@vibeframe/mcp-server 0.53.0 → 0.55.0
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/index.js +865 -338
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -6893,8 +6893,8 @@ var init_chrome = __esm({
|
|
|
6893
6893
|
|
|
6894
6894
|
// ../cli/src/pipeline/renderers/html-clips.ts
|
|
6895
6895
|
function relAsset(url) {
|
|
6896
|
-
const
|
|
6897
|
-
return `assets/${
|
|
6896
|
+
const basename19 = url.split("/").pop() ?? url;
|
|
6897
|
+
return `assets/${basename19}`;
|
|
6898
6898
|
}
|
|
6899
6899
|
function buildClipElements(state) {
|
|
6900
6900
|
return state.clips.map((clip) => {
|
|
@@ -8047,7 +8047,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8047
8047
|
let latestResultPromise;
|
|
8048
8048
|
let provideLatestResult;
|
|
8049
8049
|
if (isContext)
|
|
8050
|
-
requestCallbacks["on-end"] = (id, request22) => new Promise((
|
|
8050
|
+
requestCallbacks["on-end"] = (id, request22) => new Promise((resolve44) => {
|
|
8051
8051
|
buildResponseToResult(request22, (err, result, onEndErrors, onEndWarnings) => {
|
|
8052
8052
|
const response = {
|
|
8053
8053
|
errors: onEndErrors,
|
|
@@ -8057,7 +8057,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8057
8057
|
latestResultPromise = void 0;
|
|
8058
8058
|
provideLatestResult = void 0;
|
|
8059
8059
|
sendResponse(id, response);
|
|
8060
|
-
|
|
8060
|
+
resolve44();
|
|
8061
8061
|
});
|
|
8062
8062
|
});
|
|
8063
8063
|
sendRequest(refs3, request5, (error, response) => {
|
|
@@ -8074,10 +8074,10 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8074
8074
|
let didDispose = false;
|
|
8075
8075
|
const result = {
|
|
8076
8076
|
rebuild: () => {
|
|
8077
|
-
if (!latestResultPromise) latestResultPromise = new Promise((
|
|
8077
|
+
if (!latestResultPromise) latestResultPromise = new Promise((resolve44, reject) => {
|
|
8078
8078
|
let settlePromise;
|
|
8079
8079
|
provideLatestResult = (err, result2) => {
|
|
8080
|
-
if (!settlePromise) settlePromise = () => err ? reject(err) :
|
|
8080
|
+
if (!settlePromise) settlePromise = () => err ? reject(err) : resolve44(result2);
|
|
8081
8081
|
};
|
|
8082
8082
|
const triggerAnotherBuild = () => {
|
|
8083
8083
|
const request22 = {
|
|
@@ -8098,7 +8098,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8098
8098
|
});
|
|
8099
8099
|
return latestResultPromise;
|
|
8100
8100
|
},
|
|
8101
|
-
watch: (options2 = {}) => new Promise((
|
|
8101
|
+
watch: (options2 = {}) => new Promise((resolve44, reject) => {
|
|
8102
8102
|
if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`);
|
|
8103
8103
|
const keys2 = {};
|
|
8104
8104
|
const delay = getFlag3(options2, keys2, "delay", mustBeInteger);
|
|
@@ -8110,10 +8110,10 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8110
8110
|
if (delay) request22.delay = delay;
|
|
8111
8111
|
sendRequest(refs3, request22, (error2) => {
|
|
8112
8112
|
if (error2) reject(new Error(error2));
|
|
8113
|
-
else
|
|
8113
|
+
else resolve44(void 0);
|
|
8114
8114
|
});
|
|
8115
8115
|
}),
|
|
8116
|
-
serve: (options2 = {}) => new Promise((
|
|
8116
|
+
serve: (options2 = {}) => new Promise((resolve44, reject) => {
|
|
8117
8117
|
if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`);
|
|
8118
8118
|
const keys2 = {};
|
|
8119
8119
|
const port = getFlag3(options2, keys2, "port", mustBeValidPortNumber);
|
|
@@ -8151,28 +8151,28 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8151
8151
|
sendResponse(id, {});
|
|
8152
8152
|
};
|
|
8153
8153
|
}
|
|
8154
|
-
|
|
8154
|
+
resolve44(response2);
|
|
8155
8155
|
});
|
|
8156
8156
|
}),
|
|
8157
|
-
cancel: () => new Promise((
|
|
8158
|
-
if (didDispose) return
|
|
8157
|
+
cancel: () => new Promise((resolve44) => {
|
|
8158
|
+
if (didDispose) return resolve44();
|
|
8159
8159
|
const request22 = {
|
|
8160
8160
|
command: "cancel",
|
|
8161
8161
|
key: buildKey
|
|
8162
8162
|
};
|
|
8163
8163
|
sendRequest(refs3, request22, () => {
|
|
8164
|
-
|
|
8164
|
+
resolve44();
|
|
8165
8165
|
});
|
|
8166
8166
|
}),
|
|
8167
|
-
dispose: () => new Promise((
|
|
8168
|
-
if (didDispose) return
|
|
8167
|
+
dispose: () => new Promise((resolve44) => {
|
|
8168
|
+
if (didDispose) return resolve44();
|
|
8169
8169
|
didDispose = true;
|
|
8170
8170
|
const request22 = {
|
|
8171
8171
|
command: "dispose",
|
|
8172
8172
|
key: buildKey
|
|
8173
8173
|
};
|
|
8174
8174
|
sendRequest(refs3, request22, () => {
|
|
8175
|
-
|
|
8175
|
+
resolve44();
|
|
8176
8176
|
scheduleOnDisposeCallbacks();
|
|
8177
8177
|
refs3.unref();
|
|
8178
8178
|
});
|
|
@@ -8211,7 +8211,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8211
8211
|
onLoad: []
|
|
8212
8212
|
};
|
|
8213
8213
|
i++;
|
|
8214
|
-
let
|
|
8214
|
+
let resolve44 = (path33, options = {}) => {
|
|
8215
8215
|
if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed');
|
|
8216
8216
|
if (typeof path33 !== "string") throw new Error(`The path to resolve must be a string`);
|
|
8217
8217
|
let keys22 = /* @__PURE__ */ Object.create(null);
|
|
@@ -8255,7 +8255,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8255
8255
|
};
|
|
8256
8256
|
let promise = setup({
|
|
8257
8257
|
initialOptions,
|
|
8258
|
-
resolve:
|
|
8258
|
+
resolve: resolve44,
|
|
8259
8259
|
onStart(callback) {
|
|
8260
8260
|
let registeredText = `This error came from the "onStart" callback registered here:`;
|
|
8261
8261
|
let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart");
|
|
@@ -9133,46 +9133,46 @@ More information: The file containing the code for esbuild's JavaScript API (${_
|
|
|
9133
9133
|
}
|
|
9134
9134
|
};
|
|
9135
9135
|
longLivedService = {
|
|
9136
|
-
build: (options) => new Promise((
|
|
9136
|
+
build: (options) => new Promise((resolve44, reject) => {
|
|
9137
9137
|
service.buildOrContext({
|
|
9138
9138
|
callName: "build",
|
|
9139
9139
|
refs: refs3,
|
|
9140
9140
|
options,
|
|
9141
9141
|
isTTY: isTTY(),
|
|
9142
9142
|
defaultWD,
|
|
9143
|
-
callback: (err, res) => err ? reject(err) :
|
|
9143
|
+
callback: (err, res) => err ? reject(err) : resolve44(res)
|
|
9144
9144
|
});
|
|
9145
9145
|
}),
|
|
9146
|
-
context: (options) => new Promise((
|
|
9146
|
+
context: (options) => new Promise((resolve44, reject) => service.buildOrContext({
|
|
9147
9147
|
callName: "context",
|
|
9148
9148
|
refs: refs3,
|
|
9149
9149
|
options,
|
|
9150
9150
|
isTTY: isTTY(),
|
|
9151
9151
|
defaultWD,
|
|
9152
|
-
callback: (err, res) => err ? reject(err) :
|
|
9152
|
+
callback: (err, res) => err ? reject(err) : resolve44(res)
|
|
9153
9153
|
})),
|
|
9154
|
-
transform: (input3, options) => new Promise((
|
|
9154
|
+
transform: (input3, options) => new Promise((resolve44, reject) => service.transform({
|
|
9155
9155
|
callName: "transform",
|
|
9156
9156
|
refs: refs3,
|
|
9157
9157
|
input: input3,
|
|
9158
9158
|
options: options || {},
|
|
9159
9159
|
isTTY: isTTY(),
|
|
9160
9160
|
fs: fsAsync,
|
|
9161
|
-
callback: (err, res) => err ? reject(err) :
|
|
9161
|
+
callback: (err, res) => err ? reject(err) : resolve44(res)
|
|
9162
9162
|
})),
|
|
9163
|
-
formatMessages: (messages, options) => new Promise((
|
|
9163
|
+
formatMessages: (messages, options) => new Promise((resolve44, reject) => service.formatMessages({
|
|
9164
9164
|
callName: "formatMessages",
|
|
9165
9165
|
refs: refs3,
|
|
9166
9166
|
messages,
|
|
9167
9167
|
options,
|
|
9168
|
-
callback: (err, res) => err ? reject(err) :
|
|
9168
|
+
callback: (err, res) => err ? reject(err) : resolve44(res)
|
|
9169
9169
|
})),
|
|
9170
|
-
analyzeMetafile: (metafile, options) => new Promise((
|
|
9170
|
+
analyzeMetafile: (metafile, options) => new Promise((resolve44, reject) => service.analyzeMetafile({
|
|
9171
9171
|
callName: "analyzeMetafile",
|
|
9172
9172
|
refs: refs3,
|
|
9173
9173
|
metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile),
|
|
9174
9174
|
options,
|
|
9175
|
-
callback: (err, res) => err ? reject(err) :
|
|
9175
|
+
callback: (err, res) => err ? reject(err) : resolve44(res)
|
|
9176
9176
|
}))
|
|
9177
9177
|
};
|
|
9178
9178
|
return longLivedService;
|
|
@@ -9250,13 +9250,13 @@ error: ${text}`);
|
|
|
9250
9250
|
worker.postMessage(msg);
|
|
9251
9251
|
let status = Atomics.wait(sharedBufferView, 0, 0);
|
|
9252
9252
|
if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status);
|
|
9253
|
-
let { message: { id: id2, resolve:
|
|
9253
|
+
let { message: { id: id2, resolve: resolve44, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort);
|
|
9254
9254
|
if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`);
|
|
9255
9255
|
if (reject) {
|
|
9256
9256
|
applyProperties(reject, properties);
|
|
9257
9257
|
throw reject;
|
|
9258
9258
|
}
|
|
9259
|
-
return
|
|
9259
|
+
return resolve44;
|
|
9260
9260
|
};
|
|
9261
9261
|
worker.unref();
|
|
9262
9262
|
return {
|
|
@@ -12904,7 +12904,7 @@ var require_previous_map = __commonJS({
|
|
|
12904
12904
|
"../../node_modules/.pnpm/postcss@8.5.6/node_modules/postcss/lib/previous-map.js"(exports, module) {
|
|
12905
12905
|
"use strict";
|
|
12906
12906
|
var { existsSync: existsSync38, readFileSync: readFileSync11 } = __require("fs");
|
|
12907
|
-
var { dirname:
|
|
12907
|
+
var { dirname: dirname26, join: join23 } = __require("path");
|
|
12908
12908
|
var { SourceMapConsumer, SourceMapGenerator } = require_source_map();
|
|
12909
12909
|
function fromBase64(str) {
|
|
12910
12910
|
if (Buffer) {
|
|
@@ -12923,7 +12923,7 @@ var require_previous_map = __commonJS({
|
|
|
12923
12923
|
if (!this.mapFile && opts.from) {
|
|
12924
12924
|
this.mapFile = opts.from;
|
|
12925
12925
|
}
|
|
12926
|
-
if (this.mapFile) this.root =
|
|
12926
|
+
if (this.mapFile) this.root = dirname26(this.mapFile);
|
|
12927
12927
|
if (text) this.text = text;
|
|
12928
12928
|
}
|
|
12929
12929
|
consumer() {
|
|
@@ -12965,7 +12965,7 @@ var require_previous_map = __commonJS({
|
|
|
12965
12965
|
}
|
|
12966
12966
|
}
|
|
12967
12967
|
loadFile(path14) {
|
|
12968
|
-
this.root =
|
|
12968
|
+
this.root = dirname26(path14);
|
|
12969
12969
|
if (existsSync38(path14)) {
|
|
12970
12970
|
this.mapFile = path14;
|
|
12971
12971
|
return readFileSync11(path14, "utf-8").toString().trim();
|
|
@@ -13002,7 +13002,7 @@ var require_previous_map = __commonJS({
|
|
|
13002
13002
|
return this.decodeInline(this.annotation);
|
|
13003
13003
|
} else if (this.annotation) {
|
|
13004
13004
|
let map3 = this.annotation;
|
|
13005
|
-
if (file) map3 = join23(
|
|
13005
|
+
if (file) map3 = join23(dirname26(file), map3);
|
|
13006
13006
|
return this.loadFile(map3);
|
|
13007
13007
|
}
|
|
13008
13008
|
}
|
|
@@ -13024,7 +13024,7 @@ var require_input = __commonJS({
|
|
|
13024
13024
|
"../../node_modules/.pnpm/postcss@8.5.6/node_modules/postcss/lib/input.js"(exports, module) {
|
|
13025
13025
|
"use strict";
|
|
13026
13026
|
var { nanoid } = require_non_secure();
|
|
13027
|
-
var { isAbsolute: isAbsolute5, resolve:
|
|
13027
|
+
var { isAbsolute: isAbsolute5, resolve: resolve44 } = __require("path");
|
|
13028
13028
|
var { SourceMapConsumer, SourceMapGenerator } = require_source_map();
|
|
13029
13029
|
var { fileURLToPath: fileURLToPath6, pathToFileURL } = __require("url");
|
|
13030
13030
|
var CssSyntaxError2 = require_css_syntax_error();
|
|
@@ -13032,7 +13032,7 @@ var require_input = __commonJS({
|
|
|
13032
13032
|
var terminalHighlight = require_terminal_highlight();
|
|
13033
13033
|
var lineToIndexCache = /* @__PURE__ */ Symbol("lineToIndexCache");
|
|
13034
13034
|
var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
|
|
13035
|
-
var pathAvailable = Boolean(
|
|
13035
|
+
var pathAvailable = Boolean(resolve44 && isAbsolute5);
|
|
13036
13036
|
function getLineToIndex(input3) {
|
|
13037
13037
|
if (input3[lineToIndexCache]) return input3[lineToIndexCache];
|
|
13038
13038
|
let lines = input3.css.split("\n");
|
|
@@ -13066,7 +13066,7 @@ var require_input = __commonJS({
|
|
|
13066
13066
|
if (!pathAvailable || /^\w+:\/\//.test(opts.from) || isAbsolute5(opts.from)) {
|
|
13067
13067
|
this.file = opts.from;
|
|
13068
13068
|
} else {
|
|
13069
|
-
this.file =
|
|
13069
|
+
this.file = resolve44(opts.from);
|
|
13070
13070
|
}
|
|
13071
13071
|
}
|
|
13072
13072
|
if (pathAvailable && sourceMapAvailable) {
|
|
@@ -13179,7 +13179,7 @@ var require_input = __commonJS({
|
|
|
13179
13179
|
if (/^\w+:\/\//.test(file)) {
|
|
13180
13180
|
return file;
|
|
13181
13181
|
}
|
|
13182
|
-
return
|
|
13182
|
+
return resolve44(this.map.consumer().sourceRoot || this.map.root || ".", file);
|
|
13183
13183
|
}
|
|
13184
13184
|
origin(line, column, endLine, endColumn) {
|
|
13185
13185
|
if (!this.map) return false;
|
|
@@ -13438,12 +13438,12 @@ var require_fromJSON = __commonJS({
|
|
|
13438
13438
|
var require_map_generator = __commonJS({
|
|
13439
13439
|
"../../node_modules/.pnpm/postcss@8.5.6/node_modules/postcss/lib/map-generator.js"(exports, module) {
|
|
13440
13440
|
"use strict";
|
|
13441
|
-
var { dirname:
|
|
13441
|
+
var { dirname: dirname26, relative: relative8, resolve: resolve44, sep } = __require("path");
|
|
13442
13442
|
var { SourceMapConsumer, SourceMapGenerator } = require_source_map();
|
|
13443
13443
|
var { pathToFileURL } = __require("url");
|
|
13444
13444
|
var Input2 = require_input();
|
|
13445
13445
|
var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
|
|
13446
|
-
var pathAvailable = Boolean(
|
|
13446
|
+
var pathAvailable = Boolean(dirname26 && resolve44 && relative8 && sep);
|
|
13447
13447
|
var MapGenerator = class {
|
|
13448
13448
|
constructor(stringify5, root2, opts, cssString) {
|
|
13449
13449
|
this.stringify = stringify5;
|
|
@@ -13475,7 +13475,7 @@ var require_map_generator = __commonJS({
|
|
|
13475
13475
|
applyPrevMaps() {
|
|
13476
13476
|
for (let prev of this.previous()) {
|
|
13477
13477
|
let from3 = this.toUrl(this.path(prev.file));
|
|
13478
|
-
let root2 = prev.root ||
|
|
13478
|
+
let root2 = prev.root || dirname26(prev.file);
|
|
13479
13479
|
let map3;
|
|
13480
13480
|
if (this.mapOpts.sourcesContent === false) {
|
|
13481
13481
|
map3 = new SourceMapConsumer(prev.text);
|
|
@@ -13662,9 +13662,9 @@ var require_map_generator = __commonJS({
|
|
|
13662
13662
|
if (/^\w+:\/\//.test(file)) return file;
|
|
13663
13663
|
let cached = this.memoizedPaths.get(file);
|
|
13664
13664
|
if (cached) return cached;
|
|
13665
|
-
let from3 = this.opts.to ?
|
|
13665
|
+
let from3 = this.opts.to ? dirname26(this.opts.to) : ".";
|
|
13666
13666
|
if (typeof this.mapOpts.annotation === "string") {
|
|
13667
|
-
from3 =
|
|
13667
|
+
from3 = dirname26(resolve44(from3, this.mapOpts.annotation));
|
|
13668
13668
|
}
|
|
13669
13669
|
let path14 = relative8(from3, file);
|
|
13670
13670
|
this.memoizedPaths.set(file, path14);
|
|
@@ -15190,11 +15190,11 @@ function __extends(d, b) {
|
|
|
15190
15190
|
}
|
|
15191
15191
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
15192
15192
|
function adopt(value) {
|
|
15193
|
-
return value instanceof P ? value : new P(function(
|
|
15194
|
-
|
|
15193
|
+
return value instanceof P ? value : new P(function(resolve44) {
|
|
15194
|
+
resolve44(value);
|
|
15195
15195
|
});
|
|
15196
15196
|
}
|
|
15197
|
-
return new (P || (P = Promise))(function(
|
|
15197
|
+
return new (P || (P = Promise))(function(resolve44, reject) {
|
|
15198
15198
|
function fulfilled(value) {
|
|
15199
15199
|
try {
|
|
15200
15200
|
step(generator.next(value));
|
|
@@ -15210,7 +15210,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
15210
15210
|
}
|
|
15211
15211
|
}
|
|
15212
15212
|
function step(result) {
|
|
15213
|
-
result.done ?
|
|
15213
|
+
result.done ? resolve44(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
15214
15214
|
}
|
|
15215
15215
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15216
15216
|
});
|
|
@@ -15373,14 +15373,14 @@ function __asyncValues(o) {
|
|
|
15373
15373
|
}, i);
|
|
15374
15374
|
function verb(n) {
|
|
15375
15375
|
i[n] = o[n] && function(v) {
|
|
15376
|
-
return new Promise(function(
|
|
15377
|
-
v = o[n](v), settle(
|
|
15376
|
+
return new Promise(function(resolve44, reject) {
|
|
15377
|
+
v = o[n](v), settle(resolve44, reject, v.done, v.value);
|
|
15378
15378
|
});
|
|
15379
15379
|
};
|
|
15380
15380
|
}
|
|
15381
|
-
function settle(
|
|
15381
|
+
function settle(resolve44, reject, d, v) {
|
|
15382
15382
|
Promise.resolve(v).then(function(v2) {
|
|
15383
|
-
|
|
15383
|
+
resolve44({ value: v2, done: d });
|
|
15384
15384
|
}, reject);
|
|
15385
15385
|
}
|
|
15386
15386
|
}
|
|
@@ -15905,7 +15905,7 @@ function of() {
|
|
|
15905
15905
|
}
|
|
15906
15906
|
function lastValueFrom(source3, config22) {
|
|
15907
15907
|
var hasConfig = typeof config22 === "object";
|
|
15908
|
-
return new Promise(function(
|
|
15908
|
+
return new Promise(function(resolve44, reject) {
|
|
15909
15909
|
var _hasValue = false;
|
|
15910
15910
|
var _value;
|
|
15911
15911
|
source3.subscribe({
|
|
@@ -15916,9 +15916,9 @@ function lastValueFrom(source3, config22) {
|
|
|
15916
15916
|
error: reject,
|
|
15917
15917
|
complete: function() {
|
|
15918
15918
|
if (_hasValue) {
|
|
15919
|
-
|
|
15919
|
+
resolve44(_value);
|
|
15920
15920
|
} else if (hasConfig) {
|
|
15921
|
-
|
|
15921
|
+
resolve44(config22.defaultValue);
|
|
15922
15922
|
} else {
|
|
15923
15923
|
reject(new EmptyError());
|
|
15924
15924
|
}
|
|
@@ -15928,16 +15928,16 @@ function lastValueFrom(source3, config22) {
|
|
|
15928
15928
|
}
|
|
15929
15929
|
function firstValueFrom(source3, config22) {
|
|
15930
15930
|
var hasConfig = typeof config22 === "object";
|
|
15931
|
-
return new Promise(function(
|
|
15931
|
+
return new Promise(function(resolve44, reject) {
|
|
15932
15932
|
var subscriber = new SafeSubscriber({
|
|
15933
15933
|
next: function(value) {
|
|
15934
|
-
|
|
15934
|
+
resolve44(value);
|
|
15935
15935
|
subscriber.unsubscribe();
|
|
15936
15936
|
},
|
|
15937
15937
|
error: reject,
|
|
15938
15938
|
complete: function() {
|
|
15939
15939
|
if (hasConfig) {
|
|
15940
|
-
|
|
15940
|
+
resolve44(config22.defaultValue);
|
|
15941
15941
|
} else {
|
|
15942
15942
|
reject(new EmptyError());
|
|
15943
15943
|
}
|
|
@@ -16976,7 +16976,7 @@ var init_rxjs = __esm({
|
|
|
16976
16976
|
Observable22.prototype.forEach = function(next, promiseCtor) {
|
|
16977
16977
|
var _this = this;
|
|
16978
16978
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
16979
|
-
return new promiseCtor(function(
|
|
16979
|
+
return new promiseCtor(function(resolve44, reject) {
|
|
16980
16980
|
var subscriber = new SafeSubscriber({
|
|
16981
16981
|
next: function(value) {
|
|
16982
16982
|
try {
|
|
@@ -16987,7 +16987,7 @@ var init_rxjs = __esm({
|
|
|
16987
16987
|
}
|
|
16988
16988
|
},
|
|
16989
16989
|
error: reject,
|
|
16990
|
-
complete:
|
|
16990
|
+
complete: resolve44
|
|
16991
16991
|
});
|
|
16992
16992
|
_this.subscribe(subscriber);
|
|
16993
16993
|
});
|
|
@@ -17009,14 +17009,14 @@ var init_rxjs = __esm({
|
|
|
17009
17009
|
Observable22.prototype.toPromise = function(promiseCtor) {
|
|
17010
17010
|
var _this = this;
|
|
17011
17011
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
17012
|
-
return new promiseCtor(function(
|
|
17012
|
+
return new promiseCtor(function(resolve44, reject) {
|
|
17013
17013
|
var value;
|
|
17014
17014
|
_this.subscribe(function(x) {
|
|
17015
17015
|
return value = x;
|
|
17016
17016
|
}, function(err) {
|
|
17017
17017
|
return reject(err);
|
|
17018
17018
|
}, function() {
|
|
17019
|
-
return
|
|
17019
|
+
return resolve44(value);
|
|
17020
17020
|
});
|
|
17021
17021
|
});
|
|
17022
17022
|
};
|
|
@@ -19434,8 +19434,8 @@ var init_Deferred = __esm({
|
|
|
19434
19434
|
// SAFETY: This is ensured by #taskPromise.
|
|
19435
19435
|
#resolve;
|
|
19436
19436
|
// TODO: Switch to Promise.withResolvers with Node 22
|
|
19437
|
-
#taskPromise = new Promise((
|
|
19438
|
-
this.#resolve =
|
|
19437
|
+
#taskPromise = new Promise((resolve44) => {
|
|
19438
|
+
this.#resolve = resolve44;
|
|
19439
19439
|
});
|
|
19440
19440
|
#timeoutId;
|
|
19441
19441
|
#timeoutError;
|
|
@@ -19525,12 +19525,12 @@ var init_Mutex = __esm({
|
|
|
19525
19525
|
return new _Mutex.Guard(this, onRelease);
|
|
19526
19526
|
}
|
|
19527
19527
|
release() {
|
|
19528
|
-
const
|
|
19529
|
-
if (!
|
|
19528
|
+
const resolve44 = this.#acquirers.shift();
|
|
19529
|
+
if (!resolve44) {
|
|
19530
19530
|
this.#locked = false;
|
|
19531
19531
|
return;
|
|
19532
19532
|
}
|
|
19533
|
-
|
|
19533
|
+
resolve44();
|
|
19534
19534
|
}
|
|
19535
19535
|
};
|
|
19536
19536
|
}
|
|
@@ -21545,12 +21545,12 @@ var init_locators = __esm({
|
|
|
21545
21545
|
}
|
|
21546
21546
|
return defer(() => {
|
|
21547
21547
|
return from(handle.evaluate((element) => {
|
|
21548
|
-
return new Promise((
|
|
21548
|
+
return new Promise((resolve44) => {
|
|
21549
21549
|
window.requestAnimationFrame(() => {
|
|
21550
21550
|
const rect1 = element.getBoundingClientRect();
|
|
21551
21551
|
window.requestAnimationFrame(() => {
|
|
21552
21552
|
const rect2 = element.getBoundingClientRect();
|
|
21553
|
-
|
|
21553
|
+
resolve44([
|
|
21554
21554
|
{
|
|
21555
21555
|
x: rect1.x,
|
|
21556
21556
|
y: rect1.y,
|
|
@@ -23289,9 +23289,9 @@ var init_ElementHandle = __esm({
|
|
|
23289
23289
|
const handle = await this.#asSVGElementHandle();
|
|
23290
23290
|
const target = __addDisposableResource6(env_5, handle && await handle.#getOwnerSVGElement(), false);
|
|
23291
23291
|
return await (target ?? this).evaluate(async (element, threshold) => {
|
|
23292
|
-
const visibleRatio = await new Promise((
|
|
23292
|
+
const visibleRatio = await new Promise((resolve44) => {
|
|
23293
23293
|
const observer = new IntersectionObserver((entries2) => {
|
|
23294
|
-
|
|
23294
|
+
resolve44(entries2[0].intersectionRatio);
|
|
23295
23295
|
observer.disconnect();
|
|
23296
23296
|
});
|
|
23297
23297
|
observer.observe(element);
|
|
@@ -23984,7 +23984,7 @@ var init_Frame = __esm({
|
|
|
23984
23984
|
}
|
|
23985
23985
|
type = type ?? "text/javascript";
|
|
23986
23986
|
return await this.mainRealm().transferHandle(await this.isolatedRealm().evaluateHandle(async ({ url, id, type: type2, content: content2 }) => {
|
|
23987
|
-
return await new Promise((
|
|
23987
|
+
return await new Promise((resolve44, reject) => {
|
|
23988
23988
|
const script = document.createElement("script");
|
|
23989
23989
|
script.type = type2;
|
|
23990
23990
|
script.text = content2;
|
|
@@ -23997,12 +23997,12 @@ var init_Frame = __esm({
|
|
|
23997
23997
|
if (url) {
|
|
23998
23998
|
script.src = url;
|
|
23999
23999
|
script.addEventListener("load", () => {
|
|
24000
|
-
|
|
24000
|
+
resolve44(script);
|
|
24001
24001
|
}, { once: true });
|
|
24002
24002
|
document.head.appendChild(script);
|
|
24003
24003
|
} else {
|
|
24004
24004
|
document.head.appendChild(script);
|
|
24005
|
-
|
|
24005
|
+
resolve44(script);
|
|
24006
24006
|
}
|
|
24007
24007
|
});
|
|
24008
24008
|
}, { ...options, type, content }));
|
|
@@ -24022,7 +24022,7 @@ var init_Frame = __esm({
|
|
|
24022
24022
|
options.content = content;
|
|
24023
24023
|
}
|
|
24024
24024
|
return await this.mainRealm().transferHandle(await this.isolatedRealm().evaluateHandle(async ({ url, content: content2 }) => {
|
|
24025
|
-
return await new Promise((
|
|
24025
|
+
return await new Promise((resolve44, reject) => {
|
|
24026
24026
|
let element;
|
|
24027
24027
|
if (!url) {
|
|
24028
24028
|
element = document.createElement("style");
|
|
@@ -24034,7 +24034,7 @@ var init_Frame = __esm({
|
|
|
24034
24034
|
element = link;
|
|
24035
24035
|
}
|
|
24036
24036
|
element.addEventListener("load", () => {
|
|
24037
|
-
|
|
24037
|
+
resolve44(element);
|
|
24038
24038
|
}, { once: true });
|
|
24039
24039
|
element.addEventListener("error", (event) => {
|
|
24040
24040
|
reject(new Error(event.message ?? "Could not load style"));
|
|
@@ -25773,9 +25773,9 @@ var init_Page = __esm({
|
|
|
25773
25773
|
++this.#screencastSessionCount;
|
|
25774
25774
|
if (!this.#startScreencastPromise) {
|
|
25775
25775
|
this.#startScreencastPromise = this.mainFrame().client.send("Page.startScreencast", { format: "png" }).then(() => {
|
|
25776
|
-
return new Promise((
|
|
25776
|
+
return new Promise((resolve44) => {
|
|
25777
25777
|
return this.mainFrame().client.once("Page.screencastFrame", () => {
|
|
25778
|
-
return
|
|
25778
|
+
return resolve44();
|
|
25779
25779
|
});
|
|
25780
25780
|
});
|
|
25781
25781
|
});
|
|
@@ -29164,11 +29164,11 @@ function addPageBinding(type, name, prefix) {
|
|
|
29164
29164
|
return value instanceof Node;
|
|
29165
29165
|
})
|
|
29166
29166
|
}));
|
|
29167
|
-
return new Promise((
|
|
29167
|
+
return new Promise((resolve44, reject) => {
|
|
29168
29168
|
callPuppeteer.callbacks.set(seq, {
|
|
29169
29169
|
resolve(value) {
|
|
29170
29170
|
callPuppeteer.args.delete(seq);
|
|
29171
|
-
|
|
29171
|
+
resolve44(value);
|
|
29172
29172
|
},
|
|
29173
29173
|
reject(value) {
|
|
29174
29174
|
callPuppeteer.args.delete(seq);
|
|
@@ -33007,8 +33007,8 @@ var init_Input2 = __esm({
|
|
|
33007
33007
|
if (typeof delay === "number") {
|
|
33008
33008
|
await Promise.all(actions);
|
|
33009
33009
|
actions.length = 0;
|
|
33010
|
-
await new Promise((
|
|
33011
|
-
setTimeout(
|
|
33010
|
+
await new Promise((resolve44) => {
|
|
33011
|
+
setTimeout(resolve44, delay);
|
|
33012
33012
|
});
|
|
33013
33013
|
}
|
|
33014
33014
|
actions.push(this.up({ ...options, clickCount }));
|
|
@@ -33028,9 +33028,9 @@ var init_Input2 = __esm({
|
|
|
33028
33028
|
});
|
|
33029
33029
|
}
|
|
33030
33030
|
async drag(start, target) {
|
|
33031
|
-
const promise = new Promise((
|
|
33031
|
+
const promise = new Promise((resolve44) => {
|
|
33032
33032
|
this.#client.once("Input.dragIntercepted", (event) => {
|
|
33033
|
-
return
|
|
33033
|
+
return resolve44(event.data);
|
|
33034
33034
|
});
|
|
33035
33035
|
});
|
|
33036
33036
|
await this.move(start.x, start.y);
|
|
@@ -33071,8 +33071,8 @@ var init_Input2 = __esm({
|
|
|
33071
33071
|
await this.dragEnter(target, data);
|
|
33072
33072
|
await this.dragOver(target, data);
|
|
33073
33073
|
if (delay) {
|
|
33074
|
-
await new Promise((
|
|
33075
|
-
return setTimeout(
|
|
33074
|
+
await new Promise((resolve44) => {
|
|
33075
|
+
return setTimeout(resolve44, delay);
|
|
33076
33076
|
});
|
|
33077
33077
|
}
|
|
33078
33078
|
await this.drop(target, data);
|
|
@@ -33333,11 +33333,11 @@ var init_WebMCP = __esm({
|
|
|
33333
33333
|
*/
|
|
33334
33334
|
async execute(input3 = {}) {
|
|
33335
33335
|
const { invocationId } = await this.#webmcp.invokeTool(this, input3);
|
|
33336
|
-
return await new Promise((
|
|
33336
|
+
return await new Promise((resolve44) => {
|
|
33337
33337
|
const handler4 = (event) => {
|
|
33338
33338
|
if (event.id === invocationId) {
|
|
33339
33339
|
this.#webmcp.off("toolresponded", handler4);
|
|
33340
|
-
|
|
33340
|
+
resolve44(event);
|
|
33341
33341
|
}
|
|
33342
33342
|
};
|
|
33343
33343
|
this.#webmcp.on("toolresponded", handler4);
|
|
@@ -34145,9 +34145,9 @@ var init_Page2 = __esm({
|
|
|
34145
34145
|
async captureHeapSnapshot(options) {
|
|
34146
34146
|
const { createWriteStream: createWriteStream3 } = environment.value.fs;
|
|
34147
34147
|
const stream = createWriteStream3(options.path);
|
|
34148
|
-
const streamPromise = new Promise((
|
|
34148
|
+
const streamPromise = new Promise((resolve44, reject) => {
|
|
34149
34149
|
stream.on("error", reject);
|
|
34150
|
-
stream.on("finish",
|
|
34150
|
+
stream.on("finish", resolve44);
|
|
34151
34151
|
});
|
|
34152
34152
|
const client = this.#primaryTargetClient;
|
|
34153
34153
|
await client.send("HeapProfiler.enable");
|
|
@@ -35513,12 +35513,12 @@ var init_Browser2 = __esm({
|
|
|
35513
35513
|
for (const [targetId, targetInfo] of this._targetManager().getDiscoveredTargetInfos().entries()) {
|
|
35514
35514
|
if (targetInfo.url.includes(id) && targetInfo.type === "service_worker") {
|
|
35515
35515
|
this._targetManager().addToIgnoreTarget(targetId);
|
|
35516
|
-
targetDestroyedPromises.push(new Promise((
|
|
35516
|
+
targetDestroyedPromises.push(new Promise((resolve44) => {
|
|
35517
35517
|
return setTimeout(() => {
|
|
35518
35518
|
this.#connection.emit("Target.targetDestroyed", {
|
|
35519
35519
|
targetId
|
|
35520
35520
|
});
|
|
35521
|
-
|
|
35521
|
+
resolve44(null);
|
|
35522
35522
|
}, 0);
|
|
35523
35523
|
}));
|
|
35524
35524
|
}
|
|
@@ -35921,10 +35921,10 @@ var init_BrowserWebSocketTransport = __esm({
|
|
|
35921
35921
|
"../../node_modules/.pnpm/puppeteer-core@24.41.0/node_modules/puppeteer-core/lib/esm/puppeteer/common/BrowserWebSocketTransport.js"() {
|
|
35922
35922
|
BrowserWebSocketTransport = class _BrowserWebSocketTransport {
|
|
35923
35923
|
static create(url) {
|
|
35924
|
-
return new Promise((
|
|
35924
|
+
return new Promise((resolve44, reject) => {
|
|
35925
35925
|
const ws = new WebSocket(url);
|
|
35926
35926
|
ws.addEventListener("open", () => {
|
|
35927
|
-
return
|
|
35927
|
+
return resolve44(new _BrowserWebSocketTransport(ws));
|
|
35928
35928
|
});
|
|
35929
35929
|
ws.addEventListener("error", reject);
|
|
35930
35930
|
});
|
|
@@ -38846,11 +38846,11 @@ var require_BrowsingContextProcessor = __commonJS({
|
|
|
38846
38846
|
}
|
|
38847
38847
|
const parentCdpClient = context3.cdpTarget.parentCdpClient;
|
|
38848
38848
|
try {
|
|
38849
|
-
const detachedFromTargetPromise = new Promise((
|
|
38849
|
+
const detachedFromTargetPromise = new Promise((resolve44) => {
|
|
38850
38850
|
const onContextDestroyed = (event) => {
|
|
38851
38851
|
if (event.targetId === params.context) {
|
|
38852
38852
|
parentCdpClient.off("Target.detachedFromTarget", onContextDestroyed);
|
|
38853
|
-
|
|
38853
|
+
resolve44();
|
|
38854
38854
|
}
|
|
38855
38855
|
};
|
|
38856
38856
|
parentCdpClient.on("Target.detachedFromTarget", onContextDestroyed);
|
|
@@ -40213,7 +40213,7 @@ var require_ActionDispatcher = __commonJS({
|
|
|
40213
40213
|
}
|
|
40214
40214
|
}
|
|
40215
40215
|
const promises = [
|
|
40216
|
-
new Promise((
|
|
40216
|
+
new Promise((resolve44) => setTimeout(resolve44, this.#tickDuration))
|
|
40217
40217
|
];
|
|
40218
40218
|
for (const option of options) {
|
|
40219
40219
|
promises.push(this.#dispatchAction(option));
|
|
@@ -40814,8 +40814,8 @@ var require_Mutex = __commonJS({
|
|
|
40814
40814
|
acquire() {
|
|
40815
40815
|
const state = { resolved: false };
|
|
40816
40816
|
if (this.#locked) {
|
|
40817
|
-
return new Promise((
|
|
40818
|
-
this.#acquirers.push(() =>
|
|
40817
|
+
return new Promise((resolve44) => {
|
|
40818
|
+
this.#acquirers.push(() => resolve44(this.#release.bind(this, state)));
|
|
40819
40819
|
});
|
|
40820
40820
|
}
|
|
40821
40821
|
this.#locked = true;
|
|
@@ -40826,12 +40826,12 @@ var require_Mutex = __commonJS({
|
|
|
40826
40826
|
throw new Error("Cannot release more than once.");
|
|
40827
40827
|
}
|
|
40828
40828
|
state.resolved = true;
|
|
40829
|
-
const
|
|
40830
|
-
if (!
|
|
40829
|
+
const resolve44 = this.#acquirers.shift();
|
|
40830
|
+
if (!resolve44) {
|
|
40831
40831
|
this.#locked = false;
|
|
40832
40832
|
return;
|
|
40833
40833
|
}
|
|
40834
|
-
|
|
40834
|
+
resolve44();
|
|
40835
40835
|
}
|
|
40836
40836
|
async run(action) {
|
|
40837
40837
|
const release = await this.acquire();
|
|
@@ -42013,8 +42013,8 @@ var require_ChannelProxy = __commonJS({
|
|
|
42013
42013
|
* in the queue.
|
|
42014
42014
|
*/
|
|
42015
42015
|
async getMessage() {
|
|
42016
|
-
const onMessage = queue.length > 0 ? Promise.resolve() : new Promise((
|
|
42017
|
-
queueNonEmptyResolver =
|
|
42016
|
+
const onMessage = queue.length > 0 ? Promise.resolve() : new Promise((resolve44) => {
|
|
42017
|
+
queueNonEmptyResolver = resolve44;
|
|
42018
42018
|
});
|
|
42019
42019
|
await onMessage;
|
|
42020
42020
|
return queue.shift();
|
|
@@ -42119,7 +42119,7 @@ var require_ChannelProxy = __commonJS({
|
|
|
42119
42119
|
functionDeclaration: String((id) => {
|
|
42120
42120
|
const w = window;
|
|
42121
42121
|
if (w[id] === void 0) {
|
|
42122
|
-
return new Promise((
|
|
42122
|
+
return new Promise((resolve44) => w[id] = resolve44);
|
|
42123
42123
|
}
|
|
42124
42124
|
const channelProxy = w[id];
|
|
42125
42125
|
delete w[id];
|
|
@@ -43620,8 +43620,8 @@ var require_Deferred = __commonJS({
|
|
|
43620
43620
|
return this.#result;
|
|
43621
43621
|
}
|
|
43622
43622
|
constructor() {
|
|
43623
|
-
this.#promise = new Promise((
|
|
43624
|
-
this.#resolve =
|
|
43623
|
+
this.#promise = new Promise((resolve44, reject) => {
|
|
43624
|
+
this.#resolve = resolve44;
|
|
43625
43625
|
this.#reject = reject;
|
|
43626
43626
|
});
|
|
43627
43627
|
this.#promise.catch((_error) => {
|
|
@@ -48465,11 +48465,11 @@ var require_BrowsingContextStorage = __commonJS({
|
|
|
48465
48465
|
if (this.#contexts.has(browsingContextId)) {
|
|
48466
48466
|
return Promise.resolve(this.getContext(browsingContextId));
|
|
48467
48467
|
}
|
|
48468
|
-
return new Promise((
|
|
48468
|
+
return new Promise((resolve44) => {
|
|
48469
48469
|
const listener = (event) => {
|
|
48470
48470
|
if (event.browsingContext.id === browsingContextId) {
|
|
48471
48471
|
this.#eventEmitter.off("added", listener);
|
|
48472
|
-
|
|
48472
|
+
resolve44(event.browsingContext);
|
|
48473
48473
|
}
|
|
48474
48474
|
};
|
|
48475
48475
|
this.#eventEmitter.on("added", listener);
|
|
@@ -52069,8 +52069,8 @@ var init_ExposedFunction = __esm({
|
|
|
52069
52069
|
const functionDeclaration = stringifyFunction(interpolateFunction((callback) => {
|
|
52070
52070
|
Object.assign(globalThis, {
|
|
52071
52071
|
[PLACEHOLDER("name")]: function(...args) {
|
|
52072
|
-
return new Promise((
|
|
52073
|
-
callback([
|
|
52072
|
+
return new Promise((resolve44, reject) => {
|
|
52073
|
+
callback([resolve44, reject, args]);
|
|
52074
52074
|
});
|
|
52075
52075
|
}
|
|
52076
52076
|
});
|
|
@@ -52158,8 +52158,8 @@ var init_ExposedFunction = __esm({
|
|
|
52158
52158
|
return;
|
|
52159
52159
|
}
|
|
52160
52160
|
try {
|
|
52161
|
-
await dataHandle.evaluate(([
|
|
52162
|
-
|
|
52161
|
+
await dataHandle.evaluate(([resolve44], result2) => {
|
|
52162
|
+
resolve44(result2);
|
|
52163
52163
|
}, result);
|
|
52164
52164
|
} catch (error) {
|
|
52165
52165
|
debugError(error);
|
|
@@ -60301,7 +60301,7 @@ var init_NodeWebSocketTransport = __esm({
|
|
|
60301
60301
|
init_version();
|
|
60302
60302
|
NodeWebSocketTransport = class _NodeWebSocketTransport {
|
|
60303
60303
|
static create(url, headers) {
|
|
60304
|
-
return new Promise((
|
|
60304
|
+
return new Promise((resolve44, reject) => {
|
|
60305
60305
|
const ws = new wrapper_default(url, [], {
|
|
60306
60306
|
followRedirects: true,
|
|
60307
60307
|
perMessageDeflate: false,
|
|
@@ -60314,7 +60314,7 @@ var init_NodeWebSocketTransport = __esm({
|
|
|
60314
60314
|
}
|
|
60315
60315
|
});
|
|
60316
60316
|
ws.addEventListener("open", () => {
|
|
60317
|
-
return
|
|
60317
|
+
return resolve44(new _NodeWebSocketTransport(ws));
|
|
60318
60318
|
});
|
|
60319
60319
|
ws.addEventListener("error", reject);
|
|
60320
60320
|
});
|
|
@@ -63375,8 +63375,8 @@ var require_helpers = __commonJS({
|
|
|
63375
63375
|
function req(url, opts = {}) {
|
|
63376
63376
|
const href = typeof url === "string" ? url : url.href;
|
|
63377
63377
|
const req2 = (href.startsWith("https:") ? https3 : http3).request(url, opts);
|
|
63378
|
-
const promise = new Promise((
|
|
63379
|
-
req2.once("response",
|
|
63378
|
+
const promise = new Promise((resolve44, reject) => {
|
|
63379
|
+
req2.once("response", resolve44).once("error", reject).end();
|
|
63380
63380
|
});
|
|
63381
63381
|
req2.then = promise.then.bind(promise);
|
|
63382
63382
|
return req2;
|
|
@@ -63753,7 +63753,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
63753
63753
|
var debug_1 = __importDefault3(require_src());
|
|
63754
63754
|
var debug7 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
|
|
63755
63755
|
function parseProxyResponse(socket) {
|
|
63756
|
-
return new Promise((
|
|
63756
|
+
return new Promise((resolve44, reject) => {
|
|
63757
63757
|
let buffersLength = 0;
|
|
63758
63758
|
const buffers = [];
|
|
63759
63759
|
function read() {
|
|
@@ -63819,7 +63819,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
63819
63819
|
}
|
|
63820
63820
|
debug7("got proxy server response: %o %o", firstLine, headers);
|
|
63821
63821
|
cleanup();
|
|
63822
|
-
|
|
63822
|
+
resolve44({
|
|
63823
63823
|
connect: {
|
|
63824
63824
|
statusCode,
|
|
63825
63825
|
statusText,
|
|
@@ -67077,11 +67077,11 @@ var require_socksclient = __commonJS({
|
|
|
67077
67077
|
"use strict";
|
|
67078
67078
|
var __awaiter4 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
67079
67079
|
function adopt(value) {
|
|
67080
|
-
return value instanceof P ? value : new P(function(
|
|
67081
|
-
|
|
67080
|
+
return value instanceof P ? value : new P(function(resolve44) {
|
|
67081
|
+
resolve44(value);
|
|
67082
67082
|
});
|
|
67083
67083
|
}
|
|
67084
|
-
return new (P || (P = Promise))(function(
|
|
67084
|
+
return new (P || (P = Promise))(function(resolve44, reject) {
|
|
67085
67085
|
function fulfilled(value) {
|
|
67086
67086
|
try {
|
|
67087
67087
|
step(generator.next(value));
|
|
@@ -67097,7 +67097,7 @@ var require_socksclient = __commonJS({
|
|
|
67097
67097
|
}
|
|
67098
67098
|
}
|
|
67099
67099
|
function step(result) {
|
|
67100
|
-
result.done ?
|
|
67100
|
+
result.done ? resolve44(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
67101
67101
|
}
|
|
67102
67102
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
67103
67103
|
});
|
|
@@ -67131,13 +67131,13 @@ var require_socksclient = __commonJS({
|
|
|
67131
67131
|
* @returns { Promise }
|
|
67132
67132
|
*/
|
|
67133
67133
|
static createConnection(options, callback) {
|
|
67134
|
-
return new Promise((
|
|
67134
|
+
return new Promise((resolve44, reject) => {
|
|
67135
67135
|
try {
|
|
67136
67136
|
(0, helpers_1.validateSocksClientOptions)(options, ["connect"]);
|
|
67137
67137
|
} catch (err) {
|
|
67138
67138
|
if (typeof callback === "function") {
|
|
67139
67139
|
callback(err);
|
|
67140
|
-
return
|
|
67140
|
+
return resolve44(err);
|
|
67141
67141
|
} else {
|
|
67142
67142
|
return reject(err);
|
|
67143
67143
|
}
|
|
@@ -67148,16 +67148,16 @@ var require_socksclient = __commonJS({
|
|
|
67148
67148
|
client.removeAllListeners();
|
|
67149
67149
|
if (typeof callback === "function") {
|
|
67150
67150
|
callback(null, info);
|
|
67151
|
-
|
|
67151
|
+
resolve44(info);
|
|
67152
67152
|
} else {
|
|
67153
|
-
|
|
67153
|
+
resolve44(info);
|
|
67154
67154
|
}
|
|
67155
67155
|
});
|
|
67156
67156
|
client.once("error", (err) => {
|
|
67157
67157
|
client.removeAllListeners();
|
|
67158
67158
|
if (typeof callback === "function") {
|
|
67159
67159
|
callback(err);
|
|
67160
|
-
|
|
67160
|
+
resolve44(err);
|
|
67161
67161
|
} else {
|
|
67162
67162
|
reject(err);
|
|
67163
67163
|
}
|
|
@@ -67174,13 +67174,13 @@ var require_socksclient = __commonJS({
|
|
|
67174
67174
|
* @returns { Promise }
|
|
67175
67175
|
*/
|
|
67176
67176
|
static createConnectionChain(options, callback) {
|
|
67177
|
-
return new Promise((
|
|
67177
|
+
return new Promise((resolve44, reject) => __awaiter4(this, void 0, void 0, function* () {
|
|
67178
67178
|
try {
|
|
67179
67179
|
(0, helpers_1.validateSocksClientChainOptions)(options);
|
|
67180
67180
|
} catch (err) {
|
|
67181
67181
|
if (typeof callback === "function") {
|
|
67182
67182
|
callback(err);
|
|
67183
|
-
return
|
|
67183
|
+
return resolve44(err);
|
|
67184
67184
|
} else {
|
|
67185
67185
|
return reject(err);
|
|
67186
67186
|
}
|
|
@@ -67206,14 +67206,14 @@ var require_socksclient = __commonJS({
|
|
|
67206
67206
|
}
|
|
67207
67207
|
if (typeof callback === "function") {
|
|
67208
67208
|
callback(null, { socket: sock });
|
|
67209
|
-
|
|
67209
|
+
resolve44({ socket: sock });
|
|
67210
67210
|
} else {
|
|
67211
|
-
|
|
67211
|
+
resolve44({ socket: sock });
|
|
67212
67212
|
}
|
|
67213
67213
|
} catch (err) {
|
|
67214
67214
|
if (typeof callback === "function") {
|
|
67215
67215
|
callback(err);
|
|
67216
|
-
|
|
67216
|
+
resolve44(err);
|
|
67217
67217
|
} else {
|
|
67218
67218
|
reject(err);
|
|
67219
67219
|
}
|
|
@@ -67897,12 +67897,12 @@ var require_dist4 = __commonJS({
|
|
|
67897
67897
|
let { host } = opts;
|
|
67898
67898
|
const { port, lookup: lookupFn = dns.lookup } = opts;
|
|
67899
67899
|
if (shouldLookup) {
|
|
67900
|
-
host = await new Promise((
|
|
67900
|
+
host = await new Promise((resolve44, reject) => {
|
|
67901
67901
|
lookupFn(host, {}, (err, res) => {
|
|
67902
67902
|
if (err) {
|
|
67903
67903
|
reject(err);
|
|
67904
67904
|
} else {
|
|
67905
|
-
|
|
67905
|
+
resolve44(res);
|
|
67906
67906
|
}
|
|
67907
67907
|
});
|
|
67908
67908
|
});
|
|
@@ -68562,7 +68562,7 @@ var require_netUtils = __commonJS({
|
|
|
68562
68562
|
return `${socket.remoteAddress}:${socket.remotePort}`;
|
|
68563
68563
|
}
|
|
68564
68564
|
function upgradeSocket(socket, options) {
|
|
68565
|
-
return new Promise((
|
|
68565
|
+
return new Promise((resolve44, reject) => {
|
|
68566
68566
|
const tlsOptions = Object.assign({}, options, {
|
|
68567
68567
|
socket
|
|
68568
68568
|
});
|
|
@@ -68572,7 +68572,7 @@ var require_netUtils = __commonJS({
|
|
|
68572
68572
|
reject(tlsSocket.authorizationError);
|
|
68573
68573
|
} else {
|
|
68574
68574
|
tlsSocket.removeAllListeners("error");
|
|
68575
|
-
|
|
68575
|
+
resolve44(tlsSocket);
|
|
68576
68576
|
}
|
|
68577
68577
|
}).once("error", (error) => {
|
|
68578
68578
|
reject(error);
|
|
@@ -69202,7 +69202,7 @@ var require_transfer = __commonJS({
|
|
|
69202
69202
|
};
|
|
69203
69203
|
}
|
|
69204
69204
|
function connectForPassiveTransfer(host, port, ftp) {
|
|
69205
|
-
return new Promise((
|
|
69205
|
+
return new Promise((resolve44, reject) => {
|
|
69206
69206
|
let socket = ftp._newSocket();
|
|
69207
69207
|
const handleConnErr = function(err) {
|
|
69208
69208
|
err.message = "Can't open data connection in passive mode: " + err.message;
|
|
@@ -69230,7 +69230,7 @@ var require_transfer = __commonJS({
|
|
|
69230
69230
|
socket.removeListener("error", handleConnErr);
|
|
69231
69231
|
socket.removeListener("timeout", handleTimeout);
|
|
69232
69232
|
ftp.dataSocket = socket;
|
|
69233
|
-
|
|
69233
|
+
resolve44();
|
|
69234
69234
|
});
|
|
69235
69235
|
});
|
|
69236
69236
|
}
|
|
@@ -81702,11 +81702,11 @@ function __metadata(metadataKey, metadataValue) {
|
|
|
81702
81702
|
}
|
|
81703
81703
|
function __awaiter2(thisArg, _arguments, P, generator) {
|
|
81704
81704
|
function adopt(value) {
|
|
81705
|
-
return value instanceof P ? value : new P(function(
|
|
81706
|
-
|
|
81705
|
+
return value instanceof P ? value : new P(function(resolve44) {
|
|
81706
|
+
resolve44(value);
|
|
81707
81707
|
});
|
|
81708
81708
|
}
|
|
81709
|
-
return new (P || (P = Promise))(function(
|
|
81709
|
+
return new (P || (P = Promise))(function(resolve44, reject) {
|
|
81710
81710
|
function fulfilled(value) {
|
|
81711
81711
|
try {
|
|
81712
81712
|
step(generator.next(value));
|
|
@@ -81722,7 +81722,7 @@ function __awaiter2(thisArg, _arguments, P, generator) {
|
|
|
81722
81722
|
}
|
|
81723
81723
|
}
|
|
81724
81724
|
function step(result) {
|
|
81725
|
-
result.done ?
|
|
81725
|
+
result.done ? resolve44(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
81726
81726
|
}
|
|
81727
81727
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
81728
81728
|
});
|
|
@@ -81913,14 +81913,14 @@ function __asyncValues2(o) {
|
|
|
81913
81913
|
}, i);
|
|
81914
81914
|
function verb(n) {
|
|
81915
81915
|
i[n] = o[n] && function(v) {
|
|
81916
|
-
return new Promise(function(
|
|
81917
|
-
v = o[n](v), settle(
|
|
81916
|
+
return new Promise(function(resolve44, reject) {
|
|
81917
|
+
v = o[n](v), settle(resolve44, reject, v.done, v.value);
|
|
81918
81918
|
});
|
|
81919
81919
|
};
|
|
81920
81920
|
}
|
|
81921
|
-
function settle(
|
|
81921
|
+
function settle(resolve44, reject, d, v) {
|
|
81922
81922
|
Promise.resolve(v).then(function(v2) {
|
|
81923
|
-
|
|
81923
|
+
resolve44({ value: v2, done: d });
|
|
81924
81924
|
}, reject);
|
|
81925
81925
|
}
|
|
81926
81926
|
}
|
|
@@ -85473,12 +85473,12 @@ var require_util4 = __commonJS({
|
|
|
85473
85473
|
exports.isGMT = exports.dnsLookup = void 0;
|
|
85474
85474
|
var dns_1 = __require("dns");
|
|
85475
85475
|
function dnsLookup(host, opts) {
|
|
85476
|
-
return new Promise((
|
|
85476
|
+
return new Promise((resolve44, reject) => {
|
|
85477
85477
|
(0, dns_1.lookup)(host, opts, (err, res) => {
|
|
85478
85478
|
if (err) {
|
|
85479
85479
|
reject(err);
|
|
85480
85480
|
} else {
|
|
85481
|
-
|
|
85481
|
+
resolve44(res);
|
|
85482
85482
|
}
|
|
85483
85483
|
});
|
|
85484
85484
|
});
|
|
@@ -86083,10 +86083,10 @@ var require_myIpAddress = __commonJS({
|
|
|
86083
86083
|
var ip_1 = require_ip();
|
|
86084
86084
|
var net_1 = __importDefault3(__require("net"));
|
|
86085
86085
|
async function myIpAddress() {
|
|
86086
|
-
return new Promise((
|
|
86086
|
+
return new Promise((resolve44, reject) => {
|
|
86087
86087
|
const socket = net_1.default.connect({ host: "8.8.8.8", port: 53 });
|
|
86088
86088
|
const onError = () => {
|
|
86089
|
-
|
|
86089
|
+
resolve44(ip_1.ip.address());
|
|
86090
86090
|
};
|
|
86091
86091
|
socket.once("error", onError);
|
|
86092
86092
|
socket.once("connect", () => {
|
|
@@ -86094,9 +86094,9 @@ var require_myIpAddress = __commonJS({
|
|
|
86094
86094
|
const addr = socket.address();
|
|
86095
86095
|
socket.destroy();
|
|
86096
86096
|
if (typeof addr === "string") {
|
|
86097
|
-
|
|
86097
|
+
resolve44(addr);
|
|
86098
86098
|
} else if (addr.address) {
|
|
86099
|
-
|
|
86099
|
+
resolve44(addr.address);
|
|
86100
86100
|
} else {
|
|
86101
86101
|
reject(new Error("Expected a `string`"));
|
|
86102
86102
|
}
|
|
@@ -86674,8 +86674,8 @@ var require_deferred_promise = __commonJS({
|
|
|
86674
86674
|
this.context = args.context;
|
|
86675
86675
|
this.owner = args.context.runtime;
|
|
86676
86676
|
this.handle = args.promiseHandle;
|
|
86677
|
-
this.settled = new Promise((
|
|
86678
|
-
this.onSettled =
|
|
86677
|
+
this.settled = new Promise((resolve44) => {
|
|
86678
|
+
this.onSettled = resolve44;
|
|
86679
86679
|
});
|
|
86680
86680
|
this.resolveHandle = args.resolveHandle;
|
|
86681
86681
|
this.rejectHandle = args.rejectHandle;
|
|
@@ -87196,13 +87196,13 @@ var require_context = __commonJS({
|
|
|
87196
87196
|
if (vmResolveResult.error) {
|
|
87197
87197
|
return Promise.resolve(vmResolveResult);
|
|
87198
87198
|
}
|
|
87199
|
-
return new Promise((
|
|
87199
|
+
return new Promise((resolve44) => {
|
|
87200
87200
|
lifetime_1.Scope.withScope((scope) => {
|
|
87201
87201
|
const resolveHandle = scope.manage(this.newFunction("resolve", (value) => {
|
|
87202
|
-
|
|
87202
|
+
resolve44({ value: value && value.dup() });
|
|
87203
87203
|
}));
|
|
87204
87204
|
const rejectHandle = scope.manage(this.newFunction("reject", (error) => {
|
|
87205
|
-
|
|
87205
|
+
resolve44({ error: error && error.dup() });
|
|
87206
87206
|
}));
|
|
87207
87207
|
const promiseHandle = scope.manage(vmResolveResult.value);
|
|
87208
87208
|
const promiseThenHandle = scope.manage(this.getProp(promiseHandle, "then"));
|
|
@@ -89577,13 +89577,13 @@ import * as http from "node:http";
|
|
|
89577
89577
|
import * as https from "node:https";
|
|
89578
89578
|
import { URL as URL2, urlToHttpOptions } from "node:url";
|
|
89579
89579
|
function headHttpRequest(url) {
|
|
89580
|
-
return new Promise((
|
|
89580
|
+
return new Promise((resolve44) => {
|
|
89581
89581
|
const request5 = httpRequest(url, "HEAD", (response) => {
|
|
89582
89582
|
response.resume();
|
|
89583
|
-
|
|
89583
|
+
resolve44(response.statusCode === 200);
|
|
89584
89584
|
}, false);
|
|
89585
89585
|
request5.on("error", () => {
|
|
89586
|
-
|
|
89586
|
+
resolve44(false);
|
|
89587
89587
|
});
|
|
89588
89588
|
});
|
|
89589
89589
|
}
|
|
@@ -89611,7 +89611,7 @@ function httpRequest(url, method, response, keepAlive = true) {
|
|
|
89611
89611
|
return request5;
|
|
89612
89612
|
}
|
|
89613
89613
|
function downloadFile(url, destinationPath, progressCallback) {
|
|
89614
|
-
return new Promise((
|
|
89614
|
+
return new Promise((resolve44, reject) => {
|
|
89615
89615
|
let downloadedBytes = 0;
|
|
89616
89616
|
let totalBytes = 0;
|
|
89617
89617
|
function onData(chunk) {
|
|
@@ -89627,7 +89627,7 @@ function downloadFile(url, destinationPath, progressCallback) {
|
|
|
89627
89627
|
}
|
|
89628
89628
|
const file = createWriteStream(destinationPath);
|
|
89629
89629
|
file.on("close", () => {
|
|
89630
|
-
return
|
|
89630
|
+
return resolve44();
|
|
89631
89631
|
});
|
|
89632
89632
|
file.on("error", (error) => {
|
|
89633
89633
|
return reject(error);
|
|
@@ -89652,7 +89652,7 @@ async function getJSON(url) {
|
|
|
89652
89652
|
}
|
|
89653
89653
|
}
|
|
89654
89654
|
function getText(url) {
|
|
89655
|
-
return new Promise((
|
|
89655
|
+
return new Promise((resolve44, reject) => {
|
|
89656
89656
|
const request5 = httpRequest(url, "GET", (response) => {
|
|
89657
89657
|
let data = "";
|
|
89658
89658
|
if (response.statusCode && response.statusCode >= 400) {
|
|
@@ -89663,7 +89663,7 @@ function getText(url) {
|
|
|
89663
89663
|
});
|
|
89664
89664
|
response.on("end", () => {
|
|
89665
89665
|
try {
|
|
89666
|
-
return
|
|
89666
|
+
return resolve44(String(data));
|
|
89667
89667
|
} catch {
|
|
89668
89668
|
return reject(new Error(`Failed to read text response from ${url}`));
|
|
89669
89669
|
}
|
|
@@ -91055,7 +91055,7 @@ var init_launch = __esm({
|
|
|
91055
91055
|
if (opts.onExit) {
|
|
91056
91056
|
this.#onExitHook = opts.onExit;
|
|
91057
91057
|
}
|
|
91058
|
-
this.#browserProcessExiting = new Promise((
|
|
91058
|
+
this.#browserProcessExiting = new Promise((resolve44, reject) => {
|
|
91059
91059
|
this.#browserProcess.once("exit", async () => {
|
|
91060
91060
|
debugLaunch(`Browser process ${this.#browserProcess.pid} onExit`);
|
|
91061
91061
|
this.#clearListeners();
|
|
@@ -91066,7 +91066,7 @@ var init_launch = __esm({
|
|
|
91066
91066
|
reject(err);
|
|
91067
91067
|
return;
|
|
91068
91068
|
}
|
|
91069
|
-
|
|
91069
|
+
resolve44();
|
|
91070
91070
|
});
|
|
91071
91071
|
});
|
|
91072
91072
|
}
|
|
@@ -91182,7 +91182,7 @@ Error cause: ${isErrorLike2(error) ? error.stack : error}`);
|
|
|
91182
91182
|
return [...this.#logs];
|
|
91183
91183
|
}
|
|
91184
91184
|
waitForLineOutput(regex2, timeout3 = 0) {
|
|
91185
|
-
return new Promise((
|
|
91185
|
+
return new Promise((resolve44, reject) => {
|
|
91186
91186
|
const onClose = (errorOrCode) => {
|
|
91187
91187
|
cleanup();
|
|
91188
91188
|
reject(new Error([
|
|
@@ -91218,7 +91218,7 @@ Error cause: ${isErrorLike2(error) ? error.stack : error}`);
|
|
|
91218
91218
|
return;
|
|
91219
91219
|
}
|
|
91220
91220
|
cleanup();
|
|
91221
|
-
|
|
91221
|
+
resolve44(match2[1]);
|
|
91222
91222
|
}
|
|
91223
91223
|
});
|
|
91224
91224
|
}
|
|
@@ -91687,7 +91687,7 @@ var require_get_stream = __commonJS({
|
|
|
91687
91687
|
};
|
|
91688
91688
|
const { maxBuffer } = options;
|
|
91689
91689
|
let stream;
|
|
91690
|
-
await new Promise((
|
|
91690
|
+
await new Promise((resolve44, reject) => {
|
|
91691
91691
|
const rejectPromise = (error) => {
|
|
91692
91692
|
if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
|
|
91693
91693
|
error.bufferedData = stream.getBufferedValue();
|
|
@@ -91699,7 +91699,7 @@ var require_get_stream = __commonJS({
|
|
|
91699
91699
|
rejectPromise(error);
|
|
91700
91700
|
return;
|
|
91701
91701
|
}
|
|
91702
|
-
|
|
91702
|
+
resolve44();
|
|
91703
91703
|
});
|
|
91704
91704
|
stream.on("data", () => {
|
|
91705
91705
|
if (stream.getBufferedLength() > maxBuffer) {
|
|
@@ -92988,7 +92988,7 @@ var require_extract_zip = __commonJS({
|
|
|
92988
92988
|
debug7("opening", this.zipPath, "with opts", this.opts);
|
|
92989
92989
|
this.zipfile = await openZip(this.zipPath, { lazyEntries: true });
|
|
92990
92990
|
this.canceled = false;
|
|
92991
|
-
return new Promise((
|
|
92991
|
+
return new Promise((resolve44, reject) => {
|
|
92992
92992
|
this.zipfile.on("error", (err) => {
|
|
92993
92993
|
this.canceled = true;
|
|
92994
92994
|
reject(err);
|
|
@@ -92997,7 +92997,7 @@ var require_extract_zip = __commonJS({
|
|
|
92997
92997
|
this.zipfile.on("close", () => {
|
|
92998
92998
|
if (!this.canceled) {
|
|
92999
92999
|
debug7("zip extraction complete");
|
|
93000
|
-
|
|
93000
|
+
resolve44();
|
|
93001
93001
|
}
|
|
93002
93002
|
});
|
|
93003
93003
|
this.zipfile.on("entry", async (entry) => {
|
|
@@ -94254,8 +94254,8 @@ var require_streamx = __commonJS({
|
|
|
94254
94254
|
return this;
|
|
94255
94255
|
},
|
|
94256
94256
|
next() {
|
|
94257
|
-
return new Promise(function(
|
|
94258
|
-
promiseResolve =
|
|
94257
|
+
return new Promise(function(resolve44, reject) {
|
|
94258
|
+
promiseResolve = resolve44;
|
|
94259
94259
|
promiseReject = reject;
|
|
94260
94260
|
const data = stream.read();
|
|
94261
94261
|
if (data !== null) ondata(data);
|
|
@@ -94285,11 +94285,11 @@ var require_streamx = __commonJS({
|
|
|
94285
94285
|
}
|
|
94286
94286
|
function destroy(err) {
|
|
94287
94287
|
stream.destroy(err);
|
|
94288
|
-
return new Promise((
|
|
94289
|
-
if (stream._duplexState & DESTROYED) return
|
|
94288
|
+
return new Promise((resolve44, reject) => {
|
|
94289
|
+
if (stream._duplexState & DESTROYED) return resolve44({ value: void 0, done: true });
|
|
94290
94290
|
stream.once("close", function() {
|
|
94291
94291
|
if (err) reject(err);
|
|
94292
|
-
else
|
|
94292
|
+
else resolve44({ value: void 0, done: true });
|
|
94293
94293
|
});
|
|
94294
94294
|
});
|
|
94295
94295
|
}
|
|
@@ -94333,8 +94333,8 @@ var require_streamx = __commonJS({
|
|
|
94333
94333
|
const writes = pending + (ws._duplexState & WRITE_WRITING ? 1 : 0);
|
|
94334
94334
|
if (writes === 0) return Promise.resolve(true);
|
|
94335
94335
|
if (state.drains === null) state.drains = [];
|
|
94336
|
-
return new Promise((
|
|
94337
|
-
state.drains.push({ writes, resolve:
|
|
94336
|
+
return new Promise((resolve44) => {
|
|
94337
|
+
state.drains.push({ writes, resolve: resolve44 });
|
|
94338
94338
|
});
|
|
94339
94339
|
}
|
|
94340
94340
|
write(data) {
|
|
@@ -94439,10 +94439,10 @@ var require_streamx = __commonJS({
|
|
|
94439
94439
|
cb(null);
|
|
94440
94440
|
}
|
|
94441
94441
|
function pipelinePromise(...streams) {
|
|
94442
|
-
return new Promise((
|
|
94442
|
+
return new Promise((resolve44, reject) => {
|
|
94443
94443
|
return pipeline(...streams, (err) => {
|
|
94444
94444
|
if (err) return reject(err);
|
|
94445
|
-
|
|
94445
|
+
resolve44();
|
|
94446
94446
|
});
|
|
94447
94447
|
});
|
|
94448
94448
|
}
|
|
@@ -95097,16 +95097,16 @@ var require_extract = __commonJS({
|
|
|
95097
95097
|
entryCallback = null;
|
|
95098
95098
|
cb(err);
|
|
95099
95099
|
}
|
|
95100
|
-
function onnext(
|
|
95100
|
+
function onnext(resolve44, reject) {
|
|
95101
95101
|
if (error) {
|
|
95102
95102
|
return reject(error);
|
|
95103
95103
|
}
|
|
95104
95104
|
if (entryStream) {
|
|
95105
|
-
|
|
95105
|
+
resolve44({ value: entryStream, done: false });
|
|
95106
95106
|
entryStream = null;
|
|
95107
95107
|
return;
|
|
95108
95108
|
}
|
|
95109
|
-
promiseResolve =
|
|
95109
|
+
promiseResolve = resolve44;
|
|
95110
95110
|
promiseReject = reject;
|
|
95111
95111
|
consumeCallback(null);
|
|
95112
95112
|
if (extract._finished && promiseResolve) {
|
|
@@ -95134,11 +95134,11 @@ var require_extract = __commonJS({
|
|
|
95134
95134
|
function destroy(err) {
|
|
95135
95135
|
extract.destroy(err);
|
|
95136
95136
|
consumeCallback(err);
|
|
95137
|
-
return new Promise((
|
|
95138
|
-
if (extract.destroyed) return
|
|
95137
|
+
return new Promise((resolve44, reject) => {
|
|
95138
|
+
if (extract.destroyed) return resolve44({ value: void 0, done: true });
|
|
95139
95139
|
extract.once("close", function() {
|
|
95140
95140
|
if (err) reject(err);
|
|
95141
|
-
else
|
|
95141
|
+
else resolve44({ value: void 0, done: true });
|
|
95142
95142
|
});
|
|
95143
95143
|
});
|
|
95144
95144
|
}
|
|
@@ -100114,12 +100114,12 @@ var init_yargs_factory = __esm({
|
|
|
100114
100114
|
async getCompletion(args, done) {
|
|
100115
100115
|
argsert("<array> [function]", [args, done], arguments.length);
|
|
100116
100116
|
if (!done) {
|
|
100117
|
-
return new Promise((
|
|
100117
|
+
return new Promise((resolve44, reject) => {
|
|
100118
100118
|
__classPrivateFieldGet2(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => {
|
|
100119
100119
|
if (err)
|
|
100120
100120
|
reject(err);
|
|
100121
100121
|
else
|
|
100122
|
-
|
|
100122
|
+
resolve44(completions);
|
|
100123
100123
|
});
|
|
100124
100124
|
});
|
|
100125
100125
|
} else {
|
|
@@ -102921,8 +102921,8 @@ var init_ScreenRecorder = __esm({
|
|
|
102921
102921
|
static {
|
|
102922
102922
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
102923
102923
|
__esDecorate23(this, _private_writeFrame_descriptor = { value: __setFunctionName6(async function(buffer) {
|
|
102924
|
-
const error = await new Promise((
|
|
102925
|
-
this.#process.stdin.write(buffer,
|
|
102924
|
+
const error = await new Promise((resolve44) => {
|
|
102925
|
+
this.#process.stdin.write(buffer, resolve44);
|
|
102926
102926
|
});
|
|
102927
102927
|
if (error) {
|
|
102928
102928
|
console.log(`ffmpeg failed to write: ${error.message}.`);
|
|
@@ -103112,8 +103112,8 @@ var init_ScreenRecorder = __esm({
|
|
|
103112
103112
|
const [buffer, timestamp] = await this.#lastFrame;
|
|
103113
103113
|
await Promise.all(Array(Math.max(1, Math.round(this.#fps * (performance.now() - timestamp) / 1e3))).fill(buffer).map(this.#writeFrame.bind(this)));
|
|
103114
103114
|
this.#process.stdin.end();
|
|
103115
|
-
await new Promise((
|
|
103116
|
-
this.#process.once("close",
|
|
103115
|
+
await new Promise((resolve44) => {
|
|
103116
|
+
this.#process.once("close", resolve44);
|
|
103117
103117
|
});
|
|
103118
103118
|
}
|
|
103119
103119
|
/**
|
|
@@ -115453,7 +115453,7 @@ ${lanes.join("\n")}
|
|
|
115453
115453
|
writeOutputIsTTY() {
|
|
115454
115454
|
return process.stdout.isTTY;
|
|
115455
115455
|
},
|
|
115456
|
-
readFile:
|
|
115456
|
+
readFile: readFile26,
|
|
115457
115457
|
writeFile: writeFile27,
|
|
115458
115458
|
watchFile: watchFile2,
|
|
115459
115459
|
watchDirectory,
|
|
@@ -115659,7 +115659,7 @@ ${lanes.join("\n")}
|
|
|
115659
115659
|
callback
|
|
115660
115660
|
);
|
|
115661
115661
|
}
|
|
115662
|
-
function
|
|
115662
|
+
function readFile26(fileName, _encoding) {
|
|
115663
115663
|
let buffer;
|
|
115664
115664
|
try {
|
|
115665
115665
|
buffer = _fs.readFileSync(fileName);
|
|
@@ -140286,8 +140286,8 @@ ${lanes.join("\n")}
|
|
|
140286
140286
|
return void 0;
|
|
140287
140287
|
}
|
|
140288
140288
|
function tryRenameExternalModule(factory2, moduleName, sourceFile) {
|
|
140289
|
-
const
|
|
140290
|
-
return
|
|
140289
|
+
const rename7 = sourceFile.renamedDependencies && sourceFile.renamedDependencies.get(moduleName.text);
|
|
140290
|
+
return rename7 ? factory2.createStringLiteral(rename7) : void 0;
|
|
140291
140291
|
}
|
|
140292
140292
|
function tryGetModuleNameFromFile(factory2, file, host, options) {
|
|
140293
140293
|
if (!file) {
|
|
@@ -152215,7 +152215,7 @@ ${lanes.join("\n")}
|
|
|
152215
152215
|
const possibleOption = getSpellingSuggestion(unknownOption, diagnostics.optionDeclarations, getOptionName);
|
|
152216
152216
|
return possibleOption ? createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownDidYouMeanDiagnostic, unknownOptionErrorText || unknownOption, possibleOption.name) : createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownOptionDiagnostic, unknownOptionErrorText || unknownOption);
|
|
152217
152217
|
}
|
|
152218
|
-
function parseCommandLineWorker(diagnostics, commandLine,
|
|
152218
|
+
function parseCommandLineWorker(diagnostics, commandLine, readFile26) {
|
|
152219
152219
|
const options = {};
|
|
152220
152220
|
let watchOptions;
|
|
152221
152221
|
const fileNames = [];
|
|
@@ -152263,7 +152263,7 @@ ${lanes.join("\n")}
|
|
|
152263
152263
|
}
|
|
152264
152264
|
}
|
|
152265
152265
|
function parseResponseFile(fileName) {
|
|
152266
|
-
const text = tryReadFile(fileName,
|
|
152266
|
+
const text = tryReadFile(fileName, readFile26 || ((fileName2) => sys.readFile(fileName2)));
|
|
152267
152267
|
if (!isString3(text)) {
|
|
152268
152268
|
errors.push(text);
|
|
152269
152269
|
return;
|
|
@@ -152366,8 +152366,8 @@ ${lanes.join("\n")}
|
|
|
152366
152366
|
unknownDidYouMeanDiagnostic: Diagnostics.Unknown_compiler_option_0_Did_you_mean_1,
|
|
152367
152367
|
optionTypeMismatchDiagnostic: Diagnostics.Compiler_option_0_expects_an_argument
|
|
152368
152368
|
};
|
|
152369
|
-
function parseCommandLine(commandLine,
|
|
152370
|
-
return parseCommandLineWorker(compilerOptionsDidYouMeanDiagnostics, commandLine,
|
|
152369
|
+
function parseCommandLine(commandLine, readFile26) {
|
|
152370
|
+
return parseCommandLineWorker(compilerOptionsDidYouMeanDiagnostics, commandLine, readFile26);
|
|
152371
152371
|
}
|
|
152372
152372
|
function getOptionFromName(optionName, allowShort) {
|
|
152373
152373
|
return getOptionDeclarationFromName(getOptionsNameMap, optionName, allowShort);
|
|
@@ -152449,8 +152449,8 @@ ${lanes.join("\n")}
|
|
|
152449
152449
|
watchOptionsToExtend
|
|
152450
152450
|
);
|
|
152451
152451
|
}
|
|
152452
|
-
function readConfigFile(fileName,
|
|
152453
|
-
const textOrDiagnostic = tryReadFile(fileName,
|
|
152452
|
+
function readConfigFile(fileName, readFile26) {
|
|
152453
|
+
const textOrDiagnostic = tryReadFile(fileName, readFile26);
|
|
152454
152454
|
return isString3(textOrDiagnostic) ? parseConfigFileTextToJson(fileName, textOrDiagnostic) : { config: {}, error: textOrDiagnostic };
|
|
152455
152455
|
}
|
|
152456
152456
|
function parseConfigFileTextToJson(fileName, jsonText) {
|
|
@@ -152465,14 +152465,14 @@ ${lanes.join("\n")}
|
|
|
152465
152465
|
error: jsonSourceFile.parseDiagnostics.length ? jsonSourceFile.parseDiagnostics[0] : void 0
|
|
152466
152466
|
};
|
|
152467
152467
|
}
|
|
152468
|
-
function readJsonConfigFile(fileName,
|
|
152469
|
-
const textOrDiagnostic = tryReadFile(fileName,
|
|
152468
|
+
function readJsonConfigFile(fileName, readFile26) {
|
|
152469
|
+
const textOrDiagnostic = tryReadFile(fileName, readFile26);
|
|
152470
152470
|
return isString3(textOrDiagnostic) ? parseJsonText(fileName, textOrDiagnostic) : { fileName, parseDiagnostics: [textOrDiagnostic] };
|
|
152471
152471
|
}
|
|
152472
|
-
function tryReadFile(fileName,
|
|
152472
|
+
function tryReadFile(fileName, readFile26) {
|
|
152473
152473
|
let text;
|
|
152474
152474
|
try {
|
|
152475
|
-
text =
|
|
152475
|
+
text = readFile26(fileName);
|
|
152476
152476
|
} catch (e) {
|
|
152477
152477
|
return createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message);
|
|
152478
152478
|
}
|
|
@@ -230569,7 +230569,7 @@ ${lanes.join("\n")}
|
|
|
230569
230569
|
}
|
|
230570
230570
|
}
|
|
230571
230571
|
function createImportCallExpressionAMD(arg, containsLexicalThis) {
|
|
230572
|
-
const
|
|
230572
|
+
const resolve44 = factory2.createUniqueName("resolve");
|
|
230573
230573
|
const reject = factory2.createUniqueName("reject");
|
|
230574
230574
|
const parameters = [
|
|
230575
230575
|
factory2.createParameterDeclaration(
|
|
@@ -230578,7 +230578,7 @@ ${lanes.join("\n")}
|
|
|
230578
230578
|
/*dotDotDotToken*/
|
|
230579
230579
|
void 0,
|
|
230580
230580
|
/*name*/
|
|
230581
|
-
|
|
230581
|
+
resolve44
|
|
230582
230582
|
),
|
|
230583
230583
|
factory2.createParameterDeclaration(
|
|
230584
230584
|
/*modifiers*/
|
|
@@ -230595,7 +230595,7 @@ ${lanes.join("\n")}
|
|
|
230595
230595
|
factory2.createIdentifier("require"),
|
|
230596
230596
|
/*typeArguments*/
|
|
230597
230597
|
void 0,
|
|
230598
|
-
[factory2.createArrayLiteralExpression([arg || factory2.createOmittedExpression()]),
|
|
230598
|
+
[factory2.createArrayLiteralExpression([arg || factory2.createOmittedExpression()]), resolve44, reject]
|
|
230599
230599
|
)
|
|
230600
230600
|
)
|
|
230601
230601
|
]);
|
|
@@ -242130,12 +242130,12 @@ ${lanes.join("\n")}
|
|
|
242130
242130
|
function createCompilerHost(options, setParentNodes) {
|
|
242131
242131
|
return createCompilerHostWorker(options, setParentNodes);
|
|
242132
242132
|
}
|
|
242133
|
-
function createGetSourceFile(
|
|
242133
|
+
function createGetSourceFile(readFile26, setParentNodes) {
|
|
242134
242134
|
return (fileName, languageVersionOrOptions, onError) => {
|
|
242135
242135
|
let text;
|
|
242136
242136
|
try {
|
|
242137
242137
|
mark("beforeIORead");
|
|
242138
|
-
text =
|
|
242138
|
+
text = readFile26(fileName);
|
|
242139
242139
|
mark("afterIORead");
|
|
242140
242140
|
measure("I/O Read", "beforeIORead", "afterIORead");
|
|
242141
242141
|
} catch (e) {
|
|
@@ -243039,7 +243039,7 @@ ${lanes.join("\n")}
|
|
|
243039
243039
|
getRedirectFromOutput,
|
|
243040
243040
|
forEachResolvedProjectReference: forEachResolvedProjectReference2
|
|
243041
243041
|
});
|
|
243042
|
-
const
|
|
243042
|
+
const readFile26 = host.readFile.bind(host);
|
|
243043
243043
|
(_e = tracing) == null ? void 0 : _e.push(tracing.Phase.Program, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram });
|
|
243044
243044
|
const shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options);
|
|
243045
243045
|
(_f = tracing) == null ? void 0 : _f.pop();
|
|
@@ -243265,7 +243265,7 @@ ${lanes.join("\n")}
|
|
|
243265
243265
|
shouldTransformImportCall,
|
|
243266
243266
|
emitBuildInfo,
|
|
243267
243267
|
fileExists,
|
|
243268
|
-
readFile:
|
|
243268
|
+
readFile: readFile26,
|
|
243269
243269
|
directoryExists,
|
|
243270
243270
|
getSymlinkCache,
|
|
243271
243271
|
realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host),
|
|
@@ -243405,9 +243405,9 @@ ${lanes.join("\n")}
|
|
|
243405
243405
|
/*ignoreCase*/
|
|
243406
243406
|
false
|
|
243407
243407
|
)) {
|
|
243408
|
-
const
|
|
243409
|
-
if (
|
|
243410
|
-
const name = removeSuffix(removePrefix(
|
|
243408
|
+
const basename19 = getBaseFileName(a.fileName);
|
|
243409
|
+
if (basename19 === "lib.d.ts" || basename19 === "lib.es6.d.ts") return 0;
|
|
243410
|
+
const name = removeSuffix(removePrefix(basename19, "lib."), ".d.ts");
|
|
243411
243411
|
const index = libs.indexOf(name);
|
|
243412
243412
|
if (index !== -1) return index + 1;
|
|
243413
243413
|
}
|
|
@@ -274408,19 +274408,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
274408
274408
|
}
|
|
274409
274409
|
function convertNamedExport(sourceFile, assignment, changes, exports2) {
|
|
274410
274410
|
const { text } = assignment.left.name;
|
|
274411
|
-
const
|
|
274412
|
-
if (
|
|
274411
|
+
const rename7 = exports2.get(text);
|
|
274412
|
+
if (rename7 !== void 0) {
|
|
274413
274413
|
const newNodes = [
|
|
274414
274414
|
makeConst(
|
|
274415
274415
|
/*modifiers*/
|
|
274416
274416
|
void 0,
|
|
274417
|
-
|
|
274417
|
+
rename7,
|
|
274418
274418
|
assignment.right
|
|
274419
274419
|
),
|
|
274420
274420
|
makeExportDeclaration([factory.createExportSpecifier(
|
|
274421
274421
|
/*isTypeOnly*/
|
|
274422
274422
|
false,
|
|
274423
|
-
|
|
274423
|
+
rename7,
|
|
274424
274424
|
text
|
|
274425
274425
|
)])
|
|
274426
274426
|
];
|
|
@@ -307153,8 +307153,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
307153
307153
|
}
|
|
307154
307154
|
};
|
|
307155
307155
|
for (const file of files) {
|
|
307156
|
-
const
|
|
307157
|
-
if (
|
|
307156
|
+
const basename19 = getBaseFileName(file);
|
|
307157
|
+
if (basename19 === "package.json" || basename19 === "bower.json") {
|
|
307158
307158
|
createProjectWatcher(
|
|
307159
307159
|
file,
|
|
307160
307160
|
"FileWatcher"
|
|
@@ -310826,8 +310826,8 @@ All files are: ${JSON.stringify(names)}`,
|
|
|
310826
310826
|
var _a7;
|
|
310827
310827
|
const fileOrDirectoryPath = removeIgnoredPath(this.toPath(fileOrDirectory));
|
|
310828
310828
|
if (!fileOrDirectoryPath) return;
|
|
310829
|
-
const
|
|
310830
|
-
if (((_a7 = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a7.size) && (
|
|
310829
|
+
const basename19 = getBaseFileName(fileOrDirectoryPath);
|
|
310830
|
+
if (((_a7 = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a7.size) && (basename19 === "package.json" || basename19 === "node_modules")) {
|
|
310831
310831
|
result.affectedModuleSpecifierCacheProjects.forEach((project) => {
|
|
310832
310832
|
var _a23;
|
|
310833
310833
|
(_a23 = project.getModuleSpecifierCache()) == null ? void 0 : _a23.clear();
|
|
@@ -317313,8 +317313,8 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
317313
317313
|
installPackage(options) {
|
|
317314
317314
|
this.packageInstallId++;
|
|
317315
317315
|
const request5 = { kind: "installPackage", ...options, id: this.packageInstallId };
|
|
317316
|
-
const promise = new Promise((
|
|
317317
|
-
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve:
|
|
317316
|
+
const promise = new Promise((resolve44, reject) => {
|
|
317317
|
+
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve: resolve44, reject });
|
|
317318
317318
|
});
|
|
317319
317319
|
this.installer.send(request5);
|
|
317320
317320
|
return promise;
|
|
@@ -428532,7 +428532,7 @@ var init_WhisperProvider = __esm({
|
|
|
428532
428532
|
isConfigured() {
|
|
428533
428533
|
return !!this.apiKey;
|
|
428534
428534
|
}
|
|
428535
|
-
async transcribe(audio, language) {
|
|
428535
|
+
async transcribe(audio, language, options) {
|
|
428536
428536
|
if (!this.apiKey) {
|
|
428537
428537
|
return {
|
|
428538
428538
|
id: "",
|
|
@@ -428540,14 +428540,21 @@ var init_WhisperProvider = __esm({
|
|
|
428540
428540
|
error: "Whisper API key not configured"
|
|
428541
428541
|
};
|
|
428542
428542
|
}
|
|
428543
|
+
const granularity = options?.granularity ?? "segment";
|
|
428543
428544
|
try {
|
|
428544
428545
|
const formData = new FormData();
|
|
428545
428546
|
formData.append("file", audio, "audio.webm");
|
|
428546
428547
|
formData.append("model", "whisper-1");
|
|
428547
428548
|
formData.append("response_format", "verbose_json");
|
|
428548
|
-
|
|
428549
|
-
|
|
428550
|
-
|
|
428549
|
+
if (granularity === "segment" || granularity === "both") {
|
|
428550
|
+
formData.append("timestamp_granularities[]", "segment");
|
|
428551
|
+
}
|
|
428552
|
+
if (granularity === "word" || granularity === "both") {
|
|
428553
|
+
formData.append("timestamp_granularities[]", "word");
|
|
428554
|
+
}
|
|
428555
|
+
const lang = language ?? options?.language;
|
|
428556
|
+
if (lang) {
|
|
428557
|
+
formData.append("language", lang);
|
|
428551
428558
|
}
|
|
428552
428559
|
const response = await fetch(`${this.baseUrl}/audio/transcriptions`, {
|
|
428553
428560
|
method: "POST",
|
|
@@ -428565,20 +428572,30 @@ var init_WhisperProvider = __esm({
|
|
|
428565
428572
|
};
|
|
428566
428573
|
}
|
|
428567
428574
|
const data = await response.json();
|
|
428568
|
-
|
|
428575
|
+
const result = {
|
|
428569
428576
|
id: crypto.randomUUID(),
|
|
428570
428577
|
status: "completed",
|
|
428571
428578
|
fullText: data.text,
|
|
428572
|
-
detectedLanguage: data.language
|
|
428573
|
-
|
|
428579
|
+
detectedLanguage: data.language
|
|
428580
|
+
};
|
|
428581
|
+
if (granularity === "segment" || granularity === "both") {
|
|
428582
|
+
result.segments = data.segments?.map((seg, index) => ({
|
|
428574
428583
|
id: `segment-${index}`,
|
|
428575
428584
|
startTime: seg.start,
|
|
428576
428585
|
endTime: seg.end,
|
|
428577
428586
|
text: seg.text.trim(),
|
|
428578
428587
|
confidence: 1
|
|
428579
|
-
// Whisper doesn't provide
|
|
428580
|
-
}))
|
|
428581
|
-
}
|
|
428588
|
+
// Whisper doesn't provide per-segment confidence
|
|
428589
|
+
}));
|
|
428590
|
+
}
|
|
428591
|
+
if (granularity === "word" || granularity === "both") {
|
|
428592
|
+
result.words = data.words?.map((w) => ({
|
|
428593
|
+
text: w.word,
|
|
428594
|
+
start: w.start,
|
|
428595
|
+
end: w.end
|
|
428596
|
+
}));
|
|
428597
|
+
}
|
|
428598
|
+
return result;
|
|
428582
428599
|
} catch (error) {
|
|
428583
428600
|
return {
|
|
428584
428601
|
id: "",
|
|
@@ -429325,7 +429342,7 @@ var init_GeminiProvider = __esm({
|
|
|
429325
429342
|
* Sleep helper
|
|
429326
429343
|
*/
|
|
429327
429344
|
sleep(ms) {
|
|
429328
|
-
return new Promise((
|
|
429345
|
+
return new Promise((resolve44) => setTimeout(resolve44, ms));
|
|
429329
429346
|
}
|
|
429330
429347
|
/**
|
|
429331
429348
|
* Extend a previously generated Veo video
|
|
@@ -432768,6 +432785,101 @@ var init_elevenlabs = __esm({
|
|
|
432768
432785
|
}
|
|
432769
432786
|
});
|
|
432770
432787
|
|
|
432788
|
+
// ../ai-providers/dist/kokoro/KokoroProvider.js
|
|
432789
|
+
async function loadKokoroFactory() {
|
|
432790
|
+
if (factoryOverride)
|
|
432791
|
+
return factoryOverride;
|
|
432792
|
+
const mod = await import("kokoro-js");
|
|
432793
|
+
return mod.KokoroTTS;
|
|
432794
|
+
}
|
|
432795
|
+
function loadModel(progress) {
|
|
432796
|
+
if (modelPromise)
|
|
432797
|
+
return modelPromise;
|
|
432798
|
+
modelPromise = (async () => {
|
|
432799
|
+
const factory = await loadKokoroFactory();
|
|
432800
|
+
return factory.from_pretrained(KOKORO_MODEL_ID, {
|
|
432801
|
+
dtype: "q8",
|
|
432802
|
+
device: "cpu",
|
|
432803
|
+
progress_callback: progress ? (raw2) => progress(normaliseEvent(raw2)) : void 0
|
|
432804
|
+
});
|
|
432805
|
+
})().catch((err) => {
|
|
432806
|
+
modelPromise = null;
|
|
432807
|
+
throw err;
|
|
432808
|
+
});
|
|
432809
|
+
return modelPromise;
|
|
432810
|
+
}
|
|
432811
|
+
function normaliseEvent(raw2) {
|
|
432812
|
+
const r = raw2 ?? {};
|
|
432813
|
+
return {
|
|
432814
|
+
status: typeof r.status === "string" ? r.status : "unknown",
|
|
432815
|
+
file: typeof r.file === "string" ? r.file : void 0,
|
|
432816
|
+
progress: typeof r.progress === "number" ? r.progress : void 0,
|
|
432817
|
+
loaded: typeof r.loaded === "number" ? r.loaded : void 0,
|
|
432818
|
+
total: typeof r.total === "number" ? r.total : void 0
|
|
432819
|
+
};
|
|
432820
|
+
}
|
|
432821
|
+
var KOKORO_DEFAULT_VOICE, KOKORO_MODEL_ID, modelPromise, factoryOverride, KokoroProvider, kokoroProvider;
|
|
432822
|
+
var init_KokoroProvider = __esm({
|
|
432823
|
+
"../ai-providers/dist/kokoro/KokoroProvider.js"() {
|
|
432824
|
+
"use strict";
|
|
432825
|
+
KOKORO_DEFAULT_VOICE = "af_heart";
|
|
432826
|
+
KOKORO_MODEL_ID = "onnx-community/Kokoro-82M-v1.0-ONNX";
|
|
432827
|
+
modelPromise = null;
|
|
432828
|
+
factoryOverride = null;
|
|
432829
|
+
KokoroProvider = class {
|
|
432830
|
+
constructor() {
|
|
432831
|
+
this.id = "kokoro";
|
|
432832
|
+
this.name = "Kokoro (local)";
|
|
432833
|
+
this.description = "Local text-to-speech via Kokoro-82M (Apache 2.0)";
|
|
432834
|
+
this.capabilities = ["text-to-speech"];
|
|
432835
|
+
this.iconUrl = "/icons/kokoro.svg";
|
|
432836
|
+
this.isAvailable = true;
|
|
432837
|
+
}
|
|
432838
|
+
async initialize(_config) {
|
|
432839
|
+
}
|
|
432840
|
+
isConfigured() {
|
|
432841
|
+
return true;
|
|
432842
|
+
}
|
|
432843
|
+
/**
|
|
432844
|
+
* Synthesise speech from text. Returns a WAV buffer matching
|
|
432845
|
+
* `ElevenLabsProvider.textToSpeech`'s `TTSResult` shape.
|
|
432846
|
+
*/
|
|
432847
|
+
async textToSpeech(text, options = {}) {
|
|
432848
|
+
if (!text || !text.trim()) {
|
|
432849
|
+
return { success: false, error: "Empty text" };
|
|
432850
|
+
}
|
|
432851
|
+
try {
|
|
432852
|
+
const model = await loadModel(options.onProgress);
|
|
432853
|
+
const audio = await model.generate(text, {
|
|
432854
|
+
voice: options.voice ?? KOKORO_DEFAULT_VOICE,
|
|
432855
|
+
speed: options.speed ?? 1
|
|
432856
|
+
});
|
|
432857
|
+
const buffer = Buffer.from(audio.toWav());
|
|
432858
|
+
return {
|
|
432859
|
+
success: true,
|
|
432860
|
+
audioBuffer: buffer,
|
|
432861
|
+
characterCount: text.length
|
|
432862
|
+
};
|
|
432863
|
+
} catch (error) {
|
|
432864
|
+
return {
|
|
432865
|
+
success: false,
|
|
432866
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
432867
|
+
};
|
|
432868
|
+
}
|
|
432869
|
+
}
|
|
432870
|
+
};
|
|
432871
|
+
kokoroProvider = new KokoroProvider();
|
|
432872
|
+
}
|
|
432873
|
+
});
|
|
432874
|
+
|
|
432875
|
+
// ../ai-providers/dist/kokoro/index.js
|
|
432876
|
+
var init_kokoro = __esm({
|
|
432877
|
+
"../ai-providers/dist/kokoro/index.js"() {
|
|
432878
|
+
"use strict";
|
|
432879
|
+
init_KokoroProvider();
|
|
432880
|
+
}
|
|
432881
|
+
});
|
|
432882
|
+
|
|
432771
432883
|
// ../ai-providers/dist/openai-image/OpenAIImageProvider.js
|
|
432772
432884
|
var DEFAULT_MODEL, OpenAIImageProvider, openaiImageProvider;
|
|
432773
432885
|
var init_OpenAIImageProvider = __esm({
|
|
@@ -433317,7 +433429,7 @@ var init_RunwayProvider = __esm({
|
|
|
433317
433429
|
* Sleep helper
|
|
433318
433430
|
*/
|
|
433319
433431
|
sleep(ms) {
|
|
433320
|
-
return new Promise((
|
|
433432
|
+
return new Promise((resolve44) => setTimeout(resolve44, ms));
|
|
433321
433433
|
}
|
|
433322
433434
|
};
|
|
433323
433435
|
RunwayProvider.API_VERSION = "2024-11-06";
|
|
@@ -433749,7 +433861,7 @@ var init_KlingProvider = __esm({
|
|
|
433749
433861
|
* Sleep helper
|
|
433750
433862
|
*/
|
|
433751
433863
|
sleep(ms) {
|
|
433752
|
-
return new Promise((
|
|
433864
|
+
return new Promise((resolve44) => setTimeout(resolve44, ms));
|
|
433753
433865
|
}
|
|
433754
433866
|
};
|
|
433755
433867
|
klingProvider = new KlingProvider();
|
|
@@ -434058,7 +434170,7 @@ var init_GrokProvider = __esm({
|
|
|
434058
434170
|
}
|
|
434059
434171
|
}
|
|
434060
434172
|
sleep(ms) {
|
|
434061
|
-
return new Promise((
|
|
434173
|
+
return new Promise((resolve44) => setTimeout(resolve44, ms));
|
|
434062
434174
|
}
|
|
434063
434175
|
};
|
|
434064
434176
|
grokProvider = new GrokProvider();
|
|
@@ -434331,7 +434443,7 @@ var init_ReplicateProvider = __esm({
|
|
|
434331
434443
|
* Sleep helper
|
|
434332
434444
|
*/
|
|
434333
434445
|
sleep(ms) {
|
|
434334
|
-
return new Promise((
|
|
434446
|
+
return new Promise((resolve44) => setTimeout(resolve44, ms));
|
|
434335
434447
|
}
|
|
434336
434448
|
/**
|
|
434337
434449
|
* Generate music from text prompt using MusicGen
|
|
@@ -434730,7 +434842,10 @@ __export(dist_exports2, {
|
|
|
434730
434842
|
GeminiProvider: () => GeminiProvider,
|
|
434731
434843
|
GrokProvider: () => GrokProvider,
|
|
434732
434844
|
KNOWN_VOICES: () => KNOWN_VOICES,
|
|
434845
|
+
KOKORO_DEFAULT_VOICE: () => KOKORO_DEFAULT_VOICE,
|
|
434846
|
+
KOKORO_MODEL_ID: () => KOKORO_MODEL_ID,
|
|
434733
434847
|
KlingProvider: () => KlingProvider,
|
|
434848
|
+
KokoroProvider: () => KokoroProvider,
|
|
434734
434849
|
OllamaProvider: () => OllamaProvider,
|
|
434735
434850
|
OpenAIImageProvider: () => OpenAIImageProvider,
|
|
434736
434851
|
OpenAIProvider: () => OpenAIProvider,
|
|
@@ -434743,6 +434858,7 @@ __export(dist_exports2, {
|
|
|
434743
434858
|
getBestProviderForCapability: () => getBestProviderForCapability,
|
|
434744
434859
|
grokProvider: () => grokProvider,
|
|
434745
434860
|
klingProvider: () => klingProvider,
|
|
434861
|
+
kokoroProvider: () => kokoroProvider,
|
|
434746
434862
|
ollamaProvider: () => ollamaProvider,
|
|
434747
434863
|
openaiImageProvider: () => openaiImageProvider,
|
|
434748
434864
|
openaiProvider: () => openaiProvider,
|
|
@@ -434763,6 +434879,7 @@ var init_dist2 = __esm({
|
|
|
434763
434879
|
init_claude();
|
|
434764
434880
|
init_ollama();
|
|
434765
434881
|
init_elevenlabs();
|
|
434882
|
+
init_kokoro();
|
|
434766
434883
|
init_openai_image();
|
|
434767
434884
|
init_runway();
|
|
434768
434885
|
init_kling();
|
|
@@ -442566,7 +442683,7 @@ async function prompt(question, hidden = false) {
|
|
|
442566
442683
|
input: process.stdin,
|
|
442567
442684
|
output: process.stdout
|
|
442568
442685
|
});
|
|
442569
|
-
return new Promise((
|
|
442686
|
+
return new Promise((resolve44) => {
|
|
442570
442687
|
if (hidden && process.stdin.isTTY) {
|
|
442571
442688
|
process.stdout.write(question);
|
|
442572
442689
|
let input3 = "";
|
|
@@ -442580,7 +442697,7 @@ async function prompt(question, hidden = false) {
|
|
|
442580
442697
|
process.stdin.removeListener("data", onData);
|
|
442581
442698
|
process.stdout.write("\n");
|
|
442582
442699
|
rl.close();
|
|
442583
|
-
|
|
442700
|
+
resolve44(input3);
|
|
442584
442701
|
} else if (char === "") {
|
|
442585
442702
|
process.exit(1);
|
|
442586
442703
|
} else if (char === "\x7F" || char === "\b") {
|
|
@@ -442595,7 +442712,7 @@ async function prompt(question, hidden = false) {
|
|
|
442595
442712
|
} else {
|
|
442596
442713
|
rl.question(question, (answer) => {
|
|
442597
442714
|
rl.close();
|
|
442598
|
-
|
|
442715
|
+
resolve44(answer);
|
|
442599
442716
|
});
|
|
442600
442717
|
}
|
|
442601
442718
|
});
|
|
@@ -442748,8 +442865,8 @@ async function extendVideoNaturally(videoPath, targetDuration, outputPath) {
|
|
|
442748
442865
|
const videoDuration = await getVideoDuration(videoPath);
|
|
442749
442866
|
const ratio = targetDuration / videoDuration;
|
|
442750
442867
|
if (ratio <= 1) {
|
|
442751
|
-
const { copyFile:
|
|
442752
|
-
await
|
|
442868
|
+
const { copyFile: copyFile5 } = await import("node:fs/promises");
|
|
442869
|
+
await copyFile5(videoPath, outputPath);
|
|
442753
442870
|
return;
|
|
442754
442871
|
}
|
|
442755
442872
|
if (ratio <= 1.15) {
|
|
@@ -442983,8 +443100,8 @@ registerRoot(Root);
|
|
|
442983
443100
|
await mkdir6(REMOTION_CACHE_DIR, { recursive: true });
|
|
442984
443101
|
await writeFile7(join18(REMOTION_CACHE_DIR, "package.json"), packageJsonStr);
|
|
442985
443102
|
if (existsSync18(join18(dir, "node_modules"))) {
|
|
442986
|
-
const { rename:
|
|
442987
|
-
await
|
|
443103
|
+
const { rename: rename7, symlink } = await import("node:fs/promises");
|
|
443104
|
+
await rename7(join18(dir, "node_modules"), cachedModules).catch(() => {
|
|
442988
443105
|
});
|
|
442989
443106
|
await symlink(cachedModules, join18(dir, "node_modules"), "dir").catch(() => {
|
|
442990
443107
|
});
|
|
@@ -446295,6 +446412,16 @@ function slugifySceneName(name) {
|
|
|
446295
446412
|
const slug = normalised.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
446296
446413
|
return slug || "scene";
|
|
446297
446414
|
}
|
|
446415
|
+
function renderTranscriptSpans(transcript) {
|
|
446416
|
+
return transcript.map((w, i) => `<span class="word" data-i="${i}">${esc(w.text)}</span>`).join(" ");
|
|
446417
|
+
}
|
|
446418
|
+
function buildTranscriptTweens(transcript, targetSelector) {
|
|
446419
|
+
return transcript.map((w, i) => {
|
|
446420
|
+
const start = Math.max(0, Number(w.start.toFixed(3)));
|
|
446421
|
+
const sel = `${targetSelector}[data-i="${i}"]`;
|
|
446422
|
+
return `tl.fromTo('${sel}', { opacity: 0, y: 10 }, { opacity: 1, y: 0, duration: 0.18, ease: 'power2.out' }, ${start});`;
|
|
446423
|
+
}).join("\n ");
|
|
446424
|
+
}
|
|
446298
446425
|
function buildPreset(input3) {
|
|
446299
446426
|
const id = input3.id;
|
|
446300
446427
|
const scope = `[data-composition-id="${id}"]`;
|
|
@@ -446325,7 +446452,15 @@ function buildPreset(input3) {
|
|
|
446325
446452
|
const backdropMarkup = `<div class="backdrop"></div>`;
|
|
446326
446453
|
switch (input3.preset) {
|
|
446327
446454
|
case "simple": {
|
|
446328
|
-
const
|
|
446455
|
+
const transcript = input3.transcript;
|
|
446456
|
+
const useWordSync = !!(transcript && transcript.length > 0);
|
|
446457
|
+
const captionText = subhead || headline;
|
|
446458
|
+
const captionInner = useWordSync ? renderTranscriptSpans(transcript) : esc(captionText);
|
|
446459
|
+
const wordCss = useWordSync ? `
|
|
446460
|
+
${scope} .caption .word { display: inline-block; opacity: 0; }` : "";
|
|
446461
|
+
const timeline = useWordSync ? `${buildTranscriptTweens(transcript, `${scope} .caption .word`)}
|
|
446462
|
+
tl.to('${scope} .caption', { opacity: 0, duration: 0.4, ease: 'power2.in' }, ${(dur - 0.4).toFixed(2)});` : `tl.from('${scope} .caption', { opacity: 0, y: 28, duration: 0.6, ease: 'power2.out' }, 0.1);
|
|
446463
|
+
tl.to('${scope} .caption', { opacity: 0, duration: 0.4, ease: 'power2.in' }, ${(dur - 0.4).toFixed(2)});`;
|
|
446329
446464
|
return {
|
|
446330
446465
|
css: `${scope} {
|
|
446331
446466
|
position: absolute; inset: 0; width: 100%; height: 100%;
|
|
@@ -446341,11 +446476,10 @@ function buildPreset(input3) {
|
|
|
446341
446476
|
font-weight: 700;
|
|
446342
446477
|
line-height: 1.2;
|
|
446343
446478
|
text-shadow: 0 4px 20px rgba(0,0,0,0.65);
|
|
446344
|
-
}`,
|
|
446479
|
+
}${wordCss}`,
|
|
446345
446480
|
body: `${backdropMarkup}
|
|
446346
|
-
<div class="caption" id="caption">${
|
|
446347
|
-
timeline
|
|
446348
|
-
tl.to('${scope} .caption', { opacity: 0, duration: 0.4, ease: 'power2.in' }, ${(dur - 0.4).toFixed(2)});`
|
|
446481
|
+
<div class="caption" id="caption">${captionInner}</div>`,
|
|
446482
|
+
timeline
|
|
446349
446483
|
};
|
|
446350
446484
|
}
|
|
446351
446485
|
case "announcement": {
|
|
@@ -446381,6 +446515,12 @@ function buildPreset(input3) {
|
|
|
446381
446515
|
case "explainer": {
|
|
446382
446516
|
const k = kicker || humanise(id).toUpperCase();
|
|
446383
446517
|
const sub = subhead || "";
|
|
446518
|
+
const transcript = input3.transcript;
|
|
446519
|
+
const useWordSync = !!(transcript && transcript.length > 0 && sub);
|
|
446520
|
+
const subtitleInner = useWordSync ? renderTranscriptSpans(transcript) : esc(sub);
|
|
446521
|
+
const wordCss = useWordSync ? `
|
|
446522
|
+
${scope} #subtitle .word { display: inline-block; opacity: 0; }` : "";
|
|
446523
|
+
const subtitleTween = useWordSync ? buildTranscriptTweens(transcript, `${scope} #subtitle .word`) : sub ? `tl.from('${scope} #subtitle', { opacity: 0, y: 30, duration: 0.55, ease: 'power3.out' }, 0.55);` : "";
|
|
446384
446524
|
return {
|
|
446385
446525
|
css: `${scope} {
|
|
446386
446526
|
position: absolute; inset: 0; width: 100%; height: 100%;
|
|
@@ -446403,23 +446543,28 @@ function buildPreset(input3) {
|
|
|
446403
446543
|
}
|
|
446404
446544
|
${scope} .subtitle {
|
|
446405
446545
|
font-size: 38px; font-weight: 300; color: #c0c0d0; max-width: 80%;
|
|
446406
|
-
}`,
|
|
446546
|
+
}${wordCss}`,
|
|
446407
446547
|
body: `${backdropMarkup}
|
|
446408
446548
|
<div class="stage">
|
|
446409
446549
|
<div class="kicker" id="kicker">${esc(k)}</div>
|
|
446410
446550
|
<h1 class="title" id="title">${esc(headline)}</h1>${sub ? `
|
|
446411
|
-
<div class="subtitle" id="subtitle">${
|
|
446551
|
+
<div class="subtitle" id="subtitle">${subtitleInner}</div>` : ""}
|
|
446412
446552
|
</div>`,
|
|
446413
446553
|
timeline: `tl.from('${scope} #kicker', { opacity: 0, y: 16, duration: 0.4, ease: 'power2.out' }, 0.1);
|
|
446414
446554
|
tl.from('${scope} #title', { opacity: 0, y: 60, duration: 0.7, ease: 'power3.out' }, 0.25);
|
|
446415
|
-
${
|
|
446555
|
+
${subtitleTween}`
|
|
446416
446556
|
};
|
|
446417
446557
|
}
|
|
446418
446558
|
case "kinetic-type": {
|
|
446419
|
-
const
|
|
446420
|
-
const
|
|
446559
|
+
const transcript = input3.transcript;
|
|
446560
|
+
const useWordSync = !!(transcript && transcript.length > 0);
|
|
446561
|
+
const words = useWordSync ? transcript.map((w) => w.text) : headline.split(/\s+/).filter(Boolean);
|
|
446562
|
+
const wordSpans = words.map((w, i) => `<span class="word" data-i="${i}" id="w-${i}">${esc(w)}</span>`).join(" ");
|
|
446421
446563
|
const stagger = Math.max(0.08, Math.min(0.3, (dur - 0.6) / Math.max(words.length, 1)));
|
|
446422
|
-
const tweens =
|
|
446564
|
+
const tweens = useWordSync ? transcript.map((w, i) => {
|
|
446565
|
+
const start = Math.max(0, Number(w.start.toFixed(3)));
|
|
446566
|
+
return `tl.from('${scope} #w-${i}', { opacity: 0, y: 80, scale: 0.8, duration: 0.35, ease: 'back.out(1.8)' }, ${start});`;
|
|
446567
|
+
}).join("\n ") : words.map((_, i) => {
|
|
446423
446568
|
const start = (0.05 + i * stagger).toFixed(2);
|
|
446424
446569
|
return `tl.from('${scope} #w-${i}', { opacity: 0, y: 80, scale: 0.8, duration: 0.45, ease: 'back.out(1.8)' }, ${start});`;
|
|
446425
446570
|
}).join("\n ");
|
|
@@ -446873,7 +447018,7 @@ import { readFile as readFile12, writeFile as writeFile13, mkdir as mkdir11, unl
|
|
|
446873
447018
|
import { resolve as resolve24, basename as basename9, dirname as dirname15, extname as extname7 } from "node:path";
|
|
446874
447019
|
import { existsSync as existsSync26 } from "node:fs";
|
|
446875
447020
|
function sleep(ms) {
|
|
446876
|
-
return new Promise((
|
|
447021
|
+
return new Promise((resolve44) => setTimeout(resolve44, ms));
|
|
446877
447022
|
}
|
|
446878
447023
|
async function uploadToImgbb(imageBuffer, apiKey) {
|
|
446879
447024
|
try {
|
|
@@ -450162,10 +450307,10 @@ async function prompt2(question) {
|
|
|
450162
450307
|
input: input3,
|
|
450163
450308
|
output: process.stdout
|
|
450164
450309
|
});
|
|
450165
|
-
return new Promise((
|
|
450310
|
+
return new Promise((resolve44) => {
|
|
450166
450311
|
rl.question(question, (answer) => {
|
|
450167
450312
|
rl.close();
|
|
450168
|
-
|
|
450313
|
+
resolve44(answer);
|
|
450169
450314
|
});
|
|
450170
450315
|
});
|
|
450171
450316
|
}
|
|
@@ -450197,12 +450342,12 @@ function resolveProvider(category) {
|
|
|
450197
450342
|
if (!candidates) return null;
|
|
450198
450343
|
if (configDefaults?.[category]) {
|
|
450199
450344
|
const preferred = candidates.find((c) => c.name === configDefaults[category]);
|
|
450200
|
-
if (preferred && hasApiKey(preferred.envVar)) {
|
|
450345
|
+
if (preferred && (preferred.envVar === null || hasApiKey(preferred.envVar))) {
|
|
450201
450346
|
return { name: preferred.name, label: preferred.label };
|
|
450202
450347
|
}
|
|
450203
450348
|
}
|
|
450204
450349
|
for (const candidate of candidates) {
|
|
450205
|
-
if (hasApiKey(candidate.envVar)) {
|
|
450350
|
+
if (candidate.envVar === null || hasApiKey(candidate.envVar)) {
|
|
450206
450351
|
return { name: candidate.name, label: candidate.label };
|
|
450207
450352
|
}
|
|
450208
450353
|
}
|
|
@@ -450225,7 +450370,8 @@ var init_provider_resolver = __esm({
|
|
|
450225
450370
|
{ name: "runway", envVar: "RUNWAY_API_SECRET", label: "Runway" }
|
|
450226
450371
|
];
|
|
450227
450372
|
SPEECH_PROVIDERS = [
|
|
450228
|
-
{ name: "elevenlabs", envVar: "ELEVENLABS_API_KEY", label: "ElevenLabs" }
|
|
450373
|
+
{ name: "elevenlabs", envVar: "ELEVENLABS_API_KEY", label: "ElevenLabs" },
|
|
450374
|
+
{ name: "kokoro", envVar: null, label: "Kokoro (local)" }
|
|
450229
450375
|
];
|
|
450230
450376
|
PROVIDER_MAP = {
|
|
450231
450377
|
image: IMAGE_PROVIDERS,
|
|
@@ -451447,8 +451593,8 @@ Examples:
|
|
|
451447
451593
|
"-vn",
|
|
451448
451594
|
tempPath
|
|
451449
451595
|
]);
|
|
451450
|
-
const { rename:
|
|
451451
|
-
await
|
|
451596
|
+
const { rename: rename7 } = await import("node:fs/promises");
|
|
451597
|
+
await rename7(tempPath, outputPath);
|
|
451452
451598
|
fitSpinner.succeed(source_default.green(`Adjusted to fit ${options.fitDuration}s (${tempo.toFixed(3)}x speed)`));
|
|
451453
451599
|
} catch (err) {
|
|
451454
451600
|
fitSpinner.fail(source_default.yellow("Tempo adjustment failed \u2014 keeping original audio"));
|
|
@@ -453190,8 +453336,8 @@ async function executeSpeedRamp(options) {
|
|
|
453190
453336
|
const audioBuffer = await readFile18(tempAudio);
|
|
453191
453337
|
const transcript = await whisper.transcribe(new Blob([audioBuffer]), language);
|
|
453192
453338
|
try {
|
|
453193
|
-
const { unlink:
|
|
453194
|
-
await
|
|
453339
|
+
const { unlink: unlink6 } = await import("node:fs/promises");
|
|
453340
|
+
await unlink6(tempAudio);
|
|
453195
453341
|
} catch {
|
|
453196
453342
|
}
|
|
453197
453343
|
if (!transcript.segments || transcript.segments.length === 0) {
|
|
@@ -453575,8 +453721,8 @@ Run 'vibe schema edit.<command>' for structured parameter info.
|
|
|
453575
453721
|
maxSpeed: parseFloat(options.maxSpeed)
|
|
453576
453722
|
});
|
|
453577
453723
|
try {
|
|
453578
|
-
const { unlink:
|
|
453579
|
-
await
|
|
453724
|
+
const { unlink: unlink6 } = await import("node:fs/promises");
|
|
453725
|
+
await unlink6(tempAudio);
|
|
453580
453726
|
} catch {
|
|
453581
453727
|
}
|
|
453582
453728
|
spinner2.succeed(source_default.green(`Found ${speedResult.keyframes.length} speed keyframes`));
|
|
@@ -454647,8 +454793,8 @@ ${segmentTexts}`,
|
|
|
454647
454793
|
console.log();
|
|
454648
454794
|
if (isVideo && audioPath !== absPath) {
|
|
454649
454795
|
try {
|
|
454650
|
-
const { unlink:
|
|
454651
|
-
await
|
|
454796
|
+
const { unlink: unlink6 } = await import("node:fs/promises");
|
|
454797
|
+
await unlink6(audioPath);
|
|
454652
454798
|
} catch {
|
|
454653
454799
|
}
|
|
454654
454800
|
}
|
|
@@ -454886,8 +455032,8 @@ ${segmentTexts}`,
|
|
|
454886
455032
|
await writeFile20(finalOutputPath, combinedBuffer);
|
|
454887
455033
|
if (isVideo && audioPath !== absPath) {
|
|
454888
455034
|
try {
|
|
454889
|
-
const { unlink:
|
|
454890
|
-
await
|
|
455035
|
+
const { unlink: unlink6 } = await import("node:fs/promises");
|
|
455036
|
+
await unlink6(audioPath);
|
|
454891
455037
|
} catch {
|
|
454892
455038
|
}
|
|
454893
455039
|
}
|
|
@@ -456396,7 +456542,7 @@ function buildFFmpegArgs(clips, sources, presetSettings, outputPath, options, so
|
|
|
456396
456542
|
return args;
|
|
456397
456543
|
}
|
|
456398
456544
|
function runFFmpegProcess(ffmpegPath, args, onProgress) {
|
|
456399
|
-
return new Promise((
|
|
456545
|
+
return new Promise((resolve44, reject) => {
|
|
456400
456546
|
const ffmpeg = spawn9(ffmpegPath, args, {
|
|
456401
456547
|
stdio: ["pipe", "pipe", "pipe"]
|
|
456402
456548
|
});
|
|
@@ -456420,7 +456566,7 @@ function runFFmpegProcess(ffmpegPath, args, onProgress) {
|
|
|
456420
456566
|
});
|
|
456421
456567
|
ffmpeg.on("close", (code) => {
|
|
456422
456568
|
if (code === 0) {
|
|
456423
|
-
|
|
456569
|
+
resolve44();
|
|
456424
456570
|
} else {
|
|
456425
456571
|
const errorMatch = stderr.match(/Error.*$/m);
|
|
456426
456572
|
const errorMsg = errorMatch ? errorMatch[0] : `FFmpeg exited with code ${code}`;
|
|
@@ -456556,17 +456702,17 @@ function getPresetSettings(preset, aspectRatio) {
|
|
|
456556
456702
|
}
|
|
456557
456703
|
async function runHyperframesExport(projectPath, options, spinner2) {
|
|
456558
456704
|
spinner2.text = "Loading project...";
|
|
456559
|
-
const { readFile:
|
|
456560
|
-
const { resolve:
|
|
456705
|
+
const { readFile: readFile26 } = await import("node:fs/promises");
|
|
456706
|
+
const { resolve: resolve44, basename: basename19 } = await import("node:path");
|
|
456561
456707
|
const { Project: Project2 } = await Promise.resolve().then(() => (init_engine(), engine_exports));
|
|
456562
456708
|
const { createHyperframesBackend: createHyperframesBackend2 } = await Promise.resolve().then(() => (init_hyperframes(), hyperframes_exports));
|
|
456563
456709
|
const { exitWithError: exitWithError2, generalError: generalError2, outputResult: outputResult2 } = await Promise.resolve().then(() => (init_output(), output_exports));
|
|
456564
456710
|
const chalk2 = (await Promise.resolve().then(() => (init_source(), source_exports))).default;
|
|
456565
|
-
const filePath =
|
|
456566
|
-
const content = await
|
|
456711
|
+
const filePath = resolve44(process.cwd(), projectPath);
|
|
456712
|
+
const content = await readFile26(filePath, "utf-8");
|
|
456567
456713
|
const project = Project2.fromJSON(JSON.parse(content));
|
|
456568
456714
|
const state = project.getState();
|
|
456569
|
-
const outputPath = options.output ?
|
|
456715
|
+
const outputPath = options.output ? resolve44(process.cwd(), options.output) : resolve44(process.cwd(), `${basename19(projectPath, ".vibe.json")}.${options.format ?? "mp4"}`);
|
|
456570
456716
|
const quality = ["draft", "standard", "high"].includes(options.preset ?? "") ? options.preset : "standard";
|
|
456571
456717
|
const backend = createHyperframesBackend2();
|
|
456572
456718
|
spinner2.text = "Rendering with Hyperframes...";
|
|
@@ -458175,8 +458321,8 @@ async function handleAiPipelineToolCall(name, args) {
|
|
|
458175
458321
|
} finally {
|
|
458176
458322
|
if (tempPath) {
|
|
458177
458323
|
try {
|
|
458178
|
-
const { unlink:
|
|
458179
|
-
await
|
|
458324
|
+
const { unlink: unlink6 } = await import("node:fs/promises");
|
|
458325
|
+
await unlink6(tempPath);
|
|
458180
458326
|
} catch {
|
|
458181
458327
|
}
|
|
458182
458328
|
}
|
|
@@ -459363,16 +459509,223 @@ async function handleAiEditAdvancedToolCall(name, args) {
|
|
|
459363
459509
|
// src/tools/scene.ts
|
|
459364
459510
|
init_scene_project();
|
|
459365
459511
|
init_scene_lint();
|
|
459366
|
-
import { resolve as
|
|
459512
|
+
import { resolve as resolve41 } from "node:path";
|
|
459367
459513
|
|
|
459368
459514
|
// ../cli/src/commands/_shared/scene-render.ts
|
|
459369
459515
|
var import_yaml5 = __toESM(require_dist14(), 1);
|
|
459370
459516
|
init_dist();
|
|
459371
459517
|
init_chrome();
|
|
459372
459518
|
init_scene_lint();
|
|
459373
|
-
import { mkdir as mkdir18, stat as stat3 } from "node:fs/promises";
|
|
459519
|
+
import { mkdir as mkdir18, readFile as readFile23, stat as stat3 } from "node:fs/promises";
|
|
459374
459520
|
import { existsSync as existsSync36 } from "node:fs";
|
|
459375
|
-
import { resolve as
|
|
459521
|
+
import { resolve as resolve39, relative as relative6, dirname as dirname24, basename as basename17 } from "node:path";
|
|
459522
|
+
|
|
459523
|
+
// ../cli/src/commands/_shared/scene-audio-scan.ts
|
|
459524
|
+
import { readFile as readFile22 } from "node:fs/promises";
|
|
459525
|
+
import { resolve as resolve37 } from "node:path";
|
|
459526
|
+
function parseRootClips(rootHtml) {
|
|
459527
|
+
const clips = [];
|
|
459528
|
+
const clipRegex = /<div\b[^>]*class="clip"[^>]*>/gi;
|
|
459529
|
+
let match2;
|
|
459530
|
+
while ((match2 = clipRegex.exec(rootHtml)) !== null) {
|
|
459531
|
+
const tag = match2[0];
|
|
459532
|
+
const compositionId = pickAttr(tag, "data-composition-id");
|
|
459533
|
+
const compositionSrc = pickAttr(tag, "data-composition-src");
|
|
459534
|
+
const start = pickNumberAttr(tag, "data-start");
|
|
459535
|
+
const duration = pickNumberAttr(tag, "data-duration");
|
|
459536
|
+
const trackIndex = pickNumberAttr(tag, "data-track-index") ?? 1;
|
|
459537
|
+
if (!compositionId || !compositionSrc || start === null || duration === null) {
|
|
459538
|
+
continue;
|
|
459539
|
+
}
|
|
459540
|
+
clips.push({ compositionId, compositionSrc, start, duration, trackIndex });
|
|
459541
|
+
}
|
|
459542
|
+
return clips;
|
|
459543
|
+
}
|
|
459544
|
+
function parseSceneAudios(compositionHtml) {
|
|
459545
|
+
const out = [];
|
|
459546
|
+
const audioRegex = /<audio\b([^>]*)>/gi;
|
|
459547
|
+
let match2;
|
|
459548
|
+
while ((match2 = audioRegex.exec(compositionHtml)) !== null) {
|
|
459549
|
+
const attrs = match2[1];
|
|
459550
|
+
const src = pickAttr(attrs, "src");
|
|
459551
|
+
if (!src) continue;
|
|
459552
|
+
const localStart = pickNumberAttr(attrs, "data-start") ?? 0;
|
|
459553
|
+
const durationRaw = pickAttr(attrs, "data-duration");
|
|
459554
|
+
const durationHint = !durationRaw || durationRaw === "auto" ? "auto" : Number(durationRaw);
|
|
459555
|
+
const volume = pickNumberAttr(attrs, "data-volume") ?? 1;
|
|
459556
|
+
const trackIndex = pickNumberAttr(attrs, "data-track-index") ?? 2;
|
|
459557
|
+
out.push({ srcRel: src, localStart, durationHint, volume, trackIndex });
|
|
459558
|
+
}
|
|
459559
|
+
return out;
|
|
459560
|
+
}
|
|
459561
|
+
function makeFsCompositionReader(projectDir) {
|
|
459562
|
+
return async (compositionSrcRel) => {
|
|
459563
|
+
const abs = resolve37(projectDir, compositionSrcRel);
|
|
459564
|
+
try {
|
|
459565
|
+
return await readFile22(abs, "utf-8");
|
|
459566
|
+
} catch {
|
|
459567
|
+
return null;
|
|
459568
|
+
}
|
|
459569
|
+
};
|
|
459570
|
+
}
|
|
459571
|
+
async function scanSceneAudio(opts) {
|
|
459572
|
+
const reader = opts.readComposition ?? makeFsCompositionReader(opts.projectDir);
|
|
459573
|
+
const clips = parseRootClips(opts.rootHtml);
|
|
459574
|
+
const out = [];
|
|
459575
|
+
for (const clip of clips) {
|
|
459576
|
+
const html = await reader(clip.compositionSrc);
|
|
459577
|
+
if (!html) continue;
|
|
459578
|
+
const audios = parseSceneAudios(html);
|
|
459579
|
+
for (const audio of audios) {
|
|
459580
|
+
out.push({
|
|
459581
|
+
srcRel: audio.srcRel,
|
|
459582
|
+
srcAbs: resolve37(opts.projectDir, audio.srcRel),
|
|
459583
|
+
absoluteStart: clip.start + audio.localStart,
|
|
459584
|
+
durationHint: audio.durationHint,
|
|
459585
|
+
clipDurationCap: clip.duration - audio.localStart,
|
|
459586
|
+
volume: audio.volume,
|
|
459587
|
+
trackIndex: audio.trackIndex,
|
|
459588
|
+
compositionSrc: clip.compositionSrc
|
|
459589
|
+
});
|
|
459590
|
+
}
|
|
459591
|
+
}
|
|
459592
|
+
out.sort((a, b) => a.absoluteStart - b.absoluteStart);
|
|
459593
|
+
return out;
|
|
459594
|
+
}
|
|
459595
|
+
function pickAttr(tag, name) {
|
|
459596
|
+
const re = new RegExp(`\\b${escapeRegex3(name)}\\s*=\\s*("([^"]*)"|'([^']*)')`);
|
|
459597
|
+
const m = tag.match(re);
|
|
459598
|
+
if (!m) return null;
|
|
459599
|
+
return m[2] ?? m[3] ?? null;
|
|
459600
|
+
}
|
|
459601
|
+
function pickNumberAttr(tag, name) {
|
|
459602
|
+
const raw2 = pickAttr(tag, name);
|
|
459603
|
+
if (raw2 === null) return null;
|
|
459604
|
+
const n = Number(raw2);
|
|
459605
|
+
return Number.isFinite(n) ? n : null;
|
|
459606
|
+
}
|
|
459607
|
+
function escapeRegex3(s) {
|
|
459608
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
459609
|
+
}
|
|
459610
|
+
|
|
459611
|
+
// ../cli/src/commands/_shared/scene-audio-mux.ts
|
|
459612
|
+
init_exec_safe();
|
|
459613
|
+
import { rename as rename6, unlink as unlink5 } from "node:fs/promises";
|
|
459614
|
+
import { resolve as resolve38, dirname as dirname23, extname as extname12, basename as basename16 } from "node:path";
|
|
459615
|
+
function buildAudioMuxFilter(audios) {
|
|
459616
|
+
if (audios.length === 0) return null;
|
|
459617
|
+
const labels = [];
|
|
459618
|
+
const stages = [];
|
|
459619
|
+
audios.forEach((a, i) => {
|
|
459620
|
+
const inputIdx = i + 1;
|
|
459621
|
+
const delayMs = Math.max(0, Math.round(a.absoluteStart * 1e3));
|
|
459622
|
+
const volume = Number.isFinite(a.volume) ? a.volume : 1;
|
|
459623
|
+
const trimSec = Math.max(0, a.clipDurationCap);
|
|
459624
|
+
const label = `a${i}`;
|
|
459625
|
+
const stage = [
|
|
459626
|
+
`[${inputIdx}:a]`,
|
|
459627
|
+
`atrim=duration=${trimSec.toFixed(3)},`,
|
|
459628
|
+
`asetpts=PTS-STARTPTS,`,
|
|
459629
|
+
`adelay=${delayMs}:all=1,`,
|
|
459630
|
+
`volume=${volume}`,
|
|
459631
|
+
`[${label}]`
|
|
459632
|
+
].join("");
|
|
459633
|
+
stages.push(stage);
|
|
459634
|
+
labels.push(`[${label}]`);
|
|
459635
|
+
});
|
|
459636
|
+
if (audios.length === 1) {
|
|
459637
|
+
return {
|
|
459638
|
+
filterComplex: stages.join(";"),
|
|
459639
|
+
outLabel: labels[0],
|
|
459640
|
+
inputCount: 1
|
|
459641
|
+
};
|
|
459642
|
+
}
|
|
459643
|
+
const mix = `${labels.join("")}amix=inputs=${audios.length}:dropout_transition=0:normalize=0[mixed]`;
|
|
459644
|
+
return {
|
|
459645
|
+
filterComplex: `${stages.join(";")};${mix}`,
|
|
459646
|
+
outLabel: "[mixed]",
|
|
459647
|
+
inputCount: audios.length
|
|
459648
|
+
};
|
|
459649
|
+
}
|
|
459650
|
+
function audioCodecForFormat(format4) {
|
|
459651
|
+
if (format4 === "webm") return "libopus";
|
|
459652
|
+
if (format4 === "mov") return "pcm_s16le";
|
|
459653
|
+
return "aac";
|
|
459654
|
+
}
|
|
459655
|
+
async function muxAudioIntoVideo(opts) {
|
|
459656
|
+
if (opts.audios.length === 0) {
|
|
459657
|
+
return { success: true, outputPath: opts.videoPath, audioCount: 0 };
|
|
459658
|
+
}
|
|
459659
|
+
if (!commandExists("ffmpeg")) {
|
|
459660
|
+
return {
|
|
459661
|
+
success: false,
|
|
459662
|
+
outputPath: opts.videoPath,
|
|
459663
|
+
audioCount: opts.audios.length,
|
|
459664
|
+
error: "ffmpeg not found in PATH \u2014 install via `brew install ffmpeg` (mac) or your package manager"
|
|
459665
|
+
};
|
|
459666
|
+
}
|
|
459667
|
+
const filter4 = buildAudioMuxFilter(opts.audios);
|
|
459668
|
+
if (!filter4) {
|
|
459669
|
+
return { success: true, outputPath: opts.videoPath, audioCount: 0 };
|
|
459670
|
+
}
|
|
459671
|
+
const ext = extname12(opts.videoPath) || `.${opts.format}`;
|
|
459672
|
+
const tmpPath = resolve38(
|
|
459673
|
+
dirname23(opts.videoPath),
|
|
459674
|
+
`.${basename16(opts.videoPath, ext)}.muxing${ext}`
|
|
459675
|
+
);
|
|
459676
|
+
const args = ["-y", "-loglevel", "error", "-i", opts.videoPath];
|
|
459677
|
+
for (const a of opts.audios) {
|
|
459678
|
+
args.push("-i", a.srcAbs);
|
|
459679
|
+
}
|
|
459680
|
+
args.push(
|
|
459681
|
+
"-filter_complex",
|
|
459682
|
+
filter4.filterComplex,
|
|
459683
|
+
"-map",
|
|
459684
|
+
"0:v",
|
|
459685
|
+
"-map",
|
|
459686
|
+
filter4.outLabel,
|
|
459687
|
+
"-c:v",
|
|
459688
|
+
"copy",
|
|
459689
|
+
"-c:a",
|
|
459690
|
+
audioCodecForFormat(opts.format),
|
|
459691
|
+
// Cap on the video duration so audio that overruns the producer's render
|
|
459692
|
+
// (e.g. a long Kokoro wav on a short scene) doesn't extend the output.
|
|
459693
|
+
// Video drives the timeline because the producer already counted frames.
|
|
459694
|
+
"-t",
|
|
459695
|
+
opts.totalDuration && opts.totalDuration > 0 ? opts.totalDuration.toFixed(3) : opts.videoDuration?.toFixed(3) ?? ""
|
|
459696
|
+
);
|
|
459697
|
+
if (args[args.length - 1] === "") {
|
|
459698
|
+
args.pop();
|
|
459699
|
+
args.pop();
|
|
459700
|
+
}
|
|
459701
|
+
args.push("-movflags", "+faststart", tmpPath);
|
|
459702
|
+
try {
|
|
459703
|
+
const { stderr } = await execSafe("ffmpeg", args);
|
|
459704
|
+
if (stderr && opts.onProgress) {
|
|
459705
|
+
stderr.split(/\r?\n/).forEach((line) => opts.onProgress?.(line));
|
|
459706
|
+
}
|
|
459707
|
+
} catch (err) {
|
|
459708
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
459709
|
+
try {
|
|
459710
|
+
await unlink5(tmpPath);
|
|
459711
|
+
} catch {
|
|
459712
|
+
}
|
|
459713
|
+
return {
|
|
459714
|
+
success: false,
|
|
459715
|
+
outputPath: opts.videoPath,
|
|
459716
|
+
audioCount: opts.audios.length,
|
|
459717
|
+
error: `ffmpeg mux failed: ${msg}`
|
|
459718
|
+
};
|
|
459719
|
+
}
|
|
459720
|
+
await rename6(tmpPath, opts.videoPath);
|
|
459721
|
+
return {
|
|
459722
|
+
success: true,
|
|
459723
|
+
outputPath: opts.videoPath,
|
|
459724
|
+
audioCount: opts.audios.length
|
|
459725
|
+
};
|
|
459726
|
+
}
|
|
459727
|
+
|
|
459728
|
+
// ../cli/src/commands/_shared/scene-render.ts
|
|
459376
459729
|
function qualityToCrf2(quality = "standard") {
|
|
459377
459730
|
return quality === "draft" ? 28 : quality === "high" ? 18 : 23;
|
|
459378
459731
|
}
|
|
@@ -459380,11 +459733,11 @@ function defaultOutputPath(opts) {
|
|
|
459380
459733
|
const fmt = opts.format ?? "mp4";
|
|
459381
459734
|
const now = opts.now ?? /* @__PURE__ */ new Date();
|
|
459382
459735
|
const stamp = now.toISOString().replace(/[:T]/g, "-").replace(/\..+$/, "");
|
|
459383
|
-
const name = (opts.projectName ??
|
|
459384
|
-
return
|
|
459736
|
+
const name = (opts.projectName ?? basename17(resolve39(opts.projectDir))) || "scene";
|
|
459737
|
+
return resolve39(opts.projectDir, "renders", `${name}-${stamp}.${fmt}`);
|
|
459385
459738
|
}
|
|
459386
459739
|
async function readProjectName(projectDir) {
|
|
459387
|
-
const cfgPath =
|
|
459740
|
+
const cfgPath = resolve39(projectDir, "vibe.project.yaml");
|
|
459388
459741
|
if (!existsSync36(cfgPath)) return void 0;
|
|
459389
459742
|
try {
|
|
459390
459743
|
const raw2 = await (await import("node:fs/promises")).readFile(cfgPath, "utf-8");
|
|
@@ -459406,7 +459759,7 @@ function buildRenderConfig(opts) {
|
|
|
459406
459759
|
};
|
|
459407
459760
|
}
|
|
459408
459761
|
async function executeSceneRender(opts = {}) {
|
|
459409
|
-
const projectDir =
|
|
459762
|
+
const projectDir = resolve39(opts.projectDir ?? ".");
|
|
459410
459763
|
const root2 = opts.root ?? "index.html";
|
|
459411
459764
|
const projectStat = await safeStat(projectDir);
|
|
459412
459765
|
if (!projectStat || !projectStat.isDirectory()) {
|
|
@@ -459415,7 +459768,7 @@ async function executeSceneRender(opts = {}) {
|
|
|
459415
459768
|
if (!await rootExists(projectDir, root2)) {
|
|
459416
459769
|
return {
|
|
459417
459770
|
success: false,
|
|
459418
|
-
error: `Root composition not found: ${
|
|
459771
|
+
error: `Root composition not found: ${resolve39(projectDir, root2)}. Run \`vibe scene init\` first.`
|
|
459419
459772
|
};
|
|
459420
459773
|
}
|
|
459421
459774
|
const chrome2 = await preflightChrome();
|
|
@@ -459423,8 +459776,8 @@ async function executeSceneRender(opts = {}) {
|
|
|
459423
459776
|
return { success: false, error: chrome2.reason };
|
|
459424
459777
|
}
|
|
459425
459778
|
const projectName = await readProjectName(projectDir);
|
|
459426
|
-
const outputPath = opts.output ?
|
|
459427
|
-
await mkdir18(
|
|
459779
|
+
const outputPath = opts.output ? resolve39(projectDir, opts.output) : defaultOutputPath({ projectDir, projectName, format: opts.format });
|
|
459780
|
+
await mkdir18(dirname24(outputPath), { recursive: true });
|
|
459428
459781
|
const config4 = buildRenderConfig({
|
|
459429
459782
|
fps: opts.fps,
|
|
459430
459783
|
quality: opts.quality,
|
|
@@ -459448,6 +459801,34 @@ async function executeSceneRender(opts = {}) {
|
|
|
459448
459801
|
error: err instanceof Error ? err.message : String(err)
|
|
459449
459802
|
};
|
|
459450
459803
|
}
|
|
459804
|
+
let audioCount = 0;
|
|
459805
|
+
let audioMuxApplied = false;
|
|
459806
|
+
let audioMuxWarning;
|
|
459807
|
+
try {
|
|
459808
|
+
opts.onProgress?.(0.95, "Mixing audio");
|
|
459809
|
+
const rootHtml = await readFile23(resolve39(projectDir, root2), "utf-8");
|
|
459810
|
+
const audios = await scanSceneAudio({ projectDir, rootHtml });
|
|
459811
|
+
audioCount = audios.length;
|
|
459812
|
+
if (audios.length > 0) {
|
|
459813
|
+
const videoDuration = job.totalFrames && config4.fps ? job.totalFrames / config4.fps : void 0;
|
|
459814
|
+
const mux = await muxAudioIntoVideo({
|
|
459815
|
+
videoPath: outputPath,
|
|
459816
|
+
audios,
|
|
459817
|
+
format: config4.format ?? "mp4",
|
|
459818
|
+
videoDuration,
|
|
459819
|
+
onProgress: (line) => {
|
|
459820
|
+
if (line) opts.onProgress?.(0.97, line);
|
|
459821
|
+
}
|
|
459822
|
+
});
|
|
459823
|
+
if (mux.success) {
|
|
459824
|
+
audioMuxApplied = true;
|
|
459825
|
+
} else {
|
|
459826
|
+
audioMuxWarning = mux.error;
|
|
459827
|
+
}
|
|
459828
|
+
}
|
|
459829
|
+
} catch (err) {
|
|
459830
|
+
audioMuxWarning = err instanceof Error ? err.message : String(err);
|
|
459831
|
+
}
|
|
459451
459832
|
return {
|
|
459452
459833
|
success: true,
|
|
459453
459834
|
outputPath: relative6(process.cwd(), outputPath) || outputPath,
|
|
@@ -459456,7 +459837,10 @@ async function executeSceneRender(opts = {}) {
|
|
|
459456
459837
|
totalFrames: job.totalFrames,
|
|
459457
459838
|
fps: config4.fps,
|
|
459458
459839
|
quality: config4.quality,
|
|
459459
|
-
format: config4.format
|
|
459840
|
+
format: config4.format,
|
|
459841
|
+
audioCount,
|
|
459842
|
+
audioMuxApplied,
|
|
459843
|
+
audioMuxWarning
|
|
459460
459844
|
};
|
|
459461
459845
|
}
|
|
459462
459846
|
async function safeStat(p) {
|
|
@@ -459473,12 +459857,67 @@ init_source();
|
|
|
459473
459857
|
init_ora();
|
|
459474
459858
|
var import_yaml6 = __toESM(require_dist14(), 1);
|
|
459475
459859
|
init_dist2();
|
|
459860
|
+
import { basename as basename18, resolve as resolve40, relative as relative7, dirname as dirname25 } from "node:path";
|
|
459861
|
+
import { mkdir as mkdir19, readFile as readFile24, writeFile as writeFile25, access as access5, copyFile as copyFile4 } from "node:fs/promises";
|
|
459862
|
+
import { existsSync as existsSync37 } from "node:fs";
|
|
459863
|
+
|
|
459864
|
+
// ../cli/src/commands/_shared/tts-resolve.ts
|
|
459865
|
+
init_dist2();
|
|
459866
|
+
init_api_key();
|
|
459867
|
+
init_api_key();
|
|
459868
|
+
async function resolveTtsProvider(preferred = "auto") {
|
|
459869
|
+
const choice = preferred === "auto" ? hasApiKey("ELEVENLABS_API_KEY") ? "elevenlabs" : "kokoro" : preferred;
|
|
459870
|
+
if (choice === "elevenlabs") {
|
|
459871
|
+
return buildElevenLabs();
|
|
459872
|
+
}
|
|
459873
|
+
return buildKokoro();
|
|
459874
|
+
}
|
|
459875
|
+
async function buildElevenLabs() {
|
|
459876
|
+
const key2 = await getApiKey("ELEVENLABS_API_KEY", "ElevenLabs");
|
|
459877
|
+
if (!key2) {
|
|
459878
|
+
throw new TtsKeyMissingError("elevenlabs");
|
|
459879
|
+
}
|
|
459880
|
+
const provider = new ElevenLabsProvider();
|
|
459881
|
+
await provider.initialize({ apiKey: key2 });
|
|
459882
|
+
const call = async (text, opts) => provider.textToSpeech(text, {
|
|
459883
|
+
voiceId: opts?.voice,
|
|
459884
|
+
speed: opts?.speed
|
|
459885
|
+
});
|
|
459886
|
+
return { provider: "elevenlabs", audioExtension: "mp3", call };
|
|
459887
|
+
}
|
|
459888
|
+
async function buildKokoro() {
|
|
459889
|
+
const provider = new KokoroProvider();
|
|
459890
|
+
await provider.initialize({});
|
|
459891
|
+
const call = async (text, opts) => provider.textToSpeech(text, {
|
|
459892
|
+
voice: opts?.voice,
|
|
459893
|
+
speed: opts?.speed,
|
|
459894
|
+
onProgress: opts?.onProgress
|
|
459895
|
+
});
|
|
459896
|
+
return { provider: "kokoro", audioExtension: "wav", call };
|
|
459897
|
+
}
|
|
459898
|
+
var TtsKeyMissingError = class extends Error {
|
|
459899
|
+
constructor(provider) {
|
|
459900
|
+
super(
|
|
459901
|
+
provider === "elevenlabs" ? "ElevenLabs API key required (ELEVENLABS_API_KEY). Run 'vibe setup', set ELEVENLABS_API_KEY in .env, or pass --tts kokoro for local synthesis." : `Provider ${provider} is unavailable.`
|
|
459902
|
+
);
|
|
459903
|
+
this.provider = provider;
|
|
459904
|
+
this.name = "TtsKeyMissingError";
|
|
459905
|
+
}
|
|
459906
|
+
};
|
|
459907
|
+
function parseTtsProviderName(value) {
|
|
459908
|
+
if (!value) return "auto";
|
|
459909
|
+
if (value === "auto" || value === "elevenlabs" || value === "kokoro") {
|
|
459910
|
+
return value;
|
|
459911
|
+
}
|
|
459912
|
+
throw new Error(
|
|
459913
|
+
`Invalid --tts: ${value}. Valid: auto, elevenlabs, kokoro.`
|
|
459914
|
+
);
|
|
459915
|
+
}
|
|
459916
|
+
|
|
459917
|
+
// ../cli/src/commands/scene.ts
|
|
459476
459918
|
init_scene_project();
|
|
459477
459919
|
init_scene_html_emit();
|
|
459478
459920
|
init_scene_lint();
|
|
459479
|
-
import { basename as basename17, resolve as resolve38, relative as relative7, dirname as dirname24 } from "node:path";
|
|
459480
|
-
import { mkdir as mkdir19, readFile as readFile22, writeFile as writeFile25, access as access5 } from "node:fs/promises";
|
|
459481
|
-
import { existsSync as existsSync37 } from "node:fs";
|
|
459482
459921
|
init_output();
|
|
459483
459922
|
init_api_key();
|
|
459484
459923
|
init_audio();
|
|
@@ -459522,7 +459961,7 @@ Run 'vibe schema scene.<command>' for structured parameter info.`);
|
|
|
459522
459961
|
sceneCommand.command("init").description("Scaffold a new scene project (or safely augment an existing Hyperframes project)").argument("<dir>", "Project directory (created if it doesn't exist)").option("-n, --name <name>", "Project name (defaults to directory basename)").option("-r, --ratio <ratio>", "Aspect ratio: 16:9, 9:16, 1:1, 4:5", "16:9").option("-d, --duration <sec>", "Default root composition duration (seconds)", "10").option("--dry-run", "Preview parameters without writing files").action(async (dir, options) => {
|
|
459523
459962
|
const aspect = validateAspect(options.ratio);
|
|
459524
459963
|
const duration = validateDuration(options.duration);
|
|
459525
|
-
const name = options.name ??
|
|
459964
|
+
const name = options.name ?? basename18(dir.replace(/\/+$/, ""));
|
|
459526
459965
|
if (options.dryRun) {
|
|
459527
459966
|
outputResult({
|
|
459528
459967
|
dryRun: true,
|
|
@@ -459567,9 +460006,15 @@ sceneCommand.command("init").description("Scaffold a new scene project (or safel
|
|
|
459567
460006
|
exitWithError(generalError(`Failed to scaffold: ${msg}`));
|
|
459568
460007
|
}
|
|
459569
460008
|
});
|
|
459570
|
-
sceneCommand.command("add").description("Add a new scene to a project: AI narration + image + per-scene HTML").argument("<name>", "Scene name (slugified into the composition id)").option("--style <preset>", `Style preset: ${SCENE_PRESETS.join(", ")}`, "simple").option("--narration <text>", "Narration text (or path to a .txt file). Drives TTS + scene duration.").option("-d, --duration <sec>", "Explicit scene duration in seconds (overrides narration audio)").option("--visuals <prompt>", "Image prompt \u2014 generates assets/scene-<id>.png via the configured image provider").option("--headline <text>", "Visible headline (defaults to the humanised scene name)").option("--kicker <text>", "Small label above the headline (explainer / product-shot)").option("--insert-into <path>", "Root composition file to update", "index.html").option("--project <dir>", "Project directory", ".").option("--image-provider <name>", "Image provider: gemini, openai", "gemini").option("--
|
|
460009
|
+
sceneCommand.command("add").description("Add a new scene to a project: AI narration + image + per-scene HTML").argument("<name>", "Scene name (slugified into the composition id)").option("--style <preset>", `Style preset: ${SCENE_PRESETS.join(", ")}`, "simple").option("--narration <text>", "Narration text (or path to a .txt file). Drives TTS + scene duration.").option("--narration-file <path>", "Existing narration audio file (.wav/.mp3). Skips TTS \u2014 useful with hyperframes tts, Mac say, or other external tools.").option("-d, --duration <sec>", "Explicit scene duration in seconds (overrides narration audio)").option("--visuals <prompt>", "Image prompt \u2014 generates assets/scene-<id>.png via the configured image provider").option("--headline <text>", "Visible headline (defaults to the humanised scene name)").option("--kicker <text>", "Small label above the headline (explainer / product-shot)").option("--insert-into <path>", "Root composition file to update", "index.html").option("--project <dir>", "Project directory", ".").option("--image-provider <name>", "Image provider: gemini, openai", "gemini").option("--tts <provider>", "TTS provider: auto, elevenlabs, kokoro (default auto \u2014 picks ElevenLabs when key set, else Kokoro local)", "auto").option("--voice <id>", "Voice id (ElevenLabs name/id, or Kokoro id like af_heart, am_michael)").option("--no-audio", "Skip TTS even when --narration is provided (useful for tests/agent dry runs)").option("--no-image", "Skip image generation even when --visuals is provided").option("--no-transcribe", "Skip Whisper word-level transcribe step (no transcript-<id>.json emitted)").option("--transcribe-language <code>", "BCP-47 language code passed to Whisper (e.g. en, ko)").option("--force", "Overwrite an existing compositions/scene-<id>.html").option("--dry-run", "Preview parameters without writing files or calling APIs").action(async (name, options) => {
|
|
459571
460010
|
if (options.style) options.style = validatePreset(options.style);
|
|
459572
460011
|
if (options.duration !== void 0) options.duration = validateDuration(options.duration);
|
|
460012
|
+
let tts;
|
|
460013
|
+
try {
|
|
460014
|
+
tts = parseTtsProviderName(options.tts);
|
|
460015
|
+
} catch (error) {
|
|
460016
|
+
exitWithError(usageError(error instanceof Error ? error.message : String(error)));
|
|
460017
|
+
}
|
|
459573
460018
|
if (options.dryRun) {
|
|
459574
460019
|
const id = slugifySceneName(name);
|
|
459575
460020
|
outputResult({
|
|
@@ -459587,6 +460032,7 @@ sceneCommand.command("add").description("Add a new scene to a project: AI narrat
|
|
|
459587
460032
|
project: options.project,
|
|
459588
460033
|
insertInto: options.insertInto,
|
|
459589
460034
|
imageProvider: options.imageProvider,
|
|
460035
|
+
tts,
|
|
459590
460036
|
audio: options.audio,
|
|
459591
460037
|
// commander sets `audio: false` when --no-audio is passed
|
|
459592
460038
|
image: options.image
|
|
@@ -459600,6 +460046,7 @@ sceneCommand.command("add").description("Add a new scene to a project: AI narrat
|
|
|
459600
460046
|
name,
|
|
459601
460047
|
preset: options.style,
|
|
459602
460048
|
narration: options.narration,
|
|
460049
|
+
narrationFile: options.narrationFile,
|
|
459603
460050
|
duration: options.duration,
|
|
459604
460051
|
visuals: options.visuals,
|
|
459605
460052
|
headline: options.headline,
|
|
@@ -459607,9 +460054,12 @@ sceneCommand.command("add").description("Add a new scene to a project: AI narrat
|
|
|
459607
460054
|
projectDir: options.project,
|
|
459608
460055
|
insertInto: options.insertInto,
|
|
459609
460056
|
imageProvider: options.imageProvider,
|
|
460057
|
+
tts,
|
|
459610
460058
|
voice: options.voice,
|
|
459611
460059
|
skipAudio: options.audio === false,
|
|
459612
460060
|
skipImage: options.image === false,
|
|
460061
|
+
skipTranscribe: options.transcribe === false,
|
|
460062
|
+
transcribeLanguage: options.transcribeLanguage,
|
|
459613
460063
|
force: !!options.force,
|
|
459614
460064
|
onProgress: (msg) => {
|
|
459615
460065
|
if (spinner2) spinner2.text = msg;
|
|
@@ -459633,6 +460083,7 @@ sceneCommand.command("add").description("Add a new scene to a project: AI narrat
|
|
|
459633
460083
|
console.log(source_default.green(" +"), result.scenePath);
|
|
459634
460084
|
if (result.audioPath) console.log(source_default.green(" +"), result.audioPath);
|
|
459635
460085
|
if (result.imagePath) console.log(source_default.green(" +"), result.imagePath);
|
|
460086
|
+
if (result.transcriptPath) console.log(source_default.green(" +"), result.transcriptPath);
|
|
459636
460087
|
console.log(source_default.yellow(" ~"), result.rootPath, source_default.dim("(updated)"));
|
|
459637
460088
|
console.log();
|
|
459638
460089
|
console.log(source_default.bold.cyan("Composition"));
|
|
@@ -459661,16 +460112,16 @@ async function pathExists2(p) {
|
|
|
459661
460112
|
}
|
|
459662
460113
|
}
|
|
459663
460114
|
async function loadVibeProjectConfig(projectDir) {
|
|
459664
|
-
const cfgPath =
|
|
460115
|
+
const cfgPath = resolve40(projectDir, "vibe.project.yaml");
|
|
459665
460116
|
if (!await pathExists2(cfgPath)) return null;
|
|
459666
|
-
const raw2 = await
|
|
460117
|
+
const raw2 = await readFile24(cfgPath, "utf-8");
|
|
459667
460118
|
return (0, import_yaml6.parse)(raw2);
|
|
459668
460119
|
}
|
|
459669
460120
|
async function resolveNarrationText(value) {
|
|
459670
460121
|
if (!value) return void 0;
|
|
459671
460122
|
const looksLikePath = /\.[a-z]{2,4}$/i.test(value) || value.includes("/") || value.includes("\\");
|
|
459672
460123
|
if (looksLikePath && existsSync37(value)) {
|
|
459673
|
-
return (await
|
|
460124
|
+
return (await readFile24(value, "utf-8")).trim();
|
|
459674
460125
|
}
|
|
459675
460126
|
return value.trim();
|
|
459676
460127
|
}
|
|
@@ -459686,12 +460137,12 @@ function aspectStringFromDims(width, height) {
|
|
|
459686
460137
|
return width > height ? "16:9" : "9:16";
|
|
459687
460138
|
}
|
|
459688
460139
|
async function executeSceneAdd(opts) {
|
|
459689
|
-
const projectDir =
|
|
460140
|
+
const projectDir = resolve40(opts.projectDir ?? ".");
|
|
459690
460141
|
const rootRel = opts.insertInto ?? "index.html";
|
|
459691
|
-
const rootPath =
|
|
460142
|
+
const rootPath = resolve40(projectDir, rootRel);
|
|
459692
460143
|
const id = slugifySceneName(opts.name);
|
|
459693
460144
|
const sceneRel = `compositions/scene-${id}.html`;
|
|
459694
|
-
const scenePath =
|
|
460145
|
+
const scenePath = resolve40(projectDir, sceneRel);
|
|
459695
460146
|
const errResult = (error) => ({
|
|
459696
460147
|
success: false,
|
|
459697
460148
|
id,
|
|
@@ -459708,7 +460159,7 @@ async function executeSceneAdd(opts) {
|
|
|
459708
460159
|
if (!opts.force && await pathExists2(scenePath)) {
|
|
459709
460160
|
return errResult(`Scene already exists: ${sceneRel}. Re-run with --force to overwrite.`);
|
|
459710
460161
|
}
|
|
459711
|
-
const rootHtmlBefore = await
|
|
460162
|
+
const rootHtmlBefore = await readFile24(rootPath, "utf-8");
|
|
459712
460163
|
let dims = readRootDims(rootHtmlBefore);
|
|
459713
460164
|
if (!dims) {
|
|
459714
460165
|
const cfg2 = await loadVibeProjectConfig(projectDir);
|
|
@@ -459721,21 +460172,51 @@ async function executeSceneAdd(opts) {
|
|
|
459721
460172
|
let audioRelPath;
|
|
459722
460173
|
let audioAbsPath;
|
|
459723
460174
|
let narrationDuration;
|
|
459724
|
-
if (
|
|
459725
|
-
const
|
|
459726
|
-
if (!
|
|
459727
|
-
return errResult(
|
|
460175
|
+
if (opts.narrationFile && !opts.skipAudio) {
|
|
460176
|
+
const sourceAbs = resolve40(opts.narrationFile);
|
|
460177
|
+
if (!await pathExists2(sourceAbs)) {
|
|
460178
|
+
return errResult(`Narration file not found: ${sourceAbs}`);
|
|
460179
|
+
}
|
|
460180
|
+
const ext = (sourceAbs.match(/\.([a-z0-9]+)$/i)?.[1] ?? "wav").toLowerCase();
|
|
460181
|
+
if (ext !== "wav" && ext !== "mp3") {
|
|
460182
|
+
return errResult(`Unsupported narration file extension: .${ext}. Use .wav or .mp3.`);
|
|
460183
|
+
}
|
|
460184
|
+
audioRelPath = `assets/narration-${id}.${ext}`;
|
|
460185
|
+
audioAbsPath = resolve40(projectDir, audioRelPath);
|
|
460186
|
+
await mkdir19(dirname25(audioAbsPath), { recursive: true });
|
|
460187
|
+
await copyFile4(sourceAbs, audioAbsPath);
|
|
460188
|
+
try {
|
|
460189
|
+
narrationDuration = await getAudioDuration(audioAbsPath);
|
|
460190
|
+
} catch {
|
|
460191
|
+
narrationDuration = void 0;
|
|
459728
460192
|
}
|
|
459729
|
-
|
|
459730
|
-
|
|
459731
|
-
|
|
459732
|
-
|
|
460193
|
+
} else if (narrationText && !opts.skipAudio) {
|
|
460194
|
+
let resolution;
|
|
460195
|
+
try {
|
|
460196
|
+
resolution = await resolveTtsProvider(opts.tts ?? "auto");
|
|
460197
|
+
} catch (error) {
|
|
460198
|
+
if (error instanceof TtsKeyMissingError) {
|
|
460199
|
+
return errResult(error.message);
|
|
460200
|
+
}
|
|
460201
|
+
throw error;
|
|
460202
|
+
}
|
|
460203
|
+
opts.onProgress?.(
|
|
460204
|
+
resolution.provider === "kokoro" ? "Generating narration with Kokoro (local \u2014 first run downloads ~330MB)..." : "Generating narration with ElevenLabs..."
|
|
460205
|
+
);
|
|
460206
|
+
const tts = await resolution.call(narrationText, {
|
|
460207
|
+
voice: opts.voice,
|
|
460208
|
+
onProgress: (event) => {
|
|
460209
|
+
if (event.status === "progress" && typeof event.progress === "number") {
|
|
460210
|
+
opts.onProgress?.(`Kokoro model: ${event.file ?? ""} ${Math.round(event.progress)}%`);
|
|
460211
|
+
}
|
|
460212
|
+
}
|
|
460213
|
+
});
|
|
459733
460214
|
if (!tts.success || !tts.audioBuffer) {
|
|
459734
|
-
return errResult(
|
|
460215
|
+
return errResult(`${resolution.provider} TTS failed: ${tts.error ?? "unknown error"}`);
|
|
459735
460216
|
}
|
|
459736
|
-
audioRelPath = `assets/narration-${id}.
|
|
459737
|
-
audioAbsPath =
|
|
459738
|
-
await mkdir19(
|
|
460217
|
+
audioRelPath = `assets/narration-${id}.${resolution.audioExtension}`;
|
|
460218
|
+
audioAbsPath = resolve40(projectDir, audioRelPath);
|
|
460219
|
+
await mkdir19(dirname25(audioAbsPath), { recursive: true });
|
|
459739
460220
|
await writeFile25(audioAbsPath, tts.audioBuffer);
|
|
459740
460221
|
try {
|
|
459741
460222
|
narrationDuration = await getAudioDuration(audioAbsPath);
|
|
@@ -459743,6 +460224,41 @@ async function executeSceneAdd(opts) {
|
|
|
459743
460224
|
narrationDuration = void 0;
|
|
459744
460225
|
}
|
|
459745
460226
|
}
|
|
460227
|
+
let transcriptRelPath;
|
|
460228
|
+
let transcriptWordCount;
|
|
460229
|
+
let transcriptWords;
|
|
460230
|
+
if (audioAbsPath && !opts.skipTranscribe) {
|
|
460231
|
+
const whisperKey = await getApiKey("OPENAI_API_KEY", "OpenAI");
|
|
460232
|
+
if (!whisperKey) {
|
|
460233
|
+
opts.onProgress?.(
|
|
460234
|
+
"Skipping transcribe (OPENAI_API_KEY not set \u2014 narration plays but word-sync unavailable)"
|
|
460235
|
+
);
|
|
460236
|
+
} else {
|
|
460237
|
+
opts.onProgress?.("Transcribing narration (Whisper word-level)...");
|
|
460238
|
+
try {
|
|
460239
|
+
const whisper = new WhisperProvider();
|
|
460240
|
+
await whisper.initialize({ apiKey: whisperKey });
|
|
460241
|
+
const audioBytes = await readFile24(audioAbsPath);
|
|
460242
|
+
const audioBlob = new Blob([new Uint8Array(audioBytes)]);
|
|
460243
|
+
const transcript = await whisper.transcribe(audioBlob, void 0, {
|
|
460244
|
+
granularity: "word",
|
|
460245
|
+
language: opts.transcribeLanguage
|
|
460246
|
+
});
|
|
460247
|
+
if (transcript.status === "completed" && transcript.words?.length) {
|
|
460248
|
+
transcriptRelPath = `assets/transcript-${id}.json`;
|
|
460249
|
+
const transcriptAbs = resolve40(projectDir, transcriptRelPath);
|
|
460250
|
+
await writeFile25(transcriptAbs, JSON.stringify(transcript.words, null, 2), "utf-8");
|
|
460251
|
+
transcriptWordCount = transcript.words.length;
|
|
460252
|
+
transcriptWords = transcript.words.map((w) => ({ text: w.text, start: w.start, end: w.end }));
|
|
460253
|
+
} else if (transcript.status === "failed") {
|
|
460254
|
+
opts.onProgress?.(`Transcribe failed: ${transcript.error ?? "unknown error"}`);
|
|
460255
|
+
}
|
|
460256
|
+
} catch (error) {
|
|
460257
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
460258
|
+
opts.onProgress?.(`Transcribe failed: ${msg}`);
|
|
460259
|
+
}
|
|
460260
|
+
}
|
|
460261
|
+
}
|
|
459746
460262
|
let imageRelPath;
|
|
459747
460263
|
let imageAbsPath;
|
|
459748
460264
|
if (opts.visuals && !opts.skipImage) {
|
|
@@ -459767,8 +460283,8 @@ async function executeSceneAdd(opts) {
|
|
|
459767
460283
|
}
|
|
459768
460284
|
const img = imageResult.images[0];
|
|
459769
460285
|
imageRelPath = `assets/scene-${id}.png`;
|
|
459770
|
-
imageAbsPath =
|
|
459771
|
-
await mkdir19(
|
|
460286
|
+
imageAbsPath = resolve40(projectDir, imageRelPath);
|
|
460287
|
+
await mkdir19(dirname25(imageAbsPath), { recursive: true });
|
|
459772
460288
|
let buffer;
|
|
459773
460289
|
if (img.base64) {
|
|
459774
460290
|
buffer = Buffer.from(img.base64, "base64");
|
|
@@ -459792,8 +460308,8 @@ async function executeSceneAdd(opts) {
|
|
|
459792
460308
|
return errResult(`Gemini image generation failed: ${imageResult.error ?? "unknown error"}`);
|
|
459793
460309
|
}
|
|
459794
460310
|
imageRelPath = `assets/scene-${id}.png`;
|
|
459795
|
-
imageAbsPath =
|
|
459796
|
-
await mkdir19(
|
|
460311
|
+
imageAbsPath = resolve40(projectDir, imageRelPath);
|
|
460312
|
+
await mkdir19(dirname25(imageAbsPath), { recursive: true });
|
|
459797
460313
|
const buffer = Buffer.from(imageResult.images[0].base64, "base64");
|
|
459798
460314
|
await writeFile25(imageAbsPath, buffer);
|
|
459799
460315
|
}
|
|
@@ -459812,14 +460328,16 @@ async function executeSceneAdd(opts) {
|
|
|
459812
460328
|
subhead: narrationText,
|
|
459813
460329
|
kicker: opts.kicker,
|
|
459814
460330
|
imagePath: imageRelPath,
|
|
459815
|
-
audioPath: audioRelPath
|
|
460331
|
+
audioPath: audioRelPath,
|
|
460332
|
+
transcript: transcriptWords
|
|
459816
460333
|
});
|
|
459817
|
-
await mkdir19(
|
|
460334
|
+
await mkdir19(dirname25(scenePath), { recursive: true });
|
|
459818
460335
|
await writeFile25(scenePath, sceneHtml, "utf-8");
|
|
459819
460336
|
opts.onProgress?.("Updating root composition...");
|
|
459820
460337
|
const start = nextSceneStart(rootHtmlBefore);
|
|
459821
460338
|
const updated = insertClipIntoRoot(rootHtmlBefore, { id, start, duration });
|
|
459822
460339
|
await writeFile25(rootPath, updated, "utf-8");
|
|
460340
|
+
const transcriptAbsPath = transcriptRelPath ? resolve40(projectDir, transcriptRelPath) : void 0;
|
|
459823
460341
|
return {
|
|
459824
460342
|
success: true,
|
|
459825
460343
|
id,
|
|
@@ -459829,14 +460347,16 @@ async function executeSceneAdd(opts) {
|
|
|
459829
460347
|
scenePath: relative7(process.cwd(), scenePath) || scenePath,
|
|
459830
460348
|
rootPath: relative7(process.cwd(), rootPath) || rootPath,
|
|
459831
460349
|
audioPath: audioAbsPath ? relative7(process.cwd(), audioAbsPath) || audioAbsPath : void 0,
|
|
459832
|
-
imagePath: imageAbsPath ? relative7(process.cwd(), imageAbsPath) || imageAbsPath : void 0
|
|
460350
|
+
imagePath: imageAbsPath ? relative7(process.cwd(), imageAbsPath) || imageAbsPath : void 0,
|
|
460351
|
+
transcriptPath: transcriptAbsPath ? relative7(process.cwd(), transcriptAbsPath) || transcriptAbsPath : void 0,
|
|
460352
|
+
transcriptWordCount
|
|
459833
460353
|
};
|
|
459834
460354
|
}
|
|
459835
460355
|
sceneCommand.command("lint").description("Validate scene HTML against Hyperframes rules (in-process, no Chrome required)").argument("[root]", "Root composition file relative to --project", "index.html").option("--project <dir>", "Project directory", ".").option("--fix", 'Apply mechanical auto-fixes (currently: missing class="clip")').action(async (root2, options) => {
|
|
459836
|
-
const projectDir =
|
|
460356
|
+
const projectDir = resolve40(options.project);
|
|
459837
460357
|
if (!await rootExists(projectDir, root2)) {
|
|
459838
460358
|
exitWithError(generalError(
|
|
459839
|
-
`Root composition not found: ${
|
|
460359
|
+
`Root composition not found: ${resolve40(projectDir, root2)}`,
|
|
459840
460360
|
"Run `vibe scene init` first, or pass --project <dir>."
|
|
459841
460361
|
));
|
|
459842
460362
|
}
|
|
@@ -459929,7 +460449,7 @@ sceneCommand.command("render").description("Render a scene project to MP4/WebM/M
|
|
|
459929
460449
|
const quality = validateQuality(options.quality);
|
|
459930
460450
|
const format4 = validateFormat(options.format);
|
|
459931
460451
|
const workers = validateWorkers(options.workers);
|
|
459932
|
-
const projectDir =
|
|
460452
|
+
const projectDir = resolve40(options.project);
|
|
459933
460453
|
if (options.dryRun) {
|
|
459934
460454
|
outputResult({
|
|
459935
460455
|
dryRun: true,
|
|
@@ -459979,6 +460499,13 @@ sceneCommand.command("render").description("Render a scene project to MP4/WebM/M
|
|
|
459979
460499
|
console.log(` duration ${((result.durationMs ?? 0) / 1e3).toFixed(1)}s`);
|
|
459980
460500
|
console.log(` frames ${result.framesRendered ?? "?"}${result.totalFrames ? ` / ${result.totalFrames}` : ""}`);
|
|
459981
460501
|
console.log(` config ${result.fps}fps \xB7 ${result.quality} \xB7 ${result.format}`);
|
|
460502
|
+
if (result.audioCount && result.audioCount > 0) {
|
|
460503
|
+
const muxStatus = result.audioMuxApplied ? source_default.green(`\u2713 ${result.audioCount} track${result.audioCount === 1 ? "" : "s"} muxed`) : source_default.yellow(`\u26A0 ${result.audioCount} track${result.audioCount === 1 ? "" : "s"} skipped`);
|
|
460504
|
+
console.log(` audio ${muxStatus}`);
|
|
460505
|
+
if (result.audioMuxWarning) {
|
|
460506
|
+
console.log(source_default.dim(` ${result.audioMuxWarning}`));
|
|
460507
|
+
}
|
|
460508
|
+
}
|
|
459982
460509
|
});
|
|
459983
460510
|
|
|
459984
460511
|
// src/tools/scene.ts
|
|
@@ -460075,7 +460602,7 @@ function summariseLint(result) {
|
|
|
460075
460602
|
async function handleSceneToolCall(name, args) {
|
|
460076
460603
|
switch (name) {
|
|
460077
460604
|
case "scene_init": {
|
|
460078
|
-
const dir =
|
|
460605
|
+
const dir = resolve41(process.cwd(), args.dir);
|
|
460079
460606
|
const result = await scaffoldSceneProject({
|
|
460080
460607
|
dir,
|
|
460081
460608
|
name: args.name,
|
|
@@ -460091,7 +460618,7 @@ async function handleSceneToolCall(name, args) {
|
|
|
460091
460618
|
});
|
|
460092
460619
|
}
|
|
460093
460620
|
case "scene_add": {
|
|
460094
|
-
const projectDir = args.projectDir ?
|
|
460621
|
+
const projectDir = args.projectDir ? resolve41(process.cwd(), args.projectDir) : process.cwd();
|
|
460095
460622
|
const result = await executeSceneAdd({
|
|
460096
460623
|
name: args.name,
|
|
460097
460624
|
preset: args.preset ?? "simple",
|
|
@@ -460122,7 +460649,7 @@ async function handleSceneToolCall(name, args) {
|
|
|
460122
460649
|
});
|
|
460123
460650
|
}
|
|
460124
460651
|
case "scene_lint": {
|
|
460125
|
-
const projectDir = args.projectDir ?
|
|
460652
|
+
const projectDir = args.projectDir ? resolve41(process.cwd(), args.projectDir) : process.cwd();
|
|
460126
460653
|
const result = await runProjectLint({
|
|
460127
460654
|
projectDir,
|
|
460128
460655
|
rootRel: args.root,
|
|
@@ -460131,7 +460658,7 @@ async function handleSceneToolCall(name, args) {
|
|
|
460131
460658
|
return JSON.stringify(summariseLint(result));
|
|
460132
460659
|
}
|
|
460133
460660
|
case "scene_render": {
|
|
460134
|
-
const projectDir = args.projectDir ?
|
|
460661
|
+
const projectDir = args.projectDir ? resolve41(process.cwd(), args.projectDir) : process.cwd();
|
|
460135
460662
|
const result = await executeSceneRender({
|
|
460136
460663
|
projectDir,
|
|
460137
460664
|
root: args.root,
|
|
@@ -460225,8 +460752,8 @@ async function handleToolCall(name, args) {
|
|
|
460225
460752
|
|
|
460226
460753
|
// src/resources/index.ts
|
|
460227
460754
|
init_engine();
|
|
460228
|
-
import { readFile as
|
|
460229
|
-
import { resolve as
|
|
460755
|
+
import { readFile as readFile25 } from "node:fs/promises";
|
|
460756
|
+
import { resolve as resolve43 } from "node:path";
|
|
460230
460757
|
var resources = [
|
|
460231
460758
|
{
|
|
460232
460759
|
uri: "vibe://project/current",
|
|
@@ -460261,8 +460788,8 @@ var resources = [
|
|
|
460261
460788
|
];
|
|
460262
460789
|
var currentProjectPath = process.env.VIBE_PROJECT_PATH || null;
|
|
460263
460790
|
async function loadProject2(projectPath) {
|
|
460264
|
-
const absPath =
|
|
460265
|
-
const content = await
|
|
460791
|
+
const absPath = resolve43(process.cwd(), projectPath);
|
|
460792
|
+
const content = await readFile25(absPath, "utf-8");
|
|
460266
460793
|
const data = JSON.parse(content);
|
|
460267
460794
|
return Project.fromJSON(data);
|
|
460268
460795
|
}
|