import { type McpToolResult } from "../../_shared/baseToolAdapter.js";
export type McpCallPermission = "mcp:call" | "mcp:read" | "mcp:service";
export type McpCallMode = "tool" | "service";
export type McpCallGuard = {
    accepted?: boolean;
    allowed?: boolean;
    reason?: string;
};
export type McpCallContext = {
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    dryRun?: boolean;
    guard?: McpCallGuard;
    allowedServerIds?: readonly string[];
    grantedPermissions?: readonly McpCallPermission[];
    requestedScopes?: readonly string[];
    allowedScopes?: readonly string[];
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type McpCallTarget = {
    serverId: string;
    name: string;
    mode: McpCallMode;
    arguments?: Readonly<Record<string, unknown>>;
    timeoutMs?: number;
};
export type McpCallTargetInput = Partial<McpCallTarget> & {
    toolName?: string;
};
export type McpCallRequest = {
    target?: McpCallTargetInput | null;
    context?: McpCallContext;
};
export type McpCallProviderRequest = {
    serverId: string;
    toolName: string;
    mode: McpCallMode;
    arguments?: Readonly<Record<string, unknown>>;
    timeoutMs?: number;
};
export type McpCallProvider = (request: McpCallProviderRequest, context: Readonly<Record<string, unknown>>) => Promise<unknown> | unknown;
export type McpCallProviderContext = {
    provider?: McpCallProvider;
};
export type McpCallOutput = {
    kind: "agentCore.basicTool.mcp.call";
    target: McpCallTarget;
    requestEnvelope: {
        serverId: string;
        toolName: string;
        mode: McpCallMode;
        arguments?: Readonly<Record<string, unknown>>;
        timeoutMs?: number;
    };
    dryRun: boolean;
    executionBlocked: boolean;
    providerCalled: boolean;
    providerResult?: unknown;
    permissionsRequired: readonly McpCallPermission[];
    unsafeSideEffects: true;
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type McpCallErrorCode = "INVALID_REQUEST" | "INVALID_CONTEXT" | "MISSING_SERVER_ID" | "INVALID_SERVER_ID" | "MISSING_CALL_NAME" | "INVALID_CALL_NAME" | "INVALID_CALL_MODE" | "INVALID_ARGUMENTS" | "INVALID_TIMEOUT" | "SCOPE_REJECTED" | "PERMISSION_DENIED" | "GOVERNANCE_REJECTED" | "REAL_EXECUTION_BLOCKED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_REJECTED";
export type McpCallResult = McpToolResult<McpCallOutput, McpCallErrorCode>;
export declare const mcpCallDescriptor: {
    readonly toolId: "mcp.call";
    readonly title: "Call MCP Tool";
    readonly category: "mcpBase.execution";
    readonly purpose: "Normalize and govern a runtime-owned MCP tool invocation without creating a hidden MCP client.";
    readonly tapOwnsApproval: true;
    readonly runtimeOwnsMcpClient: true;
    readonly unsafeSideEffects: true;
    readonly requiredFields: readonly ["target.serverId", "target.name"];
    readonly canonicalStoragePath: "src/storagePool/baseToolStorage/mcpBase/execution/mcp.call/";
    readonly providerBoundary: "BaseToolExecutorPort.mcp.callTool";
};
export declare function planMcpCall(request?: unknown): McpCallResult;
export declare function executeMcpCall(request?: unknown, providerContext?: McpCallProviderContext): Promise<McpCallResult>;
