Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion skills-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"files": 10
},
"media-use": {
"hash": "8fd94ced0d1daee6",
"hash": "14d15dedf7acd4ed",
"files": 124
},
"motion-graphics": {
Expand Down
7 changes: 5 additions & 2 deletions skills/media-use/scripts/resolve.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1146,6 +1148,7 @@ const DEFAULT_EXT = {
icon: ".svg",
logo: ".svg",
brand: ".png",
video: ".mp4",
grade: ".cube",
lut: ".cube",
};
Expand Down
14 changes: 14 additions & 0 deletions skills/media-use/scripts/resolve.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
Expand Down
Loading