@swmansion/argent 0.27.1-next.2 → 0.27.1-next.21
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/assets/manifest.json +2 -2
- package/bin/argent-android-devtools-0.2.0.apk +0 -0
- package/bin/darwin/ax-service +0 -0
- package/bin/darwin/tvos-ax-service +0 -0
- package/bin/darwin/tvos-hid-daemon +0 -0
- package/bin/tcp/ax-service +0 -0
- package/dist/cli-cmds.mjs +8696 -646
- package/dist/client.d.ts +68 -0
- package/dist/client.js +8371 -410
- package/dist/installer.mjs +567 -546
- package/dist/mcp-server.mjs +8582 -455
- package/dist/tool-args.generated.d.ts +10 -2
- package/dist/tool-server.cjs +2477 -1488
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
- package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
- package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +1 -1
- package/skills/argent-create-flow/references/flow-yaml.md +1 -1
- package/skills/argent-create-flow/references/live-authoring.md +6 -2
- package/bin/argent-android-devtools-0.1.0.apk +0 -0
package/dist/installer.mjs
CHANGED
|
@@ -1192,8 +1192,8 @@ var init_esm = __esm({
|
|
|
1192
1192
|
// ../../node_modules/dotenv/lib/main.js
|
|
1193
1193
|
var require_main = __commonJS({
|
|
1194
1194
|
"../../node_modules/dotenv/lib/main.js"(exports, module) {
|
|
1195
|
-
var
|
|
1196
|
-
var
|
|
1195
|
+
var fs20 = __require("fs");
|
|
1196
|
+
var path25 = __require("path");
|
|
1197
1197
|
var os3 = __require("os");
|
|
1198
1198
|
var crypto3 = __require("crypto");
|
|
1199
1199
|
var TIPS = [
|
|
@@ -1324,7 +1324,7 @@ var require_main = __commonJS({
|
|
|
1324
1324
|
if (options && options.path && options.path.length > 0) {
|
|
1325
1325
|
if (Array.isArray(options.path)) {
|
|
1326
1326
|
for (const filepath of options.path) {
|
|
1327
|
-
if (
|
|
1327
|
+
if (fs20.existsSync(filepath)) {
|
|
1328
1328
|
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
1329
1329
|
}
|
|
1330
1330
|
}
|
|
@@ -1332,15 +1332,15 @@ var require_main = __commonJS({
|
|
|
1332
1332
|
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
1333
1333
|
}
|
|
1334
1334
|
} else {
|
|
1335
|
-
possibleVaultPath =
|
|
1335
|
+
possibleVaultPath = path25.resolve(process.cwd(), ".env.vault");
|
|
1336
1336
|
}
|
|
1337
|
-
if (
|
|
1337
|
+
if (fs20.existsSync(possibleVaultPath)) {
|
|
1338
1338
|
return possibleVaultPath;
|
|
1339
1339
|
}
|
|
1340
1340
|
return null;
|
|
1341
1341
|
}
|
|
1342
1342
|
function _resolveHome(envPath) {
|
|
1343
|
-
return envPath[0] === "~" ?
|
|
1343
|
+
return envPath[0] === "~" ? path25.join(os3.homedir(), envPath.slice(1)) : envPath;
|
|
1344
1344
|
}
|
|
1345
1345
|
function _configVault(options) {
|
|
1346
1346
|
const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
|
|
@@ -1357,7 +1357,7 @@ var require_main = __commonJS({
|
|
|
1357
1357
|
return { parsed };
|
|
1358
1358
|
}
|
|
1359
1359
|
function configDotenv(options) {
|
|
1360
|
-
const dotenvPath =
|
|
1360
|
+
const dotenvPath = path25.resolve(process.cwd(), ".env");
|
|
1361
1361
|
let encoding = "utf8";
|
|
1362
1362
|
let processEnv = process.env;
|
|
1363
1363
|
if (options && options.processEnv != null) {
|
|
@@ -1385,13 +1385,13 @@ var require_main = __commonJS({
|
|
|
1385
1385
|
}
|
|
1386
1386
|
let lastError;
|
|
1387
1387
|
const parsedAll = {};
|
|
1388
|
-
for (const
|
|
1388
|
+
for (const path26 of optionPaths) {
|
|
1389
1389
|
try {
|
|
1390
|
-
const parsed = DotenvModule.parse(
|
|
1390
|
+
const parsed = DotenvModule.parse(fs20.readFileSync(path26, { encoding }));
|
|
1391
1391
|
DotenvModule.populate(parsedAll, parsed, options);
|
|
1392
1392
|
} catch (e) {
|
|
1393
1393
|
if (debug) {
|
|
1394
|
-
_debug(`failed to load ${
|
|
1394
|
+
_debug(`failed to load ${path26} ${e.message}`);
|
|
1395
1395
|
}
|
|
1396
1396
|
lastError = e;
|
|
1397
1397
|
}
|
|
@@ -1404,7 +1404,7 @@ var require_main = __commonJS({
|
|
|
1404
1404
|
const shortPaths = [];
|
|
1405
1405
|
for (const filePath of optionPaths) {
|
|
1406
1406
|
try {
|
|
1407
|
-
const relative5 =
|
|
1407
|
+
const relative5 = path25.relative(process.cwd(), filePath);
|
|
1408
1408
|
shortPaths.push(relative5);
|
|
1409
1409
|
} catch (e) {
|
|
1410
1410
|
if (debug) {
|
|
@@ -2358,10 +2358,10 @@ var require_truncate = __commonJS({
|
|
|
2358
2358
|
"../../node_modules/semver/functions/truncate.js"(exports, module) {
|
|
2359
2359
|
"use strict";
|
|
2360
2360
|
var parse4 = require_parse();
|
|
2361
|
-
var
|
|
2361
|
+
var constants2 = require_constants();
|
|
2362
2362
|
var SemVer = require_semver();
|
|
2363
2363
|
var truncate = (version, truncation, options) => {
|
|
2364
|
-
if (!
|
|
2364
|
+
if (!constants2.RELEASE_TYPES.includes(truncation)) {
|
|
2365
2365
|
return null;
|
|
2366
2366
|
}
|
|
2367
2367
|
const clonedVersion = cloneInputVersion(version, options);
|
|
@@ -3410,7 +3410,7 @@ var require_semver2 = __commonJS({
|
|
|
3410
3410
|
"../../node_modules/semver/index.js"(exports, module) {
|
|
3411
3411
|
"use strict";
|
|
3412
3412
|
var internalRe = require_re();
|
|
3413
|
-
var
|
|
3413
|
+
var constants2 = require_constants();
|
|
3414
3414
|
var SemVer = require_semver();
|
|
3415
3415
|
var identifiers = require_identifiers();
|
|
3416
3416
|
var parse4 = require_parse();
|
|
@@ -3494,8 +3494,8 @@ var require_semver2 = __commonJS({
|
|
|
3494
3494
|
re: internalRe.re,
|
|
3495
3495
|
src: internalRe.src,
|
|
3496
3496
|
tokens: internalRe.t,
|
|
3497
|
-
SEMVER_SPEC_VERSION:
|
|
3498
|
-
RELEASE_TYPES:
|
|
3497
|
+
SEMVER_SPEC_VERSION: constants2.SEMVER_SPEC_VERSION,
|
|
3498
|
+
RELEASE_TYPES: constants2.RELEASE_TYPES,
|
|
3499
3499
|
compareIdentifiers: identifiers.compareIdentifiers,
|
|
3500
3500
|
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
3501
3501
|
};
|
|
@@ -3579,17 +3579,17 @@ var require_visit = __commonJS({
|
|
|
3579
3579
|
visit2.BREAK = BREAK;
|
|
3580
3580
|
visit2.SKIP = SKIP;
|
|
3581
3581
|
visit2.REMOVE = REMOVE;
|
|
3582
|
-
function visit_(key, node, visitor,
|
|
3583
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
3582
|
+
function visit_(key, node, visitor, path25) {
|
|
3583
|
+
const ctrl = callVisitor(key, node, visitor, path25);
|
|
3584
3584
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
3585
|
-
replaceNode(key,
|
|
3586
|
-
return visit_(key, ctrl, visitor,
|
|
3585
|
+
replaceNode(key, path25, ctrl);
|
|
3586
|
+
return visit_(key, ctrl, visitor, path25);
|
|
3587
3587
|
}
|
|
3588
3588
|
if (typeof ctrl !== "symbol") {
|
|
3589
3589
|
if (identity2.isCollection(node)) {
|
|
3590
|
-
|
|
3590
|
+
path25 = Object.freeze(path25.concat(node));
|
|
3591
3591
|
for (let i2 = 0; i2 < node.items.length; ++i2) {
|
|
3592
|
-
const ci = visit_(i2, node.items[i2], visitor,
|
|
3592
|
+
const ci = visit_(i2, node.items[i2], visitor, path25);
|
|
3593
3593
|
if (typeof ci === "number")
|
|
3594
3594
|
i2 = ci - 1;
|
|
3595
3595
|
else if (ci === BREAK)
|
|
@@ -3600,13 +3600,13 @@ var require_visit = __commonJS({
|
|
|
3600
3600
|
}
|
|
3601
3601
|
}
|
|
3602
3602
|
} else if (identity2.isPair(node)) {
|
|
3603
|
-
|
|
3604
|
-
const ck = visit_("key", node.key, visitor,
|
|
3603
|
+
path25 = Object.freeze(path25.concat(node));
|
|
3604
|
+
const ck = visit_("key", node.key, visitor, path25);
|
|
3605
3605
|
if (ck === BREAK)
|
|
3606
3606
|
return BREAK;
|
|
3607
3607
|
else if (ck === REMOVE)
|
|
3608
3608
|
node.key = null;
|
|
3609
|
-
const cv = visit_("value", node.value, visitor,
|
|
3609
|
+
const cv = visit_("value", node.value, visitor, path25);
|
|
3610
3610
|
if (cv === BREAK)
|
|
3611
3611
|
return BREAK;
|
|
3612
3612
|
else if (cv === REMOVE)
|
|
@@ -3627,17 +3627,17 @@ var require_visit = __commonJS({
|
|
|
3627
3627
|
visitAsync.BREAK = BREAK;
|
|
3628
3628
|
visitAsync.SKIP = SKIP;
|
|
3629
3629
|
visitAsync.REMOVE = REMOVE;
|
|
3630
|
-
async function visitAsync_(key, node, visitor,
|
|
3631
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
3630
|
+
async function visitAsync_(key, node, visitor, path25) {
|
|
3631
|
+
const ctrl = await callVisitor(key, node, visitor, path25);
|
|
3632
3632
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
3633
|
-
replaceNode(key,
|
|
3634
|
-
return visitAsync_(key, ctrl, visitor,
|
|
3633
|
+
replaceNode(key, path25, ctrl);
|
|
3634
|
+
return visitAsync_(key, ctrl, visitor, path25);
|
|
3635
3635
|
}
|
|
3636
3636
|
if (typeof ctrl !== "symbol") {
|
|
3637
3637
|
if (identity2.isCollection(node)) {
|
|
3638
|
-
|
|
3638
|
+
path25 = Object.freeze(path25.concat(node));
|
|
3639
3639
|
for (let i2 = 0; i2 < node.items.length; ++i2) {
|
|
3640
|
-
const ci = await visitAsync_(i2, node.items[i2], visitor,
|
|
3640
|
+
const ci = await visitAsync_(i2, node.items[i2], visitor, path25);
|
|
3641
3641
|
if (typeof ci === "number")
|
|
3642
3642
|
i2 = ci - 1;
|
|
3643
3643
|
else if (ci === BREAK)
|
|
@@ -3648,13 +3648,13 @@ var require_visit = __commonJS({
|
|
|
3648
3648
|
}
|
|
3649
3649
|
}
|
|
3650
3650
|
} else if (identity2.isPair(node)) {
|
|
3651
|
-
|
|
3652
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
3651
|
+
path25 = Object.freeze(path25.concat(node));
|
|
3652
|
+
const ck = await visitAsync_("key", node.key, visitor, path25);
|
|
3653
3653
|
if (ck === BREAK)
|
|
3654
3654
|
return BREAK;
|
|
3655
3655
|
else if (ck === REMOVE)
|
|
3656
3656
|
node.key = null;
|
|
3657
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
3657
|
+
const cv = await visitAsync_("value", node.value, visitor, path25);
|
|
3658
3658
|
if (cv === BREAK)
|
|
3659
3659
|
return BREAK;
|
|
3660
3660
|
else if (cv === REMOVE)
|
|
@@ -3681,23 +3681,23 @@ var require_visit = __commonJS({
|
|
|
3681
3681
|
}
|
|
3682
3682
|
return visitor;
|
|
3683
3683
|
}
|
|
3684
|
-
function callVisitor(key, node, visitor,
|
|
3684
|
+
function callVisitor(key, node, visitor, path25) {
|
|
3685
3685
|
if (typeof visitor === "function")
|
|
3686
|
-
return visitor(key, node,
|
|
3686
|
+
return visitor(key, node, path25);
|
|
3687
3687
|
if (identity2.isMap(node))
|
|
3688
|
-
return visitor.Map?.(key, node,
|
|
3688
|
+
return visitor.Map?.(key, node, path25);
|
|
3689
3689
|
if (identity2.isSeq(node))
|
|
3690
|
-
return visitor.Seq?.(key, node,
|
|
3690
|
+
return visitor.Seq?.(key, node, path25);
|
|
3691
3691
|
if (identity2.isPair(node))
|
|
3692
|
-
return visitor.Pair?.(key, node,
|
|
3692
|
+
return visitor.Pair?.(key, node, path25);
|
|
3693
3693
|
if (identity2.isScalar(node))
|
|
3694
|
-
return visitor.Scalar?.(key, node,
|
|
3694
|
+
return visitor.Scalar?.(key, node, path25);
|
|
3695
3695
|
if (identity2.isAlias(node))
|
|
3696
|
-
return visitor.Alias?.(key, node,
|
|
3696
|
+
return visitor.Alias?.(key, node, path25);
|
|
3697
3697
|
return void 0;
|
|
3698
3698
|
}
|
|
3699
|
-
function replaceNode(key,
|
|
3700
|
-
const parent =
|
|
3699
|
+
function replaceNode(key, path25, node) {
|
|
3700
|
+
const parent = path25[path25.length - 1];
|
|
3701
3701
|
if (identity2.isCollection(parent)) {
|
|
3702
3702
|
parent.items[key] = node;
|
|
3703
3703
|
} else if (identity2.isPair(parent)) {
|
|
@@ -4307,10 +4307,10 @@ var require_Collection = __commonJS({
|
|
|
4307
4307
|
var createNode = require_createNode();
|
|
4308
4308
|
var identity2 = require_identity();
|
|
4309
4309
|
var Node = require_Node();
|
|
4310
|
-
function collectionFromPath(schema,
|
|
4310
|
+
function collectionFromPath(schema, path25, value) {
|
|
4311
4311
|
let v = value;
|
|
4312
|
-
for (let i2 =
|
|
4313
|
-
const k =
|
|
4312
|
+
for (let i2 = path25.length - 1; i2 >= 0; --i2) {
|
|
4313
|
+
const k = path25[i2];
|
|
4314
4314
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
4315
4315
|
const a3 = [];
|
|
4316
4316
|
a3[k] = v;
|
|
@@ -4329,7 +4329,7 @@ var require_Collection = __commonJS({
|
|
|
4329
4329
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
4330
4330
|
});
|
|
4331
4331
|
}
|
|
4332
|
-
var isEmptyPath = (
|
|
4332
|
+
var isEmptyPath = (path25) => path25 == null || typeof path25 === "object" && !!path25[Symbol.iterator]().next().done;
|
|
4333
4333
|
var Collection = class extends Node.NodeBase {
|
|
4334
4334
|
constructor(type, schema) {
|
|
4335
4335
|
super(type);
|
|
@@ -4359,11 +4359,11 @@ var require_Collection = __commonJS({
|
|
|
4359
4359
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
4360
4360
|
* that already exists in the map.
|
|
4361
4361
|
*/
|
|
4362
|
-
addIn(
|
|
4363
|
-
if (isEmptyPath(
|
|
4362
|
+
addIn(path25, value) {
|
|
4363
|
+
if (isEmptyPath(path25))
|
|
4364
4364
|
this.add(value);
|
|
4365
4365
|
else {
|
|
4366
|
-
const [key, ...rest] =
|
|
4366
|
+
const [key, ...rest] = path25;
|
|
4367
4367
|
const node = this.get(key, true);
|
|
4368
4368
|
if (identity2.isCollection(node))
|
|
4369
4369
|
node.addIn(rest, value);
|
|
@@ -4377,8 +4377,8 @@ var require_Collection = __commonJS({
|
|
|
4377
4377
|
* Removes a value from the collection.
|
|
4378
4378
|
* @returns `true` if the item was found and removed.
|
|
4379
4379
|
*/
|
|
4380
|
-
deleteIn(
|
|
4381
|
-
const [key, ...rest] =
|
|
4380
|
+
deleteIn(path25) {
|
|
4381
|
+
const [key, ...rest] = path25;
|
|
4382
4382
|
if (rest.length === 0)
|
|
4383
4383
|
return this.delete(key);
|
|
4384
4384
|
const node = this.get(key, true);
|
|
@@ -4392,8 +4392,8 @@ var require_Collection = __commonJS({
|
|
|
4392
4392
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
4393
4393
|
* `true` (collections are always returned intact).
|
|
4394
4394
|
*/
|
|
4395
|
-
getIn(
|
|
4396
|
-
const [key, ...rest] =
|
|
4395
|
+
getIn(path25, keepScalar) {
|
|
4396
|
+
const [key, ...rest] = path25;
|
|
4397
4397
|
const node = this.get(key, true);
|
|
4398
4398
|
if (rest.length === 0)
|
|
4399
4399
|
return !keepScalar && identity2.isScalar(node) ? node.value : node;
|
|
@@ -4411,8 +4411,8 @@ var require_Collection = __commonJS({
|
|
|
4411
4411
|
/**
|
|
4412
4412
|
* Checks if the collection includes a value with the key `key`.
|
|
4413
4413
|
*/
|
|
4414
|
-
hasIn(
|
|
4415
|
-
const [key, ...rest] =
|
|
4414
|
+
hasIn(path25) {
|
|
4415
|
+
const [key, ...rest] = path25;
|
|
4416
4416
|
if (rest.length === 0)
|
|
4417
4417
|
return this.has(key);
|
|
4418
4418
|
const node = this.get(key, true);
|
|
@@ -4422,8 +4422,8 @@ var require_Collection = __commonJS({
|
|
|
4422
4422
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
4423
4423
|
* boolean to add/remove the item from the set.
|
|
4424
4424
|
*/
|
|
4425
|
-
setIn(
|
|
4426
|
-
const [key, ...rest] =
|
|
4425
|
+
setIn(path25, value) {
|
|
4426
|
+
const [key, ...rest] = path25;
|
|
4427
4427
|
if (rest.length === 0) {
|
|
4428
4428
|
this.set(key, value);
|
|
4429
4429
|
} else {
|
|
@@ -6938,9 +6938,9 @@ var require_Document = __commonJS({
|
|
|
6938
6938
|
this.contents.add(value);
|
|
6939
6939
|
}
|
|
6940
6940
|
/** Adds a value to the document. */
|
|
6941
|
-
addIn(
|
|
6941
|
+
addIn(path25, value) {
|
|
6942
6942
|
if (assertCollection(this.contents))
|
|
6943
|
-
this.contents.addIn(
|
|
6943
|
+
this.contents.addIn(path25, value);
|
|
6944
6944
|
}
|
|
6945
6945
|
/**
|
|
6946
6946
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -7015,14 +7015,14 @@ var require_Document = __commonJS({
|
|
|
7015
7015
|
* Removes a value from the document.
|
|
7016
7016
|
* @returns `true` if the item was found and removed.
|
|
7017
7017
|
*/
|
|
7018
|
-
deleteIn(
|
|
7019
|
-
if (Collection.isEmptyPath(
|
|
7018
|
+
deleteIn(path25) {
|
|
7019
|
+
if (Collection.isEmptyPath(path25)) {
|
|
7020
7020
|
if (this.contents == null)
|
|
7021
7021
|
return false;
|
|
7022
7022
|
this.contents = null;
|
|
7023
7023
|
return true;
|
|
7024
7024
|
}
|
|
7025
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
7025
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path25) : false;
|
|
7026
7026
|
}
|
|
7027
7027
|
/**
|
|
7028
7028
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -7037,10 +7037,10 @@ var require_Document = __commonJS({
|
|
|
7037
7037
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
7038
7038
|
* `true` (collections are always returned intact).
|
|
7039
7039
|
*/
|
|
7040
|
-
getIn(
|
|
7041
|
-
if (Collection.isEmptyPath(
|
|
7040
|
+
getIn(path25, keepScalar) {
|
|
7041
|
+
if (Collection.isEmptyPath(path25))
|
|
7042
7042
|
return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
7043
|
-
return identity2.isCollection(this.contents) ? this.contents.getIn(
|
|
7043
|
+
return identity2.isCollection(this.contents) ? this.contents.getIn(path25, keepScalar) : void 0;
|
|
7044
7044
|
}
|
|
7045
7045
|
/**
|
|
7046
7046
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -7051,10 +7051,10 @@ var require_Document = __commonJS({
|
|
|
7051
7051
|
/**
|
|
7052
7052
|
* Checks if the document includes a value at `path`.
|
|
7053
7053
|
*/
|
|
7054
|
-
hasIn(
|
|
7055
|
-
if (Collection.isEmptyPath(
|
|
7054
|
+
hasIn(path25) {
|
|
7055
|
+
if (Collection.isEmptyPath(path25))
|
|
7056
7056
|
return this.contents !== void 0;
|
|
7057
|
-
return identity2.isCollection(this.contents) ? this.contents.hasIn(
|
|
7057
|
+
return identity2.isCollection(this.contents) ? this.contents.hasIn(path25) : false;
|
|
7058
7058
|
}
|
|
7059
7059
|
/**
|
|
7060
7060
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -7071,13 +7071,13 @@ var require_Document = __commonJS({
|
|
|
7071
7071
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
7072
7072
|
* boolean to add/remove the item from the set.
|
|
7073
7073
|
*/
|
|
7074
|
-
setIn(
|
|
7075
|
-
if (Collection.isEmptyPath(
|
|
7074
|
+
setIn(path25, value) {
|
|
7075
|
+
if (Collection.isEmptyPath(path25)) {
|
|
7076
7076
|
this.contents = value;
|
|
7077
7077
|
} else if (this.contents == null) {
|
|
7078
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
7078
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path25), value);
|
|
7079
7079
|
} else if (assertCollection(this.contents)) {
|
|
7080
|
-
this.contents.setIn(
|
|
7080
|
+
this.contents.setIn(path25, value);
|
|
7081
7081
|
}
|
|
7082
7082
|
}
|
|
7083
7083
|
/**
|
|
@@ -7463,10 +7463,10 @@ var require_resolve_block_map = __commonJS({
|
|
|
7463
7463
|
let offset = bm.offset;
|
|
7464
7464
|
let commentEnd = null;
|
|
7465
7465
|
for (const collItem of bm.items) {
|
|
7466
|
-
const { start, key, sep:
|
|
7466
|
+
const { start, key, sep: sep8, value } = collItem;
|
|
7467
7467
|
const keyProps = resolveProps.resolveProps(start, {
|
|
7468
7468
|
indicator: "explicit-key-ind",
|
|
7469
|
-
next: key ??
|
|
7469
|
+
next: key ?? sep8?.[0],
|
|
7470
7470
|
offset,
|
|
7471
7471
|
onError,
|
|
7472
7472
|
parentIndent: bm.indent,
|
|
@@ -7480,7 +7480,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
7480
7480
|
else if ("indent" in key && key.indent !== bm.indent)
|
|
7481
7481
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
7482
7482
|
}
|
|
7483
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
7483
|
+
if (!keyProps.anchor && !keyProps.tag && !sep8) {
|
|
7484
7484
|
commentEnd = keyProps.end;
|
|
7485
7485
|
if (keyProps.comment) {
|
|
7486
7486
|
if (map.comment)
|
|
@@ -7504,7 +7504,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
7504
7504
|
ctx.atKey = false;
|
|
7505
7505
|
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
|
7506
7506
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
7507
|
-
const valueProps = resolveProps.resolveProps(
|
|
7507
|
+
const valueProps = resolveProps.resolveProps(sep8 ?? [], {
|
|
7508
7508
|
indicator: "map-value-ind",
|
|
7509
7509
|
next: value,
|
|
7510
7510
|
offset: keyNode.range[2],
|
|
@@ -7520,7 +7520,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
7520
7520
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
7521
7521
|
onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
7522
7522
|
}
|
|
7523
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset,
|
|
7523
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep8, null, valueProps, onError);
|
|
7524
7524
|
if (ctx.schema.compat)
|
|
7525
7525
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
7526
7526
|
offset = valueNode.range[2];
|
|
@@ -7611,7 +7611,7 @@ var require_resolve_end = __commonJS({
|
|
|
7611
7611
|
let comment = "";
|
|
7612
7612
|
if (end) {
|
|
7613
7613
|
let hasSpace = false;
|
|
7614
|
-
let
|
|
7614
|
+
let sep8 = "";
|
|
7615
7615
|
for (const token of end) {
|
|
7616
7616
|
const { source, type } = token;
|
|
7617
7617
|
switch (type) {
|
|
@@ -7625,13 +7625,13 @@ var require_resolve_end = __commonJS({
|
|
|
7625
7625
|
if (!comment)
|
|
7626
7626
|
comment = cb;
|
|
7627
7627
|
else
|
|
7628
|
-
comment +=
|
|
7629
|
-
|
|
7628
|
+
comment += sep8 + cb;
|
|
7629
|
+
sep8 = "";
|
|
7630
7630
|
break;
|
|
7631
7631
|
}
|
|
7632
7632
|
case "newline":
|
|
7633
7633
|
if (comment)
|
|
7634
|
-
|
|
7634
|
+
sep8 += source;
|
|
7635
7635
|
hasSpace = true;
|
|
7636
7636
|
break;
|
|
7637
7637
|
default:
|
|
@@ -7674,18 +7674,18 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
7674
7674
|
let offset = fc.offset + fc.start.source.length;
|
|
7675
7675
|
for (let i2 = 0; i2 < fc.items.length; ++i2) {
|
|
7676
7676
|
const collItem = fc.items[i2];
|
|
7677
|
-
const { start, key, sep:
|
|
7677
|
+
const { start, key, sep: sep8, value } = collItem;
|
|
7678
7678
|
const props = resolveProps.resolveProps(start, {
|
|
7679
7679
|
flow: fcName,
|
|
7680
7680
|
indicator: "explicit-key-ind",
|
|
7681
|
-
next: key ??
|
|
7681
|
+
next: key ?? sep8?.[0],
|
|
7682
7682
|
offset,
|
|
7683
7683
|
onError,
|
|
7684
7684
|
parentIndent: fc.indent,
|
|
7685
7685
|
startOnNewline: false
|
|
7686
7686
|
});
|
|
7687
7687
|
if (!props.found) {
|
|
7688
|
-
if (!props.anchor && !props.tag && !
|
|
7688
|
+
if (!props.anchor && !props.tag && !sep8 && !value) {
|
|
7689
7689
|
if (i2 === 0 && props.comma)
|
|
7690
7690
|
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
7691
7691
|
else if (i2 < fc.items.length - 1)
|
|
@@ -7739,8 +7739,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
7739
7739
|
}
|
|
7740
7740
|
}
|
|
7741
7741
|
}
|
|
7742
|
-
if (!isMap2 && !
|
|
7743
|
-
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end,
|
|
7742
|
+
if (!isMap2 && !sep8 && !props.found) {
|
|
7743
|
+
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep8, null, props, onError);
|
|
7744
7744
|
coll.items.push(valueNode);
|
|
7745
7745
|
offset = valueNode.range[2];
|
|
7746
7746
|
if (isBlock(value))
|
|
@@ -7752,7 +7752,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
7752
7752
|
if (isBlock(key))
|
|
7753
7753
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
7754
7754
|
ctx.atKey = false;
|
|
7755
|
-
const valueProps = resolveProps.resolveProps(
|
|
7755
|
+
const valueProps = resolveProps.resolveProps(sep8 ?? [], {
|
|
7756
7756
|
flow: fcName,
|
|
7757
7757
|
indicator: "map-value-ind",
|
|
7758
7758
|
next: value,
|
|
@@ -7763,8 +7763,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
7763
7763
|
});
|
|
7764
7764
|
if (valueProps.found) {
|
|
7765
7765
|
if (!isMap2 && !props.found && ctx.options.strict) {
|
|
7766
|
-
if (
|
|
7767
|
-
for (const st of
|
|
7766
|
+
if (sep8)
|
|
7767
|
+
for (const st of sep8) {
|
|
7768
7768
|
if (st === valueProps.found)
|
|
7769
7769
|
break;
|
|
7770
7770
|
if (st.type === "newline") {
|
|
@@ -7781,7 +7781,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
7781
7781
|
else
|
|
7782
7782
|
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
7783
7783
|
}
|
|
7784
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
7784
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep8, null, valueProps, onError) : null;
|
|
7785
7785
|
if (valueNode) {
|
|
7786
7786
|
if (isBlock(value))
|
|
7787
7787
|
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -7961,7 +7961,7 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
7961
7961
|
chompStart = i2 + 1;
|
|
7962
7962
|
}
|
|
7963
7963
|
let value = "";
|
|
7964
|
-
let
|
|
7964
|
+
let sep8 = "";
|
|
7965
7965
|
let prevMoreIndented = false;
|
|
7966
7966
|
for (let i2 = 0; i2 < contentStart; ++i2)
|
|
7967
7967
|
value += lines[i2][0].slice(trimIndent) + "\n";
|
|
@@ -7978,24 +7978,24 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
7978
7978
|
indent = "";
|
|
7979
7979
|
}
|
|
7980
7980
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
7981
|
-
value +=
|
|
7982
|
-
|
|
7981
|
+
value += sep8 + indent.slice(trimIndent) + content;
|
|
7982
|
+
sep8 = "\n";
|
|
7983
7983
|
} else if (indent.length > trimIndent || content[0] === " ") {
|
|
7984
|
-
if (
|
|
7985
|
-
|
|
7986
|
-
else if (!prevMoreIndented &&
|
|
7987
|
-
|
|
7988
|
-
value +=
|
|
7989
|
-
|
|
7984
|
+
if (sep8 === " ")
|
|
7985
|
+
sep8 = "\n";
|
|
7986
|
+
else if (!prevMoreIndented && sep8 === "\n")
|
|
7987
|
+
sep8 = "\n\n";
|
|
7988
|
+
value += sep8 + indent.slice(trimIndent) + content;
|
|
7989
|
+
sep8 = "\n";
|
|
7990
7990
|
prevMoreIndented = true;
|
|
7991
7991
|
} else if (content === "") {
|
|
7992
|
-
if (
|
|
7992
|
+
if (sep8 === "\n")
|
|
7993
7993
|
value += "\n";
|
|
7994
7994
|
else
|
|
7995
|
-
|
|
7995
|
+
sep8 = "\n";
|
|
7996
7996
|
} else {
|
|
7997
|
-
value +=
|
|
7998
|
-
|
|
7997
|
+
value += sep8 + content;
|
|
7998
|
+
sep8 = " ";
|
|
7999
7999
|
prevMoreIndented = false;
|
|
8000
8000
|
}
|
|
8001
8001
|
}
|
|
@@ -8177,25 +8177,25 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
8177
8177
|
if (!match)
|
|
8178
8178
|
return source;
|
|
8179
8179
|
let res = match[1];
|
|
8180
|
-
let
|
|
8180
|
+
let sep8 = " ";
|
|
8181
8181
|
let pos = first.lastIndex;
|
|
8182
8182
|
line.lastIndex = pos;
|
|
8183
8183
|
while (match = line.exec(source)) {
|
|
8184
8184
|
if (match[1] === "") {
|
|
8185
|
-
if (
|
|
8186
|
-
res +=
|
|
8185
|
+
if (sep8 === "\n")
|
|
8186
|
+
res += sep8;
|
|
8187
8187
|
else
|
|
8188
|
-
|
|
8188
|
+
sep8 = "\n";
|
|
8189
8189
|
} else {
|
|
8190
|
-
res +=
|
|
8191
|
-
|
|
8190
|
+
res += sep8 + match[1];
|
|
8191
|
+
sep8 = " ";
|
|
8192
8192
|
}
|
|
8193
8193
|
pos = line.lastIndex;
|
|
8194
8194
|
}
|
|
8195
8195
|
const last = /[ \t]*(.*)/sy;
|
|
8196
8196
|
last.lastIndex = pos;
|
|
8197
8197
|
match = last.exec(source);
|
|
8198
|
-
return res +
|
|
8198
|
+
return res + sep8 + (match?.[1] ?? "");
|
|
8199
8199
|
}
|
|
8200
8200
|
function doubleQuotedValue(source, onError) {
|
|
8201
8201
|
let res = "";
|
|
@@ -9005,14 +9005,14 @@ var require_cst_stringify = __commonJS({
|
|
|
9005
9005
|
}
|
|
9006
9006
|
}
|
|
9007
9007
|
}
|
|
9008
|
-
function stringifyItem({ start, key, sep:
|
|
9008
|
+
function stringifyItem({ start, key, sep: sep8, value }) {
|
|
9009
9009
|
let res = "";
|
|
9010
9010
|
for (const st of start)
|
|
9011
9011
|
res += st.source;
|
|
9012
9012
|
if (key)
|
|
9013
9013
|
res += stringifyToken(key);
|
|
9014
|
-
if (
|
|
9015
|
-
for (const st of
|
|
9014
|
+
if (sep8)
|
|
9015
|
+
for (const st of sep8)
|
|
9016
9016
|
res += st.source;
|
|
9017
9017
|
if (value)
|
|
9018
9018
|
res += stringifyToken(value);
|
|
@@ -9037,9 +9037,9 @@ var require_cst_visit = __commonJS({
|
|
|
9037
9037
|
visit2.BREAK = BREAK;
|
|
9038
9038
|
visit2.SKIP = SKIP;
|
|
9039
9039
|
visit2.REMOVE = REMOVE;
|
|
9040
|
-
visit2.itemAtPath = (cst,
|
|
9040
|
+
visit2.itemAtPath = (cst, path25) => {
|
|
9041
9041
|
let item = cst;
|
|
9042
|
-
for (const [field, index] of
|
|
9042
|
+
for (const [field, index] of path25) {
|
|
9043
9043
|
const tok = item?.[field];
|
|
9044
9044
|
if (tok && "items" in tok) {
|
|
9045
9045
|
item = tok.items[index];
|
|
@@ -9048,23 +9048,23 @@ var require_cst_visit = __commonJS({
|
|
|
9048
9048
|
}
|
|
9049
9049
|
return item;
|
|
9050
9050
|
};
|
|
9051
|
-
visit2.parentCollection = (cst,
|
|
9052
|
-
const parent = visit2.itemAtPath(cst,
|
|
9053
|
-
const field =
|
|
9051
|
+
visit2.parentCollection = (cst, path25) => {
|
|
9052
|
+
const parent = visit2.itemAtPath(cst, path25.slice(0, -1));
|
|
9053
|
+
const field = path25[path25.length - 1][0];
|
|
9054
9054
|
const coll = parent?.[field];
|
|
9055
9055
|
if (coll && "items" in coll)
|
|
9056
9056
|
return coll;
|
|
9057
9057
|
throw new Error("Parent collection not found");
|
|
9058
9058
|
};
|
|
9059
|
-
function _visit(
|
|
9060
|
-
let ctrl = visitor(item,
|
|
9059
|
+
function _visit(path25, item, visitor) {
|
|
9060
|
+
let ctrl = visitor(item, path25);
|
|
9061
9061
|
if (typeof ctrl === "symbol")
|
|
9062
9062
|
return ctrl;
|
|
9063
9063
|
for (const field of ["key", "value"]) {
|
|
9064
9064
|
const token = item[field];
|
|
9065
9065
|
if (token && "items" in token) {
|
|
9066
9066
|
for (let i2 = 0; i2 < token.items.length; ++i2) {
|
|
9067
|
-
const ci = _visit(Object.freeze(
|
|
9067
|
+
const ci = _visit(Object.freeze(path25.concat([[field, i2]])), token.items[i2], visitor);
|
|
9068
9068
|
if (typeof ci === "number")
|
|
9069
9069
|
i2 = ci - 1;
|
|
9070
9070
|
else if (ci === BREAK)
|
|
@@ -9075,10 +9075,10 @@ var require_cst_visit = __commonJS({
|
|
|
9075
9075
|
}
|
|
9076
9076
|
}
|
|
9077
9077
|
if (typeof ctrl === "function" && field === "key")
|
|
9078
|
-
ctrl = ctrl(item,
|
|
9078
|
+
ctrl = ctrl(item, path25);
|
|
9079
9079
|
}
|
|
9080
9080
|
}
|
|
9081
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
9081
|
+
return typeof ctrl === "function" ? ctrl(item, path25) : ctrl;
|
|
9082
9082
|
}
|
|
9083
9083
|
exports.visit = visit2;
|
|
9084
9084
|
}
|
|
@@ -10179,18 +10179,18 @@ var require_parser = __commonJS({
|
|
|
10179
10179
|
if (this.type === "map-value-ind") {
|
|
10180
10180
|
const prev = getPrevProps(this.peek(2));
|
|
10181
10181
|
const start = getFirstKeyStartProps(prev);
|
|
10182
|
-
let
|
|
10182
|
+
let sep8;
|
|
10183
10183
|
if (scalar.end) {
|
|
10184
|
-
|
|
10185
|
-
|
|
10184
|
+
sep8 = scalar.end;
|
|
10185
|
+
sep8.push(this.sourceToken);
|
|
10186
10186
|
delete scalar.end;
|
|
10187
10187
|
} else
|
|
10188
|
-
|
|
10188
|
+
sep8 = [this.sourceToken];
|
|
10189
10189
|
const map = {
|
|
10190
10190
|
type: "block-map",
|
|
10191
10191
|
offset: scalar.offset,
|
|
10192
10192
|
indent: scalar.indent,
|
|
10193
|
-
items: [{ start, key: scalar, sep:
|
|
10193
|
+
items: [{ start, key: scalar, sep: sep8 }]
|
|
10194
10194
|
};
|
|
10195
10195
|
this.onKeyLine = true;
|
|
10196
10196
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -10343,15 +10343,15 @@ var require_parser = __commonJS({
|
|
|
10343
10343
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
10344
10344
|
const start2 = getFirstKeyStartProps(it.start);
|
|
10345
10345
|
const key = it.key;
|
|
10346
|
-
const
|
|
10347
|
-
|
|
10346
|
+
const sep8 = it.sep;
|
|
10347
|
+
sep8.push(this.sourceToken);
|
|
10348
10348
|
delete it.key;
|
|
10349
10349
|
delete it.sep;
|
|
10350
10350
|
this.stack.push({
|
|
10351
10351
|
type: "block-map",
|
|
10352
10352
|
offset: this.offset,
|
|
10353
10353
|
indent: this.indent,
|
|
10354
|
-
items: [{ start: start2, key, sep:
|
|
10354
|
+
items: [{ start: start2, key, sep: sep8 }]
|
|
10355
10355
|
});
|
|
10356
10356
|
} else if (start.length > 0) {
|
|
10357
10357
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -10380,14 +10380,14 @@ var require_parser = __commonJS({
|
|
|
10380
10380
|
case "scalar":
|
|
10381
10381
|
case "single-quoted-scalar":
|
|
10382
10382
|
case "double-quoted-scalar": {
|
|
10383
|
-
const
|
|
10383
|
+
const fs20 = this.flowScalar(this.type);
|
|
10384
10384
|
if (atNextItem || it.value) {
|
|
10385
|
-
map.items.push({ start, key:
|
|
10385
|
+
map.items.push({ start, key: fs20, sep: [] });
|
|
10386
10386
|
this.onKeyLine = true;
|
|
10387
10387
|
} else if (it.sep) {
|
|
10388
|
-
this.stack.push(
|
|
10388
|
+
this.stack.push(fs20);
|
|
10389
10389
|
} else {
|
|
10390
|
-
Object.assign(it, { key:
|
|
10390
|
+
Object.assign(it, { key: fs20, sep: [] });
|
|
10391
10391
|
this.onKeyLine = true;
|
|
10392
10392
|
}
|
|
10393
10393
|
return;
|
|
@@ -10515,13 +10515,13 @@ var require_parser = __commonJS({
|
|
|
10515
10515
|
case "scalar":
|
|
10516
10516
|
case "single-quoted-scalar":
|
|
10517
10517
|
case "double-quoted-scalar": {
|
|
10518
|
-
const
|
|
10518
|
+
const fs20 = this.flowScalar(this.type);
|
|
10519
10519
|
if (!it || it.value)
|
|
10520
|
-
fc.items.push({ start: [], key:
|
|
10520
|
+
fc.items.push({ start: [], key: fs20, sep: [] });
|
|
10521
10521
|
else if (it.sep)
|
|
10522
|
-
this.stack.push(
|
|
10522
|
+
this.stack.push(fs20);
|
|
10523
10523
|
else
|
|
10524
|
-
Object.assign(it, { key:
|
|
10524
|
+
Object.assign(it, { key: fs20, sep: [] });
|
|
10525
10525
|
return;
|
|
10526
10526
|
}
|
|
10527
10527
|
case "flow-map-end":
|
|
@@ -10545,13 +10545,13 @@ var require_parser = __commonJS({
|
|
|
10545
10545
|
const prev = getPrevProps(parent);
|
|
10546
10546
|
const start = getFirstKeyStartProps(prev);
|
|
10547
10547
|
fixFlowSeqItems(fc);
|
|
10548
|
-
const
|
|
10549
|
-
|
|
10548
|
+
const sep8 = fc.end.splice(1, fc.end.length);
|
|
10549
|
+
sep8.push(this.sourceToken);
|
|
10550
10550
|
const map = {
|
|
10551
10551
|
type: "block-map",
|
|
10552
10552
|
offset: fc.offset,
|
|
10553
10553
|
indent: fc.indent,
|
|
10554
|
-
items: [{ start, key: fc, sep:
|
|
10554
|
+
items: [{ start, key: fc, sep: sep8 }]
|
|
10555
10555
|
};
|
|
10556
10556
|
this.onKeyLine = true;
|
|
10557
10557
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -14904,7 +14904,7 @@ function appendRootPathToUrlIfNeeded(url) {
|
|
|
14904
14904
|
return void 0;
|
|
14905
14905
|
}
|
|
14906
14906
|
}
|
|
14907
|
-
function appendResourcePathToUrl(url,
|
|
14907
|
+
function appendResourcePathToUrl(url, path25) {
|
|
14908
14908
|
try {
|
|
14909
14909
|
new URL(url);
|
|
14910
14910
|
} catch {
|
|
@@ -14914,11 +14914,11 @@ function appendResourcePathToUrl(url, path23) {
|
|
|
14914
14914
|
if (!url.endsWith("/")) {
|
|
14915
14915
|
url = url + "/";
|
|
14916
14916
|
}
|
|
14917
|
-
url +=
|
|
14917
|
+
url += path25;
|
|
14918
14918
|
try {
|
|
14919
14919
|
new URL(url);
|
|
14920
14920
|
} catch {
|
|
14921
|
-
diag2.warn(`Configuration: Provided URL appended with '${
|
|
14921
|
+
diag2.warn(`Configuration: Provided URL appended with '${path25}' is not a valid URL, using 'undefined' instead of '${url}'`);
|
|
14922
14922
|
return void 0;
|
|
14923
14923
|
}
|
|
14924
14924
|
return url;
|
|
@@ -15617,6 +15617,10 @@ var FLOW_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}$`);
|
|
|
15617
15617
|
var FLOW_FILE_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}\\.yaml$`);
|
|
15618
15618
|
var SCRIPT_FILE_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}\\.mjs$`);
|
|
15619
15619
|
|
|
15620
|
+
// ../registry/src/flow-file-refs.ts
|
|
15621
|
+
import * as fs6 from "node:fs/promises";
|
|
15622
|
+
import * as path8 from "node:path";
|
|
15623
|
+
|
|
15620
15624
|
// ../registry/src/failure-codes.ts
|
|
15621
15625
|
var FAILURE_CODES = {
|
|
15622
15626
|
ARGENT_UNCLASSIFIED_FAILURE: "ARGENT_UNCLASSIFIED_FAILURE",
|
|
@@ -15631,6 +15635,8 @@ var FAILURE_CODES = {
|
|
|
15631
15635
|
HTTP_CAPABILITY_UNSUPPORTED_OPERATION: "HTTP_CAPABILITY_UNSUPPORTED_OPERATION",
|
|
15632
15636
|
HTTP_DEVICE_RESOLUTION_FAILED: "HTTP_DEVICE_RESOLUTION_FAILED",
|
|
15633
15637
|
HTTP_DEPENDENCY_PREFLIGHT_MISSING: "HTTP_DEPENDENCY_PREFLIGHT_MISSING",
|
|
15638
|
+
// The client's POST /upload of a file input was refused, so the call was not sent.
|
|
15639
|
+
FILE_INPUT_UPLOAD_FAILED: "FILE_INPUT_UPLOAD_FAILED",
|
|
15634
15640
|
CLI_RUN_TOOL_NOT_FOUND: "CLI_RUN_TOOL_NOT_FOUND",
|
|
15635
15641
|
CLI_RUN_FLAG_PARSE_FAILED: "CLI_RUN_FLAG_PARSE_FAILED",
|
|
15636
15642
|
CLI_RUN_ARGS_NOT_OBJECT: "CLI_RUN_ARGS_NOT_OBJECT",
|
|
@@ -16307,9 +16313,9 @@ function isReplitAgent(env) {
|
|
|
16307
16313
|
}
|
|
16308
16314
|
var DEVIN_MARKER_PATH = "/opt/.devin";
|
|
16309
16315
|
var JULES_MARKER_PATH = "/opt/environment_summary.sh";
|
|
16310
|
-
function safeExists(fileExists,
|
|
16316
|
+
function safeExists(fileExists, path25) {
|
|
16311
16317
|
try {
|
|
16312
|
-
return fileExists(
|
|
16318
|
+
return fileExists(path25);
|
|
16313
16319
|
} catch {
|
|
16314
16320
|
return false;
|
|
16315
16321
|
}
|
|
@@ -16730,7 +16736,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
16730
16736
|
var SESSION_ID = randomUUID4();
|
|
16731
16737
|
function readCliVersion() {
|
|
16732
16738
|
if (true) {
|
|
16733
|
-
return "0.27.1-next.
|
|
16739
|
+
return "0.27.1-next.21";
|
|
16734
16740
|
}
|
|
16735
16741
|
return "0.0.0";
|
|
16736
16742
|
}
|
|
@@ -16763,8 +16769,8 @@ function getBaseProps(runtime) {
|
|
|
16763
16769
|
|
|
16764
16770
|
// ../telemetry/src/identity.ts
|
|
16765
16771
|
import * as crypto2 from "node:crypto";
|
|
16766
|
-
import * as
|
|
16767
|
-
import * as
|
|
16772
|
+
import * as fs7 from "node:fs";
|
|
16773
|
+
import * as path9 from "node:path";
|
|
16768
16774
|
var FINGERPRINT_PATTERN = /^[0-9a-f]{64}$/;
|
|
16769
16775
|
var cached = null;
|
|
16770
16776
|
var fingerprintResolved = null;
|
|
@@ -16871,66 +16877,66 @@ function resolveFingerprintOnce(resolveFingerprint) {
|
|
|
16871
16877
|
function isCorruptIdFile(filePath) {
|
|
16872
16878
|
let isRegularFile;
|
|
16873
16879
|
try {
|
|
16874
|
-
isRegularFile =
|
|
16880
|
+
isRegularFile = fs7.lstatSync(filePath).isFile();
|
|
16875
16881
|
} catch {
|
|
16876
16882
|
return false;
|
|
16877
16883
|
}
|
|
16878
16884
|
return isRegularFile && tryReadId(filePath) === null;
|
|
16879
16885
|
}
|
|
16880
16886
|
function writeIdFileAtomic(finalPath, id) {
|
|
16881
|
-
|
|
16887
|
+
fs7.mkdirSync(argentHomeDir(), { recursive: true });
|
|
16882
16888
|
let occupant;
|
|
16883
16889
|
try {
|
|
16884
|
-
occupant =
|
|
16890
|
+
occupant = fs7.lstatSync(finalPath);
|
|
16885
16891
|
} catch (err) {
|
|
16886
16892
|
if (err.code !== "ENOENT") throw err;
|
|
16887
16893
|
}
|
|
16888
16894
|
if (occupant && !occupant.isFile()) {
|
|
16889
16895
|
throw new Error("telemetry: refusing to replace a non-regular file at the identity path");
|
|
16890
16896
|
}
|
|
16891
|
-
const tmpPath =
|
|
16897
|
+
const tmpPath = path9.join(
|
|
16892
16898
|
argentHomeDir(),
|
|
16893
16899
|
`.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
|
|
16894
16900
|
);
|
|
16895
|
-
const fd =
|
|
16901
|
+
const fd = fs7.openSync(tmpPath, "wx", 384);
|
|
16896
16902
|
try {
|
|
16897
16903
|
try {
|
|
16898
|
-
|
|
16899
|
-
|
|
16904
|
+
fs7.writeSync(fd, id);
|
|
16905
|
+
fs7.fsyncSync(fd);
|
|
16900
16906
|
} finally {
|
|
16901
|
-
|
|
16907
|
+
fs7.closeSync(fd);
|
|
16902
16908
|
}
|
|
16903
|
-
|
|
16909
|
+
fs7.renameSync(tmpPath, finalPath);
|
|
16904
16910
|
} finally {
|
|
16905
16911
|
try {
|
|
16906
|
-
|
|
16912
|
+
fs7.unlinkSync(tmpPath);
|
|
16907
16913
|
} catch {
|
|
16908
16914
|
}
|
|
16909
16915
|
}
|
|
16910
16916
|
}
|
|
16911
16917
|
function mintRandomId(finalPath) {
|
|
16912
|
-
|
|
16918
|
+
fs7.mkdirSync(argentHomeDir(), { recursive: true });
|
|
16913
16919
|
let value = crypto2.randomUUID();
|
|
16914
16920
|
for (let attempt = 0; attempt < 3; attempt++) {
|
|
16915
|
-
const tmpPath =
|
|
16921
|
+
const tmpPath = path9.join(
|
|
16916
16922
|
argentHomeDir(),
|
|
16917
16923
|
`.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
|
|
16918
16924
|
);
|
|
16919
16925
|
let fd;
|
|
16920
16926
|
try {
|
|
16921
|
-
fd =
|
|
16927
|
+
fd = fs7.openSync(tmpPath, "wx", 384);
|
|
16922
16928
|
} catch (err) {
|
|
16923
16929
|
if (err.code === "EEXIST") continue;
|
|
16924
16930
|
throw err;
|
|
16925
16931
|
}
|
|
16926
16932
|
try {
|
|
16927
16933
|
try {
|
|
16928
|
-
|
|
16929
|
-
|
|
16934
|
+
fs7.writeSync(fd, value);
|
|
16935
|
+
fs7.fsyncSync(fd);
|
|
16930
16936
|
} finally {
|
|
16931
|
-
|
|
16937
|
+
fs7.closeSync(fd);
|
|
16932
16938
|
}
|
|
16933
|
-
|
|
16939
|
+
fs7.linkSync(tmpPath, finalPath);
|
|
16934
16940
|
cached = { path: finalPath, id: value };
|
|
16935
16941
|
return value;
|
|
16936
16942
|
} catch (err) {
|
|
@@ -16949,7 +16955,7 @@ function mintRandomId(finalPath) {
|
|
|
16949
16955
|
throw err;
|
|
16950
16956
|
} finally {
|
|
16951
16957
|
try {
|
|
16952
|
-
|
|
16958
|
+
fs7.unlinkSync(tmpPath);
|
|
16953
16959
|
} catch {
|
|
16954
16960
|
}
|
|
16955
16961
|
}
|
|
@@ -16957,12 +16963,12 @@ function mintRandomId(finalPath) {
|
|
|
16957
16963
|
throw new Error("telemetry: failed to create identity after retries");
|
|
16958
16964
|
}
|
|
16959
16965
|
function claimCorruptOccupant(finalPath) {
|
|
16960
|
-
const claimed =
|
|
16966
|
+
const claimed = path9.join(
|
|
16961
16967
|
argentHomeDir(),
|
|
16962
16968
|
`.telemetry-id.corrupt.${process.pid}.${crypto2.randomUUID()}`
|
|
16963
16969
|
);
|
|
16964
16970
|
try {
|
|
16965
|
-
|
|
16971
|
+
fs7.renameSync(finalPath, claimed);
|
|
16966
16972
|
} catch {
|
|
16967
16973
|
return null;
|
|
16968
16974
|
}
|
|
@@ -16971,7 +16977,7 @@ function claimCorruptOccupant(finalPath) {
|
|
|
16971
16977
|
grabbed = tryReadId(claimed);
|
|
16972
16978
|
} finally {
|
|
16973
16979
|
try {
|
|
16974
|
-
|
|
16980
|
+
fs7.unlinkSync(claimed);
|
|
16975
16981
|
} catch {
|
|
16976
16982
|
}
|
|
16977
16983
|
}
|
|
@@ -16980,7 +16986,7 @@ function claimCorruptOccupant(finalPath) {
|
|
|
16980
16986
|
function deleteAnonId() {
|
|
16981
16987
|
cached = null;
|
|
16982
16988
|
try {
|
|
16983
|
-
|
|
16989
|
+
fs7.unlinkSync(identityFilePath());
|
|
16984
16990
|
} catch (err) {
|
|
16985
16991
|
if (err.code !== "ENOENT") throw err;
|
|
16986
16992
|
}
|
|
@@ -16988,9 +16994,9 @@ function deleteAnonId() {
|
|
|
16988
16994
|
function tryReadId(filePath) {
|
|
16989
16995
|
let raw;
|
|
16990
16996
|
try {
|
|
16991
|
-
const stats =
|
|
16997
|
+
const stats = fs7.lstatSync(filePath);
|
|
16992
16998
|
if (!stats.isFile()) return null;
|
|
16993
|
-
raw =
|
|
16999
|
+
raw = fs7.readFileSync(filePath, "utf8");
|
|
16994
17000
|
} catch (err) {
|
|
16995
17001
|
if (err.code === "ENOENT") return null;
|
|
16996
17002
|
return null;
|
|
@@ -17004,12 +17010,12 @@ function tryReadId(filePath) {
|
|
|
17004
17010
|
import { execFileSync, spawn } from "node:child_process";
|
|
17005
17011
|
|
|
17006
17012
|
// ../native-devtools-ios/src/index.ts
|
|
17007
|
-
import * as
|
|
17008
|
-
import * as
|
|
17009
|
-
var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ??
|
|
17010
|
-
var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ??
|
|
17011
|
-
var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ??
|
|
17012
|
-
var DYLIB_TVOS_DIR =
|
|
17013
|
+
import * as path10 from "node:path";
|
|
17014
|
+
import * as fs8 from "node:fs";
|
|
17015
|
+
var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path10.join(__dirname, "..", "dylibs");
|
|
17016
|
+
var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path10.join(__dirname, "..", "bin");
|
|
17017
|
+
var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path10.join(DYLIB_DIR, "tcp");
|
|
17018
|
+
var DYLIB_TVOS_DIR = path10.join(DYLIB_DIR, "tvos");
|
|
17013
17019
|
function hostPlatformKey() {
|
|
17014
17020
|
if (process.platform === "linux" && process.arch === "arm64") {
|
|
17015
17021
|
return "linux-arm64";
|
|
@@ -17020,14 +17026,14 @@ function simulatorServerBinaryName() {
|
|
|
17020
17026
|
return process.platform === "win32" ? "simulator-server.exe" : "simulator-server";
|
|
17021
17027
|
}
|
|
17022
17028
|
function platformBinDir() {
|
|
17023
|
-
return
|
|
17029
|
+
return path10.join(BIN_DIR, hostPlatformKey());
|
|
17024
17030
|
}
|
|
17025
17031
|
function simulatorServerBinaryPath() {
|
|
17026
17032
|
const binaryName = simulatorServerBinaryName();
|
|
17027
|
-
const p =
|
|
17028
|
-
if (!
|
|
17029
|
-
const flat =
|
|
17030
|
-
const migrationHint =
|
|
17033
|
+
const p = path10.join(platformBinDir(), binaryName);
|
|
17034
|
+
if (!fs8.existsSync(p)) {
|
|
17035
|
+
const flat = path10.join(BIN_DIR, binaryName);
|
|
17036
|
+
const migrationHint = fs8.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.` : "";
|
|
17031
17037
|
throw new Error(
|
|
17032
17038
|
`simulator-server binary not found for platform "${hostPlatformKey()}" at ${p}. Supported hosts today: darwin, linux (x86_64 and arm64), win32.${migrationHint}`
|
|
17033
17039
|
);
|
|
@@ -17107,14 +17113,14 @@ function resolveHostFingerprintAsync() {
|
|
|
17107
17113
|
}
|
|
17108
17114
|
|
|
17109
17115
|
// ../telemetry/src/consent.ts
|
|
17110
|
-
import * as
|
|
17116
|
+
import * as fs9 from "node:fs";
|
|
17111
17117
|
var cache = /* @__PURE__ */ new Map();
|
|
17112
17118
|
var sessionOverride = null;
|
|
17113
17119
|
function readConfigOverrideAt(filePath) {
|
|
17114
17120
|
const miss = { mtimeMs: null, fingerprint: null, enabledOverride: null };
|
|
17115
17121
|
let stats;
|
|
17116
17122
|
try {
|
|
17117
|
-
stats =
|
|
17123
|
+
stats = fs9.lstatSync(filePath);
|
|
17118
17124
|
} catch {
|
|
17119
17125
|
cache.set(filePath, miss);
|
|
17120
17126
|
return null;
|
|
@@ -17131,7 +17137,7 @@ function readConfigOverrideAt(filePath) {
|
|
|
17131
17137
|
}
|
|
17132
17138
|
let parsedEnabled = null;
|
|
17133
17139
|
try {
|
|
17134
|
-
const raw =
|
|
17140
|
+
const raw = fs9.readFileSync(filePath, "utf8");
|
|
17135
17141
|
const json = JSON.parse(raw);
|
|
17136
17142
|
if (json && typeof json === "object") {
|
|
17137
17143
|
const t2 = json.telemetry;
|
|
@@ -17364,9 +17370,9 @@ async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
|
|
|
17364
17370
|
}
|
|
17365
17371
|
|
|
17366
17372
|
// ../argent-installer/src/mcp-configs.ts
|
|
17367
|
-
import * as
|
|
17368
|
-
import * as
|
|
17369
|
-
import { execFileSync as
|
|
17373
|
+
import * as fs16 from "node:fs";
|
|
17374
|
+
import * as path17 from "node:path";
|
|
17375
|
+
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
17370
17376
|
import { homedir as homedir4 } from "node:os";
|
|
17371
17377
|
|
|
17372
17378
|
// ../argent-installer/src/constants.ts
|
|
@@ -17379,11 +17385,11 @@ var CURSOR_ALLOWLIST_PATTERN = "argent:*";
|
|
|
17379
17385
|
|
|
17380
17386
|
// ../argent-installer/src/utils.ts
|
|
17381
17387
|
var import_semver3 = __toESM(require_semver2(), 1);
|
|
17382
|
-
import * as
|
|
17383
|
-
import * as
|
|
17388
|
+
import * as fs15 from "node:fs";
|
|
17389
|
+
import * as path16 from "node:path";
|
|
17384
17390
|
import * as dns from "node:dns";
|
|
17385
17391
|
import * as os2 from "node:os";
|
|
17386
|
-
import {
|
|
17392
|
+
import { execFileSync as execFileSync3, execSync } from "node:child_process";
|
|
17387
17393
|
|
|
17388
17394
|
// ../../node_modules/smol-toml/dist/date.js
|
|
17389
17395
|
var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
|
|
@@ -17710,7 +17716,7 @@ function skipVoid(str, ptr, banNewLines, banComments) {
|
|
|
17710
17716
|
}
|
|
17711
17717
|
return ptr;
|
|
17712
17718
|
}
|
|
17713
|
-
function skipUntil(str, ptr,
|
|
17719
|
+
function skipUntil(str, ptr, sep8, end, banNewLines = false) {
|
|
17714
17720
|
if (!end) {
|
|
17715
17721
|
ptr = indexOfNewline(str, ptr);
|
|
17716
17722
|
return ptr < 0 ? str.length : ptr;
|
|
@@ -17719,7 +17725,7 @@ function skipUntil(str, ptr, sep6, end, banNewLines = false) {
|
|
|
17719
17725
|
let c2 = str[i2];
|
|
17720
17726
|
if (c2 === "#") {
|
|
17721
17727
|
i2 = indexOfNewline(str, i2);
|
|
17722
|
-
} else if (c2 ===
|
|
17728
|
+
} else if (c2 === sep8) {
|
|
17723
17729
|
return i2 + 1;
|
|
17724
17730
|
} else if (c2 === end || banNewLines && (c2 === "\n" || c2 === "\r" && str[i2 + 1] === "\n")) {
|
|
17725
17731
|
return i2;
|
|
@@ -18985,11 +18991,11 @@ function parseTree(text2, errors = [], options = ParseOptions.DEFAULT) {
|
|
|
18985
18991
|
onValue({ type: getNodeType(value), offset, length, parent: currentParent, value });
|
|
18986
18992
|
ensurePropertyComplete(offset + length);
|
|
18987
18993
|
},
|
|
18988
|
-
onSeparator: (
|
|
18994
|
+
onSeparator: (sep8, offset, length) => {
|
|
18989
18995
|
if (currentParent.type === "property") {
|
|
18990
|
-
if (
|
|
18996
|
+
if (sep8 === ":") {
|
|
18991
18997
|
currentParent.colonOffset = offset;
|
|
18992
|
-
} else if (
|
|
18998
|
+
} else if (sep8 === ",") {
|
|
18993
18999
|
ensurePropertyComplete(offset);
|
|
18994
19000
|
}
|
|
18995
19001
|
}
|
|
@@ -19005,12 +19011,12 @@ function parseTree(text2, errors = [], options = ParseOptions.DEFAULT) {
|
|
|
19005
19011
|
}
|
|
19006
19012
|
return result;
|
|
19007
19013
|
}
|
|
19008
|
-
function findNodeAtLocation(root,
|
|
19014
|
+
function findNodeAtLocation(root, path25) {
|
|
19009
19015
|
if (!root) {
|
|
19010
19016
|
return void 0;
|
|
19011
19017
|
}
|
|
19012
19018
|
let node = root;
|
|
19013
|
-
for (let segment of
|
|
19019
|
+
for (let segment of path25) {
|
|
19014
19020
|
if (typeof segment === "string") {
|
|
19015
19021
|
if (node.type !== "object" || !Array.isArray(node.children)) {
|
|
19016
19022
|
return void 0;
|
|
@@ -19364,14 +19370,14 @@ function getNodeType(value) {
|
|
|
19364
19370
|
|
|
19365
19371
|
// ../../node_modules/jsonc-parser/lib/esm/impl/edit.js
|
|
19366
19372
|
function setProperty(text2, originalPath, value, options) {
|
|
19367
|
-
const
|
|
19373
|
+
const path25 = originalPath.slice();
|
|
19368
19374
|
const errors = [];
|
|
19369
19375
|
const root = parseTree(text2, errors);
|
|
19370
19376
|
let parent = void 0;
|
|
19371
19377
|
let lastSegment = void 0;
|
|
19372
|
-
while (
|
|
19373
|
-
lastSegment =
|
|
19374
|
-
parent = findNodeAtLocation(root,
|
|
19378
|
+
while (path25.length > 0) {
|
|
19379
|
+
lastSegment = path25.pop();
|
|
19380
|
+
parent = findNodeAtLocation(root, path25);
|
|
19375
19381
|
if (parent === void 0 && value !== void 0) {
|
|
19376
19382
|
if (typeof lastSegment === "string") {
|
|
19377
19383
|
value = { [lastSegment]: value };
|
|
@@ -19557,8 +19563,8 @@ var ParseErrorCode;
|
|
|
19557
19563
|
ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
|
|
19558
19564
|
ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
19559
19565
|
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
19560
|
-
function modify(text2,
|
|
19561
|
-
return setProperty(text2,
|
|
19566
|
+
function modify(text2, path25, value, options) {
|
|
19567
|
+
return setProperty(text2, path25, value, options);
|
|
19562
19568
|
}
|
|
19563
19569
|
function applyEdits(text2, edits) {
|
|
19564
19570
|
let sortedEdits = edits.slice(0).sort((a3, b) => {
|
|
@@ -19582,21 +19588,21 @@ function applyEdits(text2, edits) {
|
|
|
19582
19588
|
}
|
|
19583
19589
|
|
|
19584
19590
|
// ../argent-installer/src/package-root.ts
|
|
19585
|
-
import * as
|
|
19586
|
-
import * as
|
|
19587
|
-
function resolvePackageRoot(
|
|
19588
|
-
let current =
|
|
19591
|
+
import * as fs10 from "node:fs";
|
|
19592
|
+
import * as path11 from "node:path";
|
|
19593
|
+
function resolvePackageRoot(dirname17) {
|
|
19594
|
+
let current = path11.resolve(dirname17);
|
|
19589
19595
|
while (true) {
|
|
19590
|
-
if (
|
|
19591
|
-
const parent =
|
|
19592
|
-
if (parent === current) return
|
|
19596
|
+
if (fs10.existsSync(path11.join(current, "package.json"))) return current;
|
|
19597
|
+
const parent = path11.dirname(current);
|
|
19598
|
+
if (parent === current) return path11.resolve(dirname17);
|
|
19593
19599
|
current = parent;
|
|
19594
19600
|
}
|
|
19595
19601
|
}
|
|
19596
19602
|
|
|
19597
19603
|
// ../argent-installer/src/package-manager.ts
|
|
19598
|
-
import * as
|
|
19599
|
-
import * as
|
|
19604
|
+
import * as fs11 from "node:fs";
|
|
19605
|
+
import * as path12 from "node:path";
|
|
19600
19606
|
function formatShellCommand(cmd) {
|
|
19601
19607
|
const parts = [cmd.bin, ...cmd.args.map((a3) => a3.includes(" ") ? `"${a3}"` : a3)];
|
|
19602
19608
|
return parts.join(" ");
|
|
@@ -19616,7 +19622,7 @@ function asKnownPm(name) {
|
|
|
19616
19622
|
}
|
|
19617
19623
|
function pmFromPackageManagerField(dir) {
|
|
19618
19624
|
try {
|
|
19619
|
-
const pkg = JSON.parse(
|
|
19625
|
+
const pkg = JSON.parse(fs11.readFileSync(path12.join(dir, "package.json"), "utf8"));
|
|
19620
19626
|
if (typeof pkg.packageManager === "string") {
|
|
19621
19627
|
return asKnownPm(pkg.packageManager.split("@")[0]);
|
|
19622
19628
|
}
|
|
@@ -19627,7 +19633,7 @@ function pmFromPackageManagerField(dir) {
|
|
|
19627
19633
|
}
|
|
19628
19634
|
function pmFromDevEngines(dir) {
|
|
19629
19635
|
try {
|
|
19630
|
-
const pkg = JSON.parse(
|
|
19636
|
+
const pkg = JSON.parse(fs11.readFileSync(path12.join(dir, "package.json"), "utf8"));
|
|
19631
19637
|
const devEnginesPm = pkg.devEngines?.packageManager;
|
|
19632
19638
|
const names = /* @__PURE__ */ new Set();
|
|
19633
19639
|
for (const entry of Array.isArray(devEnginesPm) ? devEnginesPm : [devEnginesPm]) {
|
|
@@ -19640,7 +19646,7 @@ function pmFromDevEngines(dir) {
|
|
|
19640
19646
|
}
|
|
19641
19647
|
}
|
|
19642
19648
|
function pmFromLockfile(dir) {
|
|
19643
|
-
const has = (file) =>
|
|
19649
|
+
const has = (file) => fs11.existsSync(path12.join(dir, file));
|
|
19644
19650
|
if (has("pnpm-lock.yaml")) return "pnpm";
|
|
19645
19651
|
if (has("yarn.lock")) return "yarn";
|
|
19646
19652
|
if (has("bun.lock") || has("bun.lockb")) return "bun";
|
|
@@ -19648,15 +19654,15 @@ function pmFromLockfile(dir) {
|
|
|
19648
19654
|
return null;
|
|
19649
19655
|
}
|
|
19650
19656
|
function pmFromWorkspaceMarker(dir) {
|
|
19651
|
-
return
|
|
19657
|
+
return fs11.existsSync(path12.join(dir, "pnpm-workspace.yaml")) ? "pnpm" : null;
|
|
19652
19658
|
}
|
|
19653
19659
|
function detectProjectPackageManager(projectRoot) {
|
|
19654
|
-
let dir =
|
|
19660
|
+
let dir = path12.resolve(projectRoot);
|
|
19655
19661
|
for (; ; ) {
|
|
19656
19662
|
const pm = pmFromPackageManagerField(dir) ?? pmFromLockfile(dir) ?? pmFromDevEngines(dir) ?? pmFromWorkspaceMarker(dir);
|
|
19657
19663
|
if (pm) return pm;
|
|
19658
|
-
if (
|
|
19659
|
-
const parent =
|
|
19664
|
+
if (fs11.existsSync(path12.join(dir, ".git"))) break;
|
|
19665
|
+
const parent = path12.dirname(dir);
|
|
19660
19666
|
if (parent === dir) break;
|
|
19661
19667
|
dir = parent;
|
|
19662
19668
|
}
|
|
@@ -19724,21 +19730,21 @@ function localUninstallCommand(pm, pkg) {
|
|
|
19724
19730
|
}
|
|
19725
19731
|
|
|
19726
19732
|
// ../argent-installer/src/preflight.ts
|
|
19727
|
-
import * as
|
|
19728
|
-
import * as
|
|
19733
|
+
import * as fs12 from "node:fs";
|
|
19734
|
+
import * as path13 from "node:path";
|
|
19729
19735
|
function hasProjectPackageJson(projectRoot) {
|
|
19730
|
-
return
|
|
19736
|
+
return fs12.existsSync(path13.join(projectRoot, "package.json"));
|
|
19731
19737
|
}
|
|
19732
19738
|
function isYarnPnp(projectRoot) {
|
|
19733
|
-
return
|
|
19739
|
+
return fs12.existsSync(path13.join(projectRoot, ".pnp.cjs")) || fs12.existsSync(path13.join(projectRoot, ".pnp.loader.mjs"));
|
|
19734
19740
|
}
|
|
19735
19741
|
|
|
19736
19742
|
// ../argent-installer/src/topology.ts
|
|
19737
19743
|
var import_semver2 = __toESM(require_semver2(), 1);
|
|
19738
|
-
import * as
|
|
19739
|
-
import * as
|
|
19744
|
+
import * as fs13 from "node:fs";
|
|
19745
|
+
import * as path14 from "node:path";
|
|
19740
19746
|
import { createRequire } from "node:module";
|
|
19741
|
-
import {
|
|
19747
|
+
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
19742
19748
|
var TEMP_RUNNER_MARKERS = [
|
|
19743
19749
|
"_npx",
|
|
19744
19750
|
"/dlx-",
|
|
@@ -19751,8 +19757,8 @@ function isTempRunnerPath(binaryPath) {
|
|
|
19751
19757
|
}
|
|
19752
19758
|
function getGlobalBinaryPath() {
|
|
19753
19759
|
try {
|
|
19754
|
-
const cmd = process.platform === "win32" ? "where" : "which -a";
|
|
19755
|
-
const output =
|
|
19760
|
+
const [cmd, args] = process.platform === "win32" ? ["where", [MCP_BINARY_NAME]] : ["which", ["-a", MCP_BINARY_NAME]];
|
|
19761
|
+
const output = execFileSync2(cmd, args, {
|
|
19756
19762
|
encoding: "utf8",
|
|
19757
19763
|
stdio: ["ignore", "pipe", "ignore"]
|
|
19758
19764
|
});
|
|
@@ -19768,9 +19774,9 @@ function getGloballyInstalledPackageRoot() {
|
|
|
19768
19774
|
const binaryPath = getGlobalBinaryPath();
|
|
19769
19775
|
if (!binaryPath) return null;
|
|
19770
19776
|
try {
|
|
19771
|
-
const realPath =
|
|
19772
|
-
const root = resolvePackageRoot(
|
|
19773
|
-
const pkg = JSON.parse(
|
|
19777
|
+
const realPath = fs13.realpathSync(binaryPath);
|
|
19778
|
+
const root = resolvePackageRoot(path14.dirname(realPath));
|
|
19779
|
+
const pkg = JSON.parse(fs13.readFileSync(path14.join(root, "package.json"), "utf8"));
|
|
19774
19780
|
return pkg.name === PACKAGE_NAME ? root : null;
|
|
19775
19781
|
} catch {
|
|
19776
19782
|
return null;
|
|
@@ -19780,7 +19786,7 @@ function getGloballyInstalledVersion() {
|
|
|
19780
19786
|
const pkgRoot = getGloballyInstalledPackageRoot();
|
|
19781
19787
|
if (!pkgRoot) return null;
|
|
19782
19788
|
try {
|
|
19783
|
-
const pkg = JSON.parse(
|
|
19789
|
+
const pkg = JSON.parse(fs13.readFileSync(path14.join(pkgRoot, "package.json"), "utf8"));
|
|
19784
19790
|
return pkg.version ?? null;
|
|
19785
19791
|
} catch {
|
|
19786
19792
|
return null;
|
|
@@ -19789,7 +19795,7 @@ function getGloballyInstalledVersion() {
|
|
|
19789
19795
|
function readManifestDeclaration(projectRoot) {
|
|
19790
19796
|
try {
|
|
19791
19797
|
const pkg = JSON.parse(
|
|
19792
|
-
|
|
19798
|
+
fs13.readFileSync(path14.join(projectRoot, "package.json"), "utf8")
|
|
19793
19799
|
);
|
|
19794
19800
|
const spec = pkg.devDependencies?.[PACKAGE_NAME] ?? pkg.dependencies?.[PACKAGE_NAME] ?? pkg.optionalDependencies?.[PACKAGE_NAME];
|
|
19795
19801
|
return typeof spec === "string" ? spec : null;
|
|
@@ -19802,11 +19808,11 @@ function isDeclaredLocally(projectRoot) {
|
|
|
19802
19808
|
}
|
|
19803
19809
|
function resolveLocalArgentDir(projectRoot) {
|
|
19804
19810
|
try {
|
|
19805
|
-
const req = createRequire(
|
|
19806
|
-
return
|
|
19811
|
+
const req = createRequire(path14.join(projectRoot, "package.json"));
|
|
19812
|
+
return path14.dirname(req.resolve(`${PACKAGE_NAME}/package.json`));
|
|
19807
19813
|
} catch {
|
|
19808
|
-
const plain =
|
|
19809
|
-
return
|
|
19814
|
+
const plain = path14.join(projectRoot, "node_modules", PACKAGE_NAME);
|
|
19815
|
+
return fs13.existsSync(path14.join(plain, "package.json")) ? plain : null;
|
|
19810
19816
|
}
|
|
19811
19817
|
}
|
|
19812
19818
|
function probeLocalInstall(projectRoot) {
|
|
@@ -19814,7 +19820,7 @@ function probeLocalInstall(projectRoot) {
|
|
|
19814
19820
|
if (packageDir) {
|
|
19815
19821
|
let version;
|
|
19816
19822
|
try {
|
|
19817
|
-
const pkg = JSON.parse(
|
|
19823
|
+
const pkg = JSON.parse(fs13.readFileSync(path14.join(packageDir, "package.json"), "utf8"));
|
|
19818
19824
|
version = pkg.version ?? null;
|
|
19819
19825
|
} catch {
|
|
19820
19826
|
version = null;
|
|
@@ -19837,8 +19843,8 @@ function getLocallyInstalledVersion(projectRoot) {
|
|
|
19837
19843
|
}
|
|
19838
19844
|
function readLocalPackageVersionUncached(projectRoot) {
|
|
19839
19845
|
try {
|
|
19840
|
-
const pkgPath =
|
|
19841
|
-
const pkg = JSON.parse(
|
|
19846
|
+
const pkgPath = path14.join(projectRoot, "node_modules", PACKAGE_NAME, "package.json");
|
|
19847
|
+
const pkg = JSON.parse(fs13.readFileSync(pkgPath, "utf8"));
|
|
19842
19848
|
return pkg.version ?? null;
|
|
19843
19849
|
} catch {
|
|
19844
19850
|
return null;
|
|
@@ -19846,7 +19852,7 @@ function readLocalPackageVersionUncached(projectRoot) {
|
|
|
19846
19852
|
}
|
|
19847
19853
|
function argentBinSubpath(pkgDir) {
|
|
19848
19854
|
try {
|
|
19849
|
-
const pkg = JSON.parse(
|
|
19855
|
+
const pkg = JSON.parse(fs13.readFileSync(path14.join(pkgDir, "package.json"), "utf8"));
|
|
19850
19856
|
if (typeof pkg.bin === "string") return pkg.bin;
|
|
19851
19857
|
if (pkg.bin && typeof pkg.bin === "object") {
|
|
19852
19858
|
return pkg.bin[MCP_BINARY_NAME] ?? Object.values(pkg.bin)[0] ?? null;
|
|
@@ -19863,28 +19869,28 @@ function getLocalArgentBinRelPath(projectRoot) {
|
|
|
19863
19869
|
if (!binSub) return null;
|
|
19864
19870
|
let root = projectRoot;
|
|
19865
19871
|
try {
|
|
19866
|
-
root =
|
|
19872
|
+
root = fs13.realpathSync(projectRoot);
|
|
19867
19873
|
} catch {
|
|
19868
19874
|
}
|
|
19869
|
-
const stableRel =
|
|
19870
|
-
if (
|
|
19871
|
-
return stableRel.split(
|
|
19875
|
+
const stableRel = path14.join("node_modules", PACKAGE_NAME, binSub);
|
|
19876
|
+
if (fs13.existsSync(path14.join(root, stableRel))) {
|
|
19877
|
+
return stableRel.split(path14.sep).join("/");
|
|
19872
19878
|
}
|
|
19873
|
-
const abs =
|
|
19874
|
-
if (!
|
|
19875
|
-
return
|
|
19879
|
+
const abs = path14.join(pkgDir, binSub);
|
|
19880
|
+
if (!fs13.existsSync(abs)) return null;
|
|
19881
|
+
return path14.relative(root, abs).split(path14.sep).join("/");
|
|
19876
19882
|
}
|
|
19877
19883
|
|
|
19878
19884
|
// ../argent-installer/src/install-record.ts
|
|
19879
|
-
import * as
|
|
19880
|
-
import * as
|
|
19885
|
+
import * as fs14 from "node:fs";
|
|
19886
|
+
import * as path15 from "node:path";
|
|
19881
19887
|
function getInstallRecordPath(projectRoot) {
|
|
19882
|
-
return
|
|
19888
|
+
return path15.join(projectRoot, ".argent", "install.json");
|
|
19883
19889
|
}
|
|
19884
19890
|
function readInstallRecord(projectRoot) {
|
|
19885
19891
|
try {
|
|
19886
19892
|
const parsed = JSON.parse(
|
|
19887
|
-
|
|
19893
|
+
fs14.readFileSync(getInstallRecordPath(projectRoot), "utf8")
|
|
19888
19894
|
);
|
|
19889
19895
|
if (parsed && (parsed.mode === "local" || parsed.mode === "global")) return parsed;
|
|
19890
19896
|
return null;
|
|
@@ -19894,17 +19900,17 @@ function readInstallRecord(projectRoot) {
|
|
|
19894
19900
|
}
|
|
19895
19901
|
function writeInstallRecord(projectRoot, record) {
|
|
19896
19902
|
const recordPath = getInstallRecordPath(projectRoot);
|
|
19897
|
-
|
|
19898
|
-
|
|
19903
|
+
fs14.mkdirSync(path15.dirname(recordPath), { recursive: true });
|
|
19904
|
+
fs14.writeFileSync(recordPath, JSON.stringify(record, null, 2) + "\n");
|
|
19899
19905
|
}
|
|
19900
19906
|
function removeInstallRecord(projectRoot) {
|
|
19901
19907
|
const recordPath = getInstallRecordPath(projectRoot);
|
|
19902
19908
|
try {
|
|
19903
|
-
if (!
|
|
19904
|
-
|
|
19905
|
-
const dir =
|
|
19909
|
+
if (!fs14.existsSync(recordPath)) return false;
|
|
19910
|
+
fs14.rmSync(recordPath, { force: true });
|
|
19911
|
+
const dir = path15.dirname(recordPath);
|
|
19906
19912
|
try {
|
|
19907
|
-
if (
|
|
19913
|
+
if (fs14.existsSync(dir) && fs14.readdirSync(dir).length === 0) fs14.rmdirSync(dir);
|
|
19908
19914
|
} catch {
|
|
19909
19915
|
}
|
|
19910
19916
|
return true;
|
|
@@ -19978,9 +19984,9 @@ async function promptInstallTargets(verb) {
|
|
|
19978
19984
|
// ../argent-installer/src/utils.ts
|
|
19979
19985
|
var PACKAGE_ROOT = resolvePackageRoot(import.meta.dirname);
|
|
19980
19986
|
function resolveBundledDir(dirName) {
|
|
19981
|
-
const packagedDir =
|
|
19982
|
-
if (
|
|
19983
|
-
return
|
|
19987
|
+
const packagedDir = path16.join(PACKAGE_ROOT, dirName);
|
|
19988
|
+
if (fs15.existsSync(packagedDir)) return packagedDir;
|
|
19989
|
+
return path16.resolve(PACKAGE_ROOT, "..", "skills", dirName);
|
|
19984
19990
|
}
|
|
19985
19991
|
var SKILLS_DIR = resolveBundledDir("skills");
|
|
19986
19992
|
var RULES_DIR = resolveBundledDir("rules");
|
|
@@ -19992,23 +19998,23 @@ function buildArgentSkillsSource(version) {
|
|
|
19992
19998
|
}
|
|
19993
19999
|
function listBundledSkills(skillsDir = SKILLS_DIR) {
|
|
19994
20000
|
try {
|
|
19995
|
-
return
|
|
20001
|
+
return fs15.readdirSync(skillsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).filter((name) => fs15.existsSync(path16.join(skillsDir, name, "SKILL.md"))).sort();
|
|
19996
20002
|
} catch {
|
|
19997
20003
|
return [];
|
|
19998
20004
|
}
|
|
19999
20005
|
}
|
|
20000
20006
|
function getProjectSkillLockPath(cwd = process.cwd()) {
|
|
20001
|
-
return
|
|
20007
|
+
return path16.join(cwd, "skills-lock.json");
|
|
20002
20008
|
}
|
|
20003
20009
|
function getGlobalSkillLockPath() {
|
|
20004
20010
|
const xdgStateHome = process.env.XDG_STATE_HOME;
|
|
20005
|
-
if (xdgStateHome) return
|
|
20006
|
-
return
|
|
20011
|
+
if (xdgStateHome) return path16.join(xdgStateHome, "skills", ".skill-lock.json");
|
|
20012
|
+
return path16.join(os2.homedir(), ".agents", ".skill-lock.json");
|
|
20007
20013
|
}
|
|
20008
20014
|
var ARGENT_SKILL_PREFIX = "argent-";
|
|
20009
20015
|
function listArgentSkillsInLock(lockPath) {
|
|
20010
20016
|
try {
|
|
20011
|
-
const raw =
|
|
20017
|
+
const raw = fs15.readFileSync(lockPath, "utf8");
|
|
20012
20018
|
const lock = JSON.parse(raw);
|
|
20013
20019
|
const tracked = lock.skills ?? {};
|
|
20014
20020
|
return Object.keys(tracked).filter((name) => name.startsWith(ARGENT_SKILL_PREFIX)).sort();
|
|
@@ -20032,16 +20038,16 @@ var PROJECT_ROOT_MARKERS = [
|
|
|
20032
20038
|
"skills-lock.json"
|
|
20033
20039
|
];
|
|
20034
20040
|
function resolveProjectRoot2(startDir) {
|
|
20035
|
-
const initialDir =
|
|
20041
|
+
const initialDir = path16.resolve(startDir);
|
|
20036
20042
|
let currentDir = initialDir;
|
|
20037
20043
|
while (true) {
|
|
20038
|
-
if (PROJECT_ROOT_MARKERS.some((marker) =>
|
|
20044
|
+
if (PROJECT_ROOT_MARKERS.some((marker) => fs15.existsSync(path16.join(currentDir, marker)))) {
|
|
20039
20045
|
return currentDir;
|
|
20040
20046
|
}
|
|
20041
|
-
if (
|
|
20047
|
+
if (fs15.existsSync(path16.join(currentDir, ".git"))) {
|
|
20042
20048
|
return currentDir;
|
|
20043
20049
|
}
|
|
20044
|
-
const parentDir =
|
|
20050
|
+
const parentDir = path16.dirname(currentDir);
|
|
20045
20051
|
if (parentDir === currentDir) {
|
|
20046
20052
|
return initialDir;
|
|
20047
20053
|
}
|
|
@@ -20049,20 +20055,20 @@ function resolveProjectRoot2(startDir) {
|
|
|
20049
20055
|
}
|
|
20050
20056
|
}
|
|
20051
20057
|
function readToml(filePath) {
|
|
20052
|
-
if (!
|
|
20058
|
+
if (!fs15.existsSync(filePath)) return {};
|
|
20053
20059
|
try {
|
|
20054
|
-
return parse(
|
|
20060
|
+
return parse(fs15.readFileSync(filePath, "utf8"));
|
|
20055
20061
|
} catch {
|
|
20056
20062
|
return {};
|
|
20057
20063
|
}
|
|
20058
20064
|
}
|
|
20059
20065
|
function writeToml(filePath, data) {
|
|
20060
|
-
|
|
20061
|
-
|
|
20066
|
+
fs15.mkdirSync(path16.dirname(filePath), { recursive: true });
|
|
20067
|
+
fs15.writeFileSync(filePath, stringify(data) + "\n");
|
|
20062
20068
|
}
|
|
20063
20069
|
function readYaml(filePath) {
|
|
20064
|
-
if (!
|
|
20065
|
-
const text2 =
|
|
20070
|
+
if (!fs15.existsSync(filePath)) return new import_yaml.Document({});
|
|
20071
|
+
const text2 = fs15.readFileSync(filePath, "utf8");
|
|
20066
20072
|
const doc = (0, import_yaml.parseDocument)(text2);
|
|
20067
20073
|
if (doc.errors.length > 0) {
|
|
20068
20074
|
const messages = doc.errors.map((e) => e.message).join("; ");
|
|
@@ -20071,20 +20077,20 @@ function readYaml(filePath) {
|
|
|
20071
20077
|
return doc;
|
|
20072
20078
|
}
|
|
20073
20079
|
function writeYaml(filePath, doc) {
|
|
20074
|
-
|
|
20075
|
-
|
|
20080
|
+
fs15.mkdirSync(path16.dirname(filePath), { recursive: true });
|
|
20081
|
+
fs15.writeFileSync(filePath, doc.toString({ lineWidth: 0 }));
|
|
20076
20082
|
}
|
|
20077
20083
|
function readJson(filePath) {
|
|
20078
|
-
if (!
|
|
20084
|
+
if (!fs15.existsSync(filePath)) return {};
|
|
20079
20085
|
try {
|
|
20080
|
-
return JSON.parse(
|
|
20086
|
+
return JSON.parse(fs15.readFileSync(filePath, "utf8"));
|
|
20081
20087
|
} catch {
|
|
20082
20088
|
return {};
|
|
20083
20089
|
}
|
|
20084
20090
|
}
|
|
20085
20091
|
function writeJson(filePath, data) {
|
|
20086
|
-
|
|
20087
|
-
|
|
20092
|
+
fs15.mkdirSync(path16.dirname(filePath), { recursive: true });
|
|
20093
|
+
fs15.writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n");
|
|
20088
20094
|
}
|
|
20089
20095
|
var JSONC_FORMATTING = { tabSize: 2, insertSpaces: true };
|
|
20090
20096
|
function setJsoncIn(text2, jsonPath, value) {
|
|
@@ -20092,8 +20098,8 @@ function setJsoncIn(text2, jsonPath, value) {
|
|
|
20092
20098
|
return applyEdits(text2, edits);
|
|
20093
20099
|
}
|
|
20094
20100
|
function readJsoncFileRaw(filePath) {
|
|
20095
|
-
if (!
|
|
20096
|
-
let text2 =
|
|
20101
|
+
if (!fs15.existsSync(filePath)) return { text: "{}", hadBom: false, wasEmpty: true };
|
|
20102
|
+
let text2 = fs15.readFileSync(filePath, "utf8");
|
|
20097
20103
|
const hadBom = text2.charCodeAt(0) === 65279;
|
|
20098
20104
|
if (hadBom) text2 = text2.slice(1);
|
|
20099
20105
|
const wasEmpty = text2.trim() === "";
|
|
@@ -20113,16 +20119,16 @@ function isEmptyPlainObject(value) {
|
|
|
20113
20119
|
}
|
|
20114
20120
|
function rmEmptyDir(dirPath) {
|
|
20115
20121
|
try {
|
|
20116
|
-
if (!
|
|
20117
|
-
if (!
|
|
20118
|
-
if (
|
|
20119
|
-
|
|
20122
|
+
if (!fs15.existsSync(dirPath)) return;
|
|
20123
|
+
if (!fs15.statSync(dirPath).isDirectory()) return;
|
|
20124
|
+
if (fs15.readdirSync(dirPath).length > 0) return;
|
|
20125
|
+
fs15.rmdirSync(dirPath);
|
|
20120
20126
|
} catch {
|
|
20121
20127
|
}
|
|
20122
20128
|
}
|
|
20123
20129
|
function readJsonc(filePath) {
|
|
20124
|
-
if (!
|
|
20125
|
-
let raw =
|
|
20130
|
+
if (!fs15.existsSync(filePath)) return {};
|
|
20131
|
+
let raw = fs15.readFileSync(filePath, "utf8");
|
|
20126
20132
|
if (raw.charCodeAt(0) === 65279) raw = raw.slice(1);
|
|
20127
20133
|
if (raw.trim() === "") return {};
|
|
20128
20134
|
const parsed = parse3(raw, [], { allowTrailingComma: true });
|
|
@@ -20141,18 +20147,18 @@ function editJsoncFile(filePath, jsonPath, value) {
|
|
|
20141
20147
|
}
|
|
20142
20148
|
const parsed = parse3(text2, [], { allowTrailingComma: true });
|
|
20143
20149
|
if (isEmptyPlainObject(parsed)) {
|
|
20144
|
-
|
|
20145
|
-
rmEmptyDir(
|
|
20150
|
+
fs15.rmSync(filePath, { force: true });
|
|
20151
|
+
rmEmptyDir(path16.dirname(filePath));
|
|
20146
20152
|
return;
|
|
20147
20153
|
}
|
|
20148
|
-
|
|
20154
|
+
fs15.mkdirSync(path16.dirname(filePath), { recursive: true });
|
|
20149
20155
|
const out = wasEmpty && !text2.endsWith("\n") ? text2 + "\n" : text2;
|
|
20150
|
-
|
|
20156
|
+
fs15.writeFileSync(filePath, (hadBom ? "\uFEFF" : "") + out);
|
|
20151
20157
|
}
|
|
20152
20158
|
var MAX_SYMLINK_HOPS = 40;
|
|
20153
20159
|
function realpathOrSelf(p) {
|
|
20154
20160
|
try {
|
|
20155
|
-
return
|
|
20161
|
+
return fs15.realpathSync(p);
|
|
20156
20162
|
} catch {
|
|
20157
20163
|
return p;
|
|
20158
20164
|
}
|
|
@@ -20162,13 +20168,13 @@ function resolveLinkedDestination(dest) {
|
|
|
20162
20168
|
for (let hop = 0; hop < MAX_SYMLINK_HOPS; hop++) {
|
|
20163
20169
|
let entry;
|
|
20164
20170
|
try {
|
|
20165
|
-
entry =
|
|
20171
|
+
entry = fs15.lstatSync(current);
|
|
20166
20172
|
} catch {
|
|
20167
|
-
return current === dest || dirExists(
|
|
20173
|
+
return current === dest || dirExists(path16.dirname(current)) ? current : dest;
|
|
20168
20174
|
}
|
|
20169
20175
|
if (!entry.isSymbolicLink()) return current;
|
|
20170
20176
|
try {
|
|
20171
|
-
current =
|
|
20177
|
+
current = path16.resolve(realpathOrSelf(path16.dirname(current)), fs15.readlinkSync(current));
|
|
20172
20178
|
} catch {
|
|
20173
20179
|
return dest;
|
|
20174
20180
|
}
|
|
@@ -20176,32 +20182,32 @@ function resolveLinkedDestination(dest) {
|
|
|
20176
20182
|
return dest;
|
|
20177
20183
|
}
|
|
20178
20184
|
function copyDir(src, dest) {
|
|
20179
|
-
if (!
|
|
20185
|
+
if (!fs15.existsSync(src)) return null;
|
|
20180
20186
|
const target = resolveLinkedDestination(dest);
|
|
20181
20187
|
copyTree(src, target);
|
|
20182
20188
|
return target;
|
|
20183
20189
|
}
|
|
20184
20190
|
function copyTree(src, dest) {
|
|
20185
|
-
const entries =
|
|
20186
|
-
|
|
20191
|
+
const entries = fs15.readdirSync(src, { withFileTypes: true });
|
|
20192
|
+
fs15.mkdirSync(dest, { recursive: true });
|
|
20187
20193
|
for (const entry of entries) {
|
|
20188
|
-
const from =
|
|
20189
|
-
const to = resolveLinkedDestination(
|
|
20194
|
+
const from = path16.join(src, entry.name);
|
|
20195
|
+
const to = resolveLinkedDestination(path16.join(dest, entry.name));
|
|
20190
20196
|
if (entry.isDirectory()) copyTree(from, to);
|
|
20191
|
-
else
|
|
20197
|
+
else fs15.copyFileSync(from, to);
|
|
20192
20198
|
}
|
|
20193
20199
|
}
|
|
20194
20200
|
function dirExists(p) {
|
|
20195
20201
|
try {
|
|
20196
|
-
return
|
|
20202
|
+
return fs15.statSync(p).isDirectory();
|
|
20197
20203
|
} catch {
|
|
20198
20204
|
return false;
|
|
20199
20205
|
}
|
|
20200
20206
|
}
|
|
20201
20207
|
function getInstalledVersion() {
|
|
20202
20208
|
try {
|
|
20203
|
-
const pkgPath =
|
|
20204
|
-
const pkg = JSON.parse(
|
|
20209
|
+
const pkgPath = path16.join(PACKAGE_ROOT, "package.json");
|
|
20210
|
+
const pkg = JSON.parse(fs15.readFileSync(pkgPath, "utf8"));
|
|
20205
20211
|
return pkg.version ?? null;
|
|
20206
20212
|
} catch {
|
|
20207
20213
|
return null;
|
|
@@ -20209,10 +20215,9 @@ function getInstalledVersion() {
|
|
|
20209
20215
|
}
|
|
20210
20216
|
var PROBE_TIMEOUT_MS = 3e3;
|
|
20211
20217
|
function getLatestVersion() {
|
|
20212
|
-
const
|
|
20213
|
-
|
|
20214
|
-
|
|
20215
|
-
});
|
|
20218
|
+
const args = ["view", PACKAGE_NAME, "version", "--registry", NPM_REGISTRY];
|
|
20219
|
+
const opts = { encoding: "utf8", timeout: PROBE_TIMEOUT_MS };
|
|
20220
|
+
const result = process.platform === "win32" ? execSync(["npm", ...args].join(" "), opts) : execFileSync3("npm", args, opts);
|
|
20216
20221
|
return result.trim();
|
|
20217
20222
|
}
|
|
20218
20223
|
function isNewerVersion(candidate, current) {
|
|
@@ -20224,7 +20229,7 @@ function withNpmForce(npxArgs) {
|
|
|
20224
20229
|
}
|
|
20225
20230
|
function isSkillsCliAvailable() {
|
|
20226
20231
|
try {
|
|
20227
|
-
|
|
20232
|
+
execSync("npx --force --no-install skills --version", {
|
|
20228
20233
|
stdio: ["ignore", "ignore", "ignore"],
|
|
20229
20234
|
timeout: PROBE_TIMEOUT_MS
|
|
20230
20235
|
});
|
|
@@ -20262,9 +20267,9 @@ function escapeStringRegexp(string) {
|
|
|
20262
20267
|
}
|
|
20263
20268
|
|
|
20264
20269
|
// ../argent-installer/src/mcp-configs.ts
|
|
20265
|
-
var TOOL_SERVER_BUNDLE =
|
|
20270
|
+
var TOOL_SERVER_BUNDLE = path17.join(import.meta.dirname, "tool-server.cjs");
|
|
20266
20271
|
function getAvailableToolIds() {
|
|
20267
|
-
const out =
|
|
20272
|
+
const out = execFileSync4("node", [TOOL_SERVER_BUNDLE, "-t"], { encoding: "utf8" });
|
|
20268
20273
|
const tools = JSON.parse(out);
|
|
20269
20274
|
return tools.map((t2) => t2.id);
|
|
20270
20275
|
}
|
|
@@ -20301,10 +20306,10 @@ function hasCustomizingEnv(entry) {
|
|
|
20301
20306
|
}
|
|
20302
20307
|
function removeDirIfEmpty(dirPath) {
|
|
20303
20308
|
try {
|
|
20304
|
-
if (!
|
|
20305
|
-
if (!
|
|
20306
|
-
if (
|
|
20307
|
-
|
|
20309
|
+
if (!fs16.existsSync(dirPath)) return;
|
|
20310
|
+
if (!fs16.statSync(dirPath).isDirectory()) return;
|
|
20311
|
+
if (fs16.readdirSync(dirPath).length > 0) return;
|
|
20312
|
+
fs16.rmdirSync(dirPath);
|
|
20308
20313
|
} catch {
|
|
20309
20314
|
}
|
|
20310
20315
|
}
|
|
@@ -20341,7 +20346,7 @@ function isArgentManagedEntry(entry) {
|
|
|
20341
20346
|
return args.length === 1 && args[0] === "mcp";
|
|
20342
20347
|
case "node": {
|
|
20343
20348
|
if (args.length !== 2 || args[1] !== "mcp" || !args[0]) return false;
|
|
20344
|
-
if (
|
|
20349
|
+
if (path17.isAbsolute(args[0])) return false;
|
|
20345
20350
|
const normalized = args[0].split("\\").join("/");
|
|
20346
20351
|
return normalized.includes(`node_modules/${PACKAGE_NAME}/`);
|
|
20347
20352
|
}
|
|
@@ -20355,8 +20360,8 @@ function isArgentManagedEntry(entry) {
|
|
|
20355
20360
|
}
|
|
20356
20361
|
function writeTomlOrRemove(filePath, data) {
|
|
20357
20362
|
if (Object.keys(data).length === 0) {
|
|
20358
|
-
|
|
20359
|
-
removeDirIfEmpty(
|
|
20363
|
+
fs16.rmSync(filePath, { force: true });
|
|
20364
|
+
removeDirIfEmpty(path17.dirname(filePath));
|
|
20360
20365
|
return;
|
|
20361
20366
|
}
|
|
20362
20367
|
writeToml(filePath, data);
|
|
@@ -20365,12 +20370,12 @@ function dirHasEditorEvidence(dir, looksArgentOnly) {
|
|
|
20365
20370
|
return dirExists(dir) && !looksArgentOnly(dir);
|
|
20366
20371
|
}
|
|
20367
20372
|
function fileHasEditorEvidence(filePath, looksArgentOnly) {
|
|
20368
|
-
return
|
|
20373
|
+
return fs16.existsSync(filePath) && !looksArgentOnly(filePath);
|
|
20369
20374
|
}
|
|
20370
20375
|
function parseJsoncStrict(filePath) {
|
|
20371
20376
|
let raw;
|
|
20372
20377
|
try {
|
|
20373
|
-
raw =
|
|
20378
|
+
raw = fs16.readFileSync(filePath, "utf8");
|
|
20374
20379
|
} catch {
|
|
20375
20380
|
return null;
|
|
20376
20381
|
}
|
|
@@ -20383,14 +20388,14 @@ function parseJsoncStrict(filePath) {
|
|
|
20383
20388
|
}
|
|
20384
20389
|
function parseTomlStrict(filePath) {
|
|
20385
20390
|
try {
|
|
20386
|
-
return parse(
|
|
20391
|
+
return parse(fs16.readFileSync(filePath, "utf8"));
|
|
20387
20392
|
} catch {
|
|
20388
20393
|
return null;
|
|
20389
20394
|
}
|
|
20390
20395
|
}
|
|
20391
20396
|
function parseYamlStrict(filePath) {
|
|
20392
20397
|
try {
|
|
20393
|
-
const parsed = (0, import_yaml2.parse)(
|
|
20398
|
+
const parsed = (0, import_yaml2.parse)(fs16.readFileSync(filePath, "utf8"));
|
|
20394
20399
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
20395
20400
|
return parsed;
|
|
20396
20401
|
} catch {
|
|
@@ -20413,7 +20418,7 @@ function bundledManagedNames(kind) {
|
|
|
20413
20418
|
if (cached2) return cached2;
|
|
20414
20419
|
let names;
|
|
20415
20420
|
try {
|
|
20416
|
-
names = new Set(
|
|
20421
|
+
names = new Set(fs16.readdirSync(kind === "rules" ? RULES_DIR : AGENTS_DIR));
|
|
20417
20422
|
} catch {
|
|
20418
20423
|
names = /* @__PURE__ */ new Set();
|
|
20419
20424
|
}
|
|
@@ -20423,7 +20428,7 @@ function bundledManagedNames(kind) {
|
|
|
20423
20428
|
function managedDirLooksArgentOnly(dir, kind) {
|
|
20424
20429
|
let entries;
|
|
20425
20430
|
try {
|
|
20426
|
-
entries =
|
|
20431
|
+
entries = fs16.readdirSync(dir);
|
|
20427
20432
|
} catch {
|
|
20428
20433
|
return false;
|
|
20429
20434
|
}
|
|
@@ -20435,13 +20440,13 @@ function managedDirLooksArgentOnly(dir, kind) {
|
|
|
20435
20440
|
function cursorDirLooksArgentOnly(dir) {
|
|
20436
20441
|
let entries;
|
|
20437
20442
|
try {
|
|
20438
|
-
entries =
|
|
20443
|
+
entries = fs16.readdirSync(dir);
|
|
20439
20444
|
} catch {
|
|
20440
20445
|
return false;
|
|
20441
20446
|
}
|
|
20442
20447
|
if (entries.length === 0) return false;
|
|
20443
20448
|
return entries.every((entry) => {
|
|
20444
|
-
const full =
|
|
20449
|
+
const full = path17.join(dir, entry);
|
|
20445
20450
|
if (entry === "mcp.json") {
|
|
20446
20451
|
return jsonLooksArgentServerOnly(full, "mcpServers");
|
|
20447
20452
|
}
|
|
@@ -20474,13 +20479,13 @@ function claudeSettingsLooksArgentOnly(filePath) {
|
|
|
20474
20479
|
function claudeDirLooksArgentOnly(dir) {
|
|
20475
20480
|
let entries;
|
|
20476
20481
|
try {
|
|
20477
|
-
entries =
|
|
20482
|
+
entries = fs16.readdirSync(dir);
|
|
20478
20483
|
} catch {
|
|
20479
20484
|
return false;
|
|
20480
20485
|
}
|
|
20481
20486
|
if (entries.length === 0) return false;
|
|
20482
20487
|
return entries.every((entry) => {
|
|
20483
|
-
const full =
|
|
20488
|
+
const full = path17.join(dir, entry);
|
|
20484
20489
|
if (entry === "settings.json") return claudeSettingsLooksArgentOnly(full);
|
|
20485
20490
|
if (entry === "rules" || entry === "agents" || entry === "skills") {
|
|
20486
20491
|
return managedDirLooksArgentOnly(full, entry);
|
|
@@ -20491,25 +20496,25 @@ function claudeDirLooksArgentOnly(dir) {
|
|
|
20491
20496
|
function vscodeDirLooksArgentOnly(dir) {
|
|
20492
20497
|
let entries;
|
|
20493
20498
|
try {
|
|
20494
|
-
entries =
|
|
20499
|
+
entries = fs16.readdirSync(dir);
|
|
20495
20500
|
} catch {
|
|
20496
20501
|
return false;
|
|
20497
20502
|
}
|
|
20498
20503
|
if (entries.length === 0) return false;
|
|
20499
20504
|
return entries.every(
|
|
20500
|
-
(entry) => entry === "mcp.json" && jsonLooksArgentServerOnly(
|
|
20505
|
+
(entry) => entry === "mcp.json" && jsonLooksArgentServerOnly(path17.join(dir, entry), "servers")
|
|
20501
20506
|
);
|
|
20502
20507
|
}
|
|
20503
20508
|
function windsurfDirLooksArgentOnly(dir) {
|
|
20504
20509
|
let entries;
|
|
20505
20510
|
try {
|
|
20506
|
-
entries =
|
|
20511
|
+
entries = fs16.readdirSync(dir);
|
|
20507
20512
|
} catch {
|
|
20508
20513
|
return false;
|
|
20509
20514
|
}
|
|
20510
20515
|
if (entries.length === 0) return false;
|
|
20511
20516
|
return entries.every(
|
|
20512
|
-
(entry) => entry === "mcp_config.json" && jsonLooksArgentServerOnly(
|
|
20517
|
+
(entry) => entry === "mcp_config.json" && jsonLooksArgentServerOnly(path17.join(dir, entry), "mcpServers")
|
|
20513
20518
|
);
|
|
20514
20519
|
}
|
|
20515
20520
|
function zedSettingsLooksArgentOnly(filePath) {
|
|
@@ -20540,25 +20545,25 @@ function zedSettingsLooksArgentOnly(filePath) {
|
|
|
20540
20545
|
function zedDirLooksArgentOnly(dir) {
|
|
20541
20546
|
let entries;
|
|
20542
20547
|
try {
|
|
20543
|
-
entries =
|
|
20548
|
+
entries = fs16.readdirSync(dir);
|
|
20544
20549
|
} catch {
|
|
20545
20550
|
return false;
|
|
20546
20551
|
}
|
|
20547
20552
|
if (entries.length === 0) return false;
|
|
20548
20553
|
return entries.every(
|
|
20549
|
-
(entry) => entry === "settings.json" && zedSettingsLooksArgentOnly(
|
|
20554
|
+
(entry) => entry === "settings.json" && zedSettingsLooksArgentOnly(path17.join(dir, entry))
|
|
20550
20555
|
);
|
|
20551
20556
|
}
|
|
20552
20557
|
function geminiDirLooksArgentOnly(dir) {
|
|
20553
20558
|
let entries;
|
|
20554
20559
|
try {
|
|
20555
|
-
entries =
|
|
20560
|
+
entries = fs16.readdirSync(dir);
|
|
20556
20561
|
} catch {
|
|
20557
20562
|
return false;
|
|
20558
20563
|
}
|
|
20559
20564
|
if (entries.length === 0) return false;
|
|
20560
20565
|
return entries.every((entry) => {
|
|
20561
|
-
const full =
|
|
20566
|
+
const full = path17.join(dir, entry);
|
|
20562
20567
|
if (entry === "settings.json") return jsonLooksArgentServerOnly(full, "mcpServers");
|
|
20563
20568
|
if (entry === "rules" || entry === "agents") return managedDirLooksArgentOnly(full, entry);
|
|
20564
20569
|
return false;
|
|
@@ -20577,48 +20582,48 @@ function hermesConfigLooksArgentOnly(filePath) {
|
|
|
20577
20582
|
function hermesDirLooksArgentOnly(dir) {
|
|
20578
20583
|
let entries;
|
|
20579
20584
|
try {
|
|
20580
|
-
entries =
|
|
20585
|
+
entries = fs16.readdirSync(dir);
|
|
20581
20586
|
} catch {
|
|
20582
20587
|
return false;
|
|
20583
20588
|
}
|
|
20584
20589
|
if (entries.length === 0) return false;
|
|
20585
20590
|
return entries.every(
|
|
20586
|
-
(entry) => entry === "config.yaml" && hermesConfigLooksArgentOnly(
|
|
20591
|
+
(entry) => entry === "config.yaml" && hermesConfigLooksArgentOnly(path17.join(dir, entry))
|
|
20587
20592
|
);
|
|
20588
20593
|
}
|
|
20589
20594
|
function kiroDirLooksArgentOnly(dir) {
|
|
20590
20595
|
let entries;
|
|
20591
20596
|
try {
|
|
20592
|
-
entries =
|
|
20597
|
+
entries = fs16.readdirSync(dir);
|
|
20593
20598
|
} catch {
|
|
20594
20599
|
return false;
|
|
20595
20600
|
}
|
|
20596
20601
|
if (entries.length === 0) return false;
|
|
20597
20602
|
return entries.every((entry) => {
|
|
20598
20603
|
if (entry !== "settings") return false;
|
|
20599
|
-
const settingsDir =
|
|
20604
|
+
const settingsDir = path17.join(dir, entry);
|
|
20600
20605
|
let settingsEntries;
|
|
20601
20606
|
try {
|
|
20602
|
-
settingsEntries =
|
|
20607
|
+
settingsEntries = fs16.readdirSync(settingsDir);
|
|
20603
20608
|
} catch {
|
|
20604
20609
|
return false;
|
|
20605
20610
|
}
|
|
20606
20611
|
if (settingsEntries.length === 0) return false;
|
|
20607
20612
|
return settingsEntries.every(
|
|
20608
|
-
(name) => name === "mcp.json" && jsonLooksArgentServerOnly(
|
|
20613
|
+
(name) => name === "mcp.json" && jsonLooksArgentServerOnly(path17.join(settingsDir, name), "mcpServers")
|
|
20609
20614
|
);
|
|
20610
20615
|
});
|
|
20611
20616
|
}
|
|
20612
20617
|
function codexDirLooksArgentOnly(dir) {
|
|
20613
20618
|
let entries;
|
|
20614
20619
|
try {
|
|
20615
|
-
entries =
|
|
20620
|
+
entries = fs16.readdirSync(dir);
|
|
20616
20621
|
} catch {
|
|
20617
20622
|
return false;
|
|
20618
20623
|
}
|
|
20619
20624
|
if (entries.length === 0) return false;
|
|
20620
20625
|
return entries.every((entry) => {
|
|
20621
|
-
const full =
|
|
20626
|
+
const full = path17.join(dir, entry);
|
|
20622
20627
|
if (entry === "config.toml") {
|
|
20623
20628
|
const config = parseTomlStrict(full);
|
|
20624
20629
|
if (config === null) return false;
|
|
@@ -20645,13 +20650,13 @@ function codexDirLooksArgentOnly(dir) {
|
|
|
20645
20650
|
var cursorAdapter = {
|
|
20646
20651
|
name: "Cursor",
|
|
20647
20652
|
detect() {
|
|
20648
|
-
return dirHasEditorEvidence(
|
|
20653
|
+
return dirHasEditorEvidence(path17.join(homedir4(), ".cursor"), cursorDirLooksArgentOnly) || dirHasEditorEvidence(path17.join(process.cwd(), ".cursor"), cursorDirLooksArgentOnly);
|
|
20649
20654
|
},
|
|
20650
20655
|
projectPath(root) {
|
|
20651
|
-
return
|
|
20656
|
+
return path17.join(root, ".cursor", "mcp.json");
|
|
20652
20657
|
},
|
|
20653
20658
|
globalPath() {
|
|
20654
|
-
return
|
|
20659
|
+
return path17.join(homedir4(), ".cursor", "mcp.json");
|
|
20655
20660
|
},
|
|
20656
20661
|
// Read and written as JSONC through readJsonc / editJsoncFile: path-targeted
|
|
20657
20662
|
// text edits that preserve user comments and foreign servers.
|
|
@@ -20663,7 +20668,7 @@ var cursorAdapter = {
|
|
|
20663
20668
|
});
|
|
20664
20669
|
},
|
|
20665
20670
|
remove(configPath) {
|
|
20666
|
-
if (!
|
|
20671
|
+
if (!fs16.existsSync(configPath)) return false;
|
|
20667
20672
|
const config = readJsonc(configPath);
|
|
20668
20673
|
const servers = config.mcpServers;
|
|
20669
20674
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -20671,7 +20676,7 @@ var cursorAdapter = {
|
|
|
20671
20676
|
return true;
|
|
20672
20677
|
},
|
|
20673
20678
|
getArgentEntry(configPath) {
|
|
20674
|
-
if (!
|
|
20679
|
+
if (!fs16.existsSync(configPath)) return null;
|
|
20675
20680
|
const config = readJsonc(configPath);
|
|
20676
20681
|
const servers = config.mcpServers;
|
|
20677
20682
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -20682,7 +20687,7 @@ var cursorAdapter = {
|
|
|
20682
20687
|
// The allowlist lives in a separate ~/.cursor/permissions.json that may carry
|
|
20683
20688
|
// the user's own rules, so edit that one key instead of rewriting the file.
|
|
20684
20689
|
addAllowlist() {
|
|
20685
|
-
const permPath =
|
|
20690
|
+
const permPath = path17.join(homedir4(), ".cursor", "permissions.json");
|
|
20686
20691
|
const config = readJsonc(permPath);
|
|
20687
20692
|
const list = Array.isArray(config.mcpAllowlist) ? config.mcpAllowlist : [];
|
|
20688
20693
|
if (list.includes(CURSOR_ALLOWLIST_PATTERN)) return;
|
|
@@ -20690,8 +20695,8 @@ var cursorAdapter = {
|
|
|
20690
20695
|
},
|
|
20691
20696
|
removeAllowlist(_root, scope) {
|
|
20692
20697
|
if (scope !== "global") return;
|
|
20693
|
-
const permPath =
|
|
20694
|
-
if (!
|
|
20698
|
+
const permPath = path17.join(homedir4(), ".cursor", "permissions.json");
|
|
20699
|
+
if (!fs16.existsSync(permPath)) return;
|
|
20695
20700
|
const config = readJsonc(permPath);
|
|
20696
20701
|
const list = Array.isArray(config.mcpAllowlist) ? config.mcpAllowlist : void 0;
|
|
20697
20702
|
if (!list || !list.includes(CURSOR_ALLOWLIST_PATTERN)) return;
|
|
@@ -20702,16 +20707,16 @@ var cursorAdapter = {
|
|
|
20702
20707
|
function claudeProjectKeysForRoot(projects, root) {
|
|
20703
20708
|
const canonical = (value) => {
|
|
20704
20709
|
try {
|
|
20705
|
-
return
|
|
20710
|
+
return fs16.realpathSync.native(value);
|
|
20706
20711
|
} catch {
|
|
20707
|
-
return
|
|
20712
|
+
return path17.resolve(value);
|
|
20708
20713
|
}
|
|
20709
20714
|
};
|
|
20710
20715
|
const target = canonical(root);
|
|
20711
20716
|
return Object.keys(projects).filter((key) => key === root || canonical(key) === target);
|
|
20712
20717
|
}
|
|
20713
20718
|
function claudeDisabledListFinding(settingsPath, label, projectConfined) {
|
|
20714
|
-
if (!
|
|
20719
|
+
if (!fs16.existsSync(settingsPath)) return null;
|
|
20715
20720
|
const disabled = readJson(settingsPath).disabledMcpjsonServers;
|
|
20716
20721
|
if (!Array.isArray(disabled) || !disabled.includes(MCP_SERVER_KEY)) return null;
|
|
20717
20722
|
return {
|
|
@@ -20739,13 +20744,13 @@ var claudeAdapter = {
|
|
|
20739
20744
|
name: "Claude Code",
|
|
20740
20745
|
detect() {
|
|
20741
20746
|
const mcpJsonArgentOnly = (p) => jsonLooksArgentServerOnly(p, "mcpServers");
|
|
20742
|
-
return fileHasEditorEvidence(
|
|
20747
|
+
return fileHasEditorEvidence(path17.join(process.cwd(), ".mcp.json"), mcpJsonArgentOnly) || fileHasEditorEvidence(path17.join(homedir4(), ".claude.json"), mcpJsonArgentOnly) || dirHasEditorEvidence(path17.join(process.cwd(), ".claude"), claudeDirLooksArgentOnly) || dirHasEditorEvidence(path17.join(homedir4(), ".claude"), claudeDirLooksArgentOnly);
|
|
20743
20748
|
},
|
|
20744
20749
|
projectPath(root) {
|
|
20745
|
-
return
|
|
20750
|
+
return path17.join(root, ".mcp.json");
|
|
20746
20751
|
},
|
|
20747
20752
|
globalPath() {
|
|
20748
|
-
return
|
|
20753
|
+
return path17.join(homedir4(), ".claude.json");
|
|
20749
20754
|
},
|
|
20750
20755
|
// JSONC is a superset of JSON, so this config shares the one comment- and
|
|
20751
20756
|
// foreign-server-preserving write path (see the Cursor adapter).
|
|
@@ -20758,7 +20763,7 @@ var claudeAdapter = {
|
|
|
20758
20763
|
});
|
|
20759
20764
|
},
|
|
20760
20765
|
remove(configPath) {
|
|
20761
|
-
if (!
|
|
20766
|
+
if (!fs16.existsSync(configPath)) return false;
|
|
20762
20767
|
const config = readJsonc(configPath);
|
|
20763
20768
|
const servers = config.mcpServers;
|
|
20764
20769
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -20772,7 +20777,7 @@ var claudeAdapter = {
|
|
|
20772
20777
|
return true;
|
|
20773
20778
|
},
|
|
20774
20779
|
getArgentEntry(configPath) {
|
|
20775
|
-
if (!
|
|
20780
|
+
if (!fs16.existsSync(configPath)) return null;
|
|
20776
20781
|
const config = readJsonc(configPath);
|
|
20777
20782
|
const servers = config.mcpServers;
|
|
20778
20783
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -20785,7 +20790,7 @@ var claudeAdapter = {
|
|
|
20785
20790
|
// .mcp.json rejections (see claudeDisabledListFinding).
|
|
20786
20791
|
findShadowingConfigs(root, writtenScope) {
|
|
20787
20792
|
const findings = [];
|
|
20788
|
-
const claudeJsonPath =
|
|
20793
|
+
const claudeJsonPath = path17.join(homedir4(), ".claude.json");
|
|
20789
20794
|
const projects = readJson(claudeJsonPath).projects;
|
|
20790
20795
|
if (isRecord(projects)) {
|
|
20791
20796
|
for (const key of claudeProjectKeysForRoot(projects, root)) {
|
|
@@ -20822,9 +20827,9 @@ var claudeAdapter = {
|
|
|
20822
20827
|
}
|
|
20823
20828
|
if (writtenScope === "local") {
|
|
20824
20829
|
const candidates = [
|
|
20825
|
-
[
|
|
20826
|
-
[
|
|
20827
|
-
[
|
|
20830
|
+
[path17.join(root, ".claude", "settings.json"), ".claude/settings.json", true],
|
|
20831
|
+
[path17.join(root, ".claude", "settings.local.json"), ".claude/settings.local.json", true],
|
|
20832
|
+
[path17.join(homedir4(), ".claude", "settings.json"), "~/.claude/settings.json", false]
|
|
20828
20833
|
];
|
|
20829
20834
|
for (const [settingsPath, label, projectConfined] of candidates) {
|
|
20830
20835
|
const finding = claudeDisabledListFinding(settingsPath, label, projectConfined);
|
|
@@ -20843,10 +20848,10 @@ var claudeAdapter = {
|
|
|
20843
20848
|
var vscodeAdapter = {
|
|
20844
20849
|
name: "VS Code",
|
|
20845
20850
|
detect() {
|
|
20846
|
-
return dirHasEditorEvidence(
|
|
20851
|
+
return dirHasEditorEvidence(path17.join(process.cwd(), ".vscode"), vscodeDirLooksArgentOnly) || dirExists(path17.join(homedir4(), ".vscode"));
|
|
20847
20852
|
},
|
|
20848
20853
|
projectPath(root) {
|
|
20849
|
-
return
|
|
20854
|
+
return path17.join(root, ".vscode", "mcp.json");
|
|
20850
20855
|
},
|
|
20851
20856
|
globalPath() {
|
|
20852
20857
|
return null;
|
|
@@ -20862,7 +20867,7 @@ var vscodeAdapter = {
|
|
|
20862
20867
|
});
|
|
20863
20868
|
},
|
|
20864
20869
|
remove(configPath) {
|
|
20865
|
-
if (!
|
|
20870
|
+
if (!fs16.existsSync(configPath)) return false;
|
|
20866
20871
|
const config = readJsonc(configPath);
|
|
20867
20872
|
const servers = config.servers;
|
|
20868
20873
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -20870,7 +20875,7 @@ var vscodeAdapter = {
|
|
|
20870
20875
|
return true;
|
|
20871
20876
|
},
|
|
20872
20877
|
getArgentEntry(configPath) {
|
|
20873
|
-
if (!
|
|
20878
|
+
if (!fs16.existsSync(configPath)) return null;
|
|
20874
20879
|
const config = readJsonc(configPath);
|
|
20875
20880
|
const servers = config.servers;
|
|
20876
20881
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -20883,7 +20888,7 @@ var vscodeAdapter = {
|
|
|
20883
20888
|
findShadowingConfigs(_root, _writtenScope) {
|
|
20884
20889
|
const findings = [];
|
|
20885
20890
|
for (const userDir of vscodeUserDirs()) {
|
|
20886
|
-
const configPath =
|
|
20891
|
+
const configPath = path17.join(userDir, "mcp.json");
|
|
20887
20892
|
const entry = this.getArgentEntry(configPath);
|
|
20888
20893
|
if (!entry) continue;
|
|
20889
20894
|
findings.push({
|
|
@@ -20900,16 +20905,16 @@ var vscodeAdapter = {
|
|
|
20900
20905
|
function vscodeUserDirs() {
|
|
20901
20906
|
const bases = [];
|
|
20902
20907
|
if (process.platform === "darwin") {
|
|
20903
|
-
bases.push(
|
|
20908
|
+
bases.push(path17.join(homedir4(), "Library", "Application Support"));
|
|
20904
20909
|
} else if (process.platform === "win32") {
|
|
20905
20910
|
if (process.env.APPDATA) bases.push(process.env.APPDATA);
|
|
20906
20911
|
} else {
|
|
20907
|
-
bases.push(
|
|
20912
|
+
bases.push(path17.join(homedir4(), ".config"));
|
|
20908
20913
|
}
|
|
20909
20914
|
const dirs = [];
|
|
20910
20915
|
for (const base of bases) {
|
|
20911
20916
|
for (const product of ["Code", "Code - Insiders"]) {
|
|
20912
|
-
const dir =
|
|
20917
|
+
const dir = path17.join(base, product, "User");
|
|
20913
20918
|
if (dirExists(dir)) dirs.push(dir);
|
|
20914
20919
|
}
|
|
20915
20920
|
}
|
|
@@ -20919,7 +20924,7 @@ var windsurfAdapter = {
|
|
|
20919
20924
|
name: "Windsurf",
|
|
20920
20925
|
detect() {
|
|
20921
20926
|
return dirHasEditorEvidence(
|
|
20922
|
-
|
|
20927
|
+
path17.join(homedir4(), ".codeium", "windsurf"),
|
|
20923
20928
|
windsurfDirLooksArgentOnly
|
|
20924
20929
|
);
|
|
20925
20930
|
},
|
|
@@ -20927,7 +20932,7 @@ var windsurfAdapter = {
|
|
|
20927
20932
|
return null;
|
|
20928
20933
|
},
|
|
20929
20934
|
globalPath() {
|
|
20930
|
-
return
|
|
20935
|
+
return path17.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
|
|
20931
20936
|
},
|
|
20932
20937
|
// JSONC-safe writes (see the Cursor adapter).
|
|
20933
20938
|
write(configPath, entry) {
|
|
@@ -20938,7 +20943,7 @@ var windsurfAdapter = {
|
|
|
20938
20943
|
});
|
|
20939
20944
|
},
|
|
20940
20945
|
remove(configPath) {
|
|
20941
|
-
if (!
|
|
20946
|
+
if (!fs16.existsSync(configPath)) return false;
|
|
20942
20947
|
const config = readJsonc(configPath);
|
|
20943
20948
|
const servers = config.mcpServers;
|
|
20944
20949
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -20946,7 +20951,7 @@ var windsurfAdapter = {
|
|
|
20946
20951
|
return true;
|
|
20947
20952
|
},
|
|
20948
20953
|
getArgentEntry(configPath) {
|
|
20949
|
-
if (!
|
|
20954
|
+
if (!fs16.existsSync(configPath)) return null;
|
|
20950
20955
|
const config = readJsonc(configPath);
|
|
20951
20956
|
const servers = config.mcpServers;
|
|
20952
20957
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -20957,7 +20962,7 @@ var windsurfAdapter = {
|
|
|
20957
20962
|
// Targets just the argent entry's alwaysAllow key, so comments and foreign
|
|
20958
20963
|
// servers survive.
|
|
20959
20964
|
addAllowlist() {
|
|
20960
|
-
const configPath =
|
|
20965
|
+
const configPath = path17.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
|
|
20961
20966
|
const config = readJsonc(configPath);
|
|
20962
20967
|
const servers = config.mcpServers;
|
|
20963
20968
|
if (!servers?.[MCP_SERVER_KEY]) return;
|
|
@@ -20965,8 +20970,8 @@ var windsurfAdapter = {
|
|
|
20965
20970
|
},
|
|
20966
20971
|
removeAllowlist(_root, scope) {
|
|
20967
20972
|
if (scope !== "global") return;
|
|
20968
|
-
const configPath =
|
|
20969
|
-
if (!
|
|
20973
|
+
const configPath = path17.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
|
|
20974
|
+
if (!fs16.existsSync(configPath)) return;
|
|
20970
20975
|
const config = readJsonc(configPath);
|
|
20971
20976
|
const servers = config.mcpServers;
|
|
20972
20977
|
const entry = servers?.[MCP_SERVER_KEY];
|
|
@@ -20977,13 +20982,13 @@ var windsurfAdapter = {
|
|
|
20977
20982
|
var zedAdapter = {
|
|
20978
20983
|
name: "Zed",
|
|
20979
20984
|
detect() {
|
|
20980
|
-
return dirHasEditorEvidence(
|
|
20985
|
+
return dirHasEditorEvidence(path17.join(homedir4(), ".config", "zed"), zedDirLooksArgentOnly);
|
|
20981
20986
|
},
|
|
20982
20987
|
projectPath(root) {
|
|
20983
|
-
return
|
|
20988
|
+
return path17.join(root, ".zed", "settings.json");
|
|
20984
20989
|
},
|
|
20985
20990
|
globalPath() {
|
|
20986
|
-
return
|
|
20991
|
+
return path17.join(homedir4(), ".config", "zed", "settings.json");
|
|
20987
20992
|
},
|
|
20988
20993
|
// Read and written as JSONC through readJsonc / editJsoncFile so comments and
|
|
20989
20994
|
// formatting outside the touched key survive (see the Cursor adapter).
|
|
@@ -20996,7 +21001,7 @@ var zedAdapter = {
|
|
|
20996
21001
|
});
|
|
20997
21002
|
},
|
|
20998
21003
|
remove(configPath) {
|
|
20999
|
-
if (!
|
|
21004
|
+
if (!fs16.existsSync(configPath)) return false;
|
|
21000
21005
|
const config = readJsonc(configPath);
|
|
21001
21006
|
const servers = config.context_servers;
|
|
21002
21007
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -21004,7 +21009,7 @@ var zedAdapter = {
|
|
|
21004
21009
|
return true;
|
|
21005
21010
|
},
|
|
21006
21011
|
getArgentEntry(configPath) {
|
|
21007
|
-
if (!
|
|
21012
|
+
if (!fs16.existsSync(configPath)) return null;
|
|
21008
21013
|
const config = readJsonc(configPath);
|
|
21009
21014
|
const servers = config.context_servers;
|
|
21010
21015
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -21015,12 +21020,12 @@ var zedAdapter = {
|
|
|
21015
21020
|
// Zed has no server-level wildcard for MCP tools — each tool would need its
|
|
21016
21021
|
// own entry — so the global default is set to "allow" instead.
|
|
21017
21022
|
addAllowlist(root, scope) {
|
|
21018
|
-
const settingsPath = scope === "global" ?
|
|
21023
|
+
const settingsPath = scope === "global" ? path17.join(homedir4(), ".config", "zed", "settings.json") : path17.join(root, ".zed", "settings.json");
|
|
21019
21024
|
editJsoncFile(settingsPath, ["agent", "tool_permissions", "default"], "allow");
|
|
21020
21025
|
},
|
|
21021
21026
|
removeAllowlist(root, scope) {
|
|
21022
|
-
const settingsPath = scope === "global" ?
|
|
21023
|
-
if (!
|
|
21027
|
+
const settingsPath = scope === "global" ? path17.join(homedir4(), ".config", "zed", "settings.json") : path17.join(root, ".zed", "settings.json");
|
|
21028
|
+
if (!fs16.existsSync(settingsPath)) return;
|
|
21024
21029
|
const config = readJsonc(settingsPath);
|
|
21025
21030
|
const perms = config.agent?.tool_permissions;
|
|
21026
21031
|
if (!perms || perms.default !== "allow") return;
|
|
@@ -21030,13 +21035,13 @@ var zedAdapter = {
|
|
|
21030
21035
|
var geminiAdapter = {
|
|
21031
21036
|
name: "Gemini",
|
|
21032
21037
|
detect() {
|
|
21033
|
-
return dirHasEditorEvidence(
|
|
21038
|
+
return dirHasEditorEvidence(path17.join(homedir4(), ".gemini"), geminiDirLooksArgentOnly) || dirHasEditorEvidence(path17.join(process.cwd(), ".gemini"), geminiDirLooksArgentOnly);
|
|
21034
21039
|
},
|
|
21035
21040
|
projectPath(root) {
|
|
21036
|
-
return
|
|
21041
|
+
return path17.join(root, ".gemini", "settings.json");
|
|
21037
21042
|
},
|
|
21038
21043
|
globalPath() {
|
|
21039
|
-
return
|
|
21044
|
+
return path17.join(homedir4(), ".gemini", "settings.json");
|
|
21040
21045
|
},
|
|
21041
21046
|
// JSONC-safe writes (see the Cursor adapter).
|
|
21042
21047
|
write(configPath, entry) {
|
|
@@ -21047,7 +21052,7 @@ var geminiAdapter = {
|
|
|
21047
21052
|
});
|
|
21048
21053
|
},
|
|
21049
21054
|
remove(configPath) {
|
|
21050
|
-
if (!
|
|
21055
|
+
if (!fs16.existsSync(configPath)) return false;
|
|
21051
21056
|
const config = readJsonc(configPath);
|
|
21052
21057
|
const servers = config.mcpServers;
|
|
21053
21058
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -21055,7 +21060,7 @@ var geminiAdapter = {
|
|
|
21055
21060
|
return true;
|
|
21056
21061
|
},
|
|
21057
21062
|
getArgentEntry(configPath) {
|
|
21058
|
-
if (!
|
|
21063
|
+
if (!fs16.existsSync(configPath)) return null;
|
|
21059
21064
|
const config = readJsonc(configPath);
|
|
21060
21065
|
const servers = config.mcpServers;
|
|
21061
21066
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -21077,7 +21082,7 @@ var geminiAdapter = {
|
|
|
21077
21082
|
},
|
|
21078
21083
|
removeAllowlist(root, scope) {
|
|
21079
21084
|
const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
|
|
21080
|
-
if (!configPath || !
|
|
21085
|
+
if (!configPath || !fs16.existsSync(configPath)) {
|
|
21081
21086
|
return;
|
|
21082
21087
|
}
|
|
21083
21088
|
const config = readJsonc(configPath);
|
|
@@ -21091,13 +21096,13 @@ var CODEX_FILENAME = ".codex";
|
|
|
21091
21096
|
var codexAdapter = {
|
|
21092
21097
|
name: "Codex",
|
|
21093
21098
|
detect() {
|
|
21094
|
-
return dirHasEditorEvidence(
|
|
21099
|
+
return dirHasEditorEvidence(path17.join(homedir4(), CODEX_FILENAME), codexDirLooksArgentOnly) || dirHasEditorEvidence(path17.join(process.cwd(), CODEX_FILENAME), codexDirLooksArgentOnly);
|
|
21095
21100
|
},
|
|
21096
21101
|
projectPath(root) {
|
|
21097
|
-
return
|
|
21102
|
+
return path17.join(root, CODEX_FILENAME, "config.toml");
|
|
21098
21103
|
},
|
|
21099
21104
|
globalPath() {
|
|
21100
|
-
return
|
|
21105
|
+
return path17.join(homedir4(), CODEX_FILENAME, "config.toml");
|
|
21101
21106
|
},
|
|
21102
21107
|
write(configPath, entry) {
|
|
21103
21108
|
const config = readToml(configPath);
|
|
@@ -21111,7 +21116,7 @@ var codexAdapter = {
|
|
|
21111
21116
|
writeToml(configPath, config);
|
|
21112
21117
|
},
|
|
21113
21118
|
remove(configPath) {
|
|
21114
|
-
if (!
|
|
21119
|
+
if (!fs16.existsSync(configPath)) return false;
|
|
21115
21120
|
const config = readToml(configPath);
|
|
21116
21121
|
const servers = config.mcp_servers;
|
|
21117
21122
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -21121,7 +21126,7 @@ var codexAdapter = {
|
|
|
21121
21126
|
return true;
|
|
21122
21127
|
},
|
|
21123
21128
|
getArgentEntry(configPath) {
|
|
21124
|
-
if (!
|
|
21129
|
+
if (!fs16.existsSync(configPath)) return null;
|
|
21125
21130
|
const config = readToml(configPath);
|
|
21126
21131
|
const servers = config.mcp_servers;
|
|
21127
21132
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -21169,13 +21174,13 @@ var codexAdapter = {
|
|
|
21169
21174
|
var hermesAdapter = {
|
|
21170
21175
|
name: "Hermes",
|
|
21171
21176
|
detect() {
|
|
21172
|
-
return dirHasEditorEvidence(
|
|
21177
|
+
return dirHasEditorEvidence(path17.join(homedir4(), ".hermes"), hermesDirLooksArgentOnly);
|
|
21173
21178
|
},
|
|
21174
21179
|
projectPath() {
|
|
21175
21180
|
return null;
|
|
21176
21181
|
},
|
|
21177
21182
|
globalPath() {
|
|
21178
|
-
return
|
|
21183
|
+
return path17.join(homedir4(), ".hermes", "config.yaml");
|
|
21179
21184
|
},
|
|
21180
21185
|
write(configPath, entry) {
|
|
21181
21186
|
const doc = readYaml(configPath);
|
|
@@ -21194,7 +21199,7 @@ var hermesAdapter = {
|
|
|
21194
21199
|
writeYaml(configPath, doc);
|
|
21195
21200
|
},
|
|
21196
21201
|
remove(configPath) {
|
|
21197
|
-
if (!
|
|
21202
|
+
if (!fs16.existsSync(configPath)) return false;
|
|
21198
21203
|
const doc = readYaml(configPath);
|
|
21199
21204
|
const servers = doc.get("mcp_servers");
|
|
21200
21205
|
if (!(0, import_yaml2.isMap)(servers)) return false;
|
|
@@ -21207,7 +21212,7 @@ var hermesAdapter = {
|
|
|
21207
21212
|
return true;
|
|
21208
21213
|
},
|
|
21209
21214
|
getArgentEntry(configPath) {
|
|
21210
|
-
if (!
|
|
21215
|
+
if (!fs16.existsSync(configPath)) return null;
|
|
21211
21216
|
const doc = readYaml(configPath);
|
|
21212
21217
|
const servers = doc.get("mcp_servers");
|
|
21213
21218
|
if (!(0, import_yaml2.isMap)(servers)) return null;
|
|
@@ -21226,7 +21231,7 @@ var OPENCODE_GLOBAL_FILES = ["opencode.jsonc", "opencode.json", "config.json"];
|
|
|
21226
21231
|
function hasOpenCodeBinary() {
|
|
21227
21232
|
try {
|
|
21228
21233
|
const cmd = process.platform === "win32" ? "where" : "which";
|
|
21229
|
-
|
|
21234
|
+
execFileSync4(cmd, [OPENCODE_BINARY], { stdio: ["ignore", "ignore", "ignore"] });
|
|
21230
21235
|
return true;
|
|
21231
21236
|
} catch {
|
|
21232
21237
|
return false;
|
|
@@ -21234,10 +21239,10 @@ function hasOpenCodeBinary() {
|
|
|
21234
21239
|
}
|
|
21235
21240
|
function pickOpencodeConfig(dir, candidates) {
|
|
21236
21241
|
for (const name of candidates) {
|
|
21237
|
-
const candidate =
|
|
21238
|
-
if (
|
|
21242
|
+
const candidate = path17.join(dir, name);
|
|
21243
|
+
if (fs16.existsSync(candidate)) return candidate;
|
|
21239
21244
|
}
|
|
21240
|
-
return
|
|
21245
|
+
return path17.join(dir, "opencode.json");
|
|
21241
21246
|
}
|
|
21242
21247
|
var openCodeAdapter = {
|
|
21243
21248
|
name: "opencode",
|
|
@@ -21248,7 +21253,7 @@ var openCodeAdapter = {
|
|
|
21248
21253
|
return pickOpencodeConfig(root, OPENCODE_PROJECT_FILES);
|
|
21249
21254
|
},
|
|
21250
21255
|
globalPath() {
|
|
21251
|
-
return pickOpencodeConfig(
|
|
21256
|
+
return pickOpencodeConfig(path17.join(homedir4(), ".config", "opencode"), OPENCODE_GLOBAL_FILES);
|
|
21252
21257
|
},
|
|
21253
21258
|
write(configPath, entry) {
|
|
21254
21259
|
editJsoncFile(configPath, ["mcp", MCP_SERVER_KEY], {
|
|
@@ -21259,7 +21264,7 @@ var openCodeAdapter = {
|
|
|
21259
21264
|
});
|
|
21260
21265
|
},
|
|
21261
21266
|
remove(configPath) {
|
|
21262
|
-
if (!
|
|
21267
|
+
if (!fs16.existsSync(configPath)) return false;
|
|
21263
21268
|
const config = readJsonc(configPath);
|
|
21264
21269
|
const servers = config.mcp;
|
|
21265
21270
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -21267,7 +21272,7 @@ var openCodeAdapter = {
|
|
|
21267
21272
|
return true;
|
|
21268
21273
|
},
|
|
21269
21274
|
getArgentEntry(configPath) {
|
|
21270
|
-
if (!
|
|
21275
|
+
if (!fs16.existsSync(configPath)) return null;
|
|
21271
21276
|
const config = readJsonc(configPath);
|
|
21272
21277
|
const servers = config.mcp;
|
|
21273
21278
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -21282,7 +21287,7 @@ var openCodeAdapter = {
|
|
|
21282
21287
|
},
|
|
21283
21288
|
removeAllowlist(root, scope) {
|
|
21284
21289
|
const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
|
|
21285
|
-
if (!configPath || !
|
|
21290
|
+
if (!configPath || !fs16.existsSync(configPath)) return;
|
|
21286
21291
|
const config = readJsonc(configPath);
|
|
21287
21292
|
const tools = config.tools;
|
|
21288
21293
|
if (!tools || !(OPENCODE_ALLOWLIST_PATTERN in tools)) return;
|
|
@@ -21293,13 +21298,13 @@ var KIRO_AUTO_APPROVE_ALL = ["*"];
|
|
|
21293
21298
|
var kiroAdapter = {
|
|
21294
21299
|
name: "Kiro",
|
|
21295
21300
|
detect() {
|
|
21296
|
-
return dirHasEditorEvidence(
|
|
21301
|
+
return dirHasEditorEvidence(path17.join(homedir4(), ".kiro"), kiroDirLooksArgentOnly) || dirHasEditorEvidence(path17.join(process.cwd(), ".kiro"), kiroDirLooksArgentOnly);
|
|
21297
21302
|
},
|
|
21298
21303
|
projectPath(root) {
|
|
21299
|
-
return
|
|
21304
|
+
return path17.join(root, ".kiro", "settings", "mcp.json");
|
|
21300
21305
|
},
|
|
21301
21306
|
globalPath() {
|
|
21302
|
-
return
|
|
21307
|
+
return path17.join(homedir4(), ".kiro", "settings", "mcp.json");
|
|
21303
21308
|
},
|
|
21304
21309
|
// Read and written as JSONC through readJsonc / editJsoncFile so comments and
|
|
21305
21310
|
// foreign servers survive (see the Cursor adapter).
|
|
@@ -21311,7 +21316,7 @@ var kiroAdapter = {
|
|
|
21311
21316
|
});
|
|
21312
21317
|
},
|
|
21313
21318
|
remove(configPath) {
|
|
21314
|
-
if (!
|
|
21319
|
+
if (!fs16.existsSync(configPath)) return false;
|
|
21315
21320
|
const config = readJsonc(configPath);
|
|
21316
21321
|
const servers = config.mcpServers;
|
|
21317
21322
|
if (!servers?.[MCP_SERVER_KEY]) return false;
|
|
@@ -21319,7 +21324,7 @@ var kiroAdapter = {
|
|
|
21319
21324
|
return true;
|
|
21320
21325
|
},
|
|
21321
21326
|
getArgentEntry(configPath) {
|
|
21322
|
-
if (!
|
|
21327
|
+
if (!fs16.existsSync(configPath)) return null;
|
|
21323
21328
|
const config = readJsonc(configPath);
|
|
21324
21329
|
const servers = config.mcpServers;
|
|
21325
21330
|
return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
|
|
@@ -21343,7 +21348,7 @@ var kiroAdapter = {
|
|
|
21343
21348
|
},
|
|
21344
21349
|
removeAllowlist(root, scope) {
|
|
21345
21350
|
const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
|
|
21346
|
-
if (!configPath || !
|
|
21351
|
+
if (!configPath || !fs16.existsSync(configPath)) return;
|
|
21347
21352
|
const config = readJsonc(configPath);
|
|
21348
21353
|
const servers = config.mcpServers;
|
|
21349
21354
|
const entry = servers?.[MCP_SERVER_KEY];
|
|
@@ -21388,7 +21393,7 @@ function findConfiguredAdapterScopes(adapters, projectRoot) {
|
|
|
21388
21393
|
return results;
|
|
21389
21394
|
}
|
|
21390
21395
|
function addClaudePermission(root, scope) {
|
|
21391
|
-
const settingsPath = scope === "global" ?
|
|
21396
|
+
const settingsPath = scope === "global" ? path17.join(homedir4(), ".claude", "settings.json") : path17.join(root, ".claude", "settings.json");
|
|
21392
21397
|
const config = readJsonc(settingsPath);
|
|
21393
21398
|
const permissions = config.permissions ?? {};
|
|
21394
21399
|
const allow = Array.isArray(permissions.allow) ? permissions.allow : [];
|
|
@@ -21396,8 +21401,8 @@ function addClaudePermission(root, scope) {
|
|
|
21396
21401
|
editJsoncFile(settingsPath, ["permissions", "allow"], [...allow, PERMISSION_RULE]);
|
|
21397
21402
|
}
|
|
21398
21403
|
function removeClaudePermission(root, scope) {
|
|
21399
|
-
const settingsPath = scope === "global" ?
|
|
21400
|
-
if (!
|
|
21404
|
+
const settingsPath = scope === "global" ? path17.join(homedir4(), ".claude", "settings.json") : path17.join(root, ".claude", "settings.json");
|
|
21405
|
+
if (!fs16.existsSync(settingsPath)) return;
|
|
21401
21406
|
const config = readJsonc(settingsPath);
|
|
21402
21407
|
const permissions = config?.permissions;
|
|
21403
21408
|
const allow = permissions?.allow;
|
|
@@ -21412,11 +21417,11 @@ function formatCopyDestination(target, writtenPath, root) {
|
|
|
21412
21417
|
}
|
|
21413
21418
|
function formatManagedPathLabel(targetPath, root) {
|
|
21414
21419
|
const home = homedir4();
|
|
21415
|
-
if (targetPath === home || targetPath.startsWith(`${home}${
|
|
21420
|
+
if (targetPath === home || targetPath.startsWith(`${home}${path17.sep}`)) {
|
|
21416
21421
|
return `~${targetPath.slice(home.length)}`;
|
|
21417
21422
|
}
|
|
21418
|
-
const relative5 =
|
|
21419
|
-
if (relative5 && !relative5.startsWith("..") && !
|
|
21423
|
+
const relative5 = path17.relative(root, targetPath);
|
|
21424
|
+
if (relative5 && !relative5.startsWith("..") && !path17.isAbsolute(relative5)) {
|
|
21420
21425
|
return relative5;
|
|
21421
21426
|
}
|
|
21422
21427
|
return targetPath;
|
|
@@ -21430,7 +21435,7 @@ function addManagedTarget(targets, editorName, targetPath, root) {
|
|
|
21430
21435
|
}
|
|
21431
21436
|
function getAdapterBasePath(adapter, root, scope) {
|
|
21432
21437
|
const configPath = scope === "global" ? adapter.globalPath() : adapter.projectPath(root);
|
|
21433
|
-
return configPath ?
|
|
21438
|
+
return configPath ? path17.dirname(configPath) : null;
|
|
21434
21439
|
}
|
|
21435
21440
|
function getManagedContentTargets(adapters, root, scope) {
|
|
21436
21441
|
const targets = {
|
|
@@ -21444,13 +21449,13 @@ function getManagedContentTargets(adapters, root, scope) {
|
|
|
21444
21449
|
addManagedTarget(
|
|
21445
21450
|
targets.skillTargets,
|
|
21446
21451
|
"skills",
|
|
21447
|
-
|
|
21452
|
+
path17.join(workspaceBase, ".agents", "skills"),
|
|
21448
21453
|
root
|
|
21449
21454
|
);
|
|
21450
21455
|
addManagedTarget(
|
|
21451
21456
|
targets.skillsLockTargets,
|
|
21452
21457
|
"skills",
|
|
21453
|
-
|
|
21458
|
+
path17.join(workspaceBase, "skills-lock.json"),
|
|
21454
21459
|
root
|
|
21455
21460
|
);
|
|
21456
21461
|
for (const adapter of adapters) {
|
|
@@ -21458,21 +21463,21 @@ function getManagedContentTargets(adapters, root, scope) {
|
|
|
21458
21463
|
case "Cursor": {
|
|
21459
21464
|
const base = getAdapterBasePath(adapter, root, scope);
|
|
21460
21465
|
if (!base) break;
|
|
21461
|
-
addManagedTarget(targets.skillTargets, adapter.name,
|
|
21462
|
-
addManagedTarget(targets.ruleTargets, adapter.name,
|
|
21466
|
+
addManagedTarget(targets.skillTargets, adapter.name, path17.join(base, "skills"), root);
|
|
21467
|
+
addManagedTarget(targets.ruleTargets, adapter.name, path17.join(base, "rules"), root);
|
|
21463
21468
|
break;
|
|
21464
21469
|
}
|
|
21465
21470
|
case "Claude Code": {
|
|
21466
|
-
const claudeBase = scope === "global" ?
|
|
21467
|
-
addManagedTarget(targets.skillTargets, adapter.name,
|
|
21468
|
-
addManagedTarget(targets.ruleTargets, adapter.name,
|
|
21469
|
-
addManagedTarget(targets.agentTargets, adapter.name,
|
|
21471
|
+
const claudeBase = scope === "global" ? path17.join(homedir4(), ".claude") : path17.join(root, ".claude");
|
|
21472
|
+
addManagedTarget(targets.skillTargets, adapter.name, path17.join(claudeBase, "skills"), root);
|
|
21473
|
+
addManagedTarget(targets.ruleTargets, adapter.name, path17.join(claudeBase, "rules"), root);
|
|
21474
|
+
addManagedTarget(targets.agentTargets, adapter.name, path17.join(claudeBase, "agents"), root);
|
|
21470
21475
|
break;
|
|
21471
21476
|
}
|
|
21472
21477
|
case "Gemini": {
|
|
21473
|
-
const geminiBase = scope === "global" ?
|
|
21474
|
-
addManagedTarget(targets.ruleTargets, adapter.name,
|
|
21475
|
-
addManagedTarget(targets.agentTargets, adapter.name,
|
|
21478
|
+
const geminiBase = scope === "global" ? path17.join(homedir4(), ".gemini") : path17.join(root, ".gemini");
|
|
21479
|
+
addManagedTarget(targets.ruleTargets, adapter.name, path17.join(geminiBase, "rules"), root);
|
|
21480
|
+
addManagedTarget(targets.agentTargets, adapter.name, path17.join(geminiBase, "agents"), root);
|
|
21476
21481
|
break;
|
|
21477
21482
|
}
|
|
21478
21483
|
case "Codex": {
|
|
@@ -21482,9 +21487,9 @@ function getManagedContentTargets(adapters, root, scope) {
|
|
|
21482
21487
|
break;
|
|
21483
21488
|
}
|
|
21484
21489
|
case "opencode": {
|
|
21485
|
-
const base = scope === "global" ?
|
|
21486
|
-
addManagedTarget(targets.skillTargets, adapter.name,
|
|
21487
|
-
addManagedTarget(targets.agentTargets, adapter.name,
|
|
21490
|
+
const base = scope === "global" ? path17.join(homedir4(), ".config", "opencode") : path17.join(root, ".opencode");
|
|
21491
|
+
addManagedTarget(targets.skillTargets, adapter.name, path17.join(base, "skills"), root);
|
|
21492
|
+
addManagedTarget(targets.agentTargets, adapter.name, path17.join(base, "agents"), root);
|
|
21488
21493
|
break;
|
|
21489
21494
|
}
|
|
21490
21495
|
}
|
|
@@ -21498,12 +21503,12 @@ function stripFrontmatter(content) {
|
|
|
21498
21503
|
return match ? content.slice(match[0].length).trim() : content.trim();
|
|
21499
21504
|
}
|
|
21500
21505
|
function readAndConcatRules(rulesDir) {
|
|
21501
|
-
if (!
|
|
21502
|
-
const files =
|
|
21506
|
+
if (!fs16.existsSync(rulesDir)) return null;
|
|
21507
|
+
const files = fs16.readdirSync(rulesDir).filter((f) => f.endsWith(".md")).sort();
|
|
21503
21508
|
if (files.length === 0) return null;
|
|
21504
21509
|
const parts = [];
|
|
21505
21510
|
for (const file of files) {
|
|
21506
|
-
const raw =
|
|
21511
|
+
const raw = fs16.readFileSync(path17.join(rulesDir, file), "utf8");
|
|
21507
21512
|
const stripped = stripFrontmatter(raw);
|
|
21508
21513
|
if (stripped) parts.push(stripped);
|
|
21509
21514
|
}
|
|
@@ -21538,7 +21543,7 @@ function injectCodexRules(configPath, rulesDir) {
|
|
|
21538
21543
|
return configPath;
|
|
21539
21544
|
}
|
|
21540
21545
|
function removeCodexRules(configPath) {
|
|
21541
|
-
if (!
|
|
21546
|
+
if (!fs16.existsSync(configPath)) return false;
|
|
21542
21547
|
const config = readToml(configPath);
|
|
21543
21548
|
const existing = config.developer_instructions;
|
|
21544
21549
|
if (!existing || !existing.includes(ARGENT_RULES_START)) return false;
|
|
@@ -21589,14 +21594,14 @@ function copyRulesAndAgents(adapters, root, scope, rulesDir, agentsDir) {
|
|
|
21589
21594
|
|
|
21590
21595
|
// ../argent-installer/src/cli-record.ts
|
|
21591
21596
|
var import_semver4 = __toESM(require_semver2(), 1);
|
|
21592
|
-
import * as
|
|
21593
|
-
import * as
|
|
21597
|
+
import * as fs17 from "node:fs";
|
|
21598
|
+
import * as path18 from "node:path";
|
|
21594
21599
|
function cliRecordPath() {
|
|
21595
|
-
return
|
|
21600
|
+
return path18.join(argentHomeDir(), "cli.json");
|
|
21596
21601
|
}
|
|
21597
21602
|
function readCliRecord() {
|
|
21598
21603
|
try {
|
|
21599
|
-
const parsed = JSON.parse(
|
|
21604
|
+
const parsed = JSON.parse(fs17.readFileSync(cliRecordPath(), "utf8"));
|
|
21600
21605
|
if (typeof parsed?.cli === "string" && typeof parsed?.node === "string") return parsed;
|
|
21601
21606
|
return null;
|
|
21602
21607
|
} catch {
|
|
@@ -21606,14 +21611,14 @@ function readCliRecord() {
|
|
|
21606
21611
|
function resolveCliEntry(mode, projectRoot) {
|
|
21607
21612
|
if (mode === "local") {
|
|
21608
21613
|
const relative5 = getLocalArgentBinRelPath(projectRoot);
|
|
21609
|
-
return relative5 ?
|
|
21614
|
+
return relative5 ? path18.resolve(projectRoot, relative5) : null;
|
|
21610
21615
|
}
|
|
21611
21616
|
const packageRoot = getGloballyInstalledPackageRoot();
|
|
21612
21617
|
if (!packageRoot) return null;
|
|
21613
21618
|
const binSub = argentBinSubpath(packageRoot);
|
|
21614
21619
|
if (!binSub) return null;
|
|
21615
|
-
const entry =
|
|
21616
|
-
return
|
|
21620
|
+
const entry = path18.join(packageRoot, binSub);
|
|
21621
|
+
return fs17.existsSync(entry) ? entry : null;
|
|
21617
21622
|
}
|
|
21618
21623
|
function writeCliRecord(input) {
|
|
21619
21624
|
const cli = resolveCliEntry(input.mode, input.projectRoot);
|
|
@@ -21629,10 +21634,10 @@ function writeCliRecord(input) {
|
|
|
21629
21634
|
function persistCliRecord(record) {
|
|
21630
21635
|
const file = cliRecordPath();
|
|
21631
21636
|
try {
|
|
21632
|
-
|
|
21637
|
+
fs17.mkdirSync(path18.dirname(file), { recursive: true });
|
|
21633
21638
|
const temporary = `${file}.${process.pid}.tmp`;
|
|
21634
|
-
|
|
21635
|
-
|
|
21639
|
+
fs17.writeFileSync(temporary, JSON.stringify(record, null, 2) + "\n");
|
|
21640
|
+
fs17.renameSync(temporary, file);
|
|
21636
21641
|
return file;
|
|
21637
21642
|
} catch {
|
|
21638
21643
|
return null;
|
|
@@ -21640,10 +21645,10 @@ function persistCliRecord(record) {
|
|
|
21640
21645
|
}
|
|
21641
21646
|
function healCliRecord(input) {
|
|
21642
21647
|
try {
|
|
21643
|
-
if (!
|
|
21648
|
+
if (!fs17.existsSync(input.cli)) return null;
|
|
21644
21649
|
const existing = readCliRecord();
|
|
21645
21650
|
if (existing) {
|
|
21646
|
-
const alive =
|
|
21651
|
+
const alive = fs17.existsSync(existing.node) && fs17.existsSync(existing.cli);
|
|
21647
21652
|
const ourVersion = import_semver4.default.valid(input.version);
|
|
21648
21653
|
const theirVersion = import_semver4.default.valid(existing.version);
|
|
21649
21654
|
const newerThanExisting = ourVersion !== null && (theirVersion === null || import_semver4.default.gt(ourVersion, theirVersion));
|
|
@@ -21664,11 +21669,11 @@ function removeCliRecordFor(installDir) {
|
|
|
21664
21669
|
if (!installDir) return false;
|
|
21665
21670
|
const record = readCliRecord();
|
|
21666
21671
|
if (!record) return false;
|
|
21667
|
-
const root =
|
|
21668
|
-
const relative5 =
|
|
21669
|
-
if (relative5.startsWith("..") ||
|
|
21672
|
+
const root = path18.resolve(installDir);
|
|
21673
|
+
const relative5 = path18.relative(root, path18.resolve(record.cli));
|
|
21674
|
+
if (relative5.startsWith("..") || path18.isAbsolute(relative5)) return false;
|
|
21670
21675
|
try {
|
|
21671
|
-
|
|
21676
|
+
fs17.rmSync(cliRecordPath(), { force: true });
|
|
21672
21677
|
return true;
|
|
21673
21678
|
} catch {
|
|
21674
21679
|
return false;
|
|
@@ -21884,7 +21889,7 @@ async function promptInstallMode(defaultMode = "global") {
|
|
|
21884
21889
|
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
21885
21890
|
|
|
21886
21891
|
// ../argent-installer/src/shell.ts
|
|
21887
|
-
import { execFileSync as
|
|
21892
|
+
import { execFileSync as execFileSync5, spawn as spawn2 } from "node:child_process";
|
|
21888
21893
|
async function runTrustingDisk(execute, landedOnDisk) {
|
|
21889
21894
|
let exitError = null;
|
|
21890
21895
|
try {
|
|
@@ -21895,7 +21900,7 @@ async function runTrustingDisk(execute, landedOnDisk) {
|
|
|
21895
21900
|
return { landed: landedOnDisk(), exitError };
|
|
21896
21901
|
}
|
|
21897
21902
|
function execShellCommandSync(cmd, opts = {}) {
|
|
21898
|
-
|
|
21903
|
+
execFileSync5(cmd.bin, cmd.args, {
|
|
21899
21904
|
stdio: "inherit",
|
|
21900
21905
|
shell: process.platform === "win32",
|
|
21901
21906
|
...opts.cwd ? { cwd: opts.cwd } : {},
|
|
@@ -21939,7 +21944,7 @@ function runShellCommand(cmd, opts = {}) {
|
|
|
21939
21944
|
}
|
|
21940
21945
|
|
|
21941
21946
|
// ../argent-installer/src/skills.ts
|
|
21942
|
-
import { execFileSync as
|
|
21947
|
+
import { execFileSync as execFileSync6 } from "node:child_process";
|
|
21943
21948
|
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
21944
21949
|
function getScopeSpecs(projectRoot) {
|
|
21945
21950
|
return [
|
|
@@ -21975,14 +21980,14 @@ function refreshArgentSkills(projectRoot) {
|
|
|
21975
21980
|
pruneError: null
|
|
21976
21981
|
};
|
|
21977
21982
|
try {
|
|
21978
|
-
|
|
21983
|
+
execFileSync6("npx", withNpmForce(spec.buildAddArgs(primarySource)), execOpts);
|
|
21979
21984
|
result.synced = bundled.size;
|
|
21980
21985
|
} catch (primaryErr) {
|
|
21981
21986
|
if (primarySource === SKILLS_DIR) {
|
|
21982
21987
|
result.syncError = primaryErr instanceof Error ? primaryErr.message.split("\n")[0] : String(primaryErr);
|
|
21983
21988
|
} else {
|
|
21984
21989
|
try {
|
|
21985
|
-
|
|
21990
|
+
execFileSync6("npx", withNpmForce(spec.buildAddArgs(SKILLS_DIR)), execOpts);
|
|
21986
21991
|
result.synced = bundled.size;
|
|
21987
21992
|
} catch (fallbackErr) {
|
|
21988
21993
|
result.syncError = fallbackErr instanceof Error ? fallbackErr.message.split("\n")[0] : String(fallbackErr);
|
|
@@ -21991,7 +21996,7 @@ function refreshArgentSkills(projectRoot) {
|
|
|
21991
21996
|
}
|
|
21992
21997
|
if (orphaned.length > 0) {
|
|
21993
21998
|
try {
|
|
21994
|
-
|
|
21999
|
+
execFileSync6("npx", withNpmForce([...spec.removeArgs, ...orphaned]), execOpts);
|
|
21995
22000
|
result.pruned = orphaned;
|
|
21996
22001
|
} catch (err) {
|
|
21997
22002
|
result.pruneError = err instanceof Error ? err.message.split("\n")[0] : String(err);
|
|
@@ -23105,7 +23110,7 @@ function printBanner() {
|
|
|
23105
23110
|
// ../argent-installer/src/update.ts
|
|
23106
23111
|
var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
23107
23112
|
var import_semver5 = __toESM(require_semver2(), 1);
|
|
23108
|
-
import * as
|
|
23113
|
+
import * as path23 from "node:path";
|
|
23109
23114
|
|
|
23110
23115
|
// ../argent-installer/src/update-target.ts
|
|
23111
23116
|
var import_update_core = __toESM(require_dist2(), 1);
|
|
@@ -23124,17 +23129,17 @@ async function resolveInstallableUpdateTarget(pm, current) {
|
|
|
23124
23129
|
|
|
23125
23130
|
// ../argent-tools-client/src/launcher.ts
|
|
23126
23131
|
import * as net from "node:net";
|
|
23127
|
-
import * as
|
|
23128
|
-
import * as
|
|
23132
|
+
import * as fs18 from "node:fs";
|
|
23133
|
+
import * as path19 from "node:path";
|
|
23129
23134
|
import * as readline from "node:readline";
|
|
23130
23135
|
import { homedir as homedir5 } from "node:os";
|
|
23131
|
-
import { spawn as spawn4, execFileSync as
|
|
23136
|
+
import { spawn as spawn4, execFileSync as execFileSync7 } from "node:child_process";
|
|
23132
23137
|
import { createHash as createHash2, randomBytes } from "node:crypto";
|
|
23133
|
-
import { mkdir, writeFile, readFile, readdir, unlink, rename, chmod } from "node:fs/promises";
|
|
23134
|
-
var STATE_DIR =
|
|
23135
|
-
var STATE_FILE =
|
|
23136
|
-
var LOG_FILE =
|
|
23137
|
-
var LOCK_FILE =
|
|
23138
|
+
import { mkdir, writeFile, readFile, readdir as readdir2, unlink, rename, chmod } from "node:fs/promises";
|
|
23139
|
+
var STATE_DIR = path19.join(homedir5(), ".argent");
|
|
23140
|
+
var STATE_FILE = path19.join(STATE_DIR, "tool-server.json");
|
|
23141
|
+
var LOG_FILE = path19.join(STATE_DIR, "tool-server.log");
|
|
23142
|
+
var LOCK_FILE = path19.join(STATE_DIR, "tool-server.lock");
|
|
23138
23143
|
function isProcessAlive(pid) {
|
|
23139
23144
|
try {
|
|
23140
23145
|
process.kill(pid, 0);
|
|
@@ -23145,7 +23150,7 @@ function isProcessAlive(pid) {
|
|
|
23145
23150
|
}
|
|
23146
23151
|
function stateFileForBundle(bundlePath) {
|
|
23147
23152
|
const key = createHash2("sha256").update(bundlePath).digest("hex").slice(0, 12);
|
|
23148
|
-
return
|
|
23153
|
+
return path19.join(STATE_DIR, `tool-server-${key}.json`);
|
|
23149
23154
|
}
|
|
23150
23155
|
async function readStateFile(file) {
|
|
23151
23156
|
try {
|
|
@@ -23180,14 +23185,14 @@ var STATE_FILE_RE = /^tool-server(-[0-9a-f]{12})?\.json$/;
|
|
|
23180
23185
|
async function readAllToolsServerStates() {
|
|
23181
23186
|
let names;
|
|
23182
23187
|
try {
|
|
23183
|
-
names = await
|
|
23188
|
+
names = await readdir2(STATE_DIR);
|
|
23184
23189
|
} catch {
|
|
23185
23190
|
return [];
|
|
23186
23191
|
}
|
|
23187
23192
|
const out = [];
|
|
23188
23193
|
for (const name of names) {
|
|
23189
23194
|
if (!STATE_FILE_RE.test(name)) continue;
|
|
23190
|
-
const file =
|
|
23195
|
+
const file = path19.join(STATE_DIR, name);
|
|
23191
23196
|
const state2 = await readStateFile(file);
|
|
23192
23197
|
if (state2) out.push({ file, state: state2 });
|
|
23193
23198
|
}
|
|
@@ -23233,21 +23238,21 @@ async function killToolServer(bundlePath) {
|
|
|
23233
23238
|
return alive;
|
|
23234
23239
|
}
|
|
23235
23240
|
function isPathWithin(child, parent) {
|
|
23236
|
-
const rel =
|
|
23237
|
-
return rel !== "" && !rel.startsWith("..") && !
|
|
23241
|
+
const rel = path19.relative(parent, child);
|
|
23242
|
+
return rel !== "" && !rel.startsWith("..") && !path19.isAbsolute(rel);
|
|
23238
23243
|
}
|
|
23239
23244
|
function tryRealpath(p) {
|
|
23240
23245
|
try {
|
|
23241
|
-
return
|
|
23246
|
+
return fs18.realpathSync(p);
|
|
23242
23247
|
} catch {
|
|
23243
23248
|
return p;
|
|
23244
23249
|
}
|
|
23245
23250
|
}
|
|
23246
23251
|
async function killToolServerForInstallDir(packageDir) {
|
|
23247
|
-
const parents = /* @__PURE__ */ new Set([
|
|
23252
|
+
const parents = /* @__PURE__ */ new Set([path19.resolve(packageDir), tryRealpath(packageDir)]);
|
|
23248
23253
|
let killed = 0;
|
|
23249
23254
|
for (const { file, state: state2 } of await readAllToolsServerStates()) {
|
|
23250
|
-
const bundles = /* @__PURE__ */ new Set([
|
|
23255
|
+
const bundles = /* @__PURE__ */ new Set([path19.resolve(state2.bundlePath), tryRealpath(state2.bundlePath)]);
|
|
23251
23256
|
const matches2 = [...bundles].some((b) => [...parents].some((p) => isPathWithin(b, p)));
|
|
23252
23257
|
if (!matches2) continue;
|
|
23253
23258
|
const fresh = await readStateFile(file);
|
|
@@ -23265,11 +23270,11 @@ async function killToolServerForInstallDir(packageDir) {
|
|
|
23265
23270
|
}
|
|
23266
23271
|
return killed;
|
|
23267
23272
|
}
|
|
23268
|
-
var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) =>
|
|
23273
|
+
var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs18.existsSync(p)) ?? "ps";
|
|
23269
23274
|
var PS_WIDTH_FLAGS = ["-ww"];
|
|
23270
23275
|
var PS_LOCALE = process.platform === "darwin" ? "en_US.UTF-8" : "C.UTF-8";
|
|
23271
23276
|
function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS, env = { ...process.env, LC_ALL: PS_LOCALE }) {
|
|
23272
|
-
return
|
|
23277
|
+
return execFileSync7(PS_BIN, [...flags, "-p", String(pid), "-o", "command="], {
|
|
23273
23278
|
env,
|
|
23274
23279
|
encoding: "utf8",
|
|
23275
23280
|
timeout: 2e3,
|
|
@@ -23309,37 +23314,53 @@ function couldBeOurToolServer(pid, marker) {
|
|
|
23309
23314
|
}
|
|
23310
23315
|
|
|
23311
23316
|
// ../argent-tools-client/src/link-config.ts
|
|
23312
|
-
import * as
|
|
23317
|
+
import * as path20 from "node:path";
|
|
23313
23318
|
import { homedir as homedir6 } from "node:os";
|
|
23314
23319
|
import { mkdir as mkdir2, writeFile as writeFile2, readFile as readFile2, unlink as unlink2, chmod as chmod2 } from "node:fs/promises";
|
|
23315
|
-
var LINK_DIR =
|
|
23316
|
-
var LINK_FILE =
|
|
23320
|
+
var LINK_DIR = path20.join(homedir6(), ".argent");
|
|
23321
|
+
var LINK_FILE = path20.join(LINK_DIR, "link.json");
|
|
23317
23322
|
|
|
23318
23323
|
// ../argent-tools-client/src/file-inputs.ts
|
|
23319
23324
|
import { createHash as createHash3, randomUUID as randomUUID6 } from "node:crypto";
|
|
23320
|
-
import { createReadStream } from "node:fs";
|
|
23321
|
-
import {
|
|
23322
|
-
|
|
23323
|
-
|
|
23325
|
+
import { createReadStream, rmSync as rmSync6 } from "node:fs";
|
|
23326
|
+
import {
|
|
23327
|
+
chmod as chmod3,
|
|
23328
|
+
lstat,
|
|
23329
|
+
mkdir as mkdir3,
|
|
23330
|
+
readFile as readFile3,
|
|
23331
|
+
realpath as realpath2,
|
|
23332
|
+
rename as rename2,
|
|
23333
|
+
rm as rm2,
|
|
23334
|
+
stat as stat2,
|
|
23335
|
+
writeFile as writeFile3
|
|
23336
|
+
} from "node:fs/promises";
|
|
23337
|
+
import { constants, tmpdir } from "node:os";
|
|
23338
|
+
import * as path21 from "node:path";
|
|
23324
23339
|
|
|
23325
23340
|
// ../archive/src/index.ts
|
|
23326
23341
|
import { execFile } from "node:child_process";
|
|
23327
|
-
import { rm, readdir as
|
|
23328
|
-
import { basename as
|
|
23342
|
+
import { rm, readdir as readdir3 } from "node:fs/promises";
|
|
23343
|
+
import { basename as basename3, dirname as dirname12, join as join20, posix as posix2, resolve as resolve12, sep as sep4 } from "node:path";
|
|
23329
23344
|
import { promisify } from "node:util";
|
|
23330
23345
|
var execFileAsync = promisify(execFile);
|
|
23331
23346
|
|
|
23332
23347
|
// ../argent-tools-client/src/file-inputs.ts
|
|
23333
23348
|
var MAX_CONTENT_BYTES = 32 * 1024 * 1024;
|
|
23334
23349
|
|
|
23350
|
+
// ../argent-tools-client/src/flow-files.ts
|
|
23351
|
+
var import_yaml3 = __toESM(require_dist(), 1);
|
|
23352
|
+
import { readdir as readdir4, readFile as readFile4, realpath as realpath3, stat as stat3 } from "node:fs/promises";
|
|
23353
|
+
import * as path22 from "node:path";
|
|
23354
|
+
var INLINE_MEMBERS_BYTES = 256 * 1024;
|
|
23355
|
+
|
|
23335
23356
|
// ../argent-tools-client/src/artifacts.ts
|
|
23336
|
-
import { copyFile, mkdir as mkdir4, readFile as
|
|
23357
|
+
import { copyFile, mkdir as mkdir4, readFile as readFile5, realpath as realpath4, rm as rm3, stat as stat4, writeFile as writeFile4 } from "node:fs/promises";
|
|
23337
23358
|
import { constants as fsConstants } from "node:fs";
|
|
23338
23359
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
23339
|
-
import { basename as
|
|
23360
|
+
import { basename as basename6, dirname as dirname15, extname as extname2, isAbsolute as isAbsolute7, join as join23, normalize as normalize2, resolve as resolve13, sep as sep6 } from "node:path";
|
|
23340
23361
|
import { createHash as createHash4 } from "node:crypto";
|
|
23341
|
-
var ALLOWED_SAVE_DIRS = /* @__PURE__ */ new Set([
|
|
23342
|
-
var RECORDINGS_SAVE_DIR =
|
|
23362
|
+
var ALLOWED_SAVE_DIRS = /* @__PURE__ */ new Set([normalize2(".argent/recordings")]);
|
|
23363
|
+
var RECORDINGS_SAVE_DIR = normalize2(".argent/recordings");
|
|
23343
23364
|
var MAX_DURABLE_BYTES = 2 * 1024 * 1024 * 1024;
|
|
23344
23365
|
|
|
23345
23366
|
// ../argent-installer/src/update.ts
|
|
@@ -23695,7 +23716,7 @@ async function update(args) {
|
|
|
23695
23716
|
process.exit(1);
|
|
23696
23717
|
}
|
|
23697
23718
|
const rootOverride = getProjectRootOverride(args);
|
|
23698
|
-
const projectRoot = rootOverride ?
|
|
23719
|
+
const projectRoot = rootOverride ? path23.resolve(rootOverride) : resolveProjectRoot2(process.cwd());
|
|
23699
23720
|
installMode = resolveInstallMode(projectRoot);
|
|
23700
23721
|
const flags = parseTargetFlags(args);
|
|
23701
23722
|
const localInstalled = installMode === "local" && probeLocalInstall(projectRoot).installed;
|
|
@@ -23877,9 +23898,9 @@ async function update(args) {
|
|
|
23877
23898
|
|
|
23878
23899
|
// ../argent-installer/src/uninstall.ts
|
|
23879
23900
|
var import_picocolors12 = __toESM(require_picocolors(), 1);
|
|
23880
|
-
var
|
|
23881
|
-
import * as
|
|
23882
|
-
import * as
|
|
23901
|
+
var import_yaml4 = __toESM(require_dist(), 1);
|
|
23902
|
+
import * as fs19 from "node:fs";
|
|
23903
|
+
import * as path24 from "node:path";
|
|
23883
23904
|
var UNINSTALL_TOOLSERVER_STOP_FAILED = {
|
|
23884
23905
|
error_code: FAILURE_CODES.UNINSTALL_TOOLSERVER_STOP_FAILED,
|
|
23885
23906
|
failure_stage: "installer_uninstall_toolserver_stop",
|
|
@@ -23900,10 +23921,10 @@ var UNINSTALL_UNCLASSIFIED_FAILED = {
|
|
|
23900
23921
|
};
|
|
23901
23922
|
function removeDirIfEmpty2(dirPath) {
|
|
23902
23923
|
try {
|
|
23903
|
-
if (!
|
|
23904
|
-
if (!
|
|
23905
|
-
if (
|
|
23906
|
-
|
|
23924
|
+
if (!fs19.existsSync(dirPath)) return false;
|
|
23925
|
+
if (!fs19.statSync(dirPath).isDirectory()) return false;
|
|
23926
|
+
if (fs19.readdirSync(dirPath).length > 0) return false;
|
|
23927
|
+
fs19.rmdirSync(dirPath);
|
|
23907
23928
|
return true;
|
|
23908
23929
|
} catch {
|
|
23909
23930
|
return false;
|
|
@@ -23913,9 +23934,9 @@ function collectBundledPaths(sourceDir) {
|
|
|
23913
23934
|
const files = [];
|
|
23914
23935
|
const directories = [];
|
|
23915
23936
|
function walk(currentDir, relativeDir = "") {
|
|
23916
|
-
for (const entry of
|
|
23917
|
-
const relativePath = relativeDir ?
|
|
23918
|
-
const absolutePath =
|
|
23937
|
+
for (const entry of fs19.readdirSync(currentDir, { withFileTypes: true })) {
|
|
23938
|
+
const relativePath = relativeDir ? path24.join(relativeDir, entry.name) : entry.name;
|
|
23939
|
+
const absolutePath = path24.join(currentDir, entry.name);
|
|
23919
23940
|
if (entry.isDirectory()) {
|
|
23920
23941
|
walk(absolutePath, relativePath);
|
|
23921
23942
|
directories.push(relativePath);
|
|
@@ -23928,55 +23949,55 @@ function collectBundledPaths(sourceDir) {
|
|
|
23928
23949
|
return { files, directories };
|
|
23929
23950
|
}
|
|
23930
23951
|
function removeBundledContent(sourceDir, targetDir) {
|
|
23931
|
-
if (!
|
|
23952
|
+
if (!fs19.existsSync(sourceDir) || !fs19.existsSync(targetDir)) {
|
|
23932
23953
|
return { removedPaths: [], removedRoot: false };
|
|
23933
23954
|
}
|
|
23934
23955
|
const { files, directories } = collectBundledPaths(sourceDir);
|
|
23935
23956
|
const removedPaths = [];
|
|
23936
23957
|
for (const relativePath of files) {
|
|
23937
|
-
const targetPath =
|
|
23958
|
+
const targetPath = path24.join(targetDir, relativePath);
|
|
23938
23959
|
try {
|
|
23939
|
-
if (!
|
|
23940
|
-
if (
|
|
23941
|
-
|
|
23960
|
+
if (!fs19.existsSync(targetPath)) continue;
|
|
23961
|
+
if (fs19.lstatSync(targetPath).isDirectory()) continue;
|
|
23962
|
+
fs19.rmSync(targetPath, { force: true });
|
|
23942
23963
|
removedPaths.push(relativePath);
|
|
23943
23964
|
} catch {
|
|
23944
23965
|
}
|
|
23945
23966
|
}
|
|
23946
23967
|
directories.sort(
|
|
23947
|
-
(a3, b) => b.split(
|
|
23968
|
+
(a3, b) => b.split(path24.sep).length - a3.split(path24.sep).length || b.length - a3.length
|
|
23948
23969
|
);
|
|
23949
23970
|
for (const relativePath of directories) {
|
|
23950
|
-
const targetPath =
|
|
23971
|
+
const targetPath = path24.join(targetDir, relativePath);
|
|
23951
23972
|
try {
|
|
23952
|
-
if (!
|
|
23953
|
-
if (!
|
|
23954
|
-
if (
|
|
23955
|
-
|
|
23973
|
+
if (!fs19.existsSync(targetPath)) continue;
|
|
23974
|
+
if (!fs19.statSync(targetPath).isDirectory()) continue;
|
|
23975
|
+
if (fs19.readdirSync(targetPath).length > 0) continue;
|
|
23976
|
+
fs19.rmdirSync(targetPath);
|
|
23956
23977
|
} catch {
|
|
23957
23978
|
}
|
|
23958
23979
|
}
|
|
23959
23980
|
let removedRoot = false;
|
|
23960
23981
|
try {
|
|
23961
|
-
if (
|
|
23962
|
-
if (
|
|
23963
|
-
|
|
23982
|
+
if (fs19.existsSync(targetDir) && fs19.statSync(targetDir).isDirectory()) {
|
|
23983
|
+
if (fs19.readdirSync(targetDir).length === 0) {
|
|
23984
|
+
fs19.rmdirSync(targetDir);
|
|
23964
23985
|
removedRoot = true;
|
|
23965
23986
|
}
|
|
23966
23987
|
}
|
|
23967
23988
|
} catch {
|
|
23968
23989
|
}
|
|
23969
23990
|
if (removedRoot) {
|
|
23970
|
-
removeDirIfEmpty2(
|
|
23991
|
+
removeDirIfEmpty2(path24.dirname(targetDir));
|
|
23971
23992
|
}
|
|
23972
23993
|
return { removedPaths, removedRoot };
|
|
23973
23994
|
}
|
|
23974
23995
|
function readBundledSkillName(skillFilePath, fallbackName) {
|
|
23975
23996
|
try {
|
|
23976
|
-
const content =
|
|
23997
|
+
const content = fs19.readFileSync(skillFilePath, "utf8");
|
|
23977
23998
|
const frontmatter = content.match(/^---\r?\n([\s\S]*?)\r?\n---/)?.[1];
|
|
23978
23999
|
if (!frontmatter) return fallbackName;
|
|
23979
|
-
const data = (0,
|
|
24000
|
+
const data = (0, import_yaml4.parse)(frontmatter);
|
|
23980
24001
|
const name = data?.name;
|
|
23981
24002
|
return typeof name === "string" && name.trim() ? name.trim() : fallbackName;
|
|
23982
24003
|
} catch {
|
|
@@ -23984,30 +24005,30 @@ function readBundledSkillName(skillFilePath, fallbackName) {
|
|
|
23984
24005
|
}
|
|
23985
24006
|
}
|
|
23986
24007
|
function getBundledSkillNames(skillsDir) {
|
|
23987
|
-
if (!
|
|
24008
|
+
if (!fs19.existsSync(skillsDir)) return [];
|
|
23988
24009
|
const skillNames = [];
|
|
23989
|
-
for (const entry of
|
|
24010
|
+
for (const entry of fs19.readdirSync(skillsDir, { withFileTypes: true })) {
|
|
23990
24011
|
if (!entry.isDirectory()) continue;
|
|
23991
|
-
const skillFilePath =
|
|
23992
|
-
if (!
|
|
24012
|
+
const skillFilePath = path24.join(skillsDir, entry.name, "SKILL.md");
|
|
24013
|
+
if (!fs19.existsSync(skillFilePath)) continue;
|
|
23993
24014
|
skillNames.push(readBundledSkillName(skillFilePath, entry.name));
|
|
23994
24015
|
}
|
|
23995
24016
|
return [...new Set(skillNames)].sort();
|
|
23996
24017
|
}
|
|
23997
24018
|
function removeBundledSkillInstalls(skillNames, targetDir) {
|
|
23998
|
-
if (!
|
|
24019
|
+
if (!fs19.existsSync(targetDir)) {
|
|
23999
24020
|
return { removedPaths: [], removedRoot: false };
|
|
24000
24021
|
}
|
|
24001
24022
|
const removedPaths = [];
|
|
24002
24023
|
for (const skillName of skillNames) {
|
|
24003
|
-
const targetPath =
|
|
24024
|
+
const targetPath = path24.join(targetDir, skillName);
|
|
24004
24025
|
try {
|
|
24005
|
-
if (!
|
|
24006
|
-
const stats =
|
|
24026
|
+
if (!fs19.existsSync(targetPath)) continue;
|
|
24027
|
+
const stats = fs19.lstatSync(targetPath);
|
|
24007
24028
|
if (stats.isDirectory() && !stats.isSymbolicLink()) {
|
|
24008
|
-
|
|
24029
|
+
fs19.rmSync(targetPath, { recursive: true, force: true });
|
|
24009
24030
|
} else {
|
|
24010
|
-
|
|
24031
|
+
fs19.rmSync(targetPath, { force: true });
|
|
24011
24032
|
}
|
|
24012
24033
|
removedPaths.push(skillName);
|
|
24013
24034
|
} catch {
|
|
@@ -24015,17 +24036,17 @@ function removeBundledSkillInstalls(skillNames, targetDir) {
|
|
|
24015
24036
|
}
|
|
24016
24037
|
const removedRoot = removeDirIfEmpty2(targetDir);
|
|
24017
24038
|
if (removedRoot) {
|
|
24018
|
-
removeDirIfEmpty2(
|
|
24039
|
+
removeDirIfEmpty2(path24.dirname(targetDir));
|
|
24019
24040
|
}
|
|
24020
24041
|
return { removedPaths, removedRoot };
|
|
24021
24042
|
}
|
|
24022
24043
|
function cleanupSkillsLockFile(lockPath, skillNames) {
|
|
24023
|
-
if (!
|
|
24044
|
+
if (!fs19.existsSync(lockPath)) {
|
|
24024
24045
|
return { removedSkills: [], removedFile: false };
|
|
24025
24046
|
}
|
|
24026
24047
|
let parsed;
|
|
24027
24048
|
try {
|
|
24028
|
-
parsed = JSON.parse(
|
|
24049
|
+
parsed = JSON.parse(fs19.readFileSync(lockPath, "utf8"));
|
|
24029
24050
|
} catch {
|
|
24030
24051
|
return { removedSkills: [], removedFile: false };
|
|
24031
24052
|
}
|
|
@@ -24052,10 +24073,10 @@ function cleanupSkillsLockFile(lockPath, skillNames) {
|
|
|
24052
24073
|
parsed.skills && typeof parsed.skills === "object" && Object.keys(parsed.skills).length > 0
|
|
24053
24074
|
);
|
|
24054
24075
|
if (!hasSkills && otherKeys.length === 0) {
|
|
24055
|
-
|
|
24076
|
+
fs19.rmSync(lockPath, { force: true });
|
|
24056
24077
|
return { removedSkills, removedFile: true };
|
|
24057
24078
|
}
|
|
24058
|
-
|
|
24079
|
+
fs19.writeFileSync(lockPath, JSON.stringify(parsed, null, 2) + "\n");
|
|
24059
24080
|
return { removedSkills, removedFile: false };
|
|
24060
24081
|
}
|
|
24061
24082
|
function cleanupBundledSkills(skillNames, targets) {
|