@swmansion/argent 0.34.1-next.30 → 0.34.1-next.31
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 +211 -150
- 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-server.cjs +273 -165
- package/package.json +1 -1
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;
|
|
@@ -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;
|
|
@@ -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);
|
|
@@ -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);
|
|
@@ -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;
|
|
@@ -15820,17 +15820,17 @@ var validateAsync = async (schema, value, _ctx) => {
|
|
|
15820
15820
|
return result.issues.length === 0;
|
|
15821
15821
|
};
|
|
15822
15822
|
var _encode = (_Err) => {
|
|
15823
|
-
const
|
|
15823
|
+
const parse4 = _parse(_Err);
|
|
15824
15824
|
const fn = (schema, value, _ctx, _params) => {
|
|
15825
15825
|
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
15826
|
-
return
|
|
15826
|
+
return parse4(schema, value, ctx, finalizeParams(fn, _params));
|
|
15827
15827
|
};
|
|
15828
15828
|
return fn;
|
|
15829
15829
|
};
|
|
15830
15830
|
var _decode = (_Err) => {
|
|
15831
|
-
const
|
|
15831
|
+
const parse4 = _parse(_Err);
|
|
15832
15832
|
const fn = (schema, value, _ctx, _params) => {
|
|
15833
|
-
return
|
|
15833
|
+
return parse4(schema, value, _ctx, finalizeParams(fn, _params));
|
|
15834
15834
|
};
|
|
15835
15835
|
return fn;
|
|
15836
15836
|
};
|
|
@@ -16867,7 +16867,7 @@ function capSize(inst, size) {
|
|
|
16867
16867
|
if (!caps.length)
|
|
16868
16868
|
return;
|
|
16869
16869
|
const cap = Math.min(...caps.map((c) => c[0]));
|
|
16870
|
-
const
|
|
16870
|
+
const parse4 = inst._zod.parse;
|
|
16871
16871
|
inst._zod.parse = (payload, ctx) => {
|
|
16872
16872
|
const n = size(payload.value);
|
|
16873
16873
|
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
@@ -16881,7 +16881,7 @@ function capSize(inst, size) {
|
|
|
16881
16881
|
}
|
|
16882
16882
|
}
|
|
16883
16883
|
}
|
|
16884
|
-
return
|
|
16884
|
+
return parse4(payload, ctx);
|
|
16885
16885
|
};
|
|
16886
16886
|
}
|
|
16887
16887
|
var arraySize = (input) => Array.isArray(input) ? input.length : -1;
|
|
@@ -17977,7 +17977,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
|
|
|
17977
17977
|
var NONE = 0;
|
|
17978
17978
|
var ASSUMED = 1;
|
|
17979
17979
|
var PROVEN = 2;
|
|
17980
|
-
function isRecursive(inst, stack,
|
|
17980
|
+
function isRecursive(inst, stack, resolve12) {
|
|
17981
17981
|
const cached2 = recursive.get(inst);
|
|
17982
17982
|
if (cached2 !== void 0)
|
|
17983
17983
|
return cached2 ? PROVEN : NONE;
|
|
@@ -17987,7 +17987,7 @@ function isRecursive(inst, stack, resolve11) {
|
|
|
17987
17987
|
let result = NONE;
|
|
17988
17988
|
const check = (child) => {
|
|
17989
17989
|
if (result !== PROVEN && child?._zod) {
|
|
17990
|
-
const answer = isRecursive(child, stack,
|
|
17990
|
+
const answer = isRecursive(child, stack, resolve12);
|
|
17991
17991
|
if (answer > result)
|
|
17992
17992
|
result = answer;
|
|
17993
17993
|
}
|
|
@@ -17998,7 +17998,7 @@ function isRecursive(inst, stack, resolve11) {
|
|
|
17998
17998
|
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
17999
17999
|
if (spread && !desc.enumerable)
|
|
18000
18000
|
continue;
|
|
18001
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack,
|
|
18001
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve12) : NONE;
|
|
18002
18002
|
if (child > answer)
|
|
18003
18003
|
answer = child;
|
|
18004
18004
|
}
|
|
@@ -18062,7 +18062,7 @@ function isRecursive(inst, stack, resolve11) {
|
|
|
18062
18062
|
break;
|
|
18063
18063
|
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
18064
18064
|
case "lazy": {
|
|
18065
|
-
const inner = def._cachedInner ?? (
|
|
18065
|
+
const inner = def._cachedInner ?? (resolve12 ? inst._zod.innerType : void 0);
|
|
18066
18066
|
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
18067
18067
|
break;
|
|
18068
18068
|
}
|
|
@@ -22640,12 +22640,12 @@ var StdioServerTransport = class {
|
|
|
22640
22640
|
this.onclose?.();
|
|
22641
22641
|
}
|
|
22642
22642
|
send(message) {
|
|
22643
|
-
return new Promise((
|
|
22643
|
+
return new Promise((resolve12) => {
|
|
22644
22644
|
const json = serializeMessage(message);
|
|
22645
22645
|
if (this._stdout.write(json)) {
|
|
22646
|
-
|
|
22646
|
+
resolve12();
|
|
22647
22647
|
} else {
|
|
22648
|
-
this._stdout.once("drain",
|
|
22648
|
+
this._stdout.once("drain", resolve12);
|
|
22649
22649
|
}
|
|
22650
22650
|
});
|
|
22651
22651
|
}
|
|
@@ -23265,7 +23265,7 @@ var Protocol = class {
|
|
|
23265
23265
|
return;
|
|
23266
23266
|
}
|
|
23267
23267
|
const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
|
|
23268
|
-
await new Promise((
|
|
23268
|
+
await new Promise((resolve12) => setTimeout(resolve12, pollInterval));
|
|
23269
23269
|
options?.signal?.throwIfAborted();
|
|
23270
23270
|
}
|
|
23271
23271
|
} catch (error2) {
|
|
@@ -23282,7 +23282,7 @@ var Protocol = class {
|
|
|
23282
23282
|
*/
|
|
23283
23283
|
request(request, resultSchema, options) {
|
|
23284
23284
|
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
|
|
23285
|
-
return new Promise((
|
|
23285
|
+
return new Promise((resolve12, reject) => {
|
|
23286
23286
|
const earlyReject = (error2) => {
|
|
23287
23287
|
reject(error2);
|
|
23288
23288
|
};
|
|
@@ -23360,7 +23360,7 @@ var Protocol = class {
|
|
|
23360
23360
|
if (!parseResult.success) {
|
|
23361
23361
|
reject(parseResult.error);
|
|
23362
23362
|
} else {
|
|
23363
|
-
|
|
23363
|
+
resolve12(parseResult.data);
|
|
23364
23364
|
}
|
|
23365
23365
|
} catch (error2) {
|
|
23366
23366
|
reject(error2);
|
|
@@ -23622,12 +23622,12 @@ var Protocol = class {
|
|
|
23622
23622
|
}
|
|
23623
23623
|
} catch {
|
|
23624
23624
|
}
|
|
23625
|
-
return new Promise((
|
|
23625
|
+
return new Promise((resolve12, reject) => {
|
|
23626
23626
|
if (signal.aborted) {
|
|
23627
23627
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
23628
23628
|
return;
|
|
23629
23629
|
}
|
|
23630
|
-
const timeoutId = setTimeout(
|
|
23630
|
+
const timeoutId = setTimeout(resolve12, interval);
|
|
23631
23631
|
signal.addEventListener("abort", () => {
|
|
23632
23632
|
clearTimeout(timeoutId);
|
|
23633
23633
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
@@ -24444,7 +24444,7 @@ function generateToken() {
|
|
|
24444
24444
|
return randomBytes(AUTH_TOKEN_BYTES).toString("hex");
|
|
24445
24445
|
}
|
|
24446
24446
|
function findFreePort() {
|
|
24447
|
-
return new Promise((
|
|
24447
|
+
return new Promise((resolve12, reject) => {
|
|
24448
24448
|
const srv = net.createServer();
|
|
24449
24449
|
srv.listen(0, "127.0.0.1", () => {
|
|
24450
24450
|
const addr = srv.address();
|
|
@@ -24455,21 +24455,21 @@ function findFreePort() {
|
|
|
24455
24455
|
const port = addr.port;
|
|
24456
24456
|
srv.close((err) => {
|
|
24457
24457
|
if (err) reject(err);
|
|
24458
|
-
else
|
|
24458
|
+
else resolve12(port);
|
|
24459
24459
|
});
|
|
24460
24460
|
});
|
|
24461
24461
|
srv.on("error", reject);
|
|
24462
24462
|
});
|
|
24463
24463
|
}
|
|
24464
24464
|
function isVersionNewer(a, b) {
|
|
24465
|
-
const
|
|
24465
|
+
const parse4 = (v) => {
|
|
24466
24466
|
const [core = "", ...preParts] = v.split("+")[0].split("-");
|
|
24467
24467
|
const nums = core.split(".").map((n) => Number.parseInt(n, 10));
|
|
24468
24468
|
if (nums.length === 0 || nums.some((n) => Number.isNaN(n))) return null;
|
|
24469
24469
|
return { nums, pre: preParts.length > 0 ? preParts.join("-").split(".") : [] };
|
|
24470
24470
|
};
|
|
24471
|
-
const pa =
|
|
24472
|
-
const pb =
|
|
24471
|
+
const pa = parse4(a);
|
|
24472
|
+
const pb = parse4(b);
|
|
24473
24473
|
if (!pa || !pb) return false;
|
|
24474
24474
|
for (let i = 0; i < 3; i++) {
|
|
24475
24475
|
const x = pa.nums[i] ?? 0;
|
|
@@ -24557,7 +24557,7 @@ function resolveToolsServerNode() {
|
|
|
24557
24557
|
return !(bun || deno || electron) && fs.existsSync(process.execPath) ? process.execPath : "node";
|
|
24558
24558
|
}
|
|
24559
24559
|
function spawnToolsServer(paths, port, options = {}) {
|
|
24560
|
-
return new Promise((
|
|
24560
|
+
return new Promise((resolve12, reject) => {
|
|
24561
24561
|
let logFd;
|
|
24562
24562
|
try {
|
|
24563
24563
|
fs.mkdirSync(STATE_DIR, { recursive: true });
|
|
@@ -24603,7 +24603,7 @@ function spawnToolsServer(paths, port, options = {}) {
|
|
|
24603
24603
|
rl.close();
|
|
24604
24604
|
child.stdout?.resume();
|
|
24605
24605
|
child.stdout?.unref?.();
|
|
24606
|
-
settle2(() =>
|
|
24606
|
+
settle2(() => resolve12({ port: actualPort, pid }));
|
|
24607
24607
|
}
|
|
24608
24608
|
});
|
|
24609
24609
|
child.on("error", (err) => {
|
|
@@ -25547,10 +25547,18 @@ function toolStepFiles(specs, args) {
|
|
|
25547
25547
|
}
|
|
25548
25548
|
return files;
|
|
25549
25549
|
}
|
|
25550
|
+
var UNEXPANDED_PATH = /^~|\$[A-Za-z0-9_{(]|`|%[A-Za-z_][A-Za-z0-9_]*%|^[A-Za-z][A-Za-z0-9+.-]+:/;
|
|
25551
|
+
function isUnexpandedPath(p) {
|
|
25552
|
+
return UNEXPANDED_PATH.test(p);
|
|
25553
|
+
}
|
|
25550
25554
|
function isClientFileArgument({ spec, path: path18 }) {
|
|
25551
25555
|
return spec.kind === "file" && spec.path === `\${${spec.target}}` && path18.startsWith("/") && hasToolFileExtension(path18);
|
|
25552
25556
|
}
|
|
25553
25557
|
|
|
25558
|
+
// ../registry/src/flow-platforms.ts
|
|
25559
|
+
var LAUNCH_PLATFORMS = ["ios", "android", "chromium", "vega", "macos"];
|
|
25560
|
+
var SELECTABLE_PLATFORMS = [...LAUNCH_PLATFORMS, "ios-remote"];
|
|
25561
|
+
|
|
25554
25562
|
// ../registry/src/flow-file-refs.ts
|
|
25555
25563
|
import * as fs7 from "node:fs/promises";
|
|
25556
25564
|
import * as path8 from "node:path";
|
|
@@ -25681,6 +25689,9 @@ var MAX_BLOCK_NESTING = 64;
|
|
|
25681
25689
|
function isRecord(value) {
|
|
25682
25690
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
25683
25691
|
}
|
|
25692
|
+
function flowYamlSource(content) {
|
|
25693
|
+
return content.replace(/^\s+/, (lead) => lead.replace(/[^\n]/g, "")).trimEnd();
|
|
25694
|
+
}
|
|
25684
25695
|
function collectFlowRequests(doc) {
|
|
25685
25696
|
const runTargets = /* @__PURE__ */ new Set();
|
|
25686
25697
|
const snapshots = /* @__PURE__ */ new Set();
|
|
@@ -25955,6 +25966,8 @@ var FAILURE_CODES = {
|
|
|
25955
25966
|
DEBUGGER_TARGET_DEVICE_MISMATCH: "DEBUGGER_TARGET_DEVICE_MISMATCH",
|
|
25956
25967
|
DEBUGGER_EVALUATE_EXPRESSION_THREW: "DEBUGGER_EVALUATE_EXPRESSION_THREW",
|
|
25957
25968
|
DEBUGGER_RELOAD_FAILED: "DEBUGGER_RELOAD_FAILED",
|
|
25969
|
+
// e2e-add-step refused a debugger-* call that answered `not_connected`.
|
|
25970
|
+
DEBUGGER_NOT_CONNECTED: "DEBUGGER_NOT_CONNECTED",
|
|
25958
25971
|
JS_RUNTIME_CONSOLE_SERVER_BIND_FAILED: "JS_RUNTIME_CONSOLE_SERVER_BIND_FAILED",
|
|
25959
25972
|
JS_RUNTIME_PAYLOAD_INVALID: "JS_RUNTIME_PAYLOAD_INVALID",
|
|
25960
25973
|
JS_RUNTIME_PAYLOAD_DEVICE_MISSING: "JS_RUNTIME_PAYLOAD_DEVICE_MISSING",
|
|
@@ -26532,7 +26545,7 @@ async function runTar(archive, args, signal) {
|
|
|
26532
26545
|
child.on("error", (err) => {
|
|
26533
26546
|
childError = err;
|
|
26534
26547
|
});
|
|
26535
|
-
const closed = new Promise((
|
|
26548
|
+
const closed = new Promise((resolve12) => child.once("close", resolve12));
|
|
26536
26549
|
const stdout = collect(child.stdout, MAX_LISTING_BYTES, {
|
|
26537
26550
|
maxLines: MAX_LISTING_LINES,
|
|
26538
26551
|
onOverflow: () => child.kill()
|
|
@@ -26702,6 +26715,22 @@ function interpolatePath(template, args) {
|
|
|
26702
26715
|
});
|
|
26703
26716
|
return missing ? null : out;
|
|
26704
26717
|
}
|
|
26718
|
+
function callerPath(p) {
|
|
26719
|
+
const onCurrentDrive = path10.sep === "\\" && /^[\\/](?![\\/])/.test(p);
|
|
26720
|
+
if (!onCurrentDrive && (path10.isAbsolute(p) || path10.win32.isAbsolute(p) || isUnexpandedPath(p))) {
|
|
26721
|
+
return p;
|
|
26722
|
+
}
|
|
26723
|
+
const { root } = path10.parse(p);
|
|
26724
|
+
const rest = p.slice(root.length);
|
|
26725
|
+
if (!rest.split(/[\\/]/).includes("..")) {
|
|
26726
|
+
const resolved = path10.resolve(p);
|
|
26727
|
+
const last = p.split(path10.sep === "\\" ? /[\\/]/ : "/").at(-1);
|
|
26728
|
+
const dirOnly = p !== last && (last === "" || last === ".") && !resolved.endsWith(path10.sep);
|
|
26729
|
+
return dirOnly ? `${resolved}${path10.sep}` : resolved;
|
|
26730
|
+
}
|
|
26731
|
+
const base = path10.resolve(root);
|
|
26732
|
+
return base.endsWith(path10.sep) ? `${base}${rest}` : `${base}${path10.sep}${rest}`;
|
|
26733
|
+
}
|
|
26705
26734
|
async function specPath(spec, args) {
|
|
26706
26735
|
if (spec.kind !== "file" || !spec.paths?.length) return interpolatePath(spec.path, args);
|
|
26707
26736
|
const candidates = [];
|
|
@@ -26747,9 +26776,9 @@ function untrackArchive(archive) {
|
|
|
26747
26776
|
process.removeListener("exit", removePendingArchives);
|
|
26748
26777
|
}
|
|
26749
26778
|
function sha256File(filePath, signal) {
|
|
26750
|
-
return new Promise((
|
|
26779
|
+
return new Promise((resolve12, reject) => {
|
|
26751
26780
|
const hash = createHash2("sha256");
|
|
26752
|
-
createReadStream2(filePath, { signal }).on("data", (chunk) => hash.update(chunk)).on("end", () =>
|
|
26781
|
+
createReadStream2(filePath, { signal }).on("data", (chunk) => hash.update(chunk)).on("end", () => resolve12(hash.digest("hex"))).on("error", reject);
|
|
26753
26782
|
});
|
|
26754
26783
|
}
|
|
26755
26784
|
function toolServerError(text) {
|
|
@@ -26847,13 +26876,21 @@ async function prepareFileInputs(specs, args, opts) {
|
|
|
26847
26876
|
return args;
|
|
26848
26877
|
}
|
|
26849
26878
|
const record2 = args;
|
|
26850
|
-
|
|
26879
|
+
const planned = [];
|
|
26880
|
+
const callArgs = { ...record2 };
|
|
26851
26881
|
for (const spec of specs) {
|
|
26852
26882
|
if (spec.skipWhenSet && record2[spec.skipWhenSet] !== void 0) continue;
|
|
26853
26883
|
if (spec.target in record2 && typeof record2[spec.target] !== "string") continue;
|
|
26854
|
-
const
|
|
26855
|
-
if (
|
|
26856
|
-
if (spec.target in record2 && record2[spec.target] !==
|
|
26884
|
+
const spelled = await specPath(spec, record2);
|
|
26885
|
+
if (spelled === null) continue;
|
|
26886
|
+
if (spec.target in record2 && record2[spec.target] !== spelled) continue;
|
|
26887
|
+
const filePath = callerPath(spelled);
|
|
26888
|
+
planned.push({ spec, filePath });
|
|
26889
|
+
if (spec.target in record2) callArgs[spec.target] = filePath;
|
|
26890
|
+
}
|
|
26891
|
+
if (planned.length === 0) return args;
|
|
26892
|
+
const out = { ...record2 };
|
|
26893
|
+
for (const { spec, filePath } of planned) {
|
|
26857
26894
|
const wire = { [FILE_INPUT_MARKER2]: true, path: filePath };
|
|
26858
26895
|
if (spec.kind === "file") {
|
|
26859
26896
|
const read = await readFileInputWire(filePath, { includeContent: opts.includeContent });
|
|
@@ -26861,12 +26898,12 @@ async function prepareFileInputs(specs, args, opts) {
|
|
|
26861
26898
|
if (spec.collect === "flow" && opts.includeContent && wire.content !== void 0 && opts.collectMembers) {
|
|
26862
26899
|
Object.assign(
|
|
26863
26900
|
wire,
|
|
26864
|
-
await opts.collectMembers(filePath, Buffer.from(wire.content, "base64"),
|
|
26901
|
+
await opts.collectMembers(filePath, Buffer.from(wire.content, "base64"), callArgs, opts)
|
|
26865
26902
|
);
|
|
26866
26903
|
}
|
|
26867
26904
|
}
|
|
26868
26905
|
if (spec.kind === "probe" && spec.collect === "step" && opts.includeContent && opts.collectStepMembers) {
|
|
26869
|
-
wire.members = await opts.collectStepMembers(
|
|
26906
|
+
wire.members = await opts.collectStepMembers(callArgs, opts);
|
|
26870
26907
|
}
|
|
26871
26908
|
if (spec.kind === "tar-upload") {
|
|
26872
26909
|
const st = await stat3(filePath).catch(() => null);
|
|
@@ -26880,10 +26917,9 @@ async function prepareFileInputs(specs, args, opts) {
|
|
|
26880
26917
|
Object.assign(wire, await uploadFile(filePath, opts.uploadEndpoint, opts.signal));
|
|
26881
26918
|
}
|
|
26882
26919
|
}
|
|
26883
|
-
out = out ?? { ...record2 };
|
|
26884
26920
|
out[spec.target] = wire;
|
|
26885
26921
|
}
|
|
26886
|
-
return out
|
|
26922
|
+
return out;
|
|
26887
26923
|
}
|
|
26888
26924
|
function isAllowedClientFilePath(p) {
|
|
26889
26925
|
if (!path10.isAbsolute(p)) return false;
|
|
@@ -27247,7 +27283,7 @@ function memberCollector(roots, opts) {
|
|
|
27247
27283
|
for (let file = files.shift(); file !== void 0; file = files.shift()) {
|
|
27248
27284
|
let doc;
|
|
27249
27285
|
try {
|
|
27250
|
-
doc = (0, import_yaml.parse)(file.text
|
|
27286
|
+
doc = (0, import_yaml.parse)(flowYamlSource(file.text), { logLevel: "error" });
|
|
27251
27287
|
} catch {
|
|
27252
27288
|
continue;
|
|
27253
27289
|
}
|
|
@@ -27362,7 +27398,7 @@ function recordedStep(args) {
|
|
|
27362
27398
|
async function collectStepMembers(args, opts, recordingDirFor = e2eDirFor) {
|
|
27363
27399
|
const { name, project_root: projectRoot } = args;
|
|
27364
27400
|
const step = recordedStep(args);
|
|
27365
|
-
if (typeof name !== "string" || !FLOW_NAME_PATTERN.test(name) ||
|
|
27401
|
+
if (typeof name !== "string" || !FLOW_NAME_PATTERN.test(name) || !isResolvedAbsolute2(projectRoot) || step === void 0) {
|
|
27366
27402
|
return [];
|
|
27367
27403
|
}
|
|
27368
27404
|
const recording = path11.join(recordingDirFor(projectRoot), `${name}.yaml`);
|
|
@@ -27448,7 +27484,10 @@ async function stepForOlderServer(args, listedId) {
|
|
|
27448
27484
|
async function e2eShadowWarningFor(tool, args) {
|
|
27449
27485
|
const id = canonicalToolId(tool);
|
|
27450
27486
|
if (id !== "e2e-execute" && id !== "e2e-read-prerequisite") return void 0;
|
|
27451
|
-
const
|
|
27487
|
+
const root = args?.project_root;
|
|
27488
|
+
const target = nestedFlowTarget(
|
|
27489
|
+
typeof root === "string" ? { ...args, project_root: callerPath(root) } : args
|
|
27490
|
+
);
|
|
27452
27491
|
if (target?.kind !== "name") return void 0;
|
|
27453
27492
|
const picked = await pickE2eFile(target.paths);
|
|
27454
27493
|
return picked.shadowed === void 0 ? void 0 : e2eShadowWarning(picked.path, picked.shadowed);
|
|
@@ -27612,7 +27651,7 @@ async function forwardedSecrets(args) {
|
|
|
27612
27651
|
}
|
|
27613
27652
|
let parsed;
|
|
27614
27653
|
try {
|
|
27615
|
-
parsed = text === void 0 ? void 0 : (0, import_yaml2.parse)(text
|
|
27654
|
+
parsed = text === void 0 ? void 0 : (0, import_yaml2.parse)(flowYamlSource(text), { logLevel: "error" });
|
|
27616
27655
|
} catch {
|
|
27617
27656
|
continue;
|
|
27618
27657
|
}
|
|
@@ -27643,6 +27682,34 @@ function secretsTransportRefusal(url) {
|
|
|
27643
27682
|
return void 0;
|
|
27644
27683
|
}
|
|
27645
27684
|
var FETCH_HEAD_BYTES = 256;
|
|
27685
|
+
function isRecord2(value) {
|
|
27686
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
27687
|
+
}
|
|
27688
|
+
var PROJECT_PATH_ADVICE = {
|
|
27689
|
+
project_root: "Pass the absolute path to the project root directory - the same cwd the calling agent is working in.",
|
|
27690
|
+
e2e_test_path: "Pass the absolute path to the e2e test file."
|
|
27691
|
+
};
|
|
27692
|
+
function assertAbsoluteProjectPaths(meta2, args) {
|
|
27693
|
+
if (!meta2 || !isRecord2(args)) return;
|
|
27694
|
+
const aliases = Object.entries(toolParamAliases(meta2.name));
|
|
27695
|
+
for (const [param, advice] of Object.entries(PROJECT_PATH_ADVICE)) {
|
|
27696
|
+
const value = args[param];
|
|
27697
|
+
if (typeof value !== "string" || callerPath(value) === value) continue;
|
|
27698
|
+
const names = [param, ...aliases.filter(([, current]) => current === param).map(([f]) => f)];
|
|
27699
|
+
if (!meta2.fileInputs?.some((spec) => names.some((n) => spec.path.includes(`\${${n}}`)))) {
|
|
27700
|
+
continue;
|
|
27701
|
+
}
|
|
27702
|
+
throw new Error(`${param} must be an absolute path (got "${value}"). ${advice}`);
|
|
27703
|
+
}
|
|
27704
|
+
}
|
|
27705
|
+
function failedRun(result) {
|
|
27706
|
+
if (!isRecord2(result)) return result;
|
|
27707
|
+
if (result.ok === true) return { ...result, ok: false };
|
|
27708
|
+
if (isRecord2(result.toolResult) && result.toolResult.ok === true) {
|
|
27709
|
+
return { ...result, toolResult: { ...result.toolResult, ok: false } };
|
|
27710
|
+
}
|
|
27711
|
+
return result;
|
|
27712
|
+
}
|
|
27646
27713
|
function createToolsClient(options = {}) {
|
|
27647
27714
|
let cached2 = null;
|
|
27648
27715
|
const doFetch = options.fetchImpl ?? ((url, init) => fetch(url, init));
|
|
@@ -27691,6 +27758,7 @@ function createToolsClient(options = {}) {
|
|
|
27691
27758
|
let finalArgs = canonicalToolArgs(name, args);
|
|
27692
27759
|
const { tools, uploadFormats } = await fetchToolList({ signal: opts?.signal });
|
|
27693
27760
|
const meta2 = findTool(tools, name);
|
|
27761
|
+
if (options.refuseRelativeProjectPaths) assertAbsoluteProjectPaths(meta2, finalArgs);
|
|
27694
27762
|
const olderServer = meta2 !== null && !tools.some((t) => t.name === canonicalToolId(meta2.name));
|
|
27695
27763
|
if (meta2) {
|
|
27696
27764
|
finalArgs = await nameToE2ePathForOlderServer(meta2.name, meta2.fileInputs, finalArgs);
|
|
@@ -27728,7 +27796,7 @@ function createToolsClient(options = {}) {
|
|
|
27728
27796
|
}
|
|
27729
27797
|
}
|
|
27730
27798
|
}
|
|
27731
|
-
const result = applied.result;
|
|
27799
|
+
const result = applied.failed.length > 0 ? failedRun(applied.result) : applied.result;
|
|
27732
27800
|
if (shadowWarning === void 0 || typeof result !== "object" || result === null || Array.isArray(result) || typeof result.warning === "string") {
|
|
27733
27801
|
return result;
|
|
27734
27802
|
}
|
|
@@ -27867,7 +27935,7 @@ import {
|
|
|
27867
27935
|
} from "node:fs/promises";
|
|
27868
27936
|
import { constants as fsConstants } from "node:fs";
|
|
27869
27937
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
27870
|
-
import { basename as basename7, dirname as dirname9, extname as extname2, isAbsolute as isAbsolute6, join as join13, normalize as normalize2, resolve as
|
|
27938
|
+
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";
|
|
27871
27939
|
import { createHash as createHash3 } from "node:crypto";
|
|
27872
27940
|
var ARTIFACT_MARKER2 = "__argentArtifact";
|
|
27873
27941
|
function isArtifactHandle(value) {
|
|
@@ -27915,8 +27983,8 @@ function configuredRecordingsDir() {
|
|
|
27915
27983
|
const trimmed = value.trim();
|
|
27916
27984
|
if (trimmed === "") return null;
|
|
27917
27985
|
const home = dirname9(argentHomeDir());
|
|
27918
|
-
const expanded = trimmed === "~" ? home : trimmed.startsWith("~/") || trimmed.startsWith(`~${
|
|
27919
|
-
return
|
|
27986
|
+
const expanded = trimmed === "~" ? home : trimmed.startsWith("~/") || trimmed.startsWith(`~${sep5}`) ? join13(home, trimmed.slice(2)) : trimmed;
|
|
27987
|
+
return resolve10(durableBaseDir(), expanded);
|
|
27920
27988
|
}
|
|
27921
27989
|
var MAX_ARTIFACT_BYTES = 2 * 1024 * 1024 * 1024;
|
|
27922
27990
|
async function readCapped(res, cap) {
|
|
@@ -27963,7 +28031,7 @@ async function writeDurableUnique(dir, filename, write) {
|
|
|
27963
28031
|
function durableSaveTarget(handle) {
|
|
27964
28032
|
if (typeof handle.saveDir !== "string" || !handle.saveDir || handle.archive) return null;
|
|
27965
28033
|
const rel = normalize2(handle.saveDir);
|
|
27966
|
-
if (isAbsolute6(rel) || rel === ".." || rel.startsWith(`..${
|
|
28034
|
+
if (isAbsolute6(rel) || rel === ".." || rel.startsWith(`..${sep5}`) || rel.split(sep5).includes("..")) {
|
|
27967
28035
|
return null;
|
|
27968
28036
|
}
|
|
27969
28037
|
if (!ALLOWED_SAVE_DIRS.has(rel)) return null;
|
|
@@ -28651,7 +28719,7 @@ async function fetchPngBytes(url, signal) {
|
|
|
28651
28719
|
}
|
|
28652
28720
|
}
|
|
28653
28721
|
async function toMcpContent(result, outputHint, ctx, args) {
|
|
28654
|
-
const suppressImage =
|
|
28722
|
+
const suppressImage = isRecord3(args) && args.includeImageInContext === false;
|
|
28655
28723
|
if (ctx) {
|
|
28656
28724
|
const { result: rewritten, images } = await materializeArtifacts(result, ctx);
|
|
28657
28725
|
if (outputHint === "image") {
|
|
@@ -28695,11 +28763,11 @@ async function legacyImageContent(result, suppressImage, signal) {
|
|
|
28695
28763
|
}
|
|
28696
28764
|
return [{ type: "text", text: JSON.stringify(result, null, 2) }];
|
|
28697
28765
|
}
|
|
28698
|
-
function
|
|
28766
|
+
function isRecord3(value) {
|
|
28699
28767
|
return value !== null && typeof value === "object";
|
|
28700
28768
|
}
|
|
28701
28769
|
function isScreenshotDiffResult(value) {
|
|
28702
|
-
if (!
|
|
28770
|
+
if (!isRecord3(value)) return false;
|
|
28703
28771
|
return typeof value.summary === "string";
|
|
28704
28772
|
}
|
|
28705
28773
|
async function screenshotDiffToMcpContent(result, ctx) {
|
|
@@ -28794,12 +28862,12 @@ async function flowRunToMcpContent(result, ctx) {
|
|
|
28794
28862
|
if (step.result !== void 0) {
|
|
28795
28863
|
blocks.push(...await toMcpContent(step.result, step.outputHint, ctx, step.args));
|
|
28796
28864
|
}
|
|
28797
|
-
if (
|
|
28865
|
+
if (isRecord3(step.artifacts)) {
|
|
28798
28866
|
blocks.push(...await stepArtifactBlocks(step.artifacts, step.status, ctx, step.depth));
|
|
28799
28867
|
}
|
|
28800
28868
|
}
|
|
28801
28869
|
for (const write of result.baselineWrites ?? []) {
|
|
28802
|
-
const { path: path18, error: error2 } =
|
|
28870
|
+
const { path: path18, error: error2 } = isRecord3(write) ? write : {};
|
|
28803
28871
|
if (typeof path18 === "string" && typeof error2 === "string") {
|
|
28804
28872
|
blocks.push({ type: "text", text: `\u2717 baseline not written: ${path18}: ${error2}` });
|
|
28805
28873
|
}
|
|
@@ -29172,7 +29240,7 @@ function toMcpToolList(tools, options = {}) {
|
|
|
29172
29240
|
// ../argent-mcp/src/list-devices-text.ts
|
|
29173
29241
|
var RUNTIME_PREFIX = "com.apple.CoreSimulator.SimRuntime.";
|
|
29174
29242
|
var STOPPED_SIMULATORS_HEADER = "iOS simulators that are shut down, one per line (platform, udid, name, runtime, state, tags); start one with boot-device:";
|
|
29175
|
-
function
|
|
29243
|
+
function isRecord4(value) {
|
|
29176
29244
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
29177
29245
|
}
|
|
29178
29246
|
function shortRuntime(runtime) {
|
|
@@ -29216,8 +29284,8 @@ function stoppedSimulatorLine(device) {
|
|
|
29216
29284
|
return parts.join(" ");
|
|
29217
29285
|
}
|
|
29218
29286
|
function listDevicesText(result) {
|
|
29219
|
-
if (!
|
|
29220
|
-
if (!result.devices.every(
|
|
29287
|
+
if (!isRecord4(result) || !Array.isArray(result.devices)) return void 0;
|
|
29288
|
+
if (!result.devices.every(isRecord4)) return void 0;
|
|
29221
29289
|
const devices = result.devices;
|
|
29222
29290
|
const listed = [];
|
|
29223
29291
|
const stopped = [];
|
|
@@ -29305,9 +29373,9 @@ async function untilAborted(work, signal) {
|
|
|
29305
29373
|
}
|
|
29306
29374
|
let onAbort = () => {
|
|
29307
29375
|
};
|
|
29308
|
-
const aborted2 = new Promise((
|
|
29309
|
-
onAbort =
|
|
29310
|
-
if (signal.aborted)
|
|
29376
|
+
const aborted2 = new Promise((resolve12) => {
|
|
29377
|
+
onAbort = resolve12;
|
|
29378
|
+
if (signal.aborted) resolve12();
|
|
29311
29379
|
else signal.addEventListener("abort", onAbort, { once: true });
|
|
29312
29380
|
});
|
|
29313
29381
|
try {
|
|
@@ -29346,6 +29414,7 @@ function createToolCaller(deps) {
|
|
|
29346
29414
|
const client = createToolsClient({
|
|
29347
29415
|
baseUrl: async () => ({ ...deps.getHandle(), remote: deps.remote }),
|
|
29348
29416
|
headers: deps.extraHeaders,
|
|
29417
|
+
refuseRelativeProjectPaths: true,
|
|
29349
29418
|
fetchImpl: async (url, init, meta2) => {
|
|
29350
29419
|
parseUrl(url);
|
|
29351
29420
|
return fetchWithReconnect(() => rebase(url), deps.reconnect, {
|