@swmansion/argent 0.31.1 → 0.31.2-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.
- package/bin/argent-android-devtools-0.3.0.apk +0 -0
- package/bin/darwin/ax-service +0 -0
- package/bin/darwin/tvos-ax-service +0 -0
- package/bin/darwin/tvos-hid-daemon +0 -0
- package/bin/tcp/ax-service +0 -0
- package/dist/cli-cmds.mjs +1 -1
- package/dist/installer.mjs +517 -312
- package/dist/tool-server.cjs +48 -29
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
- package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
- package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +1 -1
package/dist/installer.mjs
CHANGED
|
@@ -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,
|
|
3656
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
3655
|
+
function visit_(key, node, visitor, path29) {
|
|
3656
|
+
const ctrl = callVisitor(key, node, visitor, path29);
|
|
3657
3657
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
3658
|
-
replaceNode(key,
|
|
3659
|
-
return visit_(key, ctrl, visitor,
|
|
3658
|
+
replaceNode(key, path29, ctrl);
|
|
3659
|
+
return visit_(key, ctrl, visitor, path29);
|
|
3660
3660
|
}
|
|
3661
3661
|
if (typeof ctrl !== "symbol") {
|
|
3662
3662
|
if (identity2.isCollection(node)) {
|
|
3663
|
-
|
|
3663
|
+
path29 = Object.freeze(path29.concat(node));
|
|
3664
3664
|
for (let i2 = 0; i2 < node.items.length; ++i2) {
|
|
3665
|
-
const ci = visit_(i2, node.items[i2], visitor,
|
|
3665
|
+
const ci = visit_(i2, node.items[i2], visitor, path29);
|
|
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
|
-
|
|
3677
|
-
const ck = visit_("key", node.key, visitor,
|
|
3676
|
+
path29 = Object.freeze(path29.concat(node));
|
|
3677
|
+
const ck = visit_("key", node.key, visitor, path29);
|
|
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,
|
|
3682
|
+
const cv = visit_("value", node.value, visitor, path29);
|
|
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,
|
|
3704
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
3703
|
+
async function visitAsync_(key, node, visitor, path29) {
|
|
3704
|
+
const ctrl = await callVisitor(key, node, visitor, path29);
|
|
3705
3705
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
3706
|
-
replaceNode(key,
|
|
3707
|
-
return visitAsync_(key, ctrl, visitor,
|
|
3706
|
+
replaceNode(key, path29, ctrl);
|
|
3707
|
+
return visitAsync_(key, ctrl, visitor, path29);
|
|
3708
3708
|
}
|
|
3709
3709
|
if (typeof ctrl !== "symbol") {
|
|
3710
3710
|
if (identity2.isCollection(node)) {
|
|
3711
|
-
|
|
3711
|
+
path29 = Object.freeze(path29.concat(node));
|
|
3712
3712
|
for (let i2 = 0; i2 < node.items.length; ++i2) {
|
|
3713
|
-
const ci = await visitAsync_(i2, node.items[i2], visitor,
|
|
3713
|
+
const ci = await visitAsync_(i2, node.items[i2], visitor, path29);
|
|
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
|
-
|
|
3725
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
3724
|
+
path29 = Object.freeze(path29.concat(node));
|
|
3725
|
+
const ck = await visitAsync_("key", node.key, visitor, path29);
|
|
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,
|
|
3730
|
+
const cv = await visitAsync_("value", node.value, visitor, path29);
|
|
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,
|
|
3757
|
+
function callVisitor(key, node, visitor, path29) {
|
|
3758
3758
|
if (typeof visitor === "function")
|
|
3759
|
-
return visitor(key, node,
|
|
3759
|
+
return visitor(key, node, path29);
|
|
3760
3760
|
if (identity2.isMap(node))
|
|
3761
|
-
return visitor.Map?.(key, node,
|
|
3761
|
+
return visitor.Map?.(key, node, path29);
|
|
3762
3762
|
if (identity2.isSeq(node))
|
|
3763
|
-
return visitor.Seq?.(key, node,
|
|
3763
|
+
return visitor.Seq?.(key, node, path29);
|
|
3764
3764
|
if (identity2.isPair(node))
|
|
3765
|
-
return visitor.Pair?.(key, node,
|
|
3765
|
+
return visitor.Pair?.(key, node, path29);
|
|
3766
3766
|
if (identity2.isScalar(node))
|
|
3767
|
-
return visitor.Scalar?.(key, node,
|
|
3767
|
+
return visitor.Scalar?.(key, node, path29);
|
|
3768
3768
|
if (identity2.isAlias(node))
|
|
3769
|
-
return visitor.Alias?.(key, node,
|
|
3769
|
+
return visitor.Alias?.(key, node, path29);
|
|
3770
3770
|
return void 0;
|
|
3771
3771
|
}
|
|
3772
|
-
function replaceNode(key,
|
|
3773
|
-
const parent =
|
|
3772
|
+
function replaceNode(key, path29, node) {
|
|
3773
|
+
const parent = path29[path29.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,
|
|
4385
|
+
function collectionFromPath(schema, path29, value) {
|
|
4386
4386
|
let v = value;
|
|
4387
|
-
for (let i2 =
|
|
4388
|
-
const k =
|
|
4387
|
+
for (let i2 = path29.length - 1; i2 >= 0; --i2) {
|
|
4388
|
+
const k = path29[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 = (
|
|
4407
|
+
var isEmptyPath = (path29) => path29 == null || typeof path29 === "object" && !!path29[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(
|
|
4438
|
-
if (isEmptyPath(
|
|
4437
|
+
addIn(path29, value) {
|
|
4438
|
+
if (isEmptyPath(path29))
|
|
4439
4439
|
this.add(value);
|
|
4440
4440
|
else {
|
|
4441
|
-
const [key, ...rest] =
|
|
4441
|
+
const [key, ...rest] = path29;
|
|
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(
|
|
4456
|
-
const [key, ...rest] =
|
|
4455
|
+
deleteIn(path29) {
|
|
4456
|
+
const [key, ...rest] = path29;
|
|
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(
|
|
4471
|
-
const [key, ...rest] =
|
|
4470
|
+
getIn(path29, keepScalar) {
|
|
4471
|
+
const [key, ...rest] = path29;
|
|
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(
|
|
4490
|
-
const [key, ...rest] =
|
|
4489
|
+
hasIn(path29) {
|
|
4490
|
+
const [key, ...rest] = path29;
|
|
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(
|
|
4501
|
-
const [key, ...rest] =
|
|
4500
|
+
setIn(path29, value) {
|
|
4501
|
+
const [key, ...rest] = path29;
|
|
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(
|
|
7016
|
+
addIn(path29, value) {
|
|
7017
7017
|
if (assertCollection(this.contents))
|
|
7018
|
-
this.contents.addIn(
|
|
7018
|
+
this.contents.addIn(path29, 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(
|
|
7094
|
-
if (Collection.isEmptyPath(
|
|
7093
|
+
deleteIn(path29) {
|
|
7094
|
+
if (Collection.isEmptyPath(path29)) {
|
|
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(
|
|
7100
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path29) : 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(
|
|
7116
|
-
if (Collection.isEmptyPath(
|
|
7115
|
+
getIn(path29, keepScalar) {
|
|
7116
|
+
if (Collection.isEmptyPath(path29))
|
|
7117
7117
|
return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
7118
|
-
return identity2.isCollection(this.contents) ? this.contents.getIn(
|
|
7118
|
+
return identity2.isCollection(this.contents) ? this.contents.getIn(path29, 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(
|
|
7130
|
-
if (Collection.isEmptyPath(
|
|
7129
|
+
hasIn(path29) {
|
|
7130
|
+
if (Collection.isEmptyPath(path29))
|
|
7131
7131
|
return this.contents !== void 0;
|
|
7132
|
-
return identity2.isCollection(this.contents) ? this.contents.hasIn(
|
|
7132
|
+
return identity2.isCollection(this.contents) ? this.contents.hasIn(path29) : 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(
|
|
7150
|
-
if (Collection.isEmptyPath(
|
|
7149
|
+
setIn(path29, value) {
|
|
7150
|
+
if (Collection.isEmptyPath(path29)) {
|
|
7151
7151
|
this.contents = value;
|
|
7152
7152
|
} else if (this.contents == null) {
|
|
7153
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
7153
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path29), value);
|
|
7154
7154
|
} else if (assertCollection(this.contents)) {
|
|
7155
|
-
this.contents.setIn(
|
|
7155
|
+
this.contents.setIn(path29, 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,
|
|
9116
|
+
visit2.itemAtPath = (cst, path29) => {
|
|
9117
9117
|
let item = cst;
|
|
9118
|
-
for (const [field, index] of
|
|
9118
|
+
for (const [field, index] of path29) {
|
|
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,
|
|
9128
|
-
const parent = visit2.itemAtPath(cst,
|
|
9129
|
-
const field =
|
|
9127
|
+
visit2.parentCollection = (cst, path29) => {
|
|
9128
|
+
const parent = visit2.itemAtPath(cst, path29.slice(0, -1));
|
|
9129
|
+
const field = path29[path29.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(
|
|
9136
|
-
let ctrl = visitor(item,
|
|
9135
|
+
function _visit(path29, item, visitor) {
|
|
9136
|
+
let ctrl = visitor(item, path29);
|
|
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(
|
|
9143
|
+
const ci = _visit(Object.freeze(path29.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,
|
|
9154
|
+
ctrl = ctrl(item, path29);
|
|
9155
9155
|
}
|
|
9156
9156
|
}
|
|
9157
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
9157
|
+
return typeof ctrl === "function" ? ctrl(item, path29) : ctrl;
|
|
9158
9158
|
}
|
|
9159
9159
|
exports.visit = visit2;
|
|
9160
9160
|
}
|
|
@@ -12566,7 +12566,7 @@ ${i2}
|
|
|
12566
12566
|
}).prompt();
|
|
12567
12567
|
|
|
12568
12568
|
// ../argent-installer/src/init.ts
|
|
12569
|
-
var
|
|
12569
|
+
var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
12570
12570
|
|
|
12571
12571
|
// ../../node_modules/@opentelemetry/api-logs/build/esm/types/LogRecord.js
|
|
12572
12572
|
var SeverityNumber;
|
|
@@ -15012,7 +15012,7 @@ function appendRootPathToUrlIfNeeded(url) {
|
|
|
15012
15012
|
return void 0;
|
|
15013
15013
|
}
|
|
15014
15014
|
}
|
|
15015
|
-
function appendResourcePathToUrl(url,
|
|
15015
|
+
function appendResourcePathToUrl(url, path29) {
|
|
15016
15016
|
try {
|
|
15017
15017
|
new URL(url);
|
|
15018
15018
|
} catch {
|
|
@@ -15022,11 +15022,11 @@ function appendResourcePathToUrl(url, path28) {
|
|
|
15022
15022
|
if (!url.endsWith("/")) {
|
|
15023
15023
|
url = url + "/";
|
|
15024
15024
|
}
|
|
15025
|
-
url +=
|
|
15025
|
+
url += path29;
|
|
15026
15026
|
try {
|
|
15027
15027
|
new URL(url);
|
|
15028
15028
|
} catch {
|
|
15029
|
-
diag2.warn(`Configuration: Provided URL appended with '${
|
|
15029
|
+
diag2.warn(`Configuration: Provided URL appended with '${path29}' is not a valid URL, using 'undefined' instead of '${url}'`);
|
|
15030
15030
|
return void 0;
|
|
15031
15031
|
}
|
|
15032
15032
|
return url;
|
|
@@ -16492,9 +16492,9 @@ function isReplitAgent(env) {
|
|
|
16492
16492
|
}
|
|
16493
16493
|
var DEVIN_MARKER_PATH = "/opt/.devin";
|
|
16494
16494
|
var JULES_MARKER_PATH = "/opt/environment_summary.sh";
|
|
16495
|
-
function safeExists(fileExists,
|
|
16495
|
+
function safeExists(fileExists, path29) {
|
|
16496
16496
|
try {
|
|
16497
|
-
return fileExists(
|
|
16497
|
+
return fileExists(path29);
|
|
16498
16498
|
} catch {
|
|
16499
16499
|
return false;
|
|
16500
16500
|
}
|
|
@@ -16915,7 +16915,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
16915
16915
|
var SESSION_ID = randomUUID4();
|
|
16916
16916
|
function readCliVersion() {
|
|
16917
16917
|
if (true) {
|
|
16918
|
-
return "0.31.
|
|
16918
|
+
return "0.31.2-next.0";
|
|
16919
16919
|
}
|
|
16920
16920
|
return "0.0.0";
|
|
16921
16921
|
}
|
|
@@ -17568,6 +17568,7 @@ var import_semver3 = __toESM(require_semver2(), 1);
|
|
|
17568
17568
|
import * as fs16 from "node:fs";
|
|
17569
17569
|
import * as path17 from "node:path";
|
|
17570
17570
|
import * as dns from "node:dns";
|
|
17571
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
17571
17572
|
import * as os2 from "node:os";
|
|
17572
17573
|
import { execFileSync as execFileSync3, execSync } from "node:child_process";
|
|
17573
17574
|
|
|
@@ -19311,12 +19312,12 @@ function parseTree(text2, errors = [], options = ParseOptions.DEFAULT) {
|
|
|
19311
19312
|
}
|
|
19312
19313
|
return result;
|
|
19313
19314
|
}
|
|
19314
|
-
function findNodeAtLocation(root,
|
|
19315
|
+
function findNodeAtLocation(root, path29) {
|
|
19315
19316
|
if (!root) {
|
|
19316
19317
|
return void 0;
|
|
19317
19318
|
}
|
|
19318
19319
|
let node = root;
|
|
19319
|
-
for (let segment of
|
|
19320
|
+
for (let segment of path29) {
|
|
19320
19321
|
if (typeof segment === "string") {
|
|
19321
19322
|
if (node.type !== "object" || !Array.isArray(node.children)) {
|
|
19322
19323
|
return void 0;
|
|
@@ -19670,14 +19671,14 @@ function getNodeType(value) {
|
|
|
19670
19671
|
|
|
19671
19672
|
// ../../node_modules/jsonc-parser/lib/esm/impl/edit.js
|
|
19672
19673
|
function setProperty(text2, originalPath, value, options) {
|
|
19673
|
-
const
|
|
19674
|
+
const path29 = originalPath.slice();
|
|
19674
19675
|
const errors = [];
|
|
19675
19676
|
const root = parseTree(text2, errors);
|
|
19676
19677
|
let parent = void 0;
|
|
19677
19678
|
let lastSegment = void 0;
|
|
19678
|
-
while (
|
|
19679
|
-
lastSegment =
|
|
19680
|
-
parent = findNodeAtLocation(root,
|
|
19679
|
+
while (path29.length > 0) {
|
|
19680
|
+
lastSegment = path29.pop();
|
|
19681
|
+
parent = findNodeAtLocation(root, path29);
|
|
19681
19682
|
if (parent === void 0 && value !== void 0) {
|
|
19682
19683
|
if (typeof lastSegment === "string") {
|
|
19683
19684
|
value = { [lastSegment]: value };
|
|
@@ -19863,8 +19864,8 @@ var ParseErrorCode;
|
|
|
19863
19864
|
ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
|
|
19864
19865
|
ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
19865
19866
|
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
19866
|
-
function modify(text2,
|
|
19867
|
-
return setProperty(text2,
|
|
19867
|
+
function modify(text2, path29, value, options) {
|
|
19868
|
+
return setProperty(text2, path29, value, options);
|
|
19868
19869
|
}
|
|
19869
19870
|
function applyEdits(text2, edits) {
|
|
19870
19871
|
let sortedEdits = edits.slice(0).sort((a2, b) => {
|
|
@@ -20045,15 +20046,25 @@ import * as fs14 from "node:fs";
|
|
|
20045
20046
|
import * as path15 from "node:path";
|
|
20046
20047
|
import { createRequire } from "node:module";
|
|
20047
20048
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
20048
|
-
var
|
|
20049
|
-
|
|
20050
|
-
|
|
20051
|
-
|
|
20052
|
-
|
|
20053
|
-
|
|
20049
|
+
var TEMP_RUNNER_PATTERNS = [
|
|
20050
|
+
// npx: <npm cache>/_npx/<hash>/node_modules/.bin
|
|
20051
|
+
/\/_npx\//,
|
|
20052
|
+
// pnpm 9+ dlx: <pnpm cache>/dlx/<hash>/<id>/node_modules/.bin
|
|
20053
|
+
/\/dlx\/[^/]+\/[^/]+\/node_modules\/\.bin\//,
|
|
20054
|
+
// pnpm 8 dlx: <store>/tmp/dlx-<pid>/node_modules/.bin
|
|
20055
|
+
/\/dlx-\d+\//,
|
|
20056
|
+
// yarn 2+ dlx: <tmp>/xfs-<hex>/argent
|
|
20057
|
+
/\/xfs-[0-9a-f]{8,}\//,
|
|
20058
|
+
// bunx up to 1.0.28: <tmp>/<spec>--bunx/node_modules/.bin
|
|
20059
|
+
/--bunx\/node_modules\/\.bin\//,
|
|
20060
|
+
// bunx 1.0.29 to 1.4.3, and on Windows: <tmp>/bunx-<uid>-<spec>/node_modules/.bin
|
|
20061
|
+
/\/bunx-\d+-/,
|
|
20062
|
+
// bunx 1.4.4+: <bun install cache, else tmp>/.bunx-<uid>/<spec>/node_modules/.bin
|
|
20063
|
+
/\/\.bunx-\d+\//
|
|
20054
20064
|
];
|
|
20055
20065
|
function isTempRunnerPath(binaryPath) {
|
|
20056
|
-
|
|
20066
|
+
const slashed = binaryPath.split("\\").join("/");
|
|
20067
|
+
return TEMP_RUNNER_PATTERNS.some((pattern) => pattern.test(slashed));
|
|
20057
20068
|
}
|
|
20058
20069
|
function getGlobalBinaryPath() {
|
|
20059
20070
|
try {
|
|
@@ -20273,6 +20284,42 @@ var LEGACY_ARGENT_SKILL_NAMES = [
|
|
|
20273
20284
|
"argent-simulator-setup",
|
|
20274
20285
|
"argent-ios-profiler"
|
|
20275
20286
|
];
|
|
20287
|
+
var RETIRED_BUNDLED_PATHS = {
|
|
20288
|
+
agents: [
|
|
20289
|
+
{
|
|
20290
|
+
// v0.3.1 and v0.3.2, when the agent and package carried their first names.
|
|
20291
|
+
path: "environment-inspector.md",
|
|
20292
|
+
shipped: [
|
|
20293
|
+
"50f8d1442677a7def3117cc8652f26dd5c1e2271ae0c7c9814c5bb17dfdd7858",
|
|
20294
|
+
"10f998fef549503cf341e1775ff6aacafbf361c1d7ec32c554a9c42343a6998a"
|
|
20295
|
+
]
|
|
20296
|
+
},
|
|
20297
|
+
{
|
|
20298
|
+
path: "argent-environment-inspector.md",
|
|
20299
|
+
shipped: [
|
|
20300
|
+
"1f9b285ec30b7298b60b03cae10fb934ab07bc394104ab2d974d452a4c203178",
|
|
20301
|
+
"9d417798147fa11f4351109e6331865b79862fc631d7f32b70f64981362b90eb",
|
|
20302
|
+
"0f535893b239040ebe4a001ae7c3639366c4a6fe8d98e2568a59584798454644",
|
|
20303
|
+
"ec5872c9bd2085d281f5d4e1d06b5eb3f32a5be29c2bf8cb5c953ca6e9d73349",
|
|
20304
|
+
"96cb2e5025755448186cd9d29e85ce3db3cedb3dbfd2e6c89e734c76aa7fbdff",
|
|
20305
|
+
"9eff92cf887390fb3ffb68e7de5789e703049795a24d5f268332af488d155531"
|
|
20306
|
+
]
|
|
20307
|
+
},
|
|
20308
|
+
{
|
|
20309
|
+
path: "references/quality-control-checklist.md",
|
|
20310
|
+
shipped: [
|
|
20311
|
+
"40f43028524e9544e2c77d2d1ad7eaf9385efadfb079bfec2973b999817203c1",
|
|
20312
|
+
"12a8deb0276a3d9fcd8b6c8fc6080b58be2e3e45fd0409dc2e7594e619e2eceb",
|
|
20313
|
+
"f1c76c1d51aa5a88371061a2bd5f46264ea2082aa4e1c2bca517d901b836c753",
|
|
20314
|
+
"84ecf5920fbca4460484a241a8ad1411fe8d6c3d0c9c25f80096a5a28f219f8a"
|
|
20315
|
+
]
|
|
20316
|
+
}
|
|
20317
|
+
],
|
|
20318
|
+
rules: []
|
|
20319
|
+
};
|
|
20320
|
+
function hashBundledContent(content) {
|
|
20321
|
+
return createHash2("sha256").update(content.replace(/\r\n/g, "\n")).digest("hex");
|
|
20322
|
+
}
|
|
20276
20323
|
function listArgentSkillsInLock(lockPath) {
|
|
20277
20324
|
try {
|
|
20278
20325
|
const raw = fs16.readFileSync(lockPath, "utf8");
|
|
@@ -20384,11 +20431,13 @@ function isEmptyPlainObject(value) {
|
|
|
20384
20431
|
}
|
|
20385
20432
|
function rmEmptyDir(dirPath) {
|
|
20386
20433
|
try {
|
|
20387
|
-
if (!fs16.existsSync(dirPath)) return;
|
|
20388
|
-
if (!fs16.statSync(dirPath).isDirectory()) return;
|
|
20389
|
-
if (fs16.readdirSync(dirPath).length > 0) return;
|
|
20434
|
+
if (!fs16.existsSync(dirPath)) return false;
|
|
20435
|
+
if (!fs16.statSync(dirPath).isDirectory()) return false;
|
|
20436
|
+
if (fs16.readdirSync(dirPath).length > 0) return false;
|
|
20390
20437
|
fs16.rmdirSync(dirPath);
|
|
20438
|
+
return true;
|
|
20391
20439
|
} catch {
|
|
20440
|
+
return false;
|
|
20392
20441
|
}
|
|
20393
20442
|
}
|
|
20394
20443
|
function readJsonc(filePath) {
|
|
@@ -20447,11 +20496,14 @@ function resolveLinkedDestination(dest) {
|
|
|
20447
20496
|
return dest;
|
|
20448
20497
|
}
|
|
20449
20498
|
function copyDir(src, dest) {
|
|
20450
|
-
if (!fs16.existsSync(src)) return null;
|
|
20499
|
+
if (!fs16.existsSync(src) || !treeHasFiles(src)) return null;
|
|
20451
20500
|
const target = resolveLinkedDestination(dest);
|
|
20452
20501
|
copyTree(src, target);
|
|
20453
20502
|
return target;
|
|
20454
20503
|
}
|
|
20504
|
+
function treeHasFiles(dir) {
|
|
20505
|
+
return fs16.readdirSync(dir, { withFileTypes: true }).some((entry) => !entry.isDirectory() || treeHasFiles(path17.join(dir, entry.name)));
|
|
20506
|
+
}
|
|
20455
20507
|
function copyTree(src, dest) {
|
|
20456
20508
|
const entries = fs16.readdirSync(src, { withFileTypes: true });
|
|
20457
20509
|
fs16.mkdirSync(dest, { recursive: true });
|
|
@@ -20462,6 +20514,50 @@ function copyTree(src, dest) {
|
|
|
20462
20514
|
else fs16.copyFileSync(from, to);
|
|
20463
20515
|
}
|
|
20464
20516
|
}
|
|
20517
|
+
function readRetiredFile(targetDir, relativePath) {
|
|
20518
|
+
const entryPath = path17.join(resolveLinkedDestination(targetDir), ...relativePath.split("/"));
|
|
20519
|
+
const file = resolveLinkedDestination(entryPath);
|
|
20520
|
+
try {
|
|
20521
|
+
if (!fs16.statSync(file, { throwIfNoEntry: false })?.isFile()) return null;
|
|
20522
|
+
return fs16.readFileSync(file, "utf8");
|
|
20523
|
+
} catch {
|
|
20524
|
+
return null;
|
|
20525
|
+
}
|
|
20526
|
+
}
|
|
20527
|
+
function findRetiredFiles(retired, bundleDir, targetDir) {
|
|
20528
|
+
const found = [];
|
|
20529
|
+
for (const { path: relativePath, shipped } of retired) {
|
|
20530
|
+
if (fs16.existsSync(path17.join(bundleDir, ...relativePath.split("/")))) continue;
|
|
20531
|
+
const content = readRetiredFile(targetDir, relativePath);
|
|
20532
|
+
if (content === null) continue;
|
|
20533
|
+
const sha256 = hashBundledContent(content);
|
|
20534
|
+
if (shipped.includes(sha256)) found.push({ relativePath, sha256 });
|
|
20535
|
+
}
|
|
20536
|
+
return found;
|
|
20537
|
+
}
|
|
20538
|
+
function removeRetiredFiles(targetDir, files) {
|
|
20539
|
+
const dir = resolveLinkedDestination(targetDir);
|
|
20540
|
+
const removedPaths = [];
|
|
20541
|
+
for (const { relativePath, sha256 } of files) {
|
|
20542
|
+
const content = readRetiredFile(targetDir, relativePath);
|
|
20543
|
+
if (content === null || hashBundledContent(content) !== sha256) continue;
|
|
20544
|
+
const segments = relativePath.split("/");
|
|
20545
|
+
const entryPath = path17.join(dir, ...segments);
|
|
20546
|
+
const file = resolveLinkedDestination(entryPath);
|
|
20547
|
+
try {
|
|
20548
|
+
fs16.rmSync(file);
|
|
20549
|
+
if (file !== entryPath) fs16.rmSync(entryPath, { force: true });
|
|
20550
|
+
removedPaths.push(relativePath);
|
|
20551
|
+
} catch {
|
|
20552
|
+
continue;
|
|
20553
|
+
}
|
|
20554
|
+
for (let depth = segments.length - 1; depth > 0; depth--) {
|
|
20555
|
+
if (!rmEmptyDir(path17.join(dir, ...segments.slice(0, depth)))) break;
|
|
20556
|
+
}
|
|
20557
|
+
}
|
|
20558
|
+
const removedRoot = removedPaths.length > 0 && dir === targetDir && rmEmptyDir(dir);
|
|
20559
|
+
return { removedPaths, removedRoot };
|
|
20560
|
+
}
|
|
20465
20561
|
function dirExists(p) {
|
|
20466
20562
|
try {
|
|
20467
20563
|
return fs16.statSync(p).isDirectory();
|
|
@@ -20697,6 +20793,7 @@ function bundledManagedNames(kind) {
|
|
|
20697
20793
|
} catch {
|
|
20698
20794
|
names = /* @__PURE__ */ new Set();
|
|
20699
20795
|
}
|
|
20796
|
+
for (const retired of RETIRED_BUNDLED_PATHS[kind]) names.add(retired.path.split("/")[0]);
|
|
20700
20797
|
bundledManagedNamesCache.set(kind, names);
|
|
20701
20798
|
return names;
|
|
20702
20799
|
}
|
|
@@ -21860,6 +21957,26 @@ function removeCodexRules(configPath) {
|
|
|
21860
21957
|
writeTomlOrRemove(configPath, config);
|
|
21861
21958
|
return true;
|
|
21862
21959
|
}
|
|
21960
|
+
function findRetiredRulesAndAgents(scans, root, rulesDir, agentsDir) {
|
|
21961
|
+
const targets = scans.flatMap(({ adapters, scope }) => {
|
|
21962
|
+
const { ruleTargets, agentTargets } = getManagedContentTargets(adapters, root, scope);
|
|
21963
|
+
return [
|
|
21964
|
+
...ruleTargets.map((target) => ({ kind: "rules", target, bundleDir: rulesDir })),
|
|
21965
|
+
...agentTargets.map((target) => ({ kind: "agents", target, bundleDir: agentsDir }))
|
|
21966
|
+
];
|
|
21967
|
+
});
|
|
21968
|
+
const found = [];
|
|
21969
|
+
const seen = /* @__PURE__ */ new Set();
|
|
21970
|
+
for (const { kind, target, bundleDir } of targets) {
|
|
21971
|
+
const dir = resolveLinkedDestination(target.targetPath);
|
|
21972
|
+
if (seen.has(`${kind}:${realpathOrSelf(dir)}`)) continue;
|
|
21973
|
+
seen.add(`${kind}:${realpathOrSelf(dir)}`);
|
|
21974
|
+
const files = findRetiredFiles(RETIRED_BUNDLED_PATHS[kind], bundleDir, target.targetPath);
|
|
21975
|
+
if (files.length === 0) continue;
|
|
21976
|
+
found.push({ kind, target, location: formatCopyDestination(target, dir, root), files });
|
|
21977
|
+
}
|
|
21978
|
+
return found;
|
|
21979
|
+
}
|
|
21863
21980
|
function copyRulesAndAgents(adapters, root, scope, rulesDir, agentsDir) {
|
|
21864
21981
|
const results = [];
|
|
21865
21982
|
const managedTargets = getManagedContentTargets(adapters, root, scope);
|
|
@@ -21896,12 +22013,65 @@ function copyRulesAndAgents(adapters, root, scope, rulesDir, agentsDir) {
|
|
|
21896
22013
|
return results;
|
|
21897
22014
|
}
|
|
21898
22015
|
|
|
22016
|
+
// ../argent-installer/src/retired-files.ts
|
|
22017
|
+
import * as path19 from "node:path";
|
|
22018
|
+
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
22019
|
+
function displayPath(entry, file) {
|
|
22020
|
+
return path19.join(entry.location, ...file.relativePath.split("/"));
|
|
22021
|
+
}
|
|
22022
|
+
async function cleanupRetiredFiles(found, options) {
|
|
22023
|
+
const result = { removed: [], declined: [], failed: [], removedRoots: [] };
|
|
22024
|
+
const paths = found.flatMap((entry) => entry.files.map((file) => displayPath(entry, file)));
|
|
22025
|
+
if (paths.length === 0) return result;
|
|
22026
|
+
if (options.ask) {
|
|
22027
|
+
log.warn(
|
|
22028
|
+
"Argent no longer ships these files, but your editors still load them:\n" + paths.map((item) => ` ${import_picocolors.default.cyan(item)}`).join("\n")
|
|
22029
|
+
);
|
|
22030
|
+
const answer = await confirm({ message: "Remove them?", initialValue: true });
|
|
22031
|
+
if (isCancel(answer) || answer !== true) {
|
|
22032
|
+
result.declined = paths;
|
|
22033
|
+
return result;
|
|
22034
|
+
}
|
|
22035
|
+
}
|
|
22036
|
+
for (const entry of found) {
|
|
22037
|
+
const label = entry.kind === "rules" ? "rule" : "agent";
|
|
22038
|
+
const { removedPaths, removedRoot } = removeRetiredFiles(entry.target.targetPath, entry.files);
|
|
22039
|
+
if (removedRoot) result.removedRoots.push(entry.target.targetPath);
|
|
22040
|
+
for (const file of entry.files) {
|
|
22041
|
+
if (removedPaths.includes(file.relativePath)) {
|
|
22042
|
+
result.removed.push(`Removed retired ${label} ${file.relativePath} from ${entry.location}`);
|
|
22043
|
+
} else {
|
|
22044
|
+
result.failed.push(displayPath(entry, file));
|
|
22045
|
+
}
|
|
22046
|
+
}
|
|
22047
|
+
}
|
|
22048
|
+
return result;
|
|
22049
|
+
}
|
|
22050
|
+
function formatRetiredCleanup(result) {
|
|
22051
|
+
const kept = [];
|
|
22052
|
+
const group = (heading, paths) => {
|
|
22053
|
+
if (paths.length > 0) kept.push(heading, ...paths.map((item) => ` ${item}`));
|
|
22054
|
+
};
|
|
22055
|
+
group("Kept, as you chose (rename one to keep it for good):", result.declined);
|
|
22056
|
+
group("Could not remove (changed since listed, or not deletable):", result.failed);
|
|
22057
|
+
return { removed: result.removed, kept };
|
|
22058
|
+
}
|
|
22059
|
+
async function reportRetiredFiles(found, interactive) {
|
|
22060
|
+
if (found.length === 0) return;
|
|
22061
|
+
const { removed, kept } = formatRetiredCleanup(
|
|
22062
|
+
await cleanupRetiredFiles(found, { ask: interactive })
|
|
22063
|
+
);
|
|
22064
|
+
const lines = [...removed, ...kept];
|
|
22065
|
+
if (lines.length > 0)
|
|
22066
|
+
note(lines.map((line) => ` ${line}`).join("\n"), "Files Argent No Longer Ships");
|
|
22067
|
+
}
|
|
22068
|
+
|
|
21899
22069
|
// ../argent-installer/src/cli-record.ts
|
|
21900
22070
|
var import_semver4 = __toESM(require_semver2(), 1);
|
|
21901
22071
|
import * as fs18 from "node:fs";
|
|
21902
|
-
import * as
|
|
22072
|
+
import * as path20 from "node:path";
|
|
21903
22073
|
function cliRecordPath() {
|
|
21904
|
-
return
|
|
22074
|
+
return path20.join(argentHomeDir(), "cli.json");
|
|
21905
22075
|
}
|
|
21906
22076
|
function readCliRecord() {
|
|
21907
22077
|
try {
|
|
@@ -21915,13 +22085,13 @@ function readCliRecord() {
|
|
|
21915
22085
|
function resolveCliEntry(mode, projectRoot) {
|
|
21916
22086
|
if (mode === "local") {
|
|
21917
22087
|
const relative5 = getLocalArgentBinRelPath(projectRoot);
|
|
21918
|
-
return relative5 ?
|
|
22088
|
+
return relative5 ? path20.resolve(projectRoot, relative5) : null;
|
|
21919
22089
|
}
|
|
21920
22090
|
const packageRoot = getGloballyInstalledPackageRoot();
|
|
21921
22091
|
if (!packageRoot) return null;
|
|
21922
22092
|
const binSub = argentBinSubpath(packageRoot);
|
|
21923
22093
|
if (!binSub) return null;
|
|
21924
|
-
const entry =
|
|
22094
|
+
const entry = path20.join(packageRoot, binSub);
|
|
21925
22095
|
return fs18.existsSync(entry) ? entry : null;
|
|
21926
22096
|
}
|
|
21927
22097
|
function writeCliRecord(input) {
|
|
@@ -21938,7 +22108,7 @@ function writeCliRecord(input) {
|
|
|
21938
22108
|
function persistCliRecord(record) {
|
|
21939
22109
|
const file = cliRecordPath();
|
|
21940
22110
|
try {
|
|
21941
|
-
fs18.mkdirSync(
|
|
22111
|
+
fs18.mkdirSync(path20.dirname(file), { recursive: true });
|
|
21942
22112
|
const temporary = `${file}.${process.pid}.tmp`;
|
|
21943
22113
|
fs18.writeFileSync(temporary, JSON.stringify(record, null, 2) + "\n");
|
|
21944
22114
|
fs18.renameSync(temporary, file);
|
|
@@ -21973,9 +22143,9 @@ function removeCliRecordFor(installDir) {
|
|
|
21973
22143
|
if (!installDir) return false;
|
|
21974
22144
|
const record = readCliRecord();
|
|
21975
22145
|
if (!record) return false;
|
|
21976
|
-
const root =
|
|
21977
|
-
const relative5 =
|
|
21978
|
-
if (relative5.startsWith("..") ||
|
|
22146
|
+
const root = path20.resolve(installDir);
|
|
22147
|
+
const relative5 = path20.relative(root, path20.resolve(record.cli));
|
|
22148
|
+
if (relative5.startsWith("..") || path20.isAbsolute(relative5)) return false;
|
|
21979
22149
|
try {
|
|
21980
22150
|
fs18.rmSync(cliRecordPath(), { force: true });
|
|
21981
22151
|
return true;
|
|
@@ -21985,16 +22155,16 @@ function removeCliRecordFor(installDir) {
|
|
|
21985
22155
|
}
|
|
21986
22156
|
|
|
21987
22157
|
// ../argent-installer/src/first-run-notice.ts
|
|
21988
|
-
var
|
|
22158
|
+
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
21989
22159
|
var TELEMETRY_OPT_IN_COMMAND = "argent telemetry enable";
|
|
21990
22160
|
function printFirstRunNotice() {
|
|
21991
22161
|
if (!shouldShowFirstRunNotice()) return;
|
|
21992
22162
|
log.info(
|
|
21993
22163
|
[
|
|
21994
|
-
|
|
21995
|
-
...FIRST_RUN_NOTICE_BODY_LINES.map((line) =>
|
|
21996
|
-
`${
|
|
21997
|
-
`${
|
|
22164
|
+
import_picocolors2.default.bold("Telemetry"),
|
|
22165
|
+
...FIRST_RUN_NOTICE_BODY_LINES.map((line) => import_picocolors2.default.dim(line)),
|
|
22166
|
+
`${import_picocolors2.default.dim("Opt out anytime:")} ${import_picocolors2.default.cyan(TELEMETRY_OPT_OUT_COMMAND)}`,
|
|
22167
|
+
`${import_picocolors2.default.dim("Details:")} ${import_picocolors2.default.dim(TELEMETRY_DETAILS_URL)}`
|
|
21998
22168
|
].join("\n")
|
|
21999
22169
|
);
|
|
22000
22170
|
markFirstRunNoticeShown();
|
|
@@ -22003,7 +22173,7 @@ async function resolveTelemetryConsent(opts) {
|
|
|
22003
22173
|
if (opts.disableFlag) {
|
|
22004
22174
|
writeConsentFlag(false);
|
|
22005
22175
|
markFirstRunNoticeShown();
|
|
22006
|
-
log.info(`${
|
|
22176
|
+
log.info(`${import_picocolors2.default.bold("Telemetry")} ${import_picocolors2.default.dim("disabled (--no-telemetry).")}`);
|
|
22007
22177
|
return { kind: "disabled", reason: "flag" };
|
|
22008
22178
|
}
|
|
22009
22179
|
if (opts.nonInteractive) {
|
|
@@ -22017,10 +22187,10 @@ async function resolveTelemetryConsent(opts) {
|
|
|
22017
22187
|
}
|
|
22018
22188
|
log.info(
|
|
22019
22189
|
[
|
|
22020
|
-
|
|
22021
|
-
...FIRST_RUN_NOTICE_BODY_LINES.map((line) =>
|
|
22022
|
-
`${
|
|
22023
|
-
`${
|
|
22190
|
+
import_picocolors2.default.bold("Telemetry"),
|
|
22191
|
+
...FIRST_RUN_NOTICE_BODY_LINES.map((line) => import_picocolors2.default.dim(line)),
|
|
22192
|
+
`${import_picocolors2.default.dim("Opt out anytime:")} ${import_picocolors2.default.cyan(TELEMETRY_OPT_OUT_COMMAND)}`,
|
|
22193
|
+
`${import_picocolors2.default.dim("Details:")} ${import_picocolors2.default.dim(TELEMETRY_DETAILS_URL)}`
|
|
22024
22194
|
].join("\n")
|
|
22025
22195
|
);
|
|
22026
22196
|
const choice = await select({
|
|
@@ -22041,11 +22211,11 @@ async function resolveTelemetryConsent(opts) {
|
|
|
22041
22211
|
markFirstRunNoticeShown();
|
|
22042
22212
|
};
|
|
22043
22213
|
if (enabled) {
|
|
22044
|
-
log.info(`${
|
|
22214
|
+
log.info(`${import_picocolors2.default.bold("Telemetry")} ${import_picocolors2.default.green("enabled")}.`);
|
|
22045
22215
|
return { kind: "enabled", commit };
|
|
22046
22216
|
}
|
|
22047
22217
|
log.info(
|
|
22048
|
-
`${
|
|
22218
|
+
`${import_picocolors2.default.bold("Telemetry")} ${import_picocolors2.default.dim(`disabled. Enable anytime: ${TELEMETRY_OPT_IN_COMMAND}`)}`
|
|
22049
22219
|
);
|
|
22050
22220
|
return { kind: "disabled", reason: "choice", commit };
|
|
22051
22221
|
}
|
|
@@ -22190,7 +22360,7 @@ async function promptInstallMode(defaultMode = "global") {
|
|
|
22190
22360
|
}
|
|
22191
22361
|
|
|
22192
22362
|
// ../argent-installer/src/install-runner.ts
|
|
22193
|
-
var
|
|
22363
|
+
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
22194
22364
|
|
|
22195
22365
|
// ../argent-installer/src/shell.ts
|
|
22196
22366
|
import { execFileSync as execFileSync5, spawn as spawn2 } from "node:child_process";
|
|
@@ -22250,8 +22420,8 @@ function runShellCommand(cmd, opts = {}) {
|
|
|
22250
22420
|
// ../argent-installer/src/skills.ts
|
|
22251
22421
|
import { execFileSync as execFileSync6 } from "node:child_process";
|
|
22252
22422
|
import * as fs19 from "node:fs";
|
|
22253
|
-
import * as
|
|
22254
|
-
var
|
|
22423
|
+
import * as path21 from "node:path";
|
|
22424
|
+
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
22255
22425
|
function getScopeSpecs(projectRoot) {
|
|
22256
22426
|
return [
|
|
22257
22427
|
{
|
|
@@ -22330,7 +22500,7 @@ function pruneLegacySkillDirs(projectRoot, scope, bundled = new Set(listBundledS
|
|
|
22330
22500
|
const removed = /* @__PURE__ */ new Set();
|
|
22331
22501
|
for (const { targetPath } of skillTargets) {
|
|
22332
22502
|
for (const name of legacy) {
|
|
22333
|
-
const dir =
|
|
22503
|
+
const dir = path21.join(targetPath, name);
|
|
22334
22504
|
try {
|
|
22335
22505
|
if (!fs19.lstatSync(dir, { throwIfNoEntry: false })) continue;
|
|
22336
22506
|
fs19.rmSync(dir, { recursive: true, force: true });
|
|
@@ -22369,17 +22539,17 @@ function formatSkillRefreshSummary(results) {
|
|
|
22369
22539
|
for (const r2 of results) {
|
|
22370
22540
|
const parts = [];
|
|
22371
22541
|
if (r2.syncError) {
|
|
22372
|
-
parts.push(`${
|
|
22542
|
+
parts.push(`${import_picocolors3.default.red("sync failed")} ${import_picocolors3.default.dim(`(${r2.syncError})`)}`);
|
|
22373
22543
|
} else if (r2.synced > 0) {
|
|
22374
22544
|
parts.push(`synced ${r2.synced}`);
|
|
22375
22545
|
}
|
|
22376
22546
|
if (r2.pruneError) {
|
|
22377
|
-
parts.push(`${
|
|
22547
|
+
parts.push(`${import_picocolors3.default.red("prune failed")} ${import_picocolors3.default.dim(`(${r2.pruneError})`)}`);
|
|
22378
22548
|
} else if (r2.pruned.length > 0) {
|
|
22379
22549
|
parts.push(`pruned ${r2.pruned.length} (${r2.pruned.join(", ")})`);
|
|
22380
22550
|
}
|
|
22381
22551
|
if (parts.length > 0) {
|
|
22382
|
-
lines.push(`${
|
|
22552
|
+
lines.push(`${import_picocolors3.default.green("+")} ${r2.scope}: ${parts.join(", ")}`);
|
|
22383
22553
|
}
|
|
22384
22554
|
}
|
|
22385
22555
|
return lines.length > 0 ? lines.join("\n") : null;
|
|
@@ -22428,8 +22598,8 @@ async function installLocally(opts) {
|
|
|
22428
22598
|
const projectRoot = resolveProjectRoot2(process.cwd());
|
|
22429
22599
|
if (!hasProjectPackageJson(projectRoot)) {
|
|
22430
22600
|
log.error(
|
|
22431
|
-
`Local install needs a package.json at ${
|
|
22432
|
-
Run ${
|
|
22601
|
+
`Local install needs a package.json at ${import_picocolors4.default.cyan(projectRoot)}.
|
|
22602
|
+
Run ${import_picocolors4.default.cyan("npm init -y")} there first, or use ${import_picocolors4.default.cyan("argent init --global")}.`
|
|
22433
22603
|
);
|
|
22434
22604
|
await tel.trackPackageAction(
|
|
22435
22605
|
"fresh_install",
|
|
@@ -22442,7 +22612,7 @@ async function installLocally(opts) {
|
|
|
22442
22612
|
}
|
|
22443
22613
|
if (isDeclaredLocally(projectRoot) && isLocallyInstalled(projectRoot) && !fromTar) {
|
|
22444
22614
|
const startedAt2 = performance.now();
|
|
22445
|
-
log.info(`${PACKAGE_NAME} is already a devDependency ${
|
|
22615
|
+
log.info(`${PACKAGE_NAME} is already a devDependency ${import_picocolors4.default.dim(`(${projectRoot})`)}.`);
|
|
22446
22616
|
await tel.trackPackageAction("already_installed", startedAt2, true);
|
|
22447
22617
|
return;
|
|
22448
22618
|
}
|
|
@@ -22478,23 +22648,23 @@ async function installLocally(opts) {
|
|
|
22478
22648
|
last_attempt_duration_ms: performance.now() - lastAttemptStartedAt
|
|
22479
22649
|
});
|
|
22480
22650
|
if (!landed) {
|
|
22481
|
-
spinner2.stop(
|
|
22651
|
+
spinner2.stop(import_picocolors4.default.red(interrupted ? "Local install interrupted." : "Local install failed."));
|
|
22482
22652
|
if (missingBinary) {
|
|
22483
22653
|
log.error(
|
|
22484
|
-
`This project uses ${
|
|
22654
|
+
`This project uses ${import_picocolors4.default.cyan(pm)}, but the ${import_picocolors4.default.cyan(pm)} command was not found on PATH.`
|
|
22485
22655
|
);
|
|
22486
22656
|
log.info(
|
|
22487
|
-
`Install ${
|
|
22657
|
+
`Install ${import_picocolors4.default.cyan(pm)} first` + (pm === "pnpm" || pm === "yarn" ? ` (e.g. ${import_picocolors4.default.cyan(`corepack enable ${pm}`)}, or see the ${pm} install docs)` : "") + `, then re-run ${import_picocolors4.default.cyan("argent init --local")}.`
|
|
22488
22658
|
);
|
|
22489
22659
|
} else if (interrupted) {
|
|
22490
|
-
log.error(`The ${
|
|
22491
|
-
log.info(`Re-run ${
|
|
22660
|
+
log.error(`The ${import_picocolors4.default.cyan(pm)} install was interrupted before it finished.`);
|
|
22661
|
+
log.info(`Re-run ${import_picocolors4.default.cyan("argent init --local")} to try again.`);
|
|
22492
22662
|
} else {
|
|
22493
22663
|
log.error(
|
|
22494
|
-
installError ? `${installError}` : `The install reported success but ${
|
|
22664
|
+
installError ? `${installError}` : `The install reported success but ${import_picocolors4.default.cyan(PACKAGE_NAME)} is not in node_modules.`
|
|
22495
22665
|
);
|
|
22496
22666
|
log.info(
|
|
22497
|
-
`Install manually with: ${
|
|
22667
|
+
`Install manually with: ${import_picocolors4.default.cyan(`cd ${shellQuotePath(projectRoot)} && ${cmdStr}`)}`
|
|
22498
22668
|
);
|
|
22499
22669
|
}
|
|
22500
22670
|
await tel.trackPackageAction(
|
|
@@ -22508,16 +22678,16 @@ async function installLocally(opts) {
|
|
|
22508
22678
|
process.exit(1);
|
|
22509
22679
|
}
|
|
22510
22680
|
spinner2.stop(
|
|
22511
|
-
|
|
22681
|
+
import_picocolors4.default.green(
|
|
22512
22682
|
materializeOnly ? `Installed ${PACKAGE_NAME} from the committed dependency.` : `Added ${PACKAGE_NAME} to devDependencies.`
|
|
22513
22683
|
)
|
|
22514
22684
|
);
|
|
22515
22685
|
if (installError) {
|
|
22516
|
-
log.warn(
|
|
22686
|
+
log.warn(import_picocolors4.default.dim(`${pm} exited non-zero but ${PACKAGE_NAME} is installed \u2014 continuing.`));
|
|
22517
22687
|
if (pm === "pnpm") {
|
|
22518
22688
|
log.info(
|
|
22519
|
-
|
|
22520
|
-
`pnpm blocks dependency build scripts by default. ${PACKAGE_NAME} does not need them; run ${
|
|
22689
|
+
import_picocolors4.default.dim(
|
|
22690
|
+
`pnpm blocks dependency build scripts by default. ${PACKAGE_NAME} does not need them; run ${import_picocolors4.default.cyan("pnpm approve-builds")} only if you want optional native features (e.g. source-level profiling).`
|
|
22521
22691
|
)
|
|
22522
22692
|
);
|
|
22523
22693
|
}
|
|
@@ -22540,13 +22710,13 @@ async function runGlobal(opts) {
|
|
|
22540
22710
|
const packageActionStartedAt2 = performance.now();
|
|
22541
22711
|
try {
|
|
22542
22712
|
await runShellCommand(cmd);
|
|
22543
|
-
spinner3.stop(
|
|
22713
|
+
spinner3.stop(import_picocolors4.default.green("Installed globally."));
|
|
22544
22714
|
version = getGloballyInstalledVersion() ?? getInstalledVersion() ?? version;
|
|
22545
22715
|
await tel.trackPackageAction("fresh_install", packageActionStartedAt2, true);
|
|
22546
22716
|
} catch (err) {
|
|
22547
|
-
spinner3.stop(
|
|
22717
|
+
spinner3.stop(import_picocolors4.default.red("Installation failed."));
|
|
22548
22718
|
log.error(`${err}`);
|
|
22549
|
-
log.info(`Install Argent manually with: ${
|
|
22719
|
+
log.info(`Install Argent manually with: ${import_picocolors4.default.cyan(cmdStr)}`);
|
|
22550
22720
|
await tel.trackPackageAction(
|
|
22551
22721
|
"fresh_install",
|
|
22552
22722
|
packageActionStartedAt2,
|
|
@@ -22566,12 +22736,12 @@ async function runGlobal(opts) {
|
|
|
22566
22736
|
spinner3.start(`Installing from ${fromTar}...`);
|
|
22567
22737
|
try {
|
|
22568
22738
|
await runShellCommand(cmd);
|
|
22569
|
-
spinner3.stop(
|
|
22739
|
+
spinner3.stop(import_picocolors4.default.green("Installed from tarball."));
|
|
22570
22740
|
version = getGloballyInstalledVersion() ?? getInstalledVersion() ?? version;
|
|
22571
22741
|
} catch (err) {
|
|
22572
|
-
spinner3.stop(
|
|
22742
|
+
spinner3.stop(import_picocolors4.default.red("Installation failed."));
|
|
22573
22743
|
log.error(`${err}`);
|
|
22574
|
-
log.info(`Install manually with: ${
|
|
22744
|
+
log.info(`Install manually with: ${import_picocolors4.default.cyan(cmdStr)}`);
|
|
22575
22745
|
await tel.finalize(INSTALL_FROM_TAR_PACKAGE_FAILED);
|
|
22576
22746
|
process.exit(1);
|
|
22577
22747
|
}
|
|
@@ -22589,10 +22759,10 @@ async function runGlobal(opts) {
|
|
|
22589
22759
|
latest = getLatestVersion();
|
|
22590
22760
|
} catch {
|
|
22591
22761
|
}
|
|
22592
|
-
spinner2.stop(
|
|
22762
|
+
spinner2.stop(import_picocolors4.default.dim("Version check complete."));
|
|
22593
22763
|
if (latest && globalVersion === null) {
|
|
22594
22764
|
log.warn(
|
|
22595
|
-
`Could not determine the global install's version \u2014 skipping the update check. Run ${
|
|
22765
|
+
`Could not determine the global install's version \u2014 skipping the update check. Run ${import_picocolors4.default.cyan("argent update")} to check for updates.`
|
|
22596
22766
|
);
|
|
22597
22767
|
await tel.trackPackageAction("no_update", packageActionStartedAt, true);
|
|
22598
22768
|
} else if (latest && isNewerVersion(latest, version)) {
|
|
@@ -22607,7 +22777,7 @@ async function runGlobal(opts) {
|
|
|
22607
22777
|
await tel.trackPackageAction("update_skipped", packageActionStartedAt, true);
|
|
22608
22778
|
} else {
|
|
22609
22779
|
const updateChoice = await select({
|
|
22610
|
-
message: `Update available: ${
|
|
22780
|
+
message: `Update available: ${import_picocolors4.default.yellow(`v${version}`)} \u2192 ${import_picocolors4.default.green(`v${latest}`)}`,
|
|
22611
22781
|
options: [
|
|
22612
22782
|
{
|
|
22613
22783
|
value: "update",
|
|
@@ -22636,14 +22806,14 @@ async function runGlobal(opts) {
|
|
|
22636
22806
|
const updateStartedAt = performance.now();
|
|
22637
22807
|
try {
|
|
22638
22808
|
await runShellCommand(cmd);
|
|
22639
|
-
updateSpinner.stop(
|
|
22809
|
+
updateSpinner.stop(import_picocolors4.default.green(`Updated to v${latest}.`));
|
|
22640
22810
|
version = getGloballyInstalledVersion() ?? getInstalledVersion() ?? version;
|
|
22641
22811
|
await tel.trackPackageAction("init_triggered_update", updateStartedAt, true);
|
|
22642
22812
|
reportSkillRefresh(resolveProjectRoot2(process.cwd()), "installer_skills_refresh");
|
|
22643
22813
|
} catch (err) {
|
|
22644
|
-
updateSpinner.stop(
|
|
22814
|
+
updateSpinner.stop(import_picocolors4.default.red("Update failed."));
|
|
22645
22815
|
log.error(`${err}`);
|
|
22646
|
-
log.info(`You can update manually later: ${
|
|
22816
|
+
log.info(`You can update manually later: ${import_picocolors4.default.cyan(cmdStr)}`);
|
|
22647
22817
|
await tel.trackPackageAction(
|
|
22648
22818
|
"update_failed",
|
|
22649
22819
|
updateStartedAt,
|
|
@@ -22667,7 +22837,7 @@ async function runGlobal(opts) {
|
|
|
22667
22837
|
}
|
|
22668
22838
|
|
|
22669
22839
|
// ../argent-installer/src/init-adapters.ts
|
|
22670
|
-
var
|
|
22840
|
+
var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
22671
22841
|
function previouslyConfiguredAdapters(eligible, installMode) {
|
|
22672
22842
|
const wantedScope = installMode === "local" ? "project" : "global";
|
|
22673
22843
|
const scopes = findConfiguredAdapterScopes(eligible, process.cwd());
|
|
@@ -22681,7 +22851,7 @@ async function chooseAdapters(opts) {
|
|
|
22681
22851
|
if (globalOnly.length > 0) {
|
|
22682
22852
|
eligible = ALL_ADAPTERS.filter((a2) => a2.projectPath(process.cwd()) != null);
|
|
22683
22853
|
log.info(
|
|
22684
|
-
|
|
22854
|
+
import_picocolors5.default.dim(
|
|
22685
22855
|
`Local mode configures project files only \u2014 ${globalOnly.map((a2) => a2.name).join(", ")} (global-only config) not offered.`
|
|
22686
22856
|
)
|
|
22687
22857
|
);
|
|
@@ -22702,9 +22872,9 @@ async function chooseAdapters(opts) {
|
|
|
22702
22872
|
const hasProject = a2.projectPath(process.cwd()) != null;
|
|
22703
22873
|
const hasGlobal = a2.globalPath() != null;
|
|
22704
22874
|
if (!hasProject && hasGlobal) {
|
|
22705
|
-
parts.push(
|
|
22875
|
+
parts.push(import_picocolors5.default.italic(import_picocolors5.default.cyan(`\u24D8 will be installed into ${a2.name}'s global config`)));
|
|
22706
22876
|
} else if (hasProject && !hasGlobal) {
|
|
22707
|
-
parts.push(
|
|
22877
|
+
parts.push(import_picocolors5.default.italic(import_picocolors5.default.cyan(`\u24D8 will be installed into ${a2.name}'s project config`)));
|
|
22708
22878
|
}
|
|
22709
22879
|
return {
|
|
22710
22880
|
value: a2,
|
|
@@ -22712,7 +22882,7 @@ async function chooseAdapters(opts) {
|
|
|
22712
22882
|
hint: parts.length > 0 ? parts.join(", ") : void 0
|
|
22713
22883
|
};
|
|
22714
22884
|
});
|
|
22715
|
-
log.message(
|
|
22885
|
+
log.message(import_picocolors5.default.dim(" Use arrow keys to move, space to toggle, enter to confirm."));
|
|
22716
22886
|
const selected = await multiselect({
|
|
22717
22887
|
message: "Which editors should Argent be configured for?",
|
|
22718
22888
|
options: choices,
|
|
@@ -22724,7 +22894,7 @@ async function chooseAdapters(opts) {
|
|
|
22724
22894
|
}
|
|
22725
22895
|
|
|
22726
22896
|
// ../argent-installer/src/init-scope.ts
|
|
22727
|
-
var
|
|
22897
|
+
var import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
22728
22898
|
import { existsSync as existsSync13 } from "node:fs";
|
|
22729
22899
|
import { resolve as resolve11 } from "node:path";
|
|
22730
22900
|
async function chooseScope(opts) {
|
|
@@ -22734,7 +22904,7 @@ async function chooseScope(opts) {
|
|
|
22734
22904
|
if (opts.nonInteractive) {
|
|
22735
22905
|
return { scope: "local" };
|
|
22736
22906
|
}
|
|
22737
|
-
log.message(
|
|
22907
|
+
log.message(import_picocolors6.default.dim(" Use arrow keys to move, enter to confirm."));
|
|
22738
22908
|
const scopeChoice = await select({
|
|
22739
22909
|
message: "Install MCP server globally or locally?",
|
|
22740
22910
|
options: [
|
|
@@ -22773,7 +22943,7 @@ async function chooseScope(opts) {
|
|
|
22773
22943
|
}
|
|
22774
22944
|
|
|
22775
22945
|
// ../argent-installer/src/init-mcp-write.ts
|
|
22776
|
-
var
|
|
22946
|
+
var import_picocolors7 = __toESM(require_picocolors(), 1);
|
|
22777
22947
|
function writeMcpConfigs(args) {
|
|
22778
22948
|
const { installMode, scope, effectiveRoot, projectRoot } = args;
|
|
22779
22949
|
let adapters = args.selectedAdapters;
|
|
@@ -22790,14 +22960,14 @@ function writeMcpConfigs(args) {
|
|
|
22790
22960
|
}
|
|
22791
22961
|
if (adapters.length === 0) {
|
|
22792
22962
|
log.warn(
|
|
22793
|
-
|
|
22794
|
-
`No MCP config was written: none of the selected editors supports a project-level config. Re-run ${
|
|
22963
|
+
import_picocolors7.default.yellow(
|
|
22964
|
+
`No MCP config was written: none of the selected editors supports a project-level config. Re-run ${import_picocolors7.default.cyan("argent init")} and select a different editor, or use ${import_picocolors7.default.cyan("argent init --global")}.`
|
|
22795
22965
|
)
|
|
22796
22966
|
);
|
|
22797
22967
|
}
|
|
22798
22968
|
if (localCmdMode.kind === "local-npx") {
|
|
22799
22969
|
log.warn(
|
|
22800
|
-
`Could not resolve a project-local argent binary; committing ${
|
|
22970
|
+
`Could not resolve a project-local argent binary; committing ${import_picocolors7.default.cyan("npx --no-install argent mcp")}. Run ${import_picocolors7.default.cyan("npm install")} so it resolves.`
|
|
22801
22971
|
);
|
|
22802
22972
|
}
|
|
22803
22973
|
}
|
|
@@ -22822,51 +22992,51 @@ function writeMcpConfigs(args) {
|
|
|
22822
22992
|
const fallback = adapter.projectPath(projectRoot);
|
|
22823
22993
|
if (keepsCommittedLocalEntry(adapter, fallback, projectRoot)) {
|
|
22824
22994
|
lines.push(
|
|
22825
|
-
`${
|
|
22995
|
+
`${import_picocolors7.default.yellow("!")} ${adapter.name} kept the committed local-mode entry ${import_picocolors7.default.dim(fallback)}`
|
|
22826
22996
|
);
|
|
22827
22997
|
continue;
|
|
22828
22998
|
}
|
|
22829
22999
|
try {
|
|
22830
23000
|
adapter.write(fallback, entryFor("local"));
|
|
22831
|
-
lines.push(`${
|
|
23001
|
+
lines.push(`${import_picocolors7.default.green("+")} ${adapter.name} ${import_picocolors7.default.dim(`(local fallback: ${fallback})`)}`);
|
|
22832
23002
|
} catch (err) {
|
|
22833
|
-
lines.push(`${
|
|
23003
|
+
lines.push(`${import_picocolors7.default.red("x")} ${adapter.name}: ${import_picocolors7.default.dim(String(err))}`);
|
|
22834
23004
|
}
|
|
22835
23005
|
} else if (scope !== "global" && adapter.globalPath()) {
|
|
22836
23006
|
const fallback = adapter.globalPath();
|
|
22837
23007
|
try {
|
|
22838
23008
|
adapter.write(fallback, entryFor("global"));
|
|
22839
23009
|
lines.push(
|
|
22840
|
-
`${
|
|
23010
|
+
`${import_picocolors7.default.green("+")} ${adapter.name} ${import_picocolors7.default.dim(`(global fallback: ${fallback})`)}`
|
|
22841
23011
|
);
|
|
22842
23012
|
} catch (err) {
|
|
22843
|
-
lines.push(`${
|
|
23013
|
+
lines.push(`${import_picocolors7.default.red("x")} ${adapter.name}: ${import_picocolors7.default.dim(String(err))}`);
|
|
22844
23014
|
}
|
|
22845
23015
|
} else {
|
|
22846
23016
|
lines.push(
|
|
22847
|
-
`${
|
|
23017
|
+
`${import_picocolors7.default.yellow("-")} ${adapter.name} ${import_picocolors7.default.dim("(no config path for this scope)")}`
|
|
22848
23018
|
);
|
|
22849
23019
|
}
|
|
22850
23020
|
continue;
|
|
22851
23021
|
}
|
|
22852
23022
|
if (scope !== "global" && keepsCommittedLocalEntry(adapter, configPath, effectiveRoot)) {
|
|
22853
23023
|
lines.push(
|
|
22854
|
-
`${
|
|
23024
|
+
`${import_picocolors7.default.yellow("!")} ${adapter.name} kept the committed local-mode entry ${import_picocolors7.default.dim(configPath)}`
|
|
22855
23025
|
);
|
|
22856
23026
|
continue;
|
|
22857
23027
|
}
|
|
22858
23028
|
try {
|
|
22859
23029
|
adapter.write(configPath, entryFor(normalizedScope));
|
|
22860
|
-
lines.push(`${
|
|
23030
|
+
lines.push(`${import_picocolors7.default.green("+")} ${adapter.name} ${import_picocolors7.default.dim(configPath)}`);
|
|
22861
23031
|
} catch (err) {
|
|
22862
|
-
lines.push(`${
|
|
23032
|
+
lines.push(`${import_picocolors7.default.red("x")} ${adapter.name}: ${import_picocolors7.default.dim(String(err))}`);
|
|
22863
23033
|
}
|
|
22864
23034
|
}
|
|
22865
23035
|
return { adapters, lines };
|
|
22866
23036
|
}
|
|
22867
23037
|
|
|
22868
23038
|
// ../argent-installer/src/init-stale-config.ts
|
|
22869
|
-
var
|
|
23039
|
+
var import_picocolors8 = __toESM(require_picocolors(), 1);
|
|
22870
23040
|
async function cleanupStaleMcpConfigs(args) {
|
|
22871
23041
|
const { writtenAdapters, detectedAdapters, installMode, scope, effectiveRoot } = args;
|
|
22872
23042
|
const lines = [];
|
|
@@ -22876,11 +23046,11 @@ async function cleanupStaleMcpConfigs(args) {
|
|
|
22876
23046
|
const isProvablyDead = (entry) => entry !== null && entry.command === MCP_BINARY_NAME && !globalArgentOnPath && !hasCustomizingEnv(entry);
|
|
22877
23047
|
const removed = (adapterName, location, what) => {
|
|
22878
23048
|
removedCount += 1;
|
|
22879
|
-
lines.push(`${
|
|
23049
|
+
lines.push(`${import_picocolors8.default.green("+")} ${adapterName}: removed ${what} ${import_picocolors8.default.dim(`(${location})`)}`);
|
|
22880
23050
|
};
|
|
22881
23051
|
const warned = (adapterName, location, why) => {
|
|
22882
23052
|
warnedCount += 1;
|
|
22883
|
-
lines.push(`${
|
|
23053
|
+
lines.push(`${import_picocolors8.default.yellow("!")} ${adapterName}: ${why} ${import_picocolors8.default.dim(`(${location})`)}`);
|
|
22884
23054
|
};
|
|
22885
23055
|
const pending = [];
|
|
22886
23056
|
for (const adapter of writtenAdapters) {
|
|
@@ -23008,7 +23178,7 @@ async function cleanupStaleMcpConfigs(args) {
|
|
|
23008
23178
|
}
|
|
23009
23179
|
|
|
23010
23180
|
// ../argent-installer/src/init-allowlist.ts
|
|
23011
|
-
var
|
|
23181
|
+
var import_picocolors9 = __toESM(require_picocolors(), 1);
|
|
23012
23182
|
async function configureAllowlist(args) {
|
|
23013
23183
|
const { adapters, effectiveRoot, scope, nonInteractive } = args;
|
|
23014
23184
|
const adaptersWithAllowlist = adapters.filter((a2) => a2.addAllowlist);
|
|
@@ -23018,12 +23188,12 @@ async function configureAllowlist(args) {
|
|
|
23018
23188
|
log.info(
|
|
23019
23189
|
`By default, editors ask for confirmation before running each MCP tool.
|
|
23020
23190
|
Adding Argent to the auto-approve allowlist lets tools run without
|
|
23021
|
-
repeated prompts. This is ${
|
|
23191
|
+
repeated prompts. This is ${import_picocolors9.default.cyan("recommended")} for a smooth experience.`
|
|
23022
23192
|
);
|
|
23023
23193
|
if (nonInteractive) {
|
|
23024
23194
|
enabled = true;
|
|
23025
23195
|
} else {
|
|
23026
|
-
log.message(
|
|
23196
|
+
log.message(import_picocolors9.default.dim(" Press y for yes, n for no, enter to confirm."));
|
|
23027
23197
|
const allowlistChoice = await confirm({
|
|
23028
23198
|
message: "Add Argent tools to editor auto-approve lists? - recommended",
|
|
23029
23199
|
initialValue: true
|
|
@@ -23037,39 +23207,39 @@ async function configureAllowlist(args) {
|
|
|
23037
23207
|
for (const adapter of adaptersWithAllowlist) {
|
|
23038
23208
|
const hasPath = scope === "global" ? adapter.globalPath() : adapter.projectPath(effectiveRoot);
|
|
23039
23209
|
if (!hasPath) {
|
|
23040
|
-
lines.push(`${
|
|
23210
|
+
lines.push(`${import_picocolors9.default.yellow("-")} ${adapter.name} ${import_picocolors9.default.dim("(no config for this scope)")}`);
|
|
23041
23211
|
continue;
|
|
23042
23212
|
}
|
|
23043
23213
|
try {
|
|
23044
23214
|
adapter.addAllowlist(effectiveRoot, scope);
|
|
23045
|
-
lines.push(`${
|
|
23215
|
+
lines.push(`${import_picocolors9.default.green("+")} ${adapter.name}`);
|
|
23046
23216
|
} catch (err) {
|
|
23047
|
-
lines.push(`${
|
|
23217
|
+
lines.push(`${import_picocolors9.default.red("x")} ${adapter.name}: ${import_picocolors9.default.dim(String(err))}`);
|
|
23048
23218
|
}
|
|
23049
23219
|
}
|
|
23050
23220
|
for (const adapter of adaptersWithoutAllowlist) {
|
|
23051
23221
|
lines.push(
|
|
23052
|
-
`${
|
|
23222
|
+
`${import_picocolors9.default.yellow("-")} ${adapter.name} ${import_picocolors9.default.dim("(no auto-approve API - configure manually)")}`
|
|
23053
23223
|
);
|
|
23054
23224
|
}
|
|
23055
23225
|
return { enabled, lines };
|
|
23056
23226
|
}
|
|
23057
23227
|
|
|
23058
23228
|
// ../argent-installer/src/init-skills.ts
|
|
23059
|
-
var
|
|
23229
|
+
var import_picocolors10 = __toESM(require_picocolors(), 1);
|
|
23060
23230
|
import { spawn as spawn3 } from "node:child_process";
|
|
23061
23231
|
import * as os3 from "node:os";
|
|
23062
23232
|
async function runSkillsStep(args) {
|
|
23063
23233
|
const { nonInteractive, fromTar, version, scope, customRoot } = args;
|
|
23064
|
-
log.step(
|
|
23065
|
-
log.warn(
|
|
23234
|
+
log.step(import_picocolors10.default.bold("Step 2: Skills Installation"));
|
|
23235
|
+
log.warn(import_picocolors10.default.yellow("Skills installation is required for Argent to function properly."));
|
|
23066
23236
|
let skillsMethod;
|
|
23067
23237
|
const online = await isOnline();
|
|
23068
23238
|
const offlineWithCache = !online && isSkillsCliAvailable();
|
|
23069
23239
|
const skillsCliReady = online || offlineWithCache;
|
|
23070
23240
|
if (!skillsCliReady) {
|
|
23071
23241
|
log.warn(
|
|
23072
|
-
|
|
23242
|
+
import_picocolors10.default.yellow("You appear to be offline. ") + "Automatic skills installation requires a network connection."
|
|
23073
23243
|
);
|
|
23074
23244
|
}
|
|
23075
23245
|
if (!skillsCliReady) {
|
|
@@ -23077,7 +23247,7 @@ async function runSkillsStep(args) {
|
|
|
23077
23247
|
} else if (nonInteractive) {
|
|
23078
23248
|
skillsMethod = "default";
|
|
23079
23249
|
} else {
|
|
23080
|
-
log.message(
|
|
23250
|
+
log.message(import_picocolors10.default.dim(" Use arrow keys to move, enter to confirm."));
|
|
23081
23251
|
const choice = await select({
|
|
23082
23252
|
message: "How would you like to install skills?",
|
|
23083
23253
|
options: [
|
|
@@ -23108,17 +23278,17 @@ async function runSkillsStep(args) {
|
|
|
23108
23278
|
note(
|
|
23109
23279
|
[
|
|
23110
23280
|
`Skills are bundled at:`,
|
|
23111
|
-
` ${
|
|
23281
|
+
` ${import_picocolors10.default.cyan(SKILLS_DIR)}`,
|
|
23112
23282
|
``,
|
|
23113
23283
|
`To install manually, copy them to your editor's skills directory:`,
|
|
23114
23284
|
``,
|
|
23115
|
-
` ${
|
|
23285
|
+
` ${import_picocolors10.default.dim("# Claude Code")}`,
|
|
23116
23286
|
` cp -r ${SKILLS_DIR}/* ${scope === "global" ? "~/.claude/skills/" : `${scope === "custom" ? customRoot : "."}/.claude/skills/`}`,
|
|
23117
23287
|
``,
|
|
23118
|
-
` ${
|
|
23288
|
+
` ${import_picocolors10.default.dim("# Cursor")}`,
|
|
23119
23289
|
` cp -r ${SKILLS_DIR}/* ${scope === "global" ? "~/.cursor/skills/" : `${scope === "custom" ? customRoot : "."}/.cursor/skills/`}`,
|
|
23120
23290
|
``,
|
|
23121
|
-
` ${
|
|
23291
|
+
` ${import_picocolors10.default.dim("# Or use npx skills directly:")}`,
|
|
23122
23292
|
` npx skills add ${skillsSource}`
|
|
23123
23293
|
].join("\n"),
|
|
23124
23294
|
"Manual Skills Installation"
|
|
@@ -23134,7 +23304,7 @@ async function runSkillsStep(args) {
|
|
|
23134
23304
|
}
|
|
23135
23305
|
const baseArgs = offlineWithCache ? ["--no-install", ...skillsArgs] : skillsArgs;
|
|
23136
23306
|
const npxArgs = withNpmForce(baseArgs);
|
|
23137
|
-
log.info(`Running: ${
|
|
23307
|
+
log.info(`Running: ${import_picocolors10.default.dim("npx")} ${import_picocolors10.default.cyan(baseArgs.join(" "))}`);
|
|
23138
23308
|
const spinner2 = spinner();
|
|
23139
23309
|
if (skillsMethod === "default") {
|
|
23140
23310
|
spinner2.start("Installing skills...");
|
|
@@ -23170,12 +23340,12 @@ async function runSkillsStep(args) {
|
|
|
23170
23340
|
}
|
|
23171
23341
|
for (const name of pruneLegacySkillDirs(pruneRoot, pruneScope)) removed.add(name);
|
|
23172
23342
|
if (removed.size > 0) {
|
|
23173
|
-
log.info(
|
|
23343
|
+
log.info(import_picocolors10.default.dim(`Removed legacy skills: ${[...removed].sort().join(", ")}`));
|
|
23174
23344
|
}
|
|
23175
23345
|
}
|
|
23176
23346
|
} catch (err) {
|
|
23177
23347
|
if (skillsMethod === "default") {
|
|
23178
|
-
spinner2.stop(
|
|
23348
|
+
spinner2.stop(import_picocolors10.default.red("Skills installation failed."));
|
|
23179
23349
|
}
|
|
23180
23350
|
log.error(`Failed to run npx skills: ${err}`);
|
|
23181
23351
|
log.info(`You can install skills manually:
|
|
@@ -23230,9 +23400,9 @@ async function init2(args) {
|
|
|
23230
23400
|
const tel = new InitTelemetry(initStartTime);
|
|
23231
23401
|
try {
|
|
23232
23402
|
printBanner();
|
|
23233
|
-
intro(
|
|
23403
|
+
intro(import_picocolors11.default.bgCyan(import_picocolors11.default.black(" argent init ")));
|
|
23234
23404
|
let version = getInstalledVersion() ?? "unknown";
|
|
23235
|
-
log.info(`${
|
|
23405
|
+
log.info(`${import_picocolors11.default.dim("Package:")} ${PACKAGE_NAME}@${version}`);
|
|
23236
23406
|
const consent = await resolveTelemetryConsent({
|
|
23237
23407
|
nonInteractive: parsed.nonInteractive,
|
|
23238
23408
|
disableFlag: parsed.noTelemetry
|
|
@@ -23272,7 +23442,7 @@ async function init2(args) {
|
|
|
23272
23442
|
writeConsentFlag(false, "project", { cwd: initProjectRoot });
|
|
23273
23443
|
wroteProjectTelemetryOptOut = true;
|
|
23274
23444
|
log.info(
|
|
23275
|
-
`${
|
|
23445
|
+
`${import_picocolors11.default.bold("Telemetry")} ${import_picocolors11.default.dim("also disabled for this project \u2014")} ${import_picocolors11.default.cyan(".argent/config.json")} ${import_picocolors11.default.dim("(commit it so the opt-out applies to every clone).")}`
|
|
23276
23446
|
);
|
|
23277
23447
|
} catch (err) {
|
|
23278
23448
|
log.warn(`Could not write the project telemetry opt-out: ${err}`);
|
|
@@ -23285,13 +23455,13 @@ async function init2(args) {
|
|
|
23285
23455
|
version,
|
|
23286
23456
|
tel
|
|
23287
23457
|
});
|
|
23288
|
-
log.step(
|
|
23458
|
+
log.step(import_picocolors11.default.bold("Step 1: MCP Server Configuration"));
|
|
23289
23459
|
const { selected: selectedAdapters, detected } = await chooseAdapters({
|
|
23290
23460
|
nonInteractive: parsed.nonInteractive,
|
|
23291
23461
|
installMode: tel.installMode
|
|
23292
23462
|
});
|
|
23293
23463
|
tel.editorsConfiguredCount = selectedAdapters.length;
|
|
23294
|
-
log.info(`Editors: ${selectedAdapters.map((a2) =>
|
|
23464
|
+
log.info(`Editors: ${selectedAdapters.map((a2) => import_picocolors11.default.cyan(a2.name)).join(", ")}`);
|
|
23295
23465
|
const { scope, customRoot } = await chooseScope({
|
|
23296
23466
|
installMode: tel.installMode,
|
|
23297
23467
|
nonInteractive: parsed.nonInteractive
|
|
@@ -23330,7 +23500,7 @@ async function init2(args) {
|
|
|
23330
23500
|
log.warn(
|
|
23331
23501
|
`Dead argent entries from a previous global install were found in
|
|
23332
23502
|
global (cross-project) config files:
|
|
23333
|
-
` + items.map((item) => ` ${
|
|
23503
|
+
` + items.map((item) => ` ${import_picocolors11.default.cyan(item)}`).join("\n")
|
|
23334
23504
|
);
|
|
23335
23505
|
const choice = await confirm({
|
|
23336
23506
|
message: "Remove these dead global entries? - recommended",
|
|
@@ -23360,13 +23530,13 @@ async function init2(args) {
|
|
|
23360
23530
|
if (isDeclaredLocally(effectiveRoot)) {
|
|
23361
23531
|
if (readInstallRecord(effectiveRoot)) {
|
|
23362
23532
|
log.info(
|
|
23363
|
-
|
|
23364
|
-
`Kept .argent/install.json \u2014 this project still declares ${PACKAGE_NAME} as a devDependency, so it stays in local mode. To fully convert to a global install, run ${
|
|
23533
|
+
import_picocolors11.default.dim(
|
|
23534
|
+
`Kept .argent/install.json \u2014 this project still declares ${PACKAGE_NAME} as a devDependency, so it stays in local mode. To fully convert to a global install, run ${import_picocolors11.default.cyan("argent uninstall --local")} first, then re-run ${import_picocolors11.default.cyan("argent init --global")}.`
|
|
23365
23535
|
)
|
|
23366
23536
|
);
|
|
23367
23537
|
}
|
|
23368
23538
|
} else if (removeInstallRecord(effectiveRoot)) {
|
|
23369
|
-
log.info(
|
|
23539
|
+
log.info(import_picocolors11.default.dim("Removed stale .argent/install.json (previous local-mode marker)."));
|
|
23370
23540
|
}
|
|
23371
23541
|
}
|
|
23372
23542
|
writeCliRecord({ mode: tel.installMode, projectRoot, version });
|
|
@@ -23387,7 +23557,7 @@ async function init2(args) {
|
|
|
23387
23557
|
scope,
|
|
23388
23558
|
customRoot
|
|
23389
23559
|
});
|
|
23390
|
-
log.step(
|
|
23560
|
+
log.step(import_picocolors11.default.bold("Step 3: Rules & Agents"));
|
|
23391
23561
|
const copyResults = copyRulesAndAgents(
|
|
23392
23562
|
writtenAdapters,
|
|
23393
23563
|
effectiveRoot,
|
|
@@ -23398,8 +23568,17 @@ async function init2(args) {
|
|
|
23398
23568
|
if (copyResults.length > 0) {
|
|
23399
23569
|
note(copyResults.join("\n"), "Rules & Agents");
|
|
23400
23570
|
} else {
|
|
23401
|
-
log.info(
|
|
23402
|
-
}
|
|
23571
|
+
log.info(import_picocolors11.default.dim("No rules or agents to copy for selected editors."));
|
|
23572
|
+
}
|
|
23573
|
+
await reportRetiredFiles(
|
|
23574
|
+
findRetiredRulesAndAgents(
|
|
23575
|
+
[{ adapters: writtenAdapters, scope: normalizedScope }],
|
|
23576
|
+
effectiveRoot,
|
|
23577
|
+
RULES_DIR,
|
|
23578
|
+
AGENTS_DIR
|
|
23579
|
+
),
|
|
23580
|
+
!parsed.nonInteractive
|
|
23581
|
+
);
|
|
23403
23582
|
printSummary({
|
|
23404
23583
|
installMode: tel.installMode,
|
|
23405
23584
|
selectedAdapters: writtenAdapters,
|
|
@@ -23411,15 +23590,15 @@ async function init2(args) {
|
|
|
23411
23590
|
});
|
|
23412
23591
|
note(
|
|
23413
23592
|
[
|
|
23414
|
-
|
|
23593
|
+
import_picocolors11.default.bold(import_picocolors11.default.green("Argent is ready!")),
|
|
23415
23594
|
"",
|
|
23416
|
-
`${
|
|
23595
|
+
`${import_picocolors11.default.bold("Get started")} by asking your assistant:`,
|
|
23417
23596
|
"",
|
|
23418
|
-
` ${
|
|
23597
|
+
` ${import_picocolors11.default.bold(import_picocolors11.default.cyan(`"What can Argent do?"`))}`,
|
|
23419
23598
|
"",
|
|
23420
|
-
|
|
23599
|
+
import_picocolors11.default.dim("It will walk you through all capabilities available.")
|
|
23421
23600
|
].join("\n"),
|
|
23422
|
-
|
|
23601
|
+
import_picocolors11.default.bgGreen(import_picocolors11.default.black(" Get Started "))
|
|
23423
23602
|
);
|
|
23424
23603
|
outro("Done.");
|
|
23425
23604
|
tel.initSucceeded = true;
|
|
@@ -23449,25 +23628,25 @@ function printSummary({
|
|
|
23449
23628
|
wroteProjectTelemetryOptOut
|
|
23450
23629
|
}) {
|
|
23451
23630
|
const summaryLines = [
|
|
23452
|
-
`${
|
|
23453
|
-
selectedAdapters.length > 0 ? `${
|
|
23454
|
-
`${
|
|
23455
|
-
`${
|
|
23456
|
-
`${
|
|
23631
|
+
`${import_picocolors11.default.green("Install mode")} ${installMode === "local" ? "local (devDependency)" : "global"}`,
|
|
23632
|
+
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`,
|
|
23633
|
+
`${import_picocolors11.default.green("Auto-approve")} ${allowlistEnabled ? "enabled" : "skipped"}`,
|
|
23634
|
+
`${import_picocolors11.default.green("Skills")} ${skillsMethod === "manual" ? "instructions printed" : "installed"}`,
|
|
23635
|
+
`${import_picocolors11.default.green("Rules & agents")} ${copiedRules ? "copied" : "n/a"}`
|
|
23457
23636
|
];
|
|
23458
23637
|
note(summaryLines.join("\n"), "Summary");
|
|
23459
23638
|
if (installMode === "local") {
|
|
23460
23639
|
note(
|
|
23461
23640
|
[
|
|
23462
|
-
`Argent is installed as a ${
|
|
23641
|
+
`Argent is installed as a ${import_picocolors11.default.bold("devDependency")} of this project.`,
|
|
23463
23642
|
"",
|
|
23464
|
-
`${
|
|
23465
|
-
` ${
|
|
23643
|
+
`${import_picocolors11.default.bold("Commit")} so your team shares the same setup:`,
|
|
23644
|
+
` ${import_picocolors11.default.cyan("package.json")} + your lockfile`,
|
|
23466
23645
|
` the written MCP config (.mcp.json, .cursor/mcp.json, \u2026)`,
|
|
23467
|
-
` ${
|
|
23646
|
+
` ${import_picocolors11.default.cyan(".argent/install.json")}${wroteProjectTelemetryOptOut ? ` + ${import_picocolors11.default.cyan(".argent/config.json")}` : ""}, and the skills/rules/agents files`,
|
|
23468
23647
|
"",
|
|
23469
|
-
`Teammates then get argent on ${
|
|
23470
|
-
|
|
23648
|
+
`Teammates then get argent on ${import_picocolors11.default.cyan("npm install")} \u2014 no global install, no ${import_picocolors11.default.cyan("argent init")}.`,
|
|
23649
|
+
import_picocolors11.default.dim(
|
|
23471
23650
|
"Note: the bare `argent` command will not be on their PATH; the MCP config runs the local copy."
|
|
23472
23651
|
)
|
|
23473
23652
|
].join("\n"),
|
|
@@ -23490,14 +23669,14 @@ function printBanner() {
|
|
|
23490
23669
|
console.log(line);
|
|
23491
23670
|
}
|
|
23492
23671
|
const attribution = "by Software Mansion";
|
|
23493
|
-
console.log(" ".repeat(width - attribution.length) +
|
|
23672
|
+
console.log(" ".repeat(width - attribution.length) + import_picocolors11.default.dim(attribution));
|
|
23494
23673
|
console.log();
|
|
23495
23674
|
}
|
|
23496
23675
|
|
|
23497
23676
|
// ../argent-installer/src/update.ts
|
|
23498
|
-
var
|
|
23677
|
+
var import_picocolors12 = __toESM(require_picocolors(), 1);
|
|
23499
23678
|
var import_semver5 = __toESM(require_semver2(), 1);
|
|
23500
|
-
import * as
|
|
23679
|
+
import * as path27 from "node:path";
|
|
23501
23680
|
|
|
23502
23681
|
// ../argent-installer/src/install-targets.ts
|
|
23503
23682
|
function parseTargetFlags(args) {
|
|
@@ -23563,16 +23742,16 @@ async function resolveInstallableUpdateTarget(pm, current) {
|
|
|
23563
23742
|
// ../argent-tools-client/src/launcher.ts
|
|
23564
23743
|
import * as net from "node:net";
|
|
23565
23744
|
import * as fs20 from "node:fs";
|
|
23566
|
-
import * as
|
|
23745
|
+
import * as path22 from "node:path";
|
|
23567
23746
|
import * as readline from "node:readline";
|
|
23568
23747
|
import { homedir as homedir6 } from "node:os";
|
|
23569
23748
|
import { spawn as spawn4, execFileSync as execFileSync7 } from "node:child_process";
|
|
23570
|
-
import { createHash as
|
|
23749
|
+
import { createHash as createHash3, randomBytes } from "node:crypto";
|
|
23571
23750
|
import { mkdir, writeFile, readFile, readdir as readdir2, unlink, rename, chmod } from "node:fs/promises";
|
|
23572
|
-
var STATE_DIR =
|
|
23573
|
-
var STATE_FILE =
|
|
23574
|
-
var LOG_FILE =
|
|
23575
|
-
var LOCK_FILE =
|
|
23751
|
+
var STATE_DIR = path22.join(homedir6(), ".argent");
|
|
23752
|
+
var STATE_FILE = path22.join(STATE_DIR, "tool-server.json");
|
|
23753
|
+
var LOG_FILE = path22.join(STATE_DIR, "tool-server.log");
|
|
23754
|
+
var LOCK_FILE = path22.join(STATE_DIR, "tool-server.lock");
|
|
23576
23755
|
function isProcessAlive(pid) {
|
|
23577
23756
|
try {
|
|
23578
23757
|
process.kill(pid, 0);
|
|
@@ -23582,8 +23761,8 @@ function isProcessAlive(pid) {
|
|
|
23582
23761
|
}
|
|
23583
23762
|
}
|
|
23584
23763
|
function stateFileForBundle(bundlePath) {
|
|
23585
|
-
const key =
|
|
23586
|
-
return
|
|
23764
|
+
const key = createHash3("sha256").update(bundlePath).digest("hex").slice(0, 12);
|
|
23765
|
+
return path22.join(STATE_DIR, `tool-server-${key}.json`);
|
|
23587
23766
|
}
|
|
23588
23767
|
async function readStateFile(file) {
|
|
23589
23768
|
try {
|
|
@@ -23625,7 +23804,7 @@ async function readAllToolsServerStates() {
|
|
|
23625
23804
|
const out = [];
|
|
23626
23805
|
for (const name of names) {
|
|
23627
23806
|
if (!STATE_FILE_RE.test(name)) continue;
|
|
23628
|
-
const file =
|
|
23807
|
+
const file = path22.join(STATE_DIR, name);
|
|
23629
23808
|
const state2 = await readStateFile(file);
|
|
23630
23809
|
if (state2) out.push({ file, state: state2 });
|
|
23631
23810
|
}
|
|
@@ -23671,8 +23850,8 @@ async function killToolServer(bundlePath) {
|
|
|
23671
23850
|
return alive;
|
|
23672
23851
|
}
|
|
23673
23852
|
function isPathWithin(child, parent) {
|
|
23674
|
-
const rel =
|
|
23675
|
-
return rel !== "" && !rel.startsWith("..") && !
|
|
23853
|
+
const rel = path22.relative(parent, child);
|
|
23854
|
+
return rel !== "" && !rel.startsWith("..") && !path22.isAbsolute(rel);
|
|
23676
23855
|
}
|
|
23677
23856
|
function tryRealpath(p) {
|
|
23678
23857
|
try {
|
|
@@ -23682,10 +23861,10 @@ function tryRealpath(p) {
|
|
|
23682
23861
|
}
|
|
23683
23862
|
}
|
|
23684
23863
|
async function killToolServerForInstallDir(packageDir) {
|
|
23685
|
-
const parents = /* @__PURE__ */ new Set([
|
|
23864
|
+
const parents = /* @__PURE__ */ new Set([path22.resolve(packageDir), tryRealpath(packageDir)]);
|
|
23686
23865
|
let killed = 0;
|
|
23687
23866
|
for (const { file, state: state2 } of await readAllToolsServerStates()) {
|
|
23688
|
-
const bundles = /* @__PURE__ */ new Set([
|
|
23867
|
+
const bundles = /* @__PURE__ */ new Set([path22.resolve(state2.bundlePath), tryRealpath(state2.bundlePath)]);
|
|
23689
23868
|
const matches2 = [...bundles].some((b) => [...parents].some((p) => isPathWithin(b, p)));
|
|
23690
23869
|
if (!matches2) continue;
|
|
23691
23870
|
const fresh = await readStateFile(file);
|
|
@@ -23750,17 +23929,17 @@ function couldBeOurToolServer(pid, marker) {
|
|
|
23750
23929
|
var import_yaml4 = __toESM(require_dist2(), 1);
|
|
23751
23930
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
23752
23931
|
import { maxHeaderSize } from "node:http";
|
|
23753
|
-
import * as
|
|
23932
|
+
import * as path26 from "node:path";
|
|
23754
23933
|
|
|
23755
23934
|
// ../argent-tools-client/src/link-config.ts
|
|
23756
|
-
import * as
|
|
23935
|
+
import * as path23 from "node:path";
|
|
23757
23936
|
import { homedir as homedir7 } from "node:os";
|
|
23758
23937
|
import { mkdir as mkdir2, writeFile as writeFile2, readFile as readFile2, unlink as unlink2, chmod as chmod2 } from "node:fs/promises";
|
|
23759
|
-
var LINK_DIR =
|
|
23760
|
-
var LINK_FILE =
|
|
23938
|
+
var LINK_DIR = path23.join(homedir7(), ".argent");
|
|
23939
|
+
var LINK_FILE = path23.join(LINK_DIR, "link.json");
|
|
23761
23940
|
|
|
23762
23941
|
// ../argent-tools-client/src/file-inputs.ts
|
|
23763
|
-
import { createHash as
|
|
23942
|
+
import { createHash as createHash4, randomUUID as randomUUID6 } from "node:crypto";
|
|
23764
23943
|
import { createReadStream, rmSync as rmSync7 } from "node:fs";
|
|
23765
23944
|
import {
|
|
23766
23945
|
chmod as chmod3,
|
|
@@ -23774,12 +23953,12 @@ import {
|
|
|
23774
23953
|
writeFile as writeFile3
|
|
23775
23954
|
} from "node:fs/promises";
|
|
23776
23955
|
import { constants, tmpdir } from "node:os";
|
|
23777
|
-
import * as
|
|
23956
|
+
import * as path24 from "node:path";
|
|
23778
23957
|
|
|
23779
23958
|
// ../archive/src/index.ts
|
|
23780
23959
|
import { execFile } from "node:child_process";
|
|
23781
23960
|
import { rm, readdir as readdir3 } from "node:fs/promises";
|
|
23782
|
-
import { basename as basename4, dirname as dirname13, join as
|
|
23961
|
+
import { basename as basename4, dirname as dirname13, join as join23, posix as posix2, resolve as resolve13, sep as sep4 } from "node:path";
|
|
23783
23962
|
import { promisify } from "node:util";
|
|
23784
23963
|
var execFileAsync = promisify(execFile);
|
|
23785
23964
|
|
|
@@ -23789,15 +23968,15 @@ var MAX_CONTENT_BYTES = 32 * 1024 * 1024;
|
|
|
23789
23968
|
// ../argent-tools-client/src/flow-files.ts
|
|
23790
23969
|
var import_yaml3 = __toESM(require_dist2(), 1);
|
|
23791
23970
|
import { readdir as readdir4, readFile as readFile4, realpath as realpath3, stat as stat4 } from "node:fs/promises";
|
|
23792
|
-
import * as
|
|
23971
|
+
import * as path25 from "node:path";
|
|
23793
23972
|
var INLINE_MEMBERS_BYTES = 256 * 1024;
|
|
23794
23973
|
|
|
23795
23974
|
// ../argent-tools-client/src/artifacts.ts
|
|
23796
23975
|
import { copyFile, mkdir as mkdir4, readFile as readFile6, realpath as realpath4, rm as rm3, stat as stat5, writeFile as writeFile4 } from "node:fs/promises";
|
|
23797
23976
|
import { constants as fsConstants } from "node:fs";
|
|
23798
23977
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
23799
|
-
import { basename as basename7, dirname as dirname17, extname as extname2, isAbsolute as isAbsolute8, join as
|
|
23800
|
-
import { createHash as
|
|
23978
|
+
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";
|
|
23979
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
23801
23980
|
var ALLOWED_SAVE_DIRS = /* @__PURE__ */ new Set([normalize2(".argent/recordings")]);
|
|
23802
23981
|
var RECORDINGS_SAVE_DIR = normalize2(".argent/recordings");
|
|
23803
23982
|
var MAX_DURABLE_BYTES = 2 * 1024 * 1024 * 1024;
|
|
@@ -23912,10 +24091,10 @@ async function update(args) {
|
|
|
23912
24091
|
const applyUpdateForTarget = async (mode, projectRoot) => {
|
|
23913
24092
|
if (mode === "local") {
|
|
23914
24093
|
log.info(
|
|
23915
|
-
`Target: ${
|
|
24094
|
+
`Target: ${import_picocolors12.default.cyan("local install")} \u2014 this project's ${PACKAGE_NAME} devDependency ${import_picocolors12.default.dim(`(${projectRoot})`)}.`
|
|
23916
24095
|
);
|
|
23917
24096
|
} else {
|
|
23918
|
-
log.info(`Target: ${
|
|
24097
|
+
log.info(`Target: ${import_picocolors12.default.cyan("global install")} \u2014 the argent command on your PATH.`);
|
|
23919
24098
|
}
|
|
23920
24099
|
const localProbe = mode === "local" ? probeLocalInstall(projectRoot) : null;
|
|
23921
24100
|
const globallyInstalled = mode === "global" && isGloballyInstalled();
|
|
@@ -23936,7 +24115,7 @@ async function update(args) {
|
|
|
23936
24115
|
`${PACKAGE_NAME} is resolvable from this project but is not declared in its package.json.`
|
|
23937
24116
|
);
|
|
23938
24117
|
log.info(
|
|
23939
|
-
`A hoisted or transitive copy is not this project's install. Run ${
|
|
24118
|
+
`A hoisted or transitive copy is not this project's install. Run ${import_picocolors12.default.cyan("argent init --local")} to adopt it as a devDependency, or ${import_picocolors12.default.cyan("argent update --global")} for the global install.`
|
|
23940
24119
|
);
|
|
23941
24120
|
await trackPackageAction("no_update", updateStartTime, true);
|
|
23942
24121
|
return "noop";
|
|
@@ -23945,15 +24124,15 @@ async function update(args) {
|
|
|
23945
24124
|
log.warn(`${PACKAGE_NAME} is not installed in this project yet.`);
|
|
23946
24125
|
if (isDeclaredLocally(projectRoot)) {
|
|
23947
24126
|
log.info(
|
|
23948
|
-
`It is declared in package.json \u2014 run your package manager's install (e.g. ${
|
|
24127
|
+
`It is declared in package.json \u2014 run your package manager's install (e.g. ${import_picocolors12.default.cyan("npm install")}), then re-run ${import_picocolors12.default.cyan("argent update")}.`
|
|
23949
24128
|
);
|
|
23950
24129
|
} else if (hasProjectPackageJson(projectRoot)) {
|
|
23951
24130
|
log.info(
|
|
23952
|
-
`It is not a dependency of this project. Run ${
|
|
24131
|
+
`It is not a dependency of this project. Run ${import_picocolors12.default.cyan("argent init --local")} to add it, or ${import_picocolors12.default.cyan("argent update --global")} for the global install.`
|
|
23953
24132
|
);
|
|
23954
24133
|
} else {
|
|
23955
24134
|
log.info(
|
|
23956
|
-
`No package.json at ${
|
|
24135
|
+
`No package.json at ${import_picocolors12.default.cyan(projectRoot)}. Run ${import_picocolors12.default.cyan("argent init")} in the project directory, or remove ${import_picocolors12.default.cyan(".argent/install.json")}.`
|
|
23957
24136
|
);
|
|
23958
24137
|
}
|
|
23959
24138
|
await trackPackageAction("no_update", updateStartTime, true);
|
|
@@ -23977,7 +24156,7 @@ async function update(args) {
|
|
|
23977
24156
|
try {
|
|
23978
24157
|
resolved = await resolveInstallableUpdateTarget(pm, installed);
|
|
23979
24158
|
} catch (err) {
|
|
23980
|
-
spinner2.stop(
|
|
24159
|
+
spinner2.stop(import_picocolors12.default.red("Could not reach registry."));
|
|
23981
24160
|
await trackPackageAction(
|
|
23982
24161
|
"update_failed",
|
|
23983
24162
|
updateStartTime,
|
|
@@ -23988,7 +24167,7 @@ async function update(args) {
|
|
|
23988
24167
|
return { failed: UPDATE_REGISTRY_CHECK_FAILED };
|
|
23989
24168
|
}
|
|
23990
24169
|
if (resolved === null) {
|
|
23991
|
-
spinner2.stop(
|
|
24170
|
+
spinner2.stop(import_picocolors12.default.red("Could not reach registry."));
|
|
23992
24171
|
await trackPackageAction(
|
|
23993
24172
|
"update_failed",
|
|
23994
24173
|
updateStartTime,
|
|
@@ -24004,44 +24183,44 @@ async function update(args) {
|
|
|
24004
24183
|
}
|
|
24005
24184
|
spinner2.stop("Version check complete.");
|
|
24006
24185
|
if (installed) {
|
|
24007
|
-
log.info(`Installed: ${
|
|
24186
|
+
log.info(`Installed: ${import_picocolors12.default.cyan(`v${installed}`)}`);
|
|
24008
24187
|
} else if (isInstalledForMode) {
|
|
24009
|
-
log.info(`Installed: ${
|
|
24188
|
+
log.info(`Installed: ${import_picocolors12.default.cyan("version unknown")} ${import_picocolors12.default.dim("(Yarn PnP)")}`);
|
|
24010
24189
|
} else {
|
|
24011
24190
|
log.warn(
|
|
24012
24191
|
mode === "local" ? `${PACKAGE_NAME} is not installed in this project.` : `${PACKAGE_NAME} is not installed globally.`
|
|
24013
24192
|
);
|
|
24014
24193
|
}
|
|
24015
24194
|
if (latest) {
|
|
24016
|
-
log.info(`Latest: ${
|
|
24195
|
+
log.info(`Latest: ${import_picocolors12.default.cyan(`v${latest}`)}`);
|
|
24017
24196
|
}
|
|
24018
24197
|
if (target) {
|
|
24019
24198
|
const label = latest && latest !== target ? "Target: " : "Version: ";
|
|
24020
|
-
const suffix = latest && latest !== target ?
|
|
24021
|
-
log.info(`${label}${
|
|
24199
|
+
const suffix = latest && latest !== target ? import_picocolors12.default.dim(" (newest installable)") : "";
|
|
24200
|
+
log.info(`${label}${import_picocolors12.default.cyan(`v${target}`)}${suffix}`);
|
|
24022
24201
|
}
|
|
24023
24202
|
const versionUnknown = isInstalledForMode && installed === null;
|
|
24024
24203
|
const needsInstall = target !== null && (!isInstalledForMode || (versionUnknown ? requestedVersion !== null : !installed || isNewerVersion(target, installed)));
|
|
24025
24204
|
const latestIsNewer = latest !== null && (!installed || isNewerVersion(latest, installed));
|
|
24026
24205
|
if (needsInstall && target !== null) {
|
|
24027
24206
|
if (installed) {
|
|
24028
|
-
log.warn(`Update available: ${
|
|
24207
|
+
log.warn(`Update available: ${import_picocolors12.default.yellow(`v${installed}`)} -> ${import_picocolors12.default.green(`v${target}`)}`);
|
|
24029
24208
|
}
|
|
24030
24209
|
const cmd = mode === "local" ? localInstallCommand(pm, `${PACKAGE_NAME}@${target}`) : globalInstallCommand(pm, `${PACKAGE_NAME}@${target}`);
|
|
24031
24210
|
const cmdStr = formatShellCommand(cmd);
|
|
24032
24211
|
if (!nonInteractive) {
|
|
24033
|
-
log.message(
|
|
24212
|
+
log.message(import_picocolors12.default.dim(" Press y for yes, n for no, enter to confirm."));
|
|
24034
24213
|
const proceed = await confirm({
|
|
24035
24214
|
message: isInstalledForMode ? `Update to v${target}?` : mode === "local" ? `Add ${PACKAGE_NAME}@${target} to this project's devDependencies?` : `Install ${PACKAGE_NAME}@${target} globally?`,
|
|
24036
24215
|
initialValue: true
|
|
24037
24216
|
});
|
|
24038
24217
|
if (isCancel(proceed) || !proceed) {
|
|
24039
24218
|
await trackPackageAction("update_skipped", updateStartTime, true);
|
|
24040
|
-
log.info(
|
|
24219
|
+
log.info(import_picocolors12.default.dim(`Skipped the ${mode} install.`));
|
|
24041
24220
|
return "declined";
|
|
24042
24221
|
}
|
|
24043
24222
|
}
|
|
24044
|
-
log.info(`Running: ${
|
|
24223
|
+
log.info(`Running: ${import_picocolors12.default.dim(cmdStr)}`);
|
|
24045
24224
|
const installDirToStop = mode === "local" ? localProbe.packageDir : getGloballyInstalledPackageRoot();
|
|
24046
24225
|
try {
|
|
24047
24226
|
if (installDirToStop) {
|
|
@@ -24097,7 +24276,7 @@ async function update(args) {
|
|
|
24097
24276
|
return { failed: UPDATE_PACKAGE_ACTION_FAILED };
|
|
24098
24277
|
}
|
|
24099
24278
|
log.warn(
|
|
24100
|
-
|
|
24279
|
+
import_picocolors12.default.dim(
|
|
24101
24280
|
`Your package manager exited non-zero but ${PACKAGE_NAME}@${landedVersion} is installed \u2014 continuing.`
|
|
24102
24281
|
)
|
|
24103
24282
|
);
|
|
@@ -24119,11 +24298,11 @@ async function update(args) {
|
|
|
24119
24298
|
await trackPackageAction("no_update", updateStartTime, true);
|
|
24120
24299
|
if (versionUnknown) {
|
|
24121
24300
|
log.warn(
|
|
24122
|
-
`Could not determine the installed version (Yarn PnP). Pass ${
|
|
24301
|
+
`Could not determine the installed version (Yarn PnP). Pass ${import_picocolors12.default.cyan("--version <x.y.z>")} to update to a specific version.`
|
|
24123
24302
|
);
|
|
24124
24303
|
} else if (latest && target === null && latestIsNewer && minReleaseAgeMs > 0) {
|
|
24125
24304
|
log.warn(
|
|
24126
|
-
`Latest version ${
|
|
24305
|
+
`Latest version ${import_picocolors12.default.cyan(`v${latest}`)} is still held by your minimum-release-age policy.`
|
|
24127
24306
|
);
|
|
24128
24307
|
log.info("No installable update is available yet.");
|
|
24129
24308
|
} else if (latest && target && latest !== target) {
|
|
@@ -24139,7 +24318,7 @@ async function update(args) {
|
|
|
24139
24318
|
return "noop";
|
|
24140
24319
|
};
|
|
24141
24320
|
try {
|
|
24142
|
-
intro(
|
|
24321
|
+
intro(import_picocolors12.default.bgCyan(import_picocolors12.default.black(" argent update ")));
|
|
24143
24322
|
await resolveTelemetryConsent({ nonInteractive: true, disableFlag: noTelemetry });
|
|
24144
24323
|
warmTelemetryIdentitySync();
|
|
24145
24324
|
track("installation:cli_update_start", {});
|
|
@@ -24155,7 +24334,7 @@ async function update(args) {
|
|
|
24155
24334
|
process.exit(1);
|
|
24156
24335
|
}
|
|
24157
24336
|
const rootOverride = getProjectRootOverride(args);
|
|
24158
|
-
const projectRoot = rootOverride ?
|
|
24337
|
+
const projectRoot = rootOverride ? path27.resolve(rootOverride) : resolveProjectRoot2(process.cwd());
|
|
24159
24338
|
installMode = resolveInstallMode(projectRoot);
|
|
24160
24339
|
const flags = parseTargetFlags(args);
|
|
24161
24340
|
const localInstalled = installMode === "local" && probeLocalInstall(projectRoot).installed;
|
|
@@ -24163,7 +24342,7 @@ async function update(args) {
|
|
|
24163
24342
|
const defaultTarget = localInstalled ? "local" : globalInstalled ? "global" : installMode;
|
|
24164
24343
|
if (installMode === "local" && !localInstalled && !flags.local) {
|
|
24165
24344
|
log.warn(
|
|
24166
|
-
`${PACKAGE_NAME} is declared for this project but not installed \u2014 run your package manager's install, or ${
|
|
24345
|
+
`${PACKAGE_NAME} is declared for this project but not installed \u2014 run your package manager's install, or ${import_picocolors12.default.cyan("argent update --local")} for guidance.`
|
|
24167
24346
|
);
|
|
24168
24347
|
}
|
|
24169
24348
|
const decision = decideInstallTargets({
|
|
@@ -24187,7 +24366,7 @@ async function update(args) {
|
|
|
24187
24366
|
targets = decision.targets;
|
|
24188
24367
|
if (decision.reason === "noninteractive-both") {
|
|
24189
24368
|
log.info(
|
|
24190
|
-
|
|
24369
|
+
import_picocolors12.default.dim(
|
|
24191
24370
|
"Both a global and a project-local install were found; updating both (pass --global or --local to narrow)."
|
|
24192
24371
|
)
|
|
24193
24372
|
);
|
|
@@ -24215,7 +24394,7 @@ async function update(args) {
|
|
|
24215
24394
|
}
|
|
24216
24395
|
if (firstFailure && !outcomes.includes("updated")) {
|
|
24217
24396
|
await failUpdateTelemetry(firstFailure);
|
|
24218
|
-
outro(
|
|
24397
|
+
outro(import_picocolors12.default.red("Update failed."));
|
|
24219
24398
|
process.exit(1);
|
|
24220
24399
|
}
|
|
24221
24400
|
{
|
|
@@ -24243,19 +24422,19 @@ async function update(args) {
|
|
|
24243
24422
|
const isUnreadableSentinel = existing !== null && existing.command === "" && existing.args.length === 0;
|
|
24244
24423
|
if (existing !== null && !isUnreadableSentinel && !isArgentManagedEntry(existing)) {
|
|
24245
24424
|
results.push(
|
|
24246
|
-
`${
|
|
24425
|
+
`${import_picocolors12.default.yellow("!")} ${adapter.name} left a customized entry untouched ${import_picocolors12.default.dim(configPath)}`
|
|
24247
24426
|
);
|
|
24248
24427
|
continue;
|
|
24249
24428
|
}
|
|
24250
24429
|
try {
|
|
24251
24430
|
adapter.write(configPath, entryFor(normScope));
|
|
24252
|
-
results.push(`${
|
|
24431
|
+
results.push(`${import_picocolors12.default.green("+")} ${adapter.name} ${import_picocolors12.default.dim(configPath)}`);
|
|
24253
24432
|
} catch {
|
|
24254
24433
|
}
|
|
24255
24434
|
}
|
|
24256
24435
|
if (skipEntryRewrite && configuredScopes.some(({ scope }) => scope === "project")) {
|
|
24257
24436
|
log.info(
|
|
24258
|
-
|
|
24437
|
+
import_picocolors12.default.dim(
|
|
24259
24438
|
"Left project MCP entries unchanged \u2014 the repo-local argent binary can't be resolved right now (fresh checkout: run your package manager's install; after an out-of-band version bump, just re-run argent update)."
|
|
24260
24439
|
)
|
|
24261
24440
|
);
|
|
@@ -24281,7 +24460,7 @@ async function update(args) {
|
|
|
24281
24460
|
spinner2.stop("Configuration refreshed.");
|
|
24282
24461
|
if (allowlistDisabled) {
|
|
24283
24462
|
log.info(
|
|
24284
|
-
|
|
24463
|
+
import_picocolors12.default.dim("Left editor auto-approve allowlists alone (allowlist.enabled is false).")
|
|
24285
24464
|
);
|
|
24286
24465
|
}
|
|
24287
24466
|
if (results.length > 0) {
|
|
@@ -24301,7 +24480,7 @@ async function update(args) {
|
|
|
24301
24480
|
log.warn(
|
|
24302
24481
|
`Dead argent entries from a previous global install were found in
|
|
24303
24482
|
global (cross-project) config files:
|
|
24304
|
-
` + items.map((item) => ` ${
|
|
24483
|
+
` + items.map((item) => ` ${import_picocolors12.default.cyan(item)}`).join("\n")
|
|
24305
24484
|
);
|
|
24306
24485
|
const choice = await confirm({
|
|
24307
24486
|
message: "Remove these dead global entries? - recommended",
|
|
@@ -24320,15 +24499,27 @@ async function update(args) {
|
|
|
24320
24499
|
if (ruleResults.length > 0) {
|
|
24321
24500
|
note(ruleResults.join("\n"), "Rules & Agents Updated");
|
|
24322
24501
|
}
|
|
24502
|
+
await reportRetiredFiles(
|
|
24503
|
+
findRetiredRulesAndAgents(
|
|
24504
|
+
[
|
|
24505
|
+
{ adapters: globalAdapters, scope: "global" },
|
|
24506
|
+
{ adapters: localAdapters, scope: "local" }
|
|
24507
|
+
],
|
|
24508
|
+
projectRoot,
|
|
24509
|
+
RULES_DIR,
|
|
24510
|
+
AGENTS_DIR
|
|
24511
|
+
),
|
|
24512
|
+
!nonInteractive
|
|
24513
|
+
);
|
|
24323
24514
|
reportSkillRefresh(projectRoot, "installer_update_skills_refresh");
|
|
24324
24515
|
}
|
|
24325
24516
|
if (firstFailure) {
|
|
24326
24517
|
await failUpdateTelemetry(firstFailure);
|
|
24327
|
-
outro(
|
|
24518
|
+
outro(import_picocolors12.default.yellow("Update finished with errors \u2014 see above."));
|
|
24328
24519
|
process.exit(1);
|
|
24329
24520
|
}
|
|
24330
24521
|
await completeUpdateTelemetry();
|
|
24331
|
-
outro(
|
|
24522
|
+
outro(import_picocolors12.default.green("Update complete."));
|
|
24332
24523
|
} catch (err) {
|
|
24333
24524
|
await failUpdateTelemetry(UPDATE_UNCLASSIFIED_FAILED);
|
|
24334
24525
|
throw err;
|
|
@@ -24336,10 +24527,10 @@ async function update(args) {
|
|
|
24336
24527
|
}
|
|
24337
24528
|
|
|
24338
24529
|
// ../argent-installer/src/uninstall.ts
|
|
24339
|
-
var
|
|
24530
|
+
var import_picocolors13 = __toESM(require_picocolors(), 1);
|
|
24340
24531
|
var import_yaml5 = __toESM(require_dist2(), 1);
|
|
24341
24532
|
import * as fs21 from "node:fs";
|
|
24342
|
-
import * as
|
|
24533
|
+
import * as path28 from "node:path";
|
|
24343
24534
|
var UNINSTALL_TOOLSERVER_STOP_FAILED = {
|
|
24344
24535
|
error_code: FAILURE_CODES.UNINSTALL_TOOLSERVER_STOP_FAILED,
|
|
24345
24536
|
failure_stage: "installer_uninstall_toolserver_stop",
|
|
@@ -24374,8 +24565,8 @@ function collectBundledPaths(sourceDir) {
|
|
|
24374
24565
|
const directories = [];
|
|
24375
24566
|
function walk(currentDir, relativeDir = "") {
|
|
24376
24567
|
for (const entry of fs21.readdirSync(currentDir, { withFileTypes: true })) {
|
|
24377
|
-
const relativePath = relativeDir ?
|
|
24378
|
-
const absolutePath =
|
|
24568
|
+
const relativePath = relativeDir ? path28.join(relativeDir, entry.name) : entry.name;
|
|
24569
|
+
const absolutePath = path28.join(currentDir, entry.name);
|
|
24379
24570
|
if (entry.isDirectory()) {
|
|
24380
24571
|
walk(absolutePath, relativePath);
|
|
24381
24572
|
directories.push(relativePath);
|
|
@@ -24394,7 +24585,7 @@ function removeBundledContent(sourceDir, targetDir) {
|
|
|
24394
24585
|
const { files, directories } = collectBundledPaths(sourceDir);
|
|
24395
24586
|
const removedPaths = [];
|
|
24396
24587
|
for (const relativePath of files) {
|
|
24397
|
-
const targetPath =
|
|
24588
|
+
const targetPath = path28.join(targetDir, relativePath);
|
|
24398
24589
|
try {
|
|
24399
24590
|
if (!fs21.existsSync(targetPath)) continue;
|
|
24400
24591
|
if (fs21.lstatSync(targetPath).isDirectory()) continue;
|
|
@@ -24404,10 +24595,10 @@ function removeBundledContent(sourceDir, targetDir) {
|
|
|
24404
24595
|
}
|
|
24405
24596
|
}
|
|
24406
24597
|
directories.sort(
|
|
24407
|
-
(a2, b) => b.split(
|
|
24598
|
+
(a2, b) => b.split(path28.sep).length - a2.split(path28.sep).length || b.length - a2.length
|
|
24408
24599
|
);
|
|
24409
24600
|
for (const relativePath of directories) {
|
|
24410
|
-
const targetPath =
|
|
24601
|
+
const targetPath = path28.join(targetDir, relativePath);
|
|
24411
24602
|
try {
|
|
24412
24603
|
if (!fs21.existsSync(targetPath)) continue;
|
|
24413
24604
|
if (!fs21.statSync(targetPath).isDirectory()) continue;
|
|
@@ -24427,7 +24618,7 @@ function removeBundledContent(sourceDir, targetDir) {
|
|
|
24427
24618
|
} catch {
|
|
24428
24619
|
}
|
|
24429
24620
|
if (removedRoot) {
|
|
24430
|
-
removeDirIfEmpty2(
|
|
24621
|
+
removeDirIfEmpty2(path28.dirname(targetDir));
|
|
24431
24622
|
}
|
|
24432
24623
|
return { removedPaths, removedRoot };
|
|
24433
24624
|
}
|
|
@@ -24448,7 +24639,7 @@ function getBundledSkillNames(skillsDir) {
|
|
|
24448
24639
|
const skillNames = [];
|
|
24449
24640
|
for (const entry of fs21.readdirSync(skillsDir, { withFileTypes: true })) {
|
|
24450
24641
|
if (!entry.isDirectory()) continue;
|
|
24451
|
-
const skillFilePath =
|
|
24642
|
+
const skillFilePath = path28.join(skillsDir, entry.name, "SKILL.md");
|
|
24452
24643
|
if (!fs21.existsSync(skillFilePath)) continue;
|
|
24453
24644
|
skillNames.push(readBundledSkillName(skillFilePath, entry.name));
|
|
24454
24645
|
}
|
|
@@ -24460,7 +24651,7 @@ function removeBundledSkillInstalls(skillNames, targetDir) {
|
|
|
24460
24651
|
}
|
|
24461
24652
|
const removedPaths = [];
|
|
24462
24653
|
for (const skillName of skillNames) {
|
|
24463
|
-
const targetPath =
|
|
24654
|
+
const targetPath = path28.join(targetDir, skillName);
|
|
24464
24655
|
try {
|
|
24465
24656
|
const stats = fs21.lstatSync(targetPath, { throwIfNoEntry: false });
|
|
24466
24657
|
if (!stats) continue;
|
|
@@ -24475,7 +24666,7 @@ function removeBundledSkillInstalls(skillNames, targetDir) {
|
|
|
24475
24666
|
}
|
|
24476
24667
|
const removedRoot = removeDirIfEmpty2(targetDir);
|
|
24477
24668
|
if (removedRoot) {
|
|
24478
|
-
removeDirIfEmpty2(
|
|
24669
|
+
removeDirIfEmpty2(path28.dirname(targetDir));
|
|
24479
24670
|
}
|
|
24480
24671
|
return { removedPaths, removedRoot };
|
|
24481
24672
|
}
|
|
@@ -24527,10 +24718,10 @@ function cleanupBundledSkills(skillNames, targets) {
|
|
|
24527
24718
|
const itemsLabel = removedPaths.length === 1 ? "skill entry" : "skill entries";
|
|
24528
24719
|
const rootLabel = removedRoot ? " and removed the now-empty directory" : "";
|
|
24529
24720
|
results.push(
|
|
24530
|
-
`${
|
|
24721
|
+
`${import_picocolors13.default.green("+")} Removed ${removedPaths.length} Argent ${itemsLabel} from ${label}${rootLabel}`
|
|
24531
24722
|
);
|
|
24532
24723
|
} catch (err) {
|
|
24533
|
-
results.push(`${
|
|
24724
|
+
results.push(`${import_picocolors13.default.red("x")} Could not clean ${label}: ${err}`);
|
|
24534
24725
|
}
|
|
24535
24726
|
}
|
|
24536
24727
|
return results;
|
|
@@ -24544,10 +24735,10 @@ function cleanupBundledTargets(sourceDir, targets, contentLabel) {
|
|
|
24544
24735
|
const itemsLabel = removedPaths.length === 1 ? `${contentLabel} file` : `${contentLabel} files`;
|
|
24545
24736
|
const rootLabel = removedRoot ? " and removed the now-empty directory" : "";
|
|
24546
24737
|
results.push(
|
|
24547
|
-
`${
|
|
24738
|
+
`${import_picocolors13.default.green("+")} Removed ${removedPaths.length} Argent ${itemsLabel} from ${label}${rootLabel}`
|
|
24548
24739
|
);
|
|
24549
24740
|
} catch (err) {
|
|
24550
|
-
results.push(`${
|
|
24741
|
+
results.push(`${import_picocolors13.default.red("x")} Could not clean ${label}: ${err}`);
|
|
24551
24742
|
}
|
|
24552
24743
|
}
|
|
24553
24744
|
return results;
|
|
@@ -24575,9 +24766,9 @@ async function uninstall(args) {
|
|
|
24575
24766
|
let hasUninstalledPackage = false;
|
|
24576
24767
|
let hasUninstalledGlobalPackage = false;
|
|
24577
24768
|
try {
|
|
24578
|
-
intro(
|
|
24769
|
+
intro(import_picocolors13.default.bgRed(import_picocolors13.default.white(" argent uninstall ")));
|
|
24579
24770
|
if (!nonInteractive) {
|
|
24580
|
-
log.message(
|
|
24771
|
+
log.message(import_picocolors13.default.dim(" Press y for yes, n for no, enter to confirm."));
|
|
24581
24772
|
const proceed = await confirm({
|
|
24582
24773
|
message: "Remove argent configuration from this workspace?",
|
|
24583
24774
|
initialValue: true
|
|
@@ -24626,7 +24817,7 @@ async function uninstall(args) {
|
|
|
24626
24817
|
scopesToClean.delete("local");
|
|
24627
24818
|
}
|
|
24628
24819
|
const results = [];
|
|
24629
|
-
log.step(
|
|
24820
|
+
log.step(import_picocolors13.default.bold("Removing MCP server entries..."));
|
|
24630
24821
|
for (const adapter of ALL_ADAPTERS) {
|
|
24631
24822
|
const scopedPaths = [
|
|
24632
24823
|
["local", adapter.projectPath(projectRoot)],
|
|
@@ -24638,7 +24829,7 @@ async function uninstall(args) {
|
|
|
24638
24829
|
try {
|
|
24639
24830
|
const removed = adapter.remove(configPath);
|
|
24640
24831
|
if (removed) {
|
|
24641
|
-
results.push(`${
|
|
24832
|
+
results.push(`${import_picocolors13.default.green("+")} Removed from ${adapter.name} ${import_picocolors13.default.dim(configPath)}`);
|
|
24642
24833
|
}
|
|
24643
24834
|
} catch {
|
|
24644
24835
|
}
|
|
@@ -24650,7 +24841,7 @@ async function uninstall(args) {
|
|
|
24650
24841
|
if (!scopesToClean.has(s)) continue;
|
|
24651
24842
|
try {
|
|
24652
24843
|
adapter.removeAllowlist(projectRoot, s);
|
|
24653
|
-
results.push(`${
|
|
24844
|
+
results.push(`${import_picocolors13.default.green("+")} Removed ${adapter.name} allowlist ${import_picocolors13.default.dim(`(${s})`)}`);
|
|
24654
24845
|
} catch {
|
|
24655
24846
|
}
|
|
24656
24847
|
}
|
|
@@ -24658,10 +24849,10 @@ async function uninstall(args) {
|
|
|
24658
24849
|
if (results.length > 0) {
|
|
24659
24850
|
note(results.join("\n"), "MCP Entries Removed");
|
|
24660
24851
|
} else {
|
|
24661
|
-
log.info(
|
|
24852
|
+
log.info(import_picocolors13.default.dim("No MCP entries found to remove."));
|
|
24662
24853
|
}
|
|
24663
24854
|
if (!nonInteractive) {
|
|
24664
|
-
log.message(
|
|
24855
|
+
log.message(import_picocolors13.default.dim(" Press y for yes, n for no, enter to confirm."));
|
|
24665
24856
|
const pruneChoice = await confirm({
|
|
24666
24857
|
message: "Also remove Argent-owned skills, rules, and agents?",
|
|
24667
24858
|
initialValue: true
|
|
@@ -24703,12 +24894,25 @@ async function uninstall(args) {
|
|
|
24703
24894
|
const itemsLabel = removedSkills.length === 1 ? "skill" : "skills";
|
|
24704
24895
|
const fileLabel = removedFile ? " and removed the now-empty lockfile" : "";
|
|
24705
24896
|
pruneResults.push(
|
|
24706
|
-
`${
|
|
24897
|
+
`${import_picocolors13.default.green("+")} Removed ${removedSkills.length} Argent ${itemsLabel} from ${label}${fileLabel}`
|
|
24707
24898
|
);
|
|
24708
24899
|
} catch (err) {
|
|
24709
|
-
pruneResults.push(`${
|
|
24900
|
+
pruneResults.push(`${import_picocolors13.default.red("x")} Could not clean ${label}: ${err}`);
|
|
24710
24901
|
}
|
|
24711
24902
|
}
|
|
24903
|
+
const retired = await cleanupRetiredFiles(
|
|
24904
|
+
findRetiredRulesAndAgents(
|
|
24905
|
+
[...scopesToClean].map((scope) => ({ adapters: ALL_ADAPTERS, scope })),
|
|
24906
|
+
projectRoot,
|
|
24907
|
+
RULES_DIR,
|
|
24908
|
+
AGENTS_DIR
|
|
24909
|
+
),
|
|
24910
|
+
{ ask: false }
|
|
24911
|
+
);
|
|
24912
|
+
for (const root of retired.removedRoots) removeDirIfEmpty2(path28.dirname(root));
|
|
24913
|
+
const retiredLines = formatRetiredCleanup(retired);
|
|
24914
|
+
pruneResults.push(...retiredLines.removed.map((line) => `${import_picocolors13.default.green("+")} ${line}`));
|
|
24915
|
+
const retiredKept = retiredLines.kept.map((line) => ` ${line}`);
|
|
24712
24916
|
const bundledTargets = [
|
|
24713
24917
|
{
|
|
24714
24918
|
sourceDir: AGENTS_DIR,
|
|
@@ -24733,36 +24937,37 @@ async function uninstall(args) {
|
|
|
24733
24937
|
]) {
|
|
24734
24938
|
try {
|
|
24735
24939
|
if (removeCodexRules(targetPath)) {
|
|
24736
|
-
pruneResults.push(`${
|
|
24940
|
+
pruneResults.push(`${import_picocolors13.default.green("+")} Removed argent rules from ${label}`);
|
|
24737
24941
|
}
|
|
24738
24942
|
} catch (err) {
|
|
24739
|
-
pruneResults.push(`${
|
|
24943
|
+
pruneResults.push(`${import_picocolors13.default.red("x")} Could not clean ${label}: ${err}`);
|
|
24740
24944
|
}
|
|
24741
24945
|
}
|
|
24742
24946
|
if (scopesToClean.has("local")) {
|
|
24743
24947
|
try {
|
|
24744
24948
|
if (removeInstallRecord(projectRoot)) {
|
|
24745
|
-
pruneResults.push(`${
|
|
24949
|
+
pruneResults.push(`${import_picocolors13.default.green("+")} Removed .argent/install.json`);
|
|
24746
24950
|
}
|
|
24747
24951
|
} catch (err) {
|
|
24748
|
-
pruneResults.push(`${
|
|
24952
|
+
pruneResults.push(`${import_picocolors13.default.red("x")} Could not remove .argent/install.json: ${err}`);
|
|
24749
24953
|
}
|
|
24750
24954
|
}
|
|
24751
24955
|
if (pruneResults.length > 0) {
|
|
24752
|
-
note(pruneResults.join("\n"), "Pruned Argent Content");
|
|
24956
|
+
note([...pruneResults, ...retiredKept].join("\n"), "Pruned Argent Content");
|
|
24753
24957
|
} else {
|
|
24754
|
-
|
|
24958
|
+
if (retiredKept.length > 0) note(retiredKept.join("\n"), "Files Argent No Longer Ships");
|
|
24959
|
+
log.info(import_picocolors13.default.dim("No Argent-owned skills, rules, or agents found to remove."));
|
|
24755
24960
|
}
|
|
24756
24961
|
hasPrunedContent = pruneResults.length > 0;
|
|
24757
24962
|
} else {
|
|
24758
|
-
log.info(
|
|
24963
|
+
log.info(import_picocolors13.default.dim("Kept Argent-owned skills, rules, and agents."));
|
|
24759
24964
|
}
|
|
24760
24965
|
const buildRemovable = (kind) => {
|
|
24761
24966
|
if (kind === "local") {
|
|
24762
24967
|
if (!uninstallLocalProbe.installed) return null;
|
|
24763
24968
|
if (installMode !== "local" && !isDeclaredLocally(projectRoot)) {
|
|
24764
24969
|
log.info(
|
|
24765
|
-
|
|
24970
|
+
import_picocolors13.default.dim(
|
|
24766
24971
|
`${PACKAGE_NAME} is resolvable from this project but not declared in its package.json \u2014 skipping the local package removal.`
|
|
24767
24972
|
)
|
|
24768
24973
|
);
|
|
@@ -24789,7 +24994,7 @@ async function uninstall(args) {
|
|
|
24789
24994
|
const removables = removeTargets.map((t2) => buildRemovable(t2)).filter((r2) => r2 !== null);
|
|
24790
24995
|
if (removables.length === 0) {
|
|
24791
24996
|
log.info(
|
|
24792
|
-
|
|
24997
|
+
import_picocolors13.default.dim(
|
|
24793
24998
|
`Skipped package removal: no matching ${PACKAGE_NAME} install detected. If it is installed elsewhere, remove it manually.`
|
|
24794
24999
|
)
|
|
24795
25000
|
);
|
|
@@ -24797,7 +25002,7 @@ async function uninstall(args) {
|
|
|
24797
25002
|
for (const removable of removables) {
|
|
24798
25003
|
let shouldRemove = nonInteractive || removePreconfirmed;
|
|
24799
25004
|
if (!nonInteractive && !removePreconfirmed) {
|
|
24800
|
-
log.message(
|
|
25005
|
+
log.message(import_picocolors13.default.dim(" Press y for yes, n for no, enter to confirm."));
|
|
24801
25006
|
const choice = await confirm({
|
|
24802
25007
|
message: removable.prompt,
|
|
24803
25008
|
initialValue: removable.defaultRemove
|
|
@@ -24816,17 +25021,17 @@ async function uninstall(args) {
|
|
|
24816
25021
|
);
|
|
24817
25022
|
throw err;
|
|
24818
25023
|
}
|
|
24819
|
-
log.info(`Running: ${
|
|
25024
|
+
log.info(`Running: ${import_picocolors13.default.dim(formatShellCommand(removable.cmd))}`);
|
|
24820
25025
|
try {
|
|
24821
25026
|
execShellCommandSync(removable.cmd, removable.cwd ? { cwd: removable.cwd } : {});
|
|
24822
25027
|
log.success(`Removed ${removable.kind} package.`);
|
|
24823
25028
|
hasUninstalledPackage = true;
|
|
24824
25029
|
if (removable.kind === "global") hasUninstalledGlobalPackage = true;
|
|
24825
25030
|
if (removable.kind === "local" && removeInstallRecord(projectRoot)) {
|
|
24826
|
-
log.info(
|
|
25031
|
+
log.info(import_picocolors13.default.dim("Removed .argent/install.json (local mode marker)."));
|
|
24827
25032
|
}
|
|
24828
25033
|
if (removeCliRecordFor(removable.installDir)) {
|
|
24829
|
-
log.info(
|
|
25034
|
+
log.info(import_picocolors13.default.dim("Removed ~/.argent/cli.json (provider CLI discovery record)."));
|
|
24830
25035
|
}
|
|
24831
25036
|
} catch (err) {
|
|
24832
25037
|
log.error(`${removable.kind} uninstall failed: ${err}`);
|
|
@@ -24845,7 +25050,7 @@ async function uninstall(args) {
|
|
|
24845
25050
|
} catch {
|
|
24846
25051
|
}
|
|
24847
25052
|
}
|
|
24848
|
-
outro(
|
|
25053
|
+
outro(import_picocolors13.default.green("argent has been removed."));
|
|
24849
25054
|
} catch (err) {
|
|
24850
25055
|
await finalizeUninstallTelemetry(
|
|
24851
25056
|
hasPrunedContent,
|