import { type McpToolResult } from "../../_shared/baseToolAdapter.js";
export type McpAuthorizeAction = "call-tool" | "read-resource" | "subscribe" | "cache-access";
export type McpAuthorizePermission = "mcp:auth" | "mcp:read";
export type McpAuthorizeContext = {
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    dryRun?: boolean;
    guard?: {
        accepted?: boolean;
        allowed?: boolean;
        reason?: string;
    };
    allowedServerIds?: readonly string[];
    allowedScopes?: readonly string[];
    grantedPermissions?: readonly McpAuthorizePermission[];
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type McpAuthorizeTarget = {
    serverId: string;
    subjectId: string;
    action: McpAuthorizeAction;
    toolName?: string;
    resourceUri?: string;
    requestedScopes: readonly string[];
};
export type McpAuthorizeRequest = {
    target?: Partial<McpAuthorizeTarget> | null;
    context?: McpAuthorizeContext;
};
export type McpAuthorizeProviderResult = {
    decision: "allowed" | "denied" | "conditional" | "pending";
    reason?: string;
    policyId?: string;
    scopesGranted?: readonly string[];
    providerMetadata?: Readonly<Record<string, unknown>>;
    raw?: unknown;
};
export type McpAuthorizeProvider = (request: McpAuthorizeTarget, context: Readonly<Record<string, unknown>>) => Promise<McpAuthorizeProviderResult> | McpAuthorizeProviderResult;
export type McpAuthorizeOutput = {
    kind: "agentCore.basicTool.mcp.authorize";
    target: McpAuthorizeTarget;
    dryRun: boolean;
    executionBlocked: boolean;
    providerCalled: boolean;
    permissionsRequired: readonly McpAuthorizePermission[];
    unsafeSideEffects: false;
    authorizationGranted: boolean;
    decision: "dry-run-policy-envelope" | "allowed" | "denied" | "conditional" | "pending";
    policyInput: {
        serverId: string;
        subjectId: string;
        action: McpAuthorizeAction;
        toolName?: string;
        resourceUri?: string;
        requestedScopes: readonly string[];
    };
    policyEnvelope: {
        decision: "planned" | "allowed" | "denied" | "conditional" | "pending";
        reason?: string;
        policyId?: string;
        scopesGranted?: readonly string[];
        source: "dry-run" | "runtime-provider";
    };
    providerMetadata?: Readonly<Record<string, unknown>>;
};
export type McpAuthorizeErrorCode = "INVALID_REQUEST" | "INVALID_CONTEXT" | "MISSING_SERVER_ID" | "INVALID_SERVER_ID" | "MISSING_SUBJECT_ID" | "MISSING_AUTH_ACTION" | "INVALID_REQUESTED_SCOPES" | "SCOPE_REJECTED" | "PERMISSION_DENIED" | "GOVERNANCE_REJECTED" | "REAL_EXECUTION_BLOCKED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_REJECTED";
export type McpAuthorizeResult = McpToolResult<McpAuthorizeOutput, McpAuthorizeErrorCode>;
export declare const mcpAuthorizeDescriptor: {
    readonly toolId: "mcp.authorize";
    readonly capability: "authorize-mcp-operation";
    readonly route: "agent_executionEngine.basic_toolLayer.baseTools.mcpBase.auth";
    readonly permissionsRequired: readonly ["mcp:auth", "mcp:read"];
    readonly defaultDryRun: true;
    readonly tapOwnsApproval: true;
};
export declare function planMcpAuthorize(request?: unknown): McpAuthorizeResult;
export declare function executeMcpAuthorize(request?: unknown, provider?: McpAuthorizeProvider): Promise<McpAuthorizeResult>;
