import { type McpToolResult } from "../../_shared/baseToolAdapter.js";
export type McpConnectTransport = "stdio" | "http" | "sse";
export type McpConnectPermission = "mcp:connect" | "network:connect" | "process:spawn";
export type McpConnectContext = {
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    dryRun?: boolean;
    guard?: {
        accepted?: boolean;
        allowed?: boolean;
        reason?: string;
    };
    allowedServerIds?: readonly string[];
    grantedPermissions?: readonly McpConnectPermission[];
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type McpConnectTarget = {
    serverId: string;
    connectionId?: string;
    transport?: McpConnectTransport;
    transportHint?: McpConnectTransport;
    endpoint?: string;
    command?: string;
    timeoutMs: number;
};
export type McpConnectProviderRequest = {
    serverId: string;
    connectionId?: string;
    transportHint?: McpConnectTransport;
    timeoutMs?: number;
};
export type McpConnectRequest = {
    target?: Partial<McpConnectTarget> | null;
    context?: McpConnectContext;
};
export type McpConnectEnvelope = {
    serverId: string;
    connectionId?: string;
    transport?: McpConnectTransport;
    transportHint?: McpConnectTransport;
    connectionState: "planned" | "connected" | "reused" | "pending";
    endpoint?: string;
    command?: string;
    timeoutMs: number;
    status?: string;
};
export type McpConnectProviderResult = {
    connectionId?: string;
    status: "connected" | "reused" | "pending";
    serverId?: string;
    providerMetadata?: Readonly<Record<string, unknown>>;
    raw?: unknown;
};
export type McpConnectProvider = (request: McpConnectProviderRequest, context: Readonly<Record<string, unknown>>) => Promise<McpConnectProviderResult> | McpConnectProviderResult;
export type McpConnectOutput = {
    kind: "agentCore.basicTool.mcp.connect";
    target: McpConnectTarget;
    operationPreview: McpConnectEnvelope;
    dryRun: boolean;
    executionBlocked: boolean;
    providerCalled: boolean;
    permissionsRequired: readonly McpConnectPermission[];
    unsafeSideEffects: true;
    providerMetadata?: Readonly<Record<string, unknown>>;
};
export type McpConnectErrorCode = "INVALID_REQUEST" | "INVALID_CONTEXT" | "MISSING_SERVER_ID" | "INVALID_SERVER_ID" | "MISSING_TRANSPORT" | "INVALID_TRANSPORT" | "MISSING_ENDPOINT" | "INVALID_ENDPOINT" | "MISSING_COMMAND" | "INVALID_TIMEOUT" | "SCOPE_REJECTED" | "PERMISSION_DENIED" | "GOVERNANCE_REJECTED" | "REAL_EXECUTION_BLOCKED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_REJECTED";
export type McpConnectResult = McpToolResult<McpConnectOutput, McpConnectErrorCode>;
export declare const mcpConnectDescriptor: {
    readonly toolId: "mcp.connect";
    readonly capability: "connect-mcp-server";
    readonly route: "agent_executionEngine.basic_toolLayer.baseTools.mcpBase.connection";
    readonly defaultDryRun: true;
    readonly tapOwnsApproval: true;
    readonly basePermissionsRequired: readonly ["mcp:connect"];
    readonly transportPermissions: {
        readonly stdio: readonly ["process:spawn"];
        readonly http: readonly ["network:connect"];
        readonly sse: readonly ["network:connect"];
    };
    readonly defaultTimeoutMs: 30000;
    readonly maxTimeoutMs: 120000;
};
export declare function planMcpConnect(request?: unknown): McpConnectResult;
export declare function executeMcpConnect(request?: unknown, provider?: McpConnectProvider): Promise<McpConnectResult>;
