@swmansion/argent 0.18.0 → 0.18.1-next.0

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.
Binary file
Binary file
Binary file
Binary file
package/dist/cli-cmds.mjs CHANGED
@@ -163,7 +163,7 @@ var require_src = __commonJS({
163
163
 
164
164
  // ../argent-cli/src/run.ts
165
165
  import * as fs8 from "node:fs";
166
- import * as path10 from "node:path";
166
+ import * as path11 from "node:path";
167
167
 
168
168
  // ../argent-tools-client/src/launcher.ts
169
169
  import * as net from "node:net";
@@ -204,7 +204,7 @@ function generateAuthToken() {
204
204
  return generateToken();
205
205
  }
206
206
  function findFreePort() {
207
- return new Promise((resolve7, reject) => {
207
+ return new Promise((resolve8, reject) => {
208
208
  const srv = net.createServer();
209
209
  srv.listen(0, "127.0.0.1", () => {
210
210
  const addr = srv.address();
@@ -215,7 +215,7 @@ function findFreePort() {
215
215
  const port = addr.port;
216
216
  srv.close((err) => {
217
217
  if (err) reject(err);
218
- else resolve7(port);
218
+ else resolve8(port);
219
219
  });
220
220
  });
221
221
  srv.on("error", reject);
@@ -316,7 +316,7 @@ function killSpawnedChild(child, pid) {
316
316
  }
317
317
  }
318
318
  function spawnToolsServer(paths, port, options = {}) {
319
- return new Promise((resolve7, reject) => {
319
+ return new Promise((resolve8, reject) => {
320
320
  let logFd;
321
321
  try {
322
322
  fs.mkdirSync(STATE_DIR, { recursive: true });
@@ -353,7 +353,7 @@ function spawnToolsServer(paths, port, options = {}) {
353
353
  rl.close();
354
354
  child.stdout?.resume();
355
355
  child.stdout?.unref?.();
356
- settle(() => resolve7({ port: actualPort, pid }));
356
+ settle(() => resolve8({ port: actualPort, pid }));
357
357
  }
358
358
  });
359
359
  child.on("error", (err) => {
@@ -742,8 +742,8 @@ function parseLinkTarget(input) {
742
742
  const host = u3.hostname.startsWith("[") ? u3.hostname.slice(1, -1) : u3.hostname;
743
743
  if (!host) throw new Error(`URL "${input}" is missing a host.`);
744
744
  const port = u3.port ? Number(u3.port) : u3.protocol === "https:" ? 443 : 80;
745
- const path15 = u3.pathname === "/" ? "" : u3.pathname.replace(/\/+$/, "");
746
- const url = `${u3.protocol}//${u3.host}${path15}`;
745
+ const path16 = u3.pathname === "/" ? "" : u3.pathname.replace(/\/+$/, "");
746
+ const url = `${u3.protocol}//${u3.host}${path16}`;
747
747
  const token = u3.username ? decodeURIComponent(u3.username) : void 0;
748
748
  return { url, host, port, ...token ? { token } : {} };
749
749
  }
@@ -879,9 +879,9 @@ async function tarball(sourcePath) {
879
879
  return tarPath;
880
880
  }
881
881
  function sha256File(filePath) {
882
- return new Promise((resolve7, reject) => {
882
+ return new Promise((resolve8, reject) => {
883
883
  const hash = createHash2("sha256");
884
- createReadStream(filePath).on("data", (chunk) => hash.update(chunk)).on("end", () => resolve7(hash.digest("hex"))).on("error", reject);
884
+ createReadStream(filePath).on("data", (chunk) => hash.update(chunk)).on("end", () => resolve8(hash.digest("hex"))).on("error", reject);
885
885
  });
886
886
  }
887
887
  async function uploadTar(tarPath, endpoint) {
@@ -1231,13 +1231,16 @@ function nonEmpty(value) {
1231
1231
  const trimmed = value.trim();
1232
1232
  return trimmed === "" ? null : value;
1233
1233
  }
1234
+ function resolveHomeDir(options = {}) {
1235
+ if (options.homeDir) return options.homeDir;
1236
+ return process.platform === "win32" ? nonEmpty(process.env.USERPROFILE) ?? os.homedir() : nonEmpty(process.env.HOME) ?? os.homedir();
1237
+ }
1234
1238
  function argentHomeDir() {
1235
- const home = process.platform === "win32" ? nonEmpty(process.env.USERPROFILE) ?? os.homedir() : nonEmpty(process.env.HOME) ?? os.homedir();
1236
- return path5.join(home, ".argent");
1239
+ return path5.join(resolveHomeDir(), ".argent");
1237
1240
  }
1238
1241
  function configDir(scope = "global", options = {}) {
1239
1242
  if (scope === "global") {
1240
- return options.homeDir ? path5.join(options.homeDir, ".argent") : argentHomeDir();
1243
+ return path5.join(resolveHomeDir(options), ".argent");
1241
1244
  }
1242
1245
  const cwd = options.cwd ?? process.cwd();
1243
1246
  return path5.join(resolveProjectRoot(cwd), ".argent");
@@ -1444,6 +1447,14 @@ function asString(raw) {
1444
1447
  const trimmed = raw.trim();
1445
1448
  return trimmed === "" ? void 0 : trimmed;
1446
1449
  }
1450
+ function asStringArray(raw) {
1451
+ if (!Array.isArray(raw)) return void 0;
1452
+ const out = [];
1453
+ for (const item of raw) {
1454
+ if (typeof item === "string" && item.trim() !== "") out.push(item.trim());
1455
+ }
1456
+ return out;
1457
+ }
1447
1458
  var CONFIG_SCHEMA = [
1448
1459
  {
1449
1460
  key: "telemetry.enabled",
@@ -1469,6 +1480,19 @@ var CONFIG_SCHEMA = [
1469
1480
  // user's global remembered choice.
1470
1481
  merge: "prioritize-local",
1471
1482
  example: "claude"
1483
+ },
1484
+ {
1485
+ key: "ios.additionalDeviceSets",
1486
+ description: "Additional CoreSimulator device-set directories whose simulators argent should see alongside the default set. Absolute paths (or ~/\u2026); relative entries resolve against the project root (project scope) or home (global scope).",
1487
+ scopes: ["project", "global"],
1488
+ parse: asStringArray,
1489
+ // Additive: the scopes extend each other rather than shadow — a repo's
1490
+ // committed device sets are appended to the user's global ones (global
1491
+ // baseline first, project extras after, deduplicated). Note that
1492
+ // `getAdditionalIosDeviceSets` re-implements this union (path resolution
1493
+ // must precede dedup) and guards on the preset staying "union".
1494
+ merge: "union",
1495
+ example: '["~/DeviceSets/ci"]'
1472
1496
  }
1473
1497
  ];
1474
1498
  function getConfigDefinition(key, registry = CONFIG_SCHEMA) {
@@ -1476,6 +1500,7 @@ function getConfigDefinition(key, registry = CONFIG_SCHEMA) {
1476
1500
  }
1477
1501
 
1478
1502
  // ../configuration-core/src/config-access.ts
1503
+ import * as path7 from "node:path";
1479
1504
  function readScopeValue(def, scope, options) {
1480
1505
  if (!def.scopes.includes(scope)) return void 0;
1481
1506
  const raw = getAtPath(readConfigObject(scope, options), def.key);
@@ -1660,10 +1685,10 @@ async function writeDurableUnique(dir, filename, write) {
1660
1685
  const stem = filename.slice(0, filename.length - ext.length);
1661
1686
  for (let i2 = 1; i2 <= 1e3; i2++) {
1662
1687
  const candidate = i2 === 1 ? filename : `${stem} (${i2})${ext}`;
1663
- const path15 = join8(dir, candidate);
1688
+ const path16 = join8(dir, candidate);
1664
1689
  try {
1665
- await write(path15);
1666
- return path15;
1690
+ await write(path16);
1691
+ return path16;
1667
1692
  } catch (err) {
1668
1693
  if (err?.code === "EEXIST") continue;
1669
1694
  throw err;
@@ -1859,8 +1884,8 @@ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname6(proce
1859
1884
  return decodedFile;
1860
1885
  };
1861
1886
  }
1862
- function normalizeWindowsPath(path15) {
1863
- return path15.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
1887
+ function normalizeWindowsPath(path16) {
1888
+ return path16.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
1864
1889
  }
1865
1890
 
1866
1891
  // ../../node_modules/@posthog/core/dist/featureFlagUtils.mjs
@@ -4412,15 +4437,15 @@ async function addSourceContext(frames) {
4412
4437
  LRU_FILE_CONTENTS_CACHE.reduce();
4413
4438
  return frames;
4414
4439
  }
4415
- function getContextLinesFromFile(path15, ranges, output) {
4416
- return new Promise((resolve7) => {
4417
- const stream = createReadStream2(path15);
4440
+ function getContextLinesFromFile(path16, ranges, output) {
4441
+ return new Promise((resolve8) => {
4442
+ const stream = createReadStream2(path16);
4418
4443
  const lineReaded = createInterface2({
4419
4444
  input: stream
4420
4445
  });
4421
4446
  function destroyStreamAndResolve() {
4422
4447
  stream.destroy();
4423
- resolve7();
4448
+ resolve8();
4424
4449
  }
4425
4450
  let lineNumber = 0;
4426
4451
  let currentRangeIndex = 0;
@@ -4429,7 +4454,7 @@ function getContextLinesFromFile(path15, ranges, output) {
4429
4454
  let rangeStart = range[0];
4430
4455
  let rangeEnd = range[1];
4431
4456
  function onStreamError() {
4432
- LRU_FILE_CONTENTS_FS_READ_FAILED.set(path15, 1);
4457
+ LRU_FILE_CONTENTS_FS_READ_FAILED.set(path16, 1);
4433
4458
  lineReaded.close();
4434
4459
  lineReaded.removeAllListeners();
4435
4460
  destroyStreamAndResolve();
@@ -4490,8 +4515,8 @@ function clearLineContext(frame) {
4490
4515
  delete frame.context_line;
4491
4516
  delete frame.post_context;
4492
4517
  }
4493
- function shouldSkipContextLinesForFile(path15) {
4494
- return path15.startsWith("node:") || path15.endsWith(".min.js") || path15.endsWith(".min.cjs") || path15.endsWith(".min.mjs") || path15.startsWith("data:");
4518
+ function shouldSkipContextLinesForFile(path16) {
4519
+ return path16.startsWith("node:") || path16.endsWith(".min.js") || path16.endsWith(".min.cjs") || path16.endsWith(".min.mjs") || path16.startsWith("data:");
4495
4520
  }
4496
4521
  function shouldSkipContextLinesForFrame(frame) {
4497
4522
  if (void 0 !== frame.lineno && frame.lineno > MAX_CONTEXTLINES_LINENO) return true;
@@ -5717,9 +5742,9 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
5717
5742
  if (!waitUntil) return;
5718
5743
  if (this.disabled || this.optedOut) return;
5719
5744
  if (!this._waitUntilCycle) {
5720
- let resolve7;
5745
+ let resolve8;
5721
5746
  const promise = new Promise((r2) => {
5722
- resolve7 = r2;
5747
+ resolve8 = r2;
5723
5748
  });
5724
5749
  try {
5725
5750
  waitUntil(promise);
@@ -5727,7 +5752,7 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
5727
5752
  return;
5728
5753
  }
5729
5754
  this._waitUntilCycle = {
5730
- resolve: resolve7,
5755
+ resolve: resolve8,
5731
5756
  startedAt: Date.now(),
5732
5757
  timer: void 0
5733
5758
  };
@@ -5751,12 +5776,12 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
5751
5776
  return cycle?.resolve;
5752
5777
  }
5753
5778
  async resolveWaitUntilFlush() {
5754
- const resolve7 = this._consumeWaitUntilCycle();
5779
+ const resolve8 = this._consumeWaitUntilCycle();
5755
5780
  try {
5756
5781
  await super.flush();
5757
5782
  } catch {
5758
5783
  } finally {
5759
- resolve7?.();
5784
+ resolve8?.();
5760
5785
  }
5761
5786
  }
5762
5787
  getPersistedProperty(key) {
@@ -5877,15 +5902,15 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
5877
5902
  async waitForLocalEvaluationReady(timeoutMs = THIRTY_SECONDS) {
5878
5903
  if (this.isLocalEvaluationReady()) return true;
5879
5904
  if (void 0 === this.featureFlagsPoller) return false;
5880
- return new Promise((resolve7) => {
5905
+ return new Promise((resolve8) => {
5881
5906
  const timeout = setTimeout(() => {
5882
5907
  cleanup();
5883
- resolve7(false);
5908
+ resolve8(false);
5884
5909
  }, timeoutMs);
5885
5910
  const cleanup = this._events.on("localEvaluationFlagsLoaded", (count) => {
5886
5911
  clearTimeout(timeout);
5887
5912
  cleanup();
5888
- resolve7(count > 0);
5913
+ resolve8(count > 0);
5889
5914
  });
5890
5915
  });
5891
5916
  }
@@ -6340,14 +6365,14 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
6340
6365
  this.context?.enter(data, options);
6341
6366
  }
6342
6367
  async _shutdown(shutdownTimeoutMs) {
6343
- const resolve7 = this._consumeWaitUntilCycle();
6368
+ const resolve8 = this._consumeWaitUntilCycle();
6344
6369
  await this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);
6345
6370
  this.errorTracking.shutdown();
6346
6371
  try {
6347
6372
  return await super._shutdown(shutdownTimeoutMs);
6348
6373
  } finally {
6349
6374
  this.distinctIdHasSentFlagCalls = {};
6350
- resolve7?.();
6375
+ resolve8?.();
6351
6376
  }
6352
6377
  }
6353
6378
  async _requestRemoteConfigPayload(flagKey) {
@@ -7332,9 +7357,9 @@ function isReplitAgent(env) {
7332
7357
  }
7333
7358
  var DEVIN_MARKER_PATH = "/opt/.devin";
7334
7359
  var JULES_MARKER_PATH = "/opt/environment_summary.sh";
7335
- function safeExists(fileExists, path15) {
7360
+ function safeExists(fileExists, path16) {
7336
7361
  try {
7337
- return fileExists(path15);
7362
+ return fileExists(path16);
7338
7363
  } catch {
7339
7364
  return false;
7340
7365
  }
@@ -7790,15 +7815,15 @@ function getBaseProps(runtime) {
7790
7815
  // ../telemetry/src/identity.ts
7791
7816
  import * as crypto2 from "node:crypto";
7792
7817
  import * as fs4 from "node:fs";
7793
- import * as path8 from "node:path";
7818
+ import * as path9 from "node:path";
7794
7819
 
7795
7820
  // ../telemetry/src/paths.ts
7796
- import * as path7 from "node:path";
7821
+ import * as path8 from "node:path";
7797
7822
  function identityFilePath() {
7798
- return path7.join(argentHomeDir(), "telemetry-id");
7823
+ return path8.join(argentHomeDir(), "telemetry-id");
7799
7824
  }
7800
7825
  function debugLogPath() {
7801
- return path7.join(argentHomeDir(), "telemetry-debug.log");
7826
+ return path8.join(argentHomeDir(), "telemetry-debug.log");
7802
7827
  }
7803
7828
 
7804
7829
  // ../telemetry/src/identity.ts
@@ -7914,7 +7939,7 @@ function writeIdFileAtomic(finalPath, id) {
7914
7939
  if (occupant && !occupant.isFile()) {
7915
7940
  throw new Error("telemetry: refusing to replace a non-regular file at the identity path");
7916
7941
  }
7917
- const tmpPath = path8.join(
7942
+ const tmpPath = path9.join(
7918
7943
  argentHomeDir(),
7919
7944
  `.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
7920
7945
  );
@@ -7938,7 +7963,7 @@ function mintRandomId(finalPath) {
7938
7963
  fs4.mkdirSync(argentHomeDir(), { recursive: true });
7939
7964
  let value = crypto2.randomUUID();
7940
7965
  for (let attempt = 0; attempt < 3; attempt++) {
7941
- const tmpPath = path8.join(
7966
+ const tmpPath = path9.join(
7942
7967
  argentHomeDir(),
7943
7968
  `.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
7944
7969
  );
@@ -7983,7 +8008,7 @@ function mintRandomId(finalPath) {
7983
8008
  throw new Error("telemetry: failed to create identity after retries");
7984
8009
  }
7985
8010
  function claimCorruptOccupant(finalPath) {
7986
- const claimed = path8.join(
8011
+ const claimed = path9.join(
7987
8012
  argentHomeDir(),
7988
8013
  `.telemetry-id.corrupt.${process.pid}.${crypto2.randomUUID()}`
7989
8014
  );
@@ -8025,12 +8050,12 @@ function tryReadId(filePath) {
8025
8050
  import { execFileSync as execFileSync2, spawn as spawn2 } from "node:child_process";
8026
8051
 
8027
8052
  // ../native-devtools-ios/src/index.ts
8028
- import * as path9 from "node:path";
8053
+ import * as path10 from "node:path";
8029
8054
  import * as fs5 from "node:fs";
8030
- var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path9.join(__dirname, "..", "dylibs");
8031
- var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path9.join(__dirname, "..", "bin");
8032
- var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path9.join(DYLIB_DIR, "tcp");
8033
- var DYLIB_TVOS_DIR = path9.join(DYLIB_DIR, "tvos");
8055
+ var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path10.join(__dirname, "..", "dylibs");
8056
+ var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path10.join(__dirname, "..", "bin");
8057
+ var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path10.join(DYLIB_DIR, "tcp");
8058
+ var DYLIB_TVOS_DIR = path10.join(DYLIB_DIR, "tvos");
8034
8059
  function hostPlatformKey() {
8035
8060
  if (process.platform === "linux" && process.arch === "arm64") {
8036
8061
  return "linux-arm64";
@@ -8041,13 +8066,13 @@ function simulatorServerBinaryName() {
8041
8066
  return process.platform === "win32" ? "simulator-server.exe" : "simulator-server";
8042
8067
  }
8043
8068
  function platformBinDir() {
8044
- return path9.join(BIN_DIR, hostPlatformKey());
8069
+ return path10.join(BIN_DIR, hostPlatformKey());
8045
8070
  }
8046
8071
  function simulatorServerBinaryPath() {
8047
8072
  const binaryName = simulatorServerBinaryName();
8048
- const p = path9.join(platformBinDir(), binaryName);
8073
+ const p = path10.join(platformBinDir(), binaryName);
8049
8074
  if (!fs5.existsSync(p)) {
8050
- const flat = path9.join(BIN_DIR, binaryName);
8075
+ const flat = path10.join(BIN_DIR, binaryName);
8051
8076
  const migrationHint = fs5.existsSync(flat) ? ` Found a binary at the old flat path ${flat}; move it to ${p} or update ARGENT_SIMULATOR_SERVER_DIR to point at the parent of the platform subdirectory.` : "";
8052
8077
  throw new Error(
8053
8078
  `simulator-server binary not found for platform "${hostPlatformKey()}" at ${p}. Supported hosts today: darwin, linux (x86_64 and arm64), win32.${migrationHint}`
@@ -8081,12 +8106,12 @@ function resolveHostFingerprint() {
8081
8106
  }
8082
8107
  }
8083
8108
  function resolveHostFingerprintAsync() {
8084
- return new Promise((resolve7) => {
8109
+ return new Promise((resolve8) => {
8085
8110
  let binary;
8086
8111
  try {
8087
8112
  binary = simulatorServerBinaryPath();
8088
8113
  } catch {
8089
- resolve7(null);
8114
+ resolve8(null);
8090
8115
  return;
8091
8116
  }
8092
8117
  let settled = false;
@@ -8099,7 +8124,7 @@ function resolveHostFingerprintAsync() {
8099
8124
  child?.kill("SIGKILL");
8100
8125
  } catch {
8101
8126
  }
8102
- resolve7(value);
8127
+ resolve8(value);
8103
8128
  };
8104
8129
  const watchdog = setTimeout(() => finish(null), FINGERPRINT_TIMEOUT_MS);
8105
8130
  watchdog.unref?.();
@@ -8341,7 +8366,7 @@ async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
8341
8366
  try {
8342
8367
  await Promise.race([
8343
8368
  client2.shutdown(timeoutMs),
8344
- new Promise((resolve7) => setTimeout(resolve7, timeoutMs + 250).unref())
8369
+ new Promise((resolve8) => setTimeout(resolve8, timeoutMs + 250).unref())
8345
8370
  ]);
8346
8371
  } catch (err) {
8347
8372
  emitDebugError("shutdown failed", err);
@@ -8361,7 +8386,7 @@ async function markDisabled() {
8361
8386
  try {
8362
8387
  await Promise.race([
8363
8388
  client2.shutdown(SHORT_FLUSH_TIMEOUT_MS),
8364
- new Promise((resolve7) => setTimeout(resolve7, SHORT_FLUSH_TIMEOUT_MS).unref())
8389
+ new Promise((resolve8) => setTimeout(resolve8, SHORT_FLUSH_TIMEOUT_MS).unref())
8365
8390
  ]);
8366
8391
  } catch {
8367
8392
  }
@@ -8603,13 +8628,13 @@ function splitOptions(argv) {
8603
8628
  return { json, outPath, argvForFlags: rest };
8604
8629
  }
8605
8630
  async function readStdin() {
8606
- return new Promise((resolve7, reject) => {
8631
+ return new Promise((resolve8, reject) => {
8607
8632
  let data = "";
8608
8633
  process.stdin.setEncoding("utf8");
8609
8634
  process.stdin.on("data", (chunk) => {
8610
8635
  data += chunk;
8611
8636
  });
8612
- process.stdin.on("end", () => resolve7(data));
8637
+ process.stdin.on("end", () => resolve8(data));
8613
8638
  process.stdin.on("error", reject);
8614
8639
  });
8615
8640
  }
@@ -8641,7 +8666,7 @@ async function fetchImageToFile(result, outPath) {
8641
8666
  const res = await fetch(url);
8642
8667
  if (!res.ok) throw new Error(`Failed to download image: ${res.status} ${res.statusText}`);
8643
8668
  const buf = Buffer.from(await res.arrayBuffer());
8644
- fs8.mkdirSync(path10.dirname(path10.resolve(outPath)), { recursive: true });
8669
+ fs8.mkdirSync(path11.dirname(path11.resolve(outPath)), { recursive: true });
8645
8670
  fs8.writeFileSync(outPath, buf);
8646
8671
  }
8647
8672
  function renderResult(result, outputHint, images, json) {
@@ -8781,7 +8806,7 @@ Examples:
8781
8806
  if (outPath && meta.outputHint === "image") {
8782
8807
  try {
8783
8808
  if (images.length > 0) {
8784
- fs8.mkdirSync(path10.dirname(path10.resolve(outPath)), { recursive: true });
8809
+ fs8.mkdirSync(path11.dirname(path11.resolve(outPath)), { recursive: true });
8785
8810
  fs8.writeFileSync(outPath, images[0].data);
8786
8811
  } else if (result && typeof result === "object") {
8787
8812
  await fetchImageToFile(result, outPath);
@@ -8806,7 +8831,7 @@ Examples:
8806
8831
 
8807
8832
  // ../argent-cli/src/flow.ts
8808
8833
  import * as fsp from "node:fs/promises";
8809
- import * as path11 from "node:path";
8834
+ import * as path12 from "node:path";
8810
8835
  var STATUS_GLYPH = {
8811
8836
  pass: "\u2713",
8812
8837
  fail: "\u2717",
@@ -8938,12 +8963,12 @@ async function exportFailureArtifacts(report, outputDir, ctx) {
8938
8963
  if (!key || !SAFE_ARTIFACT_NAME.test(key)) continue;
8939
8964
  const { result } = await materializeArtifacts(s.artifacts, ctx);
8940
8965
  s.artifacts = result;
8941
- const dir = path11.join(outputDir, report.flow);
8966
+ const dir = path12.join(outputDir, report.flow);
8942
8967
  for (const [role, value] of Object.entries(s.artifacts)) {
8943
8968
  if (typeof value !== "string") continue;
8944
- const dest = path11.join(dir, `${key}-${role}.png`);
8945
- const rel = path11.relative(outputDir, dest);
8946
- if (rel.startsWith("..") || path11.isAbsolute(rel)) continue;
8969
+ const dest = path12.join(dir, `${key}-${role}.png`);
8970
+ const rel = path12.relative(outputDir, dest);
8971
+ if (rel.startsWith("..") || path12.isAbsolute(rel)) continue;
8947
8972
  try {
8948
8973
  await fsp.mkdir(dir, { recursive: true });
8949
8974
  await fsp.copyFile(value, dest);
@@ -8959,7 +8984,7 @@ async function exportFailureArtifacts(report, outputDir, ctx) {
8959
8984
  function keyFromBaselinePath(artifacts) {
8960
8985
  const baseline = artifacts.baseline;
8961
8986
  if (typeof baseline !== "string") return null;
8962
- return path11.basename(baseline).replace(/\.png$/, "");
8987
+ return path12.basename(baseline).replace(/\.png$/, "");
8963
8988
  }
8964
8989
  function resolveArtifactDisplayPaths(report) {
8965
8990
  for (const s of report.steps) {
@@ -8971,7 +8996,7 @@ function resolveArtifactDisplayPaths(report) {
8971
8996
  }
8972
8997
  function exitAfterFlush(code, streams = [process.stdout, process.stderr]) {
8973
8998
  return Promise.all(
8974
- streams.map((s) => new Promise((resolve7) => s.write("", () => resolve7())))
8999
+ streams.map((s) => new Promise((resolve8) => s.write("", () => resolve8())))
8975
9000
  ).then(() => process.exit(code));
8976
9001
  }
8977
9002
  function renderReport(report) {
@@ -9008,7 +9033,7 @@ async function flow(argv, options) {
9008
9033
  }
9009
9034
  const { callTool, baseUrl } = createToolsClient({ paths: options.paths });
9010
9035
  if (sub === "list") {
9011
- const dir = path11.join(process.cwd(), ".argent", "flows");
9036
+ const dir = path12.join(process.cwd(), ".argent", "flows");
9012
9037
  try {
9013
9038
  const entries = await fsp.readdir(dir);
9014
9039
  const names = entries.filter((f) => f.endsWith(".yaml")).map((f) => f.replace(/\.yaml$/, ""));
@@ -9087,7 +9112,7 @@ async function flow(argv, options) {
9087
9112
  }
9088
9113
  if (args.output) {
9089
9114
  const { url, token } = await baseUrl();
9090
- await exportFailureArtifacts(report, path11.resolve(args.output), {
9115
+ await exportFailureArtifacts(report, path12.resolve(args.output), {
9091
9116
  toolsUrl: url,
9092
9117
  authToken: token
9093
9118
  });
@@ -9185,11 +9210,11 @@ Options:
9185
9210
 
9186
9211
  // ../argent-cli/src/server.ts
9187
9212
  import * as fs9 from "node:fs";
9188
- import * as path12 from "node:path";
9213
+ import * as path13 from "node:path";
9189
9214
  import { homedir as homedir5, networkInterfaces } from "node:os";
9190
9215
  import { spawn as spawn3 } from "node:child_process";
9191
- var STATE_DIR2 = path12.join(homedir5(), ".argent");
9192
- var LOG_FILE2 = path12.join(STATE_DIR2, "tool-server.log");
9216
+ var STATE_DIR2 = path13.join(homedir5(), ".argent");
9217
+ var LOG_FILE2 = path13.join(STATE_DIR2, "tool-server.log");
9193
9218
  async function describeForeignServers(ownBundlePath) {
9194
9219
  const others = (await readAllToolsServerStates()).filter(
9195
9220
  ({ state: state2 }) => state2.bundlePath !== ownBundlePath && isToolsServerProcessAlive(state2.pid)
@@ -9598,7 +9623,7 @@ async function server(argv, options) {
9598
9623
  // ../argent-cli/src/lens.ts
9599
9624
  import * as fs10 from "node:fs";
9600
9625
  import * as os2 from "node:os";
9601
- import * as path13 from "node:path";
9626
+ import * as path14 from "node:path";
9602
9627
 
9603
9628
  // ../argent-cli/src/lens-terminal.ts
9604
9629
  import { execFileSync as execFileSync3 } from "node:child_process";
@@ -9856,7 +9881,7 @@ function ptyInjectBeats(text2) {
9856
9881
  ];
9857
9882
  }
9858
9883
  function sleep(ms) {
9859
- return new Promise((resolve7) => setTimeout(resolve7, ms));
9884
+ return new Promise((resolve8) => setTimeout(resolve8, ms));
9860
9885
  }
9861
9886
  var DEFAULT_COLS = 80;
9862
9887
  var DEFAULT_ROWS = 24;
@@ -10077,7 +10102,7 @@ var SPAWN_GRACE_MS = 8e3;
10077
10102
  var DEATH_CONFIRMATIONS = 3;
10078
10103
  var SSE_RECONNECT_MS = 1e3;
10079
10104
  function sleep2(ms) {
10080
- return new Promise((resolve7) => setTimeout(resolve7, ms));
10105
+ return new Promise((resolve8) => setTimeout(resolve8, ms));
10081
10106
  }
10082
10107
  var TRUST_PROMPT_RE = /trust this folder|do you trust|yes,? i trust|trust the files in this/i;
10083
10108
  async function dismissTrustPrompt(session) {
@@ -10350,7 +10375,7 @@ async function lens(argv, options) {
10350
10375
  await endSession(baseUrl);
10351
10376
  process.exit(1);
10352
10377
  }
10353
- const seedFile = path13.join(os2.tmpdir(), `argent-lens-seed-${process.pid}-${Date.now()}.txt`);
10378
+ const seedFile = path14.join(os2.tmpdir(), `argent-lens-seed-${process.pid}-${Date.now()}.txt`);
10354
10379
  fs10.writeFileSync(seedFile, buildSeedPrompt(), "utf8");
10355
10380
  const launchCmd = agent.launch(shellQuote(process.cwd()), shellQuote(seedFile));
10356
10381
  const removeSeedFile = () => {
@@ -10745,7 +10770,7 @@ Options:
10745
10770
 
10746
10771
  // ../argent-cli/src/config.ts
10747
10772
  var import_picocolors2 = __toESM(require_picocolors(), 1);
10748
- import * as path14 from "node:path";
10773
+ import * as path15 from "node:path";
10749
10774
  function config(argv) {
10750
10775
  if (argv.length === 0 || argv[0] === "--help" || argv[0] === "-h") {
10751
10776
  printUsage();
@@ -10928,16 +10953,16 @@ function wantsHelp(argv) {
10928
10953
  }
10929
10954
  function scopeLabel(scope) {
10930
10955
  if (scope === "global") return "global";
10931
- return `project: ${path14.dirname(configDir("project"))}`;
10956
+ return `project: ${path15.dirname(configDir("project"))}`;
10932
10957
  }
10933
10958
  function degenerateProjectScopeWarning(scope) {
10934
10959
  if (scope !== "project") return null;
10935
10960
  const projDir = configDir("project");
10936
- if (path14.resolve(projDir) === path14.resolve(configDir("global"))) {
10937
- return `WARNING: no project found between ${process.cwd()} and your home directory \u2014 "project" scope resolved to the home directory, so this writes the GLOBAL config file (${path14.join(projDir, "config.json")}).`;
10961
+ if (path15.resolve(projDir) === path15.resolve(configDir("global"))) {
10962
+ return `WARNING: no project found between ${process.cwd()} and your home directory \u2014 "project" scope resolved to the home directory, so this writes the GLOBAL config file (${path15.join(projDir, "config.json")}).`;
10938
10963
  }
10939
10964
  if (findProjectRoot(process.cwd()) === null) {
10940
- return `WARNING: no project markers (.argent, .git, package.json) found above ${process.cwd()} \u2014 treating it as the project root and creating ${path14.join(projDir, "config.json")}.`;
10965
+ return `WARNING: no project markers (.argent, .git, package.json) found above ${process.cwd()} \u2014 treating it as the project root and creating ${path15.join(projDir, "config.json")}.`;
10941
10966
  }
10942
10967
  return null;
10943
10968
  }