@agentproto/catalog-sync 0.8.2 → 0.8.3
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/bin.mjs +12 -2
- package/dist/bin.mjs.map +1 -1
- package/dist/generators/llm-opencode.mjs +12 -2
- package/dist/generators/llm-opencode.mjs.map +1 -1
- package/dist/index.mjs +12 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/snapshots/image-replicate.json +80 -80
- package/snapshots/llm-huggingface.json +1948 -1912
- package/snapshots/llm-moonshot.json +3 -3
- package/snapshots/llm-opencode-go.json +5 -0
- package/snapshots/llm-opencode-zen.json +36 -0
- package/snapshots/llm-openrouter.json +839 -1747
- package/snapshots/voice-elevenlabs.json +5157 -5090
package/dist/bin.mjs
CHANGED
|
@@ -388,6 +388,10 @@ var ModelSchema3 = z.object({
|
|
|
388
388
|
family: z.string().optional(),
|
|
389
389
|
/** ISO `YYYY-MM-DD` already — no unix-seconds conversion (cf. Requesty). */
|
|
390
390
|
release_date: z.string().optional(),
|
|
391
|
+
/** Lifecycle flag. `"deprecated"` marks a model the endpoint no longer
|
|
392
|
+
* serves: opencode's own client hides it, and a request for it answers
|
|
393
|
+
* "model not found". Absent on every live model. */
|
|
394
|
+
status: z.string().optional(),
|
|
391
395
|
provider: z.object({
|
|
392
396
|
/** Which AI-SDK package serves this model — the ONLY discriminator
|
|
393
397
|
* for the endpoint's three wire surfaces (see
|
|
@@ -504,7 +508,8 @@ function serializeFile3(endpoint, entries, anthropicIds) {
|
|
|
504
508
|
"// relative to cost.input, and are omitted when the base input price is 0",
|
|
505
509
|
"// (every `-free` variant) because a free model has no cache discount.",
|
|
506
510
|
"// Zero-priced models are KEPT \u2014 on these endpoints zero is the truth, not",
|
|
507
|
-
|
|
511
|
+
'// a missing price. Models the source flags `status: "deprecated"` are',
|
|
512
|
+
"// DROPPED: the endpoint no longer serves them.",
|
|
508
513
|
"// Keys are `<provider>/<bare-id>`, the form opencode's own config uses and",
|
|
509
514
|
"// the form the runtime derives the billing endpoint from; `vendor` is a",
|
|
510
515
|
"// heuristic attribution of the model's BUILDER and is metadata only.",
|
|
@@ -548,6 +553,7 @@ function projectSnapshot(providerKey, provider) {
|
|
|
548
553
|
...model.name !== void 0 ? { name: model.name } : {},
|
|
549
554
|
...model.family !== void 0 ? { family: model.family } : {},
|
|
550
555
|
...model.release_date !== void 0 ? { release_date: model.release_date } : {},
|
|
556
|
+
...model.status !== void 0 ? { status: model.status } : {},
|
|
551
557
|
...model.provider?.npm !== void 0 ? { provider: { npm: model.provider.npm } } : {},
|
|
552
558
|
...model.cost !== void 0 ? {
|
|
553
559
|
cost: {
|
|
@@ -574,8 +580,11 @@ function projectSnapshot(providerKey, provider) {
|
|
|
574
580
|
function snapshotRelPath(ledgerId) {
|
|
575
581
|
return `packages/catalog-sync/snapshots/${ledgerId}.json`;
|
|
576
582
|
}
|
|
583
|
+
function isDeprecated(model) {
|
|
584
|
+
return model.status === "deprecated";
|
|
585
|
+
}
|
|
577
586
|
function anthropicSurfaceIds(models) {
|
|
578
|
-
return Object.entries(models).filter(([, model]) => model.provider?.npm === "@ai-sdk/anthropic").map(([bareId]) => bareId).sort();
|
|
587
|
+
return Object.entries(models).filter(([, model]) => !isDeprecated(model)).filter(([, model]) => model.provider?.npm === "@ai-sdk/anthropic").map(([bareId]) => bareId).sort();
|
|
579
588
|
}
|
|
580
589
|
async function generateFor(endpoint, source, ctx) {
|
|
581
590
|
const parsed = SnapshotSchema3.parse(await ctx.fetchSource(source));
|
|
@@ -589,6 +598,7 @@ async function generateFor(endpoint, source, ctx) {
|
|
|
589
598
|
const entries = {};
|
|
590
599
|
const releasedAt = {};
|
|
591
600
|
for (const [bareId, model] of Object.entries(models)) {
|
|
601
|
+
if (isDeprecated(model)) continue;
|
|
592
602
|
const inputPer1M = model.cost?.input;
|
|
593
603
|
const outputPer1M = model.cost?.output;
|
|
594
604
|
if (inputPer1M === void 0 || outputPer1M === void 0) continue;
|