@swmansion/argent 0.14.1-next.10 → 0.14.1-next.11
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/mcp-server.mjs +15 -2
- package/dist/tool-server.cjs +300 -177
- package/package.json +1 -1
package/dist/mcp-server.mjs
CHANGED
|
@@ -18810,8 +18810,21 @@ async function startMcpServer(options) {
|
|
|
18810
18810
|
}
|
|
18811
18811
|
const udid = getUdidFromArgs(params.arguments);
|
|
18812
18812
|
if (autoScreenshotOn && udid && shouldAutoScreenshot(params.name)) {
|
|
18813
|
-
const
|
|
18814
|
-
if (
|
|
18813
|
+
const maxWaitMs = getAutoScreenshotDelayMs(params.name);
|
|
18814
|
+
if (maxWaitMs > 0) {
|
|
18815
|
+
try {
|
|
18816
|
+
const idle = await callTool("await-screen-idle", { udid, timeoutMs: maxWaitMs });
|
|
18817
|
+
await spyLog({
|
|
18818
|
+
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
18819
|
+
event: "auto_screenshot_readiness",
|
|
18820
|
+
name: params.name,
|
|
18821
|
+
maxWaitMs,
|
|
18822
|
+
...idle.result
|
|
18823
|
+
});
|
|
18824
|
+
} catch {
|
|
18825
|
+
await new Promise((r) => setTimeout(r, maxWaitMs));
|
|
18826
|
+
}
|
|
18827
|
+
}
|
|
18815
18828
|
try {
|
|
18816
18829
|
const screenshotResult = await callTool("screenshot", { udid });
|
|
18817
18830
|
const screenshotContent = await toMcpContent(screenshotResult.result, "image", {
|
package/dist/tool-server.cjs
CHANGED
|
@@ -12075,8 +12075,8 @@ function finalize(ctx, schema) {
|
|
|
12075
12075
|
const root2 = ctx.seen.get(schema);
|
|
12076
12076
|
if (!root2)
|
|
12077
12077
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
12078
|
-
const flattenRef = (
|
|
12079
|
-
const seen = ctx.seen.get(
|
|
12078
|
+
const flattenRef = (zodSchema71) => {
|
|
12079
|
+
const seen = ctx.seen.get(zodSchema71);
|
|
12080
12080
|
if (seen.ref === null)
|
|
12081
12081
|
return;
|
|
12082
12082
|
const schema2 = seen.def ?? seen.schema;
|
|
@@ -12094,7 +12094,7 @@ function finalize(ctx, schema) {
|
|
|
12094
12094
|
Object.assign(schema2, refSchema);
|
|
12095
12095
|
}
|
|
12096
12096
|
Object.assign(schema2, _cached);
|
|
12097
|
-
const isParentRef =
|
|
12097
|
+
const isParentRef = zodSchema71._zod.parent === ref;
|
|
12098
12098
|
if (isParentRef) {
|
|
12099
12099
|
for (const key in schema2) {
|
|
12100
12100
|
if (key === "$ref" || key === "allOf")
|
|
@@ -12114,7 +12114,7 @@ function finalize(ctx, schema) {
|
|
|
12114
12114
|
}
|
|
12115
12115
|
}
|
|
12116
12116
|
}
|
|
12117
|
-
const parent =
|
|
12117
|
+
const parent = zodSchema71._zod.parent;
|
|
12118
12118
|
if (parent && parent !== ref) {
|
|
12119
12119
|
flattenRef(parent);
|
|
12120
12120
|
const parentSeen = ctx.seen.get(parent);
|
|
@@ -12132,7 +12132,7 @@ function finalize(ctx, schema) {
|
|
|
12132
12132
|
}
|
|
12133
12133
|
}
|
|
12134
12134
|
ctx.override({
|
|
12135
|
-
zodSchema:
|
|
12135
|
+
zodSchema: zodSchema71,
|
|
12136
12136
|
jsonSchema: schema2,
|
|
12137
12137
|
path: seen.path ?? []
|
|
12138
12138
|
});
|
|
@@ -14933,10 +14933,10 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14933
14933
|
}
|
|
14934
14934
|
ctx.processing.add(refPath);
|
|
14935
14935
|
const resolved = resolveRef(refPath, ctx);
|
|
14936
|
-
const
|
|
14937
|
-
ctx.refs.set(refPath,
|
|
14936
|
+
const zodSchema72 = convertSchema(resolved, ctx);
|
|
14937
|
+
ctx.refs.set(refPath, zodSchema72);
|
|
14938
14938
|
ctx.processing.delete(refPath);
|
|
14939
|
-
return
|
|
14939
|
+
return zodSchema72;
|
|
14940
14940
|
}
|
|
14941
14941
|
if (schema.enum !== void 0) {
|
|
14942
14942
|
const enumValues = schema.enum;
|
|
@@ -14978,7 +14978,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14978
14978
|
if (!type) {
|
|
14979
14979
|
return z.any();
|
|
14980
14980
|
}
|
|
14981
|
-
let
|
|
14981
|
+
let zodSchema71;
|
|
14982
14982
|
switch (type) {
|
|
14983
14983
|
case "string": {
|
|
14984
14984
|
let stringSchema = z.string();
|
|
@@ -15041,7 +15041,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15041
15041
|
if (schema.pattern) {
|
|
15042
15042
|
stringSchema = stringSchema.regex(new RegExp(schema.pattern));
|
|
15043
15043
|
}
|
|
15044
|
-
|
|
15044
|
+
zodSchema71 = stringSchema;
|
|
15045
15045
|
break;
|
|
15046
15046
|
}
|
|
15047
15047
|
case "number":
|
|
@@ -15066,15 +15066,15 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15066
15066
|
if (typeof schema.multipleOf === "number") {
|
|
15067
15067
|
numberSchema = numberSchema.multipleOf(schema.multipleOf);
|
|
15068
15068
|
}
|
|
15069
|
-
|
|
15069
|
+
zodSchema71 = numberSchema;
|
|
15070
15070
|
break;
|
|
15071
15071
|
}
|
|
15072
15072
|
case "boolean": {
|
|
15073
|
-
|
|
15073
|
+
zodSchema71 = z.boolean();
|
|
15074
15074
|
break;
|
|
15075
15075
|
}
|
|
15076
15076
|
case "null": {
|
|
15077
|
-
|
|
15077
|
+
zodSchema71 = z.null();
|
|
15078
15078
|
break;
|
|
15079
15079
|
}
|
|
15080
15080
|
case "object": {
|
|
@@ -15089,12 +15089,12 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15089
15089
|
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
15090
15090
|
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z.any();
|
|
15091
15091
|
if (Object.keys(shape).length === 0) {
|
|
15092
|
-
|
|
15092
|
+
zodSchema71 = z.record(keySchema, valueSchema);
|
|
15093
15093
|
break;
|
|
15094
15094
|
}
|
|
15095
15095
|
const objectSchema2 = z.object(shape).passthrough();
|
|
15096
15096
|
const recordSchema = z.looseRecord(keySchema, valueSchema);
|
|
15097
|
-
|
|
15097
|
+
zodSchema71 = z.intersection(objectSchema2, recordSchema);
|
|
15098
15098
|
break;
|
|
15099
15099
|
}
|
|
15100
15100
|
if (schema.patternProperties) {
|
|
@@ -15112,25 +15112,25 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15112
15112
|
}
|
|
15113
15113
|
schemasToIntersect.push(...looseRecords);
|
|
15114
15114
|
if (schemasToIntersect.length === 0) {
|
|
15115
|
-
|
|
15115
|
+
zodSchema71 = z.object({}).passthrough();
|
|
15116
15116
|
} else if (schemasToIntersect.length === 1) {
|
|
15117
|
-
|
|
15117
|
+
zodSchema71 = schemasToIntersect[0];
|
|
15118
15118
|
} else {
|
|
15119
15119
|
let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
15120
15120
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
15121
15121
|
result = z.intersection(result, schemasToIntersect[i]);
|
|
15122
15122
|
}
|
|
15123
|
-
|
|
15123
|
+
zodSchema71 = result;
|
|
15124
15124
|
}
|
|
15125
15125
|
break;
|
|
15126
15126
|
}
|
|
15127
15127
|
const objectSchema = z.object(shape);
|
|
15128
15128
|
if (schema.additionalProperties === false) {
|
|
15129
|
-
|
|
15129
|
+
zodSchema71 = objectSchema.strict();
|
|
15130
15130
|
} else if (typeof schema.additionalProperties === "object") {
|
|
15131
|
-
|
|
15131
|
+
zodSchema71 = objectSchema.catchall(convertSchema(schema.additionalProperties, ctx));
|
|
15132
15132
|
} else {
|
|
15133
|
-
|
|
15133
|
+
zodSchema71 = objectSchema.passthrough();
|
|
15134
15134
|
}
|
|
15135
15135
|
break;
|
|
15136
15136
|
}
|
|
@@ -15141,29 +15141,29 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15141
15141
|
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
15142
15142
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
15143
15143
|
if (rest) {
|
|
15144
|
-
|
|
15144
|
+
zodSchema71 = z.tuple(tupleItems).rest(rest);
|
|
15145
15145
|
} else {
|
|
15146
|
-
|
|
15146
|
+
zodSchema71 = z.tuple(tupleItems);
|
|
15147
15147
|
}
|
|
15148
15148
|
if (typeof schema.minItems === "number") {
|
|
15149
|
-
|
|
15149
|
+
zodSchema71 = zodSchema71.check(z.minLength(schema.minItems));
|
|
15150
15150
|
}
|
|
15151
15151
|
if (typeof schema.maxItems === "number") {
|
|
15152
|
-
|
|
15152
|
+
zodSchema71 = zodSchema71.check(z.maxLength(schema.maxItems));
|
|
15153
15153
|
}
|
|
15154
15154
|
} else if (Array.isArray(items)) {
|
|
15155
15155
|
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
15156
15156
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
15157
15157
|
if (rest) {
|
|
15158
|
-
|
|
15158
|
+
zodSchema71 = z.tuple(tupleItems).rest(rest);
|
|
15159
15159
|
} else {
|
|
15160
|
-
|
|
15160
|
+
zodSchema71 = z.tuple(tupleItems);
|
|
15161
15161
|
}
|
|
15162
15162
|
if (typeof schema.minItems === "number") {
|
|
15163
|
-
|
|
15163
|
+
zodSchema71 = zodSchema71.check(z.minLength(schema.minItems));
|
|
15164
15164
|
}
|
|
15165
15165
|
if (typeof schema.maxItems === "number") {
|
|
15166
|
-
|
|
15166
|
+
zodSchema71 = zodSchema71.check(z.maxLength(schema.maxItems));
|
|
15167
15167
|
}
|
|
15168
15168
|
} else if (items !== void 0) {
|
|
15169
15169
|
const element = convertSchema(items, ctx);
|
|
@@ -15174,16 +15174,16 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15174
15174
|
if (typeof schema.maxItems === "number") {
|
|
15175
15175
|
arraySchema = arraySchema.max(schema.maxItems);
|
|
15176
15176
|
}
|
|
15177
|
-
|
|
15177
|
+
zodSchema71 = arraySchema;
|
|
15178
15178
|
} else {
|
|
15179
|
-
|
|
15179
|
+
zodSchema71 = z.array(z.any());
|
|
15180
15180
|
}
|
|
15181
15181
|
break;
|
|
15182
15182
|
}
|
|
15183
15183
|
default:
|
|
15184
15184
|
throw new Error(`Unsupported type: ${type}`);
|
|
15185
15185
|
}
|
|
15186
|
-
return
|
|
15186
|
+
return zodSchema71;
|
|
15187
15187
|
}
|
|
15188
15188
|
function convertSchema(schema, ctx) {
|
|
15189
15189
|
if (typeof schema === "boolean") {
|
|
@@ -102451,23 +102451,23 @@ var NotImplementedOnPlatformError = class extends Error {
|
|
|
102451
102451
|
});
|
|
102452
102452
|
}
|
|
102453
102453
|
};
|
|
102454
|
-
function platformMatrix(platform,
|
|
102454
|
+
function platformMatrix(platform, capability29) {
|
|
102455
102455
|
switch (platform) {
|
|
102456
102456
|
case "ios":
|
|
102457
|
-
return
|
|
102457
|
+
return capability29.apple;
|
|
102458
102458
|
case "ios-remote":
|
|
102459
|
-
return
|
|
102459
|
+
return capability29.appleRemote;
|
|
102460
102460
|
case "android":
|
|
102461
|
-
return
|
|
102461
|
+
return capability29.android;
|
|
102462
102462
|
case "chromium":
|
|
102463
|
-
return
|
|
102463
|
+
return capability29.chromium;
|
|
102464
102464
|
case "vega":
|
|
102465
|
-
return
|
|
102465
|
+
return capability29.vega;
|
|
102466
102466
|
}
|
|
102467
102467
|
}
|
|
102468
|
-
function assertSupported(toolId,
|
|
102469
|
-
if (!
|
|
102470
|
-
const matrix = platformMatrix(device.platform,
|
|
102468
|
+
function assertSupported(toolId, capability29, device) {
|
|
102469
|
+
if (!capability29) return;
|
|
102470
|
+
const matrix = platformMatrix(device.platform, capability29);
|
|
102471
102471
|
if (!matrix) {
|
|
102472
102472
|
throw new UnsupportedOperationError(toolId, device, `no ${device.platform} support declared`);
|
|
102473
102473
|
}
|
|
@@ -102475,7 +102475,7 @@ function assertSupported(toolId, capability28, device) {
|
|
|
102475
102475
|
if (!supported) {
|
|
102476
102476
|
throw new UnsupportedOperationError(toolId, device, `kind '${device.kind}' not supported`);
|
|
102477
102477
|
}
|
|
102478
|
-
if (
|
|
102478
|
+
if (capability29.supports && !capability29.supports(device)) {
|
|
102479
102479
|
throw new UnsupportedOperationError(toolId, device, "supports() refiner rejected device");
|
|
102480
102480
|
}
|
|
102481
102481
|
}
|
|
@@ -109462,6 +109462,28 @@ function sleepOrAbort(ms, signal) {
|
|
|
109462
109462
|
signal?.addEventListener("abort", onAbort, { once: true });
|
|
109463
109463
|
});
|
|
109464
109464
|
}
|
|
109465
|
+
function settleWithin(p, ms, signal) {
|
|
109466
|
+
return new Promise((resolve5) => {
|
|
109467
|
+
let done = false;
|
|
109468
|
+
const teardown = [];
|
|
109469
|
+
const finish = (r) => {
|
|
109470
|
+
if (done) return;
|
|
109471
|
+
done = true;
|
|
109472
|
+
for (const fn of teardown) fn();
|
|
109473
|
+
resolve5(r);
|
|
109474
|
+
};
|
|
109475
|
+
p.then(
|
|
109476
|
+
(value) => finish({ type: "value", value }),
|
|
109477
|
+
(err) => finish({ type: "error", error: err instanceof Error ? err.message : String(err) })
|
|
109478
|
+
);
|
|
109479
|
+
if (signal?.aborted) return finish({ type: "aborted" });
|
|
109480
|
+
const onAbort = () => finish({ type: "aborted" });
|
|
109481
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
109482
|
+
teardown.push(() => signal?.removeEventListener("abort", onAbort));
|
|
109483
|
+
const timer = setTimeout(() => finish({ type: "timeout" }), Math.max(0, ms));
|
|
109484
|
+
teardown.push(() => clearTimeout(timer));
|
|
109485
|
+
});
|
|
109486
|
+
}
|
|
109465
109487
|
|
|
109466
109488
|
// ../tool-server/src/utils/simulator-client.ts
|
|
109467
109489
|
var fs9 = __toESM(require("node:fs/promises"));
|
|
@@ -121856,6 +121878,49 @@ async function invokeSubTool(registry2, ctx, toolId, args) {
|
|
|
121856
121878
|
// ../tool-server/src/tools/await-ui-element/index.ts
|
|
121857
121879
|
init_zod();
|
|
121858
121880
|
|
|
121881
|
+
// ../tool-server/src/utils/poll-describe-tree.ts
|
|
121882
|
+
async function pollDescribeTree(args) {
|
|
121883
|
+
const { fetchTree, timeoutMs, pollIntervalMs, signal, onSample } = args;
|
|
121884
|
+
const start2 = Date.now();
|
|
121885
|
+
const deadline = start2 + timeoutMs;
|
|
121886
|
+
let polls = 0;
|
|
121887
|
+
let lastData = null;
|
|
121888
|
+
let lastError;
|
|
121889
|
+
const outcome = (result, aborted2) => ({
|
|
121890
|
+
result,
|
|
121891
|
+
aborted: aborted2,
|
|
121892
|
+
polls,
|
|
121893
|
+
elapsedMs: Date.now() - start2,
|
|
121894
|
+
lastData,
|
|
121895
|
+
lastError
|
|
121896
|
+
});
|
|
121897
|
+
for (; ; ) {
|
|
121898
|
+
if (signal?.aborted) return outcome(void 0, true);
|
|
121899
|
+
const remaining = Math.max(0, deadline - Date.now());
|
|
121900
|
+
const settled = await settleWithin(fetchTree(), remaining, signal);
|
|
121901
|
+
polls += 1;
|
|
121902
|
+
if (settled.type === "aborted") return outcome(void 0, true);
|
|
121903
|
+
if (settled.type === "timeout") {
|
|
121904
|
+
if (lastData === null) {
|
|
121905
|
+
lastError ??= `tree fetch did not complete within the ${timeoutMs}ms wait budget`;
|
|
121906
|
+
}
|
|
121907
|
+
break;
|
|
121908
|
+
}
|
|
121909
|
+
if (settled.type === "error") {
|
|
121910
|
+
lastError = settled.error;
|
|
121911
|
+
} else {
|
|
121912
|
+
lastData = settled.value;
|
|
121913
|
+
lastError = void 0;
|
|
121914
|
+
const verdict = onSample(settled.value, Date.now());
|
|
121915
|
+
if (verdict.done) return outcome(verdict.result, false);
|
|
121916
|
+
}
|
|
121917
|
+
if (Date.now() >= deadline) break;
|
|
121918
|
+
const sleepMs = Math.min(pollIntervalMs, Math.max(0, deadline - Date.now()));
|
|
121919
|
+
if (!await sleepOrAbort(sleepMs, signal)) return outcome(void 0, true);
|
|
121920
|
+
}
|
|
121921
|
+
return outcome(void 0, false);
|
|
121922
|
+
}
|
|
121923
|
+
|
|
121859
121924
|
// ../tool-server/src/tools/describe/platforms/chromium.ts
|
|
121860
121925
|
init_src();
|
|
121861
121926
|
var DESCRIBE_FAILURE = {
|
|
@@ -122443,28 +122508,6 @@ function timeoutNote(params, lastTree, fetchError, lastData) {
|
|
|
122443
122508
|
}
|
|
122444
122509
|
return appendDiagnostics(base, lastData);
|
|
122445
122510
|
}
|
|
122446
|
-
function settleWithin(p, ms, signal) {
|
|
122447
|
-
return new Promise((resolve5) => {
|
|
122448
|
-
let done = false;
|
|
122449
|
-
const teardown = [];
|
|
122450
|
-
const finish = (r) => {
|
|
122451
|
-
if (done) return;
|
|
122452
|
-
done = true;
|
|
122453
|
-
for (const fn of teardown) fn();
|
|
122454
|
-
resolve5(r);
|
|
122455
|
-
};
|
|
122456
|
-
p.then(
|
|
122457
|
-
(value) => finish({ type: "value", value }),
|
|
122458
|
-
(err) => finish({ type: "error", error: err instanceof Error ? err.message : String(err) })
|
|
122459
|
-
);
|
|
122460
|
-
if (signal?.aborted) return finish({ type: "aborted" });
|
|
122461
|
-
const onAbort = () => finish({ type: "aborted" });
|
|
122462
|
-
signal?.addEventListener("abort", onAbort, { once: true });
|
|
122463
|
-
teardown.push(() => signal?.removeEventListener("abort", onAbort));
|
|
122464
|
-
const timer = setTimeout(() => finish({ type: "timeout" }), Math.max(0, ms));
|
|
122465
|
-
teardown.push(() => clearTimeout(timer));
|
|
122466
|
-
});
|
|
122467
|
-
}
|
|
122468
122511
|
function createAwaitUiElementTool(registry2) {
|
|
122469
122512
|
async function fetchTree(device, params, services, isTvOs) {
|
|
122470
122513
|
if (device.platform === "ios") {
|
|
@@ -122522,34 +122565,14 @@ or before tapping an element that appears asynchronously.`,
|
|
|
122522
122565
|
});
|
|
122523
122566
|
const timeoutMs = params.timeoutMs ?? DEFAULT_TIMEOUT_MS3;
|
|
122524
122567
|
const pollIntervalMs = params.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS;
|
|
122525
|
-
const deadline = start2 + timeoutMs;
|
|
122526
122568
|
const selector = params.selector;
|
|
122527
|
-
let lastTree = null;
|
|
122528
|
-
let lastData = null;
|
|
122529
|
-
let fetchError;
|
|
122530
122569
|
let everMatched = false;
|
|
122531
|
-
|
|
122532
|
-
|
|
122533
|
-
|
|
122534
|
-
|
|
122535
|
-
|
|
122536
|
-
|
|
122537
|
-
signal
|
|
122538
|
-
);
|
|
122539
|
-
if (settled.type === "aborted") return cancelled();
|
|
122540
|
-
if (settled.type === "timeout") {
|
|
122541
|
-
if (lastTree === null) {
|
|
122542
|
-
fetchError ??= `tree fetch did not complete within the ${timeoutMs}ms wait budget`;
|
|
122543
|
-
}
|
|
122544
|
-
break;
|
|
122545
|
-
}
|
|
122546
|
-
if (settled.type === "error") {
|
|
122547
|
-
fetchError = settled.error;
|
|
122548
|
-
} else {
|
|
122549
|
-
const data = settled.value;
|
|
122550
|
-
lastData = data;
|
|
122551
|
-
lastTree = data.tree;
|
|
122552
|
-
fetchError = void 0;
|
|
122570
|
+
const poll = await pollDescribeTree({
|
|
122571
|
+
fetchTree: () => fetchTree(device, params, services, isTvOs),
|
|
122572
|
+
timeoutMs,
|
|
122573
|
+
pollIntervalMs,
|
|
122574
|
+
signal,
|
|
122575
|
+
onSample: (data) => {
|
|
122553
122576
|
const matches2 = findAll(data.tree, selector);
|
|
122554
122577
|
if (matches2.length > 0) everMatched = true;
|
|
122555
122578
|
const blind = isBlindRead(data, everMatched);
|
|
@@ -122558,17 +122581,17 @@ or before tapping an element that appears asynchronously.`,
|
|
|
122558
122581
|
if (params.condition === "hidden" && !everMatched) {
|
|
122559
122582
|
result.note = "condition met immediately \u2014 the selector never matched any element, so it may have already been hidden before the wait, or the selector is wrong";
|
|
122560
122583
|
}
|
|
122561
|
-
return result;
|
|
122584
|
+
return { done: true, result };
|
|
122562
122585
|
}
|
|
122586
|
+
return { done: false };
|
|
122563
122587
|
}
|
|
122564
|
-
|
|
122565
|
-
|
|
122566
|
-
|
|
122567
|
-
}
|
|
122588
|
+
});
|
|
122589
|
+
if (poll.aborted) return cancelled();
|
|
122590
|
+
if (poll.result) return poll.result;
|
|
122568
122591
|
return {
|
|
122569
122592
|
success: false,
|
|
122570
122593
|
elapsed: Date.now() - start2,
|
|
122571
|
-
note: timeoutNote(params,
|
|
122594
|
+
note: timeoutNote(params, poll.lastData?.tree ?? null, poll.lastError, poll.lastData)
|
|
122572
122595
|
};
|
|
122573
122596
|
}
|
|
122574
122597
|
};
|
|
@@ -130153,6 +130176,105 @@ back/menu/home), then call describe again to confirm where focus landed.`,
|
|
|
130153
130176
|
};
|
|
130154
130177
|
}
|
|
130155
130178
|
|
|
130179
|
+
// ../tool-server/src/tools/await-screen-idle/index.ts
|
|
130180
|
+
init_zod();
|
|
130181
|
+
var AWAIT_SCREEN_IDLE_TOOL_ID = "await-screen-idle";
|
|
130182
|
+
var DEFAULT_TIMEOUT_MS4 = 3e3;
|
|
130183
|
+
var DEFAULT_POLL_INTERVAL_MS2 = 200;
|
|
130184
|
+
var DEFAULT_MIN_STABLE_MS = 250;
|
|
130185
|
+
var zodSchema38 = external_exports.object({
|
|
130186
|
+
udid: external_exports.string().min(1).describe("Target device id from `list-devices` (iOS UDID, Android serial, or Chromium id)."),
|
|
130187
|
+
timeoutMs: external_exports.number().int().positive().max(12e4).optional().describe(
|
|
130188
|
+
`Max time to wait for the screen to settle before giving up (default ${DEFAULT_TIMEOUT_MS4}).`
|
|
130189
|
+
),
|
|
130190
|
+
pollIntervalMs: external_exports.number().int().min(50).max(5e3).optional().describe(`How often to re-read the tree (default ${DEFAULT_POLL_INTERVAL_MS2}).`),
|
|
130191
|
+
minStableMs: external_exports.number().int().min(0).max(1e4).optional().describe(
|
|
130192
|
+
`The screen must hold the same content for at least this long to count as settled (default ${DEFAULT_MIN_STABLE_MS}).`
|
|
130193
|
+
)
|
|
130194
|
+
});
|
|
130195
|
+
var capability21 = {
|
|
130196
|
+
apple: { simulator: true, device: true },
|
|
130197
|
+
android: { emulator: true, device: true, unknown: true },
|
|
130198
|
+
chromium: { app: true }
|
|
130199
|
+
};
|
|
130200
|
+
function treeSignature(root2) {
|
|
130201
|
+
const round2 = (n) => Math.round(n * 100) / 100;
|
|
130202
|
+
const parts = [];
|
|
130203
|
+
const walk = (node) => {
|
|
130204
|
+
const f = node.frame;
|
|
130205
|
+
parts.push(
|
|
130206
|
+
`${node.role}|${node.label ?? ""}|${node.value ?? ""}|${round2(f.x)},${round2(f.y)},${round2(f.width)},${round2(f.height)}`
|
|
130207
|
+
);
|
|
130208
|
+
for (const child of node.children) walk(child);
|
|
130209
|
+
};
|
|
130210
|
+
for (const child of root2.children) walk(child);
|
|
130211
|
+
return parts.join("\n");
|
|
130212
|
+
}
|
|
130213
|
+
function createAwaitScreenIdleTool(registry2) {
|
|
130214
|
+
function fetchTree(device, services, isTvOs) {
|
|
130215
|
+
if (device.platform === "ios") {
|
|
130216
|
+
return describeIos(registry2, device, {}, { isTvOs });
|
|
130217
|
+
}
|
|
130218
|
+
if (device.platform === "android") {
|
|
130219
|
+
return describeAndroid(registry2, device.id);
|
|
130220
|
+
}
|
|
130221
|
+
return describeChromium(services.chromium);
|
|
130222
|
+
}
|
|
130223
|
+
return {
|
|
130224
|
+
id: AWAIT_SCREEN_IDLE_TOOL_ID,
|
|
130225
|
+
description: `Block until the screen has rendered content and stopped changing, or a timeout elapses.
|
|
130226
|
+
|
|
130227
|
+
Polls the same accessibility / DOM tree as \`describe\` every pollIntervalMs (default ${DEFAULT_POLL_INTERVAL_MS2}ms) until it
|
|
130228
|
+
has content and that content holds identical for minStableMs (default ${DEFAULT_MIN_STABLE_MS}ms), or timeoutMs (default
|
|
130229
|
+
${DEFAULT_TIMEOUT_MS4}ms) is reached. Returns { settled, waitedMs, polls } \u2014 settled=false means the screen never went
|
|
130230
|
+
still before the timeout. Use after a launch/navigation to wait for the UI to render before screenshotting or tapping.`,
|
|
130231
|
+
searchHint: "wait until screen settles idle stable stops changing animation transition rendered ready before screenshot",
|
|
130232
|
+
longRunning: true,
|
|
130233
|
+
zodSchema: zodSchema38,
|
|
130234
|
+
capability: capability21,
|
|
130235
|
+
services: (params) => {
|
|
130236
|
+
const device = resolveDevice(params.udid);
|
|
130237
|
+
if (device.platform === "chromium") {
|
|
130238
|
+
return { chromium: chromiumCdpRef(device) };
|
|
130239
|
+
}
|
|
130240
|
+
return {};
|
|
130241
|
+
},
|
|
130242
|
+
async execute(services, params, ctx) {
|
|
130243
|
+
const device = resolveDevice(params.udid);
|
|
130244
|
+
assertSupported(AWAIT_SCREEN_IDLE_TOOL_ID, capability21, device);
|
|
130245
|
+
if (device.platform === "ios") await ensureDeps(iosRequires);
|
|
130246
|
+
else if (device.platform === "android") await ensureDeps(androidRequires);
|
|
130247
|
+
const isTvOs = device.platform === "ios" && await isTvOsSimulator(device.id);
|
|
130248
|
+
const minStableMs = params.minStableMs ?? DEFAULT_MIN_STABLE_MS;
|
|
130249
|
+
let stableSignature;
|
|
130250
|
+
let stableSince = 0;
|
|
130251
|
+
const poll = await pollDescribeTree({
|
|
130252
|
+
fetchTree: () => fetchTree(device, services, isTvOs),
|
|
130253
|
+
timeoutMs: params.timeoutMs ?? DEFAULT_TIMEOUT_MS4,
|
|
130254
|
+
pollIntervalMs: params.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS2,
|
|
130255
|
+
signal: ctx?.signal,
|
|
130256
|
+
onSample: (data, nowMs) => {
|
|
130257
|
+
if (data.tree.children.length === 0) {
|
|
130258
|
+
stableSignature = void 0;
|
|
130259
|
+
stableSince = 0;
|
|
130260
|
+
return { done: false };
|
|
130261
|
+
}
|
|
130262
|
+
const signature = treeSignature(data.tree);
|
|
130263
|
+
if (signature === stableSignature) {
|
|
130264
|
+
if (nowMs - stableSince >= minStableMs) return { done: true, result: true };
|
|
130265
|
+
} else {
|
|
130266
|
+
stableSignature = signature;
|
|
130267
|
+
stableSince = nowMs;
|
|
130268
|
+
if (minStableMs === 0) return { done: true, result: true };
|
|
130269
|
+
}
|
|
130270
|
+
return { done: false };
|
|
130271
|
+
}
|
|
130272
|
+
});
|
|
130273
|
+
return { settled: poll.result === true, waitedMs: poll.elapsedMs, polls: poll.polls };
|
|
130274
|
+
}
|
|
130275
|
+
};
|
|
130276
|
+
}
|
|
130277
|
+
|
|
130156
130278
|
// ../tool-server/src/tools/profiler/react/react-profiler-start.ts
|
|
130157
130279
|
var crypto6 = __toESM(require("node:crypto"));
|
|
130158
130280
|
init_zod();
|
|
@@ -130204,7 +130326,7 @@ function bootstrapFailureMessage(bootstrap) {
|
|
|
130204
130326
|
// ../tool-server/src/tools/profiler/react/react-profiler-start.ts
|
|
130205
130327
|
var NO_DEVTOOLS_HOOK_ERROR = "React DevTools hook (__REACT_DEVTOOLS_GLOBAL_HOOK__) is not present in this app's JavaScript runtime. React profiling requires a development build with React DevTools enabled. Likely causes: (1) the app is a release/production build \u2014 DevTools is stripped to reduce bundle size; (2) you connected to the wrong JS runtime; (3) this isn't a React (Native) app. Fix: rebuild in debug/dev mode (e.g. `npx react-native run-ios` without --configuration Release; for Expo, run a dev client). Once the app is running with DevTools attached, call react-profiler-start again.";
|
|
130206
130328
|
var NO_RENDERERS_ATTACHED_ERROR = "React DevTools hook is present but no React renderer has registered yet. The hook is loaded but no fiber renderer has attached \u2014 typically because the app has not committed its first render, or the DevTools backend has not been bootstrapped on a bridgeless React Native dev build. Fix: ensure the app has rendered (interact with it once, then retry); if it stays empty, call react-profiler-start first \u2014 it will attempt to attach the DevTools backend automatically.";
|
|
130207
|
-
var
|
|
130329
|
+
var zodSchema39 = external_exports.object({
|
|
130208
130330
|
port: external_exports.coerce.number().default(8081).describe("Metro server port"),
|
|
130209
130331
|
device_id: external_exports.string().describe(
|
|
130210
130332
|
"Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
|
|
@@ -130231,7 +130353,7 @@ Before calling this, ask the user if they also want native profiling (native-pro
|
|
|
130231
130353
|
After starting, ask the user to perform the interaction to profile, then call react-profiler-stop.
|
|
130232
130354
|
Returns { started_at, startedAtEpochMs, hermes_version, detected_architecture } on success, or the already_running payload described above.
|
|
130233
130355
|
Fails if the Hermes runtime is not reachable or the Metro CDP connection cannot be established.`,
|
|
130234
|
-
zodSchema:
|
|
130356
|
+
zodSchema: zodSchema39,
|
|
130235
130357
|
// RN-only: bootstraps the React DevTools backend and uses Hermes'
|
|
130236
130358
|
// Profiler.start. A CDP-direct CPU profile for Chromium is tracked as a
|
|
130237
130359
|
// follow-up; the React commit recording has no Chromium analog.
|
|
@@ -130503,7 +130625,7 @@ async function readCommitTree(path31) {
|
|
|
130503
130625
|
}
|
|
130504
130626
|
|
|
130505
130627
|
// ../tool-server/src/tools/profiler/react/react-profiler-stop.ts
|
|
130506
|
-
var
|
|
130628
|
+
var zodSchema40 = external_exports.object({
|
|
130507
130629
|
port: external_exports.coerce.number().default(8081).describe("Metro server port"),
|
|
130508
130630
|
device_id: external_exports.string().describe(
|
|
130509
130631
|
"Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
|
|
@@ -130587,7 +130709,7 @@ Call react-profiler-start first, then exercise the app, then call this.
|
|
|
130587
130709
|
Returns { duration_ms, sample_count, fiber_renders_captured, total_react_commits, hot_commit_indices } summarizing the session.
|
|
130588
130710
|
When any commit had fibers whose display name could not be resolved at stop time (typically transient components like modals/tooltips/animations that unmounted before stop), the response also includes { unattributed_ms, unattributed_fiber_count, unattributed_commit_count } \u2014 these quantify how much work is not accounted for in the per-component breakdown (the per-commit duration itself remains correct).
|
|
130589
130711
|
Fails if no active profiling session exists or the CDP connection was lost during recording.`,
|
|
130590
|
-
zodSchema:
|
|
130712
|
+
zodSchema: zodSchema40,
|
|
130591
130713
|
// RN-only: companion to react-profiler-start.
|
|
130592
130714
|
capability: RN_ONLY_TOOL_CAPABILITY,
|
|
130593
130715
|
services: () => ({}),
|
|
@@ -130815,7 +130937,7 @@ Fails if no active profiling session exists or the CDP connection was lost durin
|
|
|
130815
130937
|
|
|
130816
130938
|
// ../tool-server/src/tools/profiler/react/react-profiler-status.ts
|
|
130817
130939
|
init_zod();
|
|
130818
|
-
var
|
|
130940
|
+
var zodSchema41 = external_exports.object({
|
|
130819
130941
|
port: external_exports.coerce.number().default(8081).describe("Metro server port"),
|
|
130820
130942
|
device_id: external_exports.string().describe(
|
|
130821
130943
|
"Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
|
|
@@ -130825,7 +130947,7 @@ function createReactProfilerStatusTool(registry2) {
|
|
|
130825
130947
|
return {
|
|
130826
130948
|
id: "react-profiler-status",
|
|
130827
130949
|
description: `Check the state of the React profiler session without side effects. Use after an interruption (debugger disconnect, unexpected error, agent pause) to decide whether to continue with react-profiler-stop, start a new session, or reconnect the debugger. Ownership is verified server-side against this tool-server's in-memory session \u2014 no token-threading is required. Returns { session_status, is_running, current_owner, \u2026 }. If this tool-server process restarted after react-profiler-start, status will report 'taken_over'; use react-profiler-start { force: true } to reclaim.`,
|
|
130828
|
-
zodSchema:
|
|
130950
|
+
zodSchema: zodSchema41,
|
|
130829
130951
|
// RN-only: companion to react-profiler-start.
|
|
130830
130952
|
capability: RN_ONLY_TOOL_CAPABILITY,
|
|
130831
130953
|
services: () => ({}),
|
|
@@ -132320,7 +132442,7 @@ var annotationSchema = external_exports.object({
|
|
|
132320
132442
|
),
|
|
132321
132443
|
label: external_exports.string().describe("Description of the action performed")
|
|
132322
132444
|
});
|
|
132323
|
-
var
|
|
132445
|
+
var zodSchema42 = external_exports.object({
|
|
132324
132446
|
port: external_exports.coerce.number().default(8081).describe("Metro server port"),
|
|
132325
132447
|
device_id: external_exports.string().describe(
|
|
132326
132448
|
"Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
|
|
@@ -132348,7 +132470,7 @@ where tapTimestampMs is the timestampMs returned by the tap/swipe tool and start
|
|
|
132348
132470
|
is returned by react-profiler-start.
|
|
132349
132471
|
Use when the profiling session is complete and you need to interpret the collected data.
|
|
132350
132472
|
Fails if react-profiler-stop has not been called or no profiling data is stored.`,
|
|
132351
|
-
zodSchema:
|
|
132473
|
+
zodSchema: zodSchema42,
|
|
132352
132474
|
// RN-only: operates on profiler trace files captured via the React DevTools
|
|
132353
132475
|
// backend's commit recording, which is not present on Chromium.
|
|
132354
132476
|
capability: RN_ONLY_TOOL_CAPABILITY,
|
|
@@ -132485,7 +132607,7 @@ Fails if react-profiler-stop has not been called or no profiling data is stored.
|
|
|
132485
132607
|
// ../tool-server/src/tools/profiler/react/react-profiler-component-source.ts
|
|
132486
132608
|
init_zod();
|
|
132487
132609
|
var import_fs6 = require("fs");
|
|
132488
|
-
var
|
|
132610
|
+
var zodSchema43 = external_exports.object({
|
|
132489
132611
|
component_name: external_exports.string().describe("Name of the React component to look up"),
|
|
132490
132612
|
project_root: external_exports.string().describe("Absolute path to the RN project root")
|
|
132491
132613
|
});
|
|
@@ -132498,7 +132620,7 @@ var reactProfilerComponentSourceTool = {
|
|
|
132498
132620
|
Call this per-finding after react-profiler-analyze to inspect source before proposing a fix.
|
|
132499
132621
|
Returns found: false if the component is not found in user-owned code (e.g. lives in node_modules).
|
|
132500
132622
|
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) \u2014 check it before assuming the returned file is the one you meant.`,
|
|
132501
|
-
zodSchema:
|
|
132623
|
+
zodSchema: zodSchema43,
|
|
132502
132624
|
// Companion to react-profiler-analyze. Carries the same RN-only capability
|
|
132503
132625
|
// declaration as the rest of react-profiler-* for intent-clarity, even
|
|
132504
132626
|
// though the HTTP gate is a no-op here (the tool takes no device_id, so
|
|
@@ -132552,7 +132674,7 @@ When several files define a component with the same name (e.g. platform variants
|
|
|
132552
132674
|
// ../tool-server/src/tools/profiler/react/react-profiler-cpu-summary.ts
|
|
132553
132675
|
init_zod();
|
|
132554
132676
|
init_src();
|
|
132555
|
-
var
|
|
132677
|
+
var zodSchema44 = external_exports.object({
|
|
132556
132678
|
port: external_exports.coerce.number().default(8081).describe("Metro server port"),
|
|
132557
132679
|
device_id: external_exports.string().describe(
|
|
132558
132680
|
"Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
|
|
@@ -132629,7 +132751,7 @@ Use when you specifically need to investigate JS CPU hotspots that are NOT tied
|
|
|
132629
132751
|
Call react-profiler-stop first. Reads directly from the stored cpuProfile.
|
|
132630
132752
|
Returns a markdown table of the top hotspot functions with self-time, total-time, and location.
|
|
132631
132753
|
Fails if react-profiler-stop has not been called or no CPU profile is stored.`,
|
|
132632
|
-
zodSchema:
|
|
132754
|
+
zodSchema: zodSchema44,
|
|
132633
132755
|
// RN-only: reads a Hermes CPU profile captured via the React profiler
|
|
132634
132756
|
// session. Chromium's V8 Profiler emits a different sample format — see the
|
|
132635
132757
|
// PR description for the follow-up scope.
|
|
@@ -132727,7 +132849,7 @@ function renderMarkdownTable2(entries) {
|
|
|
132727
132849
|
);
|
|
132728
132850
|
return [header, sep4, ...rows].join("\n");
|
|
132729
132851
|
}
|
|
132730
|
-
var
|
|
132852
|
+
var zodSchema45 = external_exports.object({
|
|
132731
132853
|
port: external_exports.coerce.number().default(8081).describe("Metro server port"),
|
|
132732
132854
|
device_id: external_exports.string().describe(
|
|
132733
132855
|
"Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
|
|
@@ -132740,7 +132862,7 @@ var reactProfilerRendersTool = {
|
|
|
132740
132862
|
Returns a markdown table of the top re-rendering components. No profiling session required \u2014 works on a live connected app.
|
|
132741
132863
|
Use when you want a quick snapshot of render counts without a full profiling session.
|
|
132742
132864
|
Fails if the React DevTools hook is not present in the runtime or the app is not connected.`,
|
|
132743
|
-
zodSchema:
|
|
132865
|
+
zodSchema: zodSchema45,
|
|
132744
132866
|
// RN-only: queries the React DevTools backend hook on the live runtime.
|
|
132745
132867
|
capability: RN_ONLY_TOOL_CAPABILITY,
|
|
132746
132868
|
services: (params) => ({
|
|
@@ -132897,7 +133019,7 @@ function buildFiberTreeScript(maxDepth, filter) {
|
|
|
132897
133019
|
}
|
|
132898
133020
|
})()`;
|
|
132899
133021
|
}
|
|
132900
|
-
var
|
|
133022
|
+
var zodSchema46 = external_exports.object({
|
|
132901
133023
|
port: external_exports.coerce.number().default(8081).describe("Metro server port"),
|
|
132902
133024
|
device_id: external_exports.string().describe(
|
|
132903
133025
|
"Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
|
|
@@ -132911,7 +133033,7 @@ var reactProfilerFiberTreeTool = {
|
|
|
132911
133033
|
Use when tracing ancestry of a library component or checking for useMemoCache hook (confirms React Compiler is active on a component).
|
|
132912
133034
|
Returns a nested JSON tree of fiber nodes with name, tag, actualDuration, selfBaseDuration, and children.
|
|
132913
133035
|
Fails if the React DevTools hook is not present or no fiber roots have been committed yet.`,
|
|
132914
|
-
zodSchema:
|
|
133036
|
+
zodSchema: zodSchema46,
|
|
132915
133037
|
// RN-only: walks the fiber tree via the React DevTools backend hook.
|
|
132916
133038
|
capability: RN_ONLY_TOOL_CAPABILITY,
|
|
132917
133039
|
services: (params) => ({
|
|
@@ -136319,7 +136441,7 @@ async function analyzeNativeProfilerAndroid(api) {
|
|
|
136319
136441
|
}
|
|
136320
136442
|
|
|
136321
136443
|
// ../tool-server/src/tools/profiler/native-profiler/native-profiler-start.ts
|
|
136322
|
-
var
|
|
136444
|
+
var zodSchema47 = external_exports.object({
|
|
136323
136445
|
device_id: external_exports.string().describe("Target device id from `list-devices` (iOS UDID or Android serial)."),
|
|
136324
136446
|
app_process: external_exports.string().optional().describe(
|
|
136325
136447
|
"iOS: the CFBundleExecutable or display name of the app to profile. Android: the app's package name. If omitted, auto-detects the currently running foreground app. Only provide this if auto-detection picks the wrong app."
|
|
@@ -136328,27 +136450,27 @@ var zodSchema46 = external_exports.object({
|
|
|
136328
136450
|
"iOS-only: path to an Instruments .tracetemplate file (defaults to bundled Argent template). Ignored on Android."
|
|
136329
136451
|
)
|
|
136330
136452
|
});
|
|
136331
|
-
var
|
|
136453
|
+
var capability22 = {
|
|
136332
136454
|
apple: { simulator: true, device: true },
|
|
136333
136455
|
android: { emulator: true, device: true, unknown: true }
|
|
136334
136456
|
};
|
|
136335
136457
|
var nativeProfilerStartTool = {
|
|
136336
136458
|
id: "native-profiler-start",
|
|
136337
|
-
capability:
|
|
136459
|
+
capability: capability22,
|
|
136338
136460
|
description: `Start native profiling on a booted device. iOS: Instruments via xctrace (CPU, hangs, memory). Android: Perfetto (CPU, jank, RSS-growth weak signal).
|
|
136339
136461
|
Auto-detects the running app process unless app_process is explicitly provided.
|
|
136340
136462
|
After starting, let the user interact with the app, then call native-profiler-stop.
|
|
136341
136463
|
Use when you want to capture native CPU, hang, and memory data for a running app.
|
|
136342
136464
|
Returns { status, pid, traceFile } confirming the recording has started.
|
|
136343
136465
|
Fails if no app is running on the device, or the profiler cannot attach to the process.`,
|
|
136344
|
-
zodSchema:
|
|
136466
|
+
zodSchema: zodSchema47,
|
|
136345
136467
|
services: (params) => ({
|
|
136346
136468
|
session: nativeProfilerSessionRef(resolveDevice(params.device_id))
|
|
136347
136469
|
}),
|
|
136348
136470
|
async execute(services, params) {
|
|
136349
136471
|
const api = services.session;
|
|
136350
136472
|
const device = resolveDevice(params.device_id);
|
|
136351
|
-
assertSupported("native-profiler-start",
|
|
136473
|
+
assertSupported("native-profiler-start", capability22, device);
|
|
136352
136474
|
if (api.platform === "ios") {
|
|
136353
136475
|
await ensureDeps(["xcrun"]);
|
|
136354
136476
|
return startNativeProfilerIos(api, params);
|
|
@@ -136360,10 +136482,10 @@ Fails if no app is running on the device, or the profiler cannot attach to the p
|
|
|
136360
136482
|
|
|
136361
136483
|
// ../tool-server/src/tools/profiler/native-profiler/native-profiler-stop.ts
|
|
136362
136484
|
init_zod();
|
|
136363
|
-
var
|
|
136485
|
+
var zodSchema48 = external_exports.object({
|
|
136364
136486
|
device_id: external_exports.string().describe("Target device id from `list-devices` (iOS UDID or Android serial).")
|
|
136365
136487
|
});
|
|
136366
|
-
var
|
|
136488
|
+
var capability23 = {
|
|
136367
136489
|
apple: { simulator: true, device: true },
|
|
136368
136490
|
android: { emulator: true, device: true, unknown: true }
|
|
136369
136491
|
};
|
|
@@ -136379,7 +136501,7 @@ function registerTrace(store, traceFile) {
|
|
|
136379
136501
|
}
|
|
136380
136502
|
var nativeProfilerStopTool = {
|
|
136381
136503
|
id: "native-profiler-stop",
|
|
136382
|
-
capability:
|
|
136504
|
+
capability: capability23,
|
|
136383
136505
|
description: `Stop native profiling and export trace data.
|
|
136384
136506
|
iOS: sends SIGINT to xctrace, waits for packaging, then exports CPU, hangs, and leaks XML.
|
|
136385
136507
|
Android: sends SIGTERM to the perfetto daemon, polls /proc/<pid>, then \`adb pull\`s the .pftrace.
|
|
@@ -136387,14 +136509,14 @@ Call native-profiler-start first.
|
|
|
136387
136509
|
Use when the user has finished the interaction to profile and you need to export the trace.
|
|
136388
136510
|
Returns { traceFile, exportedFiles, exportDiagnostics? }; traceFile is the raw trace bundle and exportedFiles the exports, all downloadable artifacts materialized to local paths.
|
|
136389
136511
|
Fails if no active native-profiler-start session exists for the given device_id.`,
|
|
136390
|
-
zodSchema:
|
|
136512
|
+
zodSchema: zodSchema48,
|
|
136391
136513
|
services: (params) => ({
|
|
136392
136514
|
session: nativeProfilerSessionRef(resolveDevice(params.device_id))
|
|
136393
136515
|
}),
|
|
136394
136516
|
async execute(services, params, ctx) {
|
|
136395
136517
|
const api = services.session;
|
|
136396
136518
|
const device = resolveDevice(params.device_id);
|
|
136397
|
-
assertSupported("native-profiler-stop",
|
|
136519
|
+
assertSupported("native-profiler-stop", capability23, device);
|
|
136398
136520
|
if (api.platform === "ios") {
|
|
136399
136521
|
await ensureDeps(["xcrun"]);
|
|
136400
136522
|
const ios = await stopNativeProfilerIos(api);
|
|
@@ -136421,16 +136543,16 @@ Fails if no active native-profiler-start session exists for the given device_id.
|
|
|
136421
136543
|
|
|
136422
136544
|
// ../tool-server/src/tools/profiler/native-profiler/native-profiler-analyze.ts
|
|
136423
136545
|
init_zod();
|
|
136424
|
-
var
|
|
136546
|
+
var zodSchema49 = external_exports.object({
|
|
136425
136547
|
device_id: external_exports.string().describe("Target device id from `list-devices` (iOS UDID or Android serial).")
|
|
136426
136548
|
});
|
|
136427
|
-
var
|
|
136549
|
+
var capability24 = {
|
|
136428
136550
|
apple: { simulator: true, device: true },
|
|
136429
136551
|
android: { emulator: true, device: true, unknown: true }
|
|
136430
136552
|
};
|
|
136431
136553
|
var nativeProfilerAnalyzeTool = {
|
|
136432
136554
|
id: "native-profiler-analyze",
|
|
136433
|
-
capability:
|
|
136555
|
+
capability: capability24,
|
|
136434
136556
|
description: `Analyze exported native trace data and return an LLM-optimized markdown report.
|
|
136435
136557
|
iOS: parses CPU time profile, UI hangs, and memory leaks from the exported XML files.
|
|
136436
136558
|
Android: queries the Perfetto .pftrace via the in-process Perfetto trace-processor engine for CPU hotspots, UI hangs with jank reason + main-thread state breakdown, GC annotation, and an RSS-growth weak signal.
|
|
@@ -136440,14 +136562,14 @@ profiler-stack-query for hang stacks, CPU context, leak details) or implement fi
|
|
|
136440
136562
|
Call native-profiler-stop first to export the trace data.
|
|
136441
136563
|
Use when you need to interpret a completed native profiling recording.
|
|
136442
136564
|
Fails if native-profiler-stop has not been called first to export trace data.`,
|
|
136443
|
-
zodSchema:
|
|
136565
|
+
zodSchema: zodSchema49,
|
|
136444
136566
|
services: (params) => ({
|
|
136445
136567
|
session: nativeProfilerSessionRef(resolveDevice(params.device_id))
|
|
136446
136568
|
}),
|
|
136447
136569
|
async execute(services, params, ctx) {
|
|
136448
136570
|
const api = services.session;
|
|
136449
136571
|
const device = resolveDevice(params.device_id);
|
|
136450
|
-
assertSupported("native-profiler-analyze",
|
|
136572
|
+
assertSupported("native-profiler-analyze", capability24, device);
|
|
136451
136573
|
let result;
|
|
136452
136574
|
if (api.platform === "ios") {
|
|
136453
136575
|
await ensureDeps(["xcrun"]);
|
|
@@ -136471,7 +136593,7 @@ var timeWindowSchema = external_exports.object({
|
|
|
136471
136593
|
start: external_exports.coerce.number().describe("Start of window in ms (performance.now clock)"),
|
|
136472
136594
|
end: external_exports.coerce.number().describe("End of window in ms (performance.now clock)")
|
|
136473
136595
|
});
|
|
136474
|
-
var
|
|
136596
|
+
var zodSchema50 = external_exports.object({
|
|
136475
136597
|
port: external_exports.coerce.number().default(8081).describe("Metro server port"),
|
|
136476
136598
|
device_id: external_exports.string().describe(
|
|
136477
136599
|
"Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
|
|
@@ -136707,7 +136829,7 @@ Modes:
|
|
|
136707
136829
|
Use when investigating JS CPU hotspots or correlating CPU cost with specific components.
|
|
136708
136830
|
Returns a markdown table of CPU hotspots, call tree, or per-component CPU breakdown.
|
|
136709
136831
|
Fails if no CPU profile is stored \u2014 run react-profiler-stop first.`,
|
|
136710
|
-
zodSchema:
|
|
136832
|
+
zodSchema: zodSchema50,
|
|
136711
136833
|
// RN-only: reads Hermes-format CPU profiles. Chromium's V8 sample format is
|
|
136712
136834
|
// different — see the PR description for the follow-up scope.
|
|
136713
136835
|
capability: RN_ONLY_TOOL_CAPABILITY,
|
|
@@ -136790,7 +136912,7 @@ var timeRangeSchema = external_exports.object({
|
|
|
136790
136912
|
start: external_exports.coerce.number().describe("Start of range in ms (performance.now clock)"),
|
|
136791
136913
|
end: external_exports.coerce.number().describe("End of range in ms (performance.now clock)")
|
|
136792
136914
|
});
|
|
136793
|
-
var
|
|
136915
|
+
var zodSchema51 = external_exports.object({
|
|
136794
136916
|
port: external_exports.coerce.number().default(8081).describe("Metro server port"),
|
|
136795
136917
|
device_id: external_exports.string().describe(
|
|
136796
136918
|
"Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
|
|
@@ -137035,7 +137157,7 @@ Modes:
|
|
|
137035
137157
|
Use when drilling into specific components or time windows after react-profiler-analyze.
|
|
137036
137158
|
Returns a markdown table or tree of commit data matching the requested mode.
|
|
137037
137159
|
Fails if react-profiler-stop has not been called or no commit data is stored.`,
|
|
137038
|
-
zodSchema:
|
|
137160
|
+
zodSchema: zodSchema51,
|
|
137039
137161
|
// RN-only: reads React commit data captured via the React DevTools backend.
|
|
137040
137162
|
capability: RN_ONLY_TOOL_CAPABILITY,
|
|
137041
137163
|
services: () => ({}),
|
|
@@ -137113,7 +137235,7 @@ function formatBytes4(bytes) {
|
|
|
137113
137235
|
}
|
|
137114
137236
|
|
|
137115
137237
|
// ../tool-server/src/tools/profiler/query/profiler-stack-query.ts
|
|
137116
|
-
var
|
|
137238
|
+
var zodSchema52 = external_exports.object({
|
|
137117
137239
|
device_id: external_exports.string().describe("iOS Simulator UDID or Android serial."),
|
|
137118
137240
|
mode: external_exports.enum(["hang_stacks", "function_callers", "thread_breakdown", "leak_stacks"]).describe(
|
|
137119
137241
|
"Query mode: hang_stacks (full CPU context during a hang), function_callers (who calls a native function), thread_breakdown (CPU split by thread), leak_stacks (leak details by object type)"
|
|
@@ -137413,7 +137535,7 @@ Modes:
|
|
|
137413
137535
|
Use when drilling into native hang stacks, thread CPU breakdown, or memory leaks after native-profiler-analyze.
|
|
137414
137536
|
Returns a markdown report with native call stacks, thread weights, or leak details for the selected mode.
|
|
137415
137537
|
Fails if native-profiler-analyze has not been run or no parsed trace data is in memory.`,
|
|
137416
|
-
zodSchema:
|
|
137538
|
+
zodSchema: zodSchema52,
|
|
137417
137539
|
// iOS: reads xctrace output. Android: queries the Perfetto .pftrace via the
|
|
137418
137540
|
// in-process trace-processor engine (see executeAndroid). Chromium has no
|
|
137419
137541
|
// native trace capture.
|
|
@@ -137469,7 +137591,7 @@ function buildPerfettoAnchor(wallClockStartMs) {
|
|
|
137469
137591
|
}
|
|
137470
137592
|
|
|
137471
137593
|
// ../tool-server/src/tools/profiler/combined/profiler-combined-report.ts
|
|
137472
|
-
var
|
|
137594
|
+
var zodSchema53 = external_exports.object({
|
|
137473
137595
|
port: external_exports.coerce.number().default(8081).describe("Metro server port"),
|
|
137474
137596
|
device_id: external_exports.string().describe("iOS Simulator/device UDID or Android serial")
|
|
137475
137597
|
});
|
|
@@ -137481,7 +137603,7 @@ Requires both react-profiler-analyze and native-profiler-analyze to have been ca
|
|
|
137481
137603
|
Call this tool when both profilers were run in parallel on the same session.
|
|
137482
137604
|
Returns a markdown report correlating hangs with React commits, memory leaks, and investigation hints.
|
|
137483
137605
|
Fails if either react-profiler-analyze or native-profiler-analyze has not been called first.`,
|
|
137484
|
-
zodSchema:
|
|
137606
|
+
zodSchema: zodSchema53,
|
|
137485
137607
|
// Combines React (Hermes) + native traces. iOS reads xctrace output;
|
|
137486
137608
|
// Android re-queries the Perfetto .pftrace via loadAndroidCombinedData. The
|
|
137487
137609
|
// capture half exists on neither platform's Chromium.
|
|
@@ -137770,7 +137892,7 @@ function assertSafeSessionId(sessionId) {
|
|
|
137770
137892
|
);
|
|
137771
137893
|
}
|
|
137772
137894
|
}
|
|
137773
|
-
var
|
|
137895
|
+
var zodSchema54 = external_exports.object({
|
|
137774
137896
|
mode: external_exports.enum(["list", "load_react", "load_native"]).describe(
|
|
137775
137897
|
"list: show available sessions on disk. load_react: load a React profiler session into memory for query tools. load_native: re-parse native profiler XML files (xctrace on iOS) into memory for query tools."
|
|
137776
137898
|
),
|
|
@@ -138094,7 +138216,7 @@ Modes:
|
|
|
138094
138216
|
For Android .pftrace restores, pass app_process for older sessions that do not have a metadata sidecar.
|
|
138095
138217
|
Returns a summary of the loaded session or a session list for the list mode.
|
|
138096
138218
|
Fails if the session_id is not found or required XML files are missing from disk.`,
|
|
138097
|
-
zodSchema:
|
|
138219
|
+
zodSchema: zodSchema54,
|
|
138098
138220
|
// Loads Hermes-format React traces or iOS xctrace XML — neither maps onto
|
|
138099
138221
|
// Chromium yet. The gate keeps the error close to the call site instead of
|
|
138100
138222
|
// letting it surface from inside the trace parser.
|
|
@@ -138154,7 +138276,7 @@ Fails if the session_id is not found or required XML files are missing from disk
|
|
|
138154
138276
|
// ../tool-server/src/tools/simulator/stop-simulator-server.ts
|
|
138155
138277
|
init_zod();
|
|
138156
138278
|
init_src();
|
|
138157
|
-
var
|
|
138279
|
+
var zodSchema55 = external_exports.object({
|
|
138158
138280
|
udid: external_exports.string().describe(
|
|
138159
138281
|
"Target device id (iOS UDID, Android serial, or Chromium id) whose transport session to stop"
|
|
138160
138282
|
)
|
|
@@ -138163,7 +138285,7 @@ function createStopSimulatorServerTool(registry2) {
|
|
|
138163
138285
|
return {
|
|
138164
138286
|
id: "stop-simulator-server",
|
|
138165
138287
|
description: `Stop the transport session for a specific device (iOS / Android: simulator-server process; Chromium: CDP WebSocket) and free its resources. Use when you are done interacting with one device but want to keep others running. Returns { stopped, udid }. Fails silently if no session is open for the given id.`,
|
|
138166
|
-
zodSchema:
|
|
138288
|
+
zodSchema: zodSchema55,
|
|
138167
138289
|
services: () => ({}),
|
|
138168
138290
|
async execute(_services, params) {
|
|
138169
138291
|
const udid = params.udid;
|
|
@@ -138222,13 +138344,13 @@ function createStopAllSimulatorServersTool(registry2) {
|
|
|
138222
138344
|
// ../tool-server/src/tools/simulator/stop-metro.ts
|
|
138223
138345
|
init_zod();
|
|
138224
138346
|
var import_node_child_process23 = require("node:child_process");
|
|
138225
|
-
var
|
|
138347
|
+
var zodSchema56 = external_exports.object({
|
|
138226
138348
|
port: external_exports.number().int().min(1).max(65535).default(8081).describe("TCP port Metro is listening on (default 8081)")
|
|
138227
138349
|
});
|
|
138228
138350
|
var stopMetroTool = {
|
|
138229
138351
|
id: "stop-metro",
|
|
138230
138352
|
description: `Stop the Metro bundler process listening on a given port (default 8081). Use when ending a React Native session or when Metro must be restarted. Returns { stopped, port, pids }; stopped=false if no process is found on the port. Fails if the port lookup command times out or the process cannot be killed. This is DESTRUCTIVE \u2014 always ask the user for confirmation before calling this tool.`,
|
|
138231
|
-
zodSchema:
|
|
138353
|
+
zodSchema: zodSchema56,
|
|
138232
138354
|
services: () => ({}),
|
|
138233
138355
|
async execute(_services, params) {
|
|
138234
138356
|
const port = params.port;
|
|
@@ -138455,7 +138577,7 @@ async function appendStepToActiveFlow(step) {
|
|
|
138455
138577
|
}
|
|
138456
138578
|
|
|
138457
138579
|
// ../tool-server/src/tools/flows/flow-start-recording.ts
|
|
138458
|
-
var
|
|
138580
|
+
var zodSchema57 = external_exports.object({
|
|
138459
138581
|
name: external_exports.string().describe('Name for this flow (e.g. "settings-explore")'),
|
|
138460
138582
|
project_root: external_exports.string().describe(
|
|
138461
138583
|
"Absolute path to the project root directory (the directory that contains or should contain `.argent/flows/`). The flow file is created at `<project_root>/.argent/flows/<name>.yaml`."
|
|
@@ -138480,7 +138602,7 @@ to add labels. Call flow-finish-recording when done.
|
|
|
138480
138602
|
|
|
138481
138603
|
If a recorded step turns out to be wrong, you can edit the .yaml file directly
|
|
138482
138604
|
to remove or reorder steps.`,
|
|
138483
|
-
zodSchema:
|
|
138605
|
+
zodSchema: zodSchema57,
|
|
138484
138606
|
fileInputs: fileInputs2,
|
|
138485
138607
|
services: () => ({}),
|
|
138486
138608
|
async execute(_services, params, ctx) {
|
|
@@ -138518,7 +138640,7 @@ to remove or reorder steps.`,
|
|
|
138518
138640
|
|
|
138519
138641
|
// ../tool-server/src/tools/flows/flow-add-step.ts
|
|
138520
138642
|
init_zod();
|
|
138521
|
-
var
|
|
138643
|
+
var zodSchema58 = external_exports.object({
|
|
138522
138644
|
command: external_exports.string().describe('MCP tool name (e.g. "tap", "screenshot", "launch-app")'),
|
|
138523
138645
|
args: external_exports.string().optional().describe(
|
|
138524
138646
|
`Tool arguments as a JSON string, e.g. '{"udid": "ABC", "x": 0.5, "y": 0.3}'. Omit for tools with no arguments.`
|
|
@@ -138530,7 +138652,7 @@ function createFlowAddStepTool(registry2) {
|
|
|
138530
138652
|
id: "flow-add-step",
|
|
138531
138653
|
description: `Execute a tool call and record it as a step in the active flow. Use when recording a flow with flow-start-recording and you want to run and capture each action. Returns { message, toolResult, flowFile } on success. If it fails an error is returned and nothing is recorded. Error if the tool name is not found in the registry or arguments are invalid JSON.
|
|
138532
138654
|
If a step was recorded by mistake, edit the .yaml file directly to remove it.`,
|
|
138533
|
-
zodSchema:
|
|
138655
|
+
zodSchema: zodSchema58,
|
|
138534
138656
|
services: () => ({}),
|
|
138535
138657
|
async execute(_services, params, ctx) {
|
|
138536
138658
|
const flowName = getActiveFlow();
|
|
@@ -138554,7 +138676,7 @@ If a step was recorded by mistake, edit the .yaml file directly to remove it.`,
|
|
|
138554
138676
|
|
|
138555
138677
|
// ../tool-server/src/tools/flows/flow-insert-echo.ts
|
|
138556
138678
|
init_zod();
|
|
138557
|
-
var
|
|
138679
|
+
var zodSchema59 = external_exports.object({
|
|
138558
138680
|
message: external_exports.string().describe("Message to echo when the flow is replayed")
|
|
138559
138681
|
});
|
|
138560
138682
|
var flowInsertEchoTool = {
|
|
@@ -138562,7 +138684,7 @@ var flowInsertEchoTool = {
|
|
|
138562
138684
|
description: `Record an echo step in the active flow. Echo steps print a message when the flow is replayed \u2014 useful as labels between tool calls.
|
|
138563
138685
|
Use when you want to annotate a recorded flow with a human-readable label or checkpoint message.
|
|
138564
138686
|
Returns { message, flowFile }. Fails if no active flow recording is in progress.`,
|
|
138565
|
-
zodSchema:
|
|
138687
|
+
zodSchema: zodSchema59,
|
|
138566
138688
|
services: () => ({}),
|
|
138567
138689
|
async execute(_services, params) {
|
|
138568
138690
|
const flowName = getActiveFlow();
|
|
@@ -138581,12 +138703,12 @@ Returns { message, flowFile }. Fails if no active flow recording is in progress.
|
|
|
138581
138703
|
// ../tool-server/src/tools/flows/flow-finish-recording.ts
|
|
138582
138704
|
init_zod();
|
|
138583
138705
|
var fs37 = __toESM(require("node:fs/promises"));
|
|
138584
|
-
var
|
|
138706
|
+
var zodSchema60 = external_exports.object({});
|
|
138585
138707
|
var flowFinishRecordingTool = {
|
|
138586
138708
|
id: "flow-finish-recording",
|
|
138587
138709
|
description: `Finish recording the active flow. Returns a summary of all recorded steps and the final YAML content. Use when you have added all desired steps and want to finalize the flow file. Fails if no active flow recording is in progress.
|
|
138588
138710
|
You can still edit the .yaml file directly afterwards to remove or reorder steps.`,
|
|
138589
|
-
zodSchema:
|
|
138711
|
+
zodSchema: zodSchema60,
|
|
138590
138712
|
services: () => ({}),
|
|
138591
138713
|
async execute(_services, _params) {
|
|
138592
138714
|
const flowName = getActiveFlow();
|
|
@@ -138624,7 +138746,7 @@ You can still edit the .yaml file directly afterwards to remove or reorder steps
|
|
|
138624
138746
|
// ../tool-server/src/tools/flows/flow-run.ts
|
|
138625
138747
|
init_zod();
|
|
138626
138748
|
var fs38 = __toESM(require("node:fs/promises"));
|
|
138627
|
-
var
|
|
138749
|
+
var zodSchema61 = external_exports.object({
|
|
138628
138750
|
name: external_exports.string().describe('Name of the flow to run (e.g. "settings-explore")'),
|
|
138629
138751
|
project_root: external_exports.string().describe(
|
|
138630
138752
|
"Absolute path to the project root directory that contains `.argent/flows/<name>.yaml`."
|
|
@@ -138655,7 +138777,7 @@ If the flow has an execution prerequisite and prerequisiteAcknowledged is not
|
|
|
138655
138777
|
set to true, the tool returns a notice with the prerequisite instead of running.
|
|
138656
138778
|
Use flow-read-prerequisite to inspect the prerequisite beforehand.`,
|
|
138657
138779
|
longRunning: true,
|
|
138658
|
-
zodSchema:
|
|
138780
|
+
zodSchema: zodSchema61,
|
|
138659
138781
|
fileInputs: fileInputs3,
|
|
138660
138782
|
services: () => ({}),
|
|
138661
138783
|
async execute(_services, params, ctx) {
|
|
@@ -138722,7 +138844,7 @@ function resolveFlowFilePath(params) {
|
|
|
138722
138844
|
// ../tool-server/src/tools/flows/flow-read-prerequisite.ts
|
|
138723
138845
|
init_zod();
|
|
138724
138846
|
var fs39 = __toESM(require("node:fs/promises"));
|
|
138725
|
-
var
|
|
138847
|
+
var zodSchema62 = external_exports.object({
|
|
138726
138848
|
name: external_exports.string().describe('Name of the flow to inspect (e.g. "settings-explore")'),
|
|
138727
138849
|
project_root: external_exports.string().describe(
|
|
138728
138850
|
"Absolute path to the project root directory that contains `.argent/flows/<name>.yaml`."
|
|
@@ -138740,7 +138862,7 @@ var flowReadPrerequisiteTool = {
|
|
|
138740
138862
|
Returns the prerequisite description so you can verify the required state is met before calling flow-execute.
|
|
138741
138863
|
Use when you need to check what app/simulator state is required before executing a flow.
|
|
138742
138864
|
Fails if the flow file does not exist in the .argent/flows/ directory.`,
|
|
138743
|
-
zodSchema:
|
|
138865
|
+
zodSchema: zodSchema62,
|
|
138744
138866
|
fileInputs: fileInputs4,
|
|
138745
138867
|
services: () => ({}),
|
|
138746
138868
|
async execute(_services, params) {
|
|
@@ -139053,7 +139175,7 @@ async function readWorkspaceSnapshot(workspacePath) {
|
|
|
139053
139175
|
}
|
|
139054
139176
|
|
|
139055
139177
|
// ../tool-server/src/tools/workspace/gather-workspace-data.ts
|
|
139056
|
-
var
|
|
139178
|
+
var zodSchema63 = external_exports.object({
|
|
139057
139179
|
workspacePath: external_exports.string().describe("Absolute path to the project root directory to inspect (e.g. /Users/dev/MyApp)")
|
|
139058
139180
|
});
|
|
139059
139181
|
var fileInputs5 = [
|
|
@@ -139079,7 +139201,7 @@ exploration of anything the snapshot surfaces.
|
|
|
139079
139201
|
Use when you need to inspect project configuration without manually reading multiple files.
|
|
139080
139202
|
Returns partial data if workspacePath does not exist or is not readable; missing items are represented as null or empty collections.
|
|
139081
139203
|
Fails if the workspacePath is not an absolute path or the directory cannot be accessed.`,
|
|
139082
|
-
zodSchema:
|
|
139204
|
+
zodSchema: zodSchema63,
|
|
139083
139205
|
fileInputs: fileInputs5,
|
|
139084
139206
|
services: () => ({}),
|
|
139085
139207
|
async execute(_services, params) {
|
|
@@ -139133,13 +139255,13 @@ var updateArgentTool = {
|
|
|
139133
139255
|
|
|
139134
139256
|
// ../tool-server/src/tools/system/dismiss-update.ts
|
|
139135
139257
|
init_zod();
|
|
139136
|
-
var
|
|
139258
|
+
var zodSchema64 = external_exports.object({
|
|
139137
139259
|
hours: external_exports.number().min(0).describe("Number of hours to suppress the update notification")
|
|
139138
139260
|
});
|
|
139139
139261
|
var dismissUpdateTool = {
|
|
139140
139262
|
id: "dismiss-update",
|
|
139141
139263
|
description: "Clear the Argent update notification for the given number of hours. Use when the user asks to postpone or silence update reminders. Returns { message } confirming the suppression duration. Fails if the hours value is negative or the suppression state cannot be persisted.",
|
|
139142
|
-
zodSchema:
|
|
139264
|
+
zodSchema: zodSchema64,
|
|
139143
139265
|
services: () => ({}),
|
|
139144
139266
|
async execute(_services, params, _options) {
|
|
139145
139267
|
const durationMs = params.hours * 60 * 60 * 1e3;
|
|
@@ -141194,7 +141316,7 @@ function roundToOne(value) {
|
|
|
141194
141316
|
}
|
|
141195
141317
|
|
|
141196
141318
|
// ../tool-server/src/tools/screenshot-diff/index.ts
|
|
141197
|
-
var
|
|
141319
|
+
var zodSchema65 = external_exports.object({
|
|
141198
141320
|
baselinePath: external_exports.string().min(1).optional().describe("Path to the baseline PNG file. Required unless captureBaseline is true."),
|
|
141199
141321
|
currentPath: external_exports.string().min(1).optional().describe("Path to the current PNG file. Required unless captureCurrent is true."),
|
|
141200
141322
|
udid: external_exports.string().min(1).describe("Target device id from `list-devices` (iOS UDID or Android serial)."),
|
|
@@ -141209,7 +141331,7 @@ var zodSchema64 = external_exports.object({
|
|
|
141209
141331
|
"Directory where diff artifacts should be written. Optional \u2014 defaults to a temp directory; the diff images are returned in the result either way."
|
|
141210
141332
|
)
|
|
141211
141333
|
}).strict();
|
|
141212
|
-
var
|
|
141334
|
+
var capability25 = {
|
|
141213
141335
|
apple: { simulator: true, device: true },
|
|
141214
141336
|
android: { emulator: true, device: true, unknown: true }
|
|
141215
141337
|
};
|
|
@@ -141228,8 +141350,8 @@ Returns { summary, diffPath, contextDiffPath }. The summary uses normalized [0,1
|
|
|
141228
141350
|
Ignores the fixed top status-bar band for both pixel and OCR text comparisons.
|
|
141229
141351
|
Fails if the input sources are invalid, PNG files cannot be read, outputDir cannot be written, or the simulator-server / emulator backend is not reachable.`,
|
|
141230
141352
|
searchHint: "compare screenshots png diff visual UI changes UI regression visual regression screenshot diff changed regions text ocr live capture",
|
|
141231
|
-
zodSchema:
|
|
141232
|
-
capability:
|
|
141353
|
+
zodSchema: zodSchema65,
|
|
141354
|
+
capability: capability25,
|
|
141233
141355
|
fileInputs: fileInputs6,
|
|
141234
141356
|
services: (params) => {
|
|
141235
141357
|
if (params.captureBaseline || params.captureCurrent) {
|
|
@@ -141447,7 +141569,7 @@ async function captureElementFrame(registry2, udid, match, opts = {}) {
|
|
|
141447
141569
|
}
|
|
141448
141570
|
|
|
141449
141571
|
// ../tool-server/src/tools/variants/propose-variant.ts
|
|
141450
|
-
var
|
|
141572
|
+
var zodSchema66 = external_exports.object({
|
|
141451
141573
|
element: external_exports.string().min(1).max(200).describe(
|
|
141452
141574
|
'Human name of the on-screen element this variant targets, e.g. "Foo button" or "profile header". Repeated calls with the same element accumulate multiple variants on it. Used as the default screen matcher when `match` is omitted.'
|
|
141453
141575
|
),
|
|
@@ -141502,7 +141624,7 @@ arrives as a follow-up message (this is the case in an \`argent lens\` CLI sessi
|
|
|
141502
141624
|
Returns { round, elementId, variantId, element, variantCount, totalElements } \u2014 confirmation only;
|
|
141503
141625
|
it does not wait for the user.`,
|
|
141504
141626
|
searchHint: "propose design variant alternative option for element non-blocking ab choice",
|
|
141505
|
-
zodSchema:
|
|
141627
|
+
zodSchema: zodSchema66,
|
|
141506
141628
|
services: () => ({}),
|
|
141507
141629
|
async execute(_services, params) {
|
|
141508
141630
|
let frame = params.variant.frame;
|
|
@@ -141526,7 +141648,7 @@ it does not wait for the user.`,
|
|
|
141526
141648
|
|
|
141527
141649
|
// ../tool-server/src/tools/variants/await-user-selection.ts
|
|
141528
141650
|
init_zod();
|
|
141529
|
-
var
|
|
141651
|
+
var zodSchema67 = external_exports.object({
|
|
141530
141652
|
timeoutSeconds: external_exports.number().int().min(5).max(86400).optional().describe(
|
|
141531
141653
|
"Max seconds to block this call before returning a re-awaitable { status: 'pending' } result (default 1800). The user's proposals stay live across timeouts \u2014 on 'pending' just call await_user_selection again. Lower this if your MCP client enforces a short request timeout."
|
|
141532
141654
|
)
|
|
@@ -141563,7 +141685,7 @@ This tool is long-running; it intentionally holds the request open. It honors cl
|
|
|
141563
141685
|
disconnects (aborts cleanly).`,
|
|
141564
141686
|
searchHint: "await wait user selection choice variant blocking confirm picks complete",
|
|
141565
141687
|
longRunning: true,
|
|
141566
|
-
zodSchema:
|
|
141688
|
+
zodSchema: zodSchema67,
|
|
141567
141689
|
services: () => ({}),
|
|
141568
141690
|
async execute(_services, params, options) {
|
|
141569
141691
|
const timeoutMs = (params.timeoutSeconds ?? 1800) * 1e3;
|
|
@@ -141577,7 +141699,7 @@ disconnects (aborts cleanly).`,
|
|
|
141577
141699
|
// ../tool-server/src/tools/chromium-tabs/index.ts
|
|
141578
141700
|
init_zod();
|
|
141579
141701
|
init_src();
|
|
141580
|
-
var
|
|
141702
|
+
var zodSchema68 = external_exports.object({
|
|
141581
141703
|
udid: external_exports.string().describe("Chromium device id from `list-devices` (e.g. `chromium-cdp-9222`)."),
|
|
141582
141704
|
action: external_exports.enum(["list", "select", "new", "close"]).describe(
|
|
141583
141705
|
"list: enumerate tabs/windows. select: make a tab active (every other tool then acts on it). new: open a tab. close: close a tab."
|
|
@@ -141588,7 +141710,7 @@ var zodSchema67 = external_exports.object({
|
|
|
141588
141710
|
url: external_exports.string().optional().describe("`new` only: URL to open (defaults to about:blank)."),
|
|
141589
141711
|
label: external_exports.string().optional().describe("`new` only: a memorable label usable interchangeably with the tabId.")
|
|
141590
141712
|
});
|
|
141591
|
-
var
|
|
141713
|
+
var capability26 = {
|
|
141592
141714
|
chromium: { app: true }
|
|
141593
141715
|
};
|
|
141594
141716
|
var chromiumTabsTool = {
|
|
@@ -141601,8 +141723,8 @@ var chromiumTabsTool = {
|
|
|
141601
141723
|
Use when an app exposes multiple windows or tabs and you need to inspect or drive one other than the current page, or to open/close a page during a flow. tabIds are stable for the session and never reused.
|
|
141602
141724
|
Returns { tabs: [{ tabId, targetId, title, url, active, label? }] }. Fails if the device is not a Chromium (CDP) device, or the requested tabId/label no longer matches a live tab. Chromium-only.`,
|
|
141603
141725
|
searchHint: "tab tabs window windows switch select close new open multi-tab chromium electron",
|
|
141604
|
-
zodSchema:
|
|
141605
|
-
capability:
|
|
141726
|
+
zodSchema: zodSchema68,
|
|
141727
|
+
capability: capability26,
|
|
141606
141728
|
services: (params) => {
|
|
141607
141729
|
const device = resolveDevice(params.udid);
|
|
141608
141730
|
if (device.platform === "chromium") {
|
|
@@ -141702,7 +141824,7 @@ async function clearStorage(cdp, type) {
|
|
|
141702
141824
|
}
|
|
141703
141825
|
|
|
141704
141826
|
// ../tool-server/src/tools/chromium-cookies/index.ts
|
|
141705
|
-
var
|
|
141827
|
+
var zodSchema69 = external_exports.object({
|
|
141706
141828
|
udid: external_exports.string().describe("Chromium device id from `list-devices` (e.g. `chromium-cdp-9222`)."),
|
|
141707
141829
|
action: external_exports.enum(["get", "set", "delete", "clear"]).describe(
|
|
141708
141830
|
"get: read cookies. set: create/update a cookie. delete: remove a named cookie. clear: remove all browser cookies."
|
|
@@ -141719,7 +141841,7 @@ var zodSchema68 = external_exports.object({
|
|
|
141719
141841
|
sameSite: external_exports.enum(["Strict", "Lax", "None"]).optional().describe("set: SameSite policy."),
|
|
141720
141842
|
expires: external_exports.number().optional().describe("set: expiry as a Unix timestamp (seconds). Omit for a session cookie.")
|
|
141721
141843
|
});
|
|
141722
|
-
var
|
|
141844
|
+
var capability27 = {
|
|
141723
141845
|
chromium: { app: true }
|
|
141724
141846
|
};
|
|
141725
141847
|
var chromiumCookiesTool = {
|
|
@@ -141732,8 +141854,8 @@ var chromiumCookiesTool = {
|
|
|
141732
141854
|
Use when seeding an authenticated session before a flow (set the session cookie, then navigate) or asserting cookie state after one.
|
|
141733
141855
|
Returns { cookies, count } for get, or a small status object ({ set } / { deleted } / { cleared }) otherwise. Fails if the device is not a Chromium (CDP) device, or set is missing name/value. Chromium-only.`,
|
|
141734
141856
|
searchHint: "cookies cookie get set delete clear httponly samesite session auth chromium",
|
|
141735
|
-
zodSchema:
|
|
141736
|
-
capability:
|
|
141857
|
+
zodSchema: zodSchema69,
|
|
141858
|
+
capability: capability27,
|
|
141737
141859
|
services: (params) => {
|
|
141738
141860
|
const device = resolveDevice(params.udid);
|
|
141739
141861
|
if (device.platform === "chromium") {
|
|
@@ -141797,7 +141919,7 @@ Returns { cookies, count } for get, or a small status object ({ set } / { delete
|
|
|
141797
141919
|
// ../tool-server/src/tools/chromium-storage/index.ts
|
|
141798
141920
|
init_zod();
|
|
141799
141921
|
init_src();
|
|
141800
|
-
var
|
|
141922
|
+
var zodSchema70 = external_exports.object({
|
|
141801
141923
|
udid: external_exports.string().describe("Chromium device id from `list-devices` (e.g. `chromium-cdp-9222`)."),
|
|
141802
141924
|
store: external_exports.enum(["local", "session"]).describe("Which Web Storage area: `local` (localStorage) or `session` (sessionStorage)."),
|
|
141803
141925
|
action: external_exports.enum(["get", "set", "remove", "clear"]).describe(
|
|
@@ -141806,7 +141928,7 @@ var zodSchema69 = external_exports.object({
|
|
|
141806
141928
|
key: external_exports.string().optional().describe("get (optional) / set / remove: the storage key."),
|
|
141807
141929
|
value: external_exports.string().optional().describe("set: the value to store.")
|
|
141808
141930
|
});
|
|
141809
|
-
var
|
|
141931
|
+
var capability28 = {
|
|
141810
141932
|
chromium: { app: true }
|
|
141811
141933
|
};
|
|
141812
141934
|
var chromiumStorageTool = {
|
|
@@ -141820,8 +141942,8 @@ Set \`store\` to "local" or "session". Storage is per-origin, so it reflects the
|
|
|
141820
141942
|
Use when seeding feature flags / auth tokens before a flow or asserting persisted app state after one.
|
|
141821
141943
|
Returns { value } for a single key, { entries, count } for all, or a status object ({ set } / { removed } / { cleared }) otherwise. Fails if the device is not a Chromium (CDP) device, or set is missing key/value. Chromium-only.`,
|
|
141822
141944
|
searchHint: "storage localstorage sessionstorage local session get set remove clear key value chromium",
|
|
141823
|
-
zodSchema:
|
|
141824
|
-
capability:
|
|
141945
|
+
zodSchema: zodSchema70,
|
|
141946
|
+
capability: capability28,
|
|
141825
141947
|
services: (params) => {
|
|
141826
141948
|
const device = resolveDevice(params.udid);
|
|
141827
141949
|
if (device.platform === "chromium") {
|
|
@@ -141919,6 +142041,7 @@ function createRegistry() {
|
|
|
141919
142041
|
registry2.registerTool(networkRequestTool);
|
|
141920
142042
|
registry2.registerTool(createDescribeTool(registry2));
|
|
141921
142043
|
registry2.registerTool(createAwaitUiElementTool(registry2));
|
|
142044
|
+
registry2.registerTool(createAwaitScreenIdleTool(registry2));
|
|
141922
142045
|
registry2.registerTool(createReactProfilerStartTool(registry2));
|
|
141923
142046
|
registry2.registerTool(createReactProfilerStopTool(registry2));
|
|
141924
142047
|
registry2.registerTool(createReactProfilerStatusTool(registry2));
|