Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.
TypeScript agentic-aiaiai-agentsai-videocompilerdslffmpeggenerative-aillmmarkup-languagemonorepoplugin-systemprogramming-languagetext-to-videotypescriptvideovideo-automationvideo-clonevideo-editingvideo-generation
feat: list the installed packages instead of reading a guide
rpone152c0e043420
diff --git a/.agents/skills/hypit/references/reference-video/workflow.md b/.agents/skills/hypit/references/reference-video/workflow.mdindex 6efd7784..2ef4a67d 100644--- a/.agents/skills/hypit/references/reference-video/workflow.md+++ b/.agents/skills/hypit/references/reference-video/workflow.md@@ -50,9 +50,14 @@ selected shots. Each shot produces three observations:shadow, glow, per-word emphasis, position and entry of text drawn over the picture;- `audio` — who is speaking, and what continues from the previous shot.-Boundary pairs additionally produce same-take and overlay-continuity observations, and a window of-three consecutive shots triggers a three-shot continuity review. The preceding tail frame, audio tail-and full-reference evidence are attached automatically; do not reconstruct that context by hand.+Each cut produces one `continuity` observation answering both questions under their own headings —+whether the two shots are one continuous camera shot, and whether an overlay continues across the+boundary — and a window of three consecutive shots triggers a three-shot continuity review. The+preceding tail frame, audio tail and full-reference evidence are attached automatically; do not+reconstruct that context by hand.++A shot is never shorter than a second. Fragments below that are not shots, and clips that short are+rejected by the model, so the detector merges them into the shot before them.Completed observations are reused. Naming a shot does not re-run it. `--reobserve` is the only way torun a completed observation again, and it exists for rebuilt media, not for doubt.diff --git a/packages/reference-video-tools/README.md b/packages/reference-video-tools/README.mdindex ff24abb0..950df8ae 100644--- a/packages/reference-video-tools/README.md+++ b/packages/reference-video-tools/README.md@@ -37,10 +37,18 @@ rerun only the selected full-reference stages.produces three observations — `visual` (base picture, covering content, continuity, whether the frameis a depicted scene or a flat designed field, and each framed element's inner picture separately fromits frame), `text_appearance` (typeface, weight, size, spacing, colour, stroke, shadow, glow,-per-word emphasis, position and entry of drawn text), and `audio` — plus per-boundary continuity-observations. The preceding tail frame, audio tail and full-reference context are attached-automatically. Completed observations are reused; `--reobserve` is the only way to run a completed-one again.+per-word emphasis, position and entry of drawn text), and `audio`. Each cut adds one `continuity`+observation covering both whether the two shots are one continuous camera shot and whether an overlay+continues across the boundary. The preceding tail frame, audio tail and full-reference context are+attached automatically. Completed observations are reused; `--reobserve` is the only way to run a+completed one again.++Shots are never shorter than one second: a fragment below that is merged into the shot before it,+because clips that short carry no evidence and the model rejects them outright.++`HYPIT_REFERENCE_CONCURRENCY` and `HYPIT_REFERENCE_LAUNCH_GAP_MS` set how fast requests are issued.+They describe the quota behind the credentials rather than anything about the video, so they are+environment settings and not flags.`--question` is a separate narrow path: it requires one to three `--shot-id` values, answers onlythat question from those shots' clips and frames in a single request, and neither reads nor writesdiff --git a/packages/reference-video-tools/src/cli.ts b/packages/reference-video-tools/src/cli.tsindex 35286214..721218da 100644--- a/packages/reference-video-tools/src/cli.ts+++ b/packages/reference-video-tools/src/cli.ts@@ -6,6 +6,7 @@ type Flags = ReadonlyMap<string, string | readonly string[] | boolean>;function usage(): string {return ["Usage:",+ " hypit-reference-video-tools list_svml_packages"," hypit-reference-video-tools prepare_reference --video-path <path> [--redo media|people|voices|systems|all]"," hypit-reference-video-tools observe_reference --reference-id <id> [--shot-id <id> ...] [--reobserve]"," hypit-reference-video-tools observe_reference --reference-id <id> --shot-id <id> [--shot-id <id> ...] --question <text>",@@ -79,7 +80,9 @@ async function main(): Promise<void> {const tools = createReferenceVideoTools();const supplied = inputObject(flags);let result: unknown;- if (command === "prepare_reference") {+ if (command === "list_svml_packages") {+ result = await tools.list_svml_packages();+ } else if (command === "prepare_reference") {const input = supplied ?? {video_path: required(flags, "video-path"),...(one(flags, "redo") === undefined ? {} : { redo: one(flags, "redo") }),diff --git a/packages/reference-video-tools/src/tools.ts b/packages/reference-video-tools/src/tools.tsindex 05cbc470..20488d94 100644--- a/packages/reference-video-tools/src/tools.ts+++ b/packages/reference-video-tools/src/tools.ts@@ -1,6 +1,6 @@import { GoogleGenAI } from "@google/genai";import type { Part } from "@google/genai";-import { access, stat, writeFile } from "node:fs/promises";+import { access, readdir, stat, writeFile } from "node:fs/promises";import { dirname, join, resolve } from "node:path";import { createRequire } from "node:module";import { loadNodePackageSelection } from "@hypit/package-loader-node";@@ -41,6 +41,7 @@ export type CompareReconstructionInput = {};export type ReferenceVideoTools = {+ list_svml_packages(): Promise<Record<string, unknown>>;prepare_reference(input: PrepareReferenceInput): Promise<PrepareResult>;observe_reference(input: ObserveReferenceInput): Promise<Record<string, unknown>>;inspect_svml_vocabulary(input: InspectVocabularyInput): Promise<Record<string, unknown>>;@@ -261,6 +262,38 @@ export function createReferenceVideoTools(options: ToolOptions = {}): ReferenceV};return {+ // Which packages exist is the first question of every reconstruction, and until now the only+ // answer was to read a guide and a directory listing by hand. The Build CLI deliberately never+ // scans a directory; this is a development tool, so it may.+ async list_svml_packages(): Promise<Record<string, unknown>> {+ const scope = join(packageRoot, "node_modules", "@hypit");+ const names = await readdir(scope).catch(() => [] as string[]);+ assert(names.length > 0, `no installed @hypit packages under ${scope}`);+ const packages: Record<string, unknown>[] = [];+ for (const name of [...names].sort()) {+ const specifier = `@hypit/${name}`;+ const manifest = await readJson<{ readonly hypit?: { readonly activation?: string }; readonly description?: string }>(+ join(scope, name, "package.json"));+ if (manifest?.hypit?.activation === undefined) continue;+ const tags: string[] = [];+ let note: string | undefined;+ try {+ for (const pack of await loadNodePackageSelection([specifier], packageRoot)) {+ for (const facet of pack.contribution.hostFacets ?? []) {+ tags.push((facet.implementation as RegisteredSurface).tag);+ }+ }+ } catch (error) { note = error instanceof Error ? error.message : String(error); }+ packages.push({+ package_name: specifier,+ ...(manifest.description === undefined ? {} : { description: manifest.description }),+ tags: [...new Set(tags)].sort(),+ ...(note === undefined ? {} : { unreadable: note }),+ });+ }+ return { package_root: packageRoot, packages };+ },+async prepare_reference(input): Promise<PrepareResult> {assert(input.redo === undefined || input.redo === "media" || input.redo === "people" || input.redo === "voices" || input.redo === "systems" || input.redo === "all", "redo must be one of: media, people, voices, systems, all");const videoPath = resolve(input.video_path);diff --git a/packages/reference-video-tools/test/tools.test.ts b/packages/reference-video-tools/test/tools.test.tsindex 9554b242..1ecedebf 100644--- a/packages/reference-video-tools/test/tools.test.ts+++ b/packages/reference-video-tools/test/tools.test.ts@@ -71,6 +71,25 @@ function tools(root: string, calls: Call[], answer?: string) {return createReferenceVideoTools({ workspaceRoot: root, concurrency: 4, launchGapMs: 0, retryDelayMs: 0, generate: recorder(calls, answer) });}+test("installed packages can be listed, and one that will not load is reported rather than hidden", async () => {+ const root = await mkdtemp(join(tmpdir(), "reference-video-tools-scope-"));+ const scope = join(root, "node_modules", "@hypit");+ await mkdir(join(scope, "with-activation"), { recursive: true });+ await mkdir(join(scope, "plain-library"), { recursive: true });+ await writeFile(join(scope, "with-activation", "package.json"),+ JSON.stringify({ name: "@hypit/with-activation", description: "declares a Surface", hypit: { activation: "./src/activation.ts" } }), "utf8");+ await writeFile(join(scope, "plain-library", "package.json"),+ JSON.stringify({ name: "@hypit/plain-library" }), "utf8");++ const result = await createReferenceVideoTools({ packageRoot: root, generate: async () => "" }).list_svml_packages();+ const packages = result["packages"] as readonly Record<string, unknown>[];+ assert.deepEqual(packages.map((item) => item["package_name"]), ["@hypit/with-activation"],+ "a package without an activation contributes no author vocabulary and is not vocabulary to discover");+ assert.equal(packages[0]!["description"], "declares a Surface");+ assert.equal(typeof packages[0]!["unreadable"], "string",+ "a package that declares an activation it cannot load is named, not silently dropped");+});+test("observation covers picture, drawn type and sound for every shot and caches every key", async () => {const { root, stateRoot } = await workspace(2);const calls: Call[] = [];