diff --git a/skills-manifest.json b/skills-manifest.json index 84f572ace7..80fc0fe017 100644 --- a/skills-manifest.json +++ b/skills-manifest.json @@ -46,7 +46,7 @@ "files": 10 }, "media-use": { - "hash": "8fd94ced0d1daee6", + "hash": "14d15dedf7acd4ed", "files": 124 }, "motion-graphics": { diff --git a/skills/media-use/scripts/resolve.mjs b/skills/media-use/scripts/resolve.mjs index 7d17560ffe..e234344fcd 100644 --- a/skills/media-use/scripts/resolve.mjs +++ b/skills/media-use/scripts/resolve.mjs @@ -36,6 +36,8 @@ import { versionLessThan, } from "./lib/heygen-cli.mjs"; +const INGEST_TYPES = [...listTypes(), "video"]; + // resolve shells `fetch`/`freezeUrl` and modern ESM; 18 is the floor where those // exist without flags. Named so the --doctor node check verifies something real // (O2). Declared before the top-level `--doctor` branch that calls runDoctor(). @@ -731,8 +733,8 @@ async function resolveColor(type, intent, options) { } async function ingest(src) { - if (!type || !listTypes().includes(type)) { - console.error(`error: --from requires --type (one of: ${listTypes().join(", ")})`); + if (!type || !INGEST_TYPES.includes(type)) { + console.error(`error: --from requires --type (one of: ${INGEST_TYPES.join(", ")})`); process.exit(2); } const isUrl = /^https?:\/\//i.test(src); @@ -1146,6 +1148,7 @@ const DEFAULT_EXT = { icon: ".svg", logo: ".svg", brand: ".png", + video: ".mp4", grade: ".cube", lut: ".cube", }; diff --git a/skills/media-use/scripts/resolve.test.mjs b/skills/media-use/scripts/resolve.test.mjs index 1e50ad2412..0fbd8a7c68 100644 --- a/skills/media-use/scripts/resolve.test.mjs +++ b/skills/media-use/scripts/resolve.test.mjs @@ -455,6 +455,20 @@ test("--help exits 0", () => { assert.ok(out.includes("--stats")); }); +test("--from registers a derived video as documented", () => { + setup(); + const source = join(tmp, "derived.mp4"); + writeFileSync(source, "derived video bytes"); + + const out = runResolve(["--from", source, "--type", "video", "--project", tmp, "--json"]); + const parsed = JSON.parse(out.trim()); + assert.equal(parsed.ok, true); + assert.equal(parsed.type, "video"); + assert.match(parsed.path, /^\.media\/video\/video_001\.mp4$/); + assert.equal(readManifest(tmp)[0]?.type, "video"); + cleanup(); +}); + test("unknown type error lists grade and lut", () => { try { runResolve(["--type", "bogus", "--intent", "x"], { stdio: "pipe" });