@linxiraos/pi-catalog 1.4.7 → 1.4.10
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 +6 -21
- package/dist/types/compat/auth-ids.d.ts +2 -2
- package/dist/types/compat/catalog-policy.d.ts +6 -4
- package/dist/types/compat/factory-droid.d.ts +7 -1
- package/dist/types/compat/provider-ids.d.ts +1 -1
- package/dist/types/compat/resolve.d.ts +1 -1
- package/dist/types/compat/revision.d.ts +2 -0
- package/dist/types/compat/server-side-fallback.d.ts +6 -4
- package/dist/types/compat/types.d.ts +3 -1
- package/dist/types/discovery/cursor-proto.d.ts +8 -0
- package/dist/types/discovery/openai-compatible.d.ts +6 -0
- package/dist/types/model-manager.d.ts +11 -1
- package/dist/types/model-thinking.d.ts +4 -0
- package/dist/types/models.d.ts +16 -0
- package/dist/types/pricing.d.ts +66 -6
- package/dist/types/provider-models/openai-compat.d.ts +18 -13
- package/dist/types/types.d.ts +14 -19
- package/dist/types/utils.d.ts +8 -0
- package/package.json +4 -4
- package/src/compat/auth-ids.ts +5 -0
- package/src/compat/axes.ts +21 -9
- package/src/compat/catalog-policy.d.ts +9 -0
- package/src/compat/catalog-policy.ts +14 -10
- package/src/compat/collapse.ts +1 -1
- package/src/compat/factory-droid.d.ts +7 -1
- package/src/compat/factory-droid.ts +9 -1
- package/src/compat/provider-ids.d.ts +1 -1
- package/src/compat/provider-ids.ts +2 -0
- package/src/compat/resolve.d.ts +1 -1
- package/src/compat/resolve.ts +4 -5
- package/src/compat/revision.d.ts +2 -0
- package/src/compat/revision.ts +10 -0
- package/src/compat/rules/README.md +3 -1
- package/src/compat/rules/auth/_order.kdl +1 -1
- package/src/compat/rules/auth/mistral.kdl +4 -0
- package/src/compat/rules/auth/modular.kdl +9 -0
- package/src/compat/rules/auth/scaleway.kdl +17 -0
- package/src/compat/rules/classes/anthropic.kdl +5 -0
- package/src/compat/rules/classes/deepseek.kdl +1 -1
- package/src/compat/rules/classes/gemini.kdl +1 -1
- package/src/compat/rules/classes/xai.kdl +1 -1
- package/src/compat/rules/providers/anthropic.kdl +8 -4
- package/src/compat/rules/providers/cursor.kdl +10 -0
- package/src/compat/rules/providers/deepseek.kdl +2 -2
- package/src/compat/rules/providers/factory-droid.kdl +219 -13
- package/src/compat/rules/providers/modular.kdl +35 -0
- package/src/compat/rules/providers/openai-codex.kdl +1 -1
- package/src/compat/rules/providers/sambanova.kdl +2 -0
- package/src/compat/rules/providers/scaleway.kdl +179 -0
- package/src/compat/rules/runtime/behavior.kdl +13 -0
- package/src/compat/rules.json +1 -1
- package/src/compat/server-side-fallback.d.ts +9 -0
- package/src/compat/server-side-fallback.ts +7 -5
- package/src/compat/types.d.ts +3 -1
- package/src/compat/types.ts +3 -1
- package/src/discovery/codex.ts +2 -9
- package/src/discovery/cursor-proto.d.ts +8 -0
- package/src/discovery/cursor-proto.ts +12 -1
- package/src/discovery/factory-droid.ts +35 -11
- package/src/discovery/openai-compatible.d.ts +6 -0
- package/src/discovery/openai-compatible.ts +1 -1
- package/src/model-cache.ts +32 -58
- package/src/model-catalog-format.ts +5 -8
- package/src/model-manager.d.ts +11 -1
- package/src/model-manager.ts +85 -143
- package/src/model-thinking.d.ts +4 -0
- package/src/model-thinking.ts +10 -0
- package/src/model-tokenizer.ts +13 -12
- package/src/models.d.ts +16 -0
- package/src/models.json +1 -1
- package/src/models.ts +32 -1
- package/src/pricing.d.ts +66 -6
- package/src/pricing.ts +59 -94
- package/src/provider-models/catalog-snapshot.json.zst +0 -0
- package/src/provider-models/catalog-snapshot.json.zst.d.ts +3 -0
- package/src/provider-models/descriptors.ts +2 -0
- package/src/provider-models/openai-compat.d.ts +18 -13
- package/src/provider-models/openai-compat.ts +120 -71
- package/src/types.d.ts +14 -19
- package/src/types.ts +11 -18
- package/src/utils.d.ts +8 -0
- package/src/utils.ts +18 -0
- package/src/wire/factory-droid.ts +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,31 +1,16 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
-
## [1.4.
|
|
4
|
-
|
|
5
|
-
- Synced with upstream OMP v18.14.0; no package-specific user-visible changes.
|
|
3
|
+
## [1.4.10] - 2026-11-05
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
- Released as part of Zeta 1.4.10; no package-specific user-visible changes.
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- Removed the raw `@oh-my-pi/pi-catalog/models.json` export; use the bundled model registry APIs instead.
|
|
12
|
-
|
|
13
|
-
### Added
|
|
7
|
+
## [1.4.9] - 2026-11-03
|
|
14
8
|
|
|
15
|
-
-
|
|
16
|
-
- Added the `selector-revision-suffix` catalog axis for Google Vertex, so `google-vertex/claude-opus-4-8` resolves exactly to `claude-opus-4-8@default`.
|
|
9
|
+
- Synced with upstream OMP v18.16.0: Scaleway provider, Factory Droid 1.1.0 models, and Mistral Vibe browser login.
|
|
17
10
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- Reduced the bundled model catalog size and loading overhead.
|
|
21
|
-
- Updated role defaults so Factory Droid image models are preferred for the `image` role, allowing `generate_image` to work with only a Factory login.
|
|
22
|
-
- Updated `smol` and `slow` role defaults to use the currently bundled Cerebras and OpenAI Codex model identifiers.
|
|
23
|
-
|
|
24
|
-
### Fixed
|
|
11
|
+
## [1.4.7] - 2026-10-30
|
|
25
12
|
|
|
26
|
-
-
|
|
27
|
-
- Fixed later-turn HTTP 422 errors in Mistral-hosted DeepSeek conversations when assistant reasoning history is included.
|
|
28
|
-
- Fixed DeepSeek V4.1 Flash image attachments being dropped for publisher-namespaced model IDs such as `ds/deepseek-flash`.
|
|
13
|
+
- Synced with upstream OMP v18.14.0; no package-specific user-visible changes.
|
|
29
14
|
|
|
30
15
|
## [1.4.5] - 2026-10-28
|
|
31
16
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Every provider with an `auth/<id>.kdl` policy. */
|
|
2
|
-
export type AuthProviderId = "abliteration" | "aiand" | "aimlapi" | "alibaba-coding-plan" | "alibaba-token-plan" | "amazon-bedrock" | "anthropic" | "apple" | "azure" | "baseten" | "bedrock-mantle" | "cerebras" | "charm-hyper" | "cline-pass" | "cloudflare-ai-gateway" | "cloudflare-workers-ai" | "commandcode" | "coralbricks" | "coreweave" | "cursor" | "deepinfra" | "deepseek" | "devin" | "exa" | "factory-droid" | "firepass" | "fireworks" | "github-copilot" | "gitlab-duo" | "gitlab-duo-agent" | "gmi-cloud" | "google" | "google-antigravity" | "google-gemini-cli" | "google-vertex" | "groq" | "helmcode" | "huggingface" | "inception" | "kagi" | "kilo" | "kimi-code" | "litellm" | "llama.cpp" | "lm-studio" | "local" | "meta" | "minimax" | "minimax-code" | "minimax-code-cn" | "mistral" | "moonshot" | "muse-code" | "nanogpt" | "novita" | "nvidia" | "ollama" | "ollama-cloud" | "openai" | "openai-codex" | "openai-codex-device" | "opencode-go" | "opencode-zen" | "openrouter" | "parallel" | "perplexity" | "qianfan" | "qwen-portal" | "sakana" | "sambanova" | "siliconflow" | "siliconflow-cn" | "singularityapi-dev" | "singularityapi-tech" | "snowflake" | "stencil" | "stepfun" | "synthetic" | "tavily" | "together" | "typesafe" | "umans" | "venice" | "vercel-ai-gateway" | "vllm" | "wafer-serverless" | "web" | "xai" | "xai-oauth" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "yolo-auto" | "zai" | "zai-coding-plan" | "zenmux" | "zhipu-coding-plan";
|
|
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" | "inception" | "kagi" | "kilo" | "kimi-code" | "litellm" | "llama.cpp" | "lm-studio" | "local" | "meta" | "minimax" | "minimax-code" | "minimax-code-cn" | "mistral" | "modular" | "moonshot" | "muse-code" | "nanogpt" | "novita" | "nvidia" | "ollama" | "ollama-cloud" | "openai" | "openai-codex" | "openai-codex-device" | "opencode-go" | "opencode-zen" | "openrouter" | "parallel" | "perplexity" | "qianfan" | "qwen-portal" | "sakana" | "sambanova" | "scaleway" | "siliconflow" | "siliconflow-cn" | "singularityapi-dev" | "singularityapi-tech" | "snowflake" | "stencil" | "stepfun" | "synthetic" | "tavily" | "together" | "typesafe" | "umans" | "venice" | "vercel-ai-gateway" | "vllm" | "wafer-serverless" | "web" | "xai" | "xai-oauth" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "yolo-auto" | "zai" | "zai-coding-plan" | "zenmux" | "zhipu-coding-plan";
|
|
3
3
|
/** Providers whose policy declares a `login` flow (the `/login` roster). */
|
|
4
|
-
export type LoginProviderId = "abliteration" | "aiand" | "alibaba-coding-plan" | "alibaba-token-plan" | "anthropic" | "baseten" | "cerebras" | "charm-hyper" | "cline-pass" | "cloudflare-ai-gateway" | "cloudflare-workers-ai" | "commandcode" | "coralbricks" | "coreweave" | "cursor" | "deepinfra" | "deepseek" | "devin" | "exa" | "factory-droid" | "firepass" | "fireworks" | "github-copilot" | "gitlab-duo" | "gitlab-duo-agent" | "gmi-cloud" | "google-antigravity" | "google-gemini-cli" | "helmcode" | "huggingface" | "inception" | "kagi" | "kilo" | "kimi-code" | "litellm" | "llama.cpp" | "lm-studio" | "meta" | "minimax-code" | "minimax-code-cn" | "moonshot" | "muse-code" | "nanogpt" | "novita" | "nvidia" | "ollama" | "ollama-cloud" | "openai-codex" | "openai-codex-device" | "opencode-go" | "opencode-zen" | "openrouter" | "parallel" | "perplexity" | "qianfan" | "qwen-portal" | "sakana" | "sambanova" | "siliconflow" | "siliconflow-cn" | "singularityapi-dev" | "singularityapi-tech" | "snowflake" | "stencil" | "stepfun" | "synthetic" | "tavily" | "together" | "typesafe" | "umans" | "venice" | "vercel-ai-gateway" | "vllm" | "wafer-serverless" | "xai" | "xai-oauth" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "yolo-auto" | "zai" | "zai-coding-plan" | "zenmux" | "zhipu-coding-plan";
|
|
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" | "inception" | "kagi" | "kilo" | "kimi-code" | "litellm" | "llama.cpp" | "lm-studio" | "meta" | "minimax-code" | "minimax-code-cn" | "mistral" | "modular" | "moonshot" | "muse-code" | "nanogpt" | "novita" | "nvidia" | "ollama" | "ollama-cloud" | "openai-codex" | "openai-codex-device" | "opencode-go" | "opencode-zen" | "openrouter" | "parallel" | "perplexity" | "qianfan" | "qwen-portal" | "sakana" | "sambanova" | "scaleway" | "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";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { CatalogPolicyInputs } from "../types.js";
|
|
2
|
+
import { type ResolveRoute } from "./resolve.js";
|
|
2
3
|
/**
|
|
3
|
-
* The `catalog` axis bag authored in the KDL cascade rules for a model
|
|
4
|
-
* memoized per distinct model. Frozen: the bag
|
|
5
|
-
* must stay read-only — extract the value you
|
|
4
|
+
* The `catalog` axis bag authored in the KDL cascade rules for a model (on one
|
|
5
|
+
* upstream when `route` names it), memoized per distinct model. Frozen: the bag
|
|
6
|
+
* is shared across callers, so it must stay read-only — extract the value you
|
|
7
|
+
* need rather than handing it on.
|
|
6
8
|
*/
|
|
7
|
-
export declare function resolveCatalogPolicy(model: CatalogPolicyInputs): Readonly<Record<string, unknown>>;
|
|
9
|
+
export declare function resolveCatalogPolicy(model: CatalogPolicyInputs, route?: ResolveRoute): Readonly<Record<string, unknown>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DatedCostCard } from "../pricing.js";
|
|
1
2
|
import type { Api, ModelSpec } from "../types.js";
|
|
2
3
|
import { type FactoryDroidRegion, type FactoryDroidWire } from "../wire/factory-droid.js";
|
|
3
4
|
/** Native token limits for one inference region. */
|
|
@@ -5,11 +6,16 @@ export interface FactoryDroidLimits {
|
|
|
5
6
|
contextWindow: number | null;
|
|
6
7
|
maxTokens: number | null;
|
|
7
8
|
}
|
|
8
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Standard Credits rates: `input` is the per-token weight; `output` and
|
|
11
|
+
* `cacheRead` multiply it. `effectiveRates` are dated cards (ascending) that
|
|
12
|
+
* overwrite those legs from their date, as on `cost-patch`.
|
|
13
|
+
*/
|
|
9
14
|
export interface FactoryDroidCreditRates {
|
|
10
15
|
input: number;
|
|
11
16
|
output?: number;
|
|
12
17
|
cacheRead?: number;
|
|
18
|
+
effectiveRates?: readonly DatedCostCard[];
|
|
13
19
|
}
|
|
14
20
|
/** Account gates on one registry model (the `entitlement` axis). */
|
|
15
21
|
export interface FactoryDroidEntitlement {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Every chat-model provider with a catalog entry (`default-model` in its provider rules). */
|
|
2
|
-
export type KnownProvider = "abliteration" | "aiand" | "aimlapi" | "alibaba-coding-plan" | "alibaba-token-plan" | "amazon-bedrock" | "anthropic" | "apple" | "azure" | "baseten" | "bedrock-mantle" | "cerebras" | "charm-hyper" | "cline-pass" | "cloudflare-ai-gateway" | "cloudflare-workers-ai" | "commandcode" | "coralbricks" | "coreweave" | "cursor" | "deepinfra" | "deepseek" | "devin" | "factory-droid" | "firepass" | "fireworks" | "github-copilot" | "gitlab-duo" | "gitlab-duo-agent" | "gmi-cloud" | "google" | "google-antigravity" | "google-gemini-cli" | "google-vertex" | "groq" | "helmcode" | "huggingface" | "inception" | "kilo" | "kimi-code" | "litellm" | "lm-studio" | "local" | "meta" | "minimax" | "minimax-code" | "minimax-code-cn" | "mistral" | "moonshot" | "muse-code" | "nanogpt" | "novita" | "nvidia" | "ollama" | "ollama-cloud" | "openai" | "openai-codex" | "opencode-go" | "opencode-zen" | "openrouter" | "qianfan" | "qwen-portal" | "sakana" | "sambanova" | "siliconflow" | "siliconflow-cn" | "singularityapi-dev" | "singularityapi-tech" | "snowflake" | "stepfun" | "synthetic" | "together" | "typesafe" | "umans" | "venice" | "vercel-ai-gateway" | "vllm" | "wafer-serverless" | "web" | "xai" | "xai-oauth" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "yolo-auto" | "zai" | "zenmux" | "zhipu-coding-plan";
|
|
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" | "inception" | "kilo" | "kimi-code" | "litellm" | "lm-studio" | "local" | "meta" | "minimax" | "minimax-code" | "minimax-code-cn" | "mistral" | "modular" | "moonshot" | "muse-code" | "nanogpt" | "novita" | "nvidia" | "ollama" | "ollama-cloud" | "openai" | "openai-codex" | "opencode-go" | "opencode-zen" | "openrouter" | "qianfan" | "qwen-portal" | "sakana" | "sambanova" | "scaleway" | "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";
|
|
@@ -21,7 +21,7 @@ export declare function resolveDiscoveryApi(spec: ModelSpec<Api>, providerType:
|
|
|
21
21
|
* {@link resolveModelPolicy} without resolving the compat and thinking
|
|
22
22
|
* policies, which dominate its cost on catalog-wide scans.
|
|
23
23
|
*/
|
|
24
|
-
export declare function resolveCatalogAxes(spec: CatalogPolicyInputs): Record<string, unknown>;
|
|
24
|
+
export declare function resolveCatalogAxes(spec: CatalogPolicyInputs, route?: ResolveRoute): Record<string, unknown>;
|
|
25
25
|
/**
|
|
26
26
|
* Resolves the full policy surface for one model spec: structured identity,
|
|
27
27
|
* complete compat record, thinking metadata, and catalog-data corrections.
|
|
@@ -22,6 +22,8 @@ export declare function parseRevision(value: string): Revision | undefined;
|
|
|
22
22
|
export declare function parseRevisionPrefix(value: string): Revision | undefined;
|
|
23
23
|
/** Lexicographic triple comparison: negative, zero, or positive. */
|
|
24
24
|
export declare function compareRevision(a: Revision, b: Revision): number;
|
|
25
|
+
/** Whether a revision string parses and is at or above `floor`; `undefined` or unparsable is never. */
|
|
26
|
+
export declare function revisionAtLeast(revision: string | undefined, floor: string): boolean;
|
|
25
27
|
/** Renders a revision as its canonical `major.minor.patch` string. */
|
|
26
28
|
export declare function formatRevision(revision: Revision): string;
|
|
27
29
|
/** Comparison operator inside a `revision ">=2.5 <4"` cascade constraint. */
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CatalogPolicyInputs } from "../types.js";
|
|
2
|
+
import type { ResolveRoute } from "./resolve.js";
|
|
2
3
|
/**
|
|
3
4
|
* Ordered model ids for Anthropic's server-side refusal `fallbacks` chain,
|
|
4
|
-
* authored on the `server-side-fallback-models` catalog axis
|
|
5
|
-
*
|
|
5
|
+
* authored on the `server-side-fallback-models` catalog axis, on `route`'s
|
|
6
|
+
* upstream when it names one. Empty when no rule assigns a chain (the model,
|
|
7
|
+
* host or upstream does not support the feature).
|
|
6
8
|
*/
|
|
7
|
-
export declare function serverSideFallbackModels(model:
|
|
9
|
+
export declare function serverSideFallbackModels(model: CatalogPolicyInputs, route?: ResolveRoute): readonly string[];
|
|
@@ -714,6 +714,8 @@ export interface ResolvedAxes {
|
|
|
714
714
|
export interface RequestPolicy {
|
|
715
715
|
completionsReasoningMode?: "none" | "effort" | "opt-in" | "forced-on";
|
|
716
716
|
completionsReasoningHistory?: "omit" | "preserved" | "interleaved";
|
|
717
|
+
/** Send `allow_missing_thinking` with the effort so tool-call turns may arrive without reasoning. */
|
|
718
|
+
completionsAllowMissingThinking?: boolean;
|
|
717
719
|
anthropicThinking?: "adaptive" | "adaptive-summarized" | "budget-interleaved" | "budget-effort";
|
|
718
720
|
/** Advertise `fine-grained-tool-streaming-2025-05-14` on requests that carry tools. */
|
|
719
721
|
anthropicToolStreamingBeta?: boolean;
|
|
@@ -721,7 +723,7 @@ export interface RequestPolicy {
|
|
|
721
723
|
openaiPlatformHeader?: string;
|
|
722
724
|
responsesCacheRetention?: boolean;
|
|
723
725
|
responsesVerbosity?: "low";
|
|
724
|
-
responsesServiceTier?: "priority";
|
|
726
|
+
responsesServiceTier?: "priority" | "ultrafast";
|
|
725
727
|
responsesParallelToolCalls?: boolean;
|
|
726
728
|
responsesSafetyIdentifier?: boolean;
|
|
727
729
|
/** Default `tool_choice` to `auto` when the request carries tools and the caller picks none. */
|
|
@@ -2514,6 +2514,9 @@ export interface InteractionUpdate extends ProtoMessage {
|
|
|
2514
2514
|
} | {
|
|
2515
2515
|
case: "stepCompleted";
|
|
2516
2516
|
value: StepCompletedUpdate;
|
|
2517
|
+
} | {
|
|
2518
|
+
case: "toolRequestsListed";
|
|
2519
|
+
value: ToolRequestsListedUpdate;
|
|
2517
2520
|
};
|
|
2518
2521
|
}
|
|
2519
2522
|
export declare const InteractionUpdateSchema: MessageCodec<InteractionUpdate>;
|
|
@@ -5318,6 +5321,11 @@ export interface ToolCallStartedUpdate extends ProtoMessage {
|
|
|
5318
5321
|
modelCallId: string;
|
|
5319
5322
|
}
|
|
5320
5323
|
export declare const ToolCallStartedUpdateSchema: MessageCodec<ToolCallStartedUpdate>;
|
|
5324
|
+
/** Cursor agent message agent.v1.ToolRequestsListedUpdate. */
|
|
5325
|
+
export interface ToolRequestsListedUpdate extends ProtoMessage {
|
|
5326
|
+
callCount: number;
|
|
5327
|
+
}
|
|
5328
|
+
export declare const ToolRequestsListedUpdateSchema: MessageCodec<ToolRequestsListedUpdate>;
|
|
5321
5329
|
/** Cursor agent message agent.v1.TruncatedToolCall. */
|
|
5322
5330
|
export interface TruncatedToolCall extends ProtoMessage {
|
|
5323
5331
|
originalStepBlobId: Uint8Array;
|
|
@@ -10,6 +10,12 @@ import type { Api, FetchImpl, ModelSpec, Provider } from "../types.js";
|
|
|
10
10
|
* (issue #8315). 10s matches the coding-agent's remote-discovery budget.
|
|
11
11
|
*/
|
|
12
12
|
export declare const DEFAULT_OPENAI_COMPATIBLE_DISCOVERY_TIMEOUT_MS = 10000;
|
|
13
|
+
/**
|
|
14
|
+
* Uses a cancellable timer rather than the native abort-timeout helper so
|
|
15
|
+
* successful fast discovery requests do not leave armed timeout signals for
|
|
16
|
+
* concurrent GC to trip over later.
|
|
17
|
+
*/
|
|
18
|
+
export declare function withOpenAICompatibleDiscoveryTimeout<T>(timeoutMs: number, run: (signal: AbortSignal) => Promise<T>): Promise<T>;
|
|
13
19
|
/**
|
|
14
20
|
* Minimal OpenAI-style model entry shape consumed by discovery.
|
|
15
21
|
*
|
|
@@ -129,9 +129,19 @@ export declare function createModelManager<TApi extends Api = Api, TModelsDevPay
|
|
|
129
129
|
* when at least one configured remote source did not refresh successfully.
|
|
130
130
|
*/
|
|
131
131
|
export declare function resolveProviderModels<TApi extends Api = Api, TModelsDevPayload = unknown>(options: ModelManagerOptions<TApi, TModelsDevPayload>, strategy?: ModelRefreshStrategy): Promise<ModelResolutionResult<TApi>>;
|
|
132
|
+
/**
|
|
133
|
+
* Merge policy that is part of a cache's identity in
|
|
134
|
+
* {@link fingerprintStaticModels}: `authoritative` when dynamic discovery owns
|
|
135
|
+
* the catalog, `additive` when the shared catalog may only add ids. The flags
|
|
136
|
+
* compose; snapshots written under different policies never match.
|
|
137
|
+
*/
|
|
138
|
+
export interface StaticFingerprintPolicy {
|
|
139
|
+
authoritative?: boolean;
|
|
140
|
+
additive?: boolean;
|
|
141
|
+
}
|
|
132
142
|
/**
|
|
133
143
|
* Return the versioned content identity for a static provider slice. Callers
|
|
134
144
|
* may mutate or freeze their arrays, so every call observes current content
|
|
135
145
|
* and never attaches a stale sidecar fingerprint to caller-owned data.
|
|
136
146
|
*/
|
|
137
|
-
export declare function fingerprintStaticModels<TApi extends Api>(models: readonly (ModelSpec<TApi> | Model<TApi>)[],
|
|
147
|
+
export declare function fingerprintStaticModels<TApi extends Api>(models: readonly (ModelSpec<TApi> | Model<TApi>)[], policy?: StaticFingerprintPolicy): string;
|
|
@@ -32,6 +32,10 @@ export declare function withoutUnverifiedThinking<T extends {
|
|
|
32
32
|
/**
|
|
33
33
|
* Clamps a requested thinking level against explicit model metadata.
|
|
34
34
|
*
|
|
35
|
+
* An unserved level first follows `thinking.effortMap` when the map sends it to
|
|
36
|
+
* a served tier that reaches the wire unchanged (a gateway answering `medium`
|
|
37
|
+
* as `high`); otherwise it climbs down to the nearest lower tier.
|
|
38
|
+
*
|
|
35
39
|
* Non-reasoning models always resolve to `undefined`.
|
|
36
40
|
*/
|
|
37
41
|
export declare function clampThinkingLevelForModel<TApi extends Api>(model: ApiModel<TApi> | undefined, requested: Effort | undefined): Effort | undefined;
|
package/dist/types/models.d.ts
CHANGED
|
@@ -11,6 +11,22 @@ export declare function getBundledProviders(): readonly KnownProvider[];
|
|
|
11
11
|
export declare function getBundledModels(provider: GeneratedProvider): Model<Api>[];
|
|
12
12
|
/** Resolve display semantics without mistaking an absent rate card for a free model. */
|
|
13
13
|
export declare function getModelPricingStatus(model: Pick<Model<Api>, "cost" | "pricingStatus">): ModelPricingStatus;
|
|
14
|
+
/** Factory Droid credit rate in force at a time, and the next dated change to it. */
|
|
15
|
+
export interface FactoryDroidCreditRate {
|
|
16
|
+
rate: number;
|
|
17
|
+
/** The earliest later `credit-rates` card that changes `rate`: the rate it sets and when (Unix ms). */
|
|
18
|
+
next?: {
|
|
19
|
+
rate: number;
|
|
20
|
+
at: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Factory Droid Standard Credits rate at `timestamp` (Unix ms, default now):
|
|
25
|
+
* the `input` of the `credit-rates` card due then (the latest at or before
|
|
26
|
+
* it, as for cost cards), else the base rate. Undefined for models without a
|
|
27
|
+
* credit rate.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getFactoryDroidCreditRate(model: Pick<Model, "factoryDroidCredits" | "factoryDroidCreditCards">, timestamp?: number): FactoryDroidCreditRate | undefined;
|
|
14
30
|
/**
|
|
15
31
|
* The base token card in force at `timestamp` (Unix ms, default now): the
|
|
16
32
|
* latest due `timeBased` effective rate, else the row's own legs. Price
|
package/dist/types/pricing.d.ts
CHANGED
|
@@ -1,24 +1,84 @@
|
|
|
1
1
|
import type { EffectiveTokenCost, ModelCost, TimeBasedCost, TokenCost } from "./types.js";
|
|
2
|
+
/** Serialized time-based pricing schedule, as cached model rows carry it. */
|
|
3
|
+
export declare const TimeBasedCostShape: import("@linxiraos/pi-omptype").FluentType<{
|
|
4
|
+
effectiveRates?: ({
|
|
5
|
+
cacheRead: number;
|
|
6
|
+
cacheWrite: number;
|
|
7
|
+
input: number;
|
|
8
|
+
output: number;
|
|
9
|
+
} & {
|
|
10
|
+
effectiveFrom: number;
|
|
11
|
+
longContext?: ({
|
|
12
|
+
cacheRead: number;
|
|
13
|
+
cacheWrite: number;
|
|
14
|
+
input: number;
|
|
15
|
+
output: number;
|
|
16
|
+
} & {
|
|
17
|
+
inputThreshold: number;
|
|
18
|
+
inputThresholdInclusive?: boolean | undefined;
|
|
19
|
+
}) | undefined;
|
|
20
|
+
})[] | undefined;
|
|
21
|
+
offPeakMultiplier: number;
|
|
22
|
+
peakWindows: {
|
|
23
|
+
endMinute: number;
|
|
24
|
+
startMinute: number;
|
|
25
|
+
weekdays: number[];
|
|
26
|
+
}[];
|
|
27
|
+
}, {
|
|
28
|
+
effectiveRates?: ({
|
|
29
|
+
cacheRead: number;
|
|
30
|
+
cacheWrite: number;
|
|
31
|
+
input: number;
|
|
32
|
+
output: number;
|
|
33
|
+
} & {
|
|
34
|
+
effectiveFrom: number;
|
|
35
|
+
longContext?: ({
|
|
36
|
+
cacheRead: number;
|
|
37
|
+
cacheWrite: number;
|
|
38
|
+
input: number;
|
|
39
|
+
output: number;
|
|
40
|
+
} & {
|
|
41
|
+
inputThreshold: number;
|
|
42
|
+
inputThresholdInclusive?: boolean | undefined;
|
|
43
|
+
}) | undefined;
|
|
44
|
+
})[] | undefined;
|
|
45
|
+
offPeakMultiplier: number;
|
|
46
|
+
peakWindows: {
|
|
47
|
+
endMinute: number;
|
|
48
|
+
startMinute: number;
|
|
49
|
+
weekdays: number[];
|
|
50
|
+
}[];
|
|
51
|
+
}>;
|
|
2
52
|
/** Validate serialized schedules before admitting cached model rows. */
|
|
3
53
|
export declare function isTimeBasedCost(value: unknown): value is TimeBasedCost;
|
|
4
54
|
/** KDL object children are named records; normalize them once while constructing the model. */
|
|
5
55
|
export declare function materializeTimeBasedCost(value: unknown): TimeBasedCost;
|
|
56
|
+
/**
|
|
57
|
+
* The dated card due at `timestamp`: the one with the latest `effectiveFrom`
|
|
58
|
+
* at or before it, in any order, or undefined before the first card.
|
|
59
|
+
*/
|
|
60
|
+
export declare function dueDatedCard<T extends {
|
|
61
|
+
effectiveFrom: number;
|
|
62
|
+
}>(cards: readonly T[], timestamp: number): T | undefined;
|
|
6
63
|
/**
|
|
7
64
|
* The latest `effectiveRates` card of a materialized schedule due at
|
|
8
65
|
* `timestamp`, or undefined before the first one (or without a schedule).
|
|
9
66
|
*/
|
|
10
67
|
export declare function dueEffectiveRate(schedule: TimeBasedCost | undefined, timestamp: number): EffectiveTokenCost | undefined;
|
|
11
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* A dated `effective-rates` card of a `cost-patch`, `cost-fallback` or
|
|
70
|
+
* `credit-rates` rule: the legs it overwrites from `effectiveFrom` (Unix ms).
|
|
71
|
+
*/
|
|
12
72
|
export interface DatedCostCard extends Partial<TokenCost> {
|
|
13
73
|
effectiveFrom: number;
|
|
14
74
|
}
|
|
15
75
|
/**
|
|
16
|
-
* Parse the compiled `effective-rates` block of a `cost-patch
|
|
17
|
-
* `cost-fallback` payload into dated cards,
|
|
18
|
-
* malformed card, so a typo in a rule fails the
|
|
19
|
-
* leaving the old price in force.
|
|
76
|
+
* Parse the compiled `effective-rates` block of a `cost-patch`,
|
|
77
|
+
* `cost-fallback` or Factory Droid `credit-rates` payload into dated cards,
|
|
78
|
+
* ascending by date. Throws on a malformed card, so a typo in a rule fails the
|
|
79
|
+
* build instead of silently leaving the old price in force.
|
|
20
80
|
*/
|
|
21
|
-
export declare function parseDatedCostCards(costAxis: unknown, axis: "cost-patch" | "cost-fallback"): DatedCostCard[];
|
|
81
|
+
export declare function parseDatedCostCards(costAxis: unknown, axis: "cost-patch" | "cost-fallback" | "credit-rates"): DatedCostCard[];
|
|
22
82
|
/**
|
|
23
83
|
* Earliest instant a rate card can name (the `Date` range minimum). A leading
|
|
24
84
|
* card from here holds the price in force before the first dated change.
|
|
@@ -36,19 +36,6 @@ export interface ModelsDevModel {
|
|
|
36
36
|
int?: number;
|
|
37
37
|
tps?: number;
|
|
38
38
|
}
|
|
39
|
-
/**
|
|
40
|
-
* Fetches the models.dev catalog via catalog.stencil.so, which serves a
|
|
41
|
-
* field-pruned copy precompressed as a zstd blob (~93 KB vs ~3.3 MB raw).
|
|
42
|
-
* The frame magic is sniffed rather than trusting content-type so plain-JSON
|
|
43
|
-
* responses (test stubs, fallback mirrors) parse identically.
|
|
44
|
-
*
|
|
45
|
-
* Fetched fully once per fetch context: concurrent callers sharing a fetch
|
|
46
|
-
* implementation reuse one transport request, while repeat callers send a
|
|
47
|
-
* conditional GET that the server answers with `304`. Each subscriber may stop
|
|
48
|
-
* waiting independently; the shared transport retains its own hard deadline.
|
|
49
|
-
* Transient failures reuse the last in-memory payload for callers that only
|
|
50
|
-
* need best-effort metadata.
|
|
51
|
-
*/
|
|
52
39
|
export declare function fetchWellKnownModels(fetchImpl?: FetchImpl, signal?: AbortSignal): Promise<unknown>;
|
|
53
40
|
type SimpleProviderDiscoveryHeaders = Record<string, string> | (() => Record<string, string> | undefined);
|
|
54
41
|
type SimpleProviderConfig = {
|
|
@@ -740,3 +727,21 @@ export declare function singularityApiDevModelManagerOptions(config?: Singularit
|
|
|
740
727
|
* reviewed KDL rules own the wire shape, limits patch, and effort ladder.
|
|
741
728
|
*/
|
|
742
729
|
export declare function singularityApiTechModelManagerOptions(config?: SingularityApiModelManagerConfig): ModelManagerOptions<Api>;
|
|
730
|
+
/**
|
|
731
|
+
* Scaleway discovery configuration: the API key plus optional base-URL and
|
|
732
|
+
* fetch overrides. Consumed by {@link scalewayModelManagerOptions}, and
|
|
733
|
+
* exported for extensions and tests that construct the manager directly.
|
|
734
|
+
*/
|
|
735
|
+
export interface ScalewayModelManagerConfig {
|
|
736
|
+
apiKey?: string;
|
|
737
|
+
baseUrl?: string;
|
|
738
|
+
fetch?: FetchImpl;
|
|
739
|
+
}
|
|
740
|
+
/**
|
|
741
|
+
* Scaleway model manager: plain OpenAI-compatible chat completions at
|
|
742
|
+
* `api.scaleway.ai/v1` (fr-par serverless Generative APIs). `/v1/models`
|
|
743
|
+
* returns bare ids, so the authored seed in `providers/scaleway.kdl` is the
|
|
744
|
+
* reference each live row merges names, modalities, prices, and limits from;
|
|
745
|
+
* a successful fetch is the complete roster and prunes retired rows.
|
|
746
|
+
*/
|
|
747
|
+
export declare function scalewayModelManagerOptions(config?: ScalewayModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ModelIdentity } from "./compat/types.js";
|
|
2
2
|
import type { Effort } from "./effort.js";
|
|
3
|
+
import type { DatedCostCard } from "./pricing.js";
|
|
3
4
|
export type { FetchImpl } from "@linxiraos/pi-utils";
|
|
4
5
|
export type { KnownProvider } from "./provider-models/descriptors.js";
|
|
5
6
|
export type KnownApi = "openai-completions" | "openai-responses" | "openrouter" | "openai-codex-responses" | "azure-openai-responses" | "anthropic-messages" | "bedrock-converse-stream" | "google-generative-ai" | "google-gemini-cli" | "google-vertex" | "ollama-chat" | "cursor-agent" | "factory-droid-agent" | "gitlab-duo-agent" | "devin-agent" | "apple-foundation-models";
|
|
@@ -477,8 +478,6 @@ export interface OpenAICompat {
|
|
|
477
478
|
clampOutputToModelMax?: boolean;
|
|
478
479
|
/** Strip image inputs before encoding (text-only serving of a multimodal id). */
|
|
479
480
|
stripImageInput?: boolean;
|
|
480
|
-
/** Thinking-loop watchdog guard family applied to streamed reasoning. */
|
|
481
|
-
thinkingLoopGuard?: "gemini" | "deepseek" | "xai";
|
|
482
481
|
}
|
|
483
482
|
/**
|
|
484
483
|
* Compatibility settings for anthropic-messages API.
|
|
@@ -676,8 +675,6 @@ export interface AnthropicCompat {
|
|
|
676
675
|
* contract override it. Default: 10485760.
|
|
677
676
|
*/
|
|
678
677
|
maxImagePayloadBytes?: number;
|
|
679
|
-
/** Thinking-loop watchdog guard family applied to streamed reasoning. */
|
|
680
|
-
thinkingLoopGuard?: "gemini" | "deepseek" | "xai";
|
|
681
678
|
/**
|
|
682
679
|
* Drop the enabled `thinking` config and replayed thinking blocks when the
|
|
683
680
|
* conversation is not thinking-led (a proxy contract for non-interleaved
|
|
@@ -887,8 +884,6 @@ export interface ResolvedOpenAISharedCompat {
|
|
|
887
884
|
toolSchemaFlavor?: OpenAICompat["toolSchemaFlavor"];
|
|
888
885
|
/** Strip image inputs before encoding (text-only serving of a multimodal id). */
|
|
889
886
|
stripImageInput: boolean;
|
|
890
|
-
/** Thinking-loop watchdog guard family applied to streamed reasoning. */
|
|
891
|
-
thinkingLoopGuard?: OpenAICompat["thinkingLoopGuard"];
|
|
892
887
|
/** Flatten/reject leftover root `anyOf`/`oneOf` unions in strict tool schemas (xAI's function-calling validator 400s on them). */
|
|
893
888
|
rejectRootObjectUnion: boolean;
|
|
894
889
|
/** Retry without strict tools when the host rejects a strict grammar as too large (OpenRouter-Anthropic compiled-grammar overflow). */
|
|
@@ -900,7 +895,7 @@ export interface ResolvedOpenAISharedCompat {
|
|
|
900
895
|
* `buildModel`; request handlers read fields and never detect, resolve, or
|
|
901
896
|
* allocate.
|
|
902
897
|
*/
|
|
903
|
-
export type ResolvedOpenAICompat = ResolvedOpenAISharedCompat & Required<Omit<OpenAICompat, "supportsDeveloperRole" | "supportsReasoningEffort" | "trustExplicitThinkingOnly" | "reasoningEffortMap" | "supportsReasoningParams" | "supportsReasoningSummary" | "statefulResponses" | "supportsSamplingParams" | "supportsPenaltyAndStopParams" | "thinkingFormat" | "kimiApiFormat" | "reasoningDisableMode" | "omitReasoningEffort" | "includeEncryptedReasoning" | "filterReasoningHistory" | "disableReasoningOnForcedToolChoice" | "disableReasoningOnToolChoice" | "disableReasoningWithTools" | "supportsToolChoice" | "supportsForcedToolChoice" | "supportsNamedToolChoice" | "reasoningContentField" | "mistralReasoningContentParts" | "requiresReasoningContentForToolCalls" | "requiresReasoningContentForAllAssistantTurns" | "allowsSyntheticReasoningContentForToolCalls" | "syntheticReasoningContentFallback" | "replayReasoningContent" | "qwenPreserveThinking" | "qwenTemplateReasoningEffort" | "requiresThinkingAsText" | "requiresMistralToolIds" | "requiresToolResultName" | "requiresAssistantAfterToolResult" | "requiresAssistantContentForToolCalls" | "stripDeepseekSpecialTokens" | "stripThinkingHistory" | "streamMarkupHealingPattern" | "reasoningDeltasMayBeCumulative" | "emptyLengthFinishIsContextError" | "usesOpenAIToolCallIdLimit" | "promptCacheSessionHeader" | "sessionHeader" | "supportsPromptCacheBreakpoints" | "promptCacheBreakpointTtl" | "openRouterRouting" | "isOpenRouterHost" | "supportsStrictMode" | "supportsLongPromptCacheRetention" | "alwaysSendMaxTokens" | "clampOutputToModelMax" | "wireModelIdMode" | "vercelGatewayRouting" | "extraBody" | "toolStrictMode" | "toolSchemaFlavor" | "streamFirstEventTimeoutMs" | "streamIdleTimeoutMs" | "streamRevision" | "cacheControlFormat" | "thinkingKeep" | "strictResponsesPairing" | "supportsImageDetailOriginal" | "supportsConfigurationUpdate" | "supportsSteering" | "stripImageInput" | "
|
|
898
|
+
export type ResolvedOpenAICompat = ResolvedOpenAISharedCompat & Required<Omit<OpenAICompat, "supportsDeveloperRole" | "supportsReasoningEffort" | "trustExplicitThinkingOnly" | "reasoningEffortMap" | "supportsReasoningParams" | "supportsReasoningSummary" | "statefulResponses" | "supportsSamplingParams" | "supportsPenaltyAndStopParams" | "thinkingFormat" | "kimiApiFormat" | "reasoningDisableMode" | "omitReasoningEffort" | "includeEncryptedReasoning" | "filterReasoningHistory" | "disableReasoningOnForcedToolChoice" | "disableReasoningOnToolChoice" | "disableReasoningWithTools" | "supportsToolChoice" | "supportsForcedToolChoice" | "supportsNamedToolChoice" | "reasoningContentField" | "mistralReasoningContentParts" | "requiresReasoningContentForToolCalls" | "requiresReasoningContentForAllAssistantTurns" | "allowsSyntheticReasoningContentForToolCalls" | "syntheticReasoningContentFallback" | "replayReasoningContent" | "qwenPreserveThinking" | "qwenTemplateReasoningEffort" | "requiresThinkingAsText" | "requiresMistralToolIds" | "requiresToolResultName" | "requiresAssistantAfterToolResult" | "requiresAssistantContentForToolCalls" | "stripDeepseekSpecialTokens" | "stripThinkingHistory" | "streamMarkupHealingPattern" | "reasoningDeltasMayBeCumulative" | "emptyLengthFinishIsContextError" | "usesOpenAIToolCallIdLimit" | "promptCacheSessionHeader" | "sessionHeader" | "supportsPromptCacheBreakpoints" | "promptCacheBreakpointTtl" | "openRouterRouting" | "isOpenRouterHost" | "supportsStrictMode" | "supportsLongPromptCacheRetention" | "alwaysSendMaxTokens" | "clampOutputToModelMax" | "wireModelIdMode" | "vercelGatewayRouting" | "extraBody" | "toolStrictMode" | "toolSchemaFlavor" | "streamFirstEventTimeoutMs" | "streamIdleTimeoutMs" | "streamRevision" | "cacheControlFormat" | "thinkingKeep" | "strictResponsesPairing" | "supportsImageDetailOriginal" | "supportsConfigurationUpdate" | "supportsSteering" | "stripImageInput" | "whenThinking">> & {
|
|
904
899
|
vercelGatewayRouting?: OpenAICompat["vercelGatewayRouting"];
|
|
905
900
|
extraBody?: OpenAICompat["extraBody"];
|
|
906
901
|
cacheControlFormat?: OpenAICompat["cacheControlFormat"];
|
|
@@ -992,7 +987,7 @@ export interface ResolvedOpenAIResponsesCompat extends ResolvedOpenAISharedCompa
|
|
|
992
987
|
*/
|
|
993
988
|
export type ResolvedOpenRouterCompat = ResolvedOpenAICompat & ResolvedOpenAIResponsesCompat;
|
|
994
989
|
/** Fully-resolved anthropic-messages compat view (same contract as `ResolvedOpenAICompat`). */
|
|
995
|
-
export type ResolvedAnthropicCompat = Required<Omit<AnthropicCompat, "streamIdleTimeoutMs" | "
|
|
990
|
+
export type ResolvedAnthropicCompat = Required<Omit<AnthropicCompat, "streamIdleTimeoutMs" | "bedrockMessagesApi" | "effortBeta" | "extendedCacheTtlBeta" | "disabledThinking" | "betweenToolsEffort" | "stripThinkingHistory" | "fastMode" | "maxImageDimension" | "maxImagePayloadBytes">> & {
|
|
996
991
|
/** Effort-beta override; undefined keeps the transport's legacy heuristic. */
|
|
997
992
|
effortBeta?: AnthropicCompat["effortBeta"];
|
|
998
993
|
/** Extended-cache-ttl beta opt-out; undefined sends it where a 1h breakpoint needs it. */
|
|
@@ -1016,8 +1011,6 @@ export type ResolvedAnthropicCompat = Required<Omit<AnthropicCompat, "streamIdle
|
|
|
1016
1011
|
* request builder.
|
|
1017
1012
|
*/
|
|
1018
1013
|
maxImagePayloadBytes?: number;
|
|
1019
|
-
/** Thinking-loop watchdog guard family applied to streamed reasoning. */
|
|
1020
|
-
thinkingLoopGuard?: AnthropicCompat["thinkingLoopGuard"];
|
|
1021
1014
|
/**
|
|
1022
1015
|
* Bedrock's Anthropic Messages API (see {@link AnthropicCompat.bedrockMessagesApi}).
|
|
1023
1016
|
* `true` when detected or configured; otherwise unset, so rows baked before
|
|
@@ -1116,16 +1109,13 @@ export interface GoogleCompat {
|
|
|
1116
1109
|
* {@link AnthropicCompat.maxImagePayloadBytes}).
|
|
1117
1110
|
*/
|
|
1118
1111
|
maxImagePayloadBytes?: number;
|
|
1119
|
-
/** Thinking-loop watchdog guard family applied to streamed reasoning. */
|
|
1120
|
-
thinkingLoopGuard?: "gemini" | "deepseek" | "xai";
|
|
1121
1112
|
/** See {@link BedrockCompat.supportsSamplingParams}. */
|
|
1122
1113
|
supportsSamplingParams?: boolean;
|
|
1123
1114
|
}
|
|
1124
1115
|
/** Fully-resolved google-API compat view, materialized once by `buildModel`. */
|
|
1125
|
-
export type ResolvedGoogleCompat = Required<Omit<GoogleCompat, "streamFirstEventTimeoutMs" | "streamIdleTimeoutMs" | "
|
|
1116
|
+
export type ResolvedGoogleCompat = Required<Omit<GoogleCompat, "streamFirstEventTimeoutMs" | "streamIdleTimeoutMs" | "antigravityUsageLabel" | "supportsSamplingParams" | "maxImageDimension" | "maxImagePayloadBytes">> & {
|
|
1126
1117
|
streamFirstEventTimeoutMs?: number;
|
|
1127
1118
|
streamIdleTimeoutMs?: number;
|
|
1128
|
-
thinkingLoopGuard?: GoogleCompat["thinkingLoopGuard"];
|
|
1129
1119
|
antigravityUsageLabel?: string;
|
|
1130
1120
|
supportsSamplingParams?: boolean;
|
|
1131
1121
|
maxImageDimension?: number;
|
|
@@ -1209,12 +1199,12 @@ export interface ModelCost extends TokenCost {
|
|
|
1209
1199
|
/**
|
|
1210
1200
|
* Exact local content tokenizer family for a model.
|
|
1211
1201
|
*
|
|
1212
|
-
* Absent means no first-party local tokenizer is known and consumers
|
|
1213
|
-
*
|
|
1202
|
+
* Absent means no first-party local tokenizer is known and consumers count
|
|
1203
|
+
* in o200k_base. The values name tokenizer
|
|
1214
1204
|
* generations rather than providers: DeepSeek V3 through V4 share
|
|
1215
1205
|
* `"deepseek-v3"`; Kimi K2 through K3 share `"kimi-k2"`.
|
|
1216
1206
|
*/
|
|
1217
|
-
export type ModelTokenizer = "claude-v3" | "claude-v47" | "claude-v5" | "claude-v5-sonnet" | "qwen3" | "deepseek-v3" | "kimi-k2" | "glm5" | "o200k";
|
|
1207
|
+
export type ModelTokenizer = "claude-v3" | "claude-v47" | "claude-v5" | "claude-v5-sonnet" | "qwen3" | "deepseek-v3" | "kimi-k2" | "glm5" | "cl100k" | "o200k";
|
|
1218
1208
|
/** One account's discovered entitlements on a model; see {@link Model.accountAccess}. */
|
|
1219
1209
|
export interface ModelAccountAccess {
|
|
1220
1210
|
/**
|
|
@@ -1404,8 +1394,12 @@ export interface Model<TApi extends Api = Api> {
|
|
|
1404
1394
|
factoryDroidApiProviders?: string[];
|
|
1405
1395
|
/** Factory Droid: `configured_order` when live routing chose the rotation; absent means registry order. */
|
|
1406
1396
|
factoryDroidRoutingSource?: "configured_order";
|
|
1397
|
+
/** Factory Droid: server-side refusal fallbacks the account can run; absent when none are named. */
|
|
1398
|
+
factoryDroidRefusalFallbacks?: string[];
|
|
1407
1399
|
/** Factory Droid Standard Credits base rate (relative per-token weight, not dollars). */
|
|
1408
1400
|
factoryDroidCredits?: number;
|
|
1401
|
+
/** Factory Droid dated `credit-rates` cards, ascending; `getFactoryDroidCreditRate` picks the one due now. */
|
|
1402
|
+
factoryDroidCreditCards?: readonly DatedCostCard[];
|
|
1409
1403
|
/** Canonical organization resolved during Factory discovery. */
|
|
1410
1404
|
factoryDroidOrgId?: string;
|
|
1411
1405
|
cost: ModelCost;
|
|
@@ -1478,8 +1472,9 @@ export interface Model<TApi extends Api = Api> {
|
|
|
1478
1472
|
useResponsesLite?: boolean;
|
|
1479
1473
|
/**
|
|
1480
1474
|
* Service-tier ids the provider advertises for this model (Codex discovery
|
|
1481
|
-
* `service_tiers[].id`,
|
|
1482
|
-
*
|
|
1475
|
+
* `service_tiers[].id`, or an OpenAI-compatible `/v1/models` row's
|
|
1476
|
+
* `service_tiers`, e.g. `priority`, `ultrafast`). Absent when the provider
|
|
1477
|
+
* publishes no per-model tier list.
|
|
1483
1478
|
*/
|
|
1484
1479
|
serviceTiers?: readonly string[];
|
|
1485
1480
|
/** Preferred model to switch to when context promotion is triggered (model id or provider/id). */
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -11,6 +11,14 @@ export declare function toPositiveNumber(value: unknown, fallback: number | null
|
|
|
11
11
|
/** Positive finite number, or `null` when the value is missing/non-positive. */
|
|
12
12
|
export declare function toPositiveNumberOrNull(value: unknown): number | null;
|
|
13
13
|
export declare function toBoolean(value: unknown): boolean | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Service-tier ids from a discovery row's `service_tiers` array, deduplicated
|
|
16
|
+
* in advertisement order. Entries may be codex-rs `{ id, name, description }`
|
|
17
|
+
* objects or bare id strings (OpenAI-compatible relays). Returns `undefined`
|
|
18
|
+
* when the value is not an array; an empty array is kept, since it is a
|
|
19
|
+
* statement that the model offers no optional tier.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseServiceTierIds(value: unknown): string[] | undefined;
|
|
14
22
|
export declare function isAnthropicOAuthToken(key: string): boolean;
|
|
15
23
|
/**
|
|
16
24
|
* Normalize a model display name: drop the gateway author prefix and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linxiraos/pi-catalog",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.10",
|
|
4
4
|
"description": "Model catalog for omp: bundled model database, provider discovery descriptors, model identity, classification, and equivalence",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -86,12 +86,12 @@
|
|
|
86
86
|
"gen:proto": "bun scripts/generate-protocols.ts"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@linxiraos/pi-omptype": "1.4.
|
|
90
|
-
"@linxiraos/pi-utils": "1.4.
|
|
89
|
+
"@linxiraos/pi-omptype": "1.4.10",
|
|
90
|
+
"@linxiraos/pi-utils": "1.4.10"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@bgotink/kdl": "0.4.0",
|
|
94
|
-
"@linxiraos/pi-ai": "1.4.
|
|
94
|
+
"@linxiraos/pi-ai": "1.4.10",
|
|
95
95
|
"@types/bun": "1.4.4"
|
|
96
96
|
},
|
|
97
97
|
"engines": {
|
package/src/compat/auth-ids.ts
CHANGED
|
@@ -53,6 +53,7 @@ export type AuthProviderId =
|
|
|
53
53
|
| "minimax-code"
|
|
54
54
|
| "minimax-code-cn"
|
|
55
55
|
| "mistral"
|
|
56
|
+
| "modular"
|
|
56
57
|
| "moonshot"
|
|
57
58
|
| "muse-code"
|
|
58
59
|
| "nanogpt"
|
|
@@ -72,6 +73,7 @@ export type AuthProviderId =
|
|
|
72
73
|
| "qwen-portal"
|
|
73
74
|
| "sakana"
|
|
74
75
|
| "sambanova"
|
|
76
|
+
| "scaleway"
|
|
75
77
|
| "siliconflow"
|
|
76
78
|
| "siliconflow-cn"
|
|
77
79
|
| "singularityapi-dev"
|
|
@@ -143,6 +145,8 @@ export type LoginProviderId =
|
|
|
143
145
|
| "meta"
|
|
144
146
|
| "minimax-code"
|
|
145
147
|
| "minimax-code-cn"
|
|
148
|
+
| "mistral"
|
|
149
|
+
| "modular"
|
|
146
150
|
| "moonshot"
|
|
147
151
|
| "muse-code"
|
|
148
152
|
| "nanogpt"
|
|
@@ -161,6 +165,7 @@ export type LoginProviderId =
|
|
|
161
165
|
| "qwen-portal"
|
|
162
166
|
| "sakana"
|
|
163
167
|
| "sambanova"
|
|
168
|
+
| "scaleway"
|
|
164
169
|
| "siliconflow"
|
|
165
170
|
| "siliconflow-cn"
|
|
166
171
|
| "singularityapi-dev"
|