@swmansion/argent 0.35.1-next.66 → 0.35.1-next.68

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.
@@ -3652,17 +3652,17 @@ var require_visit = __commonJS({
3652
3652
  visit2.BREAK = BREAK;
3653
3653
  visit2.SKIP = SKIP;
3654
3654
  visit2.REMOVE = REMOVE;
3655
- function visit_(key, node, visitor, path34) {
3656
- const ctrl = callVisitor(key, node, visitor, path34);
3655
+ function visit_(key, node, visitor, path35) {
3656
+ const ctrl = callVisitor(key, node, visitor, path35);
3657
3657
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
3658
- replaceNode(key, path34, ctrl);
3659
- return visit_(key, ctrl, visitor, path34);
3658
+ replaceNode(key, path35, ctrl);
3659
+ return visit_(key, ctrl, visitor, path35);
3660
3660
  }
3661
3661
  if (typeof ctrl !== "symbol") {
3662
3662
  if (identity2.isCollection(node)) {
3663
- path34 = Object.freeze(path34.concat(node));
3663
+ path35 = Object.freeze(path35.concat(node));
3664
3664
  for (let i2 = 0; i2 < node.items.length; ++i2) {
3665
- const ci = visit_(i2, node.items[i2], visitor, path34);
3665
+ const ci = visit_(i2, node.items[i2], visitor, path35);
3666
3666
  if (typeof ci === "number")
3667
3667
  i2 = ci - 1;
3668
3668
  else if (ci === BREAK)
@@ -3673,13 +3673,13 @@ var require_visit = __commonJS({
3673
3673
  }
3674
3674
  }
3675
3675
  } else if (identity2.isPair(node)) {
3676
- path34 = Object.freeze(path34.concat(node));
3677
- const ck = visit_("key", node.key, visitor, path34);
3676
+ path35 = Object.freeze(path35.concat(node));
3677
+ const ck = visit_("key", node.key, visitor, path35);
3678
3678
  if (ck === BREAK)
3679
3679
  return BREAK;
3680
3680
  else if (ck === REMOVE)
3681
3681
  node.key = null;
3682
- const cv = visit_("value", node.value, visitor, path34);
3682
+ const cv = visit_("value", node.value, visitor, path35);
3683
3683
  if (cv === BREAK)
3684
3684
  return BREAK;
3685
3685
  else if (cv === REMOVE)
@@ -3700,17 +3700,17 @@ var require_visit = __commonJS({
3700
3700
  visitAsync.BREAK = BREAK;
3701
3701
  visitAsync.SKIP = SKIP;
3702
3702
  visitAsync.REMOVE = REMOVE;
3703
- async function visitAsync_(key, node, visitor, path34) {
3704
- const ctrl = await callVisitor(key, node, visitor, path34);
3703
+ async function visitAsync_(key, node, visitor, path35) {
3704
+ const ctrl = await callVisitor(key, node, visitor, path35);
3705
3705
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
3706
- replaceNode(key, path34, ctrl);
3707
- return visitAsync_(key, ctrl, visitor, path34);
3706
+ replaceNode(key, path35, ctrl);
3707
+ return visitAsync_(key, ctrl, visitor, path35);
3708
3708
  }
3709
3709
  if (typeof ctrl !== "symbol") {
3710
3710
  if (identity2.isCollection(node)) {
3711
- path34 = Object.freeze(path34.concat(node));
3711
+ path35 = Object.freeze(path35.concat(node));
3712
3712
  for (let i2 = 0; i2 < node.items.length; ++i2) {
3713
- const ci = await visitAsync_(i2, node.items[i2], visitor, path34);
3713
+ const ci = await visitAsync_(i2, node.items[i2], visitor, path35);
3714
3714
  if (typeof ci === "number")
3715
3715
  i2 = ci - 1;
3716
3716
  else if (ci === BREAK)
@@ -3721,13 +3721,13 @@ var require_visit = __commonJS({
3721
3721
  }
3722
3722
  }
3723
3723
  } else if (identity2.isPair(node)) {
3724
- path34 = Object.freeze(path34.concat(node));
3725
- const ck = await visitAsync_("key", node.key, visitor, path34);
3724
+ path35 = Object.freeze(path35.concat(node));
3725
+ const ck = await visitAsync_("key", node.key, visitor, path35);
3726
3726
  if (ck === BREAK)
3727
3727
  return BREAK;
3728
3728
  else if (ck === REMOVE)
3729
3729
  node.key = null;
3730
- const cv = await visitAsync_("value", node.value, visitor, path34);
3730
+ const cv = await visitAsync_("value", node.value, visitor, path35);
3731
3731
  if (cv === BREAK)
3732
3732
  return BREAK;
3733
3733
  else if (cv === REMOVE)
@@ -3754,23 +3754,23 @@ var require_visit = __commonJS({
3754
3754
  }
3755
3755
  return visitor;
3756
3756
  }
3757
- function callVisitor(key, node, visitor, path34) {
3757
+ function callVisitor(key, node, visitor, path35) {
3758
3758
  if (typeof visitor === "function")
3759
- return visitor(key, node, path34);
3759
+ return visitor(key, node, path35);
3760
3760
  if (identity2.isMap(node))
3761
- return visitor.Map?.(key, node, path34);
3761
+ return visitor.Map?.(key, node, path35);
3762
3762
  if (identity2.isSeq(node))
3763
- return visitor.Seq?.(key, node, path34);
3763
+ return visitor.Seq?.(key, node, path35);
3764
3764
  if (identity2.isPair(node))
3765
- return visitor.Pair?.(key, node, path34);
3765
+ return visitor.Pair?.(key, node, path35);
3766
3766
  if (identity2.isScalar(node))
3767
- return visitor.Scalar?.(key, node, path34);
3767
+ return visitor.Scalar?.(key, node, path35);
3768
3768
  if (identity2.isAlias(node))
3769
- return visitor.Alias?.(key, node, path34);
3769
+ return visitor.Alias?.(key, node, path35);
3770
3770
  return void 0;
3771
3771
  }
3772
- function replaceNode(key, path34, node) {
3773
- const parent = path34[path34.length - 1];
3772
+ function replaceNode(key, path35, node) {
3773
+ const parent = path35[path35.length - 1];
3774
3774
  if (identity2.isCollection(parent)) {
3775
3775
  parent.items[key] = node;
3776
3776
  } else if (identity2.isPair(parent)) {
@@ -4382,10 +4382,10 @@ var require_Collection = __commonJS({
4382
4382
  var createNode = require_createNode();
4383
4383
  var identity2 = require_identity();
4384
4384
  var Node = require_Node();
4385
- function collectionFromPath(schema, path34, value) {
4385
+ function collectionFromPath(schema, path35, value) {
4386
4386
  let v = value;
4387
- for (let i2 = path34.length - 1; i2 >= 0; --i2) {
4388
- const k = path34[i2];
4387
+ for (let i2 = path35.length - 1; i2 >= 0; --i2) {
4388
+ const k = path35[i2];
4389
4389
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
4390
4390
  const a2 = [];
4391
4391
  a2[k] = v;
@@ -4404,7 +4404,7 @@ var require_Collection = __commonJS({
4404
4404
  sourceObjects: /* @__PURE__ */ new Map()
4405
4405
  });
4406
4406
  }
4407
- var isEmptyPath = (path34) => path34 == null || typeof path34 === "object" && !!path34[Symbol.iterator]().next().done;
4407
+ var isEmptyPath = (path35) => path35 == null || typeof path35 === "object" && !!path35[Symbol.iterator]().next().done;
4408
4408
  var Collection = class extends Node.NodeBase {
4409
4409
  constructor(type, schema) {
4410
4410
  super(type);
@@ -4434,11 +4434,11 @@ var require_Collection = __commonJS({
4434
4434
  * be a Pair instance or a `{ key, value }` object, which may not have a key
4435
4435
  * that already exists in the map.
4436
4436
  */
4437
- addIn(path34, value) {
4438
- if (isEmptyPath(path34))
4437
+ addIn(path35, value) {
4438
+ if (isEmptyPath(path35))
4439
4439
  this.add(value);
4440
4440
  else {
4441
- const [key, ...rest] = path34;
4441
+ const [key, ...rest] = path35;
4442
4442
  const node = this.get(key, true);
4443
4443
  if (identity2.isCollection(node))
4444
4444
  node.addIn(rest, value);
@@ -4452,8 +4452,8 @@ var require_Collection = __commonJS({
4452
4452
  * Removes a value from the collection.
4453
4453
  * @returns `true` if the item was found and removed.
4454
4454
  */
4455
- deleteIn(path34) {
4456
- const [key, ...rest] = path34;
4455
+ deleteIn(path35) {
4456
+ const [key, ...rest] = path35;
4457
4457
  if (rest.length === 0)
4458
4458
  return this.delete(key);
4459
4459
  const node = this.get(key, true);
@@ -4467,8 +4467,8 @@ var require_Collection = __commonJS({
4467
4467
  * scalar values from their surrounding node; to disable set `keepScalar` to
4468
4468
  * `true` (collections are always returned intact).
4469
4469
  */
4470
- getIn(path34, keepScalar) {
4471
- const [key, ...rest] = path34;
4470
+ getIn(path35, keepScalar) {
4471
+ const [key, ...rest] = path35;
4472
4472
  const node = this.get(key, true);
4473
4473
  if (rest.length === 0)
4474
4474
  return !keepScalar && identity2.isScalar(node) ? node.value : node;
@@ -4486,8 +4486,8 @@ var require_Collection = __commonJS({
4486
4486
  /**
4487
4487
  * Checks if the collection includes a value with the key `key`.
4488
4488
  */
4489
- hasIn(path34) {
4490
- const [key, ...rest] = path34;
4489
+ hasIn(path35) {
4490
+ const [key, ...rest] = path35;
4491
4491
  if (rest.length === 0)
4492
4492
  return this.has(key);
4493
4493
  const node = this.get(key, true);
@@ -4497,8 +4497,8 @@ var require_Collection = __commonJS({
4497
4497
  * Sets a value in this collection. For `!!set`, `value` needs to be a
4498
4498
  * boolean to add/remove the item from the set.
4499
4499
  */
4500
- setIn(path34, value) {
4501
- const [key, ...rest] = path34;
4500
+ setIn(path35, value) {
4501
+ const [key, ...rest] = path35;
4502
4502
  if (rest.length === 0) {
4503
4503
  this.set(key, value);
4504
4504
  } else {
@@ -7013,9 +7013,9 @@ var require_Document = __commonJS({
7013
7013
  this.contents.add(value);
7014
7014
  }
7015
7015
  /** Adds a value to the document. */
7016
- addIn(path34, value) {
7016
+ addIn(path35, value) {
7017
7017
  if (assertCollection(this.contents))
7018
- this.contents.addIn(path34, value);
7018
+ this.contents.addIn(path35, value);
7019
7019
  }
7020
7020
  /**
7021
7021
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -7090,14 +7090,14 @@ var require_Document = __commonJS({
7090
7090
  * Removes a value from the document.
7091
7091
  * @returns `true` if the item was found and removed.
7092
7092
  */
7093
- deleteIn(path34) {
7094
- if (Collection.isEmptyPath(path34)) {
7093
+ deleteIn(path35) {
7094
+ if (Collection.isEmptyPath(path35)) {
7095
7095
  if (this.contents == null)
7096
7096
  return false;
7097
7097
  this.contents = null;
7098
7098
  return true;
7099
7099
  }
7100
- return assertCollection(this.contents) ? this.contents.deleteIn(path34) : false;
7100
+ return assertCollection(this.contents) ? this.contents.deleteIn(path35) : false;
7101
7101
  }
7102
7102
  /**
7103
7103
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -7112,10 +7112,10 @@ var require_Document = __commonJS({
7112
7112
  * scalar values from their surrounding node; to disable set `keepScalar` to
7113
7113
  * `true` (collections are always returned intact).
7114
7114
  */
7115
- getIn(path34, keepScalar) {
7116
- if (Collection.isEmptyPath(path34))
7115
+ getIn(path35, keepScalar) {
7116
+ if (Collection.isEmptyPath(path35))
7117
7117
  return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
7118
- return identity2.isCollection(this.contents) ? this.contents.getIn(path34, keepScalar) : void 0;
7118
+ return identity2.isCollection(this.contents) ? this.contents.getIn(path35, keepScalar) : void 0;
7119
7119
  }
7120
7120
  /**
7121
7121
  * Checks if the document includes a value with the key `key`.
@@ -7126,10 +7126,10 @@ var require_Document = __commonJS({
7126
7126
  /**
7127
7127
  * Checks if the document includes a value at `path`.
7128
7128
  */
7129
- hasIn(path34) {
7130
- if (Collection.isEmptyPath(path34))
7129
+ hasIn(path35) {
7130
+ if (Collection.isEmptyPath(path35))
7131
7131
  return this.contents !== void 0;
7132
- return identity2.isCollection(this.contents) ? this.contents.hasIn(path34) : false;
7132
+ return identity2.isCollection(this.contents) ? this.contents.hasIn(path35) : false;
7133
7133
  }
7134
7134
  /**
7135
7135
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -7146,13 +7146,13 @@ var require_Document = __commonJS({
7146
7146
  * Sets a value in this document. For `!!set`, `value` needs to be a
7147
7147
  * boolean to add/remove the item from the set.
7148
7148
  */
7149
- setIn(path34, value) {
7150
- if (Collection.isEmptyPath(path34)) {
7149
+ setIn(path35, value) {
7150
+ if (Collection.isEmptyPath(path35)) {
7151
7151
  this.contents = value;
7152
7152
  } else if (this.contents == null) {
7153
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path34), value);
7153
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path35), value);
7154
7154
  } else if (assertCollection(this.contents)) {
7155
- this.contents.setIn(path34, value);
7155
+ this.contents.setIn(path35, value);
7156
7156
  }
7157
7157
  }
7158
7158
  /**
@@ -9113,9 +9113,9 @@ var require_cst_visit = __commonJS({
9113
9113
  visit2.BREAK = BREAK;
9114
9114
  visit2.SKIP = SKIP;
9115
9115
  visit2.REMOVE = REMOVE;
9116
- visit2.itemAtPath = (cst, path34) => {
9116
+ visit2.itemAtPath = (cst, path35) => {
9117
9117
  let item = cst;
9118
- for (const [field, index] of path34) {
9118
+ for (const [field, index] of path35) {
9119
9119
  const tok = item?.[field];
9120
9120
  if (tok && "items" in tok) {
9121
9121
  item = tok.items[index];
@@ -9124,23 +9124,23 @@ var require_cst_visit = __commonJS({
9124
9124
  }
9125
9125
  return item;
9126
9126
  };
9127
- visit2.parentCollection = (cst, path34) => {
9128
- const parent = visit2.itemAtPath(cst, path34.slice(0, -1));
9129
- const field = path34[path34.length - 1][0];
9127
+ visit2.parentCollection = (cst, path35) => {
9128
+ const parent = visit2.itemAtPath(cst, path35.slice(0, -1));
9129
+ const field = path35[path35.length - 1][0];
9130
9130
  const coll = parent?.[field];
9131
9131
  if (coll && "items" in coll)
9132
9132
  return coll;
9133
9133
  throw new Error("Parent collection not found");
9134
9134
  };
9135
- function _visit(path34, item, visitor) {
9136
- let ctrl = visitor(item, path34);
9135
+ function _visit(path35, item, visitor) {
9136
+ let ctrl = visitor(item, path35);
9137
9137
  if (typeof ctrl === "symbol")
9138
9138
  return ctrl;
9139
9139
  for (const field of ["key", "value"]) {
9140
9140
  const token = item[field];
9141
9141
  if (token && "items" in token) {
9142
9142
  for (let i2 = 0; i2 < token.items.length; ++i2) {
9143
- const ci = _visit(Object.freeze(path34.concat([[field, i2]])), token.items[i2], visitor);
9143
+ const ci = _visit(Object.freeze(path35.concat([[field, i2]])), token.items[i2], visitor);
9144
9144
  if (typeof ci === "number")
9145
9145
  i2 = ci - 1;
9146
9146
  else if (ci === BREAK)
@@ -9151,10 +9151,10 @@ var require_cst_visit = __commonJS({
9151
9151
  }
9152
9152
  }
9153
9153
  if (typeof ctrl === "function" && field === "key")
9154
- ctrl = ctrl(item, path34);
9154
+ ctrl = ctrl(item, path35);
9155
9155
  }
9156
9156
  }
9157
- return typeof ctrl === "function" ? ctrl(item, path34) : ctrl;
9157
+ return typeof ctrl === "function" ? ctrl(item, path35) : ctrl;
9158
9158
  }
9159
9159
  exports.visit = visit2;
9160
9160
  }
@@ -10456,14 +10456,14 @@ var require_parser = __commonJS({
10456
10456
  case "scalar":
10457
10457
  case "single-quoted-scalar":
10458
10458
  case "double-quoted-scalar": {
10459
- const fs27 = this.flowScalar(this.type);
10459
+ const fs28 = this.flowScalar(this.type);
10460
10460
  if (atNextItem || it.value) {
10461
- map.items.push({ start, key: fs27, sep: [] });
10461
+ map.items.push({ start, key: fs28, sep: [] });
10462
10462
  this.onKeyLine = true;
10463
10463
  } else if (it.sep) {
10464
- this.stack.push(fs27);
10464
+ this.stack.push(fs28);
10465
10465
  } else {
10466
- Object.assign(it, { key: fs27, sep: [] });
10466
+ Object.assign(it, { key: fs28, sep: [] });
10467
10467
  this.onKeyLine = true;
10468
10468
  }
10469
10469
  return;
@@ -10591,13 +10591,13 @@ var require_parser = __commonJS({
10591
10591
  case "scalar":
10592
10592
  case "single-quoted-scalar":
10593
10593
  case "double-quoted-scalar": {
10594
- const fs27 = this.flowScalar(this.type);
10594
+ const fs28 = this.flowScalar(this.type);
10595
10595
  if (!it || it.value)
10596
- fc.items.push({ start: [], key: fs27, sep: [] });
10596
+ fc.items.push({ start: [], key: fs28, sep: [] });
10597
10597
  else if (it.sep)
10598
- this.stack.push(fs27);
10598
+ this.stack.push(fs28);
10599
10599
  else
10600
- Object.assign(it, { key: fs27, sep: [] });
10600
+ Object.assign(it, { key: fs28, sep: [] });
10601
10601
  return;
10602
10602
  }
10603
10603
  case "flow-map-end":
@@ -15012,7 +15012,7 @@ function appendRootPathToUrlIfNeeded(url) {
15012
15012
  return void 0;
15013
15013
  }
15014
15014
  }
15015
- function appendResourcePathToUrl(url, path34) {
15015
+ function appendResourcePathToUrl(url, path35) {
15016
15016
  try {
15017
15017
  new URL(url);
15018
15018
  } catch {
@@ -15022,11 +15022,11 @@ function appendResourcePathToUrl(url, path34) {
15022
15022
  if (!url.endsWith("/")) {
15023
15023
  url = url + "/";
15024
15024
  }
15025
- url += path34;
15025
+ url += path35;
15026
15026
  try {
15027
15027
  new URL(url);
15028
15028
  } catch {
15029
- diag2.warn(`Configuration: Provided URL appended with '${path34}' is not a valid URL, using 'undefined' instead of '${url}'`);
15029
+ diag2.warn(`Configuration: Provided URL appended with '${path35}' is not a valid URL, using 'undefined' instead of '${url}'`);
15030
15030
  return void 0;
15031
15031
  }
15032
15032
  return url;
@@ -15137,10 +15137,10 @@ var OTLPLogExporter = class extends OTLPExporterBase {
15137
15137
  init_esm();
15138
15138
 
15139
15139
  // ../telemetry/src/debug.ts
15140
- import * as fs7 from "node:fs";
15140
+ import * as fs8 from "node:fs";
15141
15141
 
15142
15142
  // ../telemetry/src/paths.ts
15143
- import * as path8 from "node:path";
15143
+ import * as path9 from "node:path";
15144
15144
 
15145
15145
  // ../configuration-core/src/flags.ts
15146
15146
  import * as fs2 from "node:fs";
@@ -15584,12 +15584,18 @@ function isAutoUpdateEnabled() {
15584
15584
  return getConfigValueByKey(AUTO_UPDATE_ENABLED_KEY) === true;
15585
15585
  }
15586
15586
 
15587
+ // ../configuration-core/src/cloud-android.ts
15588
+ import * as fs7 from "node:fs";
15589
+ import * as os2 from "node:os";
15590
+ import * as path8 from "node:path";
15591
+ var CLOUD_ANDROID_MARKER_TTL_MS = 2 * 6e4;
15592
+
15587
15593
  // ../telemetry/src/paths.ts
15588
15594
  function identityFilePath() {
15589
- return path8.join(argentHomeDir(), "telemetry-id");
15595
+ return path9.join(argentHomeDir(), "telemetry-id");
15590
15596
  }
15591
15597
  function debugLogPath() {
15592
- return path8.join(argentHomeDir(), "telemetry-debug.log");
15598
+ return path9.join(argentHomeDir(), "telemetry-debug.log");
15593
15599
  }
15594
15600
 
15595
15601
  // ../telemetry/src/debug.ts
@@ -15619,8 +15625,8 @@ function emitDebugPayload(payload) {
15619
15625
  } catch {
15620
15626
  }
15621
15627
  try {
15622
- fs7.mkdirSync(argentHomeDir(), { recursive: true });
15623
- fs7.appendFileSync(debugLogPath(), line + "\n");
15628
+ fs8.mkdirSync(argentHomeDir(), { recursive: true });
15629
+ fs8.appendFileSync(debugLogPath(), line + "\n");
15624
15630
  } catch {
15625
15631
  }
15626
15632
  }
@@ -15808,16 +15814,16 @@ var LAUNCH_PLATFORMS = ["ios", "android", "chromium", "vega", "macos"];
15808
15814
  var SELECTABLE_PLATFORMS = [...LAUNCH_PLATFORMS, "ios-remote"];
15809
15815
 
15810
15816
  // ../registry/src/flow-file-refs.ts
15811
- import * as fs9 from "node:fs/promises";
15812
- import * as path10 from "node:path";
15817
+ import * as fs10 from "node:fs/promises";
15818
+ import * as path11 from "node:path";
15813
15819
 
15814
15820
  // ../registry/src/e2e-dirs.ts
15815
- import * as fs8 from "node:fs/promises";
15816
- import * as path9 from "node:path";
15817
- var E2E_DIR = path9.join(".argent", "e2e");
15818
- var LEGACY_E2E_DIRS = Object.freeze([path9.join(".argent", "flows")]);
15821
+ import * as fs9 from "node:fs/promises";
15822
+ import * as path10 from "node:path";
15823
+ var E2E_DIR = path10.join(".argent", "e2e");
15824
+ var LEGACY_E2E_DIRS = Object.freeze([path10.join(".argent", "flows")]);
15819
15825
  var E2E_DIRS = Object.freeze([E2E_DIR, ...LEGACY_E2E_DIRS]);
15820
- var E2E_DIR_NAMES = E2E_DIRS.map((dir) => path9.basename(dir));
15826
+ var E2E_DIR_NAMES = E2E_DIRS.map((dir) => path10.basename(dir));
15821
15827
 
15822
15828
  // ../registry/src/tool-ids.ts
15823
15829
  var TOOL_ID_ALIASES = Object.freeze({
@@ -16268,6 +16274,17 @@ var FAILURE_CODES = {
16268
16274
  BOOT_HARMONY_STOP_TIMEOUT: "BOOT_HARMONY_STOP_TIMEOUT",
16269
16275
  BOOT_HARMONY_MANAGER_EXITED: "BOOT_HARMONY_MANAGER_EXITED",
16270
16276
  BOOT_HARMONY_START_FAILED: "BOOT_HARMONY_START_FAILED",
16277
+ /**
16278
+ * Argent Cloud Android emulators
16279
+ * @see [leases.ts](../../tool-server/src/utils/cloud-android/leases.ts)
16280
+ */
16281
+ CLOUD_ANDROID_ACCESS_DENIED: "CLOUD_ANDROID_ACCESS_DENIED",
16282
+ CLOUD_ANDROID_ACQUIRE_FAILED: "CLOUD_ANDROID_ACQUIRE_FAILED",
16283
+ CLOUD_ANDROID_ADB_KEY_MISSING: "CLOUD_ANDROID_ADB_KEY_MISSING",
16284
+ CLOUD_ANDROID_ADB_SERVER_REMOTE: "CLOUD_ANDROID_ADB_SERVER_REMOTE",
16285
+ CLOUD_ANDROID_CONNECT_FAILED: "CLOUD_ANDROID_CONNECT_FAILED",
16286
+ CLOUD_ANDROID_LEASE_IN_USE: "CLOUD_ANDROID_LEASE_IN_USE",
16287
+ CLOUD_ANDROID_NO_EMULATOR: "CLOUD_ANDROID_NO_EMULATOR",
16271
16288
  /**
16272
16289
  * External device providers
16273
16290
  * @see [external-devices.ts](../../tool-server/src/utils/external-devices.ts)
@@ -16697,9 +16714,9 @@ function isReplitAgent(env) {
16697
16714
  }
16698
16715
  var DEVIN_MARKER_PATH = "/opt/.devin";
16699
16716
  var JULES_MARKER_PATH = "/opt/environment_summary.sh";
16700
- function safeExists(fileExists, path34) {
16717
+ function safeExists(fileExists, path35) {
16701
16718
  try {
16702
- return fileExists(path34);
16719
+ return fileExists(path35);
16703
16720
  } catch {
16704
16721
  return false;
16705
16722
  }
@@ -17119,7 +17136,7 @@ function isCi(env = process.env) {
17119
17136
  var SESSION_ID = randomUUID4();
17120
17137
  function readCliVersion() {
17121
17138
  if (true) {
17122
- return "0.35.1-next.65";
17139
+ return "0.35.1-next.68";
17123
17140
  }
17124
17141
  return "0.0.0";
17125
17142
  }
@@ -17152,8 +17169,8 @@ function getBaseProps(runtime) {
17152
17169
 
17153
17170
  // ../telemetry/src/identity.ts
17154
17171
  import * as crypto2 from "node:crypto";
17155
- import * as fs10 from "node:fs";
17156
- import * as path11 from "node:path";
17172
+ import * as fs11 from "node:fs";
17173
+ import * as path12 from "node:path";
17157
17174
  var FINGERPRINT_PATTERN = /^[0-9a-f]{64}$/;
17158
17175
  var cached = null;
17159
17176
  var fingerprintResolved = null;
@@ -17260,66 +17277,66 @@ function resolveFingerprintOnce(resolveFingerprint) {
17260
17277
  function isCorruptIdFile(filePath) {
17261
17278
  let isRegularFile;
17262
17279
  try {
17263
- isRegularFile = fs10.lstatSync(filePath).isFile();
17280
+ isRegularFile = fs11.lstatSync(filePath).isFile();
17264
17281
  } catch {
17265
17282
  return false;
17266
17283
  }
17267
17284
  return isRegularFile && tryReadId(filePath) === null;
17268
17285
  }
17269
17286
  function writeIdFileAtomic(finalPath, id) {
17270
- fs10.mkdirSync(argentHomeDir(), { recursive: true });
17287
+ fs11.mkdirSync(argentHomeDir(), { recursive: true });
17271
17288
  let occupant;
17272
17289
  try {
17273
- occupant = fs10.lstatSync(finalPath);
17290
+ occupant = fs11.lstatSync(finalPath);
17274
17291
  } catch (err) {
17275
17292
  if (err.code !== "ENOENT") throw err;
17276
17293
  }
17277
17294
  if (occupant && !occupant.isFile()) {
17278
17295
  throw new Error("telemetry: refusing to replace a non-regular file at the identity path");
17279
17296
  }
17280
- const tmpPath = path11.join(
17297
+ const tmpPath = path12.join(
17281
17298
  argentHomeDir(),
17282
17299
  `.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
17283
17300
  );
17284
- const fd = fs10.openSync(tmpPath, "wx", 384);
17301
+ const fd = fs11.openSync(tmpPath, "wx", 384);
17285
17302
  try {
17286
17303
  try {
17287
- fs10.writeSync(fd, id);
17288
- fs10.fsyncSync(fd);
17304
+ fs11.writeSync(fd, id);
17305
+ fs11.fsyncSync(fd);
17289
17306
  } finally {
17290
- fs10.closeSync(fd);
17307
+ fs11.closeSync(fd);
17291
17308
  }
17292
- fs10.renameSync(tmpPath, finalPath);
17309
+ fs11.renameSync(tmpPath, finalPath);
17293
17310
  } finally {
17294
17311
  try {
17295
- fs10.unlinkSync(tmpPath);
17312
+ fs11.unlinkSync(tmpPath);
17296
17313
  } catch {
17297
17314
  }
17298
17315
  }
17299
17316
  }
17300
17317
  function mintRandomId(finalPath) {
17301
- fs10.mkdirSync(argentHomeDir(), { recursive: true });
17318
+ fs11.mkdirSync(argentHomeDir(), { recursive: true });
17302
17319
  let value = crypto2.randomUUID();
17303
17320
  for (let attempt = 0; attempt < 3; attempt++) {
17304
- const tmpPath = path11.join(
17321
+ const tmpPath = path12.join(
17305
17322
  argentHomeDir(),
17306
17323
  `.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
17307
17324
  );
17308
17325
  let fd;
17309
17326
  try {
17310
- fd = fs10.openSync(tmpPath, "wx", 384);
17327
+ fd = fs11.openSync(tmpPath, "wx", 384);
17311
17328
  } catch (err) {
17312
17329
  if (err.code === "EEXIST") continue;
17313
17330
  throw err;
17314
17331
  }
17315
17332
  try {
17316
17333
  try {
17317
- fs10.writeSync(fd, value);
17318
- fs10.fsyncSync(fd);
17334
+ fs11.writeSync(fd, value);
17335
+ fs11.fsyncSync(fd);
17319
17336
  } finally {
17320
- fs10.closeSync(fd);
17337
+ fs11.closeSync(fd);
17321
17338
  }
17322
- fs10.linkSync(tmpPath, finalPath);
17339
+ fs11.linkSync(tmpPath, finalPath);
17323
17340
  cached = { path: finalPath, id: value };
17324
17341
  return value;
17325
17342
  } catch (err) {
@@ -17338,7 +17355,7 @@ function mintRandomId(finalPath) {
17338
17355
  throw err;
17339
17356
  } finally {
17340
17357
  try {
17341
- fs10.unlinkSync(tmpPath);
17358
+ fs11.unlinkSync(tmpPath);
17342
17359
  } catch {
17343
17360
  }
17344
17361
  }
@@ -17346,12 +17363,12 @@ function mintRandomId(finalPath) {
17346
17363
  throw new Error("telemetry: failed to create identity after retries");
17347
17364
  }
17348
17365
  function claimCorruptOccupant(finalPath) {
17349
- const claimed = path11.join(
17366
+ const claimed = path12.join(
17350
17367
  argentHomeDir(),
17351
17368
  `.telemetry-id.corrupt.${process.pid}.${crypto2.randomUUID()}`
17352
17369
  );
17353
17370
  try {
17354
- fs10.renameSync(finalPath, claimed);
17371
+ fs11.renameSync(finalPath, claimed);
17355
17372
  } catch {
17356
17373
  return null;
17357
17374
  }
@@ -17360,7 +17377,7 @@ function claimCorruptOccupant(finalPath) {
17360
17377
  grabbed = tryReadId(claimed);
17361
17378
  } finally {
17362
17379
  try {
17363
- fs10.unlinkSync(claimed);
17380
+ fs11.unlinkSync(claimed);
17364
17381
  } catch {
17365
17382
  }
17366
17383
  }
@@ -17369,7 +17386,7 @@ function claimCorruptOccupant(finalPath) {
17369
17386
  function deleteAnonId() {
17370
17387
  cached = null;
17371
17388
  try {
17372
- fs10.unlinkSync(identityFilePath());
17389
+ fs11.unlinkSync(identityFilePath());
17373
17390
  } catch (err) {
17374
17391
  if (err.code !== "ENOENT") throw err;
17375
17392
  }
@@ -17377,9 +17394,9 @@ function deleteAnonId() {
17377
17394
  function tryReadId(filePath) {
17378
17395
  let raw;
17379
17396
  try {
17380
- const stats = fs10.lstatSync(filePath);
17397
+ const stats = fs11.lstatSync(filePath);
17381
17398
  if (!stats.isFile()) return null;
17382
- raw = fs10.readFileSync(filePath, "utf8");
17399
+ raw = fs11.readFileSync(filePath, "utf8");
17383
17400
  } catch (err) {
17384
17401
  if (err.code === "ENOENT") return null;
17385
17402
  return null;
@@ -17393,12 +17410,12 @@ function tryReadId(filePath) {
17393
17410
  import { execFileSync, spawn } from "node:child_process";
17394
17411
 
17395
17412
  // ../native-devtools-ios/src/index.ts
17396
- import * as path12 from "node:path";
17397
- import * as fs11 from "node:fs";
17398
- var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path12.join(__dirname, "..", "dylibs");
17399
- var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path12.join(__dirname, "..", "bin");
17400
- var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path12.join(DYLIB_DIR, "tcp");
17401
- var DYLIB_TVOS_DIR = path12.join(DYLIB_DIR, "tvos");
17413
+ import * as path13 from "node:path";
17414
+ import * as fs12 from "node:fs";
17415
+ var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path13.join(__dirname, "..", "dylibs");
17416
+ var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path13.join(__dirname, "..", "bin");
17417
+ var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path13.join(DYLIB_DIR, "tcp");
17418
+ var DYLIB_TVOS_DIR = path13.join(DYLIB_DIR, "tvos");
17402
17419
  function hostPlatformKey() {
17403
17420
  if (process.platform === "linux" && process.arch === "arm64") {
17404
17421
  return "linux-arm64";
@@ -17409,14 +17426,14 @@ function simulatorServerBinaryName() {
17409
17426
  return process.platform === "win32" ? "simulator-server.exe" : "simulator-server";
17410
17427
  }
17411
17428
  function platformBinDir() {
17412
- return path12.join(BIN_DIR, hostPlatformKey());
17429
+ return path13.join(BIN_DIR, hostPlatformKey());
17413
17430
  }
17414
17431
  function simulatorServerBinaryPath() {
17415
17432
  const binaryName = simulatorServerBinaryName();
17416
- const p = path12.join(platformBinDir(), binaryName);
17417
- if (!fs11.existsSync(p)) {
17418
- const flat = path12.join(BIN_DIR, binaryName);
17419
- const migrationHint = fs11.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.` : "";
17433
+ const p = path13.join(platformBinDir(), binaryName);
17434
+ if (!fs12.existsSync(p)) {
17435
+ const flat = path13.join(BIN_DIR, binaryName);
17436
+ const migrationHint = fs12.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.` : "";
17420
17437
  throw new Error(
17421
17438
  `simulator-server binary not found for platform "${hostPlatformKey()}" at ${p}. Supported hosts today: darwin, linux (x86_64 and arm64), win32.${migrationHint}`
17422
17439
  );
@@ -17496,15 +17513,15 @@ function resolveHostFingerprintAsync() {
17496
17513
  }
17497
17514
 
17498
17515
  // ../telemetry/src/consent.ts
17499
- import * as fs12 from "node:fs";
17500
- import * as path13 from "node:path";
17516
+ import * as fs13 from "node:fs";
17517
+ import * as path14 from "node:path";
17501
17518
  var cache = /* @__PURE__ */ new Map();
17502
17519
  var sessionOverride = null;
17503
17520
  function readConfigOverrideAt(filePath) {
17504
17521
  const miss = { mtimeMs: null, fingerprint: null, enabledOverride: null };
17505
17522
  let stats;
17506
17523
  try {
17507
- stats = fs12.lstatSync(filePath);
17524
+ stats = fs13.lstatSync(filePath);
17508
17525
  } catch {
17509
17526
  cache.set(filePath, miss);
17510
17527
  return null;
@@ -17521,7 +17538,7 @@ function readConfigOverrideAt(filePath) {
17521
17538
  }
17522
17539
  let parsedEnabled = null;
17523
17540
  try {
17524
- const raw = fs12.readFileSync(filePath, "utf8");
17541
+ const raw = fs13.readFileSync(filePath, "utf8");
17525
17542
  const json = JSON.parse(raw);
17526
17543
  if (json && typeof json === "object") {
17527
17544
  const t2 = json.telemetry;
@@ -17538,12 +17555,12 @@ function readConfigOverrideAt(filePath) {
17538
17555
  function readPersistedConsent(cwd) {
17539
17556
  const globalPath = configFilePath("global");
17540
17557
  const projectPath = configFilePath("project", { cwd });
17541
- const userConfigPath = path13.join(resolveHomeDir(), ".argent", "config.json");
17558
+ const userConfigPath = path14.join(resolveHomeDir(), ".argent", "config.json");
17542
17559
  if (userConfigPath !== globalPath && readConfigOverrideAt(userConfigPath) === false) {
17543
17560
  return { enabled: false, detail: `${userConfigPath} (user)` };
17544
17561
  }
17545
17562
  const global2 = readConfigOverrideAt(globalPath);
17546
- const projectRoot = path13.dirname(path13.dirname(projectPath));
17563
+ const projectRoot = path14.dirname(path14.dirname(projectPath));
17547
17564
  const project = isHomeDir(projectRoot) ? null : readConfigOverrideAt(projectPath);
17548
17565
  if (project === false && global2 === false) {
17549
17566
  return { enabled: false, detail: "config.json (project and global)" };
@@ -17759,10 +17776,10 @@ async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
17759
17776
  }
17760
17777
 
17761
17778
  // ../argent-installer/src/mcp-configs.ts
17762
- import * as fs19 from "node:fs";
17763
- import * as path20 from "node:path";
17779
+ import * as fs20 from "node:fs";
17780
+ import * as path21 from "node:path";
17764
17781
  import { execFileSync as execFileSync5 } from "node:child_process";
17765
- import { homedir as homedir4 } from "node:os";
17782
+ import { homedir as homedir5 } from "node:os";
17766
17783
 
17767
17784
  // ../argent-installer/src/constants.ts
17768
17785
  var PACKAGE_NAME = "@swmansion/argent";
@@ -17775,11 +17792,11 @@ var CURSOR_ALLOWLIST_PATTERN = "argent:*";
17775
17792
 
17776
17793
  // ../argent-installer/src/utils.ts
17777
17794
  var import_semver3 = __toESM(require_semver2(), 1);
17778
- import * as fs18 from "node:fs";
17779
- import * as path19 from "node:path";
17795
+ import * as fs19 from "node:fs";
17796
+ import * as path20 from "node:path";
17780
17797
  import * as dns from "node:dns";
17781
17798
  import { createHash as createHash2 } from "node:crypto";
17782
- import * as os3 from "node:os";
17799
+ import * as os4 from "node:os";
17783
17800
  import { execFileSync as execFileSync4, execSync } from "node:child_process";
17784
17801
 
17785
17802
  // ../../node_modules/smol-toml/dist/error.js
@@ -19522,12 +19539,12 @@ function parseTree(text2, errors = [], options = ParseOptions.DEFAULT) {
19522
19539
  }
19523
19540
  return result;
19524
19541
  }
19525
- function findNodeAtLocation(root, path34) {
19542
+ function findNodeAtLocation(root, path35) {
19526
19543
  if (!root) {
19527
19544
  return void 0;
19528
19545
  }
19529
19546
  let node = root;
19530
- for (let segment of path34) {
19547
+ for (let segment of path35) {
19531
19548
  if (typeof segment === "string") {
19532
19549
  if (node.type !== "object" || !Array.isArray(node.children)) {
19533
19550
  return void 0;
@@ -19881,14 +19898,14 @@ function getNodeType(value) {
19881
19898
 
19882
19899
  // ../../node_modules/jsonc-parser/lib/esm/impl/edit.js
19883
19900
  function setProperty(text2, originalPath, value, options) {
19884
- const path34 = originalPath.slice();
19901
+ const path35 = originalPath.slice();
19885
19902
  const errors = [];
19886
19903
  const root = parseTree(text2, errors);
19887
19904
  let parent = void 0;
19888
19905
  let lastSegment = void 0;
19889
- while (path34.length > 0) {
19890
- lastSegment = path34.pop();
19891
- parent = findNodeAtLocation(root, path34);
19906
+ while (path35.length > 0) {
19907
+ lastSegment = path35.pop();
19908
+ parent = findNodeAtLocation(root, path35);
19892
19909
  if (parent === void 0 && value !== void 0) {
19893
19910
  if (typeof lastSegment === "string") {
19894
19911
  value = { [lastSegment]: value };
@@ -20074,8 +20091,8 @@ var ParseErrorCode;
20074
20091
  ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
20075
20092
  ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
20076
20093
  })(ParseErrorCode || (ParseErrorCode = {}));
20077
- function modify(text2, path34, value, options) {
20078
- return setProperty(text2, path34, value, options);
20094
+ function modify(text2, path35, value, options) {
20095
+ return setProperty(text2, path35, value, options);
20079
20096
  }
20080
20097
  function applyEdits(text2, edits) {
20081
20098
  let sortedEdits = edits.slice(0).sort((a2, b) => {
@@ -20099,39 +20116,39 @@ function applyEdits(text2, edits) {
20099
20116
  }
20100
20117
 
20101
20118
  // ../argent-installer/src/package-root.ts
20102
- import * as fs13 from "node:fs";
20103
- import * as path14 from "node:path";
20104
- function resolvePackageRoot(dirname19) {
20105
- let current = path14.resolve(dirname19);
20119
+ import * as fs14 from "node:fs";
20120
+ import * as path15 from "node:path";
20121
+ function resolvePackageRoot(dirname20) {
20122
+ let current = path15.resolve(dirname20);
20106
20123
  while (true) {
20107
- if (fs13.existsSync(path14.join(current, "package.json"))) return current;
20108
- const parent = path14.dirname(current);
20109
- if (parent === current) return path14.resolve(dirname19);
20124
+ if (fs14.existsSync(path15.join(current, "package.json"))) return current;
20125
+ const parent = path15.dirname(current);
20126
+ if (parent === current) return path15.resolve(dirname20);
20110
20127
  current = parent;
20111
20128
  }
20112
20129
  }
20113
20130
 
20114
20131
  // ../argent-installer/src/package-manager.ts
20115
20132
  import { execFileSync as execFileSync3 } from "node:child_process";
20116
- import * as fs16 from "node:fs";
20117
- import * as os2 from "node:os";
20118
- import * as path17 from "node:path";
20133
+ import * as fs17 from "node:fs";
20134
+ import * as os3 from "node:os";
20135
+ import * as path18 from "node:path";
20119
20136
 
20120
20137
  // ../argent-installer/src/topology.ts
20121
20138
  var import_semver2 = __toESM(require_semver2(), 1);
20122
- import * as fs15 from "node:fs";
20123
- import * as path16 from "node:path";
20139
+ import * as fs16 from "node:fs";
20140
+ import * as path17 from "node:path";
20124
20141
  import { createRequire } from "node:module";
20125
20142
  import { execFileSync as execFileSync2 } from "node:child_process";
20126
20143
 
20127
20144
  // ../argent-installer/src/preflight.ts
20128
- import * as fs14 from "node:fs";
20129
- import * as path15 from "node:path";
20145
+ import * as fs15 from "node:fs";
20146
+ import * as path16 from "node:path";
20130
20147
  function hasProjectPackageJson(projectRoot) {
20131
- return fs14.existsSync(path15.join(projectRoot, "package.json"));
20148
+ return fs15.existsSync(path16.join(projectRoot, "package.json"));
20132
20149
  }
20133
20150
  function isYarnPnp(projectRoot) {
20134
- return fs14.existsSync(path15.join(projectRoot, ".pnp.cjs")) || fs14.existsSync(path15.join(projectRoot, ".pnp.loader.mjs"));
20151
+ return fs15.existsSync(path16.join(projectRoot, ".pnp.cjs")) || fs15.existsSync(path16.join(projectRoot, ".pnp.loader.mjs"));
20135
20152
  }
20136
20153
 
20137
20154
  // ../argent-installer/src/topology.ts
@@ -20157,12 +20174,12 @@ function isTempRunnerPath(binaryPath) {
20157
20174
  }
20158
20175
  function isProjectBinPath(binaryPath) {
20159
20176
  const norm = (p) => process.platform === "win32" ? p.toLowerCase() : canonicalPath(p);
20160
- const binDir = norm(path16.dirname(path16.resolve(binaryPath)));
20177
+ const binDir = norm(path17.dirname(path17.resolve(binaryPath)));
20161
20178
  const prefix = process.env.npm_config_local_prefix;
20162
- if (prefix && norm(path16.join(prefix, "node_modules", ".bin")) === binDir) return true;
20163
- for (let dir = path16.resolve(process.cwd()); ; dir = path16.dirname(dir)) {
20164
- if (norm(path16.join(dir, "node_modules", ".bin")) === binDir) return true;
20165
- if (path16.dirname(dir) === dir) return false;
20179
+ if (prefix && norm(path17.join(prefix, "node_modules", ".bin")) === binDir) return true;
20180
+ for (let dir = path17.resolve(process.cwd()); ; dir = path17.dirname(dir)) {
20181
+ if (norm(path17.join(dir, "node_modules", ".bin")) === binDir) return true;
20182
+ if (path17.dirname(dir) === dir) return false;
20166
20183
  }
20167
20184
  }
20168
20185
  function getPermanentBinaryPaths() {
@@ -20210,8 +20227,8 @@ function getGloballyInstalledPackageRoot() {
20210
20227
  }
20211
20228
  function readShimScript(binaryPath) {
20212
20229
  try {
20213
- if (fs15.statSync(binaryPath).size > 64 * 1024) return null;
20214
- return fs15.readFileSync(binaryPath, "utf8");
20230
+ if (fs16.statSync(binaryPath).size > 64 * 1024) return null;
20231
+ return fs16.readFileSync(binaryPath, "utf8");
20215
20232
  } catch {
20216
20233
  return null;
20217
20234
  }
@@ -20222,7 +20239,7 @@ function shimTargetOf(binaryPath) {
20222
20239
  const trailer = /^# cmd-shim-target=(.+)$/m.exec(shim);
20223
20240
  if (trailer) return trailer[1].trim();
20224
20241
  const relative5 = /"\$basedir(?:_abs)?"?\/'?([^"'\s]*node_modules\/[^"'\s]*)/.exec(shim);
20225
- return relative5 ? path16.resolve(canonicalPath(path16.dirname(binaryPath)), relative5[1]) : null;
20242
+ return relative5 ? path17.resolve(canonicalPath(path17.dirname(binaryPath)), relative5[1]) : null;
20226
20243
  }
20227
20244
  function globalPackageRootOf(binaryPath) {
20228
20245
  const root = packageRootOf(binaryPath);
@@ -20232,9 +20249,9 @@ function globalPackageRootOf(binaryPath) {
20232
20249
  }
20233
20250
  function packageRootOf(binaryPath) {
20234
20251
  try {
20235
- const realPath = fs15.realpathSync(binaryPath);
20236
- const root = resolvePackageRoot(path16.dirname(realPath));
20237
- const pkg = JSON.parse(fs15.readFileSync(path16.join(root, "package.json"), "utf8"));
20252
+ const realPath = fs16.realpathSync(binaryPath);
20253
+ const root = resolvePackageRoot(path17.dirname(realPath));
20254
+ const pkg = JSON.parse(fs16.readFileSync(path17.join(root, "package.json"), "utf8"));
20238
20255
  return pkg.name === PACKAGE_NAME ? root : null;
20239
20256
  } catch {
20240
20257
  return null;
@@ -20243,8 +20260,8 @@ function packageRootOf(binaryPath) {
20243
20260
  function cliPathOf(packageRoot) {
20244
20261
  const binSub = argentBinSubpath(packageRoot);
20245
20262
  if (!binSub) return null;
20246
- const cli = path16.join(packageRoot, binSub);
20247
- return fs15.existsSync(cli) ? cli : null;
20263
+ const cli = path17.join(packageRoot, binSub);
20264
+ return fs16.existsSync(cli) ? cli : null;
20248
20265
  }
20249
20266
  function getGloballyInstalledLaunchPaths() {
20250
20267
  if (process.platform === "win32") return null;
@@ -20254,8 +20271,8 @@ function getGloballyInstalledLaunchPaths() {
20254
20271
  const cli = packageRoot ? cliPathOf(packageRoot) : null;
20255
20272
  if (!cli) return null;
20256
20273
  try {
20257
- const node = path16.join(fs15.realpathSync(path16.dirname(binaryPath)), "node");
20258
- return fs15.existsSync(node) ? { node, cli } : null;
20274
+ const node = path17.join(fs16.realpathSync(path17.dirname(binaryPath)), "node");
20275
+ return fs16.existsSync(node) ? { node, cli } : null;
20259
20276
  } catch {
20260
20277
  return null;
20261
20278
  }
@@ -20264,7 +20281,7 @@ function getGloballyInstalledVersion() {
20264
20281
  const pkgRoot = getGloballyInstalledPackageRoot();
20265
20282
  if (!pkgRoot) return null;
20266
20283
  try {
20267
- const pkg = JSON.parse(fs15.readFileSync(path16.join(pkgRoot, "package.json"), "utf8"));
20284
+ const pkg = JSON.parse(fs16.readFileSync(path17.join(pkgRoot, "package.json"), "utf8"));
20268
20285
  return pkg.version ?? null;
20269
20286
  } catch {
20270
20287
  return null;
@@ -20273,7 +20290,7 @@ function getGloballyInstalledVersion() {
20273
20290
  function readManifestDeclaration(projectRoot) {
20274
20291
  try {
20275
20292
  const pkg = JSON.parse(
20276
- fs15.readFileSync(path16.join(projectRoot, "package.json"), "utf8")
20293
+ fs16.readFileSync(path17.join(projectRoot, "package.json"), "utf8")
20277
20294
  );
20278
20295
  const spec = pkg.devDependencies?.[PACKAGE_NAME] ?? pkg.dependencies?.[PACKAGE_NAME] ?? pkg.optionalDependencies?.[PACKAGE_NAME];
20279
20296
  return typeof spec === "string" ? spec : null;
@@ -20286,11 +20303,11 @@ function isDeclaredLocally(projectRoot) {
20286
20303
  }
20287
20304
  function resolveLocalArgentDir(projectRoot) {
20288
20305
  try {
20289
- const req = createRequire(path16.join(projectRoot, "package.json"));
20290
- return path16.dirname(req.resolve(`${PACKAGE_NAME}/package.json`));
20306
+ const req = createRequire(path17.join(projectRoot, "package.json"));
20307
+ return path17.dirname(req.resolve(`${PACKAGE_NAME}/package.json`));
20291
20308
  } catch {
20292
- const plain = path16.join(projectRoot, "node_modules", PACKAGE_NAME);
20293
- return fs15.existsSync(path16.join(plain, "package.json")) ? plain : null;
20309
+ const plain = path17.join(projectRoot, "node_modules", PACKAGE_NAME);
20310
+ return fs16.existsSync(path17.join(plain, "package.json")) ? plain : null;
20294
20311
  }
20295
20312
  }
20296
20313
  function probeLocalInstall(projectRoot) {
@@ -20298,7 +20315,7 @@ function probeLocalInstall(projectRoot) {
20298
20315
  if (packageDir) {
20299
20316
  let version;
20300
20317
  try {
20301
- const pkg = JSON.parse(fs15.readFileSync(path16.join(packageDir, "package.json"), "utf8"));
20318
+ const pkg = JSON.parse(fs16.readFileSync(path17.join(packageDir, "package.json"), "utf8"));
20302
20319
  version = pkg.version ?? null;
20303
20320
  } catch {
20304
20321
  version = null;
@@ -20321,8 +20338,8 @@ function getLocallyInstalledVersion(projectRoot) {
20321
20338
  }
20322
20339
  function readLocalPackageVersionUncached(projectRoot) {
20323
20340
  try {
20324
- const pkgPath = path16.join(projectRoot, "node_modules", PACKAGE_NAME, "package.json");
20325
- const pkg = JSON.parse(fs15.readFileSync(pkgPath, "utf8"));
20341
+ const pkgPath = path17.join(projectRoot, "node_modules", PACKAGE_NAME, "package.json");
20342
+ const pkg = JSON.parse(fs16.readFileSync(pkgPath, "utf8"));
20326
20343
  return pkg.version ?? null;
20327
20344
  } catch {
20328
20345
  return null;
@@ -20330,7 +20347,7 @@ function readLocalPackageVersionUncached(projectRoot) {
20330
20347
  }
20331
20348
  function argentBinSubpath(pkgDir) {
20332
20349
  try {
20333
- const pkg = JSON.parse(fs15.readFileSync(path16.join(pkgDir, "package.json"), "utf8"));
20350
+ const pkg = JSON.parse(fs16.readFileSync(path17.join(pkgDir, "package.json"), "utf8"));
20334
20351
  if (typeof pkg.bin === "string") return pkg.bin;
20335
20352
  if (pkg.bin && typeof pkg.bin === "object") {
20336
20353
  return pkg.bin[MCP_BINARY_NAME] ?? Object.values(pkg.bin)[0] ?? null;
@@ -20347,16 +20364,16 @@ function getLocalArgentBinRelPath(projectRoot) {
20347
20364
  if (!binSub) return null;
20348
20365
  let root = projectRoot;
20349
20366
  try {
20350
- root = fs15.realpathSync(projectRoot);
20367
+ root = fs16.realpathSync(projectRoot);
20351
20368
  } catch {
20352
20369
  }
20353
- const stableRel = path16.join("node_modules", PACKAGE_NAME, binSub);
20354
- if (fs15.existsSync(path16.join(root, stableRel))) {
20355
- return stableRel.split(path16.sep).join("/");
20370
+ const stableRel = path17.join("node_modules", PACKAGE_NAME, binSub);
20371
+ if (fs16.existsSync(path17.join(root, stableRel))) {
20372
+ return stableRel.split(path17.sep).join("/");
20356
20373
  }
20357
- const abs = path16.join(pkgDir, binSub);
20358
- if (!fs15.existsSync(abs)) return null;
20359
- return path16.relative(root, abs).split(path16.sep).join("/");
20374
+ const abs = path17.join(pkgDir, binSub);
20375
+ if (!fs16.existsSync(abs)) return null;
20376
+ return path17.relative(root, abs).split(path17.sep).join("/");
20360
20377
  }
20361
20378
 
20362
20379
  // ../argent-installer/src/package-manager.ts
@@ -20389,10 +20406,10 @@ function detectGlobalPackageManager() {
20389
20406
  return BUN_GLOBAL_ROOT.test(root) ? "bun" : lockfileOwnerOf(root) ?? "yarn";
20390
20407
  }
20391
20408
  if (process.platform === "win32") {
20392
- if (fs16.existsSync(path17.join(npmCopyBeside(path17.dirname(binaryPath)), "package.json"))) {
20409
+ if (fs17.existsSync(path18.join(npmCopyBeside(path18.dirname(binaryPath)), "package.json"))) {
20393
20410
  return "npm";
20394
20411
  }
20395
- if (fs16.existsSync(binaryPath.replace(/\.exe$/i, "") + ".bunx")) return "bun";
20412
+ if (fs17.existsSync(binaryPath.replace(/\.exe$/i, "") + ".bunx")) return "bun";
20396
20413
  }
20397
20414
  const shim = readShimScript(binaryPath);
20398
20415
  if (shim === null || !/node_modules[\\/]/.test(shim)) return "npm";
@@ -20401,23 +20418,23 @@ function detectGlobalPackageManager() {
20401
20418
  return (target ? lockfileOwnerOf(target) : null) ?? "yarn";
20402
20419
  }
20403
20420
  function lockfileOwnerOf(root) {
20404
- for (let dir = path17.dirname(root); path17.dirname(dir) !== dir; dir = path17.dirname(dir)) {
20421
+ for (let dir = path18.dirname(root); path18.dirname(dir) !== dir; dir = path18.dirname(dir)) {
20405
20422
  const pm = pmFromLockfile(dir);
20406
20423
  if (pm) return pm;
20407
20424
  }
20408
20425
  return null;
20409
20426
  }
20410
20427
  function npmCopyBeside(binDir) {
20411
- return process.platform === "win32" ? path17.join(binDir, "node_modules", PACKAGE_NAME) : path17.join(path17.dirname(binDir), "lib", "node_modules", PACKAGE_NAME);
20428
+ return process.platform === "win32" ? path18.join(binDir, "node_modules", PACKAGE_NAME) : path18.join(path18.dirname(binDir), "lib", "node_modules", PACKAGE_NAME);
20412
20429
  }
20413
20430
  function isInNpmLayout(binaryPath, root) {
20414
20431
  const realRoot = canonicalPath(root);
20415
20432
  let link = binaryPath;
20416
20433
  for (let hop = 0; hop < 40; hop++) {
20417
- const binDir = canonicalPath(path17.dirname(link));
20434
+ const binDir = canonicalPath(path18.dirname(link));
20418
20435
  if (canonicalPath(npmCopyBeside(binDir)) === realRoot) return true;
20419
20436
  try {
20420
- link = path17.resolve(binDir, fs16.readlinkSync(link));
20437
+ link = path18.resolve(binDir, fs17.readlinkSync(link));
20421
20438
  } catch {
20422
20439
  return false;
20423
20440
  }
@@ -20436,7 +20453,7 @@ function asKnownPm(name) {
20436
20453
  }
20437
20454
  function pmFromPackageManagerField(dir) {
20438
20455
  try {
20439
- const pkg = JSON.parse(fs16.readFileSync(path17.join(dir, "package.json"), "utf8"));
20456
+ const pkg = JSON.parse(fs17.readFileSync(path18.join(dir, "package.json"), "utf8"));
20440
20457
  if (typeof pkg.packageManager === "string") {
20441
20458
  return asKnownPm(pkg.packageManager.split("@")[0]);
20442
20459
  }
@@ -20447,7 +20464,7 @@ function pmFromPackageManagerField(dir) {
20447
20464
  }
20448
20465
  function pmFromDevEngines(dir) {
20449
20466
  try {
20450
- const pkg = JSON.parse(fs16.readFileSync(path17.join(dir, "package.json"), "utf8"));
20467
+ const pkg = JSON.parse(fs17.readFileSync(path18.join(dir, "package.json"), "utf8"));
20451
20468
  const devEnginesPm = pkg.devEngines?.packageManager;
20452
20469
  const names = /* @__PURE__ */ new Set();
20453
20470
  for (const entry of Array.isArray(devEnginesPm) ? devEnginesPm : [devEnginesPm]) {
@@ -20460,7 +20477,7 @@ function pmFromDevEngines(dir) {
20460
20477
  }
20461
20478
  }
20462
20479
  function pmFromLockfile(dir) {
20463
- const has = (file) => fs16.existsSync(path17.join(dir, file));
20480
+ const has = (file) => fs17.existsSync(path18.join(dir, file));
20464
20481
  if (has("pnpm-lock.yaml")) return "pnpm";
20465
20482
  if (has("yarn.lock")) return "yarn";
20466
20483
  if (has("bun.lock") || has("bun.lockb")) return "bun";
@@ -20468,15 +20485,15 @@ function pmFromLockfile(dir) {
20468
20485
  return null;
20469
20486
  }
20470
20487
  function pmFromWorkspaceMarker(dir) {
20471
- return fs16.existsSync(path17.join(dir, "pnpm-workspace.yaml")) ? "pnpm" : null;
20488
+ return fs17.existsSync(path18.join(dir, "pnpm-workspace.yaml")) ? "pnpm" : null;
20472
20489
  }
20473
20490
  function detectProjectPackageManager(projectRoot) {
20474
- let dir = path17.resolve(projectRoot);
20491
+ let dir = path18.resolve(projectRoot);
20475
20492
  for (; ; ) {
20476
20493
  const pm = pmFromPackageManagerField(dir) ?? pmFromLockfile(dir) ?? pmFromDevEngines(dir) ?? pmFromWorkspaceMarker(dir);
20477
20494
  if (pm) return pm;
20478
- if (fs16.existsSync(path17.join(dir, ".git"))) break;
20479
- const parent = path17.dirname(dir);
20495
+ if (fs17.existsSync(path18.join(dir, ".git"))) break;
20496
+ const parent = path18.dirname(dir);
20480
20497
  if (parent === dir) break;
20481
20498
  dir = parent;
20482
20499
  }
@@ -20496,8 +20513,8 @@ function globalInstallCommand(pm, pkg) {
20496
20513
  }
20497
20514
  function globalCommandOptions(pm) {
20498
20515
  if (pm === "npm") return {};
20499
- const home = os2.homedir();
20500
- const cwd = fs16.existsSync(home) ? { cwd: home } : {};
20516
+ const home = os3.homedir();
20517
+ const cwd = fs17.existsSync(home) ? { cwd: home } : {};
20501
20518
  if (pm !== "yarn" || !process.env.npm_config_user_agent?.startsWith("npm/")) return cwd;
20502
20519
  const { npm_config_prefix: _npmPrefix, ...env } = process.env;
20503
20520
  return { ...cwd, env };
@@ -20529,11 +20546,11 @@ function ownsGlobalInstall(pm, runningRoot) {
20529
20546
  localBuild = !isRegistrySpec(dependency?.version);
20530
20547
  } else {
20531
20548
  const dir = pm === "bun" ? /^([^\r\n]+) node_modules \(/.exec(output)?.[1] : output;
20532
- if (!dir || !path17.isAbsolute(dir)) return false;
20533
- pkg = pm === "npm" ? path17.join(dir, PACKAGE_NAME) : path17.join(dir, "node_modules", PACKAGE_NAME);
20534
- localBuild = fs16.lstatSync(pkg).isSymbolicLink();
20549
+ if (!dir || !path18.isAbsolute(dir)) return false;
20550
+ pkg = pm === "npm" ? path18.join(dir, PACKAGE_NAME) : path18.join(dir, "node_modules", PACKAGE_NAME);
20551
+ localBuild = fs17.lstatSync(pkg).isSymbolicLink();
20535
20552
  }
20536
- return !localBuild && !!pkg && path17.isAbsolute(pkg) && fs16.realpathSync(pkg) === runningRoot;
20553
+ return !localBuild && !!pkg && path18.isAbsolute(pkg) && fs17.realpathSync(pkg) === runningRoot;
20537
20554
  } catch {
20538
20555
  return false;
20539
20556
  }
@@ -20588,15 +20605,15 @@ function localUninstallCommand(pm, pkg) {
20588
20605
  }
20589
20606
 
20590
20607
  // ../argent-installer/src/install-record.ts
20591
- import * as fs17 from "node:fs";
20592
- import * as path18 from "node:path";
20608
+ import * as fs18 from "node:fs";
20609
+ import * as path19 from "node:path";
20593
20610
  function getInstallRecordPath(projectRoot) {
20594
- return path18.join(projectRoot, ".argent", "install.json");
20611
+ return path19.join(projectRoot, ".argent", "install.json");
20595
20612
  }
20596
20613
  function readInstallRecord(projectRoot) {
20597
20614
  try {
20598
20615
  const parsed = JSON.parse(
20599
- fs17.readFileSync(getInstallRecordPath(projectRoot), "utf8")
20616
+ fs18.readFileSync(getInstallRecordPath(projectRoot), "utf8")
20600
20617
  );
20601
20618
  if (parsed && (parsed.mode === "local" || parsed.mode === "global")) return parsed;
20602
20619
  return null;
@@ -20606,17 +20623,17 @@ function readInstallRecord(projectRoot) {
20606
20623
  }
20607
20624
  function writeInstallRecord(projectRoot, record) {
20608
20625
  const recordPath = getInstallRecordPath(projectRoot);
20609
- fs17.mkdirSync(path18.dirname(recordPath), { recursive: true });
20610
- fs17.writeFileSync(recordPath, JSON.stringify(record, null, 2) + "\n");
20626
+ fs18.mkdirSync(path19.dirname(recordPath), { recursive: true });
20627
+ fs18.writeFileSync(recordPath, JSON.stringify(record, null, 2) + "\n");
20611
20628
  }
20612
20629
  function removeInstallRecord(projectRoot) {
20613
20630
  const recordPath = getInstallRecordPath(projectRoot);
20614
20631
  try {
20615
- if (!fs17.existsSync(recordPath)) return false;
20616
- fs17.rmSync(recordPath, { force: true });
20617
- const dir = path18.dirname(recordPath);
20632
+ if (!fs18.existsSync(recordPath)) return false;
20633
+ fs18.rmSync(recordPath, { force: true });
20634
+ const dir = path19.dirname(recordPath);
20618
20635
  try {
20619
- if (fs17.existsSync(dir) && fs17.readdirSync(dir).length === 0) fs17.rmdirSync(dir);
20636
+ if (fs18.existsSync(dir) && fs18.readdirSync(dir).length === 0) fs18.rmdirSync(dir);
20620
20637
  } catch {
20621
20638
  }
20622
20639
  return true;
@@ -20644,9 +20661,9 @@ function resolveInstallModeFromFlags(opts) {
20644
20661
  // ../argent-installer/src/utils.ts
20645
20662
  var PACKAGE_ROOT = resolvePackageRoot(import.meta.dirname);
20646
20663
  function resolveBundledDir(dirName) {
20647
- const packagedDir = path19.join(PACKAGE_ROOT, dirName);
20648
- if (fs18.existsSync(packagedDir)) return packagedDir;
20649
- return path19.resolve(PACKAGE_ROOT, "..", "skills", dirName);
20664
+ const packagedDir = path20.join(PACKAGE_ROOT, dirName);
20665
+ if (fs19.existsSync(packagedDir)) return packagedDir;
20666
+ return path20.resolve(PACKAGE_ROOT, "..", "skills", dirName);
20650
20667
  }
20651
20668
  var SKILLS_DIR = resolveBundledDir("skills");
20652
20669
  var RULES_DIR = resolveBundledDir("rules");
@@ -20658,18 +20675,18 @@ function buildArgentSkillsSource(version) {
20658
20675
  }
20659
20676
  function listBundledSkills(skillsDir = SKILLS_DIR) {
20660
20677
  try {
20661
- return fs18.readdirSync(skillsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).filter((name) => fs18.existsSync(path19.join(skillsDir, name, "SKILL.md"))).sort();
20678
+ return fs19.readdirSync(skillsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).filter((name) => fs19.existsSync(path20.join(skillsDir, name, "SKILL.md"))).sort();
20662
20679
  } catch {
20663
20680
  return [];
20664
20681
  }
20665
20682
  }
20666
20683
  function getProjectSkillLockPath(cwd = process.cwd()) {
20667
- return path19.join(cwd, "skills-lock.json");
20684
+ return path20.join(cwd, "skills-lock.json");
20668
20685
  }
20669
20686
  function getGlobalSkillLockPath() {
20670
20687
  const xdgStateHome = process.env.XDG_STATE_HOME;
20671
- if (xdgStateHome) return path19.join(xdgStateHome, "skills", ".skill-lock.json");
20672
- return path19.join(os3.homedir(), ".agents", ".skill-lock.json");
20688
+ if (xdgStateHome) return path20.join(xdgStateHome, "skills", ".skill-lock.json");
20689
+ return path20.join(os4.homedir(), ".agents", ".skill-lock.json");
20673
20690
  }
20674
20691
  var ARGENT_SKILL_PREFIX = "argent-";
20675
20692
  var LEGACY_ARGENT_SKILL_NAMES = [
@@ -20775,7 +20792,7 @@ function hashBundledContent(content) {
20775
20792
  }
20776
20793
  function listArgentSkillsInLock(lockPath) {
20777
20794
  try {
20778
- const raw = fs18.readFileSync(lockPath, "utf8");
20795
+ const raw = fs19.readFileSync(lockPath, "utf8");
20779
20796
  const lock = JSON.parse(raw);
20780
20797
  const tracked = lock.skills ?? {};
20781
20798
  return Object.keys(tracked).filter((name) => name.startsWith(ARGENT_SKILL_PREFIX)).sort();
@@ -20798,21 +20815,21 @@ var PROJECT_ROOT_MARKERS = [
20798
20815
  "opencode.jsonc",
20799
20816
  "skills-lock.json"
20800
20817
  ];
20801
- function resolveProjectRoot2(startDir, homeDir = os3.homedir()) {
20802
- const initialDir = path19.resolve(startDir);
20818
+ function resolveProjectRoot2(startDir, homeDir = os4.homedir()) {
20819
+ const initialDir = path20.resolve(startDir);
20803
20820
  const home = canonicalPath(homeDir);
20804
20821
  let currentDir = initialDir;
20805
20822
  while (true) {
20806
20823
  if (currentDir !== initialDir && canonicalPath(currentDir) === home) {
20807
20824
  return initialDir;
20808
20825
  }
20809
- if (PROJECT_ROOT_MARKERS.some((marker) => fs18.existsSync(path19.join(currentDir, marker)))) {
20826
+ if (PROJECT_ROOT_MARKERS.some((marker) => fs19.existsSync(path20.join(currentDir, marker)))) {
20810
20827
  return currentDir;
20811
20828
  }
20812
- if (fs18.existsSync(path19.join(currentDir, ".git"))) {
20829
+ if (fs19.existsSync(path20.join(currentDir, ".git"))) {
20813
20830
  return currentDir;
20814
20831
  }
20815
- const parentDir = path19.dirname(currentDir);
20832
+ const parentDir = path20.dirname(currentDir);
20816
20833
  if (parentDir === currentDir) {
20817
20834
  return initialDir;
20818
20835
  }
@@ -20820,20 +20837,20 @@ function resolveProjectRoot2(startDir, homeDir = os3.homedir()) {
20820
20837
  }
20821
20838
  }
20822
20839
  function readToml(filePath) {
20823
- if (!fs18.existsSync(filePath)) return {};
20840
+ if (!fs19.existsSync(filePath)) return {};
20824
20841
  try {
20825
- return parse(fs18.readFileSync(filePath, "utf8"));
20842
+ return parse(fs19.readFileSync(filePath, "utf8"));
20826
20843
  } catch {
20827
20844
  return {};
20828
20845
  }
20829
20846
  }
20830
20847
  function writeToml(filePath, data) {
20831
- fs18.mkdirSync(path19.dirname(filePath), { recursive: true });
20832
- fs18.writeFileSync(filePath, stringify(data) + "\n");
20848
+ fs19.mkdirSync(path20.dirname(filePath), { recursive: true });
20849
+ fs19.writeFileSync(filePath, stringify(data) + "\n");
20833
20850
  }
20834
20851
  function readYaml(filePath) {
20835
- if (!fs18.existsSync(filePath)) return new import_yaml.Document({});
20836
- const text2 = fs18.readFileSync(filePath, "utf8");
20852
+ if (!fs19.existsSync(filePath)) return new import_yaml.Document({});
20853
+ const text2 = fs19.readFileSync(filePath, "utf8");
20837
20854
  const doc = (0, import_yaml.parseDocument)(text2);
20838
20855
  if (doc.errors.length > 0) {
20839
20856
  const messages = doc.errors.map((e) => e.message).join("; ");
@@ -20842,20 +20859,20 @@ function readYaml(filePath) {
20842
20859
  return doc;
20843
20860
  }
20844
20861
  function writeYaml(filePath, doc) {
20845
- fs18.mkdirSync(path19.dirname(filePath), { recursive: true });
20846
- fs18.writeFileSync(filePath, doc.toString({ lineWidth: 0 }));
20862
+ fs19.mkdirSync(path20.dirname(filePath), { recursive: true });
20863
+ fs19.writeFileSync(filePath, doc.toString({ lineWidth: 0 }));
20847
20864
  }
20848
20865
  function readJson(filePath) {
20849
- if (!fs18.existsSync(filePath)) return {};
20866
+ if (!fs19.existsSync(filePath)) return {};
20850
20867
  try {
20851
- return JSON.parse(fs18.readFileSync(filePath, "utf8"));
20868
+ return JSON.parse(fs19.readFileSync(filePath, "utf8"));
20852
20869
  } catch {
20853
20870
  return {};
20854
20871
  }
20855
20872
  }
20856
20873
  function writeJson(filePath, data) {
20857
- fs18.mkdirSync(path19.dirname(filePath), { recursive: true });
20858
- fs18.writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n");
20874
+ fs19.mkdirSync(path20.dirname(filePath), { recursive: true });
20875
+ fs19.writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n");
20859
20876
  }
20860
20877
  var JSONC_FORMATTING = { tabSize: 2, insertSpaces: true };
20861
20878
  function setJsoncIn(text2, jsonPath, value) {
@@ -20863,8 +20880,8 @@ function setJsoncIn(text2, jsonPath, value) {
20863
20880
  return applyEdits(text2, edits);
20864
20881
  }
20865
20882
  function readJsoncFileRaw(filePath) {
20866
- if (!fs18.existsSync(filePath)) return { text: "{}", hadBom: false, wasEmpty: true };
20867
- let text2 = fs18.readFileSync(filePath, "utf8");
20883
+ if (!fs19.existsSync(filePath)) return { text: "{}", hadBom: false, wasEmpty: true };
20884
+ let text2 = fs19.readFileSync(filePath, "utf8");
20868
20885
  const hadBom = text2.charCodeAt(0) === 65279;
20869
20886
  if (hadBom) text2 = text2.slice(1);
20870
20887
  const wasEmpty = text2.trim() === "";
@@ -20883,26 +20900,26 @@ function isEmptyPlainObject(value) {
20883
20900
  return value !== null && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0;
20884
20901
  }
20885
20902
  function removePath(targetPath) {
20886
- const entry = fs18.lstatSync(targetPath, { throwIfNoEntry: false });
20903
+ const entry = fs19.lstatSync(targetPath, { throwIfNoEntry: false });
20887
20904
  if (!entry) return false;
20888
- if (entry.isSymbolicLink()) fs18.unlinkSync(targetPath);
20889
- else fs18.rmSync(targetPath, { recursive: entry.isDirectory(), force: true });
20905
+ if (entry.isSymbolicLink()) fs19.unlinkSync(targetPath);
20906
+ else fs19.rmSync(targetPath, { recursive: entry.isDirectory(), force: true });
20890
20907
  return true;
20891
20908
  }
20892
20909
  function rmEmptyDir(dirPath) {
20893
20910
  try {
20894
- if (!fs18.existsSync(dirPath)) return false;
20895
- if (!fs18.statSync(dirPath).isDirectory()) return false;
20896
- if (fs18.readdirSync(dirPath).length > 0) return false;
20897
- fs18.rmdirSync(dirPath);
20911
+ if (!fs19.existsSync(dirPath)) return false;
20912
+ if (!fs19.statSync(dirPath).isDirectory()) return false;
20913
+ if (fs19.readdirSync(dirPath).length > 0) return false;
20914
+ fs19.rmdirSync(dirPath);
20898
20915
  return true;
20899
20916
  } catch {
20900
20917
  return false;
20901
20918
  }
20902
20919
  }
20903
20920
  function readJsonc(filePath) {
20904
- if (!fs18.existsSync(filePath)) return {};
20905
- let raw = fs18.readFileSync(filePath, "utf8");
20921
+ if (!fs19.existsSync(filePath)) return {};
20922
+ let raw = fs19.readFileSync(filePath, "utf8");
20906
20923
  if (raw.charCodeAt(0) === 65279) raw = raw.slice(1);
20907
20924
  if (raw.trim() === "") return {};
20908
20925
  const parsed = parse3(raw, [], { allowTrailingComma: true });
@@ -20923,7 +20940,7 @@ function yamlSyntaxErrorLine(raw) {
20923
20940
  function findConfigSyntaxErrorLine(filePath, jsonOptions) {
20924
20941
  let raw;
20925
20942
  try {
20926
- raw = fs18.readFileSync(filePath, "utf8");
20943
+ raw = fs19.readFileSync(filePath, "utf8");
20927
20944
  } catch {
20928
20945
  return null;
20929
20946
  }
@@ -20949,18 +20966,18 @@ function editJsoncFile(filePath, jsonPath, value) {
20949
20966
  }
20950
20967
  const parsed = parse3(text2, [], { allowTrailingComma: true });
20951
20968
  if (isEmptyPlainObject(parsed)) {
20952
- fs18.rmSync(filePath, { force: true });
20953
- rmEmptyDir(path19.dirname(filePath));
20969
+ fs19.rmSync(filePath, { force: true });
20970
+ rmEmptyDir(path20.dirname(filePath));
20954
20971
  return;
20955
20972
  }
20956
- fs18.mkdirSync(path19.dirname(filePath), { recursive: true });
20973
+ fs19.mkdirSync(path20.dirname(filePath), { recursive: true });
20957
20974
  const out = wasEmpty && !text2.endsWith("\n") ? text2 + "\n" : text2;
20958
- fs18.writeFileSync(filePath, (hadBom ? "\uFEFF" : "") + out);
20975
+ fs19.writeFileSync(filePath, (hadBom ? "\uFEFF" : "") + out);
20959
20976
  }
20960
20977
  var MAX_SYMLINK_HOPS = 40;
20961
20978
  function realpathOrSelf(p) {
20962
20979
  try {
20963
- return fs18.realpathSync(p);
20980
+ return fs19.realpathSync(p);
20964
20981
  } catch {
20965
20982
  return p;
20966
20983
  }
@@ -20970,13 +20987,13 @@ function resolveLinkedDestination(dest) {
20970
20987
  for (let hop = 0; hop < MAX_SYMLINK_HOPS; hop++) {
20971
20988
  let entry;
20972
20989
  try {
20973
- entry = fs18.lstatSync(current);
20990
+ entry = fs19.lstatSync(current);
20974
20991
  } catch {
20975
- return current === dest || dirExists(path19.dirname(current)) ? current : dest;
20992
+ return current === dest || dirExists(path20.dirname(current)) ? current : dest;
20976
20993
  }
20977
20994
  if (!entry.isSymbolicLink()) return current;
20978
20995
  try {
20979
- current = path19.resolve(realpathOrSelf(path19.dirname(current)), fs18.readlinkSync(current));
20996
+ current = path20.resolve(realpathOrSelf(path20.dirname(current)), fs19.readlinkSync(current));
20980
20997
  } catch {
20981
20998
  return dest;
20982
20999
  }
@@ -20984,30 +21001,30 @@ function resolveLinkedDestination(dest) {
20984
21001
  return dest;
20985
21002
  }
20986
21003
  function copyDir(src, dest) {
20987
- if (!fs18.existsSync(src) || !treeHasFiles(src)) return null;
21004
+ if (!fs19.existsSync(src) || !treeHasFiles(src)) return null;
20988
21005
  const target = resolveLinkedDestination(dest);
20989
21006
  copyTree(src, target);
20990
21007
  return target;
20991
21008
  }
20992
21009
  function treeHasFiles(dir) {
20993
- return fs18.readdirSync(dir, { withFileTypes: true }).some((entry) => !entry.isDirectory() || treeHasFiles(path19.join(dir, entry.name)));
21010
+ return fs19.readdirSync(dir, { withFileTypes: true }).some((entry) => !entry.isDirectory() || treeHasFiles(path20.join(dir, entry.name)));
20994
21011
  }
20995
21012
  function copyTree(src, dest) {
20996
- const entries = fs18.readdirSync(src, { withFileTypes: true });
20997
- fs18.mkdirSync(dest, { recursive: true });
21013
+ const entries = fs19.readdirSync(src, { withFileTypes: true });
21014
+ fs19.mkdirSync(dest, { recursive: true });
20998
21015
  for (const entry of entries) {
20999
- const from = path19.join(src, entry.name);
21000
- const to = resolveLinkedDestination(path19.join(dest, entry.name));
21016
+ const from = path20.join(src, entry.name);
21017
+ const to = resolveLinkedDestination(path20.join(dest, entry.name));
21001
21018
  if (entry.isDirectory()) copyTree(from, to);
21002
- else fs18.copyFileSync(from, to);
21019
+ else fs19.copyFileSync(from, to);
21003
21020
  }
21004
21021
  }
21005
21022
  function readRetiredFile(targetDir, relativePath) {
21006
- const entryPath = path19.join(resolveLinkedDestination(targetDir), ...relativePath.split("/"));
21023
+ const entryPath = path20.join(resolveLinkedDestination(targetDir), ...relativePath.split("/"));
21007
21024
  const file = resolveLinkedDestination(entryPath);
21008
21025
  try {
21009
- if (!fs18.statSync(file, { throwIfNoEntry: false })?.isFile()) return null;
21010
- return fs18.readFileSync(file, "utf8");
21026
+ if (!fs19.statSync(file, { throwIfNoEntry: false })?.isFile()) return null;
21027
+ return fs19.readFileSync(file, "utf8");
21011
21028
  } catch {
21012
21029
  return null;
21013
21030
  }
@@ -21015,7 +21032,7 @@ function readRetiredFile(targetDir, relativePath) {
21015
21032
  function findRetiredFiles(retired, bundleDir, targetDir) {
21016
21033
  const found = [];
21017
21034
  for (const { path: relativePath, shipped } of retired) {
21018
- if (bundleDir !== null && fs18.existsSync(path19.join(bundleDir, ...relativePath.split("/"))))
21035
+ if (bundleDir !== null && fs19.existsSync(path20.join(bundleDir, ...relativePath.split("/"))))
21019
21036
  continue;
21020
21037
  const content = readRetiredFile(targetDir, relativePath);
21021
21038
  if (content === null) continue;
@@ -21031,17 +21048,17 @@ function removeRetiredFiles(targetDir, files) {
21031
21048
  const content = readRetiredFile(targetDir, relativePath);
21032
21049
  if (content === null || hashBundledContent(content) !== sha256) continue;
21033
21050
  const segments = relativePath.split("/");
21034
- const entryPath = path19.join(dir, ...segments);
21051
+ const entryPath = path20.join(dir, ...segments);
21035
21052
  const file = resolveLinkedDestination(entryPath);
21036
21053
  try {
21037
- fs18.rmSync(file);
21054
+ fs19.rmSync(file);
21038
21055
  if (file !== entryPath) removePath(entryPath);
21039
21056
  removedPaths.push(relativePath);
21040
21057
  } catch {
21041
21058
  continue;
21042
21059
  }
21043
21060
  for (let depth = segments.length - 1; depth > 0; depth--) {
21044
- if (!rmEmptyDir(path19.join(dir, ...segments.slice(0, depth)))) break;
21061
+ if (!rmEmptyDir(path20.join(dir, ...segments.slice(0, depth)))) break;
21045
21062
  }
21046
21063
  }
21047
21064
  const removedRoot = removedPaths.length > 0 && dir === targetDir && rmEmptyDir(dir);
@@ -21049,15 +21066,15 @@ function removeRetiredFiles(targetDir, files) {
21049
21066
  }
21050
21067
  function dirExists(p) {
21051
21068
  try {
21052
- return fs18.statSync(p).isDirectory();
21069
+ return fs19.statSync(p).isDirectory();
21053
21070
  } catch {
21054
21071
  return false;
21055
21072
  }
21056
21073
  }
21057
21074
  function getInstalledVersion() {
21058
21075
  try {
21059
- const pkgPath = path19.join(PACKAGE_ROOT, "package.json");
21060
- const pkg = JSON.parse(fs18.readFileSync(pkgPath, "utf8"));
21076
+ const pkgPath = path20.join(PACKAGE_ROOT, "package.json");
21077
+ const pkg = JSON.parse(fs19.readFileSync(pkgPath, "utf8"));
21061
21078
  return pkg.version ?? null;
21062
21079
  } catch {
21063
21080
  return null;
@@ -21124,7 +21141,7 @@ function escapeStringRegexp(string) {
21124
21141
  }
21125
21142
 
21126
21143
  // ../argent-installer/src/mcp-configs.ts
21127
- var TOOL_SERVER_BUNDLE = path20.join(import.meta.dirname, "tool-server.cjs");
21144
+ var TOOL_SERVER_BUNDLE = path21.join(import.meta.dirname, "tool-server.cjs");
21128
21145
  function getAvailableToolIds() {
21129
21146
  const out = execFileSync5("node", [TOOL_SERVER_BUNDLE, "-t"], { encoding: "utf8" });
21130
21147
  const tools = JSON.parse(out);
@@ -21187,10 +21204,10 @@ function hasCustomizingEnv(entry) {
21187
21204
  }
21188
21205
  function removeDirIfEmpty(dirPath) {
21189
21206
  try {
21190
- if (!fs19.existsSync(dirPath)) return;
21191
- if (!fs19.statSync(dirPath).isDirectory()) return;
21192
- if (fs19.readdirSync(dirPath).length > 0) return;
21193
- fs19.rmdirSync(dirPath);
21207
+ if (!fs20.existsSync(dirPath)) return;
21208
+ if (!fs20.statSync(dirPath).isDirectory()) return;
21209
+ if (fs20.readdirSync(dirPath).length > 0) return;
21210
+ fs20.rmdirSync(dirPath);
21194
21211
  } catch {
21195
21212
  }
21196
21213
  }
@@ -21228,7 +21245,7 @@ function isArgentManagedEntry(entry) {
21228
21245
  return args.length === 1 && args[0] === "mcp";
21229
21246
  case "node": {
21230
21247
  if (args.length !== 2 || args[1] !== "mcp" || !args[0]) return false;
21231
- if (path20.isAbsolute(args[0])) return false;
21248
+ if (path21.isAbsolute(args[0])) return false;
21232
21249
  const normalized = args[0].split("\\").join("/");
21233
21250
  return normalized.includes(`node_modules/${PACKAGE_NAME}/`);
21234
21251
  }
@@ -21242,12 +21259,12 @@ function isArgentManagedEntry(entry) {
21242
21259
  }
21243
21260
  function isPinnedGlobalEntry(entry) {
21244
21261
  const [cli, subcommand] = entry.args;
21245
- return path20.isAbsolute(entry.command) && path20.basename(entry.command) === "node" && entry.args.length === 2 && subcommand === "mcp" && path20.isAbsolute(cli) && cli.includes(`/node_modules/${PACKAGE_NAME}/`);
21262
+ return path21.isAbsolute(entry.command) && path21.basename(entry.command) === "node" && entry.args.length === 2 && subcommand === "mcp" && path21.isAbsolute(cli) && cli.includes(`/node_modules/${PACKAGE_NAME}/`);
21246
21263
  }
21247
21264
  function writeTomlOrRemove(filePath, data) {
21248
21265
  if (Object.keys(data).length === 0) {
21249
- fs19.rmSync(filePath, { force: true });
21250
- removeDirIfEmpty(path20.dirname(filePath));
21266
+ fs20.rmSync(filePath, { force: true });
21267
+ removeDirIfEmpty(path21.dirname(filePath));
21251
21268
  return;
21252
21269
  }
21253
21270
  writeToml(filePath, data);
@@ -21256,12 +21273,12 @@ function dirHasEditorEvidence(dir, looksArgentOnly) {
21256
21273
  return dirExists(dir) && !looksArgentOnly(dir);
21257
21274
  }
21258
21275
  function fileHasEditorEvidence(filePath, looksArgentOnly) {
21259
- return fs19.existsSync(filePath) && !looksArgentOnly(filePath);
21276
+ return fs20.existsSync(filePath) && !looksArgentOnly(filePath);
21260
21277
  }
21261
21278
  function parseJsoncStrict(filePath) {
21262
21279
  let raw;
21263
21280
  try {
21264
- raw = fs19.readFileSync(filePath, "utf8");
21281
+ raw = fs20.readFileSync(filePath, "utf8");
21265
21282
  } catch {
21266
21283
  return null;
21267
21284
  }
@@ -21274,14 +21291,14 @@ function parseJsoncStrict(filePath) {
21274
21291
  }
21275
21292
  function parseTomlStrict(filePath) {
21276
21293
  try {
21277
- return parse(fs19.readFileSync(filePath, "utf8"));
21294
+ return parse(fs20.readFileSync(filePath, "utf8"));
21278
21295
  } catch {
21279
21296
  return null;
21280
21297
  }
21281
21298
  }
21282
21299
  function parseYamlStrict(filePath) {
21283
21300
  try {
21284
- const parsed = (0, import_yaml2.parse)(fs19.readFileSync(filePath, "utf8"));
21301
+ const parsed = (0, import_yaml2.parse)(fs20.readFileSync(filePath, "utf8"));
21285
21302
  if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return null;
21286
21303
  return parsed;
21287
21304
  } catch {
@@ -21304,7 +21321,7 @@ function bundledManagedNames(kind) {
21304
21321
  if (cached2) return cached2;
21305
21322
  let names;
21306
21323
  try {
21307
- names = new Set(fs19.readdirSync(kind === "rules" ? RULES_DIR : AGENTS_DIR));
21324
+ names = new Set(fs20.readdirSync(kind === "rules" ? RULES_DIR : AGENTS_DIR));
21308
21325
  } catch {
21309
21326
  names = /* @__PURE__ */ new Set();
21310
21327
  }
@@ -21315,7 +21332,7 @@ function bundledManagedNames(kind) {
21315
21332
  function managedDirLooksArgentOnly(dir, kind) {
21316
21333
  let entries;
21317
21334
  try {
21318
- entries = fs19.readdirSync(dir);
21335
+ entries = fs20.readdirSync(dir);
21319
21336
  } catch {
21320
21337
  return false;
21321
21338
  }
@@ -21327,13 +21344,13 @@ function managedDirLooksArgentOnly(dir, kind) {
21327
21344
  function cursorDirLooksArgentOnly(dir) {
21328
21345
  let entries;
21329
21346
  try {
21330
- entries = fs19.readdirSync(dir);
21347
+ entries = fs20.readdirSync(dir);
21331
21348
  } catch {
21332
21349
  return false;
21333
21350
  }
21334
21351
  if (entries.length === 0) return false;
21335
21352
  return entries.every((entry) => {
21336
- const full = path20.join(dir, entry);
21353
+ const full = path21.join(dir, entry);
21337
21354
  if (entry === "mcp.json") {
21338
21355
  return jsonLooksArgentServerOnly(full, "mcpServers");
21339
21356
  }
@@ -21366,13 +21383,13 @@ function claudeSettingsLooksArgentOnly(filePath) {
21366
21383
  function claudeDirLooksArgentOnly(dir) {
21367
21384
  let entries;
21368
21385
  try {
21369
- entries = fs19.readdirSync(dir);
21386
+ entries = fs20.readdirSync(dir);
21370
21387
  } catch {
21371
21388
  return false;
21372
21389
  }
21373
21390
  if (entries.length === 0) return false;
21374
21391
  return entries.every((entry) => {
21375
- const full = path20.join(dir, entry);
21392
+ const full = path21.join(dir, entry);
21376
21393
  if (entry === "settings.json") return claudeSettingsLooksArgentOnly(full);
21377
21394
  if (entry === "rules" || entry === "agents" || entry === "skills") {
21378
21395
  return managedDirLooksArgentOnly(full, entry);
@@ -21383,25 +21400,25 @@ function claudeDirLooksArgentOnly(dir) {
21383
21400
  function vscodeDirLooksArgentOnly(dir) {
21384
21401
  let entries;
21385
21402
  try {
21386
- entries = fs19.readdirSync(dir);
21403
+ entries = fs20.readdirSync(dir);
21387
21404
  } catch {
21388
21405
  return false;
21389
21406
  }
21390
21407
  if (entries.length === 0) return false;
21391
21408
  return entries.every(
21392
- (entry) => entry === "mcp.json" && jsonLooksArgentServerOnly(path20.join(dir, entry), "servers")
21409
+ (entry) => entry === "mcp.json" && jsonLooksArgentServerOnly(path21.join(dir, entry), "servers")
21393
21410
  );
21394
21411
  }
21395
21412
  function windsurfDirLooksArgentOnly(dir) {
21396
21413
  let entries;
21397
21414
  try {
21398
- entries = fs19.readdirSync(dir);
21415
+ entries = fs20.readdirSync(dir);
21399
21416
  } catch {
21400
21417
  return false;
21401
21418
  }
21402
21419
  if (entries.length === 0) return false;
21403
21420
  return entries.every(
21404
- (entry) => entry === "mcp_config.json" && jsonLooksArgentServerOnly(path20.join(dir, entry), "mcpServers")
21421
+ (entry) => entry === "mcp_config.json" && jsonLooksArgentServerOnly(path21.join(dir, entry), "mcpServers")
21405
21422
  );
21406
21423
  }
21407
21424
  function zedSettingsLooksArgentOnly(filePath) {
@@ -21432,25 +21449,25 @@ function zedSettingsLooksArgentOnly(filePath) {
21432
21449
  function zedDirLooksArgentOnly(dir) {
21433
21450
  let entries;
21434
21451
  try {
21435
- entries = fs19.readdirSync(dir);
21452
+ entries = fs20.readdirSync(dir);
21436
21453
  } catch {
21437
21454
  return false;
21438
21455
  }
21439
21456
  if (entries.length === 0) return false;
21440
21457
  return entries.every(
21441
- (entry) => entry === "settings.json" && zedSettingsLooksArgentOnly(path20.join(dir, entry))
21458
+ (entry) => entry === "settings.json" && zedSettingsLooksArgentOnly(path21.join(dir, entry))
21442
21459
  );
21443
21460
  }
21444
21461
  function geminiDirLooksArgentOnly(dir) {
21445
21462
  let entries;
21446
21463
  try {
21447
- entries = fs19.readdirSync(dir);
21464
+ entries = fs20.readdirSync(dir);
21448
21465
  } catch {
21449
21466
  return false;
21450
21467
  }
21451
21468
  if (entries.length === 0) return false;
21452
21469
  return entries.every((entry) => {
21453
- const full = path20.join(dir, entry);
21470
+ const full = path21.join(dir, entry);
21454
21471
  if (entry === "settings.json") return jsonLooksArgentServerOnly(full, "mcpServers");
21455
21472
  if (entry === "rules" || entry === "agents") return managedDirLooksArgentOnly(full, entry);
21456
21473
  return false;
@@ -21469,48 +21486,48 @@ function hermesConfigLooksArgentOnly(filePath) {
21469
21486
  function hermesDirLooksArgentOnly(dir) {
21470
21487
  let entries;
21471
21488
  try {
21472
- entries = fs19.readdirSync(dir);
21489
+ entries = fs20.readdirSync(dir);
21473
21490
  } catch {
21474
21491
  return false;
21475
21492
  }
21476
21493
  if (entries.length === 0) return false;
21477
21494
  return entries.every(
21478
- (entry) => entry === "config.yaml" && hermesConfigLooksArgentOnly(path20.join(dir, entry))
21495
+ (entry) => entry === "config.yaml" && hermesConfigLooksArgentOnly(path21.join(dir, entry))
21479
21496
  );
21480
21497
  }
21481
21498
  function kiroDirLooksArgentOnly(dir) {
21482
21499
  let entries;
21483
21500
  try {
21484
- entries = fs19.readdirSync(dir);
21501
+ entries = fs20.readdirSync(dir);
21485
21502
  } catch {
21486
21503
  return false;
21487
21504
  }
21488
21505
  if (entries.length === 0) return false;
21489
21506
  return entries.every((entry) => {
21490
21507
  if (entry !== "settings") return false;
21491
- const settingsDir = path20.join(dir, entry);
21508
+ const settingsDir = path21.join(dir, entry);
21492
21509
  let settingsEntries;
21493
21510
  try {
21494
- settingsEntries = fs19.readdirSync(settingsDir);
21511
+ settingsEntries = fs20.readdirSync(settingsDir);
21495
21512
  } catch {
21496
21513
  return false;
21497
21514
  }
21498
21515
  if (settingsEntries.length === 0) return false;
21499
21516
  return settingsEntries.every(
21500
- (name) => name === "mcp.json" && jsonLooksArgentServerOnly(path20.join(settingsDir, name), "mcpServers")
21517
+ (name) => name === "mcp.json" && jsonLooksArgentServerOnly(path21.join(settingsDir, name), "mcpServers")
21501
21518
  );
21502
21519
  });
21503
21520
  }
21504
21521
  function codexDirLooksArgentOnly(dir) {
21505
21522
  let entries;
21506
21523
  try {
21507
- entries = fs19.readdirSync(dir);
21524
+ entries = fs20.readdirSync(dir);
21508
21525
  } catch {
21509
21526
  return false;
21510
21527
  }
21511
21528
  if (entries.length === 0) return false;
21512
21529
  return entries.every((entry) => {
21513
- const full = path20.join(dir, entry);
21530
+ const full = path21.join(dir, entry);
21514
21531
  if (entry === "config.toml") {
21515
21532
  const config = parseTomlStrict(full);
21516
21533
  if (config === null) return false;
@@ -21535,7 +21552,7 @@ function codexDirLooksArgentOnly(dir) {
21535
21552
  });
21536
21553
  }
21537
21554
  function cursorPermissionsPath() {
21538
- return path20.join(homedir4(), ".cursor", "permissions.json");
21555
+ return path21.join(homedir5(), ".cursor", "permissions.json");
21539
21556
  }
21540
21557
  function cursorPermissionsList() {
21541
21558
  const list = readJsonc(cursorPermissionsPath()).mcpAllowlist;
@@ -21544,13 +21561,13 @@ function cursorPermissionsList() {
21544
21561
  var cursorAdapter = {
21545
21562
  name: "Cursor",
21546
21563
  detect() {
21547
- return dirHasEditorEvidence(path20.join(homedir4(), ".cursor"), cursorDirLooksArgentOnly) || dirHasEditorEvidence(path20.join(process.cwd(), ".cursor"), cursorDirLooksArgentOnly);
21564
+ return dirHasEditorEvidence(path21.join(homedir5(), ".cursor"), cursorDirLooksArgentOnly) || dirHasEditorEvidence(path21.join(process.cwd(), ".cursor"), cursorDirLooksArgentOnly);
21548
21565
  },
21549
21566
  projectPath(root) {
21550
- return path20.join(root, ".cursor", "mcp.json");
21567
+ return path21.join(root, ".cursor", "mcp.json");
21551
21568
  },
21552
21569
  globalPath() {
21553
- return path20.join(homedir4(), ".cursor", "mcp.json");
21570
+ return path21.join(homedir5(), ".cursor", "mcp.json");
21554
21571
  },
21555
21572
  // Read and written as JSONC through readJsonc / editJsoncFile: path-targeted
21556
21573
  // text edits that preserve user comments and foreign servers.
@@ -21562,7 +21579,7 @@ var cursorAdapter = {
21562
21579
  });
21563
21580
  },
21564
21581
  remove(configPath) {
21565
- if (!fs19.existsSync(configPath)) return false;
21582
+ if (!fs20.existsSync(configPath)) return false;
21566
21583
  const config = readJsonc(configPath);
21567
21584
  const servers = config.mcpServers;
21568
21585
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21570,7 +21587,7 @@ var cursorAdapter = {
21570
21587
  return true;
21571
21588
  },
21572
21589
  getArgentEntry(configPath) {
21573
- if (!fs19.existsSync(configPath)) return null;
21590
+ if (!fs20.existsSync(configPath)) return null;
21574
21591
  const config = readJsonc(configPath);
21575
21592
  const servers = config.mcpServers;
21576
21593
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21595,7 +21612,7 @@ var cursorAdapter = {
21595
21612
  removeAllowlist(_root, scope) {
21596
21613
  if (scope !== "global") return;
21597
21614
  const permPath = cursorPermissionsPath();
21598
- if (!fs19.existsSync(permPath)) return;
21615
+ if (!fs20.existsSync(permPath)) return;
21599
21616
  const config = readJsonc(permPath);
21600
21617
  const list = Array.isArray(config.mcpAllowlist) ? config.mcpAllowlist : void 0;
21601
21618
  if (!list || !list.includes(CURSOR_ALLOWLIST_PATTERN)) return;
@@ -21608,7 +21625,7 @@ function claudeProjectKeysForRoot(projects, root) {
21608
21625
  return Object.keys(projects).filter((key) => key === root || canonicalPath(key) === target);
21609
21626
  }
21610
21627
  function claudeDisabledListFinding(settingsPath, label, projectConfined) {
21611
- if (!fs19.existsSync(settingsPath)) return null;
21628
+ if (!fs20.existsSync(settingsPath)) return null;
21612
21629
  const disabled = readJson(settingsPath).disabledMcpjsonServers;
21613
21630
  if (!Array.isArray(disabled) || !disabled.includes(MCP_SERVER_KEY)) return null;
21614
21631
  return {
@@ -21636,13 +21653,13 @@ var claudeAdapter = {
21636
21653
  name: "Claude Code",
21637
21654
  detect() {
21638
21655
  const mcpJsonArgentOnly = (p) => jsonLooksArgentServerOnly(p, "mcpServers");
21639
- return fileHasEditorEvidence(path20.join(process.cwd(), ".mcp.json"), mcpJsonArgentOnly) || fileHasEditorEvidence(path20.join(homedir4(), ".claude.json"), mcpJsonArgentOnly) || dirHasEditorEvidence(path20.join(process.cwd(), ".claude"), claudeDirLooksArgentOnly) || dirHasEditorEvidence(path20.join(homedir4(), ".claude"), claudeDirLooksArgentOnly);
21656
+ return fileHasEditorEvidence(path21.join(process.cwd(), ".mcp.json"), mcpJsonArgentOnly) || fileHasEditorEvidence(path21.join(homedir5(), ".claude.json"), mcpJsonArgentOnly) || dirHasEditorEvidence(path21.join(process.cwd(), ".claude"), claudeDirLooksArgentOnly) || dirHasEditorEvidence(path21.join(homedir5(), ".claude"), claudeDirLooksArgentOnly);
21640
21657
  },
21641
21658
  projectPath(root) {
21642
- return path20.join(root, ".mcp.json");
21659
+ return path21.join(root, ".mcp.json");
21643
21660
  },
21644
21661
  globalPath() {
21645
- return path20.join(homedir4(), ".claude.json");
21662
+ return path21.join(homedir5(), ".claude.json");
21646
21663
  },
21647
21664
  // JSONC is a superset of JSON, so this config shares the one comment- and
21648
21665
  // foreign-server-preserving write path (see the Cursor adapter).
@@ -21655,7 +21672,7 @@ var claudeAdapter = {
21655
21672
  });
21656
21673
  },
21657
21674
  remove(configPath) {
21658
- if (!fs19.existsSync(configPath)) return false;
21675
+ if (!fs20.existsSync(configPath)) return false;
21659
21676
  const config = readJsonc(configPath);
21660
21677
  const servers = config.mcpServers;
21661
21678
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21669,7 +21686,7 @@ var claudeAdapter = {
21669
21686
  return true;
21670
21687
  },
21671
21688
  getArgentEntry(configPath) {
21672
- if (!fs19.existsSync(configPath)) return null;
21689
+ if (!fs20.existsSync(configPath)) return null;
21673
21690
  const config = readJsonc(configPath);
21674
21691
  const servers = config.mcpServers;
21675
21692
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21682,7 +21699,7 @@ var claudeAdapter = {
21682
21699
  // .mcp.json rejections (see claudeDisabledListFinding).
21683
21700
  findShadowingConfigs(root, writtenScope) {
21684
21701
  const findings = [];
21685
- const claudeJsonPath = path20.join(homedir4(), ".claude.json");
21702
+ const claudeJsonPath = path21.join(homedir5(), ".claude.json");
21686
21703
  const projects = readJson(claudeJsonPath).projects;
21687
21704
  if (isRecord(projects)) {
21688
21705
  for (const key of claudeProjectKeysForRoot(projects, root)) {
@@ -21719,9 +21736,9 @@ var claudeAdapter = {
21719
21736
  }
21720
21737
  if (writtenScope === "local") {
21721
21738
  const candidates = [
21722
- [path20.join(root, ".claude", "settings.json"), ".claude/settings.json", true],
21723
- [path20.join(root, ".claude", "settings.local.json"), ".claude/settings.local.json", true],
21724
- [path20.join(homedir4(), ".claude", "settings.json"), "~/.claude/settings.json", false]
21739
+ [path21.join(root, ".claude", "settings.json"), ".claude/settings.json", true],
21740
+ [path21.join(root, ".claude", "settings.local.json"), ".claude/settings.local.json", true],
21741
+ [path21.join(homedir5(), ".claude", "settings.json"), "~/.claude/settings.json", false]
21725
21742
  ];
21726
21743
  for (const [settingsPath, label, projectConfined] of candidates) {
21727
21744
  const finding = claudeDisabledListFinding(settingsPath, label, projectConfined);
@@ -21740,10 +21757,10 @@ var claudeAdapter = {
21740
21757
  var vscodeAdapter = {
21741
21758
  name: "VS Code",
21742
21759
  detect() {
21743
- return dirHasEditorEvidence(path20.join(process.cwd(), ".vscode"), vscodeDirLooksArgentOnly) || dirExists(path20.join(homedir4(), ".vscode"));
21760
+ return dirHasEditorEvidence(path21.join(process.cwd(), ".vscode"), vscodeDirLooksArgentOnly) || dirExists(path21.join(homedir5(), ".vscode"));
21744
21761
  },
21745
21762
  projectPath(root) {
21746
- return path20.join(root, ".vscode", "mcp.json");
21763
+ return path21.join(root, ".vscode", "mcp.json");
21747
21764
  },
21748
21765
  globalPath() {
21749
21766
  return null;
@@ -21759,7 +21776,7 @@ var vscodeAdapter = {
21759
21776
  });
21760
21777
  },
21761
21778
  remove(configPath) {
21762
- if (!fs19.existsSync(configPath)) return false;
21779
+ if (!fs20.existsSync(configPath)) return false;
21763
21780
  const config = readJsonc(configPath);
21764
21781
  const servers = config.servers;
21765
21782
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21767,7 +21784,7 @@ var vscodeAdapter = {
21767
21784
  return true;
21768
21785
  },
21769
21786
  getArgentEntry(configPath) {
21770
- if (!fs19.existsSync(configPath)) return null;
21787
+ if (!fs20.existsSync(configPath)) return null;
21771
21788
  const config = readJsonc(configPath);
21772
21789
  const servers = config.servers;
21773
21790
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21780,7 +21797,7 @@ var vscodeAdapter = {
21780
21797
  findShadowingConfigs(_root, _writtenScope) {
21781
21798
  const findings = [];
21782
21799
  for (const userDir of vscodeUserDirs()) {
21783
- const configPath = path20.join(userDir, "mcp.json");
21800
+ const configPath = path21.join(userDir, "mcp.json");
21784
21801
  const entry = this.getArgentEntry(configPath);
21785
21802
  if (!entry) continue;
21786
21803
  findings.push({
@@ -21797,16 +21814,16 @@ var vscodeAdapter = {
21797
21814
  function vscodeUserDirs() {
21798
21815
  const bases = [];
21799
21816
  if (process.platform === "darwin") {
21800
- bases.push(path20.join(homedir4(), "Library", "Application Support"));
21817
+ bases.push(path21.join(homedir5(), "Library", "Application Support"));
21801
21818
  } else if (process.platform === "win32") {
21802
21819
  if (process.env.APPDATA) bases.push(process.env.APPDATA);
21803
21820
  } else {
21804
- bases.push(path20.join(homedir4(), ".config"));
21821
+ bases.push(path21.join(homedir5(), ".config"));
21805
21822
  }
21806
21823
  const dirs = [];
21807
21824
  for (const base of bases) {
21808
21825
  for (const product of ["Code", "Code - Insiders"]) {
21809
- const dir = path20.join(base, product, "User");
21826
+ const dir = path21.join(base, product, "User");
21810
21827
  if (dirExists(dir)) dirs.push(dir);
21811
21828
  }
21812
21829
  }
@@ -21814,18 +21831,18 @@ function vscodeUserDirs() {
21814
21831
  }
21815
21832
  function devinUserConfigPath() {
21816
21833
  if (process.platform === "win32") {
21817
- const appData = process.env.APPDATA || path20.join(homedir4(), "AppData", "Roaming");
21818
- return path20.join(appData, "devin", "config.json");
21834
+ const appData = process.env.APPDATA || path21.join(homedir5(), "AppData", "Roaming");
21835
+ return path21.join(appData, "devin", "config.json");
21819
21836
  }
21820
21837
  const xdg = process.env.XDG_CONFIG_HOME;
21821
- return path20.join(xdg || path20.join(homedir4(), ".config"), "devin", "config.json");
21838
+ return path21.join(xdg || path21.join(homedir5(), ".config"), "devin", "config.json");
21822
21839
  }
21823
21840
  var windsurfAdapter = {
21824
21841
  name: "Devin Desktop",
21825
21842
  telemetryName: "windsurf",
21826
21843
  detect() {
21827
21844
  return dirHasEditorEvidence(
21828
- path20.join(homedir4(), ".codeium", "windsurf"),
21845
+ path21.join(homedir5(), ".codeium", "windsurf"),
21829
21846
  windsurfDirLooksArgentOnly
21830
21847
  );
21831
21848
  },
@@ -21833,7 +21850,7 @@ var windsurfAdapter = {
21833
21850
  return null;
21834
21851
  },
21835
21852
  globalPath() {
21836
- return path20.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21853
+ return path21.join(homedir5(), ".codeium", "windsurf", "mcp_config.json");
21837
21854
  },
21838
21855
  // JSONC-safe writes (see the Cursor adapter).
21839
21856
  write(configPath, entry) {
@@ -21845,7 +21862,7 @@ var windsurfAdapter = {
21845
21862
  });
21846
21863
  },
21847
21864
  remove(configPath) {
21848
- if (!fs19.existsSync(configPath)) return false;
21865
+ if (!fs20.existsSync(configPath)) return false;
21849
21866
  const config = readJsonc(configPath);
21850
21867
  const servers = config.mcpServers;
21851
21868
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21853,7 +21870,7 @@ var windsurfAdapter = {
21853
21870
  return true;
21854
21871
  },
21855
21872
  getArgentEntry(configPath) {
21856
- if (!fs19.existsSync(configPath)) return null;
21873
+ if (!fs20.existsSync(configPath)) return null;
21857
21874
  const config = readJsonc(configPath);
21858
21875
  const servers = config.mcpServers;
21859
21876
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21865,7 +21882,7 @@ var windsurfAdapter = {
21865
21882
  // servers survive. alwaysAllow serves the legacy Cascade agent; the Devin
21866
21883
  // agent needs its own permission rule.
21867
21884
  addAllowlist() {
21868
- const configPath = path20.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21885
+ const configPath = path21.join(homedir5(), ".codeium", "windsurf", "mcp_config.json");
21869
21886
  const config = readJsonc(configPath);
21870
21887
  const servers = config.mcpServers;
21871
21888
  if (!servers?.[MCP_SERVER_KEY]) return;
@@ -21875,8 +21892,8 @@ var windsurfAdapter = {
21875
21892
  removeAllowlist(_root, scope) {
21876
21893
  if (scope !== "global") return;
21877
21894
  removeAllowRule(devinUserConfigPath(), DEVIN_PERMISSION_RULE);
21878
- const configPath = path20.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21879
- if (!fs19.existsSync(configPath)) return;
21895
+ const configPath = path21.join(homedir5(), ".codeium", "windsurf", "mcp_config.json");
21896
+ if (!fs20.existsSync(configPath)) return;
21880
21897
  const config = readJsonc(configPath);
21881
21898
  const servers = config.mcpServers;
21882
21899
  const entry = servers?.[MCP_SERVER_KEY];
@@ -21887,13 +21904,13 @@ var windsurfAdapter = {
21887
21904
  var zedAdapter = {
21888
21905
  name: "Zed",
21889
21906
  detect() {
21890
- return dirHasEditorEvidence(path20.join(homedir4(), ".config", "zed"), zedDirLooksArgentOnly);
21907
+ return dirHasEditorEvidence(path21.join(homedir5(), ".config", "zed"), zedDirLooksArgentOnly);
21891
21908
  },
21892
21909
  projectPath(root) {
21893
- return path20.join(root, ".zed", "settings.json");
21910
+ return path21.join(root, ".zed", "settings.json");
21894
21911
  },
21895
21912
  globalPath() {
21896
- return path20.join(homedir4(), ".config", "zed", "settings.json");
21913
+ return path21.join(homedir5(), ".config", "zed", "settings.json");
21897
21914
  },
21898
21915
  // Read and written as JSONC through readJsonc / editJsoncFile so comments and
21899
21916
  // formatting outside the touched key survive (see the Cursor adapter).
@@ -21906,7 +21923,7 @@ var zedAdapter = {
21906
21923
  });
21907
21924
  },
21908
21925
  remove(configPath) {
21909
- if (!fs19.existsSync(configPath)) return false;
21926
+ if (!fs20.existsSync(configPath)) return false;
21910
21927
  const config = readJsonc(configPath);
21911
21928
  const servers = config.context_servers;
21912
21929
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21914,7 +21931,7 @@ var zedAdapter = {
21914
21931
  return true;
21915
21932
  },
21916
21933
  getArgentEntry(configPath) {
21917
- if (!fs19.existsSync(configPath)) return null;
21934
+ if (!fs20.existsSync(configPath)) return null;
21918
21935
  const config = readJsonc(configPath);
21919
21936
  const servers = config.context_servers;
21920
21937
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21925,12 +21942,12 @@ var zedAdapter = {
21925
21942
  // Zed has no server-level wildcard for MCP tools — each tool would need its
21926
21943
  // own entry — so the global default is set to "allow" instead.
21927
21944
  addAllowlist(root, scope) {
21928
- const settingsPath = scope === "global" ? path20.join(homedir4(), ".config", "zed", "settings.json") : path20.join(root, ".zed", "settings.json");
21945
+ const settingsPath = scope === "global" ? path21.join(homedir5(), ".config", "zed", "settings.json") : path21.join(root, ".zed", "settings.json");
21929
21946
  editJsoncFile(settingsPath, ["agent", "tool_permissions", "default"], "allow");
21930
21947
  },
21931
21948
  removeAllowlist(root, scope) {
21932
- const settingsPath = scope === "global" ? path20.join(homedir4(), ".config", "zed", "settings.json") : path20.join(root, ".zed", "settings.json");
21933
- if (!fs19.existsSync(settingsPath)) return;
21949
+ const settingsPath = scope === "global" ? path21.join(homedir5(), ".config", "zed", "settings.json") : path21.join(root, ".zed", "settings.json");
21950
+ if (!fs20.existsSync(settingsPath)) return;
21934
21951
  const config = readJsonc(settingsPath);
21935
21952
  const perms = config.agent?.tool_permissions;
21936
21953
  if (!perms || perms.default !== "allow") return;
@@ -21940,13 +21957,13 @@ var zedAdapter = {
21940
21957
  var geminiAdapter = {
21941
21958
  name: "Gemini",
21942
21959
  detect() {
21943
- return dirHasEditorEvidence(path20.join(homedir4(), ".gemini"), geminiDirLooksArgentOnly) || dirHasEditorEvidence(path20.join(process.cwd(), ".gemini"), geminiDirLooksArgentOnly);
21960
+ return dirHasEditorEvidence(path21.join(homedir5(), ".gemini"), geminiDirLooksArgentOnly) || dirHasEditorEvidence(path21.join(process.cwd(), ".gemini"), geminiDirLooksArgentOnly);
21944
21961
  },
21945
21962
  projectPath(root) {
21946
- return path20.join(root, ".gemini", "settings.json");
21963
+ return path21.join(root, ".gemini", "settings.json");
21947
21964
  },
21948
21965
  globalPath() {
21949
- return path20.join(homedir4(), ".gemini", "settings.json");
21966
+ return path21.join(homedir5(), ".gemini", "settings.json");
21950
21967
  },
21951
21968
  // JSONC-safe writes (see the Cursor adapter).
21952
21969
  write(configPath, entry) {
@@ -21958,7 +21975,7 @@ var geminiAdapter = {
21958
21975
  });
21959
21976
  },
21960
21977
  remove(configPath) {
21961
- if (!fs19.existsSync(configPath)) return false;
21978
+ if (!fs20.existsSync(configPath)) return false;
21962
21979
  const config = readJsonc(configPath);
21963
21980
  const servers = config.mcpServers;
21964
21981
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21966,7 +21983,7 @@ var geminiAdapter = {
21966
21983
  return true;
21967
21984
  },
21968
21985
  getArgentEntry(configPath) {
21969
- if (!fs19.existsSync(configPath)) return null;
21986
+ if (!fs20.existsSync(configPath)) return null;
21970
21987
  const config = readJsonc(configPath);
21971
21988
  const servers = config.mcpServers;
21972
21989
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21988,7 +22005,7 @@ var geminiAdapter = {
21988
22005
  },
21989
22006
  removeAllowlist(root, scope) {
21990
22007
  const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
21991
- if (!configPath || !fs19.existsSync(configPath)) {
22008
+ if (!configPath || !fs20.existsSync(configPath)) {
21992
22009
  return;
21993
22010
  }
21994
22011
  const config = readJsonc(configPath);
@@ -22002,13 +22019,13 @@ var CODEX_FILENAME = ".codex";
22002
22019
  var codexAdapter = {
22003
22020
  name: "Codex",
22004
22021
  detect() {
22005
- return dirHasEditorEvidence(path20.join(homedir4(), CODEX_FILENAME), codexDirLooksArgentOnly) || dirHasEditorEvidence(path20.join(process.cwd(), CODEX_FILENAME), codexDirLooksArgentOnly);
22022
+ return dirHasEditorEvidence(path21.join(homedir5(), CODEX_FILENAME), codexDirLooksArgentOnly) || dirHasEditorEvidence(path21.join(process.cwd(), CODEX_FILENAME), codexDirLooksArgentOnly);
22006
22023
  },
22007
22024
  projectPath(root) {
22008
- return path20.join(root, CODEX_FILENAME, "config.toml");
22025
+ return path21.join(root, CODEX_FILENAME, "config.toml");
22009
22026
  },
22010
22027
  globalPath() {
22011
- return path20.join(homedir4(), CODEX_FILENAME, "config.toml");
22028
+ return path21.join(homedir5(), CODEX_FILENAME, "config.toml");
22012
22029
  },
22013
22030
  write(configPath, entry) {
22014
22031
  const config = readToml(configPath);
@@ -22024,7 +22041,7 @@ var codexAdapter = {
22024
22041
  writeToml(configPath, config);
22025
22042
  },
22026
22043
  remove(configPath) {
22027
- if (!fs19.existsSync(configPath)) return false;
22044
+ if (!fs20.existsSync(configPath)) return false;
22028
22045
  const config = readToml(configPath);
22029
22046
  const servers = config.mcp_servers;
22030
22047
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -22034,7 +22051,7 @@ var codexAdapter = {
22034
22051
  return true;
22035
22052
  },
22036
22053
  getArgentEntry(configPath) {
22037
- if (!fs19.existsSync(configPath)) return null;
22054
+ if (!fs20.existsSync(configPath)) return null;
22038
22055
  const config = readToml(configPath);
22039
22056
  const servers = config.mcp_servers;
22040
22057
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -22066,7 +22083,7 @@ var codexAdapter = {
22066
22083
  // them, and an emptied or removed table stays as it is.
22067
22084
  refreshAllowlist(root, scope) {
22068
22085
  const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
22069
- if (!configPath || !fs19.existsSync(configPath)) return;
22086
+ if (!configPath || !fs20.existsSync(configPath)) return;
22070
22087
  const config = readToml(configPath);
22071
22088
  const toolsConfig = config.mcp_servers?.argent?.tools;
22072
22089
  if (!toolsConfig) return;
@@ -22103,13 +22120,13 @@ var codexAdapter = {
22103
22120
  var hermesAdapter = {
22104
22121
  name: "Hermes",
22105
22122
  detect() {
22106
- return dirHasEditorEvidence(path20.join(homedir4(), ".hermes"), hermesDirLooksArgentOnly);
22123
+ return dirHasEditorEvidence(path21.join(homedir5(), ".hermes"), hermesDirLooksArgentOnly);
22107
22124
  },
22108
22125
  projectPath() {
22109
22126
  return null;
22110
22127
  },
22111
22128
  globalPath() {
22112
- return path20.join(homedir4(), ".hermes", "config.yaml");
22129
+ return path21.join(homedir5(), ".hermes", "config.yaml");
22113
22130
  },
22114
22131
  write(configPath, entry) {
22115
22132
  const doc = readYaml(configPath);
@@ -22128,7 +22145,7 @@ var hermesAdapter = {
22128
22145
  writeYaml(configPath, doc);
22129
22146
  },
22130
22147
  remove(configPath) {
22131
- if (!fs19.existsSync(configPath)) return false;
22148
+ if (!fs20.existsSync(configPath)) return false;
22132
22149
  const doc = readYaml(configPath);
22133
22150
  const servers = doc.get("mcp_servers");
22134
22151
  if (!(0, import_yaml2.isMap)(servers)) return false;
@@ -22141,7 +22158,7 @@ var hermesAdapter = {
22141
22158
  return true;
22142
22159
  },
22143
22160
  getArgentEntry(configPath) {
22144
- if (!fs19.existsSync(configPath)) return null;
22161
+ if (!fs20.existsSync(configPath)) return null;
22145
22162
  const doc = readYaml(configPath);
22146
22163
  const servers = doc.get("mcp_servers");
22147
22164
  if (!(0, import_yaml2.isMap)(servers)) return null;
@@ -22168,10 +22185,10 @@ function hasOpenCodeBinary() {
22168
22185
  }
22169
22186
  function pickOpencodeConfig(dir, candidates) {
22170
22187
  for (const name of candidates) {
22171
- const candidate = path20.join(dir, name);
22172
- if (fs19.existsSync(candidate)) return candidate;
22188
+ const candidate = path21.join(dir, name);
22189
+ if (fs20.existsSync(candidate)) return candidate;
22173
22190
  }
22174
- return path20.join(dir, "opencode.json");
22191
+ return path21.join(dir, "opencode.json");
22175
22192
  }
22176
22193
  var openCodeAdapter = {
22177
22194
  name: "opencode",
@@ -22182,7 +22199,7 @@ var openCodeAdapter = {
22182
22199
  return pickOpencodeConfig(root, OPENCODE_PROJECT_FILES);
22183
22200
  },
22184
22201
  globalPath() {
22185
- return pickOpencodeConfig(path20.join(homedir4(), ".config", "opencode"), OPENCODE_GLOBAL_FILES);
22202
+ return pickOpencodeConfig(path21.join(homedir5(), ".config", "opencode"), OPENCODE_GLOBAL_FILES);
22186
22203
  },
22187
22204
  write(configPath, entry) {
22188
22205
  editJsoncFile(configPath, ["mcp", MCP_SERVER_KEY], {
@@ -22193,7 +22210,7 @@ var openCodeAdapter = {
22193
22210
  });
22194
22211
  },
22195
22212
  remove(configPath) {
22196
- if (!fs19.existsSync(configPath)) return false;
22213
+ if (!fs20.existsSync(configPath)) return false;
22197
22214
  const config = readJsonc(configPath);
22198
22215
  const servers = config.mcp;
22199
22216
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -22201,7 +22218,7 @@ var openCodeAdapter = {
22201
22218
  return true;
22202
22219
  },
22203
22220
  getArgentEntry(configPath) {
22204
- if (!fs19.existsSync(configPath)) return null;
22221
+ if (!fs20.existsSync(configPath)) return null;
22205
22222
  const config = readJsonc(configPath);
22206
22223
  const servers = config.mcp;
22207
22224
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -22216,7 +22233,7 @@ var openCodeAdapter = {
22216
22233
  },
22217
22234
  removeAllowlist(root, scope) {
22218
22235
  const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
22219
- if (!configPath || !fs19.existsSync(configPath)) return;
22236
+ if (!configPath || !fs20.existsSync(configPath)) return;
22220
22237
  const config = readJsonc(configPath);
22221
22238
  const tools = config.tools;
22222
22239
  if (!tools || !(OPENCODE_ALLOWLIST_PATTERN in tools)) return;
@@ -22227,13 +22244,13 @@ var KIRO_AUTO_APPROVE_ALL = ["*"];
22227
22244
  var kiroAdapter = {
22228
22245
  name: "Kiro",
22229
22246
  detect() {
22230
- return dirHasEditorEvidence(path20.join(homedir4(), ".kiro"), kiroDirLooksArgentOnly) || dirHasEditorEvidence(path20.join(process.cwd(), ".kiro"), kiroDirLooksArgentOnly);
22247
+ return dirHasEditorEvidence(path21.join(homedir5(), ".kiro"), kiroDirLooksArgentOnly) || dirHasEditorEvidence(path21.join(process.cwd(), ".kiro"), kiroDirLooksArgentOnly);
22231
22248
  },
22232
22249
  projectPath(root) {
22233
- return path20.join(root, ".kiro", "settings", "mcp.json");
22250
+ return path21.join(root, ".kiro", "settings", "mcp.json");
22234
22251
  },
22235
22252
  globalPath() {
22236
- return path20.join(homedir4(), ".kiro", "settings", "mcp.json");
22253
+ return path21.join(homedir5(), ".kiro", "settings", "mcp.json");
22237
22254
  },
22238
22255
  // Read and written as JSONC through readJsonc / editJsoncFile so comments and
22239
22256
  // foreign servers survive (see the Cursor adapter).
@@ -22246,7 +22263,7 @@ var kiroAdapter = {
22246
22263
  });
22247
22264
  },
22248
22265
  remove(configPath) {
22249
- if (!fs19.existsSync(configPath)) return false;
22266
+ if (!fs20.existsSync(configPath)) return false;
22250
22267
  const config = readJsonc(configPath);
22251
22268
  const servers = config.mcpServers;
22252
22269
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -22254,7 +22271,7 @@ var kiroAdapter = {
22254
22271
  return true;
22255
22272
  },
22256
22273
  getArgentEntry(configPath) {
22257
- if (!fs19.existsSync(configPath)) return null;
22274
+ if (!fs20.existsSync(configPath)) return null;
22258
22275
  const config = readJsonc(configPath);
22259
22276
  const servers = config.mcpServers;
22260
22277
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -22278,7 +22295,7 @@ var kiroAdapter = {
22278
22295
  },
22279
22296
  removeAllowlist(root, scope) {
22280
22297
  const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
22281
- if (!configPath || !fs19.existsSync(configPath)) return;
22298
+ if (!configPath || !fs20.existsSync(configPath)) return;
22282
22299
  const config = readJsonc(configPath);
22283
22300
  const servers = config.mcpServers;
22284
22301
  const entry = servers?.[MCP_SERVER_KEY];
@@ -22330,7 +22347,7 @@ function addAllowRule(settingsPath, rule) {
22330
22347
  editJsoncFile(settingsPath, ["permissions", "allow"], [...allow, rule]);
22331
22348
  }
22332
22349
  function removeAllowRule(settingsPath, rule) {
22333
- if (!fs19.existsSync(settingsPath)) return;
22350
+ if (!fs20.existsSync(settingsPath)) return;
22334
22351
  const config = readJsonc(settingsPath);
22335
22352
  const permissions = config?.permissions;
22336
22353
  const allow = permissions?.allow;
@@ -22340,7 +22357,7 @@ function removeAllowRule(settingsPath, rule) {
22340
22357
  editJsoncFile(settingsPath, ["permissions", "allow"], next.length > 0 ? next : void 0);
22341
22358
  }
22342
22359
  function claudeSettingsPath(root, scope) {
22343
- return scope === "global" ? path20.join(homedir4(), ".claude", "settings.json") : path20.join(root, ".claude", "settings.json");
22360
+ return scope === "global" ? path21.join(homedir5(), ".claude", "settings.json") : path21.join(root, ".claude", "settings.json");
22344
22361
  }
22345
22362
  function addClaudePermission(root, scope) {
22346
22363
  addAllowRule(claudeSettingsPath(root, scope), PERMISSION_RULE);
@@ -22353,13 +22370,13 @@ function formatCopyDestination(target, writtenPath, root) {
22353
22370
  return `${target.label} -> ${formatManagedPathLabel(writtenPath, realpathOrSelf(root))}`;
22354
22371
  }
22355
22372
  function formatManagedPathLabel(targetPath, root) {
22356
- for (const home of [path20.resolve(homedir4()), canonicalPath(homedir4())]) {
22357
- if (targetPath === home || targetPath.startsWith(`${home}${path20.sep}`)) {
22373
+ for (const home of [path21.resolve(homedir5()), canonicalPath(homedir5())]) {
22374
+ if (targetPath === home || targetPath.startsWith(`${home}${path21.sep}`)) {
22358
22375
  return `~${targetPath.slice(home.length)}`;
22359
22376
  }
22360
22377
  }
22361
- const relative5 = path20.relative(root, targetPath);
22362
- if (relative5 && !relative5.startsWith("..") && !path20.isAbsolute(relative5)) {
22378
+ const relative5 = path21.relative(root, targetPath);
22379
+ if (relative5 && !relative5.startsWith("..") && !path21.isAbsolute(relative5)) {
22363
22380
  return relative5;
22364
22381
  }
22365
22382
  return targetPath;
@@ -22373,7 +22390,7 @@ function addManagedTarget(targets, editorName, targetPath, root) {
22373
22390
  }
22374
22391
  function getAdapterBasePath(adapter, root, scope) {
22375
22392
  const configPath = scope === "global" ? adapter.globalPath() : adapter.projectPath(root);
22376
- return configPath ? path20.dirname(configPath) : null;
22393
+ return configPath ? path21.dirname(configPath) : null;
22377
22394
  }
22378
22395
  function getManagedContentTargets(adapters, root, scope) {
22379
22396
  const targets = {
@@ -22383,17 +22400,17 @@ function getManagedContentTargets(adapters, root, scope) {
22383
22400
  codexConfigTargets: [],
22384
22401
  skillsLockTargets: []
22385
22402
  };
22386
- const workspaceBase = scope === "global" ? homedir4() : root;
22403
+ const workspaceBase = scope === "global" ? homedir5() : root;
22387
22404
  addManagedTarget(
22388
22405
  targets.skillTargets,
22389
22406
  "skills",
22390
- path20.join(workspaceBase, ".agents", "skills"),
22407
+ path21.join(workspaceBase, ".agents", "skills"),
22391
22408
  root
22392
22409
  );
22393
22410
  addManagedTarget(
22394
22411
  targets.skillsLockTargets,
22395
22412
  "skills",
22396
- path20.join(workspaceBase, "skills-lock.json"),
22413
+ path21.join(workspaceBase, "skills-lock.json"),
22397
22414
  root
22398
22415
  );
22399
22416
  for (const adapter of adapters) {
@@ -22401,21 +22418,21 @@ function getManagedContentTargets(adapters, root, scope) {
22401
22418
  case "Cursor": {
22402
22419
  const base = getAdapterBasePath(adapter, root, scope);
22403
22420
  if (!base) break;
22404
- addManagedTarget(targets.skillTargets, adapter.name, path20.join(base, "skills"), root);
22405
- addManagedTarget(targets.ruleTargets, adapter.name, path20.join(base, "rules"), root);
22421
+ addManagedTarget(targets.skillTargets, adapter.name, path21.join(base, "skills"), root);
22422
+ addManagedTarget(targets.ruleTargets, adapter.name, path21.join(base, "rules"), root);
22406
22423
  break;
22407
22424
  }
22408
22425
  case "Claude Code": {
22409
- const claudeBase = scope === "global" ? path20.join(homedir4(), ".claude") : path20.join(root, ".claude");
22410
- addManagedTarget(targets.skillTargets, adapter.name, path20.join(claudeBase, "skills"), root);
22411
- addManagedTarget(targets.ruleTargets, adapter.name, path20.join(claudeBase, "rules"), root);
22412
- addManagedTarget(targets.agentTargets, adapter.name, path20.join(claudeBase, "agents"), root);
22426
+ const claudeBase = scope === "global" ? path21.join(homedir5(), ".claude") : path21.join(root, ".claude");
22427
+ addManagedTarget(targets.skillTargets, adapter.name, path21.join(claudeBase, "skills"), root);
22428
+ addManagedTarget(targets.ruleTargets, adapter.name, path21.join(claudeBase, "rules"), root);
22429
+ addManagedTarget(targets.agentTargets, adapter.name, path21.join(claudeBase, "agents"), root);
22413
22430
  break;
22414
22431
  }
22415
22432
  case "Gemini": {
22416
- const geminiBase = scope === "global" ? path20.join(homedir4(), ".gemini") : path20.join(root, ".gemini");
22417
- addManagedTarget(targets.ruleTargets, adapter.name, path20.join(geminiBase, "rules"), root);
22418
- addManagedTarget(targets.agentTargets, adapter.name, path20.join(geminiBase, "agents"), root);
22433
+ const geminiBase = scope === "global" ? path21.join(homedir5(), ".gemini") : path21.join(root, ".gemini");
22434
+ addManagedTarget(targets.ruleTargets, adapter.name, path21.join(geminiBase, "rules"), root);
22435
+ addManagedTarget(targets.agentTargets, adapter.name, path21.join(geminiBase, "agents"), root);
22419
22436
  break;
22420
22437
  }
22421
22438
  case "Codex": {
@@ -22425,19 +22442,19 @@ function getManagedContentTargets(adapters, root, scope) {
22425
22442
  break;
22426
22443
  }
22427
22444
  case "opencode": {
22428
- const base = scope === "global" ? path20.join(homedir4(), ".config", "opencode") : path20.join(root, ".opencode");
22429
- addManagedTarget(targets.skillTargets, adapter.name, path20.join(base, "skills"), root);
22430
- addManagedTarget(targets.agentTargets, adapter.name, path20.join(base, "agents"), root);
22445
+ const base = scope === "global" ? path21.join(homedir5(), ".config", "opencode") : path21.join(root, ".opencode");
22446
+ addManagedTarget(targets.skillTargets, adapter.name, path21.join(base, "skills"), root);
22447
+ addManagedTarget(targets.agentTargets, adapter.name, path21.join(base, "agents"), root);
22431
22448
  break;
22432
22449
  }
22433
22450
  case "Kiro": {
22434
- const kiroBase = scope === "global" ? path20.join(homedir4(), ".kiro") : path20.join(root, ".kiro");
22435
- addManagedTarget(targets.skillTargets, adapter.name, path20.join(kiroBase, "skills"), root);
22451
+ const kiroBase = scope === "global" ? path21.join(homedir5(), ".kiro") : path21.join(root, ".kiro");
22452
+ addManagedTarget(targets.skillTargets, adapter.name, path21.join(kiroBase, "skills"), root);
22436
22453
  break;
22437
22454
  }
22438
22455
  case "Devin Desktop": {
22439
- const devinBase = scope === "global" ? path20.join(process.env.XDG_CONFIG_HOME || path20.join(homedir4(), ".config"), "devin") : path20.join(root, ".devin");
22440
- addManagedTarget(targets.skillTargets, adapter.name, path20.join(devinBase, "skills"), root);
22456
+ const devinBase = scope === "global" ? path21.join(process.env.XDG_CONFIG_HOME || path21.join(homedir5(), ".config"), "devin") : path21.join(root, ".devin");
22457
+ addManagedTarget(targets.skillTargets, adapter.name, path21.join(devinBase, "skills"), root);
22441
22458
  break;
22442
22459
  }
22443
22460
  }
@@ -22451,12 +22468,12 @@ function stripFrontmatter(content) {
22451
22468
  return match ? content.slice(match[0].length).trim() : content.trim();
22452
22469
  }
22453
22470
  function readAndConcatRules(rulesDir) {
22454
- if (!fs19.existsSync(rulesDir)) return null;
22455
- const files = fs19.readdirSync(rulesDir).filter((f) => f.endsWith(".md")).sort();
22471
+ if (!fs20.existsSync(rulesDir)) return null;
22472
+ const files = fs20.readdirSync(rulesDir).filter((f) => f.endsWith(".md")).sort();
22456
22473
  if (files.length === 0) return null;
22457
22474
  const parts = [];
22458
22475
  for (const file of files) {
22459
- const raw = fs19.readFileSync(path20.join(rulesDir, file), "utf8");
22476
+ const raw = fs20.readFileSync(path21.join(rulesDir, file), "utf8");
22460
22477
  const stripped = stripFrontmatter(raw);
22461
22478
  if (stripped) parts.push(stripped);
22462
22479
  }
@@ -22491,7 +22508,7 @@ function injectCodexRules(configPath, rulesDir) {
22491
22508
  return configPath;
22492
22509
  }
22493
22510
  function removeCodexRules(configPath) {
22494
- if (!fs19.existsSync(configPath)) return false;
22511
+ if (!fs20.existsSync(configPath)) return false;
22495
22512
  const config = readToml(configPath);
22496
22513
  const existing = config.developer_instructions;
22497
22514
  if (!existing || !existing.includes(ARGENT_RULES_START)) return false;
@@ -22583,10 +22600,10 @@ function copyRulesAndAgents(adapters, root, scope, rulesDir, agentsDir) {
22583
22600
  }
22584
22601
 
22585
22602
  // ../argent-installer/src/retired-files.ts
22586
- import * as path21 from "node:path";
22603
+ import * as path22 from "node:path";
22587
22604
  var import_picocolors = __toESM(require_picocolors(), 1);
22588
22605
  function displayPath(entry, file) {
22589
- return path21.join(entry.location, ...file.relativePath.split("/"));
22606
+ return path22.join(entry.location, ...file.relativePath.split("/"));
22590
22607
  }
22591
22608
  async function cleanupRetiredFiles(found, options) {
22592
22609
  const result = { removed: [], declined: [], failed: [], removedRoots: [] };
@@ -22637,14 +22654,14 @@ async function reportRetiredFiles(found, interactive) {
22637
22654
 
22638
22655
  // ../argent-installer/src/cli-record.ts
22639
22656
  var import_semver4 = __toESM(require_semver2(), 1);
22640
- import * as fs20 from "node:fs";
22641
- import * as path22 from "node:path";
22657
+ import * as fs21 from "node:fs";
22658
+ import * as path23 from "node:path";
22642
22659
  function cliRecordPath() {
22643
- return path22.join(argentHomeDir(), "cli.json");
22660
+ return path23.join(argentHomeDir(), "cli.json");
22644
22661
  }
22645
22662
  function readCliRecord() {
22646
22663
  try {
22647
- const parsed = JSON.parse(fs20.readFileSync(cliRecordPath(), "utf8"));
22664
+ const parsed = JSON.parse(fs21.readFileSync(cliRecordPath(), "utf8"));
22648
22665
  if (typeof parsed?.cli === "string" && typeof parsed?.node === "string") return parsed;
22649
22666
  return null;
22650
22667
  } catch {
@@ -22654,7 +22671,7 @@ function readCliRecord() {
22654
22671
  function resolveCliEntry(mode, projectRoot) {
22655
22672
  if (mode === "local") {
22656
22673
  const relative5 = getLocalArgentBinRelPath(projectRoot);
22657
- return relative5 ? path22.resolve(projectRoot, relative5) : null;
22674
+ return relative5 ? path23.resolve(projectRoot, relative5) : null;
22658
22675
  }
22659
22676
  const packageRoot = getGloballyInstalledPackageRoot();
22660
22677
  return packageRoot ? cliPathOf(packageRoot) : null;
@@ -22673,10 +22690,10 @@ function writeCliRecord(input) {
22673
22690
  function persistCliRecord(record) {
22674
22691
  const file = cliRecordPath();
22675
22692
  try {
22676
- fs20.mkdirSync(path22.dirname(file), { recursive: true });
22693
+ fs21.mkdirSync(path23.dirname(file), { recursive: true });
22677
22694
  const temporary = `${file}.${process.pid}.tmp`;
22678
- fs20.writeFileSync(temporary, JSON.stringify(record, null, 2) + "\n");
22679
- fs20.renameSync(temporary, file);
22695
+ fs21.writeFileSync(temporary, JSON.stringify(record, null, 2) + "\n");
22696
+ fs21.renameSync(temporary, file);
22680
22697
  return file;
22681
22698
  } catch {
22682
22699
  return null;
@@ -22684,10 +22701,10 @@ function persistCliRecord(record) {
22684
22701
  }
22685
22702
  function healCliRecord(input) {
22686
22703
  try {
22687
- if (!fs20.existsSync(input.cli)) return null;
22704
+ if (!fs21.existsSync(input.cli)) return null;
22688
22705
  const existing = readCliRecord();
22689
22706
  if (existing) {
22690
- const alive = fs20.existsSync(existing.node) && fs20.existsSync(existing.cli);
22707
+ const alive = fs21.existsSync(existing.node) && fs21.existsSync(existing.cli);
22691
22708
  const ourVersion = import_semver4.default.valid(input.version);
22692
22709
  const theirVersion = import_semver4.default.valid(existing.version);
22693
22710
  const newerThanExisting = ourVersion !== null && (theirVersion === null || import_semver4.default.gt(ourVersion, theirVersion));
@@ -22708,11 +22725,11 @@ function removeCliRecordFor(installDir) {
22708
22725
  if (!installDir) return false;
22709
22726
  const record = readCliRecord();
22710
22727
  if (!record) return false;
22711
- const root = path22.resolve(installDir);
22712
- const relative5 = path22.relative(root, path22.resolve(record.cli));
22713
- if (relative5.startsWith("..") || path22.isAbsolute(relative5)) return false;
22728
+ const root = path23.resolve(installDir);
22729
+ const relative5 = path23.relative(root, path23.resolve(record.cli));
22730
+ if (relative5.startsWith("..") || path23.isAbsolute(relative5)) return false;
22714
22731
  try {
22715
- fs20.rmSync(cliRecordPath(), { force: true });
22732
+ fs21.rmSync(cliRecordPath(), { force: true });
22716
22733
  return true;
22717
22734
  } catch {
22718
22735
  return false;
@@ -22938,8 +22955,8 @@ async function promptInstallMode(defaultMode = "global") {
22938
22955
 
22939
22956
  // ../argent-installer/src/install-runner.ts
22940
22957
  var import_picocolors4 = __toESM(require_picocolors(), 1);
22941
- import * as fs23 from "node:fs";
22942
- import * as path25 from "node:path";
22958
+ import * as fs24 from "node:fs";
22959
+ import * as path26 from "node:path";
22943
22960
 
22944
22961
  // ../argent-installer/src/shell.ts
22945
22962
  import { execFileSync as execFileSync6, spawn as spawn2 } from "node:child_process";
@@ -23003,33 +23020,33 @@ function runShellCommand(cmd, opts = {}) {
23003
23020
 
23004
23021
  // ../argent-installer/src/skills.ts
23005
23022
  import { execFileSync as execFileSync8 } from "node:child_process";
23006
- import * as fs22 from "node:fs";
23007
- import * as path24 from "node:path";
23023
+ import * as fs23 from "node:fs";
23024
+ import * as path25 from "node:path";
23008
23025
  var import_picocolors3 = __toESM(require_picocolors(), 1);
23009
23026
 
23010
23027
  // ../argent-installer/src/skills-runner.ts
23011
23028
  import { execFileSync as execFileSync7 } from "node:child_process";
23012
- import * as fs21 from "node:fs";
23013
- import * as path23 from "node:path";
23029
+ import * as fs22 from "node:fs";
23030
+ import * as path24 from "node:path";
23014
23031
  var WIN32_DEFAULT_PATHEXT = ".COM;.EXE;.BAT;.CMD";
23015
23032
  function findOnPath(bin, env, platform) {
23016
23033
  const pathValue = env.PATH ?? env.Path ?? "";
23017
- const dirs = pathValue.split(path23.delimiter).filter((dir) => path23.isAbsolute(dir));
23034
+ const dirs = pathValue.split(path24.delimiter).filter((dir) => path24.isAbsolute(dir));
23018
23035
  if (platform === "win32") {
23019
23036
  const exts = (env.PATHEXT ?? WIN32_DEFAULT_PATHEXT).split(";").filter(Boolean);
23020
23037
  for (const dir of dirs) {
23021
23038
  for (const ext of exts) {
23022
- const candidate = path23.join(dir, bin + ext);
23023
- if (fs21.existsSync(candidate)) return candidate;
23039
+ const candidate = path24.join(dir, bin + ext);
23040
+ if (fs22.existsSync(candidate)) return candidate;
23024
23041
  }
23025
23042
  }
23026
23043
  return null;
23027
23044
  }
23028
23045
  for (const dir of dirs) {
23029
- const candidate = path23.join(dir, bin);
23046
+ const candidate = path24.join(dir, bin);
23030
23047
  try {
23031
- if (!fs21.statSync(candidate).isFile()) continue;
23032
- fs21.accessSync(candidate, fs21.constants.X_OK);
23048
+ if (!fs22.statSync(candidate).isFile()) continue;
23049
+ fs22.accessSync(candidate, fs22.constants.X_OK);
23033
23050
  return candidate;
23034
23051
  } catch {
23035
23052
  }
@@ -23206,13 +23223,13 @@ function snapshotArgentSkills(projectRoot, scope, names) {
23206
23223
  let candidates = names;
23207
23224
  if (names.length === 0) {
23208
23225
  try {
23209
- candidates = fs22.readdirSync(targetPath).filter((n3) => n3.startsWith(ARGENT_SKILL_PREFIX));
23226
+ candidates = fs23.readdirSync(targetPath).filter((n3) => n3.startsWith(ARGENT_SKILL_PREFIX));
23210
23227
  } catch {
23211
23228
  continue;
23212
23229
  }
23213
23230
  }
23214
23231
  for (const name of candidates) {
23215
- const stat6 = fs22.statSync(path24.join(targetPath, name, "SKILL.md"), { throwIfNoEntry: false });
23232
+ const stat6 = fs23.statSync(path25.join(targetPath, name, "SKILL.md"), { throwIfNoEntry: false });
23216
23233
  if (!stat6?.isFile()) continue;
23217
23234
  found.set(name, `${found.get(name) ?? ""}${stat6.ino}:${stat6.mtimeMs};`);
23218
23235
  }
@@ -23230,7 +23247,7 @@ function pruneLegacySkillDirs(projectRoot, scope, bundled = new Set(listBundledS
23230
23247
  const removed = /* @__PURE__ */ new Set();
23231
23248
  for (const { targetPath } of skillTargets) {
23232
23249
  for (const name of legacy) {
23233
- const dir = path24.join(targetPath, name);
23250
+ const dir = path25.join(targetPath, name);
23234
23251
  try {
23235
23252
  if (removePath(dir)) removed.add(name);
23236
23253
  } catch {
@@ -23250,13 +23267,13 @@ function listTrackedLegacySkills(projectRoot, scope, bundled = new Set(listBundl
23250
23267
  }
23251
23268
  function removeLockEntries(lockPath, names) {
23252
23269
  try {
23253
- const lock = JSON.parse(fs22.readFileSync(lockPath, "utf8"));
23270
+ const lock = JSON.parse(fs23.readFileSync(lockPath, "utf8"));
23254
23271
  const skills = lock.skills;
23255
23272
  if (!skills) return [];
23256
23273
  const removed = names.filter((name) => name in skills);
23257
23274
  if (removed.length === 0) return [];
23258
23275
  for (const name of removed) delete skills[name];
23259
- fs22.writeFileSync(lockPath, JSON.stringify(lock, null, 2) + "\n");
23276
+ fs23.writeFileSync(lockPath, JSON.stringify(lock, null, 2) + "\n");
23260
23277
  return removed;
23261
23278
  } catch {
23262
23279
  return [];
@@ -23327,7 +23344,7 @@ async function runInstall(args) {
23327
23344
  return runGlobal({ fromTar, nonInteractive, version: args.version, tel });
23328
23345
  }
23329
23346
  function installSpec(fromTar) {
23330
- return fs23.existsSync(fromTar) ? path25.resolve(fromTar) : fromTar;
23347
+ return fs24.existsSync(fromTar) ? path26.resolve(fromTar) : fromTar;
23331
23348
  }
23332
23349
  async function installLocally(opts) {
23333
23350
  const { fromTar, tel } = opts;
@@ -23978,8 +23995,8 @@ async function configureAllowlist(args) {
23978
23995
  // ../argent-installer/src/init-skills.ts
23979
23996
  var import_picocolors10 = __toESM(require_picocolors(), 1);
23980
23997
  import { spawn as spawn3 } from "node:child_process";
23981
- import * as os4 from "node:os";
23982
- import * as path26 from "node:path";
23998
+ import * as os5 from "node:os";
23999
+ import * as path27 from "node:path";
23983
24000
  var REF_MISSING = /Remote branch .* not found in upstream|couldn't find remote ref|unknown revision/i;
23984
24001
  function meaningfulLine(err) {
23985
24002
  const lines = (err instanceof Error ? err.message : String(err)).split("\n").map((l2) => l2.replace(/^[│┌└■◇\s]+/, "").trim()).filter((l2) => l2 && !/^npm (warn|notice)/i.test(l2));
@@ -23987,10 +24004,10 @@ function meaningfulLine(err) {
23987
24004
  }
23988
24005
  function bundledCopyFor(version) {
23989
24006
  const local = probeLocalInstall(resolveProjectRoot2(process.cwd()));
23990
- if (local.packageDir && local.version === version) return path26.join(local.packageDir, "skills");
24007
+ if (local.packageDir && local.version === version) return path27.join(local.packageDir, "skills");
23991
24008
  const globalRoot = getGloballyInstalledPackageRoot();
23992
24009
  if (globalRoot && getGloballyInstalledVersion() === version) {
23993
- return path26.join(globalRoot, "skills");
24010
+ return path27.join(globalRoot, "skills");
23994
24011
  }
23995
24012
  return SKILLS_DIR;
23996
24013
  }
@@ -24095,7 +24112,7 @@ async function runSkillsStep(args) {
24095
24112
  const useGitHubSource = online && !fromTar && version !== "unknown";
24096
24113
  const skillsSource = useGitHubSource ? buildArgentSkillsSource(version) : SKILLS_DIR;
24097
24114
  const bundledCopy = useGitHubSource ? bundledCopyFor(version) : SKILLS_DIR;
24098
- const skillsRoot = scope === "global" ? os4.homedir() : effectiveRoot;
24115
+ const skillsRoot = scope === "global" ? os5.homedir() : effectiveRoot;
24099
24116
  const skillsScope = scope === "global" ? "global" : "project";
24100
24117
  const expected = listBundledSkills(bundledCopy);
24101
24118
  const snapshot = () => snapshotArgentSkills(skillsRoot, skillsScope, expected);
@@ -24557,9 +24574,9 @@ function printBanner() {
24557
24574
  // ../argent-installer/src/update.ts
24558
24575
  var import_picocolors12 = __toESM(require_picocolors(), 1);
24559
24576
  var import_semver5 = __toESM(require_semver2(), 1);
24560
- import * as fs25 from "node:fs";
24561
- import * as os6 from "node:os";
24562
- import * as path32 from "node:path";
24577
+ import * as fs26 from "node:fs";
24578
+ import * as os7 from "node:os";
24579
+ import * as path33 from "node:path";
24563
24580
 
24564
24581
  // ../argent-installer/src/install-targets.ts
24565
24582
  function parseTargetFlags(args) {
@@ -24631,17 +24648,17 @@ async function resolveInstallableUpdateTarget(pm, current, cwd, candidate) {
24631
24648
 
24632
24649
  // ../argent-tools-client/src/launcher.ts
24633
24650
  import * as net from "node:net";
24634
- import * as os5 from "node:os";
24635
- import * as fs24 from "node:fs";
24636
- import * as path27 from "node:path";
24651
+ import * as os6 from "node:os";
24652
+ import * as fs25 from "node:fs";
24653
+ import * as path28 from "node:path";
24637
24654
  import * as readline from "node:readline";
24638
24655
  import { spawn as spawn4, execFileSync as execFileSync9 } from "node:child_process";
24639
24656
  import { createHash as createHash3, randomBytes } from "node:crypto";
24640
24657
  import { readFile, readdir as readdir2, unlink } from "node:fs/promises";
24641
24658
  var STATE_DIR = argentHomeDir();
24642
- var STATE_FILE = path27.join(STATE_DIR, "tool-server.json");
24643
- var LOG_FILE = path27.join(STATE_DIR, "tool-server.log");
24644
- var LOCK_FILE = path27.join(STATE_DIR, "tool-server.lock");
24659
+ var STATE_FILE = path28.join(STATE_DIR, "tool-server.json");
24660
+ var LOG_FILE = path28.join(STATE_DIR, "tool-server.log");
24661
+ var LOCK_FILE = path28.join(STATE_DIR, "tool-server.lock");
24645
24662
  function isProcessAlive(pid) {
24646
24663
  try {
24647
24664
  process.kill(pid, 0);
@@ -24650,9 +24667,10 @@ function isProcessAlive(pid) {
24650
24667
  return false;
24651
24668
  }
24652
24669
  }
24653
- function stateFileForBundle(bundlePath) {
24670
+ function stateFileForBundle(bundlePath, cloudProfile) {
24654
24671
  const key = createHash3("sha256").update(bundlePath).digest("hex").slice(0, 12);
24655
- return path27.join(STATE_DIR, `tool-server-${key}.json`);
24672
+ const profile = cloudProfile ? `-cloud-${cloudProfile}` : "";
24673
+ return path28.join(STATE_DIR, `tool-server-${key}${profile}.json`);
24656
24674
  }
24657
24675
  async function readStateFile(file) {
24658
24676
  try {
@@ -24662,16 +24680,22 @@ async function readStateFile(file) {
24662
24680
  return null;
24663
24681
  }
24664
24682
  }
24665
- async function readToolsServerState(bundlePath) {
24683
+ async function readToolsServerState(bundlePath, cloudProfile) {
24666
24684
  if (bundlePath === void 0) return readStateFile(STATE_FILE);
24685
+ if (cloudProfile) {
24686
+ const own2 = await readStateFile(stateFileForBundle(bundlePath, cloudProfile));
24687
+ return own2?.cloudProfile === cloudProfile ? own2 : null;
24688
+ }
24667
24689
  const own = await readStateFile(stateFileForBundle(bundlePath));
24668
24690
  if (own) return own;
24669
24691
  const legacy = await readStateFile(STATE_FILE);
24670
24692
  return legacy && legacy.bundlePath === bundlePath ? legacy : null;
24671
24693
  }
24672
- async function clearToolsServerState(bundlePath) {
24694
+ async function clearToolsServerState(bundlePath, cloudProfile) {
24673
24695
  const files = [STATE_FILE];
24674
- if (bundlePath !== void 0) {
24696
+ if (bundlePath !== void 0 && cloudProfile) {
24697
+ files[0] = stateFileForBundle(bundlePath, cloudProfile);
24698
+ } else if (bundlePath !== void 0) {
24675
24699
  files[0] = stateFileForBundle(bundlePath);
24676
24700
  const legacy = await readStateFile(STATE_FILE);
24677
24701
  if (legacy && legacy.bundlePath === bundlePath) files.push(STATE_FILE);
@@ -24683,7 +24707,7 @@ async function clearToolsServerState(bundlePath) {
24683
24707
  }
24684
24708
  }
24685
24709
  }
24686
- var STATE_FILE_RE = /^tool-server(-[0-9a-f]{12})?\.json$/;
24710
+ var STATE_FILE_RE = /^tool-server(-[0-9a-f]{12}(-cloud-[0-9a-f]{12})?)?\.json$/;
24687
24711
  async function readAllToolsServerStates() {
24688
24712
  let names;
24689
24713
  try {
@@ -24694,7 +24718,7 @@ async function readAllToolsServerStates() {
24694
24718
  const out = [];
24695
24719
  for (const name of names) {
24696
24720
  if (!STATE_FILE_RE.test(name)) continue;
24697
- const file = path27.join(STATE_DIR, name);
24721
+ const file = path28.join(STATE_DIR, name);
24698
24722
  const state2 = await readStateFile(file);
24699
24723
  if (state2) out.push({ file, state: state2 });
24700
24724
  }
@@ -24729,32 +24753,32 @@ async function terminatePid(pid, stillOurs) {
24729
24753
  }
24730
24754
  await waitForExit(pid, SIGKILL_GRACE_MS);
24731
24755
  }
24732
- async function killToolServer(bundlePath) {
24733
- const state2 = await readState(bundlePath);
24756
+ async function killToolServer(bundlePath, cloudProfile) {
24757
+ const state2 = await readState(bundlePath, cloudProfile);
24734
24758
  if (!state2) return false;
24735
24759
  const stillOurs = () => couldBeOurToolServer(state2.pid, state2.bundlePath);
24736
24760
  const alive = isProcessAlive(state2.pid);
24737
24761
  if (alive && !stillOurs()) return false;
24738
24762
  if (alive) await terminatePid(state2.pid, stillOurs);
24739
- await clearToolsServerState(bundlePath ?? state2.bundlePath);
24763
+ await clearToolsServerState(bundlePath ?? state2.bundlePath, cloudProfile);
24740
24764
  return alive;
24741
24765
  }
24742
24766
  function isPathWithin(child, parent) {
24743
- const rel = path27.relative(parent, child);
24744
- return rel !== "" && !rel.startsWith("..") && !path27.isAbsolute(rel);
24767
+ const rel = path28.relative(parent, child);
24768
+ return rel !== "" && !rel.startsWith("..") && !path28.isAbsolute(rel);
24745
24769
  }
24746
24770
  function tryRealpath(p) {
24747
24771
  try {
24748
- return fs24.realpathSync(p);
24772
+ return fs25.realpathSync(p);
24749
24773
  } catch {
24750
24774
  return p;
24751
24775
  }
24752
24776
  }
24753
24777
  async function killToolServerForInstallDir(packageDir) {
24754
- const parents = /* @__PURE__ */ new Set([path27.resolve(packageDir), tryRealpath(packageDir)]);
24778
+ const parents = /* @__PURE__ */ new Set([path28.resolve(packageDir), tryRealpath(packageDir)]);
24755
24779
  let killed = 0;
24756
24780
  for (const { file, state: state2 } of await readAllToolsServerStates()) {
24757
- const bundles = /* @__PURE__ */ new Set([path27.resolve(state2.bundlePath), tryRealpath(state2.bundlePath)]);
24781
+ const bundles = /* @__PURE__ */ new Set([path28.resolve(state2.bundlePath), tryRealpath(state2.bundlePath)]);
24758
24782
  const matches2 = [...bundles].some((b) => [...parents].some((p) => isPathWithin(b, p)));
24759
24783
  if (!matches2) continue;
24760
24784
  const fresh = await readStateFile(file);
@@ -24772,7 +24796,7 @@ async function killToolServerForInstallDir(packageDir) {
24772
24796
  }
24773
24797
  return killed;
24774
24798
  }
24775
- var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs24.existsSync(p)) ?? "ps";
24799
+ var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs25.existsSync(p)) ?? "ps";
24776
24800
  var PS_WIDTH_FLAGS = ["-ww"];
24777
24801
  var PS_LOCALE = process.platform === "darwin" ? "en_US.UTF-8" : "C.UTF-8";
24778
24802
  function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS, env = { ...process.env, LC_ALL: PS_LOCALE }) {
@@ -24819,13 +24843,13 @@ function couldBeOurToolServer(pid, marker) {
24819
24843
  var import_yaml4 = __toESM(require_dist2(), 1);
24820
24844
  import { readFile as readFile5 } from "node:fs/promises";
24821
24845
  import { maxHeaderSize } from "node:http";
24822
- import * as path31 from "node:path";
24846
+ import * as path32 from "node:path";
24823
24847
 
24824
24848
  // ../argent-tools-client/src/link-config.ts
24825
- import * as path28 from "node:path";
24849
+ import * as path29 from "node:path";
24826
24850
  import { mkdir, writeFile, readFile as readFile2, unlink as unlink2, chmod } from "node:fs/promises";
24827
24851
  var LINK_DIR = argentHomeDir();
24828
- var LINK_FILE = path28.join(LINK_DIR, "link.json");
24852
+ var LINK_FILE = path29.join(LINK_DIR, "link.json");
24829
24853
 
24830
24854
  // ../argent-tools-client/src/file-inputs.ts
24831
24855
  import { createHash as createHash4, randomUUID as randomUUID6 } from "node:crypto";
@@ -24842,14 +24866,14 @@ import {
24842
24866
  writeFile as writeFile2
24843
24867
  } from "node:fs/promises";
24844
24868
  import { constants as constants3, tmpdir } from "node:os";
24845
- import * as path29 from "node:path";
24869
+ import * as path30 from "node:path";
24846
24870
 
24847
24871
  // ../archive/src/index.ts
24848
24872
  import { spawn as spawn5 } from "node:child_process";
24849
24873
  import { once } from "node:events";
24850
24874
  import { createReadStream, createWriteStream } from "node:fs";
24851
24875
  import { open, rm, readdir as readdir3 } from "node:fs/promises";
24852
- import { basename as basename5, dirname as dirname14, join as join27, resolve as resolve17, sep as sep4 } from "node:path";
24876
+ import { basename as basename5, dirname as dirname15, join as join28, resolve as resolve17, sep as sep4 } from "node:path";
24853
24877
  import { Writable } from "node:stream";
24854
24878
  import { pipeline } from "node:stream/promises";
24855
24879
  import zlib2 from "node:zlib";
@@ -24867,14 +24891,14 @@ var MAX_CONTENT_BYTES = 32 * 1024 * 1024;
24867
24891
  // ../argent-tools-client/src/flow-files.ts
24868
24892
  var import_yaml3 = __toESM(require_dist2(), 1);
24869
24893
  import { readdir as readdir4, readFile as readFile4, realpath as realpath3, stat as stat4 } from "node:fs/promises";
24870
- import * as path30 from "node:path";
24894
+ import * as path31 from "node:path";
24871
24895
  var INLINE_MEMBERS_BYTES = 256 * 1024;
24872
24896
 
24873
24897
  // ../argent-tools-client/src/tools-client.ts
24874
24898
  var RECORDING_FILE_INPUT = {
24875
24899
  target: "__recording",
24876
- path: `\${project_root}/${E2E_DIRS[0].split(path31.sep).join("/")}/\${name}.yaml`,
24877
- paths: E2E_DIRS.map((dir) => `\${project_root}/${dir.split(path31.sep).join("/")}/\${name}.yaml`),
24900
+ path: `\${project_root}/${E2E_DIRS[0].split(path32.sep).join("/")}/\${name}.yaml`,
24901
+ paths: E2E_DIRS.map((dir) => `\${project_root}/${dir.split(path32.sep).join("/")}/\${name}.yaml`),
24878
24902
  kind: "file",
24879
24903
  optional: true,
24880
24904
  collect: "flow"
@@ -24893,7 +24917,7 @@ import {
24893
24917
  } from "node:fs/promises";
24894
24918
  import { constants as fsConstants } from "node:fs";
24895
24919
  import { tmpdir as tmpdir2 } from "node:os";
24896
- import { basename as basename8, extname as extname2, isAbsolute as isAbsolute10, join as join31, normalize as normalize2, resolve as resolve20, sep as sep8 } from "node:path";
24920
+ import { basename as basename8, extname as extname2, isAbsolute as isAbsolute10, join as join32, normalize as normalize2, resolve as resolve20, sep as sep8 } from "node:path";
24897
24921
  import { createHash as createHash5 } from "node:crypto";
24898
24922
  var ALLOWED_SAVE_DIRS = /* @__PURE__ */ new Set([normalize2(".argent/recordings")]);
24899
24923
  var RECORDINGS_SAVE_DIR = normalize2(".argent/recordings");
@@ -24968,7 +24992,7 @@ function resolveUpdatePackageAction(trigger, installed) {
24968
24992
  return installed ? "standalone_update" : "standalone_install";
24969
24993
  }
24970
24994
  function isLivePinnedEntry(entry) {
24971
- return entry !== null && isPinnedGlobalEntry(entry) && fs25.existsSync(entry.command) && fs25.existsSync(entry.args[0]);
24995
+ return entry !== null && isPinnedGlobalEntry(entry) && fs26.existsSync(entry.command) && fs26.existsSync(entry.args[0]);
24972
24996
  }
24973
24997
  async function refreshConfiguration({
24974
24998
  projectRoot,
@@ -25200,7 +25224,7 @@ async function update(args) {
25200
25224
  const pm = mode === "local" ? detectProjectPackageManager(projectRoot) : detectGlobalPackageManager();
25201
25225
  if (automatic) {
25202
25226
  const globalRoot = getGloballyInstalledPackageRoot();
25203
- if (!globallyInstalled || !globalRoot || fs25.realpathSync(globalRoot) !== projectRoot || !isAutoUpdateEnabled() || !ownsGlobalInstall(pm, projectRoot)) {
25227
+ if (!globallyInstalled || !globalRoot || fs26.realpathSync(globalRoot) !== projectRoot || !isAutoUpdateEnabled() || !ownsGlobalInstall(pm, projectRoot)) {
25204
25228
  spinner2.stop("Could not confirm an automatic update for this installation.");
25205
25229
  return "noop";
25206
25230
  }
@@ -25401,7 +25425,7 @@ async function update(args) {
25401
25425
  process.exit(1);
25402
25426
  }
25403
25427
  if (automatic) {
25404
- const runningRoot = fs25.realpathSync(resolvePackageRoot(import.meta.dirname));
25428
+ const runningRoot = fs26.realpathSync(resolvePackageRoot(import.meta.dirname));
25405
25429
  const result = requestedVersion ? await applyUpdateForTarget("global", runningRoot) : "noop";
25406
25430
  if (result === "updated" && requestedVersion) {
25407
25431
  writeCliRecord({
@@ -25410,7 +25434,7 @@ async function update(args) {
25410
25434
  version: getGloballyInstalledVersion() ?? requestedVersion
25411
25435
  });
25412
25436
  await refreshConfiguration({
25413
- projectRoot: os6.homedir(),
25437
+ projectRoot: os7.homedir(),
25414
25438
  installMode: "global",
25415
25439
  nonInteractive: true,
25416
25440
  globalOnly: true
@@ -25424,7 +25448,7 @@ async function update(args) {
25424
25448
  return;
25425
25449
  }
25426
25450
  const rootOverride = getProjectRootOverride(args);
25427
- const projectRoot = rootOverride ? path32.resolve(rootOverride) : resolveProjectRoot2(process.cwd());
25451
+ const projectRoot = rootOverride ? path33.resolve(rootOverride) : resolveProjectRoot2(process.cwd());
25428
25452
  installMode = resolveInstallMode(projectRoot);
25429
25453
  const flags = parseTargetFlags(args);
25430
25454
  const localInstalled = installMode === "local" && probeLocalInstall(projectRoot).installed;
@@ -25504,8 +25528,8 @@ async function update(args) {
25504
25528
  // ../argent-installer/src/uninstall.ts
25505
25529
  var import_picocolors13 = __toESM(require_picocolors(), 1);
25506
25530
  var import_yaml5 = __toESM(require_dist2(), 1);
25507
- import * as fs26 from "node:fs";
25508
- import * as path33 from "node:path";
25531
+ import * as fs27 from "node:fs";
25532
+ import * as path34 from "node:path";
25509
25533
  var UNINSTALL_TOOLSERVER_STOP_FAILED = {
25510
25534
  error_code: FAILURE_CODES.UNINSTALL_TOOLSERVER_STOP_FAILED,
25511
25535
  failure_stage: "installer_uninstall_toolserver_stop",
@@ -25526,10 +25550,10 @@ var UNINSTALL_UNCLASSIFIED_FAILED = {
25526
25550
  };
25527
25551
  function removeDirIfEmpty2(dirPath) {
25528
25552
  try {
25529
- if (!fs26.existsSync(dirPath)) return false;
25530
- if (!fs26.statSync(dirPath).isDirectory()) return false;
25531
- if (fs26.readdirSync(dirPath).length > 0) return false;
25532
- fs26.rmdirSync(dirPath);
25553
+ if (!fs27.existsSync(dirPath)) return false;
25554
+ if (!fs27.statSync(dirPath).isDirectory()) return false;
25555
+ if (fs27.readdirSync(dirPath).length > 0) return false;
25556
+ fs27.rmdirSync(dirPath);
25533
25557
  return true;
25534
25558
  } catch {
25535
25559
  return false;
@@ -25539,9 +25563,9 @@ function collectBundledPaths(sourceDir) {
25539
25563
  const files = [];
25540
25564
  const directories = [];
25541
25565
  function walk(currentDir, relativeDir = "") {
25542
- for (const entry of fs26.readdirSync(currentDir, { withFileTypes: true })) {
25543
- const relativePath = relativeDir ? path33.join(relativeDir, entry.name) : entry.name;
25544
- const absolutePath = path33.join(currentDir, entry.name);
25566
+ for (const entry of fs27.readdirSync(currentDir, { withFileTypes: true })) {
25567
+ const relativePath = relativeDir ? path34.join(relativeDir, entry.name) : entry.name;
25568
+ const absolutePath = path34.join(currentDir, entry.name);
25545
25569
  if (entry.isDirectory()) {
25546
25570
  walk(absolutePath, relativePath);
25547
25571
  directories.push(relativePath);
@@ -25554,15 +25578,15 @@ function collectBundledPaths(sourceDir) {
25554
25578
  return { files, directories };
25555
25579
  }
25556
25580
  function removeBundledContent(sourceDir, targetDir) {
25557
- if (!fs26.existsSync(sourceDir) || !fs26.existsSync(targetDir)) {
25581
+ if (!fs27.existsSync(sourceDir) || !fs27.existsSync(targetDir)) {
25558
25582
  return { removedPaths: [], removedRoot: false };
25559
25583
  }
25560
25584
  const { files, directories } = collectBundledPaths(sourceDir);
25561
25585
  const removedPaths = [];
25562
25586
  for (const relativePath of files) {
25563
- const targetPath = path33.join(targetDir, relativePath);
25587
+ const targetPath = path34.join(targetDir, relativePath);
25564
25588
  try {
25565
- const entry = fs26.lstatSync(targetPath, { throwIfNoEntry: false });
25589
+ const entry = fs27.lstatSync(targetPath, { throwIfNoEntry: false });
25566
25590
  if (!entry || entry.isDirectory()) continue;
25567
25591
  removePath(targetPath);
25568
25592
  removedPaths.push(relativePath);
@@ -25570,36 +25594,36 @@ function removeBundledContent(sourceDir, targetDir) {
25570
25594
  }
25571
25595
  }
25572
25596
  directories.sort(
25573
- (a2, b) => b.split(path33.sep).length - a2.split(path33.sep).length || b.length - a2.length
25597
+ (a2, b) => b.split(path34.sep).length - a2.split(path34.sep).length || b.length - a2.length
25574
25598
  );
25575
25599
  for (const relativePath of directories) {
25576
- const targetPath = path33.join(targetDir, relativePath);
25600
+ const targetPath = path34.join(targetDir, relativePath);
25577
25601
  try {
25578
- if (!fs26.existsSync(targetPath)) continue;
25579
- if (!fs26.statSync(targetPath).isDirectory()) continue;
25580
- if (fs26.readdirSync(targetPath).length > 0) continue;
25581
- fs26.rmdirSync(targetPath);
25602
+ if (!fs27.existsSync(targetPath)) continue;
25603
+ if (!fs27.statSync(targetPath).isDirectory()) continue;
25604
+ if (fs27.readdirSync(targetPath).length > 0) continue;
25605
+ fs27.rmdirSync(targetPath);
25582
25606
  } catch {
25583
25607
  }
25584
25608
  }
25585
25609
  let removedRoot = false;
25586
25610
  try {
25587
- if (fs26.existsSync(targetDir) && fs26.statSync(targetDir).isDirectory()) {
25588
- if (fs26.readdirSync(targetDir).length === 0) {
25589
- fs26.rmdirSync(targetDir);
25611
+ if (fs27.existsSync(targetDir) && fs27.statSync(targetDir).isDirectory()) {
25612
+ if (fs27.readdirSync(targetDir).length === 0) {
25613
+ fs27.rmdirSync(targetDir);
25590
25614
  removedRoot = true;
25591
25615
  }
25592
25616
  }
25593
25617
  } catch {
25594
25618
  }
25595
25619
  if (removedRoot) {
25596
- removeDirIfEmpty2(path33.dirname(targetDir));
25620
+ removeDirIfEmpty2(path34.dirname(targetDir));
25597
25621
  }
25598
25622
  return { removedPaths, removedRoot };
25599
25623
  }
25600
25624
  function readBundledSkillName(skillFilePath, fallbackName) {
25601
25625
  try {
25602
- const content = fs26.readFileSync(skillFilePath, "utf8");
25626
+ const content = fs27.readFileSync(skillFilePath, "utf8");
25603
25627
  const frontmatter = content.match(/^---\r?\n([\s\S]*?)\r?\n---/)?.[1];
25604
25628
  if (!frontmatter) return fallbackName;
25605
25629
  const data = (0, import_yaml5.parse)(frontmatter);
@@ -25610,23 +25634,23 @@ function readBundledSkillName(skillFilePath, fallbackName) {
25610
25634
  }
25611
25635
  }
25612
25636
  function getBundledSkillNames(skillsDir) {
25613
- if (!fs26.existsSync(skillsDir)) return [];
25637
+ if (!fs27.existsSync(skillsDir)) return [];
25614
25638
  const skillNames = [];
25615
- for (const entry of fs26.readdirSync(skillsDir, { withFileTypes: true })) {
25639
+ for (const entry of fs27.readdirSync(skillsDir, { withFileTypes: true })) {
25616
25640
  if (!entry.isDirectory()) continue;
25617
- const skillFilePath = path33.join(skillsDir, entry.name, "SKILL.md");
25618
- if (!fs26.existsSync(skillFilePath)) continue;
25641
+ const skillFilePath = path34.join(skillsDir, entry.name, "SKILL.md");
25642
+ if (!fs27.existsSync(skillFilePath)) continue;
25619
25643
  skillNames.push(readBundledSkillName(skillFilePath, entry.name));
25620
25644
  }
25621
25645
  return [...new Set(skillNames)].sort();
25622
25646
  }
25623
25647
  function removeBundledSkillInstalls(skillNames, targetDir) {
25624
- if (!fs26.existsSync(targetDir)) {
25648
+ if (!fs27.existsSync(targetDir)) {
25625
25649
  return { removedPaths: [], removedRoot: false };
25626
25650
  }
25627
25651
  const removedPaths = [];
25628
25652
  for (const skillName of skillNames) {
25629
- const targetPath = path33.join(targetDir, skillName);
25653
+ const targetPath = path34.join(targetDir, skillName);
25630
25654
  try {
25631
25655
  if (removePath(targetPath)) removedPaths.push(skillName);
25632
25656
  } catch {
@@ -25634,17 +25658,17 @@ function removeBundledSkillInstalls(skillNames, targetDir) {
25634
25658
  }
25635
25659
  const removedRoot = removeDirIfEmpty2(targetDir);
25636
25660
  if (removedRoot) {
25637
- removeDirIfEmpty2(path33.dirname(targetDir));
25661
+ removeDirIfEmpty2(path34.dirname(targetDir));
25638
25662
  }
25639
25663
  return { removedPaths, removedRoot };
25640
25664
  }
25641
25665
  function cleanupSkillsLockFile(lockPath, skillNames) {
25642
- if (!fs26.existsSync(lockPath)) {
25666
+ if (!fs27.existsSync(lockPath)) {
25643
25667
  return { removedSkills: [], removedFile: false };
25644
25668
  }
25645
25669
  let parsed;
25646
25670
  try {
25647
- parsed = JSON.parse(fs26.readFileSync(lockPath, "utf8"));
25671
+ parsed = JSON.parse(fs27.readFileSync(lockPath, "utf8"));
25648
25672
  } catch {
25649
25673
  return { removedSkills: [], removedFile: false };
25650
25674
  }
@@ -25671,10 +25695,10 @@ function cleanupSkillsLockFile(lockPath, skillNames) {
25671
25695
  parsed.skills && typeof parsed.skills === "object" && Object.keys(parsed.skills).length > 0
25672
25696
  );
25673
25697
  if (!hasSkills && otherKeys.length === 0) {
25674
- fs26.rmSync(lockPath, { force: true });
25698
+ fs27.rmSync(lockPath, { force: true });
25675
25699
  return { removedSkills, removedFile: true };
25676
25700
  }
25677
- fs26.writeFileSync(lockPath, JSON.stringify(parsed, null, 2) + "\n");
25701
+ fs27.writeFileSync(lockPath, JSON.stringify(parsed, null, 2) + "\n");
25678
25702
  return { removedSkills, removedFile: false };
25679
25703
  }
25680
25704
  function cleanupBundledSkills(skillNames, targets) {
@@ -25877,7 +25901,7 @@ async function uninstall(args) {
25877
25901
  ),
25878
25902
  { ask: false }
25879
25903
  );
25880
- for (const root of retired.removedRoots) removeDirIfEmpty2(path33.dirname(root));
25904
+ for (const root of retired.removedRoots) removeDirIfEmpty2(path34.dirname(root));
25881
25905
  const retiredLines = formatRetiredCleanup(retired);
25882
25906
  pruneResults.push(...retiredLines.removed.map((line) => `${import_picocolors13.default.green("+")} ${line}`));
25883
25907
  const retiredKept = retiredLines.kept.map((line) => ` ${line}`);
@@ -25996,7 +26020,7 @@ async function uninstall(args) {
25996
26020
  try {
25997
26021
  execShellCommandSync(removable.cmd, { cwd: removable.cwd, env: removable.env });
25998
26022
  const leftover = removable.kind === "global" ? getRemainingGlobalBinaryPath() : null;
25999
- const removed = !leftover || removable.installDir !== null && !fs26.existsSync(removable.installDir);
26023
+ const removed = !leftover || removable.installDir !== null && !fs27.existsSync(removable.installDir);
26000
26024
  if (removed) hasUninstalledPackage = true;
26001
26025
  if (removed && removeCliRecordFor(removable.installDir)) {
26002
26026
  log.info(import_picocolors13.default.dim(`Removed ${cliRecordPath()} (provider CLI discovery record).`));