/** * MCP assignment resolution (issue #1137). * * Resolves the effective MCP server set for an agent execution from the * `runtime.yaml.mcp` section. The resolution rule is: * * effective servers * = defaults.servers * + matched targets.servers * - matched targets.exclude * * Server names are de-duplicated; `exclude` wins over `addition`; a target * referencing an unknown server name fails fast (order.md:93-105). * * This module owns the target resolution rule only. It does not know provider * config formats (that lives in `infra/providers/mcp/`), and it does not read * the runtime file — callers pass the already-loaded `mcp` section. */ import type { McpServerConfig } from '../../../core/models/index.js'; import { type McpSection } from './mcp-schema.js'; /** The `mcp` section shape consumed by the resolver. */ export type McpAssignmentSection = McpSection; /** Per-target entry shape shared by personas/tags/steps. */ export interface McpTargetAssignment { servers?: readonly string[]; exclude?: readonly string[]; } /** Context for resolving the effective MCP server set for one agent. */ export interface AgentExecutionContext { /** Persona name of the current agent step (undefined for control nodes). */ persona: string | undefined; /** Workflow tags active for the current step. */ tags: readonly string[]; /** Fully-qualified step name `/`. */ stepQualifiedName: string | undefined; /** True when the current node is a `workflow_call` control node (not an agent). */ isWorkflowCallNode: boolean; /** True when resolving for an internal agent (selector/assistant). */ isInternalAgent: boolean; } /** Resolved MCP server set ready to hand to a provider adapter. */ export interface ResolvedMcpServers { /** True when at least one server is assigned (MCP enabled). */ enabled: boolean; /** Resolved (env-interpolated) server configs keyed by name. */ servers: Record; /** Sorted server names (effective set, de-duplicated). */ serverNames: string[]; /** Deterministic identity including non-secret server structure. */ identity: string; } /** * Resolve the effective MCP server set for a single agent execution. * * `exclude` is applied after collecting all additions so it always wins over * `defaults` and matched target `servers` (order.md:102). Unknown server names * in `defaults`, target `servers`, or `exclude` fail fast (order.md:104). */ export declare function resolveMcpAssignment(section: McpAssignmentSection, context: AgentExecutionContext): ResolvedMcpServers; /** * Resolve the shared MCP assignment for a TAKT-owned internal agent. * * Internal agents do not have a workflow persona, tag, or step target. They * still receive `defaults.servers`, and the common internal-agent exclusion * is applied with `isInternalAgent: true`. */ export interface ResolvedInternalAgentMcpServers { servers: Record; identity: string | undefined; } export declare function resolveInternalAgentMcpServers(section: McpAssignmentSection | undefined): ResolvedInternalAgentMcpServers; //# sourceMappingURL=mcp-assignment.d.ts.map