@shop-os/modelkit 0.23.1 → 0.24.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
@@ -9,6 +9,20 @@ header in the release PR.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.24.0] - Unreleased
13
+
14
+ ### Added
15
+ - `seedance-2.5-draft` (ENG-4106): Seedance 2.5 in BytePlus draft mode, as its own row on the same
16
+ provider model. Every call renders a 480p draft (`draft: true`); the job id is the draft task id.
17
+ A call with `VideoRequest.draftTaskId` renders the final on the same row: the ark adapter sends
18
+ only the `draft_task` item, the resolution (`constraints.draft.finalResolutions`, `1080p`) and
19
+ `watermark`, because BytePlus refuses every inherited field (probed 2026-11-17). The adapter
20
+ refuses `draftTaskId` on a row without `constraints.draft`, another draft resolution, a task type
21
+ on the draft row and a final outside `finalResolutions` before any call. The row ships with no
22
+ exposure (internal); `constraints.draft` is a loose object, so older kits keep the row.
23
+ `resolveVideoOptions` gives a final (`draftTaskId`) the first of `finalResolutions` and checks
24
+ it against them, not against the row's draft-only `resolutions` or its 480p default.
25
+
12
26
  ## [0.23.1] - Unreleased
13
27
 
14
28
  ### Changed
package/dist/catalog.cjs CHANGED
@@ -6433,6 +6433,54 @@ var VIDEO_MODELS = [
6433
6433
  },
6434
6434
  capabilities: { acceptsSourceVideo: true, videoEdit: true, ...FRAMES_EXCLUDE_REFERENCES }
6435
6435
  },
6436
+ {
6437
+ // The same BytePlus model in draft mode. Probed 2026-11-17: a draft must be 480p; its
6438
+ // final is a second task on this row (draftTaskId), and 720p or no resolution is refused
6439
+ // there. A 4k final also rendered, but the docs list 1080p only. No alias for the provider
6440
+ // id: that alias resolves usage to seedance-2.5. Edit and extend stay on seedance-2.5.
6441
+ id: "seedance-2.5-draft",
6442
+ aliases: ["seedance-2-5-draft"],
6443
+ label: "Seedance 2.5 Draft",
6444
+ type: "video",
6445
+ adapter: "ark",
6446
+ providerModelId: "dreamina-seedance-2-5-260628",
6447
+ lifecycle: "active",
6448
+ exposure: [],
6449
+ constraints: {
6450
+ aspectRatios: [...SEEDANCE_RATIOS],
6451
+ resolutions: ["480p"],
6452
+ durations: { min: 4, max: 30 },
6453
+ references: {
6454
+ images: 30,
6455
+ videos: 10,
6456
+ audios: 10,
6457
+ videoSeconds: { min: 2, max: 30, total: 30 },
6458
+ ...SEEDANCE_REFERENCE_MEDIA,
6459
+ audioSeconds: { min: 2, max: 30, total: 30 },
6460
+ audioFormats: ["wav", "mp3"],
6461
+ audioMaxBytes: 15 * 1024 * 1024
6462
+ },
6463
+ ratioIgnoredWith: ["firstFrame"],
6464
+ supports: ["generateAudio", "lastFrame", "watermark"],
6465
+ draft: { resolution: "480p", finalResolutions: ["1080p"], ttlDays: 14 },
6466
+ prompt: SEEDANCE_PROMPT,
6467
+ audio: "optional"
6468
+ },
6469
+ defaults: {
6470
+ durationSeconds: 5,
6471
+ resolution: "480p",
6472
+ aspectRatio: "16:9",
6473
+ generateAudio: true
6474
+ },
6475
+ usage: { ...VIDEO_USAGE3 },
6476
+ pricingKind: "video_per_second",
6477
+ display: {
6478
+ provider: "bytedance",
6479
+ logo: BYTEDANCE_LOGO2,
6480
+ description: "A quick 480p Seedance 2.5 preview. Render the 1080p final from it within 14 days; the final keeps the draft's scene and motion."
6481
+ },
6482
+ capabilities: { acceptsSourceVideo: false, videoEdit: false, ...FRAMES_EXCLUDE_REFERENCES }
6483
+ },
6436
6484
  {
6437
6485
  // Limits probed on the live API 2026-11-16 (1080p is refused). Extend probe: a 4 s
6438
6486
  // extend returned 4 s of new footage only and billed input + output tokens, as on 2.5.
@@ -8416,6 +8464,13 @@ var ModelConstraintsSchema = import_zod3.z.looseObject({
8416
8464
  maxTotalSeconds: import_zod3.z.number(),
8417
8465
  returns: import_zod3.z.enum(["new", "joined"]).optional()
8418
8466
  }).optional(),
8467
+ // Loose so a kit before 0.24.0 keeps a row that carries it (an unknown `supports` value
8468
+ // would drop the row there).
8469
+ draft: import_zod3.z.looseObject({
8470
+ resolution: VideoResolutionSchema,
8471
+ finalResolutions: import_zod3.z.array(VideoResolutionSchema).min(1),
8472
+ ttlDays: import_zod3.z.number().positive()
8473
+ }).optional(),
8419
8474
  tool: VideoToolConstraintsSchema.optional(),
8420
8475
  model3d: Model3dConstraintsSchema.optional(),
8421
8476
  // Loose on purpose: the read path keeps a row whose value is invalid (the accessors in
@@ -10024,6 +10079,25 @@ function resolveVideoResolution(requested, model, onUnsupported, warnings) {
10024
10079
  warnings
10025
10080
  );
10026
10081
  }
10082
+ function resolveDraftFinalResolution(requested, draft, model, onUnsupported, warnings) {
10083
+ const [first] = draft.finalResolutions;
10084
+ if (requested === void 0 || draft.finalResolutions.includes(requested))
10085
+ return requested ?? first;
10086
+ if (onUnsupported === "error") {
10087
+ throw new ModelKitError({
10088
+ code: "unsupported_option",
10089
+ message: `${model.id} renders a final from a draft at ${draft.finalResolutions.join(", ")} only`,
10090
+ model: model.id,
10091
+ retryable: false
10092
+ });
10093
+ }
10094
+ warnings.push({
10095
+ code: "resolution_coerced",
10096
+ field: "resolution",
10097
+ message: `${model.id} renders a final at ${String(first)}, not ${requested}`
10098
+ });
10099
+ return first;
10100
+ }
10027
10101
  function resolveDuration(requested, durations, model, onUnsupported, warnings) {
10028
10102
  if (requested === void 0 || !durations) return requested;
10029
10103
  const inSet = Array.isArray(durations) ? durations.includes(requested) : requested >= durations.min && requested <= durations.max;
@@ -10351,7 +10425,13 @@ function resolveVideoOptions(model, request, onUnsupported = "error") {
10351
10425
  );
10352
10426
  if (aspectRatio !== void 0) merged.aspectRatio = aspectRatio;
10353
10427
  fillKlingModeResolution(model, merged);
10354
- const resolution = resolveVideoResolution(merged.resolution, model, onUnsupported, warnings);
10428
+ const resolution = merged.draftTaskId !== void 0 && c.draft ? resolveDraftFinalResolution(
10429
+ request.resolution,
10430
+ c.draft,
10431
+ model,
10432
+ onUnsupported,
10433
+ warnings
10434
+ ) : resolveVideoResolution(merged.resolution, model, onUnsupported, warnings);
10355
10435
  if (resolution !== void 0) merged.resolution = resolution;
10356
10436
  if (takesKlingMode(model)) delete merged.mode;
10357
10437
  const duration = resolveDuration(