@oh-my-pi/pi-ai 15.10.3 → 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.
Files changed (237) hide show
  1. package/CHANGELOG.md +42 -2
  2. package/dist/types/auth-broker/remote-store.d.ts +1 -1
  3. package/dist/types/auth-storage.d.ts +1 -1
  4. package/dist/types/index.d.ts +1 -2
  5. package/dist/types/provider-models/descriptors.d.ts +8 -46
  6. package/dist/types/provider-models/discovery-constants.d.ts +11 -0
  7. package/dist/types/provider-models/openai-compat.d.ts +7 -3
  8. package/dist/types/providers/anthropic.d.ts +13 -28
  9. package/dist/types/registry/alibaba-coding-plan.d.ts +15 -0
  10. package/dist/types/registry/amazon-bedrock.d.ts +6 -0
  11. package/dist/types/registry/anthropic.d.ts +13 -0
  12. package/dist/types/{utils/oauth → registry}/api-key-login.d.ts +8 -2
  13. package/dist/types/{utils/oauth → registry}/api-key-validation.d.ts +11 -0
  14. package/dist/types/registry/cerebras.d.ts +15 -0
  15. package/dist/types/registry/cloudflare-ai-gateway.d.ts +21 -0
  16. package/dist/types/registry/cursor.d.ts +16 -0
  17. package/dist/types/registry/deepseek.d.ts +16 -0
  18. package/dist/types/registry/derived.d.ts +5 -0
  19. package/dist/types/registry/firepass.d.ts +20 -0
  20. package/dist/types/registry/fireworks.d.ts +15 -0
  21. package/dist/types/registry/github-copilot.d.ts +11 -0
  22. package/dist/types/registry/gitlab-duo.d.ts +11 -0
  23. package/dist/types/registry/google-antigravity.d.ts +11 -0
  24. package/dist/types/registry/google-gemini-cli.d.ts +11 -0
  25. package/dist/types/registry/google-vertex.d.ts +9 -0
  26. package/dist/types/registry/google.d.ts +8 -0
  27. package/dist/types/registry/groq.d.ts +8 -0
  28. package/dist/types/registry/huggingface.d.ts +15 -0
  29. package/dist/types/registry/index.d.ts +4 -0
  30. package/dist/types/registry/kagi.d.ts +14 -0
  31. package/dist/types/registry/kilo.d.ts +16 -0
  32. package/dist/types/registry/kimi-code.d.ts +14 -0
  33. package/dist/types/registry/litellm.d.ts +22 -0
  34. package/dist/types/registry/lm-studio.d.ts +13 -0
  35. package/dist/types/registry/minimax-code-cn.d.ts +8 -0
  36. package/dist/types/registry/minimax-code.d.ts +8 -0
  37. package/dist/types/registry/minimax.d.ts +6 -0
  38. package/dist/types/registry/mistral.d.ts +8 -0
  39. package/dist/types/registry/moonshot.d.ts +15 -0
  40. package/dist/types/registry/nanogpt.d.ts +15 -0
  41. package/dist/types/registry/nvidia.d.ts +15 -0
  42. package/dist/types/{utils → registry}/oauth/index.d.ts +1 -0
  43. package/dist/types/{utils → registry}/oauth/types.d.ts +4 -1
  44. package/dist/types/registry/ollama-cloud.d.ts +16 -0
  45. package/dist/types/registry/ollama.d.ts +17 -0
  46. package/dist/types/registry/openai-codex-device.d.ts +8 -0
  47. package/dist/types/registry/openai-codex.d.ts +12 -0
  48. package/dist/types/registry/openai.d.ts +8 -0
  49. package/dist/types/registry/opencode-go.d.ts +10 -0
  50. package/dist/types/registry/opencode-zen.d.ts +10 -0
  51. package/dist/types/registry/openrouter.d.ts +22 -0
  52. package/dist/types/registry/parallel.d.ts +14 -0
  53. package/dist/types/registry/perplexity.d.ts +7 -0
  54. package/dist/types/registry/qianfan.d.ts +15 -0
  55. package/dist/types/registry/qwen-portal.d.ts +16 -0
  56. package/dist/types/registry/registry.d.ts +553 -0
  57. package/dist/types/registry/synthetic.d.ts +15 -0
  58. package/dist/types/registry/tavily.d.ts +14 -0
  59. package/dist/types/registry/together.d.ts +14 -0
  60. package/dist/types/registry/types.d.ts +107 -0
  61. package/dist/types/registry/venice.d.ts +22 -0
  62. package/dist/types/registry/vercel-ai-gateway.d.ts +16 -0
  63. package/dist/types/registry/vllm.d.ts +16 -0
  64. package/dist/types/registry/wafer-pass.d.ts +15 -0
  65. package/dist/types/registry/wafer-serverless.d.ts +15 -0
  66. package/dist/types/registry/xai-oauth.d.ts +16 -0
  67. package/dist/types/registry/xai.d.ts +8 -0
  68. package/dist/types/registry/xiaomi-token-plan-ams.d.ts +10 -0
  69. package/dist/types/registry/xiaomi-token-plan-cn.d.ts +10 -0
  70. package/dist/types/registry/xiaomi-token-plan-sgp.d.ts +10 -0
  71. package/dist/types/registry/xiaomi.d.ts +14 -0
  72. package/dist/types/registry/zai.d.ts +15 -0
  73. package/dist/types/registry/zenmux.d.ts +15 -0
  74. package/dist/types/registry/zhipu-coding-plan.d.ts +15 -0
  75. package/dist/types/types.d.ts +3 -2
  76. package/package.json +16 -8
  77. package/src/auth-broker/remote-store.ts +1 -1
  78. package/src/auth-storage.ts +22 -336
  79. package/src/index.ts +1 -7
  80. package/src/models.json +11 -11
  81. package/src/provider-models/descriptors.ts +37 -358
  82. package/src/provider-models/discovery-constants.ts +11 -0
  83. package/src/provider-models/openai-compat.ts +18 -7
  84. package/src/providers/anthropic.ts +596 -340
  85. package/src/providers/github-copilot-headers.ts +1 -1
  86. package/src/providers/kimi.ts +1 -1
  87. package/src/providers/openai-codex-responses.ts +114 -6
  88. package/src/providers/openai-completions.ts +2 -2
  89. package/src/providers/openai-responses.ts +1 -1
  90. package/src/{utils/oauth → registry}/alibaba-coding-plan.ts +13 -18
  91. package/src/registry/amazon-bedrock.ts +23 -0
  92. package/src/registry/anthropic.ts +29 -0
  93. package/src/{utils/oauth → registry}/api-key-login.ts +22 -3
  94. package/src/{utils/oauth → registry}/api-key-validation.ts +52 -0
  95. package/src/registry/cerebras.ts +28 -0
  96. package/src/{utils/oauth → registry}/cloudflare-ai-gateway.ts +13 -12
  97. package/src/registry/cursor.ts +25 -0
  98. package/src/{utils/oauth → registry}/deepseek.ts +14 -17
  99. package/src/registry/derived.ts +9 -0
  100. package/src/{utils/oauth → registry}/firepass.ts +14 -2
  101. package/src/registry/fireworks.ts +27 -0
  102. package/src/registry/github-copilot.ts +26 -0
  103. package/src/registry/gitlab-duo.ts +21 -0
  104. package/src/registry/google-antigravity.ts +23 -0
  105. package/src/registry/google-gemini-cli.ts +23 -0
  106. package/src/registry/google-vertex.ts +42 -0
  107. package/src/registry/google.ts +10 -0
  108. package/src/registry/groq.ts +10 -0
  109. package/src/{utils/oauth → registry}/huggingface.ts +14 -19
  110. package/src/registry/index.ts +4 -0
  111. package/src/{utils/oauth → registry}/kagi.ts +9 -11
  112. package/src/{utils/oauth → registry}/kilo.ts +13 -4
  113. package/src/registry/kimi-code.ts +21 -0
  114. package/src/{utils/oauth → registry}/litellm.ts +13 -12
  115. package/src/registry/lm-studio.ts +35 -0
  116. package/src/registry/minimax-code-cn.ts +14 -0
  117. package/src/registry/minimax-code.ts +14 -0
  118. package/src/registry/minimax.ts +8 -0
  119. package/src/registry/mistral.ts +10 -0
  120. package/src/registry/moonshot.ts +27 -0
  121. package/src/registry/nanogpt.ts +27 -0
  122. package/src/{utils/oauth → registry}/nvidia.ts +13 -18
  123. package/src/registry/oauth/index.ts +164 -0
  124. package/src/{utils → registry}/oauth/minimax-code.ts +1 -1
  125. package/src/{utils → registry}/oauth/types.ts +5 -51
  126. package/src/{utils → registry}/oauth/wafer.ts +1 -1
  127. package/src/{utils/oauth → registry}/ollama-cloud.ts +13 -1
  128. package/src/{utils/oauth → registry}/ollama.ts +13 -13
  129. package/src/registry/openai-codex-device.ts +18 -0
  130. package/src/registry/openai-codex.ts +22 -0
  131. package/src/registry/openai.ts +10 -0
  132. package/src/registry/opencode-go.ts +16 -0
  133. package/src/registry/opencode-zen.ts +16 -0
  134. package/src/{utils/oauth → registry}/openrouter.ts +15 -2
  135. package/src/{utils/oauth → registry}/parallel.ts +9 -11
  136. package/src/registry/perplexity.ts +13 -0
  137. package/src/{utils/oauth → registry}/qianfan.ts +13 -17
  138. package/src/{utils/oauth → registry}/qwen-portal.ts +18 -19
  139. package/src/registry/registry.ts +141 -0
  140. package/src/registry/synthetic.ts +27 -0
  141. package/src/{utils/oauth → registry}/tavily.ts +10 -12
  142. package/src/registry/together.ts +27 -0
  143. package/src/registry/types.ts +118 -0
  144. package/src/{utils/oauth → registry}/venice.ts +13 -12
  145. package/src/{utils/oauth → registry}/vercel-ai-gateway.ts +13 -18
  146. package/src/{utils/oauth → registry}/vllm.ts +14 -16
  147. package/src/registry/wafer-pass.ts +17 -0
  148. package/src/registry/wafer-serverless.ts +21 -0
  149. package/src/registry/xai-oauth.ts +27 -0
  150. package/src/registry/xai.ts +10 -0
  151. package/src/registry/xiaomi-token-plan-ams.ts +17 -0
  152. package/src/registry/xiaomi-token-plan-cn.ts +17 -0
  153. package/src/registry/xiaomi-token-plan-sgp.ts +17 -0
  154. package/src/registry/xiaomi.ts +17 -0
  155. package/src/{utils/oauth → registry}/zai.ts +13 -20
  156. package/src/registry/zenmux.ts +27 -0
  157. package/src/{utils/oauth/zhipu.ts → registry/zhipu-coding-plan.ts} +14 -21
  158. package/src/stream.ts +14 -110
  159. package/src/types.ts +7 -55
  160. package/src/usage/github-copilot.ts +2 -1
  161. package/src/usage/kimi.ts +1 -1
  162. package/src/utils/discovery/gemini.ts +1 -1
  163. package/src/utils/discovery/openai-compatible.ts +1 -1
  164. package/src/utils/idle-iterator.ts +11 -0
  165. package/dist/types/utils/oauth/alibaba-coding-plan.d.ts +0 -18
  166. package/dist/types/utils/oauth/cerebras.d.ts +0 -1
  167. package/dist/types/utils/oauth/cloudflare-ai-gateway.d.ts +0 -18
  168. package/dist/types/utils/oauth/deepseek.d.ts +0 -10
  169. package/dist/types/utils/oauth/firepass.d.ts +0 -1
  170. package/dist/types/utils/oauth/fireworks.d.ts +0 -1
  171. package/dist/types/utils/oauth/huggingface.d.ts +0 -19
  172. package/dist/types/utils/oauth/kagi.d.ts +0 -17
  173. package/dist/types/utils/oauth/kilo.d.ts +0 -5
  174. package/dist/types/utils/oauth/litellm.d.ts +0 -18
  175. package/dist/types/utils/oauth/lm-studio.d.ts +0 -17
  176. package/dist/types/utils/oauth/moonshot.d.ts +0 -1
  177. package/dist/types/utils/oauth/nanogpt.d.ts +0 -1
  178. package/dist/types/utils/oauth/nvidia.d.ts +0 -18
  179. package/dist/types/utils/oauth/ollama-cloud.d.ts +0 -2
  180. package/dist/types/utils/oauth/ollama.d.ts +0 -18
  181. package/dist/types/utils/oauth/openrouter.d.ts +0 -1
  182. package/dist/types/utils/oauth/parallel.d.ts +0 -17
  183. package/dist/types/utils/oauth/qianfan.d.ts +0 -17
  184. package/dist/types/utils/oauth/qwen-portal.d.ts +0 -19
  185. package/dist/types/utils/oauth/synthetic.d.ts +0 -1
  186. package/dist/types/utils/oauth/tavily.d.ts +0 -17
  187. package/dist/types/utils/oauth/together.d.ts +0 -1
  188. package/dist/types/utils/oauth/venice.d.ts +0 -18
  189. package/dist/types/utils/oauth/vercel-ai-gateway.d.ts +0 -18
  190. package/dist/types/utils/oauth/vllm.d.ts +0 -16
  191. package/dist/types/utils/oauth/zai.d.ts +0 -18
  192. package/dist/types/utils/oauth/zenmux.d.ts +0 -1
  193. package/dist/types/utils/oauth/zhipu.d.ts +0 -18
  194. package/src/utils/oauth/cerebras.ts +0 -16
  195. package/src/utils/oauth/fireworks.ts +0 -15
  196. package/src/utils/oauth/index.ts +0 -502
  197. package/src/utils/oauth/lm-studio.ts +0 -38
  198. package/src/utils/oauth/moonshot.ts +0 -23
  199. package/src/utils/oauth/nanogpt.ts +0 -15
  200. package/src/utils/oauth/synthetic.ts +0 -15
  201. package/src/utils/oauth/together.ts +0 -16
  202. package/src/utils/oauth/zenmux.ts +0 -15
  203. /package/dist/types/{utils → registry}/oauth/__tests__/xai-oauth.test.d.ts +0 -0
  204. /package/dist/types/{utils → registry}/oauth/anthropic.d.ts +0 -0
  205. /package/dist/types/{utils → registry}/oauth/callback-server.d.ts +0 -0
  206. /package/dist/types/{utils → registry}/oauth/cursor.d.ts +0 -0
  207. /package/dist/types/{utils → registry}/oauth/github-copilot.d.ts +0 -0
  208. /package/dist/types/{utils → registry}/oauth/gitlab-duo.d.ts +0 -0
  209. /package/dist/types/{utils → registry}/oauth/google-antigravity.d.ts +0 -0
  210. /package/dist/types/{utils → registry}/oauth/google-gemini-cli.d.ts +0 -0
  211. /package/dist/types/{utils → registry}/oauth/google-oauth-shared.d.ts +0 -0
  212. /package/dist/types/{utils → registry}/oauth/kimi.d.ts +0 -0
  213. /package/dist/types/{utils → registry}/oauth/minimax-code.d.ts +0 -0
  214. /package/dist/types/{utils → registry}/oauth/openai-codex.d.ts +0 -0
  215. /package/dist/types/{utils → registry}/oauth/opencode.d.ts +0 -0
  216. /package/dist/types/{utils → registry}/oauth/perplexity.d.ts +0 -0
  217. /package/dist/types/{utils → registry}/oauth/pkce.d.ts +0 -0
  218. /package/dist/types/{utils → registry}/oauth/wafer.d.ts +0 -0
  219. /package/dist/types/{utils → registry}/oauth/xai-oauth.d.ts +0 -0
  220. /package/dist/types/{utils → registry}/oauth/xiaomi.d.ts +0 -0
  221. /package/src/{utils → registry}/oauth/__tests__/xai-oauth.test.ts +0 -0
  222. /package/src/{utils → registry}/oauth/anthropic.ts +0 -0
  223. /package/src/{utils → registry}/oauth/callback-server.ts +0 -0
  224. /package/src/{utils → registry}/oauth/cursor.ts +0 -0
  225. /package/src/{utils → registry}/oauth/github-copilot.ts +0 -0
  226. /package/src/{utils → registry}/oauth/gitlab-duo.ts +0 -0
  227. /package/src/{utils → registry}/oauth/google-antigravity.ts +0 -0
  228. /package/src/{utils → registry}/oauth/google-gemini-cli.ts +0 -0
  229. /package/src/{utils → registry}/oauth/google-oauth-shared.ts +0 -0
  230. /package/src/{utils → registry}/oauth/kimi.ts +0 -0
  231. /package/src/{utils → registry}/oauth/oauth.html +0 -0
  232. /package/src/{utils → registry}/oauth/openai-codex.ts +0 -0
  233. /package/src/{utils → registry}/oauth/opencode.ts +0 -0
  234. /package/src/{utils → registry}/oauth/perplexity.ts +0 -0
  235. /package/src/{utils → registry}/oauth/pkce.ts +0 -0
  236. /package/src/{utils → registry}/oauth/xai-oauth.ts +0 -0
  237. /package/src/{utils → registry}/oauth/xiaomi.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,46 @@
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
+
33
+ ## [15.10.4] - 2026-06-08
34
+
35
+ ### Added
36
+
37
+ - Added `anthropic-client-platform` (`desktop_app`) and `anthropic-client-version` (`1.11187.4`) headers to the Anthropic request fingerprint for OAuth sessions
38
+
39
+ ### Changed
40
+
41
+ - Changed non-built-in tool names sent to Anthropic from `proxy_` prefixing to `_` prefixing (for example `bash` to `_bash`) while built-in tool names remain unchanged
42
+ - Updated the Anthropic OAuth stealth fingerprint to track Claude Code 2.1.165: `claudeCodeVersion` bumped to `2.1.165` (flows into both the `cc_version` billing header and the `claude-cli/<version>` user-agent), `claudeCodeSystemInstruction` changed to `"You are a Claude agent, built on Anthropic's Claude Agent SDK."`, and the billing-header `cc_entrypoint` changed from `cli` to `local-agent`.
43
+ - Clamped the Anthropic request `max_tokens` to `Math.min(CLAUDE_CODE_MAX_OUTPUT_TOKENS, options.maxTokens || model.maxTokens)` (64k) so OAuth requests match Claude Code's requested output cap instead of sending the model's full ceiling (e.g. 128k for Opus 4.8).
44
+
5
45
  ## [15.10.3] - 2026-06-08
6
46
 
7
47
  ### Removed
@@ -9,8 +49,8 @@
9
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.
10
50
  - Removed the legacy Anthropic first-user-message skip for `<system-reminder>` blocks now that synthetic reminders no longer travel as user messages.
11
51
 
12
-
13
52
  ## [15.10.2] - 2026-06-08
53
+
14
54
  ### Added
15
55
 
16
56
  - Added support for `impersonated_service_account` Application Default Credentials (ADC) in Vertex AI to enable chained impersonation without failing via 401 `invalid_client`.
@@ -3034,4 +3074,4 @@ _Dedicated to Peter's shoulder ([@steipete](https://twitter.com/steipete))_
3034
3074
 
3035
3075
  ## [0.9.4] - 2025-11-26
3036
3076
 
3037
- 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;
@@ -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
- * Unified provider descriptors single source of truth for provider metadata
3
- * used by both runtime model discovery (model-registry.ts) and catalog
4
- * generation (generate-models.ts).
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, built from descriptors + special 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 declare const UNK_CONTEXT_WINDOW = 222222;
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 {};
@@ -26,9 +26,12 @@ type AnthropicCacheControl = NonNullable<TextBlockParam["cache_control"]>;
26
26
  */
27
27
  export declare function clearAnthropicFastModeFallback(providerSessionState: Map<string, ProviderSessionState> | undefined): void;
28
28
  export declare function isAnthropicFastModeUnsupportedError(error: unknown): boolean;
29
- export declare const claudeCodeVersion = "2.1.160";
29
+ export declare const claudeCodeVersion = "2.1.165";
30
+ export declare const claudeAgentSdkVersion = "0.3.165";
31
+ export declare const claudeClientVersion = "1.11187.4";
30
32
  export declare const claudeToolPrefix: string;
31
- export declare const claudeCodeSystemInstruction = "You are Claude Code, Anthropic's official CLI for Claude.";
33
+ export declare const claudeCodeSystemInstruction = "You are a Claude agent, built on Anthropic's Claude Agent SDK.";
34
+ export declare const CLAUDE_CODE_MAX_OUTPUT_TOKENS = 64000;
32
35
  export declare function mapStainlessOs(platform: string): "MacOS" | "Windows" | "Linux" | "FreeBSD" | `Other::${string}`;
33
36
  export declare function mapStainlessArch(arch: string): "x64" | "arm64" | "x86" | `other::${string}`;
34
37
  export declare const claudeCodeHeaders: {
@@ -40,11 +43,14 @@ export declare const claudeCodeHeaders: {
40
43
  "X-Stainless-Arch": "arm64" | "x64" | "x86" | `other::${string}`;
41
44
  "X-Stainless-OS": "FreeBSD" | "Linux" | "MacOS" | "Windows" | `Other::${string}`;
42
45
  "X-Stainless-Timeout": string;
46
+ "anthropic-client-platform": string;
47
+ "anthropic-client-version": string;
43
48
  };
44
49
  export declare function isClaudeCloakingUserId(userId: string): boolean;
45
50
  export declare function generateClaudeCloakingUserId(): string;
46
- export declare const applyClaudeToolPrefix: (name: string, prefixOverride?: string) => string;
47
- export declare const stripClaudeToolPrefix: (name: string, prefixOverride?: string) => string;
51
+ export declare function deriveClaudeDeviceId(installId: string, accountId?: string): string;
52
+ export declare const applyClaudeToolPrefix: (name: string) => string;
53
+ export declare const stripClaudeToolPrefix: (name: string) => string;
48
54
  export type AnthropicEffort = "low" | "medium" | "high" | "xhigh" | "max";
49
55
  export type AnthropicThinkingDisplay = "summarized" | "omitted";
50
56
  export interface AnthropicOptions extends StreamOptions {
@@ -154,9 +160,8 @@ export type AnthropicUsageLike = {
154
160
  };
155
161
  /**
156
162
  * Capture Anthropic's optional cache-creation TTL breakdown and server-tool-use
157
- * counters into the harness Usage shape. Only sets fields that were reported, so
158
- * a `message_delta` that omits `cache_creation` does not clobber the breakdown
159
- * 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.
160
165
  */
161
166
  export declare function applyAnthropicUsageExtras(usage: Usage, source: AnthropicUsageLike): void;
162
167
  export declare const streamAnthropic: StreamFunction<"anthropic-messages">;
@@ -180,26 +185,6 @@ export declare function buildAnthropicClientOptions(args: AnthropicClientOptions
180
185
  * `system` role (Opus 4.8+).
181
186
  */
182
187
  export type AnthropicMessageParam = MessageParam;
183
- export declare function convertAnthropicMessages(messages: Message[], model: Model<"anthropic-messages">, isOAuthToken: boolean): AnthropicMessageParam[];
184
- /**
185
- * Normalize a JSON Schema node for Anthropic tool `input_schema`.
186
- *
187
- * Applies the full whitelist semantics from the Anthropic Python SDK's
188
- * `lib/_parse/_transform.py::transform_schema`:
189
- *
190
- * 1. Universal keys (`$ref`, `$defs`, `type`, `anyOf`/`oneOf`/`allOf`, `enum`, `const`,
191
- * `description`, `title`, `default`, `nullable`) are preserved on every node.
192
- * 2. Per-type keys are kept additively (object → `properties`/`required`/`additionalProperties`,
193
- * array → `items`/`prefixItems` plus `minItems` only when 0 or 1, string → `format`
194
- * only when in the supported value set).
195
- * 3. Everything else is demoted into the node's `description` as `\n\n{key: value, ...}`
196
- * so the model still sees the constraint as a natural-language hint.
197
- *
198
- * Object nodes default to `additionalProperties: false`, but explicit open-map
199
- * declarations (`additionalProperties: true` or a schema literal — Zod's
200
- * `z.record(z.string(), z.unknown())` produces `{}`) are preserved. The strict-mode
201
- * pass downstream demotes those shapes to non-strict instead of fabricating a closed
202
- * object, so callers like the resolve tool keep working open-map semantics.
203
- */
188
+ export declare function convertAnthropicMessages(messages: Message[], model: Model<"anthropic-messages">, isOAuthToken: boolean, baseUrl?: string | undefined): AnthropicMessageParam[];
204
189
  export declare function normalizeAnthropicToolSchema(schema: unknown): unknown;
205
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,6 @@
1
+ export declare const amazonBedrockProvider: {
2
+ readonly id: "amazon-bedrock";
3
+ readonly name: "Amazon Bedrock";
4
+ readonly defaultModel: "us.anthropic.claude-opus-4-6-v1";
5
+ readonly envKeys: () => "<authenticated>" | undefined;
6
+ };
@@ -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,5 @@
1
+ /**
2
+ * Providers whose OAuth flow needs a pasted code/redirect URL rather than a
3
+ * local callback server. Consumed by the coding-agent login UX.
4
+ */
5
+ export declare const PASTE_CODE_LOGIN_PROVIDERS: ReadonlySet<string>;
@@ -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,4 @@
1
+ export * from "./derived";
2
+ export * from "./oauth";
3
+ export * from "./registry";
4
+ export * from "./types";
@@ -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
+ };