@shop-os/modelkit 0.2.4 → 0.2.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
@@ -9,6 +9,18 @@ header in the release PR.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.2.6] - 2026-09-15
13
+
14
+ ### Changed
15
+
16
+ - `gemini-omni-flash` and `gemini-omni-1.1-flash` declare `references.videos: 1`. Omni does not reference across several clips, and every runner already sent only the first, so the extra slots were silently dropped.
17
+ - `grok-imagine` declares `references.images: 5` and the xAI adapter caps at 5, the limit xAI documents per request.
18
+
19
+ ## [0.2.5] - 2026-09-15
20
+
21
+ ### Changed
22
+ - `Catalog.list()` returns rows in picker order: `display.sortOrder` descending, rows without one after the ordered ones, then `label` ascending (case-insensitive), then `id`. pro-backend orders its query the same way. Before, the order was the insertion order of the primed rows (pro-backend heap order), so an edited row moved to the end of every picker. `compareCatalogOrder` and `sortCatalogRows` are exported from the root and `/catalog` entries for consumers that sort their own lists.
23
+
12
24
  ## [0.2.4] - 2026-09-15
13
25
 
14
26
  ### Fixed
package/dist/catalog.cjs CHANGED
@@ -30,6 +30,7 @@ __export(catalog_entry_exports, {
30
30
  OTHER_MODELS: () => OTHER_MODELS,
31
31
  TEXT_MODELS: () => TEXT_MODELS,
32
32
  VIDEO_MODELS: () => VIDEO_MODELS,
33
+ compareCatalogOrder: () => compareCatalogOrder,
33
34
  isModelKitError: () => isModelKitError,
34
35
  liveCatalog: () => liveCatalog,
35
36
  liveState: () => liveState,
@@ -39,7 +40,8 @@ __export(catalog_entry_exports, {
39
40
  resolveAudioOptions: () => resolveAudioOptions,
40
41
  resolveImageOptions: () => resolveImageOptions,
41
42
  resolveOptions: () => resolveOptions,
42
- resolveVideoOptions: () => resolveVideoOptions
43
+ resolveVideoOptions: () => resolveVideoOptions,
44
+ sortCatalogRows: () => sortCatalogRows
43
45
  });
44
46
  module.exports = __toCommonJS(catalog_entry_exports);
45
47
 
@@ -69,6 +71,22 @@ function isModelKitError(err) {
69
71
  return err instanceof ModelKitError;
70
72
  }
71
73
 
74
+ // src/catalog/order.ts
75
+ function compareCatalogOrder(a, b) {
76
+ const sa = a.display?.sortOrder;
77
+ const sb = b.display?.sortOrder;
78
+ if (sa !== void 0 && sb !== void 0 && sa !== sb) return sb - sa;
79
+ if (sa !== void 0 && sb === void 0) return -1;
80
+ if (sa === void 0 && sb !== void 0) return 1;
81
+ return compareText(a.label.toLowerCase(), b.label.toLowerCase()) || compareText(a.id, b.id);
82
+ }
83
+ function compareText(a, b) {
84
+ return a < b ? -1 : a > b ? 1 : 0;
85
+ }
86
+ function sortCatalogRows(rows) {
87
+ return [...rows].sort(compareCatalogOrder);
88
+ }
89
+
72
90
  // src/catalog/registry.ts
73
91
  var Catalog = class _Catalog {
74
92
  byId = /* @__PURE__ */ new Map();
@@ -125,11 +143,12 @@ var Catalog = class _Catalog {
125
143
  }
126
144
  return model;
127
145
  }
146
+ /** Rows in picker order: `display.sortOrder` descending, then label. See `compareCatalogOrder`. */
128
147
  list(filter = {}) {
129
148
  const lifecycles = filter.lifecycle ?? ["active"];
130
149
  return [...this.byId.values()].filter(
131
150
  (m) => (filter.type ? m.type === filter.type : true) && lifecycles.includes(m.lifecycle)
132
- );
151
+ ).sort(compareCatalogOrder);
133
152
  }
134
153
  /** Merge rows by id. Used for catalogOverride. */
135
154
  withOverrides(rows) {
@@ -1367,7 +1386,7 @@ var VIDEO_MODELS = [
1367
1386
  // reference clip keeps its own framing.
1368
1387
  aspectRatios: [...OMNI_RATIOS],
1369
1388
  durations: [3, 4, 5, 6, 7, 8, 9, 10],
1370
- references: { images: 6, videos: 3 },
1389
+ references: { images: 6, videos: 1 },
1371
1390
  supports: []
1372
1391
  },
1373
1392
  defaults: {},
@@ -1393,7 +1412,7 @@ var VIDEO_MODELS = [
1393
1412
  aspectRatios: [...OMNI_RATIOS],
1394
1413
  resolutions: ["360p", "720p", "1080p", "4k"],
1395
1414
  durations: [3, 4, 5, 6, 7, 8, 9, 10],
1396
- references: { images: 6, videos: 3 },
1415
+ references: { images: 6, videos: 1 },
1397
1416
  supports: []
1398
1417
  },
1399
1418
  defaults: {},
@@ -1520,7 +1539,7 @@ var VIDEO_MODELS = [
1520
1539
  resolutions: ["480p", "720p"],
1521
1540
  durations: { min: 1, max: 15 },
1522
1541
  durationPresets: [4, 6, 8, 10],
1523
- references: { images: 7 },
1542
+ references: { images: 5 },
1524
1543
  supports: []
1525
1544
  },
1526
1545
  // No resolution default: xAI picks its own unless the caller asks.
@@ -1529,7 +1548,7 @@ var VIDEO_MODELS = [
1529
1548
  pricingKind: "video_per_second",
1530
1549
  display: {
1531
1550
  provider: "xai",
1532
- description: "xAI's reference-to-video model. Generates short clips conditioned on up to 7 reference images with flexible aspect ratios.",
1551
+ description: "xAI's reference-to-video model. Generates short clips conditioned on up to 5 reference images with flexible aspect ratios.",
1533
1552
  logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/858b7fcc-9bd5-411d-aea1-a7b35ecfffab_compressed.png"
1534
1553
  },
1535
1554
  capabilities: { ...FRAMES_EXCLUDE_REFERENCES }