@swmansion/argent 0.18.0 → 0.18.1-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2238,17 +2238,17 @@ var require_visit = __commonJS({
2238
2238
  visit2.BREAK = BREAK;
2239
2239
  visit2.SKIP = SKIP;
2240
2240
  visit2.REMOVE = REMOVE;
2241
- function visit_(key, node, visitor, path19) {
2242
- const ctrl = callVisitor(key, node, visitor, path19);
2241
+ function visit_(key, node, visitor, path20) {
2242
+ const ctrl = callVisitor(key, node, visitor, path20);
2243
2243
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
2244
- replaceNode(key, path19, ctrl);
2245
- return visit_(key, ctrl, visitor, path19);
2244
+ replaceNode(key, path20, ctrl);
2245
+ return visit_(key, ctrl, visitor, path20);
2246
2246
  }
2247
2247
  if (typeof ctrl !== "symbol") {
2248
2248
  if (identity.isCollection(node)) {
2249
- path19 = Object.freeze(path19.concat(node));
2249
+ path20 = Object.freeze(path20.concat(node));
2250
2250
  for (let i2 = 0; i2 < node.items.length; ++i2) {
2251
- const ci = visit_(i2, node.items[i2], visitor, path19);
2251
+ const ci = visit_(i2, node.items[i2], visitor, path20);
2252
2252
  if (typeof ci === "number")
2253
2253
  i2 = ci - 1;
2254
2254
  else if (ci === BREAK)
@@ -2259,13 +2259,13 @@ var require_visit = __commonJS({
2259
2259
  }
2260
2260
  }
2261
2261
  } else if (identity.isPair(node)) {
2262
- path19 = Object.freeze(path19.concat(node));
2263
- const ck = visit_("key", node.key, visitor, path19);
2262
+ path20 = Object.freeze(path20.concat(node));
2263
+ const ck = visit_("key", node.key, visitor, path20);
2264
2264
  if (ck === BREAK)
2265
2265
  return BREAK;
2266
2266
  else if (ck === REMOVE)
2267
2267
  node.key = null;
2268
- const cv = visit_("value", node.value, visitor, path19);
2268
+ const cv = visit_("value", node.value, visitor, path20);
2269
2269
  if (cv === BREAK)
2270
2270
  return BREAK;
2271
2271
  else if (cv === REMOVE)
@@ -2286,17 +2286,17 @@ var require_visit = __commonJS({
2286
2286
  visitAsync.BREAK = BREAK;
2287
2287
  visitAsync.SKIP = SKIP;
2288
2288
  visitAsync.REMOVE = REMOVE;
2289
- async function visitAsync_(key, node, visitor, path19) {
2290
- const ctrl = await callVisitor(key, node, visitor, path19);
2289
+ async function visitAsync_(key, node, visitor, path20) {
2290
+ const ctrl = await callVisitor(key, node, visitor, path20);
2291
2291
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
2292
- replaceNode(key, path19, ctrl);
2293
- return visitAsync_(key, ctrl, visitor, path19);
2292
+ replaceNode(key, path20, ctrl);
2293
+ return visitAsync_(key, ctrl, visitor, path20);
2294
2294
  }
2295
2295
  if (typeof ctrl !== "symbol") {
2296
2296
  if (identity.isCollection(node)) {
2297
- path19 = Object.freeze(path19.concat(node));
2297
+ path20 = Object.freeze(path20.concat(node));
2298
2298
  for (let i2 = 0; i2 < node.items.length; ++i2) {
2299
- const ci = await visitAsync_(i2, node.items[i2], visitor, path19);
2299
+ const ci = await visitAsync_(i2, node.items[i2], visitor, path20);
2300
2300
  if (typeof ci === "number")
2301
2301
  i2 = ci - 1;
2302
2302
  else if (ci === BREAK)
@@ -2307,13 +2307,13 @@ var require_visit = __commonJS({
2307
2307
  }
2308
2308
  }
2309
2309
  } else if (identity.isPair(node)) {
2310
- path19 = Object.freeze(path19.concat(node));
2311
- const ck = await visitAsync_("key", node.key, visitor, path19);
2310
+ path20 = Object.freeze(path20.concat(node));
2311
+ const ck = await visitAsync_("key", node.key, visitor, path20);
2312
2312
  if (ck === BREAK)
2313
2313
  return BREAK;
2314
2314
  else if (ck === REMOVE)
2315
2315
  node.key = null;
2316
- const cv = await visitAsync_("value", node.value, visitor, path19);
2316
+ const cv = await visitAsync_("value", node.value, visitor, path20);
2317
2317
  if (cv === BREAK)
2318
2318
  return BREAK;
2319
2319
  else if (cv === REMOVE)
@@ -2340,23 +2340,23 @@ var require_visit = __commonJS({
2340
2340
  }
2341
2341
  return visitor;
2342
2342
  }
2343
- function callVisitor(key, node, visitor, path19) {
2343
+ function callVisitor(key, node, visitor, path20) {
2344
2344
  if (typeof visitor === "function")
2345
- return visitor(key, node, path19);
2345
+ return visitor(key, node, path20);
2346
2346
  if (identity.isMap(node))
2347
- return visitor.Map?.(key, node, path19);
2347
+ return visitor.Map?.(key, node, path20);
2348
2348
  if (identity.isSeq(node))
2349
- return visitor.Seq?.(key, node, path19);
2349
+ return visitor.Seq?.(key, node, path20);
2350
2350
  if (identity.isPair(node))
2351
- return visitor.Pair?.(key, node, path19);
2351
+ return visitor.Pair?.(key, node, path20);
2352
2352
  if (identity.isScalar(node))
2353
- return visitor.Scalar?.(key, node, path19);
2353
+ return visitor.Scalar?.(key, node, path20);
2354
2354
  if (identity.isAlias(node))
2355
- return visitor.Alias?.(key, node, path19);
2355
+ return visitor.Alias?.(key, node, path20);
2356
2356
  return void 0;
2357
2357
  }
2358
- function replaceNode(key, path19, node) {
2359
- const parent = path19[path19.length - 1];
2358
+ function replaceNode(key, path20, node) {
2359
+ const parent = path20[path20.length - 1];
2360
2360
  if (identity.isCollection(parent)) {
2361
2361
  parent.items[key] = node;
2362
2362
  } else if (identity.isPair(parent)) {
@@ -2966,10 +2966,10 @@ var require_Collection = __commonJS({
2966
2966
  var createNode = require_createNode();
2967
2967
  var identity = require_identity();
2968
2968
  var Node = require_Node();
2969
- function collectionFromPath(schema, path19, value) {
2969
+ function collectionFromPath(schema, path20, value) {
2970
2970
  let v = value;
2971
- for (let i2 = path19.length - 1; i2 >= 0; --i2) {
2972
- const k = path19[i2];
2971
+ for (let i2 = path20.length - 1; i2 >= 0; --i2) {
2972
+ const k = path20[i2];
2973
2973
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
2974
2974
  const a3 = [];
2975
2975
  a3[k] = v;
@@ -2988,7 +2988,7 @@ var require_Collection = __commonJS({
2988
2988
  sourceObjects: /* @__PURE__ */ new Map()
2989
2989
  });
2990
2990
  }
2991
- var isEmptyPath = (path19) => path19 == null || typeof path19 === "object" && !!path19[Symbol.iterator]().next().done;
2991
+ var isEmptyPath = (path20) => path20 == null || typeof path20 === "object" && !!path20[Symbol.iterator]().next().done;
2992
2992
  var Collection = class extends Node.NodeBase {
2993
2993
  constructor(type, schema) {
2994
2994
  super(type);
@@ -3018,11 +3018,11 @@ var require_Collection = __commonJS({
3018
3018
  * be a Pair instance or a `{ key, value }` object, which may not have a key
3019
3019
  * that already exists in the map.
3020
3020
  */
3021
- addIn(path19, value) {
3022
- if (isEmptyPath(path19))
3021
+ addIn(path20, value) {
3022
+ if (isEmptyPath(path20))
3023
3023
  this.add(value);
3024
3024
  else {
3025
- const [key, ...rest] = path19;
3025
+ const [key, ...rest] = path20;
3026
3026
  const node = this.get(key, true);
3027
3027
  if (identity.isCollection(node))
3028
3028
  node.addIn(rest, value);
@@ -3036,8 +3036,8 @@ var require_Collection = __commonJS({
3036
3036
  * Removes a value from the collection.
3037
3037
  * @returns `true` if the item was found and removed.
3038
3038
  */
3039
- deleteIn(path19) {
3040
- const [key, ...rest] = path19;
3039
+ deleteIn(path20) {
3040
+ const [key, ...rest] = path20;
3041
3041
  if (rest.length === 0)
3042
3042
  return this.delete(key);
3043
3043
  const node = this.get(key, true);
@@ -3051,8 +3051,8 @@ var require_Collection = __commonJS({
3051
3051
  * scalar values from their surrounding node; to disable set `keepScalar` to
3052
3052
  * `true` (collections are always returned intact).
3053
3053
  */
3054
- getIn(path19, keepScalar) {
3055
- const [key, ...rest] = path19;
3054
+ getIn(path20, keepScalar) {
3055
+ const [key, ...rest] = path20;
3056
3056
  const node = this.get(key, true);
3057
3057
  if (rest.length === 0)
3058
3058
  return !keepScalar && identity.isScalar(node) ? node.value : node;
@@ -3070,8 +3070,8 @@ var require_Collection = __commonJS({
3070
3070
  /**
3071
3071
  * Checks if the collection includes a value with the key `key`.
3072
3072
  */
3073
- hasIn(path19) {
3074
- const [key, ...rest] = path19;
3073
+ hasIn(path20) {
3074
+ const [key, ...rest] = path20;
3075
3075
  if (rest.length === 0)
3076
3076
  return this.has(key);
3077
3077
  const node = this.get(key, true);
@@ -3081,8 +3081,8 @@ var require_Collection = __commonJS({
3081
3081
  * Sets a value in this collection. For `!!set`, `value` needs to be a
3082
3082
  * boolean to add/remove the item from the set.
3083
3083
  */
3084
- setIn(path19, value) {
3085
- const [key, ...rest] = path19;
3084
+ setIn(path20, value) {
3085
+ const [key, ...rest] = path20;
3086
3086
  if (rest.length === 0) {
3087
3087
  this.set(key, value);
3088
3088
  } else {
@@ -5597,9 +5597,9 @@ var require_Document = __commonJS({
5597
5597
  this.contents.add(value);
5598
5598
  }
5599
5599
  /** Adds a value to the document. */
5600
- addIn(path19, value) {
5600
+ addIn(path20, value) {
5601
5601
  if (assertCollection(this.contents))
5602
- this.contents.addIn(path19, value);
5602
+ this.contents.addIn(path20, value);
5603
5603
  }
5604
5604
  /**
5605
5605
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -5674,14 +5674,14 @@ var require_Document = __commonJS({
5674
5674
  * Removes a value from the document.
5675
5675
  * @returns `true` if the item was found and removed.
5676
5676
  */
5677
- deleteIn(path19) {
5678
- if (Collection.isEmptyPath(path19)) {
5677
+ deleteIn(path20) {
5678
+ if (Collection.isEmptyPath(path20)) {
5679
5679
  if (this.contents == null)
5680
5680
  return false;
5681
5681
  this.contents = null;
5682
5682
  return true;
5683
5683
  }
5684
- return assertCollection(this.contents) ? this.contents.deleteIn(path19) : false;
5684
+ return assertCollection(this.contents) ? this.contents.deleteIn(path20) : false;
5685
5685
  }
5686
5686
  /**
5687
5687
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -5696,10 +5696,10 @@ var require_Document = __commonJS({
5696
5696
  * scalar values from their surrounding node; to disable set `keepScalar` to
5697
5697
  * `true` (collections are always returned intact).
5698
5698
  */
5699
- getIn(path19, keepScalar) {
5700
- if (Collection.isEmptyPath(path19))
5699
+ getIn(path20, keepScalar) {
5700
+ if (Collection.isEmptyPath(path20))
5701
5701
  return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
5702
- return identity.isCollection(this.contents) ? this.contents.getIn(path19, keepScalar) : void 0;
5702
+ return identity.isCollection(this.contents) ? this.contents.getIn(path20, keepScalar) : void 0;
5703
5703
  }
5704
5704
  /**
5705
5705
  * Checks if the document includes a value with the key `key`.
@@ -5710,10 +5710,10 @@ var require_Document = __commonJS({
5710
5710
  /**
5711
5711
  * Checks if the document includes a value at `path`.
5712
5712
  */
5713
- hasIn(path19) {
5714
- if (Collection.isEmptyPath(path19))
5713
+ hasIn(path20) {
5714
+ if (Collection.isEmptyPath(path20))
5715
5715
  return this.contents !== void 0;
5716
- return identity.isCollection(this.contents) ? this.contents.hasIn(path19) : false;
5716
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path20) : false;
5717
5717
  }
5718
5718
  /**
5719
5719
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -5730,13 +5730,13 @@ var require_Document = __commonJS({
5730
5730
  * Sets a value in this document. For `!!set`, `value` needs to be a
5731
5731
  * boolean to add/remove the item from the set.
5732
5732
  */
5733
- setIn(path19, value) {
5734
- if (Collection.isEmptyPath(path19)) {
5733
+ setIn(path20, value) {
5734
+ if (Collection.isEmptyPath(path20)) {
5735
5735
  this.contents = value;
5736
5736
  } else if (this.contents == null) {
5737
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path19), value);
5737
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path20), value);
5738
5738
  } else if (assertCollection(this.contents)) {
5739
- this.contents.setIn(path19, value);
5739
+ this.contents.setIn(path20, value);
5740
5740
  }
5741
5741
  }
5742
5742
  /**
@@ -7696,9 +7696,9 @@ var require_cst_visit = __commonJS({
7696
7696
  visit2.BREAK = BREAK;
7697
7697
  visit2.SKIP = SKIP;
7698
7698
  visit2.REMOVE = REMOVE;
7699
- visit2.itemAtPath = (cst, path19) => {
7699
+ visit2.itemAtPath = (cst, path20) => {
7700
7700
  let item = cst;
7701
- for (const [field, index] of path19) {
7701
+ for (const [field, index] of path20) {
7702
7702
  const tok = item?.[field];
7703
7703
  if (tok && "items" in tok) {
7704
7704
  item = tok.items[index];
@@ -7707,23 +7707,23 @@ var require_cst_visit = __commonJS({
7707
7707
  }
7708
7708
  return item;
7709
7709
  };
7710
- visit2.parentCollection = (cst, path19) => {
7711
- const parent = visit2.itemAtPath(cst, path19.slice(0, -1));
7712
- const field = path19[path19.length - 1][0];
7710
+ visit2.parentCollection = (cst, path20) => {
7711
+ const parent = visit2.itemAtPath(cst, path20.slice(0, -1));
7712
+ const field = path20[path20.length - 1][0];
7713
7713
  const coll = parent?.[field];
7714
7714
  if (coll && "items" in coll)
7715
7715
  return coll;
7716
7716
  throw new Error("Parent collection not found");
7717
7717
  };
7718
- function _visit(path19, item, visitor) {
7719
- let ctrl = visitor(item, path19);
7718
+ function _visit(path20, item, visitor) {
7719
+ let ctrl = visitor(item, path20);
7720
7720
  if (typeof ctrl === "symbol")
7721
7721
  return ctrl;
7722
7722
  for (const field of ["key", "value"]) {
7723
7723
  const token = item[field];
7724
7724
  if (token && "items" in token) {
7725
7725
  for (let i2 = 0; i2 < token.items.length; ++i2) {
7726
- const ci = _visit(Object.freeze(path19.concat([[field, i2]])), token.items[i2], visitor);
7726
+ const ci = _visit(Object.freeze(path20.concat([[field, i2]])), token.items[i2], visitor);
7727
7727
  if (typeof ci === "number")
7728
7728
  i2 = ci - 1;
7729
7729
  else if (ci === BREAK)
@@ -7734,10 +7734,10 @@ var require_cst_visit = __commonJS({
7734
7734
  }
7735
7735
  }
7736
7736
  if (typeof ctrl === "function" && field === "key")
7737
- ctrl = ctrl(item, path19);
7737
+ ctrl = ctrl(item, path20);
7738
7738
  }
7739
7739
  }
7740
- return typeof ctrl === "function" ? ctrl(item, path19) : ctrl;
7740
+ return typeof ctrl === "function" ? ctrl(item, path20) : ctrl;
7741
7741
  }
7742
7742
  exports.visit = visit2;
7743
7743
  }
@@ -9593,13 +9593,13 @@ var require_min_release_age = __commonJS({
9593
9593
  return Number.isFinite(days) && days > 0 ? days * config_parse_1.DAY_MS : 0;
9594
9594
  }
9595
9595
  function probe(p) {
9596
- return new Promise((resolve10) => {
9596
+ return new Promise((resolve11) => {
9597
9597
  (0, node_child_process_1.exec)(p.command, { timeout: PROBE_TIMEOUT_MS2, windowsHide: true }, (err, stdout2) => {
9598
9598
  if (err) {
9599
- resolve10(0);
9599
+ resolve11(0);
9600
9600
  return;
9601
9601
  }
9602
- resolve10(p.parse(stdout2));
9602
+ resolve11(p.parse(stdout2));
9603
9603
  });
9604
9604
  });
9605
9605
  }
@@ -9632,12 +9632,12 @@ var require_registry = __commonJS({
9632
9632
  var node_https_1 = __importDefault(__require("node:https"));
9633
9633
  var REQUEST_TIMEOUT_MS = 1e4;
9634
9634
  function fetchRegistryInfo2(url) {
9635
- return new Promise((resolve10) => {
9635
+ return new Promise((resolve11) => {
9636
9636
  let resolved = false;
9637
9637
  const safeResolve = (value) => {
9638
9638
  if (!resolved) {
9639
9639
  resolved = true;
9640
- resolve10(value);
9640
+ resolve11(value);
9641
9641
  }
9642
9642
  };
9643
9643
  const req = node_https_1.default.get(url, { timeout: REQUEST_TIMEOUT_MS }, (res) => {
@@ -11148,8 +11148,8 @@ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname2(proce
11148
11148
  return decodedFile;
11149
11149
  };
11150
11150
  }
11151
- function normalizeWindowsPath(path19) {
11152
- return path19.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
11151
+ function normalizeWindowsPath(path20) {
11152
+ return path20.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
11153
11153
  }
11154
11154
 
11155
11155
  // ../../node_modules/@posthog/core/dist/featureFlagUtils.mjs
@@ -13701,15 +13701,15 @@ async function addSourceContext(frames) {
13701
13701
  LRU_FILE_CONTENTS_CACHE.reduce();
13702
13702
  return frames;
13703
13703
  }
13704
- function getContextLinesFromFile(path19, ranges, output) {
13705
- return new Promise((resolve10) => {
13706
- const stream = createReadStream(path19);
13704
+ function getContextLinesFromFile(path20, ranges, output) {
13705
+ return new Promise((resolve11) => {
13706
+ const stream = createReadStream(path20);
13707
13707
  const lineReaded = createInterface2({
13708
13708
  input: stream
13709
13709
  });
13710
13710
  function destroyStreamAndResolve() {
13711
13711
  stream.destroy();
13712
- resolve10();
13712
+ resolve11();
13713
13713
  }
13714
13714
  let lineNumber = 0;
13715
13715
  let currentRangeIndex = 0;
@@ -13718,7 +13718,7 @@ function getContextLinesFromFile(path19, ranges, output) {
13718
13718
  let rangeStart = range[0];
13719
13719
  let rangeEnd = range[1];
13720
13720
  function onStreamError() {
13721
- LRU_FILE_CONTENTS_FS_READ_FAILED.set(path19, 1);
13721
+ LRU_FILE_CONTENTS_FS_READ_FAILED.set(path20, 1);
13722
13722
  lineReaded.close();
13723
13723
  lineReaded.removeAllListeners();
13724
13724
  destroyStreamAndResolve();
@@ -13779,8 +13779,8 @@ function clearLineContext(frame) {
13779
13779
  delete frame.context_line;
13780
13780
  delete frame.post_context;
13781
13781
  }
13782
- function shouldSkipContextLinesForFile(path19) {
13783
- return path19.startsWith("node:") || path19.endsWith(".min.js") || path19.endsWith(".min.cjs") || path19.endsWith(".min.mjs") || path19.startsWith("data:");
13782
+ function shouldSkipContextLinesForFile(path20) {
13783
+ return path20.startsWith("node:") || path20.endsWith(".min.js") || path20.endsWith(".min.cjs") || path20.endsWith(".min.mjs") || path20.startsWith("data:");
13784
13784
  }
13785
13785
  function shouldSkipContextLinesForFrame(frame) {
13786
13786
  if (void 0 !== frame.lineno && frame.lineno > MAX_CONTEXTLINES_LINENO) return true;
@@ -15006,9 +15006,9 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
15006
15006
  if (!waitUntil) return;
15007
15007
  if (this.disabled || this.optedOut) return;
15008
15008
  if (!this._waitUntilCycle) {
15009
- let resolve10;
15009
+ let resolve11;
15010
15010
  const promise = new Promise((r2) => {
15011
- resolve10 = r2;
15011
+ resolve11 = r2;
15012
15012
  });
15013
15013
  try {
15014
15014
  waitUntil(promise);
@@ -15016,7 +15016,7 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
15016
15016
  return;
15017
15017
  }
15018
15018
  this._waitUntilCycle = {
15019
- resolve: resolve10,
15019
+ resolve: resolve11,
15020
15020
  startedAt: Date.now(),
15021
15021
  timer: void 0
15022
15022
  };
@@ -15040,12 +15040,12 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
15040
15040
  return cycle?.resolve;
15041
15041
  }
15042
15042
  async resolveWaitUntilFlush() {
15043
- const resolve10 = this._consumeWaitUntilCycle();
15043
+ const resolve11 = this._consumeWaitUntilCycle();
15044
15044
  try {
15045
15045
  await super.flush();
15046
15046
  } catch {
15047
15047
  } finally {
15048
- resolve10?.();
15048
+ resolve11?.();
15049
15049
  }
15050
15050
  }
15051
15051
  getPersistedProperty(key) {
@@ -15166,15 +15166,15 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
15166
15166
  async waitForLocalEvaluationReady(timeoutMs = THIRTY_SECONDS) {
15167
15167
  if (this.isLocalEvaluationReady()) return true;
15168
15168
  if (void 0 === this.featureFlagsPoller) return false;
15169
- return new Promise((resolve10) => {
15169
+ return new Promise((resolve11) => {
15170
15170
  const timeout = setTimeout(() => {
15171
15171
  cleanup();
15172
- resolve10(false);
15172
+ resolve11(false);
15173
15173
  }, timeoutMs);
15174
15174
  const cleanup = this._events.on("localEvaluationFlagsLoaded", (count) => {
15175
15175
  clearTimeout(timeout);
15176
15176
  cleanup();
15177
- resolve10(count > 0);
15177
+ resolve11(count > 0);
15178
15178
  });
15179
15179
  });
15180
15180
  }
@@ -15629,14 +15629,14 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
15629
15629
  this.context?.enter(data, options);
15630
15630
  }
15631
15631
  async _shutdown(shutdownTimeoutMs) {
15632
- const resolve10 = this._consumeWaitUntilCycle();
15632
+ const resolve11 = this._consumeWaitUntilCycle();
15633
15633
  await this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);
15634
15634
  this.errorTracking.shutdown();
15635
15635
  try {
15636
15636
  return await super._shutdown(shutdownTimeoutMs);
15637
15637
  } finally {
15638
15638
  this.distinctIdHasSentFlagCalls = {};
15639
- resolve10?.();
15639
+ resolve11?.();
15640
15640
  }
15641
15641
  }
15642
15642
  async _requestRemoteConfigPayload(flagKey) {
@@ -16621,9 +16621,9 @@ function isReplitAgent(env) {
16621
16621
  }
16622
16622
  var DEVIN_MARKER_PATH = "/opt/.devin";
16623
16623
  var JULES_MARKER_PATH = "/opt/environment_summary.sh";
16624
- function safeExists(fileExists, path19) {
16624
+ function safeExists(fileExists, path20) {
16625
16625
  try {
16626
- return fileExists(path19);
16626
+ return fileExists(path20);
16627
16627
  } catch {
16628
16628
  return false;
16629
16629
  }
@@ -17079,10 +17079,10 @@ function getBaseProps(runtime) {
17079
17079
  // ../telemetry/src/identity.ts
17080
17080
  import * as crypto2 from "node:crypto";
17081
17081
  import * as fs3 from "node:fs";
17082
- import * as path5 from "node:path";
17082
+ import * as path6 from "node:path";
17083
17083
 
17084
17084
  // ../telemetry/src/paths.ts
17085
- import * as path4 from "node:path";
17085
+ import * as path5 from "node:path";
17086
17086
 
17087
17087
  // ../configuration-core/src/flags.ts
17088
17088
  import * as fs from "node:fs";
@@ -17112,13 +17112,16 @@ function nonEmpty(value) {
17112
17112
  const trimmed = value.trim();
17113
17113
  return trimmed === "" ? null : value;
17114
17114
  }
17115
+ function resolveHomeDir(options = {}) {
17116
+ if (options.homeDir) return options.homeDir;
17117
+ return process.platform === "win32" ? nonEmpty(process.env.USERPROFILE) ?? os.homedir() : nonEmpty(process.env.HOME) ?? os.homedir();
17118
+ }
17115
17119
  function argentHomeDir() {
17116
- const home = process.platform === "win32" ? nonEmpty(process.env.USERPROFILE) ?? os.homedir() : nonEmpty(process.env.HOME) ?? os.homedir();
17117
- return path2.join(home, ".argent");
17120
+ return path2.join(resolveHomeDir(), ".argent");
17118
17121
  }
17119
17122
  function configDir(scope = "global", options = {}) {
17120
17123
  if (scope === "global") {
17121
- return options.homeDir ? path2.join(options.homeDir, ".argent") : argentHomeDir();
17124
+ return path2.join(resolveHomeDir(options), ".argent");
17122
17125
  }
17123
17126
  const cwd = options.cwd ?? process.cwd();
17124
17127
  return path2.join(resolveProjectRoot(cwd), ".argent");
@@ -17214,12 +17217,15 @@ function updateConfig(mutate, scope = "global", options = {}) {
17214
17217
  }
17215
17218
  }
17216
17219
 
17220
+ // ../configuration-core/src/config-access.ts
17221
+ import * as path4 from "node:path";
17222
+
17217
17223
  // ../telemetry/src/paths.ts
17218
17224
  function identityFilePath() {
17219
- return path4.join(argentHomeDir(), "telemetry-id");
17225
+ return path5.join(argentHomeDir(), "telemetry-id");
17220
17226
  }
17221
17227
  function debugLogPath() {
17222
- return path4.join(argentHomeDir(), "telemetry-debug.log");
17228
+ return path5.join(argentHomeDir(), "telemetry-debug.log");
17223
17229
  }
17224
17230
 
17225
17231
  // ../telemetry/src/identity.ts
@@ -17346,7 +17352,7 @@ function writeIdFileAtomic(finalPath, id) {
17346
17352
  if (occupant && !occupant.isFile()) {
17347
17353
  throw new Error("telemetry: refusing to replace a non-regular file at the identity path");
17348
17354
  }
17349
- const tmpPath = path5.join(
17355
+ const tmpPath = path6.join(
17350
17356
  argentHomeDir(),
17351
17357
  `.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
17352
17358
  );
@@ -17370,7 +17376,7 @@ function mintRandomId(finalPath) {
17370
17376
  fs3.mkdirSync(argentHomeDir(), { recursive: true });
17371
17377
  let value = crypto2.randomUUID();
17372
17378
  for (let attempt = 0; attempt < 3; attempt++) {
17373
- const tmpPath = path5.join(
17379
+ const tmpPath = path6.join(
17374
17380
  argentHomeDir(),
17375
17381
  `.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
17376
17382
  );
@@ -17415,7 +17421,7 @@ function mintRandomId(finalPath) {
17415
17421
  throw new Error("telemetry: failed to create identity after retries");
17416
17422
  }
17417
17423
  function claimCorruptOccupant(finalPath) {
17418
- const claimed = path5.join(
17424
+ const claimed = path6.join(
17419
17425
  argentHomeDir(),
17420
17426
  `.telemetry-id.corrupt.${process.pid}.${crypto2.randomUUID()}`
17421
17427
  );
@@ -17462,12 +17468,12 @@ function tryReadId(filePath) {
17462
17468
  import { execFileSync, spawn } from "node:child_process";
17463
17469
 
17464
17470
  // ../native-devtools-ios/src/index.ts
17465
- import * as path6 from "node:path";
17471
+ import * as path7 from "node:path";
17466
17472
  import * as fs4 from "node:fs";
17467
- var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path6.join(__dirname, "..", "dylibs");
17468
- var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path6.join(__dirname, "..", "bin");
17469
- var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path6.join(DYLIB_DIR, "tcp");
17470
- var DYLIB_TVOS_DIR = path6.join(DYLIB_DIR, "tvos");
17473
+ var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path7.join(__dirname, "..", "dylibs");
17474
+ var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path7.join(__dirname, "..", "bin");
17475
+ var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path7.join(DYLIB_DIR, "tcp");
17476
+ var DYLIB_TVOS_DIR = path7.join(DYLIB_DIR, "tvos");
17471
17477
  function hostPlatformKey() {
17472
17478
  if (process.platform === "linux" && process.arch === "arm64") {
17473
17479
  return "linux-arm64";
@@ -17478,13 +17484,13 @@ function simulatorServerBinaryName() {
17478
17484
  return process.platform === "win32" ? "simulator-server.exe" : "simulator-server";
17479
17485
  }
17480
17486
  function platformBinDir() {
17481
- return path6.join(BIN_DIR, hostPlatformKey());
17487
+ return path7.join(BIN_DIR, hostPlatformKey());
17482
17488
  }
17483
17489
  function simulatorServerBinaryPath() {
17484
17490
  const binaryName = simulatorServerBinaryName();
17485
- const p = path6.join(platformBinDir(), binaryName);
17491
+ const p = path7.join(platformBinDir(), binaryName);
17486
17492
  if (!fs4.existsSync(p)) {
17487
- const flat = path6.join(BIN_DIR, binaryName);
17493
+ const flat = path7.join(BIN_DIR, binaryName);
17488
17494
  const migrationHint = fs4.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.` : "";
17489
17495
  throw new Error(
17490
17496
  `simulator-server binary not found for platform "${hostPlatformKey()}" at ${p}. Supported hosts today: darwin, linux (x86_64 and arm64), win32.${migrationHint}`
@@ -17518,12 +17524,12 @@ function resolveHostFingerprint() {
17518
17524
  }
17519
17525
  }
17520
17526
  function resolveHostFingerprintAsync() {
17521
- return new Promise((resolve10) => {
17527
+ return new Promise((resolve11) => {
17522
17528
  let binary;
17523
17529
  try {
17524
17530
  binary = simulatorServerBinaryPath();
17525
17531
  } catch {
17526
- resolve10(null);
17532
+ resolve11(null);
17527
17533
  return;
17528
17534
  }
17529
17535
  let settled = false;
@@ -17536,7 +17542,7 @@ function resolveHostFingerprintAsync() {
17536
17542
  child?.kill("SIGKILL");
17537
17543
  } catch {
17538
17544
  }
17539
- resolve10(value);
17545
+ resolve11(value);
17540
17546
  };
17541
17547
  const watchdog = setTimeout(() => finish(null), FINGERPRINT_TIMEOUT_MS);
17542
17548
  watchdog.unref?.();
@@ -17834,7 +17840,7 @@ async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
17834
17840
  try {
17835
17841
  await Promise.race([
17836
17842
  client2.shutdown(timeoutMs),
17837
- new Promise((resolve10) => setTimeout(resolve10, timeoutMs + 250).unref())
17843
+ new Promise((resolve11) => setTimeout(resolve11, timeoutMs + 250).unref())
17838
17844
  ]);
17839
17845
  } catch (err) {
17840
17846
  emitDebugError("shutdown failed", err);
@@ -17846,7 +17852,7 @@ async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
17846
17852
 
17847
17853
  // ../argent-installer/src/mcp-configs.ts
17848
17854
  import * as fs13 from "node:fs";
17849
- import * as path13 from "node:path";
17855
+ import * as path14 from "node:path";
17850
17856
  import { execFileSync as execFileSync2 } from "node:child_process";
17851
17857
  import { homedir as homedir4 } from "node:os";
17852
17858
 
@@ -17861,7 +17867,7 @@ var CURSOR_ALLOWLIST_PATTERN = "argent:*";
17861
17867
  // ../argent-installer/src/utils.ts
17862
17868
  var import_semver2 = __toESM(require_semver2(), 1);
17863
17869
  import * as fs12 from "node:fs";
17864
- import * as path12 from "node:path";
17870
+ import * as path13 from "node:path";
17865
17871
  import * as dns from "node:dns";
17866
17872
  import * as os2 from "node:os";
17867
17873
  import { execSync as execSync2 } from "node:child_process";
@@ -19486,12 +19492,12 @@ function parseTree(text2, errors = [], options = ParseOptions.DEFAULT) {
19486
19492
  }
19487
19493
  return result;
19488
19494
  }
19489
- function findNodeAtLocation(root, path19) {
19495
+ function findNodeAtLocation(root, path20) {
19490
19496
  if (!root) {
19491
19497
  return void 0;
19492
19498
  }
19493
19499
  let node = root;
19494
- for (let segment of path19) {
19500
+ for (let segment of path20) {
19495
19501
  if (typeof segment === "string") {
19496
19502
  if (node.type !== "object" || !Array.isArray(node.children)) {
19497
19503
  return void 0;
@@ -19845,14 +19851,14 @@ function getNodeType(value) {
19845
19851
 
19846
19852
  // ../../node_modules/jsonc-parser/lib/esm/impl/edit.js
19847
19853
  function setProperty(text2, originalPath, value, options) {
19848
- const path19 = originalPath.slice();
19854
+ const path20 = originalPath.slice();
19849
19855
  const errors = [];
19850
19856
  const root = parseTree(text2, errors);
19851
19857
  let parent = void 0;
19852
19858
  let lastSegment = void 0;
19853
- while (path19.length > 0) {
19854
- lastSegment = path19.pop();
19855
- parent = findNodeAtLocation(root, path19);
19859
+ while (path20.length > 0) {
19860
+ lastSegment = path20.pop();
19861
+ parent = findNodeAtLocation(root, path20);
19856
19862
  if (parent === void 0 && value !== void 0) {
19857
19863
  if (typeof lastSegment === "string") {
19858
19864
  value = { [lastSegment]: value };
@@ -20038,8 +20044,8 @@ var ParseErrorCode;
20038
20044
  ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
20039
20045
  ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
20040
20046
  })(ParseErrorCode || (ParseErrorCode = {}));
20041
- function modify(text2, path19, value, options) {
20042
- return setProperty(text2, path19, value, options);
20047
+ function modify(text2, path20, value, options) {
20048
+ return setProperty(text2, path20, value, options);
20043
20049
  }
20044
20050
  function applyEdits(text2, edits) {
20045
20051
  let sortedEdits = edits.slice(0).sort((a3, b) => {
@@ -20064,20 +20070,20 @@ function applyEdits(text2, edits) {
20064
20070
 
20065
20071
  // ../argent-installer/src/package-root.ts
20066
20072
  import * as fs7 from "node:fs";
20067
- import * as path7 from "node:path";
20073
+ import * as path8 from "node:path";
20068
20074
  function resolvePackageRoot(dirname15) {
20069
- let current = path7.resolve(dirname15);
20075
+ let current = path8.resolve(dirname15);
20070
20076
  while (true) {
20071
- if (fs7.existsSync(path7.join(current, "package.json"))) return current;
20072
- const parent = path7.dirname(current);
20073
- if (parent === current) return path7.resolve(dirname15);
20077
+ if (fs7.existsSync(path8.join(current, "package.json"))) return current;
20078
+ const parent = path8.dirname(current);
20079
+ if (parent === current) return path8.resolve(dirname15);
20074
20080
  current = parent;
20075
20081
  }
20076
20082
  }
20077
20083
 
20078
20084
  // ../argent-installer/src/package-manager.ts
20079
20085
  import * as fs8 from "node:fs";
20080
- import * as path8 from "node:path";
20086
+ import * as path9 from "node:path";
20081
20087
  function formatShellCommand(cmd) {
20082
20088
  const parts = [cmd.bin, ...cmd.args.map((a3) => a3.includes(" ") ? `"${a3}"` : a3)];
20083
20089
  return parts.join(" ");
@@ -20094,7 +20100,7 @@ function asKnownPm(name) {
20094
20100
  }
20095
20101
  function pmFromPackageManagerField(dir) {
20096
20102
  try {
20097
- const pkg = JSON.parse(fs8.readFileSync(path8.join(dir, "package.json"), "utf8"));
20103
+ const pkg = JSON.parse(fs8.readFileSync(path9.join(dir, "package.json"), "utf8"));
20098
20104
  if (typeof pkg.packageManager === "string") {
20099
20105
  return asKnownPm(pkg.packageManager.split("@")[0]);
20100
20106
  }
@@ -20105,7 +20111,7 @@ function pmFromPackageManagerField(dir) {
20105
20111
  }
20106
20112
  function pmFromDevEngines(dir) {
20107
20113
  try {
20108
- const pkg = JSON.parse(fs8.readFileSync(path8.join(dir, "package.json"), "utf8"));
20114
+ const pkg = JSON.parse(fs8.readFileSync(path9.join(dir, "package.json"), "utf8"));
20109
20115
  const devEnginesPm = pkg.devEngines?.packageManager;
20110
20116
  const names = /* @__PURE__ */ new Set();
20111
20117
  for (const entry of Array.isArray(devEnginesPm) ? devEnginesPm : [devEnginesPm]) {
@@ -20118,7 +20124,7 @@ function pmFromDevEngines(dir) {
20118
20124
  }
20119
20125
  }
20120
20126
  function pmFromLockfile(dir) {
20121
- const has = (file) => fs8.existsSync(path8.join(dir, file));
20127
+ const has = (file) => fs8.existsSync(path9.join(dir, file));
20122
20128
  if (has("pnpm-lock.yaml")) return "pnpm";
20123
20129
  if (has("yarn.lock")) return "yarn";
20124
20130
  if (has("bun.lock") || has("bun.lockb")) return "bun";
@@ -20126,15 +20132,15 @@ function pmFromLockfile(dir) {
20126
20132
  return null;
20127
20133
  }
20128
20134
  function pmFromWorkspaceMarker(dir) {
20129
- return fs8.existsSync(path8.join(dir, "pnpm-workspace.yaml")) ? "pnpm" : null;
20135
+ return fs8.existsSync(path9.join(dir, "pnpm-workspace.yaml")) ? "pnpm" : null;
20130
20136
  }
20131
20137
  function detectProjectPackageManager(projectRoot) {
20132
- let dir = path8.resolve(projectRoot);
20138
+ let dir = path9.resolve(projectRoot);
20133
20139
  for (; ; ) {
20134
20140
  const pm = pmFromPackageManagerField(dir) ?? pmFromLockfile(dir) ?? pmFromDevEngines(dir) ?? pmFromWorkspaceMarker(dir);
20135
20141
  if (pm) return pm;
20136
- if (fs8.existsSync(path8.join(dir, ".git"))) break;
20137
- const parent = path8.dirname(dir);
20142
+ if (fs8.existsSync(path9.join(dir, ".git"))) break;
20143
+ const parent = path9.dirname(dir);
20138
20144
  if (parent === dir) break;
20139
20145
  dir = parent;
20140
20146
  }
@@ -20203,18 +20209,18 @@ function localUninstallCommand(pm, pkg) {
20203
20209
 
20204
20210
  // ../argent-installer/src/preflight.ts
20205
20211
  import * as fs9 from "node:fs";
20206
- import * as path9 from "node:path";
20212
+ import * as path10 from "node:path";
20207
20213
  function hasProjectPackageJson(projectRoot) {
20208
- return fs9.existsSync(path9.join(projectRoot, "package.json"));
20214
+ return fs9.existsSync(path10.join(projectRoot, "package.json"));
20209
20215
  }
20210
20216
  function isYarnPnp(projectRoot) {
20211
- return fs9.existsSync(path9.join(projectRoot, ".pnp.cjs")) || fs9.existsSync(path9.join(projectRoot, ".pnp.loader.mjs"));
20217
+ return fs9.existsSync(path10.join(projectRoot, ".pnp.cjs")) || fs9.existsSync(path10.join(projectRoot, ".pnp.loader.mjs"));
20212
20218
  }
20213
20219
 
20214
20220
  // ../argent-installer/src/topology.ts
20215
20221
  var import_semver = __toESM(require_semver2(), 1);
20216
20222
  import * as fs10 from "node:fs";
20217
- import * as path10 from "node:path";
20223
+ import * as path11 from "node:path";
20218
20224
  import { createRequire } from "node:module";
20219
20225
  import { execSync } from "node:child_process";
20220
20226
  var TEMP_RUNNER_MARKERS = [
@@ -20247,8 +20253,8 @@ function getGloballyInstalledPackageRoot() {
20247
20253
  if (!binaryPath) return null;
20248
20254
  try {
20249
20255
  const realPath = fs10.realpathSync(binaryPath);
20250
- const root = resolvePackageRoot(path10.dirname(realPath));
20251
- const pkg = JSON.parse(fs10.readFileSync(path10.join(root, "package.json"), "utf8"));
20256
+ const root = resolvePackageRoot(path11.dirname(realPath));
20257
+ const pkg = JSON.parse(fs10.readFileSync(path11.join(root, "package.json"), "utf8"));
20252
20258
  return pkg.name === PACKAGE_NAME ? root : null;
20253
20259
  } catch {
20254
20260
  return null;
@@ -20258,7 +20264,7 @@ function getGloballyInstalledVersion() {
20258
20264
  const pkgRoot = getGloballyInstalledPackageRoot();
20259
20265
  if (!pkgRoot) return null;
20260
20266
  try {
20261
- const pkg = JSON.parse(fs10.readFileSync(path10.join(pkgRoot, "package.json"), "utf8"));
20267
+ const pkg = JSON.parse(fs10.readFileSync(path11.join(pkgRoot, "package.json"), "utf8"));
20262
20268
  return pkg.version ?? null;
20263
20269
  } catch {
20264
20270
  return null;
@@ -20267,7 +20273,7 @@ function getGloballyInstalledVersion() {
20267
20273
  function readManifestDeclaration(projectRoot) {
20268
20274
  try {
20269
20275
  const pkg = JSON.parse(
20270
- fs10.readFileSync(path10.join(projectRoot, "package.json"), "utf8")
20276
+ fs10.readFileSync(path11.join(projectRoot, "package.json"), "utf8")
20271
20277
  );
20272
20278
  const spec = pkg.devDependencies?.[PACKAGE_NAME] ?? pkg.dependencies?.[PACKAGE_NAME] ?? pkg.optionalDependencies?.[PACKAGE_NAME];
20273
20279
  return typeof spec === "string" ? spec : null;
@@ -20280,11 +20286,11 @@ function isDeclaredLocally(projectRoot) {
20280
20286
  }
20281
20287
  function resolveLocalArgentDir(projectRoot) {
20282
20288
  try {
20283
- const req = createRequire(path10.join(projectRoot, "package.json"));
20284
- return path10.dirname(req.resolve(`${PACKAGE_NAME}/package.json`));
20289
+ const req = createRequire(path11.join(projectRoot, "package.json"));
20290
+ return path11.dirname(req.resolve(`${PACKAGE_NAME}/package.json`));
20285
20291
  } catch {
20286
- const plain = path10.join(projectRoot, "node_modules", PACKAGE_NAME);
20287
- return fs10.existsSync(path10.join(plain, "package.json")) ? plain : null;
20292
+ const plain = path11.join(projectRoot, "node_modules", PACKAGE_NAME);
20293
+ return fs10.existsSync(path11.join(plain, "package.json")) ? plain : null;
20288
20294
  }
20289
20295
  }
20290
20296
  function probeLocalInstall(projectRoot) {
@@ -20292,7 +20298,7 @@ function probeLocalInstall(projectRoot) {
20292
20298
  if (packageDir) {
20293
20299
  let version2;
20294
20300
  try {
20295
- const pkg = JSON.parse(fs10.readFileSync(path10.join(packageDir, "package.json"), "utf8"));
20301
+ const pkg = JSON.parse(fs10.readFileSync(path11.join(packageDir, "package.json"), "utf8"));
20296
20302
  version2 = pkg.version ?? null;
20297
20303
  } catch {
20298
20304
  version2 = null;
@@ -20315,7 +20321,7 @@ function getLocallyInstalledVersion(projectRoot) {
20315
20321
  }
20316
20322
  function readLocalPackageVersionUncached(projectRoot) {
20317
20323
  try {
20318
- const pkgPath = path10.join(projectRoot, "node_modules", PACKAGE_NAME, "package.json");
20324
+ const pkgPath = path11.join(projectRoot, "node_modules", PACKAGE_NAME, "package.json");
20319
20325
  const pkg = JSON.parse(fs10.readFileSync(pkgPath, "utf8"));
20320
20326
  return pkg.version ?? null;
20321
20327
  } catch {
@@ -20327,7 +20333,7 @@ function getLocalArgentBinRelPath(projectRoot) {
20327
20333
  if (!pkgDir) return null;
20328
20334
  let binSub;
20329
20335
  try {
20330
- const pkg = JSON.parse(fs10.readFileSync(path10.join(pkgDir, "package.json"), "utf8"));
20336
+ const pkg = JSON.parse(fs10.readFileSync(path11.join(pkgDir, "package.json"), "utf8"));
20331
20337
  if (typeof pkg.bin === "string") binSub = pkg.bin;
20332
20338
  else if (pkg.bin && typeof pkg.bin === "object")
20333
20339
  binSub = pkg.bin[MCP_BINARY_NAME] ?? Object.values(pkg.bin)[0];
@@ -20340,20 +20346,20 @@ function getLocalArgentBinRelPath(projectRoot) {
20340
20346
  root = fs10.realpathSync(projectRoot);
20341
20347
  } catch {
20342
20348
  }
20343
- const stableRel = path10.join("node_modules", PACKAGE_NAME, binSub);
20344
- if (fs10.existsSync(path10.join(root, stableRel))) {
20345
- return stableRel.split(path10.sep).join("/");
20349
+ const stableRel = path11.join("node_modules", PACKAGE_NAME, binSub);
20350
+ if (fs10.existsSync(path11.join(root, stableRel))) {
20351
+ return stableRel.split(path11.sep).join("/");
20346
20352
  }
20347
- const abs = path10.join(pkgDir, binSub);
20353
+ const abs = path11.join(pkgDir, binSub);
20348
20354
  if (!fs10.existsSync(abs)) return null;
20349
- return path10.relative(root, abs).split(path10.sep).join("/");
20355
+ return path11.relative(root, abs).split(path11.sep).join("/");
20350
20356
  }
20351
20357
 
20352
20358
  // ../argent-installer/src/install-record.ts
20353
20359
  import * as fs11 from "node:fs";
20354
- import * as path11 from "node:path";
20360
+ import * as path12 from "node:path";
20355
20361
  function getInstallRecordPath(projectRoot) {
20356
- return path11.join(projectRoot, ".argent", "install.json");
20362
+ return path12.join(projectRoot, ".argent", "install.json");
20357
20363
  }
20358
20364
  function readInstallRecord(projectRoot) {
20359
20365
  try {
@@ -20368,7 +20374,7 @@ function readInstallRecord(projectRoot) {
20368
20374
  }
20369
20375
  function writeInstallRecord(projectRoot, record) {
20370
20376
  const recordPath = getInstallRecordPath(projectRoot);
20371
- fs11.mkdirSync(path11.dirname(recordPath), { recursive: true });
20377
+ fs11.mkdirSync(path12.dirname(recordPath), { recursive: true });
20372
20378
  fs11.writeFileSync(recordPath, JSON.stringify(record, null, 2) + "\n");
20373
20379
  }
20374
20380
  function removeInstallRecord(projectRoot) {
@@ -20376,7 +20382,7 @@ function removeInstallRecord(projectRoot) {
20376
20382
  try {
20377
20383
  if (!fs11.existsSync(recordPath)) return false;
20378
20384
  fs11.rmSync(recordPath, { force: true });
20379
- const dir = path11.dirname(recordPath);
20385
+ const dir = path12.dirname(recordPath);
20380
20386
  try {
20381
20387
  if (fs11.existsSync(dir) && fs11.readdirSync(dir).length === 0) fs11.rmdirSync(dir);
20382
20388
  } catch {
@@ -20452,9 +20458,9 @@ async function promptInstallTargets(verb) {
20452
20458
  // ../argent-installer/src/utils.ts
20453
20459
  var PACKAGE_ROOT = resolvePackageRoot(import.meta.dirname);
20454
20460
  function resolveBundledDir(dirName) {
20455
- const packagedDir = path12.join(PACKAGE_ROOT, dirName);
20461
+ const packagedDir = path13.join(PACKAGE_ROOT, dirName);
20456
20462
  if (fs12.existsSync(packagedDir)) return packagedDir;
20457
- return path12.resolve(PACKAGE_ROOT, "..", "skills", dirName);
20463
+ return path13.resolve(PACKAGE_ROOT, "..", "skills", dirName);
20458
20464
  }
20459
20465
  var SKILLS_DIR = resolveBundledDir("skills");
20460
20466
  var RULES_DIR = resolveBundledDir("rules");
@@ -20466,18 +20472,18 @@ function buildArgentSkillsSource(version2) {
20466
20472
  }
20467
20473
  function listBundledSkills(skillsDir = SKILLS_DIR) {
20468
20474
  try {
20469
- return fs12.readdirSync(skillsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).filter((name) => fs12.existsSync(path12.join(skillsDir, name, "SKILL.md"))).sort();
20475
+ return fs12.readdirSync(skillsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).filter((name) => fs12.existsSync(path13.join(skillsDir, name, "SKILL.md"))).sort();
20470
20476
  } catch {
20471
20477
  return [];
20472
20478
  }
20473
20479
  }
20474
20480
  function getProjectSkillLockPath(cwd = process.cwd()) {
20475
- return path12.join(cwd, "skills-lock.json");
20481
+ return path13.join(cwd, "skills-lock.json");
20476
20482
  }
20477
20483
  function getGlobalSkillLockPath() {
20478
20484
  const xdgStateHome = process.env.XDG_STATE_HOME;
20479
- if (xdgStateHome) return path12.join(xdgStateHome, "skills", ".skill-lock.json");
20480
- return path12.join(os2.homedir(), ".agents", ".skill-lock.json");
20485
+ if (xdgStateHome) return path13.join(xdgStateHome, "skills", ".skill-lock.json");
20486
+ return path13.join(os2.homedir(), ".agents", ".skill-lock.json");
20481
20487
  }
20482
20488
  var ARGENT_SKILL_PREFIX = "argent-";
20483
20489
  function listArgentSkillsInLock(lockPath) {
@@ -20506,16 +20512,16 @@ var PROJECT_ROOT_MARKERS = [
20506
20512
  "skills-lock.json"
20507
20513
  ];
20508
20514
  function resolveProjectRoot2(startDir) {
20509
- const initialDir = path12.resolve(startDir);
20515
+ const initialDir = path13.resolve(startDir);
20510
20516
  let currentDir = initialDir;
20511
20517
  while (true) {
20512
- if (PROJECT_ROOT_MARKERS.some((marker) => fs12.existsSync(path12.join(currentDir, marker)))) {
20518
+ if (PROJECT_ROOT_MARKERS.some((marker) => fs12.existsSync(path13.join(currentDir, marker)))) {
20513
20519
  return currentDir;
20514
20520
  }
20515
- if (fs12.existsSync(path12.join(currentDir, ".git"))) {
20521
+ if (fs12.existsSync(path13.join(currentDir, ".git"))) {
20516
20522
  return currentDir;
20517
20523
  }
20518
- const parentDir = path12.dirname(currentDir);
20524
+ const parentDir = path13.dirname(currentDir);
20519
20525
  if (parentDir === currentDir) {
20520
20526
  return initialDir;
20521
20527
  }
@@ -20531,7 +20537,7 @@ function readToml(filePath) {
20531
20537
  }
20532
20538
  }
20533
20539
  function writeToml(filePath, data) {
20534
- fs12.mkdirSync(path12.dirname(filePath), { recursive: true });
20540
+ fs12.mkdirSync(path13.dirname(filePath), { recursive: true });
20535
20541
  fs12.writeFileSync(filePath, stringify(data) + "\n");
20536
20542
  }
20537
20543
  function readYaml(filePath) {
@@ -20545,7 +20551,7 @@ function readYaml(filePath) {
20545
20551
  return doc;
20546
20552
  }
20547
20553
  function writeYaml(filePath, doc) {
20548
- fs12.mkdirSync(path12.dirname(filePath), { recursive: true });
20554
+ fs12.mkdirSync(path13.dirname(filePath), { recursive: true });
20549
20555
  fs12.writeFileSync(filePath, doc.toString({ lineWidth: 0 }));
20550
20556
  }
20551
20557
  function readJson(filePath) {
@@ -20557,7 +20563,7 @@ function readJson(filePath) {
20557
20563
  }
20558
20564
  }
20559
20565
  function writeJson(filePath, data) {
20560
- fs12.mkdirSync(path12.dirname(filePath), { recursive: true });
20566
+ fs12.mkdirSync(path13.dirname(filePath), { recursive: true });
20561
20567
  fs12.writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n");
20562
20568
  }
20563
20569
  var JSONC_FORMATTING = { tabSize: 2, insertSpaces: true };
@@ -20616,10 +20622,10 @@ function editJsoncFile(filePath, jsonPath, value) {
20616
20622
  const parsed = parse3(text2, [], { allowTrailingComma: true });
20617
20623
  if (isEmptyPlainObject(parsed)) {
20618
20624
  fs12.rmSync(filePath, { force: true });
20619
- rmEmptyDir(path12.dirname(filePath));
20625
+ rmEmptyDir(path13.dirname(filePath));
20620
20626
  return;
20621
20627
  }
20622
- fs12.mkdirSync(path12.dirname(filePath), { recursive: true });
20628
+ fs12.mkdirSync(path13.dirname(filePath), { recursive: true });
20623
20629
  const out = wasEmpty && !text2.endsWith("\n") ? text2 + "\n" : text2;
20624
20630
  fs12.writeFileSync(filePath, (hadBom ? "\uFEFF" : "") + out);
20625
20631
  }
@@ -20632,7 +20638,7 @@ function dirExists(p) {
20632
20638
  }
20633
20639
  function getInstalledVersion() {
20634
20640
  try {
20635
- const pkgPath = path12.join(PACKAGE_ROOT, "package.json");
20641
+ const pkgPath = path13.join(PACKAGE_ROOT, "package.json");
20636
20642
  const pkg = JSON.parse(fs12.readFileSync(pkgPath, "utf8"));
20637
20643
  return pkg.version ?? null;
20638
20644
  } catch {
@@ -20672,12 +20678,12 @@ async function isOnline(timeoutMs = PROBE_TIMEOUT_MS) {
20672
20678
  } catch {
20673
20679
  return false;
20674
20680
  }
20675
- return new Promise((resolve10) => {
20676
- const timer = setTimeout(() => resolve10(false), timeoutMs);
20681
+ return new Promise((resolve11) => {
20682
+ const timer = setTimeout(() => resolve11(false), timeoutMs);
20677
20683
  timer.unref();
20678
20684
  dns.lookup(host, (err) => {
20679
20685
  clearTimeout(timer);
20680
- resolve10(!err);
20686
+ resolve11(!err);
20681
20687
  });
20682
20688
  });
20683
20689
  }
@@ -20694,7 +20700,7 @@ function escapeStringRegexp(string) {
20694
20700
  }
20695
20701
 
20696
20702
  // ../argent-installer/src/mcp-configs.ts
20697
- var TOOL_SERVER_BUNDLE = path13.join(import.meta.dirname, "tool-server.cjs");
20703
+ var TOOL_SERVER_BUNDLE = path14.join(import.meta.dirname, "tool-server.cjs");
20698
20704
  function getAvailableToolIds() {
20699
20705
  const out = execFileSync2("node", [TOOL_SERVER_BUNDLE, "-t"], { encoding: "utf8" });
20700
20706
  const tools = JSON.parse(out);
@@ -20773,7 +20779,7 @@ function isArgentManagedEntry(entry) {
20773
20779
  return args.length === 1 && args[0] === "mcp";
20774
20780
  case "node": {
20775
20781
  if (args.length !== 2 || args[1] !== "mcp" || !args[0]) return false;
20776
- if (path13.isAbsolute(args[0])) return false;
20782
+ if (path14.isAbsolute(args[0])) return false;
20777
20783
  const normalized = args[0].split("\\").join("/");
20778
20784
  return normalized.includes(`node_modules/${PACKAGE_NAME}/`);
20779
20785
  }
@@ -20788,7 +20794,7 @@ function isArgentManagedEntry(entry) {
20788
20794
  function writeTomlOrRemove(filePath, data) {
20789
20795
  if (Object.keys(data).length === 0) {
20790
20796
  fs13.rmSync(filePath, { force: true });
20791
- removeDirIfEmpty(path13.dirname(filePath));
20797
+ removeDirIfEmpty(path14.dirname(filePath));
20792
20798
  return;
20793
20799
  }
20794
20800
  writeToml(filePath, data);
@@ -20873,7 +20879,7 @@ function cursorDirLooksArgentOnly(dir) {
20873
20879
  }
20874
20880
  if (entries.length === 0) return false;
20875
20881
  return entries.every((entry) => {
20876
- const full = path13.join(dir, entry);
20882
+ const full = path14.join(dir, entry);
20877
20883
  if (entry === "mcp.json") {
20878
20884
  return jsonLooksArgentServerOnly(full, "mcpServers");
20879
20885
  }
@@ -20912,7 +20918,7 @@ function claudeDirLooksArgentOnly(dir) {
20912
20918
  }
20913
20919
  if (entries.length === 0) return false;
20914
20920
  return entries.every((entry) => {
20915
- const full = path13.join(dir, entry);
20921
+ const full = path14.join(dir, entry);
20916
20922
  if (entry === "settings.json") return claudeSettingsLooksArgentOnly(full);
20917
20923
  if (entry === "rules" || entry === "agents" || entry === "skills") {
20918
20924
  return managedDirLooksArgentOnly(full, entry);
@@ -20929,7 +20935,7 @@ function vscodeDirLooksArgentOnly(dir) {
20929
20935
  }
20930
20936
  if (entries.length === 0) return false;
20931
20937
  return entries.every(
20932
- (entry) => entry === "mcp.json" && jsonLooksArgentServerOnly(path13.join(dir, entry), "servers")
20938
+ (entry) => entry === "mcp.json" && jsonLooksArgentServerOnly(path14.join(dir, entry), "servers")
20933
20939
  );
20934
20940
  }
20935
20941
  function windsurfDirLooksArgentOnly(dir) {
@@ -20941,7 +20947,7 @@ function windsurfDirLooksArgentOnly(dir) {
20941
20947
  }
20942
20948
  if (entries.length === 0) return false;
20943
20949
  return entries.every(
20944
- (entry) => entry === "mcp_config.json" && jsonLooksArgentServerOnly(path13.join(dir, entry), "mcpServers")
20950
+ (entry) => entry === "mcp_config.json" && jsonLooksArgentServerOnly(path14.join(dir, entry), "mcpServers")
20945
20951
  );
20946
20952
  }
20947
20953
  function zedSettingsLooksArgentOnly(filePath) {
@@ -20978,7 +20984,7 @@ function zedDirLooksArgentOnly(dir) {
20978
20984
  }
20979
20985
  if (entries.length === 0) return false;
20980
20986
  return entries.every(
20981
- (entry) => entry === "settings.json" && zedSettingsLooksArgentOnly(path13.join(dir, entry))
20987
+ (entry) => entry === "settings.json" && zedSettingsLooksArgentOnly(path14.join(dir, entry))
20982
20988
  );
20983
20989
  }
20984
20990
  function geminiDirLooksArgentOnly(dir) {
@@ -20990,7 +20996,7 @@ function geminiDirLooksArgentOnly(dir) {
20990
20996
  }
20991
20997
  if (entries.length === 0) return false;
20992
20998
  return entries.every((entry) => {
20993
- const full = path13.join(dir, entry);
20999
+ const full = path14.join(dir, entry);
20994
21000
  if (entry === "settings.json") return jsonLooksArgentServerOnly(full, "mcpServers");
20995
21001
  if (entry === "rules" || entry === "agents") return managedDirLooksArgentOnly(full, entry);
20996
21002
  return false;
@@ -21015,7 +21021,7 @@ function hermesDirLooksArgentOnly(dir) {
21015
21021
  }
21016
21022
  if (entries.length === 0) return false;
21017
21023
  return entries.every(
21018
- (entry) => entry === "config.yaml" && hermesConfigLooksArgentOnly(path13.join(dir, entry))
21024
+ (entry) => entry === "config.yaml" && hermesConfigLooksArgentOnly(path14.join(dir, entry))
21019
21025
  );
21020
21026
  }
21021
21027
  function kiroDirLooksArgentOnly(dir) {
@@ -21028,7 +21034,7 @@ function kiroDirLooksArgentOnly(dir) {
21028
21034
  if (entries.length === 0) return false;
21029
21035
  return entries.every((entry) => {
21030
21036
  if (entry !== "settings") return false;
21031
- const settingsDir = path13.join(dir, entry);
21037
+ const settingsDir = path14.join(dir, entry);
21032
21038
  let settingsEntries;
21033
21039
  try {
21034
21040
  settingsEntries = fs13.readdirSync(settingsDir);
@@ -21037,7 +21043,7 @@ function kiroDirLooksArgentOnly(dir) {
21037
21043
  }
21038
21044
  if (settingsEntries.length === 0) return false;
21039
21045
  return settingsEntries.every(
21040
- (name) => name === "mcp.json" && jsonLooksArgentServerOnly(path13.join(settingsDir, name), "mcpServers")
21046
+ (name) => name === "mcp.json" && jsonLooksArgentServerOnly(path14.join(settingsDir, name), "mcpServers")
21041
21047
  );
21042
21048
  });
21043
21049
  }
@@ -21050,7 +21056,7 @@ function codexDirLooksArgentOnly(dir) {
21050
21056
  }
21051
21057
  if (entries.length === 0) return false;
21052
21058
  return entries.every((entry) => {
21053
- const full = path13.join(dir, entry);
21059
+ const full = path14.join(dir, entry);
21054
21060
  if (entry === "config.toml") {
21055
21061
  const config = parseTomlStrict(full);
21056
21062
  if (config === null) return false;
@@ -21077,13 +21083,13 @@ function codexDirLooksArgentOnly(dir) {
21077
21083
  var cursorAdapter = {
21078
21084
  name: "Cursor",
21079
21085
  detect() {
21080
- return dirHasEditorEvidence(path13.join(homedir4(), ".cursor"), cursorDirLooksArgentOnly) || dirHasEditorEvidence(path13.join(process.cwd(), ".cursor"), cursorDirLooksArgentOnly);
21086
+ return dirHasEditorEvidence(path14.join(homedir4(), ".cursor"), cursorDirLooksArgentOnly) || dirHasEditorEvidence(path14.join(process.cwd(), ".cursor"), cursorDirLooksArgentOnly);
21081
21087
  },
21082
21088
  projectPath(root) {
21083
- return path13.join(root, ".cursor", "mcp.json");
21089
+ return path14.join(root, ".cursor", "mcp.json");
21084
21090
  },
21085
21091
  globalPath() {
21086
- return path13.join(homedir4(), ".cursor", "mcp.json");
21092
+ return path14.join(homedir4(), ".cursor", "mcp.json");
21087
21093
  },
21088
21094
  // Cursor is a VS Code fork: .cursor/mcp.json is JSONC (line/block comments,
21089
21095
  // trailing commas). Routing write/remove/hasArgentEntry through readJsonc /
@@ -21124,7 +21130,7 @@ var cursorAdapter = {
21124
21130
  // because `hasArgentEntry` now reads mcp.json with readJsonc, so `update`
21125
21131
  // detects a commented config as configured and calls this.
21126
21132
  addAllowlist() {
21127
- const permPath = path13.join(homedir4(), ".cursor", "permissions.json");
21133
+ const permPath = path14.join(homedir4(), ".cursor", "permissions.json");
21128
21134
  const config = readJsonc(permPath);
21129
21135
  const list = Array.isArray(config.mcpAllowlist) ? config.mcpAllowlist : [];
21130
21136
  if (list.includes(CURSOR_ALLOWLIST_PATTERN)) return;
@@ -21132,7 +21138,7 @@ var cursorAdapter = {
21132
21138
  },
21133
21139
  removeAllowlist(_root, scope) {
21134
21140
  if (scope !== "global") return;
21135
- const permPath = path13.join(homedir4(), ".cursor", "permissions.json");
21141
+ const permPath = path14.join(homedir4(), ".cursor", "permissions.json");
21136
21142
  if (!fs13.existsSync(permPath)) return;
21137
21143
  const config = readJsonc(permPath);
21138
21144
  const list = Array.isArray(config.mcpAllowlist) ? config.mcpAllowlist : void 0;
@@ -21146,7 +21152,7 @@ function claudeProjectKeysForRoot(projects, root) {
21146
21152
  try {
21147
21153
  return fs13.realpathSync.native(value);
21148
21154
  } catch {
21149
- return path13.resolve(value);
21155
+ return path14.resolve(value);
21150
21156
  }
21151
21157
  };
21152
21158
  const target = canonical(root);
@@ -21182,13 +21188,13 @@ var claudeAdapter = {
21182
21188
  name: "Claude Code",
21183
21189
  detect() {
21184
21190
  const mcpJsonArgentOnly = (p) => jsonLooksArgentServerOnly(p, "mcpServers");
21185
- return fileHasEditorEvidence(path13.join(process.cwd(), ".mcp.json"), mcpJsonArgentOnly) || fileHasEditorEvidence(path13.join(homedir4(), ".claude.json"), mcpJsonArgentOnly) || dirHasEditorEvidence(path13.join(process.cwd(), ".claude"), claudeDirLooksArgentOnly) || dirHasEditorEvidence(path13.join(homedir4(), ".claude"), claudeDirLooksArgentOnly);
21191
+ return fileHasEditorEvidence(path14.join(process.cwd(), ".mcp.json"), mcpJsonArgentOnly) || fileHasEditorEvidence(path14.join(homedir4(), ".claude.json"), mcpJsonArgentOnly) || dirHasEditorEvidence(path14.join(process.cwd(), ".claude"), claudeDirLooksArgentOnly) || dirHasEditorEvidence(path14.join(homedir4(), ".claude"), claudeDirLooksArgentOnly);
21186
21192
  },
21187
21193
  projectPath(root) {
21188
- return path13.join(root, ".mcp.json");
21194
+ return path14.join(root, ".mcp.json");
21189
21195
  },
21190
21196
  globalPath() {
21191
- return path13.join(homedir4(), ".claude.json");
21197
+ return path14.join(homedir4(), ".claude.json");
21192
21198
  },
21193
21199
  // JSONC is a superset of JSON, so routing through readJsonc / editJsoncFile is
21194
21200
  // safe for this strict-JSON config and keeps every MCP-entry write on the one
@@ -21232,7 +21238,7 @@ var claudeAdapter = {
21232
21238
  // reports recorded .mcp.json rejections (see claudeDisabledListFinding).
21233
21239
  findShadowingConfigs(root, writtenScope) {
21234
21240
  const findings = [];
21235
- const claudeJsonPath = path13.join(homedir4(), ".claude.json");
21241
+ const claudeJsonPath = path14.join(homedir4(), ".claude.json");
21236
21242
  const projects = readJson(claudeJsonPath).projects;
21237
21243
  if (isRecord(projects)) {
21238
21244
  for (const key of claudeProjectKeysForRoot(projects, root)) {
@@ -21269,9 +21275,9 @@ var claudeAdapter = {
21269
21275
  }
21270
21276
  if (writtenScope === "local") {
21271
21277
  const candidates = [
21272
- [path13.join(root, ".claude", "settings.json"), ".claude/settings.json", true],
21273
- [path13.join(root, ".claude", "settings.local.json"), ".claude/settings.local.json", true],
21274
- [path13.join(homedir4(), ".claude", "settings.json"), "~/.claude/settings.json", false]
21278
+ [path14.join(root, ".claude", "settings.json"), ".claude/settings.json", true],
21279
+ [path14.join(root, ".claude", "settings.local.json"), ".claude/settings.local.json", true],
21280
+ [path14.join(homedir4(), ".claude", "settings.json"), "~/.claude/settings.json", false]
21275
21281
  ];
21276
21282
  for (const [settingsPath, label, projectConfined] of candidates) {
21277
21283
  const finding = claudeDisabledListFinding(settingsPath, label, projectConfined);
@@ -21290,10 +21296,10 @@ var claudeAdapter = {
21290
21296
  var vscodeAdapter = {
21291
21297
  name: "VS Code",
21292
21298
  detect() {
21293
- return dirHasEditorEvidence(path13.join(process.cwd(), ".vscode"), vscodeDirLooksArgentOnly) || dirExists(path13.join(homedir4(), ".vscode"));
21299
+ return dirHasEditorEvidence(path14.join(process.cwd(), ".vscode"), vscodeDirLooksArgentOnly) || dirExists(path14.join(homedir4(), ".vscode"));
21294
21300
  },
21295
21301
  projectPath(root) {
21296
- return path13.join(root, ".vscode", "mcp.json");
21302
+ return path14.join(root, ".vscode", "mcp.json");
21297
21303
  },
21298
21304
  globalPath() {
21299
21305
  return null;
@@ -21338,7 +21344,7 @@ var vscodeAdapter = {
21338
21344
  findShadowingConfigs(_root, _writtenScope) {
21339
21345
  const findings = [];
21340
21346
  for (const userDir of vscodeUserDirs()) {
21341
- const configPath = path13.join(userDir, "mcp.json");
21347
+ const configPath = path14.join(userDir, "mcp.json");
21342
21348
  const entry = this.getArgentEntry(configPath);
21343
21349
  if (!entry) continue;
21344
21350
  findings.push({
@@ -21355,16 +21361,16 @@ var vscodeAdapter = {
21355
21361
  function vscodeUserDirs() {
21356
21362
  const bases = [];
21357
21363
  if (process.platform === "darwin") {
21358
- bases.push(path13.join(homedir4(), "Library", "Application Support"));
21364
+ bases.push(path14.join(homedir4(), "Library", "Application Support"));
21359
21365
  } else if (process.platform === "win32") {
21360
21366
  if (process.env.APPDATA) bases.push(process.env.APPDATA);
21361
21367
  } else {
21362
- bases.push(path13.join(homedir4(), ".config"));
21368
+ bases.push(path14.join(homedir4(), ".config"));
21363
21369
  }
21364
21370
  const dirs = [];
21365
21371
  for (const base of bases) {
21366
21372
  for (const product of ["Code", "Code - Insiders"]) {
21367
- const dir = path13.join(base, product, "User");
21373
+ const dir = path14.join(base, product, "User");
21368
21374
  if (dirExists(dir)) dirs.push(dir);
21369
21375
  }
21370
21376
  }
@@ -21374,7 +21380,7 @@ var windsurfAdapter = {
21374
21380
  name: "Windsurf",
21375
21381
  detect() {
21376
21382
  return dirHasEditorEvidence(
21377
- path13.join(homedir4(), ".codeium", "windsurf"),
21383
+ path14.join(homedir4(), ".codeium", "windsurf"),
21378
21384
  windsurfDirLooksArgentOnly
21379
21385
  );
21380
21386
  },
@@ -21382,7 +21388,7 @@ var windsurfAdapter = {
21382
21388
  return null;
21383
21389
  },
21384
21390
  globalPath() {
21385
- return path13.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21391
+ return path14.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21386
21392
  },
21387
21393
  // JSONC-safe MCP-entry writes (see the Cursor adapter): editJsoncFile
21388
21394
  // preserves comments and pre-existing foreign servers on this JSON config.
@@ -21416,7 +21422,7 @@ var windsurfAdapter = {
21416
21422
  // silently skipped the toggle; editJsoncFile targets just the argent entry's
21417
21423
  // alwaysAllow key so comments and foreign servers survive.
21418
21424
  addAllowlist() {
21419
- const configPath = path13.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21425
+ const configPath = path14.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21420
21426
  const config = readJsonc(configPath);
21421
21427
  const servers = config.mcpServers;
21422
21428
  if (!servers?.[MCP_SERVER_KEY]) return;
@@ -21424,7 +21430,7 @@ var windsurfAdapter = {
21424
21430
  },
21425
21431
  removeAllowlist(_root, scope) {
21426
21432
  if (scope !== "global") return;
21427
- const configPath = path13.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21433
+ const configPath = path14.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21428
21434
  if (!fs13.existsSync(configPath)) return;
21429
21435
  const config = readJsonc(configPath);
21430
21436
  const servers = config.mcpServers;
@@ -21436,13 +21442,13 @@ var windsurfAdapter = {
21436
21442
  var zedAdapter = {
21437
21443
  name: "Zed",
21438
21444
  detect() {
21439
- return dirHasEditorEvidence(path13.join(homedir4(), ".config", "zed"), zedDirLooksArgentOnly);
21445
+ return dirHasEditorEvidence(path14.join(homedir4(), ".config", "zed"), zedDirLooksArgentOnly);
21440
21446
  },
21441
21447
  projectPath(root) {
21442
- return path13.join(root, ".zed", "settings.json");
21448
+ return path14.join(root, ".zed", "settings.json");
21443
21449
  },
21444
21450
  globalPath() {
21445
- return path13.join(homedir4(), ".config", "zed", "settings.json");
21451
+ return path14.join(homedir4(), ".config", "zed", "settings.json");
21446
21452
  },
21447
21453
  // Zed's settings.json is JSONC (line + block comments, trailing commas).
21448
21454
  // The previous JSON.parse → mutate → JSON.stringify path silently stripped
@@ -21479,11 +21485,11 @@ var zedAdapter = {
21479
21485
  // documented opt-in; built-in security rules still protect against
21480
21486
  // destructive operations.
21481
21487
  addAllowlist(root, scope) {
21482
- const settingsPath = scope === "global" ? path13.join(homedir4(), ".config", "zed", "settings.json") : path13.join(root, ".zed", "settings.json");
21488
+ const settingsPath = scope === "global" ? path14.join(homedir4(), ".config", "zed", "settings.json") : path14.join(root, ".zed", "settings.json");
21483
21489
  editJsoncFile(settingsPath, ["agent", "tool_permissions", "default"], "allow");
21484
21490
  },
21485
21491
  removeAllowlist(root, scope) {
21486
- const settingsPath = scope === "global" ? path13.join(homedir4(), ".config", "zed", "settings.json") : path13.join(root, ".zed", "settings.json");
21492
+ const settingsPath = scope === "global" ? path14.join(homedir4(), ".config", "zed", "settings.json") : path14.join(root, ".zed", "settings.json");
21487
21493
  if (!fs13.existsSync(settingsPath)) return;
21488
21494
  const config = readJsonc(settingsPath);
21489
21495
  const perms = config.agent?.tool_permissions;
@@ -21494,13 +21500,13 @@ var zedAdapter = {
21494
21500
  var geminiAdapter = {
21495
21501
  name: "Gemini",
21496
21502
  detect() {
21497
- return dirHasEditorEvidence(path13.join(homedir4(), ".gemini"), geminiDirLooksArgentOnly) || dirHasEditorEvidence(path13.join(process.cwd(), ".gemini"), geminiDirLooksArgentOnly);
21503
+ return dirHasEditorEvidence(path14.join(homedir4(), ".gemini"), geminiDirLooksArgentOnly) || dirHasEditorEvidence(path14.join(process.cwd(), ".gemini"), geminiDirLooksArgentOnly);
21498
21504
  },
21499
21505
  projectPath(root) {
21500
- return path13.join(root, ".gemini", "settings.json");
21506
+ return path14.join(root, ".gemini", "settings.json");
21501
21507
  },
21502
21508
  globalPath() {
21503
- return path13.join(homedir4(), ".gemini", "settings.json");
21509
+ return path14.join(homedir4(), ".gemini", "settings.json");
21504
21510
  },
21505
21511
  // JSONC-safe MCP-entry writes (see the Cursor adapter): editJsoncFile
21506
21512
  // preserves comments and pre-existing foreign servers on this JSON config.
@@ -21559,13 +21565,13 @@ var CODEX_FILENAME = ".codex";
21559
21565
  var codexAdapter = {
21560
21566
  name: "Codex",
21561
21567
  detect() {
21562
- return dirHasEditorEvidence(path13.join(homedir4(), CODEX_FILENAME), codexDirLooksArgentOnly) || dirHasEditorEvidence(path13.join(process.cwd(), CODEX_FILENAME), codexDirLooksArgentOnly);
21568
+ return dirHasEditorEvidence(path14.join(homedir4(), CODEX_FILENAME), codexDirLooksArgentOnly) || dirHasEditorEvidence(path14.join(process.cwd(), CODEX_FILENAME), codexDirLooksArgentOnly);
21563
21569
  },
21564
21570
  projectPath(root) {
21565
- return path13.join(root, CODEX_FILENAME, "config.toml");
21571
+ return path14.join(root, CODEX_FILENAME, "config.toml");
21566
21572
  },
21567
21573
  globalPath() {
21568
- return path13.join(homedir4(), CODEX_FILENAME, "config.toml");
21574
+ return path14.join(homedir4(), CODEX_FILENAME, "config.toml");
21569
21575
  },
21570
21576
  write(configPath, entry) {
21571
21577
  const config = readToml(configPath);
@@ -21637,13 +21643,13 @@ var codexAdapter = {
21637
21643
  var hermesAdapter = {
21638
21644
  name: "Hermes",
21639
21645
  detect() {
21640
- return dirHasEditorEvidence(path13.join(homedir4(), ".hermes"), hermesDirLooksArgentOnly);
21646
+ return dirHasEditorEvidence(path14.join(homedir4(), ".hermes"), hermesDirLooksArgentOnly);
21641
21647
  },
21642
21648
  projectPath() {
21643
21649
  return null;
21644
21650
  },
21645
21651
  globalPath() {
21646
- return path13.join(homedir4(), ".hermes", "config.yaml");
21652
+ return path14.join(homedir4(), ".hermes", "config.yaml");
21647
21653
  },
21648
21654
  write(configPath, entry) {
21649
21655
  const doc = readYaml(configPath);
@@ -21702,10 +21708,10 @@ function hasOpenCodeBinary() {
21702
21708
  }
21703
21709
  function pickOpencodeConfig(dir, candidates) {
21704
21710
  for (const name of candidates) {
21705
- const candidate = path13.join(dir, name);
21711
+ const candidate = path14.join(dir, name);
21706
21712
  if (fs13.existsSync(candidate)) return candidate;
21707
21713
  }
21708
- return path13.join(dir, "opencode.json");
21714
+ return path14.join(dir, "opencode.json");
21709
21715
  }
21710
21716
  var openCodeAdapter = {
21711
21717
  name: "opencode",
@@ -21716,7 +21722,7 @@ var openCodeAdapter = {
21716
21722
  return pickOpencodeConfig(root, OPENCODE_PROJECT_FILES);
21717
21723
  },
21718
21724
  globalPath() {
21719
- return pickOpencodeConfig(path13.join(homedir4(), ".config", "opencode"), OPENCODE_GLOBAL_FILES);
21725
+ return pickOpencodeConfig(path14.join(homedir4(), ".config", "opencode"), OPENCODE_GLOBAL_FILES);
21720
21726
  },
21721
21727
  write(configPath, entry) {
21722
21728
  editJsoncFile(configPath, ["mcp", MCP_SERVER_KEY], {
@@ -21761,13 +21767,13 @@ var KIRO_AUTO_APPROVE_ALL = ["*"];
21761
21767
  var kiroAdapter = {
21762
21768
  name: "Kiro",
21763
21769
  detect() {
21764
- return dirHasEditorEvidence(path13.join(homedir4(), ".kiro"), kiroDirLooksArgentOnly) || dirHasEditorEvidence(path13.join(process.cwd(), ".kiro"), kiroDirLooksArgentOnly);
21770
+ return dirHasEditorEvidence(path14.join(homedir4(), ".kiro"), kiroDirLooksArgentOnly) || dirHasEditorEvidence(path14.join(process.cwd(), ".kiro"), kiroDirLooksArgentOnly);
21765
21771
  },
21766
21772
  projectPath(root) {
21767
- return path13.join(root, ".kiro", "settings", "mcp.json");
21773
+ return path14.join(root, ".kiro", "settings", "mcp.json");
21768
21774
  },
21769
21775
  globalPath() {
21770
- return path13.join(homedir4(), ".kiro", "settings", "mcp.json");
21776
+ return path14.join(homedir4(), ".kiro", "settings", "mcp.json");
21771
21777
  },
21772
21778
  // Kiro is a VS Code fork: .kiro/settings/mcp.json is JSONC. As with Cursor,
21773
21779
  // route write/remove/hasArgentEntry through readJsonc / editJsoncFile so
@@ -21861,7 +21867,7 @@ function findConfiguredAdapterScopes(adapters, projectRoot) {
21861
21867
  return results;
21862
21868
  }
21863
21869
  function addClaudePermission(root, scope) {
21864
- const settingsPath = scope === "global" ? path13.join(homedir4(), ".claude", "settings.json") : path13.join(root, ".claude", "settings.json");
21870
+ const settingsPath = scope === "global" ? path14.join(homedir4(), ".claude", "settings.json") : path14.join(root, ".claude", "settings.json");
21865
21871
  const config = readJsonc(settingsPath);
21866
21872
  const permissions = config.permissions ?? {};
21867
21873
  const allow = Array.isArray(permissions.allow) ? permissions.allow : [];
@@ -21869,7 +21875,7 @@ function addClaudePermission(root, scope) {
21869
21875
  editJsoncFile(settingsPath, ["permissions", "allow"], [...allow, PERMISSION_RULE]);
21870
21876
  }
21871
21877
  function removeClaudePermission(root, scope) {
21872
- const settingsPath = scope === "global" ? path13.join(homedir4(), ".claude", "settings.json") : path13.join(root, ".claude", "settings.json");
21878
+ const settingsPath = scope === "global" ? path14.join(homedir4(), ".claude", "settings.json") : path14.join(root, ".claude", "settings.json");
21873
21879
  if (!fs13.existsSync(settingsPath)) return;
21874
21880
  const config = readJsonc(settingsPath);
21875
21881
  const permissions = config?.permissions;
@@ -21881,11 +21887,11 @@ function removeClaudePermission(root, scope) {
21881
21887
  }
21882
21888
  function formatManagedPathLabel(targetPath, root) {
21883
21889
  const home = homedir4();
21884
- if (targetPath === home || targetPath.startsWith(`${home}${path13.sep}`)) {
21890
+ if (targetPath === home || targetPath.startsWith(`${home}${path14.sep}`)) {
21885
21891
  return `~${targetPath.slice(home.length)}`;
21886
21892
  }
21887
- const relative5 = path13.relative(root, targetPath);
21888
- if (relative5 && !relative5.startsWith("..") && !path13.isAbsolute(relative5)) {
21893
+ const relative5 = path14.relative(root, targetPath);
21894
+ if (relative5 && !relative5.startsWith("..") && !path14.isAbsolute(relative5)) {
21889
21895
  return relative5;
21890
21896
  }
21891
21897
  return targetPath;
@@ -21899,7 +21905,7 @@ function addManagedTarget(targets, editorName, targetPath, root) {
21899
21905
  }
21900
21906
  function getAdapterBasePath(adapter, root, scope) {
21901
21907
  const configPath = scope === "global" ? adapter.globalPath() : adapter.projectPath(root);
21902
- return configPath ? path13.dirname(configPath) : null;
21908
+ return configPath ? path14.dirname(configPath) : null;
21903
21909
  }
21904
21910
  function getManagedContentTargets(adapters, root, scope) {
21905
21911
  const targets = {
@@ -21913,13 +21919,13 @@ function getManagedContentTargets(adapters, root, scope) {
21913
21919
  addManagedTarget(
21914
21920
  targets.skillTargets,
21915
21921
  "skills",
21916
- path13.join(workspaceBase, ".agents", "skills"),
21922
+ path14.join(workspaceBase, ".agents", "skills"),
21917
21923
  root
21918
21924
  );
21919
21925
  addManagedTarget(
21920
21926
  targets.skillsLockTargets,
21921
21927
  "skills",
21922
- path13.join(workspaceBase, "skills-lock.json"),
21928
+ path14.join(workspaceBase, "skills-lock.json"),
21923
21929
  root
21924
21930
  );
21925
21931
  for (const adapter of adapters) {
@@ -21927,21 +21933,21 @@ function getManagedContentTargets(adapters, root, scope) {
21927
21933
  case "Cursor": {
21928
21934
  const base = getAdapterBasePath(adapter, root, scope);
21929
21935
  if (!base) break;
21930
- addManagedTarget(targets.skillTargets, adapter.name, path13.join(base, "skills"), root);
21931
- addManagedTarget(targets.ruleTargets, adapter.name, path13.join(base, "rules"), root);
21936
+ addManagedTarget(targets.skillTargets, adapter.name, path14.join(base, "skills"), root);
21937
+ addManagedTarget(targets.ruleTargets, adapter.name, path14.join(base, "rules"), root);
21932
21938
  break;
21933
21939
  }
21934
21940
  case "Claude Code": {
21935
- const claudeBase = scope === "global" ? path13.join(homedir4(), ".claude") : path13.join(root, ".claude");
21936
- addManagedTarget(targets.skillTargets, adapter.name, path13.join(claudeBase, "skills"), root);
21937
- addManagedTarget(targets.ruleTargets, adapter.name, path13.join(claudeBase, "rules"), root);
21938
- addManagedTarget(targets.agentTargets, adapter.name, path13.join(claudeBase, "agents"), root);
21941
+ const claudeBase = scope === "global" ? path14.join(homedir4(), ".claude") : path14.join(root, ".claude");
21942
+ addManagedTarget(targets.skillTargets, adapter.name, path14.join(claudeBase, "skills"), root);
21943
+ addManagedTarget(targets.ruleTargets, adapter.name, path14.join(claudeBase, "rules"), root);
21944
+ addManagedTarget(targets.agentTargets, adapter.name, path14.join(claudeBase, "agents"), root);
21939
21945
  break;
21940
21946
  }
21941
21947
  case "Gemini": {
21942
- const geminiBase = scope === "global" ? path13.join(homedir4(), ".gemini") : path13.join(root, ".gemini");
21943
- addManagedTarget(targets.ruleTargets, adapter.name, path13.join(geminiBase, "rules"), root);
21944
- addManagedTarget(targets.agentTargets, adapter.name, path13.join(geminiBase, "agents"), root);
21948
+ const geminiBase = scope === "global" ? path14.join(homedir4(), ".gemini") : path14.join(root, ".gemini");
21949
+ addManagedTarget(targets.ruleTargets, adapter.name, path14.join(geminiBase, "rules"), root);
21950
+ addManagedTarget(targets.agentTargets, adapter.name, path14.join(geminiBase, "agents"), root);
21945
21951
  break;
21946
21952
  }
21947
21953
  case "Codex": {
@@ -21951,9 +21957,9 @@ function getManagedContentTargets(adapters, root, scope) {
21951
21957
  break;
21952
21958
  }
21953
21959
  case "opencode": {
21954
- const base = scope === "global" ? path13.join(homedir4(), ".config", "opencode") : path13.join(root, ".opencode");
21955
- addManagedTarget(targets.skillTargets, adapter.name, path13.join(base, "skills"), root);
21956
- addManagedTarget(targets.agentTargets, adapter.name, path13.join(base, "agents"), root);
21960
+ const base = scope === "global" ? path14.join(homedir4(), ".config", "opencode") : path14.join(root, ".opencode");
21961
+ addManagedTarget(targets.skillTargets, adapter.name, path14.join(base, "skills"), root);
21962
+ addManagedTarget(targets.agentTargets, adapter.name, path14.join(base, "agents"), root);
21957
21963
  break;
21958
21964
  }
21959
21965
  }
@@ -21972,7 +21978,7 @@ function readAndConcatRules(rulesDir) {
21972
21978
  if (files.length === 0) return null;
21973
21979
  const parts = [];
21974
21980
  for (const file of files) {
21975
- const raw = fs13.readFileSync(path13.join(rulesDir, file), "utf8");
21981
+ const raw = fs13.readFileSync(path14.join(rulesDir, file), "utf8");
21976
21982
  const stripped = stripFrontmatter(raw);
21977
21983
  if (stripped) parts.push(stripped);
21978
21984
  }
@@ -22297,7 +22303,7 @@ var ShellCommandError = class extends Error {
22297
22303
  signal;
22298
22304
  };
22299
22305
  function runShellCommand(cmd, opts = {}) {
22300
- return new Promise((resolve10, reject) => {
22306
+ return new Promise((resolve11, reject) => {
22301
22307
  const child = spawn2(cmd.bin, cmd.args, {
22302
22308
  stdio: ["ignore", "pipe", "pipe"],
22303
22309
  shell: process.platform === "win32",
@@ -22308,7 +22314,7 @@ function runShellCommand(cmd, opts = {}) {
22308
22314
  stderr += chunk.toString();
22309
22315
  });
22310
22316
  child.on("close", (code, signal) => {
22311
- if (code === 0) resolve10();
22317
+ if (code === 0) resolve11();
22312
22318
  else
22313
22319
  reject(
22314
22320
  new ShellCommandError(
@@ -22745,7 +22751,7 @@ async function chooseAdapters(opts) {
22745
22751
  // ../argent-installer/src/init-scope.ts
22746
22752
  var import_picocolors5 = __toESM(require_picocolors(), 1);
22747
22753
  import { existsSync as existsSync12 } from "node:fs";
22748
- import { resolve as resolve6 } from "node:path";
22754
+ import { resolve as resolve7 } from "node:path";
22749
22755
  async function chooseScope(opts) {
22750
22756
  if (opts.installMode === "local") {
22751
22757
  return { scope: "local" };
@@ -22782,13 +22788,13 @@ async function chooseScope(opts) {
22782
22788
  placeholder: process.cwd(),
22783
22789
  validate(value) {
22784
22790
  if (!value?.trim()) return "Path cannot be empty.";
22785
- const resolved = resolve6(value.trim());
22791
+ const resolved = resolve7(value.trim());
22786
22792
  if (!existsSync12(resolved))
22787
22793
  return `Path does not exist: ${resolved}. Please verify and enter a valid path.`;
22788
22794
  }
22789
22795
  });
22790
22796
  if (isCancel(customPathInput)) throw new InitCancelled("scope");
22791
- return { scope: "custom", customRoot: resolve6(customPathInput.trim()) };
22797
+ return { scope: "custom", customRoot: resolve7(customPathInput.trim()) };
22792
22798
  }
22793
22799
 
22794
22800
  // ../argent-installer/src/init-mcp-write.ts
@@ -23183,7 +23189,7 @@ async function runSkillsStep(args) {
23183
23189
  return skillsMethod;
23184
23190
  }
23185
23191
  function runNpxSkills(args, interactive, cwd) {
23186
- return new Promise((resolve10, reject) => {
23192
+ return new Promise((resolve11, reject) => {
23187
23193
  const npxCmd = process.platform === "win32" ? "npx.cmd" : "npx";
23188
23194
  const child = spawn3(npxCmd, args, {
23189
23195
  stdio: interactive ? "inherit" : ["ignore", "pipe", "pipe"],
@@ -23202,7 +23208,7 @@ function runNpxSkills(args, interactive, cwd) {
23202
23208
  }
23203
23209
  child.on("close", (code) => {
23204
23210
  if (code === 0) {
23205
- resolve10();
23211
+ resolve11();
23206
23212
  } else {
23207
23213
  const output = [stderr, stdout2].filter(Boolean).join("\n").trim();
23208
23214
  reject(new Error(output || `npx skills exited with code ${code}`));
@@ -23475,7 +23481,7 @@ function printBanner() {
23475
23481
  // ../argent-installer/src/update.ts
23476
23482
  var import_picocolors11 = __toESM(require_picocolors(), 1);
23477
23483
  var import_semver3 = __toESM(require_semver2(), 1);
23478
- import * as path17 from "node:path";
23484
+ import * as path18 from "node:path";
23479
23485
 
23480
23486
  // ../argent-installer/src/update-target.ts
23481
23487
  var import_update_core = __toESM(require_dist2(), 1);
@@ -23495,16 +23501,16 @@ async function resolveInstallableUpdateTarget(pm, current) {
23495
23501
  // ../argent-tools-client/src/launcher.ts
23496
23502
  import * as net from "node:net";
23497
23503
  import * as fs14 from "node:fs";
23498
- import * as path14 from "node:path";
23504
+ import * as path15 from "node:path";
23499
23505
  import * as readline from "node:readline";
23500
23506
  import { homedir as homedir5 } from "node:os";
23501
23507
  import { spawn as spawn4, execFileSync as execFileSync5 } from "node:child_process";
23502
23508
  import { createHash as createHash2, randomBytes } from "node:crypto";
23503
23509
  import { mkdir, writeFile, readFile, readdir, unlink, rename, chmod } from "node:fs/promises";
23504
- var STATE_DIR = path14.join(homedir5(), ".argent");
23505
- var STATE_FILE = path14.join(STATE_DIR, "tool-server.json");
23506
- var LOG_FILE = path14.join(STATE_DIR, "tool-server.log");
23507
- var LOCK_FILE = path14.join(STATE_DIR, "tool-server.lock");
23510
+ var STATE_DIR = path15.join(homedir5(), ".argent");
23511
+ var STATE_FILE = path15.join(STATE_DIR, "tool-server.json");
23512
+ var LOG_FILE = path15.join(STATE_DIR, "tool-server.log");
23513
+ var LOCK_FILE = path15.join(STATE_DIR, "tool-server.lock");
23508
23514
  function isProcessAlive(pid) {
23509
23515
  try {
23510
23516
  process.kill(pid, 0);
@@ -23515,7 +23521,7 @@ function isProcessAlive(pid) {
23515
23521
  }
23516
23522
  function stateFileForBundle(bundlePath) {
23517
23523
  const key = createHash2("sha256").update(bundlePath).digest("hex").slice(0, 12);
23518
- return path14.join(STATE_DIR, `tool-server-${key}.json`);
23524
+ return path15.join(STATE_DIR, `tool-server-${key}.json`);
23519
23525
  }
23520
23526
  async function readStateFile(file) {
23521
23527
  try {
@@ -23557,7 +23563,7 @@ async function readAllToolsServerStates() {
23557
23563
  const out = [];
23558
23564
  for (const name of names) {
23559
23565
  if (!STATE_FILE_RE.test(name)) continue;
23560
- const file = path14.join(STATE_DIR, name);
23566
+ const file = path15.join(STATE_DIR, name);
23561
23567
  const state2 = await readStateFile(file);
23562
23568
  if (state2) out.push({ file, state: state2 });
23563
23569
  }
@@ -23599,8 +23605,8 @@ async function killToolServer(bundlePath) {
23599
23605
  await clearToolsServerState(bundlePath ?? state2.bundlePath);
23600
23606
  }
23601
23607
  function isPathWithin(child, parent) {
23602
- const rel = path14.relative(parent, child);
23603
- return rel !== "" && !rel.startsWith("..") && !path14.isAbsolute(rel);
23608
+ const rel = path15.relative(parent, child);
23609
+ return rel !== "" && !rel.startsWith("..") && !path15.isAbsolute(rel);
23604
23610
  }
23605
23611
  function tryRealpath(p) {
23606
23612
  try {
@@ -23610,10 +23616,10 @@ function tryRealpath(p) {
23610
23616
  }
23611
23617
  }
23612
23618
  async function killToolServerForInstallDir(packageDir) {
23613
- const parents = /* @__PURE__ */ new Set([path14.resolve(packageDir), tryRealpath(packageDir)]);
23619
+ const parents = /* @__PURE__ */ new Set([path15.resolve(packageDir), tryRealpath(packageDir)]);
23614
23620
  let killed = 0;
23615
23621
  for (const { file, state: state2 } of await readAllToolsServerStates()) {
23616
- const bundles = /* @__PURE__ */ new Set([path14.resolve(state2.bundlePath), tryRealpath(state2.bundlePath)]);
23622
+ const bundles = /* @__PURE__ */ new Set([path15.resolve(state2.bundlePath), tryRealpath(state2.bundlePath)]);
23617
23623
  const matches2 = [...bundles].some((b) => [...parents].some((p) => isPathWithin(b, p)));
23618
23624
  if (!matches2) continue;
23619
23625
  const fresh = await readStateFile(file);
@@ -23652,23 +23658,23 @@ function processCommandMatches(pid, marker) {
23652
23658
  }
23653
23659
 
23654
23660
  // ../argent-tools-client/src/link-config.ts
23655
- import * as path15 from "node:path";
23661
+ import * as path16 from "node:path";
23656
23662
  import { homedir as homedir6 } from "node:os";
23657
23663
  import { mkdir as mkdir2, writeFile as writeFile2, readFile as readFile2, unlink as unlink2, chmod as chmod2 } from "node:fs/promises";
23658
- var LINK_DIR = path15.join(homedir6(), ".argent");
23659
- var LINK_FILE = path15.join(LINK_DIR, "link.json");
23664
+ var LINK_DIR = path16.join(homedir6(), ".argent");
23665
+ var LINK_FILE = path16.join(LINK_DIR, "link.json");
23660
23666
 
23661
23667
  // ../argent-tools-client/src/file-inputs.ts
23662
23668
  import { createHash as createHash3, randomUUID as randomUUID6 } from "node:crypto";
23663
23669
  import { createReadStream as createReadStream2 } from "node:fs";
23664
23670
  import { mkdir as mkdir3, readFile as readFile3, rm as rm2, stat as stat2, writeFile as writeFile3 } from "node:fs/promises";
23665
23671
  import { tmpdir } from "node:os";
23666
- import * as path16 from "node:path";
23672
+ import * as path17 from "node:path";
23667
23673
 
23668
23674
  // ../archive/src/index.ts
23669
23675
  import { execFile } from "node:child_process";
23670
23676
  import { rm, readdir as readdir2 } from "node:fs/promises";
23671
- import { basename as basename2, dirname as dirname11, join as join17, posix as posix2, resolve as resolve8, sep as sep5 } from "node:path";
23677
+ import { basename as basename2, dirname as dirname11, join as join17, posix as posix2, resolve as resolve9, sep as sep5 } from "node:path";
23672
23678
  import { promisify } from "node:util";
23673
23679
  var execFileAsync = promisify(execFile);
23674
23680
 
@@ -24037,7 +24043,7 @@ async function update(args) {
24037
24043
  process.exit(1);
24038
24044
  }
24039
24045
  const rootOverride = getProjectRootOverride(args);
24040
- const projectRoot = rootOverride ? path17.resolve(rootOverride) : resolveProjectRoot2(process.cwd());
24046
+ const projectRoot = rootOverride ? path18.resolve(rootOverride) : resolveProjectRoot2(process.cwd());
24041
24047
  installMode = resolveInstallMode(projectRoot);
24042
24048
  const flags = parseTargetFlags(args);
24043
24049
  const localInstalled = installMode === "local" && probeLocalInstall(projectRoot).installed;
@@ -24209,7 +24215,7 @@ async function update(args) {
24209
24215
  var import_picocolors12 = __toESM(require_picocolors(), 1);
24210
24216
  var import_yaml3 = __toESM(require_dist(), 1);
24211
24217
  import * as fs15 from "node:fs";
24212
- import * as path18 from "node:path";
24218
+ import * as path19 from "node:path";
24213
24219
  var UNINSTALL_TOOLSERVER_STOP_FAILED = {
24214
24220
  error_code: FAILURE_CODES.UNINSTALL_TOOLSERVER_STOP_FAILED,
24215
24221
  failure_stage: "installer_uninstall_toolserver_stop",
@@ -24244,8 +24250,8 @@ function collectBundledPaths(sourceDir) {
24244
24250
  const directories = [];
24245
24251
  function walk(currentDir, relativeDir = "") {
24246
24252
  for (const entry of fs15.readdirSync(currentDir, { withFileTypes: true })) {
24247
- const relativePath = relativeDir ? path18.join(relativeDir, entry.name) : entry.name;
24248
- const absolutePath = path18.join(currentDir, entry.name);
24253
+ const relativePath = relativeDir ? path19.join(relativeDir, entry.name) : entry.name;
24254
+ const absolutePath = path19.join(currentDir, entry.name);
24249
24255
  if (entry.isDirectory()) {
24250
24256
  walk(absolutePath, relativePath);
24251
24257
  directories.push(relativePath);
@@ -24264,7 +24270,7 @@ function removeBundledContent(sourceDir, targetDir) {
24264
24270
  const { files, directories } = collectBundledPaths(sourceDir);
24265
24271
  const removedPaths = [];
24266
24272
  for (const relativePath of files) {
24267
- const targetPath = path18.join(targetDir, relativePath);
24273
+ const targetPath = path19.join(targetDir, relativePath);
24268
24274
  try {
24269
24275
  if (!fs15.existsSync(targetPath)) continue;
24270
24276
  if (fs15.lstatSync(targetPath).isDirectory()) continue;
@@ -24274,10 +24280,10 @@ function removeBundledContent(sourceDir, targetDir) {
24274
24280
  }
24275
24281
  }
24276
24282
  directories.sort(
24277
- (a3, b) => b.split(path18.sep).length - a3.split(path18.sep).length || b.length - a3.length
24283
+ (a3, b) => b.split(path19.sep).length - a3.split(path19.sep).length || b.length - a3.length
24278
24284
  );
24279
24285
  for (const relativePath of directories) {
24280
- const targetPath = path18.join(targetDir, relativePath);
24286
+ const targetPath = path19.join(targetDir, relativePath);
24281
24287
  try {
24282
24288
  if (!fs15.existsSync(targetPath)) continue;
24283
24289
  if (!fs15.statSync(targetPath).isDirectory()) continue;
@@ -24297,7 +24303,7 @@ function removeBundledContent(sourceDir, targetDir) {
24297
24303
  } catch {
24298
24304
  }
24299
24305
  if (removedRoot) {
24300
- removeDirIfEmpty2(path18.dirname(targetDir));
24306
+ removeDirIfEmpty2(path19.dirname(targetDir));
24301
24307
  }
24302
24308
  return { removedPaths, removedRoot };
24303
24309
  }
@@ -24318,7 +24324,7 @@ function getBundledSkillNames(skillsDir) {
24318
24324
  const skillNames = [];
24319
24325
  for (const entry of fs15.readdirSync(skillsDir, { withFileTypes: true })) {
24320
24326
  if (!entry.isDirectory()) continue;
24321
- const skillFilePath = path18.join(skillsDir, entry.name, "SKILL.md");
24327
+ const skillFilePath = path19.join(skillsDir, entry.name, "SKILL.md");
24322
24328
  if (!fs15.existsSync(skillFilePath)) continue;
24323
24329
  skillNames.push(readBundledSkillName(skillFilePath, entry.name));
24324
24330
  }
@@ -24330,7 +24336,7 @@ function removeBundledSkillInstalls(skillNames, targetDir) {
24330
24336
  }
24331
24337
  const removedPaths = [];
24332
24338
  for (const skillName of skillNames) {
24333
- const targetPath = path18.join(targetDir, skillName);
24339
+ const targetPath = path19.join(targetDir, skillName);
24334
24340
  try {
24335
24341
  if (!fs15.existsSync(targetPath)) continue;
24336
24342
  const stats = fs15.lstatSync(targetPath);
@@ -24345,7 +24351,7 @@ function removeBundledSkillInstalls(skillNames, targetDir) {
24345
24351
  }
24346
24352
  const removedRoot = removeDirIfEmpty2(targetDir);
24347
24353
  if (removedRoot) {
24348
- removeDirIfEmpty2(path18.dirname(targetDir));
24354
+ removeDirIfEmpty2(path19.dirname(targetDir));
24349
24355
  }
24350
24356
  return { removedPaths, removedRoot };
24351
24357
  }