@mevdragon/vidfarm-devcli 0.2.6 → 0.2.8
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/GETTING_STARTED.developers.md +25 -0
- package/README.md +44 -3
- package/SKILL.developer.md +147 -11
- package/dist/src/account-pages.js +1 -1
- package/dist/src/app.js +380 -13
- package/dist/src/cli.js +246 -59
- package/dist/src/config.js +4 -5
- package/dist/src/context.js +16 -0
- package/dist/src/db.js +67 -13
- package/dist/src/homepage.js +33 -1
- package/dist/src/lib/template-paths.js +10 -4
- package/dist/src/registry.js +9 -2
- package/dist/src/services/auth.js +2 -6
- package/dist/src/services/job-logs.js +4 -4
- package/dist/src/services/providers.js +470 -0
- package/dist/src/services/storage.js +13 -0
- package/dist/src/services/template-certification.js +16 -2
- package/dist/src/services/template-loader.js +17 -1
- package/dist/src/services/template-sources.js +338 -17
- package/{templates/template_0000 → dist/templates/vidfarm_template_0000}/src/remotion/Root.js +1 -0
- package/dist/templates/{template_0000 → vidfarm_template_0000}/src/template.js +9 -3
- package/package.json +4 -3
- package/templates/{template_0000 → vidfarm_template_0000}/README.md +23 -0
- package/templates/{template_0000 → vidfarm_template_0000}/package.json +0 -1
- package/templates/{template_0000 → vidfarm_template_0000}/src/sdk.ts +18 -0
- package/templates/{template_0000 → vidfarm_template_0000}/src/template.js +9 -3
- package/templates/{template_0000 → vidfarm_template_0000}/src/template.ts +10 -3
- package/templates/vidfarm_template_0000/tmp/solobacterium-moorei-slideshow.request.json +31 -0
- /package/dist/templates/{template_0000 → vidfarm_template_0000}/src/lib/images.js +0 -0
- /package/dist/templates/{template_0000 → vidfarm_template_0000}/src/remotion/index.js +0 -0
- /package/dist/templates/{template_0000 → vidfarm_template_0000}/src/sdk.js +0 -0
- /package/dist/templates/{template_0000 → vidfarm_template_0000}/src/style-options.js +0 -0
- /package/dist/templates/{template_0000 → vidfarm_template_0000}/src/template-dna.js +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/SKILL.md +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/assets/Abel-Regular.ttf +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/assets/DMSerifDisplay-Regular.ttf +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/assets/Montserrat[wght].ttf +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/assets/SourceCodePro[wght].ttf +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/assets/TikTokSans-SemiBold.ttf +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/assets/Yesteryear-Regular.ttf +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/composition.json +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/research/preview/.gitkeep +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/research/source_notes.md +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/src/lib/images.js +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/src/lib/images.ts +0 -0
- /package/{dist/templates/template_0000 → templates/vidfarm_template_0000}/src/remotion/Root.js +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/src/remotion/Root.tsx +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/src/remotion/index.js +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/src/remotion/index.tsx +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/src/sdk.js +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/src/style-options.js +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/src/style-options.ts +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/src/template-dna.js +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/src/template-dna.ts +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/template.config.json +0 -0
- /package/templates/{template_0000 → vidfarm_template_0000}/tsconfig.json +0 -0
|
@@ -85,3 +85,28 @@ 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
|
+
## Shipping Updates
|
|
90
|
+
|
|
91
|
+
For a brand-new template, register the source once.
|
|
92
|
+
|
|
93
|
+
For an update to an already-registered template:
|
|
94
|
+
|
|
95
|
+
1. Push the exact commit to GitHub.
|
|
96
|
+
2. Submit that exact commit SHA to Vidfarm for review.
|
|
97
|
+
3. Wait for platform admin approval and activation.
|
|
98
|
+
|
|
99
|
+
Developer CLI example:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
node dist/src/cli.js publish-update-hosted \
|
|
103
|
+
--env-file .env \
|
|
104
|
+
--template-id YOUR_TEMPLATE_ID \
|
|
105
|
+
--slug-id vidfarm_template_your_slug \
|
|
106
|
+
--repo-url https://github.com/your-org/your-repo.git \
|
|
107
|
+
--branch main \
|
|
108
|
+
--template-module-path src/vidfarm_template_your_slug/src/template.ts \
|
|
109
|
+
--commit-sha YOUR_GITHUB_COMMIT_SHA
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
This does not make the template live. The CLI packages that exact commit locally, uploads the artifact to Vidfarm-managed S3, and creates or refreshes the reviewable release so a platform admin can approve and activate it.
|
package/README.md
CHANGED
|
@@ -84,6 +84,20 @@ Third-party developers build and validate templates locally first.
|
|
|
84
84
|
|
|
85
85
|
After handoff, a Vidfarm admin reviews the template before it is made available on the hosted platform. Template authors should assume there is an approval step between local development and production availability.
|
|
86
86
|
|
|
87
|
+
The developer handoff ends at:
|
|
88
|
+
|
|
89
|
+
- `git push` of the template code
|
|
90
|
+
- template source registration or registration update
|
|
91
|
+
- for an already-registered template, publishing the exact GitHub commit SHA that should enter review
|
|
92
|
+
|
|
93
|
+
The developer handoff does not include:
|
|
94
|
+
|
|
95
|
+
- importing the source into the live platform
|
|
96
|
+
- activating a release
|
|
97
|
+
- making the template public/live
|
|
98
|
+
|
|
99
|
+
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.
|
|
100
|
+
|
|
87
101
|
## Template Deploy Cycle
|
|
88
102
|
|
|
89
103
|
When someone says "template deploy cycle" in this repo, they mean this exact sequence:
|
|
@@ -97,6 +111,15 @@ For `template_0000`, that usually means:
|
|
|
97
111
|
|
|
98
112
|
```bash
|
|
99
113
|
git -C templates/vidfarm_template_0000 push origin production
|
|
114
|
+
# third-party developer registration step
|
|
115
|
+
node dist/src/cli.js register-source-hosted \
|
|
116
|
+
--env-file .env.production \
|
|
117
|
+
--template-id 4c7a7e1a-7f35-4f30-9f86-9c8a63c7f2db \
|
|
118
|
+
--slug-id template_0000 \
|
|
119
|
+
--repo-url https://github.com/your-org/your-template-repo \
|
|
120
|
+
--branch production \
|
|
121
|
+
--template-module-path templates/vidfarm_template_0000/src/template.ts
|
|
122
|
+
|
|
100
123
|
# then run the platform operator command
|
|
101
124
|
node dist/src/cli.js deploy-template-cycle \
|
|
102
125
|
--env-file .env.production \
|
|
@@ -110,7 +133,10 @@ node dist/src/cli.js deploy-template-cycle \
|
|
|
110
133
|
|
|
111
134
|
The important distinction is:
|
|
112
135
|
|
|
113
|
-
- template repo changes
|
|
136
|
+
- third-party developers ship template repo changes plus registration metadata, and can publish an exact commit SHA for an existing registered template
|
|
137
|
+
- platform admins import and activate those template repo changes
|
|
138
|
+
- new source registrations land in the hosted review queue before approval
|
|
139
|
+
- developer-published commit SHAs become reviewable releases while an older active release stays live
|
|
114
140
|
- platform code changes ship through the root prod deploy script
|
|
115
141
|
- 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`
|
|
116
142
|
|
|
@@ -126,7 +152,22 @@ If you need to discover the authenticated customer ID first, resolve it from `GE
|
|
|
126
152
|
|
|
127
153
|
For hosted template source registration, treat `template_module_path` as repo-relative and point it at the template's TypeScript entrypoint, for example `templates/vidfarm_template_hooks/src/template.ts`. Each template folder must start with `vidfarm_template_`. The import flow builds the repo and loads the compiled `src/template.js` sibling at activation time.
|
|
128
154
|
|
|
129
|
-
For
|
|
155
|
+
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.
|
|
156
|
+
|
|
157
|
+
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.
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
node dist/src/cli.js publish-update-hosted \
|
|
161
|
+
--env-file .env \
|
|
162
|
+
--template-id c7af2cd8-f032-45fa-9d4d-7af0e85cf4ef \
|
|
163
|
+
--slug-id vidfarm_template_reddit_brainrot \
|
|
164
|
+
--repo-url https://github.com/mevdragon/vidfarm_templates.git \
|
|
165
|
+
--branch main \
|
|
166
|
+
--template-module-path src/vidfarm_template_reddit_brainrot/src/template.ts \
|
|
167
|
+
--commit-sha 5e05a90a05a40105cc6e3b6a06774fdfb60c1893
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
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.
|
|
130
171
|
|
|
131
172
|
For local CLI usage, the `session` command gives you a local seeded session so you can test without manually wiring auth state.
|
|
132
173
|
|
|
@@ -153,4 +194,4 @@ If your template uses `ctx.remotion`, develop and validate it locally through th
|
|
|
153
194
|
|
|
154
195
|
## Next Read
|
|
155
196
|
|
|
156
|
-
For the external template-author workflow, continue with [GETTING_STARTED.developers.md](./GETTING_STARTED.developers.md) and the example template in [`templates/
|
|
197
|
+
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).
|
package/SKILL.developer.md
CHANGED
|
@@ -30,20 +30,35 @@ Do not use this skill for:
|
|
|
30
30
|
|
|
31
31
|
Third-party template developers publish template code by pushing git commits to GitHub. That is the only code-distribution step they own.
|
|
32
32
|
|
|
33
|
+
Important nuance:
|
|
34
|
+
|
|
35
|
+
- GitHub is relevant for the hosted handoff, not for normal local template authoring
|
|
36
|
+
- do not make GitHub setup or GitHub debugging a blocker for local template creation, testing, iteration, or validation
|
|
37
|
+
- if the user is only building or revising a template locally, they should not need to worry about GitHub at all
|
|
38
|
+
|
|
33
39
|
The third-party developer responsibility is:
|
|
34
40
|
|
|
35
41
|
- build and validate the template locally
|
|
36
42
|
- commit and push the template folder to GitHub
|
|
37
|
-
- register or update the hosted template source metadata so Vidfarm knows which repo, branch, and template folder to import from
|
|
43
|
+
- register or update the hosted template source metadata with `register-source-hosted` so Vidfarm knows which repo, branch, and template folder to import from
|
|
44
|
+
- for an already-registered template update, publish the exact GitHub commit SHA with `publish-update-hosted`
|
|
45
|
+
- stop there and hand off to the platform team
|
|
38
46
|
|
|
39
47
|
The third-party developer should not:
|
|
40
48
|
|
|
41
49
|
- run `import-source-prod`
|
|
42
50
|
- use AWS CloudFormation, SSM, EC2, or shared prod credentials
|
|
43
51
|
- treat platform import/activation as part of template authoring
|
|
52
|
+
- assume "make this template public/live" is their duty
|
|
44
53
|
|
|
45
54
|
`import-source-prod` and `deploy-template-cycle` are platform-operator commands. They are for internal admin flow, not for external template authors.
|
|
46
55
|
|
|
56
|
+
Private repo rule:
|
|
57
|
+
|
|
58
|
+
- if the registered source repo is private, assume the intended hosted setup is that Vidfarm has already been granted access to it
|
|
59
|
+
- when repo sharing is needed, the repo should be shared with GitHub username `mevdragon`
|
|
60
|
+
- do not treat a private repo itself as a problem if that access assumption is already stated
|
|
61
|
+
|
|
47
62
|
For third-party developers, Remotion is local and storage should be accessed through Vidfarm helpers. Do not require cloud Remotion setup or hand-written S3 integration for normal template work.
|
|
48
63
|
|
|
49
64
|
## Agent Operating Rule
|
|
@@ -113,34 +128,75 @@ Notes:
|
|
|
113
128
|
- at least one runtime AI provider key is usually enough
|
|
114
129
|
- `GEMINI_API_KEY` is the key used by the built-in DNA analysis commands
|
|
115
130
|
- `VIDFARM_API_KEY` is needed when calling a hosted Vidfarm API directly, including when minting presigned preview-media uploads through `vidfarm-devcli presign-preview-media`
|
|
131
|
+
- `VIDFARM_API_KEY` is also what `vidfarm-devcli register-source-hosted` and `vidfarm-devcli publish-update-hosted` use for hosted handoff
|
|
116
132
|
- local `vidfarm-devcli session` already gives you a seeded local API key for the local runtime
|
|
117
133
|
- when calling the hosted API directly, include both `vidfarm-user-id` and `vidfarm-api-key` headers
|
|
118
134
|
- for local `vidfarm-devcli` sessions, you usually do not need to supply `VIDFARM_USER_ID` manually
|
|
119
135
|
- template authoring is TypeScript-first; create and edit template source as `src/template.ts`, not `src/template.js`
|
|
120
136
|
- keep exploratory scripts, one-off test runners, scratch validation files, and temporary job-driving code out of `src/`; place them in a repo-local tmp folder that is a sibling to `src` instead, for example `templates/vidfarm_template_0007/tmp/`
|
|
121
137
|
- when registering a hosted template source, set `template_module_path` to the repo-relative TypeScript entrypoint inside the template folder, for example `templates/vidfarm_template_example/src/template.ts`; the platform build/import flow resolves the compiled `src/template.js` sibling after `npm run build`
|
|
122
|
-
- hosted template registration is git metadata only: repo URL, branch, template entrypoint path
|
|
138
|
+
- hosted template registration is git metadata only: repo URL, branch, and template entrypoint path
|
|
123
139
|
- if a template moves folders or switches branches, update the registration metadata; if the template code changed but the location stayed the same, just push a new Git commit
|
|
124
|
-
- the
|
|
140
|
+
- for an already-registered template, submit the exact commit you want reviewed with `publish-update-hosted --commit-sha <sha>`; that command packages the commit locally and uploads a review artifact to platform-controlled S3
|
|
141
|
+
- a local shell GitHub auth failure does not prove the hosted Vidfarm platform lacks repo access
|
|
142
|
+
- if `git ls-remote` fails locally, interpret that as local credential state unless the hosted import flow itself reports a GitHub access error
|
|
125
143
|
- do not ask for platform secrets like `ENCRYPTION_SECRET`, `API_KEY_SALT`, `WEBHOOK_SECRET`, admin emails, S3 config, or generic AWS credentials
|
|
126
144
|
- do not ask for `REMOTION_AWS_ACCESS_KEY_ID` or `REMOTION_AWS_SECRET_ACCESS_KEY`
|
|
127
145
|
|
|
146
|
+
Current first-class speech model allowlists in the platform runtime:
|
|
147
|
+
|
|
148
|
+
- text-to-speech
|
|
149
|
+
- `openrouter`: `google/gemini-3.1-flash-tts-preview`
|
|
150
|
+
- `gemini`: `gemini-3.1-flash-tts-preview`
|
|
151
|
+
- `openai`: `gpt-4o-mini-tts-2025-12-15`
|
|
152
|
+
|
|
153
|
+
- speech-to-text
|
|
154
|
+
- `openrouter`: `openai/gpt-4o-mini-transcribe`
|
|
155
|
+
- `gemini`: `gemini-3.1-flash-lite-preview`, `gemini-2.5-flash-lite`
|
|
156
|
+
- `openai`: `gpt-4o-mini-transcribe-2025-12-15`
|
|
157
|
+
|
|
128
158
|
## Hosted Registration Flow
|
|
129
159
|
|
|
130
160
|
For a third-party developer, the hosted publish handoff is:
|
|
131
161
|
|
|
132
162
|
1. push the repo changes that contain the target template folder
|
|
133
163
|
2. register the source location if it is new, or update the existing registration if the repo, branch, or template path changed
|
|
134
|
-
3.
|
|
164
|
+
3. if the template is already registered and the location did not change, publish the exact GitHub commit SHA with `publish-update-hosted`; that command uploads a signed artifact for that commit
|
|
165
|
+
4. stop there, then tell the platform operator which commit was submitted if they ask
|
|
135
166
|
|
|
136
167
|
Registration data should be treated like this:
|
|
137
168
|
|
|
138
169
|
- `repo_url`: the GitHub repo that contains the template code
|
|
139
170
|
- `branch`: the branch Vidfarm should watch for the latest version, usually `main`
|
|
140
171
|
- `template_module_path`: the repo-relative path to the template TypeScript entrypoint, for example `src/vidfarm_template_funnychat/src/template.ts`
|
|
141
|
-
- `
|
|
172
|
+
- `install_command`: the exact command that installs dependencies for the registered template source
|
|
173
|
+
- `build_command`: the exact command that leaves the compiled JavaScript entrypoint beside the declared TypeScript entrypoint, or `:` when the compiled `.js` files are already committed and no build step is needed
|
|
174
|
+
- `commit_sha`: for developer publish flow, the exact GitHub commit to package locally and submit for review on an already-registered source
|
|
175
|
+
|
|
176
|
+
Registration command rule:
|
|
142
177
|
|
|
143
|
-
|
|
178
|
+
- do not guess `install_command` and `build_command`
|
|
179
|
+
- for a standalone template repo rooted at the template itself, root-level commands like `npm install` and `npm run build` are usually correct
|
|
180
|
+
- for a multi-template repo, the commands must match the registered template folder, usually with `--prefix <template-folder>`
|
|
181
|
+
- if the declared `template_module_path` is `src/vidfarm_template_chadvirgin/src/template.ts`, then a typical install command is `npm install --prefix src/vidfarm_template_chadvirgin`
|
|
182
|
+
- if that template folder already commits `src/template.js`, a typical build command is `:`
|
|
183
|
+
- if that template folder requires compilation, a typical build command is `npm run build --prefix src/vidfarm_template_chadvirgin`
|
|
184
|
+
- a broken `build_command` will block hosted import even if the source registration itself succeeded
|
|
185
|
+
- before telling a user to register or update hosted source metadata, inspect the repo's actual `package.json` files and choose commands that match the template's real location
|
|
186
|
+
|
|
187
|
+
Do not tell third-party developers to run AWS-backed operator commands just to publish template code. If the task is only "make my updated template available to Vidfarm", the correct answer is GitHub push plus source registration metadata for new sources, or GitHub push plus `publish-update-hosted --commit-sha ...` for existing sources.
|
|
188
|
+
|
|
189
|
+
When reasoning about hosted visibility:
|
|
190
|
+
|
|
191
|
+
- the required developer-side outcome is that the intended commit is pushed to the registered branch
|
|
192
|
+
- do not infer hosted GitHub access failure from a local CLI auth error
|
|
193
|
+
- for hosted template updates, the review artifact is uploaded from the developer machine and prod later imports it from S3, so server-side GitHub access is not part of the normal publish path
|
|
194
|
+
|
|
195
|
+
If a developer can register a source but receives `403 Admin access required` when trying to import or activate it, that is the expected boundary, not a blocker they are supposed to solve. It means the handoff point was reached correctly.
|
|
196
|
+
|
|
197
|
+
Hosted registration should use `register-source-hosted`, not a local DB-backed command. That command calls the Vidfarm REST API so the source appears in the production review queue with `pending_review` status.
|
|
198
|
+
|
|
199
|
+
For updates to an already-registered template, use `publish-update-hosted` so the exact GitHub commit is packaged locally, uploaded as a signed artifact, and enters review as a pending release without granting approval or activation rights.
|
|
144
200
|
|
|
145
201
|
## Template Deploy Cycle
|
|
146
202
|
|
|
@@ -162,8 +218,8 @@ Read these files first when doing template work:
|
|
|
162
218
|
|
|
163
219
|
1. [GETTING_STARTED.developers.md](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/GETTING_STARTED.developers.md)
|
|
164
220
|
2. [README.md](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/README.md)
|
|
165
|
-
3. [templates/
|
|
166
|
-
4. [templates/
|
|
221
|
+
3. [templates/vidfarm_template_0000/SKILL.md](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/templates/vidfarm_template_0000/SKILL.md)
|
|
222
|
+
4. [templates/vidfarm_template_0000/src/template.ts](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/templates/vidfarm_template_0000/src/template.ts)
|
|
167
223
|
5. [src/template-sdk.ts](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/src/template-sdk.ts)
|
|
168
224
|
6. [src/cli.ts](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/src/cli.ts)
|
|
169
225
|
|
|
@@ -180,9 +236,19 @@ The contract is:
|
|
|
180
236
|
- `jobs` implement the actual work
|
|
181
237
|
- `configSchema` defines editable per-user template config
|
|
182
238
|
- `about.viral_dna` and `about.visual_dna` explain why the format wins
|
|
239
|
+
- `about.proposal_generator` tells directors and agents how to turn product/about context into template-native post ideas
|
|
240
|
+
- `about.sample_prompts` shows future users and agents how to prompt the template well
|
|
183
241
|
- `SKILL.md` teaches humans and agents how to call the template correctly
|
|
184
242
|
- the canonical template entrypoint is `src/template.ts`
|
|
185
243
|
|
|
244
|
+
The platform-owned helper surface on `ctx.providers` currently includes:
|
|
245
|
+
|
|
246
|
+
- `generateText(...)`
|
|
247
|
+
- `generateImage(...)`
|
|
248
|
+
- `analyzeImageLayout(...)`
|
|
249
|
+
- `generateSpeech(...)`
|
|
250
|
+
- `transcribeSpeech(...)`
|
|
251
|
+
|
|
186
252
|
Every public template action should remain async and job-based. Prefer one or more named operations behind `POST /api/v1/templates/:templateId/operations/:operationName` instead of inventing custom synchronous endpoints.
|
|
187
253
|
|
|
188
254
|
Templates are expected to evolve through multiple revisions. One-shot generation is not the standard. The standard is:
|
|
@@ -206,7 +272,7 @@ That documentation should describe:
|
|
|
206
272
|
|
|
207
273
|
- supported provider names
|
|
208
274
|
- allowed model IDs per provider
|
|
209
|
-
- which capability each model is intended for, such as `text`, `image`, `layout_analysis`, or `video`
|
|
275
|
+
- which capability each model is intended for, such as `text`, `image`, `layout_analysis`, `tts`, `stt`, or `video`
|
|
210
276
|
- whether the list is strict, preferred, or just known-good defaults
|
|
211
277
|
- any runtime caveats, especially when a provider is only partially supported by the current platform adapter
|
|
212
278
|
|
|
@@ -281,6 +347,13 @@ This boots the local API, worker, SQLite state, provider-key seeding, and local
|
|
|
281
347
|
|
|
282
348
|
Use a folder name that starts with `vidfarm_template_`, such as `templates/vidfarm_template_<nnnn>/`.
|
|
283
349
|
|
|
350
|
+
Keep the identifiers separate:
|
|
351
|
+
|
|
352
|
+
- the folder / package name should keep the `vidfarm_template_` prefix
|
|
353
|
+
- the `slugId` should stay clean and human-meaningful, for example `ugc_hooks_v1`
|
|
354
|
+
- `about.title` is the user-facing display title and should not be prefixed with `Vidfarm Template` unless that phrase is genuinely part of the brand or concept
|
|
355
|
+
- avoid redundant titles like `Vidfarm Template UGC Hooks V1` when `UGC Hooks V1` is the actual display name
|
|
356
|
+
|
|
284
357
|
Example:
|
|
285
358
|
|
|
286
359
|
```bash
|
|
@@ -345,11 +418,19 @@ These commands:
|
|
|
345
418
|
- sync the generated DNA module back into the template
|
|
346
419
|
- populate the strings consumed by `about.viral_dna`, `about.visual_dna`, and `about.link_to_original`
|
|
347
420
|
|
|
421
|
+
After DNA analysis, add `about.proposal_generator` and `about.sample_prompts` manually. The standard now requires both. `proposal_generator` should help a director combine product/about information with the template's format to invent many post proposals, and `sample_prompts` should show what strong final prompts look like. Do not leave either as optional polish.
|
|
422
|
+
|
|
423
|
+
Required-field rule:
|
|
424
|
+
|
|
425
|
+
- treat missing required fields as a blocking bug, not as follow-up polish
|
|
426
|
+
- before calling a template "ready", verify every required field in `defineTemplate(...)` is present and populated with real values
|
|
427
|
+
- if a scaffold or older repo shape omits any current required field, update the template to the current contract in the same pass
|
|
428
|
+
|
|
348
429
|
Do not hand-write these summaries if the CLI can generate them from the source media.
|
|
349
430
|
|
|
350
431
|
### 6. Implement the actual repeatable workflow
|
|
351
432
|
|
|
352
|
-
Use [templates/
|
|
433
|
+
Use [templates/vidfarm_template_0000/src/template.ts](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/templates/vidfarm_template_0000/src/template.ts) as the baseline pattern.
|
|
353
434
|
|
|
354
435
|
For a new template, make sure it has:
|
|
355
436
|
|
|
@@ -357,6 +438,14 @@ For a new template, make sure it has:
|
|
|
357
438
|
- `slugId`
|
|
358
439
|
- `version`
|
|
359
440
|
- `about`
|
|
441
|
+
- `about.title`
|
|
442
|
+
- `about.description`
|
|
443
|
+
- `about.viral_dna`
|
|
444
|
+
- `about.visual_dna`
|
|
445
|
+
- `about.preview_media`
|
|
446
|
+
- `about.link_to_original`
|
|
447
|
+
- `about.proposal_generator` with a reusable instruction for proposal generation
|
|
448
|
+
- `about.sample_prompts` with multiple concrete examples
|
|
360
449
|
- `configSchema`
|
|
361
450
|
- `operations`
|
|
362
451
|
- `jobs`
|
|
@@ -464,6 +553,7 @@ A revision is not complete just because the code compiles. It is complete when:
|
|
|
464
553
|
- the requested change is visible in the output
|
|
465
554
|
- the change does not obviously regress the core format
|
|
466
555
|
- the template can still be rerun by another user or agent
|
|
556
|
+
- `about.proposal_generator` and `about.sample_prompts` still reflect the best current way to ideate and prompt the template
|
|
467
557
|
- the usage instructions still match the implementation
|
|
468
558
|
|
|
469
559
|
## Template Contract
|
|
@@ -481,7 +571,14 @@ export const myTemplate = defineTemplate({
|
|
|
481
571
|
viral_dna: "Fast creator-style hooks with simple repeatable structure.",
|
|
482
572
|
visual_dna: "Presentation-led mobile layouts with recognizable creator-native framing.",
|
|
483
573
|
preview_media: ["templates/ugc_hooks_v1/about/preview-01.jpg"],
|
|
484
|
-
link_to_original: "https://www.tiktok.com/@example/video/1234567890"
|
|
574
|
+
link_to_original: "https://www.tiktok.com/@example/video/1234567890",
|
|
575
|
+
proposal_generator:
|
|
576
|
+
"Given the director's product, audience, and positioning, propose multiple UGC hook post ideas that fit this template. Return ideas that can either be used directly as prompts or expanded into a larger series of related prompts.",
|
|
577
|
+
sample_prompts: [
|
|
578
|
+
"Create a 3-slide UGC hook sequence for a sleep supplement targeting new parents.",
|
|
579
|
+
"Make a creator-style launch teaser for a skincare serum with one hook, one proof point, and one CTA.",
|
|
580
|
+
"Generate a short product explainer slideshow for a budgeting app aimed at freelancers."
|
|
581
|
+
]
|
|
485
582
|
},
|
|
486
583
|
configSchema: z.object({
|
|
487
584
|
defaultProvider: z.enum(["openai", "openrouter", "gemini", "perplexity"]).default("openai")
|
|
@@ -515,10 +612,48 @@ Keep these roles clear:
|
|
|
515
612
|
|
|
516
613
|
- `id` is the UUID-style template identifier
|
|
517
614
|
- `slugId` is the stable human-readable identifier
|
|
615
|
+
- `version` is required and should be an explicit template version string such as `1.0.0`
|
|
616
|
+
- `about.title` is the customer-facing display name; it does not need the folder prefix and should usually read like a normal product/template title
|
|
617
|
+
- `about.description` is required and should explain the reusable output format, not just restate the folder name
|
|
618
|
+
- `about.viral_dna` is required and should describe the repeatable distribution mechanics that make the format work
|
|
619
|
+
- `about.visual_dna` is required and should describe the repeatable visual system, framing, pacing, and composition cues
|
|
620
|
+
- `about.preview_media` is required and should contain checked-in preview asset paths that represent the template well
|
|
621
|
+
- `about.link_to_original` is required and should point to the original inspiration post or source reference when one exists
|
|
622
|
+
- `about.proposal_generator` is required and should help directors turn product/about context into a list of strong post proposals for that template
|
|
623
|
+
- `about.sample_prompts` is required and should contain realistic, high-signal examples that teach users how to get good results
|
|
518
624
|
- `operations` define the public API
|
|
519
625
|
- `jobs` implement the actual work
|
|
520
626
|
- `smokeTestPayload` is required for each operation
|
|
521
627
|
|
|
628
|
+
Required fields checklist:
|
|
629
|
+
|
|
630
|
+
- `id`
|
|
631
|
+
- `slugId`
|
|
632
|
+
- `version`
|
|
633
|
+
- `about.title`
|
|
634
|
+
- `about.description`
|
|
635
|
+
- `about.viral_dna`
|
|
636
|
+
- `about.visual_dna`
|
|
637
|
+
- `about.preview_media`
|
|
638
|
+
- `about.link_to_original`
|
|
639
|
+
- `about.proposal_generator`
|
|
640
|
+
- `about.sample_prompts`
|
|
641
|
+
- `configSchema`
|
|
642
|
+
- at least one operation
|
|
643
|
+
- a valid workflow function for every operation
|
|
644
|
+
- `smokeTestPayload` for every operation
|
|
645
|
+
- template-local `SKILL.md`
|
|
646
|
+
|
|
647
|
+
Best-practice rule:
|
|
648
|
+
|
|
649
|
+
- every template should ship with sample prompts
|
|
650
|
+
- every template should ship with a proposal generator prompt
|
|
651
|
+
- proposal generation should support a workflow of proposal -> prompts -> posts
|
|
652
|
+
- proposal outputs should be useful either as direct one-off prompts or as seeds for a whole series
|
|
653
|
+
- include more than one example so users can see the range of valid requests
|
|
654
|
+
- prefer prompts that are specific enough to be reusable exemplars, not vague one-liners
|
|
655
|
+
- refresh both `about.proposal_generator` and `about.sample_prompts` when the template's prompting strategy or supported use cases change
|
|
656
|
+
|
|
522
657
|
## Provider Rules
|
|
523
658
|
|
|
524
659
|
Templates should use the provider abstractions already available on `ctx.providers`.
|
|
@@ -534,6 +669,7 @@ Rules:
|
|
|
534
669
|
Important distinction:
|
|
535
670
|
|
|
536
671
|
- runtime template generation can use OpenAI, OpenRouter, Gemini, or Perplexity according to template logic
|
|
672
|
+
- first-class speech helpers use a strict runtime allowlist per provider/model pair; if a template needs other speech models, document that it is using a custom provider path instead of the built-in helper
|
|
537
673
|
- built-in DNA analysis commands currently depend on `GEMINI_API_KEY`
|
|
538
674
|
|
|
539
675
|
## Storage And Upload Rules
|
|
@@ -516,7 +516,7 @@ export function renderSettingsPage(input) {
|
|
|
516
516
|
<div class="card-head">
|
|
517
517
|
<div>
|
|
518
518
|
<div class="pill">AI Providers</div>
|
|
519
|
-
<h2>Attached
|
|
519
|
+
<h2>Attached AI API keys</h2>
|
|
520
520
|
</div>
|
|
521
521
|
</div>
|
|
522
522
|
<p class="helper">These are stored in plain text in SQLite for now, per your current platform requirement.</p>
|