@mevdragon/vidfarm-devcli 0.2.14 → 0.3.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.
- package/README.md +11 -4
- package/SKILL.director.md +97 -0
- package/SKILL.platform.md +66 -6
- package/dist/src/cli.js +135 -1527
- package/package.json +5 -24
- package/.env.example +0 -60
- package/auto-create-hyperframe-templates/AUTO_CREATE_HYPERFRAME_TEMPLATES.md +0 -275
- package/auto-create-hyperframe-templates/extractor-system-prompt.md +0 -128
- package/auto-create-hyperframe-templates/input-manifest.schema.json +0 -56
- package/auto-create-hyperframe-templates/lambda-memory-estimator.md +0 -118
- package/auto-create-hyperframe-templates/production-graph.schema.json +0 -314
- package/auto-create-hyperframe-templates/runbook.md +0 -198
- package/auto-create-hyperframe-templates/scripts/create-hyperframe-template.mjs +0 -368
- package/auto-create-hyperframe-templates/template-plan.schema.json +0 -311
- package/auto-create-hyperframe-templates/template-planner-prompt.md +0 -144
- package/auto-create-templates/AUTO_CREATE_TEMPLATES.md +0 -599
- package/auto-create-templates/extractor-system-prompt.md +0 -119
- package/auto-create-templates/production-graph.schema.json +0 -276
- package/auto-create-templates/runbook.md +0 -140
- package/auto-create-templates/template-plan.schema.json +0 -301
- package/auto-create-templates/template-planner-prompt.md +0 -137
- package/dist/src/account-pages-legacy.js +0 -9338
- package/dist/src/account-pages-legacy.js.map +0 -1
- package/dist/src/account-pages.js +0 -52
- package/dist/src/account-pages.js.map +0 -1
- package/dist/src/app.js +0 -13711
- package/dist/src/app.js.map +0 -1
- package/dist/src/cli.js.map +0 -1
- package/dist/src/composition-runtime.js +0 -581
- package/dist/src/composition-runtime.js.map +0 -1
- package/dist/src/config.js +0 -140
- package/dist/src/config.js.map +0 -1
- package/dist/src/context.js +0 -492
- package/dist/src/context.js.map +0 -1
- package/dist/src/dev-app-legacy.js +0 -694
- package/dist/src/dev-app-legacy.js.map +0 -1
- package/dist/src/dev-app.js +0 -6
- package/dist/src/dev-app.js.map +0 -1
- package/dist/src/dev-serve.js.map +0 -1
- package/dist/src/domain.js +0 -2
- package/dist/src/domain.js.map +0 -1
- package/dist/src/editor-chat-history.js +0 -82
- package/dist/src/editor-chat-history.js.map +0 -1
- package/dist/src/editor-chat.js +0 -312
- package/dist/src/editor-chat.js.map +0 -1
- package/dist/src/editor-dark-theme.js +0 -1128
- package/dist/src/editor-dark-theme.js.map +0 -1
- package/dist/src/frontend/flockposter-cache-store.js +0 -124
- package/dist/src/frontend/flockposter-cache-store.js.map +0 -1
- package/dist/src/frontend/homepage-client.js +0 -117
- package/dist/src/frontend/homepage-client.js.map +0 -1
- package/dist/src/frontend/homepage-shared.js +0 -4
- package/dist/src/frontend/homepage-shared.js.map +0 -1
- package/dist/src/frontend/homepage-store.js +0 -28
- package/dist/src/frontend/homepage-store.js.map +0 -1
- package/dist/src/frontend/homepage-view.js +0 -260
- package/dist/src/frontend/homepage-view.js.map +0 -1
- package/dist/src/frontend/page-runtime-client.js +0 -124
- package/dist/src/frontend/page-runtime-client.js.map +0 -1
- package/dist/src/frontend/page-runtime-store.js +0 -9
- package/dist/src/frontend/page-runtime-store.js.map +0 -1
- package/dist/src/frontend/sentry.js +0 -42
- package/dist/src/frontend/sentry.js.map +0 -1
- package/dist/src/frontend/template-editor-chat.js +0 -3760
- package/dist/src/frontend/template-editor-chat.js.map +0 -1
- package/dist/src/help-page.js +0 -333
- package/dist/src/help-page.js.map +0 -1
- package/dist/src/homepage.js +0 -919
- package/dist/src/homepage.js.map +0 -1
- package/dist/src/hyperframes/composition.js +0 -180
- package/dist/src/hyperframes/composition.js.map +0 -1
- package/dist/src/index.js +0 -16
- package/dist/src/index.js.map +0 -1
- package/dist/src/instrument.js +0 -30
- package/dist/src/instrument.js.map +0 -1
- package/dist/src/lib/crypto.js +0 -45
- package/dist/src/lib/crypto.js.map +0 -1
- package/dist/src/lib/dev-log.js +0 -54
- package/dist/src/lib/dev-log.js.map +0 -1
- package/dist/src/lib/display-name.js +0 -11
- package/dist/src/lib/display-name.js.map +0 -1
- package/dist/src/lib/ids.js +0 -24
- package/dist/src/lib/ids.js.map +0 -1
- package/dist/src/lib/images.js +0 -19
- package/dist/src/lib/images.js.map +0 -1
- package/dist/src/lib/json.js +0 -15
- package/dist/src/lib/json.js.map +0 -1
- package/dist/src/lib/template-dna.js +0 -543
- package/dist/src/lib/template-dna.js.map +0 -1
- package/dist/src/lib/template-paths.js +0 -28
- package/dist/src/lib/template-paths.js.map +0 -1
- package/dist/src/lib/template-style-options.js +0 -203
- package/dist/src/lib/template-style-options.js.map +0 -1
- package/dist/src/lib/time.js +0 -7
- package/dist/src/lib/time.js.map +0 -1
- package/dist/src/lib/video-quality-harness.js +0 -60
- package/dist/src/lib/video-quality-harness.js.map +0 -1
- package/dist/src/page-runtime.js +0 -2
- package/dist/src/page-runtime.js.map +0 -1
- package/dist/src/page-shell.js +0 -1315
- package/dist/src/page-shell.js.map +0 -1
- package/dist/src/primitive-context.js +0 -299
- package/dist/src/primitive-context.js.map +0 -1
- package/dist/src/primitive-registry.js +0 -2181
- package/dist/src/primitive-registry.js.map +0 -1
- package/dist/src/primitive-sdk.js +0 -4
- package/dist/src/primitive-sdk.js.map +0 -1
- package/dist/src/primitives/remotion/html-image.js +0 -30
- package/dist/src/primitives/remotion/html-image.js.map +0 -1
- package/dist/src/primitives/remotion/media-slideshow.js +0 -60
- package/dist/src/primitives/remotion/media-slideshow.js.map +0 -1
- package/dist/src/react-page-shell.js +0 -35
- package/dist/src/react-page-shell.js.map +0 -1
- package/dist/src/ready-post-schedule-component.js +0 -1515
- package/dist/src/ready-post-schedule-component.js.map +0 -1
- package/dist/src/registry.js +0 -296
- package/dist/src/registry.js.map +0 -1
- package/dist/src/runtime.js +0 -31
- package/dist/src/runtime.js.map +0 -1
- package/dist/src/services/api-call-history.js +0 -249
- package/dist/src/services/api-call-history.js.map +0 -1
- package/dist/src/services/auth.js +0 -152
- package/dist/src/services/auth.js.map +0 -1
- package/dist/src/services/billing.js +0 -231
- package/dist/src/services/billing.js.map +0 -1
- package/dist/src/services/chat-threads.js +0 -92
- package/dist/src/services/chat-threads.js.map +0 -1
- package/dist/src/services/fork-access.js +0 -93
- package/dist/src/services/fork-access.js.map +0 -1
- package/dist/src/services/fork-manifest.js +0 -43
- package/dist/src/services/fork-manifest.js.map +0 -1
- package/dist/src/services/ghostcut.js +0 -132
- package/dist/src/services/ghostcut.js.map +0 -1
- package/dist/src/services/hyperframes.js +0 -1014
- package/dist/src/services/hyperframes.js.map +0 -1
- package/dist/src/services/job-capacity.js +0 -14
- package/dist/src/services/job-capacity.js.map +0 -1
- package/dist/src/services/job-logs.js +0 -197
- package/dist/src/services/job-logs.js.map +0 -1
- package/dist/src/services/jobs.js +0 -136
- package/dist/src/services/jobs.js.map +0 -1
- package/dist/src/services/media-processing.js +0 -743
- package/dist/src/services/media-processing.js.map +0 -1
- package/dist/src/services/primitive-media-lambda.js +0 -280
- package/dist/src/services/primitive-media-lambda.js.map +0 -1
- package/dist/src/services/providers.js +0 -2870
- package/dist/src/services/providers.js.map +0 -1
- package/dist/src/services/rate-limits.js +0 -237
- package/dist/src/services/rate-limits.js.map +0 -1
- package/dist/src/services/remotion.js +0 -688
- package/dist/src/services/remotion.js.map +0 -1
- package/dist/src/services/serverless-auth.js +0 -374
- package/dist/src/services/serverless-auth.js.map +0 -1
- package/dist/src/services/serverless-jobs.js +0 -1074
- package/dist/src/services/serverless-jobs.js.map +0 -1
- package/dist/src/services/serverless-provider-keys.js +0 -401
- package/dist/src/services/serverless-provider-keys.js.map +0 -1
- package/dist/src/services/serverless-records.js +0 -1088
- package/dist/src/services/serverless-records.js.map +0 -1
- package/dist/src/services/serverless-template-configs.js +0 -67
- package/dist/src/services/serverless-template-configs.js.map +0 -1
- package/dist/src/services/storage.js +0 -383
- package/dist/src/services/storage.js.map +0 -1
- package/dist/src/services/template-certification.js +0 -475
- package/dist/src/services/template-certification.js.map +0 -1
- package/dist/src/services/template-loader.js +0 -99
- package/dist/src/services/template-loader.js.map +0 -1
- package/dist/src/services/template-runtime-bundles.js +0 -217
- package/dist/src/services/template-runtime-bundles.js.map +0 -1
- package/dist/src/services/template-sources.js +0 -1017
- package/dist/src/services/template-sources.js.map +0 -1
- package/dist/src/services/video-normalization.js +0 -2
- package/dist/src/services/video-normalization.js.map +0 -1
- package/dist/src/services/webhooks.js +0 -62
- package/dist/src/services/webhooks.js.map +0 -1
- package/dist/src/template-editor-pages.js +0 -2491
- package/dist/src/template-editor-pages.js.map +0 -1
- package/dist/src/template-editor-shell.js +0 -2702
- package/dist/src/template-editor-shell.js.map +0 -1
- package/dist/src/template-sdk.js +0 -4
- package/dist/src/template-sdk.js.map +0 -1
- package/dist/src/worker.js +0 -17
- package/dist/src/worker.js.map +0 -1
- package/public/assets/homepage-app.js +0 -54
- package/public/assets/homepage-client-app.js +0 -80
- package/public/assets/page-runtime-client-app.js +0 -94
- package/readme.secret.md +0 -89
- package/templates/vidfarm_template_0000/README.md +0 -106
- package/templates/vidfarm_template_0000/SKILL.md +0 -266
- package/templates/vidfarm_template_0000/assets/Abel-Regular.ttf +0 -0
- package/templates/vidfarm_template_0000/assets/DMSerifDisplay-Regular.ttf +0 -0
- package/templates/vidfarm_template_0000/assets/Montserrat[wght].ttf +0 -0
- package/templates/vidfarm_template_0000/assets/SourceCodePro[wght].ttf +0 -0
- package/templates/vidfarm_template_0000/assets/TikTokSans-SemiBold.ttf +0 -0
- package/templates/vidfarm_template_0000/assets/Yesteryear-Regular.ttf +0 -0
- package/templates/vidfarm_template_0000/composition.json +0 -11
- package/templates/vidfarm_template_0000/src/lib/images.js +0 -221
- package/templates/vidfarm_template_0000/src/remotion/Root.js +0 -33
- package/templates/vidfarm_template_0000/src/remotion/index.js +0 -3
- package/templates/vidfarm_template_0000/src/sdk.js +0 -3
- package/templates/vidfarm_template_0000/src/style-options.js +0 -200
- package/templates/vidfarm_template_0000/src/template-dna.js +0 -9
- package/templates/vidfarm_template_0000/src/template.js +0 -1566
- package/templates/vidfarm_template_0000/template.config.json +0 -21
package/README.md
CHANGED
|
@@ -35,10 +35,17 @@ npm run cdk:deploy:prod-serverless
|
|
|
35
35
|
|
|
36
36
|
Never call bare `cdk deploy` — the npm scripts load the correct `.env.<stage>` and select the right stack.
|
|
37
37
|
|
|
38
|
-
##
|
|
38
|
+
## Local editor: `@mevdragon/vidfarm-devcli`
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
Pair a local composition directory with the hosted Trackpad Editor so an AI agent (Claude Code, Codex, etc.) or a human can edit `composition.html` on disk and see live preview in the browser.
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
```bash
|
|
43
|
+
npx -y @mevdragon/vidfarm-devcli <template_id>
|
|
44
|
+
# → downloads the current composition into .vidfarm/<template_id>/
|
|
45
|
+
# → starts dev-serve on localhost:4321
|
|
46
|
+
# → prints an https://vidfarm.cc/editor/<template_id>?fork=…&dev=… URL to open
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Flags: `--port`, `--dir`, `--host`, `--fork`, `--api-key` (or `VIDFARM_API_KEY`), `--share`, `--refetch`. Use `dev-serve` as an explicit subcommand to skip the fetch step and just serve an existing directory.
|
|
43
50
|
|
|
44
|
-
See `SKILL.platform.md` for the
|
|
51
|
+
See `SKILL.platform.md` § "Local editor dev loop" for the request-rewrite / SSE reload flow.
|
package/SKILL.director.md
CHANGED
|
@@ -118,6 +118,14 @@ The editor persists to:
|
|
|
118
118
|
|
|
119
119
|
Automation that needs to bypass the UI can call these endpoints directly.
|
|
120
120
|
|
|
121
|
+
Reads also work anonymously since the `compositions/forks/*` S3 prefix is public-read — clients that only need to fetch (not mutate) can bypass the API and hit S3 directly:
|
|
122
|
+
|
|
123
|
+
- `GET https://<bucket>.s3.<region>.amazonaws.com/compositions/forks/<forkId>/working/composition.html`
|
|
124
|
+
- `GET .../working/composition.json`
|
|
125
|
+
- `GET .../working/manifest.json` — fork identity + genealogy (`parent_fork_id`, `parent_version`, `latest_version`, direct URLs for html/json/parent manifest). Also served via `GET /api/v1/compositions/:forkId/manifest.json` and `.../versions/:v/manifest.json`.
|
|
126
|
+
|
|
127
|
+
Treat the `forkId` as an unguessable bearer token — anyone with it can view the composition.
|
|
128
|
+
|
|
121
129
|
## Auto-decompose
|
|
122
130
|
|
|
123
131
|
If the fork's source is a raw video (not a pre-decomposed template), call auto-decompose to split it into scenes:
|
|
@@ -246,6 +254,20 @@ For agents that operate Vidfarm headlessly, the typical loop is:
|
|
|
246
254
|
|
|
247
255
|
Always send a stable `tracer` on publish to make retries idempotent.
|
|
248
256
|
|
|
257
|
+
## Local dev loop with `vidfarm dev-serve`
|
|
258
|
+
|
|
259
|
+
For iterating on a composition on disk (e.g. Claude Code editing HTML directly), skip the cloud entirely:
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
npm install -g @mevdragon/vidfarm-devcli
|
|
263
|
+
vidfarm dev-serve --dir ./my-fork --port 4321
|
|
264
|
+
# ./my-fork must contain composition.html; composition.json + manifest.json optional
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Then open the Trackpad Editor with `?dev=1` appended to the URL (or `?dev=host:port` / `?dev=<full-url>`). An orange **LOCAL DEV MODE** banner pins to the top with an Exit button. All fork API fetches route to the devcli instead of the deployed API; file saves on disk push an SSE reload event and the iframe re-fetches automatically.
|
|
268
|
+
|
|
269
|
+
The dev source is persisted in `localStorage.VIDFARM_DEV_SOURCE`, so you don't need to keep the `?dev=` param in the URL after the first load.
|
|
270
|
+
|
|
249
271
|
## What NOT to do
|
|
250
272
|
|
|
251
273
|
- Do **not** manipulate composition HTML by string concatenation. Always parse, edit, and re-serialize the DOM. The editor and runtime rely on `data-start`, `data-duration`, `data-track-index`, `data-hf-id`, `data-composition-id` attributes being well-formed.
|
|
@@ -291,3 +313,78 @@ curl -X POST "$VIDFARM_BASE/api/v1/primitives/images/remove-background" \
|
|
|
291
313
|
-H "content-type: application/json" \
|
|
292
314
|
-d '{"source_image_url": "https://cdn.example.com/photo.jpg"}'
|
|
293
315
|
```
|
|
316
|
+
|
|
317
|
+
## Primitive: media_dedupe
|
|
318
|
+
|
|
319
|
+
Apply subtle camouflage transforms (zoom, tilt, rotate, saturation, playback speed, contrast, brightness, hue rotate, blur, horizontal flip, tint overlay) to any source **image or video** URL. Useful when reposting existing media and you want small perceptual differences to reduce duplicate-detection.
|
|
320
|
+
|
|
321
|
+
- `POST /api/v1/primitives/media/dedupe`
|
|
322
|
+
- Body: `{ "tracer": "...", "payload": { ...fields... }, "webhook_url"?: "..." }`
|
|
323
|
+
- Response: standard primitive job. Poll to completion, then read `primary_file_url` (also `video.file_url` for MP4 or `image.file_url` for stills)
|
|
324
|
+
- Billing: metered as a Remotion render (via `remotion_lambda` on prod, local fallback in dev)
|
|
325
|
+
|
|
326
|
+
Payload fields:
|
|
327
|
+
|
|
328
|
+
- `source_media_url` (required, URL) — the image or video to transform
|
|
329
|
+
- `media_type` (`"image" | "video"`, optional) — auto-detected from URL extension if omitted (`.mp4/.mov/.webm/.m4v` → video, else image)
|
|
330
|
+
- `effects` (optional object). All fields optional; defaults camouflage lightly:
|
|
331
|
+
- `zoom` (default `1.04`) — scale factor
|
|
332
|
+
- `tilt` (default `3`) — degrees of 3D X-axis tilt (perspective 1000px)
|
|
333
|
+
- `rotate` (default `3`) — degrees of 2D rotation
|
|
334
|
+
- `saturation` (default `1.05`)
|
|
335
|
+
- `speed` (default `1.05`, video only) — playback rate, also compresses output duration accordingly
|
|
336
|
+
- `horizontal_flip` (default `false`)
|
|
337
|
+
- `contrast` (default `1.05`)
|
|
338
|
+
- `brightness` (default `1.05`)
|
|
339
|
+
- `hue_rotate` (default `0`) — degrees
|
|
340
|
+
- `blur` (default `0`) — pixels
|
|
341
|
+
- `tint_color` (default `"#FF8C00"`), `tint_opacity` (default `0.08`) — subtle color overlay
|
|
342
|
+
- `width` (default `1080`), `height` (default `1920`) — output canvas
|
|
343
|
+
- `duration_ms` — output duration for video; if omitted, `fallback_duration_ms` (default `5000`) is used
|
|
344
|
+
- `object_fit` (`"cover" | "contain" | "fill" | "none" | "scale-down"`, default `"cover"`)
|
|
345
|
+
- `background_color` (default `"#000000"`) — visible when `object_fit` leaves letterboxing
|
|
346
|
+
- `muted` (default `false`), `volume` (default `1`) — audio pass-through on video
|
|
347
|
+
- `output_format` (`"png" | "jpeg" | "webp"`, default `"png"`) — image mode only; video mode always outputs MP4
|
|
348
|
+
|
|
349
|
+
Video example (camouflage a reused clip):
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
curl -X POST "$VIDFARM_BASE/api/v1/primitives/media/dedupe" \
|
|
353
|
+
-H "authorization: Bearer $VIDFARM_API_KEY" \
|
|
354
|
+
-H "content-type: application/json" \
|
|
355
|
+
-d '{
|
|
356
|
+
"tracer": "dedupe-2026-07-01-abc",
|
|
357
|
+
"payload": {
|
|
358
|
+
"source_media_url": "https://cdn.example.com/reel.mp4",
|
|
359
|
+
"media_type": "video",
|
|
360
|
+
"duration_ms": 8500,
|
|
361
|
+
"effects": {
|
|
362
|
+
"zoom": 1.05,
|
|
363
|
+
"tilt": 2,
|
|
364
|
+
"rotate": -2,
|
|
365
|
+
"speed": 1.03,
|
|
366
|
+
"hue_rotate": 4,
|
|
367
|
+
"horizontal_flip": true
|
|
368
|
+
},
|
|
369
|
+
"tint_color": "#00A3FF",
|
|
370
|
+
"tint_opacity": 0.06
|
|
371
|
+
}
|
|
372
|
+
}'
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
Image example:
|
|
376
|
+
|
|
377
|
+
```bash
|
|
378
|
+
curl -X POST "$VIDFARM_BASE/api/v1/primitives/media/dedupe" \
|
|
379
|
+
-H "authorization: Bearer $VIDFARM_API_KEY" \
|
|
380
|
+
-H "content-type: application/json" \
|
|
381
|
+
-d '{
|
|
382
|
+
"tracer": "dedupe-still-01",
|
|
383
|
+
"payload": {
|
|
384
|
+
"source_media_url": "https://cdn.example.com/photo.jpg",
|
|
385
|
+
"media_type": "image",
|
|
386
|
+
"effects": { "zoom": 1.06, "rotate": -1, "hue_rotate": 8 },
|
|
387
|
+
"output_format": "webp"
|
|
388
|
+
}
|
|
389
|
+
}'
|
|
390
|
+
```
|
package/SKILL.platform.md
CHANGED
|
@@ -58,19 +58,23 @@ Query patterns use GSIs on `customerId`, `forkId`, `granteeId`, `slug`, and `sta
|
|
|
58
58
|
|
|
59
59
|
### S3 — composition storage
|
|
60
60
|
|
|
61
|
-
Bucket per stage. Layout is **ownership-agnostic** — the customerId does not appear in the S3 key.
|
|
61
|
+
Bucket per stage. Layout is **ownership-agnostic** — the customerId does not appear in the S3 key.
|
|
62
62
|
|
|
63
63
|
```
|
|
64
64
|
compositions/forks/<forkId>/
|
|
65
65
|
├── working/
|
|
66
66
|
│ ├── composition.html # current editor state
|
|
67
67
|
│ ├── composition.json # current metadata (scenes, captions, viral DNA)
|
|
68
|
+
│ ├── manifest.json # fork identity + genealogy pointer
|
|
68
69
|
│ └── ghostcut.json # GhostCut subtitle-removal task state (optional)
|
|
69
70
|
└── versions/<version>/
|
|
70
71
|
├── composition.html
|
|
71
|
-
|
|
72
|
+
├── composition.json
|
|
73
|
+
└── manifest.json # frozen version manifest
|
|
72
74
|
```
|
|
73
75
|
|
|
76
|
+
The `compositions/forks/*` prefix is **public-read** in the bucket resource policy — any client with a `forkId` can fetch `composition.html` / `composition.json` / `manifest.json` directly from S3 without a Lambda proxy hop. The `forkId` is treated as an unguessable bearer token (revoking share = generating a new fork). Write access is still gated at the API by `assertForkAccess(..., "edit" | "publish" | "share" | "delete")`. See `isPublicStorageKey` in `src/services/storage.ts`.
|
|
77
|
+
|
|
74
78
|
Additional prefixes:
|
|
75
79
|
|
|
76
80
|
- `renders/vidfarm/<slug>/<render-id>/output.mp4` — published MP4s
|
|
@@ -78,7 +82,35 @@ Additional prefixes:
|
|
|
78
82
|
- `template-assets/<slug>/...` — template media
|
|
79
83
|
- `user-attachments/<customerId>/...` — chat panel uploads (only ownership-keyed area remaining)
|
|
80
84
|
|
|
81
|
-
Old ownership-keyed composition paths (`compositions/users/<customerId>/forks/...`) were migrated away by `scripts/migrate-compositions-to-ownership-agnostic.ts`. Old `decomposition.json` was renamed to `composition.json` by `scripts/migrate-decomposition-to-composition.ts`.
|
|
85
|
+
Old ownership-keyed composition paths (`compositions/users/<customerId>/forks/...`) were migrated away by `scripts/migrate-compositions-to-ownership-agnostic.ts`. Old `decomposition.json` was renamed to `composition.json` by `scripts/migrate-decomposition-to-composition.ts`. Forks written before the manifest rollout won't have `manifest.json` until their next mutation — reads must tolerate 404.
|
|
86
|
+
|
|
87
|
+
### manifest.json
|
|
88
|
+
|
|
89
|
+
Written next to `composition.html` / `composition.json` in both `working/` and `versions/<n>/`. Lets clients traverse fork genealogy and jump between versions without a DynamoDB round-trip.
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"fork_id": "...",
|
|
94
|
+
"customer_id": "...",
|
|
95
|
+
"is_working": true,
|
|
96
|
+
"version": null,
|
|
97
|
+
"latest_version": 3,
|
|
98
|
+
"parent_fork_id": "fork_abc" | null,
|
|
99
|
+
"parent_version": 2 | null,
|
|
100
|
+
"source_slug_id": "...",
|
|
101
|
+
"source_video_id": "..." | null,
|
|
102
|
+
"visibility": "private" | "unlisted" | "public",
|
|
103
|
+
"title": "...",
|
|
104
|
+
"composition_url": "https://.../composition.html",
|
|
105
|
+
"composition_json_url": "https://.../composition.json",
|
|
106
|
+
"manifest_url": "https://.../manifest.json",
|
|
107
|
+
"parent_manifest_url": "https://.../versions/2/manifest.json" | null,
|
|
108
|
+
"created_at": "...",
|
|
109
|
+
"updated_at": "..."
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Writes are centralized in `writeForkManifest()` in `src/services/fork-manifest.ts`. `snapshotForkVersion()` writes both the version manifest AND refreshes the working manifest (so `latest_version` stays in sync). Every working-only mutation site (create, PUT html, PATCH json, visibility, decompose, ghostcut swap, export) also calls it.
|
|
82
114
|
|
|
83
115
|
## Composition model
|
|
84
116
|
|
|
@@ -119,7 +151,7 @@ A composition is a single HTML document plus a JSON sidecar.
|
|
|
119
151
|
}
|
|
120
152
|
```
|
|
121
153
|
|
|
122
|
-
|
|
154
|
+
All three files (`composition.html`, `composition.json`, `manifest.json`) are treated as immutable per version. The working state is mutable.
|
|
123
155
|
|
|
124
156
|
## Composition runtime
|
|
125
157
|
|
|
@@ -287,7 +319,7 @@ Top-level:
|
|
|
287
319
|
|
|
288
320
|
Legacy but still active:
|
|
289
321
|
|
|
290
|
-
- `auto-create-templates/` — extractor prompts for the older template creation flow.
|
|
322
|
+
- `auto-create-templates/` — extractor prompts for the older template creation flow. Only `extractor-system-prompt.md` and `production-graph.schema.json` are still live (loaded by `demo/scripts/dev.mjs`); the rest is inert docs kept for reference.
|
|
291
323
|
- `src/account-pages-legacy.ts`, `src/dev-app-legacy.ts` — HTML-string page renderers wrapped by `.tsx` React shells (`account-pages.tsx`, `dev-app.tsx`). Still active.
|
|
292
324
|
|
|
293
325
|
## Common failure modes
|
|
@@ -302,11 +334,39 @@ Legacy but still active:
|
|
|
302
334
|
|
|
303
335
|
- Composition endpoints — `src/app.ts` under `COMPOSITIONS_PREFIX` (~line 6970+)
|
|
304
336
|
- Fork CRUD & permissions — `src/services/serverless-records.ts`, `src/services/fork-access.ts`
|
|
305
|
-
- Storage keys — `src/services/storage.ts`
|
|
337
|
+
- Storage keys + public-read prefix list — `src/services/storage.ts`
|
|
338
|
+
- Fork manifest.json helper — `src/services/fork-manifest.ts`
|
|
306
339
|
- Composition runtime script — `src/composition-runtime.ts`
|
|
307
340
|
- Trackpad Editor — `demo/src/HyperframesStudioEditor.tsx`
|
|
341
|
+
- Editor local-mode bootstrap — `demo/src/dev-mode.ts`
|
|
342
|
+
- Devcli (`vidfarm-devcli`) — `src/cli.ts` (edit-mode fetch + banner), `src/dev-serve.ts` (raw HTTP shim)
|
|
308
343
|
- Auto-decompose logic — `src/hyperframes/composition.ts` (time-slice), `src/services/hyperframes.ts` (smart)
|
|
309
344
|
- Publish flow — `src/app.ts` `publishCompositionToRenderer()`
|
|
310
345
|
- Ghostcut — `src/services/ghostcut.ts`
|
|
311
346
|
- CDK stack — `infra/cdk/lib/vidfarm-serverless-staging-stack.ts`, `infra/cdk/lib/vidfarm-prod-stack.ts`
|
|
347
|
+
|
|
348
|
+
## Local editor dev loop
|
|
349
|
+
|
|
350
|
+
`@mevdragon/vidfarm-devcli` (`src/cli.ts` + `src/dev-serve.ts`) pairs a local directory of composition files with the hosted Trackpad Editor so Claude Code, Codex, or a human can edit `composition.html` on disk and see instant preview reload in the browser.
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
# One-shot: fetch composition, start dev-serve, print editor URL.
|
|
354
|
+
vidfarm-devcli <template_id>
|
|
355
|
+
# → downloads composition.html/json + manifest.json into .vidfarm/<template_id>/
|
|
356
|
+
# → listens on http://localhost:4321
|
|
357
|
+
# → prints https://vidfarm.cc/editor/<template_id>?fork=<forkId>&dev=http%3A%2F%2Flocalhost%3A4321
|
|
358
|
+
|
|
359
|
+
# Advanced: skip fetch, serve an existing directory.
|
|
360
|
+
vidfarm-devcli dev-serve --dir ./my-fork --port 4321
|
|
361
|
+
# Then open the editor with ?dev=1 (or ?dev=host:port / ?dev=<full-url>)
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
Edit flags: `--port`, `--dir`, `--host`, `--fork`, `--api-key` (or `VIDFARM_API_KEY`), `--share`, `--refetch`.
|
|
365
|
+
|
|
366
|
+
`dev-serve` behavior:
|
|
367
|
+
- Serves `composition.html` / `composition.json` / `manifest.json` (and `/versions/{n}/…`) with CORS `*`.
|
|
368
|
+
- Accepts `PUT /composition.html` and `PATCH /composition.json`.
|
|
369
|
+
- Watches the dir with `fs.watch`, coalesces bursts, fans out reload events via `GET /_events` SSE.
|
|
370
|
+
|
|
371
|
+
The editor side lives in `demo/src/dev-mode.ts` — a self-installing module imported at the top of `demo/src/main.tsx`. It reads `?dev=<url>` (persisted to `localStorage.VIDFARM_DEV_SOURCE`), monkey-patches `window.fetch` to rewrite `/api/v1/compositions/{forkId}/*` → `${devSource}/*`, injects a persistent orange banner with an Exit button, and dispatches `vidfarm:dev-reload` on SSE reload events. `HyperframesStudioEditor.tsx` listens for that event and re-runs the composition fetch effect with `cache: "reload"`.
|
|
312
372
|
- Lambdas — `infra/lambda/*.ts`
|