import { type McpToolResult } from "../../_shared/baseToolAdapter.js";
export type McpStreamPermission = "mcp:stream" | "mcp:call";
export type McpStreamChannel = "events" | "chunks";
export type McpStreamContext = {
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    dryRun?: boolean;
    guard?: {
        accepted?: boolean;
        allowed?: boolean;
        reason?: string;
    };
    contract?: {
        accepted?: boolean;
        reason?: string;
    };
    governance?: {
        accepted?: boolean;
        reason?: string;
    };
    allowedServerIds?: readonly string[];
    requestedScopes?: readonly string[];
    allowedScopes?: readonly string[];
    grantedPermissions?: readonly McpStreamPermission[];
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type McpStreamTarget = {
    serverId: string;
    name: string;
    channel: McpStreamChannel;
    arguments?: Readonly<Record<string, unknown>>;
    maxEvents?: number;
};
export type McpStreamRequest = {
    target?: Partial<McpStreamTarget> | null;
    context?: McpStreamContext;
};
export type McpStreamProviderRequest = McpStreamTarget;
export type McpStreamProviderResult = {
    executionId?: string;
    streamId?: string;
    status: "streaming" | "started" | "completed" | "pending";
    channel?: McpStreamChannel;
    chunks?: readonly unknown[];
    events?: readonly unknown[];
    providerMetadata?: Readonly<Record<string, unknown>>;
    raw?: unknown;
};
export type McpStreamProvider = (request: McpStreamProviderRequest, context: Readonly<Record<string, unknown>>) => Promise<McpStreamProviderResult> | McpStreamProviderResult;
export type McpStreamEnvelope = {
    transport: "mcp";
    operation: "stream";
    serverId: string;
    name: string;
    channel: McpStreamChannel;
    arguments: Readonly<Record<string, unknown>>;
    maxEvents?: number;
    executionId?: string;
    streamId?: string;
    state: "planned" | "streaming" | "started" | "completed" | "pending";
    chunks?: readonly unknown[];
    events?: readonly unknown[];
};
export type McpStreamOutput = {
    kind: "agentCore.basicTool.mcp.stream";
    target: McpStreamTarget;
    streamEnvelope: McpStreamEnvelope;
    dryRun: boolean;
    executionBlocked: boolean;
    providerCalled: boolean;
    permissionsRequired: readonly McpStreamPermission[];
    unsafeSideEffects: true;
    acceptedScopes: readonly string[];
    providerMetadata?: Readonly<Record<string, unknown>>;
};
export type McpStreamErrorCode = "INVALID_REQUEST" | "INVALID_CONTEXT" | "MISSING_SERVER_ID" | "INVALID_SERVER_ID" | "MISSING_STREAM_NAME" | "INVALID_STREAM_NAME" | "INVALID_CHANNEL" | "INVALID_ARGUMENTS" | "INVALID_MAX_EVENTS" | "SCOPE_REJECTED" | "PERMISSION_DENIED" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED" | "REAL_EXECUTION_BLOCKED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_REJECTED";
export type McpStreamResult = McpToolResult<McpStreamOutput, McpStreamErrorCode>;
export declare const mcpStreamDescriptor: {
    readonly toolId: "mcp.stream";
    readonly capability: "stream-mcp-execution";
    readonly route: "agent_executionEngine.basic_toolLayer.baseTools.mcpBase.execution";
    readonly defaultDryRun: true;
    readonly tapOwnsApproval: true;
    readonly runtimeOwnsMcpClient: true;
    readonly permissionsRequired: readonly ["mcp:stream", "mcp:call"];
    readonly unsafeSideEffects: true;
    readonly providerBoundary: "BaseToolExecutorPort.mcp.streamTool";
};
export declare function planMcpStream(request?: unknown): McpStreamResult;
export declare function executeMcpStream(request?: unknown, provider?: McpStreamProvider): Promise<McpStreamResult>;
