@swmansion/argent 0.32.1-next.16 → 0.32.1-next.17
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 +1 -1
- package/dist/installer.mjs +1 -1
- package/dist/tool-args.generated.d.ts +4 -2
- package/dist/tool-server.cjs +405 -213
- package/package.json +1 -1
- package/skills/argent-create-e2e/references/reliability-and-recovery.md +2 -2
- package/skills/argent-device-interact/references/chromium.md +1 -1
- package/skills/argent-react-native-profiler/SKILL.md +2 -3
package/dist/tool-server.cjs
CHANGED
|
@@ -24653,7 +24653,7 @@ var require_src = __commonJS({
|
|
|
24653
24653
|
// ../../node_modules/depd/index.js
|
|
24654
24654
|
var require_depd = __commonJS({
|
|
24655
24655
|
"../../node_modules/depd/index.js"(exports2, module2) {
|
|
24656
|
-
var
|
|
24656
|
+
var relative9 = require("path").relative;
|
|
24657
24657
|
module2.exports = depd;
|
|
24658
24658
|
var basePath = process.cwd();
|
|
24659
24659
|
function containsNamespace(str3, namespace) {
|
|
@@ -24805,7 +24805,7 @@ var require_depd = __commonJS({
|
|
|
24805
24805
|
var callSite = site.callSite;
|
|
24806
24806
|
var funcName = site.name;
|
|
24807
24807
|
if (!funcName) {
|
|
24808
|
-
funcName = "<anonymous@" +
|
|
24808
|
+
funcName = "<anonymous@" + formatLocation2(site) + ">";
|
|
24809
24809
|
}
|
|
24810
24810
|
var context2 = callSite.getThis();
|
|
24811
24811
|
var typeName = context2 && callSite.getTypeName();
|
|
@@ -24827,7 +24827,7 @@ var require_depd = __commonJS({
|
|
|
24827
24827
|
return formatted;
|
|
24828
24828
|
}
|
|
24829
24829
|
if (caller) {
|
|
24830
|
-
formatted += " at " +
|
|
24830
|
+
formatted += " at " + formatLocation2(caller);
|
|
24831
24831
|
}
|
|
24832
24832
|
return formatted;
|
|
24833
24833
|
}
|
|
@@ -24840,12 +24840,12 @@ var require_depd = __commonJS({
|
|
|
24840
24840
|
return formatted;
|
|
24841
24841
|
}
|
|
24842
24842
|
if (caller) {
|
|
24843
|
-
formatted += " \x1B[36m" +
|
|
24843
|
+
formatted += " \x1B[36m" + formatLocation2(caller) + "\x1B[39m";
|
|
24844
24844
|
}
|
|
24845
24845
|
return formatted;
|
|
24846
24846
|
}
|
|
24847
|
-
function
|
|
24848
|
-
return
|
|
24847
|
+
function formatLocation2(callSite) {
|
|
24848
|
+
return relative9(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2];
|
|
24849
24849
|
}
|
|
24850
24850
|
function getStack() {
|
|
24851
24851
|
var limit = Error.stackTraceLimit;
|
|
@@ -43048,8 +43048,8 @@ var require_view = __commonJS({
|
|
|
43048
43048
|
var debug = require_src()("express:view");
|
|
43049
43049
|
var path63 = require("node:path");
|
|
43050
43050
|
var fs78 = require("node:fs");
|
|
43051
|
-
var
|
|
43052
|
-
var
|
|
43051
|
+
var dirname23 = path63.dirname;
|
|
43052
|
+
var basename19 = path63.basename;
|
|
43053
43053
|
var extname7 = path63.extname;
|
|
43054
43054
|
var join68 = path63.join;
|
|
43055
43055
|
var resolve19 = path63.resolve;
|
|
@@ -43087,8 +43087,8 @@ var require_view = __commonJS({
|
|
|
43087
43087
|
for (var i = 0; i < roots.length && !path64; i++) {
|
|
43088
43088
|
var root = roots[i];
|
|
43089
43089
|
var loc = resolve19(root, name);
|
|
43090
|
-
var dir =
|
|
43091
|
-
var file2 =
|
|
43090
|
+
var dir = dirname23(loc);
|
|
43091
|
+
var file2 = basename19(loc);
|
|
43092
43092
|
path64 = this.resolve(dir, file2);
|
|
43093
43093
|
}
|
|
43094
43094
|
return path64;
|
|
@@ -43118,7 +43118,7 @@ var require_view = __commonJS({
|
|
|
43118
43118
|
if (stat10 && stat10.isFile()) {
|
|
43119
43119
|
return path64;
|
|
43120
43120
|
}
|
|
43121
|
-
path64 = join68(dir,
|
|
43121
|
+
path64 = join68(dir, basename19(file2, ext), "index" + ext);
|
|
43122
43122
|
stat10 = tryStat(path64);
|
|
43123
43123
|
if (stat10 && stat10.isFile()) {
|
|
43124
43124
|
return path64;
|
|
@@ -75576,7 +75576,7 @@ var require_send = __commonJS({
|
|
|
75576
75576
|
var join68 = path63.join;
|
|
75577
75577
|
var normalize = path63.normalize;
|
|
75578
75578
|
var resolve19 = path63.resolve;
|
|
75579
|
-
var
|
|
75579
|
+
var sep10 = path63.sep;
|
|
75580
75580
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
75581
75581
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1e3;
|
|
75582
75582
|
var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
|
|
@@ -75737,14 +75737,14 @@ var require_send = __commonJS({
|
|
|
75737
75737
|
var parts2;
|
|
75738
75738
|
if (root !== null) {
|
|
75739
75739
|
if (path64) {
|
|
75740
|
-
path64 = normalize("." +
|
|
75740
|
+
path64 = normalize("." + sep10 + path64);
|
|
75741
75741
|
}
|
|
75742
75742
|
if (UP_PATH_REGEXP.test(path64)) {
|
|
75743
75743
|
debug('malicious path "%s"', path64);
|
|
75744
75744
|
this.error(403);
|
|
75745
75745
|
return res;
|
|
75746
75746
|
}
|
|
75747
|
-
parts2 = path64.split(
|
|
75747
|
+
parts2 = path64.split(sep10);
|
|
75748
75748
|
path64 = normalize(join68(root, path64));
|
|
75749
75749
|
} else {
|
|
75750
75750
|
if (UP_PATH_REGEXP.test(path64)) {
|
|
@@ -75752,7 +75752,7 @@ var require_send = __commonJS({
|
|
|
75752
75752
|
this.error(403);
|
|
75753
75753
|
return res;
|
|
75754
75754
|
}
|
|
75755
|
-
parts2 = normalize(path64).split(
|
|
75755
|
+
parts2 = normalize(path64).split(sep10);
|
|
75756
75756
|
path64 = resolve19(path64);
|
|
75757
75757
|
}
|
|
75758
75758
|
if (containsDotFile(parts2)) {
|
|
@@ -75846,7 +75846,7 @@ var require_send = __commonJS({
|
|
|
75846
75846
|
var self2 = this;
|
|
75847
75847
|
debug('stat "%s"', path64);
|
|
75848
75848
|
fs78.stat(path64, function onstat(err, stat10) {
|
|
75849
|
-
var pathEndsWithSep = path64[path64.length - 1] ===
|
|
75849
|
+
var pathEndsWithSep = path64[path64.length - 1] === sep10;
|
|
75850
75850
|
if (err && err.code === "ENOENT" && !extname7(path64) && !pathEndsWithSep) {
|
|
75851
75851
|
return next(err);
|
|
75852
75852
|
}
|
|
@@ -76132,7 +76132,7 @@ var require_response = __commonJS({
|
|
|
76132
76132
|
var send = require_send();
|
|
76133
76133
|
var extname7 = path63.extname;
|
|
76134
76134
|
var resolve19 = path63.resolve;
|
|
76135
|
-
var
|
|
76135
|
+
var basename19 = path63.basename;
|
|
76136
76136
|
var vary = require_vary();
|
|
76137
76137
|
var { Buffer: Buffer2 } = require("node:buffer");
|
|
76138
76138
|
var res = Object.create(http6.ServerResponse.prototype);
|
|
@@ -76323,7 +76323,7 @@ var require_response = __commonJS({
|
|
|
76323
76323
|
opts = filename;
|
|
76324
76324
|
}
|
|
76325
76325
|
var headers = {
|
|
76326
|
-
"Content-Disposition": contentDisposition.create(
|
|
76326
|
+
"Content-Disposition": contentDisposition.create(basename19(name || path64))
|
|
76327
76327
|
};
|
|
76328
76328
|
if (opts && opts.headers) {
|
|
76329
76329
|
var keys = Object.keys(opts.headers);
|
|
@@ -76366,7 +76366,7 @@ var require_response = __commonJS({
|
|
|
76366
76366
|
return this;
|
|
76367
76367
|
};
|
|
76368
76368
|
res.attachment = function attachment(filename) {
|
|
76369
|
-
const name = filename !== void 0 ?
|
|
76369
|
+
const name = filename !== void 0 ? basename19(filename) : void 0;
|
|
76370
76370
|
if (name) {
|
|
76371
76371
|
this.type(extname7(name));
|
|
76372
76372
|
}
|
|
@@ -86684,20 +86684,20 @@ var require_ncp = __commonJS({
|
|
|
86684
86684
|
}
|
|
86685
86685
|
function onLink(link) {
|
|
86686
86686
|
var target = link.replace(currentPath, targetPath);
|
|
86687
|
-
fs78.readlink(link, function(err,
|
|
86687
|
+
fs78.readlink(link, function(err, resolvedPath2) {
|
|
86688
86688
|
if (err) {
|
|
86689
86689
|
return onError(err);
|
|
86690
86690
|
}
|
|
86691
|
-
checkLink(
|
|
86691
|
+
checkLink(resolvedPath2, target);
|
|
86692
86692
|
});
|
|
86693
86693
|
}
|
|
86694
|
-
function checkLink(
|
|
86694
|
+
function checkLink(resolvedPath2, target) {
|
|
86695
86695
|
if (dereference) {
|
|
86696
|
-
|
|
86696
|
+
resolvedPath2 = path63.resolve(basePath, resolvedPath2);
|
|
86697
86697
|
}
|
|
86698
86698
|
isWritable2(target, function(writable) {
|
|
86699
86699
|
if (writable) {
|
|
86700
|
-
return makeLink(
|
|
86700
|
+
return makeLink(resolvedPath2, target);
|
|
86701
86701
|
}
|
|
86702
86702
|
fs78.readlink(target, function(err, targetDest) {
|
|
86703
86703
|
if (err) {
|
|
@@ -86706,11 +86706,11 @@ var require_ncp = __commonJS({
|
|
|
86706
86706
|
if (dereference) {
|
|
86707
86707
|
targetDest = path63.resolve(basePath, targetDest);
|
|
86708
86708
|
}
|
|
86709
|
-
if (targetDest ===
|
|
86709
|
+
if (targetDest === resolvedPath2) {
|
|
86710
86710
|
return cb();
|
|
86711
86711
|
}
|
|
86712
86712
|
return rmFile(target, function() {
|
|
86713
|
-
makeLink(
|
|
86713
|
+
makeLink(resolvedPath2, target);
|
|
86714
86714
|
});
|
|
86715
86715
|
});
|
|
86716
86716
|
});
|
|
@@ -87691,7 +87691,7 @@ var require_common2 = __commonJS({
|
|
|
87691
87691
|
}
|
|
87692
87692
|
var path63 = require("path");
|
|
87693
87693
|
var minimatch = require_minimatch();
|
|
87694
|
-
var
|
|
87694
|
+
var isAbsolute13 = require_path_is_absolute();
|
|
87695
87695
|
var Minimatch = minimatch.Minimatch;
|
|
87696
87696
|
function alphasorti(a, b) {
|
|
87697
87697
|
return a.toLowerCase().localeCompare(b.toLowerCase());
|
|
@@ -87834,7 +87834,7 @@ var require_common2 = __commonJS({
|
|
|
87834
87834
|
var abs = f;
|
|
87835
87835
|
if (f.charAt(0) === "/") {
|
|
87836
87836
|
abs = path63.join(self2.root, f);
|
|
87837
|
-
} else if (
|
|
87837
|
+
} else if (isAbsolute13(f) || f === "") {
|
|
87838
87838
|
abs = f;
|
|
87839
87839
|
} else if (self2.changedCwd) {
|
|
87840
87840
|
abs = path63.resolve(self2.cwd, f);
|
|
@@ -87872,7 +87872,7 @@ var require_sync = __commonJS({
|
|
|
87872
87872
|
var util = require("util");
|
|
87873
87873
|
var path63 = require("path");
|
|
87874
87874
|
var assert2 = require("assert");
|
|
87875
|
-
var
|
|
87875
|
+
var isAbsolute13 = require_path_is_absolute();
|
|
87876
87876
|
var common = require_common2();
|
|
87877
87877
|
var alphasort = common.alphasort;
|
|
87878
87878
|
var alphasorti = common.alphasorti;
|
|
@@ -87946,8 +87946,8 @@ var require_sync = __commonJS({
|
|
|
87946
87946
|
var read;
|
|
87947
87947
|
if (prefix === null)
|
|
87948
87948
|
read = ".";
|
|
87949
|
-
else if (
|
|
87950
|
-
if (!prefix || !
|
|
87949
|
+
else if (isAbsolute13(prefix) || isAbsolute13(pattern.join("/"))) {
|
|
87950
|
+
if (!prefix || !isAbsolute13(prefix))
|
|
87951
87951
|
prefix = "/" + prefix;
|
|
87952
87952
|
read = prefix;
|
|
87953
87953
|
} else
|
|
@@ -88132,7 +88132,7 @@ var require_sync = __commonJS({
|
|
|
88132
88132
|
this.matches[index] = /* @__PURE__ */ Object.create(null);
|
|
88133
88133
|
if (!exists3)
|
|
88134
88134
|
return;
|
|
88135
|
-
if (prefix &&
|
|
88135
|
+
if (prefix && isAbsolute13(prefix) && !this.nomount) {
|
|
88136
88136
|
var trail = /[\/\\]$/.test(prefix);
|
|
88137
88137
|
if (prefix.charAt(0) === "/") {
|
|
88138
88138
|
prefix = path63.join(this.root, prefix);
|
|
@@ -88252,7 +88252,7 @@ var require_glob = __commonJS({
|
|
|
88252
88252
|
var EE = require("events").EventEmitter;
|
|
88253
88253
|
var path63 = require("path");
|
|
88254
88254
|
var assert2 = require("assert");
|
|
88255
|
-
var
|
|
88255
|
+
var isAbsolute13 = require_path_is_absolute();
|
|
88256
88256
|
var globSync = require_sync();
|
|
88257
88257
|
var common = require_common2();
|
|
88258
88258
|
var alphasort = common.alphasort;
|
|
@@ -88466,8 +88466,8 @@ var require_glob = __commonJS({
|
|
|
88466
88466
|
var read;
|
|
88467
88467
|
if (prefix === null)
|
|
88468
88468
|
read = ".";
|
|
88469
|
-
else if (
|
|
88470
|
-
if (!prefix || !
|
|
88469
|
+
else if (isAbsolute13(prefix) || isAbsolute13(pattern.join("/"))) {
|
|
88470
|
+
if (!prefix || !isAbsolute13(prefix))
|
|
88471
88471
|
prefix = "/" + prefix;
|
|
88472
88472
|
read = prefix;
|
|
88473
88473
|
} else
|
|
@@ -88699,7 +88699,7 @@ var require_glob = __commonJS({
|
|
|
88699
88699
|
this.matches[index] = /* @__PURE__ */ Object.create(null);
|
|
88700
88700
|
if (!exists3)
|
|
88701
88701
|
return cb();
|
|
88702
|
-
if (prefix &&
|
|
88702
|
+
if (prefix && isAbsolute13(prefix) && !this.nomount) {
|
|
88703
88703
|
var trail = /[\/\\]$/.test(prefix);
|
|
88704
88704
|
if (prefix.charAt(0) === "/") {
|
|
88705
88705
|
prefix = path63.join(this.root, prefix);
|
|
@@ -94322,10 +94322,10 @@ var require_resolve_block_map = __commonJS({
|
|
|
94322
94322
|
let offset = bm.offset;
|
|
94323
94323
|
let commentEnd = null;
|
|
94324
94324
|
for (const collItem of bm.items) {
|
|
94325
|
-
const { start: start2, key: key2, sep:
|
|
94325
|
+
const { start: start2, key: key2, sep: sep10, value } = collItem;
|
|
94326
94326
|
const keyProps = resolveProps.resolveProps(start2, {
|
|
94327
94327
|
indicator: "explicit-key-ind",
|
|
94328
|
-
next: key2 ??
|
|
94328
|
+
next: key2 ?? sep10?.[0],
|
|
94329
94329
|
offset,
|
|
94330
94330
|
onError,
|
|
94331
94331
|
parentIndent: bm.indent,
|
|
@@ -94339,7 +94339,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
94339
94339
|
else if ("indent" in key2 && key2.indent !== bm.indent)
|
|
94340
94340
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
94341
94341
|
}
|
|
94342
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
94342
|
+
if (!keyProps.anchor && !keyProps.tag && !sep10) {
|
|
94343
94343
|
commentEnd = keyProps.end;
|
|
94344
94344
|
if (keyProps.comment) {
|
|
94345
94345
|
if (map2.comment)
|
|
@@ -94363,7 +94363,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
94363
94363
|
ctx.atKey = false;
|
|
94364
94364
|
if (utilMapIncludes.mapIncludes(ctx, map2.items, keyNode))
|
|
94365
94365
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
94366
|
-
const valueProps = resolveProps.resolveProps(
|
|
94366
|
+
const valueProps = resolveProps.resolveProps(sep10 ?? [], {
|
|
94367
94367
|
indicator: "map-value-ind",
|
|
94368
94368
|
next: value,
|
|
94369
94369
|
offset: keyNode.range[2],
|
|
@@ -94379,7 +94379,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
94379
94379
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
94380
94380
|
onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
94381
94381
|
}
|
|
94382
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset,
|
|
94382
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep10, null, valueProps, onError);
|
|
94383
94383
|
if (ctx.schema.compat)
|
|
94384
94384
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
94385
94385
|
offset = valueNode.range[2];
|
|
@@ -94470,7 +94470,7 @@ var require_resolve_end = __commonJS({
|
|
|
94470
94470
|
let comment = "";
|
|
94471
94471
|
if (end) {
|
|
94472
94472
|
let hasSpace = false;
|
|
94473
|
-
let
|
|
94473
|
+
let sep10 = "";
|
|
94474
94474
|
for (const token of end) {
|
|
94475
94475
|
const { source, type } = token;
|
|
94476
94476
|
switch (type) {
|
|
@@ -94484,13 +94484,13 @@ var require_resolve_end = __commonJS({
|
|
|
94484
94484
|
if (!comment)
|
|
94485
94485
|
comment = cb;
|
|
94486
94486
|
else
|
|
94487
|
-
comment +=
|
|
94488
|
-
|
|
94487
|
+
comment += sep10 + cb;
|
|
94488
|
+
sep10 = "";
|
|
94489
94489
|
break;
|
|
94490
94490
|
}
|
|
94491
94491
|
case "newline":
|
|
94492
94492
|
if (comment)
|
|
94493
|
-
|
|
94493
|
+
sep10 += source;
|
|
94494
94494
|
hasSpace = true;
|
|
94495
94495
|
break;
|
|
94496
94496
|
default:
|
|
@@ -94533,18 +94533,18 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
94533
94533
|
let offset = fc.offset + fc.start.source.length;
|
|
94534
94534
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
94535
94535
|
const collItem = fc.items[i];
|
|
94536
|
-
const { start: start2, key: key2, sep:
|
|
94536
|
+
const { start: start2, key: key2, sep: sep10, value } = collItem;
|
|
94537
94537
|
const props = resolveProps.resolveProps(start2, {
|
|
94538
94538
|
flow: fcName,
|
|
94539
94539
|
indicator: "explicit-key-ind",
|
|
94540
|
-
next: key2 ??
|
|
94540
|
+
next: key2 ?? sep10?.[0],
|
|
94541
94541
|
offset,
|
|
94542
94542
|
onError,
|
|
94543
94543
|
parentIndent: fc.indent,
|
|
94544
94544
|
startOnNewline: false
|
|
94545
94545
|
});
|
|
94546
94546
|
if (!props.found) {
|
|
94547
|
-
if (!props.anchor && !props.tag && !
|
|
94547
|
+
if (!props.anchor && !props.tag && !sep10 && !value) {
|
|
94548
94548
|
if (i === 0 && props.comma)
|
|
94549
94549
|
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
94550
94550
|
else if (i < fc.items.length - 1)
|
|
@@ -94598,8 +94598,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
94598
94598
|
}
|
|
94599
94599
|
}
|
|
94600
94600
|
}
|
|
94601
|
-
if (!isMap && !
|
|
94602
|
-
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end,
|
|
94601
|
+
if (!isMap && !sep10 && !props.found) {
|
|
94602
|
+
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep10, null, props, onError);
|
|
94603
94603
|
coll.items.push(valueNode);
|
|
94604
94604
|
offset = valueNode.range[2];
|
|
94605
94605
|
if (isBlock(value))
|
|
@@ -94611,7 +94611,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
94611
94611
|
if (isBlock(key2))
|
|
94612
94612
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
94613
94613
|
ctx.atKey = false;
|
|
94614
|
-
const valueProps = resolveProps.resolveProps(
|
|
94614
|
+
const valueProps = resolveProps.resolveProps(sep10 ?? [], {
|
|
94615
94615
|
flow: fcName,
|
|
94616
94616
|
indicator: "map-value-ind",
|
|
94617
94617
|
next: value,
|
|
@@ -94622,8 +94622,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
94622
94622
|
});
|
|
94623
94623
|
if (valueProps.found) {
|
|
94624
94624
|
if (!isMap && !props.found && ctx.options.strict) {
|
|
94625
|
-
if (
|
|
94626
|
-
for (const st of
|
|
94625
|
+
if (sep10)
|
|
94626
|
+
for (const st of sep10) {
|
|
94627
94627
|
if (st === valueProps.found)
|
|
94628
94628
|
break;
|
|
94629
94629
|
if (st.type === "newline") {
|
|
@@ -94640,7 +94640,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
94640
94640
|
else
|
|
94641
94641
|
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
94642
94642
|
}
|
|
94643
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
94643
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep10, null, valueProps, onError) : null;
|
|
94644
94644
|
if (valueNode) {
|
|
94645
94645
|
if (isBlock(value))
|
|
94646
94646
|
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -94820,7 +94820,7 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
94820
94820
|
chompStart = i + 1;
|
|
94821
94821
|
}
|
|
94822
94822
|
let value = "";
|
|
94823
|
-
let
|
|
94823
|
+
let sep10 = "";
|
|
94824
94824
|
let prevMoreIndented = false;
|
|
94825
94825
|
for (let i = 0; i < contentStart; ++i)
|
|
94826
94826
|
value += lines[i][0].slice(trimIndent) + "\n";
|
|
@@ -94837,24 +94837,24 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
94837
94837
|
indent = "";
|
|
94838
94838
|
}
|
|
94839
94839
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
94840
|
-
value +=
|
|
94841
|
-
|
|
94840
|
+
value += sep10 + indent.slice(trimIndent) + content;
|
|
94841
|
+
sep10 = "\n";
|
|
94842
94842
|
} else if (indent.length > trimIndent || content[0] === " ") {
|
|
94843
|
-
if (
|
|
94844
|
-
|
|
94845
|
-
else if (!prevMoreIndented &&
|
|
94846
|
-
|
|
94847
|
-
value +=
|
|
94848
|
-
|
|
94843
|
+
if (sep10 === " ")
|
|
94844
|
+
sep10 = "\n";
|
|
94845
|
+
else if (!prevMoreIndented && sep10 === "\n")
|
|
94846
|
+
sep10 = "\n\n";
|
|
94847
|
+
value += sep10 + indent.slice(trimIndent) + content;
|
|
94848
|
+
sep10 = "\n";
|
|
94849
94849
|
prevMoreIndented = true;
|
|
94850
94850
|
} else if (content === "") {
|
|
94851
|
-
if (
|
|
94851
|
+
if (sep10 === "\n")
|
|
94852
94852
|
value += "\n";
|
|
94853
94853
|
else
|
|
94854
|
-
|
|
94854
|
+
sep10 = "\n";
|
|
94855
94855
|
} else {
|
|
94856
|
-
value +=
|
|
94857
|
-
|
|
94856
|
+
value += sep10 + content;
|
|
94857
|
+
sep10 = " ";
|
|
94858
94858
|
prevMoreIndented = false;
|
|
94859
94859
|
}
|
|
94860
94860
|
}
|
|
@@ -95037,25 +95037,25 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
95037
95037
|
trimBoth = /^[ \t]+|[ \t]+$/g;
|
|
95038
95038
|
}
|
|
95039
95039
|
let res = match[1].replace(trimEnd, "");
|
|
95040
|
-
let
|
|
95040
|
+
let sep10 = " ";
|
|
95041
95041
|
let pos = line.lastIndex;
|
|
95042
95042
|
while (match = line.exec(source)) {
|
|
95043
95043
|
const lm = match[1].replace(trimBoth, "");
|
|
95044
95044
|
if (lm === "") {
|
|
95045
|
-
if (
|
|
95046
|
-
res +=
|
|
95045
|
+
if (sep10 === "\n")
|
|
95046
|
+
res += sep10;
|
|
95047
95047
|
else
|
|
95048
|
-
|
|
95048
|
+
sep10 = "\n";
|
|
95049
95049
|
} else {
|
|
95050
|
-
res +=
|
|
95051
|
-
|
|
95050
|
+
res += sep10 + lm;
|
|
95051
|
+
sep10 = " ";
|
|
95052
95052
|
}
|
|
95053
95053
|
pos = line.lastIndex;
|
|
95054
95054
|
}
|
|
95055
95055
|
const last = /[ \t]*(.*)/sy;
|
|
95056
95056
|
last.lastIndex = pos;
|
|
95057
95057
|
match = last.exec(source);
|
|
95058
|
-
return res +
|
|
95058
|
+
return res + sep10 + (match?.[1] ?? "");
|
|
95059
95059
|
}
|
|
95060
95060
|
function doubleQuotedValue(source, onError) {
|
|
95061
95061
|
let res = "";
|
|
@@ -95865,14 +95865,14 @@ var require_cst_stringify = __commonJS({
|
|
|
95865
95865
|
}
|
|
95866
95866
|
}
|
|
95867
95867
|
}
|
|
95868
|
-
function stringifyItem({ start: start2, key: key2, sep:
|
|
95868
|
+
function stringifyItem({ start: start2, key: key2, sep: sep10, value }) {
|
|
95869
95869
|
let res = "";
|
|
95870
95870
|
for (const st of start2)
|
|
95871
95871
|
res += st.source;
|
|
95872
95872
|
if (key2)
|
|
95873
95873
|
res += stringifyToken(key2);
|
|
95874
|
-
if (
|
|
95875
|
-
for (const st of
|
|
95874
|
+
if (sep10)
|
|
95875
|
+
for (const st of sep10)
|
|
95876
95876
|
res += st.source;
|
|
95877
95877
|
if (value)
|
|
95878
95878
|
res += stringifyToken(value);
|
|
@@ -97039,18 +97039,18 @@ var require_parser2 = __commonJS({
|
|
|
97039
97039
|
if (this.type === "map-value-ind") {
|
|
97040
97040
|
const prev = getPrevProps(this.peek(2));
|
|
97041
97041
|
const start2 = getFirstKeyStartProps(prev);
|
|
97042
|
-
let
|
|
97042
|
+
let sep10;
|
|
97043
97043
|
if (scalar.end) {
|
|
97044
|
-
|
|
97045
|
-
|
|
97044
|
+
sep10 = scalar.end;
|
|
97045
|
+
sep10.push(this.sourceToken);
|
|
97046
97046
|
delete scalar.end;
|
|
97047
97047
|
} else
|
|
97048
|
-
|
|
97048
|
+
sep10 = [this.sourceToken];
|
|
97049
97049
|
const map2 = {
|
|
97050
97050
|
type: "block-map",
|
|
97051
97051
|
offset: scalar.offset,
|
|
97052
97052
|
indent: scalar.indent,
|
|
97053
|
-
items: [{ start: start2, key: scalar, sep:
|
|
97053
|
+
items: [{ start: start2, key: scalar, sep: sep10 }]
|
|
97054
97054
|
};
|
|
97055
97055
|
this.onKeyLine = true;
|
|
97056
97056
|
this.stack[this.stack.length - 1] = map2;
|
|
@@ -97203,15 +97203,15 @@ var require_parser2 = __commonJS({
|
|
|
97203
97203
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
97204
97204
|
const start3 = getFirstKeyStartProps(it.start);
|
|
97205
97205
|
const key2 = it.key;
|
|
97206
|
-
const
|
|
97207
|
-
|
|
97206
|
+
const sep10 = it.sep;
|
|
97207
|
+
sep10.push(this.sourceToken);
|
|
97208
97208
|
delete it.key;
|
|
97209
97209
|
delete it.sep;
|
|
97210
97210
|
this.stack.push({
|
|
97211
97211
|
type: "block-map",
|
|
97212
97212
|
offset: this.offset,
|
|
97213
97213
|
indent: this.indent,
|
|
97214
|
-
items: [{ start: start3, key: key2, sep:
|
|
97214
|
+
items: [{ start: start3, key: key2, sep: sep10 }]
|
|
97215
97215
|
});
|
|
97216
97216
|
} else if (start2.length > 0) {
|
|
97217
97217
|
it.sep = it.sep.concat(start2, this.sourceToken);
|
|
@@ -97405,13 +97405,13 @@ var require_parser2 = __commonJS({
|
|
|
97405
97405
|
const prev = getPrevProps(parent);
|
|
97406
97406
|
const start2 = getFirstKeyStartProps(prev);
|
|
97407
97407
|
fixFlowSeqItems(fc);
|
|
97408
|
-
const
|
|
97409
|
-
|
|
97408
|
+
const sep10 = fc.end.splice(1, fc.end.length);
|
|
97409
|
+
sep10.push(this.sourceToken);
|
|
97410
97410
|
const map2 = {
|
|
97411
97411
|
type: "block-map",
|
|
97412
97412
|
offset: fc.offset,
|
|
97413
97413
|
indent: fc.indent,
|
|
97414
|
-
items: [{ start: start2, key: fc, sep:
|
|
97414
|
+
items: [{ start: start2, key: fc, sep: sep10 }]
|
|
97415
97415
|
};
|
|
97416
97416
|
this.onKeyLine = true;
|
|
97417
97417
|
this.stack[this.stack.length - 1] = map2;
|
|
@@ -101252,7 +101252,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
101252
101252
|
var SESSION_ID = (0, import_node_crypto3.randomUUID)();
|
|
101253
101253
|
function readCliVersion() {
|
|
101254
101254
|
if (true) {
|
|
101255
|
-
return "0.32.1-next.
|
|
101255
|
+
return "0.32.1-next.17";
|
|
101256
101256
|
}
|
|
101257
101257
|
return "0.0.0";
|
|
101258
101258
|
}
|
|
@@ -102534,9 +102534,9 @@ async function isExecutable2(p) {
|
|
|
102534
102534
|
return false;
|
|
102535
102535
|
}
|
|
102536
102536
|
}
|
|
102537
|
-
async function resolveDevecoBinary(
|
|
102537
|
+
async function resolveDevecoBinary(relative9) {
|
|
102538
102538
|
for (const root of devecoRoots()) {
|
|
102539
|
-
const candidate = (0, import_node_path6.join)(root,
|
|
102539
|
+
const candidate = (0, import_node_path6.join)(root, relative9) + BIN_EXT2;
|
|
102540
102540
|
if (await isExecutable2(candidate)) return candidate;
|
|
102541
102541
|
}
|
|
102542
102542
|
return null;
|
|
@@ -103045,7 +103045,14 @@ function loadSuppressUntil() {
|
|
|
103045
103045
|
function persistSuppressUntil(value) {
|
|
103046
103046
|
const filePath = getSuppressionFilePath();
|
|
103047
103047
|
import_node_fs5.default.mkdirSync(import_node_path8.default.dirname(filePath), { recursive: true });
|
|
103048
|
-
|
|
103048
|
+
const tempPath = `${filePath}.${process.pid}.tmp`;
|
|
103049
|
+
try {
|
|
103050
|
+
import_node_fs5.default.writeFileSync(tempPath, JSON.stringify({ suppressUntil: value }));
|
|
103051
|
+
import_node_fs5.default.renameSync(tempPath, filePath);
|
|
103052
|
+
} catch (error63) {
|
|
103053
|
+
import_node_fs5.default.rmSync(tempPath, { force: true });
|
|
103054
|
+
throw error63;
|
|
103055
|
+
}
|
|
103049
103056
|
}
|
|
103050
103057
|
var state2 = {
|
|
103051
103058
|
updateAvailable: false,
|
|
@@ -103057,17 +103064,23 @@ var state2 = {
|
|
|
103057
103064
|
currentVersion: version2
|
|
103058
103065
|
};
|
|
103059
103066
|
var interval = null;
|
|
103060
|
-
var
|
|
103067
|
+
var unpersistedUntil = 0;
|
|
103061
103068
|
function getUpdateState() {
|
|
103062
103069
|
return { ...state2 };
|
|
103063
103070
|
}
|
|
103064
103071
|
function isUpdateNoteSuppressed() {
|
|
103065
|
-
return Date.now() <
|
|
103072
|
+
return Date.now() < Math.max(loadSuppressUntil(), unpersistedUntil);
|
|
103066
103073
|
}
|
|
103067
103074
|
function suppressUpdateNote(durationMs) {
|
|
103068
|
-
const
|
|
103069
|
-
|
|
103070
|
-
|
|
103075
|
+
const until = Date.now() + durationMs;
|
|
103076
|
+
try {
|
|
103077
|
+
persistSuppressUntil(until);
|
|
103078
|
+
unpersistedUntil = 0;
|
|
103079
|
+
return { until, persisted: true };
|
|
103080
|
+
} catch {
|
|
103081
|
+
unpersistedUntil = until;
|
|
103082
|
+
return { until, persisted: false };
|
|
103083
|
+
}
|
|
103071
103084
|
}
|
|
103072
103085
|
function isNewerVersion(latest, current) {
|
|
103073
103086
|
if (!import_semver2.default.valid(latest) || !import_semver2.default.valid(current)) return false;
|
|
@@ -103129,11 +103142,9 @@ IMPORTANT \u2014 Updates must only be applied with the user's explicit, informed
|
|
|
103129
103142
|
How to update:
|
|
103130
103143
|
- Manual (user-initiated): run \`npx @swmansion/argent update\` in the terminal
|
|
103131
103144
|
- Agent-assisted (requires explicit user consent): call the \`update-argent\` tool \u2014 only after the user has explicitly asked you to update Argent in this conversation
|
|
103132
|
-
- To postpone
|
|
103133
|
-
|
|
103134
|
-
ACTION REQUIRED: Save a note (via TODO, task list) that an Argent update to v${latestVersion} is available so you can remind the user about it later. This notification will not repeat for the next 30 minutes.
|
|
103145
|
+
- To postpone it (later, tomorrow, stop, never): call the \`dismiss-update\` tool with the hours to wait, 87600 for never. That is the only thing that changes when this reminder appears; a memory or a reminder of your own does not
|
|
103135
103146
|
|
|
103136
|
-
|
|
103147
|
+
This reminder comes from Argent itself. It will not repeat for the next 30 minutes and then repeats on its own, so it needs no task, memory entry or scheduled reminder.`;
|
|
103137
103148
|
}
|
|
103138
103149
|
|
|
103139
103150
|
// ../tool-server/src/utils/screen-recording-reminder.ts
|
|
@@ -128074,11 +128085,11 @@ function parseVegaDeviceList(stdout) {
|
|
|
128074
128085
|
const devices = [];
|
|
128075
128086
|
for (const raw of stdout.split("\n")) {
|
|
128076
128087
|
const line = raw.trim();
|
|
128077
|
-
const
|
|
128078
|
-
if (
|
|
128079
|
-
const type = line.slice(0,
|
|
128088
|
+
const sep10 = line.indexOf(" : ");
|
|
128089
|
+
if (sep10 < 0) continue;
|
|
128090
|
+
const type = line.slice(0, sep10).trim();
|
|
128080
128091
|
if (!/^[A-Za-z]+$/.test(type)) continue;
|
|
128081
|
-
const rhs = line.slice(
|
|
128092
|
+
const rhs = line.slice(sep10 + 3).trim();
|
|
128082
128093
|
const parts2 = rhs.split(/\s+-\s+/);
|
|
128083
128094
|
const serial = parts2[parts2.length - 1]?.trim();
|
|
128084
128095
|
if (!serial) continue;
|
|
@@ -131394,12 +131405,12 @@ function isSafeTarMember(memberPath2, destDir) {
|
|
|
131394
131405
|
const normalized = normalizeTarMemberPath(memberPath2);
|
|
131395
131406
|
if (!normalized || normalized === "." || normalized === "./") return false;
|
|
131396
131407
|
if (normalized.startsWith("/") || /^[A-Za-z]:[\\/]/.test(normalized)) return false;
|
|
131397
|
-
const
|
|
131398
|
-
if (
|
|
131408
|
+
const relative9 = import_node_path12.posix.normalize(normalized);
|
|
131409
|
+
if (relative9 === ".." || relative9.startsWith("../") || relative9.split("/").includes("..")) {
|
|
131399
131410
|
return false;
|
|
131400
131411
|
}
|
|
131401
131412
|
const root = (0, import_node_path12.resolve)(destDir);
|
|
131402
|
-
const resolved = (0, import_node_path12.resolve)(destDir,
|
|
131413
|
+
const resolved = (0, import_node_path12.resolve)(destDir, relative9);
|
|
131403
131414
|
return resolved === root || resolved.startsWith(root + import_node_path12.sep);
|
|
131404
131415
|
}
|
|
131405
131416
|
async function listTarMembers(tarPath) {
|
|
@@ -137885,21 +137896,21 @@ var Matcher = class {
|
|
|
137885
137896
|
* @returns {string}
|
|
137886
137897
|
*/
|
|
137887
137898
|
toString(separator, includeNamespace = true) {
|
|
137888
|
-
const
|
|
137889
|
-
const isDefault =
|
|
137899
|
+
const sep10 = separator || this.separator;
|
|
137900
|
+
const isDefault = sep10 === this.separator && includeNamespace === true;
|
|
137890
137901
|
if (isDefault) {
|
|
137891
137902
|
if (this._pathStringCache !== null) {
|
|
137892
137903
|
return this._pathStringCache;
|
|
137893
137904
|
}
|
|
137894
137905
|
const result = this.path.map(
|
|
137895
137906
|
(n) => n.namespace ? `${n.namespace}:${n.tag}` : n.tag
|
|
137896
|
-
).join(
|
|
137907
|
+
).join(sep10);
|
|
137897
137908
|
this._pathStringCache = result;
|
|
137898
137909
|
return result;
|
|
137899
137910
|
}
|
|
137900
137911
|
return this.path.map(
|
|
137901
137912
|
(n) => includeNamespace && n.namespace ? `${n.namespace}:${n.tag}` : n.tag
|
|
137902
|
-
).join(
|
|
137913
|
+
).join(sep10);
|
|
137903
137914
|
}
|
|
137904
137915
|
/**
|
|
137905
137916
|
* Get path as array of tag names.
|
|
@@ -144152,10 +144163,7 @@ function createHttpApp(registry2, options) {
|
|
|
144152
144163
|
const { updateInstallable, currentVersion, installableVersion } = getUpdateState();
|
|
144153
144164
|
const shouldNotify = updateInstallable && !isUpdateNoteSuppressed();
|
|
144154
144165
|
if (shouldNotify) {
|
|
144155
|
-
|
|
144156
|
-
suppressUpdateNote(AUTO_SUPPRESS_MS);
|
|
144157
|
-
} catch {
|
|
144158
|
-
}
|
|
144166
|
+
suppressUpdateNote(AUTO_SUPPRESS_MS);
|
|
144159
144167
|
}
|
|
144160
144168
|
const notes = shouldNotify ? [buildUpdateNote(currentVersion, installableVersion ?? "unknown")] : [];
|
|
144161
144169
|
const activeRecordings2 = getActiveScreenRecordings();
|
|
@@ -146138,6 +146146,13 @@ Returns { status: "init_failed", message, attempts } instead when the simulator'
|
|
|
146138
146146
|
Fails if the simulator server is not running for the given UDID.`,
|
|
146139
146147
|
zodSchema: zodSchema3,
|
|
146140
146148
|
readOnly: true,
|
|
146149
|
+
// When the app is not connected, the native-* tools that use native devtools
|
|
146150
|
+
// run the same precheck and return the same `message` (buildAppStateMessage),
|
|
146151
|
+
// so agents need no separate status call. Their `status` names the remedy,
|
|
146152
|
+
// where this tool gives `state`. They fail instead for an Apple system app and
|
|
146153
|
+
// for an app that a device provider did not lend. The SDK and the e2e-full
|
|
146154
|
+
// suite still call it.
|
|
146155
|
+
hideFromMcp: true,
|
|
146141
146156
|
interaction: {
|
|
146142
146157
|
startedMsg: ({ params }) => `Checking native inspection for ${params.bundleId}`,
|
|
146143
146158
|
completedMsg: ({ params }) => `Checked native inspection for ${params.bundleId}`,
|
|
@@ -146328,7 +146343,7 @@ On iOS: returns { status, count, events } where each event contains URL, method,
|
|
|
146328
146343
|
<flag:macos-apps>On a Mac app it records NSURLSession requests, react-native-macos fetch included, with the same event fields. The first call turns capture on and earlier requests are not logged: call it once, then repeat the action. Capture stays on across restart-app with an empty log per process, and requests sent while the app starts can be missing. The statuses below are iOS only.
|
|
146329
146344
|
</flag:macos-apps>If status is restart_required: follow the message (usually restart-app), then retry. If status is service_stale: the app is already injected, so restarting it cannot help. Restart the tool-server (\`argent server stop && argent server start --detach\`) and retry. If the same status comes back after that restart, stop restarting: follow the message, which names the terminal fallback. If status is connect_pending: the app is injected and still connecting. Do not restart it, wait a few seconds and retry. If status is init_failed: follow the message (re-boot the simulator) rather than retrying.
|
|
146330
146345
|
On a device whose devtools agent argent attached to rather than armed itself, a not-connected app fails with \`NATIVE_DEVTOOLS_NOT_CONNECTED\` instead of a status, and no restart on argent's side fixes it. An Apple system app is rejected outright (terminal: never retry it).
|
|
146331
|
-
On Android: needs a debuggable build
|
|
146346
|
+
On Android: needs a debuggable build. The first call starts capture and usually returns armed: false. Call it again every few seconds until armed is true, then repeat the action whose requests you need: earlier requests are not captured.
|
|
146332
146347
|
Capture also misses a request already in flight at the attach and requests from clients other than OkHttp (e.g. HttpURLConnection, Cronet); an app whose OkHttp is fully minified reports capture unavailable.
|
|
146333
146348
|
Returns { status, header, armed, capture, captureDetail, count, total, requests }. When capture is active, captureDetail and the header can say that only some requests are captured: then an empty or short list does not mean the app sent nothing. Pass a request's ID (android-3f9a-12) to view-network-request-details for its headers, redirects and bodies.
|
|
146334
146349
|
Capture can slow the app. It stays on, and launch-app and restart-app attach it to each new process, until a call with stop: true turns it off for this app (stop-all-simulator-servers for the device also does); restart-app then starts the app without the agent. stop: true returns { status, stopped, message }, where stopped is false when capture was not on for the app. On iOS stop: true fails: capture there ends only when stop-all-simulator-servers stops this device's services and the app restarts.
|
|
@@ -146770,8 +146785,17 @@ An Apple system app is rejected outright (terminal: never retry it).`,
|
|
|
146770
146785
|
init_src2();
|
|
146771
146786
|
|
|
146772
146787
|
// ../tool-server/src/utils/debugger/discovery.ts
|
|
146788
|
+
var import_node_fs13 = require("node:fs");
|
|
146773
146789
|
init_src2();
|
|
146774
146790
|
var DECOY_VM = "don't use";
|
|
146791
|
+
function decodeProjectRoot(raw) {
|
|
146792
|
+
if (!raw.includes("%") || (0, import_node_fs13.existsSync)(raw)) return raw;
|
|
146793
|
+
try {
|
|
146794
|
+
return decodeURIComponent(raw);
|
|
146795
|
+
} catch {
|
|
146796
|
+
return raw;
|
|
146797
|
+
}
|
|
146798
|
+
}
|
|
146775
146799
|
async function discoverMetro(port) {
|
|
146776
146800
|
let statusRes;
|
|
146777
146801
|
try {
|
|
@@ -146813,7 +146837,7 @@ async function discoverMetro(port) {
|
|
|
146813
146837
|
}
|
|
146814
146838
|
);
|
|
146815
146839
|
}
|
|
146816
|
-
const projectRoot = statusRes.headers.get("X-React-Native-Project-Root") ?? "";
|
|
146840
|
+
const projectRoot = decodeProjectRoot(statusRes.headers.get("X-React-Native-Project-Root") ?? "");
|
|
146817
146841
|
let listRes;
|
|
146818
146842
|
try {
|
|
146819
146843
|
listRes = await fetch(`http://localhost:${port}/json/list`);
|
|
@@ -149421,7 +149445,7 @@ function clearLostProfilerRun(port, deviceId) {
|
|
|
149421
149445
|
|
|
149422
149446
|
// ../tool-server/src/tools/devices/boot-device.ts
|
|
149423
149447
|
var import_node_child_process34 = require("node:child_process");
|
|
149424
|
-
var
|
|
149448
|
+
var import_node_fs15 = require("node:fs");
|
|
149425
149449
|
var import_promises13 = require("node:fs/promises");
|
|
149426
149450
|
var import_node_os14 = require("node:os");
|
|
149427
149451
|
var import_node_path19 = require("node:path");
|
|
@@ -149534,7 +149558,7 @@ function readMb(config2, key2) {
|
|
|
149534
149558
|
|
|
149535
149559
|
// ../tool-server/src/utils/simulator-app-launch.ts
|
|
149536
149560
|
var import_node_child_process32 = require("node:child_process");
|
|
149537
|
-
var
|
|
149561
|
+
var import_node_fs14 = __toESM(require("node:fs"));
|
|
149538
149562
|
var import_node_os13 = __toESM(require("node:os"));
|
|
149539
149563
|
var import_node_path18 = __toESM(require("node:path"));
|
|
149540
149564
|
var import_node_util23 = require("node:util");
|
|
@@ -149548,7 +149572,7 @@ function verdictFilePath() {
|
|
|
149548
149572
|
}
|
|
149549
149573
|
function loadVerdicts() {
|
|
149550
149574
|
try {
|
|
149551
|
-
const parsed = JSON.parse(
|
|
149575
|
+
const parsed = JSON.parse(import_node_fs14.default.readFileSync(verdictFilePath(), "utf8"));
|
|
149552
149576
|
return parsed && typeof parsed === "object" ? parsed : {};
|
|
149553
149577
|
} catch {
|
|
149554
149578
|
return {};
|
|
@@ -149556,13 +149580,13 @@ function loadVerdicts() {
|
|
|
149556
149580
|
}
|
|
149557
149581
|
function persistVerdict(key2, verdict) {
|
|
149558
149582
|
const filePath = verdictFilePath();
|
|
149559
|
-
|
|
149583
|
+
import_node_fs14.default.mkdirSync(import_node_path18.default.dirname(filePath), { recursive: true });
|
|
149560
149584
|
const tmpPath = `${filePath}.${process.pid}.tmp`;
|
|
149561
149585
|
try {
|
|
149562
|
-
|
|
149563
|
-
|
|
149586
|
+
import_node_fs14.default.writeFileSync(tmpPath, JSON.stringify({ ...loadVerdicts(), [key2]: verdict }, null, 2));
|
|
149587
|
+
import_node_fs14.default.renameSync(tmpPath, filePath);
|
|
149564
149588
|
} catch (err) {
|
|
149565
|
-
|
|
149589
|
+
import_node_fs14.default.rmSync(tmpPath, { force: true });
|
|
149566
149590
|
throw err;
|
|
149567
149591
|
}
|
|
149568
149592
|
}
|
|
@@ -150344,9 +150368,9 @@ async function bootIos(udid, registry2, force, headless) {
|
|
|
150344
150368
|
async function openSimulatorWindow(udid) {
|
|
150345
150369
|
const timeout = 5e3;
|
|
150346
150370
|
const { stdout } = await execFileAsync24("xcode-select", ["-p"], { timeout });
|
|
150347
|
-
const developerDir2 = (0,
|
|
150371
|
+
const developerDir2 = (0, import_node_fs15.realpathSync)(stdout.trim());
|
|
150348
150372
|
const simulatorApp = (0, import_node_path19.join)(developerDir2, "Applications", "Simulator.app");
|
|
150349
|
-
if ((0,
|
|
150373
|
+
if ((0, import_node_fs15.existsSync)(simulatorApp)) {
|
|
150350
150374
|
const launched = await launchSimulatorApp(
|
|
150351
150375
|
simulatorApp,
|
|
150352
150376
|
() => execFileAsync24("open", ["-a", simulatorApp], { timeout })
|
|
@@ -150354,7 +150378,7 @@ async function openSimulatorWindow(udid) {
|
|
|
150354
150378
|
return launched ? void 0 : `${simulatorApp} exits right after launch on this host, so Argent no longer opens it and the device runs without a window. Delete ~/.argent/simulator-app-launch.json to try opening it again.`;
|
|
150355
150379
|
}
|
|
150356
150380
|
const deviceHubApp = (0, import_node_path19.join)(developerDir2, "..", "Applications", "DeviceHub.app");
|
|
150357
|
-
if ((0,
|
|
150381
|
+
if ((0, import_node_fs15.existsSync)(deviceHubApp)) {
|
|
150358
150382
|
const url2 = `devices://device/open?id=${encodeURIComponent(udid)}`;
|
|
150359
150383
|
await execFileAsync24("open", ["-a", deviceHubApp, url2], { timeout });
|
|
150360
150384
|
}
|
|
@@ -150402,7 +150426,7 @@ async function attemptBoot(params) {
|
|
|
150402
150426
|
if (process.platform === "win32") {
|
|
150403
150427
|
const safeName = params.avdName.replace(/[^\w.-]/g, "_");
|
|
150404
150428
|
const logPath = (0, import_node_path19.join)((0, import_node_os14.tmpdir)(), `argent-emulator-${safeName}.log`);
|
|
150405
|
-
emulatorLogFd = (0,
|
|
150429
|
+
emulatorLogFd = (0, import_node_fs15.openSync)(logPath, "w");
|
|
150406
150430
|
stdio = ["ignore", emulatorLogFd, emulatorLogFd];
|
|
150407
150431
|
}
|
|
150408
150432
|
const child = (0, import_node_child_process34.spawn)(params.emulatorBinary, params.emulatorArgs, {
|
|
@@ -150412,7 +150436,7 @@ async function attemptBoot(params) {
|
|
|
150412
150436
|
child.unref();
|
|
150413
150437
|
if (emulatorLogFd !== void 0) {
|
|
150414
150438
|
try {
|
|
150415
|
-
(0,
|
|
150439
|
+
(0, import_node_fs15.closeSync)(emulatorLogFd);
|
|
150416
150440
|
} catch {
|
|
150417
150441
|
}
|
|
150418
150442
|
}
|
|
@@ -150930,11 +150954,11 @@ async function startHarmonyEmulator(instanceName) {
|
|
|
150930
150954
|
});
|
|
150931
150955
|
}
|
|
150932
150956
|
try {
|
|
150933
|
-
for (const entry of (0,
|
|
150957
|
+
for (const entry of (0, import_node_fs15.readdirSync)((0, import_node_os14.tmpdir)())) {
|
|
150934
150958
|
if (!entry.startsWith("argent-harmony-") || !entry.endsWith(".log")) continue;
|
|
150935
150959
|
try {
|
|
150936
|
-
if (Date.now() - (0,
|
|
150937
|
-
(0,
|
|
150960
|
+
if (Date.now() - (0, import_node_fs15.statSync)((0, import_node_path19.join)((0, import_node_os14.tmpdir)(), entry)).mtimeMs > HARMONY_LOG_TTL_MS) {
|
|
150961
|
+
(0, import_node_fs15.rmSync)((0, import_node_path19.join)((0, import_node_os14.tmpdir)(), entry), { force: true });
|
|
150938
150962
|
}
|
|
150939
150963
|
} catch {
|
|
150940
150964
|
}
|
|
@@ -150945,7 +150969,7 @@ async function startHarmonyEmulator(instanceName) {
|
|
|
150945
150969
|
const logPath = (0, import_node_path19.join)((0, import_node_os14.tmpdir)(), `argent-harmony-${safeName}-${process.hrtime.bigint()}.log`);
|
|
150946
150970
|
let logFd;
|
|
150947
150971
|
try {
|
|
150948
|
-
logFd = (0,
|
|
150972
|
+
logFd = (0, import_node_fs15.openSync)(logPath, "w");
|
|
150949
150973
|
} catch {
|
|
150950
150974
|
logFd = null;
|
|
150951
150975
|
}
|
|
@@ -150956,7 +150980,7 @@ async function startHarmonyEmulator(instanceName) {
|
|
|
150956
150980
|
child.unref();
|
|
150957
150981
|
if (logFd !== null) {
|
|
150958
150982
|
try {
|
|
150959
|
-
(0,
|
|
150983
|
+
(0, import_node_fs15.closeSync)(logFd);
|
|
150960
150984
|
} catch {
|
|
150961
150985
|
}
|
|
150962
150986
|
}
|
|
@@ -150965,7 +150989,7 @@ async function startHarmonyEmulator(instanceName) {
|
|
|
150965
150989
|
if (exit) return;
|
|
150966
150990
|
let output2 = "";
|
|
150967
150991
|
try {
|
|
150968
|
-
output2 = (0,
|
|
150992
|
+
output2 = (0, import_node_fs15.readFileSync)(logPath, "utf8");
|
|
150969
150993
|
} catch {
|
|
150970
150994
|
}
|
|
150971
150995
|
exit = { reason: reason2, output: output2 };
|
|
@@ -153521,7 +153545,7 @@ init_device_info();
|
|
|
153521
153545
|
init_adb();
|
|
153522
153546
|
|
|
153523
153547
|
// ../tool-server/src/utils/device-orientation.ts
|
|
153524
|
-
var
|
|
153548
|
+
var import_node_fs16 = require("node:fs");
|
|
153525
153549
|
init_adb();
|
|
153526
153550
|
var SURFACE_ROTATION_TO_NAME = {
|
|
153527
153551
|
0: "Portrait",
|
|
@@ -153566,7 +153590,7 @@ function captureRotationForSurface(rotation) {
|
|
|
153566
153590
|
async function readPngSize2(path63) {
|
|
153567
153591
|
let handle;
|
|
153568
153592
|
try {
|
|
153569
|
-
handle = await
|
|
153593
|
+
handle = await import_node_fs16.promises.open(path63, "r");
|
|
153570
153594
|
const buf = Buffer.alloc(24);
|
|
153571
153595
|
const { bytesRead } = await handle.read(buf, 0, 24, 0);
|
|
153572
153596
|
if (bytesRead < 24) return null;
|
|
@@ -157723,8 +157747,9 @@ var zodSchema33 = external_exports.object({
|
|
|
157723
157747
|
var debuggerEvaluateTool = {
|
|
157724
157748
|
id: "debugger-evaluate",
|
|
157725
157749
|
description: `Execute arbitrary JavaScript in the app's JS runtime via CDP: Hermes on iOS / Android / Vega, V8 on Chromium.
|
|
157726
|
-
Returns the result serialized by value as JSON, with deviceName, appName, and logicalDeviceId. Use when you need to read app state, call app functions, or test logic at runtime. Cyclic objects, which many RN runtime values are (fiber nodes, navigation refs, global), fail with a serialization error. Fails if the expression throws or the runtime is not connected.`,
|
|
157750
|
+
Returns the result serialized by value as JSON, with deviceName, appName, and logicalDeviceId. Use when you need to read app state, including localStorage and sessionStorage on Chromium, call app functions, or test logic at runtime. Cyclic objects, which many RN runtime values are (fiber nodes, navigation refs, global), fail with a serialization error. Fails if the expression throws or the runtime is not connected.`,
|
|
157727
157751
|
zodSchema: zodSchema33,
|
|
157752
|
+
searchHint: "javascript js eval expression runtime app state localstorage sessionstorage web storage",
|
|
157728
157753
|
interaction: {
|
|
157729
157754
|
startedMsg: () => "Running JavaScript in the app",
|
|
157730
157755
|
completedMsg: () => "Ran JavaScript in the app",
|
|
@@ -162694,7 +162719,7 @@ function createReactProfilerStopTool(registry2) {
|
|
|
162694
162719
|
return {
|
|
162695
162720
|
id: "react-profiler-stop",
|
|
162696
162721
|
description: `Stop CPU profiling and collect the cpuProfile + React commit tree.
|
|
162697
|
-
Stores the results for react-profiler-analyze
|
|
162722
|
+
Stores the results for react-profiler-analyze, profiler-commit-query and profiler-cpu-query.
|
|
162698
162723
|
Call react-profiler-start first, then exercise the app, then call this.
|
|
162699
162724
|
Returns { duration_ms, sample_count, fiber_renders_captured, total_react_commits, hot_commit_indices, react_render_ms, react_render_share_pct, react_render_peak_1s_pct }.
|
|
162700
162725
|
If some fibers' display names could not be resolved (typically modals, tooltips or animations that unmounted before stop), it also returns { unattributed_ms, unattributed_fiber_count, unattributed_commit_count }: the work missing from the per-component breakdown. Per-commit durations stay correct.
|
|
@@ -163201,6 +163226,7 @@ function createReactProfilerStatusTool(registry2) {
|
|
|
163201
163226
|
// ../tool-server/src/tools/profiler/react/react-profiler-analyze.ts
|
|
163202
163227
|
init_zod();
|
|
163203
163228
|
var import_fs5 = require("fs");
|
|
163229
|
+
var import_path6 = require("path");
|
|
163204
163230
|
init_src2();
|
|
163205
163231
|
|
|
163206
163232
|
// ../tool-server/src/utils/react-profiler/pipeline/session-context.ts
|
|
@@ -163830,6 +163856,7 @@ var EXCLUDE_DIRS = /* @__PURE__ */ new Set([
|
|
|
163830
163856
|
var TEST_FILE = /\.(test|spec)\.[jt]sx?$/;
|
|
163831
163857
|
async function findSourceFiles(dir) {
|
|
163832
163858
|
const result = [];
|
|
163859
|
+
const nestedPackages = [];
|
|
163833
163860
|
async function walk(current) {
|
|
163834
163861
|
let entries;
|
|
163835
163862
|
try {
|
|
@@ -163837,6 +163864,9 @@ async function findSourceFiles(dir) {
|
|
|
163837
163864
|
} catch {
|
|
163838
163865
|
return;
|
|
163839
163866
|
}
|
|
163867
|
+
if (current !== dir && entries.some((e) => e.isFile() && e.name === "package.json")) {
|
|
163868
|
+
nestedPackages.push(current + import_path4.sep);
|
|
163869
|
+
}
|
|
163840
163870
|
for (const entry of entries) {
|
|
163841
163871
|
if (entry.isDirectory()) {
|
|
163842
163872
|
if (!EXCLUDE_DIRS.has(entry.name)) {
|
|
@@ -163851,7 +163881,7 @@ async function findSourceFiles(dir) {
|
|
|
163851
163881
|
}
|
|
163852
163882
|
}
|
|
163853
163883
|
await walk(dir);
|
|
163854
|
-
return result;
|
|
163884
|
+
return { files: result, nestedPackages };
|
|
163855
163885
|
}
|
|
163856
163886
|
function isCapitalized(name) {
|
|
163857
163887
|
if (name.length === 0) return false;
|
|
@@ -163898,12 +163928,47 @@ function collectMemoizedNames(root) {
|
|
|
163898
163928
|
return names;
|
|
163899
163929
|
}
|
|
163900
163930
|
var PLATFORM_SUFFIX = /\.(web|ios|android|native)\.[jt]sx?$/;
|
|
163901
|
-
|
|
163902
|
-
|
|
163931
|
+
var EXTENSION = /\.[jt]sx?$/;
|
|
163932
|
+
var NOT_APP_CODE = /\.(test|spec|stories)\.[jt]sx?$/;
|
|
163933
|
+
var NOT_BUNDLED = 3;
|
|
163934
|
+
function variantRank(file2, platform) {
|
|
163935
|
+
const suffix = PLATFORM_SUFFIX.exec(file2)?.[1];
|
|
163936
|
+
if (!platform) return suffix ? 1 : 0;
|
|
163937
|
+
if (suffix === platform) return 0;
|
|
163938
|
+
if (suffix === "native") return 1;
|
|
163939
|
+
return suffix ? NOT_BUNDLED : 2;
|
|
163940
|
+
}
|
|
163941
|
+
function moduleOf(file2) {
|
|
163942
|
+
return file2.replace(PLATFORM_SUFFIX, "").replace(EXTENSION, "");
|
|
163943
|
+
}
|
|
163944
|
+
function bundledFilter(files, platform) {
|
|
163945
|
+
if (!platform) return () => true;
|
|
163946
|
+
const best = /* @__PURE__ */ new Map();
|
|
163947
|
+
for (const file2 of files) {
|
|
163948
|
+
const module2 = moduleOf(file2);
|
|
163949
|
+
best.set(module2, Math.min(best.get(module2) ?? NOT_BUNDLED, variantRank(file2, platform)));
|
|
163950
|
+
}
|
|
163951
|
+
return (file2) => {
|
|
163952
|
+
const rank2 = variantRank(file2, platform);
|
|
163953
|
+
return rank2 !== NOT_BUNDLED && rank2 === best.get(moduleOf(file2));
|
|
163954
|
+
};
|
|
163903
163955
|
}
|
|
163904
|
-
function
|
|
163956
|
+
function fileNameKey(name) {
|
|
163957
|
+
return name.replace(/[-_]/g, "").toLowerCase();
|
|
163958
|
+
}
|
|
163959
|
+
function isNamedAfter(file2, component) {
|
|
163960
|
+
const base = (0, import_path4.basename)(moduleOf(file2));
|
|
163961
|
+
const stem = base === "index" ? (0, import_path4.basename)((0, import_path4.dirname)(file2)) : base;
|
|
163962
|
+
return fileNameKey(stem) === fileNameKey(component);
|
|
163963
|
+
}
|
|
163964
|
+
function pickPrimary(name, entries, platform, nestedPackages) {
|
|
163965
|
+
const foreign = (file2) => NOT_APP_CODE.test(file2) || nestedPackages.some((dir) => file2.startsWith(dir)) ? 1 : 0;
|
|
163905
163966
|
const sorted = entries.slice().sort((a, b) => {
|
|
163906
|
-
const
|
|
163967
|
+
const foreignDelta = foreign(a.file) - foreign(b.file);
|
|
163968
|
+
if (foreignDelta !== 0) return foreignDelta;
|
|
163969
|
+
const nameDelta = Number(isNamedAfter(b.file, name)) - Number(isNamedAfter(a.file, name));
|
|
163970
|
+
if (nameDelta !== 0) return nameDelta;
|
|
163971
|
+
const variantDelta = variantRank(a.file, platform) - variantRank(b.file, platform);
|
|
163907
163972
|
if (variantDelta !== 0) return variantDelta;
|
|
163908
163973
|
if (a.file !== b.file) return a.file < b.file ? -1 : 1;
|
|
163909
163974
|
if (a.line !== b.line) return a.line - b.line;
|
|
@@ -163917,12 +163982,12 @@ function pickPrimary(entries) {
|
|
|
163917
163982
|
}
|
|
163918
163983
|
var DEFAULT_PARSE_BUFFER_CHARS = 32 * 1024 - 1;
|
|
163919
163984
|
var MAX_JSX_FILE_CHARS = 512 * 1024;
|
|
163920
|
-
async function buildAstIndexWithDiagnostics(projectRoot) {
|
|
163985
|
+
async function buildAstIndexWithDiagnostics(projectRoot, platform) {
|
|
163921
163986
|
const index = /* @__PURE__ */ new Map();
|
|
163922
163987
|
const ts = loadTreeSitter();
|
|
163923
163988
|
if (!ts) return { index, treeSitterAvailable: false, indexedFiles: 0 };
|
|
163924
163989
|
const { ParserClass, ts: tsLang, tsx: tsxLang } = ts;
|
|
163925
|
-
const files = await findSourceFiles(projectRoot);
|
|
163990
|
+
const { files, nestedPackages } = await findSourceFiles(projectRoot);
|
|
163926
163991
|
const candidates = /* @__PURE__ */ new Map();
|
|
163927
163992
|
function addCandidate(name, entry) {
|
|
163928
163993
|
const existing = candidates.get(name);
|
|
@@ -163993,8 +164058,11 @@ async function buildAstIndexWithDiagnostics(projectRoot) {
|
|
|
163993
164058
|
} catch {
|
|
163994
164059
|
}
|
|
163995
164060
|
}
|
|
164061
|
+
const isBundled = bundledFilter(files, platform);
|
|
163996
164062
|
for (const [name, entries] of candidates) {
|
|
163997
|
-
const {
|
|
164063
|
+
const bundled = entries.filter(({ file: file2 }) => isBundled(file2));
|
|
164064
|
+
if (bundled.length === 0) continue;
|
|
164065
|
+
const { primary, others } = pickPrimary(name, bundled, platform, nestedPackages);
|
|
163998
164066
|
index.set(name, others.length > 0 ? { ...primary, otherMatches: others } : primary);
|
|
163999
164067
|
}
|
|
164000
164068
|
return { index, treeSitterAvailable: true, indexedFiles: files.length };
|
|
@@ -164066,6 +164134,7 @@ function createComponentOriginClassifier(index) {
|
|
|
164066
164134
|
|
|
164067
164135
|
// ../tool-server/src/utils/react-profiler/pipeline/05-render.ts
|
|
164068
164136
|
var MAX_INLINE_COMMITS = 10;
|
|
164137
|
+
var MAX_OTHER_MATCHES = 3;
|
|
164069
164138
|
var MAX_OUTSIDE_SOURCE_NAMES = 5;
|
|
164070
164139
|
var REPORT_FILENAME = "react-profiler-report.md";
|
|
164071
164140
|
async function renderProfilingReport(input2) {
|
|
@@ -164163,7 +164232,15 @@ function renderNoHotCommits(input2, maxMs) {
|
|
|
164163
164232
|
lines.push(``, `No component in this session could be named, so there is nothing to list.`);
|
|
164164
164233
|
}
|
|
164165
164234
|
const { rows, cut } = frequentRerenderRows(input2);
|
|
164166
|
-
lines.push(
|
|
164235
|
+
lines.push(
|
|
164236
|
+
...renderFrequentRerenders(
|
|
164237
|
+
summary,
|
|
164238
|
+
rows,
|
|
164239
|
+
frequentOutsideSource(input2),
|
|
164240
|
+
input2.sessionContext.projectRoot,
|
|
164241
|
+
cut
|
|
164242
|
+
)
|
|
164243
|
+
);
|
|
164167
164244
|
lines.push(``, `---`, `## Next Steps`, ``);
|
|
164168
164245
|
if (rows.length > 0) {
|
|
164169
164246
|
lines.push(
|
|
@@ -164200,7 +164277,7 @@ function frequentOutsideSource(input2) {
|
|
|
164200
164277
|
input2.componentOrigin ?? createComponentOriginClassifier(null)
|
|
164201
164278
|
) : [];
|
|
164202
164279
|
}
|
|
164203
|
-
function renderFrequentRerenders(summary, rows, outsideSource, cut = []) {
|
|
164280
|
+
function renderFrequentRerenders(summary, rows, outsideSource, projectRoot, cut = []) {
|
|
164204
164281
|
if (!summary) return [];
|
|
164205
164282
|
const outsideNote = outsideSource.length > 0 ? [``, renderOutsideSourceNote(outsideSource)] : [];
|
|
164206
164283
|
const cutNote = cut.length > 0 ? [``, renderCutNote(cut)] : [];
|
|
@@ -164215,7 +164292,7 @@ function renderFrequentRerenders(summary, rows, outsideSource, cut = []) {
|
|
|
164215
164292
|
``,
|
|
164216
164293
|
`| Component | Re-renders | Per second | Self ms/s | Self total | Reason | File |`,
|
|
164217
164294
|
`|---|---|---|---|---|---|---|`,
|
|
164218
|
-
...rows.map(renderFrequentRow),
|
|
164295
|
+
...rows.map((row) => renderFrequentRow(row, projectRoot)),
|
|
164219
164296
|
...cutNote,
|
|
164220
164297
|
...outsideNote
|
|
164221
164298
|
];
|
|
@@ -164230,10 +164307,10 @@ function renderOutsideSourceNote(names) {
|
|
|
164230
164307
|
const more = names.length > MAX_OUTSIDE_SOURCE_NAMES ? ` and ${names.length - MAX_OUTSIDE_SOURCE_NAMES} more` : "";
|
|
164231
164308
|
return `Frequent re-renders left out because the source index has no definition for the name: ${shown}${more}. These are usually library components. Class components, components made by a wrapper such as \`observer()\`, and all of your components when \`project_root\` is wrong land here too. \`profiler-commit-query\` mode=\`render_counts\` has the counts.`;
|
|
164232
164309
|
}
|
|
164233
|
-
function renderFrequentRow(row) {
|
|
164310
|
+
function renderFrequentRow(row, projectRoot) {
|
|
164234
164311
|
const c = row.component;
|
|
164235
164312
|
const ann = annotateComponentName(c.name);
|
|
164236
|
-
const file2 = row.origin.file !== void 0 ? `\`${
|
|
164313
|
+
const file2 = row.origin.file !== void 0 ? `\`${pathFromProject(row.origin.file, projectRoot)}${row.origin.line !== void 0 ? `:${row.origin.line}` : ""}\`` : "\u2014";
|
|
164237
164314
|
return `| \`${ann.displayName}\`${ann.tag} | ${formatCount(c.rerenders)} | ${row.perSecond.toFixed(1)} | ${row.selfMsPerSecond.toFixed(1)} | ${c.rerenderSelfMs.toFixed(1)}ms | ${formatRenderSummaryReason(c)} | ${file2} |`;
|
|
164238
164315
|
}
|
|
164239
164316
|
function renderCompilerStatus(enabled, detectedAtRuntime) {
|
|
@@ -164283,7 +164360,7 @@ function buildFullMarkdown(input2, annotations, totalHotCommits) {
|
|
|
164283
164360
|
lines.push("| Component | Renders | Total | Avg | Max | Reason | File |");
|
|
164284
164361
|
lines.push("|---|---|---|---|---|---|---|");
|
|
164285
164362
|
for (const f of input2.componentFindings) {
|
|
164286
|
-
const file2 = f.sourceLocation ?
|
|
164363
|
+
const file2 = f.sourceLocation ? formatLocation(f.sourceLocation, sessionContext.projectRoot) : "\u2014";
|
|
164287
164364
|
const reasonStr = formatReason(f.dominantReason, f.topChangedProps, f.topChangedHookNames);
|
|
164288
164365
|
const compilerFlag = f.compilerBailoutSuspected ? " \u26A0\uFE0F" : f.isCompilerOptimized ? " \u2713" : "";
|
|
164289
164366
|
const ann = annotateComponentName(f.component);
|
|
@@ -164311,13 +164388,15 @@ function buildFullMarkdown(input2, annotations, totalHotCommits) {
|
|
|
164311
164388
|
input2.renderSummary ?? null,
|
|
164312
164389
|
tableAddsRow ? frequent : [],
|
|
164313
164390
|
outsideSource,
|
|
164391
|
+
sessionContext.projectRoot,
|
|
164314
164392
|
cutNew
|
|
164315
164393
|
)
|
|
164316
164394
|
);
|
|
164317
164395
|
}
|
|
164318
164396
|
const suggestionsSection = renderSuggestedImprovements(
|
|
164319
164397
|
input2.componentFindings,
|
|
164320
|
-
sessionContext.reactCompilerEnabled
|
|
164398
|
+
sessionContext.reactCompilerEnabled,
|
|
164399
|
+
sessionContext.projectRoot
|
|
164321
164400
|
);
|
|
164322
164401
|
if (suggestionsSection) {
|
|
164323
164402
|
lines.push(suggestionsSection);
|
|
@@ -164491,12 +164570,12 @@ function findPriorAnnotation(annotations, relativeMs) {
|
|
|
164491
164570
|
}
|
|
164492
164571
|
return result;
|
|
164493
164572
|
}
|
|
164494
|
-
function renderSuggestedImprovements(findings, compilerEnabled) {
|
|
164573
|
+
function renderSuggestedImprovements(findings, compilerEnabled, projectRoot) {
|
|
164495
164574
|
if (findings.length === 0) return "";
|
|
164496
164575
|
const topFindings = findings.slice().sort((a, b) => b.totalMs - a.totalMs).slice(0, 5);
|
|
164497
164576
|
const lines = ["", "---", "## Suggested Improvements", ""];
|
|
164498
164577
|
for (const f of topFindings) {
|
|
164499
|
-
const loc = f.sourceLocation ?
|
|
164578
|
+
const loc = f.sourceLocation ? formatLocation(f.sourceLocation, projectRoot) : null;
|
|
164500
164579
|
const ann = annotateComponentName(f.component);
|
|
164501
164580
|
const heading = `\`${ann.displayName}\`${ann.tag}`;
|
|
164502
164581
|
lines.push(loc ? `### ${heading} \u2014 ${loc}` : `### ${heading}`);
|
|
@@ -164560,7 +164639,7 @@ function renderSuggestedImprovements(findings, compilerEnabled) {
|
|
|
164560
164639
|
}
|
|
164561
164640
|
}
|
|
164562
164641
|
if (f.sourceSnippet && f.sourceLocation) {
|
|
164563
|
-
const snippetPath = `${
|
|
164642
|
+
const snippetPath = `${pathFromProject(f.sourceLocation.file, projectRoot)}:${f.sourceLocation.line}`;
|
|
164564
164643
|
lines.push("");
|
|
164565
164644
|
lines.push(`<details><summary>Source \u2014 \`${snippetPath}\`</summary>`);
|
|
164566
164645
|
lines.push("");
|
|
@@ -164574,10 +164653,23 @@ function renderSuggestedImprovements(findings, compilerEnabled) {
|
|
|
164574
164653
|
}
|
|
164575
164654
|
return lines.join("\n");
|
|
164576
164655
|
}
|
|
164656
|
+
function formatLocation(loc, projectRoot) {
|
|
164657
|
+
const main = `\`${pathFromProject(loc.file, projectRoot)}:${loc.line}\``;
|
|
164658
|
+
const others = loc.otherMatches ?? [];
|
|
164659
|
+
if (others.length === 0) return main;
|
|
164660
|
+
const shown = others.slice(0, MAX_OTHER_MATCHES).map((m) => `${pathFromProject(m.file, projectRoot)}:${m.line}`);
|
|
164661
|
+
const rest = others.length - shown.length;
|
|
164662
|
+
return `${main} (name also in ${shown.join(", ")}${rest > 0 ? `, +${rest} more` : ""})`;
|
|
164663
|
+
}
|
|
164577
164664
|
function shortenPath(file2) {
|
|
164578
164665
|
const parts2 = file2.replace(/\\/g, "/").split("/");
|
|
164579
164666
|
return parts2.slice(-2).join("/");
|
|
164580
164667
|
}
|
|
164668
|
+
function pathFromProject(file2, projectRoot) {
|
|
164669
|
+
const fromRoot = (0, import_path5.relative)(projectRoot, file2);
|
|
164670
|
+
const outsideRoot = !fromRoot || fromRoot.split(import_path5.sep)[0] === ".." || (0, import_path5.isAbsolute)(fromRoot);
|
|
164671
|
+
return outsideRoot ? file2 : fromRoot;
|
|
164672
|
+
}
|
|
164581
164673
|
async function writeReport(path63, content) {
|
|
164582
164674
|
try {
|
|
164583
164675
|
await import_fs4.promises.writeFile(path63, content, "utf8");
|
|
@@ -164591,6 +164683,21 @@ async function writeReport(path63, content) {
|
|
|
164591
164683
|
async function fileArtifact(store, p, kind) {
|
|
164592
164684
|
return p ? store.register({ hostPath: p, kind }) : null;
|
|
164593
164685
|
}
|
|
164686
|
+
function recordedPlatform(profile) {
|
|
164687
|
+
for (const node2 of profile?.nodes ?? []) {
|
|
164688
|
+
const match = /[?&]platform=(ios|android)\b/.exec(node2.callFrame.url);
|
|
164689
|
+
if (match) return match[1];
|
|
164690
|
+
}
|
|
164691
|
+
return void 0;
|
|
164692
|
+
}
|
|
164693
|
+
async function resolvedPath(path63) {
|
|
164694
|
+
return import_fs5.promises.realpath(path63).catch(() => path63);
|
|
164695
|
+
}
|
|
164696
|
+
async function unrelatedPaths(a, b) {
|
|
164697
|
+
const [from2, to] = await Promise.all([resolvedPath(a), resolvedPath(b)]);
|
|
164698
|
+
const outside = (rel) => rel.startsWith("..") || (0, import_path6.isAbsolute)(rel);
|
|
164699
|
+
return outside((0, import_path6.relative)(from2, to)) && outside((0, import_path6.relative)(to, from2));
|
|
164700
|
+
}
|
|
164594
164701
|
var annotationSchema = external_exports.object({
|
|
164595
164702
|
offsetMs: external_exports.coerce.number().describe(
|
|
164596
164703
|
"Milliseconds since profiling started: tapTimestampMs - startedAtEpochMs, where tapTimestampMs is the timestampMs a tap/swipe tool returned and startedAtEpochMs is the value react-profiler-start returned."
|
|
@@ -164603,7 +164710,7 @@ var zodSchema48 = external_exports.object({
|
|
|
164603
164710
|
"Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
|
|
164604
164711
|
),
|
|
164605
164712
|
project_root: external_exports.string().describe("Absolute path to the RN project root for session context detection"),
|
|
164606
|
-
platform: external_exports.enum(["ios", "android"]).
|
|
164713
|
+
platform: external_exports.enum(["ios", "android"]).optional().describe("Target platform"),
|
|
164607
164714
|
rn_version: external_exports.coerce.string().default("unknown").describe('React Native version (e.g. "0.73.4")'),
|
|
164608
164715
|
annotations: external_exports.array(annotationSchema).optional().describe(
|
|
164609
164716
|
"User actions to annotate the report's commits with: each commit shows the action that preceded it."
|
|
@@ -164652,6 +164759,7 @@ Fails if react-profiler-stop has not been called or no profiling data is stored.
|
|
|
164652
164759
|
}
|
|
164653
164760
|
let commitTree;
|
|
164654
164761
|
let unattributedByCommit;
|
|
164762
|
+
let metroRoot;
|
|
164655
164763
|
let renderSummary = null;
|
|
164656
164764
|
if (sessionPaths.commitsPath) {
|
|
164657
164765
|
const onDisk = await readCommitTree(sessionPaths.commitsPath);
|
|
@@ -164659,11 +164767,13 @@ Fails if react-profiler-stop has not been called or no profiling data is stored.
|
|
|
164659
164767
|
if (onDisk.meta?.unattributedByCommit) {
|
|
164660
164768
|
unattributedByCommit = onDisk.meta.unattributedByCommit;
|
|
164661
164769
|
}
|
|
164770
|
+
metroRoot = onDisk.meta?.projectRoot || void 0;
|
|
164662
164771
|
renderSummary = parseRenderSummary(onDisk.meta?.renderSummary);
|
|
164663
164772
|
} else {
|
|
164664
164773
|
commitTree = { commits: [], hookNames: /* @__PURE__ */ new Map() };
|
|
164665
164774
|
}
|
|
164666
164775
|
const { detectedArchitecture, anyCompilerOptimized, hotCommitIndices, totalReactCommits } = sessionPaths;
|
|
164776
|
+
const platform = recordedPlatform(cpuProfile) ?? params.platform;
|
|
164667
164777
|
const recordingDurationMs = cpuProfile ? (cpuProfile.endTime - cpuProfile.startTime) / 1e3 : 0;
|
|
164668
164778
|
const input2 = {
|
|
164669
164779
|
...cpuProfile !== null && { flamegraph: cpuProfile },
|
|
@@ -164671,7 +164781,7 @@ Fails if react-profiler-stop has not been called or no profiling data is stored.
|
|
|
164671
164781
|
sessionMeta: {
|
|
164672
164782
|
recordingDurationMs,
|
|
164673
164783
|
deviceId: "simulator",
|
|
164674
|
-
platform:
|
|
164784
|
+
platform: platform ?? "ios",
|
|
164675
164785
|
rnVersion: params.rn_version,
|
|
164676
164786
|
projectRoot: params.project_root,
|
|
164677
164787
|
...detectedArchitecture !== null && {
|
|
@@ -164703,8 +164813,18 @@ Fails if react-profiler-stop has not been called or no profiling data is stored.
|
|
|
164703
164813
|
}
|
|
164704
164814
|
const needsSourceIndex = pipelineOutput.componentFindings.length > 0 || renderSummary !== null && selectFrequentRerenders(renderSummary, createComponentOriginClassifier(null)).length > 0;
|
|
164705
164815
|
let sourceIndex = null;
|
|
164816
|
+
let sourceWarning;
|
|
164817
|
+
let sourceRoot = params.project_root;
|
|
164706
164818
|
try {
|
|
164707
|
-
|
|
164819
|
+
let astIndex = needsSourceIndex ? await buildAstIndexWithDiagnostics(sourceRoot, platform) : null;
|
|
164820
|
+
if (astIndex && astIndex.index.size === 0 && metroRoot && metroRoot !== sourceRoot) {
|
|
164821
|
+
const fromMetro = await buildAstIndexWithDiagnostics(metroRoot, platform);
|
|
164822
|
+
if (fromMetro.index.size > 0) {
|
|
164823
|
+
astIndex = fromMetro;
|
|
164824
|
+
sourceRoot = metroRoot;
|
|
164825
|
+
sourceWarning = `project_root "${params.project_root}" holds no components on the tool-server host, so the File column comes from Metro's project root "${metroRoot}".`;
|
|
164826
|
+
}
|
|
164827
|
+
}
|
|
164708
164828
|
if (astIndex?.treeSitterAvailable) sourceIndex = astIndex.index;
|
|
164709
164829
|
for (const finding of pipelineOutput.componentFindings) {
|
|
164710
164830
|
const entry = astLookupCandidates(finding.component).map((k) => astIndex?.index.get(k)).find(Boolean);
|
|
@@ -164715,11 +164835,24 @@ Fails if react-profiler-stop has not been called or no profiling data is stored.
|
|
|
164715
164835
|
col: entry.col,
|
|
164716
164836
|
isMemoized: entry.isMemoized,
|
|
164717
164837
|
hasUseCallback: entry.hasUseCallback,
|
|
164718
|
-
hasUseMemo: entry.hasUseMemo
|
|
164838
|
+
hasUseMemo: entry.hasUseMemo,
|
|
164839
|
+
...entry.otherMatches?.length ? { otherMatches: entry.otherMatches } : {}
|
|
164719
164840
|
};
|
|
164720
164841
|
}
|
|
164721
164842
|
}
|
|
164843
|
+
const findings = pipelineOutput.componentFindings;
|
|
164844
|
+
if (!astIndex) {
|
|
164845
|
+
} else if (!astIndex.treeSitterAvailable) {
|
|
164846
|
+
sourceWarning = "The tree-sitter parser could not be loaded, so the report gives no file for any component.";
|
|
164847
|
+
} else if (findings.length > 0 && !findings.some((f) => f.sourceLocation)) {
|
|
164848
|
+
const searched = sourceRoot === params.project_root ? "project_root" : "Metro's project root";
|
|
164849
|
+
const noFile = `No component in the report's table is defined under ${searched} "${sourceRoot}" (${astIndex.indexedFiles} source files on the tool-server host, ${astIndex.index.size} components), so the report gives no file for any of them. They may all be library components. If any of them is from the app, check project_root.`;
|
|
164850
|
+
sourceWarning = sourceWarning ? `${sourceWarning} ${noFile}` : noFile;
|
|
164851
|
+
} else if (metroRoot && await unrelatedPaths(metroRoot, sourceRoot)) {
|
|
164852
|
+
sourceWarning = `Metro serves this app from "${metroRoot}", but project_root is "${sourceRoot}", so the files in this report may be from another project.`;
|
|
164853
|
+
}
|
|
164722
164854
|
} catch {
|
|
164855
|
+
sourceWarning = "Reading the project's source failed, so the report may lack file locations.";
|
|
164723
164856
|
}
|
|
164724
164857
|
const top5 = pipelineOutput.componentFindings.slice().sort((a, b) => b.totalMs - a.totalMs).slice(0, 5);
|
|
164725
164858
|
await Promise.all(
|
|
@@ -164739,7 +164872,8 @@ Fails if react-profiler-stop has not been called or no profiling data is stored.
|
|
|
164739
164872
|
const { report, reportFile, hotCommitsTotal, hotCommitsShown } = await renderProfilingReport({
|
|
164740
164873
|
hotCommitSummaries: pipelineOutput.hotCommitSummaries,
|
|
164741
164874
|
componentFindings: pipelineOutput.componentFindings,
|
|
164742
|
-
|
|
164875
|
+
// Paths in the report count from the root the files were read from.
|
|
164876
|
+
sessionContext: { ...pipelineOutput.sessionContext, projectRoot: sourceRoot },
|
|
164743
164877
|
recordingMs: pipelineOutput.recordingMs,
|
|
164744
164878
|
anyRuntimeCompilerDetected: pipelineOutput.anyRuntimeCompilerDetected,
|
|
164745
164879
|
reactCommits: pipelineOutput.reactCommits,
|
|
@@ -164753,6 +164887,7 @@ Fails if react-profiler-stop has not been called or no profiling data is stored.
|
|
|
164753
164887
|
});
|
|
164754
164888
|
const artifacts = requireArtifacts(ctx);
|
|
164755
164889
|
const result = {
|
|
164890
|
+
...sourceWarning ? { warning: sourceWarning } : {},
|
|
164756
164891
|
report,
|
|
164757
164892
|
reportFile: await fileArtifact(artifacts, reportFile, "react-profile-report"),
|
|
164758
164893
|
hotCommitsTotal,
|
|
@@ -164764,7 +164899,8 @@ Fails if react-profiler-stop has not been called or no profiling data is stored.
|
|
|
164764
164899
|
}
|
|
164765
164900
|
};
|
|
164766
164901
|
if (hotCommitIndices === null) {
|
|
164767
|
-
|
|
164902
|
+
const noCommits = "No React commit data \u2014 the DevTools hook may not be present in this runtime, or the commit-capture script failed to inject (check react-profiler-start output for errors).";
|
|
164903
|
+
result["warning"] = sourceWarning ? `${noCommits} ${sourceWarning}` : noCommits;
|
|
164768
164904
|
}
|
|
164769
164905
|
return result;
|
|
164770
164906
|
}
|
|
@@ -164788,6 +164924,11 @@ Returns found: false if the component is not found in user-owned code (e.g. live
|
|
|
164788
164924
|
When several files define a component with the same name (e.g. platform variants like List.tsx and List.web.tsx), returns the primary match and lists the rest under otherMatches[] (file/line/col). Check it before assuming the returned file is the one you meant.`,
|
|
164789
164925
|
zodSchema: zodSchema49,
|
|
164790
164926
|
readOnly: true,
|
|
164927
|
+
// react-profiler-analyze runs the same AST lookup for each component in its
|
|
164928
|
+
// table (file, line and other matches) and adds the source of the located ones
|
|
164929
|
+
// among the top five; agents read any other file themselves. The SDK still
|
|
164930
|
+
// calls it.
|
|
164931
|
+
hideFromMcp: true,
|
|
164791
164932
|
interaction: {
|
|
164792
164933
|
startedMsg: ({ params }) => `Finding source for ${params.component_name}`,
|
|
164793
164934
|
completedMsg: ({ params, result }) => `${result.found ? "Found" : "Could not find"} source for ${params.component_name}`,
|
|
@@ -164902,11 +165043,11 @@ function buildHotspots(nodes, samples, timeDeltas, topN2, reactOnly) {
|
|
|
164902
165043
|
function renderMarkdownTable(entries) {
|
|
164903
165044
|
if (entries.length === 0) return "_No hotspots found._";
|
|
164904
165045
|
const header = "| Function | Location | Self (ms) | Total (ms) | Self % |";
|
|
164905
|
-
const
|
|
165046
|
+
const sep10 = "|---|---|---|---|---|";
|
|
164906
165047
|
const rows = entries.map(
|
|
164907
165048
|
(e) => `| \`${e.function}\` | ${e.url || "\u2014"} | ${e.self_ms} | ${e.total_ms} | ${e.self_pct} |`
|
|
164908
165049
|
);
|
|
164909
|
-
return [header,
|
|
165050
|
+
return [header, sep10, ...rows].join("\n");
|
|
164910
165051
|
}
|
|
164911
165052
|
var zodSchema50 = external_exports.object({
|
|
164912
165053
|
port: metroPortField,
|
|
@@ -164925,6 +165066,11 @@ Use when you specifically need to investigate JS CPU hotspots that are NOT tied
|
|
|
164925
165066
|
Fails if react-profiler-stop has not been called or no CPU profile is stored.`,
|
|
164926
165067
|
zodSchema: zodSchema50,
|
|
164927
165068
|
readOnly: true,
|
|
165069
|
+
// Agents use profiler-cpu-query mode top_functions, which reads the same
|
|
165070
|
+
// profile with per-sample intervals and idle filtered out, and has the same
|
|
165071
|
+
// react_only filter and Self % column. The SDK and the e2e-full suite still
|
|
165072
|
+
// call it.
|
|
165073
|
+
hideFromMcp: true,
|
|
164928
165074
|
interaction: {
|
|
164929
165075
|
startedMsg: () => "Summarizing React CPU profile",
|
|
164930
165076
|
completedMsg: () => "Summarized React CPU profile",
|
|
@@ -165019,11 +165165,11 @@ function renderMarkdownTable2(entries) {
|
|
|
165019
165165
|
if (entries.length === 0)
|
|
165020
165166
|
return "_No render data found. Ensure React DevTools global hook is present._";
|
|
165021
165167
|
const header = "| Component | Instances | Total (ms) | Self Base (ms) |";
|
|
165022
|
-
const
|
|
165168
|
+
const sep10 = "|---|---|---|---|";
|
|
165023
165169
|
const rows = entries.map(
|
|
165024
165170
|
(e) => `| \`${e.component}\` | ${e.renderCount} | ${e.totalActualDuration_ms.toFixed(2)} | ${e.selfBaseDuration_ms.toFixed(2)} |`
|
|
165025
165171
|
);
|
|
165026
|
-
return [header,
|
|
165172
|
+
return [header, sep10, ...rows].join("\n");
|
|
165027
165173
|
}
|
|
165028
165174
|
var zodSchema51 = external_exports.object({
|
|
165029
165175
|
port: metroPortField,
|
|
@@ -165503,7 +165649,7 @@ init_capability();
|
|
|
165503
165649
|
var import_child_process4 = require("child_process");
|
|
165504
165650
|
init_src2();
|
|
165505
165651
|
var import_fs9 = require("fs");
|
|
165506
|
-
var
|
|
165652
|
+
var import_node_fs17 = require("node:fs");
|
|
165507
165653
|
var path40 = __toESM(require("path"));
|
|
165508
165654
|
init_external_devices();
|
|
165509
165655
|
|
|
@@ -167174,7 +167320,7 @@ function resolveDefaultTemplatePath() {
|
|
|
167174
167320
|
)
|
|
167175
167321
|
];
|
|
167176
167322
|
for (const candidate of candidates) {
|
|
167177
|
-
if ((0,
|
|
167323
|
+
if ((0, import_node_fs17.existsSync)(candidate)) return candidate;
|
|
167178
167324
|
}
|
|
167179
167325
|
throw new FailureError(
|
|
167180
167326
|
`Argent.tracetemplate not found. Looked in:
|
|
@@ -169729,7 +169875,7 @@ var import_fs16 = require("fs");
|
|
|
169729
169875
|
var import_child_process6 = require("child_process");
|
|
169730
169876
|
var import_util15 = require("util");
|
|
169731
169877
|
var import_os2 = __toESM(require("os"));
|
|
169732
|
-
var
|
|
169878
|
+
var import_path7 = __toESM(require("path"));
|
|
169733
169879
|
|
|
169734
169880
|
// ../tool-server/src/tools/screen-recording/watermark-asset.ts
|
|
169735
169881
|
var WATERMARK_PNG_WIDTH = 900;
|
|
@@ -169831,7 +169977,7 @@ function buildWatermarkGraph(dims, opts) {
|
|
|
169831
169977
|
].join(";");
|
|
169832
169978
|
}
|
|
169833
169979
|
async function writeLogoTemp() {
|
|
169834
|
-
const file2 =
|
|
169980
|
+
const file2 = import_path7.default.join(
|
|
169835
169981
|
import_os2.default.tmpdir(),
|
|
169836
169982
|
`argent-watermark-${process.pid}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.png`
|
|
169837
169983
|
);
|
|
@@ -171349,12 +171495,18 @@ function explainEmptyWindow(res, startMs, endMs) {
|
|
|
171349
171495
|
}
|
|
171350
171496
|
return `_No CPU samples fell inside ${window2} (${(endMs - startMs).toFixed(1)}ms wide), although it lies within the recorded range (${range}). The sampler runs roughly every ${res.medianIntervalMs > 0 ? res.medianIntervalMs.toFixed(1) : "13"}ms, so a window this narrow can contain none at all. **Absence of samples is not evidence that this commit was cheap.** Widen the window, or use \`mode=component_cpu\`._`;
|
|
171351
171497
|
}
|
|
171352
|
-
function
|
|
171498
|
+
function isReactComponentName(name) {
|
|
171499
|
+
return /^[A-Z][A-Za-z0-9]*$/.test(name);
|
|
171500
|
+
}
|
|
171501
|
+
function coverageNote(res, startMs, endMs, reactOnly) {
|
|
171353
171502
|
const widthMs = endMs - startMs;
|
|
171354
171503
|
const lines = [
|
|
171355
171504
|
`**Window:** ${startMs.toFixed(1)}ms \u2192 ${endMs.toFixed(1)}ms (${widthMs.toFixed(1)}ms)`,
|
|
171356
|
-
`**Samples:** ${res.samplesInWindow} covering ${res.coveredMs.toFixed(1)}ms` + (res.idleMs > 0 ? `, of which ${res.idleMs.toFixed(1)}ms idle` : "") + ` \u2014 sampling interval ~${res.medianIntervalMs.toFixed(1)}ms. Self-times sum to sampled coverage, not to the window width.`
|
|
171505
|
+
`**Samples:** ${res.samplesInWindow} covering ${res.coveredMs.toFixed(1)}ms` + (res.idleMs > 0 ? `, of which ${res.idleMs.toFixed(1)}ms idle` : "") + ` \u2014 sampling interval ~${res.medianIntervalMs.toFixed(1)}ms. Self-times sum to sampled coverage, not to the window width. Self % is a share of that coverage.`
|
|
171357
171506
|
];
|
|
171507
|
+
if (reactOnly) {
|
|
171508
|
+
lines.push("**Filter:** React components only (PascalCase function names)");
|
|
171509
|
+
}
|
|
171358
171510
|
if (widthMs > 0 && widthMs < 3 * res.medianIntervalMs) {
|
|
171359
171511
|
lines.push(
|
|
171360
171512
|
`> This window is narrower than ~3 sampling intervals, so every figure carries \xB11 sample (\u2248${res.medianIntervalMs.toFixed(1)}ms).`
|
|
@@ -171367,23 +171519,28 @@ function coverageNote(res, startMs, endMs) {
|
|
|
171367
171519
|
}
|
|
171368
171520
|
return lines.join("\n\n");
|
|
171369
171521
|
}
|
|
171370
|
-
function renderTopFunctions(index, topN2, startMs, endMs) {
|
|
171522
|
+
function renderTopFunctions(index, topN2, startMs, endMs, reactOnly = false) {
|
|
171371
171523
|
const windowStart = startMs ?? index.intervalStartsMs[0] ?? 0;
|
|
171372
171524
|
const windowEnd = endMs ?? index.timestampsMs[index.timestampsMs.length - 1] ?? 0;
|
|
171373
|
-
const res = queryCpuWindow(index, windowStart, windowEnd, topN2);
|
|
171525
|
+
const res = queryCpuWindow(index, windowStart, windowEnd, reactOnly ? Infinity : topN2);
|
|
171374
171526
|
if (res.hotspots.length === 0) return explainEmptyWindow(res, windowStart, windowEnd);
|
|
171375
|
-
const
|
|
171376
|
-
|
|
171377
|
-
|
|
171527
|
+
const hotspots = reactOnly ? res.hotspots.filter((hs) => isReactComponentName(hs.name)).slice(0, topN2) : res.hotspots;
|
|
171528
|
+
if (hotspots.length === 0) {
|
|
171529
|
+
return `_No function sampled in ${windowStart.toFixed(1)}\u2013${windowEnd.toFixed(1)}ms has a PascalCase (React component) name. Query again without react_only to see the JS work._`;
|
|
171530
|
+
}
|
|
171531
|
+
const header = "| Function | Self (ms) | Self % | Total (ms) | Location |";
|
|
171532
|
+
const sep10 = "|---|---|---|---|---|";
|
|
171533
|
+
const rows = hotspots.map((hs) => {
|
|
171378
171534
|
const loc = hs.url ? `${shortenUrl(hs.url)}${hs.lineNumber != null ? `:${hs.lineNumber}` : ""}` : "\u2014";
|
|
171379
|
-
|
|
171535
|
+
const selfPct = res.coveredMs > 0 ? `${(hs.selfMs / res.coveredMs * 100).toFixed(1)}%` : "\u2014";
|
|
171536
|
+
return `| \`${hs.name}\` | ${hs.selfMs} | ${selfPct} | ${hs.totalMs} | ${loc} |`;
|
|
171380
171537
|
});
|
|
171381
171538
|
return `## CPU Hotspots
|
|
171382
171539
|
|
|
171383
|
-
${coverageNote(res, windowStart, windowEnd)}
|
|
171540
|
+
${coverageNote(res, windowStart, windowEnd, reactOnly)}
|
|
171384
171541
|
|
|
171385
171542
|
${header}
|
|
171386
|
-
${
|
|
171543
|
+
${sep10}
|
|
171387
171544
|
${rows.join("\n")}`;
|
|
171388
171545
|
}
|
|
171389
171546
|
function renderCallTree(index, functionName, topN2, includeCallers) {
|
|
@@ -171587,7 +171744,10 @@ var zodSchema59 = external_exports.object({
|
|
|
171587
171744
|
component_name: external_exports.string().optional().describe("Component name"),
|
|
171588
171745
|
function_name: external_exports.string().optional().describe("Function name"),
|
|
171589
171746
|
top_n: external_exports.coerce.number().int().positive().default(15).describe("Number of results to return"),
|
|
171590
|
-
include_callers: external_exports.boolean().default(false).describe("Also show callers of the function")
|
|
171747
|
+
include_callers: external_exports.boolean().default(false).describe("Also show callers of the function"),
|
|
171748
|
+
react_only: external_exports.boolean().default(false).describe(
|
|
171749
|
+
"top_functions and time_window: list only React component functions (PascalCase names)"
|
|
171750
|
+
)
|
|
171591
171751
|
});
|
|
171592
171752
|
var profilerCpuQueryTool = {
|
|
171593
171753
|
id: "profiler-cpu-query",
|
|
@@ -171600,6 +171760,7 @@ Modes:
|
|
|
171600
171760
|
In top_functions and time_window, self-times are the summed sampling intervals of the samples that
|
|
171601
171761
|
landed in the window, so they measure sampled coverage rather than the window's width and do not
|
|
171602
171762
|
change if you widen the query. Their tables state how many samples they cover and how much was idle.
|
|
171763
|
+
Each row is one call path, so a function can have several rows and top_n counts rows.
|
|
171603
171764
|
Use when investigating JS CPU hotspots or correlating CPU cost with specific components.
|
|
171604
171765
|
Returns a markdown table of CPU hotspots, call tree, or per-component CPU breakdown.
|
|
171605
171766
|
Fails if no CPU profile is stored; run react-profiler-stop (and ideally react-profiler-analyze) first.`,
|
|
@@ -171633,7 +171794,8 @@ Fails if no CPU profile is stored; run react-profiler-stop (and ideally react-pr
|
|
|
171633
171794
|
index,
|
|
171634
171795
|
params.top_n,
|
|
171635
171796
|
params.time_window_ms?.start,
|
|
171636
|
-
params.time_window_ms?.end
|
|
171797
|
+
params.time_window_ms?.end,
|
|
171798
|
+
params.react_only
|
|
171637
171799
|
);
|
|
171638
171800
|
case "time_window": {
|
|
171639
171801
|
if (!params.time_window_ms) {
|
|
@@ -171648,7 +171810,8 @@ Fails if no CPU profile is stored; run react-profiler-stop (and ideally react-pr
|
|
|
171648
171810
|
index,
|
|
171649
171811
|
params.top_n,
|
|
171650
171812
|
params.time_window_ms.start,
|
|
171651
|
-
params.time_window_ms.end
|
|
171813
|
+
params.time_window_ms.end,
|
|
171814
|
+
params.react_only
|
|
171652
171815
|
);
|
|
171653
171816
|
}
|
|
171654
171817
|
case "call_tree": {
|
|
@@ -173059,7 +173222,7 @@ Fails if the input has an unknown key (e.g. \`udids\` instead of \`devices\`); o
|
|
|
173059
173222
|
// ../tool-server/src/tools/simulator/stop-metro.ts
|
|
173060
173223
|
init_zod();
|
|
173061
173224
|
var import_node_child_process47 = require("node:child_process");
|
|
173062
|
-
var
|
|
173225
|
+
var import_node_fs18 = require("node:fs");
|
|
173063
173226
|
init_src2();
|
|
173064
173227
|
function parseNetstatListeningPids(netstatOutput, port) {
|
|
173065
173228
|
const pids = /* @__PURE__ */ new Set();
|
|
@@ -173079,7 +173242,7 @@ function procListeningPids(port, proc = "/proc") {
|
|
|
173079
173242
|
for (const table of ["tcp", "tcp6"]) {
|
|
173080
173243
|
let rows;
|
|
173081
173244
|
try {
|
|
173082
|
-
rows = (0,
|
|
173245
|
+
rows = (0, import_node_fs18.readFileSync)(`${proc}/net/${table}`, "utf-8");
|
|
173083
173246
|
} catch (error63) {
|
|
173084
173247
|
if (table === "tcp6" && error63.code === "ENOENT") continue;
|
|
173085
173248
|
throw error63;
|
|
@@ -173094,11 +173257,11 @@ function procListeningPids(port, proc = "/proc") {
|
|
|
173094
173257
|
if (inodes.size === 0) return [];
|
|
173095
173258
|
const owned = /* @__PURE__ */ new Set();
|
|
173096
173259
|
const pids = [];
|
|
173097
|
-
for (const entry of (0,
|
|
173260
|
+
for (const entry of (0, import_node_fs18.readdirSync)(proc)) {
|
|
173098
173261
|
if (!/^\d+$/.test(entry)) continue;
|
|
173099
173262
|
let fds;
|
|
173100
173263
|
try {
|
|
173101
|
-
fds = (0,
|
|
173264
|
+
fds = (0, import_node_fs18.readdirSync)(`${proc}/${entry}/fd`);
|
|
173102
173265
|
} catch {
|
|
173103
173266
|
continue;
|
|
173104
173267
|
}
|
|
@@ -173106,7 +173269,7 @@ function procListeningPids(port, proc = "/proc") {
|
|
|
173106
173269
|
for (const fd of fds) {
|
|
173107
173270
|
let target;
|
|
173108
173271
|
try {
|
|
173109
|
-
target = (0,
|
|
173272
|
+
target = (0, import_node_fs18.readlinkSync)(`${proc}/${entry}/fd/${fd}`);
|
|
173110
173273
|
} catch {
|
|
173111
173274
|
continue;
|
|
173112
173275
|
}
|
|
@@ -173125,8 +173288,8 @@ function procListeningPids(port, proc = "/proc") {
|
|
|
173125
173288
|
}
|
|
173126
173289
|
return pids;
|
|
173127
173290
|
}
|
|
173128
|
-
var LSOF_BIN = ["/usr/sbin/lsof", "/usr/bin/lsof"].find((p) => (0,
|
|
173129
|
-
var DARWIN_NETSTAT_BIN = (0,
|
|
173291
|
+
var LSOF_BIN = ["/usr/sbin/lsof", "/usr/bin/lsof"].find((p) => (0, import_node_fs18.existsSync)(p)) ?? "lsof";
|
|
173292
|
+
var DARWIN_NETSTAT_BIN = (0, import_node_fs18.existsSync)("/usr/sbin/netstat") ? "/usr/sbin/netstat" : "netstat";
|
|
173130
173293
|
function parseDarwinNetstatHasListener(netstatOutput, port) {
|
|
173131
173294
|
return netstatOutput.split("\n").some((line) => {
|
|
173132
173295
|
const cols = line.trim().split(/\s+/);
|
|
@@ -173245,7 +173408,7 @@ init_zod();
|
|
|
173245
173408
|
// ../tool-server/src/tools/flows/flow-utils.ts
|
|
173246
173409
|
var path48 = __toESM(require("node:path"));
|
|
173247
173410
|
var fs63 = __toESM(require("node:fs/promises"));
|
|
173248
|
-
var
|
|
173411
|
+
var import_node_fs19 = require("node:fs");
|
|
173249
173412
|
init_src();
|
|
173250
173413
|
init_src2();
|
|
173251
173414
|
var import_yaml = __toESM(require_dist8());
|
|
@@ -175486,7 +175649,7 @@ async function followDanglingLink(linkPath) {
|
|
|
175486
175649
|
return current;
|
|
175487
175650
|
}
|
|
175488
175651
|
async function isWritable(filePath) {
|
|
175489
|
-
return fs63.access(filePath,
|
|
175652
|
+
return fs63.access(filePath, import_node_fs19.constants.W_OK).then(
|
|
175490
175653
|
() => true,
|
|
175491
175654
|
() => false
|
|
175492
175655
|
);
|
|
@@ -180441,9 +180604,9 @@ function readableFrame(frame2, roots) {
|
|
|
180441
180604
|
return match;
|
|
180442
180605
|
}
|
|
180443
180606
|
for (const root of roots) {
|
|
180444
|
-
const
|
|
180445
|
-
if (
|
|
180446
|
-
return `${
|
|
180607
|
+
const relative9 = path54.relative(root, file2);
|
|
180608
|
+
if (relative9 !== "" && !relative9.startsWith("..") && !path54.isAbsolute(relative9)) {
|
|
180609
|
+
return `${relative9}${position}`;
|
|
180447
180610
|
}
|
|
180448
180611
|
}
|
|
180449
180612
|
return `${file2}${position}`;
|
|
@@ -180790,7 +180953,7 @@ init_src2();
|
|
|
180790
180953
|
|
|
180791
180954
|
// ../tool-server/src/tools/screenshot-diff/screenshot-diff.ts
|
|
180792
180955
|
var import_promises18 = __toESM(require("fs/promises"));
|
|
180793
|
-
var
|
|
180956
|
+
var import_path8 = __toESM(require("path"));
|
|
180794
180957
|
var import_pngjs6 = __toESM(require_png());
|
|
180795
180958
|
init_src2();
|
|
180796
180959
|
|
|
@@ -182511,12 +182674,12 @@ function topRegionsByPixelCount(regions, limit) {
|
|
|
182511
182674
|
function resolveDiffArtifactPaths(options) {
|
|
182512
182675
|
const currentName = outputArtifactBaseName(options.currentPath);
|
|
182513
182676
|
return {
|
|
182514
|
-
diffPath:
|
|
182515
|
-
contextDiffPath:
|
|
182677
|
+
diffPath: import_path8.default.join(options.outputDir, `${currentName}-diff.png`),
|
|
182678
|
+
contextDiffPath: import_path8.default.join(options.outputDir, `${currentName}-context-diff.png`)
|
|
182516
182679
|
};
|
|
182517
182680
|
}
|
|
182518
182681
|
function outputArtifactBaseName(filePath) {
|
|
182519
|
-
const parsed =
|
|
182682
|
+
const parsed = import_path8.default.parse(import_path8.default.basename(filePath));
|
|
182520
182683
|
return parsed.name || parsed.base;
|
|
182521
182684
|
}
|
|
182522
182685
|
async function writeDiffArtifacts(params) {
|
|
@@ -182589,7 +182752,7 @@ function luminanceFromOffset(data, offset) {
|
|
|
182589
182752
|
return 0.2126 * data[offset] + 0.7152 * data[offset + 1] + 0.0722 * data[offset + 2];
|
|
182590
182753
|
}
|
|
182591
182754
|
async function writePngFile(filePath, png) {
|
|
182592
|
-
await import_promises18.default.mkdir(
|
|
182755
|
+
await import_promises18.default.mkdir(import_path8.default.dirname(filePath), { recursive: true });
|
|
182593
182756
|
await import_promises18.default.writeFile(filePath, import_pngjs6.PNG.sync.write(png));
|
|
182594
182757
|
}
|
|
182595
182758
|
function downscalePng(source, scale) {
|
|
@@ -183722,7 +183885,7 @@ var zodSchema71 = external_exports.object({
|
|
|
183722
183885
|
"Write/refresh screenshot baselines for `snapshot` steps instead of diffing against them, also in the e2e tests that tool: e2e-execute steps run, unless such a step sets updateBaselines itself. Over a link, the client writes the new baselines when the run ends."
|
|
183723
183886
|
),
|
|
183724
183887
|
prerequisiteAcknowledged: external_exports.boolean().optional().describe(
|
|
183725
|
-
"Set to true to confirm the execution prerequisite has been met. Required when a fragment defines an executionPrerequisite."
|
|
183888
|
+
"Set to true to confirm the execution prerequisite has been met. Required when a fragment defines an executionPrerequisite: without it, the call runs no step and returns the prerequisite text. Not a dry run: an e2e test with no prerequisite runs in full. To read a prerequisite without running, read executionPrerequisite in the YAML file."
|
|
183726
183889
|
)
|
|
183727
183890
|
}).superRefine((params, ctx) => {
|
|
183728
183891
|
if (params.name === void 0 === (params.e2e_test_path === void 0)) {
|
|
@@ -184843,6 +185006,12 @@ Fails if the e2e test file does not exist.
|
|
|
184843
185006
|
Address the e2e test exactly as you will address it in e2e-execute: name or e2e_test_path, one and only one; supplying both or neither is rejected.`,
|
|
184844
185007
|
zodSchema: zodSchema72,
|
|
184845
185008
|
readOnly: true,
|
|
185009
|
+
// When its gates pass, e2e-execute without prerequisiteAcknowledged returns
|
|
185010
|
+
// the same executionPrerequisite, from the same resolveFlowSource, before any
|
|
185011
|
+
// device work. An invalid test gets the gate's error, and a test with no
|
|
185012
|
+
// prerequisite runs. The SDK, `argent run` and e2e tool: steps still call it,
|
|
185013
|
+
// by its id or its alias.
|
|
185014
|
+
hideFromMcp: true,
|
|
184846
185015
|
aliases: ["flow-read-prerequisite"],
|
|
184847
185016
|
interaction: {
|
|
184848
185017
|
startedMsg: () => "Reading e2e test prerequisite",
|
|
@@ -185364,12 +185533,15 @@ var updateArgentTool = {
|
|
|
185364
185533
|
|
|
185365
185534
|
// ../tool-server/src/tools/system/dismiss-update.ts
|
|
185366
185535
|
init_zod();
|
|
185536
|
+
var MAX_HOURS = 24 * 365 * 10;
|
|
185367
185537
|
var zodSchema75 = external_exports.object({
|
|
185368
|
-
hours: external_exports.number().min(0).describe(
|
|
185538
|
+
hours: external_exports.number().min(0).describe(
|
|
185539
|
+
"Hours until reminders resume: 168 is a week, 87600 is the longest, 0 turns them back on"
|
|
185540
|
+
)
|
|
185369
185541
|
});
|
|
185370
185542
|
var dismissUpdateTool = {
|
|
185371
185543
|
id: "dismiss-update",
|
|
185372
|
-
description: "
|
|
185544
|
+
description: "Postpone the Argent update reminder, on every tool-server on this machine, when the user wants it later or tomorrow, wants it stopped, or never wants it (87600 hours). Installs nothing. A memory or a reminder of your own does not change it. Returns { message, remindersResumeAt, persisted, pendingVersion }: tell the user when reminders resume, and if persisted is false, that it did not fully hold.",
|
|
185373
185545
|
zodSchema: zodSchema75,
|
|
185374
185546
|
interaction: {
|
|
185375
185547
|
startedMsg: () => "Dismissing Argent update",
|
|
@@ -185378,10 +185550,27 @@ var dismissUpdateTool = {
|
|
|
185378
185550
|
},
|
|
185379
185551
|
services: () => ({}),
|
|
185380
185552
|
async execute(_services, params, _options) {
|
|
185381
|
-
const
|
|
185382
|
-
suppressUpdateNote(
|
|
185553
|
+
const hours = Math.min(params.hours, MAX_HOURS);
|
|
185554
|
+
const { until, persisted } = suppressUpdateNote(hours * 60 * 60 * 1e3);
|
|
185555
|
+
const { updateInstallable, installableVersion } = getUpdateState();
|
|
185556
|
+
const pendingVersion = updateInstallable ? installableVersion : null;
|
|
185557
|
+
const end = new Date(until);
|
|
185558
|
+
const local = end.toLocaleString("en-US", { dateStyle: "medium", timeStyle: "short" });
|
|
185559
|
+
if (hours === 0) {
|
|
185560
|
+
return {
|
|
185561
|
+
message: pendingVersion ? `Update reminders are back on, so the reminder for v${pendingVersion} shows again.` : "Update reminders are back on. No update is pending right now.",
|
|
185562
|
+
remindersResumeAt: null,
|
|
185563
|
+
persisted,
|
|
185564
|
+
pendingVersion
|
|
185565
|
+
};
|
|
185566
|
+
}
|
|
185567
|
+
const pending = pendingVersion ? `v${pendingVersion} stays available and nothing was installed.` : `No update is pending right now; one that appears before then stays silent too.`;
|
|
185568
|
+
const scope = persisted ? `on every Argent tool-server on this machine` : `in this tool-server only, and only until it restarts: ~/.argent could not be written, so other tool-servers still show reminders`;
|
|
185383
185569
|
return {
|
|
185384
|
-
message:
|
|
185570
|
+
message: `Update reminders are off until ${local} (${end.toISOString()}) ${scope}. ${pending} Tell the user when reminders resume. Remove any saved reminder about this update from your task list and do not bring it up again unless the user asks.`,
|
|
185571
|
+
remindersResumeAt: end.toISOString(),
|
|
185572
|
+
persisted,
|
|
185573
|
+
pendingVersion
|
|
185385
185574
|
};
|
|
185386
185575
|
}
|
|
185387
185576
|
};
|
|
@@ -185390,7 +185579,7 @@ var dismissUpdateTool = {
|
|
|
185390
185579
|
var import_node_crypto16 = __toESM(require("node:crypto"));
|
|
185391
185580
|
var import_promises20 = __toESM(require("fs/promises"));
|
|
185392
185581
|
var import_node_os17 = __toESM(require("node:os"));
|
|
185393
|
-
var
|
|
185582
|
+
var import_path9 = __toESM(require("path"));
|
|
185394
185583
|
init_zod();
|
|
185395
185584
|
init_src2();
|
|
185396
185585
|
init_device_info();
|
|
@@ -185539,7 +185728,7 @@ async function resolveOutputDir(params, options) {
|
|
|
185539
185728
|
if (err.code === "EEXIST") return params.outputDir;
|
|
185540
185729
|
}
|
|
185541
185730
|
}
|
|
185542
|
-
const dir =
|
|
185731
|
+
const dir = import_path9.default.join(
|
|
185543
185732
|
import_node_os17.default.tmpdir(),
|
|
185544
185733
|
"argent-screenshot-diff",
|
|
185545
185734
|
import_node_crypto16.default.randomBytes(6).toString("hex")
|
|
@@ -185648,7 +185837,7 @@ async function captureIosDeviceLiveInput(params) {
|
|
|
185648
185837
|
}
|
|
185649
185838
|
async function writeLivePng(outputDir, name, png) {
|
|
185650
185839
|
const suffix = import_node_crypto16.default.randomBytes(4).toString("hex");
|
|
185651
|
-
const destination =
|
|
185840
|
+
const destination = import_path9.default.join(outputDir, `${name}-${suffix}.live.png`);
|
|
185652
185841
|
await import_promises20.default.mkdir(outputDir, { recursive: true });
|
|
185653
185842
|
await import_promises20.default.writeFile(destination, png);
|
|
185654
185843
|
return destination;
|
|
@@ -185666,7 +185855,7 @@ async function captureHarmonyLiveInput(params) {
|
|
|
185666
185855
|
await ensureDep("hdc");
|
|
185667
185856
|
const captured = await captureHarmonyScreenshotPng({ connectKey: params.connectKey, scale: 1 });
|
|
185668
185857
|
const suffix = import_node_crypto16.default.randomBytes(4).toString("hex");
|
|
185669
|
-
const destination =
|
|
185858
|
+
const destination = import_path9.default.join(params.outputDir, `${params.name}-${suffix}.live.png`);
|
|
185670
185859
|
try {
|
|
185671
185860
|
await import_promises20.default.mkdir(params.outputDir, { recursive: true });
|
|
185672
185861
|
await import_promises20.default.copyFile(captured, destination);
|
|
@@ -185702,7 +185891,7 @@ async function captureLiveInput(params) {
|
|
|
185702
185891
|
);
|
|
185703
185892
|
}
|
|
185704
185893
|
const suffix = import_node_crypto16.default.randomBytes(4).toString("hex");
|
|
185705
|
-
const destination =
|
|
185894
|
+
const destination = import_path9.default.join(params.outputDir, `${params.name}-${suffix}.live.png`);
|
|
185706
185895
|
await import_promises20.default.mkdir(params.outputDir, { recursive: true });
|
|
185707
185896
|
await import_promises20.default.copyFile(capture.path, destination);
|
|
185708
185897
|
return {
|
|
@@ -186220,6 +186409,9 @@ Use when seeding feature flags / auth tokens before an e2e test or asserting per
|
|
|
186220
186409
|
Returns { value } for one key, { entries, count } for all keys, and { set } / { removed } / { cleared } for the writes. Fails if the device is not a Chromium (CDP) device, or the action is missing the \`key\` / \`value\` it needs.`,
|
|
186221
186410
|
zodSchema: zodSchema81,
|
|
186222
186411
|
searchHint: "storage localstorage sessionstorage local session get set remove clear key value chromium",
|
|
186412
|
+
// Agents read and write Web Storage with debugger-evaluate, which runs the same
|
|
186413
|
+
// Runtime.evaluate on the active page. The SDK and the e2e-full suite still call it.
|
|
186414
|
+
hideFromMcp: true,
|
|
186223
186415
|
interaction: {
|
|
186224
186416
|
startedMsg: ({ params }) => `${storageAction[params.action].started} ${params.store} storage`,
|
|
186225
186417
|
completedMsg: ({ params }) => `${storageAction[params.action].completed} ${params.store} storage`,
|