@oh-my-pi/pi-catalog 16.5.1 → 17.0.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 CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [16.5.2] - 2026-07-14
6
+
7
+ ### Fixed
8
+
9
+ - Fixed OpenCode Zen and Go discovery to replace stale bundled models with each provider's live model catalog.
10
+
5
11
  ## [16.5.1] - 2026-07-14
6
12
 
7
13
  ### Fixed
@@ -264,11 +264,13 @@ export declare const CATALOG_PROVIDERS: readonly [{
264
264
  readonly defaultModel: "kimi-k2.7-code";
265
265
  readonly envVars: readonly ["OPENCODE_API_KEY"];
266
266
  readonly createModelManagerOptions: (config: ModelManagerConfig) => import("../index.js").ModelManagerOptions<import("../index.js").Api, unknown>;
267
+ readonly dynamicModelsAuthoritative: true;
267
268
  }, {
268
269
  readonly id: "opencode-zen";
269
270
  readonly defaultModel: "claude-opus-4-8";
270
271
  readonly envVars: readonly ["OPENCODE_API_KEY"];
271
272
  readonly createModelManagerOptions: (config: ModelManagerConfig) => import("../index.js").ModelManagerOptions<import("../index.js").Api, unknown>;
273
+ readonly dynamicModelsAuthoritative: true;
272
274
  }, {
273
275
  readonly id: "openrouter";
274
276
  readonly defaultModel: "openai/gpt-5.5";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-catalog",
4
- "version": "16.5.1",
4
+ "version": "17.0.0",
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": "16.5.1",
37
+ "@oh-my-pi/pi-utils": "17.0.0",
38
38
  "arktype": "2.2.3",
39
39
  "zod": "^4"
40
40
  },
41
41
  "devDependencies": {
42
- "@oh-my-pi/pi-ai": "16.5.1",
42
+ "@oh-my-pi/pi-ai": "17.0.0",
43
43
  "@types/bun": "^1.3.14"
44
44
  },
45
45
  "engines": {
@@ -311,12 +311,14 @@ export const CATALOG_PROVIDERS = [
311
311
  defaultModel: "kimi-k2.7-code",
312
312
  envVars: ["OPENCODE_API_KEY"],
313
313
  createModelManagerOptions: (config: ModelManagerConfig) => opencodeGoModelManagerOptions(config),
314
+ dynamicModelsAuthoritative: true,
314
315
  },
315
316
  {
316
317
  id: "opencode-zen",
317
318
  defaultModel: "claude-opus-4-8",
318
319
  envVars: ["OPENCODE_API_KEY"],
319
320
  createModelManagerOptions: (config: ModelManagerConfig) => opencodeZenModelManagerOptions(config),
321
+ dynamicModelsAuthoritative: true,
320
322
  },
321
323
  {
322
324
  id: "openrouter",
@@ -2036,6 +2036,16 @@ function openCodeBaseUrlForApi(api: Api, basePath: string): string {
2036
2036
  return api === "anthropic-messages" ? basePath : `${basePath}/v1`;
2037
2037
  }
2038
2038
 
2039
+ function openCodeModelCacheProviderId(
2040
+ providerId: "opencode-go" | "opencode-zen",
2041
+ apiKey: string | undefined,
2042
+ discoveryBaseUrl: string,
2043
+ ): string {
2044
+ // OpenCode catalogs are entitlement-scoped; isolate authoritative rows by credential and endpoint.
2045
+ const scope = `${apiKey ?? ""}\u0000${discoveryBaseUrl}`;
2046
+ return `${providerId}:models-v1:${Bun.hash(scope).toString(36)}`;
2047
+ }
2048
+
2039
2049
  function openCodeModelManagerOptions(
2040
2050
  providerId: "opencode-go" | "opencode-zen",
2041
2051
  defaultBasePath: string,
@@ -2047,6 +2057,8 @@ function openCodeModelManagerOptions(
2047
2057
  const references = createBundledReferenceMap<Api>(providerId);
2048
2058
  return {
2049
2059
  providerId,
2060
+ cacheProviderId: openCodeModelCacheProviderId(providerId, apiKey, discoveryBaseUrl),
2061
+ dynamicModelsAuthoritative: true,
2050
2062
  ...(apiKey && {
2051
2063
  fetchDynamicModels: () =>
2052
2064
  fetchOpenAICompatibleModels<Api>({