@mevdragon/vidfarm-devcli 0.20.6 → 0.20.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.
Files changed (154) hide show
  1. package/.agents/skills/editor-capabilities/SKILL.md +15 -1
  2. package/.agents/skills/vidfarm-director/SKILL.md +106 -0
  3. package/.agents/skills/vidfarm-director/recipes/find-and-fork-template.md +16 -0
  4. package/.agents/skills/vidfarm-director/recipes/local-edit-render-approve.md +13 -0
  5. package/.agents/skills/vidfarm-director/recipes/onboard-a-new-director.md +13 -0
  6. package/.agents/skills/vidfarm-director/recipes/retheme-template.md +17 -0
  7. package/.agents/skills/vidfarm-director/references/assets-and-sourcing.md +111 -0
  8. package/.agents/skills/vidfarm-director/references/automation-and-local-dev.md +243 -0
  9. package/.agents/skills/vidfarm-director/references/core-workflows.md +273 -0
  10. package/.agents/skills/vidfarm-director/references/editor-workflows.md +365 -0
  11. package/.agents/skills/vidfarm-director/references/onboarding.md +28 -0
  12. package/.agents/skills/vidfarm-director/references/primitives.md +265 -0
  13. package/SKILL.director.md +476 -260
  14. package/dist/src/cli.js +362 -96
  15. package/dist/src/devcli/clips.js +15 -10
  16. package/dist/src/devcli/doctor.js +2 -2
  17. package/dist/src/devcli/local-backend.js +46 -2
  18. package/dist/src/services/clip-curation/cost.js +5 -1
  19. package/dist/src/services/clip-curation/gemini.js +10 -0
  20. package/package.json +30 -10
  21. package/SKILL.platform.md +0 -432
  22. package/demo/README.md +0 -28
  23. package/demo/dist/app.css +0 -1
  24. package/demo/dist/app.js +0 -1850
  25. package/demo/dist/chunks/chunk-DXB73IDG.js +0 -1
  26. package/demo/dist/chunks/chunk-S7OWAJDS.js +0 -36
  27. package/demo/dist/chunks/chunk-VTIBZ6AN.js +0 -1
  28. package/demo/dist/chunks/dist-ADSJKBVE.js +0 -332
  29. package/demo/dist/chunks/domEditingLayers-VZMLL4AP-SGHWPND4.js +0 -1
  30. package/demo/dist/chunks/hyperframes-player-XB65TCD6.js +0 -425
  31. package/demo/dist/chunks/lib-XAQ37YOE.js +0 -1
  32. package/demo/dist/chunks/src-TJ2QYA4U.js +0 -207
  33. package/demo/dist/favicon.ico +0 -0
  34. package/demo/dist/icons/timeline/audio.svg +0 -7
  35. package/demo/dist/icons/timeline/captions.svg +0 -5
  36. package/demo/dist/icons/timeline/composition.svg +0 -12
  37. package/demo/dist/icons/timeline/image.svg +0 -18
  38. package/demo/dist/icons/timeline/music.svg +0 -10
  39. package/demo/dist/icons/timeline/text.svg +0 -3
  40. package/demo/dist/index.html +0 -15
  41. package/dist/src/account-pages-legacy.js +0 -9396
  42. package/dist/src/account-pages.js +0 -61
  43. package/dist/src/app.js +0 -21603
  44. package/dist/src/composition-runtime.js +0 -1053
  45. package/dist/src/config.js +0 -217
  46. package/dist/src/context.js +0 -447
  47. package/dist/src/dev-app-legacy.js +0 -739
  48. package/dist/src/dev-app.js +0 -6
  49. package/dist/src/devcli/migrate-local.js +0 -140
  50. package/dist/src/devcli/sync.js +0 -368
  51. package/dist/src/domain.js +0 -5
  52. package/dist/src/editor-chat-history.js +0 -82
  53. package/dist/src/editor-chat.js +0 -828
  54. package/dist/src/editor-dark-theme.js +0 -1128
  55. package/dist/src/frontend/debug.js +0 -71
  56. package/dist/src/frontend/discover-client.js +0 -130
  57. package/dist/src/frontend/discover-store.js +0 -23
  58. package/dist/src/frontend/file-directory.js +0 -1018
  59. package/dist/src/frontend/flockposter-cache-store.js +0 -124
  60. package/dist/src/frontend/homepage-client.js +0 -446
  61. package/dist/src/frontend/homepage-shared.js +0 -201
  62. package/dist/src/frontend/homepage-store.js +0 -66
  63. package/dist/src/frontend/homepage-view.js +0 -705
  64. package/dist/src/frontend/page-runtime-client.js +0 -132
  65. package/dist/src/frontend/page-runtime-store.js +0 -9
  66. package/dist/src/frontend/sentry.js +0 -42
  67. package/dist/src/frontend/template-editor-chat.js +0 -4181
  68. package/dist/src/help-page.js +0 -346
  69. package/dist/src/homepage.js +0 -1458
  70. package/dist/src/index.js +0 -16
  71. package/dist/src/instrument.js +0 -30
  72. package/dist/src/landing-page.js +0 -384
  73. package/dist/src/page-runtime.js +0 -2
  74. package/dist/src/page-shell.js +0 -1452
  75. package/dist/src/primitive-context.js +0 -416
  76. package/dist/src/primitive-registry.js +0 -3940
  77. package/dist/src/primitive-sdk.js +0 -4
  78. package/dist/src/primitives/hyperframes-media.js +0 -108
  79. package/dist/src/react-page-shell.js +0 -35
  80. package/dist/src/ready-post-schedule-component.js +0 -1540
  81. package/dist/src/registry.js +0 -296
  82. package/dist/src/reskin/agency-page.js +0 -299
  83. package/dist/src/reskin/calendar-page.js +0 -568
  84. package/dist/src/reskin/chat-page.js +0 -942
  85. package/dist/src/reskin/discover-page.js +0 -1788
  86. package/dist/src/reskin/document.js +0 -1587
  87. package/dist/src/reskin/help-page.js +0 -357
  88. package/dist/src/reskin/index-page.js +0 -62
  89. package/dist/src/reskin/inpaint-clipper-page.js +0 -890
  90. package/dist/src/reskin/inpaint-page.js +0 -2554
  91. package/dist/src/reskin/inpaint-video-page.js +0 -1339
  92. package/dist/src/reskin/job-runs-page.js +0 -477
  93. package/dist/src/reskin/library-page.js +0 -1634
  94. package/dist/src/reskin/login-page.js +0 -262
  95. package/dist/src/reskin/portfolio-page.js +0 -687
  96. package/dist/src/reskin/pricing-page.js +0 -390
  97. package/dist/src/reskin/settings-page.js +0 -732
  98. package/dist/src/reskin/theme.js +0 -711
  99. package/dist/src/runtime.js +0 -35
  100. package/dist/src/services/api-call-history.js +0 -249
  101. package/dist/src/services/auth.js +0 -152
  102. package/dist/src/services/billing-pricing.js +0 -39
  103. package/dist/src/services/billing.js +0 -241
  104. package/dist/src/services/cast.js +0 -127
  105. package/dist/src/services/chat-threads.js +0 -92
  106. package/dist/src/services/clip-records.js +0 -250
  107. package/dist/src/services/clip-search.js +0 -77
  108. package/dist/src/services/clip-vectors.js +0 -125
  109. package/dist/src/services/composition-sanitize.js +0 -124
  110. package/dist/src/services/composition-watch.js +0 -79
  111. package/dist/src/services/elevenlabs.js +0 -222
  112. package/dist/src/services/file-directory.js +0 -117
  113. package/dist/src/services/fork-access.js +0 -93
  114. package/dist/src/services/fork-manifest.js +0 -42
  115. package/dist/src/services/ghostcut.js +0 -179
  116. package/dist/src/services/hyperframes.js +0 -3654
  117. package/dist/src/services/job-capacity.js +0 -14
  118. package/dist/src/services/job-logs.js +0 -197
  119. package/dist/src/services/jobs.js +0 -136
  120. package/dist/src/services/local-dynamo.js +0 -0
  121. package/dist/src/services/media-processing.js +0 -766
  122. package/dist/src/services/primitive-media-lambda.js +0 -280
  123. package/dist/src/services/providers.js +0 -2748
  124. package/dist/src/services/rate-limits.js +0 -262
  125. package/dist/src/services/scene-annotations.js +0 -32
  126. package/dist/src/services/serverless-auth.js +0 -382
  127. package/dist/src/services/serverless-jobs.js +0 -1084
  128. package/dist/src/services/serverless-provider-keys.js +0 -409
  129. package/dist/src/services/serverless-records.js +0 -1515
  130. package/dist/src/services/serverless-template-configs.js +0 -75
  131. package/dist/src/services/storage.js +0 -461
  132. package/dist/src/services/swipe-customize.js +0 -437
  133. package/dist/src/services/template-certification.js +0 -413
  134. package/dist/src/services/template-loader.js +0 -99
  135. package/dist/src/services/template-runtime-bundles.js +0 -217
  136. package/dist/src/services/template-sources.js +0 -1017
  137. package/dist/src/services/upstream.js +0 -248
  138. package/dist/src/services/video-normalization.js +0 -2
  139. package/dist/src/services/webhooks.js +0 -62
  140. package/dist/src/template-editor-pages.js +0 -2576
  141. package/dist/src/template-editor-shell.js +0 -2893
  142. package/dist/src/template-sdk.js +0 -4
  143. package/dist/src/worker.js +0 -17
  144. package/public/assets/discover-client-app.js +0 -1
  145. package/public/assets/file-directory-app.js +0 -3
  146. package/public/assets/homepage-app.js +0 -54
  147. package/public/assets/homepage-client-app.js +0 -80
  148. package/public/assets/page-runtime-client-app.js +0 -94
  149. package/public/assets/placeholders/scene-placeholder.png +0 -0
  150. package/src/assets/SELLING_AWARENESS_STAGES.md +0 -579
  151. package/src/assets/SELLING_WITH_HOOKS.md +0 -377
  152. package/src/assets/SELLING_WITH_VSLS.md +0 -606
  153. package/src/assets/favicon.ico +0 -0
  154. package/src/assets/logo-vidfarm.png +0 -0
@@ -1,217 +0,0 @@
1
- import { createHash } from "node:crypto";
2
- import { existsSync, mkdirSync, readdirSync, rmSync, statSync, symlinkSync, writeFileSync } from "node:fs";
3
- import os from "node:os";
4
- import path from "node:path";
5
- import { gunzipSync } from "node:zlib";
6
- import { devLog } from "../lib/dev-log.js";
7
- import { loadTemplateFromModule } from "./template-loader.js";
8
- import { StorageService } from "./storage.js";
9
- const storage = new StorageService();
10
- const releaseCache = new Map();
11
- const MAX_EXTRACTED_RUNTIME_RELEASES = 6;
12
- export async function loadTemplateFromRuntimeRelease(release) {
13
- const cacheKey = `${release.id}:${release.commitSha}:${release.runtimeArtifactSha256 ?? "local"}`;
14
- const existing = releaseCache.get(cacheKey);
15
- if (existing) {
16
- return existing;
17
- }
18
- const loadPromise = loadRuntimeReleaseUncached(release);
19
- releaseCache.set(cacheKey, loadPromise);
20
- try {
21
- return await loadPromise;
22
- }
23
- catch (error) {
24
- releaseCache.delete(cacheKey);
25
- throw error;
26
- }
27
- }
28
- async function loadRuntimeReleaseUncached(release) {
29
- if (release.runtimeArtifactKey) {
30
- const checkoutPath = await extractRuntimeArtifact(release);
31
- const modulePath = path.join(checkoutPath, release.runtimeModulePath ?? relativeModulePath(release));
32
- devLog("template_runtime.release.loading", {
33
- release_id: release.id,
34
- template_id: release.templateId,
35
- runtime_artifact_key: release.runtimeArtifactKey,
36
- module_path: modulePath
37
- });
38
- const template = await loadTemplateFromModule(modulePath);
39
- return {
40
- ...template,
41
- skillPath: path.join(checkoutPath, relativeSkillPath(release))
42
- };
43
- }
44
- if (release.modulePath && existsSync(release.modulePath)) {
45
- devLog("template_runtime.release.local_loading", {
46
- release_id: release.id,
47
- template_id: release.templateId,
48
- module_path: release.modulePath
49
- });
50
- const template = await loadTemplateFromModule(release.modulePath);
51
- return {
52
- ...template,
53
- skillPath: release.skillPath
54
- };
55
- }
56
- throw new Error(`Active template release ${release.id} has no runtime artifact and no local module path.`);
57
- }
58
- async function extractRuntimeArtifact(release) {
59
- const root = path.join(os.tmpdir(), "vidfarm-template-releases");
60
- const checkoutPath = path.join(root, `${safePathSegment(release.templateId)}-${safePathSegment(release.commitSha)}`);
61
- const markerPath = path.join(checkoutPath, ".vidfarm-runtime-ready");
62
- if (existsSync(markerPath)) {
63
- return checkoutPath;
64
- }
65
- const archive = await storage.readBuffer(String(release.runtimeArtifactKey));
66
- if (!archive) {
67
- throw new Error(`Runtime template artifact not found: ${release.runtimeArtifactKey}`);
68
- }
69
- const sha256 = createHash("sha256").update(archive).digest("hex");
70
- if (release.runtimeArtifactSha256 && sha256 !== release.runtimeArtifactSha256) {
71
- throw new Error(`Runtime template artifact hash mismatch for ${release.runtimeArtifactKey}.`);
72
- }
73
- try {
74
- extractRuntimeArtifactToPath({ archive, root, checkoutPath, markerPath, release, sha256 });
75
- }
76
- catch (error) {
77
- if (!isNoSpaceError(error)) {
78
- throw error;
79
- }
80
- devLog("template_runtime.release.extract_enospc_retry", {
81
- release_id: release.id,
82
- template_id: release.templateId,
83
- checkout_path: checkoutPath
84
- });
85
- pruneExtractedRuntimeArtifacts(root, checkoutPath, 0);
86
- extractRuntimeArtifactToPath({ archive, root, checkoutPath, markerPath, release, sha256 });
87
- }
88
- return checkoutPath;
89
- }
90
- function extractRuntimeArtifactToPath(input) {
91
- mkdirSync(input.root, { recursive: true });
92
- pruneExtractedRuntimeArtifacts(input.root, input.checkoutPath, MAX_EXTRACTED_RUNTIME_RELEASES);
93
- rmSync(input.checkoutPath, { recursive: true, force: true });
94
- mkdirSync(input.checkoutPath, { recursive: true });
95
- extractTarGzBuffer(input.archive, input.checkoutPath);
96
- linkSharedNodeModules(input.checkoutPath);
97
- writeFileSync(input.markerPath, JSON.stringify({
98
- release_id: input.release.id,
99
- template_id: input.release.templateId,
100
- commit_sha: input.release.commitSha,
101
- runtime_artifact_key: input.release.runtimeArtifactKey,
102
- runtime_artifact_sha256: input.sha256,
103
- extracted_at: new Date().toISOString()
104
- }, null, 2));
105
- devLog("template_runtime.release.extracted", {
106
- release_id: input.release.id,
107
- template_id: input.release.templateId,
108
- checkout_path: input.checkoutPath,
109
- runtime_artifact_key: input.release.runtimeArtifactKey
110
- });
111
- }
112
- function pruneExtractedRuntimeArtifacts(root, keepPath, maxEntries) {
113
- if (!existsSync(root)) {
114
- return;
115
- }
116
- const keep = path.resolve(keepPath);
117
- const entries = readdirSync(root, { withFileTypes: true })
118
- .filter((entry) => entry.isDirectory())
119
- .map((entry) => {
120
- const fullPath = path.join(root, entry.name);
121
- let mtimeMs = 0;
122
- try {
123
- mtimeMs = statSync(fullPath).mtimeMs;
124
- }
125
- catch {
126
- return null;
127
- }
128
- return { fullPath, mtimeMs };
129
- })
130
- .filter((entry) => Boolean(entry))
131
- .filter((entry) => path.resolve(entry.fullPath) !== keep)
132
- .sort((a, b) => b.mtimeMs - a.mtimeMs);
133
- const stale = maxEntries <= 0 ? entries : entries.slice(Math.max(0, maxEntries - 1));
134
- for (const entry of stale) {
135
- rmSync(entry.fullPath, { recursive: true, force: true });
136
- }
137
- }
138
- function isNoSpaceError(error) {
139
- return Boolean(error && typeof error === "object" && "code" in error && error.code === "ENOSPC");
140
- }
141
- function linkSharedNodeModules(checkoutPath) {
142
- const target = path.resolve(process.env.LAMBDA_TASK_ROOT ?? process.cwd(), "node_modules");
143
- const linkPath = path.join(checkoutPath, "node_modules");
144
- if (!existsSync(target) || existsSync(linkPath)) {
145
- return;
146
- }
147
- symlinkSync(target, linkPath, "dir");
148
- }
149
- function relativeModulePath(release) {
150
- if (release.runtimeModulePath) {
151
- return release.runtimeModulePath;
152
- }
153
- return path.relative(release.checkoutPath, release.modulePath).split(path.sep).join("/");
154
- }
155
- function relativeSkillPath(release) {
156
- return path.relative(release.checkoutPath, release.skillPath).split(path.sep).join("/");
157
- }
158
- function safePathSegment(value) {
159
- return value.replace(/[^a-zA-Z0-9._-]/g, "_").slice(0, 180);
160
- }
161
- function extractTarGzBuffer(archive, outputDir) {
162
- const tar = gunzipSync(archive);
163
- let offset = 0;
164
- while (offset + 512 <= tar.length) {
165
- const header = tar.subarray(offset, offset + 512);
166
- offset += 512;
167
- if (header.every((byte) => byte === 0)) {
168
- break;
169
- }
170
- const name = readTarString(header, 0, 100);
171
- const prefix = readTarString(header, 345, 155);
172
- const fullName = [prefix, name].filter(Boolean).join("/");
173
- const size = Number.parseInt(readTarString(header, 124, 12).trim() || "0", 8) || 0;
174
- const typeFlag = readTarString(header, 156, 1) || "0";
175
- const body = tar.subarray(offset, offset + size);
176
- offset += Math.ceil(size / 512) * 512;
177
- if (!fullName || fullName === "." || typeFlag === "x" || typeFlag === "g") {
178
- continue;
179
- }
180
- const outputPath = resolveTarOutputPath(outputDir, fullName);
181
- if (!outputPath) {
182
- continue;
183
- }
184
- if (typeFlag === "5") {
185
- mkdirSync(outputPath, { recursive: true });
186
- continue;
187
- }
188
- if (typeFlag === "2") {
189
- continue;
190
- }
191
- if (typeFlag !== "0" && typeFlag !== "") {
192
- continue;
193
- }
194
- mkdirSync(path.dirname(outputPath), { recursive: true });
195
- writeFileSync(outputPath, body);
196
- }
197
- }
198
- function readTarString(buffer, offset, length) {
199
- return buffer
200
- .subarray(offset, offset + length)
201
- .toString("utf8")
202
- .replace(/\0.*$/s, "")
203
- .trim();
204
- }
205
- function resolveTarOutputPath(outputDir, entryName) {
206
- const normalized = entryName.replace(/^\.\/+/, "");
207
- if (!normalized || normalized.startsWith("/") || normalized.includes("..")) {
208
- return null;
209
- }
210
- const root = path.resolve(outputDir);
211
- const outputPath = path.resolve(root, normalized);
212
- if (outputPath !== root && !outputPath.startsWith(`${root}${path.sep}`)) {
213
- return null;
214
- }
215
- return outputPath;
216
- }
217
- //# sourceMappingURL=template-runtime-bundles.js.map