blitzreels 0.1.4 → 0.1.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 +55 -25
- package/dist/agent-context.d.ts +68 -0
- package/dist/agent-context.d.ts.map +1 -0
- package/dist/agent-context.js +214 -0
- package/dist/agent-context.js.map +1 -0
- package/dist/cli-command-routing.d.ts +27 -0
- package/dist/cli-command-routing.d.ts.map +1 -0
- package/dist/cli-command-routing.js +236 -0
- package/dist/cli-command-routing.js.map +1 -0
- package/dist/cli-errors.d.ts +31 -0
- package/dist/cli-errors.d.ts.map +1 -0
- package/dist/cli-errors.js +27 -0
- package/dist/cli-errors.js.map +1 -0
- package/dist/cli-flag-reader.d.ts +61 -0
- package/dist/cli-flag-reader.d.ts.map +1 -0
- package/dist/cli-flag-reader.js +207 -0
- package/dist/cli-flag-reader.js.map +1 -0
- package/dist/cli-http.d.ts +6 -0
- package/dist/cli-http.d.ts.map +1 -0
- package/dist/cli-http.js +42 -0
- package/dist/cli-http.js.map +1 -0
- package/dist/cli-presenter.d.ts +24 -0
- package/dist/cli-presenter.d.ts.map +1 -0
- package/dist/cli-presenter.js +161 -0
- package/dist/cli-presenter.js.map +1 -0
- package/dist/cli-runtime.d.ts +1 -2
- package/dist/cli-runtime.d.ts.map +1 -1
- package/dist/cli-runtime.js +2 -2
- package/dist/cli-runtime.js.map +1 -1
- package/dist/cli-timing.d.ts +4 -0
- package/dist/cli-timing.d.ts.map +1 -0
- package/dist/cli-timing.js +6 -0
- package/dist/cli-timing.js.map +1 -0
- package/dist/cli-types.d.ts +52 -0
- package/dist/cli-types.d.ts.map +1 -1
- package/dist/cli-value-parsers.d.ts +76 -0
- package/dist/cli-value-parsers.d.ts.map +1 -0
- package/dist/cli-value-parsers.js +271 -0
- package/dist/cli-value-parsers.js.map +1 -0
- package/dist/command-metadata.d.ts +11 -5
- package/dist/command-metadata.d.ts.map +1 -1
- package/dist/command-metadata.js +64 -9
- package/dist/command-metadata.js.map +1 -1
- package/dist/command-registry.d.ts +1 -1
- package/dist/command-registry.d.ts.map +1 -1
- package/dist/command-registry.js +44 -853
- package/dist/command-registry.js.map +1 -1
- package/dist/commands/ai-edit.d.ts +45 -0
- package/dist/commands/ai-edit.d.ts.map +1 -0
- package/dist/commands/ai-edit.js +370 -0
- package/dist/commands/ai-edit.js.map +1 -0
- package/dist/commands/api.d.ts +20 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +56 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/audio.d.ts +65 -0
- package/dist/commands/audio.d.ts.map +1 -0
- package/dist/commands/audio.js +264 -0
- package/dist/commands/audio.js.map +1 -0
- package/dist/commands/auth-runtime.d.ts +24 -0
- package/dist/commands/auth-runtime.d.ts.map +1 -0
- package/dist/commands/auth-runtime.js +169 -0
- package/dist/commands/auth-runtime.js.map +1 -0
- package/dist/commands/auth.d.ts +26 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +59 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/caption-command-types.d.ts +66 -0
- package/dist/commands/caption-command-types.d.ts.map +1 -0
- package/dist/commands/caption-command-types.js +2 -0
- package/dist/commands/caption-command-types.js.map +1 -0
- package/dist/commands/caption-dry-run.d.ts +66 -0
- package/dist/commands/caption-dry-run.d.ts.map +1 -0
- package/dist/commands/caption-dry-run.js +225 -0
- package/dist/commands/caption-dry-run.js.map +1 -0
- package/dist/commands/caption-overrides.d.ts +43 -0
- package/dist/commands/caption-overrides.d.ts.map +1 -0
- package/dist/commands/caption-overrides.js +245 -0
- package/dist/commands/caption-overrides.js.map +1 -0
- package/dist/commands/caption-selection.d.ts +72 -0
- package/dist/commands/caption-selection.d.ts.map +1 -0
- package/dist/commands/caption-selection.js +89 -0
- package/dist/commands/caption-selection.js.map +1 -0
- package/dist/commands/caption-style-commands.d.ts +3 -0
- package/dist/commands/caption-style-commands.d.ts.map +1 -0
- package/dist/commands/caption-style-commands.js +240 -0
- package/dist/commands/caption-style-commands.js.map +1 -0
- package/dist/commands/caption-style-flags.d.ts +30 -0
- package/dist/commands/caption-style-flags.d.ts.map +1 -0
- package/dist/commands/caption-style-flags.js +257 -0
- package/dist/commands/caption-style-flags.js.map +1 -0
- package/dist/commands/caption-text-updates.d.ts +21 -0
- package/dist/commands/caption-text-updates.d.ts.map +1 -0
- package/dist/commands/caption-text-updates.js +23 -0
- package/dist/commands/caption-text-updates.js.map +1 -0
- package/dist/commands/captions-specs.d.ts +3 -0
- package/dist/commands/captions-specs.d.ts.map +1 -0
- package/dist/commands/captions-specs.js +241 -0
- package/dist/commands/captions-specs.js.map +1 -0
- package/dist/commands/captions.d.ts +7 -0
- package/dist/commands/captions.d.ts.map +1 -0
- package/dist/commands/captions.js +203 -0
- package/dist/commands/captions.js.map +1 -0
- package/dist/commands/clip-runtime.d.ts +67 -0
- package/dist/commands/clip-runtime.d.ts.map +1 -0
- package/dist/commands/clip-runtime.js +194 -0
- package/dist/commands/clip-runtime.js.map +1 -0
- package/dist/commands/clips.d.ts +66 -0
- package/dist/commands/clips.d.ts.map +1 -0
- package/dist/commands/clips.js +625 -0
- package/dist/commands/clips.js.map +1 -0
- package/dist/commands/command-operation.d.ts +26 -0
- package/dist/commands/command-operation.d.ts.map +1 -0
- package/dist/commands/command-operation.js +18 -0
- package/dist/commands/command-operation.js.map +1 -0
- package/dist/commands/editing-workflow-runtime.d.ts +42 -0
- package/dist/commands/editing-workflow-runtime.d.ts.map +1 -0
- package/dist/commands/editing-workflow-runtime.js +128 -0
- package/dist/commands/editing-workflow-runtime.js.map +1 -0
- package/dist/commands/editing-workflows.d.ts +70 -0
- package/dist/commands/editing-workflows.d.ts.map +1 -0
- package/dist/commands/editing-workflows.js +252 -0
- package/dist/commands/editing-workflows.js.map +1 -0
- package/dist/commands/effects-runtime.d.ts +64 -0
- package/dist/commands/effects-runtime.d.ts.map +1 -0
- package/dist/commands/effects-runtime.js +100 -0
- package/dist/commands/effects-runtime.js.map +1 -0
- package/dist/commands/effects.d.ts +69 -0
- package/dist/commands/effects.d.ts.map +1 -0
- package/dist/commands/effects.js +281 -0
- package/dist/commands/effects.js.map +1 -0
- package/dist/commands/exports.d.ts +16 -5
- package/dist/commands/exports.d.ts.map +1 -1
- package/dist/commands/exports.js +119 -2
- package/dist/commands/exports.js.map +1 -1
- package/dist/commands/faceless.d.ts +44 -0
- package/dist/commands/faceless.d.ts.map +1 -0
- package/dist/commands/faceless.js +587 -0
- package/dist/commands/faceless.js.map +1 -0
- package/dist/commands/formats.d.ts +41 -0
- package/dist/commands/formats.d.ts.map +1 -0
- package/dist/commands/formats.js +140 -0
- package/dist/commands/formats.js.map +1 -0
- package/dist/commands/jobs.d.ts +20 -0
- package/dist/commands/jobs.d.ts.map +1 -0
- package/dist/commands/jobs.js +40 -0
- package/dist/commands/jobs.js.map +1 -0
- package/dist/commands/media-assets.d.ts +100 -0
- package/dist/commands/media-assets.d.ts.map +1 -0
- package/dist/commands/media-assets.js +644 -0
- package/dist/commands/media-assets.js.map +1 -0
- package/dist/commands/media-overlays.d.ts +52 -0
- package/dist/commands/media-overlays.d.ts.map +1 -0
- package/dist/commands/media-overlays.js +314 -0
- package/dist/commands/media-overlays.js.map +1 -0
- package/dist/commands/media-runtime.d.ts +61 -0
- package/dist/commands/media-runtime.d.ts.map +1 -0
- package/dist/commands/media-runtime.js +239 -0
- package/dist/commands/media-runtime.js.map +1 -0
- package/dist/commands/onboarding.d.ts +51 -0
- package/dist/commands/onboarding.d.ts.map +1 -0
- package/dist/commands/onboarding.js +452 -0
- package/dist/commands/onboarding.js.map +1 -0
- package/dist/commands/project-read.d.ts +40 -0
- package/dist/commands/project-read.d.ts.map +1 -0
- package/dist/commands/project-read.js +184 -0
- package/dist/commands/project-read.js.map +1 -0
- package/dist/commands/projects.d.ts +16 -5
- package/dist/commands/projects.d.ts.map +1 -1
- package/dist/commands/projects.js +139 -2
- package/dist/commands/projects.js.map +1 -1
- package/dist/commands/stock-library.d.ts +72 -0
- package/dist/commands/stock-library.d.ts.map +1 -0
- package/dist/commands/stock-library.js +175 -0
- package/dist/commands/stock-library.js.map +1 -0
- package/dist/commands/system.d.ts +16 -0
- package/dist/commands/system.d.ts.map +1 -0
- package/dist/commands/system.js +147 -0
- package/dist/commands/system.js.map +1 -0
- package/dist/commands/text-overlay-spec.d.ts +24 -0
- package/dist/commands/text-overlay-spec.d.ts.map +1 -0
- package/dist/commands/text-overlay-spec.js +228 -0
- package/dist/commands/text-overlay-spec.js.map +1 -0
- package/dist/commands/text-overlays.d.ts +67 -0
- package/dist/commands/text-overlays.d.ts.map +1 -0
- package/dist/commands/text-overlays.js +272 -0
- package/dist/commands/text-overlays.js.map +1 -0
- package/dist/commands/timeline-runtime.d.ts +105 -0
- package/dist/commands/timeline-runtime.d.ts.map +1 -0
- package/dist/commands/timeline-runtime.js +508 -0
- package/dist/commands/timeline-runtime.js.map +1 -0
- package/dist/commands/timeline.d.ts +120 -0
- package/dist/commands/timeline.d.ts.map +1 -0
- package/dist/commands/timeline.js +621 -0
- package/dist/commands/timeline.js.map +1 -0
- package/dist/commands/workspace-defaults.d.ts +12 -0
- package/dist/commands/workspace-defaults.d.ts.map +1 -0
- package/dist/commands/workspace-defaults.js +115 -0
- package/dist/commands/workspace-defaults.js.map +1 -0
- package/dist/commands/workspace.d.ts +50 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +116 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/index.js +485 -5035
- package/dist/index.js.map +1 -1
- package/dist/preview-first-edit.d.ts +9 -1
- package/dist/preview-first-edit.d.ts.map +1 -1
- package/dist/preview-first-edit.js +16 -4
- package/dist/preview-first-edit.js.map +1 -1
- package/dist/update-notifier.d.ts +43 -0
- package/dist/update-notifier.d.ts.map +1 -0
- package/dist/update-notifier.js +265 -0
- package/dist/update-notifier.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -16,7 +16,6 @@ After the first real publish:
|
|
|
16
16
|
```bash
|
|
17
17
|
npx blitzreels version
|
|
18
18
|
npx blitzreels doctor
|
|
19
|
-
npx blitzreels prime
|
|
20
19
|
npx blitzreels agent-context --json
|
|
21
20
|
npx blitzreels auth login
|
|
22
21
|
```
|
|
@@ -35,8 +34,9 @@ blitzreels auth set-key --api-key br_live_...
|
|
|
35
34
|
blitzreels auth whoami
|
|
36
35
|
```
|
|
37
36
|
|
|
38
|
-
`auth login` opens BlitzReels in your browser,
|
|
39
|
-
|
|
37
|
+
`auth login` opens BlitzReels in your browser, shows the one-time CLI code, and
|
|
38
|
+
waits for you to click `Connect CLI`. After confirmation, it stores the
|
|
39
|
+
generated API key in macOS Keychain when available or
|
|
40
40
|
`~/.blitzreels/config.json` as a fallback. Use `--no-browser` on remote shells
|
|
41
41
|
and open the printed URL manually.
|
|
42
42
|
|
|
@@ -51,6 +51,13 @@ API keys are environment-bounded:
|
|
|
51
51
|
blitzreels workspace settings get --json
|
|
52
52
|
blitzreels workspace settings update --name "Creator Studio" --protected-words "Brand,Product"
|
|
53
53
|
|
|
54
|
+
blitzreels onboarding scan start --website-url "https://example.com" --json
|
|
55
|
+
blitzreels onboarding scan get --run-id RUN_ID --json
|
|
56
|
+
blitzreels onboarding profile get --json
|
|
57
|
+
blitzreels onboarding profile update --brand-name "Creator Studio" --protected-words "Brand,Product"
|
|
58
|
+
blitzreels onboarding logo import --profile-id PROFILE_ID --replace-existing false
|
|
59
|
+
blitzreels onboarding complete --brand-name "Creator Studio" --platforms tiktok,linkedin --save-workspace-icon true --json
|
|
60
|
+
|
|
54
61
|
blitzreels projects list --status active --json
|
|
55
62
|
blitzreels projects create --name "Launch short" --aspect-ratio 9:16
|
|
56
63
|
blitzreels projects get --project-id PROJECT_ID --json
|
|
@@ -67,6 +74,7 @@ blitzreels media rename --asset-id ASSET_ID --name "New media name"
|
|
|
67
74
|
blitzreels media update --asset-id ASSET_ID --description "B-roll" --folder-id FOLDER_ID
|
|
68
75
|
blitzreels media move --asset-id ASSET_ID --target-folder-id FOLDER_ID
|
|
69
76
|
blitzreels media attach --project-id PROJECT_ID --asset-id ASSET_ID --at 0 --duration 4
|
|
77
|
+
blitzreels media attach --project-id PROJECT_ID --asset-id ASSET_ID --at 0 --duration 4 --placement-intent overlay
|
|
70
78
|
blitzreels media attach --project-id PROJECT_ID --asset-id IMAGE_ID --at 6 --duration 1.6 --position-preset center --position-y -230 --width-px 561 --height-px 212 --animation-preset popIn
|
|
71
79
|
blitzreels media folders list --json
|
|
72
80
|
blitzreels media folders create --name "B-roll" --icon-type video
|
|
@@ -74,13 +82,15 @@ blitzreels media folders rename --folder-id FOLDER_ID --name "New folder name"
|
|
|
74
82
|
blitzreels media folders update --folder-id FOLDER_ID --parent-folder-id root
|
|
75
83
|
blitzreels media folders delete --folder-id FOLDER_ID --confirm-delete
|
|
76
84
|
|
|
77
|
-
blitzreels clips create --
|
|
78
|
-
blitzreels clips create --
|
|
85
|
+
blitzreels clips create --asset-id ASSET_ID --output ./clips
|
|
86
|
+
blitzreels clips create --asset-id ASSET_ID --logo-asset-id LOGO_ASSET_ID --output ./clips --count 5
|
|
87
|
+
blitzreels clips create --youtube-url "https://www.youtube.com/watch?v=..." --name "MKBHD hero loop"
|
|
79
88
|
blitzreels clips get --clip-id CLIP_ID --json
|
|
80
89
|
blitzreels clips wait --clip-id CLIP_ID --json
|
|
81
|
-
blitzreels clips reselect --clip-id CLIP_ID --
|
|
82
|
-
blitzreels clips
|
|
83
|
-
blitzreels clips
|
|
90
|
+
blitzreels clips reselect --clip-id CLIP_ID --start-seconds 52 --end-seconds 64
|
|
91
|
+
blitzreels clips reselect --clip-id CLIP_ID --suggestion-id SUGGESTION_ID
|
|
92
|
+
blitzreels clips repair --clip-id CLIP_ID
|
|
93
|
+
blitzreels clips export --clip-id CLIP_ID
|
|
84
94
|
|
|
85
95
|
blitzreels project inspect --project-id PROJECT_ID --json
|
|
86
96
|
blitzreels project timeline --project-id PROJECT_ID --json
|
|
@@ -103,13 +113,16 @@ blitzreels text update --project-id PROJECT_ID --content-item-id CONTENT_ITEM_ID
|
|
|
103
113
|
blitzreels text remove --project-id PROJECT_ID --content-item-id CONTENT_ITEM_ID
|
|
104
114
|
|
|
105
115
|
blitzreels audio search --query "ambient riser" --license cc0 --json
|
|
106
|
-
blitzreels audio import --provider openverse --external-id AUDIO_ID --project-id PROJECT_ID --at 0 --duration 12 --volume 0.
|
|
107
|
-
blitzreels audio add --project-id PROJECT_ID --asset-id ASSET_ID --at 0 --volume 0.
|
|
116
|
+
blitzreels audio import --provider openverse --external-id AUDIO_ID --project-id PROJECT_ID --at 0 --duration 12 --volume 0.03
|
|
117
|
+
blitzreels audio add --project-id PROJECT_ID --asset-id ASSET_ID --at 0 --volume 0.03
|
|
108
118
|
|
|
109
119
|
blitzreels captions words list --project-id PROJECT_ID --match-text "Supabase" --json
|
|
110
120
|
blitzreels captions words text --project-id PROJECT_ID --word-id WORD_ID --text "Supabase"
|
|
121
|
+
blitzreels captions words update --project-id PROJECT_ID --word-id WORD_ID --text "Supabase"
|
|
111
122
|
blitzreels captions words batch-text --project-id PROJECT_ID --updates-json '[{"word_id":"WORD_ID","new_text":"Supabase"}]'
|
|
123
|
+
blitzreels captions words batch-text --project-id PROJECT_ID --updates-file caption-updates.json
|
|
112
124
|
blitzreels captions words style --project-id PROJECT_ID --word-id WORD_ID --font-family Pacifico --color "#17FFA6" --scale 1.45
|
|
125
|
+
blitzreels captions words style --project-id PROJECT_ID --all --style-file caption-word-style.json
|
|
113
126
|
blitzreels captions words emphasis --project-id PROJECT_ID --match-text "MCP" --emphasis true
|
|
114
127
|
blitzreels captions words delete --project-id PROJECT_ID --word-id WORD_ID
|
|
115
128
|
blitzreels captions words merge --project-id PROJECT_ID --word-ids WORD_ID_1,WORD_ID_2 --text "serveurs MCP"
|
|
@@ -121,42 +134,56 @@ blitzreels silence apply --project-id PROJECT_ID --timeline-item-id TIMELINE_ITE
|
|
|
121
134
|
blitzreels mistakes plan --project-id PROJECT_ID --timeline-item-id TIMELINE_ITEM_ID --json
|
|
122
135
|
blitzreels mistakes apply --project-id PROJECT_ID --timeline-item-id TIMELINE_ITEM_ID --confirm-preview
|
|
123
136
|
|
|
124
|
-
blitzreels captions
|
|
125
|
-
blitzreels captions
|
|
126
|
-
blitzreels captions
|
|
137
|
+
blitzreels captions looks list --json
|
|
138
|
+
blitzreels captions look set --project-id PROJECT_ID --look-id editor-premium-lime
|
|
139
|
+
blitzreels captions style update --project-id PROJECT_ID --look-id paper-karaoke --text-stroke-enabled false
|
|
127
140
|
|
|
128
|
-
blitzreels exports start --project-id PROJECT_ID
|
|
141
|
+
blitzreels exports start --project-id PROJECT_ID --cover-frame-seconds 1
|
|
129
142
|
blitzreels exports wait --export-id EXPORT_ID
|
|
130
143
|
blitzreels exports download --export-id EXPORT_ID --output ./short.mp4
|
|
131
144
|
|
|
145
|
+
blitzreels formats run --format video-model-benchmark \
|
|
146
|
+
--prompt "A red figure walks toward a circular platform under a deep blue night sky" \
|
|
147
|
+
--left-model wan-2.1 --right-model krea-wan-14b-t2v --confirm-cost
|
|
148
|
+
blitzreels jobs get --job-id JOB_ID --json
|
|
149
|
+
|
|
132
150
|
blitzreels api docs
|
|
133
151
|
blitzreels api spec
|
|
134
152
|
```
|
|
135
153
|
|
|
136
154
|
Use `--json` for script and AI-agent workflows.
|
|
137
155
|
Use `--fields id,name` with `--json` to trim large responses.
|
|
156
|
+
Export status responses include `thumbnail_url`, `thumbnail.frame_seconds`, `thumbnail.rationale`, and first-pass `platform_metadata` suggestions for YouTube, TikTok, and Instagram.
|
|
157
|
+
Onboarding scan responses include `run_id`, `status`, optional `profile`, and `next_actions`; poll the run before completing onboarding. Mutating onboarding commands support `--dry-run`.
|
|
138
158
|
|
|
139
|
-
##
|
|
159
|
+
## Machine-Readable Contract
|
|
140
160
|
|
|
141
161
|
```bash
|
|
142
|
-
blitzreels prime
|
|
143
|
-
blitzreels prime --command "media attach"
|
|
144
162
|
blitzreels agent-context --json
|
|
145
163
|
blitzreels agent-context --command "media attach" --json
|
|
164
|
+
blitzreels agent-context --full --json
|
|
146
165
|
blitzreels schema --command "captions words style" --json
|
|
147
166
|
blitzreels media attach --project-id PROJECT_ID --asset-id ASSET_ID --at 6 --dry-run
|
|
148
167
|
```
|
|
149
168
|
|
|
150
|
-
`
|
|
151
|
-
|
|
152
|
-
|
|
169
|
+
`agent-context --json` is the compact machine-readable command index. It lists
|
|
170
|
+
stable operation IDs and command names, plus write and destructive operation ID
|
|
171
|
+
sets. Use `--command` for one detailed contract with typed flags, defaults,
|
|
172
|
+
examples, safety markers, and known errors. Use `--full` only for compatibility
|
|
173
|
+
or bulk tooling that explicitly needs every detailed command contract.
|
|
153
174
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
and known error categories.
|
|
175
|
+
Agent workflow strategy lives in BlitzReels skills and docs, not in CLI command
|
|
176
|
+
metadata or normal command output.
|
|
157
177
|
|
|
158
|
-
|
|
159
|
-
|
|
178
|
+
Retry project, clip-batch, and export creation safely with a stable key:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
blitzreels projects create --name "Launch clips" --idempotency-key project:launch-clips:v1
|
|
182
|
+
blitzreels clips create --asset-id ASSET_ID --idempotency-key clips:ASSET_ID:v1
|
|
183
|
+
blitzreels exports start --project-id PROJECT_ID --idempotency-key export:PROJECT_ID:1080p:v1
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Reuse a key only with identical inputs. A changed request returns a conflict.
|
|
160
187
|
|
|
161
188
|
`--dry-run` is available on mutating commands and prints the API request that
|
|
162
189
|
would be made without making the write request. Destructive dry-runs still require
|
|
@@ -202,5 +229,8 @@ With `--json`, errors are structured on stderr:
|
|
|
202
229
|
}
|
|
203
230
|
```
|
|
204
231
|
|
|
232
|
+
Plan-limit failures use `upgrade_required`, exit code `3`, and include an
|
|
233
|
+
`upgrade_url`. Human output prints the same billing link after the error.
|
|
234
|
+
|
|
205
235
|
Use `blitzreels <command> --help` for command-specific flags without requiring
|
|
206
236
|
auth.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type SequenceOperationId } from "@blitzreels/sdk";
|
|
2
|
+
import { type CliExitCode } from "./cli-errors.js";
|
|
3
|
+
import type { CommandSpec, FlagSpec } from "./command-metadata.js";
|
|
4
|
+
export type AgentContext = {
|
|
5
|
+
schema_version: "1";
|
|
6
|
+
cli: {
|
|
7
|
+
name: "blitzreels";
|
|
8
|
+
version: string;
|
|
9
|
+
default_base_url: string;
|
|
10
|
+
exit_codes: Array<{
|
|
11
|
+
code: CliExitCode;
|
|
12
|
+
meaning: string;
|
|
13
|
+
retryable: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
sequence_error_codes: string[];
|
|
17
|
+
sequence_error_contract: "/api/capabilities.json#error_contract";
|
|
18
|
+
commands: Array<{
|
|
19
|
+
operation_id: string;
|
|
20
|
+
command: string;
|
|
21
|
+
category: string;
|
|
22
|
+
description: string;
|
|
23
|
+
usage: string;
|
|
24
|
+
mutates: boolean;
|
|
25
|
+
destructive: boolean;
|
|
26
|
+
requires_auth: boolean;
|
|
27
|
+
dry_run_supported: boolean;
|
|
28
|
+
kernel_operation_ids: readonly SequenceOperationId[];
|
|
29
|
+
flags: readonly FlagSpec[];
|
|
30
|
+
examples: readonly string[];
|
|
31
|
+
errors: Array<{
|
|
32
|
+
code: string;
|
|
33
|
+
description: string;
|
|
34
|
+
exit_code: CliExitCode;
|
|
35
|
+
retryable: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
export type AgentContextIndex = {
|
|
40
|
+
schema_version: "2";
|
|
41
|
+
mode: "index";
|
|
42
|
+
cli: {
|
|
43
|
+
name: "blitzreels";
|
|
44
|
+
version: string;
|
|
45
|
+
};
|
|
46
|
+
command_count: number;
|
|
47
|
+
detail_command: string;
|
|
48
|
+
full_command: string;
|
|
49
|
+
write_operation_ids: string[];
|
|
50
|
+
destructive_operation_ids: string[];
|
|
51
|
+
commands: Array<{
|
|
52
|
+
operation_id: string;
|
|
53
|
+
command: string;
|
|
54
|
+
}>;
|
|
55
|
+
};
|
|
56
|
+
export type AgentContextResult = AgentContext | AgentContextIndex;
|
|
57
|
+
export declare function buildAgentContextIndex({ commandSpecs, }: {
|
|
58
|
+
commandSpecs: CommandSpec[];
|
|
59
|
+
}): AgentContextIndex;
|
|
60
|
+
export declare function buildAgentContext({ commandFilter, commandSpecs, surfaceName, }: {
|
|
61
|
+
commandFilter: string | undefined;
|
|
62
|
+
commandSpecs: CommandSpec[];
|
|
63
|
+
surfaceName?: string;
|
|
64
|
+
}): AgentContext;
|
|
65
|
+
export declare function buildAgentContextLines({ value, }: {
|
|
66
|
+
value: AgentContextResult;
|
|
67
|
+
}): string[];
|
|
68
|
+
//# sourceMappingURL=agent-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-context.d.ts","sourceRoot":"","sources":["../src/agent-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,WAAW,EAAiB,MAAM,iBAAiB,CAAC;AAElE,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQnE,MAAM,MAAM,YAAY,GAAG;IACzB,cAAc,EAAE,GAAG,CAAC;IACpB,GAAG,EAAE;QACH,IAAI,EAAE,YAAY,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,gBAAgB,EAAE,MAAM,CAAC;QACzB,UAAU,EAAE,KAAK,CAAC;YAChB,IAAI,EAAE,WAAW,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,SAAS,EAAE,OAAO,CAAC;SACpB,CAAC,CAAC;KACJ,CAAC;IACF,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,uBAAuB,EAAE,uCAAuC,CAAC;IACjE,QAAQ,EAAE,KAAK,CA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GAAG,iBAAiB,CA6BpB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,aAAa,EACb,YAAY,EACZ,WAA6B,GAC9B,EAAE;IACD,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,YAAY,CA+Cf;AAED,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,GACN,EAAE;IACD,KAAK,EAAE,kBAAkB,CAAC;CAC3B,GAAG,MAAM,EAAE,CAaX"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { SEQUENCE_OPERATION_ERROR_DEFINITIONS, } from "@blitzreels/sdk";
|
|
2
|
+
import { CliUsageError } from "./cli-errors.js";
|
|
3
|
+
import { CLI_VERSION, DEFAULT_BASE_URL } from "./cli-runtime.js";
|
|
4
|
+
import { commandLabel, commandsEqual, flagsForCommand, suggestCommandSpecs, } from "./command-metadata.js";
|
|
5
|
+
export function buildAgentContextIndex({ commandSpecs, }) {
|
|
6
|
+
const operations = commandSpecs.map((spec) => ({
|
|
7
|
+
operation_id: operationIdForCommand({ command: spec.command }),
|
|
8
|
+
command: commandLabel({ command: spec.command }),
|
|
9
|
+
mutates: spec.mutates,
|
|
10
|
+
destructive: spec.destructive,
|
|
11
|
+
}));
|
|
12
|
+
return {
|
|
13
|
+
schema_version: "2",
|
|
14
|
+
mode: "index",
|
|
15
|
+
cli: {
|
|
16
|
+
name: "blitzreels",
|
|
17
|
+
version: CLI_VERSION,
|
|
18
|
+
},
|
|
19
|
+
command_count: operations.length,
|
|
20
|
+
detail_command: 'blitzreels agent-context --command "COMMAND" --json',
|
|
21
|
+
full_command: "blitzreels agent-context --full --json",
|
|
22
|
+
write_operation_ids: operations
|
|
23
|
+
.filter((operation) => operation.mutates)
|
|
24
|
+
.map((operation) => operation.operation_id),
|
|
25
|
+
destructive_operation_ids: operations
|
|
26
|
+
.filter((operation) => operation.destructive)
|
|
27
|
+
.map((operation) => operation.operation_id),
|
|
28
|
+
commands: operations.map((operation) => ({
|
|
29
|
+
operation_id: operation.operation_id,
|
|
30
|
+
command: operation.command,
|
|
31
|
+
})),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function buildAgentContext({ commandFilter, commandSpecs, surfaceName = "agent-context", }) {
|
|
35
|
+
const commands = commandFilter
|
|
36
|
+
? commandSpecs.filter((spec) => commandsEqual(spec.command, splitCommandFilter({ value: commandFilter })))
|
|
37
|
+
: commandSpecs;
|
|
38
|
+
if (commandFilter && commands.length === 0) {
|
|
39
|
+
throw new CliUsageError({
|
|
40
|
+
code: "unknown_command",
|
|
41
|
+
message: `Unknown command for ${surfaceName}: ${commandFilter}`,
|
|
42
|
+
suggestions: suggestCommandSpecs({
|
|
43
|
+
command: splitCommandFilter({ value: commandFilter }),
|
|
44
|
+
specs: commandSpecs,
|
|
45
|
+
}).map((spec) => commandLabel({ command: spec.command })),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
schema_version: "1",
|
|
50
|
+
cli: {
|
|
51
|
+
name: "blitzreels",
|
|
52
|
+
version: CLI_VERSION,
|
|
53
|
+
default_base_url: DEFAULT_BASE_URL,
|
|
54
|
+
exit_codes: buildCliExitCodeContract(),
|
|
55
|
+
},
|
|
56
|
+
sequence_error_codes: SEQUENCE_OPERATION_ERROR_DEFINITIONS.map((definition) => definition.code),
|
|
57
|
+
sequence_error_contract: "/api/capabilities.json#error_contract",
|
|
58
|
+
commands: commands.map((spec) => ({
|
|
59
|
+
operation_id: operationIdForCommand({ command: spec.command }),
|
|
60
|
+
command: commandLabel({ command: spec.command }),
|
|
61
|
+
category: spec.command[0] ?? "unknown",
|
|
62
|
+
description: spec.description,
|
|
63
|
+
usage: spec.usage,
|
|
64
|
+
mutates: spec.mutates,
|
|
65
|
+
destructive: spec.destructive,
|
|
66
|
+
requires_auth: spec.requiresAuth,
|
|
67
|
+
dry_run_supported: spec.dryRunSupported,
|
|
68
|
+
kernel_operation_ids: spec.kernelOperationIds,
|
|
69
|
+
flags: flagsForCommand({ spec, includeHidden: true }),
|
|
70
|
+
examples: spec.examples,
|
|
71
|
+
errors: buildCommandErrors({ spec }),
|
|
72
|
+
})),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function buildAgentContextLines({ value, }) {
|
|
76
|
+
if (value.schema_version === "2") {
|
|
77
|
+
const writeOperations = new Set(value.write_operation_ids);
|
|
78
|
+
const destructiveOperations = new Set(value.destructive_operation_ids);
|
|
79
|
+
return value.commands.map((command) => `${command.command} ${writeOperations.has(command.operation_id) ? "write" : "read"}${destructiveOperations.has(command.operation_id) ? " destructive" : ""}`);
|
|
80
|
+
}
|
|
81
|
+
return value.commands.map((command) => `${command.command} ${command.mutates ? "write" : "read"}${command.destructive ? " destructive" : ""}${command.dry_run_supported ? " dry-run" : ""} - ${command.description}`);
|
|
82
|
+
}
|
|
83
|
+
function splitCommandFilter({ value }) {
|
|
84
|
+
return value
|
|
85
|
+
.trim()
|
|
86
|
+
.split(/\s+/)
|
|
87
|
+
.filter((part) => part.length > 0);
|
|
88
|
+
}
|
|
89
|
+
function buildCommandErrors({ spec }) {
|
|
90
|
+
const errors = [
|
|
91
|
+
{
|
|
92
|
+
code: "unknown_command",
|
|
93
|
+
description: "Command is not registered.",
|
|
94
|
+
exit_code: 2,
|
|
95
|
+
retryable: false,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
code: "unknown_flag",
|
|
99
|
+
description: "Flag is not accepted by command.",
|
|
100
|
+
exit_code: 2,
|
|
101
|
+
retryable: false,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
code: "missing_required_flag",
|
|
105
|
+
description: "A required flag was not provided.",
|
|
106
|
+
exit_code: 2,
|
|
107
|
+
retryable: false,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
code: "invalid_flag_value",
|
|
111
|
+
description: "A flag value could not be parsed.",
|
|
112
|
+
exit_code: 2,
|
|
113
|
+
retryable: false,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
code: "cli_error",
|
|
117
|
+
description: "Input or local execution failed.",
|
|
118
|
+
exit_code: 1,
|
|
119
|
+
retryable: false,
|
|
120
|
+
},
|
|
121
|
+
];
|
|
122
|
+
if (spec.requiresAuth) {
|
|
123
|
+
errors.push({
|
|
124
|
+
code: "api_error",
|
|
125
|
+
description: "BlitzReels API returned a non-2xx response.",
|
|
126
|
+
exit_code: 1,
|
|
127
|
+
retryable: false,
|
|
128
|
+
});
|
|
129
|
+
errors.push({
|
|
130
|
+
code: "auth_error",
|
|
131
|
+
description: "Authentication or permission failed.",
|
|
132
|
+
exit_code: 3,
|
|
133
|
+
retryable: false,
|
|
134
|
+
});
|
|
135
|
+
errors.push({
|
|
136
|
+
code: "upgrade_required",
|
|
137
|
+
description: "The workspace plan limit was reached. Open the returned upgrade_url.",
|
|
138
|
+
exit_code: 3,
|
|
139
|
+
retryable: false,
|
|
140
|
+
});
|
|
141
|
+
errors.push({
|
|
142
|
+
code: "not_found",
|
|
143
|
+
description: "Requested BlitzReels resource was not found.",
|
|
144
|
+
exit_code: 4,
|
|
145
|
+
retryable: false,
|
|
146
|
+
});
|
|
147
|
+
errors.push({
|
|
148
|
+
code: "conflict",
|
|
149
|
+
description: "Requested operation conflicted with current project state.",
|
|
150
|
+
exit_code: 5,
|
|
151
|
+
retryable: false,
|
|
152
|
+
});
|
|
153
|
+
errors.push({
|
|
154
|
+
code: "rate_limited",
|
|
155
|
+
description: "Request was rate limited.",
|
|
156
|
+
exit_code: 6,
|
|
157
|
+
retryable: true,
|
|
158
|
+
});
|
|
159
|
+
errors.push({
|
|
160
|
+
code: "server_error",
|
|
161
|
+
description: "BlitzReels API returned a transient server error.",
|
|
162
|
+
exit_code: 7,
|
|
163
|
+
retryable: true,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
if (spec.mutates && !spec.dryRunSupported) {
|
|
167
|
+
errors.push({
|
|
168
|
+
code: "unsupported_dry_run",
|
|
169
|
+
description: "--dry-run was used on a command that cannot preview.",
|
|
170
|
+
exit_code: 2,
|
|
171
|
+
retryable: false,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
if (spec.destructive) {
|
|
175
|
+
errors.push({
|
|
176
|
+
code: "missing_confirmation",
|
|
177
|
+
description: "Required destructive confirmation flag was not provided.",
|
|
178
|
+
exit_code: 2,
|
|
179
|
+
retryable: false,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
return errors;
|
|
183
|
+
}
|
|
184
|
+
function operationIdForCommand({ command }) {
|
|
185
|
+
const [first = "unknown", ...rest] = command;
|
|
186
|
+
return [
|
|
187
|
+
first,
|
|
188
|
+
...rest.map((part) => part.replace(/-([a-z0-9])/g, (_match, value) => value.toUpperCase())),
|
|
189
|
+
].join(".");
|
|
190
|
+
}
|
|
191
|
+
function buildCliExitCodeContract() {
|
|
192
|
+
return [
|
|
193
|
+
{ code: 1, meaning: "Local or generic API failure.", retryable: false },
|
|
194
|
+
{
|
|
195
|
+
code: 2,
|
|
196
|
+
meaning: "Usage error: command, flag, or input is invalid.",
|
|
197
|
+
retryable: false,
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
code: 3,
|
|
201
|
+
meaning: "Authentication or permission failure.",
|
|
202
|
+
retryable: false,
|
|
203
|
+
},
|
|
204
|
+
{ code: 4, meaning: "Requested resource was not found.", retryable: false },
|
|
205
|
+
{
|
|
206
|
+
code: 5,
|
|
207
|
+
meaning: "Conflict with current server state.",
|
|
208
|
+
retryable: false,
|
|
209
|
+
},
|
|
210
|
+
{ code: 6, meaning: "Rate limited; retry after backoff.", retryable: true },
|
|
211
|
+
{ code: 7, meaning: "Transient server/provider failure.", retryable: true },
|
|
212
|
+
];
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=agent-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-context.js","sourceRoot":"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AK,EAAE;QAC3E;YACE,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,qCAAqC;YAC9C,SAAS,EAAE,KAAK;SACjB;QACD,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,oCAAoC,EAAE,SAAS,EAAE,IAAI,EAAE;QAC3E,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,oCAAoC,EAAE,SAAS,EAAE,IAAI,EAAE;KAC5E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CliUsageError } from "./cli-errors.js";
|
|
2
|
+
import type { ParsedArgs } from "./cli-types.js";
|
|
3
|
+
import { type CommandSpec } from "./command-metadata.js";
|
|
4
|
+
export declare function parseArgs({ argv }: {
|
|
5
|
+
argv: string[];
|
|
6
|
+
}): ParsedArgs;
|
|
7
|
+
export declare function validateParsedArgs({ parsed }: {
|
|
8
|
+
parsed: ParsedArgs;
|
|
9
|
+
}): void;
|
|
10
|
+
export declare function validateSafeInputs({ parsed }: {
|
|
11
|
+
parsed: ParsedArgs;
|
|
12
|
+
}): void;
|
|
13
|
+
export declare function findCommandSpec({ command, }: {
|
|
14
|
+
command: string[];
|
|
15
|
+
}): CommandSpec | undefined;
|
|
16
|
+
export declare function findGroupCommandSpecs({ command, }: {
|
|
17
|
+
command: string[];
|
|
18
|
+
}): CommandSpec[];
|
|
19
|
+
export declare function printCommandOrGroupHelpOrThrow({ command, }: {
|
|
20
|
+
command: string[];
|
|
21
|
+
}): void;
|
|
22
|
+
export declare function printHelp(): void;
|
|
23
|
+
export declare function buildUnknownCommandError({ command, }: {
|
|
24
|
+
command: string[];
|
|
25
|
+
}): CliUsageError;
|
|
26
|
+
export declare function usageForCurrentCommand(): string | undefined;
|
|
27
|
+
//# sourceMappingURL=cli-command-routing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-command-routing.d.ts","sourceRoot":"","sources":["../src/cli-command-routing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAS,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EACL,KAAK,WAAW,EAOjB,MAAM,uBAAuB,CAAC;AAG/B,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,UAAU,CAiClE;AAED,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,GAAG,IAAI,CAwB3E;AAED,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,GAAG,IAAI,CAgB3E;AAED,wBAAgB,eAAe,CAAC,EAC9B,OAAO,GACR,EAAE;IACD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,GAAG,WAAW,GAAG,SAAS,CAE1B;AAED,wBAAgB,qBAAqB,CAAC,EACpC,OAAO,GACR,EAAE;IACD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,GAAG,WAAW,EAAE,CAOhB;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,OAAO,GACR,EAAE;IACD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,GAAG,IAAI,CAYP;AAED,wBAAgB,SAAS,IAAI,IAAI,CAWhC;AAED,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,GACR,EAAE;IACD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,GAAG,aAAa,CAQhB;AAED,wBAAgB,sBAAsB,IAAI,MAAM,GAAG,SAAS,CAG3D"}
|