export const mcpAuthorizeDependencyDeclarations = [
    {
        dependencyId: "runtime.execEngine.mcp.authorize",
        kind: "service",
        required: true,
        description: "Runtime-owned MCP authorization support. BaseTool normalizes policy input and does not own product policy.",
    },
    {
        dependencyId: "runtime.governancePlane.mcpApproval",
        kind: "permission",
        required: true,
        description: "dryRun:false requires explicit guard/governance approval before asking runtime for an authorization decision.",
    },
    {
        dependencyId: "runtime.mcp.policyStore",
        kind: "runtime",
        required: true,
        description: "Subject identity, server grants, and policy decisions remain with runtime/TAP.",
    },
];
export function createHostExecutorMcpAuthorizeProvider(executor) {
    const authorize = executor?.mcp?.authorize;
    if (authorize === undefined)
        return undefined;
    return async (request, context) => {
        const result = await authorize({ ...request, context });
        if (!result.ok)
            throw new Error(result.error.message);
        return result.output;
    };
}
