@vibeframe/mcp-server 0.115.8 → 0.115.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/dist/dotlottie/dotlottie-player.wasm +0 -0
- package/dist/dotlottie/index.js +6 -0
- package/dist/index.js +352 -323
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3388,7 +3388,7 @@ async function loadBundledKokoroRuntime(runtimeDir = process.env.VIBE_KOKORO_RUN
|
|
|
3388
3388
|
if (!base2)
|
|
3389
3389
|
return null;
|
|
3390
3390
|
try {
|
|
3391
|
-
const { readFile: readFile49, writeFile: writeFile49, mkdir:
|
|
3391
|
+
const { readFile: readFile49, writeFile: writeFile49, mkdir: mkdir34 } = await import("node:fs/promises");
|
|
3392
3392
|
const { join: join80, resolve: resolve83 } = await import("node:path");
|
|
3393
3393
|
const { pathToFileURL: pathToFileURL2 } = await import("node:url");
|
|
3394
3394
|
const { homedir: homedir8 } = await import("node:os");
|
|
@@ -3409,7 +3409,7 @@ async function loadBundledKokoroRuntime(runtimeDir = process.env.VIBE_KOKORO_RUN
|
|
|
3409
3409
|
async put(key2, response) {
|
|
3410
3410
|
try {
|
|
3411
3411
|
const buf = Buffer.from(await response.arrayBuffer());
|
|
3412
|
-
await
|
|
3412
|
+
await mkdir34(cacheRoot, { recursive: true });
|
|
3413
3413
|
await writeFile49(join80(cacheRoot, encodeURIComponent(String(key2))), buf);
|
|
3414
3414
|
} catch {
|
|
3415
3415
|
}
|
|
@@ -30224,6 +30224,81 @@ var init_cost_tier = __esm({
|
|
|
30224
30224
|
}
|
|
30225
30225
|
});
|
|
30226
30226
|
|
|
30227
|
+
// ../cli/src/commands/_shared/lottie.ts
|
|
30228
|
+
import { existsSync as existsSync5 } from "node:fs";
|
|
30229
|
+
import { copyFile as copyFile2, mkdir as mkdir7, readFile as readFile8 } from "node:fs/promises";
|
|
30230
|
+
import { createRequire } from "node:module";
|
|
30231
|
+
import { basename as basename3, join as join5 } from "node:path";
|
|
30232
|
+
import { fileURLToPath } from "node:url";
|
|
30233
|
+
async function checkLottieAsset(path15) {
|
|
30234
|
+
const bytes = await readFile8(path15);
|
|
30235
|
+
const isZip = bytes.length > 4 && bytes[0] === 80 && bytes[1] === 75;
|
|
30236
|
+
if (isZip) return void 0;
|
|
30237
|
+
try {
|
|
30238
|
+
const json = JSON.parse(bytes.toString("utf-8"));
|
|
30239
|
+
if (Array.isArray(json.layers)) return void 0;
|
|
30240
|
+
} catch {
|
|
30241
|
+
}
|
|
30242
|
+
return `${basename3(path15)} is not a Lottie animation (expected Lottie JSON or a .lottie archive).`;
|
|
30243
|
+
}
|
|
30244
|
+
function overlayBox(layer, position, scale) {
|
|
30245
|
+
if (position === "full") return { left: 0, top: 0, width: layer.width, height: layer.height };
|
|
30246
|
+
const width = Math.max(1, Math.round(layer.width * scale));
|
|
30247
|
+
const height = Math.max(1, Math.round(layer.height * scale));
|
|
30248
|
+
const marginX = Math.round(layer.width * 0.04);
|
|
30249
|
+
const marginY = Math.round(layer.height * 0.04);
|
|
30250
|
+
const left3 = position === "center" ? Math.round((layer.width - width) / 2) : position.endsWith("left") ? marginX : layer.width - marginX - width;
|
|
30251
|
+
const top3 = position === "center" ? Math.round((layer.height - height) / 2) : position.startsWith("top") ? marginY : layer.height - marginY - height;
|
|
30252
|
+
return { left: left3, top: top3, width, height };
|
|
30253
|
+
}
|
|
30254
|
+
function dotLottieDist() {
|
|
30255
|
+
try {
|
|
30256
|
+
return join5(createRequire(import.meta.url).resolve("@lottiefiles/dotlottie-web"), "..");
|
|
30257
|
+
} catch {
|
|
30258
|
+
const bundled = fileURLToPath(new URL(`./${BUNDLED_DOTLOTTIE_DIR}/`, import.meta.url));
|
|
30259
|
+
if (existsSync5(join5(bundled, DOTLOTTIE_WASM))) return bundled;
|
|
30260
|
+
throw new Error("The dotLottie runtime (@lottiefiles/dotlottie-web) is not installed. Reinstall VibeFrame.");
|
|
30261
|
+
}
|
|
30262
|
+
}
|
|
30263
|
+
async function copyDotLottieRuntime(dir) {
|
|
30264
|
+
const dist = dotLottieDist();
|
|
30265
|
+
await mkdir7(dir, { recursive: true });
|
|
30266
|
+
await copyFile2(join5(dist, "index.js"), join5(dir, DOTLOTTIE_SCRIPT));
|
|
30267
|
+
await copyFile2(join5(dist, DOTLOTTIE_WASM), join5(dir, DOTLOTTIE_WASM));
|
|
30268
|
+
}
|
|
30269
|
+
var LOTTIE_POSITIONS, DOTLOTTIE_SCRIPT, DOTLOTTIE_WASM, BUNDLED_DOTLOTTIE_DIR, DOTLOTTIE_BROWSER_HELPERS;
|
|
30270
|
+
var init_lottie = __esm({
|
|
30271
|
+
"../cli/src/commands/_shared/lottie.ts"() {
|
|
30272
|
+
"use strict";
|
|
30273
|
+
LOTTIE_POSITIONS = [
|
|
30274
|
+
"full",
|
|
30275
|
+
"center",
|
|
30276
|
+
"top-left",
|
|
30277
|
+
"top-right",
|
|
30278
|
+
"bottom-left",
|
|
30279
|
+
"bottom-right"
|
|
30280
|
+
];
|
|
30281
|
+
DOTLOTTIE_SCRIPT = "dotlottie-web.js";
|
|
30282
|
+
DOTLOTTIE_WASM = "dotlottie-player.wasm";
|
|
30283
|
+
BUNDLED_DOTLOTTIE_DIR = "dotlottie";
|
|
30284
|
+
DOTLOTTIE_BROWSER_HELPERS = `async function loadDotLottie(vendorDir) {
|
|
30285
|
+
const url = (file) => new URL(vendorDir + "/" + file, document.baseURI).href;
|
|
30286
|
+
const { DotLottie } = await import(url("${DOTLOTTIE_SCRIPT}"));
|
|
30287
|
+
const wasm = await (await fetch(url("${DOTLOTTIE_WASM}"))).arrayBuffer();
|
|
30288
|
+
DotLottie.setWasmUrl(URL.createObjectURL(new Blob([wasm], { type: "application/wasm" })));
|
|
30289
|
+
return DotLottie;
|
|
30290
|
+
}
|
|
30291
|
+
function setLottieTime(player, t, loop) {
|
|
30292
|
+
const length = player.duration;
|
|
30293
|
+
const frames = player.totalFrames;
|
|
30294
|
+
if (!(length > 0) || !(frames > 0)) return;
|
|
30295
|
+
const local = Math.max(0, Number(t) || 0);
|
|
30296
|
+
const at = loop ? local % length : Math.min(local, length);
|
|
30297
|
+
player.setFrame(Math.min(frames - 1, (at / length) * frames));
|
|
30298
|
+
}`;
|
|
30299
|
+
}
|
|
30300
|
+
});
|
|
30301
|
+
|
|
30227
30302
|
// ../../node_modules/.pnpm/esbuild@0.24.2/node_modules/esbuild/lib/main.js
|
|
30228
30303
|
var require_main2 = __commonJS({
|
|
30229
30304
|
"../../node_modules/.pnpm/esbuild@0.24.2/node_modules/esbuild/lib/main.js"(exports, module) {
|
|
@@ -36004,7 +36079,7 @@ var require_source_map = __commonJS({
|
|
|
36004
36079
|
var require_previous_map = __commonJS({
|
|
36005
36080
|
"../../node_modules/.pnpm/postcss@8.5.6/node_modules/postcss/lib/previous-map.js"(exports, module) {
|
|
36006
36081
|
"use strict";
|
|
36007
|
-
var { existsSync:
|
|
36082
|
+
var { existsSync: existsSync88, readFileSync: readFileSync23 } = __require("fs");
|
|
36008
36083
|
var { dirname: dirname39, join: join80 } = __require("path");
|
|
36009
36084
|
var { SourceMapConsumer, SourceMapGenerator } = require_source_map();
|
|
36010
36085
|
function fromBase642(str2) {
|
|
@@ -36067,7 +36142,7 @@ var require_previous_map = __commonJS({
|
|
|
36067
36142
|
}
|
|
36068
36143
|
loadFile(path15) {
|
|
36069
36144
|
this.root = dirname39(path15);
|
|
36070
|
-
if (
|
|
36145
|
+
if (existsSync88(path15)) {
|
|
36071
36146
|
this.mapFile = path15;
|
|
36072
36147
|
return readFileSync23(path15, "utf-8").toString().trim();
|
|
36073
36148
|
}
|
|
@@ -88056,7 +88131,7 @@ var require_yauzl = __commonJS({
|
|
|
88056
88131
|
// ../../node_modules/.pnpm/@puppeteer+browsers@3.0.6_yauzl@2.10.0/node_modules/@puppeteer/browsers/lib/fileUtil.js
|
|
88057
88132
|
import { spawnSync, spawn, execFile } from "node:child_process";
|
|
88058
88133
|
import { constants as constants2, createReadStream, createWriteStream as createWriteStream2 } from "node:fs";
|
|
88059
|
-
import { mkdir as
|
|
88134
|
+
import { mkdir as mkdir9, readdir as readdir4, symlink as symlink2 } from "node:fs/promises";
|
|
88060
88135
|
import * as path9 from "node:path";
|
|
88061
88136
|
import { Stream, Writable as Writable2 } from "node:stream";
|
|
88062
88137
|
import { pipeline } from "node:stream/promises";
|
|
@@ -88066,12 +88141,12 @@ async function unpackArchive(archivePath, folderPath) {
|
|
|
88066
88141
|
folderPath = path9.resolve(process.cwd(), folderPath);
|
|
88067
88142
|
}
|
|
88068
88143
|
if (archivePath.endsWith(".zip")) {
|
|
88069
|
-
await
|
|
88144
|
+
await mkdir9(folderPath, { recursive: true });
|
|
88070
88145
|
await extractZip(archivePath, folderPath);
|
|
88071
88146
|
} else if (archivePath.endsWith(".tar.bz2")) {
|
|
88072
88147
|
await extractTar(archivePath, folderPath, "bzip2");
|
|
88073
88148
|
} else if (archivePath.endsWith(".dmg")) {
|
|
88074
|
-
await
|
|
88149
|
+
await mkdir9(folderPath);
|
|
88075
88150
|
await installDMG(archivePath, folderPath);
|
|
88076
88151
|
} else if (archivePath.endsWith(".exe")) {
|
|
88077
88152
|
const result = spawnSync(archivePath, [`/ExtractDir=${folderPath}`], {
|
|
@@ -88259,10 +88334,10 @@ async function extractZipEntry(zipFile, entry, folderPath) {
|
|
|
88259
88334
|
const mode = unixMode === 0 ? isDirectory2 ? 493 : 420 : unixMode & 511;
|
|
88260
88335
|
const destination = path9.join(folderPath, entry.fileName);
|
|
88261
88336
|
if (isDirectory2) {
|
|
88262
|
-
await
|
|
88337
|
+
await mkdir9(destination, { recursive: true, mode });
|
|
88263
88338
|
return;
|
|
88264
88339
|
}
|
|
88265
|
-
await
|
|
88340
|
+
await mkdir9(path9.dirname(destination), { recursive: true });
|
|
88266
88341
|
const readStream = await promisify(zipFile.openReadStream.bind(zipFile))(entry);
|
|
88267
88342
|
if (isSymlink) {
|
|
88268
88343
|
const chunks = [];
|
|
@@ -88429,8 +88504,8 @@ var init_ProgressBar = __esm({
|
|
|
88429
88504
|
// ../../node_modules/.pnpm/@puppeteer+browsers@3.0.6_yauzl@2.10.0/node_modules/@puppeteer/browsers/lib/install.js
|
|
88430
88505
|
import assert3 from "node:assert";
|
|
88431
88506
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
88432
|
-
import { existsSync as
|
|
88433
|
-
import { mkdir as
|
|
88507
|
+
import { existsSync as existsSync6, readFileSync as readFileSync2 } from "node:fs";
|
|
88508
|
+
import { mkdir as mkdir10, unlink } from "node:fs/promises";
|
|
88434
88509
|
import os6 from "node:os";
|
|
88435
88510
|
import path10 from "node:path";
|
|
88436
88511
|
function debugTime(label) {
|
|
@@ -88482,8 +88557,8 @@ async function installWithProviders(options) {
|
|
|
88482
88557
|
continue;
|
|
88483
88558
|
}
|
|
88484
88559
|
debugInstall?.(`Successfully got URL from ${provider.getName()}: ${url}`);
|
|
88485
|
-
if (!
|
|
88486
|
-
await
|
|
88560
|
+
if (!existsSync6(browserRoot)) {
|
|
88561
|
+
await mkdir10(browserRoot, { recursive: true });
|
|
88487
88562
|
}
|
|
88488
88563
|
return await installUrl(url, options, provider);
|
|
88489
88564
|
} catch (err) {
|
|
@@ -88514,7 +88589,7 @@ async function installDeps(installedBrowser) {
|
|
|
88514
88589
|
return;
|
|
88515
88590
|
}
|
|
88516
88591
|
const depsPath = path10.join(path10.dirname(installedBrowser.executablePath), "deb.deps");
|
|
88517
|
-
if (!
|
|
88592
|
+
if (!existsSync6(depsPath)) {
|
|
88518
88593
|
debugInstall?.(`deb.deps file was not found at ${depsPath}`);
|
|
88519
88594
|
return;
|
|
88520
88595
|
}
|
|
@@ -88555,14 +88630,14 @@ async function installUrl(url, options, provider) {
|
|
|
88555
88630
|
const cache = new Cache(options.cacheDir);
|
|
88556
88631
|
const browserRoot = cache.browserRoot(options.browser);
|
|
88557
88632
|
const archivePath = path10.join(browserRoot, `${options.buildId}-${fileName}`);
|
|
88558
|
-
if (!
|
|
88559
|
-
await
|
|
88633
|
+
if (!existsSync6(browserRoot)) {
|
|
88634
|
+
await mkdir10(browserRoot, { recursive: true });
|
|
88560
88635
|
}
|
|
88561
88636
|
if (options.expectedHash) {
|
|
88562
88637
|
debugInstall?.(`Using provided checksum for ${fileName}: ${options.expectedHash}`);
|
|
88563
88638
|
}
|
|
88564
88639
|
if (!options.unpack) {
|
|
88565
|
-
if (
|
|
88640
|
+
if (existsSync6(archivePath)) {
|
|
88566
88641
|
return archivePath;
|
|
88567
88642
|
}
|
|
88568
88643
|
debugInstall?.(`Downloading binary from ${url}`);
|
|
@@ -88583,8 +88658,8 @@ async function installUrl(url, options, provider) {
|
|
|
88583
88658
|
cache.writeExecutablePath(options.browser, options.platform, options.buildId, relativeExecutablePath7);
|
|
88584
88659
|
}
|
|
88585
88660
|
try {
|
|
88586
|
-
if (
|
|
88587
|
-
if (!
|
|
88661
|
+
if (existsSync6(outputPath)) {
|
|
88662
|
+
if (!existsSync6(installedBrowser.executablePath)) {
|
|
88588
88663
|
throw new Error(`The browser folder (${outputPath}) exists but the executable (${installedBrowser.executablePath}) is missing`);
|
|
88589
88664
|
}
|
|
88590
88665
|
await runSetup(installedBrowser);
|
|
@@ -88593,7 +88668,7 @@ async function installUrl(url, options, provider) {
|
|
|
88593
88668
|
}
|
|
88594
88669
|
return installedBrowser;
|
|
88595
88670
|
}
|
|
88596
|
-
if (!
|
|
88671
|
+
if (!existsSync6(archivePath)) {
|
|
88597
88672
|
debugInstall?.(`Downloading binary from ${url}`);
|
|
88598
88673
|
try {
|
|
88599
88674
|
debugTime("download");
|
|
@@ -88622,7 +88697,7 @@ async function installUrl(url, options, provider) {
|
|
|
88622
88697
|
}
|
|
88623
88698
|
return installedBrowser;
|
|
88624
88699
|
} finally {
|
|
88625
|
-
if (
|
|
88700
|
+
if (existsSync6(archivePath)) {
|
|
88626
88701
|
await unlink(archivePath);
|
|
88627
88702
|
}
|
|
88628
88703
|
}
|
|
@@ -88633,7 +88708,7 @@ async function runSetup(installedBrowser) {
|
|
|
88633
88708
|
debugTime("permissions");
|
|
88634
88709
|
const browserDir = path10.dirname(installedBrowser.executablePath);
|
|
88635
88710
|
const setupExePath = path10.join(browserDir, "setup.exe");
|
|
88636
|
-
if (!
|
|
88711
|
+
if (!existsSync6(setupExePath)) {
|
|
88637
88712
|
return;
|
|
88638
88713
|
}
|
|
88639
88714
|
spawnSync2(path10.join(browserDir, "setup.exe"), [`--configure-browser-in-directory=` + browserDir], {
|
|
@@ -90325,7 +90400,7 @@ var init_yargs_parser = __esm({
|
|
|
90325
90400
|
import { format } from "util";
|
|
90326
90401
|
import { normalize, resolve as resolve12 } from "path";
|
|
90327
90402
|
import { readFileSync as readFileSync3 } from "fs";
|
|
90328
|
-
import { createRequire } from "node:module";
|
|
90403
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
90329
90404
|
var _a9, _b, _c, minNodeVersion, nodeVersion, env2, require2, parser, yargsParser, lib_default;
|
|
90330
90405
|
var init_lib3 = __esm({
|
|
90331
90406
|
"../../node_modules/.pnpm/yargs-parser@22.0.0/node_modules/yargs-parser/build/lib/index.js"() {
|
|
@@ -90340,7 +90415,7 @@ var init_lib3 = __esm({
|
|
|
90340
90415
|
}
|
|
90341
90416
|
}
|
|
90342
90417
|
env2 = process ? process.env : {};
|
|
90343
|
-
require2 =
|
|
90418
|
+
require2 = createRequire2 ? createRequire2(import.meta.url) : void 0;
|
|
90344
90419
|
parser = new YargsParser({
|
|
90345
90420
|
cwd: process.cwd,
|
|
90346
90421
|
env: () => {
|
|
@@ -90626,9 +90701,9 @@ var require_get_caller_file = __commonJS({
|
|
|
90626
90701
|
// ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/lib/platform-shims/esm.mjs
|
|
90627
90702
|
import { notStrictEqual, strictEqual } from "assert";
|
|
90628
90703
|
import { inspect } from "util";
|
|
90629
|
-
import { fileURLToPath } from "url";
|
|
90630
|
-
import { basename as
|
|
90631
|
-
import { createRequire as
|
|
90704
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
90705
|
+
import { basename as basename5, dirname as dirname8, extname as extname2, relative as relative3, resolve as resolve14, join as join8 } from "path";
|
|
90706
|
+
import { createRequire as createRequire3 } from "node:module";
|
|
90632
90707
|
import { readFileSync as readFileSync5, readdirSync as readdirSync2 } from "node:fs";
|
|
90633
90708
|
var import_get_caller_file, __dirname2, mainFilename, require3, esm_default;
|
|
90634
90709
|
var init_esm2 = __esm({
|
|
@@ -90641,9 +90716,9 @@ var init_esm2 = __esm({
|
|
|
90641
90716
|
init_string_width();
|
|
90642
90717
|
init_y18n();
|
|
90643
90718
|
import_get_caller_file = __toESM(require_get_caller_file(), 1);
|
|
90644
|
-
__dirname2 =
|
|
90719
|
+
__dirname2 = fileURLToPath2(import.meta.url);
|
|
90645
90720
|
mainFilename = __dirname2.substring(0, __dirname2.lastIndexOf("node_modules"));
|
|
90646
|
-
require3 =
|
|
90721
|
+
require3 = createRequire3(import.meta.url);
|
|
90647
90722
|
esm_default = {
|
|
90648
90723
|
assert: {
|
|
90649
90724
|
notStrictEqual,
|
|
@@ -90659,12 +90734,12 @@ var init_esm2 = __esm({
|
|
|
90659
90734
|
mainFilename: mainFilename || process.cwd(),
|
|
90660
90735
|
Parser: lib_default,
|
|
90661
90736
|
path: {
|
|
90662
|
-
basename:
|
|
90737
|
+
basename: basename5,
|
|
90663
90738
|
dirname: dirname8,
|
|
90664
90739
|
extname: extname2,
|
|
90665
90740
|
relative: relative3,
|
|
90666
90741
|
resolve: resolve14,
|
|
90667
|
-
join:
|
|
90742
|
+
join: join8
|
|
90668
90743
|
},
|
|
90669
90744
|
process: {
|
|
90670
90745
|
argv: () => process.argv,
|
|
@@ -90682,7 +90757,7 @@ var init_esm2 = __esm({
|
|
|
90682
90757
|
require: require3,
|
|
90683
90758
|
getCallerFile: () => {
|
|
90684
90759
|
const callerFile = (0, import_get_caller_file.default)(3);
|
|
90685
|
-
return callerFile.match(/^file:\/\//) ?
|
|
90760
|
+
return callerFile.match(/^file:\/\//) ? fileURLToPath2(callerFile) : callerFile;
|
|
90686
90761
|
},
|
|
90687
90762
|
stringWidth,
|
|
90688
90763
|
y18n: y18n_default({
|
|
@@ -94914,9 +94989,9 @@ var init_PipeTransport = __esm({
|
|
|
94914
94989
|
});
|
|
94915
94990
|
|
|
94916
94991
|
// ../../node_modules/.pnpm/puppeteer-core@25.3.0_yauzl@2.10.0/node_modules/puppeteer-core/lib/puppeteer/node/BrowserLauncher.js
|
|
94917
|
-
import { existsSync as
|
|
94992
|
+
import { existsSync as existsSync7 } from "node:fs";
|
|
94918
94993
|
import { tmpdir } from "node:os";
|
|
94919
|
-
import { join as
|
|
94994
|
+
import { join as join9 } from "node:path";
|
|
94920
94995
|
function getBrowserTypeDisplayName(browserType) {
|
|
94921
94996
|
switch (browserType) {
|
|
94922
94997
|
case Browser3.FIREFOX:
|
|
@@ -94973,7 +95048,7 @@ var init_BrowserLauncher = __esm({
|
|
|
94973
95048
|
...options,
|
|
94974
95049
|
protocol
|
|
94975
95050
|
});
|
|
94976
|
-
if (!
|
|
95051
|
+
if (!existsSync7(launchArgs.executablePath)) {
|
|
94977
95052
|
throw new Error(`Browser was not found at the configured executablePath (${launchArgs.executablePath})`);
|
|
94978
95053
|
}
|
|
94979
95054
|
const usePipe = launchArgs.args.includes("--remote-debugging-pipe");
|
|
@@ -95050,7 +95125,7 @@ var init_BrowserLauncher = __esm({
|
|
|
95050
95125
|
const logs = browserProcess.getRecentLogs().join("\n");
|
|
95051
95126
|
if (logs.includes("Failed to create a ProcessSingleton for your profile directory") || // On Windows we will not get logs due to the singleton process handover. See
|
|
95052
95127
|
// https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/process_singleton_win.cc;l=46;drc=fc7952f0422b5073515a205a04ec9c3a1ae81658
|
|
95053
|
-
process.platform === "win32" &&
|
|
95128
|
+
process.platform === "win32" && existsSync7(join9(launchArgs.userDataDir, "lockfile"))) {
|
|
95054
95129
|
throw new Error(`The browser is already running for ${launchArgs.userDataDir}. Use a different \`userDataDir\` or stop the running browser first.`);
|
|
95055
95130
|
}
|
|
95056
95131
|
if (logs.includes("Missing X server") && options.headless === false) {
|
|
@@ -95181,7 +95256,7 @@ var init_BrowserLauncher = __esm({
|
|
|
95181
95256
|
*/
|
|
95182
95257
|
async getProfilePath() {
|
|
95183
95258
|
const config4 = await this.puppeteer.configuration();
|
|
95184
|
-
return
|
|
95259
|
+
return join9(config4.temporaryDirectory ?? tmpdir(), `puppeteer_dev_${this.browser}_profile-`);
|
|
95185
95260
|
}
|
|
95186
95261
|
/**
|
|
95187
95262
|
* @internal
|
|
@@ -95190,7 +95265,7 @@ var init_BrowserLauncher = __esm({
|
|
|
95190
95265
|
const config4 = await this.puppeteer.configuration();
|
|
95191
95266
|
let executablePath4 = config4.executablePath;
|
|
95192
95267
|
if (executablePath4) {
|
|
95193
|
-
if (validatePath && !
|
|
95268
|
+
if (validatePath && !existsSync7(executablePath4)) {
|
|
95194
95269
|
throw new Error(`Tried to find the browser at the configured path (${executablePath4}), but no executable was found.`);
|
|
95195
95270
|
}
|
|
95196
95271
|
return executablePath4;
|
|
@@ -95215,7 +95290,7 @@ var init_BrowserLauncher = __esm({
|
|
|
95215
95290
|
browser: browserType,
|
|
95216
95291
|
buildId: browserVersion
|
|
95217
95292
|
});
|
|
95218
|
-
if (validatePath && !
|
|
95293
|
+
if (validatePath && !existsSync7(executablePath4)) {
|
|
95219
95294
|
const configVersion = config4?.[this.browser]?.version;
|
|
95220
95295
|
if (configVersion) {
|
|
95221
95296
|
throw new Error(`Tried to find the browser at the configured path (${executablePath4}) for version ${configVersion}, but no executable was found.`);
|
|
@@ -96586,7 +96661,7 @@ var require_src2 = __commonJS({
|
|
|
96586
96661
|
|
|
96587
96662
|
// ../../node_modules/.pnpm/puppeteer@25.3.0_yauzl@2.10.0/node_modules/puppeteer/lib/puppeteer/getConfiguration.js
|
|
96588
96663
|
import { homedir as homedir3 } from "node:os";
|
|
96589
|
-
import { join as
|
|
96664
|
+
import { join as join10 } from "node:path";
|
|
96590
96665
|
function getBooleanEnvVar(name) {
|
|
96591
96666
|
const env4 = process.env[name];
|
|
96592
96667
|
if (env4 === void 0) {
|
|
@@ -96673,7 +96748,7 @@ var init_getConfiguration = __esm({
|
|
|
96673
96748
|
configuration.firefox = getBrowserSetting("firefox", configuration, {
|
|
96674
96749
|
skipDownload: true
|
|
96675
96750
|
});
|
|
96676
|
-
configuration.cacheDirectory = process.env["PUPPETEER_CACHE_DIR"] ?? configuration.cacheDirectory ??
|
|
96751
|
+
configuration.cacheDirectory = process.env["PUPPETEER_CACHE_DIR"] ?? configuration.cacheDirectory ?? join10(homedir3(), ".cache", "puppeteer");
|
|
96677
96752
|
configuration.temporaryDirectory = process.env["PUPPETEER_TMP_DIR"] ?? configuration.temporaryDirectory;
|
|
96678
96753
|
configuration.experiments ??= {};
|
|
96679
96754
|
return configuration;
|
|
@@ -97032,7 +97107,7 @@ import { pipeline as pipeline2 } from "node:stream/promises";
|
|
|
97032
97107
|
import { promisify as promisify2 } from "node:util";
|
|
97033
97108
|
import assert32 from "node:assert";
|
|
97034
97109
|
import { spawnSync as spawnSync22 } from "node:child_process";
|
|
97035
|
-
import { existsSync as
|
|
97110
|
+
import { existsSync as existsSync8, readFileSync as readFileSync22 } from "node:fs";
|
|
97036
97111
|
import { mkdir as mkdir32, unlink as unlink3 } from "node:fs/promises";
|
|
97037
97112
|
import os52 from "node:os";
|
|
97038
97113
|
import path102 from "node:path";
|
|
@@ -97041,13 +97116,13 @@ import { readdirSync as readdirSync3, statSync as statSync4 } from "fs";
|
|
|
97041
97116
|
import { format as format3 } from "util";
|
|
97042
97117
|
import { normalize as normalize2, resolve as resolve52 } from "path";
|
|
97043
97118
|
import { readFileSync as readFileSync32 } from "fs";
|
|
97044
|
-
import { createRequire as
|
|
97119
|
+
import { createRequire as createRequire4 } from "node:module";
|
|
97045
97120
|
import { readFileSync as readFileSync42, statSync as statSync22, writeFile as writeFile10 } from "fs";
|
|
97046
97121
|
import { format as format22 } from "util";
|
|
97047
97122
|
import { resolve as resolve62 } from "path";
|
|
97048
97123
|
import { notStrictEqual as notStrictEqual2, strictEqual as strictEqual2 } from "assert";
|
|
97049
97124
|
import { inspect as inspect2 } from "util";
|
|
97050
|
-
import { fileURLToPath as
|
|
97125
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
97051
97126
|
import { basename as basename22, dirname as dirname52, extname as extname3, relative as relative4, resolve as resolve72, join as join52 } from "path";
|
|
97052
97127
|
import { createRequire as createRequire22 } from "node:module";
|
|
97053
97128
|
import { readFileSync as readFileSync52, readdirSync as readdirSync22 } from "node:fs";
|
|
@@ -97092,7 +97167,7 @@ import { copyFileSync, existsSync as existsSync72, mkdirSync as mkdirSync2, read
|
|
|
97092
97167
|
import { join as join102, dirname as dirname72, extname as extname32 } from "path";
|
|
97093
97168
|
import { spawn as spawn7 } from "child_process";
|
|
97094
97169
|
import { once } from "events";
|
|
97095
|
-
import { existsSync as
|
|
97170
|
+
import { existsSync as existsSync82, mkdirSync as mkdirSync3, statSync as statSync42 } from "fs";
|
|
97096
97171
|
import { dirname as dirname82 } from "path";
|
|
97097
97172
|
import { createWriteStream as createWriteStream32, existsSync as existsSync9, mkdirSync as mkdirSync4 } from "fs";
|
|
97098
97173
|
import { createHash as createHash22 } from "crypto";
|
|
@@ -97111,7 +97186,7 @@ import {
|
|
|
97111
97186
|
utimesSync,
|
|
97112
97187
|
writeFileSync as writeFileSync3
|
|
97113
97188
|
} from "node:fs";
|
|
97114
|
-
import { join as
|
|
97189
|
+
import { join as join122 } from "node:path";
|
|
97115
97190
|
import { copyFileSync as copyFileSync2, existsSync as existsSync11, linkSync, mkdirSync as mkdirSync6, readdirSync as readdirSync6, rmSync as rmSync2 } from "fs";
|
|
97116
97191
|
import { isAbsolute as isAbsolute32, join as join13, posix as posix2, resolve as resolve92, sep as sep32 } from "path";
|
|
97117
97192
|
import { promises as fs92 } from "fs";
|
|
@@ -97126,7 +97201,7 @@ import { join as join15 } from "node:path";
|
|
|
97126
97201
|
import { promisify as promisify22 } from "node:util";
|
|
97127
97202
|
import { cpus as cpus22, freemem } from "os";
|
|
97128
97203
|
import { existsSync as existsSync13, mkdirSync as mkdirSync8, readdirSync as readdirSync7 } from "fs";
|
|
97129
|
-
import { copyFile as
|
|
97204
|
+
import { copyFile as copyFile3, readFile as readFile22, rename as rename22 } from "fs/promises";
|
|
97130
97205
|
import { join as join16 } from "path";
|
|
97131
97206
|
import { getHeapStatistics } from "v8";
|
|
97132
97207
|
import { createServer as createServerHTTP } from "http";
|
|
@@ -97186,7 +97261,7 @@ import {
|
|
|
97186
97261
|
relative as nodeRelative,
|
|
97187
97262
|
isAbsolute as nodeIsAbsolute
|
|
97188
97263
|
} from "node:path";
|
|
97189
|
-
import { fileURLToPath as
|
|
97264
|
+
import { fileURLToPath as fileURLToPath32 } from "node:url";
|
|
97190
97265
|
import { freemem as freemem2 } from "node:os";
|
|
97191
97266
|
import {
|
|
97192
97267
|
closeSync as closeSync2,
|
|
@@ -97204,7 +97279,7 @@ import { join as join23 } from "node:path";
|
|
|
97204
97279
|
import { createHash as createHash5 } from "node:crypto";
|
|
97205
97280
|
import { join as join29 } from "node:path";
|
|
97206
97281
|
import { readFileSync as readFileSync13, existsSync as existsSync24, mkdirSync as mkdirSync13 } from "fs";
|
|
97207
|
-
import { join as join28, dirname as dirname15, resolve as resolve162, basename as
|
|
97282
|
+
import { join as join28, dirname as dirname15, resolve as resolve162, basename as basename62 } from "path";
|
|
97208
97283
|
import { createHash as createHash7 } from "node:crypto";
|
|
97209
97284
|
import { existsSync as existsSync222, mkdirSync as mkdirSync11, readFileSync as readFileSync11, writeFileSync as writeFileSync8 } from "node:fs";
|
|
97210
97285
|
import { homedir as homedir5, tmpdir as tmpdir5 } from "node:os";
|
|
@@ -107768,7 +107843,7 @@ async function installWithProviders2(options) {
|
|
|
107768
107843
|
continue;
|
|
107769
107844
|
}
|
|
107770
107845
|
debugInstall2?.(`Successfully got URL from ${provider.getName()}: ${url}`);
|
|
107771
|
-
if (!
|
|
107846
|
+
if (!existsSync8(browserRoot)) {
|
|
107772
107847
|
await mkdir32(browserRoot, { recursive: true });
|
|
107773
107848
|
}
|
|
107774
107849
|
return await installUrl2(url, options, provider);
|
|
@@ -107800,7 +107875,7 @@ async function installDeps2(installedBrowser) {
|
|
|
107800
107875
|
return;
|
|
107801
107876
|
}
|
|
107802
107877
|
const depsPath = path102.join(path102.dirname(installedBrowser.executablePath), "deb.deps");
|
|
107803
|
-
if (!
|
|
107878
|
+
if (!existsSync8(depsPath)) {
|
|
107804
107879
|
debugInstall2?.(`deb.deps file was not found at ${depsPath}`);
|
|
107805
107880
|
return;
|
|
107806
107881
|
}
|
|
@@ -107841,14 +107916,14 @@ async function installUrl2(url, options, provider) {
|
|
|
107841
107916
|
const cache = new Cache2(options.cacheDir);
|
|
107842
107917
|
const browserRoot = cache.browserRoot(options.browser);
|
|
107843
107918
|
const archivePath = path102.join(browserRoot, `${options.buildId}-${fileName}`);
|
|
107844
|
-
if (!
|
|
107919
|
+
if (!existsSync8(browserRoot)) {
|
|
107845
107920
|
await mkdir32(browserRoot, { recursive: true });
|
|
107846
107921
|
}
|
|
107847
107922
|
if (options.expectedHash) {
|
|
107848
107923
|
debugInstall2?.(`Using provided checksum for ${fileName}: ${options.expectedHash}`);
|
|
107849
107924
|
}
|
|
107850
107925
|
if (!options.unpack) {
|
|
107851
|
-
if (
|
|
107926
|
+
if (existsSync8(archivePath)) {
|
|
107852
107927
|
return archivePath;
|
|
107853
107928
|
}
|
|
107854
107929
|
debugInstall2?.(`Downloading binary from ${url}`);
|
|
@@ -107869,8 +107944,8 @@ async function installUrl2(url, options, provider) {
|
|
|
107869
107944
|
cache.writeExecutablePath(options.browser, options.platform, options.buildId, relativeExecutablePath62);
|
|
107870
107945
|
}
|
|
107871
107946
|
try {
|
|
107872
|
-
if (
|
|
107873
|
-
if (!
|
|
107947
|
+
if (existsSync8(outputPath)) {
|
|
107948
|
+
if (!existsSync8(installedBrowser.executablePath)) {
|
|
107874
107949
|
throw new Error(`The browser folder (${outputPath}) exists but the executable (${installedBrowser.executablePath}) is missing`);
|
|
107875
107950
|
}
|
|
107876
107951
|
await runSetup2(installedBrowser);
|
|
@@ -107879,7 +107954,7 @@ async function installUrl2(url, options, provider) {
|
|
|
107879
107954
|
}
|
|
107880
107955
|
return installedBrowser;
|
|
107881
107956
|
}
|
|
107882
|
-
if (!
|
|
107957
|
+
if (!existsSync8(archivePath)) {
|
|
107883
107958
|
debugInstall2?.(`Downloading binary from ${url}`);
|
|
107884
107959
|
try {
|
|
107885
107960
|
debugTime2("download");
|
|
@@ -107908,7 +107983,7 @@ async function installUrl2(url, options, provider) {
|
|
|
107908
107983
|
}
|
|
107909
107984
|
return installedBrowser;
|
|
107910
107985
|
} finally {
|
|
107911
|
-
if (
|
|
107986
|
+
if (existsSync8(archivePath)) {
|
|
107912
107987
|
await unlink3(archivePath);
|
|
107913
107988
|
}
|
|
107914
107989
|
}
|
|
@@ -107919,7 +107994,7 @@ async function runSetup2(installedBrowser) {
|
|
|
107919
107994
|
debugTime2("permissions");
|
|
107920
107995
|
const browserDir = path102.dirname(installedBrowser.executablePath);
|
|
107921
107996
|
const setupExePath = path102.join(browserDir, "setup.exe");
|
|
107922
|
-
if (!
|
|
107997
|
+
if (!existsSync8(setupExePath)) {
|
|
107923
107998
|
return;
|
|
107924
107999
|
}
|
|
107925
108000
|
spawnSync22(path102.join(browserDir, "setup.exe"), [`--configure-browser-in-directory=` + browserDir], {
|
|
@@ -115299,7 +115374,7 @@ function buildStreamingArgs(options, outputPath, gpuEncoder = null) {
|
|
|
115299
115374
|
}
|
|
115300
115375
|
async function spawnStreamingEncoder(outputPath, options, signal, config22) {
|
|
115301
115376
|
const outputDir = dirname82(outputPath);
|
|
115302
|
-
if (!
|
|
115377
|
+
if (!existsSync82(outputDir)) mkdirSync3(outputDir, { recursive: true });
|
|
115303
115378
|
let gpuEncoder = null;
|
|
115304
115379
|
if (options.useGpu) {
|
|
115305
115380
|
gpuEncoder = await getCachedGpuEncoder();
|
|
@@ -115398,7 +115473,7 @@ FFmpeg stopped after ${streamingTimeout} ms without consuming a frame.` : "";
|
|
|
115398
115473
|
error: `${formatFfmpegError(exitCode, stderr)}${inactivitySuffix}`
|
|
115399
115474
|
};
|
|
115400
115475
|
}
|
|
115401
|
-
const fileSize =
|
|
115476
|
+
const fileSize = existsSync82(outputPath) ? statSync42(outputPath).size : 0;
|
|
115402
115477
|
return { success: true, durationMs, fileSize };
|
|
115403
115478
|
},
|
|
115404
115479
|
getExitStatus: () => exitStatus,
|
|
@@ -120146,8 +120221,8 @@ function cacheEntryDirName(keyHash) {
|
|
|
120146
120221
|
}
|
|
120147
120222
|
function lookupCacheEntry(rootDir, input22) {
|
|
120148
120223
|
const keyHash = computeCacheKey(input22);
|
|
120149
|
-
const dir =
|
|
120150
|
-
const complete = existsSync10(
|
|
120224
|
+
const dir = join122(rootDir, cacheEntryDirName(keyHash));
|
|
120225
|
+
const complete = existsSync10(join122(dir, COMPLETE_SENTINEL));
|
|
120151
120226
|
return { entry: { dir, keyHash }, hit: complete };
|
|
120152
120227
|
}
|
|
120153
120228
|
function partialCacheEntryDir(entry) {
|
|
@@ -120158,13 +120233,13 @@ function isTargetExistsRenameError(err) {
|
|
|
120158
120233
|
return code === "EEXIST" || code === "ENOTEMPTY" || code === "EPERM";
|
|
120159
120234
|
}
|
|
120160
120235
|
function adoptPublishedWinner(entry, partialDir) {
|
|
120161
|
-
if (!existsSync10(
|
|
120236
|
+
if (!existsSync10(join122(entry.dir, COMPLETE_SENTINEL))) return null;
|
|
120162
120237
|
removeDir(partialDir);
|
|
120163
120238
|
return { dir: entry.dir, published: true };
|
|
120164
120239
|
}
|
|
120165
120240
|
function publishCacheEntry(entry, partialDir) {
|
|
120166
120241
|
try {
|
|
120167
|
-
writeFileSync3(
|
|
120242
|
+
writeFileSync3(join122(partialDir, COMPLETE_SENTINEL), "", "utf-8");
|
|
120168
120243
|
} catch {
|
|
120169
120244
|
return { dir: partialDir, published: false };
|
|
120170
120245
|
}
|
|
@@ -120191,7 +120266,7 @@ function publishCacheEntry(entry, partialDir) {
|
|
|
120191
120266
|
function touchCacheEntry(entry) {
|
|
120192
120267
|
try {
|
|
120193
120268
|
const now = /* @__PURE__ */ new Date();
|
|
120194
|
-
utimesSync(
|
|
120269
|
+
utimesSync(join122(entry.dir, COMPLETE_SENTINEL), now, now);
|
|
120195
120270
|
} catch {
|
|
120196
120271
|
}
|
|
120197
120272
|
}
|
|
@@ -120216,7 +120291,7 @@ function directorySizeBytes(path142) {
|
|
|
120216
120291
|
return 0;
|
|
120217
120292
|
}
|
|
120218
120293
|
for (const child of children) {
|
|
120219
|
-
const childPath =
|
|
120294
|
+
const childPath = join122(path142, child);
|
|
120220
120295
|
try {
|
|
120221
120296
|
const stat22 = lstatSync(childPath);
|
|
120222
120297
|
if (stat22.isDirectory()) {
|
|
@@ -120245,7 +120320,7 @@ function collectGcEntry(dir, name, now, minAgeMs, stats) {
|
|
|
120245
120320
|
}
|
|
120246
120321
|
let lastUseMs = dirStat.mtimeMs;
|
|
120247
120322
|
try {
|
|
120248
|
-
lastUseMs = statSync5(
|
|
120323
|
+
lastUseMs = statSync5(join122(dir, COMPLETE_SENTINEL)).mtimeMs;
|
|
120249
120324
|
} catch {
|
|
120250
120325
|
}
|
|
120251
120326
|
return { dir, size: directorySizeBytes(dir), lastUseMs, ageMs: now - lastUseMs };
|
|
@@ -120255,7 +120330,7 @@ function collectGcEntry(dir, name, now, minAgeMs, stats) {
|
|
|
120255
120330
|
}
|
|
120256
120331
|
function gcSweepDue(rootDir, maxAgeMs) {
|
|
120257
120332
|
try {
|
|
120258
|
-
return Date.now() - statSync5(
|
|
120333
|
+
return Date.now() - statSync5(join122(rootDir, GC_MARKER)).mtimeMs > maxAgeMs;
|
|
120259
120334
|
} catch {
|
|
120260
120335
|
return true;
|
|
120261
120336
|
}
|
|
@@ -120263,7 +120338,7 @@ function gcSweepDue(rootDir, maxAgeMs) {
|
|
|
120263
120338
|
function gcExtractionCache(rootDir, opts) {
|
|
120264
120339
|
const stats = { evictedEntries: 0, evictedBytes: 0, agedPartialsRemoved: 0 };
|
|
120265
120340
|
try {
|
|
120266
|
-
writeFileSync3(
|
|
120341
|
+
writeFileSync3(join122(rootDir, GC_MARKER), "", "utf-8");
|
|
120267
120342
|
} catch {
|
|
120268
120343
|
}
|
|
120269
120344
|
try {
|
|
@@ -120272,7 +120347,7 @@ function gcExtractionCache(rootDir, opts) {
|
|
|
120272
120347
|
for (const child of readdirSync5(rootDir, { withFileTypes: true })) {
|
|
120273
120348
|
if (!child.isDirectory() || !isCacheLikeChild(child.name)) continue;
|
|
120274
120349
|
const entry = collectGcEntry(
|
|
120275
|
-
|
|
120350
|
+
join122(rootDir, child.name),
|
|
120276
120351
|
child.name,
|
|
120277
120352
|
now,
|
|
120278
120353
|
opts.minAgeMs,
|
|
@@ -120301,7 +120376,7 @@ function rehydrateCacheEntry(entry, options) {
|
|
|
120301
120376
|
const suffix = `.${options.format}`;
|
|
120302
120377
|
const files = readdirSync5(entry.dir).filter((f2) => f2.startsWith(FRAME_FILENAME_PREFIX) && f2.endsWith(suffix)).sort();
|
|
120303
120378
|
files.forEach((file, idx) => {
|
|
120304
|
-
framePaths.set(idx,
|
|
120379
|
+
framePaths.set(idx, join122(entry.dir, file));
|
|
120305
120380
|
});
|
|
120306
120381
|
return {
|
|
120307
120382
|
videoId: options.videoId,
|
|
@@ -122503,7 +122578,7 @@ async function mergeWorkerFrames(workDir, tasks, outputDir) {
|
|
|
122503
122578
|
try {
|
|
122504
122579
|
await rename22(sourcePath, targetPath);
|
|
122505
122580
|
} catch {
|
|
122506
|
-
await
|
|
122581
|
+
await copyFile3(sourcePath, targetPath);
|
|
122507
122582
|
}
|
|
122508
122583
|
});
|
|
122509
122584
|
await Promise.all(copyTasks);
|
|
@@ -127539,7 +127614,7 @@ async function downloadAndRewriteUrls(urlSet, html, remoteDir, warnLabel, logLab
|
|
|
127539
127614
|
const remoteMediaAssets = /* @__PURE__ */ new Map();
|
|
127540
127615
|
const urlToRelPath = /* @__PURE__ */ new Map();
|
|
127541
127616
|
for (const [url, absPath] of urlToLocal) {
|
|
127542
|
-
const relPath = `${REMOTE_MEDIA_SUBDIR}/${
|
|
127617
|
+
const relPath = `${REMOTE_MEDIA_SUBDIR}/${basename62(absPath)}`;
|
|
127543
127618
|
remoteMediaAssets.set(relPath, absPath);
|
|
127544
127619
|
urlToRelPath.set(url, relPath);
|
|
127545
127620
|
}
|
|
@@ -247910,7 +247985,7 @@ If you think this is a bug, please report it on the Puppeteer issue tracker.`;
|
|
|
247910
247985
|
}
|
|
247911
247986
|
}
|
|
247912
247987
|
env3 = process ? process.env : {};
|
|
247913
|
-
require22 =
|
|
247988
|
+
require22 = createRequire4 ? createRequire4(import.meta.url) : void 0;
|
|
247914
247989
|
parser2 = new YargsParser2({
|
|
247915
247990
|
cwd: process.cwd,
|
|
247916
247991
|
env: () => {
|
|
@@ -248157,7 +248232,7 @@ If you think this is a bug, please report it on the Puppeteer issue tracker.`;
|
|
|
248157
248232
|
init_string_width2();
|
|
248158
248233
|
init_y18n2();
|
|
248159
248234
|
import_get_caller_file2 = __toESM2(require_get_caller_file2(), 1);
|
|
248160
|
-
__dirname22 =
|
|
248235
|
+
__dirname22 = fileURLToPath3(import.meta.url);
|
|
248161
248236
|
mainFilename2 = __dirname22.substring(0, __dirname22.lastIndexOf("node_modules"));
|
|
248162
248237
|
require32 = createRequire22(import.meta.url);
|
|
248163
248238
|
esm_default3 = {
|
|
@@ -248198,7 +248273,7 @@ If you think this is a bug, please report it on the Puppeteer issue tracker.`;
|
|
|
248198
248273
|
require: require32,
|
|
248199
248274
|
getCallerFile: () => {
|
|
248200
248275
|
const callerFile = (0, import_get_caller_file2.default)(3);
|
|
248201
|
-
return callerFile.match(/^file:\/\//) ?
|
|
248276
|
+
return callerFile.match(/^file:\/\//) ? fileURLToPath3(callerFile) : callerFile;
|
|
248202
248277
|
},
|
|
248203
248278
|
stringWidth: stringWidth2,
|
|
248204
248279
|
y18n: y18n_default2({
|
|
@@ -267308,7 +267383,7 @@ ${allInlineStyles}`.replace(/\/\*[\s\S]*?\*\//g, "");
|
|
|
267308
267383
|
init_src();
|
|
267309
267384
|
DEFAULT_RENDERS_DIR = process.env.PRODUCER_RENDERS_DIR ?? // fileURLToPath (not URL.pathname): on Windows .pathname is "/D:/..." which
|
|
267310
267385
|
// resolves to a bogus renders dir.
|
|
267311
|
-
nodeResolve(
|
|
267386
|
+
nodeResolve(fileURLToPath32(import.meta.url), "../../..", "renders");
|
|
267312
267387
|
BROWSER_MEDIA_EPSILON = 1e-4;
|
|
267313
267388
|
materializePathModule = {
|
|
267314
267389
|
resolve: resolve122,
|
|
@@ -268281,7 +268356,7 @@ Check that each file referenced by data-composition-src contains valid HTML with
|
|
|
268281
268356
|
});
|
|
268282
268357
|
|
|
268283
268358
|
// ../cli/src/commands/_shared/scene-lint.ts
|
|
268284
|
-
import { readdir as readdir6, readFile as
|
|
268359
|
+
import { readdir as readdir6, readFile as readFile10, writeFile as writeFile11, stat as stat4 } from "node:fs/promises";
|
|
268285
268360
|
import { existsSync as existsSync38 } from "node:fs";
|
|
268286
268361
|
import { resolve as resolve21, relative as relative5, join as join53 } from "node:path";
|
|
268287
268362
|
async function discoverSceneFiles(opts) {
|
|
@@ -268383,7 +268458,7 @@ async function runProjectLint(opts) {
|
|
|
268383
268458
|
for (const sub of subs) targets.push({ abs: sub, isSub: true });
|
|
268384
268459
|
for (const { abs, isSub } of targets) {
|
|
268385
268460
|
const rel = relative5(projectDir, abs) || abs;
|
|
268386
|
-
const html = await
|
|
268461
|
+
const html = await readFile10(abs, "utf-8");
|
|
268387
268462
|
const prepared = {
|
|
268388
268463
|
html,
|
|
268389
268464
|
entryFile: rel,
|
|
@@ -268592,7 +268667,7 @@ var init_image_file = __esm({
|
|
|
268592
268667
|
|
|
268593
268668
|
// ../cli/src/commands/_shared/image-jobs.ts
|
|
268594
268669
|
import { existsSync as existsSync39 } from "node:fs";
|
|
268595
|
-
import { mkdir as
|
|
268670
|
+
import { mkdir as mkdir12, readFile as readFile11 } from "node:fs/promises";
|
|
268596
268671
|
import { dirname as dirname24, resolve as resolve23 } from "node:path";
|
|
268597
268672
|
async function openImageGenerator(provider, apiKey) {
|
|
268598
268673
|
const envVar = IMAGE_PROVIDER_ENV[provider];
|
|
@@ -268612,11 +268687,11 @@ async function readImageInput(path15) {
|
|
|
268612
268687
|
if (!existsSync39(absPath)) {
|
|
268613
268688
|
throw new ProviderError({ kind: "invalid-request", provider: "local", message: `Image not found: ${absPath}` });
|
|
268614
268689
|
}
|
|
268615
|
-
return { bytes: new Uint8Array(await
|
|
268690
|
+
return { bytes: new Uint8Array(await readFile11(absPath)), mimeType: mimeTypeForPath(path15, "image/png") };
|
|
268616
268691
|
}
|
|
268617
268692
|
async function saveImage(output3, bytes) {
|
|
268618
268693
|
const outputPath = resolve23(process.cwd(), output3);
|
|
268619
|
-
await
|
|
268694
|
+
await mkdir12(dirname24(outputPath), { recursive: true });
|
|
268620
268695
|
await writeImageFile(outputPath, Buffer.from(bytes));
|
|
268621
268696
|
return outputPath;
|
|
268622
268697
|
}
|
|
@@ -269001,7 +269076,7 @@ var init_compose_beat_prompt = __esm({
|
|
|
269001
269076
|
|
|
269002
269077
|
// ../cli/src/commands/_shared/root-sync.ts
|
|
269003
269078
|
import { existsSync as existsSync41 } from "node:fs";
|
|
269004
|
-
import { readFile as
|
|
269079
|
+
import { readFile as readFile12, writeFile as writeFile13 } from "node:fs/promises";
|
|
269005
269080
|
import { join as join55, resolve as resolve25 } from "node:path";
|
|
269006
269081
|
async function createRootSyncPlan(opts) {
|
|
269007
269082
|
const projectDir = resolve25(opts.projectDir);
|
|
@@ -269010,7 +269085,7 @@ async function createRootSyncPlan(opts) {
|
|
|
269010
269085
|
if (!existsSync41(rootPath)) {
|
|
269011
269086
|
return { rootPath, rootRel, exists: false, changed: false, fixCodes: [], issues: [] };
|
|
269012
269087
|
}
|
|
269013
|
-
const html = await
|
|
269088
|
+
const html = await readFile12(rootPath, "utf-8");
|
|
269014
269089
|
if (opts.beats.length === 0) {
|
|
269015
269090
|
return { rootPath, rootRel, exists: true, changed: false, fixCodes: [], issues: [] };
|
|
269016
269091
|
}
|
|
@@ -269299,7 +269374,7 @@ async function readBuildReportBeats(projectDir) {
|
|
|
269299
269374
|
const reportPath = join55(projectDir, "build-report.json");
|
|
269300
269375
|
if (!existsSync41(reportPath)) return [];
|
|
269301
269376
|
try {
|
|
269302
|
-
const report = JSON.parse(await
|
|
269377
|
+
const report = JSON.parse(await readFile12(reportPath, "utf-8"));
|
|
269303
269378
|
return Array.isArray(report.beats) ? report.beats : [];
|
|
269304
269379
|
} catch {
|
|
269305
269380
|
return [];
|
|
@@ -269341,12 +269416,12 @@ var init_root_sync = __esm({
|
|
|
269341
269416
|
});
|
|
269342
269417
|
|
|
269343
269418
|
// ../cli/src/commands/_shared/transcription.ts
|
|
269344
|
-
import { readFile as
|
|
269419
|
+
import { readFile as readFile13 } from "node:fs/promises";
|
|
269345
269420
|
import { basename as basename7 } from "node:path";
|
|
269346
269421
|
async function transcribeAudioFile(path15, options) {
|
|
269347
269422
|
try {
|
|
269348
269423
|
const transcriber = await createTranscriber("openai", options.apiKey);
|
|
269349
|
-
const audio = new Uint8Array(await
|
|
269424
|
+
const audio = new Uint8Array(await readFile13(path15));
|
|
269350
269425
|
const name = basename7(path15);
|
|
269351
269426
|
const transcript = await transcriber.transcribeAudio({
|
|
269352
269427
|
audio,
|
|
@@ -269381,7 +269456,7 @@ var init_transcription2 = __esm({
|
|
|
269381
269456
|
|
|
269382
269457
|
// ../cli/src/commands/_shared/transcribe-narration.ts
|
|
269383
269458
|
import { existsSync as existsSync43 } from "node:fs";
|
|
269384
|
-
import { readFile as
|
|
269459
|
+
import { readFile as readFile14 } from "node:fs/promises";
|
|
269385
269460
|
import { join as join56 } from "node:path";
|
|
269386
269461
|
async function transcribeNarrationWords(audioAbsPath, opts) {
|
|
269387
269462
|
try {
|
|
@@ -269401,7 +269476,7 @@ async function readBeatTranscript(projectDir, beatId) {
|
|
|
269401
269476
|
const abs = join56(projectDir, beatTranscriptRelPath(beatId));
|
|
269402
269477
|
if (!existsSync43(abs)) return void 0;
|
|
269403
269478
|
try {
|
|
269404
|
-
const parsed = JSON.parse(await
|
|
269479
|
+
const parsed = JSON.parse(await readFile14(abs, "utf-8"));
|
|
269405
269480
|
if (!Array.isArray(parsed)) return void 0;
|
|
269406
269481
|
const words = parsed.filter(
|
|
269407
269482
|
(w4) => typeof w4 === "object" && w4 !== null && typeof w4.text === "string" && Number.isFinite(w4.start) && Number.isFinite(w4.end)
|
|
@@ -269565,7 +269640,7 @@ var init_compose_prompts = __esm({
|
|
|
269565
269640
|
|
|
269566
269641
|
// ../cli/src/commands/_shared/sub-comp-duration-sync.ts
|
|
269567
269642
|
import { existsSync as existsSync46 } from "node:fs";
|
|
269568
|
-
import { readFile as
|
|
269643
|
+
import { readFile as readFile15 } from "node:fs/promises";
|
|
269569
269644
|
import { join as join59, resolve as resolve28 } from "node:path";
|
|
269570
269645
|
function syncSubCompositionDurationHtml(html, beatId, newDurationSec, fileRel) {
|
|
269571
269646
|
const compositionId = `scene-${beatId}`;
|
|
@@ -269666,7 +269741,7 @@ async function createSubCompDurationSyncPlans(opts) {
|
|
|
269666
269741
|
narrationPath: beat.narrationPath,
|
|
269667
269742
|
sceneDurationSec: beat.sceneDurationSec
|
|
269668
269743
|
});
|
|
269669
|
-
const html = await
|
|
269744
|
+
const html = await readFile15(filePath, "utf-8");
|
|
269670
269745
|
const outcome = syncSubCompositionDurationHtml(html, beat.id, newDurationSec, fileRel);
|
|
269671
269746
|
results.push({ ...outcome, file: fileRel, beatId: beat.id });
|
|
269672
269747
|
}
|
|
@@ -269690,7 +269765,7 @@ var init_sub_comp_duration_sync = __esm({
|
|
|
269690
269765
|
});
|
|
269691
269766
|
|
|
269692
269767
|
// ../cli/src/commands/_shared/scene-repair.ts
|
|
269693
|
-
import { readFile as
|
|
269768
|
+
import { readFile as readFile16, writeFile as writeFile15 } from "node:fs/promises";
|
|
269694
269769
|
import { relative as relative7, resolve as resolve29 } from "node:path";
|
|
269695
269770
|
async function executeSceneRepair(opts) {
|
|
269696
269771
|
const projectDir = resolve29(opts.projectDir);
|
|
@@ -269735,7 +269810,7 @@ async function executeSceneRepair(opts) {
|
|
|
269735
269810
|
}
|
|
269736
269811
|
for (const target of targets) {
|
|
269737
269812
|
const rel = relative7(projectDir, target.abs) || target.abs;
|
|
269738
|
-
const html = await
|
|
269813
|
+
const html = await readFile16(target.abs, "utf-8");
|
|
269739
269814
|
const findings = await lintHtml(html, rel, target.isSub);
|
|
269740
269815
|
const { html: nextHtml, fixedCodes } = applyMechanicalFixes(html, findings);
|
|
269741
269816
|
if (fixedCodes.length > 0) {
|
|
@@ -269890,7 +269965,7 @@ var init_ffmpeg_gate = __esm({
|
|
|
269890
269965
|
});
|
|
269891
269966
|
|
|
269892
269967
|
// ../cli/src/commands/_shared/scene-audio-scan.ts
|
|
269893
|
-
import { readFile as
|
|
269968
|
+
import { readFile as readFile18 } from "node:fs/promises";
|
|
269894
269969
|
import { resolve as resolve31 } from "node:path";
|
|
269895
269970
|
function parseRootClips(rootHtml) {
|
|
269896
269971
|
const clips = [];
|
|
@@ -269931,7 +270006,7 @@ function makeFsCompositionReader(projectDir) {
|
|
|
269931
270006
|
return async (compositionSrcRel) => {
|
|
269932
270007
|
const abs = resolve31(projectDir, compositionSrcRel);
|
|
269933
270008
|
try {
|
|
269934
|
-
return await
|
|
270009
|
+
return await readFile18(abs, "utf-8");
|
|
269935
270010
|
} catch {
|
|
269936
270011
|
return null;
|
|
269937
270012
|
}
|
|
@@ -270122,7 +270197,7 @@ var init_scene_audio_mux = __esm({
|
|
|
270122
270197
|
|
|
270123
270198
|
// ../cli/src/commands/_shared/scene-assemble.ts
|
|
270124
270199
|
import { existsSync as existsSync49 } from "node:fs";
|
|
270125
|
-
import { readFile as
|
|
270200
|
+
import { readFile as readFile19 } from "node:fs/promises";
|
|
270126
270201
|
import { resolve as resolve33, isAbsolute as isAbsolute7 } from "node:path";
|
|
270127
270202
|
async function executeSceneAssemble(opts) {
|
|
270128
270203
|
const projectDir = resolve33(opts.projectDir);
|
|
@@ -270153,7 +270228,7 @@ async function executeSceneAssemble(opts) {
|
|
|
270153
270228
|
let audioMuxWarning;
|
|
270154
270229
|
try {
|
|
270155
270230
|
opts.onProgress?.(0.1, "Scanning audio");
|
|
270156
|
-
const rootHtml = await
|
|
270231
|
+
const rootHtml = await readFile19(rootPath, "utf-8");
|
|
270157
270232
|
const audios = await scanSceneAudio({ projectDir, rootHtml });
|
|
270158
270233
|
audioCount = audios.length;
|
|
270159
270234
|
if (audios.length > 0) {
|
|
@@ -270207,7 +270282,7 @@ __export(scene_render_exports, {
|
|
|
270207
270282
|
});
|
|
270208
270283
|
import { execFile as execFile5 } from "node:child_process";
|
|
270209
270284
|
import { existsSync as existsSync50 } from "node:fs";
|
|
270210
|
-
import { mkdir as
|
|
270285
|
+
import { mkdir as mkdir15, readFile as readFile20, stat as stat5, writeFile as writeFile17 } from "node:fs/promises";
|
|
270211
270286
|
import { resolve as resolve34, relative as relative9, dirname as dirname27, basename as basename9, join as join61, isAbsolute as isAbsolute8 } from "node:path";
|
|
270212
270287
|
import { promisify as promisify5 } from "node:util";
|
|
270213
270288
|
function qualityToCrf(quality = "standard") {
|
|
@@ -270353,7 +270428,7 @@ async function executeSceneRender(opts = {}) {
|
|
|
270353
270428
|
}
|
|
270354
270429
|
const projectName = projectConfig.config.name;
|
|
270355
270430
|
const outputPath = opts.output ? resolve34(projectDir, opts.output) : defaultOutputPath({ projectDir, projectName, format: opts.format, beatId: opts.beatId });
|
|
270356
|
-
await
|
|
270431
|
+
await mkdir15(dirname27(outputPath), { recursive: true });
|
|
270357
270432
|
const config4 = buildRenderConfig({
|
|
270358
270433
|
fps: opts.fps,
|
|
270359
270434
|
quality: opts.quality,
|
|
@@ -270480,7 +270555,7 @@ async function prepareBeatRenderRoot(opts) {
|
|
|
270480
270555
|
}
|
|
270481
270556
|
let report;
|
|
270482
270557
|
try {
|
|
270483
|
-
report = JSON.parse(await
|
|
270558
|
+
report = JSON.parse(await readFile20(reportPath, "utf-8"));
|
|
270484
270559
|
} catch (error) {
|
|
270485
270560
|
return {
|
|
270486
270561
|
success: false,
|
|
@@ -270549,7 +270624,7 @@ async function prepareBeatRenderRoot(opts) {
|
|
|
270549
270624
|
durationSec,
|
|
270550
270625
|
narrationPath
|
|
270551
270626
|
});
|
|
270552
|
-
await
|
|
270627
|
+
await mkdir15(dirname27(join61(opts.projectDir, root2)), { recursive: true });
|
|
270553
270628
|
await writeFile17(join61(opts.projectDir, root2), html, "utf-8");
|
|
270554
270629
|
return {
|
|
270555
270630
|
success: true,
|
|
@@ -270834,7 +270909,7 @@ var init_design_parse = __esm({
|
|
|
270834
270909
|
|
|
270835
270910
|
// ../cli/src/commands/_shared/compose-aivideo.ts
|
|
270836
270911
|
import { existsSync as existsSync51 } from "node:fs";
|
|
270837
|
-
import { mkdir as
|
|
270912
|
+
import { mkdir as mkdir16, readFile as readFile21, writeFile as writeFile18 } from "node:fs/promises";
|
|
270838
270913
|
import { join as join63, resolve as resolve35 } from "node:path";
|
|
270839
270914
|
function headingDescriptor(heading) {
|
|
270840
270915
|
const stripped = heading.replace(/^\s*beat\s+/i, "");
|
|
@@ -270997,7 +271072,7 @@ async function composeAiVideo(opts) {
|
|
|
270997
271072
|
}
|
|
270998
271073
|
clipRels.push(rel);
|
|
270999
271074
|
}
|
|
271000
|
-
await
|
|
271075
|
+
await mkdir16(join63(projectDir, "assets"), { recursive: true });
|
|
271001
271076
|
const bgRel = "assets/bg-full.mp4";
|
|
271002
271077
|
const concatArgs = buildBgConcatArgs(
|
|
271003
271078
|
clipRels.map((r2) => join63(projectDir, r2)),
|
|
@@ -271005,7 +271080,7 @@ async function composeAiVideo(opts) {
|
|
|
271005
271080
|
);
|
|
271006
271081
|
await execSafe("ffmpeg", concatArgs, { timeout: 6e5 });
|
|
271007
271082
|
const totalDurationSec = await probeDurationSec(join63(projectDir, bgRel));
|
|
271008
|
-
await
|
|
271083
|
+
await mkdir16(join63(projectDir, "compositions"), { recursive: true });
|
|
271009
271084
|
const sceneFiles = [];
|
|
271010
271085
|
for (let i3 = 0; i3 < beats.length; i3++) {
|
|
271011
271086
|
const beat = beats[i3];
|
|
@@ -271026,7 +271101,7 @@ async function composeAiVideo(opts) {
|
|
|
271026
271101
|
sceneFiles.push(rel);
|
|
271027
271102
|
}
|
|
271028
271103
|
const indexPath = join63(projectDir, "index.html");
|
|
271029
|
-
const next = existsSync51(indexPath) ? injectBgVideo(await
|
|
271104
|
+
const next = existsSync51(indexPath) ? injectBgVideo(await readFile21(indexPath, "utf-8"), bgRel, totalDurationSec) : buildRootShell(tokens, bgRel, totalDurationSec);
|
|
271030
271105
|
await writeFile18(indexPath, next, "utf-8");
|
|
271031
271106
|
return { bgVideoRel: bgRel, sceneFiles, totalDurationSec, beats: beats.length };
|
|
271032
271107
|
}
|
|
@@ -271078,7 +271153,7 @@ async function loadProjectTokens(projectDir) {
|
|
|
271078
271153
|
const designPath = join63(projectDir, "DESIGN.md");
|
|
271079
271154
|
if (!existsSync51(designPath)) return DEFAULT_AIVIDEO_TOKENS;
|
|
271080
271155
|
try {
|
|
271081
|
-
return extractDesignTokens(await
|
|
271156
|
+
return extractDesignTokens(await readFile21(designPath, "utf-8"));
|
|
271082
271157
|
} catch {
|
|
271083
271158
|
return DEFAULT_AIVIDEO_TOKENS;
|
|
271084
271159
|
}
|
|
@@ -271154,7 +271229,7 @@ var init_compose_aivideo = __esm({
|
|
|
271154
271229
|
|
|
271155
271230
|
// ../cli/src/commands/_shared/footage-assemble.ts
|
|
271156
271231
|
import { existsSync as existsSync53 } from "node:fs";
|
|
271157
|
-
import { mkdir as
|
|
271232
|
+
import { mkdir as mkdir17, writeFile as writeFile19 } from "node:fs/promises";
|
|
271158
271233
|
import { dirname as dirname28, isAbsolute as isAbsolute9, join as join64, resolve as resolve36 } from "node:path";
|
|
271159
271234
|
function planFootageTimeline(inputs, opts = {}) {
|
|
271160
271235
|
if (inputs.length === 0) {
|
|
@@ -271484,7 +271559,7 @@ async function executeFootageAssemble(opts) {
|
|
|
271484
271559
|
if (opts.dryRun) {
|
|
271485
271560
|
return { success: true, dryRun: true, outputPath, report };
|
|
271486
271561
|
}
|
|
271487
|
-
await
|
|
271562
|
+
await mkdir17(dirname28(outputPath), { recursive: true });
|
|
271488
271563
|
const args = buildFootageAssembleArgs({
|
|
271489
271564
|
sources: sourceRels.map((s2) => ({ path: join64(projectDir, s2.rel), kind: s2.kind })),
|
|
271490
271565
|
plan: plan2,
|
|
@@ -272837,7 +272912,7 @@ __export(scene_build_exports, {
|
|
|
272837
272912
|
resolveSceneBuildMode: () => resolveSceneBuildMode
|
|
272838
272913
|
});
|
|
272839
272914
|
import { existsSync as existsSync57, readFileSync as readFileSync21 } from "node:fs";
|
|
272840
|
-
import { copyFile as
|
|
272915
|
+
import { copyFile as copyFile5, mkdir as mkdir18, readFile as readFile23, rm as rm7, writeFile as writeFile21 } from "node:fs/promises";
|
|
272841
272916
|
import { dirname as dirname30, join as join66, resolve as resolve41 } from "node:path";
|
|
272842
272917
|
function readProjectKindSync(projectDir) {
|
|
272843
272918
|
try {
|
|
@@ -273691,8 +273766,8 @@ async function dispatchNarration(beat, ctx) {
|
|
|
273691
273766
|
};
|
|
273692
273767
|
}
|
|
273693
273768
|
if (existsSync57(cacheAbs) && !ctx.force) {
|
|
273694
|
-
await
|
|
273695
|
-
await
|
|
273769
|
+
await mkdir18(dirname30(abs), { recursive: true });
|
|
273770
|
+
await copyFile5(cacheAbs, abs);
|
|
273696
273771
|
await writeAssetMetadata({
|
|
273697
273772
|
projectDir: ctx.projectDir,
|
|
273698
273773
|
kind: "narration",
|
|
@@ -273722,13 +273797,13 @@ async function dispatchNarration(beat, ctx) {
|
|
|
273722
273797
|
ctx.onProgress({ type: "narration-failed", beatId: beat.id, error });
|
|
273723
273798
|
return { status: "failed", error };
|
|
273724
273799
|
}
|
|
273725
|
-
await
|
|
273800
|
+
await mkdir18(dirname30(abs), { recursive: true });
|
|
273726
273801
|
await writeFile21(abs, result.audioBuffer);
|
|
273727
273802
|
for (const otherExt of ["mp3", "wav"]) {
|
|
273728
273803
|
const sibling = join66(ctx.projectDir, `assets/narration-${beat.id}.${otherExt}`);
|
|
273729
273804
|
if (sibling !== abs && existsSync57(sibling)) await rm7(sibling, { force: true });
|
|
273730
273805
|
}
|
|
273731
|
-
await
|
|
273806
|
+
await mkdir18(dirname30(cacheAbs), { recursive: true });
|
|
273732
273807
|
await writeFile21(cacheAbs, result.audioBuffer);
|
|
273733
273808
|
await writeAssetMetadata({
|
|
273734
273809
|
projectDir: ctx.projectDir,
|
|
@@ -273785,7 +273860,7 @@ async function dispatchTranscript(beat, narrationPath, narrationFresh, ctx) {
|
|
|
273785
273860
|
return "skipped";
|
|
273786
273861
|
}
|
|
273787
273862
|
try {
|
|
273788
|
-
await
|
|
273863
|
+
await mkdir18(dirname30(abs), { recursive: true });
|
|
273789
273864
|
await writeFile21(abs, JSON.stringify(words, null, 2), "utf-8");
|
|
273790
273865
|
} catch (err) {
|
|
273791
273866
|
ctx.onProgress({
|
|
@@ -273874,8 +273949,8 @@ async function buildCharacters(characters, ctx) {
|
|
|
273874
273949
|
}
|
|
273875
273950
|
const cacheAbs = join66(ctx.projectDir, cache.path);
|
|
273876
273951
|
if (existsSync57(cacheAbs) && !ctx.force) {
|
|
273877
|
-
await
|
|
273878
|
-
await
|
|
273952
|
+
await mkdir18(dirname30(abs), { recursive: true });
|
|
273953
|
+
await copyFile5(cacheAbs, abs);
|
|
273879
273954
|
await writeAssetMetadata({
|
|
273880
273955
|
projectDir: ctx.projectDir,
|
|
273881
273956
|
kind: "character",
|
|
@@ -273907,9 +273982,9 @@ async function buildCharacters(characters, ctx) {
|
|
|
273907
273982
|
ctx.onProgress({ type: "character-failed", name: character.name, error: generated.error });
|
|
273908
273983
|
continue;
|
|
273909
273984
|
}
|
|
273910
|
-
await
|
|
273985
|
+
await mkdir18(dirname30(abs), { recursive: true });
|
|
273911
273986
|
await writeImageFile(abs, generated.buffer);
|
|
273912
|
-
await
|
|
273987
|
+
await mkdir18(dirname30(cacheAbs), { recursive: true });
|
|
273913
273988
|
await writeImageFile(cacheAbs, generated.buffer);
|
|
273914
273989
|
await writeAssetMetadata({
|
|
273915
273990
|
projectDir: ctx.projectDir,
|
|
@@ -273979,8 +274054,8 @@ async function dispatchBackdrop(beat, ctx) {
|
|
|
273979
274054
|
}
|
|
273980
274055
|
const cacheAbs = join66(ctx.projectDir, cache.path);
|
|
273981
274056
|
if (existsSync57(cacheAbs) && !ctx.force) {
|
|
273982
|
-
await
|
|
273983
|
-
await
|
|
274057
|
+
await mkdir18(dirname30(abs), { recursive: true });
|
|
274058
|
+
await copyFile5(cacheAbs, abs);
|
|
273984
274059
|
await writeAssetMetadata({
|
|
273985
274060
|
projectDir: ctx.projectDir,
|
|
273986
274061
|
kind: "backdrop",
|
|
@@ -274009,10 +274084,10 @@ async function dispatchBackdrop(beat, ctx) {
|
|
|
274009
274084
|
ctx.onProgress({ type: "backdrop-failed", beatId: beat.id, error });
|
|
274010
274085
|
return { status: "failed", error };
|
|
274011
274086
|
}
|
|
274012
|
-
await
|
|
274087
|
+
await mkdir18(dirname30(abs), { recursive: true });
|
|
274013
274088
|
const buffer = generated.buffer;
|
|
274014
274089
|
await writeImageFile(abs, buffer);
|
|
274015
|
-
await
|
|
274090
|
+
await mkdir18(dirname30(cacheAbs), { recursive: true });
|
|
274016
274091
|
await writeImageFile(cacheAbs, buffer);
|
|
274017
274092
|
await writeAssetMetadata({
|
|
274018
274093
|
projectDir: ctx.projectDir,
|
|
@@ -274105,8 +274180,8 @@ async function ensureKeyframe(beat, ctx, keyframeCue, characterRefsRel) {
|
|
|
274105
274180
|
}
|
|
274106
274181
|
const cacheAbs = join66(ctx.projectDir, cache.path);
|
|
274107
274182
|
if (existsSync57(cacheAbs) && !ctx.force) {
|
|
274108
|
-
await
|
|
274109
|
-
await
|
|
274183
|
+
await mkdir18(dirname30(abs), { recursive: true });
|
|
274184
|
+
await copyFile5(cacheAbs, abs);
|
|
274110
274185
|
await writeAssetMetadata({
|
|
274111
274186
|
projectDir: ctx.projectDir,
|
|
274112
274187
|
kind: "keyframe",
|
|
@@ -274123,7 +274198,7 @@ async function ensureKeyframe(beat, ctx, keyframeCue, characterRefsRel) {
|
|
|
274123
274198
|
const sheetBuffers = [];
|
|
274124
274199
|
for (const relPath of characterRefsRel) {
|
|
274125
274200
|
const sheetAbs = join66(ctx.projectDir, relPath);
|
|
274126
|
-
if (existsSync57(sheetAbs)) sheetBuffers.push(await
|
|
274201
|
+
if (existsSync57(sheetAbs)) sheetBuffers.push(await readFile23(sheetAbs));
|
|
274127
274202
|
}
|
|
274128
274203
|
const imgCtx = {
|
|
274129
274204
|
projectDir: ctx.projectDir,
|
|
@@ -274135,9 +274210,9 @@ async function ensureKeyframe(beat, ctx, keyframeCue, characterRefsRel) {
|
|
|
274135
274210
|
const identityLock = "Keep the EXACT same person and face as the reference image(s): identical facial features (eyes, nose shape, jawline), skin tone and complexion, hairstyle, hair color, and wardrobe. Do not restyle or change the face. Change only the scene, pose, framing, and lighting. ";
|
|
274136
274211
|
const generated = sheetBuffers.length > 0 ? await editKeyframeImage(`${identityLock}${keyframeCue}`, sheetBuffers, imgCtx, ratio) : await generateBackdropImage(keyframeCue, imgCtx, ratio);
|
|
274137
274212
|
if (!generated.success) return { status: "failed", error: generated.error };
|
|
274138
|
-
await
|
|
274213
|
+
await mkdir18(dirname30(abs), { recursive: true });
|
|
274139
274214
|
await writeImageFile(abs, generated.buffer);
|
|
274140
|
-
await
|
|
274215
|
+
await mkdir18(dirname30(cacheAbs), { recursive: true });
|
|
274141
274216
|
await writeImageFile(cacheAbs, generated.buffer);
|
|
274142
274217
|
await writeAssetMetadata({
|
|
274143
274218
|
projectDir: ctx.projectDir,
|
|
@@ -274219,8 +274294,8 @@ async function dispatchVideo(beat, ctx, keyframe) {
|
|
|
274219
274294
|
}
|
|
274220
274295
|
const cacheAbs = join66(ctx.projectDir, cache.path);
|
|
274221
274296
|
if (existsSync57(cacheAbs) && !ctx.force) {
|
|
274222
|
-
await
|
|
274223
|
-
await
|
|
274297
|
+
await mkdir18(dirname30(abs), { recursive: true });
|
|
274298
|
+
await copyFile5(cacheAbs, abs);
|
|
274224
274299
|
await writeAssetMetadata({
|
|
274225
274300
|
projectDir: ctx.projectDir,
|
|
274226
274301
|
kind: "video",
|
|
@@ -274329,8 +274404,8 @@ async function dispatchVideo(beat, ctx, keyframe) {
|
|
|
274329
274404
|
}
|
|
274330
274405
|
if (result.status === "completed" && existsSync57(abs)) {
|
|
274331
274406
|
await settleJob("completed");
|
|
274332
|
-
await
|
|
274333
|
-
await
|
|
274407
|
+
await mkdir18(dirname30(cacheAbs), { recursive: true });
|
|
274408
|
+
await copyFile5(abs, cacheAbs);
|
|
274334
274409
|
await writeAssetMetadata({
|
|
274335
274410
|
projectDir: ctx.projectDir,
|
|
274336
274411
|
kind: "video",
|
|
@@ -274414,8 +274489,8 @@ async function dispatchMusic(beat, ctx) {
|
|
|
274414
274489
|
}
|
|
274415
274490
|
const cacheAbs = join66(ctx.projectDir, cache.path);
|
|
274416
274491
|
if (existsSync57(cacheAbs) && !ctx.force) {
|
|
274417
|
-
await
|
|
274418
|
-
await
|
|
274492
|
+
await mkdir18(dirname30(abs), { recursive: true });
|
|
274493
|
+
await copyFile5(cacheAbs, abs);
|
|
274419
274494
|
await writeAssetMetadata({
|
|
274420
274495
|
projectDir: ctx.projectDir,
|
|
274421
274496
|
kind: "music",
|
|
@@ -274492,8 +274567,8 @@ async function dispatchMusic(beat, ctx) {
|
|
|
274492
274567
|
ctx.onProgress({ type: "music-failed", beatId: beat.id, error });
|
|
274493
274568
|
return { status: "failed", error };
|
|
274494
274569
|
}
|
|
274495
|
-
await
|
|
274496
|
-
await
|
|
274570
|
+
await mkdir18(dirname30(cacheAbs), { recursive: true });
|
|
274571
|
+
await copyFile5(abs, cacheAbs);
|
|
274497
274572
|
await writeAssetMetadata({
|
|
274498
274573
|
projectDir: ctx.projectDir,
|
|
274499
274574
|
kind: "music",
|
|
@@ -275235,7 +275310,7 @@ __export(ai_audio_exports, {
|
|
|
275235
275310
|
executeVoiceClone: () => executeVoiceClone
|
|
275236
275311
|
});
|
|
275237
275312
|
import { resolve as resolve44, dirname as dirname31, basename as basename10, extname as extname13, join as join67 } from "node:path";
|
|
275238
|
-
import { mkdir as
|
|
275313
|
+
import { mkdir as mkdir19, mkdtemp as mkdtemp5, readFile as readFile24, rm as rm8, writeFile as writeFile23 } from "node:fs/promises";
|
|
275239
275314
|
import { tmpdir as tmpdir9 } from "node:os";
|
|
275240
275315
|
import { existsSync as existsSync58 } from "node:fs";
|
|
275241
275316
|
async function executeTranscribe(options) {
|
|
@@ -275275,7 +275350,7 @@ async function executeIsolate(options) {
|
|
|
275275
275350
|
if (!existsSync58(absPath)) return { success: false, error: `File not found: ${absPath}`, errorKind: "not-found" };
|
|
275276
275351
|
const key2 = await getConfiguredApiKey("ELEVENLABS_API_KEY", apiKey);
|
|
275277
275352
|
if (!key2) return { success: false, error: "ELEVENLABS_API_KEY required", errorKind: "auth" };
|
|
275278
|
-
const audioBuffer = await
|
|
275353
|
+
const audioBuffer = await readFile24(absPath);
|
|
275279
275354
|
const elevenlabs = new ElevenLabsProvider();
|
|
275280
275355
|
await elevenlabs.initialize({ apiKey: key2 });
|
|
275281
275356
|
const result = await elevenlabs.isolateVocals(audioBuffer);
|
|
@@ -275301,7 +275376,7 @@ async function executeVoiceClone(options) {
|
|
|
275301
275376
|
for (const samplePath of samplePaths) {
|
|
275302
275377
|
const absPath = resolve44(process.cwd(), samplePath);
|
|
275303
275378
|
if (!existsSync58(absPath)) return { success: false, error: `File not found: ${samplePath}`, errorKind: "not-found" };
|
|
275304
|
-
const buffer = await
|
|
275379
|
+
const buffer = await readFile24(absPath);
|
|
275305
275380
|
audioBuffers.push(buffer);
|
|
275306
275381
|
}
|
|
275307
275382
|
const elevenlabs = new ElevenLabsProvider();
|
|
@@ -275398,7 +275473,7 @@ async function mixAtOffsets(clips, outputPath) {
|
|
|
275398
275473
|
return `[${i3}:a]${tempo}adelay=${delay}|${delay}[a${i3}]`;
|
|
275399
275474
|
});
|
|
275400
275475
|
const mix = `${clips.map((_4, i3) => `[a${i3}]`).join("")}amix=inputs=${clips.length}:normalize=0:dropout_transition=0[out]`;
|
|
275401
|
-
await
|
|
275476
|
+
await mkdir19(dirname31(outputPath), { recursive: true });
|
|
275402
275477
|
await execSafe("ffmpeg", ["-y", "-loglevel", "error", ...inputs, "-filter_complex", [...chains, mix].join(";"), "-map", "[out]", outputPath]);
|
|
275403
275478
|
}
|
|
275404
275479
|
async function executeDuck(options) {
|
|
@@ -275454,7 +275529,7 @@ var init_ai_audio = __esm({
|
|
|
275454
275529
|
|
|
275455
275530
|
// ../cli/src/commands/_shared/edit/silence-cut.ts
|
|
275456
275531
|
import { existsSync as existsSync59 } from "node:fs";
|
|
275457
|
-
import { readFile as
|
|
275532
|
+
import { readFile as readFile25 } from "node:fs/promises";
|
|
275458
275533
|
async function detectSilencePeriods(videoPath, noiseThreshold, minDuration) {
|
|
275459
275534
|
const totalDuration = await getVideoDuration(videoPath);
|
|
275460
275535
|
const { stdout, stderr } = await execSafe(
|
|
@@ -275504,7 +275579,7 @@ async function detectSilencePeriodsWithGemini(videoPath, minDuration, options) {
|
|
|
275504
275579
|
}
|
|
275505
275580
|
const gemini = new GeminiProvider();
|
|
275506
275581
|
await gemini.initialize({ apiKey: geminiApiKey });
|
|
275507
|
-
const videoBuffer = await
|
|
275582
|
+
const videoBuffer = await readFile25(videoPath);
|
|
275508
275583
|
const modelId = options.model ? resolveGeminiTextModel(options.model) : void 0;
|
|
275509
275584
|
const prompt3 = `Analyze this video and identify all silent or dead segments where there is NO meaningful content.
|
|
275510
275585
|
|
|
@@ -275689,7 +275764,7 @@ var init_silence_cut = __esm({
|
|
|
275689
275764
|
|
|
275690
275765
|
// ../cli/src/commands/_shared/edit/jump-cut.ts
|
|
275691
275766
|
import { existsSync as existsSync60 } from "node:fs";
|
|
275692
|
-
import { writeFile as writeFile24, mkdir as
|
|
275767
|
+
import { writeFile as writeFile24, mkdir as mkdir20 } from "node:fs/promises";
|
|
275693
275768
|
import { join as join68 } from "node:path";
|
|
275694
275769
|
async function transcribeWithWords(audioPath, apiKey, language) {
|
|
275695
275770
|
const result = await transcribeAudioFile(audioPath, { apiKey, language, granularity: "word" });
|
|
@@ -275751,7 +275826,7 @@ async function executeJumpCut(options) {
|
|
|
275751
275826
|
}
|
|
275752
275827
|
try {
|
|
275753
275828
|
const tmpDir = `/tmp/vibe_jumpcut_${Date.now()}`;
|
|
275754
|
-
await
|
|
275829
|
+
await mkdir20(tmpDir, { recursive: true });
|
|
275755
275830
|
const audioPath = join68(tmpDir, "audio.wav");
|
|
275756
275831
|
try {
|
|
275757
275832
|
await execSafe(
|
|
@@ -275935,7 +276010,7 @@ __export(remotion_exports, {
|
|
|
275935
276010
|
wrapComponentWithImage: () => wrapComponentWithImage,
|
|
275936
276011
|
wrapComponentWithVideo: () => wrapComponentWithVideo
|
|
275937
276012
|
});
|
|
275938
|
-
import { writeFile as writeFile25, mkdir as
|
|
276013
|
+
import { writeFile as writeFile25, mkdir as mkdir21, rm as rm9, copyFile as copyFile6 } from "node:fs/promises";
|
|
275939
276014
|
import { existsSync as existsSync61 } from "node:fs";
|
|
275940
276015
|
import { join as join69 } from "node:path";
|
|
275941
276016
|
import { tmpdir as tmpdir10 } from "node:os";
|
|
@@ -275955,7 +276030,7 @@ async function ensureRemotionInstalled() {
|
|
|
275955
276030
|
}
|
|
275956
276031
|
async function scaffoldRemotionProject(componentCode, componentName, opts) {
|
|
275957
276032
|
const dir = join69(tmpdir10(), `vibe_motion_${Date.now()}`);
|
|
275958
|
-
await
|
|
276033
|
+
await mkdir21(dir, { recursive: true });
|
|
275959
276034
|
const deps = {
|
|
275960
276035
|
remotion: REMOTION_VERSION,
|
|
275961
276036
|
"@remotion/cli": REMOTION_VERSION,
|
|
@@ -276019,7 +276094,7 @@ registerRoot(Root);
|
|
|
276019
276094
|
} else {
|
|
276020
276095
|
await this_npmInstall(dir);
|
|
276021
276096
|
try {
|
|
276022
|
-
await
|
|
276097
|
+
await mkdir21(REMOTION_CACHE_DIR, { recursive: true });
|
|
276023
276098
|
await writeFile25(join69(REMOTION_CACHE_DIR, "package.json"), packageJsonStr);
|
|
276024
276099
|
if (existsSync61(join69(dir, "node_modules"))) {
|
|
276025
276100
|
const { rename: rename7, symlink: symlink4 } = await import("node:fs/promises");
|
|
@@ -276177,8 +276252,8 @@ async function renderWithEmbeddedImage(options) {
|
|
|
276177
276252
|
);
|
|
276178
276253
|
try {
|
|
276179
276254
|
const publicDir = join69(dir, "public");
|
|
276180
|
-
await
|
|
276181
|
-
await
|
|
276255
|
+
await mkdir21(publicDir, { recursive: true });
|
|
276256
|
+
await copyFile6(options.imagePath, join69(publicDir, options.imageFileName));
|
|
276182
276257
|
const entryPoint = join69(dir, "Root.tsx");
|
|
276183
276258
|
const mp4Out = options.outputPath.replace(/\.\w+$/, ".mp4");
|
|
276184
276259
|
const { execFile: execFileImg } = await import("node:child_process");
|
|
@@ -276241,8 +276316,8 @@ async function renderWithEmbeddedVideo(options) {
|
|
|
276241
276316
|
);
|
|
276242
276317
|
try {
|
|
276243
276318
|
const publicDir = join69(dir, "public");
|
|
276244
|
-
await
|
|
276245
|
-
await
|
|
276319
|
+
await mkdir21(publicDir, { recursive: true });
|
|
276320
|
+
await copyFile6(options.videoPath, join69(publicDir, options.videoFileName));
|
|
276246
276321
|
const entryPoint = join69(dir, "Root.tsx");
|
|
276247
276322
|
const mp4VideoOnly = options.outputPath.replace(/\.\w+$/, "_video_only.mp4");
|
|
276248
276323
|
const { execFile: execFileVid } = await import("node:child_process");
|
|
@@ -276665,7 +276740,7 @@ var init_remotion = __esm({
|
|
|
276665
276740
|
|
|
276666
276741
|
// ../cli/src/commands/_shared/edit/caption.ts
|
|
276667
276742
|
import { existsSync as existsSync63 } from "node:fs";
|
|
276668
|
-
import { writeFile as writeFile26, mkdir as
|
|
276743
|
+
import { writeFile as writeFile26, mkdir as mkdir23 } from "node:fs/promises";
|
|
276669
276744
|
import { dirname as dirname32, basename as basename11, extname as extname14, join as join70 } from "node:path";
|
|
276670
276745
|
function getCaptionForceStyle(style, fontSize, fontColor, position) {
|
|
276671
276746
|
const alignment = position === "top" ? 8 : position === "center" ? 5 : 2;
|
|
@@ -276712,7 +276787,7 @@ async function executeCaption(options) {
|
|
|
276712
276787
|
}
|
|
276713
276788
|
try {
|
|
276714
276789
|
const tmpDir = `/tmp/vibe_caption_${Date.now()}`;
|
|
276715
|
-
await
|
|
276790
|
+
await mkdir23(tmpDir, { recursive: true });
|
|
276716
276791
|
const audioPath = join70(tmpDir, "audio.wav");
|
|
276717
276792
|
const srtPath = join70(tmpDir, "captions.srt");
|
|
276718
276793
|
try {
|
|
@@ -277006,7 +277081,7 @@ var init_fade = __esm({
|
|
|
277006
277081
|
|
|
277007
277082
|
// ../cli/src/commands/_shared/edit/translate-srt.ts
|
|
277008
277083
|
import { existsSync as existsSync66 } from "node:fs";
|
|
277009
|
-
import { readFile as
|
|
277084
|
+
import { readFile as readFile26, writeFile as writeFile27 } from "node:fs/promises";
|
|
277010
277085
|
async function executeTranslateSrt(options) {
|
|
277011
277086
|
const {
|
|
277012
277087
|
srtPath,
|
|
@@ -277020,7 +277095,7 @@ async function executeTranslateSrt(options) {
|
|
|
277020
277095
|
return { success: false, error: `SRT file not found: ${srtPath}` };
|
|
277021
277096
|
}
|
|
277022
277097
|
try {
|
|
277023
|
-
const srtContent = await
|
|
277098
|
+
const srtContent = await readFile26(srtPath, "utf-8");
|
|
277024
277099
|
const segments = parseSRT(srtContent);
|
|
277025
277100
|
if (segments.length === 0) {
|
|
277026
277101
|
return { success: false, error: "No subtitle segments found in SRT file" };
|
|
@@ -278252,7 +278327,7 @@ var init_project_resolver = __esm({
|
|
|
278252
278327
|
|
|
278253
278328
|
// ../cli/src/commands/_shared/execute-fill-gaps.ts
|
|
278254
278329
|
import { existsSync as existsSync69 } from "node:fs";
|
|
278255
|
-
import { readFile as
|
|
278330
|
+
import { readFile as readFile27, writeFile as writeFile28, mkdir as mkdir24, rename as renameFs } from "node:fs/promises";
|
|
278256
278331
|
import { resolve as resolve48, dirname as dirname33 } from "node:path";
|
|
278257
278332
|
function detectVideoGaps(videoClips, totalDuration) {
|
|
278258
278333
|
const gaps = [];
|
|
@@ -278309,7 +278384,7 @@ function analyzeGapFillability(gaps, videoClips, sources) {
|
|
|
278309
278384
|
}
|
|
278310
278385
|
async function uploadFrame(host, framePath) {
|
|
278311
278386
|
try {
|
|
278312
|
-
const upload = await host.uploadImage(await
|
|
278387
|
+
const upload = await host.uploadImage(await readFile27(framePath), {
|
|
278313
278388
|
filename: framePath,
|
|
278314
278389
|
mimeType: "image/png"
|
|
278315
278390
|
});
|
|
@@ -278349,7 +278424,7 @@ async function executeFillGaps(options) {
|
|
|
278349
278424
|
humanLines
|
|
278350
278425
|
};
|
|
278351
278426
|
}
|
|
278352
|
-
const content = await
|
|
278427
|
+
const content = await readFile27(filePath, "utf-8");
|
|
278353
278428
|
const data2 = JSON.parse(content);
|
|
278354
278429
|
const project = Project.fromJSON(data2);
|
|
278355
278430
|
const clips = project.getClips().sort((a4, b4) => a4.startTime - b4.startTime);
|
|
@@ -278470,7 +278545,7 @@ async function executeFillGaps(options) {
|
|
|
278470
278545
|
const projectDir = dirname33(filePath);
|
|
278471
278546
|
const footageDir = options.dir ? resolve48(process.cwd(), options.dir) : resolve48(projectDir, "footage");
|
|
278472
278547
|
if (!existsSync69(footageDir)) {
|
|
278473
|
-
await
|
|
278548
|
+
await mkdir24(footageDir, { recursive: true });
|
|
278474
278549
|
}
|
|
278475
278550
|
humanLines.push("Generating AI Videos");
|
|
278476
278551
|
let uploadHost;
|
|
@@ -278768,7 +278843,7 @@ __export(ai_motion_exports, {
|
|
|
278768
278843
|
});
|
|
278769
278844
|
import { resolve as resolve49 } from "node:path";
|
|
278770
278845
|
import { existsSync as existsSync70 } from "node:fs";
|
|
278771
|
-
import { readFile as
|
|
278846
|
+
import { readFile as readFile28, writeFile as writeFile29 } from "node:fs/promises";
|
|
278772
278847
|
function resolveMotionModel(alias) {
|
|
278773
278848
|
const claude = findModel("claude", "llm", alias);
|
|
278774
278849
|
if (claude) return { provider: "claude", modelId: claude.id };
|
|
@@ -278822,7 +278897,7 @@ async function executeMotion(options) {
|
|
|
278822
278897
|
};
|
|
278823
278898
|
}
|
|
278824
278899
|
const imagePath = resolve49(process.cwd(), options.image);
|
|
278825
|
-
const imageBuffer = await
|
|
278900
|
+
const imageBuffer = await readFile28(imagePath);
|
|
278826
278901
|
const gemini = new GeminiProvider();
|
|
278827
278902
|
await gemini.initialize({ apiKey: geminiApiKey });
|
|
278828
278903
|
const analysisResult = await gemini.analyzeImage(
|
|
@@ -278859,7 +278934,7 @@ Use this image analysis to inform the color palette, typography placement, and o
|
|
|
278859
278934
|
}
|
|
278860
278935
|
if (geminiApiKey) {
|
|
278861
278936
|
const videoPath = resolve49(process.cwd(), options.video);
|
|
278862
|
-
const videoBuffer = await
|
|
278937
|
+
const videoBuffer = await readFile28(videoPath);
|
|
278863
278938
|
const gemini = new GeminiProvider();
|
|
278864
278939
|
await gemini.initialize({ apiKey: geminiApiKey });
|
|
278865
278940
|
const analysisPrompt = options.understandingPrompt || `Analyze this video for motion graphics composition. Return concise production guidance:
|
|
@@ -278893,7 +278968,7 @@ Use this video understanding to place motion graphics in safe zones, match the c
|
|
|
278893
278968
|
if (!existsSync70(tsxPath)) {
|
|
278894
278969
|
return { success: false, error: `TSX file not found: ${tsxPath}` };
|
|
278895
278970
|
}
|
|
278896
|
-
const existingCode = await
|
|
278971
|
+
const existingCode = await readFile28(tsxPath, "utf-8");
|
|
278897
278972
|
if (useGemini) {
|
|
278898
278973
|
const gemini = new GeminiProvider();
|
|
278899
278974
|
await gemini.initialize({ apiKey });
|
|
@@ -279183,8 +279258,7 @@ var init_ai_motion = __esm({
|
|
|
279183
279258
|
});
|
|
279184
279259
|
|
|
279185
279260
|
// ../cli/src/commands/edit/lottie-overlay.ts
|
|
279186
|
-
import {
|
|
279187
|
-
import { copyFile as copyFile6, mkdir as mkdir24, mkdtemp as mkdtemp6, readFile as readFile28, rm as rm10, writeFile as writeFile30 } from "node:fs/promises";
|
|
279261
|
+
import { copyFile as copyFile7, mkdir as mkdir25, mkdtemp as mkdtemp6, rm as rm10, writeFile as writeFile30 } from "node:fs/promises";
|
|
279188
279262
|
import { tmpdir as tmpdir11 } from "node:os";
|
|
279189
279263
|
import { basename as basename13, extname as extname16, join as join71 } from "node:path";
|
|
279190
279264
|
async function probeVideoStream(path15) {
|
|
@@ -279213,27 +279287,6 @@ async function probeVideoStream(path15) {
|
|
|
279213
279287
|
duration: Number(info.format?.duration ?? 0)
|
|
279214
279288
|
};
|
|
279215
279289
|
}
|
|
279216
|
-
async function checkLottieAsset(path15) {
|
|
279217
|
-
const bytes = await readFile28(path15);
|
|
279218
|
-
const isZip = bytes.length > 4 && bytes[0] === 80 && bytes[1] === 75;
|
|
279219
|
-
if (isZip) return void 0;
|
|
279220
|
-
try {
|
|
279221
|
-
const json = JSON.parse(bytes.toString("utf-8"));
|
|
279222
|
-
if (Array.isArray(json.layers)) return void 0;
|
|
279223
|
-
} catch {
|
|
279224
|
-
}
|
|
279225
|
-
return `${basename13(path15)} is not a Lottie animation (expected Lottie JSON or a .lottie archive).`;
|
|
279226
|
-
}
|
|
279227
|
-
function overlayBox(layer, position, scale) {
|
|
279228
|
-
if (position === "full") return { left: 0, top: 0, width: layer.width, height: layer.height };
|
|
279229
|
-
const width = Math.max(1, Math.round(layer.width * scale));
|
|
279230
|
-
const height = Math.max(1, Math.round(layer.height * scale));
|
|
279231
|
-
const marginX = Math.round(layer.width * 0.04);
|
|
279232
|
-
const marginY = Math.round(layer.height * 0.04);
|
|
279233
|
-
const left3 = position === "center" ? Math.round((layer.width - width) / 2) : position.endsWith("left") ? marginX : layer.width - marginX - width;
|
|
279234
|
-
const top3 = position === "center" ? Math.round((layer.height - height) / 2) : position.startsWith("top") ? marginY : layer.height - marginY - height;
|
|
279235
|
-
return { left: left3, top: top3, width, height };
|
|
279236
|
-
}
|
|
279237
279290
|
function lottieLayerHtml(opts) {
|
|
279238
279291
|
const { box } = opts;
|
|
279239
279292
|
return `<!DOCTYPE html>
|
|
@@ -279246,11 +279299,8 @@ function lottieLayerHtml(opts) {
|
|
|
279246
279299
|
</head><body>
|
|
279247
279300
|
<canvas id="lottie" width="${box.width}" height="${box.height}"></canvas>
|
|
279248
279301
|
<script type="module">
|
|
279249
|
-
|
|
279250
|
-
|
|
279251
|
-
// WebAssembly.instantiateStreaming reject it; a typed Blob URL avoids that.
|
|
279252
|
-
const wasm = await (await fetch("./vendor/dotlottie-player.wasm")).arrayBuffer();
|
|
279253
|
-
DotLottie.setWasmUrl(URL.createObjectURL(new Blob([wasm], { type: "application/wasm" })));
|
|
279302
|
+
${DOTLOTTIE_BROWSER_HELPERS}
|
|
279303
|
+
const DotLottie = await loadDotLottie("./vendor");
|
|
279254
279304
|
const LOOP = ${opts.loop};
|
|
279255
279305
|
const DURATION = ${opts.duration};
|
|
279256
279306
|
const player = new DotLottie({
|
|
@@ -279267,12 +279317,7 @@ function lottieLayerHtml(opts) {
|
|
|
279267
279317
|
window.__hf = {
|
|
279268
279318
|
duration: DURATION,
|
|
279269
279319
|
seek(t) {
|
|
279270
|
-
|
|
279271
|
-
const frames = player.totalFrames;
|
|
279272
|
-
if (!(length > 0) || !(frames > 0)) return;
|
|
279273
|
-
const local = Math.max(0, Number(t) || 0);
|
|
279274
|
-
const at = LOOP ? local % length : Math.min(local, length);
|
|
279275
|
-
player.setFrame(Math.min(frames - 1, (at / length) * frames));
|
|
279320
|
+
setLottieTime(player, t, LOOP);
|
|
279276
279321
|
},
|
|
279277
279322
|
};
|
|
279278
279323
|
window.__hf.seek(0);
|
|
@@ -279281,21 +279326,12 @@ function lottieLayerHtml(opts) {
|
|
|
279281
279326
|
</body></html>
|
|
279282
279327
|
`;
|
|
279283
279328
|
}
|
|
279284
|
-
function vendorPaths() {
|
|
279285
|
-
const require5 = createRequire4(import.meta.url);
|
|
279286
|
-
const script = require5.resolve("@lottiefiles/dotlottie-web");
|
|
279287
|
-
const dist = join71(script, "..");
|
|
279288
|
-
return { script: join71(dist, "index.js"), wasm: join71(dist, "dotlottie-player.wasm") };
|
|
279289
|
-
}
|
|
279290
279329
|
async function renderLayer(opts) {
|
|
279291
279330
|
const { dir, info, options } = opts;
|
|
279292
|
-
|
|
279293
|
-
await
|
|
279294
|
-
await mkdir24(join71(dir, "assets"), { recursive: true });
|
|
279295
|
-
await copyFile6(vendor.script, join71(dir, "vendor", "dotlottie-web.js"));
|
|
279296
|
-
await copyFile6(vendor.wasm, join71(dir, "vendor", "dotlottie-player.wasm"));
|
|
279331
|
+
await copyDotLottieRuntime(join71(dir, "vendor"));
|
|
279332
|
+
await mkdir25(join71(dir, "assets"), { recursive: true });
|
|
279297
279333
|
const assetName = `animation${extname16(options.assetPath).toLowerCase()}`;
|
|
279298
|
-
await
|
|
279334
|
+
await copyFile7(options.assetPath, join71(dir, "assets", assetName));
|
|
279299
279335
|
const html = lottieLayerHtml({
|
|
279300
279336
|
width: info.width,
|
|
279301
279337
|
height: info.height,
|
|
@@ -279390,6 +279426,7 @@ var init_lottie_overlay = __esm({
|
|
|
279390
279426
|
init_chrome3();
|
|
279391
279427
|
init_exec_safe();
|
|
279392
279428
|
init_stdout_guard();
|
|
279429
|
+
init_lottie();
|
|
279393
279430
|
FFMPEG_MISSING = "FFmpeg not found. Install with: brew install ffmpeg (macOS) or apt install ffmpeg (Linux). Run `vibe doctor` for details.";
|
|
279394
279431
|
}
|
|
279395
279432
|
});
|
|
@@ -279400,7 +279437,7 @@ __export(motion_overlay_exports, {
|
|
|
279400
279437
|
executeMotionOverlay: () => executeMotionOverlay,
|
|
279401
279438
|
registerMotionOverlayCommand: () => registerMotionOverlayCommand
|
|
279402
279439
|
});
|
|
279403
|
-
import { mkdir as
|
|
279440
|
+
import { mkdir as mkdir26 } from "node:fs/promises";
|
|
279404
279441
|
import { existsSync as existsSync71 } from "node:fs";
|
|
279405
279442
|
import { dirname as dirname34, extname as extname17, resolve as resolve50 } from "node:path";
|
|
279406
279443
|
function normalizeUnderstand2(value) {
|
|
@@ -279448,7 +279485,7 @@ async function executeMotionOverlay(options) {
|
|
|
279448
279485
|
}
|
|
279449
279486
|
const remaining = videoDuration - start;
|
|
279450
279487
|
const position = normalizePosition(options.position);
|
|
279451
|
-
await
|
|
279488
|
+
await mkdir26(dirname34(outputPath), { recursive: true });
|
|
279452
279489
|
const result2 = await renderLottieOverlay({
|
|
279453
279490
|
videoPath: absVideo,
|
|
279454
279491
|
assetPath: absAsset,
|
|
@@ -279466,7 +279503,7 @@ async function executeMotionOverlay(options) {
|
|
|
279466
279503
|
return { success: true, outputPath, provider: "lottie" };
|
|
279467
279504
|
}
|
|
279468
279505
|
const duration = options.duration ?? await ffprobeDuration(absVideo).catch(() => void 0);
|
|
279469
|
-
await
|
|
279506
|
+
await mkdir26(dirname34(outputPath), { recursive: true });
|
|
279470
279507
|
const result = await executeMotion({
|
|
279471
279508
|
description: options.description.trim(),
|
|
279472
279509
|
video: absVideo,
|
|
@@ -281151,10 +281188,10 @@ var init_tty = __esm({
|
|
|
281151
281188
|
});
|
|
281152
281189
|
|
|
281153
281190
|
// ../cli/src/utils/audio-file.ts
|
|
281154
|
-
import { mkdir as
|
|
281191
|
+
import { mkdir as mkdir28, rm as rm12, writeFile as writeFile36 } from "node:fs/promises";
|
|
281155
281192
|
import { dirname as dirname36, extname as extname19 } from "node:path";
|
|
281156
281193
|
async function writeAudioFile(path15, bytes, container) {
|
|
281157
|
-
await
|
|
281194
|
+
await mkdir28(dirname36(path15), { recursive: true });
|
|
281158
281195
|
const wanted = extname19(path15).toLowerCase();
|
|
281159
281196
|
if (!CONVERTIBLE.has(wanted) || wanted === `.${container}`) {
|
|
281160
281197
|
await writeFile36(path15, bytes);
|
|
@@ -281271,7 +281308,7 @@ var init_speech2 = __esm({
|
|
|
281271
281308
|
// ../cli/src/commands/generate/thumbnail.ts
|
|
281272
281309
|
import { resolve as resolve63, dirname as dirname37, basename as basename16, extname as extname20 } from "node:path";
|
|
281273
281310
|
import { existsSync as existsSync79 } from "node:fs";
|
|
281274
|
-
import { writeFile as writeFile37, mkdir as
|
|
281311
|
+
import { writeFile as writeFile37, mkdir as mkdir29 } from "node:fs/promises";
|
|
281275
281312
|
function registerThumbnailCommand(parent) {
|
|
281276
281313
|
parent.command("thumbnail").description("Generate video thumbnail (DALL-E) or extract best frame from video (Gemini)").argument("[description]", "Thumbnail description (for DALL-E generation)").option("-k, --api-key <key>", "API key (OpenAI for generation, Google for best-frame)").option("-o, --output <path>", "Output file path").option("--style <style>", "Platform style: youtube, instagram, tiktok, twitter").option("--best-frame <video>", "Extract best thumbnail frame from video using Gemini AI").option("--prompt <prompt>", "Custom prompt for best-frame analysis").option("--model <model>", `Gemini model: ${GEMINI_TEXT_MODEL_HELP}`, "flash").action(async (description, options) => {
|
|
281277
281314
|
const startedAt = Date.now();
|
|
@@ -281362,7 +281399,7 @@ function registerThumbnailCommand(parent) {
|
|
|
281362
281399
|
throw new Error("No image data available");
|
|
281363
281400
|
}
|
|
281364
281401
|
outputPath = resolve63(process.cwd(), options.output);
|
|
281365
|
-
await
|
|
281402
|
+
await mkdir29(dirname37(outputPath), { recursive: true });
|
|
281366
281403
|
await writeFile37(outputPath, buffer);
|
|
281367
281404
|
}
|
|
281368
281405
|
outputSuccess({
|
|
@@ -281393,7 +281430,7 @@ function registerThumbnailCommand(parent) {
|
|
|
281393
281430
|
throw new Error("No image data available");
|
|
281394
281431
|
}
|
|
281395
281432
|
const outputPath = resolve63(process.cwd(), options.output);
|
|
281396
|
-
await
|
|
281433
|
+
await mkdir29(dirname37(outputPath), { recursive: true });
|
|
281397
281434
|
await writeFile37(outputPath, buffer);
|
|
281398
281435
|
saveSpinner.succeed(source_default.green(`Saved to: ${outputPath}`));
|
|
281399
281436
|
} catch {
|
|
@@ -302767,8 +302804,9 @@ async function runWithMcpPromotion(work, opts) {
|
|
|
302767
302804
|
let lastRecordWriteAt = 0;
|
|
302768
302805
|
let heartbeat = null;
|
|
302769
302806
|
let writes = Promise.resolve();
|
|
302807
|
+
let finished2 = false;
|
|
302770
302808
|
const writeRecord = (patch) => {
|
|
302771
|
-
if (!record) return writes;
|
|
302809
|
+
if (!record || finished2) return writes;
|
|
302772
302810
|
record = {
|
|
302773
302811
|
...record,
|
|
302774
302812
|
...patch,
|
|
@@ -302831,8 +302869,14 @@ async function runWithMcpPromotion(work, opts) {
|
|
|
302831
302869
|
void writeRecord({ heartbeatAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
302832
302870
|
}, opts.heartbeatMs ?? DEFAULT_HEARTBEAT_MS);
|
|
302833
302871
|
heartbeat.unref?.();
|
|
302872
|
+
const finish = (patch) => {
|
|
302873
|
+
if (heartbeat) clearInterval(heartbeat);
|
|
302874
|
+
const terminal2 = writeRecord(patch);
|
|
302875
|
+
finished2 = true;
|
|
302876
|
+
return terminal2;
|
|
302877
|
+
};
|
|
302834
302878
|
void workPromise.then(
|
|
302835
|
-
(result) =>
|
|
302879
|
+
(result) => finish(
|
|
302836
302880
|
result.success ? {
|
|
302837
302881
|
status: "completed",
|
|
302838
302882
|
progress: 100,
|
|
@@ -302844,13 +302888,11 @@ async function runWithMcpPromotion(work, opts) {
|
|
|
302844
302888
|
resultPayload: result.data
|
|
302845
302889
|
}
|
|
302846
302890
|
),
|
|
302847
|
-
(error) =>
|
|
302891
|
+
(error) => finish({
|
|
302848
302892
|
status: "failed",
|
|
302849
302893
|
error: error instanceof Error ? error.message : String(error)
|
|
302850
302894
|
})
|
|
302851
|
-
)
|
|
302852
|
-
if (heartbeat) clearInterval(heartbeat);
|
|
302853
|
-
});
|
|
302895
|
+
);
|
|
302854
302896
|
return {
|
|
302855
302897
|
success: true,
|
|
302856
302898
|
data: {
|
|
@@ -303132,10 +303174,11 @@ init_scene_project();
|
|
|
303132
303174
|
init_project_config();
|
|
303133
303175
|
init_cost_tier();
|
|
303134
303176
|
import { resolve as resolve30, relative as relative8, dirname as dirname25 } from "node:path";
|
|
303135
|
-
import { mkdir as
|
|
303177
|
+
import { mkdir as mkdir14, readFile as readFile17, writeFile as writeFile16, access as access4, copyFile as copyFile4 } from "node:fs/promises";
|
|
303136
303178
|
import { existsSync as existsSync47 } from "node:fs";
|
|
303137
303179
|
|
|
303138
303180
|
// ../cli/src/commands/_shared/scene-html-emit.ts
|
|
303181
|
+
init_lottie();
|
|
303139
303182
|
var SCENE_PRESETS = [
|
|
303140
303183
|
"simple",
|
|
303141
303184
|
"announcement",
|
|
@@ -303143,14 +303186,7 @@ var SCENE_PRESETS = [
|
|
|
303143
303186
|
"kinetic-type",
|
|
303144
303187
|
"product-shot"
|
|
303145
303188
|
];
|
|
303146
|
-
var
|
|
303147
|
-
"full",
|
|
303148
|
-
"center",
|
|
303149
|
-
"top-left",
|
|
303150
|
-
"top-right",
|
|
303151
|
-
"bottom-left",
|
|
303152
|
-
"bottom-right"
|
|
303153
|
-
];
|
|
303189
|
+
var LOTTIE_RUNTIME_DIR = "assets/vendor/dotlottie";
|
|
303154
303190
|
var GSAP_CDN = "https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js";
|
|
303155
303191
|
function esc(text) {
|
|
303156
303192
|
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
@@ -303449,55 +303485,45 @@ function buildPreset(input3) {
|
|
|
303449
303485
|
}
|
|
303450
303486
|
}
|
|
303451
303487
|
}
|
|
303452
|
-
|
|
303453
|
-
|
|
303454
|
-
|
|
303455
|
-
|
|
303456
|
-
function lottieOverlayStyle(input3) {
|
|
303488
|
+
function jsString(value) {
|
|
303489
|
+
return JSON.stringify(value).replace(/</g, "\\u003c");
|
|
303490
|
+
}
|
|
303491
|
+
function buildLottieOverlay(input3, canvas, sceneId, duration) {
|
|
303457
303492
|
const pos = input3.position ?? "full";
|
|
303458
|
-
const
|
|
303459
|
-
const scale = Math.max(0.01, Math.min(2, rawScale));
|
|
303493
|
+
const scale = Math.max(0.01, Math.min(2, input3.scale ?? (pos === "full" ? 1 : 0.25)));
|
|
303460
303494
|
const opacity = Math.max(0, Math.min(1, input3.opacity ?? 1));
|
|
303461
|
-
const
|
|
303462
|
-
"position:absolute",
|
|
303463
|
-
"pointer-events:none",
|
|
303464
|
-
`opacity:${opacity}`
|
|
303465
|
-
];
|
|
303466
|
-
if (pos === "full") {
|
|
303467
|
-
base2.push("inset:0", "width:100%", "height:100%");
|
|
303468
|
-
} else {
|
|
303469
|
-
const pct = scale * 100;
|
|
303470
|
-
base2.push(`width:${pct}%`, `height:${pct}%`);
|
|
303471
|
-
switch (pos) {
|
|
303472
|
-
case "center":
|
|
303473
|
-
base2.push("top:50%", "left:50%", "transform:translate(-50%,-50%)");
|
|
303474
|
-
break;
|
|
303475
|
-
case "top-left":
|
|
303476
|
-
base2.push("top:4%", "left:4%");
|
|
303477
|
-
break;
|
|
303478
|
-
case "top-right":
|
|
303479
|
-
base2.push("top:4%", "right:4%");
|
|
303480
|
-
break;
|
|
303481
|
-
case "bottom-left":
|
|
303482
|
-
base2.push("bottom:4%", "left:4%");
|
|
303483
|
-
break;
|
|
303484
|
-
case "bottom-right":
|
|
303485
|
-
base2.push("bottom:4%", "right:4%");
|
|
303486
|
-
break;
|
|
303487
|
-
}
|
|
303488
|
-
}
|
|
303489
|
-
return base2.join(";");
|
|
303490
|
-
}
|
|
303491
|
-
function buildLottieOverlay(input3, sceneId) {
|
|
303492
|
-
const loop = input3.loop ?? true ? " loop" : "";
|
|
303493
|
-
const style = lottieOverlayStyle(input3);
|
|
303495
|
+
const box = overlayBox(canvas, pos, scale);
|
|
303494
303496
|
const overlayId = `lottie-overlay-${sceneId}`;
|
|
303495
|
-
const markup = `<
|
|
303496
|
-
const
|
|
303497
|
-
|
|
303498
|
-
|
|
303499
|
-
|
|
303500
|
-
|
|
303497
|
+
const markup = `<canvas id="${overlayId}" class="lottie-overlay" width="${box.width}" height="${box.height}" style="position:absolute;left:${box.left}px;top:${box.top}px;width:${box.width}px;height:${box.height}px;pointer-events:none;opacity:${opacity}"></canvas>`;
|
|
303498
|
+
const register = `${DOTLOTTIE_BROWSER_HELPERS}
|
|
303499
|
+
(async () => {
|
|
303500
|
+
const DotLottie = await loadDotLottie(${jsString(LOTTIE_RUNTIME_DIR)});
|
|
303501
|
+
const player = new DotLottie({
|
|
303502
|
+
canvas: document.getElementById(${jsString(overlayId)}),
|
|
303503
|
+
src: ${jsString(input3.src)},
|
|
303504
|
+
autoplay: false,
|
|
303505
|
+
loop: false,
|
|
303506
|
+
renderConfig: { devicePixelRatio: 1, autoResize: false, freezeOnOffscreen: false },
|
|
303507
|
+
});
|
|
303508
|
+
await new Promise((resolve, reject) => {
|
|
303509
|
+
player.addEventListener("load", resolve);
|
|
303510
|
+
player.addEventListener("loadError", (event) => reject(event && event.error));
|
|
303511
|
+
});
|
|
303512
|
+
let sceneTime = 0;
|
|
303513
|
+
const lottieClock = {
|
|
303514
|
+
time(t) {
|
|
303515
|
+
if (t === undefined) return sceneTime;
|
|
303516
|
+
sceneTime = t;
|
|
303517
|
+
setLottieTime(player, t, ${input3.loop ?? true});
|
|
303518
|
+
},
|
|
303519
|
+
};
|
|
303520
|
+
tl.fromTo(lottieClock, { time: 0 }, { time: ${duration}, duration: ${duration}, ease: "none" }, 0);
|
|
303521
|
+
})()
|
|
303522
|
+
.catch((error) => console.error("[vibe] Lottie overlay failed to load:", ${jsString(input3.src)}, error))
|
|
303523
|
+
.finally(() => {
|
|
303524
|
+
window.__timelines["${sceneId}"] = tl;
|
|
303525
|
+
});`;
|
|
303526
|
+
return { markup, register };
|
|
303501
303527
|
}
|
|
303502
303528
|
function emitSceneHtml(input3) {
|
|
303503
303529
|
if (input3.duration <= 0) {
|
|
@@ -303520,11 +303546,10 @@ function emitSceneHtml(input3) {
|
|
|
303520
303546
|
data-volume="1"
|
|
303521
303547
|
></audio>
|
|
303522
303548
|
` : "";
|
|
303523
|
-
const lottieLayer = input3.lottie ? buildLottieOverlay(input3.lottie, id) : null;
|
|
303549
|
+
const lottieLayer = input3.lottie ? buildLottieOverlay(input3.lottie, input3, id, dur) : null;
|
|
303524
303550
|
const lottieMarkup = lottieLayer ? `
|
|
303525
303551
|
${lottieLayer.markup}` : "";
|
|
303526
|
-
const
|
|
303527
|
-
${lottieLayer.script}` : "";
|
|
303552
|
+
const register = lottieLayer?.register ?? `window.__timelines["${id}"] = tl;`;
|
|
303528
303553
|
return `<template id="${id}-template">
|
|
303529
303554
|
<div data-composition-id="${id}" data-start="0" data-duration="${dur}" data-width="${input3.width}" data-height="${input3.height}">
|
|
303530
303555
|
<style>
|
|
@@ -303533,14 +303558,14 @@ function emitSceneHtml(input3) {
|
|
|
303533
303558
|
|
|
303534
303559
|
${parts.body}${lottieMarkup}
|
|
303535
303560
|
${audioBlock}
|
|
303536
|
-
<script src="${GSAP_CDN}"></script
|
|
303561
|
+
<script src="${GSAP_CDN}"></script>
|
|
303537
303562
|
<script>
|
|
303538
303563
|
window.__timelines = window.__timelines || {};
|
|
303539
303564
|
const tl = gsap.timeline({ paused: true });
|
|
303540
303565
|
|
|
303541
303566
|
${parts.timeline}
|
|
303542
303567
|
|
|
303543
|
-
|
|
303568
|
+
${register}
|
|
303544
303569
|
</script>
|
|
303545
303570
|
</div>
|
|
303546
303571
|
</template>
|
|
@@ -303598,6 +303623,7 @@ function readRootDims(rootHtml) {
|
|
|
303598
303623
|
}
|
|
303599
303624
|
|
|
303600
303625
|
// ../cli/src/commands/scene.ts
|
|
303626
|
+
init_lottie();
|
|
303601
303627
|
init_scene_lint();
|
|
303602
303628
|
init_output();
|
|
303603
303629
|
init_api_key();
|
|
@@ -303614,7 +303640,7 @@ init_storyboard_parse();
|
|
|
303614
303640
|
init_storyboard_source();
|
|
303615
303641
|
init_root_sync();
|
|
303616
303642
|
import { existsSync as existsSync45 } from "node:fs";
|
|
303617
|
-
import { mkdir as
|
|
303643
|
+
import { mkdir as mkdir13, writeFile as writeFile14 } from "node:fs/promises";
|
|
303618
303644
|
import { join as join58, resolve as resolve27 } from "node:path";
|
|
303619
303645
|
async function executeSceneSubmit(opts) {
|
|
303620
303646
|
const projectDir = resolve27(opts.projectDir);
|
|
@@ -303708,7 +303734,7 @@ async function executeSceneSubmit(opts) {
|
|
|
303708
303734
|
return { ...base2, success: true };
|
|
303709
303735
|
}
|
|
303710
303736
|
const absPath = join58(projectDir, scenePath);
|
|
303711
|
-
await
|
|
303737
|
+
await mkdir13(join58(projectDir, "compositions"), { recursive: true });
|
|
303712
303738
|
await writeFile14(absPath, html.endsWith("\n") ? html : `${html}
|
|
303713
303739
|
`, "utf-8");
|
|
303714
303740
|
return {
|
|
@@ -303903,7 +303929,7 @@ sceneCommand.command("submit").description(
|
|
|
303903
303929
|
}
|
|
303904
303930
|
html = Buffer.concat(chunks).toString("utf-8");
|
|
303905
303931
|
} else if (options.file) {
|
|
303906
|
-
html = await
|
|
303932
|
+
html = await readFile17(resolve30(String(options.file)), "utf-8");
|
|
303907
303933
|
} else {
|
|
303908
303934
|
exitWithError(
|
|
303909
303935
|
usageError(
|
|
@@ -304234,7 +304260,7 @@ async function resolveNarrationText(value) {
|
|
|
304234
304260
|
if (!value) return void 0;
|
|
304235
304261
|
const looksLikePath = /\.[a-z]{2,4}$/i.test(value) || value.includes("/") || value.includes("\\");
|
|
304236
304262
|
if (looksLikePath && existsSync47(value)) {
|
|
304237
|
-
return (await
|
|
304263
|
+
return (await readFile17(value, "utf-8")).trim();
|
|
304238
304264
|
}
|
|
304239
304265
|
return value.trim();
|
|
304240
304266
|
}
|
|
@@ -304271,7 +304297,7 @@ async function executeSceneAdd(opts) {
|
|
|
304271
304297
|
if (!opts.force && await pathExists2(scenePath)) {
|
|
304272
304298
|
return errResult(`Scene already exists: ${sceneRel}. Re-run with --force to overwrite.`);
|
|
304273
304299
|
}
|
|
304274
|
-
const rootHtmlBefore = await
|
|
304300
|
+
const rootHtmlBefore = await readFile17(rootPath, "utf-8");
|
|
304275
304301
|
let dims = readRootDims(rootHtmlBefore);
|
|
304276
304302
|
if (!dims) {
|
|
304277
304303
|
const cfg2 = await loadVibeProjectConfig(projectDir);
|
|
@@ -304295,8 +304321,8 @@ async function executeSceneAdd(opts) {
|
|
|
304295
304321
|
}
|
|
304296
304322
|
audioRelPath = `assets/narration-${id}.${ext}`;
|
|
304297
304323
|
audioAbsPath = resolve30(projectDir, audioRelPath);
|
|
304298
|
-
await
|
|
304299
|
-
await
|
|
304324
|
+
await mkdir14(dirname25(audioAbsPath), { recursive: true });
|
|
304325
|
+
await copyFile4(sourceAbs, audioAbsPath);
|
|
304300
304326
|
try {
|
|
304301
304327
|
narrationDuration = await getAudioDuration(audioAbsPath);
|
|
304302
304328
|
} catch {
|
|
@@ -304328,7 +304354,7 @@ async function executeSceneAdd(opts) {
|
|
|
304328
304354
|
}
|
|
304329
304355
|
audioRelPath = `assets/narration-${id}.${resolution.audioExtension}`;
|
|
304330
304356
|
audioAbsPath = resolve30(projectDir, audioRelPath);
|
|
304331
|
-
await
|
|
304357
|
+
await mkdir14(dirname25(audioAbsPath), { recursive: true });
|
|
304332
304358
|
await writeFile16(audioAbsPath, tts.audioBuffer);
|
|
304333
304359
|
try {
|
|
304334
304360
|
narrationDuration = await getAudioDuration(audioAbsPath);
|
|
@@ -304386,7 +304412,7 @@ async function executeSceneAdd(opts) {
|
|
|
304386
304412
|
});
|
|
304387
304413
|
imageRelPath = `assets/scene-${id}.png`;
|
|
304388
304414
|
imageAbsPath = resolve30(projectDir, imageRelPath);
|
|
304389
|
-
await
|
|
304415
|
+
await mkdir14(dirname25(imageAbsPath), { recursive: true });
|
|
304390
304416
|
await writeImageFile(imageAbsPath, Buffer.from(result.images[0].bytes));
|
|
304391
304417
|
} catch (error) {
|
|
304392
304418
|
return errResult(`${label} image generation failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -304404,10 +304430,13 @@ async function executeSceneAdd(opts) {
|
|
|
304404
304430
|
if (ext !== "json" && ext !== "lottie") {
|
|
304405
304431
|
return errResult(`Unsupported Lottie file extension: .${ext}. Use .json or .lottie.`);
|
|
304406
304432
|
}
|
|
304433
|
+
const assetProblem = await checkLottieAsset(sourceAbs);
|
|
304434
|
+
if (assetProblem) return errResult(assetProblem);
|
|
304407
304435
|
lottieRelPath = `assets/lottie-${id}.${ext}`;
|
|
304408
304436
|
lottieAbsPath = resolve30(projectDir, lottieRelPath);
|
|
304409
|
-
await
|
|
304410
|
-
await
|
|
304437
|
+
await mkdir14(dirname25(lottieAbsPath), { recursive: true });
|
|
304438
|
+
await copyFile4(sourceAbs, lottieAbsPath);
|
|
304439
|
+
await copyDotLottieRuntime(resolve30(projectDir, LOTTIE_RUNTIME_DIR));
|
|
304411
304440
|
lottieInput = {
|
|
304412
304441
|
src: lottieRelPath,
|
|
304413
304442
|
position: opts.lottie.position,
|
|
@@ -304451,7 +304480,7 @@ async function executeSceneAdd(opts) {
|
|
|
304451
304480
|
storyboardAction = synced.action;
|
|
304452
304481
|
} else {
|
|
304453
304482
|
opts.onProgress?.("Syncing STORYBOARD.md...");
|
|
304454
|
-
const before2 = await
|
|
304483
|
+
const before2 = await readFile17(storyboardAbsPath, "utf-8");
|
|
304455
304484
|
const synced = upsertStoryboardBeat(before2, upsert);
|
|
304456
304485
|
if (synced.markdown !== before2) {
|
|
304457
304486
|
await writeFile16(storyboardAbsPath, synced.markdown, "utf-8");
|
|
@@ -304476,7 +304505,7 @@ async function executeSceneAdd(opts) {
|
|
|
304476
304505
|
transcript: transcriptWords,
|
|
304477
304506
|
lottie: lottieInput
|
|
304478
304507
|
});
|
|
304479
|
-
await
|
|
304508
|
+
await mkdir14(dirname25(scenePath), { recursive: true });
|
|
304480
304509
|
await writeFile16(scenePath, sceneHtml, "utf-8");
|
|
304481
304510
|
opts.onProgress?.("Updating root composition...");
|
|
304482
304511
|
let start = 0;
|
|
@@ -304488,7 +304517,7 @@ async function executeSceneAdd(opts) {
|
|
|
304488
304517
|
});
|
|
304489
304518
|
const blockingIssue = syncPlan.issues.find((issue) => issue.severity === "error");
|
|
304490
304519
|
if (blockingIssue) return errResult(blockingIssue.message);
|
|
304491
|
-
const rootHtmlAfterSync = await
|
|
304520
|
+
const rootHtmlAfterSync = await readFile17(rootPath, "utf-8");
|
|
304492
304521
|
start = readClipStart(rootHtmlAfterSync, id) ?? 0;
|
|
304493
304522
|
} else {
|
|
304494
304523
|
start = nextSceneStart(rootHtmlBefore, SCENE_OVERLAP_SECONDS);
|
|
@@ -305532,7 +305561,7 @@ init_api_key();
|
|
|
305532
305561
|
init_exec_safe();
|
|
305533
305562
|
init_remotion();
|
|
305534
305563
|
import { resolve as resolve53, dirname as dirname35, basename as basename14 } from "node:path";
|
|
305535
|
-
import { writeFile as writeFile33, mkdir as
|
|
305564
|
+
import { writeFile as writeFile33, mkdir as mkdir27, rm as rm11 } from "node:fs/promises";
|
|
305536
305565
|
import { existsSync as existsSync74 } from "node:fs";
|
|
305537
305566
|
import { tmpdir as tmpdir12 } from "node:os";
|
|
305538
305567
|
var ASS_STYLES = ["karaoke-sweep", "typewriter"];
|
|
@@ -305684,7 +305713,7 @@ async function executeAnimatedCaption(options) {
|
|
|
305684
305713
|
}
|
|
305685
305714
|
const effectiveFontSize = fontSize ?? Math.round(height * 0.04);
|
|
305686
305715
|
const tmpAudioDir = resolve53(tmpdir12(), `vf-ac-${Date.now()}`);
|
|
305687
|
-
await
|
|
305716
|
+
await mkdir27(tmpAudioDir, { recursive: true });
|
|
305688
305717
|
const audioPath = resolve53(tmpAudioDir, "audio.wav");
|
|
305689
305718
|
await execSafe("ffmpeg", [
|
|
305690
305719
|
"-y",
|
|
@@ -305715,7 +305744,7 @@ async function executeAnimatedCaption(options) {
|
|
|
305715
305744
|
const absOutputPath = resolve53(process.cwd(), outputPath);
|
|
305716
305745
|
const outDir = dirname35(absOutputPath);
|
|
305717
305746
|
if (!existsSync74(outDir)) {
|
|
305718
|
-
await
|
|
305747
|
+
await mkdir27(outDir, { recursive: true });
|
|
305719
305748
|
}
|
|
305720
305749
|
if (tier === "ass") {
|
|
305721
305750
|
const assContent = generateASS(
|
|
@@ -308907,7 +308936,7 @@ var storyboardTools = [
|
|
|
308907
308936
|
];
|
|
308908
308937
|
|
|
308909
308938
|
// ../cli/src/tools/manifest/design.ts
|
|
308910
|
-
import { existsSync as
|
|
308939
|
+
import { existsSync as existsSync83 } from "node:fs";
|
|
308911
308940
|
import { readFile as readFile40 } from "node:fs/promises";
|
|
308912
308941
|
import { resolve as resolve68, join as join76 } from "node:path";
|
|
308913
308942
|
import { z as z10 } from "zod";
|
|
@@ -308927,7 +308956,7 @@ var designValidateTool = defineTool({
|
|
|
308927
308956
|
async execute(args, ctx) {
|
|
308928
308957
|
const projectDir = args.projectDir ? resolve68(ctx.workingDirectory, args.projectDir) : ctx.workingDirectory;
|
|
308929
308958
|
const path15 = join76(projectDir, "DESIGN.md");
|
|
308930
|
-
if (!
|
|
308959
|
+
if (!existsSync83(path15)) return { success: false, error: `DESIGN.md not found in ${projectDir}` };
|
|
308931
308960
|
const md = await readFile40(path15, "utf-8");
|
|
308932
308961
|
const issues = validateDesignMarkdown(md);
|
|
308933
308962
|
const design = parseDesign(md);
|
|
@@ -308955,9 +308984,9 @@ import { join as join77 } from "node:path";
|
|
|
308955
308984
|
import { z as z11 } from "zod";
|
|
308956
308985
|
|
|
308957
308986
|
// ../cli/src/commands/ai-highlights.ts
|
|
308958
|
-
import { readFile as readFile41, writeFile as writeFile41, mkdir as
|
|
308987
|
+
import { readFile as readFile41, writeFile as writeFile41, mkdir as mkdir30 } from "node:fs/promises";
|
|
308959
308988
|
import { resolve as resolve69, dirname as dirname38, basename as basename18, extname as extname21 } from "node:path";
|
|
308960
|
-
import { existsSync as
|
|
308989
|
+
import { existsSync as existsSync84 } from "node:fs";
|
|
308961
308990
|
init_dist();
|
|
308962
308991
|
init_engine();
|
|
308963
308992
|
init_api_key();
|
|
@@ -308989,7 +309018,7 @@ function filterHighlights(highlights, options) {
|
|
|
308989
309018
|
async function executeHighlights(options) {
|
|
308990
309019
|
try {
|
|
308991
309020
|
const absPath = resolve69(process.cwd(), options.media);
|
|
308992
|
-
if (!
|
|
309021
|
+
if (!existsSync84(absPath)) {
|
|
308993
309022
|
return { success: false, highlights: [], totalDuration: 0, totalHighlightDuration: 0, error: `File not found: ${absPath}` };
|
|
308994
309023
|
}
|
|
308995
309024
|
const ext = extname21(absPath).toLowerCase();
|
|
@@ -309101,7 +309130,7 @@ Analyze both what is SHOWN (visual cues, actions, expressions) and what is SAID
|
|
|
309101
309130
|
sourceDuration = await ffprobeDuration(absPath);
|
|
309102
309131
|
}
|
|
309103
309132
|
const transcriptResult = await transcribeAudioFile(audioPath, { apiKey: openaiApiKey, language: options.language });
|
|
309104
|
-
if (tempAudioPath &&
|
|
309133
|
+
if (tempAudioPath && existsSync84(tempAudioPath)) {
|
|
309105
309134
|
const { unlink: unlinkFile } = await import("node:fs/promises");
|
|
309106
309135
|
await unlinkFile(tempAudioPath).catch(() => {
|
|
309107
309136
|
});
|
|
@@ -309188,7 +309217,7 @@ async function executeAutoShorts(options) {
|
|
|
309188
309217
|
return { success: false, shorts: [], error: "FFmpeg not found" };
|
|
309189
309218
|
}
|
|
309190
309219
|
const absPath = resolve69(process.cwd(), options.video);
|
|
309191
|
-
if (!
|
|
309220
|
+
if (!existsSync84(absPath)) {
|
|
309192
309221
|
return { success: false, shorts: [], error: `File not found: ${absPath}` };
|
|
309193
309222
|
}
|
|
309194
309223
|
const targetDuration = options.duration ?? 60;
|
|
@@ -309312,8 +309341,8 @@ Analyze both VISUALS (expressions, actions, scene changes) and AUDIO (speech, re
|
|
|
309312
309341
|
};
|
|
309313
309342
|
}
|
|
309314
309343
|
const outputDir = options.outputDir ? resolve69(process.cwd(), options.outputDir) : dirname38(absPath);
|
|
309315
|
-
if (options.outputDir && !
|
|
309316
|
-
await
|
|
309344
|
+
if (options.outputDir && !existsSync84(outputDir)) {
|
|
309345
|
+
await mkdir30(outputDir, { recursive: true });
|
|
309317
309346
|
}
|
|
309318
309347
|
const result = {
|
|
309319
309348
|
success: true,
|
|
@@ -309391,8 +309420,8 @@ Analyze both VISUALS (expressions, actions, scene changes) and AUDIO (speech, re
|
|
|
309391
309420
|
// ../cli/src/pipeline/executor.ts
|
|
309392
309421
|
var import_yaml8 = __toESM(require_dist3(), 1);
|
|
309393
309422
|
import { resolve as resolve71 } from "node:path";
|
|
309394
|
-
import { readFile as readFile43, writeFile as writeFile43, mkdir as
|
|
309395
|
-
import { existsSync as
|
|
309423
|
+
import { readFile as readFile43, writeFile as writeFile43, mkdir as mkdir31 } from "node:fs/promises";
|
|
309424
|
+
import { existsSync as existsSync85 } from "node:fs";
|
|
309396
309425
|
|
|
309397
309426
|
// ../cli/src/pipeline/resolver.ts
|
|
309398
309427
|
function resolveStepParams(params, completedSteps) {
|
|
@@ -309790,7 +309819,7 @@ async function ensureActionsRegistered() {
|
|
|
309790
309819
|
}
|
|
309791
309820
|
async function loadPipeline(filePath) {
|
|
309792
309821
|
const absPath = resolve71(process.cwd(), filePath);
|
|
309793
|
-
if (!
|
|
309822
|
+
if (!existsSync85(absPath)) {
|
|
309794
309823
|
throw new Error(`Pipeline file not found: ${absPath}`);
|
|
309795
309824
|
}
|
|
309796
309825
|
const content = await readFile43(absPath, "utf-8");
|
|
@@ -309810,13 +309839,13 @@ var CHECKPOINT_FILE = ".pipeline-state.yaml";
|
|
|
309810
309839
|
async function executePipeline(manifest2, options = {}) {
|
|
309811
309840
|
await ensureActionsRegistered();
|
|
309812
309841
|
const outputDir = resolve71(process.cwd(), options.outputDir || `${manifest2.name}-output`);
|
|
309813
|
-
await
|
|
309842
|
+
await mkdir31(outputDir, { recursive: true });
|
|
309814
309843
|
const completedSteps = /* @__PURE__ */ new Map();
|
|
309815
309844
|
const results = [];
|
|
309816
309845
|
const startTime = Date.now();
|
|
309817
309846
|
if (options.resume) {
|
|
309818
309847
|
const checkpointPath = resolve71(outputDir, CHECKPOINT_FILE);
|
|
309819
|
-
if (
|
|
309848
|
+
if (existsSync85(checkpointPath)) {
|
|
309820
309849
|
const checkpointContent = await readFile43(checkpointPath, "utf-8");
|
|
309821
309850
|
const checkpoint = (0, import_yaml8.parse)(checkpointContent);
|
|
309822
309851
|
for (const cs of checkpoint.completedSteps) {
|
|
@@ -310227,7 +310256,7 @@ var detectTools = [
|
|
|
310227
310256
|
|
|
310228
310257
|
// ../cli/src/tools/manifest/timeline.ts
|
|
310229
310258
|
import { z as z13 } from "zod";
|
|
310230
|
-
import { mkdir as
|
|
310259
|
+
import { mkdir as mkdir33, writeFile as writeFile46 } from "node:fs/promises";
|
|
310231
310260
|
import { basename as basename20, resolve as resolve73 } from "node:path";
|
|
310232
310261
|
init_engine();
|
|
310233
310262
|
init_project_resolver();
|
|
@@ -310283,7 +310312,7 @@ var timelineCreateTool = defineTool({
|
|
|
310283
310312
|
outputPath = resolve73(ctx.workingDirectory, args.outputPath);
|
|
310284
310313
|
} else {
|
|
310285
310314
|
const dirPath = resolve73(ctx.workingDirectory, args.name);
|
|
310286
|
-
await
|
|
310315
|
+
await mkdir33(dirPath, { recursive: true });
|
|
310287
310316
|
outputPath = resolve73(dirPath, TIMELINE_FILENAME);
|
|
310288
310317
|
}
|
|
310289
310318
|
await writeFile46(outputPath, JSON.stringify(project.toJSON(), null, 2), "utf-8");
|
|
@@ -310591,11 +310620,11 @@ init_engine();
|
|
|
310591
310620
|
init_storyboard_parse();
|
|
310592
310621
|
init_storyboard_source();
|
|
310593
310622
|
import { readdir as readdir9, readFile as readFile45, stat as stat9 } from "node:fs/promises";
|
|
310594
|
-
import { existsSync as
|
|
310623
|
+
import { existsSync as existsSync86 } from "node:fs";
|
|
310595
310624
|
import { join as join78, resolve as resolve74 } from "node:path";
|
|
310596
310625
|
async function executeProjectList(opts = {}) {
|
|
310597
310626
|
const workspaceDir = resolve74(opts.workspaceDir ?? ".");
|
|
310598
|
-
if (!
|
|
310627
|
+
if (!existsSync86(workspaceDir)) {
|
|
310599
310628
|
return {
|
|
310600
310629
|
success: false,
|
|
310601
310630
|
workspaceDir,
|
|
@@ -310616,7 +310645,7 @@ async function executeProjectList(opts = {}) {
|
|
|
310616
310645
|
continue;
|
|
310617
310646
|
}
|
|
310618
310647
|
const projectDir = join78(workspaceDir, entry.name);
|
|
310619
|
-
if (!
|
|
310648
|
+
if (!existsSync86(join78(projectDir, "STORYBOARD.md"))) continue;
|
|
310620
310649
|
projects.push(await describeProject(entry.name, projectDir));
|
|
310621
310650
|
}
|
|
310622
310651
|
projects.sort((a4, b4) => b4.updatedAt.localeCompare(a4.updatedAt));
|
|
@@ -310626,7 +310655,7 @@ async function countProjects(dir) {
|
|
|
310626
310655
|
try {
|
|
310627
310656
|
const entries2 = await readdir9(dir, { withFileTypes: true });
|
|
310628
310657
|
return entries2.filter(
|
|
310629
|
-
(e2) => e2.isDirectory() &&
|
|
310658
|
+
(e2) => e2.isDirectory() && existsSync86(join78(dir, e2.name, "STORYBOARD.md"))
|
|
310630
310659
|
).length;
|
|
310631
310660
|
} catch {
|
|
310632
310661
|
return 0;
|
|
@@ -313646,14 +313675,14 @@ This creates a music video-style edit where cuts happen in rhythm with the music
|
|
|
313646
313675
|
}
|
|
313647
313676
|
|
|
313648
313677
|
// src/instructions.ts
|
|
313649
|
-
import { existsSync as
|
|
313678
|
+
import { existsSync as existsSync87, mkdirSync as mkdirSync23 } from "node:fs";
|
|
313650
313679
|
import { delimiter as delimiter2, isAbsolute as isAbsolute14, resolve as resolve81 } from "node:path";
|
|
313651
313680
|
var DEFAULT_EXTRA_PATH_DIRS = process.platform === "darwin" ? ["/opt/homebrew/bin", "/usr/local/bin", "/opt/local/bin"] : ["/usr/local/bin"];
|
|
313652
313681
|
function ensureSystemPath(env4 = process.env, extraDirs = DEFAULT_EXTRA_PATH_DIRS) {
|
|
313653
313682
|
const current = (env4.PATH ?? "").split(delimiter2).filter(Boolean);
|
|
313654
313683
|
const added = [];
|
|
313655
313684
|
for (const dir of extraDirs) {
|
|
313656
|
-
if (!current.includes(dir) &&
|
|
313685
|
+
if (!current.includes(dir) && existsSync87(dir)) {
|
|
313657
313686
|
current.push(dir);
|
|
313658
313687
|
added.push(dir);
|
|
313659
313688
|
}
|
|
@@ -313756,7 +313785,7 @@ function handleCliFlags(argv, version2) {
|
|
|
313756
313785
|
}
|
|
313757
313786
|
|
|
313758
313787
|
// src/index.ts
|
|
313759
|
-
if (handleCliFlags(process.argv.slice(2), "0.115.
|
|
313788
|
+
if (handleCliFlags(process.argv.slice(2), "0.115.9")) {
|
|
313760
313789
|
process.exit(0);
|
|
313761
313790
|
}
|
|
313762
313791
|
console.log = (...args) => console.error(...args);
|
|
@@ -313769,7 +313798,7 @@ var server = new Server(
|
|
|
313769
313798
|
{
|
|
313770
313799
|
name: "vibeframe",
|
|
313771
313800
|
// Stamped with the package version by build.js at bundle time.
|
|
313772
|
-
version: "0.115.
|
|
313801
|
+
version: "0.115.9"
|
|
313773
313802
|
},
|
|
313774
313803
|
{
|
|
313775
313804
|
capabilities: {
|