@swmansion/argent 0.35.1-next.61 → 0.35.1-next.62
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/tool-server.cjs +34 -27
- package/package.json +2 -2
package/dist/tool-server.cjs
CHANGED
|
@@ -73904,7 +73904,7 @@ var import_express3 = __toESM(require_express2());
|
|
|
73904
73904
|
var import_bytes2 = __toESM(require_bytes());
|
|
73905
73905
|
var import_node_fs13 = require("node:fs");
|
|
73906
73906
|
var import_promises13 = require("node:fs/promises");
|
|
73907
|
-
var
|
|
73907
|
+
var import_node_os10 = require("node:os");
|
|
73908
73908
|
var import_node_path15 = require("node:path");
|
|
73909
73909
|
init_src();
|
|
73910
73910
|
var import_node_crypto14 = require("node:crypto");
|
|
@@ -125727,6 +125727,7 @@ function directCallFailure(tool, result) {
|
|
|
125727
125727
|
// ../tool-server/src/utils/argent-home-id.ts
|
|
125728
125728
|
var import_node_crypto13 = require("node:crypto");
|
|
125729
125729
|
var fs44 = __toESM(require("node:fs"));
|
|
125730
|
+
var import_node_os9 = require("node:os");
|
|
125730
125731
|
var path39 = __toESM(require("node:path"));
|
|
125731
125732
|
init_src();
|
|
125732
125733
|
var ARGENT_HOME_HEADER = "x-argent-home";
|
|
@@ -125744,10 +125745,16 @@ function peerArgentHomeId(header) {
|
|
|
125744
125745
|
return argentHomeId(path39.join(resolveHomeDir(), ".argent"));
|
|
125745
125746
|
}
|
|
125746
125747
|
var LOOPBACK_ADDRESSES = /* @__PURE__ */ new Set(["127.0.0.1", "::1", "::ffff:127.0.0.1"]);
|
|
125748
|
+
function isOwnAddress(address) {
|
|
125749
|
+
const ip = address.replace(/^::ffff:(?=\d+\.\d+\.\d+\.\d+$)/, "");
|
|
125750
|
+
return Object.values((0, import_node_os9.networkInterfaces)()).some(
|
|
125751
|
+
(list) => list?.some((a) => (a.family === "IPv4" || a.scopeid === 0) && a.address === ip)
|
|
125752
|
+
);
|
|
125753
|
+
}
|
|
125747
125754
|
function isLocalConnection(socket) {
|
|
125748
125755
|
const remote = socket.remoteAddress;
|
|
125749
125756
|
if (remote === void 0) return false;
|
|
125750
|
-
return LOOPBACK_ADDRESSES.has(remote) || remote === socket.localAddress;
|
|
125757
|
+
return LOOPBACK_ADDRESSES.has(remote) || remote === socket.localAddress || isOwnAddress(remote);
|
|
125751
125758
|
}
|
|
125752
125759
|
|
|
125753
125760
|
// ../tool-server/src/utils/received-secrets.ts
|
|
@@ -125964,13 +125971,13 @@ function checkTokenExemptAccess(req, policy) {
|
|
|
125964
125971
|
}
|
|
125965
125972
|
function interfaceAddresses() {
|
|
125966
125973
|
const out = [];
|
|
125967
|
-
for (const list of Object.values((0,
|
|
125974
|
+
for (const list of Object.values((0, import_node_os10.networkInterfaces)())) {
|
|
125968
125975
|
for (const a of list ?? []) out.push(a.address.split("%")[0]);
|
|
125969
125976
|
}
|
|
125970
125977
|
return out;
|
|
125971
125978
|
}
|
|
125972
125979
|
function machineHostnames() {
|
|
125973
|
-
const name = (0,
|
|
125980
|
+
const name = (0, import_node_os10.hostname)().toLowerCase();
|
|
125974
125981
|
if (!name) return [];
|
|
125975
125982
|
const bare = name.endsWith(".local") ? name.slice(0, -".local".length) : name;
|
|
125976
125983
|
return [bare, `${bare}.local`];
|
|
@@ -126127,7 +126134,7 @@ function createHttpApp(registry2, options) {
|
|
|
126127
126134
|
return;
|
|
126128
126135
|
}
|
|
126129
126136
|
const id = (0, import_node_crypto14.randomUUID)();
|
|
126130
|
-
const tarPath = (0, import_node_path15.join)((0,
|
|
126137
|
+
const tarPath = (0, import_node_path15.join)((0, import_node_os10.tmpdir)(), `argent-upload-${id}.tar.gz`);
|
|
126131
126138
|
const ws = (0, import_node_fs13.createWriteStream)(tarPath);
|
|
126132
126139
|
let received2 = 0;
|
|
126133
126140
|
let released = false;
|
|
@@ -131381,7 +131388,7 @@ init_src2();
|
|
|
131381
131388
|
|
|
131382
131389
|
// ../tool-server/src/utils/debugger/scripts/network-interceptor.ts
|
|
131383
131390
|
var import_node_crypto18 = require("node:crypto");
|
|
131384
|
-
var
|
|
131391
|
+
var import_node_os11 = require("node:os");
|
|
131385
131392
|
init_src3();
|
|
131386
131393
|
var BINARY_BODY_TYPES = /^(image\/(?!svg)|audio\/|video\/|font\/|application\/(octet-stream|pdf|zip|gzip|wasm|x-protobuf)$)/;
|
|
131387
131394
|
var NETWORK_INTERCEPTOR_SCRIPT = `(function() {
|
|
@@ -132462,7 +132469,7 @@ var NETWORK_CAPTURE_MARK_SCRIPT = `(function() {
|
|
|
132462
132469
|
})()`;
|
|
132463
132470
|
var HOLDER = JSON.stringify((0, import_node_crypto18.randomUUID)());
|
|
132464
132471
|
function holderRecord(capturing2) {
|
|
132465
|
-
return JSON.stringify({ capturing: capturing2, pid: process.pid, host: (0,
|
|
132472
|
+
return JSON.stringify({ capturing: capturing2, pid: process.pid, host: (0, import_node_os11.hostname)() });
|
|
132466
132473
|
}
|
|
132467
132474
|
function makeNetworkCaptureControlScript(paused) {
|
|
132468
132475
|
return `(function() {
|
|
@@ -132509,7 +132516,7 @@ function exitedHolders(answer) {
|
|
|
132509
132516
|
}
|
|
132510
132517
|
return Object.keys(holders).filter((key2) => {
|
|
132511
132518
|
const { pid, host } = holders[key2];
|
|
132512
|
-
return host === (0,
|
|
132519
|
+
return host === (0, import_node_os11.hostname)() && typeof pid === "number" && !isProcessAlive(pid);
|
|
132513
132520
|
});
|
|
132514
132521
|
}
|
|
132515
132522
|
function makeNetworkLogReadScript(start2, limit, metroPort2) {
|
|
@@ -133725,7 +133732,7 @@ var import_node_child_process37 = require("node:child_process");
|
|
|
133725
133732
|
var import_node_fs19 = require("node:fs");
|
|
133726
133733
|
var import_promises15 = require("node:fs/promises");
|
|
133727
133734
|
var import_node_net4 = require("node:net");
|
|
133728
|
-
var
|
|
133735
|
+
var import_node_os13 = require("node:os");
|
|
133729
133736
|
var import_node_path20 = require("node:path");
|
|
133730
133737
|
var import_node_util27 = require("node:util");
|
|
133731
133738
|
init_zod();
|
|
@@ -133962,7 +133969,7 @@ async function readParentPids() {
|
|
|
133962
133969
|
|
|
133963
133970
|
// ../tool-server/src/utils/linux-preflight.ts
|
|
133964
133971
|
var fs48 = __toESM(require("node:fs"));
|
|
133965
|
-
var
|
|
133972
|
+
var import_node_os12 = require("node:os");
|
|
133966
133973
|
var import_node_path18 = require("node:path");
|
|
133967
133974
|
var import_ini2 = __toESM(require_ini());
|
|
133968
133975
|
function linuxBootDiagnostics(avdName) {
|
|
@@ -133991,7 +133998,7 @@ function checkKvm() {
|
|
|
133991
133998
|
var MIN_RAM_MB = 4096;
|
|
133992
133999
|
var MIN_HEAP_MB = 512;
|
|
133993
134000
|
function checkAvdSizing(avdName) {
|
|
133994
|
-
const configPath = (0, import_node_path18.join)((0,
|
|
134001
|
+
const configPath = (0, import_node_path18.join)((0, import_node_os12.homedir)(), ".android", "avd", `${avdName}.avd`, "config.ini");
|
|
133995
134002
|
let content;
|
|
133996
134003
|
try {
|
|
133997
134004
|
content = fs48.readFileSync(configPath, "utf8");
|
|
@@ -134967,7 +134974,7 @@ async function attemptBoot(params) {
|
|
|
134967
134974
|
const portArg = params.emulatorArgs.indexOf("-port");
|
|
134968
134975
|
const instance = portArg >= 0 ? `${params.avdName}-${params.emulatorArgs[portArg + 1]}` : params.avdName;
|
|
134969
134976
|
const safeName = instance.replace(/[^\w.-]/g, "_");
|
|
134970
|
-
const logPath = (0, import_node_path20.join)((0,
|
|
134977
|
+
const logPath = (0, import_node_path20.join)((0, import_node_os13.tmpdir)(), `argent-emulator-${safeName}.log`);
|
|
134971
134978
|
emulatorLogFd = (0, import_node_fs19.openSync)(logPath, "w");
|
|
134972
134979
|
stdio = ["ignore", emulatorLogFd, emulatorLogFd];
|
|
134973
134980
|
}
|
|
@@ -135715,11 +135722,11 @@ async function startHarmonyEmulator(instanceName) {
|
|
|
135715
135722
|
});
|
|
135716
135723
|
}
|
|
135717
135724
|
try {
|
|
135718
|
-
for (const entry of (0, import_node_fs19.readdirSync)((0,
|
|
135725
|
+
for (const entry of (0, import_node_fs19.readdirSync)((0, import_node_os13.tmpdir)())) {
|
|
135719
135726
|
if (!entry.startsWith("argent-harmony-") || !entry.endsWith(".log")) continue;
|
|
135720
135727
|
try {
|
|
135721
|
-
if (Date.now() - (0, import_node_fs19.statSync)((0, import_node_path20.join)((0,
|
|
135722
|
-
(0, import_node_fs19.rmSync)((0, import_node_path20.join)((0,
|
|
135728
|
+
if (Date.now() - (0, import_node_fs19.statSync)((0, import_node_path20.join)((0, import_node_os13.tmpdir)(), entry)).mtimeMs > HARMONY_LOG_TTL_MS) {
|
|
135729
|
+
(0, import_node_fs19.rmSync)((0, import_node_path20.join)((0, import_node_os13.tmpdir)(), entry), { force: true });
|
|
135723
135730
|
}
|
|
135724
135731
|
} catch {
|
|
135725
135732
|
}
|
|
@@ -135727,7 +135734,7 @@ async function startHarmonyEmulator(instanceName) {
|
|
|
135727
135734
|
} catch {
|
|
135728
135735
|
}
|
|
135729
135736
|
const safeName = instanceName.replace(/[^\w.-]/g, (c) => `%${c.codePointAt(0).toString(16)}`);
|
|
135730
|
-
const logPath = (0, import_node_path20.join)((0,
|
|
135737
|
+
const logPath = (0, import_node_path20.join)((0, import_node_os13.tmpdir)(), `argent-harmony-${safeName}-${process.hrtime.bigint()}.log`);
|
|
135731
135738
|
let logFd;
|
|
135732
135739
|
try {
|
|
135733
135740
|
logFd = (0, import_node_fs19.openSync)(logPath, "w");
|
|
@@ -135834,7 +135841,7 @@ async function waitForHarmonyTarget(before, deadline, checkAlive, expected) {
|
|
|
135834
135841
|
}
|
|
135835
135842
|
}
|
|
135836
135843
|
async function waitForHarmonyDrivable(connectKey, deadline, checkAlive) {
|
|
135837
|
-
const probePath = (0, import_node_path20.join)((0,
|
|
135844
|
+
const probePath = (0, import_node_path20.join)((0, import_node_os13.tmpdir)(), `argent-harmony-bootprobe-${process.hrtime.bigint()}.json`);
|
|
135838
135845
|
let inFlight4 = null;
|
|
135839
135846
|
try {
|
|
135840
135847
|
for (; ; ) {
|
|
@@ -138506,14 +138513,14 @@ function androidDevtoolsRotationPeek(registry2, device) {
|
|
|
138506
138513
|
|
|
138507
138514
|
// ../tool-server/src/utils/vega-screen.ts
|
|
138508
138515
|
var import_promises18 = require("node:fs/promises");
|
|
138509
|
-
var
|
|
138516
|
+
var import_node_os15 = require("node:os");
|
|
138510
138517
|
var import_node_path29 = require("node:path");
|
|
138511
138518
|
var import_pngjs3 = __toESM(require_png());
|
|
138512
138519
|
init_src2();
|
|
138513
138520
|
init_adb();
|
|
138514
138521
|
|
|
138515
138522
|
// ../tool-server/src/utils/emulator-console.ts
|
|
138516
|
-
var
|
|
138523
|
+
var import_node_os14 = require("node:os");
|
|
138517
138524
|
var import_node_path28 = require("node:path");
|
|
138518
138525
|
init_adb();
|
|
138519
138526
|
async function runEmuConsole(serial, args) {
|
|
@@ -138530,7 +138537,7 @@ function describeConsoleReply(stdout) {
|
|
|
138530
138537
|
const lines = replyLines(stdout);
|
|
138531
138538
|
const reply = lines.join("; ") || "empty reply";
|
|
138532
138539
|
if (!lines.at(-1)?.startsWith("KO: unknown command")) return reply;
|
|
138533
|
-
const tokenFile = (0, import_node_path28.join)((0,
|
|
138540
|
+
const tokenFile = (0, import_node_path28.join)((0, import_node_os14.homedir)(), ".emulator_console_auth_token");
|
|
138534
138541
|
const fileKind = process.platform === "win32" ? "a file" : "a regular file, not a symlink,";
|
|
138535
138542
|
return `${reply} (adb authenticates to the console with ${tokenFile}, which must be ${fileKind} holding the emulator's token)`;
|
|
138536
138543
|
}
|
|
@@ -138545,7 +138552,7 @@ async function captureVegaScreenshotPng(opts = {}) {
|
|
|
138545
138552
|
async function captureViaEmulatorConsole(opts) {
|
|
138546
138553
|
const port = await discoverVegaConsolePort();
|
|
138547
138554
|
const serial = `emulator-${port}`;
|
|
138548
|
-
const outDir = await (0, import_promises18.mkdtemp)((0, import_node_path29.join)((0,
|
|
138555
|
+
const outDir = await (0, import_promises18.mkdtemp)((0, import_node_path29.join)((0, import_node_os15.tmpdir)(), "vega-shot-"));
|
|
138549
138556
|
try {
|
|
138550
138557
|
const { stdout } = await runAdb(["-s", serial, "emu", "screenrecord", "screenshot", outDir], {
|
|
138551
138558
|
timeoutMs: 2e4
|
|
@@ -138567,7 +138574,7 @@ async function captureViaEmulatorConsole(opts) {
|
|
|
138567
138574
|
decoded2,
|
|
138568
138575
|
opts.scale ?? getScreenshotScaleOverride() ?? tvDefaultScale(decoded2.width, decoded2.height)
|
|
138569
138576
|
);
|
|
138570
|
-
const outPath = (0, import_node_path29.join)((0,
|
|
138577
|
+
const outPath = (0, import_node_path29.join)((0, import_node_os15.tmpdir)(), `vega-screenshot-${process.hrtime.bigint()}.png`);
|
|
138571
138578
|
await (0, import_promises18.writeFile)(outPath, import_pngjs3.PNG.sync.write(scaled));
|
|
138572
138579
|
return outPath;
|
|
138573
138580
|
} finally {
|
|
@@ -138578,7 +138585,7 @@ async function captureViaEmulatorConsole(opts) {
|
|
|
138578
138585
|
|
|
138579
138586
|
// ../tool-server/src/utils/harmony-screen.ts
|
|
138580
138587
|
var import_promises19 = require("node:fs/promises");
|
|
138581
|
-
var
|
|
138588
|
+
var import_node_os16 = require("node:os");
|
|
138582
138589
|
var import_node_path30 = require("node:path");
|
|
138583
138590
|
var import_pngjs4 = __toESM(require_png());
|
|
138584
138591
|
init_src2();
|
|
@@ -138600,12 +138607,12 @@ function decodeCapture(raw, connectKey) {
|
|
|
138600
138607
|
}
|
|
138601
138608
|
}
|
|
138602
138609
|
async function captureHarmonyScreenshotPng(opts) {
|
|
138603
|
-
const rawPath = (0, import_node_path30.join)((0,
|
|
138610
|
+
const rawPath = (0, import_node_path30.join)((0, import_node_os16.tmpdir)(), `argent-harmony-raw-${process.hrtime.bigint()}.png`);
|
|
138604
138611
|
try {
|
|
138605
138612
|
await harmonyScreenCap(opts.connectKey, rawPath);
|
|
138606
138613
|
const decoded2 = decodeCapture(await (0, import_promises19.readFile)(rawPath), opts.connectKey);
|
|
138607
138614
|
const scaled = scaleDecodedPng(decoded2, opts.scale);
|
|
138608
|
-
const outPath = (0, import_node_path30.join)((0,
|
|
138615
|
+
const outPath = (0, import_node_path30.join)((0, import_node_os16.tmpdir)(), `harmony-screenshot-${process.hrtime.bigint()}.png`);
|
|
138609
138616
|
if (scaled === decoded2) {
|
|
138610
138617
|
await (0, import_promises19.rename)(rawPath, outPath);
|
|
138611
138618
|
} else {
|
|
@@ -175592,7 +175599,7 @@ var dismissUpdateTool = {
|
|
|
175592
175599
|
// ../tool-server/src/tools/screenshot-diff/index.ts
|
|
175593
175600
|
var import_node_crypto25 = __toESM(require("node:crypto"));
|
|
175594
175601
|
var import_promises23 = __toESM(require("fs/promises"));
|
|
175595
|
-
var
|
|
175602
|
+
var import_node_os17 = __toESM(require("node:os"));
|
|
175596
175603
|
var import_path9 = __toESM(require("path"));
|
|
175597
175604
|
init_zod();
|
|
175598
175605
|
init_src2();
|
|
@@ -175732,7 +175739,7 @@ async function resolveOutputDir(params, options) {
|
|
|
175732
175739
|
}
|
|
175733
175740
|
}
|
|
175734
175741
|
const dir = import_path9.default.join(
|
|
175735
|
-
|
|
175742
|
+
import_node_os17.default.tmpdir(),
|
|
175736
175743
|
"argent-screenshot-diff",
|
|
175737
175744
|
import_node_crypto25.default.randomBytes(6).toString("hex")
|
|
175738
175745
|
);
|
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.62",
|
|
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": "58ba34e0801c010cba78b5f152a16e79196d0712"
|
|
102
102
|
}
|