export const mcpSubscribeDependencyDeclarations = [
    {
        dependencyId: "runtime.execEngine.mcp.subscribe",
        kind: "service",
        required: true,
        description: "Runtime-owned MCP subscription support. BaseTool passes a normalized subscribe request and never owns event streams.",
    },
    {
        dependencyId: "runtime.governancePlane.mcpApproval",
        kind: "permission",
        required: true,
        description: "dryRun:false requires explicit guard/governance approval before asking runtime to subscribe.",
    },
    {
        dependencyId: "runtime.mcp.subscriptionLifecycle",
        kind: "runtime",
        required: true,
        description: "Subscription ids, notification handlers, reconnect, delivery buffers, and cleanup remain with runtime.",
    },
];
export function createHostExecutorMcpSubscribeProvider(executor) {
    const subscribe = executor?.mcp?.subscribe;
    if (subscribe === undefined)
        return undefined;
    return async (request, context) => {
        const result = await subscribe({ ...request, context });
        if (!result.ok)
            throw new Error(result.error.message);
        return result.output;
    };
}
