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