@oh-my-pi/pi-ai 15.10.4 → 15.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -2
- package/dist/types/auth-broker/remote-store.d.ts +1 -1
- package/dist/types/auth-storage.d.ts +1 -1
- package/dist/types/index.d.ts +1 -2
- package/dist/types/provider-models/descriptors.d.ts +8 -46
- package/dist/types/provider-models/discovery-constants.d.ts +11 -0
- package/dist/types/provider-models/openai-compat.d.ts +7 -3
- package/dist/types/providers/anthropic.d.ts +4 -24
- package/dist/types/registry/alibaba-coding-plan.d.ts +15 -0
- package/dist/types/registry/amazon-bedrock.d.ts +6 -0
- package/dist/types/registry/anthropic.d.ts +13 -0
- package/dist/types/{utils/oauth → registry}/api-key-login.d.ts +8 -2
- package/dist/types/{utils/oauth → registry}/api-key-validation.d.ts +11 -0
- package/dist/types/registry/cerebras.d.ts +15 -0
- package/dist/types/registry/cloudflare-ai-gateway.d.ts +21 -0
- package/dist/types/registry/cursor.d.ts +16 -0
- package/dist/types/registry/deepseek.d.ts +16 -0
- package/dist/types/registry/derived.d.ts +5 -0
- package/dist/types/registry/firepass.d.ts +20 -0
- package/dist/types/registry/fireworks.d.ts +15 -0
- package/dist/types/registry/github-copilot.d.ts +11 -0
- package/dist/types/registry/gitlab-duo.d.ts +11 -0
- package/dist/types/registry/google-antigravity.d.ts +11 -0
- package/dist/types/registry/google-gemini-cli.d.ts +11 -0
- package/dist/types/registry/google-vertex.d.ts +9 -0
- package/dist/types/registry/google.d.ts +8 -0
- package/dist/types/registry/groq.d.ts +8 -0
- package/dist/types/registry/huggingface.d.ts +15 -0
- package/dist/types/registry/index.d.ts +4 -0
- package/dist/types/registry/kagi.d.ts +14 -0
- package/dist/types/registry/kilo.d.ts +16 -0
- package/dist/types/registry/kimi-code.d.ts +14 -0
- package/dist/types/registry/litellm.d.ts +22 -0
- package/dist/types/registry/lm-studio.d.ts +13 -0
- package/dist/types/registry/minimax-code-cn.d.ts +8 -0
- package/dist/types/registry/minimax-code.d.ts +8 -0
- package/dist/types/registry/minimax.d.ts +6 -0
- package/dist/types/registry/mistral.d.ts +8 -0
- package/dist/types/registry/moonshot.d.ts +15 -0
- package/dist/types/registry/nanogpt.d.ts +15 -0
- package/dist/types/registry/nvidia.d.ts +15 -0
- package/dist/types/{utils → registry}/oauth/index.d.ts +1 -0
- package/dist/types/{utils → registry}/oauth/types.d.ts +4 -1
- package/dist/types/registry/ollama-cloud.d.ts +16 -0
- package/dist/types/registry/ollama.d.ts +17 -0
- package/dist/types/registry/openai-codex-device.d.ts +8 -0
- package/dist/types/registry/openai-codex.d.ts +12 -0
- package/dist/types/registry/openai.d.ts +8 -0
- package/dist/types/registry/opencode-go.d.ts +10 -0
- package/dist/types/registry/opencode-zen.d.ts +10 -0
- package/dist/types/registry/openrouter.d.ts +22 -0
- package/dist/types/registry/parallel.d.ts +14 -0
- package/dist/types/registry/perplexity.d.ts +7 -0
- package/dist/types/registry/qianfan.d.ts +15 -0
- package/dist/types/registry/qwen-portal.d.ts +16 -0
- package/dist/types/registry/registry.d.ts +553 -0
- package/dist/types/registry/synthetic.d.ts +15 -0
- package/dist/types/registry/tavily.d.ts +14 -0
- package/dist/types/registry/together.d.ts +14 -0
- package/dist/types/registry/types.d.ts +107 -0
- package/dist/types/registry/venice.d.ts +22 -0
- package/dist/types/registry/vercel-ai-gateway.d.ts +16 -0
- package/dist/types/registry/vllm.d.ts +16 -0
- package/dist/types/registry/wafer-pass.d.ts +15 -0
- package/dist/types/registry/wafer-serverless.d.ts +15 -0
- package/dist/types/registry/xai-oauth.d.ts +16 -0
- package/dist/types/registry/xai.d.ts +8 -0
- package/dist/types/registry/xiaomi-token-plan-ams.d.ts +10 -0
- package/dist/types/registry/xiaomi-token-plan-cn.d.ts +10 -0
- package/dist/types/registry/xiaomi-token-plan-sgp.d.ts +10 -0
- package/dist/types/registry/xiaomi.d.ts +14 -0
- package/dist/types/registry/zai.d.ts +15 -0
- package/dist/types/registry/zenmux.d.ts +15 -0
- package/dist/types/registry/zhipu-coding-plan.d.ts +15 -0
- package/dist/types/types.d.ts +3 -2
- package/package.json +16 -8
- package/src/auth-broker/remote-store.ts +1 -1
- package/src/auth-storage.ts +22 -336
- package/src/index.ts +1 -7
- package/src/models.json +11 -11
- package/src/provider-models/descriptors.ts +37 -358
- package/src/provider-models/discovery-constants.ts +11 -0
- package/src/provider-models/openai-compat.ts +18 -7
- package/src/providers/anthropic.ts +499 -245
- package/src/providers/github-copilot-headers.ts +1 -1
- package/src/providers/kimi.ts +1 -1
- package/src/providers/openai-codex-responses.ts +114 -6
- package/src/providers/openai-completions.ts +2 -2
- package/src/providers/openai-responses.ts +1 -1
- package/src/{utils/oauth → registry}/alibaba-coding-plan.ts +13 -18
- package/src/registry/amazon-bedrock.ts +23 -0
- package/src/registry/anthropic.ts +29 -0
- package/src/{utils/oauth → registry}/api-key-login.ts +22 -3
- package/src/{utils/oauth → registry}/api-key-validation.ts +52 -0
- package/src/registry/cerebras.ts +28 -0
- package/src/{utils/oauth → registry}/cloudflare-ai-gateway.ts +13 -12
- package/src/registry/cursor.ts +25 -0
- package/src/{utils/oauth → registry}/deepseek.ts +14 -17
- package/src/registry/derived.ts +9 -0
- package/src/{utils/oauth → registry}/firepass.ts +14 -2
- package/src/registry/fireworks.ts +27 -0
- package/src/registry/github-copilot.ts +26 -0
- package/src/registry/gitlab-duo.ts +21 -0
- package/src/registry/google-antigravity.ts +23 -0
- package/src/registry/google-gemini-cli.ts +23 -0
- package/src/registry/google-vertex.ts +42 -0
- package/src/registry/google.ts +10 -0
- package/src/registry/groq.ts +10 -0
- package/src/{utils/oauth → registry}/huggingface.ts +14 -19
- package/src/registry/index.ts +4 -0
- package/src/{utils/oauth → registry}/kagi.ts +9 -11
- package/src/{utils/oauth → registry}/kilo.ts +13 -4
- package/src/registry/kimi-code.ts +21 -0
- package/src/{utils/oauth → registry}/litellm.ts +13 -12
- package/src/registry/lm-studio.ts +35 -0
- package/src/registry/minimax-code-cn.ts +14 -0
- package/src/registry/minimax-code.ts +14 -0
- package/src/registry/minimax.ts +8 -0
- package/src/registry/mistral.ts +10 -0
- package/src/registry/moonshot.ts +27 -0
- package/src/registry/nanogpt.ts +27 -0
- package/src/{utils/oauth → registry}/nvidia.ts +13 -18
- package/src/registry/oauth/index.ts +164 -0
- package/src/{utils → registry}/oauth/minimax-code.ts +1 -1
- package/src/{utils → registry}/oauth/types.ts +5 -51
- package/src/{utils → registry}/oauth/wafer.ts +1 -1
- package/src/{utils/oauth → registry}/ollama-cloud.ts +13 -1
- package/src/{utils/oauth → registry}/ollama.ts +13 -13
- package/src/registry/openai-codex-device.ts +18 -0
- package/src/registry/openai-codex.ts +22 -0
- package/src/registry/openai.ts +10 -0
- package/src/registry/opencode-go.ts +16 -0
- package/src/registry/opencode-zen.ts +16 -0
- package/src/{utils/oauth → registry}/openrouter.ts +15 -2
- package/src/{utils/oauth → registry}/parallel.ts +9 -11
- package/src/registry/perplexity.ts +13 -0
- package/src/{utils/oauth → registry}/qianfan.ts +13 -17
- package/src/{utils/oauth → registry}/qwen-portal.ts +18 -19
- package/src/registry/registry.ts +141 -0
- package/src/registry/synthetic.ts +27 -0
- package/src/{utils/oauth → registry}/tavily.ts +10 -12
- package/src/registry/together.ts +27 -0
- package/src/registry/types.ts +118 -0
- package/src/{utils/oauth → registry}/venice.ts +13 -12
- package/src/{utils/oauth → registry}/vercel-ai-gateway.ts +13 -18
- package/src/{utils/oauth → registry}/vllm.ts +14 -16
- package/src/registry/wafer-pass.ts +17 -0
- package/src/registry/wafer-serverless.ts +21 -0
- package/src/registry/xai-oauth.ts +27 -0
- package/src/registry/xai.ts +10 -0
- package/src/registry/xiaomi-token-plan-ams.ts +17 -0
- package/src/registry/xiaomi-token-plan-cn.ts +17 -0
- package/src/registry/xiaomi-token-plan-sgp.ts +17 -0
- package/src/registry/xiaomi.ts +17 -0
- package/src/{utils/oauth → registry}/zai.ts +13 -20
- package/src/registry/zenmux.ts +27 -0
- package/src/{utils/oauth/zhipu.ts → registry/zhipu-coding-plan.ts} +14 -21
- package/src/stream.ts +14 -110
- package/src/types.ts +7 -55
- package/src/usage/github-copilot.ts +2 -1
- package/src/usage/kimi.ts +1 -1
- package/src/utils/discovery/gemini.ts +1 -1
- package/src/utils/discovery/openai-compatible.ts +1 -1
- package/src/utils/idle-iterator.ts +11 -0
- package/dist/types/utils/oauth/alibaba-coding-plan.d.ts +0 -18
- package/dist/types/utils/oauth/cerebras.d.ts +0 -1
- package/dist/types/utils/oauth/cloudflare-ai-gateway.d.ts +0 -18
- package/dist/types/utils/oauth/deepseek.d.ts +0 -10
- package/dist/types/utils/oauth/firepass.d.ts +0 -1
- package/dist/types/utils/oauth/fireworks.d.ts +0 -1
- package/dist/types/utils/oauth/huggingface.d.ts +0 -19
- package/dist/types/utils/oauth/kagi.d.ts +0 -17
- package/dist/types/utils/oauth/kilo.d.ts +0 -5
- package/dist/types/utils/oauth/litellm.d.ts +0 -18
- package/dist/types/utils/oauth/lm-studio.d.ts +0 -17
- package/dist/types/utils/oauth/moonshot.d.ts +0 -1
- package/dist/types/utils/oauth/nanogpt.d.ts +0 -1
- package/dist/types/utils/oauth/nvidia.d.ts +0 -18
- package/dist/types/utils/oauth/ollama-cloud.d.ts +0 -2
- package/dist/types/utils/oauth/ollama.d.ts +0 -18
- package/dist/types/utils/oauth/openrouter.d.ts +0 -1
- package/dist/types/utils/oauth/parallel.d.ts +0 -17
- package/dist/types/utils/oauth/qianfan.d.ts +0 -17
- package/dist/types/utils/oauth/qwen-portal.d.ts +0 -19
- package/dist/types/utils/oauth/synthetic.d.ts +0 -1
- package/dist/types/utils/oauth/tavily.d.ts +0 -17
- package/dist/types/utils/oauth/together.d.ts +0 -1
- package/dist/types/utils/oauth/venice.d.ts +0 -18
- package/dist/types/utils/oauth/vercel-ai-gateway.d.ts +0 -18
- package/dist/types/utils/oauth/vllm.d.ts +0 -16
- package/dist/types/utils/oauth/zai.d.ts +0 -18
- package/dist/types/utils/oauth/zenmux.d.ts +0 -1
- package/dist/types/utils/oauth/zhipu.d.ts +0 -18
- package/src/utils/oauth/cerebras.ts +0 -16
- package/src/utils/oauth/fireworks.ts +0 -15
- package/src/utils/oauth/index.ts +0 -502
- package/src/utils/oauth/lm-studio.ts +0 -38
- package/src/utils/oauth/moonshot.ts +0 -23
- package/src/utils/oauth/nanogpt.ts +0 -15
- package/src/utils/oauth/synthetic.ts +0 -15
- package/src/utils/oauth/together.ts +0 -16
- package/src/utils/oauth/zenmux.ts +0 -15
- /package/dist/types/{utils → registry}/oauth/__tests__/xai-oauth.test.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/anthropic.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/callback-server.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/cursor.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/github-copilot.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/gitlab-duo.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/google-antigravity.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/google-gemini-cli.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/google-oauth-shared.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/kimi.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/minimax-code.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/openai-codex.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/opencode.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/perplexity.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/pkce.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/wafer.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/xai-oauth.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/xiaomi.d.ts +0 -0
- /package/src/{utils → registry}/oauth/__tests__/xai-oauth.test.ts +0 -0
- /package/src/{utils → registry}/oauth/anthropic.ts +0 -0
- /package/src/{utils → registry}/oauth/callback-server.ts +0 -0
- /package/src/{utils → registry}/oauth/cursor.ts +0 -0
- /package/src/{utils → registry}/oauth/github-copilot.ts +0 -0
- /package/src/{utils → registry}/oauth/gitlab-duo.ts +0 -0
- /package/src/{utils → registry}/oauth/google-antigravity.ts +0 -0
- /package/src/{utils → registry}/oauth/google-gemini-cli.ts +0 -0
- /package/src/{utils → registry}/oauth/google-oauth-shared.ts +0 -0
- /package/src/{utils → registry}/oauth/kimi.ts +0 -0
- /package/src/{utils → registry}/oauth/oauth.html +0 -0
- /package/src/{utils → registry}/oauth/openai-codex.ts +0 -0
- /package/src/{utils → registry}/oauth/opencode.ts +0 -0
- /package/src/{utils → registry}/oauth/perplexity.ts +0 -0
- /package/src/{utils → registry}/oauth/pkce.ts +0 -0
- /package/src/{utils → registry}/oauth/xai-oauth.ts +0 -0
- /package/src/{utils → registry}/oauth/xiaomi.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [15.10.5] - 2026-06-08
|
|
6
|
+
|
|
7
|
+
### Breaking Changes
|
|
8
|
+
|
|
9
|
+
- Renamed the OAuth subpath export `@oh-my-pi/pi-ai/utils/oauth` → `@oh-my-pi/pi-ai/oauth` (and `@oh-my-pi/pi-ai/utils/oauth/*` → `@oh-my-pi/pi-ai/oauth/*`, e.g. `oauth/types`, `oauth/callback-server`, `oauth/openai-codex`) after relocating the OAuth implementation out of `utils/oauth/` into `registry/oauth/`. The high-level OAuth API (`getOAuthProviders`, `refreshOAuthToken`, `getOAuthApiKey`, `registerOAuthProvider`, `unregisterOAuthProviders`, `getOAuthProvider`) and the `OAuth*` types stay exported from the package root, unchanged.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Changed Anthropic retry handling to avoid retrying 4xx responses other than 408 and 429
|
|
14
|
+
- Optimized the Anthropic `cch` attestation patch to locate the billing-header placeholder with native `Buffer.indexOf` (memmem) instead of a hand-rolled byte loop. The marker sits ~99% through the body (`messages` serializes before `system`), so the old scan walked almost the entire payload; output bytes are unchanged but the patch is ~7.5x faster (563µs -> 75µs on a 1MB body).
|
|
15
|
+
- Refactored provider configuration to a single-source registry (`registry/`, renamed from `provider-registry/` with its `providers/` subdir flattened up). The `KnownProvider`/`OAuthProvider` type unions, `PROVIDER_DESCRIPTORS`, `DEFAULT_MODEL_PER_PROVIDER`, the `serviceProviderMap` env-key fallbacks, the `/login` provider list (`builtInOAuthProviders`), and the `refreshOAuthToken`/`AuthStorage.login` dispatch are all derived from it. Provider defs live directly under `registry/`; thin provider-specific login flows are inlined into the def file, while heavier provider-local OAuth flows and the shared OAuth flow infra (`callback-server`, `pkce`, `google-oauth-shared`, `types`, runtime `index`) now live together under `registry/oauth/` (previously split across `provider-registry/providers/oauth/` and `utils/oauth/`). The non-OAuth API-key paste/validation helpers (`api-key-login`, `api-key-validation`) sit beside the defs in `registry/`. Adding a provider that reuses an existing wire API is now one new provider def plus one registry entry in the common case. Exposes `PROVIDER_REGISTRY`, `getProviderDefinition`, `ProviderDefinition`, and `PASTE_CODE_LOGIN_PROVIDERS`.
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Disabled OpenAI Codex Responses stream obfuscation by sending `stream_options.include_obfuscation=false`, reducing raw WebSocket/SSE debug noise and bandwidth.
|
|
20
|
+
- Interrupted OpenAI Codex Responses streams that emit long runs of whitespace-only tool-call argument deltas, preventing degenerate WebSocket/SSE responses from filling the raw stream buffer indefinitely.
|
|
21
|
+
- Preserved streaming responses when Anthropic emits unrecognized content_block envelopes by ignoring unknown blocks and continuing to emit known content
|
|
22
|
+
- Applied cache control to the most recent tool result block when building Anthropic OAuth payloads without a preceding text block, enabling ephemeral caching for tool-result-only messages
|
|
23
|
+
- Kept Anthropic sampling parameters (temperature, top_p, top_k) when thinking is explicitly disabled
|
|
24
|
+
- Fixed raw Anthropic SSE handling by parsing event frames with strict JSON parsing and matching event-type validation, surfacing malformed frames as stream errors instead of repairing them
|
|
25
|
+
- Fixed Anthropic stream envelope handling to reject duplicate `content_block_start` indexes and block deltas/stops for unopened blocks, preventing malformed envelope states from producing partial output
|
|
26
|
+
- Fixed Anthropic image conversion to normalize `image/jpg` to `image/jpeg` and emit a placeholder for unsupported image MIME types
|
|
27
|
+
- Fixed Anthropic thinking request preparation by clamping `max_tokens` to provider/model limits and adjusting thinking budgets to a valid value
|
|
28
|
+
- Fixed Anthropic request shaping around forced tool choice, unsigned thinking replay, prompt-cache marker placement, non-Anthropic bearer gateways, Foundry TLS loading, and strict tool-schema normalization so malformed or incompatible request payloads are rejected locally or shaped consistently before streaming
|
|
29
|
+
- Fixed the Anthropic stream parser shipping a truncated tool call as a completed turn. When a transport drop cut the SSE stream mid-`tool_use` and a transparent reconnect spliced a fresh message envelope onto the same stream, the duplicate `message_start` was deduped but the orphaned tool block — which never received its `content_block_stop` — survived in the assistant message with its seed `{}` (or partially-parsed) arguments. The terminal stop signal from the reconnect then let it flow through as a normal tool call, so e.g. a `read` dispatched with `{}` failed downstream validation (`path: expected string, received undefined`). The parser now treats any tool block left open at stream end as a truncated envelope and routes it through the existing retry/error path instead of emitting bogus arguments.
|
|
30
|
+
- Fixed the Zhipu Coding Plan login prompt advertising a misleading `sk-...` placeholder. Zhipu API keys are formatted `<id>.<secret>` (no `sk-` prefix), so the placeholder now matches the actual format instead of suggesting the wrong shape. ([#2106](https://github.com/can1357/oh-my-pi/issues/2106))
|
|
31
|
+
- Fixed Moonshot `kimi-k2.6` (and any future `kimi-k2.x`) discovered via `MOONSHOT_API_KEY` stalling on first turn with no output. The `moonshotModelManagerOptions` discovery mapper only marked ids containing `"thinking"` as `reasoning: true`, so dynamic `kimi-k2.6` entries fell through with `reasoning: false`; the openai-completions z.ai branch was then skipped and the request reached Moonshot with no `thinking` parameter at all. Moonshot K2.6 requires an explicit `thinking: {type}` field (the same native-API wire shape #1838 introduced `thinking.keep` for), so the server held the stream silently. The mapper now stamps `reasoning: true`, vision input, and default `thinking` metadata on every `kimi-k2.x` id, restoring the explicit `thinking: {type: "disabled"|"enabled"}` wire body the Moonshot endpoint expects. ([#2113](https://github.com/can1357/oh-my-pi/issues/2113))
|
|
32
|
+
|
|
5
33
|
## [15.10.4] - 2026-06-08
|
|
34
|
+
|
|
6
35
|
### Added
|
|
7
36
|
|
|
8
37
|
- Added `anthropic-client-platform` (`desktop_app`) and `anthropic-client-version` (`1.11187.4`) headers to the Anthropic request fingerprint for OAuth sessions
|
|
@@ -20,8 +49,8 @@
|
|
|
20
49
|
- Removed the synthetic `<turn-aborted>` developer guidance note that `transformMessages` injected after an aborted/errored assistant turn (and its `turn-aborted-guidance.md` prompt). The per-call synthetic `"aborted"` tool results already tell the model the turn's tools were terminated, so the extra "verify current state before retrying" note was redundant — and it biased the model toward second-guessing a deliberate user interrupt when the turn was resumed.
|
|
21
50
|
- Removed the legacy Anthropic first-user-message skip for `<system-reminder>` blocks now that synthetic reminders no longer travel as user messages.
|
|
22
51
|
|
|
23
|
-
|
|
24
52
|
## [15.10.2] - 2026-06-08
|
|
53
|
+
|
|
25
54
|
### Added
|
|
26
55
|
|
|
27
56
|
- Added support for `impersonated_service_account` Application Default Credentials (ADC) in Vertex AI to enable chained impersonation without failing via 401 `invalid_client`.
|
|
@@ -3045,4 +3074,4 @@ _Dedicated to Peter's shoulder ([@steipete](https://twitter.com/steipete))_
|
|
|
3045
3074
|
|
|
3046
3075
|
## [0.9.4] - 2025-11-26
|
|
3047
3076
|
|
|
3048
|
-
Initial release with multi-provider LLM support.
|
|
3077
|
+
Initial release with multi-provider LLM support.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type AuthCredential, type AuthCredentialStore, type OAuthCredential, type StoredAuthCredential } from "../auth-storage";
|
|
2
|
+
import type { OAuthCredentials } from "../registry/oauth/types";
|
|
2
3
|
import type { Provider } from "../types";
|
|
3
4
|
import type { UsageReport } from "../usage";
|
|
4
|
-
import type { OAuthCredentials } from "../utils/oauth/types";
|
|
5
5
|
import { type AuthBrokerClient } from "./client";
|
|
6
6
|
import type { SnapshotResponse } from "./types";
|
|
7
7
|
export interface RemoteAuthCredentialStoreOptions {
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { Database } from "bun:sqlite";
|
|
11
11
|
import type { ApiKeyResolver } from "./auth-retry";
|
|
12
|
+
import type { OAuthController, OAuthCredentials, OAuthProviderId } from "./registry/oauth/types";
|
|
12
13
|
import type { Provider } from "./types";
|
|
13
14
|
import type { CredentialRankingStrategy, UsageLogger, UsageProvider, UsageReport } from "./usage";
|
|
14
|
-
import type { OAuthController, OAuthCredentials, OAuthProviderId } from "./utils/oauth/types";
|
|
15
15
|
export type ApiKeyCredential = {
|
|
16
16
|
type: "api_key";
|
|
17
17
|
key: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export * from "./providers/openai-completions";
|
|
|
29
29
|
export * from "./providers/openai-responses";
|
|
30
30
|
export * from "./providers/synthetic";
|
|
31
31
|
export * from "./rate-limit-utils";
|
|
32
|
+
export * from "./registry";
|
|
32
33
|
export * from "./stream";
|
|
33
34
|
export * from "./types";
|
|
34
35
|
export * from "./usage";
|
|
@@ -43,8 +44,6 @@ export * from "./usage/zai";
|
|
|
43
44
|
export * from "./utils/anthropic-auth";
|
|
44
45
|
export * from "./utils/discovery";
|
|
45
46
|
export * from "./utils/event-stream";
|
|
46
|
-
export * from "./utils/oauth";
|
|
47
|
-
export type { OAuthCredentials, OAuthProvider, OAuthProviderId, OAuthProviderInfo, } from "./utils/oauth/types";
|
|
48
47
|
export * from "./utils/overflow";
|
|
49
48
|
export * from "./utils/retry";
|
|
50
49
|
export * from "./utils/schema";
|
|
@@ -1,50 +1,12 @@
|
|
|
1
|
+
import type { ProviderDescriptor } from "../registry/types";
|
|
2
|
+
import type { KnownProvider } from "../types";
|
|
3
|
+
export * from "../registry/types";
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
import type { ModelManagerOptions } from "../model-manager";
|
|
7
|
-
import type { Api, KnownProvider } from "../types";
|
|
8
|
-
import type { OAuthProvider } from "../utils/oauth/types";
|
|
9
|
-
/** Catalog discovery configuration for providers that support endpoint-based model listing. */
|
|
10
|
-
export interface CatalogDiscoveryConfig {
|
|
11
|
-
/** Human-readable name for log messages. */
|
|
12
|
-
label: string;
|
|
13
|
-
/** Environment variables to check for API keys during catalog generation. */
|
|
14
|
-
envVars: string[];
|
|
15
|
-
/** OAuth provider for credential refresh during catalog generation. */
|
|
16
|
-
oauthProvider?: OAuthProvider;
|
|
17
|
-
/** When true, catalog discovery proceeds even without credentials. */
|
|
18
|
-
allowUnauthenticated?: boolean;
|
|
19
|
-
}
|
|
20
|
-
/** Unified provider descriptor used by both runtime discovery and catalog generation. */
|
|
21
|
-
export interface ProviderDescriptor {
|
|
22
|
-
providerId: KnownProvider;
|
|
23
|
-
createModelManagerOptions(config: {
|
|
24
|
-
apiKey?: string;
|
|
25
|
-
baseUrl?: string;
|
|
26
|
-
}): ModelManagerOptions<Api>;
|
|
27
|
-
/** Preferred model ID when no explicit selection is made. */
|
|
28
|
-
defaultModel: string;
|
|
29
|
-
/** When true, the runtime creates a model manager even without a valid API key (e.g. ollama). */
|
|
30
|
-
allowUnauthenticated?: boolean;
|
|
31
|
-
/** When true, successful runtime discovery replaces bundled provider models instead of merging fallback-only IDs. */
|
|
32
|
-
dynamicModelsAuthoritative?: boolean;
|
|
33
|
-
/** Catalog discovery configuration. Only providers with this field participate in generate-models.ts. */
|
|
34
|
-
catalogDiscovery?: CatalogDiscoveryConfig;
|
|
35
|
-
}
|
|
36
|
-
/** A provider descriptor that has catalog discovery configured. */
|
|
37
|
-
export type CatalogProviderDescriptor = ProviderDescriptor & {
|
|
38
|
-
catalogDiscovery: CatalogDiscoveryConfig;
|
|
39
|
-
};
|
|
40
|
-
/** Type guard for descriptors with catalog discovery. */
|
|
41
|
-
export declare function isCatalogDescriptor(d: ProviderDescriptor): d is CatalogProviderDescriptor;
|
|
42
|
-
/** Whether catalog discovery may run without provider credentials. */
|
|
43
|
-
export declare function allowsUnauthenticatedCatalogDiscovery(descriptor: CatalogProviderDescriptor): boolean;
|
|
44
|
-
/**
|
|
45
|
-
* All standard providers. Special providers (google-antigravity, google-gemini-cli,
|
|
46
|
-
* openai-codex) are handled separately because they require different config shapes.
|
|
5
|
+
* Runtime model-discovery descriptors: every registry provider that exposes a
|
|
6
|
+
* standard model-manager factory. Special-managed providers
|
|
7
|
+
* (`google-antigravity`/`google-gemini-cli`/`openai-codex`) are built bespoke in
|
|
8
|
+
* the coding-agent runtime and are excluded here.
|
|
47
9
|
*/
|
|
48
10
|
export declare const PROVIDER_DESCRIPTORS: readonly ProviderDescriptor[];
|
|
49
|
-
/** Default model IDs for all known providers,
|
|
11
|
+
/** Default model IDs for all known providers, derived from the registry. */
|
|
50
12
|
export declare const DEFAULT_MODEL_PER_PROVIDER: Record<KnownProvider, string>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fallback context-window / max-output-token values for models discovered
|
|
3
|
+
* without limit metadata.
|
|
4
|
+
*
|
|
5
|
+
* Kept in a dependency-free leaf module (rather than `openai-compat.ts`) so the
|
|
6
|
+
* model-discovery helpers in `utils/discovery/*` can import them without pulling
|
|
7
|
+
* the package root barrel (`@oh-my-pi/pi-ai`) into the model-manager init graph,
|
|
8
|
+
* which would otherwise form an import cycle through the provider registry.
|
|
9
|
+
*/
|
|
10
|
+
export declare const UNK_CONTEXT_WINDOW = 222222;
|
|
11
|
+
export declare const UNK_MAX_TOKENS = 8888;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ModelManagerOptions } from "../model-manager";
|
|
2
|
+
import { getBundledModels } from "../models";
|
|
2
3
|
import type { Api, Model, Provider } from "../types";
|
|
3
4
|
export interface ModelsDevModel {
|
|
4
5
|
id?: string;
|
|
@@ -23,6 +24,11 @@ export interface ModelsDevModel {
|
|
|
23
24
|
npm?: string;
|
|
24
25
|
};
|
|
25
26
|
}
|
|
27
|
+
type SimpleProviderConfig = {
|
|
28
|
+
apiKey?: string;
|
|
29
|
+
baseUrl?: string;
|
|
30
|
+
};
|
|
31
|
+
export declare function createSimpleOpenAICompletionsOptions(providerId: Parameters<typeof getBundledModels>[0], defaultBaseUrl: string, config?: SimpleProviderConfig): ModelManagerOptions<"openai-completions">;
|
|
26
32
|
export interface OpenAIModelManagerConfig {
|
|
27
33
|
apiKey?: string;
|
|
28
34
|
baseUrl?: string;
|
|
@@ -281,8 +287,7 @@ export interface AnthropicModelManagerConfig {
|
|
|
281
287
|
baseUrl?: string;
|
|
282
288
|
}
|
|
283
289
|
export declare function anthropicModelManagerOptions(config?: AnthropicModelManagerConfig): ModelManagerOptions<"anthropic-messages">;
|
|
284
|
-
export
|
|
285
|
-
export declare const UNK_MAX_TOKENS = 8888;
|
|
290
|
+
export { UNK_CONTEXT_WINDOW, UNK_MAX_TOKENS } from "./discovery-constants";
|
|
286
291
|
/** Describes how to map models.dev API data for a single provider. */
|
|
287
292
|
export interface ModelsDevProviderDescriptor {
|
|
288
293
|
/** Key in the models.dev API response JSON (e.g., "anthropic", "amazon-bedrock") */
|
|
@@ -325,4 +330,3 @@ export interface ModelsDevProviderDescriptor {
|
|
|
325
330
|
export declare function mapModelsDevToModels(data: Record<string, unknown>, descriptors: readonly ModelsDevProviderDescriptor[]): Model<Api>[];
|
|
326
331
|
/** All provider descriptors for models.dev data mapping in generate-models.ts. */
|
|
327
332
|
export declare const MODELS_DEV_PROVIDER_DESCRIPTORS: readonly ModelsDevProviderDescriptor[];
|
|
328
|
-
export {};
|
|
@@ -48,6 +48,7 @@ export declare const claudeCodeHeaders: {
|
|
|
48
48
|
};
|
|
49
49
|
export declare function isClaudeCloakingUserId(userId: string): boolean;
|
|
50
50
|
export declare function generateClaudeCloakingUserId(): string;
|
|
51
|
+
export declare function deriveClaudeDeviceId(installId: string, accountId?: string): string;
|
|
51
52
|
export declare const applyClaudeToolPrefix: (name: string) => string;
|
|
52
53
|
export declare const stripClaudeToolPrefix: (name: string) => string;
|
|
53
54
|
export type AnthropicEffort = "low" | "medium" | "high" | "xhigh" | "max";
|
|
@@ -159,9 +160,8 @@ export type AnthropicUsageLike = {
|
|
|
159
160
|
};
|
|
160
161
|
/**
|
|
161
162
|
* Capture Anthropic's optional cache-creation TTL breakdown and server-tool-use
|
|
162
|
-
* counters into the harness Usage shape.
|
|
163
|
-
*
|
|
164
|
-
* established at `message_start`.
|
|
163
|
+
* counters into the harness Usage shape. Omitted/null fields are no-ops; explicit
|
|
164
|
+
* zero-valued objects clear prior extras from earlier stream usage snapshots.
|
|
165
165
|
*/
|
|
166
166
|
export declare function applyAnthropicUsageExtras(usage: Usage, source: AnthropicUsageLike): void;
|
|
167
167
|
export declare const streamAnthropic: StreamFunction<"anthropic-messages">;
|
|
@@ -185,26 +185,6 @@ export declare function buildAnthropicClientOptions(args: AnthropicClientOptions
|
|
|
185
185
|
* `system` role (Opus 4.8+).
|
|
186
186
|
*/
|
|
187
187
|
export type AnthropicMessageParam = MessageParam;
|
|
188
|
-
export declare function convertAnthropicMessages(messages: Message[], model: Model<"anthropic-messages">, isOAuthToken: boolean): AnthropicMessageParam[];
|
|
189
|
-
/**
|
|
190
|
-
* Normalize a JSON Schema node for Anthropic tool `input_schema`.
|
|
191
|
-
*
|
|
192
|
-
* Applies the full whitelist semantics from the Anthropic Python SDK's
|
|
193
|
-
* `lib/_parse/_transform.py::transform_schema`:
|
|
194
|
-
*
|
|
195
|
-
* 1. Universal keys (`$ref`, `$defs`, `type`, `anyOf`/`oneOf`/`allOf`, `enum`, `const`,
|
|
196
|
-
* `description`, `title`, `default`, `nullable`) are preserved on every node.
|
|
197
|
-
* 2. Per-type keys are kept additively (object → `properties`/`required`/`additionalProperties`,
|
|
198
|
-
* array → `items`/`prefixItems` plus `minItems` only when 0 or 1, string → `format`
|
|
199
|
-
* only when in the supported value set).
|
|
200
|
-
* 3. Everything else is demoted into the node's `description` as `\n\n{key: value, ...}`
|
|
201
|
-
* so the model still sees the constraint as a natural-language hint.
|
|
202
|
-
*
|
|
203
|
-
* Object nodes default to `additionalProperties: false`, but explicit open-map
|
|
204
|
-
* declarations (`additionalProperties: true` or a schema literal — Zod's
|
|
205
|
-
* `z.record(z.string(), z.unknown())` produces `{}`) are preserved. The strict-mode
|
|
206
|
-
* pass downstream demotes those shapes to non-strict instead of fabricating a closed
|
|
207
|
-
* object, so callers like the resolve tool keep working open-map semantics.
|
|
208
|
-
*/
|
|
188
|
+
export declare function convertAnthropicMessages(messages: Message[], model: Model<"anthropic-messages">, isOAuthToken: boolean, baseUrl?: string | undefined): AnthropicMessageParam[];
|
|
209
189
|
export declare function normalizeAnthropicToolSchema(schema: unknown): unknown;
|
|
210
190
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { OAuthController, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
import type { ModelManagerConfig } from "./types";
|
|
3
|
+
export declare function loginAlibabaCodingPlan(options: OAuthController): Promise<string>;
|
|
4
|
+
export declare const alibabaCodingPlanProvider: {
|
|
5
|
+
readonly id: "alibaba-coding-plan";
|
|
6
|
+
readonly name: "Alibaba Coding Plan";
|
|
7
|
+
readonly defaultModel: "qwen3.5-plus";
|
|
8
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
|
|
9
|
+
readonly catalogDiscovery: {
|
|
10
|
+
readonly label: "Alibaba Coding Plan";
|
|
11
|
+
readonly envVars: readonly ["ALIBABA_CODING_PLAN_API_KEY"];
|
|
12
|
+
};
|
|
13
|
+
readonly envKeys: "ALIBABA_CODING_PLAN_API_KEY";
|
|
14
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
import type { ModelManagerConfig } from "./types";
|
|
3
|
+
export declare const anthropicProvider: {
|
|
4
|
+
readonly id: "anthropic";
|
|
5
|
+
readonly name: "Anthropic (Claude Pro/Max)";
|
|
6
|
+
readonly defaultModel: "claude-opus-4-6";
|
|
7
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"anthropic-messages", unknown>;
|
|
8
|
+
readonly envKeys: () => string | undefined;
|
|
9
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<OAuthCredentials>;
|
|
10
|
+
readonly refreshToken: (credentials: OAuthCredentials) => Promise<OAuthCredentials>;
|
|
11
|
+
readonly callbackPort: 54545;
|
|
12
|
+
readonly pasteCodeFlow: true;
|
|
13
|
+
};
|
|
@@ -5,13 +5,19 @@
|
|
|
5
5
|
* don't actually implement OAuth — they just ask the user to paste an API key,
|
|
6
6
|
* optionally validate it, and return the trimmed key.
|
|
7
7
|
*/
|
|
8
|
-
import type { OAuthController } from "./types";
|
|
8
|
+
import type { OAuthController } from "./oauth/types";
|
|
9
9
|
type ChatCompletionsValidation = {
|
|
10
10
|
kind: "chat-completions";
|
|
11
11
|
provider: string;
|
|
12
12
|
baseUrl: string;
|
|
13
13
|
model: string;
|
|
14
14
|
};
|
|
15
|
+
type AnthropicMessagesValidation = {
|
|
16
|
+
kind: "anthropic-messages";
|
|
17
|
+
provider: string;
|
|
18
|
+
baseUrl: string;
|
|
19
|
+
model: string;
|
|
20
|
+
};
|
|
15
21
|
type ModelsEndpointValidation = {
|
|
16
22
|
kind: "models-endpoint";
|
|
17
23
|
provider: string;
|
|
@@ -29,7 +35,7 @@ export type ApiKeyLoginConfig = {
|
|
|
29
35
|
/** Placeholder string for the prompt (e.g. "sk-...", "csk-..."). */
|
|
30
36
|
placeholder: string;
|
|
31
37
|
/** Validation strategy, or `null` to skip validation. */
|
|
32
|
-
validation: ChatCompletionsValidation | ModelsEndpointValidation | null;
|
|
38
|
+
validation: ChatCompletionsValidation | AnthropicMessagesValidation | ModelsEndpointValidation | null;
|
|
33
39
|
};
|
|
34
40
|
export declare function createApiKeyLogin(config: ApiKeyLoginConfig): (options: OAuthController) => Promise<string>;
|
|
35
41
|
export {};
|
|
@@ -5,6 +5,13 @@ type OpenAICompatibleValidationOptions = {
|
|
|
5
5
|
model: string;
|
|
6
6
|
signal?: AbortSignal;
|
|
7
7
|
};
|
|
8
|
+
type AnthropicCompatibleValidationOptions = {
|
|
9
|
+
provider: string;
|
|
10
|
+
apiKey: string;
|
|
11
|
+
baseUrl: string;
|
|
12
|
+
model: string;
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
};
|
|
8
15
|
type ModelListValidationOptions = {
|
|
9
16
|
provider: string;
|
|
10
17
|
apiKey: string;
|
|
@@ -17,6 +24,10 @@ type ModelListValidationOptions = {
|
|
|
17
24
|
* Performs a minimal request to verify credentials and endpoint access.
|
|
18
25
|
*/
|
|
19
26
|
export declare function validateOpenAICompatibleApiKey(options: OpenAICompatibleValidationOptions): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Validate an API key against an Anthropic-compatible messages endpoint.
|
|
29
|
+
*/
|
|
30
|
+
export declare function validateAnthropicCompatibleApiKey(options: AnthropicCompatibleValidationOptions): Promise<void>;
|
|
20
31
|
/**
|
|
21
32
|
* Validate an API key against a provider models endpoint.
|
|
22
33
|
*
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
import type { ModelManagerConfig } from "./types";
|
|
3
|
+
export declare const loginCerebras: (options: import("./oauth").OAuthController) => Promise<string>;
|
|
4
|
+
export declare const cerebrasProvider: {
|
|
5
|
+
readonly id: "cerebras";
|
|
6
|
+
readonly name: "Cerebras";
|
|
7
|
+
readonly defaultModel: "zai-glm-4.6";
|
|
8
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
|
|
9
|
+
readonly catalogDiscovery: {
|
|
10
|
+
readonly label: "Cerebras";
|
|
11
|
+
readonly envVars: readonly ["CEREBRAS_API_KEY"];
|
|
12
|
+
};
|
|
13
|
+
readonly envKeys: "CEREBRAS_API_KEY";
|
|
14
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { OAuthController, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
import type { ModelManagerConfig } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Login to Cloudflare AI Gateway.
|
|
5
|
+
*
|
|
6
|
+
* Opens browser to Cloudflare AI Gateway authentication docs and prompts for a gateway token/API key.
|
|
7
|
+
* Returns the API key directly (not OAuthCredentials - this isn't OAuth).
|
|
8
|
+
*/
|
|
9
|
+
export declare function loginCloudflareAiGateway(options: OAuthController): Promise<string>;
|
|
10
|
+
export declare const cloudflareAiGatewayProvider: {
|
|
11
|
+
readonly id: "cloudflare-ai-gateway";
|
|
12
|
+
readonly name: "Cloudflare AI Gateway";
|
|
13
|
+
readonly defaultModel: "claude-sonnet-4-5";
|
|
14
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"anthropic-messages", unknown>;
|
|
15
|
+
readonly catalogDiscovery: {
|
|
16
|
+
readonly label: "Cloudflare AI Gateway";
|
|
17
|
+
readonly envVars: readonly ["CLOUDFLARE_AI_GATEWAY_API_KEY"];
|
|
18
|
+
};
|
|
19
|
+
readonly envKeys: "CLOUDFLARE_AI_GATEWAY_API_KEY";
|
|
20
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
21
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
import type { ModelManagerConfig } from "./types";
|
|
3
|
+
export declare const cursorProvider: {
|
|
4
|
+
readonly id: "cursor";
|
|
5
|
+
readonly name: "Cursor (Claude, GPT, etc.)";
|
|
6
|
+
readonly defaultModel: "claude-sonnet-4-6";
|
|
7
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"cursor-agent", unknown>;
|
|
8
|
+
readonly catalogDiscovery: {
|
|
9
|
+
readonly label: "Cursor";
|
|
10
|
+
readonly envVars: readonly ["CURSOR_API_KEY"];
|
|
11
|
+
readonly oauthProvider: "cursor";
|
|
12
|
+
};
|
|
13
|
+
readonly envKeys: "CURSOR_ACCESS_TOKEN";
|
|
14
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<OAuthCredentials>;
|
|
15
|
+
readonly refreshToken: (credentials: OAuthCredentials) => Promise<OAuthCredentials>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { OAuthController, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
import type { ModelManagerConfig } from "./types";
|
|
3
|
+
export declare function normalizeDeepSeekApiKey(raw: string): string;
|
|
4
|
+
export declare const loginDeepSeek: (options: OAuthController) => Promise<string>;
|
|
5
|
+
export declare const deepseekProvider: {
|
|
6
|
+
readonly id: "deepseek";
|
|
7
|
+
readonly name: "DeepSeek";
|
|
8
|
+
readonly defaultModel: "deepseek-v4-pro";
|
|
9
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
|
|
10
|
+
readonly catalogDiscovery: {
|
|
11
|
+
readonly label: "DeepSeek";
|
|
12
|
+
readonly envVars: readonly ["DEEPSEEK_API_KEY"];
|
|
13
|
+
};
|
|
14
|
+
readonly envKeys: "DEEPSEEK_API_KEY";
|
|
15
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
import type { ModelManagerConfig } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Fire Pass login flow.
|
|
5
|
+
*
|
|
6
|
+
* Fire Pass is a Fireworks subscription product whose dedicated `fpk_…` API
|
|
7
|
+
* keys are scoped to the `accounts/fireworks/routers/kimi-k2p6-turbo` router
|
|
8
|
+
* (Kimi K2.6 Turbo). The key does NOT authorize `/v1/models`, so validation
|
|
9
|
+
* pings the chat completions endpoint with the router id directly.
|
|
10
|
+
* See https://docs.fireworks.ai/firepass.
|
|
11
|
+
*/
|
|
12
|
+
export declare const loginFirepass: (options: import("./oauth").OAuthController) => Promise<string>;
|
|
13
|
+
export declare const firepassProvider: {
|
|
14
|
+
readonly id: "firepass";
|
|
15
|
+
readonly name: "Fire Pass (Fireworks Kimi K2.6 Turbo subscription)";
|
|
16
|
+
readonly defaultModel: "kimi-k2.6-turbo";
|
|
17
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
|
|
18
|
+
readonly envKeys: "FIREPASS_API_KEY";
|
|
19
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
import type { ModelManagerConfig } from "./types";
|
|
3
|
+
export declare const loginFireworks: (options: import("./oauth").OAuthController) => Promise<string>;
|
|
4
|
+
export declare const fireworksProvider: {
|
|
5
|
+
readonly id: "fireworks";
|
|
6
|
+
readonly name: "Fireworks";
|
|
7
|
+
readonly defaultModel: "kimi-k2.6";
|
|
8
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
|
|
9
|
+
readonly catalogDiscovery: {
|
|
10
|
+
readonly label: "Fireworks";
|
|
11
|
+
readonly envVars: readonly ["FIREWORKS_API_KEY"];
|
|
12
|
+
};
|
|
13
|
+
readonly envKeys: "FIREWORKS_API_KEY";
|
|
14
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
import type { ModelManagerConfig } from "./types";
|
|
3
|
+
export declare const githubCopilotProvider: {
|
|
4
|
+
readonly id: "github-copilot";
|
|
5
|
+
readonly name: "GitHub Copilot";
|
|
6
|
+
readonly defaultModel: "gpt-4o";
|
|
7
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<import("..").Api, unknown>;
|
|
8
|
+
readonly envKeys: "COPILOT_GITHUB_TOKEN";
|
|
9
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<OAuthCredentials>;
|
|
10
|
+
readonly refreshToken: (credentials: OAuthCredentials) => Promise<OAuthCredentials>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
export declare const gitlabDuoProvider: {
|
|
3
|
+
readonly id: "gitlab-duo";
|
|
4
|
+
readonly name: "GitLab Duo";
|
|
5
|
+
readonly defaultModel: "duo-chat-sonnet-4-5";
|
|
6
|
+
readonly envKeys: "GITLAB_TOKEN";
|
|
7
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<OAuthCredentials>;
|
|
8
|
+
readonly refreshToken: (credentials: OAuthCredentials) => Promise<OAuthCredentials>;
|
|
9
|
+
readonly callbackPort: 8080;
|
|
10
|
+
readonly pasteCodeFlow: true;
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
export declare const googleAntigravityProvider: {
|
|
3
|
+
readonly id: "google-antigravity";
|
|
4
|
+
readonly name: "Antigravity (Gemini 3, Claude, GPT-OSS)";
|
|
5
|
+
readonly defaultModel: "gemini-3-pro-high";
|
|
6
|
+
readonly specialModelManager: true;
|
|
7
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<OAuthCredentials>;
|
|
8
|
+
readonly refreshToken: (credentials: OAuthCredentials) => Promise<OAuthCredentials>;
|
|
9
|
+
readonly callbackPort: 51121;
|
|
10
|
+
readonly pasteCodeFlow: true;
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
export declare const googleGeminiCliProvider: {
|
|
3
|
+
readonly id: "google-gemini-cli";
|
|
4
|
+
readonly name: "Google Cloud Code Assist (Gemini CLI)";
|
|
5
|
+
readonly defaultModel: "gemini-2.5-pro";
|
|
6
|
+
readonly specialModelManager: true;
|
|
7
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<OAuthCredentials>;
|
|
8
|
+
readonly refreshToken: (credentials: OAuthCredentials) => Promise<OAuthCredentials>;
|
|
9
|
+
readonly callbackPort: 8085;
|
|
10
|
+
readonly pasteCodeFlow: true;
|
|
11
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ModelManagerConfig } from "./types";
|
|
2
|
+
export declare const googleVertexProvider: {
|
|
3
|
+
readonly id: "google-vertex";
|
|
4
|
+
readonly name: "Google Vertex AI";
|
|
5
|
+
readonly defaultModel: "gemini-3-pro-preview";
|
|
6
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<import("..").Api, unknown>;
|
|
7
|
+
readonly allowUnauthenticated: true;
|
|
8
|
+
readonly envKeys: () => string | undefined;
|
|
9
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ModelManagerConfig } from "./types";
|
|
2
|
+
export declare const googleProvider: {
|
|
3
|
+
readonly id: "google";
|
|
4
|
+
readonly name: "Google Gemini";
|
|
5
|
+
readonly defaultModel: "gemini-2.5-pro";
|
|
6
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"google-generative-ai", unknown>;
|
|
7
|
+
readonly envKeys: "GEMINI_API_KEY";
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ModelManagerConfig } from "./types";
|
|
2
|
+
export declare const groqProvider: {
|
|
3
|
+
readonly id: "groq";
|
|
4
|
+
readonly name: "Groq";
|
|
5
|
+
readonly defaultModel: "openai/gpt-oss-120b";
|
|
6
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
|
|
7
|
+
readonly envKeys: "GROQ_API_KEY";
|
|
8
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { OAuthController, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
import type { ModelManagerConfig } from "./types";
|
|
3
|
+
export declare function loginHuggingface(options: OAuthController): Promise<string>;
|
|
4
|
+
export declare const huggingfaceProvider: {
|
|
5
|
+
readonly id: "huggingface";
|
|
6
|
+
readonly name: "Hugging Face Inference";
|
|
7
|
+
readonly defaultModel: "deepseek-ai/DeepSeek-R1";
|
|
8
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
|
|
9
|
+
readonly catalogDiscovery: {
|
|
10
|
+
readonly label: "Hugging Face";
|
|
11
|
+
readonly envVars: readonly ["HUGGINGFACE_HUB_TOKEN", "HF_TOKEN"];
|
|
12
|
+
};
|
|
13
|
+
readonly envKeys: () => string | undefined;
|
|
14
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OAuthController, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
/**
|
|
3
|
+
* Login to Kagi.
|
|
4
|
+
*
|
|
5
|
+
* Opens browser to API settings and prompts user to paste their API key.
|
|
6
|
+
* Returns the API key directly (not OAuthCredentials - this isn't OAuth).
|
|
7
|
+
*/
|
|
8
|
+
export declare function loginKagi(options: OAuthController): Promise<string>;
|
|
9
|
+
export declare const kagiProvider: {
|
|
10
|
+
readonly id: "kagi";
|
|
11
|
+
readonly name: "Kagi";
|
|
12
|
+
readonly envKeys: "KAGI_API_KEY";
|
|
13
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { OAuthController, OAuthCredentials } from "./oauth/types";
|
|
2
|
+
import type { ModelManagerConfig } from "./types";
|
|
3
|
+
export declare function loginKilo(callbacks: OAuthController): Promise<OAuthCredentials>;
|
|
4
|
+
export declare const kiloProvider: {
|
|
5
|
+
readonly id: "kilo";
|
|
6
|
+
readonly name: "Kilo Gateway";
|
|
7
|
+
readonly defaultModel: "anthropic/claude-sonnet-4.5";
|
|
8
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
|
|
9
|
+
readonly catalogDiscovery: {
|
|
10
|
+
readonly label: "Kilo Gateway";
|
|
11
|
+
readonly envVars: readonly ["KILO_API_KEY"];
|
|
12
|
+
readonly allowUnauthenticated: true;
|
|
13
|
+
};
|
|
14
|
+
readonly envKeys: "KILO_API_KEY";
|
|
15
|
+
readonly login: typeof loginKilo;
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
import type { ModelManagerConfig } from "./types";
|
|
3
|
+
export declare const kimiCodeProvider: {
|
|
4
|
+
readonly id: "kimi-code";
|
|
5
|
+
readonly name: "Kimi Code";
|
|
6
|
+
readonly defaultModel: "kimi-k2.5";
|
|
7
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
|
|
8
|
+
readonly catalogDiscovery: {
|
|
9
|
+
readonly label: "Kimi Code";
|
|
10
|
+
readonly envVars: readonly ["KIMI_API_KEY"];
|
|
11
|
+
};
|
|
12
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<OAuthCredentials>;
|
|
13
|
+
readonly refreshToken: (credentials: OAuthCredentials) => Promise<OAuthCredentials>;
|
|
14
|
+
};
|