@mevdragon/vidfarm-devcli 0.2.8 → 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.
- package/.env.example +9 -0
- package/GETTING_STARTED.developers.md +1 -26
- package/README.md +3 -0
- package/SKILL.developer.md +327 -4
- package/auto-create-templates/AUTO_CREATE_TEMPLATES.md +475 -0
- package/auto-create-templates/extractor-system-prompt.md +113 -0
- package/auto-create-templates/production-graph.schema.json +276 -0
- package/auto-create-templates/runbook.md +140 -0
- package/auto-create-templates/template-plan.schema.json +230 -0
- package/auto-create-templates/template-planner-prompt.md +75 -0
- package/dist/src/account-pages-legacy.js +9064 -0
- package/dist/src/account-pages.js +41 -620
- package/dist/src/app.js +6627 -244
- package/dist/src/cli.js +386 -26
- package/dist/src/config.js +12 -2
- package/dist/src/context.js +35 -35
- package/dist/src/db.js +1016 -53
- package/dist/src/dev-app-legacy.js +693 -0
- package/dist/src/dev-app.js +4 -904
- package/dist/src/domain.js +1 -1
- package/dist/src/editor-chat-history.js +72 -0
- package/dist/src/editor-chat.js +202 -0
- package/dist/src/frontend/flockposter-cache-store.js +116 -0
- package/dist/src/frontend/homepage-client.js +114 -0
- package/dist/src/frontend/homepage-shared.js +3 -0
- package/dist/src/frontend/homepage-store.js +27 -0
- package/dist/src/frontend/homepage-view.js +147 -0
- package/dist/src/frontend/page-runtime-client.js +100 -0
- package/dist/src/frontend/page-runtime-store.js +8 -0
- package/dist/src/frontend/template-editor-chat.js +2261 -0
- package/dist/src/homepage.js +695 -371
- package/dist/src/lib/template-style-options.js +95 -15
- package/dist/src/page-runtime.js +1 -0
- package/dist/src/page-shell.js +941 -0
- package/dist/src/primitive-context.js +163 -0
- package/dist/src/primitive-registry.js +340 -0
- package/dist/src/primitive-sdk.js +3 -0
- package/dist/src/primitives/remotion/html-image.js +28 -0
- package/dist/src/react-page-shell.js +34 -0
- package/dist/src/ready-post-schedule-component.js +1514 -0
- package/dist/src/registry.js +36 -17
- package/dist/src/runtime.js +6 -1
- package/dist/src/services/api-call-history.js +245 -0
- package/dist/src/services/auth.js +25 -3
- package/dist/src/services/billing.js +248 -9
- package/dist/src/services/chat-threads.js +88 -0
- package/dist/src/services/job-logs.js +14 -7
- package/dist/src/services/jobs.js +13 -2
- package/dist/src/services/providers.js +552 -133
- package/dist/src/services/rate-limits.js +236 -0
- package/dist/src/services/remotion.js +143 -16
- package/dist/src/services/storage.js +10 -8
- package/dist/src/services/template-certification.js +11 -2
- package/dist/src/services/template-loader.js +3 -1
- package/dist/src/services/template-sources.js +68 -3
- package/dist/src/template-editor-pages.js +2309 -0
- package/dist/src/template-editor-shell.js +1507 -0
- package/dist/src/worker.js +120 -22
- package/package.json +27 -4
- package/public/assets/homepage-app.js +54 -0
- package/public/assets/homepage-client-app.js +54 -0
- package/public/assets/page-runtime-client-app.js +68 -0
- package/dist/templates/vidfarm_template_0000/src/lib/images.js +0 -202
- package/dist/templates/vidfarm_template_0000/src/remotion/Root.js +0 -34
- package/dist/templates/vidfarm_template_0000/src/remotion/index.js +0 -3
- package/dist/templates/vidfarm_template_0000/src/sdk.js +0 -3
- package/dist/templates/vidfarm_template_0000/src/style-options.js +0 -51
- package/dist/templates/vidfarm_template_0000/src/template-dna.js +0 -9
- package/dist/templates/vidfarm_template_0000/src/template.js +0 -1447
- package/templates/vidfarm_template_0000/README.md +0 -100
- package/templates/vidfarm_template_0000/SKILL.md +0 -225
- 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/package.json +0 -27
- package/templates/vidfarm_template_0000/research/preview/.gitkeep +0 -1
- package/templates/vidfarm_template_0000/research/source_notes.md +0 -7
- package/templates/vidfarm_template_0000/src/lib/images.js +0 -202
- package/templates/vidfarm_template_0000/src/lib/images.ts +0 -241
- package/templates/vidfarm_template_0000/src/remotion/Root.js +0 -33
- package/templates/vidfarm_template_0000/src/remotion/Root.tsx +0 -75
- package/templates/vidfarm_template_0000/src/remotion/index.js +0 -3
- package/templates/vidfarm_template_0000/src/remotion/index.tsx +0 -4
- package/templates/vidfarm_template_0000/src/sdk.js +0 -3
- package/templates/vidfarm_template_0000/src/sdk.ts +0 -140
- package/templates/vidfarm_template_0000/src/style-options.js +0 -51
- package/templates/vidfarm_template_0000/src/style-options.ts +0 -60
- package/templates/vidfarm_template_0000/src/template-dna.js +0 -9
- package/templates/vidfarm_template_0000/src/template-dna.ts +0 -15
- package/templates/vidfarm_template_0000/src/template.js +0 -1447
- package/templates/vidfarm_template_0000/src/template.ts +0 -2049
- package/templates/vidfarm_template_0000/template.config.json +0 -21
- package/templates/vidfarm_template_0000/tmp/solobacterium-moorei-slideshow.request.json +0 -31
- package/templates/vidfarm_template_0000/tsconfig.json +0 -19
package/dist/src/context.js
CHANGED
|
@@ -5,12 +5,7 @@ import { jobLogStore } from "./services/job-logs.js";
|
|
|
5
5
|
export function createTemplateJobContext(input) {
|
|
6
6
|
const templateConfig = database.getTemplateConfig(input.customer.id, input.template.id);
|
|
7
7
|
const prefix = input.storage.templateJobPrefix(input.template.id, input.customer.id, input.job.id);
|
|
8
|
-
const buildArtifactUrl = (storageKey, fallbackUrl) =>
|
|
9
|
-
if (config.STORAGE_DRIVER !== "s3") {
|
|
10
|
-
return fallbackUrl;
|
|
11
|
-
}
|
|
12
|
-
return `${config.PUBLIC_BASE_URL}/template-media?key=${encodeURIComponent(storageKey)}`;
|
|
13
|
-
};
|
|
8
|
+
const buildArtifactUrl = (storageKey, fallbackUrl) => fallbackUrl ?? input.storage.getPublicUrl(storageKey);
|
|
14
9
|
return {
|
|
15
10
|
env: config.isProduction ? "production" : "development",
|
|
16
11
|
customer: input.customer,
|
|
@@ -97,15 +92,6 @@ export function createTemplateJobContext(input) {
|
|
|
97
92
|
const stored = await input.storage.putJson(`${prefix}/${key}`, value);
|
|
98
93
|
const artifactUrl = buildArtifactUrl(stored.key, stored.url);
|
|
99
94
|
insertArtifact("json", stored.key, artifactUrl, {});
|
|
100
|
-
await input.billing.record({
|
|
101
|
-
customerId: input.customer.id,
|
|
102
|
-
jobId: input.job.id,
|
|
103
|
-
templateId: input.template.id,
|
|
104
|
-
type: "storage_write",
|
|
105
|
-
costUsd: 0.005,
|
|
106
|
-
chargeUsd: 0.01,
|
|
107
|
-
metadata: { key: stored.key }
|
|
108
|
-
});
|
|
109
95
|
return {
|
|
110
96
|
...stored,
|
|
111
97
|
url: artifactUrl
|
|
@@ -115,15 +101,6 @@ export function createTemplateJobContext(input) {
|
|
|
115
101
|
const stored = await input.storage.putText(`${prefix}/${key}`, value, contentType);
|
|
116
102
|
const artifactUrl = buildArtifactUrl(stored.key, stored.url);
|
|
117
103
|
insertArtifact("text", stored.key, artifactUrl, { contentType });
|
|
118
|
-
await input.billing.record({
|
|
119
|
-
customerId: input.customer.id,
|
|
120
|
-
jobId: input.job.id,
|
|
121
|
-
templateId: input.template.id,
|
|
122
|
-
type: "storage_write",
|
|
123
|
-
costUsd: 0.005,
|
|
124
|
-
chargeUsd: 0.01,
|
|
125
|
-
metadata: { key: stored.key }
|
|
126
|
-
});
|
|
127
104
|
return {
|
|
128
105
|
...stored,
|
|
129
106
|
url: artifactUrl
|
|
@@ -136,15 +113,6 @@ export function createTemplateJobContext(input) {
|
|
|
136
113
|
...(options.metadata ?? {}),
|
|
137
114
|
contentType: options.contentType ?? null
|
|
138
115
|
});
|
|
139
|
-
await input.billing.record({
|
|
140
|
-
customerId: input.customer.id,
|
|
141
|
-
jobId: input.job.id,
|
|
142
|
-
templateId: input.template.id,
|
|
143
|
-
type: "storage_write",
|
|
144
|
-
costUsd: 0.005,
|
|
145
|
-
chargeUsd: 0.01,
|
|
146
|
-
metadata: { key: stored.key }
|
|
147
|
-
});
|
|
148
116
|
return {
|
|
149
117
|
...stored,
|
|
150
118
|
url: artifactUrl
|
|
@@ -159,15 +127,22 @@ export function createTemplateJobContext(input) {
|
|
|
159
127
|
await input.billing.record({
|
|
160
128
|
customerId: input.customer.id,
|
|
161
129
|
jobId: input.job.id,
|
|
130
|
+
tracer: input.job.tracer,
|
|
162
131
|
templateId: input.template.id,
|
|
163
132
|
type: record.type,
|
|
164
133
|
costUsd: record.costUsd,
|
|
165
|
-
chargeUsd: record.chargeUsd ?? Number((record.costUsd * 2).toFixed(4)),
|
|
134
|
+
chargeUsd: record.chargeUsd ?? Number((record.costUsd * 1.2).toFixed(4)),
|
|
135
|
+
costCenterSlug: record.costCenterSlug,
|
|
136
|
+
idempotencyKey: record.idempotencyKey,
|
|
137
|
+
occurredAtMs: record.occurredAtMs,
|
|
166
138
|
metadata: record.metadata
|
|
167
139
|
});
|
|
168
140
|
}
|
|
169
141
|
},
|
|
170
142
|
providers: {
|
|
143
|
+
listAvailableProviders() {
|
|
144
|
+
return input.providers.listAvailableProviders(input.customer.id);
|
|
145
|
+
},
|
|
171
146
|
async generateText(request) {
|
|
172
147
|
return input.providers.generateText({
|
|
173
148
|
customerId: input.customer.id,
|
|
@@ -211,10 +186,35 @@ export function createTemplateJobContext(input) {
|
|
|
211
186
|
},
|
|
212
187
|
remotion: {
|
|
213
188
|
async render(request) {
|
|
214
|
-
|
|
189
|
+
const render = await input.remotion.render({
|
|
215
190
|
...request,
|
|
216
191
|
outputKey: request.outputKey ? `${prefix}/${request.outputKey}` : undefined
|
|
217
192
|
});
|
|
193
|
+
const estimatedCostUsd = "estimatedCostUsd" in render.metadata ? render.metadata.estimatedCostUsd : null;
|
|
194
|
+
const chargeUsd = "chargeUsd" in render.metadata ? render.metadata.chargeUsd : null;
|
|
195
|
+
if (render.metadata.mode === "lambda" && typeof estimatedCostUsd === "number" && estimatedCostUsd > 0) {
|
|
196
|
+
await input.billing.record({
|
|
197
|
+
customerId: input.customer.id,
|
|
198
|
+
jobId: input.job.id,
|
|
199
|
+
tracer: input.job.tracer,
|
|
200
|
+
templateId: input.template.id,
|
|
201
|
+
type: "render",
|
|
202
|
+
costUsd: estimatedCostUsd,
|
|
203
|
+
chargeUsd: typeof chargeUsd === "number" ? chargeUsd : undefined,
|
|
204
|
+
costCenterSlug: "remotion_lambda",
|
|
205
|
+
idempotencyKey: `remotion_lambda:${render.renderId}`,
|
|
206
|
+
occurredAtMs: Date.now(),
|
|
207
|
+
metadata: {
|
|
208
|
+
...render.metadata,
|
|
209
|
+
render_id: render.renderId,
|
|
210
|
+
output_url: render.outputUrl,
|
|
211
|
+
composition_id: typeof render.metadata.compositionId === "string"
|
|
212
|
+
? render.metadata.compositionId
|
|
213
|
+
: request.compositionId,
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
return render;
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
};
|