export const mcpCancelDependencyDeclarations = [
    {
        dependencyId: "runtime.execEngine.mcp.cancelExecution",
        kind: "service",
        required: true,
        description: "Runtime-owned MCP cancellation support. BaseTool passes a normalized cancel request and never stores live handles.",
    },
    {
        dependencyId: "runtime.governancePlane.mcpApproval",
        kind: "permission",
        required: true,
        description: "dryRun:false requires explicit guard/governance approval before asking runtime to cancel.",
    },
    {
        dependencyId: "runtime.mcp.executionLifecycle",
        kind: "runtime",
        required: true,
        description: "Execution ids, cancellation handles, progress state, transports, and cleanup remain with runtime.",
    },
];
export function createHostExecutorMcpCancelProvider(executor) {
    const cancelExecution = executor?.mcp?.cancelExecution;
    if (cancelExecution === undefined)
        return undefined;
    return async (request, context) => {
        const result = await cancelExecution({ ...request, context });
        if (!result.ok)
            throw new Error(result.error.message);
        return result.output;
    };
}
