@vibeframe/cli 0.99.1 → 0.101.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CONTEXT.md +110 -31
  2. package/dist/index.js +7739 -4042
  3. package/package.json +5 -4
package/CONTEXT.md CHANGED
@@ -8,13 +8,14 @@ a shell command. The same surface is exposed as MCP tools through
8
8
 
9
9
  For the full reference (every flag, default, enum), read
10
10
  [`docs/cli-reference.md`](../../docs/cli-reference.md) — auto-generated
11
- from `vibe schema --list`. This file is the *agent quickstart*: rules,
11
+ from `vibe schema --list`. This file is the _agent quickstart_: rules,
12
12
  conventions, and discovery hooks.
13
13
 
14
14
  ## Discovery (use these first)
15
15
 
16
16
  ```bash
17
17
  vibe schema --list --json # All commands with paths + descriptions
18
+ vibe schema --list --surface public # Small first-run/product command surface
18
19
  vibe schema <group>.<leaf> --json # JSON Schema for one command
19
20
  vibe doctor --json # Configured API keys + filter availability
20
21
  vibe guide <topic> --json # Step-by-step guides (motion | scene | pipeline)
@@ -29,7 +30,7 @@ vibe guide <topic> --json # Step-by-step guides (motion | scene | p
29
30
  2. **`--dry-run` before any paid call** — returns a `costUsd` estimate
30
31
  in the JSON envelope without spending. Validates inputs.
31
32
  3. **`--stdin` for complex options** — `echo '{"key":"value"}' | vibe
32
- <cmd> --stdin --json`. CLI flags still win on conflict.
33
+ <cmd> --stdin --json`. CLI flags still win on conflict.
33
34
  4. **`--fields <list>`** — limit JSON output fields on read-heavy
34
35
  commands (e.g. `--fields "path,duration"`).
35
36
  5. **`--describe`** — print a command's JSON Schema and exit (no
@@ -37,30 +38,34 @@ vibe guide <topic> --json # Step-by-step guides (motion | scene | p
37
38
 
38
39
  ## Cost tiers
39
40
 
40
- | Tier | Commands | Per-call cost |
41
- |------|----------|---------------|
42
- | Free | `detect *`, `edit silence-cut/fade/noise-reduce/text-overlay/interpolate`, `timeline *`, `scene lint/list-styles`, `audio duck` | $0 |
43
- | Low | `inspect *`, `audio transcribe/list-voices`, `generate image` | $0.01–0.10 |
44
- | High | `generate video`, `edit image`, `edit grade/reframe/speed-ramp` | $1–5 |
45
- | Very High | `remix *` (highlights, auto-shorts, regenerate-scene), `vibe build` (full pipeline) | $5–50+ |
41
+ | Tier | Commands | Per-call cost |
42
+ | --------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------- |
43
+ | Free | `detect *`, `edit silence-cut/fade/noise-reduce/text-overlay/interpolate`, `timeline *`, `scene lint/list-styles`, `audio duck` | $0 |
44
+ | Low | `inspect *`, `audio transcribe/list-voices`, `generate image` | $0.01–0.10 |
45
+ | High | `generate video`, `edit image`, `edit grade/reframe/speed-ramp` | $1–5 |
46
+ | Very High | `remix *` (highlights, auto-shorts, regenerate-scene), `vibe build` (full pipeline) | $5–50+ |
46
47
 
47
48
  > Rule: **confirm with the user before any High / Very-High call**.
48
49
 
49
50
  ## JSON envelope
50
51
 
51
52
  ### Success
53
+
52
54
  ```json
53
55
  {
54
56
  "command": "<group> <leaf>",
55
57
  "elapsedMs": 12345,
56
58
  "costUsd": 0.07,
57
59
  "warnings": [],
58
- "data": { /* command-specific */ },
60
+ "data": {
61
+ /* command-specific */
62
+ },
59
63
  "dryRun": true
60
64
  }
61
65
  ```
62
66
 
63
67
  ### Error (stderr)
68
+
64
69
  ```json
65
70
  {
66
71
  "success": false,
@@ -72,13 +77,13 @@ vibe guide <topic> --json # Step-by-step guides (motion | scene | p
72
77
  }
73
78
  ```
74
79
 
75
- | Code | Exit | Meaning | Recovery |
76
- |------|------|---------|----------|
77
- | `USAGE_ERROR` | 2 | bad arg | check `vibe schema <cmd>` |
78
- | `NOT_FOUND` | 3 | file missing | verify path |
79
- | `AUTH_ERROR` | 4 | key missing/invalid | `vibe doctor` |
80
- | `API_ERROR` | 5 | provider failed | retry if `retryable: true` |
81
- | `NETWORK_ERROR` | 6 | connection | retry with backoff |
80
+ | Code | Exit | Meaning | Recovery |
81
+ | --------------- | ---- | ------------------- | -------------------------- |
82
+ | `USAGE_ERROR` | 2 | bad arg | check `vibe schema <cmd>` |
83
+ | `NOT_FOUND` | 3 | file missing | verify path |
84
+ | `AUTH_ERROR` | 4 | key missing/invalid | `vibe doctor` |
85
+ | `API_ERROR` | 5 | provider failed | retry if `retryable: true` |
86
+ | `NETWORK_ERROR` | 6 | connection | retry with backoff |
82
87
 
83
88
  ## Authentication
84
89
 
@@ -107,13 +112,15 @@ export IMGBB_API_KEY="..." # Local image upload (Seedance image-to-video
107
112
  The **storyboard project** is the primary product lane. `STORYBOARD.md`
108
113
  and `DESIGN.md` are the source of truth; generated files under
109
114
  `compositions/` are artifacts. Use `vibe storyboard *` for narrow cue
110
- edits and direct Markdown edits for larger creative rewrites. Use
115
+ edits, and use `vibe storyboard revise --dry-run` for project-aware
116
+ LLM revisions to `STORYBOARD.md`. Use direct Markdown edits for larger
117
+ design rewrites. Use
111
118
  `vibe inspect project`, `vibe inspect render --cheap`, and `vibe scene repair`
112
119
  for deterministic local review and mechanical composition fixes. Semantic
113
120
  creative fixes belong to the host agent.
114
121
 
115
122
  ```
116
- init --from → storyboard validate → plan → build → inspect → render # storyboard-to-video
123
+ init --from → storyboard revise → storyboard validate → plan → build → inspect → render
117
124
  generate / edit / inspect / remix # one-shot media tools
118
125
  scene / timeline # lower-level authoring
119
126
  run / agent / schema / context # automation + agents
@@ -126,20 +133,72 @@ CLI flag → per-beat STORYBOARD.md cue → vibe.config.json →
126
133
  legacy vibe.project.yaml → configured/env default → VibeFrame default
127
134
  ```
128
135
 
136
+ Build planning contract:
137
+
138
+ `vibe plan --json` emits `data.kind:"build-plan"`, `schemaVersion:"1"`,
139
+ `status:"ready"|"invalid"`, `summary`, `providerResolution`, cache-aware
140
+ per-asset plans, asset reference metadata (`sourcePath`, `referenceError`),
141
+ `validation`, `retryWith`, and `nextCommands`. `backdrop`, `video`, `music`,
142
+ `narration`, and generic `asset` cues may point at existing project-local media;
143
+ those are planned as `reason:"referenced-asset"` with no provider spend, while
144
+ invalid/out-of-project paths are surfaced before provider dispatch. `vibe plan`,
145
+ `vibe build --dry-run`, and `vibe build` validate `STORYBOARD.md` before cost
146
+ caps or provider dispatch. Invalid storyboards exit non-zero with
147
+ `code:"STORYBOARD_VALIDATION_FAILED"` and `retryWith` entries for
148
+ `storyboard validate` / `storyboard revise`.
149
+
150
+ Build repair contract:
151
+
152
+ Real `vibe build` runs deterministic scene repair after compose
153
+ (sub-compositions only) and after sync (including root `index.html`) before
154
+ render. Failed repair returns `code:"SCENE_REPAIR_FAILED"` and
155
+ `sceneRepair:{ran,stage,status,score,fixed,remainingIssues,retryWith}`; use
156
+ those `retryWith` commands before trying to render. `vibe scene repair`
157
+ also repairs deterministic root timeline drift: clip refs, root duration, and
158
+ root narration audio wiring.
159
+
160
+ Asset stage failure contract:
161
+
162
+ If assets fail during a full build, `vibe build` stops before compose/render
163
+ and returns `currentStage:"assets"` with `code:"ASSET_REFERENCE_INVALID"`,
164
+ `code:"MISSING_API_KEY"`, or `code:"ASSET_GENERATION_FAILED"` plus
165
+ `suggestion`, `recoverable:true`, and `retryWith`.
166
+ Compose failures use `code:"COMPOSE_FAILED"` and render failures use the
167
+ render code or `code:"RENDER_FAILED"`; both include `currentStage`,
168
+ `suggestion`, `recoverable:true`, and `retryWith`.
169
+
170
+ Review report contract:
171
+
172
+ `vibe inspect project` and `vibe inspect render` write
173
+ `review-report.json` by default. The file uses `kind:"review"`,
174
+ `mode:"project"|"render"`, `status`, `score`, `issues[]`,
175
+ `summary:{issueCount,errorCount,warningCount,infoCount,fixOwners}`,
176
+ `sourceReports`, and `retryWith`. Each issue has `fixOwner:"vibe"` for
177
+ deterministic CLI recovery or `fixOwner:"host-agent"` for storyboard/design/
178
+ composition edits the host agent should make. Use `retryWith` first, then
179
+ hand remaining `host-agent` issues to the agent.
180
+
181
+ Product surface contract:
182
+
183
+ `vibe schema --list` includes `surface`, `replacement`, and `note`.
184
+ Prefer `vibe schema --list --surface public` for first-run/product workflows.
185
+ Use `legacy` commands only for compatibility and inspect `replacement` first.
186
+
129
187
  ## Per-group invariants
130
188
 
131
- | Group | Key rule |
132
- |-------|----------|
133
- | `generate` | Always `--dry-run` first. Costs money. `-p` selects provider; default routes via key availability. `--no-wait` returns local job ids. |
134
- | `edit` | FFmpeg-only leaves (silence-cut, fade, noise-reduce, text-overlay, interpolate) are free. caption/grade/reframe/image need API keys. |
135
- | `inspect` | `inspect project` and `inspect render --cheap` are local. Use `inspect render --ai` for final Gemini critique; Gemini media/review calls are low cost. |
136
- | `audio` | `transcribe` low cost (Whisper). `dub` is full pipeline (medium-high). `duck` is free. |
137
- | `remix` | **Confirm with user.** Multi-step, high cost ($5–50+). Always `--dry-run`. |
138
- | `detect` | Free, FFmpeg only. No keys. |
139
- | `project / timeline` | Free. All mutating leaves support `--dry-run`. |
140
- | `scene` | `lint` and `list-styles` free; `add` may invoke TTS + image-gen. |
141
- | `init / build / render` | Top-level project flow. `init` is idempotent (existing files preserved without `--force`). |
142
- | `status` | Free/local by default. Use `status job` and `status project` to inspect async jobs and latest build/review reports. |
189
+ | Group | Key rule |
190
+ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
191
+ | `generate` | Always `--dry-run` first. Costs money. `-p` selects provider; default routes via key availability. `--no-wait` returns local job ids. |
192
+ | `edit` | FFmpeg-only leaves (silence-cut, fade, noise-reduce, text-overlay, interpolate) are free. caption/grade/reframe/image need API keys. |
193
+ | `inspect` | `inspect project` and `inspect render --cheap` are local. Use `inspect render --ai` for final Gemini critique; Gemini media/review calls are low cost. |
194
+ | `audio` | `transcribe` low cost (Whisper). `dub` is full pipeline (medium-high). `duck` is free. |
195
+ | `remix` | **Confirm with user.** Multi-step, high cost ($5–50+). Always `--dry-run`. |
196
+ | `detect` | Free, FFmpeg only. No keys. |
197
+ | `project / timeline` | Free. All mutating leaves support `--dry-run`. |
198
+ | `scene` | `lint` and `list-styles` free; `add` may invoke TTS + image-gen. |
199
+ | `init / build / render` | Top-level project flow. `init` is idempotent. `build --stage assets` may return async job ids for video/music cues; poll with `status project --refresh`. Real `build` auto-repairs scene artifacts before render. |
200
+ | `storyboard` | `list/get/set/move/validate` are local. `revise` uses a composer LLM, validates before writing, and should be run with `--dry-run` first. |
201
+ | `status` | Free/local by default. `status job` returns a flat `kind:"job"` payload plus the raw record; `status project` returns `kind/status/currentStage/beats/jobs/build/review/retryWith` for resume decisions. |
143
202
 
144
203
  ## Common patterns
145
204
 
@@ -148,7 +207,7 @@ legacy vibe.project.yaml → configured/env default → VibeFrame default
148
207
  ```bash
149
208
  vibe generate image "hero shot" -o hero.png --json
150
209
  vibe generate video "motion prompt" -i hero.png -o hero.mp4 --json
151
- vibe generate speech "narration text" -o voice.mp3 --json
210
+ vibe generate narration "narration text" -o voice.mp3 --json
152
211
  vibe generate music "mood description" -o bgm.mp3 -d 10 --json
153
212
  ```
154
213
 
@@ -156,19 +215,39 @@ vibe generate music "mood description" -o bgm.mp3 -d 10 --json
156
215
 
157
216
  ```bash
158
217
  vibe init my-video --from "45-second launch video" --visual-style "Swiss Pulse" --json
218
+ vibe storyboard revise my-video --from "make the hook sharper" --dry-run --json
159
219
  # edit my-video/STORYBOARD.md, my-video/DESIGN.md
160
220
  vibe storyboard validate my-video --json
161
221
  vibe plan my-video --json
162
222
  vibe build my-video --dry-run --max-cost 5 --json
163
223
  vibe build my-video --max-cost 5 --json
224
+ vibe status project my-video --refresh --json # when build returns pending-jobs
164
225
  vibe inspect project my-video --json
165
226
  vibe render my-video -o renders/final.mp4 --json
166
227
  vibe inspect render my-video --cheap --json
167
228
  vibe inspect render my-video --ai --json
229
+
230
+ # Single-beat loop
231
+ vibe build my-video --beat hook --stage sync --json
232
+ vibe inspect project my-video --beat hook --json
233
+ vibe render my-video --beat hook --json
234
+ vibe inspect render my-video --beat hook --cheap --json
168
235
  vibe status project my-video --json
169
236
  vibe scene repair --project my-video --json
170
237
  ```
171
238
 
239
+ ### Machine status contract
240
+
241
+ `build-report.json` keeps the detailed `beats[]` array and also includes `kind:"build"`, `status`, `currentStage`, `providerResolution`, `beatSummary`, `jobs[]`, `sceneRepair`, `stageReports`, `warnings`, and `retryWith`. Each beat keeps legacy flat asset fields and nested `narration`, `backdrop`, `video`, and `music` objects with provider/path/status/sourcePath/cache metadata, plus a nested `composition` object with path/existence/status/cacheKey visibility. `render-report.json` records the latest render output, including `beat` when `vibe render --beat <id>` is used.
242
+
243
+ `vibe status job --json` emits the normal success envelope with `data.kind:"job"`, flat job fields (`id`, `jobType`, `provider`, `status`, timestamps), `progress`, `result`, `retryWith`, and the raw `job` record for compatibility.
244
+
245
+ `vibe status project --json` emits `data.kind:"project"`, `status`, `currentStage`, `beats:{total,assetsReady,compositionsReady,needsAuthor}`, `jobs.latest`, `build`, `review`, `warnings`, and `retryWith`. `review` includes `mode`, `issueCount`, `errorCount`, `warningCount`, `infoCount`, `fixOwners`, `sourceReports`, and its own `retryWith`; top-level `retryWith` carries the next resume command. Use `retryWith` rather than guessing the next command.
246
+
247
+ ### Storyboard revision contract
248
+
249
+ `vibe storyboard revise --json` emits `data.kind:"storyboard-revision"`, `provider`, `summary`, `changedBeats`, `validation`, `wrote`, `warnings`, and `retryWith`. On failure it does not write `STORYBOARD.md`; inspect `data.code`, `data.message`, and `data.retryWith`.
250
+
172
251
  ### Lower-level timeline (NLE-style)
173
252
 
174
253
  ```bash