@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.
Files changed (61) hide show
  1. package/README.md +6 -3
  2. package/dist/commands/auth.d.ts.map +1 -1
  3. package/dist/commands/auth.js +17 -1
  4. package/dist/commands/project.d.ts.map +1 -1
  5. package/dist/commands/project.js +16 -2
  6. package/dist/commands/render.d.ts.map +1 -1
  7. package/dist/commands/render.js +14 -0
  8. package/dist/commands/validate.d.ts.map +1 -1
  9. package/dist/commands/validate.js +13 -6
  10. package/dist/index.js +3 -1
  11. package/dist/lib/api.d.ts +12 -0
  12. package/dist/lib/api.d.ts.map +1 -1
  13. package/dist/lib/api.js +38 -4
  14. package/dist/lib/format-api-error.d.ts +2 -0
  15. package/dist/lib/format-api-error.d.ts.map +1 -0
  16. package/dist/lib/format-api-error.js +24 -0
  17. package/dist/lib/logger.d.ts +8 -0
  18. package/dist/lib/logger.d.ts.map +1 -0
  19. package/dist/lib/logger.js +51 -0
  20. package/examples/system/rokmilk-chocolate-promo.vid +5 -4
  21. package/package.json +1 -1
  22. package/skills/aider/SKILL.md +13 -18
  23. package/skills/aider/vidscript-guide.md +42 -39
  24. package/skills/aider/vidscript-sample.md +4 -3
  25. package/skills/aider/vidscript-strict.md +26 -8
  26. package/skills/claude/SKILL.md +13 -18
  27. package/skills/claude/vidscript-guide.md +42 -39
  28. package/skills/claude/vidscript-sample.md +4 -3
  29. package/skills/claude/vidscript-strict.md +26 -8
  30. package/skills/codex/SKILL.md +13 -18
  31. package/skills/codex/vidscript-guide.md +42 -39
  32. package/skills/codex/vidscript-sample.md +4 -3
  33. package/skills/codex/vidscript-strict.md +26 -8
  34. package/skills/cursor/SKILL.md +13 -18
  35. package/skills/cursor/vidscript-guide.md +42 -39
  36. package/skills/cursor/vidscript-sample.md +4 -3
  37. package/skills/cursor/vidscript-strict.md +26 -8
  38. package/skills/opencode/SKILL.md +13 -18
  39. package/skills/opencode/vidscript-guide.md +42 -39
  40. package/skills/opencode/vidscript-sample.md +4 -3
  41. package/skills/opencode/vidscript-strict.md +26 -8
  42. package/skills/skills/aider/SKILL.md +13 -18
  43. package/skills/skills/aider/vidscript-guide.md +42 -39
  44. package/skills/skills/aider/vidscript-sample.md +4 -3
  45. package/skills/skills/aider/vidscript-strict.md +26 -8
  46. package/skills/skills/claude/SKILL.md +13 -18
  47. package/skills/skills/claude/vidscript-guide.md +42 -39
  48. package/skills/skills/claude/vidscript-sample.md +4 -3
  49. package/skills/skills/claude/vidscript-strict.md +26 -8
  50. package/skills/skills/codex/SKILL.md +13 -18
  51. package/skills/skills/codex/vidscript-guide.md +42 -39
  52. package/skills/skills/codex/vidscript-sample.md +4 -3
  53. package/skills/skills/codex/vidscript-strict.md +26 -8
  54. package/skills/skills/cursor/SKILL.md +13 -18
  55. package/skills/skills/cursor/vidscript-guide.md +42 -39
  56. package/skills/skills/cursor/vidscript-sample.md +4 -3
  57. package/skills/skills/cursor/vidscript-strict.md +26 -8
  58. package/skills/skills/opencode/SKILL.md +13 -18
  59. package/skills/skills/opencode/vidscript-guide.md +42 -39
  60. package/skills/skills/opencode/vidscript-sample.md +4 -3
  61. 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 plugins** — `import xai from "@scenerok/xai"` before `xai.imagine`, `xai.tts`, or `animate: fadeIn(...)`.
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. **Copy working examples** — see `examples/system/` in this skill folder (e.g. `minimal-text-reel.vid`, `ecom-product-launch.vid`, `rokmilk-chocolate-promo.vid`).
10
- 4. **Strict rules** — see `vidscript-strict.md` for invalid patterns (bare `xai.imagine`, `audio music(...), volume:`, nested quotes in prompts).
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'` | Same import (animation helpers are plugin-backed) |
18
- | `Expected ... but "," found` | Do not put `, volume:` after a plugin call on the same line |
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
- ### Import / Export (Module System)
71
+ ### Package Imports
70
72
 
71
- ```vidscript
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
- # Import from another file
82
- import { intro, BRAND_COLOR } from "./timelines.vid"
83
-
84
- # Import namespace
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
- Plugins require an explicit default import. The server registers `@scenerok/xai` when API keys are configured. Plugin calls run at compile time and must appear **inside time blocks**, not in `let` assignments.
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("...") # missing import
252
- [-] = audio music("..."), volume: 0.5 # trailing params after plugin call
253
- let clip = xai.imagine("...") # plugin assigned to variable
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
- text "Hello", animate: fadeIn(0.8s)
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: Plugin imports are mandatory
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 this line, `xai.imagine`, `xai.tts`, and animation helpers like `fadeIn` fail validation.
13
+ Without the owning import, calls like `xai.imagine`, `xai.tts`, `eleven.music`, and `motion.fadeIn` fail validation.
12
14
 
13
- **Never** call `video xai.imagine(...)` or `animate: fadeIn(...)` without the import above.
15
+ **Never** call package functions without importing the package alias first.
14
16
 
15
- ## Rule 2: Put plugin calls directly in time blocks
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
- **Never** assign plugins to variables: `let clip = xai.imagine(...)` is invalid.
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
- Music/generative audio plugins require their own `import` when available; do not invent bare `music(...)` calls.
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
- [0s .. 2s] = text "Launch", x: "50%", y: "50%", animate: popIn(0.7s)
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`.
@@ -76,37 +76,32 @@ Built-in filters: `monochrome`, `sepia`, `blur`, `chromatic`, `glitch`, `vignett
76
76
  output to "video.mp4", resolution: "1080x1920", fps: 30
77
77
  ```
78
78
 
79
- ### Module System
79
+ ### Package Imports
80
80
 
81
81
  ```vidscript
82
- export const BRAND_COLOR = "#FF5733"
83
- export timeline intro(clip: string, headline: string) {
84
- [-] = clip # auto-append
85
- clip.Trim(start: 0s, end: 3s)
86
- [- 2s] = text headline, style: title # auto-start, 2s duration
87
- }
82
+ import xai from "@scenerok/xai" # xAI image/video/tts
83
+ import eleven from "@elevenlabs/music" # ElevenLabs generative music
84
+ import motion from "@scenerok/basic-animations" # text/video animation helpers
88
85
  ```
89
86
 
90
- ```vidscript
91
- import { intro } from "./timelines.vid"
92
- import * as pack from "./effects.vid"
93
- import eleven from "@elevenlabs/tts" # future scoped package # from npm registry
94
- import music from "@elevenlabs/music" # generative music
95
- use intro at [-] with { clip: main, headline: "Welcome" }
96
- ```
97
-
98
- ### Plugin Calls (required import)
87
+ ### Plugin Calls
99
88
 
100
89
  ```vidscript
101
90
  import xai from "@scenerok/xai"
91
+ import eleven from "@elevenlabs/music"
92
+ import motion from "@scenerok/basic-animations"
102
93
 
103
94
  [-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16", duration: 5)
104
95
  [-] = audio xai.tts("Welcome to SceneRok", voice: "eve")
96
+
97
+ # ElevenLabs music package functions require an import alias.
98
+ let bed = eleven.music("Warm premium launch bed", duration: 15, instrumental: true)
99
+ [0s .. 15s] = audio bed, volume: 0.35, fade_out: 2s
105
100
  ```
106
101
 
107
- **Always** add `import xai from "@scenerok/xai"` before any `xai.imagine` / `xai.tts` call or `animate: fadeIn(...)` helper. Calls without import fail validation with `Unknown function 'xai.imagine'`.
102
+ **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'`.
108
103
 
109
- Put plugin calls **directly** in time blocks never `let clip = xai.imagine(...)`.
104
+ 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.
110
105
 
111
106
  Read `vidscript-strict.md` for anti-patterns and `examples/system/*.vid` for copy-paste templates (installed with `scenerok skills install`).
112
107
 
@@ -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 plugins** — `import xai from "@scenerok/xai"` before `xai.imagine`, `xai.tts`, or `animate: fadeIn(...)`.
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. **Copy working examples** — see `examples/system/` in this skill folder (e.g. `minimal-text-reel.vid`, `ecom-product-launch.vid`, `rokmilk-chocolate-promo.vid`).
10
- 4. **Strict rules** — see `vidscript-strict.md` for invalid patterns (bare `xai.imagine`, `audio music(...), volume:`, nested quotes in prompts).
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'` | Same import (animation helpers are plugin-backed) |
18
- | `Expected ... but "," found` | Do not put `, volume:` after a plugin call on the same line |
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
- ### Import / Export (Module System)
71
+ ### Package Imports
70
72
 
71
- ```vidscript
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
- # Import from another file
82
- import { intro, BRAND_COLOR } from "./timelines.vid"
83
-
84
- # Import namespace
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
- Plugins require an explicit default import. The server registers `@scenerok/xai` when API keys are configured. Plugin calls run at compile time and must appear **inside time blocks**, not in `let` assignments.
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("...") # missing import
252
- [-] = audio music("..."), volume: 0.5 # trailing params after plugin call
253
- let clip = xai.imagine("...") # plugin assigned to variable
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
- text "Hello", animate: fadeIn(0.8s)
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: Plugin imports are mandatory
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 this line, `xai.imagine`, `xai.tts`, and animation helpers like `fadeIn` fail validation.
13
+ Without the owning import, calls like `xai.imagine`, `xai.tts`, `eleven.music`, and `motion.fadeIn` fail validation.
12
14
 
13
- **Never** call `video xai.imagine(...)` or `animate: fadeIn(...)` without the import above.
15
+ **Never** call package functions without importing the package alias first.
14
16
 
15
- ## Rule 2: Put plugin calls directly in time blocks
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
- **Never** assign plugins to variables: `let clip = xai.imagine(...)` is invalid.
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
- Music/generative audio plugins require their own `import` when available; do not invent bare `music(...)` calls.
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
- [0s .. 2s] = text "Launch", x: "50%", y: "50%", animate: popIn(0.7s)
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`.