import { z } from "zod"; import { type AiConnectionBinding } from "./ai-connections.js"; import type { AiConnectionUsage } from "./ai-connection-usage.js"; export declare const aiConnectionRouterBindingSchema: z.ZodObject<{ mode: z.ZodLiteral<"router">; connectionId: z.ZodString; }, z.core.$strict>; export declare const aiRuntimeConnectionBindingSchema: z.ZodUnion; 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">, z.ZodObject<{ mode: z.ZodLiteral<"router">; connectionId: z.ZodString; }, z.core.$strict>]>; export type AiRuntimeConnectionBinding = z.infer; export declare const aiConnectionPoolMemberSchema: z.ZodObject<{ id: z.ZodString; binding: 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"> & z.ZodType<{ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "shared"; connectionId: string; grantId: string; } | { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "delegated"; connectionId: string; grantId: string; }, { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "responsible_user"; } | { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "shared"; connectionId: string; grantId: string; } | { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "delegated"; connectionId: string; grantId: string; }, z.core.$ZodTypeInternals<{ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "shared"; connectionId: string; grantId: string; } | { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "delegated"; connectionId: string; grantId: string; }, { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "responsible_user"; } | { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "shared"; connectionId: string; grantId: string; } | { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "delegated"; connectionId: string; grantId: string; }>>; profile: z.ZodObject<{ provider: z.ZodEnum<{ acpx: "acpx"; codex: "codex"; opencode: "opencode"; }>; acpxAgent: z.ZodOptional>; model: z.ZodString; effort: z.ZodOptional; }, z.core.$strict>; }, z.core.$strict>; export declare const aiConnectionPoolConfigSchema: z.ZodObject<{ name: z.ZodString; enabled: z.ZodDefault; mode: z.ZodDefault>; thresholdPercent: z.ZodDefault; members: z.ZodArray; 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"> & z.ZodType<{ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "shared"; connectionId: string; grantId: string; } | { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "delegated"; connectionId: string; grantId: string; }, { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "responsible_user"; } | { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "shared"; connectionId: string; grantId: string; } | { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "delegated"; connectionId: string; grantId: string; }, z.core.$ZodTypeInternals<{ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "shared"; connectionId: string; grantId: string; } | { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "delegated"; connectionId: string; grantId: string; }, { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "responsible_user"; } | { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "shared"; connectionId: string; grantId: string; } | { provider: "anthropic" | "google" | "openai" | "openrouter" | "xai"; method: "api_key" | "subscription"; mode: "delegated"; connectionId: string; grantId: string; }>>; profile: z.ZodObject<{ provider: z.ZodEnum<{ acpx: "acpx"; codex: "codex"; opencode: "opencode"; }>; acpxAgent: z.ZodOptional>; model: z.ZodString; effort: z.ZodOptional; }, z.core.$strict>; }, z.core.$strict>>; }, z.core.$strict>; export type AiConnectionPoolMember = z.infer; export type AiConnectionPoolConfig = z.infer; export interface AiConnectionPool extends AiConnectionPoolConfig { id: string; companyId: string; pluginKey: string; revision: number; } /** Host-authorized metadata only. No credentials or raw provider responses. */ export interface AiConnectionRouterRequest { companyId: string; pool: AiConnectionPool; agentId: string; taskKey: string; lastMemberId: string | null; cursorVersion: number; /** Opaque IDs preserve order without exposing unauthorized account metadata. */ memberOrder: string[]; pinnedMemberId?: string; candidates: Array<{ member: AiConnectionPoolMember; runtimeConfig: Record; notes: string[]; usage?: AiConnectionUsage; }>; now: string; } export type AiConnectionRouterResult = { kind: "selected"; memberId: string; skipped?: Record; } | { kind: "exhausted"; retryAt: string; skipped: Record; } | { kind: "unavailable"; skipped: Record; }; export interface AiConnectionPoolSaveInput { companyId: string; id?: string; expectedRevision?: number; config: AiConnectionPoolConfig; } export interface AiConnectionRouterSelection { poolId: string; memberId: string; binding: AiConnectionBinding; runtimeConfig: Record; notes: string[]; } /** Stable, collision-free catalog identity across plugin reinstallations. */ export declare function aiConnectionRouterSlug(pluginKey: string): string; export declare function aiConnectionRouterAppDefinition(pluginKey: string, descriptor: { name: string; description: string; }, availability?: { available: boolean; reason?: string; }): import("./types/app-definition.js").AppDefinition; export declare function aiConnectionRouterPluginKey(connection: { config?: Record | null; }): string | null; //# sourceMappingURL=ai-connection-router.d.ts.map