@linxiraos/pi-catalog 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -8
- package/README.md +9 -8
- package/dist/types/build.d.ts +13 -8
- package/dist/types/cline-pass-model-id.d.ts +4 -0
- package/dist/types/compat/anthropic.d.ts +10 -4
- package/dist/types/compat/auth-ids.d.ts +4 -0
- package/dist/types/compat/auth.d.ts +7 -0
- package/dist/types/compat/axes.d.ts +50 -0
- package/dist/types/compat/behavior.d.ts +69 -0
- package/dist/types/compat/cascade.d.ts +37 -0
- package/dist/types/{variant-collapse.d.ts → compat/collapse.d.ts} +60 -35
- package/dist/types/compat/openai.d.ts +7 -26
- package/dist/types/compat/resolve.d.ts +15 -0
- package/dist/types/compat/revision.d.ts +41 -0
- package/dist/types/compat/taxonomy.d.ts +93 -0
- package/dist/types/compat/types.d.ts +565 -0
- package/dist/types/discovery/antigravity.d.ts +1 -1
- package/dist/types/discovery/cursor-proto.d.ts +6 -6
- package/dist/types/discovery/cursor.d.ts +5 -3
- package/dist/types/discovery/devin-proto.d.ts +363 -0
- package/dist/types/discovery/gemini-cli.d.ts +1 -1
- package/dist/types/identity/id.d.ts +1 -0
- package/dist/types/identity/index.d.ts +3 -3
- package/dist/types/identity/reference.d.ts +0 -10
- package/dist/types/index.d.ts +1 -1
- package/dist/types/model-thinking.d.ts +6 -24
- package/dist/types/provider-models/cline-pass.d.ts +22 -0
- package/dist/types/provider-models/descriptors.d.ts +20 -1
- package/dist/types/provider-models/models-dev-policies.d.ts +2 -1
- package/dist/types/provider-models/openai-compat.d.ts +59 -46
- package/dist/types/provider-models/special.d.ts +23 -2
- package/dist/types/types.d.ts +177 -13
- package/dist/types/wire/cline-pass.d.ts +21 -0
- package/dist/types/wire/devin-proto.d.ts +14 -0
- package/dist/types/wire/devin.d.ts +36 -0
- package/dist/types/wire/github-copilot.d.ts +31 -12
- package/package.json +6 -4
- package/src/build.ts +165 -48
- package/src/cline-pass-model-id.ts +11 -0
- package/src/compat/anthropic.ts +15 -136
- package/src/compat/auth-ids.ts +157 -0
- package/src/compat/auth.ts +60 -0
- package/src/compat/axes.ts +290 -0
- package/src/compat/behavior.ts +207 -0
- package/src/compat/cascade.ts +230 -0
- package/src/{variant-collapse.ts → compat/collapse.ts} +381 -773
- package/src/compat/openai.ts +17 -848
- package/src/compat/resolve.ts +1229 -0
- package/src/compat/revision.ts +154 -0
- package/src/compat/rules/README.md +315 -0
- package/src/compat/rules/auth/_order.kdl +13 -0
- package/src/compat/rules/auth/abliteration.kdl +9 -0
- package/src/compat/rules/auth/aiand.kdl +9 -0
- package/src/compat/rules/auth/aimlapi.kdl +3 -0
- package/src/compat/rules/auth/alibaba-coding-plan.kdl +5 -0
- package/src/compat/rules/auth/alibaba-token-plan.kdl +11 -0
- package/src/compat/rules/auth/amazon-bedrock.kdl +5 -0
- package/src/compat/rules/auth/anthropic.kdl +53 -0
- package/src/compat/rules/auth/azure.kdl +3 -0
- package/src/compat/rules/auth/baseten.kdl +9 -0
- package/src/compat/rules/auth/bedrock-mantle.kdl +5 -0
- package/src/compat/rules/auth/cerebras.kdl +9 -0
- package/src/compat/rules/auth/cline-pass.kdl +12 -0
- package/src/compat/rules/auth/cloudflare-ai-gateway.kdl +4 -0
- package/src/compat/rules/auth/coreweave.kdl +9 -0
- package/src/compat/rules/auth/cursor.kdl +5 -0
- package/src/compat/rules/auth/deepinfra.kdl +11 -0
- package/src/compat/rules/auth/deepseek.kdl +10 -0
- package/src/compat/rules/auth/devin.kdl +28 -0
- package/src/compat/rules/auth/exa.kdl +9 -0
- package/src/compat/rules/auth/firepass.kdl +14 -0
- package/src/compat/rules/auth/fireworks.kdl +16 -0
- package/src/compat/rules/auth/github-copilot.kdl +7 -0
- package/src/compat/rules/auth/gitlab-duo-agent.kdl +23 -0
- package/src/compat/rules/auth/gitlab-duo.kdl +24 -0
- package/src/compat/rules/auth/gmi-cloud.kdl +9 -0
- package/src/compat/rules/auth/google-antigravity.kdl +28 -0
- package/src/compat/rules/auth/google-gemini-cli.kdl +26 -0
- package/src/compat/rules/auth/google-vertex.kdl +5 -0
- package/src/compat/rules/auth/google.kdl +3 -0
- package/src/compat/rules/auth/groq.kdl +3 -0
- package/src/compat/rules/auth/huggingface.kdl +9 -0
- package/src/compat/rules/auth/kagi.kdl +9 -0
- package/src/compat/rules/auth/kilo.kdl +4 -0
- package/src/compat/rules/auth/kimi-code.kdl +18 -0
- package/src/compat/rules/auth/litellm.kdl +8 -0
- package/src/compat/rules/auth/llama.cpp.kdl +10 -0
- package/src/compat/rules/auth/lm-studio.kdl +7 -0
- package/src/compat/rules/auth/meta.kdl +9 -0
- package/src/compat/rules/auth/minimax-code-cn.kdl +9 -0
- package/src/compat/rules/auth/minimax-code.kdl +9 -0
- package/src/compat/rules/auth/minimax.kdl +3 -0
- package/src/compat/rules/auth/mistral.kdl +3 -0
- package/src/compat/rules/auth/moonshot.kdl +9 -0
- package/src/compat/rules/auth/nanogpt.kdl +9 -0
- package/src/compat/rules/auth/novita.kdl +12 -0
- package/src/compat/rules/auth/nvidia.kdl +11 -0
- package/src/compat/rules/auth/ollama-cloud.kdl +8 -0
- package/src/compat/rules/auth/ollama.kdl +9 -0
- package/src/compat/rules/auth/openai-codex-device.kdl +20 -0
- package/src/compat/rules/auth/openai-codex.kdl +33 -0
- package/src/compat/rules/auth/openai.kdl +3 -0
- package/src/compat/rules/auth/opencode-go.kdl +10 -0
- package/src/compat/rules/auth/opencode-zen.kdl +9 -0
- package/src/compat/rules/auth/openrouter.kdl +32 -0
- package/src/compat/rules/auth/parallel.kdl +9 -0
- package/src/compat/rules/auth/perplexity.kdl +7 -0
- package/src/compat/rules/auth/qianfan.kdl +9 -0
- package/src/compat/rules/auth/qwen-portal.kdl +9 -0
- package/src/compat/rules/auth/sakana.kdl +9 -0
- package/src/compat/rules/auth/siliconflow-cn.kdl +9 -0
- package/src/compat/rules/auth/siliconflow.kdl +9 -0
- package/src/compat/rules/auth/synthetic.kdl +9 -0
- package/src/compat/rules/auth/tavily.kdl +9 -0
- package/src/compat/rules/auth/together.kdl +14 -0
- package/src/compat/rules/auth/umans.kdl +9 -0
- package/src/compat/rules/auth/venice.kdl +9 -0
- package/src/compat/rules/auth/vercel-ai-gateway.kdl +8 -0
- package/src/compat/rules/auth/vllm.kdl +9 -0
- package/src/compat/rules/auth/wafer-serverless.kdl +11 -0
- package/src/compat/rules/auth/xai-oauth.kdl +27 -0
- package/src/compat/rules/auth/xai.kdl +9 -0
- package/src/compat/rules/auth/xiaomi-token-plan-ams.kdl +9 -0
- package/src/compat/rules/auth/xiaomi-token-plan-cn.kdl +9 -0
- package/src/compat/rules/auth/xiaomi-token-plan-sgp.kdl +9 -0
- package/src/compat/rules/auth/xiaomi.kdl +6 -0
- package/src/compat/rules/auth/yolo-auto.kdl +11 -0
- package/src/compat/rules/auth/zai-coding-plan.kdl +29 -0
- package/src/compat/rules/auth/zai.kdl +9 -0
- package/src/compat/rules/auth/zenmux.kdl +9 -0
- package/src/compat/rules/auth/zhipu-coding-plan.kdl +9 -0
- package/src/compat/rules/classes/amazon.kdl +21 -0
- package/src/compat/rules/classes/anthropic.kdl +285 -0
- package/src/compat/rules/classes/baidu.kdl +9 -0
- package/src/compat/rules/classes/bytedance.kdl +9 -0
- package/src/compat/rules/classes/cohere.kdl +7 -0
- package/src/compat/rules/classes/deepseek.kdl +80 -0
- package/src/compat/rules/classes/gemini.kdl +107 -0
- package/src/compat/rules/classes/gemma.kdl +14 -0
- package/src/compat/rules/classes/glm.kdl +115 -0
- package/src/compat/rules/classes/gpt-oss.kdl +16 -0
- package/src/compat/rules/classes/kimi.kdl +113 -0
- package/src/compat/rules/classes/meta.kdl +15 -0
- package/src/compat/rules/classes/mimo.kdl +32 -0
- package/src/compat/rules/classes/minimax.kdl +79 -0
- package/src/compat/rules/classes/mistral.kdl +19 -0
- package/src/compat/rules/classes/openai.kdl +42 -0
- package/src/compat/rules/classes/qwen.kdl +72 -0
- package/src/compat/rules/classes/stepfun.kdl +10 -0
- package/src/compat/rules/classes/xai.kdl +45 -0
- package/src/compat/rules/providers/abliteration.kdl +8 -0
- package/src/compat/rules/providers/aiand.kdl +19 -0
- package/src/compat/rules/providers/aimlapi.kdl +24 -0
- package/src/compat/rules/providers/alibaba-coding-plan.kdl +20 -0
- package/src/compat/rules/providers/alibaba-token-plan.kdl +35 -0
- package/src/compat/rules/providers/amazon-bedrock.kdl +36 -0
- package/src/compat/rules/providers/anthropic.kdl +24 -0
- package/src/compat/rules/providers/azure.kdl +19 -0
- package/src/compat/rules/providers/baseten.kdl +19 -0
- package/src/compat/rules/providers/bedrock-mantle.kdl +15 -0
- package/src/compat/rules/providers/cerebras.kdl +19 -0
- package/src/compat/rules/providers/cline-pass.kdl +8 -0
- package/src/compat/rules/providers/cloudflare-ai-gateway.kdl +26 -0
- package/src/compat/rules/providers/coreweave.kdl +16 -0
- package/src/compat/rules/providers/cursor.kdl +52 -0
- package/src/compat/rules/providers/deepseek.kdl +21 -0
- package/src/compat/rules/providers/firepass.kdl +15 -0
- package/src/compat/rules/providers/fireworks.kdl +43 -0
- package/src/compat/rules/providers/github-copilot.kdl +62 -0
- package/src/compat/rules/providers/gitlab-duo.kdl +24 -0
- package/src/compat/rules/providers/gmi-cloud.kdl +8 -0
- package/src/compat/rules/providers/google-antigravity.kdl +59 -0
- package/src/compat/rules/providers/google-gemini-cli.kdl +12 -0
- package/src/compat/rules/providers/google-vertex.kdl +25 -0
- package/src/compat/rules/providers/google.kdl +17 -0
- package/src/compat/rules/providers/groq.kdl +8 -0
- package/src/compat/rules/providers/huggingface.kdl +24 -0
- package/src/compat/rules/providers/kilo.kdl +51 -0
- package/src/compat/rules/providers/kimi-code.kdl +37 -0
- package/src/compat/rules/providers/llama.cpp.kdl +6 -0
- package/src/compat/rules/providers/lm-studio.kdl +6 -0
- package/src/compat/rules/providers/meta.kdl +10 -0
- package/src/compat/rules/providers/minimax-code-cn.kdl +13 -0
- package/src/compat/rules/providers/minimax-code.kdl +13 -0
- package/src/compat/rules/providers/minimax.kdl +6 -0
- package/src/compat/rules/providers/mistral.kdl +8 -0
- package/src/compat/rules/providers/moonshot.kdl +36 -0
- package/src/compat/rules/providers/nanogpt.kdl +100 -0
- package/src/compat/rules/providers/novita.kdl +34 -0
- package/src/compat/rules/providers/nvidia.kdl +27 -0
- package/src/compat/rules/providers/ollama-cloud.kdl +20 -0
- package/src/compat/rules/providers/ollama.kdl +12 -0
- package/src/compat/rules/providers/openai-codex.kdl +121 -0
- package/src/compat/rules/providers/openai.kdl +82 -0
- package/src/compat/rules/providers/opencode-go.kdl +97 -0
- package/src/compat/rules/providers/opencode-zen.kdl +103 -0
- package/src/compat/rules/providers/openrouter.kdl +66 -0
- package/src/compat/rules/providers/qianfan.kdl +8 -0
- package/src/compat/rules/providers/sakana.kdl +10 -0
- package/src/compat/rules/providers/synthetic.kdl +16 -0
- package/src/compat/rules/providers/together.kdl +22 -0
- package/src/compat/rules/providers/umans.kdl +28 -0
- package/src/compat/rules/providers/venice.kdl +46 -0
- package/src/compat/rules/providers/vercel-ai-gateway.kdl +73 -0
- package/src/compat/rules/providers/vllm.kdl +8 -0
- package/src/compat/rules/providers/wafer-serverless.kdl +35 -0
- package/src/compat/rules/providers/xai-oauth.kdl +48 -0
- package/src/compat/rules/providers/xai.kdl +50 -0
- package/src/compat/rules/providers/xiaomi-token-plan-ams.kdl +9 -0
- package/src/compat/rules/providers/xiaomi-token-plan-cn.kdl +9 -0
- package/src/compat/rules/providers/xiaomi-token-plan-sgp.kdl +9 -0
- package/src/compat/rules/providers/xiaomi.kdl +22 -0
- package/src/compat/rules/providers/yolo-auto.kdl +16 -0
- package/src/compat/rules/providers/zai.kdl +36 -0
- package/src/compat/rules/providers/zenmux.kdl +108 -0
- package/src/compat/rules/providers/zhipu-coding-plan.kdl +49 -0
- package/src/compat/rules/runtime/behavior.kdl +254 -0
- package/src/compat/rules/taxonomy/_collapse.kdl +747 -0
- package/src/compat/rules/taxonomy/_discovery.kdl +60 -0
- package/src/compat/rules/taxonomy/ai21.kdl +6 -0
- package/src/compat/rules/taxonomy/amazon.kdl +8 -0
- package/src/compat/rules/taxonomy/anthropic.kdl +17 -0
- package/src/compat/rules/taxonomy/baidu.kdl +5 -0
- package/src/compat/rules/taxonomy/bytedance.kdl +5 -0
- package/src/compat/rules/taxonomy/cohere.kdl +6 -0
- package/src/compat/rules/taxonomy/deepseek.kdl +18 -0
- package/src/compat/rules/taxonomy/gemini.kdl +9 -0
- package/src/compat/rules/taxonomy/gemma.kdl +3 -0
- package/src/compat/rules/taxonomy/glm.kdl +17 -0
- package/src/compat/rules/taxonomy/gpt-oss.kdl +11 -0
- package/src/compat/rules/taxonomy/kimi.kdl +20 -0
- package/src/compat/rules/taxonomy/meta.kdl +10 -0
- package/src/compat/rules/taxonomy/mimo.kdl +7 -0
- package/src/compat/rules/taxonomy/minimax.kdl +9 -0
- package/src/compat/rules/taxonomy/mistral.kdl +7 -0
- package/src/compat/rules/taxonomy/openai.kdl +43 -0
- package/src/compat/rules/taxonomy/qwen.kdl +33 -0
- package/src/compat/rules/taxonomy/stepfun.kdl +5 -0
- package/src/compat/rules/taxonomy/unknown.kdl +3 -0
- package/src/compat/rules/taxonomy/xai.kdl +12 -0
- package/src/compat/rules.d.json.ts +5 -0
- package/src/compat/rules.json +16933 -0
- package/src/compat/taxonomy.ts +452 -0
- package/src/compat/types.ts +586 -0
- package/src/discovery/antigravity.ts +5 -6
- package/src/discovery/codex.ts +12 -7
- package/src/discovery/cursor-proto.ts +7 -7
- package/src/discovery/cursor.ts +47 -58
- package/src/discovery/devin-proto.ts +613 -0
- package/src/discovery/devin.ts +358 -52
- package/src/discovery/gemini-cli.ts +14 -11
- package/src/discovery/gemini.ts +2 -0
- package/src/identity/dialect.ts +2 -2
- package/src/identity/id.ts +12 -0
- package/src/identity/index.ts +3 -3
- package/src/identity/reference.ts +30 -4
- package/src/index.ts +1 -1
- package/src/model-manager.ts +4 -4
- package/src/model-thinking.ts +6 -810
- package/src/model-tokenizer.ts +37 -44
- package/src/models.json +86187 -23440
- package/src/models.ts +6 -1
- package/src/provider-models/bundled-references.ts +3 -1
- package/src/provider-models/cline-pass.ts +226 -0
- package/src/provider-models/descriptors.ts +18 -0
- package/src/provider-models/google.ts +14 -5
- package/src/provider-models/models-dev-policies.ts +4 -29
- package/src/provider-models/ollama.ts +15 -2
- package/src/provider-models/openai-compat.ts +794 -520
- package/src/provider-models/special.ts +186 -2
- package/src/types.ts +197 -11
- package/src/wire/cline-pass.ts +35 -0
- package/src/wire/devin-proto.ts +30 -0
- package/src/wire/devin.ts +72 -0
- package/src/wire/github-copilot.ts +49 -7
- package/dist/types/compat/bedrock.d.ts +0 -3
- package/dist/types/compat/devin.d.ts +0 -9
- package/dist/types/identity/classify.d.ts +0 -69
- package/dist/types/identity/family.d.ts +0 -243
- package/dist/types/identity/markers.d.ts +0 -4
- package/dist/types/openai-pricing.d.ts +0 -17
- package/src/compat/bedrock.ts +0 -153
- package/src/compat/devin.ts +0 -12
- package/src/identity/classify.ts +0 -242
- package/src/identity/family.ts +0 -496
- package/src/identity/markers.ts +0 -49
- package/src/openai-pricing.ts +0 -29
|
@@ -8,6 +8,12 @@ export interface ModelsDevModel {
|
|
|
8
8
|
name?: string;
|
|
9
9
|
tool_call?: boolean;
|
|
10
10
|
reasoning?: boolean;
|
|
11
|
+
reasoning_options?: Array<{
|
|
12
|
+
type?: string;
|
|
13
|
+
values?: string[];
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
}>;
|
|
11
17
|
limit?: {
|
|
12
18
|
context?: number;
|
|
13
19
|
output?: number;
|
|
@@ -64,30 +70,6 @@ export interface UmansModelManagerConfig {
|
|
|
64
70
|
fetch?: FetchImpl;
|
|
65
71
|
}
|
|
66
72
|
export declare function umansModelManagerOptions(config?: UmansModelManagerConfig): ModelManagerOptions<"anthropic-messages">;
|
|
67
|
-
/** GPT-5.6 rates applied when a first-party request exceeds 272K input tokens. */
|
|
68
|
-
export declare const OPENAI_GPT_56_LONG_CONTEXT_COSTS: {
|
|
69
|
-
readonly luna: {
|
|
70
|
-
readonly inputThreshold: 272000;
|
|
71
|
-
readonly input: 0.4;
|
|
72
|
-
readonly output: 1.8;
|
|
73
|
-
readonly cacheRead: 0.04;
|
|
74
|
-
readonly cacheWrite: 0.5;
|
|
75
|
-
};
|
|
76
|
-
readonly sol: {
|
|
77
|
-
readonly inputThreshold: 272000;
|
|
78
|
-
readonly input: 10;
|
|
79
|
-
readonly output: 45;
|
|
80
|
-
readonly cacheRead: 1;
|
|
81
|
-
readonly cacheWrite: 12.5;
|
|
82
|
-
};
|
|
83
|
-
readonly terra: {
|
|
84
|
-
readonly inputThreshold: 272000;
|
|
85
|
-
readonly input: 4;
|
|
86
|
-
readonly output: 18;
|
|
87
|
-
readonly cacheRead: 0.4;
|
|
88
|
-
readonly cacheWrite: 5;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
73
|
export interface OpenAIModelManagerConfig {
|
|
92
74
|
apiKey?: string;
|
|
93
75
|
baseUrl?: string;
|
|
@@ -183,8 +165,9 @@ export interface XaiModelManagerConfig {
|
|
|
183
165
|
fetch?: FetchImpl;
|
|
184
166
|
}
|
|
185
167
|
/**
|
|
186
|
-
*
|
|
187
|
-
*
|
|
168
|
+
* Mirrors exact public-model prices onto matching SuperGrok catalog rows.
|
|
169
|
+
* The >200K long-context tier itself is rule-owned (`classes/xai.kdl`
|
|
170
|
+
* `long-context-cost` multiplier axis) and derives at build time.
|
|
188
171
|
*/
|
|
189
172
|
export declare function applyXaiCatalogPricing(models: readonly ModelSpec[]): ModelSpec[];
|
|
190
173
|
export declare function xaiModelManagerOptions(config?: XaiModelManagerConfig): ModelManagerOptions<"openai-responses">;
|
|
@@ -202,9 +185,8 @@ interface XAICuratedModel {
|
|
|
202
185
|
/**
|
|
203
186
|
* Whether xAI accepts the `reasoning.effort` wire param for this model.
|
|
204
187
|
* Default true. When false: the picker hides the effort dial (via
|
|
205
|
-
* getSupportedEfforts in model-thinking.ts) AND the wire omits the param
|
|
206
|
-
*
|
|
207
|
-
* single allowlist shared by this curated layer and the compat builder.
|
|
188
|
+
* getSupportedEfforts in model-thinking.ts) AND the wire omits the param.
|
|
189
|
+
* Both read the compat engine's resolved reasoning-effort axes.
|
|
208
190
|
*/
|
|
209
191
|
supportsReasoningEffort?: boolean;
|
|
210
192
|
/**
|
|
@@ -220,8 +202,8 @@ export declare const XAI_OAUTH_CURATED_MODELS: readonly XAICuratedModel[];
|
|
|
220
202
|
* Bake first-party xAI Responses effort-dial metadata onto a catalog spec.
|
|
221
203
|
*
|
|
222
204
|
* models.dev marks many Grok SKUs as reasoners and the thinking rebake would
|
|
223
|
-
* otherwise emit a default `minimal/low/medium/high` dial. api.x.ai
|
|
224
|
-
* accepts `reasoning.effort` for
|
|
205
|
+
* otherwise emit a default `minimal/low/medium/high` dial. api.x.ai
|
|
206
|
+
* accepts `reasoning.effort` only for ids selected by the compat rule —
|
|
225
207
|
* off-allowlist reasoners (`grok-code-fast-1`, `grok-build-0.1`,
|
|
226
208
|
* `grok-4.20-0309-reasoning`, …) 400 if the param is sent. SuperGrok
|
|
227
209
|
* (`xai-oauth`) already curates this via {@link mergeCuratedIntoModel}; paid
|
|
@@ -269,6 +251,12 @@ export interface SiliconFlowModelManagerConfig {
|
|
|
269
251
|
baseUrl?: string;
|
|
270
252
|
fetch?: FetchImpl;
|
|
271
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* SiliconFlow's `/v1/models` lists every served model — including embeddings,
|
|
256
|
+
* rerankers, image, audio, and video generators that cannot serve chat
|
|
257
|
+
* completions — and carries no per-model type field, so non-chat entries are
|
|
258
|
+
* dropped by id to keep the picker usable.
|
|
259
|
+
*/
|
|
272
260
|
export declare function isLikelySiliconFlowChatModelId(id: string): boolean;
|
|
273
261
|
export declare function siliconflowModelManagerOptions(config?: SiliconFlowModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
274
262
|
export declare function siliconflowCnModelManagerOptions(config?: SiliconFlowModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
@@ -355,6 +343,17 @@ export interface FirepassModelManagerConfig {
|
|
|
355
343
|
* See https://docs.fireworks.ai/firepass.
|
|
356
344
|
*/
|
|
357
345
|
export declare function firepassModelManagerOptions(_config?: FirepassModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
346
|
+
/**
|
|
347
|
+
* Cline's OpenAI-compatible `/models` route is absent, but its public
|
|
348
|
+
* recommended-models endpoint is the authoritative ClinePass roster: the
|
|
349
|
+
* `clinePass` bucket lists subscription models and the optional `free` bucket
|
|
350
|
+
* adds $0 usage-billing models selectable with the same key. Metadata resolves
|
|
351
|
+
* in three tiers: the current Cline-published metadata snapshot first, bundled
|
|
352
|
+
* upstream references and OpenRouter enrichment for future ids second, then
|
|
353
|
+
* conservative constants. Newly added ids remain usable before the next regen;
|
|
354
|
+
* known ids retain exact Cline limits, plan pricing, and reasoning controls.
|
|
355
|
+
*/
|
|
356
|
+
export declare function clinePassModelManagerOptions(config?: ModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
358
357
|
export interface WaferModelManagerConfig {
|
|
359
358
|
apiKey?: string;
|
|
360
359
|
baseUrl?: string;
|
|
@@ -408,17 +407,6 @@ export interface AlibabaCodingPlanModelManagerConfig {
|
|
|
408
407
|
export declare function alibabaCodingPlanModelManagerOptions(config?: AlibabaCodingPlanModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
409
408
|
export { ALIBABA_TOKEN_PLAN_BASE_URL };
|
|
410
409
|
export declare const ALIBABA_TOKEN_PLAN_STATIC_MODELS: readonly ModelSpec<"openai-completions">[];
|
|
411
|
-
/**
|
|
412
|
-
* Metadata for Alibaba Token Plan models that are dynamically discovered but not
|
|
413
|
-
* in the static catalog. Context window and max tokens are sourced from
|
|
414
|
-
* official model documentation and provider catalogs. Unknown future models
|
|
415
|
-
* remain available with null limits instead of assigning unsafe guessed limits.
|
|
416
|
-
*/
|
|
417
|
-
export interface AlibabaTokenPlanModelLimits {
|
|
418
|
-
contextWindow: number;
|
|
419
|
-
maxTokens: number;
|
|
420
|
-
}
|
|
421
|
-
export declare const ALIBABA_TOKEN_PLAN_DISCOVERED_MODEL_LIMITS: Readonly<Record<string, AlibabaTokenPlanModelLimits>>;
|
|
422
410
|
export interface AlibabaTokenPlanModelManagerConfig {
|
|
423
411
|
apiKey?: string;
|
|
424
412
|
baseUrl?: string;
|
|
@@ -442,13 +430,12 @@ export interface KimiCodeModelManagerConfig {
|
|
|
442
430
|
* per-family caps instead of a blanket constant. Values match models.dev's
|
|
443
431
|
* `kimi-for-coding` and `moonshotai` kimi-k3 entries. See #6711.
|
|
444
432
|
*/
|
|
445
|
-
export declare const KIMI_CODE_K3_MAX_TOKENS = 131072;
|
|
446
|
-
export declare const KIMI_CODE_FOR_CODING_MAX_TOKENS = 32768;
|
|
447
433
|
/** Fallback output cap for Kimi Code families without a documented ceiling (legacy K2 discovery rows). */
|
|
448
434
|
export declare const KIMI_CODE_DEFAULT_MAX_TOKENS = 32000;
|
|
449
435
|
/**
|
|
450
|
-
* Resolve a Kimi Code model's output ceiling
|
|
451
|
-
*
|
|
436
|
+
* Resolve a Kimi Code model's output ceiling; the per-family caps are
|
|
437
|
+
* rule-owned (`runtime/behavior.kdl` model-limits), everything else ->
|
|
438
|
+
* `fallback`.
|
|
452
439
|
*/
|
|
453
440
|
export declare function kimiCodeMaxTokens(modelId: string, fallback?: number): number;
|
|
454
441
|
export declare function kimiCodeMaxTokens(modelId: string, fallback: number | null): number | null;
|
|
@@ -501,6 +488,12 @@ export interface CoreWeaveModelManagerConfig {
|
|
|
501
488
|
fetch?: FetchImpl;
|
|
502
489
|
}
|
|
503
490
|
export declare function coreWeaveModelManagerOptions(config?: CoreWeaveModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
491
|
+
/**
|
|
492
|
+
* Muse Spark revisions served by Meta's first-party Responses API. Meta's
|
|
493
|
+
* `/v1/models` lists bare ids with no capability metadata, so every revision
|
|
494
|
+
* must be seeded here or discovery yields a text-only, non-reasoning model
|
|
495
|
+
* with an unknown context window.
|
|
496
|
+
*/
|
|
504
497
|
export declare const META_MUSE_STATIC_MODELS: readonly ModelSpec<"openai-responses">[];
|
|
505
498
|
/**
|
|
506
499
|
* OpenAI frontier models served exclusively through Bedrock Mantle's Responses
|
|
@@ -544,6 +537,21 @@ export interface AiandModelManagerConfig {
|
|
|
544
537
|
* pricing metadata, so discovery is authoritative over the bundled seed.
|
|
545
538
|
*/
|
|
546
539
|
export declare function aiandModelManagerOptions(config?: AiandModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
540
|
+
/**
|
|
541
|
+
* Documented abliteration.ai catalog (docs.abliteration.ai/models, 2026-09)
|
|
542
|
+
* bundled so the provider is usable when generation and first boot have no
|
|
543
|
+
* live key. The `/v1/models` response is authoritative once discovery runs.
|
|
544
|
+
* Rows carry only the documented limits and pricing; the per-model reasoning
|
|
545
|
+
* ladders, alias map and wire quirks come from `rules/classes/glm.kdl` and
|
|
546
|
+
* `rules/providers/abliteration.kdl` via `buildModel`.
|
|
547
|
+
*/
|
|
548
|
+
export declare const ABLITERATION_STATIC_MODELS: readonly ModelSpec<"openai-responses">[];
|
|
549
|
+
export interface AbliterationModelManagerConfig {
|
|
550
|
+
apiKey?: string;
|
|
551
|
+
baseUrl?: string;
|
|
552
|
+
fetch?: FetchImpl;
|
|
553
|
+
}
|
|
554
|
+
export declare function abliterationModelManagerOptions(config?: AbliterationModelManagerConfig): ModelManagerOptions<"openai-responses">;
|
|
547
555
|
/**
|
|
548
556
|
* Documented Yolo-Auto catalog (yolo-auto.com/docs, 2026-08) bundled so the
|
|
549
557
|
* provider is usable when generation and first boot have no live key. The
|
|
@@ -686,6 +694,11 @@ export interface ModelsDevProviderDescriptor {
|
|
|
686
694
|
}
|
|
687
695
|
/** Generic mapper that converts models.dev data using provider descriptors. */
|
|
688
696
|
export declare function mapModelsDevToModels(data: Record<string, unknown>, descriptors: readonly ModelsDevProviderDescriptor[]): ModelSpec<Api>[];
|
|
697
|
+
/** Resolves the transport and endpoint for one Z.AI model catalog entry. */
|
|
698
|
+
export declare function resolveZaiApi(modelId: string): {
|
|
699
|
+
api: "anthropic-messages" | "openai-completions";
|
|
700
|
+
baseUrl: string;
|
|
701
|
+
};
|
|
689
702
|
/** All provider descriptors for models.dev data mapping in generate-models.ts. */
|
|
690
703
|
export declare const MODELS_DEV_PROVIDER_DESCRIPTORS: readonly ModelsDevProviderDescriptor[];
|
|
691
704
|
/** Providers whose bundled catalog can receive additive models.dev updates at runtime. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DevinModelDiscoveryOptions } from "../discovery/devin.js";
|
|
2
2
|
import type { ModelManagerOptions } from "../model-manager.js";
|
|
3
|
-
import type { FetchImpl } from "../types.js";
|
|
3
|
+
import type { Api, FetchImpl, Model, ModelSpec } from "../types.js";
|
|
4
4
|
/** One Codex OAuth account to fetch a catalog for. */
|
|
5
5
|
export interface OpenAICodexAccount {
|
|
6
6
|
/** OAuth access token used for `Authorization: Bearer ...`. */
|
|
@@ -33,6 +33,13 @@ export interface CursorModelManagerConfig {
|
|
|
33
33
|
clientVersion?: string;
|
|
34
34
|
}
|
|
35
35
|
export declare function cursorModelManagerOptions(config?: CursorModelManagerConfig): ModelManagerOptions<"cursor-agent">;
|
|
36
|
+
export type GitLabDuoModelIdentity = {
|
|
37
|
+
upstreamModelId: string;
|
|
38
|
+
referenceProvider: "anthropic" | "openai";
|
|
39
|
+
referenceModelId: string;
|
|
40
|
+
};
|
|
41
|
+
export declare function resolveGitLabDuoModelIdentity(modelId: string): GitLabDuoModelIdentity | undefined;
|
|
42
|
+
export declare function getGitLabDuoModels(): Model<Api>[];
|
|
36
43
|
export interface GitLabDuoWorkflowModelManagerConfig {
|
|
37
44
|
apiKey?: string;
|
|
38
45
|
baseUrl?: string;
|
|
@@ -47,7 +54,21 @@ export interface DevinModelManagerConfig {
|
|
|
47
54
|
baseUrl?: string;
|
|
48
55
|
fetch?: DevinModelDiscoveryOptions["fetch"];
|
|
49
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Curated Devin seed — the entire bundled surface for the provider. The
|
|
59
|
+
* Cascade catalog is credential-scoped (gated per account/team), so catalog
|
|
60
|
+
* generation never fetches it: baking one account's roster into the shared
|
|
61
|
+
* bundle would misstate every other account's entitlements and leave zombie
|
|
62
|
+
* rows behind (see CREDENTIAL_SCOPED_PROVIDERS in generate-models.ts). Both
|
|
63
|
+
* SWE-1.6 lanes are verified live against `GetCliModelConfigs`; the
|
|
64
|
+
* descriptor's `defaultModel` (`swe-1-6`) must resolve synchronously at
|
|
65
|
+
* boot, before credential-scoped runtime discovery replaces the seed. Field
|
|
66
|
+
* shape mirrors `devinModelSpec` so seeded and discovered rows are
|
|
67
|
+
* indistinguishable downstream.
|
|
68
|
+
*/
|
|
69
|
+
export declare const DEVIN_STATIC_MODELS: readonly ModelSpec<"devin-agent">[];
|
|
50
70
|
export declare function devinModelManagerOptions(config?: DevinModelManagerConfig): ModelManagerOptions<"devin-agent">;
|
|
51
71
|
export interface ZaiModelManagerConfig {
|
|
52
72
|
}
|
|
53
|
-
|
|
73
|
+
/** Creates model-manager options for Z.AI's mixed native and Anthropic transports. */
|
|
74
|
+
export declare function zaiModelManagerOptions(_config?: ZaiModelManagerConfig): ModelManagerOptions<"anthropic-messages" | "openai-completions">;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ModelIdentity } from "./compat/types.js";
|
|
1
2
|
import type { Effort } from "./effort.js";
|
|
2
3
|
export type { FetchImpl } from "@linxiraos/pi-utils";
|
|
3
4
|
export type { KnownProvider } from "./provider-models/descriptors.js";
|
|
@@ -28,9 +29,14 @@ export interface ThinkingConfig {
|
|
|
28
29
|
* 5). Also implies native interleaved thinking — no beta header needed.
|
|
29
30
|
*/
|
|
30
31
|
supportsDisplay?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Thinking signatures bind each block to its preceding conversation prefix.
|
|
34
|
+
* Requests that rewrite the prefix must opt into the provider's drop/error control.
|
|
35
|
+
*/
|
|
36
|
+
prefixBinding?: boolean;
|
|
31
37
|
/**
|
|
32
38
|
* Per-effort upstream wire-id routing for collapsed effort-tier variants
|
|
33
|
-
* (`
|
|
39
|
+
* (`compat/collapse.ts`). Keyed by pi effort; `"off"` applies when
|
|
34
40
|
* thinking is disabled. Missing keys fall back to `requestModelId ?? id`.
|
|
35
41
|
*/
|
|
36
42
|
effortRouting?: Readonly<Partial<Record<Effort | "off", string>>>;
|
|
@@ -113,6 +119,15 @@ export interface Usage {
|
|
|
113
119
|
webSearch?: number;
|
|
114
120
|
webFetch?: number;
|
|
115
121
|
};
|
|
122
|
+
/** Provider-reported credit meter values for credit-based billing APIs. */
|
|
123
|
+
credits?: {
|
|
124
|
+
/** Uncommitted per-response credit cost, when reported. */
|
|
125
|
+
cost?: number;
|
|
126
|
+
/** Final committed credit cost, when reported. */
|
|
127
|
+
committedCost?: number;
|
|
128
|
+
/** Final committed ACU cost, when reported. */
|
|
129
|
+
acuCost?: number;
|
|
130
|
+
};
|
|
116
131
|
cost: {
|
|
117
132
|
input: number;
|
|
118
133
|
output: number;
|
|
@@ -122,7 +137,7 @@ export interface Usage {
|
|
|
122
137
|
};
|
|
123
138
|
}
|
|
124
139
|
export type OpenAIReasoningFormat = "openai" | "openrouter" | "zai" | "kimi" | "qwen" | "qwen-chat-template" | "chat-template";
|
|
125
|
-
export type OpenAIReasoningDisableMode = "omit" | "lowest-effort" | "none-effort" | "openrouter-enabled-false" | "venice-disable-thinking" | "zai-thinking-disabled" | "qwen-enable-thinking-false" | "qwen-template-false" | "chat-template-thinking-false";
|
|
140
|
+
export type OpenAIReasoningDisableMode = "omit" | "lowest-effort" | "none-effort" | "openrouter-enabled-false" | "cline-enabled-false" | "venice-disable-thinking" | "zai-thinking-disabled" | "qwen-enable-thinking-false" | "qwen-template-false" | "chat-template-thinking-false";
|
|
126
141
|
export type OpenAIStreamMarkupHealingPattern = "kimi" | "dsml" | "qwen" | "thinking";
|
|
127
142
|
/**
|
|
128
143
|
* Compatibility settings for openai-completions API.
|
|
@@ -267,6 +282,14 @@ export interface OpenAICompat {
|
|
|
267
282
|
openRouterRouting?: OpenRouterRouting;
|
|
268
283
|
/** Vercel AI Gateway routing preferences. Only used when baseUrl points to Vercel AI Gateway. */
|
|
269
284
|
vercelGatewayRouting?: VercelGatewayRouting;
|
|
285
|
+
/**
|
|
286
|
+
* Provider-specific wire model-id transform applied to the base id, overriding
|
|
287
|
+
* the provider-detected default. Discovery layers set this per model when the
|
|
288
|
+
* upstream roster declares the id's namespace (e.g. ClinePass free-tier models
|
|
289
|
+
* arrive pre-namespaced and use `"raw"`), so wire form follows data rather
|
|
290
|
+
* than id shape.
|
|
291
|
+
*/
|
|
292
|
+
wireModelIdMode?: "raw" | "cline-pass" | "firepass" | "fireworks" | "openrouter";
|
|
270
293
|
/** Extra fields to include in request body (e.g. gateway routing hints for OpenClaw-style proxies). */
|
|
271
294
|
extraBody?: Record<string, unknown>;
|
|
272
295
|
/** Request-session header that should mirror the normalized prompt-cache key. Default: unset. */
|
|
@@ -325,6 +348,8 @@ export interface OpenAICompat {
|
|
|
325
348
|
toolStrictMode?: "all_strict" | "none";
|
|
326
349
|
/** Whether request shaping may send reasoning params at all. Default: auto-detected (disabled for GitHub Copilot chat-completions). */
|
|
327
350
|
supportsReasoningParams?: boolean;
|
|
351
|
+
/** Whether Responses requests may include `reasoning.summary`. Default: true except on known incompatible hosts. */
|
|
352
|
+
supportsReasoningSummary?: boolean;
|
|
328
353
|
/**
|
|
329
354
|
* Whether the endpoint accepts explicit sampling parameters (`temperature`,
|
|
330
355
|
* `top_p`, `top_k`, `min_p`, penalties). OpenAI proprietary reasoning models
|
|
@@ -365,6 +390,16 @@ export interface OpenAICompat {
|
|
|
365
390
|
* spread. Default: auto-detected (OpenCode gateways, #1071/#1484).
|
|
366
391
|
*/
|
|
367
392
|
whenThinking?: Partial<Omit<OpenAICompat, "whenThinking">>;
|
|
393
|
+
/** Kimi K3 drives reasoning through native `reasoning_effort` on Moonshot-native hosts. */
|
|
394
|
+
nativeKimiK3Reasoning?: boolean;
|
|
395
|
+
/** GLM-5.2 accepts Z.ai's `reasoning_effort` dialect alongside binary thinking. */
|
|
396
|
+
zaiReasoningEffortDialect?: boolean;
|
|
397
|
+
/** Clamp the requested max output tokens to the model's advertised ceiling. */
|
|
398
|
+
clampOutputToModelMax?: boolean;
|
|
399
|
+
/** Strip image inputs before encoding (text-only serving of a multimodal id). */
|
|
400
|
+
stripImageInput?: boolean;
|
|
401
|
+
/** Thinking-loop watchdog guard family applied to streamed reasoning. */
|
|
402
|
+
thinkingLoopGuard?: "gemini" | "deepseek" | "xai";
|
|
368
403
|
}
|
|
369
404
|
/**
|
|
370
405
|
* Compatibility settings for anthropic-messages API.
|
|
@@ -372,6 +407,13 @@ export interface OpenAICompat {
|
|
|
372
407
|
* that proxy gateways (Vertex AI, AWS Bedrock-style fronts, etc.) reject.
|
|
373
408
|
*/
|
|
374
409
|
export interface AnthropicCompat {
|
|
410
|
+
/** Whether thinking requests may include `context_management` and its beta header. Default: true. */
|
|
411
|
+
supportsContextManagement?: boolean;
|
|
412
|
+
/**
|
|
413
|
+
* Whether requests may carry `output_config.effort` (and its effort beta
|
|
414
|
+
* header). Vertex AI rejects the field/header. Default: true.
|
|
415
|
+
*/
|
|
416
|
+
supportsOutputEffort?: boolean;
|
|
375
417
|
/**
|
|
376
418
|
* Stream-watchdog idle-timeout fallback in ms for slow reasoning hosts.
|
|
377
419
|
* Set to 0 to disable the inter-event idle watchdog entirely, matching
|
|
@@ -400,12 +442,20 @@ export interface AnthropicCompat {
|
|
|
400
442
|
supportsLongCacheRetention?: boolean;
|
|
401
443
|
/**
|
|
402
444
|
* Whether mid-conversation `role: "system"` messages are accepted in the
|
|
403
|
-
* `messages` array
|
|
404
|
-
* first-party Claude API and Claude Platform on AWS). When unset,
|
|
405
|
-
* auto-detected from the model id and base URL. Not available on Bedrock,
|
|
406
|
-
* Vertex AI, or Microsoft Foundry.
|
|
445
|
+
* `messages` array. When unset, auto-detected from model and deployment policy.
|
|
407
446
|
*/
|
|
408
447
|
supportsMidConversationSystem?: boolean;
|
|
448
|
+
/** Whether turn-scoped system messages accept `clear_at`. */
|
|
449
|
+
supportsTurnScopedSystem?: boolean;
|
|
450
|
+
/** Whether tool availability can change through system-message tool references. */
|
|
451
|
+
supportsMidConversationToolChanges?: boolean;
|
|
452
|
+
/** Whether effort can change through a per-message `output_config`. */
|
|
453
|
+
supportsPerMessageEffort?: boolean;
|
|
454
|
+
/**
|
|
455
|
+
* Whether the endpoint accepts `thinking.block_binding` and reports
|
|
456
|
+
* `input_transformations` under the thinking-binding-controls beta.
|
|
457
|
+
*/
|
|
458
|
+
supportsThinkingBindingControls?: boolean;
|
|
409
459
|
/**
|
|
410
460
|
* Whether the model accepts a forced `tool_choice` (`{ type: "any" }` or
|
|
411
461
|
* `{ type: "tool", name }`). Claude Fable/Mythos 5 reject forced tool use
|
|
@@ -467,6 +517,15 @@ export interface AnthropicCompat {
|
|
|
467
517
|
* {@link ResolvedAnthropicCompat.officialEndpoint}.
|
|
468
518
|
*/
|
|
469
519
|
signingEndpoint?: boolean;
|
|
520
|
+
/**
|
|
521
|
+
* Inject the Claude Code identity instruction on OAuth requests. Haiku 3.5
|
|
522
|
+
* predates the framing and rejects it; class rules set `false` there.
|
|
523
|
+
*/
|
|
524
|
+
injectClaudeCodeInstruction?: boolean;
|
|
525
|
+
/** Strip image inputs before encoding (text-only serving of a multimodal id). */
|
|
526
|
+
stripImageInput?: boolean;
|
|
527
|
+
/** Thinking-loop watchdog guard family applied to streamed reasoning. */
|
|
528
|
+
thinkingLoopGuard?: "gemini" | "deepseek" | "xai";
|
|
470
529
|
}
|
|
471
530
|
/**
|
|
472
531
|
* Compatibility settings for Bedrock Converse prompt caching. Cache pricing is
|
|
@@ -596,9 +655,17 @@ export interface ResolvedOpenAISharedCompat {
|
|
|
596
655
|
alwaysSendMaxTokens: boolean;
|
|
597
656
|
openRouterRouting?: OpenAICompat["openRouterRouting"];
|
|
598
657
|
/** Provider-specific wire model-id transform applied to the base id. */
|
|
599
|
-
wireModelIdMode: "raw" | "firepass" | "fireworks" | "openrouter";
|
|
658
|
+
wireModelIdMode: "raw" | "cline-pass" | "firepass" | "fireworks" | "openrouter";
|
|
600
659
|
/** See {@link OpenAICompat.toolSchemaFlavor}. Read by both wire paths when converting tools. */
|
|
601
660
|
toolSchemaFlavor?: OpenAICompat["toolSchemaFlavor"];
|
|
661
|
+
/** Strip image inputs before encoding (text-only serving of a multimodal id). */
|
|
662
|
+
stripImageInput: boolean;
|
|
663
|
+
/** Thinking-loop watchdog guard family applied to streamed reasoning. */
|
|
664
|
+
thinkingLoopGuard?: OpenAICompat["thinkingLoopGuard"];
|
|
665
|
+
/** Flatten/reject leftover root `anyOf`/`oneOf` unions in strict tool schemas (xAI's function-calling validator 400s on them). */
|
|
666
|
+
rejectRootObjectUnion: boolean;
|
|
667
|
+
/** Retry without strict tools when the host rejects a strict grammar as too large (OpenRouter-Anthropic compiled-grammar overflow). */
|
|
668
|
+
retryWithoutStrictOnGrammarError: boolean;
|
|
602
669
|
}
|
|
603
670
|
/**
|
|
604
671
|
* Fully-resolved chat-completions compat view: every detected default
|
|
@@ -606,7 +673,7 @@ export interface ResolvedOpenAISharedCompat {
|
|
|
606
673
|
* `buildModel`; request handlers read fields and never detect, resolve, or
|
|
607
674
|
* allocate.
|
|
608
675
|
*/
|
|
609
|
-
export type ResolvedOpenAICompat = ResolvedOpenAISharedCompat & Required<Omit<OpenAICompat, "supportsDeveloperRole" | "supportsReasoningEffort" | "reasoningEffortMap" | "supportsReasoningParams" | "supportsSamplingParams" | "supportsPenaltyAndStopParams" | "thinkingFormat" | "kimiApiFormat" | "reasoningDisableMode" | "omitReasoningEffort" | "includeEncryptedReasoning" | "filterReasoningHistory" | "disableReasoningOnForcedToolChoice" | "disableReasoningOnToolChoice" | "supportsToolChoice" | "supportsForcedToolChoice" | "supportsNamedToolChoice" | "reasoningContentField" | "requiresReasoningContentForToolCalls" | "requiresReasoningContentForAllAssistantTurns" | "allowsSyntheticReasoningContentForToolCalls" | "replayReasoningContent" | "qwenPreserveThinking" | "qwenTemplateReasoningEffort" | "requiresThinkingAsText" | "requiresMistralToolIds" | "requiresToolResultName" | "requiresAssistantAfterToolResult" | "requiresAssistantContentForToolCalls" | "stripDeepseekSpecialTokens" | "streamMarkupHealingPattern" | "reasoningDeltasMayBeCumulative" | "emptyLengthFinishIsContextError" | "usesOpenAIToolCallIdLimit" | "promptCacheSessionHeader" | "supportsPromptCacheBreakpoints" | "promptCacheBreakpointTtl" | "openRouterRouting" | "isOpenRouterHost" | "supportsStrictMode" | "supportsLongPromptCacheRetention" | "alwaysSendMaxTokens" | "wireModelIdMode" | "vercelGatewayRouting" | "extraBody" | "toolStrictMode" | "toolSchemaFlavor" | "streamFirstEventTimeoutMs" | "streamIdleTimeoutMs" | "cacheControlFormat" | "thinkingKeep" | "strictResponsesPairing" | "supportsImageDetailOriginal" | "whenThinking">> & {
|
|
676
|
+
export type ResolvedOpenAICompat = ResolvedOpenAISharedCompat & Required<Omit<OpenAICompat, "supportsDeveloperRole" | "supportsReasoningEffort" | "reasoningEffortMap" | "supportsReasoningParams" | "supportsReasoningSummary" | "supportsSamplingParams" | "supportsPenaltyAndStopParams" | "thinkingFormat" | "kimiApiFormat" | "reasoningDisableMode" | "omitReasoningEffort" | "includeEncryptedReasoning" | "filterReasoningHistory" | "disableReasoningOnForcedToolChoice" | "disableReasoningOnToolChoice" | "supportsToolChoice" | "supportsForcedToolChoice" | "supportsNamedToolChoice" | "reasoningContentField" | "requiresReasoningContentForToolCalls" | "requiresReasoningContentForAllAssistantTurns" | "allowsSyntheticReasoningContentForToolCalls" | "replayReasoningContent" | "qwenPreserveThinking" | "qwenTemplateReasoningEffort" | "requiresThinkingAsText" | "requiresMistralToolIds" | "requiresToolResultName" | "requiresAssistantAfterToolResult" | "requiresAssistantContentForToolCalls" | "stripDeepseekSpecialTokens" | "streamMarkupHealingPattern" | "reasoningDeltasMayBeCumulative" | "emptyLengthFinishIsContextError" | "usesOpenAIToolCallIdLimit" | "promptCacheSessionHeader" | "supportsPromptCacheBreakpoints" | "promptCacheBreakpointTtl" | "openRouterRouting" | "isOpenRouterHost" | "supportsStrictMode" | "supportsLongPromptCacheRetention" | "alwaysSendMaxTokens" | "wireModelIdMode" | "vercelGatewayRouting" | "extraBody" | "toolStrictMode" | "toolSchemaFlavor" | "streamFirstEventTimeoutMs" | "streamIdleTimeoutMs" | "cacheControlFormat" | "thinkingKeep" | "strictResponsesPairing" | "supportsImageDetailOriginal" | "stripImageInput" | "thinkingLoopGuard" | "whenThinking">> & {
|
|
610
677
|
vercelGatewayRouting?: OpenAICompat["vercelGatewayRouting"];
|
|
611
678
|
extraBody?: OpenAICompat["extraBody"];
|
|
612
679
|
cacheControlFormat?: OpenAICompat["cacheControlFormat"];
|
|
@@ -615,6 +682,8 @@ export type ResolvedOpenAICompat = ResolvedOpenAISharedCompat & Required<Omit<Op
|
|
|
615
682
|
toolStrictMode: ResolvedToolStrictMode;
|
|
616
683
|
/** The model sits behind Vercel AI Gateway. */
|
|
617
684
|
isVercelGatewayHost: boolean;
|
|
685
|
+
/** Send the normalized prompt-cache key as top-level `prompt_cache_key` on chat completions. */
|
|
686
|
+
supportsPromptCacheKey: boolean;
|
|
618
687
|
dropThinkingWhenReasoningEffort: boolean;
|
|
619
688
|
/** Complete alternate view for thinking-engaged requests; swap pointers, never spread. */
|
|
620
689
|
whenThinking?: ResolvedOpenAICompat;
|
|
@@ -625,6 +694,14 @@ export interface ResolvedOpenAIResponsesCompat extends ResolvedOpenAISharedCompa
|
|
|
625
694
|
strictResponsesPairing: boolean;
|
|
626
695
|
supportsImageDetailOriginal: boolean;
|
|
627
696
|
supportsObfuscationOptOut: boolean;
|
|
697
|
+
/**
|
|
698
|
+
* Whether `reasoning.context: "all_turns"` (full cross-turn reasoning
|
|
699
|
+
* replay) is accepted. Rule-owned: gpt-5.4+ wire generation on the Codex
|
|
700
|
+
* transport; earlier ids reject the value.
|
|
701
|
+
*/
|
|
702
|
+
supportsAllTurnsReasoningContext: boolean;
|
|
703
|
+
/** Inject the `# Juice: 0 !important` developer item when reasoning is forced off (gpt-5.6+). */
|
|
704
|
+
requiresReasoningOffJuiceInstruction: boolean;
|
|
628
705
|
/**
|
|
629
706
|
* Whether `reasoning.summary` may be sent. First-party xAI `/v1/responses`
|
|
630
707
|
* rejects the field; handlers pass `null` so the wire omits it instead of
|
|
@@ -635,6 +712,17 @@ export interface ResolvedOpenAIResponsesCompat extends ResolvedOpenAISharedCompa
|
|
|
635
712
|
vercelGatewayRouting?: OpenAICompat["vercelGatewayRouting"];
|
|
636
713
|
/** The model sits behind Vercel AI Gateway's Responses endpoint. */
|
|
637
714
|
isVercelGatewayHost: boolean;
|
|
715
|
+
/**
|
|
716
|
+
* The configured endpoint is first-party OpenAI (`provider === "openai"` on
|
|
717
|
+
* an `api.openai.com` or unset baseUrl). Gates official-only Responses
|
|
718
|
+
* behavior: default-on stateful `previous_response_id` chaining and the
|
|
719
|
+
* `text.verbosity` field.
|
|
720
|
+
*/
|
|
721
|
+
officialEndpoint: boolean;
|
|
722
|
+
/** Run Harmony-protocol leak detection/mitigation on streamed output. */
|
|
723
|
+
harmonyLeakMitigation: boolean;
|
|
724
|
+
/** Responses-surface prompt-cache marker dialect (OpenRouter-Anthropic `cache_control`). */
|
|
725
|
+
cacheControlFormat?: OpenAICompat["cacheControlFormat"];
|
|
638
726
|
}
|
|
639
727
|
/**
|
|
640
728
|
* OpenRouter is a pseudo API: runtime dispatch can use either Responses
|
|
@@ -643,7 +731,9 @@ export interface ResolvedOpenAIResponsesCompat extends ResolvedOpenAISharedCompa
|
|
|
643
731
|
*/
|
|
644
732
|
export type ResolvedOpenRouterCompat = ResolvedOpenAICompat & ResolvedOpenAIResponsesCompat;
|
|
645
733
|
/** Fully-resolved anthropic-messages compat view (same contract as `ResolvedOpenAICompat`). */
|
|
646
|
-
export type ResolvedAnthropicCompat = Required<Omit<AnthropicCompat, "streamIdleTimeoutMs">> & {
|
|
734
|
+
export type ResolvedAnthropicCompat = Required<Omit<AnthropicCompat, "streamIdleTimeoutMs" | "thinkingLoopGuard">> & {
|
|
735
|
+
/** Thinking-loop watchdog guard family applied to streamed reasoning. */
|
|
736
|
+
thinkingLoopGuard?: AnthropicCompat["thinkingLoopGuard"];
|
|
647
737
|
/**
|
|
648
738
|
* Stream-watchdog idle-timeout fallback in ms for slow reasoning hosts; 0 disables the idle watchdog.
|
|
649
739
|
* Undefined defers to `PI_STREAM_IDLE_TIMEOUT_MS`, then the legacy
|
|
@@ -661,7 +751,7 @@ export type ResolvedAnthropicCompat = Required<Omit<AnthropicCompat, "streamIdle
|
|
|
661
751
|
/**
|
|
662
752
|
* Compatibility settings for the devin-agent (Codeium Cascade) API. Cascade
|
|
663
753
|
* selects reasoning effort only by routing to a sibling model id (the
|
|
664
|
-
* `thinking.effortRouting` baked by
|
|
754
|
+
* `thinking.effortRouting` baked by the compat collapse engine), never by a wire
|
|
665
755
|
* reasoning/effort field, so the model-thinking deriver must not invent an
|
|
666
756
|
* effort ladder from identity for these models.
|
|
667
757
|
*/
|
|
@@ -673,13 +763,62 @@ export interface DevinCompat {
|
|
|
673
763
|
* effort) instead of a fabricated minimal/low/medium/high ladder.
|
|
674
764
|
*/
|
|
675
765
|
trustExplicitThinkingOnly?: boolean;
|
|
766
|
+
/**
|
|
767
|
+
* Server-side router model. Providers must resolve the router through
|
|
768
|
+
* `AssignModel` and send the returned assignment JWT with the chat request.
|
|
769
|
+
*/
|
|
770
|
+
modelRouter?: boolean;
|
|
771
|
+
/** Whether the upstream model supports native parallel tool calls. */
|
|
772
|
+
supportsParallelToolCalls?: boolean;
|
|
676
773
|
}
|
|
677
774
|
/** Fully-resolved devin-agent compat view. */
|
|
678
775
|
export type ResolvedDevinCompat = Required<DevinCompat>;
|
|
776
|
+
/**
|
|
777
|
+
* Compatibility settings for the Google API family (google-generative-ai,
|
|
778
|
+
* google-vertex, google-gemini-cli). Class-driven defaults come from the
|
|
779
|
+
* compat cascade; sparse overrides follow the same shape.
|
|
780
|
+
*/
|
|
781
|
+
export interface GoogleCompat {
|
|
782
|
+
/** Whether functionCall/functionResponse parts carry the `id` field. */
|
|
783
|
+
supportsFunctionPartId?: boolean;
|
|
784
|
+
/** Add the bypass sentinel to every unsigned Gemini function call. */
|
|
785
|
+
requiresSkipThoughtSignature?: boolean;
|
|
786
|
+
/** Add the bypass sentinel when a Gemini turn's first function call is unsigned. */
|
|
787
|
+
requiresSkipThoughtSignatureOnFirstFunctionCall?: boolean;
|
|
788
|
+
/** Drop unsigned thinking blocks from replayed history (Antigravity Claude). */
|
|
789
|
+
dropUnsignedThinking?: boolean;
|
|
790
|
+
/** Cloud Code Assist legacy `parameters` schema field instead of `parametersJsonSchema`. */
|
|
791
|
+
ccaLegacyParametersSchema?: boolean;
|
|
792
|
+
/** Whether multimodal (non-text) functionResponse parts are accepted (Gemini 3+). */
|
|
793
|
+
multimodalFunctionResponse?: boolean;
|
|
794
|
+
/** Stream-watchdog first-event timeout in ms; 0 disables it. */
|
|
795
|
+
streamFirstEventTimeoutMs?: number;
|
|
796
|
+
/** Stream-watchdog idle-timeout floor in ms. */
|
|
797
|
+
streamIdleTimeoutMs?: number;
|
|
798
|
+
/** Work around the Flash streaming leak (duplicate first chunk) on gemini-cli. */
|
|
799
|
+
flashStreamLeakWorkaround?: boolean;
|
|
800
|
+
/** Send the Claude thinking beta header on Antigravity Claude requests. */
|
|
801
|
+
claudeThinkingBetaHeader?: boolean;
|
|
802
|
+
/** Antigravity Claude tool-mode request framing. */
|
|
803
|
+
antigravityClaudeToolMode?: boolean;
|
|
804
|
+
/** Usage-label bucket Antigravity reports this model under. */
|
|
805
|
+
antigravityUsageLabel?: string;
|
|
806
|
+
/** Strip image inputs before encoding (text-only serving of a multimodal id). */
|
|
807
|
+
stripImageInput?: boolean;
|
|
808
|
+
/** Thinking-loop watchdog guard family applied to streamed reasoning. */
|
|
809
|
+
thinkingLoopGuard?: "gemini" | "deepseek" | "xai";
|
|
810
|
+
}
|
|
811
|
+
/** Fully-resolved google-API compat view, materialized once by `buildModel`. */
|
|
812
|
+
export type ResolvedGoogleCompat = Required<Omit<GoogleCompat, "streamFirstEventTimeoutMs" | "streamIdleTimeoutMs" | "thinkingLoopGuard" | "antigravityUsageLabel">> & {
|
|
813
|
+
streamFirstEventTimeoutMs?: number;
|
|
814
|
+
streamIdleTimeoutMs?: number;
|
|
815
|
+
thinkingLoopGuard?: GoogleCompat["thinkingLoopGuard"];
|
|
816
|
+
antigravityUsageLabel?: string;
|
|
817
|
+
};
|
|
679
818
|
/** Sparse, user-authored compat overrides for a given API (models.json / config vocabulary). */
|
|
680
|
-
export type CompatConfigOf<TApi extends Api> = TApi extends "openai-completions" | "openrouter" | "openai-responses" | "azure-openai-responses" | "openai-codex-responses" ? OpenAICompat : TApi extends "anthropic-messages" ? AnthropicCompat : TApi extends "bedrock-converse-stream" ? BedrockCompat : TApi extends "devin-agent" ? DevinCompat : undefined;
|
|
819
|
+
export type CompatConfigOf<TApi extends Api> = TApi extends "openai-completions" | "openrouter" | "openai-responses" | "azure-openai-responses" | "openai-codex-responses" ? OpenAICompat : TApi extends "anthropic-messages" ? AnthropicCompat : TApi extends "bedrock-converse-stream" ? BedrockCompat : TApi extends "devin-agent" ? DevinCompat : TApi extends "google-generative-ai" | "google-vertex" | "google-gemini-cli" ? GoogleCompat : undefined;
|
|
681
820
|
/** Resolved compat for a given API: complete record, materialized once by `buildModel`. */
|
|
682
|
-
export type CompatOf<TApi extends Api> = TApi extends "openrouter" ? ResolvedOpenRouterCompat : TApi extends "openai-completions" ? ResolvedOpenAICompat : TApi extends "openai-responses" | "azure-openai-responses" | "openai-codex-responses" ? ResolvedOpenAIResponsesCompat : TApi extends "anthropic-messages" ? ResolvedAnthropicCompat : TApi extends "bedrock-converse-stream" ? ResolvedBedrockCompat : TApi extends "devin-agent" ? ResolvedDevinCompat : undefined;
|
|
821
|
+
export type CompatOf<TApi extends Api> = TApi extends "openrouter" ? ResolvedOpenRouterCompat : TApi extends "openai-completions" ? ResolvedOpenAICompat : TApi extends "openai-responses" | "azure-openai-responses" | "openai-codex-responses" ? ResolvedOpenAIResponsesCompat : TApi extends "anthropic-messages" ? ResolvedAnthropicCompat : TApi extends "bedrock-converse-stream" ? ResolvedBedrockCompat : TApi extends "devin-agent" ? ResolvedDevinCompat : TApi extends "google-generative-ai" | "google-vertex" | "google-gemini-cli" ? ResolvedGoogleCompat : undefined;
|
|
683
822
|
/** Provider-native compaction endpoint configuration for one model. */
|
|
684
823
|
export interface RemoteCompactionConfig<TApi extends Api = Api> {
|
|
685
824
|
/** Enables provider-native compaction for providers not enabled by built-in policy. */
|
|
@@ -730,12 +869,20 @@ export interface ModelCost extends TokenCost {
|
|
|
730
869
|
export type ModelTokenizer = "claude-v3" | "claude-v47" | "claude-v5" | "claude-v5-sonnet" | "qwen3" | "deepseek-v3" | "kimi-k2" | "glm5";
|
|
731
870
|
export interface Model<TApi extends Api = Api> {
|
|
732
871
|
id: string;
|
|
872
|
+
/**
|
|
873
|
+
* Structured model identity resolved by the compat engine: vendor lineage
|
|
874
|
+
* class, product family, and revision. Baked into models.json rows and
|
|
875
|
+
* materialized by `buildModel` for discovered/custom specs.
|
|
876
|
+
*/
|
|
877
|
+
identity: ModelIdentity;
|
|
733
878
|
/**
|
|
734
879
|
* Whether provider-bound private-use glyphs require reversible ASCII tokenization.
|
|
735
880
|
* Materialized by `buildModel`; request handlers read this capability instead of
|
|
736
881
|
* inferring it from the transport API.
|
|
737
882
|
*/
|
|
738
883
|
requiresGlyphTokenization?: boolean;
|
|
884
|
+
/** Whether this model requires Cursor's tool-schema combiner projection. */
|
|
885
|
+
requiresCursorToolSchemaProjection?: boolean;
|
|
739
886
|
/**
|
|
740
887
|
* Model id to send on the wire when it differs from `id`. Used by catalog
|
|
741
888
|
* variants that present one upstream model under several local entries —
|
|
@@ -831,6 +978,23 @@ export interface Model<TApi extends Api = Api> {
|
|
|
831
978
|
remoteCompaction?: RemoteCompactionConfig<TApi>;
|
|
832
979
|
/** Provider-assigned priority value (lower = higher priority). */
|
|
833
980
|
priority?: number;
|
|
981
|
+
/**
|
|
982
|
+
* Per-service-tier cost multipliers baked from the `service-tier-cost`
|
|
983
|
+
* catalog axis (e.g. `{ priority: 2.5 }`). Absent tiers use the API-generic
|
|
984
|
+
* defaults.
|
|
985
|
+
*/
|
|
986
|
+
serviceTierCost?: Readonly<Partial<Record<"flex" | "priority", number>>>;
|
|
987
|
+
/**
|
|
988
|
+
* Provider-supplied one-line blurb for this model. Set only when an upstream
|
|
989
|
+
* ships one (Devin's `GetCliModelConfigs`); never synthesized locally.
|
|
990
|
+
*/
|
|
991
|
+
description?: string;
|
|
992
|
+
/** Upstream marks this model as newly released. */
|
|
993
|
+
isNew?: boolean;
|
|
994
|
+
/** Upstream marks this model as beta / preview quality. */
|
|
995
|
+
isBeta?: boolean;
|
|
996
|
+
/** Upstream marks this model as one of its recommended picks. */
|
|
997
|
+
isRecommended?: boolean;
|
|
834
998
|
/** Canonical thinking capability metadata for this model. */
|
|
835
999
|
thinking?: ThinkingConfig;
|
|
836
1000
|
/**
|
|
@@ -873,7 +1037,7 @@ export interface Model<TApi extends Api = Api> {
|
|
|
873
1037
|
* vocabulary of `buildModel`. Identical to `Model` except `compat` carries the
|
|
874
1038
|
* sparse override shape and nothing is resolved yet.
|
|
875
1039
|
*/
|
|
876
|
-
export interface ModelSpec<TApi extends Api = Api> extends Omit<Model<TApi>, "compat" | "compatConfig" | "requiresGlyphTokenization" | "supportsComputerUseConfig"> {
|
|
1040
|
+
export interface ModelSpec<TApi extends Api = Api> extends Omit<Model<TApi>, "compat" | "identity" | "compatConfig" | "requiresGlyphTokenization" | "requiresCursorToolSchemaProjection" | "supportsComputerUseConfig"> {
|
|
877
1041
|
/** Sparse compatibility overrides; resolved into `Model.compat` by `buildModel`. */
|
|
878
1042
|
compat?: CompatConfigOf<TApi>;
|
|
879
1043
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cline API base shared by ClinePass subscription inference, free-tier models,
|
|
3
|
+
* roster discovery, login validation, and usage reporting. One constant so a
|
|
4
|
+
* host migration touches a single module.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CLINEPASS_API_BASE_URL = "https://api.cline.bot/api/v1";
|
|
7
|
+
/**
|
|
8
|
+
* Client-identity headers mirroring the official Cline CLI's request layer
|
|
9
|
+
* (sdk/packages/llms/src/providers/request-headers.ts). Cline's gateway gates
|
|
10
|
+
* some roster entries — certain free-tier models — to Cline product surfaces,
|
|
11
|
+
* and this is the contract that identifies a Cline client. Mirrored with Cline's
|
|
12
|
+
* blessing for a native integration.
|
|
13
|
+
*
|
|
14
|
+
* The gate accepted an arbitrary version string when probed (0.0.1 passed on
|
|
15
|
+
* 2026-08-13), so the pinned versions are mirror fidelity, not a minimum — but
|
|
16
|
+
* the full set is sent deliberately: partial mirrors are one gateway change
|
|
17
|
+
* away from a 403. `X-Task-ID` carries OMP's stable prompt-cache/session key
|
|
18
|
+
* when available; account and discovery calls omit it rather than inventing a
|
|
19
|
+
* per-request identity.
|
|
20
|
+
*/
|
|
21
|
+
export declare function clinePassClientHeaders(taskId?: string): Record<string, string>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protobuf decoding helpers for Devin's unary Connect RPCs. Kept separate from
|
|
3
|
+
* `wire/devin.ts`: that module stays protobuf-free for the synchronous catalog
|
|
4
|
+
* boot path, while this one is shared by discovery, chat, and usage callers
|
|
5
|
+
* that already load the generated schemas.
|
|
6
|
+
*/
|
|
7
|
+
import { type MessageCodec, type ProtoMessage } from "../discovery/protobuf.js";
|
|
8
|
+
/**
|
|
9
|
+
* Decode a unary Devin Connect response. Edges variously return bare protobuf
|
|
10
|
+
* or a gzipped protobuf body; Bun's `fetch` normally decompresses first, so the
|
|
11
|
+
* direct decode is attempted before the gzip fallback. Returns `null` when
|
|
12
|
+
* neither representation decodes against `schema`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function decodeDevinUnaryMessage<TMessage extends ProtoMessage>(schema: MessageCodec<TMessage>, payload: Uint8Array): TMessage | null;
|