@swmansion/argent 0.35.1-next.18 → 0.35.1-next.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-cmds.mjs +1670 -1624
- package/dist/client.js +253 -249
- package/dist/fatal-handlers.js +7 -1
- package/dist/fatal-handlers.js.map +1 -1
- package/dist/installer.mjs +411 -393
- package/dist/mcp-server.mjs +1172 -1163
- package/dist/tool-server.cjs +1818 -1760
- package/package.json +2 -2
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, path34) {
|
|
3656
|
+
const ctrl = callVisitor(key, node, visitor, path34);
|
|
3657
3657
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
3658
|
-
replaceNode(key,
|
|
3659
|
-
return visit_(key, ctrl, visitor,
|
|
3658
|
+
replaceNode(key, path34, ctrl);
|
|
3659
|
+
return visit_(key, ctrl, visitor, path34);
|
|
3660
3660
|
}
|
|
3661
3661
|
if (typeof ctrl !== "symbol") {
|
|
3662
3662
|
if (identity2.isCollection(node)) {
|
|
3663
|
-
|
|
3663
|
+
path34 = Object.freeze(path34.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, path34);
|
|
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
|
+
path34 = Object.freeze(path34.concat(node));
|
|
3677
|
+
const ck = visit_("key", node.key, visitor, path34);
|
|
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, path34);
|
|
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, path34) {
|
|
3704
|
+
const ctrl = await callVisitor(key, node, visitor, path34);
|
|
3705
3705
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
3706
|
-
replaceNode(key,
|
|
3707
|
-
return visitAsync_(key, ctrl, visitor,
|
|
3706
|
+
replaceNode(key, path34, ctrl);
|
|
3707
|
+
return visitAsync_(key, ctrl, visitor, path34);
|
|
3708
3708
|
}
|
|
3709
3709
|
if (typeof ctrl !== "symbol") {
|
|
3710
3710
|
if (identity2.isCollection(node)) {
|
|
3711
|
-
|
|
3711
|
+
path34 = Object.freeze(path34.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, path34);
|
|
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
|
+
path34 = Object.freeze(path34.concat(node));
|
|
3725
|
+
const ck = await visitAsync_("key", node.key, visitor, path34);
|
|
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, path34);
|
|
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, path34) {
|
|
3758
3758
|
if (typeof visitor === "function")
|
|
3759
|
-
return visitor(key, node,
|
|
3759
|
+
return visitor(key, node, path34);
|
|
3760
3760
|
if (identity2.isMap(node))
|
|
3761
|
-
return visitor.Map?.(key, node,
|
|
3761
|
+
return visitor.Map?.(key, node, path34);
|
|
3762
3762
|
if (identity2.isSeq(node))
|
|
3763
|
-
return visitor.Seq?.(key, node,
|
|
3763
|
+
return visitor.Seq?.(key, node, path34);
|
|
3764
3764
|
if (identity2.isPair(node))
|
|
3765
|
-
return visitor.Pair?.(key, node,
|
|
3765
|
+
return visitor.Pair?.(key, node, path34);
|
|
3766
3766
|
if (identity2.isScalar(node))
|
|
3767
|
-
return visitor.Scalar?.(key, node,
|
|
3767
|
+
return visitor.Scalar?.(key, node, path34);
|
|
3768
3768
|
if (identity2.isAlias(node))
|
|
3769
|
-
return visitor.Alias?.(key, node,
|
|
3769
|
+
return visitor.Alias?.(key, node, path34);
|
|
3770
3770
|
return void 0;
|
|
3771
3771
|
}
|
|
3772
|
-
function replaceNode(key,
|
|
3773
|
-
const parent =
|
|
3772
|
+
function replaceNode(key, path34, node) {
|
|
3773
|
+
const parent = path34[path34.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, path34, value) {
|
|
4386
4386
|
let v = value;
|
|
4387
|
-
for (let i2 =
|
|
4388
|
-
const k =
|
|
4387
|
+
for (let i2 = path34.length - 1; i2 >= 0; --i2) {
|
|
4388
|
+
const k = path34[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 = (path34) => path34 == null || typeof path34 === "object" && !!path34[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(path34, value) {
|
|
4438
|
+
if (isEmptyPath(path34))
|
|
4439
4439
|
this.add(value);
|
|
4440
4440
|
else {
|
|
4441
|
-
const [key, ...rest] =
|
|
4441
|
+
const [key, ...rest] = path34;
|
|
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(path34) {
|
|
4456
|
+
const [key, ...rest] = path34;
|
|
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(path34, keepScalar) {
|
|
4471
|
+
const [key, ...rest] = path34;
|
|
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(path34) {
|
|
4490
|
+
const [key, ...rest] = path34;
|
|
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(path34, value) {
|
|
4501
|
+
const [key, ...rest] = path34;
|
|
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(path34, value) {
|
|
7017
7017
|
if (assertCollection(this.contents))
|
|
7018
|
-
this.contents.addIn(
|
|
7018
|
+
this.contents.addIn(path34, 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(path34) {
|
|
7094
|
+
if (Collection.isEmptyPath(path34)) {
|
|
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(path34) : 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(path34, keepScalar) {
|
|
7116
|
+
if (Collection.isEmptyPath(path34))
|
|
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(path34, 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(path34) {
|
|
7130
|
+
if (Collection.isEmptyPath(path34))
|
|
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(path34) : 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(path34, value) {
|
|
7150
|
+
if (Collection.isEmptyPath(path34)) {
|
|
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(path34), value);
|
|
7154
7154
|
} else if (assertCollection(this.contents)) {
|
|
7155
|
-
this.contents.setIn(
|
|
7155
|
+
this.contents.setIn(path34, 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, path34) => {
|
|
9117
9117
|
let item = cst;
|
|
9118
|
-
for (const [field, index] of
|
|
9118
|
+
for (const [field, index] of path34) {
|
|
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, path34) => {
|
|
9128
|
+
const parent = visit2.itemAtPath(cst, path34.slice(0, -1));
|
|
9129
|
+
const field = path34[path34.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(path34, item, visitor) {
|
|
9136
|
+
let ctrl = visitor(item, path34);
|
|
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(path34.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, path34);
|
|
9155
9155
|
}
|
|
9156
9156
|
}
|
|
9157
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
9157
|
+
return typeof ctrl === "function" ? ctrl(item, path34) : ctrl;
|
|
9158
9158
|
}
|
|
9159
9159
|
exports.visit = visit2;
|
|
9160
9160
|
}
|
|
@@ -11008,13 +11008,13 @@ var require_min_release_age = __commonJS({
|
|
|
11008
11008
|
return Number.isFinite(days) && days > 0 ? days * config_parse_1.DAY_MS : 0;
|
|
11009
11009
|
}
|
|
11010
11010
|
function probe(p, cwd) {
|
|
11011
|
-
return new Promise((
|
|
11011
|
+
return new Promise((resolve22) => {
|
|
11012
11012
|
(0, node_child_process_1.exec)(p.command, { cwd, timeout: PROBE_TIMEOUT_MS2, windowsHide: true }, (err, stdout2) => {
|
|
11013
11013
|
if (err) {
|
|
11014
|
-
|
|
11014
|
+
resolve22(0);
|
|
11015
11015
|
return;
|
|
11016
11016
|
}
|
|
11017
|
-
|
|
11017
|
+
resolve22(p.parse(stdout2));
|
|
11018
11018
|
});
|
|
11019
11019
|
});
|
|
11020
11020
|
}
|
|
@@ -11047,12 +11047,12 @@ var require_registry = __commonJS({
|
|
|
11047
11047
|
var node_https_1 = __importDefault(__require("node:https"));
|
|
11048
11048
|
var REQUEST_TIMEOUT_MS = 1e4;
|
|
11049
11049
|
function fetchRegistryInfo2(url) {
|
|
11050
|
-
return new Promise((
|
|
11050
|
+
return new Promise((resolve22) => {
|
|
11051
11051
|
let resolved = false;
|
|
11052
11052
|
const safeResolve = (value) => {
|
|
11053
11053
|
if (!resolved) {
|
|
11054
11054
|
resolved = true;
|
|
11055
|
-
|
|
11055
|
+
resolve22(value);
|
|
11056
11056
|
}
|
|
11057
11057
|
};
|
|
11058
11058
|
const req = node_https_1.default.get(url, { timeout: REQUEST_TIMEOUT_MS }, (res) => {
|
|
@@ -12992,8 +12992,8 @@ var Deferred = class {
|
|
|
12992
12992
|
_resolve;
|
|
12993
12993
|
_reject;
|
|
12994
12994
|
constructor() {
|
|
12995
|
-
this._promise = new Promise((
|
|
12996
|
-
this._resolve =
|
|
12995
|
+
this._promise = new Promise((resolve22, reject) => {
|
|
12996
|
+
this._resolve = resolve22;
|
|
12997
12997
|
this._reject = reject;
|
|
12998
12998
|
});
|
|
12999
12999
|
}
|
|
@@ -13886,8 +13886,8 @@ var ExportOperation = class {
|
|
|
13886
13886
|
_metrics;
|
|
13887
13887
|
_exportScheduledResolve;
|
|
13888
13888
|
constructor(exporter, logRecords, exportTimeoutMillis, metrics) {
|
|
13889
|
-
this._exportScheduledPromise = new Promise((
|
|
13890
|
-
this._exportScheduledResolve =
|
|
13889
|
+
this._exportScheduledPromise = new Promise((resolve22) => {
|
|
13890
|
+
this._exportScheduledResolve = resolve22;
|
|
13891
13891
|
});
|
|
13892
13892
|
this._exportCompleted = this._executeExport(exporter, logRecords, exportTimeoutMillis);
|
|
13893
13893
|
this._metrics = metrics;
|
|
@@ -13912,7 +13912,7 @@ var ExportOperation = class {
|
|
|
13912
13912
|
}
|
|
13913
13913
|
}
|
|
13914
13914
|
async _exportWithTimeout(exporter, logRecords, exportTimeoutMillis) {
|
|
13915
|
-
return new Promise((
|
|
13915
|
+
return new Promise((resolve22, reject) => {
|
|
13916
13916
|
const timer = setTimeout(() => {
|
|
13917
13917
|
reject(new Error("Timeout"));
|
|
13918
13918
|
}, exportTimeoutMillis);
|
|
@@ -13920,7 +13920,7 @@ var ExportOperation = class {
|
|
|
13920
13920
|
this._metrics.finishLogs(logRecords.length, result.error);
|
|
13921
13921
|
clearTimeout(timer);
|
|
13922
13922
|
if (result.code === ExportResultCode.SUCCESS) {
|
|
13923
|
-
|
|
13923
|
+
resolve22();
|
|
13924
13924
|
} else {
|
|
13925
13925
|
reject(result.error ?? new Error("BatchLogRecordProcessor: log record export failed"));
|
|
13926
13926
|
}
|
|
@@ -14701,7 +14701,7 @@ function parseRetryAfterToMills(retryAfter) {
|
|
|
14701
14701
|
var DEFAULT_USER_AGENT = `OTel-OTLP-Exporter-JavaScript/${VERSION4}`;
|
|
14702
14702
|
var MAX_RESPONSE_BODY_SIZE = 4 * 1024 * 1024;
|
|
14703
14703
|
function sendWithHttp(request, url, headers, compression, userAgent, agent, data, timeoutMillis) {
|
|
14704
|
-
return new Promise((
|
|
14704
|
+
return new Promise((resolve22) => {
|
|
14705
14705
|
const parsedUrl = new URL(url);
|
|
14706
14706
|
if (userAgent) {
|
|
14707
14707
|
headers["User-Agent"] = `${userAgent} ${DEFAULT_USER_AGENT}`;
|
|
@@ -14720,7 +14720,7 @@ function sendWithHttp(request, url, headers, compression, userAgent, agent, data
|
|
|
14720
14720
|
responseSize += chunk.length;
|
|
14721
14721
|
if (responseSize > MAX_RESPONSE_BODY_SIZE) {
|
|
14722
14722
|
const sizeError = new Error(`OTLP export response body exceeded size limit of ${MAX_RESPONSE_BODY_SIZE} bytes`);
|
|
14723
|
-
|
|
14723
|
+
resolve22({ status: "failure", error: sizeError });
|
|
14724
14724
|
res.destroy();
|
|
14725
14725
|
return;
|
|
14726
14726
|
}
|
|
@@ -14728,18 +14728,18 @@ function sendWithHttp(request, url, headers, compression, userAgent, agent, data
|
|
|
14728
14728
|
});
|
|
14729
14729
|
res.on("end", () => {
|
|
14730
14730
|
if (res.statusCode && res.statusCode <= 299) {
|
|
14731
|
-
|
|
14731
|
+
resolve22({
|
|
14732
14732
|
status: "success",
|
|
14733
14733
|
data: Buffer.concat(responseData)
|
|
14734
14734
|
});
|
|
14735
14735
|
} else if (res.statusCode && isExportHTTPErrorRetryable(res.statusCode)) {
|
|
14736
|
-
|
|
14736
|
+
resolve22({
|
|
14737
14737
|
status: "retryable",
|
|
14738
14738
|
retryInMillis: parseRetryAfterToMills(res.headers["retry-after"])
|
|
14739
14739
|
});
|
|
14740
14740
|
} else {
|
|
14741
14741
|
const error = new OTLPExporterError(res.statusMessage, res.statusCode, Buffer.concat(responseData).toString());
|
|
14742
|
-
|
|
14742
|
+
resolve22({
|
|
14743
14743
|
status: "failure",
|
|
14744
14744
|
error
|
|
14745
14745
|
});
|
|
@@ -14747,17 +14747,17 @@ function sendWithHttp(request, url, headers, compression, userAgent, agent, data
|
|
|
14747
14747
|
});
|
|
14748
14748
|
res.on("error", (error) => {
|
|
14749
14749
|
if (res.statusCode && res.statusCode <= 299) {
|
|
14750
|
-
|
|
14750
|
+
resolve22({
|
|
14751
14751
|
status: "success"
|
|
14752
14752
|
});
|
|
14753
14753
|
} else if (res.statusCode && isExportHTTPErrorRetryable(res.statusCode)) {
|
|
14754
|
-
|
|
14754
|
+
resolve22({
|
|
14755
14755
|
status: "retryable",
|
|
14756
14756
|
error,
|
|
14757
14757
|
retryInMillis: parseRetryAfterToMills(res.headers["retry-after"])
|
|
14758
14758
|
});
|
|
14759
14759
|
} else {
|
|
14760
|
-
|
|
14760
|
+
resolve22({
|
|
14761
14761
|
status: "failure",
|
|
14762
14762
|
error
|
|
14763
14763
|
});
|
|
@@ -14766,26 +14766,26 @@ function sendWithHttp(request, url, headers, compression, userAgent, agent, data
|
|
|
14766
14766
|
});
|
|
14767
14767
|
req.setTimeout(timeoutMillis, () => {
|
|
14768
14768
|
req.destroy();
|
|
14769
|
-
|
|
14769
|
+
resolve22({
|
|
14770
14770
|
status: "retryable",
|
|
14771
14771
|
error: new Error("Request timed out")
|
|
14772
14772
|
});
|
|
14773
14773
|
});
|
|
14774
14774
|
req.on("error", (error) => {
|
|
14775
14775
|
if (isHttpTransportNetworkErrorRetryable(error)) {
|
|
14776
|
-
|
|
14776
|
+
resolve22({
|
|
14777
14777
|
status: "retryable",
|
|
14778
14778
|
error
|
|
14779
14779
|
});
|
|
14780
14780
|
} else {
|
|
14781
|
-
|
|
14781
|
+
resolve22({
|
|
14782
14782
|
status: "failure",
|
|
14783
14783
|
error
|
|
14784
14784
|
});
|
|
14785
14785
|
}
|
|
14786
14786
|
});
|
|
14787
14787
|
compressAndSend(req, compression, data, (error) => {
|
|
14788
|
-
|
|
14788
|
+
resolve22({
|
|
14789
14789
|
status: "failure",
|
|
14790
14790
|
error
|
|
14791
14791
|
});
|
|
@@ -14875,9 +14875,9 @@ var RetryingTransport = class {
|
|
|
14875
14875
|
this._transport = transport;
|
|
14876
14876
|
}
|
|
14877
14877
|
retry(data, timeoutMillis, inMillis) {
|
|
14878
|
-
return new Promise((
|
|
14878
|
+
return new Promise((resolve22, reject) => {
|
|
14879
14879
|
setTimeout(() => {
|
|
14880
|
-
this._transport.send(data, timeoutMillis).then(
|
|
14880
|
+
this._transport.send(data, timeoutMillis).then(resolve22, reject);
|
|
14881
14881
|
}, inMillis);
|
|
14882
14882
|
});
|
|
14883
14883
|
}
|
|
@@ -15012,7 +15012,7 @@ function appendRootPathToUrlIfNeeded(url) {
|
|
|
15012
15012
|
return void 0;
|
|
15013
15013
|
}
|
|
15014
15014
|
}
|
|
15015
|
-
function appendResourcePathToUrl(url,
|
|
15015
|
+
function appendResourcePathToUrl(url, path34) {
|
|
15016
15016
|
try {
|
|
15017
15017
|
new URL(url);
|
|
15018
15018
|
} catch {
|
|
@@ -15022,11 +15022,11 @@ function appendResourcePathToUrl(url, path33) {
|
|
|
15022
15022
|
if (!url.endsWith("/")) {
|
|
15023
15023
|
url = url + "/";
|
|
15024
15024
|
}
|
|
15025
|
-
url +=
|
|
15025
|
+
url += path34;
|
|
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 '${path34}' is not a valid URL, using 'undefined' instead of '${url}'`);
|
|
15030
15030
|
return void 0;
|
|
15031
15031
|
}
|
|
15032
15032
|
return url;
|
|
@@ -15140,41 +15140,50 @@ init_esm();
|
|
|
15140
15140
|
import * as fs6 from "node:fs";
|
|
15141
15141
|
|
|
15142
15142
|
// ../telemetry/src/paths.ts
|
|
15143
|
-
import * as
|
|
15143
|
+
import * as path8 from "node:path";
|
|
15144
15144
|
|
|
15145
15145
|
// ../configuration-core/src/flags.ts
|
|
15146
15146
|
import * as fs2 from "node:fs";
|
|
15147
|
+
import * as path3 from "node:path";
|
|
15148
|
+
|
|
15149
|
+
// ../configuration-core/src/home.ts
|
|
15150
|
+
import * as os from "node:os";
|
|
15147
15151
|
import * as path2 from "node:path";
|
|
15148
|
-
|
|
15152
|
+
var ARGENT_HOME_DIR_ENV = "ARGENT_HOME_DIR";
|
|
15153
|
+
function nonEmpty(value) {
|
|
15154
|
+
if (value == void 0) return null;
|
|
15155
|
+
const trimmed = value.trim();
|
|
15156
|
+
return trimmed === "" ? null : value;
|
|
15157
|
+
}
|
|
15158
|
+
function resolveHomeDir(options = {}) {
|
|
15159
|
+
if (options.homeDir) return options.homeDir;
|
|
15160
|
+
return process.platform === "win32" ? nonEmpty(process.env.USERPROFILE) ?? os.homedir() : nonEmpty(process.env.HOME) ?? os.homedir();
|
|
15161
|
+
}
|
|
15162
|
+
function argentHomeDir(options = {}) {
|
|
15163
|
+
const override = options.homeDir ? null : nonEmpty(process.env[ARGENT_HOME_DIR_ENV]);
|
|
15164
|
+
return override ? path2.resolve(override.trim()) : path2.join(resolveHomeDir(options), ".argent");
|
|
15165
|
+
}
|
|
15166
|
+
|
|
15167
|
+
// ../configuration-core/src/flags.ts
|
|
15149
15168
|
var PROJECT_MARKERS = [".argent", ".git", "package.json"];
|
|
15150
15169
|
function findProjectRoot(startDir) {
|
|
15151
|
-
let current =
|
|
15170
|
+
let current = path3.resolve(startDir);
|
|
15152
15171
|
while (true) {
|
|
15153
15172
|
for (const marker of PROJECT_MARKERS) {
|
|
15154
|
-
if (fs2.existsSync(
|
|
15173
|
+
if (fs2.existsSync(path3.join(current, marker))) return current;
|
|
15155
15174
|
}
|
|
15156
|
-
const parent =
|
|
15175
|
+
const parent = path3.dirname(current);
|
|
15157
15176
|
if (parent === current) return null;
|
|
15158
15177
|
current = parent;
|
|
15159
15178
|
}
|
|
15160
15179
|
}
|
|
15161
15180
|
function resolveProjectRoot(startDir) {
|
|
15162
|
-
return findProjectRoot(startDir) ??
|
|
15181
|
+
return findProjectRoot(startDir) ?? path3.resolve(startDir);
|
|
15163
15182
|
}
|
|
15164
15183
|
|
|
15165
15184
|
// ../configuration-core/src/paths.ts
|
|
15166
15185
|
import * as fs3 from "node:fs";
|
|
15167
|
-
import * as
|
|
15168
|
-
import * as path3 from "node:path";
|
|
15169
|
-
function nonEmpty(value) {
|
|
15170
|
-
if (value == void 0) return null;
|
|
15171
|
-
const trimmed = value.trim();
|
|
15172
|
-
return trimmed === "" ? null : value;
|
|
15173
|
-
}
|
|
15174
|
-
function resolveHomeDir(options = {}) {
|
|
15175
|
-
if (options.homeDir) return options.homeDir;
|
|
15176
|
-
return process.platform === "win32" ? nonEmpty(process.env.USERPROFILE) ?? os.homedir() : nonEmpty(process.env.HOME) ?? os.homedir();
|
|
15177
|
-
}
|
|
15186
|
+
import * as path4 from "node:path";
|
|
15178
15187
|
function isHomeDir(dir, options = {}) {
|
|
15179
15188
|
return canonicalPath(dir) === canonicalPath(resolveHomeDir(options));
|
|
15180
15189
|
}
|
|
@@ -15182,27 +15191,22 @@ function canonicalPath(p) {
|
|
|
15182
15191
|
try {
|
|
15183
15192
|
return fs3.realpathSync.native(p);
|
|
15184
15193
|
} catch {
|
|
15185
|
-
return
|
|
15194
|
+
return path4.resolve(p);
|
|
15186
15195
|
}
|
|
15187
15196
|
}
|
|
15188
|
-
function argentHomeDir() {
|
|
15189
|
-
return path3.join(resolveHomeDir(), ".argent");
|
|
15190
|
-
}
|
|
15191
15197
|
function configDir(scope = "global", options = {}) {
|
|
15192
|
-
if (scope === "global")
|
|
15193
|
-
return path3.join(resolveHomeDir(options), ".argent");
|
|
15194
|
-
}
|
|
15198
|
+
if (scope === "global") return argentHomeDir(options);
|
|
15195
15199
|
const cwd = options.cwd ?? process.cwd();
|
|
15196
|
-
return
|
|
15200
|
+
return path4.join(resolveProjectRoot(cwd), ".argent");
|
|
15197
15201
|
}
|
|
15198
15202
|
function configFilePath(scope = "global", options = {}) {
|
|
15199
|
-
return
|
|
15203
|
+
return path4.join(configDir(scope, options), "config.json");
|
|
15200
15204
|
}
|
|
15201
15205
|
|
|
15202
15206
|
// ../configuration-core/src/config.ts
|
|
15203
15207
|
import * as crypto from "node:crypto";
|
|
15204
15208
|
import * as fs4 from "node:fs";
|
|
15205
|
-
import * as
|
|
15209
|
+
import * as path5 from "node:path";
|
|
15206
15210
|
function readConfigObject(scope = "global", options = {}) {
|
|
15207
15211
|
try {
|
|
15208
15212
|
const raw = fs4.readFileSync(configFilePath(scope, options), "utf8");
|
|
@@ -15302,7 +15306,7 @@ function updateConfig(mutate, scope = "global", options = {}) {
|
|
|
15302
15306
|
try {
|
|
15303
15307
|
const next = readConfigObject(scope, options);
|
|
15304
15308
|
mutate(next);
|
|
15305
|
-
const tmpPath =
|
|
15309
|
+
const tmpPath = path5.join(dir, `.config.tmp.${process.pid}.${crypto.randomUUID()}`);
|
|
15306
15310
|
const fd = fs4.openSync(tmpPath, "wx", 384);
|
|
15307
15311
|
try {
|
|
15308
15312
|
fs4.writeSync(fd, JSON.stringify(next, null, 2) + "\n");
|
|
@@ -15349,7 +15353,7 @@ function setWhatsNewSeenVersion(version, options = {}) {
|
|
|
15349
15353
|
// ../configuration-core/src/secrets.ts
|
|
15350
15354
|
var import_dotenv = __toESM(require_dist(), 1);
|
|
15351
15355
|
import * as fs5 from "node:fs";
|
|
15352
|
-
import * as
|
|
15356
|
+
import * as path6 from "node:path";
|
|
15353
15357
|
|
|
15354
15358
|
// ../configuration-core/src/merge.ts
|
|
15355
15359
|
function mergeRestrictive(local, global2) {
|
|
@@ -15536,7 +15540,7 @@ function getConfigDefinition(key, registry = CONFIG_SCHEMA) {
|
|
|
15536
15540
|
}
|
|
15537
15541
|
|
|
15538
15542
|
// ../configuration-core/src/config-access.ts
|
|
15539
|
-
import * as
|
|
15543
|
+
import * as path7 from "node:path";
|
|
15540
15544
|
function readScopeValue(def, scope, options) {
|
|
15541
15545
|
if (!def.scopes.includes(scope)) return void 0;
|
|
15542
15546
|
const raw = getAtPath(readConfigObject(scope, options), def.key);
|
|
@@ -15548,6 +15552,10 @@ function getConfigValue(def, options = {}) {
|
|
|
15548
15552
|
const merged = applyMergePolicy(def.merge, local, global2);
|
|
15549
15553
|
return merged ?? def.default;
|
|
15550
15554
|
}
|
|
15555
|
+
function getConfigValueAtScope(key, scope, options = {}, registry = CONFIG_SCHEMA) {
|
|
15556
|
+
const def = requireDefinition(key, registry);
|
|
15557
|
+
return readScopeValue(def, scope, options);
|
|
15558
|
+
}
|
|
15551
15559
|
function getConfigValueByKey(key, options = {}, registry = CONFIG_SCHEMA) {
|
|
15552
15560
|
const def = requireDefinition(key, registry);
|
|
15553
15561
|
return getConfigValue(def, options);
|
|
@@ -15567,13 +15575,19 @@ var UnknownConfigKeyError = class extends Error {
|
|
|
15567
15575
|
}
|
|
15568
15576
|
key;
|
|
15569
15577
|
};
|
|
15578
|
+
var AUTO_UPDATE_ENABLED_KEY = "autoUpdate.enabled";
|
|
15579
|
+
function isAutoUpdateEnabled() {
|
|
15580
|
+
if (getConfigValueByKey(AUTO_UPDATE_ENABLED_KEY) !== true) return false;
|
|
15581
|
+
const userHome = { homeDir: resolveHomeDir() };
|
|
15582
|
+
return getConfigValueAtScope(AUTO_UPDATE_ENABLED_KEY, "global", userHome) !== false;
|
|
15583
|
+
}
|
|
15570
15584
|
|
|
15571
15585
|
// ../telemetry/src/paths.ts
|
|
15572
15586
|
function identityFilePath() {
|
|
15573
|
-
return
|
|
15587
|
+
return path8.join(argentHomeDir(), "telemetry-id");
|
|
15574
15588
|
}
|
|
15575
15589
|
function debugLogPath() {
|
|
15576
|
-
return
|
|
15590
|
+
return path8.join(argentHomeDir(), "telemetry-debug.log");
|
|
15577
15591
|
}
|
|
15578
15592
|
|
|
15579
15593
|
// ../telemetry/src/debug.ts
|
|
@@ -15793,15 +15807,15 @@ var SELECTABLE_PLATFORMS = [...LAUNCH_PLATFORMS, "ios-remote"];
|
|
|
15793
15807
|
|
|
15794
15808
|
// ../registry/src/flow-file-refs.ts
|
|
15795
15809
|
import * as fs8 from "node:fs/promises";
|
|
15796
|
-
import * as
|
|
15810
|
+
import * as path10 from "node:path";
|
|
15797
15811
|
|
|
15798
15812
|
// ../registry/src/e2e-dirs.ts
|
|
15799
15813
|
import * as fs7 from "node:fs/promises";
|
|
15800
|
-
import * as
|
|
15801
|
-
var E2E_DIR =
|
|
15802
|
-
var LEGACY_E2E_DIRS = Object.freeze([
|
|
15814
|
+
import * as path9 from "node:path";
|
|
15815
|
+
var E2E_DIR = path9.join(".argent", "e2e");
|
|
15816
|
+
var LEGACY_E2E_DIRS = Object.freeze([path9.join(".argent", "flows")]);
|
|
15803
15817
|
var E2E_DIRS = Object.freeze([E2E_DIR, ...LEGACY_E2E_DIRS]);
|
|
15804
|
-
var E2E_DIR_NAMES = E2E_DIRS.map((dir) =>
|
|
15818
|
+
var E2E_DIR_NAMES = E2E_DIRS.map((dir) => path9.basename(dir));
|
|
15805
15819
|
|
|
15806
15820
|
// ../registry/src/tool-ids.ts
|
|
15807
15821
|
var TOOL_ID_ALIASES = Object.freeze({
|
|
@@ -16681,9 +16695,9 @@ function isReplitAgent(env) {
|
|
|
16681
16695
|
}
|
|
16682
16696
|
var DEVIN_MARKER_PATH = "/opt/.devin";
|
|
16683
16697
|
var JULES_MARKER_PATH = "/opt/environment_summary.sh";
|
|
16684
|
-
function safeExists(fileExists,
|
|
16698
|
+
function safeExists(fileExists, path34) {
|
|
16685
16699
|
try {
|
|
16686
|
-
return fileExists(
|
|
16700
|
+
return fileExists(path34);
|
|
16687
16701
|
} catch {
|
|
16688
16702
|
return false;
|
|
16689
16703
|
}
|
|
@@ -17137,7 +17151,7 @@ function getBaseProps(runtime) {
|
|
|
17137
17151
|
// ../telemetry/src/identity.ts
|
|
17138
17152
|
import * as crypto2 from "node:crypto";
|
|
17139
17153
|
import * as fs9 from "node:fs";
|
|
17140
|
-
import * as
|
|
17154
|
+
import * as path11 from "node:path";
|
|
17141
17155
|
var FINGERPRINT_PATTERN = /^[0-9a-f]{64}$/;
|
|
17142
17156
|
var cached = null;
|
|
17143
17157
|
var fingerprintResolved = null;
|
|
@@ -17261,7 +17275,7 @@ function writeIdFileAtomic(finalPath, id) {
|
|
|
17261
17275
|
if (occupant && !occupant.isFile()) {
|
|
17262
17276
|
throw new Error("telemetry: refusing to replace a non-regular file at the identity path");
|
|
17263
17277
|
}
|
|
17264
|
-
const tmpPath =
|
|
17278
|
+
const tmpPath = path11.join(
|
|
17265
17279
|
argentHomeDir(),
|
|
17266
17280
|
`.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
|
|
17267
17281
|
);
|
|
@@ -17285,7 +17299,7 @@ function mintRandomId(finalPath) {
|
|
|
17285
17299
|
fs9.mkdirSync(argentHomeDir(), { recursive: true });
|
|
17286
17300
|
let value = crypto2.randomUUID();
|
|
17287
17301
|
for (let attempt = 0; attempt < 3; attempt++) {
|
|
17288
|
-
const tmpPath =
|
|
17302
|
+
const tmpPath = path11.join(
|
|
17289
17303
|
argentHomeDir(),
|
|
17290
17304
|
`.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
|
|
17291
17305
|
);
|
|
@@ -17330,7 +17344,7 @@ function mintRandomId(finalPath) {
|
|
|
17330
17344
|
throw new Error("telemetry: failed to create identity after retries");
|
|
17331
17345
|
}
|
|
17332
17346
|
function claimCorruptOccupant(finalPath) {
|
|
17333
|
-
const claimed =
|
|
17347
|
+
const claimed = path11.join(
|
|
17334
17348
|
argentHomeDir(),
|
|
17335
17349
|
`.telemetry-id.corrupt.${process.pid}.${crypto2.randomUUID()}`
|
|
17336
17350
|
);
|
|
@@ -17377,12 +17391,12 @@ function tryReadId(filePath) {
|
|
|
17377
17391
|
import { execFileSync, spawn } from "node:child_process";
|
|
17378
17392
|
|
|
17379
17393
|
// ../native-devtools-ios/src/index.ts
|
|
17380
|
-
import * as
|
|
17394
|
+
import * as path12 from "node:path";
|
|
17381
17395
|
import * as fs10 from "node:fs";
|
|
17382
|
-
var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ??
|
|
17383
|
-
var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ??
|
|
17384
|
-
var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ??
|
|
17385
|
-
var DYLIB_TVOS_DIR =
|
|
17396
|
+
var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path12.join(__dirname, "..", "dylibs");
|
|
17397
|
+
var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path12.join(__dirname, "..", "bin");
|
|
17398
|
+
var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path12.join(DYLIB_DIR, "tcp");
|
|
17399
|
+
var DYLIB_TVOS_DIR = path12.join(DYLIB_DIR, "tvos");
|
|
17386
17400
|
function hostPlatformKey() {
|
|
17387
17401
|
if (process.platform === "linux" && process.arch === "arm64") {
|
|
17388
17402
|
return "linux-arm64";
|
|
@@ -17393,13 +17407,13 @@ function simulatorServerBinaryName() {
|
|
|
17393
17407
|
return process.platform === "win32" ? "simulator-server.exe" : "simulator-server";
|
|
17394
17408
|
}
|
|
17395
17409
|
function platformBinDir() {
|
|
17396
|
-
return
|
|
17410
|
+
return path12.join(BIN_DIR, hostPlatformKey());
|
|
17397
17411
|
}
|
|
17398
17412
|
function simulatorServerBinaryPath() {
|
|
17399
17413
|
const binaryName = simulatorServerBinaryName();
|
|
17400
|
-
const p =
|
|
17414
|
+
const p = path12.join(platformBinDir(), binaryName);
|
|
17401
17415
|
if (!fs10.existsSync(p)) {
|
|
17402
|
-
const flat =
|
|
17416
|
+
const flat = path12.join(BIN_DIR, binaryName);
|
|
17403
17417
|
const migrationHint = fs10.existsSync(flat) ? ` Found a binary at the old flat path ${flat}; move it to ${p} or update ARGENT_SIMULATOR_SERVER_DIR to point at the parent of the platform subdirectory.` : "";
|
|
17404
17418
|
throw new Error(
|
|
17405
17419
|
`simulator-server binary not found for platform "${hostPlatformKey()}" at ${p}. Supported hosts today: darwin, linux (x86_64 and arm64), win32.${migrationHint}`
|
|
@@ -17429,12 +17443,12 @@ function resolveHostFingerprint() {
|
|
|
17429
17443
|
}
|
|
17430
17444
|
}
|
|
17431
17445
|
function resolveHostFingerprintAsync() {
|
|
17432
|
-
return new Promise((
|
|
17446
|
+
return new Promise((resolve22) => {
|
|
17433
17447
|
let binary;
|
|
17434
17448
|
try {
|
|
17435
17449
|
binary = simulatorServerBinaryPath();
|
|
17436
17450
|
} catch {
|
|
17437
|
-
|
|
17451
|
+
resolve22(null);
|
|
17438
17452
|
return;
|
|
17439
17453
|
}
|
|
17440
17454
|
let settled = false;
|
|
@@ -17447,7 +17461,7 @@ function resolveHostFingerprintAsync() {
|
|
|
17447
17461
|
child?.kill("SIGKILL");
|
|
17448
17462
|
} catch {
|
|
17449
17463
|
}
|
|
17450
|
-
|
|
17464
|
+
resolve22(value);
|
|
17451
17465
|
};
|
|
17452
17466
|
const watchdog = setTimeout(() => finish(null), FINGERPRINT_TIMEOUT_MS);
|
|
17453
17467
|
watchdog.unref?.();
|
|
@@ -17481,7 +17495,7 @@ function resolveHostFingerprintAsync() {
|
|
|
17481
17495
|
|
|
17482
17496
|
// ../telemetry/src/consent.ts
|
|
17483
17497
|
import * as fs11 from "node:fs";
|
|
17484
|
-
import * as
|
|
17498
|
+
import * as path13 from "node:path";
|
|
17485
17499
|
var cache = /* @__PURE__ */ new Map();
|
|
17486
17500
|
var sessionOverride = null;
|
|
17487
17501
|
function readConfigOverrideAt(filePath) {
|
|
@@ -17522,8 +17536,12 @@ function readConfigOverrideAt(filePath) {
|
|
|
17522
17536
|
function readPersistedConsent(cwd) {
|
|
17523
17537
|
const globalPath = configFilePath("global");
|
|
17524
17538
|
const projectPath = configFilePath("project", { cwd });
|
|
17539
|
+
const userConfigPath = path13.join(resolveHomeDir(), ".argent", "config.json");
|
|
17540
|
+
if (userConfigPath !== globalPath && readConfigOverrideAt(userConfigPath) === false) {
|
|
17541
|
+
return { enabled: false, detail: `${userConfigPath} (user)` };
|
|
17542
|
+
}
|
|
17525
17543
|
const global2 = readConfigOverrideAt(globalPath);
|
|
17526
|
-
const projectRoot =
|
|
17544
|
+
const projectRoot = path13.dirname(path13.dirname(projectPath));
|
|
17527
17545
|
const project = isHomeDir(projectRoot) ? null : readConfigOverrideAt(projectPath);
|
|
17528
17546
|
if (project === false && global2 === false) {
|
|
17529
17547
|
return { enabled: false, detail: "config.json (project and global)" };
|
|
@@ -17719,7 +17737,7 @@ var DRAIN_GRACE_MS = 250;
|
|
|
17719
17737
|
async function raceDrain(client2, timeoutMs) {
|
|
17720
17738
|
await Promise.race([
|
|
17721
17739
|
client2.shutdown(timeoutMs),
|
|
17722
|
-
new Promise((
|
|
17740
|
+
new Promise((resolve22) => setTimeout(resolve22, timeoutMs + DRAIN_GRACE_MS).unref())
|
|
17723
17741
|
]);
|
|
17724
17742
|
}
|
|
17725
17743
|
async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
|
|
@@ -17740,9 +17758,9 @@ async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
|
|
|
17740
17758
|
|
|
17741
17759
|
// ../argent-installer/src/mcp-configs.ts
|
|
17742
17760
|
import * as fs18 from "node:fs";
|
|
17743
|
-
import * as
|
|
17761
|
+
import * as path20 from "node:path";
|
|
17744
17762
|
import { execFileSync as execFileSync5 } from "node:child_process";
|
|
17745
|
-
import { homedir as
|
|
17763
|
+
import { homedir as homedir4 } from "node:os";
|
|
17746
17764
|
|
|
17747
17765
|
// ../argent-installer/src/constants.ts
|
|
17748
17766
|
var PACKAGE_NAME = "@swmansion/argent";
|
|
@@ -17756,7 +17774,7 @@ var CURSOR_ALLOWLIST_PATTERN = "argent:*";
|
|
|
17756
17774
|
// ../argent-installer/src/utils.ts
|
|
17757
17775
|
var import_semver3 = __toESM(require_semver2(), 1);
|
|
17758
17776
|
import * as fs17 from "node:fs";
|
|
17759
|
-
import * as
|
|
17777
|
+
import * as path19 from "node:path";
|
|
17760
17778
|
import * as dns from "node:dns";
|
|
17761
17779
|
import { createHash as createHash2 } from "node:crypto";
|
|
17762
17780
|
import * as os3 from "node:os";
|
|
@@ -19502,12 +19520,12 @@ function parseTree(text2, errors = [], options = ParseOptions.DEFAULT) {
|
|
|
19502
19520
|
}
|
|
19503
19521
|
return result;
|
|
19504
19522
|
}
|
|
19505
|
-
function findNodeAtLocation(root,
|
|
19523
|
+
function findNodeAtLocation(root, path34) {
|
|
19506
19524
|
if (!root) {
|
|
19507
19525
|
return void 0;
|
|
19508
19526
|
}
|
|
19509
19527
|
let node = root;
|
|
19510
|
-
for (let segment of
|
|
19528
|
+
for (let segment of path34) {
|
|
19511
19529
|
if (typeof segment === "string") {
|
|
19512
19530
|
if (node.type !== "object" || !Array.isArray(node.children)) {
|
|
19513
19531
|
return void 0;
|
|
@@ -19861,14 +19879,14 @@ function getNodeType(value) {
|
|
|
19861
19879
|
|
|
19862
19880
|
// ../../node_modules/jsonc-parser/lib/esm/impl/edit.js
|
|
19863
19881
|
function setProperty(text2, originalPath, value, options) {
|
|
19864
|
-
const
|
|
19882
|
+
const path34 = originalPath.slice();
|
|
19865
19883
|
const errors = [];
|
|
19866
19884
|
const root = parseTree(text2, errors);
|
|
19867
19885
|
let parent = void 0;
|
|
19868
19886
|
let lastSegment = void 0;
|
|
19869
|
-
while (
|
|
19870
|
-
lastSegment =
|
|
19871
|
-
parent = findNodeAtLocation(root,
|
|
19887
|
+
while (path34.length > 0) {
|
|
19888
|
+
lastSegment = path34.pop();
|
|
19889
|
+
parent = findNodeAtLocation(root, path34);
|
|
19872
19890
|
if (parent === void 0 && value !== void 0) {
|
|
19873
19891
|
if (typeof lastSegment === "string") {
|
|
19874
19892
|
value = { [lastSegment]: value };
|
|
@@ -20054,8 +20072,8 @@ var ParseErrorCode;
|
|
|
20054
20072
|
ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
|
|
20055
20073
|
ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
20056
20074
|
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
20057
|
-
function modify(text2,
|
|
20058
|
-
return setProperty(text2,
|
|
20075
|
+
function modify(text2, path34, value, options) {
|
|
20076
|
+
return setProperty(text2, path34, value, options);
|
|
20059
20077
|
}
|
|
20060
20078
|
function applyEdits(text2, edits) {
|
|
20061
20079
|
let sortedEdits = edits.slice(0).sort((a2, b) => {
|
|
@@ -20080,13 +20098,13 @@ function applyEdits(text2, edits) {
|
|
|
20080
20098
|
|
|
20081
20099
|
// ../argent-installer/src/package-root.ts
|
|
20082
20100
|
import * as fs12 from "node:fs";
|
|
20083
|
-
import * as
|
|
20084
|
-
function resolvePackageRoot(
|
|
20085
|
-
let current =
|
|
20101
|
+
import * as path14 from "node:path";
|
|
20102
|
+
function resolvePackageRoot(dirname19) {
|
|
20103
|
+
let current = path14.resolve(dirname19);
|
|
20086
20104
|
while (true) {
|
|
20087
|
-
if (fs12.existsSync(
|
|
20088
|
-
const parent =
|
|
20089
|
-
if (parent === current) return
|
|
20105
|
+
if (fs12.existsSync(path14.join(current, "package.json"))) return current;
|
|
20106
|
+
const parent = path14.dirname(current);
|
|
20107
|
+
if (parent === current) return path14.resolve(dirname19);
|
|
20090
20108
|
current = parent;
|
|
20091
20109
|
}
|
|
20092
20110
|
}
|
|
@@ -20095,23 +20113,23 @@ function resolvePackageRoot(dirname20) {
|
|
|
20095
20113
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
20096
20114
|
import * as fs15 from "node:fs";
|
|
20097
20115
|
import * as os2 from "node:os";
|
|
20098
|
-
import * as
|
|
20116
|
+
import * as path17 from "node:path";
|
|
20099
20117
|
|
|
20100
20118
|
// ../argent-installer/src/topology.ts
|
|
20101
20119
|
var import_semver2 = __toESM(require_semver2(), 1);
|
|
20102
20120
|
import * as fs14 from "node:fs";
|
|
20103
|
-
import * as
|
|
20121
|
+
import * as path16 from "node:path";
|
|
20104
20122
|
import { createRequire } from "node:module";
|
|
20105
20123
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
20106
20124
|
|
|
20107
20125
|
// ../argent-installer/src/preflight.ts
|
|
20108
20126
|
import * as fs13 from "node:fs";
|
|
20109
|
-
import * as
|
|
20127
|
+
import * as path15 from "node:path";
|
|
20110
20128
|
function hasProjectPackageJson(projectRoot) {
|
|
20111
|
-
return fs13.existsSync(
|
|
20129
|
+
return fs13.existsSync(path15.join(projectRoot, "package.json"));
|
|
20112
20130
|
}
|
|
20113
20131
|
function isYarnPnp(projectRoot) {
|
|
20114
|
-
return fs13.existsSync(
|
|
20132
|
+
return fs13.existsSync(path15.join(projectRoot, ".pnp.cjs")) || fs13.existsSync(path15.join(projectRoot, ".pnp.loader.mjs"));
|
|
20115
20133
|
}
|
|
20116
20134
|
|
|
20117
20135
|
// ../argent-installer/src/topology.ts
|
|
@@ -20137,12 +20155,12 @@ function isTempRunnerPath(binaryPath) {
|
|
|
20137
20155
|
}
|
|
20138
20156
|
function isProjectBinPath(binaryPath) {
|
|
20139
20157
|
const norm = (p) => process.platform === "win32" ? p.toLowerCase() : canonicalPath(p);
|
|
20140
|
-
const binDir = norm(
|
|
20158
|
+
const binDir = norm(path16.dirname(path16.resolve(binaryPath)));
|
|
20141
20159
|
const prefix = process.env.npm_config_local_prefix;
|
|
20142
|
-
if (prefix && norm(
|
|
20143
|
-
for (let dir =
|
|
20144
|
-
if (norm(
|
|
20145
|
-
if (
|
|
20160
|
+
if (prefix && norm(path16.join(prefix, "node_modules", ".bin")) === binDir) return true;
|
|
20161
|
+
for (let dir = path16.resolve(process.cwd()); ; dir = path16.dirname(dir)) {
|
|
20162
|
+
if (norm(path16.join(dir, "node_modules", ".bin")) === binDir) return true;
|
|
20163
|
+
if (path16.dirname(dir) === dir) return false;
|
|
20146
20164
|
}
|
|
20147
20165
|
}
|
|
20148
20166
|
function getPermanentBinaryPaths() {
|
|
@@ -20202,7 +20220,7 @@ function shimTargetOf(binaryPath) {
|
|
|
20202
20220
|
const trailer = /^# cmd-shim-target=(.+)$/m.exec(shim);
|
|
20203
20221
|
if (trailer) return trailer[1].trim();
|
|
20204
20222
|
const relative5 = /"\$basedir(?:_abs)?"?\/'?([^"'\s]*node_modules\/[^"'\s]*)/.exec(shim);
|
|
20205
|
-
return relative5 ?
|
|
20223
|
+
return relative5 ? path16.resolve(canonicalPath(path16.dirname(binaryPath)), relative5[1]) : null;
|
|
20206
20224
|
}
|
|
20207
20225
|
function globalPackageRootOf(binaryPath) {
|
|
20208
20226
|
const root = packageRootOf(binaryPath);
|
|
@@ -20213,8 +20231,8 @@ function globalPackageRootOf(binaryPath) {
|
|
|
20213
20231
|
function packageRootOf(binaryPath) {
|
|
20214
20232
|
try {
|
|
20215
20233
|
const realPath = fs14.realpathSync(binaryPath);
|
|
20216
|
-
const root = resolvePackageRoot(
|
|
20217
|
-
const pkg = JSON.parse(fs14.readFileSync(
|
|
20234
|
+
const root = resolvePackageRoot(path16.dirname(realPath));
|
|
20235
|
+
const pkg = JSON.parse(fs14.readFileSync(path16.join(root, "package.json"), "utf8"));
|
|
20218
20236
|
return pkg.name === PACKAGE_NAME ? root : null;
|
|
20219
20237
|
} catch {
|
|
20220
20238
|
return null;
|
|
@@ -20223,7 +20241,7 @@ function packageRootOf(binaryPath) {
|
|
|
20223
20241
|
function cliPathOf(packageRoot) {
|
|
20224
20242
|
const binSub = argentBinSubpath(packageRoot);
|
|
20225
20243
|
if (!binSub) return null;
|
|
20226
|
-
const cli =
|
|
20244
|
+
const cli = path16.join(packageRoot, binSub);
|
|
20227
20245
|
return fs14.existsSync(cli) ? cli : null;
|
|
20228
20246
|
}
|
|
20229
20247
|
function getGloballyInstalledLaunchPaths() {
|
|
@@ -20234,7 +20252,7 @@ function getGloballyInstalledLaunchPaths() {
|
|
|
20234
20252
|
const cli = packageRoot ? cliPathOf(packageRoot) : null;
|
|
20235
20253
|
if (!cli) return null;
|
|
20236
20254
|
try {
|
|
20237
|
-
const node =
|
|
20255
|
+
const node = path16.join(fs14.realpathSync(path16.dirname(binaryPath)), "node");
|
|
20238
20256
|
return fs14.existsSync(node) ? { node, cli } : null;
|
|
20239
20257
|
} catch {
|
|
20240
20258
|
return null;
|
|
@@ -20244,7 +20262,7 @@ function getGloballyInstalledVersion() {
|
|
|
20244
20262
|
const pkgRoot = getGloballyInstalledPackageRoot();
|
|
20245
20263
|
if (!pkgRoot) return null;
|
|
20246
20264
|
try {
|
|
20247
|
-
const pkg = JSON.parse(fs14.readFileSync(
|
|
20265
|
+
const pkg = JSON.parse(fs14.readFileSync(path16.join(pkgRoot, "package.json"), "utf8"));
|
|
20248
20266
|
return pkg.version ?? null;
|
|
20249
20267
|
} catch {
|
|
20250
20268
|
return null;
|
|
@@ -20253,7 +20271,7 @@ function getGloballyInstalledVersion() {
|
|
|
20253
20271
|
function readManifestDeclaration(projectRoot) {
|
|
20254
20272
|
try {
|
|
20255
20273
|
const pkg = JSON.parse(
|
|
20256
|
-
fs14.readFileSync(
|
|
20274
|
+
fs14.readFileSync(path16.join(projectRoot, "package.json"), "utf8")
|
|
20257
20275
|
);
|
|
20258
20276
|
const spec = pkg.devDependencies?.[PACKAGE_NAME] ?? pkg.dependencies?.[PACKAGE_NAME] ?? pkg.optionalDependencies?.[PACKAGE_NAME];
|
|
20259
20277
|
return typeof spec === "string" ? spec : null;
|
|
@@ -20266,11 +20284,11 @@ function isDeclaredLocally(projectRoot) {
|
|
|
20266
20284
|
}
|
|
20267
20285
|
function resolveLocalArgentDir(projectRoot) {
|
|
20268
20286
|
try {
|
|
20269
|
-
const req = createRequire(
|
|
20270
|
-
return
|
|
20287
|
+
const req = createRequire(path16.join(projectRoot, "package.json"));
|
|
20288
|
+
return path16.dirname(req.resolve(`${PACKAGE_NAME}/package.json`));
|
|
20271
20289
|
} catch {
|
|
20272
|
-
const plain =
|
|
20273
|
-
return fs14.existsSync(
|
|
20290
|
+
const plain = path16.join(projectRoot, "node_modules", PACKAGE_NAME);
|
|
20291
|
+
return fs14.existsSync(path16.join(plain, "package.json")) ? plain : null;
|
|
20274
20292
|
}
|
|
20275
20293
|
}
|
|
20276
20294
|
function probeLocalInstall(projectRoot) {
|
|
@@ -20278,7 +20296,7 @@ function probeLocalInstall(projectRoot) {
|
|
|
20278
20296
|
if (packageDir) {
|
|
20279
20297
|
let version;
|
|
20280
20298
|
try {
|
|
20281
|
-
const pkg = JSON.parse(fs14.readFileSync(
|
|
20299
|
+
const pkg = JSON.parse(fs14.readFileSync(path16.join(packageDir, "package.json"), "utf8"));
|
|
20282
20300
|
version = pkg.version ?? null;
|
|
20283
20301
|
} catch {
|
|
20284
20302
|
version = null;
|
|
@@ -20301,7 +20319,7 @@ function getLocallyInstalledVersion(projectRoot) {
|
|
|
20301
20319
|
}
|
|
20302
20320
|
function readLocalPackageVersionUncached(projectRoot) {
|
|
20303
20321
|
try {
|
|
20304
|
-
const pkgPath =
|
|
20322
|
+
const pkgPath = path16.join(projectRoot, "node_modules", PACKAGE_NAME, "package.json");
|
|
20305
20323
|
const pkg = JSON.parse(fs14.readFileSync(pkgPath, "utf8"));
|
|
20306
20324
|
return pkg.version ?? null;
|
|
20307
20325
|
} catch {
|
|
@@ -20310,7 +20328,7 @@ function readLocalPackageVersionUncached(projectRoot) {
|
|
|
20310
20328
|
}
|
|
20311
20329
|
function argentBinSubpath(pkgDir) {
|
|
20312
20330
|
try {
|
|
20313
|
-
const pkg = JSON.parse(fs14.readFileSync(
|
|
20331
|
+
const pkg = JSON.parse(fs14.readFileSync(path16.join(pkgDir, "package.json"), "utf8"));
|
|
20314
20332
|
if (typeof pkg.bin === "string") return pkg.bin;
|
|
20315
20333
|
if (pkg.bin && typeof pkg.bin === "object") {
|
|
20316
20334
|
return pkg.bin[MCP_BINARY_NAME] ?? Object.values(pkg.bin)[0] ?? null;
|
|
@@ -20330,13 +20348,13 @@ function getLocalArgentBinRelPath(projectRoot) {
|
|
|
20330
20348
|
root = fs14.realpathSync(projectRoot);
|
|
20331
20349
|
} catch {
|
|
20332
20350
|
}
|
|
20333
|
-
const stableRel =
|
|
20334
|
-
if (fs14.existsSync(
|
|
20335
|
-
return stableRel.split(
|
|
20351
|
+
const stableRel = path16.join("node_modules", PACKAGE_NAME, binSub);
|
|
20352
|
+
if (fs14.existsSync(path16.join(root, stableRel))) {
|
|
20353
|
+
return stableRel.split(path16.sep).join("/");
|
|
20336
20354
|
}
|
|
20337
|
-
const abs =
|
|
20355
|
+
const abs = path16.join(pkgDir, binSub);
|
|
20338
20356
|
if (!fs14.existsSync(abs)) return null;
|
|
20339
|
-
return
|
|
20357
|
+
return path16.relative(root, abs).split(path16.sep).join("/");
|
|
20340
20358
|
}
|
|
20341
20359
|
|
|
20342
20360
|
// ../argent-installer/src/package-manager.ts
|
|
@@ -20369,7 +20387,7 @@ function detectGlobalPackageManager() {
|
|
|
20369
20387
|
return BUN_GLOBAL_ROOT.test(root) ? "bun" : lockfileOwnerOf(root) ?? "yarn";
|
|
20370
20388
|
}
|
|
20371
20389
|
if (process.platform === "win32") {
|
|
20372
|
-
if (fs15.existsSync(
|
|
20390
|
+
if (fs15.existsSync(path17.join(npmCopyBeside(path17.dirname(binaryPath)), "package.json"))) {
|
|
20373
20391
|
return "npm";
|
|
20374
20392
|
}
|
|
20375
20393
|
if (fs15.existsSync(binaryPath.replace(/\.exe$/i, "") + ".bunx")) return "bun";
|
|
@@ -20381,23 +20399,23 @@ function detectGlobalPackageManager() {
|
|
|
20381
20399
|
return (target ? lockfileOwnerOf(target) : null) ?? "yarn";
|
|
20382
20400
|
}
|
|
20383
20401
|
function lockfileOwnerOf(root) {
|
|
20384
|
-
for (let dir =
|
|
20402
|
+
for (let dir = path17.dirname(root); path17.dirname(dir) !== dir; dir = path17.dirname(dir)) {
|
|
20385
20403
|
const pm = pmFromLockfile(dir);
|
|
20386
20404
|
if (pm) return pm;
|
|
20387
20405
|
}
|
|
20388
20406
|
return null;
|
|
20389
20407
|
}
|
|
20390
20408
|
function npmCopyBeside(binDir) {
|
|
20391
|
-
return process.platform === "win32" ?
|
|
20409
|
+
return process.platform === "win32" ? path17.join(binDir, "node_modules", PACKAGE_NAME) : path17.join(path17.dirname(binDir), "lib", "node_modules", PACKAGE_NAME);
|
|
20392
20410
|
}
|
|
20393
20411
|
function isInNpmLayout(binaryPath, root) {
|
|
20394
20412
|
const realRoot = canonicalPath(root);
|
|
20395
20413
|
let link = binaryPath;
|
|
20396
20414
|
for (let hop = 0; hop < 40; hop++) {
|
|
20397
|
-
const binDir = canonicalPath(
|
|
20415
|
+
const binDir = canonicalPath(path17.dirname(link));
|
|
20398
20416
|
if (canonicalPath(npmCopyBeside(binDir)) === realRoot) return true;
|
|
20399
20417
|
try {
|
|
20400
|
-
link =
|
|
20418
|
+
link = path17.resolve(binDir, fs15.readlinkSync(link));
|
|
20401
20419
|
} catch {
|
|
20402
20420
|
return false;
|
|
20403
20421
|
}
|
|
@@ -20416,7 +20434,7 @@ function asKnownPm(name) {
|
|
|
20416
20434
|
}
|
|
20417
20435
|
function pmFromPackageManagerField(dir) {
|
|
20418
20436
|
try {
|
|
20419
|
-
const pkg = JSON.parse(fs15.readFileSync(
|
|
20437
|
+
const pkg = JSON.parse(fs15.readFileSync(path17.join(dir, "package.json"), "utf8"));
|
|
20420
20438
|
if (typeof pkg.packageManager === "string") {
|
|
20421
20439
|
return asKnownPm(pkg.packageManager.split("@")[0]);
|
|
20422
20440
|
}
|
|
@@ -20427,7 +20445,7 @@ function pmFromPackageManagerField(dir) {
|
|
|
20427
20445
|
}
|
|
20428
20446
|
function pmFromDevEngines(dir) {
|
|
20429
20447
|
try {
|
|
20430
|
-
const pkg = JSON.parse(fs15.readFileSync(
|
|
20448
|
+
const pkg = JSON.parse(fs15.readFileSync(path17.join(dir, "package.json"), "utf8"));
|
|
20431
20449
|
const devEnginesPm = pkg.devEngines?.packageManager;
|
|
20432
20450
|
const names = /* @__PURE__ */ new Set();
|
|
20433
20451
|
for (const entry of Array.isArray(devEnginesPm) ? devEnginesPm : [devEnginesPm]) {
|
|
@@ -20440,7 +20458,7 @@ function pmFromDevEngines(dir) {
|
|
|
20440
20458
|
}
|
|
20441
20459
|
}
|
|
20442
20460
|
function pmFromLockfile(dir) {
|
|
20443
|
-
const has = (file) => fs15.existsSync(
|
|
20461
|
+
const has = (file) => fs15.existsSync(path17.join(dir, file));
|
|
20444
20462
|
if (has("pnpm-lock.yaml")) return "pnpm";
|
|
20445
20463
|
if (has("yarn.lock")) return "yarn";
|
|
20446
20464
|
if (has("bun.lock") || has("bun.lockb")) return "bun";
|
|
@@ -20448,15 +20466,15 @@ function pmFromLockfile(dir) {
|
|
|
20448
20466
|
return null;
|
|
20449
20467
|
}
|
|
20450
20468
|
function pmFromWorkspaceMarker(dir) {
|
|
20451
|
-
return fs15.existsSync(
|
|
20469
|
+
return fs15.existsSync(path17.join(dir, "pnpm-workspace.yaml")) ? "pnpm" : null;
|
|
20452
20470
|
}
|
|
20453
20471
|
function detectProjectPackageManager(projectRoot) {
|
|
20454
|
-
let dir =
|
|
20472
|
+
let dir = path17.resolve(projectRoot);
|
|
20455
20473
|
for (; ; ) {
|
|
20456
20474
|
const pm = pmFromPackageManagerField(dir) ?? pmFromLockfile(dir) ?? pmFromDevEngines(dir) ?? pmFromWorkspaceMarker(dir);
|
|
20457
20475
|
if (pm) return pm;
|
|
20458
|
-
if (fs15.existsSync(
|
|
20459
|
-
const parent =
|
|
20476
|
+
if (fs15.existsSync(path17.join(dir, ".git"))) break;
|
|
20477
|
+
const parent = path17.dirname(dir);
|
|
20460
20478
|
if (parent === dir) break;
|
|
20461
20479
|
dir = parent;
|
|
20462
20480
|
}
|
|
@@ -20509,11 +20527,11 @@ function ownsGlobalInstall(pm, runningRoot) {
|
|
|
20509
20527
|
localBuild = !isRegistrySpec(dependency?.version);
|
|
20510
20528
|
} else {
|
|
20511
20529
|
const dir = pm === "bun" ? /^([^\r\n]+) node_modules \(/.exec(output)?.[1] : output;
|
|
20512
|
-
if (!dir || !
|
|
20513
|
-
pkg = pm === "npm" ?
|
|
20530
|
+
if (!dir || !path17.isAbsolute(dir)) return false;
|
|
20531
|
+
pkg = pm === "npm" ? path17.join(dir, PACKAGE_NAME) : path17.join(dir, "node_modules", PACKAGE_NAME);
|
|
20514
20532
|
localBuild = fs15.lstatSync(pkg).isSymbolicLink();
|
|
20515
20533
|
}
|
|
20516
|
-
return !localBuild && !!pkg &&
|
|
20534
|
+
return !localBuild && !!pkg && path17.isAbsolute(pkg) && fs15.realpathSync(pkg) === runningRoot;
|
|
20517
20535
|
} catch {
|
|
20518
20536
|
return false;
|
|
20519
20537
|
}
|
|
@@ -20569,9 +20587,9 @@ function localUninstallCommand(pm, pkg) {
|
|
|
20569
20587
|
|
|
20570
20588
|
// ../argent-installer/src/install-record.ts
|
|
20571
20589
|
import * as fs16 from "node:fs";
|
|
20572
|
-
import * as
|
|
20590
|
+
import * as path18 from "node:path";
|
|
20573
20591
|
function getInstallRecordPath(projectRoot) {
|
|
20574
|
-
return
|
|
20592
|
+
return path18.join(projectRoot, ".argent", "install.json");
|
|
20575
20593
|
}
|
|
20576
20594
|
function readInstallRecord(projectRoot) {
|
|
20577
20595
|
try {
|
|
@@ -20586,7 +20604,7 @@ function readInstallRecord(projectRoot) {
|
|
|
20586
20604
|
}
|
|
20587
20605
|
function writeInstallRecord(projectRoot, record) {
|
|
20588
20606
|
const recordPath = getInstallRecordPath(projectRoot);
|
|
20589
|
-
fs16.mkdirSync(
|
|
20607
|
+
fs16.mkdirSync(path18.dirname(recordPath), { recursive: true });
|
|
20590
20608
|
fs16.writeFileSync(recordPath, JSON.stringify(record, null, 2) + "\n");
|
|
20591
20609
|
}
|
|
20592
20610
|
function removeInstallRecord(projectRoot) {
|
|
@@ -20594,7 +20612,7 @@ function removeInstallRecord(projectRoot) {
|
|
|
20594
20612
|
try {
|
|
20595
20613
|
if (!fs16.existsSync(recordPath)) return false;
|
|
20596
20614
|
fs16.rmSync(recordPath, { force: true });
|
|
20597
|
-
const dir =
|
|
20615
|
+
const dir = path18.dirname(recordPath);
|
|
20598
20616
|
try {
|
|
20599
20617
|
if (fs16.existsSync(dir) && fs16.readdirSync(dir).length === 0) fs16.rmdirSync(dir);
|
|
20600
20618
|
} catch {
|
|
@@ -20624,9 +20642,9 @@ function resolveInstallModeFromFlags(opts) {
|
|
|
20624
20642
|
// ../argent-installer/src/utils.ts
|
|
20625
20643
|
var PACKAGE_ROOT = resolvePackageRoot(import.meta.dirname);
|
|
20626
20644
|
function resolveBundledDir(dirName) {
|
|
20627
|
-
const packagedDir =
|
|
20645
|
+
const packagedDir = path19.join(PACKAGE_ROOT, dirName);
|
|
20628
20646
|
if (fs17.existsSync(packagedDir)) return packagedDir;
|
|
20629
|
-
return
|
|
20647
|
+
return path19.resolve(PACKAGE_ROOT, "..", "skills", dirName);
|
|
20630
20648
|
}
|
|
20631
20649
|
var SKILLS_DIR = resolveBundledDir("skills");
|
|
20632
20650
|
var RULES_DIR = resolveBundledDir("rules");
|
|
@@ -20638,18 +20656,18 @@ function buildArgentSkillsSource(version) {
|
|
|
20638
20656
|
}
|
|
20639
20657
|
function listBundledSkills(skillsDir = SKILLS_DIR) {
|
|
20640
20658
|
try {
|
|
20641
|
-
return fs17.readdirSync(skillsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).filter((name) => fs17.existsSync(
|
|
20659
|
+
return fs17.readdirSync(skillsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).filter((name) => fs17.existsSync(path19.join(skillsDir, name, "SKILL.md"))).sort();
|
|
20642
20660
|
} catch {
|
|
20643
20661
|
return [];
|
|
20644
20662
|
}
|
|
20645
20663
|
}
|
|
20646
20664
|
function getProjectSkillLockPath(cwd = process.cwd()) {
|
|
20647
|
-
return
|
|
20665
|
+
return path19.join(cwd, "skills-lock.json");
|
|
20648
20666
|
}
|
|
20649
20667
|
function getGlobalSkillLockPath() {
|
|
20650
20668
|
const xdgStateHome = process.env.XDG_STATE_HOME;
|
|
20651
|
-
if (xdgStateHome) return
|
|
20652
|
-
return
|
|
20669
|
+
if (xdgStateHome) return path19.join(xdgStateHome, "skills", ".skill-lock.json");
|
|
20670
|
+
return path19.join(os3.homedir(), ".agents", ".skill-lock.json");
|
|
20653
20671
|
}
|
|
20654
20672
|
var ARGENT_SKILL_PREFIX = "argent-";
|
|
20655
20673
|
var LEGACY_ARGENT_SKILL_NAMES = [
|
|
@@ -20779,20 +20797,20 @@ var PROJECT_ROOT_MARKERS = [
|
|
|
20779
20797
|
"skills-lock.json"
|
|
20780
20798
|
];
|
|
20781
20799
|
function resolveProjectRoot2(startDir, homeDir = os3.homedir()) {
|
|
20782
|
-
const initialDir =
|
|
20800
|
+
const initialDir = path19.resolve(startDir);
|
|
20783
20801
|
const home = canonicalPath(homeDir);
|
|
20784
20802
|
let currentDir = initialDir;
|
|
20785
20803
|
while (true) {
|
|
20786
20804
|
if (currentDir !== initialDir && canonicalPath(currentDir) === home) {
|
|
20787
20805
|
return initialDir;
|
|
20788
20806
|
}
|
|
20789
|
-
if (PROJECT_ROOT_MARKERS.some((marker) => fs17.existsSync(
|
|
20807
|
+
if (PROJECT_ROOT_MARKERS.some((marker) => fs17.existsSync(path19.join(currentDir, marker)))) {
|
|
20790
20808
|
return currentDir;
|
|
20791
20809
|
}
|
|
20792
|
-
if (fs17.existsSync(
|
|
20810
|
+
if (fs17.existsSync(path19.join(currentDir, ".git"))) {
|
|
20793
20811
|
return currentDir;
|
|
20794
20812
|
}
|
|
20795
|
-
const parentDir =
|
|
20813
|
+
const parentDir = path19.dirname(currentDir);
|
|
20796
20814
|
if (parentDir === currentDir) {
|
|
20797
20815
|
return initialDir;
|
|
20798
20816
|
}
|
|
@@ -20808,7 +20826,7 @@ function readToml(filePath) {
|
|
|
20808
20826
|
}
|
|
20809
20827
|
}
|
|
20810
20828
|
function writeToml(filePath, data) {
|
|
20811
|
-
fs17.mkdirSync(
|
|
20829
|
+
fs17.mkdirSync(path19.dirname(filePath), { recursive: true });
|
|
20812
20830
|
fs17.writeFileSync(filePath, stringify(data) + "\n");
|
|
20813
20831
|
}
|
|
20814
20832
|
function readYaml(filePath) {
|
|
@@ -20822,7 +20840,7 @@ function readYaml(filePath) {
|
|
|
20822
20840
|
return doc;
|
|
20823
20841
|
}
|
|
20824
20842
|
function writeYaml(filePath, doc) {
|
|
20825
|
-
fs17.mkdirSync(
|
|
20843
|
+
fs17.mkdirSync(path19.dirname(filePath), { recursive: true });
|
|
20826
20844
|
fs17.writeFileSync(filePath, doc.toString({ lineWidth: 0 }));
|
|
20827
20845
|
}
|
|
20828
20846
|
function readJson(filePath) {
|
|
@@ -20834,7 +20852,7 @@ function readJson(filePath) {
|
|
|
20834
20852
|
}
|
|
20835
20853
|
}
|
|
20836
20854
|
function writeJson(filePath, data) {
|
|
20837
|
-
fs17.mkdirSync(
|
|
20855
|
+
fs17.mkdirSync(path19.dirname(filePath), { recursive: true });
|
|
20838
20856
|
fs17.writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n");
|
|
20839
20857
|
}
|
|
20840
20858
|
var JSONC_FORMATTING = { tabSize: 2, insertSpaces: true };
|
|
@@ -20930,10 +20948,10 @@ function editJsoncFile(filePath, jsonPath, value) {
|
|
|
20930
20948
|
const parsed = parse3(text2, [], { allowTrailingComma: true });
|
|
20931
20949
|
if (isEmptyPlainObject(parsed)) {
|
|
20932
20950
|
fs17.rmSync(filePath, { force: true });
|
|
20933
|
-
rmEmptyDir(
|
|
20951
|
+
rmEmptyDir(path19.dirname(filePath));
|
|
20934
20952
|
return;
|
|
20935
20953
|
}
|
|
20936
|
-
fs17.mkdirSync(
|
|
20954
|
+
fs17.mkdirSync(path19.dirname(filePath), { recursive: true });
|
|
20937
20955
|
const out = wasEmpty && !text2.endsWith("\n") ? text2 + "\n" : text2;
|
|
20938
20956
|
fs17.writeFileSync(filePath, (hadBom ? "\uFEFF" : "") + out);
|
|
20939
20957
|
}
|
|
@@ -20952,11 +20970,11 @@ function resolveLinkedDestination(dest) {
|
|
|
20952
20970
|
try {
|
|
20953
20971
|
entry = fs17.lstatSync(current);
|
|
20954
20972
|
} catch {
|
|
20955
|
-
return current === dest || dirExists(
|
|
20973
|
+
return current === dest || dirExists(path19.dirname(current)) ? current : dest;
|
|
20956
20974
|
}
|
|
20957
20975
|
if (!entry.isSymbolicLink()) return current;
|
|
20958
20976
|
try {
|
|
20959
|
-
current =
|
|
20977
|
+
current = path19.resolve(realpathOrSelf(path19.dirname(current)), fs17.readlinkSync(current));
|
|
20960
20978
|
} catch {
|
|
20961
20979
|
return dest;
|
|
20962
20980
|
}
|
|
@@ -20970,20 +20988,20 @@ function copyDir(src, dest) {
|
|
|
20970
20988
|
return target;
|
|
20971
20989
|
}
|
|
20972
20990
|
function treeHasFiles(dir) {
|
|
20973
|
-
return fs17.readdirSync(dir, { withFileTypes: true }).some((entry) => !entry.isDirectory() || treeHasFiles(
|
|
20991
|
+
return fs17.readdirSync(dir, { withFileTypes: true }).some((entry) => !entry.isDirectory() || treeHasFiles(path19.join(dir, entry.name)));
|
|
20974
20992
|
}
|
|
20975
20993
|
function copyTree(src, dest) {
|
|
20976
20994
|
const entries = fs17.readdirSync(src, { withFileTypes: true });
|
|
20977
20995
|
fs17.mkdirSync(dest, { recursive: true });
|
|
20978
20996
|
for (const entry of entries) {
|
|
20979
|
-
const from =
|
|
20980
|
-
const to = resolveLinkedDestination(
|
|
20997
|
+
const from = path19.join(src, entry.name);
|
|
20998
|
+
const to = resolveLinkedDestination(path19.join(dest, entry.name));
|
|
20981
20999
|
if (entry.isDirectory()) copyTree(from, to);
|
|
20982
21000
|
else fs17.copyFileSync(from, to);
|
|
20983
21001
|
}
|
|
20984
21002
|
}
|
|
20985
21003
|
function readRetiredFile(targetDir, relativePath) {
|
|
20986
|
-
const entryPath =
|
|
21004
|
+
const entryPath = path19.join(resolveLinkedDestination(targetDir), ...relativePath.split("/"));
|
|
20987
21005
|
const file = resolveLinkedDestination(entryPath);
|
|
20988
21006
|
try {
|
|
20989
21007
|
if (!fs17.statSync(file, { throwIfNoEntry: false })?.isFile()) return null;
|
|
@@ -20995,7 +21013,7 @@ function readRetiredFile(targetDir, relativePath) {
|
|
|
20995
21013
|
function findRetiredFiles(retired, bundleDir, targetDir) {
|
|
20996
21014
|
const found = [];
|
|
20997
21015
|
for (const { path: relativePath, shipped } of retired) {
|
|
20998
|
-
if (bundleDir !== null && fs17.existsSync(
|
|
21016
|
+
if (bundleDir !== null && fs17.existsSync(path19.join(bundleDir, ...relativePath.split("/"))))
|
|
20999
21017
|
continue;
|
|
21000
21018
|
const content = readRetiredFile(targetDir, relativePath);
|
|
21001
21019
|
if (content === null) continue;
|
|
@@ -21011,7 +21029,7 @@ function removeRetiredFiles(targetDir, files) {
|
|
|
21011
21029
|
const content = readRetiredFile(targetDir, relativePath);
|
|
21012
21030
|
if (content === null || hashBundledContent(content) !== sha256) continue;
|
|
21013
21031
|
const segments = relativePath.split("/");
|
|
21014
|
-
const entryPath =
|
|
21032
|
+
const entryPath = path19.join(dir, ...segments);
|
|
21015
21033
|
const file = resolveLinkedDestination(entryPath);
|
|
21016
21034
|
try {
|
|
21017
21035
|
fs17.rmSync(file);
|
|
@@ -21021,7 +21039,7 @@ function removeRetiredFiles(targetDir, files) {
|
|
|
21021
21039
|
continue;
|
|
21022
21040
|
}
|
|
21023
21041
|
for (let depth = segments.length - 1; depth > 0; depth--) {
|
|
21024
|
-
if (!rmEmptyDir(
|
|
21042
|
+
if (!rmEmptyDir(path19.join(dir, ...segments.slice(0, depth)))) break;
|
|
21025
21043
|
}
|
|
21026
21044
|
}
|
|
21027
21045
|
const removedRoot = removedPaths.length > 0 && dir === targetDir && rmEmptyDir(dir);
|
|
@@ -21036,7 +21054,7 @@ function dirExists(p) {
|
|
|
21036
21054
|
}
|
|
21037
21055
|
function getInstalledVersion() {
|
|
21038
21056
|
try {
|
|
21039
|
-
const pkgPath =
|
|
21057
|
+
const pkgPath = path19.join(PACKAGE_ROOT, "package.json");
|
|
21040
21058
|
const pkg = JSON.parse(fs17.readFileSync(pkgPath, "utf8"));
|
|
21041
21059
|
return pkg.version ?? null;
|
|
21042
21060
|
} catch {
|
|
@@ -21082,12 +21100,12 @@ async function isOnline(timeoutMs = PROBE_TIMEOUT_MS) {
|
|
|
21082
21100
|
} catch {
|
|
21083
21101
|
return false;
|
|
21084
21102
|
}
|
|
21085
|
-
return new Promise((
|
|
21086
|
-
const timer = setTimeout(() =>
|
|
21103
|
+
return new Promise((resolve22) => {
|
|
21104
|
+
const timer = setTimeout(() => resolve22(false), timeoutMs);
|
|
21087
21105
|
timer.unref();
|
|
21088
21106
|
dns.lookup(host, (err) => {
|
|
21089
21107
|
clearTimeout(timer);
|
|
21090
|
-
|
|
21108
|
+
resolve22(!err);
|
|
21091
21109
|
});
|
|
21092
21110
|
});
|
|
21093
21111
|
}
|
|
@@ -21104,7 +21122,7 @@ function escapeStringRegexp(string) {
|
|
|
21104
21122
|
}
|
|
21105
21123
|
|
|
21106
21124
|
// ../argent-installer/src/mcp-configs.ts
|
|
21107
|
-
var TOOL_SERVER_BUNDLE =
|
|
21125
|
+
var TOOL_SERVER_BUNDLE = path20.join(import.meta.dirname, "tool-server.cjs");
|
|
21108
21126
|
function getAvailableToolIds() {
|
|
21109
21127
|
const out = execFileSync5("node", [TOOL_SERVER_BUNDLE, "-t"], { encoding: "utf8" });
|
|
21110
21128
|
const tools = JSON.parse(out);
|
|
@@ -21208,7 +21226,7 @@ function isArgentManagedEntry(entry) {
|
|
|
21208
21226
|
return args.length === 1 && args[0] === "mcp";
|
|
21209
21227
|
case "node": {
|
|
21210
21228
|
if (args.length !== 2 || args[1] !== "mcp" || !args[0]) return false;
|
|
21211
|
-
if (
|
|
21229
|
+
if (path20.isAbsolute(args[0])) return false;
|
|
21212
21230
|
const normalized = args[0].split("\\").join("/");
|
|
21213
21231
|
return normalized.includes(`node_modules/${PACKAGE_NAME}/`);
|
|
21214
21232
|
}
|
|
@@ -21222,12 +21240,12 @@ function isArgentManagedEntry(entry) {
|
|
|
21222
21240
|
}
|
|
21223
21241
|
function isPinnedGlobalEntry(entry) {
|
|
21224
21242
|
const [cli, subcommand] = entry.args;
|
|
21225
|
-
return
|
|
21243
|
+
return path20.isAbsolute(entry.command) && path20.basename(entry.command) === "node" && entry.args.length === 2 && subcommand === "mcp" && path20.isAbsolute(cli) && cli.includes(`/node_modules/${PACKAGE_NAME}/`);
|
|
21226
21244
|
}
|
|
21227
21245
|
function writeTomlOrRemove(filePath, data) {
|
|
21228
21246
|
if (Object.keys(data).length === 0) {
|
|
21229
21247
|
fs18.rmSync(filePath, { force: true });
|
|
21230
|
-
removeDirIfEmpty(
|
|
21248
|
+
removeDirIfEmpty(path20.dirname(filePath));
|
|
21231
21249
|
return;
|
|
21232
21250
|
}
|
|
21233
21251
|
writeToml(filePath, data);
|
|
@@ -21313,7 +21331,7 @@ function cursorDirLooksArgentOnly(dir) {
|
|
|
21313
21331
|
}
|
|
21314
21332
|
if (entries.length === 0) return false;
|
|
21315
21333
|
return entries.every((entry) => {
|
|
21316
|
-
const full =
|
|
21334
|
+
const full = path20.join(dir, entry);
|
|
21317
21335
|
if (entry === "mcp.json") {
|
|
21318
21336
|
return jsonLooksArgentServerOnly(full, "mcpServers");
|
|
21319
21337
|
}
|
|
@@ -21352,7 +21370,7 @@ function claudeDirLooksArgentOnly(dir) {
|
|
|
21352
21370
|
}
|
|
21353
21371
|
if (entries.length === 0) return false;
|
|
21354
21372
|
return entries.every((entry) => {
|
|
21355
|
-
const full =
|
|
21373
|
+
const full = path20.join(dir, entry);
|
|
21356
21374
|
if (entry === "settings.json") return claudeSettingsLooksArgentOnly(full);
|
|
21357
21375
|
if (entry === "rules" || entry === "agents" || entry === "skills") {
|
|
21358
21376
|
return managedDirLooksArgentOnly(full, entry);
|
|
@@ -21369,7 +21387,7 @@ function vscodeDirLooksArgentOnly(dir) {
|
|
|
21369
21387
|
}
|
|
21370
21388
|
if (entries.length === 0) return false;
|
|
21371
21389
|
return entries.every(
|
|
21372
|
-
(entry) => entry === "mcp.json" && jsonLooksArgentServerOnly(
|
|
21390
|
+
(entry) => entry === "mcp.json" && jsonLooksArgentServerOnly(path20.join(dir, entry), "servers")
|
|
21373
21391
|
);
|
|
21374
21392
|
}
|
|
21375
21393
|
function windsurfDirLooksArgentOnly(dir) {
|
|
@@ -21381,7 +21399,7 @@ function windsurfDirLooksArgentOnly(dir) {
|
|
|
21381
21399
|
}
|
|
21382
21400
|
if (entries.length === 0) return false;
|
|
21383
21401
|
return entries.every(
|
|
21384
|
-
(entry) => entry === "mcp_config.json" && jsonLooksArgentServerOnly(
|
|
21402
|
+
(entry) => entry === "mcp_config.json" && jsonLooksArgentServerOnly(path20.join(dir, entry), "mcpServers")
|
|
21385
21403
|
);
|
|
21386
21404
|
}
|
|
21387
21405
|
function zedSettingsLooksArgentOnly(filePath) {
|
|
@@ -21418,7 +21436,7 @@ function zedDirLooksArgentOnly(dir) {
|
|
|
21418
21436
|
}
|
|
21419
21437
|
if (entries.length === 0) return false;
|
|
21420
21438
|
return entries.every(
|
|
21421
|
-
(entry) => entry === "settings.json" && zedSettingsLooksArgentOnly(
|
|
21439
|
+
(entry) => entry === "settings.json" && zedSettingsLooksArgentOnly(path20.join(dir, entry))
|
|
21422
21440
|
);
|
|
21423
21441
|
}
|
|
21424
21442
|
function geminiDirLooksArgentOnly(dir) {
|
|
@@ -21430,7 +21448,7 @@ function geminiDirLooksArgentOnly(dir) {
|
|
|
21430
21448
|
}
|
|
21431
21449
|
if (entries.length === 0) return false;
|
|
21432
21450
|
return entries.every((entry) => {
|
|
21433
|
-
const full =
|
|
21451
|
+
const full = path20.join(dir, entry);
|
|
21434
21452
|
if (entry === "settings.json") return jsonLooksArgentServerOnly(full, "mcpServers");
|
|
21435
21453
|
if (entry === "rules" || entry === "agents") return managedDirLooksArgentOnly(full, entry);
|
|
21436
21454
|
return false;
|
|
@@ -21455,7 +21473,7 @@ function hermesDirLooksArgentOnly(dir) {
|
|
|
21455
21473
|
}
|
|
21456
21474
|
if (entries.length === 0) return false;
|
|
21457
21475
|
return entries.every(
|
|
21458
|
-
(entry) => entry === "config.yaml" && hermesConfigLooksArgentOnly(
|
|
21476
|
+
(entry) => entry === "config.yaml" && hermesConfigLooksArgentOnly(path20.join(dir, entry))
|
|
21459
21477
|
);
|
|
21460
21478
|
}
|
|
21461
21479
|
function kiroDirLooksArgentOnly(dir) {
|
|
@@ -21468,7 +21486,7 @@ function kiroDirLooksArgentOnly(dir) {
|
|
|
21468
21486
|
if (entries.length === 0) return false;
|
|
21469
21487
|
return entries.every((entry) => {
|
|
21470
21488
|
if (entry !== "settings") return false;
|
|
21471
|
-
const settingsDir =
|
|
21489
|
+
const settingsDir = path20.join(dir, entry);
|
|
21472
21490
|
let settingsEntries;
|
|
21473
21491
|
try {
|
|
21474
21492
|
settingsEntries = fs18.readdirSync(settingsDir);
|
|
@@ -21477,7 +21495,7 @@ function kiroDirLooksArgentOnly(dir) {
|
|
|
21477
21495
|
}
|
|
21478
21496
|
if (settingsEntries.length === 0) return false;
|
|
21479
21497
|
return settingsEntries.every(
|
|
21480
|
-
(name) => name === "mcp.json" && jsonLooksArgentServerOnly(
|
|
21498
|
+
(name) => name === "mcp.json" && jsonLooksArgentServerOnly(path20.join(settingsDir, name), "mcpServers")
|
|
21481
21499
|
);
|
|
21482
21500
|
});
|
|
21483
21501
|
}
|
|
@@ -21490,7 +21508,7 @@ function codexDirLooksArgentOnly(dir) {
|
|
|
21490
21508
|
}
|
|
21491
21509
|
if (entries.length === 0) return false;
|
|
21492
21510
|
return entries.every((entry) => {
|
|
21493
|
-
const full =
|
|
21511
|
+
const full = path20.join(dir, entry);
|
|
21494
21512
|
if (entry === "config.toml") {
|
|
21495
21513
|
const config = parseTomlStrict(full);
|
|
21496
21514
|
if (config === null) return false;
|
|
@@ -21515,7 +21533,7 @@ function codexDirLooksArgentOnly(dir) {
|
|
|
21515
21533
|
});
|
|
21516
21534
|
}
|
|
21517
21535
|
function cursorPermissionsPath() {
|
|
21518
|
-
return
|
|
21536
|
+
return path20.join(homedir4(), ".cursor", "permissions.json");
|
|
21519
21537
|
}
|
|
21520
21538
|
function cursorPermissionsList() {
|
|
21521
21539
|
const list = readJsonc(cursorPermissionsPath()).mcpAllowlist;
|
|
@@ -21524,13 +21542,13 @@ function cursorPermissionsList() {
|
|
|
21524
21542
|
var cursorAdapter = {
|
|
21525
21543
|
name: "Cursor",
|
|
21526
21544
|
detect() {
|
|
21527
|
-
return dirHasEditorEvidence(
|
|
21545
|
+
return dirHasEditorEvidence(path20.join(homedir4(), ".cursor"), cursorDirLooksArgentOnly) || dirHasEditorEvidence(path20.join(process.cwd(), ".cursor"), cursorDirLooksArgentOnly);
|
|
21528
21546
|
},
|
|
21529
21547
|
projectPath(root) {
|
|
21530
|
-
return
|
|
21548
|
+
return path20.join(root, ".cursor", "mcp.json");
|
|
21531
21549
|
},
|
|
21532
21550
|
globalPath() {
|
|
21533
|
-
return
|
|
21551
|
+
return path20.join(homedir4(), ".cursor", "mcp.json");
|
|
21534
21552
|
},
|
|
21535
21553
|
// Read and written as JSONC through readJsonc / editJsoncFile: path-targeted
|
|
21536
21554
|
// text edits that preserve user comments and foreign servers.
|
|
@@ -21616,13 +21634,13 @@ var claudeAdapter = {
|
|
|
21616
21634
|
name: "Claude Code",
|
|
21617
21635
|
detect() {
|
|
21618
21636
|
const mcpJsonArgentOnly = (p) => jsonLooksArgentServerOnly(p, "mcpServers");
|
|
21619
|
-
return fileHasEditorEvidence(
|
|
21637
|
+
return fileHasEditorEvidence(path20.join(process.cwd(), ".mcp.json"), mcpJsonArgentOnly) || fileHasEditorEvidence(path20.join(homedir4(), ".claude.json"), mcpJsonArgentOnly) || dirHasEditorEvidence(path20.join(process.cwd(), ".claude"), claudeDirLooksArgentOnly) || dirHasEditorEvidence(path20.join(homedir4(), ".claude"), claudeDirLooksArgentOnly);
|
|
21620
21638
|
},
|
|
21621
21639
|
projectPath(root) {
|
|
21622
|
-
return
|
|
21640
|
+
return path20.join(root, ".mcp.json");
|
|
21623
21641
|
},
|
|
21624
21642
|
globalPath() {
|
|
21625
|
-
return
|
|
21643
|
+
return path20.join(homedir4(), ".claude.json");
|
|
21626
21644
|
},
|
|
21627
21645
|
// JSONC is a superset of JSON, so this config shares the one comment- and
|
|
21628
21646
|
// foreign-server-preserving write path (see the Cursor adapter).
|
|
@@ -21662,7 +21680,7 @@ var claudeAdapter = {
|
|
|
21662
21680
|
// .mcp.json rejections (see claudeDisabledListFinding).
|
|
21663
21681
|
findShadowingConfigs(root, writtenScope) {
|
|
21664
21682
|
const findings = [];
|
|
21665
|
-
const claudeJsonPath =
|
|
21683
|
+
const claudeJsonPath = path20.join(homedir4(), ".claude.json");
|
|
21666
21684
|
const projects = readJson(claudeJsonPath).projects;
|
|
21667
21685
|
if (isRecord(projects)) {
|
|
21668
21686
|
for (const key of claudeProjectKeysForRoot(projects, root)) {
|
|
@@ -21699,9 +21717,9 @@ var claudeAdapter = {
|
|
|
21699
21717
|
}
|
|
21700
21718
|
if (writtenScope === "local") {
|
|
21701
21719
|
const candidates = [
|
|
21702
|
-
[
|
|
21703
|
-
[
|
|
21704
|
-
[
|
|
21720
|
+
[path20.join(root, ".claude", "settings.json"), ".claude/settings.json", true],
|
|
21721
|
+
[path20.join(root, ".claude", "settings.local.json"), ".claude/settings.local.json", true],
|
|
21722
|
+
[path20.join(homedir4(), ".claude", "settings.json"), "~/.claude/settings.json", false]
|
|
21705
21723
|
];
|
|
21706
21724
|
for (const [settingsPath, label, projectConfined] of candidates) {
|
|
21707
21725
|
const finding = claudeDisabledListFinding(settingsPath, label, projectConfined);
|
|
@@ -21720,10 +21738,10 @@ var claudeAdapter = {
|
|
|
21720
21738
|
var vscodeAdapter = {
|
|
21721
21739
|
name: "VS Code",
|
|
21722
21740
|
detect() {
|
|
21723
|
-
return dirHasEditorEvidence(
|
|
21741
|
+
return dirHasEditorEvidence(path20.join(process.cwd(), ".vscode"), vscodeDirLooksArgentOnly) || dirExists(path20.join(homedir4(), ".vscode"));
|
|
21724
21742
|
},
|
|
21725
21743
|
projectPath(root) {
|
|
21726
|
-
return
|
|
21744
|
+
return path20.join(root, ".vscode", "mcp.json");
|
|
21727
21745
|
},
|
|
21728
21746
|
globalPath() {
|
|
21729
21747
|
return null;
|
|
@@ -21760,7 +21778,7 @@ var vscodeAdapter = {
|
|
|
21760
21778
|
findShadowingConfigs(_root, _writtenScope) {
|
|
21761
21779
|
const findings = [];
|
|
21762
21780
|
for (const userDir of vscodeUserDirs()) {
|
|
21763
|
-
const configPath =
|
|
21781
|
+
const configPath = path20.join(userDir, "mcp.json");
|
|
21764
21782
|
const entry = this.getArgentEntry(configPath);
|
|
21765
21783
|
if (!entry) continue;
|
|
21766
21784
|
findings.push({
|
|
@@ -21777,16 +21795,16 @@ var vscodeAdapter = {
|
|
|
21777
21795
|
function vscodeUserDirs() {
|
|
21778
21796
|
const bases = [];
|
|
21779
21797
|
if (process.platform === "darwin") {
|
|
21780
|
-
bases.push(
|
|
21798
|
+
bases.push(path20.join(homedir4(), "Library", "Application Support"));
|
|
21781
21799
|
} else if (process.platform === "win32") {
|
|
21782
21800
|
if (process.env.APPDATA) bases.push(process.env.APPDATA);
|
|
21783
21801
|
} else {
|
|
21784
|
-
bases.push(
|
|
21802
|
+
bases.push(path20.join(homedir4(), ".config"));
|
|
21785
21803
|
}
|
|
21786
21804
|
const dirs = [];
|
|
21787
21805
|
for (const base of bases) {
|
|
21788
21806
|
for (const product of ["Code", "Code - Insiders"]) {
|
|
21789
|
-
const dir =
|
|
21807
|
+
const dir = path20.join(base, product, "User");
|
|
21790
21808
|
if (dirExists(dir)) dirs.push(dir);
|
|
21791
21809
|
}
|
|
21792
21810
|
}
|
|
@@ -21794,18 +21812,18 @@ function vscodeUserDirs() {
|
|
|
21794
21812
|
}
|
|
21795
21813
|
function devinUserConfigPath() {
|
|
21796
21814
|
if (process.platform === "win32") {
|
|
21797
|
-
const appData = process.env.APPDATA ||
|
|
21798
|
-
return
|
|
21815
|
+
const appData = process.env.APPDATA || path20.join(homedir4(), "AppData", "Roaming");
|
|
21816
|
+
return path20.join(appData, "devin", "config.json");
|
|
21799
21817
|
}
|
|
21800
21818
|
const xdg = process.env.XDG_CONFIG_HOME;
|
|
21801
|
-
return
|
|
21819
|
+
return path20.join(xdg || path20.join(homedir4(), ".config"), "devin", "config.json");
|
|
21802
21820
|
}
|
|
21803
21821
|
var windsurfAdapter = {
|
|
21804
21822
|
name: "Devin Desktop",
|
|
21805
21823
|
telemetryName: "windsurf",
|
|
21806
21824
|
detect() {
|
|
21807
21825
|
return dirHasEditorEvidence(
|
|
21808
|
-
|
|
21826
|
+
path20.join(homedir4(), ".codeium", "windsurf"),
|
|
21809
21827
|
windsurfDirLooksArgentOnly
|
|
21810
21828
|
);
|
|
21811
21829
|
},
|
|
@@ -21813,7 +21831,7 @@ var windsurfAdapter = {
|
|
|
21813
21831
|
return null;
|
|
21814
21832
|
},
|
|
21815
21833
|
globalPath() {
|
|
21816
|
-
return
|
|
21834
|
+
return path20.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
|
|
21817
21835
|
},
|
|
21818
21836
|
// JSONC-safe writes (see the Cursor adapter).
|
|
21819
21837
|
write(configPath, entry) {
|
|
@@ -21845,7 +21863,7 @@ var windsurfAdapter = {
|
|
|
21845
21863
|
// servers survive. alwaysAllow serves the legacy Cascade agent; the Devin
|
|
21846
21864
|
// agent needs its own permission rule.
|
|
21847
21865
|
addAllowlist() {
|
|
21848
|
-
const configPath =
|
|
21866
|
+
const configPath = path20.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
|
|
21849
21867
|
const config = readJsonc(configPath);
|
|
21850
21868
|
const servers = config.mcpServers;
|
|
21851
21869
|
if (!servers?.[MCP_SERVER_KEY]) return;
|
|
@@ -21855,7 +21873,7 @@ var windsurfAdapter = {
|
|
|
21855
21873
|
removeAllowlist(_root, scope) {
|
|
21856
21874
|
if (scope !== "global") return;
|
|
21857
21875
|
removeAllowRule(devinUserConfigPath(), DEVIN_PERMISSION_RULE);
|
|
21858
|
-
const configPath =
|
|
21876
|
+
const configPath = path20.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
|
|
21859
21877
|
if (!fs18.existsSync(configPath)) return;
|
|
21860
21878
|
const config = readJsonc(configPath);
|
|
21861
21879
|
const servers = config.mcpServers;
|
|
@@ -21867,13 +21885,13 @@ var windsurfAdapter = {
|
|
|
21867
21885
|
var zedAdapter = {
|
|
21868
21886
|
name: "Zed",
|
|
21869
21887
|
detect() {
|
|
21870
|
-
return dirHasEditorEvidence(
|
|
21888
|
+
return dirHasEditorEvidence(path20.join(homedir4(), ".config", "zed"), zedDirLooksArgentOnly);
|
|
21871
21889
|
},
|
|
21872
21890
|
projectPath(root) {
|
|
21873
|
-
return
|
|
21891
|
+
return path20.join(root, ".zed", "settings.json");
|
|
21874
21892
|
},
|
|
21875
21893
|
globalPath() {
|
|
21876
|
-
return
|
|
21894
|
+
return path20.join(homedir4(), ".config", "zed", "settings.json");
|
|
21877
21895
|
},
|
|
21878
21896
|
// Read and written as JSONC through readJsonc / editJsoncFile so comments and
|
|
21879
21897
|
// formatting outside the touched key survive (see the Cursor adapter).
|
|
@@ -21905,11 +21923,11 @@ var zedAdapter = {
|
|
|
21905
21923
|
// Zed has no server-level wildcard for MCP tools — each tool would need its
|
|
21906
21924
|
// own entry — so the global default is set to "allow" instead.
|
|
21907
21925
|
addAllowlist(root, scope) {
|
|
21908
|
-
const settingsPath = scope === "global" ?
|
|
21926
|
+
const settingsPath = scope === "global" ? path20.join(homedir4(), ".config", "zed", "settings.json") : path20.join(root, ".zed", "settings.json");
|
|
21909
21927
|
editJsoncFile(settingsPath, ["agent", "tool_permissions", "default"], "allow");
|
|
21910
21928
|
},
|
|
21911
21929
|
removeAllowlist(root, scope) {
|
|
21912
|
-
const settingsPath = scope === "global" ?
|
|
21930
|
+
const settingsPath = scope === "global" ? path20.join(homedir4(), ".config", "zed", "settings.json") : path20.join(root, ".zed", "settings.json");
|
|
21913
21931
|
if (!fs18.existsSync(settingsPath)) return;
|
|
21914
21932
|
const config = readJsonc(settingsPath);
|
|
21915
21933
|
const perms = config.agent?.tool_permissions;
|
|
@@ -21920,13 +21938,13 @@ var zedAdapter = {
|
|
|
21920
21938
|
var geminiAdapter = {
|
|
21921
21939
|
name: "Gemini",
|
|
21922
21940
|
detect() {
|
|
21923
|
-
return dirHasEditorEvidence(
|
|
21941
|
+
return dirHasEditorEvidence(path20.join(homedir4(), ".gemini"), geminiDirLooksArgentOnly) || dirHasEditorEvidence(path20.join(process.cwd(), ".gemini"), geminiDirLooksArgentOnly);
|
|
21924
21942
|
},
|
|
21925
21943
|
projectPath(root) {
|
|
21926
|
-
return
|
|
21944
|
+
return path20.join(root, ".gemini", "settings.json");
|
|
21927
21945
|
},
|
|
21928
21946
|
globalPath() {
|
|
21929
|
-
return
|
|
21947
|
+
return path20.join(homedir4(), ".gemini", "settings.json");
|
|
21930
21948
|
},
|
|
21931
21949
|
// JSONC-safe writes (see the Cursor adapter).
|
|
21932
21950
|
write(configPath, entry) {
|
|
@@ -21982,13 +22000,13 @@ var CODEX_FILENAME = ".codex";
|
|
|
21982
22000
|
var codexAdapter = {
|
|
21983
22001
|
name: "Codex",
|
|
21984
22002
|
detect() {
|
|
21985
|
-
return dirHasEditorEvidence(
|
|
22003
|
+
return dirHasEditorEvidence(path20.join(homedir4(), CODEX_FILENAME), codexDirLooksArgentOnly) || dirHasEditorEvidence(path20.join(process.cwd(), CODEX_FILENAME), codexDirLooksArgentOnly);
|
|
21986
22004
|
},
|
|
21987
22005
|
projectPath(root) {
|
|
21988
|
-
return
|
|
22006
|
+
return path20.join(root, CODEX_FILENAME, "config.toml");
|
|
21989
22007
|
},
|
|
21990
22008
|
globalPath() {
|
|
21991
|
-
return
|
|
22009
|
+
return path20.join(homedir4(), CODEX_FILENAME, "config.toml");
|
|
21992
22010
|
},
|
|
21993
22011
|
write(configPath, entry) {
|
|
21994
22012
|
const config = readToml(configPath);
|
|
@@ -22083,13 +22101,13 @@ var codexAdapter = {
|
|
|
22083
22101
|
var hermesAdapter = {
|
|
22084
22102
|
name: "Hermes",
|
|
22085
22103
|
detect() {
|
|
22086
|
-
return dirHasEditorEvidence(
|
|
22104
|
+
return dirHasEditorEvidence(path20.join(homedir4(), ".hermes"), hermesDirLooksArgentOnly);
|
|
22087
22105
|
},
|
|
22088
22106
|
projectPath() {
|
|
22089
22107
|
return null;
|
|
22090
22108
|
},
|
|
22091
22109
|
globalPath() {
|
|
22092
|
-
return
|
|
22110
|
+
return path20.join(homedir4(), ".hermes", "config.yaml");
|
|
22093
22111
|
},
|
|
22094
22112
|
write(configPath, entry) {
|
|
22095
22113
|
const doc = readYaml(configPath);
|
|
@@ -22148,10 +22166,10 @@ function hasOpenCodeBinary() {
|
|
|
22148
22166
|
}
|
|
22149
22167
|
function pickOpencodeConfig(dir, candidates) {
|
|
22150
22168
|
for (const name of candidates) {
|
|
22151
|
-
const candidate =
|
|
22169
|
+
const candidate = path20.join(dir, name);
|
|
22152
22170
|
if (fs18.existsSync(candidate)) return candidate;
|
|
22153
22171
|
}
|
|
22154
|
-
return
|
|
22172
|
+
return path20.join(dir, "opencode.json");
|
|
22155
22173
|
}
|
|
22156
22174
|
var openCodeAdapter = {
|
|
22157
22175
|
name: "opencode",
|
|
@@ -22162,7 +22180,7 @@ var openCodeAdapter = {
|
|
|
22162
22180
|
return pickOpencodeConfig(root, OPENCODE_PROJECT_FILES);
|
|
22163
22181
|
},
|
|
22164
22182
|
globalPath() {
|
|
22165
|
-
return pickOpencodeConfig(
|
|
22183
|
+
return pickOpencodeConfig(path20.join(homedir4(), ".config", "opencode"), OPENCODE_GLOBAL_FILES);
|
|
22166
22184
|
},
|
|
22167
22185
|
write(configPath, entry) {
|
|
22168
22186
|
editJsoncFile(configPath, ["mcp", MCP_SERVER_KEY], {
|
|
@@ -22207,13 +22225,13 @@ var KIRO_AUTO_APPROVE_ALL = ["*"];
|
|
|
22207
22225
|
var kiroAdapter = {
|
|
22208
22226
|
name: "Kiro",
|
|
22209
22227
|
detect() {
|
|
22210
|
-
return dirHasEditorEvidence(
|
|
22228
|
+
return dirHasEditorEvidence(path20.join(homedir4(), ".kiro"), kiroDirLooksArgentOnly) || dirHasEditorEvidence(path20.join(process.cwd(), ".kiro"), kiroDirLooksArgentOnly);
|
|
22211
22229
|
},
|
|
22212
22230
|
projectPath(root) {
|
|
22213
|
-
return
|
|
22231
|
+
return path20.join(root, ".kiro", "settings", "mcp.json");
|
|
22214
22232
|
},
|
|
22215
22233
|
globalPath() {
|
|
22216
|
-
return
|
|
22234
|
+
return path20.join(homedir4(), ".kiro", "settings", "mcp.json");
|
|
22217
22235
|
},
|
|
22218
22236
|
// Read and written as JSONC through readJsonc / editJsoncFile so comments and
|
|
22219
22237
|
// foreign servers survive (see the Cursor adapter).
|
|
@@ -22320,7 +22338,7 @@ function removeAllowRule(settingsPath, rule) {
|
|
|
22320
22338
|
editJsoncFile(settingsPath, ["permissions", "allow"], next.length > 0 ? next : void 0);
|
|
22321
22339
|
}
|
|
22322
22340
|
function claudeSettingsPath(root, scope) {
|
|
22323
|
-
return scope === "global" ?
|
|
22341
|
+
return scope === "global" ? path20.join(homedir4(), ".claude", "settings.json") : path20.join(root, ".claude", "settings.json");
|
|
22324
22342
|
}
|
|
22325
22343
|
function addClaudePermission(root, scope) {
|
|
22326
22344
|
addAllowRule(claudeSettingsPath(root, scope), PERMISSION_RULE);
|
|
@@ -22333,13 +22351,13 @@ function formatCopyDestination(target, writtenPath, root) {
|
|
|
22333
22351
|
return `${target.label} -> ${formatManagedPathLabel(writtenPath, realpathOrSelf(root))}`;
|
|
22334
22352
|
}
|
|
22335
22353
|
function formatManagedPathLabel(targetPath, root) {
|
|
22336
|
-
for (const home of [
|
|
22337
|
-
if (targetPath === home || targetPath.startsWith(`${home}${
|
|
22354
|
+
for (const home of [path20.resolve(homedir4()), canonicalPath(homedir4())]) {
|
|
22355
|
+
if (targetPath === home || targetPath.startsWith(`${home}${path20.sep}`)) {
|
|
22338
22356
|
return `~${targetPath.slice(home.length)}`;
|
|
22339
22357
|
}
|
|
22340
22358
|
}
|
|
22341
|
-
const relative5 =
|
|
22342
|
-
if (relative5 && !relative5.startsWith("..") && !
|
|
22359
|
+
const relative5 = path20.relative(root, targetPath);
|
|
22360
|
+
if (relative5 && !relative5.startsWith("..") && !path20.isAbsolute(relative5)) {
|
|
22343
22361
|
return relative5;
|
|
22344
22362
|
}
|
|
22345
22363
|
return targetPath;
|
|
@@ -22353,7 +22371,7 @@ function addManagedTarget(targets, editorName, targetPath, root) {
|
|
|
22353
22371
|
}
|
|
22354
22372
|
function getAdapterBasePath(adapter, root, scope) {
|
|
22355
22373
|
const configPath = scope === "global" ? adapter.globalPath() : adapter.projectPath(root);
|
|
22356
|
-
return configPath ?
|
|
22374
|
+
return configPath ? path20.dirname(configPath) : null;
|
|
22357
22375
|
}
|
|
22358
22376
|
function getManagedContentTargets(adapters, root, scope) {
|
|
22359
22377
|
const targets = {
|
|
@@ -22363,17 +22381,17 @@ function getManagedContentTargets(adapters, root, scope) {
|
|
|
22363
22381
|
codexConfigTargets: [],
|
|
22364
22382
|
skillsLockTargets: []
|
|
22365
22383
|
};
|
|
22366
|
-
const workspaceBase = scope === "global" ?
|
|
22384
|
+
const workspaceBase = scope === "global" ? homedir4() : root;
|
|
22367
22385
|
addManagedTarget(
|
|
22368
22386
|
targets.skillTargets,
|
|
22369
22387
|
"skills",
|
|
22370
|
-
|
|
22388
|
+
path20.join(workspaceBase, ".agents", "skills"),
|
|
22371
22389
|
root
|
|
22372
22390
|
);
|
|
22373
22391
|
addManagedTarget(
|
|
22374
22392
|
targets.skillsLockTargets,
|
|
22375
22393
|
"skills",
|
|
22376
|
-
|
|
22394
|
+
path20.join(workspaceBase, "skills-lock.json"),
|
|
22377
22395
|
root
|
|
22378
22396
|
);
|
|
22379
22397
|
for (const adapter of adapters) {
|
|
@@ -22381,21 +22399,21 @@ function getManagedContentTargets(adapters, root, scope) {
|
|
|
22381
22399
|
case "Cursor": {
|
|
22382
22400
|
const base = getAdapterBasePath(adapter, root, scope);
|
|
22383
22401
|
if (!base) break;
|
|
22384
|
-
addManagedTarget(targets.skillTargets, adapter.name,
|
|
22385
|
-
addManagedTarget(targets.ruleTargets, adapter.name,
|
|
22402
|
+
addManagedTarget(targets.skillTargets, adapter.name, path20.join(base, "skills"), root);
|
|
22403
|
+
addManagedTarget(targets.ruleTargets, adapter.name, path20.join(base, "rules"), root);
|
|
22386
22404
|
break;
|
|
22387
22405
|
}
|
|
22388
22406
|
case "Claude Code": {
|
|
22389
|
-
const claudeBase = scope === "global" ?
|
|
22390
|
-
addManagedTarget(targets.skillTargets, adapter.name,
|
|
22391
|
-
addManagedTarget(targets.ruleTargets, adapter.name,
|
|
22392
|
-
addManagedTarget(targets.agentTargets, adapter.name,
|
|
22407
|
+
const claudeBase = scope === "global" ? path20.join(homedir4(), ".claude") : path20.join(root, ".claude");
|
|
22408
|
+
addManagedTarget(targets.skillTargets, adapter.name, path20.join(claudeBase, "skills"), root);
|
|
22409
|
+
addManagedTarget(targets.ruleTargets, adapter.name, path20.join(claudeBase, "rules"), root);
|
|
22410
|
+
addManagedTarget(targets.agentTargets, adapter.name, path20.join(claudeBase, "agents"), root);
|
|
22393
22411
|
break;
|
|
22394
22412
|
}
|
|
22395
22413
|
case "Gemini": {
|
|
22396
|
-
const geminiBase = scope === "global" ?
|
|
22397
|
-
addManagedTarget(targets.ruleTargets, adapter.name,
|
|
22398
|
-
addManagedTarget(targets.agentTargets, adapter.name,
|
|
22414
|
+
const geminiBase = scope === "global" ? path20.join(homedir4(), ".gemini") : path20.join(root, ".gemini");
|
|
22415
|
+
addManagedTarget(targets.ruleTargets, adapter.name, path20.join(geminiBase, "rules"), root);
|
|
22416
|
+
addManagedTarget(targets.agentTargets, adapter.name, path20.join(geminiBase, "agents"), root);
|
|
22399
22417
|
break;
|
|
22400
22418
|
}
|
|
22401
22419
|
case "Codex": {
|
|
@@ -22405,19 +22423,19 @@ function getManagedContentTargets(adapters, root, scope) {
|
|
|
22405
22423
|
break;
|
|
22406
22424
|
}
|
|
22407
22425
|
case "opencode": {
|
|
22408
|
-
const base = scope === "global" ?
|
|
22409
|
-
addManagedTarget(targets.skillTargets, adapter.name,
|
|
22410
|
-
addManagedTarget(targets.agentTargets, adapter.name,
|
|
22426
|
+
const base = scope === "global" ? path20.join(homedir4(), ".config", "opencode") : path20.join(root, ".opencode");
|
|
22427
|
+
addManagedTarget(targets.skillTargets, adapter.name, path20.join(base, "skills"), root);
|
|
22428
|
+
addManagedTarget(targets.agentTargets, adapter.name, path20.join(base, "agents"), root);
|
|
22411
22429
|
break;
|
|
22412
22430
|
}
|
|
22413
22431
|
case "Kiro": {
|
|
22414
|
-
const kiroBase = scope === "global" ?
|
|
22415
|
-
addManagedTarget(targets.skillTargets, adapter.name,
|
|
22432
|
+
const kiroBase = scope === "global" ? path20.join(homedir4(), ".kiro") : path20.join(root, ".kiro");
|
|
22433
|
+
addManagedTarget(targets.skillTargets, adapter.name, path20.join(kiroBase, "skills"), root);
|
|
22416
22434
|
break;
|
|
22417
22435
|
}
|
|
22418
22436
|
case "Devin Desktop": {
|
|
22419
|
-
const devinBase = scope === "global" ?
|
|
22420
|
-
addManagedTarget(targets.skillTargets, adapter.name,
|
|
22437
|
+
const devinBase = scope === "global" ? path20.join(process.env.XDG_CONFIG_HOME || path20.join(homedir4(), ".config"), "devin") : path20.join(root, ".devin");
|
|
22438
|
+
addManagedTarget(targets.skillTargets, adapter.name, path20.join(devinBase, "skills"), root);
|
|
22421
22439
|
break;
|
|
22422
22440
|
}
|
|
22423
22441
|
}
|
|
@@ -22436,7 +22454,7 @@ function readAndConcatRules(rulesDir) {
|
|
|
22436
22454
|
if (files.length === 0) return null;
|
|
22437
22455
|
const parts = [];
|
|
22438
22456
|
for (const file of files) {
|
|
22439
|
-
const raw = fs18.readFileSync(
|
|
22457
|
+
const raw = fs18.readFileSync(path20.join(rulesDir, file), "utf8");
|
|
22440
22458
|
const stripped = stripFrontmatter(raw);
|
|
22441
22459
|
if (stripped) parts.push(stripped);
|
|
22442
22460
|
}
|
|
@@ -22563,10 +22581,10 @@ function copyRulesAndAgents(adapters, root, scope, rulesDir, agentsDir) {
|
|
|
22563
22581
|
}
|
|
22564
22582
|
|
|
22565
22583
|
// ../argent-installer/src/retired-files.ts
|
|
22566
|
-
import * as
|
|
22584
|
+
import * as path21 from "node:path";
|
|
22567
22585
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
22568
22586
|
function displayPath(entry, file) {
|
|
22569
|
-
return
|
|
22587
|
+
return path21.join(entry.location, ...file.relativePath.split("/"));
|
|
22570
22588
|
}
|
|
22571
22589
|
async function cleanupRetiredFiles(found, options) {
|
|
22572
22590
|
const result = { removed: [], declined: [], failed: [], removedRoots: [] };
|
|
@@ -22618,9 +22636,9 @@ async function reportRetiredFiles(found, interactive) {
|
|
|
22618
22636
|
// ../argent-installer/src/cli-record.ts
|
|
22619
22637
|
var import_semver4 = __toESM(require_semver2(), 1);
|
|
22620
22638
|
import * as fs19 from "node:fs";
|
|
22621
|
-
import * as
|
|
22639
|
+
import * as path22 from "node:path";
|
|
22622
22640
|
function cliRecordPath() {
|
|
22623
|
-
return
|
|
22641
|
+
return path22.join(argentHomeDir(), "cli.json");
|
|
22624
22642
|
}
|
|
22625
22643
|
function readCliRecord() {
|
|
22626
22644
|
try {
|
|
@@ -22634,7 +22652,7 @@ function readCliRecord() {
|
|
|
22634
22652
|
function resolveCliEntry(mode, projectRoot) {
|
|
22635
22653
|
if (mode === "local") {
|
|
22636
22654
|
const relative5 = getLocalArgentBinRelPath(projectRoot);
|
|
22637
|
-
return relative5 ?
|
|
22655
|
+
return relative5 ? path22.resolve(projectRoot, relative5) : null;
|
|
22638
22656
|
}
|
|
22639
22657
|
const packageRoot = getGloballyInstalledPackageRoot();
|
|
22640
22658
|
return packageRoot ? cliPathOf(packageRoot) : null;
|
|
@@ -22653,7 +22671,7 @@ function writeCliRecord(input) {
|
|
|
22653
22671
|
function persistCliRecord(record) {
|
|
22654
22672
|
const file = cliRecordPath();
|
|
22655
22673
|
try {
|
|
22656
|
-
fs19.mkdirSync(
|
|
22674
|
+
fs19.mkdirSync(path22.dirname(file), { recursive: true });
|
|
22657
22675
|
const temporary = `${file}.${process.pid}.tmp`;
|
|
22658
22676
|
fs19.writeFileSync(temporary, JSON.stringify(record, null, 2) + "\n");
|
|
22659
22677
|
fs19.renameSync(temporary, file);
|
|
@@ -22688,9 +22706,9 @@ function removeCliRecordFor(installDir) {
|
|
|
22688
22706
|
if (!installDir) return false;
|
|
22689
22707
|
const record = readCliRecord();
|
|
22690
22708
|
if (!record) return false;
|
|
22691
|
-
const root =
|
|
22692
|
-
const relative5 =
|
|
22693
|
-
if (relative5.startsWith("..") ||
|
|
22709
|
+
const root = path22.resolve(installDir);
|
|
22710
|
+
const relative5 = path22.relative(root, path22.resolve(record.cli));
|
|
22711
|
+
if (relative5.startsWith("..") || path22.isAbsolute(relative5)) return false;
|
|
22694
22712
|
try {
|
|
22695
22713
|
fs19.rmSync(cliRecordPath(), { force: true });
|
|
22696
22714
|
return true;
|
|
@@ -22728,9 +22746,11 @@ async function resolveTelemetryConsent(opts) {
|
|
|
22728
22746
|
printFirstRunNotice();
|
|
22729
22747
|
return { kind: "skipped" };
|
|
22730
22748
|
}
|
|
22731
|
-
const
|
|
22749
|
+
const state2 = getConsentState();
|
|
22750
|
+
const source = state2.source.source;
|
|
22732
22751
|
const envOwnsDecision = source === "env_do_not_track" || source === "env_argent_telemetry";
|
|
22733
|
-
|
|
22752
|
+
const configOptedOut = source === "config_file" && !state2.enabled;
|
|
22753
|
+
if (envOwnsDecision || configOptedOut || hasShownFirstRunNotice()) {
|
|
22734
22754
|
return { kind: "skipped" };
|
|
22735
22755
|
}
|
|
22736
22756
|
log.info(
|
|
@@ -22917,7 +22937,7 @@ async function promptInstallMode(defaultMode = "global") {
|
|
|
22917
22937
|
// ../argent-installer/src/install-runner.ts
|
|
22918
22938
|
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
22919
22939
|
import * as fs22 from "node:fs";
|
|
22920
|
-
import * as
|
|
22940
|
+
import * as path25 from "node:path";
|
|
22921
22941
|
|
|
22922
22942
|
// ../argent-installer/src/shell.ts
|
|
22923
22943
|
import { execFileSync as execFileSync6, spawn as spawn2 } from "node:child_process";
|
|
@@ -22949,7 +22969,7 @@ var ShellCommandError = class extends Error {
|
|
|
22949
22969
|
signal;
|
|
22950
22970
|
};
|
|
22951
22971
|
function runShellCommand(cmd, opts = {}) {
|
|
22952
|
-
return new Promise((
|
|
22972
|
+
return new Promise((resolve22, reject) => {
|
|
22953
22973
|
const child = spawn2(cmd.bin, cmd.args, {
|
|
22954
22974
|
stdio: ["ignore", "pipe", "pipe"],
|
|
22955
22975
|
shell: process.platform === "win32",
|
|
@@ -22965,7 +22985,7 @@ function runShellCommand(cmd, opts = {}) {
|
|
|
22965
22985
|
stderr += chunk.toString();
|
|
22966
22986
|
});
|
|
22967
22987
|
child.on("close", (code, signal) => {
|
|
22968
|
-
if (code === 0)
|
|
22988
|
+
if (code === 0) resolve22();
|
|
22969
22989
|
else
|
|
22970
22990
|
reject(
|
|
22971
22991
|
new ShellCommandError(
|
|
@@ -22982,29 +23002,29 @@ function runShellCommand(cmd, opts = {}) {
|
|
|
22982
23002
|
// ../argent-installer/src/skills.ts
|
|
22983
23003
|
import { execFileSync as execFileSync8 } from "node:child_process";
|
|
22984
23004
|
import * as fs21 from "node:fs";
|
|
22985
|
-
import * as
|
|
23005
|
+
import * as path24 from "node:path";
|
|
22986
23006
|
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
22987
23007
|
|
|
22988
23008
|
// ../argent-installer/src/skills-runner.ts
|
|
22989
23009
|
import { execFileSync as execFileSync7 } from "node:child_process";
|
|
22990
23010
|
import * as fs20 from "node:fs";
|
|
22991
|
-
import * as
|
|
23011
|
+
import * as path23 from "node:path";
|
|
22992
23012
|
var WIN32_DEFAULT_PATHEXT = ".COM;.EXE;.BAT;.CMD";
|
|
22993
23013
|
function findOnPath(bin, env, platform) {
|
|
22994
23014
|
const pathValue = env.PATH ?? env.Path ?? "";
|
|
22995
|
-
const dirs = pathValue.split(
|
|
23015
|
+
const dirs = pathValue.split(path23.delimiter).filter((dir) => path23.isAbsolute(dir));
|
|
22996
23016
|
if (platform === "win32") {
|
|
22997
23017
|
const exts = (env.PATHEXT ?? WIN32_DEFAULT_PATHEXT).split(";").filter(Boolean);
|
|
22998
23018
|
for (const dir of dirs) {
|
|
22999
23019
|
for (const ext of exts) {
|
|
23000
|
-
const candidate =
|
|
23020
|
+
const candidate = path23.join(dir, bin + ext);
|
|
23001
23021
|
if (fs20.existsSync(candidate)) return candidate;
|
|
23002
23022
|
}
|
|
23003
23023
|
}
|
|
23004
23024
|
return null;
|
|
23005
23025
|
}
|
|
23006
23026
|
for (const dir of dirs) {
|
|
23007
|
-
const candidate =
|
|
23027
|
+
const candidate = path23.join(dir, bin);
|
|
23008
23028
|
try {
|
|
23009
23029
|
if (!fs20.statSync(candidate).isFile()) continue;
|
|
23010
23030
|
fs20.accessSync(candidate, fs20.constants.X_OK);
|
|
@@ -23190,7 +23210,7 @@ function snapshotArgentSkills(projectRoot, scope, names) {
|
|
|
23190
23210
|
}
|
|
23191
23211
|
}
|
|
23192
23212
|
for (const name of candidates) {
|
|
23193
|
-
const stat6 = fs21.statSync(
|
|
23213
|
+
const stat6 = fs21.statSync(path24.join(targetPath, name, "SKILL.md"), { throwIfNoEntry: false });
|
|
23194
23214
|
if (!stat6?.isFile()) continue;
|
|
23195
23215
|
found.set(name, `${found.get(name) ?? ""}${stat6.ino}:${stat6.mtimeMs};`);
|
|
23196
23216
|
}
|
|
@@ -23208,7 +23228,7 @@ function pruneLegacySkillDirs(projectRoot, scope, bundled = new Set(listBundledS
|
|
|
23208
23228
|
const removed = /* @__PURE__ */ new Set();
|
|
23209
23229
|
for (const { targetPath } of skillTargets) {
|
|
23210
23230
|
for (const name of legacy) {
|
|
23211
|
-
const dir =
|
|
23231
|
+
const dir = path24.join(targetPath, name);
|
|
23212
23232
|
try {
|
|
23213
23233
|
if (removePath(dir)) removed.add(name);
|
|
23214
23234
|
} catch {
|
|
@@ -23305,7 +23325,7 @@ async function runInstall(args) {
|
|
|
23305
23325
|
return runGlobal({ fromTar, nonInteractive, version: args.version, tel });
|
|
23306
23326
|
}
|
|
23307
23327
|
function installSpec(fromTar) {
|
|
23308
|
-
return fs22.existsSync(fromTar) ?
|
|
23328
|
+
return fs22.existsSync(fromTar) ? path25.resolve(fromTar) : fromTar;
|
|
23309
23329
|
}
|
|
23310
23330
|
async function installLocally(opts) {
|
|
23311
23331
|
const { fromTar, tel } = opts;
|
|
@@ -23613,7 +23633,7 @@ async function chooseAdapters(opts) {
|
|
|
23613
23633
|
// ../argent-installer/src/init-scope.ts
|
|
23614
23634
|
var import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
23615
23635
|
import { existsSync as existsSync15 } from "node:fs";
|
|
23616
|
-
import { resolve as
|
|
23636
|
+
import { resolve as resolve15 } from "node:path";
|
|
23617
23637
|
async function chooseScope(opts) {
|
|
23618
23638
|
if (opts.installMode === "local") {
|
|
23619
23639
|
return { scope: "local" };
|
|
@@ -23650,13 +23670,13 @@ async function chooseScope(opts) {
|
|
|
23650
23670
|
placeholder: process.cwd(),
|
|
23651
23671
|
validate(value) {
|
|
23652
23672
|
if (!value?.trim()) return "Path cannot be empty.";
|
|
23653
|
-
const resolved =
|
|
23673
|
+
const resolved = resolve15(value.trim());
|
|
23654
23674
|
if (!existsSync15(resolved))
|
|
23655
23675
|
return `Path does not exist: ${resolved}. Please verify and enter a valid path.`;
|
|
23656
23676
|
}
|
|
23657
23677
|
});
|
|
23658
23678
|
if (isCancel(customPathInput)) throw new InitCancelled("scope");
|
|
23659
|
-
return { scope: "custom", customRoot:
|
|
23679
|
+
return { scope: "custom", customRoot: resolve15(customPathInput.trim()) };
|
|
23660
23680
|
}
|
|
23661
23681
|
|
|
23662
23682
|
// ../argent-installer/src/init-mcp-write.ts
|
|
@@ -23957,7 +23977,7 @@ async function configureAllowlist(args) {
|
|
|
23957
23977
|
var import_picocolors10 = __toESM(require_picocolors(), 1);
|
|
23958
23978
|
import { spawn as spawn3 } from "node:child_process";
|
|
23959
23979
|
import * as os4 from "node:os";
|
|
23960
|
-
import * as
|
|
23980
|
+
import * as path26 from "node:path";
|
|
23961
23981
|
var REF_MISSING = /Remote branch .* not found in upstream|couldn't find remote ref|unknown revision/i;
|
|
23962
23982
|
function meaningfulLine(err) {
|
|
23963
23983
|
const lines = (err instanceof Error ? err.message : String(err)).split("\n").map((l2) => l2.replace(/^[│┌└■◇\s]+/, "").trim()).filter((l2) => l2 && !/^npm (warn|notice)/i.test(l2));
|
|
@@ -23965,10 +23985,10 @@ function meaningfulLine(err) {
|
|
|
23965
23985
|
}
|
|
23966
23986
|
function bundledCopyFor(version) {
|
|
23967
23987
|
const local = probeLocalInstall(resolveProjectRoot2(process.cwd()));
|
|
23968
|
-
if (local.packageDir && local.version === version) return
|
|
23988
|
+
if (local.packageDir && local.version === version) return path26.join(local.packageDir, "skills");
|
|
23969
23989
|
const globalRoot = getGloballyInstalledPackageRoot();
|
|
23970
23990
|
if (globalRoot && getGloballyInstalledVersion() === version) {
|
|
23971
|
-
return
|
|
23991
|
+
return path26.join(globalRoot, "skills");
|
|
23972
23992
|
}
|
|
23973
23993
|
return SKILLS_DIR;
|
|
23974
23994
|
}
|
|
@@ -24195,7 +24215,7 @@ async function runSkillsStep(args) {
|
|
|
24195
24215
|
async function runSkillsCli(runner, args, interactive, cwd) {
|
|
24196
24216
|
if (!runner) throw new Error(NO_SKILLS_RUNNER_MESSAGE);
|
|
24197
24217
|
const command = skillsCommand(runner, args);
|
|
24198
|
-
return new Promise((
|
|
24218
|
+
return new Promise((resolve22, reject) => {
|
|
24199
24219
|
const child = spawn3(command.file, command.args, {
|
|
24200
24220
|
env: npxChildEnv(),
|
|
24201
24221
|
stdio: interactive ? "inherit" : ["ignore", "pipe", "pipe"],
|
|
@@ -24214,7 +24234,7 @@ async function runSkillsCli(runner, args, interactive, cwd) {
|
|
|
24214
24234
|
}
|
|
24215
24235
|
child.on("close", (code, signal) => {
|
|
24216
24236
|
if (code === 0) {
|
|
24217
|
-
|
|
24237
|
+
resolve22();
|
|
24218
24238
|
} else {
|
|
24219
24239
|
const output = [stderr, stdout2].filter(Boolean).join("\n").trim();
|
|
24220
24240
|
reject(
|
|
@@ -24537,7 +24557,7 @@ var import_picocolors12 = __toESM(require_picocolors(), 1);
|
|
|
24537
24557
|
var import_semver5 = __toESM(require_semver2(), 1);
|
|
24538
24558
|
import * as fs24 from "node:fs";
|
|
24539
24559
|
import * as os5 from "node:os";
|
|
24540
|
-
import * as
|
|
24560
|
+
import * as path32 from "node:path";
|
|
24541
24561
|
|
|
24542
24562
|
// ../argent-installer/src/install-targets.ts
|
|
24543
24563
|
function parseTargetFlags(args) {
|
|
@@ -24610,16 +24630,15 @@ async function resolveInstallableUpdateTarget(pm, current, cwd, candidate) {
|
|
|
24610
24630
|
// ../argent-tools-client/src/launcher.ts
|
|
24611
24631
|
import * as net from "node:net";
|
|
24612
24632
|
import * as fs23 from "node:fs";
|
|
24613
|
-
import * as
|
|
24633
|
+
import * as path27 from "node:path";
|
|
24614
24634
|
import * as readline from "node:readline";
|
|
24615
|
-
import { homedir as homedir7 } from "node:os";
|
|
24616
24635
|
import { spawn as spawn4, execFileSync as execFileSync9 } from "node:child_process";
|
|
24617
24636
|
import { createHash as createHash3, randomBytes } from "node:crypto";
|
|
24618
24637
|
import { mkdir, writeFile, readFile, readdir as readdir2, unlink, rename, chmod } from "node:fs/promises";
|
|
24619
|
-
var STATE_DIR =
|
|
24620
|
-
var STATE_FILE =
|
|
24621
|
-
var LOG_FILE =
|
|
24622
|
-
var LOCK_FILE =
|
|
24638
|
+
var STATE_DIR = argentHomeDir();
|
|
24639
|
+
var STATE_FILE = path27.join(STATE_DIR, "tool-server.json");
|
|
24640
|
+
var LOG_FILE = path27.join(STATE_DIR, "tool-server.log");
|
|
24641
|
+
var LOCK_FILE = path27.join(STATE_DIR, "tool-server.lock");
|
|
24623
24642
|
function isProcessAlive(pid) {
|
|
24624
24643
|
try {
|
|
24625
24644
|
process.kill(pid, 0);
|
|
@@ -24630,7 +24649,7 @@ function isProcessAlive(pid) {
|
|
|
24630
24649
|
}
|
|
24631
24650
|
function stateFileForBundle(bundlePath) {
|
|
24632
24651
|
const key = createHash3("sha256").update(bundlePath).digest("hex").slice(0, 12);
|
|
24633
|
-
return
|
|
24652
|
+
return path27.join(STATE_DIR, `tool-server-${key}.json`);
|
|
24634
24653
|
}
|
|
24635
24654
|
async function readStateFile(file) {
|
|
24636
24655
|
try {
|
|
@@ -24672,7 +24691,7 @@ async function readAllToolsServerStates() {
|
|
|
24672
24691
|
const out = [];
|
|
24673
24692
|
for (const name of names) {
|
|
24674
24693
|
if (!STATE_FILE_RE.test(name)) continue;
|
|
24675
|
-
const file =
|
|
24694
|
+
const file = path27.join(STATE_DIR, name);
|
|
24676
24695
|
const state2 = await readStateFile(file);
|
|
24677
24696
|
if (state2) out.push({ file, state: state2 });
|
|
24678
24697
|
}
|
|
@@ -24718,8 +24737,8 @@ async function killToolServer(bundlePath) {
|
|
|
24718
24737
|
return alive;
|
|
24719
24738
|
}
|
|
24720
24739
|
function isPathWithin(child, parent) {
|
|
24721
|
-
const rel =
|
|
24722
|
-
return rel !== "" && !rel.startsWith("..") && !
|
|
24740
|
+
const rel = path27.relative(parent, child);
|
|
24741
|
+
return rel !== "" && !rel.startsWith("..") && !path27.isAbsolute(rel);
|
|
24723
24742
|
}
|
|
24724
24743
|
function tryRealpath(p) {
|
|
24725
24744
|
try {
|
|
@@ -24729,10 +24748,10 @@ function tryRealpath(p) {
|
|
|
24729
24748
|
}
|
|
24730
24749
|
}
|
|
24731
24750
|
async function killToolServerForInstallDir(packageDir) {
|
|
24732
|
-
const parents = /* @__PURE__ */ new Set([
|
|
24751
|
+
const parents = /* @__PURE__ */ new Set([path27.resolve(packageDir), tryRealpath(packageDir)]);
|
|
24733
24752
|
let killed = 0;
|
|
24734
24753
|
for (const { file, state: state2 } of await readAllToolsServerStates()) {
|
|
24735
|
-
const bundles = /* @__PURE__ */ new Set([
|
|
24754
|
+
const bundles = /* @__PURE__ */ new Set([path27.resolve(state2.bundlePath), tryRealpath(state2.bundlePath)]);
|
|
24736
24755
|
const matches2 = [...bundles].some((b) => [...parents].some((p) => isPathWithin(b, p)));
|
|
24737
24756
|
if (!matches2) continue;
|
|
24738
24757
|
const fresh = await readStateFile(file);
|
|
@@ -24797,14 +24816,13 @@ function couldBeOurToolServer(pid, marker) {
|
|
|
24797
24816
|
var import_yaml4 = __toESM(require_dist2(), 1);
|
|
24798
24817
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
24799
24818
|
import { maxHeaderSize } from "node:http";
|
|
24800
|
-
import * as
|
|
24819
|
+
import * as path31 from "node:path";
|
|
24801
24820
|
|
|
24802
24821
|
// ../argent-tools-client/src/link-config.ts
|
|
24803
|
-
import * as
|
|
24804
|
-
import { homedir as homedir8 } from "node:os";
|
|
24822
|
+
import * as path28 from "node:path";
|
|
24805
24823
|
import { mkdir as mkdir2, writeFile as writeFile2, readFile as readFile2, unlink as unlink2, chmod as chmod2 } from "node:fs/promises";
|
|
24806
|
-
var LINK_DIR =
|
|
24807
|
-
var LINK_FILE =
|
|
24824
|
+
var LINK_DIR = argentHomeDir();
|
|
24825
|
+
var LINK_FILE = path28.join(LINK_DIR, "link.json");
|
|
24808
24826
|
|
|
24809
24827
|
// ../argent-tools-client/src/file-inputs.ts
|
|
24810
24828
|
import { createHash as createHash4, randomUUID as randomUUID6 } from "node:crypto";
|
|
@@ -24821,14 +24839,14 @@ import {
|
|
|
24821
24839
|
writeFile as writeFile3
|
|
24822
24840
|
} from "node:fs/promises";
|
|
24823
24841
|
import { constants as constants2, tmpdir } from "node:os";
|
|
24824
|
-
import * as
|
|
24842
|
+
import * as path29 from "node:path";
|
|
24825
24843
|
|
|
24826
24844
|
// ../archive/src/index.ts
|
|
24827
24845
|
import { spawn as spawn5 } from "node:child_process";
|
|
24828
24846
|
import { once } from "node:events";
|
|
24829
24847
|
import { createReadStream, createWriteStream } from "node:fs";
|
|
24830
24848
|
import { open, rm, readdir as readdir3 } from "node:fs/promises";
|
|
24831
|
-
import { basename as basename5, dirname as dirname14, join as
|
|
24849
|
+
import { basename as basename5, dirname as dirname14, join as join27, resolve as resolve17, sep as sep4 } from "node:path";
|
|
24832
24850
|
import { Writable } from "node:stream";
|
|
24833
24851
|
import { pipeline } from "node:stream/promises";
|
|
24834
24852
|
import zlib2 from "node:zlib";
|
|
@@ -24846,7 +24864,7 @@ var MAX_CONTENT_BYTES = 32 * 1024 * 1024;
|
|
|
24846
24864
|
// ../argent-tools-client/src/flow-files.ts
|
|
24847
24865
|
var import_yaml3 = __toESM(require_dist2(), 1);
|
|
24848
24866
|
import { readdir as readdir4, readFile as readFile4, realpath as realpath3, stat as stat4 } from "node:fs/promises";
|
|
24849
|
-
import * as
|
|
24867
|
+
import * as path30 from "node:path";
|
|
24850
24868
|
var INLINE_MEMBERS_BYTES = 256 * 1024;
|
|
24851
24869
|
|
|
24852
24870
|
// ../argent-tools-client/src/artifacts.ts
|
|
@@ -24862,7 +24880,7 @@ import {
|
|
|
24862
24880
|
} from "node:fs/promises";
|
|
24863
24881
|
import { constants as fsConstants } from "node:fs";
|
|
24864
24882
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
24865
|
-
import { basename as basename8,
|
|
24883
|
+
import { basename as basename8, extname as extname2, isAbsolute as isAbsolute10, join as join31, normalize as normalize2, resolve as resolve20, sep as sep7 } from "node:path";
|
|
24866
24884
|
import { createHash as createHash5 } from "node:crypto";
|
|
24867
24885
|
var ALLOWED_SAVE_DIRS = /* @__PURE__ */ new Set([normalize2(".argent/recordings")]);
|
|
24868
24886
|
var RECORDINGS_SAVE_DIR = normalize2(".argent/recordings");
|
|
@@ -25169,7 +25187,7 @@ async function update(args) {
|
|
|
25169
25187
|
const pm = mode === "local" ? detectProjectPackageManager(projectRoot) : detectGlobalPackageManager();
|
|
25170
25188
|
if (automatic) {
|
|
25171
25189
|
const globalRoot = getGloballyInstalledPackageRoot();
|
|
25172
|
-
if (!globallyInstalled || !globalRoot || fs24.realpathSync(globalRoot) !== projectRoot ||
|
|
25190
|
+
if (!globallyInstalled || !globalRoot || fs24.realpathSync(globalRoot) !== projectRoot || !isAutoUpdateEnabled() || !ownsGlobalInstall(pm, projectRoot)) {
|
|
25173
25191
|
spinner2.stop("Could not confirm an automatic update for this installation.");
|
|
25174
25192
|
return "noop";
|
|
25175
25193
|
}
|
|
@@ -25393,7 +25411,7 @@ async function update(args) {
|
|
|
25393
25411
|
return;
|
|
25394
25412
|
}
|
|
25395
25413
|
const rootOverride = getProjectRootOverride(args);
|
|
25396
|
-
const projectRoot = rootOverride ?
|
|
25414
|
+
const projectRoot = rootOverride ? path32.resolve(rootOverride) : resolveProjectRoot2(process.cwd());
|
|
25397
25415
|
installMode = resolveInstallMode(projectRoot);
|
|
25398
25416
|
const flags = parseTargetFlags(args);
|
|
25399
25417
|
const localInstalled = installMode === "local" && probeLocalInstall(projectRoot).installed;
|
|
@@ -25474,7 +25492,7 @@ async function update(args) {
|
|
|
25474
25492
|
var import_picocolors13 = __toESM(require_picocolors(), 1);
|
|
25475
25493
|
var import_yaml5 = __toESM(require_dist2(), 1);
|
|
25476
25494
|
import * as fs25 from "node:fs";
|
|
25477
|
-
import * as
|
|
25495
|
+
import * as path33 from "node:path";
|
|
25478
25496
|
var UNINSTALL_TOOLSERVER_STOP_FAILED = {
|
|
25479
25497
|
error_code: FAILURE_CODES.UNINSTALL_TOOLSERVER_STOP_FAILED,
|
|
25480
25498
|
failure_stage: "installer_uninstall_toolserver_stop",
|
|
@@ -25509,8 +25527,8 @@ function collectBundledPaths(sourceDir) {
|
|
|
25509
25527
|
const directories = [];
|
|
25510
25528
|
function walk(currentDir, relativeDir = "") {
|
|
25511
25529
|
for (const entry of fs25.readdirSync(currentDir, { withFileTypes: true })) {
|
|
25512
|
-
const relativePath = relativeDir ?
|
|
25513
|
-
const absolutePath =
|
|
25530
|
+
const relativePath = relativeDir ? path33.join(relativeDir, entry.name) : entry.name;
|
|
25531
|
+
const absolutePath = path33.join(currentDir, entry.name);
|
|
25514
25532
|
if (entry.isDirectory()) {
|
|
25515
25533
|
walk(absolutePath, relativePath);
|
|
25516
25534
|
directories.push(relativePath);
|
|
@@ -25529,7 +25547,7 @@ function removeBundledContent(sourceDir, targetDir) {
|
|
|
25529
25547
|
const { files, directories } = collectBundledPaths(sourceDir);
|
|
25530
25548
|
const removedPaths = [];
|
|
25531
25549
|
for (const relativePath of files) {
|
|
25532
|
-
const targetPath =
|
|
25550
|
+
const targetPath = path33.join(targetDir, relativePath);
|
|
25533
25551
|
try {
|
|
25534
25552
|
const entry = fs25.lstatSync(targetPath, { throwIfNoEntry: false });
|
|
25535
25553
|
if (!entry || entry.isDirectory()) continue;
|
|
@@ -25539,10 +25557,10 @@ function removeBundledContent(sourceDir, targetDir) {
|
|
|
25539
25557
|
}
|
|
25540
25558
|
}
|
|
25541
25559
|
directories.sort(
|
|
25542
|
-
(a2, b) => b.split(
|
|
25560
|
+
(a2, b) => b.split(path33.sep).length - a2.split(path33.sep).length || b.length - a2.length
|
|
25543
25561
|
);
|
|
25544
25562
|
for (const relativePath of directories) {
|
|
25545
|
-
const targetPath =
|
|
25563
|
+
const targetPath = path33.join(targetDir, relativePath);
|
|
25546
25564
|
try {
|
|
25547
25565
|
if (!fs25.existsSync(targetPath)) continue;
|
|
25548
25566
|
if (!fs25.statSync(targetPath).isDirectory()) continue;
|
|
@@ -25562,7 +25580,7 @@ function removeBundledContent(sourceDir, targetDir) {
|
|
|
25562
25580
|
} catch {
|
|
25563
25581
|
}
|
|
25564
25582
|
if (removedRoot) {
|
|
25565
|
-
removeDirIfEmpty2(
|
|
25583
|
+
removeDirIfEmpty2(path33.dirname(targetDir));
|
|
25566
25584
|
}
|
|
25567
25585
|
return { removedPaths, removedRoot };
|
|
25568
25586
|
}
|
|
@@ -25583,7 +25601,7 @@ function getBundledSkillNames(skillsDir) {
|
|
|
25583
25601
|
const skillNames = [];
|
|
25584
25602
|
for (const entry of fs25.readdirSync(skillsDir, { withFileTypes: true })) {
|
|
25585
25603
|
if (!entry.isDirectory()) continue;
|
|
25586
|
-
const skillFilePath =
|
|
25604
|
+
const skillFilePath = path33.join(skillsDir, entry.name, "SKILL.md");
|
|
25587
25605
|
if (!fs25.existsSync(skillFilePath)) continue;
|
|
25588
25606
|
skillNames.push(readBundledSkillName(skillFilePath, entry.name));
|
|
25589
25607
|
}
|
|
@@ -25595,7 +25613,7 @@ function removeBundledSkillInstalls(skillNames, targetDir) {
|
|
|
25595
25613
|
}
|
|
25596
25614
|
const removedPaths = [];
|
|
25597
25615
|
for (const skillName of skillNames) {
|
|
25598
|
-
const targetPath =
|
|
25616
|
+
const targetPath = path33.join(targetDir, skillName);
|
|
25599
25617
|
try {
|
|
25600
25618
|
if (removePath(targetPath)) removedPaths.push(skillName);
|
|
25601
25619
|
} catch {
|
|
@@ -25603,7 +25621,7 @@ function removeBundledSkillInstalls(skillNames, targetDir) {
|
|
|
25603
25621
|
}
|
|
25604
25622
|
const removedRoot = removeDirIfEmpty2(targetDir);
|
|
25605
25623
|
if (removedRoot) {
|
|
25606
|
-
removeDirIfEmpty2(
|
|
25624
|
+
removeDirIfEmpty2(path33.dirname(targetDir));
|
|
25607
25625
|
}
|
|
25608
25626
|
return { removedPaths, removedRoot };
|
|
25609
25627
|
}
|
|
@@ -25846,7 +25864,7 @@ async function uninstall(args) {
|
|
|
25846
25864
|
),
|
|
25847
25865
|
{ ask: false }
|
|
25848
25866
|
);
|
|
25849
|
-
for (const root of retired.removedRoots) removeDirIfEmpty2(
|
|
25867
|
+
for (const root of retired.removedRoots) removeDirIfEmpty2(path33.dirname(root));
|
|
25850
25868
|
const retiredLines = formatRetiredCleanup(retired);
|
|
25851
25869
|
pruneResults.push(...retiredLines.removed.map((line) => `${import_picocolors13.default.green("+")} ${line}`));
|
|
25852
25870
|
const retiredKept = retiredLines.kept.map((line) => ` ${line}`);
|