@videomule/recorder 0.1.4 → 0.3.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/.claude/skills/write-demo-narration/SKILL.md +140 -0
- package/dist/aidemo.js +233 -0
- package/dist/aidemo.js.map +1 -1
- package/dist/mcp-server.js +108 -1
- package/dist/mcp-server.js.map +1 -1
- package/dist/pipeline.js +23 -1
- package/dist/pipeline.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: write-demo-narration
|
|
3
|
+
description: >
|
|
4
|
+
Write real, customer-focused narration into an aidemo storyboard BEFORE the videomule-aidemo-bridge
|
|
5
|
+
records it, replacing the `<placeholder>` prompts aidemo's `init` leaves behind. Use this whenever the
|
|
6
|
+
bridge is about to record a flow (record_and_seed) and the storyboard still has `<...>` narration, or
|
|
7
|
+
the seeded VideoMule Script page came out full of `<hook: ...>` / `<narrate ...>` placeholders instead
|
|
8
|
+
of real sentences. The screen recording and the VideoMule voiceover are NOT this skill's job — this
|
|
9
|
+
only writes the TEXT that gets recorded and seeded. Not for rewriting an already-recorded video's audio
|
|
10
|
+
(that is the separate demo-voiceover skill).
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# write-demo-narration
|
|
14
|
+
|
|
15
|
+
`aidemo init --from-url` scaffolds a storyboard whose `scenes[].narration` are **template placeholders**
|
|
16
|
+
like `<hook: what X does, in one sentence>`. The bridge records and seeds whatever is there, so without
|
|
17
|
+
this step the VideoMule Script page lands full of `<...>` text. This skill fills those placeholders with
|
|
18
|
+
**real narration written for a potential customer**, so the recording and the seeded Script page both read
|
|
19
|
+
like a finished first draft (a proper hook, benefit-led lines, a call to action) that the user then edits
|
|
20
|
+
and voices in VideoMule.
|
|
21
|
+
|
|
22
|
+
## When to run it
|
|
23
|
+
|
|
24
|
+
Between the bridge's **author** and **record** steps. Concretely: after `record_and_seed` authors the
|
|
25
|
+
storyboard (or when a demo's `storyboard.json` still has `<...>` narration), write the narration, THEN let
|
|
26
|
+
the recording proceed. Writing it before recording means the real script is baked into both the take and
|
|
27
|
+
the seed.
|
|
28
|
+
|
|
29
|
+
## What you read
|
|
30
|
+
|
|
31
|
+
In the demo folder `demos/<name>/` (under the configured `AIDEMO_DIR`):
|
|
32
|
+
|
|
33
|
+
- `generated/storyboard.json` — `title`, `intro.subtitle`, and `scenes[]`, each with `id`, the current
|
|
34
|
+
`narration` (the `<placeholder>` to replace), and `actions[]` (what happens on screen in order:
|
|
35
|
+
`goto`/`click`/`type`/`scrollTo`/… with their targets). **The actions tell you what the viewer sees** —
|
|
36
|
+
narrate that, in that order.
|
|
37
|
+
- `input/brief.md` — what aidemo's `inspect` saw (page title, headings, elements). Use it for real nouns
|
|
38
|
+
the viewer can map to the screen. Fill the brief's `<your product>` / `<audience>` / `<CTA>` only if the
|
|
39
|
+
user told you those; otherwise infer conservatively from what's on screen.
|
|
40
|
+
- `generated/timeline.json` (only exists AFTER recording) — per-scene `startMs`/`endMs`. Before recording
|
|
41
|
+
it won't exist; estimate each scene's room from its action count (≈1.5–2.5 s per action) instead.
|
|
42
|
+
|
|
43
|
+
If a selector doesn't make it obvious what's on screen, say so rather than inventing a fact.
|
|
44
|
+
|
|
45
|
+
## How to write it — the rubric
|
|
46
|
+
|
|
47
|
+
The viewer is deciding whether to try the product. Every line answers **"what can I do with this, and
|
|
48
|
+
why would I care?"** Write for the ear: short sentences, natural contractions, no URLs/slashes/parentheses.
|
|
49
|
+
|
|
50
|
+
**Shape of the whole script**
|
|
51
|
+
- **First scene = the hook**: what the product is and the outcome, in one breath. (Also set
|
|
52
|
+
`intro.subtitle` to a one-line value prop.)
|
|
53
|
+
- **Middle scenes**: one idea each, in the order the screen shows it, second person ("you").
|
|
54
|
+
- **Last scene**: a quick recap of the path, then a warm call to action.
|
|
55
|
+
|
|
56
|
+
**Per scene**: 1–3 short sentences that match that scene's on-screen actions, in order. Fill ~75–90% of the
|
|
57
|
+
scene's time budget — leave a little air; don't pad to 100%.
|
|
58
|
+
|
|
59
|
+
**Cut / rewrite (the usual placeholder-era problems):**
|
|
60
|
+
- Meta-talk about the recording — "this walkthrough", "in this demo", "we won't spend credits", "we'll
|
|
61
|
+
leave this unsent". The viewer doesn't know it's a recording. Delete or replace with the benefit.
|
|
62
|
+
- Specs and jargon → outcomes. "Standard is 720p, Medium is 360p" → "Standard looks sharper; Medium costs
|
|
63
|
+
less, handy for testing."
|
|
64
|
+
- Inventories of every control → name the two or three a buyer would use and what they get.
|
|
65
|
+
- The account owner's data/POV → describe what the feature does for any user.
|
|
66
|
+
|
|
67
|
+
**Keep:** facts visible on screen (format names, "cost shown upfront", "download as MP4"); honest caveats a
|
|
68
|
+
buyer needs (costs, limits, what needs an upload); concrete UI nouns.
|
|
69
|
+
|
|
70
|
+
**Never add:** claims you can't see or verify ("10× faster", "in minutes", user counts, "the best");
|
|
71
|
+
mentions of things from a later scene (the picture won't match). Spell the brand the way it's said
|
|
72
|
+
("Selfie Ads", not "selfieads.com").
|
|
73
|
+
|
|
74
|
+
## First, fix the ACTIONS — a scroll-through makes a thin script
|
|
75
|
+
|
|
76
|
+
aidemo's `init` scaffolds **scroll/hover** beats only; it never clicks, types, or submits. If you record
|
|
77
|
+
that, the demo never shows the product *doing* anything, and the narration is stuck describing scrolling.
|
|
78
|
+
So before narration, turn the scaffold into a **real flow**.
|
|
79
|
+
|
|
80
|
+
The `author_storyboard` tool's READ mode gives you, per scene, the current `actions`, and crucially a
|
|
81
|
+
**`selectors` catalog** — the real clickable/typeable elements aidemo saw (role + name + working selector),
|
|
82
|
+
plus the page `headings`. Author actions against **those selectors**, never guessed ones.
|
|
83
|
+
|
|
84
|
+
- Replace a candidate `hover` with the real `click` on the element the scene is about (e.g.
|
|
85
|
+
`{ "op": "click", "target": "button:has-text(\"Choose avatar\")" }`), then an `assert` that the state
|
|
86
|
+
changed, so the take proves it worked.
|
|
87
|
+
- Use `type` to fill inputs, `select` for dropdowns, `scrollTo` to reveal a section before acting on it.
|
|
88
|
+
- **Drop filler scenes** that don't serve the story (a lone "Collapse the sidebar" hover is a weak ending —
|
|
89
|
+
drop it or replace it with a real last beat).
|
|
90
|
+
- Order the scenes so they tell the product's story: open → the key steps a user takes → the outcome.
|
|
91
|
+
- **DO NOT add the final submit / "Generate" / "Create" click.** That spends the product's credits.
|
|
92
|
+
Demonstrate up TO that step and let the narration say what happens next.
|
|
93
|
+
|
|
94
|
+
Valid aidemo action ops: `goto` (needs `url`), `click`, `type` (needs `text`), `press` (needs `key`),
|
|
95
|
+
`hover`, `scrollTo`, `scrollBy` (needs `dy`), `select`, `waitFor`, `assert`, `upload`, `pause`. Each
|
|
96
|
+
interaction op needs a **`target`** — pass it as a plain selector string from the catalog (e.g.
|
|
97
|
+
`"target": "button:has-text(\"Choose avatar\")"`); the tool wraps it into aidemo's `{selector}` form for
|
|
98
|
+
you.
|
|
99
|
+
|
|
100
|
+
After you write actions, the tool **validates** the storyboard (schema check, no browser) and returns any
|
|
101
|
+
issues — fix those (usually a bad/missing selector) before recording. The pipeline also validates again and
|
|
102
|
+
refuses to record an invalid storyboard, so a bad selector fails cheaply, not mid-take.
|
|
103
|
+
|
|
104
|
+
## Then write the narration, and write it all back
|
|
105
|
+
|
|
106
|
+
With the flow fixed, write narration that matches the now-meaningful steps (the richer scenes give you more
|
|
107
|
+
room for benefit-led lines — don't leave them minimal like "Pick High at 720p, or cheaper Low." when the
|
|
108
|
+
budget allows "Choose High for sharper video, or Low to save credits while you test.").
|
|
109
|
+
|
|
110
|
+
Call `author_storyboard` WRITE with the edits:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
{ "name": "<demo>",
|
|
114
|
+
"edits": {
|
|
115
|
+
"<sceneId>": { "actions": [ { "op": "click", "target": "..." }, { "op": "assert", "target": "..." } ],
|
|
116
|
+
"narration": "..." },
|
|
117
|
+
"<fillerSceneId>": { "drop": true }
|
|
118
|
+
},
|
|
119
|
+
"introSubtitle": "<one-line value prop>" }
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
For narration-only edits you can pass `{ name, narration: { "<sceneId>": "..." } }`. The tool reports any
|
|
123
|
+
scenes still holding a `<placeholder>`. Leave **none** behind. Then call `record_and_seed` with
|
|
124
|
+
`authoredNarration: true`.
|
|
125
|
+
|
|
126
|
+
## Example (what good looks like)
|
|
127
|
+
|
|
128
|
+
A scene whose actions are `goto /`, `scrollTo #features`, with budget ~3.4s:
|
|
129
|
+
|
|
130
|
+
- ❌ placeholder: `<narrate what's on the page>`
|
|
131
|
+
- ✅ real: `"Everything lives in one workspace. Scroll down and you'll see each format laid out, ready to
|
|
132
|
+
pick."`
|
|
133
|
+
|
|
134
|
+
A first scene (the hook), budget ~1.9s:
|
|
135
|
+
|
|
136
|
+
- ❌ `<hook: what Example Domain does, in one sentence>`
|
|
137
|
+
- ✅ `"Meet Example — the simplest way to put your idea online."`
|
|
138
|
+
|
|
139
|
+
Keep it one narrator throughout: warm, friendly, confident; vary within that band, don't swing from whisper
|
|
140
|
+
to hype.
|
package/dist/aidemo.js
CHANGED
|
@@ -21,6 +21,7 @@ export function demoPaths(aidemoDir, name) {
|
|
|
21
21
|
storyboard: join(demoDir, "generated", "storyboard.json"),
|
|
22
22
|
timeline: join(demoDir, "generated", "timeline.json"),
|
|
23
23
|
rawVideo: join(demoDir, "recordings", "raw.webm"),
|
|
24
|
+
brief: join(demoDir, "input", "brief.md"),
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
27
|
/** Run the aidemo CLI with cwd=aidemoDir, streaming logs to our stderr. */
|
|
@@ -37,6 +38,26 @@ function runAidemo(aidemoDir, args) {
|
|
|
37
38
|
: reject(new Error(`aidemo ${args[0]} exited with code ${code}`)));
|
|
38
39
|
});
|
|
39
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Run the aidemo CLI and CAPTURE stdout/stderr + exit code (for commands whose
|
|
43
|
+
* output we parse, like `validate --json`). Never rejects on a non-zero exit —
|
|
44
|
+
* the caller inspects `code`.
|
|
45
|
+
*/
|
|
46
|
+
function runAidemoCapture(aidemoDir, args) {
|
|
47
|
+
return new Promise((resolve, reject) => {
|
|
48
|
+
const child = spawn("node", [join(aidemoDir, "bin", "aidemo.mjs"), ...args], {
|
|
49
|
+
cwd: aidemoDir,
|
|
50
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
51
|
+
env: process.env,
|
|
52
|
+
});
|
|
53
|
+
let stdout = "";
|
|
54
|
+
let stderr = "";
|
|
55
|
+
child.stdout.on("data", (d) => (stdout += d));
|
|
56
|
+
child.stderr.on("data", (d) => (stderr += d));
|
|
57
|
+
child.on("error", reject);
|
|
58
|
+
child.on("exit", (code) => resolve({ code: code ?? 1, stdout, stderr }));
|
|
59
|
+
});
|
|
60
|
+
}
|
|
40
61
|
async function fileExists(p) {
|
|
41
62
|
try {
|
|
42
63
|
await access(p, FS.R_OK);
|
|
@@ -113,6 +134,218 @@ export async function ensureBakedCursor(storyboardPath) {
|
|
|
113
134
|
await writeFile(storyboardPath, JSON.stringify(sb, null, 2) + "\n", "utf8");
|
|
114
135
|
return true;
|
|
115
136
|
}
|
|
137
|
+
/** True when a narration string is still an unfilled `<...>` placeholder. */
|
|
138
|
+
export function isPlaceholderNarration(text) {
|
|
139
|
+
const t = text.trim();
|
|
140
|
+
return t.length === 0 || /^<.*>$/.test(t);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Parse the "What inspect saw" section of input/brief.md into the real selector
|
|
144
|
+
* catalog + headings. The brief writes a markdown table
|
|
145
|
+
* `| role | name | \`selector\` | |` and a bulleted headings list. Best-effort:
|
|
146
|
+
* a missing/odd brief just yields empty lists.
|
|
147
|
+
*/
|
|
148
|
+
export function parseBrief(md) {
|
|
149
|
+
const selectors = [];
|
|
150
|
+
const headings = [];
|
|
151
|
+
const lines = md.split("\n");
|
|
152
|
+
let inHeadings = false;
|
|
153
|
+
for (const line of lines) {
|
|
154
|
+
const t = line.trim();
|
|
155
|
+
if (/^Headings:/i.test(t)) {
|
|
156
|
+
inHeadings = true;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
if (inHeadings) {
|
|
160
|
+
const h = t.match(/^-\s+(?:h[1-6]\s+)?(.+)$/i);
|
|
161
|
+
if (h) {
|
|
162
|
+
headings.push(h[1].trim());
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
if (t && !t.startsWith("-"))
|
|
166
|
+
inHeadings = false;
|
|
167
|
+
}
|
|
168
|
+
// Table row: | role | name | `selector` | |
|
|
169
|
+
const cells = line.includes("|") ? line.split("|").map((c) => c.trim()) : [];
|
|
170
|
+
// cells: ["", role, name, "`selector`", "", ""] (leading/trailing empties)
|
|
171
|
+
if (cells.length >= 4) {
|
|
172
|
+
const role = cells[1] ?? "";
|
|
173
|
+
const name = cells[2] ?? "";
|
|
174
|
+
const selMatch = (cells[3] ?? "").match(/^`(.+)`$/);
|
|
175
|
+
if (selMatch && role && role !== "role" && !/^-+$/.test(role)) {
|
|
176
|
+
selectors.push({ role, name, selector: selMatch[1] });
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return { selectors, headings };
|
|
181
|
+
}
|
|
182
|
+
/** ~2.5 spoken words/sec; fill ~85% of the room. */
|
|
183
|
+
function wordBudgetFromMs(ms) {
|
|
184
|
+
return Math.max(4, Math.round((ms / 1000) * 2.5 * 0.85));
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Read the storyboard (+ timeline budgets if present) into a compact view for
|
|
188
|
+
* the authoring agent: each scene's id, current narration, on-screen actions,
|
|
189
|
+
* and its word budget.
|
|
190
|
+
*/
|
|
191
|
+
export async function readStoryboardView(paths) {
|
|
192
|
+
const sb = JSON.parse(await readFile(paths.storyboard, "utf8"));
|
|
193
|
+
// Per-scene budgets come from timeline.json (only after a recording exists).
|
|
194
|
+
const budgetById = new Map();
|
|
195
|
+
if (await fileExists(paths.timeline)) {
|
|
196
|
+
try {
|
|
197
|
+
const tl = JSON.parse(await readFile(paths.timeline, "utf8"));
|
|
198
|
+
for (const s of tl.scenes ?? [])
|
|
199
|
+
budgetById.set(s.id, Math.max(0, s.endMs - s.startMs));
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
/* ignore a malformed timeline — fall back to estimates */
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
const rawScenes = Array.isArray(sb.scenes) ? sb.scenes : [];
|
|
206
|
+
const scenes = rawScenes.map((s) => {
|
|
207
|
+
const id = String(s.id ?? "");
|
|
208
|
+
const actions = Array.isArray(s.actions)
|
|
209
|
+
? s.actions.map((a) => ({
|
|
210
|
+
op: String(a.op ?? ""),
|
|
211
|
+
target: a.target != null ? String(a.target) : undefined,
|
|
212
|
+
}))
|
|
213
|
+
: [];
|
|
214
|
+
// Budget: real ms if recorded, else estimate ~1.8s per action.
|
|
215
|
+
const budgetMs = budgetById.get(id) ?? (actions.length ? actions.length * 1800 : null);
|
|
216
|
+
return {
|
|
217
|
+
id,
|
|
218
|
+
narration: typeof s.narration === "string" ? s.narration : "",
|
|
219
|
+
actions,
|
|
220
|
+
budgetMs,
|
|
221
|
+
wordBudget: budgetMs != null ? wordBudgetFromMs(budgetMs) : null,
|
|
222
|
+
};
|
|
223
|
+
});
|
|
224
|
+
// Real selectors + headings aidemo saw, from input/brief.md (best-effort).
|
|
225
|
+
let selectors = [];
|
|
226
|
+
let headings = [];
|
|
227
|
+
if (await fileExists(paths.brief)) {
|
|
228
|
+
try {
|
|
229
|
+
({ selectors, headings } = parseBrief(await readFile(paths.brief, "utf8")));
|
|
230
|
+
}
|
|
231
|
+
catch {
|
|
232
|
+
/* a missing/odd brief just yields no catalog */
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
const intro = (sb.intro ?? {});
|
|
236
|
+
return {
|
|
237
|
+
title: typeof sb.title === "string" ? sb.title : "",
|
|
238
|
+
introSubtitle: typeof intro.subtitle === "string" ? intro.subtitle : null,
|
|
239
|
+
scenes,
|
|
240
|
+
selectors,
|
|
241
|
+
headings,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
/** Scene ids whose narration is still an unfilled `<placeholder>`. */
|
|
245
|
+
export async function placeholderScenes(paths) {
|
|
246
|
+
const view = await readStoryboardView(paths);
|
|
247
|
+
return view.scenes.filter((s) => isPlaceholderNarration(s.narration)).map((s) => s.id);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Write agent-authored narration back into storyboard.json. `narration` maps
|
|
251
|
+
* sceneId → text; unknown ids are ignored, missing scenes are left as-is.
|
|
252
|
+
* Optionally set the intro subtitle (the one-line value prop). Returns the ids
|
|
253
|
+
* that still hold a `<placeholder>` afterward (so the caller can warn).
|
|
254
|
+
*/
|
|
255
|
+
export async function writeNarration(paths, narration, introSubtitle) {
|
|
256
|
+
const sb = JSON.parse(await readFile(paths.storyboard, "utf8"));
|
|
257
|
+
const scenes = Array.isArray(sb.scenes) ? sb.scenes : [];
|
|
258
|
+
for (const scene of scenes) {
|
|
259
|
+
const id = String(scene.id ?? "");
|
|
260
|
+
if (id in narration && typeof narration[id] === "string") {
|
|
261
|
+
scene.narration = narration[id];
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (introSubtitle != null) {
|
|
265
|
+
const intro = (sb.intro && typeof sb.intro === "object" ? sb.intro : {});
|
|
266
|
+
intro.subtitle = introSubtitle;
|
|
267
|
+
sb.intro = intro;
|
|
268
|
+
}
|
|
269
|
+
await writeFile(paths.storyboard, JSON.stringify(sb, null, 2) + "\n", "utf8");
|
|
270
|
+
return scenes
|
|
271
|
+
.filter((s) => isPlaceholderNarration(typeof s.narration === "string" ? s.narration : ""))
|
|
272
|
+
.map((s) => String(s.id ?? ""));
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Normalize an authored action so a bare-string `target` becomes aidemo's
|
|
276
|
+
* `{ selector }` object (its TargetSchema requires an object). Lets the agent
|
|
277
|
+
* write the simpler `"target": "button:has-text(...)"` and keeps it valid.
|
|
278
|
+
*/
|
|
279
|
+
function normalizeAction(a) {
|
|
280
|
+
if (typeof a.target === "string") {
|
|
281
|
+
return { ...a, target: { selector: a.target } };
|
|
282
|
+
}
|
|
283
|
+
return a;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Write agent-authored STORYBOARD edits (actions + narration) back into
|
|
287
|
+
* storyboard.json — the richer counterpart of writeNarration. `edits` maps
|
|
288
|
+
* sceneId → { actions?, narration?, drop? }. Unknown ids are ignored; scenes
|
|
289
|
+
* not mentioned are untouched; dropped scenes are removed. Only mutates the
|
|
290
|
+
* fields given, so the rest of the storyboard (voice, zoom, intro) is preserved.
|
|
291
|
+
* The result is NOT validated here — call validateStoryboard() next.
|
|
292
|
+
*/
|
|
293
|
+
export async function writeStoryboard(paths, edits, introSubtitle) {
|
|
294
|
+
const sb = JSON.parse(await readFile(paths.storyboard, "utf8"));
|
|
295
|
+
const scenes = Array.isArray(sb.scenes) ? sb.scenes : [];
|
|
296
|
+
const kept = [];
|
|
297
|
+
for (const scene of scenes) {
|
|
298
|
+
const id = String(scene.id ?? "");
|
|
299
|
+
const edit = edits[id];
|
|
300
|
+
if (edit?.drop)
|
|
301
|
+
continue; // remove this scene
|
|
302
|
+
if (edit) {
|
|
303
|
+
if (Array.isArray(edit.actions))
|
|
304
|
+
scene.actions = edit.actions.map(normalizeAction);
|
|
305
|
+
if (typeof edit.narration === "string")
|
|
306
|
+
scene.narration = edit.narration;
|
|
307
|
+
}
|
|
308
|
+
kept.push(scene);
|
|
309
|
+
}
|
|
310
|
+
sb.scenes = kept;
|
|
311
|
+
if (introSubtitle != null) {
|
|
312
|
+
const intro = (sb.intro && typeof sb.intro === "object" ? sb.intro : {});
|
|
313
|
+
intro.subtitle = introSubtitle;
|
|
314
|
+
sb.intro = intro;
|
|
315
|
+
}
|
|
316
|
+
await writeFile(paths.storyboard, JSON.stringify(sb, null, 2) + "\n", "utf8");
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Validate the storyboard against aidemo's engine schema WITHOUT running a
|
|
320
|
+
* browser: `aidemo validate <demoDir> --relaxed --json`. This is the cheap gate
|
|
321
|
+
* to run after authoring actions — it catches malformed actions / missing
|
|
322
|
+
* fields before a multi-minute record. `--relaxed` makes narration optional (we
|
|
323
|
+
* author it separately). Returns ok + any issues.
|
|
324
|
+
*/
|
|
325
|
+
export async function validateStoryboard(paths, aidemoDir) {
|
|
326
|
+
const out = await runAidemoCapture(aidemoDir, [
|
|
327
|
+
"validate",
|
|
328
|
+
paths.demoDir,
|
|
329
|
+
"--relaxed",
|
|
330
|
+
"--json",
|
|
331
|
+
]);
|
|
332
|
+
// aidemo validate --json prints { valid, issues:[{path,message,code}], ... } and
|
|
333
|
+
// exits 0 EVEN WHEN INVALID — so key off `valid`, not the exit code.
|
|
334
|
+
try {
|
|
335
|
+
const parsed = JSON.parse(out.stdout);
|
|
336
|
+
const issues = Array.isArray(parsed.issues)
|
|
337
|
+
? parsed.issues.map((i) => i?.path ? `${i.path}: ${i.message ?? "invalid"}` : i?.message ?? JSON.stringify(i))
|
|
338
|
+
: [];
|
|
339
|
+
return { ok: parsed.valid === true, issues };
|
|
340
|
+
}
|
|
341
|
+
catch {
|
|
342
|
+
// Output wasn't JSON (e.g. aidemo crashed) — fall back to exit code + stderr.
|
|
343
|
+
return {
|
|
344
|
+
ok: out.code === 0,
|
|
345
|
+
issues: out.code === 0 ? [] : [out.stderr.trim() || out.stdout.trim() || "validation failed"],
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
}
|
|
116
349
|
/**
|
|
117
350
|
* Record the demo: `aidemo record <demoDir> [--headless]`. Writes raw.webm +
|
|
118
351
|
* timeline.json. (The aidemo CLI blocks until the take finishes, so there's no
|
package/dist/aidemo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aidemo.js","sourceRoot":"","sources":["../src/aidemo.ts"],"names":[],"mappings":"AAAA;;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I,CAAC,YAAY,EAAE,CAAC;QACtB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC;IACtE,CAAC;IACD,MAAM,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACjC,KAAK,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjD,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,cAAc,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/mcp-server.js
CHANGED
|
@@ -26,6 +26,7 @@ import { z } from "zod";
|
|
|
26
26
|
import { loadConfig } from "./config.js";
|
|
27
27
|
import { runPipeline } from "./pipeline.js";
|
|
28
28
|
import { ensureLoggedIn, closeContext } from "./browser.js";
|
|
29
|
+
import { demoPaths, authorFromUrl, readStoryboardView, writeNarration, writeStoryboard, validateStoryboard, } from "./aidemo.js";
|
|
29
30
|
import { log } from "./log.js";
|
|
30
31
|
/**
|
|
31
32
|
* Claude Desktop (and other GUI hosts) launch the server with a MINIMAL PATH
|
|
@@ -118,6 +119,105 @@ function buildServer() {
|
|
|
118
119
|
return fail(`login failed: ${err.message}`);
|
|
119
120
|
}
|
|
120
121
|
});
|
|
122
|
+
server.registerTool("author_storyboard", {
|
|
123
|
+
description: "Shape the demo storyboard BEFORE recording — the ACTIONS (what gets performed on screen) AND " +
|
|
124
|
+
"the narration — so the recording actually demonstrates the product and the seeded VideoMule " +
|
|
125
|
+
"Script page reads like a real demo (not a scroll-through with `<placeholder>` text). Follow " +
|
|
126
|
+
"the write-demo-narration skill. TWO modes:\n" +
|
|
127
|
+
"• READ (pass name, + url if not scaffolded yet): returns each scene's id, current actions + " +
|
|
128
|
+
"narration + word budget, PLUS `selectors` (the real clickable elements aidemo saw) and " +
|
|
129
|
+
"`headings`. aidemo's auto-scaffold is just scroll/hover beats — rewrite them into a real flow " +
|
|
130
|
+
"using those selectors (click a format, select quality, etc.), drop filler scenes, and write " +
|
|
131
|
+
"fuller narration.\n" +
|
|
132
|
+
"• WRITE (pass name + edits): stores your per-scene { actions?, narration?, drop? } edits (+ " +
|
|
133
|
+
"optional introSubtitle), then VALIDATES the storyboard and returns any issues. Fix issues, " +
|
|
134
|
+
"then call record_and_seed.\n" +
|
|
135
|
+
"IMPORTANT: do NOT add the final submit/'Generate' click — that spends the product's credits. " +
|
|
136
|
+
"Demonstrate up to that step.",
|
|
137
|
+
inputSchema: {
|
|
138
|
+
name: z.string().min(1).describe("Demo name (demos/<name>/ under the aidemo checkout)."),
|
|
139
|
+
url: z
|
|
140
|
+
.string()
|
|
141
|
+
.url()
|
|
142
|
+
.optional()
|
|
143
|
+
.describe("READ: the page to scaffold the storyboard from (if it doesn't exist yet)."),
|
|
144
|
+
edits: z
|
|
145
|
+
.record(z.object({
|
|
146
|
+
actions: z
|
|
147
|
+
.array(z.record(z.unknown()))
|
|
148
|
+
.optional()
|
|
149
|
+
.describe("Replace this scene's action beats (aidemo action objects: {op, target, …})."),
|
|
150
|
+
narration: z.string().optional().describe("Replace this scene's narration."),
|
|
151
|
+
drop: z.boolean().optional().describe("Remove this scene (e.g. filler like 'Collapse the sidebar')."),
|
|
152
|
+
}))
|
|
153
|
+
.optional()
|
|
154
|
+
.describe("WRITE: { sceneId: { actions?, narration?, drop? } } edits to apply."),
|
|
155
|
+
narration: z
|
|
156
|
+
.record(z.string())
|
|
157
|
+
.optional()
|
|
158
|
+
.describe("WRITE (shortcut): { sceneId: narrationText } — narration-only edits."),
|
|
159
|
+
introSubtitle: z.string().optional().describe("WRITE (optional): a one-line value prop for the intro."),
|
|
160
|
+
force: z.boolean().optional().describe("READ: overwrite an existing demos/<name>/ when scaffolding."),
|
|
161
|
+
headed: z.boolean().optional().describe("READ: show Chrome while inspecting."),
|
|
162
|
+
},
|
|
163
|
+
}, async ({ name, url, edits, narration, introSubtitle, force, headed }) => {
|
|
164
|
+
try {
|
|
165
|
+
const config = loadConfig();
|
|
166
|
+
let paths = demoPaths(config.aidemoDir, name);
|
|
167
|
+
// WRITE mode: apply storyboard edits (or narration-only), then validate.
|
|
168
|
+
if (edits || narration) {
|
|
169
|
+
if (edits) {
|
|
170
|
+
await writeStoryboard(paths, edits, introSubtitle);
|
|
171
|
+
}
|
|
172
|
+
else if (narration) {
|
|
173
|
+
await writeNarration(paths, narration, introSubtitle);
|
|
174
|
+
}
|
|
175
|
+
const v = await validateStoryboard(paths, config.aidemoDir);
|
|
176
|
+
const view = await readStoryboardView(paths);
|
|
177
|
+
const stillPlaceholder = view.scenes
|
|
178
|
+
.filter((s) => /^\s*<.*>\s*$/.test(s.narration) || s.narration.trim() === "")
|
|
179
|
+
.map((s) => s.id);
|
|
180
|
+
return ok({
|
|
181
|
+
mode: "write",
|
|
182
|
+
name,
|
|
183
|
+
valid: v.ok,
|
|
184
|
+
issues: v.issues,
|
|
185
|
+
stillPlaceholder,
|
|
186
|
+
note: !v.ok
|
|
187
|
+
? "Storyboard INVALID — fix the issues above (use real selectors), then call author_storyboard again."
|
|
188
|
+
: stillPlaceholder.length
|
|
189
|
+
? `Valid, but scenes still have placeholder narration: ${stillPlaceholder.join(", ")}.`
|
|
190
|
+
: "Valid and fully narrated. Call record_and_seed with { name, authoredNarration: true }.",
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
// READ mode — scaffold if the storyboard doesn't exist yet.
|
|
194
|
+
const { access } = await import("node:fs/promises");
|
|
195
|
+
const exists = await access(paths.storyboard).then(() => true).catch(() => false);
|
|
196
|
+
if (!exists) {
|
|
197
|
+
if (!url) {
|
|
198
|
+
return fail("No storyboard yet for this name — pass `url` so I can scaffold it first (READ mode).");
|
|
199
|
+
}
|
|
200
|
+
paths = await authorFromUrl(config.aidemoDir, name, url, { force, headed });
|
|
201
|
+
}
|
|
202
|
+
const view = await readStoryboardView(paths);
|
|
203
|
+
return ok({
|
|
204
|
+
mode: "read",
|
|
205
|
+
name,
|
|
206
|
+
title: view.title,
|
|
207
|
+
introSubtitle: view.introSubtitle,
|
|
208
|
+
headings: view.headings,
|
|
209
|
+
selectors: view.selectors,
|
|
210
|
+
scenes: view.scenes,
|
|
211
|
+
note: "Rewrite the scaffold's scroll/hover beats into a real flow using `selectors` (click a " +
|
|
212
|
+
"format, select quality…), drop filler scenes, write fuller narration — then call " +
|
|
213
|
+
"author_storyboard WRITE with { name, edits: { sceneId: { actions?, narration?, drop? } } }. " +
|
|
214
|
+
"Do NOT click the final Generate/submit (spends credits).",
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
catch (err) {
|
|
218
|
+
return fail(`author_storyboard failed: ${err.message}`);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
121
221
|
server.registerTool("record_and_seed", {
|
|
122
222
|
description: "Record a web flow LOCALLY and seed an editable VideoMule Script page from it. Drives " +
|
|
123
223
|
"aidemo to author a storyboard from the URL and record the flow in Chrome, maps the " +
|
|
@@ -156,8 +256,14 @@ function buildServer() {
|
|
|
156
256
|
.string()
|
|
157
257
|
.optional()
|
|
158
258
|
.describe("Password for the target site (required if targetEmail is given). Never logged."),
|
|
259
|
+
authoredNarration: z
|
|
260
|
+
.boolean()
|
|
261
|
+
.optional()
|
|
262
|
+
.describe("Set true if you already wrote real narration via author_narration — suppresses the " +
|
|
263
|
+
"placeholder-narration warning. For a GOOD first-draft script, call author_narration " +
|
|
264
|
+
"first and pass this true."),
|
|
159
265
|
},
|
|
160
|
-
}, async ({ url, name, headed, force, targetEmail, targetPassword }) => {
|
|
266
|
+
}, async ({ url, name, headed, force, targetEmail, targetPassword, authoredNarration }) => {
|
|
161
267
|
const steps = [];
|
|
162
268
|
try {
|
|
163
269
|
const config = loadConfig();
|
|
@@ -168,6 +274,7 @@ function buildServer() {
|
|
|
168
274
|
force,
|
|
169
275
|
targetEmail,
|
|
170
276
|
targetPassword,
|
|
277
|
+
authorNarration: authoredNarration,
|
|
171
278
|
onStep: (m) => {
|
|
172
279
|
steps.push(m);
|
|
173
280
|
log(m);
|
package/dist/mcp-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAkB,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B;;;;;;GAMG;AACH,SAAS,WAAW;IAClB,MAAM,MAAM,GAAG;QACb,mBAAmB;QACnB,oBAAoB;QACpB,gBAAgB;QAChB,iBAAiB;QACjB,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,aAAa;QACtC,UAAU;QACV,MAAM;QACN,WAAW;QACX,OAAO;KACR,CAAC;IACF,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACrE,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,QAAQ,CAAC,CAAC;IACxC,uBAAuB;IACvB,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAA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AC,CAAC;AACxE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,GAAG,CAAC,UAAW,GAAa,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/pipeline.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* to stderr and the MCP server can collect the messages into its result —
|
|
17
17
|
* neither path writes to stdout from in here.
|
|
18
18
|
*/
|
|
19
|
-
import { authorFromUrl, record, demoPaths, preflight } from "./aidemo.js";
|
|
19
|
+
import { authorFromUrl, record, demoPaths, preflight, placeholderScenes, validateStoryboard, } from "./aidemo.js";
|
|
20
20
|
import { readAidemoOutputs, buildSeedRequest } from "./mapper.js";
|
|
21
21
|
import { probeVideo } from "./video.js";
|
|
22
22
|
import { uploadVideo } from "./s3.js";
|
|
@@ -47,6 +47,28 @@ export async function runPipeline(config, opts) {
|
|
|
47
47
|
headed: opts.headed,
|
|
48
48
|
});
|
|
49
49
|
log(` → ${paths.storyboard}`);
|
|
50
|
+
// Validate the storyboard (schema, no browser — cheap) before the long
|
|
51
|
+
// record, so authored actions with a bad selector/shape fail fast here
|
|
52
|
+
// instead of mid-take. Fatal: a broken storyboard can't be recorded.
|
|
53
|
+
const validation = await validateStoryboard(paths, config.aidemoDir);
|
|
54
|
+
if (!validation.ok) {
|
|
55
|
+
throw new Error("Storyboard is invalid — fix it before recording:\n - " +
|
|
56
|
+
validation.issues.join("\n - ") +
|
|
57
|
+
"\n(Author actions against real selectors; re-run author_storyboard, then validate.)");
|
|
58
|
+
}
|
|
59
|
+
// The storyboard still has aidemo's `<placeholder>` narration unless the
|
|
60
|
+
// agent authored it first (author_storyboard / the write-demo-narration
|
|
61
|
+
// skill). Recording+seeding placeholders yields a Script page full of
|
|
62
|
+
// `<hook: ...>` text. Warn (don't block — an automated run may intend it),
|
|
63
|
+
// so the result is understood. `authorNarration` opts out of the warning.
|
|
64
|
+
if (!opts.authorNarration) {
|
|
65
|
+
const unfilled = await placeholderScenes(paths);
|
|
66
|
+
if (unfilled.length) {
|
|
67
|
+
warnings.push(`${unfilled.length} scene(s) still have placeholder narration (<...>). The Script ` +
|
|
68
|
+
`page will show those literally. Author real narration first (author_storyboard / the ` +
|
|
69
|
+
`write-demo-narration skill) for a usable first draft.`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
50
72
|
// Gated target site: log in and capture a storageState for aidemo to seed.
|
|
51
73
|
let storageState;
|
|
52
74
|
if (opts.targetEmail && opts.targetPassword) {
|
package/dist/pipeline.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EACL,aAAa,EACb,MAAM,EACN,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,kBAAkB,GAEnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAqCjC,8FAA8F;AAC9F,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAoB,EACpB,IAAgB;IAEhB,MAAM,GA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AC/B,cAAc;QACd,YAAY;QACZ,gFAAgF;QAChF,OAAO;QACP,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE;KACxD,CAAC,CAAC;IACH,MAAM,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAC1C,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,MAAM,EAClC,CAAC,CACF,CAAC;IACF,GAAG,CAAC,YAAY,OAAO,CAAC,KAAK,CAAC,MAAM,aAAa,eAAe,iBAAiB,CAAC,CAAC;IAEnF,GAAG,CAAC,mDAAmD,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAE5E,OAAO;QACL,GAAG,MAAM;QACT,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM;QAC/B,eAAe;QACf,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
package/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifest_version": "0.4",
|
|
3
3
|
"name": "videomule-aidemo-bridge",
|
|
4
4
|
"display_name": "VideoMule Record → Script",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.3.0",
|
|
6
6
|
"description": "Record any website flow on your computer and turn it into an editable VideoMule video script — just by asking your AI assistant.",
|
|
7
7
|
"long_description": "Ask your AI assistant to record a website, and VideoMule captures the flow right here on your computer, then opens a ready-to-edit Script page in your VideoMule project. Tidy up the script, and VideoMule adds the voiceover and renders the final video. Sign in to VideoMule once, in the window that opens on first use — that's it. Needs Google Chrome on your computer.",
|
|
8
8
|
"author": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@videomule/recorder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Record a web flow with aidemo, then seed a VideoMule project's editable Script page from the recording. aidemo is used as-is (its CLI/MCP); VideoMule owns voiceover + render.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"typecheck": "tsc --noEmit",
|
|
17
|
-
"build": "tsc -p tsconfig.build.json",
|
|
17
|
+
"build": "node scripts/sync-manifest-version.mjs && tsc -p tsconfig.build.json",
|
|
18
18
|
"bridge": "tsx src/cli.ts",
|
|
19
19
|
"mcp": "tsx src/mcp-server.ts",
|
|
20
20
|
"prepublishOnly": "npm run build",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"bin",
|
|
27
27
|
"manifest.json",
|
|
28
28
|
".claude-plugin",
|
|
29
|
+
".claude/skills",
|
|
29
30
|
"plugins",
|
|
30
31
|
"docs",
|
|
31
32
|
"README.md",
|