@linxiraos/pi-catalog 1.0.9 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -1094
- package/LICENSE +22 -0
- package/THIRD-PARTY-NOTICES.txt +22909 -0
- package/dist/types/build.d.ts +5 -0
- package/dist/types/discovery/cursor-proto.d.ts +5368 -0
- package/dist/types/discovery/devin-proto.d.ts +1549 -0
- package/dist/types/discovery/gemini-cli.d.ts +33 -0
- package/dist/types/discovery/index.d.ts +2 -0
- package/dist/types/discovery/protobuf.d.ts +102 -0
- package/dist/types/hosts.d.ts +5 -0
- package/dist/types/identity/family.d.ts +30 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/model-manager.d.ts +5 -5
- package/dist/types/model-thinking.d.ts +17 -2
- package/dist/types/model-tokenizer.d.ts +8 -0
- package/dist/types/models.d.ts +5 -2
- package/dist/types/provider-models/cache-provider-id.d.ts +2 -0
- package/dist/types/provider-models/descriptors.d.ts +4 -3
- package/dist/types/provider-models/google.d.ts +2 -0
- package/dist/types/provider-models/openai-compat.d.ts +8 -1
- package/dist/types/types.d.ts +56 -7
- package/dist/types/variant-collapse.d.ts +29 -16
- package/dist/types/wire/codex.d.ts +21 -0
- package/dist/types/wire/image-fetchers.d.ts +76 -0
- package/package.json +9 -8
- package/src/build.ts +9 -0
- package/src/compat/openai.ts +37 -6
- package/src/discovery/codex.ts +137 -29
- package/src/discovery/cursor-proto.ts +8329 -0
- package/src/discovery/cursor.ts +16 -3
- package/src/discovery/devin-proto.ts +2037 -0
- package/src/discovery/devin.ts +4 -3
- package/src/discovery/gemini-cli.ts +198 -0
- package/src/discovery/index.ts +2 -0
- package/src/discovery/protobuf.ts +1073 -0
- package/src/hosts.ts +24 -1
- package/src/identity/family.ts +52 -1
- package/src/index.ts +2 -0
- package/src/model-cache.ts +70 -9
- package/src/model-manager.ts +5 -5
- package/src/model-thinking.ts +104 -7
- package/src/model-tokenizer.ts +75 -0
- package/src/models.json +194755 -4193
- package/src/models.ts +20 -10
- package/src/provider-models/bundled-references.ts +12 -2
- package/src/provider-models/cache-provider-id.ts +22 -6
- package/src/provider-models/descriptors.ts +3 -2
- package/src/provider-models/google.ts +18 -8
- package/src/provider-models/openai-compat.ts +446 -112
- package/src/types.ts +65 -5
- package/src/variant-collapse.ts +466 -89
- package/src/wire/codex.ts +54 -0
- package/src/wire/image-fetchers.ts +159 -0
- package/dist/types/discovery/cursor-gen/agent_pb.d.ts +0 -16769
- package/dist/types/discovery/devin-gen/buf/validate/validate_pb.d.ts +0 -1715
- package/dist/types/discovery/devin-gen/exa/analytics_pb/analytics_pb.d.ts +0 -693
- package/dist/types/discovery/devin-gen/exa/api_server_pb/api_server_pb.d.ts +0 -9158
- package/dist/types/discovery/devin-gen/exa/auth_pb/auth_pb.d.ts +0 -52
- package/dist/types/discovery/devin-gen/exa/auto_cascade_common_pb/auto_cascade_common_pb.d.ts +0 -276
- package/dist/types/discovery/devin-gen/exa/bug_checker_pb/bug_checker_pb.d.ts +0 -78
- package/dist/types/discovery/devin-gen/exa/cascade_plugins_pb/cascade_plugins_pb.d.ts +0 -999
- package/dist/types/discovery/devin-gen/exa/chat_pb/chat_pb.d.ts +0 -1704
- package/dist/types/discovery/devin-gen/exa/code_edit/code_edit_pb/code_edit_pb.d.ts +0 -656
- package/dist/types/discovery/devin-gen/exa/codeium_common_pb/codeium_common_pb.d.ts +0 -15014
- package/dist/types/discovery/devin-gen/exa/context_module_pb/context_module_pb.d.ts +0 -607
- package/dist/types/discovery/devin-gen/exa/cortex_pb/cortex_pb.d.ts +0 -11830
- package/dist/types/discovery/devin-gen/exa/diff_action_pb/diff_action_pb.d.ts +0 -248
- package/dist/types/discovery/devin-gen/exa/index_pb/index_pb.d.ts +0 -1747
- package/dist/types/discovery/devin-gen/exa/knowledge_base_pb/knowledge_base_pb.d.ts +0 -509
- package/dist/types/discovery/devin-gen/exa/language_server_pb/language_server_pb.d.ts +0 -9048
- package/dist/types/discovery/devin-gen/exa/opensearch_clients_pb/opensearch_clients_pb.d.ts +0 -1760
- package/dist/types/discovery/devin-gen/exa/prompt_pb/prompt_pb.d.ts +0 -286
- package/dist/types/discovery/devin-gen/exa/reactive_component_pb/reactive_component_pb.d.ts +0 -405
- package/dist/types/discovery/devin-gen/exa/trust_pb/trust_pb.d.ts +0 -582
- package/src/discovery/cursor-gen/agent_pb.ts +0 -19513
- package/src/discovery/devin-gen/buf/validate/validate_pb.ts +0 -1862
- package/src/discovery/devin-gen/exa/analytics_pb/analytics_pb.ts +0 -871
- package/src/discovery/devin-gen/exa/api_server_pb/api_server_pb.ts +0 -11083
- package/src/discovery/devin-gen/exa/auth_pb/auth_pb.ts +0 -71
- package/src/discovery/devin-gen/exa/auto_cascade_common_pb/auto_cascade_common_pb.ts +0 -348
- package/src/discovery/devin-gen/exa/bug_checker_pb/bug_checker_pb.ts +0 -103
- package/src/discovery/devin-gen/exa/cascade_plugins_pb/cascade_plugins_pb.ts +0 -1198
- package/src/discovery/devin-gen/exa/chat_pb/chat_pb.ts +0 -2063
- package/src/discovery/devin-gen/exa/code_edit/code_edit_pb/code_edit_pb.ts +0 -810
- package/src/discovery/devin-gen/exa/codeium_common_pb/codeium_common_pb.ts +0 -18354
- package/src/discovery/devin-gen/exa/context_module_pb/context_module_pb.ts +0 -732
- package/src/discovery/devin-gen/exa/cortex_pb/cortex_pb.ts +0 -14277
- package/src/discovery/devin-gen/exa/diff_action_pb/diff_action_pb.ts +0 -312
- package/src/discovery/devin-gen/exa/index_pb/index_pb.ts +0 -2106
- package/src/discovery/devin-gen/exa/knowledge_base_pb/knowledge_base_pb.ts +0 -623
- package/src/discovery/devin-gen/exa/language_server_pb/language_server_pb.ts +0 -10918
- package/src/discovery/devin-gen/exa/opensearch_clients_pb/opensearch_clients_pb.ts +0 -2125
- package/src/discovery/devin-gen/exa/prompt_pb/prompt_pb.ts +0 -361
- package/src/discovery/devin-gen/exa/reactive_component_pb/reactive_component_pb.ts +0 -450
- package/src/discovery/devin-gen/exa/trust_pb/trust_pb.ts +0 -712
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ModelSpec } from "../types.js";
|
|
2
|
+
import { type VariantCollapseTable } from "../variant-collapse.js";
|
|
3
|
+
/**
|
|
4
|
+
* Options for the Gemini CLI quota-based discovery fallback.
|
|
5
|
+
*/
|
|
6
|
+
export interface FetchGeminiCliQuotaModelsOptions {
|
|
7
|
+
/** OAuth access token sent as `Authorization: Bearer <token>`. */
|
|
8
|
+
token: string;
|
|
9
|
+
/** Cloud Code Assist endpoint. Defaults to `https://cloudcode-pa.googleapis.com`. */
|
|
10
|
+
endpoint?: string;
|
|
11
|
+
/** Pre-resolved GCP project id; otherwise discovered via `loadCodeAssist`. */
|
|
12
|
+
projectId?: string;
|
|
13
|
+
/** Optional abort signal for request cancellation. */
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
/** Optional fetch implementation override for tests. */
|
|
16
|
+
fetcher?: typeof fetch;
|
|
17
|
+
/** Effort-tier collapse table applied to the discovered list. */
|
|
18
|
+
collapseTable?: VariantCollapseTable;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Discovers the Gemini models available to a `google-gemini-cli` credential via
|
|
22
|
+
* the account's own `retrieveUserQuota` endpoint on Cloud Code Assist.
|
|
23
|
+
*
|
|
24
|
+
* This is the fallback for accounts whose credential is not authorized for the
|
|
25
|
+
* Antigravity `fetchAvailableModels` endpoint (e.g. Gemini Code Assist Standard
|
|
26
|
+
* tiers, which return HTTP 403 there). Quota buckets carry only model ids, so
|
|
27
|
+
* metadata is filled from the bundled catalog where the id is known and
|
|
28
|
+
* synthesized with Gemini CLI defaults otherwise.
|
|
29
|
+
*
|
|
30
|
+
* Returns `null` on network/payload/auth failure (the caller keeps the bundled
|
|
31
|
+
* catalog). Returns `[]` when the quota response lists no usable Gemini models.
|
|
32
|
+
*/
|
|
33
|
+
export declare function fetchGeminiCliQuotaModels(options: FetchGeminiCliQuotaModelsOptions): Promise<ModelSpec<"google-gemini-cli">[] | null>;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-performance, zero-builder protobuf wire codecs for @linxiraos/pi-catalog.
|
|
3
|
+
*
|
|
4
|
+
* Schemas are declared as static IR descriptors with near-zero module load overhead
|
|
5
|
+
* and lazy compilation on first encode/decode/create invocation.
|
|
6
|
+
*/
|
|
7
|
+
/** JSON values carried by `google.protobuf.Value` fields. */
|
|
8
|
+
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
9
|
+
[key: string]: JsonValue;
|
|
10
|
+
};
|
|
11
|
+
/** An unrecognised wire field retained for forward-compatible round-trips. */
|
|
12
|
+
export interface ProtoUnknownField {
|
|
13
|
+
no: number;
|
|
14
|
+
wireType: number;
|
|
15
|
+
data: Uint8Array;
|
|
16
|
+
}
|
|
17
|
+
/** Shared internal metadata present on every decoded protocol message. */
|
|
18
|
+
export interface ProtoMessage {
|
|
19
|
+
$typeName?: string;
|
|
20
|
+
$unknown?: ProtoUnknownField[];
|
|
21
|
+
}
|
|
22
|
+
/** A bidirectional codec for one protobuf message type. */
|
|
23
|
+
export interface MessageCodec<T extends ProtoMessage = ProtoMessage> {
|
|
24
|
+
(value: T): Uint8Array;
|
|
25
|
+
(value: Uint8Array): T;
|
|
26
|
+
/** Creates a message with protobuf defaults for omitted fields. */
|
|
27
|
+
create(value?: Partial<T>): T;
|
|
28
|
+
/** Encodes one message into protobuf wire bytes. */
|
|
29
|
+
encode(value: T): Uint8Array;
|
|
30
|
+
/** Decodes one protobuf message from wire bytes. */
|
|
31
|
+
decode(value: Uint8Array): T;
|
|
32
|
+
/** Converts a message to its protobuf JSON representation. */
|
|
33
|
+
toJson(value: T): JsonValue;
|
|
34
|
+
}
|
|
35
|
+
/** Infers a message shape from a codec result. */
|
|
36
|
+
export type InferMessage<TCodec> = TCodec extends MessageCodec<infer TMessage> ? TMessage : never;
|
|
37
|
+
/** Erases a referenced message's concrete shape for static field descriptors. */
|
|
38
|
+
export interface MessageReference {
|
|
39
|
+
encode(value: unknown): Uint8Array;
|
|
40
|
+
decode(value: Uint8Array): ProtoMessage;
|
|
41
|
+
toJson(value: unknown): JsonValue;
|
|
42
|
+
}
|
|
43
|
+
export type ScalarKind = "bool" | "bytes" | "double" | "enum" | "float" | "int32" | "int64" | "string" | "uint32" | "uint64";
|
|
44
|
+
export type WireType = 0 | 1 | 2 | 5;
|
|
45
|
+
export interface ScalarFieldDesc {
|
|
46
|
+
readonly no: number;
|
|
47
|
+
readonly name: string;
|
|
48
|
+
readonly kind: ScalarKind;
|
|
49
|
+
readonly optional?: boolean;
|
|
50
|
+
readonly repeat?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface MessageFieldDesc {
|
|
53
|
+
readonly no: number;
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly kind: "message";
|
|
56
|
+
readonly T: () => MessageReference;
|
|
57
|
+
readonly repeat?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface EnumFieldDesc {
|
|
60
|
+
readonly no: number;
|
|
61
|
+
readonly name: string;
|
|
62
|
+
readonly kind: "enum";
|
|
63
|
+
readonly optional?: boolean;
|
|
64
|
+
readonly repeat?: boolean;
|
|
65
|
+
}
|
|
66
|
+
export interface MapFieldDesc {
|
|
67
|
+
readonly no: number;
|
|
68
|
+
readonly name: string;
|
|
69
|
+
readonly kind: "map";
|
|
70
|
+
readonly K: "string";
|
|
71
|
+
readonly V: ScalarKind | (() => MessageReference);
|
|
72
|
+
}
|
|
73
|
+
export type VariantDesc = {
|
|
74
|
+
readonly no: number;
|
|
75
|
+
readonly name: string;
|
|
76
|
+
readonly kind: ScalarKind;
|
|
77
|
+
} | {
|
|
78
|
+
readonly no: number;
|
|
79
|
+
readonly name: string;
|
|
80
|
+
readonly kind: "message";
|
|
81
|
+
readonly T: () => MessageReference;
|
|
82
|
+
};
|
|
83
|
+
export interface OneofFieldDesc {
|
|
84
|
+
readonly kind: "oneof";
|
|
85
|
+
readonly name: string;
|
|
86
|
+
readonly variants: readonly VariantDesc[];
|
|
87
|
+
}
|
|
88
|
+
export type FieldDesc = ScalarFieldDesc | MessageFieldDesc | EnumFieldDesc | MapFieldDesc | OneofFieldDesc;
|
|
89
|
+
/** Creates a high-performance, lazy protobuf message codec from an IR field descriptor list. */
|
|
90
|
+
export declare function pb<T extends ProtoMessage = ProtoMessage>(typeName: string, fields?: readonly FieldDesc[]): MessageCodec<T>;
|
|
91
|
+
/** Creates a message using its codec's protobuf defaults. */
|
|
92
|
+
export declare function create<TMessage extends ProtoMessage>(codec: MessageCodec<TMessage>, value?: Partial<TMessage>): TMessage;
|
|
93
|
+
/** Encodes a message using its codec. */
|
|
94
|
+
export declare function toBinary<TMessage extends ProtoMessage>(codec: MessageCodec<TMessage>, value: TMessage): Uint8Array;
|
|
95
|
+
/** Decodes wire bytes using a message codec. */
|
|
96
|
+
export declare function fromBinary<TMessage extends ProtoMessage>(codec: MessageCodec<TMessage>, value: Uint8Array): TMessage;
|
|
97
|
+
/** Converts a message to protobuf JSON using its codec. */
|
|
98
|
+
export declare function toJson<TMessage extends ProtoMessage>(codec: MessageCodec<TMessage>, value: TMessage): JsonValue;
|
|
99
|
+
/** Encodes a JSON value as `google.protobuf.Value`. */
|
|
100
|
+
export declare function encodeJsonValue(value: JsonValue): Uint8Array;
|
|
101
|
+
/** Decodes `google.protobuf.Value` wire bytes into a JSON value. */
|
|
102
|
+
export declare function decodeJsonValue(value: Uint8Array): JsonValue;
|
package/dist/types/hosts.d.ts
CHANGED
|
@@ -111,6 +111,11 @@ export declare const KNOWN_HOSTS: {
|
|
|
111
111
|
readonly providers: readonly ["nvidia"];
|
|
112
112
|
readonly urlMarkers: readonly ["integrate.api.nvidia.com"];
|
|
113
113
|
};
|
|
114
|
+
/** Venice AI (`api.venice.ai`). OpenAI-compatible; drives reasoning via top-level `reasoning_effort` (and `venice_parameters.disable_thinking`), and rejects DashScope's top-level `enable_thinking` with a 400 (`additionalProperties: false` request schema). */
|
|
115
|
+
readonly venice: {
|
|
116
|
+
readonly providers: readonly ["venice"];
|
|
117
|
+
readonly urlMarkers: readonly ["api.venice.ai"];
|
|
118
|
+
};
|
|
114
119
|
readonly moonshotNative: {
|
|
115
120
|
readonly providers: readonly ["moonshot", "kimi-code"];
|
|
116
121
|
readonly urlMarkers: readonly ["api.moonshot.ai", "api.kimi.com"];
|
|
@@ -30,6 +30,17 @@ export declare const isClaudeModelId: (modelId: string) => boolean;
|
|
|
30
30
|
export declare const isAnthropicNamespacedModelId: (modelId: string) => boolean;
|
|
31
31
|
/** Qwen family ids (substring match — Qwen SKUs have no stable prefix shape). */
|
|
32
32
|
export declare const isQwenModelId: (modelId: string) => boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Open-weight Qwen 3.8+ releases (`qwen3.8-27b`, `qwen3.8-2.4t-a95b`, GGUF
|
|
35
|
+
* names like `Qwen3.8-27B-UD-Q6_K_XL`) whose chat template steers thinking
|
|
36
|
+
* depth through a `reasoning_effort` template kwarg (`low`/`medium`/`xhigh`,
|
|
37
|
+
* template default `xhigh`; thinking itself cannot be disabled). Compared
|
|
38
|
+
* component-wise so `qwen3.10` sorts after `qwen3.8`. API-only `-max` SKUs are
|
|
39
|
+
* excluded — Dashscope drives them through OpenAI-style `reasoning_effort`
|
|
40
|
+
* with curated compat. The trailing guard rejects parameter-count lookalikes
|
|
41
|
+
* (`qwen-3.8b`) without breaking `qwen3.8-27b`.
|
|
42
|
+
*/
|
|
43
|
+
export declare const isQwen38PlusTemplateEffortModelId: (modelId: string) => boolean;
|
|
33
44
|
/** Gemma open-weights family (`gemma-3-27b-it`, `google/gemma-4-E2B-it`, `gemma2-9b`). */
|
|
34
45
|
export declare const isGemmaModelId: (modelId: string) => boolean;
|
|
35
46
|
/** DeepSeek family by id or display name (proxies often rename the id but keep the name). */
|
|
@@ -45,6 +56,8 @@ export declare const isDeepseekModelIdOrName: (modelId: string) => boolean;
|
|
|
45
56
|
export declare const isDeepseekV4FlashModelId: (modelId: string) => boolean;
|
|
46
57
|
/** Xiaomi MiMo family by id or display name. */
|
|
47
58
|
export declare const isMimoModelIdOrName: (modelId: string) => boolean;
|
|
59
|
+
/** StepFun Step 3.7 Flash SKU in any namespace form (`kilo/stepfun/step-3.7-flash:free`). */
|
|
60
|
+
export declare const isStep37FlashModelId: (modelId: string) => boolean;
|
|
48
61
|
/** Gemini family ids in any namespace form (`gemini-*`, `google/gemini-*`, `openrouter/google/gemini-…`). */
|
|
49
62
|
export declare const isGeminiModelId: (modelId: string) => boolean;
|
|
50
63
|
/** Grok family ids across namespace and delimiter forms (`grok-*`, `cursor-grok-*`, `xai/grok-*`). */
|
|
@@ -52,7 +65,8 @@ export declare const isGrokModelId: (modelId: string) => boolean;
|
|
|
52
65
|
/**
|
|
53
66
|
* Grok SKUs that expose the wire `reasoning.effort` dial. Other Grok reasoners
|
|
54
67
|
* (e.g. `grok-build`, `grok-4.20-0309-reasoning`) think natively but reject the
|
|
55
|
-
* param, so callers must omit reasoning effort for them.
|
|
68
|
+
* param, so callers must omit reasoning effort for them. `grok-4.6` accepts
|
|
69
|
+
* `low`/`medium`/`high`/`xhigh` and 400s on `max`.
|
|
56
70
|
*/
|
|
57
71
|
export declare const isGrokReasoningEffortCapable: (modelId: string) => boolean;
|
|
58
72
|
/**
|
|
@@ -88,6 +102,13 @@ export declare const isMinimaxM3FamilyModelId: (modelId: string) => boolean;
|
|
|
88
102
|
* and `none`.
|
|
89
103
|
*/
|
|
90
104
|
export declare const isOpenAIGptOssModelId: (modelId: string) => boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Meta Muse Spark ids (`muse-spark-1.1`, `muse-spark-1.2`,
|
|
107
|
+
* `muse-spark-1.2-contributor`, `meta/muse-spark-1.2`). The Responses
|
|
108
|
+
* `reasoning.effort` wire accepts `none` (thinking-off) plus
|
|
109
|
+
* `minimal`/`low`/`medium`/`high`/`xhigh`.
|
|
110
|
+
*/
|
|
111
|
+
export declare const isMuseSparkModelId: (modelId: string) => boolean;
|
|
91
112
|
/** OpenAI model ids (gpt-*, chatgpt-*, o1/o3/o4 SKUs, codex-*, or openai/*). */
|
|
92
113
|
export declare const isOpenAIModelId: (modelId: string) => boolean;
|
|
93
114
|
/**
|
|
@@ -187,6 +208,14 @@ export declare const hasOpus47ApiRestrictions: (modelId: string) => boolean;
|
|
|
187
208
|
* @see https://platform.claude.com/docs/en/build-with-claude/mid-conversation-system-messages
|
|
188
209
|
*/
|
|
189
210
|
export declare const supportsMidConversationSystemMessages: (modelId: string) => boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Models that reliably follow the hashline line-anchored edit dialect
|
|
213
|
+
* (`[path#TAG]` headers plus 1-indexed anchors). Kimi, MiMo, DeepSeek V4
|
|
214
|
+
* Flash, and Step 3.7 Flash miscount anchors or drop the tag header often
|
|
215
|
+
* enough that hosts fall back to the sloppy edit format for
|
|
216
|
+
* them.
|
|
217
|
+
*/
|
|
218
|
+
export declare const supportsHashlineEdits: (modelId: string) => boolean;
|
|
190
219
|
export declare const isAnthropicFableOrMythosModel: (modelId: string) => boolean;
|
|
191
220
|
/** Thinking-variant token location inside a model id. */
|
|
192
221
|
export interface ThinkingVariantToken {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./identity/index.js";
|
|
|
6
6
|
export * from "./model-cache.js";
|
|
7
7
|
export * from "./model-manager.js";
|
|
8
8
|
export * from "./model-thinking.js";
|
|
9
|
+
export * from "./model-tokenizer.js";
|
|
9
10
|
export * from "./models.js";
|
|
10
11
|
export * from "./provider-models/index.js";
|
|
11
12
|
export * from "./types.js";
|
|
@@ -15,3 +16,4 @@ export * from "./wire/codex.js";
|
|
|
15
16
|
export * from "./wire/coreweave.js";
|
|
16
17
|
export * from "./wire/gemini-headers.js";
|
|
17
18
|
export * from "./wire/github-copilot.js";
|
|
19
|
+
export * from "./wire/image-fetchers.js";
|
|
@@ -31,11 +31,11 @@ export interface ModelManagerOptions<TApi extends Api = Api, TModelsDevPayload =
|
|
|
31
31
|
/** Cached model ids whose presence forces refresh when the static or migration-policy fingerprint changes. */
|
|
32
32
|
dropCachedModelIdsOnStaticMismatch?: readonly string[];
|
|
33
33
|
/**
|
|
34
|
-
* Trusted, provider-wide request headers
|
|
35
|
-
*
|
|
36
|
-
* headers matched
|
|
37
|
-
*
|
|
38
|
-
*
|
|
34
|
+
* Trusted, provider-wide request headers that can be safely re-derived at
|
|
35
|
+
* cache-read time. The cache never persists their values. Models whose live
|
|
36
|
+
* headers matched this record at write time can survive offline reads without
|
|
37
|
+
* a bundled static source, including configured discovery providers whose
|
|
38
|
+
* bearer header comes from the current local config.
|
|
39
39
|
*/
|
|
40
40
|
restorableHeaderFallback?: Record<string, string>;
|
|
41
41
|
/** Optional dynamic endpoint fetcher. */
|
|
@@ -44,8 +44,12 @@ export declare function getSupportedEfforts<TApi extends Api>(model: ApiModel<TA
|
|
|
44
44
|
*/
|
|
45
45
|
export declare function clampThinkingLevelForModel<TApi extends Api>(model: ApiModel<TApi> | undefined, requested: Effort | undefined): Effort | undefined;
|
|
46
46
|
export declare function requireSupportedEffort<TApi extends Api>(model: ApiModel<TApi>, effort: Effort): Effort;
|
|
47
|
-
/** Maps a normalized thinking effort to Google's `thinkingLevel` enum values.
|
|
48
|
-
|
|
47
|
+
/** Maps a normalized thinking effort to Google's `thinkingLevel` enum values.
|
|
48
|
+
* When a collapsed family routes `minimal` onto the same wire id as `low`
|
|
49
|
+
* (Antigravity Gemini 3.6/3.7 Flash), emit `LOW` — Cloud Code Assist rejects
|
|
50
|
+
* `MINIMAL` on those `-low` SKUs.
|
|
51
|
+
*/
|
|
52
|
+
export declare function mapEffortToGoogleThinkingLevel<TApi extends Api>(effort: Effort, model?: ApiModel<TApi>): "MINIMAL" | "LOW" | "MEDIUM" | "HIGH";
|
|
49
53
|
/**
|
|
50
54
|
* Maps a normalized thinking effort to Anthropic adaptive effort values via
|
|
51
55
|
* the model's baked `thinking.effortMap` (identity for unmapped efforts).
|
|
@@ -63,4 +67,15 @@ export declare function resolveWireModelId<TApi extends Api>(model: ApiModel<TAp
|
|
|
63
67
|
* thinking-off requests on `thinking.requiresEffort` models.
|
|
64
68
|
*/
|
|
65
69
|
export declare function minimumSupportedEffort<TApi extends Api>(model: ApiModel<TApi>): Effort | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Clamp target for effort-less requests on `thinking.requiresEffort` models:
|
|
72
|
+
* the effort whose wire route equals the model's default wire id
|
|
73
|
+
* (`requestModelId`), so a collapsed row clamps to the tier it already
|
|
74
|
+
* advertises as its default rather than the numerically lowest supported tier
|
|
75
|
+
* (e.g. Cursor Grok 4.5/4.6 default to `medium`, the only tier the Start plan
|
|
76
|
+
* serves). Falls back to {@link minimumSupportedEffort} when no route matches
|
|
77
|
+
* the default id — families whose default already is the minimum, or that
|
|
78
|
+
* expose no routing, are unaffected.
|
|
79
|
+
*/
|
|
80
|
+
export declare function defaultSupportedEffort<TApi extends Api>(model: ApiModel<TApi>): Effort | undefined;
|
|
66
81
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ModelTokenizer } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the exact locally embedded tokenizer for a canonical model id.
|
|
4
|
+
*
|
|
5
|
+
* This is catalog policy, not a runtime caller heuristic: [`buildModel`](./build.ts)
|
|
6
|
+
* materializes the result as `Model.tokenizer`; consumers read that property.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveModelTokenizer(modelId: string): ModelTokenizer | undefined;
|
package/dist/types/models.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import MODELS from "./models.json";
|
|
2
|
-
import type { Api, KnownProvider, Model, Usage } from "./types.js";
|
|
2
|
+
import type { Api, KnownProvider, Model, ModelCost, Usage } from "./types.js";
|
|
3
3
|
export type GeneratedProvider = keyof typeof MODELS;
|
|
4
4
|
export declare function getBundledModel<TApi extends Api = Api>(provider: GeneratedProvider, modelId: string): Model<TApi>;
|
|
5
5
|
export declare function getBundledProviders(): KnownProvider[];
|
|
6
6
|
export declare function getBundledModels(provider: GeneratedProvider): Model<Api>[];
|
|
7
7
|
/** Price a prompt as fully uncached input under its active context-length tier. */
|
|
8
|
-
export declare function calculateUncachedInputCost(cost:
|
|
8
|
+
export declare function calculateUncachedInputCost(cost: ModelCost, promptInputTokens: number): number;
|
|
9
|
+
/** Price one usage record from a token rate card, including active context tiers. */
|
|
10
|
+
export declare function calculateUsageCost(cost: ModelCost, usage: Usage): Usage["cost"];
|
|
11
|
+
/** Price one usage record from its model's token rate card. */
|
|
9
12
|
export declare function calculateCost<TApi extends Api>(model: Model<TApi>, usage: Usage): Usage["cost"];
|
|
10
13
|
/**
|
|
11
14
|
* Check if two models are equal by comparing both their id and provider.
|
|
@@ -2,6 +2,8 @@ export interface ModelCacheProviderIdOptions {
|
|
|
2
2
|
apiKey?: string;
|
|
3
3
|
baseUrl?: string;
|
|
4
4
|
}
|
|
5
|
+
/** Whether a provider's model-cache namespace requires its resolved credential. */
|
|
6
|
+
export declare function isCredentialScopedModelCacheProvider(providerId: string): boolean;
|
|
5
7
|
export declare function getDefaultModelDiscoveryBaseUrl(providerId: string): string | undefined;
|
|
6
8
|
/** Resolve an Ollama model-cache namespace scoped to the normalized discovery endpoint. */
|
|
7
9
|
export declare function resolveOllamaModelCacheProviderId(providerId: string, baseUrl?: string): string;
|
|
@@ -205,7 +205,7 @@ export declare const CATALOG_PROVIDERS: readonly [{
|
|
|
205
205
|
readonly id: "litellm";
|
|
206
206
|
readonly defaultModel: "claude-opus-4-8";
|
|
207
207
|
readonly envVars: readonly ["LITELLM_API_KEY"];
|
|
208
|
-
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("../index.js").ModelManagerOptions<"
|
|
208
|
+
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("../index.js").ModelManagerOptions<import("../index.js").Api, unknown>;
|
|
209
209
|
readonly catalogDiscovery: {
|
|
210
210
|
readonly label: "LiteLLM";
|
|
211
211
|
readonly allowUnauthenticated: true;
|
|
@@ -428,17 +428,18 @@ export declare const CATALOG_PROVIDERS: readonly [{
|
|
|
428
428
|
readonly defaultModel: "openai/gpt-oss-120b";
|
|
429
429
|
readonly envVars: readonly ["COREWEAVE_API_KEY", "WANDB_API_KEY"];
|
|
430
430
|
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("../index.js").ModelManagerOptions<"openai-completions", unknown>;
|
|
431
|
+
readonly dynamicModelsAuthoritative: true;
|
|
431
432
|
readonly catalogDiscovery: {
|
|
432
433
|
readonly label: "CoreWeave Serverless Inference";
|
|
433
434
|
};
|
|
434
435
|
}, {
|
|
435
436
|
readonly id: "xai";
|
|
436
|
-
readonly defaultModel: "grok-4.
|
|
437
|
+
readonly defaultModel: "grok-4.6";
|
|
437
438
|
readonly envVars: readonly ["XAI_API_KEY"];
|
|
438
439
|
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("../index.js").ModelManagerOptions<"openai-responses", unknown>;
|
|
439
440
|
}, {
|
|
440
441
|
readonly id: "xai-oauth";
|
|
441
|
-
readonly defaultModel: "grok-4.
|
|
442
|
+
readonly defaultModel: "grok-4.6";
|
|
442
443
|
readonly envVars: readonly ["XAI_OAUTH_TOKEN", "XAI_API_KEY"];
|
|
443
444
|
readonly createModelManagerOptions: (config: ModelManagerConfig) => import("../index.js").ModelManagerOptions<"openai-responses", unknown>;
|
|
444
445
|
readonly catalogDiscovery: {
|
|
@@ -18,6 +18,8 @@ export interface GoogleAntigravityModelManagerConfig {
|
|
|
18
18
|
}
|
|
19
19
|
export interface GoogleGeminiCliModelManagerConfig {
|
|
20
20
|
oauthToken?: string;
|
|
21
|
+
/** GCP project id required by Workspace/Standard credentials for quota discovery. */
|
|
22
|
+
projectId?: string;
|
|
21
23
|
endpoint?: string;
|
|
22
24
|
fetch?: FetchImpl;
|
|
23
25
|
}
|
|
@@ -166,6 +166,11 @@ export interface XaiModelManagerConfig {
|
|
|
166
166
|
baseUrl?: string;
|
|
167
167
|
fetch?: FetchImpl;
|
|
168
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* Applies xAI's long-context rate card and mirrors exact public-model prices
|
|
171
|
+
* onto matching SuperGrok catalog rows.
|
|
172
|
+
*/
|
|
173
|
+
export declare function applyXaiCatalogPricing(models: readonly ModelSpec[]): ModelSpec[];
|
|
169
174
|
export declare function xaiModelManagerOptions(config?: XaiModelManagerConfig): ModelManagerOptions<"openai-responses">;
|
|
170
175
|
export interface XaiOAuthModelManagerConfig {
|
|
171
176
|
apiKey?: string;
|
|
@@ -568,12 +573,14 @@ export interface FetchLiteLLMRichModelsOptions<TApi extends Api> {
|
|
|
568
573
|
signal?: AbortSignal;
|
|
569
574
|
timeoutMs?: number;
|
|
570
575
|
referenceResolver?: (modelId: string) => ModelSpec<TApi> | undefined;
|
|
576
|
+
resolveApi?: (entry: Record<string, unknown>, modelId: string) => TApi;
|
|
571
577
|
}
|
|
572
578
|
export declare const OPENAI_COMPAT_DISCOVERY_DEFAULT_CONTEXT_WINDOW = 128000;
|
|
573
579
|
export declare const OPENAI_COMPAT_DISCOVERY_DEFAULT_MAX_TOKENS = 32768;
|
|
574
580
|
export declare function normalizeLiteLLMManagementBaseUrl(baseUrl: string): string;
|
|
581
|
+
export declare function resolveLiteLLMApi(entry: Record<string, unknown> | undefined, id: string, fallbackApi?: Api): Api;
|
|
575
582
|
export declare function fetchLiteLLMRichModels<TApi extends Api>(options: FetchLiteLLMRichModelsOptions<TApi>): Promise<ModelSpec<TApi>[] | null>;
|
|
576
|
-
export declare function litellmModelManagerOptions(config?: LiteLLMModelManagerConfig): ModelManagerOptions<
|
|
583
|
+
export declare function litellmModelManagerOptions(config?: LiteLLMModelManagerConfig): ModelManagerOptions<Api>;
|
|
577
584
|
export interface VllmModelManagerConfig {
|
|
578
585
|
apiKey?: string;
|
|
579
586
|
baseUrl?: string;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -122,8 +122,8 @@ export interface Usage {
|
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
export type OpenAIReasoningFormat = "openai" | "openrouter" | "zai" | "kimi" | "qwen" | "qwen-chat-template";
|
|
125
|
-
export type OpenAIReasoningDisableMode = "omit" | "lowest-effort" | "none-effort" | "openrouter-enabled-false" | "zai-thinking-disabled" | "qwen-enable-thinking-false" | "qwen-template-false";
|
|
126
|
-
export type OpenAIStreamMarkupHealingPattern = "kimi" | "dsml" | "thinking";
|
|
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";
|
|
126
|
+
export type OpenAIStreamMarkupHealingPattern = "kimi" | "dsml" | "qwen" | "thinking";
|
|
127
127
|
/**
|
|
128
128
|
* Compatibility settings for openai-completions API.
|
|
129
129
|
* Use this to override URL-based auto-detection for custom providers.
|
|
@@ -220,6 +220,16 @@ export interface OpenAICompat {
|
|
|
220
220
|
* Non-Qwen templates ignore the flag, so the auto-detection is safe.
|
|
221
221
|
*/
|
|
222
222
|
qwenPreserveThinking?: boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Route the requested thinking effort onto the Qwen 3.8+ chat template's
|
|
225
|
+
* `reasoning_effort` kwarg (`low`/`medium`/`xhigh`; template default
|
|
226
|
+
* `xhigh`). Emitted inside `chat_template_kwargs` for both Qwen dialects
|
|
227
|
+
* (plus the top-level field on the `qwen` dialect, which newer llama.cpp
|
|
228
|
+
* builds map natively). Without it the qwen dialects only toggle
|
|
229
|
+
* `enable_thinking` and the template always thinks at its `xhigh` default.
|
|
230
|
+
* Default: auto-detected (Qwen 3.8+ id on a local llama.cpp-style backend).
|
|
231
|
+
*/
|
|
232
|
+
qwenTemplateReasoningEffort?: boolean;
|
|
223
233
|
/** Whether assistant tool-call messages must include non-empty content. Default: false. */
|
|
224
234
|
requiresAssistantContentForToolCalls?: boolean;
|
|
225
235
|
/** Whether the provider supports the `tool_choice` parameter. Default: true. */
|
|
@@ -558,6 +568,7 @@ export interface ResolvedOpenAISharedCompat {
|
|
|
558
568
|
allowsSyntheticReasoningContentForToolCalls: boolean;
|
|
559
569
|
replayReasoningContent: boolean;
|
|
560
570
|
qwenPreserveThinking: boolean;
|
|
571
|
+
qwenTemplateReasoningEffort: boolean;
|
|
561
572
|
requiresThinkingAsText: boolean;
|
|
562
573
|
requiresMistralToolIds: boolean;
|
|
563
574
|
requiresToolResultName: boolean;
|
|
@@ -595,7 +606,7 @@ export interface ResolvedOpenAISharedCompat {
|
|
|
595
606
|
* `buildModel`; request handlers read fields and never detect, resolve, or
|
|
596
607
|
* allocate.
|
|
597
608
|
*/
|
|
598
|
-
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" | "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">> & {
|
|
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">> & {
|
|
599
610
|
vercelGatewayRouting?: OpenAICompat["vercelGatewayRouting"];
|
|
600
611
|
extraBody?: OpenAICompat["extraBody"];
|
|
601
612
|
cacheControlFormat?: OpenAICompat["cacheControlFormat"];
|
|
@@ -694,19 +705,37 @@ export interface TokenCost {
|
|
|
694
705
|
cacheWrite: number;
|
|
695
706
|
}
|
|
696
707
|
/**
|
|
697
|
-
* Rates applied to the full request when its prompt exceeds `inputThreshold
|
|
698
|
-
*
|
|
699
|
-
* provider-orchestration input
|
|
708
|
+
* Rates applied to the full request when its prompt exceeds `inputThreshold`,
|
|
709
|
+
* or reaches it when `inputThresholdInclusive` is true. Prompt input is the
|
|
710
|
+
* sum of uncached, cached-read, cache-write, and provider-orchestration input
|
|
711
|
+
* tokens.
|
|
700
712
|
*/
|
|
701
713
|
export interface LongContextTokenCost extends TokenCost {
|
|
702
714
|
inputThreshold: number;
|
|
715
|
+
/** Whether the long-context tier starts exactly at `inputThreshold`. */
|
|
716
|
+
inputThresholdInclusive?: boolean;
|
|
703
717
|
}
|
|
704
718
|
/** Base token rates plus an optional long-context tier. */
|
|
705
719
|
export interface ModelCost extends TokenCost {
|
|
706
720
|
longContext?: LongContextTokenCost;
|
|
707
721
|
}
|
|
722
|
+
/**
|
|
723
|
+
* Exact local content tokenizer family for a model.
|
|
724
|
+
*
|
|
725
|
+
* Absent means no first-party local tokenizer is known and consumers retain
|
|
726
|
+
* their estimate/default-tokenizer policy. The values name tokenizer
|
|
727
|
+
* generations rather than providers: DeepSeek V3 through V4 share
|
|
728
|
+
* `"deepseek-v3"`; Kimi K2 through K3 share `"kimi-k2"`.
|
|
729
|
+
*/
|
|
730
|
+
export type ModelTokenizer = "claude-v3" | "claude-v47" | "claude-v5" | "claude-v5-sonnet" | "qwen3" | "deepseek-v3" | "kimi-k2" | "glm5";
|
|
708
731
|
export interface Model<TApi extends Api = Api> {
|
|
709
732
|
id: string;
|
|
733
|
+
/**
|
|
734
|
+
* Whether provider-bound private-use glyphs require reversible ASCII tokenization.
|
|
735
|
+
* Materialized by `buildModel`; request handlers read this capability instead of
|
|
736
|
+
* inferring it from the transport API.
|
|
737
|
+
*/
|
|
738
|
+
requiresGlyphTokenization?: boolean;
|
|
710
739
|
/**
|
|
711
740
|
* Model id to send on the wire when it differs from `id`. Used by catalog
|
|
712
741
|
* variants that present one upstream model under several local entries —
|
|
@@ -728,6 +757,12 @@ export interface Model<TApi extends Api = Api> {
|
|
|
728
757
|
provider: Provider;
|
|
729
758
|
baseUrl: string;
|
|
730
759
|
reasoning: boolean;
|
|
760
|
+
/**
|
|
761
|
+
* Exact local tokenizer family resolved from the model identity or supplied
|
|
762
|
+
* explicitly by a catalog/discovery source. Absent leaves local counting to
|
|
763
|
+
* the consumer's fallback policy.
|
|
764
|
+
*/
|
|
765
|
+
tokenizer?: ModelTokenizer;
|
|
731
766
|
input: ("text" | "image")[];
|
|
732
767
|
/**
|
|
733
768
|
* Decoder family used for image inputs when it has narrower format support
|
|
@@ -786,6 +821,8 @@ export interface Model<TApi extends Api = Api> {
|
|
|
786
821
|
preferWebsockets?: boolean;
|
|
787
822
|
/** Codex Responses Lite transport: send the lite marker and carry instructions/tools as input items (mirrors codex-rs `use_responses_lite`). */
|
|
788
823
|
useResponsesLite?: boolean;
|
|
824
|
+
/** Codex Code Mode restriction: model expects tools routed through a programmatic exec surface (mirrors codex-rs `tool_mode`). */
|
|
825
|
+
toolMode?: "code_mode_only";
|
|
789
826
|
/** Preferred model to switch to when context promotion is triggered (model id or provider/id). */
|
|
790
827
|
contextPromotionTarget?: string;
|
|
791
828
|
/** Preferred model to use only for compaction (model id or provider/id); the active session model is unchanged. */
|
|
@@ -818,13 +855,25 @@ export interface Model<TApi extends Api = Api> {
|
|
|
818
855
|
* `options.isOAuth = true` for the underlying provider call.
|
|
819
856
|
*/
|
|
820
857
|
isOAuth?: boolean;
|
|
858
|
+
/**
|
|
859
|
+
* Amazon Bedrock Guardrail id or ARN attached to every Converse request for
|
|
860
|
+
* this model. Set from `providers.amazon-bedrock.guardrailIdentifier`; the
|
|
861
|
+
* streaming layer forwards it as `options.guardrailIdentifier` so accounts
|
|
862
|
+
* that gate `bedrock:InvokeModel*` on the `bedrock:GuardrailIdentifier`
|
|
863
|
+
* condition key stop returning an explicit deny.
|
|
864
|
+
*/
|
|
865
|
+
guardrailIdentifier?: string;
|
|
866
|
+
/** Bedrock guardrail version. Defaults to `"DRAFT"` at request time when unset. */
|
|
867
|
+
guardrailVersion?: string;
|
|
868
|
+
/** Bedrock guardrail trace verbosity. */
|
|
869
|
+
guardrailTrace?: "enabled" | "disabled" | "enabled_full";
|
|
821
870
|
}
|
|
822
871
|
/**
|
|
823
872
|
* A model as authored by configs, bundled catalogs, and discovery — the input
|
|
824
873
|
* vocabulary of `buildModel`. Identical to `Model` except `compat` carries the
|
|
825
874
|
* sparse override shape and nothing is resolved yet.
|
|
826
875
|
*/
|
|
827
|
-
export interface ModelSpec<TApi extends Api = Api> extends Omit<Model<TApi>, "compat" | "compatConfig" | "supportsComputerUseConfig"> {
|
|
876
|
+
export interface ModelSpec<TApi extends Api = Api> extends Omit<Model<TApi>, "compat" | "compatConfig" | "requiresGlyphTokenization" | "supportsComputerUseConfig"> {
|
|
828
877
|
/** Sparse compatibility overrides; resolved into `Model.compat` by `buildModel`. */
|
|
829
878
|
compat?: CompatConfigOf<TApi>;
|
|
830
879
|
}
|
|
@@ -21,6 +21,15 @@ export interface EffortVariantFamily {
|
|
|
21
21
|
* when it equals the logical id).
|
|
22
22
|
*/
|
|
23
23
|
members: readonly string[];
|
|
24
|
+
/**
|
|
25
|
+
* Preferred default wire id: overrides the member-order default for the
|
|
26
|
+
* collapsed spec's `requestModelId` when this member is live. Lets a
|
|
27
|
+
* mandatory-reasoning family advertise a canonical tier that is not its
|
|
28
|
+
* numeric floor (Cursor Grok 4.5/4.6 default to `-medium`, the only tier the
|
|
29
|
+
* Start plan serves; the `-low` floor is refused). Ignored when absent from
|
|
30
|
+
* the input or retired.
|
|
31
|
+
*/
|
|
32
|
+
defaultMember?: string;
|
|
24
33
|
/**
|
|
25
34
|
* Wire ids upstream no longer serves (e.g. a deployment killed while
|
|
26
35
|
* discovery still advertises it). Fresh collapsing never routes to them,
|
|
@@ -58,6 +67,8 @@ export declare const ANTIGRAVITY_VARIANT_COLLAPSE_TABLE: VariantCollapseTable;
|
|
|
58
67
|
/** `google-gemini-cli` Gemini families on the official CLI's level transport. */
|
|
59
68
|
export declare const GEMINI_CLI_VARIANT_COLLAPSE_TABLE: VariantCollapseTable;
|
|
60
69
|
export declare const DEVIN_VARIANT_COLLAPSE_TABLE: VariantCollapseTable;
|
|
70
|
+
/** `cursor` per-effort sibling families collapsed per service-tier lane: Grok 4.5/4.6 plus GPT-5.6 Luna/Sol/Terra. */
|
|
71
|
+
export declare const CURSOR_VARIANT_COLLAPSE_TABLE: VariantCollapseTable;
|
|
61
72
|
/** Provider id → hand collapse table. The CCA providers diverge on thinking transport. */
|
|
62
73
|
export declare const VARIANT_COLLAPSE_TABLES: Readonly<Record<string, VariantCollapseTable>>;
|
|
63
74
|
/**
|
|
@@ -89,10 +100,11 @@ export declare function isVariantCollapsedSpec(spec: VariantSpecLike): boolean;
|
|
|
89
100
|
*/
|
|
90
101
|
export declare function collapseEffortVariants<TSpec extends VariantSpecLike>(specs: readonly TSpec[], table: VariantCollapseTable): TSpec[];
|
|
91
102
|
/**
|
|
92
|
-
* Collapse a full mixed-provider list: per provider, the hand table
|
|
93
|
-
*
|
|
94
|
-
* catalog generator; the runtime equivalent lives at
|
|
95
|
-
* point. Output is regrouped by provider — callers
|
|
103
|
+
* Collapse a full mixed-provider list: per provider, the hand table, Cursor's
|
|
104
|
+
* conservative live effort-sibling rule, and the automatic `X`/`X-thinking`
|
|
105
|
+
* pair rule. Used by the catalog generator; the runtime equivalent lives at
|
|
106
|
+
* the model-manager merge point. Output is regrouped by provider — callers
|
|
107
|
+
* re-sort.
|
|
96
108
|
*/
|
|
97
109
|
export declare function collapseEffortVariantsAcrossProviders<TSpec extends VariantSpecLike>(specs: readonly TSpec[]): TSpec[];
|
|
98
110
|
/**
|
|
@@ -105,29 +117,30 @@ export declare function collapseEffortVariantsAcrossProviders<TSpec extends Vari
|
|
|
105
117
|
export declare function collapseBuiltModelVariants<TApi extends Api>(models: readonly Model<TApi>[]): Model<TApi>[];
|
|
106
118
|
/**
|
|
107
119
|
* Resolve a retired effort-tier variant id (collapsed member, recycled id) to
|
|
108
|
-
* its replacement model id for `provider` via
|
|
109
|
-
* `undefined` when the id is not a known alias; derived
|
|
110
|
-
*
|
|
111
|
-
* exact model lookup first — a live model always wins over
|
|
120
|
+
* its replacement model id for `provider` via hand-table or registered live
|
|
121
|
+
* aliases. Returns `undefined` when the id is not a known alias; derived
|
|
122
|
+
* `X-thinking` members also resolve through `stripThinkingVariantToken`.
|
|
123
|
+
* Callers must try an exact model lookup first — a live model always wins over
|
|
124
|
+
* an alias.
|
|
112
125
|
*/
|
|
113
126
|
export declare function resolveVariantAlias(provider: Provider, modelId: string): string | undefined;
|
|
114
127
|
/** Bare-id alias hit: replacement id plus the providers declaring it. */
|
|
115
128
|
export interface BareVariantAliasHit {
|
|
116
129
|
id: string;
|
|
117
|
-
/** Providers
|
|
130
|
+
/** Providers declaring the alias — candidates from these win ties. */
|
|
118
131
|
providers: readonly Provider[];
|
|
119
132
|
}
|
|
120
133
|
/**
|
|
121
|
-
* Provider-agnostic
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
134
|
+
* Provider-agnostic alias lookup for bare-id selectors. Returns the declaring
|
|
135
|
+
* providers so callers can prefer their models when the replacement id exists
|
|
136
|
+
* on unrelated providers too (e.g. a retired Cursor tier id must not resolve
|
|
137
|
+
* to `openai/gpt-5.4`).
|
|
125
138
|
*/
|
|
126
139
|
export declare function resolveBareVariantAlias(modelId: string): BareVariantAliasHit | undefined;
|
|
127
140
|
/**
|
|
128
141
|
* Reverse alias lookup: the retired ids that resolve to `modelId` for
|
|
129
|
-
* `provider` via
|
|
130
|
-
* ids (models.yml `modelOverrides`, suppressed selectors)
|
|
131
|
-
*
|
|
142
|
+
* `provider` via hand-table or registered live aliases. Used to re-key config
|
|
143
|
+
* keyed by raw member ids (models.yml `modelOverrides`, suppressed selectors)
|
|
144
|
+
* onto the collapsed model.
|
|
132
145
|
*/
|
|
133
146
|
export declare function getVariantAliasSources(provider: Provider, modelId: string): readonly string[];
|