@mevdragon/vidfarm-devcli 0.2.0 → 0.2.1
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/.env.example +2 -2
- package/PLATFORM_SPEC.md +1 -0
- package/SKILL.developer.md +128 -447
- package/SKILL.director.md +599 -0
- package/dist/src/account-pages.js +57 -5
- package/dist/src/app.js +32 -22
- package/dist/src/config.js +1 -1
- package/dist/src/context.js +1 -1
- package/dist/src/services/storage.js +22 -0
- package/dist/templates/template_0000/src/template.js +1 -1
- package/package.json +2 -1
- package/templates/template_0000/package-lock.json +368 -0
- package/templates/template_0000/package.json +1 -0
- package/templates/template_0000/src/lib/images.js +242 -0
- package/templates/template_0000/src/remotion/index.js +3 -0
- package/templates/template_0000/src/sdk.js +3 -0
- package/templates/template_0000/src/template.js +1117 -0
- package/templates/template_0000/src/template.ts +1 -1
|
@@ -0,0 +1,599 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vidfarm-director
|
|
3
|
+
description: Use Vidfarm as a director-facing agent-first video production platform. Use this whenever the user wants to log in with OTP, store their own AI provider keys, discover templates, read a template's published skill, submit template jobs, poll job status, inspect logs, or operate a multi-stage media production workflow through the Vidfarm REST API.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Vidfarm Director
|
|
7
|
+
|
|
8
|
+
Vidfarm is an agent-first media production platform.
|
|
9
|
+
|
|
10
|
+
Use this skill when the user wants to operate Vidfarm as a director, not when they want to build templates or modify the platform.
|
|
11
|
+
|
|
12
|
+
The user of this skill is a director or template operator:
|
|
13
|
+
|
|
14
|
+
- they sign in to Vidfarm
|
|
15
|
+
- they bring their own AI API keys
|
|
16
|
+
- they discover available templates
|
|
17
|
+
- they read each template's published skill and metadata
|
|
18
|
+
- they submit async jobs to template operations
|
|
19
|
+
- they poll jobs, read logs, and chain stages together
|
|
20
|
+
|
|
21
|
+
Do not explain template developer internals unless the user explicitly asks for them.
|
|
22
|
+
|
|
23
|
+
## Core Mental Model
|
|
24
|
+
|
|
25
|
+
Treat Vidfarm as a shared control plane for many production templates.
|
|
26
|
+
|
|
27
|
+
Each template is a production format with a common platform wrapper:
|
|
28
|
+
|
|
29
|
+
- auth
|
|
30
|
+
- API keys
|
|
31
|
+
- async jobs
|
|
32
|
+
- logs
|
|
33
|
+
- webhooks
|
|
34
|
+
- artifacts
|
|
35
|
+
|
|
36
|
+
Each template then adds its own production logic through its operations.
|
|
37
|
+
|
|
38
|
+
The platform is intentionally async-first:
|
|
39
|
+
|
|
40
|
+
- every meaningful production action becomes a job
|
|
41
|
+
- jobs immediately return `job_id`
|
|
42
|
+
- the caller polls for status or receives a webhook
|
|
43
|
+
|
|
44
|
+
This is important because video production is inherently multi-stage and often slow:
|
|
45
|
+
|
|
46
|
+
- concept generation
|
|
47
|
+
- research
|
|
48
|
+
- script or storyboard scaffolding
|
|
49
|
+
- image or scene generation
|
|
50
|
+
- human review or revision
|
|
51
|
+
- final render
|
|
52
|
+
|
|
53
|
+
You should frame Vidfarm as a production pipeline system, not as a single prompt-response tool.
|
|
54
|
+
|
|
55
|
+
## Agent-First Operating Style
|
|
56
|
+
|
|
57
|
+
Vidfarm is designed for users who work through AI agents.
|
|
58
|
+
|
|
59
|
+
Your role is usually to operate the API on the user's behalf:
|
|
60
|
+
|
|
61
|
+
1. log the user in
|
|
62
|
+
2. store their provider keys
|
|
63
|
+
3. list templates
|
|
64
|
+
4. inspect the selected template
|
|
65
|
+
5. read the template's published skill
|
|
66
|
+
6. choose the right operation
|
|
67
|
+
7. submit the job
|
|
68
|
+
8. monitor progress
|
|
69
|
+
9. use outputs from one stage as inputs to the next stage
|
|
70
|
+
|
|
71
|
+
Prefer doing this operational work for the user instead of only describing the docs.
|
|
72
|
+
|
|
73
|
+
When helping a user choose what to do next, think in terms of pipeline stages. Ask what stage they are in:
|
|
74
|
+
|
|
75
|
+
- idea
|
|
76
|
+
- storyboard
|
|
77
|
+
- asset generation
|
|
78
|
+
- refinement
|
|
79
|
+
- rendering
|
|
80
|
+
- delivery
|
|
81
|
+
|
|
82
|
+
## Bring Your Own AI Keys
|
|
83
|
+
|
|
84
|
+
Vidfarm expects customers to bring their own AI provider credentials.
|
|
85
|
+
|
|
86
|
+
Today the user-facing provider key API supports:
|
|
87
|
+
|
|
88
|
+
- `openai`
|
|
89
|
+
- `gemini`
|
|
90
|
+
- `openrouter`
|
|
91
|
+
- `perplexity`
|
|
92
|
+
|
|
93
|
+
Before running most AI-backed template operations, the user should save at least one provider key that matches the template's expected provider flow.
|
|
94
|
+
|
|
95
|
+
Do not imply that Vidfarm supplies the AI credits itself. The customer is expected to supply their own upstream AI access.
|
|
96
|
+
|
|
97
|
+
## Base URL And Auth
|
|
98
|
+
|
|
99
|
+
Production is intended to run under:
|
|
100
|
+
|
|
101
|
+
```txt
|
|
102
|
+
https://vidfarm.cloud.zoomgtm.com
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The REST API base path is:
|
|
106
|
+
|
|
107
|
+
```txt
|
|
108
|
+
/api/v1
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Authenticated API calls use these headers:
|
|
112
|
+
|
|
113
|
+
```txt
|
|
114
|
+
vidfarm-user-id: <customer id>
|
|
115
|
+
vidfarm-api-key: <api key>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The API key is issued after OTP verification.
|
|
119
|
+
|
|
120
|
+
## Login Flow
|
|
121
|
+
|
|
122
|
+
Use this sequence for API login:
|
|
123
|
+
|
|
124
|
+
1. `POST /api/v1/user/request-otp`
|
|
125
|
+
2. `POST /api/v1/user/verify-otp`
|
|
126
|
+
|
|
127
|
+
Request OTP:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
curl -X POST "https://vidfarm.cloud.zoomgtm.com/api/v1/user/request-otp" \
|
|
131
|
+
-H "content-type: application/json" \
|
|
132
|
+
-d '{
|
|
133
|
+
"email": "user@example.com"
|
|
134
|
+
}'
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Verify OTP:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
curl -X POST "https://vidfarm.cloud.zoomgtm.com/api/v1/user/verify-otp" \
|
|
141
|
+
-H "content-type: application/json" \
|
|
142
|
+
-d '{
|
|
143
|
+
"email": "user@example.com",
|
|
144
|
+
"code": "123456",
|
|
145
|
+
"name": "Example User"
|
|
146
|
+
}'
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Expected response shape:
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"customer": {
|
|
154
|
+
"id": "cus_...",
|
|
155
|
+
"email": "user@example.com",
|
|
156
|
+
"name": "Example User",
|
|
157
|
+
"defaultWebhookUrl": null,
|
|
158
|
+
"isDeveloper": false,
|
|
159
|
+
"isPaidPlan": true
|
|
160
|
+
},
|
|
161
|
+
"apiKey": "vf_key_..."
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Persist these values for later API calls:
|
|
166
|
+
|
|
167
|
+
- `customer.id`
|
|
168
|
+
- `apiKey`
|
|
169
|
+
|
|
170
|
+
Useful shell variables:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
BASE_URL="https://vidfarm.cloud.zoomgtm.com/api/v1"
|
|
174
|
+
VIDFARM_USER_ID="cus_replace_me"
|
|
175
|
+
VIDFARM_API_KEY="vf_replace_me"
|
|
176
|
+
AUTH_HEADERS=(
|
|
177
|
+
-H "vidfarm-user-id: ${VIDFARM_USER_ID}"
|
|
178
|
+
-H "vidfarm-api-key: ${VIDFARM_API_KEY}"
|
|
179
|
+
)
|
|
180
|
+
JSON_HEADERS=(
|
|
181
|
+
"${AUTH_HEADERS[@]}"
|
|
182
|
+
-H "content-type: application/json"
|
|
183
|
+
)
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Save Provider Keys
|
|
187
|
+
|
|
188
|
+
Store the user's own AI key before starting template work:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
curl -X POST "${BASE_URL}/user/me/provider-keys" \
|
|
192
|
+
"${JSON_HEADERS[@]}" \
|
|
193
|
+
-d '{
|
|
194
|
+
"provider": "openrouter",
|
|
195
|
+
"label": "primary",
|
|
196
|
+
"secret": "sk-or-v1-...",
|
|
197
|
+
"weight": 1
|
|
198
|
+
}'
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
List saved provider keys:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
curl "${BASE_URL}/user/me/provider-keys" \
|
|
205
|
+
"${AUTH_HEADERS[@]}"
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Use `GET /api/v1/user/me` to inspect the current authenticated customer profile:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
curl "${BASE_URL}/user/me" \
|
|
212
|
+
"${AUTH_HEADERS[@]}"
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Template Standard
|
|
216
|
+
|
|
217
|
+
Every customer-usable template follows the same platform shape:
|
|
218
|
+
|
|
219
|
+
- `GET /api/v1/templates`
|
|
220
|
+
- `GET /api/v1/templates/:templateId`
|
|
221
|
+
- `GET /api/v1/templates/:templateId/skill`
|
|
222
|
+
- `GET /api/v1/templates/:templateId/about/*`
|
|
223
|
+
- `POST /api/v1/templates/:templateId/config`
|
|
224
|
+
- `POST /api/v1/templates/:templateId/operations/:operationName`
|
|
225
|
+
- `GET /api/v1/templates/:templateId/jobs`
|
|
226
|
+
- `GET /api/v1/templates/:templateId/jobs/:jobId`
|
|
227
|
+
- `GET /api/v1/templates/:templateId/jobs/:jobId/logs`
|
|
228
|
+
- `POST /api/v1/templates/:templateId/jobs/:jobId/cancel`
|
|
229
|
+
|
|
230
|
+
This common wrapper is the most important concept for users.
|
|
231
|
+
|
|
232
|
+
No matter which template is chosen, the operating pattern stays the same:
|
|
233
|
+
|
|
234
|
+
1. discover
|
|
235
|
+
2. inspect
|
|
236
|
+
3. configure
|
|
237
|
+
4. submit operation
|
|
238
|
+
5. monitor job
|
|
239
|
+
6. feed outputs into the next stage
|
|
240
|
+
|
|
241
|
+
## Discover Templates
|
|
242
|
+
|
|
243
|
+
List all templates:
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
curl "${BASE_URL}/templates" \
|
|
247
|
+
"${AUTH_HEADERS[@]}"
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
The response includes each template's:
|
|
251
|
+
|
|
252
|
+
- `id`
|
|
253
|
+
- `slug_id`
|
|
254
|
+
- `version`
|
|
255
|
+
- `title`
|
|
256
|
+
- `description`
|
|
257
|
+
- `skill_url`
|
|
258
|
+
- `operations`
|
|
259
|
+
|
|
260
|
+
Read one template's about metadata:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
curl "${BASE_URL}/templates/template_0000" \
|
|
264
|
+
"${AUTH_HEADERS[@]}"
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Expected about fields include:
|
|
268
|
+
|
|
269
|
+
- `id`
|
|
270
|
+
- `slug_id`
|
|
271
|
+
- `version`
|
|
272
|
+
- `title`
|
|
273
|
+
- `description`
|
|
274
|
+
- `viral_dna`
|
|
275
|
+
- `preview_media`
|
|
276
|
+
- `link_to_original`
|
|
277
|
+
- `skill_url`
|
|
278
|
+
- `operations`
|
|
279
|
+
|
|
280
|
+
Important detail:
|
|
281
|
+
|
|
282
|
+
- `templateId` may be either the UUID-like template id or the human-readable `slug_id`
|
|
283
|
+
- in practice, users will usually prefer the `slug_id`
|
|
284
|
+
|
|
285
|
+
## Read The Template's Own Skill
|
|
286
|
+
|
|
287
|
+
After identifying a template, read its published skill:
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
curl "${BASE_URL}/templates/template_0000/skill" \
|
|
291
|
+
"${AUTH_HEADERS[@]}"
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
This is how you discover the template's unique operating details.
|
|
295
|
+
|
|
296
|
+
The template skill is the customer-facing contract for things like:
|
|
297
|
+
|
|
298
|
+
- which operations exist
|
|
299
|
+
- what each operation does
|
|
300
|
+
- the expected payload shape
|
|
301
|
+
- which output artifacts come back
|
|
302
|
+
- any template-specific stage sequence
|
|
303
|
+
- any style or formatting constraints
|
|
304
|
+
|
|
305
|
+
When a user asks how to use a specific template, always inspect both:
|
|
306
|
+
|
|
307
|
+
1. `GET /templates/:templateId`
|
|
308
|
+
2. `GET /templates/:templateId/skill`
|
|
309
|
+
|
|
310
|
+
Use the metadata endpoint for the standard wrapper and the skill endpoint for the template-specific behavior.
|
|
311
|
+
|
|
312
|
+
## Template Configuration
|
|
313
|
+
|
|
314
|
+
Some templates support saved per-user configuration.
|
|
315
|
+
|
|
316
|
+
Write config with:
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
curl -X POST "${BASE_URL}/templates/template_0000/config" \
|
|
320
|
+
"${JSON_HEADERS[@]}" \
|
|
321
|
+
-d '{
|
|
322
|
+
"config": {
|
|
323
|
+
"defaultProvider": "gemini"
|
|
324
|
+
}
|
|
325
|
+
}'
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Treat config as stable preferences for that template, such as:
|
|
329
|
+
|
|
330
|
+
- default provider
|
|
331
|
+
- default models
|
|
332
|
+
- style settings
|
|
333
|
+
- rendering defaults
|
|
334
|
+
|
|
335
|
+
Always check the template skill for the config fields that the specific template expects.
|
|
336
|
+
|
|
337
|
+
## Submit Template Operations
|
|
338
|
+
|
|
339
|
+
Template work is submitted through operation routes:
|
|
340
|
+
|
|
341
|
+
```txt
|
|
342
|
+
POST /api/v1/templates/:templateId/operations/:operationName
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
Request shape:
|
|
346
|
+
|
|
347
|
+
```json
|
|
348
|
+
{
|
|
349
|
+
"tracer": "client-generated-reference",
|
|
350
|
+
"payload": {},
|
|
351
|
+
"webhook_url": "https://example.com/webhooks/vidfarm"
|
|
352
|
+
}
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
`webhook_url` is optional.
|
|
356
|
+
|
|
357
|
+
The standard response shape is:
|
|
358
|
+
|
|
359
|
+
```json
|
|
360
|
+
{
|
|
361
|
+
"job_id": "job_...",
|
|
362
|
+
"tracer": "client-generated-reference",
|
|
363
|
+
"status": "queued"
|
|
364
|
+
}
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Example, using the sample template's first stage:
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
curl -X POST "${BASE_URL}/templates/template_0000/operations/create_slideshow" \
|
|
371
|
+
"${JSON_HEADERS[@]}" \
|
|
372
|
+
-d '{
|
|
373
|
+
"tracer": "launch-story-001",
|
|
374
|
+
"payload": {
|
|
375
|
+
"slides": [
|
|
376
|
+
["late night founder at laptop", "launching after hours", 2200],
|
|
377
|
+
{
|
|
378
|
+
"image_prompt": "skincare serum bottle on a clean bathroom counter near a window",
|
|
379
|
+
"caption": "the routine was simpler than i thought",
|
|
380
|
+
"duration_ms": 2800
|
|
381
|
+
}
|
|
382
|
+
],
|
|
383
|
+
"meta_details_prompt": "Write native TikTok metadata for a US audience. Keep it curiosity-driven and casual."
|
|
384
|
+
}
|
|
385
|
+
}'
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
## Monitor Jobs
|
|
389
|
+
|
|
390
|
+
List jobs for one template:
|
|
391
|
+
|
|
392
|
+
```bash
|
|
393
|
+
curl "${BASE_URL}/templates/template_0000/jobs" \
|
|
394
|
+
"${AUTH_HEADERS[@]}"
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
Filter by tracer or time window:
|
|
398
|
+
|
|
399
|
+
```bash
|
|
400
|
+
curl "${BASE_URL}/templates/template_0000/jobs?tracer=launch-story-001&start_time=2026-05-17T00:00:00.000Z&end_time=2026-05-18T00:00:00.000Z&limit=20" \
|
|
401
|
+
"${AUTH_HEADERS[@]}"
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
Get one job:
|
|
405
|
+
|
|
406
|
+
```bash
|
|
407
|
+
JOB_ID="job_replace_me"
|
|
408
|
+
|
|
409
|
+
curl "${BASE_URL}/templates/template_0000/jobs/${JOB_ID}" \
|
|
410
|
+
"${AUTH_HEADERS[@]}"
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
Job responses commonly include:
|
|
414
|
+
|
|
415
|
+
- `job_id`
|
|
416
|
+
- `template_id`
|
|
417
|
+
- `operation_name`
|
|
418
|
+
- `workflow_name`
|
|
419
|
+
- `tracer`
|
|
420
|
+
- `status`
|
|
421
|
+
- `progress`
|
|
422
|
+
- `result`
|
|
423
|
+
- `error`
|
|
424
|
+
- `created_at`
|
|
425
|
+
- `updated_at`
|
|
426
|
+
- `started_at`
|
|
427
|
+
- `completed_at`
|
|
428
|
+
|
|
429
|
+
Current job statuses are:
|
|
430
|
+
|
|
431
|
+
- `queued`
|
|
432
|
+
- `running`
|
|
433
|
+
- `waiting_for_child`
|
|
434
|
+
- `waiting_for_human`
|
|
435
|
+
- `succeeded`
|
|
436
|
+
- `failed`
|
|
437
|
+
- `cancelled`
|
|
438
|
+
|
|
439
|
+
## Read Structured Logs
|
|
440
|
+
|
|
441
|
+
Every job can expose a structured timeline:
|
|
442
|
+
|
|
443
|
+
```bash
|
|
444
|
+
curl "${BASE_URL}/templates/template_0000/jobs/${JOB_ID}/logs?start_time=2026-05-17T00:00:00.000Z&end_time=2026-05-18T00:00:00.000Z&limit=200" \
|
|
445
|
+
"${AUTH_HEADERS[@]}"
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
Treat logs as the best source for:
|
|
449
|
+
|
|
450
|
+
- progress checkpoints
|
|
451
|
+
- stage-level diagnostics
|
|
452
|
+
- artifact references
|
|
453
|
+
- machine-readable metadata emitted during production
|
|
454
|
+
|
|
455
|
+
When a job fails or stalls, inspect logs before retrying blindly.
|
|
456
|
+
|
|
457
|
+
## Cancel Jobs
|
|
458
|
+
|
|
459
|
+
Cancel a job with:
|
|
460
|
+
|
|
461
|
+
```bash
|
|
462
|
+
curl -X POST "${BASE_URL}/templates/template_0000/jobs/${JOB_ID}/cancel" \
|
|
463
|
+
"${AUTH_HEADERS[@]}"
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
## Cross-Template Job Listing
|
|
467
|
+
|
|
468
|
+
To see the current user's jobs across templates:
|
|
469
|
+
|
|
470
|
+
```bash
|
|
471
|
+
curl "${BASE_URL}/user/me/jobs" \
|
|
472
|
+
"${AUTH_HEADERS[@]}"
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
This endpoint also supports filters such as:
|
|
476
|
+
|
|
477
|
+
- `template_id`
|
|
478
|
+
- `tracer`
|
|
479
|
+
- `start_time`
|
|
480
|
+
- `end_time`
|
|
481
|
+
- `limit`
|
|
482
|
+
|
|
483
|
+
## Webhooks
|
|
484
|
+
|
|
485
|
+
Vidfarm supports optional job webhooks on operation submission.
|
|
486
|
+
|
|
487
|
+
Use them when the user wants asynchronous completion handling instead of polling.
|
|
488
|
+
|
|
489
|
+
Webhook events can include:
|
|
490
|
+
|
|
491
|
+
- `job.queued`
|
|
492
|
+
- `job.running`
|
|
493
|
+
- `job.succeeded`
|
|
494
|
+
- `job.failed`
|
|
495
|
+
- `job.cancelled`
|
|
496
|
+
|
|
497
|
+
Webhook requests include:
|
|
498
|
+
|
|
499
|
+
- `x-vidfarm-event`
|
|
500
|
+
- `x-vidfarm-signature`
|
|
501
|
+
|
|
502
|
+
The JSON body shape is:
|
|
503
|
+
|
|
504
|
+
```json
|
|
505
|
+
{
|
|
506
|
+
"type": "job.succeeded",
|
|
507
|
+
"emitted_at": "2026-05-17T12:00:00.000Z",
|
|
508
|
+
"job": {
|
|
509
|
+
"job_id": "job_...",
|
|
510
|
+
"tracer": "launch-story-001",
|
|
511
|
+
"status": "succeeded",
|
|
512
|
+
"template_id": "template_0000",
|
|
513
|
+
"operation_name": "create_slideshow",
|
|
514
|
+
"progress": 1,
|
|
515
|
+
"result": {},
|
|
516
|
+
"error": null
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
## Multi-Stage Production Guidance
|
|
522
|
+
|
|
523
|
+
The right way to think about Vidfarm is as a chain of production states.
|
|
524
|
+
|
|
525
|
+
One operation often prepares the next one.
|
|
526
|
+
|
|
527
|
+
Typical pattern:
|
|
528
|
+
|
|
529
|
+
1. generate or scaffold assets
|
|
530
|
+
2. inspect the result payload and artifacts
|
|
531
|
+
3. optionally revise inputs
|
|
532
|
+
4. submit the next operation
|
|
533
|
+
5. repeat until final render or export
|
|
534
|
+
|
|
535
|
+
For example, the current sample template behaves like this:
|
|
536
|
+
|
|
537
|
+
1. `create_slideshow` generates finished slide frames plus manifest data
|
|
538
|
+
2. the returned `renderVideoInput` becomes the clean handoff into `render_video`
|
|
539
|
+
3. `render_video` turns those frames into a final vertical video
|
|
540
|
+
|
|
541
|
+
When helping users, always look for explicit handoff fields in the previous stage's `result`.
|
|
542
|
+
|
|
543
|
+
## How To Understand A Template's Unique API
|
|
544
|
+
|
|
545
|
+
Vidfarm templates share the same outer API, but each template has unique operations and payloads.
|
|
546
|
+
|
|
547
|
+
Use this exact sequence:
|
|
548
|
+
|
|
549
|
+
1. call `GET /api/v1/templates`
|
|
550
|
+
2. pick a template id or `slug_id`
|
|
551
|
+
3. call `GET /api/v1/templates/:templateId`
|
|
552
|
+
4. inspect `operations`
|
|
553
|
+
5. call `GET /api/v1/templates/:templateId/skill`
|
|
554
|
+
6. extract operation names, payload examples, and stage order from the skill
|
|
555
|
+
7. submit the chosen operation under `/operations/:operationName`
|
|
556
|
+
|
|
557
|
+
Do not invent undocumented subroutes.
|
|
558
|
+
|
|
559
|
+
For customers, the unique template surface is primarily:
|
|
560
|
+
|
|
561
|
+
- the operation names
|
|
562
|
+
- the config schema
|
|
563
|
+
- the payload contract
|
|
564
|
+
- the returned artifacts and result structure
|
|
565
|
+
|
|
566
|
+
The template skill is the authoritative human-readable guide for those differences.
|
|
567
|
+
|
|
568
|
+
## Alpha Posture
|
|
569
|
+
|
|
570
|
+
Vidfarm is in alpha.
|
|
571
|
+
|
|
572
|
+
Prefer teaching users the flows that exist now and avoid dwelling on features that may arrive later.
|
|
573
|
+
|
|
574
|
+
Focus on what lets a user become operational immediately:
|
|
575
|
+
|
|
576
|
+
- OTP login
|
|
577
|
+
- API key issuance
|
|
578
|
+
- provider key upload
|
|
579
|
+
- template discovery
|
|
580
|
+
- template skill inspection
|
|
581
|
+
- async job submission
|
|
582
|
+
- job polling
|
|
583
|
+
- logs
|
|
584
|
+
- webhooks
|
|
585
|
+
|
|
586
|
+
## Default Assistance Pattern
|
|
587
|
+
|
|
588
|
+
When a user asks for help using Vidfarm, default to this style:
|
|
589
|
+
|
|
590
|
+
1. get or confirm their auth state
|
|
591
|
+
2. confirm they have brought their own AI key
|
|
592
|
+
3. list templates
|
|
593
|
+
4. inspect the chosen template
|
|
594
|
+
5. read the template skill
|
|
595
|
+
6. identify the current production stage
|
|
596
|
+
7. submit the smallest sensible next operation
|
|
597
|
+
8. monitor the job and interpret the outputs
|
|
598
|
+
|
|
599
|
+
This keeps the interaction agentic, operational, and immediately useful.
|
|
@@ -220,6 +220,40 @@ function shell(input) {
|
|
|
220
220
|
color: var(--muted);
|
|
221
221
|
background: rgba(255,255,255,0.7);
|
|
222
222
|
}
|
|
223
|
+
.status-row {
|
|
224
|
+
display: flex;
|
|
225
|
+
flex-wrap: wrap;
|
|
226
|
+
gap: 10px;
|
|
227
|
+
align-items: center;
|
|
228
|
+
}
|
|
229
|
+
.status-pill {
|
|
230
|
+
display: inline-flex;
|
|
231
|
+
align-items: center;
|
|
232
|
+
gap: 8px;
|
|
233
|
+
padding: 8px 12px;
|
|
234
|
+
border: 1px solid var(--line);
|
|
235
|
+
background: rgba(255,255,255,0.78);
|
|
236
|
+
color: var(--ink);
|
|
237
|
+
letter-spacing: 0.08em;
|
|
238
|
+
text-transform: uppercase;
|
|
239
|
+
font-size: 12px;
|
|
240
|
+
}
|
|
241
|
+
.status-pill::before {
|
|
242
|
+
content: "";
|
|
243
|
+
width: 9px;
|
|
244
|
+
height: 9px;
|
|
245
|
+
border-radius: 999px;
|
|
246
|
+
background: #7a6d61;
|
|
247
|
+
}
|
|
248
|
+
.status-pill.is-active::before {
|
|
249
|
+
background: var(--accent);
|
|
250
|
+
box-shadow: 0 0 0 4px rgba(159, 61, 36, 0.12);
|
|
251
|
+
}
|
|
252
|
+
.developer-panel {
|
|
253
|
+
background:
|
|
254
|
+
linear-gradient(135deg, rgba(159, 61, 36, 0.11), rgba(255,255,255,0.68)),
|
|
255
|
+
rgba(255,255,255,0.62);
|
|
256
|
+
}
|
|
223
257
|
.key-list, .attachment-list {
|
|
224
258
|
display: grid;
|
|
225
259
|
gap: 12px;
|
|
@@ -402,6 +436,21 @@ export function renderSettingsPage(input) {
|
|
|
402
436
|
data-copy-content='${escapeAttribute(input.developerSkill)}'
|
|
403
437
|
data-copy-label="Developer SKILL.md"
|
|
404
438
|
>Developer SKILL.md</button>
|
|
439
|
+
` : "";
|
|
440
|
+
const developerPanel = input.isDeveloper ? `
|
|
441
|
+
<section class="settings-panel developer-panel">
|
|
442
|
+
<div class="card-head">
|
|
443
|
+
<div>
|
|
444
|
+
<div class="pill">Developer Access</div>
|
|
445
|
+
<h2>Template developer tools are enabled</h2>
|
|
446
|
+
</div>
|
|
447
|
+
<div class="status-pill is-active">Developer</div>
|
|
448
|
+
</div>
|
|
449
|
+
<p class="helper">This account can submit template sources and use the developer workflow. The <code>Developer SKILL.md</code> prompt is available here for fast copy into your agent tooling.</p>
|
|
450
|
+
<div class="toolbar">
|
|
451
|
+
${developerSkillButton}
|
|
452
|
+
</div>
|
|
453
|
+
</section>
|
|
405
454
|
` : "";
|
|
406
455
|
return shell({
|
|
407
456
|
title: "Settings",
|
|
@@ -423,7 +472,10 @@ export function renderSettingsPage(input) {
|
|
|
423
472
|
<div class="pill">Profile</div>
|
|
424
473
|
<h2>Workspace identity</h2>
|
|
425
474
|
</div>
|
|
426
|
-
<div class="
|
|
475
|
+
<div class="status-row">
|
|
476
|
+
<div class="status-pill ${input.isPaidPlan ? "is-active" : ""}">${input.isPaidPlan ? "Paid plan" : "Inactive plan"}</div>
|
|
477
|
+
<div class="status-pill ${input.isDeveloper ? "is-active" : ""}">${input.isDeveloper ? "Developer" : "Standard"}</div>
|
|
478
|
+
</div>
|
|
427
479
|
</div>
|
|
428
480
|
<form method="post" action="/settings/profile">
|
|
429
481
|
<label for="settings-email">Email</label>
|
|
@@ -440,10 +492,11 @@ export function renderSettingsPage(input) {
|
|
|
440
492
|
</div>
|
|
441
493
|
</form>
|
|
442
494
|
</section>
|
|
495
|
+
${developerPanel}
|
|
443
496
|
<section class="settings-panel">
|
|
444
497
|
<div class="pill">Vidfarm API</div>
|
|
445
|
-
<h2>Your
|
|
446
|
-
<p class="helper">Use this key with the <code>vidfarm-user-id</code> header pair when calling the API directly.</p>
|
|
498
|
+
<h2>Your Vidfarm API key</h2>
|
|
499
|
+
<p class="helper">Use this key with the <code>vidfarm-user-id</code> header pair when calling the Vidfarm API directly.</p>
|
|
447
500
|
<label for="vidfarm-api-key">Current API key</label>
|
|
448
501
|
<div class="secret-wrap">
|
|
449
502
|
<input id="vidfarm-api-key" type="password" value="${escapeHtml(input.vidfarmApiKey)}" readonly />
|
|
@@ -457,7 +510,6 @@ export function renderSettingsPage(input) {
|
|
|
457
510
|
data-copy-content='${escapeAttribute(input.directorSkill)}'
|
|
458
511
|
data-copy-label="Director SKILL.md"
|
|
459
512
|
>Director SKILL.md</button>
|
|
460
|
-
${developerSkillButton}
|
|
461
513
|
</div>
|
|
462
514
|
</section>
|
|
463
515
|
<section class="settings-panel">
|
|
@@ -506,7 +558,7 @@ export function renderSettingsPage(input) {
|
|
|
506
558
|
<section class="settings-panel">
|
|
507
559
|
<div class="pill">Attachments</div>
|
|
508
560
|
<h2>Shared files</h2>
|
|
509
|
-
<p class="helper">Uploads are stored under your <code>user
|
|
561
|
+
<p class="helper">Uploads are stored under your <code>user/<user_id>/*</code> namespace and can be opened via public read URLs.</p>
|
|
510
562
|
<form method="post" action="/settings/attachments" enctype="multipart/form-data">
|
|
511
563
|
<label for="settings-files">Images, video, audio, PDF, Markdown, or text</label>
|
|
512
564
|
<input id="settings-files" type="file" name="files" multiple accept="image/*,video/*,audio/*,.pdf,.md,.txt,text/markdown,text/plain,application/pdf" />
|