@swmansion/argent 0.35.1-next.0 → 0.35.1-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-cmds.mjs +1 -1
- package/dist/installer.mjs +1 -1
- package/dist/tool-server.cjs +155 -23
- package/package.json +2 -2
package/dist/cli-cmds.mjs
CHANGED
|
@@ -38575,7 +38575,7 @@ function isCi(env = process.env) {
|
|
|
38575
38575
|
var SESSION_ID2 = randomUUID5();
|
|
38576
38576
|
function readCliVersion() {
|
|
38577
38577
|
if (true) {
|
|
38578
|
-
return "0.35.1-next.
|
|
38578
|
+
return "0.35.1-next.2";
|
|
38579
38579
|
}
|
|
38580
38580
|
return "0.0.0";
|
|
38581
38581
|
}
|
package/dist/installer.mjs
CHANGED
|
@@ -16998,7 +16998,7 @@ function isCi(env = process.env) {
|
|
|
16998
16998
|
var SESSION_ID = randomUUID4();
|
|
16999
16999
|
function readCliVersion() {
|
|
17000
17000
|
if (true) {
|
|
17001
|
-
return "0.35.1-next.
|
|
17001
|
+
return "0.35.1-next.2";
|
|
17002
17002
|
}
|
|
17003
17003
|
return "0.0.0";
|
|
17004
17004
|
}
|
package/dist/tool-server.cjs
CHANGED
|
@@ -55730,7 +55730,7 @@ async function adbShellInput(serial, shellCommand, input2, options = {}) {
|
|
|
55730
55730
|
const adbPath = await resolveAdbOrThrow();
|
|
55731
55731
|
const argv = adbArgv(["-s", serial, "shell", shellCommand]);
|
|
55732
55732
|
return new Promise((resolve21, reject) => {
|
|
55733
|
-
const child = (0,
|
|
55733
|
+
const child = (0, import_node_child_process17.execFile)(
|
|
55734
55734
|
adbPath,
|
|
55735
55735
|
argv,
|
|
55736
55736
|
{
|
|
@@ -56052,11 +56052,11 @@ async function hasDefaultBootSnapshot(avdName) {
|
|
|
56052
56052
|
return false;
|
|
56053
56053
|
}
|
|
56054
56054
|
}
|
|
56055
|
-
var
|
|
56055
|
+
var import_node_child_process17, import_node_util13, import_node_os5, import_node_path10, import_ini, execFileAsync13, emulatorFlagSupportCache, ADB_KILL_SIGNAL, ADB_DEVICE_STATES, ADB_DEVICES_TIMEOUT_MS, ENRICH_TIMEOUT_MS, androidRuntimeKindCache, TERMINAL_ADB_ERROR_PATTERNS, AVD_NAME_PATTERN;
|
|
56056
56056
|
var init_adb = __esm({
|
|
56057
56057
|
"../tool-server/src/utils/adb.ts"() {
|
|
56058
56058
|
"use strict";
|
|
56059
|
-
|
|
56059
|
+
import_node_child_process17 = require("node:child_process");
|
|
56060
56060
|
import_node_util13 = require("node:util");
|
|
56061
56061
|
import_node_os5 = require("node:os");
|
|
56062
56062
|
import_node_path10 = require("node:path");
|
|
@@ -56065,7 +56065,7 @@ var init_adb = __esm({
|
|
|
56065
56065
|
init_android_binary();
|
|
56066
56066
|
init_subprocess_error();
|
|
56067
56067
|
init_external_devices();
|
|
56068
|
-
execFileAsync13 = (0, import_node_util13.promisify)(
|
|
56068
|
+
execFileAsync13 = (0, import_node_util13.promisify)(import_node_child_process17.execFile);
|
|
56069
56069
|
emulatorFlagSupportCache = /* @__PURE__ */ new Map();
|
|
56070
56070
|
ADB_KILL_SIGNAL = "SIGKILL";
|
|
56071
56071
|
ADB_DEVICE_STATES = /* @__PURE__ */ new Set([
|
|
@@ -72948,7 +72948,7 @@ function isCi(env = process.env) {
|
|
|
72948
72948
|
var SESSION_ID = (0, import_node_crypto3.randomUUID)();
|
|
72949
72949
|
function readCliVersion() {
|
|
72950
72950
|
if (true) {
|
|
72951
|
-
return "0.35.1-next.
|
|
72951
|
+
return "0.35.1-next.2";
|
|
72952
72952
|
}
|
|
72953
72953
|
return "0.0.0";
|
|
72954
72954
|
}
|
|
@@ -75331,7 +75331,7 @@ var import_express = __toESM(require_express2());
|
|
|
75331
75331
|
init_src();
|
|
75332
75332
|
|
|
75333
75333
|
// ../tool-server/src/blueprints/simulator-server.ts
|
|
75334
|
-
var
|
|
75334
|
+
var import_node_child_process18 = require("node:child_process");
|
|
75335
75335
|
var readline = __toESM(require("node:readline"));
|
|
75336
75336
|
init_src2();
|
|
75337
75337
|
init_src();
|
|
@@ -97218,10 +97218,16 @@ var nativeDevtoolsBlueprint = {
|
|
|
97218
97218
|
attachNdjsonReader(socket, {
|
|
97219
97219
|
onDropped: reportDroppedFrameToStderr(`native-devtools ${udid.slice(0, 8)}`),
|
|
97220
97220
|
onMessage: (parsed2) => {
|
|
97221
|
+
if (socket.destroyed) return;
|
|
97221
97222
|
const msg = parsed2;
|
|
97222
97223
|
if (bundleId === null) {
|
|
97223
97224
|
if (msg.type !== "Control") return;
|
|
97224
|
-
|
|
97225
|
+
const id = msg.payload?.bundleId;
|
|
97226
|
+
if (typeof id !== "string" || !isInjectableBundleId(id)) {
|
|
97227
|
+
socket.destroy();
|
|
97228
|
+
return;
|
|
97229
|
+
}
|
|
97230
|
+
bundleId = id;
|
|
97225
97231
|
const existing = connections3.get(bundleId);
|
|
97226
97232
|
if (existing) {
|
|
97227
97233
|
closeConnection(bundleId, existing);
|
|
@@ -97942,6 +97948,79 @@ function startSimulatorWatcher(registry2) {
|
|
|
97942
97948
|
};
|
|
97943
97949
|
}
|
|
97944
97950
|
|
|
97951
|
+
// ../tool-server/src/utils/android-agent-reap.ts
|
|
97952
|
+
init_src2();
|
|
97953
|
+
init_adb();
|
|
97954
|
+
var AGENT_SOCKET_RE = /localabstract:(screen-sharing-agent-\d+)/g;
|
|
97955
|
+
var SAFE_AGENT_SOCKET = /^screen-sharing-agent-\d+$/;
|
|
97956
|
+
var REAP_ADB_TIMEOUT_MS = 5e3;
|
|
97957
|
+
async function listAgentReverseSockets(serial) {
|
|
97958
|
+
try {
|
|
97959
|
+
const { stdout } = await runAdb(["-s", serial, "reverse", "--list"], {
|
|
97960
|
+
timeoutMs: REAP_ADB_TIMEOUT_MS
|
|
97961
|
+
});
|
|
97962
|
+
return new Set(Array.from(stdout.matchAll(AGENT_SOCKET_RE), (m) => m[1]));
|
|
97963
|
+
} catch {
|
|
97964
|
+
return null;
|
|
97965
|
+
}
|
|
97966
|
+
}
|
|
97967
|
+
async function detectAgentSocket(serial, before) {
|
|
97968
|
+
const after = await listAgentReverseSockets(serial);
|
|
97969
|
+
if (after == null) return null;
|
|
97970
|
+
const added = [...after].filter((socket) => !before.has(socket));
|
|
97971
|
+
if (added.length === 1) return added[0];
|
|
97972
|
+
if (added.length > 1) {
|
|
97973
|
+
process.stderr.write(
|
|
97974
|
+
`[argent] cannot tell which screen-sharing agent on ${serial} belongs to this session (${added.length} appeared at once); leaving all of them alone
|
|
97975
|
+
`
|
|
97976
|
+
);
|
|
97977
|
+
}
|
|
97978
|
+
return null;
|
|
97979
|
+
}
|
|
97980
|
+
async function reapAndroidScreenSharingAgent(serial, socket) {
|
|
97981
|
+
if (socket == null || !SAFE_AGENT_SOCKET.test(socket)) return;
|
|
97982
|
+
const pkill = runAdb(
|
|
97983
|
+
["-s", serial, "shell", `pkill -f 'screensharing[.]Main.*--socket=${socket}'`],
|
|
97984
|
+
{ timeoutMs: REAP_ADB_TIMEOUT_MS }
|
|
97985
|
+
).then(
|
|
97986
|
+
// Exit 0: a live agent was found, so the binary did not clean up after
|
|
97987
|
+
// itself. That is the one outcome worth a line.
|
|
97988
|
+
() => process.stderr.write(
|
|
97989
|
+
`[argent] stopped a leftover screen-sharing agent on ${serial} (socket ${socket})
|
|
97990
|
+
`
|
|
97991
|
+
),
|
|
97992
|
+
(err) => {
|
|
97993
|
+
if (getFailureSignal(err)?.failure_exit_code === 1) return;
|
|
97994
|
+
process.stderr.write(
|
|
97995
|
+
`[argent] could not stop the screen-sharing agent on ${serial}: ${err instanceof Error ? err.message : String(err)}
|
|
97996
|
+
`
|
|
97997
|
+
);
|
|
97998
|
+
}
|
|
97999
|
+
);
|
|
98000
|
+
const unreverse = runAdb(["-s", serial, "reverse", "--remove", `localabstract:${socket}`], {
|
|
98001
|
+
timeoutMs: REAP_ADB_TIMEOUT_MS
|
|
98002
|
+
}).catch(() => {
|
|
98003
|
+
});
|
|
98004
|
+
await Promise.all([pkill, unreverse]);
|
|
98005
|
+
}
|
|
98006
|
+
var pendingReaps = /* @__PURE__ */ new Set();
|
|
98007
|
+
function trackAgentReap(reap) {
|
|
98008
|
+
const tracked = reap.catch(() => {
|
|
98009
|
+
}).finally(() => pendingReaps.delete(tracked));
|
|
98010
|
+
pendingReaps.add(tracked);
|
|
98011
|
+
}
|
|
98012
|
+
async function settleAgentReaps(maxMs) {
|
|
98013
|
+
if (pendingReaps.size === 0) return;
|
|
98014
|
+
let timer;
|
|
98015
|
+
await Promise.race([
|
|
98016
|
+
Promise.all([...pendingReaps]),
|
|
98017
|
+
new Promise((resolve21) => {
|
|
98018
|
+
timer = setTimeout(resolve21, maxMs);
|
|
98019
|
+
})
|
|
98020
|
+
]);
|
|
98021
|
+
clearTimeout(timer);
|
|
98022
|
+
}
|
|
98023
|
+
|
|
97945
98024
|
// ../tool-server/src/blueprints/simulator-server.ts
|
|
97946
98025
|
var SIMULATOR_SERVER_NAMESPACE = "SimulatorServer";
|
|
97947
98026
|
function simulatorServerRef(device) {
|
|
@@ -97956,6 +98035,19 @@ var getPaths = () => {
|
|
|
97956
98035
|
return { BINARY_PATH, RUN_DIR };
|
|
97957
98036
|
};
|
|
97958
98037
|
var READY_TIMEOUT_MS = 3e4;
|
|
98038
|
+
var EXIT_GRACE_MS = 2500;
|
|
98039
|
+
function waitForExit(proc, timeoutMs) {
|
|
98040
|
+
if (proc.exitCode != null || proc.signalCode != null) return Promise.resolve();
|
|
98041
|
+
return new Promise((resolve21) => {
|
|
98042
|
+
const done = () => {
|
|
98043
|
+
clearTimeout(timer);
|
|
98044
|
+
proc.off("exit", done);
|
|
98045
|
+
resolve21();
|
|
98046
|
+
};
|
|
98047
|
+
const timer = setTimeout(done, timeoutMs);
|
|
98048
|
+
proc.once("exit", done);
|
|
98049
|
+
});
|
|
98050
|
+
}
|
|
97959
98051
|
var STDERR_DRAIN_MS = 250;
|
|
97960
98052
|
var STDERR_TAIL_LINES = 10;
|
|
97961
98053
|
var STDERR_MAX_LINE_CHARS = 500;
|
|
@@ -98073,10 +98165,21 @@ async function waitForFirstFrame(streamUrl) {
|
|
|
98073
98165
|
await stream.waitForFirstFrame(FIRST_FRAME_TIMEOUT_MS).catch(() => {
|
|
98074
98166
|
}).finally(() => stream.close());
|
|
98075
98167
|
}
|
|
98168
|
+
var NO_AGENT = Promise.resolve(null);
|
|
98169
|
+
async function spawnAndroidDevice(serial) {
|
|
98170
|
+
if (!SAFE_SIMULATOR_DEVICE_ID.test(serial)) {
|
|
98171
|
+
throw new Error(`Refusing to start simulator-server for unsafe device id "${serial}".`);
|
|
98172
|
+
}
|
|
98173
|
+
const before = await listAgentReverseSockets(serial);
|
|
98174
|
+
const server = await spawnSimulatorServerProcess(serial, "android_device");
|
|
98175
|
+
const agentSocket = before ? detectAgentSocket(serial, before) : NO_AGENT;
|
|
98176
|
+
return { ...server, agentSocket };
|
|
98177
|
+
}
|
|
98076
98178
|
async function spawnWithEmulatorFallback(device) {
|
|
98077
98179
|
const subcommand = subcommandForDevice(device);
|
|
98180
|
+
if (subcommand === "android_device") return spawnAndroidDevice(device.id);
|
|
98078
98181
|
try {
|
|
98079
|
-
return await spawnSimulatorServerProcess(device.id, subcommand);
|
|
98182
|
+
return { ...await spawnSimulatorServerProcess(device.id, subcommand), agentSocket: NO_AGENT };
|
|
98080
98183
|
} catch (err) {
|
|
98081
98184
|
const message = err instanceof Error ? err.message : String(err);
|
|
98082
98185
|
if (subcommand !== "android" || !EMULATOR_NOT_DISCOVERED.test(message)) throw err;
|
|
@@ -98084,7 +98187,7 @@ async function spawnWithEmulatorFallback(device) {
|
|
|
98084
98187
|
`[sim ${device.id}] emulator not found through gRPC discovery; falling back to the adb screen-sharing controller
|
|
98085
98188
|
`
|
|
98086
98189
|
);
|
|
98087
|
-
const server = await
|
|
98190
|
+
const server = await spawnAndroidDevice(device.id);
|
|
98088
98191
|
await waitForFirstFrame(server.streamUrl);
|
|
98089
98192
|
return server;
|
|
98090
98193
|
}
|
|
@@ -98102,7 +98205,7 @@ async function spawnSimulatorServerProcess(udid, subcommand) {
|
|
|
98102
98205
|
if (sdkRoot)
|
|
98103
98206
|
process.stderr.write(`[sim ${udid.slice(0, 8)}] android.sdkRoot \u2192 ANDROID_HOME=${sdkRoot}
|
|
98104
98207
|
`);
|
|
98105
|
-
const proc = (0,
|
|
98208
|
+
const proc = (0, import_node_child_process18.spawn)(BINARY_PATH, args, {
|
|
98106
98209
|
cwd: RUN_DIR,
|
|
98107
98210
|
stdio: ["pipe", "pipe", "pipe"],
|
|
98108
98211
|
...sdkRoot ? { env: { ...process.env, ANDROID_HOME: sdkRoot } } : {}
|
|
@@ -98300,7 +98403,7 @@ var simulatorServerBlueprint = {
|
|
|
98300
98403
|
`${SIMULATOR_SERVER_NAMESPACE}.factory does not support platform "${device.platform}". Use the platform-specific service blueprint instead.`
|
|
98301
98404
|
);
|
|
98302
98405
|
}
|
|
98303
|
-
const { proc, apiUrl, streamUrl } = await spawnWithEmulatorFallback(device);
|
|
98406
|
+
const { proc, apiUrl, streamUrl, agentSocket } = await spawnWithEmulatorFallback(device);
|
|
98304
98407
|
const events = new TypedEventEmitter();
|
|
98305
98408
|
proc.on("exit", (code) => {
|
|
98306
98409
|
events.emit(
|
|
@@ -98336,10 +98439,21 @@ var simulatorServerBlueprint = {
|
|
|
98336
98439
|
);
|
|
98337
98440
|
}
|
|
98338
98441
|
};
|
|
98442
|
+
let disposed = false;
|
|
98339
98443
|
const instance = {
|
|
98340
98444
|
api,
|
|
98341
98445
|
dispose: async () => {
|
|
98446
|
+
if (disposed) return;
|
|
98447
|
+
disposed = true;
|
|
98342
98448
|
proc.kill();
|
|
98449
|
+
trackAgentReap(
|
|
98450
|
+
(async () => {
|
|
98451
|
+
const socket = await agentSocket;
|
|
98452
|
+
if (!socket) return;
|
|
98453
|
+
await waitForExit(proc, EXIT_GRACE_MS);
|
|
98454
|
+
await reapAndroidScreenSharingAgent(device.id, socket);
|
|
98455
|
+
})()
|
|
98456
|
+
);
|
|
98343
98457
|
},
|
|
98344
98458
|
events
|
|
98345
98459
|
};
|
|
@@ -103525,10 +103639,11 @@ var axServiceBlueprint = {
|
|
|
103525
103639
|
|
|
103526
103640
|
// ../tool-server/src/utils/native-target-app.ts
|
|
103527
103641
|
init_src2();
|
|
103642
|
+
function isForegroundActive(app) {
|
|
103643
|
+
return app.applicationState === "active" || app.foregroundActiveSceneCount > 0;
|
|
103644
|
+
}
|
|
103528
103645
|
function chooseFrontmostConnectedApp(apps) {
|
|
103529
|
-
const strongCandidates = apps.filter(
|
|
103530
|
-
(app) => app.applicationState === "active" || app.foregroundActiveSceneCount > 0
|
|
103531
|
-
);
|
|
103646
|
+
const strongCandidates = apps.filter(isForegroundActive);
|
|
103532
103647
|
if (strongCandidates.length === 1) {
|
|
103533
103648
|
return strongCandidates[0];
|
|
103534
103649
|
}
|
|
@@ -103540,16 +103655,31 @@ function chooseFrontmostConnectedApp(apps) {
|
|
|
103540
103655
|
}
|
|
103541
103656
|
return null;
|
|
103542
103657
|
}
|
|
103543
|
-
async function inspectConnectedNativeApps(api) {
|
|
103544
|
-
|
|
103545
|
-
const
|
|
103658
|
+
async function inspectConnectedNativeApps(api, bundleIds = api.listConnectedBundleIds()) {
|
|
103659
|
+
let timeout;
|
|
103660
|
+
const responses = await Promise.all(
|
|
103661
|
+
bundleIds.map(async (bundleId) => {
|
|
103662
|
+
try {
|
|
103663
|
+
return await api.getAppState(bundleId);
|
|
103664
|
+
} catch (err) {
|
|
103665
|
+
if (!(err instanceof Error) || getFailureSignal(err)?.error_code !== FAILURE_CODES.NATIVE_DEVTOOLS_RPC_TIMEOUT) {
|
|
103666
|
+
throw err;
|
|
103667
|
+
}
|
|
103668
|
+
timeout ??= err;
|
|
103669
|
+
return null;
|
|
103670
|
+
}
|
|
103671
|
+
})
|
|
103672
|
+
);
|
|
103673
|
+
const appStates = responses.filter((state3) => state3 !== null);
|
|
103674
|
+
if (timeout && appStates.filter(isForegroundActive).length !== 1) throw timeout;
|
|
103546
103675
|
return appStates.sort((a, b) => a.bundleId.localeCompare(b.bundleId));
|
|
103547
103676
|
}
|
|
103548
103677
|
async function resolveNativeTargetApp(api, bundleId) {
|
|
103549
103678
|
if (bundleId) {
|
|
103550
103679
|
return { bundleId, source: "explicit" };
|
|
103551
103680
|
}
|
|
103552
|
-
const
|
|
103681
|
+
const bundleIds = api.listConnectedBundleIds();
|
|
103682
|
+
const connectedApps = await inspectConnectedNativeApps(api, bundleIds);
|
|
103553
103683
|
if (connectedApps.length === 0) {
|
|
103554
103684
|
throw new FailureError(
|
|
103555
103685
|
"No native-devtools-connected apps are available for auto-targeting. Launch or restart the app first, provide bundleId explicitly, or use screenshot to inspect visible Home/system UI.",
|
|
@@ -103562,7 +103692,7 @@ async function resolveNativeTargetApp(api, bundleId) {
|
|
|
103562
103692
|
);
|
|
103563
103693
|
}
|
|
103564
103694
|
const frontmost2 = chooseFrontmostConnectedApp(connectedApps);
|
|
103565
|
-
if (
|
|
103695
|
+
if (bundleIds.length === 1) {
|
|
103566
103696
|
if (frontmost2) {
|
|
103567
103697
|
return {
|
|
103568
103698
|
bundleId: connectedApps[0].bundleId,
|
|
@@ -105266,7 +105396,7 @@ function androidDevtoolsRef(device) {
|
|
|
105266
105396
|
};
|
|
105267
105397
|
}
|
|
105268
105398
|
var READY_TIMEOUT_MS2 = 3e4;
|
|
105269
|
-
var
|
|
105399
|
+
var EXIT_GRACE_MS2 = 200;
|
|
105270
105400
|
var HELPER_EXIT_TIMEOUT_MS = 3e3;
|
|
105271
105401
|
var DISPOSE_FORCE_STOP_WAIT_MS = 2e3;
|
|
105272
105402
|
var HELPER_PORT_MARKER = /^INSTRUMENTATION_STATUS:\s*port=(\d+)/;
|
|
@@ -105392,7 +105522,7 @@ async function spawnHelper(serial) {
|
|
|
105392
105522
|
proc.on("exit", (code, signal) => {
|
|
105393
105523
|
exitCode = code;
|
|
105394
105524
|
exitSignal = signal;
|
|
105395
|
-
exitGrace = setTimeout(() => settle3(rejectExited),
|
|
105525
|
+
exitGrace = setTimeout(() => settle3(rejectExited), EXIT_GRACE_MS2);
|
|
105396
105526
|
});
|
|
105397
105527
|
proc.on("close", () => settle3(rejectExited));
|
|
105398
105528
|
const timer = setTimeout(() => {
|
|
@@ -162665,7 +162795,7 @@ async function queryFullHierarchyTree(registry2, device, target) {
|
|
|
162665
162795
|
}
|
|
162666
162796
|
if (target.probeAnswered) {
|
|
162667
162797
|
throw new FailureError(
|
|
162668
|
-
`${bundleId} (the launched app) stopped answering Application.getState - the probe timed out although an earlier one in this run answered, so the app's main queue is no longer being serviced. For a pinned app that is usually the suspension iOS applies once an e2e test leaves it (e.g. a tap that opened another app), and a suspended app's hierarchy is not what is on screen; in-app work blocking the main thread past the probe timeout looks the same from here. Reading anyway parks on that same unserviced queue: certain to time out if the app is suspended, and paying the longer hierarchy timeout to find that out if it is not. If this e2e test's subject IS the other app, give the e2e test a \`launch:\` step for that app - it re-pins reads to it, and a pinned read probes only the app it names, so the silent ${bundleId} is never touched; \`tool: launch-app\` or \`tool: restart-app\` naming that app works too - each re-targets reads at the app it starts, and is how a recorded e2e test switches apps. A
|
|
162798
|
+
`${bundleId} (the launched app) stopped answering Application.getState - the probe timed out although an earlier one in this run answered, so the app's main queue is no longer being serviced. For a pinned app that is usually the suspension iOS applies once an e2e test leaves it (e.g. a tap that opened another app), and a suspended app's hierarchy is not what is on screen; in-app work blocking the main thread past the probe timeout looks the same from here. Reading anyway parks on that same unserviced queue: certain to time out if the app is suspended, and paying the longer hierarchy timeout to find that out if it is not. If this e2e test's subject IS the other app, give the e2e test a \`launch:\` step for that app - it re-pins reads to it, and a pinned read probes only the app it names, so the silent ${bundleId} is never touched; \`tool: launch-app\` or \`tool: restart-app\` naming that app works too - each re-targets reads at the app it starts, and is how a recorded e2e test switches apps. A raw \`tool:\` step that only demotes the pin leaves the choice to auto-resolve: if a connection times out, it needs exactly one foreground-active response. If the e2e test left ${bundleId} but is still about it, make it return before reading the UI. If it never left, the main thread is busy: raise the step's \`timeout:\` so the poll re-reads past the work, or \`launch\` ${bundleId} again.`,
|
|
162669
162799
|
{
|
|
162670
162800
|
// The timeout's own code, NOT
|
|
162671
162801
|
// NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND: nothing answered, so no
|
|
@@ -162681,7 +162811,7 @@ async function queryFullHierarchyTree(registry2, device, target) {
|
|
|
162681
162811
|
}
|
|
162682
162812
|
if (pinnedState && !chooseFrontmostConnectedApp([pinnedState])) {
|
|
162683
162813
|
throw new FailureError(
|
|
162684
|
-
`${bundleId} (the launched app) has no foreground presence at all (applicationState=${pinnedState.applicationState}, foregroundActiveScenes=${pinnedState.foregroundActiveSceneCount}, foregroundInactiveScenes=${pinnedState.foregroundInactiveSceneCount}) - a step in this e2e test left the app (e.g. a tap that opened another app), so a read of its hierarchy would describe a screen that is not on screen. Transitional states are NOT refused here: an \`inactive\` app, or one still holding a foreground scene, is read as usual - under a system alert or mid-transition it is still the app on screen. If this e2e test's subject IS another app, give the e2e test a \`launch:\` step for that app - it re-pins reads to it, and no wedged sibling connection can sink a pinned read; a raw \`tool:\` step demotes the pin and returns reads to frontmost auto-resolve, which
|
|
162814
|
+
`${bundleId} (the launched app) has no foreground presence at all (applicationState=${pinnedState.applicationState}, foregroundActiveScenes=${pinnedState.foregroundActiveSceneCount}, foregroundInactiveScenes=${pinnedState.foregroundInactiveSceneCount}) - a step in this e2e test left the app (e.g. a tap that opened another app), so a read of its hierarchy would describe a screen that is not on screen. Transitional states are NOT refused here: an \`inactive\` app, or one still holding a foreground scene, is read as usual - under a system alert or mid-transition it is still the app on screen. If this e2e test's subject IS another app, give the e2e test a \`launch:\` step for that app - it re-pins reads to it, and no wedged sibling connection can sink a pinned read; a raw \`tool:\` step demotes the pin and returns reads to frontmost auto-resolve, which needs exactly one foreground-active response if a connection times out. Otherwise make the e2e test return to ${bundleId} before reading the UI, or \`launch\` it again.`,
|
|
162685
162815
|
{
|
|
162686
162816
|
error_code: FAILURE_CODES.NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND,
|
|
162687
162817
|
failure_stage: "flow_tree_pinned_target",
|
|
@@ -173721,6 +173851,7 @@ function createPreviewWindowManager(opts = {}) {
|
|
|
173721
173851
|
// ../tool-server/src/index.ts
|
|
173722
173852
|
var PROCESS_TIMEOUT_MS = 5e3;
|
|
173723
173853
|
var EXIT_CAPTURE_WAIT_MS = 2e3;
|
|
173854
|
+
var EXIT_AGENT_REAP_WAIT_MS = 3e3;
|
|
173724
173855
|
var DEFAULT_PORT = "3001";
|
|
173725
173856
|
var DEFAULT_HOST = "127.0.0.1";
|
|
173726
173857
|
var DEFAULT_IDLE_TIMEOUT_MINUTES = "0";
|
|
@@ -173931,6 +174062,7 @@ function start() {
|
|
|
173931
174062
|
`);
|
|
173932
174063
|
}
|
|
173933
174064
|
});
|
|
174065
|
+
await settleAgentReaps(EXIT_AGENT_REAP_WAIT_MS);
|
|
173934
174066
|
try {
|
|
173935
174067
|
await eventLog?.dispose();
|
|
173936
174068
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swmansion/argent",
|
|
3
|
-
"version": "0.35.1-next.
|
|
3
|
+
"version": "0.35.1-next.2",
|
|
4
4
|
"mcpName": "io.github.software-mansion/argent",
|
|
5
5
|
"description": "MCP server for iOS Simulator, Android Emulator, Chromium app and Mac app control",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"vitest": "^5.0.5",
|
|
99
99
|
"yaml": "^2.9.1"
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "0f5f4c7e93d51e328f5231c48e5fa4dc1ae64c36"
|
|
102
102
|
}
|