agentcut 0.2.16 → 0.2.18
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/README.md +127 -0
- package/dist/bridge.d.ts +1 -0
- package/dist/bridge.js +9 -4
- package/dist/bridge.js.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/log.js +6 -1
- package/dist/log.js.map +1 -1
- package/dist/studio/agents/claude.d.ts +22 -1
- package/dist/studio/agents/claude.js +89 -3
- package/dist/studio/agents/claude.js.map +1 -1
- package/dist/studio/agents/types.d.ts +6 -0
- package/dist/studio/chat.d.ts +2 -0
- package/dist/studio/chat.js +11 -9
- package/dist/studio/chat.js.map +1 -1
- package/dist/studio/cli.js +43 -21
- package/dist/studio/cli.js.map +1 -1
- package/dist/studio/editing-styles.d.ts +26 -0
- package/dist/studio/editing-styles.js +84 -0
- package/dist/studio/editing-styles.js.map +1 -0
- package/dist/studio/host.d.ts +11 -2
- package/dist/studio/host.js +124 -5
- package/dist/studio/host.js.map +1 -1
- package/dist/studio/housekeeping.d.ts +16 -0
- package/dist/studio/housekeeping.js +152 -0
- package/dist/studio/housekeeping.js.map +1 -0
- package/dist/studio/http.d.ts +3 -0
- package/dist/studio/http.js +25 -0
- package/dist/studio/http.js.map +1 -1
- package/dist/studio/mcp-files.d.ts +34 -0
- package/dist/studio/mcp-files.js +159 -0
- package/dist/studio/mcp-files.js.map +1 -0
- package/dist/studio/mcp-guides.d.ts +4 -0
- package/dist/studio/mcp-guides.js +93 -0
- package/dist/studio/mcp-guides.js.map +1 -0
- package/dist/studio/projects.d.ts +1 -1
- package/dist/studio/proxies.d.ts +45 -0
- package/dist/studio/proxies.js +263 -0
- package/dist/studio/proxies.js.map +1 -0
- package/dist/studio/references.d.ts +18 -0
- package/dist/studio/references.js +21 -4
- package/dist/studio/references.js.map +1 -1
- package/dist/studio/release-browser.d.ts +25 -0
- package/dist/studio/release-browser.js +191 -0
- package/dist/studio/release-browser.js.map +1 -0
- package/dist/studio/release-cursor.d.ts +3 -0
- package/dist/studio/release-cursor.js +27 -0
- package/dist/studio/release-cursor.js.map +1 -0
- package/dist/studio/release-edit.d.ts +34 -0
- package/dist/studio/release-edit.js +183 -0
- package/dist/studio/release-edit.js.map +1 -0
- package/dist/studio/release-recorder.d.ts +30 -0
- package/dist/studio/release-recorder.js +273 -0
- package/dist/studio/release-recorder.js.map +1 -0
- package/dist/studio/release-video.d.ts +693 -0
- package/dist/studio/release-video.js +616 -0
- package/dist/studio/release-video.js.map +1 -0
- package/dist/studio/render.d.ts +2 -0
- package/dist/studio/render.js +33 -15
- package/dist/studio/render.js.map +1 -1
- package/dist/studio/reveal.d.ts +3 -1
- package/dist/studio/reveal.js +26 -8
- package/dist/studio/reveal.js.map +1 -1
- package/dist/studio/schema.d.ts +23642 -2685
- package/dist/studio/schema.js +61 -4
- package/dist/studio/schema.js.map +1 -1
- package/dist/studio/share.d.ts +2 -0
- package/dist/studio/share.js +7 -1
- package/dist/studio/share.js.map +1 -1
- package/dist/studio/tools.d.ts +4 -0
- package/dist/studio/tools.js +103 -4
- package/dist/studio/tools.js.map +1 -1
- package/dist/studio/transcription/service.js +2 -1
- package/dist/studio/transcription/service.js.map +1 -1
- package/dist/studio/workspace.d.ts +1 -0
- package/dist/studio/workspace.js +1 -0
- package/dist/studio/workspace.js.map +1 -1
- package/package.json +2 -1
- package/template/AGENTS.md +1 -0
- package/template/components/color/grade-effect.ts +650 -0
- package/template/components/color/grade.ts +512 -0
- package/template/components/color/looks.ts +154 -0
- package/template/components/index.ts +14 -0
- package/template/components/live-clip.ts +75 -0
- package/template/runtime/composition.tsx +274 -24
- package/template/runtime/helpers.tsx +2 -0
- package/template/runtime/types.ts +67 -4
- package/template/skill/SKILL.md +120 -5
- package/template/skill/references/broll.md +2 -1
- package/template/skill/references/color.md +79 -0
- package/template/skill/references/editing-styles.md +57 -0
- package/template/skill/references/footage.md +72 -73
- package/template/skill/references/format.md +142 -140
- package/template/skill/references/performance.md +14 -2
- package/template/skill/references/person-cutout.md +19 -0
- package/template/skill/references/presets.md +60 -56
- package/template/skill/references/sound.md +151 -151
- package/template/skill/references/website-howto.md +41 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { dirname, delimiter, join } from "node:path";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { spawn } from "node:child_process";
|
|
5
|
+
import { killTree, DETACH_FOR_GROUP_KILL } from "./proc.js";
|
|
6
|
+
import { ensureFfmpeg } from "./references.js";
|
|
7
|
+
import { ReleaseRecorder } from "./release-recorder.js";
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
9
|
+
/** The package supplies the controller; Chrome and the shared recorder are acquired on demand. */
|
|
10
|
+
export class ReleaseBrowser {
|
|
11
|
+
session;
|
|
12
|
+
profile;
|
|
13
|
+
headed;
|
|
14
|
+
children = new Set();
|
|
15
|
+
ffmpeg = null;
|
|
16
|
+
ready = null;
|
|
17
|
+
stopped = false;
|
|
18
|
+
recorder = null;
|
|
19
|
+
get isClosed() {
|
|
20
|
+
return this.stopped;
|
|
21
|
+
}
|
|
22
|
+
async abortRecording() {
|
|
23
|
+
this.recorder?.cancel();
|
|
24
|
+
this.recorder = null;
|
|
25
|
+
}
|
|
26
|
+
constructor(session, profile, headed) {
|
|
27
|
+
this.session = session;
|
|
28
|
+
this.profile = profile;
|
|
29
|
+
this.headed = headed;
|
|
30
|
+
}
|
|
31
|
+
async run(args, timeoutMs = 90_000) {
|
|
32
|
+
if (this.stopped)
|
|
33
|
+
throw new Error("Video job was cancelled.");
|
|
34
|
+
const cli = join(dirname(require.resolve("agent-browser/package.json")), "bin", "agent-browser.js");
|
|
35
|
+
return new Promise((resolve, reject) => {
|
|
36
|
+
// The upstream JS launcher uses windowsHide:false for its native child.
|
|
37
|
+
// Call the Windows binary directly so helper commands cannot flash terminals.
|
|
38
|
+
const native = join(dirname(cli), "agent-browser-win32-x64.exe");
|
|
39
|
+
const direct = process.platform === "win32" && existsSync(native);
|
|
40
|
+
const child = spawn(direct ? native : process.execPath, direct ? args : [cli, ...args], {
|
|
41
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
42
|
+
windowsHide: true,
|
|
43
|
+
detached: DETACH_FOR_GROUP_KILL,
|
|
44
|
+
env: {
|
|
45
|
+
...process.env,
|
|
46
|
+
PATH: this.ffmpeg
|
|
47
|
+
? `${dirname(this.ffmpeg)}${delimiter}${process.env.PATH ?? ""}`
|
|
48
|
+
: process.env.PATH,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
this.children.add(child);
|
|
52
|
+
let output = "", errors = "";
|
|
53
|
+
const timer = setTimeout(() => {
|
|
54
|
+
killTree(child);
|
|
55
|
+
reject(new Error("Browser command timed out. The job has stopped; do not retry it blindly."));
|
|
56
|
+
}, timeoutMs);
|
|
57
|
+
child.stdout.on("data", (data) => {
|
|
58
|
+
output = (output + data).slice(-1_000_000);
|
|
59
|
+
});
|
|
60
|
+
child.stderr.on("data", (data) => {
|
|
61
|
+
errors = (errors + data).slice(-4000);
|
|
62
|
+
});
|
|
63
|
+
child.on("error", reject);
|
|
64
|
+
child.on("close", (code) => {
|
|
65
|
+
clearTimeout(timer);
|
|
66
|
+
this.children.delete(child);
|
|
67
|
+
if (code !== 0) {
|
|
68
|
+
let message = (errors || output || `Browser exited ${code}`).slice(-4000);
|
|
69
|
+
try {
|
|
70
|
+
message = String(JSON.parse(output).error || message);
|
|
71
|
+
}
|
|
72
|
+
catch { }
|
|
73
|
+
if (/encoder fell.*behind capture/i.test(message))
|
|
74
|
+
message =
|
|
75
|
+
"The recorder could not keep up with this computer's load. The job stopped. Close heavy work and create a new job to retry.";
|
|
76
|
+
return reject(new Error(message));
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
const result = JSON.parse(output);
|
|
80
|
+
if (result.success === false)
|
|
81
|
+
reject(new Error(String(result.error ?? "Browser command failed.")));
|
|
82
|
+
else
|
|
83
|
+
resolve(result.data ?? result);
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
resolve({ output: output.trim() });
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
setup(progress) {
|
|
92
|
+
this.ready ??= (async () => {
|
|
93
|
+
progress();
|
|
94
|
+
this.ffmpeg = await ensureFfmpeg(progress);
|
|
95
|
+
await this.run(["install"], 5 * 60_000);
|
|
96
|
+
})().catch((error) => {
|
|
97
|
+
this.ready = null;
|
|
98
|
+
throw error;
|
|
99
|
+
});
|
|
100
|
+
return this.ready;
|
|
101
|
+
}
|
|
102
|
+
command(args) {
|
|
103
|
+
return this.run([
|
|
104
|
+
"--session",
|
|
105
|
+
this.session,
|
|
106
|
+
"--profile",
|
|
107
|
+
this.profile,
|
|
108
|
+
...(this.headed ? ["--headed"] : []),
|
|
109
|
+
"--json",
|
|
110
|
+
...args,
|
|
111
|
+
]);
|
|
112
|
+
}
|
|
113
|
+
/** No page text or form values leave the browser when a login form is present. */
|
|
114
|
+
async needsLogin() {
|
|
115
|
+
const result = await this.command([
|
|
116
|
+
"eval",
|
|
117
|
+
"Boolean(document.querySelector('input[type=password]')) || /\\/(login|signin|sign-in|auth)(\\/|$)/i.test(location.pathname)",
|
|
118
|
+
]);
|
|
119
|
+
return result.result === true;
|
|
120
|
+
}
|
|
121
|
+
async duration(file) {
|
|
122
|
+
if (!this.ffmpeg)
|
|
123
|
+
throw new Error("Recorder is not ready.");
|
|
124
|
+
return new Promise((resolve, reject) => {
|
|
125
|
+
const child = spawn(this.ffmpeg, ["-hide_banner", "-i", file, "-frames:v", "1", "-f", "null", "-"], { windowsHide: true });
|
|
126
|
+
this.children.add(child);
|
|
127
|
+
let log = "";
|
|
128
|
+
const timer = setTimeout(() => {
|
|
129
|
+
killTree(child);
|
|
130
|
+
reject(new Error("Recording validation timed out."));
|
|
131
|
+
}, 30_000);
|
|
132
|
+
child.stderr.on("data", (data) => {
|
|
133
|
+
log = (log + data).slice(-12000);
|
|
134
|
+
});
|
|
135
|
+
child.on("error", reject);
|
|
136
|
+
child.on("close", (code) => {
|
|
137
|
+
clearTimeout(timer);
|
|
138
|
+
this.children.delete(child);
|
|
139
|
+
const match = /Duration: (\d+):(\d+):(\d+\.\d+)/.exec(log);
|
|
140
|
+
if (code !== 0 || !match || !/Video:/.test(log))
|
|
141
|
+
return reject(new Error("The browser did not produce a readable video."));
|
|
142
|
+
resolve(Number(match[1]) * 3600 + Number(match[2]) * 60 + Number(match[3]));
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
async startRecording(file, cursor = false) {
|
|
147
|
+
const endpoint = await this.command(["get", "cdp-url"]);
|
|
148
|
+
const page = await this.command(["get", "url"]);
|
|
149
|
+
this.recorder = new ReleaseRecorder();
|
|
150
|
+
try {
|
|
151
|
+
await this.recorder.start(this.ffmpeg, String(endpoint.cdpUrl), String(page.url), file, cursor);
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
this.recorder.cancel();
|
|
155
|
+
this.recorder = null;
|
|
156
|
+
throw error;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
async moveCursor(selector) {
|
|
160
|
+
if (this.recorder)
|
|
161
|
+
await this.recorder.moveToSelector(selector);
|
|
162
|
+
}
|
|
163
|
+
async typeDemo(selector, text, delayMs) {
|
|
164
|
+
if (!this.recorder)
|
|
165
|
+
throw new Error("Demo typing requires an active recording.");
|
|
166
|
+
await this.moveCursor(selector);
|
|
167
|
+
await this.command(["click", selector]);
|
|
168
|
+
await this.recorder.typeDemo(selector, text, delayMs);
|
|
169
|
+
}
|
|
170
|
+
async stopRecording() {
|
|
171
|
+
if (this.recorder) {
|
|
172
|
+
const recorder = this.recorder;
|
|
173
|
+
this.recorder = null;
|
|
174
|
+
await recorder.stop();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
async close() {
|
|
178
|
+
this.recorder?.cancel();
|
|
179
|
+
this.recorder = null;
|
|
180
|
+
for (const child of this.children)
|
|
181
|
+
killTree(child);
|
|
182
|
+
this.children.clear();
|
|
183
|
+
// The CLI talks to a persistent per-session daemon. Closing the CLI alone is insufficient.
|
|
184
|
+
try {
|
|
185
|
+
await this.command(["close"]);
|
|
186
|
+
}
|
|
187
|
+
catch { }
|
|
188
|
+
this.stopped = true;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=release-browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-browser.js","sourceRoot":"","sources":["../../src/studio/release-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,kGAAkG;AAClG,MAAM,OAAO,cAAc;IAgBd;IACA;IACQ;IAjBX,QAAQ,GAAG,IAAI,GAAG,EAAgB,CAAC;IACnC,MAAM,GAAkB,IAAI,CAAC;IAC7B,KAAK,GAAyB,IAAI,CAAC;IACnC,OAAO,GAAG,KAAK,CAAC;IAChB,QAAQ,GAA2B,IAAI,CAAC;IAChD,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,C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CAAC,QAAQ;YAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;QACnD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,2FAA2F;QAC3F,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAChC,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;QACV,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** A page overlay keeps cursor motion in the captured Chrome pixels. No desktop
|
|
2
|
+
* capture, native cursor compositor, or separate image encoder is required. */
|
|
3
|
+
export function cursorOverlayScript(id) {
|
|
4
|
+
return `(() => {
|
|
5
|
+
if (window !== window.top) return;
|
|
6
|
+
const install = () => {
|
|
7
|
+
if (document.getElementById(${JSON.stringify(id)})) return;
|
|
8
|
+
const root = document.createElement('div'); root.id = ${JSON.stringify(id)};
|
|
9
|
+
root.setAttribute('aria-hidden','true'); root.style.cssText = 'position:fixed;inset:0;pointer-events:none;z-index:2147483647;contain:strict';
|
|
10
|
+
const pointer = document.createElement('div');
|
|
11
|
+
pointer.style.cssText = 'position:absolute;left:0;top:0;width:30px;height:36px;transform:translate(1100px,760px);filter:drop-shadow(0 2px 2px #0d142455)';
|
|
12
|
+
pointer.innerHTML = '<svg width="30" height="36" viewBox="0 0 30 36"><path d="M3 2L4 28l7-7 6 12 5-3-6-11 10-1Z" fill="#0d1424" stroke="white" stroke-width="2.3" stroke-linejoin="round"/></svg>';
|
|
13
|
+
root.append(pointer); document.documentElement.append(root);
|
|
14
|
+
const move = e => { pointer.style.transform = 'translate(' + e.clientX + 'px,' + e.clientY + 'px)'; };
|
|
15
|
+
const down = e => {
|
|
16
|
+
move(e); const ripple = document.createElement('div');
|
|
17
|
+
ripple.style.cssText = 'position:absolute;width:44px;height:44px;border:3px solid #2f74f0;background:#2f74f026;border-radius:50%;left:'+(e.clientX-22)+'px;top:'+(e.clientY-22)+'px';
|
|
18
|
+
root.prepend(ripple); ripple.animate([{transform:'scale(.3)',opacity:1},{transform:'scale(1.5)',opacity:0}],{duration:450,easing:'cubic-bezier(.16,1,.3,1)'}).onfinish=()=>ripple.remove();
|
|
19
|
+
};
|
|
20
|
+
addEventListener('mousemove',move,true); addEventListener('mousedown',down,true);
|
|
21
|
+
root.__cleanup = () => { removeEventListener('mousemove',move,true); removeEventListener('mousedown',down,true); root.remove(); };
|
|
22
|
+
};
|
|
23
|
+
window[${JSON.stringify(id)}] = () => { removeEventListener('DOMContentLoaded',install); document.getElementById(${JSON.stringify(id)})?.__cleanup?.(); delete window[${JSON.stringify(id)}]; };
|
|
24
|
+
if (document.documentElement) install(); else addEventListener('DOMContentLoaded',install,{once:true});
|
|
25
|
+
})()`;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=release-cursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-cursor.js","sourceRoot":"","sources":["../../src/studio/release-cursor.ts"],"names":[],"mappings":"AAAA;+EAC+E;AAC/E,MAAM,UAAU,mBAAmB,CAAC,EAAU;IAC5C,OAAO;;;kCAGyB,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;4DACQ,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;;;;;;;;;;;;;;;aAejE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,wFAAwF,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,mCAAmC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;;OAEvL,CAAC;AACR,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { WorkspacePaths } from "./workspace.js";
|
|
2
|
+
import type { ReleaseJob } from "./release-video.js";
|
|
3
|
+
interface EditPlan {
|
|
4
|
+
opening: string;
|
|
5
|
+
closing: string;
|
|
6
|
+
story: {
|
|
7
|
+
message: string;
|
|
8
|
+
disclosure?: string;
|
|
9
|
+
audience: string;
|
|
10
|
+
before: string;
|
|
11
|
+
after: string;
|
|
12
|
+
};
|
|
13
|
+
scenes: {
|
|
14
|
+
title: string;
|
|
15
|
+
purpose: string;
|
|
16
|
+
evidence: string;
|
|
17
|
+
expectedChange: string;
|
|
18
|
+
focus?: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
24
|
+
beats?: {
|
|
25
|
+
actionIndex: number;
|
|
26
|
+
headline: string;
|
|
27
|
+
explanation: string;
|
|
28
|
+
}[];
|
|
29
|
+
}[];
|
|
30
|
+
}
|
|
31
|
+
/** Translate actual capture cue times into source trims and editable story beats.
|
|
32
|
+
* No footage, conversation, timing or zoom is invented by the edit builder. */
|
|
33
|
+
export declare function buildReleaseEdit(paths: WorkspacePaths, job: ReleaseJob, plan: EditPlan): void;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { readProjectState, writeLayers, writeProjectFile, atomicWrite, } from "./projects.js";
|
|
4
|
+
/** Translate actual capture cue times into source trims and editable story beats.
|
|
5
|
+
* No footage, conversation, timing or zoom is invented by the edit builder. */
|
|
6
|
+
export function buildReleaseEdit(paths, job, plan) {
|
|
7
|
+
const state = readProjectState(paths, job.slug);
|
|
8
|
+
if (!state.project)
|
|
9
|
+
throw new Error("The recorded project is invalid.");
|
|
10
|
+
const fps = state.project.fps;
|
|
11
|
+
const openingFrames = Math.max(90, Math.ceil((plan.opening.split(/\s+/).length / 3) * fps));
|
|
12
|
+
const closingFrames = Math.max(100, Math.ceil((plan.closing.split(/\s+/).length / 3) * fps));
|
|
13
|
+
let frame = openingFrames;
|
|
14
|
+
const videos = [], headings = [], explanations = [], numbers = [], markers = [];
|
|
15
|
+
const edit = [];
|
|
16
|
+
const text = (id, from, duration, value, box, fontSize, color = "#101b30", weight = 650) => ({
|
|
17
|
+
id,
|
|
18
|
+
from,
|
|
19
|
+
duration,
|
|
20
|
+
text: value,
|
|
21
|
+
box,
|
|
22
|
+
style: {
|
|
23
|
+
fontFamily: "Segoe UI",
|
|
24
|
+
fontSize,
|
|
25
|
+
fontWeight: weight,
|
|
26
|
+
color,
|
|
27
|
+
align: "left",
|
|
28
|
+
lineHeight: 1.15,
|
|
29
|
+
},
|
|
30
|
+
enter: { preset: "fade", frames: 8 },
|
|
31
|
+
exit: { preset: "fade", frames: 6 },
|
|
32
|
+
});
|
|
33
|
+
let index = 0;
|
|
34
|
+
job.recordings.forEach((take, sceneIndex) => {
|
|
35
|
+
const scene = plan.scenes[sceneIndex];
|
|
36
|
+
const beats = scene.beats?.length
|
|
37
|
+
? scene.beats
|
|
38
|
+
: [
|
|
39
|
+
{
|
|
40
|
+
actionIndex: 0,
|
|
41
|
+
headline: scene.title,
|
|
42
|
+
explanation: scene.expectedChange,
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
const boundaries = beats.map((beat, i) => i === 0
|
|
46
|
+
? 0
|
|
47
|
+
: Math.max(0, (take.cues?.find((c) => c.actionIndex === beat.actionIndex)
|
|
48
|
+
?.start ?? 0) - 0.25));
|
|
49
|
+
if (boundaries.some((time, i) => i > 0 && time <= boundaries[i - 1]))
|
|
50
|
+
throw new Error("Story beats must use increasing recorded action cues.");
|
|
51
|
+
beats.forEach((beat, beatIndex) => {
|
|
52
|
+
const sourceStart = Math.round(boundaries[beatIndex] * fps);
|
|
53
|
+
const sourceEnd = boundaries[beatIndex + 1] === undefined
|
|
54
|
+
? Math.floor((take.seconds - 0.2) * fps)
|
|
55
|
+
: Math.round(boundaries[beatIndex + 1] * fps);
|
|
56
|
+
const duration = sourceEnd - sourceStart;
|
|
57
|
+
if (duration < fps)
|
|
58
|
+
throw new Error("A story beat is too short to show its action and result. Add a readable hold before the next action.");
|
|
59
|
+
const id = `beat-${++index}`;
|
|
60
|
+
videos.push({
|
|
61
|
+
id: `${id}-footage`,
|
|
62
|
+
name: beat.headline,
|
|
63
|
+
from: frame,
|
|
64
|
+
duration,
|
|
65
|
+
src: take.path,
|
|
66
|
+
trimStart: sourceStart,
|
|
67
|
+
muted: true,
|
|
68
|
+
fit: "contain",
|
|
69
|
+
camera: "none",
|
|
70
|
+
...(scene.focus ? { framing: { crop: scene.focus } } : {}),
|
|
71
|
+
box: { x: 0.28, y: 0.15, width: 0.69, height: 0.76 },
|
|
72
|
+
radius: 20,
|
|
73
|
+
});
|
|
74
|
+
headings.push(text(`${id}-heading`, frame, duration, beat.headline, { x: 0.045, y: 0.29, width: 0.205, height: 0.28 }, 48));
|
|
75
|
+
explanations.push(text(`${id}-explanation`, frame, duration, beat.explanation, { x: 0.045, y: 0.59, width: 0.205, height: 0.2 }, 25, "#536176", 450));
|
|
76
|
+
numbers.push(text(`${id}-number`, frame, duration, String(index).padStart(2, "0"), { x: 0.045, y: 0.2, width: 0.16, height: 0.06 }, 25, "#2f74f0", 700));
|
|
77
|
+
markers.push({ id, frame, label: beat.headline, kind: "section" });
|
|
78
|
+
edit.push({
|
|
79
|
+
id,
|
|
80
|
+
from: frame,
|
|
81
|
+
duration,
|
|
82
|
+
source: take.path,
|
|
83
|
+
trimStart: sourceStart,
|
|
84
|
+
headline: beat.headline,
|
|
85
|
+
explanation: beat.explanation,
|
|
86
|
+
evidence: scene.evidence,
|
|
87
|
+
});
|
|
88
|
+
frame += duration;
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
const total = frame + closingFrames;
|
|
92
|
+
const brand = job.input.name.replace(/\s*[—–].*$/, "");
|
|
93
|
+
const titles = [
|
|
94
|
+
text("opening-kicker", 0, openingFrames, "PRODUCT UPDATE", { x: 0.07, y: 0.22, width: 0.8, height: 0.07 }, 27, "#2f74f0", 750),
|
|
95
|
+
text("opening", 0, openingFrames, plan.opening, { x: 0.07, y: 0.34, width: 0.84, height: 0.38 }, 96),
|
|
96
|
+
text("closing", frame, closingFrames, plan.closing, { x: 0.07, y: 0.29, width: 0.84, height: 0.4 }, 94),
|
|
97
|
+
text("closing-message", frame, closingFrames, plan.story.message, { x: 0.07, y: 0.73, width: 0.78, height: 0.12 }, 31, "#536176", 450),
|
|
98
|
+
];
|
|
99
|
+
const persistent = [
|
|
100
|
+
text("brand", 0, total, brand, { x: 0.045, y: 0.045, width: 0.75, height: 0.06 }, 27, "#101b30", 750),
|
|
101
|
+
...(plan.story.disclosure
|
|
102
|
+
? [
|
|
103
|
+
text("disclosure", 0, total, plan.story.disclosure, { x: 0.045, y: 0.945, width: 0.91, height: 0.035 }, 20, "#536176", 450),
|
|
104
|
+
]
|
|
105
|
+
: []),
|
|
106
|
+
];
|
|
107
|
+
writeFileSync(join(state.dir, "scenes", "ReleaseBackdrop.tsx"), `import React from 'react';\nimport {useCurrentFrame,useVideoConfig,interpolate} from 'remotion';\nexport default function ReleaseBackdrop({duration=900}){const f=useCurrentFrame();const {width,height}=useVideoConfig();return <div style={{position:'absolute',inset:0,background:'#f5f8fc'}}><div style={{position:'absolute',left:width*.045,right:width*.03,top:height*.12,height:1,background:'#dbe4f1'}}/><div style={{position:'absolute',left:width*.045,bottom:height*.014,width:width*.91,height:3,background:'#e2eaf5'}}/><div style={{position:'absolute',left:width*.045,bottom:height*.014,width:width*.91*interpolate(f,[0,duration],[0,1],{extrapolateRight:'clamp'}),height:3,background:'#2f74f0'}}/></div>;}\n`);
|
|
108
|
+
writeProjectFile(paths, job.slug, {
|
|
109
|
+
...state.project,
|
|
110
|
+
background: "#f5f8fc",
|
|
111
|
+
fonts: [],
|
|
112
|
+
variants: { wide: { width: 1920, height: 1080 } },
|
|
113
|
+
defaultVariant: "wide",
|
|
114
|
+
durationInFrames: total,
|
|
115
|
+
});
|
|
116
|
+
writeLayers(paths, job.slug, {
|
|
117
|
+
version: 1,
|
|
118
|
+
tracks: [
|
|
119
|
+
{
|
|
120
|
+
id: "titles",
|
|
121
|
+
name: "Opening and closing",
|
|
122
|
+
kind: "text",
|
|
123
|
+
clips: [titles[1], titles[2]],
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: "kicker",
|
|
127
|
+
name: "Opening label",
|
|
128
|
+
kind: "text",
|
|
129
|
+
clips: [titles[0]],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: "closing-message",
|
|
133
|
+
name: "Closing explanation",
|
|
134
|
+
kind: "text",
|
|
135
|
+
clips: [titles[3]],
|
|
136
|
+
},
|
|
137
|
+
{ id: "brand", name: "Brand", kind: "text", clips: [persistent[0]] },
|
|
138
|
+
{
|
|
139
|
+
id: "disclosure",
|
|
140
|
+
name: "Demo disclosure",
|
|
141
|
+
kind: "text",
|
|
142
|
+
clips: persistent.slice(1),
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: "headlines",
|
|
146
|
+
name: "Story headlines",
|
|
147
|
+
kind: "text",
|
|
148
|
+
clips: headings,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: "explanations",
|
|
152
|
+
name: "What changed and why",
|
|
153
|
+
kind: "text",
|
|
154
|
+
clips: explanations,
|
|
155
|
+
},
|
|
156
|
+
{ id: "steps", name: "Story steps", kind: "text", clips: numbers },
|
|
157
|
+
{
|
|
158
|
+
id: "footage",
|
|
159
|
+
name: "Recorded actions and results",
|
|
160
|
+
kind: "video",
|
|
161
|
+
clips: videos,
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: "backdrop",
|
|
165
|
+
name: "Presentation and progress",
|
|
166
|
+
kind: "scene",
|
|
167
|
+
clips: [
|
|
168
|
+
{
|
|
169
|
+
id: "backdrop",
|
|
170
|
+
scene: "ReleaseBackdrop",
|
|
171
|
+
from: 0,
|
|
172
|
+
duration: total,
|
|
173
|
+
props: { duration: total },
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
markers,
|
|
179
|
+
}, state.layersHash);
|
|
180
|
+
atomicWrite(join(state.dir, ".studio", "edit-decision-list.json"), JSON.stringify({ story: plan.story, fps, durationInFrames: total, beats: edit }, null, 2) + "\n");
|
|
181
|
+
writeFileSync(join(state.dir, "notes.md"), `# ${job.input.name}\n\n${plan.story.message}\n\nAudience: ${plan.story.audience}\nBefore: ${plan.story.before}\nAfter: ${plan.story.after}\n\n${plan.story.disclosure ?? "Recorded from the supplied website."}\n\nTitles, explanations, source trims and footage are separate editable tracks. Cuts use actual recorded action times. No arbitrary zooms are added. Source recordings remain in assets/.\n\nReview the story and full playback before sharing.\n`);
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=release-edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-edit.js","sourceRoot":"","sources":["../../src/studio/release-edit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,WAAW,GACZ,MAAM,eAAe,CAAC;AAwBvB;+EAC+E;AAC/E,MAAM,UAAU,gBAAgB,CAC9B,KAAqB,EACrB,GAAe,EACf,IAAc;IAEd,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,CAAC,KAAK,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACxE,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;IAC9B,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAC5B,EAAE,EACF,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CACxD,CAAC;IACF,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAC5B,GAAG,EACH,IAAI,CAAC,I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rome page, not the desktop. Keep a single latest frame in
|
|
2
|
+
* memory and preserve wall-clock timing through encoder backpressure. */
|
|
3
|
+
export declare class ReleaseRecorder {
|
|
4
|
+
private socket;
|
|
5
|
+
private child;
|
|
6
|
+
private pending;
|
|
7
|
+
private counter;
|
|
8
|
+
private session;
|
|
9
|
+
private frame;
|
|
10
|
+
private started;
|
|
11
|
+
private written;
|
|
12
|
+
private stopping;
|
|
13
|
+
private cancelled;
|
|
14
|
+
private pump;
|
|
15
|
+
private failure;
|
|
16
|
+
private log;
|
|
17
|
+
private exited;
|
|
18
|
+
private cursorId;
|
|
19
|
+
private cursorScriptId;
|
|
20
|
+
private pointer;
|
|
21
|
+
private call;
|
|
22
|
+
start(ffmpeg: string, endpoint: string, pageUrl: string, file: string, cursor?: boolean): Promise<void>;
|
|
23
|
+
moveToSelector(selector: string, milliseconds?: number): Promise<void>;
|
|
24
|
+
typeDemo(selector: string, text: string, delayMs: number): Promise<void>;
|
|
25
|
+
private removeCursor;
|
|
26
|
+
private writeFrames;
|
|
27
|
+
stop(): Promise<void>;
|
|
28
|
+
cancel(): void;
|
|
29
|
+
private dispose;
|
|
30
|
+
}
|