import { z } from "zod"; import { type AiProviderRouting } from "./ai-provider-routing.js"; /** Runtime authentication is a separate transport, never a tool or channel. */ export declare const connectionPurposeTransportSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ connectionPurpose: z.ZodLiteral<"tool">; transport: z.ZodEnum<{ local_stdio: "local_stdio"; mcp_remote: "mcp_remote"; rest_api: "rest_api"; }>; }, z.core.$strip>, z.ZodObject<{ connectionPurpose: z.ZodLiteral<"channel">; transport: z.ZodEnum<{ chat_sdk: "chat_sdk"; rest_api: "rest_api"; voice: "voice"; }>; config: z.ZodOptional; }, z.core.$loose>>; }, z.core.$strip>, z.ZodObject<{ connectionPurpose: z.ZodLiteral<"ai">; transport: z.ZodLiteral<"runtime_auth">; }, z.core.$strip>], "connectionPurpose">; export type ConnectionPurposeTransport = z.infer; export declare const AI_PROVIDERS: readonly ["anthropic", "openai", "openrouter", "xai", "google"]; export declare const aiProviderSchema: z.ZodEnum<{ anthropic: "anthropic"; google: "google"; openai: "openai"; openrouter: "openrouter"; xai: "xai"; }>; export declare const aiAuthMethodSchema: z.ZodEnum<{ api_key: "api_key"; subscription: "subscription"; }>; export type AiProvider = z.infer; export type AiAuthMethod = z.infer; export declare const aiConnectionBindingSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ provider: z.ZodEnum<{ anthropic: "anthropic"; google: "google"; openai: "openai"; openrouter: "openrouter"; xai: "xai"; }>; method: z.ZodEnum<{ api_key: "api_key"; subscription: "subscription"; }>; mode: z.ZodLiteral<"responsible_user">; }, z.core.$strict>, z.ZodObject<{ provider: z.ZodEnum<{ anthropic: "anthropic"; google: "google"; openai: "openai"; openrouter: "openrouter"; xai: "xai"; }>; method: z.ZodEnum<{ api_key: "api_key"; subscription: "subscription"; }>; mode: z.ZodLiteral<"shared">; connectionId: z.ZodString; grantId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ provider: z.ZodEnum<{ anthropic: "anthropic"; google: "google"; openai: "openai"; openrouter: "openrouter"; xai: "xai"; }>; method: z.ZodEnum<{ api_key: "api_key"; subscription: "subscription"; }>; mode: z.ZodLiteral<"delegated">; connectionId: z.ZodString; grantId: z.ZodString; }, z.core.$strict>], "mode">; export type AiConnectionBinding = z.infer; export declare const aiConnectionMetadataSchema: z.ZodObject<{ provider: z.ZodEnum<{ anthropic: "anthropic"; google: "google"; openai: "openai"; openrouter: "openrouter"; xai: "xai"; }>; method: z.ZodEnum<{ api_key: "api_key"; subscription: "subscription"; }>; routing: z.ZodOptional; protocol: z.ZodEnum<{ bedrock: "bedrock"; chat: "chat"; messages: "messages"; responses: "responses"; }>; baseUrl: z.ZodOptional; auth: z.ZodDefault>; region: z.ZodOptional; models: z.ZodDefault; }, z.core.$strict>>>; }, z.core.$strict>>; }, z.core.$strict>; export type AiConnectionMetadata = z.infer; /** Existing integrations only. This table describes compatibility, never routing. */ export declare const AI_CONNECTION_CAPABILITIES: Record>; }>; export declare function isAiConnectionCompatible(requirement: AiConnectionMetadata | AiConnectionBinding, adapterType: string, model?: unknown, runnerProvider?: unknown, acpxAgent?: unknown): boolean; export type AiConnectionUnavailableReason = "responsible_user_missing" | "membership_missing" | "default_missing" | "connection_missing" | "connection_unavailable" | "incompatible" | "access_denied" | "credential_missing"; export interface AiConnectionAttribution { /** Billing account at execution time; never resolved again from mutable settings. */ subscriptionId?: string; connectionId: string; grantId: string; provider: AiProvider; method: AiAuthMethod; mode: AiConnectionBinding["mode"]; responsibleUserId: string | null; } export type AiConnectionResolution = { ok: true; attribution: AiConnectionAttribution; } | { ok: false; reason: AiConnectionUnavailableReason; message: string; }; export interface AiManagedConnectionSummary { id: string; grantId: string; companyId: string; provider: AiProvider; method: AiAuthMethod; name: string; routing?: AiProviderRouting; accountLabel?: string; ownership: "personal" | "shared"; ownerUserId?: string; ownerName?: string; isDefault: boolean; status: "connected" | "needs_attention" | "expired" | "revoked"; unavailableReason?: string; usageProbeSupported?: boolean; } export interface AiConnectionList { currentUserId: string; pools?: import("./ai-connection-router.js").AiConnectionPool[]; canManageConnections: boolean; connections: AiManagedConnectionSummary[]; } export declare const createAiConnectionSchema: z.ZodObject<{ provider: z.ZodEnum<{ anthropic: "anthropic"; google: "google"; openai: "openai"; openrouter: "openrouter"; xai: "xai"; }>; method: z.ZodEnum<{ api_key: "api_key"; subscription: "subscription"; }>; name: z.ZodString; ownership: z.ZodEnum<{ personal: "personal"; shared: "shared"; }>; routing: z.ZodOptional; protocol: z.ZodEnum<{ bedrock: "bedrock"; chat: "chat"; messages: "messages"; responses: "responses"; }>; baseUrl: z.ZodOptional; auth: z.ZodDefault>; region: z.ZodOptional; models: z.ZodDefault; }, z.core.$strict>>>; }, z.core.$strict>>; apiKey: z.ZodOptional; loginSessionId: z.ZodOptional; connectionId: z.ZodOptional; agentIds: z.ZodDefault>; allAgents: z.ZodDefault; }, z.core.$strict>; export type CreateAiConnection = z.infer; export declare const aiConnectionLoginIntentSchema: z.ZodObject<{ provider: z.ZodEnum<{ anthropic: "anthropic"; openai: "openai"; xai: "xai"; }>; method: z.ZodLiteral<"subscription">; name: z.ZodString; ownership: z.ZodEnum<{ personal: "personal"; shared: "shared"; }>; connectionId: z.ZodOptional; agentIds: z.ZodDefault>; allAgents: z.ZodDefault; }, z.core.$strict>; export type AiConnectionLoginIntent = z.infer; export declare const localAiConnectionSchema: z.ZodObject<{ provider: z.ZodEnum<{ anthropic: "anthropic"; openai: "openai"; xai: "xai"; }>; method: z.ZodLiteral<"subscription">; name: z.ZodString; ownership: z.ZodEnum<{ personal: "personal"; shared: "shared"; }>; connectionId: z.ZodOptional; agentIds: z.ZodDefault>; allAgents: z.ZodDefault; localSessionId: z.ZodOptional; }, z.core.$strict>; export declare const localAiLoginStartSchema: z.ZodObject<{ provider: z.ZodEnum<{ anthropic: "anthropic"; openai: "openai"; xai: "xai"; }>; method: z.ZodLiteral<"subscription">; name: z.ZodString; ownership: z.ZodEnum<{ personal: "personal"; shared: "shared"; }>; connectionId: z.ZodOptional; agentIds: z.ZodDefault>; allAgents: z.ZodDefault; restart: z.ZodOptional; }, z.core.$strict>; export interface LocalAiLoginStatus { status: "ready" | "sign_in_required" | "expired"; authorizationUrl?: string; code?: string; error?: string; } export interface LocalAiLoginAttempt { sessionId: string; /** Grok still uses terminal sign-in until it has an in-app login runner. */ command?: string; expiresAt: string; } /** Preview-era copies of rotating local credentials must be reconnected. */ export declare function aiSubscriptionNeedsIsolatedLogin(config: Record | undefined): boolean; //# sourceMappingURL=ai-connections.d.ts.map