export const mcpNativeExecuteDependencyDeclarations = [
    {
        dependencyId: "runtime.execEngine.mcp.nativeExecute",
        kind: "service",
        required: true,
        description: "Runtime-owned raw MCP dispatch. BaseTool normalizes the native request and never creates a hidden MCP client.",
    },
    {
        dependencyId: "runtime.governancePlane.mcpRawApproval",
        kind: "permission",
        required: true,
        description: "dryRun:false requires explicit guard approval because raw MCP methods can bypass fixed tool semantics.",
    },
    {
        dependencyId: "runtime.mcp.sessionTransport",
        kind: "runtime",
        required: true,
        description: "Connection, session, transport, OAuth, progress, cancellation, and raw protocol state remain owned by runtime.",
    },
];
export function createHostExecutorMcpNativeExecuteProvider(executor) {
    const nativeExecute = executor?.mcp?.nativeExecute;
    if (nativeExecute === undefined)
        return undefined;
    return async (request, context) => {
        const result = await nativeExecute({ ...request, context });
        if (!result.ok)
            throw new Error(result.error.message);
        return result.output;
    };
}
