@shop-os/modelkit 0.7.4 → 0.7.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,13 @@ header in the release PR.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.7.6] - Unreleased
13
+
14
+ ENG-3323: one xAI reference-mode rule.
15
+
16
+ ### Changed
17
+ - `xaiReferenceResolution` (kit-internal) now owns "is this request in xAI reference mode" and the 720p cap for both the resolver and the `xai-video` adapter. The adapter no longer keeps its own reference-mode check or its own copy of the refuse/lower rule. Requests, refusals and warnings are unchanged.
18
+
12
19
  ## [0.7.4] - Unreleased
13
20
 
14
21
  ENG-3321: one source of truth for each 3D family's options.
package/dist/catalog.cjs CHANGED
@@ -6401,14 +6401,14 @@ function xaiReferenceMode(model, req) {
6401
6401
  const takesLastFrame = (model.constraints.supports ?? []).includes("lastFrame");
6402
6402
  return (req.referenceImages ?? []).length > 0 || takesLastFrame && req.lastFrame !== void 0;
6403
6403
  }
6404
- function applyXaiVideoRules(model, req, onUnsupported, warnings) {
6405
- if (model.adapter !== "xai-video" || req.resolution !== "1080p") return;
6406
- if (!xaiReferenceMode(model, req)) return;
6404
+ function xaiReferenceResolution(model, req, onUnsupported, warnings, provider) {
6405
+ if (req.resolution !== "1080p" || !xaiReferenceMode(model, req)) return void 0;
6407
6406
  const message = xaiReferenceResolutionMessage(model.id);
6408
6407
  if (onUnsupported === "error") {
6409
6408
  throw new ModelKitError({
6410
6409
  code: "unsupported_option",
6411
6410
  message,
6411
+ ...provider === void 0 ? {} : { provider },
6412
6412
  model: model.id,
6413
6413
  retryable: false
6414
6414
  });
@@ -6420,7 +6420,12 @@ function applyXaiVideoRules(model, req, onUnsupported, warnings) {
6420
6420
  to: XAI_REFERENCE_MAX_RESOLUTION,
6421
6421
  message
6422
6422
  });
6423
- req.resolution = XAI_REFERENCE_MAX_RESOLUTION;
6423
+ return XAI_REFERENCE_MAX_RESOLUTION;
6424
+ }
6425
+ function applyXaiVideoRules(model, req, onUnsupported, warnings) {
6426
+ if (model.adapter !== "xai-video") return;
6427
+ const lowered = xaiReferenceResolution(model, req, onUnsupported, warnings);
6428
+ if (lowered !== void 0) req.resolution = lowered;
6424
6429
  }
6425
6430
  function takesTargetAspectRatio(model) {
6426
6431
  const ratios = model.constraints.aspectRatios ?? [];