@mevdragon/vidfarm-devcli 0.20.6 → 0.20.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.
Files changed (157) 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 +117 -0
  8. package/.agents/skills/vidfarm-director/references/automation-and-local-dev.md +245 -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 +308 -0
  13. package/SKILL.director.md +517 -250
  14. package/dist/src/cli.js +563 -99
  15. package/dist/src/devcli/clips.js +29 -12
  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 +14 -2
  20. package/dist/src/services/clip-curation/hunt.js +56 -0
  21. package/dist/src/services/clip-curation/index.js +1 -1
  22. package/dist/src/services/clip-curation/scan.js +5 -3
  23. package/package.json +30 -10
  24. package/SKILL.platform.md +0 -432
  25. package/demo/README.md +0 -28
  26. package/demo/dist/app.css +0 -1
  27. package/demo/dist/app.js +0 -1850
  28. package/demo/dist/chunks/chunk-DXB73IDG.js +0 -1
  29. package/demo/dist/chunks/chunk-S7OWAJDS.js +0 -36
  30. package/demo/dist/chunks/chunk-VTIBZ6AN.js +0 -1
  31. package/demo/dist/chunks/dist-ADSJKBVE.js +0 -332
  32. package/demo/dist/chunks/domEditingLayers-VZMLL4AP-SGHWPND4.js +0 -1
  33. package/demo/dist/chunks/hyperframes-player-XB65TCD6.js +0 -425
  34. package/demo/dist/chunks/lib-XAQ37YOE.js +0 -1
  35. package/demo/dist/chunks/src-TJ2QYA4U.js +0 -207
  36. package/demo/dist/favicon.ico +0 -0
  37. package/demo/dist/icons/timeline/audio.svg +0 -7
  38. package/demo/dist/icons/timeline/captions.svg +0 -5
  39. package/demo/dist/icons/timeline/composition.svg +0 -12
  40. package/demo/dist/icons/timeline/image.svg +0 -18
  41. package/demo/dist/icons/timeline/music.svg +0 -10
  42. package/demo/dist/icons/timeline/text.svg +0 -3
  43. package/demo/dist/index.html +0 -15
  44. package/dist/src/account-pages-legacy.js +0 -9396
  45. package/dist/src/account-pages.js +0 -61
  46. package/dist/src/app.js +0 -21603
  47. package/dist/src/composition-runtime.js +0 -1053
  48. package/dist/src/config.js +0 -217
  49. package/dist/src/context.js +0 -447
  50. package/dist/src/dev-app-legacy.js +0 -739
  51. package/dist/src/dev-app.js +0 -6
  52. package/dist/src/devcli/migrate-local.js +0 -140
  53. package/dist/src/devcli/sync.js +0 -368
  54. package/dist/src/domain.js +0 -5
  55. package/dist/src/editor-chat-history.js +0 -82
  56. package/dist/src/editor-chat.js +0 -828
  57. package/dist/src/editor-dark-theme.js +0 -1128
  58. package/dist/src/frontend/debug.js +0 -71
  59. package/dist/src/frontend/discover-client.js +0 -130
  60. package/dist/src/frontend/discover-store.js +0 -23
  61. package/dist/src/frontend/file-directory.js +0 -1018
  62. package/dist/src/frontend/flockposter-cache-store.js +0 -124
  63. package/dist/src/frontend/homepage-client.js +0 -446
  64. package/dist/src/frontend/homepage-shared.js +0 -201
  65. package/dist/src/frontend/homepage-store.js +0 -66
  66. package/dist/src/frontend/homepage-view.js +0 -705
  67. package/dist/src/frontend/page-runtime-client.js +0 -132
  68. package/dist/src/frontend/page-runtime-store.js +0 -9
  69. package/dist/src/frontend/sentry.js +0 -42
  70. package/dist/src/frontend/template-editor-chat.js +0 -4181
  71. package/dist/src/help-page.js +0 -346
  72. package/dist/src/homepage.js +0 -1458
  73. package/dist/src/index.js +0 -16
  74. package/dist/src/instrument.js +0 -30
  75. package/dist/src/landing-page.js +0 -384
  76. package/dist/src/page-runtime.js +0 -2
  77. package/dist/src/page-shell.js +0 -1452
  78. package/dist/src/primitive-context.js +0 -416
  79. package/dist/src/primitive-registry.js +0 -3940
  80. package/dist/src/primitive-sdk.js +0 -4
  81. package/dist/src/primitives/hyperframes-media.js +0 -108
  82. package/dist/src/react-page-shell.js +0 -35
  83. package/dist/src/ready-post-schedule-component.js +0 -1540
  84. package/dist/src/registry.js +0 -296
  85. package/dist/src/reskin/agency-page.js +0 -299
  86. package/dist/src/reskin/calendar-page.js +0 -568
  87. package/dist/src/reskin/chat-page.js +0 -942
  88. package/dist/src/reskin/discover-page.js +0 -1788
  89. package/dist/src/reskin/document.js +0 -1587
  90. package/dist/src/reskin/help-page.js +0 -357
  91. package/dist/src/reskin/index-page.js +0 -62
  92. package/dist/src/reskin/inpaint-clipper-page.js +0 -890
  93. package/dist/src/reskin/inpaint-page.js +0 -2554
  94. package/dist/src/reskin/inpaint-video-page.js +0 -1339
  95. package/dist/src/reskin/job-runs-page.js +0 -477
  96. package/dist/src/reskin/library-page.js +0 -1634
  97. package/dist/src/reskin/login-page.js +0 -262
  98. package/dist/src/reskin/portfolio-page.js +0 -687
  99. package/dist/src/reskin/pricing-page.js +0 -390
  100. package/dist/src/reskin/settings-page.js +0 -732
  101. package/dist/src/reskin/theme.js +0 -711
  102. package/dist/src/runtime.js +0 -35
  103. package/dist/src/services/api-call-history.js +0 -249
  104. package/dist/src/services/auth.js +0 -152
  105. package/dist/src/services/billing-pricing.js +0 -39
  106. package/dist/src/services/billing.js +0 -241
  107. package/dist/src/services/cast.js +0 -127
  108. package/dist/src/services/chat-threads.js +0 -92
  109. package/dist/src/services/clip-records.js +0 -250
  110. package/dist/src/services/clip-search.js +0 -77
  111. package/dist/src/services/clip-vectors.js +0 -125
  112. package/dist/src/services/composition-sanitize.js +0 -124
  113. package/dist/src/services/composition-watch.js +0 -79
  114. package/dist/src/services/elevenlabs.js +0 -222
  115. package/dist/src/services/file-directory.js +0 -117
  116. package/dist/src/services/fork-access.js +0 -93
  117. package/dist/src/services/fork-manifest.js +0 -42
  118. package/dist/src/services/ghostcut.js +0 -179
  119. package/dist/src/services/hyperframes.js +0 -3654
  120. package/dist/src/services/job-capacity.js +0 -14
  121. package/dist/src/services/job-logs.js +0 -197
  122. package/dist/src/services/jobs.js +0 -136
  123. package/dist/src/services/local-dynamo.js +0 -0
  124. package/dist/src/services/media-processing.js +0 -766
  125. package/dist/src/services/primitive-media-lambda.js +0 -280
  126. package/dist/src/services/providers.js +0 -2748
  127. package/dist/src/services/rate-limits.js +0 -262
  128. package/dist/src/services/scene-annotations.js +0 -32
  129. package/dist/src/services/serverless-auth.js +0 -382
  130. package/dist/src/services/serverless-jobs.js +0 -1084
  131. package/dist/src/services/serverless-provider-keys.js +0 -409
  132. package/dist/src/services/serverless-records.js +0 -1515
  133. package/dist/src/services/serverless-template-configs.js +0 -75
  134. package/dist/src/services/storage.js +0 -461
  135. package/dist/src/services/swipe-customize.js +0 -437
  136. package/dist/src/services/template-certification.js +0 -413
  137. package/dist/src/services/template-loader.js +0 -99
  138. package/dist/src/services/template-runtime-bundles.js +0 -217
  139. package/dist/src/services/template-sources.js +0 -1017
  140. package/dist/src/services/upstream.js +0 -248
  141. package/dist/src/services/video-normalization.js +0 -2
  142. package/dist/src/services/webhooks.js +0 -62
  143. package/dist/src/template-editor-pages.js +0 -2576
  144. package/dist/src/template-editor-shell.js +0 -2893
  145. package/dist/src/template-sdk.js +0 -4
  146. package/dist/src/worker.js +0 -17
  147. package/public/assets/discover-client-app.js +0 -1
  148. package/public/assets/file-directory-app.js +0 -3
  149. package/public/assets/homepage-app.js +0 -54
  150. package/public/assets/homepage-client-app.js +0 -80
  151. package/public/assets/page-runtime-client-app.js +0 -94
  152. package/public/assets/placeholders/scene-placeholder.png +0 -0
  153. package/src/assets/SELLING_AWARENESS_STAGES.md +0 -579
  154. package/src/assets/SELLING_WITH_HOOKS.md +0 -377
  155. package/src/assets/SELLING_WITH_VSLS.md +0 -606
  156. package/src/assets/favicon.ico +0 -0
  157. 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