MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / resolveMotionSpec

Function resolveMotionSpec

packages/cli/src/commands/layout.ts:422–448  ·  view source on GitHub ↗

Read + validate the motion sidecar; print the error and exit on a bad spec.

(specPath: string, json: boolean)

Source from the content-addressed store, hash-verified

420
421/** Read + validate the motion sidecar; print the error and exit on a bad spec. */
422function resolveMotionSpec(specPath: string, json: boolean): MotionSpec {
423 const parsed = readMotionSpec(specPath);
424 if (parsed.ok) return parsed.spec;
425
426 const message = `Invalid motion spec ${specPath}: ${parsed.errors.join("; ")}`;
427 if (json) {
428 console.log(
429 JSON.stringify(
430 withMeta({
431 schemaVersion: INSPECT_SCHEMA_VERSION,
432 ok: false,
433 error: message,
434 issues: [],
435 errorCount: 0,
436 warningCount: 0,
437 infoCount: 0,
438 issueCount: 0,
439 }),
440 null,
441 2,
442 ),
443 );
444 } else {
445 console.error(`${c.error("✗")} ${message}`);
446 }
447 process.exit(1);
448}
449
450function parseAt(value: unknown): number[] | undefined {
451 if (!value) return undefined;

Callers 1

runFunction · 0.85

Calls 3

readMotionSpecFunction · 0.85
withMetaFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected