@linxiraos/pi-catalog 1.1.15 → 1.1.17

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 (148) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/THIRD-PARTY-NOTICES.txt +54 -25
  3. package/dist/types/compat/auth-ids.d.ts +2 -2
  4. package/dist/types/compat/behavior.d.ts +11 -0
  5. package/dist/types/compat/cascade.d.ts +16 -15
  6. package/dist/types/compat/collapse.d.ts +8 -0
  7. package/dist/types/compat/context-window.d.ts +28 -3
  8. package/dist/types/compat/delegation.d.ts +4 -0
  9. package/dist/types/compat/provider-ids.d.ts +2 -0
  10. package/dist/types/compat/providers.d.ts +11 -0
  11. package/dist/types/compat/resolve.d.ts +10 -0
  12. package/dist/types/compat/seeds-tmp.d.ts +1 -0
  13. package/dist/types/compat/taxonomy.d.ts +0 -7
  14. package/dist/types/compat/types.d.ts +104 -1
  15. package/dist/types/discovery/antigravity.d.ts +10 -1
  16. package/dist/types/discovery/gitlab-duo-workflow.d.ts +1 -1
  17. package/dist/types/model-cache.d.ts +5 -4
  18. package/dist/types/model-manager.d.ts +17 -5
  19. package/dist/types/model-thinking.d.ts +7 -0
  20. package/dist/types/model-tokenizer.d.ts +1 -1
  21. package/dist/types/provider-models/descriptor-types.d.ts +8 -51
  22. package/dist/types/provider-models/descriptors.d.ts +17 -565
  23. package/dist/types/provider-models/openai-compat.d.ts +4 -109
  24. package/dist/types/provider-models/special.d.ts +1 -14
  25. package/dist/types/types.d.ts +50 -2
  26. package/package.json +5 -5
  27. package/src/build.ts +68 -3
  28. package/src/compat/auth-ids.ts +4 -0
  29. package/src/compat/axes.ts +17 -0
  30. package/src/compat/behavior.ts +22 -2
  31. package/src/compat/cascade.ts +224 -64
  32. package/src/compat/collapse.ts +100 -8
  33. package/src/compat/context-window.ts +68 -15
  34. package/src/compat/delegation.ts +47 -2
  35. package/src/compat/provider-ids.ts +79 -0
  36. package/src/compat/providers.ts +32 -0
  37. package/src/compat/resolve.ts +56 -17
  38. package/src/compat/rules/README.md +117 -2
  39. package/src/compat/rules/auth/_order.kdl +2 -2
  40. package/src/compat/rules/auth/amazon-bedrock.kdl +1 -0
  41. package/src/compat/rules/auth/bedrock-mantle.kdl +1 -0
  42. package/src/compat/rules/auth/stencil.kdl +36 -0
  43. package/src/compat/rules/auth/typesafe.kdl +16 -0
  44. package/src/compat/rules/classes/anthropic.kdl +15 -0
  45. package/src/compat/rules/classes/deepseek.kdl +9 -1
  46. package/src/compat/rules/classes/gemini.kdl +3 -3
  47. package/src/compat/rules/classes/kimi.kdl +6 -0
  48. package/src/compat/rules/providers/abliteration.kdl +32 -0
  49. package/src/compat/rules/providers/aiand.kdl +92 -0
  50. package/src/compat/rules/providers/aimlapi.kdl +5 -0
  51. package/src/compat/rules/providers/alibaba-coding-plan.kdl +4 -0
  52. package/src/compat/rules/providers/alibaba-token-plan.kdl +114 -8
  53. package/src/compat/rules/providers/amazon-bedrock.kdl +32 -0
  54. package/src/compat/rules/providers/anthropic.kdl +44 -0
  55. package/src/compat/rules/providers/azure.kdl +9 -0
  56. package/src/compat/rules/providers/baseten.kdl +5 -0
  57. package/src/compat/rules/providers/bedrock-mantle.kdl +49 -0
  58. package/src/compat/rules/providers/cerebras.kdl +14 -0
  59. package/src/compat/rules/providers/charm-hyper.kdl +17 -0
  60. package/src/compat/rules/providers/cline-pass.kdl +5 -0
  61. package/src/compat/rules/providers/cloudflare-ai-gateway.kdl +16 -0
  62. package/src/compat/rules/providers/commandcode.kdl +30 -4
  63. package/src/compat/rules/providers/coreweave.kdl +5 -0
  64. package/src/compat/rules/providers/cursor.kdl +38 -0
  65. package/src/compat/rules/providers/deepinfra.kdl +8 -0
  66. package/src/compat/rules/providers/deepseek.kdl +9 -5
  67. package/src/compat/rules/providers/devin.kdl +88 -0
  68. package/src/compat/rules/providers/firepass.kdl +22 -0
  69. package/src/compat/rules/providers/fireworks.kdl +4 -0
  70. package/src/compat/rules/providers/github-copilot.kdl +3 -0
  71. package/src/compat/rules/providers/gitlab-duo-agent.kdl +18 -0
  72. package/src/compat/rules/providers/gitlab-duo.kdl +3 -0
  73. package/src/compat/rules/providers/gmi-cloud.kdl +27 -0
  74. package/src/compat/rules/providers/google-antigravity.kdl +2 -0
  75. package/src/compat/rules/providers/google-gemini-cli.kdl +2 -0
  76. package/src/compat/rules/providers/google-vertex.kdl +18 -0
  77. package/src/compat/rules/providers/google.kdl +3 -0
  78. package/src/compat/rules/providers/groq.kdl +3 -0
  79. package/src/compat/rules/providers/huggingface.kdl +4 -0
  80. package/src/compat/rules/providers/kilo.kdl +4 -0
  81. package/src/compat/rules/providers/kimi-code.kdl +53 -0
  82. package/src/compat/rules/providers/litellm.kdl +7 -0
  83. package/src/compat/rules/providers/lm-studio.kdl +4 -0
  84. package/src/compat/rules/providers/meta.kdl +68 -0
  85. package/src/compat/rules/providers/minimax-code-cn.kdl +3 -0
  86. package/src/compat/rules/providers/minimax-code.kdl +3 -0
  87. package/src/compat/rules/providers/minimax.kdl +3 -0
  88. package/src/compat/rules/providers/mistral.kdl +3 -0
  89. package/src/compat/rules/providers/moonshot.kdl +6 -0
  90. package/src/compat/rules/providers/muse-code.kdl +11 -0
  91. package/src/compat/rules/providers/nanogpt.kdl +4 -0
  92. package/src/compat/rules/providers/novita.kdl +5 -0
  93. package/src/compat/rules/providers/nvidia.kdl +4 -0
  94. package/src/compat/rules/providers/ollama-cloud.kdl +6 -0
  95. package/src/compat/rules/providers/ollama.kdl +7 -0
  96. package/src/compat/rules/providers/openai-codex.kdl +21 -15
  97. package/src/compat/rules/providers/openai.kdl +44 -0
  98. package/src/compat/rules/providers/opencode-go.kdl +4 -0
  99. package/src/compat/rules/providers/opencode-zen.kdl +4 -0
  100. package/src/compat/rules/providers/openrouter.kdl +10 -0
  101. package/src/compat/rules/providers/qianfan.kdl +4 -0
  102. package/src/compat/rules/providers/qwen-portal.kdl +7 -0
  103. package/src/compat/rules/providers/sakana.kdl +44 -0
  104. package/src/compat/rules/providers/siliconflow-cn.kdl +7 -0
  105. package/src/compat/rules/providers/siliconflow.kdl +7 -0
  106. package/src/compat/rules/providers/synthetic.kdl +5 -0
  107. package/src/compat/rules/providers/together.kdl +4 -0
  108. package/src/compat/rules/providers/umans.kdl +5 -0
  109. package/src/compat/rules/providers/venice.kdl +4 -0
  110. package/src/compat/rules/providers/vercel-ai-gateway.kdl +6 -0
  111. package/src/compat/rules/providers/vllm.kdl +4 -0
  112. package/src/compat/rules/providers/wafer-serverless.kdl +4 -0
  113. package/src/compat/rules/providers/xai-oauth.kdl +83 -0
  114. package/src/compat/rules/providers/xai.kdl +3 -0
  115. package/src/compat/rules/providers/xiaomi-token-plan-ams.kdl +3 -0
  116. package/src/compat/rules/providers/xiaomi-token-plan-cn.kdl +3 -0
  117. package/src/compat/rules/providers/xiaomi-token-plan-sgp.kdl +3 -0
  118. package/src/compat/rules/providers/xiaomi.kdl +4 -0
  119. package/src/compat/rules/providers/yolo-auto.kdl +58 -0
  120. package/src/compat/rules/providers/zai.kdl +32 -0
  121. package/src/compat/rules/providers/zenmux.kdl +5 -0
  122. package/src/compat/rules/providers/zhipu-coding-plan.kdl +5 -0
  123. package/src/compat/rules/runtime/behavior.kdl +23 -6
  124. package/src/compat/rules/taxonomy/deepseek.kdl +5 -0
  125. package/src/compat/rules/taxonomy/qwen.kdl +1 -0
  126. package/src/compat/rules.json +1 -19163
  127. package/src/compat/seeds-tmp.ts +3 -0
  128. package/src/compat/taxonomy.ts +73 -14
  129. package/src/compat/types.ts +111 -1
  130. package/src/discovery/antigravity.ts +80 -43
  131. package/src/discovery/devin.ts +22 -4
  132. package/src/discovery/gemini.ts +7 -2
  133. package/src/discovery/gitlab-duo-workflow.ts +12 -10
  134. package/src/identity/bundled.ts +4 -3
  135. package/src/model-cache.ts +285 -135
  136. package/src/model-manager.ts +62 -37
  137. package/src/model-thinking.ts +10 -7
  138. package/src/model-tokenizer.ts +8 -4
  139. package/src/models.json +69565 -44040
  140. package/src/provider-models/bundled-references.ts +4 -3
  141. package/src/provider-models/cache-provider-id.ts +14 -8
  142. package/src/provider-models/descriptor-types.ts +8 -52
  143. package/src/provider-models/descriptors.ts +108 -585
  144. package/src/provider-models/google.ts +4 -3
  145. package/src/provider-models/ollama.ts +11 -31
  146. package/src/provider-models/openai-compat.ts +361 -829
  147. package/src/provider-models/special.ts +5 -51
  148. package/src/types.ts +52 -0
package/CHANGELOG.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
- ## [1.1.15] - 2026-09-16
5
+ ## [1.1.16] - 2026-09-19
6
6
 
7
- - 上游 v18.1.17–v18.1.21 同步:DeepSeek V4.1 Flash 原生多模态保留图片输入;GitHub Copilot OAuth 公共 GitHub/GHE 双 client-id;renovate 系模型目录配置面。
7
+ - 上游 v18.2.5 同步:Astra 分类的确定性 override 处理。
8
8
 
@@ -10843,7 +10843,7 @@ RUST RUNTIME DEPENDENCY LICENSES
10843
10843
 
10844
10844
  Generated from Cargo.lock by cargo-about 0.8.2 in locked, offline, workspace, all-feature, all-target mode, then restricted using cargo metadata to normal and build edges reachable from the workspace (development-only edges are excluded). cargo-deny independently evaluates the complete all-target graph.
10845
10845
 
10846
- Native Opus (audiopus/audiopus_sys) and PCRE2 (pcre2/pcre2-sys) are covered by the exact crate license payloads below. inferno 0.12.8 is package-scoped as CDDL-1.0: its CDDL-covered source remains available in the locked crates.io source archive at https://crates.io/crates/inferno/0.12.8 and https://github.com/jonhoo/inferno. The full locked license text follows below.
10846
+ Native Opus (opus/opusic-sys) and PCRE2 (pcre2/pcre2-sys) are covered by the exact crate license payloads below. inferno 0.12.8 is package-scoped as CDDL-1.0: its CDDL-covered source remains available in the locked crates.io source archive at https://crates.io/crates/inferno/0.12.8 and https://github.com/jonhoo/inferno. The full locked license text follows below.
10847
10847
 
10848
10848
  -------------------------------------------------------------------------------
10849
10849
  License: Apache License 2.0 (Apache-2.0)
@@ -12509,6 +12509,58 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
12509
12509
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
12510
12510
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12511
12511
 
12512
+ -------------------------------------------------------------------------------
12513
+ License: BSD 3-Clause "New" or "Revised" License (BSD-3-Clause)
12514
+ Used by:
12515
+ - opusic-sys 0.7.5 (https://github.com/DoumanAsh/opusic-sys)
12516
+
12517
+ Full license text:
12518
+
12519
+ Copyright 2001-2023 Xiph.Org, Skype Limited, Octasic,
12520
+ Jean-Marc Valin, Timothy B. Terriberry,
12521
+ CSIRO, Gregory Maxwell, Mark Borgerding,
12522
+ Erik de Castro Lopo, Mozilla, Amazon
12523
+
12524
+ Redistribution and use in source and binary forms, with or without
12525
+ modification, are permitted provided that the following conditions
12526
+ are met:
12527
+
12528
+ - Redistributions of source code must retain the above copyright
12529
+ notice, this list of conditions and the following disclaimer.
12530
+
12531
+ - Redistributions in binary form must reproduce the above copyright
12532
+ notice, this list of conditions and the following disclaimer in the
12533
+ documentation and/or other materials provided with the distribution.
12534
+
12535
+ - Neither the name of Internet Society, IETF or IETF Trust, nor the
12536
+ names of specific contributors, may be used to endorse or promote
12537
+ products derived from this software without specific prior written
12538
+ permission.
12539
+
12540
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
12541
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
12542
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
12543
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
12544
+ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
12545
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
12546
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
12547
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
12548
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
12549
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
12550
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12551
+
12552
+ Opus is subject to the royalty-free patent licenses which are
12553
+ specified at:
12554
+
12555
+ Xiph.Org Foundation:
12556
+ https://datatracker.ietf.org/ipr/1524/
12557
+
12558
+ Microsoft Corporation:
12559
+ https://datatracker.ietf.org/ipr/1914/
12560
+
12561
+ Broadcom Corporation:
12562
+ https://datatracker.ietf.org/ipr/1526/
12563
+
12512
12564
  -------------------------------------------------------------------------------
12513
12565
  License: BSD 3-Clause "New" or "Revised" License (BSD-3-Clause)
12514
12566
  Used by:
@@ -13290,29 +13342,6 @@ jurisdiction of the Federal Courts of the Northern District of
13290
13342
  California and the state courts of the State of California, with
13291
13343
  venue lying in Santa Clara County, California.
13292
13344
 
13293
- -------------------------------------------------------------------------------
13294
- License: ISC License (ISC)
13295
- Used by:
13296
- - audiopus_sys 0.2.2 (https://github.com/lakelezz/audiopus_sys.git)
13297
-
13298
- Full license text:
13299
-
13300
- ISC License
13301
-
13302
- Copyright (c) 2019, Lakelezz
13303
-
13304
- Permission to use, copy, modify, and/or distribute this software for any
13305
- purpose with or without fee is hereby granted, provided that the above
13306
- copyright notice and this permission notice appear in all copies.
13307
-
13308
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13309
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13310
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13311
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13312
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13313
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13314
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13315
-
13316
13345
  -------------------------------------------------------------------------------
13317
13346
  License: ISC License (ISC)
13318
13347
  Used by:
@@ -18734,7 +18763,7 @@ DEALINGS IN THE SOFTWARE.
18734
18763
  -------------------------------------------------------------------------------
18735
18764
  License: MIT License (MIT)
18736
18765
  Used by:
18737
- - opus 0.3.1 (https://github.com/SpaceManiac/opus-rs)
18766
+ - opus 0.4.0 (https://github.com/SpaceManiac/opus-rs)
18738
18767
 
18739
18768
  Full license text:
18740
18769
 
@@ -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" | "azure" | "baseten" | "bedrock-mantle" | "cerebras" | "charm-hyper" | "cline-pass" | "cloudflare-ai-gateway" | "commandcode" | "coreweave" | "cursor" | "deepinfra" | "deepseek" | "devin" | "exa" | "firepass" | "fireworks" | "github-copilot" | "gitlab-duo" | "gitlab-duo-agent" | "gmi-cloud" | "google" | "google-antigravity" | "google-gemini-cli" | "google-vertex" | "groq" | "huggingface" | "kagi" | "kilo" | "kimi-code" | "litellm" | "llama.cpp" | "lm-studio" | "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" | "synthetic" | "tavily" | "together" | "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";
2
+ export type AuthProviderId = "abliteration" | "aiand" | "aimlapi" | "alibaba-coding-plan" | "alibaba-token-plan" | "amazon-bedrock" | "anthropic" | "azure" | "baseten" | "bedrock-mantle" | "cerebras" | "charm-hyper" | "cline-pass" | "cloudflare-ai-gateway" | "commandcode" | "coreweave" | "cursor" | "deepinfra" | "deepseek" | "devin" | "exa" | "firepass" | "fireworks" | "github-copilot" | "gitlab-duo" | "gitlab-duo-agent" | "gmi-cloud" | "google" | "google-antigravity" | "google-gemini-cli" | "google-vertex" | "groq" | "huggingface" | "kagi" | "kilo" | "kimi-code" | "litellm" | "llama.cpp" | "lm-studio" | "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" | "stencil" | "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";
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" | "commandcode" | "coreweave" | "cursor" | "deepinfra" | "deepseek" | "devin" | "exa" | "firepass" | "fireworks" | "github-copilot" | "gitlab-duo" | "gitlab-duo-agent" | "gmi-cloud" | "google-antigravity" | "google-gemini-cli" | "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" | "synthetic" | "tavily" | "together" | "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" | "commandcode" | "coreweave" | "cursor" | "deepinfra" | "deepseek" | "devin" | "exa" | "firepass" | "fireworks" | "github-copilot" | "gitlab-duo" | "gitlab-duo-agent" | "gmi-cloud" | "google-antigravity" | "google-gemini-cli" | "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" | "stencil" | "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";
@@ -29,6 +29,8 @@ export declare function cursorModelParameters(model: string): readonly {
29
29
  * preserve quota semantics for newly discovered ids.
30
30
  */
31
31
  export declare function quotaTierFor(provider: string, model: string): string | undefined;
32
+ /** UTC offset for a provider's timezone-naive absolute retry-reset timestamps. */
33
+ export declare function retryResetTimezoneOffsetFor(provider: string): string | undefined;
32
34
  /** Whether a provider has catalog-authored model quota scopes. */
33
35
  export declare function hasQuotaTierPolicy(provider: string): boolean;
34
36
  /** The provider-default wire model for a model-less hosted operation. */
@@ -55,11 +57,20 @@ export declare function modelLimitsFor(provider: string, model: string): {
55
57
  } | undefined;
56
58
  /** Whether a provider roster entry is a declared non-chat/unsupported SKU. */
57
59
  export declare function isExcludedModel(provider: string, model: string): boolean;
60
+ /** Whether an exact upstream discovery mode is excluded from a provider's coding-model roster. */
61
+ export declare function isExcludedDiscoveryMode(provider: string, mode: string): boolean;
58
62
  /**
59
63
  * Whether a provider is retired: its entire roster is excluded from the
60
64
  * generated bundle and must never be resurrected from the previous snapshot.
61
65
  */
62
66
  export declare function isRetiredProvider(provider: string): boolean;
67
+ /**
68
+ * Whether a provider's bundled rows may seed cross-provider bare-id enrichment
69
+ * references. Gateway-namespaced providers (ClinePass) are isolated so their
70
+ * limits, pricing, and reasoning controls never contaminate an unrelated proxy
71
+ * model that happens to advertise the same bare id.
72
+ */
73
+ export declare function isBareIdReferenceProvider(provider: string): boolean;
63
74
  /** The declared subscription tier required to use a provider model id, if any. */
64
75
  export declare function planRequirementFor(provider: string, model: string): string | undefined;
65
76
  /** Cross-provider pricing-peer resolution for one provider model id. */
@@ -12,26 +12,27 @@ export declare class AmbiguousOverlapError extends Error {
12
12
  readonly second: string;
13
13
  constructor(provider: string, model: string, axis: string, first: string, second: string);
14
14
  }
15
- /**
16
- * Anchored `*`-wildcard match; both sides must be pre-lowercased. `*` spans
17
- * any substring; non-wildcard text stays anchored in order.
18
- */
19
15
  export declare function globMatch(pattern: string, value: string): boolean;
20
16
  /**
21
- * Resolves wire, thinking, and catalog assignments for one structured target.
22
- *
23
- * Thinking axes are gated on `target.reasoning`, except that an exact model
24
- * selector declaring `thinking-efforts` upgrades the target (a reviewed
25
- * correction to stale capability metadata). Family and revision selectors
26
- * never match targets missing that identity rank. Unmatched targets resolve
27
- * to empty maps.
17
+ * Resolve wire, thinking, and catalog assignments for one structured target.
18
+ * Exact model effort corrections can enable reasoning; absent family/revision
19
+ * facts never satisfy selectors that require them. Returned axes are caller-owned.
28
20
  *
29
- * @throws AmbiguousOverlapError when two equal-rank rules contest one axis.
21
+ * @throws AmbiguousOverlapError when equal-rank rules contest one axis.
30
22
  */
31
23
  export declare function resolveCascade(target: ResolveTarget): ResolvedAxes;
32
24
  /**
33
- * Resolves a target against an arbitrary compiled cascade (test seam and
34
- * scratch evaluations); `resolveCascade` delegates here with the bundled
35
- * rule index.
25
+ * Resolve a target against a caller-owned compiled cascade without memoizing
26
+ * mutable rule data. Bundled target lookups use {@link resolveCascade}.
36
27
  */
37
28
  export declare function resolveCascadeRules(cascade: CompiledCascade, target: ResolveTarget): ResolvedAxes;
29
+ /**
30
+ * Whether the effort ladder this target resolves to comes from a rule scoped
31
+ * to the model's identity (a recognized class, family, revision, or an explicit
32
+ * model selector), rather than a provider/api-wide or fallback unknown-class
33
+ * rule that any unrecognized id at that provider inherits.
34
+ *
35
+ * Discovery reads this to tell reviewed tiers apart from a blanket default, so
36
+ * catalog-published tiers can correct the latter and never the former.
37
+ */
38
+ export declare function hasModelScopedEffortsRule(target: ResolveTarget): boolean;
@@ -124,6 +124,14 @@ export declare function deriveThinkingPairFamilies<TSpec extends VariantSpecLike
124
124
  * unrelated carriers (GitHub Copilot `-1m` context variants) never match.
125
125
  */
126
126
  export declare function isCollapsedVariantSpec(spec: VariantSpecLike): boolean;
127
+ /**
128
+ * Whether a Cursor wire id names an extended tier that upstream serves only in
129
+ * max mode. The compiled taxonomy identifies `xhigh`/`extra-high`/`max`
130
+ * efforts and their optional service lanes. This is an inference, not an
131
+ * upstream marker: it is the only per-tier signal available for bundled rows
132
+ * and for routes live discovery never advertised.
133
+ */
134
+ export declare function isCursorMaxModeWireId(wireModelId: string): boolean;
127
135
  /**
128
136
  * Collapse a full mixed-provider list: per provider, the compiled reviewed table, Cursor's
129
137
  * conservative live effort-sibling rule, and the automatic `X`/`X-thinking`
@@ -1,7 +1,32 @@
1
1
  import type { Model } from "../types.js";
2
2
  /**
3
- * Maximum prompt window for extended context. Live discovery takes precedence
4
- * over rule-owned fallbacks for older bundled or cached model metadata. Resolve
5
- * at catalog composition time so frozen bundled rows need no runtime mutation.
3
+ * Extended-context capacity. Curated maxima correct stale lower discovery
4
+ * values; a higher live maximum still wins. The registry applies this capacity
5
+ * only when extended context is enabled, before explicit user overrides.
6
6
  */
7
7
  export declare function resolveMaxContextWindow(model: Model): number | undefined;
8
+ /**
9
+ * Override ceiling for Codex models. Upstream clamps `model_context_window`
10
+ * to `min(override, max_context_window)` (`with_config_overrides` in
11
+ * `models-manager/src/model_info.rs`); the ceiling here is stale-aware — the
12
+ * curated maximum corrects a lower server value (Astra reports a stale 872K
13
+ * maximum; OpenAI documents at most 922K input) while a higher live maximum
14
+ * still wins. No curated or live maximum means no ceiling: overrides pass
15
+ * through, matching upstream's unclamped branch.
16
+ */
17
+ export declare function codexOverrideCeiling(model: Model): number | undefined;
18
+ /**
19
+ * Whether explicit context-window overrides for this model clamp to the
20
+ * server-honored ceiling. KDL-owned (`clamp-context-override`): branching on
21
+ * it here keeps provider deployment contracts out of TypeScript.
22
+ */
23
+ export declare function clampsContextOverride(model: Model): boolean;
24
+ /**
25
+ * Clamp a requested Codex context window to the override ceiling, mirroring
26
+ * upstream. `model` is the pre-override model: the ceiling never shrinks the
27
+ * request below the window that already works, so a stale-low live maximum
28
+ * (e.g. 128K base with a 64K advertised maximum) cannot punish an explicit
29
+ * override. Returns the request unchanged when no ceiling applies or it
30
+ * already fits.
31
+ */
32
+ export declare function clampCodexContextWindow(model: Model, requested: number): number;
@@ -15,5 +15,9 @@ export type DelegationBias = (typeof DELEGATION_BIASES)[number];
15
15
  /**
16
16
  * Delegation bias for a built model; `eager` when no rule assigns one.
17
17
  * Callers: system-prompt and tool-description rendering in the coding agent.
18
+ *
19
+ * Results are cached by model object. Every cascade input is checked before a
20
+ * hit, including fields on a reused/mutated identity object, so model metadata
21
+ * refreshes and policy-relevant replacements cannot return stale bias.
18
22
  */
19
23
  export declare function resolveDelegationBias(model: Model): DelegationBias;
@@ -0,0 +1,2 @@
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" | "azure" | "baseten" | "bedrock-mantle" | "cerebras" | "charm-hyper" | "cline-pass" | "cloudflare-ai-gateway" | "commandcode" | "coreweave" | "cursor" | "deepinfra" | "deepseek" | "devin" | "firepass" | "fireworks" | "github-copilot" | "gitlab-duo" | "gitlab-duo-agent" | "gmi-cloud" | "google" | "google-antigravity" | "google-gemini-cli" | "google-vertex" | "groq" | "huggingface" | "kilo" | "kimi-code" | "litellm" | "lm-studio" | "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" | "synthetic" | "together" | "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" | "zenmux" | "zhipu-coding-plan";
@@ -0,0 +1,11 @@
1
+ import type { Api, ModelSpec } from "../types.js";
2
+ import type { CompiledProvider } from "./types.js";
3
+ /** Every catalog provider entry keyed by id (sorted). */
4
+ export declare function providerEntries(): Readonly<Record<string, CompiledProvider>>;
5
+ /** One provider's catalog entry, or `undefined` for ids without one. */
6
+ export declare function providerEntry(provider: string): CompiledProvider | undefined;
7
+ /**
8
+ * The authored seed rows for one provider (empty when it has none). Rows are
9
+ * the compiled JSON verbatim; callers that mutate must copy.
10
+ */
11
+ export declare function seedModels<TApi extends Api = Api>(provider: string): readonly ModelSpec<TApi>[];
@@ -13,3 +13,13 @@ export interface ResolvedModelPolicy<TApi extends Api = Api> {
13
13
  * complete compat record, thinking metadata, and catalog-data corrections.
14
14
  */
15
15
  export declare function resolveModelPolicy<TApi extends Api>(spec: ModelSpec<TApi>): ResolvedModelPolicy<TApi>;
16
+ /**
17
+ * Whether reviewed rules know THIS model's effort ladder, as opposed to it
18
+ * inheriting a provider-wide default or {@link resolveThinkingPolicy} falling
19
+ * through to the neutral wire ladder.
20
+ *
21
+ * Discovery uses this to tell "omp knows this model's tiers" apart from "omp
22
+ * is guessing them", so catalog-published tiers can correct the guess without
23
+ * ever overriding reviewed knowledge.
24
+ */
25
+ export declare function hasModelScopedEffortLadder<TApi extends Api>(spec: ModelSpec<TApi>): boolean;
@@ -0,0 +1 @@
1
+ export declare function allSeeds(): never[];
@@ -52,13 +52,6 @@ export declare function collapseVariantId(provider: string, model: string): Coll
52
52
  * `non-thinking` and `no-thinking` are not variants.
53
53
  */
54
54
  export declare function stripThinkingVariantSuffix(model: string): string | undefined;
55
- /**
56
- * Classifies a model into its structured identity: reviewed override first,
57
- * then suffix collapse, then class/family/revision ranks over the logical id.
58
- *
59
- * @throws AmbiguousIdentityError on equal-rank cross-class or cross-family
60
- * matches unless `opts.lenient`.
61
- */
62
55
  export declare function classifyModel(provider: string, modelId: string, opts?: ClassifyOptions): ModelIdentity;
63
56
  /**
64
57
  * Strips a declared billing-variant suffix (`-free`, `-contributor`) from a
@@ -5,7 +5,7 @@
5
5
  * `behavior.ts`, `resolve.ts`) exposes to consumers.
6
6
  */
7
7
  import type { Effort } from "../effort.js";
8
- import type { ThinkingControlMode } from "../types.js";
8
+ import type { KnownApi, ThinkingControlMode, TokenCost } from "../types.js";
9
9
  import type { RevisionOp } from "./revision.js";
10
10
  /** Class-membership matcher kinds, most to least specific. */
11
11
  export type MatcherKind = "exact" | "bounded" | "namespace" | "prefix" | "glob";
@@ -272,6 +272,11 @@ export interface CompiledExcludeModels {
272
272
  provider: string;
273
273
  match: CompiledMatchList;
274
274
  }
275
+ /** Exact upstream discovery modes excluded from one provider's coding-model roster. */
276
+ export interface CompiledExcludeDiscoveryModes {
277
+ provider: string;
278
+ modes: string[];
279
+ }
275
280
  /** Provider plan-requirement tiers keyed by matcher token lists. */
276
281
  export interface CompiledPlanRequirement {
277
282
  provider: string;
@@ -289,6 +294,11 @@ export interface CompiledPricingPeer {
289
294
  peerId: string;
290
295
  }[];
291
296
  }
297
+ /** Provider timezone assumption for offset-less absolute retry-reset timestamps. */
298
+ export interface CompiledRetryResetTimezone {
299
+ provider: string;
300
+ offset: string;
301
+ }
292
302
  /** Compiled runtime behavior vocabulary (`runtime/behavior.kdl`). */
293
303
  export interface CompiledBehavior {
294
304
  openaiResponsesHeuristic?: CompiledResponsesHeuristic;
@@ -299,10 +309,13 @@ export interface CompiledBehavior {
299
309
  hostedDefaults: CompiledHostedDefault[];
300
310
  apiRoutes: CompiledApiRoutes[];
301
311
  modelLimits: CompiledModelLimits[];
312
+ excludeDiscoveryModes: CompiledExcludeDiscoveryModes[];
302
313
  excludeModels: CompiledExcludeModels[];
303
314
  planRequirements: CompiledPlanRequirement[];
304
315
  pricingPeers: CompiledPricingPeer[];
316
+ retryResetTimezones: CompiledRetryResetTimezone[];
305
317
  retiredProviders: string[];
318
+ referenceIsolatedProviders: string[];
306
319
  }
307
320
  /**
308
321
  * A string setting from `auth/*.kdl` that may be overridden by environment
@@ -426,6 +439,10 @@ export interface CompiledOAuthCodeLogin {
426
439
  kind: "oauth-code";
427
440
  clientId?: CompiledAuthValue;
428
441
  clientSecret?: CompiledAuthValue;
442
+ /** `{base}` placeholder source (the provider's API origin). */
443
+ baseUrl?: CompiledAuthValue;
444
+ /** `{auth}` placeholder source for the authorize, token, and userinfo URLs when the issuer is a separate host. */
445
+ authUrl?: CompiledAuthValue;
429
446
  authorizeUrl: CompiledAuthValue;
430
447
  scopes: string[];
431
448
  scopeSeparator: string;
@@ -505,6 +522,8 @@ export interface CompiledAuthProvider {
505
522
  hook: string;
506
523
  };
507
524
  allowsMissingApiKey?: boolean;
525
+ /** APIs whose provider transport resolves credentials without a stored account. */
526
+ nativeAuthApis?: string[];
508
527
  available?: boolean;
509
528
  showInLoginList?: boolean;
510
529
  storeAs?: string;
@@ -521,6 +540,80 @@ export interface CompiledAuthProvider {
521
540
  export interface CompiledAuth {
522
541
  providers: CompiledAuthProvider[];
523
542
  }
543
+ /**
544
+ * When a provider's seed rows enter the generated bundle:
545
+ * - `always`: every regeneration; same-id upstream/discovery rows win dedup.
546
+ * - `fallback`: only when authoritative catalog discovery did not succeed.
547
+ * - `empty`: only when no other source produced a row for the provider.
548
+ */
549
+ export type SeedBundlePolicy = "always" | "fallback" | "empty";
550
+ /** Catalog-generation discovery settings (`discovery` node in `providers/<id>.kdl`). */
551
+ export interface CompiledProviderDiscovery {
552
+ /** Human-readable name for generator log messages. */
553
+ label: string;
554
+ /** Env vars checked for a generation-time API key; defaults to the provider's `env`. */
555
+ envVars?: string[];
556
+ /** OAuth provider whose stored credential may stand in for an API key. */
557
+ oauthProvider?: string;
558
+ /** Discovery proceeds without credentials. */
559
+ allowUnauthenticated?: boolean;
560
+ }
561
+ /**
562
+ * One authored seed row: the intrinsic `ModelSpec` fields plus optional
563
+ * explicit `thinking` / `compat` overrides compiled from the axis vocabulary
564
+ * (keyed by resolved field, value-validated at compile time). `seeds.ts`
565
+ * projects rows to `ModelSpec` at the JSON boundary.
566
+ */
567
+ export interface CompiledSeedModel {
568
+ id: string;
569
+ name: string;
570
+ api: KnownApi;
571
+ provider: string;
572
+ baseUrl: string;
573
+ reasoning: boolean;
574
+ input: ("text" | "image")[];
575
+ supportsTools?: boolean;
576
+ cost: TokenCost;
577
+ contextWindow: number | null;
578
+ maxTokens: number | null;
579
+ thinking?: Record<string, unknown>;
580
+ compat?: Record<string, unknown>;
581
+ }
582
+ /** A provider's authored seed rows (`seed` node in `providers/<id>.kdl`). */
583
+ export interface CompiledSeed {
584
+ bundle: SeedBundlePolicy;
585
+ /**
586
+ * `seed`: rows are prepended after upstream merging so they outrank same-id
587
+ * rows and never receive cross-provider reference fills. `upstream`
588
+ * (default): rows are appended and same-id upstream rows win.
589
+ */
590
+ precedence: "upstream" | "seed";
591
+ /** Rows in declaration order (inherited `models-from` rows appended last). */
592
+ models: CompiledSeedModel[];
593
+ }
594
+ /**
595
+ * One chat-model provider's catalog entry: the non-code half of what the
596
+ * runtime and generator know about a provider. A `providers/<id>.kdl` file
597
+ * declares one by carrying `default-model`; files without it are wire-compat
598
+ * only (custom provider ids such as `llama.cpp`).
599
+ */
600
+ export interface CompiledProvider {
601
+ id: string;
602
+ /** Preferred model id when no explicit selection is made. */
603
+ defaultModel: string;
604
+ /** Env vars consulted, in order, for the runtime API-key fallback. */
605
+ envVars?: string[];
606
+ /** The runtime creates a model manager even without a valid API key. */
607
+ allowUnauthenticated?: boolean;
608
+ /** Successful runtime discovery replaces bundled provider models instead of merging. */
609
+ dynamicModelsAuthoritative?: boolean;
610
+ /** Generator backfills never copy reasoning/input/limits from same-id rows on other hosts. */
611
+ skipCrossProviderReferenceFills?: boolean;
612
+ /** Present only for providers enrolled in `generate-models.ts` discovery. */
613
+ discovery?: CompiledProviderDiscovery;
614
+ /** Authored bundled rows, when the provider cannot be discovered at generation time. */
615
+ seed?: CompiledSeed;
616
+ }
524
617
  /** The complete compiled rule tree persisted as `rules.json`. */
525
618
  export interface CompiledCompatRules {
526
619
  /** Compiled-format version; bump on incompatible shape changes. */
@@ -531,6 +624,8 @@ export interface CompiledCompatRules {
531
624
  cascade: CompiledCascade;
532
625
  behavior: CompiledBehavior;
533
626
  auth: CompiledAuth;
627
+ /** Catalog provider entries keyed by provider id, sorted. */
628
+ providers: Record<string, CompiledProvider>;
534
629
  }
535
630
  /** Structured identity of one classified model. */
536
631
  export interface ModelIdentity {
@@ -569,4 +664,12 @@ export interface ResolvedAxes {
569
664
  wire: Record<string, unknown>;
570
665
  thinking: Record<string, unknown>;
571
666
  catalog: Record<string, unknown>;
667
+ /**
668
+ * Reasoning capability after the exact-model effort upgrade: `true` when the
669
+ * target reported reasoning or an exact rule declares a ladder for it (the
670
+ * reviewed correction to metadata-less discovery rows). Compat resolvers
671
+ * read this instead of the raw spec flag, or one id resolves two different
672
+ * wire contracts depending on whether it came from discovery or the bake.
673
+ */
674
+ reasoning: boolean;
572
675
  }
@@ -1,3 +1,4 @@
1
+ import type { FetchImpl } from "@linxiraos/pi-utils";
1
2
  import { type VariantCollapseTable } from "../compat/collapse.js";
2
3
  import type { ModelSpec } from "../types.js";
3
4
  export declare const ANTIGRAVITY_PRIMARY_ENDPOINT = "https://daily-cloudcode-pa.googleapis.com";
@@ -37,6 +38,7 @@ export interface AntigravityDiscoveryAgentModelSort {
37
38
  export interface AntigravityDiscoveryApiResponse {
38
39
  models?: Record<string, AntigravityDiscoveryApiModel>;
39
40
  agentModelSorts?: AntigravityDiscoveryAgentModelSort[];
41
+ imageGenerationModelIds?: string[];
40
42
  }
41
43
  /**
42
44
  * Options for fetching Antigravity discovery models.
@@ -53,7 +55,7 @@ export interface FetchAntigravityDiscoveryModelsOptions {
53
55
  /** Optional abort signal for request cancellation. */
54
56
  signal?: AbortSignal;
55
57
  /** Optional fetch implementation override for tests. */
56
- fetcher?: typeof fetch;
58
+ fetcher?: FetchImpl;
57
59
  /**
58
60
  * Hand collapse table to apply to the discovered list. Defaults to the
59
61
  * Antigravity (budget-transport) table; `googleGeminiCli` passes the
@@ -68,3 +70,10 @@ export interface FetchAntigravityDiscoveryModelsOptions {
68
70
  * Returns `[]` only when the endpoint responds successfully with no usable models.
69
71
  */
70
72
  export declare function fetchAntigravityDiscoveryModels(options: FetchAntigravityDiscoveryModelsOptions): Promise<ModelSpec<"google-gemini-cli">[] | null>;
73
+ /** Advertised image model and serving endpoint for one Antigravity account. */
74
+ export interface AntigravityImageModel {
75
+ id: string;
76
+ endpoint: string;
77
+ }
78
+ /** Resolves the first image-generation model advertised by an Antigravity account. */
79
+ export declare function fetchAntigravityImageModel(options: FetchAntigravityDiscoveryModelsOptions): Promise<AntigravityImageModel | null>;
@@ -26,5 +26,5 @@ export declare function discoverGitLabDuoWorkflowNamespace(config: GitLabDuoWork
26
26
  export declare function discoverGitLabDuoWorkflowRuntimeNamespace(config: GitLabDuoWorkflowDiscoveryConfig): Promise<GitLabDuoWorkflowNamespaceSelection>;
27
27
  export declare function fetchGitLabDuoWorkflowModels(config: GitLabDuoWorkflowDiscoveryConfig): Promise<readonly ModelSpec<"gitlab-duo-agent">[] | null>;
28
28
  export declare function buildGitLabDuoWorkflowModelSpec(model: GitLabDuoWorkflowModelRef, baseUrl?: string, rootNamespaceId?: string): ModelSpec<"gitlab-duo-agent">;
29
- export declare function buildGitLabDuoWorkflowFallbackModel(id?: string, name?: string, baseUrl?: string): ModelSpec<"gitlab-duo-agent">;
29
+ export declare function buildGitLabDuoWorkflowFallbackModel(baseUrl?: string): ModelSpec<"gitlab-duo-agent">;
30
30
  export {};
@@ -1,6 +1,8 @@
1
- import type { Api, Model, ModelSpec } from "./types.js";
2
- interface CacheEntry<TApi extends Api = Api> {
3
- models: ModelSpec<TApi>[];
1
+ import type { Api, Model } from "./types.js";
2
+ /** Materialized provider snapshot with freshness and header-restoration provenance. */
3
+ export interface CacheEntry<TApi extends Api = Api> {
4
+ /** Trusted, fully materialized rows; request headers remain omitted. */
5
+ models: Model<TApi>[];
4
6
  fresh: boolean;
5
7
  authoritative: boolean;
6
8
  updatedAt: number;
@@ -20,4 +22,3 @@ interface CacheEntry<TApi extends Api = Api> {
20
22
  }
21
23
  export declare function readModelCache<TApi extends Api>(providerId: string, ttlMs: number, now: () => number, dbPath?: string): CacheEntry<TApi> | null;
22
24
  export declare function writeModelCache<TApi extends Api>(providerId: string, updatedAt: number, models: Model<TApi>[], authoritative: boolean, staticFingerprint: string, dbPath?: string, staticHeaderSources?: readonly Model<TApi>[], restorableHeaderFallback?: Record<string, string>): void;
23
- export {};
@@ -20,8 +20,13 @@ export interface ModelsDevFallback<TApi extends Api = Api, TPayload = unknown> {
20
20
  export interface ModelManagerOptions<TApi extends Api = Api, TModelsDevPayload = unknown> {
21
21
  /** Provider id used for static lookup and cache namespacing. */
22
22
  providerId: Provider;
23
- /** Optional static list override. When omitted, bundled models.json is used. */
24
- staticModels?: readonly ModelSpec<TApi>[];
23
+ /**
24
+ * Optional static override. Raw ModelSpec rows are materialized with
25
+ * `buildModel`; explicitly prebuilt Model rows are consumed as trusted
26
+ * materializations. When omitted, generator-materialized models.json rows
27
+ * are consumed directly.
28
+ */
29
+ staticModels?: readonly (ModelSpec<TApi> | Model<TApi>)[];
25
30
  /** Optional override for the cache database path. Default: <agent-dir>/models.db. */
26
31
  cacheDbPath?: string;
27
32
  /** Optional provider id override for cache namespacing. Defaults to providerId. */
@@ -40,6 +45,13 @@ export interface ModelManagerOptions<TApi extends Api = Api, TModelsDevPayload =
40
45
  * bearer header comes from the current local config.
41
46
  */
42
47
  restorableHeaderFallback?: Record<string, string>;
48
+ /**
49
+ * Reconstruct omitted request headers from authoritative local configuration
50
+ * when no trusted static source remains. Return undefined to keep the row
51
+ * unavailable. This hook must not perform I/O; attach `resolveHeaders` for
52
+ * command-backed credentials that must wait until an actual request.
53
+ */
54
+ restoreCachedHeaders?: (model: Readonly<Model>) => Pick<Model, "headers" | "resolveHeaders"> | undefined;
43
55
  /** Optional dynamic endpoint fetcher. */
44
56
  fetchDynamicModels?: () => Promise<readonly ModelSpec<TApi>[] | null>;
45
57
  /** Optional stencil.so fallback hook. */
@@ -86,8 +98,8 @@ export declare function createModelManager<TApi extends Api = Api, TModelsDevPay
86
98
  */
87
99
  export declare function resolveProviderModels<TApi extends Api = Api, TModelsDevPayload = unknown>(options: ModelManagerOptions<TApi, TModelsDevPayload>, strategy?: ModelRefreshStrategy): Promise<ModelResolutionResult<TApi>>;
88
100
  /**
89
- * Return the versioned, low-collision model-cache identity for a static provider
90
- * slice. Results are cached by array reference so repeat cold-start paths skip
91
- * the JSON serialization and hash.
101
+ * Return the versioned content identity for a static provider slice. Callers
102
+ * may mutate or freeze their arrays, so every call observes current content
103
+ * and never attaches a stale sidecar fingerprint to caller-owned data.
92
104
  */
93
105
  export declare function fingerprintStaticModels<TApi extends Api>(models: readonly (ModelSpec<TApi> | Model<TApi>)[], dynamicModelsAuthoritative?: boolean): string;
@@ -35,6 +35,13 @@ export declare function mapEffortToGoogleThinkingLevel<TApi extends Api>(effort:
35
35
  /**
36
36
  * Maps a normalized thinking effort to Anthropic adaptive effort values via
37
37
  * the model's baked `thinking.effortMap` (identity for unmapped efforts).
38
+ *
39
+ * The Anthropic adaptive wire vocabulary has no `minimal` tier (valid values:
40
+ * `low`, `medium`, `high`, `xhigh`, `max`); a model ladder that exposes
41
+ * `minimal` — custom `anthropic-messages` providers do, unlike the built-in
42
+ * Claude ladders — would otherwise serialize `output_config.effort: "minimal"`
43
+ * and 400 (`level "minimal" not supported`). Clamp it to the lowest real tier,
44
+ * mirroring {@link mapEffortToGoogleThinkingLevel}'s `minimal` handling.
38
45
  */
39
46
  export declare function mapEffortToAnthropicAdaptiveEffort<TApi extends Api>(model: ApiModel<TApi>, effort: Effort): "low" | "medium" | "high" | "xhigh" | "max" | "adaptive";
40
47
  /**
@@ -5,4 +5,4 @@ import type { ModelTokenizer } from "./types.js";
5
5
  * This is catalog policy, not a runtime caller heuristic: [`buildModel`](./build.ts)
6
6
  * materializes the result as `Model.tokenizer`; consumers read that property.
7
7
  */
8
- export declare function resolveModelTokenizer(modelId: string): ModelTokenizer | undefined;
8
+ export declare function resolveModelTokenizer(modelId: string, provider?: string): ModelTokenizer | undefined;