@vibeframe/mcp-server 0.54.0 → 0.55.1
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 +616 -368
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -6893,8 +6893,8 @@ var init_chrome = __esm({
|
|
|
6893
6893
|
|
|
6894
6894
|
// ../cli/src/pipeline/renderers/html-clips.ts
|
|
6895
6895
|
function relAsset(url) {
|
|
6896
|
-
const
|
|
6897
|
-
return `assets/${
|
|
6896
|
+
const basename19 = url.split("/").pop() ?? url;
|
|
6897
|
+
return `assets/${basename19}`;
|
|
6898
6898
|
}
|
|
6899
6899
|
function buildClipElements(state) {
|
|
6900
6900
|
return state.clips.map((clip) => {
|
|
@@ -7126,9 +7126,9 @@ var init_project_builder = __esm({
|
|
|
7126
7126
|
}
|
|
7127
7127
|
});
|
|
7128
7128
|
|
|
7129
|
-
// ../../node_modules/.pnpm/esbuild@0.
|
|
7129
|
+
// ../../node_modules/.pnpm/esbuild@0.24.2/node_modules/esbuild/lib/main.js
|
|
7130
7130
|
var require_main = __commonJS({
|
|
7131
|
-
"../../node_modules/.pnpm/esbuild@0.
|
|
7131
|
+
"../../node_modules/.pnpm/esbuild@0.24.2/node_modules/esbuild/lib/main.js"(exports, module) {
|
|
7132
7132
|
"use strict";
|
|
7133
7133
|
var __defProp3 = Object.defineProperty;
|
|
7134
7134
|
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
@@ -7333,31 +7333,25 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
7333
7333
|
var quote = JSON.stringify;
|
|
7334
7334
|
var buildLogLevelDefault = "warning";
|
|
7335
7335
|
var transformLogLevelDefault = "silent";
|
|
7336
|
-
function
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
if (value.indexOf(",") >= 0) throw new Error(`Invalid ${what}: ${value}`);
|
|
7341
|
-
toJoin.push(value);
|
|
7342
|
-
}
|
|
7343
|
-
return toJoin.join(",");
|
|
7336
|
+
function validateTarget(target) {
|
|
7337
|
+
validateStringValue(target, "target");
|
|
7338
|
+
if (target.indexOf(",") >= 0) throw new Error(`Invalid target: ${target}`);
|
|
7339
|
+
return target;
|
|
7344
7340
|
}
|
|
7345
7341
|
var canBeAnything = () => null;
|
|
7346
7342
|
var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean";
|
|
7347
7343
|
var mustBeString = (value) => typeof value === "string" ? null : "a string";
|
|
7348
7344
|
var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object";
|
|
7349
7345
|
var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer";
|
|
7350
|
-
var mustBeValidPortNumber = (value) => typeof value === "number" && value === (value | 0) && value >= 0 && value <= 65535 ? null : "a valid port number";
|
|
7351
7346
|
var mustBeFunction = (value) => typeof value === "function" ? null : "a function";
|
|
7352
7347
|
var mustBeArray = (value) => Array.isArray(value) ? null : "an array";
|
|
7353
|
-
var mustBeArrayOfStrings = (value) => Array.isArray(value) && value.every((x) => typeof x === "string") ? null : "an array of strings";
|
|
7354
7348
|
var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object";
|
|
7355
7349
|
var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object";
|
|
7356
7350
|
var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module";
|
|
7357
7351
|
var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null";
|
|
7358
7352
|
var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean";
|
|
7359
7353
|
var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object";
|
|
7360
|
-
var
|
|
7354
|
+
var mustBeStringOrArray = (value) => typeof value === "string" || Array.isArray(value) ? null : "a string or an array";
|
|
7361
7355
|
var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array";
|
|
7362
7356
|
var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL";
|
|
7363
7357
|
function getFlag3(object, keys2, key2, mustBeFn) {
|
|
@@ -7421,7 +7415,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
7421
7415
|
let legalComments = getFlag3(options, keys2, "legalComments", mustBeString);
|
|
7422
7416
|
let sourceRoot = getFlag3(options, keys2, "sourceRoot", mustBeString);
|
|
7423
7417
|
let sourcesContent = getFlag3(options, keys2, "sourcesContent", mustBeBoolean);
|
|
7424
|
-
let target = getFlag3(options, keys2, "target",
|
|
7418
|
+
let target = getFlag3(options, keys2, "target", mustBeStringOrArray);
|
|
7425
7419
|
let format4 = getFlag3(options, keys2, "format", mustBeString);
|
|
7426
7420
|
let globalName = getFlag3(options, keys2, "globalName", mustBeString);
|
|
7427
7421
|
let mangleProps = getFlag3(options, keys2, "mangleProps", mustBeRegExp);
|
|
@@ -7432,8 +7426,8 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
7432
7426
|
let minifyWhitespace = getFlag3(options, keys2, "minifyWhitespace", mustBeBoolean);
|
|
7433
7427
|
let minifyIdentifiers = getFlag3(options, keys2, "minifyIdentifiers", mustBeBoolean);
|
|
7434
7428
|
let lineLimit = getFlag3(options, keys2, "lineLimit", mustBeInteger);
|
|
7435
|
-
let drop = getFlag3(options, keys2, "drop",
|
|
7436
|
-
let dropLabels = getFlag3(options, keys2, "dropLabels",
|
|
7429
|
+
let drop = getFlag3(options, keys2, "drop", mustBeArray);
|
|
7430
|
+
let dropLabels = getFlag3(options, keys2, "dropLabels", mustBeArray);
|
|
7437
7431
|
let charset = getFlag3(options, keys2, "charset", mustBeString);
|
|
7438
7432
|
let treeShaking = getFlag3(options, keys2, "treeShaking", mustBeBoolean);
|
|
7439
7433
|
let ignoreAnnotations = getFlag3(options, keys2, "ignoreAnnotations", mustBeBoolean);
|
|
@@ -7446,15 +7440,17 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
7446
7440
|
let define2 = getFlag3(options, keys2, "define", mustBeObject);
|
|
7447
7441
|
let logOverride = getFlag3(options, keys2, "logOverride", mustBeObject);
|
|
7448
7442
|
let supported = getFlag3(options, keys2, "supported", mustBeObject);
|
|
7449
|
-
let pure = getFlag3(options, keys2, "pure",
|
|
7443
|
+
let pure = getFlag3(options, keys2, "pure", mustBeArray);
|
|
7450
7444
|
let keepNames = getFlag3(options, keys2, "keepNames", mustBeBoolean);
|
|
7451
7445
|
let platform = getFlag3(options, keys2, "platform", mustBeString);
|
|
7452
7446
|
let tsconfigRaw = getFlag3(options, keys2, "tsconfigRaw", mustBeStringOrObject);
|
|
7453
|
-
let absPaths = getFlag3(options, keys2, "absPaths", mustBeArrayOfStrings);
|
|
7454
7447
|
if (legalComments) flags.push(`--legal-comments=${legalComments}`);
|
|
7455
7448
|
if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`);
|
|
7456
7449
|
if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`);
|
|
7457
|
-
if (target)
|
|
7450
|
+
if (target) {
|
|
7451
|
+
if (Array.isArray(target)) flags.push(`--target=${Array.from(target).map(validateTarget).join(",")}`);
|
|
7452
|
+
else flags.push(`--target=${validateTarget(target)}`);
|
|
7453
|
+
}
|
|
7458
7454
|
if (format4) flags.push(`--format=${format4}`);
|
|
7459
7455
|
if (globalName) flags.push(`--global-name=${globalName}`);
|
|
7460
7456
|
if (platform) flags.push(`--platform=${platform}`);
|
|
@@ -7468,10 +7464,9 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
7468
7464
|
if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`);
|
|
7469
7465
|
if (ignoreAnnotations) flags.push(`--ignore-annotations`);
|
|
7470
7466
|
if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`);
|
|
7471
|
-
if (dropLabels) flags.push(`--drop-labels=${
|
|
7472
|
-
if (
|
|
7473
|
-
if (
|
|
7474
|
-
if (reserveProps) flags.push(`--reserve-props=${jsRegExpToGoRegExp(reserveProps)}`);
|
|
7467
|
+
if (dropLabels) flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`);
|
|
7468
|
+
if (mangleProps) flags.push(`--mangle-props=${mangleProps.source}`);
|
|
7469
|
+
if (reserveProps) flags.push(`--reserve-props=${reserveProps.source}`);
|
|
7475
7470
|
if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`);
|
|
7476
7471
|
if (jsx) flags.push(`--jsx=${jsx}`);
|
|
7477
7472
|
if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`);
|
|
@@ -7520,11 +7515,11 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
7520
7515
|
let outdir = getFlag3(options, keys2, "outdir", mustBeString);
|
|
7521
7516
|
let outbase = getFlag3(options, keys2, "outbase", mustBeString);
|
|
7522
7517
|
let tsconfig = getFlag3(options, keys2, "tsconfig", mustBeString);
|
|
7523
|
-
let resolveExtensions = getFlag3(options, keys2, "resolveExtensions",
|
|
7524
|
-
let nodePathsInput = getFlag3(options, keys2, "nodePaths",
|
|
7525
|
-
let mainFields = getFlag3(options, keys2, "mainFields",
|
|
7526
|
-
let conditions = getFlag3(options, keys2, "conditions",
|
|
7527
|
-
let external = getFlag3(options, keys2, "external",
|
|
7518
|
+
let resolveExtensions = getFlag3(options, keys2, "resolveExtensions", mustBeArray);
|
|
7519
|
+
let nodePathsInput = getFlag3(options, keys2, "nodePaths", mustBeArray);
|
|
7520
|
+
let mainFields = getFlag3(options, keys2, "mainFields", mustBeArray);
|
|
7521
|
+
let conditions = getFlag3(options, keys2, "conditions", mustBeArray);
|
|
7522
|
+
let external = getFlag3(options, keys2, "external", mustBeArray);
|
|
7528
7523
|
let packages = getFlag3(options, keys2, "packages", mustBeString);
|
|
7529
7524
|
let alias = getFlag3(options, keys2, "alias", mustBeObject);
|
|
7530
7525
|
let loader = getFlag3(options, keys2, "loader", mustBeObject);
|
|
@@ -7533,7 +7528,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
7533
7528
|
let entryNames = getFlag3(options, keys2, "entryNames", mustBeString);
|
|
7534
7529
|
let chunkNames = getFlag3(options, keys2, "chunkNames", mustBeString);
|
|
7535
7530
|
let assetNames = getFlag3(options, keys2, "assetNames", mustBeString);
|
|
7536
|
-
let inject = getFlag3(options, keys2, "inject",
|
|
7531
|
+
let inject = getFlag3(options, keys2, "inject", mustBeArray);
|
|
7537
7532
|
let banner = getFlag3(options, keys2, "banner", mustBeObject);
|
|
7538
7533
|
let footer = getFlag3(options, keys2, "footer", mustBeObject);
|
|
7539
7534
|
let entryPoints = getFlag3(options, keys2, "entryPoints", mustBeEntryPoints);
|
|
@@ -7555,13 +7550,37 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
7555
7550
|
if (outbase) flags.push(`--outbase=${outbase}`);
|
|
7556
7551
|
if (tsconfig) flags.push(`--tsconfig=${tsconfig}`);
|
|
7557
7552
|
if (packages) flags.push(`--packages=${packages}`);
|
|
7558
|
-
if (resolveExtensions)
|
|
7553
|
+
if (resolveExtensions) {
|
|
7554
|
+
let values = [];
|
|
7555
|
+
for (let value of resolveExtensions) {
|
|
7556
|
+
validateStringValue(value, "resolve extension");
|
|
7557
|
+
if (value.indexOf(",") >= 0) throw new Error(`Invalid resolve extension: ${value}`);
|
|
7558
|
+
values.push(value);
|
|
7559
|
+
}
|
|
7560
|
+
flags.push(`--resolve-extensions=${values.join(",")}`);
|
|
7561
|
+
}
|
|
7559
7562
|
if (publicPath) flags.push(`--public-path=${publicPath}`);
|
|
7560
7563
|
if (entryNames) flags.push(`--entry-names=${entryNames}`);
|
|
7561
7564
|
if (chunkNames) flags.push(`--chunk-names=${chunkNames}`);
|
|
7562
7565
|
if (assetNames) flags.push(`--asset-names=${assetNames}`);
|
|
7563
|
-
if (mainFields)
|
|
7564
|
-
|
|
7566
|
+
if (mainFields) {
|
|
7567
|
+
let values = [];
|
|
7568
|
+
for (let value of mainFields) {
|
|
7569
|
+
validateStringValue(value, "main field");
|
|
7570
|
+
if (value.indexOf(",") >= 0) throw new Error(`Invalid main field: ${value}`);
|
|
7571
|
+
values.push(value);
|
|
7572
|
+
}
|
|
7573
|
+
flags.push(`--main-fields=${values.join(",")}`);
|
|
7574
|
+
}
|
|
7575
|
+
if (conditions) {
|
|
7576
|
+
let values = [];
|
|
7577
|
+
for (let value of conditions) {
|
|
7578
|
+
validateStringValue(value, "condition");
|
|
7579
|
+
if (value.indexOf(",") >= 0) throw new Error(`Invalid condition: ${value}`);
|
|
7580
|
+
values.push(value);
|
|
7581
|
+
}
|
|
7582
|
+
flags.push(`--conditions=${values.join(",")}`);
|
|
7583
|
+
}
|
|
7565
7584
|
if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`);
|
|
7566
7585
|
if (alias) {
|
|
7567
7586
|
for (let old in alias) {
|
|
@@ -7758,8 +7777,8 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
7758
7777
|
if (isFirstPacket) {
|
|
7759
7778
|
isFirstPacket = false;
|
|
7760
7779
|
let binaryVersion = String.fromCharCode(...bytes);
|
|
7761
|
-
if (binaryVersion !== "0.
|
|
7762
|
-
throw new Error(`Cannot start service: Host version "${"0.
|
|
7780
|
+
if (binaryVersion !== "0.24.2") {
|
|
7781
|
+
throw new Error(`Cannot start service: Host version "${"0.24.2"}" does not match binary version ${quote(binaryVersion)}`);
|
|
7763
7782
|
}
|
|
7764
7783
|
return;
|
|
7765
7784
|
}
|
|
@@ -8047,7 +8066,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8047
8066
|
let latestResultPromise;
|
|
8048
8067
|
let provideLatestResult;
|
|
8049
8068
|
if (isContext)
|
|
8050
|
-
requestCallbacks["on-end"] = (id, request22) => new Promise((
|
|
8069
|
+
requestCallbacks["on-end"] = (id, request22) => new Promise((resolve44) => {
|
|
8051
8070
|
buildResponseToResult(request22, (err, result, onEndErrors, onEndWarnings) => {
|
|
8052
8071
|
const response = {
|
|
8053
8072
|
errors: onEndErrors,
|
|
@@ -8057,7 +8076,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8057
8076
|
latestResultPromise = void 0;
|
|
8058
8077
|
provideLatestResult = void 0;
|
|
8059
8078
|
sendResponse(id, response);
|
|
8060
|
-
|
|
8079
|
+
resolve44();
|
|
8061
8080
|
});
|
|
8062
8081
|
});
|
|
8063
8082
|
sendRequest(refs3, request5, (error, response) => {
|
|
@@ -8074,10 +8093,10 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8074
8093
|
let didDispose = false;
|
|
8075
8094
|
const result = {
|
|
8076
8095
|
rebuild: () => {
|
|
8077
|
-
if (!latestResultPromise) latestResultPromise = new Promise((
|
|
8096
|
+
if (!latestResultPromise) latestResultPromise = new Promise((resolve44, reject) => {
|
|
8078
8097
|
let settlePromise;
|
|
8079
8098
|
provideLatestResult = (err, result2) => {
|
|
8080
|
-
if (!settlePromise) settlePromise = () => err ? reject(err) :
|
|
8099
|
+
if (!settlePromise) settlePromise = () => err ? reject(err) : resolve44(result2);
|
|
8081
8100
|
};
|
|
8082
8101
|
const triggerAnotherBuild = () => {
|
|
8083
8102
|
const request22 = {
|
|
@@ -8098,31 +8117,28 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8098
8117
|
});
|
|
8099
8118
|
return latestResultPromise;
|
|
8100
8119
|
},
|
|
8101
|
-
watch: (options2 = {}) => new Promise((
|
|
8120
|
+
watch: (options2 = {}) => new Promise((resolve44, reject) => {
|
|
8102
8121
|
if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`);
|
|
8103
8122
|
const keys2 = {};
|
|
8104
|
-
const delay = getFlag3(options2, keys2, "delay", mustBeInteger);
|
|
8105
8123
|
checkForInvalidFlags(options2, keys2, `in watch() call`);
|
|
8106
8124
|
const request22 = {
|
|
8107
8125
|
command: "watch",
|
|
8108
8126
|
key: buildKey
|
|
8109
8127
|
};
|
|
8110
|
-
if (delay) request22.delay = delay;
|
|
8111
8128
|
sendRequest(refs3, request22, (error2) => {
|
|
8112
8129
|
if (error2) reject(new Error(error2));
|
|
8113
|
-
else
|
|
8130
|
+
else resolve44(void 0);
|
|
8114
8131
|
});
|
|
8115
8132
|
}),
|
|
8116
|
-
serve: (options2 = {}) => new Promise((
|
|
8133
|
+
serve: (options2 = {}) => new Promise((resolve44, reject) => {
|
|
8117
8134
|
if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`);
|
|
8118
8135
|
const keys2 = {};
|
|
8119
|
-
const port = getFlag3(options2, keys2, "port",
|
|
8136
|
+
const port = getFlag3(options2, keys2, "port", mustBeInteger);
|
|
8120
8137
|
const host = getFlag3(options2, keys2, "host", mustBeString);
|
|
8121
8138
|
const servedir = getFlag3(options2, keys2, "servedir", mustBeString);
|
|
8122
8139
|
const keyfile = getFlag3(options2, keys2, "keyfile", mustBeString);
|
|
8123
8140
|
const certfile = getFlag3(options2, keys2, "certfile", mustBeString);
|
|
8124
8141
|
const fallback2 = getFlag3(options2, keys2, "fallback", mustBeString);
|
|
8125
|
-
const cors = getFlag3(options2, keys2, "cors", mustBeObject);
|
|
8126
8142
|
const onRequest = getFlag3(options2, keys2, "onRequest", mustBeFunction);
|
|
8127
8143
|
checkForInvalidFlags(options2, keys2, `in serve() call`);
|
|
8128
8144
|
const request22 = {
|
|
@@ -8136,13 +8152,6 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8136
8152
|
if (keyfile !== void 0) request22.keyfile = keyfile;
|
|
8137
8153
|
if (certfile !== void 0) request22.certfile = certfile;
|
|
8138
8154
|
if (fallback2 !== void 0) request22.fallback = fallback2;
|
|
8139
|
-
if (cors) {
|
|
8140
|
-
const corsKeys = {};
|
|
8141
|
-
const origin = getFlag3(cors, corsKeys, "origin", mustBeStringOrArrayOfStrings);
|
|
8142
|
-
checkForInvalidFlags(cors, corsKeys, `on "cors" object`);
|
|
8143
|
-
if (Array.isArray(origin)) request22.corsOrigin = origin;
|
|
8144
|
-
else if (origin !== void 0) request22.corsOrigin = [origin];
|
|
8145
|
-
}
|
|
8146
8155
|
sendRequest(refs3, request22, (error2, response2) => {
|
|
8147
8156
|
if (error2) return reject(new Error(error2));
|
|
8148
8157
|
if (onRequest) {
|
|
@@ -8151,28 +8160,28 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8151
8160
|
sendResponse(id, {});
|
|
8152
8161
|
};
|
|
8153
8162
|
}
|
|
8154
|
-
|
|
8163
|
+
resolve44(response2);
|
|
8155
8164
|
});
|
|
8156
8165
|
}),
|
|
8157
|
-
cancel: () => new Promise((
|
|
8158
|
-
if (didDispose) return
|
|
8166
|
+
cancel: () => new Promise((resolve44) => {
|
|
8167
|
+
if (didDispose) return resolve44();
|
|
8159
8168
|
const request22 = {
|
|
8160
8169
|
command: "cancel",
|
|
8161
8170
|
key: buildKey
|
|
8162
8171
|
};
|
|
8163
8172
|
sendRequest(refs3, request22, () => {
|
|
8164
|
-
|
|
8173
|
+
resolve44();
|
|
8165
8174
|
});
|
|
8166
8175
|
}),
|
|
8167
|
-
dispose: () => new Promise((
|
|
8168
|
-
if (didDispose) return
|
|
8176
|
+
dispose: () => new Promise((resolve44) => {
|
|
8177
|
+
if (didDispose) return resolve44();
|
|
8169
8178
|
didDispose = true;
|
|
8170
8179
|
const request22 = {
|
|
8171
8180
|
command: "dispose",
|
|
8172
8181
|
key: buildKey
|
|
8173
8182
|
};
|
|
8174
8183
|
sendRequest(refs3, request22, () => {
|
|
8175
|
-
|
|
8184
|
+
resolve44();
|
|
8176
8185
|
scheduleOnDisposeCallbacks();
|
|
8177
8186
|
refs3.unref();
|
|
8178
8187
|
});
|
|
@@ -8211,7 +8220,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8211
8220
|
onLoad: []
|
|
8212
8221
|
};
|
|
8213
8222
|
i++;
|
|
8214
|
-
let
|
|
8223
|
+
let resolve44 = (path33, options = {}) => {
|
|
8215
8224
|
if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed');
|
|
8216
8225
|
if (typeof path33 !== "string") throw new Error(`The path to resolve must be a string`);
|
|
8217
8226
|
let keys22 = /* @__PURE__ */ Object.create(null);
|
|
@@ -8255,7 +8264,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8255
8264
|
};
|
|
8256
8265
|
let promise = setup({
|
|
8257
8266
|
initialOptions,
|
|
8258
|
-
resolve:
|
|
8267
|
+
resolve: resolve44,
|
|
8259
8268
|
onStart(callback) {
|
|
8260
8269
|
let registeredText = `This error came from the "onStart" callback registered here:`;
|
|
8261
8270
|
let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart");
|
|
@@ -8278,7 +8287,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8278
8287
|
if (filter4 == null) throw new Error(`onResolve() call is missing a filter`);
|
|
8279
8288
|
let id = nextCallbackID++;
|
|
8280
8289
|
onResolveCallbacks[id] = { name, callback, note: registeredNote };
|
|
8281
|
-
plugin2.onResolve.push({ id, filter:
|
|
8290
|
+
plugin2.onResolve.push({ id, filter: filter4.source, namespace: namespace || "" });
|
|
8282
8291
|
},
|
|
8283
8292
|
onLoad(options, callback) {
|
|
8284
8293
|
let registeredText = `This error came from the "onLoad" callback registered here:`;
|
|
@@ -8290,7 +8299,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8290
8299
|
if (filter4 == null) throw new Error(`onLoad() call is missing a filter`);
|
|
8291
8300
|
let id = nextCallbackID++;
|
|
8292
8301
|
onLoadCallbacks[id] = { name, callback, note: registeredNote };
|
|
8293
|
-
plugin2.onLoad.push({ id, filter:
|
|
8302
|
+
plugin2.onLoad.push({ id, filter: filter4.source, namespace: namespace || "" });
|
|
8294
8303
|
},
|
|
8295
8304
|
onDispose(callback) {
|
|
8296
8305
|
onDisposeCallbacks.push(callback);
|
|
@@ -8350,8 +8359,8 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8350
8359
|
let pluginData = getFlag3(result, keys2, "pluginData", canBeAnything);
|
|
8351
8360
|
let errors = getFlag3(result, keys2, "errors", mustBeArray);
|
|
8352
8361
|
let warnings = getFlag3(result, keys2, "warnings", mustBeArray);
|
|
8353
|
-
let watchFiles = getFlag3(result, keys2, "watchFiles",
|
|
8354
|
-
let watchDirs = getFlag3(result, keys2, "watchDirs",
|
|
8362
|
+
let watchFiles = getFlag3(result, keys2, "watchFiles", mustBeArray);
|
|
8363
|
+
let watchDirs = getFlag3(result, keys2, "watchDirs", mustBeArray);
|
|
8355
8364
|
checkForInvalidFlags(result, keys2, `from onResolve() callback in plugin ${quote(name)}`);
|
|
8356
8365
|
response.id = id2;
|
|
8357
8366
|
if (pluginName != null) response.pluginName = pluginName;
|
|
@@ -8396,8 +8405,8 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8396
8405
|
let loader = getFlag3(result, keys2, "loader", mustBeString);
|
|
8397
8406
|
let errors = getFlag3(result, keys2, "errors", mustBeArray);
|
|
8398
8407
|
let warnings = getFlag3(result, keys2, "warnings", mustBeArray);
|
|
8399
|
-
let watchFiles = getFlag3(result, keys2, "watchFiles",
|
|
8400
|
-
let watchDirs = getFlag3(result, keys2, "watchDirs",
|
|
8408
|
+
let watchFiles = getFlag3(result, keys2, "watchFiles", mustBeArray);
|
|
8409
|
+
let watchDirs = getFlag3(result, keys2, "watchDirs", mustBeArray);
|
|
8401
8410
|
checkForInvalidFlags(result, keys2, `from onLoad() callback in plugin ${quote(name)}`);
|
|
8402
8411
|
response.id = id2;
|
|
8403
8412
|
if (pluginName != null) response.pluginName = pluginName;
|
|
@@ -8701,11 +8710,6 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
|
|
|
8701
8710
|
}
|
|
8702
8711
|
};
|
|
8703
8712
|
}
|
|
8704
|
-
function jsRegExpToGoRegExp(regexp) {
|
|
8705
|
-
let result = regexp.source;
|
|
8706
|
-
if (regexp.flags) result = `(?${regexp.flags})${result}`;
|
|
8707
|
-
return result;
|
|
8708
|
-
}
|
|
8709
8713
|
var fs8 = __require("fs");
|
|
8710
8714
|
var os11 = __require("os");
|
|
8711
8715
|
var path14 = __require("path");
|
|
@@ -8742,8 +8746,7 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
|
|
|
8742
8746
|
};
|
|
8743
8747
|
var knownWebAssemblyFallbackPackages = {
|
|
8744
8748
|
"android arm LE": "@esbuild/android-arm",
|
|
8745
|
-
"android x64 LE": "@esbuild/android-x64"
|
|
8746
|
-
"openharmony arm64 LE": "@esbuild/openharmony-arm64"
|
|
8749
|
+
"android x64 LE": "@esbuild/android-x64"
|
|
8747
8750
|
};
|
|
8748
8751
|
function pkgAndSubpathForCurrentPlatform() {
|
|
8749
8752
|
let pkg;
|
|
@@ -8883,7 +8886,7 @@ for your current platform.`);
|
|
|
8883
8886
|
"node_modules",
|
|
8884
8887
|
".cache",
|
|
8885
8888
|
"esbuild",
|
|
8886
|
-
`pnpapi-${pkg.replace("/", "-")}-${"0.
|
|
8889
|
+
`pnpapi-${pkg.replace("/", "-")}-${"0.24.2"}-${path14.basename(subpath)}`
|
|
8887
8890
|
);
|
|
8888
8891
|
if (!fs8.existsSync(binTargetPath)) {
|
|
8889
8892
|
fs8.mkdirSync(path14.dirname(binTargetPath), { recursive: true });
|
|
@@ -8916,7 +8919,7 @@ for your current platform.`);
|
|
|
8916
8919
|
}
|
|
8917
8920
|
}
|
|
8918
8921
|
var _a7;
|
|
8919
|
-
var isInternalWorkerThread = ((_a7 = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a7.esbuildVersion) === "0.
|
|
8922
|
+
var isInternalWorkerThread = ((_a7 = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a7.esbuildVersion) === "0.24.2";
|
|
8920
8923
|
var esbuildCommandAndArgs = () => {
|
|
8921
8924
|
if ((!ESBUILD_BINARY_PATH || false) && (path23.basename(__filename) !== "main.js" || path23.basename(__dirname) !== "lib")) {
|
|
8922
8925
|
throw new Error(
|
|
@@ -8983,7 +8986,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
|
|
|
8983
8986
|
}
|
|
8984
8987
|
}
|
|
8985
8988
|
};
|
|
8986
|
-
var version = "0.
|
|
8989
|
+
var version = "0.24.2";
|
|
8987
8990
|
var build = (options) => ensureServiceIsRunning().build(options);
|
|
8988
8991
|
var context3 = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
|
|
8989
8992
|
var transform = (input3, options) => ensureServiceIsRunning().transform(input3, options);
|
|
@@ -9086,7 +9089,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
|
|
|
9086
9089
|
var ensureServiceIsRunning = () => {
|
|
9087
9090
|
if (longLivedService) return longLivedService;
|
|
9088
9091
|
let [command3, args] = esbuildCommandAndArgs();
|
|
9089
|
-
let child = child_process.spawn(command3, args.concat(`--service=${"0.
|
|
9092
|
+
let child = child_process.spawn(command3, args.concat(`--service=${"0.24.2"}`, "--ping"), {
|
|
9090
9093
|
windowsHide: true,
|
|
9091
9094
|
stdio: ["pipe", "pipe", "inherit"],
|
|
9092
9095
|
cwd: defaultWD
|
|
@@ -9133,46 +9136,46 @@ More information: The file containing the code for esbuild's JavaScript API (${_
|
|
|
9133
9136
|
}
|
|
9134
9137
|
};
|
|
9135
9138
|
longLivedService = {
|
|
9136
|
-
build: (options) => new Promise((
|
|
9139
|
+
build: (options) => new Promise((resolve44, reject) => {
|
|
9137
9140
|
service.buildOrContext({
|
|
9138
9141
|
callName: "build",
|
|
9139
9142
|
refs: refs3,
|
|
9140
9143
|
options,
|
|
9141
9144
|
isTTY: isTTY(),
|
|
9142
9145
|
defaultWD,
|
|
9143
|
-
callback: (err, res) => err ? reject(err) :
|
|
9146
|
+
callback: (err, res) => err ? reject(err) : resolve44(res)
|
|
9144
9147
|
});
|
|
9145
9148
|
}),
|
|
9146
|
-
context: (options) => new Promise((
|
|
9149
|
+
context: (options) => new Promise((resolve44, reject) => service.buildOrContext({
|
|
9147
9150
|
callName: "context",
|
|
9148
9151
|
refs: refs3,
|
|
9149
9152
|
options,
|
|
9150
9153
|
isTTY: isTTY(),
|
|
9151
9154
|
defaultWD,
|
|
9152
|
-
callback: (err, res) => err ? reject(err) :
|
|
9155
|
+
callback: (err, res) => err ? reject(err) : resolve44(res)
|
|
9153
9156
|
})),
|
|
9154
|
-
transform: (input3, options) => new Promise((
|
|
9157
|
+
transform: (input3, options) => new Promise((resolve44, reject) => service.transform({
|
|
9155
9158
|
callName: "transform",
|
|
9156
9159
|
refs: refs3,
|
|
9157
9160
|
input: input3,
|
|
9158
9161
|
options: options || {},
|
|
9159
9162
|
isTTY: isTTY(),
|
|
9160
9163
|
fs: fsAsync,
|
|
9161
|
-
callback: (err, res) => err ? reject(err) :
|
|
9164
|
+
callback: (err, res) => err ? reject(err) : resolve44(res)
|
|
9162
9165
|
})),
|
|
9163
|
-
formatMessages: (messages, options) => new Promise((
|
|
9166
|
+
formatMessages: (messages, options) => new Promise((resolve44, reject) => service.formatMessages({
|
|
9164
9167
|
callName: "formatMessages",
|
|
9165
9168
|
refs: refs3,
|
|
9166
9169
|
messages,
|
|
9167
9170
|
options,
|
|
9168
|
-
callback: (err, res) => err ? reject(err) :
|
|
9171
|
+
callback: (err, res) => err ? reject(err) : resolve44(res)
|
|
9169
9172
|
})),
|
|
9170
|
-
analyzeMetafile: (metafile, options) => new Promise((
|
|
9173
|
+
analyzeMetafile: (metafile, options) => new Promise((resolve44, reject) => service.analyzeMetafile({
|
|
9171
9174
|
callName: "analyzeMetafile",
|
|
9172
9175
|
refs: refs3,
|
|
9173
9176
|
metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile),
|
|
9174
9177
|
options,
|
|
9175
|
-
callback: (err, res) => err ? reject(err) :
|
|
9178
|
+
callback: (err, res) => err ? reject(err) : resolve44(res)
|
|
9176
9179
|
}))
|
|
9177
9180
|
};
|
|
9178
9181
|
return longLivedService;
|
|
@@ -9190,7 +9193,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
|
|
|
9190
9193
|
esbuild: node_exports
|
|
9191
9194
|
});
|
|
9192
9195
|
callback(service);
|
|
9193
|
-
let stdout = child_process.execFileSync(command3, args.concat(`--service=${"0.
|
|
9196
|
+
let stdout = child_process.execFileSync(command3, args.concat(`--service=${"0.24.2"}`), {
|
|
9194
9197
|
cwd: defaultWD,
|
|
9195
9198
|
windowsHide: true,
|
|
9196
9199
|
input: stdin,
|
|
@@ -9210,7 +9213,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
|
|
|
9210
9213
|
var startWorkerThreadService = (worker_threads2) => {
|
|
9211
9214
|
let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
|
|
9212
9215
|
let worker = new worker_threads2.Worker(__filename, {
|
|
9213
|
-
workerData: { workerPort, defaultWD, esbuildVersion: "0.
|
|
9216
|
+
workerData: { workerPort, defaultWD, esbuildVersion: "0.24.2" },
|
|
9214
9217
|
transferList: [workerPort],
|
|
9215
9218
|
// From node's documentation: https://nodejs.org/api/worker_threads.html
|
|
9216
9219
|
//
|
|
@@ -9250,13 +9253,13 @@ error: ${text}`);
|
|
|
9250
9253
|
worker.postMessage(msg);
|
|
9251
9254
|
let status = Atomics.wait(sharedBufferView, 0, 0);
|
|
9252
9255
|
if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status);
|
|
9253
|
-
let { message: { id: id2, resolve:
|
|
9256
|
+
let { message: { id: id2, resolve: resolve44, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort);
|
|
9254
9257
|
if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`);
|
|
9255
9258
|
if (reject) {
|
|
9256
9259
|
applyProperties(reject, properties);
|
|
9257
9260
|
throw reject;
|
|
9258
9261
|
}
|
|
9259
|
-
return
|
|
9262
|
+
return resolve44;
|
|
9260
9263
|
};
|
|
9261
9264
|
worker.unref();
|
|
9262
9265
|
return {
|
|
@@ -12904,7 +12907,7 @@ var require_previous_map = __commonJS({
|
|
|
12904
12907
|
"../../node_modules/.pnpm/postcss@8.5.6/node_modules/postcss/lib/previous-map.js"(exports, module) {
|
|
12905
12908
|
"use strict";
|
|
12906
12909
|
var { existsSync: existsSync38, readFileSync: readFileSync11 } = __require("fs");
|
|
12907
|
-
var { dirname:
|
|
12910
|
+
var { dirname: dirname26, join: join23 } = __require("path");
|
|
12908
12911
|
var { SourceMapConsumer, SourceMapGenerator } = require_source_map();
|
|
12909
12912
|
function fromBase64(str) {
|
|
12910
12913
|
if (Buffer) {
|
|
@@ -12923,7 +12926,7 @@ var require_previous_map = __commonJS({
|
|
|
12923
12926
|
if (!this.mapFile && opts.from) {
|
|
12924
12927
|
this.mapFile = opts.from;
|
|
12925
12928
|
}
|
|
12926
|
-
if (this.mapFile) this.root =
|
|
12929
|
+
if (this.mapFile) this.root = dirname26(this.mapFile);
|
|
12927
12930
|
if (text) this.text = text;
|
|
12928
12931
|
}
|
|
12929
12932
|
consumer() {
|
|
@@ -12965,7 +12968,7 @@ var require_previous_map = __commonJS({
|
|
|
12965
12968
|
}
|
|
12966
12969
|
}
|
|
12967
12970
|
loadFile(path14) {
|
|
12968
|
-
this.root =
|
|
12971
|
+
this.root = dirname26(path14);
|
|
12969
12972
|
if (existsSync38(path14)) {
|
|
12970
12973
|
this.mapFile = path14;
|
|
12971
12974
|
return readFileSync11(path14, "utf-8").toString().trim();
|
|
@@ -13002,7 +13005,7 @@ var require_previous_map = __commonJS({
|
|
|
13002
13005
|
return this.decodeInline(this.annotation);
|
|
13003
13006
|
} else if (this.annotation) {
|
|
13004
13007
|
let map3 = this.annotation;
|
|
13005
|
-
if (file) map3 = join23(
|
|
13008
|
+
if (file) map3 = join23(dirname26(file), map3);
|
|
13006
13009
|
return this.loadFile(map3);
|
|
13007
13010
|
}
|
|
13008
13011
|
}
|
|
@@ -13024,7 +13027,7 @@ var require_input = __commonJS({
|
|
|
13024
13027
|
"../../node_modules/.pnpm/postcss@8.5.6/node_modules/postcss/lib/input.js"(exports, module) {
|
|
13025
13028
|
"use strict";
|
|
13026
13029
|
var { nanoid } = require_non_secure();
|
|
13027
|
-
var { isAbsolute: isAbsolute5, resolve:
|
|
13030
|
+
var { isAbsolute: isAbsolute5, resolve: resolve44 } = __require("path");
|
|
13028
13031
|
var { SourceMapConsumer, SourceMapGenerator } = require_source_map();
|
|
13029
13032
|
var { fileURLToPath: fileURLToPath6, pathToFileURL } = __require("url");
|
|
13030
13033
|
var CssSyntaxError2 = require_css_syntax_error();
|
|
@@ -13032,7 +13035,7 @@ var require_input = __commonJS({
|
|
|
13032
13035
|
var terminalHighlight = require_terminal_highlight();
|
|
13033
13036
|
var lineToIndexCache = /* @__PURE__ */ Symbol("lineToIndexCache");
|
|
13034
13037
|
var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
|
|
13035
|
-
var pathAvailable = Boolean(
|
|
13038
|
+
var pathAvailable = Boolean(resolve44 && isAbsolute5);
|
|
13036
13039
|
function getLineToIndex(input3) {
|
|
13037
13040
|
if (input3[lineToIndexCache]) return input3[lineToIndexCache];
|
|
13038
13041
|
let lines = input3.css.split("\n");
|
|
@@ -13066,7 +13069,7 @@ var require_input = __commonJS({
|
|
|
13066
13069
|
if (!pathAvailable || /^\w+:\/\//.test(opts.from) || isAbsolute5(opts.from)) {
|
|
13067
13070
|
this.file = opts.from;
|
|
13068
13071
|
} else {
|
|
13069
|
-
this.file =
|
|
13072
|
+
this.file = resolve44(opts.from);
|
|
13070
13073
|
}
|
|
13071
13074
|
}
|
|
13072
13075
|
if (pathAvailable && sourceMapAvailable) {
|
|
@@ -13179,7 +13182,7 @@ var require_input = __commonJS({
|
|
|
13179
13182
|
if (/^\w+:\/\//.test(file)) {
|
|
13180
13183
|
return file;
|
|
13181
13184
|
}
|
|
13182
|
-
return
|
|
13185
|
+
return resolve44(this.map.consumer().sourceRoot || this.map.root || ".", file);
|
|
13183
13186
|
}
|
|
13184
13187
|
origin(line, column, endLine, endColumn) {
|
|
13185
13188
|
if (!this.map) return false;
|
|
@@ -13438,12 +13441,12 @@ var require_fromJSON = __commonJS({
|
|
|
13438
13441
|
var require_map_generator = __commonJS({
|
|
13439
13442
|
"../../node_modules/.pnpm/postcss@8.5.6/node_modules/postcss/lib/map-generator.js"(exports, module) {
|
|
13440
13443
|
"use strict";
|
|
13441
|
-
var { dirname:
|
|
13444
|
+
var { dirname: dirname26, relative: relative8, resolve: resolve44, sep } = __require("path");
|
|
13442
13445
|
var { SourceMapConsumer, SourceMapGenerator } = require_source_map();
|
|
13443
13446
|
var { pathToFileURL } = __require("url");
|
|
13444
13447
|
var Input2 = require_input();
|
|
13445
13448
|
var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
|
|
13446
|
-
var pathAvailable = Boolean(
|
|
13449
|
+
var pathAvailable = Boolean(dirname26 && resolve44 && relative8 && sep);
|
|
13447
13450
|
var MapGenerator = class {
|
|
13448
13451
|
constructor(stringify5, root2, opts, cssString) {
|
|
13449
13452
|
this.stringify = stringify5;
|
|
@@ -13475,7 +13478,7 @@ var require_map_generator = __commonJS({
|
|
|
13475
13478
|
applyPrevMaps() {
|
|
13476
13479
|
for (let prev of this.previous()) {
|
|
13477
13480
|
let from3 = this.toUrl(this.path(prev.file));
|
|
13478
|
-
let root2 = prev.root ||
|
|
13481
|
+
let root2 = prev.root || dirname26(prev.file);
|
|
13479
13482
|
let map3;
|
|
13480
13483
|
if (this.mapOpts.sourcesContent === false) {
|
|
13481
13484
|
map3 = new SourceMapConsumer(prev.text);
|
|
@@ -13662,9 +13665,9 @@ var require_map_generator = __commonJS({
|
|
|
13662
13665
|
if (/^\w+:\/\//.test(file)) return file;
|
|
13663
13666
|
let cached = this.memoizedPaths.get(file);
|
|
13664
13667
|
if (cached) return cached;
|
|
13665
|
-
let from3 = this.opts.to ?
|
|
13668
|
+
let from3 = this.opts.to ? dirname26(this.opts.to) : ".";
|
|
13666
13669
|
if (typeof this.mapOpts.annotation === "string") {
|
|
13667
|
-
from3 =
|
|
13670
|
+
from3 = dirname26(resolve44(from3, this.mapOpts.annotation));
|
|
13668
13671
|
}
|
|
13669
13672
|
let path14 = relative8(from3, file);
|
|
13670
13673
|
this.memoizedPaths.set(file, path14);
|
|
@@ -15190,11 +15193,11 @@ function __extends(d, b) {
|
|
|
15190
15193
|
}
|
|
15191
15194
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
15192
15195
|
function adopt(value) {
|
|
15193
|
-
return value instanceof P ? value : new P(function(
|
|
15194
|
-
|
|
15196
|
+
return value instanceof P ? value : new P(function(resolve44) {
|
|
15197
|
+
resolve44(value);
|
|
15195
15198
|
});
|
|
15196
15199
|
}
|
|
15197
|
-
return new (P || (P = Promise))(function(
|
|
15200
|
+
return new (P || (P = Promise))(function(resolve44, reject) {
|
|
15198
15201
|
function fulfilled(value) {
|
|
15199
15202
|
try {
|
|
15200
15203
|
step(generator.next(value));
|
|
@@ -15210,7 +15213,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
15210
15213
|
}
|
|
15211
15214
|
}
|
|
15212
15215
|
function step(result) {
|
|
15213
|
-
result.done ?
|
|
15216
|
+
result.done ? resolve44(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
15214
15217
|
}
|
|
15215
15218
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15216
15219
|
});
|
|
@@ -15373,14 +15376,14 @@ function __asyncValues(o) {
|
|
|
15373
15376
|
}, i);
|
|
15374
15377
|
function verb(n) {
|
|
15375
15378
|
i[n] = o[n] && function(v) {
|
|
15376
|
-
return new Promise(function(
|
|
15377
|
-
v = o[n](v), settle(
|
|
15379
|
+
return new Promise(function(resolve44, reject) {
|
|
15380
|
+
v = o[n](v), settle(resolve44, reject, v.done, v.value);
|
|
15378
15381
|
});
|
|
15379
15382
|
};
|
|
15380
15383
|
}
|
|
15381
|
-
function settle(
|
|
15384
|
+
function settle(resolve44, reject, d, v) {
|
|
15382
15385
|
Promise.resolve(v).then(function(v2) {
|
|
15383
|
-
|
|
15386
|
+
resolve44({ value: v2, done: d });
|
|
15384
15387
|
}, reject);
|
|
15385
15388
|
}
|
|
15386
15389
|
}
|
|
@@ -15905,7 +15908,7 @@ function of() {
|
|
|
15905
15908
|
}
|
|
15906
15909
|
function lastValueFrom(source3, config22) {
|
|
15907
15910
|
var hasConfig = typeof config22 === "object";
|
|
15908
|
-
return new Promise(function(
|
|
15911
|
+
return new Promise(function(resolve44, reject) {
|
|
15909
15912
|
var _hasValue = false;
|
|
15910
15913
|
var _value;
|
|
15911
15914
|
source3.subscribe({
|
|
@@ -15916,9 +15919,9 @@ function lastValueFrom(source3, config22) {
|
|
|
15916
15919
|
error: reject,
|
|
15917
15920
|
complete: function() {
|
|
15918
15921
|
if (_hasValue) {
|
|
15919
|
-
|
|
15922
|
+
resolve44(_value);
|
|
15920
15923
|
} else if (hasConfig) {
|
|
15921
|
-
|
|
15924
|
+
resolve44(config22.defaultValue);
|
|
15922
15925
|
} else {
|
|
15923
15926
|
reject(new EmptyError());
|
|
15924
15927
|
}
|
|
@@ -15928,16 +15931,16 @@ function lastValueFrom(source3, config22) {
|
|
|
15928
15931
|
}
|
|
15929
15932
|
function firstValueFrom(source3, config22) {
|
|
15930
15933
|
var hasConfig = typeof config22 === "object";
|
|
15931
|
-
return new Promise(function(
|
|
15934
|
+
return new Promise(function(resolve44, reject) {
|
|
15932
15935
|
var subscriber = new SafeSubscriber({
|
|
15933
15936
|
next: function(value) {
|
|
15934
|
-
|
|
15937
|
+
resolve44(value);
|
|
15935
15938
|
subscriber.unsubscribe();
|
|
15936
15939
|
},
|
|
15937
15940
|
error: reject,
|
|
15938
15941
|
complete: function() {
|
|
15939
15942
|
if (hasConfig) {
|
|
15940
|
-
|
|
15943
|
+
resolve44(config22.defaultValue);
|
|
15941
15944
|
} else {
|
|
15942
15945
|
reject(new EmptyError());
|
|
15943
15946
|
}
|
|
@@ -16976,7 +16979,7 @@ var init_rxjs = __esm({
|
|
|
16976
16979
|
Observable22.prototype.forEach = function(next, promiseCtor) {
|
|
16977
16980
|
var _this = this;
|
|
16978
16981
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
16979
|
-
return new promiseCtor(function(
|
|
16982
|
+
return new promiseCtor(function(resolve44, reject) {
|
|
16980
16983
|
var subscriber = new SafeSubscriber({
|
|
16981
16984
|
next: function(value) {
|
|
16982
16985
|
try {
|
|
@@ -16987,7 +16990,7 @@ var init_rxjs = __esm({
|
|
|
16987
16990
|
}
|
|
16988
16991
|
},
|
|
16989
16992
|
error: reject,
|
|
16990
|
-
complete:
|
|
16993
|
+
complete: resolve44
|
|
16991
16994
|
});
|
|
16992
16995
|
_this.subscribe(subscriber);
|
|
16993
16996
|
});
|
|
@@ -17009,14 +17012,14 @@ var init_rxjs = __esm({
|
|
|
17009
17012
|
Observable22.prototype.toPromise = function(promiseCtor) {
|
|
17010
17013
|
var _this = this;
|
|
17011
17014
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
17012
|
-
return new promiseCtor(function(
|
|
17015
|
+
return new promiseCtor(function(resolve44, reject) {
|
|
17013
17016
|
var value;
|
|
17014
17017
|
_this.subscribe(function(x) {
|
|
17015
17018
|
return value = x;
|
|
17016
17019
|
}, function(err) {
|
|
17017
17020
|
return reject(err);
|
|
17018
17021
|
}, function() {
|
|
17019
|
-
return
|
|
17022
|
+
return resolve44(value);
|
|
17020
17023
|
});
|
|
17021
17024
|
});
|
|
17022
17025
|
};
|
|
@@ -19434,8 +19437,8 @@ var init_Deferred = __esm({
|
|
|
19434
19437
|
// SAFETY: This is ensured by #taskPromise.
|
|
19435
19438
|
#resolve;
|
|
19436
19439
|
// TODO: Switch to Promise.withResolvers with Node 22
|
|
19437
|
-
#taskPromise = new Promise((
|
|
19438
|
-
this.#resolve =
|
|
19440
|
+
#taskPromise = new Promise((resolve44) => {
|
|
19441
|
+
this.#resolve = resolve44;
|
|
19439
19442
|
});
|
|
19440
19443
|
#timeoutId;
|
|
19441
19444
|
#timeoutError;
|
|
@@ -19525,12 +19528,12 @@ var init_Mutex = __esm({
|
|
|
19525
19528
|
return new _Mutex.Guard(this, onRelease);
|
|
19526
19529
|
}
|
|
19527
19530
|
release() {
|
|
19528
|
-
const
|
|
19529
|
-
if (!
|
|
19531
|
+
const resolve44 = this.#acquirers.shift();
|
|
19532
|
+
if (!resolve44) {
|
|
19530
19533
|
this.#locked = false;
|
|
19531
19534
|
return;
|
|
19532
19535
|
}
|
|
19533
|
-
|
|
19536
|
+
resolve44();
|
|
19534
19537
|
}
|
|
19535
19538
|
};
|
|
19536
19539
|
}
|
|
@@ -21545,12 +21548,12 @@ var init_locators = __esm({
|
|
|
21545
21548
|
}
|
|
21546
21549
|
return defer(() => {
|
|
21547
21550
|
return from(handle.evaluate((element) => {
|
|
21548
|
-
return new Promise((
|
|
21551
|
+
return new Promise((resolve44) => {
|
|
21549
21552
|
window.requestAnimationFrame(() => {
|
|
21550
21553
|
const rect1 = element.getBoundingClientRect();
|
|
21551
21554
|
window.requestAnimationFrame(() => {
|
|
21552
21555
|
const rect2 = element.getBoundingClientRect();
|
|
21553
|
-
|
|
21556
|
+
resolve44([
|
|
21554
21557
|
{
|
|
21555
21558
|
x: rect1.x,
|
|
21556
21559
|
y: rect1.y,
|
|
@@ -23289,9 +23292,9 @@ var init_ElementHandle = __esm({
|
|
|
23289
23292
|
const handle = await this.#asSVGElementHandle();
|
|
23290
23293
|
const target = __addDisposableResource6(env_5, handle && await handle.#getOwnerSVGElement(), false);
|
|
23291
23294
|
return await (target ?? this).evaluate(async (element, threshold) => {
|
|
23292
|
-
const visibleRatio = await new Promise((
|
|
23295
|
+
const visibleRatio = await new Promise((resolve44) => {
|
|
23293
23296
|
const observer = new IntersectionObserver((entries2) => {
|
|
23294
|
-
|
|
23297
|
+
resolve44(entries2[0].intersectionRatio);
|
|
23295
23298
|
observer.disconnect();
|
|
23296
23299
|
});
|
|
23297
23300
|
observer.observe(element);
|
|
@@ -23984,7 +23987,7 @@ var init_Frame = __esm({
|
|
|
23984
23987
|
}
|
|
23985
23988
|
type = type ?? "text/javascript";
|
|
23986
23989
|
return await this.mainRealm().transferHandle(await this.isolatedRealm().evaluateHandle(async ({ url, id, type: type2, content: content2 }) => {
|
|
23987
|
-
return await new Promise((
|
|
23990
|
+
return await new Promise((resolve44, reject) => {
|
|
23988
23991
|
const script = document.createElement("script");
|
|
23989
23992
|
script.type = type2;
|
|
23990
23993
|
script.text = content2;
|
|
@@ -23997,12 +24000,12 @@ var init_Frame = __esm({
|
|
|
23997
24000
|
if (url) {
|
|
23998
24001
|
script.src = url;
|
|
23999
24002
|
script.addEventListener("load", () => {
|
|
24000
|
-
|
|
24003
|
+
resolve44(script);
|
|
24001
24004
|
}, { once: true });
|
|
24002
24005
|
document.head.appendChild(script);
|
|
24003
24006
|
} else {
|
|
24004
24007
|
document.head.appendChild(script);
|
|
24005
|
-
|
|
24008
|
+
resolve44(script);
|
|
24006
24009
|
}
|
|
24007
24010
|
});
|
|
24008
24011
|
}, { ...options, type, content }));
|
|
@@ -24022,7 +24025,7 @@ var init_Frame = __esm({
|
|
|
24022
24025
|
options.content = content;
|
|
24023
24026
|
}
|
|
24024
24027
|
return await this.mainRealm().transferHandle(await this.isolatedRealm().evaluateHandle(async ({ url, content: content2 }) => {
|
|
24025
|
-
return await new Promise((
|
|
24028
|
+
return await new Promise((resolve44, reject) => {
|
|
24026
24029
|
let element;
|
|
24027
24030
|
if (!url) {
|
|
24028
24031
|
element = document.createElement("style");
|
|
@@ -24034,7 +24037,7 @@ var init_Frame = __esm({
|
|
|
24034
24037
|
element = link;
|
|
24035
24038
|
}
|
|
24036
24039
|
element.addEventListener("load", () => {
|
|
24037
|
-
|
|
24040
|
+
resolve44(element);
|
|
24038
24041
|
}, { once: true });
|
|
24039
24042
|
element.addEventListener("error", (event) => {
|
|
24040
24043
|
reject(new Error(event.message ?? "Could not load style"));
|
|
@@ -25773,9 +25776,9 @@ var init_Page = __esm({
|
|
|
25773
25776
|
++this.#screencastSessionCount;
|
|
25774
25777
|
if (!this.#startScreencastPromise) {
|
|
25775
25778
|
this.#startScreencastPromise = this.mainFrame().client.send("Page.startScreencast", { format: "png" }).then(() => {
|
|
25776
|
-
return new Promise((
|
|
25779
|
+
return new Promise((resolve44) => {
|
|
25777
25780
|
return this.mainFrame().client.once("Page.screencastFrame", () => {
|
|
25778
|
-
return
|
|
25781
|
+
return resolve44();
|
|
25779
25782
|
});
|
|
25780
25783
|
});
|
|
25781
25784
|
});
|
|
@@ -29164,11 +29167,11 @@ function addPageBinding(type, name, prefix) {
|
|
|
29164
29167
|
return value instanceof Node;
|
|
29165
29168
|
})
|
|
29166
29169
|
}));
|
|
29167
|
-
return new Promise((
|
|
29170
|
+
return new Promise((resolve44, reject) => {
|
|
29168
29171
|
callPuppeteer.callbacks.set(seq, {
|
|
29169
29172
|
resolve(value) {
|
|
29170
29173
|
callPuppeteer.args.delete(seq);
|
|
29171
|
-
|
|
29174
|
+
resolve44(value);
|
|
29172
29175
|
},
|
|
29173
29176
|
reject(value) {
|
|
29174
29177
|
callPuppeteer.args.delete(seq);
|
|
@@ -33007,8 +33010,8 @@ var init_Input2 = __esm({
|
|
|
33007
33010
|
if (typeof delay === "number") {
|
|
33008
33011
|
await Promise.all(actions);
|
|
33009
33012
|
actions.length = 0;
|
|
33010
|
-
await new Promise((
|
|
33011
|
-
setTimeout(
|
|
33013
|
+
await new Promise((resolve44) => {
|
|
33014
|
+
setTimeout(resolve44, delay);
|
|
33012
33015
|
});
|
|
33013
33016
|
}
|
|
33014
33017
|
actions.push(this.up({ ...options, clickCount }));
|
|
@@ -33028,9 +33031,9 @@ var init_Input2 = __esm({
|
|
|
33028
33031
|
});
|
|
33029
33032
|
}
|
|
33030
33033
|
async drag(start, target) {
|
|
33031
|
-
const promise = new Promise((
|
|
33034
|
+
const promise = new Promise((resolve44) => {
|
|
33032
33035
|
this.#client.once("Input.dragIntercepted", (event) => {
|
|
33033
|
-
return
|
|
33036
|
+
return resolve44(event.data);
|
|
33034
33037
|
});
|
|
33035
33038
|
});
|
|
33036
33039
|
await this.move(start.x, start.y);
|
|
@@ -33071,8 +33074,8 @@ var init_Input2 = __esm({
|
|
|
33071
33074
|
await this.dragEnter(target, data);
|
|
33072
33075
|
await this.dragOver(target, data);
|
|
33073
33076
|
if (delay) {
|
|
33074
|
-
await new Promise((
|
|
33075
|
-
return setTimeout(
|
|
33077
|
+
await new Promise((resolve44) => {
|
|
33078
|
+
return setTimeout(resolve44, delay);
|
|
33076
33079
|
});
|
|
33077
33080
|
}
|
|
33078
33081
|
await this.drop(target, data);
|
|
@@ -33333,11 +33336,11 @@ var init_WebMCP = __esm({
|
|
|
33333
33336
|
*/
|
|
33334
33337
|
async execute(input3 = {}) {
|
|
33335
33338
|
const { invocationId } = await this.#webmcp.invokeTool(this, input3);
|
|
33336
|
-
return await new Promise((
|
|
33339
|
+
return await new Promise((resolve44) => {
|
|
33337
33340
|
const handler4 = (event) => {
|
|
33338
33341
|
if (event.id === invocationId) {
|
|
33339
33342
|
this.#webmcp.off("toolresponded", handler4);
|
|
33340
|
-
|
|
33343
|
+
resolve44(event);
|
|
33341
33344
|
}
|
|
33342
33345
|
};
|
|
33343
33346
|
this.#webmcp.on("toolresponded", handler4);
|
|
@@ -34145,9 +34148,9 @@ var init_Page2 = __esm({
|
|
|
34145
34148
|
async captureHeapSnapshot(options) {
|
|
34146
34149
|
const { createWriteStream: createWriteStream3 } = environment.value.fs;
|
|
34147
34150
|
const stream = createWriteStream3(options.path);
|
|
34148
|
-
const streamPromise = new Promise((
|
|
34151
|
+
const streamPromise = new Promise((resolve44, reject) => {
|
|
34149
34152
|
stream.on("error", reject);
|
|
34150
|
-
stream.on("finish",
|
|
34153
|
+
stream.on("finish", resolve44);
|
|
34151
34154
|
});
|
|
34152
34155
|
const client = this.#primaryTargetClient;
|
|
34153
34156
|
await client.send("HeapProfiler.enable");
|
|
@@ -35513,12 +35516,12 @@ var init_Browser2 = __esm({
|
|
|
35513
35516
|
for (const [targetId, targetInfo] of this._targetManager().getDiscoveredTargetInfos().entries()) {
|
|
35514
35517
|
if (targetInfo.url.includes(id) && targetInfo.type === "service_worker") {
|
|
35515
35518
|
this._targetManager().addToIgnoreTarget(targetId);
|
|
35516
|
-
targetDestroyedPromises.push(new Promise((
|
|
35519
|
+
targetDestroyedPromises.push(new Promise((resolve44) => {
|
|
35517
35520
|
return setTimeout(() => {
|
|
35518
35521
|
this.#connection.emit("Target.targetDestroyed", {
|
|
35519
35522
|
targetId
|
|
35520
35523
|
});
|
|
35521
|
-
|
|
35524
|
+
resolve44(null);
|
|
35522
35525
|
}, 0);
|
|
35523
35526
|
}));
|
|
35524
35527
|
}
|
|
@@ -35921,10 +35924,10 @@ var init_BrowserWebSocketTransport = __esm({
|
|
|
35921
35924
|
"../../node_modules/.pnpm/puppeteer-core@24.41.0/node_modules/puppeteer-core/lib/esm/puppeteer/common/BrowserWebSocketTransport.js"() {
|
|
35922
35925
|
BrowserWebSocketTransport = class _BrowserWebSocketTransport {
|
|
35923
35926
|
static create(url) {
|
|
35924
|
-
return new Promise((
|
|
35927
|
+
return new Promise((resolve44, reject) => {
|
|
35925
35928
|
const ws = new WebSocket(url);
|
|
35926
35929
|
ws.addEventListener("open", () => {
|
|
35927
|
-
return
|
|
35930
|
+
return resolve44(new _BrowserWebSocketTransport(ws));
|
|
35928
35931
|
});
|
|
35929
35932
|
ws.addEventListener("error", reject);
|
|
35930
35933
|
});
|
|
@@ -38846,11 +38849,11 @@ var require_BrowsingContextProcessor = __commonJS({
|
|
|
38846
38849
|
}
|
|
38847
38850
|
const parentCdpClient = context3.cdpTarget.parentCdpClient;
|
|
38848
38851
|
try {
|
|
38849
|
-
const detachedFromTargetPromise = new Promise((
|
|
38852
|
+
const detachedFromTargetPromise = new Promise((resolve44) => {
|
|
38850
38853
|
const onContextDestroyed = (event) => {
|
|
38851
38854
|
if (event.targetId === params.context) {
|
|
38852
38855
|
parentCdpClient.off("Target.detachedFromTarget", onContextDestroyed);
|
|
38853
|
-
|
|
38856
|
+
resolve44();
|
|
38854
38857
|
}
|
|
38855
38858
|
};
|
|
38856
38859
|
parentCdpClient.on("Target.detachedFromTarget", onContextDestroyed);
|
|
@@ -40213,7 +40216,7 @@ var require_ActionDispatcher = __commonJS({
|
|
|
40213
40216
|
}
|
|
40214
40217
|
}
|
|
40215
40218
|
const promises = [
|
|
40216
|
-
new Promise((
|
|
40219
|
+
new Promise((resolve44) => setTimeout(resolve44, this.#tickDuration))
|
|
40217
40220
|
];
|
|
40218
40221
|
for (const option of options) {
|
|
40219
40222
|
promises.push(this.#dispatchAction(option));
|
|
@@ -40814,8 +40817,8 @@ var require_Mutex = __commonJS({
|
|
|
40814
40817
|
acquire() {
|
|
40815
40818
|
const state = { resolved: false };
|
|
40816
40819
|
if (this.#locked) {
|
|
40817
|
-
return new Promise((
|
|
40818
|
-
this.#acquirers.push(() =>
|
|
40820
|
+
return new Promise((resolve44) => {
|
|
40821
|
+
this.#acquirers.push(() => resolve44(this.#release.bind(this, state)));
|
|
40819
40822
|
});
|
|
40820
40823
|
}
|
|
40821
40824
|
this.#locked = true;
|
|
@@ -40826,12 +40829,12 @@ var require_Mutex = __commonJS({
|
|
|
40826
40829
|
throw new Error("Cannot release more than once.");
|
|
40827
40830
|
}
|
|
40828
40831
|
state.resolved = true;
|
|
40829
|
-
const
|
|
40830
|
-
if (!
|
|
40832
|
+
const resolve44 = this.#acquirers.shift();
|
|
40833
|
+
if (!resolve44) {
|
|
40831
40834
|
this.#locked = false;
|
|
40832
40835
|
return;
|
|
40833
40836
|
}
|
|
40834
|
-
|
|
40837
|
+
resolve44();
|
|
40835
40838
|
}
|
|
40836
40839
|
async run(action) {
|
|
40837
40840
|
const release = await this.acquire();
|
|
@@ -42013,8 +42016,8 @@ var require_ChannelProxy = __commonJS({
|
|
|
42013
42016
|
* in the queue.
|
|
42014
42017
|
*/
|
|
42015
42018
|
async getMessage() {
|
|
42016
|
-
const onMessage = queue.length > 0 ? Promise.resolve() : new Promise((
|
|
42017
|
-
queueNonEmptyResolver =
|
|
42019
|
+
const onMessage = queue.length > 0 ? Promise.resolve() : new Promise((resolve44) => {
|
|
42020
|
+
queueNonEmptyResolver = resolve44;
|
|
42018
42021
|
});
|
|
42019
42022
|
await onMessage;
|
|
42020
42023
|
return queue.shift();
|
|
@@ -42119,7 +42122,7 @@ var require_ChannelProxy = __commonJS({
|
|
|
42119
42122
|
functionDeclaration: String((id) => {
|
|
42120
42123
|
const w = window;
|
|
42121
42124
|
if (w[id] === void 0) {
|
|
42122
|
-
return new Promise((
|
|
42125
|
+
return new Promise((resolve44) => w[id] = resolve44);
|
|
42123
42126
|
}
|
|
42124
42127
|
const channelProxy = w[id];
|
|
42125
42128
|
delete w[id];
|
|
@@ -43620,8 +43623,8 @@ var require_Deferred = __commonJS({
|
|
|
43620
43623
|
return this.#result;
|
|
43621
43624
|
}
|
|
43622
43625
|
constructor() {
|
|
43623
|
-
this.#promise = new Promise((
|
|
43624
|
-
this.#resolve =
|
|
43626
|
+
this.#promise = new Promise((resolve44, reject) => {
|
|
43627
|
+
this.#resolve = resolve44;
|
|
43625
43628
|
this.#reject = reject;
|
|
43626
43629
|
});
|
|
43627
43630
|
this.#promise.catch((_error) => {
|
|
@@ -48465,11 +48468,11 @@ var require_BrowsingContextStorage = __commonJS({
|
|
|
48465
48468
|
if (this.#contexts.has(browsingContextId)) {
|
|
48466
48469
|
return Promise.resolve(this.getContext(browsingContextId));
|
|
48467
48470
|
}
|
|
48468
|
-
return new Promise((
|
|
48471
|
+
return new Promise((resolve44) => {
|
|
48469
48472
|
const listener = (event) => {
|
|
48470
48473
|
if (event.browsingContext.id === browsingContextId) {
|
|
48471
48474
|
this.#eventEmitter.off("added", listener);
|
|
48472
|
-
|
|
48475
|
+
resolve44(event.browsingContext);
|
|
48473
48476
|
}
|
|
48474
48477
|
};
|
|
48475
48478
|
this.#eventEmitter.on("added", listener);
|
|
@@ -52069,8 +52072,8 @@ var init_ExposedFunction = __esm({
|
|
|
52069
52072
|
const functionDeclaration = stringifyFunction(interpolateFunction((callback) => {
|
|
52070
52073
|
Object.assign(globalThis, {
|
|
52071
52074
|
[PLACEHOLDER("name")]: function(...args) {
|
|
52072
|
-
return new Promise((
|
|
52073
|
-
callback([
|
|
52075
|
+
return new Promise((resolve44, reject) => {
|
|
52076
|
+
callback([resolve44, reject, args]);
|
|
52074
52077
|
});
|
|
52075
52078
|
}
|
|
52076
52079
|
});
|
|
@@ -52158,8 +52161,8 @@ var init_ExposedFunction = __esm({
|
|
|
52158
52161
|
return;
|
|
52159
52162
|
}
|
|
52160
52163
|
try {
|
|
52161
|
-
await dataHandle.evaluate(([
|
|
52162
|
-
|
|
52164
|
+
await dataHandle.evaluate(([resolve44], result2) => {
|
|
52165
|
+
resolve44(result2);
|
|
52163
52166
|
}, result);
|
|
52164
52167
|
} catch (error) {
|
|
52165
52168
|
debugError(error);
|
|
@@ -60301,7 +60304,7 @@ var init_NodeWebSocketTransport = __esm({
|
|
|
60301
60304
|
init_version();
|
|
60302
60305
|
NodeWebSocketTransport = class _NodeWebSocketTransport {
|
|
60303
60306
|
static create(url, headers) {
|
|
60304
|
-
return new Promise((
|
|
60307
|
+
return new Promise((resolve44, reject) => {
|
|
60305
60308
|
const ws = new wrapper_default(url, [], {
|
|
60306
60309
|
followRedirects: true,
|
|
60307
60310
|
perMessageDeflate: false,
|
|
@@ -60314,7 +60317,7 @@ var init_NodeWebSocketTransport = __esm({
|
|
|
60314
60317
|
}
|
|
60315
60318
|
});
|
|
60316
60319
|
ws.addEventListener("open", () => {
|
|
60317
|
-
return
|
|
60320
|
+
return resolve44(new _NodeWebSocketTransport(ws));
|
|
60318
60321
|
});
|
|
60319
60322
|
ws.addEventListener("error", reject);
|
|
60320
60323
|
});
|
|
@@ -63375,8 +63378,8 @@ var require_helpers = __commonJS({
|
|
|
63375
63378
|
function req(url, opts = {}) {
|
|
63376
63379
|
const href = typeof url === "string" ? url : url.href;
|
|
63377
63380
|
const req2 = (href.startsWith("https:") ? https3 : http3).request(url, opts);
|
|
63378
|
-
const promise = new Promise((
|
|
63379
|
-
req2.once("response",
|
|
63381
|
+
const promise = new Promise((resolve44, reject) => {
|
|
63382
|
+
req2.once("response", resolve44).once("error", reject).end();
|
|
63380
63383
|
});
|
|
63381
63384
|
req2.then = promise.then.bind(promise);
|
|
63382
63385
|
return req2;
|
|
@@ -63753,7 +63756,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
63753
63756
|
var debug_1 = __importDefault3(require_src());
|
|
63754
63757
|
var debug7 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
|
|
63755
63758
|
function parseProxyResponse(socket) {
|
|
63756
|
-
return new Promise((
|
|
63759
|
+
return new Promise((resolve44, reject) => {
|
|
63757
63760
|
let buffersLength = 0;
|
|
63758
63761
|
const buffers = [];
|
|
63759
63762
|
function read() {
|
|
@@ -63819,7 +63822,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
63819
63822
|
}
|
|
63820
63823
|
debug7("got proxy server response: %o %o", firstLine, headers);
|
|
63821
63824
|
cleanup();
|
|
63822
|
-
|
|
63825
|
+
resolve44({
|
|
63823
63826
|
connect: {
|
|
63824
63827
|
statusCode,
|
|
63825
63828
|
statusText,
|
|
@@ -67077,11 +67080,11 @@ var require_socksclient = __commonJS({
|
|
|
67077
67080
|
"use strict";
|
|
67078
67081
|
var __awaiter4 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
67079
67082
|
function adopt(value) {
|
|
67080
|
-
return value instanceof P ? value : new P(function(
|
|
67081
|
-
|
|
67083
|
+
return value instanceof P ? value : new P(function(resolve44) {
|
|
67084
|
+
resolve44(value);
|
|
67082
67085
|
});
|
|
67083
67086
|
}
|
|
67084
|
-
return new (P || (P = Promise))(function(
|
|
67087
|
+
return new (P || (P = Promise))(function(resolve44, reject) {
|
|
67085
67088
|
function fulfilled(value) {
|
|
67086
67089
|
try {
|
|
67087
67090
|
step(generator.next(value));
|
|
@@ -67097,7 +67100,7 @@ var require_socksclient = __commonJS({
|
|
|
67097
67100
|
}
|
|
67098
67101
|
}
|
|
67099
67102
|
function step(result) {
|
|
67100
|
-
result.done ?
|
|
67103
|
+
result.done ? resolve44(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
67101
67104
|
}
|
|
67102
67105
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
67103
67106
|
});
|
|
@@ -67131,13 +67134,13 @@ var require_socksclient = __commonJS({
|
|
|
67131
67134
|
* @returns { Promise }
|
|
67132
67135
|
*/
|
|
67133
67136
|
static createConnection(options, callback) {
|
|
67134
|
-
return new Promise((
|
|
67137
|
+
return new Promise((resolve44, reject) => {
|
|
67135
67138
|
try {
|
|
67136
67139
|
(0, helpers_1.validateSocksClientOptions)(options, ["connect"]);
|
|
67137
67140
|
} catch (err) {
|
|
67138
67141
|
if (typeof callback === "function") {
|
|
67139
67142
|
callback(err);
|
|
67140
|
-
return
|
|
67143
|
+
return resolve44(err);
|
|
67141
67144
|
} else {
|
|
67142
67145
|
return reject(err);
|
|
67143
67146
|
}
|
|
@@ -67148,16 +67151,16 @@ var require_socksclient = __commonJS({
|
|
|
67148
67151
|
client.removeAllListeners();
|
|
67149
67152
|
if (typeof callback === "function") {
|
|
67150
67153
|
callback(null, info);
|
|
67151
|
-
|
|
67154
|
+
resolve44(info);
|
|
67152
67155
|
} else {
|
|
67153
|
-
|
|
67156
|
+
resolve44(info);
|
|
67154
67157
|
}
|
|
67155
67158
|
});
|
|
67156
67159
|
client.once("error", (err) => {
|
|
67157
67160
|
client.removeAllListeners();
|
|
67158
67161
|
if (typeof callback === "function") {
|
|
67159
67162
|
callback(err);
|
|
67160
|
-
|
|
67163
|
+
resolve44(err);
|
|
67161
67164
|
} else {
|
|
67162
67165
|
reject(err);
|
|
67163
67166
|
}
|
|
@@ -67174,13 +67177,13 @@ var require_socksclient = __commonJS({
|
|
|
67174
67177
|
* @returns { Promise }
|
|
67175
67178
|
*/
|
|
67176
67179
|
static createConnectionChain(options, callback) {
|
|
67177
|
-
return new Promise((
|
|
67180
|
+
return new Promise((resolve44, reject) => __awaiter4(this, void 0, void 0, function* () {
|
|
67178
67181
|
try {
|
|
67179
67182
|
(0, helpers_1.validateSocksClientChainOptions)(options);
|
|
67180
67183
|
} catch (err) {
|
|
67181
67184
|
if (typeof callback === "function") {
|
|
67182
67185
|
callback(err);
|
|
67183
|
-
return
|
|
67186
|
+
return resolve44(err);
|
|
67184
67187
|
} else {
|
|
67185
67188
|
return reject(err);
|
|
67186
67189
|
}
|
|
@@ -67206,14 +67209,14 @@ var require_socksclient = __commonJS({
|
|
|
67206
67209
|
}
|
|
67207
67210
|
if (typeof callback === "function") {
|
|
67208
67211
|
callback(null, { socket: sock });
|
|
67209
|
-
|
|
67212
|
+
resolve44({ socket: sock });
|
|
67210
67213
|
} else {
|
|
67211
|
-
|
|
67214
|
+
resolve44({ socket: sock });
|
|
67212
67215
|
}
|
|
67213
67216
|
} catch (err) {
|
|
67214
67217
|
if (typeof callback === "function") {
|
|
67215
67218
|
callback(err);
|
|
67216
|
-
|
|
67219
|
+
resolve44(err);
|
|
67217
67220
|
} else {
|
|
67218
67221
|
reject(err);
|
|
67219
67222
|
}
|
|
@@ -67897,12 +67900,12 @@ var require_dist4 = __commonJS({
|
|
|
67897
67900
|
let { host } = opts;
|
|
67898
67901
|
const { port, lookup: lookupFn = dns.lookup } = opts;
|
|
67899
67902
|
if (shouldLookup) {
|
|
67900
|
-
host = await new Promise((
|
|
67903
|
+
host = await new Promise((resolve44, reject) => {
|
|
67901
67904
|
lookupFn(host, {}, (err, res) => {
|
|
67902
67905
|
if (err) {
|
|
67903
67906
|
reject(err);
|
|
67904
67907
|
} else {
|
|
67905
|
-
|
|
67908
|
+
resolve44(res);
|
|
67906
67909
|
}
|
|
67907
67910
|
});
|
|
67908
67911
|
});
|
|
@@ -68562,7 +68565,7 @@ var require_netUtils = __commonJS({
|
|
|
68562
68565
|
return `${socket.remoteAddress}:${socket.remotePort}`;
|
|
68563
68566
|
}
|
|
68564
68567
|
function upgradeSocket(socket, options) {
|
|
68565
|
-
return new Promise((
|
|
68568
|
+
return new Promise((resolve44, reject) => {
|
|
68566
68569
|
const tlsOptions = Object.assign({}, options, {
|
|
68567
68570
|
socket
|
|
68568
68571
|
});
|
|
@@ -68572,7 +68575,7 @@ var require_netUtils = __commonJS({
|
|
|
68572
68575
|
reject(tlsSocket.authorizationError);
|
|
68573
68576
|
} else {
|
|
68574
68577
|
tlsSocket.removeAllListeners("error");
|
|
68575
|
-
|
|
68578
|
+
resolve44(tlsSocket);
|
|
68576
68579
|
}
|
|
68577
68580
|
}).once("error", (error) => {
|
|
68578
68581
|
reject(error);
|
|
@@ -69202,7 +69205,7 @@ var require_transfer = __commonJS({
|
|
|
69202
69205
|
};
|
|
69203
69206
|
}
|
|
69204
69207
|
function connectForPassiveTransfer(host, port, ftp) {
|
|
69205
|
-
return new Promise((
|
|
69208
|
+
return new Promise((resolve44, reject) => {
|
|
69206
69209
|
let socket = ftp._newSocket();
|
|
69207
69210
|
const handleConnErr = function(err) {
|
|
69208
69211
|
err.message = "Can't open data connection in passive mode: " + err.message;
|
|
@@ -69230,7 +69233,7 @@ var require_transfer = __commonJS({
|
|
|
69230
69233
|
socket.removeListener("error", handleConnErr);
|
|
69231
69234
|
socket.removeListener("timeout", handleTimeout);
|
|
69232
69235
|
ftp.dataSocket = socket;
|
|
69233
|
-
|
|
69236
|
+
resolve44();
|
|
69234
69237
|
});
|
|
69235
69238
|
});
|
|
69236
69239
|
}
|
|
@@ -81702,11 +81705,11 @@ function __metadata(metadataKey, metadataValue) {
|
|
|
81702
81705
|
}
|
|
81703
81706
|
function __awaiter2(thisArg, _arguments, P, generator) {
|
|
81704
81707
|
function adopt(value) {
|
|
81705
|
-
return value instanceof P ? value : new P(function(
|
|
81706
|
-
|
|
81708
|
+
return value instanceof P ? value : new P(function(resolve44) {
|
|
81709
|
+
resolve44(value);
|
|
81707
81710
|
});
|
|
81708
81711
|
}
|
|
81709
|
-
return new (P || (P = Promise))(function(
|
|
81712
|
+
return new (P || (P = Promise))(function(resolve44, reject) {
|
|
81710
81713
|
function fulfilled(value) {
|
|
81711
81714
|
try {
|
|
81712
81715
|
step(generator.next(value));
|
|
@@ -81722,7 +81725,7 @@ function __awaiter2(thisArg, _arguments, P, generator) {
|
|
|
81722
81725
|
}
|
|
81723
81726
|
}
|
|
81724
81727
|
function step(result) {
|
|
81725
|
-
result.done ?
|
|
81728
|
+
result.done ? resolve44(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
81726
81729
|
}
|
|
81727
81730
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
81728
81731
|
});
|
|
@@ -81913,14 +81916,14 @@ function __asyncValues2(o) {
|
|
|
81913
81916
|
}, i);
|
|
81914
81917
|
function verb(n) {
|
|
81915
81918
|
i[n] = o[n] && function(v) {
|
|
81916
|
-
return new Promise(function(
|
|
81917
|
-
v = o[n](v), settle(
|
|
81919
|
+
return new Promise(function(resolve44, reject) {
|
|
81920
|
+
v = o[n](v), settle(resolve44, reject, v.done, v.value);
|
|
81918
81921
|
});
|
|
81919
81922
|
};
|
|
81920
81923
|
}
|
|
81921
|
-
function settle(
|
|
81924
|
+
function settle(resolve44, reject, d, v) {
|
|
81922
81925
|
Promise.resolve(v).then(function(v2) {
|
|
81923
|
-
|
|
81926
|
+
resolve44({ value: v2, done: d });
|
|
81924
81927
|
}, reject);
|
|
81925
81928
|
}
|
|
81926
81929
|
}
|
|
@@ -85473,12 +85476,12 @@ var require_util4 = __commonJS({
|
|
|
85473
85476
|
exports.isGMT = exports.dnsLookup = void 0;
|
|
85474
85477
|
var dns_1 = __require("dns");
|
|
85475
85478
|
function dnsLookup(host, opts) {
|
|
85476
|
-
return new Promise((
|
|
85479
|
+
return new Promise((resolve44, reject) => {
|
|
85477
85480
|
(0, dns_1.lookup)(host, opts, (err, res) => {
|
|
85478
85481
|
if (err) {
|
|
85479
85482
|
reject(err);
|
|
85480
85483
|
} else {
|
|
85481
|
-
|
|
85484
|
+
resolve44(res);
|
|
85482
85485
|
}
|
|
85483
85486
|
});
|
|
85484
85487
|
});
|
|
@@ -86083,10 +86086,10 @@ var require_myIpAddress = __commonJS({
|
|
|
86083
86086
|
var ip_1 = require_ip();
|
|
86084
86087
|
var net_1 = __importDefault3(__require("net"));
|
|
86085
86088
|
async function myIpAddress() {
|
|
86086
|
-
return new Promise((
|
|
86089
|
+
return new Promise((resolve44, reject) => {
|
|
86087
86090
|
const socket = net_1.default.connect({ host: "8.8.8.8", port: 53 });
|
|
86088
86091
|
const onError = () => {
|
|
86089
|
-
|
|
86092
|
+
resolve44(ip_1.ip.address());
|
|
86090
86093
|
};
|
|
86091
86094
|
socket.once("error", onError);
|
|
86092
86095
|
socket.once("connect", () => {
|
|
@@ -86094,9 +86097,9 @@ var require_myIpAddress = __commonJS({
|
|
|
86094
86097
|
const addr = socket.address();
|
|
86095
86098
|
socket.destroy();
|
|
86096
86099
|
if (typeof addr === "string") {
|
|
86097
|
-
|
|
86100
|
+
resolve44(addr);
|
|
86098
86101
|
} else if (addr.address) {
|
|
86099
|
-
|
|
86102
|
+
resolve44(addr.address);
|
|
86100
86103
|
} else {
|
|
86101
86104
|
reject(new Error("Expected a `string`"));
|
|
86102
86105
|
}
|
|
@@ -86674,8 +86677,8 @@ var require_deferred_promise = __commonJS({
|
|
|
86674
86677
|
this.context = args.context;
|
|
86675
86678
|
this.owner = args.context.runtime;
|
|
86676
86679
|
this.handle = args.promiseHandle;
|
|
86677
|
-
this.settled = new Promise((
|
|
86678
|
-
this.onSettled =
|
|
86680
|
+
this.settled = new Promise((resolve44) => {
|
|
86681
|
+
this.onSettled = resolve44;
|
|
86679
86682
|
});
|
|
86680
86683
|
this.resolveHandle = args.resolveHandle;
|
|
86681
86684
|
this.rejectHandle = args.rejectHandle;
|
|
@@ -87196,13 +87199,13 @@ var require_context = __commonJS({
|
|
|
87196
87199
|
if (vmResolveResult.error) {
|
|
87197
87200
|
return Promise.resolve(vmResolveResult);
|
|
87198
87201
|
}
|
|
87199
|
-
return new Promise((
|
|
87202
|
+
return new Promise((resolve44) => {
|
|
87200
87203
|
lifetime_1.Scope.withScope((scope) => {
|
|
87201
87204
|
const resolveHandle = scope.manage(this.newFunction("resolve", (value) => {
|
|
87202
|
-
|
|
87205
|
+
resolve44({ value: value && value.dup() });
|
|
87203
87206
|
}));
|
|
87204
87207
|
const rejectHandle = scope.manage(this.newFunction("reject", (error) => {
|
|
87205
|
-
|
|
87208
|
+
resolve44({ error: error && error.dup() });
|
|
87206
87209
|
}));
|
|
87207
87210
|
const promiseHandle = scope.manage(vmResolveResult.value);
|
|
87208
87211
|
const promiseThenHandle = scope.manage(this.getProp(promiseHandle, "then"));
|
|
@@ -89577,13 +89580,13 @@ import * as http from "node:http";
|
|
|
89577
89580
|
import * as https from "node:https";
|
|
89578
89581
|
import { URL as URL2, urlToHttpOptions } from "node:url";
|
|
89579
89582
|
function headHttpRequest(url) {
|
|
89580
|
-
return new Promise((
|
|
89583
|
+
return new Promise((resolve44) => {
|
|
89581
89584
|
const request5 = httpRequest(url, "HEAD", (response) => {
|
|
89582
89585
|
response.resume();
|
|
89583
|
-
|
|
89586
|
+
resolve44(response.statusCode === 200);
|
|
89584
89587
|
}, false);
|
|
89585
89588
|
request5.on("error", () => {
|
|
89586
|
-
|
|
89589
|
+
resolve44(false);
|
|
89587
89590
|
});
|
|
89588
89591
|
});
|
|
89589
89592
|
}
|
|
@@ -89611,7 +89614,7 @@ function httpRequest(url, method, response, keepAlive = true) {
|
|
|
89611
89614
|
return request5;
|
|
89612
89615
|
}
|
|
89613
89616
|
function downloadFile(url, destinationPath, progressCallback) {
|
|
89614
|
-
return new Promise((
|
|
89617
|
+
return new Promise((resolve44, reject) => {
|
|
89615
89618
|
let downloadedBytes = 0;
|
|
89616
89619
|
let totalBytes = 0;
|
|
89617
89620
|
function onData(chunk) {
|
|
@@ -89627,7 +89630,7 @@ function downloadFile(url, destinationPath, progressCallback) {
|
|
|
89627
89630
|
}
|
|
89628
89631
|
const file = createWriteStream(destinationPath);
|
|
89629
89632
|
file.on("close", () => {
|
|
89630
|
-
return
|
|
89633
|
+
return resolve44();
|
|
89631
89634
|
});
|
|
89632
89635
|
file.on("error", (error) => {
|
|
89633
89636
|
return reject(error);
|
|
@@ -89652,7 +89655,7 @@ async function getJSON(url) {
|
|
|
89652
89655
|
}
|
|
89653
89656
|
}
|
|
89654
89657
|
function getText(url) {
|
|
89655
|
-
return new Promise((
|
|
89658
|
+
return new Promise((resolve44, reject) => {
|
|
89656
89659
|
const request5 = httpRequest(url, "GET", (response) => {
|
|
89657
89660
|
let data = "";
|
|
89658
89661
|
if (response.statusCode && response.statusCode >= 400) {
|
|
@@ -89663,7 +89666,7 @@ function getText(url) {
|
|
|
89663
89666
|
});
|
|
89664
89667
|
response.on("end", () => {
|
|
89665
89668
|
try {
|
|
89666
|
-
return
|
|
89669
|
+
return resolve44(String(data));
|
|
89667
89670
|
} catch {
|
|
89668
89671
|
return reject(new Error(`Failed to read text response from ${url}`));
|
|
89669
89672
|
}
|
|
@@ -91055,7 +91058,7 @@ var init_launch = __esm({
|
|
|
91055
91058
|
if (opts.onExit) {
|
|
91056
91059
|
this.#onExitHook = opts.onExit;
|
|
91057
91060
|
}
|
|
91058
|
-
this.#browserProcessExiting = new Promise((
|
|
91061
|
+
this.#browserProcessExiting = new Promise((resolve44, reject) => {
|
|
91059
91062
|
this.#browserProcess.once("exit", async () => {
|
|
91060
91063
|
debugLaunch(`Browser process ${this.#browserProcess.pid} onExit`);
|
|
91061
91064
|
this.#clearListeners();
|
|
@@ -91066,7 +91069,7 @@ var init_launch = __esm({
|
|
|
91066
91069
|
reject(err);
|
|
91067
91070
|
return;
|
|
91068
91071
|
}
|
|
91069
|
-
|
|
91072
|
+
resolve44();
|
|
91070
91073
|
});
|
|
91071
91074
|
});
|
|
91072
91075
|
}
|
|
@@ -91182,7 +91185,7 @@ Error cause: ${isErrorLike2(error) ? error.stack : error}`);
|
|
|
91182
91185
|
return [...this.#logs];
|
|
91183
91186
|
}
|
|
91184
91187
|
waitForLineOutput(regex2, timeout3 = 0) {
|
|
91185
|
-
return new Promise((
|
|
91188
|
+
return new Promise((resolve44, reject) => {
|
|
91186
91189
|
const onClose = (errorOrCode) => {
|
|
91187
91190
|
cleanup();
|
|
91188
91191
|
reject(new Error([
|
|
@@ -91218,7 +91221,7 @@ Error cause: ${isErrorLike2(error) ? error.stack : error}`);
|
|
|
91218
91221
|
return;
|
|
91219
91222
|
}
|
|
91220
91223
|
cleanup();
|
|
91221
|
-
|
|
91224
|
+
resolve44(match2[1]);
|
|
91222
91225
|
}
|
|
91223
91226
|
});
|
|
91224
91227
|
}
|
|
@@ -91687,7 +91690,7 @@ var require_get_stream = __commonJS({
|
|
|
91687
91690
|
};
|
|
91688
91691
|
const { maxBuffer } = options;
|
|
91689
91692
|
let stream;
|
|
91690
|
-
await new Promise((
|
|
91693
|
+
await new Promise((resolve44, reject) => {
|
|
91691
91694
|
const rejectPromise = (error) => {
|
|
91692
91695
|
if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
|
|
91693
91696
|
error.bufferedData = stream.getBufferedValue();
|
|
@@ -91699,7 +91702,7 @@ var require_get_stream = __commonJS({
|
|
|
91699
91702
|
rejectPromise(error);
|
|
91700
91703
|
return;
|
|
91701
91704
|
}
|
|
91702
|
-
|
|
91705
|
+
resolve44();
|
|
91703
91706
|
});
|
|
91704
91707
|
stream.on("data", () => {
|
|
91705
91708
|
if (stream.getBufferedLength() > maxBuffer) {
|
|
@@ -92988,7 +92991,7 @@ var require_extract_zip = __commonJS({
|
|
|
92988
92991
|
debug7("opening", this.zipPath, "with opts", this.opts);
|
|
92989
92992
|
this.zipfile = await openZip(this.zipPath, { lazyEntries: true });
|
|
92990
92993
|
this.canceled = false;
|
|
92991
|
-
return new Promise((
|
|
92994
|
+
return new Promise((resolve44, reject) => {
|
|
92992
92995
|
this.zipfile.on("error", (err) => {
|
|
92993
92996
|
this.canceled = true;
|
|
92994
92997
|
reject(err);
|
|
@@ -92997,7 +93000,7 @@ var require_extract_zip = __commonJS({
|
|
|
92997
93000
|
this.zipfile.on("close", () => {
|
|
92998
93001
|
if (!this.canceled) {
|
|
92999
93002
|
debug7("zip extraction complete");
|
|
93000
|
-
|
|
93003
|
+
resolve44();
|
|
93001
93004
|
}
|
|
93002
93005
|
});
|
|
93003
93006
|
this.zipfile.on("entry", async (entry) => {
|
|
@@ -94254,8 +94257,8 @@ var require_streamx = __commonJS({
|
|
|
94254
94257
|
return this;
|
|
94255
94258
|
},
|
|
94256
94259
|
next() {
|
|
94257
|
-
return new Promise(function(
|
|
94258
|
-
promiseResolve =
|
|
94260
|
+
return new Promise(function(resolve44, reject) {
|
|
94261
|
+
promiseResolve = resolve44;
|
|
94259
94262
|
promiseReject = reject;
|
|
94260
94263
|
const data = stream.read();
|
|
94261
94264
|
if (data !== null) ondata(data);
|
|
@@ -94285,11 +94288,11 @@ var require_streamx = __commonJS({
|
|
|
94285
94288
|
}
|
|
94286
94289
|
function destroy(err) {
|
|
94287
94290
|
stream.destroy(err);
|
|
94288
|
-
return new Promise((
|
|
94289
|
-
if (stream._duplexState & DESTROYED) return
|
|
94291
|
+
return new Promise((resolve44, reject) => {
|
|
94292
|
+
if (stream._duplexState & DESTROYED) return resolve44({ value: void 0, done: true });
|
|
94290
94293
|
stream.once("close", function() {
|
|
94291
94294
|
if (err) reject(err);
|
|
94292
|
-
else
|
|
94295
|
+
else resolve44({ value: void 0, done: true });
|
|
94293
94296
|
});
|
|
94294
94297
|
});
|
|
94295
94298
|
}
|
|
@@ -94333,8 +94336,8 @@ var require_streamx = __commonJS({
|
|
|
94333
94336
|
const writes = pending + (ws._duplexState & WRITE_WRITING ? 1 : 0);
|
|
94334
94337
|
if (writes === 0) return Promise.resolve(true);
|
|
94335
94338
|
if (state.drains === null) state.drains = [];
|
|
94336
|
-
return new Promise((
|
|
94337
|
-
state.drains.push({ writes, resolve:
|
|
94339
|
+
return new Promise((resolve44) => {
|
|
94340
|
+
state.drains.push({ writes, resolve: resolve44 });
|
|
94338
94341
|
});
|
|
94339
94342
|
}
|
|
94340
94343
|
write(data) {
|
|
@@ -94439,10 +94442,10 @@ var require_streamx = __commonJS({
|
|
|
94439
94442
|
cb(null);
|
|
94440
94443
|
}
|
|
94441
94444
|
function pipelinePromise(...streams) {
|
|
94442
|
-
return new Promise((
|
|
94445
|
+
return new Promise((resolve44, reject) => {
|
|
94443
94446
|
return pipeline(...streams, (err) => {
|
|
94444
94447
|
if (err) return reject(err);
|
|
94445
|
-
|
|
94448
|
+
resolve44();
|
|
94446
94449
|
});
|
|
94447
94450
|
});
|
|
94448
94451
|
}
|
|
@@ -95097,16 +95100,16 @@ var require_extract = __commonJS({
|
|
|
95097
95100
|
entryCallback = null;
|
|
95098
95101
|
cb(err);
|
|
95099
95102
|
}
|
|
95100
|
-
function onnext(
|
|
95103
|
+
function onnext(resolve44, reject) {
|
|
95101
95104
|
if (error) {
|
|
95102
95105
|
return reject(error);
|
|
95103
95106
|
}
|
|
95104
95107
|
if (entryStream) {
|
|
95105
|
-
|
|
95108
|
+
resolve44({ value: entryStream, done: false });
|
|
95106
95109
|
entryStream = null;
|
|
95107
95110
|
return;
|
|
95108
95111
|
}
|
|
95109
|
-
promiseResolve =
|
|
95112
|
+
promiseResolve = resolve44;
|
|
95110
95113
|
promiseReject = reject;
|
|
95111
95114
|
consumeCallback(null);
|
|
95112
95115
|
if (extract._finished && promiseResolve) {
|
|
@@ -95134,11 +95137,11 @@ var require_extract = __commonJS({
|
|
|
95134
95137
|
function destroy(err) {
|
|
95135
95138
|
extract.destroy(err);
|
|
95136
95139
|
consumeCallback(err);
|
|
95137
|
-
return new Promise((
|
|
95138
|
-
if (extract.destroyed) return
|
|
95140
|
+
return new Promise((resolve44, reject) => {
|
|
95141
|
+
if (extract.destroyed) return resolve44({ value: void 0, done: true });
|
|
95139
95142
|
extract.once("close", function() {
|
|
95140
95143
|
if (err) reject(err);
|
|
95141
|
-
else
|
|
95144
|
+
else resolve44({ value: void 0, done: true });
|
|
95142
95145
|
});
|
|
95143
95146
|
});
|
|
95144
95147
|
}
|
|
@@ -100114,12 +100117,12 @@ var init_yargs_factory = __esm({
|
|
|
100114
100117
|
async getCompletion(args, done) {
|
|
100115
100118
|
argsert("<array> [function]", [args, done], arguments.length);
|
|
100116
100119
|
if (!done) {
|
|
100117
|
-
return new Promise((
|
|
100120
|
+
return new Promise((resolve44, reject) => {
|
|
100118
100121
|
__classPrivateFieldGet2(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => {
|
|
100119
100122
|
if (err)
|
|
100120
100123
|
reject(err);
|
|
100121
100124
|
else
|
|
100122
|
-
|
|
100125
|
+
resolve44(completions);
|
|
100123
100126
|
});
|
|
100124
100127
|
});
|
|
100125
100128
|
} else {
|
|
@@ -102921,8 +102924,8 @@ var init_ScreenRecorder = __esm({
|
|
|
102921
102924
|
static {
|
|
102922
102925
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
102923
102926
|
__esDecorate23(this, _private_writeFrame_descriptor = { value: __setFunctionName6(async function(buffer) {
|
|
102924
|
-
const error = await new Promise((
|
|
102925
|
-
this.#process.stdin.write(buffer,
|
|
102927
|
+
const error = await new Promise((resolve44) => {
|
|
102928
|
+
this.#process.stdin.write(buffer, resolve44);
|
|
102926
102929
|
});
|
|
102927
102930
|
if (error) {
|
|
102928
102931
|
console.log(`ffmpeg failed to write: ${error.message}.`);
|
|
@@ -103112,8 +103115,8 @@ var init_ScreenRecorder = __esm({
|
|
|
103112
103115
|
const [buffer, timestamp] = await this.#lastFrame;
|
|
103113
103116
|
await Promise.all(Array(Math.max(1, Math.round(this.#fps * (performance.now() - timestamp) / 1e3))).fill(buffer).map(this.#writeFrame.bind(this)));
|
|
103114
103117
|
this.#process.stdin.end();
|
|
103115
|
-
await new Promise((
|
|
103116
|
-
this.#process.once("close",
|
|
103118
|
+
await new Promise((resolve44) => {
|
|
103119
|
+
this.#process.once("close", resolve44);
|
|
103117
103120
|
});
|
|
103118
103121
|
}
|
|
103119
103122
|
/**
|
|
@@ -115453,7 +115456,7 @@ ${lanes.join("\n")}
|
|
|
115453
115456
|
writeOutputIsTTY() {
|
|
115454
115457
|
return process.stdout.isTTY;
|
|
115455
115458
|
},
|
|
115456
|
-
readFile:
|
|
115459
|
+
readFile: readFile26,
|
|
115457
115460
|
writeFile: writeFile27,
|
|
115458
115461
|
watchFile: watchFile2,
|
|
115459
115462
|
watchDirectory,
|
|
@@ -115659,7 +115662,7 @@ ${lanes.join("\n")}
|
|
|
115659
115662
|
callback
|
|
115660
115663
|
);
|
|
115661
115664
|
}
|
|
115662
|
-
function
|
|
115665
|
+
function readFile26(fileName, _encoding) {
|
|
115663
115666
|
let buffer;
|
|
115664
115667
|
try {
|
|
115665
115668
|
buffer = _fs.readFileSync(fileName);
|
|
@@ -140286,8 +140289,8 @@ ${lanes.join("\n")}
|
|
|
140286
140289
|
return void 0;
|
|
140287
140290
|
}
|
|
140288
140291
|
function tryRenameExternalModule(factory2, moduleName, sourceFile) {
|
|
140289
|
-
const
|
|
140290
|
-
return
|
|
140292
|
+
const rename7 = sourceFile.renamedDependencies && sourceFile.renamedDependencies.get(moduleName.text);
|
|
140293
|
+
return rename7 ? factory2.createStringLiteral(rename7) : void 0;
|
|
140291
140294
|
}
|
|
140292
140295
|
function tryGetModuleNameFromFile(factory2, file, host, options) {
|
|
140293
140296
|
if (!file) {
|
|
@@ -152215,7 +152218,7 @@ ${lanes.join("\n")}
|
|
|
152215
152218
|
const possibleOption = getSpellingSuggestion(unknownOption, diagnostics.optionDeclarations, getOptionName);
|
|
152216
152219
|
return possibleOption ? createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownDidYouMeanDiagnostic, unknownOptionErrorText || unknownOption, possibleOption.name) : createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownOptionDiagnostic, unknownOptionErrorText || unknownOption);
|
|
152217
152220
|
}
|
|
152218
|
-
function parseCommandLineWorker(diagnostics, commandLine,
|
|
152221
|
+
function parseCommandLineWorker(diagnostics, commandLine, readFile26) {
|
|
152219
152222
|
const options = {};
|
|
152220
152223
|
let watchOptions;
|
|
152221
152224
|
const fileNames = [];
|
|
@@ -152263,7 +152266,7 @@ ${lanes.join("\n")}
|
|
|
152263
152266
|
}
|
|
152264
152267
|
}
|
|
152265
152268
|
function parseResponseFile(fileName) {
|
|
152266
|
-
const text = tryReadFile(fileName,
|
|
152269
|
+
const text = tryReadFile(fileName, readFile26 || ((fileName2) => sys.readFile(fileName2)));
|
|
152267
152270
|
if (!isString3(text)) {
|
|
152268
152271
|
errors.push(text);
|
|
152269
152272
|
return;
|
|
@@ -152366,8 +152369,8 @@ ${lanes.join("\n")}
|
|
|
152366
152369
|
unknownDidYouMeanDiagnostic: Diagnostics.Unknown_compiler_option_0_Did_you_mean_1,
|
|
152367
152370
|
optionTypeMismatchDiagnostic: Diagnostics.Compiler_option_0_expects_an_argument
|
|
152368
152371
|
};
|
|
152369
|
-
function parseCommandLine(commandLine,
|
|
152370
|
-
return parseCommandLineWorker(compilerOptionsDidYouMeanDiagnostics, commandLine,
|
|
152372
|
+
function parseCommandLine(commandLine, readFile26) {
|
|
152373
|
+
return parseCommandLineWorker(compilerOptionsDidYouMeanDiagnostics, commandLine, readFile26);
|
|
152371
152374
|
}
|
|
152372
152375
|
function getOptionFromName(optionName, allowShort) {
|
|
152373
152376
|
return getOptionDeclarationFromName(getOptionsNameMap, optionName, allowShort);
|
|
@@ -152449,8 +152452,8 @@ ${lanes.join("\n")}
|
|
|
152449
152452
|
watchOptionsToExtend
|
|
152450
152453
|
);
|
|
152451
152454
|
}
|
|
152452
|
-
function readConfigFile(fileName,
|
|
152453
|
-
const textOrDiagnostic = tryReadFile(fileName,
|
|
152455
|
+
function readConfigFile(fileName, readFile26) {
|
|
152456
|
+
const textOrDiagnostic = tryReadFile(fileName, readFile26);
|
|
152454
152457
|
return isString3(textOrDiagnostic) ? parseConfigFileTextToJson(fileName, textOrDiagnostic) : { config: {}, error: textOrDiagnostic };
|
|
152455
152458
|
}
|
|
152456
152459
|
function parseConfigFileTextToJson(fileName, jsonText) {
|
|
@@ -152465,14 +152468,14 @@ ${lanes.join("\n")}
|
|
|
152465
152468
|
error: jsonSourceFile.parseDiagnostics.length ? jsonSourceFile.parseDiagnostics[0] : void 0
|
|
152466
152469
|
};
|
|
152467
152470
|
}
|
|
152468
|
-
function readJsonConfigFile(fileName,
|
|
152469
|
-
const textOrDiagnostic = tryReadFile(fileName,
|
|
152471
|
+
function readJsonConfigFile(fileName, readFile26) {
|
|
152472
|
+
const textOrDiagnostic = tryReadFile(fileName, readFile26);
|
|
152470
152473
|
return isString3(textOrDiagnostic) ? parseJsonText(fileName, textOrDiagnostic) : { fileName, parseDiagnostics: [textOrDiagnostic] };
|
|
152471
152474
|
}
|
|
152472
|
-
function tryReadFile(fileName,
|
|
152475
|
+
function tryReadFile(fileName, readFile26) {
|
|
152473
152476
|
let text;
|
|
152474
152477
|
try {
|
|
152475
|
-
text =
|
|
152478
|
+
text = readFile26(fileName);
|
|
152476
152479
|
} catch (e) {
|
|
152477
152480
|
return createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message);
|
|
152478
152481
|
}
|
|
@@ -230569,7 +230572,7 @@ ${lanes.join("\n")}
|
|
|
230569
230572
|
}
|
|
230570
230573
|
}
|
|
230571
230574
|
function createImportCallExpressionAMD(arg, containsLexicalThis) {
|
|
230572
|
-
const
|
|
230575
|
+
const resolve44 = factory2.createUniqueName("resolve");
|
|
230573
230576
|
const reject = factory2.createUniqueName("reject");
|
|
230574
230577
|
const parameters = [
|
|
230575
230578
|
factory2.createParameterDeclaration(
|
|
@@ -230578,7 +230581,7 @@ ${lanes.join("\n")}
|
|
|
230578
230581
|
/*dotDotDotToken*/
|
|
230579
230582
|
void 0,
|
|
230580
230583
|
/*name*/
|
|
230581
|
-
|
|
230584
|
+
resolve44
|
|
230582
230585
|
),
|
|
230583
230586
|
factory2.createParameterDeclaration(
|
|
230584
230587
|
/*modifiers*/
|
|
@@ -230595,7 +230598,7 @@ ${lanes.join("\n")}
|
|
|
230595
230598
|
factory2.createIdentifier("require"),
|
|
230596
230599
|
/*typeArguments*/
|
|
230597
230600
|
void 0,
|
|
230598
|
-
[factory2.createArrayLiteralExpression([arg || factory2.createOmittedExpression()]),
|
|
230601
|
+
[factory2.createArrayLiteralExpression([arg || factory2.createOmittedExpression()]), resolve44, reject]
|
|
230599
230602
|
)
|
|
230600
230603
|
)
|
|
230601
230604
|
]);
|
|
@@ -242130,12 +242133,12 @@ ${lanes.join("\n")}
|
|
|
242130
242133
|
function createCompilerHost(options, setParentNodes) {
|
|
242131
242134
|
return createCompilerHostWorker(options, setParentNodes);
|
|
242132
242135
|
}
|
|
242133
|
-
function createGetSourceFile(
|
|
242136
|
+
function createGetSourceFile(readFile26, setParentNodes) {
|
|
242134
242137
|
return (fileName, languageVersionOrOptions, onError) => {
|
|
242135
242138
|
let text;
|
|
242136
242139
|
try {
|
|
242137
242140
|
mark("beforeIORead");
|
|
242138
|
-
text =
|
|
242141
|
+
text = readFile26(fileName);
|
|
242139
242142
|
mark("afterIORead");
|
|
242140
242143
|
measure("I/O Read", "beforeIORead", "afterIORead");
|
|
242141
242144
|
} catch (e) {
|
|
@@ -243039,7 +243042,7 @@ ${lanes.join("\n")}
|
|
|
243039
243042
|
getRedirectFromOutput,
|
|
243040
243043
|
forEachResolvedProjectReference: forEachResolvedProjectReference2
|
|
243041
243044
|
});
|
|
243042
|
-
const
|
|
243045
|
+
const readFile26 = host.readFile.bind(host);
|
|
243043
243046
|
(_e = tracing) == null ? void 0 : _e.push(tracing.Phase.Program, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram });
|
|
243044
243047
|
const shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options);
|
|
243045
243048
|
(_f = tracing) == null ? void 0 : _f.pop();
|
|
@@ -243265,7 +243268,7 @@ ${lanes.join("\n")}
|
|
|
243265
243268
|
shouldTransformImportCall,
|
|
243266
243269
|
emitBuildInfo,
|
|
243267
243270
|
fileExists,
|
|
243268
|
-
readFile:
|
|
243271
|
+
readFile: readFile26,
|
|
243269
243272
|
directoryExists,
|
|
243270
243273
|
getSymlinkCache,
|
|
243271
243274
|
realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host),
|
|
@@ -243405,9 +243408,9 @@ ${lanes.join("\n")}
|
|
|
243405
243408
|
/*ignoreCase*/
|
|
243406
243409
|
false
|
|
243407
243410
|
)) {
|
|
243408
|
-
const
|
|
243409
|
-
if (
|
|
243410
|
-
const name = removeSuffix(removePrefix(
|
|
243411
|
+
const basename19 = getBaseFileName(a.fileName);
|
|
243412
|
+
if (basename19 === "lib.d.ts" || basename19 === "lib.es6.d.ts") return 0;
|
|
243413
|
+
const name = removeSuffix(removePrefix(basename19, "lib."), ".d.ts");
|
|
243411
243414
|
const index = libs.indexOf(name);
|
|
243412
243415
|
if (index !== -1) return index + 1;
|
|
243413
243416
|
}
|
|
@@ -274408,19 +274411,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
274408
274411
|
}
|
|
274409
274412
|
function convertNamedExport(sourceFile, assignment, changes, exports2) {
|
|
274410
274413
|
const { text } = assignment.left.name;
|
|
274411
|
-
const
|
|
274412
|
-
if (
|
|
274414
|
+
const rename7 = exports2.get(text);
|
|
274415
|
+
if (rename7 !== void 0) {
|
|
274413
274416
|
const newNodes = [
|
|
274414
274417
|
makeConst(
|
|
274415
274418
|
/*modifiers*/
|
|
274416
274419
|
void 0,
|
|
274417
|
-
|
|
274420
|
+
rename7,
|
|
274418
274421
|
assignment.right
|
|
274419
274422
|
),
|
|
274420
274423
|
makeExportDeclaration([factory.createExportSpecifier(
|
|
274421
274424
|
/*isTypeOnly*/
|
|
274422
274425
|
false,
|
|
274423
|
-
|
|
274426
|
+
rename7,
|
|
274424
274427
|
text
|
|
274425
274428
|
)])
|
|
274426
274429
|
];
|
|
@@ -307153,8 +307156,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
307153
307156
|
}
|
|
307154
307157
|
};
|
|
307155
307158
|
for (const file of files) {
|
|
307156
|
-
const
|
|
307157
|
-
if (
|
|
307159
|
+
const basename19 = getBaseFileName(file);
|
|
307160
|
+
if (basename19 === "package.json" || basename19 === "bower.json") {
|
|
307158
307161
|
createProjectWatcher(
|
|
307159
307162
|
file,
|
|
307160
307163
|
"FileWatcher"
|
|
@@ -310826,8 +310829,8 @@ All files are: ${JSON.stringify(names)}`,
|
|
|
310826
310829
|
var _a7;
|
|
310827
310830
|
const fileOrDirectoryPath = removeIgnoredPath(this.toPath(fileOrDirectory));
|
|
310828
310831
|
if (!fileOrDirectoryPath) return;
|
|
310829
|
-
const
|
|
310830
|
-
if (((_a7 = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a7.size) && (
|
|
310832
|
+
const basename19 = getBaseFileName(fileOrDirectoryPath);
|
|
310833
|
+
if (((_a7 = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a7.size) && (basename19 === "package.json" || basename19 === "node_modules")) {
|
|
310831
310834
|
result.affectedModuleSpecifierCacheProjects.forEach((project) => {
|
|
310832
310835
|
var _a23;
|
|
310833
310836
|
(_a23 = project.getModuleSpecifierCache()) == null ? void 0 : _a23.clear();
|
|
@@ -317313,8 +317316,8 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
317313
317316
|
installPackage(options) {
|
|
317314
317317
|
this.packageInstallId++;
|
|
317315
317318
|
const request5 = { kind: "installPackage", ...options, id: this.packageInstallId };
|
|
317316
|
-
const promise = new Promise((
|
|
317317
|
-
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve:
|
|
317319
|
+
const promise = new Promise((resolve44, reject) => {
|
|
317320
|
+
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve: resolve44, reject });
|
|
317318
317321
|
});
|
|
317319
317322
|
this.installer.send(request5);
|
|
317320
317323
|
return promise;
|
|
@@ -429342,7 +429345,7 @@ var init_GeminiProvider = __esm({
|
|
|
429342
429345
|
* Sleep helper
|
|
429343
429346
|
*/
|
|
429344
429347
|
sleep(ms) {
|
|
429345
|
-
return new Promise((
|
|
429348
|
+
return new Promise((resolve44) => setTimeout(resolve44, ms));
|
|
429346
429349
|
}
|
|
429347
429350
|
/**
|
|
429348
429351
|
* Extend a previously generated Veo video
|
|
@@ -433429,7 +433432,7 @@ var init_RunwayProvider = __esm({
|
|
|
433429
433432
|
* Sleep helper
|
|
433430
433433
|
*/
|
|
433431
433434
|
sleep(ms) {
|
|
433432
|
-
return new Promise((
|
|
433435
|
+
return new Promise((resolve44) => setTimeout(resolve44, ms));
|
|
433433
433436
|
}
|
|
433434
433437
|
};
|
|
433435
433438
|
RunwayProvider.API_VERSION = "2024-11-06";
|
|
@@ -433861,7 +433864,7 @@ var init_KlingProvider = __esm({
|
|
|
433861
433864
|
* Sleep helper
|
|
433862
433865
|
*/
|
|
433863
433866
|
sleep(ms) {
|
|
433864
|
-
return new Promise((
|
|
433867
|
+
return new Promise((resolve44) => setTimeout(resolve44, ms));
|
|
433865
433868
|
}
|
|
433866
433869
|
};
|
|
433867
433870
|
klingProvider = new KlingProvider();
|
|
@@ -434170,7 +434173,7 @@ var init_GrokProvider = __esm({
|
|
|
434170
434173
|
}
|
|
434171
434174
|
}
|
|
434172
434175
|
sleep(ms) {
|
|
434173
|
-
return new Promise((
|
|
434176
|
+
return new Promise((resolve44) => setTimeout(resolve44, ms));
|
|
434174
434177
|
}
|
|
434175
434178
|
};
|
|
434176
434179
|
grokProvider = new GrokProvider();
|
|
@@ -434443,7 +434446,7 @@ var init_ReplicateProvider = __esm({
|
|
|
434443
434446
|
* Sleep helper
|
|
434444
434447
|
*/
|
|
434445
434448
|
sleep(ms) {
|
|
434446
|
-
return new Promise((
|
|
434449
|
+
return new Promise((resolve44) => setTimeout(resolve44, ms));
|
|
434447
434450
|
}
|
|
434448
434451
|
/**
|
|
434449
434452
|
* Generate music from text prompt using MusicGen
|
|
@@ -442683,7 +442686,7 @@ async function prompt(question, hidden = false) {
|
|
|
442683
442686
|
input: process.stdin,
|
|
442684
442687
|
output: process.stdout
|
|
442685
442688
|
});
|
|
442686
|
-
return new Promise((
|
|
442689
|
+
return new Promise((resolve44) => {
|
|
442687
442690
|
if (hidden && process.stdin.isTTY) {
|
|
442688
442691
|
process.stdout.write(question);
|
|
442689
442692
|
let input3 = "";
|
|
@@ -442697,7 +442700,7 @@ async function prompt(question, hidden = false) {
|
|
|
442697
442700
|
process.stdin.removeListener("data", onData);
|
|
442698
442701
|
process.stdout.write("\n");
|
|
442699
442702
|
rl.close();
|
|
442700
|
-
|
|
442703
|
+
resolve44(input3);
|
|
442701
442704
|
} else if (char === "") {
|
|
442702
442705
|
process.exit(1);
|
|
442703
442706
|
} else if (char === "\x7F" || char === "\b") {
|
|
@@ -442712,7 +442715,7 @@ async function prompt(question, hidden = false) {
|
|
|
442712
442715
|
} else {
|
|
442713
442716
|
rl.question(question, (answer) => {
|
|
442714
442717
|
rl.close();
|
|
442715
|
-
|
|
442718
|
+
resolve44(answer);
|
|
442716
442719
|
});
|
|
442717
442720
|
}
|
|
442718
442721
|
});
|
|
@@ -443100,8 +443103,8 @@ registerRoot(Root);
|
|
|
443100
443103
|
await mkdir6(REMOTION_CACHE_DIR, { recursive: true });
|
|
443101
443104
|
await writeFile7(join18(REMOTION_CACHE_DIR, "package.json"), packageJsonStr);
|
|
443102
443105
|
if (existsSync18(join18(dir, "node_modules"))) {
|
|
443103
|
-
const { rename:
|
|
443104
|
-
await
|
|
443106
|
+
const { rename: rename7, symlink } = await import("node:fs/promises");
|
|
443107
|
+
await rename7(join18(dir, "node_modules"), cachedModules).catch(() => {
|
|
443105
443108
|
});
|
|
443106
443109
|
await symlink(cachedModules, join18(dir, "node_modules"), "dir").catch(() => {
|
|
443107
443110
|
});
|
|
@@ -447018,7 +447021,7 @@ import { readFile as readFile12, writeFile as writeFile13, mkdir as mkdir11, unl
|
|
|
447018
447021
|
import { resolve as resolve24, basename as basename9, dirname as dirname15, extname as extname7 } from "node:path";
|
|
447019
447022
|
import { existsSync as existsSync26 } from "node:fs";
|
|
447020
447023
|
function sleep(ms) {
|
|
447021
|
-
return new Promise((
|
|
447024
|
+
return new Promise((resolve44) => setTimeout(resolve44, ms));
|
|
447022
447025
|
}
|
|
447023
447026
|
async function uploadToImgbb(imageBuffer, apiKey) {
|
|
447024
447027
|
try {
|
|
@@ -450307,10 +450310,10 @@ async function prompt2(question) {
|
|
|
450307
450310
|
input: input3,
|
|
450308
450311
|
output: process.stdout
|
|
450309
450312
|
});
|
|
450310
|
-
return new Promise((
|
|
450313
|
+
return new Promise((resolve44) => {
|
|
450311
450314
|
rl.question(question, (answer) => {
|
|
450312
450315
|
rl.close();
|
|
450313
|
-
|
|
450316
|
+
resolve44(answer);
|
|
450314
450317
|
});
|
|
450315
450318
|
});
|
|
450316
450319
|
}
|
|
@@ -451593,8 +451596,8 @@ Examples:
|
|
|
451593
451596
|
"-vn",
|
|
451594
451597
|
tempPath
|
|
451595
451598
|
]);
|
|
451596
|
-
const { rename:
|
|
451597
|
-
await
|
|
451599
|
+
const { rename: rename7 } = await import("node:fs/promises");
|
|
451600
|
+
await rename7(tempPath, outputPath);
|
|
451598
451601
|
fitSpinner.succeed(source_default.green(`Adjusted to fit ${options.fitDuration}s (${tempo.toFixed(3)}x speed)`));
|
|
451599
451602
|
} catch (err) {
|
|
451600
451603
|
fitSpinner.fail(source_default.yellow("Tempo adjustment failed \u2014 keeping original audio"));
|
|
@@ -453336,8 +453339,8 @@ async function executeSpeedRamp(options) {
|
|
|
453336
453339
|
const audioBuffer = await readFile18(tempAudio);
|
|
453337
453340
|
const transcript = await whisper.transcribe(new Blob([audioBuffer]), language);
|
|
453338
453341
|
try {
|
|
453339
|
-
const { unlink:
|
|
453340
|
-
await
|
|
453342
|
+
const { unlink: unlink6 } = await import("node:fs/promises");
|
|
453343
|
+
await unlink6(tempAudio);
|
|
453341
453344
|
} catch {
|
|
453342
453345
|
}
|
|
453343
453346
|
if (!transcript.segments || transcript.segments.length === 0) {
|
|
@@ -453721,8 +453724,8 @@ Run 'vibe schema edit.<command>' for structured parameter info.
|
|
|
453721
453724
|
maxSpeed: parseFloat(options.maxSpeed)
|
|
453722
453725
|
});
|
|
453723
453726
|
try {
|
|
453724
|
-
const { unlink:
|
|
453725
|
-
await
|
|
453727
|
+
const { unlink: unlink6 } = await import("node:fs/promises");
|
|
453728
|
+
await unlink6(tempAudio);
|
|
453726
453729
|
} catch {
|
|
453727
453730
|
}
|
|
453728
453731
|
spinner2.succeed(source_default.green(`Found ${speedResult.keyframes.length} speed keyframes`));
|
|
@@ -454793,8 +454796,8 @@ ${segmentTexts}`,
|
|
|
454793
454796
|
console.log();
|
|
454794
454797
|
if (isVideo && audioPath !== absPath) {
|
|
454795
454798
|
try {
|
|
454796
|
-
const { unlink:
|
|
454797
|
-
await
|
|
454799
|
+
const { unlink: unlink6 } = await import("node:fs/promises");
|
|
454800
|
+
await unlink6(audioPath);
|
|
454798
454801
|
} catch {
|
|
454799
454802
|
}
|
|
454800
454803
|
}
|
|
@@ -455032,8 +455035,8 @@ ${segmentTexts}`,
|
|
|
455032
455035
|
await writeFile20(finalOutputPath, combinedBuffer);
|
|
455033
455036
|
if (isVideo && audioPath !== absPath) {
|
|
455034
455037
|
try {
|
|
455035
|
-
const { unlink:
|
|
455036
|
-
await
|
|
455038
|
+
const { unlink: unlink6 } = await import("node:fs/promises");
|
|
455039
|
+
await unlink6(audioPath);
|
|
455037
455040
|
} catch {
|
|
455038
455041
|
}
|
|
455039
455042
|
}
|
|
@@ -456542,7 +456545,7 @@ function buildFFmpegArgs(clips, sources, presetSettings, outputPath, options, so
|
|
|
456542
456545
|
return args;
|
|
456543
456546
|
}
|
|
456544
456547
|
function runFFmpegProcess(ffmpegPath, args, onProgress) {
|
|
456545
|
-
return new Promise((
|
|
456548
|
+
return new Promise((resolve44, reject) => {
|
|
456546
456549
|
const ffmpeg = spawn9(ffmpegPath, args, {
|
|
456547
456550
|
stdio: ["pipe", "pipe", "pipe"]
|
|
456548
456551
|
});
|
|
@@ -456566,7 +456569,7 @@ function runFFmpegProcess(ffmpegPath, args, onProgress) {
|
|
|
456566
456569
|
});
|
|
456567
456570
|
ffmpeg.on("close", (code) => {
|
|
456568
456571
|
if (code === 0) {
|
|
456569
|
-
|
|
456572
|
+
resolve44();
|
|
456570
456573
|
} else {
|
|
456571
456574
|
const errorMatch = stderr.match(/Error.*$/m);
|
|
456572
456575
|
const errorMsg = errorMatch ? errorMatch[0] : `FFmpeg exited with code ${code}`;
|
|
@@ -456702,17 +456705,17 @@ function getPresetSettings(preset, aspectRatio) {
|
|
|
456702
456705
|
}
|
|
456703
456706
|
async function runHyperframesExport(projectPath, options, spinner2) {
|
|
456704
456707
|
spinner2.text = "Loading project...";
|
|
456705
|
-
const { readFile:
|
|
456706
|
-
const { resolve:
|
|
456708
|
+
const { readFile: readFile26 } = await import("node:fs/promises");
|
|
456709
|
+
const { resolve: resolve44, basename: basename19 } = await import("node:path");
|
|
456707
456710
|
const { Project: Project2 } = await Promise.resolve().then(() => (init_engine(), engine_exports));
|
|
456708
456711
|
const { createHyperframesBackend: createHyperframesBackend2 } = await Promise.resolve().then(() => (init_hyperframes(), hyperframes_exports));
|
|
456709
456712
|
const { exitWithError: exitWithError2, generalError: generalError2, outputResult: outputResult2 } = await Promise.resolve().then(() => (init_output(), output_exports));
|
|
456710
456713
|
const chalk2 = (await Promise.resolve().then(() => (init_source(), source_exports))).default;
|
|
456711
|
-
const filePath =
|
|
456712
|
-
const content = await
|
|
456714
|
+
const filePath = resolve44(process.cwd(), projectPath);
|
|
456715
|
+
const content = await readFile26(filePath, "utf-8");
|
|
456713
456716
|
const project = Project2.fromJSON(JSON.parse(content));
|
|
456714
456717
|
const state = project.getState();
|
|
456715
|
-
const outputPath = options.output ?
|
|
456718
|
+
const outputPath = options.output ? resolve44(process.cwd(), options.output) : resolve44(process.cwd(), `${basename19(projectPath, ".vibe.json")}.${options.format ?? "mp4"}`);
|
|
456716
456719
|
const quality = ["draft", "standard", "high"].includes(options.preset ?? "") ? options.preset : "standard";
|
|
456717
456720
|
const backend = createHyperframesBackend2();
|
|
456718
456721
|
spinner2.text = "Rendering with Hyperframes...";
|
|
@@ -458321,8 +458324,8 @@ async function handleAiPipelineToolCall(name, args) {
|
|
|
458321
458324
|
} finally {
|
|
458322
458325
|
if (tempPath) {
|
|
458323
458326
|
try {
|
|
458324
|
-
const { unlink:
|
|
458325
|
-
await
|
|
458327
|
+
const { unlink: unlink6 } = await import("node:fs/promises");
|
|
458328
|
+
await unlink6(tempPath);
|
|
458326
458329
|
} catch {
|
|
458327
458330
|
}
|
|
458328
458331
|
}
|
|
@@ -459509,16 +459512,223 @@ async function handleAiEditAdvancedToolCall(name, args) {
|
|
|
459509
459512
|
// src/tools/scene.ts
|
|
459510
459513
|
init_scene_project();
|
|
459511
459514
|
init_scene_lint();
|
|
459512
|
-
import { resolve as
|
|
459515
|
+
import { resolve as resolve41 } from "node:path";
|
|
459513
459516
|
|
|
459514
459517
|
// ../cli/src/commands/_shared/scene-render.ts
|
|
459515
459518
|
var import_yaml5 = __toESM(require_dist14(), 1);
|
|
459516
459519
|
init_dist();
|
|
459517
459520
|
init_chrome();
|
|
459518
459521
|
init_scene_lint();
|
|
459519
|
-
import { mkdir as mkdir18, stat as stat3 } from "node:fs/promises";
|
|
459522
|
+
import { mkdir as mkdir18, readFile as readFile23, stat as stat3 } from "node:fs/promises";
|
|
459520
459523
|
import { existsSync as existsSync36 } from "node:fs";
|
|
459521
|
-
import { resolve as
|
|
459524
|
+
import { resolve as resolve39, relative as relative6, dirname as dirname24, basename as basename17 } from "node:path";
|
|
459525
|
+
|
|
459526
|
+
// ../cli/src/commands/_shared/scene-audio-scan.ts
|
|
459527
|
+
import { readFile as readFile22 } from "node:fs/promises";
|
|
459528
|
+
import { resolve as resolve37 } from "node:path";
|
|
459529
|
+
function parseRootClips(rootHtml) {
|
|
459530
|
+
const clips = [];
|
|
459531
|
+
const clipRegex = /<div\b[^>]*class="clip"[^>]*>/gi;
|
|
459532
|
+
let match2;
|
|
459533
|
+
while ((match2 = clipRegex.exec(rootHtml)) !== null) {
|
|
459534
|
+
const tag = match2[0];
|
|
459535
|
+
const compositionId = pickAttr(tag, "data-composition-id");
|
|
459536
|
+
const compositionSrc = pickAttr(tag, "data-composition-src");
|
|
459537
|
+
const start = pickNumberAttr(tag, "data-start");
|
|
459538
|
+
const duration = pickNumberAttr(tag, "data-duration");
|
|
459539
|
+
const trackIndex = pickNumberAttr(tag, "data-track-index") ?? 1;
|
|
459540
|
+
if (!compositionId || !compositionSrc || start === null || duration === null) {
|
|
459541
|
+
continue;
|
|
459542
|
+
}
|
|
459543
|
+
clips.push({ compositionId, compositionSrc, start, duration, trackIndex });
|
|
459544
|
+
}
|
|
459545
|
+
return clips;
|
|
459546
|
+
}
|
|
459547
|
+
function parseSceneAudios(compositionHtml) {
|
|
459548
|
+
const out = [];
|
|
459549
|
+
const audioRegex = /<audio\b([^>]*)>/gi;
|
|
459550
|
+
let match2;
|
|
459551
|
+
while ((match2 = audioRegex.exec(compositionHtml)) !== null) {
|
|
459552
|
+
const attrs = match2[1];
|
|
459553
|
+
const src = pickAttr(attrs, "src");
|
|
459554
|
+
if (!src) continue;
|
|
459555
|
+
const localStart = pickNumberAttr(attrs, "data-start") ?? 0;
|
|
459556
|
+
const durationRaw = pickAttr(attrs, "data-duration");
|
|
459557
|
+
const durationHint = !durationRaw || durationRaw === "auto" ? "auto" : Number(durationRaw);
|
|
459558
|
+
const volume = pickNumberAttr(attrs, "data-volume") ?? 1;
|
|
459559
|
+
const trackIndex = pickNumberAttr(attrs, "data-track-index") ?? 2;
|
|
459560
|
+
out.push({ srcRel: src, localStart, durationHint, volume, trackIndex });
|
|
459561
|
+
}
|
|
459562
|
+
return out;
|
|
459563
|
+
}
|
|
459564
|
+
function makeFsCompositionReader(projectDir) {
|
|
459565
|
+
return async (compositionSrcRel) => {
|
|
459566
|
+
const abs = resolve37(projectDir, compositionSrcRel);
|
|
459567
|
+
try {
|
|
459568
|
+
return await readFile22(abs, "utf-8");
|
|
459569
|
+
} catch {
|
|
459570
|
+
return null;
|
|
459571
|
+
}
|
|
459572
|
+
};
|
|
459573
|
+
}
|
|
459574
|
+
async function scanSceneAudio(opts) {
|
|
459575
|
+
const reader = opts.readComposition ?? makeFsCompositionReader(opts.projectDir);
|
|
459576
|
+
const clips = parseRootClips(opts.rootHtml);
|
|
459577
|
+
const out = [];
|
|
459578
|
+
for (const clip of clips) {
|
|
459579
|
+
const html = await reader(clip.compositionSrc);
|
|
459580
|
+
if (!html) continue;
|
|
459581
|
+
const audios = parseSceneAudios(html);
|
|
459582
|
+
for (const audio of audios) {
|
|
459583
|
+
out.push({
|
|
459584
|
+
srcRel: audio.srcRel,
|
|
459585
|
+
srcAbs: resolve37(opts.projectDir, audio.srcRel),
|
|
459586
|
+
absoluteStart: clip.start + audio.localStart,
|
|
459587
|
+
durationHint: audio.durationHint,
|
|
459588
|
+
clipDurationCap: clip.duration - audio.localStart,
|
|
459589
|
+
volume: audio.volume,
|
|
459590
|
+
trackIndex: audio.trackIndex,
|
|
459591
|
+
compositionSrc: clip.compositionSrc
|
|
459592
|
+
});
|
|
459593
|
+
}
|
|
459594
|
+
}
|
|
459595
|
+
out.sort((a, b) => a.absoluteStart - b.absoluteStart);
|
|
459596
|
+
return out;
|
|
459597
|
+
}
|
|
459598
|
+
function pickAttr(tag, name) {
|
|
459599
|
+
const re = new RegExp(`\\b${escapeRegex3(name)}\\s*=\\s*("([^"]*)"|'([^']*)')`);
|
|
459600
|
+
const m = tag.match(re);
|
|
459601
|
+
if (!m) return null;
|
|
459602
|
+
return m[2] ?? m[3] ?? null;
|
|
459603
|
+
}
|
|
459604
|
+
function pickNumberAttr(tag, name) {
|
|
459605
|
+
const raw2 = pickAttr(tag, name);
|
|
459606
|
+
if (raw2 === null) return null;
|
|
459607
|
+
const n = Number(raw2);
|
|
459608
|
+
return Number.isFinite(n) ? n : null;
|
|
459609
|
+
}
|
|
459610
|
+
function escapeRegex3(s) {
|
|
459611
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
459612
|
+
}
|
|
459613
|
+
|
|
459614
|
+
// ../cli/src/commands/_shared/scene-audio-mux.ts
|
|
459615
|
+
init_exec_safe();
|
|
459616
|
+
import { rename as rename6, unlink as unlink5 } from "node:fs/promises";
|
|
459617
|
+
import { resolve as resolve38, dirname as dirname23, extname as extname12, basename as basename16 } from "node:path";
|
|
459618
|
+
function buildAudioMuxFilter(audios) {
|
|
459619
|
+
if (audios.length === 0) return null;
|
|
459620
|
+
const labels = [];
|
|
459621
|
+
const stages = [];
|
|
459622
|
+
audios.forEach((a, i) => {
|
|
459623
|
+
const inputIdx = i + 1;
|
|
459624
|
+
const delayMs = Math.max(0, Math.round(a.absoluteStart * 1e3));
|
|
459625
|
+
const volume = Number.isFinite(a.volume) ? a.volume : 1;
|
|
459626
|
+
const trimSec = Math.max(0, a.clipDurationCap);
|
|
459627
|
+
const label = `a${i}`;
|
|
459628
|
+
const stage = [
|
|
459629
|
+
`[${inputIdx}:a]`,
|
|
459630
|
+
`atrim=duration=${trimSec.toFixed(3)},`,
|
|
459631
|
+
`asetpts=PTS-STARTPTS,`,
|
|
459632
|
+
`adelay=${delayMs}:all=1,`,
|
|
459633
|
+
`volume=${volume}`,
|
|
459634
|
+
`[${label}]`
|
|
459635
|
+
].join("");
|
|
459636
|
+
stages.push(stage);
|
|
459637
|
+
labels.push(`[${label}]`);
|
|
459638
|
+
});
|
|
459639
|
+
if (audios.length === 1) {
|
|
459640
|
+
return {
|
|
459641
|
+
filterComplex: stages.join(";"),
|
|
459642
|
+
outLabel: labels[0],
|
|
459643
|
+
inputCount: 1
|
|
459644
|
+
};
|
|
459645
|
+
}
|
|
459646
|
+
const mix = `${labels.join("")}amix=inputs=${audios.length}:dropout_transition=0:normalize=0[mixed]`;
|
|
459647
|
+
return {
|
|
459648
|
+
filterComplex: `${stages.join(";")};${mix}`,
|
|
459649
|
+
outLabel: "[mixed]",
|
|
459650
|
+
inputCount: audios.length
|
|
459651
|
+
};
|
|
459652
|
+
}
|
|
459653
|
+
function audioCodecForFormat(format4) {
|
|
459654
|
+
if (format4 === "webm") return "libopus";
|
|
459655
|
+
if (format4 === "mov") return "pcm_s16le";
|
|
459656
|
+
return "aac";
|
|
459657
|
+
}
|
|
459658
|
+
async function muxAudioIntoVideo(opts) {
|
|
459659
|
+
if (opts.audios.length === 0) {
|
|
459660
|
+
return { success: true, outputPath: opts.videoPath, audioCount: 0 };
|
|
459661
|
+
}
|
|
459662
|
+
if (!commandExists("ffmpeg")) {
|
|
459663
|
+
return {
|
|
459664
|
+
success: false,
|
|
459665
|
+
outputPath: opts.videoPath,
|
|
459666
|
+
audioCount: opts.audios.length,
|
|
459667
|
+
error: "ffmpeg not found in PATH \u2014 install via `brew install ffmpeg` (mac) or your package manager"
|
|
459668
|
+
};
|
|
459669
|
+
}
|
|
459670
|
+
const filter4 = buildAudioMuxFilter(opts.audios);
|
|
459671
|
+
if (!filter4) {
|
|
459672
|
+
return { success: true, outputPath: opts.videoPath, audioCount: 0 };
|
|
459673
|
+
}
|
|
459674
|
+
const ext = extname12(opts.videoPath) || `.${opts.format}`;
|
|
459675
|
+
const tmpPath = resolve38(
|
|
459676
|
+
dirname23(opts.videoPath),
|
|
459677
|
+
`.${basename16(opts.videoPath, ext)}.muxing${ext}`
|
|
459678
|
+
);
|
|
459679
|
+
const args = ["-y", "-loglevel", "error", "-i", opts.videoPath];
|
|
459680
|
+
for (const a of opts.audios) {
|
|
459681
|
+
args.push("-i", a.srcAbs);
|
|
459682
|
+
}
|
|
459683
|
+
args.push(
|
|
459684
|
+
"-filter_complex",
|
|
459685
|
+
filter4.filterComplex,
|
|
459686
|
+
"-map",
|
|
459687
|
+
"0:v",
|
|
459688
|
+
"-map",
|
|
459689
|
+
filter4.outLabel,
|
|
459690
|
+
"-c:v",
|
|
459691
|
+
"copy",
|
|
459692
|
+
"-c:a",
|
|
459693
|
+
audioCodecForFormat(opts.format),
|
|
459694
|
+
// Cap on the video duration so audio that overruns the producer's render
|
|
459695
|
+
// (e.g. a long Kokoro wav on a short scene) doesn't extend the output.
|
|
459696
|
+
// Video drives the timeline because the producer already counted frames.
|
|
459697
|
+
"-t",
|
|
459698
|
+
opts.totalDuration && opts.totalDuration > 0 ? opts.totalDuration.toFixed(3) : opts.videoDuration?.toFixed(3) ?? ""
|
|
459699
|
+
);
|
|
459700
|
+
if (args[args.length - 1] === "") {
|
|
459701
|
+
args.pop();
|
|
459702
|
+
args.pop();
|
|
459703
|
+
}
|
|
459704
|
+
args.push("-movflags", "+faststart", tmpPath);
|
|
459705
|
+
try {
|
|
459706
|
+
const { stderr } = await execSafe("ffmpeg", args);
|
|
459707
|
+
if (stderr && opts.onProgress) {
|
|
459708
|
+
stderr.split(/\r?\n/).forEach((line) => opts.onProgress?.(line));
|
|
459709
|
+
}
|
|
459710
|
+
} catch (err) {
|
|
459711
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
459712
|
+
try {
|
|
459713
|
+
await unlink5(tmpPath);
|
|
459714
|
+
} catch {
|
|
459715
|
+
}
|
|
459716
|
+
return {
|
|
459717
|
+
success: false,
|
|
459718
|
+
outputPath: opts.videoPath,
|
|
459719
|
+
audioCount: opts.audios.length,
|
|
459720
|
+
error: `ffmpeg mux failed: ${msg}`
|
|
459721
|
+
};
|
|
459722
|
+
}
|
|
459723
|
+
await rename6(tmpPath, opts.videoPath);
|
|
459724
|
+
return {
|
|
459725
|
+
success: true,
|
|
459726
|
+
outputPath: opts.videoPath,
|
|
459727
|
+
audioCount: opts.audios.length
|
|
459728
|
+
};
|
|
459729
|
+
}
|
|
459730
|
+
|
|
459731
|
+
// ../cli/src/commands/_shared/scene-render.ts
|
|
459522
459732
|
function qualityToCrf2(quality = "standard") {
|
|
459523
459733
|
return quality === "draft" ? 28 : quality === "high" ? 18 : 23;
|
|
459524
459734
|
}
|
|
@@ -459526,11 +459736,11 @@ function defaultOutputPath(opts) {
|
|
|
459526
459736
|
const fmt = opts.format ?? "mp4";
|
|
459527
459737
|
const now = opts.now ?? /* @__PURE__ */ new Date();
|
|
459528
459738
|
const stamp = now.toISOString().replace(/[:T]/g, "-").replace(/\..+$/, "");
|
|
459529
|
-
const name = (opts.projectName ??
|
|
459530
|
-
return
|
|
459739
|
+
const name = (opts.projectName ?? basename17(resolve39(opts.projectDir))) || "scene";
|
|
459740
|
+
return resolve39(opts.projectDir, "renders", `${name}-${stamp}.${fmt}`);
|
|
459531
459741
|
}
|
|
459532
459742
|
async function readProjectName(projectDir) {
|
|
459533
|
-
const cfgPath =
|
|
459743
|
+
const cfgPath = resolve39(projectDir, "vibe.project.yaml");
|
|
459534
459744
|
if (!existsSync36(cfgPath)) return void 0;
|
|
459535
459745
|
try {
|
|
459536
459746
|
const raw2 = await (await import("node:fs/promises")).readFile(cfgPath, "utf-8");
|
|
@@ -459552,7 +459762,7 @@ function buildRenderConfig(opts) {
|
|
|
459552
459762
|
};
|
|
459553
459763
|
}
|
|
459554
459764
|
async function executeSceneRender(opts = {}) {
|
|
459555
|
-
const projectDir =
|
|
459765
|
+
const projectDir = resolve39(opts.projectDir ?? ".");
|
|
459556
459766
|
const root2 = opts.root ?? "index.html";
|
|
459557
459767
|
const projectStat = await safeStat(projectDir);
|
|
459558
459768
|
if (!projectStat || !projectStat.isDirectory()) {
|
|
@@ -459561,7 +459771,7 @@ async function executeSceneRender(opts = {}) {
|
|
|
459561
459771
|
if (!await rootExists(projectDir, root2)) {
|
|
459562
459772
|
return {
|
|
459563
459773
|
success: false,
|
|
459564
|
-
error: `Root composition not found: ${
|
|
459774
|
+
error: `Root composition not found: ${resolve39(projectDir, root2)}. Run \`vibe scene init\` first.`
|
|
459565
459775
|
};
|
|
459566
459776
|
}
|
|
459567
459777
|
const chrome2 = await preflightChrome();
|
|
@@ -459569,8 +459779,8 @@ async function executeSceneRender(opts = {}) {
|
|
|
459569
459779
|
return { success: false, error: chrome2.reason };
|
|
459570
459780
|
}
|
|
459571
459781
|
const projectName = await readProjectName(projectDir);
|
|
459572
|
-
const outputPath = opts.output ?
|
|
459573
|
-
await mkdir18(
|
|
459782
|
+
const outputPath = opts.output ? resolve39(projectDir, opts.output) : defaultOutputPath({ projectDir, projectName, format: opts.format });
|
|
459783
|
+
await mkdir18(dirname24(outputPath), { recursive: true });
|
|
459574
459784
|
const config4 = buildRenderConfig({
|
|
459575
459785
|
fps: opts.fps,
|
|
459576
459786
|
quality: opts.quality,
|
|
@@ -459594,6 +459804,34 @@ async function executeSceneRender(opts = {}) {
|
|
|
459594
459804
|
error: err instanceof Error ? err.message : String(err)
|
|
459595
459805
|
};
|
|
459596
459806
|
}
|
|
459807
|
+
let audioCount = 0;
|
|
459808
|
+
let audioMuxApplied = false;
|
|
459809
|
+
let audioMuxWarning;
|
|
459810
|
+
try {
|
|
459811
|
+
opts.onProgress?.(0.95, "Mixing audio");
|
|
459812
|
+
const rootHtml = await readFile23(resolve39(projectDir, root2), "utf-8");
|
|
459813
|
+
const audios = await scanSceneAudio({ projectDir, rootHtml });
|
|
459814
|
+
audioCount = audios.length;
|
|
459815
|
+
if (audios.length > 0) {
|
|
459816
|
+
const videoDuration = job.totalFrames && config4.fps ? job.totalFrames / config4.fps : void 0;
|
|
459817
|
+
const mux = await muxAudioIntoVideo({
|
|
459818
|
+
videoPath: outputPath,
|
|
459819
|
+
audios,
|
|
459820
|
+
format: config4.format ?? "mp4",
|
|
459821
|
+
videoDuration,
|
|
459822
|
+
onProgress: (line) => {
|
|
459823
|
+
if (line) opts.onProgress?.(0.97, line);
|
|
459824
|
+
}
|
|
459825
|
+
});
|
|
459826
|
+
if (mux.success) {
|
|
459827
|
+
audioMuxApplied = true;
|
|
459828
|
+
} else {
|
|
459829
|
+
audioMuxWarning = mux.error;
|
|
459830
|
+
}
|
|
459831
|
+
}
|
|
459832
|
+
} catch (err) {
|
|
459833
|
+
audioMuxWarning = err instanceof Error ? err.message : String(err);
|
|
459834
|
+
}
|
|
459597
459835
|
return {
|
|
459598
459836
|
success: true,
|
|
459599
459837
|
outputPath: relative6(process.cwd(), outputPath) || outputPath,
|
|
@@ -459602,7 +459840,10 @@ async function executeSceneRender(opts = {}) {
|
|
|
459602
459840
|
totalFrames: job.totalFrames,
|
|
459603
459841
|
fps: config4.fps,
|
|
459604
459842
|
quality: config4.quality,
|
|
459605
|
-
format: config4.format
|
|
459843
|
+
format: config4.format,
|
|
459844
|
+
audioCount,
|
|
459845
|
+
audioMuxApplied,
|
|
459846
|
+
audioMuxWarning
|
|
459606
459847
|
};
|
|
459607
459848
|
}
|
|
459608
459849
|
async function safeStat(p) {
|
|
@@ -459619,8 +459860,8 @@ init_source();
|
|
|
459619
459860
|
init_ora();
|
|
459620
459861
|
var import_yaml6 = __toESM(require_dist14(), 1);
|
|
459621
459862
|
init_dist2();
|
|
459622
|
-
import { basename as
|
|
459623
|
-
import { mkdir as mkdir19, readFile as
|
|
459863
|
+
import { basename as basename18, resolve as resolve40, relative as relative7, dirname as dirname25 } from "node:path";
|
|
459864
|
+
import { mkdir as mkdir19, readFile as readFile24, writeFile as writeFile25, access as access5, copyFile as copyFile4 } from "node:fs/promises";
|
|
459624
459865
|
import { existsSync as existsSync37 } from "node:fs";
|
|
459625
459866
|
|
|
459626
459867
|
// ../cli/src/commands/_shared/tts-resolve.ts
|
|
@@ -459723,7 +459964,7 @@ Run 'vibe schema scene.<command>' for structured parameter info.`);
|
|
|
459723
459964
|
sceneCommand.command("init").description("Scaffold a new scene project (or safely augment an existing Hyperframes project)").argument("<dir>", "Project directory (created if it doesn't exist)").option("-n, --name <name>", "Project name (defaults to directory basename)").option("-r, --ratio <ratio>", "Aspect ratio: 16:9, 9:16, 1:1, 4:5", "16:9").option("-d, --duration <sec>", "Default root composition duration (seconds)", "10").option("--dry-run", "Preview parameters without writing files").action(async (dir, options) => {
|
|
459724
459965
|
const aspect = validateAspect(options.ratio);
|
|
459725
459966
|
const duration = validateDuration(options.duration);
|
|
459726
|
-
const name = options.name ??
|
|
459967
|
+
const name = options.name ?? basename18(dir.replace(/\/+$/, ""));
|
|
459727
459968
|
if (options.dryRun) {
|
|
459728
459969
|
outputResult({
|
|
459729
459970
|
dryRun: true,
|
|
@@ -459874,16 +460115,16 @@ async function pathExists2(p) {
|
|
|
459874
460115
|
}
|
|
459875
460116
|
}
|
|
459876
460117
|
async function loadVibeProjectConfig(projectDir) {
|
|
459877
|
-
const cfgPath =
|
|
460118
|
+
const cfgPath = resolve40(projectDir, "vibe.project.yaml");
|
|
459878
460119
|
if (!await pathExists2(cfgPath)) return null;
|
|
459879
|
-
const raw2 = await
|
|
460120
|
+
const raw2 = await readFile24(cfgPath, "utf-8");
|
|
459880
460121
|
return (0, import_yaml6.parse)(raw2);
|
|
459881
460122
|
}
|
|
459882
460123
|
async function resolveNarrationText(value) {
|
|
459883
460124
|
if (!value) return void 0;
|
|
459884
460125
|
const looksLikePath = /\.[a-z]{2,4}$/i.test(value) || value.includes("/") || value.includes("\\");
|
|
459885
460126
|
if (looksLikePath && existsSync37(value)) {
|
|
459886
|
-
return (await
|
|
460127
|
+
return (await readFile24(value, "utf-8")).trim();
|
|
459887
460128
|
}
|
|
459888
460129
|
return value.trim();
|
|
459889
460130
|
}
|
|
@@ -459899,12 +460140,12 @@ function aspectStringFromDims(width, height) {
|
|
|
459899
460140
|
return width > height ? "16:9" : "9:16";
|
|
459900
460141
|
}
|
|
459901
460142
|
async function executeSceneAdd(opts) {
|
|
459902
|
-
const projectDir =
|
|
460143
|
+
const projectDir = resolve40(opts.projectDir ?? ".");
|
|
459903
460144
|
const rootRel = opts.insertInto ?? "index.html";
|
|
459904
|
-
const rootPath =
|
|
460145
|
+
const rootPath = resolve40(projectDir, rootRel);
|
|
459905
460146
|
const id = slugifySceneName(opts.name);
|
|
459906
460147
|
const sceneRel = `compositions/scene-${id}.html`;
|
|
459907
|
-
const scenePath =
|
|
460148
|
+
const scenePath = resolve40(projectDir, sceneRel);
|
|
459908
460149
|
const errResult = (error) => ({
|
|
459909
460150
|
success: false,
|
|
459910
460151
|
id,
|
|
@@ -459921,7 +460162,7 @@ async function executeSceneAdd(opts) {
|
|
|
459921
460162
|
if (!opts.force && await pathExists2(scenePath)) {
|
|
459922
460163
|
return errResult(`Scene already exists: ${sceneRel}. Re-run with --force to overwrite.`);
|
|
459923
460164
|
}
|
|
459924
|
-
const rootHtmlBefore = await
|
|
460165
|
+
const rootHtmlBefore = await readFile24(rootPath, "utf-8");
|
|
459925
460166
|
let dims = readRootDims(rootHtmlBefore);
|
|
459926
460167
|
if (!dims) {
|
|
459927
460168
|
const cfg2 = await loadVibeProjectConfig(projectDir);
|
|
@@ -459935,7 +460176,7 @@ async function executeSceneAdd(opts) {
|
|
|
459935
460176
|
let audioAbsPath;
|
|
459936
460177
|
let narrationDuration;
|
|
459937
460178
|
if (opts.narrationFile && !opts.skipAudio) {
|
|
459938
|
-
const sourceAbs =
|
|
460179
|
+
const sourceAbs = resolve40(opts.narrationFile);
|
|
459939
460180
|
if (!await pathExists2(sourceAbs)) {
|
|
459940
460181
|
return errResult(`Narration file not found: ${sourceAbs}`);
|
|
459941
460182
|
}
|
|
@@ -459944,8 +460185,8 @@ async function executeSceneAdd(opts) {
|
|
|
459944
460185
|
return errResult(`Unsupported narration file extension: .${ext}. Use .wav or .mp3.`);
|
|
459945
460186
|
}
|
|
459946
460187
|
audioRelPath = `assets/narration-${id}.${ext}`;
|
|
459947
|
-
audioAbsPath =
|
|
459948
|
-
await mkdir19(
|
|
460188
|
+
audioAbsPath = resolve40(projectDir, audioRelPath);
|
|
460189
|
+
await mkdir19(dirname25(audioAbsPath), { recursive: true });
|
|
459949
460190
|
await copyFile4(sourceAbs, audioAbsPath);
|
|
459950
460191
|
try {
|
|
459951
460192
|
narrationDuration = await getAudioDuration(audioAbsPath);
|
|
@@ -459977,8 +460218,8 @@ async function executeSceneAdd(opts) {
|
|
|
459977
460218
|
return errResult(`${resolution.provider} TTS failed: ${tts.error ?? "unknown error"}`);
|
|
459978
460219
|
}
|
|
459979
460220
|
audioRelPath = `assets/narration-${id}.${resolution.audioExtension}`;
|
|
459980
|
-
audioAbsPath =
|
|
459981
|
-
await mkdir19(
|
|
460221
|
+
audioAbsPath = resolve40(projectDir, audioRelPath);
|
|
460222
|
+
await mkdir19(dirname25(audioAbsPath), { recursive: true });
|
|
459982
460223
|
await writeFile25(audioAbsPath, tts.audioBuffer);
|
|
459983
460224
|
try {
|
|
459984
460225
|
narrationDuration = await getAudioDuration(audioAbsPath);
|
|
@@ -460000,7 +460241,7 @@ async function executeSceneAdd(opts) {
|
|
|
460000
460241
|
try {
|
|
460001
460242
|
const whisper = new WhisperProvider();
|
|
460002
460243
|
await whisper.initialize({ apiKey: whisperKey });
|
|
460003
|
-
const audioBytes = await
|
|
460244
|
+
const audioBytes = await readFile24(audioAbsPath);
|
|
460004
460245
|
const audioBlob = new Blob([new Uint8Array(audioBytes)]);
|
|
460005
460246
|
const transcript = await whisper.transcribe(audioBlob, void 0, {
|
|
460006
460247
|
granularity: "word",
|
|
@@ -460008,7 +460249,7 @@ async function executeSceneAdd(opts) {
|
|
|
460008
460249
|
});
|
|
460009
460250
|
if (transcript.status === "completed" && transcript.words?.length) {
|
|
460010
460251
|
transcriptRelPath = `assets/transcript-${id}.json`;
|
|
460011
|
-
const transcriptAbs =
|
|
460252
|
+
const transcriptAbs = resolve40(projectDir, transcriptRelPath);
|
|
460012
460253
|
await writeFile25(transcriptAbs, JSON.stringify(transcript.words, null, 2), "utf-8");
|
|
460013
460254
|
transcriptWordCount = transcript.words.length;
|
|
460014
460255
|
transcriptWords = transcript.words.map((w) => ({ text: w.text, start: w.start, end: w.end }));
|
|
@@ -460045,8 +460286,8 @@ async function executeSceneAdd(opts) {
|
|
|
460045
460286
|
}
|
|
460046
460287
|
const img = imageResult.images[0];
|
|
460047
460288
|
imageRelPath = `assets/scene-${id}.png`;
|
|
460048
|
-
imageAbsPath =
|
|
460049
|
-
await mkdir19(
|
|
460289
|
+
imageAbsPath = resolve40(projectDir, imageRelPath);
|
|
460290
|
+
await mkdir19(dirname25(imageAbsPath), { recursive: true });
|
|
460050
460291
|
let buffer;
|
|
460051
460292
|
if (img.base64) {
|
|
460052
460293
|
buffer = Buffer.from(img.base64, "base64");
|
|
@@ -460070,8 +460311,8 @@ async function executeSceneAdd(opts) {
|
|
|
460070
460311
|
return errResult(`Gemini image generation failed: ${imageResult.error ?? "unknown error"}`);
|
|
460071
460312
|
}
|
|
460072
460313
|
imageRelPath = `assets/scene-${id}.png`;
|
|
460073
|
-
imageAbsPath =
|
|
460074
|
-
await mkdir19(
|
|
460314
|
+
imageAbsPath = resolve40(projectDir, imageRelPath);
|
|
460315
|
+
await mkdir19(dirname25(imageAbsPath), { recursive: true });
|
|
460075
460316
|
const buffer = Buffer.from(imageResult.images[0].base64, "base64");
|
|
460076
460317
|
await writeFile25(imageAbsPath, buffer);
|
|
460077
460318
|
}
|
|
@@ -460093,13 +460334,13 @@ async function executeSceneAdd(opts) {
|
|
|
460093
460334
|
audioPath: audioRelPath,
|
|
460094
460335
|
transcript: transcriptWords
|
|
460095
460336
|
});
|
|
460096
|
-
await mkdir19(
|
|
460337
|
+
await mkdir19(dirname25(scenePath), { recursive: true });
|
|
460097
460338
|
await writeFile25(scenePath, sceneHtml, "utf-8");
|
|
460098
460339
|
opts.onProgress?.("Updating root composition...");
|
|
460099
460340
|
const start = nextSceneStart(rootHtmlBefore);
|
|
460100
460341
|
const updated = insertClipIntoRoot(rootHtmlBefore, { id, start, duration });
|
|
460101
460342
|
await writeFile25(rootPath, updated, "utf-8");
|
|
460102
|
-
const transcriptAbsPath = transcriptRelPath ?
|
|
460343
|
+
const transcriptAbsPath = transcriptRelPath ? resolve40(projectDir, transcriptRelPath) : void 0;
|
|
460103
460344
|
return {
|
|
460104
460345
|
success: true,
|
|
460105
460346
|
id,
|
|
@@ -460115,10 +460356,10 @@ async function executeSceneAdd(opts) {
|
|
|
460115
460356
|
};
|
|
460116
460357
|
}
|
|
460117
460358
|
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) => {
|
|
460118
|
-
const projectDir =
|
|
460359
|
+
const projectDir = resolve40(options.project);
|
|
460119
460360
|
if (!await rootExists(projectDir, root2)) {
|
|
460120
460361
|
exitWithError(generalError(
|
|
460121
|
-
`Root composition not found: ${
|
|
460362
|
+
`Root composition not found: ${resolve40(projectDir, root2)}`,
|
|
460122
460363
|
"Run `vibe scene init` first, or pass --project <dir>."
|
|
460123
460364
|
));
|
|
460124
460365
|
}
|
|
@@ -460211,7 +460452,7 @@ sceneCommand.command("render").description("Render a scene project to MP4/WebM/M
|
|
|
460211
460452
|
const quality = validateQuality(options.quality);
|
|
460212
460453
|
const format4 = validateFormat(options.format);
|
|
460213
460454
|
const workers = validateWorkers(options.workers);
|
|
460214
|
-
const projectDir =
|
|
460455
|
+
const projectDir = resolve40(options.project);
|
|
460215
460456
|
if (options.dryRun) {
|
|
460216
460457
|
outputResult({
|
|
460217
460458
|
dryRun: true,
|
|
@@ -460261,6 +460502,13 @@ sceneCommand.command("render").description("Render a scene project to MP4/WebM/M
|
|
|
460261
460502
|
console.log(` duration ${((result.durationMs ?? 0) / 1e3).toFixed(1)}s`);
|
|
460262
460503
|
console.log(` frames ${result.framesRendered ?? "?"}${result.totalFrames ? ` / ${result.totalFrames}` : ""}`);
|
|
460263
460504
|
console.log(` config ${result.fps}fps \xB7 ${result.quality} \xB7 ${result.format}`);
|
|
460505
|
+
if (result.audioCount && result.audioCount > 0) {
|
|
460506
|
+
const muxStatus = result.audioMuxApplied ? source_default.green(`\u2713 ${result.audioCount} track${result.audioCount === 1 ? "" : "s"} muxed`) : source_default.yellow(`\u26A0 ${result.audioCount} track${result.audioCount === 1 ? "" : "s"} skipped`);
|
|
460507
|
+
console.log(` audio ${muxStatus}`);
|
|
460508
|
+
if (result.audioMuxWarning) {
|
|
460509
|
+
console.log(source_default.dim(` ${result.audioMuxWarning}`));
|
|
460510
|
+
}
|
|
460511
|
+
}
|
|
460264
460512
|
});
|
|
460265
460513
|
|
|
460266
460514
|
// src/tools/scene.ts
|
|
@@ -460357,7 +460605,7 @@ function summariseLint(result) {
|
|
|
460357
460605
|
async function handleSceneToolCall(name, args) {
|
|
460358
460606
|
switch (name) {
|
|
460359
460607
|
case "scene_init": {
|
|
460360
|
-
const dir =
|
|
460608
|
+
const dir = resolve41(process.cwd(), args.dir);
|
|
460361
460609
|
const result = await scaffoldSceneProject({
|
|
460362
460610
|
dir,
|
|
460363
460611
|
name: args.name,
|
|
@@ -460373,7 +460621,7 @@ async function handleSceneToolCall(name, args) {
|
|
|
460373
460621
|
});
|
|
460374
460622
|
}
|
|
460375
460623
|
case "scene_add": {
|
|
460376
|
-
const projectDir = args.projectDir ?
|
|
460624
|
+
const projectDir = args.projectDir ? resolve41(process.cwd(), args.projectDir) : process.cwd();
|
|
460377
460625
|
const result = await executeSceneAdd({
|
|
460378
460626
|
name: args.name,
|
|
460379
460627
|
preset: args.preset ?? "simple",
|
|
@@ -460404,7 +460652,7 @@ async function handleSceneToolCall(name, args) {
|
|
|
460404
460652
|
});
|
|
460405
460653
|
}
|
|
460406
460654
|
case "scene_lint": {
|
|
460407
|
-
const projectDir = args.projectDir ?
|
|
460655
|
+
const projectDir = args.projectDir ? resolve41(process.cwd(), args.projectDir) : process.cwd();
|
|
460408
460656
|
const result = await runProjectLint({
|
|
460409
460657
|
projectDir,
|
|
460410
460658
|
rootRel: args.root,
|
|
@@ -460413,7 +460661,7 @@ async function handleSceneToolCall(name, args) {
|
|
|
460413
460661
|
return JSON.stringify(summariseLint(result));
|
|
460414
460662
|
}
|
|
460415
460663
|
case "scene_render": {
|
|
460416
|
-
const projectDir = args.projectDir ?
|
|
460664
|
+
const projectDir = args.projectDir ? resolve41(process.cwd(), args.projectDir) : process.cwd();
|
|
460417
460665
|
const result = await executeSceneRender({
|
|
460418
460666
|
projectDir,
|
|
460419
460667
|
root: args.root,
|
|
@@ -460507,8 +460755,8 @@ async function handleToolCall(name, args) {
|
|
|
460507
460755
|
|
|
460508
460756
|
// src/resources/index.ts
|
|
460509
460757
|
init_engine();
|
|
460510
|
-
import { readFile as
|
|
460511
|
-
import { resolve as
|
|
460758
|
+
import { readFile as readFile25 } from "node:fs/promises";
|
|
460759
|
+
import { resolve as resolve43 } from "node:path";
|
|
460512
460760
|
var resources = [
|
|
460513
460761
|
{
|
|
460514
460762
|
uri: "vibe://project/current",
|
|
@@ -460543,8 +460791,8 @@ var resources = [
|
|
|
460543
460791
|
];
|
|
460544
460792
|
var currentProjectPath = process.env.VIBE_PROJECT_PATH || null;
|
|
460545
460793
|
async function loadProject2(projectPath) {
|
|
460546
|
-
const absPath =
|
|
460547
|
-
const content = await
|
|
460794
|
+
const absPath = resolve43(process.cwd(), projectPath);
|
|
460795
|
+
const content = await readFile25(absPath, "utf-8");
|
|
460548
460796
|
const data = JSON.parse(content);
|
|
460549
460797
|
return Project.fromJSON(data);
|
|
460550
460798
|
}
|