mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
Auth helpers in src/auth/helpers.ts: envApiKeyAuth() (stored key wins, then env vars in order, with secret-prompt login) and lazyOAuth() (flow loads on first use through bundler-opaque dynamic imports in utils/oauth/load.ts; the OAuthAuth flow exports land in phase 4). There is no OAuth factory toggle: providers that support OAuth always attach it, advertising costs nothing until login/refresh runs. createProvider() in models.ts builds providers from parts: single API implementation or a map dispatched on model.api (mixed-API providers like opencode and github-copilot); unknown api yields a stream error. generate-models.ts now emits one providers/<id>.models.ts catalog per provider (35 files, biome-excluded like models.generated.ts) and models.generated.ts becomes a generated aggregator, so importing one provider factory pulls one catalog. Typed getModel globals unchanged. One factory per built-in provider under src/providers/: envApiKeyAuth for standard providers, OAuth for anthropic/openai-codex/github-copilot, ambient ApiKeyAuth for amazon-bedrock (AWS env/profile/IAM) and google-vertex (explicit key or ADC+project+location). providers/all.ts: builtinProviders(), builtinModels(), getBuiltin* re-exports. fauxProvider() factory returns a real Provider for tests; legacy registerFauxProvider() unchanged.
57 lines
2.4 KiB
TypeScript
57 lines
2.4 KiB
TypeScript
export type { Static, TSchema } from "typebox";
|
|
export { Type } from "typebox";
|
|
|
|
export * from "./api/anthropic-messages.lazy.ts";
|
|
export type { AnthropicEffort, AnthropicOptions, AnthropicThinkingDisplay } from "./api/anthropic-messages.ts";
|
|
export * from "./api/azure-openai-responses.lazy.ts";
|
|
export type { AzureOpenAIResponsesOptions } from "./api/azure-openai-responses.ts";
|
|
export * from "./api/bedrock-converse-stream.lazy.ts";
|
|
export type { BedrockOptions, BedrockThinkingDisplay } from "./api/bedrock-converse-stream.ts";
|
|
export * from "./api/google-generative-ai.lazy.ts";
|
|
export type { GoogleOptions } from "./api/google-generative-ai.ts";
|
|
export type { GoogleThinkingLevel } from "./api/google-shared.ts";
|
|
export * from "./api/google-vertex.lazy.ts";
|
|
export type { GoogleVertexOptions } from "./api/google-vertex.ts";
|
|
export * from "./api/lazy.ts";
|
|
export * from "./api/mistral-conversations.lazy.ts";
|
|
export type { MistralOptions } from "./api/mistral-conversations.ts";
|
|
export * from "./api/openai-codex-responses.lazy.ts";
|
|
export type { OpenAICodexResponsesOptions, OpenAICodexWebSocketDebugStats } from "./api/openai-codex-responses.ts";
|
|
export * from "./api/openai-completions.lazy.ts";
|
|
export type { OpenAICompletionsOptions } from "./api/openai-completions.ts";
|
|
export * from "./api/openai-responses.lazy.ts";
|
|
export type { OpenAIResponsesOptions } from "./api/openai-responses.ts";
|
|
export * from "./api-registry.ts";
|
|
export * from "./auth/context.ts";
|
|
export * from "./auth/credential-store.ts";
|
|
export * from "./auth/helpers.ts";
|
|
export * from "./auth/types.ts";
|
|
export * from "./env-api-keys.ts";
|
|
export * from "./image-models.ts";
|
|
export * from "./images.ts";
|
|
export * from "./images-api-registry.ts";
|
|
export * from "./models.ts";
|
|
export * from "./providers/faux.ts";
|
|
export * from "./providers/images/register-builtins.ts";
|
|
export * from "./session-resources.ts";
|
|
export * from "./stream.ts";
|
|
export * from "./types.ts";
|
|
export * from "./utils/diagnostics.ts";
|
|
export * from "./utils/event-stream.ts";
|
|
export * from "./utils/json-parse.ts";
|
|
export type {
|
|
OAuthAuthInfo,
|
|
OAuthCredentials,
|
|
OAuthDeviceCodeInfo,
|
|
OAuthLoginCallbacks,
|
|
OAuthPrompt,
|
|
OAuthProvider,
|
|
OAuthProviderId,
|
|
OAuthProviderInfo,
|
|
OAuthProviderInterface,
|
|
OAuthSelectOption,
|
|
OAuthSelectPrompt,
|
|
} from "./utils/oauth/types.ts";
|
|
export * from "./utils/overflow.ts";
|
|
export * from "./utils/typebox-helpers.ts";
|
|
export * from "./utils/validation.ts";
|