export const mcpConnectDependencyDeclarations = [
    {
        dependencyId: "runtime.execEngine.mcp.connect",
        kind: "service",
        required: true,
        description: "Runtime-owned MCP connection support. BaseTool passes a normalized connection request and never creates a hidden MCP client.",
    },
    {
        dependencyId: "runtime.governancePlane.mcpApproval",
        kind: "permission",
        required: true,
        description: "dryRun:false requires explicit guard/governance approval before asking runtime to connect.",
    },
    {
        dependencyId: "runtime.mcp.sessionTransport",
        kind: "runtime",
        required: true,
        description: "Session, transport, OAuth, reconnect, and progress ownership remain with runtime.",
    },
];
export function createHostExecutorMcpConnectProvider(executor) {
    const connect = executor?.mcp?.connect;
    if (connect === undefined)
        return undefined;
    return async (request, context) => {
        const result = await connect({ ...request, context });
        if (!result.ok)
            throw new Error(result.error.message);
        return result.output;
    };
}
