@swmansion/argent 0.35.1-next.81 → 0.35.1-next.83
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 +107 -97
- package/package.json +2 -2
package/dist/cli-cmds.mjs
CHANGED
|
@@ -38933,7 +38933,7 @@ function isCi(env = process.env) {
|
|
|
38933
38933
|
var SESSION_ID2 = randomUUID5();
|
|
38934
38934
|
function readCliVersion() {
|
|
38935
38935
|
if (true) {
|
|
38936
|
-
return "0.35.1-next.
|
|
38936
|
+
return "0.35.1-next.82";
|
|
38937
38937
|
}
|
|
38938
38938
|
return "0.0.0";
|
|
38939
38939
|
}
|
package/dist/installer.mjs
CHANGED
|
@@ -17175,7 +17175,7 @@ function isCi(env = process.env) {
|
|
|
17175
17175
|
var SESSION_ID = randomUUID4();
|
|
17176
17176
|
function readCliVersion() {
|
|
17177
17177
|
if (true) {
|
|
17178
|
-
return "0.35.1-next.
|
|
17178
|
+
return "0.35.1-next.82";
|
|
17179
17179
|
}
|
|
17180
17180
|
return "0.0.0";
|
|
17181
17181
|
}
|
package/dist/mcp-server.mjs
CHANGED
|
@@ -38506,7 +38506,7 @@ async function startMcpServer(options) {
|
|
|
38506
38506
|
const autoDescribeOn = autoDescribeEnabled();
|
|
38507
38507
|
const whatsNewOn = whatsNewEnabled();
|
|
38508
38508
|
const installedVersion = getInstalledVersion();
|
|
38509
|
-
const highlightsVersion = true ? "0.35.1-next.
|
|
38509
|
+
const highlightsVersion = true ? "0.35.1-next.82" : installedVersion;
|
|
38510
38510
|
const captureTimeoutMs = options.captureTimeoutMs ?? CAPTURE_TIMEOUT_MS;
|
|
38511
38511
|
const trees = createTreeMemory();
|
|
38512
38512
|
const screenshots = createScreenshotMemory();
|
package/dist/tool-server.cjs
CHANGED
|
@@ -73410,7 +73410,7 @@ function isCi(env = process.env) {
|
|
|
73410
73410
|
var SESSION_ID = (0, import_node_crypto4.randomUUID)();
|
|
73411
73411
|
function readCliVersion() {
|
|
73412
73412
|
if (true) {
|
|
73413
|
-
return "0.35.1-next.
|
|
73413
|
+
return "0.35.1-next.82";
|
|
73414
73414
|
}
|
|
73415
73415
|
return "0.0.0";
|
|
73416
73416
|
}
|
|
@@ -101638,14 +101638,47 @@ function createMoqTransport(moq, options) {
|
|
|
101638
101638
|
init_external_devices();
|
|
101639
101639
|
|
|
101640
101640
|
// ../tool-server/src/utils/simulator-watcher.ts
|
|
101641
|
-
var
|
|
101641
|
+
var fs31 = __toESM(require("node:fs"));
|
|
101642
101642
|
init_src2();
|
|
101643
101643
|
|
|
101644
101644
|
// ../tool-server/src/blueprints/native-devtools.ts
|
|
101645
101645
|
var net3 = __toESM(require("node:net"));
|
|
101646
|
-
var
|
|
101646
|
+
var fs30 = __toESM(require("node:fs"));
|
|
101647
101647
|
var os6 = __toESM(require("node:os"));
|
|
101648
|
-
var
|
|
101648
|
+
var path26 = __toESM(require("node:path"));
|
|
101649
|
+
|
|
101650
|
+
// ../tool-server/src/utils/argent-home-id.ts
|
|
101651
|
+
var import_node_crypto10 = require("node:crypto");
|
|
101652
|
+
var fs26 = __toESM(require("node:fs"));
|
|
101653
|
+
var import_node_os6 = require("node:os");
|
|
101654
|
+
var path23 = __toESM(require("node:path"));
|
|
101655
|
+
init_src();
|
|
101656
|
+
var ARGENT_HOME_HEADER = "x-argent-home";
|
|
101657
|
+
function canonicalDir(dir) {
|
|
101658
|
+
const resolved = path23.resolve(dir);
|
|
101659
|
+
const parent = path23.dirname(resolved);
|
|
101660
|
+
if (fs26.existsSync(resolved) || parent === resolved) return canonicalPath(resolved);
|
|
101661
|
+
return path23.join(canonicalDir(parent), path23.basename(resolved));
|
|
101662
|
+
}
|
|
101663
|
+
function argentHomeId(dir = argentHomeDir()) {
|
|
101664
|
+
return (0, import_node_crypto10.createHash)("sha256").update(canonicalDir(dir)).digest("hex").slice(0, 12);
|
|
101665
|
+
}
|
|
101666
|
+
function peerArgentHomeId(header) {
|
|
101667
|
+
if (typeof header === "string" && header) return header;
|
|
101668
|
+
return argentHomeId(path23.join(resolveHomeDir(), ".argent"));
|
|
101669
|
+
}
|
|
101670
|
+
var LOOPBACK_ADDRESSES = /* @__PURE__ */ new Set(["127.0.0.1", "::1", "::ffff:127.0.0.1"]);
|
|
101671
|
+
function isOwnAddress(address) {
|
|
101672
|
+
const ip = address.replace(/^::ffff:(?=\d+\.\d+\.\d+\.\d+$)/, "");
|
|
101673
|
+
return Object.values((0, import_node_os6.networkInterfaces)()).some(
|
|
101674
|
+
(list) => list?.some((a) => (a.family === "IPv4" || a.scopeid === 0) && a.address === ip)
|
|
101675
|
+
);
|
|
101676
|
+
}
|
|
101677
|
+
function isLocalConnection(socket) {
|
|
101678
|
+
const remote = socket.remoteAddress;
|
|
101679
|
+
if (remote === void 0) return false;
|
|
101680
|
+
return LOOPBACK_ADDRESSES.has(remote) || remote === socket.localAddress || isOwnAddress(remote);
|
|
101681
|
+
}
|
|
101649
101682
|
|
|
101650
101683
|
// ../tool-server/src/utils/ndjson-socket.ts
|
|
101651
101684
|
init_src2();
|
|
@@ -101954,17 +101987,17 @@ function asString2(value) {
|
|
|
101954
101987
|
// ../tool-server/src/utils/ios-host.ts
|
|
101955
101988
|
var import_node_child_process18 = require("node:child_process");
|
|
101956
101989
|
var import_node_events = require("node:events");
|
|
101957
|
-
var
|
|
101958
|
-
var
|
|
101990
|
+
var fs29 = __toESM(require("node:fs"));
|
|
101991
|
+
var path25 = __toESM(require("node:path"));
|
|
101959
101992
|
var import_node_util15 = require("node:util");
|
|
101960
101993
|
init_src();
|
|
101961
101994
|
|
|
101962
101995
|
// ../tool-server/src/utils/ios-audio-leftovers.ts
|
|
101963
|
-
var
|
|
101964
|
-
var
|
|
101996
|
+
var fs28 = __toESM(require("node:fs"));
|
|
101997
|
+
var path24 = __toESM(require("node:path"));
|
|
101965
101998
|
|
|
101966
101999
|
// ../tool-server/src/utils/ios-audio-rings.ts
|
|
101967
|
-
var
|
|
102000
|
+
var fs27 = __toESM(require("node:fs"));
|
|
101968
102001
|
init_src2();
|
|
101969
102002
|
var RING_HDR = 128;
|
|
101970
102003
|
var IN_MAGIC = 1229410881;
|
|
@@ -101977,20 +102010,20 @@ var FLOAT_SUBFORMAT = "0300000000001000800000aa00389b71";
|
|
|
101977
102010
|
function putU32(fd, pos, value) {
|
|
101978
102011
|
const b = Buffer.alloc(4);
|
|
101979
102012
|
b.writeUInt32LE(value >>> 0);
|
|
101980
|
-
|
|
102013
|
+
fs27.writeSync(fd, b, 0, 4, pos);
|
|
101981
102014
|
}
|
|
101982
102015
|
function createRing(ringPath, header, dataBytes) {
|
|
101983
|
-
const fd =
|
|
102016
|
+
const fd = fs27.openSync(ringPath, "w+", 384);
|
|
101984
102017
|
const hdr = Buffer.alloc(RING_HDR);
|
|
101985
102018
|
header.forEach((v, i) => hdr.writeUInt32LE(v >>> 0, i * 4));
|
|
101986
|
-
|
|
101987
|
-
|
|
102019
|
+
fs27.writeSync(fd, hdr, 0, RING_HDR, 0);
|
|
102020
|
+
fs27.writeSync(fd, Buffer.alloc(dataBytes), 0, dataBytes, RING_HDR);
|
|
101988
102021
|
return fd;
|
|
101989
102022
|
}
|
|
101990
102023
|
function readClipInfo(fd) {
|
|
101991
102024
|
const head = Buffer.alloc(16384);
|
|
101992
|
-
const read =
|
|
101993
|
-
const size =
|
|
102025
|
+
const read = fs27.readSync(fd, head, 0, head.length, 0);
|
|
102026
|
+
const size = fs27.fstatSync(fd).size;
|
|
101994
102027
|
const bad = (why) => new FailureError(`The converted clip is not mono float32 WAV (${why}).`, {
|
|
101995
102028
|
error_code: FAILURE_CODES.AUDIO_CLIP_CONVERSION_FAILED,
|
|
101996
102029
|
failure_stage: "audio_clip_conversion",
|
|
@@ -102019,7 +102052,7 @@ function readClipInfo(fd) {
|
|
|
102019
102052
|
throw bad("no data chunk");
|
|
102020
102053
|
}
|
|
102021
102054
|
function closeSource(source) {
|
|
102022
|
-
if (source.kind === "clip")
|
|
102055
|
+
if (source.kind === "clip") fs27.closeSync(source.fd);
|
|
102023
102056
|
}
|
|
102024
102057
|
var InputFeeder = class {
|
|
102025
102058
|
constructor(ringPath, source) {
|
|
@@ -102071,7 +102104,7 @@ var InputFeeder = class {
|
|
|
102071
102104
|
this.running = false;
|
|
102072
102105
|
if (this.timer) clearInterval(this.timer);
|
|
102073
102106
|
closeSource(this.source);
|
|
102074
|
-
|
|
102107
|
+
fs27.closeSync(this.fd);
|
|
102075
102108
|
}
|
|
102076
102109
|
step() {
|
|
102077
102110
|
const { readFrame, requestGen } = this.readGuest();
|
|
@@ -102091,13 +102124,13 @@ var InputFeeder = class {
|
|
|
102091
102124
|
this.produce(n);
|
|
102092
102125
|
const start2 = this.writeFrame & RING_CAP - 1;
|
|
102093
102126
|
const first = Math.min(n, RING_CAP - start2);
|
|
102094
|
-
|
|
102095
|
-
if (n > first)
|
|
102127
|
+
fs27.writeSync(this.fd, this.bytes, 0, first * 4, RING_HDR + start2 * 4);
|
|
102128
|
+
if (n > first) fs27.writeSync(this.fd, this.bytes, first * 4, (n - first) * 4, RING_HDR);
|
|
102096
102129
|
this.writeFrame = this.writeFrame + n >>> 0;
|
|
102097
102130
|
putU32(this.fd, 16, this.writeFrame);
|
|
102098
102131
|
}
|
|
102099
102132
|
readGuest() {
|
|
102100
|
-
|
|
102133
|
+
fs27.readSync(this.fd, this.guest, 0, 12, 64);
|
|
102101
102134
|
return { readFrame: this.guest.readUInt32LE(0), requestGen: this.guest.readUInt32LE(4) };
|
|
102102
102135
|
}
|
|
102103
102136
|
/** The source starts again from its beginning, with its full play count, at the next frame written. */
|
|
@@ -102132,7 +102165,7 @@ var InputFeeder = class {
|
|
|
102132
102165
|
this.clipPos = 0;
|
|
102133
102166
|
}
|
|
102134
102167
|
const take2 = Math.min(s.info.frames - this.clipPos, n - off);
|
|
102135
|
-
const got =
|
|
102168
|
+
const got = fs27.readSync(
|
|
102136
102169
|
s.fd,
|
|
102137
102170
|
this.bytes,
|
|
102138
102171
|
off * 4,
|
|
@@ -102152,13 +102185,13 @@ var InputFeeder = class {
|
|
|
102152
102185
|
};
|
|
102153
102186
|
function readInCursors(ringPath) {
|
|
102154
102187
|
try {
|
|
102155
|
-
const fd =
|
|
102188
|
+
const fd = fs27.openSync(ringPath, "r");
|
|
102156
102189
|
try {
|
|
102157
102190
|
const b = Buffer.alloc(RING_HDR);
|
|
102158
|
-
if (
|
|
102191
|
+
if (fs27.readSync(fd, b, 0, RING_HDR, 0) < 68 || b.readUInt32LE(0) !== IN_MAGIC) return null;
|
|
102159
102192
|
return { write: b.readUInt32LE(16), read: b.readUInt32LE(64) };
|
|
102160
102193
|
} finally {
|
|
102161
|
-
|
|
102194
|
+
fs27.closeSync(fd);
|
|
102162
102195
|
}
|
|
102163
102196
|
} catch {
|
|
102164
102197
|
return null;
|
|
@@ -102191,27 +102224,27 @@ async function abandoned(text) {
|
|
|
102191
102224
|
const owner = Number(field(text, "host"));
|
|
102192
102225
|
if (owner > 0) return !processAlive(owner);
|
|
102193
102226
|
const ring = field(text, "ring");
|
|
102194
|
-
if (!ring || !
|
|
102227
|
+
if (!ring || !fs28.existsSync(ring)) return true;
|
|
102195
102228
|
return feederGone(ring);
|
|
102196
102229
|
}
|
|
102197
102230
|
async function clearAudioLeftovers(dir) {
|
|
102198
102231
|
let names;
|
|
102199
102232
|
try {
|
|
102200
|
-
names =
|
|
102233
|
+
names = fs28.readdirSync(dir);
|
|
102201
102234
|
} catch {
|
|
102202
102235
|
return;
|
|
102203
102236
|
}
|
|
102204
102237
|
let liveUnmarkedInput = false;
|
|
102205
102238
|
const read = (file2) => {
|
|
102206
102239
|
try {
|
|
102207
|
-
return
|
|
102240
|
+
return fs28.readFileSync(file2, "utf8");
|
|
102208
102241
|
} catch {
|
|
102209
102242
|
return null;
|
|
102210
102243
|
}
|
|
102211
102244
|
};
|
|
102212
102245
|
for (const name of names) {
|
|
102213
102246
|
if (name !== "input") continue;
|
|
102214
|
-
const file2 =
|
|
102247
|
+
const file2 = path24.join(dir, name);
|
|
102215
102248
|
const text = read(file2);
|
|
102216
102249
|
if (text === null) continue;
|
|
102217
102250
|
if (!await abandoned(text)) {
|
|
@@ -102219,25 +102252,25 @@ async function clearAudioLeftovers(dir) {
|
|
|
102219
102252
|
continue;
|
|
102220
102253
|
}
|
|
102221
102254
|
if (read(file2) !== text) continue;
|
|
102222
|
-
|
|
102255
|
+
fs28.rmSync(file2, { force: true });
|
|
102223
102256
|
const ring = field(text, "ring");
|
|
102224
|
-
if (ring &&
|
|
102225
|
-
|
|
102257
|
+
if (ring && path24.dirname(ring) === dir && /^in-/.test(path24.basename(ring))) {
|
|
102258
|
+
fs28.rmSync(ring, { force: true });
|
|
102226
102259
|
}
|
|
102227
102260
|
}
|
|
102228
102261
|
for (const name of names) {
|
|
102229
102262
|
if (!name.startsWith("st.")) continue;
|
|
102230
|
-
const file2 =
|
|
102263
|
+
const file2 = path24.join(dir, name);
|
|
102231
102264
|
const text = read(file2);
|
|
102232
102265
|
if (text === null) continue;
|
|
102233
102266
|
const pid = Number(field(text, "pid"));
|
|
102234
|
-
if (pid > 0 && !processAlive(pid) && read(file2) === text)
|
|
102267
|
+
if (pid > 0 && !processAlive(pid) && read(file2) === text) fs28.rmSync(file2, { force: true });
|
|
102235
102268
|
}
|
|
102236
102269
|
for (const name of names) {
|
|
102237
102270
|
const owner = /^(?:in|clip)-(\d+)-/.exec(name);
|
|
102238
102271
|
const unmarked = !owner && /^(?:in|clip)-/.test(name) && !liveUnmarkedInput;
|
|
102239
102272
|
if (owner && !processAlive(Number(owner[1])) || unmarked) {
|
|
102240
|
-
|
|
102273
|
+
fs28.rmSync(path24.join(dir, name), { force: true });
|
|
102241
102274
|
}
|
|
102242
102275
|
}
|
|
102243
102276
|
}
|
|
@@ -102269,13 +102302,13 @@ function shouldPreserveDyldInsertLibrariesEntry(entry, bootstrapPath) {
|
|
|
102269
102302
|
if (entry === bootstrapPath) {
|
|
102270
102303
|
return false;
|
|
102271
102304
|
}
|
|
102272
|
-
if (ARGENT_BOOTSTRAP_DYLIB_BASENAMES.has(
|
|
102305
|
+
if (ARGENT_BOOTSTRAP_DYLIB_BASENAMES.has(path25.basename(entry))) {
|
|
102273
102306
|
return false;
|
|
102274
102307
|
}
|
|
102275
102308
|
if (entry.startsWith("@")) {
|
|
102276
102309
|
return true;
|
|
102277
102310
|
}
|
|
102278
|
-
return
|
|
102311
|
+
return fs29.existsSync(entry);
|
|
102279
102312
|
}
|
|
102280
102313
|
function audioDir(udid) {
|
|
102281
102314
|
return `/tmp/argent-audio-${udid}`;
|
|
@@ -102302,14 +102335,14 @@ function buildDyldInsertLibraries(currentValue, bootstrapPath) {
|
|
|
102302
102335
|
}
|
|
102303
102336
|
function withdrawDyldInsertLibraries(currentValue, bootstrapPath) {
|
|
102304
102337
|
const preserved = preservedDyldInsertLibraries(currentValue, bootstrapPath).filter(
|
|
102305
|
-
(entry) =>
|
|
102338
|
+
(entry) => path25.basename(entry) !== AUDIO_DYLIB_BASENAME
|
|
102306
102339
|
);
|
|
102307
102340
|
return preserved.length === 0 ? null : preserved.join(":");
|
|
102308
102341
|
}
|
|
102309
102342
|
function appendDyldInsertLibrary(currentValue, dylibPath) {
|
|
102310
|
-
const name =
|
|
102343
|
+
const name = path25.basename(dylibPath);
|
|
102311
102344
|
const kept = splitDyldInsertLibraries(currentValue).filter(
|
|
102312
|
-
(entry) => entry !== dylibPath &&
|
|
102345
|
+
(entry) => entry !== dylibPath && path25.basename(entry) !== name
|
|
102313
102346
|
);
|
|
102314
102347
|
return [...kept, dylibPath].join(":");
|
|
102315
102348
|
}
|
|
@@ -102391,7 +102424,7 @@ function setEndpointEnv(endpoint, launchctl) {
|
|
|
102391
102424
|
}
|
|
102392
102425
|
async function setAudioDirEnv(nativeId, launchctl) {
|
|
102393
102426
|
try {
|
|
102394
|
-
|
|
102427
|
+
fs29.mkdirSync(audioDir(nativeId), { recursive: true, mode: 448 });
|
|
102395
102428
|
await launchctl(["setenv", "ARGENT_AUDIO_DIR", audioDir(nativeId)]);
|
|
102396
102429
|
} catch (err) {
|
|
102397
102430
|
process.stderr.write(`[ios-host] audio setup failed for ${nativeId}: ${String(err)}
|
|
@@ -102644,10 +102677,10 @@ async function enableAppAccessibilityBeforeLaunch(device) {
|
|
|
102644
102677
|
}
|
|
102645
102678
|
|
|
102646
102679
|
// ../tool-server/src/blueprints/ios-network-records.ts
|
|
102647
|
-
var
|
|
102680
|
+
var import_node_crypto11 = require("node:crypto");
|
|
102648
102681
|
var import_node_http2 = require("node:http");
|
|
102649
102682
|
init_src2();
|
|
102650
|
-
var RUN_TAG = (0,
|
|
102683
|
+
var RUN_TAG = (0, import_node_crypto11.randomBytes)(2).toString("hex");
|
|
102651
102684
|
var IOS_NATIVE_REQUEST_ID = /^ios-[0-9a-f]{4}-\d+$/;
|
|
102652
102685
|
var MACOS_NATIVE_REQUEST_ID = /^macos-[0-9a-f]{4}-\d+$/;
|
|
102653
102686
|
var nextRecordNumber = 1;
|
|
@@ -103224,7 +103257,11 @@ function handshakeCount(value) {
|
|
|
103224
103257
|
return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : void 0;
|
|
103225
103258
|
}
|
|
103226
103259
|
function getNativeDevtoolsSocketPath(udid) {
|
|
103227
|
-
return `/tmp/argent-nd-${udid.slice(0, 8)}.sock`;
|
|
103260
|
+
return `/tmp/argent-nd-${udid.slice(0, 8)}-${argentHomeId()}.sock`;
|
|
103261
|
+
}
|
|
103262
|
+
function nativeDevtoolsLaunchEnv(api) {
|
|
103263
|
+
if (!api) return process.env;
|
|
103264
|
+
return { ...process.env, SIMCTL_CHILD_NATIVE_DEVTOOLS_IOS_CDP_SOCKET: api.socketPath };
|
|
103228
103265
|
}
|
|
103229
103266
|
function bindNativeDevtoolsUnixSocket(server, socketPath) {
|
|
103230
103267
|
return new Promise((resolve24, reject) => {
|
|
@@ -103237,7 +103274,7 @@ function bindNativeDevtoolsUnixSocket(server, socketPath) {
|
|
|
103237
103274
|
if ((err.code === "EADDRINUSE" || err.code === "EEXIST") && !retried) {
|
|
103238
103275
|
retried = true;
|
|
103239
103276
|
try {
|
|
103240
|
-
|
|
103277
|
+
fs30.unlinkSync(socketPath);
|
|
103241
103278
|
} catch {
|
|
103242
103279
|
}
|
|
103243
103280
|
server.listen(socketPath);
|
|
@@ -103558,7 +103595,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
103558
103595
|
providerCapture.set(bundleId, await readCaptureEnabled(bundleId));
|
|
103559
103596
|
};
|
|
103560
103597
|
const keepsCapture = (bundleId) => lentSocketPath ? providerCapture.get(bundleId) === true : activatedBundleIds.has(bundleId);
|
|
103561
|
-
const ownedThrottlePath = (bundleId) =>
|
|
103598
|
+
const ownedThrottlePath = (bundleId) => path26.join(
|
|
103562
103599
|
os6.tmpdir(),
|
|
103563
103600
|
`argent-throttle-${encodeURIComponent(deviceKeyOf(udid))}-${encodeURIComponent(bundleId)}`
|
|
103564
103601
|
);
|
|
@@ -103571,9 +103608,9 @@ var nativeDevtoolsBlueprint = {
|
|
|
103571
103608
|
Math.trunc(amount("uploadThroughput"))
|
|
103572
103609
|
]);
|
|
103573
103610
|
};
|
|
103574
|
-
const readOwnedKeys = (bundleId) =>
|
|
103611
|
+
const readOwnedKeys = (bundleId) => fs30.existsSync(ownedThrottlePath(bundleId)) ? fs30.readFileSync(ownedThrottlePath(bundleId), "utf8").split("\n") : [];
|
|
103575
103612
|
const recordOwnedKeys = (bundleId, keys) => {
|
|
103576
|
-
if (lentSocketPath)
|
|
103613
|
+
if (lentSocketPath) fs30.writeFileSync(ownedThrottlePath(bundleId), keys.join("\n"));
|
|
103577
103614
|
};
|
|
103578
103615
|
const applyThrottle = async (bundleId, throttle) => {
|
|
103579
103616
|
await noteProviderCapture(bundleId);
|
|
@@ -103589,11 +103626,11 @@ var nativeDevtoolsBlueprint = {
|
|
|
103589
103626
|
await sendCdpRpc(bundleId, "NativeDevtoolsIos.configure", { bypassPorts: [] });
|
|
103590
103627
|
await sendCdpRpc(bundleId, keepsCapture(bundleId) ? "Network.enable" : "Network.disable");
|
|
103591
103628
|
providerCapture.delete(bundleId);
|
|
103592
|
-
|
|
103629
|
+
fs30.rmSync(ownedThrottlePath(bundleId), { force: true });
|
|
103593
103630
|
};
|
|
103594
103631
|
const isEmulating = (state3) => state3?.offline === true || ["latency", "downloadThroughput", "uploadThroughput"].some((key2) => Number(state3?.[key2]) > 0);
|
|
103595
103632
|
const clearLeftoverThrottle = async (bundleId) => {
|
|
103596
|
-
if (!lentSocketPath || !
|
|
103633
|
+
if (!lentSocketPath || !fs30.existsSync(ownedThrottlePath(bundleId))) return;
|
|
103597
103634
|
const method = "NativeDevtoolsIos.getConditions";
|
|
103598
103635
|
const state3 = await sendCdpRpc(bundleId, method).catch((err) => {
|
|
103599
103636
|
if (err instanceof Error && err.message.endsWith(`Unsupported method: ${method}`))
|
|
@@ -103601,7 +103638,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
103601
103638
|
throw err;
|
|
103602
103639
|
});
|
|
103603
103640
|
if (!isEmulating(state3) || !readOwnedKeys(bundleId).includes(conditionsKey(state3))) {
|
|
103604
|
-
|
|
103641
|
+
fs30.rmSync(ownedThrottlePath(bundleId), { force: true });
|
|
103605
103642
|
return;
|
|
103606
103643
|
}
|
|
103607
103644
|
providerCapture.set(bundleId, true);
|
|
@@ -103685,7 +103722,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
103685
103722
|
};
|
|
103686
103723
|
if (transport === "unix" && !lentSocketPath) {
|
|
103687
103724
|
try {
|
|
103688
|
-
|
|
103725
|
+
fs30.unlinkSync(socketPath);
|
|
103689
103726
|
} catch {
|
|
103690
103727
|
}
|
|
103691
103728
|
}
|
|
@@ -104152,7 +104189,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
104152
104189
|
server?.close();
|
|
104153
104190
|
if (transport === "unix" && !lentSocketPath) {
|
|
104154
104191
|
try {
|
|
104155
|
-
|
|
104192
|
+
fs30.unlinkSync(socketPath);
|
|
104156
104193
|
} catch {
|
|
104157
104194
|
}
|
|
104158
104195
|
}
|
|
@@ -104315,7 +104352,7 @@ async function getBootedUdidsInSet(deviceSet, signal) {
|
|
|
104315
104352
|
async function getBootedUdids(signal) {
|
|
104316
104353
|
const sets = [
|
|
104317
104354
|
null,
|
|
104318
|
-
...configuredAdditionalDeviceSets().filter((p) =>
|
|
104355
|
+
...configuredAdditionalDeviceSets().filter((p) => fs31.existsSync(p))
|
|
104319
104356
|
];
|
|
104320
104357
|
const perSet = await Promise.allSettled(sets.map((set2) => getBootedUdidsInSet(set2, signal)));
|
|
104321
104358
|
const failures = perSet.flatMap((r) => r.status === "rejected" ? [r.reason] : []);
|
|
@@ -105203,10 +105240,10 @@ init_adb();
|
|
|
105203
105240
|
// ../tool-server/src/utils/ios-device/devicectl.ts
|
|
105204
105241
|
var import_node_child_process22 = require("node:child_process");
|
|
105205
105242
|
var import_node_util17 = require("node:util");
|
|
105206
|
-
var
|
|
105243
|
+
var fs32 = __toESM(require("node:fs/promises"));
|
|
105207
105244
|
var os7 = __toESM(require("node:os"));
|
|
105208
|
-
var
|
|
105209
|
-
var
|
|
105245
|
+
var path27 = __toESM(require("node:path"));
|
|
105246
|
+
var import_node_crypto12 = require("node:crypto");
|
|
105210
105247
|
var import_node_net = require("node:net");
|
|
105211
105248
|
init_src2();
|
|
105212
105249
|
var execFileAsync16 = (0, import_node_util17.promisify)(import_node_child_process22.execFile);
|
|
@@ -105255,7 +105292,7 @@ async function runDevicectl(args, action, opts = {}) {
|
|
|
105255
105292
|
let jsonPath = null;
|
|
105256
105293
|
const argv = ["devicectl", ...args];
|
|
105257
105294
|
if (opts.json) {
|
|
105258
|
-
jsonPath =
|
|
105295
|
+
jsonPath = path27.join(os7.tmpdir(), `argent-devicectl-${process.pid}-${(0, import_node_crypto12.randomUUID)()}.json`);
|
|
105259
105296
|
argv.push("--json-output", jsonPath);
|
|
105260
105297
|
}
|
|
105261
105298
|
try {
|
|
@@ -105267,7 +105304,7 @@ async function runDevicectl(args, action, opts = {}) {
|
|
|
105267
105304
|
let json2 = null;
|
|
105268
105305
|
if (jsonPath) {
|
|
105269
105306
|
try {
|
|
105270
|
-
json2 = JSON.parse(await
|
|
105307
|
+
json2 = JSON.parse(await fs32.readFile(jsonPath, "utf8"));
|
|
105271
105308
|
} catch {
|
|
105272
105309
|
json2 = null;
|
|
105273
105310
|
}
|
|
@@ -105279,7 +105316,7 @@ async function runDevicectl(args, action, opts = {}) {
|
|
|
105279
105316
|
let errorJson = null;
|
|
105280
105317
|
if (jsonPath) {
|
|
105281
105318
|
try {
|
|
105282
|
-
errorJson = JSON.parse(await
|
|
105319
|
+
errorJson = JSON.parse(await fs32.readFile(jsonPath, "utf8"));
|
|
105283
105320
|
} catch {
|
|
105284
105321
|
errorJson = null;
|
|
105285
105322
|
}
|
|
@@ -105298,7 +105335,7 @@ async function runDevicectl(args, action, opts = {}) {
|
|
|
105298
105335
|
}
|
|
105299
105336
|
);
|
|
105300
105337
|
} finally {
|
|
105301
|
-
if (jsonPath) await
|
|
105338
|
+
if (jsonPath) await fs32.rm(jsonPath, { force: true }).catch(() => {
|
|
105302
105339
|
});
|
|
105303
105340
|
}
|
|
105304
105341
|
}
|
|
@@ -105549,41 +105586,6 @@ init_capability();
|
|
|
105549
105586
|
init_device_info();
|
|
105550
105587
|
init_macos_app_kind();
|
|
105551
105588
|
init_src();
|
|
105552
|
-
|
|
105553
|
-
// ../tool-server/src/utils/argent-home-id.ts
|
|
105554
|
-
var import_node_crypto12 = require("node:crypto");
|
|
105555
|
-
var fs32 = __toESM(require("node:fs"));
|
|
105556
|
-
var import_node_os6 = require("node:os");
|
|
105557
|
-
var path27 = __toESM(require("node:path"));
|
|
105558
|
-
init_src();
|
|
105559
|
-
var ARGENT_HOME_HEADER = "x-argent-home";
|
|
105560
|
-
function canonicalDir(dir) {
|
|
105561
|
-
const resolved = path27.resolve(dir);
|
|
105562
|
-
const parent = path27.dirname(resolved);
|
|
105563
|
-
if (fs32.existsSync(resolved) || parent === resolved) return canonicalPath(resolved);
|
|
105564
|
-
return path27.join(canonicalDir(parent), path27.basename(resolved));
|
|
105565
|
-
}
|
|
105566
|
-
function argentHomeId(dir = argentHomeDir()) {
|
|
105567
|
-
return (0, import_node_crypto12.createHash)("sha256").update(canonicalDir(dir)).digest("hex").slice(0, 12);
|
|
105568
|
-
}
|
|
105569
|
-
function peerArgentHomeId(header) {
|
|
105570
|
-
if (typeof header === "string" && header) return header;
|
|
105571
|
-
return argentHomeId(path27.join(resolveHomeDir(), ".argent"));
|
|
105572
|
-
}
|
|
105573
|
-
var LOOPBACK_ADDRESSES = /* @__PURE__ */ new Set(["127.0.0.1", "::1", "::ffff:127.0.0.1"]);
|
|
105574
|
-
function isOwnAddress(address) {
|
|
105575
|
-
const ip = address.replace(/^::ffff:(?=\d+\.\d+\.\d+\.\d+$)/, "");
|
|
105576
|
-
return Object.values((0, import_node_os6.networkInterfaces)()).some(
|
|
105577
|
-
(list) => list?.some((a) => (a.family === "IPv4" || a.scopeid === 0) && a.address === ip)
|
|
105578
|
-
);
|
|
105579
|
-
}
|
|
105580
|
-
function isLocalConnection(socket) {
|
|
105581
|
-
const remote = socket.remoteAddress;
|
|
105582
|
-
if (remote === void 0) return false;
|
|
105583
|
-
return LOOPBACK_ADDRESSES.has(remote) || remote === socket.localAddress || isOwnAddress(remote);
|
|
105584
|
-
}
|
|
105585
|
-
|
|
105586
|
-
// ../tool-server/src/utils/macos-apps.ts
|
|
105587
105589
|
var execFileAsync17 = (0, import_node_util18.promisify)(import_node_child_process23.execFile);
|
|
105588
105590
|
function isMacosAppsEnabled() {
|
|
105589
105591
|
return isFeatureEnabled(MACOS_APPS_FLAG);
|
|
@@ -138884,7 +138886,11 @@ function makeIosImpl(registry2) {
|
|
|
138884
138886
|
params.bundleId,
|
|
138885
138887
|
...params.launchArgs ?? []
|
|
138886
138888
|
]),
|
|
138887
|
-
{
|
|
138889
|
+
{
|
|
138890
|
+
timeout: 3e4,
|
|
138891
|
+
killSignal: SIMCTL_KILL_SIGNAL,
|
|
138892
|
+
env: nativeDevtoolsLaunchEnv(nativeDevtools)
|
|
138893
|
+
}
|
|
138888
138894
|
);
|
|
138889
138895
|
} catch (err) {
|
|
138890
138896
|
if (err instanceof XcodeFirstLaunchPendingError) throw err;
|
|
@@ -139430,7 +139436,11 @@ function makeIosImpl2(registry2) {
|
|
|
139430
139436
|
await execFileAsync29(
|
|
139431
139437
|
"xcrun",
|
|
139432
139438
|
await simctlArgsForUdid(udid, ["launch", udid, bundleId, ...params.launchArgs ?? []]),
|
|
139433
|
-
{
|
|
139439
|
+
{
|
|
139440
|
+
timeout: 3e4,
|
|
139441
|
+
killSignal: SIMCTL_KILL_SIGNAL,
|
|
139442
|
+
env: nativeDevtoolsLaunchEnv(nativeDevtools)
|
|
139443
|
+
}
|
|
139434
139444
|
);
|
|
139435
139445
|
} catch (err) {
|
|
139436
139446
|
if (err instanceof XcodeFirstLaunchPendingError) throw 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.83",
|
|
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": "8543180eef821321da6fc6a77af3ba04f5636cfb"
|
|
102
102
|
}
|