@linxiraos/pi-catalog 1.1.26 → 1.2.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 (128) hide show
  1. package/CHANGELOG.md +4 -6
  2. package/dist/types/compat/auth-ids.d.ts +2 -2
  3. package/dist/types/compat/collapse.d.ts +7 -0
  4. package/dist/types/compat/image-tokenization.d.ts +52 -0
  5. package/dist/types/compat/judgment-questions.d.ts +7 -0
  6. package/dist/types/compat/prompt-cache-lookback.d.ts +7 -0
  7. package/dist/types/compat/provider-ids.d.ts +1 -1
  8. package/dist/types/compat/reasoning-carry.d.ts +21 -0
  9. package/dist/types/compat/request-size.d.ts +7 -0
  10. package/dist/types/compat/taxonomy.d.ts +0 -10
  11. package/dist/types/compat/types.d.ts +4 -0
  12. package/dist/types/discovery/antigravity.d.ts +13 -3
  13. package/dist/types/hosts.d.ts +4 -0
  14. package/dist/types/model-cache.d.ts +6 -0
  15. package/dist/types/model-manager.d.ts +16 -0
  16. package/dist/types/provider-models/account-access.d.ts +11 -0
  17. package/dist/types/provider-models/google.d.ts +23 -1
  18. package/dist/types/provider-models/openai-compat.d.ts +19 -1
  19. package/dist/types/provider-models/special.d.ts +8 -0
  20. package/dist/types/types.d.ts +134 -23
  21. package/dist/types/wire/cloudflare-ai-gateway.d.ts +0 -10
  22. package/dist/types/wire/cloudflare.d.ts +10 -0
  23. package/dist/types/wire/factory-droid.d.ts +1 -1
  24. package/dist/types/wire/gemini-headers.d.ts +6 -3
  25. package/package.json +4 -4
  26. package/src/build.ts +39 -35
  27. package/src/compat/auth-ids.ts +6 -0
  28. package/src/compat/axes.ts +43 -5
  29. package/src/compat/cascade.ts +6 -1
  30. package/src/compat/collapse.d.ts +7 -0
  31. package/src/compat/collapse.ts +11 -0
  32. package/src/compat/image-tokenization.ts +166 -0
  33. package/src/compat/judgment-questions.ts +12 -0
  34. package/src/compat/prompt-cache-lookback.ts +23 -0
  35. package/src/compat/provider-ids.d.ts +1 -1
  36. package/src/compat/provider-ids.ts +3 -0
  37. package/src/compat/reasoning-carry.ts +64 -0
  38. package/src/compat/request-size.ts +25 -0
  39. package/src/compat/resolve.ts +36 -25
  40. package/src/compat/rules/README.md +13 -3
  41. package/src/compat/rules/auth/_order.kdl +2 -2
  42. package/src/compat/rules/auth/cloudflare-workers-ai.kdl +9 -0
  43. package/src/compat/rules/auth/coralbricks.kdl +13 -0
  44. package/src/compat/rules/auth/minimax-code-cn.kdl +1 -1
  45. package/src/compat/rules/auth/minimax-code.kdl +1 -1
  46. package/src/compat/rules/auth/openai-codex.kdl +1 -1
  47. package/src/compat/rules/auth/snowflake.kdl +11 -0
  48. package/src/compat/rules/auth/stencil.kdl +1 -1
  49. package/src/compat/rules/classes/anthropic.kdl +188 -7
  50. package/src/compat/rules/classes/deepseek.kdl +11 -3
  51. package/src/compat/rules/classes/gemini.kdl +12 -0
  52. package/src/compat/rules/classes/glm.kdl +17 -8
  53. package/src/compat/rules/classes/kimi.kdl +15 -0
  54. package/src/compat/rules/classes/meta.kdl +4 -4
  55. package/src/compat/rules/classes/minimax.kdl +31 -1
  56. package/src/compat/rules/classes/openai.kdl +114 -4
  57. package/src/compat/rules/classes/qwen.kdl +2 -1
  58. package/src/compat/rules/providers/abliteration.kdl +7 -0
  59. package/src/compat/rules/providers/amazon-bedrock.kdl +0 -7
  60. package/src/compat/rules/providers/anthropic.kdl +13 -0
  61. package/src/compat/rules/providers/apple.kdl +1 -0
  62. package/src/compat/rules/providers/cloudflare-workers-ai.kdl +34 -0
  63. package/src/compat/rules/providers/coralbricks.kdl +62 -0
  64. package/src/compat/rules/providers/cursor.kdl +28 -8
  65. package/src/compat/rules/providers/devin.kdl +2 -2
  66. package/src/compat/rules/providers/factory-droid.kdl +77 -13
  67. package/src/compat/rules/providers/github-copilot.kdl +29 -0
  68. package/src/compat/rules/providers/google-antigravity.kdl +8 -1
  69. package/src/compat/rules/providers/groq.kdl +21 -0
  70. package/src/compat/rules/providers/image-tokenization.kdl +42 -0
  71. package/src/compat/rules/providers/judgment-questions.kdl +53 -0
  72. package/src/compat/rules/providers/litellm.kdl +4 -1
  73. package/src/compat/rules/providers/meta.kdl +3 -3
  74. package/src/compat/rules/providers/minimax-code-cn.kdl +10 -5
  75. package/src/compat/rules/providers/minimax-code.kdl +10 -5
  76. package/src/compat/rules/providers/mistral.kdl +25 -1
  77. package/src/compat/rules/providers/moonshot.kdl +11 -0
  78. package/src/compat/rules/providers/muse-code.kdl +7 -0
  79. package/src/compat/rules/providers/ollama.kdl +3 -0
  80. package/src/compat/rules/providers/openai-codex.kdl +18 -13
  81. package/src/compat/rules/providers/openai.kdl +22 -0
  82. package/src/compat/rules/providers/opencode-go.kdl +11 -0
  83. package/src/compat/rules/providers/opencode-zen.kdl +20 -0
  84. package/src/compat/rules/providers/openrouter.kdl +6 -0
  85. package/src/compat/rules/providers/snowflake.kdl +135 -0
  86. package/src/compat/rules/providers/tool-result-images.kdl +16 -0
  87. package/src/compat/rules/providers/zhipu-coding-plan.kdl +10 -0
  88. package/src/compat/rules/runtime/behavior.kdl +8 -5
  89. package/src/compat/rules/taxonomy/_collapse.kdl +52 -2
  90. package/src/compat/rules/taxonomy/deepseek.kdl +4 -0
  91. package/src/compat/rules/taxonomy/kimi.kdl +5 -0
  92. package/src/compat/rules.json +1 -1
  93. package/src/compat/taxonomy.d.ts +0 -10
  94. package/src/compat/taxonomy.ts +3 -3
  95. package/src/compat/types.d.ts +4 -0
  96. package/src/compat/types.ts +4 -0
  97. package/src/discovery/antigravity.d.ts +13 -3
  98. package/src/discovery/antigravity.ts +33 -17
  99. package/src/discovery/cursor.ts +28 -4
  100. package/src/discovery/devin.ts +20 -2
  101. package/src/hosts.d.ts +4 -0
  102. package/src/hosts.ts +2 -0
  103. package/src/model-cache.d.ts +6 -0
  104. package/src/model-cache.ts +123 -47
  105. package/src/model-manager.d.ts +16 -0
  106. package/src/model-manager.ts +107 -41
  107. package/src/model-tokenizer.ts +3 -0
  108. package/src/models.json +1 -1
  109. package/src/provider-models/account-access.d.ts +11 -0
  110. package/src/provider-models/account-access.ts +30 -0
  111. package/src/provider-models/cache-provider-id.ts +13 -6
  112. package/src/provider-models/cline-pass.ts +33 -0
  113. package/src/provider-models/descriptors.ts +4 -0
  114. package/src/provider-models/google.d.ts +23 -1
  115. package/src/provider-models/google.ts +72 -14
  116. package/src/provider-models/openai-compat.d.ts +19 -1
  117. package/src/provider-models/openai-compat.ts +281 -42
  118. package/src/provider-models/special.d.ts +8 -0
  119. package/src/provider-models/special.ts +26 -22
  120. package/src/types.d.ts +134 -23
  121. package/src/types.ts +183 -20
  122. package/src/wire/cloudflare-ai-gateway.d.ts +0 -10
  123. package/src/wire/cloudflare-ai-gateway.ts +0 -36
  124. package/src/wire/cloudflare.ts +40 -0
  125. package/src/wire/factory-droid.d.ts +1 -1
  126. package/src/wire/factory-droid.ts +1 -1
  127. package/src/wire/gemini-headers.d.ts +6 -3
  128. package/src/wire/gemini-headers.ts +39 -21
package/CHANGELOG.md CHANGED
@@ -1,14 +1,12 @@
1
- # Changelog
2
-
3
1
  ## [Unreleased]
4
2
 
5
- ## [1.1.26] - 2026-10-03
3
+ ## [1.2.0] - 2026-10-12
6
4
 
7
- - 版本线推进至 1.1.26;本版无独立用户可见变化。
5
+ - 版本线推进至 1.2.0;本版无独立用户可见变化。
8
6
 
9
- ## [1.1.25] - 2026-10-03
7
+ ## [1.1.27] - 2026-10-07
10
8
 
11
- - 版本线推进至 1.1.25;本版无独立用户可见变化。
9
+ - 版本线推进至 1.1.27;本版无独立用户可见变化。
12
10
 
13
11
  ## [1.1.24] - 2026-10-03
14
12
 
@@ -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" | "commandcode" | "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" | "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" | "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" | "commandcode" | "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" | "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" | "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";
@@ -102,6 +102,13 @@ export interface VariantCollapseTable {
102
102
  * Discovery uses this accessor to preserve injectable table seams.
103
103
  */
104
104
  export declare function reviewedCollapseTable(provider: string): VariantCollapseTable | undefined;
105
+ /**
106
+ * Logical id of the reviewed `provider` family claiming `memberId` as a member
107
+ * or extra alias, or `undefined` when no reviewed family owns it. Cursor's rich
108
+ * discovery names lanes with it so they keep the id the legacy-slug collapse
109
+ * (and the bundled catalog) assigns.
110
+ */
111
+ export declare function reviewedVariantFamilyId(provider: string, memberId: string): string | undefined;
105
112
  /**
106
113
  * The global automatic rule: derive an `X` + `X-thinking` family for every
107
114
  * pair where both ids are live in `specs` (trailing or infix token). Gates:
@@ -0,0 +1,52 @@
1
+ import type { ModelIdentity } from "./types.js";
2
+ /** OpenAI image `detail` levels; `undefined` means the provider default (`auto`). */
3
+ export type ImageDetail = "auto" | "low" | "high" | "original";
4
+ export interface ImageSize {
5
+ width: number;
6
+ height: number;
7
+ }
8
+ /** One OpenAI `detail` level's sizing: a pixel-dimension limit, then an optional patch budget. */
9
+ export interface PatchSizing {
10
+ /** Longest side after the pixel-dimension fit. */
11
+ maxEdge: number;
12
+ /** Resizing patch budget; absent when the level keeps the image's size. */
13
+ patchBudget?: number;
14
+ }
15
+ /** OpenAI 32px patches × a per-model multiplier, sized per `detail` level. */
16
+ export interface OpenAiPatchTokenization {
17
+ regime: "openai-patch";
18
+ multiplier: number;
19
+ low: PatchSizing;
20
+ high: PatchSizing;
21
+ original: PatchSizing;
22
+ /** The level `auto` (and an omitted `detail`) sizes like. */
23
+ auto: "high" | "original";
24
+ }
25
+ /** One model line's image billing rule: the vendor formula and its per-model numbers. */
26
+ export type ImageTokenization = OpenAiPatchTokenization
27
+ /** Anthropic 28px patches, resized to fit a padded-edge limit and a visual-token budget. */
28
+ | {
29
+ regime: "anthropic-patch";
30
+ maxEdge: number;
31
+ maxTokens: number;
32
+ }
33
+ /** A fixed per-image budget regardless of pixels (Gemini 3 `media_resolution`). */
34
+ | {
35
+ regime: "fixed";
36
+ tokens: number;
37
+ };
38
+ /** What reads the image: a built model, any `{ id }` with optional host and identity, or just a wire `{ api }`. */
39
+ export interface ImageTokenizationTarget {
40
+ id?: string;
41
+ provider?: string;
42
+ api?: string;
43
+ identity?: Pick<ModelIdentity, "class" | "family" | "revision">;
44
+ }
45
+ /**
46
+ * The reader's image billing rule: its lineage rule, else its wire API's
47
+ * fallback; undefined when neither covers it (an unclassified model on an
48
+ * unregistered API).
49
+ */
50
+ export declare function resolveImageTokenization(target: ImageTokenizationTarget): ImageTokenization | undefined;
51
+ /** Billed input tokens for one image of `size` under `rule`; only `openai-patch` reads `detail`. */
52
+ export declare function imageTokens(rule: ImageTokenization, size: ImageSize, detail?: ImageDetail): number;
@@ -0,0 +1,7 @@
1
+ import type { Model } from "../types.js";
2
+ /**
3
+ * Most questions one System One judgment request to this model may carry
4
+ * (`judgment-questions-max` axis), or `undefined` when the endpoint takes any
5
+ * batch size.
6
+ */
7
+ export declare function resolveJudgmentQuestionsMax(model: Model): number | undefined;
@@ -0,0 +1,7 @@
1
+ import type { Model } from "../types.js";
2
+ /**
3
+ * Block positions the provider's prompt cache checks back from a breakpoint for
4
+ * an earlier request's entry (`prompt-cache-lookback` axis), or `undefined` when
5
+ * the model has no known lookback bound.
6
+ */
7
+ export declare function resolvePromptCacheLookback(model: Model): number | 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" | "commandcode" | "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" | "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" | "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,21 @@
1
+ import type { ModelIdentity } from "./types.js";
2
+ /**
3
+ * The identity a deployment's reasoning is carried under, or `undefined` when
4
+ * the deployment's model family is not declared portable there. Class-only
5
+ * identities never qualify: they name a lineage, not a set of weights.
6
+ */
7
+ export declare function portableReasoningIdentity(provider: string, api: string, modelId: string): ModelIdentity | undefined;
8
+ /**
9
+ * Whether reasoning recorded on `source` may replay natively on `target`:
10
+ * both deployments declare the family portable and classify to the same
11
+ * class, family, and revision.
12
+ */
13
+ export declare function carriesReasoning(source: {
14
+ provider: string;
15
+ api: string;
16
+ model: string;
17
+ }, target: {
18
+ provider: string;
19
+ api: string;
20
+ id: string;
21
+ }): boolean;
@@ -0,0 +1,7 @@
1
+ import type { Model } from "../types.js";
2
+ /**
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.
6
+ */
7
+ export declare function resolveInlineImageByteBudget(model: Model): number | undefined;
@@ -1,13 +1,3 @@
1
- /**
2
- * Runtime model-identity taxonomy: classifies wire model ids into
3
- * `(class, family, revision)` ranks, applies reviewed identity overrides, and
4
- * exposes the collapse/discovery vocabularies.
5
- *
6
- * Faithful port of the o2 reference (`taxonomy.rs` / `classify.rs`):
7
- * matchers rank `exact(4) > bounded(3) > namespace(2) > prefix(1) > glob(0)`
8
- * with token byte length as tiebreak; equal cross-class or cross-family ranks
9
- * throw unless classification is `lenient` (discovery normalization).
10
- */
11
1
  import type { Effort } from "../effort.js";
12
2
  import type { ModelIdentity } from "./types.js";
13
3
  /** Two classes, families, or reviewed override patterns tie for one model id. */
@@ -593,6 +593,8 @@ export interface CompiledSeedModel {
593
593
  baseUrl: string;
594
594
  reasoning: boolean;
595
595
  input: ("text" | "image")[];
596
+ /** Wire model id sent upstream when it differs from the row id (`request-model-id`). */
597
+ requestModelId?: string;
596
598
  supportsTools?: boolean;
597
599
  cost: TokenCost;
598
600
  contextWindow: number | null;
@@ -622,6 +624,8 @@ export interface CompiledProvider {
622
624
  id: string;
623
625
  /** Preferred model id when no explicit selection is made. */
624
626
  defaultModel: string;
627
+ /** Whether the provider participates in automatic default selection (defaults to true). */
628
+ automaticDefault?: boolean;
625
629
  /** Env vars consulted, in order, for the runtime API-key fallback. */
626
630
  envVars?: string[];
627
631
  /** The runtime creates a model manager even without a valid API key. */
@@ -63,13 +63,23 @@ export interface FetchAntigravityDiscoveryModelsOptions {
63
63
  */
64
64
  collapseTable?: VariantCollapseTable;
65
65
  }
66
+ /**
67
+ * A complete account roster, or a definitive 401/403 credential rejection.
68
+ * `null` from {@link fetchAntigravityDiscoveryModels} instead means a transient
69
+ * failure or invalid response, which must not replace an authoritative catalog.
70
+ */
71
+ export interface AntigravityModelDiscoveryResult {
72
+ models: ModelSpec<"google-gemini-cli">[];
73
+ rejectedStatus?: 401 | 403;
74
+ }
66
75
  /**
67
76
  * Fetches discoverable Antigravity models and normalizes them into canonical model entries.
68
77
  *
69
- * Returns `null` on network/payload/auth failures.
70
- * Returns `[]` only when the endpoint responds successfully with no usable models.
78
+ * Returns `null` on network, server, or payload failures; a 401/403 is reported
79
+ * separately so multi-account discovery can skip a rejected credential.
80
+ * A successful empty roster has `models: []` without `rejectedStatus`.
71
81
  */
72
- export declare function fetchAntigravityDiscoveryModels(options: FetchAntigravityDiscoveryModelsOptions): Promise<ModelSpec<"google-gemini-cli">[] | null>;
82
+ export declare function fetchAntigravityDiscoveryModels(options: FetchAntigravityDiscoveryModelsOptions): Promise<AntigravityModelDiscoveryResult | null>;
73
83
  /** Advertised image model and serving endpoint for one Antigravity account. */
74
84
  export interface AntigravityImageModel {
75
85
  id: string;
@@ -15,6 +15,10 @@ export declare const KNOWN_HOSTS: {
15
15
  readonly providers: readonly ["openai"];
16
16
  readonly urlMarkers: readonly ["api.openai.com"];
17
17
  };
18
+ /** URL-only: a Codex provider rerouted through a proxy does not imply the subscription backend's capabilities. */
19
+ readonly openaiCodex: {
20
+ readonly urlMarkers: readonly ["chatgpt.com/backend-api", "chat.openai.com/backend-api"];
21
+ };
18
22
  readonly azureOpenAI: {
19
23
  readonly providers: readonly ["azure"];
20
24
  readonly urlMarkers: readonly [".openai.azure.com", "azure.com/openai", "models.inference.ai.azure.com"];
@@ -35,6 +35,12 @@ export interface CacheEntry<TApi extends Api = Api> {
35
35
  */
36
36
  staticFingerprint: string;
37
37
  }
38
+ /**
39
+ * Closes the shared handle to the default `<agent-dir>/models.db`; the next
40
+ * default-path access reopens it. Call before deleting an agent directory the
41
+ * cache was opened under — Windows cannot remove a database that is still open.
42
+ */
43
+ export declare function closeModelCache(): void;
38
44
  export declare function readModelCache<TApi extends Api>(providerId: string, ttlMs: number, now: () => number, dbPath?: string): CacheEntry<TApi> | null;
39
45
  /**
40
46
  * Persist a provider snapshot.
@@ -35,6 +35,22 @@ export interface ModelManagerOptions<TApi extends Api = Api, TModelsDevPayload =
35
35
  cacheTtlMs?: number;
36
36
  /** When true, a successful dynamic fetch is the complete provider catalog and prunes static-only models. */
37
37
  dynamicModelsAuthoritative?: boolean;
38
+ /**
39
+ * When true, a provider's dynamic rows are the deployment's whole truth
40
+ * for input modality: a live text-only row strips the bundled reference's
41
+ * image support instead of OR-merging it back. Declared by providers whose
42
+ * capability flags are authoritative and whose endpoints reject
43
+ * unsupported content (`github-copilot`, `deepinfra`, `coralbricks`).
44
+ */
45
+ dynamicInputAuthoritative?: boolean;
46
+ /** When true, live reasoning capability replaces the fallback, including an explicit false. */
47
+ dynamicReasoningAuthoritative?: boolean;
48
+ /**
49
+ * When true, a live per-million price replaces the fallback even when it is
50
+ * an explicit `0` (a free model or a dropped cache-write charge). Without it,
51
+ * a zero discovery price is treated as unknown and the bundled rate is kept.
52
+ */
53
+ dynamicCostAuthoritative?: boolean;
38
54
  /**
39
55
  * When true, a fresh cache never satisfies an online-eligible refresh: the
40
56
  * dynamic fetch always runs (an explicit `"offline"` strategy is still
@@ -0,0 +1,11 @@
1
+ import type { Api, ModelSpec } from "../types.js";
2
+ /**
3
+ * Merge per-account discovery catalogs into one list, deduped by model id.
4
+ *
5
+ * The first catalog to list an id supplies its spec; {@link ModelSpec.accountAccess}
6
+ * is merged from every catalog listing that id, so credential selection can
7
+ * route account-gated models to the accounts that serve them. Used by
8
+ * multi-account discovery for Codex and Antigravity, whose rosters differ per
9
+ * account.
10
+ */
11
+ export declare function unionAccountCatalogs<TApi extends Api>(catalogs: readonly (readonly ModelSpec<TApi>[])[]): ModelSpec<TApi>[];
@@ -11,8 +11,30 @@ export interface GoogleVertexModelManagerConfig {
11
11
  signal?: AbortSignal;
12
12
  fetch?: FetchImpl;
13
13
  }
14
+ /** One Antigravity OAuth account whose `fetchAvailableModels` roster discovery reads. */
15
+ export interface GoogleAntigravityAccount {
16
+ /** OAuth access token used for `Authorization: Bearer ...`. */
17
+ accessToken: string;
18
+ /**
19
+ * Credential identity recorded in {@link ModelSpec.accountAccess} for every
20
+ * model this account serves (see `oauthAccountKey` in `@linxiraos/pi-ai`).
21
+ * When any account lacks one, no model records per-account access.
22
+ */
23
+ accountKey?: string;
24
+ }
14
25
  export interface GoogleAntigravityModelManagerConfig {
15
- oauthToken?: string;
26
+ /**
27
+ * Resolves every configured Antigravity account at discovery time. Rosters
28
+ * are plan-scoped (Claude 5.5 is served to some accounts only) and
29
+ * authoritative, so each account's roster is fetched and the results are
30
+ * unioned; reading one account's roster would prune models only its
31
+ * siblings serve (#14924).
32
+ *
33
+ * Returns `null` to abort discovery (e.g. an account's credential failed to
34
+ * refresh), keeping the previous/bundled catalog instead of caching a
35
+ * partial one.
36
+ */
37
+ resolveAccounts?: () => Promise<readonly GoogleAntigravityAccount[] | null>;
16
38
  endpoint?: string;
17
39
  fetch?: FetchImpl;
18
40
  }
@@ -69,7 +69,7 @@ export interface OpenAIModelManagerConfig {
69
69
  baseUrl?: string;
70
70
  fetch?: FetchImpl;
71
71
  }
72
- export declare function openaiModelManagerOptions(config?: OpenAIModelManagerConfig): ModelManagerOptions<"openai-responses">;
72
+ export declare function openaiModelManagerOptions(config?: OpenAIModelManagerConfig): ModelManagerOptions<Api>;
73
73
  /**
74
74
  * Re-derive the generated pro-reasoning aliases (`gpt-5.6-*-pro`) for the
75
75
  * first-party `openai` gpt-5.6 rows. Each alias inherits the base row's
@@ -154,6 +154,19 @@ export interface DeepinfraModelManagerConfig {
154
154
  * model availability at runtime is still gated on credentials by the registry.
155
155
  */
156
156
  export declare function deepinfraModelManagerOptions(config?: DeepinfraModelManagerConfig): ModelManagerOptions<"openai-completions">;
157
+ export declare const CORALBRICKS_BASE_URL = "https://inference.coralbricks.ai/v1";
158
+ /** CoralBricks OpenAI-compatible discovery configuration. */
159
+ export interface CoralbricksModelManagerConfig {
160
+ apiKey?: string;
161
+ baseUrl?: string;
162
+ fetch?: FetchImpl;
163
+ }
164
+ /**
165
+ * Builds CoralBricks' model-discovery manager. `/v1/models` is key-protected
166
+ * (401 without a bearer key), so a keyless config serves only the bundled
167
+ * reviewed seed rows; with a key, live rows are authoritative over the bundle.
168
+ */
169
+ export declare function coralbricksModelManagerOptions(config?: CoralbricksModelManagerConfig): ModelManagerOptions<"openai-completions">;
157
170
  export interface XaiModelManagerConfig {
158
171
  apiKey?: string;
159
172
  baseUrl?: string;
@@ -339,6 +352,11 @@ export interface OpenRouterModelManagerConfig {
339
352
  baseUrl?: string;
340
353
  fetch?: FetchImpl;
341
354
  }
355
+ /**
356
+ * OpenRouter's Decisions API lives at `/api/alpha`, a sibling of the `/api/v1`
357
+ * chat root; derive it so a custom gateway base URL keeps both aligned.
358
+ */
359
+ export declare function openrouterDecisionsBaseUrl(chatBaseUrl: string): string;
342
360
  export declare function openrouterModelManagerOptions(config?: OpenRouterModelManagerConfig): ModelManagerOptions<Api>;
343
361
  export interface ZenMuxModelManagerConfig {
344
362
  apiKey?: string;
@@ -24,6 +24,12 @@ export interface OpenAICodexModelManagerConfig {
24
24
  * keeps the previous/bundled catalog instead.
25
25
  */
26
26
  resolveAccounts?: () => Promise<readonly OpenAICodexAccount[] | null>;
27
+ /**
28
+ * Codex backend base URL (e.g. a Codex-compatible gateway from `models.yml`).
29
+ * Defaults to the official ChatGPT backend. Also scopes the discovery cache,
30
+ * so a gateway roster never serves the official endpoint and vice versa.
31
+ */
32
+ baseUrl?: string;
27
33
  clientVersion?: string;
28
34
  fetch?: FetchImpl;
29
35
  }
@@ -59,6 +65,8 @@ export declare function devinModelManagerOptions(config?: DevinModelManagerConfi
59
65
  export declare function factoryDroidModelManagerOptions(config?: FactoryDroidModelDiscoveryOptions): ModelManagerOptions<"factory-droid-agent">;
60
66
  export declare function localModelManagerOptions(): ModelManagerOptions<"local-inference">;
61
67
  export declare function webModelManagerOptions(): ModelManagerOptions<"web-search">;
68
+ /** Cloudflare Workers AI judges: the authored Clef rows; the account id resolves per request. */
69
+ export declare function cloudflareWorkersAiModelManagerOptions(): ModelManagerOptions<"workers-ai-systemone">;
62
70
  /** Credentials and endpoint overrides for the TypeSafe catalog manager. */
63
71
  export interface TypeSafeModelManagerConfig {
64
72
  apiKey?: string;