visualfries 0.1.10120 → 0.3.2
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 +97 -0
- package/bin/visualfries.js +1570 -0
- package/dist/DIContainer.d.ts +2 -1
- package/dist/DIContainer.js +16 -5
- package/dist/SceneBuilder.svelte.d.ts +70 -1
- package/dist/SceneBuilder.svelte.js +96 -29
- package/dist/agent/audioMixer.d.ts +34 -0
- package/dist/agent/audioMixer.js +308 -0
- package/dist/agent/broll.d.ts +35 -0
- package/dist/agent/broll.js +226 -0
- package/dist/agent/capabilities.d.ts +34 -0
- package/dist/agent/capabilities.js +246 -0
- package/dist/agent/captionScene.d.ts +23 -0
- package/dist/agent/captionScene.js +204 -0
- package/dist/agent/catalog.d.ts +24 -0
- package/dist/agent/catalog.js +67 -0
- package/dist/agent/cueFiles.d.ts +54 -0
- package/dist/agent/cueFiles.js +219 -0
- package/dist/agent/cuePresets.d.ts +7 -0
- package/dist/agent/cuePresets.js +50 -0
- package/dist/agent/deterministicMedia.d.ts +61 -0
- package/dist/agent/deterministicMedia.js +303 -0
- package/dist/agent/index.d.ts +18 -0
- package/dist/agent/index.js +18 -0
- package/dist/agent/inspectScene.d.ts +36 -0
- package/dist/agent/inspectScene.js +139 -0
- package/dist/agent/localRender.d.ts +82 -0
- package/dist/agent/localRender.js +702 -0
- package/dist/agent/overlays.d.ts +40 -0
- package/dist/agent/overlays.js +325 -0
- package/dist/agent/productionPlan.d.ts +131 -0
- package/dist/agent/productionPlan.js +322 -0
- package/dist/agent/renderPlan.d.ts +27 -0
- package/dist/agent/renderPlan.js +68 -0
- package/dist/agent/renderRanges.d.ts +24 -0
- package/dist/agent/renderRanges.js +73 -0
- package/dist/agent/runtimeSupport.d.ts +19 -0
- package/dist/agent/runtimeSupport.js +192 -0
- package/dist/agent/streamingEncoder.d.ts +31 -0
- package/dist/agent/streamingEncoder.js +208 -0
- package/dist/agent/transcripts.d.ts +29 -0
- package/dist/agent/transcripts.js +146 -0
- package/dist/agent/transitions.d.ts +20 -0
- package/dist/agent/transitions.js +169 -0
- package/dist/animations/PixiAnimationTarget.d.ts +29 -0
- package/dist/animations/PixiAnimationTarget.js +63 -0
- package/dist/animations/builders/LineHighlighterAnimationBuilder.js +20 -3
- package/dist/animations/builders/WordHighlighterAnimationBuilder.js +15 -2
- package/dist/browser/browserExport.d.ts +73 -0
- package/dist/browser/browserExport.js +180 -0
- package/dist/browser/glTransitions.d.ts +37 -0
- package/dist/browser/glTransitions.js +261 -0
- package/dist/browser/index.d.ts +3 -0
- package/dist/browser/index.js +3 -0
- package/dist/browser/mediaDecode.d.ts +31 -0
- package/dist/browser/mediaDecode.js +152 -0
- package/dist/builders/PixiComponentBuilder.d.ts +6 -0
- package/dist/builders/PixiComponentBuilder.js +12 -0
- package/dist/builders/_ComponentState.svelte.d.ts +7 -5
- package/dist/builders/_ComponentState.svelte.js +29 -15
- package/dist/builders/html/StyleBuilder.js +9 -8
- package/dist/builders/html/TextComponentHtmlBuilder.js +4 -2
- package/dist/builders/html/processors/AppearanceStyleProcessor.js +1 -1
- package/dist/builders/html/processors/TextAppearanceStyleProcessor.js +7 -0
- package/dist/builders/html/processors/TextEffectsStyleProcessor.js +32 -13
- package/dist/commands/ReplaceSourceOnTimeCommand.js +9 -1
- package/dist/commands/SeekCommand.js +19 -6
- package/dist/components/AnimatedGIF.d.ts +3 -0
- package/dist/components/AnimatedGIF.js +28 -1
- package/dist/components/Component.svelte.d.ts +5 -5
- package/dist/components/Component.svelte.js +29 -13
- package/dist/components/ComponentContext.svelte.js +68 -23
- package/dist/components/hooks/AnimationHook.js +1 -1
- package/dist/components/hooks/CanvasFillHook.d.ts +12 -0
- package/dist/components/hooks/CanvasFillHook.js +75 -0
- package/dist/components/hooks/DeterministicMediaFrameHook.js +3 -0
- package/dist/components/hooks/HtmlTextHook.js +11 -3
- package/dist/components/hooks/HtmlToCanvasHook.js +8 -25
- package/dist/components/hooks/MediaHook.js +172 -47
- package/dist/components/hooks/MediaSeekingHook.js +138 -88
- package/dist/components/hooks/PixiGifHook.js +4 -4
- package/dist/components/hooks/PixiSplitScreenDisplayObjectHook.js +73 -6
- package/dist/components/hooks/PixiVideoTextureHook.js +10 -4
- package/dist/components/hooks/PixiVisualTransformHook.d.ts +16 -0
- package/dist/components/hooks/PixiVisualTransformHook.js +102 -0
- package/dist/components/hooks/SubtitlesHook.js +48 -24
- package/dist/components/hooks/VerifyMediaHook.js +2 -2
- package/dist/directors/ComponentDirector.d.ts +1 -0
- package/dist/directors/ComponentDirector.js +41 -8
- package/dist/fonts/fontDiscovery.js +12 -1
- package/dist/layers/Layer.svelte.d.ts +54 -0
- package/dist/layers/Layer.svelte.js +2 -25
- package/dist/managers/AppManager.svelte.js +8 -5
- package/dist/managers/ComponentsManager.svelte.d.ts +7 -7
- package/dist/managers/ComponentsManager.svelte.js +29 -15
- package/dist/managers/DeterministicMediaManager.js +38 -3
- package/dist/managers/EventManager.js +3 -1
- package/dist/managers/LayersManager.svelte.d.ts +54 -0
- package/dist/managers/RenderManager.d.ts +5 -0
- package/dist/managers/RenderManager.js +67 -21
- package/dist/managers/StateManager.svelte.d.ts +56 -0
- package/dist/managers/StateManager.svelte.js +60 -58
- package/dist/managers/SubtitlesManager.svelte.js +1 -3
- package/dist/managers/TimeManager.svelte.d.ts +4 -0
- package/dist/managers/TimeManager.svelte.js +23 -7
- package/dist/schemas/runtime/deterministic.js +5 -1
- package/dist/schemas/runtime/types.d.ts +36 -15
- package/dist/schemas/scene/components.d.ts +126 -0
- package/dist/schemas/scene/components.js +11 -0
- package/dist/schemas/scene/core.d.ts +109 -10
- package/dist/schemas/scene/core.js +1 -1
- package/dist/utils/mediaWindow.d.ts +13 -0
- package/dist/utils/mediaWindow.js +25 -0
- package/dist/utils/svgGenerator.js +1 -1
- package/dist/utils/timelineWindow.d.ts +2 -0
- package/dist/utils/timelineWindow.js +7 -0
- package/dist/utils/utils.js +2 -4
- package/docs/AGENT_PATTERNS.md +243 -0
- package/docs/AGENT_WORKFLOW.md +364 -0
- package/docs/AUTHORING_BEST_PRACTICES.md +188 -0
- package/docs/AUTHORING_SYSTEM_AUDIT.md +98 -0
- package/docs/BROWSER_EXPORT_SPIKE.md +55 -0
- package/docs/DETERMINISTIC_RENDERER.md +83 -0
- package/docs/NEXT_RELEASE.md +28 -0
- package/docs/PROPOSED_VISUALFRIES_SKILL.md +68 -0
- package/docs/examples/agent-cues.json +49 -0
- package/docs/examples/agent-transcript.json +23 -0
- package/docs/examples/agent-transcript.srt +7 -0
- package/docs/examples/agent-transcript.vtt +7 -0
- package/docs/examples/image-animation.json +87 -0
- package/docs/examples/native-text-metric-badge.json +109 -0
- package/package.json +133 -100
- package/skills/visualfries/SKILL.md +328 -0
package/package.json
CHANGED
|
@@ -1,101 +1,134 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
2
|
+
"name": "visualfries",
|
|
3
|
+
"version": "0.3.2",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"author": "ContentFries",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/ContentFries/visualfries"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/ContentFries/visualfries/issues"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"dev": "vite dev",
|
|
15
|
+
"build": "vite build && pnpm run package",
|
|
16
|
+
"preview": "vite preview",
|
|
17
|
+
"package": "svelte-kit sync && svelte-package && publint",
|
|
18
|
+
"prepublishOnly": "pnpm run package",
|
|
19
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
20
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
21
|
+
"test": "pnpm run test:unit -- --run",
|
|
22
|
+
"test:unit": "vitest",
|
|
23
|
+
"lint": "eslint . && prettier --check .",
|
|
24
|
+
"format": "prettier --write .",
|
|
25
|
+
"knip": "knip",
|
|
26
|
+
"release:pr": "release-please release-pr",
|
|
27
|
+
"release:github": "release-please github-release",
|
|
28
|
+
"release:bootstrap": "release-please bootstrap"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"bin",
|
|
32
|
+
"dist",
|
|
33
|
+
"skills",
|
|
34
|
+
"docs",
|
|
35
|
+
"!dist/**/*.test.*",
|
|
36
|
+
"!dist/**/*.spec.*",
|
|
37
|
+
"!dist/stories/**"
|
|
38
|
+
],
|
|
39
|
+
"bin": {
|
|
40
|
+
"visualfries": "bin/visualfries.js"
|
|
41
|
+
},
|
|
42
|
+
"sideEffects": [
|
|
43
|
+
"**/*.css"
|
|
44
|
+
],
|
|
45
|
+
"@parcel/resolver-default": {
|
|
46
|
+
"packageExports": true
|
|
47
|
+
},
|
|
48
|
+
"main": "./dist/index.js",
|
|
49
|
+
"module": "./dist/index.js",
|
|
50
|
+
"svelte": "./dist/index.js",
|
|
51
|
+
"types": "./dist/index.d.ts",
|
|
52
|
+
"type": "module",
|
|
53
|
+
"exports": {
|
|
54
|
+
".": {
|
|
55
|
+
"types": "./dist/index.d.ts",
|
|
56
|
+
"svelte": "./dist/index.js",
|
|
57
|
+
"import": "./dist/index.js",
|
|
58
|
+
"default": "./dist/index.js"
|
|
59
|
+
},
|
|
60
|
+
"./agent": {
|
|
61
|
+
"types": "./dist/agent/index.d.ts",
|
|
62
|
+
"import": "./dist/agent/index.js",
|
|
63
|
+
"default": "./dist/agent/index.js"
|
|
64
|
+
},
|
|
65
|
+
"./browser": {
|
|
66
|
+
"types": "./dist/browser/index.d.ts",
|
|
67
|
+
"import": "./dist/browser/index.js",
|
|
68
|
+
"default": "./dist/browser/index.js"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"peerDependencies": {
|
|
72
|
+
"@sveltejs/vite-plugin-svelte": "^4.0.0 || ^5.0.0 || ^6.0.0",
|
|
73
|
+
"playwright": "^1.40.0",
|
|
74
|
+
"svelte": "^5.0.0",
|
|
75
|
+
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
76
|
+
},
|
|
77
|
+
"peerDependenciesMeta": {
|
|
78
|
+
"@sveltejs/vite-plugin-svelte": {
|
|
79
|
+
"optional": true
|
|
80
|
+
},
|
|
81
|
+
"playwright": {
|
|
82
|
+
"optional": true
|
|
83
|
+
},
|
|
84
|
+
"vite": {
|
|
85
|
+
"optional": true
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"devDependencies": {
|
|
89
|
+
"@sveltejs/adapter-auto": "^3.0.0",
|
|
90
|
+
"@sveltejs/kit": "^2.46.4",
|
|
91
|
+
"@sveltejs/package": "^2.0.0",
|
|
92
|
+
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
|
93
|
+
"@tailwindcss/aspect-ratio": "^0.4.2",
|
|
94
|
+
"@tailwindcss/typography": "^0.5.16",
|
|
95
|
+
"@types/lodash-es": "^4.17.12",
|
|
96
|
+
"@types/md5": "^2.3.5",
|
|
97
|
+
"@types/node": "^20.17.30",
|
|
98
|
+
"@types/tinycolor2": "^1.4.6",
|
|
99
|
+
"@types/uuid": "^10.0.0",
|
|
100
|
+
"autoprefixer": "^10.4.20",
|
|
101
|
+
"daisyui": "^4.12.13",
|
|
102
|
+
"eslint": "^9.7.0",
|
|
103
|
+
"jsdom": "^26.1.0",
|
|
104
|
+
"knip": "^5.65.0",
|
|
105
|
+
"md5": "^2.3.0",
|
|
106
|
+
"postcss": "^8.4.47",
|
|
107
|
+
"playwright": "^1.52.0",
|
|
108
|
+
"prettier": "^3.3.2",
|
|
109
|
+
"prettier-plugin-svelte": "^3.2.6",
|
|
110
|
+
"prettier-plugin-tailwindcss": "^0.7.0",
|
|
111
|
+
"publint": "^0.2.0",
|
|
112
|
+
"release-please": "^15.0.0",
|
|
113
|
+
"svelte": "^5.0.0",
|
|
114
|
+
"svelte-check": "^4.0.0",
|
|
115
|
+
"tailwindcss": "^3.4.14",
|
|
116
|
+
"typescript": "^5.8.3",
|
|
117
|
+
"vite": "^5.0.11",
|
|
118
|
+
"vitest": "^2.0.4"
|
|
119
|
+
},
|
|
120
|
+
"dependencies": {
|
|
121
|
+
"awilix": "^12.0.3",
|
|
122
|
+
"dompurify": "^3.3.0",
|
|
123
|
+
"earcut": "^2.2.4",
|
|
124
|
+
"gifuct-js": "^2.1.2",
|
|
125
|
+
"gsap": "^3.13.0",
|
|
126
|
+
"hls.js": "^1.5.17",
|
|
127
|
+
"lodash-es": "^4.17.21",
|
|
128
|
+
"mediabunny": "1.49.0",
|
|
129
|
+
"pixi.js-legacy": "^7.4.3",
|
|
130
|
+
"tinycolor2": "^1.6.0",
|
|
131
|
+
"uuid": "^10.0.0",
|
|
132
|
+
"zod": "^4.1.12"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: visualfries
|
|
3
|
+
description: Create and validate VisualFries scene JSON, caption videos from transcripts, prepare agent-friendly video overlays, and hand off render-ready scenes without opening the ContentFries UI.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VisualFries
|
|
7
|
+
|
|
8
|
+
VisualFries is a JSON-first Svelte/Pixi/GSAP video scene engine. For agents, treat `scene.json` as the source of truth.
|
|
9
|
+
|
|
10
|
+
Use this skill when the user asks to:
|
|
11
|
+
|
|
12
|
+
- add captions/subtitles to a video without ContentFries UI
|
|
13
|
+
- build a VisualFries scene from assets and a transcript
|
|
14
|
+
- create reusable overlays, text effects, b-roll layouts, or short-form scene JSON
|
|
15
|
+
- validate or inspect VisualFries scene JSON before sending it to a renderer
|
|
16
|
+
|
|
17
|
+
## Mental Model
|
|
18
|
+
|
|
19
|
+
VisualFries uses typed scene JSON as its authoring format:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
scene
|
|
23
|
+
settings
|
|
24
|
+
assets
|
|
25
|
+
layers
|
|
26
|
+
components
|
|
27
|
+
VIDEO / IMAGE / TEXT / SHAPE / AUDIO / SUBTITLES
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Agent rule:
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
video/transcript/assets -> scene.json -> validate -> inspect -> render
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Do not require the user to open ContentFries UI for captioning or scene creation.
|
|
37
|
+
|
|
38
|
+
For authored short-form edits with named beats, exact multi-track audio, source trims, freeze holds, proof cards, and timeline QA, use a production plan instead of raw component JSON:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
visualfries produce ./production-plan.json \
|
|
42
|
+
--scene-output ./scene.json \
|
|
43
|
+
--generated-assets ./generated \
|
|
44
|
+
--qa-output ./qa \
|
|
45
|
+
--output ./final.mp4
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`produce` is the preferred path for authored, production-ready edits. It compiles editable plan text into deterministic SVG overlays, extracts freeze frames, segments rendering at timeline event boundaries, mixes audio, writes exact QA frames, and enforces the declared leading-silence limit.
|
|
49
|
+
|
|
50
|
+
## First Commands
|
|
51
|
+
|
|
52
|
+
From a project with `visualfries` installed:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
visualfries --help
|
|
56
|
+
visualfries doctor --json
|
|
57
|
+
visualfries catalog --json
|
|
58
|
+
visualfries validate-cues ./cues.json --duration 45 --json
|
|
59
|
+
visualfries validate scene.json
|
|
60
|
+
visualfries inspect scene.json --json
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Create a caption scene:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
visualfries compose \
|
|
67
|
+
--video ./input.mp4 \
|
|
68
|
+
--transcript ./captions.srt \
|
|
69
|
+
--cue-preset hidden-engine-dynamic \
|
|
70
|
+
--cues ./cues.json \
|
|
71
|
+
--scene-output ./scene.json \
|
|
72
|
+
--qa-output ./qa/frames \
|
|
73
|
+
--output ./out.mp4
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Or step-by-step:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
visualfries init ./video-package \
|
|
80
|
+
--video ./input.mp4 \
|
|
81
|
+
--transcript ./captions.srt \
|
|
82
|
+
--preset hidden-engine-center \
|
|
83
|
+
--cue-preset hidden-engine-dynamic
|
|
84
|
+
|
|
85
|
+
visualfries caption-scene \
|
|
86
|
+
--video ./input.mp4 \
|
|
87
|
+
--transcript ./captions.srt \
|
|
88
|
+
--preset hidden-engine-center \
|
|
89
|
+
--output ./scene.json
|
|
90
|
+
|
|
91
|
+
visualfries preset-cues \
|
|
92
|
+
--duration 45 \
|
|
93
|
+
--preset hidden-engine-dynamic \
|
|
94
|
+
--output ./cues.json
|
|
95
|
+
|
|
96
|
+
visualfries apply-cues ./scene.json \
|
|
97
|
+
--cues ./cues.json \
|
|
98
|
+
--output ./scene.with-cues.json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Then:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
visualfries validate ./scene.json
|
|
105
|
+
visualfries inspect ./scene.json --json
|
|
106
|
+
visualfries qa ./scene.json --output ./qa
|
|
107
|
+
visualfries render ./scene.json --output ./qa-frames --frames-only --to-frame 3
|
|
108
|
+
visualfries render ./scene.json --render-mode preview --output ./preview.mp4
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Important: browser media rendering is preview/QA only for scenes with `VIDEO` or `GIF` components. Final VIDEO/GIF output uses the local deterministic renderer path, which predecodes active media ranges into exact frame images before browser composition. Use `--render-mode preview` only for QA or rough checks.
|
|
112
|
+
|
|
113
|
+
For final contiguous MP4 renders after QA, prefer:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
visualfries render ./scene.json --stream-encode --image-format jpg --output ./out.mp4
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
For static-heavy scenes after QA:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
visualfries render ./scene.json --output ./out.mp4 --skip-duplicates
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Contiguous renders use the browser-side `renderFrameRange()` path. Sparse QA screenshots still use direct sampled frame rendering.
|
|
126
|
+
|
|
127
|
+
Preferred full agent path:
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
production plan -> produce (authored edit)
|
|
131
|
+
compose (caption-first video)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Debug path:
|
|
135
|
+
|
|
136
|
+
```text
|
|
137
|
+
caption-scene -> preset-cues -> edit cues -> apply-cues -> qa -> render
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Caption Workflow
|
|
141
|
+
|
|
142
|
+
Inputs:
|
|
143
|
+
|
|
144
|
+
- video file or URL
|
|
145
|
+
- transcript JSON with one of:
|
|
146
|
+
- `segments: [{ text, start, end, words }]`
|
|
147
|
+
- `subtitles: [{ text, start_at, end_at, words }]`
|
|
148
|
+
- `words: [{ text, start, end }]`
|
|
149
|
+
- or a plain subtitle file:
|
|
150
|
+
- `.srt`
|
|
151
|
+
- `.vtt`
|
|
152
|
+
|
|
153
|
+
Recommended presets:
|
|
154
|
+
|
|
155
|
+
- `hidden-engine-center` for Hidden Engine short videos with middle captions
|
|
156
|
+
- `reels-center` for default high-energy vertical captions
|
|
157
|
+
- `reels-lower` when the middle must stay clean
|
|
158
|
+
- `podcast-clean` for calmer interview clips
|
|
159
|
+
|
|
160
|
+
Caption constraints:
|
|
161
|
+
|
|
162
|
+
- Keep subtitles away from important faces, product UI, and proof overlays.
|
|
163
|
+
- For videos that will get ContentFries-style overlays, prefer center captions only if the overlay is top/bottom.
|
|
164
|
+
- Validate and inspect after generating the scene.
|
|
165
|
+
|
|
166
|
+
## Scene Rules
|
|
167
|
+
|
|
168
|
+
- All media components must reference assets with stable `assetId`.
|
|
169
|
+
- SUBTITLES must have `timingAnchor.assetId` matching `scene.settings.subtitles.data[assetId]`.
|
|
170
|
+
- Higher layer `order` renders above lower layers.
|
|
171
|
+
- Use `SceneShape` validation, never raw unvalidated JSON.
|
|
172
|
+
- For Node agents, prefer the agent-only subpath so Svelte/browser exports are not loaded:
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
import { createCaptionScene, inspectScene, normalizeTranscript } from 'visualfries/agent';
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
- Composer helpers are useful inside app/runtime code, but CLI and automation should stay on `visualfries/agent` unless they explicitly need full VisualFries UI/runtime exports.
|
|
179
|
+
|
|
180
|
+
## Overlay Workflow
|
|
181
|
+
|
|
182
|
+
For Hidden Engine / short-form reaction overlays, use cue files or timed overlay helpers instead of hand-building TEXT components:
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"broll": [
|
|
187
|
+
{ "url": "./assets/profile-scroll.mp4", "start": 2, "end": 5, "type": "VIDEO" },
|
|
188
|
+
{ "url": "./assets/chart.png", "start": 5, "end": 7, "type": "IMAGE", "motion": "slow-zoom-in" }
|
|
189
|
+
],
|
|
190
|
+
"overlays": [
|
|
191
|
+
{ "text": "LOVE THIS 😍", "start": 0.4, "end": 1.1, "style": "hook-punch" },
|
|
192
|
+
{ "text": "NECK 🤯", "start": 1.1, "end": 1.7, "style": "shock-word" }
|
|
193
|
+
],
|
|
194
|
+
"transitions": [
|
|
195
|
+
{ "time": 2, "style": "dip-to-black" },
|
|
196
|
+
{ "time": 5, "style": "swipe-left", "color": "#04483D" }
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Apply it:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
visualfries apply-cues ./scene.json --cues ./cues.json --output ./scene.with-cues.json
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Relative b-roll URLs resolve relative to the cue file.
|
|
208
|
+
|
|
209
|
+
If the agent is starting from scratch, create a cue skeleton first:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
visualfries preset-cues --duration 45 --preset hidden-engine-dynamic --output ./cues.json
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Starter presets:
|
|
216
|
+
|
|
217
|
+
- `hidden-engine-dynamic`: 40-60s story-driven shorts with hook/proof/mechanism/choice/CTA overlay beats.
|
|
218
|
+
- `captioned-clean`: caption-first videos with minimal transitions.
|
|
219
|
+
|
|
220
|
+
For Node automations:
|
|
221
|
+
|
|
222
|
+
```ts
|
|
223
|
+
import {
|
|
224
|
+
addAgentBrollSequence,
|
|
225
|
+
addAgentTextOverlays,
|
|
226
|
+
addAgentTransitions
|
|
227
|
+
} from 'visualfries/agent';
|
|
228
|
+
|
|
229
|
+
const sceneWithOverlays = addAgentTextOverlays({
|
|
230
|
+
scene,
|
|
231
|
+
overlays: [
|
|
232
|
+
{ text: 'LOVE THIS 😍', start: 0.4, end: 1.1, style: 'pop-label' },
|
|
233
|
+
{ text: 'NECK 🤯', start: 1.1, end: 1.7, style: 'shock-word' }
|
|
234
|
+
]
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
const sceneWithBroll = addAgentBrollSequence({
|
|
238
|
+
scene,
|
|
239
|
+
cues: [
|
|
240
|
+
{ url: './broll/profile.mp4', start: 2.0, end: 5.0, type: 'VIDEO' },
|
|
241
|
+
{ url: './broll/chart.png', start: 5.0, end: 7.0, type: 'IMAGE', motion: 'slow-zoom-in' }
|
|
242
|
+
]
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
const sceneWithTransitions = addAgentTransitions({
|
|
246
|
+
scene,
|
|
247
|
+
transitions: [
|
|
248
|
+
{ time: 2.0, style: 'dip-to-black' },
|
|
249
|
+
{ time: 5.0, style: 'swipe-left', color: '#04483D' }
|
|
250
|
+
]
|
|
251
|
+
});
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Available initial styles:
|
|
255
|
+
|
|
256
|
+
- `pop-label`: reaction label with fast pop animation.
|
|
257
|
+
- `shock-word`: large high-emphasis keyword reveal.
|
|
258
|
+
- `soft-card`: calmer context/proof card.
|
|
259
|
+
- `hook-punch`: loud yellow hook label for the first second.
|
|
260
|
+
- `proof-pill`: compact proof/credibility pill.
|
|
261
|
+
- `metric-badge`: big number/proof badge.
|
|
262
|
+
- `danger-crossout`: wrong-path or negative-beat callout.
|
|
263
|
+
- `cta-card`: final question/choice card.
|
|
264
|
+
|
|
265
|
+
Rules:
|
|
266
|
+
|
|
267
|
+
- One overlay idea per beat.
|
|
268
|
+
- Prefer 0.4-1.4 second overlay durations.
|
|
269
|
+
- Keep the caption lane clear. If captions sit in the middle, place overlays top/bottom or time them between caption-heavy beats.
|
|
270
|
+
- Render `--frames-only --to-frame 3` before encoding when a new overlay style or position is used.
|
|
271
|
+
|
|
272
|
+
For b-roll, use `addAgentBrollSequence` instead of manually creating media layers. It defaults to layer order `5`, which keeps it below captions and overlays.
|
|
273
|
+
|
|
274
|
+
B-roll image cues default to subtle `slow-zoom-in`. Available motion values: `none`, `slow-zoom-in`, `slow-zoom-out`, `drift-up`.
|
|
275
|
+
|
|
276
|
+
For transitions, use `addAgentTransitions` instead of manually creating SHAPE covers. It defaults to layer order `95`, so short transition covers can hide hard cuts. Available styles: `dip-to-black`, `flash`, `swipe-left`, `swipe-up`, `focus-pull`.
|
|
277
|
+
|
|
278
|
+
## Render Workflow
|
|
279
|
+
|
|
280
|
+
Use `visualfries render` after validation:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
visualfries render scene.json --output out.mp4
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
For fast QA:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
visualfries doctor --json
|
|
290
|
+
visualfries qa scene.json --output ./qa
|
|
291
|
+
visualfries render scene.json --output ./qa-frames --frames-only --to-frame 3
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Renderer requirements:
|
|
295
|
+
|
|
296
|
+
- `ffmpeg` must be available on `PATH` for MP4 output.
|
|
297
|
+
- `vite`, `@sveltejs/vite-plugin-svelte`, and `playwright` must be resolvable. In agent environments, set `VISUALFRIES_NODE_MODULES=/path/to/node_modules` when Playwright is provided by a shared runtime.
|
|
298
|
+
- Local media files are copied into a temporary render root and served over the local Vite server so browser rendering does not depend on `file://` access.
|
|
299
|
+
- Audio is mapped from the first local VIDEO asset by default. Use `--audio none` for silent output or `--audio ./voiceover.wav` to override.
|
|
300
|
+
|
|
301
|
+
Run `visualfries doctor --json` before the first render in a new agent environment. It checks ffmpeg, Vite, Svelte Vite plugin, Playwright, Chromium executable resolution, and the temp directory.
|
|
302
|
+
|
|
303
|
+
Run `visualfries catalog --json` when an agent needs valid values for caption presets, cue presets, overlay styles, b-roll motions, transitions, transcript formats, or supported CLI commands.
|
|
304
|
+
|
|
305
|
+
Run `visualfries validate-cues ./cues.json --duration <seconds> --json` before applying hand-edited cues. It catches unknown overlay styles, b-roll motions, transition styles, invalid time ranges, and cues outside the scene duration.
|
|
306
|
+
|
|
307
|
+
Use `visualfries qa scene.json --output ./qa` as the normal agent quality gate. It writes `inspect.json`, `screenshots.json`, and sampled `frames/` into one QA directory.
|
|
308
|
+
|
|
309
|
+
## Agent Output Contract
|
|
310
|
+
|
|
311
|
+
For any generated VisualFries video package, produce:
|
|
312
|
+
|
|
313
|
+
```text
|
|
314
|
+
scene.json
|
|
315
|
+
cues.json
|
|
316
|
+
assets/
|
|
317
|
+
qa/
|
|
318
|
+
inspect.json
|
|
319
|
+
frames/
|
|
320
|
+
out.mp4
|
|
321
|
+
notes.md
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
For caption-only work, `scene.json` plus `inspect.json` is acceptable only when the user explicitly does not need a rendered asset yet.
|
|
325
|
+
|
|
326
|
+
## Current Coverage
|
|
327
|
+
|
|
328
|
+
The CLI covers JSON creation, validation, inspection, production plans, automatic freeze holds, deterministic SVG overlays, exact audio tracks, timeline-segmented MP4 rendering, QA frames, captions, b-roll, transitions, cue files, and one-command compose/produce.
|