@swmansion/argent 0.29.1-next.21 → 0.29.1-next.22

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, path26) {
3656
- const ctrl = callVisitor(key, node, visitor, path26);
3655
+ function visit_(key, node, visitor, path28) {
3656
+ const ctrl = callVisitor(key, node, visitor, path28);
3657
3657
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
3658
- replaceNode(key, path26, ctrl);
3659
- return visit_(key, ctrl, visitor, path26);
3658
+ replaceNode(key, path28, ctrl);
3659
+ return visit_(key, ctrl, visitor, path28);
3660
3660
  }
3661
3661
  if (typeof ctrl !== "symbol") {
3662
3662
  if (identity2.isCollection(node)) {
3663
- path26 = Object.freeze(path26.concat(node));
3663
+ path28 = Object.freeze(path28.concat(node));
3664
3664
  for (let i2 = 0; i2 < node.items.length; ++i2) {
3665
- const ci = visit_(i2, node.items[i2], visitor, path26);
3665
+ const ci = visit_(i2, node.items[i2], visitor, path28);
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
- path26 = Object.freeze(path26.concat(node));
3677
- const ck = visit_("key", node.key, visitor, path26);
3676
+ path28 = Object.freeze(path28.concat(node));
3677
+ const ck = visit_("key", node.key, visitor, path28);
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, path26);
3682
+ const cv = visit_("value", node.value, visitor, path28);
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, path26) {
3704
- const ctrl = await callVisitor(key, node, visitor, path26);
3703
+ async function visitAsync_(key, node, visitor, path28) {
3704
+ const ctrl = await callVisitor(key, node, visitor, path28);
3705
3705
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
3706
- replaceNode(key, path26, ctrl);
3707
- return visitAsync_(key, ctrl, visitor, path26);
3706
+ replaceNode(key, path28, ctrl);
3707
+ return visitAsync_(key, ctrl, visitor, path28);
3708
3708
  }
3709
3709
  if (typeof ctrl !== "symbol") {
3710
3710
  if (identity2.isCollection(node)) {
3711
- path26 = Object.freeze(path26.concat(node));
3711
+ path28 = Object.freeze(path28.concat(node));
3712
3712
  for (let i2 = 0; i2 < node.items.length; ++i2) {
3713
- const ci = await visitAsync_(i2, node.items[i2], visitor, path26);
3713
+ const ci = await visitAsync_(i2, node.items[i2], visitor, path28);
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
- path26 = Object.freeze(path26.concat(node));
3725
- const ck = await visitAsync_("key", node.key, visitor, path26);
3724
+ path28 = Object.freeze(path28.concat(node));
3725
+ const ck = await visitAsync_("key", node.key, visitor, path28);
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, path26);
3730
+ const cv = await visitAsync_("value", node.value, visitor, path28);
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, path26) {
3757
+ function callVisitor(key, node, visitor, path28) {
3758
3758
  if (typeof visitor === "function")
3759
- return visitor(key, node, path26);
3759
+ return visitor(key, node, path28);
3760
3760
  if (identity2.isMap(node))
3761
- return visitor.Map?.(key, node, path26);
3761
+ return visitor.Map?.(key, node, path28);
3762
3762
  if (identity2.isSeq(node))
3763
- return visitor.Seq?.(key, node, path26);
3763
+ return visitor.Seq?.(key, node, path28);
3764
3764
  if (identity2.isPair(node))
3765
- return visitor.Pair?.(key, node, path26);
3765
+ return visitor.Pair?.(key, node, path28);
3766
3766
  if (identity2.isScalar(node))
3767
- return visitor.Scalar?.(key, node, path26);
3767
+ return visitor.Scalar?.(key, node, path28);
3768
3768
  if (identity2.isAlias(node))
3769
- return visitor.Alias?.(key, node, path26);
3769
+ return visitor.Alias?.(key, node, path28);
3770
3770
  return void 0;
3771
3771
  }
3772
- function replaceNode(key, path26, node) {
3773
- const parent = path26[path26.length - 1];
3772
+ function replaceNode(key, path28, node) {
3773
+ const parent = path28[path28.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, path26, value) {
4385
+ function collectionFromPath(schema, path28, value) {
4386
4386
  let v = value;
4387
- for (let i2 = path26.length - 1; i2 >= 0; --i2) {
4388
- const k = path26[i2];
4387
+ for (let i2 = path28.length - 1; i2 >= 0; --i2) {
4388
+ const k = path28[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 = (path26) => path26 == null || typeof path26 === "object" && !!path26[Symbol.iterator]().next().done;
4407
+ var isEmptyPath = (path28) => path28 == null || typeof path28 === "object" && !!path28[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(path26, value) {
4438
- if (isEmptyPath(path26))
4437
+ addIn(path28, value) {
4438
+ if (isEmptyPath(path28))
4439
4439
  this.add(value);
4440
4440
  else {
4441
- const [key, ...rest] = path26;
4441
+ const [key, ...rest] = path28;
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(path26) {
4456
- const [key, ...rest] = path26;
4455
+ deleteIn(path28) {
4456
+ const [key, ...rest] = path28;
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(path26, keepScalar) {
4471
- const [key, ...rest] = path26;
4470
+ getIn(path28, keepScalar) {
4471
+ const [key, ...rest] = path28;
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(path26) {
4490
- const [key, ...rest] = path26;
4489
+ hasIn(path28) {
4490
+ const [key, ...rest] = path28;
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(path26, value) {
4501
- const [key, ...rest] = path26;
4500
+ setIn(path28, value) {
4501
+ const [key, ...rest] = path28;
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(path26, value) {
7016
+ addIn(path28, value) {
7017
7017
  if (assertCollection(this.contents))
7018
- this.contents.addIn(path26, value);
7018
+ this.contents.addIn(path28, 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(path26) {
7094
- if (Collection.isEmptyPath(path26)) {
7093
+ deleteIn(path28) {
7094
+ if (Collection.isEmptyPath(path28)) {
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(path26) : false;
7100
+ return assertCollection(this.contents) ? this.contents.deleteIn(path28) : 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(path26, keepScalar) {
7116
- if (Collection.isEmptyPath(path26))
7115
+ getIn(path28, keepScalar) {
7116
+ if (Collection.isEmptyPath(path28))
7117
7117
  return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
7118
- return identity2.isCollection(this.contents) ? this.contents.getIn(path26, keepScalar) : void 0;
7118
+ return identity2.isCollection(this.contents) ? this.contents.getIn(path28, 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(path26) {
7130
- if (Collection.isEmptyPath(path26))
7129
+ hasIn(path28) {
7130
+ if (Collection.isEmptyPath(path28))
7131
7131
  return this.contents !== void 0;
7132
- return identity2.isCollection(this.contents) ? this.contents.hasIn(path26) : false;
7132
+ return identity2.isCollection(this.contents) ? this.contents.hasIn(path28) : 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(path26, value) {
7150
- if (Collection.isEmptyPath(path26)) {
7149
+ setIn(path28, value) {
7150
+ if (Collection.isEmptyPath(path28)) {
7151
7151
  this.contents = value;
7152
7152
  } else if (this.contents == null) {
7153
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path26), value);
7153
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path28), value);
7154
7154
  } else if (assertCollection(this.contents)) {
7155
- this.contents.setIn(path26, value);
7155
+ this.contents.setIn(path28, 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, path26) => {
9116
+ visit2.itemAtPath = (cst, path28) => {
9117
9117
  let item = cst;
9118
- for (const [field, index] of path26) {
9118
+ for (const [field, index] of path28) {
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, path26) => {
9128
- const parent = visit2.itemAtPath(cst, path26.slice(0, -1));
9129
- const field = path26[path26.length - 1][0];
9127
+ visit2.parentCollection = (cst, path28) => {
9128
+ const parent = visit2.itemAtPath(cst, path28.slice(0, -1));
9129
+ const field = path28[path28.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(path26, item, visitor) {
9136
- let ctrl = visitor(item, path26);
9135
+ function _visit(path28, item, visitor) {
9136
+ let ctrl = visitor(item, path28);
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(path26.concat([[field, i2]])), token.items[i2], visitor);
9143
+ const ci = _visit(Object.freeze(path28.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, path26);
9154
+ ctrl = ctrl(item, path28);
9155
9155
  }
9156
9156
  }
9157
- return typeof ctrl === "function" ? ctrl(item, path26) : ctrl;
9157
+ return typeof ctrl === "function" ? ctrl(item, path28) : 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 fs20 = this.flowScalar(this.type);
10459
+ const fs22 = this.flowScalar(this.type);
10460
10460
  if (atNextItem || it.value) {
10461
- map.items.push({ start, key: fs20, sep: [] });
10461
+ map.items.push({ start, key: fs22, sep: [] });
10462
10462
  this.onKeyLine = true;
10463
10463
  } else if (it.sep) {
10464
- this.stack.push(fs20);
10464
+ this.stack.push(fs22);
10465
10465
  } else {
10466
- Object.assign(it, { key: fs20, sep: [] });
10466
+ Object.assign(it, { key: fs22, 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 fs20 = this.flowScalar(this.type);
10594
+ const fs22 = this.flowScalar(this.type);
10595
10595
  if (!it || it.value)
10596
- fc.items.push({ start: [], key: fs20, sep: [] });
10596
+ fc.items.push({ start: [], key: fs22, sep: [] });
10597
10597
  else if (it.sep)
10598
- this.stack.push(fs20);
10598
+ this.stack.push(fs22);
10599
10599
  else
10600
- Object.assign(it, { key: fs20, sep: [] });
10600
+ Object.assign(it, { key: fs22, sep: [] });
10601
10601
  return;
10602
10602
  }
10603
10603
  case "flow-map-end":
@@ -11008,13 +11008,13 @@ var require_min_release_age = __commonJS({
11008
11008
  return Number.isFinite(days) && days > 0 ? days * config_parse_1.DAY_MS : 0;
11009
11009
  }
11010
11010
  function probe(p) {
11011
- return new Promise((resolve16) => {
11011
+ return new Promise((resolve17) => {
11012
11012
  (0, node_child_process_1.exec)(p.command, { timeout: PROBE_TIMEOUT_MS2, windowsHide: true }, (err, stdout2) => {
11013
11013
  if (err) {
11014
- resolve16(0);
11014
+ resolve17(0);
11015
11015
  return;
11016
11016
  }
11017
- resolve16(p.parse(stdout2));
11017
+ resolve17(p.parse(stdout2));
11018
11018
  });
11019
11019
  });
11020
11020
  }
@@ -11047,12 +11047,12 @@ var require_registry = __commonJS({
11047
11047
  var node_https_1 = __importDefault(__require("node:https"));
11048
11048
  var REQUEST_TIMEOUT_MS = 1e4;
11049
11049
  function fetchRegistryInfo2(url) {
11050
- return new Promise((resolve16) => {
11050
+ return new Promise((resolve17) => {
11051
11051
  let resolved = false;
11052
11052
  const safeResolve = (value) => {
11053
11053
  if (!resolved) {
11054
11054
  resolved = true;
11055
- resolve16(value);
11055
+ resolve17(value);
11056
11056
  }
11057
11057
  };
11058
11058
  const req = node_https_1.default.get(url, { timeout: REQUEST_TIMEOUT_MS }, (res) => {
@@ -12992,8 +12992,8 @@ var Deferred = class {
12992
12992
  _resolve;
12993
12993
  _reject;
12994
12994
  constructor() {
12995
- this._promise = new Promise((resolve16, reject) => {
12996
- this._resolve = resolve16;
12995
+ this._promise = new Promise((resolve17, reject) => {
12996
+ this._resolve = resolve17;
12997
12997
  this._reject = reject;
12998
12998
  });
12999
12999
  }
@@ -13886,8 +13886,8 @@ var ExportOperation = class {
13886
13886
  _metrics;
13887
13887
  _exportScheduledResolve;
13888
13888
  constructor(exporter, logRecords, exportTimeoutMillis, metrics) {
13889
- this._exportScheduledPromise = new Promise((resolve16) => {
13890
- this._exportScheduledResolve = resolve16;
13889
+ this._exportScheduledPromise = new Promise((resolve17) => {
13890
+ this._exportScheduledResolve = resolve17;
13891
13891
  });
13892
13892
  this._exportCompleted = this._executeExport(exporter, logRecords, exportTimeoutMillis);
13893
13893
  this._metrics = metrics;
@@ -13912,7 +13912,7 @@ var ExportOperation = class {
13912
13912
  }
13913
13913
  }
13914
13914
  async _exportWithTimeout(exporter, logRecords, exportTimeoutMillis) {
13915
- return new Promise((resolve16, reject) => {
13915
+ return new Promise((resolve17, reject) => {
13916
13916
  const timer = setTimeout(() => {
13917
13917
  reject(new Error("Timeout"));
13918
13918
  }, exportTimeoutMillis);
@@ -13920,7 +13920,7 @@ var ExportOperation = class {
13920
13920
  this._metrics.finishLogs(logRecords.length, result.error);
13921
13921
  clearTimeout(timer);
13922
13922
  if (result.code === ExportResultCode.SUCCESS) {
13923
- resolve16();
13923
+ resolve17();
13924
13924
  } else {
13925
13925
  reject(result.error ?? new Error("BatchLogRecordProcessor: log record export failed"));
13926
13926
  }
@@ -14701,7 +14701,7 @@ function parseRetryAfterToMills(retryAfter) {
14701
14701
  var DEFAULT_USER_AGENT = `OTel-OTLP-Exporter-JavaScript/${VERSION4}`;
14702
14702
  var MAX_RESPONSE_BODY_SIZE = 4 * 1024 * 1024;
14703
14703
  function sendWithHttp(request, url, headers, compression, userAgent, agent, data, timeoutMillis) {
14704
- return new Promise((resolve16) => {
14704
+ return new Promise((resolve17) => {
14705
14705
  const parsedUrl = new URL(url);
14706
14706
  if (userAgent) {
14707
14707
  headers["User-Agent"] = `${userAgent} ${DEFAULT_USER_AGENT}`;
@@ -14720,7 +14720,7 @@ function sendWithHttp(request, url, headers, compression, userAgent, agent, data
14720
14720
  responseSize += chunk.length;
14721
14721
  if (responseSize > MAX_RESPONSE_BODY_SIZE) {
14722
14722
  const sizeError = new Error(`OTLP export response body exceeded size limit of ${MAX_RESPONSE_BODY_SIZE} bytes`);
14723
- resolve16({ status: "failure", error: sizeError });
14723
+ resolve17({ status: "failure", error: sizeError });
14724
14724
  res.destroy();
14725
14725
  return;
14726
14726
  }
@@ -14728,18 +14728,18 @@ function sendWithHttp(request, url, headers, compression, userAgent, agent, data
14728
14728
  });
14729
14729
  res.on("end", () => {
14730
14730
  if (res.statusCode && res.statusCode <= 299) {
14731
- resolve16({
14731
+ resolve17({
14732
14732
  status: "success",
14733
14733
  data: Buffer.concat(responseData)
14734
14734
  });
14735
14735
  } else if (res.statusCode && isExportHTTPErrorRetryable(res.statusCode)) {
14736
- resolve16({
14736
+ resolve17({
14737
14737
  status: "retryable",
14738
14738
  retryInMillis: parseRetryAfterToMills(res.headers["retry-after"])
14739
14739
  });
14740
14740
  } else {
14741
14741
  const error = new OTLPExporterError(res.statusMessage, res.statusCode, Buffer.concat(responseData).toString());
14742
- resolve16({
14742
+ resolve17({
14743
14743
  status: "failure",
14744
14744
  error
14745
14745
  });
@@ -14747,17 +14747,17 @@ function sendWithHttp(request, url, headers, compression, userAgent, agent, data
14747
14747
  });
14748
14748
  res.on("error", (error) => {
14749
14749
  if (res.statusCode && res.statusCode <= 299) {
14750
- resolve16({
14750
+ resolve17({
14751
14751
  status: "success"
14752
14752
  });
14753
14753
  } else if (res.statusCode && isExportHTTPErrorRetryable(res.statusCode)) {
14754
- resolve16({
14754
+ resolve17({
14755
14755
  status: "retryable",
14756
14756
  error,
14757
14757
  retryInMillis: parseRetryAfterToMills(res.headers["retry-after"])
14758
14758
  });
14759
14759
  } else {
14760
- resolve16({
14760
+ resolve17({
14761
14761
  status: "failure",
14762
14762
  error
14763
14763
  });
@@ -14766,26 +14766,26 @@ function sendWithHttp(request, url, headers, compression, userAgent, agent, data
14766
14766
  });
14767
14767
  req.setTimeout(timeoutMillis, () => {
14768
14768
  req.destroy();
14769
- resolve16({
14769
+ resolve17({
14770
14770
  status: "retryable",
14771
14771
  error: new Error("Request timed out")
14772
14772
  });
14773
14773
  });
14774
14774
  req.on("error", (error) => {
14775
14775
  if (isHttpTransportNetworkErrorRetryable(error)) {
14776
- resolve16({
14776
+ resolve17({
14777
14777
  status: "retryable",
14778
14778
  error
14779
14779
  });
14780
14780
  } else {
14781
- resolve16({
14781
+ resolve17({
14782
14782
  status: "failure",
14783
14783
  error
14784
14784
  });
14785
14785
  }
14786
14786
  });
14787
14787
  compressAndSend(req, compression, data, (error) => {
14788
- resolve16({
14788
+ resolve17({
14789
14789
  status: "failure",
14790
14790
  error
14791
14791
  });
@@ -14875,9 +14875,9 @@ var RetryingTransport = class {
14875
14875
  this._transport = transport;
14876
14876
  }
14877
14877
  retry(data, timeoutMillis, inMillis) {
14878
- return new Promise((resolve16, reject) => {
14878
+ return new Promise((resolve17, reject) => {
14879
14879
  setTimeout(() => {
14880
- this._transport.send(data, timeoutMillis).then(resolve16, reject);
14880
+ this._transport.send(data, timeoutMillis).then(resolve17, reject);
14881
14881
  }, inMillis);
14882
14882
  });
14883
14883
  }
@@ -15012,7 +15012,7 @@ function appendRootPathToUrlIfNeeded(url) {
15012
15012
  return void 0;
15013
15013
  }
15014
15014
  }
15015
- function appendResourcePathToUrl(url, path26) {
15015
+ function appendResourcePathToUrl(url, path28) {
15016
15016
  try {
15017
15017
  new URL(url);
15018
15018
  } catch {
@@ -15022,11 +15022,11 @@ function appendResourcePathToUrl(url, path26) {
15022
15022
  if (!url.endsWith("/")) {
15023
15023
  url = url + "/";
15024
15024
  }
15025
- url += path26;
15025
+ url += path28;
15026
15026
  try {
15027
15027
  new URL(url);
15028
15028
  } catch {
15029
- diag2.warn(`Configuration: Provided URL appended with '${path26}' is not a valid URL, using 'undefined' instead of '${url}'`);
15029
+ diag2.warn(`Configuration: Provided URL appended with '${path28}' is not a valid URL, using 'undefined' instead of '${url}'`);
15030
15030
  return void 0;
15031
15031
  }
15032
15032
  return url;
@@ -15447,7 +15447,7 @@ var CONFIG_SCHEMA = [
15447
15447
  // nominal here — the project scope of a global-only key is never read.
15448
15448
  {
15449
15449
  key: "scripts.maxTimeoutMs",
15450
- description: `Upper bound, in milliseconds, on the time limit a flow \`script\` step may ask for (default 300000 \u2014 five minutes). Bounds how long one script can occupy the host. Values below ${MIN_SCRIPT_TIMEOUT_MS} ms are refused: the step starts a Node process before the script runs, so a smaller ceiling ends a script that did nothing wrong.`,
15450
+ description: `Upper bound, in milliseconds, on the time limit an e2e test \`script\` step may ask for (default 300000 \u2014 five minutes). Bounds how long one script can occupy the host. Values below ${MIN_SCRIPT_TIMEOUT_MS} ms are refused: the step starts a Node process before the script runs, so a smaller ceiling ends a script that did nothing wrong.`,
15451
15451
  scopes: ["global"],
15452
15452
  parse: (raw) => {
15453
15453
  const value = asPositiveInteger(raw);
@@ -15460,7 +15460,7 @@ var CONFIG_SCHEMA = [
15460
15460
  },
15461
15461
  {
15462
15462
  key: "scripts.heapLimitMb",
15463
- description: `Old-space heap limit, in MiB, given to each flow \`script\` process (default 512). Values below ${MIN_SCRIPT_HEAP_LIMIT_MB} MiB are refused: that is already below what importing a real npm dependency needs, and under about 5 MiB the process dies inside V8's own startup before any script runs.`,
15463
+ description: `Old-space heap limit, in MiB, given to each e2e test \`script\` process (default 512). Values below ${MIN_SCRIPT_HEAP_LIMIT_MB} MiB are refused: that is already below what importing a real npm dependency needs, and under about 5 MiB the process dies inside V8's own startup before any script runs.`,
15464
15464
  scopes: ["global"],
15465
15465
  parse: (raw) => {
15466
15466
  const value = asPositiveInteger(raw);
@@ -15726,8 +15726,27 @@ var FLOW_FILE_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}\\.yaml$`);
15726
15726
  var SCRIPT_FILE_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}\\.mjs$`);
15727
15727
 
15728
15728
  // ../registry/src/flow-file-refs.ts
15729
+ import * as fs7 from "node:fs/promises";
15730
+ import * as path9 from "node:path";
15731
+
15732
+ // ../registry/src/e2e-dirs.ts
15729
15733
  import * as fs6 from "node:fs/promises";
15730
15734
  import * as path8 from "node:path";
15735
+ var E2E_DIR = path8.join(".argent", "e2e");
15736
+ var LEGACY_E2E_DIRS = Object.freeze([path8.join(".argent", "flows")]);
15737
+ var E2E_DIRS = Object.freeze([E2E_DIR, ...LEGACY_E2E_DIRS]);
15738
+ var E2E_DIR_NAMES = E2E_DIRS.map((dir) => path8.basename(dir));
15739
+
15740
+ // ../registry/src/tool-ids.ts
15741
+ var TOOL_ID_ALIASES = Object.freeze({
15742
+ "flow-start-recording": "e2e-start-recording",
15743
+ "flow-add-step": "e2e-add-step",
15744
+ "flow-add-echo": "e2e-add-echo",
15745
+ "flow-add-script": "e2e-add-script",
15746
+ "flow-finish-recording": "e2e-finish-recording",
15747
+ "flow-read-prerequisite": "e2e-read-prerequisite",
15748
+ "flow-execute": "e2e-execute"
15749
+ });
15731
15750
 
15732
15751
  // ../registry/src/failure-codes.ts
15733
15752
  var FAILURE_CODES = {
@@ -16298,6 +16317,7 @@ var ALLOWED = {
16298
16317
  "tool:invoke": {
16299
16318
  device_provider: DEVICE_PROVIDER,
16300
16319
  tool: TOOL_NAME,
16320
+ alias_used: bool,
16301
16321
  tool_invocation_id: UUID,
16302
16322
  platform: PLATFORM,
16303
16323
  device_kind: DEVICE_KIND,
@@ -16306,6 +16326,7 @@ var ALLOWED = {
16306
16326
  "tool:complete": {
16307
16327
  device_provider: DEVICE_PROVIDER,
16308
16328
  tool: TOOL_NAME,
16329
+ alias_used: bool,
16309
16330
  tool_invocation_id: UUID,
16310
16331
  platform: PLATFORM,
16311
16332
  device_kind: DEVICE_KIND,
@@ -16315,6 +16336,7 @@ var ALLOWED = {
16315
16336
  "tool:fail": {
16316
16337
  device_provider: DEVICE_PROVIDER,
16317
16338
  tool: TOOL_NAME,
16339
+ alias_used: bool,
16318
16340
  tool_invocation_id: UUID,
16319
16341
  platform: PLATFORM,
16320
16342
  device_kind: DEVICE_KIND,
@@ -16333,6 +16355,7 @@ var ALLOWED = {
16333
16355
  },
16334
16356
  "cli:run_fail": {
16335
16357
  tool: TOOL_NAME,
16358
+ alias_used: bool,
16336
16359
  duration_ms: DURATION_MS,
16337
16360
  ...FAILURE_SIGNAL
16338
16361
  },
@@ -16429,9 +16452,9 @@ function isReplitAgent(env) {
16429
16452
  }
16430
16453
  var DEVIN_MARKER_PATH = "/opt/.devin";
16431
16454
  var JULES_MARKER_PATH = "/opt/environment_summary.sh";
16432
- function safeExists(fileExists, path26) {
16455
+ function safeExists(fileExists, path28) {
16433
16456
  try {
16434
- return fileExists(path26);
16457
+ return fileExists(path28);
16435
16458
  } catch {
16436
16459
  return false;
16437
16460
  }
@@ -16852,7 +16875,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16852
16875
  var SESSION_ID = randomUUID4();
16853
16876
  function readCliVersion() {
16854
16877
  if (true) {
16855
- return "0.29.1-next.21";
16878
+ return "0.29.1-next.22";
16856
16879
  }
16857
16880
  return "0.0.0";
16858
16881
  }
@@ -16885,8 +16908,8 @@ function getBaseProps(runtime) {
16885
16908
 
16886
16909
  // ../telemetry/src/identity.ts
16887
16910
  import * as crypto2 from "node:crypto";
16888
- import * as fs7 from "node:fs";
16889
- import * as path9 from "node:path";
16911
+ import * as fs8 from "node:fs";
16912
+ import * as path10 from "node:path";
16890
16913
  var FINGERPRINT_PATTERN = /^[0-9a-f]{64}$/;
16891
16914
  var cached = null;
16892
16915
  var fingerprintResolved = null;
@@ -16993,66 +17016,66 @@ function resolveFingerprintOnce(resolveFingerprint) {
16993
17016
  function isCorruptIdFile(filePath) {
16994
17017
  let isRegularFile;
16995
17018
  try {
16996
- isRegularFile = fs7.lstatSync(filePath).isFile();
17019
+ isRegularFile = fs8.lstatSync(filePath).isFile();
16997
17020
  } catch {
16998
17021
  return false;
16999
17022
  }
17000
17023
  return isRegularFile && tryReadId(filePath) === null;
17001
17024
  }
17002
17025
  function writeIdFileAtomic(finalPath, id) {
17003
- fs7.mkdirSync(argentHomeDir(), { recursive: true });
17026
+ fs8.mkdirSync(argentHomeDir(), { recursive: true });
17004
17027
  let occupant;
17005
17028
  try {
17006
- occupant = fs7.lstatSync(finalPath);
17029
+ occupant = fs8.lstatSync(finalPath);
17007
17030
  } catch (err) {
17008
17031
  if (err.code !== "ENOENT") throw err;
17009
17032
  }
17010
17033
  if (occupant && !occupant.isFile()) {
17011
17034
  throw new Error("telemetry: refusing to replace a non-regular file at the identity path");
17012
17035
  }
17013
- const tmpPath = path9.join(
17036
+ const tmpPath = path10.join(
17014
17037
  argentHomeDir(),
17015
17038
  `.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
17016
17039
  );
17017
- const fd = fs7.openSync(tmpPath, "wx", 384);
17040
+ const fd = fs8.openSync(tmpPath, "wx", 384);
17018
17041
  try {
17019
17042
  try {
17020
- fs7.writeSync(fd, id);
17021
- fs7.fsyncSync(fd);
17043
+ fs8.writeSync(fd, id);
17044
+ fs8.fsyncSync(fd);
17022
17045
  } finally {
17023
- fs7.closeSync(fd);
17046
+ fs8.closeSync(fd);
17024
17047
  }
17025
- fs7.renameSync(tmpPath, finalPath);
17048
+ fs8.renameSync(tmpPath, finalPath);
17026
17049
  } finally {
17027
17050
  try {
17028
- fs7.unlinkSync(tmpPath);
17051
+ fs8.unlinkSync(tmpPath);
17029
17052
  } catch {
17030
17053
  }
17031
17054
  }
17032
17055
  }
17033
17056
  function mintRandomId(finalPath) {
17034
- fs7.mkdirSync(argentHomeDir(), { recursive: true });
17057
+ fs8.mkdirSync(argentHomeDir(), { recursive: true });
17035
17058
  let value = crypto2.randomUUID();
17036
17059
  for (let attempt = 0; attempt < 3; attempt++) {
17037
- const tmpPath = path9.join(
17060
+ const tmpPath = path10.join(
17038
17061
  argentHomeDir(),
17039
17062
  `.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
17040
17063
  );
17041
17064
  let fd;
17042
17065
  try {
17043
- fd = fs7.openSync(tmpPath, "wx", 384);
17066
+ fd = fs8.openSync(tmpPath, "wx", 384);
17044
17067
  } catch (err) {
17045
17068
  if (err.code === "EEXIST") continue;
17046
17069
  throw err;
17047
17070
  }
17048
17071
  try {
17049
17072
  try {
17050
- fs7.writeSync(fd, value);
17051
- fs7.fsyncSync(fd);
17073
+ fs8.writeSync(fd, value);
17074
+ fs8.fsyncSync(fd);
17052
17075
  } finally {
17053
- fs7.closeSync(fd);
17076
+ fs8.closeSync(fd);
17054
17077
  }
17055
- fs7.linkSync(tmpPath, finalPath);
17078
+ fs8.linkSync(tmpPath, finalPath);
17056
17079
  cached = { path: finalPath, id: value };
17057
17080
  return value;
17058
17081
  } catch (err) {
@@ -17071,7 +17094,7 @@ function mintRandomId(finalPath) {
17071
17094
  throw err;
17072
17095
  } finally {
17073
17096
  try {
17074
- fs7.unlinkSync(tmpPath);
17097
+ fs8.unlinkSync(tmpPath);
17075
17098
  } catch {
17076
17099
  }
17077
17100
  }
@@ -17079,12 +17102,12 @@ function mintRandomId(finalPath) {
17079
17102
  throw new Error("telemetry: failed to create identity after retries");
17080
17103
  }
17081
17104
  function claimCorruptOccupant(finalPath) {
17082
- const claimed = path9.join(
17105
+ const claimed = path10.join(
17083
17106
  argentHomeDir(),
17084
17107
  `.telemetry-id.corrupt.${process.pid}.${crypto2.randomUUID()}`
17085
17108
  );
17086
17109
  try {
17087
- fs7.renameSync(finalPath, claimed);
17110
+ fs8.renameSync(finalPath, claimed);
17088
17111
  } catch {
17089
17112
  return null;
17090
17113
  }
@@ -17093,7 +17116,7 @@ function claimCorruptOccupant(finalPath) {
17093
17116
  grabbed = tryReadId(claimed);
17094
17117
  } finally {
17095
17118
  try {
17096
- fs7.unlinkSync(claimed);
17119
+ fs8.unlinkSync(claimed);
17097
17120
  } catch {
17098
17121
  }
17099
17122
  }
@@ -17102,7 +17125,7 @@ function claimCorruptOccupant(finalPath) {
17102
17125
  function deleteAnonId() {
17103
17126
  cached = null;
17104
17127
  try {
17105
- fs7.unlinkSync(identityFilePath());
17128
+ fs8.unlinkSync(identityFilePath());
17106
17129
  } catch (err) {
17107
17130
  if (err.code !== "ENOENT") throw err;
17108
17131
  }
@@ -17110,9 +17133,9 @@ function deleteAnonId() {
17110
17133
  function tryReadId(filePath) {
17111
17134
  let raw;
17112
17135
  try {
17113
- const stats = fs7.lstatSync(filePath);
17136
+ const stats = fs8.lstatSync(filePath);
17114
17137
  if (!stats.isFile()) return null;
17115
- raw = fs7.readFileSync(filePath, "utf8");
17138
+ raw = fs8.readFileSync(filePath, "utf8");
17116
17139
  } catch (err) {
17117
17140
  if (err.code === "ENOENT") return null;
17118
17141
  return null;
@@ -17126,12 +17149,12 @@ function tryReadId(filePath) {
17126
17149
  import { execFileSync, spawn } from "node:child_process";
17127
17150
 
17128
17151
  // ../native-devtools-ios/src/index.ts
17129
- import * as path10 from "node:path";
17130
- import * as fs8 from "node:fs";
17131
- var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path10.join(__dirname, "..", "dylibs");
17132
- var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path10.join(__dirname, "..", "bin");
17133
- var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path10.join(DYLIB_DIR, "tcp");
17134
- var DYLIB_TVOS_DIR = path10.join(DYLIB_DIR, "tvos");
17152
+ import * as path11 from "node:path";
17153
+ import * as fs9 from "node:fs";
17154
+ var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path11.join(__dirname, "..", "dylibs");
17155
+ var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path11.join(__dirname, "..", "bin");
17156
+ var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path11.join(DYLIB_DIR, "tcp");
17157
+ var DYLIB_TVOS_DIR = path11.join(DYLIB_DIR, "tvos");
17135
17158
  function hostPlatformKey() {
17136
17159
  if (process.platform === "linux" && process.arch === "arm64") {
17137
17160
  return "linux-arm64";
@@ -17142,14 +17165,14 @@ function simulatorServerBinaryName() {
17142
17165
  return process.platform === "win32" ? "simulator-server.exe" : "simulator-server";
17143
17166
  }
17144
17167
  function platformBinDir() {
17145
- return path10.join(BIN_DIR, hostPlatformKey());
17168
+ return path11.join(BIN_DIR, hostPlatformKey());
17146
17169
  }
17147
17170
  function simulatorServerBinaryPath() {
17148
17171
  const binaryName = simulatorServerBinaryName();
17149
- const p = path10.join(platformBinDir(), binaryName);
17150
- if (!fs8.existsSync(p)) {
17151
- const flat = path10.join(BIN_DIR, binaryName);
17152
- const migrationHint = fs8.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.` : "";
17172
+ const p = path11.join(platformBinDir(), binaryName);
17173
+ if (!fs9.existsSync(p)) {
17174
+ const flat = path11.join(BIN_DIR, binaryName);
17175
+ const migrationHint = fs9.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.` : "";
17153
17176
  throw new Error(
17154
17177
  `simulator-server binary not found for platform "${hostPlatformKey()}" at ${p}. Supported hosts today: darwin, linux (x86_64 and arm64), win32.${migrationHint}`
17155
17178
  );
@@ -17178,12 +17201,12 @@ function resolveHostFingerprint() {
17178
17201
  }
17179
17202
  }
17180
17203
  function resolveHostFingerprintAsync() {
17181
- return new Promise((resolve16) => {
17204
+ return new Promise((resolve17) => {
17182
17205
  let binary;
17183
17206
  try {
17184
17207
  binary = simulatorServerBinaryPath();
17185
17208
  } catch {
17186
- resolve16(null);
17209
+ resolve17(null);
17187
17210
  return;
17188
17211
  }
17189
17212
  let settled = false;
@@ -17196,7 +17219,7 @@ function resolveHostFingerprintAsync() {
17196
17219
  child?.kill("SIGKILL");
17197
17220
  } catch {
17198
17221
  }
17199
- resolve16(value);
17222
+ resolve17(value);
17200
17223
  };
17201
17224
  const watchdog = setTimeout(() => finish(null), FINGERPRINT_TIMEOUT_MS);
17202
17225
  watchdog.unref?.();
@@ -17229,14 +17252,14 @@ function resolveHostFingerprintAsync() {
17229
17252
  }
17230
17253
 
17231
17254
  // ../telemetry/src/consent.ts
17232
- import * as fs9 from "node:fs";
17255
+ import * as fs10 from "node:fs";
17233
17256
  var cache = /* @__PURE__ */ new Map();
17234
17257
  var sessionOverride = null;
17235
17258
  function readConfigOverrideAt(filePath) {
17236
17259
  const miss = { mtimeMs: null, fingerprint: null, enabledOverride: null };
17237
17260
  let stats;
17238
17261
  try {
17239
- stats = fs9.lstatSync(filePath);
17262
+ stats = fs10.lstatSync(filePath);
17240
17263
  } catch {
17241
17264
  cache.set(filePath, miss);
17242
17265
  return null;
@@ -17253,7 +17276,7 @@ function readConfigOverrideAt(filePath) {
17253
17276
  }
17254
17277
  let parsedEnabled = null;
17255
17278
  try {
17256
- const raw = fs9.readFileSync(filePath, "utf8");
17279
+ const raw = fs10.readFileSync(filePath, "utf8");
17257
17280
  const json = JSON.parse(raw);
17258
17281
  if (json && typeof json === "object") {
17259
17282
  const t2 = json.telemetry;
@@ -17466,7 +17489,7 @@ var DRAIN_GRACE_MS = 250;
17466
17489
  async function raceDrain(client2, timeoutMs) {
17467
17490
  await Promise.race([
17468
17491
  client2.shutdown(timeoutMs),
17469
- new Promise((resolve16) => setTimeout(resolve16, timeoutMs + DRAIN_GRACE_MS).unref())
17492
+ new Promise((resolve17) => setTimeout(resolve17, timeoutMs + DRAIN_GRACE_MS).unref())
17470
17493
  ]);
17471
17494
  }
17472
17495
  async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
@@ -17486,8 +17509,8 @@ async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
17486
17509
  }
17487
17510
 
17488
17511
  // ../argent-installer/src/mcp-configs.ts
17489
- import * as fs16 from "node:fs";
17490
- import * as path17 from "node:path";
17512
+ import * as fs17 from "node:fs";
17513
+ import * as path18 from "node:path";
17491
17514
  import { execFileSync as execFileSync4 } from "node:child_process";
17492
17515
  import { homedir as homedir4 } from "node:os";
17493
17516
 
@@ -17501,8 +17524,8 @@ var CURSOR_ALLOWLIST_PATTERN = "argent:*";
17501
17524
 
17502
17525
  // ../argent-installer/src/utils.ts
17503
17526
  var import_semver3 = __toESM(require_semver2(), 1);
17504
- import * as fs15 from "node:fs";
17505
- import * as path16 from "node:path";
17527
+ import * as fs16 from "node:fs";
17528
+ import * as path17 from "node:path";
17506
17529
  import * as dns from "node:dns";
17507
17530
  import * as os2 from "node:os";
17508
17531
  import { execFileSync as execFileSync3, execSync } from "node:child_process";
@@ -19247,12 +19270,12 @@ function parseTree(text2, errors = [], options = ParseOptions.DEFAULT) {
19247
19270
  }
19248
19271
  return result;
19249
19272
  }
19250
- function findNodeAtLocation(root, path26) {
19273
+ function findNodeAtLocation(root, path28) {
19251
19274
  if (!root) {
19252
19275
  return void 0;
19253
19276
  }
19254
19277
  let node = root;
19255
- for (let segment of path26) {
19278
+ for (let segment of path28) {
19256
19279
  if (typeof segment === "string") {
19257
19280
  if (node.type !== "object" || !Array.isArray(node.children)) {
19258
19281
  return void 0;
@@ -19606,14 +19629,14 @@ function getNodeType(value) {
19606
19629
 
19607
19630
  // ../../node_modules/jsonc-parser/lib/esm/impl/edit.js
19608
19631
  function setProperty(text2, originalPath, value, options) {
19609
- const path26 = originalPath.slice();
19632
+ const path28 = originalPath.slice();
19610
19633
  const errors = [];
19611
19634
  const root = parseTree(text2, errors);
19612
19635
  let parent = void 0;
19613
19636
  let lastSegment = void 0;
19614
- while (path26.length > 0) {
19615
- lastSegment = path26.pop();
19616
- parent = findNodeAtLocation(root, path26);
19637
+ while (path28.length > 0) {
19638
+ lastSegment = path28.pop();
19639
+ parent = findNodeAtLocation(root, path28);
19617
19640
  if (parent === void 0 && value !== void 0) {
19618
19641
  if (typeof lastSegment === "string") {
19619
19642
  value = { [lastSegment]: value };
@@ -19799,8 +19822,8 @@ var ParseErrorCode;
19799
19822
  ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
19800
19823
  ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
19801
19824
  })(ParseErrorCode || (ParseErrorCode = {}));
19802
- function modify(text2, path26, value, options) {
19803
- return setProperty(text2, path26, value, options);
19825
+ function modify(text2, path28, value, options) {
19826
+ return setProperty(text2, path28, value, options);
19804
19827
  }
19805
19828
  function applyEdits(text2, edits) {
19806
19829
  let sortedEdits = edits.slice(0).sort((a2, b) => {
@@ -19824,21 +19847,21 @@ function applyEdits(text2, edits) {
19824
19847
  }
19825
19848
 
19826
19849
  // ../argent-installer/src/package-root.ts
19827
- import * as fs10 from "node:fs";
19828
- import * as path11 from "node:path";
19829
- function resolvePackageRoot(dirname18) {
19830
- let current = path11.resolve(dirname18);
19850
+ import * as fs11 from "node:fs";
19851
+ import * as path12 from "node:path";
19852
+ function resolvePackageRoot(dirname19) {
19853
+ let current = path12.resolve(dirname19);
19831
19854
  while (true) {
19832
- if (fs10.existsSync(path11.join(current, "package.json"))) return current;
19833
- const parent = path11.dirname(current);
19834
- if (parent === current) return path11.resolve(dirname18);
19855
+ if (fs11.existsSync(path12.join(current, "package.json"))) return current;
19856
+ const parent = path12.dirname(current);
19857
+ if (parent === current) return path12.resolve(dirname19);
19835
19858
  current = parent;
19836
19859
  }
19837
19860
  }
19838
19861
 
19839
19862
  // ../argent-installer/src/package-manager.ts
19840
- import * as fs11 from "node:fs";
19841
- import * as path12 from "node:path";
19863
+ import * as fs12 from "node:fs";
19864
+ import * as path13 from "node:path";
19842
19865
  function formatShellCommand(cmd) {
19843
19866
  const parts = [cmd.bin, ...cmd.args.map((a2) => a2.includes(" ") ? `"${a2}"` : a2)];
19844
19867
  return parts.join(" ");
@@ -19858,7 +19881,7 @@ function asKnownPm(name) {
19858
19881
  }
19859
19882
  function pmFromPackageManagerField(dir) {
19860
19883
  try {
19861
- const pkg = JSON.parse(fs11.readFileSync(path12.join(dir, "package.json"), "utf8"));
19884
+ const pkg = JSON.parse(fs12.readFileSync(path13.join(dir, "package.json"), "utf8"));
19862
19885
  if (typeof pkg.packageManager === "string") {
19863
19886
  return asKnownPm(pkg.packageManager.split("@")[0]);
19864
19887
  }
@@ -19869,7 +19892,7 @@ function pmFromPackageManagerField(dir) {
19869
19892
  }
19870
19893
  function pmFromDevEngines(dir) {
19871
19894
  try {
19872
- const pkg = JSON.parse(fs11.readFileSync(path12.join(dir, "package.json"), "utf8"));
19895
+ const pkg = JSON.parse(fs12.readFileSync(path13.join(dir, "package.json"), "utf8"));
19873
19896
  const devEnginesPm = pkg.devEngines?.packageManager;
19874
19897
  const names = /* @__PURE__ */ new Set();
19875
19898
  for (const entry of Array.isArray(devEnginesPm) ? devEnginesPm : [devEnginesPm]) {
@@ -19882,7 +19905,7 @@ function pmFromDevEngines(dir) {
19882
19905
  }
19883
19906
  }
19884
19907
  function pmFromLockfile(dir) {
19885
- const has = (file) => fs11.existsSync(path12.join(dir, file));
19908
+ const has = (file) => fs12.existsSync(path13.join(dir, file));
19886
19909
  if (has("pnpm-lock.yaml")) return "pnpm";
19887
19910
  if (has("yarn.lock")) return "yarn";
19888
19911
  if (has("bun.lock") || has("bun.lockb")) return "bun";
@@ -19890,15 +19913,15 @@ function pmFromLockfile(dir) {
19890
19913
  return null;
19891
19914
  }
19892
19915
  function pmFromWorkspaceMarker(dir) {
19893
- return fs11.existsSync(path12.join(dir, "pnpm-workspace.yaml")) ? "pnpm" : null;
19916
+ return fs12.existsSync(path13.join(dir, "pnpm-workspace.yaml")) ? "pnpm" : null;
19894
19917
  }
19895
19918
  function detectProjectPackageManager(projectRoot) {
19896
- let dir = path12.resolve(projectRoot);
19919
+ let dir = path13.resolve(projectRoot);
19897
19920
  for (; ; ) {
19898
19921
  const pm = pmFromPackageManagerField(dir) ?? pmFromLockfile(dir) ?? pmFromDevEngines(dir) ?? pmFromWorkspaceMarker(dir);
19899
19922
  if (pm) return pm;
19900
- if (fs11.existsSync(path12.join(dir, ".git"))) break;
19901
- const parent = path12.dirname(dir);
19923
+ if (fs12.existsSync(path13.join(dir, ".git"))) break;
19924
+ const parent = path13.dirname(dir);
19902
19925
  if (parent === dir) break;
19903
19926
  dir = parent;
19904
19927
  }
@@ -19966,19 +19989,19 @@ function localUninstallCommand(pm, pkg) {
19966
19989
  }
19967
19990
 
19968
19991
  // ../argent-installer/src/preflight.ts
19969
- import * as fs12 from "node:fs";
19970
- import * as path13 from "node:path";
19992
+ import * as fs13 from "node:fs";
19993
+ import * as path14 from "node:path";
19971
19994
  function hasProjectPackageJson(projectRoot) {
19972
- return fs12.existsSync(path13.join(projectRoot, "package.json"));
19995
+ return fs13.existsSync(path14.join(projectRoot, "package.json"));
19973
19996
  }
19974
19997
  function isYarnPnp(projectRoot) {
19975
- return fs12.existsSync(path13.join(projectRoot, ".pnp.cjs")) || fs12.existsSync(path13.join(projectRoot, ".pnp.loader.mjs"));
19998
+ return fs13.existsSync(path14.join(projectRoot, ".pnp.cjs")) || fs13.existsSync(path14.join(projectRoot, ".pnp.loader.mjs"));
19976
19999
  }
19977
20000
 
19978
20001
  // ../argent-installer/src/topology.ts
19979
20002
  var import_semver2 = __toESM(require_semver2(), 1);
19980
- import * as fs13 from "node:fs";
19981
- import * as path14 from "node:path";
20003
+ import * as fs14 from "node:fs";
20004
+ import * as path15 from "node:path";
19982
20005
  import { createRequire } from "node:module";
19983
20006
  import { execFileSync as execFileSync2 } from "node:child_process";
19984
20007
  var TEMP_RUNNER_MARKERS = [
@@ -20010,9 +20033,9 @@ function getGloballyInstalledPackageRoot() {
20010
20033
  const binaryPath = getGlobalBinaryPath();
20011
20034
  if (!binaryPath) return null;
20012
20035
  try {
20013
- const realPath = fs13.realpathSync(binaryPath);
20014
- const root = resolvePackageRoot(path14.dirname(realPath));
20015
- const pkg = JSON.parse(fs13.readFileSync(path14.join(root, "package.json"), "utf8"));
20036
+ const realPath = fs14.realpathSync(binaryPath);
20037
+ const root = resolvePackageRoot(path15.dirname(realPath));
20038
+ const pkg = JSON.parse(fs14.readFileSync(path15.join(root, "package.json"), "utf8"));
20016
20039
  return pkg.name === PACKAGE_NAME ? root : null;
20017
20040
  } catch {
20018
20041
  return null;
@@ -20022,7 +20045,7 @@ function getGloballyInstalledVersion() {
20022
20045
  const pkgRoot = getGloballyInstalledPackageRoot();
20023
20046
  if (!pkgRoot) return null;
20024
20047
  try {
20025
- const pkg = JSON.parse(fs13.readFileSync(path14.join(pkgRoot, "package.json"), "utf8"));
20048
+ const pkg = JSON.parse(fs14.readFileSync(path15.join(pkgRoot, "package.json"), "utf8"));
20026
20049
  return pkg.version ?? null;
20027
20050
  } catch {
20028
20051
  return null;
@@ -20031,7 +20054,7 @@ function getGloballyInstalledVersion() {
20031
20054
  function readManifestDeclaration(projectRoot) {
20032
20055
  try {
20033
20056
  const pkg = JSON.parse(
20034
- fs13.readFileSync(path14.join(projectRoot, "package.json"), "utf8")
20057
+ fs14.readFileSync(path15.join(projectRoot, "package.json"), "utf8")
20035
20058
  );
20036
20059
  const spec = pkg.devDependencies?.[PACKAGE_NAME] ?? pkg.dependencies?.[PACKAGE_NAME] ?? pkg.optionalDependencies?.[PACKAGE_NAME];
20037
20060
  return typeof spec === "string" ? spec : null;
@@ -20044,11 +20067,11 @@ function isDeclaredLocally(projectRoot) {
20044
20067
  }
20045
20068
  function resolveLocalArgentDir(projectRoot) {
20046
20069
  try {
20047
- const req = createRequire(path14.join(projectRoot, "package.json"));
20048
- return path14.dirname(req.resolve(`${PACKAGE_NAME}/package.json`));
20070
+ const req = createRequire(path15.join(projectRoot, "package.json"));
20071
+ return path15.dirname(req.resolve(`${PACKAGE_NAME}/package.json`));
20049
20072
  } catch {
20050
- const plain = path14.join(projectRoot, "node_modules", PACKAGE_NAME);
20051
- return fs13.existsSync(path14.join(plain, "package.json")) ? plain : null;
20073
+ const plain = path15.join(projectRoot, "node_modules", PACKAGE_NAME);
20074
+ return fs14.existsSync(path15.join(plain, "package.json")) ? plain : null;
20052
20075
  }
20053
20076
  }
20054
20077
  function probeLocalInstall(projectRoot) {
@@ -20056,7 +20079,7 @@ function probeLocalInstall(projectRoot) {
20056
20079
  if (packageDir) {
20057
20080
  let version;
20058
20081
  try {
20059
- const pkg = JSON.parse(fs13.readFileSync(path14.join(packageDir, "package.json"), "utf8"));
20082
+ const pkg = JSON.parse(fs14.readFileSync(path15.join(packageDir, "package.json"), "utf8"));
20060
20083
  version = pkg.version ?? null;
20061
20084
  } catch {
20062
20085
  version = null;
@@ -20079,8 +20102,8 @@ function getLocallyInstalledVersion(projectRoot) {
20079
20102
  }
20080
20103
  function readLocalPackageVersionUncached(projectRoot) {
20081
20104
  try {
20082
- const pkgPath = path14.join(projectRoot, "node_modules", PACKAGE_NAME, "package.json");
20083
- const pkg = JSON.parse(fs13.readFileSync(pkgPath, "utf8"));
20105
+ const pkgPath = path15.join(projectRoot, "node_modules", PACKAGE_NAME, "package.json");
20106
+ const pkg = JSON.parse(fs14.readFileSync(pkgPath, "utf8"));
20084
20107
  return pkg.version ?? null;
20085
20108
  } catch {
20086
20109
  return null;
@@ -20088,7 +20111,7 @@ function readLocalPackageVersionUncached(projectRoot) {
20088
20111
  }
20089
20112
  function argentBinSubpath(pkgDir) {
20090
20113
  try {
20091
- const pkg = JSON.parse(fs13.readFileSync(path14.join(pkgDir, "package.json"), "utf8"));
20114
+ const pkg = JSON.parse(fs14.readFileSync(path15.join(pkgDir, "package.json"), "utf8"));
20092
20115
  if (typeof pkg.bin === "string") return pkg.bin;
20093
20116
  if (pkg.bin && typeof pkg.bin === "object") {
20094
20117
  return pkg.bin[MCP_BINARY_NAME] ?? Object.values(pkg.bin)[0] ?? null;
@@ -20105,28 +20128,28 @@ function getLocalArgentBinRelPath(projectRoot) {
20105
20128
  if (!binSub) return null;
20106
20129
  let root = projectRoot;
20107
20130
  try {
20108
- root = fs13.realpathSync(projectRoot);
20131
+ root = fs14.realpathSync(projectRoot);
20109
20132
  } catch {
20110
20133
  }
20111
- const stableRel = path14.join("node_modules", PACKAGE_NAME, binSub);
20112
- if (fs13.existsSync(path14.join(root, stableRel))) {
20113
- return stableRel.split(path14.sep).join("/");
20134
+ const stableRel = path15.join("node_modules", PACKAGE_NAME, binSub);
20135
+ if (fs14.existsSync(path15.join(root, stableRel))) {
20136
+ return stableRel.split(path15.sep).join("/");
20114
20137
  }
20115
- const abs = path14.join(pkgDir, binSub);
20116
- if (!fs13.existsSync(abs)) return null;
20117
- return path14.relative(root, abs).split(path14.sep).join("/");
20138
+ const abs = path15.join(pkgDir, binSub);
20139
+ if (!fs14.existsSync(abs)) return null;
20140
+ return path15.relative(root, abs).split(path15.sep).join("/");
20118
20141
  }
20119
20142
 
20120
20143
  // ../argent-installer/src/install-record.ts
20121
- import * as fs14 from "node:fs";
20122
- import * as path15 from "node:path";
20144
+ import * as fs15 from "node:fs";
20145
+ import * as path16 from "node:path";
20123
20146
  function getInstallRecordPath(projectRoot) {
20124
- return path15.join(projectRoot, ".argent", "install.json");
20147
+ return path16.join(projectRoot, ".argent", "install.json");
20125
20148
  }
20126
20149
  function readInstallRecord(projectRoot) {
20127
20150
  try {
20128
20151
  const parsed = JSON.parse(
20129
- fs14.readFileSync(getInstallRecordPath(projectRoot), "utf8")
20152
+ fs15.readFileSync(getInstallRecordPath(projectRoot), "utf8")
20130
20153
  );
20131
20154
  if (parsed && (parsed.mode === "local" || parsed.mode === "global")) return parsed;
20132
20155
  return null;
@@ -20136,17 +20159,17 @@ function readInstallRecord(projectRoot) {
20136
20159
  }
20137
20160
  function writeInstallRecord(projectRoot, record) {
20138
20161
  const recordPath = getInstallRecordPath(projectRoot);
20139
- fs14.mkdirSync(path15.dirname(recordPath), { recursive: true });
20140
- fs14.writeFileSync(recordPath, JSON.stringify(record, null, 2) + "\n");
20162
+ fs15.mkdirSync(path16.dirname(recordPath), { recursive: true });
20163
+ fs15.writeFileSync(recordPath, JSON.stringify(record, null, 2) + "\n");
20141
20164
  }
20142
20165
  function removeInstallRecord(projectRoot) {
20143
20166
  const recordPath = getInstallRecordPath(projectRoot);
20144
20167
  try {
20145
- if (!fs14.existsSync(recordPath)) return false;
20146
- fs14.rmSync(recordPath, { force: true });
20147
- const dir = path15.dirname(recordPath);
20168
+ if (!fs15.existsSync(recordPath)) return false;
20169
+ fs15.rmSync(recordPath, { force: true });
20170
+ const dir = path16.dirname(recordPath);
20148
20171
  try {
20149
- if (fs14.existsSync(dir) && fs14.readdirSync(dir).length === 0) fs14.rmdirSync(dir);
20172
+ if (fs15.existsSync(dir) && fs15.readdirSync(dir).length === 0) fs15.rmdirSync(dir);
20150
20173
  } catch {
20151
20174
  }
20152
20175
  return true;
@@ -20174,9 +20197,9 @@ function resolveInstallModeFromFlags(opts) {
20174
20197
  // ../argent-installer/src/utils.ts
20175
20198
  var PACKAGE_ROOT = resolvePackageRoot(import.meta.dirname);
20176
20199
  function resolveBundledDir(dirName) {
20177
- const packagedDir = path16.join(PACKAGE_ROOT, dirName);
20178
- if (fs15.existsSync(packagedDir)) return packagedDir;
20179
- return path16.resolve(PACKAGE_ROOT, "..", "skills", dirName);
20200
+ const packagedDir = path17.join(PACKAGE_ROOT, dirName);
20201
+ if (fs16.existsSync(packagedDir)) return packagedDir;
20202
+ return path17.resolve(PACKAGE_ROOT, "..", "skills", dirName);
20180
20203
  }
20181
20204
  var SKILLS_DIR = resolveBundledDir("skills");
20182
20205
  var RULES_DIR = resolveBundledDir("rules");
@@ -20188,23 +20211,30 @@ function buildArgentSkillsSource(version) {
20188
20211
  }
20189
20212
  function listBundledSkills(skillsDir = SKILLS_DIR) {
20190
20213
  try {
20191
- return fs15.readdirSync(skillsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).filter((name) => fs15.existsSync(path16.join(skillsDir, name, "SKILL.md"))).sort();
20214
+ return fs16.readdirSync(skillsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).filter((name) => fs16.existsSync(path17.join(skillsDir, name, "SKILL.md"))).sort();
20192
20215
  } catch {
20193
20216
  return [];
20194
20217
  }
20195
20218
  }
20196
20219
  function getProjectSkillLockPath(cwd = process.cwd()) {
20197
- return path16.join(cwd, "skills-lock.json");
20220
+ return path17.join(cwd, "skills-lock.json");
20198
20221
  }
20199
20222
  function getGlobalSkillLockPath() {
20200
20223
  const xdgStateHome = process.env.XDG_STATE_HOME;
20201
- if (xdgStateHome) return path16.join(xdgStateHome, "skills", ".skill-lock.json");
20202
- return path16.join(os2.homedir(), ".agents", ".skill-lock.json");
20224
+ if (xdgStateHome) return path17.join(xdgStateHome, "skills", ".skill-lock.json");
20225
+ return path17.join(os2.homedir(), ".agents", ".skill-lock.json");
20203
20226
  }
20204
20227
  var ARGENT_SKILL_PREFIX = "argent-";
20228
+ var LEGACY_ARGENT_SKILL_NAMES = [
20229
+ "argent-create-flow",
20230
+ "argent-qa-flows",
20231
+ "argent-simulator-interact",
20232
+ "argent-simulator-setup",
20233
+ "argent-ios-profiler"
20234
+ ];
20205
20235
  function listArgentSkillsInLock(lockPath) {
20206
20236
  try {
20207
- const raw = fs15.readFileSync(lockPath, "utf8");
20237
+ const raw = fs16.readFileSync(lockPath, "utf8");
20208
20238
  const lock = JSON.parse(raw);
20209
20239
  const tracked = lock.skills ?? {};
20210
20240
  return Object.keys(tracked).filter((name) => name.startsWith(ARGENT_SKILL_PREFIX)).sort();
@@ -20228,20 +20258,20 @@ var PROJECT_ROOT_MARKERS = [
20228
20258
  "skills-lock.json"
20229
20259
  ];
20230
20260
  function resolveProjectRoot2(startDir, homeDir = os2.homedir()) {
20231
- const initialDir = path16.resolve(startDir);
20232
- const home = path16.resolve(homeDir);
20261
+ const initialDir = path17.resolve(startDir);
20262
+ const home = path17.resolve(homeDir);
20233
20263
  let currentDir = initialDir;
20234
20264
  while (true) {
20235
20265
  if (currentDir === home && currentDir !== initialDir) {
20236
20266
  return initialDir;
20237
20267
  }
20238
- if (PROJECT_ROOT_MARKERS.some((marker) => fs15.existsSync(path16.join(currentDir, marker)))) {
20268
+ if (PROJECT_ROOT_MARKERS.some((marker) => fs16.existsSync(path17.join(currentDir, marker)))) {
20239
20269
  return currentDir;
20240
20270
  }
20241
- if (fs15.existsSync(path16.join(currentDir, ".git"))) {
20271
+ if (fs16.existsSync(path17.join(currentDir, ".git"))) {
20242
20272
  return currentDir;
20243
20273
  }
20244
- const parentDir = path16.dirname(currentDir);
20274
+ const parentDir = path17.dirname(currentDir);
20245
20275
  if (parentDir === currentDir) {
20246
20276
  return initialDir;
20247
20277
  }
@@ -20249,20 +20279,20 @@ function resolveProjectRoot2(startDir, homeDir = os2.homedir()) {
20249
20279
  }
20250
20280
  }
20251
20281
  function readToml(filePath) {
20252
- if (!fs15.existsSync(filePath)) return {};
20282
+ if (!fs16.existsSync(filePath)) return {};
20253
20283
  try {
20254
- return parse(fs15.readFileSync(filePath, "utf8"));
20284
+ return parse(fs16.readFileSync(filePath, "utf8"));
20255
20285
  } catch {
20256
20286
  return {};
20257
20287
  }
20258
20288
  }
20259
20289
  function writeToml(filePath, data) {
20260
- fs15.mkdirSync(path16.dirname(filePath), { recursive: true });
20261
- fs15.writeFileSync(filePath, stringify(data) + "\n");
20290
+ fs16.mkdirSync(path17.dirname(filePath), { recursive: true });
20291
+ fs16.writeFileSync(filePath, stringify(data) + "\n");
20262
20292
  }
20263
20293
  function readYaml(filePath) {
20264
- if (!fs15.existsSync(filePath)) return new import_yaml.Document({});
20265
- const text2 = fs15.readFileSync(filePath, "utf8");
20294
+ if (!fs16.existsSync(filePath)) return new import_yaml.Document({});
20295
+ const text2 = fs16.readFileSync(filePath, "utf8");
20266
20296
  const doc = (0, import_yaml.parseDocument)(text2);
20267
20297
  if (doc.errors.length > 0) {
20268
20298
  const messages = doc.errors.map((e) => e.message).join("; ");
@@ -20271,20 +20301,20 @@ function readYaml(filePath) {
20271
20301
  return doc;
20272
20302
  }
20273
20303
  function writeYaml(filePath, doc) {
20274
- fs15.mkdirSync(path16.dirname(filePath), { recursive: true });
20275
- fs15.writeFileSync(filePath, doc.toString({ lineWidth: 0 }));
20304
+ fs16.mkdirSync(path17.dirname(filePath), { recursive: true });
20305
+ fs16.writeFileSync(filePath, doc.toString({ lineWidth: 0 }));
20276
20306
  }
20277
20307
  function readJson(filePath) {
20278
- if (!fs15.existsSync(filePath)) return {};
20308
+ if (!fs16.existsSync(filePath)) return {};
20279
20309
  try {
20280
- return JSON.parse(fs15.readFileSync(filePath, "utf8"));
20310
+ return JSON.parse(fs16.readFileSync(filePath, "utf8"));
20281
20311
  } catch {
20282
20312
  return {};
20283
20313
  }
20284
20314
  }
20285
20315
  function writeJson(filePath, data) {
20286
- fs15.mkdirSync(path16.dirname(filePath), { recursive: true });
20287
- fs15.writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n");
20316
+ fs16.mkdirSync(path17.dirname(filePath), { recursive: true });
20317
+ fs16.writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n");
20288
20318
  }
20289
20319
  var JSONC_FORMATTING = { tabSize: 2, insertSpaces: true };
20290
20320
  function setJsoncIn(text2, jsonPath, value) {
@@ -20292,8 +20322,8 @@ function setJsoncIn(text2, jsonPath, value) {
20292
20322
  return applyEdits(text2, edits);
20293
20323
  }
20294
20324
  function readJsoncFileRaw(filePath) {
20295
- if (!fs15.existsSync(filePath)) return { text: "{}", hadBom: false, wasEmpty: true };
20296
- let text2 = fs15.readFileSync(filePath, "utf8");
20325
+ if (!fs16.existsSync(filePath)) return { text: "{}", hadBom: false, wasEmpty: true };
20326
+ let text2 = fs16.readFileSync(filePath, "utf8");
20297
20327
  const hadBom = text2.charCodeAt(0) === 65279;
20298
20328
  if (hadBom) text2 = text2.slice(1);
20299
20329
  const wasEmpty = text2.trim() === "";
@@ -20313,16 +20343,16 @@ function isEmptyPlainObject(value) {
20313
20343
  }
20314
20344
  function rmEmptyDir(dirPath) {
20315
20345
  try {
20316
- if (!fs15.existsSync(dirPath)) return;
20317
- if (!fs15.statSync(dirPath).isDirectory()) return;
20318
- if (fs15.readdirSync(dirPath).length > 0) return;
20319
- fs15.rmdirSync(dirPath);
20346
+ if (!fs16.existsSync(dirPath)) return;
20347
+ if (!fs16.statSync(dirPath).isDirectory()) return;
20348
+ if (fs16.readdirSync(dirPath).length > 0) return;
20349
+ fs16.rmdirSync(dirPath);
20320
20350
  } catch {
20321
20351
  }
20322
20352
  }
20323
20353
  function readJsonc(filePath) {
20324
- if (!fs15.existsSync(filePath)) return {};
20325
- let raw = fs15.readFileSync(filePath, "utf8");
20354
+ if (!fs16.existsSync(filePath)) return {};
20355
+ let raw = fs16.readFileSync(filePath, "utf8");
20326
20356
  if (raw.charCodeAt(0) === 65279) raw = raw.slice(1);
20327
20357
  if (raw.trim() === "") return {};
20328
20358
  const parsed = parse3(raw, [], { allowTrailingComma: true });
@@ -20341,18 +20371,18 @@ function editJsoncFile(filePath, jsonPath, value) {
20341
20371
  }
20342
20372
  const parsed = parse3(text2, [], { allowTrailingComma: true });
20343
20373
  if (isEmptyPlainObject(parsed)) {
20344
- fs15.rmSync(filePath, { force: true });
20345
- rmEmptyDir(path16.dirname(filePath));
20374
+ fs16.rmSync(filePath, { force: true });
20375
+ rmEmptyDir(path17.dirname(filePath));
20346
20376
  return;
20347
20377
  }
20348
- fs15.mkdirSync(path16.dirname(filePath), { recursive: true });
20378
+ fs16.mkdirSync(path17.dirname(filePath), { recursive: true });
20349
20379
  const out = wasEmpty && !text2.endsWith("\n") ? text2 + "\n" : text2;
20350
- fs15.writeFileSync(filePath, (hadBom ? "\uFEFF" : "") + out);
20380
+ fs16.writeFileSync(filePath, (hadBom ? "\uFEFF" : "") + out);
20351
20381
  }
20352
20382
  var MAX_SYMLINK_HOPS = 40;
20353
20383
  function realpathOrSelf(p) {
20354
20384
  try {
20355
- return fs15.realpathSync(p);
20385
+ return fs16.realpathSync(p);
20356
20386
  } catch {
20357
20387
  return p;
20358
20388
  }
@@ -20362,13 +20392,13 @@ function resolveLinkedDestination(dest) {
20362
20392
  for (let hop = 0; hop < MAX_SYMLINK_HOPS; hop++) {
20363
20393
  let entry;
20364
20394
  try {
20365
- entry = fs15.lstatSync(current);
20395
+ entry = fs16.lstatSync(current);
20366
20396
  } catch {
20367
- return current === dest || dirExists(path16.dirname(current)) ? current : dest;
20397
+ return current === dest || dirExists(path17.dirname(current)) ? current : dest;
20368
20398
  }
20369
20399
  if (!entry.isSymbolicLink()) return current;
20370
20400
  try {
20371
- current = path16.resolve(realpathOrSelf(path16.dirname(current)), fs15.readlinkSync(current));
20401
+ current = path17.resolve(realpathOrSelf(path17.dirname(current)), fs16.readlinkSync(current));
20372
20402
  } catch {
20373
20403
  return dest;
20374
20404
  }
@@ -20376,32 +20406,32 @@ function resolveLinkedDestination(dest) {
20376
20406
  return dest;
20377
20407
  }
20378
20408
  function copyDir(src, dest) {
20379
- if (!fs15.existsSync(src)) return null;
20409
+ if (!fs16.existsSync(src)) return null;
20380
20410
  const target = resolveLinkedDestination(dest);
20381
20411
  copyTree(src, target);
20382
20412
  return target;
20383
20413
  }
20384
20414
  function copyTree(src, dest) {
20385
- const entries = fs15.readdirSync(src, { withFileTypes: true });
20386
- fs15.mkdirSync(dest, { recursive: true });
20415
+ const entries = fs16.readdirSync(src, { withFileTypes: true });
20416
+ fs16.mkdirSync(dest, { recursive: true });
20387
20417
  for (const entry of entries) {
20388
- const from = path16.join(src, entry.name);
20389
- const to = resolveLinkedDestination(path16.join(dest, entry.name));
20418
+ const from = path17.join(src, entry.name);
20419
+ const to = resolveLinkedDestination(path17.join(dest, entry.name));
20390
20420
  if (entry.isDirectory()) copyTree(from, to);
20391
- else fs15.copyFileSync(from, to);
20421
+ else fs16.copyFileSync(from, to);
20392
20422
  }
20393
20423
  }
20394
20424
  function dirExists(p) {
20395
20425
  try {
20396
- return fs15.statSync(p).isDirectory();
20426
+ return fs16.statSync(p).isDirectory();
20397
20427
  } catch {
20398
20428
  return false;
20399
20429
  }
20400
20430
  }
20401
20431
  function getInstalledVersion() {
20402
20432
  try {
20403
- const pkgPath = path16.join(PACKAGE_ROOT, "package.json");
20404
- const pkg = JSON.parse(fs15.readFileSync(pkgPath, "utf8"));
20433
+ const pkgPath = path17.join(PACKAGE_ROOT, "package.json");
20434
+ const pkg = JSON.parse(fs16.readFileSync(pkgPath, "utf8"));
20405
20435
  return pkg.version ?? null;
20406
20436
  } catch {
20407
20437
  return null;
@@ -20449,12 +20479,12 @@ async function isOnline(timeoutMs = PROBE_TIMEOUT_MS) {
20449
20479
  } catch {
20450
20480
  return false;
20451
20481
  }
20452
- return new Promise((resolve16) => {
20453
- const timer = setTimeout(() => resolve16(false), timeoutMs);
20482
+ return new Promise((resolve17) => {
20483
+ const timer = setTimeout(() => resolve17(false), timeoutMs);
20454
20484
  timer.unref();
20455
20485
  dns.lookup(host, (err) => {
20456
20486
  clearTimeout(timer);
20457
- resolve16(!err);
20487
+ resolve17(!err);
20458
20488
  });
20459
20489
  });
20460
20490
  }
@@ -20471,7 +20501,7 @@ function escapeStringRegexp(string) {
20471
20501
  }
20472
20502
 
20473
20503
  // ../argent-installer/src/mcp-configs.ts
20474
- var TOOL_SERVER_BUNDLE = path17.join(import.meta.dirname, "tool-server.cjs");
20504
+ var TOOL_SERVER_BUNDLE = path18.join(import.meta.dirname, "tool-server.cjs");
20475
20505
  function getAvailableToolIds() {
20476
20506
  const out = execFileSync4("node", [TOOL_SERVER_BUNDLE, "-t"], { encoding: "utf8" });
20477
20507
  const tools = JSON.parse(out);
@@ -20510,10 +20540,10 @@ function hasCustomizingEnv(entry) {
20510
20540
  }
20511
20541
  function removeDirIfEmpty(dirPath) {
20512
20542
  try {
20513
- if (!fs16.existsSync(dirPath)) return;
20514
- if (!fs16.statSync(dirPath).isDirectory()) return;
20515
- if (fs16.readdirSync(dirPath).length > 0) return;
20516
- fs16.rmdirSync(dirPath);
20543
+ if (!fs17.existsSync(dirPath)) return;
20544
+ if (!fs17.statSync(dirPath).isDirectory()) return;
20545
+ if (fs17.readdirSync(dirPath).length > 0) return;
20546
+ fs17.rmdirSync(dirPath);
20517
20547
  } catch {
20518
20548
  }
20519
20549
  }
@@ -20550,7 +20580,7 @@ function isArgentManagedEntry(entry) {
20550
20580
  return args.length === 1 && args[0] === "mcp";
20551
20581
  case "node": {
20552
20582
  if (args.length !== 2 || args[1] !== "mcp" || !args[0]) return false;
20553
- if (path17.isAbsolute(args[0])) return false;
20583
+ if (path18.isAbsolute(args[0])) return false;
20554
20584
  const normalized = args[0].split("\\").join("/");
20555
20585
  return normalized.includes(`node_modules/${PACKAGE_NAME}/`);
20556
20586
  }
@@ -20564,8 +20594,8 @@ function isArgentManagedEntry(entry) {
20564
20594
  }
20565
20595
  function writeTomlOrRemove(filePath, data) {
20566
20596
  if (Object.keys(data).length === 0) {
20567
- fs16.rmSync(filePath, { force: true });
20568
- removeDirIfEmpty(path17.dirname(filePath));
20597
+ fs17.rmSync(filePath, { force: true });
20598
+ removeDirIfEmpty(path18.dirname(filePath));
20569
20599
  return;
20570
20600
  }
20571
20601
  writeToml(filePath, data);
@@ -20574,12 +20604,12 @@ function dirHasEditorEvidence(dir, looksArgentOnly) {
20574
20604
  return dirExists(dir) && !looksArgentOnly(dir);
20575
20605
  }
20576
20606
  function fileHasEditorEvidence(filePath, looksArgentOnly) {
20577
- return fs16.existsSync(filePath) && !looksArgentOnly(filePath);
20607
+ return fs17.existsSync(filePath) && !looksArgentOnly(filePath);
20578
20608
  }
20579
20609
  function parseJsoncStrict(filePath) {
20580
20610
  let raw;
20581
20611
  try {
20582
- raw = fs16.readFileSync(filePath, "utf8");
20612
+ raw = fs17.readFileSync(filePath, "utf8");
20583
20613
  } catch {
20584
20614
  return null;
20585
20615
  }
@@ -20592,14 +20622,14 @@ function parseJsoncStrict(filePath) {
20592
20622
  }
20593
20623
  function parseTomlStrict(filePath) {
20594
20624
  try {
20595
- return parse(fs16.readFileSync(filePath, "utf8"));
20625
+ return parse(fs17.readFileSync(filePath, "utf8"));
20596
20626
  } catch {
20597
20627
  return null;
20598
20628
  }
20599
20629
  }
20600
20630
  function parseYamlStrict(filePath) {
20601
20631
  try {
20602
- const parsed = (0, import_yaml2.parse)(fs16.readFileSync(filePath, "utf8"));
20632
+ const parsed = (0, import_yaml2.parse)(fs17.readFileSync(filePath, "utf8"));
20603
20633
  if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return null;
20604
20634
  return parsed;
20605
20635
  } catch {
@@ -20622,7 +20652,7 @@ function bundledManagedNames(kind) {
20622
20652
  if (cached2) return cached2;
20623
20653
  let names;
20624
20654
  try {
20625
- names = new Set(fs16.readdirSync(kind === "rules" ? RULES_DIR : AGENTS_DIR));
20655
+ names = new Set(fs17.readdirSync(kind === "rules" ? RULES_DIR : AGENTS_DIR));
20626
20656
  } catch {
20627
20657
  names = /* @__PURE__ */ new Set();
20628
20658
  }
@@ -20632,7 +20662,7 @@ function bundledManagedNames(kind) {
20632
20662
  function managedDirLooksArgentOnly(dir, kind) {
20633
20663
  let entries;
20634
20664
  try {
20635
- entries = fs16.readdirSync(dir);
20665
+ entries = fs17.readdirSync(dir);
20636
20666
  } catch {
20637
20667
  return false;
20638
20668
  }
@@ -20644,13 +20674,13 @@ function managedDirLooksArgentOnly(dir, kind) {
20644
20674
  function cursorDirLooksArgentOnly(dir) {
20645
20675
  let entries;
20646
20676
  try {
20647
- entries = fs16.readdirSync(dir);
20677
+ entries = fs17.readdirSync(dir);
20648
20678
  } catch {
20649
20679
  return false;
20650
20680
  }
20651
20681
  if (entries.length === 0) return false;
20652
20682
  return entries.every((entry) => {
20653
- const full = path17.join(dir, entry);
20683
+ const full = path18.join(dir, entry);
20654
20684
  if (entry === "mcp.json") {
20655
20685
  return jsonLooksArgentServerOnly(full, "mcpServers");
20656
20686
  }
@@ -20683,13 +20713,13 @@ function claudeSettingsLooksArgentOnly(filePath) {
20683
20713
  function claudeDirLooksArgentOnly(dir) {
20684
20714
  let entries;
20685
20715
  try {
20686
- entries = fs16.readdirSync(dir);
20716
+ entries = fs17.readdirSync(dir);
20687
20717
  } catch {
20688
20718
  return false;
20689
20719
  }
20690
20720
  if (entries.length === 0) return false;
20691
20721
  return entries.every((entry) => {
20692
- const full = path17.join(dir, entry);
20722
+ const full = path18.join(dir, entry);
20693
20723
  if (entry === "settings.json") return claudeSettingsLooksArgentOnly(full);
20694
20724
  if (entry === "rules" || entry === "agents" || entry === "skills") {
20695
20725
  return managedDirLooksArgentOnly(full, entry);
@@ -20700,25 +20730,25 @@ function claudeDirLooksArgentOnly(dir) {
20700
20730
  function vscodeDirLooksArgentOnly(dir) {
20701
20731
  let entries;
20702
20732
  try {
20703
- entries = fs16.readdirSync(dir);
20733
+ entries = fs17.readdirSync(dir);
20704
20734
  } catch {
20705
20735
  return false;
20706
20736
  }
20707
20737
  if (entries.length === 0) return false;
20708
20738
  return entries.every(
20709
- (entry) => entry === "mcp.json" && jsonLooksArgentServerOnly(path17.join(dir, entry), "servers")
20739
+ (entry) => entry === "mcp.json" && jsonLooksArgentServerOnly(path18.join(dir, entry), "servers")
20710
20740
  );
20711
20741
  }
20712
20742
  function windsurfDirLooksArgentOnly(dir) {
20713
20743
  let entries;
20714
20744
  try {
20715
- entries = fs16.readdirSync(dir);
20745
+ entries = fs17.readdirSync(dir);
20716
20746
  } catch {
20717
20747
  return false;
20718
20748
  }
20719
20749
  if (entries.length === 0) return false;
20720
20750
  return entries.every(
20721
- (entry) => entry === "mcp_config.json" && jsonLooksArgentServerOnly(path17.join(dir, entry), "mcpServers")
20751
+ (entry) => entry === "mcp_config.json" && jsonLooksArgentServerOnly(path18.join(dir, entry), "mcpServers")
20722
20752
  );
20723
20753
  }
20724
20754
  function zedSettingsLooksArgentOnly(filePath) {
@@ -20749,25 +20779,25 @@ function zedSettingsLooksArgentOnly(filePath) {
20749
20779
  function zedDirLooksArgentOnly(dir) {
20750
20780
  let entries;
20751
20781
  try {
20752
- entries = fs16.readdirSync(dir);
20782
+ entries = fs17.readdirSync(dir);
20753
20783
  } catch {
20754
20784
  return false;
20755
20785
  }
20756
20786
  if (entries.length === 0) return false;
20757
20787
  return entries.every(
20758
- (entry) => entry === "settings.json" && zedSettingsLooksArgentOnly(path17.join(dir, entry))
20788
+ (entry) => entry === "settings.json" && zedSettingsLooksArgentOnly(path18.join(dir, entry))
20759
20789
  );
20760
20790
  }
20761
20791
  function geminiDirLooksArgentOnly(dir) {
20762
20792
  let entries;
20763
20793
  try {
20764
- entries = fs16.readdirSync(dir);
20794
+ entries = fs17.readdirSync(dir);
20765
20795
  } catch {
20766
20796
  return false;
20767
20797
  }
20768
20798
  if (entries.length === 0) return false;
20769
20799
  return entries.every((entry) => {
20770
- const full = path17.join(dir, entry);
20800
+ const full = path18.join(dir, entry);
20771
20801
  if (entry === "settings.json") return jsonLooksArgentServerOnly(full, "mcpServers");
20772
20802
  if (entry === "rules" || entry === "agents") return managedDirLooksArgentOnly(full, entry);
20773
20803
  return false;
@@ -20786,48 +20816,48 @@ function hermesConfigLooksArgentOnly(filePath) {
20786
20816
  function hermesDirLooksArgentOnly(dir) {
20787
20817
  let entries;
20788
20818
  try {
20789
- entries = fs16.readdirSync(dir);
20819
+ entries = fs17.readdirSync(dir);
20790
20820
  } catch {
20791
20821
  return false;
20792
20822
  }
20793
20823
  if (entries.length === 0) return false;
20794
20824
  return entries.every(
20795
- (entry) => entry === "config.yaml" && hermesConfigLooksArgentOnly(path17.join(dir, entry))
20825
+ (entry) => entry === "config.yaml" && hermesConfigLooksArgentOnly(path18.join(dir, entry))
20796
20826
  );
20797
20827
  }
20798
20828
  function kiroDirLooksArgentOnly(dir) {
20799
20829
  let entries;
20800
20830
  try {
20801
- entries = fs16.readdirSync(dir);
20831
+ entries = fs17.readdirSync(dir);
20802
20832
  } catch {
20803
20833
  return false;
20804
20834
  }
20805
20835
  if (entries.length === 0) return false;
20806
20836
  return entries.every((entry) => {
20807
20837
  if (entry !== "settings") return false;
20808
- const settingsDir = path17.join(dir, entry);
20838
+ const settingsDir = path18.join(dir, entry);
20809
20839
  let settingsEntries;
20810
20840
  try {
20811
- settingsEntries = fs16.readdirSync(settingsDir);
20841
+ settingsEntries = fs17.readdirSync(settingsDir);
20812
20842
  } catch {
20813
20843
  return false;
20814
20844
  }
20815
20845
  if (settingsEntries.length === 0) return false;
20816
20846
  return settingsEntries.every(
20817
- (name) => name === "mcp.json" && jsonLooksArgentServerOnly(path17.join(settingsDir, name), "mcpServers")
20847
+ (name) => name === "mcp.json" && jsonLooksArgentServerOnly(path18.join(settingsDir, name), "mcpServers")
20818
20848
  );
20819
20849
  });
20820
20850
  }
20821
20851
  function codexDirLooksArgentOnly(dir) {
20822
20852
  let entries;
20823
20853
  try {
20824
- entries = fs16.readdirSync(dir);
20854
+ entries = fs17.readdirSync(dir);
20825
20855
  } catch {
20826
20856
  return false;
20827
20857
  }
20828
20858
  if (entries.length === 0) return false;
20829
20859
  return entries.every((entry) => {
20830
- const full = path17.join(dir, entry);
20860
+ const full = path18.join(dir, entry);
20831
20861
  if (entry === "config.toml") {
20832
20862
  const config = parseTomlStrict(full);
20833
20863
  if (config === null) return false;
@@ -20854,13 +20884,13 @@ function codexDirLooksArgentOnly(dir) {
20854
20884
  var cursorAdapter = {
20855
20885
  name: "Cursor",
20856
20886
  detect() {
20857
- return dirHasEditorEvidence(path17.join(homedir4(), ".cursor"), cursorDirLooksArgentOnly) || dirHasEditorEvidence(path17.join(process.cwd(), ".cursor"), cursorDirLooksArgentOnly);
20887
+ return dirHasEditorEvidence(path18.join(homedir4(), ".cursor"), cursorDirLooksArgentOnly) || dirHasEditorEvidence(path18.join(process.cwd(), ".cursor"), cursorDirLooksArgentOnly);
20858
20888
  },
20859
20889
  projectPath(root) {
20860
- return path17.join(root, ".cursor", "mcp.json");
20890
+ return path18.join(root, ".cursor", "mcp.json");
20861
20891
  },
20862
20892
  globalPath() {
20863
- return path17.join(homedir4(), ".cursor", "mcp.json");
20893
+ return path18.join(homedir4(), ".cursor", "mcp.json");
20864
20894
  },
20865
20895
  // Read and written as JSONC through readJsonc / editJsoncFile: path-targeted
20866
20896
  // text edits that preserve user comments and foreign servers.
@@ -20872,7 +20902,7 @@ var cursorAdapter = {
20872
20902
  });
20873
20903
  },
20874
20904
  remove(configPath) {
20875
- if (!fs16.existsSync(configPath)) return false;
20905
+ if (!fs17.existsSync(configPath)) return false;
20876
20906
  const config = readJsonc(configPath);
20877
20907
  const servers = config.mcpServers;
20878
20908
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -20880,7 +20910,7 @@ var cursorAdapter = {
20880
20910
  return true;
20881
20911
  },
20882
20912
  getArgentEntry(configPath) {
20883
- if (!fs16.existsSync(configPath)) return null;
20913
+ if (!fs17.existsSync(configPath)) return null;
20884
20914
  const config = readJsonc(configPath);
20885
20915
  const servers = config.mcpServers;
20886
20916
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -20891,7 +20921,7 @@ var cursorAdapter = {
20891
20921
  // The allowlist lives in a separate ~/.cursor/permissions.json that may carry
20892
20922
  // the user's own rules, so edit that one key instead of rewriting the file.
20893
20923
  addAllowlist() {
20894
- const permPath = path17.join(homedir4(), ".cursor", "permissions.json");
20924
+ const permPath = path18.join(homedir4(), ".cursor", "permissions.json");
20895
20925
  const config = readJsonc(permPath);
20896
20926
  const list = Array.isArray(config.mcpAllowlist) ? config.mcpAllowlist : [];
20897
20927
  if (list.includes(CURSOR_ALLOWLIST_PATTERN)) return;
@@ -20899,8 +20929,8 @@ var cursorAdapter = {
20899
20929
  },
20900
20930
  removeAllowlist(_root, scope) {
20901
20931
  if (scope !== "global") return;
20902
- const permPath = path17.join(homedir4(), ".cursor", "permissions.json");
20903
- if (!fs16.existsSync(permPath)) return;
20932
+ const permPath = path18.join(homedir4(), ".cursor", "permissions.json");
20933
+ if (!fs17.existsSync(permPath)) return;
20904
20934
  const config = readJsonc(permPath);
20905
20935
  const list = Array.isArray(config.mcpAllowlist) ? config.mcpAllowlist : void 0;
20906
20936
  if (!list || !list.includes(CURSOR_ALLOWLIST_PATTERN)) return;
@@ -20911,16 +20941,16 @@ var cursorAdapter = {
20911
20941
  function claudeProjectKeysForRoot(projects, root) {
20912
20942
  const canonical = (value) => {
20913
20943
  try {
20914
- return fs16.realpathSync.native(value);
20944
+ return fs17.realpathSync.native(value);
20915
20945
  } catch {
20916
- return path17.resolve(value);
20946
+ return path18.resolve(value);
20917
20947
  }
20918
20948
  };
20919
20949
  const target = canonical(root);
20920
20950
  return Object.keys(projects).filter((key) => key === root || canonical(key) === target);
20921
20951
  }
20922
20952
  function claudeDisabledListFinding(settingsPath, label, projectConfined) {
20923
- if (!fs16.existsSync(settingsPath)) return null;
20953
+ if (!fs17.existsSync(settingsPath)) return null;
20924
20954
  const disabled = readJson(settingsPath).disabledMcpjsonServers;
20925
20955
  if (!Array.isArray(disabled) || !disabled.includes(MCP_SERVER_KEY)) return null;
20926
20956
  return {
@@ -20948,13 +20978,13 @@ var claudeAdapter = {
20948
20978
  name: "Claude Code",
20949
20979
  detect() {
20950
20980
  const mcpJsonArgentOnly = (p) => jsonLooksArgentServerOnly(p, "mcpServers");
20951
- return fileHasEditorEvidence(path17.join(process.cwd(), ".mcp.json"), mcpJsonArgentOnly) || fileHasEditorEvidence(path17.join(homedir4(), ".claude.json"), mcpJsonArgentOnly) || dirHasEditorEvidence(path17.join(process.cwd(), ".claude"), claudeDirLooksArgentOnly) || dirHasEditorEvidence(path17.join(homedir4(), ".claude"), claudeDirLooksArgentOnly);
20981
+ return fileHasEditorEvidence(path18.join(process.cwd(), ".mcp.json"), mcpJsonArgentOnly) || fileHasEditorEvidence(path18.join(homedir4(), ".claude.json"), mcpJsonArgentOnly) || dirHasEditorEvidence(path18.join(process.cwd(), ".claude"), claudeDirLooksArgentOnly) || dirHasEditorEvidence(path18.join(homedir4(), ".claude"), claudeDirLooksArgentOnly);
20952
20982
  },
20953
20983
  projectPath(root) {
20954
- return path17.join(root, ".mcp.json");
20984
+ return path18.join(root, ".mcp.json");
20955
20985
  },
20956
20986
  globalPath() {
20957
- return path17.join(homedir4(), ".claude.json");
20987
+ return path18.join(homedir4(), ".claude.json");
20958
20988
  },
20959
20989
  // JSONC is a superset of JSON, so this config shares the one comment- and
20960
20990
  // foreign-server-preserving write path (see the Cursor adapter).
@@ -20967,7 +20997,7 @@ var claudeAdapter = {
20967
20997
  });
20968
20998
  },
20969
20999
  remove(configPath) {
20970
- if (!fs16.existsSync(configPath)) return false;
21000
+ if (!fs17.existsSync(configPath)) return false;
20971
21001
  const config = readJsonc(configPath);
20972
21002
  const servers = config.mcpServers;
20973
21003
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -20981,7 +21011,7 @@ var claudeAdapter = {
20981
21011
  return true;
20982
21012
  },
20983
21013
  getArgentEntry(configPath) {
20984
- if (!fs16.existsSync(configPath)) return null;
21014
+ if (!fs17.existsSync(configPath)) return null;
20985
21015
  const config = readJsonc(configPath);
20986
21016
  const servers = config.mcpServers;
20987
21017
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -20994,7 +21024,7 @@ var claudeAdapter = {
20994
21024
  // .mcp.json rejections (see claudeDisabledListFinding).
20995
21025
  findShadowingConfigs(root, writtenScope) {
20996
21026
  const findings = [];
20997
- const claudeJsonPath = path17.join(homedir4(), ".claude.json");
21027
+ const claudeJsonPath = path18.join(homedir4(), ".claude.json");
20998
21028
  const projects = readJson(claudeJsonPath).projects;
20999
21029
  if (isRecord(projects)) {
21000
21030
  for (const key of claudeProjectKeysForRoot(projects, root)) {
@@ -21031,9 +21061,9 @@ var claudeAdapter = {
21031
21061
  }
21032
21062
  if (writtenScope === "local") {
21033
21063
  const candidates = [
21034
- [path17.join(root, ".claude", "settings.json"), ".claude/settings.json", true],
21035
- [path17.join(root, ".claude", "settings.local.json"), ".claude/settings.local.json", true],
21036
- [path17.join(homedir4(), ".claude", "settings.json"), "~/.claude/settings.json", false]
21064
+ [path18.join(root, ".claude", "settings.json"), ".claude/settings.json", true],
21065
+ [path18.join(root, ".claude", "settings.local.json"), ".claude/settings.local.json", true],
21066
+ [path18.join(homedir4(), ".claude", "settings.json"), "~/.claude/settings.json", false]
21037
21067
  ];
21038
21068
  for (const [settingsPath, label, projectConfined] of candidates) {
21039
21069
  const finding = claudeDisabledListFinding(settingsPath, label, projectConfined);
@@ -21052,10 +21082,10 @@ var claudeAdapter = {
21052
21082
  var vscodeAdapter = {
21053
21083
  name: "VS Code",
21054
21084
  detect() {
21055
- return dirHasEditorEvidence(path17.join(process.cwd(), ".vscode"), vscodeDirLooksArgentOnly) || dirExists(path17.join(homedir4(), ".vscode"));
21085
+ return dirHasEditorEvidence(path18.join(process.cwd(), ".vscode"), vscodeDirLooksArgentOnly) || dirExists(path18.join(homedir4(), ".vscode"));
21056
21086
  },
21057
21087
  projectPath(root) {
21058
- return path17.join(root, ".vscode", "mcp.json");
21088
+ return path18.join(root, ".vscode", "mcp.json");
21059
21089
  },
21060
21090
  globalPath() {
21061
21091
  return null;
@@ -21071,7 +21101,7 @@ var vscodeAdapter = {
21071
21101
  });
21072
21102
  },
21073
21103
  remove(configPath) {
21074
- if (!fs16.existsSync(configPath)) return false;
21104
+ if (!fs17.existsSync(configPath)) return false;
21075
21105
  const config = readJsonc(configPath);
21076
21106
  const servers = config.servers;
21077
21107
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21079,7 +21109,7 @@ var vscodeAdapter = {
21079
21109
  return true;
21080
21110
  },
21081
21111
  getArgentEntry(configPath) {
21082
- if (!fs16.existsSync(configPath)) return null;
21112
+ if (!fs17.existsSync(configPath)) return null;
21083
21113
  const config = readJsonc(configPath);
21084
21114
  const servers = config.servers;
21085
21115
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21092,7 +21122,7 @@ var vscodeAdapter = {
21092
21122
  findShadowingConfigs(_root, _writtenScope) {
21093
21123
  const findings = [];
21094
21124
  for (const userDir of vscodeUserDirs()) {
21095
- const configPath = path17.join(userDir, "mcp.json");
21125
+ const configPath = path18.join(userDir, "mcp.json");
21096
21126
  const entry = this.getArgentEntry(configPath);
21097
21127
  if (!entry) continue;
21098
21128
  findings.push({
@@ -21109,16 +21139,16 @@ var vscodeAdapter = {
21109
21139
  function vscodeUserDirs() {
21110
21140
  const bases = [];
21111
21141
  if (process.platform === "darwin") {
21112
- bases.push(path17.join(homedir4(), "Library", "Application Support"));
21142
+ bases.push(path18.join(homedir4(), "Library", "Application Support"));
21113
21143
  } else if (process.platform === "win32") {
21114
21144
  if (process.env.APPDATA) bases.push(process.env.APPDATA);
21115
21145
  } else {
21116
- bases.push(path17.join(homedir4(), ".config"));
21146
+ bases.push(path18.join(homedir4(), ".config"));
21117
21147
  }
21118
21148
  const dirs = [];
21119
21149
  for (const base of bases) {
21120
21150
  for (const product of ["Code", "Code - Insiders"]) {
21121
- const dir = path17.join(base, product, "User");
21151
+ const dir = path18.join(base, product, "User");
21122
21152
  if (dirExists(dir)) dirs.push(dir);
21123
21153
  }
21124
21154
  }
@@ -21128,7 +21158,7 @@ var windsurfAdapter = {
21128
21158
  name: "Windsurf",
21129
21159
  detect() {
21130
21160
  return dirHasEditorEvidence(
21131
- path17.join(homedir4(), ".codeium", "windsurf"),
21161
+ path18.join(homedir4(), ".codeium", "windsurf"),
21132
21162
  windsurfDirLooksArgentOnly
21133
21163
  );
21134
21164
  },
@@ -21136,7 +21166,7 @@ var windsurfAdapter = {
21136
21166
  return null;
21137
21167
  },
21138
21168
  globalPath() {
21139
- return path17.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21169
+ return path18.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21140
21170
  },
21141
21171
  // JSONC-safe writes (see the Cursor adapter).
21142
21172
  write(configPath, entry) {
@@ -21147,7 +21177,7 @@ var windsurfAdapter = {
21147
21177
  });
21148
21178
  },
21149
21179
  remove(configPath) {
21150
- if (!fs16.existsSync(configPath)) return false;
21180
+ if (!fs17.existsSync(configPath)) return false;
21151
21181
  const config = readJsonc(configPath);
21152
21182
  const servers = config.mcpServers;
21153
21183
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21155,7 +21185,7 @@ var windsurfAdapter = {
21155
21185
  return true;
21156
21186
  },
21157
21187
  getArgentEntry(configPath) {
21158
- if (!fs16.existsSync(configPath)) return null;
21188
+ if (!fs17.existsSync(configPath)) return null;
21159
21189
  const config = readJsonc(configPath);
21160
21190
  const servers = config.mcpServers;
21161
21191
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21166,7 +21196,7 @@ var windsurfAdapter = {
21166
21196
  // Targets just the argent entry's alwaysAllow key, so comments and foreign
21167
21197
  // servers survive.
21168
21198
  addAllowlist() {
21169
- const configPath = path17.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21199
+ const configPath = path18.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21170
21200
  const config = readJsonc(configPath);
21171
21201
  const servers = config.mcpServers;
21172
21202
  if (!servers?.[MCP_SERVER_KEY]) return;
@@ -21174,8 +21204,8 @@ var windsurfAdapter = {
21174
21204
  },
21175
21205
  removeAllowlist(_root, scope) {
21176
21206
  if (scope !== "global") return;
21177
- const configPath = path17.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21178
- if (!fs16.existsSync(configPath)) return;
21207
+ const configPath = path18.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21208
+ if (!fs17.existsSync(configPath)) return;
21179
21209
  const config = readJsonc(configPath);
21180
21210
  const servers = config.mcpServers;
21181
21211
  const entry = servers?.[MCP_SERVER_KEY];
@@ -21186,13 +21216,13 @@ var windsurfAdapter = {
21186
21216
  var zedAdapter = {
21187
21217
  name: "Zed",
21188
21218
  detect() {
21189
- return dirHasEditorEvidence(path17.join(homedir4(), ".config", "zed"), zedDirLooksArgentOnly);
21219
+ return dirHasEditorEvidence(path18.join(homedir4(), ".config", "zed"), zedDirLooksArgentOnly);
21190
21220
  },
21191
21221
  projectPath(root) {
21192
- return path17.join(root, ".zed", "settings.json");
21222
+ return path18.join(root, ".zed", "settings.json");
21193
21223
  },
21194
21224
  globalPath() {
21195
- return path17.join(homedir4(), ".config", "zed", "settings.json");
21225
+ return path18.join(homedir4(), ".config", "zed", "settings.json");
21196
21226
  },
21197
21227
  // Read and written as JSONC through readJsonc / editJsoncFile so comments and
21198
21228
  // formatting outside the touched key survive (see the Cursor adapter).
@@ -21205,7 +21235,7 @@ var zedAdapter = {
21205
21235
  });
21206
21236
  },
21207
21237
  remove(configPath) {
21208
- if (!fs16.existsSync(configPath)) return false;
21238
+ if (!fs17.existsSync(configPath)) return false;
21209
21239
  const config = readJsonc(configPath);
21210
21240
  const servers = config.context_servers;
21211
21241
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21213,7 +21243,7 @@ var zedAdapter = {
21213
21243
  return true;
21214
21244
  },
21215
21245
  getArgentEntry(configPath) {
21216
- if (!fs16.existsSync(configPath)) return null;
21246
+ if (!fs17.existsSync(configPath)) return null;
21217
21247
  const config = readJsonc(configPath);
21218
21248
  const servers = config.context_servers;
21219
21249
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21224,12 +21254,12 @@ var zedAdapter = {
21224
21254
  // Zed has no server-level wildcard for MCP tools — each tool would need its
21225
21255
  // own entry — so the global default is set to "allow" instead.
21226
21256
  addAllowlist(root, scope) {
21227
- const settingsPath = scope === "global" ? path17.join(homedir4(), ".config", "zed", "settings.json") : path17.join(root, ".zed", "settings.json");
21257
+ const settingsPath = scope === "global" ? path18.join(homedir4(), ".config", "zed", "settings.json") : path18.join(root, ".zed", "settings.json");
21228
21258
  editJsoncFile(settingsPath, ["agent", "tool_permissions", "default"], "allow");
21229
21259
  },
21230
21260
  removeAllowlist(root, scope) {
21231
- const settingsPath = scope === "global" ? path17.join(homedir4(), ".config", "zed", "settings.json") : path17.join(root, ".zed", "settings.json");
21232
- if (!fs16.existsSync(settingsPath)) return;
21261
+ const settingsPath = scope === "global" ? path18.join(homedir4(), ".config", "zed", "settings.json") : path18.join(root, ".zed", "settings.json");
21262
+ if (!fs17.existsSync(settingsPath)) return;
21233
21263
  const config = readJsonc(settingsPath);
21234
21264
  const perms = config.agent?.tool_permissions;
21235
21265
  if (!perms || perms.default !== "allow") return;
@@ -21239,13 +21269,13 @@ var zedAdapter = {
21239
21269
  var geminiAdapter = {
21240
21270
  name: "Gemini",
21241
21271
  detect() {
21242
- return dirHasEditorEvidence(path17.join(homedir4(), ".gemini"), geminiDirLooksArgentOnly) || dirHasEditorEvidence(path17.join(process.cwd(), ".gemini"), geminiDirLooksArgentOnly);
21272
+ return dirHasEditorEvidence(path18.join(homedir4(), ".gemini"), geminiDirLooksArgentOnly) || dirHasEditorEvidence(path18.join(process.cwd(), ".gemini"), geminiDirLooksArgentOnly);
21243
21273
  },
21244
21274
  projectPath(root) {
21245
- return path17.join(root, ".gemini", "settings.json");
21275
+ return path18.join(root, ".gemini", "settings.json");
21246
21276
  },
21247
21277
  globalPath() {
21248
- return path17.join(homedir4(), ".gemini", "settings.json");
21278
+ return path18.join(homedir4(), ".gemini", "settings.json");
21249
21279
  },
21250
21280
  // JSONC-safe writes (see the Cursor adapter).
21251
21281
  write(configPath, entry) {
@@ -21256,7 +21286,7 @@ var geminiAdapter = {
21256
21286
  });
21257
21287
  },
21258
21288
  remove(configPath) {
21259
- if (!fs16.existsSync(configPath)) return false;
21289
+ if (!fs17.existsSync(configPath)) return false;
21260
21290
  const config = readJsonc(configPath);
21261
21291
  const servers = config.mcpServers;
21262
21292
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21264,7 +21294,7 @@ var geminiAdapter = {
21264
21294
  return true;
21265
21295
  },
21266
21296
  getArgentEntry(configPath) {
21267
- if (!fs16.existsSync(configPath)) return null;
21297
+ if (!fs17.existsSync(configPath)) return null;
21268
21298
  const config = readJsonc(configPath);
21269
21299
  const servers = config.mcpServers;
21270
21300
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21286,7 +21316,7 @@ var geminiAdapter = {
21286
21316
  },
21287
21317
  removeAllowlist(root, scope) {
21288
21318
  const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
21289
- if (!configPath || !fs16.existsSync(configPath)) {
21319
+ if (!configPath || !fs17.existsSync(configPath)) {
21290
21320
  return;
21291
21321
  }
21292
21322
  const config = readJsonc(configPath);
@@ -21300,13 +21330,13 @@ var CODEX_FILENAME = ".codex";
21300
21330
  var codexAdapter = {
21301
21331
  name: "Codex",
21302
21332
  detect() {
21303
- return dirHasEditorEvidence(path17.join(homedir4(), CODEX_FILENAME), codexDirLooksArgentOnly) || dirHasEditorEvidence(path17.join(process.cwd(), CODEX_FILENAME), codexDirLooksArgentOnly);
21333
+ return dirHasEditorEvidence(path18.join(homedir4(), CODEX_FILENAME), codexDirLooksArgentOnly) || dirHasEditorEvidence(path18.join(process.cwd(), CODEX_FILENAME), codexDirLooksArgentOnly);
21304
21334
  },
21305
21335
  projectPath(root) {
21306
- return path17.join(root, CODEX_FILENAME, "config.toml");
21336
+ return path18.join(root, CODEX_FILENAME, "config.toml");
21307
21337
  },
21308
21338
  globalPath() {
21309
- return path17.join(homedir4(), CODEX_FILENAME, "config.toml");
21339
+ return path18.join(homedir4(), CODEX_FILENAME, "config.toml");
21310
21340
  },
21311
21341
  write(configPath, entry) {
21312
21342
  const config = readToml(configPath);
@@ -21320,7 +21350,7 @@ var codexAdapter = {
21320
21350
  writeToml(configPath, config);
21321
21351
  },
21322
21352
  remove(configPath) {
21323
- if (!fs16.existsSync(configPath)) return false;
21353
+ if (!fs17.existsSync(configPath)) return false;
21324
21354
  const config = readToml(configPath);
21325
21355
  const servers = config.mcp_servers;
21326
21356
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21330,7 +21360,7 @@ var codexAdapter = {
21330
21360
  return true;
21331
21361
  },
21332
21362
  getArgentEntry(configPath) {
21333
- if (!fs16.existsSync(configPath)) return null;
21363
+ if (!fs17.existsSync(configPath)) return null;
21334
21364
  const config = readToml(configPath);
21335
21365
  const servers = config.mcp_servers;
21336
21366
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21378,13 +21408,13 @@ var codexAdapter = {
21378
21408
  var hermesAdapter = {
21379
21409
  name: "Hermes",
21380
21410
  detect() {
21381
- return dirHasEditorEvidence(path17.join(homedir4(), ".hermes"), hermesDirLooksArgentOnly);
21411
+ return dirHasEditorEvidence(path18.join(homedir4(), ".hermes"), hermesDirLooksArgentOnly);
21382
21412
  },
21383
21413
  projectPath() {
21384
21414
  return null;
21385
21415
  },
21386
21416
  globalPath() {
21387
- return path17.join(homedir4(), ".hermes", "config.yaml");
21417
+ return path18.join(homedir4(), ".hermes", "config.yaml");
21388
21418
  },
21389
21419
  write(configPath, entry) {
21390
21420
  const doc = readYaml(configPath);
@@ -21403,7 +21433,7 @@ var hermesAdapter = {
21403
21433
  writeYaml(configPath, doc);
21404
21434
  },
21405
21435
  remove(configPath) {
21406
- if (!fs16.existsSync(configPath)) return false;
21436
+ if (!fs17.existsSync(configPath)) return false;
21407
21437
  const doc = readYaml(configPath);
21408
21438
  const servers = doc.get("mcp_servers");
21409
21439
  if (!(0, import_yaml2.isMap)(servers)) return false;
@@ -21416,7 +21446,7 @@ var hermesAdapter = {
21416
21446
  return true;
21417
21447
  },
21418
21448
  getArgentEntry(configPath) {
21419
- if (!fs16.existsSync(configPath)) return null;
21449
+ if (!fs17.existsSync(configPath)) return null;
21420
21450
  const doc = readYaml(configPath);
21421
21451
  const servers = doc.get("mcp_servers");
21422
21452
  if (!(0, import_yaml2.isMap)(servers)) return null;
@@ -21443,10 +21473,10 @@ function hasOpenCodeBinary() {
21443
21473
  }
21444
21474
  function pickOpencodeConfig(dir, candidates) {
21445
21475
  for (const name of candidates) {
21446
- const candidate = path17.join(dir, name);
21447
- if (fs16.existsSync(candidate)) return candidate;
21476
+ const candidate = path18.join(dir, name);
21477
+ if (fs17.existsSync(candidate)) return candidate;
21448
21478
  }
21449
- return path17.join(dir, "opencode.json");
21479
+ return path18.join(dir, "opencode.json");
21450
21480
  }
21451
21481
  var openCodeAdapter = {
21452
21482
  name: "opencode",
@@ -21457,7 +21487,7 @@ var openCodeAdapter = {
21457
21487
  return pickOpencodeConfig(root, OPENCODE_PROJECT_FILES);
21458
21488
  },
21459
21489
  globalPath() {
21460
- return pickOpencodeConfig(path17.join(homedir4(), ".config", "opencode"), OPENCODE_GLOBAL_FILES);
21490
+ return pickOpencodeConfig(path18.join(homedir4(), ".config", "opencode"), OPENCODE_GLOBAL_FILES);
21461
21491
  },
21462
21492
  write(configPath, entry) {
21463
21493
  editJsoncFile(configPath, ["mcp", MCP_SERVER_KEY], {
@@ -21468,7 +21498,7 @@ var openCodeAdapter = {
21468
21498
  });
21469
21499
  },
21470
21500
  remove(configPath) {
21471
- if (!fs16.existsSync(configPath)) return false;
21501
+ if (!fs17.existsSync(configPath)) return false;
21472
21502
  const config = readJsonc(configPath);
21473
21503
  const servers = config.mcp;
21474
21504
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21476,7 +21506,7 @@ var openCodeAdapter = {
21476
21506
  return true;
21477
21507
  },
21478
21508
  getArgentEntry(configPath) {
21479
- if (!fs16.existsSync(configPath)) return null;
21509
+ if (!fs17.existsSync(configPath)) return null;
21480
21510
  const config = readJsonc(configPath);
21481
21511
  const servers = config.mcp;
21482
21512
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21491,7 +21521,7 @@ var openCodeAdapter = {
21491
21521
  },
21492
21522
  removeAllowlist(root, scope) {
21493
21523
  const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
21494
- if (!configPath || !fs16.existsSync(configPath)) return;
21524
+ if (!configPath || !fs17.existsSync(configPath)) return;
21495
21525
  const config = readJsonc(configPath);
21496
21526
  const tools = config.tools;
21497
21527
  if (!tools || !(OPENCODE_ALLOWLIST_PATTERN in tools)) return;
@@ -21502,13 +21532,13 @@ var KIRO_AUTO_APPROVE_ALL = ["*"];
21502
21532
  var kiroAdapter = {
21503
21533
  name: "Kiro",
21504
21534
  detect() {
21505
- return dirHasEditorEvidence(path17.join(homedir4(), ".kiro"), kiroDirLooksArgentOnly) || dirHasEditorEvidence(path17.join(process.cwd(), ".kiro"), kiroDirLooksArgentOnly);
21535
+ return dirHasEditorEvidence(path18.join(homedir4(), ".kiro"), kiroDirLooksArgentOnly) || dirHasEditorEvidence(path18.join(process.cwd(), ".kiro"), kiroDirLooksArgentOnly);
21506
21536
  },
21507
21537
  projectPath(root) {
21508
- return path17.join(root, ".kiro", "settings", "mcp.json");
21538
+ return path18.join(root, ".kiro", "settings", "mcp.json");
21509
21539
  },
21510
21540
  globalPath() {
21511
- return path17.join(homedir4(), ".kiro", "settings", "mcp.json");
21541
+ return path18.join(homedir4(), ".kiro", "settings", "mcp.json");
21512
21542
  },
21513
21543
  // Read and written as JSONC through readJsonc / editJsoncFile so comments and
21514
21544
  // foreign servers survive (see the Cursor adapter).
@@ -21520,7 +21550,7 @@ var kiroAdapter = {
21520
21550
  });
21521
21551
  },
21522
21552
  remove(configPath) {
21523
- if (!fs16.existsSync(configPath)) return false;
21553
+ if (!fs17.existsSync(configPath)) return false;
21524
21554
  const config = readJsonc(configPath);
21525
21555
  const servers = config.mcpServers;
21526
21556
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21528,7 +21558,7 @@ var kiroAdapter = {
21528
21558
  return true;
21529
21559
  },
21530
21560
  getArgentEntry(configPath) {
21531
- if (!fs16.existsSync(configPath)) return null;
21561
+ if (!fs17.existsSync(configPath)) return null;
21532
21562
  const config = readJsonc(configPath);
21533
21563
  const servers = config.mcpServers;
21534
21564
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21552,7 +21582,7 @@ var kiroAdapter = {
21552
21582
  },
21553
21583
  removeAllowlist(root, scope) {
21554
21584
  const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
21555
- if (!configPath || !fs16.existsSync(configPath)) return;
21585
+ if (!configPath || !fs17.existsSync(configPath)) return;
21556
21586
  const config = readJsonc(configPath);
21557
21587
  const servers = config.mcpServers;
21558
21588
  const entry = servers?.[MCP_SERVER_KEY];
@@ -21597,7 +21627,7 @@ function findConfiguredAdapterScopes(adapters, projectRoot) {
21597
21627
  return results;
21598
21628
  }
21599
21629
  function addClaudePermission(root, scope) {
21600
- const settingsPath = scope === "global" ? path17.join(homedir4(), ".claude", "settings.json") : path17.join(root, ".claude", "settings.json");
21630
+ const settingsPath = scope === "global" ? path18.join(homedir4(), ".claude", "settings.json") : path18.join(root, ".claude", "settings.json");
21601
21631
  const config = readJsonc(settingsPath);
21602
21632
  const permissions = config.permissions ?? {};
21603
21633
  const allow = Array.isArray(permissions.allow) ? permissions.allow : [];
@@ -21605,8 +21635,8 @@ function addClaudePermission(root, scope) {
21605
21635
  editJsoncFile(settingsPath, ["permissions", "allow"], [...allow, PERMISSION_RULE]);
21606
21636
  }
21607
21637
  function removeClaudePermission(root, scope) {
21608
- const settingsPath = scope === "global" ? path17.join(homedir4(), ".claude", "settings.json") : path17.join(root, ".claude", "settings.json");
21609
- if (!fs16.existsSync(settingsPath)) return;
21638
+ const settingsPath = scope === "global" ? path18.join(homedir4(), ".claude", "settings.json") : path18.join(root, ".claude", "settings.json");
21639
+ if (!fs17.existsSync(settingsPath)) return;
21610
21640
  const config = readJsonc(settingsPath);
21611
21641
  const permissions = config?.permissions;
21612
21642
  const allow = permissions?.allow;
@@ -21621,11 +21651,11 @@ function formatCopyDestination(target, writtenPath, root) {
21621
21651
  }
21622
21652
  function formatManagedPathLabel(targetPath, root) {
21623
21653
  const home = homedir4();
21624
- if (targetPath === home || targetPath.startsWith(`${home}${path17.sep}`)) {
21654
+ if (targetPath === home || targetPath.startsWith(`${home}${path18.sep}`)) {
21625
21655
  return `~${targetPath.slice(home.length)}`;
21626
21656
  }
21627
- const relative5 = path17.relative(root, targetPath);
21628
- if (relative5 && !relative5.startsWith("..") && !path17.isAbsolute(relative5)) {
21657
+ const relative5 = path18.relative(root, targetPath);
21658
+ if (relative5 && !relative5.startsWith("..") && !path18.isAbsolute(relative5)) {
21629
21659
  return relative5;
21630
21660
  }
21631
21661
  return targetPath;
@@ -21639,7 +21669,7 @@ function addManagedTarget(targets, editorName, targetPath, root) {
21639
21669
  }
21640
21670
  function getAdapterBasePath(adapter, root, scope) {
21641
21671
  const configPath = scope === "global" ? adapter.globalPath() : adapter.projectPath(root);
21642
- return configPath ? path17.dirname(configPath) : null;
21672
+ return configPath ? path18.dirname(configPath) : null;
21643
21673
  }
21644
21674
  function getManagedContentTargets(adapters, root, scope) {
21645
21675
  const targets = {
@@ -21653,13 +21683,13 @@ function getManagedContentTargets(adapters, root, scope) {
21653
21683
  addManagedTarget(
21654
21684
  targets.skillTargets,
21655
21685
  "skills",
21656
- path17.join(workspaceBase, ".agents", "skills"),
21686
+ path18.join(workspaceBase, ".agents", "skills"),
21657
21687
  root
21658
21688
  );
21659
21689
  addManagedTarget(
21660
21690
  targets.skillsLockTargets,
21661
21691
  "skills",
21662
- path17.join(workspaceBase, "skills-lock.json"),
21692
+ path18.join(workspaceBase, "skills-lock.json"),
21663
21693
  root
21664
21694
  );
21665
21695
  for (const adapter of adapters) {
@@ -21667,21 +21697,21 @@ function getManagedContentTargets(adapters, root, scope) {
21667
21697
  case "Cursor": {
21668
21698
  const base = getAdapterBasePath(adapter, root, scope);
21669
21699
  if (!base) break;
21670
- addManagedTarget(targets.skillTargets, adapter.name, path17.join(base, "skills"), root);
21671
- addManagedTarget(targets.ruleTargets, adapter.name, path17.join(base, "rules"), root);
21700
+ addManagedTarget(targets.skillTargets, adapter.name, path18.join(base, "skills"), root);
21701
+ addManagedTarget(targets.ruleTargets, adapter.name, path18.join(base, "rules"), root);
21672
21702
  break;
21673
21703
  }
21674
21704
  case "Claude Code": {
21675
- const claudeBase = scope === "global" ? path17.join(homedir4(), ".claude") : path17.join(root, ".claude");
21676
- addManagedTarget(targets.skillTargets, adapter.name, path17.join(claudeBase, "skills"), root);
21677
- addManagedTarget(targets.ruleTargets, adapter.name, path17.join(claudeBase, "rules"), root);
21678
- addManagedTarget(targets.agentTargets, adapter.name, path17.join(claudeBase, "agents"), root);
21705
+ const claudeBase = scope === "global" ? path18.join(homedir4(), ".claude") : path18.join(root, ".claude");
21706
+ addManagedTarget(targets.skillTargets, adapter.name, path18.join(claudeBase, "skills"), root);
21707
+ addManagedTarget(targets.ruleTargets, adapter.name, path18.join(claudeBase, "rules"), root);
21708
+ addManagedTarget(targets.agentTargets, adapter.name, path18.join(claudeBase, "agents"), root);
21679
21709
  break;
21680
21710
  }
21681
21711
  case "Gemini": {
21682
- const geminiBase = scope === "global" ? path17.join(homedir4(), ".gemini") : path17.join(root, ".gemini");
21683
- addManagedTarget(targets.ruleTargets, adapter.name, path17.join(geminiBase, "rules"), root);
21684
- addManagedTarget(targets.agentTargets, adapter.name, path17.join(geminiBase, "agents"), root);
21712
+ const geminiBase = scope === "global" ? path18.join(homedir4(), ".gemini") : path18.join(root, ".gemini");
21713
+ addManagedTarget(targets.ruleTargets, adapter.name, path18.join(geminiBase, "rules"), root);
21714
+ addManagedTarget(targets.agentTargets, adapter.name, path18.join(geminiBase, "agents"), root);
21685
21715
  break;
21686
21716
  }
21687
21717
  case "Codex": {
@@ -21691,14 +21721,14 @@ function getManagedContentTargets(adapters, root, scope) {
21691
21721
  break;
21692
21722
  }
21693
21723
  case "opencode": {
21694
- const base = scope === "global" ? path17.join(homedir4(), ".config", "opencode") : path17.join(root, ".opencode");
21695
- addManagedTarget(targets.skillTargets, adapter.name, path17.join(base, "skills"), root);
21696
- addManagedTarget(targets.agentTargets, adapter.name, path17.join(base, "agents"), root);
21724
+ const base = scope === "global" ? path18.join(homedir4(), ".config", "opencode") : path18.join(root, ".opencode");
21725
+ addManagedTarget(targets.skillTargets, adapter.name, path18.join(base, "skills"), root);
21726
+ addManagedTarget(targets.agentTargets, adapter.name, path18.join(base, "agents"), root);
21697
21727
  break;
21698
21728
  }
21699
21729
  case "Kiro": {
21700
- const kiroBase = scope === "global" ? path17.join(homedir4(), ".kiro") : path17.join(root, ".kiro");
21701
- addManagedTarget(targets.skillTargets, adapter.name, path17.join(kiroBase, "skills"), root);
21730
+ const kiroBase = scope === "global" ? path18.join(homedir4(), ".kiro") : path18.join(root, ".kiro");
21731
+ addManagedTarget(targets.skillTargets, adapter.name, path18.join(kiroBase, "skills"), root);
21702
21732
  break;
21703
21733
  }
21704
21734
  }
@@ -21712,12 +21742,12 @@ function stripFrontmatter(content) {
21712
21742
  return match ? content.slice(match[0].length).trim() : content.trim();
21713
21743
  }
21714
21744
  function readAndConcatRules(rulesDir) {
21715
- if (!fs16.existsSync(rulesDir)) return null;
21716
- const files = fs16.readdirSync(rulesDir).filter((f) => f.endsWith(".md")).sort();
21745
+ if (!fs17.existsSync(rulesDir)) return null;
21746
+ const files = fs17.readdirSync(rulesDir).filter((f) => f.endsWith(".md")).sort();
21717
21747
  if (files.length === 0) return null;
21718
21748
  const parts = [];
21719
21749
  for (const file of files) {
21720
- const raw = fs16.readFileSync(path17.join(rulesDir, file), "utf8");
21750
+ const raw = fs17.readFileSync(path18.join(rulesDir, file), "utf8");
21721
21751
  const stripped = stripFrontmatter(raw);
21722
21752
  if (stripped) parts.push(stripped);
21723
21753
  }
@@ -21752,7 +21782,7 @@ function injectCodexRules(configPath, rulesDir) {
21752
21782
  return configPath;
21753
21783
  }
21754
21784
  function removeCodexRules(configPath) {
21755
- if (!fs16.existsSync(configPath)) return false;
21785
+ if (!fs17.existsSync(configPath)) return false;
21756
21786
  const config = readToml(configPath);
21757
21787
  const existing = config.developer_instructions;
21758
21788
  if (!existing || !existing.includes(ARGENT_RULES_START)) return false;
@@ -21803,14 +21833,14 @@ function copyRulesAndAgents(adapters, root, scope, rulesDir, agentsDir) {
21803
21833
 
21804
21834
  // ../argent-installer/src/cli-record.ts
21805
21835
  var import_semver4 = __toESM(require_semver2(), 1);
21806
- import * as fs17 from "node:fs";
21807
- import * as path18 from "node:path";
21836
+ import * as fs18 from "node:fs";
21837
+ import * as path19 from "node:path";
21808
21838
  function cliRecordPath() {
21809
- return path18.join(argentHomeDir(), "cli.json");
21839
+ return path19.join(argentHomeDir(), "cli.json");
21810
21840
  }
21811
21841
  function readCliRecord() {
21812
21842
  try {
21813
- const parsed = JSON.parse(fs17.readFileSync(cliRecordPath(), "utf8"));
21843
+ const parsed = JSON.parse(fs18.readFileSync(cliRecordPath(), "utf8"));
21814
21844
  if (typeof parsed?.cli === "string" && typeof parsed?.node === "string") return parsed;
21815
21845
  return null;
21816
21846
  } catch {
@@ -21820,14 +21850,14 @@ function readCliRecord() {
21820
21850
  function resolveCliEntry(mode, projectRoot) {
21821
21851
  if (mode === "local") {
21822
21852
  const relative5 = getLocalArgentBinRelPath(projectRoot);
21823
- return relative5 ? path18.resolve(projectRoot, relative5) : null;
21853
+ return relative5 ? path19.resolve(projectRoot, relative5) : null;
21824
21854
  }
21825
21855
  const packageRoot = getGloballyInstalledPackageRoot();
21826
21856
  if (!packageRoot) return null;
21827
21857
  const binSub = argentBinSubpath(packageRoot);
21828
21858
  if (!binSub) return null;
21829
- const entry = path18.join(packageRoot, binSub);
21830
- return fs17.existsSync(entry) ? entry : null;
21859
+ const entry = path19.join(packageRoot, binSub);
21860
+ return fs18.existsSync(entry) ? entry : null;
21831
21861
  }
21832
21862
  function writeCliRecord(input) {
21833
21863
  const cli = resolveCliEntry(input.mode, input.projectRoot);
@@ -21843,10 +21873,10 @@ function writeCliRecord(input) {
21843
21873
  function persistCliRecord(record) {
21844
21874
  const file = cliRecordPath();
21845
21875
  try {
21846
- fs17.mkdirSync(path18.dirname(file), { recursive: true });
21876
+ fs18.mkdirSync(path19.dirname(file), { recursive: true });
21847
21877
  const temporary = `${file}.${process.pid}.tmp`;
21848
- fs17.writeFileSync(temporary, JSON.stringify(record, null, 2) + "\n");
21849
- fs17.renameSync(temporary, file);
21878
+ fs18.writeFileSync(temporary, JSON.stringify(record, null, 2) + "\n");
21879
+ fs18.renameSync(temporary, file);
21850
21880
  return file;
21851
21881
  } catch {
21852
21882
  return null;
@@ -21854,10 +21884,10 @@ function persistCliRecord(record) {
21854
21884
  }
21855
21885
  function healCliRecord(input) {
21856
21886
  try {
21857
- if (!fs17.existsSync(input.cli)) return null;
21887
+ if (!fs18.existsSync(input.cli)) return null;
21858
21888
  const existing = readCliRecord();
21859
21889
  if (existing) {
21860
- const alive = fs17.existsSync(existing.node) && fs17.existsSync(existing.cli);
21890
+ const alive = fs18.existsSync(existing.node) && fs18.existsSync(existing.cli);
21861
21891
  const ourVersion = import_semver4.default.valid(input.version);
21862
21892
  const theirVersion = import_semver4.default.valid(existing.version);
21863
21893
  const newerThanExisting = ourVersion !== null && (theirVersion === null || import_semver4.default.gt(ourVersion, theirVersion));
@@ -21878,11 +21908,11 @@ function removeCliRecordFor(installDir) {
21878
21908
  if (!installDir) return false;
21879
21909
  const record = readCliRecord();
21880
21910
  if (!record) return false;
21881
- const root = path18.resolve(installDir);
21882
- const relative5 = path18.relative(root, path18.resolve(record.cli));
21883
- if (relative5.startsWith("..") || path18.isAbsolute(relative5)) return false;
21911
+ const root = path19.resolve(installDir);
21912
+ const relative5 = path19.relative(root, path19.resolve(record.cli));
21913
+ if (relative5.startsWith("..") || path19.isAbsolute(relative5)) return false;
21884
21914
  try {
21885
- fs17.rmSync(cliRecordPath(), { force: true });
21915
+ fs18.rmSync(cliRecordPath(), { force: true });
21886
21916
  return true;
21887
21917
  } catch {
21888
21918
  return false;
@@ -22127,7 +22157,7 @@ var ShellCommandError = class extends Error {
22127
22157
  signal;
22128
22158
  };
22129
22159
  function runShellCommand(cmd, opts = {}) {
22130
- return new Promise((resolve16, reject) => {
22160
+ return new Promise((resolve17, reject) => {
22131
22161
  const child = spawn2(cmd.bin, cmd.args, {
22132
22162
  stdio: ["ignore", "pipe", "pipe"],
22133
22163
  shell: process.platform === "win32",
@@ -22138,7 +22168,7 @@ function runShellCommand(cmd, opts = {}) {
22138
22168
  stderr += chunk.toString();
22139
22169
  });
22140
22170
  child.on("close", (code, signal) => {
22141
- if (code === 0) resolve16();
22171
+ if (code === 0) resolve17();
22142
22172
  else
22143
22173
  reject(
22144
22174
  new ShellCommandError(
@@ -22154,6 +22184,8 @@ function runShellCommand(cmd, opts = {}) {
22154
22184
 
22155
22185
  // ../argent-installer/src/skills.ts
22156
22186
  import { execFileSync as execFileSync6 } from "node:child_process";
22187
+ import * as fs19 from "node:fs";
22188
+ import * as path20 from "node:path";
22157
22189
  var import_picocolors2 = __toESM(require_picocolors(), 1);
22158
22190
  function getScopeSpecs(projectRoot) {
22159
22191
  return [
@@ -22215,10 +22247,58 @@ function refreshArgentSkills(projectRoot) {
22215
22247
  result.pruneError = err instanceof Error ? err.message.split("\n")[0] : String(err);
22216
22248
  }
22217
22249
  }
22250
+ for (const name of pruneLegacySkillDirs(projectRoot, spec.scope, bundled)) {
22251
+ if (!result.pruned.includes(name)) result.pruned.push(name);
22252
+ }
22218
22253
  results.push(result);
22219
22254
  }
22220
22255
  return results;
22221
22256
  }
22257
+ function pruneLegacySkillDirs(projectRoot, scope, bundled = new Set(listBundledSkills())) {
22258
+ if (bundled.size === 0) return [];
22259
+ const legacy = LEGACY_ARGENT_SKILL_NAMES.filter((name) => !bundled.has(name));
22260
+ const { skillTargets } = getManagedContentTargets(
22261
+ ALL_ADAPTERS,
22262
+ projectRoot,
22263
+ scope === "global" ? "global" : "local"
22264
+ );
22265
+ const removed = /* @__PURE__ */ new Set();
22266
+ for (const { targetPath } of skillTargets) {
22267
+ for (const name of legacy) {
22268
+ const dir = path20.join(targetPath, name);
22269
+ try {
22270
+ if (!fs19.lstatSync(dir, { throwIfNoEntry: false })) continue;
22271
+ fs19.rmSync(dir, { recursive: true, force: true });
22272
+ removed.add(name);
22273
+ } catch {
22274
+ }
22275
+ }
22276
+ }
22277
+ const lockPath = scope === "global" ? getGlobalSkillLockPath() : getProjectSkillLockPath(projectRoot);
22278
+ for (const name of removeLockEntries(lockPath, legacy)) removed.add(name);
22279
+ return [...removed].sort();
22280
+ }
22281
+ function listTrackedLegacySkills(projectRoot, scope, bundled = new Set(listBundledSkills())) {
22282
+ if (bundled.size === 0) return [];
22283
+ const lockPath = scope === "global" ? getGlobalSkillLockPath() : getProjectSkillLockPath(projectRoot);
22284
+ return listArgentSkillsInLock(lockPath).filter(
22285
+ (name) => LEGACY_ARGENT_SKILL_NAMES.includes(name) && !bundled.has(name)
22286
+ );
22287
+ }
22288
+ function removeLockEntries(lockPath, names) {
22289
+ try {
22290
+ const lock = JSON.parse(fs19.readFileSync(lockPath, "utf8"));
22291
+ const skills = lock.skills;
22292
+ if (!skills) return [];
22293
+ const removed = names.filter((name) => name in skills);
22294
+ if (removed.length === 0) return [];
22295
+ for (const name of removed) delete skills[name];
22296
+ fs19.writeFileSync(lockPath, JSON.stringify(lock, null, 2) + "\n");
22297
+ return removed;
22298
+ } catch {
22299
+ return [];
22300
+ }
22301
+ }
22222
22302
  function formatSkillRefreshSummary(results) {
22223
22303
  const lines = [];
22224
22304
  for (const r2 of results) {
@@ -22581,7 +22661,7 @@ async function chooseAdapters(opts) {
22581
22661
  // ../argent-installer/src/init-scope.ts
22582
22662
  var import_picocolors5 = __toESM(require_picocolors(), 1);
22583
22663
  import { existsSync as existsSync13 } from "node:fs";
22584
- import { resolve as resolve10 } from "node:path";
22664
+ import { resolve as resolve11 } from "node:path";
22585
22665
  async function chooseScope(opts) {
22586
22666
  if (opts.installMode === "local") {
22587
22667
  return { scope: "local" };
@@ -22618,13 +22698,13 @@ async function chooseScope(opts) {
22618
22698
  placeholder: process.cwd(),
22619
22699
  validate(value) {
22620
22700
  if (!value?.trim()) return "Path cannot be empty.";
22621
- const resolved = resolve10(value.trim());
22701
+ const resolved = resolve11(value.trim());
22622
22702
  if (!existsSync13(resolved))
22623
22703
  return `Path does not exist: ${resolved}. Please verify and enter a valid path.`;
22624
22704
  }
22625
22705
  });
22626
22706
  if (isCancel(customPathInput)) throw new InitCancelled("scope");
22627
- return { scope: "custom", customRoot: resolve10(customPathInput.trim()) };
22707
+ return { scope: "custom", customRoot: resolve11(customPathInput.trim()) };
22628
22708
  }
22629
22709
 
22630
22710
  // ../argent-installer/src/init-mcp-write.ts
@@ -22913,6 +22993,7 @@ async function configureAllowlist(args) {
22913
22993
  // ../argent-installer/src/init-skills.ts
22914
22994
  var import_picocolors9 = __toESM(require_picocolors(), 1);
22915
22995
  import { spawn as spawn3 } from "node:child_process";
22996
+ import * as os3 from "node:os";
22916
22997
  async function runSkillsStep(args) {
22917
22998
  const { nonInteractive, fromTar, version, scope, customRoot } = args;
22918
22999
  log.step(import_picocolors9.default.bold("Step 2: Skills Installation"));
@@ -23000,6 +23081,33 @@ async function runSkillsStep(args) {
23000
23081
  spinner2.stop("Skills installed.");
23001
23082
  }
23002
23083
  skillOutcome = "success";
23084
+ const sourceIsBundled = skillsSource === SKILLS_DIR || version === getInstalledVersion();
23085
+ if (skillsMethod === "default" && sourceIsBundled) {
23086
+ const pruneRoot = scope === "global" ? os3.homedir() : skillsCwd ?? process.cwd();
23087
+ const pruneScope = scope === "global" ? "global" : "project";
23088
+ const tracked = listTrackedLegacySkills(pruneRoot, pruneScope);
23089
+ const removed = /* @__PURE__ */ new Set();
23090
+ if (tracked.length > 0) {
23091
+ const removeArgs = ["skills", "remove", "-y", ...scope === "global" ? ["-g"] : []];
23092
+ try {
23093
+ await runNpxSkills(
23094
+ withNpmForce([
23095
+ ...offlineWithCache ? ["--no-install"] : [],
23096
+ ...removeArgs,
23097
+ ...tracked
23098
+ ]),
23099
+ false,
23100
+ skillsCwd
23101
+ );
23102
+ for (const name of tracked) removed.add(name);
23103
+ } catch {
23104
+ }
23105
+ }
23106
+ for (const name of pruneLegacySkillDirs(pruneRoot, pruneScope)) removed.add(name);
23107
+ if (removed.size > 0) {
23108
+ log.info(import_picocolors9.default.dim(`Removed legacy skills: ${[...removed].sort().join(", ")}`));
23109
+ }
23110
+ }
23003
23111
  } catch (err) {
23004
23112
  if (skillsMethod === "default") {
23005
23113
  spinner2.stop(import_picocolors9.default.red("Skills installation failed."));
@@ -23019,7 +23127,7 @@ async function runSkillsStep(args) {
23019
23127
  return skillsMethod;
23020
23128
  }
23021
23129
  function runNpxSkills(args, interactive, cwd) {
23022
- return new Promise((resolve16, reject) => {
23130
+ return new Promise((resolve17, reject) => {
23023
23131
  const npxCmd = process.platform === "win32" ? "npx.cmd" : "npx";
23024
23132
  const child = spawn3(npxCmd, args, {
23025
23133
  env: npxChildEnv(),
@@ -23039,7 +23147,7 @@ function runNpxSkills(args, interactive, cwd) {
23039
23147
  }
23040
23148
  child.on("close", (code) => {
23041
23149
  if (code === 0) {
23042
- resolve16();
23150
+ resolve17();
23043
23151
  } else {
23044
23152
  const output = [stderr, stdout2].filter(Boolean).join("\n").trim();
23045
23153
  reject(new Error(output || `npx skills exited with code ${code}`));
@@ -23324,7 +23432,7 @@ function printBanner() {
23324
23432
  // ../argent-installer/src/update.ts
23325
23433
  var import_picocolors11 = __toESM(require_picocolors(), 1);
23326
23434
  var import_semver5 = __toESM(require_semver2(), 1);
23327
- import * as path24 from "node:path";
23435
+ import * as path26 from "node:path";
23328
23436
 
23329
23437
  // ../argent-installer/src/install-targets.ts
23330
23438
  function parseTargetFlags(args) {
@@ -23389,17 +23497,17 @@ async function resolveInstallableUpdateTarget(pm, current) {
23389
23497
 
23390
23498
  // ../argent-tools-client/src/launcher.ts
23391
23499
  import * as net from "node:net";
23392
- import * as fs18 from "node:fs";
23393
- import * as path19 from "node:path";
23500
+ import * as fs20 from "node:fs";
23501
+ import * as path21 from "node:path";
23394
23502
  import * as readline from "node:readline";
23395
- import { homedir as homedir5 } from "node:os";
23503
+ import { homedir as homedir6 } from "node:os";
23396
23504
  import { spawn as spawn4, execFileSync as execFileSync7 } from "node:child_process";
23397
23505
  import { createHash as createHash2, randomBytes } from "node:crypto";
23398
23506
  import { mkdir, writeFile, readFile, readdir as readdir2, unlink, rename, chmod } from "node:fs/promises";
23399
- var STATE_DIR = path19.join(homedir5(), ".argent");
23400
- var STATE_FILE = path19.join(STATE_DIR, "tool-server.json");
23401
- var LOG_FILE = path19.join(STATE_DIR, "tool-server.log");
23402
- var LOCK_FILE = path19.join(STATE_DIR, "tool-server.lock");
23507
+ var STATE_DIR = path21.join(homedir6(), ".argent");
23508
+ var STATE_FILE = path21.join(STATE_DIR, "tool-server.json");
23509
+ var LOG_FILE = path21.join(STATE_DIR, "tool-server.log");
23510
+ var LOCK_FILE = path21.join(STATE_DIR, "tool-server.lock");
23403
23511
  function isProcessAlive(pid) {
23404
23512
  try {
23405
23513
  process.kill(pid, 0);
@@ -23410,7 +23518,7 @@ function isProcessAlive(pid) {
23410
23518
  }
23411
23519
  function stateFileForBundle(bundlePath) {
23412
23520
  const key = createHash2("sha256").update(bundlePath).digest("hex").slice(0, 12);
23413
- return path19.join(STATE_DIR, `tool-server-${key}.json`);
23521
+ return path21.join(STATE_DIR, `tool-server-${key}.json`);
23414
23522
  }
23415
23523
  async function readStateFile(file) {
23416
23524
  try {
@@ -23452,7 +23560,7 @@ async function readAllToolsServerStates() {
23452
23560
  const out = [];
23453
23561
  for (const name of names) {
23454
23562
  if (!STATE_FILE_RE.test(name)) continue;
23455
- const file = path19.join(STATE_DIR, name);
23563
+ const file = path21.join(STATE_DIR, name);
23456
23564
  const state2 = await readStateFile(file);
23457
23565
  if (state2) out.push({ file, state: state2 });
23458
23566
  }
@@ -23498,21 +23606,21 @@ async function killToolServer(bundlePath) {
23498
23606
  return alive;
23499
23607
  }
23500
23608
  function isPathWithin(child, parent) {
23501
- const rel = path19.relative(parent, child);
23502
- return rel !== "" && !rel.startsWith("..") && !path19.isAbsolute(rel);
23609
+ const rel = path21.relative(parent, child);
23610
+ return rel !== "" && !rel.startsWith("..") && !path21.isAbsolute(rel);
23503
23611
  }
23504
23612
  function tryRealpath(p) {
23505
23613
  try {
23506
- return fs18.realpathSync(p);
23614
+ return fs20.realpathSync(p);
23507
23615
  } catch {
23508
23616
  return p;
23509
23617
  }
23510
23618
  }
23511
23619
  async function killToolServerForInstallDir(packageDir) {
23512
- const parents = /* @__PURE__ */ new Set([path19.resolve(packageDir), tryRealpath(packageDir)]);
23620
+ const parents = /* @__PURE__ */ new Set([path21.resolve(packageDir), tryRealpath(packageDir)]);
23513
23621
  let killed = 0;
23514
23622
  for (const { file, state: state2 } of await readAllToolsServerStates()) {
23515
- const bundles = /* @__PURE__ */ new Set([path19.resolve(state2.bundlePath), tryRealpath(state2.bundlePath)]);
23623
+ const bundles = /* @__PURE__ */ new Set([path21.resolve(state2.bundlePath), tryRealpath(state2.bundlePath)]);
23516
23624
  const matches2 = [...bundles].some((b) => [...parents].some((p) => isPathWithin(b, p)));
23517
23625
  if (!matches2) continue;
23518
23626
  const fresh = await readStateFile(file);
@@ -23530,7 +23638,7 @@ async function killToolServerForInstallDir(packageDir) {
23530
23638
  }
23531
23639
  return killed;
23532
23640
  }
23533
- var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs18.existsSync(p)) ?? "ps";
23641
+ var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs20.existsSync(p)) ?? "ps";
23534
23642
  var PS_WIDTH_FLAGS = ["-ww"];
23535
23643
  var PS_LOCALE = process.platform === "darwin" ? "en_US.UTF-8" : "C.UTF-8";
23536
23644
  function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS, env = { ...process.env, LC_ALL: PS_LOCALE }) {
@@ -23574,18 +23682,18 @@ function couldBeOurToolServer(pid, marker) {
23574
23682
  }
23575
23683
 
23576
23684
  // ../argent-tools-client/src/tools-client.ts
23577
- import * as path23 from "node:path";
23685
+ import * as path25 from "node:path";
23578
23686
 
23579
23687
  // ../argent-tools-client/src/link-config.ts
23580
- import * as path20 from "node:path";
23581
- import { homedir as homedir6 } from "node:os";
23688
+ import * as path22 from "node:path";
23689
+ import { homedir as homedir7 } from "node:os";
23582
23690
  import { mkdir as mkdir2, writeFile as writeFile2, readFile as readFile2, unlink as unlink2, chmod as chmod2 } from "node:fs/promises";
23583
- var LINK_DIR = path20.join(homedir6(), ".argent");
23584
- var LINK_FILE = path20.join(LINK_DIR, "link.json");
23691
+ var LINK_DIR = path22.join(homedir7(), ".argent");
23692
+ var LINK_FILE = path22.join(LINK_DIR, "link.json");
23585
23693
 
23586
23694
  // ../argent-tools-client/src/file-inputs.ts
23587
23695
  import { createHash as createHash3, randomUUID as randomUUID6 } from "node:crypto";
23588
- import { createReadStream, rmSync as rmSync6 } from "node:fs";
23696
+ import { createReadStream, rmSync as rmSync7 } from "node:fs";
23589
23697
  import {
23590
23698
  chmod as chmod3,
23591
23699
  lstat,
@@ -23594,16 +23702,16 @@ import {
23594
23702
  realpath as realpath2,
23595
23703
  rename as rename2,
23596
23704
  rm as rm2,
23597
- stat as stat2,
23705
+ stat as stat3,
23598
23706
  writeFile as writeFile3
23599
23707
  } from "node:fs/promises";
23600
23708
  import { constants, tmpdir } from "node:os";
23601
- import * as path21 from "node:path";
23709
+ import * as path23 from "node:path";
23602
23710
 
23603
23711
  // ../archive/src/index.ts
23604
23712
  import { execFile } from "node:child_process";
23605
23713
  import { rm, readdir as readdir3 } from "node:fs/promises";
23606
- import { basename as basename3, dirname as dirname12, join as join20, posix as posix2, resolve as resolve12, sep as sep4 } from "node:path";
23714
+ import { basename as basename4, dirname as dirname13, join as join22, posix as posix2, resolve as resolve13, sep as sep4 } from "node:path";
23607
23715
  import { promisify } from "node:util";
23608
23716
  var execFileAsync = promisify(execFile);
23609
23717
 
@@ -23612,15 +23720,15 @@ var MAX_CONTENT_BYTES = 32 * 1024 * 1024;
23612
23720
 
23613
23721
  // ../argent-tools-client/src/flow-files.ts
23614
23722
  var import_yaml3 = __toESM(require_dist2(), 1);
23615
- import { readdir as readdir4, readFile as readFile4, realpath as realpath3, stat as stat3 } from "node:fs/promises";
23616
- import * as path22 from "node:path";
23723
+ import { readdir as readdir4, readFile as readFile4, realpath as realpath3, stat as stat4 } from "node:fs/promises";
23724
+ import * as path24 from "node:path";
23617
23725
  var INLINE_MEMBERS_BYTES = 256 * 1024;
23618
23726
 
23619
23727
  // ../argent-tools-client/src/artifacts.ts
23620
- import { copyFile, mkdir as mkdir4, readFile as readFile5, realpath as realpath4, rm as rm3, stat as stat4, writeFile as writeFile4 } from "node:fs/promises";
23728
+ import { copyFile, mkdir as mkdir4, readFile as readFile5, realpath as realpath4, rm as rm3, stat as stat5, writeFile as writeFile4 } from "node:fs/promises";
23621
23729
  import { constants as fsConstants } from "node:fs";
23622
23730
  import { tmpdir as tmpdir2 } from "node:os";
23623
- import { basename as basename6, dirname as dirname16, extname as extname2, isAbsolute as isAbsolute8, join as join23, normalize as normalize2, resolve as resolve14, sep as sep6 } from "node:path";
23731
+ import { basename as basename7, dirname as dirname17, extname as extname2, isAbsolute as isAbsolute8, join as join26, normalize as normalize2, resolve as resolve15, sep as sep6 } from "node:path";
23624
23732
  import { createHash as createHash4 } from "node:crypto";
23625
23733
  var ALLOWED_SAVE_DIRS = /* @__PURE__ */ new Set([normalize2(".argent/recordings")]);
23626
23734
  var RECORDINGS_SAVE_DIR = normalize2(".argent/recordings");
@@ -23979,7 +24087,7 @@ async function update(args) {
23979
24087
  process.exit(1);
23980
24088
  }
23981
24089
  const rootOverride = getProjectRootOverride(args);
23982
- const projectRoot = rootOverride ? path24.resolve(rootOverride) : resolveProjectRoot2(process.cwd());
24090
+ const projectRoot = rootOverride ? path26.resolve(rootOverride) : resolveProjectRoot2(process.cwd());
23983
24091
  installMode = resolveInstallMode(projectRoot);
23984
24092
  const flags = parseTargetFlags(args);
23985
24093
  const localInstalled = installMode === "local" && probeLocalInstall(projectRoot).installed;
@@ -24162,8 +24270,8 @@ async function update(args) {
24162
24270
  // ../argent-installer/src/uninstall.ts
24163
24271
  var import_picocolors12 = __toESM(require_picocolors(), 1);
24164
24272
  var import_yaml4 = __toESM(require_dist2(), 1);
24165
- import * as fs19 from "node:fs";
24166
- import * as path25 from "node:path";
24273
+ import * as fs21 from "node:fs";
24274
+ import * as path27 from "node:path";
24167
24275
  var UNINSTALL_TOOLSERVER_STOP_FAILED = {
24168
24276
  error_code: FAILURE_CODES.UNINSTALL_TOOLSERVER_STOP_FAILED,
24169
24277
  failure_stage: "installer_uninstall_toolserver_stop",
@@ -24184,10 +24292,10 @@ var UNINSTALL_UNCLASSIFIED_FAILED = {
24184
24292
  };
24185
24293
  function removeDirIfEmpty2(dirPath) {
24186
24294
  try {
24187
- if (!fs19.existsSync(dirPath)) return false;
24188
- if (!fs19.statSync(dirPath).isDirectory()) return false;
24189
- if (fs19.readdirSync(dirPath).length > 0) return false;
24190
- fs19.rmdirSync(dirPath);
24295
+ if (!fs21.existsSync(dirPath)) return false;
24296
+ if (!fs21.statSync(dirPath).isDirectory()) return false;
24297
+ if (fs21.readdirSync(dirPath).length > 0) return false;
24298
+ fs21.rmdirSync(dirPath);
24191
24299
  return true;
24192
24300
  } catch {
24193
24301
  return false;
@@ -24197,9 +24305,9 @@ function collectBundledPaths(sourceDir) {
24197
24305
  const files = [];
24198
24306
  const directories = [];
24199
24307
  function walk(currentDir, relativeDir = "") {
24200
- for (const entry of fs19.readdirSync(currentDir, { withFileTypes: true })) {
24201
- const relativePath = relativeDir ? path25.join(relativeDir, entry.name) : entry.name;
24202
- const absolutePath = path25.join(currentDir, entry.name);
24308
+ for (const entry of fs21.readdirSync(currentDir, { withFileTypes: true })) {
24309
+ const relativePath = relativeDir ? path27.join(relativeDir, entry.name) : entry.name;
24310
+ const absolutePath = path27.join(currentDir, entry.name);
24203
24311
  if (entry.isDirectory()) {
24204
24312
  walk(absolutePath, relativePath);
24205
24313
  directories.push(relativePath);
@@ -24212,52 +24320,52 @@ function collectBundledPaths(sourceDir) {
24212
24320
  return { files, directories };
24213
24321
  }
24214
24322
  function removeBundledContent(sourceDir, targetDir) {
24215
- if (!fs19.existsSync(sourceDir) || !fs19.existsSync(targetDir)) {
24323
+ if (!fs21.existsSync(sourceDir) || !fs21.existsSync(targetDir)) {
24216
24324
  return { removedPaths: [], removedRoot: false };
24217
24325
  }
24218
24326
  const { files, directories } = collectBundledPaths(sourceDir);
24219
24327
  const removedPaths = [];
24220
24328
  for (const relativePath of files) {
24221
- const targetPath = path25.join(targetDir, relativePath);
24329
+ const targetPath = path27.join(targetDir, relativePath);
24222
24330
  try {
24223
- if (!fs19.existsSync(targetPath)) continue;
24224
- if (fs19.lstatSync(targetPath).isDirectory()) continue;
24225
- fs19.rmSync(targetPath, { force: true });
24331
+ if (!fs21.existsSync(targetPath)) continue;
24332
+ if (fs21.lstatSync(targetPath).isDirectory()) continue;
24333
+ fs21.rmSync(targetPath, { force: true });
24226
24334
  removedPaths.push(relativePath);
24227
24335
  } catch {
24228
24336
  }
24229
24337
  }
24230
24338
  directories.sort(
24231
- (a2, b) => b.split(path25.sep).length - a2.split(path25.sep).length || b.length - a2.length
24339
+ (a2, b) => b.split(path27.sep).length - a2.split(path27.sep).length || b.length - a2.length
24232
24340
  );
24233
24341
  for (const relativePath of directories) {
24234
- const targetPath = path25.join(targetDir, relativePath);
24342
+ const targetPath = path27.join(targetDir, relativePath);
24235
24343
  try {
24236
- if (!fs19.existsSync(targetPath)) continue;
24237
- if (!fs19.statSync(targetPath).isDirectory()) continue;
24238
- if (fs19.readdirSync(targetPath).length > 0) continue;
24239
- fs19.rmdirSync(targetPath);
24344
+ if (!fs21.existsSync(targetPath)) continue;
24345
+ if (!fs21.statSync(targetPath).isDirectory()) continue;
24346
+ if (fs21.readdirSync(targetPath).length > 0) continue;
24347
+ fs21.rmdirSync(targetPath);
24240
24348
  } catch {
24241
24349
  }
24242
24350
  }
24243
24351
  let removedRoot = false;
24244
24352
  try {
24245
- if (fs19.existsSync(targetDir) && fs19.statSync(targetDir).isDirectory()) {
24246
- if (fs19.readdirSync(targetDir).length === 0) {
24247
- fs19.rmdirSync(targetDir);
24353
+ if (fs21.existsSync(targetDir) && fs21.statSync(targetDir).isDirectory()) {
24354
+ if (fs21.readdirSync(targetDir).length === 0) {
24355
+ fs21.rmdirSync(targetDir);
24248
24356
  removedRoot = true;
24249
24357
  }
24250
24358
  }
24251
24359
  } catch {
24252
24360
  }
24253
24361
  if (removedRoot) {
24254
- removeDirIfEmpty2(path25.dirname(targetDir));
24362
+ removeDirIfEmpty2(path27.dirname(targetDir));
24255
24363
  }
24256
24364
  return { removedPaths, removedRoot };
24257
24365
  }
24258
24366
  function readBundledSkillName(skillFilePath, fallbackName) {
24259
24367
  try {
24260
- const content = fs19.readFileSync(skillFilePath, "utf8");
24368
+ const content = fs21.readFileSync(skillFilePath, "utf8");
24261
24369
  const frontmatter = content.match(/^---\r?\n([\s\S]*?)\r?\n---/)?.[1];
24262
24370
  if (!frontmatter) return fallbackName;
24263
24371
  const data = (0, import_yaml4.parse)(frontmatter);
@@ -24268,30 +24376,30 @@ function readBundledSkillName(skillFilePath, fallbackName) {
24268
24376
  }
24269
24377
  }
24270
24378
  function getBundledSkillNames(skillsDir) {
24271
- if (!fs19.existsSync(skillsDir)) return [];
24379
+ if (!fs21.existsSync(skillsDir)) return [];
24272
24380
  const skillNames = [];
24273
- for (const entry of fs19.readdirSync(skillsDir, { withFileTypes: true })) {
24381
+ for (const entry of fs21.readdirSync(skillsDir, { withFileTypes: true })) {
24274
24382
  if (!entry.isDirectory()) continue;
24275
- const skillFilePath = path25.join(skillsDir, entry.name, "SKILL.md");
24276
- if (!fs19.existsSync(skillFilePath)) continue;
24383
+ const skillFilePath = path27.join(skillsDir, entry.name, "SKILL.md");
24384
+ if (!fs21.existsSync(skillFilePath)) continue;
24277
24385
  skillNames.push(readBundledSkillName(skillFilePath, entry.name));
24278
24386
  }
24279
24387
  return [...new Set(skillNames)].sort();
24280
24388
  }
24281
24389
  function removeBundledSkillInstalls(skillNames, targetDir) {
24282
- if (!fs19.existsSync(targetDir)) {
24390
+ if (!fs21.existsSync(targetDir)) {
24283
24391
  return { removedPaths: [], removedRoot: false };
24284
24392
  }
24285
24393
  const removedPaths = [];
24286
24394
  for (const skillName of skillNames) {
24287
- const targetPath = path25.join(targetDir, skillName);
24395
+ const targetPath = path27.join(targetDir, skillName);
24288
24396
  try {
24289
- const stats = fs19.lstatSync(targetPath, { throwIfNoEntry: false });
24397
+ const stats = fs21.lstatSync(targetPath, { throwIfNoEntry: false });
24290
24398
  if (!stats) continue;
24291
24399
  if (stats.isDirectory() && !stats.isSymbolicLink()) {
24292
- fs19.rmSync(targetPath, { recursive: true, force: true });
24400
+ fs21.rmSync(targetPath, { recursive: true, force: true });
24293
24401
  } else {
24294
- fs19.rmSync(targetPath, { force: true });
24402
+ fs21.rmSync(targetPath, { force: true });
24295
24403
  }
24296
24404
  removedPaths.push(skillName);
24297
24405
  } catch {
@@ -24299,17 +24407,17 @@ function removeBundledSkillInstalls(skillNames, targetDir) {
24299
24407
  }
24300
24408
  const removedRoot = removeDirIfEmpty2(targetDir);
24301
24409
  if (removedRoot) {
24302
- removeDirIfEmpty2(path25.dirname(targetDir));
24410
+ removeDirIfEmpty2(path27.dirname(targetDir));
24303
24411
  }
24304
24412
  return { removedPaths, removedRoot };
24305
24413
  }
24306
24414
  function cleanupSkillsLockFile(lockPath, skillNames) {
24307
- if (!fs19.existsSync(lockPath)) {
24415
+ if (!fs21.existsSync(lockPath)) {
24308
24416
  return { removedSkills: [], removedFile: false };
24309
24417
  }
24310
24418
  let parsed;
24311
24419
  try {
24312
- parsed = JSON.parse(fs19.readFileSync(lockPath, "utf8"));
24420
+ parsed = JSON.parse(fs21.readFileSync(lockPath, "utf8"));
24313
24421
  } catch {
24314
24422
  return { removedSkills: [], removedFile: false };
24315
24423
  }
@@ -24336,10 +24444,10 @@ function cleanupSkillsLockFile(lockPath, skillNames) {
24336
24444
  parsed.skills && typeof parsed.skills === "object" && Object.keys(parsed.skills).length > 0
24337
24445
  );
24338
24446
  if (!hasSkills && otherKeys.length === 0) {
24339
- fs19.rmSync(lockPath, { force: true });
24447
+ fs21.rmSync(lockPath, { force: true });
24340
24448
  return { removedSkills, removedFile: true };
24341
24449
  }
24342
- fs19.writeFileSync(lockPath, JSON.stringify(parsed, null, 2) + "\n");
24450
+ fs21.writeFileSync(lockPath, JSON.stringify(parsed, null, 2) + "\n");
24343
24451
  return { removedSkills, removedFile: false };
24344
24452
  }
24345
24453
  function cleanupBundledSkills(skillNames, targets) {
@@ -24505,9 +24613,11 @@ async function uninstall(args) {
24505
24613
  };
24506
24614
  const localTargets = scopesToClean.has("local") ? getManagedContentTargets(ALL_ADAPTERS, projectRoot, "local") : emptyTargets;
24507
24615
  const globalTargets = scopesToClean.has("global") ? getManagedContentTargets(ALL_ADAPTERS, projectRoot, "global") : emptyTargets;
24508
- const bundledSkillNames = getBundledSkillNames(SKILLS_DIR);
24616
+ const argentSkillNames = [
24617
+ .../* @__PURE__ */ new Set([...getBundledSkillNames(SKILLS_DIR), ...LEGACY_ARGENT_SKILL_NAMES])
24618
+ ].sort();
24509
24619
  pruneResults.push(
24510
- ...cleanupBundledSkills(bundledSkillNames, [
24620
+ ...cleanupBundledSkills(argentSkillNames, [
24511
24621
  ...localTargets.skillTargets,
24512
24622
  ...globalTargets.skillTargets
24513
24623
  ])
@@ -24519,7 +24629,7 @@ async function uninstall(args) {
24519
24629
  try {
24520
24630
  const { removedSkills, removedFile } = cleanupSkillsLockFile(
24521
24631
  targetPath,
24522
- bundledSkillNames
24632
+ argentSkillNames
24523
24633
  );
24524
24634
  if (removedSkills.length === 0 && !removedFile) continue;
24525
24635
  const itemsLabel = removedSkills.length === 1 ? "skill" : "skills";