@mevdragon/vidfarm-devcli 0.2.8 → 0.2.10
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 +419 -8
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash, createHmac } from "node:crypto";
|
|
2
|
-
import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { execFile } from "node:child_process";
|
|
@@ -26,8 +26,8 @@ export class TemplateSourceAlreadyRegisteredError extends Error {
|
|
|
26
26
|
}
|
|
27
27
|
export class TemplateSourceService {
|
|
28
28
|
certification = new TemplateCertificationService();
|
|
29
|
-
listSources(
|
|
30
|
-
return database.listTemplateSources(
|
|
29
|
+
listSources(input) {
|
|
30
|
+
return database.listTemplateSources(input);
|
|
31
31
|
}
|
|
32
32
|
listReleases(input) {
|
|
33
33
|
return database.listTemplateReleases(input);
|
|
@@ -368,6 +368,7 @@ export class TemplateSourceService {
|
|
|
368
368
|
});
|
|
369
369
|
throw new Error("Template release failed certification and cannot be activated.");
|
|
370
370
|
}
|
|
371
|
+
await this.syncTemplateAboutAssets({ release, template });
|
|
371
372
|
database.clearActiveTemplateReleases(release.templateId);
|
|
372
373
|
database.updateTemplateReleaseStatus({
|
|
373
374
|
id: release.id,
|
|
@@ -432,6 +433,47 @@ export class TemplateSourceService {
|
|
|
432
433
|
}
|
|
433
434
|
});
|
|
434
435
|
}
|
|
436
|
+
async syncTemplateAboutAssets(input) {
|
|
437
|
+
const entries = Array.from(new Set(input.template.about.preview_media
|
|
438
|
+
.filter((entry) => !/^https?:\/\//i.test(entry))
|
|
439
|
+
.filter((entry) => !entry.replace(/^\/+/, "").startsWith("templates/"))));
|
|
440
|
+
for (const entry of entries) {
|
|
441
|
+
const asset = this.resolveTemplateAboutAsset(input.release, entry);
|
|
442
|
+
if (!asset) {
|
|
443
|
+
throw new Error(`Template about asset not found in release checkout: ${entry}`);
|
|
444
|
+
}
|
|
445
|
+
await storage.putBuffer(storage.templateAboutKey(input.template.id, asset.storageAssetPath), readFileSync(asset.sourcePath), inferContentType(asset.sourcePath));
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
resolveTemplateAboutAsset(release, entry) {
|
|
449
|
+
const normalizedEntry = entry.replace(/^\/+/, "");
|
|
450
|
+
const sourceRelativePath = normalizedEntry.startsWith("about/")
|
|
451
|
+
? normalizedEntry
|
|
452
|
+
: path.posix.join("about", normalizedEntry);
|
|
453
|
+
const storageAssetPath = normalizedEntry.startsWith("about/")
|
|
454
|
+
? normalizedEntry.slice("about/".length)
|
|
455
|
+
: normalizedEntry;
|
|
456
|
+
const checkoutRoot = path.resolve(release.checkoutPath);
|
|
457
|
+
let currentDir = path.dirname(release.modulePath);
|
|
458
|
+
while (true) {
|
|
459
|
+
const candidatePath = path.join(currentDir, sourceRelativePath);
|
|
460
|
+
if (existsSync(candidatePath)) {
|
|
461
|
+
return {
|
|
462
|
+
sourcePath: candidatePath,
|
|
463
|
+
storageAssetPath
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
if (path.resolve(currentDir) === checkoutRoot) {
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
const parentDir = path.dirname(currentDir);
|
|
470
|
+
if (parentDir === currentDir) {
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
currentDir = parentDir;
|
|
474
|
+
}
|
|
475
|
+
return null;
|
|
476
|
+
}
|
|
435
477
|
async loadAndVerifyArtifactManifest(manifestKey, source) {
|
|
436
478
|
const raw = await storage.readText(manifestKey);
|
|
437
479
|
if (!raw) {
|
|
@@ -585,3 +627,26 @@ export class TemplateSourceService {
|
|
|
585
627
|
throw new Error(`Template module path ${declaredModulePath} was not found in the imported release.`);
|
|
586
628
|
}
|
|
587
629
|
}
|
|
630
|
+
function inferContentType(filePath) {
|
|
631
|
+
switch (path.extname(filePath).toLowerCase()) {
|
|
632
|
+
case ".png":
|
|
633
|
+
return "image/png";
|
|
634
|
+
case ".gif":
|
|
635
|
+
return "image/gif";
|
|
636
|
+
case ".jpg":
|
|
637
|
+
case ".jpeg":
|
|
638
|
+
return "image/jpeg";
|
|
639
|
+
case ".webp":
|
|
640
|
+
return "image/webp";
|
|
641
|
+
case ".svg":
|
|
642
|
+
return "image/svg+xml";
|
|
643
|
+
case ".mp4":
|
|
644
|
+
return "video/mp4";
|
|
645
|
+
case ".webm":
|
|
646
|
+
return "video/webm";
|
|
647
|
+
case ".mov":
|
|
648
|
+
return "video/quicktime";
|
|
649
|
+
default:
|
|
650
|
+
return "application/octet-stream";
|
|
651
|
+
}
|
|
652
|
+
}
|