@swmansion/argent 0.35.1-next.32 → 0.35.1-next.34
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 +240 -239
- package/dist/client.js +42 -41
- package/dist/installer.mjs +242 -241
- package/dist/mcp-server.mjs +47 -46
- package/dist/tool-server.cjs +398 -394
- package/package.json +2 -2
package/dist/client.js
CHANGED
|
@@ -7308,14 +7308,14 @@ var require_parser = __commonJS({
|
|
|
7308
7308
|
case "scalar":
|
|
7309
7309
|
case "single-quoted-scalar":
|
|
7310
7310
|
case "double-quoted-scalar": {
|
|
7311
|
-
const
|
|
7311
|
+
const fs10 = this.flowScalar(this.type);
|
|
7312
7312
|
if (atNextItem || it.value) {
|
|
7313
|
-
map.items.push({ start, key:
|
|
7313
|
+
map.items.push({ start, key: fs10, sep: [] });
|
|
7314
7314
|
this.onKeyLine = true;
|
|
7315
7315
|
} else if (it.sep) {
|
|
7316
|
-
this.stack.push(
|
|
7316
|
+
this.stack.push(fs10);
|
|
7317
7317
|
} else {
|
|
7318
|
-
Object.assign(it, { key:
|
|
7318
|
+
Object.assign(it, { key: fs10, sep: [] });
|
|
7319
7319
|
this.onKeyLine = true;
|
|
7320
7320
|
}
|
|
7321
7321
|
return;
|
|
@@ -7443,13 +7443,13 @@ var require_parser = __commonJS({
|
|
|
7443
7443
|
case "scalar":
|
|
7444
7444
|
case "single-quoted-scalar":
|
|
7445
7445
|
case "double-quoted-scalar": {
|
|
7446
|
-
const
|
|
7446
|
+
const fs10 = this.flowScalar(this.type);
|
|
7447
7447
|
if (!it || it.value)
|
|
7448
|
-
fc.items.push({ start: [], key:
|
|
7448
|
+
fc.items.push({ start: [], key: fs10, sep: [] });
|
|
7449
7449
|
else if (it.sep)
|
|
7450
|
-
this.stack.push(
|
|
7450
|
+
this.stack.push(fs10);
|
|
7451
7451
|
else
|
|
7452
|
-
Object.assign(it, { key:
|
|
7452
|
+
Object.assign(it, { key: fs10, sep: [] });
|
|
7453
7453
|
return;
|
|
7454
7454
|
}
|
|
7455
7455
|
case "flow-map-end":
|
|
@@ -8259,6 +8259,7 @@ function getConfigDefinition(key, registry = CONFIG_SCHEMA) {
|
|
|
8259
8259
|
}
|
|
8260
8260
|
|
|
8261
8261
|
// ../configuration-core/src/config-access.ts
|
|
8262
|
+
import * as fs5 from "node:fs";
|
|
8262
8263
|
import * as path6 from "node:path";
|
|
8263
8264
|
function readScopeValue(def, scope, options) {
|
|
8264
8265
|
if (!def.scopes.includes(scope)) return void 0;
|
|
@@ -8293,7 +8294,7 @@ var UnknownConfigKeyError = class extends Error {
|
|
|
8293
8294
|
|
|
8294
8295
|
// ../argent-tools-client/src/launcher.ts
|
|
8295
8296
|
import * as net from "node:net";
|
|
8296
|
-
import * as
|
|
8297
|
+
import * as fs6 from "node:fs";
|
|
8297
8298
|
import * as path7 from "node:path";
|
|
8298
8299
|
import * as readline from "node:readline";
|
|
8299
8300
|
import { spawn, execFileSync } from "node:child_process";
|
|
@@ -8381,7 +8382,7 @@ function isVersionNewer(a, b) {
|
|
|
8381
8382
|
function readBundlePackageVersion(bundlePath) {
|
|
8382
8383
|
try {
|
|
8383
8384
|
const pkg = JSON.parse(
|
|
8384
|
-
|
|
8385
|
+
fs6.readFileSync(path7.join(path7.dirname(bundlePath), "..", "package.json"), "utf8")
|
|
8385
8386
|
);
|
|
8386
8387
|
return typeof pkg.version === "string" ? pkg.version : void 0;
|
|
8387
8388
|
} catch {
|
|
@@ -8438,7 +8439,7 @@ function killSpawnedChild(child, pid) {
|
|
|
8438
8439
|
}
|
|
8439
8440
|
function resolveToolsServerNode() {
|
|
8440
8441
|
const { bun, deno, electron } = process.versions;
|
|
8441
|
-
return !(bun || deno || electron) &&
|
|
8442
|
+
return !(bun || deno || electron) && fs6.existsSync(process.execPath) ? process.execPath : "node";
|
|
8442
8443
|
}
|
|
8443
8444
|
function parseListeningPort(line) {
|
|
8444
8445
|
const match = line.match(/Tools server listening on http:\/\/.+:(\d+)/);
|
|
@@ -8448,10 +8449,10 @@ function spawnToolsServer(paths, port, options = {}) {
|
|
|
8448
8449
|
return new Promise((resolve12, reject) => {
|
|
8449
8450
|
let logFd;
|
|
8450
8451
|
try {
|
|
8451
|
-
|
|
8452
|
-
logFd =
|
|
8452
|
+
fs6.mkdirSync(STATE_DIR, { recursive: true });
|
|
8453
|
+
logFd = fs6.openSync(LOG_FILE, "a");
|
|
8453
8454
|
} catch {
|
|
8454
|
-
logFd =
|
|
8455
|
+
logFd = fs6.openSync("/dev/null", "w");
|
|
8455
8456
|
}
|
|
8456
8457
|
const nodeBin = resolveToolsServerNode();
|
|
8457
8458
|
const child = spawn(nodeBin, [paths.bundlePath, "start"], {
|
|
@@ -8459,7 +8460,7 @@ function spawnToolsServer(paths, port, options = {}) {
|
|
|
8459
8460
|
stdio: ["ignore", "pipe", logFd],
|
|
8460
8461
|
env: buildToolsServerEnv(paths, port, process.env, options)
|
|
8461
8462
|
});
|
|
8462
|
-
|
|
8463
|
+
fs6.closeSync(logFd);
|
|
8463
8464
|
const pid = child.pid;
|
|
8464
8465
|
if (!pid) {
|
|
8465
8466
|
child.once(
|
|
@@ -8585,7 +8586,7 @@ async function sweepDeadStateFiles() {
|
|
|
8585
8586
|
});
|
|
8586
8587
|
continue;
|
|
8587
8588
|
}
|
|
8588
|
-
if (
|
|
8589
|
+
if (fs6.existsSync(fresh.bundlePath)) continue;
|
|
8589
8590
|
if (!couldBeOurToolServer(fresh.pid, fresh.bundlePath)) continue;
|
|
8590
8591
|
await unlink(file).catch(() => {
|
|
8591
8592
|
});
|
|
@@ -8632,7 +8633,7 @@ async function killToolServer(bundlePath) {
|
|
|
8632
8633
|
await clearToolsServerState(bundlePath ?? state.bundlePath);
|
|
8633
8634
|
return alive;
|
|
8634
8635
|
}
|
|
8635
|
-
var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) =>
|
|
8636
|
+
var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs6.existsSync(p)) ?? "ps";
|
|
8636
8637
|
var PS_WIDTH_FLAGS = ["-ww"];
|
|
8637
8638
|
var PS_LOCALE = process.platform === "darwin" ? "en_US.UTF-8" : "C.UTF-8";
|
|
8638
8639
|
function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS, env = { ...process.env, LC_ALL: PS_LOCALE }) {
|
|
@@ -8679,13 +8680,13 @@ var LOCK_STALE_MS = 45e3;
|
|
|
8679
8680
|
var LOCK_POLL_MS = 100;
|
|
8680
8681
|
function spawnLockIsStale() {
|
|
8681
8682
|
try {
|
|
8682
|
-
const { pid, ts } = JSON.parse(
|
|
8683
|
+
const { pid, ts } = JSON.parse(fs6.readFileSync(LOCK_FILE, "utf8"));
|
|
8683
8684
|
if (typeof pid === "number" && pid > 0 && !isProcessAlive(pid)) return true;
|
|
8684
8685
|
if (typeof ts === "number" && Date.now() - ts > LOCK_STALE_MS) return true;
|
|
8685
8686
|
return false;
|
|
8686
8687
|
} catch {
|
|
8687
8688
|
try {
|
|
8688
|
-
return Date.now() -
|
|
8689
|
+
return Date.now() - fs6.statSync(LOCK_FILE).mtimeMs > LOCK_STALE_MS;
|
|
8689
8690
|
} catch {
|
|
8690
8691
|
return true;
|
|
8691
8692
|
}
|
|
@@ -8693,7 +8694,7 @@ function spawnLockIsStale() {
|
|
|
8693
8694
|
}
|
|
8694
8695
|
async function acquireSpawnLock() {
|
|
8695
8696
|
try {
|
|
8696
|
-
|
|
8697
|
+
fs6.mkdirSync(STATE_DIR, { recursive: true });
|
|
8697
8698
|
} catch {
|
|
8698
8699
|
return null;
|
|
8699
8700
|
}
|
|
@@ -8701,11 +8702,11 @@ async function acquireSpawnLock() {
|
|
|
8701
8702
|
const deadline = Date.now() + LOCK_WAIT_TIMEOUT_MS;
|
|
8702
8703
|
for (; ; ) {
|
|
8703
8704
|
try {
|
|
8704
|
-
const fd =
|
|
8705
|
+
const fd = fs6.openSync(LOCK_FILE, "wx");
|
|
8705
8706
|
try {
|
|
8706
|
-
|
|
8707
|
+
fs6.writeSync(fd, JSON.stringify({ pid: process.pid, nonce, ts: Date.now() }));
|
|
8707
8708
|
} finally {
|
|
8708
|
-
|
|
8709
|
+
fs6.closeSync(fd);
|
|
8709
8710
|
}
|
|
8710
8711
|
let released = false;
|
|
8711
8712
|
return {
|
|
@@ -8713,8 +8714,8 @@ async function acquireSpawnLock() {
|
|
|
8713
8714
|
if (released) return;
|
|
8714
8715
|
released = true;
|
|
8715
8716
|
try {
|
|
8716
|
-
const cur = JSON.parse(
|
|
8717
|
-
if (cur.pid === process.pid && cur.nonce === nonce)
|
|
8717
|
+
const cur = JSON.parse(fs6.readFileSync(LOCK_FILE, "utf8"));
|
|
8718
|
+
if (cur.pid === process.pid && cur.nonce === nonce) fs6.unlinkSync(LOCK_FILE);
|
|
8718
8719
|
} catch {
|
|
8719
8720
|
}
|
|
8720
8721
|
}
|
|
@@ -8723,10 +8724,10 @@ async function acquireSpawnLock() {
|
|
|
8723
8724
|
if (err.code !== "EEXIST") return null;
|
|
8724
8725
|
if (spawnLockIsStale()) {
|
|
8725
8726
|
try {
|
|
8726
|
-
|
|
8727
|
+
fs6.unlinkSync(LOCK_FILE);
|
|
8727
8728
|
} catch {
|
|
8728
8729
|
}
|
|
8729
|
-
if (!
|
|
8730
|
+
if (!fs6.existsSync(LOCK_FILE)) continue;
|
|
8730
8731
|
}
|
|
8731
8732
|
if (Date.now() >= deadline) return null;
|
|
8732
8733
|
await new Promise((r) => setTimeout(r, LOCK_POLL_MS));
|
|
@@ -8766,7 +8767,7 @@ async function ensureToolsServer(paths) {
|
|
|
8766
8767
|
}
|
|
8767
8768
|
await clearToolsServerState(paths.bundlePath);
|
|
8768
8769
|
await sweepDeadStateFiles();
|
|
8769
|
-
if (!
|
|
8770
|
+
if (!fs6.existsSync(paths.bundlePath)) {
|
|
8770
8771
|
throw new Error(
|
|
8771
8772
|
`The argent install serving this session is gone from disk (${paths.bundlePath}) \u2014 it was likely updated or removed. Restart the editor's MCP connection to reconnect.`
|
|
8772
8773
|
);
|
|
@@ -8869,11 +8870,11 @@ var LAUNCH_PLATFORMS = ["ios", "android", "chromium", "vega", "macos"];
|
|
|
8869
8870
|
var SELECTABLE_PLATFORMS = [...LAUNCH_PLATFORMS, "ios-remote"];
|
|
8870
8871
|
|
|
8871
8872
|
// ../registry/src/flow-file-refs.ts
|
|
8872
|
-
import * as
|
|
8873
|
+
import * as fs8 from "node:fs/promises";
|
|
8873
8874
|
import * as path9 from "node:path";
|
|
8874
8875
|
|
|
8875
8876
|
// ../registry/src/e2e-dirs.ts
|
|
8876
|
-
import * as
|
|
8877
|
+
import * as fs7 from "node:fs/promises";
|
|
8877
8878
|
import * as path8 from "node:path";
|
|
8878
8879
|
var E2E_DIR = path8.join(".argent", "e2e");
|
|
8879
8880
|
var LEGACY_E2E_DIRS = Object.freeze([path8.join(".argent", "flows")]);
|
|
@@ -8888,7 +8889,7 @@ function e2eFileCandidates(projectRoot, name) {
|
|
|
8888
8889
|
return e2eDirsFor(projectRoot).map((dir) => path8.join(dir, `${name}.yaml`));
|
|
8889
8890
|
}
|
|
8890
8891
|
async function exists(file) {
|
|
8891
|
-
return
|
|
8892
|
+
return fs7.stat(file).then(
|
|
8892
8893
|
() => true,
|
|
8893
8894
|
() => false
|
|
8894
8895
|
);
|
|
@@ -8979,10 +8980,10 @@ function canonicalToolArgs(tool, args) {
|
|
|
8979
8980
|
// ../registry/src/flow-file-refs.ts
|
|
8980
8981
|
async function canonicalFlowPath(p) {
|
|
8981
8982
|
try {
|
|
8982
|
-
return await
|
|
8983
|
+
return await fs8.realpath(p);
|
|
8983
8984
|
} catch {
|
|
8984
8985
|
try {
|
|
8985
|
-
return path9.join(await
|
|
8986
|
+
return path9.join(await fs8.realpath(path9.dirname(p)), path9.basename(p));
|
|
8986
8987
|
} catch {
|
|
8987
8988
|
return p;
|
|
8988
8989
|
}
|
|
@@ -9042,7 +9043,7 @@ function flowMemberKey(anchorDir, target) {
|
|
|
9042
9043
|
return `${anchorDir}\0${target}`;
|
|
9043
9044
|
}
|
|
9044
9045
|
async function classifyOnDiskSpelling(dir, base, addressable = FLOW_FILE_NAME_PATTERN) {
|
|
9045
|
-
const entries = await
|
|
9046
|
+
const entries = await fs8.readdir(dir).catch(() => null);
|
|
9046
9047
|
if (entries === null || entries.includes(base)) return { state: "listed" };
|
|
9047
9048
|
const actual = entries.find((entry) => entry.toLowerCase() === base.toLowerCase());
|
|
9048
9049
|
if (actual === void 0) return { state: "absent" };
|
|
@@ -11512,12 +11513,12 @@ function getDeviceIdFromArgs(args) {
|
|
|
11512
11513
|
}
|
|
11513
11514
|
|
|
11514
11515
|
// src/bundled-paths.ts
|
|
11515
|
-
import * as
|
|
11516
|
+
import * as fs9 from "node:fs";
|
|
11516
11517
|
import * as path14 from "node:path";
|
|
11517
11518
|
function readPackageVersion() {
|
|
11518
11519
|
try {
|
|
11519
11520
|
const pkg = JSON.parse(
|
|
11520
|
-
|
|
11521
|
+
fs9.readFileSync(path14.join(import.meta.dirname, "..", "package.json"), "utf8")
|
|
11521
11522
|
);
|
|
11522
11523
|
return pkg.version;
|
|
11523
11524
|
} catch {
|
|
@@ -11528,9 +11529,9 @@ var PACKAGE_NAME = "@swmansion/argent";
|
|
|
11528
11529
|
function findDeclaringRoot(startDir) {
|
|
11529
11530
|
let dir = startDir;
|
|
11530
11531
|
for (; ; ) {
|
|
11531
|
-
if (
|
|
11532
|
+
if (fs9.existsSync(path14.join(dir, ".argent", "install.json"))) return dir;
|
|
11532
11533
|
try {
|
|
11533
|
-
const manifest = JSON.parse(
|
|
11534
|
+
const manifest = JSON.parse(fs9.readFileSync(path14.join(dir, "package.json"), "utf8"));
|
|
11534
11535
|
if (manifest.devDependencies?.[PACKAGE_NAME] || manifest.dependencies?.[PACKAGE_NAME] || manifest.optionalDependencies?.[PACKAGE_NAME]) {
|
|
11535
11536
|
return dir;
|
|
11536
11537
|
}
|
|
@@ -11546,7 +11547,7 @@ function findStablePackageDir(startDir, packageRoot) {
|
|
|
11546
11547
|
for (; ; ) {
|
|
11547
11548
|
const candidate = path14.join(dir, "node_modules", PACKAGE_NAME);
|
|
11548
11549
|
try {
|
|
11549
|
-
if (
|
|
11550
|
+
if (fs9.realpathSync(candidate) === packageRoot) return candidate;
|
|
11550
11551
|
} catch {
|
|
11551
11552
|
}
|
|
11552
11553
|
const parent = path14.dirname(dir);
|
|
@@ -11559,7 +11560,7 @@ function classifyInstall() {
|
|
|
11559
11560
|
let dir;
|
|
11560
11561
|
let cwd;
|
|
11561
11562
|
try {
|
|
11562
|
-
packageRoot =
|
|
11563
|
+
packageRoot = fs9.realpathSync(path14.join(import.meta.dirname, ".."));
|
|
11563
11564
|
cwd = process.cwd();
|
|
11564
11565
|
dir = cwd;
|
|
11565
11566
|
} catch {
|
|
@@ -11567,7 +11568,7 @@ function classifyInstall() {
|
|
|
11567
11568
|
}
|
|
11568
11569
|
for (; ; ) {
|
|
11569
11570
|
try {
|
|
11570
|
-
const nmReal =
|
|
11571
|
+
const nmReal = fs9.realpathSync(path14.join(dir, "node_modules"));
|
|
11571
11572
|
if (packageRoot === nmReal || packageRoot.startsWith(nmReal + path14.sep)) {
|
|
11572
11573
|
return {
|
|
11573
11574
|
kind: "local",
|