@vibeframe/mcp-server 0.59.0 → 0.63.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 +1431 -904
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -8069,7 +8069,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8069
8069
|
let latestResultPromise;
|
|
8070
8070
|
let provideLatestResult;
|
|
8071
8071
|
if (isContext)
|
|
8072
|
-
requestCallbacks["on-end"] = (id, request22) => new Promise((
|
|
8072
|
+
requestCallbacks["on-end"] = (id, request22) => new Promise((resolve46) => {
|
|
8073
8073
|
buildResponseToResult(request22, (err, result, onEndErrors, onEndWarnings) => {
|
|
8074
8074
|
const response = {
|
|
8075
8075
|
errors: onEndErrors,
|
|
@@ -8079,7 +8079,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8079
8079
|
latestResultPromise = void 0;
|
|
8080
8080
|
provideLatestResult = void 0;
|
|
8081
8081
|
sendResponse(id, response);
|
|
8082
|
-
|
|
8082
|
+
resolve46();
|
|
8083
8083
|
});
|
|
8084
8084
|
});
|
|
8085
8085
|
sendRequest(refs3, request5, (error, response) => {
|
|
@@ -8096,10 +8096,10 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8096
8096
|
let didDispose = false;
|
|
8097
8097
|
const result = {
|
|
8098
8098
|
rebuild: () => {
|
|
8099
|
-
if (!latestResultPromise) latestResultPromise = new Promise((
|
|
8099
|
+
if (!latestResultPromise) latestResultPromise = new Promise((resolve46, reject) => {
|
|
8100
8100
|
let settlePromise;
|
|
8101
8101
|
provideLatestResult = (err, result2) => {
|
|
8102
|
-
if (!settlePromise) settlePromise = () => err ? reject(err) :
|
|
8102
|
+
if (!settlePromise) settlePromise = () => err ? reject(err) : resolve46(result2);
|
|
8103
8103
|
};
|
|
8104
8104
|
const triggerAnotherBuild = () => {
|
|
8105
8105
|
const request22 = {
|
|
@@ -8120,7 +8120,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8120
8120
|
});
|
|
8121
8121
|
return latestResultPromise;
|
|
8122
8122
|
},
|
|
8123
|
-
watch: (options2 = {}) => new Promise((
|
|
8123
|
+
watch: (options2 = {}) => new Promise((resolve46, reject) => {
|
|
8124
8124
|
if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`);
|
|
8125
8125
|
const keys2 = {};
|
|
8126
8126
|
checkForInvalidFlags(options2, keys2, `in watch() call`);
|
|
@@ -8130,10 +8130,10 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8130
8130
|
};
|
|
8131
8131
|
sendRequest(refs3, request22, (error2) => {
|
|
8132
8132
|
if (error2) reject(new Error(error2));
|
|
8133
|
-
else
|
|
8133
|
+
else resolve46(void 0);
|
|
8134
8134
|
});
|
|
8135
8135
|
}),
|
|
8136
|
-
serve: (options2 = {}) => new Promise((
|
|
8136
|
+
serve: (options2 = {}) => new Promise((resolve46, reject) => {
|
|
8137
8137
|
if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`);
|
|
8138
8138
|
const keys2 = {};
|
|
8139
8139
|
const port = getFlag3(options2, keys2, "port", mustBeInteger);
|
|
@@ -8163,28 +8163,28 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8163
8163
|
sendResponse(id, {});
|
|
8164
8164
|
};
|
|
8165
8165
|
}
|
|
8166
|
-
|
|
8166
|
+
resolve46(response2);
|
|
8167
8167
|
});
|
|
8168
8168
|
}),
|
|
8169
|
-
cancel: () => new Promise((
|
|
8170
|
-
if (didDispose) return
|
|
8169
|
+
cancel: () => new Promise((resolve46) => {
|
|
8170
|
+
if (didDispose) return resolve46();
|
|
8171
8171
|
const request22 = {
|
|
8172
8172
|
command: "cancel",
|
|
8173
8173
|
key: buildKey
|
|
8174
8174
|
};
|
|
8175
8175
|
sendRequest(refs3, request22, () => {
|
|
8176
|
-
|
|
8176
|
+
resolve46();
|
|
8177
8177
|
});
|
|
8178
8178
|
}),
|
|
8179
|
-
dispose: () => new Promise((
|
|
8180
|
-
if (didDispose) return
|
|
8179
|
+
dispose: () => new Promise((resolve46) => {
|
|
8180
|
+
if (didDispose) return resolve46();
|
|
8181
8181
|
didDispose = true;
|
|
8182
8182
|
const request22 = {
|
|
8183
8183
|
command: "dispose",
|
|
8184
8184
|
key: buildKey
|
|
8185
8185
|
};
|
|
8186
8186
|
sendRequest(refs3, request22, () => {
|
|
8187
|
-
|
|
8187
|
+
resolve46();
|
|
8188
8188
|
scheduleOnDisposeCallbacks();
|
|
8189
8189
|
refs3.unref();
|
|
8190
8190
|
});
|
|
@@ -8223,7 +8223,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8223
8223
|
onLoad: []
|
|
8224
8224
|
};
|
|
8225
8225
|
i++;
|
|
8226
|
-
let
|
|
8226
|
+
let resolve46 = (path33, options = {}) => {
|
|
8227
8227
|
if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed');
|
|
8228
8228
|
if (typeof path33 !== "string") throw new Error(`The path to resolve must be a string`);
|
|
8229
8229
|
let keys22 = /* @__PURE__ */ Object.create(null);
|
|
@@ -8267,7 +8267,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8267
8267
|
};
|
|
8268
8268
|
let promise = setup({
|
|
8269
8269
|
initialOptions,
|
|
8270
|
-
resolve:
|
|
8270
|
+
resolve: resolve46,
|
|
8271
8271
|
onStart(callback) {
|
|
8272
8272
|
let registeredText = `This error came from the "onStart" callback registered here:`;
|
|
8273
8273
|
let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart");
|
|
@@ -9139,46 +9139,46 @@ More information: The file containing the code for esbuild's JavaScript API (${_
|
|
|
9139
9139
|
}
|
|
9140
9140
|
};
|
|
9141
9141
|
longLivedService = {
|
|
9142
|
-
build: (options) => new Promise((
|
|
9142
|
+
build: (options) => new Promise((resolve46, reject) => {
|
|
9143
9143
|
service.buildOrContext({
|
|
9144
9144
|
callName: "build",
|
|
9145
9145
|
refs: refs3,
|
|
9146
9146
|
options,
|
|
9147
9147
|
isTTY: isTTY(),
|
|
9148
9148
|
defaultWD,
|
|
9149
|
-
callback: (err, res) => err ? reject(err) :
|
|
9149
|
+
callback: (err, res) => err ? reject(err) : resolve46(res)
|
|
9150
9150
|
});
|
|
9151
9151
|
}),
|
|
9152
|
-
context: (options) => new Promise((
|
|
9152
|
+
context: (options) => new Promise((resolve46, reject) => service.buildOrContext({
|
|
9153
9153
|
callName: "context",
|
|
9154
9154
|
refs: refs3,
|
|
9155
9155
|
options,
|
|
9156
9156
|
isTTY: isTTY(),
|
|
9157
9157
|
defaultWD,
|
|
9158
|
-
callback: (err, res) => err ? reject(err) :
|
|
9158
|
+
callback: (err, res) => err ? reject(err) : resolve46(res)
|
|
9159
9159
|
})),
|
|
9160
|
-
transform: (input3, options) => new Promise((
|
|
9160
|
+
transform: (input3, options) => new Promise((resolve46, reject) => service.transform({
|
|
9161
9161
|
callName: "transform",
|
|
9162
9162
|
refs: refs3,
|
|
9163
9163
|
input: input3,
|
|
9164
9164
|
options: options || {},
|
|
9165
9165
|
isTTY: isTTY(),
|
|
9166
9166
|
fs: fsAsync,
|
|
9167
|
-
callback: (err, res) => err ? reject(err) :
|
|
9167
|
+
callback: (err, res) => err ? reject(err) : resolve46(res)
|
|
9168
9168
|
})),
|
|
9169
|
-
formatMessages: (messages, options) => new Promise((
|
|
9169
|
+
formatMessages: (messages, options) => new Promise((resolve46, reject) => service.formatMessages({
|
|
9170
9170
|
callName: "formatMessages",
|
|
9171
9171
|
refs: refs3,
|
|
9172
9172
|
messages,
|
|
9173
9173
|
options,
|
|
9174
|
-
callback: (err, res) => err ? reject(err) :
|
|
9174
|
+
callback: (err, res) => err ? reject(err) : resolve46(res)
|
|
9175
9175
|
})),
|
|
9176
|
-
analyzeMetafile: (metafile, options) => new Promise((
|
|
9176
|
+
analyzeMetafile: (metafile, options) => new Promise((resolve46, reject) => service.analyzeMetafile({
|
|
9177
9177
|
callName: "analyzeMetafile",
|
|
9178
9178
|
refs: refs3,
|
|
9179
9179
|
metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile),
|
|
9180
9180
|
options,
|
|
9181
|
-
callback: (err, res) => err ? reject(err) :
|
|
9181
|
+
callback: (err, res) => err ? reject(err) : resolve46(res)
|
|
9182
9182
|
}))
|
|
9183
9183
|
};
|
|
9184
9184
|
return longLivedService;
|
|
@@ -9256,13 +9256,13 @@ error: ${text}`);
|
|
|
9256
9256
|
worker.postMessage(msg);
|
|
9257
9257
|
let status = Atomics.wait(sharedBufferView, 0, 0);
|
|
9258
9258
|
if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status);
|
|
9259
|
-
let { message: { id: id2, resolve:
|
|
9259
|
+
let { message: { id: id2, resolve: resolve46, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort);
|
|
9260
9260
|
if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`);
|
|
9261
9261
|
if (reject) {
|
|
9262
9262
|
applyProperties(reject, properties);
|
|
9263
9263
|
throw reject;
|
|
9264
9264
|
}
|
|
9265
|
-
return
|
|
9265
|
+
return resolve46;
|
|
9266
9266
|
};
|
|
9267
9267
|
worker.unref();
|
|
9268
9268
|
return {
|
|
@@ -11223,7 +11223,7 @@ var require_util = __commonJS({
|
|
|
11223
11223
|
return path14;
|
|
11224
11224
|
});
|
|
11225
11225
|
exports.normalize = normalize3;
|
|
11226
|
-
function
|
|
11226
|
+
function join26(aRoot, aPath) {
|
|
11227
11227
|
if (aRoot === "") {
|
|
11228
11228
|
aRoot = ".";
|
|
11229
11229
|
}
|
|
@@ -11255,7 +11255,7 @@ var require_util = __commonJS({
|
|
|
11255
11255
|
}
|
|
11256
11256
|
return joined;
|
|
11257
11257
|
}
|
|
11258
|
-
exports.join =
|
|
11258
|
+
exports.join = join26;
|
|
11259
11259
|
exports.isAbsolute = function(aPath) {
|
|
11260
11260
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
11261
11261
|
};
|
|
@@ -11469,7 +11469,7 @@ var require_util = __commonJS({
|
|
|
11469
11469
|
parsed.path = parsed.path.substring(0, index + 1);
|
|
11470
11470
|
}
|
|
11471
11471
|
}
|
|
11472
|
-
sourceURL =
|
|
11472
|
+
sourceURL = join26(urlGenerate(parsed), sourceURL);
|
|
11473
11473
|
}
|
|
11474
11474
|
return normalize3(sourceURL);
|
|
11475
11475
|
}
|
|
@@ -12909,8 +12909,8 @@ var require_source_map = __commonJS({
|
|
|
12909
12909
|
var require_previous_map = __commonJS({
|
|
12910
12910
|
"../../node_modules/.pnpm/postcss@8.5.6/node_modules/postcss/lib/previous-map.js"(exports, module) {
|
|
12911
12911
|
"use strict";
|
|
12912
|
-
var { existsSync:
|
|
12913
|
-
var { dirname:
|
|
12912
|
+
var { existsSync: existsSync41, readFileSync: readFileSync12 } = __require("fs");
|
|
12913
|
+
var { dirname: dirname28, join: join26 } = __require("path");
|
|
12914
12914
|
var { SourceMapConsumer, SourceMapGenerator } = require_source_map();
|
|
12915
12915
|
function fromBase64(str) {
|
|
12916
12916
|
if (Buffer) {
|
|
@@ -12929,7 +12929,7 @@ var require_previous_map = __commonJS({
|
|
|
12929
12929
|
if (!this.mapFile && opts.from) {
|
|
12930
12930
|
this.mapFile = opts.from;
|
|
12931
12931
|
}
|
|
12932
|
-
if (this.mapFile) this.root =
|
|
12932
|
+
if (this.mapFile) this.root = dirname28(this.mapFile);
|
|
12933
12933
|
if (text) this.text = text;
|
|
12934
12934
|
}
|
|
12935
12935
|
consumer() {
|
|
@@ -12971,8 +12971,8 @@ var require_previous_map = __commonJS({
|
|
|
12971
12971
|
}
|
|
12972
12972
|
}
|
|
12973
12973
|
loadFile(path14) {
|
|
12974
|
-
this.root =
|
|
12975
|
-
if (
|
|
12974
|
+
this.root = dirname28(path14);
|
|
12975
|
+
if (existsSync41(path14)) {
|
|
12976
12976
|
this.mapFile = path14;
|
|
12977
12977
|
return readFileSync12(path14, "utf-8").toString().trim();
|
|
12978
12978
|
}
|
|
@@ -13008,7 +13008,7 @@ var require_previous_map = __commonJS({
|
|
|
13008
13008
|
return this.decodeInline(this.annotation);
|
|
13009
13009
|
} else if (this.annotation) {
|
|
13010
13010
|
let map3 = this.annotation;
|
|
13011
|
-
if (file) map3 =
|
|
13011
|
+
if (file) map3 = join26(dirname28(file), map3);
|
|
13012
13012
|
return this.loadFile(map3);
|
|
13013
13013
|
}
|
|
13014
13014
|
}
|
|
@@ -13030,7 +13030,7 @@ var require_input = __commonJS({
|
|
|
13030
13030
|
"../../node_modules/.pnpm/postcss@8.5.6/node_modules/postcss/lib/input.js"(exports, module) {
|
|
13031
13031
|
"use strict";
|
|
13032
13032
|
var { nanoid } = require_non_secure();
|
|
13033
|
-
var { isAbsolute: isAbsolute5, resolve:
|
|
13033
|
+
var { isAbsolute: isAbsolute5, resolve: resolve46 } = __require("path");
|
|
13034
13034
|
var { SourceMapConsumer, SourceMapGenerator } = require_source_map();
|
|
13035
13035
|
var { fileURLToPath: fileURLToPath6, pathToFileURL } = __require("url");
|
|
13036
13036
|
var CssSyntaxError2 = require_css_syntax_error();
|
|
@@ -13038,7 +13038,7 @@ var require_input = __commonJS({
|
|
|
13038
13038
|
var terminalHighlight = require_terminal_highlight();
|
|
13039
13039
|
var lineToIndexCache = /* @__PURE__ */ Symbol("lineToIndexCache");
|
|
13040
13040
|
var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
|
|
13041
|
-
var pathAvailable = Boolean(
|
|
13041
|
+
var pathAvailable = Boolean(resolve46 && isAbsolute5);
|
|
13042
13042
|
function getLineToIndex(input3) {
|
|
13043
13043
|
if (input3[lineToIndexCache]) return input3[lineToIndexCache];
|
|
13044
13044
|
let lines = input3.css.split("\n");
|
|
@@ -13072,7 +13072,7 @@ var require_input = __commonJS({
|
|
|
13072
13072
|
if (!pathAvailable || /^\w+:\/\//.test(opts.from) || isAbsolute5(opts.from)) {
|
|
13073
13073
|
this.file = opts.from;
|
|
13074
13074
|
} else {
|
|
13075
|
-
this.file =
|
|
13075
|
+
this.file = resolve46(opts.from);
|
|
13076
13076
|
}
|
|
13077
13077
|
}
|
|
13078
13078
|
if (pathAvailable && sourceMapAvailable) {
|
|
@@ -13185,7 +13185,7 @@ var require_input = __commonJS({
|
|
|
13185
13185
|
if (/^\w+:\/\//.test(file)) {
|
|
13186
13186
|
return file;
|
|
13187
13187
|
}
|
|
13188
|
-
return
|
|
13188
|
+
return resolve46(this.map.consumer().sourceRoot || this.map.root || ".", file);
|
|
13189
13189
|
}
|
|
13190
13190
|
origin(line, column, endLine, endColumn) {
|
|
13191
13191
|
if (!this.map) return false;
|
|
@@ -13444,12 +13444,12 @@ var require_fromJSON = __commonJS({
|
|
|
13444
13444
|
var require_map_generator = __commonJS({
|
|
13445
13445
|
"../../node_modules/.pnpm/postcss@8.5.6/node_modules/postcss/lib/map-generator.js"(exports, module) {
|
|
13446
13446
|
"use strict";
|
|
13447
|
-
var { dirname:
|
|
13447
|
+
var { dirname: dirname28, relative: relative8, resolve: resolve46, sep } = __require("path");
|
|
13448
13448
|
var { SourceMapConsumer, SourceMapGenerator } = require_source_map();
|
|
13449
13449
|
var { pathToFileURL } = __require("url");
|
|
13450
13450
|
var Input2 = require_input();
|
|
13451
13451
|
var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
|
|
13452
|
-
var pathAvailable = Boolean(
|
|
13452
|
+
var pathAvailable = Boolean(dirname28 && resolve46 && relative8 && sep);
|
|
13453
13453
|
var MapGenerator = class {
|
|
13454
13454
|
constructor(stringify5, root2, opts, cssString) {
|
|
13455
13455
|
this.stringify = stringify5;
|
|
@@ -13481,7 +13481,7 @@ var require_map_generator = __commonJS({
|
|
|
13481
13481
|
applyPrevMaps() {
|
|
13482
13482
|
for (let prev of this.previous()) {
|
|
13483
13483
|
let from3 = this.toUrl(this.path(prev.file));
|
|
13484
|
-
let root2 = prev.root ||
|
|
13484
|
+
let root2 = prev.root || dirname28(prev.file);
|
|
13485
13485
|
let map3;
|
|
13486
13486
|
if (this.mapOpts.sourcesContent === false) {
|
|
13487
13487
|
map3 = new SourceMapConsumer(prev.text);
|
|
@@ -13668,9 +13668,9 @@ var require_map_generator = __commonJS({
|
|
|
13668
13668
|
if (/^\w+:\/\//.test(file)) return file;
|
|
13669
13669
|
let cached = this.memoizedPaths.get(file);
|
|
13670
13670
|
if (cached) return cached;
|
|
13671
|
-
let from3 = this.opts.to ?
|
|
13671
|
+
let from3 = this.opts.to ? dirname28(this.opts.to) : ".";
|
|
13672
13672
|
if (typeof this.mapOpts.annotation === "string") {
|
|
13673
|
-
from3 =
|
|
13673
|
+
from3 = dirname28(resolve46(from3, this.mapOpts.annotation));
|
|
13674
13674
|
}
|
|
13675
13675
|
let path14 = relative8(from3, file);
|
|
13676
13676
|
this.memoizedPaths.set(file, path14);
|
|
@@ -15196,11 +15196,11 @@ function __extends(d, b) {
|
|
|
15196
15196
|
}
|
|
15197
15197
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
15198
15198
|
function adopt(value) {
|
|
15199
|
-
return value instanceof P ? value : new P(function(
|
|
15200
|
-
|
|
15199
|
+
return value instanceof P ? value : new P(function(resolve46) {
|
|
15200
|
+
resolve46(value);
|
|
15201
15201
|
});
|
|
15202
15202
|
}
|
|
15203
|
-
return new (P || (P = Promise))(function(
|
|
15203
|
+
return new (P || (P = Promise))(function(resolve46, reject) {
|
|
15204
15204
|
function fulfilled(value) {
|
|
15205
15205
|
try {
|
|
15206
15206
|
step(generator.next(value));
|
|
@@ -15216,7 +15216,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
15216
15216
|
}
|
|
15217
15217
|
}
|
|
15218
15218
|
function step(result) {
|
|
15219
|
-
result.done ?
|
|
15219
|
+
result.done ? resolve46(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
15220
15220
|
}
|
|
15221
15221
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15222
15222
|
});
|
|
@@ -15379,14 +15379,14 @@ function __asyncValues(o) {
|
|
|
15379
15379
|
}, i);
|
|
15380
15380
|
function verb(n) {
|
|
15381
15381
|
i[n] = o[n] && function(v) {
|
|
15382
|
-
return new Promise(function(
|
|
15383
|
-
v = o[n](v), settle(
|
|
15382
|
+
return new Promise(function(resolve46, reject) {
|
|
15383
|
+
v = o[n](v), settle(resolve46, reject, v.done, v.value);
|
|
15384
15384
|
});
|
|
15385
15385
|
};
|
|
15386
15386
|
}
|
|
15387
|
-
function settle(
|
|
15387
|
+
function settle(resolve46, reject, d, v) {
|
|
15388
15388
|
Promise.resolve(v).then(function(v2) {
|
|
15389
|
-
|
|
15389
|
+
resolve46({ value: v2, done: d });
|
|
15390
15390
|
}, reject);
|
|
15391
15391
|
}
|
|
15392
15392
|
}
|
|
@@ -15911,7 +15911,7 @@ function of() {
|
|
|
15911
15911
|
}
|
|
15912
15912
|
function lastValueFrom(source3, config22) {
|
|
15913
15913
|
var hasConfig = typeof config22 === "object";
|
|
15914
|
-
return new Promise(function(
|
|
15914
|
+
return new Promise(function(resolve46, reject) {
|
|
15915
15915
|
var _hasValue = false;
|
|
15916
15916
|
var _value;
|
|
15917
15917
|
source3.subscribe({
|
|
@@ -15922,9 +15922,9 @@ function lastValueFrom(source3, config22) {
|
|
|
15922
15922
|
error: reject,
|
|
15923
15923
|
complete: function() {
|
|
15924
15924
|
if (_hasValue) {
|
|
15925
|
-
|
|
15925
|
+
resolve46(_value);
|
|
15926
15926
|
} else if (hasConfig) {
|
|
15927
|
-
|
|
15927
|
+
resolve46(config22.defaultValue);
|
|
15928
15928
|
} else {
|
|
15929
15929
|
reject(new EmptyError());
|
|
15930
15930
|
}
|
|
@@ -15934,16 +15934,16 @@ function lastValueFrom(source3, config22) {
|
|
|
15934
15934
|
}
|
|
15935
15935
|
function firstValueFrom(source3, config22) {
|
|
15936
15936
|
var hasConfig = typeof config22 === "object";
|
|
15937
|
-
return new Promise(function(
|
|
15937
|
+
return new Promise(function(resolve46, reject) {
|
|
15938
15938
|
var subscriber = new SafeSubscriber({
|
|
15939
15939
|
next: function(value) {
|
|
15940
|
-
|
|
15940
|
+
resolve46(value);
|
|
15941
15941
|
subscriber.unsubscribe();
|
|
15942
15942
|
},
|
|
15943
15943
|
error: reject,
|
|
15944
15944
|
complete: function() {
|
|
15945
15945
|
if (hasConfig) {
|
|
15946
|
-
|
|
15946
|
+
resolve46(config22.defaultValue);
|
|
15947
15947
|
} else {
|
|
15948
15948
|
reject(new EmptyError());
|
|
15949
15949
|
}
|
|
@@ -16982,7 +16982,7 @@ var init_rxjs = __esm({
|
|
|
16982
16982
|
Observable22.prototype.forEach = function(next, promiseCtor) {
|
|
16983
16983
|
var _this = this;
|
|
16984
16984
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
16985
|
-
return new promiseCtor(function(
|
|
16985
|
+
return new promiseCtor(function(resolve46, reject) {
|
|
16986
16986
|
var subscriber = new SafeSubscriber({
|
|
16987
16987
|
next: function(value) {
|
|
16988
16988
|
try {
|
|
@@ -16993,7 +16993,7 @@ var init_rxjs = __esm({
|
|
|
16993
16993
|
}
|
|
16994
16994
|
},
|
|
16995
16995
|
error: reject,
|
|
16996
|
-
complete:
|
|
16996
|
+
complete: resolve46
|
|
16997
16997
|
});
|
|
16998
16998
|
_this.subscribe(subscriber);
|
|
16999
16999
|
});
|
|
@@ -17015,14 +17015,14 @@ var init_rxjs = __esm({
|
|
|
17015
17015
|
Observable22.prototype.toPromise = function(promiseCtor) {
|
|
17016
17016
|
var _this = this;
|
|
17017
17017
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
17018
|
-
return new promiseCtor(function(
|
|
17018
|
+
return new promiseCtor(function(resolve46, reject) {
|
|
17019
17019
|
var value;
|
|
17020
17020
|
_this.subscribe(function(x) {
|
|
17021
17021
|
return value = x;
|
|
17022
17022
|
}, function(err) {
|
|
17023
17023
|
return reject(err);
|
|
17024
17024
|
}, function() {
|
|
17025
|
-
return
|
|
17025
|
+
return resolve46(value);
|
|
17026
17026
|
});
|
|
17027
17027
|
});
|
|
17028
17028
|
};
|
|
@@ -19440,8 +19440,8 @@ var init_Deferred = __esm({
|
|
|
19440
19440
|
// SAFETY: This is ensured by #taskPromise.
|
|
19441
19441
|
#resolve;
|
|
19442
19442
|
// TODO: Switch to Promise.withResolvers with Node 22
|
|
19443
|
-
#taskPromise = new Promise((
|
|
19444
|
-
this.#resolve =
|
|
19443
|
+
#taskPromise = new Promise((resolve46) => {
|
|
19444
|
+
this.#resolve = resolve46;
|
|
19445
19445
|
});
|
|
19446
19446
|
#timeoutId;
|
|
19447
19447
|
#timeoutError;
|
|
@@ -19531,12 +19531,12 @@ var init_Mutex = __esm({
|
|
|
19531
19531
|
return new _Mutex.Guard(this, onRelease);
|
|
19532
19532
|
}
|
|
19533
19533
|
release() {
|
|
19534
|
-
const
|
|
19535
|
-
if (!
|
|
19534
|
+
const resolve46 = this.#acquirers.shift();
|
|
19535
|
+
if (!resolve46) {
|
|
19536
19536
|
this.#locked = false;
|
|
19537
19537
|
return;
|
|
19538
19538
|
}
|
|
19539
|
-
|
|
19539
|
+
resolve46();
|
|
19540
19540
|
}
|
|
19541
19541
|
};
|
|
19542
19542
|
}
|
|
@@ -21551,12 +21551,12 @@ var init_locators = __esm({
|
|
|
21551
21551
|
}
|
|
21552
21552
|
return defer(() => {
|
|
21553
21553
|
return from(handle.evaluate((element) => {
|
|
21554
|
-
return new Promise((
|
|
21554
|
+
return new Promise((resolve46) => {
|
|
21555
21555
|
window.requestAnimationFrame(() => {
|
|
21556
21556
|
const rect1 = element.getBoundingClientRect();
|
|
21557
21557
|
window.requestAnimationFrame(() => {
|
|
21558
21558
|
const rect2 = element.getBoundingClientRect();
|
|
21559
|
-
|
|
21559
|
+
resolve46([
|
|
21560
21560
|
{
|
|
21561
21561
|
x: rect1.x,
|
|
21562
21562
|
y: rect1.y,
|
|
@@ -23295,9 +23295,9 @@ var init_ElementHandle = __esm({
|
|
|
23295
23295
|
const handle = await this.#asSVGElementHandle();
|
|
23296
23296
|
const target = __addDisposableResource6(env_5, handle && await handle.#getOwnerSVGElement(), false);
|
|
23297
23297
|
return await (target ?? this).evaluate(async (element, threshold) => {
|
|
23298
|
-
const visibleRatio = await new Promise((
|
|
23298
|
+
const visibleRatio = await new Promise((resolve46) => {
|
|
23299
23299
|
const observer = new IntersectionObserver((entries2) => {
|
|
23300
|
-
|
|
23300
|
+
resolve46(entries2[0].intersectionRatio);
|
|
23301
23301
|
observer.disconnect();
|
|
23302
23302
|
});
|
|
23303
23303
|
observer.observe(element);
|
|
@@ -23990,7 +23990,7 @@ var init_Frame = __esm({
|
|
|
23990
23990
|
}
|
|
23991
23991
|
type = type ?? "text/javascript";
|
|
23992
23992
|
return await this.mainRealm().transferHandle(await this.isolatedRealm().evaluateHandle(async ({ url, id, type: type2, content: content2 }) => {
|
|
23993
|
-
return await new Promise((
|
|
23993
|
+
return await new Promise((resolve46, reject) => {
|
|
23994
23994
|
const script = document.createElement("script");
|
|
23995
23995
|
script.type = type2;
|
|
23996
23996
|
script.text = content2;
|
|
@@ -24003,12 +24003,12 @@ var init_Frame = __esm({
|
|
|
24003
24003
|
if (url) {
|
|
24004
24004
|
script.src = url;
|
|
24005
24005
|
script.addEventListener("load", () => {
|
|
24006
|
-
|
|
24006
|
+
resolve46(script);
|
|
24007
24007
|
}, { once: true });
|
|
24008
24008
|
document.head.appendChild(script);
|
|
24009
24009
|
} else {
|
|
24010
24010
|
document.head.appendChild(script);
|
|
24011
|
-
|
|
24011
|
+
resolve46(script);
|
|
24012
24012
|
}
|
|
24013
24013
|
});
|
|
24014
24014
|
}, { ...options, type, content }));
|
|
@@ -24028,7 +24028,7 @@ var init_Frame = __esm({
|
|
|
24028
24028
|
options.content = content;
|
|
24029
24029
|
}
|
|
24030
24030
|
return await this.mainRealm().transferHandle(await this.isolatedRealm().evaluateHandle(async ({ url, content: content2 }) => {
|
|
24031
|
-
return await new Promise((
|
|
24031
|
+
return await new Promise((resolve46, reject) => {
|
|
24032
24032
|
let element;
|
|
24033
24033
|
if (!url) {
|
|
24034
24034
|
element = document.createElement("style");
|
|
@@ -24040,7 +24040,7 @@ var init_Frame = __esm({
|
|
|
24040
24040
|
element = link;
|
|
24041
24041
|
}
|
|
24042
24042
|
element.addEventListener("load", () => {
|
|
24043
|
-
|
|
24043
|
+
resolve46(element);
|
|
24044
24044
|
}, { once: true });
|
|
24045
24045
|
element.addEventListener("error", (event) => {
|
|
24046
24046
|
reject(new Error(event.message ?? "Could not load style"));
|
|
@@ -25779,9 +25779,9 @@ var init_Page = __esm({
|
|
|
25779
25779
|
++this.#screencastSessionCount;
|
|
25780
25780
|
if (!this.#startScreencastPromise) {
|
|
25781
25781
|
this.#startScreencastPromise = this.mainFrame().client.send("Page.startScreencast", { format: "png" }).then(() => {
|
|
25782
|
-
return new Promise((
|
|
25782
|
+
return new Promise((resolve46) => {
|
|
25783
25783
|
return this.mainFrame().client.once("Page.screencastFrame", () => {
|
|
25784
|
-
return
|
|
25784
|
+
return resolve46();
|
|
25785
25785
|
});
|
|
25786
25786
|
});
|
|
25787
25787
|
});
|
|
@@ -29170,11 +29170,11 @@ function addPageBinding(type, name, prefix) {
|
|
|
29170
29170
|
return value instanceof Node;
|
|
29171
29171
|
})
|
|
29172
29172
|
}));
|
|
29173
|
-
return new Promise((
|
|
29173
|
+
return new Promise((resolve46, reject) => {
|
|
29174
29174
|
callPuppeteer.callbacks.set(seq, {
|
|
29175
29175
|
resolve(value) {
|
|
29176
29176
|
callPuppeteer.args.delete(seq);
|
|
29177
|
-
|
|
29177
|
+
resolve46(value);
|
|
29178
29178
|
},
|
|
29179
29179
|
reject(value) {
|
|
29180
29180
|
callPuppeteer.args.delete(seq);
|
|
@@ -33013,8 +33013,8 @@ var init_Input2 = __esm({
|
|
|
33013
33013
|
if (typeof delay === "number") {
|
|
33014
33014
|
await Promise.all(actions);
|
|
33015
33015
|
actions.length = 0;
|
|
33016
|
-
await new Promise((
|
|
33017
|
-
setTimeout(
|
|
33016
|
+
await new Promise((resolve46) => {
|
|
33017
|
+
setTimeout(resolve46, delay);
|
|
33018
33018
|
});
|
|
33019
33019
|
}
|
|
33020
33020
|
actions.push(this.up({ ...options, clickCount }));
|
|
@@ -33034,9 +33034,9 @@ var init_Input2 = __esm({
|
|
|
33034
33034
|
});
|
|
33035
33035
|
}
|
|
33036
33036
|
async drag(start, target) {
|
|
33037
|
-
const promise = new Promise((
|
|
33037
|
+
const promise = new Promise((resolve46) => {
|
|
33038
33038
|
this.#client.once("Input.dragIntercepted", (event) => {
|
|
33039
|
-
return
|
|
33039
|
+
return resolve46(event.data);
|
|
33040
33040
|
});
|
|
33041
33041
|
});
|
|
33042
33042
|
await this.move(start.x, start.y);
|
|
@@ -33077,8 +33077,8 @@ var init_Input2 = __esm({
|
|
|
33077
33077
|
await this.dragEnter(target, data);
|
|
33078
33078
|
await this.dragOver(target, data);
|
|
33079
33079
|
if (delay) {
|
|
33080
|
-
await new Promise((
|
|
33081
|
-
return setTimeout(
|
|
33080
|
+
await new Promise((resolve46) => {
|
|
33081
|
+
return setTimeout(resolve46, delay);
|
|
33082
33082
|
});
|
|
33083
33083
|
}
|
|
33084
33084
|
await this.drop(target, data);
|
|
@@ -33339,11 +33339,11 @@ var init_WebMCP = __esm({
|
|
|
33339
33339
|
*/
|
|
33340
33340
|
async execute(input3 = {}) {
|
|
33341
33341
|
const { invocationId } = await this.#webmcp.invokeTool(this, input3);
|
|
33342
|
-
return await new Promise((
|
|
33342
|
+
return await new Promise((resolve46) => {
|
|
33343
33343
|
const handler4 = (event) => {
|
|
33344
33344
|
if (event.id === invocationId) {
|
|
33345
33345
|
this.#webmcp.off("toolresponded", handler4);
|
|
33346
|
-
|
|
33346
|
+
resolve46(event);
|
|
33347
33347
|
}
|
|
33348
33348
|
};
|
|
33349
33349
|
this.#webmcp.on("toolresponded", handler4);
|
|
@@ -34151,9 +34151,9 @@ var init_Page2 = __esm({
|
|
|
34151
34151
|
async captureHeapSnapshot(options) {
|
|
34152
34152
|
const { createWriteStream: createWriteStream3 } = environment.value.fs;
|
|
34153
34153
|
const stream = createWriteStream3(options.path);
|
|
34154
|
-
const streamPromise = new Promise((
|
|
34154
|
+
const streamPromise = new Promise((resolve46, reject) => {
|
|
34155
34155
|
stream.on("error", reject);
|
|
34156
|
-
stream.on("finish",
|
|
34156
|
+
stream.on("finish", resolve46);
|
|
34157
34157
|
});
|
|
34158
34158
|
const client = this.#primaryTargetClient;
|
|
34159
34159
|
await client.send("HeapProfiler.enable");
|
|
@@ -35519,12 +35519,12 @@ var init_Browser2 = __esm({
|
|
|
35519
35519
|
for (const [targetId, targetInfo] of this._targetManager().getDiscoveredTargetInfos().entries()) {
|
|
35520
35520
|
if (targetInfo.url.includes(id) && targetInfo.type === "service_worker") {
|
|
35521
35521
|
this._targetManager().addToIgnoreTarget(targetId);
|
|
35522
|
-
targetDestroyedPromises.push(new Promise((
|
|
35522
|
+
targetDestroyedPromises.push(new Promise((resolve46) => {
|
|
35523
35523
|
return setTimeout(() => {
|
|
35524
35524
|
this.#connection.emit("Target.targetDestroyed", {
|
|
35525
35525
|
targetId
|
|
35526
35526
|
});
|
|
35527
|
-
|
|
35527
|
+
resolve46(null);
|
|
35528
35528
|
}, 0);
|
|
35529
35529
|
}));
|
|
35530
35530
|
}
|
|
@@ -35927,10 +35927,10 @@ var init_BrowserWebSocketTransport = __esm({
|
|
|
35927
35927
|
"../../node_modules/.pnpm/puppeteer-core@24.41.0/node_modules/puppeteer-core/lib/esm/puppeteer/common/BrowserWebSocketTransport.js"() {
|
|
35928
35928
|
BrowserWebSocketTransport = class _BrowserWebSocketTransport {
|
|
35929
35929
|
static create(url) {
|
|
35930
|
-
return new Promise((
|
|
35930
|
+
return new Promise((resolve46, reject) => {
|
|
35931
35931
|
const ws = new WebSocket(url);
|
|
35932
35932
|
ws.addEventListener("open", () => {
|
|
35933
|
-
return
|
|
35933
|
+
return resolve46(new _BrowserWebSocketTransport(ws));
|
|
35934
35934
|
});
|
|
35935
35935
|
ws.addEventListener("error", reject);
|
|
35936
35936
|
});
|
|
@@ -38852,11 +38852,11 @@ var require_BrowsingContextProcessor = __commonJS({
|
|
|
38852
38852
|
}
|
|
38853
38853
|
const parentCdpClient = context3.cdpTarget.parentCdpClient;
|
|
38854
38854
|
try {
|
|
38855
|
-
const detachedFromTargetPromise = new Promise((
|
|
38855
|
+
const detachedFromTargetPromise = new Promise((resolve46) => {
|
|
38856
38856
|
const onContextDestroyed = (event) => {
|
|
38857
38857
|
if (event.targetId === params.context) {
|
|
38858
38858
|
parentCdpClient.off("Target.detachedFromTarget", onContextDestroyed);
|
|
38859
|
-
|
|
38859
|
+
resolve46();
|
|
38860
38860
|
}
|
|
38861
38861
|
};
|
|
38862
38862
|
parentCdpClient.on("Target.detachedFromTarget", onContextDestroyed);
|
|
@@ -40219,7 +40219,7 @@ var require_ActionDispatcher = __commonJS({
|
|
|
40219
40219
|
}
|
|
40220
40220
|
}
|
|
40221
40221
|
const promises = [
|
|
40222
|
-
new Promise((
|
|
40222
|
+
new Promise((resolve46) => setTimeout(resolve46, this.#tickDuration))
|
|
40223
40223
|
];
|
|
40224
40224
|
for (const option of options) {
|
|
40225
40225
|
promises.push(this.#dispatchAction(option));
|
|
@@ -40820,8 +40820,8 @@ var require_Mutex = __commonJS({
|
|
|
40820
40820
|
acquire() {
|
|
40821
40821
|
const state = { resolved: false };
|
|
40822
40822
|
if (this.#locked) {
|
|
40823
|
-
return new Promise((
|
|
40824
|
-
this.#acquirers.push(() =>
|
|
40823
|
+
return new Promise((resolve46) => {
|
|
40824
|
+
this.#acquirers.push(() => resolve46(this.#release.bind(this, state)));
|
|
40825
40825
|
});
|
|
40826
40826
|
}
|
|
40827
40827
|
this.#locked = true;
|
|
@@ -40832,12 +40832,12 @@ var require_Mutex = __commonJS({
|
|
|
40832
40832
|
throw new Error("Cannot release more than once.");
|
|
40833
40833
|
}
|
|
40834
40834
|
state.resolved = true;
|
|
40835
|
-
const
|
|
40836
|
-
if (!
|
|
40835
|
+
const resolve46 = this.#acquirers.shift();
|
|
40836
|
+
if (!resolve46) {
|
|
40837
40837
|
this.#locked = false;
|
|
40838
40838
|
return;
|
|
40839
40839
|
}
|
|
40840
|
-
|
|
40840
|
+
resolve46();
|
|
40841
40841
|
}
|
|
40842
40842
|
async run(action) {
|
|
40843
40843
|
const release = await this.acquire();
|
|
@@ -42019,8 +42019,8 @@ var require_ChannelProxy = __commonJS({
|
|
|
42019
42019
|
* in the queue.
|
|
42020
42020
|
*/
|
|
42021
42021
|
async getMessage() {
|
|
42022
|
-
const onMessage = queue.length > 0 ? Promise.resolve() : new Promise((
|
|
42023
|
-
queueNonEmptyResolver =
|
|
42022
|
+
const onMessage = queue.length > 0 ? Promise.resolve() : new Promise((resolve46) => {
|
|
42023
|
+
queueNonEmptyResolver = resolve46;
|
|
42024
42024
|
});
|
|
42025
42025
|
await onMessage;
|
|
42026
42026
|
return queue.shift();
|
|
@@ -42125,7 +42125,7 @@ var require_ChannelProxy = __commonJS({
|
|
|
42125
42125
|
functionDeclaration: String((id) => {
|
|
42126
42126
|
const w = window;
|
|
42127
42127
|
if (w[id] === void 0) {
|
|
42128
|
-
return new Promise((
|
|
42128
|
+
return new Promise((resolve46) => w[id] = resolve46);
|
|
42129
42129
|
}
|
|
42130
42130
|
const channelProxy = w[id];
|
|
42131
42131
|
delete w[id];
|
|
@@ -43626,8 +43626,8 @@ var require_Deferred = __commonJS({
|
|
|
43626
43626
|
return this.#result;
|
|
43627
43627
|
}
|
|
43628
43628
|
constructor() {
|
|
43629
|
-
this.#promise = new Promise((
|
|
43630
|
-
this.#resolve =
|
|
43629
|
+
this.#promise = new Promise((resolve46, reject) => {
|
|
43630
|
+
this.#resolve = resolve46;
|
|
43631
43631
|
this.#reject = reject;
|
|
43632
43632
|
});
|
|
43633
43633
|
this.#promise.catch((_error) => {
|
|
@@ -48471,11 +48471,11 @@ var require_BrowsingContextStorage = __commonJS({
|
|
|
48471
48471
|
if (this.#contexts.has(browsingContextId)) {
|
|
48472
48472
|
return Promise.resolve(this.getContext(browsingContextId));
|
|
48473
48473
|
}
|
|
48474
|
-
return new Promise((
|
|
48474
|
+
return new Promise((resolve46) => {
|
|
48475
48475
|
const listener = (event) => {
|
|
48476
48476
|
if (event.browsingContext.id === browsingContextId) {
|
|
48477
48477
|
this.#eventEmitter.off("added", listener);
|
|
48478
|
-
|
|
48478
|
+
resolve46(event.browsingContext);
|
|
48479
48479
|
}
|
|
48480
48480
|
};
|
|
48481
48481
|
this.#eventEmitter.on("added", listener);
|
|
@@ -52075,8 +52075,8 @@ var init_ExposedFunction = __esm({
|
|
|
52075
52075
|
const functionDeclaration = stringifyFunction(interpolateFunction((callback) => {
|
|
52076
52076
|
Object.assign(globalThis, {
|
|
52077
52077
|
[PLACEHOLDER("name")]: function(...args) {
|
|
52078
|
-
return new Promise((
|
|
52079
|
-
callback([
|
|
52078
|
+
return new Promise((resolve46, reject) => {
|
|
52079
|
+
callback([resolve46, reject, args]);
|
|
52080
52080
|
});
|
|
52081
52081
|
}
|
|
52082
52082
|
});
|
|
@@ -52164,8 +52164,8 @@ var init_ExposedFunction = __esm({
|
|
|
52164
52164
|
return;
|
|
52165
52165
|
}
|
|
52166
52166
|
try {
|
|
52167
|
-
await dataHandle.evaluate(([
|
|
52168
|
-
|
|
52167
|
+
await dataHandle.evaluate(([resolve46], result2) => {
|
|
52168
|
+
resolve46(result2);
|
|
52169
52169
|
}, result);
|
|
52170
52170
|
} catch (error) {
|
|
52171
52171
|
debugError(error);
|
|
@@ -60307,7 +60307,7 @@ var init_NodeWebSocketTransport = __esm({
|
|
|
60307
60307
|
init_version();
|
|
60308
60308
|
NodeWebSocketTransport = class _NodeWebSocketTransport {
|
|
60309
60309
|
static create(url, headers) {
|
|
60310
|
-
return new Promise((
|
|
60310
|
+
return new Promise((resolve46, reject) => {
|
|
60311
60311
|
const ws = new wrapper_default(url, [], {
|
|
60312
60312
|
followRedirects: true,
|
|
60313
60313
|
perMessageDeflate: false,
|
|
@@ -60320,7 +60320,7 @@ var init_NodeWebSocketTransport = __esm({
|
|
|
60320
60320
|
}
|
|
60321
60321
|
});
|
|
60322
60322
|
ws.addEventListener("open", () => {
|
|
60323
|
-
return
|
|
60323
|
+
return resolve46(new _NodeWebSocketTransport(ws));
|
|
60324
60324
|
});
|
|
60325
60325
|
ws.addEventListener("error", reject);
|
|
60326
60326
|
});
|
|
@@ -63381,8 +63381,8 @@ var require_helpers = __commonJS({
|
|
|
63381
63381
|
function req(url, opts = {}) {
|
|
63382
63382
|
const href = typeof url === "string" ? url : url.href;
|
|
63383
63383
|
const req2 = (href.startsWith("https:") ? https3 : http3).request(url, opts);
|
|
63384
|
-
const promise = new Promise((
|
|
63385
|
-
req2.once("response",
|
|
63384
|
+
const promise = new Promise((resolve46, reject) => {
|
|
63385
|
+
req2.once("response", resolve46).once("error", reject).end();
|
|
63386
63386
|
});
|
|
63387
63387
|
req2.then = promise.then.bind(promise);
|
|
63388
63388
|
return req2;
|
|
@@ -63759,7 +63759,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
63759
63759
|
var debug_1 = __importDefault3(require_src());
|
|
63760
63760
|
var debug7 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
|
|
63761
63761
|
function parseProxyResponse(socket) {
|
|
63762
|
-
return new Promise((
|
|
63762
|
+
return new Promise((resolve46, reject) => {
|
|
63763
63763
|
let buffersLength = 0;
|
|
63764
63764
|
const buffers = [];
|
|
63765
63765
|
function read() {
|
|
@@ -63825,7 +63825,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
63825
63825
|
}
|
|
63826
63826
|
debug7("got proxy server response: %o %o", firstLine, headers);
|
|
63827
63827
|
cleanup();
|
|
63828
|
-
|
|
63828
|
+
resolve46({
|
|
63829
63829
|
connect: {
|
|
63830
63830
|
statusCode,
|
|
63831
63831
|
statusText,
|
|
@@ -67083,11 +67083,11 @@ var require_socksclient = __commonJS({
|
|
|
67083
67083
|
"use strict";
|
|
67084
67084
|
var __awaiter4 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
67085
67085
|
function adopt(value) {
|
|
67086
|
-
return value instanceof P ? value : new P(function(
|
|
67087
|
-
|
|
67086
|
+
return value instanceof P ? value : new P(function(resolve46) {
|
|
67087
|
+
resolve46(value);
|
|
67088
67088
|
});
|
|
67089
67089
|
}
|
|
67090
|
-
return new (P || (P = Promise))(function(
|
|
67090
|
+
return new (P || (P = Promise))(function(resolve46, reject) {
|
|
67091
67091
|
function fulfilled(value) {
|
|
67092
67092
|
try {
|
|
67093
67093
|
step(generator.next(value));
|
|
@@ -67103,7 +67103,7 @@ var require_socksclient = __commonJS({
|
|
|
67103
67103
|
}
|
|
67104
67104
|
}
|
|
67105
67105
|
function step(result) {
|
|
67106
|
-
result.done ?
|
|
67106
|
+
result.done ? resolve46(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
67107
67107
|
}
|
|
67108
67108
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
67109
67109
|
});
|
|
@@ -67137,13 +67137,13 @@ var require_socksclient = __commonJS({
|
|
|
67137
67137
|
* @returns { Promise }
|
|
67138
67138
|
*/
|
|
67139
67139
|
static createConnection(options, callback) {
|
|
67140
|
-
return new Promise((
|
|
67140
|
+
return new Promise((resolve46, reject) => {
|
|
67141
67141
|
try {
|
|
67142
67142
|
(0, helpers_1.validateSocksClientOptions)(options, ["connect"]);
|
|
67143
67143
|
} catch (err) {
|
|
67144
67144
|
if (typeof callback === "function") {
|
|
67145
67145
|
callback(err);
|
|
67146
|
-
return
|
|
67146
|
+
return resolve46(err);
|
|
67147
67147
|
} else {
|
|
67148
67148
|
return reject(err);
|
|
67149
67149
|
}
|
|
@@ -67154,16 +67154,16 @@ var require_socksclient = __commonJS({
|
|
|
67154
67154
|
client.removeAllListeners();
|
|
67155
67155
|
if (typeof callback === "function") {
|
|
67156
67156
|
callback(null, info);
|
|
67157
|
-
|
|
67157
|
+
resolve46(info);
|
|
67158
67158
|
} else {
|
|
67159
|
-
|
|
67159
|
+
resolve46(info);
|
|
67160
67160
|
}
|
|
67161
67161
|
});
|
|
67162
67162
|
client.once("error", (err) => {
|
|
67163
67163
|
client.removeAllListeners();
|
|
67164
67164
|
if (typeof callback === "function") {
|
|
67165
67165
|
callback(err);
|
|
67166
|
-
|
|
67166
|
+
resolve46(err);
|
|
67167
67167
|
} else {
|
|
67168
67168
|
reject(err);
|
|
67169
67169
|
}
|
|
@@ -67180,13 +67180,13 @@ var require_socksclient = __commonJS({
|
|
|
67180
67180
|
* @returns { Promise }
|
|
67181
67181
|
*/
|
|
67182
67182
|
static createConnectionChain(options, callback) {
|
|
67183
|
-
return new Promise((
|
|
67183
|
+
return new Promise((resolve46, reject) => __awaiter4(this, void 0, void 0, function* () {
|
|
67184
67184
|
try {
|
|
67185
67185
|
(0, helpers_1.validateSocksClientChainOptions)(options);
|
|
67186
67186
|
} catch (err) {
|
|
67187
67187
|
if (typeof callback === "function") {
|
|
67188
67188
|
callback(err);
|
|
67189
|
-
return
|
|
67189
|
+
return resolve46(err);
|
|
67190
67190
|
} else {
|
|
67191
67191
|
return reject(err);
|
|
67192
67192
|
}
|
|
@@ -67212,14 +67212,14 @@ var require_socksclient = __commonJS({
|
|
|
67212
67212
|
}
|
|
67213
67213
|
if (typeof callback === "function") {
|
|
67214
67214
|
callback(null, { socket: sock });
|
|
67215
|
-
|
|
67215
|
+
resolve46({ socket: sock });
|
|
67216
67216
|
} else {
|
|
67217
|
-
|
|
67217
|
+
resolve46({ socket: sock });
|
|
67218
67218
|
}
|
|
67219
67219
|
} catch (err) {
|
|
67220
67220
|
if (typeof callback === "function") {
|
|
67221
67221
|
callback(err);
|
|
67222
|
-
|
|
67222
|
+
resolve46(err);
|
|
67223
67223
|
} else {
|
|
67224
67224
|
reject(err);
|
|
67225
67225
|
}
|
|
@@ -67903,12 +67903,12 @@ var require_dist4 = __commonJS({
|
|
|
67903
67903
|
let { host } = opts;
|
|
67904
67904
|
const { port, lookup: lookupFn = dns.lookup } = opts;
|
|
67905
67905
|
if (shouldLookup) {
|
|
67906
|
-
host = await new Promise((
|
|
67906
|
+
host = await new Promise((resolve46, reject) => {
|
|
67907
67907
|
lookupFn(host, {}, (err, res) => {
|
|
67908
67908
|
if (err) {
|
|
67909
67909
|
reject(err);
|
|
67910
67910
|
} else {
|
|
67911
|
-
|
|
67911
|
+
resolve46(res);
|
|
67912
67912
|
}
|
|
67913
67913
|
});
|
|
67914
67914
|
});
|
|
@@ -68568,7 +68568,7 @@ var require_netUtils = __commonJS({
|
|
|
68568
68568
|
return `${socket.remoteAddress}:${socket.remotePort}`;
|
|
68569
68569
|
}
|
|
68570
68570
|
function upgradeSocket(socket, options) {
|
|
68571
|
-
return new Promise((
|
|
68571
|
+
return new Promise((resolve46, reject) => {
|
|
68572
68572
|
const tlsOptions = Object.assign({}, options, {
|
|
68573
68573
|
socket
|
|
68574
68574
|
});
|
|
@@ -68578,7 +68578,7 @@ var require_netUtils = __commonJS({
|
|
|
68578
68578
|
reject(tlsSocket.authorizationError);
|
|
68579
68579
|
} else {
|
|
68580
68580
|
tlsSocket.removeAllListeners("error");
|
|
68581
|
-
|
|
68581
|
+
resolve46(tlsSocket);
|
|
68582
68582
|
}
|
|
68583
68583
|
}).once("error", (error) => {
|
|
68584
68584
|
reject(error);
|
|
@@ -69208,7 +69208,7 @@ var require_transfer = __commonJS({
|
|
|
69208
69208
|
};
|
|
69209
69209
|
}
|
|
69210
69210
|
function connectForPassiveTransfer(host, port, ftp) {
|
|
69211
|
-
return new Promise((
|
|
69211
|
+
return new Promise((resolve46, reject) => {
|
|
69212
69212
|
let socket = ftp._newSocket();
|
|
69213
69213
|
const handleConnErr = function(err) {
|
|
69214
69214
|
err.message = "Can't open data connection in passive mode: " + err.message;
|
|
@@ -69236,7 +69236,7 @@ var require_transfer = __commonJS({
|
|
|
69236
69236
|
socket.removeListener("error", handleConnErr);
|
|
69237
69237
|
socket.removeListener("timeout", handleTimeout);
|
|
69238
69238
|
ftp.dataSocket = socket;
|
|
69239
|
-
|
|
69239
|
+
resolve46();
|
|
69240
69240
|
});
|
|
69241
69241
|
});
|
|
69242
69242
|
}
|
|
@@ -71637,7 +71637,7 @@ var require_util3 = __commonJS({
|
|
|
71637
71637
|
return path14;
|
|
71638
71638
|
}
|
|
71639
71639
|
exports.normalize = normalize3;
|
|
71640
|
-
function
|
|
71640
|
+
function join26(aRoot, aPath) {
|
|
71641
71641
|
if (aRoot === "") {
|
|
71642
71642
|
aRoot = ".";
|
|
71643
71643
|
}
|
|
@@ -71669,7 +71669,7 @@ var require_util3 = __commonJS({
|
|
|
71669
71669
|
}
|
|
71670
71670
|
return joined;
|
|
71671
71671
|
}
|
|
71672
|
-
exports.join =
|
|
71672
|
+
exports.join = join26;
|
|
71673
71673
|
exports.isAbsolute = function(aPath) {
|
|
71674
71674
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
71675
71675
|
};
|
|
@@ -71842,7 +71842,7 @@ var require_util3 = __commonJS({
|
|
|
71842
71842
|
parsed.path = parsed.path.substring(0, index + 1);
|
|
71843
71843
|
}
|
|
71844
71844
|
}
|
|
71845
|
-
sourceURL =
|
|
71845
|
+
sourceURL = join26(urlGenerate(parsed), sourceURL);
|
|
71846
71846
|
}
|
|
71847
71847
|
return normalize3(sourceURL);
|
|
71848
71848
|
}
|
|
@@ -73644,7 +73644,7 @@ var require_escodegen = __commonJS({
|
|
|
73644
73644
|
function noEmptySpace() {
|
|
73645
73645
|
return space ? space : " ";
|
|
73646
73646
|
}
|
|
73647
|
-
function
|
|
73647
|
+
function join26(left3, right3) {
|
|
73648
73648
|
var leftSource, rightSource, leftCharCode, rightCharCode;
|
|
73649
73649
|
leftSource = toSourceNodeWhenNeeded(left3).toString();
|
|
73650
73650
|
if (leftSource.length === 0) {
|
|
@@ -73975,8 +73975,8 @@ var require_escodegen = __commonJS({
|
|
|
73975
73975
|
} else {
|
|
73976
73976
|
result.push(that.generateExpression(stmt.left, Precedence.Call, E_TTT));
|
|
73977
73977
|
}
|
|
73978
|
-
result =
|
|
73979
|
-
result = [
|
|
73978
|
+
result = join26(result, operator);
|
|
73979
|
+
result = [join26(
|
|
73980
73980
|
result,
|
|
73981
73981
|
that.generateExpression(stmt.right, Precedence.Assignment, E_TTT)
|
|
73982
73982
|
), ")"];
|
|
@@ -74119,11 +74119,11 @@ var require_escodegen = __commonJS({
|
|
|
74119
74119
|
var result, fragment;
|
|
74120
74120
|
result = ["class"];
|
|
74121
74121
|
if (stmt.id) {
|
|
74122
|
-
result =
|
|
74122
|
+
result = join26(result, this.generateExpression(stmt.id, Precedence.Sequence, E_TTT));
|
|
74123
74123
|
}
|
|
74124
74124
|
if (stmt.superClass) {
|
|
74125
|
-
fragment =
|
|
74126
|
-
result =
|
|
74125
|
+
fragment = join26("extends", this.generateExpression(stmt.superClass, Precedence.Unary, E_TTT));
|
|
74126
|
+
result = join26(result, fragment);
|
|
74127
74127
|
}
|
|
74128
74128
|
result.push(space);
|
|
74129
74129
|
result.push(this.generateStatement(stmt.body, S_TFFT));
|
|
@@ -74136,9 +74136,9 @@ var require_escodegen = __commonJS({
|
|
|
74136
74136
|
return escapeDirective(stmt.directive) + this.semicolon(flags);
|
|
74137
74137
|
},
|
|
74138
74138
|
DoWhileStatement: function(stmt, flags) {
|
|
74139
|
-
var result =
|
|
74139
|
+
var result = join26("do", this.maybeBlock(stmt.body, S_TFFF));
|
|
74140
74140
|
result = this.maybeBlockSuffix(stmt.body, result);
|
|
74141
|
-
return
|
|
74141
|
+
return join26(result, [
|
|
74142
74142
|
"while" + space + "(",
|
|
74143
74143
|
this.generateExpression(stmt.test, Precedence.Sequence, E_TTT),
|
|
74144
74144
|
")" + this.semicolon(flags)
|
|
@@ -74174,11 +74174,11 @@ var require_escodegen = __commonJS({
|
|
|
74174
74174
|
ExportDefaultDeclaration: function(stmt, flags) {
|
|
74175
74175
|
var result = ["export"], bodyFlags;
|
|
74176
74176
|
bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF;
|
|
74177
|
-
result =
|
|
74177
|
+
result = join26(result, "default");
|
|
74178
74178
|
if (isStatement(stmt.declaration)) {
|
|
74179
|
-
result =
|
|
74179
|
+
result = join26(result, this.generateStatement(stmt.declaration, bodyFlags));
|
|
74180
74180
|
} else {
|
|
74181
|
-
result =
|
|
74181
|
+
result = join26(result, this.generateExpression(stmt.declaration, Precedence.Assignment, E_TTT) + this.semicolon(flags));
|
|
74182
74182
|
}
|
|
74183
74183
|
return result;
|
|
74184
74184
|
},
|
|
@@ -74186,15 +74186,15 @@ var require_escodegen = __commonJS({
|
|
|
74186
74186
|
var result = ["export"], bodyFlags, that = this;
|
|
74187
74187
|
bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF;
|
|
74188
74188
|
if (stmt.declaration) {
|
|
74189
|
-
return
|
|
74189
|
+
return join26(result, this.generateStatement(stmt.declaration, bodyFlags));
|
|
74190
74190
|
}
|
|
74191
74191
|
if (stmt.specifiers) {
|
|
74192
74192
|
if (stmt.specifiers.length === 0) {
|
|
74193
|
-
result =
|
|
74193
|
+
result = join26(result, "{" + space + "}");
|
|
74194
74194
|
} else if (stmt.specifiers[0].type === Syntax.ExportBatchSpecifier) {
|
|
74195
|
-
result =
|
|
74195
|
+
result = join26(result, this.generateExpression(stmt.specifiers[0], Precedence.Sequence, E_TTT));
|
|
74196
74196
|
} else {
|
|
74197
|
-
result =
|
|
74197
|
+
result = join26(result, "{");
|
|
74198
74198
|
withIndent(function(indent2) {
|
|
74199
74199
|
var i, iz;
|
|
74200
74200
|
result.push(newline);
|
|
@@ -74212,7 +74212,7 @@ var require_escodegen = __commonJS({
|
|
|
74212
74212
|
result.push(base + "}");
|
|
74213
74213
|
}
|
|
74214
74214
|
if (stmt.source) {
|
|
74215
|
-
result =
|
|
74215
|
+
result = join26(result, [
|
|
74216
74216
|
"from" + space,
|
|
74217
74217
|
// ModuleSpecifier
|
|
74218
74218
|
this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
|
|
@@ -74300,7 +74300,7 @@ var require_escodegen = __commonJS({
|
|
|
74300
74300
|
];
|
|
74301
74301
|
cursor = 0;
|
|
74302
74302
|
if (stmt.specifiers[cursor].type === Syntax.ImportDefaultSpecifier) {
|
|
74303
|
-
result =
|
|
74303
|
+
result = join26(result, [
|
|
74304
74304
|
this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)
|
|
74305
74305
|
]);
|
|
74306
74306
|
++cursor;
|
|
@@ -74310,7 +74310,7 @@ var require_escodegen = __commonJS({
|
|
|
74310
74310
|
result.push(",");
|
|
74311
74311
|
}
|
|
74312
74312
|
if (stmt.specifiers[cursor].type === Syntax.ImportNamespaceSpecifier) {
|
|
74313
|
-
result =
|
|
74313
|
+
result = join26(result, [
|
|
74314
74314
|
space,
|
|
74315
74315
|
this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)
|
|
74316
74316
|
]);
|
|
@@ -74339,7 +74339,7 @@ var require_escodegen = __commonJS({
|
|
|
74339
74339
|
}
|
|
74340
74340
|
}
|
|
74341
74341
|
}
|
|
74342
|
-
result =
|
|
74342
|
+
result = join26(result, [
|
|
74343
74343
|
"from" + space,
|
|
74344
74344
|
// ModuleSpecifier
|
|
74345
74345
|
this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
|
|
@@ -74393,7 +74393,7 @@ var require_escodegen = __commonJS({
|
|
|
74393
74393
|
return result;
|
|
74394
74394
|
},
|
|
74395
74395
|
ThrowStatement: function(stmt, flags) {
|
|
74396
|
-
return [
|
|
74396
|
+
return [join26(
|
|
74397
74397
|
"throw",
|
|
74398
74398
|
this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)
|
|
74399
74399
|
), this.semicolon(flags)];
|
|
@@ -74404,7 +74404,7 @@ var require_escodegen = __commonJS({
|
|
|
74404
74404
|
result = this.maybeBlockSuffix(stmt.block, result);
|
|
74405
74405
|
if (stmt.handlers) {
|
|
74406
74406
|
for (i = 0, iz = stmt.handlers.length; i < iz; ++i) {
|
|
74407
|
-
result =
|
|
74407
|
+
result = join26(result, this.generateStatement(stmt.handlers[i], S_TFFF));
|
|
74408
74408
|
if (stmt.finalizer || i + 1 !== iz) {
|
|
74409
74409
|
result = this.maybeBlockSuffix(stmt.handlers[i].body, result);
|
|
74410
74410
|
}
|
|
@@ -74412,7 +74412,7 @@ var require_escodegen = __commonJS({
|
|
|
74412
74412
|
} else {
|
|
74413
74413
|
guardedHandlers = stmt.guardedHandlers || [];
|
|
74414
74414
|
for (i = 0, iz = guardedHandlers.length; i < iz; ++i) {
|
|
74415
|
-
result =
|
|
74415
|
+
result = join26(result, this.generateStatement(guardedHandlers[i], S_TFFF));
|
|
74416
74416
|
if (stmt.finalizer || i + 1 !== iz) {
|
|
74417
74417
|
result = this.maybeBlockSuffix(guardedHandlers[i].body, result);
|
|
74418
74418
|
}
|
|
@@ -74420,13 +74420,13 @@ var require_escodegen = __commonJS({
|
|
|
74420
74420
|
if (stmt.handler) {
|
|
74421
74421
|
if (Array.isArray(stmt.handler)) {
|
|
74422
74422
|
for (i = 0, iz = stmt.handler.length; i < iz; ++i) {
|
|
74423
|
-
result =
|
|
74423
|
+
result = join26(result, this.generateStatement(stmt.handler[i], S_TFFF));
|
|
74424
74424
|
if (stmt.finalizer || i + 1 !== iz) {
|
|
74425
74425
|
result = this.maybeBlockSuffix(stmt.handler[i].body, result);
|
|
74426
74426
|
}
|
|
74427
74427
|
}
|
|
74428
74428
|
} else {
|
|
74429
|
-
result =
|
|
74429
|
+
result = join26(result, this.generateStatement(stmt.handler, S_TFFF));
|
|
74430
74430
|
if (stmt.finalizer) {
|
|
74431
74431
|
result = this.maybeBlockSuffix(stmt.handler.body, result);
|
|
74432
74432
|
}
|
|
@@ -74434,7 +74434,7 @@ var require_escodegen = __commonJS({
|
|
|
74434
74434
|
}
|
|
74435
74435
|
}
|
|
74436
74436
|
if (stmt.finalizer) {
|
|
74437
|
-
result =
|
|
74437
|
+
result = join26(result, ["finally", this.maybeBlock(stmt.finalizer, S_TFFF)]);
|
|
74438
74438
|
}
|
|
74439
74439
|
return result;
|
|
74440
74440
|
},
|
|
@@ -74468,7 +74468,7 @@ var require_escodegen = __commonJS({
|
|
|
74468
74468
|
withIndent(function() {
|
|
74469
74469
|
if (stmt.test) {
|
|
74470
74470
|
result = [
|
|
74471
|
-
|
|
74471
|
+
join26("case", that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)),
|
|
74472
74472
|
":"
|
|
74473
74473
|
];
|
|
74474
74474
|
} else {
|
|
@@ -74516,9 +74516,9 @@ var require_escodegen = __commonJS({
|
|
|
74516
74516
|
result.push(this.maybeBlock(stmt.consequent, S_TFFF));
|
|
74517
74517
|
result = this.maybeBlockSuffix(stmt.consequent, result);
|
|
74518
74518
|
if (stmt.alternate.type === Syntax.IfStatement) {
|
|
74519
|
-
result =
|
|
74519
|
+
result = join26(result, ["else ", this.generateStatement(stmt.alternate, bodyFlags)]);
|
|
74520
74520
|
} else {
|
|
74521
|
-
result =
|
|
74521
|
+
result = join26(result, join26("else", this.maybeBlock(stmt.alternate, bodyFlags)));
|
|
74522
74522
|
}
|
|
74523
74523
|
} else {
|
|
74524
74524
|
result.push(this.maybeBlock(stmt.consequent, bodyFlags));
|
|
@@ -74619,7 +74619,7 @@ var require_escodegen = __commonJS({
|
|
|
74619
74619
|
},
|
|
74620
74620
|
ReturnStatement: function(stmt, flags) {
|
|
74621
74621
|
if (stmt.argument) {
|
|
74622
|
-
return [
|
|
74622
|
+
return [join26(
|
|
74623
74623
|
"return",
|
|
74624
74624
|
this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)
|
|
74625
74625
|
), this.semicolon(flags)];
|
|
@@ -74708,14 +74708,14 @@ var require_escodegen = __commonJS({
|
|
|
74708
74708
|
if (leftSource.charCodeAt(leftSource.length - 1) === 47 && esutils.code.isIdentifierPartES5(expr.operator.charCodeAt(0))) {
|
|
74709
74709
|
result = [fragment, noEmptySpace(), expr.operator];
|
|
74710
74710
|
} else {
|
|
74711
|
-
result =
|
|
74711
|
+
result = join26(fragment, expr.operator);
|
|
74712
74712
|
}
|
|
74713
74713
|
fragment = this.generateExpression(expr.right, rightPrecedence, flags);
|
|
74714
74714
|
if (expr.operator === "/" && fragment.toString().charAt(0) === "/" || expr.operator.slice(-1) === "<" && fragment.toString().slice(0, 3) === "!--") {
|
|
74715
74715
|
result.push(noEmptySpace());
|
|
74716
74716
|
result.push(fragment);
|
|
74717
74717
|
} else {
|
|
74718
|
-
result =
|
|
74718
|
+
result = join26(result, fragment);
|
|
74719
74719
|
}
|
|
74720
74720
|
if (expr.operator === "in" && !(flags & F_ALLOW_IN)) {
|
|
74721
74721
|
return ["(", result, ")"];
|
|
@@ -74755,7 +74755,7 @@ var require_escodegen = __commonJS({
|
|
|
74755
74755
|
var result, length, i, iz, itemFlags;
|
|
74756
74756
|
length = expr["arguments"].length;
|
|
74757
74757
|
itemFlags = flags & F_ALLOW_UNPARATH_NEW && !parentheses && length === 0 ? E_TFT : E_TFF;
|
|
74758
|
-
result =
|
|
74758
|
+
result = join26(
|
|
74759
74759
|
"new",
|
|
74760
74760
|
this.generateExpression(expr.callee, Precedence.New, itemFlags)
|
|
74761
74761
|
);
|
|
@@ -74805,11 +74805,11 @@ var require_escodegen = __commonJS({
|
|
|
74805
74805
|
var result, fragment, rightCharCode, leftSource, leftCharCode;
|
|
74806
74806
|
fragment = this.generateExpression(expr.argument, Precedence.Unary, E_TTT);
|
|
74807
74807
|
if (space === "") {
|
|
74808
|
-
result =
|
|
74808
|
+
result = join26(expr.operator, fragment);
|
|
74809
74809
|
} else {
|
|
74810
74810
|
result = [expr.operator];
|
|
74811
74811
|
if (expr.operator.length > 2) {
|
|
74812
|
-
result =
|
|
74812
|
+
result = join26(result, fragment);
|
|
74813
74813
|
} else {
|
|
74814
74814
|
leftSource = toSourceNodeWhenNeeded(result).toString();
|
|
74815
74815
|
leftCharCode = leftSource.charCodeAt(leftSource.length - 1);
|
|
@@ -74832,7 +74832,7 @@ var require_escodegen = __commonJS({
|
|
|
74832
74832
|
result = "yield";
|
|
74833
74833
|
}
|
|
74834
74834
|
if (expr.argument) {
|
|
74835
|
-
result =
|
|
74835
|
+
result = join26(
|
|
74836
74836
|
result,
|
|
74837
74837
|
this.generateExpression(expr.argument, Precedence.Yield, E_TTT)
|
|
74838
74838
|
);
|
|
@@ -74840,7 +74840,7 @@ var require_escodegen = __commonJS({
|
|
|
74840
74840
|
return parenthesize(result, Precedence.Yield, precedence);
|
|
74841
74841
|
},
|
|
74842
74842
|
AwaitExpression: function(expr, precedence, flags) {
|
|
74843
|
-
var result =
|
|
74843
|
+
var result = join26(
|
|
74844
74844
|
expr.all ? "await*" : "await",
|
|
74845
74845
|
this.generateExpression(expr.argument, Precedence.Await, E_TTT)
|
|
74846
74846
|
);
|
|
@@ -74923,11 +74923,11 @@ var require_escodegen = __commonJS({
|
|
|
74923
74923
|
var result, fragment;
|
|
74924
74924
|
result = ["class"];
|
|
74925
74925
|
if (expr.id) {
|
|
74926
|
-
result =
|
|
74926
|
+
result = join26(result, this.generateExpression(expr.id, Precedence.Sequence, E_TTT));
|
|
74927
74927
|
}
|
|
74928
74928
|
if (expr.superClass) {
|
|
74929
|
-
fragment =
|
|
74930
|
-
result =
|
|
74929
|
+
fragment = join26("extends", this.generateExpression(expr.superClass, Precedence.Unary, E_TTT));
|
|
74930
|
+
result = join26(result, fragment);
|
|
74931
74931
|
}
|
|
74932
74932
|
result.push(space);
|
|
74933
74933
|
result.push(this.generateStatement(expr.body, S_TFFT));
|
|
@@ -74942,7 +74942,7 @@ var require_escodegen = __commonJS({
|
|
|
74942
74942
|
}
|
|
74943
74943
|
if (expr.kind === "get" || expr.kind === "set") {
|
|
74944
74944
|
fragment = [
|
|
74945
|
-
|
|
74945
|
+
join26(expr.kind, this.generatePropertyKey(expr.key, expr.computed)),
|
|
74946
74946
|
this.generateFunctionBody(expr.value)
|
|
74947
74947
|
];
|
|
74948
74948
|
} else {
|
|
@@ -74952,7 +74952,7 @@ var require_escodegen = __commonJS({
|
|
|
74952
74952
|
this.generateFunctionBody(expr.value)
|
|
74953
74953
|
];
|
|
74954
74954
|
}
|
|
74955
|
-
return
|
|
74955
|
+
return join26(result, fragment);
|
|
74956
74956
|
},
|
|
74957
74957
|
Property: function(expr, precedence, flags) {
|
|
74958
74958
|
if (expr.kind === "get" || expr.kind === "set") {
|
|
@@ -75147,7 +75147,7 @@ var require_escodegen = __commonJS({
|
|
|
75147
75147
|
for (i = 0, iz = expr.blocks.length; i < iz; ++i) {
|
|
75148
75148
|
fragment = that.generateExpression(expr.blocks[i], Precedence.Sequence, E_TTT);
|
|
75149
75149
|
if (i > 0 || extra.moz.comprehensionExpressionStartsWithAssignment) {
|
|
75150
|
-
result =
|
|
75150
|
+
result = join26(result, fragment);
|
|
75151
75151
|
} else {
|
|
75152
75152
|
result.push(fragment);
|
|
75153
75153
|
}
|
|
@@ -75155,13 +75155,13 @@ var require_escodegen = __commonJS({
|
|
|
75155
75155
|
});
|
|
75156
75156
|
}
|
|
75157
75157
|
if (expr.filter) {
|
|
75158
|
-
result =
|
|
75158
|
+
result = join26(result, "if" + space);
|
|
75159
75159
|
fragment = this.generateExpression(expr.filter, Precedence.Sequence, E_TTT);
|
|
75160
|
-
result =
|
|
75160
|
+
result = join26(result, ["(", fragment, ")"]);
|
|
75161
75161
|
}
|
|
75162
75162
|
if (!extra.moz.comprehensionExpressionStartsWithAssignment) {
|
|
75163
75163
|
fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT);
|
|
75164
|
-
result =
|
|
75164
|
+
result = join26(result, fragment);
|
|
75165
75165
|
}
|
|
75166
75166
|
result.push(expr.type === Syntax.GeneratorExpression ? ")" : "]");
|
|
75167
75167
|
return result;
|
|
@@ -75177,8 +75177,8 @@ var require_escodegen = __commonJS({
|
|
|
75177
75177
|
} else {
|
|
75178
75178
|
fragment = this.generateExpression(expr.left, Precedence.Call, E_TTT);
|
|
75179
75179
|
}
|
|
75180
|
-
fragment =
|
|
75181
|
-
fragment =
|
|
75180
|
+
fragment = join26(fragment, expr.of ? "of" : "in");
|
|
75181
|
+
fragment = join26(fragment, this.generateExpression(expr.right, Precedence.Sequence, E_TTT));
|
|
75182
75182
|
return ["for" + space + "(", fragment, ")"];
|
|
75183
75183
|
},
|
|
75184
75184
|
SpreadElement: function(expr, precedence, flags) {
|
|
@@ -81708,11 +81708,11 @@ function __metadata(metadataKey, metadataValue) {
|
|
|
81708
81708
|
}
|
|
81709
81709
|
function __awaiter2(thisArg, _arguments, P, generator) {
|
|
81710
81710
|
function adopt(value) {
|
|
81711
|
-
return value instanceof P ? value : new P(function(
|
|
81712
|
-
|
|
81711
|
+
return value instanceof P ? value : new P(function(resolve46) {
|
|
81712
|
+
resolve46(value);
|
|
81713
81713
|
});
|
|
81714
81714
|
}
|
|
81715
|
-
return new (P || (P = Promise))(function(
|
|
81715
|
+
return new (P || (P = Promise))(function(resolve46, reject) {
|
|
81716
81716
|
function fulfilled(value) {
|
|
81717
81717
|
try {
|
|
81718
81718
|
step(generator.next(value));
|
|
@@ -81728,7 +81728,7 @@ function __awaiter2(thisArg, _arguments, P, generator) {
|
|
|
81728
81728
|
}
|
|
81729
81729
|
}
|
|
81730
81730
|
function step(result) {
|
|
81731
|
-
result.done ?
|
|
81731
|
+
result.done ? resolve46(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
81732
81732
|
}
|
|
81733
81733
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
81734
81734
|
});
|
|
@@ -81919,14 +81919,14 @@ function __asyncValues2(o) {
|
|
|
81919
81919
|
}, i);
|
|
81920
81920
|
function verb(n) {
|
|
81921
81921
|
i[n] = o[n] && function(v) {
|
|
81922
|
-
return new Promise(function(
|
|
81923
|
-
v = o[n](v), settle(
|
|
81922
|
+
return new Promise(function(resolve46, reject) {
|
|
81923
|
+
v = o[n](v), settle(resolve46, reject, v.done, v.value);
|
|
81924
81924
|
});
|
|
81925
81925
|
};
|
|
81926
81926
|
}
|
|
81927
|
-
function settle(
|
|
81927
|
+
function settle(resolve46, reject, d, v) {
|
|
81928
81928
|
Promise.resolve(v).then(function(v2) {
|
|
81929
|
-
|
|
81929
|
+
resolve46({ value: v2, done: d });
|
|
81930
81930
|
}, reject);
|
|
81931
81931
|
}
|
|
81932
81932
|
}
|
|
@@ -85479,12 +85479,12 @@ var require_util4 = __commonJS({
|
|
|
85479
85479
|
exports.isGMT = exports.dnsLookup = void 0;
|
|
85480
85480
|
var dns_1 = __require("dns");
|
|
85481
85481
|
function dnsLookup(host, opts) {
|
|
85482
|
-
return new Promise((
|
|
85482
|
+
return new Promise((resolve46, reject) => {
|
|
85483
85483
|
(0, dns_1.lookup)(host, opts, (err, res) => {
|
|
85484
85484
|
if (err) {
|
|
85485
85485
|
reject(err);
|
|
85486
85486
|
} else {
|
|
85487
|
-
|
|
85487
|
+
resolve46(res);
|
|
85488
85488
|
}
|
|
85489
85489
|
});
|
|
85490
85490
|
});
|
|
@@ -86089,10 +86089,10 @@ var require_myIpAddress = __commonJS({
|
|
|
86089
86089
|
var ip_1 = require_ip();
|
|
86090
86090
|
var net_1 = __importDefault3(__require("net"));
|
|
86091
86091
|
async function myIpAddress() {
|
|
86092
|
-
return new Promise((
|
|
86092
|
+
return new Promise((resolve46, reject) => {
|
|
86093
86093
|
const socket = net_1.default.connect({ host: "8.8.8.8", port: 53 });
|
|
86094
86094
|
const onError = () => {
|
|
86095
|
-
|
|
86095
|
+
resolve46(ip_1.ip.address());
|
|
86096
86096
|
};
|
|
86097
86097
|
socket.once("error", onError);
|
|
86098
86098
|
socket.once("connect", () => {
|
|
@@ -86100,9 +86100,9 @@ var require_myIpAddress = __commonJS({
|
|
|
86100
86100
|
const addr = socket.address();
|
|
86101
86101
|
socket.destroy();
|
|
86102
86102
|
if (typeof addr === "string") {
|
|
86103
|
-
|
|
86103
|
+
resolve46(addr);
|
|
86104
86104
|
} else if (addr.address) {
|
|
86105
|
-
|
|
86105
|
+
resolve46(addr.address);
|
|
86106
86106
|
} else {
|
|
86107
86107
|
reject(new Error("Expected a `string`"));
|
|
86108
86108
|
}
|
|
@@ -86680,8 +86680,8 @@ var require_deferred_promise = __commonJS({
|
|
|
86680
86680
|
this.context = args.context;
|
|
86681
86681
|
this.owner = args.context.runtime;
|
|
86682
86682
|
this.handle = args.promiseHandle;
|
|
86683
|
-
this.settled = new Promise((
|
|
86684
|
-
this.onSettled =
|
|
86683
|
+
this.settled = new Promise((resolve46) => {
|
|
86684
|
+
this.onSettled = resolve46;
|
|
86685
86685
|
});
|
|
86686
86686
|
this.resolveHandle = args.resolveHandle;
|
|
86687
86687
|
this.rejectHandle = args.rejectHandle;
|
|
@@ -87202,13 +87202,13 @@ var require_context = __commonJS({
|
|
|
87202
87202
|
if (vmResolveResult.error) {
|
|
87203
87203
|
return Promise.resolve(vmResolveResult);
|
|
87204
87204
|
}
|
|
87205
|
-
return new Promise((
|
|
87205
|
+
return new Promise((resolve46) => {
|
|
87206
87206
|
lifetime_1.Scope.withScope((scope) => {
|
|
87207
87207
|
const resolveHandle = scope.manage(this.newFunction("resolve", (value) => {
|
|
87208
|
-
|
|
87208
|
+
resolve46({ value: value && value.dup() });
|
|
87209
87209
|
}));
|
|
87210
87210
|
const rejectHandle = scope.manage(this.newFunction("reject", (error) => {
|
|
87211
|
-
|
|
87211
|
+
resolve46({ error: error && error.dup() });
|
|
87212
87212
|
}));
|
|
87213
87213
|
const promiseHandle = scope.manage(vmResolveResult.value);
|
|
87214
87214
|
const promiseThenHandle = scope.manage(this.getProp(promiseHandle, "then"));
|
|
@@ -89583,13 +89583,13 @@ import * as http from "node:http";
|
|
|
89583
89583
|
import * as https from "node:https";
|
|
89584
89584
|
import { URL as URL2, urlToHttpOptions } from "node:url";
|
|
89585
89585
|
function headHttpRequest(url) {
|
|
89586
|
-
return new Promise((
|
|
89586
|
+
return new Promise((resolve46) => {
|
|
89587
89587
|
const request5 = httpRequest(url, "HEAD", (response) => {
|
|
89588
89588
|
response.resume();
|
|
89589
|
-
|
|
89589
|
+
resolve46(response.statusCode === 200);
|
|
89590
89590
|
}, false);
|
|
89591
89591
|
request5.on("error", () => {
|
|
89592
|
-
|
|
89592
|
+
resolve46(false);
|
|
89593
89593
|
});
|
|
89594
89594
|
});
|
|
89595
89595
|
}
|
|
@@ -89617,7 +89617,7 @@ function httpRequest(url, method, response, keepAlive = true) {
|
|
|
89617
89617
|
return request5;
|
|
89618
89618
|
}
|
|
89619
89619
|
function downloadFile(url, destinationPath, progressCallback) {
|
|
89620
|
-
return new Promise((
|
|
89620
|
+
return new Promise((resolve46, reject) => {
|
|
89621
89621
|
let downloadedBytes = 0;
|
|
89622
89622
|
let totalBytes = 0;
|
|
89623
89623
|
function onData(chunk) {
|
|
@@ -89633,7 +89633,7 @@ function downloadFile(url, destinationPath, progressCallback) {
|
|
|
89633
89633
|
}
|
|
89634
89634
|
const file = createWriteStream(destinationPath);
|
|
89635
89635
|
file.on("close", () => {
|
|
89636
|
-
return
|
|
89636
|
+
return resolve46();
|
|
89637
89637
|
});
|
|
89638
89638
|
file.on("error", (error) => {
|
|
89639
89639
|
return reject(error);
|
|
@@ -89658,7 +89658,7 @@ async function getJSON(url) {
|
|
|
89658
89658
|
}
|
|
89659
89659
|
}
|
|
89660
89660
|
function getText(url) {
|
|
89661
|
-
return new Promise((
|
|
89661
|
+
return new Promise((resolve46, reject) => {
|
|
89662
89662
|
const request5 = httpRequest(url, "GET", (response) => {
|
|
89663
89663
|
let data = "";
|
|
89664
89664
|
if (response.statusCode && response.statusCode >= 400) {
|
|
@@ -89669,7 +89669,7 @@ function getText(url) {
|
|
|
89669
89669
|
});
|
|
89670
89670
|
response.on("end", () => {
|
|
89671
89671
|
try {
|
|
89672
|
-
return
|
|
89672
|
+
return resolve46(String(data));
|
|
89673
89673
|
} catch {
|
|
89674
89674
|
return reject(new Error(`Failed to read text response from ${url}`));
|
|
89675
89675
|
}
|
|
@@ -91061,7 +91061,7 @@ var init_launch = __esm({
|
|
|
91061
91061
|
if (opts.onExit) {
|
|
91062
91062
|
this.#onExitHook = opts.onExit;
|
|
91063
91063
|
}
|
|
91064
|
-
this.#browserProcessExiting = new Promise((
|
|
91064
|
+
this.#browserProcessExiting = new Promise((resolve46, reject) => {
|
|
91065
91065
|
this.#browserProcess.once("exit", async () => {
|
|
91066
91066
|
debugLaunch(`Browser process ${this.#browserProcess.pid} onExit`);
|
|
91067
91067
|
this.#clearListeners();
|
|
@@ -91072,7 +91072,7 @@ var init_launch = __esm({
|
|
|
91072
91072
|
reject(err);
|
|
91073
91073
|
return;
|
|
91074
91074
|
}
|
|
91075
|
-
|
|
91075
|
+
resolve46();
|
|
91076
91076
|
});
|
|
91077
91077
|
});
|
|
91078
91078
|
}
|
|
@@ -91188,7 +91188,7 @@ Error cause: ${isErrorLike2(error) ? error.stack : error}`);
|
|
|
91188
91188
|
return [...this.#logs];
|
|
91189
91189
|
}
|
|
91190
91190
|
waitForLineOutput(regex2, timeout3 = 0) {
|
|
91191
|
-
return new Promise((
|
|
91191
|
+
return new Promise((resolve46, reject) => {
|
|
91192
91192
|
const onClose = (errorOrCode) => {
|
|
91193
91193
|
cleanup();
|
|
91194
91194
|
reject(new Error([
|
|
@@ -91224,7 +91224,7 @@ Error cause: ${isErrorLike2(error) ? error.stack : error}`);
|
|
|
91224
91224
|
return;
|
|
91225
91225
|
}
|
|
91226
91226
|
cleanup();
|
|
91227
|
-
|
|
91227
|
+
resolve46(match2[1]);
|
|
91228
91228
|
}
|
|
91229
91229
|
});
|
|
91230
91230
|
}
|
|
@@ -91693,7 +91693,7 @@ var require_get_stream = __commonJS({
|
|
|
91693
91693
|
};
|
|
91694
91694
|
const { maxBuffer } = options;
|
|
91695
91695
|
let stream;
|
|
91696
|
-
await new Promise((
|
|
91696
|
+
await new Promise((resolve46, reject) => {
|
|
91697
91697
|
const rejectPromise = (error) => {
|
|
91698
91698
|
if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
|
|
91699
91699
|
error.bufferedData = stream.getBufferedValue();
|
|
@@ -91705,7 +91705,7 @@ var require_get_stream = __commonJS({
|
|
|
91705
91705
|
rejectPromise(error);
|
|
91706
91706
|
return;
|
|
91707
91707
|
}
|
|
91708
|
-
|
|
91708
|
+
resolve46();
|
|
91709
91709
|
});
|
|
91710
91710
|
stream.on("data", () => {
|
|
91711
91711
|
if (stream.getBufferedLength() > maxBuffer) {
|
|
@@ -92994,7 +92994,7 @@ var require_extract_zip = __commonJS({
|
|
|
92994
92994
|
debug7("opening", this.zipPath, "with opts", this.opts);
|
|
92995
92995
|
this.zipfile = await openZip(this.zipPath, { lazyEntries: true });
|
|
92996
92996
|
this.canceled = false;
|
|
92997
|
-
return new Promise((
|
|
92997
|
+
return new Promise((resolve46, reject) => {
|
|
92998
92998
|
this.zipfile.on("error", (err) => {
|
|
92999
92999
|
this.canceled = true;
|
|
93000
93000
|
reject(err);
|
|
@@ -93003,7 +93003,7 @@ var require_extract_zip = __commonJS({
|
|
|
93003
93003
|
this.zipfile.on("close", () => {
|
|
93004
93004
|
if (!this.canceled) {
|
|
93005
93005
|
debug7("zip extraction complete");
|
|
93006
|
-
|
|
93006
|
+
resolve46();
|
|
93007
93007
|
}
|
|
93008
93008
|
});
|
|
93009
93009
|
this.zipfile.on("entry", async (entry) => {
|
|
@@ -94260,8 +94260,8 @@ var require_streamx = __commonJS({
|
|
|
94260
94260
|
return this;
|
|
94261
94261
|
},
|
|
94262
94262
|
next() {
|
|
94263
|
-
return new Promise(function(
|
|
94264
|
-
promiseResolve =
|
|
94263
|
+
return new Promise(function(resolve46, reject) {
|
|
94264
|
+
promiseResolve = resolve46;
|
|
94265
94265
|
promiseReject = reject;
|
|
94266
94266
|
const data = stream.read();
|
|
94267
94267
|
if (data !== null) ondata(data);
|
|
@@ -94291,11 +94291,11 @@ var require_streamx = __commonJS({
|
|
|
94291
94291
|
}
|
|
94292
94292
|
function destroy(err) {
|
|
94293
94293
|
stream.destroy(err);
|
|
94294
|
-
return new Promise((
|
|
94295
|
-
if (stream._duplexState & DESTROYED) return
|
|
94294
|
+
return new Promise((resolve46, reject) => {
|
|
94295
|
+
if (stream._duplexState & DESTROYED) return resolve46({ value: void 0, done: true });
|
|
94296
94296
|
stream.once("close", function() {
|
|
94297
94297
|
if (err) reject(err);
|
|
94298
|
-
else
|
|
94298
|
+
else resolve46({ value: void 0, done: true });
|
|
94299
94299
|
});
|
|
94300
94300
|
});
|
|
94301
94301
|
}
|
|
@@ -94339,8 +94339,8 @@ var require_streamx = __commonJS({
|
|
|
94339
94339
|
const writes = pending + (ws._duplexState & WRITE_WRITING ? 1 : 0);
|
|
94340
94340
|
if (writes === 0) return Promise.resolve(true);
|
|
94341
94341
|
if (state.drains === null) state.drains = [];
|
|
94342
|
-
return new Promise((
|
|
94343
|
-
state.drains.push({ writes, resolve:
|
|
94342
|
+
return new Promise((resolve46) => {
|
|
94343
|
+
state.drains.push({ writes, resolve: resolve46 });
|
|
94344
94344
|
});
|
|
94345
94345
|
}
|
|
94346
94346
|
write(data) {
|
|
@@ -94445,10 +94445,10 @@ var require_streamx = __commonJS({
|
|
|
94445
94445
|
cb(null);
|
|
94446
94446
|
}
|
|
94447
94447
|
function pipelinePromise(...streams) {
|
|
94448
|
-
return new Promise((
|
|
94448
|
+
return new Promise((resolve46, reject) => {
|
|
94449
94449
|
return pipeline(...streams, (err) => {
|
|
94450
94450
|
if (err) return reject(err);
|
|
94451
|
-
|
|
94451
|
+
resolve46();
|
|
94452
94452
|
});
|
|
94453
94453
|
});
|
|
94454
94454
|
}
|
|
@@ -95103,16 +95103,16 @@ var require_extract = __commonJS({
|
|
|
95103
95103
|
entryCallback = null;
|
|
95104
95104
|
cb(err);
|
|
95105
95105
|
}
|
|
95106
|
-
function onnext(
|
|
95106
|
+
function onnext(resolve46, reject) {
|
|
95107
95107
|
if (error) {
|
|
95108
95108
|
return reject(error);
|
|
95109
95109
|
}
|
|
95110
95110
|
if (entryStream) {
|
|
95111
|
-
|
|
95111
|
+
resolve46({ value: entryStream, done: false });
|
|
95112
95112
|
entryStream = null;
|
|
95113
95113
|
return;
|
|
95114
95114
|
}
|
|
95115
|
-
promiseResolve =
|
|
95115
|
+
promiseResolve = resolve46;
|
|
95116
95116
|
promiseReject = reject;
|
|
95117
95117
|
consumeCallback(null);
|
|
95118
95118
|
if (extract._finished && promiseResolve) {
|
|
@@ -95140,11 +95140,11 @@ var require_extract = __commonJS({
|
|
|
95140
95140
|
function destroy(err) {
|
|
95141
95141
|
extract.destroy(err);
|
|
95142
95142
|
consumeCallback(err);
|
|
95143
|
-
return new Promise((
|
|
95144
|
-
if (extract.destroyed) return
|
|
95143
|
+
return new Promise((resolve46, reject) => {
|
|
95144
|
+
if (extract.destroyed) return resolve46({ value: void 0, done: true });
|
|
95145
95145
|
extract.once("close", function() {
|
|
95146
95146
|
if (err) reject(err);
|
|
95147
|
-
else
|
|
95147
|
+
else resolve46({ value: void 0, done: true });
|
|
95148
95148
|
});
|
|
95149
95149
|
});
|
|
95150
95150
|
}
|
|
@@ -100120,12 +100120,12 @@ var init_yargs_factory = __esm({
|
|
|
100120
100120
|
async getCompletion(args, done) {
|
|
100121
100121
|
argsert("<array> [function]", [args, done], arguments.length);
|
|
100122
100122
|
if (!done) {
|
|
100123
|
-
return new Promise((
|
|
100123
|
+
return new Promise((resolve46, reject) => {
|
|
100124
100124
|
__classPrivateFieldGet2(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => {
|
|
100125
100125
|
if (err)
|
|
100126
100126
|
reject(err);
|
|
100127
100127
|
else
|
|
100128
|
-
|
|
100128
|
+
resolve46(completions);
|
|
100129
100129
|
});
|
|
100130
100130
|
});
|
|
100131
100131
|
} else {
|
|
@@ -101580,9 +101580,9 @@ async function getConnectionTransport(options) {
|
|
|
101580
101580
|
throw new Error("Could not detect required browser platform");
|
|
101581
101581
|
}
|
|
101582
101582
|
const { convertPuppeteerChannelToBrowsersChannel: convertPuppeteerChannelToBrowsersChannel3 } = await Promise.resolve().then(() => (init_LaunchOptions(), LaunchOptions_exports));
|
|
101583
|
-
const { join:
|
|
101583
|
+
const { join: join26 } = await import("node:path");
|
|
101584
101584
|
const userDataDir = resolveDefaultUserDataDir4(Browser5.CHROME, platform, convertPuppeteerChannelToBrowsersChannel3(options.channel));
|
|
101585
|
-
const portPath =
|
|
101585
|
+
const portPath = join26(userDataDir, "DevToolsActivePort");
|
|
101586
101586
|
try {
|
|
101587
101587
|
const fileContent = await environment.value.fs.promises.readFile(portPath, "ascii");
|
|
101588
101588
|
const [rawPort, rawPath] = fileContent.split("\n").map((line) => {
|
|
@@ -102927,8 +102927,8 @@ var init_ScreenRecorder = __esm({
|
|
|
102927
102927
|
static {
|
|
102928
102928
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
102929
102929
|
__esDecorate23(this, _private_writeFrame_descriptor = { value: __setFunctionName6(async function(buffer) {
|
|
102930
|
-
const error = await new Promise((
|
|
102931
|
-
this.#process.stdin.write(buffer,
|
|
102930
|
+
const error = await new Promise((resolve46) => {
|
|
102931
|
+
this.#process.stdin.write(buffer, resolve46);
|
|
102932
102932
|
});
|
|
102933
102933
|
if (error) {
|
|
102934
102934
|
console.log(`ffmpeg failed to write: ${error.message}.`);
|
|
@@ -103118,8 +103118,8 @@ var init_ScreenRecorder = __esm({
|
|
|
103118
103118
|
const [buffer, timestamp] = await this.#lastFrame;
|
|
103119
103119
|
await Promise.all(Array(Math.max(1, Math.round(this.#fps * (performance.now() - timestamp) / 1e3))).fill(buffer).map(this.#writeFrame.bind(this)));
|
|
103120
103120
|
this.#process.stdin.end();
|
|
103121
|
-
await new Promise((
|
|
103122
|
-
this.#process.once("close",
|
|
103121
|
+
await new Promise((resolve46) => {
|
|
103122
|
+
this.#process.once("close", resolve46);
|
|
103123
103123
|
});
|
|
103124
103124
|
}
|
|
103125
103125
|
/**
|
|
@@ -109127,7 +109127,7 @@ var require_typescript2 = __commonJS({
|
|
|
109127
109127
|
walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild,
|
|
109128
109128
|
whitespaceOrMapCommentRegExp: () => whitespaceOrMapCommentRegExp,
|
|
109129
109129
|
writeCommentRange: () => writeCommentRange,
|
|
109130
|
-
writeFile: () =>
|
|
109130
|
+
writeFile: () => writeFile28,
|
|
109131
109131
|
writeFileEnsuringDirectories: () => writeFileEnsuringDirectories,
|
|
109132
109132
|
zipWith: () => zipWith
|
|
109133
109133
|
});
|
|
@@ -115459,8 +115459,8 @@ ${lanes.join("\n")}
|
|
|
115459
115459
|
writeOutputIsTTY() {
|
|
115460
115460
|
return process.stdout.isTTY;
|
|
115461
115461
|
},
|
|
115462
|
-
readFile:
|
|
115463
|
-
writeFile:
|
|
115462
|
+
readFile: readFile28,
|
|
115463
|
+
writeFile: writeFile29,
|
|
115464
115464
|
watchFile: watchFile2,
|
|
115465
115465
|
watchDirectory,
|
|
115466
115466
|
preferNonRecursiveWatch: !fsSupportsRecursiveFsWatch,
|
|
@@ -115665,7 +115665,7 @@ ${lanes.join("\n")}
|
|
|
115665
115665
|
callback
|
|
115666
115666
|
);
|
|
115667
115667
|
}
|
|
115668
|
-
function
|
|
115668
|
+
function readFile28(fileName, _encoding) {
|
|
115669
115669
|
let buffer;
|
|
115670
115670
|
try {
|
|
115671
115671
|
buffer = _fs.readFileSync(fileName);
|
|
@@ -115690,7 +115690,7 @@ ${lanes.join("\n")}
|
|
|
115690
115690
|
}
|
|
115691
115691
|
return buffer.toString("utf8");
|
|
115692
115692
|
}
|
|
115693
|
-
function
|
|
115693
|
+
function writeFile29(fileName, data, writeByteOrderMark) {
|
|
115694
115694
|
if (writeByteOrderMark) {
|
|
115695
115695
|
data = byteOrderMarkIndicator + data;
|
|
115696
115696
|
}
|
|
@@ -127770,7 +127770,7 @@ ${lanes.join("\n")}
|
|
|
127770
127770
|
sourceFilePath = isSourceFileInCommonSourceDirectory ? sourceFilePath.substring(commonSourceDirectory.length) : sourceFilePath;
|
|
127771
127771
|
return combinePaths(newDirPath, sourceFilePath);
|
|
127772
127772
|
}
|
|
127773
|
-
function
|
|
127773
|
+
function writeFile28(host, diagnostics, fileName, text, writeByteOrderMark, sourceFiles, data) {
|
|
127774
127774
|
host.writeFile(
|
|
127775
127775
|
fileName,
|
|
127776
127776
|
text,
|
|
@@ -127789,12 +127789,12 @@ ${lanes.join("\n")}
|
|
|
127789
127789
|
createDirectory(directoryPath);
|
|
127790
127790
|
}
|
|
127791
127791
|
}
|
|
127792
|
-
function writeFileEnsuringDirectories(path14, data, writeByteOrderMark,
|
|
127792
|
+
function writeFileEnsuringDirectories(path14, data, writeByteOrderMark, writeFile29, createDirectory, directoryExists) {
|
|
127793
127793
|
try {
|
|
127794
|
-
|
|
127794
|
+
writeFile29(path14, data, writeByteOrderMark);
|
|
127795
127795
|
} catch {
|
|
127796
127796
|
ensureDirectoriesExist(getDirectoryPath(normalizePath(path14)), createDirectory, directoryExists);
|
|
127797
|
-
|
|
127797
|
+
writeFile29(path14, data, writeByteOrderMark);
|
|
127798
127798
|
}
|
|
127799
127799
|
}
|
|
127800
127800
|
function getLineOfLocalPosition(sourceFile, pos) {
|
|
@@ -131983,8 +131983,8 @@ ${lanes.join("\n")}
|
|
|
131983
131983
|
return 0;
|
|
131984
131984
|
}
|
|
131985
131985
|
function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
|
|
131986
|
-
const
|
|
131987
|
-
if (
|
|
131986
|
+
const skipped2 = skipPartiallyEmittedExpressions(operand);
|
|
131987
|
+
if (skipped2.kind === 218) {
|
|
131988
131988
|
return operand;
|
|
131989
131989
|
}
|
|
131990
131990
|
return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) ? factory2.createParenthesizedExpression(operand) : operand;
|
|
@@ -152221,7 +152221,7 @@ ${lanes.join("\n")}
|
|
|
152221
152221
|
const possibleOption = getSpellingSuggestion(unknownOption, diagnostics.optionDeclarations, getOptionName);
|
|
152222
152222
|
return possibleOption ? createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownDidYouMeanDiagnostic, unknownOptionErrorText || unknownOption, possibleOption.name) : createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownOptionDiagnostic, unknownOptionErrorText || unknownOption);
|
|
152223
152223
|
}
|
|
152224
|
-
function parseCommandLineWorker(diagnostics, commandLine,
|
|
152224
|
+
function parseCommandLineWorker(diagnostics, commandLine, readFile28) {
|
|
152225
152225
|
const options = {};
|
|
152226
152226
|
let watchOptions;
|
|
152227
152227
|
const fileNames = [];
|
|
@@ -152269,7 +152269,7 @@ ${lanes.join("\n")}
|
|
|
152269
152269
|
}
|
|
152270
152270
|
}
|
|
152271
152271
|
function parseResponseFile(fileName) {
|
|
152272
|
-
const text = tryReadFile(fileName,
|
|
152272
|
+
const text = tryReadFile(fileName, readFile28 || ((fileName2) => sys.readFile(fileName2)));
|
|
152273
152273
|
if (!isString3(text)) {
|
|
152274
152274
|
errors.push(text);
|
|
152275
152275
|
return;
|
|
@@ -152372,8 +152372,8 @@ ${lanes.join("\n")}
|
|
|
152372
152372
|
unknownDidYouMeanDiagnostic: Diagnostics.Unknown_compiler_option_0_Did_you_mean_1,
|
|
152373
152373
|
optionTypeMismatchDiagnostic: Diagnostics.Compiler_option_0_expects_an_argument
|
|
152374
152374
|
};
|
|
152375
|
-
function parseCommandLine(commandLine,
|
|
152376
|
-
return parseCommandLineWorker(compilerOptionsDidYouMeanDiagnostics, commandLine,
|
|
152375
|
+
function parseCommandLine(commandLine, readFile28) {
|
|
152376
|
+
return parseCommandLineWorker(compilerOptionsDidYouMeanDiagnostics, commandLine, readFile28);
|
|
152377
152377
|
}
|
|
152378
152378
|
function getOptionFromName(optionName, allowShort) {
|
|
152379
152379
|
return getOptionDeclarationFromName(getOptionsNameMap, optionName, allowShort);
|
|
@@ -152455,8 +152455,8 @@ ${lanes.join("\n")}
|
|
|
152455
152455
|
watchOptionsToExtend
|
|
152456
152456
|
);
|
|
152457
152457
|
}
|
|
152458
|
-
function readConfigFile(fileName,
|
|
152459
|
-
const textOrDiagnostic = tryReadFile(fileName,
|
|
152458
|
+
function readConfigFile(fileName, readFile28) {
|
|
152459
|
+
const textOrDiagnostic = tryReadFile(fileName, readFile28);
|
|
152460
152460
|
return isString3(textOrDiagnostic) ? parseConfigFileTextToJson(fileName, textOrDiagnostic) : { config: {}, error: textOrDiagnostic };
|
|
152461
152461
|
}
|
|
152462
152462
|
function parseConfigFileTextToJson(fileName, jsonText) {
|
|
@@ -152471,14 +152471,14 @@ ${lanes.join("\n")}
|
|
|
152471
152471
|
error: jsonSourceFile.parseDiagnostics.length ? jsonSourceFile.parseDiagnostics[0] : void 0
|
|
152472
152472
|
};
|
|
152473
152473
|
}
|
|
152474
|
-
function readJsonConfigFile(fileName,
|
|
152475
|
-
const textOrDiagnostic = tryReadFile(fileName,
|
|
152474
|
+
function readJsonConfigFile(fileName, readFile28) {
|
|
152475
|
+
const textOrDiagnostic = tryReadFile(fileName, readFile28);
|
|
152476
152476
|
return isString3(textOrDiagnostic) ? parseJsonText(fileName, textOrDiagnostic) : { fileName, parseDiagnostics: [textOrDiagnostic] };
|
|
152477
152477
|
}
|
|
152478
|
-
function tryReadFile(fileName,
|
|
152478
|
+
function tryReadFile(fileName, readFile28) {
|
|
152479
152479
|
let text;
|
|
152480
152480
|
try {
|
|
152481
|
-
text =
|
|
152481
|
+
text = readFile28(fileName);
|
|
152482
152482
|
} catch (e) {
|
|
152483
152483
|
return createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message);
|
|
152484
152484
|
}
|
|
@@ -230575,7 +230575,7 @@ ${lanes.join("\n")}
|
|
|
230575
230575
|
}
|
|
230576
230576
|
}
|
|
230577
230577
|
function createImportCallExpressionAMD(arg, containsLexicalThis) {
|
|
230578
|
-
const
|
|
230578
|
+
const resolve46 = factory2.createUniqueName("resolve");
|
|
230579
230579
|
const reject = factory2.createUniqueName("reject");
|
|
230580
230580
|
const parameters = [
|
|
230581
230581
|
factory2.createParameterDeclaration(
|
|
@@ -230584,7 +230584,7 @@ ${lanes.join("\n")}
|
|
|
230584
230584
|
/*dotDotDotToken*/
|
|
230585
230585
|
void 0,
|
|
230586
230586
|
/*name*/
|
|
230587
|
-
|
|
230587
|
+
resolve46
|
|
230588
230588
|
),
|
|
230589
230589
|
factory2.createParameterDeclaration(
|
|
230590
230590
|
/*modifiers*/
|
|
@@ -230601,7 +230601,7 @@ ${lanes.join("\n")}
|
|
|
230601
230601
|
factory2.createIdentifier("require"),
|
|
230602
230602
|
/*typeArguments*/
|
|
230603
230603
|
void 0,
|
|
230604
|
-
[factory2.createArrayLiteralExpression([arg || factory2.createOmittedExpression()]),
|
|
230604
|
+
[factory2.createArrayLiteralExpression([arg || factory2.createOmittedExpression()]), resolve46, reject]
|
|
230605
230605
|
)
|
|
230606
230606
|
)
|
|
230607
230607
|
]);
|
|
@@ -236521,7 +236521,7 @@ ${lanes.join("\n")}
|
|
|
236521
236521
|
return;
|
|
236522
236522
|
}
|
|
236523
236523
|
const buildInfo = host.getBuildInfo() || { version };
|
|
236524
|
-
|
|
236524
|
+
writeFile28(
|
|
236525
236525
|
host,
|
|
236526
236526
|
emitterDiagnostics,
|
|
236527
236527
|
buildInfoPath,
|
|
@@ -236733,7 +236733,7 @@ ${lanes.join("\n")}
|
|
|
236733
236733
|
}
|
|
236734
236734
|
if (sourceMapFilePath) {
|
|
236735
236735
|
const sourceMap = sourceMapGenerator.toString();
|
|
236736
|
-
|
|
236736
|
+
writeFile28(
|
|
236737
236737
|
host,
|
|
236738
236738
|
emitterDiagnostics,
|
|
236739
236739
|
sourceMapFilePath,
|
|
@@ -236748,7 +236748,7 @@ ${lanes.join("\n")}
|
|
|
236748
236748
|
}
|
|
236749
236749
|
const text = writer.getText();
|
|
236750
236750
|
const data = { sourceMapUrlPos, diagnostics: transform2.diagnostics };
|
|
236751
|
-
|
|
236751
|
+
writeFile28(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, data);
|
|
236752
236752
|
writer.clear();
|
|
236753
236753
|
return !data.skippedDtsWrite;
|
|
236754
236754
|
}
|
|
@@ -236933,7 +236933,7 @@ ${lanes.join("\n")}
|
|
|
236933
236933
|
// internal API
|
|
236934
236934
|
writeNode,
|
|
236935
236935
|
writeList,
|
|
236936
|
-
writeFile:
|
|
236936
|
+
writeFile: writeFile29,
|
|
236937
236937
|
writeBundle
|
|
236938
236938
|
};
|
|
236939
236939
|
function printNode(hint, node, sourceFile) {
|
|
@@ -236971,7 +236971,7 @@ ${lanes.join("\n")}
|
|
|
236971
236971
|
return endPrint();
|
|
236972
236972
|
}
|
|
236973
236973
|
function printFile(sourceFile) {
|
|
236974
|
-
|
|
236974
|
+
writeFile29(
|
|
236975
236975
|
sourceFile,
|
|
236976
236976
|
beginPrint(),
|
|
236977
236977
|
/*sourceMapGenerator*/
|
|
@@ -237023,7 +237023,7 @@ ${lanes.join("\n")}
|
|
|
237023
237023
|
reset2();
|
|
237024
237024
|
writer = previousWriter;
|
|
237025
237025
|
}
|
|
237026
|
-
function
|
|
237026
|
+
function writeFile29(sourceFile, output3, sourceMapGenerator2) {
|
|
237027
237027
|
isOwnFileEmit = true;
|
|
237028
237028
|
const previousWriter = writer;
|
|
237029
237029
|
setWriter(output3, sourceMapGenerator2);
|
|
@@ -241592,7 +241592,7 @@ ${lanes.join("\n")}
|
|
|
241592
241592
|
getDirectories,
|
|
241593
241593
|
readDirectory,
|
|
241594
241594
|
createDirectory: host.createDirectory && createDirectory,
|
|
241595
|
-
writeFile: host.writeFile &&
|
|
241595
|
+
writeFile: host.writeFile && writeFile29,
|
|
241596
241596
|
addOrDeleteFileOrDirectory,
|
|
241597
241597
|
addOrDeleteFile,
|
|
241598
241598
|
clearCache,
|
|
@@ -241659,7 +241659,7 @@ ${lanes.join("\n")}
|
|
|
241659
241659
|
const index = binarySearch(entries2, name, identity3, compareStringsCaseSensitive);
|
|
241660
241660
|
return index >= 0;
|
|
241661
241661
|
}
|
|
241662
|
-
function
|
|
241662
|
+
function writeFile29(fileName, data, writeByteOrderMark) {
|
|
241663
241663
|
const path14 = toPath3(fileName);
|
|
241664
241664
|
const result = getCachedFileSystemEntriesForBaseDir(path14);
|
|
241665
241665
|
if (result) {
|
|
@@ -242136,12 +242136,12 @@ ${lanes.join("\n")}
|
|
|
242136
242136
|
function createCompilerHost(options, setParentNodes) {
|
|
242137
242137
|
return createCompilerHostWorker(options, setParentNodes);
|
|
242138
242138
|
}
|
|
242139
|
-
function createGetSourceFile(
|
|
242139
|
+
function createGetSourceFile(readFile28, setParentNodes) {
|
|
242140
242140
|
return (fileName, languageVersionOrOptions, onError) => {
|
|
242141
242141
|
let text;
|
|
242142
242142
|
try {
|
|
242143
242143
|
mark("beforeIORead");
|
|
242144
|
-
text =
|
|
242144
|
+
text = readFile28(fileName);
|
|
242145
242145
|
mark("afterIORead");
|
|
242146
242146
|
measure("I/O Read", "beforeIORead", "afterIORead");
|
|
242147
242147
|
} catch (e) {
|
|
@@ -243045,7 +243045,7 @@ ${lanes.join("\n")}
|
|
|
243045
243045
|
getRedirectFromOutput,
|
|
243046
243046
|
forEachResolvedProjectReference: forEachResolvedProjectReference2
|
|
243047
243047
|
});
|
|
243048
|
-
const
|
|
243048
|
+
const readFile28 = host.readFile.bind(host);
|
|
243049
243049
|
(_e = tracing) == null ? void 0 : _e.push(tracing.Phase.Program, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram });
|
|
243050
243050
|
const shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options);
|
|
243051
243051
|
(_f = tracing) == null ? void 0 : _f.pop();
|
|
@@ -243271,7 +243271,7 @@ ${lanes.join("\n")}
|
|
|
243271
243271
|
shouldTransformImportCall,
|
|
243272
243272
|
emitBuildInfo,
|
|
243273
243273
|
fileExists,
|
|
243274
|
-
readFile:
|
|
243274
|
+
readFile: readFile28,
|
|
243275
243275
|
directoryExists,
|
|
243276
243276
|
getSymlinkCache,
|
|
243277
243277
|
realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host),
|
|
@@ -243279,7 +243279,7 @@ ${lanes.join("\n")}
|
|
|
243279
243279
|
getCanonicalFileName,
|
|
243280
243280
|
getFileIncludeReasons: () => programDiagnostics.getFileReasons(),
|
|
243281
243281
|
structureIsReused,
|
|
243282
|
-
writeFile:
|
|
243282
|
+
writeFile: writeFile29,
|
|
243283
243283
|
getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation)
|
|
243284
243284
|
};
|
|
243285
243285
|
onProgramCreateComplete();
|
|
@@ -243774,7 +243774,7 @@ ${lanes.join("\n")}
|
|
|
243774
243774
|
getRedirectFromSourceFile,
|
|
243775
243775
|
isSourceOfProjectReferenceRedirect,
|
|
243776
243776
|
getSymlinkCache,
|
|
243777
|
-
writeFile: writeFileCallback ||
|
|
243777
|
+
writeFile: writeFileCallback || writeFile29,
|
|
243778
243778
|
isEmitBlocked,
|
|
243779
243779
|
shouldTransformImportCall,
|
|
243780
243780
|
getEmitModuleFormatOfFile: getEmitModuleFormatOfFile2,
|
|
@@ -243802,7 +243802,7 @@ ${lanes.join("\n")}
|
|
|
243802
243802
|
getGlobalTypingsCacheLocation: program2.getGlobalTypingsCacheLocation
|
|
243803
243803
|
};
|
|
243804
243804
|
}
|
|
243805
|
-
function
|
|
243805
|
+
function writeFile29(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
|
|
243806
243806
|
host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
|
|
243807
243807
|
}
|
|
243808
243808
|
function emitBuildInfo(writeFileCallback) {
|
|
@@ -245886,10 +245886,10 @@ ${lanes.join("\n")}
|
|
|
245886
245886
|
}
|
|
245887
245887
|
}
|
|
245888
245888
|
var emitSkippedWithNoDiagnostics = { diagnostics: emptyArray, sourceMaps: void 0, emittedFiles: void 0, emitSkipped: true };
|
|
245889
|
-
function handleNoEmitOptions(program2, sourceFile,
|
|
245889
|
+
function handleNoEmitOptions(program2, sourceFile, writeFile29, cancellationToken) {
|
|
245890
245890
|
const options = program2.getCompilerOptions();
|
|
245891
245891
|
if (options.noEmit) {
|
|
245892
|
-
return sourceFile ? emitSkippedWithNoDiagnostics : program2.emitBuildInfo(
|
|
245892
|
+
return sourceFile ? emitSkippedWithNoDiagnostics : program2.emitBuildInfo(writeFile29, cancellationToken);
|
|
245893
245893
|
}
|
|
245894
245894
|
if (!options.noEmitOnError) return void 0;
|
|
245895
245895
|
let diagnostics = [
|
|
@@ -245908,7 +245908,7 @@ ${lanes.join("\n")}
|
|
|
245908
245908
|
if (!diagnostics.length) return void 0;
|
|
245909
245909
|
let emittedFiles;
|
|
245910
245910
|
if (!sourceFile) {
|
|
245911
|
-
const emitResult = program2.emitBuildInfo(
|
|
245911
|
+
const emitResult = program2.emitBuildInfo(writeFile29, cancellationToken);
|
|
245912
245912
|
if (emitResult.diagnostics) diagnostics = [...diagnostics, ...emitResult.diagnostics];
|
|
245913
245913
|
emittedFiles = emitResult.emittedFiles;
|
|
245914
245914
|
}
|
|
@@ -246279,9 +246279,9 @@ ${lanes.join("\n")}
|
|
|
246279
246279
|
}
|
|
246280
246280
|
function getFileEmitOutput(program2, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers, forceDtsEmit) {
|
|
246281
246281
|
const outputFiles = [];
|
|
246282
|
-
const { emitSkipped, diagnostics } = program2.emit(sourceFile,
|
|
246282
|
+
const { emitSkipped, diagnostics } = program2.emit(sourceFile, writeFile29, cancellationToken, emitOnlyDtsFiles, customTransformers, forceDtsEmit);
|
|
246283
246283
|
return { outputFiles, emitSkipped, diagnostics };
|
|
246284
|
-
function
|
|
246284
|
+
function writeFile29(fileName, text, writeByteOrderMark) {
|
|
246285
246285
|
outputFiles.push({ name: fileName, writeByteOrderMark, text });
|
|
246286
246286
|
}
|
|
246287
246287
|
}
|
|
@@ -247640,11 +247640,11 @@ ${lanes.join("\n")}
|
|
|
247640
247640
|
notImplemented();
|
|
247641
247641
|
}
|
|
247642
247642
|
return builderProgram;
|
|
247643
|
-
function emitBuildInfo(
|
|
247643
|
+
function emitBuildInfo(writeFile29, cancellationToken) {
|
|
247644
247644
|
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
247645
247645
|
if (getBuildInfoEmitPending(state)) {
|
|
247646
247646
|
const result = state.program.emitBuildInfo(
|
|
247647
|
-
|
|
247647
|
+
writeFile29 || maybeBind(host, host.writeFile),
|
|
247648
247648
|
cancellationToken
|
|
247649
247649
|
);
|
|
247650
247650
|
state.buildInfoEmitPending = false;
|
|
@@ -247652,7 +247652,7 @@ ${lanes.join("\n")}
|
|
|
247652
247652
|
}
|
|
247653
247653
|
return emitSkippedWithNoDiagnostics;
|
|
247654
247654
|
}
|
|
247655
|
-
function emitNextAffectedFileOrDtsErrors(
|
|
247655
|
+
function emitNextAffectedFileOrDtsErrors(writeFile29, cancellationToken, emitOnlyDtsFiles, customTransformers, isForDtsErrors) {
|
|
247656
247656
|
var _a7, _b3, _c3, _d;
|
|
247657
247657
|
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
247658
247658
|
let affected = getNextAffectedFile(state, cancellationToken, host);
|
|
@@ -247710,7 +247710,7 @@ ${lanes.join("\n")}
|
|
|
247710
247710
|
if (isForDtsErrors || !getBuildInfoEmitPending(state)) return void 0;
|
|
247711
247711
|
const affected2 = state.program;
|
|
247712
247712
|
const result2 = affected2.emitBuildInfo(
|
|
247713
|
-
|
|
247713
|
+
writeFile29 || maybeBind(host, host.writeFile),
|
|
247714
247714
|
cancellationToken
|
|
247715
247715
|
);
|
|
247716
247716
|
state.buildInfoEmitPending = false;
|
|
@@ -247722,7 +247722,7 @@ ${lanes.join("\n")}
|
|
|
247722
247722
|
if (emitKind & 56) emitOnly = emitOnly === void 0 ? 1 : void 0;
|
|
247723
247723
|
const result = !isForDtsErrors ? state.program.emit(
|
|
247724
247724
|
affected === state.program ? void 0 : affected,
|
|
247725
|
-
getWriteFileCallback(
|
|
247725
|
+
getWriteFileCallback(writeFile29, customTransformers),
|
|
247726
247726
|
cancellationToken,
|
|
247727
247727
|
emitOnly,
|
|
247728
247728
|
customTransformers,
|
|
@@ -247768,9 +247768,9 @@ ${lanes.join("\n")}
|
|
|
247768
247768
|
});
|
|
247769
247769
|
if (emitDiagnosticsPerFile) state.emitDiagnosticsPerFile = emitDiagnosticsPerFile;
|
|
247770
247770
|
}
|
|
247771
|
-
function emitNextAffectedFile(
|
|
247771
|
+
function emitNextAffectedFile(writeFile29, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
247772
247772
|
return emitNextAffectedFileOrDtsErrors(
|
|
247773
|
-
|
|
247773
|
+
writeFile29,
|
|
247774
247774
|
cancellationToken,
|
|
247775
247775
|
emitOnlyDtsFiles,
|
|
247776
247776
|
customTransformers,
|
|
@@ -247778,9 +247778,9 @@ ${lanes.join("\n")}
|
|
|
247778
247778
|
false
|
|
247779
247779
|
);
|
|
247780
247780
|
}
|
|
247781
|
-
function getWriteFileCallback(
|
|
247781
|
+
function getWriteFileCallback(writeFile29, customTransformers) {
|
|
247782
247782
|
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
247783
|
-
if (!getEmitDeclarations(state.compilerOptions)) return
|
|
247783
|
+
if (!getEmitDeclarations(state.compilerOptions)) return writeFile29 || maybeBind(host, host.writeFile);
|
|
247784
247784
|
return (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
|
|
247785
247785
|
var _a7, _b3, _c3;
|
|
247786
247786
|
if (isDeclarationFileName(fileName)) {
|
|
@@ -247831,7 +247831,7 @@ ${lanes.join("\n")}
|
|
|
247831
247831
|
state.outSignature = newSignature;
|
|
247832
247832
|
}
|
|
247833
247833
|
}
|
|
247834
|
-
if (
|
|
247834
|
+
if (writeFile29) writeFile29(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
|
|
247835
247835
|
else if (host.writeFile) host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
|
|
247836
247836
|
else state.program.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
|
|
247837
247837
|
function handleNewSignature(oldSignatureFormat, newSignature) {
|
|
@@ -247849,12 +247849,12 @@ ${lanes.join("\n")}
|
|
|
247849
247849
|
}
|
|
247850
247850
|
};
|
|
247851
247851
|
}
|
|
247852
|
-
function emit(targetSourceFile,
|
|
247852
|
+
function emit(targetSourceFile, writeFile29, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
247853
247853
|
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
247854
247854
|
if (kind === 1) {
|
|
247855
247855
|
assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile);
|
|
247856
247856
|
}
|
|
247857
|
-
const result = handleNoEmitOptions(builderProgram, targetSourceFile,
|
|
247857
|
+
const result = handleNoEmitOptions(builderProgram, targetSourceFile, writeFile29, cancellationToken);
|
|
247858
247858
|
if (result) return result;
|
|
247859
247859
|
if (!targetSourceFile) {
|
|
247860
247860
|
if (kind === 1) {
|
|
@@ -247864,7 +247864,7 @@ ${lanes.join("\n")}
|
|
|
247864
247864
|
let emittedFiles = [];
|
|
247865
247865
|
let affectedEmitResult;
|
|
247866
247866
|
while (affectedEmitResult = emitNextAffectedFile(
|
|
247867
|
-
|
|
247867
|
+
writeFile29,
|
|
247868
247868
|
cancellationToken,
|
|
247869
247869
|
emitOnlyDtsFiles,
|
|
247870
247870
|
customTransformers
|
|
@@ -247891,7 +247891,7 @@ ${lanes.join("\n")}
|
|
|
247891
247891
|
}
|
|
247892
247892
|
const emitResult = state.program.emit(
|
|
247893
247893
|
targetSourceFile,
|
|
247894
|
-
getWriteFileCallback(
|
|
247894
|
+
getWriteFileCallback(writeFile29, customTransformers),
|
|
247895
247895
|
cancellationToken,
|
|
247896
247896
|
emitOnlyDtsFiles,
|
|
247897
247897
|
customTransformers
|
|
@@ -248206,8 +248206,8 @@ ${lanes.join("\n")}
|
|
|
248206
248206
|
getSyntacticDiagnostics: (sourceFile, cancellationToken) => getProgram().getSyntacticDiagnostics(sourceFile, cancellationToken),
|
|
248207
248207
|
getDeclarationDiagnostics: (sourceFile, cancellationToken) => getProgram().getDeclarationDiagnostics(sourceFile, cancellationToken),
|
|
248208
248208
|
getSemanticDiagnostics: (sourceFile, cancellationToken) => getProgram().getSemanticDiagnostics(sourceFile, cancellationToken),
|
|
248209
|
-
emit: (sourceFile,
|
|
248210
|
-
emitBuildInfo: (
|
|
248209
|
+
emit: (sourceFile, writeFile29, cancellationToken, emitOnlyDts, customTransformers) => getProgram().emit(sourceFile, writeFile29, cancellationToken, emitOnlyDts, customTransformers),
|
|
248210
|
+
emitBuildInfo: (writeFile29, cancellationToken) => getProgram().emitBuildInfo(writeFile29, cancellationToken),
|
|
248211
248211
|
getAllDependencies: notImplemented,
|
|
248212
248212
|
getCurrentDirectory: () => getProgram().getCurrentDirectory(),
|
|
248213
248213
|
close: noop3
|
|
@@ -249755,7 +249755,7 @@ ${lanes.join("\n")}
|
|
|
249755
249755
|
const fileName = isString3(file) ? file : file.fileName;
|
|
249756
249756
|
return fileNameConvertor ? fileNameConvertor(fileName) : fileName;
|
|
249757
249757
|
}
|
|
249758
|
-
function emitFilesAndReportErrors(program2, reportDiagnostic, write, reportSummary,
|
|
249758
|
+
function emitFilesAndReportErrors(program2, reportDiagnostic, write, reportSummary, writeFile29, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
249759
249759
|
const options = program2.getCompilerOptions();
|
|
249760
249760
|
const allDiagnostics = program2.getConfigFileParsingDiagnostics().slice();
|
|
249761
249761
|
const configFileParsingDiagnosticsLength = allDiagnostics.length;
|
|
@@ -249787,7 +249787,7 @@ ${lanes.join("\n")}
|
|
|
249787
249787
|
const emitResult = options.listFilesOnly ? { emitSkipped: true, diagnostics: emptyArray } : program2.emit(
|
|
249788
249788
|
/*targetSourceFile*/
|
|
249789
249789
|
void 0,
|
|
249790
|
-
|
|
249790
|
+
writeFile29,
|
|
249791
249791
|
cancellationToken,
|
|
249792
249792
|
emitOnlyDtsFiles,
|
|
249793
249793
|
customTransformers
|
|
@@ -249811,13 +249811,13 @@ ${lanes.join("\n")}
|
|
|
249811
249811
|
diagnostics
|
|
249812
249812
|
};
|
|
249813
249813
|
}
|
|
249814
|
-
function emitFilesAndReportErrorsAndGetExitStatus(program2, reportDiagnostic, write, reportSummary,
|
|
249814
|
+
function emitFilesAndReportErrorsAndGetExitStatus(program2, reportDiagnostic, write, reportSummary, writeFile29, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
249815
249815
|
const { emitResult, diagnostics } = emitFilesAndReportErrors(
|
|
249816
249816
|
program2,
|
|
249817
249817
|
reportDiagnostic,
|
|
249818
249818
|
write,
|
|
249819
249819
|
reportSummary,
|
|
249820
|
-
|
|
249820
|
+
writeFile29,
|
|
249821
249821
|
cancellationToken,
|
|
249822
249822
|
emitOnlyDtsFiles,
|
|
249823
249823
|
customTransformers
|
|
@@ -251317,22 +251317,22 @@ ${lanes.join("\n")}
|
|
|
251317
251317
|
getSemanticDiagnosticsOfNextAffectedFile: (cancellationToken, ignoreSourceFile) => withProgramOrUndefined(
|
|
251318
251318
|
(program22) => program22.getSemanticDiagnosticsOfNextAffectedFile && program22.getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile)
|
|
251319
251319
|
),
|
|
251320
|
-
emit: (targetSourceFile,
|
|
251320
|
+
emit: (targetSourceFile, writeFile29, cancellationToken, emitOnlyDtsFiles, customTransformers) => {
|
|
251321
251321
|
if (targetSourceFile || emitOnlyDtsFiles) {
|
|
251322
251322
|
return withProgramOrUndefined(
|
|
251323
251323
|
(program22) => {
|
|
251324
251324
|
var _a7, _b3;
|
|
251325
|
-
return program22.emit(targetSourceFile,
|
|
251325
|
+
return program22.emit(targetSourceFile, writeFile29, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b3 = (_a7 = state.host).getCustomTransformers) == null ? void 0 : _b3.call(_a7, project)));
|
|
251326
251326
|
}
|
|
251327
251327
|
);
|
|
251328
251328
|
}
|
|
251329
251329
|
executeSteps(0, cancellationToken);
|
|
251330
|
-
return emit(
|
|
251330
|
+
return emit(writeFile29, cancellationToken, customTransformers);
|
|
251331
251331
|
},
|
|
251332
251332
|
done
|
|
251333
251333
|
};
|
|
251334
|
-
function done(cancellationToken,
|
|
251335
|
-
executeSteps(3, cancellationToken,
|
|
251334
|
+
function done(cancellationToken, writeFile29, customTransformers) {
|
|
251335
|
+
executeSteps(3, cancellationToken, writeFile29, customTransformers);
|
|
251336
251336
|
mark("SolutionBuilder::Projects built");
|
|
251337
251337
|
return doneInvalidatedProject(state, projectPath);
|
|
251338
251338
|
}
|
|
@@ -251466,7 +251466,7 @@ ${lanes.join("\n")}
|
|
|
251466
251466
|
step = 2;
|
|
251467
251467
|
return emitResult;
|
|
251468
251468
|
}
|
|
251469
|
-
function executeSteps(till, cancellationToken,
|
|
251469
|
+
function executeSteps(till, cancellationToken, writeFile29, customTransformers) {
|
|
251470
251470
|
while (step <= till && step < 3) {
|
|
251471
251471
|
const currentStep = step;
|
|
251472
251472
|
switch (step) {
|
|
@@ -251474,7 +251474,7 @@ ${lanes.join("\n")}
|
|
|
251474
251474
|
createProgram2();
|
|
251475
251475
|
break;
|
|
251476
251476
|
case 1:
|
|
251477
|
-
emit(
|
|
251477
|
+
emit(writeFile29, cancellationToken, customTransformers);
|
|
251478
251478
|
break;
|
|
251479
251479
|
case 2:
|
|
251480
251480
|
queueReferencingProjects(state, project, projectPath, projectIndex, config4, buildOrder, Debug.checkDefined(buildResult));
|
|
@@ -252061,14 +252061,14 @@ ${lanes.join("\n")}
|
|
|
252061
252061
|
}
|
|
252062
252062
|
}
|
|
252063
252063
|
}
|
|
252064
|
-
function build(state, project, cancellationToken,
|
|
252064
|
+
function build(state, project, cancellationToken, writeFile29, getCustomTransformers, onlyReferences) {
|
|
252065
252065
|
mark("SolutionBuilder::beforeBuild");
|
|
252066
|
-
const result = buildWorker(state, project, cancellationToken,
|
|
252066
|
+
const result = buildWorker(state, project, cancellationToken, writeFile29, getCustomTransformers, onlyReferences);
|
|
252067
252067
|
mark("SolutionBuilder::afterBuild");
|
|
252068
252068
|
measure("SolutionBuilder::Build", "SolutionBuilder::beforeBuild", "SolutionBuilder::afterBuild");
|
|
252069
252069
|
return result;
|
|
252070
252070
|
}
|
|
252071
|
-
function buildWorker(state, project, cancellationToken,
|
|
252071
|
+
function buildWorker(state, project, cancellationToken, writeFile29, getCustomTransformers, onlyReferences) {
|
|
252072
252072
|
const buildOrder = getBuildOrderFor(state, project, onlyReferences);
|
|
252073
252073
|
if (!buildOrder) return 3;
|
|
252074
252074
|
setupInitialBuild(state, cancellationToken);
|
|
@@ -252078,7 +252078,7 @@ ${lanes.join("\n")}
|
|
|
252078
252078
|
const invalidatedProject = getNextInvalidatedProject(state, buildOrder, reportQueue);
|
|
252079
252079
|
if (!invalidatedProject) break;
|
|
252080
252080
|
reportQueue = false;
|
|
252081
|
-
invalidatedProject.done(cancellationToken,
|
|
252081
|
+
invalidatedProject.done(cancellationToken, writeFile29, getCustomTransformers == null ? void 0 : getCustomTransformers(invalidatedProject.project));
|
|
252082
252082
|
if (!state.diagnostics.has(invalidatedProject.projectPath)) successfulProjects++;
|
|
252083
252083
|
}
|
|
252084
252084
|
disableCache(state);
|
|
@@ -252374,13 +252374,13 @@ ${lanes.join("\n")}
|
|
|
252374
252374
|
function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) {
|
|
252375
252375
|
const state = createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions);
|
|
252376
252376
|
return {
|
|
252377
|
-
build: (project, cancellationToken,
|
|
252377
|
+
build: (project, cancellationToken, writeFile29, getCustomTransformers) => build(state, project, cancellationToken, writeFile29, getCustomTransformers),
|
|
252378
252378
|
clean: (project) => clean2(state, project),
|
|
252379
|
-
buildReferences: (project, cancellationToken,
|
|
252379
|
+
buildReferences: (project, cancellationToken, writeFile29, getCustomTransformers) => build(
|
|
252380
252380
|
state,
|
|
252381
252381
|
project,
|
|
252382
252382
|
cancellationToken,
|
|
252383
|
-
|
|
252383
|
+
writeFile29,
|
|
252384
252384
|
getCustomTransformers,
|
|
252385
252385
|
/*onlyReferences*/
|
|
252386
252386
|
true
|
|
@@ -304630,7 +304630,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
304630
304630
|
walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild,
|
|
304631
304631
|
whitespaceOrMapCommentRegExp: () => whitespaceOrMapCommentRegExp,
|
|
304632
304632
|
writeCommentRange: () => writeCommentRange,
|
|
304633
|
-
writeFile: () =>
|
|
304633
|
+
writeFile: () => writeFile28,
|
|
304634
304634
|
writeFileEnsuringDirectories: () => writeFileEnsuringDirectories,
|
|
304635
304635
|
zipWith: () => zipWith
|
|
304636
304636
|
});
|
|
@@ -306676,7 +306676,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
306676
306676
|
/**
|
|
306677
306677
|
* Returns true if emit was conducted
|
|
306678
306678
|
*/
|
|
306679
|
-
emitFile(scriptInfo,
|
|
306679
|
+
emitFile(scriptInfo, writeFile29) {
|
|
306680
306680
|
if (!this.languageServiceEnabled || !this.shouldEmitFile(scriptInfo)) {
|
|
306681
306681
|
return { emitSkipped: true, diagnostics: emptyArray2 };
|
|
306682
306682
|
}
|
|
@@ -306684,7 +306684,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
306684
306684
|
if (!emitSkipped) {
|
|
306685
306685
|
for (const outputFile of outputFiles) {
|
|
306686
306686
|
const outputFileAbsoluteFileName = getNormalizedAbsolutePath(outputFile.name, this.currentDirectory);
|
|
306687
|
-
|
|
306687
|
+
writeFile29(outputFileAbsoluteFileName, outputFile.text, outputFile.writeByteOrderMark);
|
|
306688
306688
|
}
|
|
306689
306689
|
if (this.builderState && getEmitDeclarations(this.compilerOptions)) {
|
|
306690
306690
|
const dtsFiles = outputFiles.filter((f) => isDeclarationFileName(f.name));
|
|
@@ -317319,8 +317319,8 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
317319
317319
|
installPackage(options) {
|
|
317320
317320
|
this.packageInstallId++;
|
|
317321
317321
|
const request5 = { kind: "installPackage", ...options, id: this.packageInstallId };
|
|
317322
|
-
const promise = new Promise((
|
|
317323
|
-
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve:
|
|
317322
|
+
const promise = new Promise((resolve46, reject) => {
|
|
317323
|
+
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve: resolve46, reject });
|
|
317324
317324
|
});
|
|
317325
317325
|
this.installer.send(request5);
|
|
317326
317326
|
return promise;
|
|
@@ -429348,7 +429348,7 @@ var init_GeminiProvider = __esm({
|
|
|
429348
429348
|
* Sleep helper
|
|
429349
429349
|
*/
|
|
429350
429350
|
sleep(ms) {
|
|
429351
|
-
return new Promise((
|
|
429351
|
+
return new Promise((resolve46) => setTimeout(resolve46, ms));
|
|
429352
429352
|
}
|
|
429353
429353
|
/**
|
|
429354
429354
|
* Extend a previously generated Veo video
|
|
@@ -433435,7 +433435,7 @@ var init_RunwayProvider = __esm({
|
|
|
433435
433435
|
* Sleep helper
|
|
433436
433436
|
*/
|
|
433437
433437
|
sleep(ms) {
|
|
433438
|
-
return new Promise((
|
|
433438
|
+
return new Promise((resolve46) => setTimeout(resolve46, ms));
|
|
433439
433439
|
}
|
|
433440
433440
|
};
|
|
433441
433441
|
RunwayProvider.API_VERSION = "2024-11-06";
|
|
@@ -433867,7 +433867,7 @@ var init_KlingProvider = __esm({
|
|
|
433867
433867
|
* Sleep helper
|
|
433868
433868
|
*/
|
|
433869
433869
|
sleep(ms) {
|
|
433870
|
-
return new Promise((
|
|
433870
|
+
return new Promise((resolve46) => setTimeout(resolve46, ms));
|
|
433871
433871
|
}
|
|
433872
433872
|
};
|
|
433873
433873
|
klingProvider = new KlingProvider();
|
|
@@ -434176,7 +434176,7 @@ var init_GrokProvider = __esm({
|
|
|
434176
434176
|
}
|
|
434177
434177
|
}
|
|
434178
434178
|
sleep(ms) {
|
|
434179
|
-
return new Promise((
|
|
434179
|
+
return new Promise((resolve46) => setTimeout(resolve46, ms));
|
|
434180
434180
|
}
|
|
434181
434181
|
};
|
|
434182
434182
|
grokProvider = new GrokProvider();
|
|
@@ -434197,11 +434197,11 @@ var require_middleware = __commonJS({
|
|
|
434197
434197
|
"use strict";
|
|
434198
434198
|
var __awaiter4 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
434199
434199
|
function adopt(value) {
|
|
434200
|
-
return value instanceof P ? value : new P(function(
|
|
434201
|
-
|
|
434200
|
+
return value instanceof P ? value : new P(function(resolve46) {
|
|
434201
|
+
resolve46(value);
|
|
434202
434202
|
});
|
|
434203
434203
|
}
|
|
434204
|
-
return new (P || (P = Promise))(function(
|
|
434204
|
+
return new (P || (P = Promise))(function(resolve46, reject) {
|
|
434205
434205
|
function fulfilled(value) {
|
|
434206
434206
|
try {
|
|
434207
434207
|
step(generator.next(value));
|
|
@@ -434217,7 +434217,7 @@ var require_middleware = __commonJS({
|
|
|
434217
434217
|
}
|
|
434218
434218
|
}
|
|
434219
434219
|
function step(result) {
|
|
434220
|
-
result.done ?
|
|
434220
|
+
result.done ? resolve46(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
434221
434221
|
}
|
|
434222
434222
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
434223
434223
|
});
|
|
@@ -434302,11 +434302,11 @@ var require_response = __commonJS({
|
|
|
434302
434302
|
"use strict";
|
|
434303
434303
|
var __awaiter4 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
434304
434304
|
function adopt(value) {
|
|
434305
|
-
return value instanceof P ? value : new P(function(
|
|
434306
|
-
|
|
434305
|
+
return value instanceof P ? value : new P(function(resolve46) {
|
|
434306
|
+
resolve46(value);
|
|
434307
434307
|
});
|
|
434308
434308
|
}
|
|
434309
|
-
return new (P || (P = Promise))(function(
|
|
434309
|
+
return new (P || (P = Promise))(function(resolve46, reject) {
|
|
434310
434310
|
function fulfilled(value) {
|
|
434311
434311
|
try {
|
|
434312
434312
|
step(generator.next(value));
|
|
@@ -434322,7 +434322,7 @@ var require_response = __commonJS({
|
|
|
434322
434322
|
}
|
|
434323
434323
|
}
|
|
434324
434324
|
function step(result) {
|
|
434325
|
-
result.done ?
|
|
434325
|
+
result.done ? resolve46(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
434326
434326
|
}
|
|
434327
434327
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
434328
434328
|
});
|
|
@@ -434429,11 +434429,11 @@ var require_utils4 = __commonJS({
|
|
|
434429
434429
|
"use strict";
|
|
434430
434430
|
var __awaiter4 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
434431
434431
|
function adopt(value) {
|
|
434432
|
-
return value instanceof P ? value : new P(function(
|
|
434433
|
-
|
|
434432
|
+
return value instanceof P ? value : new P(function(resolve46) {
|
|
434433
|
+
resolve46(value);
|
|
434434
434434
|
});
|
|
434435
434435
|
}
|
|
434436
|
-
return new (P || (P = Promise))(function(
|
|
434436
|
+
return new (P || (P = Promise))(function(resolve46, reject) {
|
|
434437
434437
|
function fulfilled(value) {
|
|
434438
434438
|
try {
|
|
434439
434439
|
step(generator.next(value));
|
|
@@ -434449,7 +434449,7 @@ var require_utils4 = __commonJS({
|
|
|
434449
434449
|
}
|
|
434450
434450
|
}
|
|
434451
434451
|
function step(result) {
|
|
434452
|
-
result.done ?
|
|
434452
|
+
result.done ? resolve46(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
434453
434453
|
}
|
|
434454
434454
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
434455
434455
|
});
|
|
@@ -434542,7 +434542,7 @@ var require_utils4 = __commonJS({
|
|
|
434542
434542
|
}
|
|
434543
434543
|
function sleep2(ms) {
|
|
434544
434544
|
return __awaiter4(this, void 0, void 0, function* () {
|
|
434545
|
-
return new Promise((
|
|
434545
|
+
return new Promise((resolve46) => setTimeout(resolve46, ms));
|
|
434546
434546
|
});
|
|
434547
434547
|
}
|
|
434548
434548
|
}
|
|
@@ -434554,11 +434554,11 @@ var require_retry = __commonJS({
|
|
|
434554
434554
|
"use strict";
|
|
434555
434555
|
var __awaiter4 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
434556
434556
|
function adopt(value) {
|
|
434557
|
-
return value instanceof P ? value : new P(function(
|
|
434558
|
-
|
|
434557
|
+
return value instanceof P ? value : new P(function(resolve46) {
|
|
434558
|
+
resolve46(value);
|
|
434559
434559
|
});
|
|
434560
434560
|
}
|
|
434561
|
-
return new (P || (P = Promise))(function(
|
|
434561
|
+
return new (P || (P = Promise))(function(resolve46, reject) {
|
|
434562
434562
|
function fulfilled(value) {
|
|
434563
434563
|
try {
|
|
434564
434564
|
step(generator.next(value));
|
|
@@ -434574,7 +434574,7 @@ var require_retry = __commonJS({
|
|
|
434574
434574
|
}
|
|
434575
434575
|
}
|
|
434576
434576
|
function step(result) {
|
|
434577
|
-
result.done ?
|
|
434577
|
+
result.done ? resolve46(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
434578
434578
|
}
|
|
434579
434579
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
434580
434580
|
});
|
|
@@ -434781,11 +434781,11 @@ var require_request = __commonJS({
|
|
|
434781
434781
|
"use strict";
|
|
434782
434782
|
var __awaiter4 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
434783
434783
|
function adopt(value) {
|
|
434784
|
-
return value instanceof P ? value : new P(function(
|
|
434785
|
-
|
|
434784
|
+
return value instanceof P ? value : new P(function(resolve46) {
|
|
434785
|
+
resolve46(value);
|
|
434786
434786
|
});
|
|
434787
434787
|
}
|
|
434788
|
-
return new (P || (P = Promise))(function(
|
|
434788
|
+
return new (P || (P = Promise))(function(resolve46, reject) {
|
|
434789
434789
|
function fulfilled(value) {
|
|
434790
434790
|
try {
|
|
434791
434791
|
step(generator.next(value));
|
|
@@ -434801,7 +434801,7 @@ var require_request = __commonJS({
|
|
|
434801
434801
|
}
|
|
434802
434802
|
}
|
|
434803
434803
|
function step(result) {
|
|
434804
|
-
result.done ?
|
|
434804
|
+
result.done ? resolve46(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
434805
434805
|
}
|
|
434806
434806
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
434807
434807
|
});
|
|
@@ -434888,11 +434888,11 @@ var require_storage = __commonJS({
|
|
|
434888
434888
|
"use strict";
|
|
434889
434889
|
var __awaiter4 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
434890
434890
|
function adopt(value) {
|
|
434891
|
-
return value instanceof P ? value : new P(function(
|
|
434892
|
-
|
|
434891
|
+
return value instanceof P ? value : new P(function(resolve46) {
|
|
434892
|
+
resolve46(value);
|
|
434893
434893
|
});
|
|
434894
434894
|
}
|
|
434895
|
-
return new (P || (P = Promise))(function(
|
|
434895
|
+
return new (P || (P = Promise))(function(resolve46, reject) {
|
|
434896
434896
|
function fulfilled(value) {
|
|
434897
434897
|
try {
|
|
434898
434898
|
step(generator.next(value));
|
|
@@ -434908,7 +434908,7 @@ var require_storage = __commonJS({
|
|
|
434908
434908
|
}
|
|
434909
434909
|
}
|
|
434910
434910
|
function step(result) {
|
|
434911
|
-
result.done ?
|
|
434911
|
+
result.done ? resolve46(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
434912
434912
|
}
|
|
434913
434913
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
434914
434914
|
});
|
|
@@ -435236,11 +435236,11 @@ var require_auth = __commonJS({
|
|
|
435236
435236
|
"use strict";
|
|
435237
435237
|
var __awaiter4 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
435238
435238
|
function adopt(value) {
|
|
435239
|
-
return value instanceof P ? value : new P(function(
|
|
435240
|
-
|
|
435239
|
+
return value instanceof P ? value : new P(function(resolve46) {
|
|
435240
|
+
resolve46(value);
|
|
435241
435241
|
});
|
|
435242
435242
|
}
|
|
435243
|
-
return new (P || (P = Promise))(function(
|
|
435243
|
+
return new (P || (P = Promise))(function(resolve46, reject) {
|
|
435244
435244
|
function fulfilled(value) {
|
|
435245
435245
|
try {
|
|
435246
435246
|
step(generator.next(value));
|
|
@@ -435256,7 +435256,7 @@ var require_auth = __commonJS({
|
|
|
435256
435256
|
}
|
|
435257
435257
|
}
|
|
435258
435258
|
function step(result) {
|
|
435259
|
-
result.done ?
|
|
435259
|
+
result.done ? resolve46(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
435260
435260
|
}
|
|
435261
435261
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
435262
435262
|
});
|
|
@@ -435295,11 +435295,11 @@ var require_streaming = __commonJS({
|
|
|
435295
435295
|
"use strict";
|
|
435296
435296
|
var __awaiter4 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
435297
435297
|
function adopt(value) {
|
|
435298
|
-
return value instanceof P ? value : new P(function(
|
|
435299
|
-
|
|
435298
|
+
return value instanceof P ? value : new P(function(resolve46) {
|
|
435299
|
+
resolve46(value);
|
|
435300
435300
|
});
|
|
435301
435301
|
}
|
|
435302
|
-
return new (P || (P = Promise))(function(
|
|
435302
|
+
return new (P || (P = Promise))(function(resolve46, reject) {
|
|
435303
435303
|
function fulfilled(value) {
|
|
435304
435304
|
try {
|
|
435305
435305
|
step(generator.next(value));
|
|
@@ -435315,7 +435315,7 @@ var require_streaming = __commonJS({
|
|
|
435315
435315
|
}
|
|
435316
435316
|
}
|
|
435317
435317
|
function step(result) {
|
|
435318
|
-
result.done ?
|
|
435318
|
+
result.done ? resolve46(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
435319
435319
|
}
|
|
435320
435320
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
435321
435321
|
});
|
|
@@ -435548,7 +435548,7 @@ var require_streaming = __commonJS({
|
|
|
435548
435548
|
query: options.queryParams
|
|
435549
435549
|
});
|
|
435550
435550
|
this.options = options;
|
|
435551
|
-
this.donePromise = new Promise((
|
|
435551
|
+
this.donePromise = new Promise((resolve46, reject) => {
|
|
435552
435552
|
if (this.streamClosed) {
|
|
435553
435553
|
reject(new response_1.ApiError({
|
|
435554
435554
|
message: "Streaming connection is already closed.",
|
|
@@ -435559,11 +435559,11 @@ var require_streaming = __commonJS({
|
|
|
435559
435559
|
}
|
|
435560
435560
|
this.signal.addEventListener("abort", () => {
|
|
435561
435561
|
var _a8;
|
|
435562
|
-
|
|
435562
|
+
resolve46((_a8 = this.currentData) !== null && _a8 !== void 0 ? _a8 : {});
|
|
435563
435563
|
});
|
|
435564
435564
|
this.on("done", (data) => {
|
|
435565
435565
|
this.streamClosed = true;
|
|
435566
|
-
|
|
435566
|
+
resolve46(data);
|
|
435567
435567
|
});
|
|
435568
435568
|
this.on("error", (error) => {
|
|
435569
435569
|
this.streamClosed = true;
|
|
@@ -435588,7 +435588,7 @@ var require_streaming = __commonJS({
|
|
|
435588
435588
|
if (data) {
|
|
435589
435589
|
yield yield __await4(data);
|
|
435590
435590
|
}
|
|
435591
|
-
yield __await4(new Promise((
|
|
435591
|
+
yield __await4(new Promise((resolve46) => setTimeout(resolve46, 16)));
|
|
435592
435592
|
}
|
|
435593
435593
|
});
|
|
435594
435594
|
}
|
|
@@ -435633,11 +435633,11 @@ var require_queue = __commonJS({
|
|
|
435633
435633
|
"use strict";
|
|
435634
435634
|
var __awaiter4 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
435635
435635
|
function adopt(value) {
|
|
435636
|
-
return value instanceof P ? value : new P(function(
|
|
435637
|
-
|
|
435636
|
+
return value instanceof P ? value : new P(function(resolve46) {
|
|
435637
|
+
resolve46(value);
|
|
435638
435638
|
});
|
|
435639
435639
|
}
|
|
435640
|
-
return new (P || (P = Promise))(function(
|
|
435640
|
+
return new (P || (P = Promise))(function(resolve46, reject) {
|
|
435641
435641
|
function fulfilled(value) {
|
|
435642
435642
|
try {
|
|
435643
435643
|
step(generator.next(value));
|
|
@@ -435653,7 +435653,7 @@ var require_queue = __commonJS({
|
|
|
435653
435653
|
}
|
|
435654
435654
|
}
|
|
435655
435655
|
function step(result) {
|
|
435656
|
-
result.done ?
|
|
435656
|
+
result.done ? resolve46(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
435657
435657
|
}
|
|
435658
435658
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
435659
435659
|
});
|
|
@@ -435788,7 +435788,7 @@ var require_queue = __commonJS({
|
|
|
435788
435788
|
}
|
|
435789
435789
|
return doneStatus;
|
|
435790
435790
|
}
|
|
435791
|
-
return new Promise((
|
|
435791
|
+
return new Promise((resolve46, reject) => {
|
|
435792
435792
|
var _a7;
|
|
435793
435793
|
let pollingTimeoutId;
|
|
435794
435794
|
const pollInterval = "pollInterval" in options && typeof options.pollInterval === "number" ? (_a7 = options.pollInterval) !== null && _a7 !== void 0 ? _a7 : DEFAULT_POLL_INTERVAL : DEFAULT_POLL_INTERVAL;
|
|
@@ -435820,7 +435820,7 @@ var require_queue = __commonJS({
|
|
|
435820
435820
|
}
|
|
435821
435821
|
if (requestStatus.status === "COMPLETED") {
|
|
435822
435822
|
clearScheduledTasks();
|
|
435823
|
-
|
|
435823
|
+
resolve46(requestStatus);
|
|
435824
435824
|
return;
|
|
435825
435825
|
}
|
|
435826
435826
|
pollingTimeoutId = setTimeout(poll, pollInterval);
|
|
@@ -437781,11 +437781,11 @@ var require_realtime = __commonJS({
|
|
|
437781
437781
|
"use strict";
|
|
437782
437782
|
var __awaiter4 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
437783
437783
|
function adopt(value) {
|
|
437784
|
-
return value instanceof P ? value : new P(function(
|
|
437785
|
-
|
|
437784
|
+
return value instanceof P ? value : new P(function(resolve46) {
|
|
437785
|
+
resolve46(value);
|
|
437786
437786
|
});
|
|
437787
437787
|
}
|
|
437788
|
-
return new (P || (P = Promise))(function(
|
|
437788
|
+
return new (P || (P = Promise))(function(resolve46, reject) {
|
|
437789
437789
|
function fulfilled(value) {
|
|
437790
437790
|
try {
|
|
437791
437791
|
step(generator.next(value));
|
|
@@ -437801,7 +437801,7 @@ var require_realtime = __commonJS({
|
|
|
437801
437801
|
}
|
|
437802
437802
|
}
|
|
437803
437803
|
function step(result) {
|
|
437804
|
-
result.done ?
|
|
437804
|
+
result.done ? resolve46(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
437805
437805
|
}
|
|
437806
437806
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
437807
437807
|
});
|
|
@@ -438126,11 +438126,11 @@ var require_client = __commonJS({
|
|
|
438126
438126
|
"use strict";
|
|
438127
438127
|
var __awaiter4 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
438128
438128
|
function adopt(value) {
|
|
438129
|
-
return value instanceof P ? value : new P(function(
|
|
438130
|
-
|
|
438129
|
+
return value instanceof P ? value : new P(function(resolve46) {
|
|
438130
|
+
resolve46(value);
|
|
438131
438131
|
});
|
|
438132
438132
|
}
|
|
438133
|
-
return new (P || (P = Promise))(function(
|
|
438133
|
+
return new (P || (P = Promise))(function(resolve46, reject) {
|
|
438134
438134
|
function fulfilled(value) {
|
|
438135
438135
|
try {
|
|
438136
438136
|
step(generator.next(value));
|
|
@@ -438146,7 +438146,7 @@ var require_client = __commonJS({
|
|
|
438146
438146
|
}
|
|
438147
438147
|
}
|
|
438148
438148
|
function step(result) {
|
|
438149
|
-
result.done ?
|
|
438149
|
+
result.done ? resolve46(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
438150
438150
|
}
|
|
438151
438151
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
438152
438152
|
});
|
|
@@ -438711,7 +438711,7 @@ var init_ReplicateProvider = __esm({
|
|
|
438711
438711
|
* Sleep helper
|
|
438712
438712
|
*/
|
|
438713
438713
|
sleep(ms) {
|
|
438714
|
-
return new Promise((
|
|
438714
|
+
return new Promise((resolve46) => setTimeout(resolve46, ms));
|
|
438715
438715
|
}
|
|
438716
438716
|
/**
|
|
438717
438717
|
* Generate music from text prompt using MusicGen
|
|
@@ -446955,7 +446955,7 @@ async function prompt(question, hidden = false) {
|
|
|
446955
446955
|
input: process.stdin,
|
|
446956
446956
|
output: process.stdout
|
|
446957
446957
|
});
|
|
446958
|
-
return new Promise((
|
|
446958
|
+
return new Promise((resolve46) => {
|
|
446959
446959
|
if (hidden && process.stdin.isTTY) {
|
|
446960
446960
|
process.stdout.write(question);
|
|
446961
446961
|
let input3 = "";
|
|
@@ -446969,7 +446969,7 @@ async function prompt(question, hidden = false) {
|
|
|
446969
446969
|
process.stdin.removeListener("data", onData);
|
|
446970
446970
|
process.stdout.write("\n");
|
|
446971
446971
|
rl.close();
|
|
446972
|
-
|
|
446972
|
+
resolve46(input3);
|
|
446973
446973
|
} else if (char === "") {
|
|
446974
446974
|
process.exit(1);
|
|
446975
446975
|
} else if (char === "\x7F" || char === "\b") {
|
|
@@ -446984,7 +446984,7 @@ async function prompt(question, hidden = false) {
|
|
|
446984
446984
|
} else {
|
|
446985
446985
|
rl.question(question, (answer) => {
|
|
446986
446986
|
rl.close();
|
|
446987
|
-
|
|
446987
|
+
resolve46(answer);
|
|
446988
446988
|
});
|
|
446989
446989
|
}
|
|
446990
446990
|
});
|
|
@@ -449598,7 +449598,7 @@ import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
|
449598
449598
|
import { readFile as readFile8, writeFile as writeFile9, mkdir as mkdir8 } from "node:fs/promises";
|
|
449599
449599
|
import { existsSync as existsSync23 } from "node:fs";
|
|
449600
449600
|
function _registerImageCommands(aiCommand) {
|
|
449601
|
-
aiCommand.command("image").description("Generate image using AI (Gemini or DALL-E)").argument("<prompt>", "Image description prompt").option("-p, --provider <provider>", "Provider: gemini, openai, runway (dalle is deprecated)", "gemini").option("-k, --api-key <key>", "API key (or set env: OPENAI_API_KEY, GOOGLE_API_KEY)").option("-o, --output <path>", "Output file path (downloads image)").option("-s, --size <size>", "Image size (openai: 1024x1024, 1536x1024, 1024x1536)", "1024x1024").option("-r, --ratio <ratio>", "Aspect ratio (gemini: 1:1, 1:4, 1:8, 4:1, 8:1, 16:9, 9:16, 3:4, 4:3, etc.)", "1:1").option("
|
|
449601
|
+
aiCommand.command("image").description("Generate image using AI (Gemini or DALL-E)").argument("<prompt>", "Image description prompt").option("-p, --provider <provider>", "Provider: gemini, openai, runway (dalle is deprecated)", "gemini").option("-k, --api-key <key>", "API key (or set env: OPENAI_API_KEY, GOOGLE_API_KEY)").option("-o, --output <path>", "Output file path (downloads image)").option("-s, --size <size>", "Image size (openai: 1024x1024, 1536x1024, 1024x1536)", "1024x1024").option("-r, --ratio <ratio>", "Aspect ratio (gemini: 1:1, 1:4, 1:8, 4:1, 8:1, 16:9, 9:16, 3:4, 4:3, etc.)", "1:1").option("--quality <quality>", "Quality: standard, hd (openai only)", "standard").option("--style <style>", "Style: vivid, natural (openai only)", "vivid").option("-n, --count <n>", "Number of images to generate", "1").option("-m, --model <model>", "Model. Gemini: flash, 3.1-flash, latest, pro. OpenAI: 1.5 (default), 2 (gpt-image-2)").option("--dry-run", "Preview parameters without executing").action(async (prompt3, options) => {
|
|
449602
449602
|
try {
|
|
449603
449603
|
if (options.output) {
|
|
449604
449604
|
validateOutputPath(options.output);
|
|
@@ -450613,7 +450613,7 @@ async function scaffoldSceneProject(opts) {
|
|
|
450613
450613
|
await mkdir9(resolve20(dir, "compositions"), { recursive: true });
|
|
450614
450614
|
await mkdir9(resolve20(dir, "assets"), { recursive: true });
|
|
450615
450615
|
const created = [];
|
|
450616
|
-
const
|
|
450616
|
+
const skipped2 = [];
|
|
450617
450617
|
const merged = [];
|
|
450618
450618
|
const hfPath = resolve20(dir, "hyperframes.json");
|
|
450619
450619
|
const hfDefaults = buildHyperframesConfig();
|
|
@@ -450629,21 +450629,21 @@ async function scaffoldSceneProject(opts) {
|
|
|
450629
450629
|
}
|
|
450630
450630
|
const metaPath = resolve20(dir, "meta.json");
|
|
450631
450631
|
if (await pathExists(metaPath)) {
|
|
450632
|
-
|
|
450632
|
+
skipped2.push(metaPath);
|
|
450633
450633
|
} else {
|
|
450634
450634
|
await writeFile10(metaPath, JSON.stringify(buildHyperframesMeta(name, now), null, 2) + "\n", "utf-8");
|
|
450635
450635
|
created.push(metaPath);
|
|
450636
450636
|
}
|
|
450637
450637
|
const rootPath = resolve20(dir, "index.html");
|
|
450638
450638
|
if (await pathExists(rootPath)) {
|
|
450639
|
-
|
|
450639
|
+
skipped2.push(rootPath);
|
|
450640
450640
|
} else {
|
|
450641
450641
|
await writeFile10(rootPath, buildEmptyRootHtml({ aspect, duration }), "utf-8");
|
|
450642
450642
|
created.push(rootPath);
|
|
450643
450643
|
}
|
|
450644
450644
|
const vibePath = resolve20(dir, "vibe.project.yaml");
|
|
450645
450645
|
if (await pathExists(vibePath)) {
|
|
450646
|
-
|
|
450646
|
+
skipped2.push(vibePath);
|
|
450647
450647
|
} else {
|
|
450648
450648
|
const cfg = { ...defaultVibeProjectConfig(name), aspect };
|
|
450649
450649
|
await writeFile10(vibePath, (0, import_yaml2.stringify)(cfg), "utf-8");
|
|
@@ -450651,14 +450651,14 @@ async function scaffoldSceneProject(opts) {
|
|
|
450651
450651
|
}
|
|
450652
450652
|
const claudePath = resolve20(dir, "CLAUDE.md");
|
|
450653
450653
|
if (await pathExists(claudePath)) {
|
|
450654
|
-
|
|
450654
|
+
skipped2.push(claudePath);
|
|
450655
450655
|
} else {
|
|
450656
450656
|
await writeFile10(claudePath, buildProjectClaudeMd(name), "utf-8");
|
|
450657
450657
|
created.push(claudePath);
|
|
450658
450658
|
}
|
|
450659
450659
|
const designPath = resolve20(dir, "DESIGN.md");
|
|
450660
450660
|
if (await pathExists(designPath)) {
|
|
450661
|
-
|
|
450661
|
+
skipped2.push(designPath);
|
|
450662
450662
|
} else {
|
|
450663
450663
|
await writeFile10(
|
|
450664
450664
|
designPath,
|
|
@@ -450669,12 +450669,12 @@ async function scaffoldSceneProject(opts) {
|
|
|
450669
450669
|
}
|
|
450670
450670
|
const gitignorePath = resolve20(dir, ".gitignore");
|
|
450671
450671
|
if (await pathExists(gitignorePath)) {
|
|
450672
|
-
|
|
450672
|
+
skipped2.push(gitignorePath);
|
|
450673
450673
|
} else {
|
|
450674
450674
|
await writeFile10(gitignorePath, buildSceneGitignore(), "utf-8");
|
|
450675
450675
|
created.push(gitignorePath);
|
|
450676
450676
|
}
|
|
450677
|
-
return { created, skipped, merged };
|
|
450677
|
+
return { created, skipped: skipped2, merged };
|
|
450678
450678
|
}
|
|
450679
450679
|
var import_yaml2, ASPECT_DIMS;
|
|
450680
450680
|
var init_scene_project = __esm({
|
|
@@ -451368,7 +451368,7 @@ import { readFile as readFile12, writeFile as writeFile13, mkdir as mkdir11, unl
|
|
|
451368
451368
|
import { resolve as resolve24, basename as basename9, dirname as dirname15, extname as extname7 } from "node:path";
|
|
451369
451369
|
import { existsSync as existsSync26 } from "node:fs";
|
|
451370
451370
|
function sleep(ms) {
|
|
451371
|
-
return new Promise((
|
|
451371
|
+
return new Promise((resolve46) => setTimeout(resolve46, ms));
|
|
451372
451372
|
}
|
|
451373
451373
|
async function uploadToImgbb(imageBuffer, apiKey) {
|
|
451374
451374
|
try {
|
|
@@ -454655,10 +454655,10 @@ async function prompt2(question) {
|
|
|
454655
454655
|
input: input3,
|
|
454656
454656
|
output: process.stdout
|
|
454657
454657
|
});
|
|
454658
|
-
return new Promise((
|
|
454658
|
+
return new Promise((resolve46) => {
|
|
454659
454659
|
rl.question(question, (answer) => {
|
|
454660
454660
|
rl.close();
|
|
454661
|
-
|
|
454661
|
+
resolve46(answer);
|
|
454662
454662
|
});
|
|
454663
454663
|
});
|
|
454664
454664
|
}
|
|
@@ -455197,7 +455197,7 @@ Run 'vibe setup --show' to check API key status.
|
|
|
455197
455197
|
Run 'vibe schema generate.<command>' for structured parameter info.
|
|
455198
455198
|
`
|
|
455199
455199
|
);
|
|
455200
|
-
generateCommand.command("image").alias("img").description("Generate image using AI (Gemini, DALL-E, or Runway)").argument("[prompt]", "Image description prompt (interactive if omitted)").option("-p, --provider <provider>", "Provider: openai (default when OPENAI_API_KEY set), gemini, grok, runway (dalle is deprecated)").option("-k, --api-key <key>", "API key (or set env: OPENAI_API_KEY, GOOGLE_API_KEY)").option("-o, --output <path>", "Output file path (downloads image)").option("-s, --size <size>", "Image size (openai: 1024x1024, 1536x1024, 1024x1536)", "1024x1024").option("-r, --ratio <ratio>", "Aspect ratio (gemini: 1:1, 1:4, 1:8, 4:1, 8:1, 16:9, 9:16, 3:4, 4:3, etc.)", "1:1").option("
|
|
455200
|
+
generateCommand.command("image").alias("img").description("Generate image using AI (Gemini, DALL-E, or Runway)").argument("[prompt]", "Image description prompt (interactive if omitted)").option("-p, --provider <provider>", "Provider: openai (default when OPENAI_API_KEY set), gemini, grok, runway (dalle is deprecated)").option("-k, --api-key <key>", "API key (or set env: OPENAI_API_KEY, GOOGLE_API_KEY)").option("-o, --output <path>", "Output file path (downloads image)").option("-s, --size <size>", "Image size (openai: 1024x1024, 1536x1024, 1024x1536)", "1024x1024").option("-r, --ratio <ratio>", "Aspect ratio (gemini: 1:1, 1:4, 1:8, 4:1, 8:1, 16:9, 9:16, 3:4, 4:3, etc.)", "1:1").option("--quality <quality>", "Quality: standard, hd (openai only)", "standard").option("--style <style>", "Style: vivid, natural (openai only)", "vivid").option("-n, --count <n>", "Number of images to generate", "1").option("-m, --model <model>", "Model. Gemini: flash, 3.1-flash, latest, pro. OpenAI: 1.5 (default), 2 (gpt-image-2)").option("--dry-run", "Preview parameters without executing").addHelpText("after", `
|
|
455201
455201
|
Examples:
|
|
455202
455202
|
$ vibe generate image "a sunset over the ocean" -o sunset.png
|
|
455203
455203
|
$ vibe gen img "logo design" -o logo.png -p openai
|
|
@@ -458419,7 +458419,7 @@ Run 'vibe schema edit.<command>' for structured parameter info.
|
|
|
458419
458419
|
exitWithError(apiError(`Image editing failed: ${msg}`, true));
|
|
458420
458420
|
}
|
|
458421
458421
|
});
|
|
458422
|
-
editCommand.command("interpolate").description("Create slow motion with frame interpolation (FFmpeg)").argument("<video>", "Video file path").option("-o, --output <path>", "Output file path").option("-f, --factor <number>", "Slow motion factor: 2, 4, or 8", "2").option("--fps <number>", "Target output FPS").option("
|
|
458422
|
+
editCommand.command("interpolate").description("Create slow motion with frame interpolation (FFmpeg)").argument("<video>", "Video file path").option("-o, --output <path>", "Output file path").option("-f, --factor <number>", "Slow motion factor: 2, 4, or 8", "2").option("--fps <number>", "Target output FPS").option("--quality <mode>", "Quality: fast or quality", "quality").option("--dry-run", "Preview parameters without executing").action(async (videoPath, options) => {
|
|
458423
458423
|
try {
|
|
458424
458424
|
if (options.output) {
|
|
458425
458425
|
validateOutputPath(options.output);
|
|
@@ -460819,7 +460819,9 @@ var init_bundle = __esm({
|
|
|
460819
460819
|
|
|
460820
460820
|
// ../cli/src/commands/_shared/storyboard-parse.ts
|
|
460821
460821
|
function parseStoryboard(md) {
|
|
460822
|
-
const
|
|
460822
|
+
const normalized = md.replace(/\r\n/g, "\n");
|
|
460823
|
+
const { frontmatter, remaining } = extractProjectFrontmatter(normalized);
|
|
460824
|
+
const text = remaining;
|
|
460823
460825
|
const headings = [];
|
|
460824
460826
|
HEADING_RE.lastIndex = 0;
|
|
460825
460827
|
let m;
|
|
@@ -460831,23 +460833,67 @@ function parseStoryboard(md) {
|
|
|
460831
460833
|
});
|
|
460832
460834
|
}
|
|
460833
460835
|
if (headings.length === 0) {
|
|
460834
|
-
return {
|
|
460836
|
+
return {
|
|
460837
|
+
global: text.trim(),
|
|
460838
|
+
beats: [],
|
|
460839
|
+
...frontmatter ? { frontmatter } : {}
|
|
460840
|
+
};
|
|
460835
460841
|
}
|
|
460836
460842
|
const global3 = text.slice(0, headings[0].start).trim();
|
|
460837
460843
|
const beats = headings.map((h, i) => {
|
|
460838
460844
|
const bodyStart = h.end;
|
|
460839
460845
|
const bodyEnd = i + 1 < headings.length ? headings[i + 1].start : text.length;
|
|
460840
|
-
const
|
|
460846
|
+
const rawBody = text.slice(bodyStart, bodyEnd).trim();
|
|
460847
|
+
const { cues, body } = extractBeatCues(rawBody);
|
|
460841
460848
|
const id = deriveBeatId(h.line);
|
|
460842
|
-
const duration = parseBeatDuration(body);
|
|
460849
|
+
const duration = cues?.duration ?? parseBeatDuration(body);
|
|
460843
460850
|
return {
|
|
460844
460851
|
id,
|
|
460845
460852
|
heading: h.line,
|
|
460846
460853
|
body,
|
|
460847
|
-
...duration !== void 0 ? { duration } : {}
|
|
460854
|
+
...duration !== void 0 ? { duration } : {},
|
|
460855
|
+
...cues ? { cues } : {}
|
|
460848
460856
|
};
|
|
460849
460857
|
});
|
|
460850
|
-
return {
|
|
460858
|
+
return {
|
|
460859
|
+
global: global3,
|
|
460860
|
+
beats,
|
|
460861
|
+
...frontmatter ? { frontmatter } : {}
|
|
460862
|
+
};
|
|
460863
|
+
}
|
|
460864
|
+
function extractProjectFrontmatter(md) {
|
|
460865
|
+
const match2 = md.match(FRONTMATTER_RE);
|
|
460866
|
+
if (!match2) return { frontmatter: void 0, remaining: md };
|
|
460867
|
+
let parsed;
|
|
460868
|
+
try {
|
|
460869
|
+
parsed = (0, import_yaml4.parse)(match2[1]);
|
|
460870
|
+
} catch {
|
|
460871
|
+
return { frontmatter: void 0, remaining: md };
|
|
460872
|
+
}
|
|
460873
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
460874
|
+
return { frontmatter: void 0, remaining: md };
|
|
460875
|
+
}
|
|
460876
|
+
return {
|
|
460877
|
+
frontmatter: parsed,
|
|
460878
|
+
remaining: md.slice(match2[0].length)
|
|
460879
|
+
};
|
|
460880
|
+
}
|
|
460881
|
+
function extractBeatCues(body) {
|
|
460882
|
+
const match2 = body.match(BEAT_CUES_RE);
|
|
460883
|
+
if (!match2) return { cues: void 0, body };
|
|
460884
|
+
let parsed;
|
|
460885
|
+
try {
|
|
460886
|
+
parsed = (0, import_yaml4.parse)(match2[1]);
|
|
460887
|
+
} catch {
|
|
460888
|
+
return { cues: void 0, body };
|
|
460889
|
+
}
|
|
460890
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
460891
|
+
return { cues: void 0, body };
|
|
460892
|
+
}
|
|
460893
|
+
return {
|
|
460894
|
+
cues: parsed,
|
|
460895
|
+
body: body.slice(match2[0].length).trim()
|
|
460896
|
+
};
|
|
460851
460897
|
}
|
|
460852
460898
|
function deriveBeatId(headingLine) {
|
|
460853
460899
|
const beatPrefix = headingLine.match(BEAT_PREFIX_RE);
|
|
@@ -460867,14 +460913,17 @@ function parseBeatDuration(body) {
|
|
|
460867
460913
|
const n = parseFloat(valueMatch[1]);
|
|
460868
460914
|
return Number.isFinite(n) && n > 0 ? n : void 0;
|
|
460869
460915
|
}
|
|
460870
|
-
var HEADING_RE, BEAT_PREFIX_RE, DURATION_SUBSECTION_RE, DURATION_VALUE_RE;
|
|
460916
|
+
var import_yaml4, HEADING_RE, BEAT_PREFIX_RE, DURATION_SUBSECTION_RE, DURATION_VALUE_RE, FRONTMATTER_RE, BEAT_CUES_RE;
|
|
460871
460917
|
var init_storyboard_parse = __esm({
|
|
460872
460918
|
"../cli/src/commands/_shared/storyboard-parse.ts"() {
|
|
460873
460919
|
"use strict";
|
|
460920
|
+
import_yaml4 = __toESM(require_dist16(), 1);
|
|
460874
460921
|
HEADING_RE = /^##\s+(.+?)\s*$/gm;
|
|
460875
460922
|
BEAT_PREFIX_RE = /^Beat\s+(.+?)\s+(?:—|:|-)\s+(.+)$/i;
|
|
460876
460923
|
DURATION_SUBSECTION_RE = /###\s+Beat\s+duration\s*\n([\s\S]*?)(?=\n###\s|\n##\s|$)/i;
|
|
460877
460924
|
DURATION_VALUE_RE = /(-?\d+(?:\.\d+)?)\s*(?:s|sec|seconds?)?/i;
|
|
460925
|
+
FRONTMATTER_RE = /^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/;
|
|
460926
|
+
BEAT_CUES_RE = /^\s*```ya?ml\s*\n([\s\S]*?)\n```\s*(?:\n|$)/;
|
|
460878
460927
|
}
|
|
460879
460928
|
});
|
|
460880
460929
|
|
|
@@ -460917,14 +460966,85 @@ will be loaded into a root index.html via
|
|
|
460917
460966
|
\`data-composition-src="compositions/${compositionId}.html"\`.
|
|
460918
460967
|
|
|
460919
460968
|
Requirements (non-negotiable):
|
|
460920
|
-
|
|
460921
|
-
-
|
|
460922
|
-
|
|
460923
|
-
|
|
460924
|
-
|
|
460925
|
-
-
|
|
460926
|
-
-
|
|
460927
|
-
-
|
|
460969
|
+
|
|
460970
|
+
- **Output must be a BARE \`<template>...</template>\` fragment.** Do NOT
|
|
460971
|
+
wrap it in \`<!DOCTYPE html>\`, \`<html>\`, \`<head>\`, or \`<body>\` \u2014
|
|
460972
|
+
Hyperframes' producer reads the file as a fragment and full-document
|
|
460973
|
+
wrappers break sub-composition parsing.
|
|
460974
|
+
- Wrapper template id: \`${compositionId}-template\`. Inner div has
|
|
460975
|
+
\`data-composition-id="${compositionId}"\` AND \`data-start="0"\` AND
|
|
460976
|
+
\`data-duration="<beat duration in seconds>"\` AND \`data-width="1920"\`
|
|
460977
|
+
AND \`data-height="1080"\`.
|
|
460978
|
+
- One paused GSAP timeline registered on \`window.__timelines["${compositionId}"]\`.
|
|
460979
|
+
- **Timeline total duration MUST equal the beat \`data-duration\`.** Hyperframes
|
|
460980
|
+
renders in screenshot-capture mode with virtual time; if the timeline ends
|
|
460981
|
+
before the beat (e.g., entry tweens covering 0\u20131.4s of a 3s beat), the
|
|
460982
|
+
producer's seek lands past the timeline's natural end and visibility state
|
|
460983
|
+
goes stale \u2014 the hold phase renders BLACK. Anchor the timeline to the full
|
|
460984
|
+
beat duration via either:
|
|
460985
|
+
1. A subtle idle motion spanning 0\u2192duration on a parent element, e.g.
|
|
460986
|
+
\`tl.fromTo(".scene-content", { scale: 1.0 }, { scale: 1.015, duration: <beat>, ease: "none" }, 0);\`
|
|
460987
|
+
(Ken-Burns, breathing opacity, gradient drift \u2014 should be barely
|
|
460988
|
+
perceptible so it doesn't compete with entry/exit beats).
|
|
460989
|
+
2. OR an explicit \`tl.set(target, { ...natural state... }, <beat - 0.001>)\`
|
|
460990
|
+
anchor at the end.
|
|
460991
|
+
This is the #2 source of "text disappears mid-beat" bugs after \`.clip\` sizing.
|
|
460992
|
+
- Timed children inside the composition have \`class="clip"\` plus
|
|
460993
|
+
\`data-start\`, \`data-duration\`, \`data-track-index\`.
|
|
460994
|
+
- **\`.clip\` elements get visibility control from the framework but NO
|
|
460995
|
+
sizing.** Always give \`.clip\` explicit fill via CSS:
|
|
460996
|
+
\`{ position: absolute; inset: 0; }\` (or equivalent
|
|
460997
|
+
\`width: 100%; height: 100%; top: 0; left: 0;\`). Without this, the
|
|
460998
|
+
\`.clip\` collapses to its content size and any flex-centering inside
|
|
460999
|
+
it breaks. THIS IS THE #1 SOURCE OF "TEXT NOT RENDERING / WRONG
|
|
461000
|
+
POSITION" BUGS \u2014 do not skip the rule.
|
|
461001
|
+
- Composition root must declare its absolute size in CSS:
|
|
461002
|
+
\`[data-composition-id="${compositionId}"] { position: relative; width: 1920px; height: 1080px; }\`.
|
|
461003
|
+
- No \`Math.random()\`, \`Date.now()\`, \`repeat: -1\`, or \`<br>\` in content.
|
|
461004
|
+
- Layout-before-animation: position elements at hero-frame state in CSS,
|
|
461005
|
+
animate FROM that position.
|
|
461006
|
+
- No exit animations (transitions handle scene exits, except the final beat).
|
|
461007
|
+
- Strictly follow DESIGN.md palette, typography, motion signature.
|
|
461008
|
+
|
|
461009
|
+
Reference shape (verbatim \u2014 match this skeleton exactly, no DOCTYPE / html / body):
|
|
461010
|
+
|
|
461011
|
+
\`\`\`
|
|
461012
|
+
<template id="${compositionId}-template">
|
|
461013
|
+
<div data-composition-id="${compositionId}" data-start="0" data-duration="<sec>" data-width="1920" data-height="1080">
|
|
461014
|
+
<style>
|
|
461015
|
+
[data-composition-id="${compositionId}"] {
|
|
461016
|
+
position: relative;
|
|
461017
|
+
width: 1920px;
|
|
461018
|
+
height: 1080px;
|
|
461019
|
+
background: /* from DESIGN.md */;
|
|
461020
|
+
overflow: hidden;
|
|
461021
|
+
}
|
|
461022
|
+
/* Critical: .clip elements get framework visibility control but NOT
|
|
461023
|
+
sizing \u2014 give them explicit fill or content centering breaks. */
|
|
461024
|
+
[data-composition-id="${compositionId}"] .clip {
|
|
461025
|
+
position: absolute;
|
|
461026
|
+
inset: 0;
|
|
461027
|
+
}
|
|
461028
|
+
/* \u2026per-element styles\u2026 */
|
|
461029
|
+
</style>
|
|
461030
|
+
|
|
461031
|
+
<div class="clip" data-start="0" data-duration="<sec>" data-track-index="0">
|
|
461032
|
+
<!-- content; can use display:flex etc. since .clip now fills the scene -->
|
|
461033
|
+
</div>
|
|
461034
|
+
|
|
461035
|
+
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
|
461036
|
+
<script>
|
|
461037
|
+
window.__timelines = window.__timelines || {};
|
|
461038
|
+
const tl = gsap.timeline({ paused: true });
|
|
461039
|
+
// Idle motion spanning full beat duration \u2014 required to keep timeline
|
|
461040
|
+
// length aligned with data-duration (otherwise hold phase goes black).
|
|
461041
|
+
tl.fromTo(".scene-content", { scale: 1.0 }, { scale: 1.015, duration: <sec>, ease: "none" }, 0);
|
|
461042
|
+
// entry tweens
|
|
461043
|
+
window.__timelines["${compositionId}"] = tl;
|
|
461044
|
+
</script>
|
|
461045
|
+
</div>
|
|
461046
|
+
</template>
|
|
461047
|
+
\`\`\`
|
|
460928
461048
|
|
|
460929
461049
|
=== Storyboard \u2014 global direction ===
|
|
460930
461050
|
|
|
@@ -460938,8 +461058,9 @@ ${ctx.beat.body}
|
|
|
460938
461058
|
|
|
460939
461059
|
=== Output format ===
|
|
460940
461060
|
|
|
460941
|
-
Return ONE
|
|
460942
|
-
No prose, no explanations, no
|
|
461061
|
+
Return ONE bare \`<template>\` fragment in a single \`\`\`html\`\`\` fenced code
|
|
461062
|
+
block. No \`<!DOCTYPE>\`, no \`<html>\`, no prose, no explanations, no
|
|
461063
|
+
commentary outside the code block. Just the template.`;
|
|
460943
461064
|
if (ctx.retryFeedback && ctx.retryFeedback.trim().length > 0) {
|
|
460944
461065
|
return `${baseRequirements}
|
|
460945
461066
|
|
|
@@ -461218,6 +461339,634 @@ var init_compose_scenes_skills = __esm({
|
|
|
461218
461339
|
}
|
|
461219
461340
|
});
|
|
461220
461341
|
|
|
461342
|
+
// ../cli/src/commands/_shared/scene-audio-scan.ts
|
|
461343
|
+
import { readFile as readFile22 } from "node:fs/promises";
|
|
461344
|
+
import { resolve as resolve36 } from "node:path";
|
|
461345
|
+
function parseRootClips(rootHtml) {
|
|
461346
|
+
const clips = [];
|
|
461347
|
+
const clipRegex = /<div\b[^>]*class="clip"[^>]*>/gi;
|
|
461348
|
+
let match2;
|
|
461349
|
+
while ((match2 = clipRegex.exec(rootHtml)) !== null) {
|
|
461350
|
+
const tag = match2[0];
|
|
461351
|
+
const compositionId = pickAttr(tag, "data-composition-id");
|
|
461352
|
+
const compositionSrc = pickAttr(tag, "data-composition-src");
|
|
461353
|
+
const start = pickNumberAttr(tag, "data-start");
|
|
461354
|
+
const duration = pickNumberAttr(tag, "data-duration");
|
|
461355
|
+
const trackIndex = pickNumberAttr(tag, "data-track-index") ?? 1;
|
|
461356
|
+
if (!compositionId || !compositionSrc || start === null || duration === null) {
|
|
461357
|
+
continue;
|
|
461358
|
+
}
|
|
461359
|
+
clips.push({ compositionId, compositionSrc, start, duration, trackIndex });
|
|
461360
|
+
}
|
|
461361
|
+
return clips;
|
|
461362
|
+
}
|
|
461363
|
+
function parseSceneAudios(compositionHtml) {
|
|
461364
|
+
const out = [];
|
|
461365
|
+
const audioRegex = /<audio\b([^>]*)>/gi;
|
|
461366
|
+
let match2;
|
|
461367
|
+
while ((match2 = audioRegex.exec(compositionHtml)) !== null) {
|
|
461368
|
+
const attrs = match2[1];
|
|
461369
|
+
const src = pickAttr(attrs, "src");
|
|
461370
|
+
if (!src) continue;
|
|
461371
|
+
const localStart = pickNumberAttr(attrs, "data-start") ?? 0;
|
|
461372
|
+
const durationRaw = pickAttr(attrs, "data-duration");
|
|
461373
|
+
const durationHint = !durationRaw || durationRaw === "auto" ? "auto" : Number(durationRaw);
|
|
461374
|
+
const volume = pickNumberAttr(attrs, "data-volume") ?? 1;
|
|
461375
|
+
const trackIndex = pickNumberAttr(attrs, "data-track-index") ?? 2;
|
|
461376
|
+
out.push({ srcRel: src, localStart, durationHint, volume, trackIndex });
|
|
461377
|
+
}
|
|
461378
|
+
return out;
|
|
461379
|
+
}
|
|
461380
|
+
function makeFsCompositionReader(projectDir) {
|
|
461381
|
+
return async (compositionSrcRel) => {
|
|
461382
|
+
const abs = resolve36(projectDir, compositionSrcRel);
|
|
461383
|
+
try {
|
|
461384
|
+
return await readFile22(abs, "utf-8");
|
|
461385
|
+
} catch {
|
|
461386
|
+
return null;
|
|
461387
|
+
}
|
|
461388
|
+
};
|
|
461389
|
+
}
|
|
461390
|
+
async function scanSceneAudio(opts) {
|
|
461391
|
+
const reader = opts.readComposition ?? makeFsCompositionReader(opts.projectDir);
|
|
461392
|
+
const clips = parseRootClips(opts.rootHtml);
|
|
461393
|
+
const out = [];
|
|
461394
|
+
for (const clip of clips) {
|
|
461395
|
+
const html = await reader(clip.compositionSrc);
|
|
461396
|
+
if (!html) continue;
|
|
461397
|
+
const audios = parseSceneAudios(html);
|
|
461398
|
+
for (const audio of audios) {
|
|
461399
|
+
out.push({
|
|
461400
|
+
srcRel: audio.srcRel,
|
|
461401
|
+
srcAbs: resolve36(opts.projectDir, audio.srcRel),
|
|
461402
|
+
absoluteStart: clip.start + audio.localStart,
|
|
461403
|
+
durationHint: audio.durationHint,
|
|
461404
|
+
clipDurationCap: clip.duration - audio.localStart,
|
|
461405
|
+
volume: audio.volume,
|
|
461406
|
+
trackIndex: audio.trackIndex,
|
|
461407
|
+
compositionSrc: clip.compositionSrc
|
|
461408
|
+
});
|
|
461409
|
+
}
|
|
461410
|
+
}
|
|
461411
|
+
out.sort((a, b) => a.absoluteStart - b.absoluteStart);
|
|
461412
|
+
return out;
|
|
461413
|
+
}
|
|
461414
|
+
function pickAttr(tag, name) {
|
|
461415
|
+
const re = new RegExp(`\\b${escapeRegex3(name)}\\s*=\\s*("([^"]*)"|'([^']*)')`);
|
|
461416
|
+
const m = tag.match(re);
|
|
461417
|
+
if (!m) return null;
|
|
461418
|
+
return m[2] ?? m[3] ?? null;
|
|
461419
|
+
}
|
|
461420
|
+
function pickNumberAttr(tag, name) {
|
|
461421
|
+
const raw2 = pickAttr(tag, name);
|
|
461422
|
+
if (raw2 === null) return null;
|
|
461423
|
+
const n = Number(raw2);
|
|
461424
|
+
return Number.isFinite(n) ? n : null;
|
|
461425
|
+
}
|
|
461426
|
+
function escapeRegex3(s) {
|
|
461427
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
461428
|
+
}
|
|
461429
|
+
var init_scene_audio_scan = __esm({
|
|
461430
|
+
"../cli/src/commands/_shared/scene-audio-scan.ts"() {
|
|
461431
|
+
"use strict";
|
|
461432
|
+
}
|
|
461433
|
+
});
|
|
461434
|
+
|
|
461435
|
+
// ../cli/src/commands/_shared/scene-audio-mux.ts
|
|
461436
|
+
import { rename as rename6, unlink as unlink5 } from "node:fs/promises";
|
|
461437
|
+
import { resolve as resolve37, dirname as dirname23, extname as extname12, basename as basename15 } from "node:path";
|
|
461438
|
+
function buildAudioMuxFilter(audios) {
|
|
461439
|
+
if (audios.length === 0) return null;
|
|
461440
|
+
const labels = [];
|
|
461441
|
+
const stages = [];
|
|
461442
|
+
audios.forEach((a, i) => {
|
|
461443
|
+
const inputIdx = i + 1;
|
|
461444
|
+
const delayMs = Math.max(0, Math.round(a.absoluteStart * 1e3));
|
|
461445
|
+
const volume = Number.isFinite(a.volume) ? a.volume : 1;
|
|
461446
|
+
const trimSec = Math.max(0, a.clipDurationCap);
|
|
461447
|
+
const label = `a${i}`;
|
|
461448
|
+
const stage = [
|
|
461449
|
+
`[${inputIdx}:a]`,
|
|
461450
|
+
`atrim=duration=${trimSec.toFixed(3)},`,
|
|
461451
|
+
`asetpts=PTS-STARTPTS,`,
|
|
461452
|
+
`adelay=${delayMs}:all=1,`,
|
|
461453
|
+
`volume=${volume}`,
|
|
461454
|
+
`[${label}]`
|
|
461455
|
+
].join("");
|
|
461456
|
+
stages.push(stage);
|
|
461457
|
+
labels.push(`[${label}]`);
|
|
461458
|
+
});
|
|
461459
|
+
if (audios.length === 1) {
|
|
461460
|
+
return {
|
|
461461
|
+
filterComplex: stages.join(";"),
|
|
461462
|
+
outLabel: labels[0],
|
|
461463
|
+
inputCount: 1
|
|
461464
|
+
};
|
|
461465
|
+
}
|
|
461466
|
+
const mix = `${labels.join("")}amix=inputs=${audios.length}:dropout_transition=0:normalize=0[mixed]`;
|
|
461467
|
+
return {
|
|
461468
|
+
filterComplex: `${stages.join(";")};${mix}`,
|
|
461469
|
+
outLabel: "[mixed]",
|
|
461470
|
+
inputCount: audios.length
|
|
461471
|
+
};
|
|
461472
|
+
}
|
|
461473
|
+
function audioCodecForFormat(format4) {
|
|
461474
|
+
if (format4 === "webm") return "libopus";
|
|
461475
|
+
if (format4 === "mov") return "pcm_s16le";
|
|
461476
|
+
return "aac";
|
|
461477
|
+
}
|
|
461478
|
+
async function muxAudioIntoVideo(opts) {
|
|
461479
|
+
if (opts.audios.length === 0) {
|
|
461480
|
+
return { success: true, outputPath: opts.videoPath, audioCount: 0 };
|
|
461481
|
+
}
|
|
461482
|
+
if (!commandExists("ffmpeg")) {
|
|
461483
|
+
return {
|
|
461484
|
+
success: false,
|
|
461485
|
+
outputPath: opts.videoPath,
|
|
461486
|
+
audioCount: opts.audios.length,
|
|
461487
|
+
error: "ffmpeg not found in PATH \u2014 install via `brew install ffmpeg` (mac) or your package manager"
|
|
461488
|
+
};
|
|
461489
|
+
}
|
|
461490
|
+
const filter4 = buildAudioMuxFilter(opts.audios);
|
|
461491
|
+
if (!filter4) {
|
|
461492
|
+
return { success: true, outputPath: opts.videoPath, audioCount: 0 };
|
|
461493
|
+
}
|
|
461494
|
+
const ext = extname12(opts.videoPath) || `.${opts.format}`;
|
|
461495
|
+
const tmpPath = resolve37(
|
|
461496
|
+
dirname23(opts.videoPath),
|
|
461497
|
+
`.${basename15(opts.videoPath, ext)}.muxing${ext}`
|
|
461498
|
+
);
|
|
461499
|
+
const args = ["-y", "-loglevel", "error", "-i", opts.videoPath];
|
|
461500
|
+
for (const a of opts.audios) {
|
|
461501
|
+
args.push("-i", a.srcAbs);
|
|
461502
|
+
}
|
|
461503
|
+
args.push(
|
|
461504
|
+
"-filter_complex",
|
|
461505
|
+
filter4.filterComplex,
|
|
461506
|
+
"-map",
|
|
461507
|
+
"0:v",
|
|
461508
|
+
"-map",
|
|
461509
|
+
filter4.outLabel,
|
|
461510
|
+
"-c:v",
|
|
461511
|
+
"copy",
|
|
461512
|
+
"-c:a",
|
|
461513
|
+
audioCodecForFormat(opts.format),
|
|
461514
|
+
// Cap on the video duration so audio that overruns the producer's render
|
|
461515
|
+
// (e.g. a long Kokoro wav on a short scene) doesn't extend the output.
|
|
461516
|
+
// Video drives the timeline because the producer already counted frames.
|
|
461517
|
+
"-t",
|
|
461518
|
+
opts.totalDuration && opts.totalDuration > 0 ? opts.totalDuration.toFixed(3) : opts.videoDuration?.toFixed(3) ?? ""
|
|
461519
|
+
);
|
|
461520
|
+
if (args[args.length - 1] === "") {
|
|
461521
|
+
args.pop();
|
|
461522
|
+
args.pop();
|
|
461523
|
+
}
|
|
461524
|
+
args.push("-movflags", "+faststart", tmpPath);
|
|
461525
|
+
try {
|
|
461526
|
+
const { stderr } = await execSafe("ffmpeg", args);
|
|
461527
|
+
if (stderr && opts.onProgress) {
|
|
461528
|
+
stderr.split(/\r?\n/).forEach((line) => opts.onProgress?.(line));
|
|
461529
|
+
}
|
|
461530
|
+
} catch (err) {
|
|
461531
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
461532
|
+
try {
|
|
461533
|
+
await unlink5(tmpPath);
|
|
461534
|
+
} catch {
|
|
461535
|
+
}
|
|
461536
|
+
return {
|
|
461537
|
+
success: false,
|
|
461538
|
+
outputPath: opts.videoPath,
|
|
461539
|
+
audioCount: opts.audios.length,
|
|
461540
|
+
error: `ffmpeg mux failed: ${msg}`
|
|
461541
|
+
};
|
|
461542
|
+
}
|
|
461543
|
+
await rename6(tmpPath, opts.videoPath);
|
|
461544
|
+
return {
|
|
461545
|
+
success: true,
|
|
461546
|
+
outputPath: opts.videoPath,
|
|
461547
|
+
audioCount: opts.audios.length
|
|
461548
|
+
};
|
|
461549
|
+
}
|
|
461550
|
+
var init_scene_audio_mux = __esm({
|
|
461551
|
+
"../cli/src/commands/_shared/scene-audio-mux.ts"() {
|
|
461552
|
+
"use strict";
|
|
461553
|
+
init_exec_safe();
|
|
461554
|
+
}
|
|
461555
|
+
});
|
|
461556
|
+
|
|
461557
|
+
// ../cli/src/commands/_shared/scene-render.ts
|
|
461558
|
+
var scene_render_exports = {};
|
|
461559
|
+
__export(scene_render_exports, {
|
|
461560
|
+
buildRenderConfig: () => buildRenderConfig,
|
|
461561
|
+
defaultOutputPath: () => defaultOutputPath,
|
|
461562
|
+
executeSceneRender: () => executeSceneRender,
|
|
461563
|
+
qualityToCrf: () => qualityToCrf2
|
|
461564
|
+
});
|
|
461565
|
+
import { mkdir as mkdir17, readFile as readFile23, stat as stat3 } from "node:fs/promises";
|
|
461566
|
+
import { existsSync as existsSync36 } from "node:fs";
|
|
461567
|
+
import { resolve as resolve38, relative as relative6, dirname as dirname24, basename as basename16 } from "node:path";
|
|
461568
|
+
function qualityToCrf2(quality = "standard") {
|
|
461569
|
+
return quality === "draft" ? 28 : quality === "high" ? 18 : 23;
|
|
461570
|
+
}
|
|
461571
|
+
function defaultOutputPath(opts) {
|
|
461572
|
+
const fmt = opts.format ?? "mp4";
|
|
461573
|
+
const now = opts.now ?? /* @__PURE__ */ new Date();
|
|
461574
|
+
const stamp = now.toISOString().replace(/[:T]/g, "-").replace(/\..+$/, "");
|
|
461575
|
+
const name = (opts.projectName ?? basename16(resolve38(opts.projectDir))) || "scene";
|
|
461576
|
+
return resolve38(opts.projectDir, "renders", `${name}-${stamp}.${fmt}`);
|
|
461577
|
+
}
|
|
461578
|
+
async function readProjectName(projectDir) {
|
|
461579
|
+
const cfgPath = resolve38(projectDir, "vibe.project.yaml");
|
|
461580
|
+
if (!existsSync36(cfgPath)) return void 0;
|
|
461581
|
+
try {
|
|
461582
|
+
const raw2 = await (await import("node:fs/promises")).readFile(cfgPath, "utf-8");
|
|
461583
|
+
const parsed = (0, import_yaml5.parse)(raw2);
|
|
461584
|
+
return parsed?.name ?? void 0;
|
|
461585
|
+
} catch {
|
|
461586
|
+
return void 0;
|
|
461587
|
+
}
|
|
461588
|
+
}
|
|
461589
|
+
function buildRenderConfig(opts) {
|
|
461590
|
+
const quality = opts.quality ?? "standard";
|
|
461591
|
+
return {
|
|
461592
|
+
fps: opts.fps ?? 30,
|
|
461593
|
+
quality,
|
|
461594
|
+
format: opts.format ?? "mp4",
|
|
461595
|
+
entryFile: opts.entryFile ?? "index.html",
|
|
461596
|
+
crf: qualityToCrf2(quality),
|
|
461597
|
+
workers: opts.workers ?? 1
|
|
461598
|
+
};
|
|
461599
|
+
}
|
|
461600
|
+
async function executeSceneRender(opts = {}) {
|
|
461601
|
+
const projectDir = resolve38(opts.projectDir ?? ".");
|
|
461602
|
+
const root2 = opts.root ?? "index.html";
|
|
461603
|
+
const projectStat = await safeStat(projectDir);
|
|
461604
|
+
if (!projectStat || !projectStat.isDirectory()) {
|
|
461605
|
+
return { success: false, error: `Project directory not found: ${projectDir}` };
|
|
461606
|
+
}
|
|
461607
|
+
if (!await rootExists(projectDir, root2)) {
|
|
461608
|
+
return {
|
|
461609
|
+
success: false,
|
|
461610
|
+
error: `Root composition not found: ${resolve38(projectDir, root2)}. Run \`vibe scene init\` first.`
|
|
461611
|
+
};
|
|
461612
|
+
}
|
|
461613
|
+
const chrome2 = await preflightChrome();
|
|
461614
|
+
if (!chrome2.ok) {
|
|
461615
|
+
return { success: false, error: chrome2.reason };
|
|
461616
|
+
}
|
|
461617
|
+
const projectName = await readProjectName(projectDir);
|
|
461618
|
+
const outputPath = opts.output ? resolve38(projectDir, opts.output) : defaultOutputPath({ projectDir, projectName, format: opts.format });
|
|
461619
|
+
await mkdir17(dirname24(outputPath), { recursive: true });
|
|
461620
|
+
const config4 = buildRenderConfig({
|
|
461621
|
+
fps: opts.fps,
|
|
461622
|
+
quality: opts.quality,
|
|
461623
|
+
format: opts.format,
|
|
461624
|
+
workers: opts.workers,
|
|
461625
|
+
entryFile: root2
|
|
461626
|
+
});
|
|
461627
|
+
const job = createRenderJob(config4);
|
|
461628
|
+
const start = Date.now();
|
|
461629
|
+
try {
|
|
461630
|
+
await executeRenderJob(
|
|
461631
|
+
job,
|
|
461632
|
+
projectDir,
|
|
461633
|
+
outputPath,
|
|
461634
|
+
(j, msg) => opts.onProgress?.(j.progress, j.currentStage ?? msg),
|
|
461635
|
+
opts.signal
|
|
461636
|
+
);
|
|
461637
|
+
} catch (err) {
|
|
461638
|
+
return {
|
|
461639
|
+
success: false,
|
|
461640
|
+
error: err instanceof Error ? err.message : String(err)
|
|
461641
|
+
};
|
|
461642
|
+
}
|
|
461643
|
+
let audioCount = 0;
|
|
461644
|
+
let audioMuxApplied = false;
|
|
461645
|
+
let audioMuxWarning;
|
|
461646
|
+
try {
|
|
461647
|
+
opts.onProgress?.(0.95, "Mixing audio");
|
|
461648
|
+
const rootHtml = await readFile23(resolve38(projectDir, root2), "utf-8");
|
|
461649
|
+
const audios = await scanSceneAudio({ projectDir, rootHtml });
|
|
461650
|
+
audioCount = audios.length;
|
|
461651
|
+
if (audios.length > 0) {
|
|
461652
|
+
const videoDuration = job.totalFrames && config4.fps ? job.totalFrames / config4.fps : void 0;
|
|
461653
|
+
const mux = await muxAudioIntoVideo({
|
|
461654
|
+
videoPath: outputPath,
|
|
461655
|
+
audios,
|
|
461656
|
+
format: config4.format ?? "mp4",
|
|
461657
|
+
videoDuration,
|
|
461658
|
+
onProgress: (line) => {
|
|
461659
|
+
if (line) opts.onProgress?.(0.97, line);
|
|
461660
|
+
}
|
|
461661
|
+
});
|
|
461662
|
+
if (mux.success) {
|
|
461663
|
+
audioMuxApplied = true;
|
|
461664
|
+
} else {
|
|
461665
|
+
audioMuxWarning = mux.error;
|
|
461666
|
+
}
|
|
461667
|
+
}
|
|
461668
|
+
} catch (err) {
|
|
461669
|
+
audioMuxWarning = err instanceof Error ? err.message : String(err);
|
|
461670
|
+
}
|
|
461671
|
+
return {
|
|
461672
|
+
success: true,
|
|
461673
|
+
outputPath: relative6(process.cwd(), outputPath) || outputPath,
|
|
461674
|
+
durationMs: Date.now() - start,
|
|
461675
|
+
framesRendered: job.framesRendered,
|
|
461676
|
+
totalFrames: job.totalFrames,
|
|
461677
|
+
fps: config4.fps,
|
|
461678
|
+
quality: config4.quality,
|
|
461679
|
+
format: config4.format,
|
|
461680
|
+
audioCount,
|
|
461681
|
+
audioMuxApplied,
|
|
461682
|
+
audioMuxWarning
|
|
461683
|
+
};
|
|
461684
|
+
}
|
|
461685
|
+
async function safeStat(p) {
|
|
461686
|
+
try {
|
|
461687
|
+
return await stat3(p);
|
|
461688
|
+
} catch {
|
|
461689
|
+
return null;
|
|
461690
|
+
}
|
|
461691
|
+
}
|
|
461692
|
+
var import_yaml5;
|
|
461693
|
+
var init_scene_render = __esm({
|
|
461694
|
+
"../cli/src/commands/_shared/scene-render.ts"() {
|
|
461695
|
+
"use strict";
|
|
461696
|
+
import_yaml5 = __toESM(require_dist16(), 1);
|
|
461697
|
+
init_dist();
|
|
461698
|
+
init_chrome();
|
|
461699
|
+
init_scene_lint();
|
|
461700
|
+
init_scene_audio_scan();
|
|
461701
|
+
init_scene_audio_mux();
|
|
461702
|
+
}
|
|
461703
|
+
});
|
|
461704
|
+
|
|
461705
|
+
// ../cli/src/commands/_shared/tts-resolve.ts
|
|
461706
|
+
async function resolveTtsProvider(preferred = "auto") {
|
|
461707
|
+
const choice = preferred === "auto" ? hasApiKey("ELEVENLABS_API_KEY") ? "elevenlabs" : "kokoro" : preferred;
|
|
461708
|
+
if (choice === "elevenlabs") {
|
|
461709
|
+
return buildElevenLabs();
|
|
461710
|
+
}
|
|
461711
|
+
return buildKokoro();
|
|
461712
|
+
}
|
|
461713
|
+
async function buildElevenLabs() {
|
|
461714
|
+
const key2 = await getApiKey("ELEVENLABS_API_KEY", "ElevenLabs");
|
|
461715
|
+
if (!key2) {
|
|
461716
|
+
throw new TtsKeyMissingError("elevenlabs");
|
|
461717
|
+
}
|
|
461718
|
+
const provider = new ElevenLabsProvider();
|
|
461719
|
+
await provider.initialize({ apiKey: key2 });
|
|
461720
|
+
const call = async (text, opts) => provider.textToSpeech(text, {
|
|
461721
|
+
voiceId: opts?.voice,
|
|
461722
|
+
speed: opts?.speed
|
|
461723
|
+
});
|
|
461724
|
+
return { provider: "elevenlabs", audioExtension: "mp3", call };
|
|
461725
|
+
}
|
|
461726
|
+
async function buildKokoro() {
|
|
461727
|
+
const provider = new KokoroProvider();
|
|
461728
|
+
await provider.initialize({});
|
|
461729
|
+
const call = async (text, opts) => provider.textToSpeech(text, {
|
|
461730
|
+
voice: opts?.voice,
|
|
461731
|
+
speed: opts?.speed,
|
|
461732
|
+
onProgress: opts?.onProgress
|
|
461733
|
+
});
|
|
461734
|
+
return { provider: "kokoro", audioExtension: "wav", call };
|
|
461735
|
+
}
|
|
461736
|
+
function parseTtsProviderName(value) {
|
|
461737
|
+
if (!value) return "auto";
|
|
461738
|
+
if (value === "auto" || value === "elevenlabs" || value === "kokoro") {
|
|
461739
|
+
return value;
|
|
461740
|
+
}
|
|
461741
|
+
throw new Error(
|
|
461742
|
+
`Invalid --tts: ${value}. Valid: auto, elevenlabs, kokoro.`
|
|
461743
|
+
);
|
|
461744
|
+
}
|
|
461745
|
+
var TtsKeyMissingError;
|
|
461746
|
+
var init_tts_resolve = __esm({
|
|
461747
|
+
"../cli/src/commands/_shared/tts-resolve.ts"() {
|
|
461748
|
+
"use strict";
|
|
461749
|
+
init_dist2();
|
|
461750
|
+
init_api_key();
|
|
461751
|
+
init_api_key();
|
|
461752
|
+
TtsKeyMissingError = class extends Error {
|
|
461753
|
+
constructor(provider) {
|
|
461754
|
+
super(
|
|
461755
|
+
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.`
|
|
461756
|
+
);
|
|
461757
|
+
this.provider = provider;
|
|
461758
|
+
this.name = "TtsKeyMissingError";
|
|
461759
|
+
}
|
|
461760
|
+
};
|
|
461761
|
+
}
|
|
461762
|
+
});
|
|
461763
|
+
|
|
461764
|
+
// ../cli/src/commands/_shared/scene-build.ts
|
|
461765
|
+
var scene_build_exports = {};
|
|
461766
|
+
__export(scene_build_exports, {
|
|
461767
|
+
executeSceneBuild: () => executeSceneBuild
|
|
461768
|
+
});
|
|
461769
|
+
import { existsSync as existsSync37 } from "node:fs";
|
|
461770
|
+
import { mkdir as mkdir18, readFile as readFile24, writeFile as writeFile23 } from "node:fs/promises";
|
|
461771
|
+
import { dirname as dirname25, join as join24, resolve as resolve39 } from "node:path";
|
|
461772
|
+
async function executeSceneBuild(opts) {
|
|
461773
|
+
const startedAt = Date.now();
|
|
461774
|
+
const projectDir = resolve39(opts.projectDir);
|
|
461775
|
+
const onProgress = opts.onProgress ?? (() => {
|
|
461776
|
+
});
|
|
461777
|
+
const storyboardPath = join24(projectDir, "STORYBOARD.md");
|
|
461778
|
+
if (!existsSync37(storyboardPath)) {
|
|
461779
|
+
return failBeforePrimitives(`STORYBOARD.md not found at ${storyboardPath}`, startedAt);
|
|
461780
|
+
}
|
|
461781
|
+
const storyboardMd = await readFile24(storyboardPath, "utf-8");
|
|
461782
|
+
const parsed = parseStoryboard(storyboardMd);
|
|
461783
|
+
if (parsed.beats.length === 0) {
|
|
461784
|
+
return failBeforePrimitives(
|
|
461785
|
+
`STORYBOARD.md at ${storyboardPath} has no \`## Beat \u2026\` headings.`,
|
|
461786
|
+
startedAt
|
|
461787
|
+
);
|
|
461788
|
+
}
|
|
461789
|
+
const ttsProvider = opts.ttsProvider ?? parsed.frontmatter?.providers?.tts ?? "auto";
|
|
461790
|
+
const imageProvider = opts.imageProvider ?? parsed.frontmatter?.providers?.image ?? "openai";
|
|
461791
|
+
const voice = opts.voice ?? parsed.frontmatter?.voice;
|
|
461792
|
+
onProgress({ type: "phase-start", phase: "primitives" });
|
|
461793
|
+
const beatOutcomes = await Promise.all(
|
|
461794
|
+
parsed.beats.map((beat) => buildBeatPrimitives(beat, {
|
|
461795
|
+
projectDir,
|
|
461796
|
+
ttsProvider,
|
|
461797
|
+
voice,
|
|
461798
|
+
imageProvider,
|
|
461799
|
+
imageQuality: opts.imageQuality ?? "hd",
|
|
461800
|
+
imageSize: opts.imageSize ?? "1536x1024",
|
|
461801
|
+
skipNarration: opts.skipNarration ?? false,
|
|
461802
|
+
skipBackdrop: opts.skipBackdrop ?? false,
|
|
461803
|
+
force: opts.force ?? false,
|
|
461804
|
+
onProgress
|
|
461805
|
+
}))
|
|
461806
|
+
);
|
|
461807
|
+
onProgress({ type: "phase-start", phase: "compose" });
|
|
461808
|
+
const composeResult = await executeComposeScenesWithSkills(
|
|
461809
|
+
{
|
|
461810
|
+
project: ".",
|
|
461811
|
+
effort: opts.effort,
|
|
461812
|
+
cacheDir: opts.cacheDir,
|
|
461813
|
+
onProgress: (e) => onProgress(e)
|
|
461814
|
+
},
|
|
461815
|
+
projectDir
|
|
461816
|
+
);
|
|
461817
|
+
if (!composeResult.success) {
|
|
461818
|
+
return {
|
|
461819
|
+
success: false,
|
|
461820
|
+
error: `compose failed: ${composeResult.error ?? "unknown"}`,
|
|
461821
|
+
beats: beatOutcomes,
|
|
461822
|
+
composeData: composeResult.data,
|
|
461823
|
+
totalLatencyMs: Date.now() - startedAt
|
|
461824
|
+
};
|
|
461825
|
+
}
|
|
461826
|
+
let outputPath;
|
|
461827
|
+
let renderResult;
|
|
461828
|
+
if (!opts.skipRender) {
|
|
461829
|
+
onProgress({ type: "phase-start", phase: "render" });
|
|
461830
|
+
onProgress({ type: "render-start" });
|
|
461831
|
+
renderResult = await executeSceneRender({ projectDir });
|
|
461832
|
+
if (!renderResult.success) {
|
|
461833
|
+
return {
|
|
461834
|
+
success: false,
|
|
461835
|
+
error: `render failed: ${renderResult.error ?? "unknown"}`,
|
|
461836
|
+
beats: beatOutcomes,
|
|
461837
|
+
composeData: composeResult.data,
|
|
461838
|
+
renderResult,
|
|
461839
|
+
totalLatencyMs: Date.now() - startedAt
|
|
461840
|
+
};
|
|
461841
|
+
}
|
|
461842
|
+
outputPath = renderResult.outputPath;
|
|
461843
|
+
if (outputPath) onProgress({ type: "render-done", outputPath });
|
|
461844
|
+
}
|
|
461845
|
+
return {
|
|
461846
|
+
success: true,
|
|
461847
|
+
beats: beatOutcomes,
|
|
461848
|
+
outputPath,
|
|
461849
|
+
composeData: composeResult.data,
|
|
461850
|
+
renderResult,
|
|
461851
|
+
totalLatencyMs: Date.now() - startedAt
|
|
461852
|
+
};
|
|
461853
|
+
}
|
|
461854
|
+
async function buildBeatPrimitives(beat, ctx) {
|
|
461855
|
+
const [narration, backdrop] = await Promise.all([
|
|
461856
|
+
ctx.skipNarration ? skipped("narration", beat.id, "--skip-narration", ctx) : dispatchNarration(beat, ctx),
|
|
461857
|
+
ctx.skipBackdrop ? skipped("backdrop", beat.id, "--skip-backdrop", ctx) : dispatchBackdrop(beat, ctx)
|
|
461858
|
+
]);
|
|
461859
|
+
return {
|
|
461860
|
+
beatId: beat.id,
|
|
461861
|
+
narrationStatus: narration.status,
|
|
461862
|
+
narrationPath: narration.path,
|
|
461863
|
+
narrationError: narration.error,
|
|
461864
|
+
backdropStatus: backdrop.status,
|
|
461865
|
+
backdropPath: backdrop.path,
|
|
461866
|
+
backdropError: backdrop.error
|
|
461867
|
+
};
|
|
461868
|
+
}
|
|
461869
|
+
async function dispatchNarration(beat, ctx) {
|
|
461870
|
+
const text = beat.cues?.narration;
|
|
461871
|
+
if (!text) return { status: "no-cue" };
|
|
461872
|
+
for (const ext of ["mp3", "wav"]) {
|
|
461873
|
+
const rel2 = `assets/narration-${beat.id}.${ext}`;
|
|
461874
|
+
if (existsSync37(join24(ctx.projectDir, rel2)) && !ctx.force) {
|
|
461875
|
+
ctx.onProgress({ type: "narration-cached", beatId: beat.id, path: rel2 });
|
|
461876
|
+
return { status: "cached", path: rel2 };
|
|
461877
|
+
}
|
|
461878
|
+
}
|
|
461879
|
+
let resolution;
|
|
461880
|
+
try {
|
|
461881
|
+
resolution = await resolveTtsProvider(ctx.ttsProvider);
|
|
461882
|
+
} catch (err) {
|
|
461883
|
+
const error = err instanceof TtsKeyMissingError ? err.message : err.message;
|
|
461884
|
+
ctx.onProgress({ type: "narration-failed", beatId: beat.id, error });
|
|
461885
|
+
return { status: "failed", error };
|
|
461886
|
+
}
|
|
461887
|
+
const result = await resolution.call(text, { voice: ctx.voice });
|
|
461888
|
+
if (!result.success || !result.audioBuffer) {
|
|
461889
|
+
const error = result.error ?? "unknown TTS failure";
|
|
461890
|
+
ctx.onProgress({ type: "narration-failed", beatId: beat.id, error });
|
|
461891
|
+
return { status: "failed", error };
|
|
461892
|
+
}
|
|
461893
|
+
const rel = `assets/narration-${beat.id}.${resolution.audioExtension}`;
|
|
461894
|
+
const abs = join24(ctx.projectDir, rel);
|
|
461895
|
+
await mkdir18(dirname25(abs), { recursive: true });
|
|
461896
|
+
await writeFile23(abs, result.audioBuffer);
|
|
461897
|
+
ctx.onProgress({
|
|
461898
|
+
type: "narration-generated",
|
|
461899
|
+
beatId: beat.id,
|
|
461900
|
+
path: rel,
|
|
461901
|
+
provider: resolution.provider
|
|
461902
|
+
});
|
|
461903
|
+
return { status: "generated", path: rel };
|
|
461904
|
+
}
|
|
461905
|
+
async function dispatchBackdrop(beat, ctx) {
|
|
461906
|
+
const prompt3 = beat.cues?.backdrop;
|
|
461907
|
+
if (!prompt3) return { status: "no-cue" };
|
|
461908
|
+
if (ctx.imageProvider !== "openai") {
|
|
461909
|
+
const error = `image provider "${ctx.imageProvider}" not yet supported (use openai)`;
|
|
461910
|
+
ctx.onProgress({ type: "backdrop-failed", beatId: beat.id, error });
|
|
461911
|
+
return { status: "failed", error };
|
|
461912
|
+
}
|
|
461913
|
+
const rel = `assets/backdrop-${beat.id}.png`;
|
|
461914
|
+
const abs = join24(ctx.projectDir, rel);
|
|
461915
|
+
if (existsSync37(abs) && !ctx.force) {
|
|
461916
|
+
ctx.onProgress({ type: "backdrop-cached", beatId: beat.id, path: rel });
|
|
461917
|
+
return { status: "cached", path: rel };
|
|
461918
|
+
}
|
|
461919
|
+
const apiKey = process.env.OPENAI_API_KEY ?? "";
|
|
461920
|
+
if (!apiKey) {
|
|
461921
|
+
const error = "OPENAI_API_KEY not set \u2014 cannot dispatch backdrop";
|
|
461922
|
+
ctx.onProgress({ type: "backdrop-failed", beatId: beat.id, error });
|
|
461923
|
+
return { status: "failed", error };
|
|
461924
|
+
}
|
|
461925
|
+
const provider = new OpenAIImageProvider();
|
|
461926
|
+
await provider.initialize({ apiKey });
|
|
461927
|
+
const result = await provider.generateImage(prompt3, {
|
|
461928
|
+
model: "gpt-image-2",
|
|
461929
|
+
size: ctx.imageSize,
|
|
461930
|
+
quality: ctx.imageQuality
|
|
461931
|
+
});
|
|
461932
|
+
if (!result.success || !result.images?.[0]?.base64) {
|
|
461933
|
+
const error = result.error ?? "no image data returned";
|
|
461934
|
+
ctx.onProgress({ type: "backdrop-failed", beatId: beat.id, error });
|
|
461935
|
+
return { status: "failed", error };
|
|
461936
|
+
}
|
|
461937
|
+
await mkdir18(dirname25(abs), { recursive: true });
|
|
461938
|
+
await writeFile23(abs, Buffer.from(result.images[0].base64, "base64"));
|
|
461939
|
+
ctx.onProgress({
|
|
461940
|
+
type: "backdrop-generated",
|
|
461941
|
+
beatId: beat.id,
|
|
461942
|
+
path: rel,
|
|
461943
|
+
provider: "openai"
|
|
461944
|
+
});
|
|
461945
|
+
return { status: "generated", path: rel };
|
|
461946
|
+
}
|
|
461947
|
+
async function skipped(kind, beatId, reason, ctx) {
|
|
461948
|
+
ctx.onProgress({ type: `${kind}-skipped`, beatId, reason });
|
|
461949
|
+
return { status: "skipped" };
|
|
461950
|
+
}
|
|
461951
|
+
function failBeforePrimitives(error, startedAt) {
|
|
461952
|
+
return {
|
|
461953
|
+
success: false,
|
|
461954
|
+
error,
|
|
461955
|
+
beats: [],
|
|
461956
|
+
totalLatencyMs: Date.now() - startedAt
|
|
461957
|
+
};
|
|
461958
|
+
}
|
|
461959
|
+
var init_scene_build = __esm({
|
|
461960
|
+
"../cli/src/commands/_shared/scene-build.ts"() {
|
|
461961
|
+
"use strict";
|
|
461962
|
+
init_dist2();
|
|
461963
|
+
init_compose_scenes_skills();
|
|
461964
|
+
init_scene_render();
|
|
461965
|
+
init_storyboard_parse();
|
|
461966
|
+
init_tts_resolve();
|
|
461967
|
+
}
|
|
461968
|
+
});
|
|
461969
|
+
|
|
461221
461970
|
// src/index.ts
|
|
461222
461971
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
461223
461972
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -462214,7 +462963,7 @@ function buildFFmpegArgs(clips, sources, presetSettings, outputPath, options, so
|
|
|
462214
462963
|
return args;
|
|
462215
462964
|
}
|
|
462216
462965
|
function runFFmpegProcess(ffmpegPath, args, onProgress) {
|
|
462217
|
-
return new Promise((
|
|
462966
|
+
return new Promise((resolve46, reject) => {
|
|
462218
462967
|
const ffmpeg = spawn9(ffmpegPath, args, {
|
|
462219
462968
|
stdio: ["pipe", "pipe", "pipe"]
|
|
462220
462969
|
});
|
|
@@ -462238,7 +462987,7 @@ function runFFmpegProcess(ffmpegPath, args, onProgress) {
|
|
|
462238
462987
|
});
|
|
462239
462988
|
ffmpeg.on("close", (code) => {
|
|
462240
462989
|
if (code === 0) {
|
|
462241
|
-
|
|
462990
|
+
resolve46();
|
|
462242
462991
|
} else {
|
|
462243
462992
|
const errorMatch = stderr.match(/Error.*$/m);
|
|
462244
462993
|
const errorMsg = errorMatch ? errorMatch[0] : `FFmpeg exited with code ${code}`;
|
|
@@ -462374,17 +463123,17 @@ function getPresetSettings(preset, aspectRatio) {
|
|
|
462374
463123
|
}
|
|
462375
463124
|
async function runHyperframesExport(projectPath, options, spinner2) {
|
|
462376
463125
|
spinner2.text = "Loading project...";
|
|
462377
|
-
const { readFile:
|
|
462378
|
-
const { resolve:
|
|
463126
|
+
const { readFile: readFile28 } = await import("node:fs/promises");
|
|
463127
|
+
const { resolve: resolve46, basename: basename19 } = await import("node:path");
|
|
462379
463128
|
const { Project: Project2 } = await Promise.resolve().then(() => (init_engine(), engine_exports));
|
|
462380
463129
|
const { createHyperframesBackend: createHyperframesBackend2 } = await Promise.resolve().then(() => (init_hyperframes(), hyperframes_exports));
|
|
462381
463130
|
const { exitWithError: exitWithError2, generalError: generalError2, outputResult: outputResult2 } = await Promise.resolve().then(() => (init_output(), output_exports));
|
|
462382
463131
|
const chalk2 = (await Promise.resolve().then(() => (init_source(), source_exports))).default;
|
|
462383
|
-
const filePath =
|
|
462384
|
-
const content = await
|
|
463132
|
+
const filePath = resolve46(process.cwd(), projectPath);
|
|
463133
|
+
const content = await readFile28(filePath, "utf-8");
|
|
462385
463134
|
const project = Project2.fromJSON(JSON.parse(content));
|
|
462386
463135
|
const state = project.getState();
|
|
462387
|
-
const outputPath = options.output ?
|
|
463136
|
+
const outputPath = options.output ? resolve46(process.cwd(), options.output) : resolve46(process.cwd(), `${basename19(projectPath, ".vibe.json")}.${options.format ?? "mp4"}`);
|
|
462388
463137
|
const quality = ["draft", "standard", "high"].includes(options.preset ?? "") ? options.preset : "standard";
|
|
462389
463138
|
const backend = createHyperframesBackend2();
|
|
462390
463139
|
spinner2.text = "Rendering with Hyperframes...";
|
|
@@ -462885,9 +463634,9 @@ async function handleAiAnalysisToolCall(name, args) {
|
|
|
462885
463634
|
|
|
462886
463635
|
// src/tools/ai-pipelines.ts
|
|
462887
463636
|
init_ai_script_pipeline();
|
|
462888
|
-
import { writeFile as
|
|
463637
|
+
import { writeFile as writeFile25 } from "node:fs/promises";
|
|
462889
463638
|
import { tmpdir as tmpdir5 } from "node:os";
|
|
462890
|
-
import { join as
|
|
463639
|
+
import { join as join25 } from "node:path";
|
|
462891
463640
|
|
|
462892
463641
|
// ../cli/src/commands/ai-highlights.ts
|
|
462893
463642
|
import { readFile as readFile13, writeFile as writeFile14, mkdir as mkdir12 } from "node:fs/promises";
|
|
@@ -463331,10 +464080,10 @@ Analyze both VISUALS (expressions, actions, scene changes) and AUDIO (speech, re
|
|
|
463331
464080
|
}
|
|
463332
464081
|
|
|
463333
464082
|
// ../cli/src/pipeline/executor.ts
|
|
463334
|
-
var
|
|
463335
|
-
import { resolve as
|
|
463336
|
-
import { readFile as
|
|
463337
|
-
import { existsSync as
|
|
464083
|
+
var import_yaml6 = __toESM(require_dist16(), 1);
|
|
464084
|
+
import { resolve as resolve40 } from "node:path";
|
|
464085
|
+
import { readFile as readFile25, writeFile as writeFile24, mkdir as mkdir19 } from "node:fs/promises";
|
|
464086
|
+
import { existsSync as existsSync38 } from "node:fs";
|
|
463338
464087
|
|
|
463339
464088
|
// ../cli/src/pipeline/resolver.ts
|
|
463340
464089
|
function resolveStepParams(params, completedSteps) {
|
|
@@ -463434,9 +464183,9 @@ function registerAction(action, handler4) {
|
|
|
463434
464183
|
}
|
|
463435
464184
|
function getOutput(params, outputDir, defaultName) {
|
|
463436
464185
|
if (params.output && typeof params.output === "string") {
|
|
463437
|
-
return
|
|
464186
|
+
return resolve40(outputDir, params.output);
|
|
463438
464187
|
}
|
|
463439
|
-
return
|
|
464188
|
+
return resolve40(outputDir, defaultName);
|
|
463440
464189
|
}
|
|
463441
464190
|
async function ensureActionsRegistered() {
|
|
463442
464191
|
if (Object.keys(ACTION_HANDLERS).length > 0) return;
|
|
@@ -463576,14 +464325,64 @@ async function ensureActionsRegistered() {
|
|
|
463576
464325
|
error: r.error
|
|
463577
464326
|
};
|
|
463578
464327
|
});
|
|
464328
|
+
registerAction("scene-build", async (params, outputDir) => {
|
|
464329
|
+
const { executeSceneBuild: executeSceneBuild2 } = await Promise.resolve().then(() => (init_scene_build(), scene_build_exports));
|
|
464330
|
+
const projectRel = params.project ?? ".";
|
|
464331
|
+
const r = await executeSceneBuild2({
|
|
464332
|
+
projectDir: resolve40(outputDir, projectRel),
|
|
464333
|
+
effort: params.effort,
|
|
464334
|
+
skipNarration: params.skipNarration,
|
|
464335
|
+
skipBackdrop: params.skipBackdrop,
|
|
464336
|
+
skipRender: params.skipRender,
|
|
464337
|
+
ttsProvider: params.tts,
|
|
464338
|
+
voice: params.voice,
|
|
464339
|
+
imageProvider: params.imageProvider,
|
|
464340
|
+
imageQuality: params.quality,
|
|
464341
|
+
force: params.force
|
|
464342
|
+
});
|
|
464343
|
+
return {
|
|
464344
|
+
id: "",
|
|
464345
|
+
action: "scene-build",
|
|
464346
|
+
success: r.success,
|
|
464347
|
+
output: r.outputPath,
|
|
464348
|
+
data: { beats: r.beats, totalLatencyMs: r.totalLatencyMs, composeData: r.composeData ?? null },
|
|
464349
|
+
error: r.error
|
|
464350
|
+
};
|
|
464351
|
+
});
|
|
464352
|
+
registerAction("scene-render", async (params, outputDir) => {
|
|
464353
|
+
const { executeSceneRender: executeSceneRender2 } = await Promise.resolve().then(() => (init_scene_render(), scene_render_exports));
|
|
464354
|
+
const projectRel = params.project ?? ".";
|
|
464355
|
+
const r = await executeSceneRender2({
|
|
464356
|
+
projectDir: resolve40(outputDir, projectRel),
|
|
464357
|
+
root: params.root,
|
|
464358
|
+
output: params.output,
|
|
464359
|
+
fps: params.fps,
|
|
464360
|
+
quality: params.quality,
|
|
464361
|
+
format: params.format,
|
|
464362
|
+
workers: params.workers
|
|
464363
|
+
});
|
|
464364
|
+
return {
|
|
464365
|
+
id: "",
|
|
464366
|
+
action: "scene-render",
|
|
464367
|
+
success: r.success,
|
|
464368
|
+
output: r.outputPath,
|
|
464369
|
+
data: {
|
|
464370
|
+
durationMs: r.durationMs,
|
|
464371
|
+
framesRendered: r.framesRendered,
|
|
464372
|
+
audioCount: r.audioCount,
|
|
464373
|
+
audioMuxApplied: r.audioMuxApplied
|
|
464374
|
+
},
|
|
464375
|
+
error: r.error
|
|
464376
|
+
};
|
|
464377
|
+
});
|
|
463579
464378
|
}
|
|
463580
464379
|
async function loadPipeline(filePath) {
|
|
463581
|
-
const absPath =
|
|
463582
|
-
if (!
|
|
464380
|
+
const absPath = resolve40(process.cwd(), filePath);
|
|
464381
|
+
if (!existsSync38(absPath)) {
|
|
463583
464382
|
throw new Error(`Pipeline file not found: ${absPath}`);
|
|
463584
464383
|
}
|
|
463585
|
-
const content = await
|
|
463586
|
-
const manifest = (0,
|
|
464384
|
+
const content = await readFile25(absPath, "utf-8");
|
|
464385
|
+
const manifest = (0, import_yaml6.parse)(content);
|
|
463587
464386
|
if (!manifest.name) throw new Error("Pipeline missing 'name' field");
|
|
463588
464387
|
if (!manifest.steps || !Array.isArray(manifest.steps)) throw new Error("Pipeline missing 'steps' array");
|
|
463589
464388
|
const ids = /* @__PURE__ */ new Set();
|
|
@@ -463598,16 +464397,16 @@ async function loadPipeline(filePath) {
|
|
|
463598
464397
|
var CHECKPOINT_FILE = ".pipeline-state.yaml";
|
|
463599
464398
|
async function executePipeline(manifest, options = {}) {
|
|
463600
464399
|
await ensureActionsRegistered();
|
|
463601
|
-
const outputDir =
|
|
463602
|
-
await
|
|
464400
|
+
const outputDir = resolve40(process.cwd(), options.outputDir || `${manifest.name}-output`);
|
|
464401
|
+
await mkdir19(outputDir, { recursive: true });
|
|
463603
464402
|
const completedSteps = /* @__PURE__ */ new Map();
|
|
463604
464403
|
const results = [];
|
|
463605
464404
|
const startTime = Date.now();
|
|
463606
464405
|
if (options.resume) {
|
|
463607
|
-
const checkpointPath =
|
|
463608
|
-
if (
|
|
463609
|
-
const checkpointContent = await
|
|
463610
|
-
const checkpoint = (0,
|
|
464406
|
+
const checkpointPath = resolve40(outputDir, CHECKPOINT_FILE);
|
|
464407
|
+
if (existsSync38(checkpointPath)) {
|
|
464408
|
+
const checkpointContent = await readFile25(checkpointPath, "utf-8");
|
|
464409
|
+
const checkpoint = (0, import_yaml6.parse)(checkpointContent);
|
|
463611
464410
|
for (const cs of checkpoint.completedSteps) {
|
|
463612
464411
|
completedSteps.set(cs.id, {
|
|
463613
464412
|
id: cs.id,
|
|
@@ -463724,9 +464523,9 @@ async function executePipeline(manifest, options = {}) {
|
|
|
463724
464523
|
data: s.data
|
|
463725
464524
|
}))
|
|
463726
464525
|
};
|
|
463727
|
-
await
|
|
463728
|
-
|
|
463729
|
-
(0,
|
|
464526
|
+
await writeFile24(
|
|
464527
|
+
resolve40(outputDir, CHECKPOINT_FILE),
|
|
464528
|
+
(0, import_yaml6.stringify)(checkpoint, { indent: 2 }),
|
|
463730
464529
|
"utf-8"
|
|
463731
464530
|
);
|
|
463732
464531
|
} else {
|
|
@@ -463973,8 +464772,8 @@ async function handleAiPipelineToolCall(name, args) {
|
|
|
463973
464772
|
let resolvedPath = pipelinePath;
|
|
463974
464773
|
let tempPath;
|
|
463975
464774
|
if (pipelineYaml) {
|
|
463976
|
-
tempPath =
|
|
463977
|
-
await
|
|
464775
|
+
tempPath = join25(tmpdir5(), `vibe-mcp-pipeline-${Date.now()}.yaml`);
|
|
464776
|
+
await writeFile25(tempPath, pipelineYaml, "utf-8");
|
|
463978
464777
|
resolvedPath = tempPath;
|
|
463979
464778
|
}
|
|
463980
464779
|
try {
|
|
@@ -464060,9 +464859,9 @@ init_ai_edit();
|
|
|
464060
464859
|
init_api_key();
|
|
464061
464860
|
init_exec_safe();
|
|
464062
464861
|
init_remotion();
|
|
464063
|
-
import { resolve as
|
|
464064
|
-
import { writeFile as
|
|
464065
|
-
import { existsSync as
|
|
464862
|
+
import { resolve as resolve41, dirname as dirname26, basename as basename17 } from "node:path";
|
|
464863
|
+
import { writeFile as writeFile26, mkdir as mkdir20, rm as rm5 } from "node:fs/promises";
|
|
464864
|
+
import { existsSync as existsSync39 } from "node:fs";
|
|
464066
464865
|
import { tmpdir as tmpdir6 } from "node:os";
|
|
464067
464866
|
var ASS_STYLES = ["karaoke-sweep", "typewriter"];
|
|
464068
464867
|
var SENTENCE_BREAKS = /[.!?]/;
|
|
@@ -464212,9 +465011,9 @@ async function executeAnimatedCaption(options) {
|
|
|
464212
465011
|
} catch {
|
|
464213
465012
|
}
|
|
464214
465013
|
const effectiveFontSize = fontSize ?? Math.round(height * 0.04);
|
|
464215
|
-
const tmpAudioDir =
|
|
464216
|
-
await
|
|
464217
|
-
const audioPath =
|
|
465014
|
+
const tmpAudioDir = resolve41(tmpdir6(), `vf-ac-${Date.now()}`);
|
|
465015
|
+
await mkdir20(tmpAudioDir, { recursive: true });
|
|
465016
|
+
const audioPath = resolve41(tmpAudioDir, "audio.wav");
|
|
464218
465017
|
await execSafe("ffmpeg", [
|
|
464219
465018
|
"-y",
|
|
464220
465019
|
"-i",
|
|
@@ -464241,10 +465040,10 @@ async function executeAnimatedCaption(options) {
|
|
|
464241
465040
|
return { success: false, error: "No words detected in transcription" };
|
|
464242
465041
|
}
|
|
464243
465042
|
const groups = groupWords(transcript.words, { wordsPerGroup, maxChars });
|
|
464244
|
-
const absOutputPath =
|
|
464245
|
-
const outDir =
|
|
464246
|
-
if (!
|
|
464247
|
-
await
|
|
465043
|
+
const absOutputPath = resolve41(process.cwd(), outputPath);
|
|
465044
|
+
const outDir = dirname26(absOutputPath);
|
|
465045
|
+
if (!existsSync39(outDir)) {
|
|
465046
|
+
await mkdir20(outDir, { recursive: true });
|
|
464248
465047
|
}
|
|
464249
465048
|
if (tier === "ass") {
|
|
464250
465049
|
const assContent = generateASS(
|
|
@@ -464252,8 +465051,8 @@ async function executeAnimatedCaption(options) {
|
|
|
464252
465051
|
effectiveStyle,
|
|
464253
465052
|
{ highlightColor, fontSize: effectiveFontSize, position, width, height }
|
|
464254
465053
|
);
|
|
464255
|
-
const assPath =
|
|
464256
|
-
await
|
|
465054
|
+
const assPath = resolve41(tmpAudioDir, "captions.ass");
|
|
465055
|
+
await writeFile26(assPath, assContent, "utf-8");
|
|
464257
465056
|
const escapedAssPath = assPath.replace(/\\/g, "\\\\").replace(/:/g, "\\:");
|
|
464258
465057
|
await execSafe("ffmpeg", [
|
|
464259
465058
|
"-y",
|
|
@@ -464275,7 +465074,7 @@ async function executeAnimatedCaption(options) {
|
|
|
464275
465074
|
width,
|
|
464276
465075
|
height,
|
|
464277
465076
|
fps: videoFps,
|
|
464278
|
-
videoFileName:
|
|
465077
|
+
videoFileName: basename17(videoPath)
|
|
464279
465078
|
});
|
|
464280
465079
|
const durationInFrames = Math.ceil(duration * videoFps);
|
|
464281
465080
|
const renderResult = await renderWithEmbeddedVideo({
|
|
@@ -464286,7 +465085,7 @@ async function executeAnimatedCaption(options) {
|
|
|
464286
465085
|
fps: videoFps,
|
|
464287
465086
|
durationInFrames,
|
|
464288
465087
|
videoPath,
|
|
464289
|
-
videoFileName:
|
|
465088
|
+
videoFileName: basename17(videoPath),
|
|
464290
465089
|
outputPath: absOutputPath
|
|
464291
465090
|
});
|
|
464292
465091
|
if (!renderResult.success) {
|
|
@@ -465202,413 +466001,20 @@ async function handleAiEditAdvancedToolCall(name, args) {
|
|
|
465202
466001
|
// src/tools/scene.ts
|
|
465203
466002
|
init_scene_project();
|
|
465204
466003
|
init_scene_lint();
|
|
465205
|
-
|
|
465206
|
-
|
|
465207
|
-
// ../cli/src/commands/_shared/scene-render.ts
|
|
465208
|
-
var import_yaml5 = __toESM(require_dist16(), 1);
|
|
465209
|
-
init_dist();
|
|
465210
|
-
init_chrome();
|
|
465211
|
-
init_scene_lint();
|
|
465212
|
-
import { mkdir as mkdir19, readFile as readFile24, stat as stat3 } from "node:fs/promises";
|
|
465213
|
-
import { existsSync as existsSync38 } from "node:fs";
|
|
465214
|
-
import { resolve as resolve40, relative as relative6, dirname as dirname25, basename as basename17 } from "node:path";
|
|
465215
|
-
|
|
465216
|
-
// ../cli/src/commands/_shared/scene-audio-scan.ts
|
|
465217
|
-
import { readFile as readFile23 } from "node:fs/promises";
|
|
465218
|
-
import { resolve as resolve38 } from "node:path";
|
|
465219
|
-
function parseRootClips(rootHtml) {
|
|
465220
|
-
const clips = [];
|
|
465221
|
-
const clipRegex = /<div\b[^>]*class="clip"[^>]*>/gi;
|
|
465222
|
-
let match2;
|
|
465223
|
-
while ((match2 = clipRegex.exec(rootHtml)) !== null) {
|
|
465224
|
-
const tag = match2[0];
|
|
465225
|
-
const compositionId = pickAttr(tag, "data-composition-id");
|
|
465226
|
-
const compositionSrc = pickAttr(tag, "data-composition-src");
|
|
465227
|
-
const start = pickNumberAttr(tag, "data-start");
|
|
465228
|
-
const duration = pickNumberAttr(tag, "data-duration");
|
|
465229
|
-
const trackIndex = pickNumberAttr(tag, "data-track-index") ?? 1;
|
|
465230
|
-
if (!compositionId || !compositionSrc || start === null || duration === null) {
|
|
465231
|
-
continue;
|
|
465232
|
-
}
|
|
465233
|
-
clips.push({ compositionId, compositionSrc, start, duration, trackIndex });
|
|
465234
|
-
}
|
|
465235
|
-
return clips;
|
|
465236
|
-
}
|
|
465237
|
-
function parseSceneAudios(compositionHtml) {
|
|
465238
|
-
const out = [];
|
|
465239
|
-
const audioRegex = /<audio\b([^>]*)>/gi;
|
|
465240
|
-
let match2;
|
|
465241
|
-
while ((match2 = audioRegex.exec(compositionHtml)) !== null) {
|
|
465242
|
-
const attrs = match2[1];
|
|
465243
|
-
const src = pickAttr(attrs, "src");
|
|
465244
|
-
if (!src) continue;
|
|
465245
|
-
const localStart = pickNumberAttr(attrs, "data-start") ?? 0;
|
|
465246
|
-
const durationRaw = pickAttr(attrs, "data-duration");
|
|
465247
|
-
const durationHint = !durationRaw || durationRaw === "auto" ? "auto" : Number(durationRaw);
|
|
465248
|
-
const volume = pickNumberAttr(attrs, "data-volume") ?? 1;
|
|
465249
|
-
const trackIndex = pickNumberAttr(attrs, "data-track-index") ?? 2;
|
|
465250
|
-
out.push({ srcRel: src, localStart, durationHint, volume, trackIndex });
|
|
465251
|
-
}
|
|
465252
|
-
return out;
|
|
465253
|
-
}
|
|
465254
|
-
function makeFsCompositionReader(projectDir) {
|
|
465255
|
-
return async (compositionSrcRel) => {
|
|
465256
|
-
const abs = resolve38(projectDir, compositionSrcRel);
|
|
465257
|
-
try {
|
|
465258
|
-
return await readFile23(abs, "utf-8");
|
|
465259
|
-
} catch {
|
|
465260
|
-
return null;
|
|
465261
|
-
}
|
|
465262
|
-
};
|
|
465263
|
-
}
|
|
465264
|
-
async function scanSceneAudio(opts) {
|
|
465265
|
-
const reader = opts.readComposition ?? makeFsCompositionReader(opts.projectDir);
|
|
465266
|
-
const clips = parseRootClips(opts.rootHtml);
|
|
465267
|
-
const out = [];
|
|
465268
|
-
for (const clip of clips) {
|
|
465269
|
-
const html = await reader(clip.compositionSrc);
|
|
465270
|
-
if (!html) continue;
|
|
465271
|
-
const audios = parseSceneAudios(html);
|
|
465272
|
-
for (const audio of audios) {
|
|
465273
|
-
out.push({
|
|
465274
|
-
srcRel: audio.srcRel,
|
|
465275
|
-
srcAbs: resolve38(opts.projectDir, audio.srcRel),
|
|
465276
|
-
absoluteStart: clip.start + audio.localStart,
|
|
465277
|
-
durationHint: audio.durationHint,
|
|
465278
|
-
clipDurationCap: clip.duration - audio.localStart,
|
|
465279
|
-
volume: audio.volume,
|
|
465280
|
-
trackIndex: audio.trackIndex,
|
|
465281
|
-
compositionSrc: clip.compositionSrc
|
|
465282
|
-
});
|
|
465283
|
-
}
|
|
465284
|
-
}
|
|
465285
|
-
out.sort((a, b) => a.absoluteStart - b.absoluteStart);
|
|
465286
|
-
return out;
|
|
465287
|
-
}
|
|
465288
|
-
function pickAttr(tag, name) {
|
|
465289
|
-
const re = new RegExp(`\\b${escapeRegex3(name)}\\s*=\\s*("([^"]*)"|'([^']*)')`);
|
|
465290
|
-
const m = tag.match(re);
|
|
465291
|
-
if (!m) return null;
|
|
465292
|
-
return m[2] ?? m[3] ?? null;
|
|
465293
|
-
}
|
|
465294
|
-
function pickNumberAttr(tag, name) {
|
|
465295
|
-
const raw2 = pickAttr(tag, name);
|
|
465296
|
-
if (raw2 === null) return null;
|
|
465297
|
-
const n = Number(raw2);
|
|
465298
|
-
return Number.isFinite(n) ? n : null;
|
|
465299
|
-
}
|
|
465300
|
-
function escapeRegex3(s) {
|
|
465301
|
-
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
465302
|
-
}
|
|
465303
|
-
|
|
465304
|
-
// ../cli/src/commands/_shared/scene-audio-mux.ts
|
|
465305
|
-
init_exec_safe();
|
|
465306
|
-
import { rename as rename6, unlink as unlink5 } from "node:fs/promises";
|
|
465307
|
-
import { resolve as resolve39, dirname as dirname24, extname as extname12, basename as basename16 } from "node:path";
|
|
465308
|
-
function buildAudioMuxFilter(audios) {
|
|
465309
|
-
if (audios.length === 0) return null;
|
|
465310
|
-
const labels = [];
|
|
465311
|
-
const stages = [];
|
|
465312
|
-
audios.forEach((a, i) => {
|
|
465313
|
-
const inputIdx = i + 1;
|
|
465314
|
-
const delayMs = Math.max(0, Math.round(a.absoluteStart * 1e3));
|
|
465315
|
-
const volume = Number.isFinite(a.volume) ? a.volume : 1;
|
|
465316
|
-
const trimSec = Math.max(0, a.clipDurationCap);
|
|
465317
|
-
const label = `a${i}`;
|
|
465318
|
-
const stage = [
|
|
465319
|
-
`[${inputIdx}:a]`,
|
|
465320
|
-
`atrim=duration=${trimSec.toFixed(3)},`,
|
|
465321
|
-
`asetpts=PTS-STARTPTS,`,
|
|
465322
|
-
`adelay=${delayMs}:all=1,`,
|
|
465323
|
-
`volume=${volume}`,
|
|
465324
|
-
`[${label}]`
|
|
465325
|
-
].join("");
|
|
465326
|
-
stages.push(stage);
|
|
465327
|
-
labels.push(`[${label}]`);
|
|
465328
|
-
});
|
|
465329
|
-
if (audios.length === 1) {
|
|
465330
|
-
return {
|
|
465331
|
-
filterComplex: stages.join(";"),
|
|
465332
|
-
outLabel: labels[0],
|
|
465333
|
-
inputCount: 1
|
|
465334
|
-
};
|
|
465335
|
-
}
|
|
465336
|
-
const mix = `${labels.join("")}amix=inputs=${audios.length}:dropout_transition=0:normalize=0[mixed]`;
|
|
465337
|
-
return {
|
|
465338
|
-
filterComplex: `${stages.join(";")};${mix}`,
|
|
465339
|
-
outLabel: "[mixed]",
|
|
465340
|
-
inputCount: audios.length
|
|
465341
|
-
};
|
|
465342
|
-
}
|
|
465343
|
-
function audioCodecForFormat(format4) {
|
|
465344
|
-
if (format4 === "webm") return "libopus";
|
|
465345
|
-
if (format4 === "mov") return "pcm_s16le";
|
|
465346
|
-
return "aac";
|
|
465347
|
-
}
|
|
465348
|
-
async function muxAudioIntoVideo(opts) {
|
|
465349
|
-
if (opts.audios.length === 0) {
|
|
465350
|
-
return { success: true, outputPath: opts.videoPath, audioCount: 0 };
|
|
465351
|
-
}
|
|
465352
|
-
if (!commandExists("ffmpeg")) {
|
|
465353
|
-
return {
|
|
465354
|
-
success: false,
|
|
465355
|
-
outputPath: opts.videoPath,
|
|
465356
|
-
audioCount: opts.audios.length,
|
|
465357
|
-
error: "ffmpeg not found in PATH \u2014 install via `brew install ffmpeg` (mac) or your package manager"
|
|
465358
|
-
};
|
|
465359
|
-
}
|
|
465360
|
-
const filter4 = buildAudioMuxFilter(opts.audios);
|
|
465361
|
-
if (!filter4) {
|
|
465362
|
-
return { success: true, outputPath: opts.videoPath, audioCount: 0 };
|
|
465363
|
-
}
|
|
465364
|
-
const ext = extname12(opts.videoPath) || `.${opts.format}`;
|
|
465365
|
-
const tmpPath = resolve39(
|
|
465366
|
-
dirname24(opts.videoPath),
|
|
465367
|
-
`.${basename16(opts.videoPath, ext)}.muxing${ext}`
|
|
465368
|
-
);
|
|
465369
|
-
const args = ["-y", "-loglevel", "error", "-i", opts.videoPath];
|
|
465370
|
-
for (const a of opts.audios) {
|
|
465371
|
-
args.push("-i", a.srcAbs);
|
|
465372
|
-
}
|
|
465373
|
-
args.push(
|
|
465374
|
-
"-filter_complex",
|
|
465375
|
-
filter4.filterComplex,
|
|
465376
|
-
"-map",
|
|
465377
|
-
"0:v",
|
|
465378
|
-
"-map",
|
|
465379
|
-
filter4.outLabel,
|
|
465380
|
-
"-c:v",
|
|
465381
|
-
"copy",
|
|
465382
|
-
"-c:a",
|
|
465383
|
-
audioCodecForFormat(opts.format),
|
|
465384
|
-
// Cap on the video duration so audio that overruns the producer's render
|
|
465385
|
-
// (e.g. a long Kokoro wav on a short scene) doesn't extend the output.
|
|
465386
|
-
// Video drives the timeline because the producer already counted frames.
|
|
465387
|
-
"-t",
|
|
465388
|
-
opts.totalDuration && opts.totalDuration > 0 ? opts.totalDuration.toFixed(3) : opts.videoDuration?.toFixed(3) ?? ""
|
|
465389
|
-
);
|
|
465390
|
-
if (args[args.length - 1] === "") {
|
|
465391
|
-
args.pop();
|
|
465392
|
-
args.pop();
|
|
465393
|
-
}
|
|
465394
|
-
args.push("-movflags", "+faststart", tmpPath);
|
|
465395
|
-
try {
|
|
465396
|
-
const { stderr } = await execSafe("ffmpeg", args);
|
|
465397
|
-
if (stderr && opts.onProgress) {
|
|
465398
|
-
stderr.split(/\r?\n/).forEach((line) => opts.onProgress?.(line));
|
|
465399
|
-
}
|
|
465400
|
-
} catch (err) {
|
|
465401
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
465402
|
-
try {
|
|
465403
|
-
await unlink5(tmpPath);
|
|
465404
|
-
} catch {
|
|
465405
|
-
}
|
|
465406
|
-
return {
|
|
465407
|
-
success: false,
|
|
465408
|
-
outputPath: opts.videoPath,
|
|
465409
|
-
audioCount: opts.audios.length,
|
|
465410
|
-
error: `ffmpeg mux failed: ${msg}`
|
|
465411
|
-
};
|
|
465412
|
-
}
|
|
465413
|
-
await rename6(tmpPath, opts.videoPath);
|
|
465414
|
-
return {
|
|
465415
|
-
success: true,
|
|
465416
|
-
outputPath: opts.videoPath,
|
|
465417
|
-
audioCount: opts.audios.length
|
|
465418
|
-
};
|
|
465419
|
-
}
|
|
465420
|
-
|
|
465421
|
-
// ../cli/src/commands/_shared/scene-render.ts
|
|
465422
|
-
function qualityToCrf2(quality = "standard") {
|
|
465423
|
-
return quality === "draft" ? 28 : quality === "high" ? 18 : 23;
|
|
465424
|
-
}
|
|
465425
|
-
function defaultOutputPath(opts) {
|
|
465426
|
-
const fmt = opts.format ?? "mp4";
|
|
465427
|
-
const now = opts.now ?? /* @__PURE__ */ new Date();
|
|
465428
|
-
const stamp = now.toISOString().replace(/[:T]/g, "-").replace(/\..+$/, "");
|
|
465429
|
-
const name = (opts.projectName ?? basename17(resolve40(opts.projectDir))) || "scene";
|
|
465430
|
-
return resolve40(opts.projectDir, "renders", `${name}-${stamp}.${fmt}`);
|
|
465431
|
-
}
|
|
465432
|
-
async function readProjectName(projectDir) {
|
|
465433
|
-
const cfgPath = resolve40(projectDir, "vibe.project.yaml");
|
|
465434
|
-
if (!existsSync38(cfgPath)) return void 0;
|
|
465435
|
-
try {
|
|
465436
|
-
const raw2 = await (await import("node:fs/promises")).readFile(cfgPath, "utf-8");
|
|
465437
|
-
const parsed = (0, import_yaml5.parse)(raw2);
|
|
465438
|
-
return parsed?.name ?? void 0;
|
|
465439
|
-
} catch {
|
|
465440
|
-
return void 0;
|
|
465441
|
-
}
|
|
465442
|
-
}
|
|
465443
|
-
function buildRenderConfig(opts) {
|
|
465444
|
-
const quality = opts.quality ?? "standard";
|
|
465445
|
-
return {
|
|
465446
|
-
fps: opts.fps ?? 30,
|
|
465447
|
-
quality,
|
|
465448
|
-
format: opts.format ?? "mp4",
|
|
465449
|
-
entryFile: opts.entryFile ?? "index.html",
|
|
465450
|
-
crf: qualityToCrf2(quality),
|
|
465451
|
-
workers: opts.workers ?? 1
|
|
465452
|
-
};
|
|
465453
|
-
}
|
|
465454
|
-
async function executeSceneRender(opts = {}) {
|
|
465455
|
-
const projectDir = resolve40(opts.projectDir ?? ".");
|
|
465456
|
-
const root2 = opts.root ?? "index.html";
|
|
465457
|
-
const projectStat = await safeStat(projectDir);
|
|
465458
|
-
if (!projectStat || !projectStat.isDirectory()) {
|
|
465459
|
-
return { success: false, error: `Project directory not found: ${projectDir}` };
|
|
465460
|
-
}
|
|
465461
|
-
if (!await rootExists(projectDir, root2)) {
|
|
465462
|
-
return {
|
|
465463
|
-
success: false,
|
|
465464
|
-
error: `Root composition not found: ${resolve40(projectDir, root2)}. Run \`vibe scene init\` first.`
|
|
465465
|
-
};
|
|
465466
|
-
}
|
|
465467
|
-
const chrome2 = await preflightChrome();
|
|
465468
|
-
if (!chrome2.ok) {
|
|
465469
|
-
return { success: false, error: chrome2.reason };
|
|
465470
|
-
}
|
|
465471
|
-
const projectName = await readProjectName(projectDir);
|
|
465472
|
-
const outputPath = opts.output ? resolve40(projectDir, opts.output) : defaultOutputPath({ projectDir, projectName, format: opts.format });
|
|
465473
|
-
await mkdir19(dirname25(outputPath), { recursive: true });
|
|
465474
|
-
const config4 = buildRenderConfig({
|
|
465475
|
-
fps: opts.fps,
|
|
465476
|
-
quality: opts.quality,
|
|
465477
|
-
format: opts.format,
|
|
465478
|
-
workers: opts.workers,
|
|
465479
|
-
entryFile: root2
|
|
465480
|
-
});
|
|
465481
|
-
const job = createRenderJob(config4);
|
|
465482
|
-
const start = Date.now();
|
|
465483
|
-
try {
|
|
465484
|
-
await executeRenderJob(
|
|
465485
|
-
job,
|
|
465486
|
-
projectDir,
|
|
465487
|
-
outputPath,
|
|
465488
|
-
(j, msg) => opts.onProgress?.(j.progress, j.currentStage ?? msg),
|
|
465489
|
-
opts.signal
|
|
465490
|
-
);
|
|
465491
|
-
} catch (err) {
|
|
465492
|
-
return {
|
|
465493
|
-
success: false,
|
|
465494
|
-
error: err instanceof Error ? err.message : String(err)
|
|
465495
|
-
};
|
|
465496
|
-
}
|
|
465497
|
-
let audioCount = 0;
|
|
465498
|
-
let audioMuxApplied = false;
|
|
465499
|
-
let audioMuxWarning;
|
|
465500
|
-
try {
|
|
465501
|
-
opts.onProgress?.(0.95, "Mixing audio");
|
|
465502
|
-
const rootHtml = await readFile24(resolve40(projectDir, root2), "utf-8");
|
|
465503
|
-
const audios = await scanSceneAudio({ projectDir, rootHtml });
|
|
465504
|
-
audioCount = audios.length;
|
|
465505
|
-
if (audios.length > 0) {
|
|
465506
|
-
const videoDuration = job.totalFrames && config4.fps ? job.totalFrames / config4.fps : void 0;
|
|
465507
|
-
const mux = await muxAudioIntoVideo({
|
|
465508
|
-
videoPath: outputPath,
|
|
465509
|
-
audios,
|
|
465510
|
-
format: config4.format ?? "mp4",
|
|
465511
|
-
videoDuration,
|
|
465512
|
-
onProgress: (line) => {
|
|
465513
|
-
if (line) opts.onProgress?.(0.97, line);
|
|
465514
|
-
}
|
|
465515
|
-
});
|
|
465516
|
-
if (mux.success) {
|
|
465517
|
-
audioMuxApplied = true;
|
|
465518
|
-
} else {
|
|
465519
|
-
audioMuxWarning = mux.error;
|
|
465520
|
-
}
|
|
465521
|
-
}
|
|
465522
|
-
} catch (err) {
|
|
465523
|
-
audioMuxWarning = err instanceof Error ? err.message : String(err);
|
|
465524
|
-
}
|
|
465525
|
-
return {
|
|
465526
|
-
success: true,
|
|
465527
|
-
outputPath: relative6(process.cwd(), outputPath) || outputPath,
|
|
465528
|
-
durationMs: Date.now() - start,
|
|
465529
|
-
framesRendered: job.framesRendered,
|
|
465530
|
-
totalFrames: job.totalFrames,
|
|
465531
|
-
fps: config4.fps,
|
|
465532
|
-
quality: config4.quality,
|
|
465533
|
-
format: config4.format,
|
|
465534
|
-
audioCount,
|
|
465535
|
-
audioMuxApplied,
|
|
465536
|
-
audioMuxWarning
|
|
465537
|
-
};
|
|
465538
|
-
}
|
|
465539
|
-
async function safeStat(p) {
|
|
465540
|
-
try {
|
|
465541
|
-
return await stat3(p);
|
|
465542
|
-
} catch {
|
|
465543
|
-
return null;
|
|
465544
|
-
}
|
|
465545
|
-
}
|
|
466004
|
+
init_scene_render();
|
|
466005
|
+
import { resolve as resolve44 } from "node:path";
|
|
465546
466006
|
|
|
465547
466007
|
// ../cli/src/commands/scene.ts
|
|
465548
466008
|
init_esm();
|
|
465549
466009
|
init_source();
|
|
465550
466010
|
init_ora();
|
|
465551
|
-
var
|
|
465552
|
-
init_dist2();
|
|
465553
|
-
import { basename as basename18, resolve as resolve41, relative as relative7, dirname as dirname26 } from "node:path";
|
|
465554
|
-
import { mkdir as mkdir20, readFile as readFile25, writeFile as writeFile26, access as access5, copyFile as copyFile4 } from "node:fs/promises";
|
|
465555
|
-
import { existsSync as existsSync39 } from "node:fs";
|
|
465556
|
-
|
|
465557
|
-
// ../cli/src/commands/_shared/tts-resolve.ts
|
|
466011
|
+
var import_yaml7 = __toESM(require_dist16(), 1);
|
|
465558
466012
|
init_dist2();
|
|
465559
|
-
|
|
465560
|
-
init_api_key();
|
|
465561
|
-
async function resolveTtsProvider(preferred = "auto") {
|
|
465562
|
-
const choice = preferred === "auto" ? hasApiKey("ELEVENLABS_API_KEY") ? "elevenlabs" : "kokoro" : preferred;
|
|
465563
|
-
if (choice === "elevenlabs") {
|
|
465564
|
-
return buildElevenLabs();
|
|
465565
|
-
}
|
|
465566
|
-
return buildKokoro();
|
|
465567
|
-
}
|
|
465568
|
-
async function buildElevenLabs() {
|
|
465569
|
-
const key2 = await getApiKey("ELEVENLABS_API_KEY", "ElevenLabs");
|
|
465570
|
-
if (!key2) {
|
|
465571
|
-
throw new TtsKeyMissingError("elevenlabs");
|
|
465572
|
-
}
|
|
465573
|
-
const provider = new ElevenLabsProvider();
|
|
465574
|
-
await provider.initialize({ apiKey: key2 });
|
|
465575
|
-
const call = async (text, opts) => provider.textToSpeech(text, {
|
|
465576
|
-
voiceId: opts?.voice,
|
|
465577
|
-
speed: opts?.speed
|
|
465578
|
-
});
|
|
465579
|
-
return { provider: "elevenlabs", audioExtension: "mp3", call };
|
|
465580
|
-
}
|
|
465581
|
-
async function buildKokoro() {
|
|
465582
|
-
const provider = new KokoroProvider();
|
|
465583
|
-
await provider.initialize({});
|
|
465584
|
-
const call = async (text, opts) => provider.textToSpeech(text, {
|
|
465585
|
-
voice: opts?.voice,
|
|
465586
|
-
speed: opts?.speed,
|
|
465587
|
-
onProgress: opts?.onProgress
|
|
465588
|
-
});
|
|
465589
|
-
return { provider: "kokoro", audioExtension: "wav", call };
|
|
465590
|
-
}
|
|
465591
|
-
var TtsKeyMissingError = class extends Error {
|
|
465592
|
-
constructor(provider) {
|
|
465593
|
-
super(
|
|
465594
|
-
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.`
|
|
465595
|
-
);
|
|
465596
|
-
this.provider = provider;
|
|
465597
|
-
this.name = "TtsKeyMissingError";
|
|
465598
|
-
}
|
|
465599
|
-
};
|
|
465600
|
-
function parseTtsProviderName(value) {
|
|
465601
|
-
if (!value) return "auto";
|
|
465602
|
-
if (value === "auto" || value === "elevenlabs" || value === "kokoro") {
|
|
465603
|
-
return value;
|
|
465604
|
-
}
|
|
465605
|
-
throw new Error(
|
|
465606
|
-
`Invalid --tts: ${value}. Valid: auto, elevenlabs, kokoro.`
|
|
465607
|
-
);
|
|
465608
|
-
}
|
|
465609
|
-
|
|
465610
|
-
// ../cli/src/commands/scene.ts
|
|
466013
|
+
init_tts_resolve();
|
|
465611
466014
|
init_scene_project();
|
|
466015
|
+
import { basename as basename18, resolve as resolve43, relative as relative7, dirname as dirname27 } from "node:path";
|
|
466016
|
+
import { mkdir as mkdir21, readFile as readFile26, writeFile as writeFile27, access as access5, copyFile as copyFile4 } from "node:fs/promises";
|
|
466017
|
+
import { existsSync as existsSync40 } from "node:fs";
|
|
465612
466018
|
|
|
465613
466019
|
// ../cli/src/commands/_shared/visual-styles.ts
|
|
465614
466020
|
var STYLES = [
|
|
@@ -465781,6 +466187,8 @@ function visualStyleNames() {
|
|
|
465781
466187
|
// ../cli/src/commands/scene.ts
|
|
465782
466188
|
init_scene_html_emit();
|
|
465783
466189
|
init_scene_lint();
|
|
466190
|
+
init_scene_render();
|
|
466191
|
+
init_scene_build();
|
|
465784
466192
|
init_output();
|
|
465785
466193
|
init_api_key();
|
|
465786
466194
|
init_audio();
|
|
@@ -466064,16 +466472,16 @@ async function pathExists2(p) {
|
|
|
466064
466472
|
}
|
|
466065
466473
|
}
|
|
466066
466474
|
async function loadVibeProjectConfig(projectDir) {
|
|
466067
|
-
const cfgPath =
|
|
466475
|
+
const cfgPath = resolve43(projectDir, "vibe.project.yaml");
|
|
466068
466476
|
if (!await pathExists2(cfgPath)) return null;
|
|
466069
|
-
const raw2 = await
|
|
466070
|
-
return (0,
|
|
466477
|
+
const raw2 = await readFile26(cfgPath, "utf-8");
|
|
466478
|
+
return (0, import_yaml7.parse)(raw2);
|
|
466071
466479
|
}
|
|
466072
466480
|
async function resolveNarrationText(value) {
|
|
466073
466481
|
if (!value) return void 0;
|
|
466074
466482
|
const looksLikePath = /\.[a-z]{2,4}$/i.test(value) || value.includes("/") || value.includes("\\");
|
|
466075
|
-
if (looksLikePath &&
|
|
466076
|
-
return (await
|
|
466483
|
+
if (looksLikePath && existsSync40(value)) {
|
|
466484
|
+
return (await readFile26(value, "utf-8")).trim();
|
|
466077
466485
|
}
|
|
466078
466486
|
return value.trim();
|
|
466079
466487
|
}
|
|
@@ -466089,12 +466497,12 @@ function aspectStringFromDims(width, height) {
|
|
|
466089
466497
|
return width > height ? "16:9" : "9:16";
|
|
466090
466498
|
}
|
|
466091
466499
|
async function executeSceneAdd(opts) {
|
|
466092
|
-
const projectDir =
|
|
466500
|
+
const projectDir = resolve43(opts.projectDir ?? ".");
|
|
466093
466501
|
const rootRel = opts.insertInto ?? "index.html";
|
|
466094
|
-
const rootPath =
|
|
466502
|
+
const rootPath = resolve43(projectDir, rootRel);
|
|
466095
466503
|
const id = slugifySceneName(opts.name);
|
|
466096
466504
|
const sceneRel = `compositions/scene-${id}.html`;
|
|
466097
|
-
const scenePath =
|
|
466505
|
+
const scenePath = resolve43(projectDir, sceneRel);
|
|
466098
466506
|
const errResult = (error) => ({
|
|
466099
466507
|
success: false,
|
|
466100
466508
|
id,
|
|
@@ -466111,7 +466519,7 @@ async function executeSceneAdd(opts) {
|
|
|
466111
466519
|
if (!opts.force && await pathExists2(scenePath)) {
|
|
466112
466520
|
return errResult(`Scene already exists: ${sceneRel}. Re-run with --force to overwrite.`);
|
|
466113
466521
|
}
|
|
466114
|
-
const rootHtmlBefore = await
|
|
466522
|
+
const rootHtmlBefore = await readFile26(rootPath, "utf-8");
|
|
466115
466523
|
let dims = readRootDims(rootHtmlBefore);
|
|
466116
466524
|
if (!dims) {
|
|
466117
466525
|
const cfg2 = await loadVibeProjectConfig(projectDir);
|
|
@@ -466125,7 +466533,7 @@ async function executeSceneAdd(opts) {
|
|
|
466125
466533
|
let audioAbsPath;
|
|
466126
466534
|
let narrationDuration;
|
|
466127
466535
|
if (opts.narrationFile && !opts.skipAudio) {
|
|
466128
|
-
const sourceAbs =
|
|
466536
|
+
const sourceAbs = resolve43(opts.narrationFile);
|
|
466129
466537
|
if (!await pathExists2(sourceAbs)) {
|
|
466130
466538
|
return errResult(`Narration file not found: ${sourceAbs}`);
|
|
466131
466539
|
}
|
|
@@ -466134,8 +466542,8 @@ async function executeSceneAdd(opts) {
|
|
|
466134
466542
|
return errResult(`Unsupported narration file extension: .${ext}. Use .wav or .mp3.`);
|
|
466135
466543
|
}
|
|
466136
466544
|
audioRelPath = `assets/narration-${id}.${ext}`;
|
|
466137
|
-
audioAbsPath =
|
|
466138
|
-
await
|
|
466545
|
+
audioAbsPath = resolve43(projectDir, audioRelPath);
|
|
466546
|
+
await mkdir21(dirname27(audioAbsPath), { recursive: true });
|
|
466139
466547
|
await copyFile4(sourceAbs, audioAbsPath);
|
|
466140
466548
|
try {
|
|
466141
466549
|
narrationDuration = await getAudioDuration(audioAbsPath);
|
|
@@ -466167,9 +466575,9 @@ async function executeSceneAdd(opts) {
|
|
|
466167
466575
|
return errResult(`${resolution.provider} TTS failed: ${tts.error ?? "unknown error"}`);
|
|
466168
466576
|
}
|
|
466169
466577
|
audioRelPath = `assets/narration-${id}.${resolution.audioExtension}`;
|
|
466170
|
-
audioAbsPath =
|
|
466171
|
-
await
|
|
466172
|
-
await
|
|
466578
|
+
audioAbsPath = resolve43(projectDir, audioRelPath);
|
|
466579
|
+
await mkdir21(dirname27(audioAbsPath), { recursive: true });
|
|
466580
|
+
await writeFile27(audioAbsPath, tts.audioBuffer);
|
|
466173
466581
|
try {
|
|
466174
466582
|
narrationDuration = await getAudioDuration(audioAbsPath);
|
|
466175
466583
|
} catch {
|
|
@@ -466190,7 +466598,7 @@ async function executeSceneAdd(opts) {
|
|
|
466190
466598
|
try {
|
|
466191
466599
|
const whisper = new WhisperProvider();
|
|
466192
466600
|
await whisper.initialize({ apiKey: whisperKey });
|
|
466193
|
-
const audioBytes = await
|
|
466601
|
+
const audioBytes = await readFile26(audioAbsPath);
|
|
466194
466602
|
const audioBlob = new Blob([new Uint8Array(audioBytes)]);
|
|
466195
466603
|
const transcript = await whisper.transcribe(audioBlob, void 0, {
|
|
466196
466604
|
granularity: "word",
|
|
@@ -466198,8 +466606,8 @@ async function executeSceneAdd(opts) {
|
|
|
466198
466606
|
});
|
|
466199
466607
|
if (transcript.status === "completed" && transcript.words?.length) {
|
|
466200
466608
|
transcriptRelPath = `assets/transcript-${id}.json`;
|
|
466201
|
-
const transcriptAbs =
|
|
466202
|
-
await
|
|
466609
|
+
const transcriptAbs = resolve43(projectDir, transcriptRelPath);
|
|
466610
|
+
await writeFile27(transcriptAbs, JSON.stringify(transcript.words, null, 2), "utf-8");
|
|
466203
466611
|
transcriptWordCount = transcript.words.length;
|
|
466204
466612
|
transcriptWords = transcript.words.map((w) => ({ text: w.text, start: w.start, end: w.end }));
|
|
466205
466613
|
} else if (transcript.status === "failed") {
|
|
@@ -466235,8 +466643,8 @@ async function executeSceneAdd(opts) {
|
|
|
466235
466643
|
}
|
|
466236
466644
|
const img = imageResult.images[0];
|
|
466237
466645
|
imageRelPath = `assets/scene-${id}.png`;
|
|
466238
|
-
imageAbsPath =
|
|
466239
|
-
await
|
|
466646
|
+
imageAbsPath = resolve43(projectDir, imageRelPath);
|
|
466647
|
+
await mkdir21(dirname27(imageAbsPath), { recursive: true });
|
|
466240
466648
|
let buffer;
|
|
466241
466649
|
if (img.base64) {
|
|
466242
466650
|
buffer = Buffer.from(img.base64, "base64");
|
|
@@ -466246,7 +466654,7 @@ async function executeSceneAdd(opts) {
|
|
|
466246
466654
|
} else {
|
|
466247
466655
|
return errResult("OpenAI returned no image data");
|
|
466248
466656
|
}
|
|
466249
|
-
await
|
|
466657
|
+
await writeFile27(imageAbsPath, buffer);
|
|
466250
466658
|
} else {
|
|
466251
466659
|
const googleKey = await getApiKey("GOOGLE_API_KEY", "Google");
|
|
466252
466660
|
if (!googleKey) {
|
|
@@ -466260,10 +466668,10 @@ async function executeSceneAdd(opts) {
|
|
|
466260
466668
|
return errResult(`Gemini image generation failed: ${imageResult.error ?? "unknown error"}`);
|
|
466261
466669
|
}
|
|
466262
466670
|
imageRelPath = `assets/scene-${id}.png`;
|
|
466263
|
-
imageAbsPath =
|
|
466264
|
-
await
|
|
466671
|
+
imageAbsPath = resolve43(projectDir, imageRelPath);
|
|
466672
|
+
await mkdir21(dirname27(imageAbsPath), { recursive: true });
|
|
466265
466673
|
const buffer = Buffer.from(imageResult.images[0].base64, "base64");
|
|
466266
|
-
await
|
|
466674
|
+
await writeFile27(imageAbsPath, buffer);
|
|
466267
466675
|
}
|
|
466268
466676
|
}
|
|
466269
466677
|
const cfg = await loadVibeProjectConfig(projectDir);
|
|
@@ -466296,15 +466704,15 @@ async function executeSceneAdd(opts) {
|
|
|
466296
466704
|
audioPath: audioRelPath,
|
|
466297
466705
|
transcript: transcriptWords
|
|
466298
466706
|
});
|
|
466299
|
-
await
|
|
466300
|
-
await
|
|
466707
|
+
await mkdir21(dirname27(scenePath), { recursive: true });
|
|
466708
|
+
await writeFile27(scenePath, sceneHtml, "utf-8");
|
|
466301
466709
|
opts.onProgress?.("Updating root composition...");
|
|
466302
466710
|
const start = nextSceneStart(rootHtmlBefore, SCENE_OVERLAP_SECONDS);
|
|
466303
466711
|
const existingClipCount = (rootHtmlBefore.match(/<div\s+class="clip"/g) || []).length;
|
|
466304
466712
|
const trackIndex = existingClipCount % 2 + 1;
|
|
466305
466713
|
const updated = insertClipIntoRoot(rootHtmlBefore, { id, start, duration, trackIndex });
|
|
466306
|
-
await
|
|
466307
|
-
const transcriptAbsPath = transcriptRelPath ?
|
|
466714
|
+
await writeFile27(rootPath, updated, "utf-8");
|
|
466715
|
+
const transcriptAbsPath = transcriptRelPath ? resolve43(projectDir, transcriptRelPath) : void 0;
|
|
466308
466716
|
return {
|
|
466309
466717
|
success: true,
|
|
466310
466718
|
id,
|
|
@@ -466320,10 +466728,10 @@ async function executeSceneAdd(opts) {
|
|
|
466320
466728
|
};
|
|
466321
466729
|
}
|
|
466322
466730
|
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) => {
|
|
466323
|
-
const projectDir =
|
|
466731
|
+
const projectDir = resolve43(options.project);
|
|
466324
466732
|
if (!await rootExists(projectDir, root2)) {
|
|
466325
466733
|
exitWithError(generalError(
|
|
466326
|
-
`Root composition not found: ${
|
|
466734
|
+
`Root composition not found: ${resolve43(projectDir, root2)}`,
|
|
466327
466735
|
"Run `vibe scene init` first, or pass --project <dir>."
|
|
466328
466736
|
));
|
|
466329
466737
|
}
|
|
@@ -466416,7 +466824,7 @@ sceneCommand.command("render").description("Render a scene project to MP4/WebM/M
|
|
|
466416
466824
|
const quality = validateQuality(options.quality);
|
|
466417
466825
|
const format4 = validateFormat(options.format);
|
|
466418
466826
|
const workers = validateWorkers(options.workers);
|
|
466419
|
-
const projectDir =
|
|
466827
|
+
const projectDir = resolve43(options.project);
|
|
466420
466828
|
if (options.dryRun) {
|
|
466421
466829
|
outputResult({
|
|
466422
466830
|
dryRun: true,
|
|
@@ -466474,6 +466882,125 @@ sceneCommand.command("render").description("Render a scene project to MP4/WebM/M
|
|
|
466474
466882
|
}
|
|
466475
466883
|
}
|
|
466476
466884
|
});
|
|
466885
|
+
sceneCommand.command("build").description("One-shot: read STORYBOARD.md cues, dispatch TTS + image-gen per beat, compose, render to MP4 (v0.60)").argument("[project-dir]", "Project directory containing STORYBOARD.md", ".").option("--effort <level>", "Compose effort tier: low|medium|high", "medium").option("--skip-narration", "Don't dispatch TTS even when beats declare narration cues").option("--skip-backdrop", "Don't dispatch image-gen even when beats declare backdrop cues").option("--skip-render", "Compose only \u2014 don't render to MP4").option("--tts <provider>", "TTS provider: auto|elevenlabs|kokoro (overrides frontmatter)").option("--voice <id>", "Voice id (provider-specific \u2014 overrides frontmatter)").option("--image-provider <name>", "Image provider: openai (only one supported in v0.60)").option("--quality <q>", "Image quality: standard|hd", "hd").option("--image-size <s>", "Image size: 1024x1024|1536x1024|1024x1536", "1536x1024").option("--force", "Re-dispatch primitives even when assets already exist").option("--dry-run", "Preview parameters without dispatching").action(async (projectDirArg, options) => {
|
|
466886
|
+
const projectDir = resolve43(projectDirArg);
|
|
466887
|
+
if (options.dryRun) {
|
|
466888
|
+
outputResult({
|
|
466889
|
+
dryRun: true,
|
|
466890
|
+
command: "scene build",
|
|
466891
|
+
params: {
|
|
466892
|
+
projectDir,
|
|
466893
|
+
effort: options.effort,
|
|
466894
|
+
skipNarration: options.skipNarration ?? false,
|
|
466895
|
+
skipBackdrop: options.skipBackdrop ?? false,
|
|
466896
|
+
skipRender: options.skipRender ?? false,
|
|
466897
|
+
ttsProvider: options.tts,
|
|
466898
|
+
voice: options.voice,
|
|
466899
|
+
imageProvider: options.imageProvider,
|
|
466900
|
+
imageQuality: options.quality,
|
|
466901
|
+
imageSize: options.imageSize,
|
|
466902
|
+
force: options.force ?? false
|
|
466903
|
+
}
|
|
466904
|
+
});
|
|
466905
|
+
return;
|
|
466906
|
+
}
|
|
466907
|
+
const validEfforts = ["low", "medium", "high"];
|
|
466908
|
+
if (!validEfforts.includes(options.effort)) {
|
|
466909
|
+
exitWithError(usageError(`Invalid --effort: ${options.effort}`, `Must be one of: ${validEfforts.join(", ")}`));
|
|
466910
|
+
}
|
|
466911
|
+
const spinner2 = isJsonMode() ? null : ora("Reading STORYBOARD.md...").start();
|
|
466912
|
+
const result = await executeSceneBuild({
|
|
466913
|
+
projectDir,
|
|
466914
|
+
effort: options.effort,
|
|
466915
|
+
skipNarration: options.skipNarration,
|
|
466916
|
+
skipBackdrop: options.skipBackdrop,
|
|
466917
|
+
skipRender: options.skipRender,
|
|
466918
|
+
ttsProvider: options.tts,
|
|
466919
|
+
voice: options.voice,
|
|
466920
|
+
imageProvider: options.imageProvider,
|
|
466921
|
+
imageQuality: options.quality,
|
|
466922
|
+
imageSize: options.imageSize,
|
|
466923
|
+
force: options.force,
|
|
466924
|
+
onProgress: (e) => {
|
|
466925
|
+
if (!spinner2) return;
|
|
466926
|
+
if (e.type === "phase-start") {
|
|
466927
|
+
spinner2.text = `Phase: ${e.phase}...`;
|
|
466928
|
+
} else if (e.type === "narration-generated") {
|
|
466929
|
+
spinner2.text = `Narration ${e.beatId} \u2192 ${e.path} (${e.provider})`;
|
|
466930
|
+
} else if (e.type === "backdrop-generated") {
|
|
466931
|
+
spinner2.text = `Backdrop ${e.beatId} \u2192 ${e.path} (${e.provider})`;
|
|
466932
|
+
} else if (e.type === "beat-fresh") {
|
|
466933
|
+
spinner2.text = `Composed beat ${e.beatId} ($${(e.costUsd ?? 0).toFixed(3)} \xB7 ${e.latencyMs ?? 0}ms)`;
|
|
466934
|
+
} else if (e.type === "beat-cached") {
|
|
466935
|
+
spinner2.text = `Composed beat ${e.beatId} (cached)`;
|
|
466936
|
+
} else if (e.type === "render-start") {
|
|
466937
|
+
spinner2.text = "Rendering...";
|
|
466938
|
+
} else if (e.type === "render-done") {
|
|
466939
|
+
spinner2.text = `Rendered: ${e.outputPath}`;
|
|
466940
|
+
}
|
|
466941
|
+
}
|
|
466942
|
+
});
|
|
466943
|
+
if (!result.success) {
|
|
466944
|
+
spinner2?.fail(`Build failed: ${result.error}`);
|
|
466945
|
+
if (isJsonMode()) {
|
|
466946
|
+
outputResult({ command: "scene build", ...result });
|
|
466947
|
+
process.exit(1);
|
|
466948
|
+
}
|
|
466949
|
+
exitWithError(generalError(result.error ?? "Build failed"));
|
|
466950
|
+
}
|
|
466951
|
+
if (isJsonMode()) {
|
|
466952
|
+
outputResult({ command: "scene build", ...result });
|
|
466953
|
+
return;
|
|
466954
|
+
}
|
|
466955
|
+
spinner2?.succeed(source_default.green(
|
|
466956
|
+
result.outputPath ? `Build complete: ${result.outputPath}` : "Build complete (compose only \u2014 render skipped)"
|
|
466957
|
+
));
|
|
466958
|
+
console.log();
|
|
466959
|
+
console.log(source_default.bold.cyan("Beats"));
|
|
466960
|
+
console.log(source_default.dim("\u2500".repeat(60)));
|
|
466961
|
+
for (const b of result.beats) {
|
|
466962
|
+
const narration = formatPrimitiveStatus(b.narrationStatus, b.narrationPath);
|
|
466963
|
+
const backdrop = formatPrimitiveStatus(b.backdropStatus, b.backdropPath);
|
|
466964
|
+
console.log(` ${source_default.bold(b.beatId.padEnd(12))} narration: ${narration} backdrop: ${backdrop}`);
|
|
466965
|
+
if (b.narrationError) console.log(source_default.red(` ! narration: ${b.narrationError}`));
|
|
466966
|
+
if (b.backdropError) console.log(source_default.red(` ! backdrop: ${b.backdropError}`));
|
|
466967
|
+
}
|
|
466968
|
+
if (result.composeData) {
|
|
466969
|
+
console.log();
|
|
466970
|
+
console.log(source_default.bold.cyan("Compose"));
|
|
466971
|
+
console.log(source_default.dim("\u2500".repeat(60)));
|
|
466972
|
+
console.log(` beats ${result.composeData.beats}`);
|
|
466973
|
+
console.log(` cache ${result.composeData.cacheHits} hit / ${result.composeData.beats - result.composeData.cacheHits} fresh`);
|
|
466974
|
+
console.log(` cost $${result.composeData.totalCostUsd.toFixed(4)}`);
|
|
466975
|
+
}
|
|
466976
|
+
if (result.outputPath) {
|
|
466977
|
+
console.log();
|
|
466978
|
+
console.log(source_default.bold.cyan("Render"));
|
|
466979
|
+
console.log(source_default.dim("\u2500".repeat(60)));
|
|
466980
|
+
console.log(` output ${source_default.bold(result.outputPath)}`);
|
|
466981
|
+
if (result.renderResult?.audioCount && result.renderResult.audioCount > 0) {
|
|
466982
|
+
console.log(` audio ${result.renderResult.audioCount} track${result.renderResult.audioCount === 1 ? "" : "s"} muxed`);
|
|
466983
|
+
}
|
|
466984
|
+
}
|
|
466985
|
+
console.log();
|
|
466986
|
+
console.log(source_default.dim(`Total: ${(result.totalLatencyMs / 1e3).toFixed(1)}s`));
|
|
466987
|
+
});
|
|
466988
|
+
function formatPrimitiveStatus(status, path14) {
|
|
466989
|
+
switch (status) {
|
|
466990
|
+
case "generated":
|
|
466991
|
+
return source_default.green(`\u2713 ${path14}`);
|
|
466992
|
+
case "cached":
|
|
466993
|
+
return source_default.dim(`\u25C7 ${path14} (cached)`);
|
|
466994
|
+
case "skipped":
|
|
466995
|
+
return source_default.dim("\xB7 skipped");
|
|
466996
|
+
case "no-cue":
|
|
466997
|
+
return source_default.dim("\xB7 no cue");
|
|
466998
|
+
case "failed":
|
|
466999
|
+
return source_default.red("\u2717 failed");
|
|
467000
|
+
default:
|
|
467001
|
+
return status;
|
|
467002
|
+
}
|
|
467003
|
+
}
|
|
466477
467004
|
|
|
466478
467005
|
// src/tools/scene.ts
|
|
466479
467006
|
var SCENE_PRESETS2 = ["simple", "announcement", "explainer", "kinetic-type", "product-shot"];
|
|
@@ -466569,7 +467096,7 @@ function summariseLint(result) {
|
|
|
466569
467096
|
async function handleSceneToolCall(name, args) {
|
|
466570
467097
|
switch (name) {
|
|
466571
467098
|
case "scene_init": {
|
|
466572
|
-
const dir =
|
|
467099
|
+
const dir = resolve44(process.cwd(), args.dir);
|
|
466573
467100
|
const result = await scaffoldSceneProject({
|
|
466574
467101
|
dir,
|
|
466575
467102
|
name: args.name,
|
|
@@ -466585,7 +467112,7 @@ async function handleSceneToolCall(name, args) {
|
|
|
466585
467112
|
});
|
|
466586
467113
|
}
|
|
466587
467114
|
case "scene_add": {
|
|
466588
|
-
const projectDir = args.projectDir ?
|
|
467115
|
+
const projectDir = args.projectDir ? resolve44(process.cwd(), args.projectDir) : process.cwd();
|
|
466589
467116
|
const result = await executeSceneAdd({
|
|
466590
467117
|
name: args.name,
|
|
466591
467118
|
preset: args.preset ?? "simple",
|
|
@@ -466616,7 +467143,7 @@ async function handleSceneToolCall(name, args) {
|
|
|
466616
467143
|
});
|
|
466617
467144
|
}
|
|
466618
467145
|
case "scene_lint": {
|
|
466619
|
-
const projectDir = args.projectDir ?
|
|
467146
|
+
const projectDir = args.projectDir ? resolve44(process.cwd(), args.projectDir) : process.cwd();
|
|
466620
467147
|
const result = await runProjectLint({
|
|
466621
467148
|
projectDir,
|
|
466622
467149
|
rootRel: args.root,
|
|
@@ -466625,7 +467152,7 @@ async function handleSceneToolCall(name, args) {
|
|
|
466625
467152
|
return JSON.stringify(summariseLint(result));
|
|
466626
467153
|
}
|
|
466627
467154
|
case "scene_render": {
|
|
466628
|
-
const projectDir = args.projectDir ?
|
|
467155
|
+
const projectDir = args.projectDir ? resolve44(process.cwd(), args.projectDir) : process.cwd();
|
|
466629
467156
|
const result = await executeSceneRender({
|
|
466630
467157
|
projectDir,
|
|
466631
467158
|
root: args.root,
|
|
@@ -466719,8 +467246,8 @@ async function handleToolCall(name, args) {
|
|
|
466719
467246
|
|
|
466720
467247
|
// src/resources/index.ts
|
|
466721
467248
|
init_engine();
|
|
466722
|
-
import { readFile as
|
|
466723
|
-
import { resolve as
|
|
467249
|
+
import { readFile as readFile27 } from "node:fs/promises";
|
|
467250
|
+
import { resolve as resolve45 } from "node:path";
|
|
466724
467251
|
var resources = [
|
|
466725
467252
|
{
|
|
466726
467253
|
uri: "vibe://project/current",
|
|
@@ -466755,8 +467282,8 @@ var resources = [
|
|
|
466755
467282
|
];
|
|
466756
467283
|
var currentProjectPath = process.env.VIBE_PROJECT_PATH || null;
|
|
466757
467284
|
async function loadProject2(projectPath) {
|
|
466758
|
-
const absPath =
|
|
466759
|
-
const content = await
|
|
467285
|
+
const absPath = resolve45(process.cwd(), projectPath);
|
|
467286
|
+
const content = await readFile27(absPath, "utf-8");
|
|
466760
467287
|
const data = JSON.parse(content);
|
|
466761
467288
|
return Project.fromJSON(data);
|
|
466762
467289
|
}
|