@swmansion/argent 0.32.1-next.11 → 0.32.1-next.12

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.
package/dist/cli-cmds.mjs CHANGED
@@ -10469,6 +10469,7 @@ var FAILURE_CODES = {
10469
10469
  INSTALL_MODE_FLAG_CONFLICT: "INSTALL_MODE_FLAG_CONFLICT",
10470
10470
  INSTALL_FROM_TAR_PACKAGE_FAILED: "INSTALL_FROM_TAR_PACKAGE_FAILED",
10471
10471
  INSTALL_INIT_TRIGGERED_UPDATE_FAILED: "INSTALL_INIT_TRIGGERED_UPDATE_FAILED",
10472
+ INSTALL_SKILLS_FAILED: "INSTALL_SKILLS_FAILED",
10472
10473
  INSTALL_SKILLS_REFRESH_FAILED: "INSTALL_SKILLS_REFRESH_FAILED",
10473
10474
  INSTALL_UNCLASSIFIED_FAILED: "INSTALL_UNCLASSIFIED_FAILED",
10474
10475
  UPDATE_INSTALLED_VERSION_DETECT_FAILED: "UPDATE_INSTALLED_VERSION_DETECT_FAILED",
@@ -35234,6 +35235,9 @@ var ALLOWED = {
35234
35235
  warned_count: COUNT
35235
35236
  },
35236
35237
  "installation:skill_install": {
35238
+ source: oneOf(["pinned", "bundled"]),
35239
+ used_fallback: bool,
35240
+ fallback_reason: oneOf(["ref_missing", "unclassified"]),
35237
35241
  method: oneOf(["default", "interactive", "manual"]),
35238
35242
  is_online: bool,
35239
35243
  has_offline_cache: bool,
@@ -35834,7 +35838,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
35834
35838
  var SESSION_ID2 = randomUUID5();
35835
35839
  function readCliVersion() {
35836
35840
  if (true) {
35837
- return "0.32.1-next.10";
35841
+ return "0.32.1-next.12";
35838
35842
  }
35839
35843
  return "0.0.0";
35840
35844
  }
package/dist/client.js CHANGED
@@ -9042,6 +9042,7 @@ var FAILURE_CODES = {
9042
9042
  INSTALL_MODE_FLAG_CONFLICT: "INSTALL_MODE_FLAG_CONFLICT",
9043
9043
  INSTALL_FROM_TAR_PACKAGE_FAILED: "INSTALL_FROM_TAR_PACKAGE_FAILED",
9044
9044
  INSTALL_INIT_TRIGGERED_UPDATE_FAILED: "INSTALL_INIT_TRIGGERED_UPDATE_FAILED",
9045
+ INSTALL_SKILLS_FAILED: "INSTALL_SKILLS_FAILED",
9045
9046
  INSTALL_SKILLS_REFRESH_FAILED: "INSTALL_SKILLS_REFRESH_FAILED",
9046
9047
  INSTALL_UNCLASSIFIED_FAILED: "INSTALL_UNCLASSIFIED_FAILED",
9047
9048
  UPDATE_INSTALLED_VERSION_DETECT_FAILED: "UPDATE_INSTALLED_VERSION_DETECT_FAILED",
@@ -3652,17 +3652,17 @@ var require_visit = __commonJS({
3652
3652
  visit2.BREAK = BREAK;
3653
3653
  visit2.SKIP = SKIP;
3654
3654
  visit2.REMOVE = REMOVE;
3655
- function visit_(key, node, visitor, path29) {
3656
- const ctrl = callVisitor(key, node, visitor, path29);
3655
+ function visit_(key, node, visitor, path30) {
3656
+ const ctrl = callVisitor(key, node, visitor, path30);
3657
3657
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
3658
- replaceNode(key, path29, ctrl);
3659
- return visit_(key, ctrl, visitor, path29);
3658
+ replaceNode(key, path30, ctrl);
3659
+ return visit_(key, ctrl, visitor, path30);
3660
3660
  }
3661
3661
  if (typeof ctrl !== "symbol") {
3662
3662
  if (identity2.isCollection(node)) {
3663
- path29 = Object.freeze(path29.concat(node));
3663
+ path30 = Object.freeze(path30.concat(node));
3664
3664
  for (let i2 = 0; i2 < node.items.length; ++i2) {
3665
- const ci = visit_(i2, node.items[i2], visitor, path29);
3665
+ const ci = visit_(i2, node.items[i2], visitor, path30);
3666
3666
  if (typeof ci === "number")
3667
3667
  i2 = ci - 1;
3668
3668
  else if (ci === BREAK)
@@ -3673,13 +3673,13 @@ var require_visit = __commonJS({
3673
3673
  }
3674
3674
  }
3675
3675
  } else if (identity2.isPair(node)) {
3676
- path29 = Object.freeze(path29.concat(node));
3677
- const ck = visit_("key", node.key, visitor, path29);
3676
+ path30 = Object.freeze(path30.concat(node));
3677
+ const ck = visit_("key", node.key, visitor, path30);
3678
3678
  if (ck === BREAK)
3679
3679
  return BREAK;
3680
3680
  else if (ck === REMOVE)
3681
3681
  node.key = null;
3682
- const cv = visit_("value", node.value, visitor, path29);
3682
+ const cv = visit_("value", node.value, visitor, path30);
3683
3683
  if (cv === BREAK)
3684
3684
  return BREAK;
3685
3685
  else if (cv === REMOVE)
@@ -3700,17 +3700,17 @@ var require_visit = __commonJS({
3700
3700
  visitAsync.BREAK = BREAK;
3701
3701
  visitAsync.SKIP = SKIP;
3702
3702
  visitAsync.REMOVE = REMOVE;
3703
- async function visitAsync_(key, node, visitor, path29) {
3704
- const ctrl = await callVisitor(key, node, visitor, path29);
3703
+ async function visitAsync_(key, node, visitor, path30) {
3704
+ const ctrl = await callVisitor(key, node, visitor, path30);
3705
3705
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
3706
- replaceNode(key, path29, ctrl);
3707
- return visitAsync_(key, ctrl, visitor, path29);
3706
+ replaceNode(key, path30, ctrl);
3707
+ return visitAsync_(key, ctrl, visitor, path30);
3708
3708
  }
3709
3709
  if (typeof ctrl !== "symbol") {
3710
3710
  if (identity2.isCollection(node)) {
3711
- path29 = Object.freeze(path29.concat(node));
3711
+ path30 = Object.freeze(path30.concat(node));
3712
3712
  for (let i2 = 0; i2 < node.items.length; ++i2) {
3713
- const ci = await visitAsync_(i2, node.items[i2], visitor, path29);
3713
+ const ci = await visitAsync_(i2, node.items[i2], visitor, path30);
3714
3714
  if (typeof ci === "number")
3715
3715
  i2 = ci - 1;
3716
3716
  else if (ci === BREAK)
@@ -3721,13 +3721,13 @@ var require_visit = __commonJS({
3721
3721
  }
3722
3722
  }
3723
3723
  } else if (identity2.isPair(node)) {
3724
- path29 = Object.freeze(path29.concat(node));
3725
- const ck = await visitAsync_("key", node.key, visitor, path29);
3724
+ path30 = Object.freeze(path30.concat(node));
3725
+ const ck = await visitAsync_("key", node.key, visitor, path30);
3726
3726
  if (ck === BREAK)
3727
3727
  return BREAK;
3728
3728
  else if (ck === REMOVE)
3729
3729
  node.key = null;
3730
- const cv = await visitAsync_("value", node.value, visitor, path29);
3730
+ const cv = await visitAsync_("value", node.value, visitor, path30);
3731
3731
  if (cv === BREAK)
3732
3732
  return BREAK;
3733
3733
  else if (cv === REMOVE)
@@ -3754,23 +3754,23 @@ var require_visit = __commonJS({
3754
3754
  }
3755
3755
  return visitor;
3756
3756
  }
3757
- function callVisitor(key, node, visitor, path29) {
3757
+ function callVisitor(key, node, visitor, path30) {
3758
3758
  if (typeof visitor === "function")
3759
- return visitor(key, node, path29);
3759
+ return visitor(key, node, path30);
3760
3760
  if (identity2.isMap(node))
3761
- return visitor.Map?.(key, node, path29);
3761
+ return visitor.Map?.(key, node, path30);
3762
3762
  if (identity2.isSeq(node))
3763
- return visitor.Seq?.(key, node, path29);
3763
+ return visitor.Seq?.(key, node, path30);
3764
3764
  if (identity2.isPair(node))
3765
- return visitor.Pair?.(key, node, path29);
3765
+ return visitor.Pair?.(key, node, path30);
3766
3766
  if (identity2.isScalar(node))
3767
- return visitor.Scalar?.(key, node, path29);
3767
+ return visitor.Scalar?.(key, node, path30);
3768
3768
  if (identity2.isAlias(node))
3769
- return visitor.Alias?.(key, node, path29);
3769
+ return visitor.Alias?.(key, node, path30);
3770
3770
  return void 0;
3771
3771
  }
3772
- function replaceNode(key, path29, node) {
3773
- const parent = path29[path29.length - 1];
3772
+ function replaceNode(key, path30, node) {
3773
+ const parent = path30[path30.length - 1];
3774
3774
  if (identity2.isCollection(parent)) {
3775
3775
  parent.items[key] = node;
3776
3776
  } else if (identity2.isPair(parent)) {
@@ -4382,10 +4382,10 @@ var require_Collection = __commonJS({
4382
4382
  var createNode = require_createNode();
4383
4383
  var identity2 = require_identity();
4384
4384
  var Node = require_Node();
4385
- function collectionFromPath(schema, path29, value) {
4385
+ function collectionFromPath(schema, path30, value) {
4386
4386
  let v = value;
4387
- for (let i2 = path29.length - 1; i2 >= 0; --i2) {
4388
- const k = path29[i2];
4387
+ for (let i2 = path30.length - 1; i2 >= 0; --i2) {
4388
+ const k = path30[i2];
4389
4389
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
4390
4390
  const a2 = [];
4391
4391
  a2[k] = v;
@@ -4404,7 +4404,7 @@ var require_Collection = __commonJS({
4404
4404
  sourceObjects: /* @__PURE__ */ new Map()
4405
4405
  });
4406
4406
  }
4407
- var isEmptyPath = (path29) => path29 == null || typeof path29 === "object" && !!path29[Symbol.iterator]().next().done;
4407
+ var isEmptyPath = (path30) => path30 == null || typeof path30 === "object" && !!path30[Symbol.iterator]().next().done;
4408
4408
  var Collection = class extends Node.NodeBase {
4409
4409
  constructor(type, schema) {
4410
4410
  super(type);
@@ -4434,11 +4434,11 @@ var require_Collection = __commonJS({
4434
4434
  * be a Pair instance or a `{ key, value }` object, which may not have a key
4435
4435
  * that already exists in the map.
4436
4436
  */
4437
- addIn(path29, value) {
4438
- if (isEmptyPath(path29))
4437
+ addIn(path30, value) {
4438
+ if (isEmptyPath(path30))
4439
4439
  this.add(value);
4440
4440
  else {
4441
- const [key, ...rest] = path29;
4441
+ const [key, ...rest] = path30;
4442
4442
  const node = this.get(key, true);
4443
4443
  if (identity2.isCollection(node))
4444
4444
  node.addIn(rest, value);
@@ -4452,8 +4452,8 @@ var require_Collection = __commonJS({
4452
4452
  * Removes a value from the collection.
4453
4453
  * @returns `true` if the item was found and removed.
4454
4454
  */
4455
- deleteIn(path29) {
4456
- const [key, ...rest] = path29;
4455
+ deleteIn(path30) {
4456
+ const [key, ...rest] = path30;
4457
4457
  if (rest.length === 0)
4458
4458
  return this.delete(key);
4459
4459
  const node = this.get(key, true);
@@ -4467,8 +4467,8 @@ var require_Collection = __commonJS({
4467
4467
  * scalar values from their surrounding node; to disable set `keepScalar` to
4468
4468
  * `true` (collections are always returned intact).
4469
4469
  */
4470
- getIn(path29, keepScalar) {
4471
- const [key, ...rest] = path29;
4470
+ getIn(path30, keepScalar) {
4471
+ const [key, ...rest] = path30;
4472
4472
  const node = this.get(key, true);
4473
4473
  if (rest.length === 0)
4474
4474
  return !keepScalar && identity2.isScalar(node) ? node.value : node;
@@ -4486,8 +4486,8 @@ var require_Collection = __commonJS({
4486
4486
  /**
4487
4487
  * Checks if the collection includes a value with the key `key`.
4488
4488
  */
4489
- hasIn(path29) {
4490
- const [key, ...rest] = path29;
4489
+ hasIn(path30) {
4490
+ const [key, ...rest] = path30;
4491
4491
  if (rest.length === 0)
4492
4492
  return this.has(key);
4493
4493
  const node = this.get(key, true);
@@ -4497,8 +4497,8 @@ var require_Collection = __commonJS({
4497
4497
  * Sets a value in this collection. For `!!set`, `value` needs to be a
4498
4498
  * boolean to add/remove the item from the set.
4499
4499
  */
4500
- setIn(path29, value) {
4501
- const [key, ...rest] = path29;
4500
+ setIn(path30, value) {
4501
+ const [key, ...rest] = path30;
4502
4502
  if (rest.length === 0) {
4503
4503
  this.set(key, value);
4504
4504
  } else {
@@ -7013,9 +7013,9 @@ var require_Document = __commonJS({
7013
7013
  this.contents.add(value);
7014
7014
  }
7015
7015
  /** Adds a value to the document. */
7016
- addIn(path29, value) {
7016
+ addIn(path30, value) {
7017
7017
  if (assertCollection(this.contents))
7018
- this.contents.addIn(path29, value);
7018
+ this.contents.addIn(path30, value);
7019
7019
  }
7020
7020
  /**
7021
7021
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -7090,14 +7090,14 @@ var require_Document = __commonJS({
7090
7090
  * Removes a value from the document.
7091
7091
  * @returns `true` if the item was found and removed.
7092
7092
  */
7093
- deleteIn(path29) {
7094
- if (Collection.isEmptyPath(path29)) {
7093
+ deleteIn(path30) {
7094
+ if (Collection.isEmptyPath(path30)) {
7095
7095
  if (this.contents == null)
7096
7096
  return false;
7097
7097
  this.contents = null;
7098
7098
  return true;
7099
7099
  }
7100
- return assertCollection(this.contents) ? this.contents.deleteIn(path29) : false;
7100
+ return assertCollection(this.contents) ? this.contents.deleteIn(path30) : false;
7101
7101
  }
7102
7102
  /**
7103
7103
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -7112,10 +7112,10 @@ var require_Document = __commonJS({
7112
7112
  * scalar values from their surrounding node; to disable set `keepScalar` to
7113
7113
  * `true` (collections are always returned intact).
7114
7114
  */
7115
- getIn(path29, keepScalar) {
7116
- if (Collection.isEmptyPath(path29))
7115
+ getIn(path30, keepScalar) {
7116
+ if (Collection.isEmptyPath(path30))
7117
7117
  return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
7118
- return identity2.isCollection(this.contents) ? this.contents.getIn(path29, keepScalar) : void 0;
7118
+ return identity2.isCollection(this.contents) ? this.contents.getIn(path30, keepScalar) : void 0;
7119
7119
  }
7120
7120
  /**
7121
7121
  * Checks if the document includes a value with the key `key`.
@@ -7126,10 +7126,10 @@ var require_Document = __commonJS({
7126
7126
  /**
7127
7127
  * Checks if the document includes a value at `path`.
7128
7128
  */
7129
- hasIn(path29) {
7130
- if (Collection.isEmptyPath(path29))
7129
+ hasIn(path30) {
7130
+ if (Collection.isEmptyPath(path30))
7131
7131
  return this.contents !== void 0;
7132
- return identity2.isCollection(this.contents) ? this.contents.hasIn(path29) : false;
7132
+ return identity2.isCollection(this.contents) ? this.contents.hasIn(path30) : false;
7133
7133
  }
7134
7134
  /**
7135
7135
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -7146,13 +7146,13 @@ var require_Document = __commonJS({
7146
7146
  * Sets a value in this document. For `!!set`, `value` needs to be a
7147
7147
  * boolean to add/remove the item from the set.
7148
7148
  */
7149
- setIn(path29, value) {
7150
- if (Collection.isEmptyPath(path29)) {
7149
+ setIn(path30, value) {
7150
+ if (Collection.isEmptyPath(path30)) {
7151
7151
  this.contents = value;
7152
7152
  } else if (this.contents == null) {
7153
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path29), value);
7153
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path30), value);
7154
7154
  } else if (assertCollection(this.contents)) {
7155
- this.contents.setIn(path29, value);
7155
+ this.contents.setIn(path30, value);
7156
7156
  }
7157
7157
  }
7158
7158
  /**
@@ -9113,9 +9113,9 @@ var require_cst_visit = __commonJS({
9113
9113
  visit2.BREAK = BREAK;
9114
9114
  visit2.SKIP = SKIP;
9115
9115
  visit2.REMOVE = REMOVE;
9116
- visit2.itemAtPath = (cst, path29) => {
9116
+ visit2.itemAtPath = (cst, path30) => {
9117
9117
  let item = cst;
9118
- for (const [field, index] of path29) {
9118
+ for (const [field, index] of path30) {
9119
9119
  const tok = item?.[field];
9120
9120
  if (tok && "items" in tok) {
9121
9121
  item = tok.items[index];
@@ -9124,23 +9124,23 @@ var require_cst_visit = __commonJS({
9124
9124
  }
9125
9125
  return item;
9126
9126
  };
9127
- visit2.parentCollection = (cst, path29) => {
9128
- const parent = visit2.itemAtPath(cst, path29.slice(0, -1));
9129
- const field = path29[path29.length - 1][0];
9127
+ visit2.parentCollection = (cst, path30) => {
9128
+ const parent = visit2.itemAtPath(cst, path30.slice(0, -1));
9129
+ const field = path30[path30.length - 1][0];
9130
9130
  const coll = parent?.[field];
9131
9131
  if (coll && "items" in coll)
9132
9132
  return coll;
9133
9133
  throw new Error("Parent collection not found");
9134
9134
  };
9135
- function _visit(path29, item, visitor) {
9136
- let ctrl = visitor(item, path29);
9135
+ function _visit(path30, item, visitor) {
9136
+ let ctrl = visitor(item, path30);
9137
9137
  if (typeof ctrl === "symbol")
9138
9138
  return ctrl;
9139
9139
  for (const field of ["key", "value"]) {
9140
9140
  const token = item[field];
9141
9141
  if (token && "items" in token) {
9142
9142
  for (let i2 = 0; i2 < token.items.length; ++i2) {
9143
- const ci = _visit(Object.freeze(path29.concat([[field, i2]])), token.items[i2], visitor);
9143
+ const ci = _visit(Object.freeze(path30.concat([[field, i2]])), token.items[i2], visitor);
9144
9144
  if (typeof ci === "number")
9145
9145
  i2 = ci - 1;
9146
9146
  else if (ci === BREAK)
@@ -9151,10 +9151,10 @@ var require_cst_visit = __commonJS({
9151
9151
  }
9152
9152
  }
9153
9153
  if (typeof ctrl === "function" && field === "key")
9154
- ctrl = ctrl(item, path29);
9154
+ ctrl = ctrl(item, path30);
9155
9155
  }
9156
9156
  }
9157
- return typeof ctrl === "function" ? ctrl(item, path29) : ctrl;
9157
+ return typeof ctrl === "function" ? ctrl(item, path30) : ctrl;
9158
9158
  }
9159
9159
  exports.visit = visit2;
9160
9160
  }
@@ -15012,7 +15012,7 @@ function appendRootPathToUrlIfNeeded(url) {
15012
15012
  return void 0;
15013
15013
  }
15014
15014
  }
15015
- function appendResourcePathToUrl(url, path29) {
15015
+ function appendResourcePathToUrl(url, path30) {
15016
15016
  try {
15017
15017
  new URL(url);
15018
15018
  } catch {
@@ -15022,11 +15022,11 @@ function appendResourcePathToUrl(url, path29) {
15022
15022
  if (!url.endsWith("/")) {
15023
15023
  url = url + "/";
15024
15024
  }
15025
- url += path29;
15025
+ url += path30;
15026
15026
  try {
15027
15027
  new URL(url);
15028
15028
  } catch {
15029
- diag2.warn(`Configuration: Provided URL appended with '${path29}' is not a valid URL, using 'undefined' instead of '${url}'`);
15029
+ diag2.warn(`Configuration: Provided URL appended with '${path30}' is not a valid URL, using 'undefined' instead of '${url}'`);
15030
15030
  return void 0;
15031
15031
  }
15032
15032
  return url;
@@ -15806,6 +15806,7 @@ var FAILURE_CODES = {
15806
15806
  INSTALL_MODE_FLAG_CONFLICT: "INSTALL_MODE_FLAG_CONFLICT",
15807
15807
  INSTALL_FROM_TAR_PACKAGE_FAILED: "INSTALL_FROM_TAR_PACKAGE_FAILED",
15808
15808
  INSTALL_INIT_TRIGGERED_UPDATE_FAILED: "INSTALL_INIT_TRIGGERED_UPDATE_FAILED",
15809
+ INSTALL_SKILLS_FAILED: "INSTALL_SKILLS_FAILED",
15809
15810
  INSTALL_SKILLS_REFRESH_FAILED: "INSTALL_SKILLS_REFRESH_FAILED",
15810
15811
  INSTALL_UNCLASSIFIED_FAILED: "INSTALL_UNCLASSIFIED_FAILED",
15811
15812
  UPDATE_INSTALLED_VERSION_DETECT_FAILED: "UPDATE_INSTALLED_VERSION_DETECT_FAILED",
@@ -16348,6 +16349,9 @@ var ALLOWED = {
16348
16349
  warned_count: COUNT
16349
16350
  },
16350
16351
  "installation:skill_install": {
16352
+ source: oneOf(["pinned", "bundled"]),
16353
+ used_fallback: bool,
16354
+ fallback_reason: oneOf(["ref_missing", "unclassified"]),
16351
16355
  method: oneOf(["default", "interactive", "manual"]),
16352
16356
  is_online: bool,
16353
16357
  has_offline_cache: bool,
@@ -16525,9 +16529,9 @@ function isReplitAgent(env) {
16525
16529
  }
16526
16530
  var DEVIN_MARKER_PATH = "/opt/.devin";
16527
16531
  var JULES_MARKER_PATH = "/opt/environment_summary.sh";
16528
- function safeExists(fileExists, path29) {
16532
+ function safeExists(fileExists, path30) {
16529
16533
  try {
16530
- return fileExists(path29);
16534
+ return fileExists(path30);
16531
16535
  } catch {
16532
16536
  return false;
16533
16537
  }
@@ -16948,7 +16952,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16948
16952
  var SESSION_ID = randomUUID4();
16949
16953
  function readCliVersion() {
16950
16954
  if (true) {
16951
- return "0.32.1-next.10";
16955
+ return "0.32.1-next.12";
16952
16956
  }
16953
16957
  return "0.0.0";
16954
16958
  }
@@ -19345,12 +19349,12 @@ function parseTree(text2, errors = [], options = ParseOptions.DEFAULT) {
19345
19349
  }
19346
19350
  return result;
19347
19351
  }
19348
- function findNodeAtLocation(root, path29) {
19352
+ function findNodeAtLocation(root, path30) {
19349
19353
  if (!root) {
19350
19354
  return void 0;
19351
19355
  }
19352
19356
  let node = root;
19353
- for (let segment of path29) {
19357
+ for (let segment of path30) {
19354
19358
  if (typeof segment === "string") {
19355
19359
  if (node.type !== "object" || !Array.isArray(node.children)) {
19356
19360
  return void 0;
@@ -19704,14 +19708,14 @@ function getNodeType(value) {
19704
19708
 
19705
19709
  // ../../node_modules/jsonc-parser/lib/esm/impl/edit.js
19706
19710
  function setProperty(text2, originalPath, value, options) {
19707
- const path29 = originalPath.slice();
19711
+ const path30 = originalPath.slice();
19708
19712
  const errors = [];
19709
19713
  const root = parseTree(text2, errors);
19710
19714
  let parent = void 0;
19711
19715
  let lastSegment = void 0;
19712
- while (path29.length > 0) {
19713
- lastSegment = path29.pop();
19714
- parent = findNodeAtLocation(root, path29);
19716
+ while (path30.length > 0) {
19717
+ lastSegment = path30.pop();
19718
+ parent = findNodeAtLocation(root, path30);
19715
19719
  if (parent === void 0 && value !== void 0) {
19716
19720
  if (typeof lastSegment === "string") {
19717
19721
  value = { [lastSegment]: value };
@@ -19897,8 +19901,8 @@ var ParseErrorCode;
19897
19901
  ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
19898
19902
  ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
19899
19903
  })(ParseErrorCode || (ParseErrorCode = {}));
19900
- function modify(text2, path29, value, options) {
19901
- return setProperty(text2, path29, value, options);
19904
+ function modify(text2, path30, value, options) {
19905
+ return setProperty(text2, path30, value, options);
19902
19906
  }
19903
19907
  function applyEdits(text2, edits) {
19904
19908
  let sortedEdits = edits.slice(0).sort((a2, b) => {
@@ -22329,6 +22333,12 @@ var INSTALL_INIT_TRIGGERED_UPDATE_FAILED = {
22329
22333
  failure_area: "installer",
22330
22334
  error_kind: "subprocess"
22331
22335
  };
22336
+ var INSTALL_SKILLS_FAILED = {
22337
+ error_code: FAILURE_CODES.INSTALL_SKILLS_FAILED,
22338
+ failure_stage: "installer_skills_install",
22339
+ failure_area: "installer",
22340
+ error_kind: "subprocess"
22341
+ };
22332
22342
  var INSTALL_UNCLASSIFIED_FAILED = {
22333
22343
  error_code: FAILURE_CODES.INSTALL_UNCLASSIFIED_FAILED,
22334
22344
  failure_stage: "installer_init_unclassified",
@@ -22522,6 +22532,30 @@ function refreshArgentSkills(projectRoot) {
22522
22532
  }
22523
22533
  return results;
22524
22534
  }
22535
+ function snapshotArgentSkills(projectRoot, scope, names) {
22536
+ const { skillTargets } = getManagedContentTargets(
22537
+ ALL_ADAPTERS,
22538
+ projectRoot,
22539
+ scope === "global" ? "global" : "local"
22540
+ );
22541
+ const found = /* @__PURE__ */ new Map();
22542
+ for (const { targetPath } of skillTargets) {
22543
+ let candidates = names;
22544
+ if (names.length === 0) {
22545
+ try {
22546
+ candidates = fs19.readdirSync(targetPath).filter((n3) => n3.startsWith(ARGENT_SKILL_PREFIX));
22547
+ } catch {
22548
+ continue;
22549
+ }
22550
+ }
22551
+ for (const name of candidates) {
22552
+ const stat6 = fs19.statSync(path21.join(targetPath, name, "SKILL.md"), { throwIfNoEntry: false });
22553
+ if (!stat6?.isFile()) continue;
22554
+ found.set(name, `${found.get(name) ?? ""}${stat6.ino}:${stat6.mtimeMs};`);
22555
+ }
22556
+ }
22557
+ return found;
22558
+ }
22525
22559
  function pruneLegacySkillDirs(projectRoot, scope, bundled = new Set(listBundledSkills())) {
22526
22560
  if (bundled.size === 0) return [];
22527
22561
  const legacy = LEGACY_ARGENT_SKILL_NAMES.filter((name) => !bundled.has(name));
@@ -23267,6 +23301,67 @@ async function configureAllowlist(args) {
23267
23301
  var import_picocolors10 = __toESM(require_picocolors(), 1);
23268
23302
  import { spawn as spawn3 } from "node:child_process";
23269
23303
  import * as os3 from "node:os";
23304
+ import * as path22 from "node:path";
23305
+ var REF_MISSING = /Remote branch .* not found in upstream|couldn't find remote ref|unknown revision/i;
23306
+ function meaningfulLine(err) {
23307
+ const lines = (err instanceof Error ? err.message : String(err)).split("\n").map((l2) => l2.replace(/^[│┌└■◇\s]+/, "").trim()).filter((l2) => l2 && !/^npm (warn|notice)/i.test(l2));
23308
+ return lines.find((l2) => l2.startsWith("fatal:")) ?? lines.find((l2) => /Error:|Failed to|not found|Could not/i.test(l2)) ?? lines[0] ?? "unknown error";
23309
+ }
23310
+ function bundledCopyFor(version) {
23311
+ const local = probeLocalInstall(resolveProjectRoot2(process.cwd()));
23312
+ if (local.packageDir && local.version === version) return path22.join(local.packageDir, "skills");
23313
+ const globalRoot = getGloballyInstalledPackageRoot();
23314
+ if (globalRoot && getGloballyInstalledVersion() === version) {
23315
+ return path22.join(globalRoot, "skills");
23316
+ }
23317
+ return SKILLS_DIR;
23318
+ }
23319
+ function printManualInstructions(source, bundledCopy, scope, customRoot, npxMissing = false) {
23320
+ const root = scope === "global" ? "~" : scope === "custom" ? customRoot : ".";
23321
+ const add = `skills add ${source}${scope === "global" ? " -g" : ""} --skill '*' -y`;
23322
+ const cd = scope === "custom" ? `cd ${customRoot} && ` : "";
23323
+ note(
23324
+ [
23325
+ `Skills are bundled at:`,
23326
+ ` ${import_picocolors10.default.cyan(bundledCopy)}`,
23327
+ ``,
23328
+ `To install manually, copy them to your editor's skills directory:`,
23329
+ ``,
23330
+ ` ${import_picocolors10.default.dim("# Claude Code")}`,
23331
+ ` mkdir -p ${root}/.claude/skills && cp -r ${bundledCopy}/* ${root}/.claude/skills/`,
23332
+ ``,
23333
+ ` ${import_picocolors10.default.dim("# Cursor")}`,
23334
+ ` mkdir -p ${root}/.cursor/skills && cp -r ${bundledCopy}/* ${root}/.cursor/skills/`,
23335
+ ``,
23336
+ ...npxMissing ? [` ${import_picocolors10.default.dim("# Or, with pnpm:")}`, ` ${cd}pnpm dlx ${add}`] : [` ${import_picocolors10.default.dim("# Or use npx skills directly:")}`, ` ${cd}npx ${add}`]
23337
+ ].join("\n"),
23338
+ "Manual Skills Installation"
23339
+ );
23340
+ }
23341
+ function skillsAreMissing(skills) {
23342
+ return skills.outcome === "failure" && skills.installedCount === 0;
23343
+ }
23344
+ function formatSkillsSummaryLine(skills) {
23345
+ const count = skills.installedCount;
23346
+ const label = import_picocolors10.default.yellow("Skills");
23347
+ if (skills.outcome === "failure" || skills.forcedManual) {
23348
+ const why = skills.forcedManual ? "offline, see the instructions above" : "see the error above";
23349
+ return count > 0 ? `${label} not updated (${why}), ${count} from an earlier install on disk` : `${label} NOT installed (${why})`;
23350
+ }
23351
+ if (skills.method === "manual") {
23352
+ const existing = count > 0 ? `, ${count} from an earlier install on disk` : "";
23353
+ return `${import_picocolors10.default.green("Skills")} instructions printed${existing}`;
23354
+ }
23355
+ if (skills.outcome === "skipped") {
23356
+ const existing = count > 0 ? `, ${count} from an earlier install on disk` : "";
23357
+ return `${label} none installed (none selected)${existing}`;
23358
+ }
23359
+ const written = skills.installedThisRun;
23360
+ if (skills.usedFallback) {
23361
+ return `${label} ${written} installed from the bundled copy (the pinned source failed)`;
23362
+ }
23363
+ return `${import_picocolors10.default.green("Skills")} ${written} installed`;
23364
+ }
23270
23365
  async function runSkillsStep(args) {
23271
23366
  const { nonInteractive, fromTar, version, scope, customRoot } = args;
23272
23367
  log.step(import_picocolors10.default.bold("Step 2: Skills Installation"));
@@ -23311,93 +23406,120 @@ async function runSkillsStep(args) {
23311
23406
  }
23312
23407
  const useGitHubSource = online && !fromTar && version !== "unknown";
23313
23408
  const skillsSource = useGitHubSource ? buildArgentSkillsSource(version) : SKILLS_DIR;
23409
+ const bundledCopy = useGitHubSource ? bundledCopyFor(version) : SKILLS_DIR;
23410
+ const skillsCwd = scope === "custom" ? customRoot : void 0;
23411
+ const skillsRoot = scope === "global" ? os3.homedir() : skillsCwd ?? process.cwd();
23412
+ const skillsScope = scope === "global" ? "global" : "project";
23413
+ const expected = listBundledSkills(bundledCopy);
23414
+ const snapshot = () => snapshotArgentSkills(skillsRoot, skillsScope, expected);
23415
+ const writtenSince = (before) => [...snapshot()].filter(([name, stamp]) => before.get(name) !== stamp).length;
23416
+ const initial = snapshot();
23314
23417
  let skillOutcome;
23418
+ let installedFrom = skillsSource;
23419
+ let fallbackReason = null;
23315
23420
  if (skillsMethod === "manual") {
23316
- note(
23317
- [
23318
- `Skills are bundled at:`,
23319
- ` ${import_picocolors10.default.cyan(SKILLS_DIR)}`,
23320
- ``,
23321
- `To install manually, copy them to your editor's skills directory:`,
23322
- ``,
23323
- ` ${import_picocolors10.default.dim("# Claude Code")}`,
23324
- ` cp -r ${SKILLS_DIR}/* ${scope === "global" ? "~/.claude/skills/" : `${scope === "custom" ? customRoot : "."}/.claude/skills/`}`,
23325
- ``,
23326
- ` ${import_picocolors10.default.dim("# Cursor")}`,
23327
- ` cp -r ${SKILLS_DIR}/* ${scope === "global" ? "~/.cursor/skills/" : `${scope === "custom" ? customRoot : "."}/.cursor/skills/`}`,
23328
- ``,
23329
- ` ${import_picocolors10.default.dim("# Or use npx skills directly:")}`,
23330
- ` npx skills add ${skillsSource}`
23331
- ].join("\n"),
23332
- "Manual Skills Installation"
23333
- );
23421
+ printManualInstructions(skillsSource, bundledCopy, scope, customRoot);
23334
23422
  skillOutcome = "skipped";
23335
23423
  } else {
23336
- const skillsArgs = ["skills", "add", skillsSource];
23337
- if (scope === "global") {
23338
- skillsArgs.push("-g");
23339
- }
23340
- if (skillsMethod === "default") {
23341
- skillsArgs.push("--skill", "*", "-y");
23342
- }
23343
- const baseArgs = offlineWithCache ? ["--no-install", ...skillsArgs] : skillsArgs;
23344
- const npxArgs = withNpmForce(baseArgs);
23345
- log.info(`Running: ${import_picocolors10.default.dim("npx")} ${import_picocolors10.default.cyan(baseArgs.join(" "))}`);
23424
+ const interactive = skillsMethod === "interactive";
23425
+ const buildSkillsArgs = (source2) => {
23426
+ const skillsArgs = ["skills", "add", source2];
23427
+ if (scope === "global") skillsArgs.push("-g");
23428
+ if (!interactive) skillsArgs.push("--skill", "*", "-y");
23429
+ return offlineWithCache ? ["--no-install", ...skillsArgs] : skillsArgs;
23430
+ };
23431
+ log.info(`Running: ${import_picocolors10.default.dim("npx")} ${import_picocolors10.default.cyan(buildSkillsArgs(skillsSource).join(" "))}`);
23346
23432
  const spinner2 = spinner();
23347
- if (skillsMethod === "default") {
23348
- spinner2.start("Installing skills...");
23349
- }
23433
+ if (!interactive) spinner2.start("Installing skills...");
23434
+ const attempt = async (source2, npmFlags = []) => {
23435
+ const before = snapshot();
23436
+ const npxArgs = withNpmForce([...npmFlags, ...buildSkillsArgs(source2)]);
23437
+ await runNpxSkills(npxArgs, interactive, skillsCwd);
23438
+ if (writtenSince(before) > 0) return "success";
23439
+ if (interactive) return "skipped";
23440
+ throw new Error("The skills CLI exited cleanly, but it installed no skills.");
23441
+ };
23442
+ const fail = (err, attempted, npxMissing = false) => {
23443
+ if (!interactive) spinner2.stop(import_picocolors10.default.red("Skills installation failed."));
23444
+ log.error(`Failed to install skills from ${attempted}: ${meaningfulLine(err)}`);
23445
+ printManualInstructions(bundledCopy, bundledCopy, scope, customRoot, npxMissing);
23446
+ return "failure";
23447
+ };
23350
23448
  try {
23351
- const skillsCwd = scope === "custom" ? customRoot : void 0;
23352
- await runNpxSkills(npxArgs, skillsMethod === "interactive", skillsCwd);
23353
- if (skillsMethod === "default") {
23354
- spinner2.stop("Skills installed.");
23355
- }
23356
- skillOutcome = "success";
23357
- const sourceIsBundled = skillsSource === SKILLS_DIR || version === getInstalledVersion();
23358
- if (skillsMethod === "default" && sourceIsBundled) {
23359
- const pruneRoot = scope === "global" ? os3.homedir() : skillsCwd ?? process.cwd();
23360
- const pruneScope = scope === "global" ? "global" : "project";
23361
- const tracked = listTrackedLegacySkills(pruneRoot, pruneScope);
23362
- const removed = /* @__PURE__ */ new Set();
23363
- if (tracked.length > 0) {
23364
- const removeArgs = ["skills", "remove", "-y", ...scope === "global" ? ["-g"] : []];
23449
+ skillOutcome = await attempt(skillsSource);
23450
+ if (!interactive) spinner2.stop("Skills installed.");
23451
+ } catch (err) {
23452
+ const npxMissing = err.code === "ENOENT";
23453
+ const interrupted = err instanceof ShellCommandError && err.signal !== null;
23454
+ const canRetry = skillsSource !== bundledCopy && !npxMissing && !interrupted && listBundledSkills(bundledCopy).length > 0;
23455
+ if (!canRetry) {
23456
+ skillOutcome = fail(err, skillsSource, npxMissing);
23457
+ } else {
23458
+ if (!interactive) spinner2.stop(import_picocolors10.default.yellow("Pinned skills source failed."));
23459
+ log.warn(`Could not install skills from ${skillsSource}: ${meaningfulLine(err)}`);
23460
+ fallbackReason = REF_MISSING.test(String(err)) ? "ref_missing" : "unclassified";
23461
+ const retry = interactive ? await confirm({ message: "Install from the copy bundled with this package instead?" }) : true;
23462
+ if (retry !== true) {
23463
+ skillOutcome = fail(err, skillsSource);
23464
+ } else {
23465
+ if (!interactive) spinner2.start("Installing the copy bundled with this package...");
23365
23466
  try {
23366
- await runNpxSkills(
23367
- withNpmForce([
23368
- ...offlineWithCache ? ["--no-install"] : [],
23369
- ...removeArgs,
23370
- ...tracked
23371
- ]),
23372
- false,
23373
- skillsCwd
23374
- );
23375
- for (const name of tracked) removed.add(name);
23376
- } catch {
23467
+ skillOutcome = await attempt(bundledCopy, ["--fetch-retries=0"]);
23468
+ if (!interactive) spinner2.stop("Skills installed from the bundled copy.");
23469
+ installedFrom = bundledCopy;
23470
+ } catch (fallbackErr) {
23471
+ skillOutcome = fail(fallbackErr, bundledCopy);
23377
23472
  }
23378
23473
  }
23379
- for (const name of pruneLegacySkillDirs(pruneRoot, pruneScope)) removed.add(name);
23380
- if (removed.size > 0) {
23381
- log.info(import_picocolors10.default.dim(`Removed legacy skills: ${[...removed].sort().join(", ")}`));
23474
+ }
23475
+ }
23476
+ if (!interactive && skillOutcome === "success" && (installedFrom === SKILLS_DIR || version === getInstalledVersion())) {
23477
+ const tracked = listTrackedLegacySkills(skillsRoot, skillsScope);
23478
+ const removed = /* @__PURE__ */ new Set();
23479
+ if (tracked.length > 0) {
23480
+ const removeArgs = ["skills", "remove", "-y", ...scope === "global" ? ["-g"] : []];
23481
+ try {
23482
+ await runNpxSkills(
23483
+ withNpmForce([
23484
+ ...offlineWithCache ? ["--no-install"] : [],
23485
+ ...removeArgs,
23486
+ ...tracked
23487
+ ]),
23488
+ false,
23489
+ skillsCwd
23490
+ );
23491
+ for (const name of tracked) removed.add(name);
23492
+ } catch {
23382
23493
  }
23383
23494
  }
23384
- } catch (err) {
23385
- if (skillsMethod === "default") {
23386
- spinner2.stop(import_picocolors10.default.red("Skills installation failed."));
23495
+ for (const name of pruneLegacySkillDirs(skillsRoot, skillsScope)) removed.add(name);
23496
+ if (removed.size > 0) {
23497
+ log.info(import_picocolors10.default.dim(`Removed legacy skills: ${[...removed].sort().join(", ")}`));
23387
23498
  }
23388
- log.error(`Failed to run npx skills: ${err}`);
23389
- log.info(`You can install skills manually:
23390
- npx ${skillsArgs.join(" ")}`);
23391
- skillOutcome = "failure";
23392
23499
  }
23393
23500
  }
23501
+ const usedFallback = fallbackReason !== null && skillOutcome === "success";
23502
+ const source = skillOutcome !== "success" ? null : useGitHubSource && installedFrom === skillsSource ? "pinned" : "bundled";
23394
23503
  track("installation:skill_install", {
23395
23504
  method: skillsMethod,
23396
23505
  is_online: online,
23397
23506
  has_offline_cache: offlineWithCache,
23398
- outcome: skillOutcome
23507
+ outcome: skillOutcome,
23508
+ // A release whose tag was never pushed makes every install fall back. That
23509
+ // is invisible once the fallback rescues it, so it has to be measurable.
23510
+ ...source ? { source } : {},
23511
+ used_fallback: usedFallback,
23512
+ ...fallbackReason ? { fallback_reason: fallbackReason } : {}
23399
23513
  });
23400
- return skillsMethod;
23514
+ return {
23515
+ method: skillsMethod,
23516
+ outcome: skillOutcome,
23517
+ source,
23518
+ usedFallback,
23519
+ installedCount: snapshot().size,
23520
+ installedThisRun: writtenSince(initial),
23521
+ forcedManual: !skillsCliReady
23522
+ };
23401
23523
  }
23402
23524
  function runNpxSkills(args, interactive, cwd) {
23403
23525
  return new Promise((resolve17, reject) => {
@@ -23418,12 +23540,14 @@ function runNpxSkills(args, interactive, cwd) {
23418
23540
  stderr += chunk.toString();
23419
23541
  });
23420
23542
  }
23421
- child.on("close", (code) => {
23543
+ child.on("close", (code, signal) => {
23422
23544
  if (code === 0) {
23423
23545
  resolve17();
23424
23546
  } else {
23425
23547
  const output = [stderr, stdout2].filter(Boolean).join("\n").trim();
23426
- reject(new Error(output || `npx skills exited with code ${code}`));
23548
+ reject(
23549
+ new ShellCommandError(output || `npx skills exited with code ${code}`, code, signal)
23550
+ );
23427
23551
  }
23428
23552
  });
23429
23553
  child.on("error", reject);
@@ -23588,7 +23712,7 @@ async function init2(args) {
23588
23712
  if (allowlist.enabled && allowlist.lines.length > 0) {
23589
23713
  note(allowlist.lines.join("\n"), "Tool Auto-Approval");
23590
23714
  }
23591
- const skillsMethod = await runSkillsStep({
23715
+ const skills = await runSkillsStep({
23592
23716
  nonInteractive: parsed.nonInteractive,
23593
23717
  fromTar: parsed.fromTar,
23594
23718
  version,
@@ -23622,25 +23746,40 @@ async function init2(args) {
23622
23746
  selectedAdapters: writtenAdapters,
23623
23747
  scope,
23624
23748
  allowlistEnabled: allowlist.enabled,
23625
- skillsMethod,
23749
+ skills,
23626
23750
  copiedRules: copyResults.length > 0,
23627
23751
  wroteProjectTelemetryOptOut
23628
23752
  });
23629
- note(
23630
- [
23631
- import_picocolors11.default.bold(import_picocolors11.default.green("Argent is ready!")),
23632
- "",
23633
- `${import_picocolors11.default.bold("Get started")} by asking your assistant:`,
23634
- "",
23635
- ` ${import_picocolors11.default.bold(import_picocolors11.default.cyan(`"What can Argent do?"`))}`,
23636
- "",
23637
- import_picocolors11.default.dim("It will walk you through all capabilities available.")
23638
- ].join("\n"),
23639
- import_picocolors11.default.bgGreen(import_picocolors11.default.black(" Get Started "))
23640
- );
23641
- outro("Done.");
23642
- tel.initSucceeded = true;
23753
+ const skillsMissing = skillsAreMissing(skills);
23754
+ if (skills.outcome === "success" || skills.method === "manual" && !skills.forcedManual) {
23755
+ note(
23756
+ [
23757
+ import_picocolors11.default.bold(import_picocolors11.default.green("Argent is ready!")),
23758
+ "",
23759
+ `${import_picocolors11.default.bold("Get started")} by asking your assistant:`,
23760
+ "",
23761
+ ` ${import_picocolors11.default.bold(import_picocolors11.default.cyan(`"What can Argent do?"`))}`,
23762
+ "",
23763
+ import_picocolors11.default.dim("It will walk you through all capabilities available.")
23764
+ ].join("\n"),
23765
+ import_picocolors11.default.bgGreen(import_picocolors11.default.black(" Get Started "))
23766
+ );
23767
+ } else if (skills.installedCount > 0) {
23768
+ log.warn(
23769
+ `${import_picocolors11.default.bold("Skills were not updated:")} ${skills.installedCount} skills from an earlier install stay in use. Run ${import_picocolors11.default.cyan("argent init")} again to update them.`
23770
+ );
23771
+ } else {
23772
+ log.warn(
23773
+ `${import_picocolors11.default.bold("Argent is not ready:")} the MCP server and rules are in place, but no skills are installed. Run ${import_picocolors11.default.cyan("argent init")} again to install them.`
23774
+ );
23775
+ }
23776
+ outro(skillsMissing ? "Done, without skills." : "Done.");
23777
+ tel.initSucceeded = !skillsMissing;
23643
23778
  if ("commit" in consent) consent.commit();
23779
+ if (skillsMissing) {
23780
+ await tel.finalize(INSTALL_SKILLS_FAILED);
23781
+ process.exit(1);
23782
+ }
23644
23783
  await tel.finalize();
23645
23784
  } catch (err) {
23646
23785
  if (err instanceof InitCancelled) {
@@ -23661,7 +23800,7 @@ function printSummary({
23661
23800
  selectedAdapters,
23662
23801
  scope,
23663
23802
  allowlistEnabled,
23664
- skillsMethod,
23803
+ skills,
23665
23804
  copiedRules,
23666
23805
  wroteProjectTelemetryOptOut
23667
23806
  }) {
@@ -23669,7 +23808,7 @@ function printSummary({
23669
23808
  `${import_picocolors11.default.green("Install mode")} ${installMode === "local" ? "local (devDependency)" : "global"}`,
23670
23809
  selectedAdapters.length > 0 ? `${import_picocolors11.default.green("MCP server")} configured for ${selectedAdapters.map((a2) => a2.name).join(", ")} (${scope})` : `${import_picocolors11.default.yellow("MCP server")} NOT configured \u2014 no editor config was written`,
23671
23810
  `${import_picocolors11.default.green("Auto-approve")} ${allowlistEnabled ? "enabled" : "skipped"}`,
23672
- `${import_picocolors11.default.green("Skills")} ${skillsMethod === "manual" ? "instructions printed" : "installed"}`,
23811
+ formatSkillsSummaryLine(skills),
23673
23812
  `${import_picocolors11.default.green("Rules")} ${copiedRules ? "copied" : "n/a"}`
23674
23813
  ];
23675
23814
  note(summaryLines.join("\n"), "Summary");
@@ -23714,7 +23853,7 @@ function printBanner() {
23714
23853
  // ../argent-installer/src/update.ts
23715
23854
  var import_picocolors12 = __toESM(require_picocolors(), 1);
23716
23855
  var import_semver5 = __toESM(require_semver2(), 1);
23717
- import * as path27 from "node:path";
23856
+ import * as path28 from "node:path";
23718
23857
 
23719
23858
  // ../argent-installer/src/install-targets.ts
23720
23859
  function parseTargetFlags(args) {
@@ -23780,16 +23919,16 @@ async function resolveInstallableUpdateTarget(pm, current) {
23780
23919
  // ../argent-tools-client/src/launcher.ts
23781
23920
  import * as net from "node:net";
23782
23921
  import * as fs20 from "node:fs";
23783
- import * as path22 from "node:path";
23922
+ import * as path23 from "node:path";
23784
23923
  import * as readline from "node:readline";
23785
23924
  import { homedir as homedir6 } from "node:os";
23786
23925
  import { spawn as spawn4, execFileSync as execFileSync7 } from "node:child_process";
23787
23926
  import { createHash as createHash3, randomBytes } from "node:crypto";
23788
23927
  import { mkdir, writeFile, readFile, readdir as readdir2, unlink, rename, chmod } from "node:fs/promises";
23789
- var STATE_DIR = path22.join(homedir6(), ".argent");
23790
- var STATE_FILE = path22.join(STATE_DIR, "tool-server.json");
23791
- var LOG_FILE = path22.join(STATE_DIR, "tool-server.log");
23792
- var LOCK_FILE = path22.join(STATE_DIR, "tool-server.lock");
23928
+ var STATE_DIR = path23.join(homedir6(), ".argent");
23929
+ var STATE_FILE = path23.join(STATE_DIR, "tool-server.json");
23930
+ var LOG_FILE = path23.join(STATE_DIR, "tool-server.log");
23931
+ var LOCK_FILE = path23.join(STATE_DIR, "tool-server.lock");
23793
23932
  function isProcessAlive(pid) {
23794
23933
  try {
23795
23934
  process.kill(pid, 0);
@@ -23800,7 +23939,7 @@ function isProcessAlive(pid) {
23800
23939
  }
23801
23940
  function stateFileForBundle(bundlePath) {
23802
23941
  const key = createHash3("sha256").update(bundlePath).digest("hex").slice(0, 12);
23803
- return path22.join(STATE_DIR, `tool-server-${key}.json`);
23942
+ return path23.join(STATE_DIR, `tool-server-${key}.json`);
23804
23943
  }
23805
23944
  async function readStateFile(file) {
23806
23945
  try {
@@ -23842,7 +23981,7 @@ async function readAllToolsServerStates() {
23842
23981
  const out = [];
23843
23982
  for (const name of names) {
23844
23983
  if (!STATE_FILE_RE.test(name)) continue;
23845
- const file = path22.join(STATE_DIR, name);
23984
+ const file = path23.join(STATE_DIR, name);
23846
23985
  const state2 = await readStateFile(file);
23847
23986
  if (state2) out.push({ file, state: state2 });
23848
23987
  }
@@ -23888,8 +24027,8 @@ async function killToolServer(bundlePath) {
23888
24027
  return alive;
23889
24028
  }
23890
24029
  function isPathWithin(child, parent) {
23891
- const rel = path22.relative(parent, child);
23892
- return rel !== "" && !rel.startsWith("..") && !path22.isAbsolute(rel);
24030
+ const rel = path23.relative(parent, child);
24031
+ return rel !== "" && !rel.startsWith("..") && !path23.isAbsolute(rel);
23893
24032
  }
23894
24033
  function tryRealpath(p) {
23895
24034
  try {
@@ -23899,10 +24038,10 @@ function tryRealpath(p) {
23899
24038
  }
23900
24039
  }
23901
24040
  async function killToolServerForInstallDir(packageDir) {
23902
- const parents = /* @__PURE__ */ new Set([path22.resolve(packageDir), tryRealpath(packageDir)]);
24041
+ const parents = /* @__PURE__ */ new Set([path23.resolve(packageDir), tryRealpath(packageDir)]);
23903
24042
  let killed = 0;
23904
24043
  for (const { file, state: state2 } of await readAllToolsServerStates()) {
23905
- const bundles = /* @__PURE__ */ new Set([path22.resolve(state2.bundlePath), tryRealpath(state2.bundlePath)]);
24044
+ const bundles = /* @__PURE__ */ new Set([path23.resolve(state2.bundlePath), tryRealpath(state2.bundlePath)]);
23906
24045
  const matches2 = [...bundles].some((b) => [...parents].some((p) => isPathWithin(b, p)));
23907
24046
  if (!matches2) continue;
23908
24047
  const fresh = await readStateFile(file);
@@ -23967,14 +24106,14 @@ function couldBeOurToolServer(pid, marker) {
23967
24106
  var import_yaml4 = __toESM(require_dist2(), 1);
23968
24107
  import { readFile as readFile5 } from "node:fs/promises";
23969
24108
  import { maxHeaderSize } from "node:http";
23970
- import * as path26 from "node:path";
24109
+ import * as path27 from "node:path";
23971
24110
 
23972
24111
  // ../argent-tools-client/src/link-config.ts
23973
- import * as path23 from "node:path";
24112
+ import * as path24 from "node:path";
23974
24113
  import { homedir as homedir7 } from "node:os";
23975
24114
  import { mkdir as mkdir2, writeFile as writeFile2, readFile as readFile2, unlink as unlink2, chmod as chmod2 } from "node:fs/promises";
23976
- var LINK_DIR = path23.join(homedir7(), ".argent");
23977
- var LINK_FILE = path23.join(LINK_DIR, "link.json");
24115
+ var LINK_DIR = path24.join(homedir7(), ".argent");
24116
+ var LINK_FILE = path24.join(LINK_DIR, "link.json");
23978
24117
 
23979
24118
  // ../argent-tools-client/src/file-inputs.ts
23980
24119
  import { createHash as createHash4, randomUUID as randomUUID6 } from "node:crypto";
@@ -23991,12 +24130,12 @@ import {
23991
24130
  writeFile as writeFile3
23992
24131
  } from "node:fs/promises";
23993
24132
  import { constants, tmpdir } from "node:os";
23994
- import * as path24 from "node:path";
24133
+ import * as path25 from "node:path";
23995
24134
 
23996
24135
  // ../archive/src/index.ts
23997
24136
  import { execFile } from "node:child_process";
23998
24137
  import { rm, readdir as readdir3 } from "node:fs/promises";
23999
- import { basename as basename4, dirname as dirname13, join as join23, posix as posix2, resolve as resolve13, sep as sep4 } from "node:path";
24138
+ import { basename as basename4, dirname as dirname13, join as join24, posix as posix2, resolve as resolve13, sep as sep4 } from "node:path";
24000
24139
  import { promisify } from "node:util";
24001
24140
  var execFileAsync = promisify(execFile);
24002
24141
 
@@ -24006,14 +24145,14 @@ var MAX_CONTENT_BYTES = 32 * 1024 * 1024;
24006
24145
  // ../argent-tools-client/src/flow-files.ts
24007
24146
  var import_yaml3 = __toESM(require_dist2(), 1);
24008
24147
  import { readdir as readdir4, readFile as readFile4, realpath as realpath3, stat as stat4 } from "node:fs/promises";
24009
- import * as path25 from "node:path";
24148
+ import * as path26 from "node:path";
24010
24149
  var INLINE_MEMBERS_BYTES = 256 * 1024;
24011
24150
 
24012
24151
  // ../argent-tools-client/src/artifacts.ts
24013
24152
  import { copyFile, mkdir as mkdir4, readFile as readFile6, realpath as realpath4, rm as rm3, stat as stat5, writeFile as writeFile4 } from "node:fs/promises";
24014
24153
  import { constants as fsConstants } from "node:fs";
24015
24154
  import { tmpdir as tmpdir2 } from "node:os";
24016
- import { basename as basename7, dirname as dirname17, extname as extname2, isAbsolute as isAbsolute8, join as join27, normalize as normalize2, resolve as resolve15, sep as sep6 } from "node:path";
24155
+ import { basename as basename7, dirname as dirname17, extname as extname2, isAbsolute as isAbsolute8, join as join28, normalize as normalize2, resolve as resolve15, sep as sep6 } from "node:path";
24017
24156
  import { createHash as createHash5 } from "node:crypto";
24018
24157
  var ALLOWED_SAVE_DIRS = /* @__PURE__ */ new Set([normalize2(".argent/recordings")]);
24019
24158
  var RECORDINGS_SAVE_DIR = normalize2(".argent/recordings");
@@ -24372,7 +24511,7 @@ async function update(args) {
24372
24511
  process.exit(1);
24373
24512
  }
24374
24513
  const rootOverride = getProjectRootOverride(args);
24375
- const projectRoot = rootOverride ? path27.resolve(rootOverride) : resolveProjectRoot2(process.cwd());
24514
+ const projectRoot = rootOverride ? path28.resolve(rootOverride) : resolveProjectRoot2(process.cwd());
24376
24515
  installMode = resolveInstallMode(projectRoot);
24377
24516
  const flags = parseTargetFlags(args);
24378
24517
  const localInstalled = installMode === "local" && probeLocalInstall(projectRoot).installed;
@@ -24568,7 +24707,7 @@ async function update(args) {
24568
24707
  var import_picocolors13 = __toESM(require_picocolors(), 1);
24569
24708
  var import_yaml5 = __toESM(require_dist2(), 1);
24570
24709
  import * as fs21 from "node:fs";
24571
- import * as path28 from "node:path";
24710
+ import * as path29 from "node:path";
24572
24711
  var UNINSTALL_TOOLSERVER_STOP_FAILED = {
24573
24712
  error_code: FAILURE_CODES.UNINSTALL_TOOLSERVER_STOP_FAILED,
24574
24713
  failure_stage: "installer_uninstall_toolserver_stop",
@@ -24603,8 +24742,8 @@ function collectBundledPaths(sourceDir) {
24603
24742
  const directories = [];
24604
24743
  function walk(currentDir, relativeDir = "") {
24605
24744
  for (const entry of fs21.readdirSync(currentDir, { withFileTypes: true })) {
24606
- const relativePath = relativeDir ? path28.join(relativeDir, entry.name) : entry.name;
24607
- const absolutePath = path28.join(currentDir, entry.name);
24745
+ const relativePath = relativeDir ? path29.join(relativeDir, entry.name) : entry.name;
24746
+ const absolutePath = path29.join(currentDir, entry.name);
24608
24747
  if (entry.isDirectory()) {
24609
24748
  walk(absolutePath, relativePath);
24610
24749
  directories.push(relativePath);
@@ -24623,7 +24762,7 @@ function removeBundledContent(sourceDir, targetDir) {
24623
24762
  const { files, directories } = collectBundledPaths(sourceDir);
24624
24763
  const removedPaths = [];
24625
24764
  for (const relativePath of files) {
24626
- const targetPath = path28.join(targetDir, relativePath);
24765
+ const targetPath = path29.join(targetDir, relativePath);
24627
24766
  try {
24628
24767
  if (!fs21.existsSync(targetPath)) continue;
24629
24768
  if (fs21.lstatSync(targetPath).isDirectory()) continue;
@@ -24633,10 +24772,10 @@ function removeBundledContent(sourceDir, targetDir) {
24633
24772
  }
24634
24773
  }
24635
24774
  directories.sort(
24636
- (a2, b) => b.split(path28.sep).length - a2.split(path28.sep).length || b.length - a2.length
24775
+ (a2, b) => b.split(path29.sep).length - a2.split(path29.sep).length || b.length - a2.length
24637
24776
  );
24638
24777
  for (const relativePath of directories) {
24639
- const targetPath = path28.join(targetDir, relativePath);
24778
+ const targetPath = path29.join(targetDir, relativePath);
24640
24779
  try {
24641
24780
  if (!fs21.existsSync(targetPath)) continue;
24642
24781
  if (!fs21.statSync(targetPath).isDirectory()) continue;
@@ -24656,7 +24795,7 @@ function removeBundledContent(sourceDir, targetDir) {
24656
24795
  } catch {
24657
24796
  }
24658
24797
  if (removedRoot) {
24659
- removeDirIfEmpty2(path28.dirname(targetDir));
24798
+ removeDirIfEmpty2(path29.dirname(targetDir));
24660
24799
  }
24661
24800
  return { removedPaths, removedRoot };
24662
24801
  }
@@ -24677,7 +24816,7 @@ function getBundledSkillNames(skillsDir) {
24677
24816
  const skillNames = [];
24678
24817
  for (const entry of fs21.readdirSync(skillsDir, { withFileTypes: true })) {
24679
24818
  if (!entry.isDirectory()) continue;
24680
- const skillFilePath = path28.join(skillsDir, entry.name, "SKILL.md");
24819
+ const skillFilePath = path29.join(skillsDir, entry.name, "SKILL.md");
24681
24820
  if (!fs21.existsSync(skillFilePath)) continue;
24682
24821
  skillNames.push(readBundledSkillName(skillFilePath, entry.name));
24683
24822
  }
@@ -24689,7 +24828,7 @@ function removeBundledSkillInstalls(skillNames, targetDir) {
24689
24828
  }
24690
24829
  const removedPaths = [];
24691
24830
  for (const skillName of skillNames) {
24692
- const targetPath = path28.join(targetDir, skillName);
24831
+ const targetPath = path29.join(targetDir, skillName);
24693
24832
  try {
24694
24833
  const stats = fs21.lstatSync(targetPath, { throwIfNoEntry: false });
24695
24834
  if (!stats) continue;
@@ -24704,7 +24843,7 @@ function removeBundledSkillInstalls(skillNames, targetDir) {
24704
24843
  }
24705
24844
  const removedRoot = removeDirIfEmpty2(targetDir);
24706
24845
  if (removedRoot) {
24707
- removeDirIfEmpty2(path28.dirname(targetDir));
24846
+ removeDirIfEmpty2(path29.dirname(targetDir));
24708
24847
  }
24709
24848
  return { removedPaths, removedRoot };
24710
24849
  }
@@ -24947,7 +25086,7 @@ async function uninstall(args) {
24947
25086
  ),
24948
25087
  { ask: false }
24949
25088
  );
24950
- for (const root of retired.removedRoots) removeDirIfEmpty2(path28.dirname(root));
25089
+ for (const root of retired.removedRoots) removeDirIfEmpty2(path29.dirname(root));
24951
25090
  const retiredLines = formatRetiredCleanup(retired);
24952
25091
  pruneResults.push(...retiredLines.removed.map((line) => `${import_picocolors13.default.green("+")} ${line}`));
24953
25092
  const retiredKept = retiredLines.kept.map((line) => ` ${line}`);
@@ -25752,6 +25752,7 @@ var FAILURE_CODES = {
25752
25752
  INSTALL_MODE_FLAG_CONFLICT: "INSTALL_MODE_FLAG_CONFLICT",
25753
25753
  INSTALL_FROM_TAR_PACKAGE_FAILED: "INSTALL_FROM_TAR_PACKAGE_FAILED",
25754
25754
  INSTALL_INIT_TRIGGERED_UPDATE_FAILED: "INSTALL_INIT_TRIGGERED_UPDATE_FAILED",
25755
+ INSTALL_SKILLS_FAILED: "INSTALL_SKILLS_FAILED",
25755
25756
  INSTALL_SKILLS_REFRESH_FAILED: "INSTALL_SKILLS_REFRESH_FAILED",
25756
25757
  INSTALL_UNCLASSIFIED_FAILED: "INSTALL_UNCLASSIFIED_FAILED",
25757
25758
  UPDATE_INSTALLED_VERSION_DETECT_FAILED: "UPDATE_INSTALLED_VERSION_DETECT_FAILED",
@@ -27985,6 +27986,9 @@ var ALLOWED = {
27985
27986
  warned_count: COUNT
27986
27987
  },
27987
27988
  "installation:skill_install": {
27989
+ source: oneOf(["pinned", "bundled"]),
27990
+ used_fallback: bool,
27991
+ fallback_reason: oneOf(["ref_missing", "unclassified"]),
27988
27992
  method: oneOf(["default", "interactive", "manual"]),
27989
27993
  is_online: bool,
27990
27994
  has_offline_cache: bool,
@@ -1512,6 +1512,7 @@ var init_failure_codes = __esm({
1512
1512
  INSTALL_MODE_FLAG_CONFLICT: "INSTALL_MODE_FLAG_CONFLICT",
1513
1513
  INSTALL_FROM_TAR_PACKAGE_FAILED: "INSTALL_FROM_TAR_PACKAGE_FAILED",
1514
1514
  INSTALL_INIT_TRIGGERED_UPDATE_FAILED: "INSTALL_INIT_TRIGGERED_UPDATE_FAILED",
1515
+ INSTALL_SKILLS_FAILED: "INSTALL_SKILLS_FAILED",
1515
1516
  INSTALL_SKILLS_REFRESH_FAILED: "INSTALL_SKILLS_REFRESH_FAILED",
1516
1517
  INSTALL_UNCLASSIFIED_FAILED: "INSTALL_UNCLASSIFIED_FAILED",
1517
1518
  UPDATE_INSTALLED_VERSION_DETECT_FAILED: "UPDATE_INSTALLED_VERSION_DETECT_FAILED",
@@ -100582,6 +100583,9 @@ var ALLOWED = {
100582
100583
  warned_count: COUNT
100583
100584
  },
100584
100585
  "installation:skill_install": {
100586
+ source: oneOf(["pinned", "bundled"]),
100587
+ used_fallback: bool,
100588
+ fallback_reason: oneOf(["ref_missing", "unclassified"]),
100585
100589
  method: oneOf(["default", "interactive", "manual"]),
100586
100590
  is_online: bool,
100587
100591
  has_offline_cache: bool,
@@ -101182,7 +101186,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
101182
101186
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
101183
101187
  function readCliVersion() {
101184
101188
  if (true) {
101185
- return "0.32.1-next.10";
101189
+ return "0.32.1-next.12";
101186
101190
  }
101187
101191
  return "0.0.0";
101188
101192
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.32.1-next.11",
3
+ "version": "0.32.1-next.12",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator and Android Emulator control",
6
6
  "license": "Apache-2.0",