@oh-my-pi/pi-catalog 17.1.4 → 17.1.6

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 CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [17.1.6] - 2026-07-27
6
+
7
+ ### Added
8
+
9
+ - Added SiliconFlow providers (`siliconflow`, `siliconflow-cn`) with dynamic-only OpenAI-compatible model discovery: no bundled catalog — the model list is fetched live from each region's `/v1/models` endpoint, with non-chat entries (embedding, reranker, image, audio, video) filtered out. Discovery hydrates pricing, context/output limits, and reasoning metadata from the provider's models.dev catalog at runtime (with bundled upstream references as a reasoning-only fallback for ids models.dev has not indexed), so reasoning models keep thinking enabled and sessions compact against real context windows. `SILICONFLOW_API_KEY` / `SILICONFLOW_CN_API_KEY` environment variables are wired into `getEnvApiKey`.
10
+
11
+ ## [17.1.5] - 2026-07-27
12
+
13
+ ### Fixed
14
+
15
+ - Fixed Kimi Code (`kimi-code`) reporting `maxTokens: 32000` for every model — its `/coding/v1/models` discovery mapper and the bundled catalog applied a blanket constant, truncating `k3`/`k3-256k` output at ~4x below their real 131072 ceiling and `kimi-for-coding`/`kimi-for-coding-highspeed` below their 32768 ceiling. Output caps are now derived per family, and the model cache is invalidated so upgrades drop the stale `maxTokens: 32000` rows (including the discovery-only `k3-256k`) instead of serving them until the next network refresh ([#6711](https://github.com/can1357/oh-my-pi/issues/6711)).
16
+ - Fixed Anthropic model discovery 404ing when the registry derived the provider base URL from a bundled model without the `/v1` suffix (`https://api.anthropic.com/models` instead of `/v1/models`), which let a stale text-only cache row shadow fresh models.dev vision metadata — surfacing as snapcompact refusing to run on `claude-opus-5`. Discovery now always targets `/v1/models` while model rows keep the provider base URL ([#6563](https://github.com/can1357/oh-my-pi/issues/6563)).
17
+
5
18
  ## [17.1.4] - 2026-07-26
6
19
 
7
20
  ### Added
@@ -7,5 +7,12 @@ import type { ModelSpec, ResolvedAnthropicCompat } from "../types.js";
7
7
  * prefix check would accept lookalikes like `https://api.anthropic.com.evil.com`.
8
8
  */
9
9
  export declare function isOfficialAnthropicApiUrl(baseUrl?: string): boolean;
10
+ /**
11
+ * Known non-official URLs that enforce Anthropic thinking signatures on replay.
12
+ *
13
+ * Runtime routing calls this with the effective URL because a model's resolved
14
+ * compat can be stale after Foundry or a provider base-URL override reroutes it.
15
+ */
16
+ export declare function isAnthropicSigningProxyUrl(baseUrl?: string): boolean;
10
17
  /** Build the resolved anthropic-messages compat record for a model spec. */
11
18
  export declare function buildAnthropicCompat(spec: ModelSpec<"anthropic-messages">): ResolvedAnthropicCompat;
@@ -8,4 +8,6 @@ import type { Api, Model, ModelSpec } from "../types.js";
8
8
  */
9
9
  export declare function toModelSpec<TApi extends Api>(model: Model<TApi>): ModelSpec<TApi>;
10
10
  export declare function createBundledReferenceMap<TApi extends Api>(provider: Parameters<typeof getBundledModels>[0]): Map<string, ModelSpec<TApi>>;
11
- export declare function createReferenceResolver<TApi extends Api>(providerRefs: Map<string, ModelSpec<TApi>>): (modelId: string) => ModelSpec<TApi> | undefined;
11
+ type ProviderReferenceSource<TApi extends Api> = Map<string, ModelSpec<TApi>> | (() => Map<string, ModelSpec<TApi>>);
12
+ export declare function createReferenceResolver<TApi extends Api>(providerReferenceSource: ProviderReferenceSource<TApi>): (modelId: string) => ModelSpec<TApi> | undefined;
13
+ export {};
@@ -0,0 +1,7 @@
1
+ export interface ModelCacheProviderIdOptions {
2
+ apiKey?: string;
3
+ baseUrl?: string;
4
+ }
5
+ export declare function getDefaultModelDiscoveryBaseUrl(providerId: string): string | undefined;
6
+ /** Resolve the cache namespace used by a provider's model-manager options without constructing those options. */
7
+ export declare function resolveModelCacheProviderId(providerId: string, options?: ModelCacheProviderIdOptions): string;
@@ -323,6 +323,18 @@ export declare const CATALOG_PROVIDERS: readonly [{
323
323
  readonly catalogDiscovery: {
324
324
  readonly label: "Sakana AI";
325
325
  };
326
+ }, {
327
+ readonly id: "siliconflow";
328
+ readonly defaultModel: "zai-org/GLM-5.1";
329
+ readonly envVars: readonly ["SILICONFLOW_API_KEY"];
330
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("../index.js").ModelManagerOptions<"openai-completions", unknown>;
331
+ readonly dynamicModelsAuthoritative: true;
332
+ }, {
333
+ readonly id: "siliconflow-cn";
334
+ readonly defaultModel: "deepseek-ai/DeepSeek-V4-Pro";
335
+ readonly envVars: readonly ["SILICONFLOW_CN_API_KEY"];
336
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("../index.js").ModelManagerOptions<"openai-completions", unknown>;
337
+ readonly dynamicModelsAuthoritative: true;
326
338
  }, {
327
339
  readonly id: "synthetic";
328
340
  readonly defaultModel: "hf:zai-org/GLM-5.1";
@@ -1,3 +1,4 @@
1
+ export * from "./cache-provider-id.js";
1
2
  export * from "./descriptor-types.js";
2
3
  export * from "./descriptors.js";
3
4
  export * from "./google.js";
@@ -166,6 +166,14 @@ export interface DeepSeekModelManagerConfig {
166
166
  fetch?: FetchImpl;
167
167
  }
168
168
  export declare function deepseekModelManagerOptions(config?: DeepSeekModelManagerConfig): ModelManagerOptions<"openai-completions">;
169
+ export interface SiliconFlowModelManagerConfig {
170
+ apiKey?: string;
171
+ baseUrl?: string;
172
+ fetch?: FetchImpl;
173
+ }
174
+ export declare function isLikelySiliconFlowChatModelId(id: string): boolean;
175
+ export declare function siliconflowModelManagerOptions(config?: SiliconFlowModelManagerConfig): ModelManagerOptions<"openai-completions">;
176
+ export declare function siliconflowCnModelManagerOptions(config?: SiliconFlowModelManagerConfig): ModelManagerOptions<"openai-completions">;
169
177
  export interface ZhipuCodingPlanModelManagerConfig {
170
178
  apiKey?: string;
171
179
  baseUrl?: string;
@@ -319,6 +327,22 @@ export interface KimiCodeModelManagerConfig {
319
327
  baseUrl?: string;
320
328
  fetch?: FetchImpl;
321
329
  }
330
+ /**
331
+ * Kimi Code output ceilings by model family. The `/coding/v1/models` discovery
332
+ * envelope carries no output-limit field, so the mapper supplies the documented
333
+ * per-family caps instead of a blanket constant. Values match models.dev's
334
+ * `kimi-for-coding` and `moonshotai` kimi-k3 entries. See #6711.
335
+ */
336
+ export declare const KIMI_CODE_K3_MAX_TOKENS = 131072;
337
+ export declare const KIMI_CODE_FOR_CODING_MAX_TOKENS = 32768;
338
+ /** Fallback output cap for Kimi Code families without a documented ceiling (legacy K2 discovery rows). */
339
+ export declare const KIMI_CODE_DEFAULT_MAX_TOKENS = 32000;
340
+ /**
341
+ * Resolve a Kimi Code model's output ceiling from its id: `k3` / `k3-256k` ->
342
+ * 131072, `kimi-for-coding[-highspeed]` -> 32768, everything else -> `fallback`.
343
+ */
344
+ export declare function kimiCodeMaxTokens(modelId: string, fallback?: number): number;
345
+ export declare function kimiCodeMaxTokens(modelId: string, fallback: number | null): number | null;
322
346
  export declare function kimiCodeModelManagerOptions(config?: KimiCodeModelManagerConfig): ModelManagerOptions<"openai-completions">;
323
347
  /** Native LM Studio metadata keyed by model id from `/api/v0/models`. */
324
348
  export interface LmStudioNativeModelMetadata {
@@ -432,6 +432,20 @@ export interface AnthropicCompat {
432
432
  * blocks instead of normal `tool_use` calls.
433
433
  */
434
434
  escapeBuiltinToolNames?: boolean;
435
+ /**
436
+ * The configured endpoint enforces Anthropic's signature protocol on
437
+ * replayed thinking blocks — either the official API itself or a proxy
438
+ * that forwards to it (GitHub Copilot, ZenMux, Cloudflare AI Gateway's
439
+ * `/anthropic` route, Google Vertex's `publishers/anthropic/…`).
440
+ * Downstream transforms strip stale cross-model thinking signatures on
441
+ * these endpoints so the signing proxy doesn't 400 with
442
+ * `Invalid signature in thinking block` (#4297), and adaptive-thinking
443
+ * models keep the interleaved-thinking beta on them (#6717). Known hosts
444
+ * are auto-detected from provider id and baseUrl; set this to mark an
445
+ * opaque signing proxy the URL list can't recognize. Superset of
446
+ * {@link ResolvedAnthropicCompat.officialEndpoint}.
447
+ */
448
+ signingEndpoint?: boolean;
435
449
  }
436
450
  /**
437
451
  * Compatibility settings for Bedrock Converse prompt caching. Cache pricing is
@@ -597,17 +611,6 @@ export type ResolvedAnthropicCompat = Required<AnthropicCompat> & {
597
611
  * env headers, and cache-TTL shaping without per-request URL parsing.
598
612
  */
599
613
  officialEndpoint: boolean;
600
- /**
601
- * The configured endpoint enforces Anthropic's signature protocol on
602
- * replayed thinking blocks — either the official API itself or a proxy
603
- * that forwards to it (GitHub Copilot, ZenMux, Cloudflare AI Gateway's
604
- * `/anthropic` route, Google Vertex's `publishers/anthropic/…`).
605
- * Downstream transforms strip stale cross-model thinking signatures on
606
- * these endpoints so the signing proxy doesn't 400 with
607
- * `Invalid signature in thinking block` (#4297). Superset of
608
- * {@link officialEndpoint}.
609
- */
610
- signingEndpoint: boolean;
611
614
  };
612
615
  /**
613
616
  * Compatibility settings for the devin-agent (Codeium Cascade) API. Cascade
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-catalog",
4
- "version": "17.1.4",
4
+ "version": "17.1.6",
5
5
  "description": "Model catalog for omp: bundled model database, provider discovery descriptors, model identity, classification, and equivalence",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
@@ -34,12 +34,12 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@bufbuild/protobuf": "^2.12.1",
37
- "@oh-my-pi/pi-utils": "17.1.4",
37
+ "@oh-my-pi/pi-utils": "17.1.6",
38
38
  "arktype": "2.2.3",
39
39
  "zod": "^4"
40
40
  },
41
41
  "devDependencies": {
42
- "@oh-my-pi/pi-ai": "17.1.4",
42
+ "@oh-my-pi/pi-ai": "17.1.6",
43
43
  "@types/bun": "^1.3.14"
44
44
  },
45
45
  "engines": {
@@ -4,7 +4,7 @@
4
4
  * defaults come from provider ids, strict host checks, and model-id
5
5
  * classification, with explicit spec overrides assigned on top.
6
6
  */
7
- import { modelMatchesHost } from "../hosts";
7
+ import { hostMatchesUrl, modelMatchesHost } from "../hosts";
8
8
  import {
9
9
  hasOpus47ApiRestrictions,
10
10
  isAnthropicFableOrMythosModel,
@@ -96,6 +96,23 @@ function isAzureAnthropicRoute(baseUrl?: string): boolean {
96
96
  return baseUrl !== undefined && AZURE_ANTHROPIC_URL_MARKER.test(baseUrl);
97
97
  }
98
98
 
99
+ /**
100
+ * Known non-official URLs that enforce Anthropic thinking signatures on replay.
101
+ *
102
+ * Runtime routing calls this with the effective URL because a model's resolved
103
+ * compat can be stale after Foundry or a provider base-URL override reroutes it.
104
+ */
105
+ export function isAnthropicSigningProxyUrl(baseUrl?: string): boolean {
106
+ return (
107
+ hostMatchesUrl(baseUrl, "githubCopilot") ||
108
+ hostMatchesUrl(baseUrl, "zenmux") ||
109
+ isCloudflareAnthropicGateway(baseUrl) ||
110
+ isVertexAnthropicRoute(baseUrl) ||
111
+ isBedrockAnthropicRoute(baseUrl) ||
112
+ isAzureAnthropicRoute(baseUrl)
113
+ );
114
+ }
115
+
99
116
  /** Build the resolved anthropic-messages compat record for a model spec. */
100
117
  export function buildAnthropicCompat(spec: ModelSpec<"anthropic-messages">): ResolvedAnthropicCompat {
101
118
  const baseUrl = spec.baseUrl;
@@ -113,11 +130,8 @@ export function buildAnthropicCompat(spec: ModelSpec<"anthropic-messages">): Res
113
130
  // (issue #4192).
114
131
  const isZenmux = modelMatchesHost(spec, "zenmux");
115
132
  const requiresThinkingEnabled = modelMatchesHost(spec, "moonshotNative") && matchesKimiMandatoryThinkingModel(spec);
116
- const isVertex = isVertexAnthropicRoute(baseUrl);
117
- const isBedrock = isBedrockAnthropicRoute(baseUrl);
118
133
  const isAzure = isAzureAnthropicRoute(baseUrl);
119
- const signingEndpoint =
120
- official || isCopilot || isZenmux || isCloudflareAnthropicGateway(baseUrl) || isVertex || isBedrock || isAzure;
134
+ const signingEndpoint = official || isCopilot || isZenmux || isAnthropicSigningProxyUrl(baseUrl);
121
135
  const compat: ResolvedAnthropicCompat = {
122
136
  officialEndpoint: official,
123
137
  signingEndpoint,
@@ -9,8 +9,10 @@ import type { Api, Model, ModelSpec } from "./types";
9
9
  // Rows persist ModelSpec JSON (sparse `compat`, never the resolved record);
10
10
  // the model manager rebuilds via `buildModel` on load. Request headers are
11
11
  // intentionally omitted: arbitrary provider-defined header names can carry
12
- // credentials. v11 invalidates rows that may persist derived computer-use
13
- // support without provenance; v10 deletes rows that may contain persisted
12
+ // credentials. v12 invalidates Kimi Code rows carrying the blanket
13
+ // maxTokens: 32000 that predate per-family output caps (k3/k3-256k -> 131072,
14
+ // kimi-for-coding[-highspeed] -> 32768, #6711); v11 invalidates rows that may
15
+ // persist derived computer-use
14
16
  // headers and records which model ids lost headers or cannot be rebuilt.
15
17
  // v9 invalidated Kimi Code rows predating live effort and protocol metadata;
16
18
  // v8 invalidated Codex discovery rows predating provider-native V2 compaction
@@ -20,7 +22,7 @@ import type { Api, Model, ModelSpec } from "./types";
20
22
  // retired unknown-limit sentinels (222222/8888); v5 invalidated rows predating
21
23
  // effort-tier variant collapsing (raw `-low`/`-high`/`-thinking` member ids);
22
24
  // v4 dropped the pre-efforts ThinkingConfig shape.
23
- const CACHE_SCHEMA_VERSION = 11;
25
+ const CACHE_SCHEMA_VERSION = 12;
24
26
  const HEADER_RESTORE_VERSION = 1;
25
27
 
26
28
  interface CacheRow {