export const mcpStreamDependencyDeclarations = [
    {
        dependencyId: "runtime.execEngine.mcp.streamTool",
        kind: "service",
        required: true,
        description: "Runtime-owned MCP streaming support. BaseTool passes a normalized stream request and never owns stream handles or buffers.",
    },
    {
        dependencyId: "runtime.governancePlane.mcpApproval",
        kind: "permission",
        required: true,
        description: "dryRun:false requires explicit guard/governance approval before asking runtime to stream.",
    },
    {
        dependencyId: "runtime.mcp.streamLifecycle",
        kind: "runtime",
        required: true,
        description: "Stream ids, progress, backpressure, cancellation handles, transports, and cleanup remain with runtime.",
    },
];
export function createHostExecutorMcpStreamProvider(executor) {
    const streamTool = executor?.mcp?.streamTool;
    if (streamTool === undefined)
        return undefined;
    return async (request, context) => {
        const result = await streamTool({ ...request, context });
        if (!result.ok)
            throw new Error(result.error.message);
        return result.output;
    };
}
