@mevdragon/vidfarm-devcli 0.2.7 → 0.2.9

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 (98) hide show
  1. package/.env.example +9 -0
  2. package/GETTING_STARTED.developers.md +1 -30
  3. package/README.md +22 -5
  4. package/SKILL.developer.md +464 -12
  5. package/auto-create-templates/AUTO_CREATE_TEMPLATES.md +475 -0
  6. package/auto-create-templates/extractor-system-prompt.md +113 -0
  7. package/auto-create-templates/production-graph.schema.json +276 -0
  8. package/auto-create-templates/runbook.md +140 -0
  9. package/auto-create-templates/template-plan.schema.json +230 -0
  10. package/auto-create-templates/template-planner-prompt.md +75 -0
  11. package/dist/src/account-pages-legacy.js +9064 -0
  12. package/dist/src/account-pages.js +41 -620
  13. package/dist/src/app.js +7173 -494
  14. package/dist/src/cli.js +525 -29
  15. package/dist/src/config.js +14 -7
  16. package/dist/src/context.js +51 -35
  17. package/dist/src/db.js +1049 -55
  18. package/dist/src/dev-app-legacy.js +693 -0
  19. package/dist/src/dev-app.js +4 -904
  20. package/dist/src/domain.js +1 -1
  21. package/dist/src/editor-chat-history.js +72 -0
  22. package/dist/src/editor-chat.js +202 -0
  23. package/dist/src/frontend/flockposter-cache-store.js +116 -0
  24. package/dist/src/frontend/homepage-client.js +114 -0
  25. package/dist/src/frontend/homepage-shared.js +3 -0
  26. package/dist/src/frontend/homepage-store.js +27 -0
  27. package/dist/src/frontend/homepage-view.js +147 -0
  28. package/dist/src/frontend/page-runtime-client.js +100 -0
  29. package/dist/src/frontend/page-runtime-store.js +8 -0
  30. package/dist/src/frontend/template-editor-chat.js +2261 -0
  31. package/dist/src/homepage.js +695 -339
  32. package/dist/src/lib/template-paths.js +10 -4
  33. package/dist/src/lib/template-style-options.js +95 -15
  34. package/dist/src/page-runtime.js +1 -0
  35. package/dist/src/page-shell.js +941 -0
  36. package/dist/src/primitive-context.js +163 -0
  37. package/dist/src/primitive-registry.js +340 -0
  38. package/dist/src/primitive-sdk.js +3 -0
  39. package/dist/src/primitives/remotion/html-image.js +28 -0
  40. package/dist/src/react-page-shell.js +34 -0
  41. package/dist/src/ready-post-schedule-component.js +1514 -0
  42. package/dist/src/registry.js +44 -18
  43. package/dist/src/runtime.js +6 -1
  44. package/dist/src/services/api-call-history.js +245 -0
  45. package/dist/src/services/auth.js +27 -9
  46. package/dist/src/services/billing.js +248 -9
  47. package/dist/src/services/chat-threads.js +88 -0
  48. package/dist/src/services/job-logs.js +10 -3
  49. package/dist/src/services/jobs.js +13 -2
  50. package/dist/src/services/providers.js +944 -55
  51. package/dist/src/services/rate-limits.js +236 -0
  52. package/dist/src/services/remotion.js +143 -16
  53. package/dist/src/services/storage.js +23 -8
  54. package/dist/src/services/template-certification.js +26 -3
  55. package/dist/src/services/template-loader.js +19 -1
  56. package/dist/src/services/template-sources.js +316 -7
  57. package/dist/src/template-editor-pages.js +2309 -0
  58. package/dist/src/template-editor-shell.js +1507 -0
  59. package/dist/src/worker.js +120 -22
  60. package/package.json +30 -6
  61. package/public/assets/homepage-app.js +54 -0
  62. package/public/assets/homepage-client-app.js +54 -0
  63. package/public/assets/page-runtime-client-app.js +68 -0
  64. package/dist/templates/template_0000/src/lib/images.js +0 -202
  65. package/dist/templates/template_0000/src/remotion/Root.js +0 -33
  66. package/dist/templates/template_0000/src/remotion/index.js +0 -3
  67. package/dist/templates/template_0000/src/sdk.js +0 -3
  68. package/dist/templates/template_0000/src/style-options.js +0 -51
  69. package/dist/templates/template_0000/src/template-dna.js +0 -9
  70. package/dist/templates/template_0000/src/template.js +0 -1441
  71. package/templates/template_0000/README.md +0 -77
  72. package/templates/template_0000/SKILL.md +0 -225
  73. package/templates/template_0000/assets/Abel-Regular.ttf +0 -0
  74. package/templates/template_0000/assets/DMSerifDisplay-Regular.ttf +0 -0
  75. package/templates/template_0000/assets/Montserrat[wght].ttf +0 -0
  76. package/templates/template_0000/assets/SourceCodePro[wght].ttf +0 -0
  77. package/templates/template_0000/assets/TikTokSans-SemiBold.ttf +0 -0
  78. package/templates/template_0000/assets/Yesteryear-Regular.ttf +0 -0
  79. package/templates/template_0000/composition.json +0 -11
  80. package/templates/template_0000/package.json +0 -28
  81. package/templates/template_0000/research/preview/.gitkeep +0 -1
  82. package/templates/template_0000/research/source_notes.md +0 -7
  83. package/templates/template_0000/src/lib/images.js +0 -202
  84. package/templates/template_0000/src/lib/images.ts +0 -241
  85. package/templates/template_0000/src/remotion/Root.js +0 -33
  86. package/templates/template_0000/src/remotion/Root.tsx +0 -75
  87. package/templates/template_0000/src/remotion/index.js +0 -3
  88. package/templates/template_0000/src/remotion/index.tsx +0 -4
  89. package/templates/template_0000/src/sdk.js +0 -3
  90. package/templates/template_0000/src/sdk.ts +0 -122
  91. package/templates/template_0000/src/style-options.js +0 -51
  92. package/templates/template_0000/src/style-options.ts +0 -60
  93. package/templates/template_0000/src/template-dna.js +0 -9
  94. package/templates/template_0000/src/template-dna.ts +0 -15
  95. package/templates/template_0000/src/template.js +0 -1441
  96. package/templates/template_0000/src/template.ts +0 -2042
  97. package/templates/template_0000/template.config.json +0 -21
  98. package/templates/template_0000/tsconfig.json +0 -19
package/.env.example CHANGED
@@ -6,10 +6,19 @@ OPENROUTER_API_KEY=""
6
6
  GEMINI_API_KEY=""
7
7
  PERPLEXITY_API_KEY=""
8
8
 
9
+ # Optional. Production CDK wires these automatically for the EC2 app and ZIP Lambda.
10
+ VIDFARM_ZIP_LAMBDA_URL=""
11
+ VIDFARM_ZIP_LAMBDA_SECRET=""
12
+ VIDFARM_BILLING_URL=""
13
+ VIDFARM_BILLING_SECRET=""
14
+ VIDFARM_RATE_LIMITS_TABLE_NAME=""
15
+
9
16
  # Optional when calling a hosted Vidfarm API directly.
10
17
  VIDFARM_USER_ID=""
11
18
  VIDFARM_API_KEY=""
12
19
 
13
20
  # Optional local overrides. The CLI will choose sensible local defaults.
14
21
  PUBLIC_BASE_URL="http://localhost:3310"
22
+ # Optional public browser-facing chat endpoint. Leave empty locally unless you want the UI to hit a separate chat host directly.
23
+ PUBLIC_EDITOR_CHAT_URL=""
15
24
  REMOTION_MODE="local"
@@ -46,7 +46,7 @@ https://calendly.com/zoom-gtm/creative-director-interviews
46
46
 
47
47
  0. Tell your manager your email so he can whitelist you access to Vidfarm. After he confirms you have access, login at https://vidfarm.cloud.zoomgtm.com
48
48
 
49
- 1. Open VSCode in a new project called "Vidfarm-Developer"
49
+ 1. Open VSCode in a new project and create a new project folder "Vidfarm-Developer"
50
50
 
51
51
  2. Open terminal and login to github cli and npm cli (ask ai/codex if you need help). ask your manager if they gave you npm access to "vidfarm-devcli" yet.
52
52
 
@@ -85,32 +85,3 @@ That will populate with a reference folder of what a template code looks like. W
85
85
  8. Create a new folder beside src called `drafts/` which is where we will put messy files when needed.
86
86
 
87
87
  9. Now find an easy winning format from https://winning-formats-gallery-tiktok.cloud.zoomgtm.com/ and save the image to your drafts/ folder. then tell Codex to look at that image (right click, copy relative path, paste to codex), then tell codex please make a new template based on the image.
88
-
89
- ## Publish Responsibility
90
-
91
- When your template is ready for hosted Vidfarm, your responsibility is only:
92
-
93
- 1. push your template code to GitHub
94
- 2. register or update the template source metadata so Vidfarm knows the repo URL, branch, and template folder path
95
-
96
- Your responsibility does not include:
97
-
98
- 1. importing the source into the live platform
99
- 2. activating the release
100
- 3. making the template public/live
101
-
102
- Those are platform-admin steps. If an API route says `403 Admin access required` for import or activate, that means you reached the correct handoff boundary.
103
-
104
- When you need to register your template with hosted Vidfarm, use the dev CLI command below from your repo root:
105
-
106
- ```bash
107
- npx @mevdragon/vidfarm-devcli register-source-hosted \
108
- --env-file .env \
109
- --template-id <uuid-v4> \
110
- --slug-id <template_slug> \
111
- --repo-url https://github.com/<you>/<repo> \
112
- --branch main \
113
- --template-module-path templates/vidfarm_template_<slug>/src/template.ts
114
- ```
115
-
116
- That command uses your `VIDFARM_API_KEY` and sends the registration to the hosted REST API, so the template appears in Vidfarm's review queue with `pending_review` status.
package/README.md CHANGED
@@ -30,6 +30,7 @@ npx @mevdragon/vidfarm-devcli dev --port 3310 --reset
30
30
  npx @mevdragon/vidfarm-devcli session
31
31
  npx @mevdragon/vidfarm-devcli validate-template --template-id template_0000
32
32
  npx @mevdragon/vidfarm-devcli copy-reference-template --template-dir ./src/vidfarm_template_0000
33
+ npx @mevdragon/vidfarm-devcli autocreate-template ./drafts/my_format ./templates/vidfarm_template_my_format
33
34
  npx @mevdragon/vidfarm-devcli generate-template --slug-id template_0001 --template-dir ./templates/vidfarm_template_0001
34
35
  npx @mevdragon/vidfarm-devcli analyze-viral-dna --template-dir ./templates/vidfarm_template_0001
35
36
  npx @mevdragon/vidfarm-devcli analyze-visual-dna --template-dir ./templates/vidfarm_template_0001
@@ -38,6 +39,8 @@ npx @mevdragon/vidfarm-devcli presign-preview-media --file ./drafts/preview/exam
38
39
 
39
40
  After install, the package exposes both `vidfarm` and `vidfarm-devcli` as local binaries.
40
41
 
42
+ `autocreate-template` prepares the auto-create harness run folder, stages media from the input path, snapshots the current harness files, scaffolds the output template, and writes an agent handoff prompt at `auto-create-templates/runs/<run_id>/agent_prompt.md`. Keep improving `auto-create-templates/AUTO_CREATE_TEMPLATES.md`; each new run uses the current harness and stores a per-run snapshot for traceability.
43
+
41
44
  ## What The Local CLI Does
42
45
 
43
46
  The local CLI runs the same template contract used by the hosted platform, but with local-first defaults:
@@ -88,6 +91,7 @@ The developer handoff ends at:
88
91
 
89
92
  - `git push` of the template code
90
93
  - template source registration or registration update
94
+ - for an already-registered template, publishing the exact GitHub commit SHA that should enter review
91
95
 
92
96
  The developer handoff does not include:
93
97
 
@@ -95,7 +99,7 @@ The developer handoff does not include:
95
99
  - activating a release
96
100
  - making the template public/live
97
101
 
98
- If a developer receives `403 Admin access required` while trying to import or activate a registered source, that is expected. Those routes are for platform admins.
102
+ If a developer receives `403 Admin access required` while trying to import or activate a registered source, that is expected. Those routes are for platform admins. Developers should use the publish-update flow to submit an exact commit SHA for review instead.
99
103
 
100
104
  ## Template Deploy Cycle
101
105
 
@@ -132,10 +136,10 @@ node dist/src/cli.js deploy-template-cycle \
132
136
 
133
137
  The important distinction is:
134
138
 
135
- - third-party developers only ship template repo changes plus registration metadata
139
+ - third-party developers ship template repo changes plus registration metadata, and can publish an exact commit SHA for an existing registered template
136
140
  - platform admins import and activate those template repo changes
137
141
  - new source registrations land in the hosted review queue before approval
138
- - newly imported releases can be approved while an older active release stays live
142
+ - developer-published commit SHAs become reviewable releases while an older active release stays live
139
143
  - platform code changes ship through the root prod deploy script
140
144
  - multiple templates can live in one git repo as long as each template has its own folder and its `template_module_path` points at that folder's `src/template.ts`
141
145
 
@@ -153,7 +157,20 @@ For hosted template source registration, treat `template_module_path` as repo-re
153
157
 
154
158
  For hosted registration, use `register-source-hosted`. It talks to the Vidfarm REST API directly, so the source record lands in the production database that backs the hosted review queue. `register-source-prod` remains as a compatibility alias for internal/operator workflows.
155
159
 
156
- For private GitHub repos, set `VIDFARM_GITHUB_TOKEN` or `GITHUB_TOKEN` in the hosted runtime environment before using the REST import and approval flow. The production API now performs the clone/import itself, so the token must be available to the server process rather than injected from the operator shell.
160
+ For updates to an already-registered template, use `publish-update-hosted` with the exact reviewed commit SHA. The CLI packages that commit locally into a signed artifact, uploads it to platform-controlled S3 through the Vidfarm API, and then creates or refreshes the pending release for admin review without granting developers approval or activation rights.
161
+
162
+ ```bash
163
+ node dist/src/cli.js publish-update-hosted \
164
+ --env-file .env \
165
+ --template-id c7af2cd8-f032-45fa-9d4d-7af0e85cf4ef \
166
+ --slug-id vidfarm_template_reddit_brainrot \
167
+ --repo-url https://github.com/mevdragon/vidfarm_templates.git \
168
+ --branch main \
169
+ --template-module-path src/vidfarm_template_reddit_brainrot/src/template.ts \
170
+ --commit-sha 5e05a90a05a40105cc6e3b6a06774fdfb60c1893
171
+ ```
172
+
173
+ The hosted publish path no longer depends on server-side GitHub access for template updates. Prod imports the uploaded artifact from S3 during review/import.
157
174
 
158
175
  For local CLI usage, the `session` command gives you a local seeded session so you can test without manually wiring auth state.
159
176
 
@@ -180,4 +197,4 @@ If your template uses `ctx.remotion`, develop and validate it locally through th
180
197
 
181
198
  ## Next Read
182
199
 
183
- For the external template-author workflow, continue with [GETTING_STARTED.developers.md](./GETTING_STARTED.developers.md) and the example template in [`templates/template_0000`](./templates/template_0000).
200
+ For the external template-author workflow, continue with [GETTING_STARTED.developers.md](./GETTING_STARTED.developers.md) and the example template in [`templates/vidfarm_template_0000`](./templates/vidfarm_template_0000).