import { r as KlawConfig } from "./types.klaw-xKUw_Rz7.js"; import { y as ResolvedProviderRuntimeAuth } from "./types-core-BH2BbD0A.js"; import { n as TransientProviderRetryConfig } from "./operation-retry-A5qTbPGF.js"; import { d as resolveApiKeyForProvider$1 } from "./model-auth-CPed-SwA.js"; import { Api, Model } from "@earendil-works/pi-ai"; //#region src/plugins/runtime/runtime-model-auth.runtime.d.ts /** * Resolve request-ready auth for a runtime model, applying any provider-owned * `prepareRuntimeAuth` exchange on top of the standard credential lookup. */ declare function getRuntimeAuthForModel$1(params: { model: Model; cfg?: KlawConfig; workspaceDir?: string; }): Promise; //#endregion //#region src/agents/api-key-rotation.d.ts type ApiKeyRetryParams = { apiKey: string; error: unknown; attempt: number; }; type ExecuteWithApiKeyRotationOptions = { provider: string; apiKeys: string[]; execute: (apiKey: string) => Promise; shouldRetry?: (params: ApiKeyRetryParams & { message: string; }) => boolean; onRetry?: (params: ApiKeyRetryParams & { message: string; }) => void; transientRetry?: TransientProviderRetryConfig; }; declare function collectProviderApiKeysForExecution(params: { provider: string; primaryApiKey?: string; }): string[]; declare function executeWithApiKeyRotation(params: ExecuteWithApiKeyRotationOptions): Promise; //#endregion //#region src/plugin-sdk/provider-auth-runtime.d.ts type OAuthCallbackResult = { code: string; state: string; }; declare function buildOAuthCallbackOriginResolver(allowedHosts: readonly string[] | undefined): (originHeader: string | string[] | undefined) => string | undefined; declare function generateOAuthState(): string; declare function parseOAuthCallbackInput(input: string, messages?: { missingState?: string; invalidInput?: string; }): OAuthCallbackResult | { error: string; }; declare function waitForLocalOAuthCallback(params: { expectedState: string; timeoutMs: number; port: number; callbackPath: string; redirectUri: string; successTitle: string; progressMessage?: string; hostname?: string; onProgress?: (message: string) => void; corsOriginAllowlist?: readonly string[]; }): Promise; type ResolveApiKeyForProvider = typeof resolveApiKeyForProvider$1; type GetRuntimeAuthForModel = typeof getRuntimeAuthForModel$1; declare function resolveApiKeyForProvider(params: Parameters[0]): Promise>>; declare function getRuntimeAuthForModel(params: Parameters[0]): Promise>>; //#endregion export { parseOAuthCallbackInput as a, collectProviderApiKeysForExecution as c, getRuntimeAuthForModel as i, executeWithApiKeyRotation as l, buildOAuthCallbackOriginResolver as n, resolveApiKeyForProvider as o, generateOAuthState as r, waitForLocalOAuthCallback as s, OAuthCallbackResult as t };