@swmansion/argent 0.34.1-next.30 → 0.34.1-next.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-cmds.mjs +215 -151
- package/dist/client.js +149 -81
- package/dist/flow-script-runner.mjs +1 -0
- package/dist/installer.mjs +118 -112
- package/dist/mcp-server.mjs +189 -120
- package/dist/tool-args.generated.d.ts +3 -3
- package/dist/tool-server.cjs +280 -168
- package/package.json +1 -1
package/dist/cli-cmds.mjs
CHANGED
|
@@ -4010,10 +4010,10 @@ var require_resolve_block_map = __commonJS({
|
|
|
4010
4010
|
let offset = bm.offset;
|
|
4011
4011
|
let commentEnd = null;
|
|
4012
4012
|
for (const collItem of bm.items) {
|
|
4013
|
-
const { start, key, sep:
|
|
4013
|
+
const { start, key, sep: sep7, value } = collItem;
|
|
4014
4014
|
const keyProps = resolveProps.resolveProps(start, {
|
|
4015
4015
|
indicator: "explicit-key-ind",
|
|
4016
|
-
next: key ??
|
|
4016
|
+
next: key ?? sep7?.[0],
|
|
4017
4017
|
offset,
|
|
4018
4018
|
onError,
|
|
4019
4019
|
parentIndent: bm.indent,
|
|
@@ -4027,7 +4027,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
4027
4027
|
else if ("indent" in key && key.indent !== bm.indent)
|
|
4028
4028
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
4029
4029
|
}
|
|
4030
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
4030
|
+
if (!keyProps.anchor && !keyProps.tag && !sep7) {
|
|
4031
4031
|
commentEnd = keyProps.end;
|
|
4032
4032
|
if (keyProps.comment) {
|
|
4033
4033
|
if (map2.comment)
|
|
@@ -4051,7 +4051,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
4051
4051
|
ctx.atKey = false;
|
|
4052
4052
|
if (utilMapIncludes.mapIncludes(ctx, map2.items, keyNode))
|
|
4053
4053
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
4054
|
-
const valueProps = resolveProps.resolveProps(
|
|
4054
|
+
const valueProps = resolveProps.resolveProps(sep7 ?? [], {
|
|
4055
4055
|
indicator: "map-value-ind",
|
|
4056
4056
|
next: value,
|
|
4057
4057
|
offset: keyNode.range[2],
|
|
@@ -4067,7 +4067,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
4067
4067
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
4068
4068
|
onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
4069
4069
|
}
|
|
4070
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset,
|
|
4070
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep7, null, valueProps, onError);
|
|
4071
4071
|
if (ctx.schema.compat)
|
|
4072
4072
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
4073
4073
|
offset = valueNode.range[2];
|
|
@@ -4158,7 +4158,7 @@ var require_resolve_end = __commonJS({
|
|
|
4158
4158
|
let comment = "";
|
|
4159
4159
|
if (end) {
|
|
4160
4160
|
let hasSpace = false;
|
|
4161
|
-
let
|
|
4161
|
+
let sep7 = "";
|
|
4162
4162
|
for (const token of end) {
|
|
4163
4163
|
const { source, type } = token;
|
|
4164
4164
|
switch (type) {
|
|
@@ -4172,13 +4172,13 @@ var require_resolve_end = __commonJS({
|
|
|
4172
4172
|
if (!comment)
|
|
4173
4173
|
comment = cb;
|
|
4174
4174
|
else
|
|
4175
|
-
comment +=
|
|
4176
|
-
|
|
4175
|
+
comment += sep7 + cb;
|
|
4176
|
+
sep7 = "";
|
|
4177
4177
|
break;
|
|
4178
4178
|
}
|
|
4179
4179
|
case "newline":
|
|
4180
4180
|
if (comment)
|
|
4181
|
-
|
|
4181
|
+
sep7 += source;
|
|
4182
4182
|
hasSpace = true;
|
|
4183
4183
|
break;
|
|
4184
4184
|
default:
|
|
@@ -4221,18 +4221,18 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4221
4221
|
let offset = fc.offset + fc.start.source.length;
|
|
4222
4222
|
for (let i2 = 0; i2 < fc.items.length; ++i2) {
|
|
4223
4223
|
const collItem = fc.items[i2];
|
|
4224
|
-
const { start, key, sep:
|
|
4224
|
+
const { start, key, sep: sep7, value } = collItem;
|
|
4225
4225
|
const props = resolveProps.resolveProps(start, {
|
|
4226
4226
|
flow: fcName,
|
|
4227
4227
|
indicator: "explicit-key-ind",
|
|
4228
|
-
next: key ??
|
|
4228
|
+
next: key ?? sep7?.[0],
|
|
4229
4229
|
offset,
|
|
4230
4230
|
onError,
|
|
4231
4231
|
parentIndent: fc.indent,
|
|
4232
4232
|
startOnNewline: false
|
|
4233
4233
|
});
|
|
4234
4234
|
if (!props.found) {
|
|
4235
|
-
if (!props.anchor && !props.tag && !
|
|
4235
|
+
if (!props.anchor && !props.tag && !sep7 && !value) {
|
|
4236
4236
|
if (i2 === 0 && props.comma)
|
|
4237
4237
|
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
4238
4238
|
else if (i2 < fc.items.length - 1)
|
|
@@ -4286,8 +4286,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4286
4286
|
}
|
|
4287
4287
|
}
|
|
4288
4288
|
}
|
|
4289
|
-
if (!isMap && !
|
|
4290
|
-
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end,
|
|
4289
|
+
if (!isMap && !sep7 && !props.found) {
|
|
4290
|
+
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep7, null, props, onError);
|
|
4291
4291
|
coll.items.push(valueNode);
|
|
4292
4292
|
offset = valueNode.range[2];
|
|
4293
4293
|
if (isBlock(value))
|
|
@@ -4299,7 +4299,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4299
4299
|
if (isBlock(key))
|
|
4300
4300
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
4301
4301
|
ctx.atKey = false;
|
|
4302
|
-
const valueProps = resolveProps.resolveProps(
|
|
4302
|
+
const valueProps = resolveProps.resolveProps(sep7 ?? [], {
|
|
4303
4303
|
flow: fcName,
|
|
4304
4304
|
indicator: "map-value-ind",
|
|
4305
4305
|
next: value,
|
|
@@ -4310,8 +4310,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4310
4310
|
});
|
|
4311
4311
|
if (valueProps.found) {
|
|
4312
4312
|
if (!isMap && !props.found && ctx.options.strict) {
|
|
4313
|
-
if (
|
|
4314
|
-
for (const st of
|
|
4313
|
+
if (sep7)
|
|
4314
|
+
for (const st of sep7) {
|
|
4315
4315
|
if (st === valueProps.found)
|
|
4316
4316
|
break;
|
|
4317
4317
|
if (st.type === "newline") {
|
|
@@ -4328,7 +4328,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4328
4328
|
else
|
|
4329
4329
|
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
4330
4330
|
}
|
|
4331
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
4331
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep7, null, valueProps, onError) : null;
|
|
4332
4332
|
if (valueNode) {
|
|
4333
4333
|
if (isBlock(value))
|
|
4334
4334
|
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -4508,7 +4508,7 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
4508
4508
|
chompStart = i2 + 1;
|
|
4509
4509
|
}
|
|
4510
4510
|
let value = "";
|
|
4511
|
-
let
|
|
4511
|
+
let sep7 = "";
|
|
4512
4512
|
let prevMoreIndented = false;
|
|
4513
4513
|
for (let i2 = 0; i2 < contentStart; ++i2)
|
|
4514
4514
|
value += lines[i2][0].slice(trimIndent) + "\n";
|
|
@@ -4525,24 +4525,24 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
4525
4525
|
indent = "";
|
|
4526
4526
|
}
|
|
4527
4527
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
4528
|
-
value +=
|
|
4529
|
-
|
|
4528
|
+
value += sep7 + indent.slice(trimIndent) + content;
|
|
4529
|
+
sep7 = "\n";
|
|
4530
4530
|
} else if (indent.length > trimIndent || content[0] === " ") {
|
|
4531
|
-
if (
|
|
4532
|
-
|
|
4533
|
-
else if (!prevMoreIndented &&
|
|
4534
|
-
|
|
4535
|
-
value +=
|
|
4536
|
-
|
|
4531
|
+
if (sep7 === " ")
|
|
4532
|
+
sep7 = "\n";
|
|
4533
|
+
else if (!prevMoreIndented && sep7 === "\n")
|
|
4534
|
+
sep7 = "\n\n";
|
|
4535
|
+
value += sep7 + indent.slice(trimIndent) + content;
|
|
4536
|
+
sep7 = "\n";
|
|
4537
4537
|
prevMoreIndented = true;
|
|
4538
4538
|
} else if (content === "") {
|
|
4539
|
-
if (
|
|
4539
|
+
if (sep7 === "\n")
|
|
4540
4540
|
value += "\n";
|
|
4541
4541
|
else
|
|
4542
|
-
|
|
4542
|
+
sep7 = "\n";
|
|
4543
4543
|
} else {
|
|
4544
|
-
value +=
|
|
4545
|
-
|
|
4544
|
+
value += sep7 + content;
|
|
4545
|
+
sep7 = " ";
|
|
4546
4546
|
prevMoreIndented = false;
|
|
4547
4547
|
}
|
|
4548
4548
|
}
|
|
@@ -4725,25 +4725,25 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
4725
4725
|
trimBoth = /^[ \t]+|[ \t]+$/g;
|
|
4726
4726
|
}
|
|
4727
4727
|
let res = match[1].replace(trimEnd, "");
|
|
4728
|
-
let
|
|
4728
|
+
let sep7 = " ";
|
|
4729
4729
|
let pos = line.lastIndex;
|
|
4730
4730
|
while (match = line.exec(source)) {
|
|
4731
4731
|
const lm = match[1].replace(trimBoth, "");
|
|
4732
4732
|
if (lm === "") {
|
|
4733
|
-
if (
|
|
4734
|
-
res +=
|
|
4733
|
+
if (sep7 === "\n")
|
|
4734
|
+
res += sep7;
|
|
4735
4735
|
else
|
|
4736
|
-
|
|
4736
|
+
sep7 = "\n";
|
|
4737
4737
|
} else {
|
|
4738
|
-
res +=
|
|
4739
|
-
|
|
4738
|
+
res += sep7 + lm;
|
|
4739
|
+
sep7 = " ";
|
|
4740
4740
|
}
|
|
4741
4741
|
pos = line.lastIndex;
|
|
4742
4742
|
}
|
|
4743
4743
|
const last = /[ \t]*(.*)/sy;
|
|
4744
4744
|
last.lastIndex = pos;
|
|
4745
4745
|
match = last.exec(source);
|
|
4746
|
-
return res +
|
|
4746
|
+
return res + sep7 + (match?.[1] ?? "");
|
|
4747
4747
|
}
|
|
4748
4748
|
function doubleQuotedValue(source, onError) {
|
|
4749
4749
|
let res = "";
|
|
@@ -5553,14 +5553,14 @@ var require_cst_stringify = __commonJS({
|
|
|
5553
5553
|
}
|
|
5554
5554
|
}
|
|
5555
5555
|
}
|
|
5556
|
-
function stringifyItem({ start, key, sep:
|
|
5556
|
+
function stringifyItem({ start, key, sep: sep7, value }) {
|
|
5557
5557
|
let res = "";
|
|
5558
5558
|
for (const st of start)
|
|
5559
5559
|
res += st.source;
|
|
5560
5560
|
if (key)
|
|
5561
5561
|
res += stringifyToken(key);
|
|
5562
|
-
if (
|
|
5563
|
-
for (const st of
|
|
5562
|
+
if (sep7)
|
|
5563
|
+
for (const st of sep7)
|
|
5564
5564
|
res += st.source;
|
|
5565
5565
|
if (value)
|
|
5566
5566
|
res += stringifyToken(value);
|
|
@@ -6727,18 +6727,18 @@ var require_parser = __commonJS({
|
|
|
6727
6727
|
if (this.type === "map-value-ind") {
|
|
6728
6728
|
const prev = getPrevProps(this.peek(2));
|
|
6729
6729
|
const start = getFirstKeyStartProps(prev);
|
|
6730
|
-
let
|
|
6730
|
+
let sep7;
|
|
6731
6731
|
if (scalar.end) {
|
|
6732
|
-
|
|
6733
|
-
|
|
6732
|
+
sep7 = scalar.end;
|
|
6733
|
+
sep7.push(this.sourceToken);
|
|
6734
6734
|
delete scalar.end;
|
|
6735
6735
|
} else
|
|
6736
|
-
|
|
6736
|
+
sep7 = [this.sourceToken];
|
|
6737
6737
|
const map2 = {
|
|
6738
6738
|
type: "block-map",
|
|
6739
6739
|
offset: scalar.offset,
|
|
6740
6740
|
indent: scalar.indent,
|
|
6741
|
-
items: [{ start, key: scalar, sep:
|
|
6741
|
+
items: [{ start, key: scalar, sep: sep7 }]
|
|
6742
6742
|
};
|
|
6743
6743
|
this.onKeyLine = true;
|
|
6744
6744
|
this.stack[this.stack.length - 1] = map2;
|
|
@@ -6891,15 +6891,15 @@ var require_parser = __commonJS({
|
|
|
6891
6891
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
6892
6892
|
const start2 = getFirstKeyStartProps(it.start);
|
|
6893
6893
|
const key = it.key;
|
|
6894
|
-
const
|
|
6895
|
-
|
|
6894
|
+
const sep7 = it.sep;
|
|
6895
|
+
sep7.push(this.sourceToken);
|
|
6896
6896
|
delete it.key;
|
|
6897
6897
|
delete it.sep;
|
|
6898
6898
|
this.stack.push({
|
|
6899
6899
|
type: "block-map",
|
|
6900
6900
|
offset: this.offset,
|
|
6901
6901
|
indent: this.indent,
|
|
6902
|
-
items: [{ start: start2, key, sep:
|
|
6902
|
+
items: [{ start: start2, key, sep: sep7 }]
|
|
6903
6903
|
});
|
|
6904
6904
|
} else if (start.length > 0) {
|
|
6905
6905
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -7093,13 +7093,13 @@ var require_parser = __commonJS({
|
|
|
7093
7093
|
const prev = getPrevProps(parent);
|
|
7094
7094
|
const start = getFirstKeyStartProps(prev);
|
|
7095
7095
|
fixFlowSeqItems(fc);
|
|
7096
|
-
const
|
|
7097
|
-
|
|
7096
|
+
const sep7 = fc.end.splice(1, fc.end.length);
|
|
7097
|
+
sep7.push(this.sourceToken);
|
|
7098
7098
|
const map2 = {
|
|
7099
7099
|
type: "block-map",
|
|
7100
7100
|
offset: fc.offset,
|
|
7101
7101
|
indent: fc.indent,
|
|
7102
|
-
items: [{ start, key: fc, sep:
|
|
7102
|
+
items: [{ start, key: fc, sep: sep7 }]
|
|
7103
7103
|
};
|
|
7104
7104
|
this.onKeyLine = true;
|
|
7105
7105
|
this.stack[this.stack.length - 1] = map2;
|
|
@@ -7277,7 +7277,7 @@ var require_public_api = __commonJS({
|
|
|
7277
7277
|
}
|
|
7278
7278
|
return doc;
|
|
7279
7279
|
}
|
|
7280
|
-
function
|
|
7280
|
+
function parse4(src, reviver, options) {
|
|
7281
7281
|
let _reviver = void 0;
|
|
7282
7282
|
if (typeof reviver === "function") {
|
|
7283
7283
|
_reviver = reviver;
|
|
@@ -7318,7 +7318,7 @@ var require_public_api = __commonJS({
|
|
|
7318
7318
|
return value.toString(options);
|
|
7319
7319
|
return new Document.Document(value, _replacer, options).toString(options);
|
|
7320
7320
|
}
|
|
7321
|
-
exports.parse =
|
|
7321
|
+
exports.parse = parse4;
|
|
7322
7322
|
exports.parseAllDocuments = parseAllDocuments;
|
|
7323
7323
|
exports.parseDocument = parseDocument;
|
|
7324
7324
|
exports.stringify = stringify;
|
|
@@ -8959,7 +8959,7 @@ function generateAuthToken() {
|
|
|
8959
8959
|
return generateToken();
|
|
8960
8960
|
}
|
|
8961
8961
|
function findFreePort() {
|
|
8962
|
-
return new Promise((
|
|
8962
|
+
return new Promise((resolve14, reject) => {
|
|
8963
8963
|
const srv = net.createServer();
|
|
8964
8964
|
srv.listen(0, "127.0.0.1", () => {
|
|
8965
8965
|
const addr = srv.address();
|
|
@@ -8970,21 +8970,21 @@ function findFreePort() {
|
|
|
8970
8970
|
const port = addr.port;
|
|
8971
8971
|
srv.close((err) => {
|
|
8972
8972
|
if (err) reject(err);
|
|
8973
|
-
else
|
|
8973
|
+
else resolve14(port);
|
|
8974
8974
|
});
|
|
8975
8975
|
});
|
|
8976
8976
|
srv.on("error", reject);
|
|
8977
8977
|
});
|
|
8978
8978
|
}
|
|
8979
8979
|
function isVersionNewer(a2, b) {
|
|
8980
|
-
const
|
|
8980
|
+
const parse4 = (v) => {
|
|
8981
8981
|
const [core = "", ...preParts] = v.split("+")[0].split("-");
|
|
8982
8982
|
const nums = core.split(".").map((n3) => Number.parseInt(n3, 10));
|
|
8983
8983
|
if (nums.length === 0 || nums.some((n3) => Number.isNaN(n3))) return null;
|
|
8984
8984
|
return { nums, pre: preParts.length > 0 ? preParts.join("-").split(".") : [] };
|
|
8985
8985
|
};
|
|
8986
|
-
const pa =
|
|
8987
|
-
const pb =
|
|
8986
|
+
const pa = parse4(a2);
|
|
8987
|
+
const pb = parse4(b);
|
|
8988
8988
|
if (!pa || !pb) return false;
|
|
8989
8989
|
for (let i2 = 0; i2 < 3; i2++) {
|
|
8990
8990
|
const x = pa.nums[i2] ?? 0;
|
|
@@ -9075,7 +9075,7 @@ function resolveToolsServerNode() {
|
|
|
9075
9075
|
return !(bun || deno || electron) && fs.existsSync(process.execPath) ? process.execPath : "node";
|
|
9076
9076
|
}
|
|
9077
9077
|
function spawnToolsServer(paths, port, options = {}) {
|
|
9078
|
-
return new Promise((
|
|
9078
|
+
return new Promise((resolve14, reject) => {
|
|
9079
9079
|
let logFd;
|
|
9080
9080
|
try {
|
|
9081
9081
|
fs.mkdirSync(STATE_DIR, { recursive: true });
|
|
@@ -9121,7 +9121,7 @@ function spawnToolsServer(paths, port, options = {}) {
|
|
|
9121
9121
|
rl.close();
|
|
9122
9122
|
child.stdout?.resume();
|
|
9123
9123
|
child.stdout?.unref?.();
|
|
9124
|
-
settle2(() =>
|
|
9124
|
+
settle2(() => resolve14({ port: actualPort, pid }));
|
|
9125
9125
|
}
|
|
9126
9126
|
});
|
|
9127
9127
|
child.on("error", (err) => {
|
|
@@ -10261,10 +10261,18 @@ function toolStepFiles(specs, args) {
|
|
|
10261
10261
|
}
|
|
10262
10262
|
return files;
|
|
10263
10263
|
}
|
|
10264
|
+
var UNEXPANDED_PATH = /^~|\$[A-Za-z0-9_{(]|`|%[A-Za-z_][A-Za-z0-9_]*%|^[A-Za-z][A-Za-z0-9+.-]+:/;
|
|
10265
|
+
function isUnexpandedPath(p) {
|
|
10266
|
+
return UNEXPANDED_PATH.test(p);
|
|
10267
|
+
}
|
|
10264
10268
|
function isClientFileArgument({ spec, path: path29 }) {
|
|
10265
10269
|
return spec.kind === "file" && spec.path === `\${${spec.target}}` && path29.startsWith("/") && hasToolFileExtension(path29);
|
|
10266
10270
|
}
|
|
10267
10271
|
|
|
10272
|
+
// ../registry/src/flow-platforms.ts
|
|
10273
|
+
var LAUNCH_PLATFORMS = ["ios", "android", "chromium", "vega", "macos"];
|
|
10274
|
+
var SELECTABLE_PLATFORMS = [...LAUNCH_PLATFORMS, "ios-remote"];
|
|
10275
|
+
|
|
10268
10276
|
// ../registry/src/flow-file-refs.ts
|
|
10269
10277
|
import * as fs7 from "node:fs/promises";
|
|
10270
10278
|
import * as path8 from "node:path";
|
|
@@ -10398,6 +10406,9 @@ var MAX_BLOCK_NESTING = 64;
|
|
|
10398
10406
|
function isRecord(value) {
|
|
10399
10407
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10400
10408
|
}
|
|
10409
|
+
function flowYamlSource(content) {
|
|
10410
|
+
return content.replace(/^\s+/, (lead) => lead.replace(/[^\n]/g, "")).trimEnd();
|
|
10411
|
+
}
|
|
10401
10412
|
function collectFlowRequests(doc) {
|
|
10402
10413
|
const runTargets = /* @__PURE__ */ new Set();
|
|
10403
10414
|
const snapshots = /* @__PURE__ */ new Set();
|
|
@@ -10672,6 +10683,8 @@ var FAILURE_CODES = {
|
|
|
10672
10683
|
DEBUGGER_TARGET_DEVICE_MISMATCH: "DEBUGGER_TARGET_DEVICE_MISMATCH",
|
|
10673
10684
|
DEBUGGER_EVALUATE_EXPRESSION_THREW: "DEBUGGER_EVALUATE_EXPRESSION_THREW",
|
|
10674
10685
|
DEBUGGER_RELOAD_FAILED: "DEBUGGER_RELOAD_FAILED",
|
|
10686
|
+
// e2e-add-step refused a debugger-* call that answered `not_connected`.
|
|
10687
|
+
DEBUGGER_NOT_CONNECTED: "DEBUGGER_NOT_CONNECTED",
|
|
10675
10688
|
JS_RUNTIME_CONSOLE_SERVER_BIND_FAILED: "JS_RUNTIME_CONSOLE_SERVER_BIND_FAILED",
|
|
10676
10689
|
JS_RUNTIME_PAYLOAD_INVALID: "JS_RUNTIME_PAYLOAD_INVALID",
|
|
10677
10690
|
JS_RUNTIME_PAYLOAD_DEVICE_MISSING: "JS_RUNTIME_PAYLOAD_DEVICE_MISSING",
|
|
@@ -12824,18 +12837,18 @@ var validateAsync = async (schema, value, _ctx) => {
|
|
|
12824
12837
|
return result.issues.length === 0;
|
|
12825
12838
|
};
|
|
12826
12839
|
var _encode = (_Err) => {
|
|
12827
|
-
const
|
|
12840
|
+
const parse4 = _parse(_Err);
|
|
12828
12841
|
const fn = (schema, value, _ctx, _params) => {
|
|
12829
12842
|
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
12830
|
-
return
|
|
12843
|
+
return parse4(schema, value, ctx, finalizeParams(fn, _params));
|
|
12831
12844
|
};
|
|
12832
12845
|
return fn;
|
|
12833
12846
|
};
|
|
12834
12847
|
var encode = /* @__PURE__ */ _encode($ZodRealError);
|
|
12835
12848
|
var _decode = (_Err) => {
|
|
12836
|
-
const
|
|
12849
|
+
const parse4 = _parse(_Err);
|
|
12837
12850
|
const fn = (schema, value, _ctx, _params) => {
|
|
12838
|
-
return
|
|
12851
|
+
return parse4(schema, value, _ctx, finalizeParams(fn, _params));
|
|
12839
12852
|
};
|
|
12840
12853
|
return fn;
|
|
12841
12854
|
};
|
|
@@ -14330,7 +14343,7 @@ function capSize(inst, size) {
|
|
|
14330
14343
|
if (!caps.length)
|
|
14331
14344
|
return;
|
|
14332
14345
|
const cap = Math.min(...caps.map((c2) => c2[0]));
|
|
14333
|
-
const
|
|
14346
|
+
const parse4 = inst._zod.parse;
|
|
14334
14347
|
inst._zod.parse = (payload, ctx) => {
|
|
14335
14348
|
const n3 = size(payload.value);
|
|
14336
14349
|
if (n3 > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
@@ -14344,7 +14357,7 @@ function capSize(inst, size) {
|
|
|
14344
14357
|
}
|
|
14345
14358
|
}
|
|
14346
14359
|
}
|
|
14347
|
-
return
|
|
14360
|
+
return parse4(payload, ctx);
|
|
14348
14361
|
};
|
|
14349
14362
|
}
|
|
14350
14363
|
var arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
|
|
@@ -16033,7 +16046,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
|
|
|
16033
16046
|
var NONE = 0;
|
|
16034
16047
|
var ASSUMED = 1;
|
|
16035
16048
|
var PROVEN = 2;
|
|
16036
|
-
function isRecursive(inst, stack,
|
|
16049
|
+
function isRecursive(inst, stack, resolve14) {
|
|
16037
16050
|
const cached3 = recursive.get(inst);
|
|
16038
16051
|
if (cached3 !== void 0)
|
|
16039
16052
|
return cached3 ? PROVEN : NONE;
|
|
@@ -16043,7 +16056,7 @@ function isRecursive(inst, stack, resolve13) {
|
|
|
16043
16056
|
let result = NONE;
|
|
16044
16057
|
const check2 = (child) => {
|
|
16045
16058
|
if (result !== PROVEN && child?._zod) {
|
|
16046
|
-
const answer = isRecursive(child, stack,
|
|
16059
|
+
const answer = isRecursive(child, stack, resolve14);
|
|
16047
16060
|
if (answer > result)
|
|
16048
16061
|
result = answer;
|
|
16049
16062
|
}
|
|
@@ -16054,7 +16067,7 @@ function isRecursive(inst, stack, resolve13) {
|
|
|
16054
16067
|
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
16055
16068
|
if (spread && !desc.enumerable)
|
|
16056
16069
|
continue;
|
|
16057
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack,
|
|
16070
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve14) : NONE;
|
|
16058
16071
|
if (child > answer)
|
|
16059
16072
|
answer = child;
|
|
16060
16073
|
}
|
|
@@ -16118,7 +16131,7 @@ function isRecursive(inst, stack, resolve13) {
|
|
|
16118
16131
|
break;
|
|
16119
16132
|
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
16120
16133
|
case "lazy": {
|
|
16121
|
-
const inner = def._cachedInner ?? (
|
|
16134
|
+
const inner = def._cachedInner ?? (resolve14 ? inst._zod.innerType : void 0);
|
|
16122
16135
|
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
16123
16136
|
break;
|
|
16124
16137
|
}
|
|
@@ -31032,7 +31045,7 @@ async function runTar(archive, args, signal) {
|
|
|
31032
31045
|
child.on("error", (err) => {
|
|
31033
31046
|
childError = err;
|
|
31034
31047
|
});
|
|
31035
|
-
const closed = new Promise((
|
|
31048
|
+
const closed = new Promise((resolve14) => child.once("close", resolve14));
|
|
31036
31049
|
const stdout2 = collect(child.stdout, MAX_LISTING_BYTES, {
|
|
31037
31050
|
maxLines: MAX_LISTING_LINES,
|
|
31038
31051
|
onOverflow: () => child.kill()
|
|
@@ -31202,6 +31215,22 @@ function interpolatePath(template, args) {
|
|
|
31202
31215
|
});
|
|
31203
31216
|
return missing ? null : out;
|
|
31204
31217
|
}
|
|
31218
|
+
function callerPath(p) {
|
|
31219
|
+
const onCurrentDrive = path10.sep === "\\" && /^[\\/](?![\\/])/.test(p);
|
|
31220
|
+
if (!onCurrentDrive && (path10.isAbsolute(p) || path10.win32.isAbsolute(p) || isUnexpandedPath(p))) {
|
|
31221
|
+
return p;
|
|
31222
|
+
}
|
|
31223
|
+
const { root } = path10.parse(p);
|
|
31224
|
+
const rest = p.slice(root.length);
|
|
31225
|
+
if (!rest.split(/[\\/]/).includes("..")) {
|
|
31226
|
+
const resolved = path10.resolve(p);
|
|
31227
|
+
const last = p.split(path10.sep === "\\" ? /[\\/]/ : "/").at(-1);
|
|
31228
|
+
const dirOnly = p !== last && (last === "" || last === ".") && !resolved.endsWith(path10.sep);
|
|
31229
|
+
return dirOnly ? `${resolved}${path10.sep}` : resolved;
|
|
31230
|
+
}
|
|
31231
|
+
const base = path10.resolve(root);
|
|
31232
|
+
return base.endsWith(path10.sep) ? `${base}${rest}` : `${base}${path10.sep}${rest}`;
|
|
31233
|
+
}
|
|
31205
31234
|
async function specPath(spec, args) {
|
|
31206
31235
|
if (spec.kind !== "file" || !spec.paths?.length) return interpolatePath(spec.path, args);
|
|
31207
31236
|
const candidates = [];
|
|
@@ -31247,9 +31276,9 @@ function untrackArchive(archive) {
|
|
|
31247
31276
|
process.removeListener("exit", removePendingArchives);
|
|
31248
31277
|
}
|
|
31249
31278
|
function sha256File(filePath, signal) {
|
|
31250
|
-
return new Promise((
|
|
31279
|
+
return new Promise((resolve14, reject) => {
|
|
31251
31280
|
const hash2 = createHash2("sha256");
|
|
31252
|
-
createReadStream2(filePath, { signal }).on("data", (chunk) => hash2.update(chunk)).on("end", () =>
|
|
31281
|
+
createReadStream2(filePath, { signal }).on("data", (chunk) => hash2.update(chunk)).on("end", () => resolve14(hash2.digest("hex"))).on("error", reject);
|
|
31253
31282
|
});
|
|
31254
31283
|
}
|
|
31255
31284
|
function toolServerError(text2) {
|
|
@@ -31347,13 +31376,21 @@ async function prepareFileInputs(specs, args, opts) {
|
|
|
31347
31376
|
return args;
|
|
31348
31377
|
}
|
|
31349
31378
|
const record2 = args;
|
|
31350
|
-
|
|
31379
|
+
const planned = [];
|
|
31380
|
+
const callArgs = { ...record2 };
|
|
31351
31381
|
for (const spec of specs) {
|
|
31352
31382
|
if (spec.skipWhenSet && record2[spec.skipWhenSet] !== void 0) continue;
|
|
31353
31383
|
if (spec.target in record2 && typeof record2[spec.target] !== "string") continue;
|
|
31354
|
-
const
|
|
31355
|
-
if (
|
|
31356
|
-
if (spec.target in record2 && record2[spec.target] !==
|
|
31384
|
+
const spelled = await specPath(spec, record2);
|
|
31385
|
+
if (spelled === null) continue;
|
|
31386
|
+
if (spec.target in record2 && record2[spec.target] !== spelled) continue;
|
|
31387
|
+
const filePath = callerPath(spelled);
|
|
31388
|
+
planned.push({ spec, filePath });
|
|
31389
|
+
if (spec.target in record2) callArgs[spec.target] = filePath;
|
|
31390
|
+
}
|
|
31391
|
+
if (planned.length === 0) return args;
|
|
31392
|
+
const out = { ...record2 };
|
|
31393
|
+
for (const { spec, filePath } of planned) {
|
|
31357
31394
|
const wire = { [FILE_INPUT_MARKER2]: true, path: filePath };
|
|
31358
31395
|
if (spec.kind === "file") {
|
|
31359
31396
|
const read = await readFileInputWire(filePath, { includeContent: opts.includeContent });
|
|
@@ -31361,12 +31398,12 @@ async function prepareFileInputs(specs, args, opts) {
|
|
|
31361
31398
|
if (spec.collect === "flow" && opts.includeContent && wire.content !== void 0 && opts.collectMembers) {
|
|
31362
31399
|
Object.assign(
|
|
31363
31400
|
wire,
|
|
31364
|
-
await opts.collectMembers(filePath, Buffer.from(wire.content, "base64"),
|
|
31401
|
+
await opts.collectMembers(filePath, Buffer.from(wire.content, "base64"), callArgs, opts)
|
|
31365
31402
|
);
|
|
31366
31403
|
}
|
|
31367
31404
|
}
|
|
31368
31405
|
if (spec.kind === "probe" && spec.collect === "step" && opts.includeContent && opts.collectStepMembers) {
|
|
31369
|
-
wire.members = await opts.collectStepMembers(
|
|
31406
|
+
wire.members = await opts.collectStepMembers(callArgs, opts);
|
|
31370
31407
|
}
|
|
31371
31408
|
if (spec.kind === "tar-upload") {
|
|
31372
31409
|
const st = await stat3(filePath).catch(() => null);
|
|
@@ -31380,10 +31417,9 @@ async function prepareFileInputs(specs, args, opts) {
|
|
|
31380
31417
|
Object.assign(wire, await uploadFile(filePath, opts.uploadEndpoint, opts.signal));
|
|
31381
31418
|
}
|
|
31382
31419
|
}
|
|
31383
|
-
out = out ?? { ...record2 };
|
|
31384
31420
|
out[spec.target] = wire;
|
|
31385
31421
|
}
|
|
31386
|
-
return out
|
|
31422
|
+
return out;
|
|
31387
31423
|
}
|
|
31388
31424
|
function isAllowedClientFilePath(p) {
|
|
31389
31425
|
if (!path10.isAbsolute(p)) return false;
|
|
@@ -31747,7 +31783,7 @@ function memberCollector(roots, opts) {
|
|
|
31747
31783
|
for (let file2 = files.shift(); file2 !== void 0; file2 = files.shift()) {
|
|
31748
31784
|
let doc;
|
|
31749
31785
|
try {
|
|
31750
|
-
doc = (0, import_yaml.parse)(file2.text
|
|
31786
|
+
doc = (0, import_yaml.parse)(flowYamlSource(file2.text), { logLevel: "error" });
|
|
31751
31787
|
} catch {
|
|
31752
31788
|
continue;
|
|
31753
31789
|
}
|
|
@@ -31862,7 +31898,7 @@ function recordedStep(args) {
|
|
|
31862
31898
|
async function collectStepMembers(args, opts, recordingDirFor = e2eDirFor) {
|
|
31863
31899
|
const { name, project_root: projectRoot } = args;
|
|
31864
31900
|
const step = recordedStep(args);
|
|
31865
|
-
if (typeof name !== "string" || !FLOW_NAME_PATTERN.test(name) ||
|
|
31901
|
+
if (typeof name !== "string" || !FLOW_NAME_PATTERN.test(name) || !isResolvedAbsolute2(projectRoot) || step === void 0) {
|
|
31866
31902
|
return [];
|
|
31867
31903
|
}
|
|
31868
31904
|
const recording = path11.join(recordingDirFor(projectRoot), `${name}.yaml`);
|
|
@@ -31948,7 +31984,10 @@ async function stepForOlderServer(args, listedId) {
|
|
|
31948
31984
|
async function e2eShadowWarningFor(tool, args) {
|
|
31949
31985
|
const id = canonicalToolId(tool);
|
|
31950
31986
|
if (id !== "e2e-execute" && id !== "e2e-read-prerequisite") return void 0;
|
|
31951
|
-
const
|
|
31987
|
+
const root = args?.project_root;
|
|
31988
|
+
const target = nestedFlowTarget(
|
|
31989
|
+
typeof root === "string" ? { ...args, project_root: callerPath(root) } : args
|
|
31990
|
+
);
|
|
31952
31991
|
if (target?.kind !== "name") return void 0;
|
|
31953
31992
|
const picked = await pickE2eFile(target.paths);
|
|
31954
31993
|
return picked.shadowed === void 0 ? void 0 : e2eShadowWarning(picked.path, picked.shadowed);
|
|
@@ -32112,7 +32151,7 @@ async function forwardedSecrets(args) {
|
|
|
32112
32151
|
}
|
|
32113
32152
|
let parsed;
|
|
32114
32153
|
try {
|
|
32115
|
-
parsed = text2 === void 0 ? void 0 : (0, import_yaml2.parse)(text2
|
|
32154
|
+
parsed = text2 === void 0 ? void 0 : (0, import_yaml2.parse)(flowYamlSource(text2), { logLevel: "error" });
|
|
32116
32155
|
} catch {
|
|
32117
32156
|
continue;
|
|
32118
32157
|
}
|
|
@@ -32143,6 +32182,34 @@ function secretsTransportRefusal(url2) {
|
|
|
32143
32182
|
return void 0;
|
|
32144
32183
|
}
|
|
32145
32184
|
var FETCH_HEAD_BYTES = 256;
|
|
32185
|
+
function isRecord2(value) {
|
|
32186
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
32187
|
+
}
|
|
32188
|
+
var PROJECT_PATH_ADVICE = {
|
|
32189
|
+
project_root: "Pass the absolute path to the project root directory - the same cwd the calling agent is working in.",
|
|
32190
|
+
e2e_test_path: "Pass the absolute path to the e2e test file."
|
|
32191
|
+
};
|
|
32192
|
+
function assertAbsoluteProjectPaths(meta3, args) {
|
|
32193
|
+
if (!meta3 || !isRecord2(args)) return;
|
|
32194
|
+
const aliases = Object.entries(toolParamAliases(meta3.name));
|
|
32195
|
+
for (const [param, advice] of Object.entries(PROJECT_PATH_ADVICE)) {
|
|
32196
|
+
const value = args[param];
|
|
32197
|
+
if (typeof value !== "string" || callerPath(value) === value) continue;
|
|
32198
|
+
const names = [param, ...aliases.filter(([, current]) => current === param).map(([f]) => f)];
|
|
32199
|
+
if (!meta3.fileInputs?.some((spec) => names.some((n3) => spec.path.includes(`\${${n3}}`)))) {
|
|
32200
|
+
continue;
|
|
32201
|
+
}
|
|
32202
|
+
throw new Error(`${param} must be an absolute path (got "${value}"). ${advice}`);
|
|
32203
|
+
}
|
|
32204
|
+
}
|
|
32205
|
+
function failedRun(result) {
|
|
32206
|
+
if (!isRecord2(result)) return result;
|
|
32207
|
+
if (result.ok === true) return { ...result, ok: false };
|
|
32208
|
+
if (isRecord2(result.toolResult) && result.toolResult.ok === true) {
|
|
32209
|
+
return { ...result, toolResult: { ...result.toolResult, ok: false } };
|
|
32210
|
+
}
|
|
32211
|
+
return result;
|
|
32212
|
+
}
|
|
32146
32213
|
function createToolsClient(options = {}) {
|
|
32147
32214
|
let cached3 = null;
|
|
32148
32215
|
const doFetch = options.fetchImpl ?? ((url2, init2) => fetch(url2, init2));
|
|
@@ -32191,6 +32258,7 @@ function createToolsClient(options = {}) {
|
|
|
32191
32258
|
let finalArgs = canonicalToolArgs(name, args);
|
|
32192
32259
|
const { tools: tools2, uploadFormats } = await fetchToolList({ signal: opts?.signal });
|
|
32193
32260
|
const meta3 = findTool(tools2, name);
|
|
32261
|
+
if (options.refuseRelativeProjectPaths) assertAbsoluteProjectPaths(meta3, finalArgs);
|
|
32194
32262
|
const olderServer = meta3 !== null && !tools2.some((t2) => t2.name === canonicalToolId(meta3.name));
|
|
32195
32263
|
if (meta3) {
|
|
32196
32264
|
finalArgs = await nameToE2ePathForOlderServer(meta3.name, meta3.fileInputs, finalArgs);
|
|
@@ -32228,7 +32296,7 @@ function createToolsClient(options = {}) {
|
|
|
32228
32296
|
}
|
|
32229
32297
|
}
|
|
32230
32298
|
}
|
|
32231
|
-
const result = applied.result;
|
|
32299
|
+
const result = applied.failed.length > 0 ? failedRun(applied.result) : applied.result;
|
|
32232
32300
|
if (shadowWarning === void 0 || typeof result !== "object" || result === null || Array.isArray(result) || typeof result.warning === "string") {
|
|
32233
32301
|
return result;
|
|
32234
32302
|
}
|
|
@@ -32367,7 +32435,7 @@ import {
|
|
|
32367
32435
|
} from "node:fs/promises";
|
|
32368
32436
|
import { constants as fsConstants } from "node:fs";
|
|
32369
32437
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
32370
|
-
import { basename as basename7, dirname as dirname9, extname as extname2, isAbsolute as isAbsolute6, join as join13, normalize as normalize2, resolve as
|
|
32438
|
+
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";
|
|
32371
32439
|
import { createHash as createHash3 } from "node:crypto";
|
|
32372
32440
|
var ARTIFACT_MARKER2 = "__argentArtifact";
|
|
32373
32441
|
function isArtifactHandle(value) {
|
|
@@ -32415,8 +32483,8 @@ function configuredRecordingsDir() {
|
|
|
32415
32483
|
const trimmed = value.trim();
|
|
32416
32484
|
if (trimmed === "") return null;
|
|
32417
32485
|
const home = dirname9(argentHomeDir());
|
|
32418
|
-
const expanded = trimmed === "~" ? home : trimmed.startsWith("~/") || trimmed.startsWith(`~${
|
|
32419
|
-
return
|
|
32486
|
+
const expanded = trimmed === "~" ? home : trimmed.startsWith("~/") || trimmed.startsWith(`~${sep5}`) ? join13(home, trimmed.slice(2)) : trimmed;
|
|
32487
|
+
return resolve10(durableBaseDir(), expanded);
|
|
32420
32488
|
}
|
|
32421
32489
|
var MAX_ARTIFACT_BYTES = 2 * 1024 * 1024 * 1024;
|
|
32422
32490
|
async function readCapped(res, cap) {
|
|
@@ -32463,7 +32531,7 @@ async function writeDurableUnique(dir, filename, write) {
|
|
|
32463
32531
|
function durableSaveTarget(handle) {
|
|
32464
32532
|
if (typeof handle.saveDir !== "string" || !handle.saveDir || handle.archive) return null;
|
|
32465
32533
|
const rel = normalize2(handle.saveDir);
|
|
32466
|
-
if (isAbsolute6(rel) || rel === ".." || rel.startsWith(`..${
|
|
32534
|
+
if (isAbsolute6(rel) || rel === ".." || rel.startsWith(`..${sep5}`) || rel.split(sep5).includes("..")) {
|
|
32467
32535
|
return null;
|
|
32468
32536
|
}
|
|
32469
32537
|
if (!ALLOWED_SAVE_DIRS.has(rel)) return null;
|
|
@@ -33069,8 +33137,8 @@ var Deferred = class {
|
|
|
33069
33137
|
_resolve;
|
|
33070
33138
|
_reject;
|
|
33071
33139
|
constructor() {
|
|
33072
|
-
this._promise = new Promise((
|
|
33073
|
-
this._resolve =
|
|
33140
|
+
this._promise = new Promise((resolve14, reject) => {
|
|
33141
|
+
this._resolve = resolve14;
|
|
33074
33142
|
this._reject = reject;
|
|
33075
33143
|
});
|
|
33076
33144
|
}
|
|
@@ -33963,8 +34031,8 @@ var ExportOperation = class {
|
|
|
33963
34031
|
_metrics;
|
|
33964
34032
|
_exportScheduledResolve;
|
|
33965
34033
|
constructor(exporter, logRecords, exportTimeoutMillis, metrics) {
|
|
33966
|
-
this._exportScheduledPromise = new Promise((
|
|
33967
|
-
this._exportScheduledResolve =
|
|
34034
|
+
this._exportScheduledPromise = new Promise((resolve14) => {
|
|
34035
|
+
this._exportScheduledResolve = resolve14;
|
|
33968
34036
|
});
|
|
33969
34037
|
this._exportCompleted = this._executeExport(exporter, logRecords, exportTimeoutMillis);
|
|
33970
34038
|
this._metrics = metrics;
|
|
@@ -33989,7 +34057,7 @@ var ExportOperation = class {
|
|
|
33989
34057
|
}
|
|
33990
34058
|
}
|
|
33991
34059
|
async _exportWithTimeout(exporter, logRecords, exportTimeoutMillis) {
|
|
33992
|
-
return new Promise((
|
|
34060
|
+
return new Promise((resolve14, reject) => {
|
|
33993
34061
|
const timer = setTimeout(() => {
|
|
33994
34062
|
reject(new Error("Timeout"));
|
|
33995
34063
|
}, exportTimeoutMillis);
|
|
@@ -33997,7 +34065,7 @@ var ExportOperation = class {
|
|
|
33997
34065
|
this._metrics.finishLogs(logRecords.length, result.error);
|
|
33998
34066
|
clearTimeout(timer);
|
|
33999
34067
|
if (result.code === ExportResultCode.SUCCESS) {
|
|
34000
|
-
|
|
34068
|
+
resolve14();
|
|
34001
34069
|
} else {
|
|
34002
34070
|
reject(result.error ?? new Error("BatchLogRecordProcessor: log record export failed"));
|
|
34003
34071
|
}
|
|
@@ -34778,7 +34846,7 @@ function parseRetryAfterToMills(retryAfter) {
|
|
|
34778
34846
|
var DEFAULT_USER_AGENT = `OTel-OTLP-Exporter-JavaScript/${VERSION4}`;
|
|
34779
34847
|
var MAX_RESPONSE_BODY_SIZE = 4 * 1024 * 1024;
|
|
34780
34848
|
function sendWithHttp(request, url2, headers, compression, userAgent, agent, data, timeoutMillis) {
|
|
34781
|
-
return new Promise((
|
|
34849
|
+
return new Promise((resolve14) => {
|
|
34782
34850
|
const parsedUrl = new URL(url2);
|
|
34783
34851
|
if (userAgent) {
|
|
34784
34852
|
headers["User-Agent"] = `${userAgent} ${DEFAULT_USER_AGENT}`;
|
|
@@ -34797,7 +34865,7 @@ function sendWithHttp(request, url2, headers, compression, userAgent, agent, dat
|
|
|
34797
34865
|
responseSize += chunk.length;
|
|
34798
34866
|
if (responseSize > MAX_RESPONSE_BODY_SIZE) {
|
|
34799
34867
|
const sizeError = new Error(`OTLP export response body exceeded size limit of ${MAX_RESPONSE_BODY_SIZE} bytes`);
|
|
34800
|
-
|
|
34868
|
+
resolve14({ status: "failure", error: sizeError });
|
|
34801
34869
|
res.destroy();
|
|
34802
34870
|
return;
|
|
34803
34871
|
}
|
|
@@ -34805,18 +34873,18 @@ function sendWithHttp(request, url2, headers, compression, userAgent, agent, dat
|
|
|
34805
34873
|
});
|
|
34806
34874
|
res.on("end", () => {
|
|
34807
34875
|
if (res.statusCode && res.statusCode <= 299) {
|
|
34808
|
-
|
|
34876
|
+
resolve14({
|
|
34809
34877
|
status: "success",
|
|
34810
34878
|
data: Buffer.concat(responseData)
|
|
34811
34879
|
});
|
|
34812
34880
|
} else if (res.statusCode && isExportHTTPErrorRetryable(res.statusCode)) {
|
|
34813
|
-
|
|
34881
|
+
resolve14({
|
|
34814
34882
|
status: "retryable",
|
|
34815
34883
|
retryInMillis: parseRetryAfterToMills(res.headers["retry-after"])
|
|
34816
34884
|
});
|
|
34817
34885
|
} else {
|
|
34818
34886
|
const error63 = new OTLPExporterError(res.statusMessage, res.statusCode, Buffer.concat(responseData).toString());
|
|
34819
|
-
|
|
34887
|
+
resolve14({
|
|
34820
34888
|
status: "failure",
|
|
34821
34889
|
error: error63
|
|
34822
34890
|
});
|
|
@@ -34824,17 +34892,17 @@ function sendWithHttp(request, url2, headers, compression, userAgent, agent, dat
|
|
|
34824
34892
|
});
|
|
34825
34893
|
res.on("error", (error63) => {
|
|
34826
34894
|
if (res.statusCode && res.statusCode <= 299) {
|
|
34827
|
-
|
|
34895
|
+
resolve14({
|
|
34828
34896
|
status: "success"
|
|
34829
34897
|
});
|
|
34830
34898
|
} else if (res.statusCode && isExportHTTPErrorRetryable(res.statusCode)) {
|
|
34831
|
-
|
|
34899
|
+
resolve14({
|
|
34832
34900
|
status: "retryable",
|
|
34833
34901
|
error: error63,
|
|
34834
34902
|
retryInMillis: parseRetryAfterToMills(res.headers["retry-after"])
|
|
34835
34903
|
});
|
|
34836
34904
|
} else {
|
|
34837
|
-
|
|
34905
|
+
resolve14({
|
|
34838
34906
|
status: "failure",
|
|
34839
34907
|
error: error63
|
|
34840
34908
|
});
|
|
@@ -34843,26 +34911,26 @@ function sendWithHttp(request, url2, headers, compression, userAgent, agent, dat
|
|
|
34843
34911
|
});
|
|
34844
34912
|
req.setTimeout(timeoutMillis, () => {
|
|
34845
34913
|
req.destroy();
|
|
34846
|
-
|
|
34914
|
+
resolve14({
|
|
34847
34915
|
status: "retryable",
|
|
34848
34916
|
error: new Error("Request timed out")
|
|
34849
34917
|
});
|
|
34850
34918
|
});
|
|
34851
34919
|
req.on("error", (error63) => {
|
|
34852
34920
|
if (isHttpTransportNetworkErrorRetryable(error63)) {
|
|
34853
|
-
|
|
34921
|
+
resolve14({
|
|
34854
34922
|
status: "retryable",
|
|
34855
34923
|
error: error63
|
|
34856
34924
|
});
|
|
34857
34925
|
} else {
|
|
34858
|
-
|
|
34926
|
+
resolve14({
|
|
34859
34927
|
status: "failure",
|
|
34860
34928
|
error: error63
|
|
34861
34929
|
});
|
|
34862
34930
|
}
|
|
34863
34931
|
});
|
|
34864
34932
|
compressAndSend(req, compression, data, (error63) => {
|
|
34865
|
-
|
|
34933
|
+
resolve14({
|
|
34866
34934
|
status: "failure",
|
|
34867
34935
|
error: error63
|
|
34868
34936
|
});
|
|
@@ -34952,9 +35020,9 @@ var RetryingTransport = class {
|
|
|
34952
35020
|
this._transport = transport;
|
|
34953
35021
|
}
|
|
34954
35022
|
retry(data, timeoutMillis, inMillis) {
|
|
34955
|
-
return new Promise((
|
|
35023
|
+
return new Promise((resolve14, reject) => {
|
|
34956
35024
|
setTimeout(() => {
|
|
34957
|
-
this._transport.send(data, timeoutMillis).then(
|
|
35025
|
+
this._transport.send(data, timeoutMillis).then(resolve14, reject);
|
|
34958
35026
|
}, inMillis);
|
|
34959
35027
|
});
|
|
34960
35028
|
}
|
|
@@ -36188,7 +36256,7 @@ function isCi(env = process.env) {
|
|
|
36188
36256
|
var SESSION_ID2 = randomUUID5();
|
|
36189
36257
|
function readCliVersion() {
|
|
36190
36258
|
if (true) {
|
|
36191
|
-
return "0.34.1-next.
|
|
36259
|
+
return "0.34.1-next.32";
|
|
36192
36260
|
}
|
|
36193
36261
|
return "0.0.0";
|
|
36194
36262
|
}
|
|
@@ -36498,12 +36566,12 @@ function resolveHostFingerprint() {
|
|
|
36498
36566
|
}
|
|
36499
36567
|
}
|
|
36500
36568
|
function resolveHostFingerprintAsync() {
|
|
36501
|
-
return new Promise((
|
|
36569
|
+
return new Promise((resolve14) => {
|
|
36502
36570
|
let binary;
|
|
36503
36571
|
try {
|
|
36504
36572
|
binary = simulatorServerBinaryPath();
|
|
36505
36573
|
} catch {
|
|
36506
|
-
|
|
36574
|
+
resolve14(null);
|
|
36507
36575
|
return;
|
|
36508
36576
|
}
|
|
36509
36577
|
let settled = false;
|
|
@@ -36516,7 +36584,7 @@ function resolveHostFingerprintAsync() {
|
|
|
36516
36584
|
child?.kill("SIGKILL");
|
|
36517
36585
|
} catch {
|
|
36518
36586
|
}
|
|
36519
|
-
|
|
36587
|
+
resolve14(value);
|
|
36520
36588
|
};
|
|
36521
36589
|
const watchdog = setTimeout(() => finish(null), FINGERPRINT_TIMEOUT_MS);
|
|
36522
36590
|
watchdog.unref?.();
|
|
@@ -36732,7 +36800,7 @@ var DRAIN_GRACE_MS = 250;
|
|
|
36732
36800
|
async function raceDrain(client2, timeoutMs) {
|
|
36733
36801
|
await Promise.race([
|
|
36734
36802
|
client2.shutdown(timeoutMs),
|
|
36735
|
-
new Promise((
|
|
36803
|
+
new Promise((resolve14) => setTimeout(resolve14, timeoutMs + DRAIN_GRACE_MS).unref())
|
|
36736
36804
|
]);
|
|
36737
36805
|
}
|
|
36738
36806
|
async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
|
|
@@ -36818,6 +36886,9 @@ function booleanLiteral(raw) {
|
|
|
36818
36886
|
return void 0;
|
|
36819
36887
|
}
|
|
36820
36888
|
function coerceScalar(raw, type, field) {
|
|
36889
|
+
if (Array.isArray(type) && type.length === 2 && type.includes("null")) {
|
|
36890
|
+
type = type.find((member) => member === "integer" || member === "number");
|
|
36891
|
+
}
|
|
36821
36892
|
if (type === "number") {
|
|
36822
36893
|
if (raw.trim() === "")
|
|
36823
36894
|
throw new FlagParseException(`--${field} expected a number, got "${raw}"`);
|
|
@@ -37026,7 +37097,7 @@ function renderType(prop) {
|
|
|
37026
37097
|
const suffix = isScalarType(prop.items?.type) ? " (repeatable)" : "";
|
|
37027
37098
|
return `array<${item}>${suffix}`;
|
|
37028
37099
|
}
|
|
37029
|
-
return prop.type ?? "any";
|
|
37100
|
+
return Array.isArray(prop.type) ? prop.type.join(" | ") : prop.type ?? "any";
|
|
37030
37101
|
}
|
|
37031
37102
|
|
|
37032
37103
|
// ../argent-cli/src/run-validation.ts
|
|
@@ -37236,7 +37307,8 @@ async function offersMacosPlatform() {
|
|
|
37236
37307
|
}
|
|
37237
37308
|
async function printHelp(toStderr = false) {
|
|
37238
37309
|
const print = toStderr ? console.error : console.log;
|
|
37239
|
-
const
|
|
37310
|
+
const offersMacos = await offersMacosPlatform();
|
|
37311
|
+
const platforms = SELECTABLE_PLATFORMS.filter((p) => p !== "macos" || offersMacos);
|
|
37240
37312
|
print(`Usage: argent e2e <subcommand> [options]
|
|
37241
37313
|
|
|
37242
37314
|
Run a YAML e2e test without an LLM in the loop. \`run\` takes any of these forms:
|
|
@@ -37313,7 +37385,7 @@ Subcommands:
|
|
|
37313
37385
|
|
|
37314
37386
|
Options (run):
|
|
37315
37387
|
--device <id> Device id to run against (auto-detected when omitted)
|
|
37316
|
-
--platform <p>
|
|
37388
|
+
--platform <p> ${platforms.join(" | ")} \u2014 narrow
|
|
37317
37389
|
auto-detection (ios never picks a remote simulator)
|
|
37318
37390
|
--update-baselines Write/refresh screenshot baselines instead of diffing,
|
|
37319
37391
|
also those of tests that tool: e2e-execute steps run,
|
|
@@ -37348,7 +37420,9 @@ var RUN_OPTIONS = {
|
|
|
37348
37420
|
"json-stream": { kind: "boolean" },
|
|
37349
37421
|
"recursive": { kind: "boolean", alias: "r" },
|
|
37350
37422
|
"device": { kind: "value" },
|
|
37351
|
-
|
|
37423
|
+
// The tool-server's schema rejection carries no error_kind, so in a directory
|
|
37424
|
+
// run it would stop the whole batch.
|
|
37425
|
+
"platform": { kind: "value", choices: SELECTABLE_PLATFORMS },
|
|
37352
37426
|
"output": { kind: "value" }
|
|
37353
37427
|
};
|
|
37354
37428
|
var LIST_OPTIONS = {
|
|
@@ -37375,7 +37449,7 @@ function parseRunArgs(argv) {
|
|
|
37375
37449
|
json: options.json === true,
|
|
37376
37450
|
jsonStream: options["json-stream"] === true
|
|
37377
37451
|
};
|
|
37378
|
-
for (const name of ["device", "
|
|
37452
|
+
for (const name of ["device", "output"]) {
|
|
37379
37453
|
if (options[name] === "") throw new FlagParseException(`--${name} requires a value`);
|
|
37380
37454
|
}
|
|
37381
37455
|
if (positionals[0] !== void 0) out.flowRef = positionals[0];
|
|
@@ -37474,15 +37548,19 @@ function renderBatchSummary(counts, durationMs) {
|
|
|
37474
37548
|
return `${verdict} \u2014 ${counts.total} e2e test${counts.total === 1 ? "" : "s"}: ${counts.passed} passed, ${counts.failed} failed, ${counts.skipped} skipped${durationSuffix(durationMs)}`;
|
|
37475
37549
|
}
|
|
37476
37550
|
function summarizeFailure(report) {
|
|
37551
|
+
const unwritten = unwrittenBaselines(report);
|
|
37477
37552
|
let n3 = 0;
|
|
37478
37553
|
for (const s of report.steps) {
|
|
37479
37554
|
if (s.kind === "echo") continue;
|
|
37480
37555
|
n3++;
|
|
37481
37556
|
if (s.status === "fail" || s.status === "error") {
|
|
37482
|
-
const
|
|
37557
|
+
const lines = s.reason ? [String(s.reason)] : [];
|
|
37558
|
+
for (const line of unwritten) lines.push(`baseline not written: ${line}`);
|
|
37559
|
+
const detail = lines.length ? lines.join("\n") : void 0;
|
|
37483
37560
|
return { headline: `step ${n3} ${stepLabel(s, e2eTestOf(report))}`, detail };
|
|
37484
37561
|
}
|
|
37485
37562
|
}
|
|
37563
|
+
if (unwritten.length) return { headline: "baselines not written", detail: unwritten.join("\n") };
|
|
37486
37564
|
return { headline: "failed with no failing step" };
|
|
37487
37565
|
}
|
|
37488
37566
|
function renderFailedFlow(f) {
|
|
@@ -37541,7 +37619,7 @@ async function readMarkerFile(marker) {
|
|
|
37541
37619
|
}
|
|
37542
37620
|
if (owner) return owner;
|
|
37543
37621
|
if (attempt === MARKER_READ_RETRIES) return null;
|
|
37544
|
-
await new Promise((
|
|
37622
|
+
await new Promise((resolve14) => setTimeout(resolve14, MARKER_READ_DELAY_MS));
|
|
37545
37623
|
}
|
|
37546
37624
|
}
|
|
37547
37625
|
async function classifyExportDir(dir, flowPath) {
|
|
@@ -37669,7 +37747,7 @@ function resolveArtifactDisplayPaths(report) {
|
|
|
37669
37747
|
}
|
|
37670
37748
|
function exitAfterFlush(code, streams = [process.stdout, process.stderr]) {
|
|
37671
37749
|
return Promise.all(
|
|
37672
|
-
streams.map((s) => new Promise((
|
|
37750
|
+
streams.map((s) => new Promise((resolve14) => s.write("", () => resolve14())))
|
|
37673
37751
|
).then(() => process.exit(code));
|
|
37674
37752
|
}
|
|
37675
37753
|
function renderReport(report) {
|
|
@@ -37986,17 +38064,8 @@ async function runFlowDirectory(dir, args, projectRoot, options) {
|
|
|
37986
38064
|
flowPath,
|
|
37987
38065
|
baseUrl
|
|
37988
38066
|
);
|
|
37989
|
-
|
|
37990
|
-
results.push({ path: rel, status: report.ok && !unwritten.length ? "pass" : "fail", report });
|
|
38067
|
+
results.push({ path: rel, status: report.ok ? "pass" : "fail", report });
|
|
37991
38068
|
if (!report.ok) failures.push({ path: rel, ...summarizeFailure(report), rerun });
|
|
37992
|
-
else if (unwritten.length) {
|
|
37993
|
-
failures.push({
|
|
37994
|
-
path: rel,
|
|
37995
|
-
headline: "baselines not written",
|
|
37996
|
-
detail: unwritten.join("\n"),
|
|
37997
|
-
rerun
|
|
37998
|
-
});
|
|
37999
|
-
}
|
|
38000
38069
|
if (!args.json) {
|
|
38001
38070
|
for (const line of renderFailedSteps(report)) console.log(line);
|
|
38002
38071
|
console.log(` ${renderSummary(report, { withDevice: true })}`);
|
|
@@ -38370,12 +38439,7 @@ ${renderSummary(report, { withDevice: true })}`);
|
|
|
38370
38439
|
} else {
|
|
38371
38440
|
console.log(renderReport(report));
|
|
38372
38441
|
}
|
|
38373
|
-
|
|
38374
|
-
if (!args.json && !args.jsonStream) {
|
|
38375
|
-
for (const line of unwritten)
|
|
38376
|
-
console.log(` ${STATUS_GLYPH.error} baseline not written: ${line}`);
|
|
38377
|
-
}
|
|
38378
|
-
return exitAfterFlush(report.ok && unwritten.length === 0 ? 0 : 1);
|
|
38442
|
+
return exitAfterFlush(report.ok ? 0 : 1);
|
|
38379
38443
|
}
|
|
38380
38444
|
|
|
38381
38445
|
// ../argent-cli/src/run.ts
|
|
@@ -38405,13 +38469,13 @@ function splitOptions(argv) {
|
|
|
38405
38469
|
return { json: json2, outPath, argvForFlags: rest };
|
|
38406
38470
|
}
|
|
38407
38471
|
async function readStdin() {
|
|
38408
|
-
return new Promise((
|
|
38472
|
+
return new Promise((resolve14, reject) => {
|
|
38409
38473
|
let data = "";
|
|
38410
38474
|
process.stdin.setEncoding("utf8");
|
|
38411
38475
|
process.stdin.on("data", (chunk) => {
|
|
38412
38476
|
data += chunk;
|
|
38413
38477
|
});
|
|
38414
|
-
process.stdin.on("end", () =>
|
|
38478
|
+
process.stdin.on("end", () => resolve14(data));
|
|
38415
38479
|
process.stdin.on("error", reject);
|
|
38416
38480
|
});
|
|
38417
38481
|
}
|
|
@@ -38673,7 +38737,7 @@ settled=false or debugger-status's not_connected.
|
|
|
38673
38737
|
console.log(`Wrote: ${outPath}`);
|
|
38674
38738
|
}
|
|
38675
38739
|
if (failure2) {
|
|
38676
|
-
await new Promise((
|
|
38740
|
+
await new Promise((resolve14) => process.stdout.write("", () => resolve14()));
|
|
38677
38741
|
console.error(failure2);
|
|
38678
38742
|
await trackRunFailure(toolName, startedAt, {
|
|
38679
38743
|
error_code: FAILURE_CODES.CLI_RUN_TOOL_RESULT_FAILED,
|
|
@@ -38898,9 +38962,9 @@ var START_OPTIONS = {
|
|
|
38898
38962
|
"host": { kind: "value" },
|
|
38899
38963
|
"idle-timeout": { kind: "value" }
|
|
38900
38964
|
};
|
|
38901
|
-
function parseOrStartFlagError(
|
|
38965
|
+
function parseOrStartFlagError(parse4) {
|
|
38902
38966
|
try {
|
|
38903
|
-
return
|
|
38967
|
+
return parse4();
|
|
38904
38968
|
} catch (err) {
|
|
38905
38969
|
if (err instanceof UsageError) throw new StartFlagError(err.message);
|
|
38906
38970
|
throw err;
|
|
@@ -39525,7 +39589,7 @@ function ptyInjectBeats(text2) {
|
|
|
39525
39589
|
];
|
|
39526
39590
|
}
|
|
39527
39591
|
function sleep(ms) {
|
|
39528
|
-
return new Promise((
|
|
39592
|
+
return new Promise((resolve14) => setTimeout(resolve14, ms));
|
|
39529
39593
|
}
|
|
39530
39594
|
var DEFAULT_COLS = 80;
|
|
39531
39595
|
var DEFAULT_ROWS = 24;
|
|
@@ -39635,10 +39699,10 @@ function parseSseBuffer(buffer) {
|
|
|
39635
39699
|
const events = [];
|
|
39636
39700
|
let rest = normalised;
|
|
39637
39701
|
for (; ; ) {
|
|
39638
|
-
const
|
|
39639
|
-
if (
|
|
39640
|
-
const rawFrame = rest.slice(0,
|
|
39641
|
-
rest = rest.slice(
|
|
39702
|
+
const sep7 = rest.indexOf("\n\n");
|
|
39703
|
+
if (sep7 === -1) break;
|
|
39704
|
+
const rawFrame = rest.slice(0, sep7);
|
|
39705
|
+
rest = rest.slice(sep7 + 2);
|
|
39642
39706
|
let event = "message";
|
|
39643
39707
|
const dataLines = [];
|
|
39644
39708
|
for (const line of rawFrame.split("\n")) {
|
|
@@ -39746,7 +39810,7 @@ var SPAWN_GRACE_MS = 8e3;
|
|
|
39746
39810
|
var DEATH_CONFIRMATIONS = 3;
|
|
39747
39811
|
var SSE_RECONNECT_MS = 1e3;
|
|
39748
39812
|
function sleep2(ms) {
|
|
39749
|
-
return new Promise((
|
|
39813
|
+
return new Promise((resolve14) => setTimeout(resolve14, ms));
|
|
39750
39814
|
}
|
|
39751
39815
|
var TRUST_PROMPT_RE = /trust this folder|do you trust|yes,? i trust|trust the files in this/i;
|
|
39752
39816
|
async function dismissTrustPrompt(session) {
|