@vibeframe/cli 0.52.1 → 0.53.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/LICENSE +21 -0
- package/dist/agent/tools/index.d.ts +1 -0
- package/dist/agent/tools/index.d.ts.map +1 -1
- package/dist/agent/tools/index.js +3 -0
- package/dist/agent/tools/index.js.map +1 -1
- package/dist/agent/tools/scene.d.ts +17 -0
- package/dist/agent/tools/scene.d.ts.map +1 -0
- package/dist/agent/tools/scene.js +263 -0
- package/dist/agent/tools/scene.js.map +1 -0
- package/dist/agent/tools/scene.test.d.ts +2 -0
- package/dist/agent/tools/scene.test.d.ts.map +1 -0
- package/dist/agent/tools/scene.test.js +139 -0
- package/dist/agent/tools/scene.test.js.map +1 -0
- package/dist/commands/_shared/scene-html-emit.d.ts +85 -0
- package/dist/commands/_shared/scene-html-emit.d.ts.map +1 -0
- package/dist/commands/_shared/scene-html-emit.js +353 -0
- package/dist/commands/_shared/scene-html-emit.js.map +1 -0
- package/dist/commands/_shared/scene-html-emit.test.d.ts +2 -0
- package/dist/commands/_shared/scene-html-emit.test.d.ts.map +1 -0
- package/dist/commands/_shared/scene-html-emit.test.js +203 -0
- package/dist/commands/_shared/scene-html-emit.test.js.map +1 -0
- package/dist/commands/_shared/scene-lint.d.ts +110 -0
- package/dist/commands/_shared/scene-lint.d.ts.map +1 -0
- package/dist/commands/_shared/scene-lint.js +207 -0
- package/dist/commands/_shared/scene-lint.js.map +1 -0
- package/dist/commands/_shared/scene-lint.test.d.ts +2 -0
- package/dist/commands/_shared/scene-lint.test.d.ts.map +1 -0
- package/dist/commands/_shared/scene-lint.test.js +208 -0
- package/dist/commands/_shared/scene-lint.test.js.map +1 -0
- package/dist/commands/_shared/scene-project.d.ts +101 -0
- package/dist/commands/_shared/scene-project.d.ts.map +1 -0
- package/dist/commands/_shared/scene-project.js +281 -0
- package/dist/commands/_shared/scene-project.js.map +1 -0
- package/dist/commands/_shared/scene-project.test.d.ts +2 -0
- package/dist/commands/_shared/scene-project.test.d.ts.map +1 -0
- package/dist/commands/_shared/scene-project.test.js +203 -0
- package/dist/commands/_shared/scene-project.test.js.map +1 -0
- package/dist/commands/_shared/scene-render.d.ts +79 -0
- package/dist/commands/_shared/scene-render.d.ts.map +1 -0
- package/dist/commands/_shared/scene-render.js +138 -0
- package/dist/commands/_shared/scene-render.js.map +1 -0
- package/dist/commands/_shared/scene-render.test.d.ts +2 -0
- package/dist/commands/_shared/scene-render.test.d.ts.map +1 -0
- package/dist/commands/_shared/scene-render.test.js +145 -0
- package/dist/commands/_shared/scene-render.test.js.map +1 -0
- package/dist/commands/_shared/segments-to-scenes.d.ts +85 -0
- package/dist/commands/_shared/segments-to-scenes.d.ts.map +1 -0
- package/dist/commands/_shared/segments-to-scenes.js +202 -0
- package/dist/commands/_shared/segments-to-scenes.js.map +1 -0
- package/dist/commands/_shared/segments-to-scenes.test.d.ts +2 -0
- package/dist/commands/_shared/segments-to-scenes.test.d.ts.map +1 -0
- package/dist/commands/_shared/segments-to-scenes.test.js +219 -0
- package/dist/commands/_shared/segments-to-scenes.test.js.map +1 -0
- package/dist/commands/ai-script-pipeline-cli.d.ts.map +1 -1
- package/dist/commands/ai-script-pipeline-cli.js +49 -0
- package/dist/commands/ai-script-pipeline-cli.js.map +1 -1
- package/dist/commands/ai-script-pipeline.d.ts +16 -0
- package/dist/commands/ai-script-pipeline.d.ts.map +1 -1
- package/dist/commands/ai-script-pipeline.js +28 -0
- package/dist/commands/ai-script-pipeline.js.map +1 -1
- package/dist/commands/ai.test.js +4 -1
- package/dist/commands/ai.test.js.map +1 -1
- package/dist/commands/scene.d.ts +60 -0
- package/dist/commands/scene.d.ts.map +1 -0
- package/dist/commands/scene.js +621 -0
- package/dist/commands/scene.js.map +1 -0
- package/dist/commands/scene.test.d.ts +2 -0
- package/dist/commands/scene.test.d.ts.map +1 -0
- package/dist/commands/scene.test.js +133 -0
- package/dist/commands/scene.test.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/pipeline/renderers/chrome.d.ts +26 -0
- package/dist/pipeline/renderers/chrome.d.ts.map +1 -0
- package/dist/pipeline/renderers/chrome.js +48 -0
- package/dist/pipeline/renderers/chrome.js.map +1 -0
- package/dist/pipeline/renderers/hyperframes.d.ts.map +1 -1
- package/dist/pipeline/renderers/hyperframes.js +2 -32
- package/dist/pipeline/renderers/hyperframes.js.map +1 -1
- package/package.json +32 -13
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 VibeFrame Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -58,6 +58,7 @@ export { registerMediaTools } from "./media.js";
|
|
|
58
58
|
export { registerAITools } from "./ai.js";
|
|
59
59
|
export { registerExportTools } from "./export.js";
|
|
60
60
|
export { registerBatchTools } from "./batch.js";
|
|
61
|
+
export { registerSceneTools } from "./scene.js";
|
|
61
62
|
/**
|
|
62
63
|
* Register all tools
|
|
63
64
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE5E,MAAM,MAAM,WAAW,GAAG,CACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,YAAY,KAClB,OAAO,CAAC,UAAU,CAAC,CAAC;AAOzB;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAA0C;IAEvD;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI;IAIhE;;OAEG;IACH,cAAc,IAAI,cAAc,EAAE;IAIlC;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAIvD;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAI7C;;OAEG;IACH,MAAM,IAAI,cAAc,EAAE;IAI1B;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAIjD;;OAEG;IACG,OAAO,CACX,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,UAAU,CAAC;IAwBtB;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM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AAM,GAAG,cAAc,GAAG,SAAS;IAI7C;;OAEG;IACH,MAAM,IAAI,cAAc,EAAE;IAI1B;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAIjD;;OAEG;IACG,OAAO,CACX,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,UAAU,CAAC;IAwBtB;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,IAAI,IAAI,MAAM,EAAE;CAGjB;AAGD,eAAO,MAAM,YAAY,cAAqB,CAAC;AAG/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB5E"}
|
|
@@ -98,6 +98,7 @@ export { registerMediaTools } from "./media.js";
|
|
|
98
98
|
export { registerAITools } from "./ai.js";
|
|
99
99
|
export { registerExportTools } from "./export.js";
|
|
100
100
|
export { registerBatchTools } from "./batch.js";
|
|
101
|
+
export { registerSceneTools } from "./scene.js";
|
|
101
102
|
/**
|
|
102
103
|
* Register all tools
|
|
103
104
|
*/
|
|
@@ -109,6 +110,7 @@ export async function registerAllTools(registry) {
|
|
|
109
110
|
const { registerAITools } = await import("./ai.js");
|
|
110
111
|
const { registerExportTools } = await import("./export.js");
|
|
111
112
|
const { registerBatchTools } = await import("./batch.js");
|
|
113
|
+
const { registerSceneTools } = await import("./scene.js");
|
|
112
114
|
registerProjectTools(registry);
|
|
113
115
|
registerTimelineTools(registry);
|
|
114
116
|
registerFilesystemTools(registry);
|
|
@@ -116,5 +118,6 @@ export async function registerAllTools(registry) {
|
|
|
116
118
|
registerAITools(registry);
|
|
117
119
|
registerExportTools(registry);
|
|
118
120
|
registerBatchTools(registry);
|
|
121
|
+
registerSceneTools(registry);
|
|
119
122
|
}
|
|
120
123
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agent/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAcH;;;GAGG;AACH,MAAM,OAAO,YAAY;IACf,KAAK,GAAgC,IAAI,GAAG,EAAE,CAAC;IAEvD;;OAEG;IACH,QAAQ,CAAC,UAA0B,EAAE,OAAoB;QACvD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,IAAY;QACxB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,aAAa,CAA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|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module scene
|
|
3
|
+
* @description Agent tools for the per-scene HTML authoring surface
|
|
4
|
+
* (`vibe scene init/add/lint/render`). Each tool wraps the corresponding
|
|
5
|
+
* `executeXxx` from `commands/scene.ts` (or `_shared/scene-*.ts`) so the LLM
|
|
6
|
+
* agent can author and ship Hyperframes-style scene projects in natural
|
|
7
|
+
* language. Mirrored as MCP tools in `packages/mcp-server/src/tools/scene.ts`.
|
|
8
|
+
*
|
|
9
|
+
* ## Tools: scene_init, scene_add, scene_lint, scene_render
|
|
10
|
+
* ## Cost tier: Low (image+TTS for `scene_add` if narration/visuals supplied,
|
|
11
|
+
* otherwise free; `scene_render` is local Chrome/FFmpeg).
|
|
12
|
+
*/
|
|
13
|
+
import type { ToolRegistry } from "./index.js";
|
|
14
|
+
import type { ToolDefinition } from "../types.js";
|
|
15
|
+
export declare function registerSceneTools(registry: ToolRegistry): void;
|
|
16
|
+
export declare const sceneToolDefinitions: ReadonlyArray<ToolDefinition>;
|
|
17
|
+
//# sourceMappingURL=scene.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene.d.ts","sourceRoot":"","sources":["../../../src/agent/tools/scene.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAe,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,aAAa,CAAC;AA6Q9D,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAK/D;AAID,eAAO,MAAM,oBAAoB,EAAE,aAAa,CAAC,cAAc,CAK9D,CAAC"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module scene
|
|
3
|
+
* @description Agent tools for the per-scene HTML authoring surface
|
|
4
|
+
* (`vibe scene init/add/lint/render`). Each tool wraps the corresponding
|
|
5
|
+
* `executeXxx` from `commands/scene.ts` (or `_shared/scene-*.ts`) so the LLM
|
|
6
|
+
* agent can author and ship Hyperframes-style scene projects in natural
|
|
7
|
+
* language. Mirrored as MCP tools in `packages/mcp-server/src/tools/scene.ts`.
|
|
8
|
+
*
|
|
9
|
+
* ## Tools: scene_init, scene_add, scene_lint, scene_render
|
|
10
|
+
* ## Cost tier: Low (image+TTS for `scene_add` if narration/visuals supplied,
|
|
11
|
+
* otherwise free; `scene_render` is local Chrome/FFmpeg).
|
|
12
|
+
*/
|
|
13
|
+
import { resolve, relative } from "node:path";
|
|
14
|
+
import { scaffoldSceneProject, } from "../../commands/_shared/scene-project.js";
|
|
15
|
+
import { executeSceneAdd, } from "../../commands/scene.js";
|
|
16
|
+
import { runProjectLint, } from "../../commands/_shared/scene-lint.js";
|
|
17
|
+
import { executeSceneRender, } from "../../commands/_shared/scene-render.js";
|
|
18
|
+
const SCENE_PRESETS = [
|
|
19
|
+
"simple",
|
|
20
|
+
"announcement",
|
|
21
|
+
"explainer",
|
|
22
|
+
"kinetic-type",
|
|
23
|
+
"product-shot",
|
|
24
|
+
];
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// Tool definitions
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
const sceneInitDef = {
|
|
29
|
+
name: "scene_init",
|
|
30
|
+
description: "Scaffold a new bilingual VibeFrame + Hyperframes scene project. Creates index.html, hyperframes.json, vibe.project.yaml, compositions/, assets/, .gitignore, and a project-local CLAUDE.md. Idempotent: safe to run on a directory that already has hyperframes.json (the config is merged, not overwritten). No API keys required.",
|
|
31
|
+
parameters: {
|
|
32
|
+
type: "object",
|
|
33
|
+
properties: {
|
|
34
|
+
dir: { type: "string", description: "Project directory (created if missing). Relative paths resolve against the agent's working directory." },
|
|
35
|
+
name: { type: "string", description: "Project name. Defaults to the directory basename." },
|
|
36
|
+
aspect: { type: "string", description: "Aspect ratio for the canvas. Default 16:9.", enum: ["16:9", "9:16", "1:1", "4:5"] },
|
|
37
|
+
duration: { type: "number", description: "Default root composition duration in seconds. Default 10." },
|
|
38
|
+
},
|
|
39
|
+
required: ["dir"],
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
const sceneAddDef = {
|
|
43
|
+
name: "scene_add",
|
|
44
|
+
description: "Add a single scene to an existing scene project. Optionally generates narration audio (ElevenLabs) and/or a backdrop image (Gemini/OpenAI), then emits compositions/scene-<id>.html with a paused GSAP timeline and splices a clip reference into the root index.html. Use `skipAudio: true` and `skipImage: true` for text-only scenes that need no API calls.",
|
|
45
|
+
parameters: {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: {
|
|
48
|
+
name: { type: "string", description: "Scene name. Slugified into the composition id (e.g. 'My Intro' → 'my-intro')." },
|
|
49
|
+
preset: { type: "string", description: `Style preset for the scene HTML. Default 'simple'.`, enum: [...SCENE_PRESETS] },
|
|
50
|
+
narration: { type: "string", description: "Narration text. If the value is a path to an existing .txt/.md file, its contents are used. Drives TTS + scene duration." },
|
|
51
|
+
duration: { type: "number", description: "Explicit scene duration in seconds. Overrides narration audio duration." },
|
|
52
|
+
visuals: { type: "string", description: "Image prompt — generates assets/scene-<id>.png via the configured image provider." },
|
|
53
|
+
headline: { type: "string", description: "Visible headline text. Defaults to the humanised scene name." },
|
|
54
|
+
kicker: { type: "string", description: "Small label above the headline (used by 'explainer' and 'product-shot' presets)." },
|
|
55
|
+
projectDir: { type: "string", description: "Project directory. Defaults to the agent's working directory." },
|
|
56
|
+
insertInto: { type: "string", description: "Root composition file (relative to projectDir). Default 'index.html'." },
|
|
57
|
+
imageProvider: { type: "string", description: "Image provider for --visuals. Default 'gemini'.", enum: ["gemini", "openai"] },
|
|
58
|
+
voice: { type: "string", description: "ElevenLabs voice id or name." },
|
|
59
|
+
skipAudio: { type: "boolean", description: "Skip TTS even if narration is provided. Useful for offline / agent dry runs." },
|
|
60
|
+
skipImage: { type: "boolean", description: "Skip image generation even if visuals is provided." },
|
|
61
|
+
force: { type: "boolean", description: "Overwrite an existing compositions/scene-<id>.html." },
|
|
62
|
+
},
|
|
63
|
+
required: ["name"],
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
const sceneLintDef = {
|
|
67
|
+
name: "scene_lint",
|
|
68
|
+
description: "Validate every scene file in a project against the public Hyperframes lint rules (in-process, no Chrome required). Returns errors, warnings, and info findings per file. Optional `fix: true` mechanically repairs `timed_element_missing_clip_class` only — other issues surface with fixHints for the agent to apply.",
|
|
69
|
+
parameters: {
|
|
70
|
+
type: "object",
|
|
71
|
+
properties: {
|
|
72
|
+
projectDir: { type: "string", description: "Project directory. Defaults to the agent's working directory." },
|
|
73
|
+
root: { type: "string", description: "Root composition file relative to projectDir. Default 'index.html'." },
|
|
74
|
+
fix: { type: "boolean", description: "Apply mechanical auto-fixes (currently: missing class=\"clip\")." },
|
|
75
|
+
},
|
|
76
|
+
required: [],
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
const sceneRenderDef = {
|
|
80
|
+
name: "scene_render",
|
|
81
|
+
description: "Render a scene project to MP4/WebM/MOV via the Hyperframes producer. Requires Chrome installed locally. Output defaults to renders/<projectName>-<isoStamp>.<format>. Costly only in CPU/GPU (no API keys).",
|
|
82
|
+
parameters: {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: {
|
|
85
|
+
projectDir: { type: "string", description: "Project directory. Defaults to the agent's working directory." },
|
|
86
|
+
root: { type: "string", description: "Root composition file relative to projectDir. Default 'index.html'." },
|
|
87
|
+
output: { type: "string", description: "Output file path (relative paths resolve against projectDir)." },
|
|
88
|
+
fps: { type: "number", description: "Frames per second. Must be 24, 30, or 60. Default 30." },
|
|
89
|
+
quality: { type: "string", description: "Quality preset. Default 'standard'.", enum: ["draft", "standard", "high"] },
|
|
90
|
+
format: { type: "string", description: "Container format. Default 'mp4'.", enum: ["mp4", "webm", "mov"] },
|
|
91
|
+
workers: { type: "number", description: "Capture worker count (1-16). Default 1." },
|
|
92
|
+
},
|
|
93
|
+
required: [],
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
// ---------------------------------------------------------------------------
|
|
97
|
+
// Handlers
|
|
98
|
+
// ---------------------------------------------------------------------------
|
|
99
|
+
const sceneInitHandler = async (args, context) => {
|
|
100
|
+
const dir = resolve(context.workingDirectory, args.dir);
|
|
101
|
+
try {
|
|
102
|
+
const result = await scaffoldSceneProject({
|
|
103
|
+
dir,
|
|
104
|
+
name: args.name,
|
|
105
|
+
aspect: args.aspect,
|
|
106
|
+
duration: args.duration,
|
|
107
|
+
});
|
|
108
|
+
const lines = [
|
|
109
|
+
`✅ Scene project scaffolded at ${relative(context.workingDirectory, dir) || dir}`,
|
|
110
|
+
` created: ${result.created.length} file(s)`,
|
|
111
|
+
` merged: ${result.merged.length} file(s)`,
|
|
112
|
+
` skipped: ${result.skipped.length} file(s) (already existed)`,
|
|
113
|
+
``,
|
|
114
|
+
`Next: scene_add { name: "intro", preset: "announcement", headline: "..." }`,
|
|
115
|
+
];
|
|
116
|
+
return { toolCallId: "", success: true, output: lines.join("\n") };
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
return {
|
|
120
|
+
toolCallId: "",
|
|
121
|
+
success: false,
|
|
122
|
+
output: "",
|
|
123
|
+
error: `scene_init failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const sceneAddHandler = async (args, context) => {
|
|
128
|
+
const projectDir = args.projectDir
|
|
129
|
+
? resolve(context.workingDirectory, args.projectDir)
|
|
130
|
+
: context.workingDirectory;
|
|
131
|
+
const result = await executeSceneAdd({
|
|
132
|
+
name: args.name,
|
|
133
|
+
preset: args.preset ?? "simple",
|
|
134
|
+
narration: args.narration,
|
|
135
|
+
duration: args.duration,
|
|
136
|
+
visuals: args.visuals,
|
|
137
|
+
headline: args.headline,
|
|
138
|
+
kicker: args.kicker,
|
|
139
|
+
projectDir,
|
|
140
|
+
insertInto: args.insertInto,
|
|
141
|
+
imageProvider: args.imageProvider,
|
|
142
|
+
voice: args.voice,
|
|
143
|
+
skipAudio: args.skipAudio,
|
|
144
|
+
skipImage: args.skipImage,
|
|
145
|
+
force: args.force,
|
|
146
|
+
});
|
|
147
|
+
if (!result.success) {
|
|
148
|
+
return {
|
|
149
|
+
toolCallId: "",
|
|
150
|
+
success: false,
|
|
151
|
+
output: "",
|
|
152
|
+
error: result.error ?? "scene_add failed",
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
const lines = [
|
|
156
|
+
`✅ Added scene "${result.id}" (preset=${result.preset})`,
|
|
157
|
+
` start: ${result.start.toFixed(2)}s`,
|
|
158
|
+
` duration: ${result.duration.toFixed(2)}s`,
|
|
159
|
+
` scene: ${result.scenePath}`,
|
|
160
|
+
` root: ${result.rootPath}`,
|
|
161
|
+
];
|
|
162
|
+
if (result.audioPath)
|
|
163
|
+
lines.push(` audio: ${result.audioPath}`);
|
|
164
|
+
if (result.imagePath)
|
|
165
|
+
lines.push(` image: ${result.imagePath}`);
|
|
166
|
+
return { toolCallId: "", success: true, output: lines.join("\n") };
|
|
167
|
+
};
|
|
168
|
+
function summariseLint(result) {
|
|
169
|
+
const lines = [
|
|
170
|
+
`${result.ok ? "✅" : "❌"} Lint ${result.ok ? "clean" : "failed"} — ` +
|
|
171
|
+
`${result.errorCount} error(s), ${result.warningCount} warning(s), ${result.infoCount} info`,
|
|
172
|
+
];
|
|
173
|
+
for (const file of result.files) {
|
|
174
|
+
if (file.findings.length === 0)
|
|
175
|
+
continue;
|
|
176
|
+
lines.push(``, `${file.file}`);
|
|
177
|
+
for (const f of file.findings) {
|
|
178
|
+
lines.push(` [${f.severity}] ${f.code} — ${f.message}`);
|
|
179
|
+
if (f.fixHint)
|
|
180
|
+
lines.push(` → ${f.fixHint}`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (result.fixed.length > 0) {
|
|
184
|
+
lines.push(``, `Auto-fixed:`);
|
|
185
|
+
for (const fx of result.fixed) {
|
|
186
|
+
lines.push(` ${fx.file}: ${fx.codes.join(", ")}`);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return lines;
|
|
190
|
+
}
|
|
191
|
+
const sceneLintHandler = async (args, context) => {
|
|
192
|
+
const projectDir = args.projectDir
|
|
193
|
+
? resolve(context.workingDirectory, args.projectDir)
|
|
194
|
+
: context.workingDirectory;
|
|
195
|
+
try {
|
|
196
|
+
const result = await runProjectLint({
|
|
197
|
+
projectDir,
|
|
198
|
+
rootRel: args.root,
|
|
199
|
+
fix: args.fix,
|
|
200
|
+
});
|
|
201
|
+
return {
|
|
202
|
+
toolCallId: "",
|
|
203
|
+
success: result.ok,
|
|
204
|
+
output: summariseLint(result).join("\n"),
|
|
205
|
+
error: result.ok ? undefined : `${result.errorCount} lint error(s)`,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
catch (error) {
|
|
209
|
+
return {
|
|
210
|
+
toolCallId: "",
|
|
211
|
+
success: false,
|
|
212
|
+
output: "",
|
|
213
|
+
error: `scene_lint failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
const sceneRenderHandler = async (args, context) => {
|
|
218
|
+
const projectDir = args.projectDir
|
|
219
|
+
? resolve(context.workingDirectory, args.projectDir)
|
|
220
|
+
: context.workingDirectory;
|
|
221
|
+
const result = await executeSceneRender({
|
|
222
|
+
projectDir,
|
|
223
|
+
root: args.root,
|
|
224
|
+
output: args.output,
|
|
225
|
+
fps: args.fps,
|
|
226
|
+
quality: args.quality,
|
|
227
|
+
format: args.format,
|
|
228
|
+
workers: args.workers,
|
|
229
|
+
});
|
|
230
|
+
if (!result.success) {
|
|
231
|
+
return {
|
|
232
|
+
toolCallId: "",
|
|
233
|
+
success: false,
|
|
234
|
+
output: "",
|
|
235
|
+
error: result.error ?? "scene_render failed",
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
const lines = [
|
|
239
|
+
`✅ Render complete: ${result.outputPath}`,
|
|
240
|
+
` duration: ${(((result.durationMs ?? 0) / 1000)).toFixed(1)}s`,
|
|
241
|
+
` frames: ${result.framesRendered ?? "?"}${result.totalFrames ? ` / ${result.totalFrames}` : ""}`,
|
|
242
|
+
` config: ${result.fps}fps · ${result.quality} · ${result.format}`,
|
|
243
|
+
];
|
|
244
|
+
return { toolCallId: "", success: true, output: lines.join("\n") };
|
|
245
|
+
};
|
|
246
|
+
// ---------------------------------------------------------------------------
|
|
247
|
+
// Registration
|
|
248
|
+
// ---------------------------------------------------------------------------
|
|
249
|
+
export function registerSceneTools(registry) {
|
|
250
|
+
registry.register(sceneInitDef, sceneInitHandler);
|
|
251
|
+
registry.register(sceneAddDef, sceneAddHandler);
|
|
252
|
+
registry.register(sceneLintDef, sceneLintHandler);
|
|
253
|
+
registry.register(sceneRenderDef, sceneRenderHandler);
|
|
254
|
+
}
|
|
255
|
+
// Exported for tests so the same defs can be inspected without instantiating
|
|
256
|
+
// a registry.
|
|
257
|
+
export const sceneToolDefinitions = [
|
|
258
|
+
sceneInitDef,
|
|
259
|
+
sceneAddDef,
|
|
260
|
+
sceneLintDef,
|
|
261
|
+
sceneRenderDef,
|
|
262
|
+
];
|
|
263
|
+
//# sourceMappingURL=scene.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene.js","sourceRoot":"","sources":["../../../src/agent/tools/scene.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAG9C,OAAO,EACL,oBAAoB,GAErB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,eAAe,GAEhB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,cAAc,GAEf,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,kBAAkB,GAInB,MAAM,wCAAwC,CAAC;AAGhD,MAAM,aAAa,GAAG;IACpB,QAAQ;IACR,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AAQ,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;AACxD,CAAC;AAED,6EAA6E;AAC7E,cAAc;AACd,MAAM,CAAC,MAAM,oBAAoB,GAAkC;IACjE,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,cAAc;CACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene.test.d.ts","sourceRoot":"","sources":["../../../src/agent/tools/scene.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { describe, expect, it, beforeEach } from "vitest";
|
|
2
|
+
import { mkdtemp, readFile, access } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join, resolve } from "node:path";
|
|
5
|
+
import { ToolRegistry } from "./index.js";
|
|
6
|
+
import { registerSceneTools, sceneToolDefinitions } from "./scene.js";
|
|
7
|
+
async function pathExists(p) {
|
|
8
|
+
try {
|
|
9
|
+
await access(p);
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async function makeTmp(label = "vibe-scene-agent-") {
|
|
17
|
+
return mkdtemp(join(tmpdir(), label));
|
|
18
|
+
}
|
|
19
|
+
function ctx(workingDirectory) {
|
|
20
|
+
return { projectPath: null, workingDirectory };
|
|
21
|
+
}
|
|
22
|
+
let registry;
|
|
23
|
+
beforeEach(() => {
|
|
24
|
+
registry = new ToolRegistry();
|
|
25
|
+
registerSceneTools(registry);
|
|
26
|
+
});
|
|
27
|
+
describe("scene agent tools — registration + schema", () => {
|
|
28
|
+
it("registers exactly four scene_* tools", () => {
|
|
29
|
+
const names = registry.getDefinitions().map((t) => t.name).filter((n) => n.startsWith("scene_")).sort();
|
|
30
|
+
expect(names).toEqual(["scene_add", "scene_init", "scene_lint", "scene_render"]);
|
|
31
|
+
});
|
|
32
|
+
it("exports definitions matching the registered set (parity with sceneToolDefinitions)", () => {
|
|
33
|
+
const exported = sceneToolDefinitions.map((d) => d.name).sort();
|
|
34
|
+
const registered = registry.getDefinitions().map((t) => t.name).sort();
|
|
35
|
+
expect(exported).toEqual(registered);
|
|
36
|
+
});
|
|
37
|
+
it.each(sceneToolDefinitions.map((d) => [d.name, d]))("%s has well-formed JSON-schema-ish parameters", (name, def) => {
|
|
38
|
+
expect(def.name).toBe(name);
|
|
39
|
+
expect(def.description.length).toBeGreaterThan(20);
|
|
40
|
+
expect(def.parameters.type).toBe("object");
|
|
41
|
+
expect(def.parameters.properties).toBeTypeOf("object");
|
|
42
|
+
expect(Array.isArray(def.parameters.required)).toBe(true);
|
|
43
|
+
// Every property has a string description.
|
|
44
|
+
for (const [key, prop] of Object.entries(def.parameters.properties)) {
|
|
45
|
+
expect(prop.description, `${name}.${key} missing description`).toBeTruthy();
|
|
46
|
+
expect(["string", "number", "boolean", "array", "object"]).toContain(prop.type);
|
|
47
|
+
}
|
|
48
|
+
// Every required arg is actually declared.
|
|
49
|
+
for (const req of def.parameters.required) {
|
|
50
|
+
expect(def.parameters.properties).toHaveProperty(req);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
it("scene_init requires only `dir`; scene_add requires only `name`; lint+render are arg-free", () => {
|
|
54
|
+
const byName = Object.fromEntries(sceneToolDefinitions.map((d) => [d.name, d]));
|
|
55
|
+
expect(byName.scene_init.parameters.required).toEqual(["dir"]);
|
|
56
|
+
expect(byName.scene_add.parameters.required).toEqual(["name"]);
|
|
57
|
+
expect(byName.scene_lint.parameters.required).toEqual([]);
|
|
58
|
+
expect(byName.scene_render.parameters.required).toEqual([]);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
describe("scene_init handler", () => {
|
|
62
|
+
it("scaffolds a project relative to the agent's working directory", async () => {
|
|
63
|
+
const cwd = await makeTmp();
|
|
64
|
+
const handler = registry.getHandler("scene_init");
|
|
65
|
+
const result = await handler({ dir: "promo", aspect: "9:16", duration: 8 }, ctx(cwd));
|
|
66
|
+
expect(result.success).toBe(true);
|
|
67
|
+
expect(result.output).toContain("Scene project scaffolded at promo");
|
|
68
|
+
expect(await pathExists(resolve(cwd, "promo/index.html"))).toBe(true);
|
|
69
|
+
expect(await pathExists(resolve(cwd, "promo/vibe.project.yaml"))).toBe(true);
|
|
70
|
+
expect(await pathExists(resolve(cwd, "promo/compositions"))).toBe(true);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
describe("scene_add handler — offline path", () => {
|
|
74
|
+
it("adds a scene with skipAudio + skipImage and reports the new clip start/duration", async () => {
|
|
75
|
+
const cwd = await makeTmp();
|
|
76
|
+
await registry.getHandler("scene_init")({ dir: ".", aspect: "16:9", duration: 6 }, ctx(cwd));
|
|
77
|
+
const result = await registry.getHandler("scene_add")({
|
|
78
|
+
name: "Intro Scene",
|
|
79
|
+
preset: "announcement",
|
|
80
|
+
headline: "Hello",
|
|
81
|
+
duration: 4,
|
|
82
|
+
skipAudio: true,
|
|
83
|
+
skipImage: true,
|
|
84
|
+
}, ctx(cwd));
|
|
85
|
+
expect(result.success).toBe(true);
|
|
86
|
+
expect(result.output).toContain('Added scene "intro-scene"');
|
|
87
|
+
expect(result.output).toContain("preset=announcement");
|
|
88
|
+
expect(result.output).toContain("start: 0.00s");
|
|
89
|
+
expect(result.output).toContain("duration: 4.00s");
|
|
90
|
+
const sceneFile = await readFile(resolve(cwd, "compositions/scene-intro-scene.html"), "utf-8");
|
|
91
|
+
expect(sceneFile).toContain("Hello");
|
|
92
|
+
expect(sceneFile).not.toContain("<audio");
|
|
93
|
+
});
|
|
94
|
+
it("returns a structured failure when a scene file already exists (no --force)", async () => {
|
|
95
|
+
const cwd = await makeTmp();
|
|
96
|
+
await registry.getHandler("scene_init")({ dir: "." }, ctx(cwd));
|
|
97
|
+
await registry.getHandler("scene_add")({
|
|
98
|
+
name: "intro", duration: 3, skipAudio: true, skipImage: true,
|
|
99
|
+
}, ctx(cwd));
|
|
100
|
+
const second = await registry.getHandler("scene_add")({
|
|
101
|
+
name: "intro", duration: 3, skipAudio: true, skipImage: true,
|
|
102
|
+
}, ctx(cwd));
|
|
103
|
+
expect(second.success).toBe(false);
|
|
104
|
+
expect(second.error).toMatch(/already exists/);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
describe("scene_lint handler — offline path", () => {
|
|
108
|
+
it("reports ok for a freshly scaffolded + populated project", async () => {
|
|
109
|
+
const cwd = await makeTmp();
|
|
110
|
+
await registry.getHandler("scene_init")({ dir: "." }, ctx(cwd));
|
|
111
|
+
await registry.getHandler("scene_add")({
|
|
112
|
+
name: "hello", duration: 3, skipAudio: true, skipImage: true,
|
|
113
|
+
}, ctx(cwd));
|
|
114
|
+
const result = await registry.getHandler("scene_lint")({}, ctx(cwd));
|
|
115
|
+
expect(result.success).toBe(true);
|
|
116
|
+
expect(result.output).toContain("Lint clean");
|
|
117
|
+
});
|
|
118
|
+
it("on an empty dir reports ok with zero findings (linter sees no files, the agent does not second-guess)", async () => {
|
|
119
|
+
const cwd = await makeTmp();
|
|
120
|
+
const result = await registry.getHandler("scene_lint")({}, ctx(cwd));
|
|
121
|
+
expect(result.success).toBe(true);
|
|
122
|
+
expect(result.output).toContain("0 error(s)");
|
|
123
|
+
expect(result.output).toContain("0 warning(s)");
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
describe("scene_render handler — Chrome-gated", () => {
|
|
127
|
+
it("returns a structured Chrome-not-found error when Chrome is missing OR the project is missing", async () => {
|
|
128
|
+
// We don't try to render — we just exercise the validation surface so the
|
|
129
|
+
// test stays Chrome-free. With a non-existent project the handler fails
|
|
130
|
+
// before reaching the Chrome preflight.
|
|
131
|
+
const cwd = await makeTmp();
|
|
132
|
+
const result = await registry.getHandler("scene_render")({
|
|
133
|
+
projectDir: "no-such-dir",
|
|
134
|
+
}, ctx(cwd));
|
|
135
|
+
expect(result.success).toBe(false);
|
|
136
|
+
expect(result.error).toMatch(/Project directory not found|Chrome not found|Root composition not found/);
|
|
137
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AQ,CAAC,UAAU,CAAC,cAAc,CAAE,CAAC;YACxD,UAAU,EAAE,aAAa;SAC1B,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACb,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,yEAAyE,CAAC,CAAC;IAC1G,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module _shared/scene-html-emit
|
|
3
|
+
*
|
|
4
|
+
* Pure HTML emitters for `vibe scene add`. Each preset produces a self-contained
|
|
5
|
+
* Hyperframes-compatible scene composition: a `<template>`-wrapped `<div
|
|
6
|
+
* data-composition-id>` with scoped CSS, optional audio/image, and a paused
|
|
7
|
+
* GSAP timeline registered on `window.__timelines`.
|
|
8
|
+
*
|
|
9
|
+
* Also exposes helpers that mutate the root index.html:
|
|
10
|
+
* - `nextSceneStart()` — sum existing clip end-times to choose the new start
|
|
11
|
+
* - `insertClipIntoRoot()` — splice a `<div class="clip">` reference before the
|
|
12
|
+
* root's closing div, preserving the user's hand-edited markup
|
|
13
|
+
* - `slugifySceneName()` — name → kebab-case scene id
|
|
14
|
+
*
|
|
15
|
+
* Pure functions only — no I/O. The orchestrating command (`scene add`) wires
|
|
16
|
+
* these to the filesystem.
|
|
17
|
+
*/
|
|
18
|
+
export type ScenePreset = "simple" | "announcement" | "explainer" | "kinetic-type" | "product-shot";
|
|
19
|
+
export declare const SCENE_PRESETS: readonly ScenePreset[];
|
|
20
|
+
export interface EmitSceneInput {
|
|
21
|
+
/** Kebab-case scene id; appears in `data-composition-id` and template id. */
|
|
22
|
+
id: string;
|
|
23
|
+
preset: ScenePreset;
|
|
24
|
+
/** Canvas width in px (must match the root composition). */
|
|
25
|
+
width: number;
|
|
26
|
+
/** Canvas height in px (must match the root composition). */
|
|
27
|
+
height: number;
|
|
28
|
+
/** Visible composition duration in seconds. */
|
|
29
|
+
duration: number;
|
|
30
|
+
/** Headline text — required for non-simple presets; defaulted from id. */
|
|
31
|
+
headline?: string;
|
|
32
|
+
/** Secondary text (subhead/caption). Often the narration. */
|
|
33
|
+
subhead?: string;
|
|
34
|
+
/** Optional small label above the headline (explainer / product-shot). */
|
|
35
|
+
kicker?: string;
|
|
36
|
+
/** Project-relative image path (e.g. "assets/scene-intro.png"). */
|
|
37
|
+
imagePath?: string;
|
|
38
|
+
/** Project-relative narration audio path (e.g. "assets/narration-intro.mp3"). */
|
|
39
|
+
audioPath?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Slugify a free-form scene name to a kebab-case id usable in HTML attributes
|
|
43
|
+
* and filenames. Strips diacritics, collapses whitespace, lowercases.
|
|
44
|
+
*/
|
|
45
|
+
export declare function slugifySceneName(name: string): string;
|
|
46
|
+
/**
|
|
47
|
+
* Emit the full per-scene HTML. Returns a complete `<template>`-wrapped
|
|
48
|
+
* composition ready to write to `compositions/scene-<id>.html`.
|
|
49
|
+
*/
|
|
50
|
+
export declare function emitSceneHtml(input: EmitSceneInput): string;
|
|
51
|
+
/**
|
|
52
|
+
* Sum existing `<div class="clip">` end-times to find where the next scene
|
|
53
|
+
* should start. Returns 0 for an empty root.
|
|
54
|
+
*/
|
|
55
|
+
export declare function nextSceneStart(rootHtml: string): number;
|
|
56
|
+
export interface ClipReferenceInput {
|
|
57
|
+
/** Scene id — used to derive the composition src path. */
|
|
58
|
+
id: string;
|
|
59
|
+
start: number;
|
|
60
|
+
duration: number;
|
|
61
|
+
trackIndex?: number;
|
|
62
|
+
/** Override the default `compositions/scene-<id>.html` src. */
|
|
63
|
+
src?: string;
|
|
64
|
+
}
|
|
65
|
+
/** Build the `<div class="clip" data-composition-id=... data-composition-src=...>` reference string. */
|
|
66
|
+
export declare function buildClipReference(opts: ClipReferenceInput): string;
|
|
67
|
+
/**
|
|
68
|
+
* Insert a clip reference inside the root composition's `#root` div, just
|
|
69
|
+
* before its closing `</div>`. Throws if the expected closing tag isn't
|
|
70
|
+
* found — callers should surface this as a structured error so users know
|
|
71
|
+
* to inspect a hand-edited root.
|
|
72
|
+
*
|
|
73
|
+
* Also grows the root's `data-duration` to fit the new clip's end-time.
|
|
74
|
+
*/
|
|
75
|
+
export declare function insertClipIntoRoot(rootHtml: string, clip: ClipReferenceInput): string;
|
|
76
|
+
/**
|
|
77
|
+
* Read the root composition's canvas dims by parsing `data-width`/`data-height`
|
|
78
|
+
* on the `#root` div. Returns null if either is missing — caller should fall
|
|
79
|
+
* back to the project's aspect config.
|
|
80
|
+
*/
|
|
81
|
+
export declare function readRootDims(rootHtml: string): {
|
|
82
|
+
width: number;
|
|
83
|
+
height: number;
|
|
84
|
+
} | null;
|
|
85
|
+
//# sourceMappingURL=scene-html-emit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-html-emit.d.ts","sourceRoot":"","sources":["../../../src/commands/_shared/scene-html-emit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,cAAc,GACd,WAAW,GACX,cAAc,GACd,cAAc,CAAC;AAEnB,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAMtC,CAAC;AAEX,MAAM,WAAW,cAAc;IAC7B,6EAA6E;IAC7E,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,WAAW,CAAC;IACpB,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAA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