@shop-os/modelkit 0.12.0 → 0.14.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,24 @@ header in the release PR.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.14.0] - Unreleased
13
+
14
+ Video Depth Anything on fal, as a Creative Studio video tool.
15
+
16
+ ### Added
17
+ - Video-tool kind `depth`: a depth map of the source clip at its frame rate and length, H.264, billed per source second at the output tier. `planVideoTool` needs the source's measured frame rate when the row has `maxOutputFrames` (fal keeps the source rate and drops frames past the limit), refuses a clip past it, and shrinks the frame to `maxOutputShortEdge`.
18
+ - `depth-anything-video` (Video Depth Anything) video-tool row on the fal adapter (`fal-ai/depth-anything-video`), listed on `cowork`, sources up to 100 s. The adapter always sends `model: "VDA-Small"` and `colormap: "grayscale"` (Small is the only Apache-2.0 size; fal defaults to the CC-BY-NC Large). fal caps the output at a 1080 px short edge and 2400 frames and bills $0.04 per second. The `credit_pricing_video` rows ship in the consumer bump.
19
+
20
+ ### Changed
21
+ - `submitFalVideoTool` sends `output_format` only for `hdr` rows; a tool kind with no fields of its own gets none.
22
+
23
+ ## [0.13.0] - Unreleased
24
+
25
+ The fal and Luma keys have one env name each; every provider key now has exactly one name.
26
+
27
+ ### Removed
28
+ - `keysFromEnv` reads the `fal` key from `FAL_KEY` only and the `luma` key from `LUMA_API_KEY` only (each with the `ENTERPRISE_` / `SLOOSH_` prefixes); the older alias names are no longer read. No ShopOS store holds the alias names.
29
+
12
30
  ## [0.12.0] - Unreleased
13
31
 
14
32
  The Prodia, Replicate and Cloudflare AI Gateway keys have one env name each.
package/dist/catalog.cjs CHANGED
@@ -6643,6 +6643,33 @@ var VIDEO_TOOL_MODELS = [
6643
6643
  description: "Topaz Hyperion 2.5 SDR to HDR: a 10-bit HDR master in H.265 (HDR10) or ProRes 422 HQ, at the source's size and frame rate."
6644
6644
  }
6645
6645
  },
6646
+ {
6647
+ // https://fal.ai/models/fal-ai/depth-anything-video/api: greyscale depth (white = near)
6648
+ // at the source's frame rate, short edge capped at 1080 px (a 2160x3840 source came
6649
+ // back 1080x1920), at most 2400 frames; one fal price of $0.04 per second for every
6650
+ // model size. The adapter always sends VDA-Small, the only Apache-2.0 size. 100 s is
6651
+ // 2400 frames at 24 fps; the frame check refuses faster clips sooner.
6652
+ id: "depth-anything-video",
6653
+ aliases: [],
6654
+ label: "Video Depth Anything",
6655
+ type: "video-tool",
6656
+ adapter: "fal",
6657
+ providerModelId: "fal-ai/depth-anything-video",
6658
+ lifecycle: "active",
6659
+ exposure: ["cowork"],
6660
+ constraints: {
6661
+ supports: [],
6662
+ sourceVideoSeconds: { max: 100 },
6663
+ tool: { kind: "depth", maxOutputShortEdge: 1080, maxOutputFrames: 2400 }
6664
+ },
6665
+ defaults: {},
6666
+ usage: SECONDS_USAGE,
6667
+ pricingKind: "video_per_second",
6668
+ display: {
6669
+ provider: "depth-anything",
6670
+ description: "Video Depth Anything: a greyscale depth map of the clip (near is white), frame for frame, for motion and camera control."
6671
+ }
6672
+ },
6646
6673
  {
6647
6674
  id: "flux-video-upscale-precise",
6648
6675
  aliases: [],
@@ -7866,7 +7893,7 @@ var LanguageOptionSchema = import_zod3.z.looseObject({
7866
7893
  name: import_zod3.z.string().min(1)
7867
7894
  });
7868
7895
  var VideoToolConstraintsSchema = import_zod3.z.looseObject({
7869
- kind: import_zod3.z.enum(["upscale", "interpolate", "hdr", "bg-remove", "subtitles"]),
7896
+ kind: import_zod3.z.enum(["upscale", "interpolate", "hdr", "bg-remove", "subtitles", "depth"]),
7870
7897
  upscaleFactor: RangeSchema.optional(),
7871
7898
  maxOutputLongEdge: import_zod3.z.number().positive().optional(),
7872
7899
  prompt: import_zod3.z.boolean().optional(),
@@ -8472,7 +8499,7 @@ function subtitleProblem(label, tool, options, resolution, durationSeconds) {
8472
8499
  // src/catalog/video-tools-spec.ts
8473
8500
  var RangeSchema2 = import_zod6.z.object({ min: import_zod6.z.number(), max: import_zod6.z.number() });
8474
8501
  var ToolSchema = import_zod6.z.object({
8475
- kind: import_zod6.z.enum(["upscale", "interpolate", "hdr", "bg-remove", "subtitles"]),
8502
+ kind: import_zod6.z.enum(["upscale", "interpolate", "hdr", "bg-remove", "subtitles", "depth"]),
8476
8503
  upscaleFactor: RangeSchema2.optional(),
8477
8504
  maxOutputLongEdge: import_zod6.z.number().positive().optional(),
8478
8505
  prompt: import_zod6.z.boolean().optional(),
@@ -8610,6 +8637,25 @@ function planVideoTool(row2, req) {
8610
8637
  }
8611
8638
  };
8612
8639
  }
8640
+ if (tool.kind === "depth") {
8641
+ const limit = tool.maxOutputFrames;
8642
+ if (limit !== void 0) {
8643
+ if (fps === void 0) return fail("The source video's frame rate is required");
8644
+ if (durationSeconds * fps > limit) {
8645
+ return fail(`${row2.label} renders up to ${limit} frames (${seconds(limit, fps)}).`);
8646
+ }
8647
+ }
8648
+ const out2 = shrinkToShortEdge(width, height, tool.maxOutputShortEdge);
8649
+ return {
8650
+ ok: true,
8651
+ output: {
8652
+ ...base,
8653
+ ...out2,
8654
+ resolution: resolutionTier(out2.width, out2.height),
8655
+ format: "h264"
8656
+ }
8657
+ };
8658
+ }
8613
8659
  if (tool.kind === "subtitles") {
8614
8660
  const resolution = resolutionTier(width, height);
8615
8661
  const problem = subtitleProblem(