@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/client.js
CHANGED
|
@@ -4390,10 +4390,10 @@ var require_resolve_block_map = __commonJS({
|
|
|
4390
4390
|
let offset = bm.offset;
|
|
4391
4391
|
let commentEnd = null;
|
|
4392
4392
|
for (const collItem of bm.items) {
|
|
4393
|
-
const { start, key, sep:
|
|
4393
|
+
const { start, key, sep: sep7, value } = collItem;
|
|
4394
4394
|
const keyProps = resolveProps.resolveProps(start, {
|
|
4395
4395
|
indicator: "explicit-key-ind",
|
|
4396
|
-
next: key ??
|
|
4396
|
+
next: key ?? sep7?.[0],
|
|
4397
4397
|
offset,
|
|
4398
4398
|
onError,
|
|
4399
4399
|
parentIndent: bm.indent,
|
|
@@ -4407,7 +4407,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
4407
4407
|
else if ("indent" in key && key.indent !== bm.indent)
|
|
4408
4408
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
4409
4409
|
}
|
|
4410
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
4410
|
+
if (!keyProps.anchor && !keyProps.tag && !sep7) {
|
|
4411
4411
|
commentEnd = keyProps.end;
|
|
4412
4412
|
if (keyProps.comment) {
|
|
4413
4413
|
if (map.comment)
|
|
@@ -4431,7 +4431,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
4431
4431
|
ctx.atKey = false;
|
|
4432
4432
|
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
|
4433
4433
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
4434
|
-
const valueProps = resolveProps.resolveProps(
|
|
4434
|
+
const valueProps = resolveProps.resolveProps(sep7 ?? [], {
|
|
4435
4435
|
indicator: "map-value-ind",
|
|
4436
4436
|
next: value,
|
|
4437
4437
|
offset: keyNode.range[2],
|
|
@@ -4447,7 +4447,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
4447
4447
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
4448
4448
|
onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
4449
4449
|
}
|
|
4450
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset,
|
|
4450
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep7, null, valueProps, onError);
|
|
4451
4451
|
if (ctx.schema.compat)
|
|
4452
4452
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
4453
4453
|
offset = valueNode.range[2];
|
|
@@ -4538,7 +4538,7 @@ var require_resolve_end = __commonJS({
|
|
|
4538
4538
|
let comment = "";
|
|
4539
4539
|
if (end) {
|
|
4540
4540
|
let hasSpace = false;
|
|
4541
|
-
let
|
|
4541
|
+
let sep7 = "";
|
|
4542
4542
|
for (const token of end) {
|
|
4543
4543
|
const { source, type } = token;
|
|
4544
4544
|
switch (type) {
|
|
@@ -4552,13 +4552,13 @@ var require_resolve_end = __commonJS({
|
|
|
4552
4552
|
if (!comment)
|
|
4553
4553
|
comment = cb;
|
|
4554
4554
|
else
|
|
4555
|
-
comment +=
|
|
4556
|
-
|
|
4555
|
+
comment += sep7 + cb;
|
|
4556
|
+
sep7 = "";
|
|
4557
4557
|
break;
|
|
4558
4558
|
}
|
|
4559
4559
|
case "newline":
|
|
4560
4560
|
if (comment)
|
|
4561
|
-
|
|
4561
|
+
sep7 += source;
|
|
4562
4562
|
hasSpace = true;
|
|
4563
4563
|
break;
|
|
4564
4564
|
default:
|
|
@@ -4601,18 +4601,18 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4601
4601
|
let offset = fc.offset + fc.start.source.length;
|
|
4602
4602
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
4603
4603
|
const collItem = fc.items[i];
|
|
4604
|
-
const { start, key, sep:
|
|
4604
|
+
const { start, key, sep: sep7, value } = collItem;
|
|
4605
4605
|
const props = resolveProps.resolveProps(start, {
|
|
4606
4606
|
flow: fcName,
|
|
4607
4607
|
indicator: "explicit-key-ind",
|
|
4608
|
-
next: key ??
|
|
4608
|
+
next: key ?? sep7?.[0],
|
|
4609
4609
|
offset,
|
|
4610
4610
|
onError,
|
|
4611
4611
|
parentIndent: fc.indent,
|
|
4612
4612
|
startOnNewline: false
|
|
4613
4613
|
});
|
|
4614
4614
|
if (!props.found) {
|
|
4615
|
-
if (!props.anchor && !props.tag && !
|
|
4615
|
+
if (!props.anchor && !props.tag && !sep7 && !value) {
|
|
4616
4616
|
if (i === 0 && props.comma)
|
|
4617
4617
|
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
4618
4618
|
else if (i < fc.items.length - 1)
|
|
@@ -4666,8 +4666,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4666
4666
|
}
|
|
4667
4667
|
}
|
|
4668
4668
|
}
|
|
4669
|
-
if (!isMap && !
|
|
4670
|
-
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end,
|
|
4669
|
+
if (!isMap && !sep7 && !props.found) {
|
|
4670
|
+
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep7, null, props, onError);
|
|
4671
4671
|
coll.items.push(valueNode);
|
|
4672
4672
|
offset = valueNode.range[2];
|
|
4673
4673
|
if (isBlock(value))
|
|
@@ -4679,7 +4679,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4679
4679
|
if (isBlock(key))
|
|
4680
4680
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
4681
4681
|
ctx.atKey = false;
|
|
4682
|
-
const valueProps = resolveProps.resolveProps(
|
|
4682
|
+
const valueProps = resolveProps.resolveProps(sep7 ?? [], {
|
|
4683
4683
|
flow: fcName,
|
|
4684
4684
|
indicator: "map-value-ind",
|
|
4685
4685
|
next: value,
|
|
@@ -4690,8 +4690,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4690
4690
|
});
|
|
4691
4691
|
if (valueProps.found) {
|
|
4692
4692
|
if (!isMap && !props.found && ctx.options.strict) {
|
|
4693
|
-
if (
|
|
4694
|
-
for (const st of
|
|
4693
|
+
if (sep7)
|
|
4694
|
+
for (const st of sep7) {
|
|
4695
4695
|
if (st === valueProps.found)
|
|
4696
4696
|
break;
|
|
4697
4697
|
if (st.type === "newline") {
|
|
@@ -4708,7 +4708,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4708
4708
|
else
|
|
4709
4709
|
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
4710
4710
|
}
|
|
4711
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
4711
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep7, null, valueProps, onError) : null;
|
|
4712
4712
|
if (valueNode) {
|
|
4713
4713
|
if (isBlock(value))
|
|
4714
4714
|
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -4888,7 +4888,7 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
4888
4888
|
chompStart = i + 1;
|
|
4889
4889
|
}
|
|
4890
4890
|
let value = "";
|
|
4891
|
-
let
|
|
4891
|
+
let sep7 = "";
|
|
4892
4892
|
let prevMoreIndented = false;
|
|
4893
4893
|
for (let i = 0; i < contentStart; ++i)
|
|
4894
4894
|
value += lines[i][0].slice(trimIndent) + "\n";
|
|
@@ -4905,24 +4905,24 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
4905
4905
|
indent = "";
|
|
4906
4906
|
}
|
|
4907
4907
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
4908
|
-
value +=
|
|
4909
|
-
|
|
4908
|
+
value += sep7 + indent.slice(trimIndent) + content;
|
|
4909
|
+
sep7 = "\n";
|
|
4910
4910
|
} else if (indent.length > trimIndent || content[0] === " ") {
|
|
4911
|
-
if (
|
|
4912
|
-
|
|
4913
|
-
else if (!prevMoreIndented &&
|
|
4914
|
-
|
|
4915
|
-
value +=
|
|
4916
|
-
|
|
4911
|
+
if (sep7 === " ")
|
|
4912
|
+
sep7 = "\n";
|
|
4913
|
+
else if (!prevMoreIndented && sep7 === "\n")
|
|
4914
|
+
sep7 = "\n\n";
|
|
4915
|
+
value += sep7 + indent.slice(trimIndent) + content;
|
|
4916
|
+
sep7 = "\n";
|
|
4917
4917
|
prevMoreIndented = true;
|
|
4918
4918
|
} else if (content === "") {
|
|
4919
|
-
if (
|
|
4919
|
+
if (sep7 === "\n")
|
|
4920
4920
|
value += "\n";
|
|
4921
4921
|
else
|
|
4922
|
-
|
|
4922
|
+
sep7 = "\n";
|
|
4923
4923
|
} else {
|
|
4924
|
-
value +=
|
|
4925
|
-
|
|
4924
|
+
value += sep7 + content;
|
|
4925
|
+
sep7 = " ";
|
|
4926
4926
|
prevMoreIndented = false;
|
|
4927
4927
|
}
|
|
4928
4928
|
}
|
|
@@ -5105,25 +5105,25 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
5105
5105
|
trimBoth = /^[ \t]+|[ \t]+$/g;
|
|
5106
5106
|
}
|
|
5107
5107
|
let res = match[1].replace(trimEnd, "");
|
|
5108
|
-
let
|
|
5108
|
+
let sep7 = " ";
|
|
5109
5109
|
let pos = line.lastIndex;
|
|
5110
5110
|
while (match = line.exec(source)) {
|
|
5111
5111
|
const lm = match[1].replace(trimBoth, "");
|
|
5112
5112
|
if (lm === "") {
|
|
5113
|
-
if (
|
|
5114
|
-
res +=
|
|
5113
|
+
if (sep7 === "\n")
|
|
5114
|
+
res += sep7;
|
|
5115
5115
|
else
|
|
5116
|
-
|
|
5116
|
+
sep7 = "\n";
|
|
5117
5117
|
} else {
|
|
5118
|
-
res +=
|
|
5119
|
-
|
|
5118
|
+
res += sep7 + lm;
|
|
5119
|
+
sep7 = " ";
|
|
5120
5120
|
}
|
|
5121
5121
|
pos = line.lastIndex;
|
|
5122
5122
|
}
|
|
5123
5123
|
const last = /[ \t]*(.*)/sy;
|
|
5124
5124
|
last.lastIndex = pos;
|
|
5125
5125
|
match = last.exec(source);
|
|
5126
|
-
return res +
|
|
5126
|
+
return res + sep7 + (match?.[1] ?? "");
|
|
5127
5127
|
}
|
|
5128
5128
|
function doubleQuotedValue(source, onError) {
|
|
5129
5129
|
let res = "";
|
|
@@ -5933,14 +5933,14 @@ var require_cst_stringify = __commonJS({
|
|
|
5933
5933
|
}
|
|
5934
5934
|
}
|
|
5935
5935
|
}
|
|
5936
|
-
function stringifyItem({ start, key, sep:
|
|
5936
|
+
function stringifyItem({ start, key, sep: sep7, value }) {
|
|
5937
5937
|
let res = "";
|
|
5938
5938
|
for (const st of start)
|
|
5939
5939
|
res += st.source;
|
|
5940
5940
|
if (key)
|
|
5941
5941
|
res += stringifyToken(key);
|
|
5942
|
-
if (
|
|
5943
|
-
for (const st of
|
|
5942
|
+
if (sep7)
|
|
5943
|
+
for (const st of sep7)
|
|
5944
5944
|
res += st.source;
|
|
5945
5945
|
if (value)
|
|
5946
5946
|
res += stringifyToken(value);
|
|
@@ -7107,18 +7107,18 @@ var require_parser = __commonJS({
|
|
|
7107
7107
|
if (this.type === "map-value-ind") {
|
|
7108
7108
|
const prev = getPrevProps(this.peek(2));
|
|
7109
7109
|
const start = getFirstKeyStartProps(prev);
|
|
7110
|
-
let
|
|
7110
|
+
let sep7;
|
|
7111
7111
|
if (scalar.end) {
|
|
7112
|
-
|
|
7113
|
-
|
|
7112
|
+
sep7 = scalar.end;
|
|
7113
|
+
sep7.push(this.sourceToken);
|
|
7114
7114
|
delete scalar.end;
|
|
7115
7115
|
} else
|
|
7116
|
-
|
|
7116
|
+
sep7 = [this.sourceToken];
|
|
7117
7117
|
const map = {
|
|
7118
7118
|
type: "block-map",
|
|
7119
7119
|
offset: scalar.offset,
|
|
7120
7120
|
indent: scalar.indent,
|
|
7121
|
-
items: [{ start, key: scalar, sep:
|
|
7121
|
+
items: [{ start, key: scalar, sep: sep7 }]
|
|
7122
7122
|
};
|
|
7123
7123
|
this.onKeyLine = true;
|
|
7124
7124
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -7271,15 +7271,15 @@ var require_parser = __commonJS({
|
|
|
7271
7271
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
7272
7272
|
const start2 = getFirstKeyStartProps(it.start);
|
|
7273
7273
|
const key = it.key;
|
|
7274
|
-
const
|
|
7275
|
-
|
|
7274
|
+
const sep7 = it.sep;
|
|
7275
|
+
sep7.push(this.sourceToken);
|
|
7276
7276
|
delete it.key;
|
|
7277
7277
|
delete it.sep;
|
|
7278
7278
|
this.stack.push({
|
|
7279
7279
|
type: "block-map",
|
|
7280
7280
|
offset: this.offset,
|
|
7281
7281
|
indent: this.indent,
|
|
7282
|
-
items: [{ start: start2, key, sep:
|
|
7282
|
+
items: [{ start: start2, key, sep: sep7 }]
|
|
7283
7283
|
});
|
|
7284
7284
|
} else if (start.length > 0) {
|
|
7285
7285
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -7473,13 +7473,13 @@ var require_parser = __commonJS({
|
|
|
7473
7473
|
const prev = getPrevProps(parent);
|
|
7474
7474
|
const start = getFirstKeyStartProps(prev);
|
|
7475
7475
|
fixFlowSeqItems(fc);
|
|
7476
|
-
const
|
|
7477
|
-
|
|
7476
|
+
const sep7 = fc.end.splice(1, fc.end.length);
|
|
7477
|
+
sep7.push(this.sourceToken);
|
|
7478
7478
|
const map = {
|
|
7479
7479
|
type: "block-map",
|
|
7480
7480
|
offset: fc.offset,
|
|
7481
7481
|
indent: fc.indent,
|
|
7482
|
-
items: [{ start, key: fc, sep:
|
|
7482
|
+
items: [{ start, key: fc, sep: sep7 }]
|
|
7483
7483
|
};
|
|
7484
7484
|
this.onKeyLine = true;
|
|
7485
7485
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -7657,7 +7657,7 @@ var require_public_api = __commonJS({
|
|
|
7657
7657
|
}
|
|
7658
7658
|
return doc;
|
|
7659
7659
|
}
|
|
7660
|
-
function
|
|
7660
|
+
function parse2(src, reviver, options) {
|
|
7661
7661
|
let _reviver = void 0;
|
|
7662
7662
|
if (typeof reviver === "function") {
|
|
7663
7663
|
_reviver = reviver;
|
|
@@ -7698,7 +7698,7 @@ var require_public_api = __commonJS({
|
|
|
7698
7698
|
return value.toString(options);
|
|
7699
7699
|
return new Document.Document(value, _replacer, options).toString(options);
|
|
7700
7700
|
}
|
|
7701
|
-
exports.parse =
|
|
7701
|
+
exports.parse = parse2;
|
|
7702
7702
|
exports.parseAllDocuments = parseAllDocuments;
|
|
7703
7703
|
exports.parseDocument = parseDocument;
|
|
7704
7704
|
exports.stringify = stringify;
|
|
@@ -8311,7 +8311,7 @@ function generateToken() {
|
|
|
8311
8311
|
return randomBytes(AUTH_TOKEN_BYTES).toString("hex");
|
|
8312
8312
|
}
|
|
8313
8313
|
function findFreePort() {
|
|
8314
|
-
return new Promise((
|
|
8314
|
+
return new Promise((resolve11, reject) => {
|
|
8315
8315
|
const srv = net.createServer();
|
|
8316
8316
|
srv.listen(0, "127.0.0.1", () => {
|
|
8317
8317
|
const addr = srv.address();
|
|
@@ -8322,21 +8322,21 @@ function findFreePort() {
|
|
|
8322
8322
|
const port = addr.port;
|
|
8323
8323
|
srv.close((err) => {
|
|
8324
8324
|
if (err) reject(err);
|
|
8325
|
-
else
|
|
8325
|
+
else resolve11(port);
|
|
8326
8326
|
});
|
|
8327
8327
|
});
|
|
8328
8328
|
srv.on("error", reject);
|
|
8329
8329
|
});
|
|
8330
8330
|
}
|
|
8331
8331
|
function isVersionNewer(a, b) {
|
|
8332
|
-
const
|
|
8332
|
+
const parse2 = (v) => {
|
|
8333
8333
|
const [core = "", ...preParts] = v.split("+")[0].split("-");
|
|
8334
8334
|
const nums = core.split(".").map((n) => Number.parseInt(n, 10));
|
|
8335
8335
|
if (nums.length === 0 || nums.some((n) => Number.isNaN(n))) return null;
|
|
8336
8336
|
return { nums, pre: preParts.length > 0 ? preParts.join("-").split(".") : [] };
|
|
8337
8337
|
};
|
|
8338
|
-
const pa =
|
|
8339
|
-
const pb =
|
|
8338
|
+
const pa = parse2(a);
|
|
8339
|
+
const pb = parse2(b);
|
|
8340
8340
|
if (!pa || !pb) return false;
|
|
8341
8341
|
for (let i = 0; i < 3; i++) {
|
|
8342
8342
|
const x = pa.nums[i] ?? 0;
|
|
@@ -8424,7 +8424,7 @@ function resolveToolsServerNode() {
|
|
|
8424
8424
|
return !(bun || deno || electron) && fs5.existsSync(process.execPath) ? process.execPath : "node";
|
|
8425
8425
|
}
|
|
8426
8426
|
function spawnToolsServer(paths, port, options = {}) {
|
|
8427
|
-
return new Promise((
|
|
8427
|
+
return new Promise((resolve11, reject) => {
|
|
8428
8428
|
let logFd;
|
|
8429
8429
|
try {
|
|
8430
8430
|
fs5.mkdirSync(STATE_DIR, { recursive: true });
|
|
@@ -8470,7 +8470,7 @@ function spawnToolsServer(paths, port, options = {}) {
|
|
|
8470
8470
|
rl.close();
|
|
8471
8471
|
child.stdout?.resume();
|
|
8472
8472
|
child.stdout?.unref?.();
|
|
8473
|
-
settle(() =>
|
|
8473
|
+
settle(() => resolve11({ port: actualPort, pid }));
|
|
8474
8474
|
}
|
|
8475
8475
|
});
|
|
8476
8476
|
child.on("error", (err) => {
|
|
@@ -8836,10 +8836,18 @@ function toolStepFiles(specs, args) {
|
|
|
8836
8836
|
}
|
|
8837
8837
|
return files;
|
|
8838
8838
|
}
|
|
8839
|
+
var UNEXPANDED_PATH = /^~|\$[A-Za-z0-9_{(]|`|%[A-Za-z_][A-Za-z0-9_]*%|^[A-Za-z][A-Za-z0-9+.-]+:/;
|
|
8840
|
+
function isUnexpandedPath(p) {
|
|
8841
|
+
return UNEXPANDED_PATH.test(p);
|
|
8842
|
+
}
|
|
8839
8843
|
function isClientFileArgument({ spec, path: path14 }) {
|
|
8840
8844
|
return spec.kind === "file" && spec.path === `\${${spec.target}}` && path14.startsWith("/") && hasToolFileExtension(path14);
|
|
8841
8845
|
}
|
|
8842
8846
|
|
|
8847
|
+
// ../registry/src/flow-platforms.ts
|
|
8848
|
+
var LAUNCH_PLATFORMS = ["ios", "android", "chromium", "vega", "macos"];
|
|
8849
|
+
var SELECTABLE_PLATFORMS = [...LAUNCH_PLATFORMS, "ios-remote"];
|
|
8850
|
+
|
|
8843
8851
|
// ../registry/src/flow-file-refs.ts
|
|
8844
8852
|
import * as fs7 from "node:fs/promises";
|
|
8845
8853
|
import * as path8 from "node:path";
|
|
@@ -8970,6 +8978,9 @@ var MAX_BLOCK_NESTING = 64;
|
|
|
8970
8978
|
function isRecord(value) {
|
|
8971
8979
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
8972
8980
|
}
|
|
8981
|
+
function flowYamlSource(content) {
|
|
8982
|
+
return content.replace(/^\s+/, (lead) => lead.replace(/[^\n]/g, "")).trimEnd();
|
|
8983
|
+
}
|
|
8973
8984
|
function collectFlowRequests(doc) {
|
|
8974
8985
|
const runTargets = /* @__PURE__ */ new Set();
|
|
8975
8986
|
const snapshots = /* @__PURE__ */ new Set();
|
|
@@ -9244,6 +9255,8 @@ var FAILURE_CODES = {
|
|
|
9244
9255
|
DEBUGGER_TARGET_DEVICE_MISMATCH: "DEBUGGER_TARGET_DEVICE_MISMATCH",
|
|
9245
9256
|
DEBUGGER_EVALUATE_EXPRESSION_THREW: "DEBUGGER_EVALUATE_EXPRESSION_THREW",
|
|
9246
9257
|
DEBUGGER_RELOAD_FAILED: "DEBUGGER_RELOAD_FAILED",
|
|
9258
|
+
// e2e-add-step refused a debugger-* call that answered `not_connected`.
|
|
9259
|
+
DEBUGGER_NOT_CONNECTED: "DEBUGGER_NOT_CONNECTED",
|
|
9247
9260
|
JS_RUNTIME_CONSOLE_SERVER_BIND_FAILED: "JS_RUNTIME_CONSOLE_SERVER_BIND_FAILED",
|
|
9248
9261
|
JS_RUNTIME_PAYLOAD_INVALID: "JS_RUNTIME_PAYLOAD_INVALID",
|
|
9249
9262
|
JS_RUNTIME_PAYLOAD_DEVICE_MISSING: "JS_RUNTIME_PAYLOAD_DEVICE_MISSING",
|
|
@@ -9771,7 +9784,7 @@ async function runTar(archive, args, signal) {
|
|
|
9771
9784
|
child.on("error", (err) => {
|
|
9772
9785
|
childError = err;
|
|
9773
9786
|
});
|
|
9774
|
-
const closed = new Promise((
|
|
9787
|
+
const closed = new Promise((resolve11) => child.once("close", resolve11));
|
|
9775
9788
|
const stdout = collect(child.stdout, MAX_LISTING_BYTES, {
|
|
9776
9789
|
maxLines: MAX_LISTING_LINES,
|
|
9777
9790
|
onOverflow: () => child.kill()
|
|
@@ -9941,6 +9954,22 @@ function interpolatePath(template, args) {
|
|
|
9941
9954
|
});
|
|
9942
9955
|
return missing ? null : out;
|
|
9943
9956
|
}
|
|
9957
|
+
function callerPath(p) {
|
|
9958
|
+
const onCurrentDrive = path10.sep === "\\" && /^[\\/](?![\\/])/.test(p);
|
|
9959
|
+
if (!onCurrentDrive && (path10.isAbsolute(p) || path10.win32.isAbsolute(p) || isUnexpandedPath(p))) {
|
|
9960
|
+
return p;
|
|
9961
|
+
}
|
|
9962
|
+
const { root } = path10.parse(p);
|
|
9963
|
+
const rest = p.slice(root.length);
|
|
9964
|
+
if (!rest.split(/[\\/]/).includes("..")) {
|
|
9965
|
+
const resolved = path10.resolve(p);
|
|
9966
|
+
const last = p.split(path10.sep === "\\" ? /[\\/]/ : "/").at(-1);
|
|
9967
|
+
const dirOnly = p !== last && (last === "" || last === ".") && !resolved.endsWith(path10.sep);
|
|
9968
|
+
return dirOnly ? `${resolved}${path10.sep}` : resolved;
|
|
9969
|
+
}
|
|
9970
|
+
const base = path10.resolve(root);
|
|
9971
|
+
return base.endsWith(path10.sep) ? `${base}${rest}` : `${base}${path10.sep}${rest}`;
|
|
9972
|
+
}
|
|
9944
9973
|
async function specPath(spec, args) {
|
|
9945
9974
|
if (spec.kind !== "file" || !spec.paths?.length) return interpolatePath(spec.path, args);
|
|
9946
9975
|
const candidates = [];
|
|
@@ -9986,9 +10015,9 @@ function untrackArchive(archive) {
|
|
|
9986
10015
|
process.removeListener("exit", removePendingArchives);
|
|
9987
10016
|
}
|
|
9988
10017
|
function sha256File(filePath, signal) {
|
|
9989
|
-
return new Promise((
|
|
10018
|
+
return new Promise((resolve11, reject) => {
|
|
9990
10019
|
const hash = createHash2("sha256");
|
|
9991
|
-
createReadStream2(filePath, { signal }).on("data", (chunk) => hash.update(chunk)).on("end", () =>
|
|
10020
|
+
createReadStream2(filePath, { signal }).on("data", (chunk) => hash.update(chunk)).on("end", () => resolve11(hash.digest("hex"))).on("error", reject);
|
|
9992
10021
|
});
|
|
9993
10022
|
}
|
|
9994
10023
|
function toolServerError(text) {
|
|
@@ -10086,13 +10115,21 @@ async function prepareFileInputs(specs, args, opts) {
|
|
|
10086
10115
|
return args;
|
|
10087
10116
|
}
|
|
10088
10117
|
const record = args;
|
|
10089
|
-
|
|
10118
|
+
const planned = [];
|
|
10119
|
+
const callArgs = { ...record };
|
|
10090
10120
|
for (const spec of specs) {
|
|
10091
10121
|
if (spec.skipWhenSet && record[spec.skipWhenSet] !== void 0) continue;
|
|
10092
10122
|
if (spec.target in record && typeof record[spec.target] !== "string") continue;
|
|
10093
|
-
const
|
|
10094
|
-
if (
|
|
10095
|
-
if (spec.target in record && record[spec.target] !==
|
|
10123
|
+
const spelled = await specPath(spec, record);
|
|
10124
|
+
if (spelled === null) continue;
|
|
10125
|
+
if (spec.target in record && record[spec.target] !== spelled) continue;
|
|
10126
|
+
const filePath = callerPath(spelled);
|
|
10127
|
+
planned.push({ spec, filePath });
|
|
10128
|
+
if (spec.target in record) callArgs[spec.target] = filePath;
|
|
10129
|
+
}
|
|
10130
|
+
if (planned.length === 0) return args;
|
|
10131
|
+
const out = { ...record };
|
|
10132
|
+
for (const { spec, filePath } of planned) {
|
|
10096
10133
|
const wire = { [FILE_INPUT_MARKER2]: true, path: filePath };
|
|
10097
10134
|
if (spec.kind === "file") {
|
|
10098
10135
|
const read = await readFileInputWire(filePath, { includeContent: opts.includeContent });
|
|
@@ -10100,12 +10137,12 @@ async function prepareFileInputs(specs, args, opts) {
|
|
|
10100
10137
|
if (spec.collect === "flow" && opts.includeContent && wire.content !== void 0 && opts.collectMembers) {
|
|
10101
10138
|
Object.assign(
|
|
10102
10139
|
wire,
|
|
10103
|
-
await opts.collectMembers(filePath, Buffer.from(wire.content, "base64"),
|
|
10140
|
+
await opts.collectMembers(filePath, Buffer.from(wire.content, "base64"), callArgs, opts)
|
|
10104
10141
|
);
|
|
10105
10142
|
}
|
|
10106
10143
|
}
|
|
10107
10144
|
if (spec.kind === "probe" && spec.collect === "step" && opts.includeContent && opts.collectStepMembers) {
|
|
10108
|
-
wire.members = await opts.collectStepMembers(
|
|
10145
|
+
wire.members = await opts.collectStepMembers(callArgs, opts);
|
|
10109
10146
|
}
|
|
10110
10147
|
if (spec.kind === "tar-upload") {
|
|
10111
10148
|
const st = await stat3(filePath).catch(() => null);
|
|
@@ -10119,10 +10156,9 @@ async function prepareFileInputs(specs, args, opts) {
|
|
|
10119
10156
|
Object.assign(wire, await uploadFile(filePath, opts.uploadEndpoint, opts.signal));
|
|
10120
10157
|
}
|
|
10121
10158
|
}
|
|
10122
|
-
out = out ?? { ...record };
|
|
10123
10159
|
out[spec.target] = wire;
|
|
10124
10160
|
}
|
|
10125
|
-
return out
|
|
10161
|
+
return out;
|
|
10126
10162
|
}
|
|
10127
10163
|
function isAllowedClientFilePath(p) {
|
|
10128
10164
|
if (!path10.isAbsolute(p)) return false;
|
|
@@ -10486,7 +10522,7 @@ function memberCollector(roots, opts) {
|
|
|
10486
10522
|
for (let file = files.shift(); file !== void 0; file = files.shift()) {
|
|
10487
10523
|
let doc;
|
|
10488
10524
|
try {
|
|
10489
|
-
doc = (0, import_yaml.parse)(file.text
|
|
10525
|
+
doc = (0, import_yaml.parse)(flowYamlSource(file.text), { logLevel: "error" });
|
|
10490
10526
|
} catch {
|
|
10491
10527
|
continue;
|
|
10492
10528
|
}
|
|
@@ -10601,7 +10637,7 @@ function recordedStep(args) {
|
|
|
10601
10637
|
async function collectStepMembers(args, opts, recordingDirFor = e2eDirFor) {
|
|
10602
10638
|
const { name, project_root: projectRoot } = args;
|
|
10603
10639
|
const step = recordedStep(args);
|
|
10604
|
-
if (typeof name !== "string" || !FLOW_NAME_PATTERN.test(name) ||
|
|
10640
|
+
if (typeof name !== "string" || !FLOW_NAME_PATTERN.test(name) || !isResolvedAbsolute2(projectRoot) || step === void 0) {
|
|
10605
10641
|
return [];
|
|
10606
10642
|
}
|
|
10607
10643
|
const recording = path11.join(recordingDirFor(projectRoot), `${name}.yaml`);
|
|
@@ -10687,7 +10723,10 @@ async function stepForOlderServer(args, listedId) {
|
|
|
10687
10723
|
async function e2eShadowWarningFor(tool, args) {
|
|
10688
10724
|
const id = canonicalToolId(tool);
|
|
10689
10725
|
if (id !== "e2e-execute" && id !== "e2e-read-prerequisite") return void 0;
|
|
10690
|
-
const
|
|
10726
|
+
const root = args?.project_root;
|
|
10727
|
+
const target = nestedFlowTarget(
|
|
10728
|
+
typeof root === "string" ? { ...args, project_root: callerPath(root) } : args
|
|
10729
|
+
);
|
|
10691
10730
|
if (target?.kind !== "name") return void 0;
|
|
10692
10731
|
const picked = await pickE2eFile(target.paths);
|
|
10693
10732
|
return picked.shadowed === void 0 ? void 0 : e2eShadowWarning(picked.path, picked.shadowed);
|
|
@@ -10851,7 +10890,7 @@ async function forwardedSecrets(args) {
|
|
|
10851
10890
|
}
|
|
10852
10891
|
let parsed;
|
|
10853
10892
|
try {
|
|
10854
|
-
parsed = text === void 0 ? void 0 : (0, import_yaml2.parse)(text
|
|
10893
|
+
parsed = text === void 0 ? void 0 : (0, import_yaml2.parse)(flowYamlSource(text), { logLevel: "error" });
|
|
10855
10894
|
} catch {
|
|
10856
10895
|
continue;
|
|
10857
10896
|
}
|
|
@@ -10882,6 +10921,34 @@ function secretsTransportRefusal(url) {
|
|
|
10882
10921
|
return void 0;
|
|
10883
10922
|
}
|
|
10884
10923
|
var FETCH_HEAD_BYTES = 256;
|
|
10924
|
+
function isRecord2(value) {
|
|
10925
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10926
|
+
}
|
|
10927
|
+
var PROJECT_PATH_ADVICE = {
|
|
10928
|
+
project_root: "Pass the absolute path to the project root directory - the same cwd the calling agent is working in.",
|
|
10929
|
+
e2e_test_path: "Pass the absolute path to the e2e test file."
|
|
10930
|
+
};
|
|
10931
|
+
function assertAbsoluteProjectPaths(meta, args) {
|
|
10932
|
+
if (!meta || !isRecord2(args)) return;
|
|
10933
|
+
const aliases = Object.entries(toolParamAliases(meta.name));
|
|
10934
|
+
for (const [param, advice] of Object.entries(PROJECT_PATH_ADVICE)) {
|
|
10935
|
+
const value = args[param];
|
|
10936
|
+
if (typeof value !== "string" || callerPath(value) === value) continue;
|
|
10937
|
+
const names = [param, ...aliases.filter(([, current]) => current === param).map(([f]) => f)];
|
|
10938
|
+
if (!meta.fileInputs?.some((spec) => names.some((n) => spec.path.includes(`\${${n}}`)))) {
|
|
10939
|
+
continue;
|
|
10940
|
+
}
|
|
10941
|
+
throw new Error(`${param} must be an absolute path (got "${value}"). ${advice}`);
|
|
10942
|
+
}
|
|
10943
|
+
}
|
|
10944
|
+
function failedRun(result) {
|
|
10945
|
+
if (!isRecord2(result)) return result;
|
|
10946
|
+
if (result.ok === true) return { ...result, ok: false };
|
|
10947
|
+
if (isRecord2(result.toolResult) && result.toolResult.ok === true) {
|
|
10948
|
+
return { ...result, toolResult: { ...result.toolResult, ok: false } };
|
|
10949
|
+
}
|
|
10950
|
+
return result;
|
|
10951
|
+
}
|
|
10885
10952
|
function createToolsClient(options = {}) {
|
|
10886
10953
|
let cached = null;
|
|
10887
10954
|
const doFetch = options.fetchImpl ?? ((url, init) => fetch(url, init));
|
|
@@ -10930,6 +10997,7 @@ function createToolsClient(options = {}) {
|
|
|
10930
10997
|
let finalArgs = canonicalToolArgs(name, args);
|
|
10931
10998
|
const { tools, uploadFormats } = await fetchToolList({ signal: opts?.signal });
|
|
10932
10999
|
const meta = findTool(tools, name);
|
|
11000
|
+
if (options.refuseRelativeProjectPaths) assertAbsoluteProjectPaths(meta, finalArgs);
|
|
10933
11001
|
const olderServer = meta !== null && !tools.some((t) => t.name === canonicalToolId(meta.name));
|
|
10934
11002
|
if (meta) {
|
|
10935
11003
|
finalArgs = await nameToE2ePathForOlderServer(meta.name, meta.fileInputs, finalArgs);
|
|
@@ -10967,7 +11035,7 @@ function createToolsClient(options = {}) {
|
|
|
10967
11035
|
}
|
|
10968
11036
|
}
|
|
10969
11037
|
}
|
|
10970
|
-
const result = applied.result;
|
|
11038
|
+
const result = applied.failed.length > 0 ? failedRun(applied.result) : applied.result;
|
|
10971
11039
|
if (shadowWarning === void 0 || typeof result !== "object" || result === null || Array.isArray(result) || typeof result.warning === "string") {
|
|
10972
11040
|
return result;
|
|
10973
11041
|
}
|
|
@@ -11106,7 +11174,7 @@ import {
|
|
|
11106
11174
|
} from "node:fs/promises";
|
|
11107
11175
|
import { constants as fsConstants } from "node:fs";
|
|
11108
11176
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
11109
|
-
import { basename as basename7, dirname as dirname9, extname as extname2, isAbsolute as isAbsolute6, join as join13, normalize as normalize2, resolve as
|
|
11177
|
+
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";
|
|
11110
11178
|
import { createHash as createHash3 } from "node:crypto";
|
|
11111
11179
|
var ARTIFACT_MARKER2 = "__argentArtifact";
|
|
11112
11180
|
function isArtifactHandle(value) {
|
|
@@ -11154,8 +11222,8 @@ function configuredRecordingsDir() {
|
|
|
11154
11222
|
const trimmed = value.trim();
|
|
11155
11223
|
if (trimmed === "") return null;
|
|
11156
11224
|
const home = dirname9(argentHomeDir());
|
|
11157
|
-
const expanded = trimmed === "~" ? home : trimmed.startsWith("~/") || trimmed.startsWith(`~${
|
|
11158
|
-
return
|
|
11225
|
+
const expanded = trimmed === "~" ? home : trimmed.startsWith("~/") || trimmed.startsWith(`~${sep5}`) ? join13(home, trimmed.slice(2)) : trimmed;
|
|
11226
|
+
return resolve10(durableBaseDir(), expanded);
|
|
11159
11227
|
}
|
|
11160
11228
|
var MAX_ARTIFACT_BYTES = 2 * 1024 * 1024 * 1024;
|
|
11161
11229
|
async function readCapped(res, cap) {
|
|
@@ -11202,7 +11270,7 @@ async function writeDurableUnique(dir, filename, write) {
|
|
|
11202
11270
|
function durableSaveTarget(handle) {
|
|
11203
11271
|
if (typeof handle.saveDir !== "string" || !handle.saveDir || handle.archive) return null;
|
|
11204
11272
|
const rel = normalize2(handle.saveDir);
|
|
11205
|
-
if (isAbsolute6(rel) || rel === ".." || rel.startsWith(`..${
|
|
11273
|
+
if (isAbsolute6(rel) || rel === ".." || rel.startsWith(`..${sep5}`) || rel.split(sep5).includes("..")) {
|
|
11206
11274
|
return null;
|
|
11207
11275
|
}
|
|
11208
11276
|
if (!ALLOWED_SAVE_DIRS.has(rel)) return null;
|
|
@@ -698,6 +698,7 @@ function describeValue(value) {
|
|
|
698
698
|
if (value === undefined) return "undefined";
|
|
699
699
|
const type = typeof value;
|
|
700
700
|
if (type === "number") {
|
|
701
|
+
if (Number.isFinite(value)) return "a number";
|
|
701
702
|
if (Number.isNaN(value)) return "NaN";
|
|
702
703
|
return value > 0 ? "Infinity" : "-Infinity";
|
|
703
704
|
}
|