@swmansion/argent 0.34.1-next.98 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/argent-android-devtools-0.4.0.apk +0 -0
- package/bin/darwin/argent-macos-helper +0 -0
- package/bin/darwin/ax-service +0 -0
- package/bin/darwin/simulator-server +0 -0
- package/bin/darwin/tvos-ax-service +0 -0
- package/bin/darwin/tvos-hid-daemon +0 -0
- package/bin/linux/simulator-server +0 -0
- package/bin/linux-arm64/simulator-server +0 -0
- package/bin/network-inspector/network-inspector.jar +0 -0
- package/bin/tcp/ax-service +0 -0
- package/bin/win32/simulator-server.exe +0 -0
- package/dist/cli-cmds.mjs +187 -182
- package/dist/installer.mjs +353 -222
- package/dist/mcp-server.mjs +450 -11
- package/dist/tool-server.cjs +1430 -951
- package/dylibs/libArgentAudio.dylib +0 -0
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/macos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/macos/libNativeDevtoolsMacos.dylib +0 -0
- package/dylibs/tcp/argent-audio-feeder +0 -0
- package/dylibs/tcp/libArgentAudio.dylib +0 -0
- package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
- package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
- package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +2 -2
- package/skills/argent-device-interact/SKILL.md +1 -1
- package/skills/argent-test-ui-flow/SKILL.md +1 -1
package/dist/installer.mjs
CHANGED
|
@@ -2431,10 +2431,10 @@ var require_truncate = __commonJS({
|
|
|
2431
2431
|
"../../node_modules/semver/functions/truncate.js"(exports, module) {
|
|
2432
2432
|
"use strict";
|
|
2433
2433
|
var parse5 = require_parse();
|
|
2434
|
-
var
|
|
2434
|
+
var constants3 = require_constants();
|
|
2435
2435
|
var SemVer = require_semver();
|
|
2436
2436
|
var truncate = (version, truncation, options) => {
|
|
2437
|
-
if (!
|
|
2437
|
+
if (!constants3.RELEASE_TYPES.includes(truncation)) {
|
|
2438
2438
|
return null;
|
|
2439
2439
|
}
|
|
2440
2440
|
const clonedVersion = cloneInputVersion(version, options);
|
|
@@ -3483,7 +3483,7 @@ var require_semver2 = __commonJS({
|
|
|
3483
3483
|
"../../node_modules/semver/index.js"(exports, module) {
|
|
3484
3484
|
"use strict";
|
|
3485
3485
|
var internalRe = require_re();
|
|
3486
|
-
var
|
|
3486
|
+
var constants3 = require_constants();
|
|
3487
3487
|
var SemVer = require_semver();
|
|
3488
3488
|
var identifiers = require_identifiers();
|
|
3489
3489
|
var parse5 = require_parse();
|
|
@@ -3567,8 +3567,8 @@ var require_semver2 = __commonJS({
|
|
|
3567
3567
|
re: internalRe.re,
|
|
3568
3568
|
src: internalRe.src,
|
|
3569
3569
|
tokens: internalRe.t,
|
|
3570
|
-
SEMVER_SPEC_VERSION:
|
|
3571
|
-
RELEASE_TYPES:
|
|
3570
|
+
SEMVER_SPEC_VERSION: constants3.SEMVER_SPEC_VERSION,
|
|
3571
|
+
RELEASE_TYPES: constants3.RELEASE_TYPES,
|
|
3572
3572
|
compareIdentifiers: identifiers.compareIdentifiers,
|
|
3573
3573
|
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
3574
3574
|
};
|
|
@@ -3652,17 +3652,17 @@ var require_visit = __commonJS({
|
|
|
3652
3652
|
visit2.BREAK = BREAK;
|
|
3653
3653
|
visit2.SKIP = SKIP;
|
|
3654
3654
|
visit2.REMOVE = REMOVE;
|
|
3655
|
-
function visit_(key, node, visitor,
|
|
3656
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
3655
|
+
function visit_(key, node, visitor, path33) {
|
|
3656
|
+
const ctrl = callVisitor(key, node, visitor, path33);
|
|
3657
3657
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
3658
|
-
replaceNode(key,
|
|
3659
|
-
return visit_(key, ctrl, visitor,
|
|
3658
|
+
replaceNode(key, path33, ctrl);
|
|
3659
|
+
return visit_(key, ctrl, visitor, path33);
|
|
3660
3660
|
}
|
|
3661
3661
|
if (typeof ctrl !== "symbol") {
|
|
3662
3662
|
if (identity2.isCollection(node)) {
|
|
3663
|
-
|
|
3663
|
+
path33 = Object.freeze(path33.concat(node));
|
|
3664
3664
|
for (let i2 = 0; i2 < node.items.length; ++i2) {
|
|
3665
|
-
const ci = visit_(i2, node.items[i2], visitor,
|
|
3665
|
+
const ci = visit_(i2, node.items[i2], visitor, path33);
|
|
3666
3666
|
if (typeof ci === "number")
|
|
3667
3667
|
i2 = ci - 1;
|
|
3668
3668
|
else if (ci === BREAK)
|
|
@@ -3673,13 +3673,13 @@ var require_visit = __commonJS({
|
|
|
3673
3673
|
}
|
|
3674
3674
|
}
|
|
3675
3675
|
} else if (identity2.isPair(node)) {
|
|
3676
|
-
|
|
3677
|
-
const ck = visit_("key", node.key, visitor,
|
|
3676
|
+
path33 = Object.freeze(path33.concat(node));
|
|
3677
|
+
const ck = visit_("key", node.key, visitor, path33);
|
|
3678
3678
|
if (ck === BREAK)
|
|
3679
3679
|
return BREAK;
|
|
3680
3680
|
else if (ck === REMOVE)
|
|
3681
3681
|
node.key = null;
|
|
3682
|
-
const cv = visit_("value", node.value, visitor,
|
|
3682
|
+
const cv = visit_("value", node.value, visitor, path33);
|
|
3683
3683
|
if (cv === BREAK)
|
|
3684
3684
|
return BREAK;
|
|
3685
3685
|
else if (cv === REMOVE)
|
|
@@ -3700,17 +3700,17 @@ var require_visit = __commonJS({
|
|
|
3700
3700
|
visitAsync.BREAK = BREAK;
|
|
3701
3701
|
visitAsync.SKIP = SKIP;
|
|
3702
3702
|
visitAsync.REMOVE = REMOVE;
|
|
3703
|
-
async function visitAsync_(key, node, visitor,
|
|
3704
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
3703
|
+
async function visitAsync_(key, node, visitor, path33) {
|
|
3704
|
+
const ctrl = await callVisitor(key, node, visitor, path33);
|
|
3705
3705
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
3706
|
-
replaceNode(key,
|
|
3707
|
-
return visitAsync_(key, ctrl, visitor,
|
|
3706
|
+
replaceNode(key, path33, ctrl);
|
|
3707
|
+
return visitAsync_(key, ctrl, visitor, path33);
|
|
3708
3708
|
}
|
|
3709
3709
|
if (typeof ctrl !== "symbol") {
|
|
3710
3710
|
if (identity2.isCollection(node)) {
|
|
3711
|
-
|
|
3711
|
+
path33 = Object.freeze(path33.concat(node));
|
|
3712
3712
|
for (let i2 = 0; i2 < node.items.length; ++i2) {
|
|
3713
|
-
const ci = await visitAsync_(i2, node.items[i2], visitor,
|
|
3713
|
+
const ci = await visitAsync_(i2, node.items[i2], visitor, path33);
|
|
3714
3714
|
if (typeof ci === "number")
|
|
3715
3715
|
i2 = ci - 1;
|
|
3716
3716
|
else if (ci === BREAK)
|
|
@@ -3721,13 +3721,13 @@ var require_visit = __commonJS({
|
|
|
3721
3721
|
}
|
|
3722
3722
|
}
|
|
3723
3723
|
} else if (identity2.isPair(node)) {
|
|
3724
|
-
|
|
3725
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
3724
|
+
path33 = Object.freeze(path33.concat(node));
|
|
3725
|
+
const ck = await visitAsync_("key", node.key, visitor, path33);
|
|
3726
3726
|
if (ck === BREAK)
|
|
3727
3727
|
return BREAK;
|
|
3728
3728
|
else if (ck === REMOVE)
|
|
3729
3729
|
node.key = null;
|
|
3730
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
3730
|
+
const cv = await visitAsync_("value", node.value, visitor, path33);
|
|
3731
3731
|
if (cv === BREAK)
|
|
3732
3732
|
return BREAK;
|
|
3733
3733
|
else if (cv === REMOVE)
|
|
@@ -3754,23 +3754,23 @@ var require_visit = __commonJS({
|
|
|
3754
3754
|
}
|
|
3755
3755
|
return visitor;
|
|
3756
3756
|
}
|
|
3757
|
-
function callVisitor(key, node, visitor,
|
|
3757
|
+
function callVisitor(key, node, visitor, path33) {
|
|
3758
3758
|
if (typeof visitor === "function")
|
|
3759
|
-
return visitor(key, node,
|
|
3759
|
+
return visitor(key, node, path33);
|
|
3760
3760
|
if (identity2.isMap(node))
|
|
3761
|
-
return visitor.Map?.(key, node,
|
|
3761
|
+
return visitor.Map?.(key, node, path33);
|
|
3762
3762
|
if (identity2.isSeq(node))
|
|
3763
|
-
return visitor.Seq?.(key, node,
|
|
3763
|
+
return visitor.Seq?.(key, node, path33);
|
|
3764
3764
|
if (identity2.isPair(node))
|
|
3765
|
-
return visitor.Pair?.(key, node,
|
|
3765
|
+
return visitor.Pair?.(key, node, path33);
|
|
3766
3766
|
if (identity2.isScalar(node))
|
|
3767
|
-
return visitor.Scalar?.(key, node,
|
|
3767
|
+
return visitor.Scalar?.(key, node, path33);
|
|
3768
3768
|
if (identity2.isAlias(node))
|
|
3769
|
-
return visitor.Alias?.(key, node,
|
|
3769
|
+
return visitor.Alias?.(key, node, path33);
|
|
3770
3770
|
return void 0;
|
|
3771
3771
|
}
|
|
3772
|
-
function replaceNode(key,
|
|
3773
|
-
const parent =
|
|
3772
|
+
function replaceNode(key, path33, node) {
|
|
3773
|
+
const parent = path33[path33.length - 1];
|
|
3774
3774
|
if (identity2.isCollection(parent)) {
|
|
3775
3775
|
parent.items[key] = node;
|
|
3776
3776
|
} else if (identity2.isPair(parent)) {
|
|
@@ -4382,10 +4382,10 @@ var require_Collection = __commonJS({
|
|
|
4382
4382
|
var createNode = require_createNode();
|
|
4383
4383
|
var identity2 = require_identity();
|
|
4384
4384
|
var Node = require_Node();
|
|
4385
|
-
function collectionFromPath(schema,
|
|
4385
|
+
function collectionFromPath(schema, path33, value) {
|
|
4386
4386
|
let v = value;
|
|
4387
|
-
for (let i2 =
|
|
4388
|
-
const k =
|
|
4387
|
+
for (let i2 = path33.length - 1; i2 >= 0; --i2) {
|
|
4388
|
+
const k = path33[i2];
|
|
4389
4389
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
4390
4390
|
const a2 = [];
|
|
4391
4391
|
a2[k] = v;
|
|
@@ -4404,7 +4404,7 @@ var require_Collection = __commonJS({
|
|
|
4404
4404
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
4405
4405
|
});
|
|
4406
4406
|
}
|
|
4407
|
-
var isEmptyPath = (
|
|
4407
|
+
var isEmptyPath = (path33) => path33 == null || typeof path33 === "object" && !!path33[Symbol.iterator]().next().done;
|
|
4408
4408
|
var Collection = class extends Node.NodeBase {
|
|
4409
4409
|
constructor(type, schema) {
|
|
4410
4410
|
super(type);
|
|
@@ -4434,11 +4434,11 @@ var require_Collection = __commonJS({
|
|
|
4434
4434
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
4435
4435
|
* that already exists in the map.
|
|
4436
4436
|
*/
|
|
4437
|
-
addIn(
|
|
4438
|
-
if (isEmptyPath(
|
|
4437
|
+
addIn(path33, value) {
|
|
4438
|
+
if (isEmptyPath(path33))
|
|
4439
4439
|
this.add(value);
|
|
4440
4440
|
else {
|
|
4441
|
-
const [key, ...rest] =
|
|
4441
|
+
const [key, ...rest] = path33;
|
|
4442
4442
|
const node = this.get(key, true);
|
|
4443
4443
|
if (identity2.isCollection(node))
|
|
4444
4444
|
node.addIn(rest, value);
|
|
@@ -4452,8 +4452,8 @@ var require_Collection = __commonJS({
|
|
|
4452
4452
|
* Removes a value from the collection.
|
|
4453
4453
|
* @returns `true` if the item was found and removed.
|
|
4454
4454
|
*/
|
|
4455
|
-
deleteIn(
|
|
4456
|
-
const [key, ...rest] =
|
|
4455
|
+
deleteIn(path33) {
|
|
4456
|
+
const [key, ...rest] = path33;
|
|
4457
4457
|
if (rest.length === 0)
|
|
4458
4458
|
return this.delete(key);
|
|
4459
4459
|
const node = this.get(key, true);
|
|
@@ -4467,8 +4467,8 @@ var require_Collection = __commonJS({
|
|
|
4467
4467
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
4468
4468
|
* `true` (collections are always returned intact).
|
|
4469
4469
|
*/
|
|
4470
|
-
getIn(
|
|
4471
|
-
const [key, ...rest] =
|
|
4470
|
+
getIn(path33, keepScalar) {
|
|
4471
|
+
const [key, ...rest] = path33;
|
|
4472
4472
|
const node = this.get(key, true);
|
|
4473
4473
|
if (rest.length === 0)
|
|
4474
4474
|
return !keepScalar && identity2.isScalar(node) ? node.value : node;
|
|
@@ -4486,8 +4486,8 @@ var require_Collection = __commonJS({
|
|
|
4486
4486
|
/**
|
|
4487
4487
|
* Checks if the collection includes a value with the key `key`.
|
|
4488
4488
|
*/
|
|
4489
|
-
hasIn(
|
|
4490
|
-
const [key, ...rest] =
|
|
4489
|
+
hasIn(path33) {
|
|
4490
|
+
const [key, ...rest] = path33;
|
|
4491
4491
|
if (rest.length === 0)
|
|
4492
4492
|
return this.has(key);
|
|
4493
4493
|
const node = this.get(key, true);
|
|
@@ -4497,8 +4497,8 @@ var require_Collection = __commonJS({
|
|
|
4497
4497
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
4498
4498
|
* boolean to add/remove the item from the set.
|
|
4499
4499
|
*/
|
|
4500
|
-
setIn(
|
|
4501
|
-
const [key, ...rest] =
|
|
4500
|
+
setIn(path33, value) {
|
|
4501
|
+
const [key, ...rest] = path33;
|
|
4502
4502
|
if (rest.length === 0) {
|
|
4503
4503
|
this.set(key, value);
|
|
4504
4504
|
} else {
|
|
@@ -7013,9 +7013,9 @@ var require_Document = __commonJS({
|
|
|
7013
7013
|
this.contents.add(value);
|
|
7014
7014
|
}
|
|
7015
7015
|
/** Adds a value to the document. */
|
|
7016
|
-
addIn(
|
|
7016
|
+
addIn(path33, value) {
|
|
7017
7017
|
if (assertCollection(this.contents))
|
|
7018
|
-
this.contents.addIn(
|
|
7018
|
+
this.contents.addIn(path33, value);
|
|
7019
7019
|
}
|
|
7020
7020
|
/**
|
|
7021
7021
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -7090,14 +7090,14 @@ var require_Document = __commonJS({
|
|
|
7090
7090
|
* Removes a value from the document.
|
|
7091
7091
|
* @returns `true` if the item was found and removed.
|
|
7092
7092
|
*/
|
|
7093
|
-
deleteIn(
|
|
7094
|
-
if (Collection.isEmptyPath(
|
|
7093
|
+
deleteIn(path33) {
|
|
7094
|
+
if (Collection.isEmptyPath(path33)) {
|
|
7095
7095
|
if (this.contents == null)
|
|
7096
7096
|
return false;
|
|
7097
7097
|
this.contents = null;
|
|
7098
7098
|
return true;
|
|
7099
7099
|
}
|
|
7100
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
7100
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path33) : false;
|
|
7101
7101
|
}
|
|
7102
7102
|
/**
|
|
7103
7103
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -7112,10 +7112,10 @@ var require_Document = __commonJS({
|
|
|
7112
7112
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
7113
7113
|
* `true` (collections are always returned intact).
|
|
7114
7114
|
*/
|
|
7115
|
-
getIn(
|
|
7116
|
-
if (Collection.isEmptyPath(
|
|
7115
|
+
getIn(path33, keepScalar) {
|
|
7116
|
+
if (Collection.isEmptyPath(path33))
|
|
7117
7117
|
return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
7118
|
-
return identity2.isCollection(this.contents) ? this.contents.getIn(
|
|
7118
|
+
return identity2.isCollection(this.contents) ? this.contents.getIn(path33, keepScalar) : void 0;
|
|
7119
7119
|
}
|
|
7120
7120
|
/**
|
|
7121
7121
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -7126,10 +7126,10 @@ var require_Document = __commonJS({
|
|
|
7126
7126
|
/**
|
|
7127
7127
|
* Checks if the document includes a value at `path`.
|
|
7128
7128
|
*/
|
|
7129
|
-
hasIn(
|
|
7130
|
-
if (Collection.isEmptyPath(
|
|
7129
|
+
hasIn(path33) {
|
|
7130
|
+
if (Collection.isEmptyPath(path33))
|
|
7131
7131
|
return this.contents !== void 0;
|
|
7132
|
-
return identity2.isCollection(this.contents) ? this.contents.hasIn(
|
|
7132
|
+
return identity2.isCollection(this.contents) ? this.contents.hasIn(path33) : false;
|
|
7133
7133
|
}
|
|
7134
7134
|
/**
|
|
7135
7135
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -7146,13 +7146,13 @@ var require_Document = __commonJS({
|
|
|
7146
7146
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
7147
7147
|
* boolean to add/remove the item from the set.
|
|
7148
7148
|
*/
|
|
7149
|
-
setIn(
|
|
7150
|
-
if (Collection.isEmptyPath(
|
|
7149
|
+
setIn(path33, value) {
|
|
7150
|
+
if (Collection.isEmptyPath(path33)) {
|
|
7151
7151
|
this.contents = value;
|
|
7152
7152
|
} else if (this.contents == null) {
|
|
7153
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
7153
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path33), value);
|
|
7154
7154
|
} else if (assertCollection(this.contents)) {
|
|
7155
|
-
this.contents.setIn(
|
|
7155
|
+
this.contents.setIn(path33, value);
|
|
7156
7156
|
}
|
|
7157
7157
|
}
|
|
7158
7158
|
/**
|
|
@@ -9113,9 +9113,9 @@ var require_cst_visit = __commonJS({
|
|
|
9113
9113
|
visit2.BREAK = BREAK;
|
|
9114
9114
|
visit2.SKIP = SKIP;
|
|
9115
9115
|
visit2.REMOVE = REMOVE;
|
|
9116
|
-
visit2.itemAtPath = (cst,
|
|
9116
|
+
visit2.itemAtPath = (cst, path33) => {
|
|
9117
9117
|
let item = cst;
|
|
9118
|
-
for (const [field, index] of
|
|
9118
|
+
for (const [field, index] of path33) {
|
|
9119
9119
|
const tok = item?.[field];
|
|
9120
9120
|
if (tok && "items" in tok) {
|
|
9121
9121
|
item = tok.items[index];
|
|
@@ -9124,23 +9124,23 @@ var require_cst_visit = __commonJS({
|
|
|
9124
9124
|
}
|
|
9125
9125
|
return item;
|
|
9126
9126
|
};
|
|
9127
|
-
visit2.parentCollection = (cst,
|
|
9128
|
-
const parent = visit2.itemAtPath(cst,
|
|
9129
|
-
const field =
|
|
9127
|
+
visit2.parentCollection = (cst, path33) => {
|
|
9128
|
+
const parent = visit2.itemAtPath(cst, path33.slice(0, -1));
|
|
9129
|
+
const field = path33[path33.length - 1][0];
|
|
9130
9130
|
const coll = parent?.[field];
|
|
9131
9131
|
if (coll && "items" in coll)
|
|
9132
9132
|
return coll;
|
|
9133
9133
|
throw new Error("Parent collection not found");
|
|
9134
9134
|
};
|
|
9135
|
-
function _visit(
|
|
9136
|
-
let ctrl = visitor(item,
|
|
9135
|
+
function _visit(path33, item, visitor) {
|
|
9136
|
+
let ctrl = visitor(item, path33);
|
|
9137
9137
|
if (typeof ctrl === "symbol")
|
|
9138
9138
|
return ctrl;
|
|
9139
9139
|
for (const field of ["key", "value"]) {
|
|
9140
9140
|
const token = item[field];
|
|
9141
9141
|
if (token && "items" in token) {
|
|
9142
9142
|
for (let i2 = 0; i2 < token.items.length; ++i2) {
|
|
9143
|
-
const ci = _visit(Object.freeze(
|
|
9143
|
+
const ci = _visit(Object.freeze(path33.concat([[field, i2]])), token.items[i2], visitor);
|
|
9144
9144
|
if (typeof ci === "number")
|
|
9145
9145
|
i2 = ci - 1;
|
|
9146
9146
|
else if (ci === BREAK)
|
|
@@ -9151,10 +9151,10 @@ var require_cst_visit = __commonJS({
|
|
|
9151
9151
|
}
|
|
9152
9152
|
}
|
|
9153
9153
|
if (typeof ctrl === "function" && field === "key")
|
|
9154
|
-
ctrl = ctrl(item,
|
|
9154
|
+
ctrl = ctrl(item, path33);
|
|
9155
9155
|
}
|
|
9156
9156
|
}
|
|
9157
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
9157
|
+
return typeof ctrl === "function" ? ctrl(item, path33) : ctrl;
|
|
9158
9158
|
}
|
|
9159
9159
|
exports.visit = visit2;
|
|
9160
9160
|
}
|
|
@@ -10456,14 +10456,14 @@ var require_parser = __commonJS({
|
|
|
10456
10456
|
case "scalar":
|
|
10457
10457
|
case "single-quoted-scalar":
|
|
10458
10458
|
case "double-quoted-scalar": {
|
|
10459
|
-
const
|
|
10459
|
+
const fs26 = this.flowScalar(this.type);
|
|
10460
10460
|
if (atNextItem || it.value) {
|
|
10461
|
-
map.items.push({ start, key:
|
|
10461
|
+
map.items.push({ start, key: fs26, sep: [] });
|
|
10462
10462
|
this.onKeyLine = true;
|
|
10463
10463
|
} else if (it.sep) {
|
|
10464
|
-
this.stack.push(
|
|
10464
|
+
this.stack.push(fs26);
|
|
10465
10465
|
} else {
|
|
10466
|
-
Object.assign(it, { key:
|
|
10466
|
+
Object.assign(it, { key: fs26, sep: [] });
|
|
10467
10467
|
this.onKeyLine = true;
|
|
10468
10468
|
}
|
|
10469
10469
|
return;
|
|
@@ -10591,13 +10591,13 @@ var require_parser = __commonJS({
|
|
|
10591
10591
|
case "scalar":
|
|
10592
10592
|
case "single-quoted-scalar":
|
|
10593
10593
|
case "double-quoted-scalar": {
|
|
10594
|
-
const
|
|
10594
|
+
const fs26 = this.flowScalar(this.type);
|
|
10595
10595
|
if (!it || it.value)
|
|
10596
|
-
fc.items.push({ start: [], key:
|
|
10596
|
+
fc.items.push({ start: [], key: fs26, sep: [] });
|
|
10597
10597
|
else if (it.sep)
|
|
10598
|
-
this.stack.push(
|
|
10598
|
+
this.stack.push(fs26);
|
|
10599
10599
|
else
|
|
10600
|
-
Object.assign(it, { key:
|
|
10600
|
+
Object.assign(it, { key: fs26, sep: [] });
|
|
10601
10601
|
return;
|
|
10602
10602
|
}
|
|
10603
10603
|
case "flow-map-end":
|
|
@@ -15012,7 +15012,7 @@ function appendRootPathToUrlIfNeeded(url) {
|
|
|
15012
15012
|
return void 0;
|
|
15013
15013
|
}
|
|
15014
15014
|
}
|
|
15015
|
-
function appendResourcePathToUrl(url,
|
|
15015
|
+
function appendResourcePathToUrl(url, path33) {
|
|
15016
15016
|
try {
|
|
15017
15017
|
new URL(url);
|
|
15018
15018
|
} catch {
|
|
@@ -15022,11 +15022,11 @@ function appendResourcePathToUrl(url, path32) {
|
|
|
15022
15022
|
if (!url.endsWith("/")) {
|
|
15023
15023
|
url = url + "/";
|
|
15024
15024
|
}
|
|
15025
|
-
url +=
|
|
15025
|
+
url += path33;
|
|
15026
15026
|
try {
|
|
15027
15027
|
new URL(url);
|
|
15028
15028
|
} catch {
|
|
15029
|
-
diag2.warn(`Configuration: Provided URL appended with '${
|
|
15029
|
+
diag2.warn(`Configuration: Provided URL appended with '${path33}' is not a valid URL, using 'undefined' instead of '${url}'`);
|
|
15030
15030
|
return void 0;
|
|
15031
15031
|
}
|
|
15032
15032
|
return url;
|
|
@@ -16576,9 +16576,9 @@ function isReplitAgent(env) {
|
|
|
16576
16576
|
}
|
|
16577
16577
|
var DEVIN_MARKER_PATH = "/opt/.devin";
|
|
16578
16578
|
var JULES_MARKER_PATH = "/opt/environment_summary.sh";
|
|
16579
|
-
function safeExists(fileExists,
|
|
16579
|
+
function safeExists(fileExists, path33) {
|
|
16580
16580
|
try {
|
|
16581
|
-
return fileExists(
|
|
16581
|
+
return fileExists(path33);
|
|
16582
16582
|
} catch {
|
|
16583
16583
|
return false;
|
|
16584
16584
|
}
|
|
@@ -16998,7 +16998,7 @@ function isCi(env = process.env) {
|
|
|
16998
16998
|
var SESSION_ID = randomUUID4();
|
|
16999
16999
|
function readCliVersion() {
|
|
17000
17000
|
if (true) {
|
|
17001
|
-
return "0.
|
|
17001
|
+
return "0.35.0";
|
|
17002
17002
|
}
|
|
17003
17003
|
return "0.0.0";
|
|
17004
17004
|
}
|
|
@@ -19397,12 +19397,12 @@ function parseTree(text2, errors = [], options = ParseOptions.DEFAULT) {
|
|
|
19397
19397
|
}
|
|
19398
19398
|
return result;
|
|
19399
19399
|
}
|
|
19400
|
-
function findNodeAtLocation(root,
|
|
19400
|
+
function findNodeAtLocation(root, path33) {
|
|
19401
19401
|
if (!root) {
|
|
19402
19402
|
return void 0;
|
|
19403
19403
|
}
|
|
19404
19404
|
let node = root;
|
|
19405
|
-
for (let segment of
|
|
19405
|
+
for (let segment of path33) {
|
|
19406
19406
|
if (typeof segment === "string") {
|
|
19407
19407
|
if (node.type !== "object" || !Array.isArray(node.children)) {
|
|
19408
19408
|
return void 0;
|
|
@@ -19756,14 +19756,14 @@ function getNodeType(value) {
|
|
|
19756
19756
|
|
|
19757
19757
|
// ../../node_modules/jsonc-parser/lib/esm/impl/edit.js
|
|
19758
19758
|
function setProperty(text2, originalPath, value, options) {
|
|
19759
|
-
const
|
|
19759
|
+
const path33 = originalPath.slice();
|
|
19760
19760
|
const errors = [];
|
|
19761
19761
|
const root = parseTree(text2, errors);
|
|
19762
19762
|
let parent = void 0;
|
|
19763
19763
|
let lastSegment = void 0;
|
|
19764
|
-
while (
|
|
19765
|
-
lastSegment =
|
|
19766
|
-
parent = findNodeAtLocation(root,
|
|
19764
|
+
while (path33.length > 0) {
|
|
19765
|
+
lastSegment = path33.pop();
|
|
19766
|
+
parent = findNodeAtLocation(root, path33);
|
|
19767
19767
|
if (parent === void 0 && value !== void 0) {
|
|
19768
19768
|
if (typeof lastSegment === "string") {
|
|
19769
19769
|
value = { [lastSegment]: value };
|
|
@@ -19949,8 +19949,8 @@ var ParseErrorCode;
|
|
|
19949
19949
|
ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
|
|
19950
19950
|
ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
19951
19951
|
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
19952
|
-
function modify(text2,
|
|
19953
|
-
return setProperty(text2,
|
|
19952
|
+
function modify(text2, path33, value, options) {
|
|
19953
|
+
return setProperty(text2, path33, value, options);
|
|
19954
19954
|
}
|
|
19955
19955
|
function applyEdits(text2, edits) {
|
|
19956
19956
|
let sortedEdits = edits.slice(0).sort((a2, b) => {
|
|
@@ -20933,19 +20933,6 @@ function npxChildEnv(env = process.env) {
|
|
|
20933
20933
|
childEnv.GIT_CONFIG_COUNT = String(count);
|
|
20934
20934
|
return childEnv;
|
|
20935
20935
|
}
|
|
20936
|
-
function isSkillsCliAvailable(cwd) {
|
|
20937
|
-
try {
|
|
20938
|
-
execSync("npx --force --no-install skills --version", {
|
|
20939
|
-
env: npxChildEnv(),
|
|
20940
|
-
stdio: ["ignore", "ignore", "ignore"],
|
|
20941
|
-
timeout: PROBE_TIMEOUT_MS,
|
|
20942
|
-
...cwd ? { cwd } : {}
|
|
20943
|
-
});
|
|
20944
|
-
return true;
|
|
20945
|
-
} catch {
|
|
20946
|
-
return false;
|
|
20947
|
-
}
|
|
20948
|
-
}
|
|
20949
20936
|
async function isOnline(timeoutMs = PROBE_TIMEOUT_MS) {
|
|
20950
20937
|
let host;
|
|
20951
20938
|
try {
|
|
@@ -22787,8 +22774,8 @@ async function promptInstallMode(defaultMode = "global") {
|
|
|
22787
22774
|
|
|
22788
22775
|
// ../argent-installer/src/install-runner.ts
|
|
22789
22776
|
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
22790
|
-
import * as
|
|
22791
|
-
import * as
|
|
22777
|
+
import * as fs22 from "node:fs";
|
|
22778
|
+
import * as path24 from "node:path";
|
|
22792
22779
|
|
|
22793
22780
|
// ../argent-installer/src/shell.ts
|
|
22794
22781
|
import { execFileSync as execFileSync5, spawn as spawn2 } from "node:child_process";
|
|
@@ -22851,10 +22838,123 @@ function runShellCommand(cmd, opts = {}) {
|
|
|
22851
22838
|
}
|
|
22852
22839
|
|
|
22853
22840
|
// ../argent-installer/src/skills.ts
|
|
22841
|
+
import { execFileSync as execFileSync7 } from "node:child_process";
|
|
22842
|
+
import * as fs21 from "node:fs";
|
|
22843
|
+
import * as path23 from "node:path";
|
|
22844
|
+
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
22845
|
+
|
|
22846
|
+
// ../argent-installer/src/skills-runner.ts
|
|
22854
22847
|
import { execFileSync as execFileSync6 } from "node:child_process";
|
|
22855
22848
|
import * as fs20 from "node:fs";
|
|
22856
22849
|
import * as path22 from "node:path";
|
|
22857
|
-
var
|
|
22850
|
+
var WIN32_DEFAULT_PATHEXT = ".COM;.EXE;.BAT;.CMD";
|
|
22851
|
+
function findOnPath(bin, env, platform) {
|
|
22852
|
+
const pathValue = env.PATH ?? env.Path ?? "";
|
|
22853
|
+
const dirs = pathValue.split(path22.delimiter).filter((dir) => path22.isAbsolute(dir));
|
|
22854
|
+
if (platform === "win32") {
|
|
22855
|
+
const exts = (env.PATHEXT ?? WIN32_DEFAULT_PATHEXT).split(";").filter(Boolean);
|
|
22856
|
+
for (const dir of dirs) {
|
|
22857
|
+
for (const ext of exts) {
|
|
22858
|
+
const candidate = path22.join(dir, bin + ext);
|
|
22859
|
+
if (fs20.existsSync(candidate)) return candidate;
|
|
22860
|
+
}
|
|
22861
|
+
}
|
|
22862
|
+
return null;
|
|
22863
|
+
}
|
|
22864
|
+
for (const dir of dirs) {
|
|
22865
|
+
const candidate = path22.join(dir, bin);
|
|
22866
|
+
try {
|
|
22867
|
+
if (!fs20.statSync(candidate).isFile()) continue;
|
|
22868
|
+
fs20.accessSync(candidate, fs20.constants.X_OK);
|
|
22869
|
+
return candidate;
|
|
22870
|
+
} catch {
|
|
22871
|
+
}
|
|
22872
|
+
}
|
|
22873
|
+
return null;
|
|
22874
|
+
}
|
|
22875
|
+
var SKILLS_RUNNERS_CHECKED = ["npx", "pnpm dlx", "bunx", "yarn dlx (Yarn 2+)"];
|
|
22876
|
+
var YARN_VERSION_TIMEOUT_MS = 3e3;
|
|
22877
|
+
function yarnSupportsDlx(bin, platform) {
|
|
22878
|
+
try {
|
|
22879
|
+
const probe = { kind: "yarn", bin, buildArgs: (args) => args, label: "yarn" };
|
|
22880
|
+
const command = skillsCommand(probe, ["--version"], platform);
|
|
22881
|
+
const out = execFileSync6(command.file, command.args, {
|
|
22882
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
22883
|
+
timeout: YARN_VERSION_TIMEOUT_MS,
|
|
22884
|
+
shell: command.shell,
|
|
22885
|
+
encoding: "utf8"
|
|
22886
|
+
});
|
|
22887
|
+
const major2 = Number.parseInt(out.trim().split(".")[0] ?? "", 10);
|
|
22888
|
+
return major2 >= 2;
|
|
22889
|
+
} catch {
|
|
22890
|
+
return false;
|
|
22891
|
+
}
|
|
22892
|
+
}
|
|
22893
|
+
function resolveSkillsRunner(env = process.env, platform = process.platform) {
|
|
22894
|
+
const npx = findOnPath("npx", env, platform);
|
|
22895
|
+
if (npx) return { kind: "npx", bin: npx, buildArgs: withNpmForce, label: "npx" };
|
|
22896
|
+
const pnpm = findOnPath("pnpm", env, platform);
|
|
22897
|
+
if (pnpm) {
|
|
22898
|
+
return { kind: "pnpm", bin: pnpm, buildArgs: (args) => ["dlx", ...args], label: "pnpm dlx" };
|
|
22899
|
+
}
|
|
22900
|
+
const bunx = findOnPath("bunx", env, platform);
|
|
22901
|
+
if (bunx) return { kind: "bun", bin: bunx, buildArgs: (args) => args, label: "bunx" };
|
|
22902
|
+
const bun = findOnPath("bun", env, platform);
|
|
22903
|
+
if (bun) return { kind: "bun", bin: bun, buildArgs: (args) => ["x", ...args], label: "bun x" };
|
|
22904
|
+
const yarn = findOnPath("yarn", env, platform);
|
|
22905
|
+
if (yarn && yarnSupportsDlx(yarn, platform)) {
|
|
22906
|
+
return { kind: "yarn", bin: yarn, buildArgs: (args) => ["dlx", ...args], label: "yarn dlx" };
|
|
22907
|
+
}
|
|
22908
|
+
return null;
|
|
22909
|
+
}
|
|
22910
|
+
var NO_SKILLS_RUNNER_MESSAGE = "no package runner on PATH";
|
|
22911
|
+
function noSkillsRunnerHelp(rerun) {
|
|
22912
|
+
return [
|
|
22913
|
+
"Argent could not install skills automatically: no package runner was found on PATH.",
|
|
22914
|
+
`Checked: ${SKILLS_RUNNERS_CHECKED.join(", ")}.`,
|
|
22915
|
+
"",
|
|
22916
|
+
"To fix this, install one of:",
|
|
22917
|
+
" - npm (it comes with Node.js): https://nodejs.org",
|
|
22918
|
+
" - pnpm: https://pnpm.io/installation",
|
|
22919
|
+
" - Bun: https://bun.sh",
|
|
22920
|
+
"",
|
|
22921
|
+
`Then run ${rerun} again.`
|
|
22922
|
+
].join("\n");
|
|
22923
|
+
}
|
|
22924
|
+
var CMD_UNSAFE = /[%!"\r\n]/;
|
|
22925
|
+
var CMD_SPECIAL = /[\s&|<>^(),;=]/;
|
|
22926
|
+
function quoteForCmd(arg) {
|
|
22927
|
+
return CMD_SPECIAL.test(arg) ? `"${arg}"` : arg;
|
|
22928
|
+
}
|
|
22929
|
+
function skillsCommand(runner, skillsArgs, platform = process.platform) {
|
|
22930
|
+
const args = runner.buildArgs(skillsArgs);
|
|
22931
|
+
if (platform !== "win32") return { file: runner.bin, args, shell: false };
|
|
22932
|
+
const unsafe = [runner.bin, ...args].find((arg) => CMD_UNSAFE.test(arg));
|
|
22933
|
+
if (unsafe !== void 0) {
|
|
22934
|
+
throw new Error(`cannot pass ${JSON.stringify(unsafe)} to cmd.exe safely`);
|
|
22935
|
+
}
|
|
22936
|
+
return { file: [runner.bin, ...args].map(quoteForCmd).join(" "), args: [], shell: true };
|
|
22937
|
+
}
|
|
22938
|
+
var OFFLINE_PROBE_TIMEOUT_MS = 3e3;
|
|
22939
|
+
function isSkillsCliCached(runner, cwd, platform = process.platform) {
|
|
22940
|
+
if (runner.kind !== "npx") return false;
|
|
22941
|
+
try {
|
|
22942
|
+
const command = skillsCommand(runner, ["--no-install", "skills", "--version"], platform);
|
|
22943
|
+
execFileSync6(command.file, command.args, {
|
|
22944
|
+
env: npxChildEnv(),
|
|
22945
|
+
stdio: ["ignore", "ignore", "ignore"],
|
|
22946
|
+
timeout: OFFLINE_PROBE_TIMEOUT_MS,
|
|
22947
|
+
shell: command.shell,
|
|
22948
|
+
...cwd ? { cwd } : {}
|
|
22949
|
+
});
|
|
22950
|
+
return true;
|
|
22951
|
+
} catch {
|
|
22952
|
+
return false;
|
|
22953
|
+
}
|
|
22954
|
+
}
|
|
22955
|
+
|
|
22956
|
+
// ../argent-installer/src/skills.ts
|
|
22957
|
+
var ARGENT_SKILL_NAME = /^argent-[a-z0-9-]+$/;
|
|
22858
22958
|
function getScopeSpecs(projectRoot) {
|
|
22859
22959
|
return [
|
|
22860
22960
|
{
|
|
@@ -22876,15 +22976,21 @@ function refreshArgentSkills(projectRoot) {
|
|
|
22876
22976
|
if (bundled.size === 0) return [];
|
|
22877
22977
|
const results = [];
|
|
22878
22978
|
const primarySource = buildArgentSkillsSource(getInstalledVersion());
|
|
22979
|
+
const runner = resolveSkillsRunner();
|
|
22879
22980
|
const execOpts = {
|
|
22880
22981
|
stdio: ["ignore", "pipe", "pipe"],
|
|
22881
22982
|
cwd: projectRoot,
|
|
22882
22983
|
env: npxChildEnv()
|
|
22883
22984
|
};
|
|
22985
|
+
const runSkills = (skillsArgs) => {
|
|
22986
|
+
if (!runner) throw new Error(NO_SKILLS_RUNNER_MESSAGE);
|
|
22987
|
+
const command = skillsCommand(runner, skillsArgs);
|
|
22988
|
+
execFileSync7(command.file, command.args, { ...execOpts, shell: command.shell });
|
|
22989
|
+
};
|
|
22884
22990
|
for (const spec of getScopeSpecs(projectRoot)) {
|
|
22885
22991
|
const tracked = listArgentSkillsInLock(spec.lockPath);
|
|
22886
22992
|
if (tracked.length === 0) continue;
|
|
22887
|
-
const orphaned = tracked.filter((name) => !bundled.has(name));
|
|
22993
|
+
const orphaned = tracked.filter((name) => !bundled.has(name) && ARGENT_SKILL_NAME.test(name));
|
|
22888
22994
|
const result = {
|
|
22889
22995
|
scope: spec.scope,
|
|
22890
22996
|
synced: 0,
|
|
@@ -22893,14 +22999,14 @@ function refreshArgentSkills(projectRoot) {
|
|
|
22893
22999
|
pruneError: null
|
|
22894
23000
|
};
|
|
22895
23001
|
try {
|
|
22896
|
-
|
|
23002
|
+
runSkills(spec.buildAddArgs(primarySource));
|
|
22897
23003
|
result.synced = bundled.size;
|
|
22898
23004
|
} catch (primaryErr) {
|
|
22899
23005
|
if (primarySource === SKILLS_DIR) {
|
|
22900
23006
|
result.syncError = primaryErr instanceof Error ? primaryErr.message.split("\n")[0] : String(primaryErr);
|
|
22901
23007
|
} else {
|
|
22902
23008
|
try {
|
|
22903
|
-
|
|
23009
|
+
runSkills(spec.buildAddArgs(SKILLS_DIR));
|
|
22904
23010
|
result.synced = bundled.size;
|
|
22905
23011
|
} catch (fallbackErr) {
|
|
22906
23012
|
result.syncError = fallbackErr instanceof Error ? fallbackErr.message.split("\n")[0] : String(fallbackErr);
|
|
@@ -22909,7 +23015,7 @@ function refreshArgentSkills(projectRoot) {
|
|
|
22909
23015
|
}
|
|
22910
23016
|
if (orphaned.length > 0) {
|
|
22911
23017
|
try {
|
|
22912
|
-
|
|
23018
|
+
runSkills([...spec.removeArgs, ...orphaned]);
|
|
22913
23019
|
result.pruned = orphaned;
|
|
22914
23020
|
} catch (err) {
|
|
22915
23021
|
result.pruneError = err instanceof Error ? err.message.split("\n")[0] : String(err);
|
|
@@ -22933,13 +23039,13 @@ function snapshotArgentSkills(projectRoot, scope, names) {
|
|
|
22933
23039
|
let candidates = names;
|
|
22934
23040
|
if (names.length === 0) {
|
|
22935
23041
|
try {
|
|
22936
|
-
candidates =
|
|
23042
|
+
candidates = fs21.readdirSync(targetPath).filter((n3) => n3.startsWith(ARGENT_SKILL_PREFIX));
|
|
22937
23043
|
} catch {
|
|
22938
23044
|
continue;
|
|
22939
23045
|
}
|
|
22940
23046
|
}
|
|
22941
23047
|
for (const name of candidates) {
|
|
22942
|
-
const stat6 =
|
|
23048
|
+
const stat6 = fs21.statSync(path23.join(targetPath, name, "SKILL.md"), { throwIfNoEntry: false });
|
|
22943
23049
|
if (!stat6?.isFile()) continue;
|
|
22944
23050
|
found.set(name, `${found.get(name) ?? ""}${stat6.ino}:${stat6.mtimeMs};`);
|
|
22945
23051
|
}
|
|
@@ -22957,7 +23063,7 @@ function pruneLegacySkillDirs(projectRoot, scope, bundled = new Set(listBundledS
|
|
|
22957
23063
|
const removed = /* @__PURE__ */ new Set();
|
|
22958
23064
|
for (const { targetPath } of skillTargets) {
|
|
22959
23065
|
for (const name of legacy) {
|
|
22960
|
-
const dir =
|
|
23066
|
+
const dir = path23.join(targetPath, name);
|
|
22961
23067
|
try {
|
|
22962
23068
|
if (removePath(dir)) removed.add(name);
|
|
22963
23069
|
} catch {
|
|
@@ -22977,13 +23083,13 @@ function listTrackedLegacySkills(projectRoot, scope, bundled = new Set(listBundl
|
|
|
22977
23083
|
}
|
|
22978
23084
|
function removeLockEntries(lockPath, names) {
|
|
22979
23085
|
try {
|
|
22980
|
-
const lock = JSON.parse(
|
|
23086
|
+
const lock = JSON.parse(fs21.readFileSync(lockPath, "utf8"));
|
|
22981
23087
|
const skills = lock.skills;
|
|
22982
23088
|
if (!skills) return [];
|
|
22983
23089
|
const removed = names.filter((name) => name in skills);
|
|
22984
23090
|
if (removed.length === 0) return [];
|
|
22985
23091
|
for (const name of removed) delete skills[name];
|
|
22986
|
-
|
|
23092
|
+
fs21.writeFileSync(lockPath, JSON.stringify(lock, null, 2) + "\n");
|
|
22987
23093
|
return removed;
|
|
22988
23094
|
} catch {
|
|
22989
23095
|
return [];
|
|
@@ -22993,7 +23099,9 @@ function formatSkillRefreshSummary(results) {
|
|
|
22993
23099
|
const lines = [];
|
|
22994
23100
|
for (const r2 of results) {
|
|
22995
23101
|
const parts = [];
|
|
22996
|
-
if (r2.syncError) {
|
|
23102
|
+
if (r2.syncError === NO_SKILLS_RUNNER_MESSAGE) {
|
|
23103
|
+
parts.push(`${import_picocolors3.default.red("not synced")} ${import_picocolors3.default.dim("(no package runner, see above)")}`);
|
|
23104
|
+
} else if (r2.syncError) {
|
|
22997
23105
|
parts.push(`${import_picocolors3.default.red("sync failed")} ${import_picocolors3.default.dim(`(${r2.syncError})`)}`);
|
|
22998
23106
|
} else if (r2.synced > 0) {
|
|
22999
23107
|
parts.push(`synced ${r2.synced}`);
|
|
@@ -23019,6 +23127,9 @@ function summarizeSkillRefreshForTelemetry(results) {
|
|
|
23019
23127
|
}
|
|
23020
23128
|
function reportSkillRefresh(projectRoot, stage) {
|
|
23021
23129
|
const results = refreshArgentSkills(projectRoot);
|
|
23130
|
+
if (results.some((r2) => r2.syncError === NO_SKILLS_RUNNER_MESSAGE)) {
|
|
23131
|
+
log.warn(noSkillsRunnerHelp("argent update"));
|
|
23132
|
+
}
|
|
23022
23133
|
const summary = formatSkillRefreshSummary(results);
|
|
23023
23134
|
if (summary) {
|
|
23024
23135
|
note(summary, "Skills Updated");
|
|
@@ -23049,7 +23160,7 @@ async function runInstall(args) {
|
|
|
23049
23160
|
return runGlobal({ fromTar, nonInteractive, version: args.version, tel });
|
|
23050
23161
|
}
|
|
23051
23162
|
function installSpec(fromTar) {
|
|
23052
|
-
return
|
|
23163
|
+
return fs22.existsSync(fromTar) ? path24.resolve(fromTar) : fromTar;
|
|
23053
23164
|
}
|
|
23054
23165
|
async function installLocally(opts) {
|
|
23055
23166
|
const { fromTar, tel } = opts;
|
|
@@ -23356,7 +23467,7 @@ async function chooseAdapters(opts) {
|
|
|
23356
23467
|
|
|
23357
23468
|
// ../argent-installer/src/init-scope.ts
|
|
23358
23469
|
var import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
23359
|
-
import { existsSync as
|
|
23470
|
+
import { existsSync as existsSync15 } from "node:fs";
|
|
23360
23471
|
import { resolve as resolve14 } from "node:path";
|
|
23361
23472
|
async function chooseScope(opts) {
|
|
23362
23473
|
if (opts.installMode === "local") {
|
|
@@ -23395,7 +23506,7 @@ async function chooseScope(opts) {
|
|
|
23395
23506
|
validate(value) {
|
|
23396
23507
|
if (!value?.trim()) return "Path cannot be empty.";
|
|
23397
23508
|
const resolved = resolve14(value.trim());
|
|
23398
|
-
if (!
|
|
23509
|
+
if (!existsSync15(resolved))
|
|
23399
23510
|
return `Path does not exist: ${resolved}. Please verify and enter a valid path.`;
|
|
23400
23511
|
}
|
|
23401
23512
|
});
|
|
@@ -23701,7 +23812,7 @@ async function configureAllowlist(args) {
|
|
|
23701
23812
|
var import_picocolors10 = __toESM(require_picocolors(), 1);
|
|
23702
23813
|
import { spawn as spawn3 } from "node:child_process";
|
|
23703
23814
|
import * as os4 from "node:os";
|
|
23704
|
-
import * as
|
|
23815
|
+
import * as path25 from "node:path";
|
|
23705
23816
|
var REF_MISSING = /Remote branch .* not found in upstream|couldn't find remote ref|unknown revision/i;
|
|
23706
23817
|
function meaningfulLine(err) {
|
|
23707
23818
|
const lines = (err instanceof Error ? err.message : String(err)).split("\n").map((l2) => l2.replace(/^[│┌└■◇\s]+/, "").trim()).filter((l2) => l2 && !/^npm (warn|notice)/i.test(l2));
|
|
@@ -23709,14 +23820,14 @@ function meaningfulLine(err) {
|
|
|
23709
23820
|
}
|
|
23710
23821
|
function bundledCopyFor(version) {
|
|
23711
23822
|
const local = probeLocalInstall(resolveProjectRoot2(process.cwd()));
|
|
23712
|
-
if (local.packageDir && local.version === version) return
|
|
23823
|
+
if (local.packageDir && local.version === version) return path25.join(local.packageDir, "skills");
|
|
23713
23824
|
const globalRoot = getGloballyInstalledPackageRoot();
|
|
23714
23825
|
if (globalRoot && getGloballyInstalledVersion() === version) {
|
|
23715
|
-
return
|
|
23826
|
+
return path25.join(globalRoot, "skills");
|
|
23716
23827
|
}
|
|
23717
23828
|
return SKILLS_DIR;
|
|
23718
23829
|
}
|
|
23719
|
-
function printManualInstructions(source, bundledCopy, scope, root,
|
|
23830
|
+
function printManualInstructions(source, bundledCopy, scope, root, runnerLabel) {
|
|
23720
23831
|
const dir = (sub) => scope === "global" ? `~/${sub}` : shellQuotePath(`${root}/${sub}`);
|
|
23721
23832
|
const add = `skills add ${source}${scope === "global" ? " -g" : ""} --skill '*' -y`;
|
|
23722
23833
|
const cd = scope === "global" ? "" : `cd ${shellQuotePath(root)} && `;
|
|
@@ -23732,8 +23843,12 @@ function printManualInstructions(source, bundledCopy, scope, root, npxMissing =
|
|
|
23732
23843
|
``,
|
|
23733
23844
|
` ${import_picocolors10.default.dim("# Cursor")}`,
|
|
23734
23845
|
` mkdir -p ${dir(".cursor/skills")} && cp -r ${bundledCopy}/* ${dir(".cursor/skills/")}`,
|
|
23735
|
-
|
|
23736
|
-
...
|
|
23846
|
+
// Without a runner the skills CLI is not an option, so do not offer it.
|
|
23847
|
+
...runnerLabel ? [
|
|
23848
|
+
``,
|
|
23849
|
+
` ${import_picocolors10.default.dim(`# Or use ${runnerLabel} skills directly:`)}`,
|
|
23850
|
+
` ${cd}${runnerLabel} ${add}`
|
|
23851
|
+
] : []
|
|
23737
23852
|
].join("\n"),
|
|
23738
23853
|
"Manual Skills Installation"
|
|
23739
23854
|
);
|
|
@@ -23745,7 +23860,7 @@ function formatSkillsSummaryLine(skills) {
|
|
|
23745
23860
|
const count = skills.installedCount;
|
|
23746
23861
|
const label = import_picocolors10.default.yellow("Skills");
|
|
23747
23862
|
if (skills.outcome === "failure" || skills.forcedManual) {
|
|
23748
|
-
const why = skills.forcedManual ? "offline, see the instructions above" : "see the error above";
|
|
23863
|
+
const why = skills.noRunner ? "no package runner found, see the instructions above" : skills.forcedManual ? "offline, see the instructions above" : "see the error above";
|
|
23749
23864
|
return count > 0 ? `${label} not updated (${why}), ${count} from an earlier install on disk` : `${label} NOT installed (${why})`;
|
|
23750
23865
|
}
|
|
23751
23866
|
if (skills.method === "manual") {
|
|
@@ -23768,10 +23883,15 @@ async function runSkillsStep(args) {
|
|
|
23768
23883
|
log.step(import_picocolors10.default.bold("Step 2: Skills Installation"));
|
|
23769
23884
|
log.warn(import_picocolors10.default.yellow("Skills installation is required for Argent to function properly."));
|
|
23770
23885
|
let skillsMethod;
|
|
23886
|
+
const runner = resolveSkillsRunner();
|
|
23887
|
+
const label = runner?.label ?? "npx";
|
|
23771
23888
|
const online = await isOnline();
|
|
23772
|
-
const offlineWithCache = !online &&
|
|
23773
|
-
const skillsCliReady = online || offlineWithCache;
|
|
23774
|
-
if (
|
|
23889
|
+
const offlineWithCache = !online && runner !== null && isSkillsCliCached(runner, skillsCwd);
|
|
23890
|
+
const skillsCliReady = runner !== null && (online || offlineWithCache);
|
|
23891
|
+
if (runner === null) {
|
|
23892
|
+
log.warn(noSkillsRunnerHelp("argent init"));
|
|
23893
|
+
log.info("Until then, you can copy the skills by hand:");
|
|
23894
|
+
} else if (!skillsCliReady) {
|
|
23775
23895
|
log.warn(
|
|
23776
23896
|
import_picocolors10.default.yellow("You appear to be offline. ") + "Automatic skills installation requires a network connection."
|
|
23777
23897
|
);
|
|
@@ -23788,12 +23908,12 @@ async function runSkillsStep(args) {
|
|
|
23788
23908
|
{
|
|
23789
23909
|
value: "default",
|
|
23790
23910
|
label: "Automatic",
|
|
23791
|
-
hint:
|
|
23911
|
+
hint: `Installs all skills automatically with ${label} skills`
|
|
23792
23912
|
},
|
|
23793
23913
|
{
|
|
23794
23914
|
value: "interactive",
|
|
23795
23915
|
label: "Interactive",
|
|
23796
|
-
hint:
|
|
23916
|
+
hint: `Full ${label} skills TUI - choose skills, agents, and method`
|
|
23797
23917
|
},
|
|
23798
23918
|
{
|
|
23799
23919
|
value: "manual",
|
|
@@ -23818,7 +23938,7 @@ async function runSkillsStep(args) {
|
|
|
23818
23938
|
let installedFrom = skillsSource;
|
|
23819
23939
|
let fallbackReason = null;
|
|
23820
23940
|
if (skillsMethod === "manual") {
|
|
23821
|
-
printManualInstructions(skillsSource, bundledCopy, scope, effectiveRoot);
|
|
23941
|
+
printManualInstructions(skillsSource, bundledCopy, scope, effectiveRoot, runner?.label ?? null);
|
|
23822
23942
|
skillOutcome = "skipped";
|
|
23823
23943
|
} else {
|
|
23824
23944
|
const interactive = skillsMethod === "interactive";
|
|
@@ -23828,32 +23948,37 @@ async function runSkillsStep(args) {
|
|
|
23828
23948
|
if (!interactive) skillsArgs.push("--skill", "*", "-y");
|
|
23829
23949
|
return offlineWithCache ? ["--no-install", ...skillsArgs] : skillsArgs;
|
|
23830
23950
|
};
|
|
23831
|
-
log.info(`Running: ${import_picocolors10.default.dim(
|
|
23951
|
+
log.info(`Running: ${import_picocolors10.default.dim(label)} ${import_picocolors10.default.cyan(buildSkillsArgs(skillsSource).join(" "))}`);
|
|
23832
23952
|
const spinner2 = spinner();
|
|
23833
23953
|
if (!interactive) spinner2.start("Installing skills...");
|
|
23834
23954
|
const attempt = async (source2, npmFlags = []) => {
|
|
23835
23955
|
const before = snapshot();
|
|
23836
|
-
|
|
23837
|
-
await runNpxSkills(npxArgs, interactive, skillsCwd);
|
|
23956
|
+
await runSkillsCli(runner, [...npmFlags, ...buildSkillsArgs(source2)], interactive, skillsCwd);
|
|
23838
23957
|
if (writtenSince(before) > 0) return "success";
|
|
23839
23958
|
if (interactive) return "skipped";
|
|
23840
23959
|
throw new Error("The skills CLI exited cleanly, but it installed no skills.");
|
|
23841
23960
|
};
|
|
23842
|
-
const fail = (err, attempted,
|
|
23961
|
+
const fail = (err, attempted, runnerMissing = false) => {
|
|
23843
23962
|
if (!interactive) spinner2.stop(import_picocolors10.default.red("Skills installation failed."));
|
|
23844
23963
|
log.error(`Failed to install skills from ${attempted}: ${meaningfulLine(err)}`);
|
|
23845
|
-
printManualInstructions(
|
|
23964
|
+
printManualInstructions(
|
|
23965
|
+
bundledCopy,
|
|
23966
|
+
bundledCopy,
|
|
23967
|
+
scope,
|
|
23968
|
+
effectiveRoot,
|
|
23969
|
+
runnerMissing ? null : label
|
|
23970
|
+
);
|
|
23846
23971
|
return "failure";
|
|
23847
23972
|
};
|
|
23848
23973
|
try {
|
|
23849
23974
|
skillOutcome = await attempt(skillsSource);
|
|
23850
23975
|
if (!interactive) spinner2.stop("Skills installed.");
|
|
23851
23976
|
} catch (err) {
|
|
23852
|
-
const
|
|
23977
|
+
const runnerMissing = err.code === "ENOENT";
|
|
23853
23978
|
const interrupted = err instanceof ShellCommandError && err.signal !== null;
|
|
23854
|
-
const canRetry = skillsSource !== bundledCopy && !
|
|
23979
|
+
const canRetry = skillsSource !== bundledCopy && !runnerMissing && !interrupted && listBundledSkills(bundledCopy).length > 0;
|
|
23855
23980
|
if (!canRetry) {
|
|
23856
|
-
skillOutcome = fail(err, skillsSource,
|
|
23981
|
+
skillOutcome = fail(err, skillsSource, runnerMissing);
|
|
23857
23982
|
} else {
|
|
23858
23983
|
if (!interactive) spinner2.stop(import_picocolors10.default.yellow("Pinned skills source failed."));
|
|
23859
23984
|
log.warn(`Could not install skills from ${skillsSource}: ${meaningfulLine(err)}`);
|
|
@@ -23864,7 +23989,10 @@ async function runSkillsStep(args) {
|
|
|
23864
23989
|
} else {
|
|
23865
23990
|
if (!interactive) spinner2.start("Installing the copy bundled with this package...");
|
|
23866
23991
|
try {
|
|
23867
|
-
skillOutcome = await attempt(
|
|
23992
|
+
skillOutcome = await attempt(
|
|
23993
|
+
bundledCopy,
|
|
23994
|
+
runner?.kind === "npx" ? ["--fetch-retries=0"] : []
|
|
23995
|
+
);
|
|
23868
23996
|
if (!interactive) spinner2.stop("Skills installed from the bundled copy.");
|
|
23869
23997
|
installedFrom = bundledCopy;
|
|
23870
23998
|
} catch (fallbackErr) {
|
|
@@ -23879,12 +24007,9 @@ async function runSkillsStep(args) {
|
|
|
23879
24007
|
if (tracked.length > 0) {
|
|
23880
24008
|
const removeArgs = ["skills", "remove", "-y", ...scope === "global" ? ["-g"] : []];
|
|
23881
24009
|
try {
|
|
23882
|
-
await
|
|
23883
|
-
|
|
23884
|
-
|
|
23885
|
-
...removeArgs,
|
|
23886
|
-
...tracked
|
|
23887
|
-
]),
|
|
24010
|
+
await runSkillsCli(
|
|
24011
|
+
runner,
|
|
24012
|
+
[...offlineWithCache ? ["--no-install"] : [], ...removeArgs, ...tracked],
|
|
23888
24013
|
false,
|
|
23889
24014
|
skillsCwd
|
|
23890
24015
|
);
|
|
@@ -23918,16 +24043,18 @@ async function runSkillsStep(args) {
|
|
|
23918
24043
|
usedFallback,
|
|
23919
24044
|
installedCount: snapshot().size,
|
|
23920
24045
|
installedThisRun: writtenSince(initial),
|
|
23921
|
-
forcedManual: !skillsCliReady
|
|
24046
|
+
forcedManual: !skillsCliReady,
|
|
24047
|
+
...runner === null ? { noRunner: true } : {}
|
|
23922
24048
|
};
|
|
23923
24049
|
}
|
|
23924
|
-
function
|
|
24050
|
+
async function runSkillsCli(runner, args, interactive, cwd) {
|
|
24051
|
+
if (!runner) throw new Error(NO_SKILLS_RUNNER_MESSAGE);
|
|
24052
|
+
const command = skillsCommand(runner, args);
|
|
23925
24053
|
return new Promise((resolve21, reject) => {
|
|
23926
|
-
const
|
|
23927
|
-
const child = spawn3(npxCmd, args, {
|
|
24054
|
+
const child = spawn3(command.file, command.args, {
|
|
23928
24055
|
env: npxChildEnv(),
|
|
23929
24056
|
stdio: interactive ? "inherit" : ["ignore", "pipe", "pipe"],
|
|
23930
|
-
shell:
|
|
24057
|
+
shell: command.shell,
|
|
23931
24058
|
...cwd ? { cwd } : {}
|
|
23932
24059
|
});
|
|
23933
24060
|
let stdout2 = "";
|
|
@@ -23946,7 +24073,11 @@ function runNpxSkills(args, interactive, cwd) {
|
|
|
23946
24073
|
} else {
|
|
23947
24074
|
const output = [stderr, stdout2].filter(Boolean).join("\n").trim();
|
|
23948
24075
|
reject(
|
|
23949
|
-
new ShellCommandError(
|
|
24076
|
+
new ShellCommandError(
|
|
24077
|
+
output || `${runner.label} skills exited with code ${code}`,
|
|
24078
|
+
code,
|
|
24079
|
+
signal
|
|
24080
|
+
)
|
|
23950
24081
|
);
|
|
23951
24082
|
}
|
|
23952
24083
|
});
|
|
@@ -24259,8 +24390,8 @@ function printBanner() {
|
|
|
24259
24390
|
// ../argent-installer/src/update.ts
|
|
24260
24391
|
var import_picocolors12 = __toESM(require_picocolors(), 1);
|
|
24261
24392
|
var import_semver5 = __toESM(require_semver2(), 1);
|
|
24262
|
-
import * as
|
|
24263
|
-
import * as
|
|
24393
|
+
import * as fs24 from "node:fs";
|
|
24394
|
+
import * as path31 from "node:path";
|
|
24264
24395
|
|
|
24265
24396
|
// ../argent-installer/src/install-targets.ts
|
|
24266
24397
|
function parseTargetFlags(args) {
|
|
@@ -24325,17 +24456,17 @@ async function resolveInstallableUpdateTarget(pm, current, cwd) {
|
|
|
24325
24456
|
|
|
24326
24457
|
// ../argent-tools-client/src/launcher.ts
|
|
24327
24458
|
import * as net from "node:net";
|
|
24328
|
-
import * as
|
|
24329
|
-
import * as
|
|
24459
|
+
import * as fs23 from "node:fs";
|
|
24460
|
+
import * as path26 from "node:path";
|
|
24330
24461
|
import * as readline from "node:readline";
|
|
24331
24462
|
import { homedir as homedir7 } from "node:os";
|
|
24332
|
-
import { spawn as spawn4, execFileSync as
|
|
24463
|
+
import { spawn as spawn4, execFileSync as execFileSync8 } from "node:child_process";
|
|
24333
24464
|
import { createHash as createHash3, randomBytes } from "node:crypto";
|
|
24334
24465
|
import { mkdir, writeFile, readFile, readdir as readdir2, unlink, rename, chmod } from "node:fs/promises";
|
|
24335
|
-
var STATE_DIR =
|
|
24336
|
-
var STATE_FILE =
|
|
24337
|
-
var LOG_FILE =
|
|
24338
|
-
var LOCK_FILE =
|
|
24466
|
+
var STATE_DIR = path26.join(homedir7(), ".argent");
|
|
24467
|
+
var STATE_FILE = path26.join(STATE_DIR, "tool-server.json");
|
|
24468
|
+
var LOG_FILE = path26.join(STATE_DIR, "tool-server.log");
|
|
24469
|
+
var LOCK_FILE = path26.join(STATE_DIR, "tool-server.lock");
|
|
24339
24470
|
function isProcessAlive(pid) {
|
|
24340
24471
|
try {
|
|
24341
24472
|
process.kill(pid, 0);
|
|
@@ -24346,7 +24477,7 @@ function isProcessAlive(pid) {
|
|
|
24346
24477
|
}
|
|
24347
24478
|
function stateFileForBundle(bundlePath) {
|
|
24348
24479
|
const key = createHash3("sha256").update(bundlePath).digest("hex").slice(0, 12);
|
|
24349
|
-
return
|
|
24480
|
+
return path26.join(STATE_DIR, `tool-server-${key}.json`);
|
|
24350
24481
|
}
|
|
24351
24482
|
async function readStateFile(file) {
|
|
24352
24483
|
try {
|
|
@@ -24388,7 +24519,7 @@ async function readAllToolsServerStates() {
|
|
|
24388
24519
|
const out = [];
|
|
24389
24520
|
for (const name of names) {
|
|
24390
24521
|
if (!STATE_FILE_RE.test(name)) continue;
|
|
24391
|
-
const file =
|
|
24522
|
+
const file = path26.join(STATE_DIR, name);
|
|
24392
24523
|
const state2 = await readStateFile(file);
|
|
24393
24524
|
if (state2) out.push({ file, state: state2 });
|
|
24394
24525
|
}
|
|
@@ -24434,21 +24565,21 @@ async function killToolServer(bundlePath) {
|
|
|
24434
24565
|
return alive;
|
|
24435
24566
|
}
|
|
24436
24567
|
function isPathWithin(child, parent) {
|
|
24437
|
-
const rel =
|
|
24438
|
-
return rel !== "" && !rel.startsWith("..") && !
|
|
24568
|
+
const rel = path26.relative(parent, child);
|
|
24569
|
+
return rel !== "" && !rel.startsWith("..") && !path26.isAbsolute(rel);
|
|
24439
24570
|
}
|
|
24440
24571
|
function tryRealpath(p) {
|
|
24441
24572
|
try {
|
|
24442
|
-
return
|
|
24573
|
+
return fs23.realpathSync(p);
|
|
24443
24574
|
} catch {
|
|
24444
24575
|
return p;
|
|
24445
24576
|
}
|
|
24446
24577
|
}
|
|
24447
24578
|
async function killToolServerForInstallDir(packageDir) {
|
|
24448
|
-
const parents = /* @__PURE__ */ new Set([
|
|
24579
|
+
const parents = /* @__PURE__ */ new Set([path26.resolve(packageDir), tryRealpath(packageDir)]);
|
|
24449
24580
|
let killed = 0;
|
|
24450
24581
|
for (const { file, state: state2 } of await readAllToolsServerStates()) {
|
|
24451
|
-
const bundles = /* @__PURE__ */ new Set([
|
|
24582
|
+
const bundles = /* @__PURE__ */ new Set([path26.resolve(state2.bundlePath), tryRealpath(state2.bundlePath)]);
|
|
24452
24583
|
const matches2 = [...bundles].some((b) => [...parents].some((p) => isPathWithin(b, p)));
|
|
24453
24584
|
if (!matches2) continue;
|
|
24454
24585
|
const fresh = await readStateFile(file);
|
|
@@ -24466,11 +24597,11 @@ async function killToolServerForInstallDir(packageDir) {
|
|
|
24466
24597
|
}
|
|
24467
24598
|
return killed;
|
|
24468
24599
|
}
|
|
24469
|
-
var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) =>
|
|
24600
|
+
var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs23.existsSync(p)) ?? "ps";
|
|
24470
24601
|
var PS_WIDTH_FLAGS = ["-ww"];
|
|
24471
24602
|
var PS_LOCALE = process.platform === "darwin" ? "en_US.UTF-8" : "C.UTF-8";
|
|
24472
24603
|
function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS, env = { ...process.env, LC_ALL: PS_LOCALE }) {
|
|
24473
|
-
return
|
|
24604
|
+
return execFileSync8(PS_BIN, [...flags, "-p", String(pid), "-o", "command="], {
|
|
24474
24605
|
env,
|
|
24475
24606
|
encoding: "utf8",
|
|
24476
24607
|
timeout: 2e3,
|
|
@@ -24513,14 +24644,14 @@ function couldBeOurToolServer(pid, marker) {
|
|
|
24513
24644
|
var import_yaml4 = __toESM(require_dist2(), 1);
|
|
24514
24645
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
24515
24646
|
import { maxHeaderSize } from "node:http";
|
|
24516
|
-
import * as
|
|
24647
|
+
import * as path30 from "node:path";
|
|
24517
24648
|
|
|
24518
24649
|
// ../argent-tools-client/src/link-config.ts
|
|
24519
|
-
import * as
|
|
24650
|
+
import * as path27 from "node:path";
|
|
24520
24651
|
import { homedir as homedir8 } from "node:os";
|
|
24521
24652
|
import { mkdir as mkdir2, writeFile as writeFile2, readFile as readFile2, unlink as unlink2, chmod as chmod2 } from "node:fs/promises";
|
|
24522
|
-
var LINK_DIR =
|
|
24523
|
-
var LINK_FILE =
|
|
24653
|
+
var LINK_DIR = path27.join(homedir8(), ".argent");
|
|
24654
|
+
var LINK_FILE = path27.join(LINK_DIR, "link.json");
|
|
24524
24655
|
|
|
24525
24656
|
// ../argent-tools-client/src/file-inputs.ts
|
|
24526
24657
|
import { createHash as createHash4, randomUUID as randomUUID6 } from "node:crypto";
|
|
@@ -24536,15 +24667,15 @@ import {
|
|
|
24536
24667
|
stat as stat3,
|
|
24537
24668
|
writeFile as writeFile3
|
|
24538
24669
|
} from "node:fs/promises";
|
|
24539
|
-
import { constants, tmpdir } from "node:os";
|
|
24540
|
-
import * as
|
|
24670
|
+
import { constants as constants2, tmpdir } from "node:os";
|
|
24671
|
+
import * as path28 from "node:path";
|
|
24541
24672
|
|
|
24542
24673
|
// ../archive/src/index.ts
|
|
24543
24674
|
import { spawn as spawn5 } from "node:child_process";
|
|
24544
24675
|
import { once } from "node:events";
|
|
24545
24676
|
import { createReadStream, createWriteStream } from "node:fs";
|
|
24546
24677
|
import { open, rm, readdir as readdir3 } from "node:fs/promises";
|
|
24547
|
-
import { basename as basename5, dirname as dirname14, join as
|
|
24678
|
+
import { basename as basename5, dirname as dirname14, join as join25, resolve as resolve16, sep as sep4 } from "node:path";
|
|
24548
24679
|
import { Writable } from "node:stream";
|
|
24549
24680
|
import { pipeline } from "node:stream/promises";
|
|
24550
24681
|
import zlib2 from "node:zlib";
|
|
@@ -24562,7 +24693,7 @@ var MAX_CONTENT_BYTES = 32 * 1024 * 1024;
|
|
|
24562
24693
|
// ../argent-tools-client/src/flow-files.ts
|
|
24563
24694
|
var import_yaml3 = __toESM(require_dist2(), 1);
|
|
24564
24695
|
import { readdir as readdir4, readFile as readFile4, realpath as realpath3, stat as stat4 } from "node:fs/promises";
|
|
24565
|
-
import * as
|
|
24696
|
+
import * as path29 from "node:path";
|
|
24566
24697
|
var INLINE_MEMBERS_BYTES = 256 * 1024;
|
|
24567
24698
|
|
|
24568
24699
|
// ../argent-tools-client/src/artifacts.ts
|
|
@@ -24578,7 +24709,7 @@ import {
|
|
|
24578
24709
|
} from "node:fs/promises";
|
|
24579
24710
|
import { constants as fsConstants } from "node:fs";
|
|
24580
24711
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
24581
|
-
import { basename as basename8, dirname as dirname18, extname as extname2, isAbsolute as
|
|
24712
|
+
import { basename as basename8, dirname as dirname18, extname as extname2, isAbsolute as isAbsolute9, join as join29, normalize as normalize2, resolve as resolve19, sep as sep7 } from "node:path";
|
|
24582
24713
|
import { createHash as createHash5 } from "node:crypto";
|
|
24583
24714
|
var ALLOWED_SAVE_DIRS = /* @__PURE__ */ new Set([normalize2(".argent/recordings")]);
|
|
24584
24715
|
var RECORDINGS_SAVE_DIR = normalize2(".argent/recordings");
|
|
@@ -24653,7 +24784,7 @@ function resolveUpdatePackageAction(trigger, installed) {
|
|
|
24653
24784
|
return installed ? "standalone_update" : "standalone_install";
|
|
24654
24785
|
}
|
|
24655
24786
|
function isLivePinnedEntry(entry) {
|
|
24656
|
-
return entry !== null && isPinnedGlobalEntry(entry) &&
|
|
24787
|
+
return entry !== null && isPinnedGlobalEntry(entry) && fs24.existsSync(entry.command) && fs24.existsSync(entry.args[0]);
|
|
24657
24788
|
}
|
|
24658
24789
|
async function update(args) {
|
|
24659
24790
|
const nonInteractive = args.includes("--yes") || args.includes("-y");
|
|
@@ -24942,7 +25073,7 @@ async function update(args) {
|
|
|
24942
25073
|
process.exit(1);
|
|
24943
25074
|
}
|
|
24944
25075
|
const rootOverride = getProjectRootOverride(args);
|
|
24945
|
-
const projectRoot = rootOverride ?
|
|
25076
|
+
const projectRoot = rootOverride ? path31.resolve(rootOverride) : resolveProjectRoot2(process.cwd());
|
|
24946
25077
|
installMode = resolveInstallMode(projectRoot);
|
|
24947
25078
|
const flags = parseTargetFlags(args);
|
|
24948
25079
|
const localInstalled = installMode === "local" && probeLocalInstall(projectRoot).installed;
|
|
@@ -25142,8 +25273,8 @@ async function update(args) {
|
|
|
25142
25273
|
// ../argent-installer/src/uninstall.ts
|
|
25143
25274
|
var import_picocolors13 = __toESM(require_picocolors(), 1);
|
|
25144
25275
|
var import_yaml5 = __toESM(require_dist2(), 1);
|
|
25145
|
-
import * as
|
|
25146
|
-
import * as
|
|
25276
|
+
import * as fs25 from "node:fs";
|
|
25277
|
+
import * as path32 from "node:path";
|
|
25147
25278
|
var UNINSTALL_TOOLSERVER_STOP_FAILED = {
|
|
25148
25279
|
error_code: FAILURE_CODES.UNINSTALL_TOOLSERVER_STOP_FAILED,
|
|
25149
25280
|
failure_stage: "installer_uninstall_toolserver_stop",
|
|
@@ -25164,10 +25295,10 @@ var UNINSTALL_UNCLASSIFIED_FAILED = {
|
|
|
25164
25295
|
};
|
|
25165
25296
|
function removeDirIfEmpty2(dirPath) {
|
|
25166
25297
|
try {
|
|
25167
|
-
if (!
|
|
25168
|
-
if (!
|
|
25169
|
-
if (
|
|
25170
|
-
|
|
25298
|
+
if (!fs25.existsSync(dirPath)) return false;
|
|
25299
|
+
if (!fs25.statSync(dirPath).isDirectory()) return false;
|
|
25300
|
+
if (fs25.readdirSync(dirPath).length > 0) return false;
|
|
25301
|
+
fs25.rmdirSync(dirPath);
|
|
25171
25302
|
return true;
|
|
25172
25303
|
} catch {
|
|
25173
25304
|
return false;
|
|
@@ -25177,9 +25308,9 @@ function collectBundledPaths(sourceDir) {
|
|
|
25177
25308
|
const files = [];
|
|
25178
25309
|
const directories = [];
|
|
25179
25310
|
function walk(currentDir, relativeDir = "") {
|
|
25180
|
-
for (const entry of
|
|
25181
|
-
const relativePath = relativeDir ?
|
|
25182
|
-
const absolutePath =
|
|
25311
|
+
for (const entry of fs25.readdirSync(currentDir, { withFileTypes: true })) {
|
|
25312
|
+
const relativePath = relativeDir ? path32.join(relativeDir, entry.name) : entry.name;
|
|
25313
|
+
const absolutePath = path32.join(currentDir, entry.name);
|
|
25183
25314
|
if (entry.isDirectory()) {
|
|
25184
25315
|
walk(absolutePath, relativePath);
|
|
25185
25316
|
directories.push(relativePath);
|
|
@@ -25192,15 +25323,15 @@ function collectBundledPaths(sourceDir) {
|
|
|
25192
25323
|
return { files, directories };
|
|
25193
25324
|
}
|
|
25194
25325
|
function removeBundledContent(sourceDir, targetDir) {
|
|
25195
|
-
if (!
|
|
25326
|
+
if (!fs25.existsSync(sourceDir) || !fs25.existsSync(targetDir)) {
|
|
25196
25327
|
return { removedPaths: [], removedRoot: false };
|
|
25197
25328
|
}
|
|
25198
25329
|
const { files, directories } = collectBundledPaths(sourceDir);
|
|
25199
25330
|
const removedPaths = [];
|
|
25200
25331
|
for (const relativePath of files) {
|
|
25201
|
-
const targetPath =
|
|
25332
|
+
const targetPath = path32.join(targetDir, relativePath);
|
|
25202
25333
|
try {
|
|
25203
|
-
const entry =
|
|
25334
|
+
const entry = fs25.lstatSync(targetPath, { throwIfNoEntry: false });
|
|
25204
25335
|
if (!entry || entry.isDirectory()) continue;
|
|
25205
25336
|
removePath(targetPath);
|
|
25206
25337
|
removedPaths.push(relativePath);
|
|
@@ -25208,36 +25339,36 @@ function removeBundledContent(sourceDir, targetDir) {
|
|
|
25208
25339
|
}
|
|
25209
25340
|
}
|
|
25210
25341
|
directories.sort(
|
|
25211
|
-
(a2, b) => b.split(
|
|
25342
|
+
(a2, b) => b.split(path32.sep).length - a2.split(path32.sep).length || b.length - a2.length
|
|
25212
25343
|
);
|
|
25213
25344
|
for (const relativePath of directories) {
|
|
25214
|
-
const targetPath =
|
|
25345
|
+
const targetPath = path32.join(targetDir, relativePath);
|
|
25215
25346
|
try {
|
|
25216
|
-
if (!
|
|
25217
|
-
if (!
|
|
25218
|
-
if (
|
|
25219
|
-
|
|
25347
|
+
if (!fs25.existsSync(targetPath)) continue;
|
|
25348
|
+
if (!fs25.statSync(targetPath).isDirectory()) continue;
|
|
25349
|
+
if (fs25.readdirSync(targetPath).length > 0) continue;
|
|
25350
|
+
fs25.rmdirSync(targetPath);
|
|
25220
25351
|
} catch {
|
|
25221
25352
|
}
|
|
25222
25353
|
}
|
|
25223
25354
|
let removedRoot = false;
|
|
25224
25355
|
try {
|
|
25225
|
-
if (
|
|
25226
|
-
if (
|
|
25227
|
-
|
|
25356
|
+
if (fs25.existsSync(targetDir) && fs25.statSync(targetDir).isDirectory()) {
|
|
25357
|
+
if (fs25.readdirSync(targetDir).length === 0) {
|
|
25358
|
+
fs25.rmdirSync(targetDir);
|
|
25228
25359
|
removedRoot = true;
|
|
25229
25360
|
}
|
|
25230
25361
|
}
|
|
25231
25362
|
} catch {
|
|
25232
25363
|
}
|
|
25233
25364
|
if (removedRoot) {
|
|
25234
|
-
removeDirIfEmpty2(
|
|
25365
|
+
removeDirIfEmpty2(path32.dirname(targetDir));
|
|
25235
25366
|
}
|
|
25236
25367
|
return { removedPaths, removedRoot };
|
|
25237
25368
|
}
|
|
25238
25369
|
function readBundledSkillName(skillFilePath, fallbackName) {
|
|
25239
25370
|
try {
|
|
25240
|
-
const content =
|
|
25371
|
+
const content = fs25.readFileSync(skillFilePath, "utf8");
|
|
25241
25372
|
const frontmatter = content.match(/^---\r?\n([\s\S]*?)\r?\n---/)?.[1];
|
|
25242
25373
|
if (!frontmatter) return fallbackName;
|
|
25243
25374
|
const data = (0, import_yaml5.parse)(frontmatter);
|
|
@@ -25248,23 +25379,23 @@ function readBundledSkillName(skillFilePath, fallbackName) {
|
|
|
25248
25379
|
}
|
|
25249
25380
|
}
|
|
25250
25381
|
function getBundledSkillNames(skillsDir) {
|
|
25251
|
-
if (!
|
|
25382
|
+
if (!fs25.existsSync(skillsDir)) return [];
|
|
25252
25383
|
const skillNames = [];
|
|
25253
|
-
for (const entry of
|
|
25384
|
+
for (const entry of fs25.readdirSync(skillsDir, { withFileTypes: true })) {
|
|
25254
25385
|
if (!entry.isDirectory()) continue;
|
|
25255
|
-
const skillFilePath =
|
|
25256
|
-
if (!
|
|
25386
|
+
const skillFilePath = path32.join(skillsDir, entry.name, "SKILL.md");
|
|
25387
|
+
if (!fs25.existsSync(skillFilePath)) continue;
|
|
25257
25388
|
skillNames.push(readBundledSkillName(skillFilePath, entry.name));
|
|
25258
25389
|
}
|
|
25259
25390
|
return [...new Set(skillNames)].sort();
|
|
25260
25391
|
}
|
|
25261
25392
|
function removeBundledSkillInstalls(skillNames, targetDir) {
|
|
25262
|
-
if (!
|
|
25393
|
+
if (!fs25.existsSync(targetDir)) {
|
|
25263
25394
|
return { removedPaths: [], removedRoot: false };
|
|
25264
25395
|
}
|
|
25265
25396
|
const removedPaths = [];
|
|
25266
25397
|
for (const skillName of skillNames) {
|
|
25267
|
-
const targetPath =
|
|
25398
|
+
const targetPath = path32.join(targetDir, skillName);
|
|
25268
25399
|
try {
|
|
25269
25400
|
if (removePath(targetPath)) removedPaths.push(skillName);
|
|
25270
25401
|
} catch {
|
|
@@ -25272,17 +25403,17 @@ function removeBundledSkillInstalls(skillNames, targetDir) {
|
|
|
25272
25403
|
}
|
|
25273
25404
|
const removedRoot = removeDirIfEmpty2(targetDir);
|
|
25274
25405
|
if (removedRoot) {
|
|
25275
|
-
removeDirIfEmpty2(
|
|
25406
|
+
removeDirIfEmpty2(path32.dirname(targetDir));
|
|
25276
25407
|
}
|
|
25277
25408
|
return { removedPaths, removedRoot };
|
|
25278
25409
|
}
|
|
25279
25410
|
function cleanupSkillsLockFile(lockPath, skillNames) {
|
|
25280
|
-
if (!
|
|
25411
|
+
if (!fs25.existsSync(lockPath)) {
|
|
25281
25412
|
return { removedSkills: [], removedFile: false };
|
|
25282
25413
|
}
|
|
25283
25414
|
let parsed;
|
|
25284
25415
|
try {
|
|
25285
|
-
parsed = JSON.parse(
|
|
25416
|
+
parsed = JSON.parse(fs25.readFileSync(lockPath, "utf8"));
|
|
25286
25417
|
} catch {
|
|
25287
25418
|
return { removedSkills: [], removedFile: false };
|
|
25288
25419
|
}
|
|
@@ -25309,10 +25440,10 @@ function cleanupSkillsLockFile(lockPath, skillNames) {
|
|
|
25309
25440
|
parsed.skills && typeof parsed.skills === "object" && Object.keys(parsed.skills).length > 0
|
|
25310
25441
|
);
|
|
25311
25442
|
if (!hasSkills && otherKeys.length === 0) {
|
|
25312
|
-
|
|
25443
|
+
fs25.rmSync(lockPath, { force: true });
|
|
25313
25444
|
return { removedSkills, removedFile: true };
|
|
25314
25445
|
}
|
|
25315
|
-
|
|
25446
|
+
fs25.writeFileSync(lockPath, JSON.stringify(parsed, null, 2) + "\n");
|
|
25316
25447
|
return { removedSkills, removedFile: false };
|
|
25317
25448
|
}
|
|
25318
25449
|
function cleanupBundledSkills(skillNames, targets) {
|
|
@@ -25515,7 +25646,7 @@ async function uninstall(args) {
|
|
|
25515
25646
|
),
|
|
25516
25647
|
{ ask: false }
|
|
25517
25648
|
);
|
|
25518
|
-
for (const root of retired.removedRoots) removeDirIfEmpty2(
|
|
25649
|
+
for (const root of retired.removedRoots) removeDirIfEmpty2(path32.dirname(root));
|
|
25519
25650
|
const retiredLines = formatRetiredCleanup(retired);
|
|
25520
25651
|
pruneResults.push(...retiredLines.removed.map((line) => `${import_picocolors13.default.green("+")} ${line}`));
|
|
25521
25652
|
const retiredKept = retiredLines.kept.map((line) => ` ${line}`);
|
|
@@ -25634,7 +25765,7 @@ async function uninstall(args) {
|
|
|
25634
25765
|
try {
|
|
25635
25766
|
execShellCommandSync(removable.cmd, { cwd: removable.cwd, env: removable.env });
|
|
25636
25767
|
const leftover = removable.kind === "global" ? getRemainingGlobalBinaryPath() : null;
|
|
25637
|
-
const removed = !leftover || removable.installDir !== null && !
|
|
25768
|
+
const removed = !leftover || removable.installDir !== null && !fs25.existsSync(removable.installDir);
|
|
25638
25769
|
if (removed) hasUninstalledPackage = true;
|
|
25639
25770
|
if (removed && removeCliRecordFor(removable.installDir)) {
|
|
25640
25771
|
log.info(import_picocolors13.default.dim("Removed ~/.argent/cli.json (provider CLI discovery record)."));
|