@swmansion/argent 0.22.1-next.2 → 0.22.1-next.3

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.
@@ -10916,9 +10916,7 @@ var require_min_release_age = __commonJS({
10916
10916
  var PROBE_TIMEOUT_MS2 = 3e3;
10917
10917
  var OVERRIDE_ENV = "ARGENT_MIN_RELEASE_AGE_DAYS";
10918
10918
  var PM_PROBES = {
10919
- // npm flattens `min-release-age` to an effective `before` cutoff, and some
10920
- // npm 11.x builds report `min-release-age=null` even while the policy is
10921
- // active. Probe `before`, which is what the resolver actually uses.
10919
+ // Probe `before`: that is the effective cutoff npm's resolver applies.
10922
10920
  npm: { command: "npm config get before", parse: config_parse_1.parseBeforeAgeMs },
10923
10921
  pnpm: {
10924
10922
  command: "pnpm config get minimumReleaseAge",
@@ -15272,17 +15270,16 @@ function createExporter(config) {
15272
15270
  // The exporter bounds a request with `req.setTimeout()`, which Node only
15273
15271
  // arms once the socket is CONNECTED — so a collector whose address drops
15274
15272
  // packets (corporate egress filter, dead host behind a firewall) leaves a
15275
- // socket stuck in the connecting state that no export deadline can reach,
15276
- // holding the process open for the OS connect timeout (~75s on macOS)
15277
- // after shutdown() has already resolved. The agent's socket timeout is
15278
- // armed when the socket is CREATED, so it also covers connect: it fires,
15279
- // the request emits 'timeout', and the exporter's handler destroys it.
15273
+ // socket stuck connecting that no export deadline can reach, holding the
15274
+ // process open for the OS connect timeout after shutdown() has resolved.
15275
+ // The agent's socket timeout is armed when the socket is CREATED, so it
15276
+ // covers connect too: it fires, the request emits 'timeout', and the
15277
+ // exporter's handler destroys it.
15280
15278
  //
15281
15279
  // keepAlive is restated because supplying httpAgentOptions at all
15282
- // replaces the agent the SDK would otherwise build, and its default is
15283
- // keepAlive: true. Without it the long-lived tool-server pays a fresh
15284
- // TCP+TLS handshake for every 10s batch — measured as one socket per
15285
- // request against a loopback collector, versus one socket shared.
15280
+ // replaces the agent the SDK would otherwise build, whose default is
15281
+ // keepAlive: true; without it the long-lived tool-server pays a fresh
15282
+ // TCP+TLS handshake for every batch.
15286
15283
  httpAgentOptions: { timeout: EXPORT_TIMEOUT_MS, keepAlive: true }
15287
15284
  });
15288
15285
  } finally {
@@ -15564,15 +15561,12 @@ var FAILURE_CODES = {
15564
15561
  NATIVE_PROFILER_SESSION_TORN_DOWN: "NATIVE_PROFILER_SESSION_TORN_DOWN",
15565
15562
  NATIVE_PROFILER_APP_PROCESS_NOT_FOUND: "NATIVE_PROFILER_APP_PROCESS_NOT_FOUND",
15566
15563
  NATIVE_PROFILER_NO_EXPORTED_TRACE: "NATIVE_PROFILER_NO_EXPORTED_TRACE",
15567
- // Android perfetto start-failure modes — mirror the iOS xctrace set so a
15568
- // failed recording start is classified rather than falling through to the
15569
- // generic tool-execution bucket.
15564
+ // Android perfetto start failures, mirroring the iOS xctrace set above.
15570
15565
  NATIVE_PROFILER_PERFETTO_PROCESS_ERROR: "NATIVE_PROFILER_PERFETTO_PROCESS_ERROR",
15571
15566
  NATIVE_PROFILER_PERFETTO_READY_TIMEOUT: "NATIVE_PROFILER_PERFETTO_READY_TIMEOUT",
15572
15567
  NATIVE_PROFILER_PERFETTO_READY_EXITED: "NATIVE_PROFILER_PERFETTO_READY_EXITED",
15573
- // screen-recording-start / screen-recording-stop. One capture path for every
15574
- // platform (simulator-server's frame stream into ffmpeg), so the stages name
15575
- // the step that failed rather than the device family.
15568
+ // iOS and Android share one capture path (simulator-server frames into
15569
+ // ffmpeg), so these name the failing stage, not the device family.
15576
15570
  SCREEN_RECORDING_FACTORY_OPTIONS_MISSING: "SCREEN_RECORDING_FACTORY_OPTIONS_MISSING",
15577
15571
  SCREEN_RECORDING_WRONG_PLATFORM: "SCREEN_RECORDING_WRONG_PLATFORM",
15578
15572
  SCREEN_RECORDING_ALREADY_ACTIVE: "SCREEN_RECORDING_ALREADY_ACTIVE",
@@ -15823,7 +15817,6 @@ var ALLOWED = {
15823
15817
  install_mode: INSTALL_MODE
15824
15818
  },
15825
15819
  "installation:global_install_decision": {
15826
- // `from_tar` is intentionally absent; the installer skips that dev path.
15827
15820
  decision: oneOf(["install", "cancel", "already_installed"])
15828
15821
  },
15829
15822
  "installation:update_decision": {
@@ -15902,9 +15895,8 @@ var ALLOWED = {
15902
15895
  tool_invocation_id: UUID,
15903
15896
  platform: PLATFORM,
15904
15897
  duration_ms: DURATION_MS,
15905
- // Schema-declared parameter names only (emit side filters against the tool's
15906
- // own zod shape and caps at 16 before this gate); the array validator also
15907
- // voids anything longer or with a non-identifier element.
15898
+ // Emit side sends only names declared in the tool's zod shape, capped at 16
15899
+ // because arrayOf voids the whole array once it is longer.
15908
15900
  invalid_params: arrayOf(matches(/^[a-z][a-z0-9_]{0,63}$/i, 64), 16),
15909
15901
  ...FAILURE_SIGNAL,
15910
15902
  ...AI_TELEMETRY
@@ -16436,7 +16428,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16436
16428
  var SESSION_ID = randomUUID4();
16437
16429
  function readCliVersion() {
16438
16430
  if (true) {
16439
- return "0.22.1-next.2";
16431
+ return "0.22.1-next.3";
16440
16432
  }
16441
16433
  return "0.0.0";
16442
16434
  }
@@ -16749,15 +16741,11 @@ function resolveHostFingerprint() {
16749
16741
  const out = execFileSync(simulatorServerBinaryPath(), ["fingerprint"], {
16750
16742
  encoding: "utf8",
16751
16743
  timeout: FINGERPRINT_TIMEOUT_MS,
16752
- // Reap with SIGKILL, not the default SIGTERM: a binary that ignores SIGTERM
16753
- // would otherwise block the (synchronous) event loop past the cap forever.
16754
- // SIGKILL can't be trapped, so the timeout is a genuine bound here.
16744
+ // SIGKILL, not the default SIGTERM: a binary that ignores SIGTERM would
16745
+ // otherwise block the (synchronous) event loop past the cap forever.
16755
16746
  killSignal: "SIGKILL",
16756
- // Cap captured stdout (same limit as the async variant): a binary streaming
16757
- // output is SIGKILL'd at this cap rather than filling Node's 1 MiB default.
16758
16747
  maxBuffer: FINGERPRINT_MAX_BUFFER,
16759
- // Ignore stderr so a binary that logs diagnostics doesn't pollute the
16760
- // caller's stderr; stdout (index 1) is captured as the return value.
16748
+ // Ignore stderr so the binary's diagnostics don't pollute the caller's.
16761
16749
  stdio: ["ignore", "pipe", "ignore"]
16762
16750
  }).trim();
16763
16751
  return out.length > 0 ? out : null;
@@ -20336,12 +20324,8 @@ var cursorAdapter = {
20336
20324
  globalPath() {
20337
20325
  return path16.join(homedir4(), ".cursor", "mcp.json");
20338
20326
  },
20339
- // Cursor is a VS Code fork: .cursor/mcp.json is JSONC (line/block comments,
20340
- // trailing commas). Routing write/remove/hasArgentEntry through readJsonc /
20341
- // editJsoncFile applies path-targeted text edits that preserve comments and
20342
- // foreign servers. The old readJson → writeJson path ran commented files
20343
- // through readJson's `catch { return {} }`, then persisted only the argent
20344
- // entry — destroying every pre-existing server and comment. Matches VS Code.
20327
+ // Read and written as JSONC through readJsonc / editJsoncFile: path-targeted
20328
+ // text edits that preserve user comments and foreign servers.
20345
20329
  write(configPath, entry) {
20346
20330
  editJsoncFile(configPath, ["mcpServers", MCP_SERVER_KEY], {
20347
20331
  command: entry.command,
@@ -20366,14 +20350,8 @@ var cursorAdapter = {
20366
20350
  hasArgentEntry(configPath) {
20367
20351
  return this.getArgentEntry(configPath) !== null;
20368
20352
  },
20369
- // Cursor's allowlist lives in a separate ~/.cursor/permissions.json, which —
20370
- // like every Cursor config — is JSONC (comments, trailing commas) and may
20371
- // carry the user's own unrelated rules. Route through readJsonc / editJsoncFile
20372
- // so a hand-commented or multi-rule permissions.json survives: the old readJson
20373
- // path ran it through `catch { return {} }` and rewrote the whole file with
20374
- // only { mcpAllowlist }, dropping every foreign rule and comment. Newly matters
20375
- // because `hasArgentEntry` now reads mcp.json with readJsonc, so `update`
20376
- // detects a commented config as configured and calls this.
20353
+ // The allowlist lives in a separate ~/.cursor/permissions.json that may carry
20354
+ // the user's own rules, so edit that one key instead of rewriting the file.
20377
20355
  addAllowlist() {
20378
20356
  const permPath = path16.join(homedir4(), ".cursor", "permissions.json");
20379
20357
  const config = readJsonc(permPath);
@@ -20411,10 +20389,9 @@ function claudeDisabledListFinding(settingsPath, label, projectConfined) {
20411
20389
  location: label,
20412
20390
  reason: projectConfined ? `a recorded "reject" in disabledMcpjsonServers blocks the .mcp.json entry from loading` : `a machine-wide "reject" in disabledMcpjsonServers blocks .mcp.json argent entries in every project; if that is not deliberate, remove "argent" from the list`,
20413
20391
  entry: null,
20414
- // Removing a PROJECT-confined rejection only lets Claude Code prompt for
20415
- // approval again — running `argent init` is that consent. The user-global
20416
- // list (~/.claude/settings.json) reaches every project on the machine, so
20417
- // it is never auto-removed; the shared policy warns instead.
20392
+ // Removing a PROJECT-confined rejection only re-enables the approval prompt
20393
+ // — running `argent init` is that consent. The user-global list reaches
20394
+ // every project on the machine, so it is never auto-removed.
20418
20395
  autoRemove: projectConfined,
20419
20396
  remove: () => {
20420
20397
  const config = readJson(settingsPath);
@@ -20441,9 +20418,8 @@ var claudeAdapter = {
20441
20418
  globalPath() {
20442
20419
  return path16.join(homedir4(), ".claude.json");
20443
20420
  },
20444
- // JSONC is a superset of JSON, so routing through readJsonc / editJsoncFile is
20445
- // safe for this strict-JSON config and keeps every MCP-entry write on the one
20446
- // comment- and foreign-server-preserving path (see the Cursor adapter).
20421
+ // JSONC is a superset of JSON, so this config shares the one comment- and
20422
+ // foreign-server-preserving write path (see the Cursor adapter).
20447
20423
  write(configPath, entry) {
20448
20424
  editJsoncFile(configPath, ["mcpServers", MCP_SERVER_KEY], {
20449
20425
  type: "stdio",
@@ -20475,12 +20451,9 @@ var claudeAdapter = {
20475
20451
  hasArgentEntry(configPath) {
20476
20452
  return this.getArgentEntry(configPath) !== null;
20477
20453
  },
20478
- // Claude Code's scope precedence is local > project (.mcp.json) > user
20479
- // (~/.claude.json top-level). "Local scope" lives outside the
20480
- // projectPath/globalPath pair: projects["<abs path>"].mcpServers in
20481
- // ~/.claude.json (the default target of `claude mcp add`). A stale entry
20482
- // there outranks BOTH scopes init can write — no tools, no error. Also
20483
- // reports recorded .mcp.json rejections (see claudeDisabledListFinding).
20454
+ // Scans the scope outside the projectPath/globalPath pair —
20455
+ // projects["<abs path>"].mcpServers in ~/.claude.json — plus recorded
20456
+ // .mcp.json rejections (see claudeDisabledListFinding).
20484
20457
  findShadowingConfigs(root, writtenScope) {
20485
20458
  const findings = [];
20486
20459
  const claudeJsonPath = path16.join(homedir4(), ".claude.json");
@@ -20549,13 +20522,8 @@ var vscodeAdapter = {
20549
20522
  globalPath() {
20550
20523
  return null;
20551
20524
  },
20552
- // .vscode/mcp.json is JSONC — VS Code allows line/block comments and trailing
20553
- // commas. The previous JSON.parse → mutate → JSON.stringify path ran through
20554
- // readJson, whose `catch { return {} }` turned any commented file into {} and
20555
- // then persisted only { servers: { argent } }, destroying every pre-existing
20556
- // user server (and their comments). All four entry points now go through
20557
- // readJsonc / editJsoncFile — path-targeted text edits that preserve comments
20558
- // and foreign servers — matching the Zed and opencode adapters.
20525
+ // Read and written as JSONC through readJsonc / editJsoncFile so user comments
20526
+ // and foreign servers survive (see the Cursor adapter).
20559
20527
  write(configPath, entry) {
20560
20528
  editJsoncFile(configPath, ["servers", MCP_SERVER_KEY], {
20561
20529
  type: "stdio",
@@ -20581,11 +20549,8 @@ var vscodeAdapter = {
20581
20549
  hasArgentEntry(configPath) {
20582
20550
  return this.getArgentEntry(configPath) !== null;
20583
20551
  },
20584
- // The user-profile mcp.json is a scope the projectPath/globalPath pair
20585
- // doesn't cover. User-vs-workspace precedence is undocumented (observed:
20586
- // silent single-winner), so a stale entry there can shadow a fresh
20587
- // .vscode/mcp.json entry. Report it; the shared policy removes it only when
20588
- // provably dead.
20552
+ // The user-profile mcp.json is a scope the projectPath/globalPath pair doesn't
20553
+ // cover. Report it; the shared policy removes it only when provably dead.
20589
20554
  findShadowingConfigs(_root, _writtenScope) {
20590
20555
  const findings = [];
20591
20556
  for (const userDir of vscodeUserDirs()) {
@@ -20635,8 +20600,7 @@ var windsurfAdapter = {
20635
20600
  globalPath() {
20636
20601
  return path16.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
20637
20602
  },
20638
- // JSONC-safe MCP-entry writes (see the Cursor adapter): editJsoncFile
20639
- // preserves comments and pre-existing foreign servers on this JSON config.
20603
+ // JSONC-safe writes (see the Cursor adapter).
20640
20604
  write(configPath, entry) {
20641
20605
  editJsoncFile(configPath, ["mcpServers", MCP_SERVER_KEY], {
20642
20606
  command: entry.command,
@@ -20661,11 +20625,8 @@ var windsurfAdapter = {
20661
20625
  hasArgentEntry(configPath) {
20662
20626
  return this.getArgentEntry(configPath) !== null;
20663
20627
  },
20664
- // JSONC-safe allowlist edits (see the Cursor adapter): the argent entry lives
20665
- // in this same mcp_config.json, and `init` runs write() (comment-preserving)
20666
- // before addAllowlist(). The old readJson path choked on any user comment and
20667
- // silently skipped the toggle; editJsoncFile targets just the argent entry's
20668
- // alwaysAllow key so comments and foreign servers survive.
20628
+ // Targets just the argent entry's alwaysAllow key, so comments and foreign
20629
+ // servers survive.
20669
20630
  addAllowlist() {
20670
20631
  const configPath = path16.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
20671
20632
  const config = readJsonc(configPath);
@@ -20695,11 +20656,8 @@ var zedAdapter = {
20695
20656
  globalPath() {
20696
20657
  return path16.join(homedir4(), ".config", "zed", "settings.json");
20697
20658
  },
20698
- // Zed's settings.json is JSONC (line + block comments, trailing commas).
20699
- // The previous JSON.parse → mutate → JSON.stringify path silently stripped
20700
- // every comment in the user's hand-edited file. All four entry points now
20701
- // go through editJsoncFile, which applies path-targeted text edits via
20702
- // jsonc-parser so comments and formatting outside the touched key survive.
20659
+ // Read and written as JSONC through readJsonc / editJsoncFile so comments and
20660
+ // formatting outside the touched key survive (see the Cursor adapter).
20703
20661
  write(configPath, entry) {
20704
20662
  editJsoncFile(configPath, ["context_servers", MCP_SERVER_KEY], {
20705
20663
  source: "custom",
@@ -20725,10 +20683,8 @@ var zedAdapter = {
20725
20683
  hasArgentEntry(configPath) {
20726
20684
  return this.getArgentEntry(configPath) !== null;
20727
20685
  },
20728
- // Zed doesn't support server-level wildcards for MCP tools — each tool
20729
- // would need its own entry. Setting the global default to "allow" is the
20730
- // documented opt-in; built-in security rules still protect against
20731
- // destructive operations.
20686
+ // Zed has no server-level wildcard for MCP tools — each tool would need its
20687
+ // own entry — so the global default is set to "allow" instead.
20732
20688
  addAllowlist(root, scope) {
20733
20689
  const settingsPath = scope === "global" ? path16.join(homedir4(), ".config", "zed", "settings.json") : path16.join(root, ".zed", "settings.json");
20734
20690
  editJsoncFile(settingsPath, ["agent", "tool_permissions", "default"], "allow");
@@ -20753,8 +20709,7 @@ var geminiAdapter = {
20753
20709
  globalPath() {
20754
20710
  return path16.join(homedir4(), ".gemini", "settings.json");
20755
20711
  },
20756
- // JSONC-safe MCP-entry writes (see the Cursor adapter): editJsoncFile
20757
- // preserves comments and pre-existing foreign servers on this JSON config.
20712
+ // JSONC-safe writes (see the Cursor adapter).
20758
20713
  write(configPath, entry) {
20759
20714
  editJsoncFile(configPath, ["mcpServers", MCP_SERVER_KEY], {
20760
20715
  command: entry.command,
@@ -20779,11 +20734,8 @@ var geminiAdapter = {
20779
20734
  hasArgentEntry(configPath) {
20780
20735
  return this.getArgentEntry(configPath) !== null;
20781
20736
  },
20782
- // JSONC-safe allowlist edits (see the Cursor adapter): the argent entry lives
20783
- // in this same settings.json, and `init` runs write() (comment-preserving)
20784
- // before addAllowlist(). The old readJson path choked on any user comment and
20785
- // silently skipped the toggle; editJsoncFile targets just the argent entry's
20786
- // trust key so comments and foreign servers survive.
20737
+ // Targets just the argent entry's trust key, so comments and foreign servers
20738
+ // survive.
20787
20739
  addAllowlist(root, scope) {
20788
20740
  const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
20789
20741
  if (!configPath) {
@@ -21020,10 +20972,8 @@ var kiroAdapter = {
21020
20972
  globalPath() {
21021
20973
  return path16.join(homedir4(), ".kiro", "settings", "mcp.json");
21022
20974
  },
21023
- // Kiro is a VS Code fork: .kiro/settings/mcp.json is JSONC. As with Cursor,
21024
- // route write/remove/hasArgentEntry through readJsonc / editJsoncFile so
21025
- // comments and foreign servers survive instead of being flattened away by the
21026
- // old readJson → writeJson path.
20975
+ // Read and written as JSONC through readJsonc / editJsoncFile so comments and
20976
+ // foreign servers survive (see the Cursor adapter).
21027
20977
  write(configPath, entry) {
21028
20978
  editJsoncFile(configPath, ["mcpServers", MCP_SERVER_KEY], {
21029
20979
  command: entry.command,
@@ -21048,11 +20998,8 @@ var kiroAdapter = {
21048
20998
  hasArgentEntry(configPath) {
21049
20999
  return this.getArgentEntry(configPath) !== null;
21050
21000
  },
21051
- // JSONC-safe allowlist edits (see the Cursor adapter): .kiro/settings/mcp.json
21052
- // is JSONC, the argent entry lives in it, and `init` runs write() (comment-
21053
- // preserving) before addAllowlist(). The old readJson path choked on any user
21054
- // comment and silently skipped the toggle; editJsoncFile targets just the
21055
- // argent entry's autoApprove key so comments and foreign servers survive.
21001
+ // Targets just the argent entry's autoApprove key, so comments and foreign
21002
+ // servers survive.
21056
21003
  addAllowlist(root, scope) {
21057
21004
  const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
21058
21005
  if (!configPath) return;
@@ -21468,8 +21415,7 @@ var InitTelemetry = class {
21468
21415
  editorsConfiguredCount = 0;
21469
21416
  initSucceeded = false;
21470
21417
  finalized = false;
21471
- // Drains buffered events and records the single terminal cli_init_complete.
21472
- // Idempotent — only the first call emits.
21418
+ // Records the single terminal cli_init_complete, then drains the event queue.
21473
21419
  async finalize(failureSignal2) {
21474
21420
  if (this.finalized) return;
21475
21421
  this.finalized = true;
@@ -22547,19 +22493,16 @@ async function init2(args) {
22547
22493
  note(mcpLines.join("\n"), "MCP Configuration");
22548
22494
  const staleCleanup = await cleanupStaleMcpConfigs({
22549
22495
  writtenAdapters,
22550
- // Sweep EVERY adapter, not just the detected set: the sweep is fully
22551
- // gated on an existing argent entry (getArgentEntry), and the stale
22552
- // entries most worth pruning live in argent-only dirs (~/.cursor,
22553
- // ~/.codex) that detection now deliberately ignores.
22496
+ // Every adapter, not just the detected set: the sweep only acts where an
22497
+ // argent entry already exists, and detection ignores dirs holding nothing
22498
+ // but argent's own artifacts (~/.cursor, ~/.codex).
22554
22499
  detectedAdapters: ALL_ADAPTERS,
22555
22500
  installMode: tel.installMode,
22556
22501
  scope: normalizedScope,
22557
22502
  effectiveRoot,
22558
- // Removals reaching beyond this project (dead entries in global config
22559
- // files) get one confirmation: the "dead" verdict is a PATH probe in
22560
- // THIS shell, which an nvm-style split can fool, so a human always gets
22561
- // the last word. Non-interactive runs pass no confirmer, making the
22562
- // sweep report those entries instead of removing them.
22503
+ // Removals in global config files get one confirmation: the "dead" verdict
22504
+ // is a PATH probe in THIS shell, which an nvm-style split can fool. No
22505
+ // confirmer non-interactively, so the sweep reports them instead.
22563
22506
  confirmCrossProjectRemovals: parsed.nonInteractive ? void 0 : async (items) => {
22564
22507
  log.warn(
22565
22508
  `Dead argent entries from a previous global install were found in
@@ -23204,9 +23147,9 @@ async function update(args) {
23204
23147
  const { landed: reachedTarget, exitError: installError } = await runTrustingDisk(
23205
23148
  () => {
23206
23149
  execShellCommandSync(cmd, {
23207
- // Older versions still ship a postinstall script that honors this
23208
- // (current ones have none); keep it so downgrades and pinned
23209
- // installs of those versions stay quiet and don't double-kill.
23150
+ // Current versions ship no postinstall, but downgrades and pinned
23151
+ // installs fetch older ones whose postinstall honors this — keep it
23152
+ // so they stay quiet and don't double-kill the tool server.
23210
23153
  env: { ...process.env, ARGENT_SKIP_POSTINSTALL: "1" },
23211
23154
  // Local installs must rewrite the project's manifest/lockfile.
23212
23155
  ...mode === "local" ? { cwd: projectRoot } : {}
@@ -23214,8 +23157,8 @@ async function update(args) {
23214
23157
  },
23215
23158
  () => {
23216
23159
  landedVersion = mode === "local" ? (
23217
- // Cache-free read: the pre-install probe memoized the old version's
23218
- // realpath, so getLocallyInstalledVersion would report it stale here.
23160
+ // Cache-free: the pre-install probe memoized the old version's
23161
+ // realpath, so getLocallyInstalledVersion would read it stale.
23219
23162
  readLocalPackageVersionUncached(projectRoot) ?? getLocallyInstalledVersion(projectRoot)
23220
23163
  ) : getGloballyInstalledVersion();
23221
23164
  return landedVersion !== null && !isNewerVersion(target, landedVersion);
@@ -23418,9 +23361,9 @@ async function update(args) {
23418
23361
  scope: localAdapters.length > 0 ? "local" : "global",
23419
23362
  effectiveRoot: projectRoot,
23420
23363
  // Same one-shot confirmation init uses for cross-project removals.
23421
- // --yes passes no confirmer (sweep goes report-only there) — the agent-
23422
- // triggered `update --yes` must never delete cross-project state on a
23423
- // fallible PATH probe.
23364
+ // --yes passes no confirmer (the sweep goes report-only) — the
23365
+ // agent-triggered `update --yes` must never delete cross-project state
23366
+ // on a fallible PATH probe.
23424
23367
  confirmCrossProjectRemovals: nonInteractive ? void 0 : async (items) => {
23425
23368
  log.warn(
23426
23369
  `Dead argent entries from a previous global install were found in
@@ -16589,15 +16589,12 @@ var FAILURE_CODES = {
16589
16589
  NATIVE_PROFILER_SESSION_TORN_DOWN: "NATIVE_PROFILER_SESSION_TORN_DOWN",
16590
16590
  NATIVE_PROFILER_APP_PROCESS_NOT_FOUND: "NATIVE_PROFILER_APP_PROCESS_NOT_FOUND",
16591
16591
  NATIVE_PROFILER_NO_EXPORTED_TRACE: "NATIVE_PROFILER_NO_EXPORTED_TRACE",
16592
- // Android perfetto start-failure modes — mirror the iOS xctrace set so a
16593
- // failed recording start is classified rather than falling through to the
16594
- // generic tool-execution bucket.
16592
+ // Android perfetto start failures, mirroring the iOS xctrace set above.
16595
16593
  NATIVE_PROFILER_PERFETTO_PROCESS_ERROR: "NATIVE_PROFILER_PERFETTO_PROCESS_ERROR",
16596
16594
  NATIVE_PROFILER_PERFETTO_READY_TIMEOUT: "NATIVE_PROFILER_PERFETTO_READY_TIMEOUT",
16597
16595
  NATIVE_PROFILER_PERFETTO_READY_EXITED: "NATIVE_PROFILER_PERFETTO_READY_EXITED",
16598
- // screen-recording-start / screen-recording-stop. One capture path for every
16599
- // platform (simulator-server's frame stream into ffmpeg), so the stages name
16600
- // the step that failed rather than the device family.
16596
+ // iOS and Android share one capture path (simulator-server frames into
16597
+ // ffmpeg), so these name the failing stage, not the device family.
16601
16598
  SCREEN_RECORDING_FACTORY_OPTIONS_MISSING: "SCREEN_RECORDING_FACTORY_OPTIONS_MISSING",
16602
16599
  SCREEN_RECORDING_WRONG_PLATFORM: "SCREEN_RECORDING_WRONG_PLATFORM",
16603
16600
  SCREEN_RECORDING_ALREADY_ACTIVE: "SCREEN_RECORDING_ALREADY_ACTIVE",
@@ -17142,14 +17139,12 @@ var CONFIG_SCHEMA = [
17142
17139
  description: "Whether anonymous opt-out telemetry is enabled (on by default; environment opt-outs like DO_NOT_TRACK are not reflected here \u2014 `argent telemetry status` shows effective consent).",
17143
17140
  scopes: ["global"],
17144
17141
  parse: asBoolean,
17145
- // A committed project file must never re-enable telemetry a user disabled
17146
- // globally, so the more-restrictive (opt-out) value always wins.
17147
17142
  merge: "prioritize-restrictive",
17148
- // Telemetry is opt-out: with nothing stored, consent.ts treats it as
17149
- // enabled, and the config surface must report the same instead of "(unset)".
17143
+ // Opt-out: consent.ts reads an unstored value as enabled, so the config
17144
+ // surface must show the same rather than "(unset)".
17150
17145
  default: true,
17151
- // Read-only under `argent config`: opt-in/out goes through the dedicated
17152
- // command so the live client is drained/reset, not just the file rewritten.
17146
+ // Opt-in/out goes through the dedicated command so the live client is
17147
+ // drained/reset, not just the file rewritten.
17153
17148
  manageCommand: "argent telemetry"
17154
17149
  },
17155
17150
  {
@@ -17157,8 +17152,6 @@ var CONFIG_SCHEMA = [
17157
17152
  description: "Coding-agent id remembered by `argent lens` to skip the picker.",
17158
17153
  scopes: ["project", "global"],
17159
17154
  parse: asString,
17160
- // A repo can pin the agent its screenshots should use; falls back to the
17161
- // user's global remembered choice.
17162
17155
  merge: "prioritize-local",
17163
17156
  example: "claude"
17164
17157
  },
@@ -17167,11 +17160,9 @@ var CONFIG_SCHEMA = [
17167
17160
  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).",
17168
17161
  scopes: ["project", "global"],
17169
17162
  parse: asStringArray,
17170
- // Additive: the scopes extend each other rather than shadow — a repo's
17171
- // committed device sets are appended to the user's global ones (global
17172
- // baseline first, project extras after, deduplicated). Note that
17173
- // `getAdditionalIosDeviceSets` re-implements this union (path resolution
17174
- // must precede dedup) and guards on the preset staying "union".
17163
+ // Additive rather than shadowing: global baseline first, project extras
17164
+ // after, deduplicated. `getAdditionalIosDeviceSets` re-implements this union
17165
+ // (path resolution must precede dedup) and guards on the preset staying "union".
17175
17166
  merge: "union",
17176
17167
  example: '["~/DeviceSets/ci"]'
17177
17168
  },
@@ -17180,10 +17171,8 @@ var CONFIG_SCHEMA = [
17180
17171
  description: "Directory where finished screen recordings (mp4) are saved on the client host. Absolute, `~`-prefixed, or relative to the project root (home dir when not in a project). Unset \u21D2 `.argent/recordings` under the project root.",
17181
17172
  scopes: ["project", "global"],
17182
17173
  parse: asString,
17183
- // A repo can pin where its recordings land; falls back to the user's global
17184
- // preference. Resolution happens on the client (the machine the mp4 is
17185
- // persisted to), so with a remote `argent link` tool-server it is the
17186
- // *client's* config that decides.
17174
+ // Resolved on the client (the machine the mp4 is persisted to), so with a
17175
+ // remote `argent link` tool-server it is the *client's* config that decides.
17187
17176
  merge: "prioritize-local",
17188
17177
  example: "~/Movies/argent"
17189
17178
  }
@@ -17646,7 +17635,6 @@ var ALLOWED = {
17646
17635
  install_mode: INSTALL_MODE
17647
17636
  },
17648
17637
  "installation:global_install_decision": {
17649
- // `from_tar` is intentionally absent; the installer skips that dev path.
17650
17638
  decision: oneOf(["install", "cancel", "already_installed"])
17651
17639
  },
17652
17640
  "installation:update_decision": {
@@ -17725,9 +17713,8 @@ var ALLOWED = {
17725
17713
  tool_invocation_id: UUID,
17726
17714
  platform: PLATFORM,
17727
17715
  duration_ms: DURATION_MS,
17728
- // Schema-declared parameter names only (emit side filters against the tool's
17729
- // own zod shape and caps at 16 before this gate); the array validator also
17730
- // voids anything longer or with a non-identifier element.
17716
+ // Emit side sends only names declared in the tool's zod shape, capped at 16
17717
+ // because arrayOf voids the whole array once it is longer.
17731
17718
  invalid_params: arrayOf(matches(/^[a-z][a-z0-9_]{0,63}$/i, 64), 16),
17732
17719
  ...FAILURE_SIGNAL,
17733
17720
  ...AI_TELEMETRY
@@ -18684,9 +18671,8 @@ async function startMcpServer(options) {
18684
18671
  let finalArgs = args;
18685
18672
  if (meta2?.fileInputs?.length) {
18686
18673
  finalArgs = await prepareFileInputs(meta2.fileInputs, args ?? {}, {
18687
- // `resolved` is the startup routing decision that picked TOOLS_URL —
18688
- // an external target means this process may not share the server's
18689
- // filesystem, so file bytes must ride along.
18674
+ // An external target may not share this process's filesystem, so the
18675
+ // file bytes have to ride along.
18690
18676
  includeContent: resolved.url !== null
18691
18677
  });
18692
18678
  }
@@ -107,22 +107,18 @@ async function createWindow() {
107
107
  width: TARGET_WIDTH,
108
108
  height: TARGET_HEIGHT,
109
109
  title: "Argent Lens",
110
- // Native window controls (the macOS traffic lights) instead of a
111
- // handcrafted close button: `titleBarStyle: "hidden"` keeps the real OS
112
- // buttons in the top-left while hiding the rest of the title bar, so the
113
- // window still reads as frameless. (`frame: false` would suppress the
114
- // buttons entirely — that's what we used to do.)
110
+ // Keeps the real macOS traffic lights in the top-left while hiding the rest
111
+ // of the title bar, so the window still reads as frameless. `frame: false`
112
+ // would suppress the buttons entirely.
115
113
  titleBarStyle: "hidden",
116
- // Inset the traffic lights to share the same 14px padding the in-window
117
- // corner panels use (theme toggle, status pill), so the native buttons and
118
- // the handcrafted chrome read as one consistent margin. Keep x and y equal —
119
- // an asymmetric inset (e.g. 14/18) reads as visibly off against the square
120
- // corner panels.
114
+ // Same 14px inset the in-window corner panels use, so native buttons and
115
+ // handcrafted chrome read as one margin. Keep x and y equal — an asymmetric
116
+ // inset reads as visibly off against the square corner panels.
121
117
  trafficLightPosition: { x: 14, y: 14 },
122
118
  show: false,
123
- // Transparent + no native shadow: the OS window is just a passthrough
124
- // for the renderer. The visible "card" is whatever <html> + <body>
125
- // paints, which is what we squeeze with the CSS transform.
119
+ // The OS window is just a passthrough for the renderer: the visible "card"
120
+ // is whatever <html> + <body> paints, and that is what the CSS transform
121
+ // squeezes.
126
122
  transparent: true,
127
123
  hasShadow: false,
128
124
  backgroundColor: "#00000000",