@swmansion/argent 0.35.1-next.85 → 0.35.1-next.87
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 +35 -5
- package/dist/client.js +26 -1
- package/dist/installer.mjs +3 -1
- package/dist/mcp-server.mjs +68 -6
- package/dist/tool-args.generated.d.ts +4 -0
- package/dist/tool-server.cjs +826 -371
- package/package.json +2 -2
package/dist/tool-server.cjs
CHANGED
|
@@ -1429,16 +1429,20 @@ var init_event_emitter = __esm({
|
|
|
1429
1429
|
});
|
|
1430
1430
|
|
|
1431
1431
|
// ../registry/src/types.ts
|
|
1432
|
+
function isValidSession(session) {
|
|
1433
|
+
return /^[\x21-\x7e]{1,128}$/.test(session);
|
|
1434
|
+
}
|
|
1432
1435
|
function isLiveServiceState(state3) {
|
|
1433
1436
|
return state3 === "RUNNING" /* RUNNING */ || state3 === "STARTING" /* STARTING */;
|
|
1434
1437
|
}
|
|
1435
|
-
var LINKED_CALL_HEADER, E2E_DIR_CLIENT_HEADER, CLIENT_SECRETS_HEADER, CLIENT_SECRET_SOURCES_HEADER;
|
|
1438
|
+
var LINKED_CALL_HEADER, E2E_DIR_CLIENT_HEADER, CLIENT_SECRETS_HEADER, SESSION_HEADER, CLIENT_SECRET_SOURCES_HEADER;
|
|
1436
1439
|
var init_types = __esm({
|
|
1437
1440
|
"../registry/src/types.ts"() {
|
|
1438
1441
|
"use strict";
|
|
1439
1442
|
LINKED_CALL_HEADER = "x-argent-linked";
|
|
1440
1443
|
E2E_DIR_CLIENT_HEADER = "x-argent-e2e-dir";
|
|
1441
1444
|
CLIENT_SECRETS_HEADER = "x-argent-client-secrets";
|
|
1445
|
+
SESSION_HEADER = "x-argent-session";
|
|
1442
1446
|
CLIENT_SECRET_SOURCES_HEADER = "x-argent-client-secret-sources";
|
|
1443
1447
|
}
|
|
1444
1448
|
});
|
|
@@ -1829,6 +1833,8 @@ var init_failure_codes = __esm({
|
|
|
1829
1833
|
HTTP_CAPABILITY_UNSUPPORTED_OPERATION: "HTTP_CAPABILITY_UNSUPPORTED_OPERATION",
|
|
1830
1834
|
HTTP_DEVICE_RESOLUTION_FAILED: "HTTP_DEVICE_RESOLUTION_FAILED",
|
|
1831
1835
|
HTTP_DEPENDENCY_PREFLIGHT_MISSING: "HTTP_DEPENDENCY_PREFLIGHT_MISSING",
|
|
1836
|
+
// Another session holds a claim on the device the call names.
|
|
1837
|
+
DEVICE_IN_USE: "DEVICE_IN_USE",
|
|
1832
1838
|
// The client's POST /upload of a file input was refused, so the call was not sent.
|
|
1833
1839
|
FILE_INPUT_UPLOAD_FAILED: "FILE_INPUT_UPLOAD_FAILED",
|
|
1834
1840
|
CLI_RUN_TOOL_NOT_FOUND: "CLI_RUN_TOOL_NOT_FOUND",
|
|
@@ -18335,8 +18341,8 @@ function finalize(ctx, schema) {
|
|
|
18335
18341
|
const root = ctx.seen.get(schema);
|
|
18336
18342
|
if (!root)
|
|
18337
18343
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
18338
|
-
const flattenRef = (
|
|
18339
|
-
const seen = ctx.seen.get(
|
|
18344
|
+
const flattenRef = (zodSchema91) => {
|
|
18345
|
+
const seen = ctx.seen.get(zodSchema91);
|
|
18340
18346
|
if (seen.ref === null)
|
|
18341
18347
|
return;
|
|
18342
18348
|
const schema2 = seen.def ?? seen.schema;
|
|
@@ -18354,7 +18360,7 @@ function finalize(ctx, schema) {
|
|
|
18354
18360
|
assignProps(schema2, refSchema);
|
|
18355
18361
|
}
|
|
18356
18362
|
assignProps(schema2, _cached);
|
|
18357
|
-
const isParentRef =
|
|
18363
|
+
const isParentRef = zodSchema91._zod.parent === ref;
|
|
18358
18364
|
if (isParentRef) {
|
|
18359
18365
|
for (const key2 in schema2) {
|
|
18360
18366
|
if (key2 === "$ref" || key2 === "allOf")
|
|
@@ -18374,7 +18380,7 @@ function finalize(ctx, schema) {
|
|
|
18374
18380
|
}
|
|
18375
18381
|
}
|
|
18376
18382
|
}
|
|
18377
|
-
const parent =
|
|
18383
|
+
const parent = zodSchema91._zod.parent;
|
|
18378
18384
|
if (parent && parent !== ref) {
|
|
18379
18385
|
flattenRef(parent);
|
|
18380
18386
|
const parentSeen = ctx.seen.get(parent);
|
|
@@ -18392,7 +18398,7 @@ function finalize(ctx, schema) {
|
|
|
18392
18398
|
}
|
|
18393
18399
|
}
|
|
18394
18400
|
ctx.override({
|
|
18395
|
-
zodSchema:
|
|
18401
|
+
zodSchema: zodSchema91,
|
|
18396
18402
|
jsonSchema: schema2,
|
|
18397
18403
|
path: seen.path ?? []
|
|
18398
18404
|
});
|
|
@@ -21827,10 +21833,10 @@ function convertBaseSchema(schema, ctx) {
|
|
|
21827
21833
|
}
|
|
21828
21834
|
ctx.processing.add(refPath);
|
|
21829
21835
|
const resolved = resolveRef(refPath, ctx);
|
|
21830
|
-
const
|
|
21831
|
-
ctx.refs.set(refPath,
|
|
21836
|
+
const zodSchema92 = convertSchema(resolved, ctx);
|
|
21837
|
+
ctx.refs.set(refPath, zodSchema92);
|
|
21832
21838
|
ctx.processing.delete(refPath);
|
|
21833
|
-
return
|
|
21839
|
+
return zodSchema92;
|
|
21834
21840
|
}
|
|
21835
21841
|
if (schema.enum !== void 0) {
|
|
21836
21842
|
const enumValues = schema.enum;
|
|
@@ -21872,7 +21878,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
21872
21878
|
if (!type) {
|
|
21873
21879
|
return z.any();
|
|
21874
21880
|
}
|
|
21875
|
-
let
|
|
21881
|
+
let zodSchema91;
|
|
21876
21882
|
switch (type) {
|
|
21877
21883
|
case "string": {
|
|
21878
21884
|
let stringSchema = z.string();
|
|
@@ -21941,7 +21947,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
21941
21947
|
if (schema.pattern) {
|
|
21942
21948
|
stringSchema = stringSchema.regex(new RegExp(schema.pattern));
|
|
21943
21949
|
}
|
|
21944
|
-
|
|
21950
|
+
zodSchema91 = stringSchema;
|
|
21945
21951
|
break;
|
|
21946
21952
|
}
|
|
21947
21953
|
case "number":
|
|
@@ -21966,15 +21972,15 @@ function convertBaseSchema(schema, ctx) {
|
|
|
21966
21972
|
if (typeof schema.multipleOf === "number") {
|
|
21967
21973
|
numberSchema = numberSchema.multipleOf(schema.multipleOf);
|
|
21968
21974
|
}
|
|
21969
|
-
|
|
21975
|
+
zodSchema91 = numberSchema;
|
|
21970
21976
|
break;
|
|
21971
21977
|
}
|
|
21972
21978
|
case "boolean": {
|
|
21973
|
-
|
|
21979
|
+
zodSchema91 = z.boolean();
|
|
21974
21980
|
break;
|
|
21975
21981
|
}
|
|
21976
21982
|
case "null": {
|
|
21977
|
-
|
|
21983
|
+
zodSchema91 = z.null();
|
|
21978
21984
|
break;
|
|
21979
21985
|
}
|
|
21980
21986
|
case "object": {
|
|
@@ -22001,21 +22007,21 @@ function convertBaseSchema(schema, ctx) {
|
|
|
22001
22007
|
}
|
|
22002
22008
|
schemasToIntersect.push(...looseRecords);
|
|
22003
22009
|
if (schemasToIntersect.length === 0) {
|
|
22004
|
-
|
|
22010
|
+
zodSchema91 = z.object({}).passthrough();
|
|
22005
22011
|
} else if (schemasToIntersect.length === 1) {
|
|
22006
|
-
|
|
22012
|
+
zodSchema91 = schemasToIntersect[0];
|
|
22007
22013
|
} else {
|
|
22008
22014
|
let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
22009
22015
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
22010
22016
|
result = z.intersection(result, schemasToIntersect[i]);
|
|
22011
22017
|
}
|
|
22012
|
-
|
|
22018
|
+
zodSchema91 = result;
|
|
22013
22019
|
}
|
|
22014
22020
|
if (schema.additionalProperties === false) {
|
|
22015
22021
|
const propertyKeys = Object.keys(shape);
|
|
22016
22022
|
const patterns = patternKeys.map((p) => new RegExp(p));
|
|
22017
|
-
const basePatternSchema =
|
|
22018
|
-
|
|
22023
|
+
const basePatternSchema = zodSchema91;
|
|
22024
|
+
zodSchema91 = zodSchema91.check((payload) => {
|
|
22019
22025
|
if (!isPlainObject2(payload.value))
|
|
22020
22026
|
return;
|
|
22021
22027
|
const unrecognized = [];
|
|
@@ -22039,11 +22045,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
22039
22045
|
} else {
|
|
22040
22046
|
const objectSchema = z.object(shape);
|
|
22041
22047
|
if (schema.additionalProperties === false) {
|
|
22042
|
-
|
|
22048
|
+
zodSchema91 = objectSchema.strict();
|
|
22043
22049
|
} else if (additionalSchema) {
|
|
22044
|
-
|
|
22050
|
+
zodSchema91 = objectSchema.catchall(additionalSchema);
|
|
22045
22051
|
} else {
|
|
22046
|
-
|
|
22052
|
+
zodSchema91 = objectSchema.passthrough();
|
|
22047
22053
|
}
|
|
22048
22054
|
}
|
|
22049
22055
|
const hasKeyGuard = schema.propertyNames !== void 0 && schema.propertyNames !== true;
|
|
@@ -22055,7 +22061,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
22055
22061
|
const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === void 0 ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
|
|
22056
22062
|
keySchema = convertSchema(keyJSONSchema, ctx);
|
|
22057
22063
|
}
|
|
22058
|
-
|
|
22064
|
+
zodSchema91 = checkObjectGuards(zodSchema91, { keySchema, minProperties, maxProperties });
|
|
22059
22065
|
}
|
|
22060
22066
|
break;
|
|
22061
22067
|
}
|
|
@@ -22068,12 +22074,12 @@ function convertBaseSchema(schema, ctx) {
|
|
|
22068
22074
|
const positionalItems = applyMinItems(tupleItems, minItems);
|
|
22069
22075
|
const rest = !Array.isArray(items) ? getTupleRest(items, ctx) : void 0;
|
|
22070
22076
|
const tupleSchema = z.tuple(positionalItems);
|
|
22071
|
-
|
|
22077
|
+
zodSchema91 = rest ? tupleSchema.rest(rest) : tupleSchema;
|
|
22072
22078
|
if (typeof schema.minItems === "number") {
|
|
22073
|
-
|
|
22079
|
+
zodSchema91 = zodSchema91.check(z.minLength(schema.minItems));
|
|
22074
22080
|
}
|
|
22075
22081
|
if (typeof schema.maxItems === "number") {
|
|
22076
|
-
|
|
22082
|
+
zodSchema91 = zodSchema91.check(z.maxLength(schema.maxItems));
|
|
22077
22083
|
}
|
|
22078
22084
|
} else if (Array.isArray(items)) {
|
|
22079
22085
|
const minItems = typeof schema.minItems === "number" ? schema.minItems : 0;
|
|
@@ -22081,12 +22087,12 @@ function convertBaseSchema(schema, ctx) {
|
|
|
22081
22087
|
const positionalItems = applyMinItems(tupleItems, minItems);
|
|
22082
22088
|
const rest = getTupleRest(schema.additionalItems, ctx);
|
|
22083
22089
|
const tupleSchema = z.tuple(positionalItems);
|
|
22084
|
-
|
|
22090
|
+
zodSchema91 = rest ? tupleSchema.rest(rest) : tupleSchema;
|
|
22085
22091
|
if (typeof schema.minItems === "number") {
|
|
22086
|
-
|
|
22092
|
+
zodSchema91 = zodSchema91.check(z.minLength(schema.minItems));
|
|
22087
22093
|
}
|
|
22088
22094
|
if (typeof schema.maxItems === "number") {
|
|
22089
|
-
|
|
22095
|
+
zodSchema91 = zodSchema91.check(z.maxLength(schema.maxItems));
|
|
22090
22096
|
}
|
|
22091
22097
|
} else if (items !== void 0) {
|
|
22092
22098
|
const element = convertSchema(items, ctx);
|
|
@@ -22097,12 +22103,12 @@ function convertBaseSchema(schema, ctx) {
|
|
|
22097
22103
|
if (typeof schema.maxItems === "number") {
|
|
22098
22104
|
arraySchema = arraySchema.max(schema.maxItems);
|
|
22099
22105
|
}
|
|
22100
|
-
|
|
22106
|
+
zodSchema91 = arraySchema;
|
|
22101
22107
|
} else {
|
|
22102
|
-
|
|
22108
|
+
zodSchema91 = z.array(z.any());
|
|
22103
22109
|
}
|
|
22104
22110
|
if (schema.uniqueItems === true || schema.contains !== void 0) {
|
|
22105
|
-
|
|
22111
|
+
zodSchema91 = checkArrayGuards(zodSchema91, {
|
|
22106
22112
|
uniqueItems: schema.uniqueItems === true,
|
|
22107
22113
|
containsSchema: schema.contains !== void 0 ? convertSchema(schema.contains, ctx) : void 0,
|
|
22108
22114
|
minContains: typeof schema.minContains === "number" ? schema.minContains : void 0,
|
|
@@ -22114,7 +22120,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
22114
22120
|
default:
|
|
22115
22121
|
throw new Error(`Unsupported type: ${type}`);
|
|
22116
22122
|
}
|
|
22117
|
-
return
|
|
22123
|
+
return zodSchema91;
|
|
22118
22124
|
}
|
|
22119
22125
|
function convertSchema(schema, ctx) {
|
|
22120
22126
|
if (typeof schema === "boolean") {
|
|
@@ -48683,7 +48689,10 @@ async function commandOnPath(name) {
|
|
|
48683
48689
|
if (!/^[A-Za-z0-9_.-]+$/.test(name)) return null;
|
|
48684
48690
|
try {
|
|
48685
48691
|
if (process.platform === "win32") {
|
|
48686
|
-
const { stdout: stdout2 } = await execFileAsync("where", [name], {
|
|
48692
|
+
const { stdout: stdout2 } = await execFileAsync("where", [name], {
|
|
48693
|
+
timeout: 2e3,
|
|
48694
|
+
windowsHide: true
|
|
48695
|
+
});
|
|
48687
48696
|
const cwd = import_node_path4.win32.resolve(process.cwd()).toLowerCase();
|
|
48688
48697
|
const match = stdout2.split(/\r?\n/).map((line) => line.trim()).filter(Boolean).find((candidate) => import_node_path4.win32.resolve(import_node_path4.win32.dirname(candidate)).toLowerCase() !== cwd);
|
|
48689
48698
|
return match ?? null;
|
|
@@ -52387,7 +52396,8 @@ async function emulatorSupportsFlag(flag, options = {}) {
|
|
|
52387
52396
|
// wedged in Qt/graphics init) leaves execFile unsettled forever, and
|
|
52388
52397
|
// this await has no deadline of its own.
|
|
52389
52398
|
killSignal: "SIGKILL",
|
|
52390
|
-
maxBuffer: 8 * 1024 * 1024
|
|
52399
|
+
maxBuffer: 8 * 1024 * 1024,
|
|
52400
|
+
windowsHide: true
|
|
52391
52401
|
});
|
|
52392
52402
|
output2 = stdout + stderr;
|
|
52393
52403
|
} catch (err) {
|
|
@@ -52439,7 +52449,8 @@ async function runAdb(args, options = {}) {
|
|
|
52439
52449
|
killSignal: ADB_KILL_SIGNAL,
|
|
52440
52450
|
maxBuffer: 64 * 1024 * 1024,
|
|
52441
52451
|
encoding: "utf-8",
|
|
52442
|
-
env: envWithoutAdbTrace()
|
|
52452
|
+
env: envWithoutAdbTrace(),
|
|
52453
|
+
windowsHide: true
|
|
52443
52454
|
});
|
|
52444
52455
|
return { stdout, stderr };
|
|
52445
52456
|
} catch (err) {
|
|
@@ -52454,7 +52465,8 @@ async function runAdbBinary(args, options = {}) {
|
|
|
52454
52465
|
timeout: options.timeoutMs ?? 3e4,
|
|
52455
52466
|
killSignal: ADB_KILL_SIGNAL,
|
|
52456
52467
|
maxBuffer: 64 * 1024 * 1024,
|
|
52457
|
-
encoding: "buffer"
|
|
52468
|
+
encoding: "buffer",
|
|
52469
|
+
windowsHide: true
|
|
52458
52470
|
});
|
|
52459
52471
|
return stdout;
|
|
52460
52472
|
} catch (err) {
|
|
@@ -52488,7 +52500,8 @@ async function adbShellInput(serial, shellCommand, input2, options = {}) {
|
|
|
52488
52500
|
timeout: options.timeoutMs ?? 3e4,
|
|
52489
52501
|
killSignal: ADB_KILL_SIGNAL,
|
|
52490
52502
|
maxBuffer: 64 * 1024 * 1024,
|
|
52491
|
-
encoding: "utf-8"
|
|
52503
|
+
encoding: "utf-8",
|
|
52504
|
+
windowsHide: true
|
|
52492
52505
|
},
|
|
52493
52506
|
(err, stdout, stderr) => {
|
|
52494
52507
|
if (err) {
|
|
@@ -52716,7 +52729,8 @@ async function listAvds() {
|
|
|
52716
52729
|
try {
|
|
52717
52730
|
const { stdout } = await execFileAsync7(emulatorPath, ["-list-avds"], {
|
|
52718
52731
|
timeout: 5e3,
|
|
52719
|
-
killSignal: "SIGKILL"
|
|
52732
|
+
killSignal: "SIGKILL",
|
|
52733
|
+
windowsHide: true
|
|
52720
52734
|
});
|
|
52721
52735
|
return stdout.split("\n").map((l) => l.trim()).filter((l) => l && AVD_NAME_PATTERN.test(l)).map((name) => ({ name }));
|
|
52722
52736
|
} catch {
|
|
@@ -52736,7 +52750,8 @@ async function checkSnapshotLoadable(avdName, snapshotName = "default_boot", opt
|
|
|
52736
52750
|
const { stdout } = await execFileAsync7(emulatorPath, args, {
|
|
52737
52751
|
timeout: options.timeoutMs ?? 1e4,
|
|
52738
52752
|
killSignal: "SIGKILL",
|
|
52739
|
-
maxBuffer: 4 * 1024 * 1024
|
|
52753
|
+
maxBuffer: 4 * 1024 * 1024,
|
|
52754
|
+
windowsHide: true
|
|
52740
52755
|
});
|
|
52741
52756
|
const tail = stdout.split("\n").slice(-6).join("\n");
|
|
52742
52757
|
if (/(^|\n)\s*Loadable\s*(\n|$)/.test(tail)) return { loadable: true, reason: null };
|
|
@@ -73410,7 +73425,7 @@ function isCi(env = process.env) {
|
|
|
73410
73425
|
var SESSION_ID = (0, import_node_crypto4.randomUUID)();
|
|
73411
73426
|
function readCliVersion() {
|
|
73412
73427
|
if (true) {
|
|
73413
|
-
return "0.35.1-next.
|
|
73428
|
+
return "0.35.1-next.86";
|
|
73414
73429
|
}
|
|
73415
73430
|
return "0.0.0";
|
|
73416
73431
|
}
|
|
@@ -74273,8 +74288,8 @@ var import_express3 = __toESM(require_express2());
|
|
|
74273
74288
|
var import_bytes2 = __toESM(require_bytes());
|
|
74274
74289
|
var import_node_fs14 = require("node:fs");
|
|
74275
74290
|
var import_promises16 = require("node:fs/promises");
|
|
74276
|
-
var
|
|
74277
|
-
var
|
|
74291
|
+
var import_node_os13 = require("node:os");
|
|
74292
|
+
var import_node_path18 = require("node:path");
|
|
74278
74293
|
init_src();
|
|
74279
74294
|
var import_node_crypto17 = require("node:crypto");
|
|
74280
74295
|
|
|
@@ -74407,7 +74422,8 @@ function tarEnv(env) {
|
|
|
74407
74422
|
async function runTar(archive, args, signal) {
|
|
74408
74423
|
const child = (0, import_node_child_process2.spawn)("tar", [...args, "-f", "-"], {
|
|
74409
74424
|
signal,
|
|
74410
|
-
env: tarEnv(process.env)
|
|
74425
|
+
env: tarEnv(process.env),
|
|
74426
|
+
windowsHide: true
|
|
74411
74427
|
});
|
|
74412
74428
|
let childError;
|
|
74413
74429
|
child.on("error", (err) => {
|
|
@@ -75032,7 +75048,8 @@ async function runHarmonyEmulator(args, timeoutMs = EMULATOR_TIMEOUT_MS) {
|
|
|
75032
75048
|
const { stdout, stderr } = await execFileAsync4(bin, args, {
|
|
75033
75049
|
timeout: timeoutMs,
|
|
75034
75050
|
killSignal: EMULATOR_KILL_SIGNAL,
|
|
75035
|
-
maxBuffer: 8 * 1024 * 1024
|
|
75051
|
+
maxBuffer: 8 * 1024 * 1024,
|
|
75052
|
+
windowsHide: true
|
|
75036
75053
|
});
|
|
75037
75054
|
return { stdout, stderr };
|
|
75038
75055
|
} catch (err) {
|
|
@@ -75122,7 +75139,8 @@ async function runHdc(args, timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
|
75122
75139
|
const { stdout, stderr } = await execFileAsync5(bin, args, {
|
|
75123
75140
|
timeout: timeoutMs,
|
|
75124
75141
|
killSignal: HDC_KILL_SIGNAL,
|
|
75125
|
-
maxBuffer: 64 * 1024 * 1024
|
|
75142
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
75143
|
+
windowsHide: true
|
|
75126
75144
|
});
|
|
75127
75145
|
return { stdout, stderr };
|
|
75128
75146
|
} catch (err) {
|
|
@@ -81285,8 +81303,8 @@ function consumePendingSigningDetectionNote(udid) {
|
|
|
81285
81303
|
|
|
81286
81304
|
// ../tool-server/src/preview.ts
|
|
81287
81305
|
var import_node_fs11 = __toESM(require("node:fs"));
|
|
81288
|
-
var
|
|
81289
|
-
var
|
|
81306
|
+
var import_node_os9 = __toESM(require("node:os"));
|
|
81307
|
+
var import_node_path15 = __toESM(require("node:path"));
|
|
81290
81308
|
var import_express = __toESM(require_express2());
|
|
81291
81309
|
init_src();
|
|
81292
81310
|
|
|
@@ -105184,7 +105202,11 @@ var import_node_util16 = require("node:util");
|
|
|
105184
105202
|
init_device_info();
|
|
105185
105203
|
init_android_binary();
|
|
105186
105204
|
var execFileAsync15 = (0, import_node_util16.promisify)(import_node_child_process21.execFile);
|
|
105187
|
-
var SHUTDOWN_EXEC_OPTIONS = {
|
|
105205
|
+
var SHUTDOWN_EXEC_OPTIONS = {
|
|
105206
|
+
timeout: 3e4,
|
|
105207
|
+
killSignal: "SIGKILL",
|
|
105208
|
+
windowsHide: true
|
|
105209
|
+
};
|
|
105188
105210
|
async function shutdownOwnedDevice(id) {
|
|
105189
105211
|
let platform;
|
|
105190
105212
|
try {
|
|
@@ -108598,6 +108620,285 @@ async function resolveRunningVvdSerial() {
|
|
|
108598
108620
|
|
|
108599
108621
|
// ../tool-server/src/tools/devices/list-devices.ts
|
|
108600
108622
|
init_external_devices();
|
|
108623
|
+
|
|
108624
|
+
// ../tool-server/src/utils/device-claims.ts
|
|
108625
|
+
init_src2();
|
|
108626
|
+
init_adb();
|
|
108627
|
+
|
|
108628
|
+
// ../tool-server/src/utils/emulator-console.ts
|
|
108629
|
+
var import_node_os8 = require("node:os");
|
|
108630
|
+
var import_node_path14 = require("node:path");
|
|
108631
|
+
init_adb();
|
|
108632
|
+
async function runEmuConsole(serial, args) {
|
|
108633
|
+
const { stdout } = await runAdb(["-s", serial, "emu", ...args], { timeoutMs: 1e4 });
|
|
108634
|
+
const verdict = replyLines(stdout).at(-1);
|
|
108635
|
+
if (verdict?.startsWith("KO:")) {
|
|
108636
|
+
throw new Error(
|
|
108637
|
+
`emulator console rejected \`${args.join(" ")}\` \u2014 ${describeConsoleReply(stdout)}`
|
|
108638
|
+
);
|
|
108639
|
+
}
|
|
108640
|
+
return stdout;
|
|
108641
|
+
}
|
|
108642
|
+
function describeConsoleReply(stdout) {
|
|
108643
|
+
const lines = replyLines(stdout);
|
|
108644
|
+
const reply = lines.join("; ") || "empty reply";
|
|
108645
|
+
if (!lines.at(-1)?.startsWith("KO: unknown command")) return reply;
|
|
108646
|
+
const tokenFile = (0, import_node_path14.join)((0, import_node_os8.homedir)(), ".emulator_console_auth_token");
|
|
108647
|
+
const fileKind = process.platform === "win32" ? "a file" : "a regular file, not a symlink,";
|
|
108648
|
+
return `${reply} (adb authenticates to the console with ${tokenFile}, which must be ${fileKind} holding the emulator's token)`;
|
|
108649
|
+
}
|
|
108650
|
+
function replyLines(stdout) {
|
|
108651
|
+
return stdout.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
108652
|
+
}
|
|
108653
|
+
|
|
108654
|
+
// ../tool-server/src/utils/device-claims.ts
|
|
108655
|
+
init_device_info();
|
|
108656
|
+
init_external_devices();
|
|
108657
|
+
var CLAIM_IDLE_SECONDS = 60;
|
|
108658
|
+
var CLAIM_IDLE_TIMEOUT_MS = CLAIM_IDLE_SECONDS * 1e3;
|
|
108659
|
+
var BOOT_PROBE_DEADLINE_MS = 3e3;
|
|
108660
|
+
var CAPTURE_HOLD_MS = 30 * 6e4;
|
|
108661
|
+
var CAPTURE_STOPS = {
|
|
108662
|
+
"network-capture-stop": "network-capture-start",
|
|
108663
|
+
"screen-recording-stop": "screen-recording-start",
|
|
108664
|
+
"react-profiler-stop": "react-profiler-start",
|
|
108665
|
+
"native-profiler-stop": "native-profiler-start"
|
|
108666
|
+
};
|
|
108667
|
+
var CAPTURE_STARTS = new Set(Object.values(CAPTURE_STOPS));
|
|
108668
|
+
var RECORDED_STEP_TOOL = "e2e-add-step";
|
|
108669
|
+
var RELEASE_DEVICE_TOOL_ID = "release-device";
|
|
108670
|
+
var UUID_SHAPE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
108671
|
+
function foldCase(device) {
|
|
108672
|
+
return device.toLowerCase();
|
|
108673
|
+
}
|
|
108674
|
+
function androidBootId(serial) {
|
|
108675
|
+
return adbShell(serial, "cat /proc/sys/kernel/random/boot_id", { timeoutMs: 5e3 }).then(
|
|
108676
|
+
(out) => out.trim() || null,
|
|
108677
|
+
() => null
|
|
108678
|
+
);
|
|
108679
|
+
}
|
|
108680
|
+
function emulatorProcessId(serial) {
|
|
108681
|
+
return runEmuConsole(serial, ["avd", "discoverypath"]).then(
|
|
108682
|
+
(out) => out.split("\n")[0]?.trim() || null,
|
|
108683
|
+
() => null
|
|
108684
|
+
);
|
|
108685
|
+
}
|
|
108686
|
+
function withinDeadline(read) {
|
|
108687
|
+
let timer;
|
|
108688
|
+
const deadline = new Promise((resolve24) => {
|
|
108689
|
+
timer = setTimeout(() => resolve24(null), BOOT_PROBE_DEADLINE_MS);
|
|
108690
|
+
});
|
|
108691
|
+
return Promise.race([read, deadline]).finally(() => clearTimeout(timer));
|
|
108692
|
+
}
|
|
108693
|
+
function chromiumBrowserId(port) {
|
|
108694
|
+
return ensureCdpReachable(port, AbortSignal.timeout(2e3)).then(
|
|
108695
|
+
(version3) => version3.webSocketDebuggerUrl ?? null,
|
|
108696
|
+
() => null
|
|
108697
|
+
);
|
|
108698
|
+
}
|
|
108699
|
+
function bootIdentity(device) {
|
|
108700
|
+
const port = parseChromiumCdpPort(device);
|
|
108701
|
+
if (port !== null) return chromiumBrowserId(port);
|
|
108702
|
+
if (isAndroidEmulatorSerial(device)) return emulatorProcessId(device);
|
|
108703
|
+
if (classifyDevice(device) === "android") return androidBootId(device);
|
|
108704
|
+
return Promise.resolve(null);
|
|
108705
|
+
}
|
|
108706
|
+
var DeviceClaims = class {
|
|
108707
|
+
constructor(idleTimeoutMs = CLAIM_IDLE_TIMEOUT_MS, now = () => Date.now(), identify = bootIdentity) {
|
|
108708
|
+
this.idleTimeoutMs = idleTimeoutMs;
|
|
108709
|
+
this.now = now;
|
|
108710
|
+
this.identify = identify;
|
|
108711
|
+
}
|
|
108712
|
+
idleTimeoutMs;
|
|
108713
|
+
now;
|
|
108714
|
+
identify;
|
|
108715
|
+
claims = /* @__PURE__ */ new Map();
|
|
108716
|
+
/**
|
|
108717
|
+
* Claims every device for `session` for the length of one call of `toolId`,
|
|
108718
|
+
* or names the first one another session holds. Call `done` when the call
|
|
108719
|
+
* ends, saying whether it succeeded.
|
|
108720
|
+
*/
|
|
108721
|
+
async claim(session, devices2, toolId, args) {
|
|
108722
|
+
for (const device of devices2) {
|
|
108723
|
+
const claim2 = this.liveClaim(device);
|
|
108724
|
+
if (claim2 === void 0 || claim2.session === session) continue;
|
|
108725
|
+
if (!await this.isAnotherBoot(claim2)) return { ok: false, device };
|
|
108726
|
+
this.drop(claim2);
|
|
108727
|
+
return this.claim(session, devices2, toolId, args);
|
|
108728
|
+
}
|
|
108729
|
+
const held2 = devices2.map((device) => this.hold(device, session));
|
|
108730
|
+
return {
|
|
108731
|
+
ok: true,
|
|
108732
|
+
done: (succeeded = false, result) => {
|
|
108733
|
+
for (const claim2 of held2) {
|
|
108734
|
+
if (toolId !== void 0) this.trackCapture(claim2, toolId, args, succeeded, result);
|
|
108735
|
+
claim2.activeCalls -= 1;
|
|
108736
|
+
claim2.lastUsedAt = this.now();
|
|
108737
|
+
claim2.boot = this.reidentify(claim2);
|
|
108738
|
+
if (claim2.released && claim2.activeCalls === 0) this.drop(claim2);
|
|
108739
|
+
}
|
|
108740
|
+
}
|
|
108741
|
+
};
|
|
108742
|
+
}
|
|
108743
|
+
/**
|
|
108744
|
+
* Releases `session`'s claim on `device`, or on every device it holds. A
|
|
108745
|
+
* device with a call in flight stays claimed until that call ends. Returns
|
|
108746
|
+
* the released devices.
|
|
108747
|
+
*/
|
|
108748
|
+
release(session, device) {
|
|
108749
|
+
const released = [];
|
|
108750
|
+
for (const key2 of [...this.claims.keys()]) {
|
|
108751
|
+
const claim2 = this.liveClaim(key2);
|
|
108752
|
+
if (!claim2 || claim2.released || claim2.session !== session) continue;
|
|
108753
|
+
if (device !== void 0 && key2 !== foldCase(device)) continue;
|
|
108754
|
+
if (claim2.activeCalls > 0) claim2.released = true;
|
|
108755
|
+
else this.claims.delete(key2);
|
|
108756
|
+
released.push(claim2.device);
|
|
108757
|
+
}
|
|
108758
|
+
return released;
|
|
108759
|
+
}
|
|
108760
|
+
/** Ends the capture holds on `devices`, or on every device, once their captures were stopped. */
|
|
108761
|
+
endCaptures(devices2) {
|
|
108762
|
+
const keys = devices2 && new Set(devices2.map((device) => foldCase(claimKey(device))));
|
|
108763
|
+
for (const [key2, claim2] of this.claims) {
|
|
108764
|
+
if (!keys || keys.has(key2)) claim2.captures.clear();
|
|
108765
|
+
}
|
|
108766
|
+
}
|
|
108767
|
+
async ownerOf(device, session) {
|
|
108768
|
+
const claim2 = this.liveClaim(device);
|
|
108769
|
+
if (!claim2) return void 0;
|
|
108770
|
+
if (claim2.session === session) return "this session";
|
|
108771
|
+
if (!await this.isAnotherBoot(claim2)) return "another session";
|
|
108772
|
+
this.drop(claim2);
|
|
108773
|
+
return void 0;
|
|
108774
|
+
}
|
|
108775
|
+
async isAnotherBoot(claim2) {
|
|
108776
|
+
if (claim2.activeCalls > 0) return false;
|
|
108777
|
+
const seen = claim2.lastUsedAt;
|
|
108778
|
+
const [claimed, current] = await Promise.all([
|
|
108779
|
+
withinDeadline(claim2.boot),
|
|
108780
|
+
withinDeadline(this.identify(claim2.device))
|
|
108781
|
+
]);
|
|
108782
|
+
if (claim2.activeCalls > 0 || claim2.lastUsedAt !== seen) return false;
|
|
108783
|
+
return claimed !== null && current !== null && claimed !== current;
|
|
108784
|
+
}
|
|
108785
|
+
/** A failed read keeps the last known boot, so a restart during an outage is still caught. */
|
|
108786
|
+
reidentify(claim2) {
|
|
108787
|
+
const known = claim2.boot;
|
|
108788
|
+
return this.identify(claim2.device).then((current) => current ?? known);
|
|
108789
|
+
}
|
|
108790
|
+
trackCapture(claim2, toolId, args, succeeded, result) {
|
|
108791
|
+
const recorded = toolId === RECORDED_STEP_TOOL;
|
|
108792
|
+
const tool = recorded ? recordedCommand(args) : toolId;
|
|
108793
|
+
if (tool === void 0) return;
|
|
108794
|
+
const answer = recorded ? result?.toolResult : result;
|
|
108795
|
+
if (succeeded && CAPTURE_STARTS.has(tool)) {
|
|
108796
|
+
const holdMs = captureHoldMs(answer);
|
|
108797
|
+
if (holdMs !== void 0) claim2.captures.set(tool, this.now() + holdMs);
|
|
108798
|
+
}
|
|
108799
|
+
const start2 = CAPTURE_STOPS[tool];
|
|
108800
|
+
if (start2 !== void 0) claim2.captures.delete(start2);
|
|
108801
|
+
}
|
|
108802
|
+
drop(claim2) {
|
|
108803
|
+
const key2 = foldCase(claim2.device);
|
|
108804
|
+
if (this.claims.get(key2) === claim2) this.claims.delete(key2);
|
|
108805
|
+
}
|
|
108806
|
+
liveClaim(device) {
|
|
108807
|
+
const claim2 = this.claims.get(foldCase(device));
|
|
108808
|
+
if (!claim2) return void 0;
|
|
108809
|
+
const idleSince = Math.max(claim2.lastUsedAt, ...claim2.captures.values());
|
|
108810
|
+
if (claim2.activeCalls === 0 && this.now() - idleSince > this.idleTimeoutMs) {
|
|
108811
|
+
this.claims.delete(foldCase(device));
|
|
108812
|
+
return void 0;
|
|
108813
|
+
}
|
|
108814
|
+
return claim2;
|
|
108815
|
+
}
|
|
108816
|
+
hold(device, session) {
|
|
108817
|
+
const existing = this.liveClaim(device);
|
|
108818
|
+
const claim2 = existing ?? {
|
|
108819
|
+
device,
|
|
108820
|
+
session,
|
|
108821
|
+
lastUsedAt: this.now(),
|
|
108822
|
+
activeCalls: 0,
|
|
108823
|
+
boot: this.identify(device),
|
|
108824
|
+
captures: /* @__PURE__ */ new Map()
|
|
108825
|
+
};
|
|
108826
|
+
claim2.activeCalls += 1;
|
|
108827
|
+
claim2.lastUsedAt = this.now();
|
|
108828
|
+
claim2.released = false;
|
|
108829
|
+
this.claims.set(foldCase(device), claim2);
|
|
108830
|
+
return claim2;
|
|
108831
|
+
}
|
|
108832
|
+
};
|
|
108833
|
+
function recordedCommand(args) {
|
|
108834
|
+
const command2 = args?.command;
|
|
108835
|
+
return typeof command2 === "string" ? canonicalToolId(command2) : void 0;
|
|
108836
|
+
}
|
|
108837
|
+
function captureHoldMs(result) {
|
|
108838
|
+
const answer = result ?? {};
|
|
108839
|
+
if (answer.already_running === true) return void 0;
|
|
108840
|
+
if (typeof answer.timeLimitSeconds !== "number") return CAPTURE_HOLD_MS;
|
|
108841
|
+
return Math.min(answer.timeLimitSeconds * 1e3, CAPTURE_HOLD_MS);
|
|
108842
|
+
}
|
|
108843
|
+
var DeviceInUseError = class extends Error {
|
|
108844
|
+
constructor(device) {
|
|
108845
|
+
super(deviceInUseMessage(device));
|
|
108846
|
+
this.name = "DeviceInUseError";
|
|
108847
|
+
withFailureSignal(this, {
|
|
108848
|
+
error_code: FAILURE_CODES.DEVICE_IN_USE,
|
|
108849
|
+
failure_stage: "picked_device_claim",
|
|
108850
|
+
failure_area: "tool_server",
|
|
108851
|
+
error_kind: "validation"
|
|
108852
|
+
});
|
|
108853
|
+
}
|
|
108854
|
+
};
|
|
108855
|
+
var deviceClaims = new DeviceClaims();
|
|
108856
|
+
function claimKey(deviceId) {
|
|
108857
|
+
const nativeId = externalNativeId(deviceId);
|
|
108858
|
+
const id = canonicalDeviceId(nativeId) ?? nativeId;
|
|
108859
|
+
return UUID_SHAPE.test(id) ? id.toUpperCase() : id;
|
|
108860
|
+
}
|
|
108861
|
+
function parseJson(text) {
|
|
108862
|
+
try {
|
|
108863
|
+
return JSON.parse(text);
|
|
108864
|
+
} catch {
|
|
108865
|
+
return void 0;
|
|
108866
|
+
}
|
|
108867
|
+
}
|
|
108868
|
+
function claimTargets(args) {
|
|
108869
|
+
if (!args || typeof args !== "object") return [];
|
|
108870
|
+
const record2 = args;
|
|
108871
|
+
const ids = [record2.udid, record2.device_id, record2.device];
|
|
108872
|
+
if (Array.isArray(record2.devices)) ids.push(...record2.devices);
|
|
108873
|
+
const named = ids.filter(
|
|
108874
|
+
(id) => typeof id === "string" && id.length > 0 && id !== CLOUD_ANDROID_DEVICE_ID
|
|
108875
|
+
);
|
|
108876
|
+
const stepTargets = typeof record2.args === "string" ? claimTargets(parseJson(record2.args)) : [];
|
|
108877
|
+
return [.../* @__PURE__ */ new Set([...named.map(claimKey), ...stepTargets])];
|
|
108878
|
+
}
|
|
108879
|
+
function parseSession(header) {
|
|
108880
|
+
if (header === void 0) return void 0;
|
|
108881
|
+
const session = header.trim();
|
|
108882
|
+
return isValidSession(session) ? session : null;
|
|
108883
|
+
}
|
|
108884
|
+
function deviceInUseMessage(device) {
|
|
108885
|
+
return `Device ${device} is in use by another Argent session. Pick another device from list-devices, retry after ${CLAIM_IDLE_SECONDS} s (the claim ends once the device is idle that long), or ask the user.`;
|
|
108886
|
+
}
|
|
108887
|
+
async function heldByAnotherSession(session, deviceId) {
|
|
108888
|
+
if (!session) return false;
|
|
108889
|
+
return await deviceClaims.ownerOf(claimKey(deviceId), session) === "another session";
|
|
108890
|
+
}
|
|
108891
|
+
async function claimPickedDevice(session, deviceId) {
|
|
108892
|
+
if (!session) return () => {
|
|
108893
|
+
};
|
|
108894
|
+
const claim2 = await deviceClaims.claim(session, [claimKey(deviceId)]);
|
|
108895
|
+
if (!claim2.ok) {
|
|
108896
|
+
throw new DeviceInUseError(claim2.device);
|
|
108897
|
+
}
|
|
108898
|
+
return claim2.done;
|
|
108899
|
+
}
|
|
108900
|
+
|
|
108901
|
+
// ../tool-server/src/tools/devices/list-devices.ts
|
|
108601
108902
|
var import_node_child_process24 = require("node:child_process");
|
|
108602
108903
|
var import_node_util19 = require("node:util");
|
|
108603
108904
|
var execFileAsync18 = (0, import_node_util19.promisify)(import_node_child_process24.execFile);
|
|
@@ -108790,6 +109091,17 @@ async function withDeadline(p, fallback, label) {
|
|
|
108790
109091
|
if (timer) clearTimeout(timer);
|
|
108791
109092
|
}
|
|
108792
109093
|
}
|
|
109094
|
+
function listedDeviceId(device) {
|
|
109095
|
+
if ("udid" in device && typeof device.udid === "string") return device.udid;
|
|
109096
|
+
if ("serial" in device && typeof device.serial === "string") return device.serial;
|
|
109097
|
+
if ("id" in device && typeof device.id === "string") return device.id;
|
|
109098
|
+
return void 0;
|
|
109099
|
+
}
|
|
109100
|
+
async function withClaim(device, session) {
|
|
109101
|
+
const id = listedDeviceId(device);
|
|
109102
|
+
const claim2 = id === void 0 ? void 0 : await deviceClaims.ownerOf(claimKey(id), session);
|
|
109103
|
+
return claim2 ? { ...device, claim: claim2 } : device;
|
|
109104
|
+
}
|
|
108793
109105
|
function toListedExternal(device) {
|
|
108794
109106
|
return {
|
|
108795
109107
|
capabilities: Array.from(device.capabilities).sort(),
|
|
@@ -108815,7 +109127,7 @@ var zodSchema2 = external_exports.object({});
|
|
|
108815
109127
|
var listDevicesTool = {
|
|
108816
109128
|
id: "list-devices",
|
|
108817
109129
|
description: `List available targets (ready devices first): iOS simulators/iPhones, Android emulators/AVDs/phones, Chromium apps, Vega devices, <flag:harmonyos>HarmonyOS, </flag:harmonyos><flag:macos-apps>Mac apps, </flag:macos-apps>and Argent Cloud simulators (\`ios-remote\`).
|
|
108818
|
-
Use when starting a session to discover target ids. Returns { devices, notes? }. Pass a ready device's \`udid\`, \`serial\`, or \`id\` to other tools; start stopped targets via \`boot-device\`. Use physical phones (\`kind: 'device'\`) only when asked. \`runtimeKind: 'tv'\` uses \`tv-remote\`, not gestures. Fails if device discovery errors; surface \`notes\` if a needed platform is unavailable.`,
|
|
109130
|
+
Use when starting a session to discover target ids. Returns { devices, notes? }. Pass a ready device's \`udid\`, \`serial\`, or \`id\` to other tools; start stopped targets via \`boot-device\`. Use physical phones (\`kind: 'device'\`) only when asked. \`runtimeKind: 'tv'\` uses \`tv-remote\`, not gestures. Fails if device discovery errors; surface \`notes\` if a needed platform is unavailable. Skip a device with \`claim: 'another session'\`: another Argent session drives it.`,
|
|
108819
109131
|
zodSchema: zodSchema2,
|
|
108820
109132
|
alwaysLoad: true,
|
|
108821
109133
|
searchHint: "list devices simulators emulators avd serial udid ios android chromium vega <flag:harmonyos>harmony harmonyos </flag:harmonyos>app fire tv session start",
|
|
@@ -108826,7 +109138,7 @@ Use when starting a session to discover target ids. Returns { devices, notes? }.
|
|
|
108826
109138
|
failedMsg: ({ failureSignal: failureSignal2 }) => `Failed to list devices: ${failureSignal2.error_code}`
|
|
108827
109139
|
},
|
|
108828
109140
|
services: () => ({}),
|
|
108829
|
-
async execute(_services, _params) {
|
|
109141
|
+
async execute(_services, _params, ctx) {
|
|
108830
109142
|
const harmonyEnabled = isHarmonyEnabled();
|
|
108831
109143
|
const xcodeInstallPending = ["simctl", "devicectl"].filter(xcodeFirstLaunchPending);
|
|
108832
109144
|
const [
|
|
@@ -109002,6 +109314,7 @@ Use when starting a session to discover target ids. Returns { devices, notes? }.
|
|
|
109002
109314
|
...external.map(toListedExternal)
|
|
109003
109315
|
];
|
|
109004
109316
|
devices2.sort((a, b) => readinessRank(a) - readinessRank(b));
|
|
109317
|
+
const listed = await Promise.all(devices2.map((device) => withClaim(device, ctx?.session)));
|
|
109005
109318
|
const [localIos, androidSdk] = await Promise.all([
|
|
109006
109319
|
xcodeInstallPending.includes("simctl") ? true : canRunLocalIos(ios.simulators.length > 0),
|
|
109007
109320
|
android.length > 0 || avds.length > 0 ? true : androidSdkFound()
|
|
@@ -109023,7 +109336,7 @@ Use when starting a session to discover target ids. Returns { devices, notes? }.
|
|
|
109023
109336
|
...external.length > 0 ? [EXTERNAL_DEVICES_HINT] : [],
|
|
109024
109337
|
...adbPrefix ? [adbServerHint(adbPrefix)] : []
|
|
109025
109338
|
];
|
|
109026
|
-
return { devices:
|
|
109339
|
+
return { devices: listed, ...notes.length > 0 ? { notes } : {} };
|
|
109027
109340
|
}
|
|
109028
109341
|
};
|
|
109029
109342
|
|
|
@@ -112003,7 +112316,7 @@ async function spawnHelper(serial) {
|
|
|
112003
112316
|
const proc = (0, import_node_child_process25.spawn)(
|
|
112004
112317
|
adbPath,
|
|
112005
112318
|
["-s", serial, "shell", "am", "instrument", "-w", manifest.instrumentationRunner],
|
|
112006
|
-
{ stdio: ["ignore", "pipe", "pipe"] }
|
|
112319
|
+
{ stdio: ["ignore", "pipe", "pipe"], windowsHide: true }
|
|
112007
112320
|
);
|
|
112008
112321
|
return new Promise((resolve24, reject) => {
|
|
112009
112322
|
let devicePort = null;
|
|
@@ -115436,9 +115749,9 @@ function hasUnreadWebView(node2) {
|
|
|
115436
115749
|
// ../tool-server/src/preview.ts
|
|
115437
115750
|
function findUiFile(name) {
|
|
115438
115751
|
const candidates = [
|
|
115439
|
-
|
|
115440
|
-
|
|
115441
|
-
|
|
115752
|
+
import_node_path15.default.join(__dirname, "preview-ui", name),
|
|
115753
|
+
import_node_path15.default.resolve(__dirname, "..", "..", "..", "ui", name),
|
|
115754
|
+
import_node_path15.default.resolve(__dirname, "..", "..", "ui", name)
|
|
115442
115755
|
];
|
|
115443
115756
|
for (const p of candidates) {
|
|
115444
115757
|
if (import_node_fs11.default.existsSync(p)) return p;
|
|
@@ -115447,7 +115760,7 @@ function findUiFile(name) {
|
|
|
115447
115760
|
}
|
|
115448
115761
|
function serveUiFile(res, filePath, contentType) {
|
|
115449
115762
|
res.set("Cache-Control", "no-store, must-revalidate");
|
|
115450
|
-
res.type(contentType).sendFile(
|
|
115763
|
+
res.type(contentType).sendFile(import_node_path15.default.basename(filePath), { root: import_node_path15.default.dirname(filePath) });
|
|
115451
115764
|
}
|
|
115452
115765
|
function wsUrlFromHttp(httpUrl2) {
|
|
115453
115766
|
const u = new URL(httpUrl2);
|
|
@@ -115777,7 +116090,7 @@ data: ${JSON.stringify(data)}
|
|
|
115777
116090
|
const MAX_PREVIEW_BYTES = 25 * 1024 * 1024;
|
|
115778
116091
|
const allowedRoots = (() => {
|
|
115779
116092
|
const roots = /* @__PURE__ */ new Set();
|
|
115780
|
-
for (const r of [
|
|
116093
|
+
for (const r of [import_node_os9.default.tmpdir(), process.cwd(), "/tmp"]) {
|
|
115781
116094
|
try {
|
|
115782
116095
|
roots.add(import_node_fs11.default.realpathSync(r));
|
|
115783
116096
|
} catch {
|
|
@@ -115807,9 +116120,9 @@ data: ${JSON.stringify(data)}
|
|
|
115807
116120
|
return;
|
|
115808
116121
|
}
|
|
115809
116122
|
const contained = allowedRoots.some(
|
|
115810
|
-
(root) => real === root || real.startsWith(root +
|
|
116123
|
+
(root) => real === root || real.startsWith(root + import_node_path15.default.sep)
|
|
115811
116124
|
);
|
|
115812
|
-
const mime = IMG_MIME[
|
|
116125
|
+
const mime = IMG_MIME[import_node_path15.default.extname(real).toLowerCase()];
|
|
115813
116126
|
if (!contained || !mime || size > MAX_PREVIEW_BYTES) {
|
|
115814
116127
|
res.status(404).end();
|
|
115815
116128
|
return;
|
|
@@ -115926,7 +116239,8 @@ function streamDirectoryAsArchive(id, entry, req, res) {
|
|
|
115926
116239
|
res.setHeader("Vary", "Accept");
|
|
115927
116240
|
res.setHeader("Content-Disposition", `attachment; filename="${entry.filename}.${ext}"`);
|
|
115928
116241
|
const child = (0, import_node_child_process26.spawn)("tar", createTarArgs(entry.path), {
|
|
115929
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
116242
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
116243
|
+
windowsHide: true
|
|
115930
116244
|
});
|
|
115931
116245
|
child.on("error", (err) => {
|
|
115932
116246
|
if (!res.headersSent) {
|
|
@@ -115955,8 +116269,8 @@ function streamDirectoryAsArchive(id, entry, req, res) {
|
|
|
115955
116269
|
|
|
115956
116270
|
// ../tool-server/src/file-inputs.ts
|
|
115957
116271
|
var import_promises13 = require("node:fs/promises");
|
|
115958
|
-
var
|
|
115959
|
-
var
|
|
116272
|
+
var import_node_os10 = require("node:os");
|
|
116273
|
+
var import_node_path16 = require("node:path");
|
|
115960
116274
|
var import_bytes = __toESM(require_bytes());
|
|
115961
116275
|
init_src2();
|
|
115962
116276
|
var MAX_UPLOAD_BYTES = 32 * 1024 * 1024;
|
|
@@ -116012,8 +116326,8 @@ function decodeContent(wire) {
|
|
|
116012
116326
|
}
|
|
116013
116327
|
async function materializeUpload(wire) {
|
|
116014
116328
|
const data = decodeContent(wire);
|
|
116015
|
-
const dir = await (0, import_promises13.mkdtemp)((0,
|
|
116016
|
-
const filePath = (0,
|
|
116329
|
+
const dir = await (0, import_promises13.mkdtemp)((0, import_node_path16.join)((0, import_node_os10.tmpdir)(), "argent-file-input-"));
|
|
116330
|
+
const filePath = (0, import_node_path16.join)(dir, sanitizeFilename((0, import_node_path16.basename)(wire.path)));
|
|
116017
116331
|
await (0, import_promises13.writeFile)(filePath, data);
|
|
116018
116332
|
return { filePath, dir };
|
|
116019
116333
|
}
|
|
@@ -116036,10 +116350,10 @@ async function extractTarUpload(wire, uploadId, meta3, tempDirs, lookupUpload) {
|
|
|
116036
116350
|
);
|
|
116037
116351
|
}
|
|
116038
116352
|
const extractDir = await (0, import_promises13.mkdtemp)(
|
|
116039
|
-
(0,
|
|
116353
|
+
(0, import_node_path16.join)((0, import_node_os10.tmpdir)(), `argent-tar-upload-${entry.sha256.slice(0, 16)}-`)
|
|
116040
116354
|
);
|
|
116041
116355
|
tempDirs.push(extractDir);
|
|
116042
|
-
const uploaded = await safeExtractArchive(entry.tarPath, extractDir, (0,
|
|
116356
|
+
const uploaded = await safeExtractArchive(entry.tarPath, extractDir, (0, import_node_path16.basename)(wire.path));
|
|
116043
116357
|
return { value: uploaded, meta: { ...meta3, viaUpload: true } };
|
|
116044
116358
|
} catch (err) {
|
|
116045
116359
|
if (err instanceof FileInputError) throw err;
|
|
@@ -116139,7 +116453,7 @@ async function resolveMembers(members2, tempDirs, lookupUpload) {
|
|
|
116139
116453
|
return out;
|
|
116140
116454
|
}
|
|
116141
116455
|
function unexpandedPathError(wire) {
|
|
116142
|
-
if ((0,
|
|
116456
|
+
if ((0, import_node_path16.isAbsolute)(wire.path) || import_node_path16.win32.isAbsolute(wire.path)) return void 0;
|
|
116143
116457
|
return new FileInputError(
|
|
116144
116458
|
`Path "${wire.path}" is not an absolute path. ` + (isUnexpandedPath(wire.path) ? `Nothing expands "~", variables, commands or URLs in a file argument, ` : `The tool-server resolves a relative path against its own working directory, `) + `so pass the file's absolute path.`
|
|
116145
116459
|
);
|
|
@@ -117848,7 +118162,7 @@ init_src2();
|
|
|
117848
118162
|
// ../tool-server/src/utils/ios-device/provisioning-profiles.ts
|
|
117849
118163
|
var import_node_child_process28 = require("node:child_process");
|
|
117850
118164
|
var import_node_fs13 = require("node:fs");
|
|
117851
|
-
var
|
|
118165
|
+
var import_node_os11 = require("node:os");
|
|
117852
118166
|
var path35 = __toESM(require("node:path"));
|
|
117853
118167
|
var import_node_util20 = require("node:util");
|
|
117854
118168
|
var execFileAsync19 = (0, import_node_util20.promisify)(import_node_child_process28.execFile);
|
|
@@ -117875,7 +118189,7 @@ function parseProvisioningProfile(xml) {
|
|
|
117875
118189
|
async function readInstalledProfiles() {
|
|
117876
118190
|
const files = (await Promise.all(
|
|
117877
118191
|
PROFILE_DIRECTORIES.map(async (directory) => {
|
|
117878
|
-
const absolute = path35.join((0,
|
|
118192
|
+
const absolute = path35.join((0, import_node_os11.homedir)(), directory);
|
|
117879
118193
|
const names = await import_node_fs13.promises.readdir(absolute).catch(() => []);
|
|
117880
118194
|
return names.filter((name) => name.endsWith(".mobileprovision")).map((name) => path35.join(absolute, name));
|
|
117881
118195
|
})
|
|
@@ -124179,8 +124493,8 @@ async function describeVega(_serial) {
|
|
|
124179
124493
|
}
|
|
124180
124494
|
|
|
124181
124495
|
// ../tool-server/src/tools/describe/platforms/harmony/index.ts
|
|
124182
|
-
var
|
|
124183
|
-
var
|
|
124496
|
+
var import_node_os12 = require("node:os");
|
|
124497
|
+
var import_node_path17 = require("node:path");
|
|
124184
124498
|
var import_promises15 = require("node:fs/promises");
|
|
124185
124499
|
|
|
124186
124500
|
// ../tool-server/src/utils/harmony-uitest.ts
|
|
@@ -124703,7 +125017,7 @@ function pollHarmonyTree(connectKey, budgetMs) {
|
|
|
124703
125017
|
return describeHarmony(connectKey, budgetMs);
|
|
124704
125018
|
}
|
|
124705
125019
|
async function describeHarmony(connectKey, timeoutMs = HARMONY_INTERACTION_TIMEOUT_MS) {
|
|
124706
|
-
const localPath = (0,
|
|
125020
|
+
const localPath = (0, import_node_path17.join)((0, import_node_os12.tmpdir)(), `argent-harmony-dump-${process.hrtime.bigint()}.json`);
|
|
124707
125021
|
const deadline = Date.now() + timeoutMs;
|
|
124708
125022
|
const display = await harmonyDisplay(
|
|
124709
125023
|
connectKey,
|
|
@@ -128506,13 +128820,13 @@ function checkTokenExemptAccess(req, policy) {
|
|
|
128506
128820
|
}
|
|
128507
128821
|
function interfaceAddresses() {
|
|
128508
128822
|
const out = [];
|
|
128509
|
-
for (const list of Object.values((0,
|
|
128823
|
+
for (const list of Object.values((0, import_node_os13.networkInterfaces)())) {
|
|
128510
128824
|
for (const a of list ?? []) out.push(a.address.split("%")[0]);
|
|
128511
128825
|
}
|
|
128512
128826
|
return out;
|
|
128513
128827
|
}
|
|
128514
128828
|
function machineHostnames() {
|
|
128515
|
-
const name = (0,
|
|
128829
|
+
const name = (0, import_node_os13.hostname)().toLowerCase();
|
|
128516
128830
|
if (!name) return [];
|
|
128517
128831
|
const bare = name.endsWith(".local") ? name.slice(0, -".local".length) : name;
|
|
128518
128832
|
return [bare, `${bare}.local`];
|
|
@@ -128669,7 +128983,7 @@ function createHttpApp(registry2, options) {
|
|
|
128669
128983
|
return;
|
|
128670
128984
|
}
|
|
128671
128985
|
const id = (0, import_node_crypto17.randomUUID)();
|
|
128672
|
-
const tarPath = (0,
|
|
128986
|
+
const tarPath = (0, import_node_path18.join)((0, import_node_os13.tmpdir)(), `argent-upload-${id}.tar.gz`);
|
|
128673
128987
|
const ws = (0, import_node_fs14.createWriteStream)(tarPath);
|
|
128674
128988
|
let received2 = 0;
|
|
128675
128989
|
let released = false;
|
|
@@ -128804,6 +129118,13 @@ function createHttpApp(registry2, options) {
|
|
|
128804
129118
|
res.status(404).json({ error: `Tool "${name}" not found` });
|
|
128805
129119
|
return;
|
|
128806
129120
|
}
|
|
129121
|
+
const session = parseSession(firstHeader(req.headers[SESSION_HEADER]));
|
|
129122
|
+
if (session === null) {
|
|
129123
|
+
res.status(400).json({
|
|
129124
|
+
error: `The ${SESSION_HEADER} header (ARGENT_SESSION for the CLI and the SDK) must be 1 to 128 printable ASCII characters without spaces.`
|
|
129125
|
+
});
|
|
129126
|
+
return;
|
|
129127
|
+
}
|
|
128807
129128
|
let clientSecrets;
|
|
128808
129129
|
const clientSecretsHeader = firstHeader(req.headers[CLIENT_SECRETS_HEADER]);
|
|
128809
129130
|
if (clientSecretsHeader !== void 0) {
|
|
@@ -128978,6 +129299,37 @@ function createHttpApp(registry2, options) {
|
|
|
128978
129299
|
}
|
|
128979
129300
|
}
|
|
128980
129301
|
if (callerGone) return;
|
|
129302
|
+
let endClaim;
|
|
129303
|
+
if (session && def.id !== RELEASE_DEVICE_TOOL_ID) {
|
|
129304
|
+
const claim2 = await deviceClaims.claim(
|
|
129305
|
+
session,
|
|
129306
|
+
claimTargets(parsedData),
|
|
129307
|
+
def.id,
|
|
129308
|
+
parsedData
|
|
129309
|
+
);
|
|
129310
|
+
if (!claim2.ok) {
|
|
129311
|
+
emitHttpFailure(
|
|
129312
|
+
{
|
|
129313
|
+
error_code: FAILURE_CODES.DEVICE_IN_USE,
|
|
129314
|
+
failure_stage: "http_device_claim",
|
|
129315
|
+
failure_area: "http",
|
|
129316
|
+
error_kind: "validation"
|
|
129317
|
+
},
|
|
129318
|
+
parsedData
|
|
129319
|
+
);
|
|
129320
|
+
res.status(409).json({
|
|
129321
|
+
error: deviceInUseMessage(claim2.device),
|
|
129322
|
+
error_code: FAILURE_CODES.DEVICE_IN_USE,
|
|
129323
|
+
error_kind: "validation"
|
|
129324
|
+
});
|
|
129325
|
+
return;
|
|
129326
|
+
}
|
|
129327
|
+
endClaim = claim2.done;
|
|
129328
|
+
if (callerGone) {
|
|
129329
|
+
endClaim(false, void 0);
|
|
129330
|
+
return;
|
|
129331
|
+
}
|
|
129332
|
+
}
|
|
128981
129333
|
const controller = new AbortController();
|
|
128982
129334
|
res.on("close", () => {
|
|
128983
129335
|
if (!res.writableFinished) controller.abort();
|
|
@@ -129012,6 +129364,8 @@ function createHttpApp(registry2, options) {
|
|
|
129012
129364
|
}
|
|
129013
129365
|
toolCallsInFlight++;
|
|
129014
129366
|
const endCloudCall = startCloudCall(toolId, cloudTargets, parsedData);
|
|
129367
|
+
let succeeded = false;
|
|
129368
|
+
let result;
|
|
129015
129369
|
try {
|
|
129016
129370
|
const data = await registry2.invokeTool(name, parsedData, {
|
|
129017
129371
|
signal: controller.signal,
|
|
@@ -129024,10 +129378,13 @@ function createHttpApp(registry2, options) {
|
|
|
129024
129378
|
// `.argent/flows/`, so the recorder keeps its recordings there.
|
|
129025
129379
|
...firstHeader(req.headers[E2E_DIR_CLIENT_HEADER]) === "1" ? {} : { legacyE2eDir: true },
|
|
129026
129380
|
...clientSecrets ? { clientSecrets } : {},
|
|
129381
|
+
...session ? { session } : {},
|
|
129027
129382
|
toolInvocationId,
|
|
129028
129383
|
...recordChildInvocation ? { recordChildInvocation } : {},
|
|
129029
129384
|
...wantsStream ? { emitProgress: (event2) => writeLine({ event: "progress", data: event2 }) } : {}
|
|
129030
129385
|
});
|
|
129386
|
+
succeeded = true;
|
|
129387
|
+
result = data;
|
|
129031
129388
|
const { updateInstallable, currentVersion, installableVersion } = getUpdateState();
|
|
129032
129389
|
const shouldNotify = updateInstallable && !isUpdatingAutomatically(installableVersion) && !isUpdateNoteSuppressed();
|
|
129033
129390
|
if (shouldNotify) {
|
|
@@ -129096,6 +129453,11 @@ function createHttpApp(registry2, options) {
|
|
|
129096
129453
|
res.status(400).json({ error: attribute(unsupportedErr.message), ...errorSignalFields(err) });
|
|
129097
129454
|
return;
|
|
129098
129455
|
}
|
|
129456
|
+
const deviceInUseErr = findErrorInCauseChain(err, DeviceInUseError);
|
|
129457
|
+
if (deviceInUseErr) {
|
|
129458
|
+
res.status(409).json({ error: attribute(deviceInUseErr.message), ...errorSignalFields(err) });
|
|
129459
|
+
return;
|
|
129460
|
+
}
|
|
129099
129461
|
const invalidInputErr = findErrorInCauseChain(err, InvalidToolInputError);
|
|
129100
129462
|
if (invalidInputErr) {
|
|
129101
129463
|
res.status(400).json({ error: attribute(invalidInputErr.message), ...errorSignalFields(err) });
|
|
@@ -129124,6 +129486,7 @@ function createHttpApp(registry2, options) {
|
|
|
129124
129486
|
idleTimer.touch();
|
|
129125
129487
|
if (keepAlive) clearInterval(keepAlive);
|
|
129126
129488
|
releaseInvocationMeta?.();
|
|
129489
|
+
endClaim?.(succeeded, result);
|
|
129127
129490
|
}
|
|
129128
129491
|
}
|
|
129129
129492
|
);
|
|
@@ -129172,12 +129535,12 @@ function createHttpApp(registry2, options) {
|
|
|
129172
129535
|
// ../tool-server/src/event-log.ts
|
|
129173
129536
|
var import_bunyan = __toESM(require_bunyan());
|
|
129174
129537
|
var import_node_fs15 = require("node:fs");
|
|
129175
|
-
var
|
|
129538
|
+
var import_node_path19 = require("node:path");
|
|
129176
129539
|
init_src2();
|
|
129177
129540
|
function createToolServerEventLog({
|
|
129178
129541
|
filePath
|
|
129179
129542
|
}) {
|
|
129180
|
-
(0, import_node_fs15.mkdirSync)((0,
|
|
129543
|
+
(0, import_node_fs15.mkdirSync)((0, import_node_path19.dirname)(filePath), { recursive: true });
|
|
129181
129544
|
(0, import_node_fs15.writeFileSync)(filePath, "");
|
|
129182
129545
|
const fileStream = (0, import_node_fs15.createWriteStream)(filePath, { flags: "a" });
|
|
129183
129546
|
let disposed = false;
|
|
@@ -133893,7 +134256,7 @@ init_src2();
|
|
|
133893
134256
|
|
|
133894
134257
|
// ../tool-server/src/utils/debugger/scripts/network-interceptor.ts
|
|
133895
134258
|
var import_node_crypto21 = require("node:crypto");
|
|
133896
|
-
var
|
|
134259
|
+
var import_node_os14 = require("node:os");
|
|
133897
134260
|
init_src3();
|
|
133898
134261
|
var BINARY_BODY_TYPES = /^(image\/(?!svg)|audio\/|video\/|font\/|application\/(octet-stream|pdf|zip|gzip|wasm|x-protobuf)$)/;
|
|
133899
134262
|
var NETWORK_INTERCEPTOR_SCRIPT = `(function() {
|
|
@@ -134974,7 +135337,7 @@ var NETWORK_CAPTURE_MARK_SCRIPT = `(function() {
|
|
|
134974
135337
|
})()`;
|
|
134975
135338
|
var HOLDER = JSON.stringify((0, import_node_crypto21.randomUUID)());
|
|
134976
135339
|
function holderRecord(capturing2) {
|
|
134977
|
-
return JSON.stringify({ capturing: capturing2, pid: process.pid, host: (0,
|
|
135340
|
+
return JSON.stringify({ capturing: capturing2, pid: process.pid, host: (0, import_node_os14.hostname)() });
|
|
134978
135341
|
}
|
|
134979
135342
|
function makeNetworkCaptureControlScript(paused) {
|
|
134980
135343
|
return `(function() {
|
|
@@ -135021,7 +135384,7 @@ function exitedHolders(answer) {
|
|
|
135021
135384
|
}
|
|
135022
135385
|
return Object.keys(holders).filter((key2) => {
|
|
135023
135386
|
const { pid, host } = holders[key2];
|
|
135024
|
-
return host === (0,
|
|
135387
|
+
return host === (0, import_node_os14.hostname)() && typeof pid === "number" && !isProcessAlive(pid);
|
|
135025
135388
|
});
|
|
135026
135389
|
}
|
|
135027
135390
|
function makeNetworkLogReadScript(start2, limit, metroPort2) {
|
|
@@ -136232,13 +136595,40 @@ function clearLostProfilerRun(port, deviceId) {
|
|
|
136232
136595
|
for (const key2 of findLostRun(port, deviceId)?.keys ?? []) lostRuns.delete(key2);
|
|
136233
136596
|
}
|
|
136234
136597
|
|
|
136598
|
+
// ../tool-server/src/tools/devices/release-device.ts
|
|
136599
|
+
init_zod();
|
|
136600
|
+
init_capability();
|
|
136601
|
+
var zodSchema11 = external_exports.object({
|
|
136602
|
+
udid: external_exports.string().optional().describe("The device to release. Omit it to release every device of the session.")
|
|
136603
|
+
}).strict();
|
|
136604
|
+
var releaseDeviceTool = {
|
|
136605
|
+
id: RELEASE_DEVICE_TOOL_ID,
|
|
136606
|
+
description: "Release a device you are done with, so that another Argent session can use it.",
|
|
136607
|
+
zodSchema: zodSchema11,
|
|
136608
|
+
interaction: {
|
|
136609
|
+
startedMsg: () => "Releasing devices",
|
|
136610
|
+
completedMsg: ({ result }) => `Released ${result.released.length} ${result.released.length === 1 ? "device" : "devices"}`,
|
|
136611
|
+
failedMsg: ({ failureSignal: failureSignal2 }) => `Failed to release devices: ${failureSignal2.error_code}`
|
|
136612
|
+
},
|
|
136613
|
+
services: () => ({}),
|
|
136614
|
+
async execute(_services, params, ctx) {
|
|
136615
|
+
if (!ctx?.session) {
|
|
136616
|
+
throw new InvalidToolInputError(
|
|
136617
|
+
"release-device needs a session. Set ARGENT_SESSION to the value the session used."
|
|
136618
|
+
);
|
|
136619
|
+
}
|
|
136620
|
+
const device = params.udid === void 0 ? void 0 : claimKey(params.udid);
|
|
136621
|
+
return { released: deviceClaims.release(ctx.session, device) };
|
|
136622
|
+
}
|
|
136623
|
+
};
|
|
136624
|
+
|
|
136235
136625
|
// ../tool-server/src/tools/devices/boot-device.ts
|
|
136236
136626
|
var import_node_child_process38 = require("node:child_process");
|
|
136237
136627
|
var import_node_fs20 = require("node:fs");
|
|
136238
136628
|
var import_promises18 = require("node:fs/promises");
|
|
136239
136629
|
var import_node_net4 = require("node:net");
|
|
136240
|
-
var
|
|
136241
|
-
var
|
|
136630
|
+
var import_node_os16 = require("node:os");
|
|
136631
|
+
var import_node_path23 = require("node:path");
|
|
136242
136632
|
var import_node_util28 = require("node:util");
|
|
136243
136633
|
init_zod();
|
|
136244
136634
|
init_src();
|
|
@@ -136247,11 +136637,11 @@ init_adb();
|
|
|
136247
136637
|
|
|
136248
136638
|
// ../tool-server/src/utils/android-read-only-boots.ts
|
|
136249
136639
|
var import_node_fs17 = __toESM(require("node:fs"));
|
|
136250
|
-
var
|
|
136640
|
+
var import_node_path20 = __toESM(require("node:path"));
|
|
136251
136641
|
init_src();
|
|
136252
136642
|
var ownRecords = /* @__PURE__ */ new Map();
|
|
136253
136643
|
function recordsFilePath() {
|
|
136254
|
-
return process.env.ARGENT_ANDROID_READ_ONLY_BOOTS_FILE ??
|
|
136644
|
+
return process.env.ARGENT_ANDROID_READ_ONLY_BOOTS_FILE ?? import_node_path20.default.join(argentHomeDir(), "android-read-only-boots.json");
|
|
136255
136645
|
}
|
|
136256
136646
|
function isRecord5(value) {
|
|
136257
136647
|
const v = value;
|
|
@@ -136273,7 +136663,7 @@ function persist(mutate) {
|
|
|
136273
136663
|
const file2 = recordsFilePath();
|
|
136274
136664
|
const records = loadPersisted();
|
|
136275
136665
|
mutate(records);
|
|
136276
|
-
import_node_fs17.default.mkdirSync(
|
|
136666
|
+
import_node_fs17.default.mkdirSync(import_node_path20.default.dirname(file2), { recursive: true });
|
|
136277
136667
|
import_node_fs17.default.writeFileSync(file2, JSON.stringify(Object.fromEntries(records)));
|
|
136278
136668
|
} catch {
|
|
136279
136669
|
}
|
|
@@ -136474,8 +136864,8 @@ async function readParentPids() {
|
|
|
136474
136864
|
|
|
136475
136865
|
// ../tool-server/src/utils/linux-preflight.ts
|
|
136476
136866
|
var fs51 = __toESM(require("node:fs"));
|
|
136477
|
-
var
|
|
136478
|
-
var
|
|
136867
|
+
var import_node_os15 = require("node:os");
|
|
136868
|
+
var import_node_path21 = require("node:path");
|
|
136479
136869
|
var import_ini2 = __toESM(require_ini());
|
|
136480
136870
|
function linuxBootDiagnostics(avdName) {
|
|
136481
136871
|
if (process.platform !== "linux") return null;
|
|
@@ -136503,7 +136893,7 @@ function checkKvm() {
|
|
|
136503
136893
|
var MIN_RAM_MB = 4096;
|
|
136504
136894
|
var MIN_HEAP_MB = 512;
|
|
136505
136895
|
function checkAvdSizing(avdName) {
|
|
136506
|
-
const configPath = (0,
|
|
136896
|
+
const configPath = (0, import_node_path21.join)((0, import_node_os15.homedir)(), ".android", "avd", `${avdName}.avd`, "config.ini");
|
|
136507
136897
|
let content;
|
|
136508
136898
|
try {
|
|
136509
136899
|
content = fs51.readFileSync(configPath, "utf8");
|
|
@@ -136539,7 +136929,7 @@ function readMb(config2, key2) {
|
|
|
136539
136929
|
// ../tool-server/src/utils/simulator-app-launch.ts
|
|
136540
136930
|
var import_node_child_process36 = require("node:child_process");
|
|
136541
136931
|
var import_node_fs19 = __toESM(require("node:fs"));
|
|
136542
|
-
var
|
|
136932
|
+
var import_node_path22 = __toESM(require("node:path"));
|
|
136543
136933
|
var import_node_util27 = require("node:util");
|
|
136544
136934
|
init_src();
|
|
136545
136935
|
var execFileAsync26 = (0, import_node_util27.promisify)(import_node_child_process36.execFile);
|
|
@@ -136548,7 +136938,7 @@ var LAUNCH_WATCH_MS = 1e4;
|
|
|
136548
136938
|
var LAUNCH_POLL_MS = 250;
|
|
136549
136939
|
var launchLocks = /* @__PURE__ */ new Map();
|
|
136550
136940
|
function verdictFilePath() {
|
|
136551
|
-
return
|
|
136941
|
+
return import_node_path22.default.join(argentHomeDir(), "simulator-app-launch.json");
|
|
136552
136942
|
}
|
|
136553
136943
|
function loadVerdicts() {
|
|
136554
136944
|
try {
|
|
@@ -136560,7 +136950,7 @@ function loadVerdicts() {
|
|
|
136560
136950
|
}
|
|
136561
136951
|
function persistVerdict(key2, verdict) {
|
|
136562
136952
|
const filePath = verdictFilePath();
|
|
136563
|
-
import_node_fs19.default.mkdirSync(
|
|
136953
|
+
import_node_fs19.default.mkdirSync(import_node_path22.default.dirname(filePath), { recursive: true });
|
|
136564
136954
|
writeFileAtomicSync(filePath, JSON.stringify({ ...loadVerdicts(), [key2]: verdict }, null, 2));
|
|
136565
136955
|
}
|
|
136566
136956
|
async function bundleVersion(infoPlist) {
|
|
@@ -136573,7 +136963,7 @@ async function bundleVersion(infoPlist) {
|
|
|
136573
136963
|
}
|
|
136574
136964
|
async function launchKey(simulatorApp) {
|
|
136575
136965
|
const [appBuild, coreSimulatorBuild] = await Promise.all([
|
|
136576
|
-
bundleVersion(
|
|
136966
|
+
bundleVersion(import_node_path22.default.join(simulatorApp, "Contents", "Info.plist")),
|
|
136577
136967
|
bundleVersion(CORE_SIMULATOR_INFO_PLIST)
|
|
136578
136968
|
]);
|
|
136579
136969
|
return `${simulatorApp} ${appBuild} / CoreSimulator ${coreSimulatorBuild}`;
|
|
@@ -136604,7 +136994,7 @@ function launchSimulatorApp(simulatorApp, launch) {
|
|
|
136604
136994
|
}
|
|
136605
136995
|
const verdict = loadVerdicts()[key2];
|
|
136606
136996
|
if (verdict === "crashes") return false;
|
|
136607
|
-
const executable =
|
|
136997
|
+
const executable = import_node_path22.default.join(simulatorApp, "Contents", "MacOS", "Simulator");
|
|
136608
136998
|
const watch = verdict !== "runs" && !await runningExecutables().then((running) => running.some(isSimulatorApp)).catch(() => true);
|
|
136609
136999
|
await launch();
|
|
136610
137000
|
if (!watch) return true;
|
|
@@ -137005,6 +137395,27 @@ async function bootMacosApp(registry2, opts) {
|
|
|
137005
137395
|
|
|
137006
137396
|
// ../tool-server/src/tools/devices/boot-device.ts
|
|
137007
137397
|
var execFileAsync27 = (0, import_node_util28.promisify)(import_node_child_process38.execFile);
|
|
137398
|
+
function bootedDeviceId(result) {
|
|
137399
|
+
if ("serial" in result) return result.serial;
|
|
137400
|
+
if ("udid" in result) return result.udid;
|
|
137401
|
+
if ("id" in result) return result.id;
|
|
137402
|
+
return void 0;
|
|
137403
|
+
}
|
|
137404
|
+
async function claimBooted(session, result) {
|
|
137405
|
+
const id = bootedDeviceId(result);
|
|
137406
|
+
if (id) (await claimPickedDevice(session, id))();
|
|
137407
|
+
return result;
|
|
137408
|
+
}
|
|
137409
|
+
function runningEmulatorHold(session) {
|
|
137410
|
+
let end = () => {
|
|
137411
|
+
};
|
|
137412
|
+
return {
|
|
137413
|
+
hold: async (serial) => {
|
|
137414
|
+
end = await claimPickedDevice(session, serial);
|
|
137415
|
+
},
|
|
137416
|
+
end: () => end()
|
|
137417
|
+
};
|
|
137418
|
+
}
|
|
137008
137419
|
function bootTarget(params) {
|
|
137009
137420
|
return params.udid ?? params.avdName ?? params.vvdImage ?? params.harmonyInstance ?? params.electronAppPath ?? params.macosAppPath ?? "device";
|
|
137010
137421
|
}
|
|
@@ -137373,7 +137784,7 @@ async function openSimulatorWindow(udid) {
|
|
|
137373
137784
|
const timeout = 5e3;
|
|
137374
137785
|
const { stdout } = await execFileAsync27("xcode-select", ["-p"], { timeout });
|
|
137375
137786
|
const developerDir2 = (0, import_node_fs20.realpathSync)(stdout.trim());
|
|
137376
|
-
const simulatorApp = (0,
|
|
137787
|
+
const simulatorApp = (0, import_node_path23.join)(developerDir2, "Applications", "Simulator.app");
|
|
137377
137788
|
if ((0, import_node_fs20.existsSync)(simulatorApp)) {
|
|
137378
137789
|
const launched = await launchSimulatorApp(
|
|
137379
137790
|
simulatorApp,
|
|
@@ -137381,7 +137792,7 @@ async function openSimulatorWindow(udid) {
|
|
|
137381
137792
|
);
|
|
137382
137793
|
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 ${verdictFilePath()} to try opening it again.`;
|
|
137383
137794
|
}
|
|
137384
|
-
const deviceHubApp = (0,
|
|
137795
|
+
const deviceHubApp = (0, import_node_path23.join)(developerDir2, "..", "Applications", "DeviceHub.app");
|
|
137385
137796
|
if ((0, import_node_fs20.existsSync)(deviceHubApp)) {
|
|
137386
137797
|
const url2 = `devices://device/open?id=${encodeURIComponent(udid)}`;
|
|
137387
137798
|
await execFileAsync27("open", ["-a", deviceHubApp, url2], { timeout });
|
|
@@ -137474,7 +137885,7 @@ async function attemptBoot(params) {
|
|
|
137474
137885
|
const portArg = params.emulatorArgs.indexOf("-port");
|
|
137475
137886
|
const instance = portArg >= 0 ? `${params.avdName}-${params.emulatorArgs[portArg + 1]}` : params.avdName;
|
|
137476
137887
|
const safeName = instance.replace(/[^\w.-]/g, "_");
|
|
137477
|
-
const logPath = (0,
|
|
137888
|
+
const logPath = (0, import_node_path23.join)((0, import_node_os16.tmpdir)(), `argent-emulator-${safeName}.log`);
|
|
137478
137889
|
emulatorLogFd = (0, import_node_fs20.openSync)(logPath, "w");
|
|
137479
137890
|
stdio = ["ignore", emulatorLogFd, emulatorLogFd];
|
|
137480
137891
|
}
|
|
@@ -137650,8 +138061,12 @@ async function attemptBoot(params) {
|
|
|
137650
138061
|
}
|
|
137651
138062
|
var GRPC_PORT_OFFSET = 3e3;
|
|
137652
138063
|
var inFlightBoots = /* @__PURE__ */ new Map();
|
|
138064
|
+
async function withoutOthersClaims(devices2, session) {
|
|
138065
|
+
const held2 = await Promise.all(devices2.map((d) => heldByAnotherSession(session, d.serial)));
|
|
138066
|
+
return devices2.filter((_, i) => !held2[i]);
|
|
138067
|
+
}
|
|
137653
138068
|
function inFlightBootKey(params) {
|
|
137654
|
-
return `${params.avdName}\0${params.readOnly ? "ro" : "rw"}\0${params.port ?? ""}`;
|
|
138069
|
+
return `${params.avdName}\0${params.readOnly ? "ro" : "rw"}\0${params.port ?? ""}\0${params.session ?? ""}`;
|
|
137655
138070
|
}
|
|
137656
138071
|
async function avdInstances(avdName, listed) {
|
|
137657
138072
|
const processes = await readEmulatorProcessesForAvd(avdName);
|
|
@@ -137849,9 +138264,10 @@ async function bootAndroidImpl(params, overallDeadline) {
|
|
|
137849
138264
|
params.avdName,
|
|
137850
138265
|
listed ? new Set(existingDevices.map((d) => d.serial)) : void 0
|
|
137851
138266
|
);
|
|
137852
|
-
const
|
|
138267
|
+
const matching = existingDevices.filter(
|
|
137853
138268
|
(d) => isRunningAvd(d, params.avdName) && (portSerial !== null ? d.serial === portSerial : !instances.pinned.has(d.serial) || !params.readOnly && !instances.readOnly.has(d.serial))
|
|
137854
138269
|
);
|
|
138270
|
+
const candidates = params.readOnly && portSerial === null ? await withoutOthersClaims(matching, params.session) : matching;
|
|
137855
138271
|
const blocks = (p) => !params.readOnly || !p.readOnly;
|
|
137856
138272
|
let alreadyRunning = params.readOnly ? candidates.find((d) => instances.readOnly.has(d.serial)) : candidates.find((d) => !instances.readOnly.has(d.serial)) ?? candidates[0];
|
|
137857
138273
|
let preserveOnProbeFailure = false;
|
|
@@ -137871,6 +138287,7 @@ async function bootAndroidImpl(params, overallDeadline) {
|
|
|
137871
138287
|
}
|
|
137872
138288
|
let killedRunning = false;
|
|
137873
138289
|
if (alreadyRunning) {
|
|
138290
|
+
await params.holdRunning?.(alreadyRunning.serial);
|
|
137874
138291
|
if (params.force) {
|
|
137875
138292
|
const others = await blockersBesides(params.avdName, alreadyRunning.serial, blocks);
|
|
137876
138293
|
if (others.length > 0) throw readOnlyConflictError(params, others);
|
|
@@ -138222,11 +138639,11 @@ async function startHarmonyEmulator(instanceName) {
|
|
|
138222
138639
|
});
|
|
138223
138640
|
}
|
|
138224
138641
|
try {
|
|
138225
|
-
for (const entry of (0, import_node_fs20.readdirSync)((0,
|
|
138642
|
+
for (const entry of (0, import_node_fs20.readdirSync)((0, import_node_os16.tmpdir)())) {
|
|
138226
138643
|
if (!entry.startsWith("argent-harmony-") || !entry.endsWith(".log")) continue;
|
|
138227
138644
|
try {
|
|
138228
|
-
if (Date.now() - (0, import_node_fs20.statSync)((0,
|
|
138229
|
-
(0, import_node_fs20.rmSync)((0,
|
|
138645
|
+
if (Date.now() - (0, import_node_fs20.statSync)((0, import_node_path23.join)((0, import_node_os16.tmpdir)(), entry)).mtimeMs > HARMONY_LOG_TTL_MS) {
|
|
138646
|
+
(0, import_node_fs20.rmSync)((0, import_node_path23.join)((0, import_node_os16.tmpdir)(), entry), { force: true });
|
|
138230
138647
|
}
|
|
138231
138648
|
} catch {
|
|
138232
138649
|
}
|
|
@@ -138234,7 +138651,7 @@ async function startHarmonyEmulator(instanceName) {
|
|
|
138234
138651
|
} catch {
|
|
138235
138652
|
}
|
|
138236
138653
|
const safeName = instanceName.replace(/[^\w.-]/g, (c) => `%${c.codePointAt(0).toString(16)}`);
|
|
138237
|
-
const logPath = (0,
|
|
138654
|
+
const logPath = (0, import_node_path23.join)((0, import_node_os16.tmpdir)(), `argent-harmony-${safeName}-${process.hrtime.bigint()}.log`);
|
|
138238
138655
|
let logFd;
|
|
138239
138656
|
try {
|
|
138240
138657
|
logFd = (0, import_node_fs20.openSync)(logPath, "w");
|
|
@@ -138341,7 +138758,7 @@ async function waitForHarmonyTarget(before, deadline, checkAlive, expected) {
|
|
|
138341
138758
|
}
|
|
138342
138759
|
}
|
|
138343
138760
|
async function waitForHarmonyDrivable(connectKey, deadline, checkAlive) {
|
|
138344
|
-
const probePath = (0,
|
|
138761
|
+
const probePath = (0, import_node_path23.join)((0, import_node_os16.tmpdir)(), `argent-harmony-bootprobe-${process.hrtime.bigint()}.json`);
|
|
138345
138762
|
let inFlight5 = null;
|
|
138346
138763
|
try {
|
|
138347
138764
|
for (; ; ) {
|
|
@@ -138576,7 +138993,7 @@ var capability2 = {
|
|
|
138576
138993
|
harmony: { emulator: true },
|
|
138577
138994
|
macos: { app: true, catalyst: true }
|
|
138578
138995
|
};
|
|
138579
|
-
var
|
|
138996
|
+
var zodSchema12 = external_exports.object({
|
|
138580
138997
|
udid: external_exports.string().optional().describe(
|
|
138581
138998
|
"iOS simulator UDID from `list-devices`.<flag:macos-apps> Or Mac app id (`macos-app-<bundle id>`) to relaunch from its last path.</flag:macos-apps>"
|
|
138582
138999
|
),
|
|
@@ -138632,7 +139049,7 @@ function createBootDeviceTool(registry2) {
|
|
|
138632
139049
|
description: `Start a target device or app and wait until ready: iOS simulator, Android emulator, Vega VVD, <flag:harmonyos>HarmonyOS emulator, </flag:harmonyos><flag:macos-apps>Mac app, </flag:macos-apps>or Electron app.
|
|
138633
139050
|
Use when starting a stopped target; pass exactly one target key (\`udid\`, \`avdName\`, \`vvdImage\`, <flag:harmonyos>\`harmonyInstance\`, </flag:harmonyos><flag:macos-apps>\`macosAppPath\`, </flag:macos-apps>or \`electronAppPath\`).
|
|
138634
139051
|
Returns a platform-tagged payload with the target id (\`udid\` / \`serial\` / \`id\`), \`booted\`, and optional \`note\`.<flag:harmonyos> HarmonyOS starts the instance via DevEco Studio's Emulator manager and waits for its \`hdc\` connect key as \`udid\` (images are served only in mainland China; \`note\` explains any unproven key/readiness).</flag:harmonyos> Fails if the target is missing or cannot boot (failed Android/Electron spawns are cleaned up automatically).`,
|
|
138635
|
-
zodSchema:
|
|
139052
|
+
zodSchema: zodSchema12,
|
|
138636
139053
|
alwaysLoad: true,
|
|
138637
139054
|
searchHint: "boot start launch simulator emulator avd device session ios android vega vvd firetv <flag:harmonyos>harmony harmonyos deveco </flag:harmonyos>cold hot",
|
|
138638
139055
|
interaction: {
|
|
@@ -138670,12 +139087,15 @@ Returns a platform-tagged payload with the target id (\`udid\` / \`serial\` / \`
|
|
|
138670
139087
|
);
|
|
138671
139088
|
}
|
|
138672
139089
|
if (hasMacos || hasUdid && classifyDevice(params.udid) === "macos") {
|
|
138673
|
-
return
|
|
138674
|
-
|
|
138675
|
-
|
|
138676
|
-
|
|
138677
|
-
|
|
138678
|
-
|
|
139090
|
+
return claimBooted(
|
|
139091
|
+
ctx?.session,
|
|
139092
|
+
await bootMacosApp(registry2, {
|
|
139093
|
+
appPath: params.macosAppPath,
|
|
139094
|
+
deviceId: hasUdid ? params.udid : void 0,
|
|
139095
|
+
args: params.macosAppArgs,
|
|
139096
|
+
force: params.force
|
|
139097
|
+
})
|
|
139098
|
+
);
|
|
138679
139099
|
}
|
|
138680
139100
|
if (hasUdid && params.udid === CLOUD_ANDROID_DEVICE_ID) {
|
|
138681
139101
|
const cloud = await bootCloudAndroid(params, ctx?.signal);
|
|
@@ -138709,11 +139129,14 @@ Returns a platform-tagged payload with the target id (\`udid\` / \`serial\` / \`
|
|
|
138709
139129
|
return bootIosRemote(params.udid, registry2, params.force);
|
|
138710
139130
|
}
|
|
138711
139131
|
if (platform === "harmony") {
|
|
138712
|
-
return
|
|
138713
|
-
|
|
138714
|
-
|
|
138715
|
-
|
|
138716
|
-
|
|
139132
|
+
return claimBooted(
|
|
139133
|
+
ctx?.session,
|
|
139134
|
+
await bootHarmony({
|
|
139135
|
+
instanceName: harmonyInstanceName(params.udid),
|
|
139136
|
+
bootTimeoutMs: params.bootTimeoutMs ?? HARMONY_BOOT_TIMEOUT_MS,
|
|
139137
|
+
force: params.force
|
|
139138
|
+
})
|
|
139139
|
+
);
|
|
138717
139140
|
}
|
|
138718
139141
|
const hint = platform === "ios" || platform === "macos" ? void 0 : nonIosUdidHint(params.udid, platform);
|
|
138719
139142
|
if (hint) {
|
|
@@ -138737,38 +139160,57 @@ Returns a platform-tagged payload with the target id (\`udid\` / \`serial\` / \`
|
|
|
138737
139160
|
});
|
|
138738
139161
|
}
|
|
138739
139162
|
}
|
|
138740
|
-
|
|
138741
|
-
|
|
138742
|
-
|
|
138743
|
-
|
|
138744
|
-
|
|
138745
|
-
|
|
138746
|
-
|
|
138747
|
-
|
|
138748
|
-
|
|
138749
|
-
|
|
138750
|
-
|
|
138751
|
-
|
|
139163
|
+
const running = runningEmulatorHold(ctx?.session);
|
|
139164
|
+
try {
|
|
139165
|
+
return await claimBooted(
|
|
139166
|
+
ctx?.session,
|
|
139167
|
+
await bootAndroid({
|
|
139168
|
+
avdName: params.avdName,
|
|
139169
|
+
bootTimeoutMs: params.bootTimeoutMs ?? 48e4,
|
|
139170
|
+
force: params.force,
|
|
139171
|
+
// An explicit argument always wins; the `boot-sound` flag only moves
|
|
139172
|
+
// the default when the caller left `sound` unset. Read live per call
|
|
139173
|
+
// so `argent enable/disable boot-sound` applies without a restart.
|
|
139174
|
+
sound: params.sound ?? isFlagEnabled("boot-sound"),
|
|
139175
|
+
guestVulkan: params.guestVulkan ?? androidGuestVulkanFromEnv(),
|
|
139176
|
+
readOnly: params.readOnly ?? false,
|
|
139177
|
+
port: params.port,
|
|
139178
|
+
session: ctx?.session,
|
|
139179
|
+
holdRunning: running.hold
|
|
139180
|
+
})
|
|
139181
|
+
);
|
|
139182
|
+
} finally {
|
|
139183
|
+
running.end();
|
|
139184
|
+
}
|
|
138752
139185
|
}
|
|
138753
139186
|
if (hasVega) {
|
|
138754
|
-
return
|
|
138755
|
-
|
|
138756
|
-
|
|
138757
|
-
|
|
138758
|
-
|
|
139187
|
+
return claimBooted(
|
|
139188
|
+
ctx?.session,
|
|
139189
|
+
await bootVega({
|
|
139190
|
+
vvdImage: params.vvdImage,
|
|
139191
|
+
bootTimeoutMs: params.bootTimeoutMs ?? 12e4,
|
|
139192
|
+
force: params.force
|
|
139193
|
+
})
|
|
139194
|
+
);
|
|
138759
139195
|
}
|
|
138760
139196
|
if (hasHarmony) {
|
|
138761
|
-
return
|
|
138762
|
-
|
|
138763
|
-
|
|
138764
|
-
|
|
138765
|
-
|
|
139197
|
+
return claimBooted(
|
|
139198
|
+
ctx?.session,
|
|
139199
|
+
await bootHarmony({
|
|
139200
|
+
instanceName: harmonyInstanceName(params.harmonyInstance),
|
|
139201
|
+
bootTimeoutMs: params.bootTimeoutMs ?? HARMONY_BOOT_TIMEOUT_MS,
|
|
139202
|
+
force: params.force
|
|
139203
|
+
})
|
|
139204
|
+
);
|
|
138766
139205
|
}
|
|
138767
|
-
return
|
|
138768
|
-
|
|
138769
|
-
|
|
138770
|
-
|
|
138771
|
-
|
|
139206
|
+
return claimBooted(
|
|
139207
|
+
ctx?.session,
|
|
139208
|
+
await bootElectronApp({
|
|
139209
|
+
appPath: params.electronAppPath,
|
|
139210
|
+
port: params.electronPort,
|
|
139211
|
+
extraArgs: params.electronArgs
|
|
139212
|
+
})
|
|
139213
|
+
);
|
|
138772
139214
|
}
|
|
138773
139215
|
};
|
|
138774
139216
|
}
|
|
@@ -139389,7 +139831,7 @@ var capability3 = {
|
|
|
139389
139831
|
harmony: { device: true },
|
|
139390
139832
|
macos: { app: true, catalyst: true }
|
|
139391
139833
|
};
|
|
139392
|
-
var
|
|
139834
|
+
var zodSchema13 = external_exports.object({
|
|
139393
139835
|
udid: external_exports.string().min(1).describe("Target device id from `list-devices`."),
|
|
139394
139836
|
bundleId: external_exports.string().regex(BUNDLE_ID_PATTERN, BUNDLE_ID_MESSAGE).describe(
|
|
139395
139837
|
"App identifier (iOS<flag:macos-apps>/Mac app</flag:macos-apps> bundle id, Android package name, Vega interactive component app id from manifest.toml e.g. `com.example.app.main`,<flag:harmonyos> HarmonyOS bundle name from `bm dump -a`,</flag:harmonyos> or Chromium tag)."
|
|
@@ -139409,7 +139851,7 @@ Use when starting an app; prefer this over tapping home-screen icons.
|
|
|
139409
139851
|
Returns { launched, bundleId, <flag:macos-apps>kind?, appPath?, args?, </flag:macos-apps>note?, networkCapture? }. Fails if the app is not installed.
|
|
139410
139852
|
Common iOS ids: com.apple.Preferences, com.apple.mobilesafari, com.apple.MobileSMS, com.apple.Maps, com.apple.mobileslideshow, com.apple.MobileAddressBook.
|
|
139411
139853
|
Common Android packages: com.android.settings, com.android.chrome, com.google.android.apps.maps.`,
|
|
139412
|
-
zodSchema:
|
|
139854
|
+
zodSchema: zodSchema13,
|
|
139413
139855
|
alwaysLoad: true,
|
|
139414
139856
|
searchHint: "open start app bundle id package simulator emulator chromium vega launch tvos apple tv fire tv",
|
|
139415
139857
|
interaction: {
|
|
@@ -139693,7 +140135,7 @@ var capability4 = {
|
|
|
139693
140135
|
harmony: { device: true },
|
|
139694
140136
|
macos: { app: true, catalyst: true }
|
|
139695
140137
|
};
|
|
139696
|
-
var
|
|
140138
|
+
var zodSchema14 = external_exports.object({
|
|
139697
140139
|
udid: external_exports.string().min(1).describe("Target device id from `list-devices`."),
|
|
139698
140140
|
bundleId: external_exports.string().min(1).regex(BUNDLE_ID_PATTERN, BUNDLE_ID_MESSAGE).describe(
|
|
139699
140141
|
"App identifier (iOS<flag:macos-apps>/Mac app</flag:macos-apps> bundle id, Android package name, Vega interactive component app id<flag:harmonyos>, or HarmonyOS bundle name</flag:harmonyos>)."
|
|
@@ -139708,7 +140150,7 @@ function createRestartAppTool(registry2) {
|
|
|
139708
140150
|
longRunning: true,
|
|
139709
140151
|
description: `Terminate and relaunch an app (also refreshes native-devtools injection on iOS/tvOS).<flag:macos-apps> On a Mac app, quits and restarts the same .app in the background.</flag:macos-apps>
|
|
139710
140152
|
Use when you need a clean in-memory app state without reinstalling. Returns { restarted, bundleId, <flag:macos-apps>kind?, appPath?, args?, note?, </flag:macos-apps>networkCapture? }. Fails if the app is not installed or fails to terminate.`,
|
|
139711
|
-
zodSchema:
|
|
140153
|
+
zodSchema: zodSchema14,
|
|
139712
140154
|
alwaysLoad: true,
|
|
139713
140155
|
searchHint: "terminate relaunch restart reset app bundle id package simulator emulator vega tvos fire tv<flag:harmonyos> harmony harmonyos</flag:harmonyos>",
|
|
139714
140156
|
interaction: {
|
|
@@ -139753,7 +140195,7 @@ var capability5 = {
|
|
|
139753
140195
|
vega: { vvd: true }
|
|
139754
140196
|
};
|
|
139755
140197
|
var VEGA_NOT_INSTALLED = /App could not be determined/i;
|
|
139756
|
-
var
|
|
140198
|
+
var zodSchema15 = external_exports.object({
|
|
139757
140199
|
udid: external_exports.string().min(1).describe("Target device id from `list-devices`."),
|
|
139758
140200
|
bundleId: external_exports.string().min(1).regex(BUNDLE_ID_PATTERN, BUNDLE_ID_MESSAGE).describe("App identifier. iOS: bundle id. Android: package name.")
|
|
139759
140201
|
});
|
|
@@ -139763,7 +140205,7 @@ var terminateAppTool = {
|
|
|
139763
140205
|
Use when a program needs the app closed between steps; agents use restart-app.
|
|
139764
140206
|
Returns { terminated, bundleId }; terminated is false on iOS when the app was not running.
|
|
139765
140207
|
Succeeds when the app is not running or not installed.`,
|
|
139766
|
-
zodSchema:
|
|
140208
|
+
zodSchema: zodSchema15,
|
|
139767
140209
|
hideFromMcp: true,
|
|
139768
140210
|
interaction: {
|
|
139769
140211
|
startedMsg: ({ params }) => `Terminating ${params.bundleId}`,
|
|
@@ -139836,13 +140278,13 @@ init_zod();
|
|
|
139836
140278
|
// ../tool-server/src/tools/reinstall-app/platforms/ios.ts
|
|
139837
140279
|
var import_node_child_process43 = require("node:child_process");
|
|
139838
140280
|
var import_node_util33 = require("node:util");
|
|
139839
|
-
var
|
|
140281
|
+
var import_node_path25 = require("node:path");
|
|
139840
140282
|
init_src2();
|
|
139841
140283
|
|
|
139842
140284
|
// ../tool-server/src/tools/reinstall-app/validate-app.ts
|
|
139843
140285
|
var import_node_child_process42 = require("node:child_process");
|
|
139844
140286
|
var import_promises20 = require("node:fs/promises");
|
|
139845
|
-
var
|
|
140287
|
+
var import_node_path24 = require("node:path");
|
|
139846
140288
|
var import_node_util32 = require("node:util");
|
|
139847
140289
|
init_capability();
|
|
139848
140290
|
|
|
@@ -139959,7 +140401,7 @@ function mismatch(bundleId, absolute, actual) {
|
|
|
139959
140401
|
}
|
|
139960
140402
|
async function assertIosAppBundle(absolute, bundleId, { readBundleId = true } = {}) {
|
|
139961
140403
|
await requirePath(absolute, "directory", "an .app bundle directory");
|
|
139962
|
-
const infoPlist = (0,
|
|
140404
|
+
const infoPlist = (0, import_node_path24.join)(absolute, "Info.plist");
|
|
139963
140405
|
if (!(await (0, import_promises20.stat)(infoPlist).catch(() => null))?.isFile()) {
|
|
139964
140406
|
throw new InvalidToolInputError(
|
|
139965
140407
|
`appPath ${absolute} has no Info.plist, so it is not an iOS .app bundle. Nothing was uninstalled.`
|
|
@@ -140024,7 +140466,7 @@ var iosImpl = {
|
|
|
140024
140466
|
requires: ["xcrun"],
|
|
140025
140467
|
handler: async (_services, params) => {
|
|
140026
140468
|
const { udid, bundleId, appPath } = params;
|
|
140027
|
-
const absolute = (0,
|
|
140469
|
+
const absolute = (0, import_node_path25.resolve)(appPath);
|
|
140028
140470
|
await assertIosAppBundle(absolute, bundleId);
|
|
140029
140471
|
const { nativeId, prefix } = await simctlTargetForUdid(udid);
|
|
140030
140472
|
try {
|
|
@@ -140071,7 +140513,7 @@ var iosImpl = {
|
|
|
140071
140513
|
};
|
|
140072
140514
|
|
|
140073
140515
|
// ../tool-server/src/tools/reinstall-app/platforms/android.ts
|
|
140074
|
-
var
|
|
140516
|
+
var import_node_path26 = require("node:path");
|
|
140075
140517
|
init_src2();
|
|
140076
140518
|
init_adb();
|
|
140077
140519
|
async function isInstalled(udid, bundleId) {
|
|
@@ -140084,7 +140526,7 @@ var androidImpl3 = {
|
|
|
140084
140526
|
requires: ["adb"],
|
|
140085
140527
|
handler: async (_services, params) => {
|
|
140086
140528
|
const { udid, bundleId, appPath } = params;
|
|
140087
|
-
const absolute = (0,
|
|
140529
|
+
const absolute = (0, import_node_path26.resolve)(appPath);
|
|
140088
140530
|
await assertApk(absolute, bundleId);
|
|
140089
140531
|
const uninstall = await runAdb(["-s", udid, "uninstall", bundleId], {
|
|
140090
140532
|
timeoutMs: 3e4
|
|
@@ -140136,7 +140578,7 @@ ${stderr}`;
|
|
|
140136
140578
|
};
|
|
140137
140579
|
|
|
140138
140580
|
// ../tool-server/src/tools/reinstall-app/platforms/ios-device.ts
|
|
140139
|
-
var
|
|
140581
|
+
var import_node_path27 = require("node:path");
|
|
140140
140582
|
init_capability();
|
|
140141
140583
|
var iosDeviceImpl3 = {
|
|
140142
140584
|
requires: ["xcrun"],
|
|
@@ -140146,7 +140588,7 @@ var iosDeviceImpl3 = {
|
|
|
140146
140588
|
`${params.bundleId} is system UI: it is always running and cannot be reinstalled. Use launch-app to put it under automation.`
|
|
140147
140589
|
);
|
|
140148
140590
|
}
|
|
140149
|
-
const absolute = (0,
|
|
140591
|
+
const absolute = (0, import_node_path27.resolve)(params.appPath);
|
|
140150
140592
|
await assertIosAppBundle(absolute, params.bundleId);
|
|
140151
140593
|
await ensureDeviceReady(params.udid);
|
|
140152
140594
|
await uninstallApp(params.udid, params.bundleId);
|
|
@@ -140160,12 +140602,12 @@ var iosDeviceImpl3 = {
|
|
|
140160
140602
|
};
|
|
140161
140603
|
|
|
140162
140604
|
// ../tool-server/src/tools/reinstall-app/platforms/ios-remote.ts
|
|
140163
|
-
var
|
|
140605
|
+
var import_node_path28 = require("node:path");
|
|
140164
140606
|
var iosRemoteImpl3 = {
|
|
140165
140607
|
requires: ["sim-remote"],
|
|
140166
140608
|
handler: async (_services, params) => {
|
|
140167
140609
|
const { udid, bundleId, appPath } = params;
|
|
140168
|
-
const absolute = (0,
|
|
140610
|
+
const absolute = (0, import_node_path28.resolve)(appPath);
|
|
140169
140611
|
await assertIosAppBundle(absolute, bundleId, { readBundleId: false });
|
|
140170
140612
|
try {
|
|
140171
140613
|
await simctlUninstall(udid, bundleId);
|
|
@@ -140177,13 +140619,13 @@ var iosRemoteImpl3 = {
|
|
|
140177
140619
|
};
|
|
140178
140620
|
|
|
140179
140621
|
// ../tool-server/src/tools/reinstall-app/platforms/vega.ts
|
|
140180
|
-
var
|
|
140622
|
+
var import_node_path29 = require("node:path");
|
|
140181
140623
|
init_src2();
|
|
140182
140624
|
var vegaImpl3 = {
|
|
140183
140625
|
requires: ["vega"],
|
|
140184
140626
|
handler: async (_services, params) => {
|
|
140185
140627
|
const { udid, bundleId, appPath } = params;
|
|
140186
|
-
const absolute = (0,
|
|
140628
|
+
const absolute = (0, import_node_path29.resolve)(appPath);
|
|
140187
140629
|
await assertVpkg(absolute);
|
|
140188
140630
|
await vegaDevice(udid, ["uninstall-app", "-a", bundleId], { timeoutMs: 6e4 }).catch(
|
|
140189
140631
|
() => {
|
|
@@ -140210,7 +140652,7 @@ ${stderr}`;
|
|
|
140210
140652
|
};
|
|
140211
140653
|
|
|
140212
140654
|
// ../tool-server/src/tools/reinstall-app/platforms/harmony.ts
|
|
140213
|
-
var
|
|
140655
|
+
var import_node_path30 = require("node:path");
|
|
140214
140656
|
init_src2();
|
|
140215
140657
|
init_device_info();
|
|
140216
140658
|
var INSTALLED = "msg:install bundle successfully.";
|
|
@@ -140221,7 +140663,7 @@ var harmonyImpl3 = {
|
|
|
140221
140663
|
handler: async (_services, params, device) => {
|
|
140222
140664
|
const { bundleId, appPath } = params;
|
|
140223
140665
|
const connectKey = harmonyConnectKey(device.id);
|
|
140224
|
-
const absolute = (0,
|
|
140666
|
+
const absolute = (0, import_node_path30.resolve)(appPath);
|
|
140225
140667
|
await assertHap(absolute, bundleId);
|
|
140226
140668
|
const uninstall = await runHdc(["-t", connectKey, "uninstall", bundleId], 6e4);
|
|
140227
140669
|
if (!uninstall.stdout.includes(UNINSTALLED) && !uninstall.stdout.includes(NOT_INSTALLED)) {
|
|
@@ -140257,7 +140699,7 @@ var capability6 = {
|
|
|
140257
140699
|
vega: { vvd: true },
|
|
140258
140700
|
harmony: { device: true }
|
|
140259
140701
|
};
|
|
140260
|
-
var
|
|
140702
|
+
var zodSchema16 = external_exports.object({
|
|
140261
140703
|
udid: external_exports.string().min(1).describe(
|
|
140262
140704
|
"Device id from `list-devices` (iOS UDID<flag:harmonyos>, HarmonyOS id,</flag:harmonyos> or Android serial)."
|
|
140263
140705
|
),
|
|
@@ -140275,7 +140717,7 @@ var reinstallAppTool = {
|
|
|
140275
140717
|
description: `Install a fresh app package after uninstalling any existing build (clears app data and permissions).
|
|
140276
140718
|
Use when installing a new build or resetting to clean state.
|
|
140277
140719
|
Returns \`{ reinstalled, bundleId }\`. Fails if \`appPath\` is invalid or \`bundleId\` does not match it (not checked on Vega or remote simulators; checks run before uninstall), or if install fails. An uninstall error fails the call on Android and physical iPhones, and on a local simulator only when it times out; Vega and remote simulators ignore it.`,
|
|
140278
|
-
zodSchema:
|
|
140720
|
+
zodSchema: zodSchema16,
|
|
140279
140721
|
interaction: {
|
|
140280
140722
|
startedMsg: ({ params }) => `Reinstalling ${params.bundleId}`,
|
|
140281
140723
|
completedMsg: ({ params }) => `Reinstalled ${params.bundleId}`,
|
|
@@ -140595,7 +141037,7 @@ var capability7 = {
|
|
|
140595
141037
|
appleRemote: { simulator: true },
|
|
140596
141038
|
android: { emulator: true, device: true, unknown: true }
|
|
140597
141039
|
};
|
|
140598
|
-
var
|
|
141040
|
+
var zodSchema17 = external_exports.object({
|
|
140599
141041
|
udid: external_exports.string().min(1).describe("Device id from `list-devices` (iOS simulator UDID or Android serial)."),
|
|
140600
141042
|
action: external_exports.enum(PERMISSION_ACTIONS).describe("`grant` (pre-authorize), `deny`, or `reset` (re-prompt on next use)."),
|
|
140601
141043
|
permission: external_exports.enum(PERMISSION_NAMES).describe("Permission name (`notifications` = Android-only; `reminders` = iOS-only)."),
|
|
@@ -140606,7 +141048,7 @@ var settingsPermissionsTool = {
|
|
|
140606
141048
|
description: `Grant or deny an app's runtime permission, or reset it, without opening Settings. Use when setting up permissions before launching or triggering a prompt (changing permissions may terminate a running app).
|
|
140607
141049
|
iOS sim: \`grant location\`/\`location-always\` requires the app installed first. Android: app must be installed and declare the mapped permissions in its manifest.
|
|
140608
141050
|
Returns \`{ action, permission, bundleId, applied, skipped? }\`. Fails if nothing could be applied.`,
|
|
140609
|
-
zodSchema:
|
|
141051
|
+
zodSchema: zodSchema17,
|
|
140610
141052
|
searchHint: "grant deny reset revoke app permissions privacy camera microphone location settings",
|
|
140611
141053
|
interaction: {
|
|
140612
141054
|
startedMsg: ({ params }) => `${permissionAction[params.action].started} ${params.permission} permission for ${params.bundleId}`,
|
|
@@ -140859,7 +141301,7 @@ var capability8 = {
|
|
|
140859
141301
|
harmony: { device: true },
|
|
140860
141302
|
macos: { app: true, catalyst: true }
|
|
140861
141303
|
};
|
|
140862
|
-
var
|
|
141304
|
+
var zodSchema18 = external_exports.object({
|
|
140863
141305
|
udid: external_exports.string().min(1).describe(
|
|
140864
141306
|
"Device id from `list-devices` (iOS UDID, Android serial, <flag:harmonyos>HarmonyOS id, </flag:harmonyos>or Chromium id)."
|
|
140865
141307
|
),
|
|
@@ -140876,7 +141318,7 @@ var openUrlTool = {
|
|
|
140876
141318
|
description: `Open a URL or deep-link scheme on the device.
|
|
140877
141319
|
Use when navigating to a web page or deep-linking into an app (prefer custom schemes or \`launch-app\` over \`https://\` Universal/App Links). On Chromium, navigates the primary page (non-page schemes like \`tel:\`/\`mailto:\` fail). On physical iOS, the receiving app becomes active for automation.<flag:harmonyos> HarmonyOS opens URIs via \`aa start -U\`.</flag:harmonyos>
|
|
140878
141320
|
Returns \`{ opened, url, note? }\`. Fails if no handler is registered<flag:harmonyos> (iOS/Android/HarmonyOS)</flag:harmonyos> or Chromium rejects navigation.`,
|
|
140879
|
-
zodSchema:
|
|
141321
|
+
zodSchema: zodSchema18,
|
|
140880
141322
|
interaction: {
|
|
140881
141323
|
startedMsg: ({ params }) => `Opening ${safeDestination(params.url)}`,
|
|
140882
141324
|
completedMsg: ({ params }) => `Opened ${safeDestination(params.url)}`,
|
|
@@ -141057,34 +141499,6 @@ var import_node_path31 = require("node:path");
|
|
|
141057
141499
|
var import_pngjs3 = __toESM(require_png());
|
|
141058
141500
|
init_src2();
|
|
141059
141501
|
init_adb();
|
|
141060
|
-
|
|
141061
|
-
// ../tool-server/src/utils/emulator-console.ts
|
|
141062
|
-
var import_node_os16 = require("node:os");
|
|
141063
|
-
var import_node_path30 = require("node:path");
|
|
141064
|
-
init_adb();
|
|
141065
|
-
async function runEmuConsole(serial, args) {
|
|
141066
|
-
const { stdout } = await runAdb(["-s", serial, "emu", ...args], { timeoutMs: 1e4 });
|
|
141067
|
-
const verdict = replyLines(stdout).at(-1);
|
|
141068
|
-
if (verdict?.startsWith("KO:")) {
|
|
141069
|
-
throw new Error(
|
|
141070
|
-
`emulator console rejected \`${args.join(" ")}\` \u2014 ${describeConsoleReply(stdout)}`
|
|
141071
|
-
);
|
|
141072
|
-
}
|
|
141073
|
-
return stdout;
|
|
141074
|
-
}
|
|
141075
|
-
function describeConsoleReply(stdout) {
|
|
141076
|
-
const lines = replyLines(stdout);
|
|
141077
|
-
const reply = lines.join("; ") || "empty reply";
|
|
141078
|
-
if (!lines.at(-1)?.startsWith("KO: unknown command")) return reply;
|
|
141079
|
-
const tokenFile = (0, import_node_path30.join)((0, import_node_os16.homedir)(), ".emulator_console_auth_token");
|
|
141080
|
-
const fileKind = process.platform === "win32" ? "a file" : "a regular file, not a symlink,";
|
|
141081
|
-
return `${reply} (adb authenticates to the console with ${tokenFile}, which must be ${fileKind} holding the emulator's token)`;
|
|
141082
|
-
}
|
|
141083
|
-
function replyLines(stdout) {
|
|
141084
|
-
return stdout.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
141085
|
-
}
|
|
141086
|
-
|
|
141087
|
-
// ../tool-server/src/utils/vega-screen.ts
|
|
141088
141502
|
async function captureVegaScreenshotPng(opts = {}) {
|
|
141089
141503
|
return captureViaEmulatorConsole(opts);
|
|
141090
141504
|
}
|
|
@@ -141271,7 +141685,7 @@ async function downscalePngInPlace(file2, scale, signal) {
|
|
|
141271
141685
|
}).catch(() => {
|
|
141272
141686
|
});
|
|
141273
141687
|
}
|
|
141274
|
-
var
|
|
141688
|
+
var zodSchema19 = external_exports.object({
|
|
141275
141689
|
udid: external_exports.string().describe("Target device id from `list-devices`."),
|
|
141276
141690
|
rotation: external_exports.enum(["Portrait", "LandscapeLeft", "LandscapeRight", "PortraitUpsideDown"]).optional().describe(
|
|
141277
141691
|
"Orientation override (rarely needed; captures already follow UI orientation).<flag:harmonyos> Rejected on HarmonyOS (captures display in current orientation).</flag:harmonyos> Ignored on physical iPhones."
|
|
@@ -141289,7 +141703,7 @@ function createScreenshotTool(registry2) {
|
|
|
141289
141703
|
id: "screenshot",
|
|
141290
141704
|
description: `Capture a PNG screenshot of the device screen.
|
|
141291
141705
|
Use when you need a baseline image or the screen state after a delay (interaction tools already attach a screenshot). Returns { image }. Fails if the capture backend is unreachable.`,
|
|
141292
|
-
zodSchema:
|
|
141706
|
+
zodSchema: zodSchema19,
|
|
141293
141707
|
alwaysLoad: true,
|
|
141294
141708
|
searchHint: "device simulator emulator chromium screen image capture baseline tvos apple tv",
|
|
141295
141709
|
readOnly: true,
|
|
@@ -141496,7 +141910,7 @@ async function tapHarmony(connectKey, x, y, clickCount, signal) {
|
|
|
141496
141910
|
signal
|
|
141497
141911
|
);
|
|
141498
141912
|
}
|
|
141499
|
-
var
|
|
141913
|
+
var zodSchema20 = external_exports.object({
|
|
141500
141914
|
udid: external_exports.string().describe("Target device id from `list-devices`."),
|
|
141501
141915
|
x: external_exports.number().min(0).max(1).describe("Horizontal screen fraction [0,1]."),
|
|
141502
141916
|
y: external_exports.number().min(0).max(1).describe("Vertical screen fraction [0,1]."),
|
|
@@ -141510,7 +141924,7 @@ var gestureTapTool = {
|
|
|
141510
141924
|
id: "gesture-tap",
|
|
141511
141925
|
description: `Press (tap, or click on Chromium<flag:macos-apps>/Mac</flag:macos-apps>) at normalized [0,1] coordinates taken from \`describe\`.
|
|
141512
141926
|
Use when tapping a button, link, or control. Returns { tapped: true, timestampMs, reactivated?, warning? } (on physical iOS, \`reactivated: true\` means re-fronted; re-describe). Fails if the device backend is unreachable.`,
|
|
141513
|
-
zodSchema:
|
|
141927
|
+
zodSchema: zodSchema20,
|
|
141514
141928
|
alwaysLoad: true,
|
|
141515
141929
|
// A physical iPhone's first call waits out the runner build, past the MCP fetch timeout,
|
|
141516
141930
|
// whose abort replays the call: the gesture would land once per replay.
|
|
@@ -141629,7 +142043,7 @@ var capability11 = {
|
|
|
141629
142043
|
android: { emulator: true, device: true, unknown: true },
|
|
141630
142044
|
harmony: { device: true }
|
|
141631
142045
|
};
|
|
141632
|
-
var
|
|
142046
|
+
var zodSchema21 = external_exports.object({
|
|
141633
142047
|
udid: external_exports.string().describe("Target device id from `list-devices`."),
|
|
141634
142048
|
fromX: external_exports.number().min(0).max(1).describe("Start x [0,1]."),
|
|
141635
142049
|
fromY: external_exports.number().min(0).max(1).describe("Start y [0,1]."),
|
|
@@ -141663,7 +142077,7 @@ var gestureSwipeTool = {
|
|
|
141663
142077
|
description: `Execute a swipe/drag between two normalized [0,1] points on touch devices (swipe up, fromY > toY, to scroll down).
|
|
141664
142078
|
Use when scrolling a list, dismissing a modal, or swiping between pages (not Chromium<flag:macos-apps>/Mac</flag:macos-apps>: use \`gesture-scroll\` / \`gesture-drag\`). Returns { swiped: true, timestampMs, reactivated?, warning? }. Fails if the touch backend is unreachable.
|
|
141665
142079
|
Physical iOS: an edge gesture (back-swipe) needs \`fromX: 0\` exactly; \`durationMs\` sets drag speed, not time; \`momentum: false\` only rests 300ms at the end and does not damp.<flag:harmonyos> HarmonyOS: \`durationMs\` sets drag speed, clamped to 200\u201340000 px/s.</flag:harmonyos>`,
|
|
141666
|
-
zodSchema:
|
|
142080
|
+
zodSchema: zodSchema21,
|
|
141667
142081
|
alwaysLoad: true,
|
|
141668
142082
|
// A physical iPhone's first call waits out the runner build, past the MCP fetch timeout,
|
|
141669
142083
|
// whose abort replays the call: the gesture would land once per replay.
|
|
@@ -141808,7 +142222,7 @@ var capability12 = {
|
|
|
141808
142222
|
chromium: { app: true },
|
|
141809
142223
|
macos: { app: true, catalyst: true }
|
|
141810
142224
|
};
|
|
141811
|
-
var
|
|
142225
|
+
var zodSchema22 = external_exports.object({
|
|
141812
142226
|
udid: external_exports.string().describe(
|
|
141813
142227
|
"Chromium device id (`chromium-cdp-<port>`)<flag:macos-apps> or Mac app id</flag:macos-apps> from `list-devices`."
|
|
141814
142228
|
),
|
|
@@ -141827,7 +142241,7 @@ var gestureScrollTool = {
|
|
|
141827
142241
|
description: `Send mouse-wheel scroll events at normalized [0,1] anchor (x, y) in Chromium<flag:macos-apps> or a Mac app</flag:macos-apps>.
|
|
141828
142242
|
Use when scrolling desktop lists or off-screen content (use \`gesture-swipe\` on iOS/Android<flag:harmonyos>/HarmonyOS</flag:harmonyos>).
|
|
141829
142243
|
Returns \`{ scrolled: true, timestampMs }\`. Fails if CDP is unreachable<flag:macos-apps> or nothing under the point scrolls on a Mac app</flag:macos-apps>.`,
|
|
141830
|
-
zodSchema:
|
|
142244
|
+
zodSchema: zodSchema22,
|
|
141831
142245
|
searchHint: "scroll wheel list page chromium<flag:macos-apps> mac</flag:macos-apps> mouse down up content fold",
|
|
141832
142246
|
interaction: {
|
|
141833
142247
|
startedMsg: ({ params }) => `Scrolling ${scrollDirection(params)}`,
|
|
@@ -141884,7 +142298,7 @@ function hoverDescription(params, tense) {
|
|
|
141884
142298
|
const at = `(${Math.round((params.x ?? 0) * 100)}%, ${Math.round((params.y ?? 0) * 100)}%)`;
|
|
141885
142299
|
return `${tense === "present" ? "Hovering" : "Hovered"} at ${at}`;
|
|
141886
142300
|
}
|
|
141887
|
-
var
|
|
142301
|
+
var zodSchema23 = external_exports.object({
|
|
141888
142302
|
udid: external_exports.string().describe("Mac app device ID from `list-devices`."),
|
|
141889
142303
|
x: external_exports.number().min(0).max(1).optional().describe(
|
|
141890
142304
|
"Horizontal fraction of the area reported by `describe`, measured from the left. Required unless `leave` is true."
|
|
@@ -141909,7 +142323,7 @@ var gestureHoverTool = {
|
|
|
141909
142323
|
description: `Move Argent's pointer in a Mac app to check hover effects, such as controls that appear on hover. Standard macOS tooltips are unavailable. Use \`gesture-tap\` directly to click a visible control. It moves the pointer before clicking.
|
|
141910
142324
|
The pointer stays in place until another pointer action or until the user clicks, scrolls, or presses a key in the app. If user input interrupts the move, the call fails with \`MACOS_APP_POINTER_TAKEN_OVER\`. Retry once the user finishes.
|
|
141911
142325
|
On \`MACOS_APP_LIBRARY_OUTDATED\`, run \`restart-app\` to reload the library, then retry.`,
|
|
141912
|
-
zodSchema:
|
|
142326
|
+
zodSchema: zodSchema23,
|
|
141913
142327
|
searchHint: "hover mouse over mouseover pointer rollover mouseEnter mouse enter leave highlight reveal mac app",
|
|
141914
142328
|
featureFlag: "macos-apps",
|
|
141915
142329
|
interaction: {
|
|
@@ -142006,7 +142420,7 @@ async function runPointerDrag(from2, to, opts, pointer) {
|
|
|
142006
142420
|
throw err;
|
|
142007
142421
|
}
|
|
142008
142422
|
}
|
|
142009
|
-
var
|
|
142423
|
+
var zodSchema24 = external_exports.object({
|
|
142010
142424
|
udid: external_exports.string().describe(
|
|
142011
142425
|
"Chromium device id (`chromium-cdp-<port>`)<flag:macos-apps> or Mac app id</flag:macos-apps> from `list-devices`."
|
|
142012
142426
|
),
|
|
@@ -142033,7 +142447,7 @@ var gestureDragTool = {
|
|
|
142033
142447
|
description: `Drag the left mouse button between normalized [0,1] window points in Chromium<flag:macos-apps> or a Mac app</flag:macos-apps>.
|
|
142034
142448
|
Use when dragging sliders, drag-and-drop items, or selecting text (use \`gesture-scroll\` to scroll desktop lists; use \`gesture-swipe\` on iOS/Android<flag:harmonyos>/HarmonyOS</flag:harmonyos>).<flag:macos-apps> Mac app: same start/end point = long press; drops stay inside the app's windows.</flag:macos-apps>
|
|
142035
142449
|
Returns \`{ dragged: true, timestampMs }\`. Fails if the CDP session is unreachable.`,
|
|
142036
|
-
zodSchema:
|
|
142450
|
+
zodSchema: zodSchema24,
|
|
142037
142451
|
searchHint: "drag drop slider mouse press move release chromium<flag:macos-apps> mac</flag:macos-apps> select",
|
|
142038
142452
|
interaction: {
|
|
142039
142453
|
startedMsg: ({ params }) => `Dragging from (${Math.round(params.fromX * 100)}%, ${Math.round(params.fromY * 100)}%) to (${Math.round(params.toX * 100)}%, ${Math.round(params.toY * 100)}%)`,
|
|
@@ -142316,7 +142730,7 @@ var eventSchema = external_exports.object({
|
|
|
142316
142730
|
y2: external_exports.number().min(0).max(1).optional().describe("Second finger y."),
|
|
142317
142731
|
delayMs: external_exports.number().optional().describe("Delay before event in ms (default 16).")
|
|
142318
142732
|
});
|
|
142319
|
-
var
|
|
142733
|
+
var zodSchema25 = external_exports.object({
|
|
142320
142734
|
udid: external_exports.string().describe("Target device id from `list-devices` (iOS UDID or Android serial)."),
|
|
142321
142735
|
edge: external_exports.enum(screenEdges).optional().describe("Starting screen edge for a single-finger system gesture (local iOS simulator)."),
|
|
142322
142736
|
events: external_exports.array(eventSchema).describe("Ordered touch events."),
|
|
@@ -142342,7 +142756,7 @@ Physical iOS: Down, optional Moves, then Up (\`x2\`/\`y2\` = second finger). Pla
|
|
|
142342
142756
|
Simulator/emulator: a train that ends without Up leaves the finger down and returns \`{ held: true }\`, so \`screenshot\`/\`describe\` can observe a pressed state; the next call continues it (start with Move or Up), and any new Down first lifts it. Argent lifts a held finger after 30 seconds. Not with \`edge\` or on physical iOS.
|
|
142343
142757
|
Example long-press + drag: \`[{"type":"Down","x":0.5,"y":0.6},{"type":"Move","x":0.5,"y":0.6,"delayMs":800},{"type":"Up","x":0.5,"y":0.3,"delayMs":500}]\`.
|
|
142344
142758
|
Returns \`{ events, held?, reactivated? }\` (on physical iOS, \`reactivated: true\` means re-describe). Fails if device is not booted or events are invalid.`,
|
|
142345
|
-
zodSchema:
|
|
142759
|
+
zodSchema: zodSchema25,
|
|
142346
142760
|
interaction: {
|
|
142347
142761
|
startedMsg: () => "Performing custom gesture",
|
|
142348
142762
|
completedMsg: () => "Performed custom gesture",
|
|
@@ -142442,7 +142856,7 @@ var capability16 = {
|
|
|
142442
142856
|
android: { emulator: true, device: true, unknown: true },
|
|
142443
142857
|
harmony: { device: true }
|
|
142444
142858
|
};
|
|
142445
|
-
var
|
|
142859
|
+
var zodSchema26 = external_exports.object({
|
|
142446
142860
|
udid: external_exports.string().describe(
|
|
142447
142861
|
"Device id from `list-devices` (iOS UDID<flag:harmonyos>, HarmonyOS id,</flag:harmonyos> or Android serial)."
|
|
142448
142862
|
),
|
|
@@ -142462,7 +142876,7 @@ var gesturePinchTool = {
|
|
|
142462
142876
|
description: `Send a two-finger pinch-to-zoom gesture in normalized [0,1] coords (\`startDistance < endDistance\` zooms in, e.g. 0.2\u21920.6; \`>\` zooms out).
|
|
142463
142877
|
Use when zooming maps, photos, or zoomable views (use \`gesture-rotate\` to rotate).
|
|
142464
142878
|
Returns \`{ pinched: true, timestampMs, reactivated? }\` (on physical iOS, \`reactivated: true\` means re-describe). Fails if the backend<flag:harmonyos> (\`hdc\` on HarmonyOS)</flag:harmonyos> is unreachable or a physical iPhone app is not in portrait.`,
|
|
142465
|
-
zodSchema:
|
|
142879
|
+
zodSchema: zodSchema26,
|
|
142466
142880
|
interaction: {
|
|
142467
142881
|
startedMsg: ({ params }) => `Pinching ${params.endDistance > params.startDistance ? "out" : "in"} at (${Math.round(params.centerX * 100)}%, ${Math.round(params.centerY * 100)}%)`,
|
|
142468
142882
|
completedMsg: ({ params }) => `Pinched ${params.endDistance > params.startDistance ? "out" : "in"} at (${Math.round(params.centerX * 100)}%, ${Math.round(params.centerY * 100)}%)`,
|
|
@@ -142559,7 +142973,7 @@ var capability17 = {
|
|
|
142559
142973
|
appleRemote: { simulator: true },
|
|
142560
142974
|
android: { emulator: true, device: true, unknown: true }
|
|
142561
142975
|
};
|
|
142562
|
-
var
|
|
142976
|
+
var zodSchema27 = external_exports.object({
|
|
142563
142977
|
udid: external_exports.string().describe("Device id from `list-devices` (iOS UDID or Android serial)."),
|
|
142564
142978
|
centerX: external_exports.number().describe("Normalized rotation center x."),
|
|
142565
142979
|
centerY: external_exports.number().describe("Normalized rotation center y."),
|
|
@@ -142579,7 +142993,7 @@ var gestureRotateTool = {
|
|
|
142579
142993
|
description: `Send a two-finger circular arc gesture in normalized [0,1] coords to rotate content from \`startAngle\` to \`endAngle\`. Pass \`radius\`, or \`radiusX\`+\`radiusY\` with \`radiusX\xB7width = radiusY\xB7height\` for a circular physical orbit (a single radius or equal values trace an ellipse on a non-square screen; one half of the pair alone is rejected).
|
|
142580
142994
|
Use when rotating a map, photo, or canvas (use \`gesture-pinch\` for zoom).
|
|
142581
142995
|
Returns \`{ rotated: true, timestampMs, reactivated? }\` (on physical iOS, \`reactivated: true\` means re-describe). Fails if the backend is unreachable or a physical iPhone app is not in portrait.`,
|
|
142582
|
-
zodSchema:
|
|
142996
|
+
zodSchema: zodSchema27,
|
|
142583
142997
|
interaction: {
|
|
142584
142998
|
startedMsg: ({ params }) => {
|
|
142585
142999
|
const degrees = Math.abs(params.endAngle - params.startAngle);
|
|
@@ -142702,7 +143116,7 @@ var RUNNER_UNSUPPORTED_OPERATION_CODE = "UNSUPPORTED_OPERATION";
|
|
|
142702
143116
|
function isPhysicalIosButton(button) {
|
|
142703
143117
|
return PHYSICAL_IOS_BUTTONS.has(button);
|
|
142704
143118
|
}
|
|
142705
|
-
var
|
|
143119
|
+
var zodSchema28 = external_exports.object({
|
|
142706
143120
|
udid: external_exports.string().describe(
|
|
142707
143121
|
"Target device id from `list-devices` (iOS UDID<flag:harmonyos>, HarmonyOS id,</flag:harmonyos> or Android serial)."
|
|
142708
143122
|
),
|
|
@@ -142715,7 +143129,7 @@ Supported buttons depend on the platform: buttons not present on the target (e.g
|
|
|
142715
143129
|
Use when you need to trigger hardware button events.
|
|
142716
143130
|
Returns { pressed: buttonName }.
|
|
142717
143131
|
Fails if the device backend is not reachable: the simulator-server for iOS, <flag:harmonyos>\`hdc\` for HarmonyOS, </flag:harmonyos>or \`adb\` for Android.`,
|
|
142718
|
-
zodSchema:
|
|
143132
|
+
zodSchema: zodSchema28,
|
|
142719
143133
|
interaction: {
|
|
142720
143134
|
startedMsg: ({ params }) => `Pressing ${params.button} button`,
|
|
142721
143135
|
completedMsg: ({ params }) => `Pressed ${params.button} button`,
|
|
@@ -144098,7 +144512,7 @@ var capability19 = {
|
|
|
144098
144512
|
harmony: { device: true },
|
|
144099
144513
|
macos: { app: true, catalyst: true }
|
|
144100
144514
|
};
|
|
144101
|
-
var
|
|
144515
|
+
var zodSchema29 = external_exports.object({
|
|
144102
144516
|
udid: external_exports.string().describe("Target device id from `list-devices`."),
|
|
144103
144517
|
text: external_exports.string().optional().describe(
|
|
144104
144518
|
"Text to type. Cannot be combined with `key`. Use `{{secret:NAME}}` for credentials, looked up where the MCP server started, first match wins: the `ARGENT_SECRET_NAME` env var, the project's `.argent/secrets.env`, `ARGENT_SECRET_NAME` in the project's `.env.local` or `.env`, then `~/.argent/secrets.env`. Ask the user to configure missing secrets there without sharing their values. Secret placeholders suppress the automatic screenshot for the call. Use one `run-sequence` to type a secret and press Enter with the same protection."
|
|
@@ -144134,7 +144548,7 @@ function createKeyboardTool(registry2) {
|
|
|
144134
144548
|
description: `Type text or press a named key on the focused field (tap or focus the field first; with no focus input is silently dropped).
|
|
144135
144549
|
Use when entering text or triggering named keys (enter, escape, backspace, arrows).
|
|
144136
144550
|
Returns { typed, keys, cleared?, verified?, warning?, reactivated? }. Fails if an unsupported key or untypeable character is passed or the input backend is unreachable (partial typing is not rolled back: on an iOS simulator or Chromium, the characters before an untypeable one stay typed; re-read before retrying). On iOS simulators, typing into an empty field verifies readback (\`verified: false\` warns). React Native: after typing, the next tap outside may only close the keyboard (tap again if so); where the field submits on return, \`key: "enter"\` avoids the extra tap.`,
|
|
144137
|
-
zodSchema:
|
|
144551
|
+
zodSchema: zodSchema29,
|
|
144138
144552
|
alwaysLoad: true,
|
|
144139
144553
|
searchHint: "type text keyboard input named key enter escape arrow tv vega fire tv <flag:harmonyos>harmony harmonyos </flag:harmonyos>search field hid leanback",
|
|
144140
144554
|
interaction: {
|
|
@@ -144450,7 +144864,7 @@ var capability21 = {
|
|
|
144450
144864
|
appleRemote: { simulator: true },
|
|
144451
144865
|
android: { emulator: true, device: true, unknown: true }
|
|
144452
144866
|
};
|
|
144453
|
-
var
|
|
144867
|
+
var zodSchema30 = external_exports.object({
|
|
144454
144868
|
udid: external_exports.string().describe("Target device id from `list-devices` (iOS UDID or Android serial)."),
|
|
144455
144869
|
orientation: external_exports.enum(["Portrait", "LandscapeLeft", "LandscapeRight", "PortraitUpsideDown"]).describe("Target orientation")
|
|
144456
144870
|
});
|
|
@@ -144464,7 +144878,7 @@ function createRotateTool(registry2) {
|
|
|
144464
144878
|
Use when testing layout in a different orientation. Re-run \`describe\` afterwards: frame coordinates change with the orientation.
|
|
144465
144879
|
On an unfolded foldable iOS simulator (the iPhone Duo), the value sets the orientation of the device, not of the UI: \`Portrait\` gives a landscape UI and \`LandscapeLeft\` gives a portrait UI. To fold or unfold the device, use \`fold\`.
|
|
144466
144880
|
Returns { orientation }. Fails on a TV target, or if the target device is not booted.`,
|
|
144467
|
-
zodSchema:
|
|
144881
|
+
zodSchema: zodSchema30,
|
|
144468
144882
|
interaction: {
|
|
144469
144883
|
startedMsg: ({ params }) => `Rotating device to ${params.orientation}`,
|
|
144470
144884
|
completedMsg: ({ params }) => `Rotated device to ${params.orientation}`,
|
|
@@ -145677,7 +146091,7 @@ var iosImpl6 = {
|
|
|
145677
146091
|
};
|
|
145678
146092
|
}
|
|
145679
146093
|
};
|
|
145680
|
-
var
|
|
146094
|
+
var zodSchema31 = external_exports.object({
|
|
145681
146095
|
udid: external_exports.string().describe(
|
|
145682
146096
|
"Foldable device id from `list-devices` (iOS simulator UDID or Android emulator serial)."
|
|
145683
146097
|
),
|
|
@@ -145692,7 +146106,7 @@ var foldTool = {
|
|
|
145692
146106
|
Use when testing an app across folded/unfolded postures (\`list-devices\` marks \`foldable: true\`; use \`rotate\` for orientation). Coordinates change with the active panel, so read the returned tree or call \`describe\` before tapping.
|
|
145693
146107
|
iOS: fold to \`closed\`/\`open\` to guarantee a panel switch; returns \`{ activeScreen, screen, posture?, hingeAngle, warning? }\`. A remote iOS simulator returns it without the panel size. Android: returns \`{ posture?, deviceState, hingeAngle?, warning? }\` (use Pixel Fold AVD for accurate cover-panel coords).
|
|
145694
146108
|
Fails if the device is not foldable or is a physical Android device.`,
|
|
145695
|
-
zodSchema:
|
|
146109
|
+
zodSchema: zodSchema31,
|
|
145696
146110
|
searchHint: "fold unfold hinge foldable duo posture open closed half-open panel screen split view",
|
|
145697
146111
|
interaction: {
|
|
145698
146112
|
startedMsg: ({ params }) => `Folding device to ${targetLabel2(params)}`,
|
|
@@ -145817,7 +146231,7 @@ var buttonSchema = external_exports.preprocess(
|
|
|
145817
146231
|
).describe(
|
|
145818
146232
|
'Single remote button or array path run in one call (e.g. ["up","right","select"]; prefer an array over repeated calls).'
|
|
145819
146233
|
);
|
|
145820
|
-
var
|
|
146234
|
+
var zodSchema32 = external_exports.object({
|
|
145821
146235
|
udid: external_exports.string().describe("TV device id from `list-devices` (Apple TV, Android TV, or Vega)."),
|
|
145822
146236
|
button: buttonSchema,
|
|
145823
146237
|
repeat: external_exports.number().int().min(1).max(50).optional().describe('Repeat `button` N times (default 1, e.g. `{ button: "down", repeat: 12 }`).')
|
|
@@ -145828,7 +146242,7 @@ function createTvRemoteTool(registry2) {
|
|
|
145828
146242
|
description: `Press a TV remote / D-pad button (or array path) on Apple TV (tvOS), Android TV, or Vega (Fire TV).
|
|
145829
146243
|
Use when navigating focus or pressing remote keys on a TV instead of touch gestures. Call \`describe\` first to locate focus; check the returned tree after.
|
|
145830
146244
|
Returns \`{ pressed, count }\`. Fails on non-TV targets, or on Apple TV sim for rewind/fastForward/next/previous/volume/mute.`,
|
|
145831
|
-
zodSchema:
|
|
146245
|
+
zodSchema: zodSchema32,
|
|
145832
146246
|
searchHint: "tv remote dpad d-pad navigate focus up down left right select ok back home menu play pause rewind fast forward sequence path apple tv tvos android tv leanback vega fire tv",
|
|
145833
146247
|
interaction: {
|
|
145834
146248
|
startedMsg: ({ params }) => `Pressing ${params.button} on TV remote${(params.repeat ?? 1) > 1 ? ` ${params.repeat} times` : ""}`,
|
|
@@ -146032,7 +146446,8 @@ async function invokeSubTool(registry2, ctx, toolId, args, extra) {
|
|
|
146032
146446
|
...flowStack ? { flowStack } : {},
|
|
146033
146447
|
...flowSecret ? { flowSecret } : {},
|
|
146034
146448
|
...extra?.flowOutput ? { flowOutput: extra.flowOutput } : {},
|
|
146035
|
-
...ctx?.clientSecrets ? { clientSecrets: ctx.clientSecrets } : {}
|
|
146449
|
+
...ctx?.clientSecrets ? { clientSecrets: ctx.clientSecrets } : {},
|
|
146450
|
+
...ctx?.session ? { session: ctx.session } : {}
|
|
146036
146451
|
};
|
|
146037
146452
|
if (!recordChildInvocation) {
|
|
146038
146453
|
return signal || Object.keys(forwarded).length > 0 ? registry2.invokeTool(toolId, args, { ...signal ? { signal } : {}, ...forwarded }) : registry2.invokeTool(toolId, args);
|
|
@@ -146052,9 +146467,9 @@ async function invokeSubTool(registry2, ctx, toolId, args, extra) {
|
|
|
146052
146467
|
}
|
|
146053
146468
|
function describeNestedParamError(registry2, err, toolId, dispatchedArgs, authoredArgs) {
|
|
146054
146469
|
if (getFailureSignal(err)?.error_code !== FAILURE_CODES.TOOL_INPUT_INVALID) return void 0;
|
|
146055
|
-
const
|
|
146056
|
-
if (!
|
|
146057
|
-
const parsed2 =
|
|
146470
|
+
const zodSchema91 = registry2.getTool(toolId)?.zodSchema;
|
|
146471
|
+
if (!zodSchema91) return void 0;
|
|
146472
|
+
const parsed2 = zodSchema91.safeParse(dispatchedArgs ?? {});
|
|
146058
146473
|
if (parsed2.success) return void 0;
|
|
146059
146474
|
return `Invalid params for tool "${toolId}": ${describeParamIssues(parsed2.error, authoredArgs)}`;
|
|
146060
146475
|
}
|
|
@@ -146107,7 +146522,7 @@ var capability26 = {
|
|
|
146107
146522
|
// A Mac app takes the mouse and keyboard steps; touch-only steps fail at their own gate.
|
|
146108
146523
|
macos: { app: true, catalyst: true }
|
|
146109
146524
|
};
|
|
146110
|
-
var
|
|
146525
|
+
var zodSchema33 = external_exports.object({
|
|
146111
146526
|
udid: external_exports.string().describe("Target device id from `list-devices`, shared across all steps."),
|
|
146112
146527
|
steps: external_exports.array(
|
|
146113
146528
|
external_exports.object({
|
|
@@ -146182,7 +146597,7 @@ Allowed tools (coords are [0,1] screen fractions; ? = optional):
|
|
|
146182
146597
|
tv-remote: button (string or string[]), repeat?
|
|
146183
146598
|
await-ui-element: condition ("exists"|"visible"|"hidden"|"text"), selector, expectedText?, textMatch?, timeoutMs?, pollIntervalMs?
|
|
146184
146599
|
await-network-request: bundleId, url, plus optional args (start capture first)`,
|
|
146185
|
-
zodSchema:
|
|
146600
|
+
zodSchema: zodSchema33,
|
|
146186
146601
|
alwaysLoad: true,
|
|
146187
146602
|
searchHint: "batch sequence multiple gesture steps sequentially",
|
|
146188
146603
|
interaction: {
|
|
@@ -146264,7 +146679,7 @@ Allowed tools (coords are [0,1] screen fractions; ? = optional):
|
|
|
146264
146679
|
|
|
146265
146680
|
// ../tool-server/src/tools/debugger/debugger-connect.ts
|
|
146266
146681
|
init_zod();
|
|
146267
|
-
var
|
|
146682
|
+
var zodSchema34 = external_exports.object({
|
|
146268
146683
|
port: metroPortField,
|
|
146269
146684
|
device_id: external_exports.string().describe(
|
|
146270
146685
|
"Device id from `list-devices`: iOS UDID, Android/Vega serial, <flag:macos-apps>Mac app id (`macos-app-<bundle id>`), </flag:macos-apps>or Chromium id (`chromium-cdp-<port>`). Reuse this same id on subsequent `debugger-*` calls (or pass the error's `logicalDeviceId` if shared Metro is ambiguous)."
|
|
@@ -146275,7 +146690,7 @@ var debuggerConnectTool = {
|
|
|
146275
146690
|
description: `Connect to an app's JS debugger (React Native via Metro, or Chromium CDP) and start capturing console logs; reuses existing connections.<flag:macos-apps> Mac apps need a Debug build loading JS from Metro (react-native-macos 0.76+ or Mac Catalyst launched via Argent).</flag:macos-apps>
|
|
146276
146691
|
Use when starting a debug session or before other \`debugger-*\` tools (keep the same \`device_id\`; retry with \`logicalDeviceId\` only if shared Metro reports ambiguity<flag:macos-apps>; Mac apps always keep the Mac app id</flag:macos-apps>).
|
|
146277
146692
|
Returns connection info (plus \`note\` with prior log path after a crash). Fails if the runtime is unreachable.`,
|
|
146278
|
-
zodSchema:
|
|
146693
|
+
zodSchema: zodSchema34,
|
|
146279
146694
|
interaction: {
|
|
146280
146695
|
startedMsg: () => "Connecting JavaScript debugger",
|
|
146281
146696
|
completedMsg: ({ result }) => `Connected JavaScript debugger to ${result.appName || result.deviceName}`,
|
|
@@ -146307,7 +146722,7 @@ Returns connection info (plus \`note\` with prior log path after a crash). Fails
|
|
|
146307
146722
|
// ../tool-server/src/tools/debugger/debugger-status.ts
|
|
146308
146723
|
init_zod();
|
|
146309
146724
|
init_device_info();
|
|
146310
|
-
var
|
|
146725
|
+
var zodSchema35 = external_exports.object({
|
|
146311
146726
|
port: metroPortField,
|
|
146312
146727
|
device_id: external_exports.string().describe(
|
|
146313
146728
|
"Device id from `debugger-connect`<flag:macos-apps> (macOS: Mac app id)</flag:macos-apps>."
|
|
@@ -146319,7 +146734,7 @@ function createDebuggerStatusTool(registry2) {
|
|
|
146319
146734
|
description: `Check JS runtime debugger connectivity and diagnostics.
|
|
146320
146735
|
Use when verifying debugger health before other \`debugger-*\` tools.
|
|
146321
146736
|
Returns \`{ status: "connected", port, projectRoot, deviceName, appName, logicalDeviceId, isNewDebugger, loadedScripts, sourceMapReady }\` or \`{ status: "not_connected", reason, detail, guidance }\` (follow \`guidance\`; don't retry in a loop). Never fails when the runtime is simply unreachable.`,
|
|
146322
|
-
zodSchema:
|
|
146737
|
+
zodSchema: zodSchema35,
|
|
146323
146738
|
readOnly: true,
|
|
146324
146739
|
interaction: {
|
|
146325
146740
|
startedMsg: () => "Checking JavaScript debugger",
|
|
@@ -146412,7 +146827,7 @@ function guardModuleLoadErrors(expression) {
|
|
|
146412
146827
|
}
|
|
146413
146828
|
|
|
146414
146829
|
// ../tool-server/src/tools/debugger/debugger-evaluate.ts
|
|
146415
|
-
var
|
|
146830
|
+
var zodSchema36 = external_exports.object({
|
|
146416
146831
|
port: metroPortField,
|
|
146417
146832
|
device_id: external_exports.string().describe(
|
|
146418
146833
|
"Device id from `debugger-connect`<flag:macos-apps> (macOS: Mac app id)</flag:macos-apps>."
|
|
@@ -146424,7 +146839,7 @@ var debuggerEvaluateTool = {
|
|
|
146424
146839
|
description: `Run JavaScript in the app runtime (Hermes on React Native/Vega<flag:macos-apps>/Mac apps</flag:macos-apps>; V8 on Chromium; awaits Promises).
|
|
146425
146840
|
Use when inspecting runtime state (e.g. localStorage/sessionStorage on Chromium) or calling app functions.
|
|
146426
146841
|
Returns \`{ result, deviceName, appName, logicalDeviceId }\` (JSON-serialized; cyclic objects fail). Fails if disconnected or the expression throws.`,
|
|
146427
|
-
zodSchema:
|
|
146842
|
+
zodSchema: zodSchema36,
|
|
146428
146843
|
searchHint: "javascript js eval expression runtime app state localstorage sessionstorage web storage",
|
|
146429
146844
|
interaction: {
|
|
146430
146845
|
startedMsg: () => "Running JavaScript in the app",
|
|
@@ -146469,7 +146884,7 @@ Returns \`{ result, deviceName, appName, logicalDeviceId }\` (JSON-serialized; c
|
|
|
146469
146884
|
init_zod();
|
|
146470
146885
|
init_device_info();
|
|
146471
146886
|
init_src2();
|
|
146472
|
-
var
|
|
146887
|
+
var zodSchema37 = external_exports.object({
|
|
146473
146888
|
port: metroPortField,
|
|
146474
146889
|
device_id: external_exports.string().describe(
|
|
146475
146890
|
"Device id used with debugger-connect<flag:macos-apps>. For macOS, use the Mac app id</flag:macos-apps>."
|
|
@@ -146479,7 +146894,7 @@ var debuggerReloadMetroTool = {
|
|
|
146479
146894
|
id: "debugger-reload-metro",
|
|
146480
146895
|
description: `Restart the Metro JS bundle in the connected React Native app without restarting the native process.
|
|
146481
146896
|
Use when you want to apply code changes or reset JS state. Returns { reloaded, port, method (cdp or http), deviceName, appName, logicalDeviceId }. Fails if Metro is not running on the given port.<flag:macos-apps> A Mac app reload targets only that app. If it fails, restart the app. A shared Metro reload would also reload other apps.</flag:macos-apps>`,
|
|
146482
|
-
zodSchema:
|
|
146897
|
+
zodSchema: zodSchema37,
|
|
146483
146898
|
interaction: {
|
|
146484
146899
|
startedMsg: () => "Reloading the app through Metro",
|
|
146485
146900
|
completedMsg: () => "Reloaded the app through Metro",
|
|
@@ -147360,7 +147775,7 @@ function buildTextTree(data, opts) {
|
|
|
147360
147775
|
}
|
|
147361
147776
|
return lines.join("\n");
|
|
147362
147777
|
}
|
|
147363
|
-
var
|
|
147778
|
+
var zodSchema38 = external_exports.object({
|
|
147364
147779
|
port: metroPortField,
|
|
147365
147780
|
device_id: external_exports.string().describe(
|
|
147366
147781
|
"Device id from `debugger-connect`<flag:macos-apps> (macOS: Mac app id)</flag:macos-apps>."
|
|
@@ -147375,7 +147790,7 @@ function createDebuggerComponentTreeTool() {
|
|
|
147375
147790
|
description: `Fetch a compact React Native component tree with text/accessibilityLabel, \`[testID=\u2026]\`, and normalized \`(tap: x,y)\`<flag:macos-apps> (Mac app window incl. title bar)</flag:macos-apps>.
|
|
147376
147791
|
Use when you need React component names/nesting or missing Android \`testID\`s (use \`describe\` for tap targets; verify pruned wrappers with \`debugger-inspect-element\`).
|
|
147377
147792
|
Returns a text tree. Fails if the Metro debugger is disconnected.<flag:macos-apps> Mac apps: uses the root with the most components; on Paper, use \`describe\` for tap points.</flag:macos-apps>`,
|
|
147378
|
-
zodSchema:
|
|
147793
|
+
zodSchema: zodSchema38,
|
|
147379
147794
|
searchHint: "react native component tree testID testIDs selector component names hierarchy",
|
|
147380
147795
|
readOnly: true,
|
|
147381
147796
|
interaction: {
|
|
@@ -147915,7 +148330,7 @@ function filterInspectItems(items, includeSkipped = false) {
|
|
|
147915
148330
|
}
|
|
147916
148331
|
return result;
|
|
147917
148332
|
}
|
|
147918
|
-
var
|
|
148333
|
+
var zodSchema39 = external_exports.object({
|
|
147919
148334
|
port: metroPortField,
|
|
147920
148335
|
device_id: external_exports.string().describe(
|
|
147921
148336
|
"Device id from `debugger-connect`<flag:macos-apps> (macOS: Mac app id)</flag:macos-apps>."
|
|
@@ -147936,7 +148351,7 @@ var debuggerInspectElementTool = {
|
|
|
147936
148351
|
description: `Inspect the React component hierarchy at logical pixel (x, y), from the tapped leaf upward with source file:line and code snippets.
|
|
147937
148352
|
Use when finding the source file/line for a React Native element (multiply \`debugger-component-tree\` fractions by its Screen dimensions).
|
|
147938
148353
|
Returns \`{ x, y, items, truncated?, hiddenCount? }\`. Fails if disconnected or (x, y) is off-screen.<flag:macos-apps> Mac apps: uses the window root with the most components; on Paper, native views can offset hits.</flag:macos-apps>`,
|
|
147939
|
-
zodSchema:
|
|
148354
|
+
zodSchema: zodSchema39,
|
|
147940
148355
|
readOnly: true,
|
|
147941
148356
|
interaction: {
|
|
147942
148357
|
startedMsg: ({ params }) => `Inspecting element at (${params.x}, ${params.y})`,
|
|
@@ -148066,7 +148481,7 @@ var CONSOLE_LEVELS = [
|
|
|
148066
148481
|
"count",
|
|
148067
148482
|
"timeEnd"
|
|
148068
148483
|
];
|
|
148069
|
-
var
|
|
148484
|
+
var zodSchema40 = external_exports.object({
|
|
148070
148485
|
port: metroPortField,
|
|
148071
148486
|
device_id: external_exports.string().describe(
|
|
148072
148487
|
"Device id from `debugger-connect`<flag:macos-apps> (macOS: Mac app id)</flag:macos-apps>."
|
|
@@ -148080,7 +148495,7 @@ function createDebuggerLogRegistryTool(registry2) {
|
|
|
148080
148495
|
description: `Get a summary of JS console logs captured from React Native<flag:macos-apps> (including Mac apps)</flag:macos-apps> or Chromium, with newest \`entries\` inline (truncated to 300 chars).
|
|
148081
148496
|
Use when investigating warnings, errors, or console output. Check \`entries\` first; Grep \`file\` for older/full lines (never Read it whole; up to 50k lines). Use \`debugger-status\` to check connection health.
|
|
148082
148497
|
Returns \`{ status: "connected", file, entries, clusters, note? }\` (\`note\` flags missing/crashed prior sessions), or \`{ status: "not_connected", reason, guidance }\` (follow guidance; don't retry in a loop). Never fails when the runtime is simply unreachable.`,
|
|
148083
|
-
zodSchema:
|
|
148498
|
+
zodSchema: zodSchema40,
|
|
148084
148499
|
readOnly: true,
|
|
148085
148500
|
interaction: {
|
|
148086
148501
|
startedMsg: () => "Reading app logs",
|
|
@@ -148307,7 +148722,7 @@ function renderChromiumPage(records, pageIndexParam, redact2) {
|
|
|
148307
148722
|
|
|
148308
148723
|
${lines.join("\n")}`;
|
|
148309
148724
|
}
|
|
148310
|
-
var
|
|
148725
|
+
var zodSchema41 = external_exports.object({
|
|
148311
148726
|
port: metroPortField,
|
|
148312
148727
|
device_id: external_exports.string().describe(
|
|
148313
148728
|
"Device ID from `list-devices` (or `logicalDeviceId` if shared Metro capture used it)<flag:macos-apps>; Mac app: Mac app id `macos-app-<bundle id>`</flag:macos-apps>."
|
|
@@ -148321,7 +148736,7 @@ var networkLogsTool = {
|
|
|
148321
148736
|
description: `List captured JS HTTP requests (React Native) or active-tab requests (Chromium). Call \`network-capture-start\` first on iOS<flag:macos-apps>/Mac apps</flag:macos-apps>/Android (on Vega, reading starts capture). Use \`native-network-logs\` for native traffic.
|
|
148322
148737
|
Use when finding requests or comparing API calls (pass an ID to \`view-network-request-details\` for headers/bodies).
|
|
148323
148738
|
Returns a paginated list of request IDs, status, size, and timing. Fails if Chromium or the JS debugger is unreachable.`,
|
|
148324
|
-
zodSchema:
|
|
148739
|
+
zodSchema: zodSchema41,
|
|
148325
148740
|
readOnly: true,
|
|
148326
148741
|
interaction: {
|
|
148327
148742
|
startedMsg: () => "Reading network activity",
|
|
@@ -148490,7 +148905,7 @@ function truncatePostData(postData, truncated, redact2) {
|
|
|
148490
148905
|
return `${cutMarker(fullSize)}
|
|
148491
148906
|
${shownText(postData, MAX_BODY_SIZE, redact2)}...`;
|
|
148492
148907
|
}
|
|
148493
|
-
var
|
|
148908
|
+
var zodSchema42 = external_exports.object({
|
|
148494
148909
|
port: metroPortField,
|
|
148495
148910
|
device_id: external_exports.string().describe(
|
|
148496
148911
|
"Device ID for the log (or `logicalDeviceId` if JS capture used it)<flag:macos-apps>; Mac app: Mac app id</flag:macos-apps>."
|
|
@@ -148505,7 +148920,7 @@ var networkRequestTool = {
|
|
|
148505
148920
|
description: `Read full details (status, timing, redacted headers, and bodies truncated to 1000 chars) for one captured HTTP request ID. Secret values exposed to Argent show as their {{secret:NAME}} placeholders; other credentials do not.
|
|
148506
148921
|
Use when inspecting payloads or headers of a request from a network log or \`await-network-request\`.
|
|
148507
148922
|
Returns request/response details, or a not-found message (refresh the log after JS reloads). Fails if the backing debugger/CDP target is unreachable.`,
|
|
148508
|
-
zodSchema:
|
|
148923
|
+
zodSchema: zodSchema42,
|
|
148509
148924
|
readOnly: true,
|
|
148510
148925
|
interaction: {
|
|
148511
148926
|
startedMsg: ({ params }) => `Reading network request ${params.requestId}`,
|
|
@@ -150083,7 +150498,7 @@ function makeDescribeExecute(registry2) {
|
|
|
150083
150498
|
}
|
|
150084
150499
|
});
|
|
150085
150500
|
}
|
|
150086
|
-
var
|
|
150501
|
+
var zodSchema43 = external_exports.object({
|
|
150087
150502
|
udid: external_exports.string().min(1).describe("Target device id from `list-devices`."),
|
|
150088
150503
|
bundleId: external_exports.string().optional().describe(
|
|
150089
150504
|
"iOS simulator only: fallback bundle id when AX-service returns empty (auto-detects frontmost if omitted)."
|
|
@@ -150101,7 +150516,7 @@ function createDescribeTool(registry2) {
|
|
|
150101
150516
|
Use when you need tap coordinates or labels and have no fresh tree: interaction tools already attach one after each action (or reference an earlier \`Tree id\`).
|
|
150102
150517
|
Returns \`{ description, source, hint? }\`: one line per element with role, label/value/id/hint, flags, and normalized \`[0,1]\` frame \`(x,y,w,h)\`, and \`tap=(x,y)\` where the center misses the control. Tap at \`tap\` when present, else at \`(x+w/2, y+h/2)\`. No z-order/occlusion info; check a screenshot if a tap hits an overlay or a text field shows its placeholder as value. Fails if the tree backend is unreachable.
|
|
150103
150518
|
For UIKit view properties (iOS sim) use \`native-find-views\`; for React Native components/testIDs use \`debugger-component-tree\`.`,
|
|
150104
|
-
zodSchema:
|
|
150519
|
+
zodSchema: zodSchema43,
|
|
150105
150520
|
alwaysLoad: true,
|
|
150106
150521
|
searchHint: "accessibility element tree ui hierarchy tap coordinates ios android chromium vega <flag:harmonyos>harmony harmonyos </flag:harmonyos><flag:macos-apps>macos mac app </flag:macos-apps>dom tv tvos apple tv android tv fire tv focus focusable remote dpad",
|
|
150107
150522
|
readOnly: true,
|
|
@@ -150439,7 +150854,7 @@ var capability28 = {
|
|
|
150439
150854
|
appleRemote: { simulator: true },
|
|
150440
150855
|
android: { emulator: true, device: true, unknown: true }
|
|
150441
150856
|
};
|
|
150442
|
-
var
|
|
150857
|
+
var zodSchema44 = external_exports.object({
|
|
150443
150858
|
udid: external_exports.string().min(1).describe("Target device id from `list-devices`.")
|
|
150444
150859
|
});
|
|
150445
150860
|
function createUiTreeTool(registry2) {
|
|
@@ -150449,7 +150864,7 @@ function createUiTreeTool(registry2) {
|
|
|
150449
150864
|
Use when a program needs element ancestry, such as an e2e engine's scoped selectors; agents use describe.
|
|
150450
150865
|
Returns { schemaVersion, roots, truncated, alertVisible, keyboardVisible, foregroundApp, unsupportedFields }.
|
|
150451
150866
|
Fails if the iOS ax-service predates the tree command; update argent.`,
|
|
150452
|
-
zodSchema:
|
|
150867
|
+
zodSchema: zodSchema44,
|
|
150453
150868
|
readOnly: true,
|
|
150454
150869
|
hideFromMcp: true,
|
|
150455
150870
|
interaction: {
|
|
@@ -150511,7 +150926,7 @@ async function readAndroidForegroundApp(registry2, device) {
|
|
|
150511
150926
|
const tree = adaptAndroidTree({ ...capture, truncated: false }, size);
|
|
150512
150927
|
return { bundleId: tree.foregroundApp, alertVisible: tree.alertVisible };
|
|
150513
150928
|
}
|
|
150514
|
-
var
|
|
150929
|
+
var zodSchema45 = external_exports.object({
|
|
150515
150930
|
udid: external_exports.string().min(1).describe("Target device id from `list-devices`.")
|
|
150516
150931
|
});
|
|
150517
150932
|
function createForegroundAppTool(registry2) {
|
|
@@ -150520,7 +150935,7 @@ function createForegroundAppTool(registry2) {
|
|
|
150520
150935
|
description: `Read which app is in front, for SDK callers.
|
|
150521
150936
|
Returns { bundleId, name, alertVisible }; under a system alert, bundleId is the app it covers.
|
|
150522
150937
|
A field is unset when it is unknown.`,
|
|
150523
|
-
zodSchema:
|
|
150938
|
+
zodSchema: zodSchema45,
|
|
150524
150939
|
readOnly: true,
|
|
150525
150940
|
hideFromMcp: true,
|
|
150526
150941
|
interaction: {
|
|
@@ -150564,7 +150979,7 @@ var capability30 = {
|
|
|
150564
150979
|
android: { emulator: true, device: true, unknown: true },
|
|
150565
150980
|
chromium: { app: true }
|
|
150566
150981
|
};
|
|
150567
|
-
var
|
|
150982
|
+
var zodSchema46 = external_exports.object({
|
|
150568
150983
|
udid: external_exports.string().min(1).describe("Target device id from `list-devices`."),
|
|
150569
150984
|
text: external_exports.string().describe(
|
|
150570
150985
|
'The text the focused field must hold afterwards; "" clears it. Supports `{{secret:<NAME>}}` placeholders like `keyboard`.'
|
|
@@ -150617,7 +151032,7 @@ function createFillTool(registry2) {
|
|
|
150617
151032
|
description: `Set the text of the focused text field to exactly \`text\`, replacing what it holds; "" clears it. Tap the field first.
|
|
150618
151033
|
Returns { verified }, never the text: true when the field was read back holding the text, false on a physical iPhone, where nothing can read it back.
|
|
150619
151034
|
Fails with FILL_NO_FOCUSED_FIELD when nothing editable has focus, FILL_NOT_VERIFIED when the field does not read back the text or the device does not answer in time, FILL_UNSUPPORTED_FIELD for a field that cannot take the text (a date or time input, a newline in a single-line field; on Chromium also text over the field's maxlength, text a number input does not hold as a number, whitespace around an email address, or focus in a cross-origin frame, a closed shadow root or an <embed>; nothing is changed). Fails if the device's ax-service or devtools helper predates fill; update argent. Not supported on TV targets or Vega.`,
|
|
150620
|
-
zodSchema:
|
|
151035
|
+
zodSchema: zodSchema46,
|
|
150621
151036
|
hideFromMcp: true,
|
|
150622
151037
|
interaction: {
|
|
150623
151038
|
// Never quote `text`: it may be a credential, and these messages reach
|
|
@@ -151202,7 +151617,7 @@ function jwtPayload(token) {
|
|
|
151202
151617
|
return { ok: false, why: "is not a JWT: its payload is not base64url" };
|
|
151203
151618
|
}
|
|
151204
151619
|
try {
|
|
151205
|
-
const payload =
|
|
151620
|
+
const payload = parseJson2(Buffer.from(parts2[1], "base64url").toString("utf8"));
|
|
151206
151621
|
if (payload === null || typeof payload !== "object" || Array.isArray(payload)) {
|
|
151207
151622
|
return { ok: false, why: "is not a JWT: its payload is not a JSON object" };
|
|
151208
151623
|
}
|
|
@@ -151211,7 +151626,7 @@ function jwtPayload(token) {
|
|
|
151211
151626
|
return { ok: false, why: "is not a JWT: its payload is not JSON" };
|
|
151212
151627
|
}
|
|
151213
151628
|
}
|
|
151214
|
-
function
|
|
151629
|
+
function parseJson2(text) {
|
|
151215
151630
|
const keepDigits = (_key, value, context2) => typeof value === "number" && context2?.source !== void 0 && /^-?\d+$/.test(context2.source) && String(value) !== context2.source ? context2.source : value;
|
|
151216
151631
|
return JSON.parse(text, keepDigits);
|
|
151217
151632
|
}
|
|
@@ -151240,7 +151655,7 @@ function checkValue(check4, source, label) {
|
|
|
151240
151655
|
} else if (check4.path !== void 0) {
|
|
151241
151656
|
let json2;
|
|
151242
151657
|
try {
|
|
151243
|
-
json2 =
|
|
151658
|
+
json2 = parseJson2(source.text);
|
|
151244
151659
|
hit = lookupPath(json2, check4.path, label);
|
|
151245
151660
|
at = `${label}.${check4.path}`;
|
|
151246
151661
|
} catch {
|
|
@@ -151376,7 +151791,7 @@ var MIN_JS_READ_MS = 1e3;
|
|
|
151376
151791
|
var BODY_READ_GRACE_MS = 1e3;
|
|
151377
151792
|
var MAX_BODY_READ_MS = 1e4;
|
|
151378
151793
|
var SHOWN_VALUE_CHARS = 200;
|
|
151379
|
-
var
|
|
151794
|
+
var zodSchema47 = external_exports.object({
|
|
151380
151795
|
udid: external_exports.string().min(1).describe("Device ID used in `network-capture-start`."),
|
|
151381
151796
|
bundleId: external_exports.string().regex(BUNDLE_ID_PATTERN, BUNDLE_ID_MESSAGE).describe(
|
|
151382
151797
|
"`bundleId` used in `network-capture-start` (Chromium: placeholder like `argent.capture`)."
|
|
@@ -151447,7 +151862,7 @@ function createAwaitNetworkRequestTool(registry2) {
|
|
|
151447
151862
|
id: "await-network-request",
|
|
151448
151863
|
description: `Wait for an HTTP request or check for no match with \`absent: true\`. Requires a \`network-capture-start\` window for the target. Unavailable on physical iPhones and Vega. On Chromium, match the final URL and method after redirects.
|
|
151449
151864
|
Pass \`match.id\` to \`view-network-request-details\`. \`values\` shows previews of matched values and redacts sensitive headers. A header claim check can show the claim. Check \`cause\` and \`note\` on failure. \`success: false\` fails an e2e step and stops \`run-sequence\`.`,
|
|
151450
|
-
zodSchema:
|
|
151865
|
+
zodSchema: zodSchema47,
|
|
151451
151866
|
searchHint: "wait await network request http api call fetch xhr response status url match after capture start e2e assert",
|
|
151452
151867
|
readOnly: true,
|
|
151453
151868
|
longRunning: true,
|
|
@@ -151892,7 +152307,7 @@ async function splashScreenShowing(serial) {
|
|
|
151892
152307
|
return false;
|
|
151893
152308
|
}
|
|
151894
152309
|
}
|
|
151895
|
-
var
|
|
152310
|
+
var zodSchema48 = external_exports.object({
|
|
151896
152311
|
udid: external_exports.string().min(1).describe(
|
|
151897
152312
|
"Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, <flag:harmonyos>HarmonyOS id, </flag:harmonyos><flag:macos-apps>Mac app id, </flag:macos-apps>or Chromium id)."
|
|
151898
152313
|
),
|
|
@@ -151932,7 +152347,7 @@ function createAwaitScreenIdleTool(registry2) {
|
|
|
151932
152347
|
description: `Block until the screen has rendered content and held it for minStableMs, or the timeout elapses. It polls the same element tree as \`describe\`.
|
|
151933
152348
|
Use when a launch or navigation must finish rendering before a screenshot or tap.
|
|
151934
152349
|
Returns { settled, waitedMs, polls, launching?, note? }. If that is not seen before timeoutMs, it returns settled=false instead of failing. On Android, launching=true (and settled=false) means an app's splash screen was still showing.<flag:harmonyos> A note on settled=true means the screen it settled on is not live: a suspended HarmonyOS panel settles instantly on its last frame, and taps land nowhere until it is woken.</flag:harmonyos>`,
|
|
151935
|
-
zodSchema:
|
|
152350
|
+
zodSchema: zodSchema48,
|
|
151936
152351
|
searchHint: "wait until screen settles idle stable stops changing animation transition rendered ready before screenshot",
|
|
151937
152352
|
readOnly: true,
|
|
151938
152353
|
interaction: {
|
|
@@ -152185,7 +152600,7 @@ function safeGetState(registry2, urn) {
|
|
|
152185
152600
|
return null;
|
|
152186
152601
|
}
|
|
152187
152602
|
}
|
|
152188
|
-
var
|
|
152603
|
+
var zodSchema49 = external_exports.object({
|
|
152189
152604
|
port: metroPortField,
|
|
152190
152605
|
device_id: external_exports.string().describe(
|
|
152191
152606
|
"Device ID from list-devices<flag:macos-apps>, including a Mac app ID</flag:macos-apps> (or `logicalDeviceId` on shared Metro if requested)."
|
|
@@ -152199,7 +152614,7 @@ function createReactProfilerStartTool(registry2) {
|
|
|
152199
152614
|
description: `Start recording Hermes CPU samples and React commits. Use when profiling React Native performance (pair with \`native-profiler-start\` in parallel on iOS/Android<flag:macos-apps>/Mac apps</flag:macos-apps>, then stop with \`react-profiler-stop\`).<flag:macos-apps> Mac apps need a Debug build loading JS from Metro (react-native-macos 0.76+ or Mac Catalyst); connects without debugger-connect.</flag:macos-apps>
|
|
152200
152615
|
Returns \`{ started_at, startedAtEpochMs, hermes_version, detected_architecture }\` or \`{ already_running: true, mine, owner, \u2026 }\` (ask approval before \`force: true\`). On iOS and Android, a warning names the apps with native network capture on.
|
|
152201
152616
|
Fails if Hermes or Metro CDP is unreachable.`,
|
|
152202
|
-
zodSchema:
|
|
152617
|
+
zodSchema: zodSchema49,
|
|
152203
152618
|
interaction: {
|
|
152204
152619
|
startedMsg: () => "Starting React profiler",
|
|
152205
152620
|
completedMsg: ({ result }) => result.already_running ? "React profiler was already running" : "Started React profiler",
|
|
@@ -153266,7 +153681,7 @@ function stopInProgressError() {
|
|
|
153266
153681
|
error_kind: "not_found"
|
|
153267
153682
|
});
|
|
153268
153683
|
}
|
|
153269
|
-
var
|
|
153684
|
+
var zodSchema50 = external_exports.object({
|
|
153270
153685
|
port: metroPortField,
|
|
153271
153686
|
device_id: external_exports.string().describe(
|
|
153272
153687
|
"Device ID passed to react-profiler-start<flag:macos-apps>. For a Mac app, use its ID from list-devices</flag:macos-apps>."
|
|
@@ -153278,7 +153693,7 @@ function createReactProfilerStopTool(registry2) {
|
|
|
153278
153693
|
description: `Stop React profiling and store CPU samples + commit tree for \`react-profiler-analyze\`, \`profiler-commit-query\`, and \`profiler-cpu-query\`.
|
|
153279
153694
|
Use when finishing an interaction recorded after \`react-profiler-start\`.
|
|
153280
153695
|
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, unattributed_*? }\`. Fails if no active session exists, CDP disconnected, or another session took over.`,
|
|
153281
|
-
zodSchema:
|
|
153696
|
+
zodSchema: zodSchema50,
|
|
153282
153697
|
// Collection can outlast the MCP client's 30 s abort. The client would then
|
|
153283
153698
|
// resend the call, and the resend fails on the stop still collecting.
|
|
153284
153699
|
longRunning: true,
|
|
@@ -153573,7 +153988,7 @@ Returns \`{ duration_ms, sample_count, fiber_renders_captured, total_react_commi
|
|
|
153573
153988
|
|
|
153574
153989
|
// ../tool-server/src/tools/profiler/react/react-profiler-status.ts
|
|
153575
153990
|
init_zod();
|
|
153576
|
-
var
|
|
153991
|
+
var zodSchema51 = external_exports.object({
|
|
153577
153992
|
port: metroPortField,
|
|
153578
153993
|
device_id: external_exports.string().describe(
|
|
153579
153994
|
"Device ID of the app to inspect<flag:macos-apps>. For a Mac app, use its ID from list-devices</flag:macos-apps>. During a recording, use the ID passed to react-profiler-start."
|
|
@@ -153591,7 +154006,7 @@ function createReactProfilerStatusTool(registry2) {
|
|
|
153591
154006
|
return {
|
|
153592
154007
|
id: "react-profiler-status",
|
|
153593
154008
|
description: `Check whether a React recording is running, saved, lost, or taken over. Use after an interruption to decide whether to collect the recording or start again. If the runtime is unavailable, session_status is no_react_runtime and note gives the reason.`,
|
|
153594
|
-
zodSchema:
|
|
154009
|
+
zodSchema: zodSchema51,
|
|
153595
154010
|
readOnly: true,
|
|
153596
154011
|
interaction: {
|
|
153597
154012
|
startedMsg: () => "Checking React profiler",
|
|
@@ -155268,7 +155683,7 @@ var annotationSchema = external_exports.object({
|
|
|
155268
155683
|
offsetMs: external_exports.coerce.number().describe("Ms since profiling started (`tapTimestampMs - startedAtEpochMs`)."),
|
|
155269
155684
|
label: external_exports.string().describe("Action label.")
|
|
155270
155685
|
});
|
|
155271
|
-
var
|
|
155686
|
+
var zodSchema52 = external_exports.object({
|
|
155272
155687
|
port: metroPortField,
|
|
155273
155688
|
device_id: external_exports.string().describe(
|
|
155274
155689
|
"Device ID from list-devices used for the profile<flag:macos-apps> (Mac app: its list-devices ID)</flag:macos-apps>."
|
|
@@ -155283,7 +155698,7 @@ var reactProfilerAnalyzeTool = {
|
|
|
155283
155698
|
description: `Analyze stored React profiling data into a markdown report of hot commits (\u226516ms), render cascades, root causes, and top components.
|
|
155284
155699
|
Use when \`react-profiler-stop\` has finished and you want to interpret the profile (drill down further with \`profiler-cpu-query\` / \`profiler-commit-query\`).
|
|
155285
155700
|
Returns \`{ report, reportFile, hotCommitsTotal, hotCommitsShown, sessionFiles }\`. Fails if no profiling data is stored.`,
|
|
155286
|
-
zodSchema:
|
|
155701
|
+
zodSchema: zodSchema52,
|
|
155287
155702
|
interaction: {
|
|
155288
155703
|
startedMsg: () => "Analyzing React profile",
|
|
155289
155704
|
completedMsg: () => "Analyzed React profile",
|
|
@@ -155468,7 +155883,7 @@ var import_fs6 = require("fs");
|
|
|
155468
155883
|
var fileInputs = [
|
|
155469
155884
|
{ target: "project_root", path: "${project_root}", kind: "directory" }
|
|
155470
155885
|
];
|
|
155471
|
-
var
|
|
155886
|
+
var zodSchema53 = external_exports.object({
|
|
155472
155887
|
component_name: external_exports.string().describe("Name of the React component to look up"),
|
|
155473
155888
|
project_root: external_exports.string().describe("Absolute path to the RN project root")
|
|
155474
155889
|
});
|
|
@@ -155478,7 +155893,7 @@ var reactProfilerComponentSourceTool = {
|
|
|
155478
155893
|
Call this per-finding after react-profiler-analyze to inspect source before proposing a fix.
|
|
155479
155894
|
Returns found: false if the component is not found in user-owned code (e.g. lives in node_modules).
|
|
155480
155895
|
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.`,
|
|
155481
|
-
zodSchema:
|
|
155896
|
+
zodSchema: zodSchema53,
|
|
155482
155897
|
readOnly: true,
|
|
155483
155898
|
// react-profiler-analyze runs the same AST lookup for each component in its
|
|
155484
155899
|
// table (file, line and other matches) and adds the source of the located ones
|
|
@@ -155605,7 +156020,7 @@ function renderMarkdownTable(entries) {
|
|
|
155605
156020
|
);
|
|
155606
156021
|
return [header, sep12, ...rows].join("\n");
|
|
155607
156022
|
}
|
|
155608
|
-
var
|
|
156023
|
+
var zodSchema54 = external_exports.object({
|
|
155609
156024
|
port: metroPortField,
|
|
155610
156025
|
device_id: external_exports.string().describe(
|
|
155611
156026
|
"Device ID used to record or load the React profile<flag:macos-apps>. For a Mac app, use its ID from list-devices</flag:macos-apps>."
|
|
@@ -155620,7 +156035,7 @@ FOR DEDICATED CPU INVESTIGATION ONLY: do NOT call this as part of a normal profi
|
|
|
155620
156035
|
Use react-profiler-analyze instead; it covers all React rendering performance analysis.
|
|
155621
156036
|
Use when you specifically need to investigate JS CPU hotspots that are NOT tied to React rendering (e.g. regex slowness, cryptography, heavy computations).
|
|
155622
156037
|
Fails if react-profiler-stop has not been called or no CPU profile is stored.`,
|
|
155623
|
-
zodSchema:
|
|
156038
|
+
zodSchema: zodSchema54,
|
|
155624
156039
|
readOnly: true,
|
|
155625
156040
|
// Agents use profiler-cpu-query mode top_functions, which reads the same
|
|
155626
156041
|
// profile with per-sample intervals and idle filtered out, and has the same
|
|
@@ -155728,7 +156143,7 @@ function renderMarkdownTable2(entries) {
|
|
|
155728
156143
|
);
|
|
155729
156144
|
return [header, sep12, ...rows].join("\n");
|
|
155730
156145
|
}
|
|
155731
|
-
var
|
|
156146
|
+
var zodSchema55 = external_exports.object({
|
|
155732
156147
|
port: metroPortField,
|
|
155733
156148
|
device_id: external_exports.string().describe(
|
|
155734
156149
|
"Device ID of the app to inspect<flag:macos-apps>. For a Mac app, use its ID from list-devices</flag:macos-apps>. During a recording, use the ID passed to react-profiler-start."
|
|
@@ -155741,7 +156156,7 @@ var reactProfilerRendersTool = {
|
|
|
155741
156156
|
Returns a markdown table of the components with the longest total self render time. It reads the top 30 levels of the tree and does not count re-renders: record a profiling session for that.
|
|
155742
156157
|
Use when you want a quick look at what is mounted in a live connected app, without a profiling session.
|
|
155743
156158
|
Fails if the React DevTools hook is not present in the runtime or the app is not connected.`,
|
|
155744
|
-
zodSchema:
|
|
156159
|
+
zodSchema: zodSchema55,
|
|
155745
156160
|
readOnly: true,
|
|
155746
156161
|
// It walks only the top 30 fiber levels, above the screens of a real app
|
|
155747
156162
|
// (Bluesky's first feed item sits at depth 446), and counts mounts, not
|
|
@@ -155910,7 +156325,7 @@ function buildFiberTreeScript(maxDepth, filter) {
|
|
|
155910
156325
|
}
|
|
155911
156326
|
})()`;
|
|
155912
156327
|
}
|
|
155913
|
-
var
|
|
156328
|
+
var zodSchema56 = external_exports.object({
|
|
155914
156329
|
port: metroPortField,
|
|
155915
156330
|
device_id: external_exports.string().describe(
|
|
155916
156331
|
"Device ID of the app to inspect<flag:macos-apps>. For a Mac app, use its ID from list-devices</flag:macos-apps>. During a recording, use the ID passed to react-profiler-start."
|
|
@@ -155924,7 +156339,7 @@ var reactProfilerFiberTreeTool = {
|
|
|
155924
156339
|
Use when tracing the ancestry of a library component.
|
|
155925
156340
|
Returns a nested JSON tree of fiber nodes with name, tag, actualDuration, selfBaseDuration, and children.
|
|
155926
156341
|
Fails if the React DevTools hook is not present or no fiber roots have been committed yet.`,
|
|
155927
|
-
zodSchema:
|
|
156342
|
+
zodSchema: zodSchema56,
|
|
155928
156343
|
readOnly: true,
|
|
155929
156344
|
interaction: {
|
|
155930
156345
|
startedMsg: () => "Reading React fiber tree",
|
|
@@ -159193,7 +159608,10 @@ async function startPerfetto(opts) {
|
|
|
159193
159608
|
"-o",
|
|
159194
159609
|
onDeviceTracePath
|
|
159195
159610
|
];
|
|
159196
|
-
const child = (0, import_child_process7.spawn)(adbPath, adbArgv(args), {
|
|
159611
|
+
const child = (0, import_child_process7.spawn)(adbPath, adbArgv(args), {
|
|
159612
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
159613
|
+
windowsHide: true
|
|
159614
|
+
});
|
|
159197
159615
|
let stdout = "";
|
|
159198
159616
|
let stderr = "";
|
|
159199
159617
|
const pid = await new Promise((resolve24, reject) => {
|
|
@@ -160527,7 +160945,7 @@ var capability32 = {
|
|
|
160527
160945
|
android: { emulator: true, device: true, unknown: true },
|
|
160528
160946
|
macos: { app: true, catalyst: true }
|
|
160529
160947
|
};
|
|
160530
|
-
var
|
|
160948
|
+
var zodSchema57 = external_exports.object({
|
|
160531
160949
|
device_id: metroDeviceIdParam(
|
|
160532
160950
|
"Target device id from `list-devices` (iOS UDID<flag:macos-apps>, Mac app id</flag:macos-apps> or Android serial)."
|
|
160533
160951
|
),
|
|
@@ -160548,7 +160966,7 @@ var nativeProfilerStartTool = {
|
|
|
160548
160966
|
description: `Start native profiling: Instruments (CPU, hangs, leaks) on iOS<flag:macos-apps> and Mac apps</flag:macos-apps>, or Perfetto (CPU, jank, memory) on Android.
|
|
160549
160967
|
Use when profiling native performance. Launch the target app first, wait for this call to return before reproducing the scenario, then call \`native-profiler-stop\` while the app is still running.<flag:macos-apps> Mac apps need a dev-signed build launched via Argent (use "Time Profiler" if signing/WebKit blocks the bundled template, or set \`malloc_stack_logging: true\` for leak stacks).</flag:macos-apps>
|
|
160550
160968
|
Returns \`{ status: "recording", pid, traceFile, warning? }\` (warns on iOS/Android if native network capture is active). Fails if the app, xctrace, or adb is unavailable.`,
|
|
160551
|
-
zodSchema:
|
|
160969
|
+
zodSchema: zodSchema57,
|
|
160552
160970
|
interaction: {
|
|
160553
160971
|
startedMsg: () => "Starting native profiler",
|
|
160554
160972
|
completedMsg: () => "Started native profiler",
|
|
@@ -160615,7 +161033,7 @@ async function exportedFilesToArtifacts(store, files) {
|
|
|
160615
161033
|
function registerTrace(store, traceFile) {
|
|
160616
161034
|
return store.register({ hostPath: traceFile, kind: "native-profile-trace", archive: "tar.gz" });
|
|
160617
161035
|
}
|
|
160618
|
-
var
|
|
161036
|
+
var zodSchema58 = external_exports.object({
|
|
160619
161037
|
device_id: metroDeviceIdParam(
|
|
160620
161038
|
"Target device id from `list-devices` (iOS UDID<flag:macos-apps>, Mac app id</flag:macos-apps> or Android serial)."
|
|
160621
161039
|
)
|
|
@@ -160624,7 +161042,7 @@ var nativeProfilerStopTool = {
|
|
|
160624
161042
|
id: "native-profiler-stop",
|
|
160625
161043
|
description: `End a native profiling session started by native-profiler-start and save the trace as a downloadable artifact.
|
|
160626
161044
|
On iOS<flag:macos-apps> and Mac apps</flag:macos-apps>, export CPU, hangs, and leaks XML from Instruments. Check warning and exportDiagnostics for partial or skipped exports. On Android, save the Perfetto .pftrace.`,
|
|
160627
|
-
zodSchema:
|
|
161045
|
+
zodSchema: zodSchema58,
|
|
160628
161046
|
interaction: {
|
|
160629
161047
|
startedMsg: () => "Stopping native profiler",
|
|
160630
161048
|
completedMsg: ({ result }) => `Saved native profile ${result.traceFile.filename}`,
|
|
@@ -160673,7 +161091,7 @@ var capability34 = {
|
|
|
160673
161091
|
android: { emulator: true, device: true, unknown: true },
|
|
160674
161092
|
macos: { app: true, catalyst: true }
|
|
160675
161093
|
};
|
|
160676
|
-
var
|
|
161094
|
+
var zodSchema59 = external_exports.object({
|
|
160677
161095
|
device_id: metroDeviceIdParam(
|
|
160678
161096
|
"Target device id from `list-devices` (iOS UDID<flag:macos-apps>, Mac app id</flag:macos-apps> or Android serial)."
|
|
160679
161097
|
)
|
|
@@ -160683,7 +161101,7 @@ var nativeProfilerAnalyzeTool = {
|
|
|
160683
161101
|
description: `Summarize a native trace saved by native-profiler-stop or restored with profiler-load. Returns a Markdown report with severity and suggested next steps.
|
|
160684
161102
|
Instruments reports CPU hotspots, UI hangs, and memory leaks on iOS<flag:macos-apps> and Mac apps</flag:macos-apps>. Android reports also include jank reasons, main-thread state, garbage collection, and memory growth as a weak leak signal.
|
|
160685
161103
|
Use profiler-stack-query for details behind a finding.`,
|
|
160686
|
-
zodSchema:
|
|
161104
|
+
zodSchema: zodSchema59,
|
|
160687
161105
|
interaction: {
|
|
160688
161106
|
startedMsg: () => "Analyzing native profile",
|
|
160689
161107
|
completedMsg: () => "Analyzed native profile",
|
|
@@ -161279,7 +161697,7 @@ function optionalExportCrashNote(tables, xcodeVersion2, options = {}) {
|
|
|
161279
161697
|
// ../tool-server/src/tools/profiler/native-profiler/launch-analysis/measure.ts
|
|
161280
161698
|
var execFileAsync40 = (0, import_node_util41.promisify)(import_node_child_process51.execFile);
|
|
161281
161699
|
var LAUNCH_ITERATIONS = 5;
|
|
161282
|
-
async function measureLaunch(params, ctx) {
|
|
161700
|
+
async function measureLaunch(params, ctx, claimDevice) {
|
|
161283
161701
|
let release3;
|
|
161284
161702
|
try {
|
|
161285
161703
|
const context2 = await prepareLaunch(
|
|
@@ -161287,7 +161705,8 @@ async function measureLaunch(params, ctx) {
|
|
|
161287
161705
|
bundleId: params.bundle_id,
|
|
161288
161706
|
deviceId: params.device_id,
|
|
161289
161707
|
allowSimulator: params.allow_simulator,
|
|
161290
|
-
checkDevice: ({ id }) => {
|
|
161708
|
+
checkDevice: async ({ id }) => {
|
|
161709
|
+
await claimDevice?.(id);
|
|
161291
161710
|
release3 = reserveLaunchMeasurement(id);
|
|
161292
161711
|
}
|
|
161293
161712
|
},
|
|
@@ -161704,13 +162123,14 @@ async function writeProfilerSession(xml) {
|
|
|
161704
162123
|
var RECORD_TIMEOUT_MS = 18e4;
|
|
161705
162124
|
var ms2 = (ns) => Math.round(ns / 1e5) / 10;
|
|
161706
162125
|
var DEFAULT_PROFILE_SECONDS = 8;
|
|
161707
|
-
async function profileLaunch(params, ctx) {
|
|
162126
|
+
async function profileLaunch(params, ctx, claimDevice) {
|
|
161708
162127
|
const context2 = await prepareLaunch(
|
|
161709
162128
|
{
|
|
161710
162129
|
bundleId: params.bundle_id,
|
|
161711
162130
|
deviceId: params.device_id,
|
|
161712
162131
|
allowSimulator: params.allow_simulator,
|
|
161713
|
-
checkDevice: async ({ simulator }) => {
|
|
162132
|
+
checkDevice: async ({ id, simulator }) => {
|
|
162133
|
+
await claimDevice?.(id);
|
|
161714
162134
|
if (!simulator) return;
|
|
161715
162135
|
const version3 = await xcodeVersion();
|
|
161716
162136
|
if (stallsSimulatorLaunchRecording(parseXcodeVersion(version3))) {
|
|
@@ -161973,7 +162393,7 @@ var launchAnalysisMode = {
|
|
|
161973
162393
|
failed: "Failed to record iOS App Launch"
|
|
161974
162394
|
}
|
|
161975
162395
|
};
|
|
161976
|
-
var
|
|
162396
|
+
var zodSchema60 = external_exports.object({
|
|
161977
162397
|
mode: external_exports.enum(["measure", "profile"]).describe("`measure`: 5 XCTest timed launches. `profile`: 1 Instruments App Launch trace."),
|
|
161978
162398
|
bundle_id: external_exports.string().regex(BUNDLE_ID_PATTERN, BUNDLE_ID_MESSAGE).describe("Installed Release build bundle ID (not built or installed by this tool)."),
|
|
161979
162399
|
device_id: external_exports.string().optional().describe("iPhone UDID (or booted simulator UDID with `allow_simulator: true`)."),
|
|
@@ -162001,18 +162421,28 @@ var nativeProfilerLaunchAnalysisTool = {
|
|
|
162001
162421
|
description: `Profile or measure iOS app startup on an already-installed Release build (warms once, then measures).
|
|
162002
162422
|
Use when benchmarking launch time (\`measure\`: 5 XCTest launches incl. extended tasks; signed runner on iPhone) or profiling pre-first-frame CPU work (\`profile\`: Instruments App Launch trace; follow \`profilerSession.next\` with \`profiler-load\` + \`profiler-stack-query\`).
|
|
162003
162423
|
Returns \`samplesCollected\` (\`measure\`) or \`launchMs\` + \`profilerSession\` (\`profile\`). Fails if the app is not installed or no iPhone / allowed simulator is available.`,
|
|
162004
|
-
zodSchema:
|
|
162424
|
+
zodSchema: zodSchema60,
|
|
162005
162425
|
services: () => ({}),
|
|
162006
162426
|
async execute(_services, params, ctx) {
|
|
162007
|
-
|
|
162008
|
-
|
|
162009
|
-
|
|
162010
|
-
|
|
162011
|
-
|
|
162012
|
-
|
|
162013
|
-
|
|
162014
|
-
|
|
162427
|
+
let endClaim = () => {
|
|
162428
|
+
};
|
|
162429
|
+
const claimDevice = async (deviceId) => {
|
|
162430
|
+
if (params.device_id === void 0)
|
|
162431
|
+
endClaim = await claimPickedDevice(ctx?.session, deviceId);
|
|
162432
|
+
};
|
|
162433
|
+
try {
|
|
162434
|
+
switch (params.mode) {
|
|
162435
|
+
case "measure":
|
|
162436
|
+
return await measureLaunch(params, ctx, claimDevice);
|
|
162437
|
+
case "profile":
|
|
162438
|
+
return await profileLaunch(params, ctx, claimDevice);
|
|
162439
|
+
default: {
|
|
162440
|
+
const mode = params.mode;
|
|
162441
|
+
throw new Error(`Unknown mode: ${String(mode)}`);
|
|
162442
|
+
}
|
|
162015
162443
|
}
|
|
162444
|
+
} finally {
|
|
162445
|
+
endClaim();
|
|
162016
162446
|
}
|
|
162017
162447
|
}
|
|
162018
162448
|
};
|
|
@@ -162702,7 +163132,7 @@ function resolveAudioSession(registry2, device) {
|
|
|
162702
163132
|
}
|
|
162703
163133
|
|
|
162704
163134
|
// ../tool-server/src/tools/audio/audio-input.ts
|
|
162705
|
-
var
|
|
163135
|
+
var zodSchema61 = external_exports.object({
|
|
162706
163136
|
udid: external_exports.string().describe("Target iOS Simulator UDID from `list-devices`."),
|
|
162707
163137
|
source: external_exports.enum(["file", "tone", "microphone"]).describe(
|
|
162708
163138
|
"`file` plays `path`, `tone` a sine wave, `microphone` restores the real microphone."
|
|
@@ -162730,7 +163160,7 @@ function createAudioInputTool(registry2) {
|
|
|
162730
163160
|
id: "audio-input",
|
|
162731
163161
|
description: `Set what apps in an iOS Simulator hear as microphone input: an audio file, a tone, or the real microphone.
|
|
162732
163162
|
A file starts playing on this call, so call it right before the action that makes the app record.`,
|
|
162733
|
-
zodSchema:
|
|
163163
|
+
zodSchema: zodSchema61,
|
|
162734
163164
|
searchHint: "audio microphone input mock fake inject voice speech sound file tone simulator mic",
|
|
162735
163165
|
interaction: {
|
|
162736
163166
|
startedMsg: ({ params }) => `Setting simulator audio input to ${params.source}`,
|
|
@@ -164666,7 +165096,7 @@ var capability35 = {
|
|
|
164666
165096
|
// argent's library records the app's window from inside the app.
|
|
164667
165097
|
macos: { app: true, catalyst: true }
|
|
164668
165098
|
};
|
|
164669
|
-
var
|
|
165099
|
+
var zodSchema62 = external_exports.object({
|
|
164670
165100
|
udid: external_exports.string().describe(
|
|
164671
165101
|
"Target ID from `list-devices`<flag:macos-apps> (Mac app: `macos-app-<bundle id>`)</flag:macos-apps>."
|
|
164672
165102
|
),
|
|
@@ -164682,7 +165112,7 @@ function createScreenRecordingStartTool(registry2) {
|
|
|
164682
165112
|
description: `Start an MP4 recording of the device screen<flag:macos-apps> or Mac app window</flag:macos-apps>. Use when capturing video of an interaction or animation (use \`screenshot\` for a still image).
|
|
164683
165113
|
Continues until \`screen-recording-stop\` or \`timeLimitSeconds\` (always retrieve via \`screen-recording-stop\`). Requires \`ffmpeg\` on simulators, Android, and wired iPhones (needs \`transportType: "wired"\` and camera access for \`ios-screen-stream\`). Unsupported on tvOS, Chromium<flag:harmonyos>, HarmonyOS</flag:harmonyos>, and Vega.<flag:macos-apps> Mac apps: needs a visible window on one display, no capture protection, no Screen Recording permission or ffmpeg; on \`MACOS_APP_LIBRARY_OUTDATED\`, run \`restart-app\` and retry.</flag:macos-apps>
|
|
164684
165114
|
Returns \`{ outputFile }\` on the tool-server host. Fails if target is unavailable or already recording.`,
|
|
164685
|
-
zodSchema:
|
|
165115
|
+
zodSchema: zodSchema62,
|
|
164686
165116
|
searchHint: "record video screen capture movie mp4 start filming screencast",
|
|
164687
165117
|
interaction: {
|
|
164688
165118
|
startedMsg: () => "Starting screen recording",
|
|
@@ -164826,7 +165256,7 @@ var capability36 = {
|
|
|
164826
165256
|
android: { emulator: true, device: true, unknown: true },
|
|
164827
165257
|
macos: { app: true, catalyst: true }
|
|
164828
165258
|
};
|
|
164829
|
-
var
|
|
165259
|
+
var zodSchema63 = external_exports.object({
|
|
164830
165260
|
udid: external_exports.string().describe(
|
|
164831
165261
|
"Target ID from `list-devices`.<flag:macos-apps> For a Mac app, use its device ID, such as `macos-app-com.example.notes`.</flag:macos-apps>"
|
|
164832
165262
|
)
|
|
@@ -164836,7 +165266,7 @@ var screenRecordingStopTool = {
|
|
|
164836
165266
|
description: `Stop a screen recording and retrieve its MP4. Call this even after the time limit or an early capture exit. The tool downloads recordings from remote simulators.
|
|
164837
165267
|
Returns the saved \`video\` and its \`durationMs\`. When trimming removes still sections, \`wallClockMs\` gives the original duration and \`trimmedMs\` gives the time removed. On a foldable simulator the video follows the active panel, keeps the first panel's size, and reports any \`panelSwitches\`.
|
|
164838
165268
|
Check \`warning\` for capture problems, such as an undetected foldable panel.<flag:macos-apps> On a Mac app, a warning can report when the video held its last frame or omitted a protected window. Quitting or restarting the app or connecting to it from another Argent tool-server during capture can discard the recording. A stop error can include a path to a recoverable video.</flag:macos-apps>`,
|
|
164839
|
-
zodSchema:
|
|
165269
|
+
zodSchema: zodSchema63,
|
|
164840
165270
|
searchHint: "stop end finish screen recording video capture save retrieve",
|
|
164841
165271
|
interaction: {
|
|
164842
165272
|
startedMsg: () => "Stopping screen recording",
|
|
@@ -165226,7 +165656,7 @@ var timeRangeSchema = external_exports.object({
|
|
|
165226
165656
|
start: external_exports.coerce.number().describe("Start ms."),
|
|
165227
165657
|
end: external_exports.coerce.number().describe("End ms.")
|
|
165228
165658
|
});
|
|
165229
|
-
var
|
|
165659
|
+
var zodSchema64 = external_exports.object({
|
|
165230
165660
|
port: metroPortField,
|
|
165231
165661
|
device_id: metroDeviceIdParam(
|
|
165232
165662
|
"Device ID used to record or load the React profile<flag:macos-apps>. For a Mac app, use its ID from list-devices</flag:macos-apps>."
|
|
@@ -165243,7 +165673,7 @@ var profilerCommitQueryTool = {
|
|
|
165243
165673
|
description: `Query React commit data by mode: \`by_component\`, \`by_time_range\`, \`by_index\` (full fiber dump), \`cascade_tree\` (parent\u2192child triggers), or \`render_counts\` (counts/rates across ALL commits, incl. <16ms).
|
|
165244
165674
|
Use when drilling into components, cascades, or time windows after \`react-profiler-analyze\`.
|
|
165245
165675
|
Returns a markdown table or tree. Fails if \`react-profiler-stop\` has not been called.`,
|
|
165246
|
-
zodSchema:
|
|
165676
|
+
zodSchema: zodSchema64,
|
|
165247
165677
|
readOnly: true,
|
|
165248
165678
|
interaction: {
|
|
165249
165679
|
startedMsg: ({ params }) => `Querying React commits ${params.mode.replace(/^by_/, "by ").replaceAll("_", " ")}`,
|
|
@@ -165679,7 +166109,7 @@ var timeWindowSchema = external_exports.object({
|
|
|
165679
166109
|
start: external_exports.coerce.number().describe("Start ms."),
|
|
165680
166110
|
end: external_exports.coerce.number().describe("End ms.")
|
|
165681
166111
|
});
|
|
165682
|
-
var
|
|
166112
|
+
var zodSchema65 = external_exports.object({
|
|
165683
166113
|
port: metroPortField,
|
|
165684
166114
|
device_id: metroDeviceIdParam(
|
|
165685
166115
|
"Device ID used to record or load the React profile<flag:macos-apps>. For a Mac app, use its ID from list-devices</flag:macos-apps>."
|
|
@@ -165697,7 +166127,7 @@ var profilerCpuQueryTool = {
|
|
|
165697
166127
|
description: `Query Hermes CPU samples by mode: \`top_functions\` (global hotspots, optional \`time_window_ms\`), \`time_window\` (breakdown during \`time_window_ms\`), \`call_tree\` (callees/callers for \`function_name\`), or \`component_cpu\` (CPU across \`component_name\` commits).
|
|
165698
166128
|
Use when drilling into JS CPU hotspots after \`react-profiler-analyze\`. Self-times measure sampled coverage per call path.
|
|
165699
166129
|
Returns a markdown table or call tree. Fails if no CPU profile is stored (run \`react-profiler-stop\` first).`,
|
|
165700
|
-
zodSchema:
|
|
166130
|
+
zodSchema: zodSchema65,
|
|
165701
166131
|
readOnly: true,
|
|
165702
166132
|
interaction: {
|
|
165703
166133
|
startedMsg: ({ params }) => `Querying CPU profile by ${params.mode.replaceAll("_", " ")}`,
|
|
@@ -166084,7 +166514,7 @@ async function executeAndroid(api, params) {
|
|
|
166084
166514
|
topN: params.top_n
|
|
166085
166515
|
});
|
|
166086
166516
|
}
|
|
166087
|
-
var
|
|
166517
|
+
var zodSchema66 = external_exports.object({
|
|
166088
166518
|
device_id: metroDeviceIdParam(
|
|
166089
166519
|
"Target device id from `list-devices` (iOS UDID<flag:macos-apps>, Mac app id</flag:macos-apps> or Android serial)."
|
|
166090
166520
|
),
|
|
@@ -166103,7 +166533,7 @@ var profilerStackQueryTool = {
|
|
|
166103
166533
|
description: `Query native profiler stacks after \`native-profiler-analyze\` or \`profiler-load\`: \`hang_stacks\` (by \`hang_index\`), \`function_callers\` (for \`function_name\`), \`thread_breakdown\`, or \`leak_stacks\` (iOS<flag:macos-apps>/Mac apps</flag:macos-apps>).
|
|
166104
166534
|
Use when drilling into native hangs, callers, threads, or leaks.
|
|
166105
166535
|
Returns a markdown breakdown. Fails if no native trace is loaded.`,
|
|
166106
|
-
zodSchema:
|
|
166536
|
+
zodSchema: zodSchema66,
|
|
166107
166537
|
readOnly: true,
|
|
166108
166538
|
interaction: {
|
|
166109
166539
|
startedMsg: ({ params }) => `Querying native stacks by ${stackQueryMode[params.mode]}`,
|
|
@@ -166181,7 +166611,7 @@ function buildPerfettoAnchor(wallClockStartMs) {
|
|
|
166181
166611
|
}
|
|
166182
166612
|
|
|
166183
166613
|
// ../tool-server/src/tools/profiler/combined/profiler-combined-report.ts
|
|
166184
|
-
var
|
|
166614
|
+
var zodSchema67 = external_exports.object({
|
|
166185
166615
|
port: metroPortField,
|
|
166186
166616
|
device_id: metroDeviceIdParam(
|
|
166187
166617
|
"Device ID from list-devices used for the native profile (iOS simulator UDID, Android serial<flag:macos-apps>, or Mac app ID</flag:macos-apps>)."
|
|
@@ -166194,7 +166624,7 @@ Maps native hangs to React commits using wall-clock time alignment.
|
|
|
166194
166624
|
Call this tool when both profilers were run in parallel on the same session.
|
|
166195
166625
|
Returns a markdown report correlating hangs with React commits, memory leaks, and investigation hints.
|
|
166196
166626
|
Fails if either react-profiler-analyze or native-profiler-analyze has not been called first, or if the session stored no React commits.`,
|
|
166197
|
-
zodSchema:
|
|
166627
|
+
zodSchema: zodSchema67,
|
|
166198
166628
|
readOnly: true,
|
|
166199
166629
|
interaction: {
|
|
166200
166630
|
startedMsg: () => "Building combined performance report",
|
|
@@ -166884,7 +167314,7 @@ var profilerLoadAction = {
|
|
|
166884
167314
|
failure: "load"
|
|
166885
167315
|
}
|
|
166886
167316
|
};
|
|
166887
|
-
var
|
|
167317
|
+
var zodSchema68 = external_exports.object({
|
|
166888
167318
|
mode: external_exports.enum(["list", "load_react", "load_native"]).describe("`list`, `load_react`, or `load_native`."),
|
|
166889
167319
|
session_id: external_exports.string().regex(SESSION_ID_PATTERN, "session_id may only contain letters, digits, '_' and '-'").optional().describe("Session ID from `list` (required for `load_*`)."),
|
|
166890
167320
|
port: metroPortField,
|
|
@@ -166896,7 +167326,7 @@ var profilerLoadTool = {
|
|
|
166896
167326
|
description: `List or restore saved React/native profiling sessions from disk into memory for \`profiler-*-query\` / \`react-profiler-analyze\` (\`load_react\` loads CPU+commits; \`load_native\` loads xctrace on iOS<flag:macos-apps>/Mac apps</flag:macos-apps> or \`.pftrace\` on Android).
|
|
166897
167327
|
Use when revisiting past sessions without re-recording (replaces the in-memory session for \`device_id\` without deleting disk files).
|
|
166898
167328
|
Returns a session list or loaded summary. Fails if \`session_id\` or its files are missing.`,
|
|
166899
|
-
zodSchema:
|
|
167329
|
+
zodSchema: zodSchema68,
|
|
166900
167330
|
interaction: {
|
|
166901
167331
|
startedMsg: ({ params }) => profilerLoadAction[params.mode].started(params),
|
|
166902
167332
|
completedMsg: ({ params }) => profilerLoadAction[params.mode].completed(params),
|
|
@@ -167058,7 +167488,7 @@ function unnameableSessionUrns(urns) {
|
|
|
167058
167488
|
}
|
|
167059
167489
|
|
|
167060
167490
|
// ../tool-server/src/tools/simulator/stop-simulator-server.ts
|
|
167061
|
-
var
|
|
167491
|
+
var zodSchema69 = external_exports.object({
|
|
167062
167492
|
udid: external_exports.string().describe(
|
|
167063
167493
|
"Target device id (iOS UDID, Android serial, or Chromium id) whose transport session to stop"
|
|
167064
167494
|
)
|
|
@@ -167069,7 +167499,7 @@ function createStopSimulatorServerTool(registry2) {
|
|
|
167069
167499
|
description: `Stop the transport session for one device (simulator-server, physical iOS runner, Chromium CDP, or TV daemons).
|
|
167070
167500
|
Use when restarting a wedged transport or freeing one device without affecting others (not routinely after every task; use \`stop-all-simulator-servers\` with \`devices\` to also stop devtools/profilers/debuggers). On Chromium, also ends the JS debugger session.<flag:macos-apps> On Mac apps, also stops native capture (discarding records) and screen recording.</flag:macos-apps>
|
|
167071
167501
|
Returns \`{ stopped, udid }\` (\`stopped: false\` if none was running). Fails only on invalid input.`,
|
|
167072
|
-
zodSchema:
|
|
167502
|
+
zodSchema: zodSchema69,
|
|
167073
167503
|
interaction: {
|
|
167074
167504
|
startedMsg: ({ params }) => `Stopping simulator server for ${params.udid}`,
|
|
167075
167505
|
completedMsg: ({ params }) => `Stopped simulator server for ${params.udid}`,
|
|
@@ -167104,7 +167534,7 @@ Returns \`{ stopped, udid }\` (\`stopped: false\` if none was running). Fails on
|
|
|
167104
167534
|
// ../tool-server/src/tools/simulator/stop-all-simulator-servers.ts
|
|
167105
167535
|
init_zod();
|
|
167106
167536
|
init_src2();
|
|
167107
|
-
var
|
|
167537
|
+
var zodSchema70 = external_exports.object({
|
|
167108
167538
|
devices: external_exports.array(external_exports.string()).optional().describe(
|
|
167109
167539
|
"Ids of the devices THIS session used (iOS UDID / Android serial / Chromium id), to scope the teardown to."
|
|
167110
167540
|
)
|
|
@@ -167116,7 +167546,7 @@ function createStopAllSimulatorServersTool(registry2) {
|
|
|
167116
167546
|
Use when cleaning up or ending a session, or when a skill asks to recycle services \u2014 not routinely after every task (services are reused). Use \`network-capture-stop\` to stop network capture while keeping recorded requests.
|
|
167117
167547
|
Always pass \`devices\` with this session's device IDs (plus any \`logicalDeviceId\` used with \`debugger-connect\` on shared Metro) so other agents' devices aren't torn down; omit \`devices\` only for a machine-wide sweep. \`[]\` stops nothing.
|
|
167118
167548
|
Returns \`{ stopped, unmatched?, left_running?, aborted? }\` (\`left_running\` names unscoped debugger URNs; re-call with the id after \`<ns>:<port>:\` to reap them). Fails if unknown keys (e.g. \`udids\`) are passed.`,
|
|
167119
|
-
zodSchema:
|
|
167549
|
+
zodSchema: zodSchema70,
|
|
167120
167550
|
interaction: {
|
|
167121
167551
|
// "all" only holds for the unscoped sweep; a scoped call touches just the
|
|
167122
167552
|
// ids it was given.
|
|
@@ -167179,6 +167609,7 @@ Returns \`{ stopped, unmatched?, left_running?, aborted? }\` (\`left_running\` n
|
|
|
167179
167609
|
}
|
|
167180
167610
|
forgetJsCapturesOf(scoped ? devices2 : void 0, paused);
|
|
167181
167611
|
forgetNativeUnavailableOf(scoped ? devices2 : void 0);
|
|
167612
|
+
deviceClaims.endCaptures(scoped ? devices2 : void 0);
|
|
167182
167613
|
if (!scoped) return { stopped };
|
|
167183
167614
|
const seen = /* @__PURE__ */ new Set();
|
|
167184
167615
|
const unmatched = devices2.filter((id) => {
|
|
@@ -167283,7 +167714,8 @@ function listeningPids(port) {
|
|
|
167283
167714
|
timeout: 5e3,
|
|
167284
167715
|
// `netstat -ano` dumps every socket on the host; Node's default 1 MiB
|
|
167285
167716
|
// can overflow and fail the probe.
|
|
167286
|
-
maxBuffer: 16 * 1024 * 1024
|
|
167717
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
167718
|
+
windowsHide: true
|
|
167287
167719
|
});
|
|
167288
167720
|
return parseNetstatListeningPids(output3, port);
|
|
167289
167721
|
}
|
|
@@ -167320,13 +167752,13 @@ function listeningPids(port) {
|
|
|
167320
167752
|
}
|
|
167321
167753
|
return lines.map((s) => parseInt(s, 10));
|
|
167322
167754
|
}
|
|
167323
|
-
var
|
|
167755
|
+
var zodSchema71 = external_exports.object({
|
|
167324
167756
|
port: external_exports.number().int().min(1).max(65535).default(8081).describe("TCP port Metro is listening on")
|
|
167325
167757
|
});
|
|
167326
167758
|
var stopMetroTool = {
|
|
167327
167759
|
id: "stop-metro",
|
|
167328
167760
|
description: `Stop the Metro bundler process listening on \`port\`. Use when the user asks to stop Metro or when Metro must be restarted - do not offer it when a task wraps up, since the next task would wait on a cold Metro start. Returns { stopped, port, pids }: stopped=true when it sent SIGTERM to every listening pid it found (or the pid had already exited), stopped=false when it found none. Fails if the port lookup cannot run or times out, if it finds a listener but not the process that owns it, or if it cannot signal a listener it found (e.g. EPERM). On macOS another user's listener is detected only when no other listener on the port is visible, so it can survive stopped=true. This is DESTRUCTIVE: always ask the user for confirmation before calling this tool.`,
|
|
167329
|
-
zodSchema:
|
|
167761
|
+
zodSchema: zodSchema71,
|
|
167330
167762
|
interaction: {
|
|
167331
167763
|
startedMsg: ({ params }) => `Stopping Metro on port ${params.port}`,
|
|
167332
167764
|
completedMsg: ({ params }) => `Stopped Metro on port ${params.port}`,
|
|
@@ -168892,7 +169324,7 @@ var MACOS_PLATFORM_FLAG = { [FLAG_ENUM_META_KEY]: { macos: MACOS_APPS_FLAG } };
|
|
|
168892
169324
|
var fileInputs3 = [
|
|
168893
169325
|
{ target: "project_root", path: "${project_root}", kind: "probe" }
|
|
168894
169326
|
];
|
|
168895
|
-
var
|
|
169327
|
+
var zodSchema72 = external_exports.object({
|
|
168896
169328
|
name: external_exports.string().describe("E2E test name (letters, digits, `_`, `-`)."),
|
|
168897
169329
|
project_root: external_exports.string().describe("Absolute path to the project root containing `.argent/e2e/`."),
|
|
168898
169330
|
executionPrerequisite: external_exports.string().optional().describe(
|
|
@@ -168915,7 +169347,7 @@ var flowStartRecordingTool = {
|
|
|
168915
169347
|
Use when capturing a reusable sequence of device actions for replay; load the \`argent-create-e2e\` skill first. Not for Apple TV or Android TV.
|
|
168916
169348
|
Record live steps with \`e2e-add-step\` (start standalone tests with \`restart-app\`; use \`executionPrerequisite\` for fragments), \`e2e-add-echo\`, and \`e2e-add-script\`, then call \`e2e-finish-recording\`. Edit the YAML only after finishing.
|
|
168917
169349
|
Returns \`{ message, e2eTestFile, savedTo, restarted?, discardedSteps?, fragmentShutdown? }\`. Fails if the target file or directory cannot be written.`,
|
|
168918
|
-
zodSchema:
|
|
169350
|
+
zodSchema: zodSchema72,
|
|
168919
169351
|
aliases: ["flow-start-recording"],
|
|
168920
169352
|
interaction: {
|
|
168921
169353
|
// Name the flow: concurrent recordings interleave in one log, and "flow
|
|
@@ -172297,7 +172729,7 @@ function withRecordedPanelKind(command2, args, toolResult, ranAction = args.acti
|
|
|
172297
172729
|
var fileInputs4 = [
|
|
172298
172730
|
{ target: "project_root", path: "${project_root}", kind: "probe", collect: "step" }
|
|
172299
172731
|
];
|
|
172300
|
-
var
|
|
172732
|
+
var zodSchema73 = external_exports.object({
|
|
172301
172733
|
name: external_exports.string().describe("E2E test name from `e2e-start-recording`."),
|
|
172302
172734
|
project_root: external_exports.string().describe("Project root from `e2e-start-recording`."),
|
|
172303
172735
|
command: external_exports.string().describe(
|
|
@@ -172315,7 +172747,7 @@ function createFlowAddStepTool(registry2) {
|
|
|
172315
172747
|
description: `Execute one MCP tool live and append it to an open e2e recording (\`gesture-tap\` records as a portable \`tap\` selector; \`restart-app\` as \`launch\`; supports \`{{output:PATH}}\` references).
|
|
172316
172748
|
Use when recording steps after \`e2e-start-recording\` (pass \`shutdown: true\` for cleanup steps; call recording tools like \`e2e-add-script\` directly).
|
|
172317
172749
|
Returns \`{ message, toolResult, stepCount, recorded?, savedTo }\`. Fails if no recording is open or the step errors (nothing recorded).`,
|
|
172318
|
-
zodSchema:
|
|
172750
|
+
zodSchema: zodSchema73,
|
|
172319
172751
|
aliases: ["flow-add-step"],
|
|
172320
172752
|
interaction: {
|
|
172321
172753
|
// Name the flow: recordings are concurrent, so several of these lines can
|
|
@@ -172627,7 +173059,7 @@ Returns \`{ message, toolResult, stepCount, recorded?, savedTo }\`. Fails if no
|
|
|
172627
173059
|
|
|
172628
173060
|
// ../tool-server/src/tools/flows/flow-insert-echo.ts
|
|
172629
173061
|
init_zod();
|
|
172630
|
-
var
|
|
173062
|
+
var zodSchema74 = external_exports.object({
|
|
172631
173063
|
name: external_exports.string().describe("Name of the e2e test being recorded: the one passed to e2e-start-recording."),
|
|
172632
173064
|
project_root: external_exports.string().describe(
|
|
172633
173065
|
"Absolute path to the project root of the e2e test being recorded: the same value passed to e2e-start-recording."
|
|
@@ -172640,7 +173072,7 @@ var flowInsertEchoTool = {
|
|
|
172640
173072
|
description: `Record an echo step in the e2e test named by \`name\` + \`project_root\`. Echo steps print a message when the e2e test is replayed, useful as labels between tool calls.
|
|
172641
173073
|
Use when you want to annotate a recorded e2e test with a human-readable label or checkpoint message; pass \`shutdown: true\` to label its shutdown steps.
|
|
172642
173074
|
Returns { message, stepCount, savedTo }. Fails if that e2e test has no recording in progress.`,
|
|
172643
|
-
zodSchema:
|
|
173075
|
+
zodSchema: zodSchema74,
|
|
172644
173076
|
fileInputs: PROJECT_ROOT_INPUT,
|
|
172645
173077
|
aliases: ["flow-add-echo"],
|
|
172646
173078
|
interaction: {
|
|
@@ -172668,7 +173100,7 @@ Returns { message, stepCount, savedTo }. Fails if that e2e test has no recording
|
|
|
172668
173100
|
// ../tool-server/src/tools/flows/flow-set-vars.ts
|
|
172669
173101
|
init_zod();
|
|
172670
173102
|
init_capability();
|
|
172671
|
-
var
|
|
173103
|
+
var zodSchema75 = external_exports.object({
|
|
172672
173104
|
name: external_exports.string().describe("Test name passed to e2e-start-recording."),
|
|
172673
173105
|
project_root: external_exports.string().describe("Absolute project root passed to e2e-start-recording."),
|
|
172674
173106
|
vars: nameRecordSchema(external_exports.string().nullable(), "vars").describe(
|
|
@@ -172678,7 +173110,7 @@ var zodSchema74 = external_exports.object({
|
|
|
172678
173110
|
var flowSetVarsTool = {
|
|
172679
173111
|
id: "e2e-set-vars",
|
|
172680
173112
|
description: `Update the test inputs in an active e2e recording. Call directly before recording steps that use \`{{var:NAME}}\`. Saves the defaults under \`vars:\` and returns them with secret placeholders intact.`,
|
|
172681
|
-
zodSchema:
|
|
173113
|
+
zodSchema: zodSchema75,
|
|
172682
173114
|
fileInputs: PROJECT_ROOT_INPUT,
|
|
172683
173115
|
interaction: {
|
|
172684
173116
|
startedMsg: ({ params }) => `Setting vars for e2e test ${params.name}`,
|
|
@@ -172762,7 +173194,7 @@ function renderOutput(output2) {
|
|
|
172762
173194
|
const kept = bytes.subarray(0, utf8SafeCut(bytes, OUTPUT_RENDER_LIMIT_BYTES));
|
|
172763
173195
|
return { outputJson: kept.toString("utf8"), outputTruncated: true };
|
|
172764
173196
|
}
|
|
172765
|
-
var
|
|
173197
|
+
var zodSchema76 = external_exports.object({
|
|
172766
173198
|
name: external_exports.string().describe("E2E test name from `e2e-start-recording`."),
|
|
172767
173199
|
project_root: external_exports.string().describe("Project root from `e2e-start-recording`."),
|
|
172768
173200
|
path: external_exports.string().describe("Script path (.mjs/.mts/.js/.ts) relative to the test YAML."),
|
|
@@ -172782,7 +173214,7 @@ var flowAddScriptTool = deferredShutdownFirst({
|
|
|
172782
173214
|
description: `Run a local JS/TS script and record it as a \`script:\` step (requires no \`argent link\` / \`ARGENT_TOOLS_URL\`).
|
|
172783
173215
|
Use when the user requests a local script in an open recording (output is available to later steps via \`{{output:PATH}}\`).
|
|
172784
173216
|
Returns \`{ status, reason?, outputJson?, stepCount, recorded? }\`. A failed script returns \`status: "fail"\` or \`"error"\` without recording (check \`reason\` and affected state before retrying). Fails on invalid input, no open recording, or recording over a link.`,
|
|
172785
|
-
zodSchema:
|
|
173217
|
+
zodSchema: zodSchema76,
|
|
172786
173218
|
fileInputs: PROJECT_ROOT_INPUT,
|
|
172787
173219
|
aliases: ["flow-add-script"],
|
|
172788
173220
|
interaction: {
|
|
@@ -172937,7 +173369,7 @@ function anchoredWarnings(recorded, warnings, steps) {
|
|
|
172937
173369
|
}
|
|
172938
173370
|
return kept;
|
|
172939
173371
|
}
|
|
172940
|
-
var
|
|
173372
|
+
var zodSchema77 = external_exports.object({
|
|
172941
173373
|
name: external_exports.string().describe("E2E test name from `e2e-start-recording`."),
|
|
172942
173374
|
project_root: external_exports.string().describe("Project root from `e2e-start-recording`.")
|
|
172943
173375
|
});
|
|
@@ -172946,7 +173378,7 @@ var flowFinishRecordingTool = {
|
|
|
172946
173378
|
description: `Finalize an open e2e recording (runs pending fragment cleanup first).
|
|
172947
173379
|
Use when all steps have been recorded and you are ready to polish or replay the YAML (check any \`warning:\` lines in \`summary\` for recorded waits).
|
|
172948
173380
|
Returns \`{ message, path, steps, shutdownSteps?, fragmentShutdown?, summary, e2eTestFile, savedTo }\`. Fails if no recording is open for \`name\` + \`project_root\`.`,
|
|
172949
|
-
zodSchema:
|
|
173381
|
+
zodSchema: zodSchema77,
|
|
172950
173382
|
fileInputs: PROJECT_ROOT_INPUT,
|
|
172951
173383
|
aliases: ["flow-finish-recording"],
|
|
172952
173384
|
// It may run the fragments' shutdown, on the device.
|
|
@@ -176284,7 +176716,7 @@ async function bootChromiumForLaunch(state3, app) {
|
|
|
176284
176716
|
if (retiring !== -1) {
|
|
176285
176717
|
const [prev] = state3.owned.splice(retiring, 1);
|
|
176286
176718
|
retiredId = prev.deviceId;
|
|
176287
|
-
await
|
|
176719
|
+
await retireOwned(state3, prev);
|
|
176288
176720
|
}
|
|
176289
176721
|
let booted;
|
|
176290
176722
|
try {
|
|
@@ -176293,6 +176725,10 @@ async function bootChromiumForLaunch(state3, app) {
|
|
|
176293
176725
|
return { ok: false, reason: await chromiumBootFailureReason(state3, err) };
|
|
176294
176726
|
}
|
|
176295
176727
|
state3.owned.push(booted);
|
|
176728
|
+
state3.endClaims.set(
|
|
176729
|
+
booted.deviceId,
|
|
176730
|
+
await claimPickedDevice(state3.ctx?.session, booted.deviceId)
|
|
176731
|
+
);
|
|
176296
176732
|
state3.device = resolveDevice(booted.deviceId);
|
|
176297
176733
|
await frontChromiumPage(registry2, state3.device);
|
|
176298
176734
|
if (!await sleepOrAbort(POST_LAUNCH_SETTLE_MS, signal)) return ABORTED_OUTCOME;
|
|
@@ -176478,7 +176914,7 @@ Run the e2e test on the computer that runs the tool-server, with no link and no
|
|
|
176478
176914
|
}
|
|
176479
176915
|
);
|
|
176480
176916
|
}
|
|
176481
|
-
var
|
|
176917
|
+
var zodSchema78 = external_exports.object({
|
|
176482
176918
|
name: external_exports.string().optional().describe("Saved e2e test name in `<project_root>/.argent/e2e/` (or `.argent/flows/`)."),
|
|
176483
176919
|
project_root: external_exports.string().describe(
|
|
176484
176920
|
"Absolute path to the project root (script cwd; with e2e_test_path, run:/script:/baselines resolve beside the YAML)."
|
|
@@ -176519,7 +176955,7 @@ function createRunFlowTool(registry2) {
|
|
|
176519
176955
|
description: `Run a saved YAML e2e test end to end. Use when replaying a recorded path or QA regression (use gesture tools for one-off actions, \`e2e-start-recording\` to author tests). Pass exactly one e2e test source: \`name\` or \`e2e_test_path\`.
|
|
176520
176956
|
Returns a per-step report (\`ok: false\` on step failure). A main-step failure skips remaining main steps, then runs \`shutdown:\` steps (marked \`shutdown: true\`; failure sets \`shutdownFailed\`).
|
|
176521
176957
|
Over a link (\`argent link\` / \`ARGENT_TOOLS_URL\`), the client uploads the test, \`run:\` fragments, baselines, and absolute \`.png\`/\`.yaml\` args; steps needing other client files (e.g. \`script:\`, recording tools, directories) fail before step 1. Fails if the YAML is invalid, no unique matching device is booted, or pre-step link validation fails.`,
|
|
176522
|
-
zodSchema:
|
|
176958
|
+
zodSchema: zodSchema78,
|
|
176523
176959
|
aliases: ["flow-execute"],
|
|
176524
176960
|
interaction: {
|
|
176525
176961
|
startedMsg: ({ params }) => `Running e2e test ${displayFlowName(params)}`,
|
|
@@ -176616,6 +177052,13 @@ Over a link (\`argent link\` / \`ARGENT_TOOLS_URL\`), the client uploads the tes
|
|
|
176616
177052
|
project
|
|
176617
177053
|
);
|
|
176618
177054
|
const device = resolved.device;
|
|
177055
|
+
let endClaim;
|
|
177056
|
+
try {
|
|
177057
|
+
endClaim = device && !params.device ? await claimPickedDevice(ctx?.session, device.id) : void 0;
|
|
177058
|
+
} catch (error63) {
|
|
177059
|
+
if (resolved.booted) await teardownBootedChromium(registry2, resolved.booted);
|
|
177060
|
+
throw error63;
|
|
177061
|
+
}
|
|
176619
177062
|
const statusBarPinned = device !== null && await pinStatusBar(device, signal);
|
|
176620
177063
|
if (device !== null && !signal?.aborted && mayRunSnapshotStep(flow)) {
|
|
176621
177064
|
void warmSnapshotCapture(registry2, device);
|
|
@@ -176654,6 +177097,7 @@ Over a link (\`argent link\` / \`ARGENT_TOOLS_URL\`), the client uploads the tes
|
|
|
176654
177097
|
stopped: false,
|
|
176655
177098
|
pinned: statusBarPinned,
|
|
176656
177099
|
owned: resolved.booted ? [resolved.booted] : [],
|
|
177100
|
+
endClaims: new Map(endClaim && device ? [[device.id, endClaim]] : []),
|
|
176657
177101
|
...resolved.booted ? { hoistedBootMs: Date.now() - resolveStartedAt } : {},
|
|
176658
177102
|
chromiumLaunched: false,
|
|
176659
177103
|
snapshotApps: /* @__PURE__ */ new Map(),
|
|
@@ -176700,9 +177144,7 @@ Over a link (\`argent link\` / \`ARGENT_TOOLS_URL\`), the client uploads the tes
|
|
|
176700
177144
|
} finally {
|
|
176701
177145
|
aborted2 = state3.signal?.aborted === true;
|
|
176702
177146
|
if (state3.pinned && device) await restoreStatusBar(device);
|
|
176703
|
-
|
|
176704
|
-
await teardownBootedChromium(registry2, state3.owned[i]);
|
|
176705
|
-
}
|
|
177147
|
+
await teardownOwned(state3);
|
|
176706
177148
|
}
|
|
176707
177149
|
const result = summarize(
|
|
176708
177150
|
flowName,
|
|
@@ -177092,6 +177534,7 @@ function deferShutdown(state3) {
|
|
|
177092
177534
|
stopped: false,
|
|
177093
177535
|
pinned: false,
|
|
177094
177536
|
owned: [],
|
|
177537
|
+
endClaims: /* @__PURE__ */ new Map(),
|
|
177095
177538
|
output: output2,
|
|
177096
177539
|
scriptLogBudget: createScriptLogBudget(),
|
|
177097
177540
|
...ctx?.emitProgress ? { onStepReport: ctx.emitProgress } : {},
|
|
@@ -177101,12 +177544,22 @@ function deferShutdown(state3) {
|
|
|
177101
177544
|
try {
|
|
177102
177545
|
await execShutdown(later);
|
|
177103
177546
|
} finally {
|
|
177104
|
-
|
|
177105
|
-
await teardownBootedChromium(state3.registry, later.owned[i]);
|
|
177106
|
-
}
|
|
177547
|
+
await teardownOwned(later);
|
|
177107
177548
|
}
|
|
177108
177549
|
};
|
|
177109
177550
|
}
|
|
177551
|
+
async function teardownOwned(state3) {
|
|
177552
|
+
for (let i = state3.owned.length - 1; i >= 0; i--) await retireOwned(state3, state3.owned[i]);
|
|
177553
|
+
for (const end of state3.endClaims.values()) end();
|
|
177554
|
+
state3.endClaims.clear();
|
|
177555
|
+
}
|
|
177556
|
+
async function retireOwned(state3, booted) {
|
|
177557
|
+
await teardownBootedChromium(state3.registry, booted);
|
|
177558
|
+
const session = state3.ctx?.session;
|
|
177559
|
+
if (session) deviceClaims.release(session, claimKey(booted.deviceId));
|
|
177560
|
+
state3.endClaims.get(booted.deviceId)?.();
|
|
177561
|
+
state3.endClaims.delete(booted.deviceId);
|
|
177562
|
+
}
|
|
177110
177563
|
async function drainShutdown(state3, floor, thrown) {
|
|
177111
177564
|
while (state3.shutdownQueue.length > floor) {
|
|
177112
177565
|
const next = state3.shutdownQueue.pop();
|
|
@@ -177665,7 +178118,7 @@ async function resolveFlowSource(params, fileInput, flowPathInput) {
|
|
|
177665
178118
|
init_zod();
|
|
177666
178119
|
init_src2();
|
|
177667
178120
|
init_capability();
|
|
177668
|
-
var
|
|
178121
|
+
var zodSchema79 = external_exports.object({
|
|
177669
178122
|
name: external_exports.string().optional().describe(
|
|
177670
178123
|
"Name of a saved e2e test to check from `<project_root>/.argent/e2e`, or `.argent/flows` when it is not there."
|
|
177671
178124
|
),
|
|
@@ -177699,7 +178152,7 @@ each step that fails when it runs for a reason a device does not change, in this
|
|
|
177699
178152
|
run: fragments and nested e2e tests its steps reach. Each problem holds at?, code? and message.
|
|
177700
178153
|
at lists the steps from the e2e test to the problem, each { step, run?, e2e?, when? }.
|
|
177701
178154
|
Pass exactly one e2e test source: name (under project_root) or e2e_test_path.`,
|
|
177702
|
-
zodSchema:
|
|
178155
|
+
zodSchema: zodSchema79,
|
|
177703
178156
|
readOnly: true,
|
|
177704
178157
|
// `argent e2e check` calls it.
|
|
177705
178158
|
hideFromMcp: true,
|
|
@@ -177762,7 +178215,7 @@ var fileInputs5 = [
|
|
|
177762
178215
|
},
|
|
177763
178216
|
...PROJECT_ROOT_INPUT
|
|
177764
178217
|
];
|
|
177765
|
-
var
|
|
178218
|
+
var zodSchema80 = external_exports.object({
|
|
177766
178219
|
name: external_exports.string().optional().describe(
|
|
177767
178220
|
'Name of a saved e2e test to inspect from `<project_root>/.argent/e2e`, or `.argent/flows` when it is not there (e.g. "settings-explore").'
|
|
177768
178221
|
),
|
|
@@ -177793,7 +178246,7 @@ correct account, correct screen) before committing to a run, or when relaying th
|
|
|
177793
178246
|
Touches no device and needs none booted: it only reads the file.
|
|
177794
178247
|
Fails if the e2e test file does not exist.
|
|
177795
178248
|
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.`,
|
|
177796
|
-
zodSchema:
|
|
178249
|
+
zodSchema: zodSchema80,
|
|
177797
178250
|
readOnly: true,
|
|
177798
178251
|
// When its gates pass, e2e-execute without prerequisiteAcknowledged returns
|
|
177799
178252
|
// the same executionPrerequisite, from the same resolveFlowSource, before any
|
|
@@ -177875,7 +178328,8 @@ async function listDir(path78) {
|
|
|
177875
178328
|
var COMMAND_TIMEOUT_MS = 3e3;
|
|
177876
178329
|
function runVersionCommand(cmd, args, cwd) {
|
|
177877
178330
|
return new Promise((resolve24) => {
|
|
177878
|
-
const
|
|
178331
|
+
const options = { cwd, timeout: COMMAND_TIMEOUT_MS, windowsHide: true };
|
|
178332
|
+
const child = (0, import_node_child_process57.execFile)(cmd, args, options, (err, stdout) => {
|
|
177879
178333
|
if (err) {
|
|
177880
178334
|
resolve24(null);
|
|
177881
178335
|
return;
|
|
@@ -178127,7 +178581,7 @@ async function readWorkspaceSnapshot(workspacePath) {
|
|
|
178127
178581
|
var fileInputs6 = [
|
|
178128
178582
|
{ target: "workspacePath", path: "${workspacePath}", kind: "directory" }
|
|
178129
178583
|
];
|
|
178130
|
-
var
|
|
178584
|
+
var zodSchema81 = external_exports.object({
|
|
178131
178585
|
workspacePath: external_exports.string().describe("Absolute path to the project root directory to inspect (e.g. /Users/dev/MyApp)")
|
|
178132
178586
|
});
|
|
178133
178587
|
var gatherWorkspaceDataTool = {
|
|
@@ -178142,7 +178596,7 @@ Makefile targets, lint-staged config, and a list of detected config files.
|
|
|
178142
178596
|
Use when a program needs the project type (React Native, Expo, Flutter, native iOS/Android,
|
|
178143
178597
|
or other), build commands, platform support, package manager or QA tooling.
|
|
178144
178598
|
Items it cannot read are null or empty collections. Fails if workspacePath is not a directory on the tool-server host.`,
|
|
178145
|
-
zodSchema:
|
|
178599
|
+
zodSchema: zodSchema81,
|
|
178146
178600
|
readOnly: true,
|
|
178147
178601
|
hideFromMcp: true,
|
|
178148
178602
|
interaction: {
|
|
@@ -178160,7 +178614,7 @@ Items it cannot read are null or empty collections. Fails if workspacePath is no
|
|
|
178160
178614
|
// ../tool-server/src/tools/system/dismiss-update.ts
|
|
178161
178615
|
init_zod();
|
|
178162
178616
|
var MAX_HOURS = 24 * 365 * 10;
|
|
178163
|
-
var
|
|
178617
|
+
var zodSchema82 = external_exports.object({
|
|
178164
178618
|
hours: external_exports.number().min(0).describe(
|
|
178165
178619
|
"Hours until reminders resume: 168 is a week, 87600 is the longest, 0 turns them back on"
|
|
178166
178620
|
)
|
|
@@ -178168,7 +178622,7 @@ var zodSchema81 = external_exports.object({
|
|
|
178168
178622
|
var dismissUpdateTool = {
|
|
178169
178623
|
id: "dismiss-update",
|
|
178170
178624
|
description: "Postpone the Argent update reminder and the automatic update, on every tool-server of this Argent home, 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.",
|
|
178171
|
-
zodSchema:
|
|
178625
|
+
zodSchema: zodSchema82,
|
|
178172
178626
|
hideWhen: isUpdateCheckDisabled,
|
|
178173
178627
|
interaction: {
|
|
178174
178628
|
startedMsg: () => "Dismissing Argent update",
|
|
@@ -178222,7 +178676,7 @@ var fileInputs7 = [
|
|
|
178222
178676
|
{ target: "currentPath", path: "${currentPath}", kind: "file", optional: true },
|
|
178223
178677
|
{ target: "outputDir", path: "${outputDir}", kind: "probe", optional: true }
|
|
178224
178678
|
];
|
|
178225
|
-
var
|
|
178679
|
+
var zodSchema83 = external_exports.object({
|
|
178226
178680
|
baselinePath: external_exports.string().min(1).optional().describe("Saved baseline PNG path (omit when `captureBaseline: true`)."),
|
|
178227
178681
|
currentPath: external_exports.string().min(1).optional().describe("Saved current PNG path (omit when `captureCurrent: true`)."),
|
|
178228
178682
|
udid: external_exports.string().min(1).describe(
|
|
@@ -178244,7 +178698,7 @@ var screenshotDiffTool = {
|
|
|
178244
178698
|
description: `Compare two PNG screenshots (saved files or one live capture<flag:harmonyos> on iOS, Android, or HarmonyOS</flag:harmonyos>) and return a visual-diff summary (status bar ignored).
|
|
178245
178699
|
Use when checking pixel-visible regressions (layout, spacing, color, typography, clipping, overflow). Both images must have identical dimensions: save baselines with screenshot scale: 1.0, one per device model.<flag:macos-apps> Mac apps: resized windows fail as a dimension mismatch.</flag:macos-apps>
|
|
178246
178700
|
Returns \`{ summary, diffPath?, contextDiffPath? }\` with normalized [0,1] changed regions. Fails if sources are invalid, dimensions differ, files cannot be read/written, or the capture backend<flag:harmonyos> (\`hdc\` on HarmonyOS)</flag:harmonyos> is unreachable.`,
|
|
178247
|
-
zodSchema:
|
|
178701
|
+
zodSchema: zodSchema83,
|
|
178248
178702
|
searchHint: "compare screenshots png diff visual UI changes UI regression visual regression screenshot diff changed regions text ocr live capture<flag:harmonyos> harmony harmonyos</flag:harmonyos>",
|
|
178249
178703
|
interaction: {
|
|
178250
178704
|
startedMsg: () => "Comparing screenshots",
|
|
@@ -178592,7 +179046,7 @@ async function captureElementFrame(registry2, udid, match, opts = {}) {
|
|
|
178592
179046
|
|
|
178593
179047
|
// ../tool-server/src/tools/variants/propose-variant.ts
|
|
178594
179048
|
init_capability();
|
|
178595
|
-
var
|
|
179049
|
+
var zodSchema84 = external_exports.object({
|
|
178596
179050
|
element: external_exports.string().min(1).max(200).describe(
|
|
178597
179051
|
'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.'
|
|
178598
179052
|
),
|
|
@@ -178645,7 +179099,7 @@ arrives as a follow-up message (this is the case in an \`argent lens\` CLI sessi
|
|
|
178645
179099
|
|
|
178646
179100
|
Returns { round, elementId, variantId, element, variantCount, totalElements }: confirmation only;
|
|
178647
179101
|
it does not wait for the user.`,
|
|
178648
|
-
zodSchema:
|
|
179102
|
+
zodSchema: zodSchema84,
|
|
178649
179103
|
searchHint: "propose design variant alternative option for element non-blocking ab choice",
|
|
178650
179104
|
featureFlag: "argent-lens",
|
|
178651
179105
|
interaction: {
|
|
@@ -178681,7 +179135,7 @@ it does not wait for the user.`,
|
|
|
178681
179135
|
|
|
178682
179136
|
// ../tool-server/src/tools/variants/await-user-selection.ts
|
|
178683
179137
|
init_zod();
|
|
178684
|
-
var
|
|
179138
|
+
var zodSchema85 = external_exports.object({
|
|
178685
179139
|
timeoutSeconds: external_exports.number().int().min(5).max(86400).optional().describe(
|
|
178686
179140
|
"Max seconds to block this call before returning a re-awaitable { status: 'pending' } result (default 1800). The user's proposals stay live across timeouts; on 'pending' just call await_user_selection again. Lower this if your MCP client enforces a short request timeout."
|
|
178687
179141
|
)
|
|
@@ -178709,7 +179163,7 @@ Returns one of:
|
|
|
178709
179163
|
|
|
178710
179164
|
This tool is long-running; it intentionally holds the request open. It honors client
|
|
178711
179165
|
disconnects (aborts cleanly).`,
|
|
178712
|
-
zodSchema:
|
|
179166
|
+
zodSchema: zodSchema85,
|
|
178713
179167
|
searchHint: "await wait user selection choice variant blocking confirm picks complete",
|
|
178714
179168
|
featureFlag: "argent-lens",
|
|
178715
179169
|
// Hidden while an `argent lens` CLI session owns the preview window: there the
|
|
@@ -178762,7 +179216,7 @@ var tabAction = {
|
|
|
178762
179216
|
var capability38 = {
|
|
178763
179217
|
chromium: { app: true }
|
|
178764
179218
|
};
|
|
178765
|
-
var
|
|
179219
|
+
var zodSchema86 = external_exports.object({
|
|
178766
179220
|
udid: external_exports.string().describe("Chromium device id (`chromium-cdp-<port>`)."),
|
|
178767
179221
|
action: external_exports.enum(["list", "select", "new", "close"]).describe("Tab operation."),
|
|
178768
179222
|
tab: external_exports.string().optional().describe("Tab id (e.g. `t2`) or label (`select` required; `close` defaults to active)."),
|
|
@@ -178774,7 +179228,7 @@ var chromiumTabsTool = {
|
|
|
178774
179228
|
description: `List and switch tabs/windows (or open/close them) in a Chromium (CDP) or Electron app (all UI tools target the active tab).
|
|
178775
179229
|
Use when switching between multiple tabs/windows or opening/closing pages.
|
|
178776
179230
|
Returns \`{ tabs: [{ tabId, targetId, title, url, active, label? }] }\`. Fails on non-Chromium targets or unknown tab ids.`,
|
|
178777
|
-
zodSchema:
|
|
179231
|
+
zodSchema: zodSchema86,
|
|
178778
179232
|
searchHint: "tab tabs window windows switch select close new open multi-tab chromium electron",
|
|
178779
179233
|
interaction: {
|
|
178780
179234
|
startedMsg: ({ params }) => tabAction[params.action].started(params),
|
|
@@ -178891,7 +179345,7 @@ var cookieAction = {
|
|
|
178891
179345
|
var capability39 = {
|
|
178892
179346
|
chromium: { app: true }
|
|
178893
179347
|
};
|
|
178894
|
-
var
|
|
179348
|
+
var zodSchema87 = external_exports.object({
|
|
178895
179349
|
udid: external_exports.string().describe("Chromium device id (`chromium-cdp-<port>`)."),
|
|
178896
179350
|
action: external_exports.enum(["get", "set", "delete", "clear"]).describe(
|
|
178897
179351
|
"get: read cookies. set: create/update a cookie. delete: remove matching cookies. clear: remove ALL browser cookies across all domains (ignores url/domain)."
|
|
@@ -178911,7 +179365,7 @@ var chromiumCookiesTool = {
|
|
|
178911
179365
|
description: `Read and write cookies (including HttpOnly) in a Chromium (CDP) app.
|
|
178912
179366
|
Use when seeding an auth session or asserting cookie state (\`set\`/\`delete\` need \`url\` or \`domain\`). \`clear\` wipes ALL browser cookies across every domain (ignores \`url\`/\`domain\`); use \`get\` + \`delete\` to clear a single domain.
|
|
178913
179367
|
Returns \`{ cookies, count }\` (\`get\`) or \`{ set }\` / \`{ deleted }\` / \`{ cleared }\`. Fails on non-Chromium targets or missing required params.`,
|
|
178914
|
-
zodSchema:
|
|
179368
|
+
zodSchema: zodSchema87,
|
|
178915
179369
|
searchHint: "cookies cookie get set delete clear httponly samesite session auth chromium",
|
|
178916
179370
|
interaction: {
|
|
178917
179371
|
startedMsg: ({ params }) => `${cookieAction[params.action].started} browser cookies`,
|
|
@@ -178992,7 +179446,7 @@ var storageAction = {
|
|
|
178992
179446
|
var capability40 = {
|
|
178993
179447
|
chromium: { app: true }
|
|
178994
179448
|
};
|
|
178995
|
-
var
|
|
179449
|
+
var zodSchema88 = external_exports.object({
|
|
178996
179450
|
udid: external_exports.string().describe("Chromium device id from `list-devices` (e.g. `chromium-cdp-9222`)."),
|
|
178997
179451
|
store: external_exports.enum(["local", "session"]).describe("`local`: localStorage. `session`: sessionStorage."),
|
|
178998
179452
|
action: external_exports.enum(["get", "set", "remove", "clear"]).describe(
|
|
@@ -179006,7 +179460,7 @@ var chromiumStorageTool = {
|
|
|
179006
179460
|
description: `Read and write localStorage / sessionStorage of a Chromium (CDP) app, for the origin of the active tab's page.
|
|
179007
179461
|
Use when seeding feature flags / auth tokens before an e2e test or asserting persisted app state after one.
|
|
179008
179462
|
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.`,
|
|
179009
|
-
zodSchema:
|
|
179463
|
+
zodSchema: zodSchema88,
|
|
179010
179464
|
searchHint: "storage localstorage sessionstorage local session get set remove clear key value chromium",
|
|
179011
179465
|
// Agents read and write Web Storage with debugger-evaluate, which runs the same
|
|
179012
179466
|
// Runtime.evaluate on the active page. The SDK and the e2e-full suite still call it.
|
|
@@ -179225,7 +179679,7 @@ async function stub(app, params) {
|
|
|
179225
179679
|
});
|
|
179226
179680
|
return { armed, mode, panelKind };
|
|
179227
179681
|
}
|
|
179228
|
-
var
|
|
179682
|
+
var zodSchema89 = external_exports.object({
|
|
179229
179683
|
udid: external_exports.string().describe("Mac app id from `list-devices` (macos-app-<bundle id>)."),
|
|
179230
179684
|
action: external_exports.enum(["list", "choose", "cancel", "discard", "stub"]).describe(
|
|
179231
179685
|
"list: the open file panels. choose: answer a panel with path or paths. cancel: cancel a panel. discard: answer a panel with its Delete or Don't Save button. stub: arm an answer or a cancel for the next panel the app presents (stubMode)."
|
|
@@ -179258,7 +179712,7 @@ For stub, panelKind names the kind of panel the answer is for; without it, paths
|
|
|
179258
179712
|
A sandboxed app that argent started is given access to the chosen paths only. A save panel that lists file formats refuses a path whose extension matches none of them, also a path with no extension, unless it saves any file (public.data, public.item) or allows other file types. On macOS 15 and later, the extension picks the format. argent does not check a path for an open panel against the panel's allowed file types.
|
|
179259
179713
|
Returns { panels } for list, { chosen, panel, kind, paths } for choose, { cancelled, panel } for cancel, { discarded, panel } for discard, { armed, mode, panelKind? } for stub.
|
|
179260
179714
|
Fails if no panel appears within timeoutMs, if more than one panel is open and panel is not given, if a path is relative or does not exist (a save panel needs an existing folder), if a path for a save panel is an existing folder other than a document package the panel saves, if the path does not fit the panel choose finds (a folder for a panel of files, a file for a panel of folders, a refused extension), if discard finds no Delete or Don't Save button, or if the Mac app is not running.`,
|
|
179261
|
-
zodSchema:
|
|
179715
|
+
zodSchema: zodSchema89,
|
|
179262
179716
|
searchHint: "file panel dialog open save choose pick file folder nsopenpanel nssavepanel mac app",
|
|
179263
179717
|
featureFlag: "macos-apps",
|
|
179264
179718
|
interaction: {
|
|
@@ -179360,7 +179814,7 @@ function renderMenus(items, depth, lines) {
|
|
|
179360
179814
|
if (item.items) renderMenus(item.items, depth + 1, lines);
|
|
179361
179815
|
}
|
|
179362
179816
|
}
|
|
179363
|
-
var
|
|
179817
|
+
var zodSchema90 = external_exports.object({
|
|
179364
179818
|
udid: external_exports.string().describe("Mac app id from `list-devices` (macos-app-<bundle id>)."),
|
|
179365
179819
|
action: external_exports.enum(["list", "choose"]).describe(
|
|
179366
179820
|
"list: the app's menu bar, one line per item. choose: run one menu item, by path or identifier."
|
|
@@ -179376,7 +179830,7 @@ var menuBarTool = {
|
|
|
179376
179830
|
Use when a command lives in the app's menus. Use keyboard instead for a shortcut you already know, and file-panel for the open or save panel that a command shows.
|
|
179377
179831
|
list returns { menuBar }, one line per item indented under its menu: the title (a menu ends with " >"), [disabled] or [checked], the shortcut in keyboard syntax, and id="..." when the item has one. choose takes path (the titles from the menu bar down, e.g. ["File", "Export..."]) or identifier, and returns { chosen } with the path; the command runs right after the reply.
|
|
179378
179832
|
Fails if no item matches (the error lists the titles at that level), if the item is disabled or is a menu, if a menu of the app is open, or if the device is not a Mac app.`,
|
|
179379
|
-
zodSchema:
|
|
179833
|
+
zodSchema: zodSchema90,
|
|
179380
179834
|
searchHint: "menu bar main menu command item file edit view window help choose mac app",
|
|
179381
179835
|
featureFlag: "macos-apps",
|
|
179382
179836
|
interaction: {
|
|
@@ -179468,6 +179922,7 @@ function createRegistry() {
|
|
|
179468
179922
|
registry2.registerBlueprint(androidNetworkInspectorBlueprint);
|
|
179469
179923
|
registry2.registerBlueprint(androidNetworkShaperBlueprint);
|
|
179470
179924
|
registry2.registerTool(listDevicesTool);
|
|
179925
|
+
registry2.registerTool(releaseDeviceTool);
|
|
179471
179926
|
registry2.registerTool(createBootDeviceTool(registry2));
|
|
179472
179927
|
registry2.registerTool(createLaunchAppTool(registry2));
|
|
179473
179928
|
registry2.registerTool(createRestartAppTool(registry2));
|