export const mcpDisconnectDependencyDeclarations = [
    { dependencyId: "runtime.execEngine.mcp.disconnect", kind: "service", required: true, description: "Runtime-owned MCP disconnect support." },
    { dependencyId: "runtime.governancePlane.mcpApproval", kind: "permission", required: true, description: "dryRun:false requires explicit guard/governance approval before asking runtime to disconnect." },
    { dependencyId: "runtime.mcp.sessionTransport", kind: "runtime", required: true, description: "Connection cleanup, transport close, cancellation, and reconnect policy remain owned by runtime." },
];
export function createHostExecutorMcpDisconnectProvider(executor) {
    const disconnect = executor?.mcp?.disconnect;
    if (disconnect === undefined)
        return undefined;
    return async (request, context) => {
        const result = await disconnect({ ...request, context });
        if (!result.ok)
            throw new Error(result.error.message);
        return result.output;
    };
}
