@linxiraos/pi-catalog 1.2.0 → 1.3.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 +79 -0
- package/README.md +4 -2
- package/THIRD-PARTY-NOTICES.txt +55 -5
- package/dist/types/build.d.ts +3 -2
- package/dist/types/compat/auth-ids.d.ts +2 -2
- package/dist/types/compat/axes.d.ts +1 -1
- package/dist/types/compat/behavior.d.ts +5 -0
- package/dist/types/compat/catalog-endpoint.d.ts +8 -0
- package/dist/types/compat/image-tokenization.d.ts +9 -1
- package/dist/types/compat/judgment-images.d.ts +25 -0
- package/dist/types/compat/provider-ids.d.ts +1 -1
- package/dist/types/compat/request-compression.d.ts +23 -0
- package/dist/types/compat/request-size.d.ts +12 -3
- package/dist/types/compat/thinking-replay.d.ts +9 -0
- package/dist/types/compat/types.d.ts +4 -0
- package/dist/types/discovery/antigravity.d.ts +7 -0
- package/dist/types/model-cache.d.ts +7 -0
- package/dist/types/model-manager.d.ts +6 -0
- package/dist/types/model-thinking.d.ts +11 -1
- package/dist/types/models.d.ts +16 -1
- package/dist/types/pricing.d.ts +37 -1
- package/dist/types/provider-models/openai-compat.d.ts +18 -46
- package/dist/types/types.d.ts +63 -12
- package/dist/types/wire/codex.d.ts +2 -0
- package/package.json +6 -6
- package/src/build.d.ts +3 -2
- package/src/build.ts +159 -80
- package/src/compat/auth-ids.ts +2 -0
- package/src/compat/axes.d.ts +1 -1
- package/src/compat/axes.ts +129 -4
- package/src/compat/behavior.d.ts +5 -0
- package/src/compat/behavior.ts +9 -1
- package/src/compat/cascade.ts +4 -1
- package/src/compat/catalog-endpoint.ts +43 -0
- package/src/compat/image-tokenization.ts +28 -10
- package/src/compat/judgment-images.ts +83 -0
- package/src/compat/provider-ids.d.ts +1 -1
- package/src/compat/provider-ids.ts +1 -0
- package/src/compat/request-compression.ts +43 -0
- package/src/compat/request-size.ts +20 -5
- package/src/compat/resolve.ts +90 -53
- package/src/compat/rules/README.md +32 -3
- package/src/compat/rules/auth/_order.kdl +1 -1
- package/src/compat/rules/auth/google-antigravity.kdl +1 -1
- package/src/compat/rules/auth/sambanova.kdl +9 -0
- package/src/compat/rules/auth/stencil.kdl +1 -1
- package/src/compat/rules/classes/anthropic.kdl +42 -2
- package/src/compat/rules/classes/deepseek.kdl +4 -0
- package/src/compat/rules/classes/gemini.kdl +46 -2
- package/src/compat/rules/classes/meta.kdl +7 -0
- package/src/compat/rules/classes/minimax.kdl +11 -1
- package/src/compat/rules/classes/openai.kdl +34 -3
- package/src/compat/rules/classes/xai.kdl +26 -0
- package/src/compat/rules/providers/amazon-bedrock.kdl +1 -0
- package/src/compat/rules/providers/anthropic.kdl +23 -0
- package/src/compat/rules/providers/azure.kdl +2 -0
- package/src/compat/rules/providers/cerebras.kdl +3 -0
- package/src/compat/rules/providers/cline-pass.kdl +16 -0
- package/src/compat/rules/providers/commandcode.kdl +10 -0
- package/src/compat/rules/providers/cursor.kdl +50 -1
- package/src/compat/rules/providers/deepinfra.kdl +3 -1
- package/src/compat/rules/providers/devin.kdl +117 -6
- package/src/compat/rules/providers/factory-droid.kdl +6 -0
- package/src/compat/rules/providers/firepass.kdl +15 -0
- package/src/compat/rules/providers/fireworks.kdl +26 -0
- package/src/compat/rules/providers/github-copilot.kdl +24 -0
- package/src/compat/rules/providers/google-antigravity.kdl +37 -0
- package/src/compat/rules/providers/google-gemini-cli.kdl +1 -0
- package/src/compat/rules/providers/google-vertex.kdl +5 -0
- package/src/compat/rules/providers/google.kdl +1 -0
- package/src/compat/rules/providers/image-tokenization.kdl +2 -1
- package/src/compat/rules/providers/local.kdl +8 -1
- package/src/compat/rules/providers/meta.kdl +16 -0
- package/src/compat/rules/providers/moonshot.kdl +2 -0
- package/src/compat/rules/providers/muse-code.kdl +49 -0
- package/src/compat/rules/providers/native-tools.kdl +3 -0
- package/src/compat/rules/providers/ollama-cloud.kdl +10 -0
- package/src/compat/rules/providers/openai-codex.kdl +29 -5
- package/src/compat/rules/providers/openai.kdl +1 -0
- package/src/compat/rules/providers/opencode-go.kdl +35 -0
- package/src/compat/rules/providers/opencode-zen.kdl +4 -0
- package/src/compat/rules/providers/openrouter.kdl +19 -0
- package/src/compat/rules/providers/sambanova.kdl +60 -0
- package/src/compat/rules/providers/tool-call-names.kdl +37 -0
- package/src/compat/rules/providers/typesafe.kdl +11 -0
- package/src/compat/rules/providers/umans.kdl +7 -0
- package/src/compat/rules/providers/venice.kdl +7 -0
- package/src/compat/rules/providers/xai-oauth.kdl +16 -6
- package/src/compat/rules/providers/xai.kdl +3 -0
- package/src/compat/rules/providers/zai.kdl +5 -0
- package/src/compat/rules/runtime/behavior.kdl +128 -8
- package/src/compat/rules/taxonomy/_collapse.kdl +11 -0
- package/src/compat/rules/taxonomy/gemma.kdl +1 -0
- package/src/compat/rules/taxonomy/meta.kdl +7 -0
- package/src/compat/rules/taxonomy/openai.kdl +2 -0
- package/src/compat/rules.json +1 -1
- package/src/compat/thinking-replay.ts +33 -0
- package/src/compat/types.d.ts +4 -0
- package/src/compat/types.ts +4 -0
- package/src/discovery/antigravity.d.ts +7 -0
- package/src/discovery/antigravity.ts +13 -0
- package/src/discovery/codex.ts +0 -4
- package/src/discovery/cursor.ts +28 -20
- package/src/discovery/devin.ts +7 -8
- package/src/model-cache.d.ts +7 -0
- package/src/model-cache.ts +8 -0
- package/src/model-manager.d.ts +6 -0
- package/src/model-manager.ts +41 -21
- package/src/model-thinking.d.ts +80 -0
- package/src/model-thinking.ts +13 -1
- package/src/model-tokenizer.ts +7 -1
- package/src/models.d.ts +16 -1
- package/src/models.json +1 -1
- package/src/models.ts +26 -12
- package/src/pricing.d.ts +37 -1
- package/src/pricing.ts +123 -12
- package/src/provider-models/bundled-references.ts +5 -2
- package/src/provider-models/cache-provider-id.ts +1 -1
- package/src/provider-models/descriptors.ts +2 -0
- package/src/provider-models/google.ts +7 -1
- package/src/provider-models/openai-compat.d.ts +18 -46
- package/src/provider-models/openai-compat.ts +188 -104
- package/src/provider-models/special.ts +1 -0
- package/src/types.d.ts +63 -12
- package/src/types.ts +71 -9
- package/src/wire/codex.d.ts +2 -0
- package/src/wire/codex.ts +17 -0
|
@@ -100,6 +100,19 @@ export interface CerebrasModelManagerConfig {
|
|
|
100
100
|
fetch?: FetchImpl;
|
|
101
101
|
}
|
|
102
102
|
export declare function cerebrasModelManagerOptions(config?: CerebrasModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
103
|
+
/** SambaNova discovery inputs: `apiKey` enables the live roster; `baseUrl` defaults to SambaNova Cloud. */
|
|
104
|
+
export interface SambaNovaModelManagerConfig {
|
|
105
|
+
apiKey?: string;
|
|
106
|
+
baseUrl?: string;
|
|
107
|
+
fetch?: FetchImpl;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* SambaNova Cloud's model manager. `/v1/models` requires a key, so a keyless
|
|
111
|
+
* manager serves only the bundled seed; with a key the live roster replaces
|
|
112
|
+
* it. Rows carry pricing and limits but no capability metadata: reasoning,
|
|
113
|
+
* thinking wire format, and image input come from `providers/sambanova.kdl`.
|
|
114
|
+
*/
|
|
115
|
+
export declare function sambanovaModelManagerOptions(config?: SambaNovaModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
103
116
|
export interface HuggingfaceModelManagerConfig {
|
|
104
117
|
apiKey?: string;
|
|
105
118
|
baseUrl?: string;
|
|
@@ -232,52 +245,6 @@ export interface ZhipuCodingPlanModelManagerConfig {
|
|
|
232
245
|
fetch?: FetchImpl;
|
|
233
246
|
}
|
|
234
247
|
export declare function zhipuCodingPlanModelManagerOptions(config?: ZhipuCodingPlanModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
235
|
-
/**
|
|
236
|
-
* Fireworks-published cap for the Kimi K2 family. Fireworks' `/v1/models`
|
|
237
|
-
* envelope generically reports `max_completion_tokens: 65536` for every Kimi
|
|
238
|
-
* deployment, but Kimi K2 (instruct / thinking / turbo) on Fireworks is
|
|
239
|
-
* documented to ship long reasoning traces that should be bounded — capping
|
|
240
|
-
* at 32,768 prevents handing callers a budget the router cannot honor.
|
|
241
|
-
* See https://github.com/can1357/oh-my-pi/issues/1849.
|
|
242
|
-
*/
|
|
243
|
-
export declare const FIREWORKS_KIMI_MAX_TOKENS = 32768;
|
|
244
|
-
/**
|
|
245
|
-
* Fireworks' output ceiling for Kimi K2.7-Code specifically. Its `/v1/models`
|
|
246
|
-
* generic `max_completion_tokens` is 65,536 and Fireworks serves it in full —
|
|
247
|
-
* verified with a single completion emitting 58,971 output tokens and
|
|
248
|
-
* `max_tokens: 200000` accepted without error. Unlike the older K2.5/K2.6
|
|
249
|
-
* family (see {@link FIREWORKS_KIMI_MAX_TOKENS}), K2.7-Code is not clamped to
|
|
250
|
-
* 32,768; that ceiling only truncated it.
|
|
251
|
-
*/
|
|
252
|
-
export declare const FIREWORKS_KIMI_K27_CODE_MAX_TOKENS = 65536;
|
|
253
|
-
/**
|
|
254
|
-
* Returns true for the Kimi K2.5 / K2.6 family served by Fireworks-backed
|
|
255
|
-
* providers (`fireworks` direct, `firepass` router) that share the 32,768
|
|
256
|
-
* `maxTokens` ceiling. Matches both the public catalog id (`kimi-k2.5`,
|
|
257
|
-
* `kimi-k2.6`, `kimi-k2.6-turbo`) and the canonical Fireworks wire id
|
|
258
|
-
* (`accounts/fireworks/{models,routers}/kimi-k2…`).
|
|
259
|
-
*
|
|
260
|
-
* K2.7-Code (incl. `-fast` / `-highspeed`) is deliberately excluded: unlike the
|
|
261
|
-
* earlier K2 family it serves its full context on Fireworks — verified with a
|
|
262
|
-
* single completion emitting 58,971 output tokens and `max_tokens: 200000`
|
|
263
|
-
* accepted without error — so the 32,768 cap would only truncate it. It inherits
|
|
264
|
-
* Fireworks' reported `max_completion_tokens` (65,536) instead.
|
|
265
|
-
*/
|
|
266
|
-
export declare function isFireworksKimiK2ModelId(modelId: string): boolean;
|
|
267
|
-
/**
|
|
268
|
-
* Clamp the Kimi K2 family's `maxTokens` to {@link FIREWORKS_KIMI_MAX_TOKENS}
|
|
269
|
-
* on Fireworks-backed providers, leaving every other model untouched.
|
|
270
|
-
*/
|
|
271
|
-
export declare function clampFireworksKimiMaxTokens(modelId: string, candidate: number): number;
|
|
272
|
-
export declare function clampFireworksKimiMaxTokens(modelId: string, candidate: number | null): number | null;
|
|
273
|
-
/**
|
|
274
|
-
* Kimi K2.7 Code's documented recommended output budget. Some provider
|
|
275
|
-
* discovery rows report the context-sized `max_completion_tokens` instead.
|
|
276
|
-
*/
|
|
277
|
-
export declare const KIMI_K27_CODE_RECOMMENDED_MAX_TOKENS = 32768;
|
|
278
|
-
export declare function isKimiK27CodeModelId(modelId: string): boolean;
|
|
279
|
-
export declare function clampKimiK27CodeMaxTokens(modelId: string, candidate: number): number;
|
|
280
|
-
export declare function clampKimiK27CodeMaxTokens(modelId: string, candidate: number | null): number | null;
|
|
281
248
|
/**
|
|
282
249
|
* Build the Fireworks Fast seed by projecting each base bundled spec into a
|
|
283
250
|
* `<id>-fast` variant. Pushed into the generated catalog (Fast routers never
|
|
@@ -655,6 +622,11 @@ export interface ModelsDevProviderDescriptor {
|
|
|
655
622
|
}
|
|
656
623
|
/** Generic mapper that converts models.dev data using provider descriptors. */
|
|
657
624
|
export declare function mapModelsDevToModels(data: Record<string, unknown>, descriptors: readonly ModelsDevProviderDescriptor[]): ModelSpec<Api>[];
|
|
625
|
+
/**
|
|
626
|
+
* OpenCode Go endpoint for one request API. The model generator re-bases
|
|
627
|
+
* previous-snapshot rows with it so retained rows follow endpoint moves.
|
|
628
|
+
*/
|
|
629
|
+
export declare function openCodeGoBaseUrlForApi(api: Api): string;
|
|
658
630
|
/** Resolves the transport and endpoint for one Z.AI model catalog entry. */
|
|
659
631
|
export declare function resolveZaiApi(modelId: string): {
|
|
660
632
|
api: "anthropic-messages" | "openai-completions";
|
package/dist/types/types.d.ts
CHANGED
|
@@ -93,6 +93,14 @@ export interface ThinkingConfig {
|
|
|
93
93
|
* provides an explicit wire off-path.
|
|
94
94
|
*/
|
|
95
95
|
requiresEffort?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* The catalog has no evidence this model reasons (unclassified id, no
|
|
98
|
+
* capability metadata). The ladder is offered for the user to opt into:
|
|
99
|
+
* sessions leave thinking unset until the user picks an effort, and a
|
|
100
|
+
* request without an effort goes out as non-reasoning (see
|
|
101
|
+
* `withoutUnverifiedThinking`).
|
|
102
|
+
*/
|
|
103
|
+
unverified?: boolean;
|
|
96
104
|
}
|
|
97
105
|
export type Provider = string;
|
|
98
106
|
/** Token budgets for each thinking level (token-based providers only) */
|
|
@@ -443,6 +451,8 @@ export interface OpenAICompat {
|
|
|
443
451
|
reasoningDeltasMayBeCumulative?: boolean;
|
|
444
452
|
/** Strip leaked DeepSeek chat-template special tokens from visible content deltas. Default: auto-detected. */
|
|
445
453
|
stripDeepseekSpecialTokens?: boolean;
|
|
454
|
+
/** Drop assistant thinking blocks from replayed chat-completions history. Default: false. */
|
|
455
|
+
stripThinkingHistory?: boolean;
|
|
446
456
|
/** Heal leaked chat-template/tool-call/thinking markup from visible content deltas. Default: auto-detected. */
|
|
447
457
|
streamMarkupHealingPattern?: OpenAIStreamMarkupHealingPattern;
|
|
448
458
|
/** Whether this wire may revise already-streamed text (`stream-revision` axis). Unassigned: append-only. */
|
|
@@ -492,6 +502,14 @@ export interface AnthropicCompat {
|
|
|
492
502
|
* contract instead. Default: false.
|
|
493
503
|
*/
|
|
494
504
|
firstPartyProvider?: boolean;
|
|
505
|
+
/**
|
|
506
|
+
* Whether the provider honors Claude Code's `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS`
|
|
507
|
+
* kill switch, which withholds pre-release fields (`context_management`, beta
|
|
508
|
+
* tool fields, task budgets, structured-output format, `thinking.block_binding`,
|
|
509
|
+
* server compaction) with their betas. Rule-owned on the
|
|
510
|
+
* provider whose `ANTHROPIC_*` env routing Claude Code shares. Default: false.
|
|
511
|
+
*/
|
|
512
|
+
honorsClaudeCodeBetaKillSwitch?: boolean;
|
|
495
513
|
/**
|
|
496
514
|
* Whether requests may carry `output_config.effort` (and its effort beta
|
|
497
515
|
* header). Vertex AI rejects the field/header. Default: true.
|
|
@@ -858,12 +876,15 @@ export interface ResolvedOpenAISharedCompat {
|
|
|
858
876
|
* `buildModel`; request handlers read fields and never detect, resolve, or
|
|
859
877
|
* allocate.
|
|
860
878
|
*/
|
|
861
|
-
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" | "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" | "thinkingLoopGuard" | "whenThinking">> & {
|
|
879
|
+
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" | "thinkingLoopGuard" | "whenThinking">> & {
|
|
862
880
|
vercelGatewayRouting?: OpenAICompat["vercelGatewayRouting"];
|
|
863
881
|
extraBody?: OpenAICompat["extraBody"];
|
|
864
882
|
cacheControlFormat?: OpenAICompat["cacheControlFormat"];
|
|
865
883
|
thinkingKeep?: OpenAICompat["thinkingKeep"];
|
|
866
884
|
streamIdleTimeoutMs?: number;
|
|
885
|
+
stripThinkingHistory?: boolean;
|
|
886
|
+
/** The configured `baseUrl` is the official OpenAI API (provider `openai`); unset otherwise. */
|
|
887
|
+
officialEndpoint?: boolean;
|
|
867
888
|
toolStrictMode: ResolvedToolStrictMode;
|
|
868
889
|
/** The model sits behind Vercel AI Gateway. */
|
|
869
890
|
isVercelGatewayHost: boolean;
|
|
@@ -928,9 +949,11 @@ export interface ResolvedOpenAIResponsesCompat extends ResolvedOpenAISharedCompa
|
|
|
928
949
|
isVercelGatewayHost: boolean;
|
|
929
950
|
/**
|
|
930
951
|
* The configured endpoint is first-party OpenAI (`provider === "openai"` on
|
|
931
|
-
* an `api.openai.com` or unset baseUrl)
|
|
932
|
-
*
|
|
933
|
-
*
|
|
952
|
+
* an `api.openai.com` or unset baseUrl), or the Codex backend
|
|
953
|
+
* (`openai-codex-responses` on the default Codex baseUrl). Gates platform
|
|
954
|
+
* OpenAI's official-only Responses behavior (default-on stateful
|
|
955
|
+
* `previous_response_id` chaining and the `text.verbosity` field; the Codex
|
|
956
|
+
* adapter is not governed by either gate) and host request-size budgets.
|
|
934
957
|
*/
|
|
935
958
|
officialEndpoint: boolean;
|
|
936
959
|
/** Run Harmony-protocol leak detection/mitigation on streamed output. */
|
|
@@ -1055,23 +1078,43 @@ export interface GoogleCompat {
|
|
|
1055
1078
|
antigravityUsageLabel?: string;
|
|
1056
1079
|
/** Strip image inputs before encoding (text-only serving of a multimodal id). */
|
|
1057
1080
|
stripImageInput?: boolean;
|
|
1081
|
+
/**
|
|
1082
|
+
* Largest width or height a single image may carry for a Claude reader on
|
|
1083
|
+
* this host (see {@link AnthropicCompat.maxImageDimension}). Setting this or
|
|
1084
|
+
* {@link maxImagePayloadBytes} turns on Claude's image clamp, many-image
|
|
1085
|
+
* cap included; unset leaves images as sent.
|
|
1086
|
+
*/
|
|
1087
|
+
maxImageDimension?: number;
|
|
1088
|
+
/**
|
|
1089
|
+
* Largest base64 payload a single image may carry, in bytes (see
|
|
1090
|
+
* {@link AnthropicCompat.maxImagePayloadBytes}).
|
|
1091
|
+
*/
|
|
1092
|
+
maxImagePayloadBytes?: number;
|
|
1058
1093
|
/** Thinking-loop watchdog guard family applied to streamed reasoning. */
|
|
1059
1094
|
thinkingLoopGuard?: "gemini" | "deepseek" | "xai";
|
|
1060
1095
|
/** See {@link BedrockCompat.supportsSamplingParams}. */
|
|
1061
1096
|
supportsSamplingParams?: boolean;
|
|
1062
1097
|
}
|
|
1063
1098
|
/** Fully-resolved google-API compat view, materialized once by `buildModel`. */
|
|
1064
|
-
export type ResolvedGoogleCompat = Required<Omit<GoogleCompat, "streamFirstEventTimeoutMs" | "streamIdleTimeoutMs" | "thinkingLoopGuard" | "antigravityUsageLabel" | "supportsSamplingParams">> & {
|
|
1099
|
+
export type ResolvedGoogleCompat = Required<Omit<GoogleCompat, "streamFirstEventTimeoutMs" | "streamIdleTimeoutMs" | "thinkingLoopGuard" | "antigravityUsageLabel" | "supportsSamplingParams" | "maxImageDimension" | "maxImagePayloadBytes">> & {
|
|
1065
1100
|
streamFirstEventTimeoutMs?: number;
|
|
1066
1101
|
streamIdleTimeoutMs?: number;
|
|
1067
1102
|
thinkingLoopGuard?: GoogleCompat["thinkingLoopGuard"];
|
|
1068
1103
|
antigravityUsageLabel?: string;
|
|
1069
1104
|
supportsSamplingParams?: boolean;
|
|
1105
|
+
maxImageDimension?: number;
|
|
1106
|
+
maxImagePayloadBytes?: number;
|
|
1070
1107
|
};
|
|
1108
|
+
/** Ollama chat history compatibility resolved by the catalog. */
|
|
1109
|
+
export interface OllamaCompat {
|
|
1110
|
+
/** Omit assistant thinking when the deployment rejects it in history. */
|
|
1111
|
+
stripThinkingHistory?: boolean;
|
|
1112
|
+
}
|
|
1113
|
+
export type ResolvedOllamaCompat = Required<OllamaCompat>;
|
|
1071
1114
|
/** Sparse, user-authored compat overrides for a given API (models.json / config vocabulary). */
|
|
1072
|
-
export type CompatConfigOf<TApi extends Api> = TApi extends "openai-completions" | "openrouter" | "openai-responses" | "azure-openai-responses" | "openai-codex-responses" ? OpenAICompat : TApi extends "anthropic-messages" ? AnthropicCompat : TApi extends "bedrock-converse-stream" ? BedrockCompat : TApi extends "devin-agent" ? DevinCompat : TApi extends "google-generative-ai" | "google-vertex" | "google-gemini-cli" ? GoogleCompat : undefined;
|
|
1115
|
+
export type CompatConfigOf<TApi extends Api> = TApi extends "openai-completions" | "openrouter" | "openai-responses" | "azure-openai-responses" | "openai-codex-responses" ? OpenAICompat : TApi extends "anthropic-messages" ? AnthropicCompat : TApi extends "bedrock-converse-stream" ? BedrockCompat : TApi extends "devin-agent" ? DevinCompat : TApi extends "google-generative-ai" | "google-vertex" | "google-gemini-cli" ? GoogleCompat : TApi extends "ollama-chat" ? OllamaCompat : undefined;
|
|
1073
1116
|
/** Resolved compat for a given API: complete record, materialized once by `buildModel`. */
|
|
1074
|
-
export type CompatOf<TApi extends Api> = TApi extends "openrouter" ? ResolvedOpenRouterCompat : TApi extends "openai-completions" ? ResolvedOpenAICompat : TApi extends "openai-responses" | "azure-openai-responses" | "openai-codex-responses" ? ResolvedOpenAIResponsesCompat : TApi extends "anthropic-messages" ? ResolvedAnthropicCompat : TApi extends "bedrock-converse-stream" ? ResolvedBedrockCompat : TApi extends "devin-agent" ? ResolvedDevinCompat : TApi extends "google-generative-ai" | "google-vertex" | "google-gemini-cli" ? ResolvedGoogleCompat : undefined;
|
|
1117
|
+
export type CompatOf<TApi extends Api> = TApi extends "openrouter" ? ResolvedOpenRouterCompat : TApi extends "openai-completions" ? ResolvedOpenAICompat : TApi extends "openai-responses" | "azure-openai-responses" | "openai-codex-responses" ? ResolvedOpenAIResponsesCompat : TApi extends "anthropic-messages" ? ResolvedAnthropicCompat : TApi extends "bedrock-converse-stream" ? ResolvedBedrockCompat : TApi extends "devin-agent" ? ResolvedDevinCompat : TApi extends "google-generative-ai" | "google-vertex" | "google-gemini-cli" ? ResolvedGoogleCompat : TApi extends "ollama-chat" ? ResolvedOllamaCompat : undefined;
|
|
1075
1118
|
/** Provider-native compaction endpoint configuration for one model. */
|
|
1076
1119
|
export interface RemoteCompactionConfig<TApi extends Api = Api> {
|
|
1077
1120
|
/** Enables provider-native compaction for providers not enabled by built-in policy. */
|
|
@@ -1145,7 +1188,7 @@ export interface ModelCost extends TokenCost {
|
|
|
1145
1188
|
* generations rather than providers: DeepSeek V3 through V4 share
|
|
1146
1189
|
* `"deepseek-v3"`; Kimi K2 through K3 share `"kimi-k2"`.
|
|
1147
1190
|
*/
|
|
1148
|
-
export type ModelTokenizer = "claude-v3" | "claude-v47" | "claude-v5" | "claude-v5-sonnet" | "qwen3" | "deepseek-v3" | "kimi-k2" | "glm5";
|
|
1191
|
+
export type ModelTokenizer = "claude-v3" | "claude-v47" | "claude-v5" | "claude-v5-sonnet" | "qwen3" | "deepseek-v3" | "kimi-k2" | "glm5" | "o200k";
|
|
1149
1192
|
/** One account's discovered entitlements on a model; see {@link Model.accountAccess}. */
|
|
1150
1193
|
export interface ModelAccountAccess {
|
|
1151
1194
|
/**
|
|
@@ -1198,6 +1241,8 @@ export interface Model<TApi extends Api = Api> {
|
|
|
1198
1241
|
requiresGlyphTokenization?: boolean;
|
|
1199
1242
|
/** Whether this model requires Cursor's tool-schema combiner projection. */
|
|
1200
1243
|
requiresCursorToolSchemaProjection?: boolean;
|
|
1244
|
+
/** Whether advertised tool schemas occupy every model request's context (false for deferred catalogs). */
|
|
1245
|
+
toolSchemasInContext?: boolean;
|
|
1201
1246
|
/** Whether this model requires tool-result images hoisted into sibling user content blocks. */
|
|
1202
1247
|
requiresToolResultImageHoisting?: boolean;
|
|
1203
1248
|
/**
|
|
@@ -1246,6 +1291,12 @@ export interface Model<TApi extends Api = Api> {
|
|
|
1246
1291
|
* than ZETA's general image pipeline. `stb` local backends reject WebP.
|
|
1247
1292
|
*/
|
|
1248
1293
|
imageInputDecoder?: "stb";
|
|
1294
|
+
/**
|
|
1295
|
+
* Most images one request may carry, from user configuration. Replaces the
|
|
1296
|
+
* catalog's `image-count-budget` for hosts no rule names, such as a custom
|
|
1297
|
+
* gateway in front of a vendor with a higher limit.
|
|
1298
|
+
*/
|
|
1299
|
+
imageCountBudget?: number;
|
|
1249
1300
|
/**
|
|
1250
1301
|
* Native provider tool-call support. `false` is the only unsupported signal:
|
|
1251
1302
|
* `true` and `undefined` both mean callers may use native tools. Catalog and
|
|
@@ -1328,6 +1379,8 @@ export interface Model<TApi extends Api = Api> {
|
|
|
1328
1379
|
contextWindow: number | null;
|
|
1329
1380
|
/** Preserve the host's supplied window instead of applying inferred expansion or reference-price caps. */
|
|
1330
1381
|
contextWindowAuthoritative?: boolean;
|
|
1382
|
+
/** The long-context price tier does not cap the runtime context window when extended context is off. */
|
|
1383
|
+
longContextWindowUncapped?: boolean;
|
|
1331
1384
|
/** Optional larger prompt window available when extended context is enabled. */
|
|
1332
1385
|
maxContextWindow?: number;
|
|
1333
1386
|
maxTokens: number | null;
|
|
@@ -1354,7 +1407,7 @@ export interface Model<TApi extends Api = Api> {
|
|
|
1354
1407
|
* Streaming transport override. When `"pi-native"`, `streamSimple` routes
|
|
1355
1408
|
* the request to the model's `baseUrl` via the auth-gateway's
|
|
1356
1409
|
* `POST /v1/pi/stream` endpoint instead of dispatching the per-API
|
|
1357
|
-
* provider client. The `baseUrl` must point at an `
|
|
1410
|
+
* provider client. The `baseUrl` must point at an `zetacode auth-gateway`
|
|
1358
1411
|
* (or compatible) host; `headers.Authorization` (or `apiKey` resolved by
|
|
1359
1412
|
* the registry) carries the gateway bearer.
|
|
1360
1413
|
*
|
|
@@ -1369,8 +1422,6 @@ export interface Model<TApi extends Api = Api> {
|
|
|
1369
1422
|
preferWebsockets?: boolean;
|
|
1370
1423
|
/** Codex Responses Lite transport: send the lite marker and carry instructions/tools as input items (mirrors codex-rs `use_responses_lite`). */
|
|
1371
1424
|
useResponsesLite?: boolean;
|
|
1372
|
-
/** Codex Code Mode restriction: model expects tools routed through a programmatic exec surface (mirrors codex-rs `tool_mode`). */
|
|
1373
|
-
toolMode?: "code_mode_only";
|
|
1374
1425
|
/**
|
|
1375
1426
|
* Service-tier ids the provider advertises for this model (Codex discovery
|
|
1376
1427
|
* `service_tiers[].id`, e.g. `priority`, `ultrafast`). Absent when the
|
|
@@ -1463,7 +1514,7 @@ export interface Model<TApi extends Api = Api> {
|
|
|
1463
1514
|
* vocabulary of `buildModel`. Identical to `Model` except `compat` carries the
|
|
1464
1515
|
* sparse override shape and nothing is resolved yet.
|
|
1465
1516
|
*/
|
|
1466
|
-
export interface ModelSpec<TApi extends Api = Api> extends Omit<Model<TApi>, "compat" | "identity" | "compatConfig" | "requiresGlyphTokenization" | "requiresCursorToolSchemaProjection" | "requiresToolResultImageHoisting" | "supportsAssistantPrefill" | "supportsComputerUseConfig"> {
|
|
1517
|
+
export interface ModelSpec<TApi extends Api = Api> extends Omit<Model<TApi>, "compat" | "identity" | "compatConfig" | "requiresGlyphTokenization" | "requiresCursorToolSchemaProjection" | "toolSchemasInContext" | "requiresToolResultImageHoisting" | "supportsAssistantPrefill" | "supportsComputerUseConfig"> {
|
|
1467
1518
|
/** Sparse compatibility overrides; resolved into `Model.compat` by `buildModel`. */
|
|
1468
1519
|
compat?: CompatConfigOf<TApi>;
|
|
1469
1520
|
}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* Constants for OpenAI Codex (ChatGPT OAuth) backend
|
|
3
3
|
*/
|
|
4
4
|
export declare const CODEX_BASE_URL = "https://chatgpt.com/backend-api";
|
|
5
|
+
/** Strict official-Codex endpoint check; exact origin or a path boundary after {@link CODEX_BASE_URL}. */
|
|
6
|
+
export declare function isOfficialCodexApiUrl(baseUrl: string | undefined): boolean;
|
|
5
7
|
/**
|
|
6
8
|
* Pinned OpenAI Codex client version (corresponds to @openai/codex package version).
|
|
7
9
|
* Updated from npm by `bun run check-spoofed-versions --update`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linxiraos/pi-catalog",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Model catalog for omp: bundled model database, provider discovery descriptors, model identity, classification, and equivalence",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|
|
82
82
|
"check": "oxlint . && oxfmt --check --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts' && bun run check:types",
|
|
83
|
-
"check:types": "
|
|
83
|
+
"check:types": "tsc -p tsconfig.json --noEmit",
|
|
84
84
|
"lint": "oxlint .",
|
|
85
85
|
"test": "bun test --parallel",
|
|
86
86
|
"fix": "oxlint --fix --fix-suggestions . && bun run fmt",
|
|
@@ -90,13 +90,13 @@
|
|
|
90
90
|
"gen:proto": "bun scripts/generate-protocols.ts"
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"@linxiraos/pi-omptype": "1.
|
|
94
|
-
"@linxiraos/pi-utils": "1.
|
|
93
|
+
"@linxiraos/pi-omptype": "1.3.0",
|
|
94
|
+
"@linxiraos/pi-utils": "1.3.0"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
97
|
"@bgotink/kdl": "0.4.0",
|
|
98
|
-
"@linxiraos/pi-ai": "1.
|
|
99
|
-
"@types/bun": "
|
|
98
|
+
"@linxiraos/pi-ai": "1.3.0",
|
|
99
|
+
"@types/bun": "1.4.3"
|
|
100
100
|
},
|
|
101
101
|
"engines": {
|
|
102
102
|
"bun": ">=1.3.14"
|
package/src/build.d.ts
CHANGED
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
import { type Api, type Model, type ModelSpec } from "./types";
|
|
10
10
|
/**
|
|
11
11
|
* Applies reviewed catalog-data value corrections (`cost-patch`,
|
|
12
|
-
* `cache-read-at-input-rate`, `
|
|
13
|
-
* `context-window-floor`, `input-modalities`) onto an
|
|
12
|
+
* `cache-read-at-input-rate`, `cache-write-rate`, `limits-patch`,
|
|
13
|
+
* `long-context-cost`, `context-window-floor`, `input-modalities`) onto an
|
|
14
|
+
* upstream-sourced spec. Applied by
|
|
14
15
|
* `buildModel` to every upstream-sourced spec; user-authored overrides are
|
|
15
16
|
* recomposed after building by the override applicators, so explicit user
|
|
16
17
|
* limits and pricing still win.
|