@agentproto/catalog-sync 0.6.1 → 0.7.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/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export { llmOpenRouterGenerator } from './generators/llm-openrouter.js';
5
5
  export { llmRequestyGenerator } from './generators/llm-requesty.js';
6
6
  export { llmOpencodeGoGenerator, llmOpencodeZenGenerator } from './generators/llm-opencode.js';
7
7
  export { CatalogFileDiff, RefreshableSource, ReviewedRefreshOptions, ReviewedRefreshResult, SourceRefreshResult, refreshSources, reviewedRefresh } from './refresh-workflow.js';
8
- export { OPENAI_LLM_SOURCE, OPENAI_SOURCES } from './sources/openai.js';
8
+ export { OPENAI_LLM_SOURCE, OPENAI_MODELS_SOURCE, OPENAI_PRICING_SOURCE, OPENAI_SOURCES } from './sources/openai.js';
9
9
 
10
10
  declare const llmHuggingfaceGenerator: CatalogGenerator;
11
11
 
package/dist/index.mjs CHANGED
@@ -180,6 +180,13 @@ async function runGenerators(gens, opts) {
180
180
  ...src.body !== void 0 ? { body: JSON.stringify(src.body) } : {}
181
181
  });
182
182
  if (!res.ok) {
183
+ if (existing !== void 0) {
184
+ process.stderr.write(
185
+ `catalog-sync: skipping refresh of "${src.id}" \u2014 fetch ${src.url} failed: ${res.status} ${res.statusText}; reusing committed snapshot.
186
+ `
187
+ );
188
+ return JSON.parse(existing);
189
+ }
183
190
  throw new Error(
184
191
  `catalog-sync: fetch ${src.url} failed: ${res.status} ${res.statusText}`
185
192
  );
@@ -1435,16 +1442,29 @@ async function reviewedRefresh(gens, refreshableSources, opts) {
1435
1442
  }
1436
1443
 
1437
1444
  // src/sources/openai.ts
1438
- var OPENAI_LLM_SOURCE = {
1445
+ var OPENAI_MODELS_SOURCE = {
1439
1446
  source: {
1440
1447
  id: "llm-openai",
1441
- url: "https://openai.com/api/pricing"
1448
+ url: "https://api.openai.com/v1/models",
1449
+ headers: { Authorization: "Bearer env:OPENAI_API_KEY" }
1442
1450
  },
1443
- refreshable: false,
1444
- notes: "OpenAI has no stable machine-readable pricing endpoint. Pricing in @agentproto/model-catalog is committed manually from openai.com/api/pricing and verified against independent aggregators where possible. Automated refresh is disabled to avoid scraping or fabricating prices."
1451
+ refreshable: true,
1452
+ notes: "Authoritative OpenAI model id list. Carries no pricing and no context window, so it is merged with a price source rather than used alone. Without OPENAI_API_KEY the sync falls back to OpenRouter's openai/* ids."
1445
1453
  };
1446
- var OPENAI_SOURCES = [OPENAI_LLM_SOURCE];
1454
+ var OPENAI_PRICING_SOURCE = {
1455
+ source: {
1456
+ id: "llm-openai-pricing",
1457
+ url: "https://platform.openai.com/docs/pricing.md"
1458
+ },
1459
+ refreshable: true,
1460
+ notes: "OpenAI's own Markdown rendering of the pricing page (text/markdown, GFM tables). Parsed by column name and sanity-checked before use; on a page restructure the sync falls back to OpenRouter passthrough rates and says so in the generated file's banner."
1461
+ };
1462
+ var OPENAI_LLM_SOURCE = OPENAI_MODELS_SOURCE;
1463
+ var OPENAI_SOURCES = [
1464
+ OPENAI_MODELS_SOURCE,
1465
+ OPENAI_PRICING_SOURCE
1466
+ ];
1447
1467
 
1448
- export { CATALOG_CHANGELOG_HEADER, CATALOG_CHANGELOG_PATH, OPENAI_LLM_SOURCE, OPENAI_SOURCES, appendChangelog, computeAddedAtLedger, defineGenerator, diffModelIds, extractRecordIds, imageReplicate, isoDateFromUnixSeconds, ledgerAbsPath, ledgerRelPath, llmHuggingfaceGenerator, llmOpenRouterGenerator, llmOpencodeGoGenerator, llmOpencodeZenGenerator, llmRequestyGenerator, readLedger, refreshSources, renderChangelogSection, reviewedRefresh, runGenerators, serializeLedger, todayIso, voiceElevenlabs, voiceMinimax };
1468
+ export { CATALOG_CHANGELOG_HEADER, CATALOG_CHANGELOG_PATH, OPENAI_LLM_SOURCE, OPENAI_MODELS_SOURCE, OPENAI_PRICING_SOURCE, OPENAI_SOURCES, appendChangelog, computeAddedAtLedger, defineGenerator, diffModelIds, extractRecordIds, imageReplicate, isoDateFromUnixSeconds, ledgerAbsPath, ledgerRelPath, llmHuggingfaceGenerator, llmOpenRouterGenerator, llmOpencodeGoGenerator, llmOpencodeZenGenerator, llmRequestyGenerator, readLedger, refreshSources, renderChangelogSection, reviewedRefresh, runGenerators, serializeLedger, todayIso, voiceElevenlabs, voiceMinimax };
1449
1469
  //# sourceMappingURL=index.mjs.map
1450
1470
  //# sourceMappingURL=index.mjs.map