@swmansion/argent 0.25.1-next.34 → 0.25.1-next.35
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
CHANGED
|
@@ -2372,6 +2372,8 @@ var FAILURE_CODES = {
|
|
|
2372
2372
|
ANDROID_DEVTOOLS_WRONG_PLATFORM: "ANDROID_DEVTOOLS_WRONG_PLATFORM",
|
|
2373
2373
|
ANDROID_DEVTOOLS_DEVICE_ID_INVALID: "ANDROID_DEVTOOLS_DEVICE_ID_INVALID",
|
|
2374
2374
|
ANDROID_DEVTOOLS_HELPER_TERMINATED: "ANDROID_DEVTOOLS_HELPER_TERMINATED",
|
|
2375
|
+
ANDROID_DEVTOOLS_HELPER_INSTALL_FAILED: "ANDROID_DEVTOOLS_HELPER_INSTALL_FAILED",
|
|
2376
|
+
ANDROID_DEVTOOLS_HELPER_REPAIR_FAILED: "ANDROID_DEVTOOLS_HELPER_REPAIR_FAILED",
|
|
2375
2377
|
ANDROID_DEVTOOLS_RPC_CLIENT_CLOSED: "ANDROID_DEVTOOLS_RPC_CLIENT_CLOSED",
|
|
2376
2378
|
ANDROID_DEVTOOLS_RPC_ERROR: "ANDROID_DEVTOOLS_RPC_ERROR",
|
|
2377
2379
|
ANDROID_DEVTOOLS_RPC_TIMEOUT: "ANDROID_DEVTOOLS_RPC_TIMEOUT",
|
|
@@ -21857,7 +21859,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
21857
21859
|
var SESSION_ID2 = randomUUID5();
|
|
21858
21860
|
function readCliVersion() {
|
|
21859
21861
|
if (true) {
|
|
21860
|
-
return "0.25.1-next.
|
|
21862
|
+
return "0.25.1-next.35";
|
|
21861
21863
|
}
|
|
21862
21864
|
return "0.0.0";
|
|
21863
21865
|
}
|
package/dist/installer.mjs
CHANGED
|
@@ -15744,6 +15744,8 @@ var FAILURE_CODES = {
|
|
|
15744
15744
|
ANDROID_DEVTOOLS_WRONG_PLATFORM: "ANDROID_DEVTOOLS_WRONG_PLATFORM",
|
|
15745
15745
|
ANDROID_DEVTOOLS_DEVICE_ID_INVALID: "ANDROID_DEVTOOLS_DEVICE_ID_INVALID",
|
|
15746
15746
|
ANDROID_DEVTOOLS_HELPER_TERMINATED: "ANDROID_DEVTOOLS_HELPER_TERMINATED",
|
|
15747
|
+
ANDROID_DEVTOOLS_HELPER_INSTALL_FAILED: "ANDROID_DEVTOOLS_HELPER_INSTALL_FAILED",
|
|
15748
|
+
ANDROID_DEVTOOLS_HELPER_REPAIR_FAILED: "ANDROID_DEVTOOLS_HELPER_REPAIR_FAILED",
|
|
15747
15749
|
ANDROID_DEVTOOLS_RPC_CLIENT_CLOSED: "ANDROID_DEVTOOLS_RPC_CLIENT_CLOSED",
|
|
15748
15750
|
ANDROID_DEVTOOLS_RPC_ERROR: "ANDROID_DEVTOOLS_RPC_ERROR",
|
|
15749
15751
|
ANDROID_DEVTOOLS_RPC_TIMEOUT: "ANDROID_DEVTOOLS_RPC_TIMEOUT",
|
|
@@ -16710,7 +16712,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
16710
16712
|
var SESSION_ID = randomUUID4();
|
|
16711
16713
|
function readCliVersion() {
|
|
16712
16714
|
if (true) {
|
|
16713
|
-
return "0.25.1-next.
|
|
16715
|
+
return "0.25.1-next.35";
|
|
16714
16716
|
}
|
|
16715
16717
|
return "0.0.0";
|
|
16716
16718
|
}
|
package/dist/mcp-server.mjs
CHANGED
|
@@ -16552,6 +16552,8 @@ var FAILURE_CODES = {
|
|
|
16552
16552
|
ANDROID_DEVTOOLS_WRONG_PLATFORM: "ANDROID_DEVTOOLS_WRONG_PLATFORM",
|
|
16553
16553
|
ANDROID_DEVTOOLS_DEVICE_ID_INVALID: "ANDROID_DEVTOOLS_DEVICE_ID_INVALID",
|
|
16554
16554
|
ANDROID_DEVTOOLS_HELPER_TERMINATED: "ANDROID_DEVTOOLS_HELPER_TERMINATED",
|
|
16555
|
+
ANDROID_DEVTOOLS_HELPER_INSTALL_FAILED: "ANDROID_DEVTOOLS_HELPER_INSTALL_FAILED",
|
|
16556
|
+
ANDROID_DEVTOOLS_HELPER_REPAIR_FAILED: "ANDROID_DEVTOOLS_HELPER_REPAIR_FAILED",
|
|
16555
16557
|
ANDROID_DEVTOOLS_RPC_CLIENT_CLOSED: "ANDROID_DEVTOOLS_RPC_CLIENT_CLOSED",
|
|
16556
16558
|
ANDROID_DEVTOOLS_RPC_ERROR: "ANDROID_DEVTOOLS_RPC_ERROR",
|
|
16557
16559
|
ANDROID_DEVTOOLS_RPC_TIMEOUT: "ANDROID_DEVTOOLS_RPC_TIMEOUT",
|
package/dist/tool-server.cjs
CHANGED
|
@@ -698,6 +698,8 @@ var init_failure_codes = __esm({
|
|
|
698
698
|
ANDROID_DEVTOOLS_WRONG_PLATFORM: "ANDROID_DEVTOOLS_WRONG_PLATFORM",
|
|
699
699
|
ANDROID_DEVTOOLS_DEVICE_ID_INVALID: "ANDROID_DEVTOOLS_DEVICE_ID_INVALID",
|
|
700
700
|
ANDROID_DEVTOOLS_HELPER_TERMINATED: "ANDROID_DEVTOOLS_HELPER_TERMINATED",
|
|
701
|
+
ANDROID_DEVTOOLS_HELPER_INSTALL_FAILED: "ANDROID_DEVTOOLS_HELPER_INSTALL_FAILED",
|
|
702
|
+
ANDROID_DEVTOOLS_HELPER_REPAIR_FAILED: "ANDROID_DEVTOOLS_HELPER_REPAIR_FAILED",
|
|
701
703
|
ANDROID_DEVTOOLS_RPC_CLIENT_CLOSED: "ANDROID_DEVTOOLS_RPC_CLIENT_CLOSED",
|
|
702
704
|
ANDROID_DEVTOOLS_RPC_ERROR: "ANDROID_DEVTOOLS_RPC_ERROR",
|
|
703
705
|
ANDROID_DEVTOOLS_RPC_TIMEOUT: "ANDROID_DEVTOOLS_RPC_TIMEOUT",
|
|
@@ -77006,8 +77008,8 @@ async function emulatorSupportsFlag(flag, options = {}) {
|
|
|
77006
77008
|
} catch {
|
|
77007
77009
|
return false;
|
|
77008
77010
|
}
|
|
77009
|
-
const
|
|
77010
|
-
const cached3 = emulatorFlagSupportCache.get(
|
|
77011
|
+
const cacheKey2 = `${emulatorPath}|${flag}`;
|
|
77012
|
+
const cached3 = emulatorFlagSupportCache.get(cacheKey2);
|
|
77011
77013
|
if (cached3 !== void 0) return cached3;
|
|
77012
77014
|
let output;
|
|
77013
77015
|
let failure = null;
|
|
@@ -77034,7 +77036,7 @@ async function emulatorSupportsFlag(flag, options = {}) {
|
|
|
77034
77036
|
return false;
|
|
77035
77037
|
}
|
|
77036
77038
|
const supported = output.includes(flag);
|
|
77037
|
-
emulatorFlagSupportCache.set(
|
|
77039
|
+
emulatorFlagSupportCache.set(cacheKey2, supported);
|
|
77038
77040
|
return supported;
|
|
77039
77041
|
}
|
|
77040
77042
|
function describeAdbFailure(args, err) {
|
|
@@ -94704,7 +94706,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
94704
94706
|
var SESSION_ID = (0, import_node_crypto3.randomUUID)();
|
|
94705
94707
|
function readCliVersion() {
|
|
94706
94708
|
if (true) {
|
|
94707
|
-
return "0.25.1-next.
|
|
94709
|
+
return "0.25.1-next.35";
|
|
94708
94710
|
}
|
|
94709
94711
|
return "0.0.0";
|
|
94710
94712
|
}
|
|
@@ -112897,10 +112899,6 @@ init_android_binary();
|
|
|
112897
112899
|
|
|
112898
112900
|
// ../tool-server/src/utils/android-helper-install.ts
|
|
112899
112901
|
init_adb();
|
|
112900
|
-
var installedHelpers = /* @__PURE__ */ new Map();
|
|
112901
|
-
function cacheKey(serial, versionCode) {
|
|
112902
|
-
return `${serial}|${versionCode}`;
|
|
112903
|
-
}
|
|
112904
112902
|
async function probeInstalledVersion(serial, packageName) {
|
|
112905
112903
|
let out;
|
|
112906
112904
|
try {
|
|
@@ -112923,17 +112921,17 @@ async function probeInstalledVersion(serial, packageName) {
|
|
|
112923
112921
|
}
|
|
112924
112922
|
return { installed: false, versionCode: null };
|
|
112925
112923
|
}
|
|
112926
|
-
async function ensureAndroidDevtoolsInstalled(serial) {
|
|
112924
|
+
async function ensureAndroidDevtoolsInstalled(serial, options = {}) {
|
|
112927
112925
|
const manifest = helperManifest();
|
|
112928
|
-
|
|
112929
|
-
|
|
112930
|
-
|
|
112931
|
-
|
|
112932
|
-
|
|
112933
|
-
return;
|
|
112926
|
+
if (!options.force) {
|
|
112927
|
+
const probe3 = await probeInstalledVersion(serial, manifest.packageName);
|
|
112928
|
+
if (probe3.installed && (probe3.versionCode === null || probe3.versionCode >= manifest.versionCode)) {
|
|
112929
|
+
return;
|
|
112930
|
+
}
|
|
112934
112931
|
}
|
|
112935
112932
|
const apkPath = bundledHelperApkPath();
|
|
112936
|
-
const
|
|
112933
|
+
const flags = options.force ? [...manifest.installFlags, "-d"] : manifest.installFlags;
|
|
112934
|
+
const args = ["-s", serial, "install", ...flags, apkPath];
|
|
112937
112935
|
try {
|
|
112938
112936
|
await runAdb(args, { timeoutMs: 6e4 });
|
|
112939
112937
|
} catch (err) {
|
|
@@ -112948,7 +112946,6 @@ async function ensureAndroidDevtoolsInstalled(serial) {
|
|
|
112948
112946
|
throw err;
|
|
112949
112947
|
}
|
|
112950
112948
|
}
|
|
112951
|
-
installedHelpers.set(key2, true);
|
|
112952
112949
|
}
|
|
112953
112950
|
|
|
112954
112951
|
// ../tool-server/src/utils/android-devtools-client.ts
|
|
@@ -113092,14 +113089,28 @@ function androidDevtoolsRef(device) {
|
|
|
113092
113089
|
};
|
|
113093
113090
|
}
|
|
113094
113091
|
var READY_TIMEOUT_MS2 = 3e4;
|
|
113092
|
+
var EXIT_GRACE_MS = 200;
|
|
113095
113093
|
var HELPER_PORT_MARKER = /^INSTRUMENTATION_STATUS:\s*port=(\d+)/;
|
|
113096
113094
|
var ADB_FORWARD_PORT_MARKER = /^(\d+)\s*$/;
|
|
113095
|
+
var HELPER_STATUS_MARKER = /^INSTRUMENTATION_STATUS:\s*Error=/;
|
|
113096
|
+
var HELPER_STATUS_MAX_CHARS = 400;
|
|
113097
|
+
function classifyHelperSpawnFault(text) {
|
|
113098
|
+
return /Unable to find instrumentation (?:info|target package)/i.test(text) ? "instrumentation-missing" : "unknown";
|
|
113099
|
+
}
|
|
113100
|
+
var HelperSpawnError = class extends FailureError {
|
|
113101
|
+
fault;
|
|
113102
|
+
constructor(message, signal, fault) {
|
|
113103
|
+
super(message, signal);
|
|
113104
|
+
this.name = "HelperSpawnError";
|
|
113105
|
+
this.fault = fault;
|
|
113106
|
+
}
|
|
113107
|
+
};
|
|
113097
113108
|
async function spawnHelper(serial) {
|
|
113098
113109
|
const manifest = helperManifest();
|
|
113099
113110
|
const adbPath = await resolveAndroidBinary("adb");
|
|
113100
113111
|
if (!adbPath) {
|
|
113101
113112
|
throw new FailureError(
|
|
113102
|
-
"`adb` not found on PATH or under `$ANDROID_HOME/platform-tools` while spawning android
|
|
113113
|
+
"`adb` not found on PATH or under `$ANDROID_HOME/platform-tools` while spawning the argent android helper.",
|
|
113103
113114
|
{
|
|
113104
113115
|
error_code: FAILURE_CODES.ANDROID_DEVTOOLS_ADB_NOT_FOUND,
|
|
113105
113116
|
failure_stage: "android_devtools_spawn_helper",
|
|
@@ -113118,10 +113129,13 @@ async function spawnHelper(serial) {
|
|
|
113118
113129
|
let localPort = null;
|
|
113119
113130
|
let settled = false;
|
|
113120
113131
|
let stderrBuf = "";
|
|
113132
|
+
let statusBuf = "";
|
|
113133
|
+
let exitGrace;
|
|
113121
113134
|
const settle = (fn, cleanup) => {
|
|
113122
113135
|
if (settled) return;
|
|
113123
113136
|
settled = true;
|
|
113124
113137
|
clearTimeout(timer);
|
|
113138
|
+
clearTimeout(exitGrace);
|
|
113125
113139
|
rl.close();
|
|
113126
113140
|
cleanup?.();
|
|
113127
113141
|
fn();
|
|
@@ -113129,6 +113143,9 @@ async function spawnHelper(serial) {
|
|
|
113129
113143
|
const rl = readline2.createInterface({ input: proc.stdout });
|
|
113130
113144
|
rl.on("line", async (rawLine) => {
|
|
113131
113145
|
const line = rawLine.trim();
|
|
113146
|
+
if (statusBuf.length < HELPER_STATUS_MAX_CHARS && HELPER_STATUS_MARKER.test(line)) {
|
|
113147
|
+
statusBuf = (statusBuf ? `${statusBuf} ${line}` : line).slice(0, HELPER_STATUS_MAX_CHARS);
|
|
113148
|
+
}
|
|
113132
113149
|
const portMatch = HELPER_PORT_MARKER.exec(line);
|
|
113133
113150
|
if (!portMatch || devicePort !== null) return;
|
|
113134
113151
|
devicePort = parseInt(portMatch[1], 10);
|
|
@@ -113158,25 +113175,32 @@ async function spawnHelper(serial) {
|
|
|
113158
113175
|
stderrBuf += data.toString("utf-8");
|
|
113159
113176
|
if (stderrBuf.length > 4 * 1024) stderrBuf = stderrBuf.slice(-4 * 1024);
|
|
113160
113177
|
});
|
|
113161
|
-
|
|
113162
|
-
|
|
113163
|
-
|
|
113164
|
-
|
|
113165
|
-
|
|
113166
|
-
|
|
113167
|
-
|
|
113168
|
-
|
|
113169
|
-
|
|
113170
|
-
|
|
113171
|
-
|
|
113172
|
-
|
|
113173
|
-
|
|
113174
|
-
|
|
113175
|
-
}
|
|
113176
|
-
|
|
113178
|
+
let exitCode = null;
|
|
113179
|
+
let exitSignal = null;
|
|
113180
|
+
const rejectExited = () => {
|
|
113181
|
+
const detail = statusBuf ? statusBuf : stderrBuf.trim() ? `code=${exitCode} signal=${exitSignal}. stderr=${stderrBuf.trim().slice(0, 200)}` : `code=${exitCode} signal=${exitSignal}`;
|
|
113182
|
+
reject(
|
|
113183
|
+
new HelperSpawnError(
|
|
113184
|
+
`am instrument exited before becoming ready: ${detail}`,
|
|
113185
|
+
{
|
|
113186
|
+
error_code: FAILURE_CODES.ANDROID_DEVTOOLS_HELPER_EXITED_BEFORE_READY,
|
|
113187
|
+
failure_stage: "android_devtools_helper_ready",
|
|
113188
|
+
failure_area: "tool_server",
|
|
113189
|
+
error_kind: "subprocess",
|
|
113190
|
+
failure_command: "android_devtools",
|
|
113191
|
+
...typeof exitCode === "number" ? { failure_exit_code: exitCode } : {},
|
|
113192
|
+
...exitSignal === "SIGABRT" || exitSignal === "SIGHUP" || exitSignal === "SIGINT" || exitSignal === "SIGKILL" || exitSignal === "SIGQUIT" || exitSignal === "SIGTERM" ? { failure_signal: exitSignal } : {}
|
|
113193
|
+
},
|
|
113194
|
+
classifyHelperSpawnFault(statusBuf)
|
|
113177
113195
|
)
|
|
113178
113196
|
);
|
|
113197
|
+
};
|
|
113198
|
+
proc.on("exit", (code, signal) => {
|
|
113199
|
+
exitCode = code;
|
|
113200
|
+
exitSignal = signal;
|
|
113201
|
+
exitGrace = setTimeout(() => settle(rejectExited), EXIT_GRACE_MS);
|
|
113179
113202
|
});
|
|
113203
|
+
proc.on("close", () => settle(rejectExited));
|
|
113180
113204
|
proc.on("error", (err) => {
|
|
113181
113205
|
settle(
|
|
113182
113206
|
() => reject(
|
|
@@ -113211,6 +113235,50 @@ async function spawnHelper(serial) {
|
|
|
113211
113235
|
}, READY_TIMEOUT_MS2);
|
|
113212
113236
|
});
|
|
113213
113237
|
}
|
|
113238
|
+
async function installHelper(serial, options) {
|
|
113239
|
+
try {
|
|
113240
|
+
await ensureAndroidDevtoolsInstalled(serial, options);
|
|
113241
|
+
} catch (err) {
|
|
113242
|
+
const cause = err instanceof Error ? err : new Error(String(err));
|
|
113243
|
+
const reason = cause.message.replace(/^.*? failed: /s, "").replace(/\s+/g, " ").trim().slice(0, 200);
|
|
113244
|
+
throw new FailureError(
|
|
113245
|
+
`the argent android helper is not installed on ${serial} and could not be installed: ${reason}`,
|
|
113246
|
+
{
|
|
113247
|
+
error_code: FAILURE_CODES.ANDROID_DEVTOOLS_HELPER_INSTALL_FAILED,
|
|
113248
|
+
failure_stage: "android_devtools_helper_install",
|
|
113249
|
+
failure_area: "tool_server",
|
|
113250
|
+
error_kind: "subprocess",
|
|
113251
|
+
failure_command: "adb"
|
|
113252
|
+
},
|
|
113253
|
+
{ cause }
|
|
113254
|
+
);
|
|
113255
|
+
}
|
|
113256
|
+
}
|
|
113257
|
+
async function spawnHelperWithRepair(serial) {
|
|
113258
|
+
await installHelper(serial, {});
|
|
113259
|
+
try {
|
|
113260
|
+
return await spawnHelper(serial);
|
|
113261
|
+
} catch (err) {
|
|
113262
|
+
if (!(err instanceof HelperSpawnError) || err.fault !== "instrumentation-missing") throw err;
|
|
113263
|
+
await installHelper(serial, { force: true });
|
|
113264
|
+
try {
|
|
113265
|
+
return await spawnHelper(serial);
|
|
113266
|
+
} catch (repairErr) {
|
|
113267
|
+
if (!(repairErr instanceof HelperSpawnError)) throw repairErr;
|
|
113268
|
+
throw new FailureError(
|
|
113269
|
+
`the argent android helper could not start on ${serial} even after reinstalling it: ${repairErr.message}`,
|
|
113270
|
+
{
|
|
113271
|
+
error_code: FAILURE_CODES.ANDROID_DEVTOOLS_HELPER_REPAIR_FAILED,
|
|
113272
|
+
failure_stage: "android_devtools_helper_repair",
|
|
113273
|
+
failure_area: "tool_server",
|
|
113274
|
+
error_kind: "subprocess",
|
|
113275
|
+
failure_command: "android_devtools"
|
|
113276
|
+
},
|
|
113277
|
+
{ cause: repairErr }
|
|
113278
|
+
);
|
|
113279
|
+
}
|
|
113280
|
+
}
|
|
113281
|
+
}
|
|
113214
113282
|
async function removeAdbForward(serial, localPort) {
|
|
113215
113283
|
try {
|
|
113216
113284
|
await runAdb(["-s", serial, "forward", "--remove", `tcp:${localPort}`], { timeoutMs: 5e3 });
|
|
@@ -113260,8 +113328,7 @@ var androidDevtoolsBlueprint = {
|
|
|
113260
113328
|
}
|
|
113261
113329
|
const serial = device.id;
|
|
113262
113330
|
const events = new TypedEventEmitter();
|
|
113263
|
-
await
|
|
113264
|
-
const spawned = await spawnHelper(serial);
|
|
113331
|
+
const spawned = await spawnHelperWithRepair(serial);
|
|
113265
113332
|
let ready2 = false;
|
|
113266
113333
|
let disposed = false;
|
|
113267
113334
|
let client2;
|
|
@@ -115528,13 +115595,13 @@ async function ensureRunnerArtifact(config2, opts = {}) {
|
|
|
115528
115595
|
xcodeVersionFingerprint()
|
|
115529
115596
|
]);
|
|
115530
115597
|
const staticArgs = runnerBuildStaticArgs(projectPath, config2);
|
|
115531
|
-
const
|
|
115598
|
+
const cacheKey2 = computeRunnerCacheKey(sourcesHash, xcodeVersion, staticArgs);
|
|
115532
115599
|
const derivedDataPath = derivedDir();
|
|
115533
115600
|
const build = opts.build ?? buildRunnerArtifact;
|
|
115534
115601
|
return withRunnerBuildLock(async () => {
|
|
115535
115602
|
const stampPath = path21.join(derivedDataPath, CACHE_KEY_FILE);
|
|
115536
115603
|
const stamped = await fsp.readFile(stampPath, "utf8").catch(() => null);
|
|
115537
|
-
if (!opts.force && stamped ===
|
|
115604
|
+
if (!opts.force && stamped === cacheKey2) {
|
|
115538
115605
|
const cached3 = findBaseXctestrun(derivedDataPath);
|
|
115539
115606
|
const expiresAt = await readRunnerExpiryDate(derivedDataPath);
|
|
115540
115607
|
const needsRenew = expiresAt !== null && profileNeedsRenewal(expiresAt, /* @__PURE__ */ new Date());
|
|
@@ -115546,14 +115613,14 @@ async function ensureRunnerArtifact(config2, opts = {}) {
|
|
|
115546
115613
|
};
|
|
115547
115614
|
}
|
|
115548
115615
|
}
|
|
115549
|
-
if (stamped !==
|
|
115616
|
+
if (stamped !== cacheKey2) {
|
|
115550
115617
|
await fsp.rm(derivedDataPath, {
|
|
115551
115618
|
recursive: true,
|
|
115552
115619
|
force: true
|
|
115553
115620
|
});
|
|
115554
115621
|
}
|
|
115555
115622
|
const built = await build(derivedDataPath, staticArgs, opts.destinationUdid);
|
|
115556
|
-
await fsp.writeFile(stampPath,
|
|
115623
|
+
await fsp.writeFile(stampPath, cacheKey2);
|
|
115557
115624
|
return built;
|
|
115558
115625
|
});
|
|
115559
115626
|
}
|
|
@@ -119852,17 +119919,17 @@ var reactProfilerSessionBlueprint = {
|
|
|
119852
119919
|
}
|
|
119853
119920
|
};
|
|
119854
119921
|
var profilerPathsCache = /* @__PURE__ */ new Map();
|
|
119855
|
-
function
|
|
119922
|
+
function cacheKey(port, deviceId) {
|
|
119856
119923
|
return `${port}:${deviceId}`;
|
|
119857
119924
|
}
|
|
119858
119925
|
function cacheProfilerPaths(port, paths, deviceId) {
|
|
119859
|
-
profilerPathsCache.set(
|
|
119926
|
+
profilerPathsCache.set(cacheKey(port, deviceId), paths);
|
|
119860
119927
|
}
|
|
119861
119928
|
function getCachedProfilerPaths(port, deviceId) {
|
|
119862
|
-
return profilerPathsCache.get(
|
|
119929
|
+
return profilerPathsCache.get(cacheKey(port, deviceId));
|
|
119863
119930
|
}
|
|
119864
119931
|
function clearCachedProfilerPaths(port, deviceId) {
|
|
119865
|
-
profilerPathsCache.delete(
|
|
119932
|
+
profilerPathsCache.delete(cacheKey(port, deviceId));
|
|
119866
119933
|
}
|
|
119867
119934
|
|
|
119868
119935
|
// ../tool-server/src/tools/devices/boot-device.ts
|
|
@@ -148090,10 +148157,7 @@ async function queryAndroidFullHierarchy(registry2, device) {
|
|
|
148090
148157
|
devtools = await registry2.resolveService(ref.urn, ref.options);
|
|
148091
148158
|
} catch (err) {
|
|
148092
148159
|
const msg = err instanceof Error ? err.message : String(err);
|
|
148093
|
-
throw new Error(
|
|
148094
|
-
`the android devtools helper is unavailable (${msg}) \u2014 flows resolve testID selectors against the full hierarchy it serves; confirm the device is unlocked and the helper can be installed (\`adb install -t\`)`,
|
|
148095
|
-
{ cause: err }
|
|
148096
|
-
);
|
|
148160
|
+
throw new Error(`the argent android helper is unavailable: ${msg}`, { cause: err });
|
|
148097
148161
|
}
|
|
148098
148162
|
const [{ xml }, size] = await Promise.all([
|
|
148099
148163
|
// clearCache: await/assert polls must see text changes, not cached reads.
|
|
@@ -149684,6 +149748,10 @@ function roleOnlySelectorWarning(selector) {
|
|
|
149684
149748
|
if (selector.text !== void 0 || selector.textMatches !== void 0) return void 0;
|
|
149685
149749
|
return `selector ${describeSelector(selector)} matches by role alone (the tapped element has no id or visible text) \u2014 replay takes whichever element of that role ranks first, so re-record against a labelled element if that is not reliably this one`;
|
|
149686
149750
|
}
|
|
149751
|
+
function innermostTreeReason(message) {
|
|
149752
|
+
const unwrapped = /helper is unavailable:\s*(.+)/s.exec(message)?.[1] ?? message;
|
|
149753
|
+
return unwrapped.replace(/^\[[^\]]+\]\s*/, "").trim();
|
|
149754
|
+
}
|
|
149687
149755
|
async function captureTapSelector(registry2, session, udid, point) {
|
|
149688
149756
|
try {
|
|
149689
149757
|
const device = resolveDevice(udid);
|
|
@@ -149715,8 +149783,9 @@ async function captureTapSelector(registry2, session, udid, point) {
|
|
|
149715
149783
|
].filter((w) => w !== void 0);
|
|
149716
149784
|
return { selector, ...warnings.length > 0 ? { warning: warnings.join("; ") } : {} };
|
|
149717
149785
|
} catch (err) {
|
|
149786
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
149718
149787
|
return {
|
|
149719
|
-
warning: `selector capture failed (${
|
|
149788
|
+
warning: `selector capture failed (${innermostTreeReason(message)}); kept coordinates`
|
|
149720
149789
|
};
|
|
149721
149790
|
}
|
|
149722
149791
|
}
|
|
@@ -154224,9 +154293,9 @@ async function androidDevtoolsReady(registry2, device) {
|
|
|
154224
154293
|
try {
|
|
154225
154294
|
const ref = androidDevtoolsRef(device);
|
|
154226
154295
|
const api = await registry2.resolveService(ref.urn, ref.options);
|
|
154227
|
-
return api.isReady();
|
|
154228
|
-
} catch {
|
|
154229
|
-
return false;
|
|
154296
|
+
return { ready: api.isReady() };
|
|
154297
|
+
} catch (err) {
|
|
154298
|
+
return { ready: false, reason: err instanceof Error ? err.message : String(err) };
|
|
154230
154299
|
}
|
|
154231
154300
|
}
|
|
154232
154301
|
async function treeSourceGate(registry2, device, bundleId, signal) {
|
|
@@ -154246,9 +154315,9 @@ async function treeSourceGate(registry2, device, bundleId, signal) {
|
|
|
154246
154315
|
}
|
|
154247
154316
|
}
|
|
154248
154317
|
if (device.platform === "android" && !signal?.aborted) {
|
|
154249
|
-
const ready2 = await androidDevtoolsReady(registry2, device);
|
|
154318
|
+
const { ready: ready2, reason } = await androidDevtoolsReady(registry2, device);
|
|
154250
154319
|
if (!ready2 && !signal?.aborted) {
|
|
154251
|
-
return
|
|
154320
|
+
return reason ? `the argent android helper is unavailable: ${reason}` : `the argent android helper is unavailable (full-hierarchy source for testID selectors).`;
|
|
154252
154321
|
}
|
|
154253
154322
|
}
|
|
154254
154323
|
if (device.platform === "vega" && !signal?.aborted) {
|
package/package.json
CHANGED
|
@@ -74,11 +74,11 @@ A normally injectable app that is broken in the environment gets the same coordi
|
|
|
74
74
|
|
|
75
75
|
While the required source is down, selector failures and raw-point capture are void. Restore the source and re-record affected taps.
|
|
76
76
|
|
|
77
|
-
| Platform | Symptom
|
|
78
|
-
| -------- |
|
|
79
|
-
| Android | Cannot reach the
|
|
80
|
-
| Chromium | No reachable CDP session
|
|
81
|
-
| Vega | Toolkit returns no page source
|
|
77
|
+
| Platform | Symptom | Recovery |
|
|
78
|
+
| -------- | -------------------------------------- | -------------------------------------------------------------------------------- |
|
|
79
|
+
| Android | Cannot reach the argent android helper | Argent reinstalls it once; if it persists, read the device's reason in the error |
|
|
80
|
+
| Chromium | No reachable CDP session | Boot again with `electronAppPath` and remote debugging |
|
|
81
|
+
| Vega | Toolkit returns no page source | Relaunch an app built with automation support |
|
|
82
82
|
|
|
83
83
|
On Android, healthy `describe` output does not prove the flow tree is available. It can fall back to legacy `uiautomator`, while the runner refuses that trimmed fallback.
|
|
84
84
|
|