@swmansion/argent 0.34.1-next.7 → 0.34.1-next.71
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/LICENSE +1 -0
- package/README.md +1 -1
- package/assets/argent.tracecfg.pbtxt +7 -1
- package/assets/ios-screen-stream/Info.plist +12 -0
- package/assets/ios-screen-stream/ios-screen-stream.swift +321 -0
- package/assets/trace-processor/engine_bundle.node.js +2074 -11121
- package/assets/trace-processor/trace_processor.wasm +0 -0
- package/bin/argent-android-devtools-0.4.0.apk +0 -0
- package/bin/darwin/argent-macos-helper +0 -0
- package/bin/darwin/ax-service +0 -0
- package/bin/darwin/simulator-server +0 -0
- package/bin/darwin/tvos-ax-service +0 -0
- package/bin/darwin/tvos-hid-daemon +0 -0
- package/bin/linux/simulator-server +0 -0
- package/bin/linux-arm64/simulator-server +0 -0
- package/bin/network-inspector/network-inspector.jar +0 -0
- package/bin/tcp/ax-service +0 -0
- package/bin/win32/simulator-server.exe +0 -0
- package/dist/cli-cmds.mjs +1259 -616
- package/dist/client.js +381 -180
- package/dist/flow-script-runner.mjs +1 -0
- package/dist/installer-help.js +4 -0
- package/dist/installer-help.js.map +1 -1
- package/dist/installer.mjs +1248 -898
- package/dist/ios-device-runner/ArgentRunner/ArgentRunner.xcodeproj/xcshareddata/xcschemes/ArgentRunner.xcscheme +1 -0
- package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/ArgentLaunchPerformanceTests.swift +21 -0
- package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/ArgentRunnerSession+Commands.swift +9 -3
- package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/ArgentRunnerSession.swift +3 -0
- package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/RunnerHTTPServer.swift +21 -9
- package/dist/mcp-server.mjs +2675 -715
- package/dist/preview-ui/index.html +28 -2
- package/dist/tool-args.generated.d.ts +101 -33
- package/dist/tool-server.cjs +15873 -6272
- package/dylibs/libArgentAudio.dylib +0 -0
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/macos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/macos/libNativeDevtoolsMacos.dylib +0 -0
- package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
- package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
- package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +1 -1
- package/rules/argent.md +6 -23
- package/skills/argent-android-emulator-setup/SKILL.md +4 -4
- package/skills/argent-create-e2e/SKILL.md +3 -0
- package/skills/argent-create-e2e/references/e2e-yaml.md +20 -2
- package/skills/argent-create-e2e/references/live-authoring.md +12 -1
- package/skills/argent-device-interact/SKILL.md +22 -21
- package/skills/argent-device-interact/references/foldables.md +22 -0
- package/skills/argent-ios-device-interact/SKILL.md +3 -3
- package/skills/argent-ios-device-setup/SKILL.md +4 -2
- package/skills/argent-macos-app-interact/SKILL.md +15 -5
- package/skills/argent-macos-app-interact/references/e2e.md +1 -1
- package/skills/argent-metro-debugger/SKILL.md +26 -14
- package/skills/argent-native-profiler/SKILL.md +14 -2
- package/skills/argent-qa-e2e/SKILL.md +1 -1
- package/skills/argent-react-native-app-workflow/SKILL.md +2 -2
- package/skills/argent-react-native-optimization/SKILL.md +10 -1
- package/skills/argent-react-native-optimization/references/fix-reference.md +10 -10
- package/skills/argent-react-native-profiler/SKILL.md +4 -3
- package/skills/argent-screen-recording/SKILL.md +6 -4
- package/skills/argent-screenshot-diff/SKILL.md +1 -1
- package/skills/argent-test-ui-flow/SKILL.md +1 -1
- package/skills/argent-tv-interact/SKILL.md +3 -3
package/dist/mcp-server.mjs
CHANGED
|
@@ -2990,7 +2990,7 @@ var require_compile = __commonJS({
|
|
|
2990
2990
|
const schOrFunc = root.refs[ref];
|
|
2991
2991
|
if (schOrFunc)
|
|
2992
2992
|
return schOrFunc;
|
|
2993
|
-
let _sch =
|
|
2993
|
+
let _sch = resolve12.call(this, root, ref);
|
|
2994
2994
|
if (_sch === void 0) {
|
|
2995
2995
|
const schema = (_a3 = root.localRefs) === null || _a3 === void 0 ? void 0 : _a3[ref];
|
|
2996
2996
|
const { schemaId } = this.opts;
|
|
@@ -3017,7 +3017,7 @@ var require_compile = __commonJS({
|
|
|
3017
3017
|
function sameSchemaEnv(s1, s2) {
|
|
3018
3018
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
3019
3019
|
}
|
|
3020
|
-
function
|
|
3020
|
+
function resolve12(root, ref) {
|
|
3021
3021
|
let sch;
|
|
3022
3022
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
3023
3023
|
ref = sch;
|
|
@@ -3235,8 +3235,8 @@ var require_utils = __commonJS({
|
|
|
3235
3235
|
}
|
|
3236
3236
|
return ind;
|
|
3237
3237
|
}
|
|
3238
|
-
function removeDotSegments(
|
|
3239
|
-
let input =
|
|
3238
|
+
function removeDotSegments(path18) {
|
|
3239
|
+
let input = path18;
|
|
3240
3240
|
const output = [];
|
|
3241
3241
|
let nextSlash = -1;
|
|
3242
3242
|
let len = 0;
|
|
@@ -3488,8 +3488,8 @@ var require_schemes = __commonJS({
|
|
|
3488
3488
|
wsComponent.secure = void 0;
|
|
3489
3489
|
}
|
|
3490
3490
|
if (wsComponent.resourceName) {
|
|
3491
|
-
const [
|
|
3492
|
-
wsComponent.path =
|
|
3491
|
+
const [path18, query] = wsComponent.resourceName.split("?");
|
|
3492
|
+
wsComponent.path = path18 && path18 !== "/" ? path18 : void 0;
|
|
3493
3493
|
wsComponent.query = query;
|
|
3494
3494
|
wsComponent.resourceName = void 0;
|
|
3495
3495
|
}
|
|
@@ -3644,21 +3644,21 @@ var require_fast_uri = __commonJS({
|
|
|
3644
3644
|
normalizeString(uri, options);
|
|
3645
3645
|
} else if (typeof uri === "object") {
|
|
3646
3646
|
uri = /** @type {T} */
|
|
3647
|
-
|
|
3647
|
+
parse4(serialize(uri, options), options);
|
|
3648
3648
|
}
|
|
3649
3649
|
return uri;
|
|
3650
3650
|
}
|
|
3651
|
-
function
|
|
3651
|
+
function resolve12(baseURI, relativeURI, options) {
|
|
3652
3652
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
3653
|
-
const resolved = resolveComponent(
|
|
3653
|
+
const resolved = resolveComponent(parse4(baseURI, schemelessOptions), parse4(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
3654
3654
|
schemelessOptions.skipEscape = true;
|
|
3655
3655
|
return serialize(resolved, schemelessOptions);
|
|
3656
3656
|
}
|
|
3657
3657
|
function resolveComponent(base, relative2, options, skipNormalization) {
|
|
3658
3658
|
const target = {};
|
|
3659
3659
|
if (!skipNormalization) {
|
|
3660
|
-
base =
|
|
3661
|
-
relative2 =
|
|
3660
|
+
base = parse4(serialize(base, options), options);
|
|
3661
|
+
relative2 = parse4(serialize(relative2, options), options);
|
|
3662
3662
|
}
|
|
3663
3663
|
options = options || {};
|
|
3664
3664
|
if (!options.tolerant && relative2.scheme) {
|
|
@@ -3881,7 +3881,7 @@ var require_fast_uri = __commonJS({
|
|
|
3881
3881
|
}
|
|
3882
3882
|
return { parsed, malformedAuthorityOrPort };
|
|
3883
3883
|
}
|
|
3884
|
-
function
|
|
3884
|
+
function parse4(uri, opts) {
|
|
3885
3885
|
return parseWithStatus(uri, opts).parsed;
|
|
3886
3886
|
}
|
|
3887
3887
|
function normalizeString(uri, opts) {
|
|
@@ -3906,11 +3906,11 @@ var require_fast_uri = __commonJS({
|
|
|
3906
3906
|
var fastUri = {
|
|
3907
3907
|
SCHEMES,
|
|
3908
3908
|
normalize: normalize3,
|
|
3909
|
-
resolve:
|
|
3909
|
+
resolve: resolve12,
|
|
3910
3910
|
resolveComponent,
|
|
3911
3911
|
equal,
|
|
3912
3912
|
serialize,
|
|
3913
|
-
parse:
|
|
3913
|
+
parse: parse4
|
|
3914
3914
|
};
|
|
3915
3915
|
module.exports = fastUri;
|
|
3916
3916
|
module.exports.default = fastUri;
|
|
@@ -6882,12 +6882,12 @@ var require_dist = __commonJS({
|
|
|
6882
6882
|
throw new Error(`Unknown format "${name}"`);
|
|
6883
6883
|
return f;
|
|
6884
6884
|
};
|
|
6885
|
-
function addFormats(ajv, list,
|
|
6885
|
+
function addFormats(ajv, list, fs13, exportName) {
|
|
6886
6886
|
var _a3;
|
|
6887
6887
|
var _b;
|
|
6888
6888
|
(_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== void 0 ? _a3 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
6889
6889
|
for (const f of list)
|
|
6890
|
-
ajv.addFormat(f,
|
|
6890
|
+
ajv.addFormat(f, fs13[f]);
|
|
6891
6891
|
}
|
|
6892
6892
|
module.exports = exports = formatsPlugin;
|
|
6893
6893
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -6972,17 +6972,17 @@ var require_visit = __commonJS({
|
|
|
6972
6972
|
visit.BREAK = BREAK;
|
|
6973
6973
|
visit.SKIP = SKIP;
|
|
6974
6974
|
visit.REMOVE = REMOVE;
|
|
6975
|
-
function visit_(key, node2, visitor,
|
|
6976
|
-
const ctrl = callVisitor(key, node2, visitor,
|
|
6975
|
+
function visit_(key, node2, visitor, path18) {
|
|
6976
|
+
const ctrl = callVisitor(key, node2, visitor, path18);
|
|
6977
6977
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
6978
|
-
replaceNode(key,
|
|
6979
|
-
return visit_(key, ctrl, visitor,
|
|
6978
|
+
replaceNode(key, path18, ctrl);
|
|
6979
|
+
return visit_(key, ctrl, visitor, path18);
|
|
6980
6980
|
}
|
|
6981
6981
|
if (typeof ctrl !== "symbol") {
|
|
6982
6982
|
if (identity.isCollection(node2)) {
|
|
6983
|
-
|
|
6983
|
+
path18 = Object.freeze(path18.concat(node2));
|
|
6984
6984
|
for (let i = 0; i < node2.items.length; ++i) {
|
|
6985
|
-
const ci = visit_(i, node2.items[i], visitor,
|
|
6985
|
+
const ci = visit_(i, node2.items[i], visitor, path18);
|
|
6986
6986
|
if (typeof ci === "number")
|
|
6987
6987
|
i = ci - 1;
|
|
6988
6988
|
else if (ci === BREAK)
|
|
@@ -6993,13 +6993,13 @@ var require_visit = __commonJS({
|
|
|
6993
6993
|
}
|
|
6994
6994
|
}
|
|
6995
6995
|
} else if (identity.isPair(node2)) {
|
|
6996
|
-
|
|
6997
|
-
const ck = visit_("key", node2.key, visitor,
|
|
6996
|
+
path18 = Object.freeze(path18.concat(node2));
|
|
6997
|
+
const ck = visit_("key", node2.key, visitor, path18);
|
|
6998
6998
|
if (ck === BREAK)
|
|
6999
6999
|
return BREAK;
|
|
7000
7000
|
else if (ck === REMOVE)
|
|
7001
7001
|
node2.key = null;
|
|
7002
|
-
const cv = visit_("value", node2.value, visitor,
|
|
7002
|
+
const cv = visit_("value", node2.value, visitor, path18);
|
|
7003
7003
|
if (cv === BREAK)
|
|
7004
7004
|
return BREAK;
|
|
7005
7005
|
else if (cv === REMOVE)
|
|
@@ -7020,17 +7020,17 @@ var require_visit = __commonJS({
|
|
|
7020
7020
|
visitAsync.BREAK = BREAK;
|
|
7021
7021
|
visitAsync.SKIP = SKIP;
|
|
7022
7022
|
visitAsync.REMOVE = REMOVE;
|
|
7023
|
-
async function visitAsync_(key, node2, visitor,
|
|
7024
|
-
const ctrl = await callVisitor(key, node2, visitor,
|
|
7023
|
+
async function visitAsync_(key, node2, visitor, path18) {
|
|
7024
|
+
const ctrl = await callVisitor(key, node2, visitor, path18);
|
|
7025
7025
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
7026
|
-
replaceNode(key,
|
|
7027
|
-
return visitAsync_(key, ctrl, visitor,
|
|
7026
|
+
replaceNode(key, path18, ctrl);
|
|
7027
|
+
return visitAsync_(key, ctrl, visitor, path18);
|
|
7028
7028
|
}
|
|
7029
7029
|
if (typeof ctrl !== "symbol") {
|
|
7030
7030
|
if (identity.isCollection(node2)) {
|
|
7031
|
-
|
|
7031
|
+
path18 = Object.freeze(path18.concat(node2));
|
|
7032
7032
|
for (let i = 0; i < node2.items.length; ++i) {
|
|
7033
|
-
const ci = await visitAsync_(i, node2.items[i], visitor,
|
|
7033
|
+
const ci = await visitAsync_(i, node2.items[i], visitor, path18);
|
|
7034
7034
|
if (typeof ci === "number")
|
|
7035
7035
|
i = ci - 1;
|
|
7036
7036
|
else if (ci === BREAK)
|
|
@@ -7041,13 +7041,13 @@ var require_visit = __commonJS({
|
|
|
7041
7041
|
}
|
|
7042
7042
|
}
|
|
7043
7043
|
} else if (identity.isPair(node2)) {
|
|
7044
|
-
|
|
7045
|
-
const ck = await visitAsync_("key", node2.key, visitor,
|
|
7044
|
+
path18 = Object.freeze(path18.concat(node2));
|
|
7045
|
+
const ck = await visitAsync_("key", node2.key, visitor, path18);
|
|
7046
7046
|
if (ck === BREAK)
|
|
7047
7047
|
return BREAK;
|
|
7048
7048
|
else if (ck === REMOVE)
|
|
7049
7049
|
node2.key = null;
|
|
7050
|
-
const cv = await visitAsync_("value", node2.value, visitor,
|
|
7050
|
+
const cv = await visitAsync_("value", node2.value, visitor, path18);
|
|
7051
7051
|
if (cv === BREAK)
|
|
7052
7052
|
return BREAK;
|
|
7053
7053
|
else if (cv === REMOVE)
|
|
@@ -7074,23 +7074,23 @@ var require_visit = __commonJS({
|
|
|
7074
7074
|
}
|
|
7075
7075
|
return visitor;
|
|
7076
7076
|
}
|
|
7077
|
-
function callVisitor(key, node2, visitor,
|
|
7077
|
+
function callVisitor(key, node2, visitor, path18) {
|
|
7078
7078
|
if (typeof visitor === "function")
|
|
7079
|
-
return visitor(key, node2,
|
|
7079
|
+
return visitor(key, node2, path18);
|
|
7080
7080
|
if (identity.isMap(node2))
|
|
7081
|
-
return visitor.Map?.(key, node2,
|
|
7081
|
+
return visitor.Map?.(key, node2, path18);
|
|
7082
7082
|
if (identity.isSeq(node2))
|
|
7083
|
-
return visitor.Seq?.(key, node2,
|
|
7083
|
+
return visitor.Seq?.(key, node2, path18);
|
|
7084
7084
|
if (identity.isPair(node2))
|
|
7085
|
-
return visitor.Pair?.(key, node2,
|
|
7085
|
+
return visitor.Pair?.(key, node2, path18);
|
|
7086
7086
|
if (identity.isScalar(node2))
|
|
7087
|
-
return visitor.Scalar?.(key, node2,
|
|
7087
|
+
return visitor.Scalar?.(key, node2, path18);
|
|
7088
7088
|
if (identity.isAlias(node2))
|
|
7089
|
-
return visitor.Alias?.(key, node2,
|
|
7089
|
+
return visitor.Alias?.(key, node2, path18);
|
|
7090
7090
|
return void 0;
|
|
7091
7091
|
}
|
|
7092
|
-
function replaceNode(key,
|
|
7093
|
-
const parent =
|
|
7092
|
+
function replaceNode(key, path18, node2) {
|
|
7093
|
+
const parent = path18[path18.length - 1];
|
|
7094
7094
|
if (identity.isCollection(parent)) {
|
|
7095
7095
|
parent.items[key] = node2;
|
|
7096
7096
|
} else if (identity.isPair(parent)) {
|
|
@@ -7702,10 +7702,10 @@ var require_Collection = __commonJS({
|
|
|
7702
7702
|
var createNode = require_createNode();
|
|
7703
7703
|
var identity = require_identity();
|
|
7704
7704
|
var Node = require_Node();
|
|
7705
|
-
function collectionFromPath(schema,
|
|
7705
|
+
function collectionFromPath(schema, path18, value) {
|
|
7706
7706
|
let v = value;
|
|
7707
|
-
for (let i =
|
|
7708
|
-
const k =
|
|
7707
|
+
for (let i = path18.length - 1; i >= 0; --i) {
|
|
7708
|
+
const k = path18[i];
|
|
7709
7709
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
7710
7710
|
const a = [];
|
|
7711
7711
|
a[k] = v;
|
|
@@ -7724,7 +7724,7 @@ var require_Collection = __commonJS({
|
|
|
7724
7724
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
7725
7725
|
});
|
|
7726
7726
|
}
|
|
7727
|
-
var isEmptyPath = (
|
|
7727
|
+
var isEmptyPath = (path18) => path18 == null || typeof path18 === "object" && !!path18[Symbol.iterator]().next().done;
|
|
7728
7728
|
var Collection = class extends Node.NodeBase {
|
|
7729
7729
|
constructor(type, schema) {
|
|
7730
7730
|
super(type);
|
|
@@ -7754,11 +7754,11 @@ var require_Collection = __commonJS({
|
|
|
7754
7754
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
7755
7755
|
* that already exists in the map.
|
|
7756
7756
|
*/
|
|
7757
|
-
addIn(
|
|
7758
|
-
if (isEmptyPath(
|
|
7757
|
+
addIn(path18, value) {
|
|
7758
|
+
if (isEmptyPath(path18))
|
|
7759
7759
|
this.add(value);
|
|
7760
7760
|
else {
|
|
7761
|
-
const [key, ...rest] =
|
|
7761
|
+
const [key, ...rest] = path18;
|
|
7762
7762
|
const node2 = this.get(key, true);
|
|
7763
7763
|
if (identity.isCollection(node2))
|
|
7764
7764
|
node2.addIn(rest, value);
|
|
@@ -7772,8 +7772,8 @@ var require_Collection = __commonJS({
|
|
|
7772
7772
|
* Removes a value from the collection.
|
|
7773
7773
|
* @returns `true` if the item was found and removed.
|
|
7774
7774
|
*/
|
|
7775
|
-
deleteIn(
|
|
7776
|
-
const [key, ...rest] =
|
|
7775
|
+
deleteIn(path18) {
|
|
7776
|
+
const [key, ...rest] = path18;
|
|
7777
7777
|
if (rest.length === 0)
|
|
7778
7778
|
return this.delete(key);
|
|
7779
7779
|
const node2 = this.get(key, true);
|
|
@@ -7787,8 +7787,8 @@ var require_Collection = __commonJS({
|
|
|
7787
7787
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
7788
7788
|
* `true` (collections are always returned intact).
|
|
7789
7789
|
*/
|
|
7790
|
-
getIn(
|
|
7791
|
-
const [key, ...rest] =
|
|
7790
|
+
getIn(path18, keepScalar) {
|
|
7791
|
+
const [key, ...rest] = path18;
|
|
7792
7792
|
const node2 = this.get(key, true);
|
|
7793
7793
|
if (rest.length === 0)
|
|
7794
7794
|
return !keepScalar && identity.isScalar(node2) ? node2.value : node2;
|
|
@@ -7806,8 +7806,8 @@ var require_Collection = __commonJS({
|
|
|
7806
7806
|
/**
|
|
7807
7807
|
* Checks if the collection includes a value with the key `key`.
|
|
7808
7808
|
*/
|
|
7809
|
-
hasIn(
|
|
7810
|
-
const [key, ...rest] =
|
|
7809
|
+
hasIn(path18) {
|
|
7810
|
+
const [key, ...rest] = path18;
|
|
7811
7811
|
if (rest.length === 0)
|
|
7812
7812
|
return this.has(key);
|
|
7813
7813
|
const node2 = this.get(key, true);
|
|
@@ -7817,8 +7817,8 @@ var require_Collection = __commonJS({
|
|
|
7817
7817
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
7818
7818
|
* boolean to add/remove the item from the set.
|
|
7819
7819
|
*/
|
|
7820
|
-
setIn(
|
|
7821
|
-
const [key, ...rest] =
|
|
7820
|
+
setIn(path18, value) {
|
|
7821
|
+
const [key, ...rest] = path18;
|
|
7822
7822
|
if (rest.length === 0) {
|
|
7823
7823
|
this.set(key, value);
|
|
7824
7824
|
} else {
|
|
@@ -10333,9 +10333,9 @@ var require_Document = __commonJS({
|
|
|
10333
10333
|
this.contents.add(value);
|
|
10334
10334
|
}
|
|
10335
10335
|
/** Adds a value to the document. */
|
|
10336
|
-
addIn(
|
|
10336
|
+
addIn(path18, value) {
|
|
10337
10337
|
if (assertCollection(this.contents))
|
|
10338
|
-
this.contents.addIn(
|
|
10338
|
+
this.contents.addIn(path18, value);
|
|
10339
10339
|
}
|
|
10340
10340
|
/**
|
|
10341
10341
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -10410,14 +10410,14 @@ var require_Document = __commonJS({
|
|
|
10410
10410
|
* Removes a value from the document.
|
|
10411
10411
|
* @returns `true` if the item was found and removed.
|
|
10412
10412
|
*/
|
|
10413
|
-
deleteIn(
|
|
10414
|
-
if (Collection.isEmptyPath(
|
|
10413
|
+
deleteIn(path18) {
|
|
10414
|
+
if (Collection.isEmptyPath(path18)) {
|
|
10415
10415
|
if (this.contents == null)
|
|
10416
10416
|
return false;
|
|
10417
10417
|
this.contents = null;
|
|
10418
10418
|
return true;
|
|
10419
10419
|
}
|
|
10420
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
10420
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path18) : false;
|
|
10421
10421
|
}
|
|
10422
10422
|
/**
|
|
10423
10423
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -10432,10 +10432,10 @@ var require_Document = __commonJS({
|
|
|
10432
10432
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
10433
10433
|
* `true` (collections are always returned intact).
|
|
10434
10434
|
*/
|
|
10435
|
-
getIn(
|
|
10436
|
-
if (Collection.isEmptyPath(
|
|
10435
|
+
getIn(path18, keepScalar) {
|
|
10436
|
+
if (Collection.isEmptyPath(path18))
|
|
10437
10437
|
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
10438
|
-
return identity.isCollection(this.contents) ? this.contents.getIn(
|
|
10438
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path18, keepScalar) : void 0;
|
|
10439
10439
|
}
|
|
10440
10440
|
/**
|
|
10441
10441
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -10446,10 +10446,10 @@ var require_Document = __commonJS({
|
|
|
10446
10446
|
/**
|
|
10447
10447
|
* Checks if the document includes a value at `path`.
|
|
10448
10448
|
*/
|
|
10449
|
-
hasIn(
|
|
10450
|
-
if (Collection.isEmptyPath(
|
|
10449
|
+
hasIn(path18) {
|
|
10450
|
+
if (Collection.isEmptyPath(path18))
|
|
10451
10451
|
return this.contents !== void 0;
|
|
10452
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
|
10452
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path18) : false;
|
|
10453
10453
|
}
|
|
10454
10454
|
/**
|
|
10455
10455
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -10466,13 +10466,13 @@ var require_Document = __commonJS({
|
|
|
10466
10466
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
10467
10467
|
* boolean to add/remove the item from the set.
|
|
10468
10468
|
*/
|
|
10469
|
-
setIn(
|
|
10470
|
-
if (Collection.isEmptyPath(
|
|
10469
|
+
setIn(path18, value) {
|
|
10470
|
+
if (Collection.isEmptyPath(path18)) {
|
|
10471
10471
|
this.contents = value;
|
|
10472
10472
|
} else if (this.contents == null) {
|
|
10473
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
10473
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path18), value);
|
|
10474
10474
|
} else if (assertCollection(this.contents)) {
|
|
10475
|
-
this.contents.setIn(
|
|
10475
|
+
this.contents.setIn(path18, value);
|
|
10476
10476
|
}
|
|
10477
10477
|
}
|
|
10478
10478
|
/**
|
|
@@ -10858,10 +10858,10 @@ var require_resolve_block_map = __commonJS({
|
|
|
10858
10858
|
let offset = bm.offset;
|
|
10859
10859
|
let commentEnd = null;
|
|
10860
10860
|
for (const collItem of bm.items) {
|
|
10861
|
-
const { start, key, sep:
|
|
10861
|
+
const { start, key, sep: sep6, value } = collItem;
|
|
10862
10862
|
const keyProps = resolveProps.resolveProps(start, {
|
|
10863
10863
|
indicator: "explicit-key-ind",
|
|
10864
|
-
next: key ??
|
|
10864
|
+
next: key ?? sep6?.[0],
|
|
10865
10865
|
offset,
|
|
10866
10866
|
onError,
|
|
10867
10867
|
parentIndent: bm.indent,
|
|
@@ -10875,7 +10875,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
10875
10875
|
else if ("indent" in key && key.indent !== bm.indent)
|
|
10876
10876
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
10877
10877
|
}
|
|
10878
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
10878
|
+
if (!keyProps.anchor && !keyProps.tag && !sep6) {
|
|
10879
10879
|
commentEnd = keyProps.end;
|
|
10880
10880
|
if (keyProps.comment) {
|
|
10881
10881
|
if (map.comment)
|
|
@@ -10899,7 +10899,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
10899
10899
|
ctx.atKey = false;
|
|
10900
10900
|
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
|
10901
10901
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
10902
|
-
const valueProps = resolveProps.resolveProps(
|
|
10902
|
+
const valueProps = resolveProps.resolveProps(sep6 ?? [], {
|
|
10903
10903
|
indicator: "map-value-ind",
|
|
10904
10904
|
next: value,
|
|
10905
10905
|
offset: keyNode.range[2],
|
|
@@ -10915,7 +10915,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
10915
10915
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
10916
10916
|
onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
10917
10917
|
}
|
|
10918
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset,
|
|
10918
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep6, null, valueProps, onError);
|
|
10919
10919
|
if (ctx.schema.compat)
|
|
10920
10920
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
10921
10921
|
offset = valueNode.range[2];
|
|
@@ -11006,7 +11006,7 @@ var require_resolve_end = __commonJS({
|
|
|
11006
11006
|
let comment = "";
|
|
11007
11007
|
if (end) {
|
|
11008
11008
|
let hasSpace = false;
|
|
11009
|
-
let
|
|
11009
|
+
let sep6 = "";
|
|
11010
11010
|
for (const token of end) {
|
|
11011
11011
|
const { source, type } = token;
|
|
11012
11012
|
switch (type) {
|
|
@@ -11020,13 +11020,13 @@ var require_resolve_end = __commonJS({
|
|
|
11020
11020
|
if (!comment)
|
|
11021
11021
|
comment = cb;
|
|
11022
11022
|
else
|
|
11023
|
-
comment +=
|
|
11024
|
-
|
|
11023
|
+
comment += sep6 + cb;
|
|
11024
|
+
sep6 = "";
|
|
11025
11025
|
break;
|
|
11026
11026
|
}
|
|
11027
11027
|
case "newline":
|
|
11028
11028
|
if (comment)
|
|
11029
|
-
|
|
11029
|
+
sep6 += source;
|
|
11030
11030
|
hasSpace = true;
|
|
11031
11031
|
break;
|
|
11032
11032
|
default:
|
|
@@ -11069,18 +11069,18 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
11069
11069
|
let offset = fc.offset + fc.start.source.length;
|
|
11070
11070
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
11071
11071
|
const collItem = fc.items[i];
|
|
11072
|
-
const { start, key, sep:
|
|
11072
|
+
const { start, key, sep: sep6, value } = collItem;
|
|
11073
11073
|
const props = resolveProps.resolveProps(start, {
|
|
11074
11074
|
flow: fcName,
|
|
11075
11075
|
indicator: "explicit-key-ind",
|
|
11076
|
-
next: key ??
|
|
11076
|
+
next: key ?? sep6?.[0],
|
|
11077
11077
|
offset,
|
|
11078
11078
|
onError,
|
|
11079
11079
|
parentIndent: fc.indent,
|
|
11080
11080
|
startOnNewline: false
|
|
11081
11081
|
});
|
|
11082
11082
|
if (!props.found) {
|
|
11083
|
-
if (!props.anchor && !props.tag && !
|
|
11083
|
+
if (!props.anchor && !props.tag && !sep6 && !value) {
|
|
11084
11084
|
if (i === 0 && props.comma)
|
|
11085
11085
|
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
11086
11086
|
else if (i < fc.items.length - 1)
|
|
@@ -11134,8 +11134,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
11134
11134
|
}
|
|
11135
11135
|
}
|
|
11136
11136
|
}
|
|
11137
|
-
if (!isMap && !
|
|
11138
|
-
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end,
|
|
11137
|
+
if (!isMap && !sep6 && !props.found) {
|
|
11138
|
+
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep6, null, props, onError);
|
|
11139
11139
|
coll.items.push(valueNode);
|
|
11140
11140
|
offset = valueNode.range[2];
|
|
11141
11141
|
if (isBlock(value))
|
|
@@ -11147,7 +11147,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
11147
11147
|
if (isBlock(key))
|
|
11148
11148
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
11149
11149
|
ctx.atKey = false;
|
|
11150
|
-
const valueProps = resolveProps.resolveProps(
|
|
11150
|
+
const valueProps = resolveProps.resolveProps(sep6 ?? [], {
|
|
11151
11151
|
flow: fcName,
|
|
11152
11152
|
indicator: "map-value-ind",
|
|
11153
11153
|
next: value,
|
|
@@ -11158,8 +11158,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
11158
11158
|
});
|
|
11159
11159
|
if (valueProps.found) {
|
|
11160
11160
|
if (!isMap && !props.found && ctx.options.strict) {
|
|
11161
|
-
if (
|
|
11162
|
-
for (const st of
|
|
11161
|
+
if (sep6)
|
|
11162
|
+
for (const st of sep6) {
|
|
11163
11163
|
if (st === valueProps.found)
|
|
11164
11164
|
break;
|
|
11165
11165
|
if (st.type === "newline") {
|
|
@@ -11176,7 +11176,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
11176
11176
|
else
|
|
11177
11177
|
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
11178
11178
|
}
|
|
11179
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
11179
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep6, null, valueProps, onError) : null;
|
|
11180
11180
|
if (valueNode) {
|
|
11181
11181
|
if (isBlock(value))
|
|
11182
11182
|
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -11356,7 +11356,7 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
11356
11356
|
chompStart = i + 1;
|
|
11357
11357
|
}
|
|
11358
11358
|
let value = "";
|
|
11359
|
-
let
|
|
11359
|
+
let sep6 = "";
|
|
11360
11360
|
let prevMoreIndented = false;
|
|
11361
11361
|
for (let i = 0; i < contentStart; ++i)
|
|
11362
11362
|
value += lines[i][0].slice(trimIndent) + "\n";
|
|
@@ -11373,24 +11373,24 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
11373
11373
|
indent = "";
|
|
11374
11374
|
}
|
|
11375
11375
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
11376
|
-
value +=
|
|
11377
|
-
|
|
11376
|
+
value += sep6 + indent.slice(trimIndent) + content;
|
|
11377
|
+
sep6 = "\n";
|
|
11378
11378
|
} else if (indent.length > trimIndent || content[0] === " ") {
|
|
11379
|
-
if (
|
|
11380
|
-
|
|
11381
|
-
else if (!prevMoreIndented &&
|
|
11382
|
-
|
|
11383
|
-
value +=
|
|
11384
|
-
|
|
11379
|
+
if (sep6 === " ")
|
|
11380
|
+
sep6 = "\n";
|
|
11381
|
+
else if (!prevMoreIndented && sep6 === "\n")
|
|
11382
|
+
sep6 = "\n\n";
|
|
11383
|
+
value += sep6 + indent.slice(trimIndent) + content;
|
|
11384
|
+
sep6 = "\n";
|
|
11385
11385
|
prevMoreIndented = true;
|
|
11386
11386
|
} else if (content === "") {
|
|
11387
|
-
if (
|
|
11387
|
+
if (sep6 === "\n")
|
|
11388
11388
|
value += "\n";
|
|
11389
11389
|
else
|
|
11390
|
-
|
|
11390
|
+
sep6 = "\n";
|
|
11391
11391
|
} else {
|
|
11392
|
-
value +=
|
|
11393
|
-
|
|
11392
|
+
value += sep6 + content;
|
|
11393
|
+
sep6 = " ";
|
|
11394
11394
|
prevMoreIndented = false;
|
|
11395
11395
|
}
|
|
11396
11396
|
}
|
|
@@ -11573,25 +11573,25 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
11573
11573
|
trimBoth = /^[ \t]+|[ \t]+$/g;
|
|
11574
11574
|
}
|
|
11575
11575
|
let res = match[1].replace(trimEnd, "");
|
|
11576
|
-
let
|
|
11576
|
+
let sep6 = " ";
|
|
11577
11577
|
let pos = line.lastIndex;
|
|
11578
11578
|
while (match = line.exec(source)) {
|
|
11579
11579
|
const lm = match[1].replace(trimBoth, "");
|
|
11580
11580
|
if (lm === "") {
|
|
11581
|
-
if (
|
|
11582
|
-
res +=
|
|
11581
|
+
if (sep6 === "\n")
|
|
11582
|
+
res += sep6;
|
|
11583
11583
|
else
|
|
11584
|
-
|
|
11584
|
+
sep6 = "\n";
|
|
11585
11585
|
} else {
|
|
11586
|
-
res +=
|
|
11587
|
-
|
|
11586
|
+
res += sep6 + lm;
|
|
11587
|
+
sep6 = " ";
|
|
11588
11588
|
}
|
|
11589
11589
|
pos = line.lastIndex;
|
|
11590
11590
|
}
|
|
11591
11591
|
const last = /[ \t]*(.*)/sy;
|
|
11592
11592
|
last.lastIndex = pos;
|
|
11593
11593
|
match = last.exec(source);
|
|
11594
|
-
return res +
|
|
11594
|
+
return res + sep6 + (match?.[1] ?? "");
|
|
11595
11595
|
}
|
|
11596
11596
|
function doubleQuotedValue(source, onError) {
|
|
11597
11597
|
let res = "";
|
|
@@ -12401,14 +12401,14 @@ var require_cst_stringify = __commonJS({
|
|
|
12401
12401
|
}
|
|
12402
12402
|
}
|
|
12403
12403
|
}
|
|
12404
|
-
function stringifyItem({ start, key, sep:
|
|
12404
|
+
function stringifyItem({ start, key, sep: sep6, value }) {
|
|
12405
12405
|
let res = "";
|
|
12406
12406
|
for (const st of start)
|
|
12407
12407
|
res += st.source;
|
|
12408
12408
|
if (key)
|
|
12409
12409
|
res += stringifyToken(key);
|
|
12410
|
-
if (
|
|
12411
|
-
for (const st of
|
|
12410
|
+
if (sep6)
|
|
12411
|
+
for (const st of sep6)
|
|
12412
12412
|
res += st.source;
|
|
12413
12413
|
if (value)
|
|
12414
12414
|
res += stringifyToken(value);
|
|
@@ -12433,9 +12433,9 @@ var require_cst_visit = __commonJS({
|
|
|
12433
12433
|
visit.BREAK = BREAK;
|
|
12434
12434
|
visit.SKIP = SKIP;
|
|
12435
12435
|
visit.REMOVE = REMOVE;
|
|
12436
|
-
visit.itemAtPath = (cst,
|
|
12436
|
+
visit.itemAtPath = (cst, path18) => {
|
|
12437
12437
|
let item = cst;
|
|
12438
|
-
for (const [field, index] of
|
|
12438
|
+
for (const [field, index] of path18) {
|
|
12439
12439
|
const tok = item?.[field];
|
|
12440
12440
|
if (tok && "items" in tok) {
|
|
12441
12441
|
item = tok.items[index];
|
|
@@ -12444,23 +12444,23 @@ var require_cst_visit = __commonJS({
|
|
|
12444
12444
|
}
|
|
12445
12445
|
return item;
|
|
12446
12446
|
};
|
|
12447
|
-
visit.parentCollection = (cst,
|
|
12448
|
-
const parent = visit.itemAtPath(cst,
|
|
12449
|
-
const field =
|
|
12447
|
+
visit.parentCollection = (cst, path18) => {
|
|
12448
|
+
const parent = visit.itemAtPath(cst, path18.slice(0, -1));
|
|
12449
|
+
const field = path18[path18.length - 1][0];
|
|
12450
12450
|
const coll = parent?.[field];
|
|
12451
12451
|
if (coll && "items" in coll)
|
|
12452
12452
|
return coll;
|
|
12453
12453
|
throw new Error("Parent collection not found");
|
|
12454
12454
|
};
|
|
12455
|
-
function _visit(
|
|
12456
|
-
let ctrl = visitor(item,
|
|
12455
|
+
function _visit(path18, item, visitor) {
|
|
12456
|
+
let ctrl = visitor(item, path18);
|
|
12457
12457
|
if (typeof ctrl === "symbol")
|
|
12458
12458
|
return ctrl;
|
|
12459
12459
|
for (const field of ["key", "value"]) {
|
|
12460
12460
|
const token = item[field];
|
|
12461
12461
|
if (token && "items" in token) {
|
|
12462
12462
|
for (let i = 0; i < token.items.length; ++i) {
|
|
12463
|
-
const ci = _visit(Object.freeze(
|
|
12463
|
+
const ci = _visit(Object.freeze(path18.concat([[field, i]])), token.items[i], visitor);
|
|
12464
12464
|
if (typeof ci === "number")
|
|
12465
12465
|
i = ci - 1;
|
|
12466
12466
|
else if (ci === BREAK)
|
|
@@ -12471,10 +12471,10 @@ var require_cst_visit = __commonJS({
|
|
|
12471
12471
|
}
|
|
12472
12472
|
}
|
|
12473
12473
|
if (typeof ctrl === "function" && field === "key")
|
|
12474
|
-
ctrl = ctrl(item,
|
|
12474
|
+
ctrl = ctrl(item, path18);
|
|
12475
12475
|
}
|
|
12476
12476
|
}
|
|
12477
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
12477
|
+
return typeof ctrl === "function" ? ctrl(item, path18) : ctrl;
|
|
12478
12478
|
}
|
|
12479
12479
|
exports.visit = visit;
|
|
12480
12480
|
}
|
|
@@ -13575,18 +13575,18 @@ var require_parser = __commonJS({
|
|
|
13575
13575
|
if (this.type === "map-value-ind") {
|
|
13576
13576
|
const prev = getPrevProps(this.peek(2));
|
|
13577
13577
|
const start = getFirstKeyStartProps(prev);
|
|
13578
|
-
let
|
|
13578
|
+
let sep6;
|
|
13579
13579
|
if (scalar.end) {
|
|
13580
|
-
|
|
13581
|
-
|
|
13580
|
+
sep6 = scalar.end;
|
|
13581
|
+
sep6.push(this.sourceToken);
|
|
13582
13582
|
delete scalar.end;
|
|
13583
13583
|
} else
|
|
13584
|
-
|
|
13584
|
+
sep6 = [this.sourceToken];
|
|
13585
13585
|
const map = {
|
|
13586
13586
|
type: "block-map",
|
|
13587
13587
|
offset: scalar.offset,
|
|
13588
13588
|
indent: scalar.indent,
|
|
13589
|
-
items: [{ start, key: scalar, sep:
|
|
13589
|
+
items: [{ start, key: scalar, sep: sep6 }]
|
|
13590
13590
|
};
|
|
13591
13591
|
this.onKeyLine = true;
|
|
13592
13592
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -13739,15 +13739,15 @@ var require_parser = __commonJS({
|
|
|
13739
13739
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
13740
13740
|
const start2 = getFirstKeyStartProps(it.start);
|
|
13741
13741
|
const key = it.key;
|
|
13742
|
-
const
|
|
13743
|
-
|
|
13742
|
+
const sep6 = it.sep;
|
|
13743
|
+
sep6.push(this.sourceToken);
|
|
13744
13744
|
delete it.key;
|
|
13745
13745
|
delete it.sep;
|
|
13746
13746
|
this.stack.push({
|
|
13747
13747
|
type: "block-map",
|
|
13748
13748
|
offset: this.offset,
|
|
13749
13749
|
indent: this.indent,
|
|
13750
|
-
items: [{ start: start2, key, sep:
|
|
13750
|
+
items: [{ start: start2, key, sep: sep6 }]
|
|
13751
13751
|
});
|
|
13752
13752
|
} else if (start.length > 0) {
|
|
13753
13753
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -13776,14 +13776,14 @@ var require_parser = __commonJS({
|
|
|
13776
13776
|
case "scalar":
|
|
13777
13777
|
case "single-quoted-scalar":
|
|
13778
13778
|
case "double-quoted-scalar": {
|
|
13779
|
-
const
|
|
13779
|
+
const fs13 = this.flowScalar(this.type);
|
|
13780
13780
|
if (atNextItem || it.value) {
|
|
13781
|
-
map.items.push({ start, key:
|
|
13781
|
+
map.items.push({ start, key: fs13, sep: [] });
|
|
13782
13782
|
this.onKeyLine = true;
|
|
13783
13783
|
} else if (it.sep) {
|
|
13784
|
-
this.stack.push(
|
|
13784
|
+
this.stack.push(fs13);
|
|
13785
13785
|
} else {
|
|
13786
|
-
Object.assign(it, { key:
|
|
13786
|
+
Object.assign(it, { key: fs13, sep: [] });
|
|
13787
13787
|
this.onKeyLine = true;
|
|
13788
13788
|
}
|
|
13789
13789
|
return;
|
|
@@ -13911,13 +13911,13 @@ var require_parser = __commonJS({
|
|
|
13911
13911
|
case "scalar":
|
|
13912
13912
|
case "single-quoted-scalar":
|
|
13913
13913
|
case "double-quoted-scalar": {
|
|
13914
|
-
const
|
|
13914
|
+
const fs13 = this.flowScalar(this.type);
|
|
13915
13915
|
if (!it || it.value)
|
|
13916
|
-
fc.items.push({ start: [], key:
|
|
13916
|
+
fc.items.push({ start: [], key: fs13, sep: [] });
|
|
13917
13917
|
else if (it.sep)
|
|
13918
|
-
this.stack.push(
|
|
13918
|
+
this.stack.push(fs13);
|
|
13919
13919
|
else
|
|
13920
|
-
Object.assign(it, { key:
|
|
13920
|
+
Object.assign(it, { key: fs13, sep: [] });
|
|
13921
13921
|
return;
|
|
13922
13922
|
}
|
|
13923
13923
|
case "flow-map-end":
|
|
@@ -13941,13 +13941,13 @@ var require_parser = __commonJS({
|
|
|
13941
13941
|
const prev = getPrevProps(parent);
|
|
13942
13942
|
const start = getFirstKeyStartProps(prev);
|
|
13943
13943
|
fixFlowSeqItems(fc);
|
|
13944
|
-
const
|
|
13945
|
-
|
|
13944
|
+
const sep6 = fc.end.splice(1, fc.end.length);
|
|
13945
|
+
sep6.push(this.sourceToken);
|
|
13946
13946
|
const map = {
|
|
13947
13947
|
type: "block-map",
|
|
13948
13948
|
offset: fc.offset,
|
|
13949
13949
|
indent: fc.indent,
|
|
13950
|
-
items: [{ start, key: fc, sep:
|
|
13950
|
+
items: [{ start, key: fc, sep: sep6 }]
|
|
13951
13951
|
};
|
|
13952
13952
|
this.onKeyLine = true;
|
|
13953
13953
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -14125,7 +14125,7 @@ var require_public_api = __commonJS({
|
|
|
14125
14125
|
}
|
|
14126
14126
|
return doc;
|
|
14127
14127
|
}
|
|
14128
|
-
function
|
|
14128
|
+
function parse4(src, reviver, options) {
|
|
14129
14129
|
let _reviver = void 0;
|
|
14130
14130
|
if (typeof reviver === "function") {
|
|
14131
14131
|
_reviver = reviver;
|
|
@@ -14166,7 +14166,7 @@ var require_public_api = __commonJS({
|
|
|
14166
14166
|
return value.toString(options);
|
|
14167
14167
|
return new Document.Document(value, _replacer, options).toString(options);
|
|
14168
14168
|
}
|
|
14169
|
-
exports.parse =
|
|
14169
|
+
exports.parse = parse4;
|
|
14170
14170
|
exports.parseAllDocuments = parseAllDocuments;
|
|
14171
14171
|
exports.parseDocument = parseDocument;
|
|
14172
14172
|
exports.stringify = stringify;
|
|
@@ -14617,10 +14617,2005 @@ var require_dist3 = __commonJS({
|
|
|
14617
14617
|
}
|
|
14618
14618
|
});
|
|
14619
14619
|
|
|
14620
|
+
// ../../node_modules/semver/internal/constants.js
|
|
14621
|
+
var require_constants = __commonJS({
|
|
14622
|
+
"../../node_modules/semver/internal/constants.js"(exports, module) {
|
|
14623
|
+
"use strict";
|
|
14624
|
+
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
14625
|
+
var MAX_LENGTH = 256;
|
|
14626
|
+
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
14627
|
+
9007199254740991;
|
|
14628
|
+
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
14629
|
+
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
14630
|
+
var RELEASE_TYPES = [
|
|
14631
|
+
"major",
|
|
14632
|
+
"premajor",
|
|
14633
|
+
"minor",
|
|
14634
|
+
"preminor",
|
|
14635
|
+
"patch",
|
|
14636
|
+
"prepatch",
|
|
14637
|
+
"prerelease"
|
|
14638
|
+
];
|
|
14639
|
+
module.exports = {
|
|
14640
|
+
MAX_LENGTH,
|
|
14641
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
14642
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
14643
|
+
MAX_SAFE_INTEGER,
|
|
14644
|
+
RELEASE_TYPES,
|
|
14645
|
+
SEMVER_SPEC_VERSION,
|
|
14646
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
14647
|
+
FLAG_LOOSE: 2
|
|
14648
|
+
};
|
|
14649
|
+
}
|
|
14650
|
+
});
|
|
14651
|
+
|
|
14652
|
+
// ../../node_modules/semver/internal/debug.js
|
|
14653
|
+
var require_debug = __commonJS({
|
|
14654
|
+
"../../node_modules/semver/internal/debug.js"(exports, module) {
|
|
14655
|
+
"use strict";
|
|
14656
|
+
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
14657
|
+
};
|
|
14658
|
+
module.exports = debug;
|
|
14659
|
+
}
|
|
14660
|
+
});
|
|
14661
|
+
|
|
14662
|
+
// ../../node_modules/semver/internal/re.js
|
|
14663
|
+
var require_re = __commonJS({
|
|
14664
|
+
"../../node_modules/semver/internal/re.js"(exports, module) {
|
|
14665
|
+
"use strict";
|
|
14666
|
+
var {
|
|
14667
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
14668
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
14669
|
+
MAX_LENGTH
|
|
14670
|
+
} = require_constants();
|
|
14671
|
+
var debug = require_debug();
|
|
14672
|
+
exports = module.exports = {};
|
|
14673
|
+
var re = exports.re = [];
|
|
14674
|
+
var safeRe = exports.safeRe = [];
|
|
14675
|
+
var src = exports.src = [];
|
|
14676
|
+
var safeSrc = exports.safeSrc = [];
|
|
14677
|
+
var t = exports.t = {};
|
|
14678
|
+
var R = 0;
|
|
14679
|
+
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
14680
|
+
var safeRegexReplacements = [
|
|
14681
|
+
["\\s", 1],
|
|
14682
|
+
["\\d", MAX_LENGTH],
|
|
14683
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
14684
|
+
];
|
|
14685
|
+
var makeSafeRegex = (value) => {
|
|
14686
|
+
for (const [token, max] of safeRegexReplacements) {
|
|
14687
|
+
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
14688
|
+
}
|
|
14689
|
+
return value;
|
|
14690
|
+
};
|
|
14691
|
+
var createToken = (name, value, isGlobal) => {
|
|
14692
|
+
const safe = makeSafeRegex(value);
|
|
14693
|
+
const index = R++;
|
|
14694
|
+
debug(name, index, value);
|
|
14695
|
+
t[name] = index;
|
|
14696
|
+
src[index] = value;
|
|
14697
|
+
safeSrc[index] = safe;
|
|
14698
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
14699
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
14700
|
+
};
|
|
14701
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
14702
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
14703
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
14704
|
+
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
14705
|
+
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
14706
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
14707
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
14708
|
+
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
14709
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
14710
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
14711
|
+
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
14712
|
+
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
14713
|
+
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
14714
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
14715
|
+
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
14716
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
14717
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
14718
|
+
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
14719
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
14720
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
14721
|
+
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
14722
|
+
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
14723
|
+
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
14724
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
14725
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
14726
|
+
createToken("COERCERTL", src[t.COERCE], true);
|
|
14727
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
14728
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
14729
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
14730
|
+
exports.tildeTrimReplace = "$1~";
|
|
14731
|
+
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
14732
|
+
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
14733
|
+
createToken("LONECARET", "(?:\\^)");
|
|
14734
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
14735
|
+
exports.caretTrimReplace = "$1^";
|
|
14736
|
+
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
14737
|
+
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
14738
|
+
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
14739
|
+
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
14740
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
14741
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
14742
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
14743
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
14744
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
14745
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
14746
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
14747
|
+
}
|
|
14748
|
+
});
|
|
14749
|
+
|
|
14750
|
+
// ../../node_modules/semver/internal/parse-options.js
|
|
14751
|
+
var require_parse_options = __commonJS({
|
|
14752
|
+
"../../node_modules/semver/internal/parse-options.js"(exports, module) {
|
|
14753
|
+
"use strict";
|
|
14754
|
+
var looseOption = Object.freeze({ loose: true });
|
|
14755
|
+
var emptyOpts = Object.freeze({});
|
|
14756
|
+
var parseOptions = (options) => {
|
|
14757
|
+
if (!options) {
|
|
14758
|
+
return emptyOpts;
|
|
14759
|
+
}
|
|
14760
|
+
if (typeof options !== "object") {
|
|
14761
|
+
return looseOption;
|
|
14762
|
+
}
|
|
14763
|
+
return options;
|
|
14764
|
+
};
|
|
14765
|
+
module.exports = parseOptions;
|
|
14766
|
+
}
|
|
14767
|
+
});
|
|
14768
|
+
|
|
14769
|
+
// ../../node_modules/semver/internal/identifiers.js
|
|
14770
|
+
var require_identifiers = __commonJS({
|
|
14771
|
+
"../../node_modules/semver/internal/identifiers.js"(exports, module) {
|
|
14772
|
+
"use strict";
|
|
14773
|
+
var numeric = /^[0-9]+$/;
|
|
14774
|
+
var compareIdentifiers = (a, b) => {
|
|
14775
|
+
if (typeof a === "number" && typeof b === "number") {
|
|
14776
|
+
return a === b ? 0 : a < b ? -1 : 1;
|
|
14777
|
+
}
|
|
14778
|
+
const anum = numeric.test(a);
|
|
14779
|
+
const bnum = numeric.test(b);
|
|
14780
|
+
if (anum && bnum) {
|
|
14781
|
+
a = +a;
|
|
14782
|
+
b = +b;
|
|
14783
|
+
}
|
|
14784
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
14785
|
+
};
|
|
14786
|
+
var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
14787
|
+
module.exports = {
|
|
14788
|
+
compareIdentifiers,
|
|
14789
|
+
rcompareIdentifiers
|
|
14790
|
+
};
|
|
14791
|
+
}
|
|
14792
|
+
});
|
|
14793
|
+
|
|
14794
|
+
// ../../node_modules/semver/classes/semver.js
|
|
14795
|
+
var require_semver = __commonJS({
|
|
14796
|
+
"../../node_modules/semver/classes/semver.js"(exports, module) {
|
|
14797
|
+
"use strict";
|
|
14798
|
+
var debug = require_debug();
|
|
14799
|
+
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
14800
|
+
var { safeRe: re, t } = require_re();
|
|
14801
|
+
var parseOptions = require_parse_options();
|
|
14802
|
+
var { compareIdentifiers } = require_identifiers();
|
|
14803
|
+
var isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
14804
|
+
const identifiers = identifier.split(".");
|
|
14805
|
+
if (identifiers.length > prerelease.length) {
|
|
14806
|
+
return false;
|
|
14807
|
+
}
|
|
14808
|
+
for (let i = 0; i < identifiers.length; i++) {
|
|
14809
|
+
if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
|
|
14810
|
+
return false;
|
|
14811
|
+
}
|
|
14812
|
+
}
|
|
14813
|
+
return true;
|
|
14814
|
+
};
|
|
14815
|
+
var SemVer = class _SemVer {
|
|
14816
|
+
constructor(version2, options) {
|
|
14817
|
+
options = parseOptions(options);
|
|
14818
|
+
if (version2 instanceof _SemVer) {
|
|
14819
|
+
if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) {
|
|
14820
|
+
return version2;
|
|
14821
|
+
} else {
|
|
14822
|
+
version2 = version2.version;
|
|
14823
|
+
}
|
|
14824
|
+
} else if (typeof version2 !== "string") {
|
|
14825
|
+
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`);
|
|
14826
|
+
}
|
|
14827
|
+
if (version2.length > MAX_LENGTH) {
|
|
14828
|
+
throw new TypeError(
|
|
14829
|
+
`version is longer than ${MAX_LENGTH} characters`
|
|
14830
|
+
);
|
|
14831
|
+
}
|
|
14832
|
+
debug("SemVer", version2, options);
|
|
14833
|
+
this.options = options;
|
|
14834
|
+
this.loose = !!options.loose;
|
|
14835
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
14836
|
+
const m = version2.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
14837
|
+
if (!m) {
|
|
14838
|
+
throw new TypeError(`Invalid Version: ${version2}`);
|
|
14839
|
+
}
|
|
14840
|
+
this.raw = version2;
|
|
14841
|
+
this.major = +m[1];
|
|
14842
|
+
this.minor = +m[2];
|
|
14843
|
+
this.patch = +m[3];
|
|
14844
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
14845
|
+
throw new TypeError("Invalid major version");
|
|
14846
|
+
}
|
|
14847
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
14848
|
+
throw new TypeError("Invalid minor version");
|
|
14849
|
+
}
|
|
14850
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
14851
|
+
throw new TypeError("Invalid patch version");
|
|
14852
|
+
}
|
|
14853
|
+
if (!m[4]) {
|
|
14854
|
+
this.prerelease = [];
|
|
14855
|
+
} else {
|
|
14856
|
+
this.prerelease = m[4].split(".").map((id) => {
|
|
14857
|
+
if (/^[0-9]+$/.test(id)) {
|
|
14858
|
+
const num = +id;
|
|
14859
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
14860
|
+
return num;
|
|
14861
|
+
}
|
|
14862
|
+
}
|
|
14863
|
+
return id;
|
|
14864
|
+
});
|
|
14865
|
+
}
|
|
14866
|
+
this.build = m[5] ? m[5].split(".") : [];
|
|
14867
|
+
this.format();
|
|
14868
|
+
}
|
|
14869
|
+
format() {
|
|
14870
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
14871
|
+
if (this.prerelease.length) {
|
|
14872
|
+
this.version += `-${this.prerelease.join(".")}`;
|
|
14873
|
+
}
|
|
14874
|
+
return this.version;
|
|
14875
|
+
}
|
|
14876
|
+
toString() {
|
|
14877
|
+
return this.version;
|
|
14878
|
+
}
|
|
14879
|
+
compare(other) {
|
|
14880
|
+
debug("SemVer.compare", this.version, this.options, other);
|
|
14881
|
+
if (!(other instanceof _SemVer)) {
|
|
14882
|
+
if (typeof other === "string" && other === this.version) {
|
|
14883
|
+
return 0;
|
|
14884
|
+
}
|
|
14885
|
+
other = new _SemVer(other, this.options);
|
|
14886
|
+
}
|
|
14887
|
+
if (other.version === this.version) {
|
|
14888
|
+
return 0;
|
|
14889
|
+
}
|
|
14890
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
14891
|
+
}
|
|
14892
|
+
compareMain(other) {
|
|
14893
|
+
if (!(other instanceof _SemVer)) {
|
|
14894
|
+
other = new _SemVer(other, this.options);
|
|
14895
|
+
}
|
|
14896
|
+
if (this.major < other.major) {
|
|
14897
|
+
return -1;
|
|
14898
|
+
}
|
|
14899
|
+
if (this.major > other.major) {
|
|
14900
|
+
return 1;
|
|
14901
|
+
}
|
|
14902
|
+
if (this.minor < other.minor) {
|
|
14903
|
+
return -1;
|
|
14904
|
+
}
|
|
14905
|
+
if (this.minor > other.minor) {
|
|
14906
|
+
return 1;
|
|
14907
|
+
}
|
|
14908
|
+
if (this.patch < other.patch) {
|
|
14909
|
+
return -1;
|
|
14910
|
+
}
|
|
14911
|
+
if (this.patch > other.patch) {
|
|
14912
|
+
return 1;
|
|
14913
|
+
}
|
|
14914
|
+
return 0;
|
|
14915
|
+
}
|
|
14916
|
+
comparePre(other) {
|
|
14917
|
+
if (!(other instanceof _SemVer)) {
|
|
14918
|
+
other = new _SemVer(other, this.options);
|
|
14919
|
+
}
|
|
14920
|
+
if (this.prerelease.length && !other.prerelease.length) {
|
|
14921
|
+
return -1;
|
|
14922
|
+
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
14923
|
+
return 1;
|
|
14924
|
+
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
14925
|
+
return 0;
|
|
14926
|
+
}
|
|
14927
|
+
let i = 0;
|
|
14928
|
+
do {
|
|
14929
|
+
const a = this.prerelease[i];
|
|
14930
|
+
const b = other.prerelease[i];
|
|
14931
|
+
debug("prerelease compare", i, a, b);
|
|
14932
|
+
if (a === void 0 && b === void 0) {
|
|
14933
|
+
return 0;
|
|
14934
|
+
} else if (b === void 0) {
|
|
14935
|
+
return 1;
|
|
14936
|
+
} else if (a === void 0) {
|
|
14937
|
+
return -1;
|
|
14938
|
+
} else if (a === b) {
|
|
14939
|
+
continue;
|
|
14940
|
+
} else {
|
|
14941
|
+
return compareIdentifiers(a, b);
|
|
14942
|
+
}
|
|
14943
|
+
} while (++i);
|
|
14944
|
+
}
|
|
14945
|
+
compareBuild(other) {
|
|
14946
|
+
if (!(other instanceof _SemVer)) {
|
|
14947
|
+
other = new _SemVer(other, this.options);
|
|
14948
|
+
}
|
|
14949
|
+
let i = 0;
|
|
14950
|
+
do {
|
|
14951
|
+
const a = this.build[i];
|
|
14952
|
+
const b = other.build[i];
|
|
14953
|
+
debug("build compare", i, a, b);
|
|
14954
|
+
if (a === void 0 && b === void 0) {
|
|
14955
|
+
return 0;
|
|
14956
|
+
} else if (b === void 0) {
|
|
14957
|
+
return 1;
|
|
14958
|
+
} else if (a === void 0) {
|
|
14959
|
+
return -1;
|
|
14960
|
+
} else if (a === b) {
|
|
14961
|
+
continue;
|
|
14962
|
+
} else {
|
|
14963
|
+
return compareIdentifiers(a, b);
|
|
14964
|
+
}
|
|
14965
|
+
} while (++i);
|
|
14966
|
+
}
|
|
14967
|
+
// preminor will bump the version up to the next minor release, and immediately
|
|
14968
|
+
// down to pre-release. premajor and prepatch work the same way.
|
|
14969
|
+
inc(release, identifier, identifierBase) {
|
|
14970
|
+
if (release.startsWith("pre")) {
|
|
14971
|
+
if (!identifier && identifierBase === false) {
|
|
14972
|
+
throw new Error("invalid increment argument: identifier is empty");
|
|
14973
|
+
}
|
|
14974
|
+
if (identifier) {
|
|
14975
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
14976
|
+
if (!match || match[1] !== identifier) {
|
|
14977
|
+
throw new Error(`invalid identifier: ${identifier}`);
|
|
14978
|
+
}
|
|
14979
|
+
}
|
|
14980
|
+
}
|
|
14981
|
+
switch (release) {
|
|
14982
|
+
case "premajor":
|
|
14983
|
+
this.prerelease.length = 0;
|
|
14984
|
+
this.patch = 0;
|
|
14985
|
+
this.minor = 0;
|
|
14986
|
+
this.major++;
|
|
14987
|
+
this.inc("pre", identifier, identifierBase);
|
|
14988
|
+
break;
|
|
14989
|
+
case "preminor":
|
|
14990
|
+
this.prerelease.length = 0;
|
|
14991
|
+
this.patch = 0;
|
|
14992
|
+
this.minor++;
|
|
14993
|
+
this.inc("pre", identifier, identifierBase);
|
|
14994
|
+
break;
|
|
14995
|
+
case "prepatch":
|
|
14996
|
+
this.prerelease.length = 0;
|
|
14997
|
+
this.inc("patch", identifier, identifierBase);
|
|
14998
|
+
this.inc("pre", identifier, identifierBase);
|
|
14999
|
+
break;
|
|
15000
|
+
// If the input is a non-prerelease version, this acts the same as
|
|
15001
|
+
// prepatch.
|
|
15002
|
+
case "prerelease":
|
|
15003
|
+
if (this.prerelease.length === 0) {
|
|
15004
|
+
this.inc("patch", identifier, identifierBase);
|
|
15005
|
+
}
|
|
15006
|
+
this.inc("pre", identifier, identifierBase);
|
|
15007
|
+
break;
|
|
15008
|
+
case "release":
|
|
15009
|
+
if (this.prerelease.length === 0) {
|
|
15010
|
+
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
15011
|
+
}
|
|
15012
|
+
this.prerelease.length = 0;
|
|
15013
|
+
break;
|
|
15014
|
+
case "major":
|
|
15015
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
15016
|
+
this.major++;
|
|
15017
|
+
}
|
|
15018
|
+
this.minor = 0;
|
|
15019
|
+
this.patch = 0;
|
|
15020
|
+
this.prerelease = [];
|
|
15021
|
+
break;
|
|
15022
|
+
case "minor":
|
|
15023
|
+
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
15024
|
+
this.minor++;
|
|
15025
|
+
}
|
|
15026
|
+
this.patch = 0;
|
|
15027
|
+
this.prerelease = [];
|
|
15028
|
+
break;
|
|
15029
|
+
case "patch":
|
|
15030
|
+
if (this.prerelease.length === 0) {
|
|
15031
|
+
this.patch++;
|
|
15032
|
+
}
|
|
15033
|
+
this.prerelease = [];
|
|
15034
|
+
break;
|
|
15035
|
+
// This probably shouldn't be used publicly.
|
|
15036
|
+
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
15037
|
+
case "pre": {
|
|
15038
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
15039
|
+
if (this.prerelease.length === 0) {
|
|
15040
|
+
this.prerelease = [base];
|
|
15041
|
+
} else {
|
|
15042
|
+
let i = this.prerelease.length;
|
|
15043
|
+
while (--i >= 0) {
|
|
15044
|
+
if (typeof this.prerelease[i] === "number") {
|
|
15045
|
+
this.prerelease[i]++;
|
|
15046
|
+
i = -2;
|
|
15047
|
+
}
|
|
15048
|
+
}
|
|
15049
|
+
if (i === -1) {
|
|
15050
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
15051
|
+
throw new Error("invalid increment argument: identifier already exists");
|
|
15052
|
+
}
|
|
15053
|
+
this.prerelease.push(base);
|
|
15054
|
+
}
|
|
15055
|
+
}
|
|
15056
|
+
if (identifier) {
|
|
15057
|
+
let prerelease = [identifier, base];
|
|
15058
|
+
if (identifierBase === false) {
|
|
15059
|
+
prerelease = [identifier];
|
|
15060
|
+
}
|
|
15061
|
+
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
15062
|
+
const prereleaseBase = this.prerelease[identifier.split(".").length];
|
|
15063
|
+
if (isNaN(prereleaseBase)) {
|
|
15064
|
+
this.prerelease = prerelease;
|
|
15065
|
+
}
|
|
15066
|
+
} else {
|
|
15067
|
+
this.prerelease = prerelease;
|
|
15068
|
+
}
|
|
15069
|
+
}
|
|
15070
|
+
break;
|
|
15071
|
+
}
|
|
15072
|
+
default:
|
|
15073
|
+
throw new Error(`invalid increment argument: ${release}`);
|
|
15074
|
+
}
|
|
15075
|
+
this.raw = this.format();
|
|
15076
|
+
if (this.build.length) {
|
|
15077
|
+
this.raw += `+${this.build.join(".")}`;
|
|
15078
|
+
}
|
|
15079
|
+
return this;
|
|
15080
|
+
}
|
|
15081
|
+
};
|
|
15082
|
+
module.exports = SemVer;
|
|
15083
|
+
}
|
|
15084
|
+
});
|
|
15085
|
+
|
|
15086
|
+
// ../../node_modules/semver/functions/parse.js
|
|
15087
|
+
var require_parse = __commonJS({
|
|
15088
|
+
"../../node_modules/semver/functions/parse.js"(exports, module) {
|
|
15089
|
+
"use strict";
|
|
15090
|
+
var SemVer = require_semver();
|
|
15091
|
+
var parse4 = (version2, options, throwErrors = false) => {
|
|
15092
|
+
if (version2 instanceof SemVer) {
|
|
15093
|
+
return version2;
|
|
15094
|
+
}
|
|
15095
|
+
try {
|
|
15096
|
+
return new SemVer(version2, options);
|
|
15097
|
+
} catch (er) {
|
|
15098
|
+
if (!throwErrors) {
|
|
15099
|
+
return null;
|
|
15100
|
+
}
|
|
15101
|
+
throw er;
|
|
15102
|
+
}
|
|
15103
|
+
};
|
|
15104
|
+
module.exports = parse4;
|
|
15105
|
+
}
|
|
15106
|
+
});
|
|
15107
|
+
|
|
15108
|
+
// ../../node_modules/semver/functions/valid.js
|
|
15109
|
+
var require_valid = __commonJS({
|
|
15110
|
+
"../../node_modules/semver/functions/valid.js"(exports, module) {
|
|
15111
|
+
"use strict";
|
|
15112
|
+
var parse4 = require_parse();
|
|
15113
|
+
var valid = (version2, options) => {
|
|
15114
|
+
const v = parse4(version2, options);
|
|
15115
|
+
return v ? v.version : null;
|
|
15116
|
+
};
|
|
15117
|
+
module.exports = valid;
|
|
15118
|
+
}
|
|
15119
|
+
});
|
|
15120
|
+
|
|
15121
|
+
// ../../node_modules/semver/functions/clean.js
|
|
15122
|
+
var require_clean = __commonJS({
|
|
15123
|
+
"../../node_modules/semver/functions/clean.js"(exports, module) {
|
|
15124
|
+
"use strict";
|
|
15125
|
+
var parse4 = require_parse();
|
|
15126
|
+
var clean = (version2, options) => {
|
|
15127
|
+
const s = parse4(version2.trim().replace(/^[=v]+/, ""), options);
|
|
15128
|
+
return s ? s.version : null;
|
|
15129
|
+
};
|
|
15130
|
+
module.exports = clean;
|
|
15131
|
+
}
|
|
15132
|
+
});
|
|
15133
|
+
|
|
15134
|
+
// ../../node_modules/semver/functions/inc.js
|
|
15135
|
+
var require_inc = __commonJS({
|
|
15136
|
+
"../../node_modules/semver/functions/inc.js"(exports, module) {
|
|
15137
|
+
"use strict";
|
|
15138
|
+
var SemVer = require_semver();
|
|
15139
|
+
var inc = (version2, release, options, identifier, identifierBase) => {
|
|
15140
|
+
if (typeof options === "string") {
|
|
15141
|
+
identifierBase = identifier;
|
|
15142
|
+
identifier = options;
|
|
15143
|
+
options = void 0;
|
|
15144
|
+
}
|
|
15145
|
+
try {
|
|
15146
|
+
return new SemVer(
|
|
15147
|
+
version2 instanceof SemVer ? version2.version : version2,
|
|
15148
|
+
options
|
|
15149
|
+
).inc(release, identifier, identifierBase).version;
|
|
15150
|
+
} catch (er) {
|
|
15151
|
+
return null;
|
|
15152
|
+
}
|
|
15153
|
+
};
|
|
15154
|
+
module.exports = inc;
|
|
15155
|
+
}
|
|
15156
|
+
});
|
|
15157
|
+
|
|
15158
|
+
// ../../node_modules/semver/functions/diff.js
|
|
15159
|
+
var require_diff = __commonJS({
|
|
15160
|
+
"../../node_modules/semver/functions/diff.js"(exports, module) {
|
|
15161
|
+
"use strict";
|
|
15162
|
+
var parse4 = require_parse();
|
|
15163
|
+
var diff = (version1, version2) => {
|
|
15164
|
+
const v1 = parse4(version1, null, true);
|
|
15165
|
+
const v2 = parse4(version2, null, true);
|
|
15166
|
+
const comparison = v1.compare(v2);
|
|
15167
|
+
if (comparison === 0) {
|
|
15168
|
+
return null;
|
|
15169
|
+
}
|
|
15170
|
+
const v1Higher = comparison > 0;
|
|
15171
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
15172
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
15173
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
15174
|
+
const lowHasPre = !!lowVersion.prerelease.length;
|
|
15175
|
+
if (lowHasPre && !highHasPre) {
|
|
15176
|
+
if (!lowVersion.patch && !lowVersion.minor) {
|
|
15177
|
+
return "major";
|
|
15178
|
+
}
|
|
15179
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
15180
|
+
if (lowVersion.minor && !lowVersion.patch) {
|
|
15181
|
+
return "minor";
|
|
15182
|
+
}
|
|
15183
|
+
return "patch";
|
|
15184
|
+
}
|
|
15185
|
+
}
|
|
15186
|
+
const prefix = highHasPre ? "pre" : "";
|
|
15187
|
+
if (v1.major !== v2.major) {
|
|
15188
|
+
return prefix + "major";
|
|
15189
|
+
}
|
|
15190
|
+
if (v1.minor !== v2.minor) {
|
|
15191
|
+
return prefix + "minor";
|
|
15192
|
+
}
|
|
15193
|
+
if (v1.patch !== v2.patch) {
|
|
15194
|
+
return prefix + "patch";
|
|
15195
|
+
}
|
|
15196
|
+
return "prerelease";
|
|
15197
|
+
};
|
|
15198
|
+
module.exports = diff;
|
|
15199
|
+
}
|
|
15200
|
+
});
|
|
15201
|
+
|
|
15202
|
+
// ../../node_modules/semver/functions/major.js
|
|
15203
|
+
var require_major = __commonJS({
|
|
15204
|
+
"../../node_modules/semver/functions/major.js"(exports, module) {
|
|
15205
|
+
"use strict";
|
|
15206
|
+
var SemVer = require_semver();
|
|
15207
|
+
var major = (a, loose) => new SemVer(a, loose).major;
|
|
15208
|
+
module.exports = major;
|
|
15209
|
+
}
|
|
15210
|
+
});
|
|
15211
|
+
|
|
15212
|
+
// ../../node_modules/semver/functions/minor.js
|
|
15213
|
+
var require_minor = __commonJS({
|
|
15214
|
+
"../../node_modules/semver/functions/minor.js"(exports, module) {
|
|
15215
|
+
"use strict";
|
|
15216
|
+
var SemVer = require_semver();
|
|
15217
|
+
var minor = (a, loose) => new SemVer(a, loose).minor;
|
|
15218
|
+
module.exports = minor;
|
|
15219
|
+
}
|
|
15220
|
+
});
|
|
15221
|
+
|
|
15222
|
+
// ../../node_modules/semver/functions/patch.js
|
|
15223
|
+
var require_patch = __commonJS({
|
|
15224
|
+
"../../node_modules/semver/functions/patch.js"(exports, module) {
|
|
15225
|
+
"use strict";
|
|
15226
|
+
var SemVer = require_semver();
|
|
15227
|
+
var patch = (a, loose) => new SemVer(a, loose).patch;
|
|
15228
|
+
module.exports = patch;
|
|
15229
|
+
}
|
|
15230
|
+
});
|
|
15231
|
+
|
|
15232
|
+
// ../../node_modules/semver/functions/prerelease.js
|
|
15233
|
+
var require_prerelease = __commonJS({
|
|
15234
|
+
"../../node_modules/semver/functions/prerelease.js"(exports, module) {
|
|
15235
|
+
"use strict";
|
|
15236
|
+
var parse4 = require_parse();
|
|
15237
|
+
var prerelease = (version2, options) => {
|
|
15238
|
+
const parsed = parse4(version2, options);
|
|
15239
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
15240
|
+
};
|
|
15241
|
+
module.exports = prerelease;
|
|
15242
|
+
}
|
|
15243
|
+
});
|
|
15244
|
+
|
|
15245
|
+
// ../../node_modules/semver/functions/compare.js
|
|
15246
|
+
var require_compare = __commonJS({
|
|
15247
|
+
"../../node_modules/semver/functions/compare.js"(exports, module) {
|
|
15248
|
+
"use strict";
|
|
15249
|
+
var SemVer = require_semver();
|
|
15250
|
+
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
15251
|
+
module.exports = compare;
|
|
15252
|
+
}
|
|
15253
|
+
});
|
|
15254
|
+
|
|
15255
|
+
// ../../node_modules/semver/functions/rcompare.js
|
|
15256
|
+
var require_rcompare = __commonJS({
|
|
15257
|
+
"../../node_modules/semver/functions/rcompare.js"(exports, module) {
|
|
15258
|
+
"use strict";
|
|
15259
|
+
var compare = require_compare();
|
|
15260
|
+
var rcompare = (a, b, loose) => compare(b, a, loose);
|
|
15261
|
+
module.exports = rcompare;
|
|
15262
|
+
}
|
|
15263
|
+
});
|
|
15264
|
+
|
|
15265
|
+
// ../../node_modules/semver/functions/compare-loose.js
|
|
15266
|
+
var require_compare_loose = __commonJS({
|
|
15267
|
+
"../../node_modules/semver/functions/compare-loose.js"(exports, module) {
|
|
15268
|
+
"use strict";
|
|
15269
|
+
var compare = require_compare();
|
|
15270
|
+
var compareLoose = (a, b) => compare(a, b, true);
|
|
15271
|
+
module.exports = compareLoose;
|
|
15272
|
+
}
|
|
15273
|
+
});
|
|
15274
|
+
|
|
15275
|
+
// ../../node_modules/semver/functions/compare-build.js
|
|
15276
|
+
var require_compare_build = __commonJS({
|
|
15277
|
+
"../../node_modules/semver/functions/compare-build.js"(exports, module) {
|
|
15278
|
+
"use strict";
|
|
15279
|
+
var SemVer = require_semver();
|
|
15280
|
+
var compareBuild = (a, b, loose) => {
|
|
15281
|
+
const versionA = new SemVer(a, loose);
|
|
15282
|
+
const versionB = new SemVer(b, loose);
|
|
15283
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
15284
|
+
};
|
|
15285
|
+
module.exports = compareBuild;
|
|
15286
|
+
}
|
|
15287
|
+
});
|
|
15288
|
+
|
|
15289
|
+
// ../../node_modules/semver/functions/sort.js
|
|
15290
|
+
var require_sort = __commonJS({
|
|
15291
|
+
"../../node_modules/semver/functions/sort.js"(exports, module) {
|
|
15292
|
+
"use strict";
|
|
15293
|
+
var compareBuild = require_compare_build();
|
|
15294
|
+
var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
15295
|
+
module.exports = sort;
|
|
15296
|
+
}
|
|
15297
|
+
});
|
|
15298
|
+
|
|
15299
|
+
// ../../node_modules/semver/functions/rsort.js
|
|
15300
|
+
var require_rsort = __commonJS({
|
|
15301
|
+
"../../node_modules/semver/functions/rsort.js"(exports, module) {
|
|
15302
|
+
"use strict";
|
|
15303
|
+
var compareBuild = require_compare_build();
|
|
15304
|
+
var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
15305
|
+
module.exports = rsort;
|
|
15306
|
+
}
|
|
15307
|
+
});
|
|
15308
|
+
|
|
15309
|
+
// ../../node_modules/semver/functions/gt.js
|
|
15310
|
+
var require_gt = __commonJS({
|
|
15311
|
+
"../../node_modules/semver/functions/gt.js"(exports, module) {
|
|
15312
|
+
"use strict";
|
|
15313
|
+
var compare = require_compare();
|
|
15314
|
+
var gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
15315
|
+
module.exports = gt;
|
|
15316
|
+
}
|
|
15317
|
+
});
|
|
15318
|
+
|
|
15319
|
+
// ../../node_modules/semver/functions/lt.js
|
|
15320
|
+
var require_lt = __commonJS({
|
|
15321
|
+
"../../node_modules/semver/functions/lt.js"(exports, module) {
|
|
15322
|
+
"use strict";
|
|
15323
|
+
var compare = require_compare();
|
|
15324
|
+
var lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
15325
|
+
module.exports = lt;
|
|
15326
|
+
}
|
|
15327
|
+
});
|
|
15328
|
+
|
|
15329
|
+
// ../../node_modules/semver/functions/eq.js
|
|
15330
|
+
var require_eq = __commonJS({
|
|
15331
|
+
"../../node_modules/semver/functions/eq.js"(exports, module) {
|
|
15332
|
+
"use strict";
|
|
15333
|
+
var compare = require_compare();
|
|
15334
|
+
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
15335
|
+
module.exports = eq;
|
|
15336
|
+
}
|
|
15337
|
+
});
|
|
15338
|
+
|
|
15339
|
+
// ../../node_modules/semver/functions/neq.js
|
|
15340
|
+
var require_neq = __commonJS({
|
|
15341
|
+
"../../node_modules/semver/functions/neq.js"(exports, module) {
|
|
15342
|
+
"use strict";
|
|
15343
|
+
var compare = require_compare();
|
|
15344
|
+
var neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
15345
|
+
module.exports = neq;
|
|
15346
|
+
}
|
|
15347
|
+
});
|
|
15348
|
+
|
|
15349
|
+
// ../../node_modules/semver/functions/gte.js
|
|
15350
|
+
var require_gte = __commonJS({
|
|
15351
|
+
"../../node_modules/semver/functions/gte.js"(exports, module) {
|
|
15352
|
+
"use strict";
|
|
15353
|
+
var compare = require_compare();
|
|
15354
|
+
var gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
15355
|
+
module.exports = gte;
|
|
15356
|
+
}
|
|
15357
|
+
});
|
|
15358
|
+
|
|
15359
|
+
// ../../node_modules/semver/functions/lte.js
|
|
15360
|
+
var require_lte = __commonJS({
|
|
15361
|
+
"../../node_modules/semver/functions/lte.js"(exports, module) {
|
|
15362
|
+
"use strict";
|
|
15363
|
+
var compare = require_compare();
|
|
15364
|
+
var lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
15365
|
+
module.exports = lte;
|
|
15366
|
+
}
|
|
15367
|
+
});
|
|
15368
|
+
|
|
15369
|
+
// ../../node_modules/semver/functions/cmp.js
|
|
15370
|
+
var require_cmp = __commonJS({
|
|
15371
|
+
"../../node_modules/semver/functions/cmp.js"(exports, module) {
|
|
15372
|
+
"use strict";
|
|
15373
|
+
var eq = require_eq();
|
|
15374
|
+
var neq = require_neq();
|
|
15375
|
+
var gt = require_gt();
|
|
15376
|
+
var gte = require_gte();
|
|
15377
|
+
var lt = require_lt();
|
|
15378
|
+
var lte = require_lte();
|
|
15379
|
+
var cmp = (a, op, b, loose) => {
|
|
15380
|
+
switch (op) {
|
|
15381
|
+
case "===":
|
|
15382
|
+
if (typeof a === "object") {
|
|
15383
|
+
a = a.version;
|
|
15384
|
+
}
|
|
15385
|
+
if (typeof b === "object") {
|
|
15386
|
+
b = b.version;
|
|
15387
|
+
}
|
|
15388
|
+
return a === b;
|
|
15389
|
+
case "!==":
|
|
15390
|
+
if (typeof a === "object") {
|
|
15391
|
+
a = a.version;
|
|
15392
|
+
}
|
|
15393
|
+
if (typeof b === "object") {
|
|
15394
|
+
b = b.version;
|
|
15395
|
+
}
|
|
15396
|
+
return a !== b;
|
|
15397
|
+
case "":
|
|
15398
|
+
case "=":
|
|
15399
|
+
case "==":
|
|
15400
|
+
return eq(a, b, loose);
|
|
15401
|
+
case "!=":
|
|
15402
|
+
return neq(a, b, loose);
|
|
15403
|
+
case ">":
|
|
15404
|
+
return gt(a, b, loose);
|
|
15405
|
+
case ">=":
|
|
15406
|
+
return gte(a, b, loose);
|
|
15407
|
+
case "<":
|
|
15408
|
+
return lt(a, b, loose);
|
|
15409
|
+
case "<=":
|
|
15410
|
+
return lte(a, b, loose);
|
|
15411
|
+
default:
|
|
15412
|
+
throw new TypeError(`Invalid operator: ${op}`);
|
|
15413
|
+
}
|
|
15414
|
+
};
|
|
15415
|
+
module.exports = cmp;
|
|
15416
|
+
}
|
|
15417
|
+
});
|
|
15418
|
+
|
|
15419
|
+
// ../../node_modules/semver/functions/coerce.js
|
|
15420
|
+
var require_coerce = __commonJS({
|
|
15421
|
+
"../../node_modules/semver/functions/coerce.js"(exports, module) {
|
|
15422
|
+
"use strict";
|
|
15423
|
+
var SemVer = require_semver();
|
|
15424
|
+
var parse4 = require_parse();
|
|
15425
|
+
var { safeRe: re, t } = require_re();
|
|
15426
|
+
var coerce = (version2, options) => {
|
|
15427
|
+
if (version2 instanceof SemVer) {
|
|
15428
|
+
return version2;
|
|
15429
|
+
}
|
|
15430
|
+
if (typeof version2 === "number") {
|
|
15431
|
+
version2 = String(version2);
|
|
15432
|
+
}
|
|
15433
|
+
if (typeof version2 !== "string") {
|
|
15434
|
+
return null;
|
|
15435
|
+
}
|
|
15436
|
+
options = options || {};
|
|
15437
|
+
let match = null;
|
|
15438
|
+
if (!options.rtl) {
|
|
15439
|
+
match = version2.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
15440
|
+
} else {
|
|
15441
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
15442
|
+
let next;
|
|
15443
|
+
while ((next = coerceRtlRegex.exec(version2)) && (!match || match.index + match[0].length !== version2.length)) {
|
|
15444
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
15445
|
+
match = next;
|
|
15446
|
+
}
|
|
15447
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
15448
|
+
}
|
|
15449
|
+
coerceRtlRegex.lastIndex = -1;
|
|
15450
|
+
}
|
|
15451
|
+
if (match === null) {
|
|
15452
|
+
return null;
|
|
15453
|
+
}
|
|
15454
|
+
const major = match[2];
|
|
15455
|
+
const minor = match[3] || "0";
|
|
15456
|
+
const patch = match[4] || "0";
|
|
15457
|
+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
15458
|
+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
15459
|
+
return parse4(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
15460
|
+
};
|
|
15461
|
+
module.exports = coerce;
|
|
15462
|
+
}
|
|
15463
|
+
});
|
|
15464
|
+
|
|
15465
|
+
// ../../node_modules/semver/functions/truncate.js
|
|
15466
|
+
var require_truncate = __commonJS({
|
|
15467
|
+
"../../node_modules/semver/functions/truncate.js"(exports, module) {
|
|
15468
|
+
"use strict";
|
|
15469
|
+
var parse4 = require_parse();
|
|
15470
|
+
var constants2 = require_constants();
|
|
15471
|
+
var SemVer = require_semver();
|
|
15472
|
+
var truncate = (version2, truncation, options) => {
|
|
15473
|
+
if (!constants2.RELEASE_TYPES.includes(truncation)) {
|
|
15474
|
+
return null;
|
|
15475
|
+
}
|
|
15476
|
+
const clonedVersion = cloneInputVersion(version2, options);
|
|
15477
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
15478
|
+
};
|
|
15479
|
+
var cloneInputVersion = (version2, options) => {
|
|
15480
|
+
const versionStringToParse = version2 instanceof SemVer ? version2.version : version2;
|
|
15481
|
+
return parse4(versionStringToParse, options);
|
|
15482
|
+
};
|
|
15483
|
+
var doTruncation = (version2, truncation) => {
|
|
15484
|
+
if (isPrerelease(truncation)) {
|
|
15485
|
+
return version2.version;
|
|
15486
|
+
}
|
|
15487
|
+
version2.prerelease = [];
|
|
15488
|
+
switch (truncation) {
|
|
15489
|
+
case "major":
|
|
15490
|
+
version2.minor = 0;
|
|
15491
|
+
version2.patch = 0;
|
|
15492
|
+
break;
|
|
15493
|
+
case "minor":
|
|
15494
|
+
version2.patch = 0;
|
|
15495
|
+
break;
|
|
15496
|
+
}
|
|
15497
|
+
return version2.format();
|
|
15498
|
+
};
|
|
15499
|
+
var isPrerelease = (type) => {
|
|
15500
|
+
return type.startsWith("pre");
|
|
15501
|
+
};
|
|
15502
|
+
module.exports = truncate;
|
|
15503
|
+
}
|
|
15504
|
+
});
|
|
15505
|
+
|
|
15506
|
+
// ../../node_modules/semver/internal/lrucache.js
|
|
15507
|
+
var require_lrucache = __commonJS({
|
|
15508
|
+
"../../node_modules/semver/internal/lrucache.js"(exports, module) {
|
|
15509
|
+
"use strict";
|
|
15510
|
+
var LRUCache = class {
|
|
15511
|
+
constructor() {
|
|
15512
|
+
this.max = 1e3;
|
|
15513
|
+
this.map = /* @__PURE__ */ new Map();
|
|
15514
|
+
}
|
|
15515
|
+
get(key) {
|
|
15516
|
+
const value = this.map.get(key);
|
|
15517
|
+
if (value === void 0) {
|
|
15518
|
+
return void 0;
|
|
15519
|
+
} else {
|
|
15520
|
+
this.map.delete(key);
|
|
15521
|
+
this.map.set(key, value);
|
|
15522
|
+
return value;
|
|
15523
|
+
}
|
|
15524
|
+
}
|
|
15525
|
+
delete(key) {
|
|
15526
|
+
return this.map.delete(key);
|
|
15527
|
+
}
|
|
15528
|
+
set(key, value) {
|
|
15529
|
+
const deleted = this.delete(key);
|
|
15530
|
+
if (!deleted && value !== void 0) {
|
|
15531
|
+
if (this.map.size >= this.max) {
|
|
15532
|
+
const firstKey = this.map.keys().next().value;
|
|
15533
|
+
this.delete(firstKey);
|
|
15534
|
+
}
|
|
15535
|
+
this.map.set(key, value);
|
|
15536
|
+
}
|
|
15537
|
+
return this;
|
|
15538
|
+
}
|
|
15539
|
+
};
|
|
15540
|
+
module.exports = LRUCache;
|
|
15541
|
+
}
|
|
15542
|
+
});
|
|
15543
|
+
|
|
15544
|
+
// ../../node_modules/semver/classes/range.js
|
|
15545
|
+
var require_range = __commonJS({
|
|
15546
|
+
"../../node_modules/semver/classes/range.js"(exports, module) {
|
|
15547
|
+
"use strict";
|
|
15548
|
+
var SPACE_CHARACTERS = /\s+/g;
|
|
15549
|
+
var Range = class _Range {
|
|
15550
|
+
constructor(range, options) {
|
|
15551
|
+
options = parseOptions(options);
|
|
15552
|
+
if (range instanceof _Range) {
|
|
15553
|
+
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
15554
|
+
return range;
|
|
15555
|
+
} else {
|
|
15556
|
+
return new _Range(range.raw, options);
|
|
15557
|
+
}
|
|
15558
|
+
}
|
|
15559
|
+
if (range instanceof Comparator) {
|
|
15560
|
+
this.raw = range.value;
|
|
15561
|
+
this.set = [[range]];
|
|
15562
|
+
this.formatted = void 0;
|
|
15563
|
+
return this;
|
|
15564
|
+
}
|
|
15565
|
+
this.options = options;
|
|
15566
|
+
this.loose = !!options.loose;
|
|
15567
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
15568
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
15569
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
15570
|
+
if (!this.set.length) {
|
|
15571
|
+
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
15572
|
+
}
|
|
15573
|
+
if (this.set.length > 1) {
|
|
15574
|
+
const first = this.set[0];
|
|
15575
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
15576
|
+
if (this.set.length === 0) {
|
|
15577
|
+
this.set = [first];
|
|
15578
|
+
} else if (this.set.length > 1) {
|
|
15579
|
+
for (const c of this.set) {
|
|
15580
|
+
if (c.length === 1 && isAny(c[0])) {
|
|
15581
|
+
this.set = [c];
|
|
15582
|
+
break;
|
|
15583
|
+
}
|
|
15584
|
+
}
|
|
15585
|
+
}
|
|
15586
|
+
}
|
|
15587
|
+
this.formatted = void 0;
|
|
15588
|
+
}
|
|
15589
|
+
get range() {
|
|
15590
|
+
if (this.formatted === void 0) {
|
|
15591
|
+
this.formatted = "";
|
|
15592
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
15593
|
+
if (i > 0) {
|
|
15594
|
+
this.formatted += "||";
|
|
15595
|
+
}
|
|
15596
|
+
const comps = this.set[i];
|
|
15597
|
+
for (let k = 0; k < comps.length; k++) {
|
|
15598
|
+
if (k > 0) {
|
|
15599
|
+
this.formatted += " ";
|
|
15600
|
+
}
|
|
15601
|
+
this.formatted += comps[k].toString().trim();
|
|
15602
|
+
}
|
|
15603
|
+
}
|
|
15604
|
+
}
|
|
15605
|
+
return this.formatted;
|
|
15606
|
+
}
|
|
15607
|
+
format() {
|
|
15608
|
+
return this.range;
|
|
15609
|
+
}
|
|
15610
|
+
toString() {
|
|
15611
|
+
return this.range;
|
|
15612
|
+
}
|
|
15613
|
+
parseRange(range) {
|
|
15614
|
+
range = range.replace(BUILDSTRIPRE, "");
|
|
15615
|
+
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
15616
|
+
const memoKey = memoOpts + ":" + range;
|
|
15617
|
+
const cached2 = cache2.get(memoKey);
|
|
15618
|
+
if (cached2) {
|
|
15619
|
+
return cached2;
|
|
15620
|
+
}
|
|
15621
|
+
const loose = this.options.loose;
|
|
15622
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
15623
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
15624
|
+
debug("hyphen replace", range);
|
|
15625
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
15626
|
+
debug("comparator trim", range);
|
|
15627
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
15628
|
+
debug("tilde trim", range);
|
|
15629
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
15630
|
+
debug("caret trim", range);
|
|
15631
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
15632
|
+
if (loose) {
|
|
15633
|
+
rangeList = rangeList.filter((comp) => {
|
|
15634
|
+
debug("loose invalid filter", comp, this.options);
|
|
15635
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
15636
|
+
});
|
|
15637
|
+
}
|
|
15638
|
+
debug("range list", rangeList);
|
|
15639
|
+
const rangeMap = /* @__PURE__ */ new Map();
|
|
15640
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
15641
|
+
for (const comp of comparators) {
|
|
15642
|
+
if (isNullSet(comp)) {
|
|
15643
|
+
return [comp];
|
|
15644
|
+
}
|
|
15645
|
+
rangeMap.set(comp.value, comp);
|
|
15646
|
+
}
|
|
15647
|
+
if (rangeMap.size > 1 && rangeMap.has("")) {
|
|
15648
|
+
rangeMap.delete("");
|
|
15649
|
+
}
|
|
15650
|
+
const result = [...rangeMap.values()];
|
|
15651
|
+
cache2.set(memoKey, result);
|
|
15652
|
+
return result;
|
|
15653
|
+
}
|
|
15654
|
+
intersects(range, options) {
|
|
15655
|
+
if (!(range instanceof _Range)) {
|
|
15656
|
+
throw new TypeError("a Range is required");
|
|
15657
|
+
}
|
|
15658
|
+
return this.set.some((thisComparators) => {
|
|
15659
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
15660
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
15661
|
+
return rangeComparators.every((rangeComparator) => {
|
|
15662
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
15663
|
+
});
|
|
15664
|
+
});
|
|
15665
|
+
});
|
|
15666
|
+
});
|
|
15667
|
+
}
|
|
15668
|
+
// if ANY of the sets match ALL of its comparators, then pass
|
|
15669
|
+
test(version2) {
|
|
15670
|
+
if (!version2) {
|
|
15671
|
+
return false;
|
|
15672
|
+
}
|
|
15673
|
+
if (typeof version2 === "string") {
|
|
15674
|
+
try {
|
|
15675
|
+
version2 = new SemVer(version2, this.options);
|
|
15676
|
+
} catch (er) {
|
|
15677
|
+
return false;
|
|
15678
|
+
}
|
|
15679
|
+
}
|
|
15680
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
15681
|
+
if (testSet(this.set[i], version2, this.options)) {
|
|
15682
|
+
return true;
|
|
15683
|
+
}
|
|
15684
|
+
}
|
|
15685
|
+
return false;
|
|
15686
|
+
}
|
|
15687
|
+
};
|
|
15688
|
+
module.exports = Range;
|
|
15689
|
+
var LRU = require_lrucache();
|
|
15690
|
+
var cache2 = new LRU();
|
|
15691
|
+
var parseOptions = require_parse_options();
|
|
15692
|
+
var Comparator = require_comparator();
|
|
15693
|
+
var debug = require_debug();
|
|
15694
|
+
var SemVer = require_semver();
|
|
15695
|
+
var {
|
|
15696
|
+
safeRe: re,
|
|
15697
|
+
src,
|
|
15698
|
+
t,
|
|
15699
|
+
comparatorTrimReplace,
|
|
15700
|
+
tildeTrimReplace,
|
|
15701
|
+
caretTrimReplace
|
|
15702
|
+
} = require_re();
|
|
15703
|
+
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
15704
|
+
var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
|
|
15705
|
+
var isNullSet = (c) => c.value === "<0.0.0-0";
|
|
15706
|
+
var isAny = (c) => c.value === "";
|
|
15707
|
+
var isSatisfiable = (comparators, options) => {
|
|
15708
|
+
let result = true;
|
|
15709
|
+
const remainingComparators = comparators.slice();
|
|
15710
|
+
let testComparator = remainingComparators.pop();
|
|
15711
|
+
while (result && remainingComparators.length) {
|
|
15712
|
+
result = remainingComparators.every((otherComparator) => {
|
|
15713
|
+
return testComparator.intersects(otherComparator, options);
|
|
15714
|
+
});
|
|
15715
|
+
testComparator = remainingComparators.pop();
|
|
15716
|
+
}
|
|
15717
|
+
return result;
|
|
15718
|
+
};
|
|
15719
|
+
var parseComparator = (comp, options) => {
|
|
15720
|
+
comp = comp.replace(re[t.BUILD], "");
|
|
15721
|
+
debug("comp", comp, options);
|
|
15722
|
+
comp = replaceCarets(comp, options);
|
|
15723
|
+
debug("caret", comp);
|
|
15724
|
+
comp = replaceTildes(comp, options);
|
|
15725
|
+
debug("tildes", comp);
|
|
15726
|
+
comp = replaceXRanges(comp, options);
|
|
15727
|
+
debug("xrange", comp);
|
|
15728
|
+
comp = replaceStars(comp, options);
|
|
15729
|
+
debug("stars", comp);
|
|
15730
|
+
return comp;
|
|
15731
|
+
};
|
|
15732
|
+
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
15733
|
+
var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
|
|
15734
|
+
var replaceTildes = (comp, options) => {
|
|
15735
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
15736
|
+
};
|
|
15737
|
+
var replaceTilde = (comp, options) => {
|
|
15738
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
15739
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
15740
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
15741
|
+
debug("tilde", comp, _, M, m, p, pr);
|
|
15742
|
+
let ret;
|
|
15743
|
+
if (isX(M)) {
|
|
15744
|
+
ret = "";
|
|
15745
|
+
} else if (isX(m)) {
|
|
15746
|
+
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
15747
|
+
} else if (isX(p)) {
|
|
15748
|
+
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
15749
|
+
} else if (pr) {
|
|
15750
|
+
debug("replaceTilde pr", pr);
|
|
15751
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
15752
|
+
} else {
|
|
15753
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
15754
|
+
}
|
|
15755
|
+
debug("tilde return", ret);
|
|
15756
|
+
return ret;
|
|
15757
|
+
});
|
|
15758
|
+
};
|
|
15759
|
+
var replaceCarets = (comp, options) => {
|
|
15760
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
15761
|
+
};
|
|
15762
|
+
var replaceCaret = (comp, options) => {
|
|
15763
|
+
debug("caret", comp, options);
|
|
15764
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
15765
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
15766
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
15767
|
+
debug("caret", comp, _, M, m, p, pr);
|
|
15768
|
+
let ret;
|
|
15769
|
+
if (isX(M)) {
|
|
15770
|
+
ret = "";
|
|
15771
|
+
} else if (isX(m)) {
|
|
15772
|
+
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
15773
|
+
} else if (isX(p)) {
|
|
15774
|
+
if (M === "0") {
|
|
15775
|
+
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
15776
|
+
} else {
|
|
15777
|
+
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
15778
|
+
}
|
|
15779
|
+
} else if (pr) {
|
|
15780
|
+
debug("replaceCaret pr", pr);
|
|
15781
|
+
if (M === "0") {
|
|
15782
|
+
if (m === "0") {
|
|
15783
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
15784
|
+
} else {
|
|
15785
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
15786
|
+
}
|
|
15787
|
+
} else {
|
|
15788
|
+
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
15789
|
+
}
|
|
15790
|
+
} else {
|
|
15791
|
+
debug("no pr");
|
|
15792
|
+
if (M === "0") {
|
|
15793
|
+
if (m === "0") {
|
|
15794
|
+
ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
|
|
15795
|
+
} else {
|
|
15796
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
15797
|
+
}
|
|
15798
|
+
} else {
|
|
15799
|
+
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
15800
|
+
}
|
|
15801
|
+
}
|
|
15802
|
+
debug("caret return", ret);
|
|
15803
|
+
return ret;
|
|
15804
|
+
});
|
|
15805
|
+
};
|
|
15806
|
+
var replaceXRanges = (comp, options) => {
|
|
15807
|
+
debug("replaceXRanges", comp, options);
|
|
15808
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
15809
|
+
};
|
|
15810
|
+
var replaceXRange = (comp, options) => {
|
|
15811
|
+
comp = comp.trim();
|
|
15812
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
15813
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
15814
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
15815
|
+
if (invalidXRangeOrder(M, m, p)) {
|
|
15816
|
+
return comp;
|
|
15817
|
+
}
|
|
15818
|
+
const xM = isX(M);
|
|
15819
|
+
const xm = xM || isX(m);
|
|
15820
|
+
const xp = xm || isX(p);
|
|
15821
|
+
const anyX = xp;
|
|
15822
|
+
if (gtlt === "=" && anyX) {
|
|
15823
|
+
gtlt = "";
|
|
15824
|
+
}
|
|
15825
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
15826
|
+
if (xM) {
|
|
15827
|
+
if (gtlt === ">" || gtlt === "<") {
|
|
15828
|
+
ret = "<0.0.0-0";
|
|
15829
|
+
} else {
|
|
15830
|
+
ret = "*";
|
|
15831
|
+
}
|
|
15832
|
+
} else if (gtlt && anyX) {
|
|
15833
|
+
if (xm) {
|
|
15834
|
+
m = 0;
|
|
15835
|
+
}
|
|
15836
|
+
p = 0;
|
|
15837
|
+
if (gtlt === ">") {
|
|
15838
|
+
gtlt = ">=";
|
|
15839
|
+
if (xm) {
|
|
15840
|
+
M = +M + 1;
|
|
15841
|
+
m = 0;
|
|
15842
|
+
p = 0;
|
|
15843
|
+
} else {
|
|
15844
|
+
m = +m + 1;
|
|
15845
|
+
p = 0;
|
|
15846
|
+
}
|
|
15847
|
+
} else if (gtlt === "<=") {
|
|
15848
|
+
gtlt = "<";
|
|
15849
|
+
if (xm) {
|
|
15850
|
+
M = +M + 1;
|
|
15851
|
+
} else {
|
|
15852
|
+
m = +m + 1;
|
|
15853
|
+
}
|
|
15854
|
+
}
|
|
15855
|
+
if (gtlt === "<") {
|
|
15856
|
+
pr = "-0";
|
|
15857
|
+
}
|
|
15858
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
15859
|
+
} else if (xm) {
|
|
15860
|
+
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
15861
|
+
} else if (xp) {
|
|
15862
|
+
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
15863
|
+
}
|
|
15864
|
+
debug("xRange return", ret);
|
|
15865
|
+
return ret;
|
|
15866
|
+
});
|
|
15867
|
+
};
|
|
15868
|
+
var replaceStars = (comp, options) => {
|
|
15869
|
+
debug("replaceStars", comp, options);
|
|
15870
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
15871
|
+
};
|
|
15872
|
+
var replaceGTE0 = (comp, options) => {
|
|
15873
|
+
debug("replaceGTE0", comp, options);
|
|
15874
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
15875
|
+
};
|
|
15876
|
+
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
15877
|
+
if (isX(fM)) {
|
|
15878
|
+
from = "";
|
|
15879
|
+
} else if (isX(fm)) {
|
|
15880
|
+
from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
15881
|
+
} else if (isX(fp)) {
|
|
15882
|
+
from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
15883
|
+
} else if (fpr) {
|
|
15884
|
+
from = `>=${from}`;
|
|
15885
|
+
} else {
|
|
15886
|
+
from = `>=${from}${incPr ? "-0" : ""}`;
|
|
15887
|
+
}
|
|
15888
|
+
if (isX(tM)) {
|
|
15889
|
+
to = "";
|
|
15890
|
+
} else if (isX(tm)) {
|
|
15891
|
+
to = `<${+tM + 1}.0.0-0`;
|
|
15892
|
+
} else if (isX(tp)) {
|
|
15893
|
+
to = `<${tM}.${+tm + 1}.0-0`;
|
|
15894
|
+
} else if (tpr) {
|
|
15895
|
+
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
15896
|
+
} else if (incPr) {
|
|
15897
|
+
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
15898
|
+
} else {
|
|
15899
|
+
to = `<=${to}`;
|
|
15900
|
+
}
|
|
15901
|
+
return `${from} ${to}`.trim();
|
|
15902
|
+
};
|
|
15903
|
+
var testSet = (set, version2, options) => {
|
|
15904
|
+
for (let i = 0; i < set.length; i++) {
|
|
15905
|
+
if (!set[i].test(version2)) {
|
|
15906
|
+
return false;
|
|
15907
|
+
}
|
|
15908
|
+
}
|
|
15909
|
+
if (version2.prerelease.length && !options.includePrerelease) {
|
|
15910
|
+
for (let i = 0; i < set.length; i++) {
|
|
15911
|
+
debug(set[i].semver);
|
|
15912
|
+
if (set[i].semver === Comparator.ANY) {
|
|
15913
|
+
continue;
|
|
15914
|
+
}
|
|
15915
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
15916
|
+
const allowed = set[i].semver;
|
|
15917
|
+
if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) {
|
|
15918
|
+
return true;
|
|
15919
|
+
}
|
|
15920
|
+
}
|
|
15921
|
+
}
|
|
15922
|
+
return false;
|
|
15923
|
+
}
|
|
15924
|
+
return true;
|
|
15925
|
+
};
|
|
15926
|
+
}
|
|
15927
|
+
});
|
|
15928
|
+
|
|
15929
|
+
// ../../node_modules/semver/classes/comparator.js
|
|
15930
|
+
var require_comparator = __commonJS({
|
|
15931
|
+
"../../node_modules/semver/classes/comparator.js"(exports, module) {
|
|
15932
|
+
"use strict";
|
|
15933
|
+
var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
|
|
15934
|
+
var Comparator = class _Comparator {
|
|
15935
|
+
static get ANY() {
|
|
15936
|
+
return ANY;
|
|
15937
|
+
}
|
|
15938
|
+
constructor(comp, options) {
|
|
15939
|
+
options = parseOptions(options);
|
|
15940
|
+
if (comp instanceof _Comparator) {
|
|
15941
|
+
if (comp.loose === !!options.loose) {
|
|
15942
|
+
return comp;
|
|
15943
|
+
} else {
|
|
15944
|
+
comp = comp.value;
|
|
15945
|
+
}
|
|
15946
|
+
}
|
|
15947
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
15948
|
+
debug("comparator", comp, options);
|
|
15949
|
+
this.options = options;
|
|
15950
|
+
this.loose = !!options.loose;
|
|
15951
|
+
this.parse(comp);
|
|
15952
|
+
if (this.semver === ANY) {
|
|
15953
|
+
this.value = "";
|
|
15954
|
+
} else {
|
|
15955
|
+
this.value = this.operator + this.semver.version;
|
|
15956
|
+
}
|
|
15957
|
+
debug("comp", this);
|
|
15958
|
+
}
|
|
15959
|
+
parse(comp) {
|
|
15960
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
15961
|
+
const m = comp.match(r);
|
|
15962
|
+
if (!m) {
|
|
15963
|
+
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
15964
|
+
}
|
|
15965
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
15966
|
+
if (this.operator === "=") {
|
|
15967
|
+
this.operator = "";
|
|
15968
|
+
}
|
|
15969
|
+
if (!m[2]) {
|
|
15970
|
+
this.semver = ANY;
|
|
15971
|
+
} else {
|
|
15972
|
+
this.semver = new SemVer(m[2], this.options.loose);
|
|
15973
|
+
}
|
|
15974
|
+
}
|
|
15975
|
+
toString() {
|
|
15976
|
+
return this.value;
|
|
15977
|
+
}
|
|
15978
|
+
test(version2) {
|
|
15979
|
+
debug("Comparator.test", version2, this.options.loose);
|
|
15980
|
+
if (this.semver === ANY || version2 === ANY) {
|
|
15981
|
+
return true;
|
|
15982
|
+
}
|
|
15983
|
+
if (typeof version2 === "string") {
|
|
15984
|
+
try {
|
|
15985
|
+
version2 = new SemVer(version2, this.options);
|
|
15986
|
+
} catch (er) {
|
|
15987
|
+
return false;
|
|
15988
|
+
}
|
|
15989
|
+
}
|
|
15990
|
+
return cmp(version2, this.operator, this.semver, this.options);
|
|
15991
|
+
}
|
|
15992
|
+
intersects(comp, options) {
|
|
15993
|
+
if (!(comp instanceof _Comparator)) {
|
|
15994
|
+
throw new TypeError("a Comparator is required");
|
|
15995
|
+
}
|
|
15996
|
+
if (this.operator === "") {
|
|
15997
|
+
if (this.value === "") {
|
|
15998
|
+
return true;
|
|
15999
|
+
}
|
|
16000
|
+
return new Range(comp.value, options).test(this.value);
|
|
16001
|
+
} else if (comp.operator === "") {
|
|
16002
|
+
if (comp.value === "") {
|
|
16003
|
+
return true;
|
|
16004
|
+
}
|
|
16005
|
+
return new Range(this.value, options).test(comp.semver);
|
|
16006
|
+
}
|
|
16007
|
+
options = parseOptions(options);
|
|
16008
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
16009
|
+
return false;
|
|
16010
|
+
}
|
|
16011
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
16012
|
+
return false;
|
|
16013
|
+
}
|
|
16014
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
16015
|
+
return true;
|
|
16016
|
+
}
|
|
16017
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
16018
|
+
return true;
|
|
16019
|
+
}
|
|
16020
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
16021
|
+
return true;
|
|
16022
|
+
}
|
|
16023
|
+
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
16024
|
+
return true;
|
|
16025
|
+
}
|
|
16026
|
+
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
16027
|
+
return true;
|
|
16028
|
+
}
|
|
16029
|
+
return false;
|
|
16030
|
+
}
|
|
16031
|
+
};
|
|
16032
|
+
module.exports = Comparator;
|
|
16033
|
+
var parseOptions = require_parse_options();
|
|
16034
|
+
var { safeRe: re, t } = require_re();
|
|
16035
|
+
var cmp = require_cmp();
|
|
16036
|
+
var debug = require_debug();
|
|
16037
|
+
var SemVer = require_semver();
|
|
16038
|
+
var Range = require_range();
|
|
16039
|
+
}
|
|
16040
|
+
});
|
|
16041
|
+
|
|
16042
|
+
// ../../node_modules/semver/functions/satisfies.js
|
|
16043
|
+
var require_satisfies = __commonJS({
|
|
16044
|
+
"../../node_modules/semver/functions/satisfies.js"(exports, module) {
|
|
16045
|
+
"use strict";
|
|
16046
|
+
var Range = require_range();
|
|
16047
|
+
var satisfies = (version2, range, options) => {
|
|
16048
|
+
try {
|
|
16049
|
+
range = new Range(range, options);
|
|
16050
|
+
} catch (er) {
|
|
16051
|
+
return false;
|
|
16052
|
+
}
|
|
16053
|
+
return range.test(version2);
|
|
16054
|
+
};
|
|
16055
|
+
module.exports = satisfies;
|
|
16056
|
+
}
|
|
16057
|
+
});
|
|
16058
|
+
|
|
16059
|
+
// ../../node_modules/semver/ranges/to-comparators.js
|
|
16060
|
+
var require_to_comparators = __commonJS({
|
|
16061
|
+
"../../node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
|
16062
|
+
"use strict";
|
|
16063
|
+
var Range = require_range();
|
|
16064
|
+
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
16065
|
+
module.exports = toComparators;
|
|
16066
|
+
}
|
|
16067
|
+
});
|
|
16068
|
+
|
|
16069
|
+
// ../../node_modules/semver/ranges/max-satisfying.js
|
|
16070
|
+
var require_max_satisfying = __commonJS({
|
|
16071
|
+
"../../node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
|
16072
|
+
"use strict";
|
|
16073
|
+
var SemVer = require_semver();
|
|
16074
|
+
var Range = require_range();
|
|
16075
|
+
var maxSatisfying = (versions, range, options) => {
|
|
16076
|
+
let max = null;
|
|
16077
|
+
let maxSV = null;
|
|
16078
|
+
let rangeObj = null;
|
|
16079
|
+
try {
|
|
16080
|
+
rangeObj = new Range(range, options);
|
|
16081
|
+
} catch (er) {
|
|
16082
|
+
return null;
|
|
16083
|
+
}
|
|
16084
|
+
versions.forEach((v) => {
|
|
16085
|
+
if (rangeObj.test(v)) {
|
|
16086
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
16087
|
+
max = v;
|
|
16088
|
+
maxSV = new SemVer(max, options);
|
|
16089
|
+
}
|
|
16090
|
+
}
|
|
16091
|
+
});
|
|
16092
|
+
return max;
|
|
16093
|
+
};
|
|
16094
|
+
module.exports = maxSatisfying;
|
|
16095
|
+
}
|
|
16096
|
+
});
|
|
16097
|
+
|
|
16098
|
+
// ../../node_modules/semver/ranges/min-satisfying.js
|
|
16099
|
+
var require_min_satisfying = __commonJS({
|
|
16100
|
+
"../../node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
|
16101
|
+
"use strict";
|
|
16102
|
+
var SemVer = require_semver();
|
|
16103
|
+
var Range = require_range();
|
|
16104
|
+
var minSatisfying = (versions, range, options) => {
|
|
16105
|
+
let min = null;
|
|
16106
|
+
let minSV = null;
|
|
16107
|
+
let rangeObj = null;
|
|
16108
|
+
try {
|
|
16109
|
+
rangeObj = new Range(range, options);
|
|
16110
|
+
} catch (er) {
|
|
16111
|
+
return null;
|
|
16112
|
+
}
|
|
16113
|
+
versions.forEach((v) => {
|
|
16114
|
+
if (rangeObj.test(v)) {
|
|
16115
|
+
if (!min || minSV.compare(v) === 1) {
|
|
16116
|
+
min = v;
|
|
16117
|
+
minSV = new SemVer(min, options);
|
|
16118
|
+
}
|
|
16119
|
+
}
|
|
16120
|
+
});
|
|
16121
|
+
return min;
|
|
16122
|
+
};
|
|
16123
|
+
module.exports = minSatisfying;
|
|
16124
|
+
}
|
|
16125
|
+
});
|
|
16126
|
+
|
|
16127
|
+
// ../../node_modules/semver/ranges/min-version.js
|
|
16128
|
+
var require_min_version = __commonJS({
|
|
16129
|
+
"../../node_modules/semver/ranges/min-version.js"(exports, module) {
|
|
16130
|
+
"use strict";
|
|
16131
|
+
var SemVer = require_semver();
|
|
16132
|
+
var Range = require_range();
|
|
16133
|
+
var gt = require_gt();
|
|
16134
|
+
var minVersion = (range, loose) => {
|
|
16135
|
+
range = new Range(range, loose);
|
|
16136
|
+
let minver = new SemVer("0.0.0");
|
|
16137
|
+
if (range.test(minver)) {
|
|
16138
|
+
return minver;
|
|
16139
|
+
}
|
|
16140
|
+
minver = new SemVer("0.0.0-0");
|
|
16141
|
+
if (range.test(minver)) {
|
|
16142
|
+
return minver;
|
|
16143
|
+
}
|
|
16144
|
+
minver = null;
|
|
16145
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
16146
|
+
const comparators = range.set[i];
|
|
16147
|
+
let setMin = null;
|
|
16148
|
+
comparators.forEach((comparator) => {
|
|
16149
|
+
const compver = new SemVer(comparator.semver.version);
|
|
16150
|
+
switch (comparator.operator) {
|
|
16151
|
+
case ">":
|
|
16152
|
+
if (compver.prerelease.length === 0) {
|
|
16153
|
+
compver.patch++;
|
|
16154
|
+
} else {
|
|
16155
|
+
compver.prerelease.push(0);
|
|
16156
|
+
}
|
|
16157
|
+
compver.raw = compver.format();
|
|
16158
|
+
/* fallthrough */
|
|
16159
|
+
case "":
|
|
16160
|
+
case ">=":
|
|
16161
|
+
if (!setMin || gt(compver, setMin)) {
|
|
16162
|
+
setMin = compver;
|
|
16163
|
+
}
|
|
16164
|
+
break;
|
|
16165
|
+
case "<":
|
|
16166
|
+
case "<=":
|
|
16167
|
+
break;
|
|
16168
|
+
/* istanbul ignore next */
|
|
16169
|
+
default:
|
|
16170
|
+
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
16171
|
+
}
|
|
16172
|
+
});
|
|
16173
|
+
if (setMin && (!minver || gt(minver, setMin))) {
|
|
16174
|
+
minver = setMin;
|
|
16175
|
+
}
|
|
16176
|
+
}
|
|
16177
|
+
if (minver && range.test(minver)) {
|
|
16178
|
+
return minver;
|
|
16179
|
+
}
|
|
16180
|
+
return null;
|
|
16181
|
+
};
|
|
16182
|
+
module.exports = minVersion;
|
|
16183
|
+
}
|
|
16184
|
+
});
|
|
16185
|
+
|
|
16186
|
+
// ../../node_modules/semver/ranges/valid.js
|
|
16187
|
+
var require_valid2 = __commonJS({
|
|
16188
|
+
"../../node_modules/semver/ranges/valid.js"(exports, module) {
|
|
16189
|
+
"use strict";
|
|
16190
|
+
var Range = require_range();
|
|
16191
|
+
var validRange = (range, options) => {
|
|
16192
|
+
try {
|
|
16193
|
+
return new Range(range, options).range || "*";
|
|
16194
|
+
} catch (er) {
|
|
16195
|
+
return null;
|
|
16196
|
+
}
|
|
16197
|
+
};
|
|
16198
|
+
module.exports = validRange;
|
|
16199
|
+
}
|
|
16200
|
+
});
|
|
16201
|
+
|
|
16202
|
+
// ../../node_modules/semver/ranges/outside.js
|
|
16203
|
+
var require_outside = __commonJS({
|
|
16204
|
+
"../../node_modules/semver/ranges/outside.js"(exports, module) {
|
|
16205
|
+
"use strict";
|
|
16206
|
+
var SemVer = require_semver();
|
|
16207
|
+
var Comparator = require_comparator();
|
|
16208
|
+
var { ANY } = Comparator;
|
|
16209
|
+
var Range = require_range();
|
|
16210
|
+
var satisfies = require_satisfies();
|
|
16211
|
+
var gt = require_gt();
|
|
16212
|
+
var lt = require_lt();
|
|
16213
|
+
var lte = require_lte();
|
|
16214
|
+
var gte = require_gte();
|
|
16215
|
+
var outside = (version2, range, hilo, options) => {
|
|
16216
|
+
version2 = new SemVer(version2, options);
|
|
16217
|
+
range = new Range(range, options);
|
|
16218
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
16219
|
+
switch (hilo) {
|
|
16220
|
+
case ">":
|
|
16221
|
+
gtfn = gt;
|
|
16222
|
+
ltefn = lte;
|
|
16223
|
+
ltfn = lt;
|
|
16224
|
+
comp = ">";
|
|
16225
|
+
ecomp = ">=";
|
|
16226
|
+
break;
|
|
16227
|
+
case "<":
|
|
16228
|
+
gtfn = lt;
|
|
16229
|
+
ltefn = gte;
|
|
16230
|
+
ltfn = gt;
|
|
16231
|
+
comp = "<";
|
|
16232
|
+
ecomp = "<=";
|
|
16233
|
+
break;
|
|
16234
|
+
default:
|
|
16235
|
+
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
16236
|
+
}
|
|
16237
|
+
if (satisfies(version2, range, options)) {
|
|
16238
|
+
return false;
|
|
16239
|
+
}
|
|
16240
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
16241
|
+
const comparators = range.set[i];
|
|
16242
|
+
let high = null;
|
|
16243
|
+
let low = null;
|
|
16244
|
+
comparators.forEach((comparator) => {
|
|
16245
|
+
if (comparator.semver === ANY) {
|
|
16246
|
+
comparator = new Comparator(">=0.0.0");
|
|
16247
|
+
}
|
|
16248
|
+
high = high || comparator;
|
|
16249
|
+
low = low || comparator;
|
|
16250
|
+
if (gtfn(comparator.semver, high.semver, options)) {
|
|
16251
|
+
high = comparator;
|
|
16252
|
+
} else if (ltfn(comparator.semver, low.semver, options)) {
|
|
16253
|
+
low = comparator;
|
|
16254
|
+
}
|
|
16255
|
+
});
|
|
16256
|
+
if (high.operator === comp || high.operator === ecomp) {
|
|
16257
|
+
return false;
|
|
16258
|
+
}
|
|
16259
|
+
if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) {
|
|
16260
|
+
return false;
|
|
16261
|
+
} else if (low.operator === ecomp && ltfn(version2, low.semver)) {
|
|
16262
|
+
return false;
|
|
16263
|
+
}
|
|
16264
|
+
}
|
|
16265
|
+
return true;
|
|
16266
|
+
};
|
|
16267
|
+
module.exports = outside;
|
|
16268
|
+
}
|
|
16269
|
+
});
|
|
16270
|
+
|
|
16271
|
+
// ../../node_modules/semver/ranges/gtr.js
|
|
16272
|
+
var require_gtr = __commonJS({
|
|
16273
|
+
"../../node_modules/semver/ranges/gtr.js"(exports, module) {
|
|
16274
|
+
"use strict";
|
|
16275
|
+
var outside = require_outside();
|
|
16276
|
+
var gtr = (version2, range, options) => outside(version2, range, ">", options);
|
|
16277
|
+
module.exports = gtr;
|
|
16278
|
+
}
|
|
16279
|
+
});
|
|
16280
|
+
|
|
16281
|
+
// ../../node_modules/semver/ranges/ltr.js
|
|
16282
|
+
var require_ltr = __commonJS({
|
|
16283
|
+
"../../node_modules/semver/ranges/ltr.js"(exports, module) {
|
|
16284
|
+
"use strict";
|
|
16285
|
+
var outside = require_outside();
|
|
16286
|
+
var ltr = (version2, range, options) => outside(version2, range, "<", options);
|
|
16287
|
+
module.exports = ltr;
|
|
16288
|
+
}
|
|
16289
|
+
});
|
|
16290
|
+
|
|
16291
|
+
// ../../node_modules/semver/ranges/intersects.js
|
|
16292
|
+
var require_intersects = __commonJS({
|
|
16293
|
+
"../../node_modules/semver/ranges/intersects.js"(exports, module) {
|
|
16294
|
+
"use strict";
|
|
16295
|
+
var Range = require_range();
|
|
16296
|
+
var intersects = (r1, r2, options) => {
|
|
16297
|
+
r1 = new Range(r1, options);
|
|
16298
|
+
r2 = new Range(r2, options);
|
|
16299
|
+
return r1.intersects(r2, options);
|
|
16300
|
+
};
|
|
16301
|
+
module.exports = intersects;
|
|
16302
|
+
}
|
|
16303
|
+
});
|
|
16304
|
+
|
|
16305
|
+
// ../../node_modules/semver/ranges/simplify.js
|
|
16306
|
+
var require_simplify = __commonJS({
|
|
16307
|
+
"../../node_modules/semver/ranges/simplify.js"(exports, module) {
|
|
16308
|
+
"use strict";
|
|
16309
|
+
var satisfies = require_satisfies();
|
|
16310
|
+
var compare = require_compare();
|
|
16311
|
+
module.exports = (versions, range, options) => {
|
|
16312
|
+
const set = [];
|
|
16313
|
+
let first = null;
|
|
16314
|
+
let prev = null;
|
|
16315
|
+
const v = versions.sort((a, b) => compare(a, b, options));
|
|
16316
|
+
for (const version2 of v) {
|
|
16317
|
+
const included = satisfies(version2, range, options);
|
|
16318
|
+
if (included) {
|
|
16319
|
+
prev = version2;
|
|
16320
|
+
if (!first) {
|
|
16321
|
+
first = version2;
|
|
16322
|
+
}
|
|
16323
|
+
} else {
|
|
16324
|
+
if (prev) {
|
|
16325
|
+
set.push([first, prev]);
|
|
16326
|
+
}
|
|
16327
|
+
prev = null;
|
|
16328
|
+
first = null;
|
|
16329
|
+
}
|
|
16330
|
+
}
|
|
16331
|
+
if (first) {
|
|
16332
|
+
set.push([first, null]);
|
|
16333
|
+
}
|
|
16334
|
+
const ranges = [];
|
|
16335
|
+
for (const [min, max] of set) {
|
|
16336
|
+
if (min === max) {
|
|
16337
|
+
ranges.push(min);
|
|
16338
|
+
} else if (!max && min === v[0]) {
|
|
16339
|
+
ranges.push("*");
|
|
16340
|
+
} else if (!max) {
|
|
16341
|
+
ranges.push(`>=${min}`);
|
|
16342
|
+
} else if (min === v[0]) {
|
|
16343
|
+
ranges.push(`<=${max}`);
|
|
16344
|
+
} else {
|
|
16345
|
+
ranges.push(`${min} - ${max}`);
|
|
16346
|
+
}
|
|
16347
|
+
}
|
|
16348
|
+
const simplified = ranges.join(" || ");
|
|
16349
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
16350
|
+
return simplified.length < original.length ? simplified : range;
|
|
16351
|
+
};
|
|
16352
|
+
}
|
|
16353
|
+
});
|
|
16354
|
+
|
|
16355
|
+
// ../../node_modules/semver/ranges/subset.js
|
|
16356
|
+
var require_subset = __commonJS({
|
|
16357
|
+
"../../node_modules/semver/ranges/subset.js"(exports, module) {
|
|
16358
|
+
"use strict";
|
|
16359
|
+
var Range = require_range();
|
|
16360
|
+
var Comparator = require_comparator();
|
|
16361
|
+
var { ANY } = Comparator;
|
|
16362
|
+
var satisfies = require_satisfies();
|
|
16363
|
+
var compare = require_compare();
|
|
16364
|
+
var subset = (sub, dom, options = {}) => {
|
|
16365
|
+
if (sub === dom) {
|
|
16366
|
+
return true;
|
|
16367
|
+
}
|
|
16368
|
+
sub = new Range(sub, options);
|
|
16369
|
+
dom = new Range(dom, options);
|
|
16370
|
+
let sawNonNull = false;
|
|
16371
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
16372
|
+
for (const simpleDom of dom.set) {
|
|
16373
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
16374
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
16375
|
+
if (isSub) {
|
|
16376
|
+
continue OUTER;
|
|
16377
|
+
}
|
|
16378
|
+
}
|
|
16379
|
+
if (sawNonNull) {
|
|
16380
|
+
return false;
|
|
16381
|
+
}
|
|
16382
|
+
}
|
|
16383
|
+
return true;
|
|
16384
|
+
};
|
|
16385
|
+
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
16386
|
+
var minimumVersion = [new Comparator(">=0.0.0")];
|
|
16387
|
+
var simpleSubset = (sub, dom, options) => {
|
|
16388
|
+
if (sub === dom) {
|
|
16389
|
+
return true;
|
|
16390
|
+
}
|
|
16391
|
+
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
16392
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
16393
|
+
return true;
|
|
16394
|
+
} else if (options.includePrerelease) {
|
|
16395
|
+
sub = minimumVersionWithPreRelease;
|
|
16396
|
+
} else {
|
|
16397
|
+
sub = minimumVersion;
|
|
16398
|
+
}
|
|
16399
|
+
}
|
|
16400
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
16401
|
+
if (options.includePrerelease) {
|
|
16402
|
+
return true;
|
|
16403
|
+
} else {
|
|
16404
|
+
dom = minimumVersion;
|
|
16405
|
+
}
|
|
16406
|
+
}
|
|
16407
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
16408
|
+
let gt, lt;
|
|
16409
|
+
for (const c of sub) {
|
|
16410
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
16411
|
+
gt = higherGT(gt, c, options);
|
|
16412
|
+
} else if (c.operator === "<" || c.operator === "<=") {
|
|
16413
|
+
lt = lowerLT(lt, c, options);
|
|
16414
|
+
} else {
|
|
16415
|
+
eqSet.add(c.semver);
|
|
16416
|
+
}
|
|
16417
|
+
}
|
|
16418
|
+
if (eqSet.size > 1) {
|
|
16419
|
+
return null;
|
|
16420
|
+
}
|
|
16421
|
+
let gtltComp;
|
|
16422
|
+
if (gt && lt) {
|
|
16423
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
16424
|
+
if (gtltComp > 0) {
|
|
16425
|
+
return null;
|
|
16426
|
+
} else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
|
|
16427
|
+
return null;
|
|
16428
|
+
}
|
|
16429
|
+
}
|
|
16430
|
+
for (const eq of eqSet) {
|
|
16431
|
+
if (gt && !satisfies(eq, String(gt), options)) {
|
|
16432
|
+
return null;
|
|
16433
|
+
}
|
|
16434
|
+
if (lt && !satisfies(eq, String(lt), options)) {
|
|
16435
|
+
return null;
|
|
16436
|
+
}
|
|
16437
|
+
for (const c of dom) {
|
|
16438
|
+
if (!satisfies(eq, String(c), options)) {
|
|
16439
|
+
return false;
|
|
16440
|
+
}
|
|
16441
|
+
}
|
|
16442
|
+
return true;
|
|
16443
|
+
}
|
|
16444
|
+
let higher, lower;
|
|
16445
|
+
let hasDomLT, hasDomGT;
|
|
16446
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
16447
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
16448
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
16449
|
+
needDomLTPre = false;
|
|
16450
|
+
}
|
|
16451
|
+
for (const c of dom) {
|
|
16452
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
16453
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
16454
|
+
if (gt) {
|
|
16455
|
+
if (needDomGTPre) {
|
|
16456
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
16457
|
+
needDomGTPre = false;
|
|
16458
|
+
}
|
|
16459
|
+
}
|
|
16460
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
16461
|
+
higher = higherGT(gt, c, options);
|
|
16462
|
+
if (higher === c && higher !== gt) {
|
|
16463
|
+
return false;
|
|
16464
|
+
}
|
|
16465
|
+
} else if (gt.operator === ">=" && !c.test(gt.semver)) {
|
|
16466
|
+
return false;
|
|
16467
|
+
}
|
|
16468
|
+
}
|
|
16469
|
+
if (lt) {
|
|
16470
|
+
if (needDomLTPre) {
|
|
16471
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
16472
|
+
needDomLTPre = false;
|
|
16473
|
+
}
|
|
16474
|
+
}
|
|
16475
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
16476
|
+
lower = lowerLT(lt, c, options);
|
|
16477
|
+
if (lower === c && lower !== lt) {
|
|
16478
|
+
return false;
|
|
16479
|
+
}
|
|
16480
|
+
} else if (lt.operator === "<=" && !c.test(lt.semver)) {
|
|
16481
|
+
return false;
|
|
16482
|
+
}
|
|
16483
|
+
}
|
|
16484
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
16485
|
+
return false;
|
|
16486
|
+
}
|
|
16487
|
+
}
|
|
16488
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
|
16489
|
+
return false;
|
|
16490
|
+
}
|
|
16491
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
|
16492
|
+
return false;
|
|
16493
|
+
}
|
|
16494
|
+
if (needDomGTPre || needDomLTPre) {
|
|
16495
|
+
return false;
|
|
16496
|
+
}
|
|
16497
|
+
return true;
|
|
16498
|
+
};
|
|
16499
|
+
var higherGT = (a, b, options) => {
|
|
16500
|
+
if (!a) {
|
|
16501
|
+
return b;
|
|
16502
|
+
}
|
|
16503
|
+
const comp = compare(a.semver, b.semver, options);
|
|
16504
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
16505
|
+
};
|
|
16506
|
+
var lowerLT = (a, b, options) => {
|
|
16507
|
+
if (!a) {
|
|
16508
|
+
return b;
|
|
16509
|
+
}
|
|
16510
|
+
const comp = compare(a.semver, b.semver, options);
|
|
16511
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
16512
|
+
};
|
|
16513
|
+
module.exports = subset;
|
|
16514
|
+
}
|
|
16515
|
+
});
|
|
16516
|
+
|
|
16517
|
+
// ../../node_modules/semver/index.js
|
|
16518
|
+
var require_semver2 = __commonJS({
|
|
16519
|
+
"../../node_modules/semver/index.js"(exports, module) {
|
|
16520
|
+
"use strict";
|
|
16521
|
+
var internalRe = require_re();
|
|
16522
|
+
var constants2 = require_constants();
|
|
16523
|
+
var SemVer = require_semver();
|
|
16524
|
+
var identifiers = require_identifiers();
|
|
16525
|
+
var parse4 = require_parse();
|
|
16526
|
+
var valid = require_valid();
|
|
16527
|
+
var clean = require_clean();
|
|
16528
|
+
var inc = require_inc();
|
|
16529
|
+
var diff = require_diff();
|
|
16530
|
+
var major = require_major();
|
|
16531
|
+
var minor = require_minor();
|
|
16532
|
+
var patch = require_patch();
|
|
16533
|
+
var prerelease = require_prerelease();
|
|
16534
|
+
var compare = require_compare();
|
|
16535
|
+
var rcompare = require_rcompare();
|
|
16536
|
+
var compareLoose = require_compare_loose();
|
|
16537
|
+
var compareBuild = require_compare_build();
|
|
16538
|
+
var sort = require_sort();
|
|
16539
|
+
var rsort = require_rsort();
|
|
16540
|
+
var gt = require_gt();
|
|
16541
|
+
var lt = require_lt();
|
|
16542
|
+
var eq = require_eq();
|
|
16543
|
+
var neq = require_neq();
|
|
16544
|
+
var gte = require_gte();
|
|
16545
|
+
var lte = require_lte();
|
|
16546
|
+
var cmp = require_cmp();
|
|
16547
|
+
var coerce = require_coerce();
|
|
16548
|
+
var truncate = require_truncate();
|
|
16549
|
+
var Comparator = require_comparator();
|
|
16550
|
+
var Range = require_range();
|
|
16551
|
+
var satisfies = require_satisfies();
|
|
16552
|
+
var toComparators = require_to_comparators();
|
|
16553
|
+
var maxSatisfying = require_max_satisfying();
|
|
16554
|
+
var minSatisfying = require_min_satisfying();
|
|
16555
|
+
var minVersion = require_min_version();
|
|
16556
|
+
var validRange = require_valid2();
|
|
16557
|
+
var outside = require_outside();
|
|
16558
|
+
var gtr = require_gtr();
|
|
16559
|
+
var ltr = require_ltr();
|
|
16560
|
+
var intersects = require_intersects();
|
|
16561
|
+
var simplifyRange = require_simplify();
|
|
16562
|
+
var subset = require_subset();
|
|
16563
|
+
module.exports = {
|
|
16564
|
+
parse: parse4,
|
|
16565
|
+
valid,
|
|
16566
|
+
clean,
|
|
16567
|
+
inc,
|
|
16568
|
+
diff,
|
|
16569
|
+
major,
|
|
16570
|
+
minor,
|
|
16571
|
+
patch,
|
|
16572
|
+
prerelease,
|
|
16573
|
+
compare,
|
|
16574
|
+
rcompare,
|
|
16575
|
+
compareLoose,
|
|
16576
|
+
compareBuild,
|
|
16577
|
+
sort,
|
|
16578
|
+
rsort,
|
|
16579
|
+
gt,
|
|
16580
|
+
lt,
|
|
16581
|
+
eq,
|
|
16582
|
+
neq,
|
|
16583
|
+
gte,
|
|
16584
|
+
lte,
|
|
16585
|
+
cmp,
|
|
16586
|
+
coerce,
|
|
16587
|
+
truncate,
|
|
16588
|
+
Comparator,
|
|
16589
|
+
Range,
|
|
16590
|
+
satisfies,
|
|
16591
|
+
toComparators,
|
|
16592
|
+
maxSatisfying,
|
|
16593
|
+
minSatisfying,
|
|
16594
|
+
minVersion,
|
|
16595
|
+
validRange,
|
|
16596
|
+
outside,
|
|
16597
|
+
gtr,
|
|
16598
|
+
ltr,
|
|
16599
|
+
intersects,
|
|
16600
|
+
simplifyRange,
|
|
16601
|
+
subset,
|
|
16602
|
+
SemVer,
|
|
16603
|
+
re: internalRe.re,
|
|
16604
|
+
src: internalRe.src,
|
|
16605
|
+
tokens: internalRe.t,
|
|
16606
|
+
SEMVER_SPEC_VERSION: constants2.SEMVER_SPEC_VERSION,
|
|
16607
|
+
RELEASE_TYPES: constants2.RELEASE_TYPES,
|
|
16608
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
16609
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
16610
|
+
};
|
|
16611
|
+
}
|
|
16612
|
+
});
|
|
16613
|
+
|
|
14620
16614
|
// ../argent-mcp/src/mcp-server.ts
|
|
14621
16615
|
import { appendFile, mkdir as mkdir5 } from "node:fs/promises";
|
|
14622
|
-
import { dirname as
|
|
16616
|
+
import { dirname as dirname11 } from "node:path";
|
|
14623
16617
|
import { homedir as homedir5 } from "node:os";
|
|
16618
|
+
import { setTimeout as sleep } from "node:timers/promises";
|
|
14624
16619
|
|
|
14625
16620
|
// ../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
14626
16621
|
import process2 from "node:process";
|
|
@@ -14862,10 +16857,10 @@ function mergeDefs(...defs) {
|
|
|
14862
16857
|
function cloneDef(schema) {
|
|
14863
16858
|
return mergeDefs(schema._zod.def);
|
|
14864
16859
|
}
|
|
14865
|
-
function getElementAtPath(obj,
|
|
14866
|
-
if (!
|
|
16860
|
+
function getElementAtPath(obj, path18) {
|
|
16861
|
+
if (!path18)
|
|
14867
16862
|
return obj;
|
|
14868
|
-
return
|
|
16863
|
+
return path18.reduce((acc, key) => acc?.[key], obj);
|
|
14869
16864
|
}
|
|
14870
16865
|
function promiseAllObject(promisesObj) {
|
|
14871
16866
|
const keys = Object.keys(promisesObj);
|
|
@@ -15205,11 +17200,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
15205
17200
|
}
|
|
15206
17201
|
return false;
|
|
15207
17202
|
}
|
|
15208
|
-
function prefixIssues(
|
|
17203
|
+
function prefixIssues(path18, issues) {
|
|
15209
17204
|
return issues.map((iss) => {
|
|
15210
17205
|
var _a3;
|
|
15211
17206
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
15212
|
-
iss.path.unshift(
|
|
17207
|
+
iss.path.unshift(path18);
|
|
15213
17208
|
return iss;
|
|
15214
17209
|
});
|
|
15215
17210
|
}
|
|
@@ -15667,16 +17662,16 @@ function flattenError(error2, mapper = (issue2) => issue2.message) {
|
|
|
15667
17662
|
}
|
|
15668
17663
|
function formatError(error2, mapper = (issue2) => issue2.message) {
|
|
15669
17664
|
const fieldErrors = { _errors: [] };
|
|
15670
|
-
const processError = (error3,
|
|
17665
|
+
const processError = (error3, path18 = []) => {
|
|
15671
17666
|
for (const issue2 of error3.issues) {
|
|
15672
17667
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
15673
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
17668
|
+
issue2.errors.map((issues) => processError({ issues }, [...path18, ...issue2.path]));
|
|
15674
17669
|
} else if (issue2.code === "invalid_key") {
|
|
15675
|
-
processError({ issues: issue2.issues }, [...
|
|
17670
|
+
processError({ issues: issue2.issues }, [...path18, ...issue2.path]);
|
|
15676
17671
|
} else if (issue2.code === "invalid_element") {
|
|
15677
|
-
processError({ issues: issue2.issues }, [...
|
|
17672
|
+
processError({ issues: issue2.issues }, [...path18, ...issue2.path]);
|
|
15678
17673
|
} else {
|
|
15679
|
-
const fullpath = [...
|
|
17674
|
+
const fullpath = [...path18, ...issue2.path];
|
|
15680
17675
|
if (fullpath.length === 0) {
|
|
15681
17676
|
fieldErrors._errors.push(mapper(issue2));
|
|
15682
17677
|
} else {
|
|
@@ -15819,17 +17814,17 @@ var validateAsync = async (schema, value, _ctx) => {
|
|
|
15819
17814
|
return result.issues.length === 0;
|
|
15820
17815
|
};
|
|
15821
17816
|
var _encode = (_Err) => {
|
|
15822
|
-
const
|
|
17817
|
+
const parse4 = _parse(_Err);
|
|
15823
17818
|
const fn = (schema, value, _ctx, _params) => {
|
|
15824
17819
|
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
15825
|
-
return
|
|
17820
|
+
return parse4(schema, value, ctx, finalizeParams(fn, _params));
|
|
15826
17821
|
};
|
|
15827
17822
|
return fn;
|
|
15828
17823
|
};
|
|
15829
17824
|
var _decode = (_Err) => {
|
|
15830
|
-
const
|
|
17825
|
+
const parse4 = _parse(_Err);
|
|
15831
17826
|
const fn = (schema, value, _ctx, _params) => {
|
|
15832
|
-
return
|
|
17827
|
+
return parse4(schema, value, _ctx, finalizeParams(fn, _params));
|
|
15833
17828
|
};
|
|
15834
17829
|
return fn;
|
|
15835
17830
|
};
|
|
@@ -16866,7 +18861,7 @@ function capSize(inst, size) {
|
|
|
16866
18861
|
if (!caps.length)
|
|
16867
18862
|
return;
|
|
16868
18863
|
const cap = Math.min(...caps.map((c) => c[0]));
|
|
16869
|
-
const
|
|
18864
|
+
const parse4 = inst._zod.parse;
|
|
16870
18865
|
inst._zod.parse = (payload, ctx) => {
|
|
16871
18866
|
const n = size(payload.value);
|
|
16872
18867
|
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
@@ -16880,7 +18875,7 @@ function capSize(inst, size) {
|
|
|
16880
18875
|
}
|
|
16881
18876
|
}
|
|
16882
18877
|
}
|
|
16883
|
-
return
|
|
18878
|
+
return parse4(payload, ctx);
|
|
16884
18879
|
};
|
|
16885
18880
|
}
|
|
16886
18881
|
var arraySize = (input) => Array.isArray(input) ? input.length : -1;
|
|
@@ -17976,7 +19971,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
|
|
|
17976
19971
|
var NONE = 0;
|
|
17977
19972
|
var ASSUMED = 1;
|
|
17978
19973
|
var PROVEN = 2;
|
|
17979
|
-
function isRecursive(inst, stack,
|
|
19974
|
+
function isRecursive(inst, stack, resolve12) {
|
|
17980
19975
|
const cached2 = recursive.get(inst);
|
|
17981
19976
|
if (cached2 !== void 0)
|
|
17982
19977
|
return cached2 ? PROVEN : NONE;
|
|
@@ -17986,7 +19981,7 @@ function isRecursive(inst, stack, resolve10) {
|
|
|
17986
19981
|
let result = NONE;
|
|
17987
19982
|
const check = (child) => {
|
|
17988
19983
|
if (result !== PROVEN && child?._zod) {
|
|
17989
|
-
const answer = isRecursive(child, stack,
|
|
19984
|
+
const answer = isRecursive(child, stack, resolve12);
|
|
17990
19985
|
if (answer > result)
|
|
17991
19986
|
result = answer;
|
|
17992
19987
|
}
|
|
@@ -17997,7 +19992,7 @@ function isRecursive(inst, stack, resolve10) {
|
|
|
17997
19992
|
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
17998
19993
|
if (spread && !desc.enumerable)
|
|
17999
19994
|
continue;
|
|
18000
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack,
|
|
19995
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve12) : NONE;
|
|
18001
19996
|
if (child > answer)
|
|
18002
19997
|
answer = child;
|
|
18003
19998
|
}
|
|
@@ -18061,7 +20056,7 @@ function isRecursive(inst, stack, resolve10) {
|
|
|
18061
20056
|
break;
|
|
18062
20057
|
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
18063
20058
|
case "lazy": {
|
|
18064
|
-
const inner = def._cachedInner ?? (
|
|
20059
|
+
const inner = def._cachedInner ?? (resolve12 ? inst._zod.innerType : void 0);
|
|
18065
20060
|
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
18066
20061
|
break;
|
|
18067
20062
|
}
|
|
@@ -22639,12 +24634,12 @@ var StdioServerTransport = class {
|
|
|
22639
24634
|
this.onclose?.();
|
|
22640
24635
|
}
|
|
22641
24636
|
send(message) {
|
|
22642
|
-
return new Promise((
|
|
24637
|
+
return new Promise((resolve12) => {
|
|
22643
24638
|
const json = serializeMessage(message);
|
|
22644
24639
|
if (this._stdout.write(json)) {
|
|
22645
|
-
|
|
24640
|
+
resolve12();
|
|
22646
24641
|
} else {
|
|
22647
|
-
this._stdout.once("drain",
|
|
24642
|
+
this._stdout.once("drain", resolve12);
|
|
22648
24643
|
}
|
|
22649
24644
|
});
|
|
22650
24645
|
}
|
|
@@ -23264,7 +25259,7 @@ var Protocol = class {
|
|
|
23264
25259
|
return;
|
|
23265
25260
|
}
|
|
23266
25261
|
const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
|
|
23267
|
-
await new Promise((
|
|
25262
|
+
await new Promise((resolve12) => setTimeout(resolve12, pollInterval));
|
|
23268
25263
|
options?.signal?.throwIfAborted();
|
|
23269
25264
|
}
|
|
23270
25265
|
} catch (error2) {
|
|
@@ -23281,7 +25276,7 @@ var Protocol = class {
|
|
|
23281
25276
|
*/
|
|
23282
25277
|
request(request, resultSchema, options) {
|
|
23283
25278
|
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
|
|
23284
|
-
return new Promise((
|
|
25279
|
+
return new Promise((resolve12, reject) => {
|
|
23285
25280
|
const earlyReject = (error2) => {
|
|
23286
25281
|
reject(error2);
|
|
23287
25282
|
};
|
|
@@ -23359,7 +25354,7 @@ var Protocol = class {
|
|
|
23359
25354
|
if (!parseResult.success) {
|
|
23360
25355
|
reject(parseResult.error);
|
|
23361
25356
|
} else {
|
|
23362
|
-
|
|
25357
|
+
resolve12(parseResult.data);
|
|
23363
25358
|
}
|
|
23364
25359
|
} catch (error2) {
|
|
23365
25360
|
reject(error2);
|
|
@@ -23621,12 +25616,12 @@ var Protocol = class {
|
|
|
23621
25616
|
}
|
|
23622
25617
|
} catch {
|
|
23623
25618
|
}
|
|
23624
|
-
return new Promise((
|
|
25619
|
+
return new Promise((resolve12, reject) => {
|
|
23625
25620
|
if (signal.aborted) {
|
|
23626
25621
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
23627
25622
|
return;
|
|
23628
25623
|
}
|
|
23629
|
-
const timeoutId = setTimeout(
|
|
25624
|
+
const timeoutId = setTimeout(resolve12, interval);
|
|
23630
25625
|
signal.addEventListener("abort", () => {
|
|
23631
25626
|
clearTimeout(timeoutId);
|
|
23632
25627
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
@@ -24422,6 +26417,7 @@ var LOCK_FILE = path.join(STATE_DIR, "tool-server.lock");
|
|
|
24422
26417
|
var AUTH_TOKEN_BYTES = 32;
|
|
24423
26418
|
var AUTH_TOKEN_ENV = "ARGENT_AUTH_TOKEN";
|
|
24424
26419
|
var AUTOSPAWN_IDLE_TIMEOUT_MINUTES = 30;
|
|
26420
|
+
var AUTOSPAWN_HOST = "127.0.0.1";
|
|
24425
26421
|
function buildToolsServerEnv(paths, port, baseEnv = process.env, options = {}) {
|
|
24426
26422
|
const env = {
|
|
24427
26423
|
...baseEnv,
|
|
@@ -24433,7 +26429,7 @@ function buildToolsServerEnv(paths, port, baseEnv = process.env, options = {}) {
|
|
|
24433
26429
|
if (options.idleTimeoutMinutes !== void 0) {
|
|
24434
26430
|
env.ARGENT_IDLE_TIMEOUT_MINUTES = String(options.idleTimeoutMinutes);
|
|
24435
26431
|
}
|
|
24436
|
-
|
|
26432
|
+
env[AUTH_TOKEN_ENV] = options.token ?? "";
|
|
24437
26433
|
if (paths.installKind) env.ARGENT_INSTALL_KIND = paths.installKind;
|
|
24438
26434
|
if (paths.installProjectRoot) env.ARGENT_PROJECT_ROOT = paths.installProjectRoot;
|
|
24439
26435
|
return env;
|
|
@@ -24442,7 +26438,7 @@ function generateToken() {
|
|
|
24442
26438
|
return randomBytes(AUTH_TOKEN_BYTES).toString("hex");
|
|
24443
26439
|
}
|
|
24444
26440
|
function findFreePort() {
|
|
24445
|
-
return new Promise((
|
|
26441
|
+
return new Promise((resolve12, reject) => {
|
|
24446
26442
|
const srv = net.createServer();
|
|
24447
26443
|
srv.listen(0, "127.0.0.1", () => {
|
|
24448
26444
|
const addr = srv.address();
|
|
@@ -24453,21 +26449,21 @@ function findFreePort() {
|
|
|
24453
26449
|
const port = addr.port;
|
|
24454
26450
|
srv.close((err) => {
|
|
24455
26451
|
if (err) reject(err);
|
|
24456
|
-
else
|
|
26452
|
+
else resolve12(port);
|
|
24457
26453
|
});
|
|
24458
26454
|
});
|
|
24459
26455
|
srv.on("error", reject);
|
|
24460
26456
|
});
|
|
24461
26457
|
}
|
|
24462
26458
|
function isVersionNewer(a, b) {
|
|
24463
|
-
const
|
|
26459
|
+
const parse4 = (v) => {
|
|
24464
26460
|
const [core = "", ...preParts] = v.split("+")[0].split("-");
|
|
24465
26461
|
const nums = core.split(".").map((n) => Number.parseInt(n, 10));
|
|
24466
26462
|
if (nums.length === 0 || nums.some((n) => Number.isNaN(n))) return null;
|
|
24467
26463
|
return { nums, pre: preParts.length > 0 ? preParts.join("-").split(".") : [] };
|
|
24468
26464
|
};
|
|
24469
|
-
const pa =
|
|
24470
|
-
const pb =
|
|
26465
|
+
const pa = parse4(a);
|
|
26466
|
+
const pb = parse4(b);
|
|
24471
26467
|
if (!pa || !pb) return false;
|
|
24472
26468
|
for (let i = 0; i < 3; i++) {
|
|
24473
26469
|
const x = pa.nums[i] ?? 0;
|
|
@@ -24550,8 +26546,12 @@ function killSpawnedChild(child, pid) {
|
|
|
24550
26546
|
}
|
|
24551
26547
|
}
|
|
24552
26548
|
}
|
|
26549
|
+
function resolveToolsServerNode() {
|
|
26550
|
+
const { bun, deno, electron } = process.versions;
|
|
26551
|
+
return !(bun || deno || electron) && fs.existsSync(process.execPath) ? process.execPath : "node";
|
|
26552
|
+
}
|
|
24553
26553
|
function spawnToolsServer(paths, port, options = {}) {
|
|
24554
|
-
return new Promise((
|
|
26554
|
+
return new Promise((resolve12, reject) => {
|
|
24555
26555
|
let logFd;
|
|
24556
26556
|
try {
|
|
24557
26557
|
fs.mkdirSync(STATE_DIR, { recursive: true });
|
|
@@ -24559,8 +26559,7 @@ function spawnToolsServer(paths, port, options = {}) {
|
|
|
24559
26559
|
} catch {
|
|
24560
26560
|
logFd = fs.openSync("/dev/null", "w");
|
|
24561
26561
|
}
|
|
24562
|
-
const
|
|
24563
|
-
const nodeBin = !(bun || deno || electron) && fs.existsSync(process.execPath) ? process.execPath : "node";
|
|
26562
|
+
const nodeBin = resolveToolsServerNode();
|
|
24564
26563
|
const child = spawn(nodeBin, [paths.bundlePath, "start"], {
|
|
24565
26564
|
detached: true,
|
|
24566
26565
|
stdio: ["ignore", "pipe", logFd],
|
|
@@ -24598,7 +26597,7 @@ function spawnToolsServer(paths, port, options = {}) {
|
|
|
24598
26597
|
rl.close();
|
|
24599
26598
|
child.stdout?.resume();
|
|
24600
26599
|
child.stdout?.unref?.();
|
|
24601
|
-
settle2(() =>
|
|
26600
|
+
settle2(() => resolve12({ port: actualPort, pid }));
|
|
24602
26601
|
}
|
|
24603
26602
|
});
|
|
24604
26603
|
child.on("error", (err) => {
|
|
@@ -24874,6 +26873,7 @@ async function ensureToolsServer(paths) {
|
|
|
24874
26873
|
const port = await findFreePort();
|
|
24875
26874
|
const { port: actualPort, pid } = await spawnToolsServer(paths, port, {
|
|
24876
26875
|
token,
|
|
26876
|
+
host: AUTOSPAWN_HOST,
|
|
24877
26877
|
idleTimeoutMinutes: AUTOSPAWN_IDLE_TIMEOUT_MINUTES
|
|
24878
26878
|
});
|
|
24879
26879
|
await writeState({
|
|
@@ -24882,11 +26882,11 @@ async function ensureToolsServer(paths) {
|
|
|
24882
26882
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
24883
26883
|
bundlePath: paths.bundlePath,
|
|
24884
26884
|
version: diskVersion,
|
|
24885
|
-
host:
|
|
26885
|
+
host: AUTOSPAWN_HOST,
|
|
24886
26886
|
token,
|
|
24887
26887
|
managed: "autospawn"
|
|
24888
26888
|
});
|
|
24889
|
-
return { url: formatUrl(
|
|
26889
|
+
return { url: formatUrl(AUTOSPAWN_HOST, actualPort), token };
|
|
24890
26890
|
} finally {
|
|
24891
26891
|
lock?.release();
|
|
24892
26892
|
}
|
|
@@ -24939,14 +26939,24 @@ var FLAG_REGISTRY = [
|
|
|
24939
26939
|
name: "forward-secrets",
|
|
24940
26940
|
description: "Over `argent link` or ARGENT_TOOLS_URL, resolve each `{{secret:NAME}}` a call names on this machine and send the value with the call, so a remote tool-server can type a secret it does not hold. The linked tool-server then receives every secret of this machine that a call names, so link only one you trust with all of them. Values go only over https:// with the certificate checked, or to a loopback address. Off by default."
|
|
24941
26941
|
},
|
|
26942
|
+
{
|
|
26943
|
+
name: "ios-audio-always-inserted",
|
|
26944
|
+
description: "Insert the iOS audio hook (libArgentAudio.dylib) into every app an armed simulator launches, so audio-input works without restart-app. Dormant until the app opens audio. On by default; `argent disable ios-audio-always-inserted` inserts it only on the first audio tool call, for apps launched after that call.",
|
|
26945
|
+
defaultEnabled: true
|
|
26946
|
+
},
|
|
24942
26947
|
{
|
|
24943
26948
|
name: "video-watermark",
|
|
24944
26949
|
description: "Overlay the argent corner watermark on recorded screen videos. On by default; turn it off with `argent disable video-watermark`.",
|
|
24945
26950
|
defaultEnabled: true
|
|
24946
26951
|
},
|
|
26952
|
+
{
|
|
26953
|
+
name: "whats-new",
|
|
26954
|
+
description: "After an update, tell the agent the highlights of the new Argent version on its first tool call. On by default; turn it off with `argent disable whats-new`.",
|
|
26955
|
+
defaultEnabled: true
|
|
26956
|
+
},
|
|
24947
26957
|
{
|
|
24948
26958
|
name: "macos-apps",
|
|
24949
|
-
description: "
|
|
26959
|
+
description: "Control native Mac apps, including Mac Catalyst. Adds the macos platform to list-devices and boot-device, and the file-panel and menu-bar tools. On by default; turn it off with `argent disable macos-apps`.",
|
|
24950
26960
|
defaultEnabled: true
|
|
24951
26961
|
}
|
|
24952
26962
|
];
|
|
@@ -25016,6 +27026,7 @@ function isFeatureEnabled(name, options = {}, registry2 = FLAG_REGISTRY) {
|
|
|
25016
27026
|
}
|
|
25017
27027
|
|
|
25018
27028
|
// ../configuration-core/src/paths.ts
|
|
27029
|
+
import * as fs3 from "node:fs";
|
|
25019
27030
|
import * as os from "node:os";
|
|
25020
27031
|
import * as path3 from "node:path";
|
|
25021
27032
|
function nonEmpty(value) {
|
|
@@ -25027,6 +27038,16 @@ function resolveHomeDir(options = {}) {
|
|
|
25027
27038
|
if (options.homeDir) return options.homeDir;
|
|
25028
27039
|
return process.platform === "win32" ? nonEmpty(process.env.USERPROFILE) ?? os.homedir() : nonEmpty(process.env.HOME) ?? os.homedir();
|
|
25029
27040
|
}
|
|
27041
|
+
function isHomeDir(dir, options = {}) {
|
|
27042
|
+
return canonicalPath(dir) === canonicalPath(resolveHomeDir(options));
|
|
27043
|
+
}
|
|
27044
|
+
function canonicalPath(p) {
|
|
27045
|
+
try {
|
|
27046
|
+
return fs3.realpathSync.native(p);
|
|
27047
|
+
} catch {
|
|
27048
|
+
return path3.resolve(p);
|
|
27049
|
+
}
|
|
27050
|
+
}
|
|
25030
27051
|
function argentHomeDir() {
|
|
25031
27052
|
return path3.join(resolveHomeDir(), ".argent");
|
|
25032
27053
|
}
|
|
@@ -25043,11 +27064,11 @@ function configFilePath(scope = "global", options = {}) {
|
|
|
25043
27064
|
|
|
25044
27065
|
// ../configuration-core/src/config.ts
|
|
25045
27066
|
import * as crypto from "node:crypto";
|
|
25046
|
-
import * as
|
|
27067
|
+
import * as fs4 from "node:fs";
|
|
25047
27068
|
import * as path4 from "node:path";
|
|
25048
27069
|
function readConfigObject(scope = "global", options = {}) {
|
|
25049
27070
|
try {
|
|
25050
|
-
const raw2 =
|
|
27071
|
+
const raw2 = fs4.readFileSync(configFilePath(scope, options), "utf8");
|
|
25051
27072
|
const json = JSON.parse(raw2);
|
|
25052
27073
|
if (json && typeof json === "object" && !Array.isArray(json)) {
|
|
25053
27074
|
return json;
|
|
@@ -25081,6 +27102,19 @@ function getAtPath(obj, dottedKey) {
|
|
|
25081
27102
|
}
|
|
25082
27103
|
return cur;
|
|
25083
27104
|
}
|
|
27105
|
+
function setAtPath(obj, dottedKey, value) {
|
|
27106
|
+
const parts = splitKey(dottedKey);
|
|
27107
|
+
let cur = obj;
|
|
27108
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
27109
|
+
const part = parts[i];
|
|
27110
|
+
const next = cur[part];
|
|
27111
|
+
if (!isPlainObject3(next)) {
|
|
27112
|
+
cur[part] = {};
|
|
27113
|
+
}
|
|
27114
|
+
cur = cur[part];
|
|
27115
|
+
}
|
|
27116
|
+
cur[parts[parts.length - 1]] = value;
|
|
27117
|
+
}
|
|
25084
27118
|
var LOCK_STALE_MS2 = 1e4;
|
|
25085
27119
|
var LOCK_MAX_WAIT_MS = 2e3;
|
|
25086
27120
|
var LOCK_RETRY_MS = 25;
|
|
@@ -25092,9 +27126,9 @@ function acquireConfigLock(finalPath) {
|
|
|
25092
27126
|
const deadline = Date.now() + LOCK_MAX_WAIT_MS;
|
|
25093
27127
|
for (; ; ) {
|
|
25094
27128
|
try {
|
|
25095
|
-
const fd =
|
|
27129
|
+
const fd = fs4.openSync(lockPath, "wx", 384);
|
|
25096
27130
|
try {
|
|
25097
|
-
|
|
27131
|
+
fs4.writeSync(fd, `${process.pid}
|
|
25098
27132
|
`);
|
|
25099
27133
|
} catch {
|
|
25100
27134
|
}
|
|
@@ -25102,8 +27136,8 @@ function acquireConfigLock(finalPath) {
|
|
|
25102
27136
|
} catch (err) {
|
|
25103
27137
|
if (err.code !== "EEXIST") return null;
|
|
25104
27138
|
try {
|
|
25105
|
-
if (Date.now() -
|
|
25106
|
-
|
|
27139
|
+
if (Date.now() - fs4.statSync(lockPath).mtimeMs > LOCK_STALE_MS2) {
|
|
27140
|
+
fs4.unlinkSync(lockPath);
|
|
25107
27141
|
continue;
|
|
25108
27142
|
}
|
|
25109
27143
|
} catch {
|
|
@@ -25115,35 +27149,35 @@ function acquireConfigLock(finalPath) {
|
|
|
25115
27149
|
}
|
|
25116
27150
|
function releaseConfigLock(lock) {
|
|
25117
27151
|
try {
|
|
25118
|
-
|
|
27152
|
+
fs4.closeSync(lock.fd);
|
|
25119
27153
|
} catch {
|
|
25120
27154
|
}
|
|
25121
27155
|
try {
|
|
25122
|
-
|
|
27156
|
+
fs4.unlinkSync(lock.lockPath);
|
|
25123
27157
|
} catch {
|
|
25124
27158
|
}
|
|
25125
27159
|
}
|
|
25126
27160
|
function updateConfig(mutate, scope = "global", options = {}) {
|
|
25127
27161
|
const dir = configDir(scope, options);
|
|
25128
|
-
|
|
27162
|
+
fs4.mkdirSync(dir, { recursive: true });
|
|
25129
27163
|
const finalPath = configFilePath(scope, options);
|
|
25130
27164
|
const lock = acquireConfigLock(finalPath);
|
|
25131
27165
|
try {
|
|
25132
27166
|
const next = readConfigObject(scope, options);
|
|
25133
27167
|
mutate(next);
|
|
25134
27168
|
const tmpPath = path4.join(dir, `.config.tmp.${process.pid}.${crypto.randomUUID()}`);
|
|
25135
|
-
const fd =
|
|
27169
|
+
const fd = fs4.openSync(tmpPath, "wx", 384);
|
|
25136
27170
|
try {
|
|
25137
|
-
|
|
25138
|
-
|
|
27171
|
+
fs4.writeSync(fd, JSON.stringify(next, null, 2) + "\n");
|
|
27172
|
+
fs4.fsyncSync(fd);
|
|
25139
27173
|
} finally {
|
|
25140
|
-
|
|
27174
|
+
fs4.closeSync(fd);
|
|
25141
27175
|
}
|
|
25142
27176
|
try {
|
|
25143
|
-
|
|
27177
|
+
fs4.renameSync(tmpPath, finalPath);
|
|
25144
27178
|
} catch (err) {
|
|
25145
27179
|
try {
|
|
25146
|
-
|
|
27180
|
+
fs4.unlinkSync(tmpPath);
|
|
25147
27181
|
} catch {
|
|
25148
27182
|
}
|
|
25149
27183
|
throw err;
|
|
@@ -25153,9 +27187,19 @@ function updateConfig(mutate, scope = "global", options = {}) {
|
|
|
25153
27187
|
}
|
|
25154
27188
|
}
|
|
25155
27189
|
|
|
27190
|
+
// ../configuration-core/src/whats-new.ts
|
|
27191
|
+
var WHATS_NEW_SEEN_KEY = "notices.whats_new_seen";
|
|
27192
|
+
function getWhatsNewSeenVersion(options = {}) {
|
|
27193
|
+
const value = getAtPath(readConfigObject("global", options), WHATS_NEW_SEEN_KEY);
|
|
27194
|
+
return typeof value === "string" ? value : null;
|
|
27195
|
+
}
|
|
27196
|
+
function setWhatsNewSeenVersion(version2, options = {}) {
|
|
27197
|
+
updateConfig((config2) => setAtPath(config2, WHATS_NEW_SEEN_KEY, version2), "global", options);
|
|
27198
|
+
}
|
|
27199
|
+
|
|
25156
27200
|
// ../configuration-core/src/secrets.ts
|
|
25157
27201
|
var import_dotenv = __toESM(require_dist3(), 1);
|
|
25158
|
-
import * as
|
|
27202
|
+
import * as fs5 from "node:fs";
|
|
25159
27203
|
import * as path5 from "node:path";
|
|
25160
27204
|
var SECRET_ENV_PREFIX = "ARGENT_SECRET_";
|
|
25161
27205
|
var SECRETS_FILE_NAME = "secrets.env";
|
|
@@ -25185,10 +27229,10 @@ function fileSource(filePath, exposure) {
|
|
|
25185
27229
|
names: [],
|
|
25186
27230
|
values: /* @__PURE__ */ new Map()
|
|
25187
27231
|
};
|
|
25188
|
-
if (!
|
|
27232
|
+
if (!fs5.statSync(filePath, { throwIfNoEntry: false })) return absent;
|
|
25189
27233
|
let content;
|
|
25190
27234
|
try {
|
|
25191
|
-
content =
|
|
27235
|
+
content = fs5.readFileSync(filePath, "utf8");
|
|
25192
27236
|
} catch {
|
|
25193
27237
|
return absent;
|
|
25194
27238
|
}
|
|
@@ -25214,7 +27258,9 @@ function fileSource(filePath, exposure) {
|
|
|
25214
27258
|
}
|
|
25215
27259
|
function secretSources(options = {}) {
|
|
25216
27260
|
const sources = [envSource(options.env ?? process.env)];
|
|
25217
|
-
const
|
|
27261
|
+
const home = resolveHomeDir(options);
|
|
27262
|
+
const found = findProjectRoot(options.cwd ?? process.cwd());
|
|
27263
|
+
const projectRoot = found && isHomeDir(found, options) ? home : found;
|
|
25218
27264
|
const filePaths = [];
|
|
25219
27265
|
if (projectRoot) {
|
|
25220
27266
|
filePaths.push({
|
|
@@ -25226,7 +27272,7 @@ function secretSources(options = {}) {
|
|
|
25226
27272
|
}
|
|
25227
27273
|
}
|
|
25228
27274
|
filePaths.push({
|
|
25229
|
-
path: path5.join(
|
|
27275
|
+
path: path5.join(home, ".argent", SECRETS_FILE_NAME),
|
|
25230
27276
|
exposure: "dedicated"
|
|
25231
27277
|
});
|
|
25232
27278
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -25348,14 +27394,6 @@ var CONFIG_SCHEMA = [
|
|
|
25348
27394
|
// drained/reset, not just the file rewritten.
|
|
25349
27395
|
manageCommand: "argent telemetry"
|
|
25350
27396
|
},
|
|
25351
|
-
{
|
|
25352
|
-
key: "allowlist.enabled",
|
|
25353
|
-
description: "Whether `argent update` re-applies editor auto-approve allowlist rules. Unset (the default) keeps the current behavior: update refreshes the rules for editors that already have argent configured. Set to `false` to keep update from touching editor allowlists. `false` in either scope wins, so a committed project opt-out holds for every teammate.",
|
|
25354
|
-
scopes: ["project", "global"],
|
|
25355
|
-
parse: asBoolean,
|
|
25356
|
-
merge: "prioritize-restrictive",
|
|
25357
|
-
example: "false"
|
|
25358
|
-
},
|
|
25359
27397
|
{
|
|
25360
27398
|
key: "lens.agent",
|
|
25361
27399
|
description: "Coding-agent id remembered by `argent lens` to skip the picker.",
|
|
@@ -25506,7 +27544,18 @@ function interpolateFileInputPath(template, args) {
|
|
|
25506
27544
|
});
|
|
25507
27545
|
return missing ? null : out;
|
|
25508
27546
|
}
|
|
25509
|
-
var TOOL_FILE_EXTENSIONS = [
|
|
27547
|
+
var TOOL_FILE_EXTENSIONS = [
|
|
27548
|
+
".png",
|
|
27549
|
+
".yaml",
|
|
27550
|
+
".wav",
|
|
27551
|
+
".mp3",
|
|
27552
|
+
".m4a",
|
|
27553
|
+
".aac",
|
|
27554
|
+
".caf",
|
|
27555
|
+
".aif",
|
|
27556
|
+
".aiff",
|
|
27557
|
+
".flac"
|
|
27558
|
+
];
|
|
25510
27559
|
function hasToolFileExtension(file) {
|
|
25511
27560
|
const name = file.toLowerCase();
|
|
25512
27561
|
return TOOL_FILE_EXTENSIONS.some((extension) => name.endsWith(extension));
|
|
@@ -25520,16 +27569,24 @@ function toolStepFiles(specs, args) {
|
|
|
25520
27569
|
}
|
|
25521
27570
|
return files;
|
|
25522
27571
|
}
|
|
25523
|
-
|
|
25524
|
-
|
|
27572
|
+
var UNEXPANDED_PATH = /^~|\$[A-Za-z0-9_{(]|`|%[A-Za-z_][A-Za-z0-9_]*%|^[A-Za-z][A-Za-z0-9+.-]+:/;
|
|
27573
|
+
function isUnexpandedPath(p) {
|
|
27574
|
+
return UNEXPANDED_PATH.test(p);
|
|
25525
27575
|
}
|
|
27576
|
+
function isClientFileArgument({ spec, path: path18 }) {
|
|
27577
|
+
return spec.kind === "file" && spec.path === `\${${spec.target}}` && path18.startsWith("/") && hasToolFileExtension(path18);
|
|
27578
|
+
}
|
|
27579
|
+
|
|
27580
|
+
// ../registry/src/flow-platforms.ts
|
|
27581
|
+
var LAUNCH_PLATFORMS = ["ios", "android", "chromium", "vega", "macos"];
|
|
27582
|
+
var SELECTABLE_PLATFORMS = [...LAUNCH_PLATFORMS, "ios-remote"];
|
|
25526
27583
|
|
|
25527
27584
|
// ../registry/src/flow-file-refs.ts
|
|
25528
|
-
import * as
|
|
27585
|
+
import * as fs7 from "node:fs/promises";
|
|
25529
27586
|
import * as path8 from "node:path";
|
|
25530
27587
|
|
|
25531
27588
|
// ../registry/src/e2e-dirs.ts
|
|
25532
|
-
import * as
|
|
27589
|
+
import * as fs6 from "node:fs/promises";
|
|
25533
27590
|
import * as path7 from "node:path";
|
|
25534
27591
|
var E2E_DIR = path7.join(".argent", "e2e");
|
|
25535
27592
|
var LEGACY_E2E_DIRS = Object.freeze([path7.join(".argent", "flows")]);
|
|
@@ -25544,7 +27601,7 @@ function e2eFileCandidates(projectRoot, name) {
|
|
|
25544
27601
|
return e2eDirsFor(projectRoot).map((dir) => path7.join(dir, `${name}.yaml`));
|
|
25545
27602
|
}
|
|
25546
27603
|
async function exists(file) {
|
|
25547
|
-
return
|
|
27604
|
+
return fs6.stat(file).then(
|
|
25548
27605
|
() => true,
|
|
25549
27606
|
() => false
|
|
25550
27607
|
);
|
|
@@ -25635,10 +27692,10 @@ function canonicalToolArgs(tool, args) {
|
|
|
25635
27692
|
// ../registry/src/flow-file-refs.ts
|
|
25636
27693
|
async function canonicalFlowPath(p) {
|
|
25637
27694
|
try {
|
|
25638
|
-
return await
|
|
27695
|
+
return await fs7.realpath(p);
|
|
25639
27696
|
} catch {
|
|
25640
27697
|
try {
|
|
25641
|
-
return path8.join(await
|
|
27698
|
+
return path8.join(await fs7.realpath(path8.dirname(p)), path8.basename(p));
|
|
25642
27699
|
} catch {
|
|
25643
27700
|
return p;
|
|
25644
27701
|
}
|
|
@@ -25654,6 +27711,9 @@ var MAX_BLOCK_NESTING = 64;
|
|
|
25654
27711
|
function isRecord(value) {
|
|
25655
27712
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
25656
27713
|
}
|
|
27714
|
+
function flowYamlSource(content) {
|
|
27715
|
+
return content.replace(/^\s+/, (lead) => lead.replace(/[^\n]/g, "")).trimEnd();
|
|
27716
|
+
}
|
|
25657
27717
|
function collectFlowRequests(doc) {
|
|
25658
27718
|
const runTargets = /* @__PURE__ */ new Set();
|
|
25659
27719
|
const snapshots = /* @__PURE__ */ new Set();
|
|
@@ -25684,15 +27744,15 @@ function collectFlowRequests(doc) {
|
|
|
25684
27744
|
if (isRecord(doc)) visit(doc.steps, 0);
|
|
25685
27745
|
return { runTargets: [...runTargets], snapshots: [...snapshots], toolSteps, nested };
|
|
25686
27746
|
}
|
|
25687
|
-
function baselineKeyFor(
|
|
25688
|
-
const stem = path8.basename(
|
|
27747
|
+
function baselineKeyFor(canonicalPath2, flowName) {
|
|
27748
|
+
const stem = path8.basename(canonicalPath2, ".yaml");
|
|
25689
27749
|
return FLOW_NAME_PATTERN.test(stem) ? stem : flowName;
|
|
25690
27750
|
}
|
|
25691
27751
|
function flowMemberKey(anchorDir, target) {
|
|
25692
27752
|
return `${anchorDir}\0${target}`;
|
|
25693
27753
|
}
|
|
25694
27754
|
async function classifyOnDiskSpelling(dir, base, addressable = FLOW_FILE_NAME_PATTERN) {
|
|
25695
|
-
const entries = await
|
|
27755
|
+
const entries = await fs7.readdir(dir).catch(() => null);
|
|
25696
27756
|
if (entries === null || entries.includes(base)) return { state: "listed" };
|
|
25697
27757
|
const actual = entries.find((entry) => entry.toLowerCase() === base.toLowerCase());
|
|
25698
27758
|
if (actual === void 0) return { state: "absent" };
|
|
@@ -25802,6 +27862,10 @@ var FAILURE_CODES = {
|
|
|
25802
27862
|
ANDROID_ADB_COMMAND_FAILED: "ANDROID_ADB_COMMAND_FAILED",
|
|
25803
27863
|
ANDROID_ADB_BOOT_TERMINAL_STATE: "ANDROID_ADB_BOOT_TERMINAL_STATE",
|
|
25804
27864
|
ANDROID_ADB_BOOT_TIMEOUT: "ANDROID_ADB_BOOT_TIMEOUT",
|
|
27865
|
+
ANDROID_NETWORK_PROXY_TIMEOUT: "ANDROID_NETWORK_PROXY_TIMEOUT",
|
|
27866
|
+
ANDROID_NETWORK_RESTORE_TIMEOUT: "ANDROID_NETWORK_RESTORE_TIMEOUT",
|
|
27867
|
+
ANDROID_OFFLINE_TIMEOUT: "ANDROID_OFFLINE_TIMEOUT",
|
|
27868
|
+
ANDROID_OFFLINE_UNSUPPORTED: "ANDROID_OFFLINE_UNSUPPORTED",
|
|
25805
27869
|
SIMULATOR_NETWORK_TIMEOUT: "SIMULATOR_NETWORK_TIMEOUT",
|
|
25806
27870
|
SIMULATOR_NETWORK_CONNECTION_REFUSED: "SIMULATOR_NETWORK_CONNECTION_REFUSED",
|
|
25807
27871
|
SIMULATOR_NETWORK_CONNECTION_RESET: "SIMULATOR_NETWORK_CONNECTION_RESET",
|
|
@@ -25921,12 +27985,15 @@ var FAILURE_CODES = {
|
|
|
25921
27985
|
DEBUGGER_CDP_PROTOCOL_ERROR: "DEBUGGER_CDP_PROTOCOL_ERROR",
|
|
25922
27986
|
DEBUGGER_CDP_CONNECT_FAILED: "DEBUGGER_CDP_CONNECT_FAILED",
|
|
25923
27987
|
DEBUGGER_CDP_SOCKET_CLOSED_BEFORE_OPEN: "DEBUGGER_CDP_SOCKET_CLOSED_BEFORE_OPEN",
|
|
27988
|
+
DEBUGGER_CDP_ORIGIN_REJECTED: "DEBUGGER_CDP_ORIGIN_REJECTED",
|
|
25924
27989
|
DEBUGGER_CDP_NOT_CONNECTED: "DEBUGGER_CDP_NOT_CONNECTED",
|
|
25925
27990
|
DEBUGGER_CDP_REQUEST_TIMEOUT: "DEBUGGER_CDP_REQUEST_TIMEOUT",
|
|
25926
27991
|
DEBUGGER_CDP_CONNECTION_CLOSED: "DEBUGGER_CDP_CONNECTION_CLOSED",
|
|
25927
27992
|
DEBUGGER_TARGET_DEVICE_MISMATCH: "DEBUGGER_TARGET_DEVICE_MISMATCH",
|
|
25928
27993
|
DEBUGGER_EVALUATE_EXPRESSION_THREW: "DEBUGGER_EVALUATE_EXPRESSION_THREW",
|
|
25929
27994
|
DEBUGGER_RELOAD_FAILED: "DEBUGGER_RELOAD_FAILED",
|
|
27995
|
+
// e2e-add-step refused a debugger-* call that answered `not_connected`.
|
|
27996
|
+
DEBUGGER_NOT_CONNECTED: "DEBUGGER_NOT_CONNECTED",
|
|
25930
27997
|
JS_RUNTIME_CONSOLE_SERVER_BIND_FAILED: "JS_RUNTIME_CONSOLE_SERVER_BIND_FAILED",
|
|
25931
27998
|
JS_RUNTIME_PAYLOAD_INVALID: "JS_RUNTIME_PAYLOAD_INVALID",
|
|
25932
27999
|
JS_RUNTIME_PAYLOAD_DEVICE_MISSING: "JS_RUNTIME_PAYLOAD_DEVICE_MISSING",
|
|
@@ -25940,7 +28007,7 @@ var FAILURE_CODES = {
|
|
|
25940
28007
|
ANDROID_NETWORK_INSPECTOR_RUN_AS_FAILED: "ANDROID_NETWORK_INSPECTOR_RUN_AS_FAILED",
|
|
25941
28008
|
ANDROID_NETWORK_INSPECTOR_DEVICE_IN_USE: "ANDROID_NETWORK_INSPECTOR_DEVICE_IN_USE",
|
|
25942
28009
|
ANDROID_NETWORK_INSPECTOR_NO_DEVICE_PORT: "ANDROID_NETWORK_INSPECTOR_NO_DEVICE_PORT",
|
|
25943
|
-
|
|
28010
|
+
NETWORK_CAPTURE_UNAVAILABLE: "NETWORK_CAPTURE_UNAVAILABLE",
|
|
25944
28011
|
NDJSON_CDP_REQUEST_TIMEOUT: "NDJSON_CDP_REQUEST_TIMEOUT",
|
|
25945
28012
|
NDJSON_CDP_REQUEST_FAILED: "NDJSON_CDP_REQUEST_FAILED",
|
|
25946
28013
|
NDJSON_CDP_CONNECTION_CLOSED: "NDJSON_CDP_CONNECTION_CLOSED",
|
|
@@ -25995,6 +28062,32 @@ var FAILURE_CODES = {
|
|
|
25995
28062
|
NATIVE_PROFILER_PERFETTO_PROCESS_ERROR: "NATIVE_PROFILER_PERFETTO_PROCESS_ERROR",
|
|
25996
28063
|
NATIVE_PROFILER_PERFETTO_READY_TIMEOUT: "NATIVE_PROFILER_PERFETTO_READY_TIMEOUT",
|
|
25997
28064
|
NATIVE_PROFILER_PERFETTO_READY_EXITED: "NATIVE_PROFILER_PERFETTO_READY_EXITED",
|
|
28065
|
+
/**
|
|
28066
|
+
* native-profiler-launch-analysis. Input problems use TOOL_INPUT_INVALID and
|
|
28067
|
+
* devicectl steps IOS_DEVICECTL_COMMAND_FAILED.
|
|
28068
|
+
* @see [workflow.ts](../../tool-server/src/utils/ios-launch-time/workflow.ts)
|
|
28069
|
+
*/
|
|
28070
|
+
// Not macOS, or an Xcode that cannot record the launch on this target.
|
|
28071
|
+
LAUNCH_ANALYSIS_UNSUPPORTED_HOST: "LAUNCH_ANALYSIS_UNSUPPORTED_HOST",
|
|
28072
|
+
// No usable iPhone or simulator was selected, or Argent's runner holds it.
|
|
28073
|
+
LAUNCH_ANALYSIS_DEVICE_UNAVAILABLE: "LAUNCH_ANALYSIS_DEVICE_UNAVAILABLE",
|
|
28074
|
+
// The bundle_id app is not installed on the selected device.
|
|
28075
|
+
LAUNCH_ANALYSIS_APP_NOT_INSTALLED: "LAUNCH_ANALYSIS_APP_NOT_INSTALLED",
|
|
28076
|
+
// The runner's xcodebuild failed on code signing or provisioning.
|
|
28077
|
+
LAUNCH_ANALYSIS_SIGNING_FAILED: "LAUNCH_ANALYSIS_SIGNING_FAILED",
|
|
28078
|
+
// The iPhone's free developer profile has no slot for Argent's runner.
|
|
28079
|
+
LAUNCH_ANALYSIS_FREE_PROFILE_LIMIT: "LAUNCH_ANALYSIS_FREE_PROFILE_LIMIT",
|
|
28080
|
+
// simctl could not wait for boot, find, launch or terminate the app.
|
|
28081
|
+
LAUNCH_ANALYSIS_SIMCTL_FAILED: "LAUNCH_ANALYSIS_SIMCTL_FAILED",
|
|
28082
|
+
LAUNCH_ANALYSIS_RECORD_FAILED: "LAUNCH_ANALYSIS_RECORD_FAILED",
|
|
28083
|
+
// xctrace could not export the TOC, the CPU samples or the first-frame marker.
|
|
28084
|
+
LAUNCH_ANALYSIS_EXPORT_FAILED: "LAUNCH_ANALYSIS_EXPORT_FAILED",
|
|
28085
|
+
// The App Launch trace has no first frame of the app, so it has no launch window.
|
|
28086
|
+
LAUNCH_ANALYSIS_NO_FIRST_FRAME: "LAUNCH_ANALYSIS_NO_FIRST_FRAME",
|
|
28087
|
+
// The XCTest launch run of Argent's runner failed.
|
|
28088
|
+
LAUNCH_ANALYSIS_RUNNER_TEST_FAILED: "LAUNCH_ANALYSIS_RUNNER_TEST_FAILED",
|
|
28089
|
+
// The launch test ran, but Argent read no launch measurements from its result.
|
|
28090
|
+
LAUNCH_ANALYSIS_NO_SAMPLES: "LAUNCH_ANALYSIS_NO_SAMPLES",
|
|
25998
28091
|
// iOS and Android share one capture path (simulator-server frames into
|
|
25999
28092
|
// ffmpeg), so these name the failing stage, not the device family.
|
|
26000
28093
|
SCREEN_RECORDING_FACTORY_OPTIONS_MISSING: "SCREEN_RECORDING_FACTORY_OPTIONS_MISSING",
|
|
@@ -26009,6 +28102,19 @@ var FAILURE_CODES = {
|
|
|
26009
28102
|
SCREEN_RECORDING_SERVER_SHUTTING_DOWN: "SCREEN_RECORDING_SERVER_SHUTTING_DOWN",
|
|
26010
28103
|
SCREEN_RECORDING_STREAM_UNAVAILABLE: "SCREEN_RECORDING_STREAM_UNAVAILABLE",
|
|
26011
28104
|
SCREEN_RECORDING_FFMPEG_NOT_FOUND: "SCREEN_RECORDING_FFMPEG_NOT_FOUND",
|
|
28105
|
+
// A cabled iPhone has no simulator-server: its frames come from a host-side
|
|
28106
|
+
// CoreMediaIO capture helper, which can fail in ways of its own.
|
|
28107
|
+
SCREEN_RECORDING_DEVICE_HELPER_BUILD_FAILED: "SCREEN_RECORDING_DEVICE_HELPER_BUILD_FAILED",
|
|
28108
|
+
SCREEN_RECORDING_DEVICE_SCREEN_NOT_FOUND: "SCREEN_RECORDING_DEVICE_SCREEN_NOT_FOUND",
|
|
28109
|
+
SCREEN_RECORDING_DEVICE_CAMERA_PERMISSION_DENIED: "SCREEN_RECORDING_DEVICE_CAMERA_PERMISSION_DENIED",
|
|
28110
|
+
SCREEN_RECORDING_DEVICE_HELPER_FAILED: "SCREEN_RECORDING_DEVICE_HELPER_FAILED",
|
|
28111
|
+
AUDIO_CLIP_CONVERSION_FAILED: "AUDIO_CLIP_CONVERSION_FAILED",
|
|
28112
|
+
AUDIO_HOOK_NOT_ACTIVE: "AUDIO_HOOK_NOT_ACTIVE",
|
|
28113
|
+
AUDIO_ENV_SETUP_FAILED: "AUDIO_ENV_SETUP_FAILED",
|
|
28114
|
+
AUDIO_WRONG_PLATFORM: "AUDIO_WRONG_PLATFORM",
|
|
28115
|
+
AUDIO_HOOK_UNAVAILABLE: "AUDIO_HOOK_UNAVAILABLE",
|
|
28116
|
+
AUDIO_INJECTION_NOT_OURS: "AUDIO_INJECTION_NOT_OURS",
|
|
28117
|
+
AUDIO_SIMULATOR_NOT_BOOTED: "AUDIO_SIMULATOR_NOT_BOOTED",
|
|
26012
28118
|
FLOW_PROJECT_ROOT_INVALID: "FLOW_PROJECT_ROOT_INVALID",
|
|
26013
28119
|
FLOW_NAME_INVALID: "FLOW_NAME_INVALID",
|
|
26014
28120
|
FLOW_NO_ACTIVE_RECORDING: "FLOW_NO_ACTIVE_RECORDING",
|
|
@@ -26072,6 +28178,8 @@ var FAILURE_CODES = {
|
|
|
26072
28178
|
MACOS_APP_BUNDLE_ID_MISMATCH: "MACOS_APP_BUNDLE_ID_MISMATCH",
|
|
26073
28179
|
MACOS_APP_OPEN_URL_FAILED: "MACOS_APP_OPEN_URL_FAILED",
|
|
26074
28180
|
MACOS_APP_FILE_ACCESS_FAILED: "MACOS_APP_FILE_ACCESS_FAILED",
|
|
28181
|
+
/** The app's loaded Argent library lacks support for the requested operation. */
|
|
28182
|
+
MACOS_APP_LIBRARY_OUTDATED: "MACOS_APP_LIBRARY_OUTDATED",
|
|
26075
28183
|
KEYBOARD_KEY_UNSUPPORTED: "KEYBOARD_KEY_UNSUPPORTED",
|
|
26076
28184
|
KEYBOARD_CHARACTER_UNSUPPORTED: "KEYBOARD_CHARACTER_UNSUPPORTED",
|
|
26077
28185
|
KEYBOARD_TEXT_AND_KEY_COMBINED: "KEYBOARD_TEXT_AND_KEY_COMBINED",
|
|
@@ -26141,13 +28249,19 @@ var FAILURE_COMMANDS = [
|
|
|
26141
28249
|
"ax_service",
|
|
26142
28250
|
"simulator_server",
|
|
26143
28251
|
"ffmpeg",
|
|
28252
|
+
"afconvert",
|
|
26144
28253
|
"cdp",
|
|
26145
28254
|
"electron",
|
|
26146
28255
|
"npm",
|
|
26147
28256
|
"npx",
|
|
26148
28257
|
"unknown",
|
|
26149
28258
|
"devicectl",
|
|
26150
|
-
"xcodebuild"
|
|
28259
|
+
"xcodebuild",
|
|
28260
|
+
"swiftc",
|
|
28261
|
+
// The host-side helper that captures a cabled iPhone's screen.
|
|
28262
|
+
"ios_screen_stream",
|
|
28263
|
+
// `xcrun xcresulttool`, which reads an XCTest result bundle.
|
|
28264
|
+
"xcresulttool"
|
|
26151
28265
|
];
|
|
26152
28266
|
var FAILURE_SIGNAL_NAMES = [
|
|
26153
28267
|
"SIGABRT",
|
|
@@ -26178,9 +28292,9 @@ var FAILURE_SPAWN_CODE_SET = new Set(FAILURE_SPAWN_CODES);
|
|
|
26178
28292
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
26179
28293
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
26180
28294
|
var resolvedDuringInvocation = new AsyncLocalStorage();
|
|
26181
|
-
function valueAtPath(root,
|
|
28295
|
+
function valueAtPath(root, path18) {
|
|
26182
28296
|
let current = root;
|
|
26183
|
-
for (const key of
|
|
28297
|
+
for (const key of path18) {
|
|
26184
28298
|
if (current === null || typeof current !== "object") return void 0;
|
|
26185
28299
|
if (!Object.hasOwn(current, key)) return void 0;
|
|
26186
28300
|
current = current[key];
|
|
@@ -26302,7 +28416,7 @@ import { spawn as spawn2 } from "node:child_process";
|
|
|
26302
28416
|
import { once } from "node:events";
|
|
26303
28417
|
import { createReadStream, createWriteStream } from "node:fs";
|
|
26304
28418
|
import { open as open2, rm, readdir as readdir3 } from "node:fs/promises";
|
|
26305
|
-
import { basename as basename4, dirname as dirname5, join as join9, resolve as
|
|
28419
|
+
import { basename as basename4, dirname as dirname5, join as join9, resolve as resolve7, sep as sep2 } from "node:path";
|
|
26306
28420
|
import { Writable } from "node:stream";
|
|
26307
28421
|
import { pipeline } from "node:stream/promises";
|
|
26308
28422
|
import zlib from "node:zlib";
|
|
@@ -26400,7 +28514,7 @@ async function sniffFormat(archivePath) {
|
|
|
26400
28514
|
}
|
|
26401
28515
|
}
|
|
26402
28516
|
var ZSTD_FRAME_MAGIC = 4247762216;
|
|
26403
|
-
async function assertSingleCompleteZstdFrame(archivePath) {
|
|
28517
|
+
async function assertSingleCompleteZstdFrame(archivePath, signal) {
|
|
26404
28518
|
const fh = await open2(archivePath, "r");
|
|
26405
28519
|
try {
|
|
26406
28520
|
const { size } = await fh.stat();
|
|
@@ -26410,6 +28524,7 @@ async function assertSingleCompleteZstdFrame(archivePath) {
|
|
|
26410
28524
|
let pos = 0;
|
|
26411
28525
|
const read = async (n) => {
|
|
26412
28526
|
if (pos < windowStart || pos + n > windowEnd) {
|
|
28527
|
+
signal?.throwIfAborted();
|
|
26413
28528
|
const { bytesRead } = await fh.read(window, 0, window.length, pos);
|
|
26414
28529
|
windowStart = pos;
|
|
26415
28530
|
windowEnd = pos + bytesRead;
|
|
@@ -26447,14 +28562,16 @@ function tarEnv(env) {
|
|
|
26447
28562
|
const characterType = env.LC_ALL || env.LC_CTYPE || env.LANG || "";
|
|
26448
28563
|
return /utf-?8/i.test(characterType) ? env : { ...env, LC_ALL: TAR_LOCALE };
|
|
26449
28564
|
}
|
|
26450
|
-
async function runTar(archive, args) {
|
|
28565
|
+
async function runTar(archive, args, signal) {
|
|
26451
28566
|
const child = spawn2("tar", [...args, "-f", "-"], {
|
|
28567
|
+
signal,
|
|
26452
28568
|
env: tarEnv(process.env)
|
|
26453
28569
|
});
|
|
26454
|
-
|
|
26455
|
-
|
|
26456
|
-
|
|
28570
|
+
let childError;
|
|
28571
|
+
child.on("error", (err) => {
|
|
28572
|
+
childError = err;
|
|
26457
28573
|
});
|
|
28574
|
+
const closed = new Promise((resolve12) => child.once("close", resolve12));
|
|
26458
28575
|
const stdout = collect(child.stdout, MAX_LISTING_BYTES, {
|
|
26459
28576
|
maxLines: MAX_LISTING_LINES,
|
|
26460
28577
|
onOverflow: () => child.kill()
|
|
@@ -26481,12 +28598,15 @@ async function runTar(archive, args) {
|
|
|
26481
28598
|
if (err) child.stdin?.destroy();
|
|
26482
28599
|
done(err);
|
|
26483
28600
|
}
|
|
26484
|
-
})
|
|
28601
|
+
}),
|
|
28602
|
+
{ signal }
|
|
26485
28603
|
).then(
|
|
26486
28604
|
() => null,
|
|
26487
28605
|
(err) => err
|
|
26488
28606
|
);
|
|
26489
|
-
const [code, feedError] = await Promise.all([
|
|
28607
|
+
const [code, feedError] = await Promise.all([closed, fed]);
|
|
28608
|
+
signal?.throwIfAborted();
|
|
28609
|
+
if (childError) throw childError;
|
|
26490
28610
|
if (stdout.overflowed()) {
|
|
26491
28611
|
throw new Error(
|
|
26492
28612
|
`tar ${args.join(" ")} listed more than ${MAX_LISTING_LINES} members or ${MAX_LISTING_BYTES >> 20} MiB`
|
|
@@ -26500,32 +28620,33 @@ async function runTar(archive, args) {
|
|
|
26500
28620
|
function normalizeTarMemberPath(memberPath) {
|
|
26501
28621
|
return memberPath.replace(/^\.\//, "").replace(/\\/g, "/");
|
|
26502
28622
|
}
|
|
26503
|
-
function isContainedPath(
|
|
26504
|
-
const slashed =
|
|
28623
|
+
function isContainedPath(path18, windows = process.platform === "win32") {
|
|
28624
|
+
const slashed = path18.replace(/\\/g, "/");
|
|
26505
28625
|
const drive = windows ? /^[A-Za-z]:/ : /^[A-Za-z]:\//;
|
|
26506
28626
|
return !slashed.startsWith("/") && !drive.test(slashed) && !slashed.split("/").includes("..");
|
|
26507
28627
|
}
|
|
26508
28628
|
function isSafeTarMember(memberPath, destDir) {
|
|
26509
28629
|
const normalized = normalizeTarMemberPath(memberPath);
|
|
26510
28630
|
if (!isContainedPath(normalized)) return false;
|
|
26511
|
-
const root =
|
|
26512
|
-
return
|
|
28631
|
+
const root = resolve7(destDir);
|
|
28632
|
+
return resolve7(destDir, normalized).startsWith(root + sep2);
|
|
26513
28633
|
}
|
|
26514
|
-
async function readListing(archive, args) {
|
|
28634
|
+
async function readListing(archive, args, signal) {
|
|
26515
28635
|
try {
|
|
26516
|
-
return await runTar(archive, args);
|
|
28636
|
+
return await runTar(archive, args, signal);
|
|
26517
28637
|
} catch (err) {
|
|
28638
|
+
signal?.throwIfAborted();
|
|
26518
28639
|
throw new ArchiveError(
|
|
26519
28640
|
`Could not read archive: ${err instanceof Error ? err.message : String(err)}`
|
|
26520
28641
|
);
|
|
26521
28642
|
}
|
|
26522
28643
|
}
|
|
26523
|
-
async function listTarMembers(archive) {
|
|
26524
|
-
const stdout = await readListing(archive, ["-t"]);
|
|
28644
|
+
async function listTarMembers(archive, signal) {
|
|
28645
|
+
const stdout = await readListing(archive, ["-t"], signal);
|
|
26525
28646
|
return stdout.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
26526
28647
|
}
|
|
26527
|
-
async function assertSafeMemberTypes(archive) {
|
|
26528
|
-
const stdout = await readListing(archive, ["-tv"]);
|
|
28648
|
+
async function assertSafeMemberTypes(archive, signal) {
|
|
28649
|
+
const stdout = await readListing(archive, ["-tv"], signal);
|
|
26529
28650
|
for (const line of stdout.split("\n")) {
|
|
26530
28651
|
if (!line.trim()) continue;
|
|
26531
28652
|
const type = line[0];
|
|
@@ -26545,8 +28666,8 @@ async function assertSafeMemberTypes(archive) {
|
|
|
26545
28666
|
);
|
|
26546
28667
|
}
|
|
26547
28668
|
}
|
|
26548
|
-
async function assertSafeArchive(archive, destDir) {
|
|
26549
|
-
const members2 = await listTarMembers(archive);
|
|
28669
|
+
async function assertSafeArchive(archive, destDir, signal) {
|
|
28670
|
+
const members2 = await listTarMembers(archive, signal);
|
|
26550
28671
|
if (members2.length === 0) {
|
|
26551
28672
|
throw new ArchiveError("Archive is empty.");
|
|
26552
28673
|
}
|
|
@@ -26555,7 +28676,7 @@ async function assertSafeArchive(archive, destDir) {
|
|
|
26555
28676
|
throw new ArchiveError(`Archive contains an unsafe path "${member}" \u2014 refusing extraction.`);
|
|
26556
28677
|
}
|
|
26557
28678
|
}
|
|
26558
|
-
await assertSafeMemberTypes(archive);
|
|
28679
|
+
await assertSafeMemberTypes(archive, signal);
|
|
26559
28680
|
}
|
|
26560
28681
|
async function resolveMember(destDir, expectedName) {
|
|
26561
28682
|
const entries = await readdir3(destDir);
|
|
@@ -26570,19 +28691,24 @@ async function resolveMember(destDir, expectedName) {
|
|
|
26570
28691
|
}
|
|
26571
28692
|
return join9(destDir, real[0]);
|
|
26572
28693
|
}
|
|
26573
|
-
async function safeExtractArchive(archivePath, destDir, expectedName) {
|
|
28694
|
+
async function safeExtractArchive(archivePath, destDir, expectedName, signal) {
|
|
28695
|
+
signal?.throwIfAborted();
|
|
26574
28696
|
let archive;
|
|
26575
28697
|
try {
|
|
26576
28698
|
archive = { path: archivePath, format: await sniffFormat(archivePath) };
|
|
26577
|
-
if (archive.format === "zstd") await assertSingleCompleteZstdFrame(archivePath);
|
|
28699
|
+
if (archive.format === "zstd") await assertSingleCompleteZstdFrame(archivePath, signal);
|
|
26578
28700
|
} catch (err) {
|
|
28701
|
+
signal?.throwIfAborted();
|
|
26579
28702
|
throw new ArchiveError(
|
|
26580
28703
|
`Could not read archive: ${err instanceof Error ? err.message : String(err)}`
|
|
26581
28704
|
);
|
|
26582
28705
|
}
|
|
26583
|
-
await assertSafeArchive(archive, destDir);
|
|
26584
|
-
|
|
26585
|
-
|
|
28706
|
+
await assertSafeArchive(archive, destDir, signal);
|
|
28707
|
+
signal?.throwIfAborted();
|
|
28708
|
+
await runTar(archive, ["-x", "-C", destDir], signal);
|
|
28709
|
+
const member = await resolveMember(destDir, expectedName);
|
|
28710
|
+
signal?.throwIfAborted();
|
|
28711
|
+
return member;
|
|
26586
28712
|
}
|
|
26587
28713
|
|
|
26588
28714
|
// ../argent-tools-client/src/errors.ts
|
|
@@ -26615,6 +28741,22 @@ function interpolatePath(template, args) {
|
|
|
26615
28741
|
});
|
|
26616
28742
|
return missing ? null : out;
|
|
26617
28743
|
}
|
|
28744
|
+
function callerPath(p) {
|
|
28745
|
+
const onCurrentDrive = path10.sep === "\\" && /^[\\/](?![\\/])/.test(p);
|
|
28746
|
+
if (!onCurrentDrive && (path10.isAbsolute(p) || path10.win32.isAbsolute(p) || isUnexpandedPath(p))) {
|
|
28747
|
+
return p;
|
|
28748
|
+
}
|
|
28749
|
+
const { root } = path10.parse(p);
|
|
28750
|
+
const rest = p.slice(root.length);
|
|
28751
|
+
if (!rest.split(/[\\/]/).includes("..")) {
|
|
28752
|
+
const resolved = path10.resolve(p);
|
|
28753
|
+
const last = p.split(path10.sep === "\\" ? /[\\/]/ : "/").at(-1);
|
|
28754
|
+
const dirOnly = p !== last && (last === "" || last === ".") && !resolved.endsWith(path10.sep);
|
|
28755
|
+
return dirOnly ? `${resolved}${path10.sep}` : resolved;
|
|
28756
|
+
}
|
|
28757
|
+
const base = path10.resolve(root);
|
|
28758
|
+
return base.endsWith(path10.sep) ? `${base}${rest}` : `${base}${path10.sep}${rest}`;
|
|
28759
|
+
}
|
|
26618
28760
|
async function specPath(spec, args) {
|
|
26619
28761
|
if (spec.kind !== "file" || !spec.paths?.length) return interpolatePath(spec.path, args);
|
|
26620
28762
|
const candidates = [];
|
|
@@ -26659,10 +28801,10 @@ function untrackArchive(archive) {
|
|
|
26659
28801
|
for (const s of ARCHIVE_SIGNALS) process.removeListener(s, removeArchivesOnSignal);
|
|
26660
28802
|
process.removeListener("exit", removePendingArchives);
|
|
26661
28803
|
}
|
|
26662
|
-
function sha256File(filePath) {
|
|
26663
|
-
return new Promise((
|
|
28804
|
+
function sha256File(filePath, signal) {
|
|
28805
|
+
return new Promise((resolve12, reject) => {
|
|
26664
28806
|
const hash = createHash2("sha256");
|
|
26665
|
-
createReadStream2(filePath).on("data", (chunk) => hash.update(chunk)).on("end", () =>
|
|
28807
|
+
createReadStream2(filePath, { signal }).on("data", (chunk) => hash.update(chunk)).on("end", () => resolve12(hash.digest("hex"))).on("error", reject);
|
|
26666
28808
|
});
|
|
26667
28809
|
}
|
|
26668
28810
|
function toolServerError(text) {
|
|
@@ -26725,7 +28867,7 @@ async function uploadFile(sourcePath, endpoint, signal) {
|
|
|
26725
28867
|
trackArchive(tarPath);
|
|
26726
28868
|
try {
|
|
26727
28869
|
await createArchiveFile(await realpath2(sourcePath), tarPath, format, signal);
|
|
26728
|
-
const contentHash = await sha256File(tarPath);
|
|
28870
|
+
const contentHash = await sha256File(tarPath, signal);
|
|
26729
28871
|
return { uploadId: await uploadTar(tarPath, format, endpoint, signal), contentHash };
|
|
26730
28872
|
} finally {
|
|
26731
28873
|
untrackArchive(tarPath);
|
|
@@ -26760,13 +28902,21 @@ async function prepareFileInputs(specs, args, opts) {
|
|
|
26760
28902
|
return args;
|
|
26761
28903
|
}
|
|
26762
28904
|
const record2 = args;
|
|
26763
|
-
|
|
28905
|
+
const planned = [];
|
|
28906
|
+
const callArgs = { ...record2 };
|
|
26764
28907
|
for (const spec of specs) {
|
|
26765
28908
|
if (spec.skipWhenSet && record2[spec.skipWhenSet] !== void 0) continue;
|
|
26766
28909
|
if (spec.target in record2 && typeof record2[spec.target] !== "string") continue;
|
|
26767
|
-
const
|
|
26768
|
-
if (
|
|
26769
|
-
if (spec.target in record2 && record2[spec.target] !==
|
|
28910
|
+
const spelled = await specPath(spec, record2);
|
|
28911
|
+
if (spelled === null) continue;
|
|
28912
|
+
if (spec.target in record2 && record2[spec.target] !== spelled) continue;
|
|
28913
|
+
const filePath = callerPath(spelled);
|
|
28914
|
+
planned.push({ spec, filePath });
|
|
28915
|
+
if (spec.target in record2) callArgs[spec.target] = filePath;
|
|
28916
|
+
}
|
|
28917
|
+
if (planned.length === 0) return args;
|
|
28918
|
+
const out = { ...record2 };
|
|
28919
|
+
for (const { spec, filePath } of planned) {
|
|
26770
28920
|
const wire = { [FILE_INPUT_MARKER2]: true, path: filePath };
|
|
26771
28921
|
if (spec.kind === "file") {
|
|
26772
28922
|
const read = await readFileInputWire(filePath, { includeContent: opts.includeContent });
|
|
@@ -26774,12 +28924,12 @@ async function prepareFileInputs(specs, args, opts) {
|
|
|
26774
28924
|
if (spec.collect === "flow" && opts.includeContent && wire.content !== void 0 && opts.collectMembers) {
|
|
26775
28925
|
Object.assign(
|
|
26776
28926
|
wire,
|
|
26777
|
-
await opts.collectMembers(filePath, Buffer.from(wire.content, "base64"),
|
|
28927
|
+
await opts.collectMembers(filePath, Buffer.from(wire.content, "base64"), callArgs, opts)
|
|
26778
28928
|
);
|
|
26779
28929
|
}
|
|
26780
28930
|
}
|
|
26781
28931
|
if (spec.kind === "probe" && spec.collect === "step" && opts.includeContent && opts.collectStepMembers) {
|
|
26782
|
-
wire.members = await opts.collectStepMembers(
|
|
28932
|
+
wire.members = await opts.collectStepMembers(callArgs, opts);
|
|
26783
28933
|
}
|
|
26784
28934
|
if (spec.kind === "tar-upload") {
|
|
26785
28935
|
const st = await stat3(filePath).catch(() => null);
|
|
@@ -26793,10 +28943,9 @@ async function prepareFileInputs(specs, args, opts) {
|
|
|
26793
28943
|
Object.assign(wire, await uploadFile(filePath, opts.uploadEndpoint, opts.signal));
|
|
26794
28944
|
}
|
|
26795
28945
|
}
|
|
26796
|
-
out = out ?? { ...record2 };
|
|
26797
28946
|
out[spec.target] = wire;
|
|
26798
28947
|
}
|
|
26799
|
-
return out
|
|
28948
|
+
return out;
|
|
26800
28949
|
}
|
|
26801
28950
|
function isAllowedClientFilePath(p) {
|
|
26802
28951
|
if (!path10.isAbsolute(p)) return false;
|
|
@@ -27160,7 +29309,7 @@ function memberCollector(roots, opts) {
|
|
|
27160
29309
|
for (let file = files.shift(); file !== void 0; file = files.shift()) {
|
|
27161
29310
|
let doc;
|
|
27162
29311
|
try {
|
|
27163
|
-
doc = (0, import_yaml.parse)(file.text
|
|
29312
|
+
doc = (0, import_yaml.parse)(flowYamlSource(file.text), { logLevel: "error" });
|
|
27164
29313
|
} catch {
|
|
27165
29314
|
continue;
|
|
27166
29315
|
}
|
|
@@ -27275,7 +29424,7 @@ function recordedStep(args) {
|
|
|
27275
29424
|
async function collectStepMembers(args, opts, recordingDirFor = e2eDirFor) {
|
|
27276
29425
|
const { name, project_root: projectRoot } = args;
|
|
27277
29426
|
const step = recordedStep(args);
|
|
27278
|
-
if (typeof name !== "string" || !FLOW_NAME_PATTERN.test(name) ||
|
|
29427
|
+
if (typeof name !== "string" || !FLOW_NAME_PATTERN.test(name) || !isResolvedAbsolute2(projectRoot) || step === void 0) {
|
|
27279
29428
|
return [];
|
|
27280
29429
|
}
|
|
27281
29430
|
const recording = path11.join(recordingDirFor(projectRoot), `${name}.yaml`);
|
|
@@ -27361,7 +29510,10 @@ async function stepForOlderServer(args, listedId) {
|
|
|
27361
29510
|
async function e2eShadowWarningFor(tool, args) {
|
|
27362
29511
|
const id = canonicalToolId(tool);
|
|
27363
29512
|
if (id !== "e2e-execute" && id !== "e2e-read-prerequisite") return void 0;
|
|
27364
|
-
const
|
|
29513
|
+
const root = args?.project_root;
|
|
29514
|
+
const target = nestedFlowTarget(
|
|
29515
|
+
typeof root === "string" ? { ...args, project_root: callerPath(root) } : args
|
|
29516
|
+
);
|
|
27365
29517
|
if (target?.kind !== "name") return void 0;
|
|
27366
29518
|
const picked = await pickE2eFile(target.paths);
|
|
27367
29519
|
return picked.shadowed === void 0 ? void 0 : e2eShadowWarning(picked.path, picked.shadowed);
|
|
@@ -27479,6 +29631,34 @@ function assertRequiredPresent(meta2, args) {
|
|
|
27479
29631
|
describeParamIssues({ issues }, record2)
|
|
27480
29632
|
);
|
|
27481
29633
|
}
|
|
29634
|
+
var MAX_NON_FINITE_ISSUES = 12;
|
|
29635
|
+
function assertFiniteNumbers(args) {
|
|
29636
|
+
const issues = [];
|
|
29637
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
29638
|
+
const pending = [{ value: args, key: "" }];
|
|
29639
|
+
for (let i = 0; i < pending.length && issues.length < MAX_NON_FINITE_ISSUES; i++) {
|
|
29640
|
+
const visit = pending[i];
|
|
29641
|
+
const { value } = visit;
|
|
29642
|
+
if (typeof value !== "object" || value === null || seen.has(value)) continue;
|
|
29643
|
+
seen.add(value);
|
|
29644
|
+
for (const [key, item] of Array.isArray(value) ? value.entries() : Object.entries(value)) {
|
|
29645
|
+
if (typeof item === "object" && item !== null) {
|
|
29646
|
+
pending.push({ value: item, key, parent: visit });
|
|
29647
|
+
} else if (typeof item === "number" && !Number.isFinite(item)) {
|
|
29648
|
+
const path18 = [key];
|
|
29649
|
+
for (let at = visit; at.parent; at = at.parent) path18.push(at.key);
|
|
29650
|
+
path18.reverse();
|
|
29651
|
+
issues.push({ code: "invalid_type", path: path18, message: `expected a number, got ${item}` });
|
|
29652
|
+
if (issues.length === MAX_NON_FINITE_ISSUES) break;
|
|
29653
|
+
}
|
|
29654
|
+
}
|
|
29655
|
+
}
|
|
29656
|
+
if (issues.length === 0) return;
|
|
29657
|
+
throw new ToolInvocationError(
|
|
29658
|
+
describeParamIssues({ issues }, args),
|
|
29659
|
+
{ errorKind: "validation", issues }
|
|
29660
|
+
);
|
|
29661
|
+
}
|
|
27482
29662
|
function fetchFailure(err) {
|
|
27483
29663
|
if (!(err instanceof Error)) return String(err);
|
|
27484
29664
|
return err.cause instanceof Error ? `${err.message}: ${err.cause.message}` : err.message;
|
|
@@ -27525,7 +29705,7 @@ async function forwardedSecrets(args) {
|
|
|
27525
29705
|
}
|
|
27526
29706
|
let parsed;
|
|
27527
29707
|
try {
|
|
27528
|
-
parsed = text === void 0 ? void 0 : (0, import_yaml2.parse)(text
|
|
29708
|
+
parsed = text === void 0 ? void 0 : (0, import_yaml2.parse)(flowYamlSource(text), { logLevel: "error" });
|
|
27529
29709
|
} catch {
|
|
27530
29710
|
continue;
|
|
27531
29711
|
}
|
|
@@ -27556,6 +29736,34 @@ function secretsTransportRefusal(url) {
|
|
|
27556
29736
|
return void 0;
|
|
27557
29737
|
}
|
|
27558
29738
|
var FETCH_HEAD_BYTES = 256;
|
|
29739
|
+
function isRecord2(value) {
|
|
29740
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
29741
|
+
}
|
|
29742
|
+
var PROJECT_PATH_ADVICE = {
|
|
29743
|
+
project_root: "Pass the absolute path to the project root directory - the same cwd the calling agent is working in.",
|
|
29744
|
+
e2e_test_path: "Pass the absolute path to the e2e test file."
|
|
29745
|
+
};
|
|
29746
|
+
function assertAbsoluteProjectPaths(meta2, args) {
|
|
29747
|
+
if (!meta2 || !isRecord2(args)) return;
|
|
29748
|
+
const aliases = Object.entries(toolParamAliases(meta2.name));
|
|
29749
|
+
for (const [param, advice] of Object.entries(PROJECT_PATH_ADVICE)) {
|
|
29750
|
+
const value = args[param];
|
|
29751
|
+
if (typeof value !== "string" || callerPath(value) === value) continue;
|
|
29752
|
+
const names = [param, ...aliases.filter(([, current]) => current === param).map(([f]) => f)];
|
|
29753
|
+
if (!meta2.fileInputs?.some((spec) => names.some((n) => spec.path.includes(`\${${n}}`)))) {
|
|
29754
|
+
continue;
|
|
29755
|
+
}
|
|
29756
|
+
throw new Error(`${param} must be an absolute path (got "${value}"). ${advice}`);
|
|
29757
|
+
}
|
|
29758
|
+
}
|
|
29759
|
+
function failedRun(result) {
|
|
29760
|
+
if (!isRecord2(result)) return result;
|
|
29761
|
+
if (result.ok === true) return { ...result, ok: false };
|
|
29762
|
+
if (isRecord2(result.toolResult) && result.toolResult.ok === true) {
|
|
29763
|
+
return { ...result, toolResult: { ...result.toolResult, ok: false } };
|
|
29764
|
+
}
|
|
29765
|
+
return result;
|
|
29766
|
+
}
|
|
27559
29767
|
function createToolsClient(options = {}) {
|
|
27560
29768
|
let cached2 = null;
|
|
27561
29769
|
const doFetch = options.fetchImpl ?? ((url, init) => fetch(url, init));
|
|
@@ -27600,10 +29808,12 @@ function createToolsClient(options = {}) {
|
|
|
27600
29808
|
}
|
|
27601
29809
|
async function callTool(name, args, opts) {
|
|
27602
29810
|
opts?.signal?.throwIfAborted();
|
|
29811
|
+
assertFiniteNumbers(args);
|
|
27603
29812
|
const { url, token, remote } = await route();
|
|
27604
29813
|
let finalArgs = canonicalToolArgs(name, args);
|
|
27605
29814
|
const { tools, uploadFormats } = await fetchToolList({ signal: opts?.signal });
|
|
27606
29815
|
const meta2 = findTool(tools, name);
|
|
29816
|
+
if (options.refuseRelativeProjectPaths) assertAbsoluteProjectPaths(meta2, finalArgs);
|
|
27607
29817
|
const olderServer = meta2 !== null && !tools.some((t) => t.name === canonicalToolId(meta2.name));
|
|
27608
29818
|
if (meta2) {
|
|
27609
29819
|
finalArgs = await nameToE2ePathForOlderServer(meta2.name, meta2.fileInputs, finalArgs);
|
|
@@ -27641,7 +29851,7 @@ function createToolsClient(options = {}) {
|
|
|
27641
29851
|
}
|
|
27642
29852
|
}
|
|
27643
29853
|
}
|
|
27644
|
-
const result = applied.result;
|
|
29854
|
+
const result = applied.failed.length > 0 ? failedRun(applied.result) : applied.result;
|
|
27645
29855
|
if (shadowWarning === void 0 || typeof result !== "object" || result === null || Array.isArray(result) || typeof result.warning === "string") {
|
|
27646
29856
|
return result;
|
|
27647
29857
|
}
|
|
@@ -27768,10 +29978,19 @@ function createToolsClient(options = {}) {
|
|
|
27768
29978
|
}
|
|
27769
29979
|
|
|
27770
29980
|
// ../argent-tools-client/src/artifacts.ts
|
|
27771
|
-
import {
|
|
29981
|
+
import {
|
|
29982
|
+
copyFile,
|
|
29983
|
+
mkdir as mkdir4,
|
|
29984
|
+
mkdtemp,
|
|
29985
|
+
readFile as readFile6,
|
|
29986
|
+
realpath as realpath4,
|
|
29987
|
+
rm as rm3,
|
|
29988
|
+
stat as stat5,
|
|
29989
|
+
writeFile as writeFile4
|
|
29990
|
+
} from "node:fs/promises";
|
|
27772
29991
|
import { constants as fsConstants } from "node:fs";
|
|
27773
29992
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
27774
|
-
import { basename as basename7, dirname as dirname9, extname as extname2, isAbsolute as isAbsolute6, join as join13, normalize as normalize2, resolve as
|
|
29993
|
+
import { basename as basename7, dirname as dirname9, extname as extname2, isAbsolute as isAbsolute6, join as join13, normalize as normalize2, resolve as resolve10, sep as sep5 } from "node:path";
|
|
27775
29994
|
import { createHash as createHash3 } from "node:crypto";
|
|
27776
29995
|
var ARTIFACT_MARKER2 = "__argentArtifact";
|
|
27777
29996
|
function isArtifactHandle(value) {
|
|
@@ -27819,8 +30038,8 @@ function configuredRecordingsDir() {
|
|
|
27819
30038
|
const trimmed = value.trim();
|
|
27820
30039
|
if (trimmed === "") return null;
|
|
27821
30040
|
const home = dirname9(argentHomeDir());
|
|
27822
|
-
const expanded = trimmed === "~" ? home : trimmed.startsWith("~/") || trimmed.startsWith(`~${
|
|
27823
|
-
return
|
|
30041
|
+
const expanded = trimmed === "~" ? home : trimmed.startsWith("~/") || trimmed.startsWith(`~${sep5}`) ? join13(home, trimmed.slice(2)) : trimmed;
|
|
30042
|
+
return resolve10(durableBaseDir(), expanded);
|
|
27824
30043
|
}
|
|
27825
30044
|
var MAX_ARTIFACT_BYTES = 2 * 1024 * 1024 * 1024;
|
|
27826
30045
|
async function readCapped(res, cap) {
|
|
@@ -27853,10 +30072,10 @@ async function writeDurableUnique(dir, filename, write) {
|
|
|
27853
30072
|
const stem = filename.slice(0, filename.length - ext.length);
|
|
27854
30073
|
for (let i = 1; i <= 1e3; i++) {
|
|
27855
30074
|
const candidate = i === 1 ? filename : `${stem} (${i})${ext}`;
|
|
27856
|
-
const
|
|
30075
|
+
const path18 = join13(dir, candidate);
|
|
27857
30076
|
try {
|
|
27858
|
-
await write(
|
|
27859
|
-
return
|
|
30077
|
+
await write(path18);
|
|
30078
|
+
return path18;
|
|
27860
30079
|
} catch (err) {
|
|
27861
30080
|
if (err?.code === "EEXIST") continue;
|
|
27862
30081
|
throw err;
|
|
@@ -27867,7 +30086,7 @@ async function writeDurableUnique(dir, filename, write) {
|
|
|
27867
30086
|
function durableSaveTarget(handle) {
|
|
27868
30087
|
if (typeof handle.saveDir !== "string" || !handle.saveDir || handle.archive) return null;
|
|
27869
30088
|
const rel = normalize2(handle.saveDir);
|
|
27870
|
-
if (isAbsolute6(rel) || rel === ".." || rel.startsWith(`..${
|
|
30089
|
+
if (isAbsolute6(rel) || rel === ".." || rel.startsWith(`..${sep5}`) || rel.split(sep5).includes("..")) {
|
|
27871
30090
|
return null;
|
|
27872
30091
|
}
|
|
27873
30092
|
if (!ALLOWED_SAVE_DIRS.has(rel)) return null;
|
|
@@ -27912,16 +30131,22 @@ async function resolveLocalFile(handle) {
|
|
|
27912
30131
|
return null;
|
|
27913
30132
|
}
|
|
27914
30133
|
}
|
|
27915
|
-
async function downloadAndExtractArchive(handle, data, dir) {
|
|
27916
|
-
|
|
30134
|
+
async function downloadAndExtractArchive(handle, data, dir, signal) {
|
|
30135
|
+
signal?.throwIfAborted();
|
|
30136
|
+
const attemptDir = await mkdtemp(join13(dir, "bundle-"));
|
|
30137
|
+
const tarball = join13(attemptDir, "download.tar");
|
|
30138
|
+
const extractDir = join13(attemptDir, "files");
|
|
27917
30139
|
try {
|
|
27918
|
-
await writeFile4(tarball, data);
|
|
27919
|
-
|
|
30140
|
+
await writeFile4(tarball, data, { signal });
|
|
30141
|
+
await mkdir4(extractDir);
|
|
30142
|
+
const member = await safeExtractArchive(tarball, extractDir, handle.filename, signal);
|
|
30143
|
+
await rm3(tarball);
|
|
30144
|
+
signal?.throwIfAborted();
|
|
30145
|
+
return member;
|
|
27920
30146
|
} catch {
|
|
27921
|
-
|
|
27922
|
-
} finally {
|
|
27923
|
-
await rm3(tarball, { force: true }).catch(() => {
|
|
30147
|
+
await rm3(attemptDir, { recursive: true, force: true }).catch(() => {
|
|
27924
30148
|
});
|
|
30149
|
+
return null;
|
|
27925
30150
|
}
|
|
27926
30151
|
}
|
|
27927
30152
|
async function materializeArtifacts(result, ctx) {
|
|
@@ -28007,7 +30232,7 @@ async function materializeArtifacts(result, ctx) {
|
|
|
28007
30232
|
if (!data) return null;
|
|
28008
30233
|
await ensureDir();
|
|
28009
30234
|
if (value.archive === "tar.gz") {
|
|
28010
|
-
return await downloadAndExtractArchive(value, data, dir);
|
|
30235
|
+
return await downloadAndExtractArchive(value, data, dir, ctx.signal);
|
|
28011
30236
|
}
|
|
28012
30237
|
if (value.size > 0 && data.length !== value.size) return null;
|
|
28013
30238
|
const downloadedPath = join13(dir, sanitizeSegment(value.filename));
|
|
@@ -28044,7 +30269,7 @@ function getDeviceIdFromArgs(args) {
|
|
|
28044
30269
|
}
|
|
28045
30270
|
|
|
28046
30271
|
// ../telemetry/src/debug.ts
|
|
28047
|
-
import * as
|
|
30272
|
+
import * as fs8 from "node:fs";
|
|
28048
30273
|
|
|
28049
30274
|
// ../telemetry/src/paths.ts
|
|
28050
30275
|
import * as path13 from "node:path";
|
|
@@ -28066,7 +30291,8 @@ var DEVICE_KINDS = [
|
|
|
28066
30291
|
"emulator",
|
|
28067
30292
|
"vvd",
|
|
28068
30293
|
"device",
|
|
28069
|
-
"app"
|
|
30294
|
+
"app",
|
|
30295
|
+
"catalyst"
|
|
28070
30296
|
];
|
|
28071
30297
|
var DEBUGGER_NOT_CONNECTED_REASONS = [
|
|
28072
30298
|
"metro_not_running",
|
|
@@ -28226,7 +30452,8 @@ var ALLOWED = {
|
|
|
28226
30452
|
install_mode: INSTALL_MODE
|
|
28227
30453
|
},
|
|
28228
30454
|
"installation:allowlist_decision": {
|
|
28229
|
-
is_enabled: bool
|
|
30455
|
+
is_enabled: bool,
|
|
30456
|
+
decided_by: oneOf(["flag", "default", "prompt"])
|
|
28230
30457
|
},
|
|
28231
30458
|
"installation:stale_config_cleanup": {
|
|
28232
30459
|
removed_count: COUNT,
|
|
@@ -28372,380 +30599,12 @@ import { randomUUID as randomUUID5 } from "node:crypto";
|
|
|
28372
30599
|
// ../telemetry/src/cloud-agent-detect.ts
|
|
28373
30600
|
import { existsSync as existsSync3 } from "node:fs";
|
|
28374
30601
|
|
|
28375
|
-
// ../../node_modules/ci-info/vendors.json
|
|
28376
|
-
var vendors_default = [
|
|
28377
|
-
{
|
|
28378
|
-
name: "Agola CI",
|
|
28379
|
-
constant: "AGOLA",
|
|
28380
|
-
env: "AGOLA_GIT_REF",
|
|
28381
|
-
pr: "AGOLA_PULL_REQUEST_ID"
|
|
28382
|
-
},
|
|
28383
|
-
{
|
|
28384
|
-
name: "Alpic",
|
|
28385
|
-
constant: "ALPIC",
|
|
28386
|
-
env: "ALPIC_HOST"
|
|
28387
|
-
},
|
|
28388
|
-
{
|
|
28389
|
-
name: "Appcircle",
|
|
28390
|
-
constant: "APPCIRCLE",
|
|
28391
|
-
env: "AC_APPCIRCLE",
|
|
28392
|
-
pr: {
|
|
28393
|
-
env: "AC_GIT_PR",
|
|
28394
|
-
ne: "false"
|
|
28395
|
-
}
|
|
28396
|
-
},
|
|
28397
|
-
{
|
|
28398
|
-
name: "AppVeyor",
|
|
28399
|
-
constant: "APPVEYOR",
|
|
28400
|
-
env: "APPVEYOR",
|
|
28401
|
-
pr: "APPVEYOR_PULL_REQUEST_NUMBER"
|
|
28402
|
-
},
|
|
28403
|
-
{
|
|
28404
|
-
name: "AWS CodeBuild",
|
|
28405
|
-
constant: "CODEBUILD",
|
|
28406
|
-
env: "CODEBUILD_BUILD_ARN",
|
|
28407
|
-
pr: {
|
|
28408
|
-
env: "CODEBUILD_WEBHOOK_EVENT",
|
|
28409
|
-
any: [
|
|
28410
|
-
"PULL_REQUEST_CREATED",
|
|
28411
|
-
"PULL_REQUEST_UPDATED",
|
|
28412
|
-
"PULL_REQUEST_REOPENED"
|
|
28413
|
-
]
|
|
28414
|
-
}
|
|
28415
|
-
},
|
|
28416
|
-
{
|
|
28417
|
-
name: "Azure Pipelines",
|
|
28418
|
-
constant: "AZURE_PIPELINES",
|
|
28419
|
-
env: "TF_BUILD",
|
|
28420
|
-
pr: {
|
|
28421
|
-
BUILD_REASON: "PullRequest"
|
|
28422
|
-
}
|
|
28423
|
-
},
|
|
28424
|
-
{
|
|
28425
|
-
name: "Bamboo",
|
|
28426
|
-
constant: "BAMBOO",
|
|
28427
|
-
env: "bamboo_planKey"
|
|
28428
|
-
},
|
|
28429
|
-
{
|
|
28430
|
-
name: "Bitbucket Pipelines",
|
|
28431
|
-
constant: "BITBUCKET",
|
|
28432
|
-
env: "BITBUCKET_COMMIT",
|
|
28433
|
-
pr: "BITBUCKET_PR_ID"
|
|
28434
|
-
},
|
|
28435
|
-
{
|
|
28436
|
-
name: "Bitrise",
|
|
28437
|
-
constant: "BITRISE",
|
|
28438
|
-
env: "BITRISE_IO",
|
|
28439
|
-
pr: "BITRISE_PULL_REQUEST"
|
|
28440
|
-
},
|
|
28441
|
-
{
|
|
28442
|
-
name: "Buddy",
|
|
28443
|
-
constant: "BUDDY",
|
|
28444
|
-
env: "BUDDY_WORKSPACE_ID",
|
|
28445
|
-
pr: "BUDDY_EXECUTION_PULL_REQUEST_ID"
|
|
28446
|
-
},
|
|
28447
|
-
{
|
|
28448
|
-
name: "Buildkite",
|
|
28449
|
-
constant: "BUILDKITE",
|
|
28450
|
-
env: "BUILDKITE",
|
|
28451
|
-
pr: {
|
|
28452
|
-
env: "BUILDKITE_PULL_REQUEST",
|
|
28453
|
-
ne: "false"
|
|
28454
|
-
}
|
|
28455
|
-
},
|
|
28456
|
-
{
|
|
28457
|
-
name: "CircleCI",
|
|
28458
|
-
constant: "CIRCLE",
|
|
28459
|
-
env: "CIRCLECI",
|
|
28460
|
-
pr: "CIRCLE_PULL_REQUEST"
|
|
28461
|
-
},
|
|
28462
|
-
{
|
|
28463
|
-
name: "Cirrus CI",
|
|
28464
|
-
constant: "CIRRUS",
|
|
28465
|
-
env: "CIRRUS_CI",
|
|
28466
|
-
pr: "CIRRUS_PR"
|
|
28467
|
-
},
|
|
28468
|
-
{
|
|
28469
|
-
name: "Cloudflare Pages",
|
|
28470
|
-
constant: "CLOUDFLARE_PAGES",
|
|
28471
|
-
env: "CF_PAGES"
|
|
28472
|
-
},
|
|
28473
|
-
{
|
|
28474
|
-
name: "Cloudflare Workers",
|
|
28475
|
-
constant: "CLOUDFLARE_WORKERS",
|
|
28476
|
-
env: "WORKERS_CI"
|
|
28477
|
-
},
|
|
28478
|
-
{
|
|
28479
|
-
name: "Codefresh",
|
|
28480
|
-
constant: "CODEFRESH",
|
|
28481
|
-
env: "CF_BUILD_ID",
|
|
28482
|
-
pr: {
|
|
28483
|
-
any: [
|
|
28484
|
-
"CF_PULL_REQUEST_NUMBER",
|
|
28485
|
-
"CF_PULL_REQUEST_ID"
|
|
28486
|
-
]
|
|
28487
|
-
}
|
|
28488
|
-
},
|
|
28489
|
-
{
|
|
28490
|
-
name: "Codemagic",
|
|
28491
|
-
constant: "CODEMAGIC",
|
|
28492
|
-
env: "CM_BUILD_ID",
|
|
28493
|
-
pr: "CM_PULL_REQUEST"
|
|
28494
|
-
},
|
|
28495
|
-
{
|
|
28496
|
-
name: "Codeship",
|
|
28497
|
-
constant: "CODESHIP",
|
|
28498
|
-
env: {
|
|
28499
|
-
CI_NAME: "codeship"
|
|
28500
|
-
}
|
|
28501
|
-
},
|
|
28502
|
-
{
|
|
28503
|
-
name: "Drone",
|
|
28504
|
-
constant: "DRONE",
|
|
28505
|
-
env: "DRONE",
|
|
28506
|
-
pr: {
|
|
28507
|
-
DRONE_BUILD_EVENT: "pull_request"
|
|
28508
|
-
}
|
|
28509
|
-
},
|
|
28510
|
-
{
|
|
28511
|
-
name: "dsari",
|
|
28512
|
-
constant: "DSARI",
|
|
28513
|
-
env: "DSARI"
|
|
28514
|
-
},
|
|
28515
|
-
{
|
|
28516
|
-
name: "Earthly",
|
|
28517
|
-
constant: "EARTHLY",
|
|
28518
|
-
env: "EARTHLY_CI"
|
|
28519
|
-
},
|
|
28520
|
-
{
|
|
28521
|
-
name: "Expo Application Services",
|
|
28522
|
-
constant: "EAS",
|
|
28523
|
-
env: "EAS_BUILD"
|
|
28524
|
-
},
|
|
28525
|
-
{
|
|
28526
|
-
name: "Gerrit",
|
|
28527
|
-
constant: "GERRIT",
|
|
28528
|
-
env: "GERRIT_PROJECT"
|
|
28529
|
-
},
|
|
28530
|
-
{
|
|
28531
|
-
name: "Gitea Actions",
|
|
28532
|
-
constant: "GITEA_ACTIONS",
|
|
28533
|
-
env: "GITEA_ACTIONS"
|
|
28534
|
-
},
|
|
28535
|
-
{
|
|
28536
|
-
name: "GitHub Actions",
|
|
28537
|
-
constant: "GITHUB_ACTIONS",
|
|
28538
|
-
env: "GITHUB_ACTIONS",
|
|
28539
|
-
pr: {
|
|
28540
|
-
GITHUB_EVENT_NAME: "pull_request"
|
|
28541
|
-
}
|
|
28542
|
-
},
|
|
28543
|
-
{
|
|
28544
|
-
name: "GitLab CI",
|
|
28545
|
-
constant: "GITLAB",
|
|
28546
|
-
env: "GITLAB_CI",
|
|
28547
|
-
pr: "CI_MERGE_REQUEST_ID"
|
|
28548
|
-
},
|
|
28549
|
-
{
|
|
28550
|
-
name: "GoCD",
|
|
28551
|
-
constant: "GOCD",
|
|
28552
|
-
env: "GO_PIPELINE_LABEL"
|
|
28553
|
-
},
|
|
28554
|
-
{
|
|
28555
|
-
name: "Google Cloud Build",
|
|
28556
|
-
constant: "GOOGLE_CLOUD_BUILD",
|
|
28557
|
-
env: "BUILDER_OUTPUT"
|
|
28558
|
-
},
|
|
28559
|
-
{
|
|
28560
|
-
name: "Harness CI",
|
|
28561
|
-
constant: "HARNESS",
|
|
28562
|
-
env: "HARNESS_BUILD_ID"
|
|
28563
|
-
},
|
|
28564
|
-
{
|
|
28565
|
-
name: "Heroku",
|
|
28566
|
-
constant: "HEROKU",
|
|
28567
|
-
env: {
|
|
28568
|
-
env: "NODE",
|
|
28569
|
-
includes: "/app/.heroku/node/bin/node"
|
|
28570
|
-
}
|
|
28571
|
-
},
|
|
28572
|
-
{
|
|
28573
|
-
name: "Hudson",
|
|
28574
|
-
constant: "HUDSON",
|
|
28575
|
-
env: "HUDSON_URL"
|
|
28576
|
-
},
|
|
28577
|
-
{
|
|
28578
|
-
name: "Jenkins",
|
|
28579
|
-
constant: "JENKINS",
|
|
28580
|
-
env: [
|
|
28581
|
-
"JENKINS_URL",
|
|
28582
|
-
"BUILD_ID"
|
|
28583
|
-
],
|
|
28584
|
-
pr: {
|
|
28585
|
-
any: [
|
|
28586
|
-
"ghprbPullId",
|
|
28587
|
-
"CHANGE_ID"
|
|
28588
|
-
]
|
|
28589
|
-
}
|
|
28590
|
-
},
|
|
28591
|
-
{
|
|
28592
|
-
name: "LayerCI",
|
|
28593
|
-
constant: "LAYERCI",
|
|
28594
|
-
env: "LAYERCI",
|
|
28595
|
-
pr: "LAYERCI_PULL_REQUEST"
|
|
28596
|
-
},
|
|
28597
|
-
{
|
|
28598
|
-
name: "Magnum CI",
|
|
28599
|
-
constant: "MAGNUM",
|
|
28600
|
-
env: "MAGNUM"
|
|
28601
|
-
},
|
|
28602
|
-
{
|
|
28603
|
-
name: "Netlify CI",
|
|
28604
|
-
constant: "NETLIFY",
|
|
28605
|
-
env: "NETLIFY",
|
|
28606
|
-
pr: {
|
|
28607
|
-
env: "PULL_REQUEST",
|
|
28608
|
-
ne: "false"
|
|
28609
|
-
}
|
|
28610
|
-
},
|
|
28611
|
-
{
|
|
28612
|
-
name: "Nevercode",
|
|
28613
|
-
constant: "NEVERCODE",
|
|
28614
|
-
env: "NEVERCODE",
|
|
28615
|
-
pr: {
|
|
28616
|
-
env: "NEVERCODE_PULL_REQUEST",
|
|
28617
|
-
ne: "false"
|
|
28618
|
-
}
|
|
28619
|
-
},
|
|
28620
|
-
{
|
|
28621
|
-
name: "Prow",
|
|
28622
|
-
constant: "PROW",
|
|
28623
|
-
env: "PROW_JOB_ID"
|
|
28624
|
-
},
|
|
28625
|
-
{
|
|
28626
|
-
name: "ReleaseHub",
|
|
28627
|
-
constant: "RELEASEHUB",
|
|
28628
|
-
env: "RELEASE_BUILD_ID"
|
|
28629
|
-
},
|
|
28630
|
-
{
|
|
28631
|
-
name: "Render",
|
|
28632
|
-
constant: "RENDER",
|
|
28633
|
-
env: "RENDER",
|
|
28634
|
-
pr: {
|
|
28635
|
-
IS_PULL_REQUEST: "true"
|
|
28636
|
-
}
|
|
28637
|
-
},
|
|
28638
|
-
{
|
|
28639
|
-
name: "Sail CI",
|
|
28640
|
-
constant: "SAIL",
|
|
28641
|
-
env: "SAILCI",
|
|
28642
|
-
pr: "SAIL_PULL_REQUEST_NUMBER"
|
|
28643
|
-
},
|
|
28644
|
-
{
|
|
28645
|
-
name: "Screwdriver",
|
|
28646
|
-
constant: "SCREWDRIVER",
|
|
28647
|
-
env: "SCREWDRIVER",
|
|
28648
|
-
pr: {
|
|
28649
|
-
env: "SD_PULL_REQUEST",
|
|
28650
|
-
ne: "false"
|
|
28651
|
-
}
|
|
28652
|
-
},
|
|
28653
|
-
{
|
|
28654
|
-
name: "Semaphore",
|
|
28655
|
-
constant: "SEMAPHORE",
|
|
28656
|
-
env: "SEMAPHORE",
|
|
28657
|
-
pr: "PULL_REQUEST_NUMBER"
|
|
28658
|
-
},
|
|
28659
|
-
{
|
|
28660
|
-
name: "Sourcehut",
|
|
28661
|
-
constant: "SOURCEHUT",
|
|
28662
|
-
env: {
|
|
28663
|
-
CI_NAME: "sourcehut"
|
|
28664
|
-
}
|
|
28665
|
-
},
|
|
28666
|
-
{
|
|
28667
|
-
name: "Strider CD",
|
|
28668
|
-
constant: "STRIDER",
|
|
28669
|
-
env: "STRIDER"
|
|
28670
|
-
},
|
|
28671
|
-
{
|
|
28672
|
-
name: "TaskCluster",
|
|
28673
|
-
constant: "TASKCLUSTER",
|
|
28674
|
-
env: [
|
|
28675
|
-
"TASK_ID",
|
|
28676
|
-
"RUN_ID"
|
|
28677
|
-
]
|
|
28678
|
-
},
|
|
28679
|
-
{
|
|
28680
|
-
name: "TeamCity",
|
|
28681
|
-
constant: "TEAMCITY",
|
|
28682
|
-
env: "TEAMCITY_VERSION"
|
|
28683
|
-
},
|
|
28684
|
-
{
|
|
28685
|
-
name: "Travis CI",
|
|
28686
|
-
constant: "TRAVIS",
|
|
28687
|
-
env: "TRAVIS",
|
|
28688
|
-
pr: {
|
|
28689
|
-
env: "TRAVIS_PULL_REQUEST",
|
|
28690
|
-
ne: "false"
|
|
28691
|
-
}
|
|
28692
|
-
},
|
|
28693
|
-
{
|
|
28694
|
-
name: "Vela",
|
|
28695
|
-
constant: "VELA",
|
|
28696
|
-
env: "VELA",
|
|
28697
|
-
pr: {
|
|
28698
|
-
VELA_PULL_REQUEST: "1"
|
|
28699
|
-
}
|
|
28700
|
-
},
|
|
28701
|
-
{
|
|
28702
|
-
name: "Vercel",
|
|
28703
|
-
constant: "VERCEL",
|
|
28704
|
-
env: {
|
|
28705
|
-
any: [
|
|
28706
|
-
"NOW_BUILDER",
|
|
28707
|
-
"VERCEL"
|
|
28708
|
-
]
|
|
28709
|
-
},
|
|
28710
|
-
pr: "VERCEL_GIT_PULL_REQUEST_ID"
|
|
28711
|
-
},
|
|
28712
|
-
{
|
|
28713
|
-
name: "Visual Studio App Center",
|
|
28714
|
-
constant: "APPCENTER",
|
|
28715
|
-
env: "APPCENTER_BUILD_ID"
|
|
28716
|
-
},
|
|
28717
|
-
{
|
|
28718
|
-
name: "Woodpecker",
|
|
28719
|
-
constant: "WOODPECKER",
|
|
28720
|
-
env: {
|
|
28721
|
-
CI: "woodpecker"
|
|
28722
|
-
},
|
|
28723
|
-
pr: {
|
|
28724
|
-
CI_BUILD_EVENT: "pull_request"
|
|
28725
|
-
}
|
|
28726
|
-
},
|
|
28727
|
-
{
|
|
28728
|
-
name: "Xcode Cloud",
|
|
28729
|
-
constant: "XCODE_CLOUD",
|
|
28730
|
-
env: "CI_XCODE_PROJECT",
|
|
28731
|
-
pr: "CI_PULL_REQUEST_NUMBER"
|
|
28732
|
-
},
|
|
28733
|
-
{
|
|
28734
|
-
name: "Xcode Server",
|
|
28735
|
-
constant: "XCODE_SERVER",
|
|
28736
|
-
env: "XCS"
|
|
28737
|
-
}
|
|
28738
|
-
];
|
|
28739
|
-
|
|
28740
|
-
// ../telemetry/src/ci-detect.ts
|
|
28741
|
-
var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
28742
|
-
|
|
28743
30602
|
// ../telemetry/src/base-props.ts
|
|
28744
30603
|
var SESSION_ID2 = randomUUID5();
|
|
28745
30604
|
|
|
28746
30605
|
// ../telemetry/src/identity.ts
|
|
28747
30606
|
import * as crypto2 from "node:crypto";
|
|
28748
|
-
import * as
|
|
30607
|
+
import * as fs9 from "node:fs";
|
|
28749
30608
|
import * as path14 from "node:path";
|
|
28750
30609
|
|
|
28751
30610
|
// ../telemetry/src/fingerprint.ts
|
|
@@ -28753,21 +30612,22 @@ import { execFileSync as execFileSync2, spawn as spawn3 } from "node:child_proce
|
|
|
28753
30612
|
|
|
28754
30613
|
// ../native-devtools-ios/src/index.ts
|
|
28755
30614
|
import * as path15 from "node:path";
|
|
28756
|
-
import * as
|
|
30615
|
+
import * as fs10 from "node:fs";
|
|
28757
30616
|
var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path15.join(__dirname, "..", "dylibs");
|
|
28758
30617
|
var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path15.join(__dirname, "..", "bin");
|
|
28759
30618
|
var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path15.join(DYLIB_DIR, "tcp");
|
|
28760
30619
|
var DYLIB_TVOS_DIR = path15.join(DYLIB_DIR, "tvos");
|
|
28761
30620
|
|
|
28762
30621
|
// ../telemetry/src/consent.ts
|
|
28763
|
-
import * as
|
|
30622
|
+
import * as fs11 from "node:fs";
|
|
30623
|
+
import * as path16 from "node:path";
|
|
28764
30624
|
var cache = /* @__PURE__ */ new Map();
|
|
28765
30625
|
var sessionOverride = null;
|
|
28766
30626
|
function readConfigOverrideAt(filePath) {
|
|
28767
30627
|
const miss = { mtimeMs: null, fingerprint: null, enabledOverride: null };
|
|
28768
30628
|
let stats;
|
|
28769
30629
|
try {
|
|
28770
|
-
stats =
|
|
30630
|
+
stats = fs11.lstatSync(filePath);
|
|
28771
30631
|
} catch {
|
|
28772
30632
|
cache.set(filePath, miss);
|
|
28773
30633
|
return null;
|
|
@@ -28784,7 +30644,7 @@ function readConfigOverrideAt(filePath) {
|
|
|
28784
30644
|
}
|
|
28785
30645
|
let parsedEnabled = null;
|
|
28786
30646
|
try {
|
|
28787
|
-
const raw2 =
|
|
30647
|
+
const raw2 = fs11.readFileSync(filePath, "utf8");
|
|
28788
30648
|
const json = JSON.parse(raw2);
|
|
28789
30649
|
if (json && typeof json === "object") {
|
|
28790
30650
|
const t = json.telemetry;
|
|
@@ -28802,7 +30662,8 @@ function readPersistedConsent(cwd) {
|
|
|
28802
30662
|
const globalPath = configFilePath("global");
|
|
28803
30663
|
const projectPath = configFilePath("project", { cwd });
|
|
28804
30664
|
const global = readConfigOverrideAt(globalPath);
|
|
28805
|
-
const
|
|
30665
|
+
const projectRoot = path16.dirname(path16.dirname(projectPath));
|
|
30666
|
+
const project = isHomeDir(projectRoot) ? null : readConfigOverrideAt(projectPath);
|
|
28806
30667
|
if (project === false && global === false) {
|
|
28807
30668
|
return { enabled: false, detail: "config.json (project and global)" };
|
|
28808
30669
|
}
|
|
@@ -28893,7 +30754,7 @@ var PNG_SIGNATURE = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]);
|
|
|
28893
30754
|
function imageBlock(data, mimeType) {
|
|
28894
30755
|
return { type: "image", data: data.toString("base64"), mimeType };
|
|
28895
30756
|
}
|
|
28896
|
-
async function fetchPngBytes(url) {
|
|
30757
|
+
async function fetchPngBytes(url, signal) {
|
|
28897
30758
|
try {
|
|
28898
30759
|
let buf;
|
|
28899
30760
|
if (url.startsWith("file://")) {
|
|
@@ -28901,7 +30762,7 @@ async function fetchPngBytes(url) {
|
|
|
28901
30762
|
const { fileURLToPath } = await import("node:url");
|
|
28902
30763
|
buf = await readFile8(fileURLToPath(url));
|
|
28903
30764
|
} else {
|
|
28904
|
-
const res = await fetch(url);
|
|
30765
|
+
const res = await fetch(url, { signal });
|
|
28905
30766
|
if (!res.ok) return null;
|
|
28906
30767
|
buf = Buffer.from(await res.arrayBuffer());
|
|
28907
30768
|
}
|
|
@@ -28913,7 +30774,7 @@ async function fetchPngBytes(url) {
|
|
|
28913
30774
|
}
|
|
28914
30775
|
}
|
|
28915
30776
|
async function toMcpContent(result, outputHint, ctx, args) {
|
|
28916
|
-
const suppressImage =
|
|
30777
|
+
const suppressImage = isRecord3(args) && args.includeImageInContext === false;
|
|
28917
30778
|
if (ctx) {
|
|
28918
30779
|
const { result: rewritten, images } = await materializeArtifacts(result, ctx);
|
|
28919
30780
|
if (outputHint === "image") {
|
|
@@ -28924,7 +30785,7 @@ async function toMcpContent(result, outputHint, ctx, args) {
|
|
|
28924
30785
|
blocks2.push(saved);
|
|
28925
30786
|
return blocks2;
|
|
28926
30787
|
}
|
|
28927
|
-
return legacyImageContent(rewritten, suppressImage);
|
|
30788
|
+
return legacyImageContent(rewritten, suppressImage, ctx.signal);
|
|
28928
30789
|
}
|
|
28929
30790
|
const blocks = [{ type: "text", text: stringifyForText(rewritten) }];
|
|
28930
30791
|
if (!suppressImage) for (const img of images) blocks.push(imageBlock(img.data, img.mimeType));
|
|
@@ -28938,13 +30799,13 @@ async function toMcpContent(result, outputHint, ctx, args) {
|
|
|
28938
30799
|
function stringifyForText(value) {
|
|
28939
30800
|
return JSON.stringify(value ?? null, null, 2);
|
|
28940
30801
|
}
|
|
28941
|
-
async function legacyImageContent(result, suppressImage) {
|
|
30802
|
+
async function legacyImageContent(result, suppressImage, signal) {
|
|
28942
30803
|
if (result && typeof result === "object" && "url" in result) {
|
|
28943
30804
|
const r = result;
|
|
28944
30805
|
if (suppressImage) {
|
|
28945
30806
|
return [{ type: "text", text: `Saved: ${r.path ?? ""}` }];
|
|
28946
30807
|
}
|
|
28947
|
-
const buf = await fetchPngBytes(r.url);
|
|
30808
|
+
const buf = await fetchPngBytes(r.url, signal);
|
|
28948
30809
|
if (buf) {
|
|
28949
30810
|
return [imageBlock(buf, "image/png"), { type: "text", text: `Saved: ${r.path ?? ""}` }];
|
|
28950
30811
|
}
|
|
@@ -28957,20 +30818,22 @@ async function legacyImageContent(result, suppressImage) {
|
|
|
28957
30818
|
}
|
|
28958
30819
|
return [{ type: "text", text: JSON.stringify(result, null, 2) }];
|
|
28959
30820
|
}
|
|
28960
|
-
function
|
|
30821
|
+
function isRecord3(value) {
|
|
28961
30822
|
return value !== null && typeof value === "object";
|
|
28962
30823
|
}
|
|
28963
30824
|
function isScreenshotDiffResult(value) {
|
|
28964
|
-
if (!
|
|
30825
|
+
if (!isRecord3(value)) return false;
|
|
28965
30826
|
return typeof value.summary === "string";
|
|
28966
30827
|
}
|
|
28967
30828
|
async function screenshotDiffToMcpContent(result, ctx) {
|
|
28968
30829
|
const blocks = [];
|
|
28969
30830
|
let contextDiffPath = result.contextDiffPath;
|
|
30831
|
+
let diffPath = result.diffPath;
|
|
28970
30832
|
let materializedImages = [];
|
|
28971
30833
|
if (ctx) {
|
|
28972
30834
|
const { result: rewritten, images } = await materializeArtifacts(result, ctx);
|
|
28973
30835
|
contextDiffPath = rewritten.contextDiffPath;
|
|
30836
|
+
diffPath = rewritten.diffPath;
|
|
28974
30837
|
materializedImages = images;
|
|
28975
30838
|
}
|
|
28976
30839
|
if (typeof contextDiffPath === "string") {
|
|
@@ -28994,6 +30857,15 @@ async function screenshotDiffToMcpContent(result, ctx) {
|
|
|
28994
30857
|
}
|
|
28995
30858
|
}
|
|
28996
30859
|
blocks.push({ type: "text", text: result.summary });
|
|
30860
|
+
const paths = [
|
|
30861
|
+
["diffPath", diffPath],
|
|
30862
|
+
["contextDiffPath", contextDiffPath]
|
|
30863
|
+
];
|
|
30864
|
+
for (const [key, value] of paths) {
|
|
30865
|
+
if (value === void 0) continue;
|
|
30866
|
+
const text = `${key}: ${typeof value === "string" ? value : "(unavailable)"}`;
|
|
30867
|
+
blocks.push({ type: "text", text });
|
|
30868
|
+
}
|
|
28997
30869
|
return blocks;
|
|
28998
30870
|
}
|
|
28999
30871
|
var STATUS_GLYPH = {
|
|
@@ -29056,14 +30928,14 @@ async function flowRunToMcpContent(result, ctx) {
|
|
|
29056
30928
|
if (step.result !== void 0) {
|
|
29057
30929
|
blocks.push(...await toMcpContent(step.result, step.outputHint, ctx, step.args));
|
|
29058
30930
|
}
|
|
29059
|
-
if (
|
|
30931
|
+
if (isRecord3(step.artifacts)) {
|
|
29060
30932
|
blocks.push(...await stepArtifactBlocks(step.artifacts, step.status, ctx, step.depth));
|
|
29061
30933
|
}
|
|
29062
30934
|
}
|
|
29063
30935
|
for (const write of result.baselineWrites ?? []) {
|
|
29064
|
-
const { path:
|
|
29065
|
-
if (typeof
|
|
29066
|
-
blocks.push({ type: "text", text: `\u2717 baseline not written: ${
|
|
30936
|
+
const { path: path18, error: error2 } = isRecord3(write) ? write : {};
|
|
30937
|
+
if (typeof path18 === "string" && typeof error2 === "string") {
|
|
30938
|
+
blocks.push({ type: "text", text: `\u2717 baseline not written: ${path18}: ${error2}` });
|
|
29067
30939
|
}
|
|
29068
30940
|
}
|
|
29069
30941
|
if (result.ok !== void 0) {
|
|
@@ -29114,6 +30986,7 @@ var AUTO_SCREENSHOT_TOOLS = /* @__PURE__ */ new Set([
|
|
|
29114
30986
|
"paste",
|
|
29115
30987
|
"rotate",
|
|
29116
30988
|
"fold",
|
|
30989
|
+
"tv-remote",
|
|
29117
30990
|
"launch-app",
|
|
29118
30991
|
"restart-app",
|
|
29119
30992
|
"open-url",
|
|
@@ -29137,6 +31010,7 @@ var AUTO_SCREENSHOT_DELAY_MS_BY_TOOL = {
|
|
|
29137
31010
|
"gesture-rotate": 1500,
|
|
29138
31011
|
"run-sequence": 15e3,
|
|
29139
31012
|
"button": 1500,
|
|
31013
|
+
"tv-remote": 1500,
|
|
29140
31014
|
"rotate": 1e3,
|
|
29141
31015
|
// The fold tool already waits for the panel hand-over; the cap covers the
|
|
29142
31016
|
// repaint after it.
|
|
@@ -29166,6 +31040,7 @@ var AUTO_DESCRIBE_TOOLS = /* @__PURE__ */ new Set([
|
|
|
29166
31040
|
"paste",
|
|
29167
31041
|
"rotate",
|
|
29168
31042
|
"fold",
|
|
31043
|
+
"tv-remote",
|
|
29169
31044
|
"launch-app",
|
|
29170
31045
|
"restart-app",
|
|
29171
31046
|
"open-url",
|
|
@@ -29227,7 +31102,7 @@ function treeIdLine(id) {
|
|
|
29227
31102
|
return `Tree id: ${id}`;
|
|
29228
31103
|
}
|
|
29229
31104
|
function unchangedTreeNote(id, tool) {
|
|
29230
|
-
return `
|
|
31105
|
+
return `Element tree matches \`${id}\` from an earlier \`${tool}\` result. Actions may have effects the tree omits. Call \`describe\` if you lack that tree.`;
|
|
29231
31106
|
}
|
|
29232
31107
|
function randomTag() {
|
|
29233
31108
|
return randomInt(36 ** 3).toString(36).padStart(3, "0");
|
|
@@ -29434,7 +31309,7 @@ function toMcpToolList(tools, options = {}) {
|
|
|
29434
31309
|
// ../argent-mcp/src/list-devices-text.ts
|
|
29435
31310
|
var RUNTIME_PREFIX = "com.apple.CoreSimulator.SimRuntime.";
|
|
29436
31311
|
var STOPPED_SIMULATORS_HEADER = "iOS simulators that are shut down, one per line (platform, udid, name, runtime, state, tags); start one with boot-device:";
|
|
29437
|
-
function
|
|
31312
|
+
function isRecord4(value) {
|
|
29438
31313
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
29439
31314
|
}
|
|
29440
31315
|
function shortRuntime(runtime) {
|
|
@@ -29455,10 +31330,12 @@ function cleanEntry(device) {
|
|
|
29455
31330
|
}
|
|
29456
31331
|
function isStoppedSimulator(device) {
|
|
29457
31332
|
if (device.platform !== "ios" && device.platform !== "ios-remote") return false;
|
|
29458
|
-
if (
|
|
31333
|
+
if (device.kind !== void 0 && device.kind !== "simulator" || "external" in device) {
|
|
31334
|
+
return false;
|
|
31335
|
+
}
|
|
29459
31336
|
return typeof device.udid === "string" && device.state === "Shutdown";
|
|
29460
31337
|
}
|
|
29461
|
-
var ONE_LINE_FIELDS = /* @__PURE__ */ new Set(["platform", "udid", "name", "runtime", "state"]);
|
|
31338
|
+
var ONE_LINE_FIELDS = /* @__PURE__ */ new Set(["platform", "kind", "udid", "name", "runtime", "state"]);
|
|
29462
31339
|
function quoteIfNeeded(value) {
|
|
29463
31340
|
return value === "" || /[\s"\\]/.test(value) ? JSON.stringify(value) : value;
|
|
29464
31341
|
}
|
|
@@ -29478,8 +31355,8 @@ function stoppedSimulatorLine(device) {
|
|
|
29478
31355
|
return parts.join(" ");
|
|
29479
31356
|
}
|
|
29480
31357
|
function listDevicesText(result) {
|
|
29481
|
-
if (!
|
|
29482
|
-
if (!result.devices.every(
|
|
31358
|
+
if (!isRecord4(result) || !Array.isArray(result.devices)) return void 0;
|
|
31359
|
+
if (!result.devices.every(isRecord4)) return void 0;
|
|
29483
31360
|
const devices = result.devices;
|
|
29484
31361
|
const listed = [];
|
|
29485
31362
|
const stopped = [];
|
|
@@ -29504,15 +31381,15 @@ ${stopped.join("\n")}`;
|
|
|
29504
31381
|
}
|
|
29505
31382
|
|
|
29506
31383
|
// ../argent-mcp/src/instructions.ts
|
|
29507
|
-
var SERVER_INSTRUCTIONS = "Argent \u2014 iOS Simulator, Android Emulator, and Chromium app control for interacting, testing, profiling and debugging mobile and Chromium applications. Interaction tools return the screen after the action: a screenshot plus the accessibility element tree with normalized tap frames. Take coordinates from that tree; call describe only when no fresh tree is available \u2014 never guess coordinates from pixels. A result names an identical earlier tree by its tree id in place of repeating it. Do not stop simulator servers when a task finishes: the next task reuses them. Call stop-all-simulator-servers when the user asks to clean up or ends the session, or when a skill tells you to recycle a device's services, always with devices: [...] naming the devices this session used. Never stop a Metro the user started unless they ask. One tool-server is shared by every agent using this argent install, so an unscoped call tears down their devices too \u2014 reserve it for a deliberate machine-wide cleanup.";
|
|
31384
|
+
var SERVER_INSTRUCTIONS = "Argent \u2014 iOS Simulator, Android Emulator, and Chromium app control for interacting, testing, profiling and debugging mobile and Chromium applications. Use the platform the user named; otherwise prefer a device list-devices shows already running, and do not default to iOS. In a single-platform project, boot that platform. Prefer these tools over raw xcrun or adb commands, which are a fallback. Prefer launch-app or open-url over tapping home-screen icons. If the task may need a saved e2e test, load the argent-create-e2e skill (argent-qa-e2e for acceptance tests) before the first launch or in-app action: recording is not retroactive. Load the matching argent-* skill before React Native build or debug work, profiling, a physical phone, a Mac app or a TV. Interaction tools return the screen after the action: a screenshot plus the accessibility element tree with normalized tap frames. Take coordinates from that tree; call describe only when no fresh tree is available \u2014 never guess coordinates from pixels. A result names an identical earlier tree by its tree id in place of repeating it. If a tap fails twice, stop retrying and call a discovery tool again. Use await-ui-element to wait for the UI instead of polling with screenshots. Do not stop simulator servers when a task finishes: the next task reuses them. Call stop-all-simulator-servers when the user asks to clean up or ends the session, or when a skill tells you to recycle a device's services, always with devices: [...] naming the devices this session used. Never stop a Metro the user started unless they ask. One tool-server is shared by every agent using this argent install, so an unscoped call tears down their devices too \u2014 reserve it for a deliberate machine-wide cleanup. The argent CLI manages the toolkit: argent --help lists its commands.";
|
|
29508
31385
|
|
|
29509
31386
|
// ../argent-mcp/src/installed-version.ts
|
|
29510
|
-
import * as
|
|
29511
|
-
import * as
|
|
31387
|
+
import * as fs12 from "node:fs";
|
|
31388
|
+
import * as path17 from "node:path";
|
|
29512
31389
|
function getInstalledVersion() {
|
|
29513
31390
|
try {
|
|
29514
|
-
const pkgPath =
|
|
29515
|
-
const pkg = JSON.parse(
|
|
31391
|
+
const pkgPath = path17.resolve(import.meta.dirname, "..", "package.json");
|
|
31392
|
+
const pkg = JSON.parse(fs12.readFileSync(pkgPath, "utf8"));
|
|
29516
31393
|
return pkg.version ?? "unknown";
|
|
29517
31394
|
} catch {
|
|
29518
31395
|
return "unknown";
|
|
@@ -29567,9 +31444,9 @@ async function untilAborted(work, signal) {
|
|
|
29567
31444
|
}
|
|
29568
31445
|
let onAbort = () => {
|
|
29569
31446
|
};
|
|
29570
|
-
const aborted2 = new Promise((
|
|
29571
|
-
onAbort =
|
|
29572
|
-
if (signal.aborted)
|
|
31447
|
+
const aborted2 = new Promise((resolve12) => {
|
|
31448
|
+
onAbort = resolve12;
|
|
31449
|
+
if (signal.aborted) resolve12();
|
|
29573
31450
|
else signal.addEventListener("abort", onAbort, { once: true });
|
|
29574
31451
|
});
|
|
29575
31452
|
try {
|
|
@@ -29608,11 +31485,12 @@ function createToolCaller(deps) {
|
|
|
29608
31485
|
const client = createToolsClient({
|
|
29609
31486
|
baseUrl: async () => ({ ...deps.getHandle(), remote: deps.remote }),
|
|
29610
31487
|
headers: deps.extraHeaders,
|
|
31488
|
+
refuseRelativeProjectPaths: true,
|
|
29611
31489
|
fetchImpl: async (url, init, meta2) => {
|
|
29612
31490
|
parseUrl(url);
|
|
29613
31491
|
return fetchWithReconnect(() => rebase(url), deps.reconnect, {
|
|
29614
31492
|
init: () => withHeaders(init),
|
|
29615
|
-
// A call that carried an upload is sent once and never
|
|
31493
|
+
// A call that carried an upload is sent once and never timed out: the
|
|
29616
31494
|
// tool-server consumes the upload when it reads the call, so a second
|
|
29617
31495
|
// attempt could only fail.
|
|
29618
31496
|
fetchTimeoutMs: meta2.longRunning || meta2.carriesUpload ? null : timeout,
|
|
@@ -29629,7 +31507,64 @@ function createToolCaller(deps) {
|
|
|
29629
31507
|
};
|
|
29630
31508
|
}
|
|
29631
31509
|
|
|
31510
|
+
// ../argent-mcp/src/whats-new.ts
|
|
31511
|
+
var import_semver = __toESM(require_semver2(), 1);
|
|
31512
|
+
|
|
31513
|
+
// ../argent-mcp/src/release-highlights.ts
|
|
31514
|
+
var RELEASE_HIGHLIGHTS = {
|
|
31515
|
+
"0.34.0": [
|
|
31516
|
+
"Profile Mac apps with the native profiler, and react-native-macos apps with the React profiler.",
|
|
31517
|
+
"e2e script steps run TypeScript (.mts, .ts) and .js files.",
|
|
31518
|
+
"`argent link` transfers app bundles faster with zstd compression.",
|
|
31519
|
+
"`argent e2e list --json` prints the test list as JSON.",
|
|
31520
|
+
"Argent now needs Node.js 22.18 or later."
|
|
31521
|
+
]
|
|
31522
|
+
};
|
|
31523
|
+
|
|
31524
|
+
// ../argent-mcp/src/whats-new.ts
|
|
31525
|
+
var MAX_HIGHLIGHTS = 5;
|
|
31526
|
+
function whatsNewEnabled() {
|
|
31527
|
+
return isFeatureEnabled("whats-new");
|
|
31528
|
+
}
|
|
31529
|
+
function isNewerThanSeen(current, seen) {
|
|
31530
|
+
if (!import_semver.default.valid(current)) return false;
|
|
31531
|
+
const previous = import_semver.default.valid(seen);
|
|
31532
|
+
return previous === null || import_semver.default.gt(current, previous);
|
|
31533
|
+
}
|
|
31534
|
+
function highlightsSince(seen, current, releases = RELEASE_HIGHLIGHTS) {
|
|
31535
|
+
if (!import_semver.default.valid(current)) return [];
|
|
31536
|
+
const previous = import_semver.default.valid(seen);
|
|
31537
|
+
const isNewRelease = (version2) => previous ? import_semver.default.gt(version2, previous) : version2 === current;
|
|
31538
|
+
return Object.keys(releases).filter((version2) => import_semver.default.lte(version2, current) && isNewRelease(version2)).sort(import_semver.default.rcompare).flatMap((version2) => releases[version2]).slice(0, MAX_HIGHLIGHTS);
|
|
31539
|
+
}
|
|
31540
|
+
function formatWhatsNewNote(version2, highlights) {
|
|
31541
|
+
return [
|
|
31542
|
+
`Argent was updated to v${version2} before this session. Briefly tell the user what is new, then continue:`,
|
|
31543
|
+
...highlights.map((highlight) => `- ${highlight}`)
|
|
31544
|
+
].join("\n");
|
|
31545
|
+
}
|
|
31546
|
+
function takeWhatsNewNote(current) {
|
|
31547
|
+
const seen = getWhatsNewSeenVersion();
|
|
31548
|
+
if (!isNewerThanSeen(current, seen)) return void 0;
|
|
31549
|
+
setWhatsNewSeenVersion(current);
|
|
31550
|
+
const highlights = highlightsSince(seen, current);
|
|
31551
|
+
return highlights.length > 0 ? formatWhatsNewNote(current, highlights) : void 0;
|
|
31552
|
+
}
|
|
31553
|
+
|
|
29632
31554
|
// ../argent-mcp/src/mcp-server.ts
|
|
31555
|
+
var SAVES_FILES_AFTER_CANCEL = /* @__PURE__ */ new Set(["screen-recording-stop", "native-profiler-stop"]);
|
|
31556
|
+
async function withDeadline(signal, ms, work) {
|
|
31557
|
+
const deadline = new AbortController();
|
|
31558
|
+
const timer = setTimeout(
|
|
31559
|
+
() => deadline.abort(new DOMException("The operation was aborted due to timeout", "TimeoutError")),
|
|
31560
|
+
ms
|
|
31561
|
+
);
|
|
31562
|
+
try {
|
|
31563
|
+
return await work(AbortSignal.any([signal, deadline.signal]));
|
|
31564
|
+
} finally {
|
|
31565
|
+
clearTimeout(timer);
|
|
31566
|
+
}
|
|
31567
|
+
}
|
|
29633
31568
|
async function startMcpServer(options) {
|
|
29634
31569
|
if (shouldShowFirstRunNotice()) {
|
|
29635
31570
|
process.stderr.write(`[argent] ${FIRST_RUN_NOTICE}
|
|
@@ -29638,6 +31573,7 @@ async function startMcpServer(options) {
|
|
|
29638
31573
|
}
|
|
29639
31574
|
const autoScreenshotOn = autoScreenshotEnabled();
|
|
29640
31575
|
const autoDescribeOn = autoDescribeEnabled();
|
|
31576
|
+
const whatsNewOn = whatsNewEnabled();
|
|
29641
31577
|
const captureTimeoutMs = options.captureTimeoutMs ?? CAPTURE_TIMEOUT_MS;
|
|
29642
31578
|
const trees = createTreeMemory();
|
|
29643
31579
|
let TOOLS_URL;
|
|
@@ -29686,7 +31622,7 @@ async function startMcpServer(options) {
|
|
|
29686
31622
|
async function spyLog(entry) {
|
|
29687
31623
|
try {
|
|
29688
31624
|
if (!logDirReady) {
|
|
29689
|
-
await mkdir5(
|
|
31625
|
+
await mkdir5(dirname11(LOG_FILE2), { recursive: true });
|
|
29690
31626
|
logDirReady = true;
|
|
29691
31627
|
}
|
|
29692
31628
|
await appendFile(LOG_FILE2, JSON.stringify(entry) + "\n");
|
|
@@ -29699,16 +31635,15 @@ async function startMcpServer(options) {
|
|
|
29699
31635
|
reconnect,
|
|
29700
31636
|
extraHeaders: aiClientHeaders
|
|
29701
31637
|
});
|
|
29702
|
-
async function awaitScreenSettled(udid, toolName) {
|
|
31638
|
+
async function awaitScreenSettled(udid, toolName, signal) {
|
|
29703
31639
|
const maxWaitMs = getAutoScreenshotDelayMs(toolName);
|
|
29704
31640
|
if (maxWaitMs === 0) return true;
|
|
29705
31641
|
const started = Date.now();
|
|
29706
31642
|
try {
|
|
29707
|
-
const idle = await
|
|
29708
|
-
|
|
29709
|
-
|
|
29710
|
-
|
|
29711
|
-
{ signal: AbortSignal.timeout(maxWaitMs + captureTimeoutMs) }
|
|
31643
|
+
const idle = await withDeadline(
|
|
31644
|
+
signal,
|
|
31645
|
+
maxWaitMs + captureTimeoutMs,
|
|
31646
|
+
(s) => callTool("await-screen-idle", { udid, timeoutMs: maxWaitMs }, { signal: s })
|
|
29712
31647
|
);
|
|
29713
31648
|
await spyLog({
|
|
29714
31649
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -29719,7 +31654,10 @@ async function startMcpServer(options) {
|
|
|
29719
31654
|
});
|
|
29720
31655
|
return idle.result?.settled === true;
|
|
29721
31656
|
} catch {
|
|
29722
|
-
await
|
|
31657
|
+
await sleep(Math.max(0, maxWaitMs - (Date.now() - started)), void 0, { signal }).catch(
|
|
31658
|
+
() => {
|
|
31659
|
+
}
|
|
31660
|
+
);
|
|
29723
31661
|
return false;
|
|
29724
31662
|
}
|
|
29725
31663
|
}
|
|
@@ -29729,7 +31667,8 @@ async function startMcpServer(options) {
|
|
|
29729
31667
|
const blocks = await toMcpContent(result, "image", {
|
|
29730
31668
|
toolsUrl: TOOLS_URL,
|
|
29731
31669
|
authToken: AUTH_TOKEN,
|
|
29732
|
-
deviceId: udid
|
|
31670
|
+
deviceId: udid,
|
|
31671
|
+
signal
|
|
29733
31672
|
});
|
|
29734
31673
|
if (!blocks.some((b) => b.type === "image")) return [];
|
|
29735
31674
|
return [{ type: "text", text: "--- Screen after action ---" }, ...blocks];
|
|
@@ -29767,6 +31706,17 @@ ${shown.text}` }];
|
|
|
29767
31706
|
return [];
|
|
29768
31707
|
}
|
|
29769
31708
|
}
|
|
31709
|
+
let whatsNewChecked = false;
|
|
31710
|
+
function whatsNewBlocks() {
|
|
31711
|
+
if (!whatsNewOn || whatsNewChecked) return [];
|
|
31712
|
+
whatsNewChecked = true;
|
|
31713
|
+
try {
|
|
31714
|
+
const note = takeWhatsNewNote(getInstalledVersion());
|
|
31715
|
+
return note ? [{ type: "text", text: note }] : [];
|
|
31716
|
+
} catch {
|
|
31717
|
+
return [];
|
|
31718
|
+
}
|
|
31719
|
+
}
|
|
29770
31720
|
const server = new Server(
|
|
29771
31721
|
{ name: "argent", version: getInstalledVersion() },
|
|
29772
31722
|
{
|
|
@@ -29774,10 +31724,10 @@ ${shown.text}` }];
|
|
|
29774
31724
|
instructions: SERVER_INSTRUCTIONS
|
|
29775
31725
|
}
|
|
29776
31726
|
);
|
|
29777
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
31727
|
+
server.setRequestHandler(ListToolsRequestSchema, async (_request, { signal }) => {
|
|
29778
31728
|
try {
|
|
29779
31729
|
const keywordFacts = !showsSchemaKeywords(server.getClientVersion()?.name);
|
|
29780
|
-
const tools = toMcpToolList(await fetchTools(), { keywordFacts });
|
|
31730
|
+
const tools = toMcpToolList(await fetchTools({ signal }), { keywordFacts });
|
|
29781
31731
|
await spyLog({
|
|
29782
31732
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
29783
31733
|
event: "list_tools",
|
|
@@ -29793,8 +31743,9 @@ ${shown.text}` }];
|
|
|
29793
31743
|
return { tools: [] };
|
|
29794
31744
|
}
|
|
29795
31745
|
});
|
|
29796
|
-
server.setRequestHandler(CallToolRequestSchema, async ({ params }, { signal
|
|
31746
|
+
server.setRequestHandler(CallToolRequestSchema, async ({ params }, { signal }) => {
|
|
29797
31747
|
const t0 = Date.now();
|
|
31748
|
+
const callSignal = SAVES_FILES_AFTER_CANCEL.has(canonicalToolId(params.name)) ? void 0 : signal;
|
|
29798
31749
|
let treeUdid;
|
|
29799
31750
|
await spyLog({
|
|
29800
31751
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -29803,7 +31754,11 @@ ${shown.text}` }];
|
|
|
29803
31754
|
args: params.arguments
|
|
29804
31755
|
});
|
|
29805
31756
|
try {
|
|
29806
|
-
const { result, outputHint, note, profiling } = await callTool(
|
|
31757
|
+
const { result, outputHint, note, profiling } = await callTool(
|
|
31758
|
+
params.name,
|
|
31759
|
+
params.arguments,
|
|
31760
|
+
{ signal: callSignal }
|
|
31761
|
+
);
|
|
29807
31762
|
await spyLog({
|
|
29808
31763
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
29809
31764
|
event: "tool_result",
|
|
@@ -29815,7 +31770,8 @@ ${shown.text}` }];
|
|
|
29815
31770
|
const ctx = {
|
|
29816
31771
|
toolsUrl: TOOLS_URL,
|
|
29817
31772
|
authToken: AUTH_TOKEN,
|
|
29818
|
-
deviceId: getDeviceIdFromArgs(params.arguments)
|
|
31773
|
+
deviceId: getDeviceIdFromArgs(params.arguments),
|
|
31774
|
+
signal: callSignal
|
|
29819
31775
|
};
|
|
29820
31776
|
const devicesText = canonicalToolId(params.name) === "list-devices" ? listDevicesText(result) : void 0;
|
|
29821
31777
|
let content;
|
|
@@ -29849,22 +31805,25 @@ ${shown.text}` }];
|
|
|
29849
31805
|
];
|
|
29850
31806
|
} else if (udid && (wantScreenshot || wantTree) && profiling) {
|
|
29851
31807
|
if (params.name !== "describe") {
|
|
29852
|
-
await awaitScreenSettled(udid, params.name);
|
|
31808
|
+
await awaitScreenSettled(udid, params.name, signal);
|
|
29853
31809
|
content = [...content, { type: "text", text: PROFILING_CAPTURE_SKIPPED_NOTE }];
|
|
29854
31810
|
}
|
|
29855
31811
|
} else if (udid && (wantScreenshot || wantTree)) {
|
|
29856
|
-
const screenSettled = await awaitScreenSettled(udid, params.name);
|
|
29857
|
-
const signal = AbortSignal.timeout(captureTimeoutMs);
|
|
29858
|
-
const screenshot = wantScreenshot ? captureScreenshotBlocks(udid, signal) : Promise.resolve([]);
|
|
29859
|
-
if (!screenSettled) await screenshot;
|
|
31812
|
+
const screenSettled = await awaitScreenSettled(udid, params.name, signal);
|
|
29860
31813
|
if (wantTree) treeUdid = udid;
|
|
29861
|
-
const
|
|
29862
|
-
|
|
31814
|
+
const captured = await withDeadline(signal, captureTimeoutMs, async (captureSignal) => {
|
|
31815
|
+
const screenshot = wantScreenshot ? captureScreenshotBlocks(udid, captureSignal) : Promise.resolve([]);
|
|
31816
|
+
if (!screenSettled) await screenshot;
|
|
31817
|
+
const tree = wantTree ? captureTreeBlocks(udid, params.name, captureSignal) : Promise.resolve([]);
|
|
31818
|
+
return [...await screenshot, ...await tree];
|
|
31819
|
+
});
|
|
31820
|
+
content = [...content, ...captured];
|
|
29863
31821
|
}
|
|
29864
31822
|
if (note) {
|
|
29865
31823
|
content = [{ type: "text", text: note }, ...content];
|
|
29866
31824
|
}
|
|
29867
|
-
|
|
31825
|
+
content = [...content, ...whatsNewBlocks()];
|
|
31826
|
+
if (treeUdid !== void 0 && signal.aborted) trees.forget(treeUdid);
|
|
29868
31827
|
return { content };
|
|
29869
31828
|
} catch (err) {
|
|
29870
31829
|
if (treeUdid !== void 0) trees.forget(treeUdid);
|
|
@@ -29874,6 +31833,7 @@ ${shown.text}` }];
|
|
|
29874
31833
|
name: params.name,
|
|
29875
31834
|
durationMs: Date.now() - t0,
|
|
29876
31835
|
isError: true,
|
|
31836
|
+
...signal.aborted ? { cancelled: true } : {},
|
|
29877
31837
|
error: String(err instanceof Error ? err.message : err)
|
|
29878
31838
|
});
|
|
29879
31839
|
return {
|