@linxiraos/pi-catalog 1.2.0 → 1.3.0

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 (127) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +4 -2
  3. package/THIRD-PARTY-NOTICES.txt +55 -5
  4. package/dist/types/build.d.ts +3 -2
  5. package/dist/types/compat/auth-ids.d.ts +2 -2
  6. package/dist/types/compat/axes.d.ts +1 -1
  7. package/dist/types/compat/behavior.d.ts +5 -0
  8. package/dist/types/compat/catalog-endpoint.d.ts +8 -0
  9. package/dist/types/compat/image-tokenization.d.ts +9 -1
  10. package/dist/types/compat/judgment-images.d.ts +25 -0
  11. package/dist/types/compat/provider-ids.d.ts +1 -1
  12. package/dist/types/compat/request-compression.d.ts +23 -0
  13. package/dist/types/compat/request-size.d.ts +12 -3
  14. package/dist/types/compat/thinking-replay.d.ts +9 -0
  15. package/dist/types/compat/types.d.ts +4 -0
  16. package/dist/types/discovery/antigravity.d.ts +7 -0
  17. package/dist/types/model-cache.d.ts +7 -0
  18. package/dist/types/model-manager.d.ts +6 -0
  19. package/dist/types/model-thinking.d.ts +11 -1
  20. package/dist/types/models.d.ts +16 -1
  21. package/dist/types/pricing.d.ts +37 -1
  22. package/dist/types/provider-models/openai-compat.d.ts +18 -46
  23. package/dist/types/types.d.ts +63 -12
  24. package/dist/types/wire/codex.d.ts +2 -0
  25. package/package.json +6 -6
  26. package/src/build.d.ts +3 -2
  27. package/src/build.ts +159 -80
  28. package/src/compat/auth-ids.ts +2 -0
  29. package/src/compat/axes.d.ts +1 -1
  30. package/src/compat/axes.ts +129 -4
  31. package/src/compat/behavior.d.ts +5 -0
  32. package/src/compat/behavior.ts +9 -1
  33. package/src/compat/cascade.ts +4 -1
  34. package/src/compat/catalog-endpoint.ts +43 -0
  35. package/src/compat/image-tokenization.ts +28 -10
  36. package/src/compat/judgment-images.ts +83 -0
  37. package/src/compat/provider-ids.d.ts +1 -1
  38. package/src/compat/provider-ids.ts +1 -0
  39. package/src/compat/request-compression.ts +43 -0
  40. package/src/compat/request-size.ts +20 -5
  41. package/src/compat/resolve.ts +90 -53
  42. package/src/compat/rules/README.md +32 -3
  43. package/src/compat/rules/auth/_order.kdl +1 -1
  44. package/src/compat/rules/auth/google-antigravity.kdl +1 -1
  45. package/src/compat/rules/auth/sambanova.kdl +9 -0
  46. package/src/compat/rules/auth/stencil.kdl +1 -1
  47. package/src/compat/rules/classes/anthropic.kdl +42 -2
  48. package/src/compat/rules/classes/deepseek.kdl +4 -0
  49. package/src/compat/rules/classes/gemini.kdl +46 -2
  50. package/src/compat/rules/classes/meta.kdl +7 -0
  51. package/src/compat/rules/classes/minimax.kdl +11 -1
  52. package/src/compat/rules/classes/openai.kdl +34 -3
  53. package/src/compat/rules/classes/xai.kdl +26 -0
  54. package/src/compat/rules/providers/amazon-bedrock.kdl +1 -0
  55. package/src/compat/rules/providers/anthropic.kdl +23 -0
  56. package/src/compat/rules/providers/azure.kdl +2 -0
  57. package/src/compat/rules/providers/cerebras.kdl +3 -0
  58. package/src/compat/rules/providers/cline-pass.kdl +16 -0
  59. package/src/compat/rules/providers/commandcode.kdl +10 -0
  60. package/src/compat/rules/providers/cursor.kdl +50 -1
  61. package/src/compat/rules/providers/deepinfra.kdl +3 -1
  62. package/src/compat/rules/providers/devin.kdl +117 -6
  63. package/src/compat/rules/providers/factory-droid.kdl +6 -0
  64. package/src/compat/rules/providers/firepass.kdl +15 -0
  65. package/src/compat/rules/providers/fireworks.kdl +26 -0
  66. package/src/compat/rules/providers/github-copilot.kdl +24 -0
  67. package/src/compat/rules/providers/google-antigravity.kdl +37 -0
  68. package/src/compat/rules/providers/google-gemini-cli.kdl +1 -0
  69. package/src/compat/rules/providers/google-vertex.kdl +5 -0
  70. package/src/compat/rules/providers/google.kdl +1 -0
  71. package/src/compat/rules/providers/image-tokenization.kdl +2 -1
  72. package/src/compat/rules/providers/local.kdl +8 -1
  73. package/src/compat/rules/providers/meta.kdl +16 -0
  74. package/src/compat/rules/providers/moonshot.kdl +2 -0
  75. package/src/compat/rules/providers/muse-code.kdl +49 -0
  76. package/src/compat/rules/providers/native-tools.kdl +3 -0
  77. package/src/compat/rules/providers/ollama-cloud.kdl +10 -0
  78. package/src/compat/rules/providers/openai-codex.kdl +29 -5
  79. package/src/compat/rules/providers/openai.kdl +1 -0
  80. package/src/compat/rules/providers/opencode-go.kdl +35 -0
  81. package/src/compat/rules/providers/opencode-zen.kdl +4 -0
  82. package/src/compat/rules/providers/openrouter.kdl +19 -0
  83. package/src/compat/rules/providers/sambanova.kdl +60 -0
  84. package/src/compat/rules/providers/tool-call-names.kdl +37 -0
  85. package/src/compat/rules/providers/typesafe.kdl +11 -0
  86. package/src/compat/rules/providers/umans.kdl +7 -0
  87. package/src/compat/rules/providers/venice.kdl +7 -0
  88. package/src/compat/rules/providers/xai-oauth.kdl +16 -6
  89. package/src/compat/rules/providers/xai.kdl +3 -0
  90. package/src/compat/rules/providers/zai.kdl +5 -0
  91. package/src/compat/rules/runtime/behavior.kdl +128 -8
  92. package/src/compat/rules/taxonomy/_collapse.kdl +11 -0
  93. package/src/compat/rules/taxonomy/gemma.kdl +1 -0
  94. package/src/compat/rules/taxonomy/meta.kdl +7 -0
  95. package/src/compat/rules/taxonomy/openai.kdl +2 -0
  96. package/src/compat/rules.json +1 -1
  97. package/src/compat/thinking-replay.ts +33 -0
  98. package/src/compat/types.d.ts +4 -0
  99. package/src/compat/types.ts +4 -0
  100. package/src/discovery/antigravity.d.ts +7 -0
  101. package/src/discovery/antigravity.ts +13 -0
  102. package/src/discovery/codex.ts +0 -4
  103. package/src/discovery/cursor.ts +28 -20
  104. package/src/discovery/devin.ts +7 -8
  105. package/src/model-cache.d.ts +7 -0
  106. package/src/model-cache.ts +8 -0
  107. package/src/model-manager.d.ts +6 -0
  108. package/src/model-manager.ts +41 -21
  109. package/src/model-thinking.d.ts +80 -0
  110. package/src/model-thinking.ts +13 -1
  111. package/src/model-tokenizer.ts +7 -1
  112. package/src/models.d.ts +16 -1
  113. package/src/models.json +1 -1
  114. package/src/models.ts +26 -12
  115. package/src/pricing.d.ts +37 -1
  116. package/src/pricing.ts +123 -12
  117. package/src/provider-models/bundled-references.ts +5 -2
  118. package/src/provider-models/cache-provider-id.ts +1 -1
  119. package/src/provider-models/descriptors.ts +2 -0
  120. package/src/provider-models/google.ts +7 -1
  121. package/src/provider-models/openai-compat.d.ts +18 -46
  122. package/src/provider-models/openai-compat.ts +188 -104
  123. package/src/provider-models/special.ts +1 -0
  124. package/src/types.d.ts +63 -12
  125. package/src/types.ts +71 -9
  126. package/src/wire/codex.d.ts +2 -0
  127. package/src/wire/codex.ts +17 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,84 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.3.0] - 2026-10-18
4
+
5
+ ### Breaking Changes
6
+
7
+ - `resolveInlineImageByteBudget(model, officialEndpoint)` and `resolveImageCountBudget(model, officialEndpoint)` take whether the request reaches the official endpoint instead of reading `compat.officialEndpoint`, which misses request-time reroutes such as `ANTHROPIC_BASE_URL`; pass pi-ai's `reachesOfficialEndpoint(model)` ([#15434](https://github.com/can1357/oh-my-pi/pull/15434) by [@will-bogusz](https://github.com/will-bogusz))
8
+
9
+ ### Added
10
+
11
+ - Added the `honors-claude-code-beta-kill-switch` axis (`compat.honorsClaudeCodeBetaKillSwitch`), on for the `anthropic` provider, so a rule or `models.yml` override decides which providers honor `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` ([#15458](https://github.com/can1357/oh-my-pi/pull/15458) by [@H4vC](https://github.com/H4vC))
12
+ - Added Muse Wonder (`muse-wonder-1.0`) to Meta and Muse Code with its `minimal`–`max` effort ladder and pricing
13
+ - Added the `thinking-unverified` rule axis: on hosts whose model list carries no capability metadata (Meta, Muse Code), unrecognized models now offer an opt-in thinking ladder (`ThinkingConfig.unverified`) instead of none
14
+ - Added `thinking-unverified` axis for offering reasoning ladders on unclassified model IDs
15
+ - Added `Muse Wonder 1.0` model definition to Meta provider
16
+ - Added the opt-in `snapcompact-image-reads` axis: snapcompact images a fresh `read` result only for readers whose rule sets it; Claude Opus 5.5 and later opt in ([#14249](https://github.com/can1357/oh-my-pi/pull/14249) by [@will-bogusz](https://github.com/will-bogusz))
17
+ - Added the `image-count-budget` rule for how many images one request may carry (Anthropic 90, Codex 200, other hosts unchanged) and the `official-image-count-budget` override that applies only on the official endpoint: Anthropic 600 (100 on 200k-window Claude models), Codex 2,000 ([#15434](https://github.com/can1357/oh-my-pi/pull/15434) by [@will-bogusz](https://github.com/will-bogusz))
18
+ - Added a 24 MB inline-image byte budget for the Codex backend, which now counts as its official endpoint at its default URL and at paths under it such as `/codex/responses` ([#15434](https://github.com/can1357/oh-my-pi/pull/15434) by [@will-bogusz](https://github.com/will-bogusz))
19
+ - Added `isOfficialCodexApiUrl` to `wire/codex`, moved from pi-ai ([#15434](https://github.com/can1357/oh-my-pi/pull/15434) by [@will-bogusz](https://github.com/will-bogusz))
20
+ - Added `verified` to `image-tokenization` rules, marking the Claude 4.7+ high-res tier and the GPT-5.5 to 6.1 and gpt-6-astra rules as matching measured provider billing ([#15442](https://github.com/can1357/oh-my-pi/pull/15442) by [@will-bogusz](https://github.com/will-bogusz))
21
+ - Added the `image-max-edge` axis and `resolveImageMaxEdge()` for hosts that shrink images before the model reads them; Cursor's Claude and GPT models and its `default` (Auto) route fit 1024×1024 ([#15448](https://github.com/can1357/oh-my-pi/pull/15448) by [@will-bogusz](https://github.com/will-bogusz))
22
+ - Added the `thinking-replay-tokens` axis; Claude lines set it to `output` on every host, since a replayed signed thinking block bills the turn's full reasoning, not the signature's bytes ([#15446](https://github.com/can1357/oh-my-pi/pull/15446) by [@will-bogusz](https://github.com/will-bogusz))
23
+ - Added a KDL opt-in for sibling subagent prompt-cache sharing, enabled for Muse Code's Spark 1.3, Wonder 1.0, and Wonder Full 1.0 variants over the Responses API ([#15467](https://github.com/can1357/oh-my-pi/pull/15467) by [@iliaal](https://github.com/iliaal))
24
+ - Added Muse Code's subscription-only Muse Wonder Full and Wonder contributor tiers with the `max` effort, recording API-equivalent cost instead of $0: Wonder Full at Muse Wonder's $4 input / $0.20 cached / $20 output per 1M tokens, contributor tiers at the measured $1.60 / $0.08 / $8 ([#15522](https://github.com/can1357/oh-my-pi/pull/15522) by [@eggpeat](https://github.com/eggpeat))
25
+ - Added the `classifier-cot-extraction` rule axis, set for Claude, marking models whose classifier refuses earlier reasoning quoted back into their input ([#15436](https://github.com/can1357/oh-my-pi/pull/15436) by [@will-bogusz](https://github.com/will-bogusz))
26
+ - Added Gemini 4 Argon pricing on Cursor ($2 input / $0.10 cached / $10 output per 1M tokens) and Google Antigravity, which now uses Google's first-party rate instead of showing $0 ([#15620](https://github.com/can1357/oh-my-pi/pull/15620) by [@eggpeat](https://github.com/eggpeat))
27
+ - Added scheduled list-price changes to `cost-patch`, as `cost-fallback` already allowed: a dated `effective-rates` card sets the price from its date, and each request is priced at the card in force when it was made, even on models loaded before the change, on rebuilt models, and on Cursor lanes priced from a sibling's card. A malformed dated card now fails the model build instead of silently keeping the old price. `getEffectiveTokenCost` returns that card for price displays, and `hasRecurringTariff` tells these dated-only schedules apart from peak/off-peak tariffs, which alone show a status-line arrow ([#15620](https://github.com/can1357/oh-my-pi/pull/15620) by [@eggpeat](https://github.com/eggpeat))
28
+ - Added `local/nemotron-streaming-en-0.6b` for local streaming English dictation ([#15759](https://github.com/can1357/oh-my-pi/pull/15759) by [@daaximus](https://github.com/daaximus)).
29
+ - Added SambaNova Cloud (`sambanova`) as a provider: `/login sambanova` with an API key, and the live `/v1/models` roster with its prices, reasoning models, and Gemma 4 image input ([#14986](https://github.com/can1357/oh-my-pi/pull/14986) by [@rjuez00](https://github.com/rjuez00))
30
+ - Added `keep-bundled-names` catalog attribute to preserve static model display names during discovery
31
+ - Updated `openai-codex` provider configuration to prevent model name regressions during live discovery
32
+ - Added the `request-encodings`, `request-encoding-rejection`, and `endpoint-hosts` rule axes, `resolveRequestCompression(model, url)`, and `isCatalogEndpointUrl(model, url)`, declaring which providers' own endpoints decode compressed request bodies: official Anthropic API (gzip), Codex backend (zstd), and GitHub Copilot's API hosts (zstd, then gzip); Moonshot's China host counts as its own endpoint ([#16086](https://github.com/can1357/oh-my-pi/pull/16086) by [@H4vC](https://github.com/H4vC))
33
+
34
+ ### Changed
35
+
36
+ - Raised the default context window for `openai-codex/gpt-6.1-sol` and `gpt-6.1-sol-wm` from 272K to 500K, matching OpenAI's new Codex default; extended context still opens 922K ([#15421](https://github.com/can1357/oh-my-pi/issues/15421))
37
+ - Updated model definitions and compatibility rules for provider metadata
38
+ - Google Antigravity, xAI and Cursor requests keep up to 60 images, 20 for Claude on Antigravity and Cursor, up from 5; this counts snapcompact frames and live screenshots together ([#15449](https://github.com/can1357/oh-my-pi/pull/15449) by [@will-bogusz](https://github.com/will-bogusz))
39
+ - Snapcompact sizes archives at the frame prices measured for Antigravity Gemini (a fixed 1,089 tokens), Grok 4.6 to 4.20, and Claude Sonnet 4.6's standard tier ([#15449](https://github.com/can1357/oh-my-pi/pull/15449) by [@will-bogusz](https://github.com/will-bogusz))
40
+ - Devin models with a long-context price tier (GPT-5.4 through 5.6 standard lanes, GPT-6 through 6.1, Gemini Pro, and Grok 4.5 through 4.7) now default to a 272K or 200K context window, where that pricing starts; run `/extended-context on` to use the full window at long-context rates ([#14891](https://github.com/can1357/oh-my-pi/pull/14891) by [@eggpeat](https://github.com/eggpeat)).
41
+ - Devin SWE-2, SWE-1.7, and GLM-5.2 fallback pricing no longer charges cache writes at the input rate, since Devin publishes no cache-write rate for them ([#14891](https://github.com/can1357/oh-my-pi/pull/14891) by [@eggpeat](https://github.com/eggpeat)).
42
+ - Google Antigravity now lists Gemini 4 Argon once, with selectable low, medium, and high thinking levels, instead of a separate entry per thinking tier ([#15620](https://github.com/can1357/oh-my-pi/pull/15620) by [@eggpeat](https://github.com/eggpeat))
43
+ - Gemini 4 Argon on Google, Vertex, Google Antigravity, and Cursor moves to Google's $4 input / $0.20 cached / $20 output list price on 2026-12-01 (midnight US Pacific), including requests on models loaded before then, without a catalog update ([#15620](https://github.com/can1357/oh-my-pi/pull/15620) by [@eggpeat](https://github.com/eggpeat))
44
+ - Devin SWE-2's promotional fallback price now ends on 2027-01-01 for requests on models loaded before then too ([#15620](https://github.com/can1357/oh-my-pi/pull/15620) by [@eggpeat](https://github.com/eggpeat))
45
+ - OpenCode Go requests now go to the current `https://opencode.ai/inference/go/v1` endpoint instead of the legacy `/zen/go` one ([#15722](https://github.com/can1357/oh-my-pi/issues/15722))
46
+ - GPT Image models (`gpt-image-*`, `chatgpt-image-*`) now classify as their own `gpt-image` family instead of `gpt` or `chatgpt`, so GPT chat-model rules no longer apply to them ([#14619](https://github.com/can1357/oh-my-pi/pull/14619) by [@jimhester](https://github.com/jimhester))
47
+ - Renamed the built-in `google-antigravity` login option to "Google Antigravity (Gemini, Claude, GPT-OSS)" so it is distinguishable from similarly named third-party plugins and no longer implies support stops at Gemini 3 ([#15998](https://github.com/can1357/oh-my-pi/pull/15998) by [@savanne-kham](https://github.com/savanne-kham)).
48
+ - Bundled GPT-5.4 rows on OpenAI, Azure, OpenCode Zen, and Command Code report a 1M context window, the window the coding agent already applied at runtime; GitHub Copilot and Factory Droid keep their own windows ([#16094](https://github.com/can1357/oh-my-pi/pull/16094) by [@H4vC](https://github.com/H4vC))
49
+
50
+ ### Fixed
51
+
52
+ - Applied `max-image-dimension` and `max-image-payload-bytes` to Google API models, and declared the 5 MiB per-image limit of Claude on Google Antigravity ([#15444](https://github.com/can1357/oh-my-pi/pull/15444) by [@will-bogusz](https://github.com/will-bogusz))
53
+ - Fixed local token counts for OpenAI GPT-5 and later models (Codex, OpenAI, Azure, OpenRouter, Copilot and other hosts) reading about 12% low: their text is now counted with o200k_base instead of a bytes/4 estimate ([#15447](https://github.com/can1357/oh-my-pi/pull/15447) by [@will-bogusz](https://github.com/will-bogusz))
54
+ - Fixed Devin Claude and GPT-5.6 through GPT-6 models pricing prompt-cache writes at $0; they now use Devin's published rate of 1.25x input, and Adaptive uses its input rate ([#14891](https://github.com/can1357/oh-my-pi/pull/14891) by [@eggpeat](https://github.com/eggpeat)).
55
+ - Fixed Devin GPT-5.4 through GPT-6.1, Gemini Pro, and Grok 4.5 through 4.7 models missing the long-context price tiers Devin publishes above 272K and 200K prompt tokens ([#14891](https://github.com/can1357/oh-my-pi/pull/14891) by [@eggpeat](https://github.com/eggpeat)).
56
+ - Fixed Devin Fusion pairings ignoring their lead model's rules, including its cache-write rate and long-context tier ([#14891](https://github.com/can1357/oh-my-pi/pull/14891) by [@eggpeat](https://github.com/eggpeat)).
57
+ - Fixed Kilo and NanoGPT models showing stale or missing prices (for example Gemini 4 Argon at $4/$20 instead of $2/$10, and many models at $0); prices now come from each gateway's live model list ([#15623](https://github.com/can1357/oh-my-pi/pull/15623) by [@eggpeat](https://github.com/eggpeat))
58
+ - Fixed NanoGPT models showing their raw id as the name and no context window (disabling auto-compaction) when the bundled catalog lacked them; names, context windows and output limits now come from NanoGPT's live model list ([#15623](https://github.com/can1357/oh-my-pi/pull/15623) by [@eggpeat](https://github.com/eggpeat))
59
+ - Enabled long prompt-cache retention (`ttl: "1h"`) for Claude models on `google-vertex` ([#15505](https://github.com/can1357/oh-my-pi/pull/15505) by [@hpost](https://github.com/hpost))
60
+ - Fixed Gemini 4 Argon on Google Vertex and the Gemini API failing every request with "Thinking budget is not supported for this model": Gemini 4 now sends `thinkingLevel` instead of `thinkingBudget`, and Argon offers only the low, medium, and high levels Google accepts ([#15643](https://github.com/can1357/oh-my-pi/pull/15643) by [@kevcube](https://github.com/kevcube))
61
+ - Fixed the Antigravity model selector offering roster rows the backend marks disabled (`disabled: true`, e.g. `gemini-4-argon-disabled` on accounts without Argon access), which answered `Cloud Code Assist API error (404): Requested entity was not found.`; discovery now skips them the way it already skips `isInternal` rows ([#15684](https://github.com/can1357/oh-my-pi/pull/15684) by [@CharleoYang](https://github.com/CharleoYang))
62
+ - Removed Google Antigravity's Gemini 3.5 Flash and its `gemini-3-flash` alias from the model list; Antigravity retired them and answers every request with a retirement notice instead of a reply ([#15445](https://github.com/can1357/oh-my-pi/pull/15445) by [@will-bogusz](https://github.com/will-bogusz))
63
+ - Fixed `xai-oauth` Grok 4.20 models (`grok-4.20-0309-reasoning`, `-non-reasoning`, `grok-4.20-multi-agent-0309`) advertising a 2M context window when the SuperGrok API rejects prompts over 1M; auto-compaction and context usage now work from the 1M window ([#15443](https://github.com/can1357/oh-my-pi/pull/15443) by [@will-bogusz](https://github.com/will-bogusz))
64
+ - Fixed trailing-dot `localhost.` and `*.local.` custom endpoints losing local-backend compatibility settings ([#15798](https://github.com/can1357/oh-my-pi/issues/15798)).
65
+ - Fixed OpenCode Go's `deepseek-flash` alias showing $0, unknown limits, and no reasoning instead of the V4.1 Flash rate card and capabilities ([#15357](https://github.com/can1357/oh-my-pi/issues/15357))
66
+ - Fixed OpenCode Go's Gemini 4 Argon Contributor failing with an unsupported protocol and thinking level; it now uses the native Gemini endpoint ([#15722](https://github.com/can1357/oh-my-pi/issues/15722))
67
+ - Fixed OpenCode Zen Gemini 4 Argon failing with an unsupported protocol; it now uses the native Gemini endpoint ([#15977](https://github.com/can1357/oh-my-pi/issues/15977)).
68
+ - Fixed Command Code's `z-ai/glm-5.3-flash` failing every request with "not available on this endpoint": the catalog routes it to chat completions, the only endpoint Command Code lists for it ([#15922](https://github.com/can1357/oh-my-pi/pull/15922) by [@jasonharrison](https://github.com/jasonharrison))
69
+ - Fixed `/handoff` failing with `400 Provider returned error` on OpenRouter's hosted Muse Spark 1.x and Muse Wonder models: requests no longer send a `tool_choice` the upstream Meta backend rejects ([#15910](https://github.com/can1357/oh-my-pi/issues/15910))
70
+ - Fixed OpenCode Zen bringing back retired bundled models from an authoritative model cache, and dropping drop-listed models such as `gemini-3.7-flash` when a refresh fails after an upgrade ([#15770](https://github.com/can1357/oh-my-pi/pull/15770) by [@adi-IL](https://github.com/adi-IL))
71
+ - Fixed custom providers that declare a built-in `providerType` (Azure, GitHub Copilot, OpenCode, ClinePass, DeepSeek, NVIDIA) missing that provider's wire quirks, such as strict Responses pairing and the ClinePass reasoning field: they now follow the same catalog rules as the built-in provider ([#16093](https://github.com/can1357/oh-my-pi/pull/16093) by [@H4vC](https://github.com/H4vC))
72
+ - Fixed OpenCode Zen bringing back its retired bundled models after a failed refresh: the retry-backoff write no longer drops the cached snapshot's retention, so the pruned catalog survives the retry window and offline launches. ([#16054](https://github.com/can1357/oh-my-pi/pull/16054) by [@adi-IL](https://github.com/adi-IL))
73
+ - Fixed `providers.cacheWarming` never arming for Claude on Google Antigravity: Claude models there now declare Vertex Anthropic's five-minute prompt-cache lifetime; Gemini models stay unwarmed because Google's implicit cache has no fixed lifetime ([#15764](https://github.com/can1357/oh-my-pi/issues/15764), [#16025](https://github.com/can1357/oh-my-pi/pull/16025) by [@harshaygadekar](https://github.com/harshaygadekar))
74
+ - Scoped Jev image bounds to the selected models instead of applying them to unrelated native judges ([#16002](https://github.com/can1357/oh-my-pi/pull/16002) by [@anatoli-tsinovoy](https://github.com/anatoli-tsinovoy))
75
+ - Fixed Bedrock sessions rejecting replayed tool names over 64 characters after a model switch ([#15839](https://github.com/can1357/oh-my-pi/issues/15839))
76
+ - Anthropic's `request-encoding-rejection` now also matches the API's "request body is not valid JSON" 400, which a gzip body gets when a proxy drops its `Content-Encoding` header ([#16108](https://github.com/can1357/oh-my-pi/pull/16108) by [@alphastorm](https://github.com/alphastorm))
77
+
78
+ ### Removed
79
+
80
+ - Removed the Codex `toolMode` model field (`code_mode_only`); Codex discovery no longer maps `tool_mode`
81
+
3
82
  ## [1.2.0] - 2026-10-12
4
83
 
5
84
  - 版本线推进至 1.2.0;本版无独立用户可见变化。
package/README.md CHANGED
@@ -47,12 +47,14 @@ The `models` subpath (also exported from the root) provides timestamp-aware pric
47
47
  | `calculateCost(model, usage, timestamp?)` | Updates and returns `usage.cost` using `model.cost`. |
48
48
  | `calculateUsageCost(cost, usage, timestamp?)` | Updates and returns `usage.cost` using a `ModelCost`. |
49
49
  | `calculateUncachedInputCost(cost, promptInputTokens, timestamp?)` | Returns the cost of a fully uncached prompt. |
50
- | `getTimeBasedPricingPeriod(cost, timestamp?)` | Returns `"peak"`, `"off-peak"`, or `undefined` without a schedule. |
50
+ | `getEffectiveTokenCost(cost, timestamp?)` | Returns the base card in force: the latest due effective rate, else the row's own legs. |
51
+ | `getTimeBasedPricingPeriod(cost, timestamp?)` | Returns `"peak"`, `"off-peak"`, or `undefined` without a recurring tariff. |
52
+ | `hasRecurringTariff(schedule)` | Whether a `TimeBasedCost` carries a peak/off-peak tariff rather than only dated rate cards. |
51
53
  | `getNextTimeBasedPricingTransition(cost, timestamp?)` | Returns the next actual peak/off-peak change strictly after the timestamp, or `undefined` if none exists. |
52
54
 
53
55
  Timestamps are Unix milliseconds; omitted timestamps use the current time for scheduled pricing. Flat token prices are unaffected. Pricing selects the latest applicable effective rate card, then its long-context tier, then the peak/off-peak multiplier. A transition query concerns the recurring tariff, not dated rate-card changes.
54
56
 
55
- `ModelCost.timeBased` is optional typed metadata (`TimeBasedCost`): `offPeakMultiplier`, `peakWindows` (UTC `weekdays`, Sunday = 0, and start-inclusive/end-exclusive `startMinute`/`endMinute`), and optional `effectiveRates`. Each effective rate is a complete `TokenCost` with an `effectiveFrom` Unix-millisecond timestamp and optional `longContext` tier, replacing the base card from that instant.
57
+ `ModelCost.timeBased` is optional typed metadata (`TimeBasedCost`): `offPeakMultiplier`, `peakWindows` (UTC `weekdays`, Sunday = 0, and start-inclusive/end-exclusive `startMinute`/`endMinute`), and optional `effectiveRates`. Each effective rate is a complete `TokenCost` with an `effectiveFrom` Unix-millisecond timestamp and optional `longContext` tier, replacing the base card from that instant. A schedule with no peak windows at a 1x off-peak multiplier has no recurring tariff, only dated rate cards: `cost-patch`/`cost-fallback` `effective-rates` compile to one, so a row built before a scheduled price change still prices later requests at the new card.
56
58
 
57
59
  Pass the request-start timestamp when estimating request usage, then preserve the resulting monetary amounts rather than repricing history at display time. OMP does this using the assistant message timestamp; it is an estimation convention, not a claim about server billing across boundaries. Prefer monetary costs reported by a provider when available.
58
60
 
@@ -8,8 +8,8 @@ no rights in third-party code, fonts, data, or marks identified below.
8
8
  PYTHON DEPENDENCY DISTRIBUTION ROLE
9
9
  ===================================
10
10
 
11
- omp-rpc has no third-party runtime dependencies. robomp declares FastAPI,
12
- Uvicorn, HTTPX, Pydantic, pydantic-settings, python-dotenv, Click, and omp-rpc
11
+ zeta-rpc has no third-party runtime dependencies. robomp declares FastAPI,
12
+ Uvicorn, HTTPX, Pydantic, pydantic-settings, python-dotenv, Click, and zeta-rpc
13
13
  as ordinary installer-resolved dependencies. The Python wheels do not vendor
14
14
  those projects; each dependency remains a separately installed distribution
15
15
  carrying its own license metadata and files. Container/system assemblers must
@@ -79,9 +79,9 @@ uutils coreutils (https://github.com/uutils/coreutils), MIT
79
79
  --------------------------------------------------------------------------------
80
80
  Covers: base32, base64, basename, cat, cksum (shared checksum machinery),
81
81
  b2sum, md5sum, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, comm, cp,
82
- cut, date, dirname, head, hostname, ln, ls, mkdir, mktemp, mv, nproc, paste,
83
- printenv, readlink, realpath, rm, seq, sort, stat, tac, tail, tee, touch, tr,
84
- truncate, uname, uniq, wc, whoami, yes.
82
+ cut, date, dirname, head, hostname, ln, ls, mkdir, mktemp, mv, nl, nproc,
83
+ paste, printenv, readlink, realpath, rm, seq, sort, stat, tac, tail, tee,
84
+ touch, tr, truncate, uname, uniq, wc, whoami, yes.
85
85
 
86
86
  Copyright (c) uutils developers
87
87
 
@@ -824,6 +824,56 @@ public licenses.
824
824
 
825
825
  Creative Commons may be contacted at creativecommons.org.
826
826
 
827
+ -------------------------------------------------------------------------------
828
+ scripts/brand/fonts/ANSI Shadow.flf, scripts/brand/fonts/mini.flf
829
+
830
+ Two FIGlet font files from the standard FIGlet font distribution — the
831
+ figlet.org font set shipped by figlet.js
832
+ (https://github.com/patorjk/figlet.js/tree/master/fonts), fetched from
833
+ figlet.js 1.8.0 — vendored so the welcome/splash brand art
834
+ (`packages/tui/src/prompt/welcome.ts`) is generated reproducibly and offline
835
+ by `bun scripts/brand/generate-logo-art.ts`. Both files are unmodified and
836
+ retain their original FIGlet headers. They are build-time inputs only: no font
837
+ file or font data is compiled into, or shipped with, a Zeta release artifact.
838
+ The fonts' own headers carry their terms:
839
+
840
+ - `ANSI Shadow.flf` — "ANSI Shadow". Author unknown ("Font Author: ?" in the
841
+ header); a TheDraw-archive font converted with the FIGlet font editor
842
+ (http://patorjk.com/figfont-editor). Distributed under the FIGlet font
843
+ license as carried by the standard FIGlet font set: free to use and
844
+ redistribute with the header intact.
845
+ - `mini.flf` — "mini" by Glenn Chappell (4/93), from figlet release 2.1
846
+ (12 Aug 1994), "Includes ISO Latin-1"; modified by Paul Burton
847
+ <solution@earthlink.net> 12/96. Header grant: "Permission is hereby given to
848
+ modify this font, as long as the modifier's name is placed on a comment
849
+ line."
850
+
851
+ FIGlet renderer — `figlet` 1.8.0 (https://github.com/patorjk/figlet.js), a
852
+ root devDependency used only to generate the art at build time; it is not
853
+ imported by any runtime bundle or shipped artifact.
854
+
855
+ MIT License
856
+
857
+ Copyright (C) 2014-present Patrick Gillespie and other contributors
858
+
859
+ Permission is hereby granted, free of charge, to any person obtaining a copy
860
+ of this software and associated documentation files (the "Software"), to deal
861
+ in the Software without restriction, including without limitation the rights
862
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
863
+ copies of the Software, and to permit persons to whom the Software is
864
+ furnished to do so, subject to the following conditions:
865
+
866
+ The above copyright notice and this permission notice shall be included in
867
+ all copies or substantial portions of the Software.
868
+
869
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
870
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
871
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
872
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
873
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
874
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
875
+ SOFTWARE.
876
+
827
877
  BUN / NPM DEPENDENCY INVENTORY
828
878
  ==============================
829
879
  This inventory is traversed from bun.lock, not from the host node_modules tree.
@@ -9,8 +9,9 @@
9
9
  import { type Api, type Model, type ModelSpec } from "./types.js";
10
10
  /**
11
11
  * Applies reviewed catalog-data value corrections (`cost-patch`,
12
- * `cache-read-at-input-rate`, `limits-patch`, `long-context-cost`,
13
- * `context-window-floor`, `input-modalities`) onto an upstream-sourced spec. Applied by
12
+ * `cache-read-at-input-rate`, `cache-write-rate`, `limits-patch`,
13
+ * `long-context-cost`, `context-window-floor`, `input-modalities`) onto an
14
+ * upstream-sourced spec. Applied by
14
15
  * `buildModel` to every upstream-sourced spec; user-authored overrides are
15
16
  * recomposed after building by the override applicators, so explicit user
16
17
  * limits and pricing still win.
@@ -1,4 +1,4 @@
1
1
  /** Every provider with an `auth/<id>.kdl` policy. */
2
- export type AuthProviderId = "abliteration" | "aiand" | "aimlapi" | "alibaba-coding-plan" | "alibaba-token-plan" | "amazon-bedrock" | "anthropic" | "apple" | "azure" | "baseten" | "bedrock-mantle" | "cerebras" | "charm-hyper" | "cline-pass" | "cloudflare-ai-gateway" | "cloudflare-workers-ai" | "commandcode" | "coralbricks" | "coreweave" | "cursor" | "deepinfra" | "deepseek" | "devin" | "exa" | "factory-droid" | "firepass" | "fireworks" | "github-copilot" | "gitlab-duo" | "gitlab-duo-agent" | "gmi-cloud" | "google" | "google-antigravity" | "google-gemini-cli" | "google-vertex" | "groq" | "helmcode" | "huggingface" | "kagi" | "kilo" | "kimi-code" | "litellm" | "llama.cpp" | "lm-studio" | "local" | "meta" | "minimax" | "minimax-code" | "minimax-code-cn" | "mistral" | "moonshot" | "muse-code" | "nanogpt" | "novita" | "nvidia" | "ollama" | "ollama-cloud" | "openai" | "openai-codex" | "openai-codex-device" | "opencode-go" | "opencode-zen" | "openrouter" | "parallel" | "perplexity" | "qianfan" | "qwen-portal" | "sakana" | "siliconflow" | "siliconflow-cn" | "singularityapi-dev" | "singularityapi-tech" | "snowflake" | "stencil" | "stepfun" | "synthetic" | "tavily" | "together" | "typesafe" | "umans" | "venice" | "vercel-ai-gateway" | "vllm" | "wafer-serverless" | "web" | "xai" | "xai-oauth" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "yolo-auto" | "zai" | "zai-coding-plan" | "zenmux" | "zhipu-coding-plan";
2
+ export type AuthProviderId = "abliteration" | "aiand" | "aimlapi" | "alibaba-coding-plan" | "alibaba-token-plan" | "amazon-bedrock" | "anthropic" | "apple" | "azure" | "baseten" | "bedrock-mantle" | "cerebras" | "charm-hyper" | "cline-pass" | "cloudflare-ai-gateway" | "cloudflare-workers-ai" | "commandcode" | "coralbricks" | "coreweave" | "cursor" | "deepinfra" | "deepseek" | "devin" | "exa" | "factory-droid" | "firepass" | "fireworks" | "github-copilot" | "gitlab-duo" | "gitlab-duo-agent" | "gmi-cloud" | "google" | "google-antigravity" | "google-gemini-cli" | "google-vertex" | "groq" | "helmcode" | "huggingface" | "kagi" | "kilo" | "kimi-code" | "litellm" | "llama.cpp" | "lm-studio" | "local" | "meta" | "minimax" | "minimax-code" | "minimax-code-cn" | "mistral" | "moonshot" | "muse-code" | "nanogpt" | "novita" | "nvidia" | "ollama" | "ollama-cloud" | "openai" | "openai-codex" | "openai-codex-device" | "opencode-go" | "opencode-zen" | "openrouter" | "parallel" | "perplexity" | "qianfan" | "qwen-portal" | "sakana" | "sambanova" | "siliconflow" | "siliconflow-cn" | "singularityapi-dev" | "singularityapi-tech" | "snowflake" | "stencil" | "stepfun" | "synthetic" | "tavily" | "together" | "typesafe" | "umans" | "venice" | "vercel-ai-gateway" | "vllm" | "wafer-serverless" | "web" | "xai" | "xai-oauth" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "yolo-auto" | "zai" | "zai-coding-plan" | "zenmux" | "zhipu-coding-plan";
3
3
  /** Providers whose policy declares a `login` flow (the `/login` roster). */
4
- export type LoginProviderId = "abliteration" | "aiand" | "alibaba-coding-plan" | "alibaba-token-plan" | "anthropic" | "baseten" | "cerebras" | "charm-hyper" | "cline-pass" | "cloudflare-ai-gateway" | "cloudflare-workers-ai" | "commandcode" | "coralbricks" | "coreweave" | "cursor" | "deepinfra" | "deepseek" | "devin" | "exa" | "factory-droid" | "firepass" | "fireworks" | "github-copilot" | "gitlab-duo" | "gitlab-duo-agent" | "gmi-cloud" | "google-antigravity" | "google-gemini-cli" | "helmcode" | "huggingface" | "kagi" | "kilo" | "kimi-code" | "litellm" | "llama.cpp" | "lm-studio" | "meta" | "minimax-code" | "minimax-code-cn" | "moonshot" | "muse-code" | "nanogpt" | "novita" | "nvidia" | "ollama" | "ollama-cloud" | "openai-codex" | "openai-codex-device" | "opencode-go" | "opencode-zen" | "openrouter" | "parallel" | "perplexity" | "qianfan" | "qwen-portal" | "sakana" | "siliconflow" | "siliconflow-cn" | "singularityapi-dev" | "singularityapi-tech" | "snowflake" | "stencil" | "stepfun" | "synthetic" | "tavily" | "together" | "typesafe" | "umans" | "venice" | "vercel-ai-gateway" | "vllm" | "wafer-serverless" | "xai" | "xai-oauth" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "yolo-auto" | "zai" | "zai-coding-plan" | "zenmux" | "zhipu-coding-plan";
4
+ export type LoginProviderId = "abliteration" | "aiand" | "alibaba-coding-plan" | "alibaba-token-plan" | "anthropic" | "baseten" | "cerebras" | "charm-hyper" | "cline-pass" | "cloudflare-ai-gateway" | "cloudflare-workers-ai" | "commandcode" | "coralbricks" | "coreweave" | "cursor" | "deepinfra" | "deepseek" | "devin" | "exa" | "factory-droid" | "firepass" | "fireworks" | "github-copilot" | "gitlab-duo" | "gitlab-duo-agent" | "gmi-cloud" | "google-antigravity" | "google-gemini-cli" | "helmcode" | "huggingface" | "kagi" | "kilo" | "kimi-code" | "litellm" | "llama.cpp" | "lm-studio" | "meta" | "minimax-code" | "minimax-code-cn" | "moonshot" | "muse-code" | "nanogpt" | "novita" | "nvidia" | "ollama" | "ollama-cloud" | "openai-codex" | "openai-codex-device" | "opencode-go" | "opencode-zen" | "openrouter" | "parallel" | "perplexity" | "qianfan" | "qwen-portal" | "sakana" | "sambanova" | "siliconflow" | "siliconflow-cn" | "singularityapi-dev" | "singularityapi-tech" | "snowflake" | "stencil" | "stepfun" | "synthetic" | "tavily" | "together" | "typesafe" | "umans" | "venice" | "vercel-ai-gateway" | "vllm" | "wafer-serverless" | "xai" | "xai-oauth" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "yolo-auto" | "zai" | "zai-coding-plan" | "zenmux" | "zhipu-coding-plan";
@@ -16,7 +16,7 @@ export type AxisShape = "scalar" | "array" | "object";
16
16
  /** Axis namespace: request-wire compat, thinking control surface, or catalog metadata. */
17
17
  export type AxisSet = "wire" | "thinking" | "catalog";
18
18
  /** Resolved compat record families a wire axis may be assigned onto. */
19
- export type CompatRecordName = "openai" | "openai-responses" | "anthropic" | "bedrock" | "devin" | "google" | "request";
19
+ export type CompatRecordName = "openai" | "openai-responses" | "anthropic" | "bedrock" | "devin" | "google" | "request" | "ollama";
20
20
  /** One axis definition: resolved key, namespace, shape, and applicability. */
21
21
  export interface AxisDef {
22
22
  /** Resolved camelCase field the directive assigns. */
@@ -78,3 +78,8 @@ export declare function pricingPeerFor(provider: string, model: string): {
78
78
  peers: readonly string[];
79
79
  peerId: string;
80
80
  } | undefined;
81
+ /**
82
+ * Built-in default model selector chains per agent role (`smol`, `slow`,
83
+ * `image`, …), most preferred first, in declaration order.
84
+ */
85
+ export declare function roleDefaultModels(): Readonly<Record<string, readonly string[]>>;
@@ -0,0 +1,8 @@
1
+ import type { Model } from "../types.js";
2
+ /**
3
+ * Whether {@link url} is HTTPS to {@link model}'s provider's own endpoint: the
4
+ * host of its bundled base URL or one of its `endpoint-hosts`. A custom model
5
+ * or provider override that keeps a catalog provider id but points `baseUrl`
6
+ * at a gateway, proxy, or local server is not.
7
+ */
8
+ export declare function isCatalogEndpointUrl(model: Model, url: string | undefined): boolean;
@@ -23,7 +23,7 @@ export interface OpenAiPatchTokenization {
23
23
  auto: "high" | "original";
24
24
  }
25
25
  /** One model line's image billing rule: the vendor formula and its per-model numbers. */
26
- export type ImageTokenization = OpenAiPatchTokenization
26
+ export type ImageTokenization = (OpenAiPatchTokenization
27
27
  /** Anthropic 28px patches, resized to fit a padded-edge limit and a visual-token budget. */
28
28
  | {
29
29
  regime: "anthropic-patch";
@@ -34,6 +34,9 @@ export type ImageTokenization = OpenAiPatchTokenization
34
34
  | {
35
35
  regime: "fixed";
36
36
  tokens: number;
37
+ }) & {
38
+ /** Provider billing was measured to match this rule; unset for docs-only rules and wire fallbacks. */
39
+ verified?: boolean;
37
40
  };
38
41
  /** What reads the image: a built model, any `{ id }` with optional host and identity, or just a wire `{ api }`. */
39
42
  export interface ImageTokenizationTarget {
@@ -48,5 +51,10 @@ export interface ImageTokenizationTarget {
48
51
  * unregistered API).
49
52
  */
50
53
  export declare function resolveImageTokenization(target: ImageTokenizationTarget): ImageTokenization | undefined;
54
+ /**
55
+ * Longest image edge the reader's host passes to the model (`image-max-edge`),
56
+ * or undefined when the host keeps the image's size.
57
+ */
58
+ export declare function resolveImageMaxEdge(target: ImageTokenizationTarget): number | undefined;
51
59
  /** Billed input tokens for one image of `size` under `rule`; only `openai-patch` reads `detail`. */
52
60
  export declare function imageTokens(rule: ImageTokenization, size: ImageSize, detail?: ImageDetail): number;
@@ -0,0 +1,25 @@
1
+ import type { Model } from "../types.js";
2
+ /** Bounds a judgment model applies to image inputs. */
3
+ export interface JudgmentImageInput {
4
+ /** Accepted lowercase MIME types; unset adds no model-specific format restriction. */
5
+ mimeTypes?: readonly string[];
6
+ /** Images per request. */
7
+ maxCount?: number;
8
+ /** Decoded bytes per image. */
9
+ maxBytes?: number;
10
+ /** Decoded bytes across all images. */
11
+ maxTotalBytes?: number;
12
+ /** Pixels per image, when the image header reports dimensions. */
13
+ maxPixels?: number;
14
+ /** Minimum pixels per image, when the image header reports dimensions. */
15
+ minPixels?: number;
16
+ /** Inclusive bounds on each side, when the image header reports dimensions. */
17
+ minSide?: number;
18
+ maxSide?: number;
19
+ }
20
+ /**
21
+ * Resolve image bounds assigned to this model by the catalog cascade. KDL
22
+ * object payloads have scalar children, so `mime-types` is authored as a
23
+ * comma-separated string and normalized here to the public array type.
24
+ */
25
+ export declare function resolveJudgmentImageInput(model: Model): JudgmentImageInput | undefined;
@@ -1,2 +1,2 @@
1
1
  /** Every chat-model provider with a catalog entry (`default-model` in its provider rules). */
2
- export type KnownProvider = "abliteration" | "aiand" | "aimlapi" | "alibaba-coding-plan" | "alibaba-token-plan" | "amazon-bedrock" | "anthropic" | "apple" | "azure" | "baseten" | "bedrock-mantle" | "cerebras" | "charm-hyper" | "cline-pass" | "cloudflare-ai-gateway" | "cloudflare-workers-ai" | "commandcode" | "coralbricks" | "coreweave" | "cursor" | "deepinfra" | "deepseek" | "devin" | "factory-droid" | "firepass" | "fireworks" | "github-copilot" | "gitlab-duo" | "gitlab-duo-agent" | "gmi-cloud" | "google" | "google-antigravity" | "google-gemini-cli" | "google-vertex" | "groq" | "helmcode" | "huggingface" | "kilo" | "kimi-code" | "litellm" | "lm-studio" | "local" | "meta" | "minimax" | "minimax-code" | "minimax-code-cn" | "mistral" | "moonshot" | "muse-code" | "nanogpt" | "novita" | "nvidia" | "ollama" | "ollama-cloud" | "openai" | "openai-codex" | "opencode-go" | "opencode-zen" | "openrouter" | "qianfan" | "qwen-portal" | "sakana" | "siliconflow" | "siliconflow-cn" | "singularityapi-dev" | "singularityapi-tech" | "snowflake" | "stepfun" | "synthetic" | "together" | "typesafe" | "umans" | "venice" | "vercel-ai-gateway" | "vllm" | "wafer-serverless" | "web" | "xai" | "xai-oauth" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "yolo-auto" | "zai" | "zenmux" | "zhipu-coding-plan";
2
+ export type KnownProvider = "abliteration" | "aiand" | "aimlapi" | "alibaba-coding-plan" | "alibaba-token-plan" | "amazon-bedrock" | "anthropic" | "apple" | "azure" | "baseten" | "bedrock-mantle" | "cerebras" | "charm-hyper" | "cline-pass" | "cloudflare-ai-gateway" | "cloudflare-workers-ai" | "commandcode" | "coralbricks" | "coreweave" | "cursor" | "deepinfra" | "deepseek" | "devin" | "factory-droid" | "firepass" | "fireworks" | "github-copilot" | "gitlab-duo" | "gitlab-duo-agent" | "gmi-cloud" | "google" | "google-antigravity" | "google-gemini-cli" | "google-vertex" | "groq" | "helmcode" | "huggingface" | "kilo" | "kimi-code" | "litellm" | "lm-studio" | "local" | "meta" | "minimax" | "minimax-code" | "minimax-code-cn" | "mistral" | "moonshot" | "muse-code" | "nanogpt" | "novita" | "nvidia" | "ollama" | "ollama-cloud" | "openai" | "openai-codex" | "opencode-go" | "opencode-zen" | "openrouter" | "qianfan" | "qwen-portal" | "sakana" | "sambanova" | "siliconflow" | "siliconflow-cn" | "singularityapi-dev" | "singularityapi-tech" | "snowflake" | "stepfun" | "synthetic" | "together" | "typesafe" | "umans" | "venice" | "vercel-ai-gateway" | "vllm" | "wafer-serverless" | "web" | "xai" | "xai-oauth" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "yolo-auto" | "zai" | "zenmux" | "zhipu-coding-plan";
@@ -0,0 +1,23 @@
1
+ import type { Model } from "../types.js";
2
+ /** `Content-Encoding` values a host may accept on request bodies. */
3
+ export type RequestBodyEncoding = "zstd" | "gzip";
4
+ /** Request-body compression contract for one request. */
5
+ export interface RequestCompressionPolicy {
6
+ /** Accepted encodings, most preferred first. */
7
+ readonly encodings: readonly RequestBodyEncoding[];
8
+ /**
9
+ * Pattern of a JSON 400/415 error body that rejects the encoding;
10
+ * `undefined` treats every JSON 400/415 as a possible rejection. A
11
+ * 400/403/415 whose body is not JSON (presumed a proxy's answer, not the
12
+ * host's) is a possible rejection either way.
13
+ */
14
+ readonly rejection: RegExp | undefined;
15
+ }
16
+ /**
17
+ * Compression contract for a request from {@link model} to {@link url}, or
18
+ * `undefined` when the body must go uncompressed. The `request-encodings` axis
19
+ * applies only while the URL reaches the provider's own endpoint
20
+ * ({@link isCatalogEndpointUrl}): a proxy, relay, or rerouted base URL never
21
+ * receives bytes it cannot read.
22
+ */
23
+ export declare function resolveRequestCompression(model: Model, url: string): RequestCompressionPolicy | undefined;
@@ -1,7 +1,16 @@
1
1
  import type { Model } from "../types.js";
2
2
  /**
3
3
  * Maximum encoded inline-image bytes retained per request for a deployment with a documented body-size limit.
4
- * The axis is a host contract: a rerouted `baseUrl` (proxy, gateway) imposes its own limit, so the budget
5
- * applies only while the model targets its official endpoint.
4
+ * The axis is a host contract: a rerouted endpoint (proxy, gateway) imposes its own limit, so the budget applies
5
+ * only when `officialEndpoint` says the request reaches the model's official endpoint. `compat.officialEndpoint`
6
+ * classifies only the configured `baseUrl`; pi-ai's `reachesOfficialEndpoint` also follows request-time reroutes.
6
7
  */
7
- export declare function resolveInlineImageByteBudget(model: Model): number | undefined;
8
+ export declare function resolveInlineImageByteBudget(model: Model, officialEndpoint: boolean): number | undefined;
9
+ /**
10
+ * Most images one request to this deployment may carry, or `undefined` when no rule names the host. A configured
11
+ * `model.imageCountBudget` wins: the user knows the host behind a custom gateway. Otherwise the
12
+ * `official-image-count-budget` axis replaces `image-count-budget` only when `officialEndpoint` says the request
13
+ * reaches the model's official endpoint (see {@link resolveInlineImageByteBudget}); a rerouted endpoint keeps the
14
+ * provider's generic budget.
15
+ */
16
+ export declare function resolveImageCountBudget(model: Model, officialEndpoint: boolean): number | undefined;
@@ -0,0 +1,9 @@
1
+ import type { ImageTokenizationTarget } from "./image-tokenization.js";
2
+ /**
3
+ * `output`: the reasoning the signature carries, at the size its turn billed
4
+ * as output; the signature's own bytes are free. `signature`: the signature's
5
+ * bytes stand in for that reasoning.
6
+ */
7
+ export type ThinkingReplayTokens = "output" | "signature";
8
+ /** How `reader` bills replayed thinking; `signature` unless its lineage declares otherwise. */
9
+ export declare function resolveThinkingReplayTokens(reader: ImageTokenizationTarget): ThinkingReplayTokens;
@@ -328,6 +328,8 @@ export interface CompiledBehavior {
328
328
  retryResetTimezones: CompiledRetryResetTimezone[];
329
329
  retiredProviders: string[];
330
330
  referenceIsolatedProviders: string[];
331
+ /** Built-in model selector chains per agent role, keyed by role in declaration order. */
332
+ roleDefaults: Record<string, string[]>;
331
333
  }
332
334
  /**
333
335
  * A string setting from `auth/*.kdl` that may be overridden by environment
@@ -634,6 +636,8 @@ export interface CompiledProvider {
634
636
  dynamicModelsAuthoritative?: boolean;
635
637
  /** Generator backfills never copy reasoning/input/limits from same-id rows on other hosts. */
636
638
  skipCrossProviderReferenceFills?: boolean;
639
+ /** Runtime discovery keeps a bundled row's display name instead of the live one. */
640
+ keepBundledNames?: boolean;
637
641
  /** Present only for providers enrolled in `generate-models.ts` discovery. */
638
642
  discovery?: CompiledProviderDiscovery;
639
643
  /** Non-chat model kinds mapped to their runtime transport APIs. */
@@ -18,6 +18,13 @@ export interface AntigravityDiscoveryApiModel {
18
18
  apiProvider?: string;
19
19
  modelProvider?: string;
20
20
  isInternal?: boolean;
21
+ /**
22
+ * Set for roster rows the backend lists but refuses to serve on this
23
+ * account (e.g. `gemini-4-argon-disabled`, `tagTitle: "Unavailable"`,
24
+ * `model: MODEL_PLACEHOLDER_M421`); a request against such an id answers
25
+ * `Cloud Code Assist API error (404): Requested entity was not found.`
26
+ */
27
+ disabled?: boolean;
21
28
  supportsVideo?: boolean;
22
29
  }
23
30
  /**
@@ -20,6 +20,13 @@ export interface CacheEntry<TApi extends Api = Api> {
20
20
  models: Model<TApi>[];
21
21
  fresh: boolean;
22
22
  authoritative: boolean;
23
+ /**
24
+ * `authoritative` of the payload row itself, ignoring the
25
+ * `model_cache_refresh` side row. A failed refresh flips only the side row
26
+ * (freshness plus retry backoff), so this keeps answering "were `models`
27
+ * written by an authoritative discovery result?" after such a write.
28
+ */
29
+ payloadAuthoritative: boolean;
23
30
  updatedAt: number;
24
31
  /** Model ids whose live headers were intentionally omitted from disk. */
25
32
  headerOmittedModelIds: readonly string[];
@@ -51,6 +51,12 @@ export interface ModelManagerOptions<TApi extends Api = Api, TModelsDevPayload =
51
51
  * a zero discovery price is treated as unknown and the bundled rate is kept.
52
52
  */
53
53
  dynamicCostAuthoritative?: boolean;
54
+ /**
55
+ * When true, a static row's display name wins over the cached or live row
56
+ * for the same id, so a model keeps one name before and after discovery.
57
+ * Set from the provider's `keep-bundled-names` catalog entry.
58
+ */
59
+ keepStaticNames?: boolean;
54
60
  /**
55
61
  * When true, a fresh cache never satisfies an online-eligible refresh: the
56
62
  * dynamic fetch always runs (an explicit `"offline"` strategy is still
@@ -7,7 +7,7 @@
7
7
  * id parsing, no host matching, no compat detection per request.
8
8
  */
9
9
  import { Effort } from "./effort.js";
10
- import type { Api, Model, ModelSpec } from "./types.js";
10
+ import type { Api, Model, ModelSpec, ThinkingConfig } from "./types.js";
11
11
  /**
12
12
  * Runtime helpers read baked metadata only, so they accept both pre-build
13
13
  * specs and built models.
@@ -19,6 +19,16 @@ type ApiModel<TApi extends Api = Api> = ModelSpec<TApi> | Model<TApi>;
19
19
  * controllable effort surface (`thinking: undefined`).
20
20
  */
21
21
  export declare function getSupportedEfforts<TApi extends Api>(model: ApiModel<TApi>): readonly Effort[];
22
+ /**
23
+ * Neutral view of a model whose thinking ladder is unverified: `reasoning: false`
24
+ * and no ladder. Re-entering policy resolution starts from it (the ladder is
25
+ * derived output, not authored input), and requests without an effort send it so
26
+ * no reasoning or disable fields reach an upstream that may reject them.
27
+ */
28
+ export declare function withoutUnverifiedThinking<T extends {
29
+ reasoning: boolean;
30
+ thinking?: ThinkingConfig;
31
+ }>(model: T): T;
22
32
  /**
23
33
  * Clamps a requested thinking level against explicit model metadata.
24
34
  *
@@ -1,5 +1,5 @@
1
1
  import MODELS from "./models.json";
2
- import type { Api, KnownProvider, Model, ModelCost, ModelPricingStatus, Usage } from "./types.js";
2
+ import type { Api, KnownProvider, Model, ModelCost, ModelPricingStatus, TimeBasedCost, TokenCost, Usage } from "./types.js";
3
3
  export type GeneratedProvider = keyof typeof MODELS;
4
4
  /** Whether `provider` has bundled rows in models.json (e.g. a provider id authored in KDL). */
5
5
  export declare function isGeneratedProvider(provider: string): provider is GeneratedProvider;
@@ -8,6 +8,21 @@ export declare function getBundledProviders(): KnownProvider[];
8
8
  export declare function getBundledModels(provider: GeneratedProvider): Model<Api>[];
9
9
  /** Resolve display semantics without mistaking an absent rate card for a free model. */
10
10
  export declare function getModelPricingStatus(model: Pick<Model<Api>, "cost" | "pricingStatus">): ModelPricingStatus;
11
+ /**
12
+ * The base token card in force at `timestamp` (Unix ms, default now): the
13
+ * latest due `timeBased` effective rate, else the row's own legs. Price
14
+ * displays read this rather than the scalar legs, which keep the card current
15
+ * when the row was built while bundles, caches, and long sessions outlive it.
16
+ * Applies no long-context tier or peak/off-peak multiplier.
17
+ */
18
+ export declare function getEffectiveTokenCost(cost: ModelCost, timestamp?: number): TokenCost;
19
+ /**
20
+ * Whether a schedule carries a recurring peak/off-peak tariff. A schedule with
21
+ * no peak windows at a 1x off-peak multiplier only carries dated rate cards
22
+ * (`cost-patch`/`cost-fallback` `effective-rates`): its price changes on a
23
+ * date, never by time of day.
24
+ */
25
+ export declare function hasRecurringTariff(schedule: TimeBasedCost): boolean;
11
26
  /** Return the recurring UTC tariff period, independently of its monetary multiplier. */
12
27
  export declare function getTimeBasedPricingPeriod(cost: ModelCost, timestamp?: number): "peak" | "off-peak" | undefined;
13
28
  /** Return the next actual peak/off-peak change strictly after the Unix-ms timestamp. */
@@ -1,5 +1,41 @@
1
- import type { TimeBasedCost } from "./types.js";
1
+ import type { EffectiveTokenCost, ModelCost, TimeBasedCost, TokenCost } from "./types.js";
2
2
  /** Validate serialized schedules before admitting cached model rows. */
3
3
  export declare function isTimeBasedCost(value: unknown): value is TimeBasedCost;
4
4
  /** KDL object children are named records; normalize them once while constructing the model. */
5
5
  export declare function materializeTimeBasedCost(value: unknown): TimeBasedCost;
6
+ /**
7
+ * The latest `effectiveRates` card of a materialized schedule due at
8
+ * `timestamp`, or undefined before the first one (or without a schedule).
9
+ */
10
+ export declare function dueEffectiveRate(schedule: TimeBasedCost | undefined, timestamp: number): EffectiveTokenCost | undefined;
11
+ /** A `cost-patch`/`cost-fallback` dated card: the legs it overwrites from `effectiveFrom` (Unix ms). */
12
+ export interface DatedCostCard extends Partial<TokenCost> {
13
+ effectiveFrom: number;
14
+ }
15
+ /**
16
+ * Parse the compiled `effective-rates` block of a `cost-patch` or
17
+ * `cost-fallback` payload into dated cards, ascending by date. Throws on a
18
+ * malformed card, so a typo in a rule fails the build instead of silently
19
+ * leaving the old price in force.
20
+ */
21
+ export declare function parseDatedCostCards(costAxis: unknown, axis: "cost-patch" | "cost-fallback"): DatedCostCard[];
22
+ /**
23
+ * Earliest instant a rate card can name (the `Date` range minimum). A leading
24
+ * card from here holds the price in force before the first dated change.
25
+ */
26
+ export declare const EARLIEST_EFFECTIVE_FROM = -8640000000000000;
27
+ /** A schedule of dated rate cards alone: no peak windows, no off-peak discount. */
28
+ export declare const NO_RECURRING_TARIFF: TimeBasedCost;
29
+ /**
30
+ * A flat card plus its dated overrides as a request-time `ModelCost`: the
31
+ * card due at `now` in the scalar legs, and every period (a leading card for
32
+ * the base price, then each dated card over the previous one) in a
33
+ * `timeBased` schedule without a recurring tariff. The plain card when no
34
+ * dated card exists.
35
+ */
36
+ export declare function datedCost(base: TokenCost, cards: readonly DatedCostCard[], now?: number): ModelCost;
37
+ /**
38
+ * Overwrite `cost` legs with the latest dated card due at `now`. Leaves
39
+ * `cost` unchanged before the first card.
40
+ */
41
+ export declare function applyDueDatedCostCard(cost: TokenCost, cards: readonly DatedCostCard[], now?: number): void;