@swmansion/argent 0.35.1-next.49 → 0.35.1-next.50
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/mcp-server.mjs +1 -1
- package/dist/tool-server.cjs +126 -40
- package/package.json +2 -2
package/dist/cli-cmds.mjs
CHANGED
|
@@ -38663,7 +38663,7 @@ function isCi(env = process.env) {
|
|
|
38663
38663
|
var SESSION_ID2 = randomUUID5();
|
|
38664
38664
|
function readCliVersion() {
|
|
38665
38665
|
if (true) {
|
|
38666
|
-
return "0.35.1-next.
|
|
38666
|
+
return "0.35.1-next.50";
|
|
38667
38667
|
}
|
|
38668
38668
|
return "0.0.0";
|
|
38669
38669
|
}
|
package/dist/installer.mjs
CHANGED
|
@@ -17118,7 +17118,7 @@ function isCi(env = process.env) {
|
|
|
17118
17118
|
var SESSION_ID = randomUUID4();
|
|
17119
17119
|
function readCliVersion() {
|
|
17120
17120
|
if (true) {
|
|
17121
|
-
return "0.35.1-next.
|
|
17121
|
+
return "0.35.1-next.50";
|
|
17122
17122
|
}
|
|
17123
17123
|
return "0.0.0";
|
|
17124
17124
|
}
|
package/dist/mcp-server.mjs
CHANGED
|
@@ -38222,7 +38222,7 @@ async function startMcpServer(options) {
|
|
|
38222
38222
|
const autoDescribeOn = autoDescribeEnabled();
|
|
38223
38223
|
const whatsNewOn = whatsNewEnabled();
|
|
38224
38224
|
const installedVersion = getInstalledVersion();
|
|
38225
|
-
const highlightsVersion = true ? "0.35.1-next.
|
|
38225
|
+
const highlightsVersion = true ? "0.35.1-next.50" : installedVersion;
|
|
38226
38226
|
const captureTimeoutMs = options.captureTimeoutMs ?? CAPTURE_TIMEOUT_MS;
|
|
38227
38227
|
const trees = createTreeMemory();
|
|
38228
38228
|
const screenshots = createScreenshotMemory();
|
package/dist/tool-server.cjs
CHANGED
|
@@ -73020,7 +73020,7 @@ function isCi(env = process.env) {
|
|
|
73020
73020
|
var SESSION_ID = (0, import_node_crypto3.randomUUID)();
|
|
73021
73021
|
function readCliVersion() {
|
|
73022
73022
|
if (true) {
|
|
73023
|
-
return "0.35.1-next.
|
|
73023
|
+
return "0.35.1-next.50";
|
|
73024
73024
|
}
|
|
73025
73025
|
return "0.0.0";
|
|
73026
73026
|
}
|
|
@@ -99970,6 +99970,27 @@ var MAX_CACHED_BODIES = 64;
|
|
|
99970
99970
|
var NOT_RECONNECTED = "the agent did not reconnect after its connection dropped, so this request's final events never arrived";
|
|
99971
99971
|
var PROCESS_ENDED = "the app process ended before the request finished";
|
|
99972
99972
|
var PROCESS_GONE = "the app process that made the request is gone";
|
|
99973
|
+
var MAX_REDIRECTS = 32;
|
|
99974
|
+
function appendRedirect(record2, previous, p, statusText, requestHeaders) {
|
|
99975
|
+
const response = asObject(p.redirectResponse);
|
|
99976
|
+
const next = asObject(p.request);
|
|
99977
|
+
const redirects = record2.redirects ??= [];
|
|
99978
|
+
if (redirects.length < MAX_REDIRECTS) {
|
|
99979
|
+
const status = typeof response.status === "number" ? response.status : 0;
|
|
99980
|
+
redirects.push({
|
|
99981
|
+
url: capString(asString2(response.url)) || previous.url,
|
|
99982
|
+
method: previous.method,
|
|
99983
|
+
status,
|
|
99984
|
+
statusText: statusText(status, capString(asString2(response.statusText))),
|
|
99985
|
+
headers: headerMap(response.headers),
|
|
99986
|
+
...requestHeaders ? { requestHeaders } : {}
|
|
99987
|
+
});
|
|
99988
|
+
}
|
|
99989
|
+
return {
|
|
99990
|
+
url: capString(asString2(next.url)) || previous.url,
|
|
99991
|
+
method: capString(asString2(next.method), 100) || previous.method
|
|
99992
|
+
};
|
|
99993
|
+
}
|
|
99973
99994
|
function isOpen(record2) {
|
|
99974
99995
|
return record2.state === "pending" || record2.state === "headers";
|
|
99975
99996
|
}
|
|
@@ -100787,6 +100808,7 @@ var NO_ANSWER = `the app did not answer within ${POST_DATA_WAIT_MS / 1e3} s; rea
|
|
|
100787
100808
|
var NO_EARLIER_ANSWER = `the app did not answer an earlier body read within ${RESPONSE_BODY_TIMEOUT_MS / 1e3} s; read it again later`;
|
|
100788
100809
|
var CONNECTION_CLOSED = "the agent's connection closed before this body was read";
|
|
100789
100810
|
var MACOS_CONNECTION_CLOSED = `${CONNECTION_CLOSED}; read it again after argent reconnects to the app, as network-capture-start does`;
|
|
100811
|
+
var IOS_CONNECTION_CLOSED = `${CONNECTION_CLOSED}; read it again once the app has reconnected, within a few seconds`;
|
|
100790
100812
|
var REQUEST_BODY_GONE = "the agent holds no body for this request";
|
|
100791
100813
|
var BODY_NO_LONGER_HELD = "the agent no longer holds this body";
|
|
100792
100814
|
var MACOS_CONNECTION_DROPPED = "argent's connection to the app dropped while this request ran, so argent can have missed its end; the request completes if its end comes later";
|
|
@@ -100851,6 +100873,19 @@ function createIosNetworkRecords(state3, link, recording = () => true, layer = "
|
|
|
100851
100873
|
const arrived = startArrivals.get(record2);
|
|
100852
100874
|
if (arrived !== void 0) record2.timing.durationMs = Math.round(performance.now() - arrived);
|
|
100853
100875
|
}
|
|
100876
|
+
const hops = /* @__PURE__ */ new WeakMap();
|
|
100877
|
+
function addHop(record2, p) {
|
|
100878
|
+
if (record2.state === "failed" && record2.errorText === MACOS_CONNECTION_DROPPED) {
|
|
100879
|
+
record2.state = "pending";
|
|
100880
|
+
delete record2.errorText;
|
|
100881
|
+
}
|
|
100882
|
+
const previous = hops.get(record2) ?? { url: record2.request.url, method: record2.request.method };
|
|
100883
|
+
hops.set(
|
|
100884
|
+
record2,
|
|
100885
|
+
appendRedirect(record2, previous, p, (status) => import_node_http2.STATUS_CODES[status] ?? "")
|
|
100886
|
+
);
|
|
100887
|
+
resize(record2);
|
|
100888
|
+
}
|
|
100854
100889
|
function resize(record2) {
|
|
100855
100890
|
if (!byId.has(record2.id)) return;
|
|
100856
100891
|
const size = recordSize(record2) + (inlineBodies.get(record2)?.text.length ?? 0);
|
|
@@ -100874,7 +100909,8 @@ function createIosNetworkRecords(state3, link, recording = () => true, layer = "
|
|
|
100874
100909
|
const live = link.liveConnection();
|
|
100875
100910
|
if (live !== void 0) sawConnection(live);
|
|
100876
100911
|
if (endedConnections.has(connection) || newestConnection > connection) return PROCESS_GONE;
|
|
100877
|
-
|
|
100912
|
+
if (!link.canReconnect?.(connection)) return CONNECTION_CLOSED;
|
|
100913
|
+
return layer === "macos-native" ? MACOS_CONNECTION_CLOSED : IOS_CONNECTION_CLOSED;
|
|
100878
100914
|
}
|
|
100879
100915
|
function readBody(id, kind) {
|
|
100880
100916
|
const record2 = byId.get(id);
|
|
@@ -101028,7 +101064,11 @@ function createIosNetworkRecords(state3, link, recording = () => true, layer = "
|
|
|
101028
101064
|
const layerId = typeof p.requestId === "string" ? p.requestId : null;
|
|
101029
101065
|
if (!layerId || layerId.length > MAX_LAYER_ID_CHARS) return;
|
|
101030
101066
|
if (method === "Network.requestWillBeSent") {
|
|
101031
|
-
if (p.redirectResponse !== void 0 && p.redirectResponse !== null)
|
|
101067
|
+
if (p.redirectResponse !== void 0 && p.redirectResponse !== null) {
|
|
101068
|
+
const hopped = byLayerId.get(keyOf(connection, layerId));
|
|
101069
|
+
if (hopped) addHop(hopped, p);
|
|
101070
|
+
return;
|
|
101071
|
+
}
|
|
101032
101072
|
if (recording()) startRecord(connection, layerId, p);
|
|
101033
101073
|
return;
|
|
101034
101074
|
}
|
|
@@ -101082,7 +101122,7 @@ function createIosNetworkRecords(state3, link, recording = () => true, layer = "
|
|
|
101082
101122
|
);
|
|
101083
101123
|
for (const record2 of open5) {
|
|
101084
101124
|
record2.state = "failed";
|
|
101085
|
-
record2.errorText = ended ? PROCESS_ENDED : layer === "macos-native" ? MACOS_CONNECTION_DROPPED : NOT_RECONNECTED;
|
|
101125
|
+
record2.errorText = ended ? PROCESS_ENDED : layer === "macos-native" || check3.reconnects ? MACOS_CONNECTION_DROPPED : NOT_RECONNECTED;
|
|
101086
101126
|
cleared.delete(record2);
|
|
101087
101127
|
}
|
|
101088
101128
|
for (const record2 of open5) resize(record2);
|
|
@@ -101183,11 +101223,11 @@ function buildAppStateMessage(bundleId, state3) {
|
|
|
101183
101223
|
case "not_running":
|
|
101184
101224
|
return `${bundleId} has no running process on this simulator, so there is no injected process to read. Call launch-app (or restart-app) then retry. If that launch fails rather than starting the app, the bundle id is not installed on this device \u2014 this state cannot tell the two apart; install it and no relaunch will be needed.`;
|
|
101185
101225
|
case "stale_process":
|
|
101186
|
-
return `The running ${bundleId} process cannot reach this simulator's native-devtools endpoint \u2014 it was launched either before argent's instrumentation was in place or against an earlier tool-server's listener. A fresh process picks up the current one: call restart-app then retry.`;
|
|
101226
|
+
return `The running ${bundleId} process cannot reach this simulator's native-devtools endpoint \u2014 it was launched either before argent's instrumentation was in place or against an earlier tool-server's listener, and it has not dialed this one. A fresh process picks up the current one: call restart-app then retry.`;
|
|
101187
101227
|
case "unregistered":
|
|
101188
101228
|
return `${bundleId} is running with argent's native devtools injected and pointed at this simulator's devtools endpoint, but the service never registered its connection. Restarting the app cannot change that \u2014 it already launched under exactly the terms a restart would recreate. Restart the tool-server (\`argent server stop && argent server start --detach\`) and retry. If you have already restarted the tool-server for this app and it reads this way again, stop: the process is loading argent's dylib but never dialing, which no further restart on either side fixes. Treat native devtools as unavailable \u2014 read the screen with describe or screenshot and drive it by coordinate.`;
|
|
101189
101229
|
case "connecting":
|
|
101190
|
-
return `${bundleId} is running with argent's native devtools injected and pointed at this simulator's devtools endpoint, and it launched moments ago \u2014 its connection has not finished being established. Wait a few seconds and retry the same call. Do NOT restart the app: launching it is what starts the connection, so a relaunch discards the one in progress and returns you to this same state.`;
|
|
101230
|
+
return `${bundleId} is running with argent's native devtools injected and pointed at this simulator's devtools endpoint, and it launched moments ago, or this tool-server started moments ago and the app is reconnecting \u2014 its connection has not finished being established. Wait a few seconds and retry the same call. Do NOT restart the app: launching it is what starts the connection, so a relaunch discards the one in progress and returns you to this same state.`;
|
|
101191
101231
|
case "indeterminate":
|
|
101192
101232
|
return `Native devtools are not connected to ${bundleId}, and its process could not be inspected to tell whether it is injected. Call restart-app then retry. If it is still not connected after that restart, the native-devtools service is stale rather than the app being uninjected \u2014 do not keep restarting the app; restart the tool-server (\`argent server stop && argent server start --detach\`) and retry.`;
|
|
101193
101233
|
case "provider_attached":
|
|
@@ -101303,6 +101343,10 @@ function closedBeforeRequest(bundleId, method) {
|
|
|
101303
101343
|
}
|
|
101304
101344
|
);
|
|
101305
101345
|
}
|
|
101346
|
+
var NATIVE_DEVTOOLS_RECONNECT_WINDOW_MS = 6e3;
|
|
101347
|
+
function handshakeCount(value) {
|
|
101348
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : void 0;
|
|
101349
|
+
}
|
|
101306
101350
|
function getNativeDevtoolsSocketPath(udid) {
|
|
101307
101351
|
return `/tmp/argent-nd-${udid.slice(0, 8)}.sock`;
|
|
101308
101352
|
}
|
|
@@ -101393,6 +101437,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
101393
101437
|
const socketPath = getNativeDevtoolsSocketPath(udid);
|
|
101394
101438
|
const endpoint = transport === "tcp" ? { transport: "tcp" } : { transport: "unix", socketPath };
|
|
101395
101439
|
const connections3 = /* @__PURE__ */ new Map();
|
|
101440
|
+
const reconnectingProcesses = /* @__PURE__ */ new Map();
|
|
101396
101441
|
let nextConnectionIndex = 1;
|
|
101397
101442
|
const networkStores = /* @__PURE__ */ new Map();
|
|
101398
101443
|
const pendingRpc = /* @__PURE__ */ new Map();
|
|
@@ -101563,19 +101608,29 @@ var nativeDevtoolsBlueprint = {
|
|
|
101563
101608
|
const settleClosedConnection = async (bundleId, conn) => {
|
|
101564
101609
|
const store = networkStores.get(bundleId);
|
|
101565
101610
|
if (lentSocketPath || disposed || !store) return;
|
|
101611
|
+
const reconnected = () => connections3.get(bundleId)?.index === conn.index;
|
|
101612
|
+
const superseded = () => {
|
|
101613
|
+
const live = connections3.get(bundleId);
|
|
101614
|
+
return live !== void 0 && live !== conn;
|
|
101615
|
+
};
|
|
101566
101616
|
if (!store.holdsRecordsOf(conn.index)) {
|
|
101567
|
-
|
|
101568
|
-
|
|
101617
|
+
store.connectionClosed(conn.index, {
|
|
101618
|
+
superseded: superseded(),
|
|
101619
|
+
reconnects: conn.reconnects
|
|
101620
|
+
});
|
|
101569
101621
|
return;
|
|
101570
101622
|
}
|
|
101623
|
+
if (conn.reconnects) {
|
|
101624
|
+
store.connectionClosed(conn.index, { superseded: superseded(), reconnects: true });
|
|
101625
|
+
}
|
|
101571
101626
|
const inspection = await host.inspectRunningApp(udid, bundleId).catch(() => null);
|
|
101572
|
-
if (disposed) return;
|
|
101573
|
-
const live = connections3.get(bundleId);
|
|
101627
|
+
if (disposed || reconnected()) return;
|
|
101574
101628
|
store.connectionClosed(conn.index, {
|
|
101575
|
-
superseded:
|
|
101629
|
+
superseded: superseded(),
|
|
101576
101630
|
...inspection ? { running: inspection.running } : {},
|
|
101577
101631
|
...inspection?.process ? { runningPid: inspection.process.pid } : {},
|
|
101578
|
-
...conn.pid !== void 0 ? { connectionPid: conn.pid } : {}
|
|
101632
|
+
...conn.pid !== void 0 ? { connectionPid: conn.pid } : {},
|
|
101633
|
+
reconnects: conn.reconnects
|
|
101579
101634
|
});
|
|
101580
101635
|
};
|
|
101581
101636
|
const closeConnection = (bundleId, conn) => {
|
|
@@ -101585,6 +101640,8 @@ var nativeDevtoolsBlueprint = {
|
|
|
101585
101640
|
connections3.delete(bundleId);
|
|
101586
101641
|
unconfirmedStopBundleIds.delete(bundleId);
|
|
101587
101642
|
}
|
|
101643
|
+
const known = reconnectingProcesses.get(bundleId);
|
|
101644
|
+
if (known?.index === conn.index) known.closedAt = Date.now();
|
|
101588
101645
|
connectionCloses += 1;
|
|
101589
101646
|
wakeConnectionWaiters();
|
|
101590
101647
|
void settleClosedConnection(bundleId, conn);
|
|
@@ -101757,24 +101814,47 @@ var nativeDevtoolsBlueprint = {
|
|
|
101757
101814
|
const msg = parsed2;
|
|
101758
101815
|
if (bundleId === null) {
|
|
101759
101816
|
if (msg.type !== "Control") return;
|
|
101760
|
-
|
|
101817
|
+
if (typeof msg.payload !== "object" || msg.payload === null) {
|
|
101818
|
+
socket.destroy();
|
|
101819
|
+
return;
|
|
101820
|
+
}
|
|
101821
|
+
const id = msg.payload.bundleId;
|
|
101761
101822
|
if (typeof id !== "string" || !isInjectableBundleId(id)) {
|
|
101762
101823
|
socket.destroy();
|
|
101763
101824
|
return;
|
|
101764
101825
|
}
|
|
101765
101826
|
bundleId = id;
|
|
101827
|
+
const handshakePid = lentSocketPath ? void 0 : handshakeCount(msg.payload.pid);
|
|
101828
|
+
const dial = lentSocketPath ? void 0 : handshakeCount(msg.payload.dial);
|
|
101829
|
+
const reconnects = dial !== void 0 && handshakePid !== void 0;
|
|
101830
|
+
const earlier = reconnectingProcesses.get(bundleId);
|
|
101831
|
+
const sameProcess = reconnects && dial > 1 && earlier?.pid === handshakePid ? earlier : void 0;
|
|
101766
101832
|
const existing = connections3.get(bundleId);
|
|
101767
101833
|
if (existing) {
|
|
101768
101834
|
closeConnection(bundleId, existing);
|
|
101769
101835
|
existing.socket.destroy();
|
|
101770
101836
|
}
|
|
101837
|
+
if (earlier && !sameProcess) {
|
|
101838
|
+
networkStores.get(bundleId)?.connectionClosed(earlier.index, { superseded: true });
|
|
101839
|
+
reconnectingProcesses.delete(bundleId);
|
|
101840
|
+
}
|
|
101771
101841
|
conn = {
|
|
101772
101842
|
socket,
|
|
101773
|
-
index: nextConnectionIndex++,
|
|
101843
|
+
index: sameProcess?.index ?? nextConnectionIndex++,
|
|
101774
101844
|
cdp: createNdjsonCdpRequester(socket, { label: `native-devtools ${bundleId}` }),
|
|
101775
|
-
armed: false
|
|
101845
|
+
armed: false,
|
|
101846
|
+
reconnects,
|
|
101847
|
+
...handshakePid !== void 0 ? { pid: handshakePid } : {},
|
|
101848
|
+
...sameProcess?.launchRecorded ? { launchRecorded: true } : {}
|
|
101776
101849
|
};
|
|
101777
101850
|
connections3.set(bundleId, conn);
|
|
101851
|
+
if (reconnects) {
|
|
101852
|
+
reconnectingProcesses.set(bundleId, {
|
|
101853
|
+
pid: handshakePid,
|
|
101854
|
+
index: conn.index,
|
|
101855
|
+
launchRecorded: conn.launchRecorded === true
|
|
101856
|
+
});
|
|
101857
|
+
}
|
|
101778
101858
|
if (!networkStores.has(bundleId)) {
|
|
101779
101859
|
const app = bundleId;
|
|
101780
101860
|
networkStores.set(
|
|
@@ -101786,7 +101866,8 @@ var nativeDevtoolsBlueprint = {
|
|
|
101786
101866
|
request: (index, method, params, timeoutMs) => {
|
|
101787
101867
|
const live = connections3.get(app);
|
|
101788
101868
|
return live?.index === index ? live.cdp.request(method, params, { timeoutMs }) : Promise.reject(closedBeforeRequest(app, method));
|
|
101789
|
-
}
|
|
101869
|
+
},
|
|
101870
|
+
canReconnect: (index) => !disposed && reconnectingProcesses.get(app)?.index === index
|
|
101790
101871
|
},
|
|
101791
101872
|
() => !stoppedBundleIds.has(app)
|
|
101792
101873
|
)
|
|
@@ -101797,14 +101878,21 @@ var nativeDevtoolsBlueprint = {
|
|
|
101797
101878
|
}
|
|
101798
101879
|
if (activatedBundleIds.has(bundleId)) {
|
|
101799
101880
|
if (!lentSocketPath) {
|
|
101800
|
-
|
|
101801
|
-
|
|
101881
|
+
if (dial === void 0 || dial === 1) {
|
|
101882
|
+
captureGaps.delete(bundleId);
|
|
101883
|
+
conn.launchRecorded = true;
|
|
101884
|
+
const recorded = reconnectingProcesses.get(bundleId);
|
|
101885
|
+
if (recorded?.index === conn.index) recorded.launchRecorded = true;
|
|
101886
|
+
} else if (!sameProcess?.launchRecorded) {
|
|
101887
|
+
captureGaps.add(bundleId);
|
|
101888
|
+
}
|
|
101802
101889
|
}
|
|
101803
101890
|
void armOn(bundleId, conn);
|
|
101804
101891
|
} else {
|
|
101805
101892
|
reapplyStoredThrottle(bundleId);
|
|
101806
101893
|
}
|
|
101807
|
-
void readConnectionPid(bundleId, conn);
|
|
101894
|
+
if (conn.pid === void 0) void readConnectionPid(bundleId, conn);
|
|
101895
|
+
else wakeConnectionWaiters();
|
|
101808
101896
|
return;
|
|
101809
101897
|
}
|
|
101810
101898
|
if (msg.type === "CDP" && conn) {
|
|
@@ -101894,6 +101982,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
101894
101982
|
await bindNativeDevtoolsUnixSocket(server, socketPath);
|
|
101895
101983
|
}
|
|
101896
101984
|
const listeningSince = Date.now();
|
|
101985
|
+
const mayStillDialIn = (listenerAgeMs) => endpoint.transport === "unix" && listenerAgeMs < NATIVE_DEVTOOLS_RECONNECT_WINDOW_MS;
|
|
101897
101986
|
if (!lentSocketPath) {
|
|
101898
101987
|
await ensureEnvReady().catch(() => {
|
|
101899
101988
|
});
|
|
@@ -101935,9 +102024,14 @@ var nativeDevtoolsBlueprint = {
|
|
|
101935
102024
|
if (!inspection.running) return "not_running";
|
|
101936
102025
|
if (inspection.process === null) return "indeterminate";
|
|
101937
102026
|
if (!processCarriesInjection(inspection.process.env, endpoint)) return "stale_process";
|
|
102027
|
+
const known = reconnectingProcesses.get(bundleId);
|
|
102028
|
+
if (known?.pid === inspection.process.pid && known.closedAt !== void 0 && Date.now() - known.closedAt < NATIVE_DEVTOOLS_RECONNECT_WINDOW_MS) {
|
|
102029
|
+
return "connecting";
|
|
102030
|
+
}
|
|
101938
102031
|
const listenerAgeMs = Date.now() - listeningSince;
|
|
101939
102032
|
const processAgeMs = inspection.process.ageMs;
|
|
101940
102033
|
if (processAgeMs + NATIVE_DEVTOOLS_AGE_SLOP_MS >= listenerAgeMs) {
|
|
102034
|
+
if (mayStillDialIn(listenerAgeMs)) return "connecting";
|
|
101941
102035
|
return "stale_process";
|
|
101942
102036
|
}
|
|
101943
102037
|
if (processAgeMs < NATIVE_DEVTOOLS_CONNECT_BUDGET_MS) return "connecting";
|
|
@@ -102038,7 +102132,8 @@ var nativeDevtoolsBlueprint = {
|
|
|
102038
102132
|
if (!processCarriesInjection(running.env, endpoint)) {
|
|
102039
102133
|
return `native network capture is on for ${bundleId}, but its running process (pid ${running.pid}) was launched without argent's injection for this simulator, so capture cannot be armed in it; call restart-app to start a process that is armed, then network-capture-start again, since a relaunch ends the JS layer's capture`;
|
|
102040
102134
|
}
|
|
102041
|
-
|
|
102135
|
+
const listenerAgeMs = Date.now() - listeningSince;
|
|
102136
|
+
if (running.ageMs > listenerAgeMs + NATIVE_DEVTOOLS_AGE_SLOP_MS && !mayStillDialIn(listenerAgeMs)) {
|
|
102042
102137
|
return `native network capture is on for ${bundleId}, but its running process (pid ${running.pid}) started before this tool-server's native-devtools listener, so it never connects and capture cannot be armed in it; call restart-app to start a process that is armed, then network-capture-start again, since a relaunch ends the JS layer's capture`;
|
|
102043
102138
|
}
|
|
102044
102139
|
}
|
|
@@ -126833,7 +126928,6 @@ function androidNetworkInspectorRef(device, packageName, metroPort2) {
|
|
|
126833
126928
|
var MIN_SDK = 26;
|
|
126834
126929
|
var PACKAGE_NAME3 = /^[A-Za-z][A-Za-z0-9_]*(?:\.[A-Za-z0-9_]+)*$/;
|
|
126835
126930
|
var PROTOCOL_VERSION = 2;
|
|
126836
|
-
var MAX_REDIRECTS = 32;
|
|
126837
126931
|
var MAX_FRAME_CHARS = 8 * 1024 * 1024;
|
|
126838
126932
|
var HANDSHAKE_FRAME_CHARS = 4 * 1024;
|
|
126839
126933
|
var MAX_PENDING_HANDSHAKES = 32;
|
|
@@ -127852,24 +127946,16 @@ function createInspector(serial, packageName, initialMetroPort) {
|
|
|
127852
127946
|
function addHop(record2, p) {
|
|
127853
127947
|
revive(record2);
|
|
127854
127948
|
const previous = hops.get(record2) ?? { url: record2.request.url, method: record2.request.method };
|
|
127855
|
-
|
|
127856
|
-
|
|
127857
|
-
|
|
127858
|
-
|
|
127859
|
-
|
|
127860
|
-
|
|
127861
|
-
|
|
127862
|
-
|
|
127863
|
-
|
|
127864
|
-
|
|
127865
|
-
headers: headerMap(response.headers),
|
|
127866
|
-
...sent ? { requestHeaders: sent } : {}
|
|
127867
|
-
});
|
|
127868
|
-
}
|
|
127869
|
-
hops.set(record2, {
|
|
127870
|
-
url: capString(asString2(next.url)) || previous.url,
|
|
127871
|
-
method: capString(asString2(next.method), 100) || previous.method
|
|
127872
|
-
});
|
|
127949
|
+
hops.set(
|
|
127950
|
+
record2,
|
|
127951
|
+
appendRedirect(
|
|
127952
|
+
record2,
|
|
127953
|
+
previous,
|
|
127954
|
+
p,
|
|
127955
|
+
(_status, reported) => reported,
|
|
127956
|
+
record2.request.wireHeaders
|
|
127957
|
+
)
|
|
127958
|
+
);
|
|
127873
127959
|
delete record2.request.wireHeaders;
|
|
127874
127960
|
resize(record2);
|
|
127875
127961
|
}
|
|
@@ -129187,7 +129273,7 @@ Returns { envSetup, appRunning, connected, requiresRestart, state, message, next
|
|
|
129187
129273
|
- appRunning: the target bundle currently has a running UIKit process on the simulator
|
|
129188
129274
|
- connected: the dylib is active in the current running process for this bundleId
|
|
129189
129275
|
- requiresRestart: the app is running and a fresh process may reach this simulator's devtools endpoint where the current one does not: true exactly when state is stale_process or indeterminate. Always false for a non-injectable app.
|
|
129190
|
-
- state: why devtools are or aren't live, measured from the running process. "connected"; "not_running"; "stale_process" (the process cannot reach this simulator's devtools endpoint: it launched before argent's instrumentation was in place or against an earlier tool-server's listener); "unregistered" (the process IS injected and pointed at this endpoint, yet the service never registered it); "connecting" (the process IS injected
|
|
129276
|
+
- state: why devtools are or aren't live, measured from the running process. "connected"; "not_running"; "stale_process" (the process cannot reach this simulator's devtools endpoint: it launched before argent's instrumentation was in place, or against an earlier tool-server's listener and never redialed); "unregistered" (the process IS injected and pointed at this endpoint, yet the service never registered it); "connecting" (the process IS injected and still connecting: it or this tool-server started moments ago); "indeterminate". Omitted when injectable is false.
|
|
129191
129277
|
- message: the remedy for that state, in full, including for a state not listed above. Omitted when connected or non-injectable. Prefer it over inferring one from the booleans: it is the only field that can tell you to stop restarting the app.
|
|
129192
129278
|
- nextLaunchWillBeInjected: if you launch this bundle now, native devtools env setup is already in place (always false for a non-injectable app)
|
|
129193
129279
|
- injectable: false for Apple system apps (bundle ids under com.apple.), which the native tools refuse to read.
|
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.50",
|
|
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": "dec35af4609f5fac2761b482f427641c7716b638"
|
|
102
102
|
}
|