@scenerok/cli 1.0.5 → 1.0.6
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 +6 -3
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +17 -1
- package/dist/commands/project.d.ts.map +1 -1
- package/dist/commands/project.js +16 -2
- package/dist/commands/render.d.ts.map +1 -1
- package/dist/commands/render.js +14 -0
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +13 -6
- package/dist/index.js +3 -1
- package/dist/lib/api.d.ts +12 -0
- package/dist/lib/api.d.ts.map +1 -1
- package/dist/lib/api.js +38 -4
- package/dist/lib/format-api-error.d.ts +2 -0
- package/dist/lib/format-api-error.d.ts.map +1 -0
- package/dist/lib/format-api-error.js +24 -0
- package/dist/lib/logger.d.ts +8 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +51 -0
- package/examples/system/rokmilk-chocolate-promo.vid +5 -4
- package/package.json +1 -1
- package/skills/aider/SKILL.md +13 -18
- package/skills/aider/vidscript-guide.md +42 -39
- package/skills/aider/vidscript-sample.md +4 -3
- package/skills/aider/vidscript-strict.md +26 -8
- package/skills/claude/SKILL.md +13 -18
- package/skills/claude/vidscript-guide.md +42 -39
- package/skills/claude/vidscript-sample.md +4 -3
- package/skills/claude/vidscript-strict.md +26 -8
- package/skills/codex/SKILL.md +13 -18
- package/skills/codex/vidscript-guide.md +42 -39
- package/skills/codex/vidscript-sample.md +4 -3
- package/skills/codex/vidscript-strict.md +26 -8
- package/skills/cursor/SKILL.md +13 -18
- package/skills/cursor/vidscript-guide.md +42 -39
- package/skills/cursor/vidscript-sample.md +4 -3
- package/skills/cursor/vidscript-strict.md +26 -8
- package/skills/opencode/SKILL.md +13 -18
- package/skills/opencode/vidscript-guide.md +42 -39
- package/skills/opencode/vidscript-sample.md +4 -3
- package/skills/opencode/vidscript-strict.md +26 -8
- package/skills/skills/aider/SKILL.md +13 -18
- package/skills/skills/aider/vidscript-guide.md +42 -39
- package/skills/skills/aider/vidscript-sample.md +4 -3
- package/skills/skills/aider/vidscript-strict.md +26 -8
- package/skills/skills/claude/SKILL.md +13 -18
- package/skills/skills/claude/vidscript-guide.md +42 -39
- package/skills/skills/claude/vidscript-sample.md +4 -3
- package/skills/skills/claude/vidscript-strict.md +26 -8
- package/skills/skills/codex/SKILL.md +13 -18
- package/skills/skills/codex/vidscript-guide.md +42 -39
- package/skills/skills/codex/vidscript-sample.md +4 -3
- package/skills/skills/codex/vidscript-strict.md +26 -8
- package/skills/skills/cursor/SKILL.md +13 -18
- package/skills/skills/cursor/vidscript-guide.md +42 -39
- package/skills/skills/cursor/vidscript-sample.md +4 -3
- package/skills/skills/cursor/vidscript-strict.md +26 -8
- package/skills/skills/opencode/SKILL.md +13 -18
- package/skills/skills/opencode/vidscript-guide.md +42 -39
- package/skills/skills/opencode/vidscript-sample.md +4 -3
- package/skills/skills/opencode/vidscript-strict.md +26 -8
|
@@ -4,18 +4,20 @@ VidScript is a declarative DSL for composing short-form videos. Write a script,
|
|
|
4
4
|
|
|
5
5
|
## Agent quick start (read before composing)
|
|
6
6
|
|
|
7
|
-
1. **Import
|
|
7
|
+
1. **Import every package function** — use `import xai from "@scenerok/xai"`, `import eleven from "@elevenlabs/music"`, and `import motion from "@scenerok/basic-animations"` before calling `xai.*`, `eleven.*`, or `motion.*`.
|
|
8
8
|
2. **Validate early** — `scenerok validate file.vid` (errors show as `Line N:C — message`).
|
|
9
|
-
3. **
|
|
10
|
-
4. **
|
|
9
|
+
3. **Music package syntax** — `import eleven from "@elevenlabs/music"`, then call `eleven.music(...)`, `eleven.generateMusic(...)`, or `eleven.composeMusic(...)`.
|
|
10
|
+
4. **Copy working examples** — see `examples/system/` in this skill folder (e.g. `minimal-text-reel.vid`, `ecom-product-launch.vid`, `rokmilk-chocolate-promo.vid`).
|
|
11
|
+
5. **Strict rules** — see `vidscript-strict.md` for invalid patterns (bare `xai.imagine`, bare `eleven.music(...)` without import, trailing params after direct plugin calls, nested quotes in prompts).
|
|
11
12
|
|
|
12
13
|
### Common validation failures
|
|
13
14
|
|
|
14
15
|
| Symptom | Fix |
|
|
15
16
|
|---------|-----|
|
|
16
17
|
| `Unknown function 'xai.imagine'` | Add `import xai from "@scenerok/xai"` at top |
|
|
17
|
-
| `Unknown function 'fadeIn'` |
|
|
18
|
-
| `Expected ... but "," found` | Do not put `, volume:` after a plugin call
|
|
18
|
+
| `Unknown function 'fadeIn'` | Use `import motion from "@scenerok/basic-animations"` and call `motion.fadeIn(...)` |
|
|
19
|
+
| `Expected ... but "," found` | Do not put `, volume:` after a direct plugin call. Use `let bed = eleven.music(...)`, then `audio bed, volume: ...` |
|
|
20
|
+
| `Unknown function 'eleven.generateMusic'` | Add `import eleven from "@elevenlabs/music"` before calling `eleven.generateMusic(...)` |
|
|
19
21
|
| Parse error on imagine prompt | Remove nested `"` quotes inside the prompt string |
|
|
20
22
|
|
|
21
23
|
## Program Structure
|
|
@@ -66,28 +68,18 @@ let clipName = "hero"
|
|
|
66
68
|
|
|
67
69
|
Variables can hold strings, numbers, time literals, and object expressions. Variables are evaluated at compile time.
|
|
68
70
|
|
|
69
|
-
###
|
|
71
|
+
### Package Imports
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
# Export a constant
|
|
73
|
-
export const BRAND_COLOR = "#FF5733"
|
|
74
|
-
|
|
75
|
-
# Export a timeline
|
|
76
|
-
export timeline intro(clip: string, title_text: string) {
|
|
77
|
-
[-] = clip
|
|
78
|
-
[- 2s] = text title_text, size: 72
|
|
79
|
-
}
|
|
73
|
+
Only default package imports are supported for callable packages. Call functions through the imported alias.
|
|
80
74
|
|
|
81
|
-
|
|
82
|
-
import
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
import * as transitions from "@scenerok/transitions"
|
|
86
|
-
|
|
87
|
-
# Use a timeline
|
|
88
|
-
use intro at 0s .. 5s with { clip: hero, title_text: "Hello" }
|
|
75
|
+
```vidscript
|
|
76
|
+
import xai from "@scenerok/xai"
|
|
77
|
+
import eleven from "@elevenlabs/music"
|
|
78
|
+
import motion from "@scenerok/basic-animations"
|
|
89
79
|
```
|
|
90
80
|
|
|
81
|
+
Named imports (`import { fn } ...`) and namespace imports (`import * as ...`) are not supported.
|
|
82
|
+
|
|
91
83
|
## Time Blocks
|
|
92
84
|
|
|
93
85
|
Time blocks are the core of VidScript. They define when instructions execute on the timeline.
|
|
@@ -238,19 +230,28 @@ Audio sources can be MP3 inputs, audio plugin results, or the embedded audio str
|
|
|
238
230
|
|
|
239
231
|
```vidscript
|
|
240
232
|
import xai from "@scenerok/xai"
|
|
233
|
+
import eleven from "@elevenlabs/music"
|
|
234
|
+
import motion from "@scenerok/basic-animations"
|
|
241
235
|
|
|
242
236
|
[-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16", duration: 5)
|
|
243
237
|
[-] = audio xai.tts("Welcome to SceneRok", voice: "eve")
|
|
238
|
+
|
|
239
|
+
# ElevenLabs music package functions require an import alias.
|
|
240
|
+
[0s .. 15s] = audio eleven.music("Warm premium launch bed", duration: 15, instrumental: true)
|
|
241
|
+
|
|
242
|
+
# If you need volume or fades, store the generated audio first.
|
|
243
|
+
let bed = eleven.music("Warm premium launch bed", duration: 15, instrumental: true)
|
|
244
|
+
[0s .. 15s] = audio bed, volume: 0.35, fade_out: 2s
|
|
244
245
|
```
|
|
245
246
|
|
|
246
|
-
|
|
247
|
+
`@scenerok/xai` requires an explicit default import. ElevenLabs music validates as `eleven.music(...)`, `eleven.generateMusic(...)`, or `eleven.composeMusic(...)` after `import eleven from "@elevenlabs/music"`. Plugin calls run at compile time; direct media plugin instructions cannot have trailing audio params, so use a `let` binding when you need `volume`, `fade_in`, or `fade_out`.
|
|
247
248
|
|
|
248
249
|
**Invalid (will not validate):**
|
|
249
250
|
|
|
250
251
|
```vidscript
|
|
251
|
-
[-] = video xai.imagine("...")
|
|
252
|
-
[
|
|
253
|
-
|
|
252
|
+
[-] = video xai.imagine("...") # missing xAI import
|
|
253
|
+
[0s .. 15s] = audio eleven.generateMusic("...") # missing `import eleven from "@elevenlabs/music"`
|
|
254
|
+
[0s .. 15s] = audio eleven.music("..."), volume: 0.5 # trailing params after direct plugin call
|
|
254
255
|
```
|
|
255
256
|
|
|
256
257
|
## Animations, Effects & Plugins (v2 Extensibility)
|
|
@@ -269,9 +270,11 @@ These accept either plugin function calls or plain object descriptors.
|
|
|
269
270
|
Attach animations to **any** text or video surface.
|
|
270
271
|
|
|
271
272
|
```vidscript
|
|
272
|
-
|
|
273
|
+
import motion from "@scenerok/basic-animations"
|
|
274
|
+
|
|
275
|
+
text "Hello", animate: motion.fadeIn(0.8s)
|
|
273
276
|
|
|
274
|
-
video hero, animate: [fadeIn(0.5s), slideY(-40, 0, 1.2s)]
|
|
277
|
+
video hero, animate: [motion.fadeIn(0.5s), motion.slideY(-40, 0, 1.2s)]
|
|
275
278
|
|
|
276
279
|
text "Title", animate: {
|
|
277
280
|
type: "fade",
|
|
@@ -299,16 +302,16 @@ video hero, effects: [{
|
|
|
299
302
|
|
|
300
303
|
| Function | Description |
|
|
301
304
|
|---------------------------|------------------------------|
|
|
302
|
-
| `fadeIn(duration?)` | Opacity 0 → 1 |
|
|
303
|
-
| `fadeOut(duration?)` | Opacity 1 → 0 |
|
|
304
|
-
| `slideX(from, to, dur?)` | Horizontal slide |
|
|
305
|
-
| `slideY(from, to, dur?)` | Vertical slide |
|
|
306
|
-
| `popIn(duration?)` | Scale + fade entrance |
|
|
307
|
-
| `riseIn(duration?, dist?)` | Upward fade entrance |
|
|
308
|
-
| `swingIn(duration?)` | Rotating slide/fade |
|
|
309
|
-
| `glitchIn(duration?)` | Jitter + flash entrance |
|
|
310
|
-
| `float(duration?, amp?)` | Gentle vertical bob |
|
|
311
|
-
| `typewriter(duration?)` | Character reveal |
|
|
305
|
+
| `motion.fadeIn(duration?)` | Opacity 0 → 1 |
|
|
306
|
+
| `motion.fadeOut(duration?)` | Opacity 1 → 0 |
|
|
307
|
+
| `motion.slideX(from, to, dur?)` | Horizontal slide |
|
|
308
|
+
| `motion.slideY(from, to, dur?)` | Vertical slide |
|
|
309
|
+
| `motion.popIn(duration?)` | Scale + fade entrance |
|
|
310
|
+
| `motion.riseIn(duration?, dist?)` | Upward fade entrance |
|
|
311
|
+
| `motion.swingIn(duration?)` | Rotating slide/fade |
|
|
312
|
+
| `motion.glitchIn(duration?)` | Jitter + flash entrance |
|
|
313
|
+
| `motion.float(duration?, amp?)` | Gentle vertical bob |
|
|
314
|
+
| `motion.typewriter(duration?)` | Character reveal |
|
|
312
315
|
|
|
313
316
|
More plugins (advanced text animations, pixel effects, 3D, etc.) are planned.
|
|
314
317
|
|
|
@@ -4,14 +4,15 @@ Copy this shape for promos that use xAI-generated clips. Run `scenerok validate`
|
|
|
4
4
|
|
|
5
5
|
```vidscript
|
|
6
6
|
import xai from "@scenerok/xai"
|
|
7
|
+
import motion from "@scenerok/basic-animations"
|
|
7
8
|
|
|
8
9
|
input product_name = "{{product_name | RokMilk}}"
|
|
9
10
|
input hook_text = "{{hook_text | Chocolate Milkshake}}"
|
|
10
11
|
input cta_text = "{{cta_text | visit your nearest grocery store}}"
|
|
11
12
|
|
|
12
|
-
[0s .. 2.5s] = text product_name, font: "Bebas Neue", size: 80, color: "#FFD700", x: "50%", y: "20%", align: center, stroke: "#3E1C00", stroke_width: 4, animate: fadeIn(0.6s)
|
|
13
|
+
[0s .. 2.5s] = text product_name, font: "Bebas Neue", size: 80, color: "#FFD700", x: "50%", y: "20%", align: center, stroke: "#3E1C00", stroke_width: 4, animate: motion.fadeIn(0.6s)
|
|
13
14
|
|
|
14
|
-
[2s .. 4.5s] = text hook_text, font: "Outfit", size: 52, color: "#FFFFFF", x: "50%", y: "45%", align: center, stroke: "#3E1C00", stroke_width: 3, animate: riseIn(0.8s)
|
|
15
|
+
[2s .. 4.5s] = text hook_text, font: "Outfit", size: 52, color: "#FFFFFF", x: "50%", y: "45%", align: center, stroke: "#3E1C00", stroke_width: 3, animate: motion.riseIn(0.8s)
|
|
15
16
|
|
|
16
17
|
[-] = video xai.imagine(
|
|
17
18
|
"Premium lifestyle product shot of " + product_name + " chocolate milk in 250ml carton, cinematic lighting, 9:16 vertical",
|
|
@@ -19,7 +20,7 @@ input cta_text = "{{cta_text | visit your nearest grocery store}}"
|
|
|
19
20
|
duration: 6
|
|
20
21
|
)
|
|
21
22
|
|
|
22
|
-
[8s .. 11s] = text cta_text, font: "Bebas Neue", size: 48, color: "#FFD700", x: "50%", y: "80%", align: center, stroke: "#3E1C00", stroke_width: 4, animate: fadeIn(0.8s)
|
|
23
|
+
[8s .. 11s] = text cta_text, font: "Bebas Neue", size: 48, color: "#FFD700", x: "50%", y: "80%", align: center, stroke: "#3E1C00", stroke_width: 4, animate: motion.fadeIn(0.8s)
|
|
23
24
|
|
|
24
25
|
[0s .. 12s] = filter "vignette", intensity: 0.3
|
|
25
26
|
|
|
@@ -2,24 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
Follow these rules exactly. When in doubt, copy a file from `examples/system/` (installed with `scenerok skills install`).
|
|
4
4
|
|
|
5
|
-
## Rule 1:
|
|
5
|
+
## Rule 1: Package imports are mandatory
|
|
6
6
|
|
|
7
7
|
```vidscript
|
|
8
8
|
import xai from "@scenerok/xai"
|
|
9
|
+
import eleven from "@elevenlabs/music"
|
|
10
|
+
import motion from "@scenerok/basic-animations"
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
Without
|
|
13
|
+
Without the owning import, calls like `xai.imagine`, `xai.tts`, `eleven.music`, and `motion.fadeIn` fail validation.
|
|
12
14
|
|
|
13
|
-
**Never** call
|
|
15
|
+
**Never** call package functions without importing the package alias first.
|
|
14
16
|
|
|
15
|
-
## Rule 2:
|
|
17
|
+
## Rule 2: Use registered plugin surfaces
|
|
16
18
|
|
|
17
19
|
```vidscript
|
|
20
|
+
import xai from "@scenerok/xai"
|
|
21
|
+
import eleven from "@elevenlabs/music"
|
|
22
|
+
|
|
18
23
|
[-] = video xai.imagine("Prompt here", aspect_ratio: "9:16", duration: 5)
|
|
19
24
|
[-] = audio xai.tts("Voiceover line", voice: "eve")
|
|
25
|
+
[0s .. 15s] = audio eleven.music("Warm premium music bed", duration: 15, instrumental: true)
|
|
20
26
|
```
|
|
21
27
|
|
|
22
|
-
|
|
28
|
+
For ElevenLabs music, import `@elevenlabs/music` and use `eleven.music(...)`, `eleven.generateMusic(...)`, or `eleven.composeMusic(...)`.
|
|
23
29
|
|
|
24
30
|
## Rule 3: Time ranges use `..`
|
|
25
31
|
|
|
@@ -42,12 +48,22 @@ Use only straight `"` inside `xai.imagine("...")`. Do not nest quotes inside the
|
|
|
42
48
|
## Rule 6: Audio syntax
|
|
43
49
|
|
|
44
50
|
```vidscript
|
|
51
|
+
import xai from "@scenerok/xai"
|
|
52
|
+
import eleven from "@elevenlabs/music"
|
|
53
|
+
|
|
45
54
|
[-] = audio xai.tts("Spoken line", voice: "eve", speed: 1.0)
|
|
55
|
+
|
|
56
|
+
# Direct music call, no trailing audio params.
|
|
57
|
+
[0s .. 15s] = audio eleven.music("Soft premium ad music", duration: 15, instrumental: true)
|
|
58
|
+
|
|
59
|
+
# Use a binding when you need volume or fades.
|
|
60
|
+
let bed = eleven.music("Soft premium ad music", duration: 15, instrumental: true)
|
|
61
|
+
[0s .. 15s] = audio bed, volume: 0.35, fade_out: 2s
|
|
46
62
|
```
|
|
47
63
|
|
|
48
|
-
**Invalid:** `audio music("...", duration: 15), volume: 0.35` — trailing `, volume` after a plugin call is a parse error.
|
|
64
|
+
**Invalid:** `audio eleven.music("...", duration: 15), volume: 0.35` — trailing `, volume` after a direct plugin call is a parse error.
|
|
49
65
|
|
|
50
|
-
|
|
66
|
+
**Invalid:** `eleven.generateMusic(...)` without `import eleven from "@elevenlabs/music"`.
|
|
51
67
|
|
|
52
68
|
## Rule 7: Filters
|
|
53
69
|
|
|
@@ -69,7 +85,9 @@ Do **not** use legacy `config { }` blocks — they are not part of VidScript v2.
|
|
|
69
85
|
## Animations (after import)
|
|
70
86
|
|
|
71
87
|
```vidscript
|
|
72
|
-
|
|
88
|
+
import motion from "@scenerok/basic-animations"
|
|
89
|
+
|
|
90
|
+
[0s .. 2s] = text "Launch", x: "50%", y: "50%", animate: motion.popIn(0.7s)
|
|
73
91
|
```
|
|
74
92
|
|
|
75
93
|
Available: `fadeIn`, `fadeOut`, `slideX`, `slideY`, `popIn`, `riseIn`, `swingIn`, `glitchIn`, `float`, `typewriter`.
|
package/skills/cursor/SKILL.md
CHANGED
|
@@ -67,37 +67,32 @@ Built-in filters: `monochrome`, `sepia`, `blur`, `chromatic`, `glitch`, `vignett
|
|
|
67
67
|
output to "video.mp4", resolution: "1080x1920", fps: 30
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
###
|
|
70
|
+
### Package Imports
|
|
71
71
|
|
|
72
72
|
```vidscript
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
clip.Trim(start: 0s, end: 3s)
|
|
77
|
-
[- 2s] = text headline, style: title # auto-start, 2s duration
|
|
78
|
-
}
|
|
73
|
+
import xai from "@scenerok/xai" # xAI image/video/tts
|
|
74
|
+
import eleven from "@elevenlabs/music" # ElevenLabs generative music
|
|
75
|
+
import motion from "@scenerok/basic-animations" # text/video animation helpers
|
|
79
76
|
```
|
|
80
77
|
|
|
81
|
-
|
|
82
|
-
import { intro } from "./timelines.vid"
|
|
83
|
-
import * as pack from "./effects.vid"
|
|
84
|
-
import eleven from "@elevenlabs/tts" # future scoped package # from npm registry
|
|
85
|
-
import music from "@elevenlabs/music" # generative music
|
|
86
|
-
use intro at [-] with { clip: main, headline: "Welcome" }
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Plugin Calls (required import)
|
|
78
|
+
### Plugin Calls
|
|
90
79
|
|
|
91
80
|
```vidscript
|
|
92
81
|
import xai from "@scenerok/xai"
|
|
82
|
+
import eleven from "@elevenlabs/music"
|
|
83
|
+
import motion from "@scenerok/basic-animations"
|
|
93
84
|
|
|
94
85
|
[-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16", duration: 5)
|
|
95
86
|
[-] = audio xai.tts("Welcome to SceneRok", voice: "eve")
|
|
87
|
+
|
|
88
|
+
# ElevenLabs music package functions require an import alias.
|
|
89
|
+
let bed = eleven.music("Warm premium launch bed", duration: 15, instrumental: true)
|
|
90
|
+
[0s .. 15s] = audio bed, volume: 0.35, fade_out: 2s
|
|
96
91
|
```
|
|
97
92
|
|
|
98
|
-
**Always**
|
|
93
|
+
**Always** import the package that owns the function: `xai.*` from `@scenerok/xai`, `eleven.*` from `@elevenlabs/music`, and `motion.*` from `@scenerok/basic-animations`. Calls without import fail validation with `Unknown function 'xai.imagine'`.
|
|
99
94
|
|
|
100
|
-
|
|
95
|
+
For ElevenLabs music, import `@elevenlabs/music` and call `eleven.music(...)`, `eleven.generateMusic(...)`, or `eleven.composeMusic(...)`. Use `let bed = eleven.music(...)` followed by `audio bed, volume: ...` when you need volume or fades.
|
|
101
96
|
|
|
102
97
|
Read `vidscript-strict.md` for anti-patterns and `examples/system/*.vid` for copy-paste templates (installed with `scenerok skills install`).
|
|
103
98
|
|
|
@@ -4,18 +4,20 @@ VidScript is a declarative DSL for composing short-form videos. Write a script,
|
|
|
4
4
|
|
|
5
5
|
## Agent quick start (read before composing)
|
|
6
6
|
|
|
7
|
-
1. **Import
|
|
7
|
+
1. **Import every package function** — use `import xai from "@scenerok/xai"`, `import eleven from "@elevenlabs/music"`, and `import motion from "@scenerok/basic-animations"` before calling `xai.*`, `eleven.*`, or `motion.*`.
|
|
8
8
|
2. **Validate early** — `scenerok validate file.vid` (errors show as `Line N:C — message`).
|
|
9
|
-
3. **
|
|
10
|
-
4. **
|
|
9
|
+
3. **Music package syntax** — `import eleven from "@elevenlabs/music"`, then call `eleven.music(...)`, `eleven.generateMusic(...)`, or `eleven.composeMusic(...)`.
|
|
10
|
+
4. **Copy working examples** — see `examples/system/` in this skill folder (e.g. `minimal-text-reel.vid`, `ecom-product-launch.vid`, `rokmilk-chocolate-promo.vid`).
|
|
11
|
+
5. **Strict rules** — see `vidscript-strict.md` for invalid patterns (bare `xai.imagine`, bare `eleven.music(...)` without import, trailing params after direct plugin calls, nested quotes in prompts).
|
|
11
12
|
|
|
12
13
|
### Common validation failures
|
|
13
14
|
|
|
14
15
|
| Symptom | Fix |
|
|
15
16
|
|---------|-----|
|
|
16
17
|
| `Unknown function 'xai.imagine'` | Add `import xai from "@scenerok/xai"` at top |
|
|
17
|
-
| `Unknown function 'fadeIn'` |
|
|
18
|
-
| `Expected ... but "," found` | Do not put `, volume:` after a plugin call
|
|
18
|
+
| `Unknown function 'fadeIn'` | Use `import motion from "@scenerok/basic-animations"` and call `motion.fadeIn(...)` |
|
|
19
|
+
| `Expected ... but "," found` | Do not put `, volume:` after a direct plugin call. Use `let bed = eleven.music(...)`, then `audio bed, volume: ...` |
|
|
20
|
+
| `Unknown function 'eleven.generateMusic'` | Add `import eleven from "@elevenlabs/music"` before calling `eleven.generateMusic(...)` |
|
|
19
21
|
| Parse error on imagine prompt | Remove nested `"` quotes inside the prompt string |
|
|
20
22
|
|
|
21
23
|
## Program Structure
|
|
@@ -66,28 +68,18 @@ let clipName = "hero"
|
|
|
66
68
|
|
|
67
69
|
Variables can hold strings, numbers, time literals, and object expressions. Variables are evaluated at compile time.
|
|
68
70
|
|
|
69
|
-
###
|
|
71
|
+
### Package Imports
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
# Export a constant
|
|
73
|
-
export const BRAND_COLOR = "#FF5733"
|
|
74
|
-
|
|
75
|
-
# Export a timeline
|
|
76
|
-
export timeline intro(clip: string, title_text: string) {
|
|
77
|
-
[-] = clip
|
|
78
|
-
[- 2s] = text title_text, size: 72
|
|
79
|
-
}
|
|
73
|
+
Only default package imports are supported for callable packages. Call functions through the imported alias.
|
|
80
74
|
|
|
81
|
-
|
|
82
|
-
import
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
import * as transitions from "@scenerok/transitions"
|
|
86
|
-
|
|
87
|
-
# Use a timeline
|
|
88
|
-
use intro at 0s .. 5s with { clip: hero, title_text: "Hello" }
|
|
75
|
+
```vidscript
|
|
76
|
+
import xai from "@scenerok/xai"
|
|
77
|
+
import eleven from "@elevenlabs/music"
|
|
78
|
+
import motion from "@scenerok/basic-animations"
|
|
89
79
|
```
|
|
90
80
|
|
|
81
|
+
Named imports (`import { fn } ...`) and namespace imports (`import * as ...`) are not supported.
|
|
82
|
+
|
|
91
83
|
## Time Blocks
|
|
92
84
|
|
|
93
85
|
Time blocks are the core of VidScript. They define when instructions execute on the timeline.
|
|
@@ -238,19 +230,28 @@ Audio sources can be MP3 inputs, audio plugin results, or the embedded audio str
|
|
|
238
230
|
|
|
239
231
|
```vidscript
|
|
240
232
|
import xai from "@scenerok/xai"
|
|
233
|
+
import eleven from "@elevenlabs/music"
|
|
234
|
+
import motion from "@scenerok/basic-animations"
|
|
241
235
|
|
|
242
236
|
[-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16", duration: 5)
|
|
243
237
|
[-] = audio xai.tts("Welcome to SceneRok", voice: "eve")
|
|
238
|
+
|
|
239
|
+
# ElevenLabs music package functions require an import alias.
|
|
240
|
+
[0s .. 15s] = audio eleven.music("Warm premium launch bed", duration: 15, instrumental: true)
|
|
241
|
+
|
|
242
|
+
# If you need volume or fades, store the generated audio first.
|
|
243
|
+
let bed = eleven.music("Warm premium launch bed", duration: 15, instrumental: true)
|
|
244
|
+
[0s .. 15s] = audio bed, volume: 0.35, fade_out: 2s
|
|
244
245
|
```
|
|
245
246
|
|
|
246
|
-
|
|
247
|
+
`@scenerok/xai` requires an explicit default import. ElevenLabs music validates as `eleven.music(...)`, `eleven.generateMusic(...)`, or `eleven.composeMusic(...)` after `import eleven from "@elevenlabs/music"`. Plugin calls run at compile time; direct media plugin instructions cannot have trailing audio params, so use a `let` binding when you need `volume`, `fade_in`, or `fade_out`.
|
|
247
248
|
|
|
248
249
|
**Invalid (will not validate):**
|
|
249
250
|
|
|
250
251
|
```vidscript
|
|
251
|
-
[-] = video xai.imagine("...")
|
|
252
|
-
[
|
|
253
|
-
|
|
252
|
+
[-] = video xai.imagine("...") # missing xAI import
|
|
253
|
+
[0s .. 15s] = audio eleven.generateMusic("...") # missing `import eleven from "@elevenlabs/music"`
|
|
254
|
+
[0s .. 15s] = audio eleven.music("..."), volume: 0.5 # trailing params after direct plugin call
|
|
254
255
|
```
|
|
255
256
|
|
|
256
257
|
## Animations, Effects & Plugins (v2 Extensibility)
|
|
@@ -269,9 +270,11 @@ These accept either plugin function calls or plain object descriptors.
|
|
|
269
270
|
Attach animations to **any** text or video surface.
|
|
270
271
|
|
|
271
272
|
```vidscript
|
|
272
|
-
|
|
273
|
+
import motion from "@scenerok/basic-animations"
|
|
274
|
+
|
|
275
|
+
text "Hello", animate: motion.fadeIn(0.8s)
|
|
273
276
|
|
|
274
|
-
video hero, animate: [fadeIn(0.5s), slideY(-40, 0, 1.2s)]
|
|
277
|
+
video hero, animate: [motion.fadeIn(0.5s), motion.slideY(-40, 0, 1.2s)]
|
|
275
278
|
|
|
276
279
|
text "Title", animate: {
|
|
277
280
|
type: "fade",
|
|
@@ -299,16 +302,16 @@ video hero, effects: [{
|
|
|
299
302
|
|
|
300
303
|
| Function | Description |
|
|
301
304
|
|---------------------------|------------------------------|
|
|
302
|
-
| `fadeIn(duration?)` | Opacity 0 → 1 |
|
|
303
|
-
| `fadeOut(duration?)` | Opacity 1 → 0 |
|
|
304
|
-
| `slideX(from, to, dur?)` | Horizontal slide |
|
|
305
|
-
| `slideY(from, to, dur?)` | Vertical slide |
|
|
306
|
-
| `popIn(duration?)` | Scale + fade entrance |
|
|
307
|
-
| `riseIn(duration?, dist?)` | Upward fade entrance |
|
|
308
|
-
| `swingIn(duration?)` | Rotating slide/fade |
|
|
309
|
-
| `glitchIn(duration?)` | Jitter + flash entrance |
|
|
310
|
-
| `float(duration?, amp?)` | Gentle vertical bob |
|
|
311
|
-
| `typewriter(duration?)` | Character reveal |
|
|
305
|
+
| `motion.fadeIn(duration?)` | Opacity 0 → 1 |
|
|
306
|
+
| `motion.fadeOut(duration?)` | Opacity 1 → 0 |
|
|
307
|
+
| `motion.slideX(from, to, dur?)` | Horizontal slide |
|
|
308
|
+
| `motion.slideY(from, to, dur?)` | Vertical slide |
|
|
309
|
+
| `motion.popIn(duration?)` | Scale + fade entrance |
|
|
310
|
+
| `motion.riseIn(duration?, dist?)` | Upward fade entrance |
|
|
311
|
+
| `motion.swingIn(duration?)` | Rotating slide/fade |
|
|
312
|
+
| `motion.glitchIn(duration?)` | Jitter + flash entrance |
|
|
313
|
+
| `motion.float(duration?, amp?)` | Gentle vertical bob |
|
|
314
|
+
| `motion.typewriter(duration?)` | Character reveal |
|
|
312
315
|
|
|
313
316
|
More plugins (advanced text animations, pixel effects, 3D, etc.) are planned.
|
|
314
317
|
|
|
@@ -4,14 +4,15 @@ Copy this shape for promos that use xAI-generated clips. Run `scenerok validate`
|
|
|
4
4
|
|
|
5
5
|
```vidscript
|
|
6
6
|
import xai from "@scenerok/xai"
|
|
7
|
+
import motion from "@scenerok/basic-animations"
|
|
7
8
|
|
|
8
9
|
input product_name = "{{product_name | RokMilk}}"
|
|
9
10
|
input hook_text = "{{hook_text | Chocolate Milkshake}}"
|
|
10
11
|
input cta_text = "{{cta_text | visit your nearest grocery store}}"
|
|
11
12
|
|
|
12
|
-
[0s .. 2.5s] = text product_name, font: "Bebas Neue", size: 80, color: "#FFD700", x: "50%", y: "20%", align: center, stroke: "#3E1C00", stroke_width: 4, animate: fadeIn(0.6s)
|
|
13
|
+
[0s .. 2.5s] = text product_name, font: "Bebas Neue", size: 80, color: "#FFD700", x: "50%", y: "20%", align: center, stroke: "#3E1C00", stroke_width: 4, animate: motion.fadeIn(0.6s)
|
|
13
14
|
|
|
14
|
-
[2s .. 4.5s] = text hook_text, font: "Outfit", size: 52, color: "#FFFFFF", x: "50%", y: "45%", align: center, stroke: "#3E1C00", stroke_width: 3, animate: riseIn(0.8s)
|
|
15
|
+
[2s .. 4.5s] = text hook_text, font: "Outfit", size: 52, color: "#FFFFFF", x: "50%", y: "45%", align: center, stroke: "#3E1C00", stroke_width: 3, animate: motion.riseIn(0.8s)
|
|
15
16
|
|
|
16
17
|
[-] = video xai.imagine(
|
|
17
18
|
"Premium lifestyle product shot of " + product_name + " chocolate milk in 250ml carton, cinematic lighting, 9:16 vertical",
|
|
@@ -19,7 +20,7 @@ input cta_text = "{{cta_text | visit your nearest grocery store}}"
|
|
|
19
20
|
duration: 6
|
|
20
21
|
)
|
|
21
22
|
|
|
22
|
-
[8s .. 11s] = text cta_text, font: "Bebas Neue", size: 48, color: "#FFD700", x: "50%", y: "80%", align: center, stroke: "#3E1C00", stroke_width: 4, animate: fadeIn(0.8s)
|
|
23
|
+
[8s .. 11s] = text cta_text, font: "Bebas Neue", size: 48, color: "#FFD700", x: "50%", y: "80%", align: center, stroke: "#3E1C00", stroke_width: 4, animate: motion.fadeIn(0.8s)
|
|
23
24
|
|
|
24
25
|
[0s .. 12s] = filter "vignette", intensity: 0.3
|
|
25
26
|
|
|
@@ -2,24 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
Follow these rules exactly. When in doubt, copy a file from `examples/system/` (installed with `scenerok skills install`).
|
|
4
4
|
|
|
5
|
-
## Rule 1:
|
|
5
|
+
## Rule 1: Package imports are mandatory
|
|
6
6
|
|
|
7
7
|
```vidscript
|
|
8
8
|
import xai from "@scenerok/xai"
|
|
9
|
+
import eleven from "@elevenlabs/music"
|
|
10
|
+
import motion from "@scenerok/basic-animations"
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
Without
|
|
13
|
+
Without the owning import, calls like `xai.imagine`, `xai.tts`, `eleven.music`, and `motion.fadeIn` fail validation.
|
|
12
14
|
|
|
13
|
-
**Never** call
|
|
15
|
+
**Never** call package functions without importing the package alias first.
|
|
14
16
|
|
|
15
|
-
## Rule 2:
|
|
17
|
+
## Rule 2: Use registered plugin surfaces
|
|
16
18
|
|
|
17
19
|
```vidscript
|
|
20
|
+
import xai from "@scenerok/xai"
|
|
21
|
+
import eleven from "@elevenlabs/music"
|
|
22
|
+
|
|
18
23
|
[-] = video xai.imagine("Prompt here", aspect_ratio: "9:16", duration: 5)
|
|
19
24
|
[-] = audio xai.tts("Voiceover line", voice: "eve")
|
|
25
|
+
[0s .. 15s] = audio eleven.music("Warm premium music bed", duration: 15, instrumental: true)
|
|
20
26
|
```
|
|
21
27
|
|
|
22
|
-
|
|
28
|
+
For ElevenLabs music, import `@elevenlabs/music` and use `eleven.music(...)`, `eleven.generateMusic(...)`, or `eleven.composeMusic(...)`.
|
|
23
29
|
|
|
24
30
|
## Rule 3: Time ranges use `..`
|
|
25
31
|
|
|
@@ -42,12 +48,22 @@ Use only straight `"` inside `xai.imagine("...")`. Do not nest quotes inside the
|
|
|
42
48
|
## Rule 6: Audio syntax
|
|
43
49
|
|
|
44
50
|
```vidscript
|
|
51
|
+
import xai from "@scenerok/xai"
|
|
52
|
+
import eleven from "@elevenlabs/music"
|
|
53
|
+
|
|
45
54
|
[-] = audio xai.tts("Spoken line", voice: "eve", speed: 1.0)
|
|
55
|
+
|
|
56
|
+
# Direct music call, no trailing audio params.
|
|
57
|
+
[0s .. 15s] = audio eleven.music("Soft premium ad music", duration: 15, instrumental: true)
|
|
58
|
+
|
|
59
|
+
# Use a binding when you need volume or fades.
|
|
60
|
+
let bed = eleven.music("Soft premium ad music", duration: 15, instrumental: true)
|
|
61
|
+
[0s .. 15s] = audio bed, volume: 0.35, fade_out: 2s
|
|
46
62
|
```
|
|
47
63
|
|
|
48
|
-
**Invalid:** `audio music("...", duration: 15), volume: 0.35` — trailing `, volume` after a plugin call is a parse error.
|
|
64
|
+
**Invalid:** `audio eleven.music("...", duration: 15), volume: 0.35` — trailing `, volume` after a direct plugin call is a parse error.
|
|
49
65
|
|
|
50
|
-
|
|
66
|
+
**Invalid:** `eleven.generateMusic(...)` without `import eleven from "@elevenlabs/music"`.
|
|
51
67
|
|
|
52
68
|
## Rule 7: Filters
|
|
53
69
|
|
|
@@ -69,7 +85,9 @@ Do **not** use legacy `config { }` blocks — they are not part of VidScript v2.
|
|
|
69
85
|
## Animations (after import)
|
|
70
86
|
|
|
71
87
|
```vidscript
|
|
72
|
-
|
|
88
|
+
import motion from "@scenerok/basic-animations"
|
|
89
|
+
|
|
90
|
+
[0s .. 2s] = text "Launch", x: "50%", y: "50%", animate: motion.popIn(0.7s)
|
|
73
91
|
```
|
|
74
92
|
|
|
75
93
|
Available: `fadeIn`, `fadeOut`, `slideX`, `slideY`, `popIn`, `riseIn`, `swingIn`, `glitchIn`, `float`, `typewriter`.
|
package/skills/opencode/SKILL.md
CHANGED
|
@@ -67,37 +67,32 @@ Built-in filters: `monochrome`, `sepia`, `blur`, `chromatic`, `glitch`, `vignett
|
|
|
67
67
|
output to "video.mp4", resolution: "1080x1920", fps: 30
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
###
|
|
70
|
+
### Package Imports
|
|
71
71
|
|
|
72
72
|
```vidscript
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
clip.Trim(start: 0s, end: 3s)
|
|
77
|
-
[- 2s] = text headline, style: title # auto-start, 2s duration
|
|
78
|
-
}
|
|
73
|
+
import xai from "@scenerok/xai" # xAI image/video/tts
|
|
74
|
+
import eleven from "@elevenlabs/music" # ElevenLabs generative music
|
|
75
|
+
import motion from "@scenerok/basic-animations" # text/video animation helpers
|
|
79
76
|
```
|
|
80
77
|
|
|
81
|
-
|
|
82
|
-
import { intro } from "./timelines.vid"
|
|
83
|
-
import * as pack from "./effects.vid"
|
|
84
|
-
import eleven from "@elevenlabs/tts" # future scoped package # from npm registry
|
|
85
|
-
import music from "@elevenlabs/music" # generative music
|
|
86
|
-
use intro at [-] with { clip: main, headline: "Welcome" }
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Plugin Calls (required import)
|
|
78
|
+
### Plugin Calls
|
|
90
79
|
|
|
91
80
|
```vidscript
|
|
92
81
|
import xai from "@scenerok/xai"
|
|
82
|
+
import eleven from "@elevenlabs/music"
|
|
83
|
+
import motion from "@scenerok/basic-animations"
|
|
93
84
|
|
|
94
85
|
[-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16", duration: 5)
|
|
95
86
|
[-] = audio xai.tts("Welcome to SceneRok", voice: "eve")
|
|
87
|
+
|
|
88
|
+
# ElevenLabs music package functions require an import alias.
|
|
89
|
+
let bed = eleven.music("Warm premium launch bed", duration: 15, instrumental: true)
|
|
90
|
+
[0s .. 15s] = audio bed, volume: 0.35, fade_out: 2s
|
|
96
91
|
```
|
|
97
92
|
|
|
98
|
-
**Always**
|
|
93
|
+
**Always** import the package that owns the function: `xai.*` from `@scenerok/xai`, `eleven.*` from `@elevenlabs/music`, and `motion.*` from `@scenerok/basic-animations`. Calls without import fail validation with `Unknown function 'xai.imagine'`.
|
|
99
94
|
|
|
100
|
-
|
|
95
|
+
For ElevenLabs music, import `@elevenlabs/music` and call `eleven.music(...)`, `eleven.generateMusic(...)`, or `eleven.composeMusic(...)`. Use `let bed = eleven.music(...)` followed by `audio bed, volume: ...` when you need volume or fades.
|
|
101
96
|
|
|
102
97
|
Read `vidscript-strict.md` for anti-patterns and `examples/system/*.vid` for copy-paste templates (installed with `scenerok skills install`).
|
|
103
98
|
|