@swmansion/argent 0.35.1-next.6 → 0.35.1-next.60
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/README.md +16 -15
- package/bin/argent-android-devtools-0.4.0.apk +0 -0
- package/bin/darwin/argent-macos-helper +0 -0
- package/bin/darwin/ax-service +0 -0
- package/bin/darwin/tvos-ax-service +0 -0
- package/bin/darwin/tvos-hid-daemon +0 -0
- package/bin/network-inspector/network-inspector.jar +0 -0
- package/bin/tcp/ax-service +0 -0
- package/dist/cli-cmds.mjs +2509 -2084
- package/dist/client.js +494 -386
- package/dist/fatal-handlers.js +7 -1
- package/dist/fatal-handlers.js.map +1 -1
- package/dist/installer-help.js +2 -1
- package/dist/installer-help.js.map +1 -1
- package/dist/installer.mjs +706 -676
- package/dist/mcp-server.mjs +1724 -1523
- package/dist/tool-args.generated.d.ts +411 -318
- package/dist/tool-server.cjs +12443 -9286
- package/dylibs/libArgentAudio.dylib +0 -0
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/macos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/macos/libNativeDevtoolsMacos.dylib +0 -0
- package/dylibs/tcp/argent-audio-feeder +0 -0
- package/dylibs/tcp/libArgentAudio.dylib +0 -0
- package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
- package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
- package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +2 -2
- package/skills/argent-android-emulator-setup/SKILL.md +2 -2
- package/skills/argent-create-e2e/SKILL.md +2 -1
- package/skills/argent-create-e2e/references/e2e-yaml.md +42 -2
- package/skills/argent-create-e2e/references/live-authoring.md +14 -3
- package/skills/argent-device-interact/SKILL.md +21 -94
- package/skills/argent-device-interact/references/advanced.md +64 -0
- package/skills/argent-ios-device-interact/SKILL.md +1 -1
- package/skills/argent-ios-device-setup/SKILL.md +1 -1
- package/skills/argent-ios-simulator-setup/SKILL.md +1 -1
- package/skills/argent-lens/SKILL.md +1 -1
- package/skills/argent-macos-app-interact/SKILL.md +1 -1
- package/skills/argent-metro-debugger/SKILL.md +4 -4
- package/skills/argent-native-profiler/SKILL.md +1 -1
- package/skills/argent-qa-e2e/SKILL.md +1 -1
- package/skills/argent-react-native-app-workflow/SKILL.md +1 -1
- package/skills/argent-react-native-optimization/SKILL.md +1 -1
- package/skills/argent-react-native-profiler/SKILL.md +1 -1
- package/skills/argent-screen-recording/SKILL.md +1 -1
- package/skills/argent-screenshot-diff/SKILL.md +1 -1
- package/skills/argent-settings-permissions/SKILL.md +1 -1
- package/skills/argent-test-ui-flow/SKILL.md +1 -1
- package/skills/argent-tv-interact/SKILL.md +1 -1
package/dist/installer.mjs
CHANGED
|
@@ -2052,7 +2052,7 @@ var require_parse = __commonJS({
|
|
|
2052
2052
|
"../../node_modules/semver/functions/parse.js"(exports, module) {
|
|
2053
2053
|
"use strict";
|
|
2054
2054
|
var SemVer = require_semver();
|
|
2055
|
-
var
|
|
2055
|
+
var parse6 = (version, options, throwErrors = false) => {
|
|
2056
2056
|
if (version instanceof SemVer) {
|
|
2057
2057
|
return version;
|
|
2058
2058
|
}
|
|
@@ -2065,7 +2065,7 @@ var require_parse = __commonJS({
|
|
|
2065
2065
|
throw er;
|
|
2066
2066
|
}
|
|
2067
2067
|
};
|
|
2068
|
-
module.exports =
|
|
2068
|
+
module.exports = parse6;
|
|
2069
2069
|
}
|
|
2070
2070
|
});
|
|
2071
2071
|
|
|
@@ -2073,9 +2073,9 @@ var require_parse = __commonJS({
|
|
|
2073
2073
|
var require_valid = __commonJS({
|
|
2074
2074
|
"../../node_modules/semver/functions/valid.js"(exports, module) {
|
|
2075
2075
|
"use strict";
|
|
2076
|
-
var
|
|
2076
|
+
var parse6 = require_parse();
|
|
2077
2077
|
var valid = (version, options) => {
|
|
2078
|
-
const v =
|
|
2078
|
+
const v = parse6(version, options);
|
|
2079
2079
|
return v ? v.version : null;
|
|
2080
2080
|
};
|
|
2081
2081
|
module.exports = valid;
|
|
@@ -2086,9 +2086,9 @@ var require_valid = __commonJS({
|
|
|
2086
2086
|
var require_clean = __commonJS({
|
|
2087
2087
|
"../../node_modules/semver/functions/clean.js"(exports, module) {
|
|
2088
2088
|
"use strict";
|
|
2089
|
-
var
|
|
2089
|
+
var parse6 = require_parse();
|
|
2090
2090
|
var clean = (version, options) => {
|
|
2091
|
-
const s =
|
|
2091
|
+
const s = parse6(version.trim().replace(/^[=v]+/, ""), options);
|
|
2092
2092
|
return s ? s.version : null;
|
|
2093
2093
|
};
|
|
2094
2094
|
module.exports = clean;
|
|
@@ -2123,10 +2123,10 @@ var require_inc = __commonJS({
|
|
|
2123
2123
|
var require_diff = __commonJS({
|
|
2124
2124
|
"../../node_modules/semver/functions/diff.js"(exports, module) {
|
|
2125
2125
|
"use strict";
|
|
2126
|
-
var
|
|
2126
|
+
var parse6 = require_parse();
|
|
2127
2127
|
var diff = (version1, version2) => {
|
|
2128
|
-
const v1 =
|
|
2129
|
-
const v2 =
|
|
2128
|
+
const v1 = parse6(version1, null, true);
|
|
2129
|
+
const v2 = parse6(version2, null, true);
|
|
2130
2130
|
const comparison = v1.compare(v2);
|
|
2131
2131
|
if (comparison === 0) {
|
|
2132
2132
|
return null;
|
|
@@ -2197,9 +2197,9 @@ var require_patch = __commonJS({
|
|
|
2197
2197
|
var require_prerelease = __commonJS({
|
|
2198
2198
|
"../../node_modules/semver/functions/prerelease.js"(exports, module) {
|
|
2199
2199
|
"use strict";
|
|
2200
|
-
var
|
|
2200
|
+
var parse6 = require_parse();
|
|
2201
2201
|
var prerelease = (version, options) => {
|
|
2202
|
-
const parsed =
|
|
2202
|
+
const parsed = parse6(version, options);
|
|
2203
2203
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
2204
2204
|
};
|
|
2205
2205
|
module.exports = prerelease;
|
|
@@ -2385,7 +2385,7 @@ var require_coerce = __commonJS({
|
|
|
2385
2385
|
"../../node_modules/semver/functions/coerce.js"(exports, module) {
|
|
2386
2386
|
"use strict";
|
|
2387
2387
|
var SemVer = require_semver();
|
|
2388
|
-
var
|
|
2388
|
+
var parse6 = require_parse();
|
|
2389
2389
|
var { safeRe: re2, t: t2 } = require_re();
|
|
2390
2390
|
var coerce = (version, options) => {
|
|
2391
2391
|
if (version instanceof SemVer) {
|
|
@@ -2420,7 +2420,7 @@ var require_coerce = __commonJS({
|
|
|
2420
2420
|
const patch = match[4] || "0";
|
|
2421
2421
|
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
2422
2422
|
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
2423
|
-
return
|
|
2423
|
+
return parse6(`${major2}.${minor}.${patch}${prerelease}${build}`, options);
|
|
2424
2424
|
};
|
|
2425
2425
|
module.exports = coerce;
|
|
2426
2426
|
}
|
|
@@ -2430,7 +2430,7 @@ var require_coerce = __commonJS({
|
|
|
2430
2430
|
var require_truncate = __commonJS({
|
|
2431
2431
|
"../../node_modules/semver/functions/truncate.js"(exports, module) {
|
|
2432
2432
|
"use strict";
|
|
2433
|
-
var
|
|
2433
|
+
var parse6 = require_parse();
|
|
2434
2434
|
var constants3 = require_constants();
|
|
2435
2435
|
var SemVer = require_semver();
|
|
2436
2436
|
var truncate = (version, truncation, options) => {
|
|
@@ -2442,7 +2442,7 @@ var require_truncate = __commonJS({
|
|
|
2442
2442
|
};
|
|
2443
2443
|
var cloneInputVersion = (version, options) => {
|
|
2444
2444
|
const versionStringToParse = version instanceof SemVer ? version.version : version;
|
|
2445
|
-
return
|
|
2445
|
+
return parse6(versionStringToParse, options);
|
|
2446
2446
|
};
|
|
2447
2447
|
var doTruncation = (version, truncation) => {
|
|
2448
2448
|
if (isPrerelease(truncation)) {
|
|
@@ -3486,7 +3486,7 @@ var require_semver2 = __commonJS({
|
|
|
3486
3486
|
var constants3 = require_constants();
|
|
3487
3487
|
var SemVer = require_semver();
|
|
3488
3488
|
var identifiers = require_identifiers();
|
|
3489
|
-
var
|
|
3489
|
+
var parse6 = require_parse();
|
|
3490
3490
|
var valid = require_valid();
|
|
3491
3491
|
var clean = require_clean();
|
|
3492
3492
|
var inc = require_inc();
|
|
@@ -3525,7 +3525,7 @@ var require_semver2 = __commonJS({
|
|
|
3525
3525
|
var simplifyRange = require_simplify();
|
|
3526
3526
|
var subset = require_subset();
|
|
3527
3527
|
module.exports = {
|
|
3528
|
-
parse:
|
|
3528
|
+
parse: parse6,
|
|
3529
3529
|
valid,
|
|
3530
3530
|
clean,
|
|
3531
3531
|
inc,
|
|
@@ -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
|
/**
|
|
@@ -7538,10 +7538,10 @@ var require_resolve_block_map = __commonJS({
|
|
|
7538
7538
|
let offset = bm.offset;
|
|
7539
7539
|
let commentEnd = null;
|
|
7540
7540
|
for (const collItem of bm.items) {
|
|
7541
|
-
const { start, key, sep:
|
|
7541
|
+
const { start, key, sep: sep10, value } = collItem;
|
|
7542
7542
|
const keyProps = resolveProps.resolveProps(start, {
|
|
7543
7543
|
indicator: "explicit-key-ind",
|
|
7544
|
-
next: key ??
|
|
7544
|
+
next: key ?? sep10?.[0],
|
|
7545
7545
|
offset,
|
|
7546
7546
|
onError,
|
|
7547
7547
|
parentIndent: bm.indent,
|
|
@@ -7555,7 +7555,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
7555
7555
|
else if ("indent" in key && key.indent !== bm.indent)
|
|
7556
7556
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
7557
7557
|
}
|
|
7558
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
7558
|
+
if (!keyProps.anchor && !keyProps.tag && !sep10) {
|
|
7559
7559
|
commentEnd = keyProps.end;
|
|
7560
7560
|
if (keyProps.comment) {
|
|
7561
7561
|
if (map.comment)
|
|
@@ -7579,7 +7579,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
7579
7579
|
ctx.atKey = false;
|
|
7580
7580
|
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
|
7581
7581
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
7582
|
-
const valueProps = resolveProps.resolveProps(
|
|
7582
|
+
const valueProps = resolveProps.resolveProps(sep10 ?? [], {
|
|
7583
7583
|
indicator: "map-value-ind",
|
|
7584
7584
|
next: value,
|
|
7585
7585
|
offset: keyNode.range[2],
|
|
@@ -7595,7 +7595,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
7595
7595
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
7596
7596
|
onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
7597
7597
|
}
|
|
7598
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset,
|
|
7598
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep10, null, valueProps, onError);
|
|
7599
7599
|
if (ctx.schema.compat)
|
|
7600
7600
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
7601
7601
|
offset = valueNode.range[2];
|
|
@@ -7686,7 +7686,7 @@ var require_resolve_end = __commonJS({
|
|
|
7686
7686
|
let comment = "";
|
|
7687
7687
|
if (end) {
|
|
7688
7688
|
let hasSpace = false;
|
|
7689
|
-
let
|
|
7689
|
+
let sep10 = "";
|
|
7690
7690
|
for (const token of end) {
|
|
7691
7691
|
const { source, type } = token;
|
|
7692
7692
|
switch (type) {
|
|
@@ -7700,13 +7700,13 @@ var require_resolve_end = __commonJS({
|
|
|
7700
7700
|
if (!comment)
|
|
7701
7701
|
comment = cb;
|
|
7702
7702
|
else
|
|
7703
|
-
comment +=
|
|
7704
|
-
|
|
7703
|
+
comment += sep10 + cb;
|
|
7704
|
+
sep10 = "";
|
|
7705
7705
|
break;
|
|
7706
7706
|
}
|
|
7707
7707
|
case "newline":
|
|
7708
7708
|
if (comment)
|
|
7709
|
-
|
|
7709
|
+
sep10 += source;
|
|
7710
7710
|
hasSpace = true;
|
|
7711
7711
|
break;
|
|
7712
7712
|
default:
|
|
@@ -7749,18 +7749,18 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
7749
7749
|
let offset = fc.offset + fc.start.source.length;
|
|
7750
7750
|
for (let i2 = 0; i2 < fc.items.length; ++i2) {
|
|
7751
7751
|
const collItem = fc.items[i2];
|
|
7752
|
-
const { start, key, sep:
|
|
7752
|
+
const { start, key, sep: sep10, value } = collItem;
|
|
7753
7753
|
const props = resolveProps.resolveProps(start, {
|
|
7754
7754
|
flow: fcName,
|
|
7755
7755
|
indicator: "explicit-key-ind",
|
|
7756
|
-
next: key ??
|
|
7756
|
+
next: key ?? sep10?.[0],
|
|
7757
7757
|
offset,
|
|
7758
7758
|
onError,
|
|
7759
7759
|
parentIndent: fc.indent,
|
|
7760
7760
|
startOnNewline: false
|
|
7761
7761
|
});
|
|
7762
7762
|
if (!props.found) {
|
|
7763
|
-
if (!props.anchor && !props.tag && !
|
|
7763
|
+
if (!props.anchor && !props.tag && !sep10 && !value) {
|
|
7764
7764
|
if (i2 === 0 && props.comma)
|
|
7765
7765
|
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
7766
7766
|
else if (i2 < fc.items.length - 1)
|
|
@@ -7814,8 +7814,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
7814
7814
|
}
|
|
7815
7815
|
}
|
|
7816
7816
|
}
|
|
7817
|
-
if (!isMap2 && !
|
|
7818
|
-
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end,
|
|
7817
|
+
if (!isMap2 && !sep10 && !props.found) {
|
|
7818
|
+
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep10, null, props, onError);
|
|
7819
7819
|
coll.items.push(valueNode);
|
|
7820
7820
|
offset = valueNode.range[2];
|
|
7821
7821
|
if (isBlock(value))
|
|
@@ -7827,7 +7827,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
7827
7827
|
if (isBlock(key))
|
|
7828
7828
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
7829
7829
|
ctx.atKey = false;
|
|
7830
|
-
const valueProps = resolveProps.resolveProps(
|
|
7830
|
+
const valueProps = resolveProps.resolveProps(sep10 ?? [], {
|
|
7831
7831
|
flow: fcName,
|
|
7832
7832
|
indicator: "map-value-ind",
|
|
7833
7833
|
next: value,
|
|
@@ -7838,8 +7838,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
7838
7838
|
});
|
|
7839
7839
|
if (valueProps.found) {
|
|
7840
7840
|
if (!isMap2 && !props.found && ctx.options.strict) {
|
|
7841
|
-
if (
|
|
7842
|
-
for (const st of
|
|
7841
|
+
if (sep10)
|
|
7842
|
+
for (const st of sep10) {
|
|
7843
7843
|
if (st === valueProps.found)
|
|
7844
7844
|
break;
|
|
7845
7845
|
if (st.type === "newline") {
|
|
@@ -7856,7 +7856,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
7856
7856
|
else
|
|
7857
7857
|
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
7858
7858
|
}
|
|
7859
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
7859
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep10, null, valueProps, onError) : null;
|
|
7860
7860
|
if (valueNode) {
|
|
7861
7861
|
if (isBlock(value))
|
|
7862
7862
|
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -8036,7 +8036,7 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
8036
8036
|
chompStart = i2 + 1;
|
|
8037
8037
|
}
|
|
8038
8038
|
let value = "";
|
|
8039
|
-
let
|
|
8039
|
+
let sep10 = "";
|
|
8040
8040
|
let prevMoreIndented = false;
|
|
8041
8041
|
for (let i2 = 0; i2 < contentStart; ++i2)
|
|
8042
8042
|
value += lines[i2][0].slice(trimIndent) + "\n";
|
|
@@ -8053,24 +8053,24 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
8053
8053
|
indent = "";
|
|
8054
8054
|
}
|
|
8055
8055
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
8056
|
-
value +=
|
|
8057
|
-
|
|
8056
|
+
value += sep10 + indent.slice(trimIndent) + content;
|
|
8057
|
+
sep10 = "\n";
|
|
8058
8058
|
} else if (indent.length > trimIndent || content[0] === " ") {
|
|
8059
|
-
if (
|
|
8060
|
-
|
|
8061
|
-
else if (!prevMoreIndented &&
|
|
8062
|
-
|
|
8063
|
-
value +=
|
|
8064
|
-
|
|
8059
|
+
if (sep10 === " ")
|
|
8060
|
+
sep10 = "\n";
|
|
8061
|
+
else if (!prevMoreIndented && sep10 === "\n")
|
|
8062
|
+
sep10 = "\n\n";
|
|
8063
|
+
value += sep10 + indent.slice(trimIndent) + content;
|
|
8064
|
+
sep10 = "\n";
|
|
8065
8065
|
prevMoreIndented = true;
|
|
8066
8066
|
} else if (content === "") {
|
|
8067
|
-
if (
|
|
8067
|
+
if (sep10 === "\n")
|
|
8068
8068
|
value += "\n";
|
|
8069
8069
|
else
|
|
8070
|
-
|
|
8070
|
+
sep10 = "\n";
|
|
8071
8071
|
} else {
|
|
8072
|
-
value +=
|
|
8073
|
-
|
|
8072
|
+
value += sep10 + content;
|
|
8073
|
+
sep10 = " ";
|
|
8074
8074
|
prevMoreIndented = false;
|
|
8075
8075
|
}
|
|
8076
8076
|
}
|
|
@@ -8253,25 +8253,25 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
8253
8253
|
trimBoth = /^[ \t]+|[ \t]+$/g;
|
|
8254
8254
|
}
|
|
8255
8255
|
let res = match[1].replace(trimEnd, "");
|
|
8256
|
-
let
|
|
8256
|
+
let sep10 = " ";
|
|
8257
8257
|
let pos = line.lastIndex;
|
|
8258
8258
|
while (match = line.exec(source)) {
|
|
8259
8259
|
const lm = match[1].replace(trimBoth, "");
|
|
8260
8260
|
if (lm === "") {
|
|
8261
|
-
if (
|
|
8262
|
-
res +=
|
|
8261
|
+
if (sep10 === "\n")
|
|
8262
|
+
res += sep10;
|
|
8263
8263
|
else
|
|
8264
|
-
|
|
8264
|
+
sep10 = "\n";
|
|
8265
8265
|
} else {
|
|
8266
|
-
res +=
|
|
8267
|
-
|
|
8266
|
+
res += sep10 + lm;
|
|
8267
|
+
sep10 = " ";
|
|
8268
8268
|
}
|
|
8269
8269
|
pos = line.lastIndex;
|
|
8270
8270
|
}
|
|
8271
8271
|
const last = /[ \t]*(.*)/sy;
|
|
8272
8272
|
last.lastIndex = pos;
|
|
8273
8273
|
match = last.exec(source);
|
|
8274
|
-
return res +
|
|
8274
|
+
return res + sep10 + (match?.[1] ?? "");
|
|
8275
8275
|
}
|
|
8276
8276
|
function doubleQuotedValue(source, onError) {
|
|
8277
8277
|
let res = "";
|
|
@@ -9081,14 +9081,14 @@ var require_cst_stringify = __commonJS({
|
|
|
9081
9081
|
}
|
|
9082
9082
|
}
|
|
9083
9083
|
}
|
|
9084
|
-
function stringifyItem({ start, key, sep:
|
|
9084
|
+
function stringifyItem({ start, key, sep: sep10, value }) {
|
|
9085
9085
|
let res = "";
|
|
9086
9086
|
for (const st of start)
|
|
9087
9087
|
res += st.source;
|
|
9088
9088
|
if (key)
|
|
9089
9089
|
res += stringifyToken(key);
|
|
9090
|
-
if (
|
|
9091
|
-
for (const st of
|
|
9090
|
+
if (sep10)
|
|
9091
|
+
for (const st of sep10)
|
|
9092
9092
|
res += st.source;
|
|
9093
9093
|
if (value)
|
|
9094
9094
|
res += stringifyToken(value);
|
|
@@ -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
|
}
|
|
@@ -10255,18 +10255,18 @@ var require_parser = __commonJS({
|
|
|
10255
10255
|
if (this.type === "map-value-ind") {
|
|
10256
10256
|
const prev = getPrevProps(this.peek(2));
|
|
10257
10257
|
const start = getFirstKeyStartProps(prev);
|
|
10258
|
-
let
|
|
10258
|
+
let sep10;
|
|
10259
10259
|
if (scalar.end) {
|
|
10260
|
-
|
|
10261
|
-
|
|
10260
|
+
sep10 = scalar.end;
|
|
10261
|
+
sep10.push(this.sourceToken);
|
|
10262
10262
|
delete scalar.end;
|
|
10263
10263
|
} else
|
|
10264
|
-
|
|
10264
|
+
sep10 = [this.sourceToken];
|
|
10265
10265
|
const map = {
|
|
10266
10266
|
type: "block-map",
|
|
10267
10267
|
offset: scalar.offset,
|
|
10268
10268
|
indent: scalar.indent,
|
|
10269
|
-
items: [{ start, key: scalar, sep:
|
|
10269
|
+
items: [{ start, key: scalar, sep: sep10 }]
|
|
10270
10270
|
};
|
|
10271
10271
|
this.onKeyLine = true;
|
|
10272
10272
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -10419,15 +10419,15 @@ var require_parser = __commonJS({
|
|
|
10419
10419
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
10420
10420
|
const start2 = getFirstKeyStartProps(it.start);
|
|
10421
10421
|
const key = it.key;
|
|
10422
|
-
const
|
|
10423
|
-
|
|
10422
|
+
const sep10 = it.sep;
|
|
10423
|
+
sep10.push(this.sourceToken);
|
|
10424
10424
|
delete it.key;
|
|
10425
10425
|
delete it.sep;
|
|
10426
10426
|
this.stack.push({
|
|
10427
10427
|
type: "block-map",
|
|
10428
10428
|
offset: this.offset,
|
|
10429
10429
|
indent: this.indent,
|
|
10430
|
-
items: [{ start: start2, key, sep:
|
|
10430
|
+
items: [{ start: start2, key, sep: sep10 }]
|
|
10431
10431
|
});
|
|
10432
10432
|
} else if (start.length > 0) {
|
|
10433
10433
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -10456,14 +10456,14 @@ var require_parser = __commonJS({
|
|
|
10456
10456
|
case "scalar":
|
|
10457
10457
|
case "single-quoted-scalar":
|
|
10458
10458
|
case "double-quoted-scalar": {
|
|
10459
|
-
const
|
|
10459
|
+
const fs27 = this.flowScalar(this.type);
|
|
10460
10460
|
if (atNextItem || it.value) {
|
|
10461
|
-
map.items.push({ start, key:
|
|
10461
|
+
map.items.push({ start, key: fs27, sep: [] });
|
|
10462
10462
|
this.onKeyLine = true;
|
|
10463
10463
|
} else if (it.sep) {
|
|
10464
|
-
this.stack.push(
|
|
10464
|
+
this.stack.push(fs27);
|
|
10465
10465
|
} else {
|
|
10466
|
-
Object.assign(it, { key:
|
|
10466
|
+
Object.assign(it, { key: fs27, sep: [] });
|
|
10467
10467
|
this.onKeyLine = true;
|
|
10468
10468
|
}
|
|
10469
10469
|
return;
|
|
@@ -10591,13 +10591,13 @@ var require_parser = __commonJS({
|
|
|
10591
10591
|
case "scalar":
|
|
10592
10592
|
case "single-quoted-scalar":
|
|
10593
10593
|
case "double-quoted-scalar": {
|
|
10594
|
-
const
|
|
10594
|
+
const fs27 = this.flowScalar(this.type);
|
|
10595
10595
|
if (!it || it.value)
|
|
10596
|
-
fc.items.push({ start: [], key:
|
|
10596
|
+
fc.items.push({ start: [], key: fs27, sep: [] });
|
|
10597
10597
|
else if (it.sep)
|
|
10598
|
-
this.stack.push(
|
|
10598
|
+
this.stack.push(fs27);
|
|
10599
10599
|
else
|
|
10600
|
-
Object.assign(it, { key:
|
|
10600
|
+
Object.assign(it, { key: fs27, sep: [] });
|
|
10601
10601
|
return;
|
|
10602
10602
|
}
|
|
10603
10603
|
case "flow-map-end":
|
|
@@ -10621,13 +10621,13 @@ var require_parser = __commonJS({
|
|
|
10621
10621
|
const prev = getPrevProps(parent);
|
|
10622
10622
|
const start = getFirstKeyStartProps(prev);
|
|
10623
10623
|
fixFlowSeqItems(fc);
|
|
10624
|
-
const
|
|
10625
|
-
|
|
10624
|
+
const sep10 = fc.end.splice(1, fc.end.length);
|
|
10625
|
+
sep10.push(this.sourceToken);
|
|
10626
10626
|
const map = {
|
|
10627
10627
|
type: "block-map",
|
|
10628
10628
|
offset: fc.offset,
|
|
10629
10629
|
indent: fc.indent,
|
|
10630
|
-
items: [{ start, key: fc, sep:
|
|
10630
|
+
items: [{ start, key: fc, sep: sep10 }]
|
|
10631
10631
|
};
|
|
10632
10632
|
this.onKeyLine = true;
|
|
10633
10633
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -10805,7 +10805,7 @@ var require_public_api = __commonJS({
|
|
|
10805
10805
|
}
|
|
10806
10806
|
return doc;
|
|
10807
10807
|
}
|
|
10808
|
-
function
|
|
10808
|
+
function parse6(src, reviver, options) {
|
|
10809
10809
|
let _reviver = void 0;
|
|
10810
10810
|
if (typeof reviver === "function") {
|
|
10811
10811
|
_reviver = reviver;
|
|
@@ -10846,7 +10846,7 @@ var require_public_api = __commonJS({
|
|
|
10846
10846
|
return value.toString(options);
|
|
10847
10847
|
return new Document2.Document(value, _replacer, options).toString(options);
|
|
10848
10848
|
}
|
|
10849
|
-
exports.parse =
|
|
10849
|
+
exports.parse = parse6;
|
|
10850
10850
|
exports.parseAllDocuments = parseAllDocuments;
|
|
10851
10851
|
exports.parseDocument = parseDocument2;
|
|
10852
10852
|
exports.stringify = stringify2;
|
|
@@ -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;
|
|
@@ -15137,44 +15137,53 @@ var OTLPLogExporter = class extends OTLPExporterBase {
|
|
|
15137
15137
|
init_esm();
|
|
15138
15138
|
|
|
15139
15139
|
// ../telemetry/src/debug.ts
|
|
15140
|
-
import * as
|
|
15140
|
+
import * as fs7 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) {
|
|
@@ -15437,7 +15441,9 @@ var CONFIG_SCHEMA = [
|
|
|
15437
15441
|
default: true,
|
|
15438
15442
|
// Opt-in/out goes through the dedicated command so the live client is
|
|
15439
15443
|
// drained/reset, not just the file rewritten.
|
|
15440
|
-
manageCommand: "argent telemetry"
|
|
15444
|
+
manageCommand: "argent telemetry",
|
|
15445
|
+
// consent.ts keeps a ~/.argent opt-out under a moved home; show the same.
|
|
15446
|
+
userHomeOptOut: true
|
|
15441
15447
|
},
|
|
15442
15448
|
{
|
|
15443
15449
|
key: "autoUpdate.enabled",
|
|
@@ -15446,6 +15452,8 @@ var CONFIG_SCHEMA = [
|
|
|
15446
15452
|
parse: asBoolean,
|
|
15447
15453
|
merge: "prioritize-local",
|
|
15448
15454
|
default: true,
|
|
15455
|
+
// The global install is shared by every Argent home.
|
|
15456
|
+
userHomeOptOut: true,
|
|
15449
15457
|
example: "false"
|
|
15450
15458
|
},
|
|
15451
15459
|
{
|
|
@@ -15536,7 +15544,8 @@ function getConfigDefinition(key, registry = CONFIG_SCHEMA) {
|
|
|
15536
15544
|
}
|
|
15537
15545
|
|
|
15538
15546
|
// ../configuration-core/src/config-access.ts
|
|
15539
|
-
import * as
|
|
15547
|
+
import * as fs6 from "node:fs";
|
|
15548
|
+
import * as path7 from "node:path";
|
|
15540
15549
|
function readScopeValue(def, scope, options) {
|
|
15541
15550
|
if (!def.scopes.includes(scope)) return void 0;
|
|
15542
15551
|
const raw = getAtPath(readConfigObject(scope, options), def.key);
|
|
@@ -15545,8 +15554,11 @@ function readScopeValue(def, scope, options) {
|
|
|
15545
15554
|
function getConfigValue(def, options = {}) {
|
|
15546
15555
|
const local = readScopeValue(def, "project", options);
|
|
15547
15556
|
const global2 = readScopeValue(def, "global", options);
|
|
15548
|
-
const merged = applyMergePolicy(def.merge, local, global2);
|
|
15549
|
-
return merged
|
|
15557
|
+
const merged = applyMergePolicy(def.merge, local, global2) ?? def.default;
|
|
15558
|
+
if (!def.userHomeOptOut) return merged;
|
|
15559
|
+
const userHome = { homeDir: resolveHomeDir(options) };
|
|
15560
|
+
if (argentHomeDir(options) === argentHomeDir(userHome)) return merged;
|
|
15561
|
+
return readScopeValue(def, "global", userHome) === false ? false : merged;
|
|
15550
15562
|
}
|
|
15551
15563
|
function getConfigValueByKey(key, options = {}, registry = CONFIG_SCHEMA) {
|
|
15552
15564
|
const def = requireDefinition(key, registry);
|
|
@@ -15567,13 +15579,17 @@ var UnknownConfigKeyError = class extends Error {
|
|
|
15567
15579
|
}
|
|
15568
15580
|
key;
|
|
15569
15581
|
};
|
|
15582
|
+
var AUTO_UPDATE_ENABLED_KEY = "autoUpdate.enabled";
|
|
15583
|
+
function isAutoUpdateEnabled() {
|
|
15584
|
+
return getConfigValueByKey(AUTO_UPDATE_ENABLED_KEY) === true;
|
|
15585
|
+
}
|
|
15570
15586
|
|
|
15571
15587
|
// ../telemetry/src/paths.ts
|
|
15572
15588
|
function identityFilePath() {
|
|
15573
|
-
return
|
|
15589
|
+
return path8.join(argentHomeDir(), "telemetry-id");
|
|
15574
15590
|
}
|
|
15575
15591
|
function debugLogPath() {
|
|
15576
|
-
return
|
|
15592
|
+
return path8.join(argentHomeDir(), "telemetry-debug.log");
|
|
15577
15593
|
}
|
|
15578
15594
|
|
|
15579
15595
|
// ../telemetry/src/debug.ts
|
|
@@ -15603,8 +15619,8 @@ function emitDebugPayload(payload) {
|
|
|
15603
15619
|
} catch {
|
|
15604
15620
|
}
|
|
15605
15621
|
try {
|
|
15606
|
-
|
|
15607
|
-
|
|
15622
|
+
fs7.mkdirSync(argentHomeDir(), { recursive: true });
|
|
15623
|
+
fs7.appendFileSync(debugLogPath(), line + "\n");
|
|
15608
15624
|
} catch {
|
|
15609
15625
|
}
|
|
15610
15626
|
}
|
|
@@ -15792,16 +15808,16 @@ var LAUNCH_PLATFORMS = ["ios", "android", "chromium", "vega", "macos"];
|
|
|
15792
15808
|
var SELECTABLE_PLATFORMS = [...LAUNCH_PLATFORMS, "ios-remote"];
|
|
15793
15809
|
|
|
15794
15810
|
// ../registry/src/flow-file-refs.ts
|
|
15795
|
-
import * as
|
|
15796
|
-
import * as
|
|
15811
|
+
import * as fs9 from "node:fs/promises";
|
|
15812
|
+
import * as path10 from "node:path";
|
|
15797
15813
|
|
|
15798
15814
|
// ../registry/src/e2e-dirs.ts
|
|
15799
|
-
import * as
|
|
15800
|
-
import * as
|
|
15801
|
-
var E2E_DIR =
|
|
15802
|
-
var LEGACY_E2E_DIRS = Object.freeze([
|
|
15815
|
+
import * as fs8 from "node:fs/promises";
|
|
15816
|
+
import * as path9 from "node:path";
|
|
15817
|
+
var E2E_DIR = path9.join(".argent", "e2e");
|
|
15818
|
+
var LEGACY_E2E_DIRS = Object.freeze([path9.join(".argent", "flows")]);
|
|
15803
15819
|
var E2E_DIRS = Object.freeze([E2E_DIR, ...LEGACY_E2E_DIRS]);
|
|
15804
|
-
var E2E_DIR_NAMES = E2E_DIRS.map((dir) =>
|
|
15820
|
+
var E2E_DIR_NAMES = E2E_DIRS.map((dir) => path9.basename(dir));
|
|
15805
15821
|
|
|
15806
15822
|
// ../registry/src/tool-ids.ts
|
|
15807
15823
|
var TOOL_ID_ALIASES = Object.freeze({
|
|
@@ -16650,7 +16666,7 @@ function sanitize(event, raw) {
|
|
|
16650
16666
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
16651
16667
|
|
|
16652
16668
|
// ../telemetry/src/cloud-agent-detect.ts
|
|
16653
|
-
import { existsSync as
|
|
16669
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
16654
16670
|
var CLAUDE_CLOUD_ENV_KINDS = /* @__PURE__ */ new Set(["byoc", "anthropic_cloud"]);
|
|
16655
16671
|
var CLAUDE_REMOTE_ENTRYPOINTS = /* @__PURE__ */ new Set([
|
|
16656
16672
|
"remote",
|
|
@@ -16681,9 +16697,9 @@ function isReplitAgent(env) {
|
|
|
16681
16697
|
}
|
|
16682
16698
|
var DEVIN_MARKER_PATH = "/opt/.devin";
|
|
16683
16699
|
var JULES_MARKER_PATH = "/opt/environment_summary.sh";
|
|
16684
|
-
function safeExists(fileExists,
|
|
16700
|
+
function safeExists(fileExists, path34) {
|
|
16685
16701
|
try {
|
|
16686
|
-
return fileExists(
|
|
16702
|
+
return fileExists(path34);
|
|
16687
16703
|
} catch {
|
|
16688
16704
|
return false;
|
|
16689
16705
|
}
|
|
@@ -16693,7 +16709,7 @@ function detectCloudAgent(env = process.env, opts = {}) {
|
|
|
16693
16709
|
if (isCursorCloud(env)) return "cursor";
|
|
16694
16710
|
if (isCopilotAgent(env)) return "copilot";
|
|
16695
16711
|
if (isReplitAgent(env)) return "replit";
|
|
16696
|
-
const fileExists = opts.fileExists ??
|
|
16712
|
+
const fileExists = opts.fileExists ?? existsSync4;
|
|
16697
16713
|
if (safeExists(fileExists, DEVIN_MARKER_PATH)) return "devin";
|
|
16698
16714
|
if (safeExists(fileExists, JULES_MARKER_PATH)) return "jules";
|
|
16699
16715
|
return null;
|
|
@@ -17103,7 +17119,7 @@ function isCi(env = process.env) {
|
|
|
17103
17119
|
var SESSION_ID = randomUUID4();
|
|
17104
17120
|
function readCliVersion() {
|
|
17105
17121
|
if (true) {
|
|
17106
|
-
return "0.35.1-next.
|
|
17122
|
+
return "0.35.1-next.60";
|
|
17107
17123
|
}
|
|
17108
17124
|
return "0.0.0";
|
|
17109
17125
|
}
|
|
@@ -17136,8 +17152,8 @@ function getBaseProps(runtime) {
|
|
|
17136
17152
|
|
|
17137
17153
|
// ../telemetry/src/identity.ts
|
|
17138
17154
|
import * as crypto2 from "node:crypto";
|
|
17139
|
-
import * as
|
|
17140
|
-
import * as
|
|
17155
|
+
import * as fs10 from "node:fs";
|
|
17156
|
+
import * as path11 from "node:path";
|
|
17141
17157
|
var FINGERPRINT_PATTERN = /^[0-9a-f]{64}$/;
|
|
17142
17158
|
var cached = null;
|
|
17143
17159
|
var fingerprintResolved = null;
|
|
@@ -17244,66 +17260,66 @@ function resolveFingerprintOnce(resolveFingerprint) {
|
|
|
17244
17260
|
function isCorruptIdFile(filePath) {
|
|
17245
17261
|
let isRegularFile;
|
|
17246
17262
|
try {
|
|
17247
|
-
isRegularFile =
|
|
17263
|
+
isRegularFile = fs10.lstatSync(filePath).isFile();
|
|
17248
17264
|
} catch {
|
|
17249
17265
|
return false;
|
|
17250
17266
|
}
|
|
17251
17267
|
return isRegularFile && tryReadId(filePath) === null;
|
|
17252
17268
|
}
|
|
17253
17269
|
function writeIdFileAtomic(finalPath, id) {
|
|
17254
|
-
|
|
17270
|
+
fs10.mkdirSync(argentHomeDir(), { recursive: true });
|
|
17255
17271
|
let occupant;
|
|
17256
17272
|
try {
|
|
17257
|
-
occupant =
|
|
17273
|
+
occupant = fs10.lstatSync(finalPath);
|
|
17258
17274
|
} catch (err) {
|
|
17259
17275
|
if (err.code !== "ENOENT") throw err;
|
|
17260
17276
|
}
|
|
17261
17277
|
if (occupant && !occupant.isFile()) {
|
|
17262
17278
|
throw new Error("telemetry: refusing to replace a non-regular file at the identity path");
|
|
17263
17279
|
}
|
|
17264
|
-
const tmpPath =
|
|
17280
|
+
const tmpPath = path11.join(
|
|
17265
17281
|
argentHomeDir(),
|
|
17266
17282
|
`.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
|
|
17267
17283
|
);
|
|
17268
|
-
const fd =
|
|
17284
|
+
const fd = fs10.openSync(tmpPath, "wx", 384);
|
|
17269
17285
|
try {
|
|
17270
17286
|
try {
|
|
17271
|
-
|
|
17272
|
-
|
|
17287
|
+
fs10.writeSync(fd, id);
|
|
17288
|
+
fs10.fsyncSync(fd);
|
|
17273
17289
|
} finally {
|
|
17274
|
-
|
|
17290
|
+
fs10.closeSync(fd);
|
|
17275
17291
|
}
|
|
17276
|
-
|
|
17292
|
+
fs10.renameSync(tmpPath, finalPath);
|
|
17277
17293
|
} finally {
|
|
17278
17294
|
try {
|
|
17279
|
-
|
|
17295
|
+
fs10.unlinkSync(tmpPath);
|
|
17280
17296
|
} catch {
|
|
17281
17297
|
}
|
|
17282
17298
|
}
|
|
17283
17299
|
}
|
|
17284
17300
|
function mintRandomId(finalPath) {
|
|
17285
|
-
|
|
17301
|
+
fs10.mkdirSync(argentHomeDir(), { recursive: true });
|
|
17286
17302
|
let value = crypto2.randomUUID();
|
|
17287
17303
|
for (let attempt = 0; attempt < 3; attempt++) {
|
|
17288
|
-
const tmpPath =
|
|
17304
|
+
const tmpPath = path11.join(
|
|
17289
17305
|
argentHomeDir(),
|
|
17290
17306
|
`.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
|
|
17291
17307
|
);
|
|
17292
17308
|
let fd;
|
|
17293
17309
|
try {
|
|
17294
|
-
fd =
|
|
17310
|
+
fd = fs10.openSync(tmpPath, "wx", 384);
|
|
17295
17311
|
} catch (err) {
|
|
17296
17312
|
if (err.code === "EEXIST") continue;
|
|
17297
17313
|
throw err;
|
|
17298
17314
|
}
|
|
17299
17315
|
try {
|
|
17300
17316
|
try {
|
|
17301
|
-
|
|
17302
|
-
|
|
17317
|
+
fs10.writeSync(fd, value);
|
|
17318
|
+
fs10.fsyncSync(fd);
|
|
17303
17319
|
} finally {
|
|
17304
|
-
|
|
17320
|
+
fs10.closeSync(fd);
|
|
17305
17321
|
}
|
|
17306
|
-
|
|
17322
|
+
fs10.linkSync(tmpPath, finalPath);
|
|
17307
17323
|
cached = { path: finalPath, id: value };
|
|
17308
17324
|
return value;
|
|
17309
17325
|
} catch (err) {
|
|
@@ -17322,7 +17338,7 @@ function mintRandomId(finalPath) {
|
|
|
17322
17338
|
throw err;
|
|
17323
17339
|
} finally {
|
|
17324
17340
|
try {
|
|
17325
|
-
|
|
17341
|
+
fs10.unlinkSync(tmpPath);
|
|
17326
17342
|
} catch {
|
|
17327
17343
|
}
|
|
17328
17344
|
}
|
|
@@ -17330,12 +17346,12 @@ function mintRandomId(finalPath) {
|
|
|
17330
17346
|
throw new Error("telemetry: failed to create identity after retries");
|
|
17331
17347
|
}
|
|
17332
17348
|
function claimCorruptOccupant(finalPath) {
|
|
17333
|
-
const claimed =
|
|
17349
|
+
const claimed = path11.join(
|
|
17334
17350
|
argentHomeDir(),
|
|
17335
17351
|
`.telemetry-id.corrupt.${process.pid}.${crypto2.randomUUID()}`
|
|
17336
17352
|
);
|
|
17337
17353
|
try {
|
|
17338
|
-
|
|
17354
|
+
fs10.renameSync(finalPath, claimed);
|
|
17339
17355
|
} catch {
|
|
17340
17356
|
return null;
|
|
17341
17357
|
}
|
|
@@ -17344,7 +17360,7 @@ function claimCorruptOccupant(finalPath) {
|
|
|
17344
17360
|
grabbed = tryReadId(claimed);
|
|
17345
17361
|
} finally {
|
|
17346
17362
|
try {
|
|
17347
|
-
|
|
17363
|
+
fs10.unlinkSync(claimed);
|
|
17348
17364
|
} catch {
|
|
17349
17365
|
}
|
|
17350
17366
|
}
|
|
@@ -17353,7 +17369,7 @@ function claimCorruptOccupant(finalPath) {
|
|
|
17353
17369
|
function deleteAnonId() {
|
|
17354
17370
|
cached = null;
|
|
17355
17371
|
try {
|
|
17356
|
-
|
|
17372
|
+
fs10.unlinkSync(identityFilePath());
|
|
17357
17373
|
} catch (err) {
|
|
17358
17374
|
if (err.code !== "ENOENT") throw err;
|
|
17359
17375
|
}
|
|
@@ -17361,9 +17377,9 @@ function deleteAnonId() {
|
|
|
17361
17377
|
function tryReadId(filePath) {
|
|
17362
17378
|
let raw;
|
|
17363
17379
|
try {
|
|
17364
|
-
const stats =
|
|
17380
|
+
const stats = fs10.lstatSync(filePath);
|
|
17365
17381
|
if (!stats.isFile()) return null;
|
|
17366
|
-
raw =
|
|
17382
|
+
raw = fs10.readFileSync(filePath, "utf8");
|
|
17367
17383
|
} catch (err) {
|
|
17368
17384
|
if (err.code === "ENOENT") return null;
|
|
17369
17385
|
return null;
|
|
@@ -17377,12 +17393,12 @@ function tryReadId(filePath) {
|
|
|
17377
17393
|
import { execFileSync, spawn } from "node:child_process";
|
|
17378
17394
|
|
|
17379
17395
|
// ../native-devtools-ios/src/index.ts
|
|
17380
|
-
import * as
|
|
17381
|
-
import * as
|
|
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
|
+
import * as path12 from "node:path";
|
|
17397
|
+
import * as fs11 from "node:fs";
|
|
17398
|
+
var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path12.join(__dirname, "..", "dylibs");
|
|
17399
|
+
var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path12.join(__dirname, "..", "bin");
|
|
17400
|
+
var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path12.join(DYLIB_DIR, "tcp");
|
|
17401
|
+
var DYLIB_TVOS_DIR = path12.join(DYLIB_DIR, "tvos");
|
|
17386
17402
|
function hostPlatformKey() {
|
|
17387
17403
|
if (process.platform === "linux" && process.arch === "arm64") {
|
|
17388
17404
|
return "linux-arm64";
|
|
@@ -17393,14 +17409,14 @@ function simulatorServerBinaryName() {
|
|
|
17393
17409
|
return process.platform === "win32" ? "simulator-server.exe" : "simulator-server";
|
|
17394
17410
|
}
|
|
17395
17411
|
function platformBinDir() {
|
|
17396
|
-
return
|
|
17412
|
+
return path12.join(BIN_DIR, hostPlatformKey());
|
|
17397
17413
|
}
|
|
17398
17414
|
function simulatorServerBinaryPath() {
|
|
17399
17415
|
const binaryName = simulatorServerBinaryName();
|
|
17400
|
-
const p =
|
|
17401
|
-
if (!
|
|
17402
|
-
const flat =
|
|
17403
|
-
const migrationHint =
|
|
17416
|
+
const p = path12.join(platformBinDir(), binaryName);
|
|
17417
|
+
if (!fs11.existsSync(p)) {
|
|
17418
|
+
const flat = path12.join(BIN_DIR, binaryName);
|
|
17419
|
+
const migrationHint = fs11.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
17420
|
throw new Error(
|
|
17405
17421
|
`simulator-server binary not found for platform "${hostPlatformKey()}" at ${p}. Supported hosts today: darwin, linux (x86_64 and arm64), win32.${migrationHint}`
|
|
17406
17422
|
);
|
|
@@ -17429,12 +17445,12 @@ function resolveHostFingerprint() {
|
|
|
17429
17445
|
}
|
|
17430
17446
|
}
|
|
17431
17447
|
function resolveHostFingerprintAsync() {
|
|
17432
|
-
return new Promise((
|
|
17448
|
+
return new Promise((resolve22) => {
|
|
17433
17449
|
let binary;
|
|
17434
17450
|
try {
|
|
17435
17451
|
binary = simulatorServerBinaryPath();
|
|
17436
17452
|
} catch {
|
|
17437
|
-
|
|
17453
|
+
resolve22(null);
|
|
17438
17454
|
return;
|
|
17439
17455
|
}
|
|
17440
17456
|
let settled = false;
|
|
@@ -17447,7 +17463,7 @@ function resolveHostFingerprintAsync() {
|
|
|
17447
17463
|
child?.kill("SIGKILL");
|
|
17448
17464
|
} catch {
|
|
17449
17465
|
}
|
|
17450
|
-
|
|
17466
|
+
resolve22(value);
|
|
17451
17467
|
};
|
|
17452
17468
|
const watchdog = setTimeout(() => finish(null), FINGERPRINT_TIMEOUT_MS);
|
|
17453
17469
|
watchdog.unref?.();
|
|
@@ -17480,15 +17496,15 @@ function resolveHostFingerprintAsync() {
|
|
|
17480
17496
|
}
|
|
17481
17497
|
|
|
17482
17498
|
// ../telemetry/src/consent.ts
|
|
17483
|
-
import * as
|
|
17484
|
-
import * as
|
|
17499
|
+
import * as fs12 from "node:fs";
|
|
17500
|
+
import * as path13 from "node:path";
|
|
17485
17501
|
var cache = /* @__PURE__ */ new Map();
|
|
17486
17502
|
var sessionOverride = null;
|
|
17487
17503
|
function readConfigOverrideAt(filePath) {
|
|
17488
17504
|
const miss = { mtimeMs: null, fingerprint: null, enabledOverride: null };
|
|
17489
17505
|
let stats;
|
|
17490
17506
|
try {
|
|
17491
|
-
stats =
|
|
17507
|
+
stats = fs12.lstatSync(filePath);
|
|
17492
17508
|
} catch {
|
|
17493
17509
|
cache.set(filePath, miss);
|
|
17494
17510
|
return null;
|
|
@@ -17505,7 +17521,7 @@ function readConfigOverrideAt(filePath) {
|
|
|
17505
17521
|
}
|
|
17506
17522
|
let parsedEnabled = null;
|
|
17507
17523
|
try {
|
|
17508
|
-
const raw =
|
|
17524
|
+
const raw = fs12.readFileSync(filePath, "utf8");
|
|
17509
17525
|
const json = JSON.parse(raw);
|
|
17510
17526
|
if (json && typeof json === "object") {
|
|
17511
17527
|
const t2 = json.telemetry;
|
|
@@ -17522,8 +17538,12 @@ function readConfigOverrideAt(filePath) {
|
|
|
17522
17538
|
function readPersistedConsent(cwd) {
|
|
17523
17539
|
const globalPath = configFilePath("global");
|
|
17524
17540
|
const projectPath = configFilePath("project", { cwd });
|
|
17541
|
+
const userConfigPath = path13.join(resolveHomeDir(), ".argent", "config.json");
|
|
17542
|
+
if (userConfigPath !== globalPath && readConfigOverrideAt(userConfigPath) === false) {
|
|
17543
|
+
return { enabled: false, detail: `${userConfigPath} (user)` };
|
|
17544
|
+
}
|
|
17525
17545
|
const global2 = readConfigOverrideAt(globalPath);
|
|
17526
|
-
const projectRoot =
|
|
17546
|
+
const projectRoot = path13.dirname(path13.dirname(projectPath));
|
|
17527
17547
|
const project = isHomeDir(projectRoot) ? null : readConfigOverrideAt(projectPath);
|
|
17528
17548
|
if (project === false && global2 === false) {
|
|
17529
17549
|
return { enabled: false, detail: "config.json (project and global)" };
|
|
@@ -17719,7 +17739,7 @@ var DRAIN_GRACE_MS = 250;
|
|
|
17719
17739
|
async function raceDrain(client2, timeoutMs) {
|
|
17720
17740
|
await Promise.race([
|
|
17721
17741
|
client2.shutdown(timeoutMs),
|
|
17722
|
-
new Promise((
|
|
17742
|
+
new Promise((resolve22) => setTimeout(resolve22, timeoutMs + DRAIN_GRACE_MS).unref())
|
|
17723
17743
|
]);
|
|
17724
17744
|
}
|
|
17725
17745
|
async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
|
|
@@ -17739,10 +17759,10 @@ async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
|
|
|
17739
17759
|
}
|
|
17740
17760
|
|
|
17741
17761
|
// ../argent-installer/src/mcp-configs.ts
|
|
17742
|
-
import * as
|
|
17743
|
-
import * as
|
|
17762
|
+
import * as fs19 from "node:fs";
|
|
17763
|
+
import * as path20 from "node:path";
|
|
17744
17764
|
import { execFileSync as execFileSync5 } from "node:child_process";
|
|
17745
|
-
import { homedir as
|
|
17765
|
+
import { homedir as homedir4 } from "node:os";
|
|
17746
17766
|
|
|
17747
17767
|
// ../argent-installer/src/constants.ts
|
|
17748
17768
|
var PACKAGE_NAME = "@swmansion/argent";
|
|
@@ -17755,8 +17775,8 @@ var CURSOR_ALLOWLIST_PATTERN = "argent:*";
|
|
|
17755
17775
|
|
|
17756
17776
|
// ../argent-installer/src/utils.ts
|
|
17757
17777
|
var import_semver3 = __toESM(require_semver2(), 1);
|
|
17758
|
-
import * as
|
|
17759
|
-
import * as
|
|
17778
|
+
import * as fs18 from "node:fs";
|
|
17779
|
+
import * as path19 from "node:path";
|
|
17760
17780
|
import * as dns from "node:dns";
|
|
17761
17781
|
import { createHash as createHash2 } from "node:crypto";
|
|
17762
17782
|
import * as os3 from "node:os";
|
|
@@ -19482,11 +19502,11 @@ function parseTree(text2, errors = [], options = ParseOptions.DEFAULT) {
|
|
|
19482
19502
|
onValue({ type: getNodeType(value), offset, length, parent: currentParent, value });
|
|
19483
19503
|
ensurePropertyComplete(offset + length);
|
|
19484
19504
|
},
|
|
19485
|
-
onSeparator: (
|
|
19505
|
+
onSeparator: (sep10, offset, length) => {
|
|
19486
19506
|
if (currentParent.type === "property") {
|
|
19487
|
-
if (
|
|
19507
|
+
if (sep10 === ":") {
|
|
19488
19508
|
currentParent.colonOffset = offset;
|
|
19489
|
-
} else if (
|
|
19509
|
+
} else if (sep10 === ",") {
|
|
19490
19510
|
ensurePropertyComplete(offset);
|
|
19491
19511
|
}
|
|
19492
19512
|
}
|
|
@@ -19502,12 +19522,12 @@ function parseTree(text2, errors = [], options = ParseOptions.DEFAULT) {
|
|
|
19502
19522
|
}
|
|
19503
19523
|
return result;
|
|
19504
19524
|
}
|
|
19505
|
-
function findNodeAtLocation(root,
|
|
19525
|
+
function findNodeAtLocation(root, path34) {
|
|
19506
19526
|
if (!root) {
|
|
19507
19527
|
return void 0;
|
|
19508
19528
|
}
|
|
19509
19529
|
let node = root;
|
|
19510
|
-
for (let segment of
|
|
19530
|
+
for (let segment of path34) {
|
|
19511
19531
|
if (typeof segment === "string") {
|
|
19512
19532
|
if (node.type !== "object" || !Array.isArray(node.children)) {
|
|
19513
19533
|
return void 0;
|
|
@@ -19861,14 +19881,14 @@ function getNodeType(value) {
|
|
|
19861
19881
|
|
|
19862
19882
|
// ../../node_modules/jsonc-parser/lib/esm/impl/edit.js
|
|
19863
19883
|
function setProperty(text2, originalPath, value, options) {
|
|
19864
|
-
const
|
|
19884
|
+
const path34 = originalPath.slice();
|
|
19865
19885
|
const errors = [];
|
|
19866
19886
|
const root = parseTree(text2, errors);
|
|
19867
19887
|
let parent = void 0;
|
|
19868
19888
|
let lastSegment = void 0;
|
|
19869
|
-
while (
|
|
19870
|
-
lastSegment =
|
|
19871
|
-
parent = findNodeAtLocation(root,
|
|
19889
|
+
while (path34.length > 0) {
|
|
19890
|
+
lastSegment = path34.pop();
|
|
19891
|
+
parent = findNodeAtLocation(root, path34);
|
|
19872
19892
|
if (parent === void 0 && value !== void 0) {
|
|
19873
19893
|
if (typeof lastSegment === "string") {
|
|
19874
19894
|
value = { [lastSegment]: value };
|
|
@@ -20054,8 +20074,8 @@ var ParseErrorCode;
|
|
|
20054
20074
|
ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
|
|
20055
20075
|
ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
20056
20076
|
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
20057
|
-
function modify(text2,
|
|
20058
|
-
return setProperty(text2,
|
|
20077
|
+
function modify(text2, path34, value, options) {
|
|
20078
|
+
return setProperty(text2, path34, value, options);
|
|
20059
20079
|
}
|
|
20060
20080
|
function applyEdits(text2, edits) {
|
|
20061
20081
|
let sortedEdits = edits.slice(0).sort((a2, b) => {
|
|
@@ -20079,39 +20099,39 @@ function applyEdits(text2, edits) {
|
|
|
20079
20099
|
}
|
|
20080
20100
|
|
|
20081
20101
|
// ../argent-installer/src/package-root.ts
|
|
20082
|
-
import * as
|
|
20083
|
-
import * as
|
|
20084
|
-
function resolvePackageRoot(
|
|
20085
|
-
let current =
|
|
20102
|
+
import * as fs13 from "node:fs";
|
|
20103
|
+
import * as path14 from "node:path";
|
|
20104
|
+
function resolvePackageRoot(dirname19) {
|
|
20105
|
+
let current = path14.resolve(dirname19);
|
|
20086
20106
|
while (true) {
|
|
20087
|
-
if (
|
|
20088
|
-
const parent =
|
|
20089
|
-
if (parent === current) return
|
|
20107
|
+
if (fs13.existsSync(path14.join(current, "package.json"))) return current;
|
|
20108
|
+
const parent = path14.dirname(current);
|
|
20109
|
+
if (parent === current) return path14.resolve(dirname19);
|
|
20090
20110
|
current = parent;
|
|
20091
20111
|
}
|
|
20092
20112
|
}
|
|
20093
20113
|
|
|
20094
20114
|
// ../argent-installer/src/package-manager.ts
|
|
20095
20115
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
20096
|
-
import * as
|
|
20116
|
+
import * as fs16 from "node:fs";
|
|
20097
20117
|
import * as os2 from "node:os";
|
|
20098
|
-
import * as
|
|
20118
|
+
import * as path17 from "node:path";
|
|
20099
20119
|
|
|
20100
20120
|
// ../argent-installer/src/topology.ts
|
|
20101
20121
|
var import_semver2 = __toESM(require_semver2(), 1);
|
|
20102
|
-
import * as
|
|
20103
|
-
import * as
|
|
20122
|
+
import * as fs15 from "node:fs";
|
|
20123
|
+
import * as path16 from "node:path";
|
|
20104
20124
|
import { createRequire } from "node:module";
|
|
20105
20125
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
20106
20126
|
|
|
20107
20127
|
// ../argent-installer/src/preflight.ts
|
|
20108
|
-
import * as
|
|
20109
|
-
import * as
|
|
20128
|
+
import * as fs14 from "node:fs";
|
|
20129
|
+
import * as path15 from "node:path";
|
|
20110
20130
|
function hasProjectPackageJson(projectRoot) {
|
|
20111
|
-
return
|
|
20131
|
+
return fs14.existsSync(path15.join(projectRoot, "package.json"));
|
|
20112
20132
|
}
|
|
20113
20133
|
function isYarnPnp(projectRoot) {
|
|
20114
|
-
return
|
|
20134
|
+
return fs14.existsSync(path15.join(projectRoot, ".pnp.cjs")) || fs14.existsSync(path15.join(projectRoot, ".pnp.loader.mjs"));
|
|
20115
20135
|
}
|
|
20116
20136
|
|
|
20117
20137
|
// ../argent-installer/src/topology.ts
|
|
@@ -20137,12 +20157,12 @@ function isTempRunnerPath(binaryPath) {
|
|
|
20137
20157
|
}
|
|
20138
20158
|
function isProjectBinPath(binaryPath) {
|
|
20139
20159
|
const norm = (p) => process.platform === "win32" ? p.toLowerCase() : canonicalPath(p);
|
|
20140
|
-
const binDir = norm(
|
|
20160
|
+
const binDir = norm(path16.dirname(path16.resolve(binaryPath)));
|
|
20141
20161
|
const prefix = process.env.npm_config_local_prefix;
|
|
20142
|
-
if (prefix && norm(
|
|
20143
|
-
for (let dir =
|
|
20144
|
-
if (norm(
|
|
20145
|
-
if (
|
|
20162
|
+
if (prefix && norm(path16.join(prefix, "node_modules", ".bin")) === binDir) return true;
|
|
20163
|
+
for (let dir = path16.resolve(process.cwd()); ; dir = path16.dirname(dir)) {
|
|
20164
|
+
if (norm(path16.join(dir, "node_modules", ".bin")) === binDir) return true;
|
|
20165
|
+
if (path16.dirname(dir) === dir) return false;
|
|
20146
20166
|
}
|
|
20147
20167
|
}
|
|
20148
20168
|
function getPermanentBinaryPaths() {
|
|
@@ -20190,8 +20210,8 @@ function getGloballyInstalledPackageRoot() {
|
|
|
20190
20210
|
}
|
|
20191
20211
|
function readShimScript(binaryPath) {
|
|
20192
20212
|
try {
|
|
20193
|
-
if (
|
|
20194
|
-
return
|
|
20213
|
+
if (fs15.statSync(binaryPath).size > 64 * 1024) return null;
|
|
20214
|
+
return fs15.readFileSync(binaryPath, "utf8");
|
|
20195
20215
|
} catch {
|
|
20196
20216
|
return null;
|
|
20197
20217
|
}
|
|
@@ -20202,7 +20222,7 @@ function shimTargetOf(binaryPath) {
|
|
|
20202
20222
|
const trailer = /^# cmd-shim-target=(.+)$/m.exec(shim);
|
|
20203
20223
|
if (trailer) return trailer[1].trim();
|
|
20204
20224
|
const relative5 = /"\$basedir(?:_abs)?"?\/'?([^"'\s]*node_modules\/[^"'\s]*)/.exec(shim);
|
|
20205
|
-
return relative5 ?
|
|
20225
|
+
return relative5 ? path16.resolve(canonicalPath(path16.dirname(binaryPath)), relative5[1]) : null;
|
|
20206
20226
|
}
|
|
20207
20227
|
function globalPackageRootOf(binaryPath) {
|
|
20208
20228
|
const root = packageRootOf(binaryPath);
|
|
@@ -20212,9 +20232,9 @@ function globalPackageRootOf(binaryPath) {
|
|
|
20212
20232
|
}
|
|
20213
20233
|
function packageRootOf(binaryPath) {
|
|
20214
20234
|
try {
|
|
20215
|
-
const realPath =
|
|
20216
|
-
const root = resolvePackageRoot(
|
|
20217
|
-
const pkg = JSON.parse(
|
|
20235
|
+
const realPath = fs15.realpathSync(binaryPath);
|
|
20236
|
+
const root = resolvePackageRoot(path16.dirname(realPath));
|
|
20237
|
+
const pkg = JSON.parse(fs15.readFileSync(path16.join(root, "package.json"), "utf8"));
|
|
20218
20238
|
return pkg.name === PACKAGE_NAME ? root : null;
|
|
20219
20239
|
} catch {
|
|
20220
20240
|
return null;
|
|
@@ -20223,8 +20243,8 @@ function packageRootOf(binaryPath) {
|
|
|
20223
20243
|
function cliPathOf(packageRoot) {
|
|
20224
20244
|
const binSub = argentBinSubpath(packageRoot);
|
|
20225
20245
|
if (!binSub) return null;
|
|
20226
|
-
const cli =
|
|
20227
|
-
return
|
|
20246
|
+
const cli = path16.join(packageRoot, binSub);
|
|
20247
|
+
return fs15.existsSync(cli) ? cli : null;
|
|
20228
20248
|
}
|
|
20229
20249
|
function getGloballyInstalledLaunchPaths() {
|
|
20230
20250
|
if (process.platform === "win32") return null;
|
|
@@ -20234,8 +20254,8 @@ function getGloballyInstalledLaunchPaths() {
|
|
|
20234
20254
|
const cli = packageRoot ? cliPathOf(packageRoot) : null;
|
|
20235
20255
|
if (!cli) return null;
|
|
20236
20256
|
try {
|
|
20237
|
-
const node =
|
|
20238
|
-
return
|
|
20257
|
+
const node = path16.join(fs15.realpathSync(path16.dirname(binaryPath)), "node");
|
|
20258
|
+
return fs15.existsSync(node) ? { node, cli } : null;
|
|
20239
20259
|
} catch {
|
|
20240
20260
|
return null;
|
|
20241
20261
|
}
|
|
@@ -20244,7 +20264,7 @@ function getGloballyInstalledVersion() {
|
|
|
20244
20264
|
const pkgRoot = getGloballyInstalledPackageRoot();
|
|
20245
20265
|
if (!pkgRoot) return null;
|
|
20246
20266
|
try {
|
|
20247
|
-
const pkg = JSON.parse(
|
|
20267
|
+
const pkg = JSON.parse(fs15.readFileSync(path16.join(pkgRoot, "package.json"), "utf8"));
|
|
20248
20268
|
return pkg.version ?? null;
|
|
20249
20269
|
} catch {
|
|
20250
20270
|
return null;
|
|
@@ -20253,7 +20273,7 @@ function getGloballyInstalledVersion() {
|
|
|
20253
20273
|
function readManifestDeclaration(projectRoot) {
|
|
20254
20274
|
try {
|
|
20255
20275
|
const pkg = JSON.parse(
|
|
20256
|
-
|
|
20276
|
+
fs15.readFileSync(path16.join(projectRoot, "package.json"), "utf8")
|
|
20257
20277
|
);
|
|
20258
20278
|
const spec = pkg.devDependencies?.[PACKAGE_NAME] ?? pkg.dependencies?.[PACKAGE_NAME] ?? pkg.optionalDependencies?.[PACKAGE_NAME];
|
|
20259
20279
|
return typeof spec === "string" ? spec : null;
|
|
@@ -20266,11 +20286,11 @@ function isDeclaredLocally(projectRoot) {
|
|
|
20266
20286
|
}
|
|
20267
20287
|
function resolveLocalArgentDir(projectRoot) {
|
|
20268
20288
|
try {
|
|
20269
|
-
const req = createRequire(
|
|
20270
|
-
return
|
|
20289
|
+
const req = createRequire(path16.join(projectRoot, "package.json"));
|
|
20290
|
+
return path16.dirname(req.resolve(`${PACKAGE_NAME}/package.json`));
|
|
20271
20291
|
} catch {
|
|
20272
|
-
const plain =
|
|
20273
|
-
return
|
|
20292
|
+
const plain = path16.join(projectRoot, "node_modules", PACKAGE_NAME);
|
|
20293
|
+
return fs15.existsSync(path16.join(plain, "package.json")) ? plain : null;
|
|
20274
20294
|
}
|
|
20275
20295
|
}
|
|
20276
20296
|
function probeLocalInstall(projectRoot) {
|
|
@@ -20278,7 +20298,7 @@ function probeLocalInstall(projectRoot) {
|
|
|
20278
20298
|
if (packageDir) {
|
|
20279
20299
|
let version;
|
|
20280
20300
|
try {
|
|
20281
|
-
const pkg = JSON.parse(
|
|
20301
|
+
const pkg = JSON.parse(fs15.readFileSync(path16.join(packageDir, "package.json"), "utf8"));
|
|
20282
20302
|
version = pkg.version ?? null;
|
|
20283
20303
|
} catch {
|
|
20284
20304
|
version = null;
|
|
@@ -20301,8 +20321,8 @@ function getLocallyInstalledVersion(projectRoot) {
|
|
|
20301
20321
|
}
|
|
20302
20322
|
function readLocalPackageVersionUncached(projectRoot) {
|
|
20303
20323
|
try {
|
|
20304
|
-
const pkgPath =
|
|
20305
|
-
const pkg = JSON.parse(
|
|
20324
|
+
const pkgPath = path16.join(projectRoot, "node_modules", PACKAGE_NAME, "package.json");
|
|
20325
|
+
const pkg = JSON.parse(fs15.readFileSync(pkgPath, "utf8"));
|
|
20306
20326
|
return pkg.version ?? null;
|
|
20307
20327
|
} catch {
|
|
20308
20328
|
return null;
|
|
@@ -20310,7 +20330,7 @@ function readLocalPackageVersionUncached(projectRoot) {
|
|
|
20310
20330
|
}
|
|
20311
20331
|
function argentBinSubpath(pkgDir) {
|
|
20312
20332
|
try {
|
|
20313
|
-
const pkg = JSON.parse(
|
|
20333
|
+
const pkg = JSON.parse(fs15.readFileSync(path16.join(pkgDir, "package.json"), "utf8"));
|
|
20314
20334
|
if (typeof pkg.bin === "string") return pkg.bin;
|
|
20315
20335
|
if (pkg.bin && typeof pkg.bin === "object") {
|
|
20316
20336
|
return pkg.bin[MCP_BINARY_NAME] ?? Object.values(pkg.bin)[0] ?? null;
|
|
@@ -20327,16 +20347,16 @@ function getLocalArgentBinRelPath(projectRoot) {
|
|
|
20327
20347
|
if (!binSub) return null;
|
|
20328
20348
|
let root = projectRoot;
|
|
20329
20349
|
try {
|
|
20330
|
-
root =
|
|
20350
|
+
root = fs15.realpathSync(projectRoot);
|
|
20331
20351
|
} catch {
|
|
20332
20352
|
}
|
|
20333
|
-
const stableRel =
|
|
20334
|
-
if (
|
|
20335
|
-
return stableRel.split(
|
|
20353
|
+
const stableRel = path16.join("node_modules", PACKAGE_NAME, binSub);
|
|
20354
|
+
if (fs15.existsSync(path16.join(root, stableRel))) {
|
|
20355
|
+
return stableRel.split(path16.sep).join("/");
|
|
20336
20356
|
}
|
|
20337
|
-
const abs =
|
|
20338
|
-
if (!
|
|
20339
|
-
return
|
|
20357
|
+
const abs = path16.join(pkgDir, binSub);
|
|
20358
|
+
if (!fs15.existsSync(abs)) return null;
|
|
20359
|
+
return path16.relative(root, abs).split(path16.sep).join("/");
|
|
20340
20360
|
}
|
|
20341
20361
|
|
|
20342
20362
|
// ../argent-installer/src/package-manager.ts
|
|
@@ -20369,10 +20389,10 @@ function detectGlobalPackageManager() {
|
|
|
20369
20389
|
return BUN_GLOBAL_ROOT.test(root) ? "bun" : lockfileOwnerOf(root) ?? "yarn";
|
|
20370
20390
|
}
|
|
20371
20391
|
if (process.platform === "win32") {
|
|
20372
|
-
if (
|
|
20392
|
+
if (fs16.existsSync(path17.join(npmCopyBeside(path17.dirname(binaryPath)), "package.json"))) {
|
|
20373
20393
|
return "npm";
|
|
20374
20394
|
}
|
|
20375
|
-
if (
|
|
20395
|
+
if (fs16.existsSync(binaryPath.replace(/\.exe$/i, "") + ".bunx")) return "bun";
|
|
20376
20396
|
}
|
|
20377
20397
|
const shim = readShimScript(binaryPath);
|
|
20378
20398
|
if (shim === null || !/node_modules[\\/]/.test(shim)) return "npm";
|
|
@@ -20381,23 +20401,23 @@ function detectGlobalPackageManager() {
|
|
|
20381
20401
|
return (target ? lockfileOwnerOf(target) : null) ?? "yarn";
|
|
20382
20402
|
}
|
|
20383
20403
|
function lockfileOwnerOf(root) {
|
|
20384
|
-
for (let dir =
|
|
20404
|
+
for (let dir = path17.dirname(root); path17.dirname(dir) !== dir; dir = path17.dirname(dir)) {
|
|
20385
20405
|
const pm = pmFromLockfile(dir);
|
|
20386
20406
|
if (pm) return pm;
|
|
20387
20407
|
}
|
|
20388
20408
|
return null;
|
|
20389
20409
|
}
|
|
20390
20410
|
function npmCopyBeside(binDir) {
|
|
20391
|
-
return process.platform === "win32" ?
|
|
20411
|
+
return process.platform === "win32" ? path17.join(binDir, "node_modules", PACKAGE_NAME) : path17.join(path17.dirname(binDir), "lib", "node_modules", PACKAGE_NAME);
|
|
20392
20412
|
}
|
|
20393
20413
|
function isInNpmLayout(binaryPath, root) {
|
|
20394
20414
|
const realRoot = canonicalPath(root);
|
|
20395
20415
|
let link = binaryPath;
|
|
20396
20416
|
for (let hop = 0; hop < 40; hop++) {
|
|
20397
|
-
const binDir = canonicalPath(
|
|
20417
|
+
const binDir = canonicalPath(path17.dirname(link));
|
|
20398
20418
|
if (canonicalPath(npmCopyBeside(binDir)) === realRoot) return true;
|
|
20399
20419
|
try {
|
|
20400
|
-
link =
|
|
20420
|
+
link = path17.resolve(binDir, fs16.readlinkSync(link));
|
|
20401
20421
|
} catch {
|
|
20402
20422
|
return false;
|
|
20403
20423
|
}
|
|
@@ -20416,7 +20436,7 @@ function asKnownPm(name) {
|
|
|
20416
20436
|
}
|
|
20417
20437
|
function pmFromPackageManagerField(dir) {
|
|
20418
20438
|
try {
|
|
20419
|
-
const pkg = JSON.parse(
|
|
20439
|
+
const pkg = JSON.parse(fs16.readFileSync(path17.join(dir, "package.json"), "utf8"));
|
|
20420
20440
|
if (typeof pkg.packageManager === "string") {
|
|
20421
20441
|
return asKnownPm(pkg.packageManager.split("@")[0]);
|
|
20422
20442
|
}
|
|
@@ -20427,7 +20447,7 @@ function pmFromPackageManagerField(dir) {
|
|
|
20427
20447
|
}
|
|
20428
20448
|
function pmFromDevEngines(dir) {
|
|
20429
20449
|
try {
|
|
20430
|
-
const pkg = JSON.parse(
|
|
20450
|
+
const pkg = JSON.parse(fs16.readFileSync(path17.join(dir, "package.json"), "utf8"));
|
|
20431
20451
|
const devEnginesPm = pkg.devEngines?.packageManager;
|
|
20432
20452
|
const names = /* @__PURE__ */ new Set();
|
|
20433
20453
|
for (const entry of Array.isArray(devEnginesPm) ? devEnginesPm : [devEnginesPm]) {
|
|
@@ -20440,7 +20460,7 @@ function pmFromDevEngines(dir) {
|
|
|
20440
20460
|
}
|
|
20441
20461
|
}
|
|
20442
20462
|
function pmFromLockfile(dir) {
|
|
20443
|
-
const has = (file) =>
|
|
20463
|
+
const has = (file) => fs16.existsSync(path17.join(dir, file));
|
|
20444
20464
|
if (has("pnpm-lock.yaml")) return "pnpm";
|
|
20445
20465
|
if (has("yarn.lock")) return "yarn";
|
|
20446
20466
|
if (has("bun.lock") || has("bun.lockb")) return "bun";
|
|
@@ -20448,15 +20468,15 @@ function pmFromLockfile(dir) {
|
|
|
20448
20468
|
return null;
|
|
20449
20469
|
}
|
|
20450
20470
|
function pmFromWorkspaceMarker(dir) {
|
|
20451
|
-
return
|
|
20471
|
+
return fs16.existsSync(path17.join(dir, "pnpm-workspace.yaml")) ? "pnpm" : null;
|
|
20452
20472
|
}
|
|
20453
20473
|
function detectProjectPackageManager(projectRoot) {
|
|
20454
|
-
let dir =
|
|
20474
|
+
let dir = path17.resolve(projectRoot);
|
|
20455
20475
|
for (; ; ) {
|
|
20456
20476
|
const pm = pmFromPackageManagerField(dir) ?? pmFromLockfile(dir) ?? pmFromDevEngines(dir) ?? pmFromWorkspaceMarker(dir);
|
|
20457
20477
|
if (pm) return pm;
|
|
20458
|
-
if (
|
|
20459
|
-
const parent =
|
|
20478
|
+
if (fs16.existsSync(path17.join(dir, ".git"))) break;
|
|
20479
|
+
const parent = path17.dirname(dir);
|
|
20460
20480
|
if (parent === dir) break;
|
|
20461
20481
|
dir = parent;
|
|
20462
20482
|
}
|
|
@@ -20477,7 +20497,7 @@ function globalInstallCommand(pm, pkg) {
|
|
|
20477
20497
|
function globalCommandOptions(pm) {
|
|
20478
20498
|
if (pm === "npm") return {};
|
|
20479
20499
|
const home = os2.homedir();
|
|
20480
|
-
const cwd =
|
|
20500
|
+
const cwd = fs16.existsSync(home) ? { cwd: home } : {};
|
|
20481
20501
|
if (pm !== "yarn" || !process.env.npm_config_user_agent?.startsWith("npm/")) return cwd;
|
|
20482
20502
|
const { npm_config_prefix: _npmPrefix, ...env } = process.env;
|
|
20483
20503
|
return { ...cwd, env };
|
|
@@ -20509,11 +20529,11 @@ function ownsGlobalInstall(pm, runningRoot) {
|
|
|
20509
20529
|
localBuild = !isRegistrySpec(dependency?.version);
|
|
20510
20530
|
} else {
|
|
20511
20531
|
const dir = pm === "bun" ? /^([^\r\n]+) node_modules \(/.exec(output)?.[1] : output;
|
|
20512
|
-
if (!dir || !
|
|
20513
|
-
pkg = pm === "npm" ?
|
|
20514
|
-
localBuild =
|
|
20532
|
+
if (!dir || !path17.isAbsolute(dir)) return false;
|
|
20533
|
+
pkg = pm === "npm" ? path17.join(dir, PACKAGE_NAME) : path17.join(dir, "node_modules", PACKAGE_NAME);
|
|
20534
|
+
localBuild = fs16.lstatSync(pkg).isSymbolicLink();
|
|
20515
20535
|
}
|
|
20516
|
-
return !localBuild && !!pkg &&
|
|
20536
|
+
return !localBuild && !!pkg && path17.isAbsolute(pkg) && fs16.realpathSync(pkg) === runningRoot;
|
|
20517
20537
|
} catch {
|
|
20518
20538
|
return false;
|
|
20519
20539
|
}
|
|
@@ -20568,15 +20588,15 @@ function localUninstallCommand(pm, pkg) {
|
|
|
20568
20588
|
}
|
|
20569
20589
|
|
|
20570
20590
|
// ../argent-installer/src/install-record.ts
|
|
20571
|
-
import * as
|
|
20572
|
-
import * as
|
|
20591
|
+
import * as fs17 from "node:fs";
|
|
20592
|
+
import * as path18 from "node:path";
|
|
20573
20593
|
function getInstallRecordPath(projectRoot) {
|
|
20574
|
-
return
|
|
20594
|
+
return path18.join(projectRoot, ".argent", "install.json");
|
|
20575
20595
|
}
|
|
20576
20596
|
function readInstallRecord(projectRoot) {
|
|
20577
20597
|
try {
|
|
20578
20598
|
const parsed = JSON.parse(
|
|
20579
|
-
|
|
20599
|
+
fs17.readFileSync(getInstallRecordPath(projectRoot), "utf8")
|
|
20580
20600
|
);
|
|
20581
20601
|
if (parsed && (parsed.mode === "local" || parsed.mode === "global")) return parsed;
|
|
20582
20602
|
return null;
|
|
@@ -20586,17 +20606,17 @@ function readInstallRecord(projectRoot) {
|
|
|
20586
20606
|
}
|
|
20587
20607
|
function writeInstallRecord(projectRoot, record) {
|
|
20588
20608
|
const recordPath = getInstallRecordPath(projectRoot);
|
|
20589
|
-
|
|
20590
|
-
|
|
20609
|
+
fs17.mkdirSync(path18.dirname(recordPath), { recursive: true });
|
|
20610
|
+
fs17.writeFileSync(recordPath, JSON.stringify(record, null, 2) + "\n");
|
|
20591
20611
|
}
|
|
20592
20612
|
function removeInstallRecord(projectRoot) {
|
|
20593
20613
|
const recordPath = getInstallRecordPath(projectRoot);
|
|
20594
20614
|
try {
|
|
20595
|
-
if (!
|
|
20596
|
-
|
|
20597
|
-
const dir =
|
|
20615
|
+
if (!fs17.existsSync(recordPath)) return false;
|
|
20616
|
+
fs17.rmSync(recordPath, { force: true });
|
|
20617
|
+
const dir = path18.dirname(recordPath);
|
|
20598
20618
|
try {
|
|
20599
|
-
if (
|
|
20619
|
+
if (fs17.existsSync(dir) && fs17.readdirSync(dir).length === 0) fs17.rmdirSync(dir);
|
|
20600
20620
|
} catch {
|
|
20601
20621
|
}
|
|
20602
20622
|
return true;
|
|
@@ -20624,9 +20644,9 @@ function resolveInstallModeFromFlags(opts) {
|
|
|
20624
20644
|
// ../argent-installer/src/utils.ts
|
|
20625
20645
|
var PACKAGE_ROOT = resolvePackageRoot(import.meta.dirname);
|
|
20626
20646
|
function resolveBundledDir(dirName) {
|
|
20627
|
-
const packagedDir =
|
|
20628
|
-
if (
|
|
20629
|
-
return
|
|
20647
|
+
const packagedDir = path19.join(PACKAGE_ROOT, dirName);
|
|
20648
|
+
if (fs18.existsSync(packagedDir)) return packagedDir;
|
|
20649
|
+
return path19.resolve(PACKAGE_ROOT, "..", "skills", dirName);
|
|
20630
20650
|
}
|
|
20631
20651
|
var SKILLS_DIR = resolveBundledDir("skills");
|
|
20632
20652
|
var RULES_DIR = resolveBundledDir("rules");
|
|
@@ -20638,18 +20658,18 @@ function buildArgentSkillsSource(version) {
|
|
|
20638
20658
|
}
|
|
20639
20659
|
function listBundledSkills(skillsDir = SKILLS_DIR) {
|
|
20640
20660
|
try {
|
|
20641
|
-
return
|
|
20661
|
+
return fs18.readdirSync(skillsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).filter((name) => fs18.existsSync(path19.join(skillsDir, name, "SKILL.md"))).sort();
|
|
20642
20662
|
} catch {
|
|
20643
20663
|
return [];
|
|
20644
20664
|
}
|
|
20645
20665
|
}
|
|
20646
20666
|
function getProjectSkillLockPath(cwd = process.cwd()) {
|
|
20647
|
-
return
|
|
20667
|
+
return path19.join(cwd, "skills-lock.json");
|
|
20648
20668
|
}
|
|
20649
20669
|
function getGlobalSkillLockPath() {
|
|
20650
20670
|
const xdgStateHome = process.env.XDG_STATE_HOME;
|
|
20651
|
-
if (xdgStateHome) return
|
|
20652
|
-
return
|
|
20671
|
+
if (xdgStateHome) return path19.join(xdgStateHome, "skills", ".skill-lock.json");
|
|
20672
|
+
return path19.join(os3.homedir(), ".agents", ".skill-lock.json");
|
|
20653
20673
|
}
|
|
20654
20674
|
var ARGENT_SKILL_PREFIX = "argent-";
|
|
20655
20675
|
var LEGACY_ARGENT_SKILL_NAMES = [
|
|
@@ -20755,7 +20775,7 @@ function hashBundledContent(content) {
|
|
|
20755
20775
|
}
|
|
20756
20776
|
function listArgentSkillsInLock(lockPath) {
|
|
20757
20777
|
try {
|
|
20758
|
-
const raw =
|
|
20778
|
+
const raw = fs18.readFileSync(lockPath, "utf8");
|
|
20759
20779
|
const lock = JSON.parse(raw);
|
|
20760
20780
|
const tracked = lock.skills ?? {};
|
|
20761
20781
|
return Object.keys(tracked).filter((name) => name.startsWith(ARGENT_SKILL_PREFIX)).sort();
|
|
@@ -20779,20 +20799,20 @@ var PROJECT_ROOT_MARKERS = [
|
|
|
20779
20799
|
"skills-lock.json"
|
|
20780
20800
|
];
|
|
20781
20801
|
function resolveProjectRoot2(startDir, homeDir = os3.homedir()) {
|
|
20782
|
-
const initialDir =
|
|
20802
|
+
const initialDir = path19.resolve(startDir);
|
|
20783
20803
|
const home = canonicalPath(homeDir);
|
|
20784
20804
|
let currentDir = initialDir;
|
|
20785
20805
|
while (true) {
|
|
20786
20806
|
if (currentDir !== initialDir && canonicalPath(currentDir) === home) {
|
|
20787
20807
|
return initialDir;
|
|
20788
20808
|
}
|
|
20789
|
-
if (PROJECT_ROOT_MARKERS.some((marker) =>
|
|
20809
|
+
if (PROJECT_ROOT_MARKERS.some((marker) => fs18.existsSync(path19.join(currentDir, marker)))) {
|
|
20790
20810
|
return currentDir;
|
|
20791
20811
|
}
|
|
20792
|
-
if (
|
|
20812
|
+
if (fs18.existsSync(path19.join(currentDir, ".git"))) {
|
|
20793
20813
|
return currentDir;
|
|
20794
20814
|
}
|
|
20795
|
-
const parentDir =
|
|
20815
|
+
const parentDir = path19.dirname(currentDir);
|
|
20796
20816
|
if (parentDir === currentDir) {
|
|
20797
20817
|
return initialDir;
|
|
20798
20818
|
}
|
|
@@ -20800,20 +20820,20 @@ function resolveProjectRoot2(startDir, homeDir = os3.homedir()) {
|
|
|
20800
20820
|
}
|
|
20801
20821
|
}
|
|
20802
20822
|
function readToml(filePath) {
|
|
20803
|
-
if (!
|
|
20823
|
+
if (!fs18.existsSync(filePath)) return {};
|
|
20804
20824
|
try {
|
|
20805
|
-
return parse(
|
|
20825
|
+
return parse(fs18.readFileSync(filePath, "utf8"));
|
|
20806
20826
|
} catch {
|
|
20807
20827
|
return {};
|
|
20808
20828
|
}
|
|
20809
20829
|
}
|
|
20810
20830
|
function writeToml(filePath, data) {
|
|
20811
|
-
|
|
20812
|
-
|
|
20831
|
+
fs18.mkdirSync(path19.dirname(filePath), { recursive: true });
|
|
20832
|
+
fs18.writeFileSync(filePath, stringify(data) + "\n");
|
|
20813
20833
|
}
|
|
20814
20834
|
function readYaml(filePath) {
|
|
20815
|
-
if (!
|
|
20816
|
-
const text2 =
|
|
20835
|
+
if (!fs18.existsSync(filePath)) return new import_yaml.Document({});
|
|
20836
|
+
const text2 = fs18.readFileSync(filePath, "utf8");
|
|
20817
20837
|
const doc = (0, import_yaml.parseDocument)(text2);
|
|
20818
20838
|
if (doc.errors.length > 0) {
|
|
20819
20839
|
const messages = doc.errors.map((e) => e.message).join("; ");
|
|
@@ -20822,20 +20842,20 @@ function readYaml(filePath) {
|
|
|
20822
20842
|
return doc;
|
|
20823
20843
|
}
|
|
20824
20844
|
function writeYaml(filePath, doc) {
|
|
20825
|
-
|
|
20826
|
-
|
|
20845
|
+
fs18.mkdirSync(path19.dirname(filePath), { recursive: true });
|
|
20846
|
+
fs18.writeFileSync(filePath, doc.toString({ lineWidth: 0 }));
|
|
20827
20847
|
}
|
|
20828
20848
|
function readJson(filePath) {
|
|
20829
|
-
if (!
|
|
20849
|
+
if (!fs18.existsSync(filePath)) return {};
|
|
20830
20850
|
try {
|
|
20831
|
-
return JSON.parse(
|
|
20851
|
+
return JSON.parse(fs18.readFileSync(filePath, "utf8"));
|
|
20832
20852
|
} catch {
|
|
20833
20853
|
return {};
|
|
20834
20854
|
}
|
|
20835
20855
|
}
|
|
20836
20856
|
function writeJson(filePath, data) {
|
|
20837
|
-
|
|
20838
|
-
|
|
20857
|
+
fs18.mkdirSync(path19.dirname(filePath), { recursive: true });
|
|
20858
|
+
fs18.writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n");
|
|
20839
20859
|
}
|
|
20840
20860
|
var JSONC_FORMATTING = { tabSize: 2, insertSpaces: true };
|
|
20841
20861
|
function setJsoncIn(text2, jsonPath, value) {
|
|
@@ -20843,8 +20863,8 @@ function setJsoncIn(text2, jsonPath, value) {
|
|
|
20843
20863
|
return applyEdits(text2, edits);
|
|
20844
20864
|
}
|
|
20845
20865
|
function readJsoncFileRaw(filePath) {
|
|
20846
|
-
if (!
|
|
20847
|
-
let text2 =
|
|
20866
|
+
if (!fs18.existsSync(filePath)) return { text: "{}", hadBom: false, wasEmpty: true };
|
|
20867
|
+
let text2 = fs18.readFileSync(filePath, "utf8");
|
|
20848
20868
|
const hadBom = text2.charCodeAt(0) === 65279;
|
|
20849
20869
|
if (hadBom) text2 = text2.slice(1);
|
|
20850
20870
|
const wasEmpty = text2.trim() === "";
|
|
@@ -20863,26 +20883,26 @@ function isEmptyPlainObject(value) {
|
|
|
20863
20883
|
return value !== null && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0;
|
|
20864
20884
|
}
|
|
20865
20885
|
function removePath(targetPath) {
|
|
20866
|
-
const entry =
|
|
20886
|
+
const entry = fs18.lstatSync(targetPath, { throwIfNoEntry: false });
|
|
20867
20887
|
if (!entry) return false;
|
|
20868
|
-
if (entry.isSymbolicLink())
|
|
20869
|
-
else
|
|
20888
|
+
if (entry.isSymbolicLink()) fs18.unlinkSync(targetPath);
|
|
20889
|
+
else fs18.rmSync(targetPath, { recursive: entry.isDirectory(), force: true });
|
|
20870
20890
|
return true;
|
|
20871
20891
|
}
|
|
20872
20892
|
function rmEmptyDir(dirPath) {
|
|
20873
20893
|
try {
|
|
20874
|
-
if (!
|
|
20875
|
-
if (!
|
|
20876
|
-
if (
|
|
20877
|
-
|
|
20894
|
+
if (!fs18.existsSync(dirPath)) return false;
|
|
20895
|
+
if (!fs18.statSync(dirPath).isDirectory()) return false;
|
|
20896
|
+
if (fs18.readdirSync(dirPath).length > 0) return false;
|
|
20897
|
+
fs18.rmdirSync(dirPath);
|
|
20878
20898
|
return true;
|
|
20879
20899
|
} catch {
|
|
20880
20900
|
return false;
|
|
20881
20901
|
}
|
|
20882
20902
|
}
|
|
20883
20903
|
function readJsonc(filePath) {
|
|
20884
|
-
if (!
|
|
20885
|
-
let raw =
|
|
20904
|
+
if (!fs18.existsSync(filePath)) return {};
|
|
20905
|
+
let raw = fs18.readFileSync(filePath, "utf8");
|
|
20886
20906
|
if (raw.charCodeAt(0) === 65279) raw = raw.slice(1);
|
|
20887
20907
|
if (raw.trim() === "") return {};
|
|
20888
20908
|
const parsed = parse3(raw, [], { allowTrailingComma: true });
|
|
@@ -20903,7 +20923,7 @@ function yamlSyntaxErrorLine(raw) {
|
|
|
20903
20923
|
function findConfigSyntaxErrorLine(filePath, jsonOptions) {
|
|
20904
20924
|
let raw;
|
|
20905
20925
|
try {
|
|
20906
|
-
raw =
|
|
20926
|
+
raw = fs18.readFileSync(filePath, "utf8");
|
|
20907
20927
|
} catch {
|
|
20908
20928
|
return null;
|
|
20909
20929
|
}
|
|
@@ -20929,18 +20949,18 @@ function editJsoncFile(filePath, jsonPath, value) {
|
|
|
20929
20949
|
}
|
|
20930
20950
|
const parsed = parse3(text2, [], { allowTrailingComma: true });
|
|
20931
20951
|
if (isEmptyPlainObject(parsed)) {
|
|
20932
|
-
|
|
20933
|
-
rmEmptyDir(
|
|
20952
|
+
fs18.rmSync(filePath, { force: true });
|
|
20953
|
+
rmEmptyDir(path19.dirname(filePath));
|
|
20934
20954
|
return;
|
|
20935
20955
|
}
|
|
20936
|
-
|
|
20956
|
+
fs18.mkdirSync(path19.dirname(filePath), { recursive: true });
|
|
20937
20957
|
const out = wasEmpty && !text2.endsWith("\n") ? text2 + "\n" : text2;
|
|
20938
|
-
|
|
20958
|
+
fs18.writeFileSync(filePath, (hadBom ? "\uFEFF" : "") + out);
|
|
20939
20959
|
}
|
|
20940
20960
|
var MAX_SYMLINK_HOPS = 40;
|
|
20941
20961
|
function realpathOrSelf(p) {
|
|
20942
20962
|
try {
|
|
20943
|
-
return
|
|
20963
|
+
return fs18.realpathSync(p);
|
|
20944
20964
|
} catch {
|
|
20945
20965
|
return p;
|
|
20946
20966
|
}
|
|
@@ -20950,13 +20970,13 @@ function resolveLinkedDestination(dest) {
|
|
|
20950
20970
|
for (let hop = 0; hop < MAX_SYMLINK_HOPS; hop++) {
|
|
20951
20971
|
let entry;
|
|
20952
20972
|
try {
|
|
20953
|
-
entry =
|
|
20973
|
+
entry = fs18.lstatSync(current);
|
|
20954
20974
|
} catch {
|
|
20955
|
-
return current === dest || dirExists(
|
|
20975
|
+
return current === dest || dirExists(path19.dirname(current)) ? current : dest;
|
|
20956
20976
|
}
|
|
20957
20977
|
if (!entry.isSymbolicLink()) return current;
|
|
20958
20978
|
try {
|
|
20959
|
-
current =
|
|
20979
|
+
current = path19.resolve(realpathOrSelf(path19.dirname(current)), fs18.readlinkSync(current));
|
|
20960
20980
|
} catch {
|
|
20961
20981
|
return dest;
|
|
20962
20982
|
}
|
|
@@ -20964,30 +20984,30 @@ function resolveLinkedDestination(dest) {
|
|
|
20964
20984
|
return dest;
|
|
20965
20985
|
}
|
|
20966
20986
|
function copyDir(src, dest) {
|
|
20967
|
-
if (!
|
|
20987
|
+
if (!fs18.existsSync(src) || !treeHasFiles(src)) return null;
|
|
20968
20988
|
const target = resolveLinkedDestination(dest);
|
|
20969
20989
|
copyTree(src, target);
|
|
20970
20990
|
return target;
|
|
20971
20991
|
}
|
|
20972
20992
|
function treeHasFiles(dir) {
|
|
20973
|
-
return
|
|
20993
|
+
return fs18.readdirSync(dir, { withFileTypes: true }).some((entry) => !entry.isDirectory() || treeHasFiles(path19.join(dir, entry.name)));
|
|
20974
20994
|
}
|
|
20975
20995
|
function copyTree(src, dest) {
|
|
20976
|
-
const entries =
|
|
20977
|
-
|
|
20996
|
+
const entries = fs18.readdirSync(src, { withFileTypes: true });
|
|
20997
|
+
fs18.mkdirSync(dest, { recursive: true });
|
|
20978
20998
|
for (const entry of entries) {
|
|
20979
|
-
const from =
|
|
20980
|
-
const to = resolveLinkedDestination(
|
|
20999
|
+
const from = path19.join(src, entry.name);
|
|
21000
|
+
const to = resolveLinkedDestination(path19.join(dest, entry.name));
|
|
20981
21001
|
if (entry.isDirectory()) copyTree(from, to);
|
|
20982
|
-
else
|
|
21002
|
+
else fs18.copyFileSync(from, to);
|
|
20983
21003
|
}
|
|
20984
21004
|
}
|
|
20985
21005
|
function readRetiredFile(targetDir, relativePath) {
|
|
20986
|
-
const entryPath =
|
|
21006
|
+
const entryPath = path19.join(resolveLinkedDestination(targetDir), ...relativePath.split("/"));
|
|
20987
21007
|
const file = resolveLinkedDestination(entryPath);
|
|
20988
21008
|
try {
|
|
20989
|
-
if (!
|
|
20990
|
-
return
|
|
21009
|
+
if (!fs18.statSync(file, { throwIfNoEntry: false })?.isFile()) return null;
|
|
21010
|
+
return fs18.readFileSync(file, "utf8");
|
|
20991
21011
|
} catch {
|
|
20992
21012
|
return null;
|
|
20993
21013
|
}
|
|
@@ -20995,7 +21015,7 @@ function readRetiredFile(targetDir, relativePath) {
|
|
|
20995
21015
|
function findRetiredFiles(retired, bundleDir, targetDir) {
|
|
20996
21016
|
const found = [];
|
|
20997
21017
|
for (const { path: relativePath, shipped } of retired) {
|
|
20998
|
-
if (bundleDir !== null &&
|
|
21018
|
+
if (bundleDir !== null && fs18.existsSync(path19.join(bundleDir, ...relativePath.split("/"))))
|
|
20999
21019
|
continue;
|
|
21000
21020
|
const content = readRetiredFile(targetDir, relativePath);
|
|
21001
21021
|
if (content === null) continue;
|
|
@@ -21011,17 +21031,17 @@ function removeRetiredFiles(targetDir, files) {
|
|
|
21011
21031
|
const content = readRetiredFile(targetDir, relativePath);
|
|
21012
21032
|
if (content === null || hashBundledContent(content) !== sha256) continue;
|
|
21013
21033
|
const segments = relativePath.split("/");
|
|
21014
|
-
const entryPath =
|
|
21034
|
+
const entryPath = path19.join(dir, ...segments);
|
|
21015
21035
|
const file = resolveLinkedDestination(entryPath);
|
|
21016
21036
|
try {
|
|
21017
|
-
|
|
21037
|
+
fs18.rmSync(file);
|
|
21018
21038
|
if (file !== entryPath) removePath(entryPath);
|
|
21019
21039
|
removedPaths.push(relativePath);
|
|
21020
21040
|
} catch {
|
|
21021
21041
|
continue;
|
|
21022
21042
|
}
|
|
21023
21043
|
for (let depth = segments.length - 1; depth > 0; depth--) {
|
|
21024
|
-
if (!rmEmptyDir(
|
|
21044
|
+
if (!rmEmptyDir(path19.join(dir, ...segments.slice(0, depth)))) break;
|
|
21025
21045
|
}
|
|
21026
21046
|
}
|
|
21027
21047
|
const removedRoot = removedPaths.length > 0 && dir === targetDir && rmEmptyDir(dir);
|
|
@@ -21029,15 +21049,15 @@ function removeRetiredFiles(targetDir, files) {
|
|
|
21029
21049
|
}
|
|
21030
21050
|
function dirExists(p) {
|
|
21031
21051
|
try {
|
|
21032
|
-
return
|
|
21052
|
+
return fs18.statSync(p).isDirectory();
|
|
21033
21053
|
} catch {
|
|
21034
21054
|
return false;
|
|
21035
21055
|
}
|
|
21036
21056
|
}
|
|
21037
21057
|
function getInstalledVersion() {
|
|
21038
21058
|
try {
|
|
21039
|
-
const pkgPath =
|
|
21040
|
-
const pkg = JSON.parse(
|
|
21059
|
+
const pkgPath = path19.join(PACKAGE_ROOT, "package.json");
|
|
21060
|
+
const pkg = JSON.parse(fs18.readFileSync(pkgPath, "utf8"));
|
|
21041
21061
|
return pkg.version ?? null;
|
|
21042
21062
|
} catch {
|
|
21043
21063
|
return null;
|
|
@@ -21082,12 +21102,12 @@ async function isOnline(timeoutMs = PROBE_TIMEOUT_MS) {
|
|
|
21082
21102
|
} catch {
|
|
21083
21103
|
return false;
|
|
21084
21104
|
}
|
|
21085
|
-
return new Promise((
|
|
21086
|
-
const timer = setTimeout(() =>
|
|
21105
|
+
return new Promise((resolve22) => {
|
|
21106
|
+
const timer = setTimeout(() => resolve22(false), timeoutMs);
|
|
21087
21107
|
timer.unref();
|
|
21088
21108
|
dns.lookup(host, (err) => {
|
|
21089
21109
|
clearTimeout(timer);
|
|
21090
|
-
|
|
21110
|
+
resolve22(!err);
|
|
21091
21111
|
});
|
|
21092
21112
|
});
|
|
21093
21113
|
}
|
|
@@ -21104,7 +21124,7 @@ function escapeStringRegexp(string) {
|
|
|
21104
21124
|
}
|
|
21105
21125
|
|
|
21106
21126
|
// ../argent-installer/src/mcp-configs.ts
|
|
21107
|
-
var TOOL_SERVER_BUNDLE =
|
|
21127
|
+
var TOOL_SERVER_BUNDLE = path20.join(import.meta.dirname, "tool-server.cjs");
|
|
21108
21128
|
function getAvailableToolIds() {
|
|
21109
21129
|
const out = execFileSync5("node", [TOOL_SERVER_BUNDLE, "-t"], { encoding: "utf8" });
|
|
21110
21130
|
const tools = JSON.parse(out);
|
|
@@ -21167,10 +21187,10 @@ function hasCustomizingEnv(entry) {
|
|
|
21167
21187
|
}
|
|
21168
21188
|
function removeDirIfEmpty(dirPath) {
|
|
21169
21189
|
try {
|
|
21170
|
-
if (!
|
|
21171
|
-
if (!
|
|
21172
|
-
if (
|
|
21173
|
-
|
|
21190
|
+
if (!fs19.existsSync(dirPath)) return;
|
|
21191
|
+
if (!fs19.statSync(dirPath).isDirectory()) return;
|
|
21192
|
+
if (fs19.readdirSync(dirPath).length > 0) return;
|
|
21193
|
+
fs19.rmdirSync(dirPath);
|
|
21174
21194
|
} catch {
|
|
21175
21195
|
}
|
|
21176
21196
|
}
|
|
@@ -21208,7 +21228,7 @@ function isArgentManagedEntry(entry) {
|
|
|
21208
21228
|
return args.length === 1 && args[0] === "mcp";
|
|
21209
21229
|
case "node": {
|
|
21210
21230
|
if (args.length !== 2 || args[1] !== "mcp" || !args[0]) return false;
|
|
21211
|
-
if (
|
|
21231
|
+
if (path20.isAbsolute(args[0])) return false;
|
|
21212
21232
|
const normalized = args[0].split("\\").join("/");
|
|
21213
21233
|
return normalized.includes(`node_modules/${PACKAGE_NAME}/`);
|
|
21214
21234
|
}
|
|
@@ -21222,12 +21242,12 @@ function isArgentManagedEntry(entry) {
|
|
|
21222
21242
|
}
|
|
21223
21243
|
function isPinnedGlobalEntry(entry) {
|
|
21224
21244
|
const [cli, subcommand] = entry.args;
|
|
21225
|
-
return
|
|
21245
|
+
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
21246
|
}
|
|
21227
21247
|
function writeTomlOrRemove(filePath, data) {
|
|
21228
21248
|
if (Object.keys(data).length === 0) {
|
|
21229
|
-
|
|
21230
|
-
removeDirIfEmpty(
|
|
21249
|
+
fs19.rmSync(filePath, { force: true });
|
|
21250
|
+
removeDirIfEmpty(path20.dirname(filePath));
|
|
21231
21251
|
return;
|
|
21232
21252
|
}
|
|
21233
21253
|
writeToml(filePath, data);
|
|
@@ -21236,12 +21256,12 @@ function dirHasEditorEvidence(dir, looksArgentOnly) {
|
|
|
21236
21256
|
return dirExists(dir) && !looksArgentOnly(dir);
|
|
21237
21257
|
}
|
|
21238
21258
|
function fileHasEditorEvidence(filePath, looksArgentOnly) {
|
|
21239
|
-
return
|
|
21259
|
+
return fs19.existsSync(filePath) && !looksArgentOnly(filePath);
|
|
21240
21260
|
}
|
|
21241
21261
|
function parseJsoncStrict(filePath) {
|
|
21242
21262
|
let raw;
|
|
21243
21263
|
try {
|
|
21244
|
-
raw =
|
|
21264
|
+
raw = fs19.readFileSync(filePath, "utf8");
|
|
21245
21265
|
} catch {
|
|
21246
21266
|
return null;
|
|
21247
21267
|
}
|
|
@@ -21254,14 +21274,14 @@ function parseJsoncStrict(filePath) {
|
|
|
21254
21274
|
}
|
|
21255
21275
|
function parseTomlStrict(filePath) {
|
|
21256
21276
|
try {
|
|
21257
|
-
return parse(
|
|
21277
|
+
return parse(fs19.readFileSync(filePath, "utf8"));
|
|
21258
21278
|
} catch {
|
|
21259
21279
|
return null;
|
|
21260
21280
|
}
|
|
21261
21281
|
}
|
|
21262
21282
|
function parseYamlStrict(filePath) {
|
|
21263
21283
|
try {
|
|
21264
|
-
const parsed = (0, import_yaml2.parse)(
|
|
21284
|
+
const parsed = (0, import_yaml2.parse)(fs19.readFileSync(filePath, "utf8"));
|
|
21265
21285
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
21266
21286
|
return parsed;
|
|
21267
21287
|
} catch {
|
|
@@ -21284,7 +21304,7 @@ function bundledManagedNames(kind) {
|
|
|
21284
21304
|
if (cached2) return cached2;
|
|
21285
21305
|
let names;
|
|
21286
21306
|
try {
|
|
21287
|
-
names = new Set(
|
|
21307
|
+
names = new Set(fs19.readdirSync(kind === "rules" ? RULES_DIR : AGENTS_DIR));
|
|
21288
21308
|
} catch {
|
|
21289
21309
|
names = /* @__PURE__ */ new Set();
|
|
21290
21310
|
}
|
|
@@ -21295,7 +21315,7 @@ function bundledManagedNames(kind) {
|
|
|
21295
21315
|
function managedDirLooksArgentOnly(dir, kind) {
|
|
21296
21316
|
let entries;
|
|
21297
21317
|
try {
|
|
21298
|
-
entries =
|
|
21318
|
+
entries = fs19.readdirSync(dir);
|
|
21299
21319
|
} catch {
|
|
21300
21320
|
return false;
|
|
21301
21321
|
}
|
|
@@ -21307,13 +21327,13 @@ function managedDirLooksArgentOnly(dir, kind) {
|
|
|
21307
21327
|
function cursorDirLooksArgentOnly(dir) {
|
|
21308
21328
|
let entries;
|
|
21309
21329
|
try {
|
|
21310
|
-
entries =
|
|
21330
|
+
entries = fs19.readdirSync(dir);
|
|
21311
21331
|
} catch {
|
|
21312
21332
|
return false;
|
|
21313
21333
|
}
|
|
21314
21334
|
if (entries.length === 0) return false;
|
|
21315
21335
|
return entries.every((entry) => {
|
|
21316
|
-
const full =
|
|
21336
|
+
const full = path20.join(dir, entry);
|
|
21317
21337
|
if (entry === "mcp.json") {
|
|
21318
21338
|
return jsonLooksArgentServerOnly(full, "mcpServers");
|
|
21319
21339
|
}
|
|
@@ -21346,13 +21366,13 @@ function claudeSettingsLooksArgentOnly(filePath) {
|
|
|
21346
21366
|
function claudeDirLooksArgentOnly(dir) {
|
|
21347
21367
|
let entries;
|
|
21348
21368
|
try {
|
|
21349
|
-
entries =
|
|
21369
|
+
entries = fs19.readdirSync(dir);
|
|
21350
21370
|
} catch {
|
|
21351
21371
|
return false;
|
|
21352
21372
|
}
|
|
21353
21373
|
if (entries.length === 0) return false;
|
|
21354
21374
|
return entries.every((entry) => {
|
|
21355
|
-
const full =
|
|
21375
|
+
const full = path20.join(dir, entry);
|
|
21356
21376
|
if (entry === "settings.json") return claudeSettingsLooksArgentOnly(full);
|
|
21357
21377
|
if (entry === "rules" || entry === "agents" || entry === "skills") {
|
|
21358
21378
|
return managedDirLooksArgentOnly(full, entry);
|
|
@@ -21363,25 +21383,25 @@ function claudeDirLooksArgentOnly(dir) {
|
|
|
21363
21383
|
function vscodeDirLooksArgentOnly(dir) {
|
|
21364
21384
|
let entries;
|
|
21365
21385
|
try {
|
|
21366
|
-
entries =
|
|
21386
|
+
entries = fs19.readdirSync(dir);
|
|
21367
21387
|
} catch {
|
|
21368
21388
|
return false;
|
|
21369
21389
|
}
|
|
21370
21390
|
if (entries.length === 0) return false;
|
|
21371
21391
|
return entries.every(
|
|
21372
|
-
(entry) => entry === "mcp.json" && jsonLooksArgentServerOnly(
|
|
21392
|
+
(entry) => entry === "mcp.json" && jsonLooksArgentServerOnly(path20.join(dir, entry), "servers")
|
|
21373
21393
|
);
|
|
21374
21394
|
}
|
|
21375
21395
|
function windsurfDirLooksArgentOnly(dir) {
|
|
21376
21396
|
let entries;
|
|
21377
21397
|
try {
|
|
21378
|
-
entries =
|
|
21398
|
+
entries = fs19.readdirSync(dir);
|
|
21379
21399
|
} catch {
|
|
21380
21400
|
return false;
|
|
21381
21401
|
}
|
|
21382
21402
|
if (entries.length === 0) return false;
|
|
21383
21403
|
return entries.every(
|
|
21384
|
-
(entry) => entry === "mcp_config.json" && jsonLooksArgentServerOnly(
|
|
21404
|
+
(entry) => entry === "mcp_config.json" && jsonLooksArgentServerOnly(path20.join(dir, entry), "mcpServers")
|
|
21385
21405
|
);
|
|
21386
21406
|
}
|
|
21387
21407
|
function zedSettingsLooksArgentOnly(filePath) {
|
|
@@ -21412,25 +21432,25 @@ function zedSettingsLooksArgentOnly(filePath) {
|
|
|
21412
21432
|
function zedDirLooksArgentOnly(dir) {
|
|
21413
21433
|
let entries;
|
|
21414
21434
|
try {
|
|
21415
|
-
entries =
|
|
21435
|
+
entries = fs19.readdirSync(dir);
|
|
21416
21436
|
} catch {
|
|
21417
21437
|
return false;
|
|
21418
21438
|
}
|
|
21419
21439
|
if (entries.length === 0) return false;
|
|
21420
21440
|
return entries.every(
|
|
21421
|
-
(entry) => entry === "settings.json" && zedSettingsLooksArgentOnly(
|
|
21441
|
+
(entry) => entry === "settings.json" && zedSettingsLooksArgentOnly(path20.join(dir, entry))
|
|
21422
21442
|
);
|
|
21423
21443
|
}
|
|
21424
21444
|
function geminiDirLooksArgentOnly(dir) {
|
|
21425
21445
|
let entries;
|
|
21426
21446
|
try {
|
|
21427
|
-
entries =
|
|
21447
|
+
entries = fs19.readdirSync(dir);
|
|
21428
21448
|
} catch {
|
|
21429
21449
|
return false;
|
|
21430
21450
|
}
|
|
21431
21451
|
if (entries.length === 0) return false;
|
|
21432
21452
|
return entries.every((entry) => {
|
|
21433
|
-
const full =
|
|
21453
|
+
const full = path20.join(dir, entry);
|
|
21434
21454
|
if (entry === "settings.json") return jsonLooksArgentServerOnly(full, "mcpServers");
|
|
21435
21455
|
if (entry === "rules" || entry === "agents") return managedDirLooksArgentOnly(full, entry);
|
|
21436
21456
|
return false;
|
|
@@ -21449,48 +21469,48 @@ function hermesConfigLooksArgentOnly(filePath) {
|
|
|
21449
21469
|
function hermesDirLooksArgentOnly(dir) {
|
|
21450
21470
|
let entries;
|
|
21451
21471
|
try {
|
|
21452
|
-
entries =
|
|
21472
|
+
entries = fs19.readdirSync(dir);
|
|
21453
21473
|
} catch {
|
|
21454
21474
|
return false;
|
|
21455
21475
|
}
|
|
21456
21476
|
if (entries.length === 0) return false;
|
|
21457
21477
|
return entries.every(
|
|
21458
|
-
(entry) => entry === "config.yaml" && hermesConfigLooksArgentOnly(
|
|
21478
|
+
(entry) => entry === "config.yaml" && hermesConfigLooksArgentOnly(path20.join(dir, entry))
|
|
21459
21479
|
);
|
|
21460
21480
|
}
|
|
21461
21481
|
function kiroDirLooksArgentOnly(dir) {
|
|
21462
21482
|
let entries;
|
|
21463
21483
|
try {
|
|
21464
|
-
entries =
|
|
21484
|
+
entries = fs19.readdirSync(dir);
|
|
21465
21485
|
} catch {
|
|
21466
21486
|
return false;
|
|
21467
21487
|
}
|
|
21468
21488
|
if (entries.length === 0) return false;
|
|
21469
21489
|
return entries.every((entry) => {
|
|
21470
21490
|
if (entry !== "settings") return false;
|
|
21471
|
-
const settingsDir =
|
|
21491
|
+
const settingsDir = path20.join(dir, entry);
|
|
21472
21492
|
let settingsEntries;
|
|
21473
21493
|
try {
|
|
21474
|
-
settingsEntries =
|
|
21494
|
+
settingsEntries = fs19.readdirSync(settingsDir);
|
|
21475
21495
|
} catch {
|
|
21476
21496
|
return false;
|
|
21477
21497
|
}
|
|
21478
21498
|
if (settingsEntries.length === 0) return false;
|
|
21479
21499
|
return settingsEntries.every(
|
|
21480
|
-
(name) => name === "mcp.json" && jsonLooksArgentServerOnly(
|
|
21500
|
+
(name) => name === "mcp.json" && jsonLooksArgentServerOnly(path20.join(settingsDir, name), "mcpServers")
|
|
21481
21501
|
);
|
|
21482
21502
|
});
|
|
21483
21503
|
}
|
|
21484
21504
|
function codexDirLooksArgentOnly(dir) {
|
|
21485
21505
|
let entries;
|
|
21486
21506
|
try {
|
|
21487
|
-
entries =
|
|
21507
|
+
entries = fs19.readdirSync(dir);
|
|
21488
21508
|
} catch {
|
|
21489
21509
|
return false;
|
|
21490
21510
|
}
|
|
21491
21511
|
if (entries.length === 0) return false;
|
|
21492
21512
|
return entries.every((entry) => {
|
|
21493
|
-
const full =
|
|
21513
|
+
const full = path20.join(dir, entry);
|
|
21494
21514
|
if (entry === "config.toml") {
|
|
21495
21515
|
const config = parseTomlStrict(full);
|
|
21496
21516
|
if (config === null) return false;
|
|
@@ -21515,7 +21535,7 @@ function codexDirLooksArgentOnly(dir) {
|
|
|
21515
21535
|
});
|
|
21516
21536
|
}
|
|
21517
21537
|
function cursorPermissionsPath() {
|
|
21518
|
-
return
|
|
21538
|
+
return path20.join(homedir4(), ".cursor", "permissions.json");
|
|
21519
21539
|
}
|
|
21520
21540
|
function cursorPermissionsList() {
|
|
21521
21541
|
const list = readJsonc(cursorPermissionsPath()).mcpAllowlist;
|
|
@@ -21524,13 +21544,13 @@ function cursorPermissionsList() {
|
|
|
21524
21544
|
var cursorAdapter = {
|
|
21525
21545
|
name: "Cursor",
|
|
21526
21546
|
detect() {
|
|
21527
|
-
return dirHasEditorEvidence(
|
|
21547
|
+
return dirHasEditorEvidence(path20.join(homedir4(), ".cursor"), cursorDirLooksArgentOnly) || dirHasEditorEvidence(path20.join(process.cwd(), ".cursor"), cursorDirLooksArgentOnly);
|
|
21528
21548
|
},
|
|
21529
21549
|
projectPath(root) {
|
|
21530
|
-
return
|
|
21550
|
+
return path20.join(root, ".cursor", "mcp.json");
|
|
21531
21551
|
},
|
|
21532
21552
|
globalPath() {
|
|
21533
|
-
return
|
|
21553
|
+
return path20.join(homedir4(), ".cursor", "mcp.json");
|
|
21534
21554
|
},
|
|
21535
21555
|
// Read and written as JSONC through readJsonc / editJsoncFile: path-targeted
|
|
21536
21556
|
// text edits that preserve user comments and foreign servers.
|
|
@@ -21542,7 +21562,7 @@ var cursorAdapter = {
|
|
|
21542
21562
|
});
|
|
21543
21563
|
},
|
|
21544
21564
|
remove(configPath) {
|
|
21545
|
-
if (!
|
|
21565
|
+
if (!fs19.existsSync(configPath)) return false;
|
|
21546
21566
|
const config = readJsonc(configPath);
|
|
21547
21567
|
const servers = config.mcpServers;
|
|
21548
21568
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -21550,7 +21570,7 @@ var cursorAdapter = {
|
|
|
21550
21570
|
return true;
|
|
21551
21571
|
},
|
|
21552
21572
|
getArgentEntry(configPath) {
|
|
21553
|
-
if (!
|
|
21573
|
+
if (!fs19.existsSync(configPath)) return null;
|
|
21554
21574
|
const config = readJsonc(configPath);
|
|
21555
21575
|
const servers = config.mcpServers;
|
|
21556
21576
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -21575,7 +21595,7 @@ var cursorAdapter = {
|
|
|
21575
21595
|
removeAllowlist(_root, scope) {
|
|
21576
21596
|
if (scope !== "global") return;
|
|
21577
21597
|
const permPath = cursorPermissionsPath();
|
|
21578
|
-
if (!
|
|
21598
|
+
if (!fs19.existsSync(permPath)) return;
|
|
21579
21599
|
const config = readJsonc(permPath);
|
|
21580
21600
|
const list = Array.isArray(config.mcpAllowlist) ? config.mcpAllowlist : void 0;
|
|
21581
21601
|
if (!list || !list.includes(CURSOR_ALLOWLIST_PATTERN)) return;
|
|
@@ -21588,7 +21608,7 @@ function claudeProjectKeysForRoot(projects, root) {
|
|
|
21588
21608
|
return Object.keys(projects).filter((key) => key === root || canonicalPath(key) === target);
|
|
21589
21609
|
}
|
|
21590
21610
|
function claudeDisabledListFinding(settingsPath, label, projectConfined) {
|
|
21591
|
-
if (!
|
|
21611
|
+
if (!fs19.existsSync(settingsPath)) return null;
|
|
21592
21612
|
const disabled = readJson(settingsPath).disabledMcpjsonServers;
|
|
21593
21613
|
if (!Array.isArray(disabled) || !disabled.includes(MCP_SERVER_KEY)) return null;
|
|
21594
21614
|
return {
|
|
@@ -21616,13 +21636,13 @@ var claudeAdapter = {
|
|
|
21616
21636
|
name: "Claude Code",
|
|
21617
21637
|
detect() {
|
|
21618
21638
|
const mcpJsonArgentOnly = (p) => jsonLooksArgentServerOnly(p, "mcpServers");
|
|
21619
|
-
return fileHasEditorEvidence(
|
|
21639
|
+
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
21640
|
},
|
|
21621
21641
|
projectPath(root) {
|
|
21622
|
-
return
|
|
21642
|
+
return path20.join(root, ".mcp.json");
|
|
21623
21643
|
},
|
|
21624
21644
|
globalPath() {
|
|
21625
|
-
return
|
|
21645
|
+
return path20.join(homedir4(), ".claude.json");
|
|
21626
21646
|
},
|
|
21627
21647
|
// JSONC is a superset of JSON, so this config shares the one comment- and
|
|
21628
21648
|
// foreign-server-preserving write path (see the Cursor adapter).
|
|
@@ -21635,7 +21655,7 @@ var claudeAdapter = {
|
|
|
21635
21655
|
});
|
|
21636
21656
|
},
|
|
21637
21657
|
remove(configPath) {
|
|
21638
|
-
if (!
|
|
21658
|
+
if (!fs19.existsSync(configPath)) return false;
|
|
21639
21659
|
const config = readJsonc(configPath);
|
|
21640
21660
|
const servers = config.mcpServers;
|
|
21641
21661
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -21649,7 +21669,7 @@ var claudeAdapter = {
|
|
|
21649
21669
|
return true;
|
|
21650
21670
|
},
|
|
21651
21671
|
getArgentEntry(configPath) {
|
|
21652
|
-
if (!
|
|
21672
|
+
if (!fs19.existsSync(configPath)) return null;
|
|
21653
21673
|
const config = readJsonc(configPath);
|
|
21654
21674
|
const servers = config.mcpServers;
|
|
21655
21675
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -21662,7 +21682,7 @@ var claudeAdapter = {
|
|
|
21662
21682
|
// .mcp.json rejections (see claudeDisabledListFinding).
|
|
21663
21683
|
findShadowingConfigs(root, writtenScope) {
|
|
21664
21684
|
const findings = [];
|
|
21665
|
-
const claudeJsonPath =
|
|
21685
|
+
const claudeJsonPath = path20.join(homedir4(), ".claude.json");
|
|
21666
21686
|
const projects = readJson(claudeJsonPath).projects;
|
|
21667
21687
|
if (isRecord(projects)) {
|
|
21668
21688
|
for (const key of claudeProjectKeysForRoot(projects, root)) {
|
|
@@ -21699,9 +21719,9 @@ var claudeAdapter = {
|
|
|
21699
21719
|
}
|
|
21700
21720
|
if (writtenScope === "local") {
|
|
21701
21721
|
const candidates = [
|
|
21702
|
-
[
|
|
21703
|
-
[
|
|
21704
|
-
[
|
|
21722
|
+
[path20.join(root, ".claude", "settings.json"), ".claude/settings.json", true],
|
|
21723
|
+
[path20.join(root, ".claude", "settings.local.json"), ".claude/settings.local.json", true],
|
|
21724
|
+
[path20.join(homedir4(), ".claude", "settings.json"), "~/.claude/settings.json", false]
|
|
21705
21725
|
];
|
|
21706
21726
|
for (const [settingsPath, label, projectConfined] of candidates) {
|
|
21707
21727
|
const finding = claudeDisabledListFinding(settingsPath, label, projectConfined);
|
|
@@ -21720,10 +21740,10 @@ var claudeAdapter = {
|
|
|
21720
21740
|
var vscodeAdapter = {
|
|
21721
21741
|
name: "VS Code",
|
|
21722
21742
|
detect() {
|
|
21723
|
-
return dirHasEditorEvidence(
|
|
21743
|
+
return dirHasEditorEvidence(path20.join(process.cwd(), ".vscode"), vscodeDirLooksArgentOnly) || dirExists(path20.join(homedir4(), ".vscode"));
|
|
21724
21744
|
},
|
|
21725
21745
|
projectPath(root) {
|
|
21726
|
-
return
|
|
21746
|
+
return path20.join(root, ".vscode", "mcp.json");
|
|
21727
21747
|
},
|
|
21728
21748
|
globalPath() {
|
|
21729
21749
|
return null;
|
|
@@ -21739,7 +21759,7 @@ var vscodeAdapter = {
|
|
|
21739
21759
|
});
|
|
21740
21760
|
},
|
|
21741
21761
|
remove(configPath) {
|
|
21742
|
-
if (!
|
|
21762
|
+
if (!fs19.existsSync(configPath)) return false;
|
|
21743
21763
|
const config = readJsonc(configPath);
|
|
21744
21764
|
const servers = config.servers;
|
|
21745
21765
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -21747,7 +21767,7 @@ var vscodeAdapter = {
|
|
|
21747
21767
|
return true;
|
|
21748
21768
|
},
|
|
21749
21769
|
getArgentEntry(configPath) {
|
|
21750
|
-
if (!
|
|
21770
|
+
if (!fs19.existsSync(configPath)) return null;
|
|
21751
21771
|
const config = readJsonc(configPath);
|
|
21752
21772
|
const servers = config.servers;
|
|
21753
21773
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -21760,7 +21780,7 @@ var vscodeAdapter = {
|
|
|
21760
21780
|
findShadowingConfigs(_root, _writtenScope) {
|
|
21761
21781
|
const findings = [];
|
|
21762
21782
|
for (const userDir of vscodeUserDirs()) {
|
|
21763
|
-
const configPath =
|
|
21783
|
+
const configPath = path20.join(userDir, "mcp.json");
|
|
21764
21784
|
const entry = this.getArgentEntry(configPath);
|
|
21765
21785
|
if (!entry) continue;
|
|
21766
21786
|
findings.push({
|
|
@@ -21777,16 +21797,16 @@ var vscodeAdapter = {
|
|
|
21777
21797
|
function vscodeUserDirs() {
|
|
21778
21798
|
const bases = [];
|
|
21779
21799
|
if (process.platform === "darwin") {
|
|
21780
|
-
bases.push(
|
|
21800
|
+
bases.push(path20.join(homedir4(), "Library", "Application Support"));
|
|
21781
21801
|
} else if (process.platform === "win32") {
|
|
21782
21802
|
if (process.env.APPDATA) bases.push(process.env.APPDATA);
|
|
21783
21803
|
} else {
|
|
21784
|
-
bases.push(
|
|
21804
|
+
bases.push(path20.join(homedir4(), ".config"));
|
|
21785
21805
|
}
|
|
21786
21806
|
const dirs = [];
|
|
21787
21807
|
for (const base of bases) {
|
|
21788
21808
|
for (const product of ["Code", "Code - Insiders"]) {
|
|
21789
|
-
const dir =
|
|
21809
|
+
const dir = path20.join(base, product, "User");
|
|
21790
21810
|
if (dirExists(dir)) dirs.push(dir);
|
|
21791
21811
|
}
|
|
21792
21812
|
}
|
|
@@ -21794,18 +21814,18 @@ function vscodeUserDirs() {
|
|
|
21794
21814
|
}
|
|
21795
21815
|
function devinUserConfigPath() {
|
|
21796
21816
|
if (process.platform === "win32") {
|
|
21797
|
-
const appData = process.env.APPDATA ||
|
|
21798
|
-
return
|
|
21817
|
+
const appData = process.env.APPDATA || path20.join(homedir4(), "AppData", "Roaming");
|
|
21818
|
+
return path20.join(appData, "devin", "config.json");
|
|
21799
21819
|
}
|
|
21800
21820
|
const xdg = process.env.XDG_CONFIG_HOME;
|
|
21801
|
-
return
|
|
21821
|
+
return path20.join(xdg || path20.join(homedir4(), ".config"), "devin", "config.json");
|
|
21802
21822
|
}
|
|
21803
21823
|
var windsurfAdapter = {
|
|
21804
21824
|
name: "Devin Desktop",
|
|
21805
21825
|
telemetryName: "windsurf",
|
|
21806
21826
|
detect() {
|
|
21807
21827
|
return dirHasEditorEvidence(
|
|
21808
|
-
|
|
21828
|
+
path20.join(homedir4(), ".codeium", "windsurf"),
|
|
21809
21829
|
windsurfDirLooksArgentOnly
|
|
21810
21830
|
);
|
|
21811
21831
|
},
|
|
@@ -21813,7 +21833,7 @@ var windsurfAdapter = {
|
|
|
21813
21833
|
return null;
|
|
21814
21834
|
},
|
|
21815
21835
|
globalPath() {
|
|
21816
|
-
return
|
|
21836
|
+
return path20.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
|
|
21817
21837
|
},
|
|
21818
21838
|
// JSONC-safe writes (see the Cursor adapter).
|
|
21819
21839
|
write(configPath, entry) {
|
|
@@ -21825,7 +21845,7 @@ var windsurfAdapter = {
|
|
|
21825
21845
|
});
|
|
21826
21846
|
},
|
|
21827
21847
|
remove(configPath) {
|
|
21828
|
-
if (!
|
|
21848
|
+
if (!fs19.existsSync(configPath)) return false;
|
|
21829
21849
|
const config = readJsonc(configPath);
|
|
21830
21850
|
const servers = config.mcpServers;
|
|
21831
21851
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -21833,7 +21853,7 @@ var windsurfAdapter = {
|
|
|
21833
21853
|
return true;
|
|
21834
21854
|
},
|
|
21835
21855
|
getArgentEntry(configPath) {
|
|
21836
|
-
if (!
|
|
21856
|
+
if (!fs19.existsSync(configPath)) return null;
|
|
21837
21857
|
const config = readJsonc(configPath);
|
|
21838
21858
|
const servers = config.mcpServers;
|
|
21839
21859
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -21845,7 +21865,7 @@ var windsurfAdapter = {
|
|
|
21845
21865
|
// servers survive. alwaysAllow serves the legacy Cascade agent; the Devin
|
|
21846
21866
|
// agent needs its own permission rule.
|
|
21847
21867
|
addAllowlist() {
|
|
21848
|
-
const configPath =
|
|
21868
|
+
const configPath = path20.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
|
|
21849
21869
|
const config = readJsonc(configPath);
|
|
21850
21870
|
const servers = config.mcpServers;
|
|
21851
21871
|
if (!servers?.[MCP_SERVER_KEY]) return;
|
|
@@ -21855,8 +21875,8 @@ var windsurfAdapter = {
|
|
|
21855
21875
|
removeAllowlist(_root, scope) {
|
|
21856
21876
|
if (scope !== "global") return;
|
|
21857
21877
|
removeAllowRule(devinUserConfigPath(), DEVIN_PERMISSION_RULE);
|
|
21858
|
-
const configPath =
|
|
21859
|
-
if (!
|
|
21878
|
+
const configPath = path20.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
|
|
21879
|
+
if (!fs19.existsSync(configPath)) return;
|
|
21860
21880
|
const config = readJsonc(configPath);
|
|
21861
21881
|
const servers = config.mcpServers;
|
|
21862
21882
|
const entry = servers?.[MCP_SERVER_KEY];
|
|
@@ -21867,13 +21887,13 @@ var windsurfAdapter = {
|
|
|
21867
21887
|
var zedAdapter = {
|
|
21868
21888
|
name: "Zed",
|
|
21869
21889
|
detect() {
|
|
21870
|
-
return dirHasEditorEvidence(
|
|
21890
|
+
return dirHasEditorEvidence(path20.join(homedir4(), ".config", "zed"), zedDirLooksArgentOnly);
|
|
21871
21891
|
},
|
|
21872
21892
|
projectPath(root) {
|
|
21873
|
-
return
|
|
21893
|
+
return path20.join(root, ".zed", "settings.json");
|
|
21874
21894
|
},
|
|
21875
21895
|
globalPath() {
|
|
21876
|
-
return
|
|
21896
|
+
return path20.join(homedir4(), ".config", "zed", "settings.json");
|
|
21877
21897
|
},
|
|
21878
21898
|
// Read and written as JSONC through readJsonc / editJsoncFile so comments and
|
|
21879
21899
|
// formatting outside the touched key survive (see the Cursor adapter).
|
|
@@ -21886,7 +21906,7 @@ var zedAdapter = {
|
|
|
21886
21906
|
});
|
|
21887
21907
|
},
|
|
21888
21908
|
remove(configPath) {
|
|
21889
|
-
if (!
|
|
21909
|
+
if (!fs19.existsSync(configPath)) return false;
|
|
21890
21910
|
const config = readJsonc(configPath);
|
|
21891
21911
|
const servers = config.context_servers;
|
|
21892
21912
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -21894,7 +21914,7 @@ var zedAdapter = {
|
|
|
21894
21914
|
return true;
|
|
21895
21915
|
},
|
|
21896
21916
|
getArgentEntry(configPath) {
|
|
21897
|
-
if (!
|
|
21917
|
+
if (!fs19.existsSync(configPath)) return null;
|
|
21898
21918
|
const config = readJsonc(configPath);
|
|
21899
21919
|
const servers = config.context_servers;
|
|
21900
21920
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -21905,12 +21925,12 @@ var zedAdapter = {
|
|
|
21905
21925
|
// Zed has no server-level wildcard for MCP tools — each tool would need its
|
|
21906
21926
|
// own entry — so the global default is set to "allow" instead.
|
|
21907
21927
|
addAllowlist(root, scope) {
|
|
21908
|
-
const settingsPath = scope === "global" ?
|
|
21928
|
+
const settingsPath = scope === "global" ? path20.join(homedir4(), ".config", "zed", "settings.json") : path20.join(root, ".zed", "settings.json");
|
|
21909
21929
|
editJsoncFile(settingsPath, ["agent", "tool_permissions", "default"], "allow");
|
|
21910
21930
|
},
|
|
21911
21931
|
removeAllowlist(root, scope) {
|
|
21912
|
-
const settingsPath = scope === "global" ?
|
|
21913
|
-
if (!
|
|
21932
|
+
const settingsPath = scope === "global" ? path20.join(homedir4(), ".config", "zed", "settings.json") : path20.join(root, ".zed", "settings.json");
|
|
21933
|
+
if (!fs19.existsSync(settingsPath)) return;
|
|
21914
21934
|
const config = readJsonc(settingsPath);
|
|
21915
21935
|
const perms = config.agent?.tool_permissions;
|
|
21916
21936
|
if (!perms || perms.default !== "allow") return;
|
|
@@ -21920,13 +21940,13 @@ var zedAdapter = {
|
|
|
21920
21940
|
var geminiAdapter = {
|
|
21921
21941
|
name: "Gemini",
|
|
21922
21942
|
detect() {
|
|
21923
|
-
return dirHasEditorEvidence(
|
|
21943
|
+
return dirHasEditorEvidence(path20.join(homedir4(), ".gemini"), geminiDirLooksArgentOnly) || dirHasEditorEvidence(path20.join(process.cwd(), ".gemini"), geminiDirLooksArgentOnly);
|
|
21924
21944
|
},
|
|
21925
21945
|
projectPath(root) {
|
|
21926
|
-
return
|
|
21946
|
+
return path20.join(root, ".gemini", "settings.json");
|
|
21927
21947
|
},
|
|
21928
21948
|
globalPath() {
|
|
21929
|
-
return
|
|
21949
|
+
return path20.join(homedir4(), ".gemini", "settings.json");
|
|
21930
21950
|
},
|
|
21931
21951
|
// JSONC-safe writes (see the Cursor adapter).
|
|
21932
21952
|
write(configPath, entry) {
|
|
@@ -21938,7 +21958,7 @@ var geminiAdapter = {
|
|
|
21938
21958
|
});
|
|
21939
21959
|
},
|
|
21940
21960
|
remove(configPath) {
|
|
21941
|
-
if (!
|
|
21961
|
+
if (!fs19.existsSync(configPath)) return false;
|
|
21942
21962
|
const config = readJsonc(configPath);
|
|
21943
21963
|
const servers = config.mcpServers;
|
|
21944
21964
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -21946,7 +21966,7 @@ var geminiAdapter = {
|
|
|
21946
21966
|
return true;
|
|
21947
21967
|
},
|
|
21948
21968
|
getArgentEntry(configPath) {
|
|
21949
|
-
if (!
|
|
21969
|
+
if (!fs19.existsSync(configPath)) return null;
|
|
21950
21970
|
const config = readJsonc(configPath);
|
|
21951
21971
|
const servers = config.mcpServers;
|
|
21952
21972
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -21968,7 +21988,7 @@ var geminiAdapter = {
|
|
|
21968
21988
|
},
|
|
21969
21989
|
removeAllowlist(root, scope) {
|
|
21970
21990
|
const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
|
|
21971
|
-
if (!configPath || !
|
|
21991
|
+
if (!configPath || !fs19.existsSync(configPath)) {
|
|
21972
21992
|
return;
|
|
21973
21993
|
}
|
|
21974
21994
|
const config = readJsonc(configPath);
|
|
@@ -21982,13 +22002,13 @@ var CODEX_FILENAME = ".codex";
|
|
|
21982
22002
|
var codexAdapter = {
|
|
21983
22003
|
name: "Codex",
|
|
21984
22004
|
detect() {
|
|
21985
|
-
return dirHasEditorEvidence(
|
|
22005
|
+
return dirHasEditorEvidence(path20.join(homedir4(), CODEX_FILENAME), codexDirLooksArgentOnly) || dirHasEditorEvidence(path20.join(process.cwd(), CODEX_FILENAME), codexDirLooksArgentOnly);
|
|
21986
22006
|
},
|
|
21987
22007
|
projectPath(root) {
|
|
21988
|
-
return
|
|
22008
|
+
return path20.join(root, CODEX_FILENAME, "config.toml");
|
|
21989
22009
|
},
|
|
21990
22010
|
globalPath() {
|
|
21991
|
-
return
|
|
22011
|
+
return path20.join(homedir4(), CODEX_FILENAME, "config.toml");
|
|
21992
22012
|
},
|
|
21993
22013
|
write(configPath, entry) {
|
|
21994
22014
|
const config = readToml(configPath);
|
|
@@ -22004,7 +22024,7 @@ var codexAdapter = {
|
|
|
22004
22024
|
writeToml(configPath, config);
|
|
22005
22025
|
},
|
|
22006
22026
|
remove(configPath) {
|
|
22007
|
-
if (!
|
|
22027
|
+
if (!fs19.existsSync(configPath)) return false;
|
|
22008
22028
|
const config = readToml(configPath);
|
|
22009
22029
|
const servers = config.mcp_servers;
|
|
22010
22030
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -22014,7 +22034,7 @@ var codexAdapter = {
|
|
|
22014
22034
|
return true;
|
|
22015
22035
|
},
|
|
22016
22036
|
getArgentEntry(configPath) {
|
|
22017
|
-
if (!
|
|
22037
|
+
if (!fs19.existsSync(configPath)) return null;
|
|
22018
22038
|
const config = readToml(configPath);
|
|
22019
22039
|
const servers = config.mcp_servers;
|
|
22020
22040
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -22046,7 +22066,7 @@ var codexAdapter = {
|
|
|
22046
22066
|
// them, and an emptied or removed table stays as it is.
|
|
22047
22067
|
refreshAllowlist(root, scope) {
|
|
22048
22068
|
const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
|
|
22049
|
-
if (!configPath || !
|
|
22069
|
+
if (!configPath || !fs19.existsSync(configPath)) return;
|
|
22050
22070
|
const config = readToml(configPath);
|
|
22051
22071
|
const toolsConfig = config.mcp_servers?.argent?.tools;
|
|
22052
22072
|
if (!toolsConfig) return;
|
|
@@ -22083,13 +22103,13 @@ var codexAdapter = {
|
|
|
22083
22103
|
var hermesAdapter = {
|
|
22084
22104
|
name: "Hermes",
|
|
22085
22105
|
detect() {
|
|
22086
|
-
return dirHasEditorEvidence(
|
|
22106
|
+
return dirHasEditorEvidence(path20.join(homedir4(), ".hermes"), hermesDirLooksArgentOnly);
|
|
22087
22107
|
},
|
|
22088
22108
|
projectPath() {
|
|
22089
22109
|
return null;
|
|
22090
22110
|
},
|
|
22091
22111
|
globalPath() {
|
|
22092
|
-
return
|
|
22112
|
+
return path20.join(homedir4(), ".hermes", "config.yaml");
|
|
22093
22113
|
},
|
|
22094
22114
|
write(configPath, entry) {
|
|
22095
22115
|
const doc = readYaml(configPath);
|
|
@@ -22108,7 +22128,7 @@ var hermesAdapter = {
|
|
|
22108
22128
|
writeYaml(configPath, doc);
|
|
22109
22129
|
},
|
|
22110
22130
|
remove(configPath) {
|
|
22111
|
-
if (!
|
|
22131
|
+
if (!fs19.existsSync(configPath)) return false;
|
|
22112
22132
|
const doc = readYaml(configPath);
|
|
22113
22133
|
const servers = doc.get("mcp_servers");
|
|
22114
22134
|
if (!(0, import_yaml2.isMap)(servers)) return false;
|
|
@@ -22121,7 +22141,7 @@ var hermesAdapter = {
|
|
|
22121
22141
|
return true;
|
|
22122
22142
|
},
|
|
22123
22143
|
getArgentEntry(configPath) {
|
|
22124
|
-
if (!
|
|
22144
|
+
if (!fs19.existsSync(configPath)) return null;
|
|
22125
22145
|
const doc = readYaml(configPath);
|
|
22126
22146
|
const servers = doc.get("mcp_servers");
|
|
22127
22147
|
if (!(0, import_yaml2.isMap)(servers)) return null;
|
|
@@ -22148,10 +22168,10 @@ function hasOpenCodeBinary() {
|
|
|
22148
22168
|
}
|
|
22149
22169
|
function pickOpencodeConfig(dir, candidates) {
|
|
22150
22170
|
for (const name of candidates) {
|
|
22151
|
-
const candidate =
|
|
22152
|
-
if (
|
|
22171
|
+
const candidate = path20.join(dir, name);
|
|
22172
|
+
if (fs19.existsSync(candidate)) return candidate;
|
|
22153
22173
|
}
|
|
22154
|
-
return
|
|
22174
|
+
return path20.join(dir, "opencode.json");
|
|
22155
22175
|
}
|
|
22156
22176
|
var openCodeAdapter = {
|
|
22157
22177
|
name: "opencode",
|
|
@@ -22162,7 +22182,7 @@ var openCodeAdapter = {
|
|
|
22162
22182
|
return pickOpencodeConfig(root, OPENCODE_PROJECT_FILES);
|
|
22163
22183
|
},
|
|
22164
22184
|
globalPath() {
|
|
22165
|
-
return pickOpencodeConfig(
|
|
22185
|
+
return pickOpencodeConfig(path20.join(homedir4(), ".config", "opencode"), OPENCODE_GLOBAL_FILES);
|
|
22166
22186
|
},
|
|
22167
22187
|
write(configPath, entry) {
|
|
22168
22188
|
editJsoncFile(configPath, ["mcp", MCP_SERVER_KEY], {
|
|
@@ -22173,7 +22193,7 @@ var openCodeAdapter = {
|
|
|
22173
22193
|
});
|
|
22174
22194
|
},
|
|
22175
22195
|
remove(configPath) {
|
|
22176
|
-
if (!
|
|
22196
|
+
if (!fs19.existsSync(configPath)) return false;
|
|
22177
22197
|
const config = readJsonc(configPath);
|
|
22178
22198
|
const servers = config.mcp;
|
|
22179
22199
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -22181,7 +22201,7 @@ var openCodeAdapter = {
|
|
|
22181
22201
|
return true;
|
|
22182
22202
|
},
|
|
22183
22203
|
getArgentEntry(configPath) {
|
|
22184
|
-
if (!
|
|
22204
|
+
if (!fs19.existsSync(configPath)) return null;
|
|
22185
22205
|
const config = readJsonc(configPath);
|
|
22186
22206
|
const servers = config.mcp;
|
|
22187
22207
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -22196,7 +22216,7 @@ var openCodeAdapter = {
|
|
|
22196
22216
|
},
|
|
22197
22217
|
removeAllowlist(root, scope) {
|
|
22198
22218
|
const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
|
|
22199
|
-
if (!configPath || !
|
|
22219
|
+
if (!configPath || !fs19.existsSync(configPath)) return;
|
|
22200
22220
|
const config = readJsonc(configPath);
|
|
22201
22221
|
const tools = config.tools;
|
|
22202
22222
|
if (!tools || !(OPENCODE_ALLOWLIST_PATTERN in tools)) return;
|
|
@@ -22207,13 +22227,13 @@ var KIRO_AUTO_APPROVE_ALL = ["*"];
|
|
|
22207
22227
|
var kiroAdapter = {
|
|
22208
22228
|
name: "Kiro",
|
|
22209
22229
|
detect() {
|
|
22210
|
-
return dirHasEditorEvidence(
|
|
22230
|
+
return dirHasEditorEvidence(path20.join(homedir4(), ".kiro"), kiroDirLooksArgentOnly) || dirHasEditorEvidence(path20.join(process.cwd(), ".kiro"), kiroDirLooksArgentOnly);
|
|
22211
22231
|
},
|
|
22212
22232
|
projectPath(root) {
|
|
22213
|
-
return
|
|
22233
|
+
return path20.join(root, ".kiro", "settings", "mcp.json");
|
|
22214
22234
|
},
|
|
22215
22235
|
globalPath() {
|
|
22216
|
-
return
|
|
22236
|
+
return path20.join(homedir4(), ".kiro", "settings", "mcp.json");
|
|
22217
22237
|
},
|
|
22218
22238
|
// Read and written as JSONC through readJsonc / editJsoncFile so comments and
|
|
22219
22239
|
// foreign servers survive (see the Cursor adapter).
|
|
@@ -22226,7 +22246,7 @@ var kiroAdapter = {
|
|
|
22226
22246
|
});
|
|
22227
22247
|
},
|
|
22228
22248
|
remove(configPath) {
|
|
22229
|
-
if (!
|
|
22249
|
+
if (!fs19.existsSync(configPath)) return false;
|
|
22230
22250
|
const config = readJsonc(configPath);
|
|
22231
22251
|
const servers = config.mcpServers;
|
|
22232
22252
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -22234,7 +22254,7 @@ var kiroAdapter = {
|
|
|
22234
22254
|
return true;
|
|
22235
22255
|
},
|
|
22236
22256
|
getArgentEntry(configPath) {
|
|
22237
|
-
if (!
|
|
22257
|
+
if (!fs19.existsSync(configPath)) return null;
|
|
22238
22258
|
const config = readJsonc(configPath);
|
|
22239
22259
|
const servers = config.mcpServers;
|
|
22240
22260
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -22258,7 +22278,7 @@ var kiroAdapter = {
|
|
|
22258
22278
|
},
|
|
22259
22279
|
removeAllowlist(root, scope) {
|
|
22260
22280
|
const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
|
|
22261
|
-
if (!configPath || !
|
|
22281
|
+
if (!configPath || !fs19.existsSync(configPath)) return;
|
|
22262
22282
|
const config = readJsonc(configPath);
|
|
22263
22283
|
const servers = config.mcpServers;
|
|
22264
22284
|
const entry = servers?.[MCP_SERVER_KEY];
|
|
@@ -22310,7 +22330,7 @@ function addAllowRule(settingsPath, rule) {
|
|
|
22310
22330
|
editJsoncFile(settingsPath, ["permissions", "allow"], [...allow, rule]);
|
|
22311
22331
|
}
|
|
22312
22332
|
function removeAllowRule(settingsPath, rule) {
|
|
22313
|
-
if (!
|
|
22333
|
+
if (!fs19.existsSync(settingsPath)) return;
|
|
22314
22334
|
const config = readJsonc(settingsPath);
|
|
22315
22335
|
const permissions = config?.permissions;
|
|
22316
22336
|
const allow = permissions?.allow;
|
|
@@ -22320,7 +22340,7 @@ function removeAllowRule(settingsPath, rule) {
|
|
|
22320
22340
|
editJsoncFile(settingsPath, ["permissions", "allow"], next.length > 0 ? next : void 0);
|
|
22321
22341
|
}
|
|
22322
22342
|
function claudeSettingsPath(root, scope) {
|
|
22323
|
-
return scope === "global" ?
|
|
22343
|
+
return scope === "global" ? path20.join(homedir4(), ".claude", "settings.json") : path20.join(root, ".claude", "settings.json");
|
|
22324
22344
|
}
|
|
22325
22345
|
function addClaudePermission(root, scope) {
|
|
22326
22346
|
addAllowRule(claudeSettingsPath(root, scope), PERMISSION_RULE);
|
|
@@ -22333,13 +22353,13 @@ function formatCopyDestination(target, writtenPath, root) {
|
|
|
22333
22353
|
return `${target.label} -> ${formatManagedPathLabel(writtenPath, realpathOrSelf(root))}`;
|
|
22334
22354
|
}
|
|
22335
22355
|
function formatManagedPathLabel(targetPath, root) {
|
|
22336
|
-
for (const home of [
|
|
22337
|
-
if (targetPath === home || targetPath.startsWith(`${home}${
|
|
22356
|
+
for (const home of [path20.resolve(homedir4()), canonicalPath(homedir4())]) {
|
|
22357
|
+
if (targetPath === home || targetPath.startsWith(`${home}${path20.sep}`)) {
|
|
22338
22358
|
return `~${targetPath.slice(home.length)}`;
|
|
22339
22359
|
}
|
|
22340
22360
|
}
|
|
22341
|
-
const relative5 =
|
|
22342
|
-
if (relative5 && !relative5.startsWith("..") && !
|
|
22361
|
+
const relative5 = path20.relative(root, targetPath);
|
|
22362
|
+
if (relative5 && !relative5.startsWith("..") && !path20.isAbsolute(relative5)) {
|
|
22343
22363
|
return relative5;
|
|
22344
22364
|
}
|
|
22345
22365
|
return targetPath;
|
|
@@ -22353,7 +22373,7 @@ function addManagedTarget(targets, editorName, targetPath, root) {
|
|
|
22353
22373
|
}
|
|
22354
22374
|
function getAdapterBasePath(adapter, root, scope) {
|
|
22355
22375
|
const configPath = scope === "global" ? adapter.globalPath() : adapter.projectPath(root);
|
|
22356
|
-
return configPath ?
|
|
22376
|
+
return configPath ? path20.dirname(configPath) : null;
|
|
22357
22377
|
}
|
|
22358
22378
|
function getManagedContentTargets(adapters, root, scope) {
|
|
22359
22379
|
const targets = {
|
|
@@ -22363,17 +22383,17 @@ function getManagedContentTargets(adapters, root, scope) {
|
|
|
22363
22383
|
codexConfigTargets: [],
|
|
22364
22384
|
skillsLockTargets: []
|
|
22365
22385
|
};
|
|
22366
|
-
const workspaceBase = scope === "global" ?
|
|
22386
|
+
const workspaceBase = scope === "global" ? homedir4() : root;
|
|
22367
22387
|
addManagedTarget(
|
|
22368
22388
|
targets.skillTargets,
|
|
22369
22389
|
"skills",
|
|
22370
|
-
|
|
22390
|
+
path20.join(workspaceBase, ".agents", "skills"),
|
|
22371
22391
|
root
|
|
22372
22392
|
);
|
|
22373
22393
|
addManagedTarget(
|
|
22374
22394
|
targets.skillsLockTargets,
|
|
22375
22395
|
"skills",
|
|
22376
|
-
|
|
22396
|
+
path20.join(workspaceBase, "skills-lock.json"),
|
|
22377
22397
|
root
|
|
22378
22398
|
);
|
|
22379
22399
|
for (const adapter of adapters) {
|
|
@@ -22381,21 +22401,21 @@ function getManagedContentTargets(adapters, root, scope) {
|
|
|
22381
22401
|
case "Cursor": {
|
|
22382
22402
|
const base = getAdapterBasePath(adapter, root, scope);
|
|
22383
22403
|
if (!base) break;
|
|
22384
|
-
addManagedTarget(targets.skillTargets, adapter.name,
|
|
22385
|
-
addManagedTarget(targets.ruleTargets, adapter.name,
|
|
22404
|
+
addManagedTarget(targets.skillTargets, adapter.name, path20.join(base, "skills"), root);
|
|
22405
|
+
addManagedTarget(targets.ruleTargets, adapter.name, path20.join(base, "rules"), root);
|
|
22386
22406
|
break;
|
|
22387
22407
|
}
|
|
22388
22408
|
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,
|
|
22409
|
+
const claudeBase = scope === "global" ? path20.join(homedir4(), ".claude") : path20.join(root, ".claude");
|
|
22410
|
+
addManagedTarget(targets.skillTargets, adapter.name, path20.join(claudeBase, "skills"), root);
|
|
22411
|
+
addManagedTarget(targets.ruleTargets, adapter.name, path20.join(claudeBase, "rules"), root);
|
|
22412
|
+
addManagedTarget(targets.agentTargets, adapter.name, path20.join(claudeBase, "agents"), root);
|
|
22393
22413
|
break;
|
|
22394
22414
|
}
|
|
22395
22415
|
case "Gemini": {
|
|
22396
|
-
const geminiBase = scope === "global" ?
|
|
22397
|
-
addManagedTarget(targets.ruleTargets, adapter.name,
|
|
22398
|
-
addManagedTarget(targets.agentTargets, adapter.name,
|
|
22416
|
+
const geminiBase = scope === "global" ? path20.join(homedir4(), ".gemini") : path20.join(root, ".gemini");
|
|
22417
|
+
addManagedTarget(targets.ruleTargets, adapter.name, path20.join(geminiBase, "rules"), root);
|
|
22418
|
+
addManagedTarget(targets.agentTargets, adapter.name, path20.join(geminiBase, "agents"), root);
|
|
22399
22419
|
break;
|
|
22400
22420
|
}
|
|
22401
22421
|
case "Codex": {
|
|
@@ -22405,19 +22425,19 @@ function getManagedContentTargets(adapters, root, scope) {
|
|
|
22405
22425
|
break;
|
|
22406
22426
|
}
|
|
22407
22427
|
case "opencode": {
|
|
22408
|
-
const base = scope === "global" ?
|
|
22409
|
-
addManagedTarget(targets.skillTargets, adapter.name,
|
|
22410
|
-
addManagedTarget(targets.agentTargets, adapter.name,
|
|
22428
|
+
const base = scope === "global" ? path20.join(homedir4(), ".config", "opencode") : path20.join(root, ".opencode");
|
|
22429
|
+
addManagedTarget(targets.skillTargets, adapter.name, path20.join(base, "skills"), root);
|
|
22430
|
+
addManagedTarget(targets.agentTargets, adapter.name, path20.join(base, "agents"), root);
|
|
22411
22431
|
break;
|
|
22412
22432
|
}
|
|
22413
22433
|
case "Kiro": {
|
|
22414
|
-
const kiroBase = scope === "global" ?
|
|
22415
|
-
addManagedTarget(targets.skillTargets, adapter.name,
|
|
22434
|
+
const kiroBase = scope === "global" ? path20.join(homedir4(), ".kiro") : path20.join(root, ".kiro");
|
|
22435
|
+
addManagedTarget(targets.skillTargets, adapter.name, path20.join(kiroBase, "skills"), root);
|
|
22416
22436
|
break;
|
|
22417
22437
|
}
|
|
22418
22438
|
case "Devin Desktop": {
|
|
22419
|
-
const devinBase = scope === "global" ?
|
|
22420
|
-
addManagedTarget(targets.skillTargets, adapter.name,
|
|
22439
|
+
const devinBase = scope === "global" ? path20.join(process.env.XDG_CONFIG_HOME || path20.join(homedir4(), ".config"), "devin") : path20.join(root, ".devin");
|
|
22440
|
+
addManagedTarget(targets.skillTargets, adapter.name, path20.join(devinBase, "skills"), root);
|
|
22421
22441
|
break;
|
|
22422
22442
|
}
|
|
22423
22443
|
}
|
|
@@ -22431,12 +22451,12 @@ function stripFrontmatter(content) {
|
|
|
22431
22451
|
return match ? content.slice(match[0].length).trim() : content.trim();
|
|
22432
22452
|
}
|
|
22433
22453
|
function readAndConcatRules(rulesDir) {
|
|
22434
|
-
if (!
|
|
22435
|
-
const files =
|
|
22454
|
+
if (!fs19.existsSync(rulesDir)) return null;
|
|
22455
|
+
const files = fs19.readdirSync(rulesDir).filter((f) => f.endsWith(".md")).sort();
|
|
22436
22456
|
if (files.length === 0) return null;
|
|
22437
22457
|
const parts = [];
|
|
22438
22458
|
for (const file of files) {
|
|
22439
|
-
const raw =
|
|
22459
|
+
const raw = fs19.readFileSync(path20.join(rulesDir, file), "utf8");
|
|
22440
22460
|
const stripped = stripFrontmatter(raw);
|
|
22441
22461
|
if (stripped) parts.push(stripped);
|
|
22442
22462
|
}
|
|
@@ -22471,7 +22491,7 @@ function injectCodexRules(configPath, rulesDir) {
|
|
|
22471
22491
|
return configPath;
|
|
22472
22492
|
}
|
|
22473
22493
|
function removeCodexRules(configPath) {
|
|
22474
|
-
if (!
|
|
22494
|
+
if (!fs19.existsSync(configPath)) return false;
|
|
22475
22495
|
const config = readToml(configPath);
|
|
22476
22496
|
const existing = config.developer_instructions;
|
|
22477
22497
|
if (!existing || !existing.includes(ARGENT_RULES_START)) return false;
|
|
@@ -22563,10 +22583,10 @@ function copyRulesAndAgents(adapters, root, scope, rulesDir, agentsDir) {
|
|
|
22563
22583
|
}
|
|
22564
22584
|
|
|
22565
22585
|
// ../argent-installer/src/retired-files.ts
|
|
22566
|
-
import * as
|
|
22586
|
+
import * as path21 from "node:path";
|
|
22567
22587
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
22568
22588
|
function displayPath(entry, file) {
|
|
22569
|
-
return
|
|
22589
|
+
return path21.join(entry.location, ...file.relativePath.split("/"));
|
|
22570
22590
|
}
|
|
22571
22591
|
async function cleanupRetiredFiles(found, options) {
|
|
22572
22592
|
const result = { removed: [], declined: [], failed: [], removedRoots: [] };
|
|
@@ -22617,14 +22637,14 @@ async function reportRetiredFiles(found, interactive) {
|
|
|
22617
22637
|
|
|
22618
22638
|
// ../argent-installer/src/cli-record.ts
|
|
22619
22639
|
var import_semver4 = __toESM(require_semver2(), 1);
|
|
22620
|
-
import * as
|
|
22621
|
-
import * as
|
|
22640
|
+
import * as fs20 from "node:fs";
|
|
22641
|
+
import * as path22 from "node:path";
|
|
22622
22642
|
function cliRecordPath() {
|
|
22623
|
-
return
|
|
22643
|
+
return path22.join(argentHomeDir(), "cli.json");
|
|
22624
22644
|
}
|
|
22625
22645
|
function readCliRecord() {
|
|
22626
22646
|
try {
|
|
22627
|
-
const parsed = JSON.parse(
|
|
22647
|
+
const parsed = JSON.parse(fs20.readFileSync(cliRecordPath(), "utf8"));
|
|
22628
22648
|
if (typeof parsed?.cli === "string" && typeof parsed?.node === "string") return parsed;
|
|
22629
22649
|
return null;
|
|
22630
22650
|
} catch {
|
|
@@ -22634,7 +22654,7 @@ function readCliRecord() {
|
|
|
22634
22654
|
function resolveCliEntry(mode, projectRoot) {
|
|
22635
22655
|
if (mode === "local") {
|
|
22636
22656
|
const relative5 = getLocalArgentBinRelPath(projectRoot);
|
|
22637
|
-
return relative5 ?
|
|
22657
|
+
return relative5 ? path22.resolve(projectRoot, relative5) : null;
|
|
22638
22658
|
}
|
|
22639
22659
|
const packageRoot = getGloballyInstalledPackageRoot();
|
|
22640
22660
|
return packageRoot ? cliPathOf(packageRoot) : null;
|
|
@@ -22653,10 +22673,10 @@ function writeCliRecord(input) {
|
|
|
22653
22673
|
function persistCliRecord(record) {
|
|
22654
22674
|
const file = cliRecordPath();
|
|
22655
22675
|
try {
|
|
22656
|
-
|
|
22676
|
+
fs20.mkdirSync(path22.dirname(file), { recursive: true });
|
|
22657
22677
|
const temporary = `${file}.${process.pid}.tmp`;
|
|
22658
|
-
|
|
22659
|
-
|
|
22678
|
+
fs20.writeFileSync(temporary, JSON.stringify(record, null, 2) + "\n");
|
|
22679
|
+
fs20.renameSync(temporary, file);
|
|
22660
22680
|
return file;
|
|
22661
22681
|
} catch {
|
|
22662
22682
|
return null;
|
|
@@ -22664,10 +22684,10 @@ function persistCliRecord(record) {
|
|
|
22664
22684
|
}
|
|
22665
22685
|
function healCliRecord(input) {
|
|
22666
22686
|
try {
|
|
22667
|
-
if (!
|
|
22687
|
+
if (!fs20.existsSync(input.cli)) return null;
|
|
22668
22688
|
const existing = readCliRecord();
|
|
22669
22689
|
if (existing) {
|
|
22670
|
-
const alive =
|
|
22690
|
+
const alive = fs20.existsSync(existing.node) && fs20.existsSync(existing.cli);
|
|
22671
22691
|
const ourVersion = import_semver4.default.valid(input.version);
|
|
22672
22692
|
const theirVersion = import_semver4.default.valid(existing.version);
|
|
22673
22693
|
const newerThanExisting = ourVersion !== null && (theirVersion === null || import_semver4.default.gt(ourVersion, theirVersion));
|
|
@@ -22688,11 +22708,11 @@ function removeCliRecordFor(installDir) {
|
|
|
22688
22708
|
if (!installDir) return false;
|
|
22689
22709
|
const record = readCliRecord();
|
|
22690
22710
|
if (!record) return false;
|
|
22691
|
-
const root =
|
|
22692
|
-
const relative5 =
|
|
22693
|
-
if (relative5.startsWith("..") ||
|
|
22711
|
+
const root = path22.resolve(installDir);
|
|
22712
|
+
const relative5 = path22.relative(root, path22.resolve(record.cli));
|
|
22713
|
+
if (relative5.startsWith("..") || path22.isAbsolute(relative5)) return false;
|
|
22694
22714
|
try {
|
|
22695
|
-
|
|
22715
|
+
fs20.rmSync(cliRecordPath(), { force: true });
|
|
22696
22716
|
return true;
|
|
22697
22717
|
} catch {
|
|
22698
22718
|
return false;
|
|
@@ -22728,9 +22748,11 @@ async function resolveTelemetryConsent(opts) {
|
|
|
22728
22748
|
printFirstRunNotice();
|
|
22729
22749
|
return { kind: "skipped" };
|
|
22730
22750
|
}
|
|
22731
|
-
const
|
|
22751
|
+
const state2 = getConsentState();
|
|
22752
|
+
const source = state2.source.source;
|
|
22732
22753
|
const envOwnsDecision = source === "env_do_not_track" || source === "env_argent_telemetry";
|
|
22733
|
-
|
|
22754
|
+
const configOptedOut = source === "config_file" && !state2.enabled;
|
|
22755
|
+
if (envOwnsDecision || configOptedOut || hasShownFirstRunNotice()) {
|
|
22734
22756
|
return { kind: "skipped" };
|
|
22735
22757
|
}
|
|
22736
22758
|
log.info(
|
|
@@ -22916,8 +22938,8 @@ async function promptInstallMode(defaultMode = "global") {
|
|
|
22916
22938
|
|
|
22917
22939
|
// ../argent-installer/src/install-runner.ts
|
|
22918
22940
|
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
22919
|
-
import * as
|
|
22920
|
-
import * as
|
|
22941
|
+
import * as fs23 from "node:fs";
|
|
22942
|
+
import * as path25 from "node:path";
|
|
22921
22943
|
|
|
22922
22944
|
// ../argent-installer/src/shell.ts
|
|
22923
22945
|
import { execFileSync as execFileSync6, spawn as spawn2 } from "node:child_process";
|
|
@@ -22949,7 +22971,7 @@ var ShellCommandError = class extends Error {
|
|
|
22949
22971
|
signal;
|
|
22950
22972
|
};
|
|
22951
22973
|
function runShellCommand(cmd, opts = {}) {
|
|
22952
|
-
return new Promise((
|
|
22974
|
+
return new Promise((resolve22, reject) => {
|
|
22953
22975
|
const child = spawn2(cmd.bin, cmd.args, {
|
|
22954
22976
|
stdio: ["ignore", "pipe", "pipe"],
|
|
22955
22977
|
shell: process.platform === "win32",
|
|
@@ -22965,7 +22987,7 @@ function runShellCommand(cmd, opts = {}) {
|
|
|
22965
22987
|
stderr += chunk.toString();
|
|
22966
22988
|
});
|
|
22967
22989
|
child.on("close", (code, signal) => {
|
|
22968
|
-
if (code === 0)
|
|
22990
|
+
if (code === 0) resolve22();
|
|
22969
22991
|
else
|
|
22970
22992
|
reject(
|
|
22971
22993
|
new ShellCommandError(
|
|
@@ -22981,33 +23003,33 @@ function runShellCommand(cmd, opts = {}) {
|
|
|
22981
23003
|
|
|
22982
23004
|
// ../argent-installer/src/skills.ts
|
|
22983
23005
|
import { execFileSync as execFileSync8 } from "node:child_process";
|
|
22984
|
-
import * as
|
|
22985
|
-
import * as
|
|
23006
|
+
import * as fs22 from "node:fs";
|
|
23007
|
+
import * as path24 from "node:path";
|
|
22986
23008
|
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
22987
23009
|
|
|
22988
23010
|
// ../argent-installer/src/skills-runner.ts
|
|
22989
23011
|
import { execFileSync as execFileSync7 } from "node:child_process";
|
|
22990
|
-
import * as
|
|
22991
|
-
import * as
|
|
23012
|
+
import * as fs21 from "node:fs";
|
|
23013
|
+
import * as path23 from "node:path";
|
|
22992
23014
|
var WIN32_DEFAULT_PATHEXT = ".COM;.EXE;.BAT;.CMD";
|
|
22993
23015
|
function findOnPath(bin, env, platform) {
|
|
22994
23016
|
const pathValue = env.PATH ?? env.Path ?? "";
|
|
22995
|
-
const dirs = pathValue.split(
|
|
23017
|
+
const dirs = pathValue.split(path23.delimiter).filter((dir) => path23.isAbsolute(dir));
|
|
22996
23018
|
if (platform === "win32") {
|
|
22997
23019
|
const exts = (env.PATHEXT ?? WIN32_DEFAULT_PATHEXT).split(";").filter(Boolean);
|
|
22998
23020
|
for (const dir of dirs) {
|
|
22999
23021
|
for (const ext of exts) {
|
|
23000
|
-
const candidate =
|
|
23001
|
-
if (
|
|
23022
|
+
const candidate = path23.join(dir, bin + ext);
|
|
23023
|
+
if (fs21.existsSync(candidate)) return candidate;
|
|
23002
23024
|
}
|
|
23003
23025
|
}
|
|
23004
23026
|
return null;
|
|
23005
23027
|
}
|
|
23006
23028
|
for (const dir of dirs) {
|
|
23007
|
-
const candidate =
|
|
23029
|
+
const candidate = path23.join(dir, bin);
|
|
23008
23030
|
try {
|
|
23009
|
-
if (!
|
|
23010
|
-
|
|
23031
|
+
if (!fs21.statSync(candidate).isFile()) continue;
|
|
23032
|
+
fs21.accessSync(candidate, fs21.constants.X_OK);
|
|
23011
23033
|
return candidate;
|
|
23012
23034
|
} catch {
|
|
23013
23035
|
}
|
|
@@ -23184,13 +23206,13 @@ function snapshotArgentSkills(projectRoot, scope, names) {
|
|
|
23184
23206
|
let candidates = names;
|
|
23185
23207
|
if (names.length === 0) {
|
|
23186
23208
|
try {
|
|
23187
|
-
candidates =
|
|
23209
|
+
candidates = fs22.readdirSync(targetPath).filter((n3) => n3.startsWith(ARGENT_SKILL_PREFIX));
|
|
23188
23210
|
} catch {
|
|
23189
23211
|
continue;
|
|
23190
23212
|
}
|
|
23191
23213
|
}
|
|
23192
23214
|
for (const name of candidates) {
|
|
23193
|
-
const stat6 =
|
|
23215
|
+
const stat6 = fs22.statSync(path24.join(targetPath, name, "SKILL.md"), { throwIfNoEntry: false });
|
|
23194
23216
|
if (!stat6?.isFile()) continue;
|
|
23195
23217
|
found.set(name, `${found.get(name) ?? ""}${stat6.ino}:${stat6.mtimeMs};`);
|
|
23196
23218
|
}
|
|
@@ -23208,7 +23230,7 @@ function pruneLegacySkillDirs(projectRoot, scope, bundled = new Set(listBundledS
|
|
|
23208
23230
|
const removed = /* @__PURE__ */ new Set();
|
|
23209
23231
|
for (const { targetPath } of skillTargets) {
|
|
23210
23232
|
for (const name of legacy) {
|
|
23211
|
-
const dir =
|
|
23233
|
+
const dir = path24.join(targetPath, name);
|
|
23212
23234
|
try {
|
|
23213
23235
|
if (removePath(dir)) removed.add(name);
|
|
23214
23236
|
} catch {
|
|
@@ -23228,13 +23250,13 @@ function listTrackedLegacySkills(projectRoot, scope, bundled = new Set(listBundl
|
|
|
23228
23250
|
}
|
|
23229
23251
|
function removeLockEntries(lockPath, names) {
|
|
23230
23252
|
try {
|
|
23231
|
-
const lock = JSON.parse(
|
|
23253
|
+
const lock = JSON.parse(fs22.readFileSync(lockPath, "utf8"));
|
|
23232
23254
|
const skills = lock.skills;
|
|
23233
23255
|
if (!skills) return [];
|
|
23234
23256
|
const removed = names.filter((name) => name in skills);
|
|
23235
23257
|
if (removed.length === 0) return [];
|
|
23236
23258
|
for (const name of removed) delete skills[name];
|
|
23237
|
-
|
|
23259
|
+
fs22.writeFileSync(lockPath, JSON.stringify(lock, null, 2) + "\n");
|
|
23238
23260
|
return removed;
|
|
23239
23261
|
} catch {
|
|
23240
23262
|
return [];
|
|
@@ -23305,7 +23327,7 @@ async function runInstall(args) {
|
|
|
23305
23327
|
return runGlobal({ fromTar, nonInteractive, version: args.version, tel });
|
|
23306
23328
|
}
|
|
23307
23329
|
function installSpec(fromTar) {
|
|
23308
|
-
return
|
|
23330
|
+
return fs23.existsSync(fromTar) ? path25.resolve(fromTar) : fromTar;
|
|
23309
23331
|
}
|
|
23310
23332
|
async function installLocally(opts) {
|
|
23311
23333
|
const { fromTar, tel } = opts;
|
|
@@ -23612,8 +23634,8 @@ async function chooseAdapters(opts) {
|
|
|
23612
23634
|
|
|
23613
23635
|
// ../argent-installer/src/init-scope.ts
|
|
23614
23636
|
var import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
23615
|
-
import { existsSync as
|
|
23616
|
-
import { resolve as
|
|
23637
|
+
import { existsSync as existsSync16 } from "node:fs";
|
|
23638
|
+
import { resolve as resolve15 } from "node:path";
|
|
23617
23639
|
async function chooseScope(opts) {
|
|
23618
23640
|
if (opts.installMode === "local") {
|
|
23619
23641
|
return { scope: "local" };
|
|
@@ -23650,13 +23672,13 @@ async function chooseScope(opts) {
|
|
|
23650
23672
|
placeholder: process.cwd(),
|
|
23651
23673
|
validate(value) {
|
|
23652
23674
|
if (!value?.trim()) return "Path cannot be empty.";
|
|
23653
|
-
const resolved =
|
|
23654
|
-
if (!
|
|
23675
|
+
const resolved = resolve15(value.trim());
|
|
23676
|
+
if (!existsSync16(resolved))
|
|
23655
23677
|
return `Path does not exist: ${resolved}. Please verify and enter a valid path.`;
|
|
23656
23678
|
}
|
|
23657
23679
|
});
|
|
23658
23680
|
if (isCancel(customPathInput)) throw new InitCancelled("scope");
|
|
23659
|
-
return { scope: "custom", customRoot:
|
|
23681
|
+
return { scope: "custom", customRoot: resolve15(customPathInput.trim()) };
|
|
23660
23682
|
}
|
|
23661
23683
|
|
|
23662
23684
|
// ../argent-installer/src/init-mcp-write.ts
|
|
@@ -23957,7 +23979,7 @@ async function configureAllowlist(args) {
|
|
|
23957
23979
|
var import_picocolors10 = __toESM(require_picocolors(), 1);
|
|
23958
23980
|
import { spawn as spawn3 } from "node:child_process";
|
|
23959
23981
|
import * as os4 from "node:os";
|
|
23960
|
-
import * as
|
|
23982
|
+
import * as path26 from "node:path";
|
|
23961
23983
|
var REF_MISSING = /Remote branch .* not found in upstream|couldn't find remote ref|unknown revision/i;
|
|
23962
23984
|
function meaningfulLine(err) {
|
|
23963
23985
|
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 +23987,10 @@ function meaningfulLine(err) {
|
|
|
23965
23987
|
}
|
|
23966
23988
|
function bundledCopyFor(version) {
|
|
23967
23989
|
const local = probeLocalInstall(resolveProjectRoot2(process.cwd()));
|
|
23968
|
-
if (local.packageDir && local.version === version) return
|
|
23990
|
+
if (local.packageDir && local.version === version) return path26.join(local.packageDir, "skills");
|
|
23969
23991
|
const globalRoot = getGloballyInstalledPackageRoot();
|
|
23970
23992
|
if (globalRoot && getGloballyInstalledVersion() === version) {
|
|
23971
|
-
return
|
|
23993
|
+
return path26.join(globalRoot, "skills");
|
|
23972
23994
|
}
|
|
23973
23995
|
return SKILLS_DIR;
|
|
23974
23996
|
}
|
|
@@ -24195,7 +24217,7 @@ async function runSkillsStep(args) {
|
|
|
24195
24217
|
async function runSkillsCli(runner, args, interactive, cwd) {
|
|
24196
24218
|
if (!runner) throw new Error(NO_SKILLS_RUNNER_MESSAGE);
|
|
24197
24219
|
const command = skillsCommand(runner, args);
|
|
24198
|
-
return new Promise((
|
|
24220
|
+
return new Promise((resolve22, reject) => {
|
|
24199
24221
|
const child = spawn3(command.file, command.args, {
|
|
24200
24222
|
env: npxChildEnv(),
|
|
24201
24223
|
stdio: interactive ? "inherit" : ["ignore", "pipe", "pipe"],
|
|
@@ -24214,7 +24236,7 @@ async function runSkillsCli(runner, args, interactive, cwd) {
|
|
|
24214
24236
|
}
|
|
24215
24237
|
child.on("close", (code, signal) => {
|
|
24216
24238
|
if (code === 0) {
|
|
24217
|
-
|
|
24239
|
+
resolve22();
|
|
24218
24240
|
} else {
|
|
24219
24241
|
const output = [stderr, stdout2].filter(Boolean).join("\n").trim();
|
|
24220
24242
|
reject(
|
|
@@ -24535,9 +24557,9 @@ function printBanner() {
|
|
|
24535
24557
|
// ../argent-installer/src/update.ts
|
|
24536
24558
|
var import_picocolors12 = __toESM(require_picocolors(), 1);
|
|
24537
24559
|
var import_semver5 = __toESM(require_semver2(), 1);
|
|
24538
|
-
import * as
|
|
24560
|
+
import * as fs25 from "node:fs";
|
|
24539
24561
|
import * as os5 from "node:os";
|
|
24540
|
-
import * as
|
|
24562
|
+
import * as path32 from "node:path";
|
|
24541
24563
|
|
|
24542
24564
|
// ../argent-installer/src/install-targets.ts
|
|
24543
24565
|
function parseTargetFlags(args) {
|
|
@@ -24609,17 +24631,16 @@ async function resolveInstallableUpdateTarget(pm, current, cwd, candidate) {
|
|
|
24609
24631
|
|
|
24610
24632
|
// ../argent-tools-client/src/launcher.ts
|
|
24611
24633
|
import * as net from "node:net";
|
|
24612
|
-
import * as
|
|
24613
|
-
import * as
|
|
24634
|
+
import * as fs24 from "node:fs";
|
|
24635
|
+
import * as path27 from "node:path";
|
|
24614
24636
|
import * as readline from "node:readline";
|
|
24615
|
-
import { homedir as homedir7 } from "node:os";
|
|
24616
24637
|
import { spawn as spawn4, execFileSync as execFileSync9 } from "node:child_process";
|
|
24617
24638
|
import { createHash as createHash3, randomBytes } from "node:crypto";
|
|
24618
24639
|
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 =
|
|
24640
|
+
var STATE_DIR = argentHomeDir();
|
|
24641
|
+
var STATE_FILE = path27.join(STATE_DIR, "tool-server.json");
|
|
24642
|
+
var LOG_FILE = path27.join(STATE_DIR, "tool-server.log");
|
|
24643
|
+
var LOCK_FILE = path27.join(STATE_DIR, "tool-server.lock");
|
|
24623
24644
|
function isProcessAlive(pid) {
|
|
24624
24645
|
try {
|
|
24625
24646
|
process.kill(pid, 0);
|
|
@@ -24630,7 +24651,7 @@ function isProcessAlive(pid) {
|
|
|
24630
24651
|
}
|
|
24631
24652
|
function stateFileForBundle(bundlePath) {
|
|
24632
24653
|
const key = createHash3("sha256").update(bundlePath).digest("hex").slice(0, 12);
|
|
24633
|
-
return
|
|
24654
|
+
return path27.join(STATE_DIR, `tool-server-${key}.json`);
|
|
24634
24655
|
}
|
|
24635
24656
|
async function readStateFile(file) {
|
|
24636
24657
|
try {
|
|
@@ -24672,7 +24693,7 @@ async function readAllToolsServerStates() {
|
|
|
24672
24693
|
const out = [];
|
|
24673
24694
|
for (const name of names) {
|
|
24674
24695
|
if (!STATE_FILE_RE.test(name)) continue;
|
|
24675
|
-
const file =
|
|
24696
|
+
const file = path27.join(STATE_DIR, name);
|
|
24676
24697
|
const state2 = await readStateFile(file);
|
|
24677
24698
|
if (state2) out.push({ file, state: state2 });
|
|
24678
24699
|
}
|
|
@@ -24718,21 +24739,21 @@ async function killToolServer(bundlePath) {
|
|
|
24718
24739
|
return alive;
|
|
24719
24740
|
}
|
|
24720
24741
|
function isPathWithin(child, parent) {
|
|
24721
|
-
const rel =
|
|
24722
|
-
return rel !== "" && !rel.startsWith("..") && !
|
|
24742
|
+
const rel = path27.relative(parent, child);
|
|
24743
|
+
return rel !== "" && !rel.startsWith("..") && !path27.isAbsolute(rel);
|
|
24723
24744
|
}
|
|
24724
24745
|
function tryRealpath(p) {
|
|
24725
24746
|
try {
|
|
24726
|
-
return
|
|
24747
|
+
return fs24.realpathSync(p);
|
|
24727
24748
|
} catch {
|
|
24728
24749
|
return p;
|
|
24729
24750
|
}
|
|
24730
24751
|
}
|
|
24731
24752
|
async function killToolServerForInstallDir(packageDir) {
|
|
24732
|
-
const parents = /* @__PURE__ */ new Set([
|
|
24753
|
+
const parents = /* @__PURE__ */ new Set([path27.resolve(packageDir), tryRealpath(packageDir)]);
|
|
24733
24754
|
let killed = 0;
|
|
24734
24755
|
for (const { file, state: state2 } of await readAllToolsServerStates()) {
|
|
24735
|
-
const bundles = /* @__PURE__ */ new Set([
|
|
24756
|
+
const bundles = /* @__PURE__ */ new Set([path27.resolve(state2.bundlePath), tryRealpath(state2.bundlePath)]);
|
|
24736
24757
|
const matches2 = [...bundles].some((b) => [...parents].some((p) => isPathWithin(b, p)));
|
|
24737
24758
|
if (!matches2) continue;
|
|
24738
24759
|
const fresh = await readStateFile(file);
|
|
@@ -24750,7 +24771,7 @@ async function killToolServerForInstallDir(packageDir) {
|
|
|
24750
24771
|
}
|
|
24751
24772
|
return killed;
|
|
24752
24773
|
}
|
|
24753
|
-
var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) =>
|
|
24774
|
+
var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs24.existsSync(p)) ?? "ps";
|
|
24754
24775
|
var PS_WIDTH_FLAGS = ["-ww"];
|
|
24755
24776
|
var PS_LOCALE = process.platform === "darwin" ? "en_US.UTF-8" : "C.UTF-8";
|
|
24756
24777
|
function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS, env = { ...process.env, LC_ALL: PS_LOCALE }) {
|
|
@@ -24797,14 +24818,13 @@ function couldBeOurToolServer(pid, marker) {
|
|
|
24797
24818
|
var import_yaml4 = __toESM(require_dist2(), 1);
|
|
24798
24819
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
24799
24820
|
import { maxHeaderSize } from "node:http";
|
|
24800
|
-
import * as
|
|
24821
|
+
import * as path31 from "node:path";
|
|
24801
24822
|
|
|
24802
24823
|
// ../argent-tools-client/src/link-config.ts
|
|
24803
|
-
import * as
|
|
24804
|
-
import { homedir as homedir8 } from "node:os";
|
|
24824
|
+
import * as path28 from "node:path";
|
|
24805
24825
|
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 =
|
|
24826
|
+
var LINK_DIR = argentHomeDir();
|
|
24827
|
+
var LINK_FILE = path28.join(LINK_DIR, "link.json");
|
|
24808
24828
|
|
|
24809
24829
|
// ../argent-tools-client/src/file-inputs.ts
|
|
24810
24830
|
import { createHash as createHash4, randomUUID as randomUUID6 } from "node:crypto";
|
|
@@ -24821,14 +24841,14 @@ import {
|
|
|
24821
24841
|
writeFile as writeFile3
|
|
24822
24842
|
} from "node:fs/promises";
|
|
24823
24843
|
import { constants as constants2, tmpdir } from "node:os";
|
|
24824
|
-
import * as
|
|
24844
|
+
import * as path29 from "node:path";
|
|
24825
24845
|
|
|
24826
24846
|
// ../archive/src/index.ts
|
|
24827
24847
|
import { spawn as spawn5 } from "node:child_process";
|
|
24828
24848
|
import { once } from "node:events";
|
|
24829
24849
|
import { createReadStream, createWriteStream } from "node:fs";
|
|
24830
24850
|
import { open, rm, readdir as readdir3 } from "node:fs/promises";
|
|
24831
|
-
import { basename as basename5, dirname as dirname14, join as
|
|
24851
|
+
import { basename as basename5, dirname as dirname14, join as join27, resolve as resolve17, sep as sep4 } from "node:path";
|
|
24832
24852
|
import { Writable } from "node:stream";
|
|
24833
24853
|
import { pipeline } from "node:stream/promises";
|
|
24834
24854
|
import zlib2 from "node:zlib";
|
|
@@ -24846,9 +24866,19 @@ var MAX_CONTENT_BYTES = 32 * 1024 * 1024;
|
|
|
24846
24866
|
// ../argent-tools-client/src/flow-files.ts
|
|
24847
24867
|
var import_yaml3 = __toESM(require_dist2(), 1);
|
|
24848
24868
|
import { readdir as readdir4, readFile as readFile4, realpath as realpath3, stat as stat4 } from "node:fs/promises";
|
|
24849
|
-
import * as
|
|
24869
|
+
import * as path30 from "node:path";
|
|
24850
24870
|
var INLINE_MEMBERS_BYTES = 256 * 1024;
|
|
24851
24871
|
|
|
24872
|
+
// ../argent-tools-client/src/tools-client.ts
|
|
24873
|
+
var RECORDING_FILE_INPUT = {
|
|
24874
|
+
target: "__recording",
|
|
24875
|
+
path: `\${project_root}/${E2E_DIRS[0].split(path31.sep).join("/")}/\${name}.yaml`,
|
|
24876
|
+
paths: E2E_DIRS.map((dir) => `\${project_root}/${dir.split(path31.sep).join("/")}/\${name}.yaml`),
|
|
24877
|
+
kind: "file",
|
|
24878
|
+
optional: true,
|
|
24879
|
+
collect: "flow"
|
|
24880
|
+
};
|
|
24881
|
+
|
|
24852
24882
|
// ../argent-tools-client/src/artifacts.ts
|
|
24853
24883
|
import {
|
|
24854
24884
|
copyFile,
|
|
@@ -24862,7 +24892,7 @@ import {
|
|
|
24862
24892
|
} from "node:fs/promises";
|
|
24863
24893
|
import { constants as fsConstants } from "node:fs";
|
|
24864
24894
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
24865
|
-
import { basename as basename8,
|
|
24895
|
+
import { basename as basename8, extname as extname2, isAbsolute as isAbsolute10, join as join31, normalize as normalize2, resolve as resolve20, sep as sep8 } from "node:path";
|
|
24866
24896
|
import { createHash as createHash5 } from "node:crypto";
|
|
24867
24897
|
var ALLOWED_SAVE_DIRS = /* @__PURE__ */ new Set([normalize2(".argent/recordings")]);
|
|
24868
24898
|
var RECORDINGS_SAVE_DIR = normalize2(".argent/recordings");
|
|
@@ -24937,7 +24967,7 @@ function resolveUpdatePackageAction(trigger, installed) {
|
|
|
24937
24967
|
return installed ? "standalone_update" : "standalone_install";
|
|
24938
24968
|
}
|
|
24939
24969
|
function isLivePinnedEntry(entry) {
|
|
24940
|
-
return entry !== null && isPinnedGlobalEntry(entry) &&
|
|
24970
|
+
return entry !== null && isPinnedGlobalEntry(entry) && fs25.existsSync(entry.command) && fs25.existsSync(entry.args[0]);
|
|
24941
24971
|
}
|
|
24942
24972
|
async function refreshConfiguration({
|
|
24943
24973
|
projectRoot,
|
|
@@ -25169,7 +25199,7 @@ async function update(args) {
|
|
|
25169
25199
|
const pm = mode === "local" ? detectProjectPackageManager(projectRoot) : detectGlobalPackageManager();
|
|
25170
25200
|
if (automatic) {
|
|
25171
25201
|
const globalRoot = getGloballyInstalledPackageRoot();
|
|
25172
|
-
if (!globallyInstalled || !globalRoot ||
|
|
25202
|
+
if (!globallyInstalled || !globalRoot || fs25.realpathSync(globalRoot) !== projectRoot || !isAutoUpdateEnabled() || !ownsGlobalInstall(pm, projectRoot)) {
|
|
25173
25203
|
spinner2.stop("Could not confirm an automatic update for this installation.");
|
|
25174
25204
|
return "noop";
|
|
25175
25205
|
}
|
|
@@ -25370,7 +25400,7 @@ async function update(args) {
|
|
|
25370
25400
|
process.exit(1);
|
|
25371
25401
|
}
|
|
25372
25402
|
if (automatic) {
|
|
25373
|
-
const runningRoot =
|
|
25403
|
+
const runningRoot = fs25.realpathSync(resolvePackageRoot(import.meta.dirname));
|
|
25374
25404
|
const result = requestedVersion ? await applyUpdateForTarget("global", runningRoot) : "noop";
|
|
25375
25405
|
if (result === "updated" && requestedVersion) {
|
|
25376
25406
|
writeCliRecord({
|
|
@@ -25393,7 +25423,7 @@ async function update(args) {
|
|
|
25393
25423
|
return;
|
|
25394
25424
|
}
|
|
25395
25425
|
const rootOverride = getProjectRootOverride(args);
|
|
25396
|
-
const projectRoot = rootOverride ?
|
|
25426
|
+
const projectRoot = rootOverride ? path32.resolve(rootOverride) : resolveProjectRoot2(process.cwd());
|
|
25397
25427
|
installMode = resolveInstallMode(projectRoot);
|
|
25398
25428
|
const flags = parseTargetFlags(args);
|
|
25399
25429
|
const localInstalled = installMode === "local" && probeLocalInstall(projectRoot).installed;
|
|
@@ -25473,8 +25503,8 @@ async function update(args) {
|
|
|
25473
25503
|
// ../argent-installer/src/uninstall.ts
|
|
25474
25504
|
var import_picocolors13 = __toESM(require_picocolors(), 1);
|
|
25475
25505
|
var import_yaml5 = __toESM(require_dist2(), 1);
|
|
25476
|
-
import * as
|
|
25477
|
-
import * as
|
|
25506
|
+
import * as fs26 from "node:fs";
|
|
25507
|
+
import * as path33 from "node:path";
|
|
25478
25508
|
var UNINSTALL_TOOLSERVER_STOP_FAILED = {
|
|
25479
25509
|
error_code: FAILURE_CODES.UNINSTALL_TOOLSERVER_STOP_FAILED,
|
|
25480
25510
|
failure_stage: "installer_uninstall_toolserver_stop",
|
|
@@ -25495,10 +25525,10 @@ var UNINSTALL_UNCLASSIFIED_FAILED = {
|
|
|
25495
25525
|
};
|
|
25496
25526
|
function removeDirIfEmpty2(dirPath) {
|
|
25497
25527
|
try {
|
|
25498
|
-
if (!
|
|
25499
|
-
if (!
|
|
25500
|
-
if (
|
|
25501
|
-
|
|
25528
|
+
if (!fs26.existsSync(dirPath)) return false;
|
|
25529
|
+
if (!fs26.statSync(dirPath).isDirectory()) return false;
|
|
25530
|
+
if (fs26.readdirSync(dirPath).length > 0) return false;
|
|
25531
|
+
fs26.rmdirSync(dirPath);
|
|
25502
25532
|
return true;
|
|
25503
25533
|
} catch {
|
|
25504
25534
|
return false;
|
|
@@ -25508,9 +25538,9 @@ function collectBundledPaths(sourceDir) {
|
|
|
25508
25538
|
const files = [];
|
|
25509
25539
|
const directories = [];
|
|
25510
25540
|
function walk(currentDir, relativeDir = "") {
|
|
25511
|
-
for (const entry of
|
|
25512
|
-
const relativePath = relativeDir ?
|
|
25513
|
-
const absolutePath =
|
|
25541
|
+
for (const entry of fs26.readdirSync(currentDir, { withFileTypes: true })) {
|
|
25542
|
+
const relativePath = relativeDir ? path33.join(relativeDir, entry.name) : entry.name;
|
|
25543
|
+
const absolutePath = path33.join(currentDir, entry.name);
|
|
25514
25544
|
if (entry.isDirectory()) {
|
|
25515
25545
|
walk(absolutePath, relativePath);
|
|
25516
25546
|
directories.push(relativePath);
|
|
@@ -25523,15 +25553,15 @@ function collectBundledPaths(sourceDir) {
|
|
|
25523
25553
|
return { files, directories };
|
|
25524
25554
|
}
|
|
25525
25555
|
function removeBundledContent(sourceDir, targetDir) {
|
|
25526
|
-
if (!
|
|
25556
|
+
if (!fs26.existsSync(sourceDir) || !fs26.existsSync(targetDir)) {
|
|
25527
25557
|
return { removedPaths: [], removedRoot: false };
|
|
25528
25558
|
}
|
|
25529
25559
|
const { files, directories } = collectBundledPaths(sourceDir);
|
|
25530
25560
|
const removedPaths = [];
|
|
25531
25561
|
for (const relativePath of files) {
|
|
25532
|
-
const targetPath =
|
|
25562
|
+
const targetPath = path33.join(targetDir, relativePath);
|
|
25533
25563
|
try {
|
|
25534
|
-
const entry =
|
|
25564
|
+
const entry = fs26.lstatSync(targetPath, { throwIfNoEntry: false });
|
|
25535
25565
|
if (!entry || entry.isDirectory()) continue;
|
|
25536
25566
|
removePath(targetPath);
|
|
25537
25567
|
removedPaths.push(relativePath);
|
|
@@ -25539,36 +25569,36 @@ function removeBundledContent(sourceDir, targetDir) {
|
|
|
25539
25569
|
}
|
|
25540
25570
|
}
|
|
25541
25571
|
directories.sort(
|
|
25542
|
-
(a2, b) => b.split(
|
|
25572
|
+
(a2, b) => b.split(path33.sep).length - a2.split(path33.sep).length || b.length - a2.length
|
|
25543
25573
|
);
|
|
25544
25574
|
for (const relativePath of directories) {
|
|
25545
|
-
const targetPath =
|
|
25575
|
+
const targetPath = path33.join(targetDir, relativePath);
|
|
25546
25576
|
try {
|
|
25547
|
-
if (!
|
|
25548
|
-
if (!
|
|
25549
|
-
if (
|
|
25550
|
-
|
|
25577
|
+
if (!fs26.existsSync(targetPath)) continue;
|
|
25578
|
+
if (!fs26.statSync(targetPath).isDirectory()) continue;
|
|
25579
|
+
if (fs26.readdirSync(targetPath).length > 0) continue;
|
|
25580
|
+
fs26.rmdirSync(targetPath);
|
|
25551
25581
|
} catch {
|
|
25552
25582
|
}
|
|
25553
25583
|
}
|
|
25554
25584
|
let removedRoot = false;
|
|
25555
25585
|
try {
|
|
25556
|
-
if (
|
|
25557
|
-
if (
|
|
25558
|
-
|
|
25586
|
+
if (fs26.existsSync(targetDir) && fs26.statSync(targetDir).isDirectory()) {
|
|
25587
|
+
if (fs26.readdirSync(targetDir).length === 0) {
|
|
25588
|
+
fs26.rmdirSync(targetDir);
|
|
25559
25589
|
removedRoot = true;
|
|
25560
25590
|
}
|
|
25561
25591
|
}
|
|
25562
25592
|
} catch {
|
|
25563
25593
|
}
|
|
25564
25594
|
if (removedRoot) {
|
|
25565
|
-
removeDirIfEmpty2(
|
|
25595
|
+
removeDirIfEmpty2(path33.dirname(targetDir));
|
|
25566
25596
|
}
|
|
25567
25597
|
return { removedPaths, removedRoot };
|
|
25568
25598
|
}
|
|
25569
25599
|
function readBundledSkillName(skillFilePath, fallbackName) {
|
|
25570
25600
|
try {
|
|
25571
|
-
const content =
|
|
25601
|
+
const content = fs26.readFileSync(skillFilePath, "utf8");
|
|
25572
25602
|
const frontmatter = content.match(/^---\r?\n([\s\S]*?)\r?\n---/)?.[1];
|
|
25573
25603
|
if (!frontmatter) return fallbackName;
|
|
25574
25604
|
const data = (0, import_yaml5.parse)(frontmatter);
|
|
@@ -25579,23 +25609,23 @@ function readBundledSkillName(skillFilePath, fallbackName) {
|
|
|
25579
25609
|
}
|
|
25580
25610
|
}
|
|
25581
25611
|
function getBundledSkillNames(skillsDir) {
|
|
25582
|
-
if (!
|
|
25612
|
+
if (!fs26.existsSync(skillsDir)) return [];
|
|
25583
25613
|
const skillNames = [];
|
|
25584
|
-
for (const entry of
|
|
25614
|
+
for (const entry of fs26.readdirSync(skillsDir, { withFileTypes: true })) {
|
|
25585
25615
|
if (!entry.isDirectory()) continue;
|
|
25586
|
-
const skillFilePath =
|
|
25587
|
-
if (!
|
|
25616
|
+
const skillFilePath = path33.join(skillsDir, entry.name, "SKILL.md");
|
|
25617
|
+
if (!fs26.existsSync(skillFilePath)) continue;
|
|
25588
25618
|
skillNames.push(readBundledSkillName(skillFilePath, entry.name));
|
|
25589
25619
|
}
|
|
25590
25620
|
return [...new Set(skillNames)].sort();
|
|
25591
25621
|
}
|
|
25592
25622
|
function removeBundledSkillInstalls(skillNames, targetDir) {
|
|
25593
|
-
if (!
|
|
25623
|
+
if (!fs26.existsSync(targetDir)) {
|
|
25594
25624
|
return { removedPaths: [], removedRoot: false };
|
|
25595
25625
|
}
|
|
25596
25626
|
const removedPaths = [];
|
|
25597
25627
|
for (const skillName of skillNames) {
|
|
25598
|
-
const targetPath =
|
|
25628
|
+
const targetPath = path33.join(targetDir, skillName);
|
|
25599
25629
|
try {
|
|
25600
25630
|
if (removePath(targetPath)) removedPaths.push(skillName);
|
|
25601
25631
|
} catch {
|
|
@@ -25603,17 +25633,17 @@ function removeBundledSkillInstalls(skillNames, targetDir) {
|
|
|
25603
25633
|
}
|
|
25604
25634
|
const removedRoot = removeDirIfEmpty2(targetDir);
|
|
25605
25635
|
if (removedRoot) {
|
|
25606
|
-
removeDirIfEmpty2(
|
|
25636
|
+
removeDirIfEmpty2(path33.dirname(targetDir));
|
|
25607
25637
|
}
|
|
25608
25638
|
return { removedPaths, removedRoot };
|
|
25609
25639
|
}
|
|
25610
25640
|
function cleanupSkillsLockFile(lockPath, skillNames) {
|
|
25611
|
-
if (!
|
|
25641
|
+
if (!fs26.existsSync(lockPath)) {
|
|
25612
25642
|
return { removedSkills: [], removedFile: false };
|
|
25613
25643
|
}
|
|
25614
25644
|
let parsed;
|
|
25615
25645
|
try {
|
|
25616
|
-
parsed = JSON.parse(
|
|
25646
|
+
parsed = JSON.parse(fs26.readFileSync(lockPath, "utf8"));
|
|
25617
25647
|
} catch {
|
|
25618
25648
|
return { removedSkills: [], removedFile: false };
|
|
25619
25649
|
}
|
|
@@ -25640,10 +25670,10 @@ function cleanupSkillsLockFile(lockPath, skillNames) {
|
|
|
25640
25670
|
parsed.skills && typeof parsed.skills === "object" && Object.keys(parsed.skills).length > 0
|
|
25641
25671
|
);
|
|
25642
25672
|
if (!hasSkills && otherKeys.length === 0) {
|
|
25643
|
-
|
|
25673
|
+
fs26.rmSync(lockPath, { force: true });
|
|
25644
25674
|
return { removedSkills, removedFile: true };
|
|
25645
25675
|
}
|
|
25646
|
-
|
|
25676
|
+
fs26.writeFileSync(lockPath, JSON.stringify(parsed, null, 2) + "\n");
|
|
25647
25677
|
return { removedSkills, removedFile: false };
|
|
25648
25678
|
}
|
|
25649
25679
|
function cleanupBundledSkills(skillNames, targets) {
|
|
@@ -25846,7 +25876,7 @@ async function uninstall(args) {
|
|
|
25846
25876
|
),
|
|
25847
25877
|
{ ask: false }
|
|
25848
25878
|
);
|
|
25849
|
-
for (const root of retired.removedRoots) removeDirIfEmpty2(
|
|
25879
|
+
for (const root of retired.removedRoots) removeDirIfEmpty2(path33.dirname(root));
|
|
25850
25880
|
const retiredLines = formatRetiredCleanup(retired);
|
|
25851
25881
|
pruneResults.push(...retiredLines.removed.map((line) => `${import_picocolors13.default.green("+")} ${line}`));
|
|
25852
25882
|
const retiredKept = retiredLines.kept.map((line) => ` ${line}`);
|
|
@@ -25965,7 +25995,7 @@ async function uninstall(args) {
|
|
|
25965
25995
|
try {
|
|
25966
25996
|
execShellCommandSync(removable.cmd, { cwd: removable.cwd, env: removable.env });
|
|
25967
25997
|
const leftover = removable.kind === "global" ? getRemainingGlobalBinaryPath() : null;
|
|
25968
|
-
const removed = !leftover || removable.installDir !== null && !
|
|
25998
|
+
const removed = !leftover || removable.installDir !== null && !fs26.existsSync(removable.installDir);
|
|
25969
25999
|
if (removed) hasUninstalledPackage = true;
|
|
25970
26000
|
if (removed && removeCliRecordFor(removable.installDir)) {
|
|
25971
26001
|
log.info(import_picocolors13.default.dim("Removed ~/.argent/cli.json (provider CLI discovery record)."));
|