export const mcpRegisterToolDependencyDeclarations = [
    {
        dependencyId: "runtime.execEngine.mcp.registerTool",
        kind: "service",
        required: true,
        description: "Runtime-owned MCP tool registration support. BaseTool validates and shapes the registration request only.",
    },
    {
        dependencyId: "runtime.governancePlane.mcpApproval",
        kind: "permission",
        required: true,
        description: "dryRun:false requires explicit guard approval before mutating runtime MCP tool registry state.",
    },
];
export function createHostExecutorMcpRegisterToolProvider(executor) {
    const registerTool = executor?.mcp?.registerTool;
    if (registerTool === undefined)
        return undefined;
    return async (request, context) => {
        const result = await registerTool({ ...request, context });
        if (!result.ok)
            throw new Error(result.error.message);
        return result.output;
    };
}
