"""Which extra tools each role gets beyond the Execution tools. Increment 6 adds the local general and cloud-read tools and remote MCP servers here. """ from __future__ import annotations from collections.abc import Mapping, Sequence from app.agents.roles import PILLAR_ADVISOR from app.agents.runtime import AgentRuntime, RoleSpec, ToolSpec from app.execution.deliverables import DeliverableKind from app.execution.graph import ToolFactory from app.execution.pillars import pillar_consultation_tool def make_tool_factory( runtime: AgentRuntime, roles: Mapping[str, RoleSpec], pillar_skills: Mapping[str, str], ) -> ToolFactory: consult = ( pillar_consultation_tool(runtime, roles[PILLAR_ADVISOR], pillar_skills) if pillar_skills and PILLAR_ADVISOR in roles else None ) def tools_for(role: RoleSpec, deliverable: str | None) -> Sequence[ToolSpec]: if consult and deliverable == DeliverableKind.DESIGN_RECOMMENDATIONS.value: return [consult] return [] return tools_for