@swmansion/argent 0.34.1-next.50 → 0.34.1-next.51
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 +72 -54
- package/package.json +1 -1
package/dist/cli-cmds.mjs
CHANGED
|
@@ -36259,7 +36259,7 @@ function isCi(env = process.env) {
|
|
|
36259
36259
|
var SESSION_ID2 = randomUUID5();
|
|
36260
36260
|
function readCliVersion() {
|
|
36261
36261
|
if (true) {
|
|
36262
|
-
return "0.34.1-next.
|
|
36262
|
+
return "0.34.1-next.51";
|
|
36263
36263
|
}
|
|
36264
36264
|
return "0.0.0";
|
|
36265
36265
|
}
|
package/dist/installer.mjs
CHANGED
|
@@ -16945,7 +16945,7 @@ function isCi(env = process.env) {
|
|
|
16945
16945
|
var SESSION_ID = randomUUID4();
|
|
16946
16946
|
function readCliVersion() {
|
|
16947
16947
|
if (true) {
|
|
16948
|
-
return "0.34.1-next.
|
|
16948
|
+
return "0.34.1-next.51";
|
|
16949
16949
|
}
|
|
16950
16950
|
return "0.0.0";
|
|
16951
16951
|
}
|
package/dist/tool-server.cjs
CHANGED
|
@@ -101447,7 +101447,7 @@ function isCi(env = process.env) {
|
|
|
101447
101447
|
var SESSION_ID = (0, import_node_crypto3.randomUUID)();
|
|
101448
101448
|
function readCliVersion() {
|
|
101449
101449
|
if (true) {
|
|
101450
|
-
return "0.34.1-next.
|
|
101450
|
+
return "0.34.1-next.51";
|
|
101451
101451
|
}
|
|
101452
101452
|
return "0.0.0";
|
|
101453
101453
|
}
|
|
@@ -102293,7 +102293,7 @@ var import_promises13 = require("node:fs/promises");
|
|
|
102293
102293
|
var import_node_os11 = require("node:os");
|
|
102294
102294
|
var import_node_path15 = require("node:path");
|
|
102295
102295
|
init_src();
|
|
102296
|
-
var
|
|
102296
|
+
var import_node_crypto13 = require("node:crypto");
|
|
102297
102297
|
|
|
102298
102298
|
// ../archive/src/index.ts
|
|
102299
102299
|
var import_node_child_process2 = require("node:child_process");
|
|
@@ -124690,9 +124690,9 @@ var STILL_SENDING = "the app may still be sending this request body; read it aga
|
|
|
124690
124690
|
var NO_ANSWER = `the app did not answer within ${POST_DATA_WAIT_MS / 1e3} s; read it again later`;
|
|
124691
124691
|
var NO_EARLIER_ANSWER = `the app did not answer an earlier body read within ${RESPONSE_BODY_TIMEOUT_MS / 1e3} s; read it again later`;
|
|
124692
124692
|
var CONNECTION_CLOSED = "the agent's connection closed before this body was read";
|
|
124693
|
+
var MACOS_CONNECTION_CLOSED = `${CONNECTION_CLOSED}; read it again after argent reconnects to the app, as network-capture-start does`;
|
|
124693
124694
|
var REQUEST_BODY_GONE = "the agent holds no body for this request";
|
|
124694
124695
|
var BODY_NO_LONGER_HELD = "the agent no longer holds this body";
|
|
124695
|
-
var MACOS_NO_BODIES = "argent does not keep the bodies of a Mac app's requests";
|
|
124696
124696
|
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";
|
|
124697
124697
|
var NO_RESPONSE_BODY = "the response has no body";
|
|
124698
124698
|
function createIosNetworkRecords(state3, link, recording = () => true, layer = "ios-native") {
|
|
@@ -124773,10 +124773,10 @@ function createIosNetworkRecords(state3, link, recording = () => true, layer = "
|
|
|
124773
124773
|
bodies.delete(`post:${record2.id}`);
|
|
124774
124774
|
}
|
|
124775
124775
|
function closedReason(connection) {
|
|
124776
|
-
if (layer === "macos-native") return MACOS_NO_BODIES;
|
|
124777
124776
|
const live = link.liveConnection();
|
|
124778
124777
|
if (live !== void 0) sawConnection(live);
|
|
124779
|
-
|
|
124778
|
+
if (endedConnections.has(connection) || newestConnection > connection) return PROCESS_GONE;
|
|
124779
|
+
return link.canReconnect?.(connection) ? MACOS_CONNECTION_CLOSED : CONNECTION_CLOSED;
|
|
124780
124780
|
}
|
|
124781
124781
|
function readBody(id, kind) {
|
|
124782
124782
|
const record2 = byId.get(id);
|
|
@@ -124910,7 +124910,6 @@ function createIosNetworkRecords(state3, link, recording = () => true, layer = "
|
|
|
124910
124910
|
const at = message.indexOf(marker);
|
|
124911
124911
|
const detail = at === -1 ? message : message.slice(at + marker.length);
|
|
124912
124912
|
if (/^no /i.test(detail)) {
|
|
124913
|
-
if (layer === "macos-native") return MACOS_NO_BODIES;
|
|
124914
124913
|
if (kind === "response") return BODY_NO_LONGER_HELD;
|
|
124915
124914
|
if (/^no request stored\b/i.test(detail)) {
|
|
124916
124915
|
return record2.state === "pending" ? STILL_SENDING : BODY_NO_LONGER_HELD;
|
|
@@ -145632,6 +145631,7 @@ init_src2();
|
|
|
145632
145631
|
|
|
145633
145632
|
// ../tool-server/src/blueprints/macos-app.ts
|
|
145634
145633
|
var import_node_child_process30 = require("node:child_process");
|
|
145634
|
+
var import_node_crypto12 = require("node:crypto");
|
|
145635
145635
|
var import_node_events5 = require("node:events");
|
|
145636
145636
|
var fs39 = __toESM(require("node:fs"));
|
|
145637
145637
|
var net8 = __toESM(require("node:net"));
|
|
@@ -145916,6 +145916,7 @@ function closedByArgentError(bundleId, method) {
|
|
|
145916
145916
|
"unknown"
|
|
145917
145917
|
);
|
|
145918
145918
|
}
|
|
145919
|
+
var nextCdpWireId = (0, import_node_crypto12.randomInt)(2 ** 47);
|
|
145919
145920
|
var LibraryChannel = class {
|
|
145920
145921
|
/**
|
|
145921
145922
|
* @param expectedPid the app's pid when known; a launch learns it from the helper after the spawn.
|
|
@@ -145938,7 +145939,7 @@ var LibraryChannel = class {
|
|
|
145938
145939
|
this.enableIds.clear();
|
|
145939
145940
|
this.disableIds.add(p.id);
|
|
145940
145941
|
}
|
|
145941
|
-
return
|
|
145942
|
+
return this.sendCdp(frame2);
|
|
145942
145943
|
}
|
|
145943
145944
|
});
|
|
145944
145945
|
this.ready.catch(() => void 0);
|
|
@@ -145980,6 +145981,8 @@ var LibraryChannel = class {
|
|
|
145980
145981
|
*/
|
|
145981
145982
|
disableIds = /* @__PURE__ */ new Set();
|
|
145982
145983
|
pending = /* @__PURE__ */ new Map();
|
|
145984
|
+
/** The requester's id of each CDP request this channel sent, by its id on the wire. */
|
|
145985
|
+
cdpIds = /* @__PURE__ */ new Map();
|
|
145983
145986
|
nextId = 1;
|
|
145984
145987
|
hello = null;
|
|
145985
145988
|
closeError = null;
|
|
@@ -146041,6 +146044,15 @@ var LibraryChannel = class {
|
|
|
146041
146044
|
this.closedByArgent = true;
|
|
146042
146045
|
this.socket.destroy();
|
|
146043
146046
|
}
|
|
146047
|
+
/** Sends a CDP request under a wire id that no other channel uses. */
|
|
146048
|
+
sendCdp(frame2) {
|
|
146049
|
+
const wireId = nextCdpWireId++;
|
|
146050
|
+
if (!writeNdjsonFrame(this.socket, { ...frame2, payload: { ...frame2.payload, id: wireId } })) {
|
|
146051
|
+
return false;
|
|
146052
|
+
}
|
|
146053
|
+
this.cdpIds.set(wireId, frame2.payload.id);
|
|
146054
|
+
return true;
|
|
146055
|
+
}
|
|
146044
146056
|
onMessage(raw) {
|
|
146045
146057
|
if (!raw || typeof raw !== "object") return;
|
|
146046
146058
|
const msg = raw;
|
|
@@ -146057,15 +146069,19 @@ var LibraryChannel = class {
|
|
|
146057
146069
|
}
|
|
146058
146070
|
if (msg.type === "CDP") {
|
|
146059
146071
|
const p = msg.payload;
|
|
146060
|
-
if (p
|
|
146061
|
-
this.
|
|
146062
|
-
|
|
146063
|
-
|
|
146064
|
-
|
|
146065
|
-
|
|
146072
|
+
if (p?.id !== void 0) {
|
|
146073
|
+
const id2 = typeof p.id === "number" ? this.cdpIds.get(p.id) : void 0;
|
|
146074
|
+
if (id2 !== void 0 && this.enableIds.has(id2) && "result" in p) this.network.enabled(this);
|
|
146075
|
+
if (id2 !== void 0 && this.disableIds.has(id2) && "result" in p) {
|
|
146076
|
+
this.stopUnconfirmed = false;
|
|
146077
|
+
this.confirmDisabling?.();
|
|
146078
|
+
}
|
|
146079
|
+
if (id2 !== void 0 && this.cdp.handleResponse({ ...p, id: id2 })) {
|
|
146080
|
+
this.cdpIds.delete(p.id);
|
|
146081
|
+
}
|
|
146082
|
+
return;
|
|
146066
146083
|
}
|
|
146067
|
-
if (
|
|
146068
|
-
if (p && typeof p.method === "string" && p.id === void 0) {
|
|
146084
|
+
if (p && typeof p.method === "string") {
|
|
146069
146085
|
this.network.event(p.method, p.params, this.hello.pid);
|
|
146070
146086
|
}
|
|
146071
146087
|
return;
|
|
@@ -146258,7 +146274,9 @@ function createMacosAppApi(bundleId) {
|
|
|
146258
146274
|
request: (index, method, params, timeoutMs) => {
|
|
146259
146275
|
const ch = liveChannel();
|
|
146260
146276
|
return ch && recordedProcess?.index === index && recordedProcess.pid === ch.handshake.pid ? ch.cdp.request(method, params, { timeoutMs }) : Promise.reject(connectionClosedBefore(bundleId, method));
|
|
146261
|
-
}
|
|
146277
|
+
},
|
|
146278
|
+
// Not once the app's services stopped, which drops the records, or the process ended.
|
|
146279
|
+
canReconnect: (index) => !disposed && recordedProcess?.index === index && recordedProcess.listens && pidIsAlive(recordedProcess.pid)
|
|
146262
146280
|
},
|
|
146263
146281
|
() => captureStarted,
|
|
146264
146282
|
"macos-native"
|
|
@@ -146314,7 +146332,7 @@ function createMacosAppApi(bundleId) {
|
|
|
146314
146332
|
ch.enabling = enabling;
|
|
146315
146333
|
return enabling;
|
|
146316
146334
|
};
|
|
146317
|
-
const adopt = (ch, launched = false) => {
|
|
146335
|
+
const adopt = (ch, launched = false, listens = true) => {
|
|
146318
146336
|
if (channel !== ch) channel?.close();
|
|
146319
146337
|
channel = ch;
|
|
146320
146338
|
const pid = ch.handshake.pid;
|
|
@@ -146322,7 +146340,7 @@ function createMacosAppApi(bundleId) {
|
|
|
146322
146340
|
if (recordedProcess) {
|
|
146323
146341
|
records.connectionClosed(recordedProcess.index, { superseded: true });
|
|
146324
146342
|
}
|
|
146325
|
-
recordedProcess = { pid, index: nextProcessIndex++, channel: ch };
|
|
146343
|
+
recordedProcess = { pid, index: nextProcessIndex++, channel: ch, listens };
|
|
146326
146344
|
captureGap = captureStarted && !launched;
|
|
146327
146345
|
armedSinceLaunch = launched && captureStarted;
|
|
146328
146346
|
} else if (recordedProcess.channel !== ch) {
|
|
@@ -146715,7 +146733,7 @@ function createMacosAppApi(bundleId) {
|
|
|
146715
146733
|
sandboxed: info.sandboxed,
|
|
146716
146734
|
logPath
|
|
146717
146735
|
};
|
|
146718
|
-
adopt(ch, true);
|
|
146736
|
+
adopt(ch, true, listen2 !== null);
|
|
146719
146737
|
const { note: noWindow, refusal: noDrivableWindow } = await waitForFirstWindow(
|
|
146720
146738
|
ch,
|
|
146721
146739
|
pid,
|
|
@@ -149516,7 +149534,7 @@ function createHttpApp(registry2, options) {
|
|
|
149516
149534
|
});
|
|
149517
149535
|
return;
|
|
149518
149536
|
}
|
|
149519
|
-
const id = (0,
|
|
149537
|
+
const id = (0, import_node_crypto13.randomUUID)();
|
|
149520
149538
|
const tarPath = (0, import_node_path15.join)((0, import_node_os11.tmpdir)(), `argent-upload-${id}.tar.gz`);
|
|
149521
149539
|
const ws = (0, import_node_fs12.createWriteStream)(tarPath);
|
|
149522
149540
|
let received = 0;
|
|
@@ -149533,7 +149551,7 @@ function createHttpApp(registry2, options) {
|
|
|
149533
149551
|
});
|
|
149534
149552
|
if (!res.headersSent) res.status(status).json({ error: message });
|
|
149535
149553
|
};
|
|
149536
|
-
const digest = (0,
|
|
149554
|
+
const digest = (0, import_node_crypto13.createHash)("sha256");
|
|
149537
149555
|
req.on("data", (chunk) => {
|
|
149538
149556
|
if (released) return;
|
|
149539
149557
|
received += chunk.length;
|
|
@@ -149809,7 +149827,7 @@ function createHttpApp(registry2, options) {
|
|
|
149809
149827
|
});
|
|
149810
149828
|
const keepAlive = def.longRunning && options?.idleTimeoutMs && options.idleTimeoutMs > 0 ? setInterval(() => idleTimer.touch(), Math.max(1e3, IDLE_CHECK_INTERVAL_MS / 2)) : null;
|
|
149811
149829
|
if (keepAlive) keepAlive.unref?.();
|
|
149812
|
-
const toolInvocationId = (0,
|
|
149830
|
+
const toolInvocationId = (0, import_node_crypto13.randomUUID)();
|
|
149813
149831
|
let releaseInvocationMeta;
|
|
149814
149832
|
let recordChildInvocation;
|
|
149815
149833
|
const recordInvocation = options?.recordInvocation;
|
|
@@ -150147,7 +150165,7 @@ init_src2();
|
|
|
150147
150165
|
init_src();
|
|
150148
150166
|
|
|
150149
150167
|
// ../tool-server/src/blueprints/android-network-inspector.ts
|
|
150150
|
-
var
|
|
150168
|
+
var import_node_crypto14 = require("node:crypto");
|
|
150151
150169
|
var fs41 = __toESM(require("node:fs"));
|
|
150152
150170
|
var net9 = __toESM(require("node:net"));
|
|
150153
150171
|
var path35 = __toESM(require("node:path"));
|
|
@@ -150355,7 +150373,7 @@ var NOT_RECONNECTED_NOTE = "the agent's connection dropped, and it did not recon
|
|
|
150355
150373
|
var STOPPED_NOTE = "capture stopped by network-capture-stop; network-capture-start turns it on again";
|
|
150356
150374
|
var AWAY_AT_STOP = "the agent's connection was down at the stop, so it did not get Network.disable; it gets it when it connects again, and argent records none of the app's new requests meanwhile";
|
|
150357
150375
|
var LOGGED_DETAIL_EVENTS = /* @__PURE__ */ new Set(["interceptor_installed", "interceptor_failed"]);
|
|
150358
|
-
var RUN_TAG2 = (0,
|
|
150376
|
+
var RUN_TAG2 = (0, import_node_crypto14.randomBytes)(2).toString("hex");
|
|
150359
150377
|
var ANDROID_NATIVE_REQUEST_ID = /^android-[0-9a-f]{4}-\d+$/;
|
|
150360
150378
|
var liveInspectors = /* @__PURE__ */ new Map();
|
|
150361
150379
|
var nextRecordNumber2 = 1;
|
|
@@ -150462,7 +150480,7 @@ function createInspector(serial, packageName, initialMetroPort) {
|
|
|
150462
150480
|
process.stderr.write(`[${tag3}] ${line}
|
|
150463
150481
|
`);
|
|
150464
150482
|
};
|
|
150465
|
-
const secret = (0,
|
|
150483
|
+
const secret = (0, import_node_crypto14.randomBytes)(32).toString("hex");
|
|
150466
150484
|
let metroPort2 = initialMetroPort;
|
|
150467
150485
|
let disposed = false;
|
|
150468
150486
|
let live = false;
|
|
@@ -150690,7 +150708,7 @@ function createInspector(serial, packageName, initialMetroPort) {
|
|
|
150690
150708
|
}
|
|
150691
150709
|
async function bindDevicePort() {
|
|
150692
150710
|
for (let attempt = 0; attempt < DEVICE_PORT_ATTEMPTS; attempt++) {
|
|
150693
|
-
const port = DEVICE_PORT_MIN + (0,
|
|
150711
|
+
const port = DEVICE_PORT_MIN + (0, import_node_crypto14.randomInt)(DEVICE_PORT_SPAN);
|
|
150694
150712
|
try {
|
|
150695
150713
|
await adbReverse(serial, port, hostPort, { timeoutMs: 1e4, noRebind: true });
|
|
150696
150714
|
} catch (err) {
|
|
@@ -150948,7 +150966,7 @@ function createInspector(serial, packageName, initialMetroPort) {
|
|
|
150948
150966
|
return;
|
|
150949
150967
|
}
|
|
150950
150968
|
agentNonce = payload.nonce;
|
|
150951
|
-
serverNonce = (0,
|
|
150969
|
+
serverNonce = (0, import_node_crypto14.randomBytes)(16).toString("hex");
|
|
150952
150970
|
writeNdjsonFrame(socket, {
|
|
150953
150971
|
type: "Control",
|
|
150954
150972
|
payload: {
|
|
@@ -151841,14 +151859,14 @@ function readHandshake(payload) {
|
|
|
151841
151859
|
}
|
|
151842
151860
|
function proofMatches(proof, expected) {
|
|
151843
151861
|
if (!isHex2(proof, 64)) return false;
|
|
151844
|
-
return (0,
|
|
151862
|
+
return (0, import_node_crypto14.timingSafeEqual)(Buffer.from(proof, "hex"), Buffer.from(expected, "hex"));
|
|
151845
151863
|
}
|
|
151846
151864
|
function handshakeProof(secret, parts2) {
|
|
151847
|
-
return (0,
|
|
151865
|
+
return (0, import_node_crypto14.createHmac)("sha256", Buffer.from(secret, "ascii")).update(parts2.join("\n"), "utf8").digest("hex");
|
|
151848
151866
|
}
|
|
151849
151867
|
function sessionKeys(agentNonce, serverNonce, secret) {
|
|
151850
|
-
const prk = (0,
|
|
151851
|
-
const expand = (info) => (0,
|
|
151868
|
+
const prk = (0, import_node_crypto14.createHmac)("sha256", Buffer.from(agentNonce + serverNonce, "ascii")).update(Buffer.from(secret, "ascii")).digest();
|
|
151869
|
+
const expand = (info) => (0, import_node_crypto14.createHmac)("sha256", prk).update(Buffer.concat([Buffer.from(info, "ascii"), Buffer.of(1)])).digest();
|
|
151852
151870
|
return {
|
|
151853
151871
|
agent: expand("argent-nwi agent to server"),
|
|
151854
151872
|
server: expand("argent-nwi server to agent")
|
|
@@ -151860,7 +151878,7 @@ function frameIv(counter) {
|
|
|
151860
151878
|
return iv;
|
|
151861
151879
|
}
|
|
151862
151880
|
function sealFrame(key2, counter, frame2) {
|
|
151863
|
-
const cipher = (0,
|
|
151881
|
+
const cipher = (0, import_node_crypto14.createCipheriv)("aes-256-gcm", key2, frameIv(counter), {
|
|
151864
151882
|
authTagLength: GCM_TAG_BYTES
|
|
151865
151883
|
});
|
|
151866
151884
|
return Buffer.concat([
|
|
@@ -151878,7 +151896,7 @@ function openFrame(key2, counter, sealed) {
|
|
|
151878
151896
|
}
|
|
151879
151897
|
let plaintext;
|
|
151880
151898
|
try {
|
|
151881
|
-
const decipher = (0,
|
|
151899
|
+
const decipher = (0, import_node_crypto14.createDecipheriv)("aes-256-gcm", key2, frameIv(counter), {
|
|
151882
151900
|
authTagLength: GCM_TAG_BYTES
|
|
151883
151901
|
});
|
|
151884
151902
|
decipher.setAuthTag(bytes.subarray(bytes.length - GCM_TAG_BYTES));
|
|
@@ -153039,7 +153057,7 @@ init_device_info();
|
|
|
153039
153057
|
init_external_devices();
|
|
153040
153058
|
|
|
153041
153059
|
// ../tool-server/src/utils/debugger/target-selection.ts
|
|
153042
|
-
var
|
|
153060
|
+
var import_node_crypto15 = require("node:crypto");
|
|
153043
153061
|
init_src2();
|
|
153044
153062
|
init_device_info();
|
|
153045
153063
|
init_external_devices();
|
|
@@ -153062,7 +153080,7 @@ function macosAppBundleIdOf(target) {
|
|
|
153062
153080
|
const vendorIds = trackedMacosAppKind(bundleId) === "catalyst" ? catalystVendorId ? [catalystVendorId] : [] : [""];
|
|
153063
153081
|
for (const vendorId of vendorIds) {
|
|
153064
153082
|
for (const mode of ["fusebox", "legacy"]) {
|
|
153065
|
-
const id = (0,
|
|
153083
|
+
const id = (0, import_node_crypto15.createHash)("sha256").update(`apple-${vendorId}-${bundleId}-${mode}`).digest("hex").slice(0, 40);
|
|
153066
153084
|
if (id === logicalId) return bundleId;
|
|
153067
153085
|
}
|
|
153068
153086
|
}
|
|
@@ -153713,7 +153731,7 @@ var jsRuntimeDebuggerBlueprint = {
|
|
|
153713
153731
|
init_src2();
|
|
153714
153732
|
|
|
153715
153733
|
// ../tool-server/src/utils/debugger/scripts/network-interceptor.ts
|
|
153716
|
-
var
|
|
153734
|
+
var import_node_crypto16 = require("node:crypto");
|
|
153717
153735
|
var import_node_os12 = require("node:os");
|
|
153718
153736
|
init_src3();
|
|
153719
153737
|
var BINARY_BODY_TYPES = /^(image\/(?!svg)|audio\/|video\/|font\/|application\/(octet-stream|pdf|zip|gzip|wasm|x-protobuf)$)/;
|
|
@@ -154782,7 +154800,7 @@ var NETWORK_CAPTURE_MARK_SCRIPT = `(function() {
|
|
|
154782
154800
|
var g = globalThis;
|
|
154783
154801
|
return typeof g.__argent_network_mark === 'function' ? g.__argent_network_mark() : JSON.stringify({ install: null });
|
|
154784
154802
|
})()`;
|
|
154785
|
-
var HOLDER = JSON.stringify((0,
|
|
154803
|
+
var HOLDER = JSON.stringify((0, import_node_crypto16.randomUUID)());
|
|
154786
154804
|
function holderRecord(capturing2) {
|
|
154787
154805
|
return JSON.stringify({ capturing: capturing2, pid: process.pid, host: (0, import_node_os12.hostname)() });
|
|
154788
154806
|
}
|
|
@@ -164241,7 +164259,7 @@ init_device_info();
|
|
|
164241
164259
|
init_capability();
|
|
164242
164260
|
|
|
164243
164261
|
// ../tool-server/src/utils/sub-invoke.ts
|
|
164244
|
-
var
|
|
164262
|
+
var import_node_crypto17 = require("node:crypto");
|
|
164245
164263
|
init_src2();
|
|
164246
164264
|
async function invokeSubTool(registry2, ctx, toolId, args, extra) {
|
|
164247
164265
|
const signal = ctx?.signal;
|
|
@@ -164257,7 +164275,7 @@ async function invokeSubTool(registry2, ctx, toolId, args, extra) {
|
|
|
164257
164275
|
if (!recordChildInvocation) {
|
|
164258
164276
|
return signal || Object.keys(forwarded).length > 0 ? registry2.invokeTool(toolId, args, { ...signal ? { signal } : {}, ...forwarded }) : registry2.invokeTool(toolId, args);
|
|
164259
164277
|
}
|
|
164260
|
-
const toolInvocationId = (0,
|
|
164278
|
+
const toolInvocationId = (0, import_node_crypto17.randomUUID)();
|
|
164261
164279
|
const release2 = recordChildInvocation(toolInvocationId, args);
|
|
164262
164280
|
try {
|
|
164263
164281
|
return await registry2.invokeTool(toolId, args, {
|
|
@@ -169121,7 +169139,7 @@ init_zod();
|
|
|
169121
169139
|
init_src2();
|
|
169122
169140
|
|
|
169123
169141
|
// ../tool-server/src/utils/debugger/runtime-device.ts
|
|
169124
|
-
var
|
|
169142
|
+
var import_node_crypto18 = require("node:crypto");
|
|
169125
169143
|
var import_node_child_process46 = require("node:child_process");
|
|
169126
169144
|
var import_node_util35 = require("node:util");
|
|
169127
169145
|
init_adb();
|
|
@@ -169134,7 +169152,7 @@ async function findRuntimeDevices(cdp, {
|
|
|
169134
169152
|
awaitSerials = [],
|
|
169135
169153
|
waitSerials = []
|
|
169136
169154
|
} = {}) {
|
|
169137
|
-
const marker = `argent-device-probe:${(0,
|
|
169155
|
+
const marker = `argent-device-probe:${(0, import_node_crypto18.randomUUID)()}`;
|
|
169138
169156
|
const logged = await cdp.evaluate(
|
|
169139
169157
|
`(function () {
|
|
169140
169158
|
if (typeof nativeLoggingHook !== "function") return false;
|
|
@@ -177982,7 +178000,7 @@ var import_node_child_process48 = require("node:child_process");
|
|
|
177982
178000
|
var import_node_util38 = require("node:util");
|
|
177983
178001
|
var fsp5 = __toESM(require("node:fs/promises"));
|
|
177984
178002
|
var path49 = __toESM(require("node:path"));
|
|
177985
|
-
var
|
|
178003
|
+
var import_node_crypto19 = require("node:crypto");
|
|
177986
178004
|
init_src2();
|
|
177987
178005
|
|
|
177988
178006
|
// ../tool-server/src/utils/ios-launch-time/workflow.ts
|
|
@@ -178565,7 +178583,7 @@ async function measurePreparedLaunch(context2, ctx) {
|
|
|
178565
178583
|
const runnerSigning = context2.simulator ? null : await resolveRunnerSigningConfig(context2.deviceId);
|
|
178566
178584
|
const runnerBundleId = runnerSigning?.appBundleId ?? "com.argent.runner.tsimulator";
|
|
178567
178585
|
const testBundleId = runnerSigning?.testBundleId ?? `${runnerBundleId}.uitests`;
|
|
178568
|
-
const runnerBuildKey = (0,
|
|
178586
|
+
const runnerBuildKey = (0, import_node_crypto19.createHash)("sha256").update(
|
|
178569
178587
|
[
|
|
178570
178588
|
// Builds for two simulators, or two iPhones, are the same build.
|
|
178571
178589
|
context2.simulator ? "iOS Simulator" : "iOS",
|
|
@@ -178704,7 +178722,7 @@ async function measurePreparedLaunch(context2, ctx) {
|
|
|
178704
178722
|
|
|
178705
178723
|
// ../tool-server/src/tools/profiler/native-profiler/launch-analysis/profile.ts
|
|
178706
178724
|
var import_node_child_process49 = require("node:child_process");
|
|
178707
|
-
var
|
|
178725
|
+
var import_node_crypto20 = require("node:crypto");
|
|
178708
178726
|
var import_node_util39 = require("node:util");
|
|
178709
178727
|
var fsp6 = __toESM(require("node:fs/promises"));
|
|
178710
178728
|
var path50 = __toESM(require("node:path"));
|
|
@@ -178952,7 +178970,7 @@ var TABLE_XPATH = (schema) => `/trace-toc/run[@number="1"]/data/table[@schema="$
|
|
|
178952
178970
|
async function writeProfilerSession(xml) {
|
|
178953
178971
|
const debugDir = await getDebugDir();
|
|
178954
178972
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[-:]/g, "").replace("T", "-").slice(0, 15);
|
|
178955
|
-
const sessionId = `${timestamp}-launch-${(0,
|
|
178973
|
+
const sessionId = `${timestamp}-launch-${(0, import_node_crypto20.randomUUID)()}`;
|
|
178956
178974
|
const cpuXmlPath = path50.join(debugDir, `native-profiler-${sessionId}_raw_cpu.xml`);
|
|
178957
178975
|
await fsp6.writeFile(cpuXmlPath, xml, { flag: "wx" });
|
|
178958
178976
|
return { sessionId, cpuXmlPath };
|
|
@@ -179292,7 +179310,7 @@ init_zod();
|
|
|
179292
179310
|
var import_node_child_process50 = require("node:child_process");
|
|
179293
179311
|
var fs62 = __toESM(require("node:fs"));
|
|
179294
179312
|
var path51 = __toESM(require("node:path"));
|
|
179295
|
-
var
|
|
179313
|
+
var import_node_crypto21 = require("node:crypto");
|
|
179296
179314
|
var import_node_util40 = require("node:util");
|
|
179297
179315
|
init_src2();
|
|
179298
179316
|
init_capability();
|
|
@@ -179508,7 +179526,7 @@ async function setAudioInput(session, source) {
|
|
|
179508
179526
|
} else {
|
|
179509
179527
|
removeFiles(dir, `in-${process.pid}-`);
|
|
179510
179528
|
feeder = new InputFeeder(
|
|
179511
|
-
path51.join(dir, `in-${process.pid}-${(0,
|
|
179529
|
+
path51.join(dir, `in-${process.pid}-${(0, import_node_crypto21.randomUUID)().slice(0, 8)}.ring`),
|
|
179512
179530
|
feederSource
|
|
179513
179531
|
);
|
|
179514
179532
|
feeder.start();
|
|
@@ -191854,7 +191872,7 @@ init_device_info();
|
|
|
191854
191872
|
init_capability();
|
|
191855
191873
|
|
|
191856
191874
|
// ../tool-server/src/tools/flows/flow-visual.ts
|
|
191857
|
-
var
|
|
191875
|
+
var import_node_crypto22 = require("node:crypto");
|
|
191858
191876
|
var fs79 = __toESM(require("node:fs/promises"));
|
|
191859
191877
|
var os25 = __toESM(require("node:os"));
|
|
191860
191878
|
var path65 = __toESM(require("node:path"));
|
|
@@ -193978,7 +193996,7 @@ async function runSnapshot(env, opts) {
|
|
|
193978
193996
|
});
|
|
193979
193997
|
let captureWarned = shot.warning !== void 0 ? { warning: shot.warning } : {};
|
|
193980
193998
|
const { w, h } = await pngDimensions(shot.image.hostPath);
|
|
193981
|
-
const cropSuffix = opts.cropOn === void 0 ? "" : `-crop-${(0,
|
|
193999
|
+
const cropSuffix = opts.cropOn === void 0 ? "" : `-crop-${(0, import_node_crypto22.createHash)("sha256").update(cropIdentity(opts.cropOn)).digest("hex").slice(0, 8)}`;
|
|
193982
194000
|
const keyFor = (width, height) => `${opts.name}__${authoringPlatform(env.device.platform)}-${width}x${height}${cropSuffix}`;
|
|
193983
194001
|
const baselineFor = (file2) => opts.clientFlowPath === void 0 ? path65.join(baselineDir(opts.flowsDir, opts.flowName), file2) : clientBaselinePath(opts.clientFlowPath, opts.flowName, file2);
|
|
193984
194002
|
const snapshotKey = keyFor(w, h);
|
|
@@ -196541,7 +196559,7 @@ var dismissUpdateTool = {
|
|
|
196541
196559
|
};
|
|
196542
196560
|
|
|
196543
196561
|
// ../tool-server/src/tools/screenshot-diff/index.ts
|
|
196544
|
-
var
|
|
196562
|
+
var import_node_crypto23 = __toESM(require("node:crypto"));
|
|
196545
196563
|
var import_promises23 = __toESM(require("fs/promises"));
|
|
196546
196564
|
var import_node_os19 = __toESM(require("node:os"));
|
|
196547
196565
|
var import_path9 = __toESM(require("path"));
|
|
@@ -196697,7 +196715,7 @@ async function resolveOutputDir(params, options) {
|
|
|
196697
196715
|
const dir = import_path9.default.join(
|
|
196698
196716
|
import_node_os19.default.tmpdir(),
|
|
196699
196717
|
"argent-screenshot-diff",
|
|
196700
|
-
|
|
196718
|
+
import_node_crypto23.default.randomBytes(6).toString("hex")
|
|
196701
196719
|
);
|
|
196702
196720
|
await import_promises23.default.mkdir(dir, { recursive: true });
|
|
196703
196721
|
return dir;
|
|
@@ -196802,7 +196820,7 @@ async function captureIosDeviceLiveInput(params) {
|
|
|
196802
196820
|
return writeLivePng(params.outputDir, params.name, png);
|
|
196803
196821
|
}
|
|
196804
196822
|
async function writeLivePng(outputDir, name, png) {
|
|
196805
|
-
const suffix =
|
|
196823
|
+
const suffix = import_node_crypto23.default.randomBytes(4).toString("hex");
|
|
196806
196824
|
const destination = import_path9.default.join(outputDir, `${name}-${suffix}.live.png`);
|
|
196807
196825
|
await import_promises23.default.mkdir(outputDir, { recursive: true });
|
|
196808
196826
|
await import_promises23.default.writeFile(destination, png);
|
|
@@ -196820,7 +196838,7 @@ async function captureHarmonyLiveInput(params) {
|
|
|
196820
196838
|
}
|
|
196821
196839
|
await ensureDep("hdc");
|
|
196822
196840
|
const captured = await captureHarmonyScreenshotPng({ connectKey: params.connectKey, scale: 1 });
|
|
196823
|
-
const suffix =
|
|
196841
|
+
const suffix = import_node_crypto23.default.randomBytes(4).toString("hex");
|
|
196824
196842
|
const destination = import_path9.default.join(params.outputDir, `${params.name}-${suffix}.live.png`);
|
|
196825
196843
|
try {
|
|
196826
196844
|
await import_promises23.default.mkdir(params.outputDir, { recursive: true });
|
|
@@ -196843,7 +196861,7 @@ async function captureLiveInput(params) {
|
|
|
196843
196861
|
captureScreenshot2,
|
|
196844
196862
|
params.peekFor?.(params.device)
|
|
196845
196863
|
);
|
|
196846
|
-
const suffix =
|
|
196864
|
+
const suffix = import_node_crypto23.default.randomBytes(4).toString("hex");
|
|
196847
196865
|
const destination = import_path9.default.join(params.outputDir, `${params.name}-${suffix}.live.png`);
|
|
196848
196866
|
await import_promises23.default.mkdir(params.outputDir, { recursive: true });
|
|
196849
196867
|
await import_promises23.default.copyFile(capture.path, destination);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swmansion/argent",
|
|
3
|
-
"version": "0.34.1-next.
|
|
3
|
+
"version": "0.34.1-next.51",
|
|
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",
|