@ai-setting/roy-agent-cli 1.5.117 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/roy-agent.js +837 -703
- package/dist/index.js +837 -703
- package/dist/roy-agent-linux-x64/bin/roy-agent +0 -0
- package/package.json +1 -1
package/dist/bin/roy-agent.js
CHANGED
|
@@ -433,7 +433,7 @@ function parseSlashCommand(input) {
|
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
-
// ../../node_modules/.
|
|
436
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/identity.js
|
|
437
437
|
var require_identity = __commonJS((exports) => {
|
|
438
438
|
var ALIAS = Symbol.for("yaml.alias");
|
|
439
439
|
var DOC = Symbol.for("yaml.document");
|
|
@@ -487,7 +487,7 @@ var require_identity = __commonJS((exports) => {
|
|
|
487
487
|
exports.isSeq = isSeq;
|
|
488
488
|
});
|
|
489
489
|
|
|
490
|
-
// ../../node_modules/.
|
|
490
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/visit.js
|
|
491
491
|
var require_visit = __commonJS((exports) => {
|
|
492
492
|
var identity = require_identity();
|
|
493
493
|
var BREAK = Symbol("break visit");
|
|
@@ -642,7 +642,7 @@ var require_visit = __commonJS((exports) => {
|
|
|
642
642
|
exports.visitAsync = visitAsync;
|
|
643
643
|
});
|
|
644
644
|
|
|
645
|
-
// ../../node_modules/.
|
|
645
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/doc/directives.js
|
|
646
646
|
var require_directives = __commonJS((exports) => {
|
|
647
647
|
var identity = require_identity();
|
|
648
648
|
var visit = require_visit();
|
|
@@ -794,7 +794,7 @@ var require_directives = __commonJS((exports) => {
|
|
|
794
794
|
exports.Directives = Directives;
|
|
795
795
|
});
|
|
796
796
|
|
|
797
|
-
// ../../node_modules/.
|
|
797
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/doc/anchors.js
|
|
798
798
|
var require_anchors = __commonJS((exports) => {
|
|
799
799
|
var identity = require_identity();
|
|
800
800
|
var visit = require_visit();
|
|
@@ -856,7 +856,7 @@ var require_anchors = __commonJS((exports) => {
|
|
|
856
856
|
exports.findNewAnchor = findNewAnchor;
|
|
857
857
|
});
|
|
858
858
|
|
|
859
|
-
// ../../node_modules/.
|
|
859
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/doc/applyReviver.js
|
|
860
860
|
var require_applyReviver = __commonJS((exports) => {
|
|
861
861
|
function applyReviver(reviver, obj, key, val) {
|
|
862
862
|
if (val && typeof val === "object") {
|
|
@@ -903,7 +903,7 @@ var require_applyReviver = __commonJS((exports) => {
|
|
|
903
903
|
exports.applyReviver = applyReviver;
|
|
904
904
|
});
|
|
905
905
|
|
|
906
|
-
// ../../node_modules/.
|
|
906
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/toJS.js
|
|
907
907
|
var require_toJS = __commonJS((exports) => {
|
|
908
908
|
var identity = require_identity();
|
|
909
909
|
function toJS(value, arg, ctx) {
|
|
@@ -930,7 +930,7 @@ var require_toJS = __commonJS((exports) => {
|
|
|
930
930
|
exports.toJS = toJS;
|
|
931
931
|
});
|
|
932
932
|
|
|
933
|
-
// ../../node_modules/.
|
|
933
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/Node.js
|
|
934
934
|
var require_Node = __commonJS((exports) => {
|
|
935
935
|
var applyReviver = require_applyReviver();
|
|
936
936
|
var identity = require_identity();
|
|
@@ -967,7 +967,7 @@ var require_Node = __commonJS((exports) => {
|
|
|
967
967
|
exports.NodeBase = NodeBase;
|
|
968
968
|
});
|
|
969
969
|
|
|
970
|
-
// ../../node_modules/.
|
|
970
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/Alias.js
|
|
971
971
|
var require_Alias = __commonJS((exports) => {
|
|
972
972
|
var anchors = require_anchors();
|
|
973
973
|
var visit = require_visit();
|
|
@@ -1077,7 +1077,7 @@ var require_Alias = __commonJS((exports) => {
|
|
|
1077
1077
|
exports.Alias = Alias;
|
|
1078
1078
|
});
|
|
1079
1079
|
|
|
1080
|
-
// ../../node_modules/.
|
|
1080
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/Scalar.js
|
|
1081
1081
|
var require_Scalar = __commonJS((exports) => {
|
|
1082
1082
|
var identity = require_identity();
|
|
1083
1083
|
var Node = require_Node();
|
|
@@ -1105,7 +1105,7 @@ var require_Scalar = __commonJS((exports) => {
|
|
|
1105
1105
|
exports.isScalarValue = isScalarValue;
|
|
1106
1106
|
});
|
|
1107
1107
|
|
|
1108
|
-
// ../../node_modules/.
|
|
1108
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/doc/createNode.js
|
|
1109
1109
|
var require_createNode = __commonJS((exports) => {
|
|
1110
1110
|
var Alias = require_Alias();
|
|
1111
1111
|
var identity = require_identity();
|
|
@@ -1177,7 +1177,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
1177
1177
|
exports.createNode = createNode;
|
|
1178
1178
|
});
|
|
1179
1179
|
|
|
1180
|
-
// ../../node_modules/.
|
|
1180
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/Collection.js
|
|
1181
1181
|
var require_Collection = __commonJS((exports) => {
|
|
1182
1182
|
var createNode = require_createNode();
|
|
1183
1183
|
var identity = require_identity();
|
|
@@ -1292,7 +1292,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
1292
1292
|
exports.isEmptyPath = isEmptyPath;
|
|
1293
1293
|
});
|
|
1294
1294
|
|
|
1295
|
-
// ../../node_modules/.
|
|
1295
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/stringifyComment.js
|
|
1296
1296
|
var require_stringifyComment = __commonJS((exports) => {
|
|
1297
1297
|
var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
|
|
1298
1298
|
function indentComment(comment, indent) {
|
|
@@ -1309,7 +1309,7 @@ var require_stringifyComment = __commonJS((exports) => {
|
|
|
1309
1309
|
exports.stringifyComment = stringifyComment;
|
|
1310
1310
|
});
|
|
1311
1311
|
|
|
1312
|
-
// ../../node_modules/.
|
|
1312
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/foldFlowLines.js
|
|
1313
1313
|
var require_foldFlowLines = __commonJS((exports) => {
|
|
1314
1314
|
var FOLD_FLOW = "flow";
|
|
1315
1315
|
var FOLD_BLOCK = "block";
|
|
@@ -1446,7 +1446,7 @@ ${indent}${text.slice(fold + 1, end2)}`;
|
|
|
1446
1446
|
exports.foldFlowLines = foldFlowLines;
|
|
1447
1447
|
});
|
|
1448
1448
|
|
|
1449
|
-
// ../../node_modules/.
|
|
1449
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/stringifyString.js
|
|
1450
1450
|
var require_stringifyString = __commonJS((exports) => {
|
|
1451
1451
|
var Scalar = require_Scalar();
|
|
1452
1452
|
var foldFlowLines = require_foldFlowLines();
|
|
@@ -1744,7 +1744,7 @@ ${indent}`);
|
|
|
1744
1744
|
exports.stringifyString = stringifyString;
|
|
1745
1745
|
});
|
|
1746
1746
|
|
|
1747
|
-
// ../../node_modules/.
|
|
1747
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/stringify.js
|
|
1748
1748
|
var require_stringify = __commonJS((exports) => {
|
|
1749
1749
|
var anchors = require_anchors();
|
|
1750
1750
|
var identity = require_identity();
|
|
@@ -1865,7 +1865,7 @@ ${ctx.indent}${str}`;
|
|
|
1865
1865
|
exports.stringify = stringify;
|
|
1866
1866
|
});
|
|
1867
1867
|
|
|
1868
|
-
// ../../node_modules/.
|
|
1868
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/stringifyPair.js
|
|
1869
1869
|
var require_stringifyPair = __commonJS((exports) => {
|
|
1870
1870
|
var identity = require_identity();
|
|
1871
1871
|
var Scalar = require_Scalar();
|
|
@@ -2001,7 +2001,7 @@ ${ctx.indent}`;
|
|
|
2001
2001
|
exports.stringifyPair = stringifyPair;
|
|
2002
2002
|
});
|
|
2003
2003
|
|
|
2004
|
-
// ../../node_modules/.
|
|
2004
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/log.js
|
|
2005
2005
|
var require_log = __commonJS((exports) => {
|
|
2006
2006
|
var node_process = __require("process");
|
|
2007
2007
|
function debug(logLevel, ...messages) {
|
|
@@ -2020,7 +2020,7 @@ var require_log = __commonJS((exports) => {
|
|
|
2020
2020
|
exports.warn = warn;
|
|
2021
2021
|
});
|
|
2022
2022
|
|
|
2023
|
-
// ../../node_modules/.
|
|
2023
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/merge.js
|
|
2024
2024
|
var require_merge = __commonJS((exports) => {
|
|
2025
2025
|
var identity = require_identity();
|
|
2026
2026
|
var Scalar = require_Scalar();
|
|
@@ -2077,7 +2077,7 @@ var require_merge = __commonJS((exports) => {
|
|
|
2077
2077
|
exports.merge = merge;
|
|
2078
2078
|
});
|
|
2079
2079
|
|
|
2080
|
-
// ../../node_modules/.
|
|
2080
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/addPairToJSMap.js
|
|
2081
2081
|
var require_addPairToJSMap = __commonJS((exports) => {
|
|
2082
2082
|
var log = require_log();
|
|
2083
2083
|
var merge = require_merge();
|
|
@@ -2138,7 +2138,7 @@ var require_addPairToJSMap = __commonJS((exports) => {
|
|
|
2138
2138
|
exports.addPairToJSMap = addPairToJSMap;
|
|
2139
2139
|
});
|
|
2140
2140
|
|
|
2141
|
-
// ../../node_modules/.
|
|
2141
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/Pair.js
|
|
2142
2142
|
var require_Pair = __commonJS((exports) => {
|
|
2143
2143
|
var createNode = require_createNode();
|
|
2144
2144
|
var stringifyPair = require_stringifyPair();
|
|
@@ -2176,7 +2176,7 @@ var require_Pair = __commonJS((exports) => {
|
|
|
2176
2176
|
exports.createPair = createPair;
|
|
2177
2177
|
});
|
|
2178
2178
|
|
|
2179
|
-
// ../../node_modules/.
|
|
2179
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/stringifyCollection.js
|
|
2180
2180
|
var require_stringifyCollection = __commonJS((exports) => {
|
|
2181
2181
|
var identity = require_identity();
|
|
2182
2182
|
var stringify = require_stringify();
|
|
@@ -2328,7 +2328,7 @@ ${indent}${end}`;
|
|
|
2328
2328
|
exports.stringifyCollection = stringifyCollection;
|
|
2329
2329
|
});
|
|
2330
2330
|
|
|
2331
|
-
// ../../node_modules/.
|
|
2331
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/YAMLMap.js
|
|
2332
2332
|
var require_YAMLMap = __commonJS((exports) => {
|
|
2333
2333
|
var stringifyCollection = require_stringifyCollection();
|
|
2334
2334
|
var addPairToJSMap = require_addPairToJSMap();
|
|
@@ -2455,7 +2455,7 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
2455
2455
|
exports.findPair = findPair;
|
|
2456
2456
|
});
|
|
2457
2457
|
|
|
2458
|
-
// ../../node_modules/.
|
|
2458
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/common/map.js
|
|
2459
2459
|
var require_map = __commonJS((exports) => {
|
|
2460
2460
|
var identity = require_identity();
|
|
2461
2461
|
var YAMLMap = require_YAMLMap();
|
|
@@ -2474,7 +2474,7 @@ var require_map = __commonJS((exports) => {
|
|
|
2474
2474
|
exports.map = map;
|
|
2475
2475
|
});
|
|
2476
2476
|
|
|
2477
|
-
// ../../node_modules/.
|
|
2477
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/YAMLSeq.js
|
|
2478
2478
|
var require_YAMLSeq = __commonJS((exports) => {
|
|
2479
2479
|
var createNode = require_createNode();
|
|
2480
2480
|
var stringifyCollection = require_stringifyCollection();
|
|
@@ -2567,7 +2567,7 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
2567
2567
|
exports.YAMLSeq = YAMLSeq;
|
|
2568
2568
|
});
|
|
2569
2569
|
|
|
2570
|
-
// ../../node_modules/.
|
|
2570
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/common/seq.js
|
|
2571
2571
|
var require_seq = __commonJS((exports) => {
|
|
2572
2572
|
var identity = require_identity();
|
|
2573
2573
|
var YAMLSeq = require_YAMLSeq();
|
|
@@ -2586,7 +2586,7 @@ var require_seq = __commonJS((exports) => {
|
|
|
2586
2586
|
exports.seq = seq;
|
|
2587
2587
|
});
|
|
2588
2588
|
|
|
2589
|
-
// ../../node_modules/.
|
|
2589
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/common/string.js
|
|
2590
2590
|
var require_string = __commonJS((exports) => {
|
|
2591
2591
|
var stringifyString = require_stringifyString();
|
|
2592
2592
|
var string = {
|
|
@@ -2602,7 +2602,7 @@ var require_string = __commonJS((exports) => {
|
|
|
2602
2602
|
exports.string = string;
|
|
2603
2603
|
});
|
|
2604
2604
|
|
|
2605
|
-
// ../../node_modules/.
|
|
2605
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/common/null.js
|
|
2606
2606
|
var require_null = __commonJS((exports) => {
|
|
2607
2607
|
var Scalar = require_Scalar();
|
|
2608
2608
|
var nullTag = {
|
|
@@ -2617,7 +2617,7 @@ var require_null = __commonJS((exports) => {
|
|
|
2617
2617
|
exports.nullTag = nullTag;
|
|
2618
2618
|
});
|
|
2619
2619
|
|
|
2620
|
-
// ../../node_modules/.
|
|
2620
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/core/bool.js
|
|
2621
2621
|
var require_bool = __commonJS((exports) => {
|
|
2622
2622
|
var Scalar = require_Scalar();
|
|
2623
2623
|
var boolTag = {
|
|
@@ -2638,7 +2638,7 @@ var require_bool = __commonJS((exports) => {
|
|
|
2638
2638
|
exports.boolTag = boolTag;
|
|
2639
2639
|
});
|
|
2640
2640
|
|
|
2641
|
-
// ../../node_modules/.
|
|
2641
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/stringifyNumber.js
|
|
2642
2642
|
var require_stringifyNumber = __commonJS((exports) => {
|
|
2643
2643
|
function stringifyNumber({ format, minFractionDigits, tag, value }) {
|
|
2644
2644
|
if (typeof value === "bigint")
|
|
@@ -2662,7 +2662,7 @@ var require_stringifyNumber = __commonJS((exports) => {
|
|
|
2662
2662
|
exports.stringifyNumber = stringifyNumber;
|
|
2663
2663
|
});
|
|
2664
2664
|
|
|
2665
|
-
// ../../node_modules/.
|
|
2665
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/core/float.js
|
|
2666
2666
|
var require_float = __commonJS((exports) => {
|
|
2667
2667
|
var Scalar = require_Scalar();
|
|
2668
2668
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -2705,7 +2705,7 @@ var require_float = __commonJS((exports) => {
|
|
|
2705
2705
|
exports.floatNaN = floatNaN;
|
|
2706
2706
|
});
|
|
2707
2707
|
|
|
2708
|
-
// ../../node_modules/.
|
|
2708
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/core/int.js
|
|
2709
2709
|
var require_int = __commonJS((exports) => {
|
|
2710
2710
|
var stringifyNumber = require_stringifyNumber();
|
|
2711
2711
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -2747,7 +2747,7 @@ var require_int = __commonJS((exports) => {
|
|
|
2747
2747
|
exports.intOct = intOct;
|
|
2748
2748
|
});
|
|
2749
2749
|
|
|
2750
|
-
// ../../node_modules/.
|
|
2750
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/core/schema.js
|
|
2751
2751
|
var require_schema = __commonJS((exports) => {
|
|
2752
2752
|
var map = require_map();
|
|
2753
2753
|
var _null = require_null();
|
|
@@ -2772,7 +2772,7 @@ var require_schema = __commonJS((exports) => {
|
|
|
2772
2772
|
exports.schema = schema;
|
|
2773
2773
|
});
|
|
2774
2774
|
|
|
2775
|
-
// ../../node_modules/.
|
|
2775
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/json/schema.js
|
|
2776
2776
|
var require_schema2 = __commonJS((exports) => {
|
|
2777
2777
|
var Scalar = require_Scalar();
|
|
2778
2778
|
var map = require_map();
|
|
@@ -2836,7 +2836,7 @@ var require_schema2 = __commonJS((exports) => {
|
|
|
2836
2836
|
exports.schema = schema;
|
|
2837
2837
|
});
|
|
2838
2838
|
|
|
2839
|
-
// ../../node_modules/.
|
|
2839
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/binary.js
|
|
2840
2840
|
var require_binary = __commonJS((exports) => {
|
|
2841
2841
|
var node_buffer = __require("buffer");
|
|
2842
2842
|
var Scalar = require_Scalar();
|
|
@@ -2891,7 +2891,7 @@ var require_binary = __commonJS((exports) => {
|
|
|
2891
2891
|
exports.binary = binary;
|
|
2892
2892
|
});
|
|
2893
2893
|
|
|
2894
|
-
// ../../node_modules/.
|
|
2894
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
|
|
2895
2895
|
var require_pairs = __commonJS((exports) => {
|
|
2896
2896
|
var identity = require_identity();
|
|
2897
2897
|
var Pair = require_Pair();
|
|
@@ -2966,7 +2966,7 @@ ${cn.comment}` : item.comment;
|
|
|
2966
2966
|
exports.resolvePairs = resolvePairs;
|
|
2967
2967
|
});
|
|
2968
2968
|
|
|
2969
|
-
// ../../node_modules/.
|
|
2969
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/omap.js
|
|
2970
2970
|
var require_omap = __commonJS((exports) => {
|
|
2971
2971
|
var identity = require_identity();
|
|
2972
2972
|
var toJS = require_toJS();
|
|
@@ -3038,7 +3038,7 @@ var require_omap = __commonJS((exports) => {
|
|
|
3038
3038
|
exports.omap = omap;
|
|
3039
3039
|
});
|
|
3040
3040
|
|
|
3041
|
-
// ../../node_modules/.
|
|
3041
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/bool.js
|
|
3042
3042
|
var require_bool2 = __commonJS((exports) => {
|
|
3043
3043
|
var Scalar = require_Scalar();
|
|
3044
3044
|
function boolStringify({ value, source }, ctx) {
|
|
@@ -3067,7 +3067,7 @@ var require_bool2 = __commonJS((exports) => {
|
|
|
3067
3067
|
exports.trueTag = trueTag;
|
|
3068
3068
|
});
|
|
3069
3069
|
|
|
3070
|
-
// ../../node_modules/.
|
|
3070
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/float.js
|
|
3071
3071
|
var require_float2 = __commonJS((exports) => {
|
|
3072
3072
|
var Scalar = require_Scalar();
|
|
3073
3073
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -3113,7 +3113,7 @@ var require_float2 = __commonJS((exports) => {
|
|
|
3113
3113
|
exports.floatNaN = floatNaN;
|
|
3114
3114
|
});
|
|
3115
3115
|
|
|
3116
|
-
// ../../node_modules/.
|
|
3116
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/int.js
|
|
3117
3117
|
var require_int2 = __commonJS((exports) => {
|
|
3118
3118
|
var stringifyNumber = require_stringifyNumber();
|
|
3119
3119
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -3189,7 +3189,7 @@ var require_int2 = __commonJS((exports) => {
|
|
|
3189
3189
|
exports.intOct = intOct;
|
|
3190
3190
|
});
|
|
3191
3191
|
|
|
3192
|
-
// ../../node_modules/.
|
|
3192
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/set.js
|
|
3193
3193
|
var require_set = __commonJS((exports) => {
|
|
3194
3194
|
var identity = require_identity();
|
|
3195
3195
|
var Pair = require_Pair();
|
|
@@ -3272,7 +3272,7 @@ var require_set = __commonJS((exports) => {
|
|
|
3272
3272
|
exports.set = set;
|
|
3273
3273
|
});
|
|
3274
3274
|
|
|
3275
|
-
// ../../node_modules/.
|
|
3275
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
|
|
3276
3276
|
var require_timestamp = __commonJS((exports) => {
|
|
3277
3277
|
var stringifyNumber = require_stringifyNumber();
|
|
3278
3278
|
function parseSexagesimal(str, asBigInt) {
|
|
@@ -3354,7 +3354,7 @@ var require_timestamp = __commonJS((exports) => {
|
|
|
3354
3354
|
exports.timestamp = timestamp;
|
|
3355
3355
|
});
|
|
3356
3356
|
|
|
3357
|
-
// ../../node_modules/.
|
|
3357
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/schema.js
|
|
3358
3358
|
var require_schema3 = __commonJS((exports) => {
|
|
3359
3359
|
var map = require_map();
|
|
3360
3360
|
var _null = require_null();
|
|
@@ -3395,7 +3395,7 @@ var require_schema3 = __commonJS((exports) => {
|
|
|
3395
3395
|
exports.schema = schema;
|
|
3396
3396
|
});
|
|
3397
3397
|
|
|
3398
|
-
// ../../node_modules/.
|
|
3398
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/tags.js
|
|
3399
3399
|
var require_tags = __commonJS((exports) => {
|
|
3400
3400
|
var map = require_map();
|
|
3401
3401
|
var _null = require_null();
|
|
@@ -3486,7 +3486,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
3486
3486
|
exports.getTags = getTags;
|
|
3487
3487
|
});
|
|
3488
3488
|
|
|
3489
|
-
// ../../node_modules/.
|
|
3489
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/Schema.js
|
|
3490
3490
|
var require_Schema = __commonJS((exports) => {
|
|
3491
3491
|
var identity = require_identity();
|
|
3492
3492
|
var map = require_map();
|
|
@@ -3516,7 +3516,7 @@ var require_Schema = __commonJS((exports) => {
|
|
|
3516
3516
|
exports.Schema = Schema;
|
|
3517
3517
|
});
|
|
3518
3518
|
|
|
3519
|
-
// ../../node_modules/.
|
|
3519
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/stringifyDocument.js
|
|
3520
3520
|
var require_stringifyDocument = __commonJS((exports) => {
|
|
3521
3521
|
var identity = require_identity();
|
|
3522
3522
|
var stringify = require_stringify();
|
|
@@ -3596,7 +3596,7 @@ var require_stringifyDocument = __commonJS((exports) => {
|
|
|
3596
3596
|
exports.stringifyDocument = stringifyDocument;
|
|
3597
3597
|
});
|
|
3598
3598
|
|
|
3599
|
-
// ../../node_modules/.
|
|
3599
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/doc/Document.js
|
|
3600
3600
|
var require_Document = __commonJS((exports) => {
|
|
3601
3601
|
var Alias = require_Alias();
|
|
3602
3602
|
var Collection = require_Collection();
|
|
@@ -3831,7 +3831,7 @@ var require_Document = __commonJS((exports) => {
|
|
|
3831
3831
|
exports.Document = Document;
|
|
3832
3832
|
});
|
|
3833
3833
|
|
|
3834
|
-
// ../../node_modules/.
|
|
3834
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/errors.js
|
|
3835
3835
|
var require_errors = __commonJS((exports) => {
|
|
3836
3836
|
class YAMLError extends Error {
|
|
3837
3837
|
constructor(name, pos, code, message) {
|
|
@@ -3896,7 +3896,7 @@ ${pointer}
|
|
|
3896
3896
|
exports.prettifyError = prettifyError;
|
|
3897
3897
|
});
|
|
3898
3898
|
|
|
3899
|
-
// ../../node_modules/.
|
|
3899
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-props.js
|
|
3900
3900
|
var require_resolve_props = __commonJS((exports) => {
|
|
3901
3901
|
function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
|
|
3902
3902
|
let spaceBefore = false;
|
|
@@ -4026,7 +4026,7 @@ var require_resolve_props = __commonJS((exports) => {
|
|
|
4026
4026
|
exports.resolveProps = resolveProps;
|
|
4027
4027
|
});
|
|
4028
4028
|
|
|
4029
|
-
// ../../node_modules/.
|
|
4029
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/util-contains-newline.js
|
|
4030
4030
|
var require_util_contains_newline = __commonJS((exports) => {
|
|
4031
4031
|
function containsNewline(key) {
|
|
4032
4032
|
if (!key)
|
|
@@ -4066,7 +4066,7 @@ var require_util_contains_newline = __commonJS((exports) => {
|
|
|
4066
4066
|
exports.containsNewline = containsNewline;
|
|
4067
4067
|
});
|
|
4068
4068
|
|
|
4069
|
-
// ../../node_modules/.
|
|
4069
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/util-flow-indent-check.js
|
|
4070
4070
|
var require_util_flow_indent_check = __commonJS((exports) => {
|
|
4071
4071
|
var utilContainsNewline = require_util_contains_newline();
|
|
4072
4072
|
function flowIndentCheck(indent, fc, onError) {
|
|
@@ -4081,7 +4081,7 @@ var require_util_flow_indent_check = __commonJS((exports) => {
|
|
|
4081
4081
|
exports.flowIndentCheck = flowIndentCheck;
|
|
4082
4082
|
});
|
|
4083
4083
|
|
|
4084
|
-
// ../../node_modules/.
|
|
4084
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/util-map-includes.js
|
|
4085
4085
|
var require_util_map_includes = __commonJS((exports) => {
|
|
4086
4086
|
var identity = require_identity();
|
|
4087
4087
|
function mapIncludes(ctx, items, search) {
|
|
@@ -4094,7 +4094,7 @@ var require_util_map_includes = __commonJS((exports) => {
|
|
|
4094
4094
|
exports.mapIncludes = mapIncludes;
|
|
4095
4095
|
});
|
|
4096
4096
|
|
|
4097
|
-
// ../../node_modules/.
|
|
4097
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-block-map.js
|
|
4098
4098
|
var require_resolve_block_map = __commonJS((exports) => {
|
|
4099
4099
|
var Pair = require_Pair();
|
|
4100
4100
|
var YAMLMap = require_YAMLMap();
|
|
@@ -4201,7 +4201,7 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
|
4201
4201
|
exports.resolveBlockMap = resolveBlockMap;
|
|
4202
4202
|
});
|
|
4203
4203
|
|
|
4204
|
-
// ../../node_modules/.
|
|
4204
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-block-seq.js
|
|
4205
4205
|
var require_resolve_block_seq = __commonJS((exports) => {
|
|
4206
4206
|
var YAMLSeq = require_YAMLSeq();
|
|
4207
4207
|
var resolveProps = require_resolve_props();
|
|
@@ -4249,7 +4249,7 @@ var require_resolve_block_seq = __commonJS((exports) => {
|
|
|
4249
4249
|
exports.resolveBlockSeq = resolveBlockSeq;
|
|
4250
4250
|
});
|
|
4251
4251
|
|
|
4252
|
-
// ../../node_modules/.
|
|
4252
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-end.js
|
|
4253
4253
|
var require_resolve_end = __commonJS((exports) => {
|
|
4254
4254
|
function resolveEnd(end, offset, reqSpace, onError) {
|
|
4255
4255
|
let comment = "";
|
|
@@ -4289,7 +4289,7 @@ var require_resolve_end = __commonJS((exports) => {
|
|
|
4289
4289
|
exports.resolveEnd = resolveEnd;
|
|
4290
4290
|
});
|
|
4291
4291
|
|
|
4292
|
-
// ../../node_modules/.
|
|
4292
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-flow-collection.js
|
|
4293
4293
|
var require_resolve_flow_collection = __commonJS((exports) => {
|
|
4294
4294
|
var identity = require_identity();
|
|
4295
4295
|
var Pair = require_Pair();
|
|
@@ -4480,7 +4480,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
|
4480
4480
|
exports.resolveFlowCollection = resolveFlowCollection;
|
|
4481
4481
|
});
|
|
4482
4482
|
|
|
4483
|
-
// ../../node_modules/.
|
|
4483
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/compose-collection.js
|
|
4484
4484
|
var require_compose_collection = __commonJS((exports) => {
|
|
4485
4485
|
var identity = require_identity();
|
|
4486
4486
|
var Scalar = require_Scalar();
|
|
@@ -4542,7 +4542,7 @@ var require_compose_collection = __commonJS((exports) => {
|
|
|
4542
4542
|
exports.composeCollection = composeCollection;
|
|
4543
4543
|
});
|
|
4544
4544
|
|
|
4545
|
-
// ../../node_modules/.
|
|
4545
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-block-scalar.js
|
|
4546
4546
|
var require_resolve_block_scalar = __commonJS((exports) => {
|
|
4547
4547
|
var Scalar = require_Scalar();
|
|
4548
4548
|
function resolveBlockScalar(ctx, scalar, onError) {
|
|
@@ -4735,7 +4735,7 @@ var require_resolve_block_scalar = __commonJS((exports) => {
|
|
|
4735
4735
|
exports.resolveBlockScalar = resolveBlockScalar;
|
|
4736
4736
|
});
|
|
4737
4737
|
|
|
4738
|
-
// ../../node_modules/.
|
|
4738
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-flow-scalar.js
|
|
4739
4739
|
var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
4740
4740
|
var Scalar = require_Scalar();
|
|
4741
4741
|
var resolveEnd = require_resolve_end();
|
|
@@ -4952,7 +4952,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
4952
4952
|
exports.resolveFlowScalar = resolveFlowScalar;
|
|
4953
4953
|
});
|
|
4954
4954
|
|
|
4955
|
-
// ../../node_modules/.
|
|
4955
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/compose-scalar.js
|
|
4956
4956
|
var require_compose_scalar = __commonJS((exports) => {
|
|
4957
4957
|
var identity = require_identity();
|
|
4958
4958
|
var Scalar = require_Scalar();
|
|
@@ -5030,7 +5030,7 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
5030
5030
|
exports.composeScalar = composeScalar;
|
|
5031
5031
|
});
|
|
5032
5032
|
|
|
5033
|
-
// ../../node_modules/.
|
|
5033
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/util-empty-scalar-position.js
|
|
5034
5034
|
var require_util_empty_scalar_position = __commonJS((exports) => {
|
|
5035
5035
|
function emptyScalarPosition(offset, before, pos) {
|
|
5036
5036
|
if (before) {
|
|
@@ -5057,7 +5057,7 @@ var require_util_empty_scalar_position = __commonJS((exports) => {
|
|
|
5057
5057
|
exports.emptyScalarPosition = emptyScalarPosition;
|
|
5058
5058
|
});
|
|
5059
5059
|
|
|
5060
|
-
// ../../node_modules/.
|
|
5060
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/compose-node.js
|
|
5061
5061
|
var require_compose_node = __commonJS((exports) => {
|
|
5062
5062
|
var Alias = require_Alias();
|
|
5063
5063
|
var identity = require_identity();
|
|
@@ -5160,7 +5160,7 @@ var require_compose_node = __commonJS((exports) => {
|
|
|
5160
5160
|
exports.composeNode = composeNode;
|
|
5161
5161
|
});
|
|
5162
5162
|
|
|
5163
|
-
// ../../node_modules/.
|
|
5163
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/compose-doc.js
|
|
5164
5164
|
var require_compose_doc = __commonJS((exports) => {
|
|
5165
5165
|
var Document = require_Document();
|
|
5166
5166
|
var composeNode = require_compose_node();
|
|
@@ -5200,7 +5200,7 @@ var require_compose_doc = __commonJS((exports) => {
|
|
|
5200
5200
|
exports.composeDoc = composeDoc;
|
|
5201
5201
|
});
|
|
5202
5202
|
|
|
5203
|
-
// ../../node_modules/.
|
|
5203
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/composer.js
|
|
5204
5204
|
var require_composer = __commonJS((exports) => {
|
|
5205
5205
|
var node_process = __require("process");
|
|
5206
5206
|
var directives = require_directives();
|
|
@@ -5286,10 +5286,8 @@ ${cb}` : comment;
|
|
|
5286
5286
|
}
|
|
5287
5287
|
}
|
|
5288
5288
|
if (afterDoc) {
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
for (let i = 0;i < this.warnings.length; ++i)
|
|
5292
|
-
doc.warnings.push(this.warnings[i]);
|
|
5289
|
+
Array.prototype.push.apply(doc.errors, this.errors);
|
|
5290
|
+
Array.prototype.push.apply(doc.warnings, this.warnings);
|
|
5293
5291
|
} else {
|
|
5294
5292
|
doc.errors = this.errors;
|
|
5295
5293
|
doc.warnings = this.warnings;
|
|
@@ -5391,7 +5389,7 @@ ${end.comment}` : end.comment;
|
|
|
5391
5389
|
exports.Composer = Composer;
|
|
5392
5390
|
});
|
|
5393
5391
|
|
|
5394
|
-
// ../../node_modules/.
|
|
5392
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/parse/cst-scalar.js
|
|
5395
5393
|
var require_cst_scalar = __commonJS((exports) => {
|
|
5396
5394
|
var resolveBlockScalar = require_resolve_block_scalar();
|
|
5397
5395
|
var resolveFlowScalar = require_resolve_flow_scalar();
|
|
@@ -5581,7 +5579,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
5581
5579
|
exports.setScalarValue = setScalarValue;
|
|
5582
5580
|
});
|
|
5583
5581
|
|
|
5584
|
-
// ../../node_modules/.
|
|
5582
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/parse/cst-stringify.js
|
|
5585
5583
|
var require_cst_stringify = __commonJS((exports) => {
|
|
5586
5584
|
var stringify = (cst) => ("type" in cst) ? stringifyToken(cst) : stringifyItem(cst);
|
|
5587
5585
|
function stringifyToken(token) {
|
|
@@ -5639,7 +5637,7 @@ var require_cst_stringify = __commonJS((exports) => {
|
|
|
5639
5637
|
exports.stringify = stringify;
|
|
5640
5638
|
});
|
|
5641
5639
|
|
|
5642
|
-
// ../../node_modules/.
|
|
5640
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/parse/cst-visit.js
|
|
5643
5641
|
var require_cst_visit = __commonJS((exports) => {
|
|
5644
5642
|
var BREAK = Symbol("break visit");
|
|
5645
5643
|
var SKIP = Symbol("skip children");
|
|
@@ -5698,7 +5696,7 @@ var require_cst_visit = __commonJS((exports) => {
|
|
|
5698
5696
|
exports.visit = visit;
|
|
5699
5697
|
});
|
|
5700
5698
|
|
|
5701
|
-
// ../../node_modules/.
|
|
5699
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/parse/cst.js
|
|
5702
5700
|
var require_cst = __commonJS((exports) => {
|
|
5703
5701
|
var cstScalar = require_cst_scalar();
|
|
5704
5702
|
var cstStringify = require_cst_stringify();
|
|
@@ -5799,7 +5797,7 @@ var require_cst = __commonJS((exports) => {
|
|
|
5799
5797
|
exports.tokenType = tokenType;
|
|
5800
5798
|
});
|
|
5801
5799
|
|
|
5802
|
-
// ../../node_modules/.
|
|
5800
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/parse/lexer.js
|
|
5803
5801
|
var require_lexer = __commonJS((exports) => {
|
|
5804
5802
|
var cst = require_cst();
|
|
5805
5803
|
function isEmpty(ch) {
|
|
@@ -6001,7 +5999,7 @@ var require_lexer = __commonJS((exports) => {
|
|
|
6001
5999
|
const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
|
|
6002
6000
|
this.indentNext = this.indentValue + 1;
|
|
6003
6001
|
this.indentValue += n;
|
|
6004
|
-
return
|
|
6002
|
+
return yield* this.parseBlockStart();
|
|
6005
6003
|
}
|
|
6006
6004
|
return "doc";
|
|
6007
6005
|
}
|
|
@@ -6308,37 +6306,26 @@ var require_lexer = __commonJS((exports) => {
|
|
|
6308
6306
|
return 0;
|
|
6309
6307
|
}
|
|
6310
6308
|
*pushIndicators() {
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
const ch1 = this.charAt(1);
|
|
6328
|
-
if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
|
|
6329
|
-
if (!inFlow)
|
|
6330
|
-
this.indentNext = this.indentValue + 1;
|
|
6331
|
-
else if (this.flowKey)
|
|
6332
|
-
this.flowKey = false;
|
|
6333
|
-
n += yield* this.pushCount(1);
|
|
6334
|
-
n += yield* this.pushSpaces(true);
|
|
6335
|
-
continue loop;
|
|
6336
|
-
}
|
|
6337
|
-
}
|
|
6309
|
+
switch (this.charAt(0)) {
|
|
6310
|
+
case "!":
|
|
6311
|
+
return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
|
|
6312
|
+
case "&":
|
|
6313
|
+
return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
|
|
6314
|
+
case "-":
|
|
6315
|
+
case "?":
|
|
6316
|
+
case ":": {
|
|
6317
|
+
const inFlow = this.flowLevel > 0;
|
|
6318
|
+
const ch1 = this.charAt(1);
|
|
6319
|
+
if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
|
|
6320
|
+
if (!inFlow)
|
|
6321
|
+
this.indentNext = this.indentValue + 1;
|
|
6322
|
+
else if (this.flowKey)
|
|
6323
|
+
this.flowKey = false;
|
|
6324
|
+
return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
|
|
6338
6325
|
}
|
|
6339
|
-
break loop;
|
|
6340
6326
|
}
|
|
6341
|
-
|
|
6327
|
+
}
|
|
6328
|
+
return 0;
|
|
6342
6329
|
}
|
|
6343
6330
|
*pushTag() {
|
|
6344
6331
|
if (this.charAt(1) === "<") {
|
|
@@ -6396,7 +6383,7 @@ var require_lexer = __commonJS((exports) => {
|
|
|
6396
6383
|
exports.Lexer = Lexer;
|
|
6397
6384
|
});
|
|
6398
6385
|
|
|
6399
|
-
// ../../node_modules/.
|
|
6386
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/parse/line-counter.js
|
|
6400
6387
|
var require_line_counter = __commonJS((exports) => {
|
|
6401
6388
|
class LineCounter {
|
|
6402
6389
|
constructor() {
|
|
@@ -6424,7 +6411,7 @@ var require_line_counter = __commonJS((exports) => {
|
|
|
6424
6411
|
exports.LineCounter = LineCounter;
|
|
6425
6412
|
});
|
|
6426
6413
|
|
|
6427
|
-
// ../../node_modules/.
|
|
6414
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/parse/parser.js
|
|
6428
6415
|
var require_parser = __commonJS((exports) => {
|
|
6429
6416
|
var node_process = __require("process");
|
|
6430
6417
|
var cst = require_cst();
|
|
@@ -6492,13 +6479,6 @@ var require_parser = __commonJS((exports) => {
|
|
|
6492
6479
|
while (prev[++i]?.type === "space") {}
|
|
6493
6480
|
return prev.splice(i, prev.length);
|
|
6494
6481
|
}
|
|
6495
|
-
function arrayPushArray(target, source) {
|
|
6496
|
-
if (source.length < 1e5)
|
|
6497
|
-
Array.prototype.push.apply(target, source);
|
|
6498
|
-
else
|
|
6499
|
-
for (let i = 0;i < source.length; ++i)
|
|
6500
|
-
target.push(source[i]);
|
|
6501
|
-
}
|
|
6502
6482
|
function fixFlowSeqItems(fc) {
|
|
6503
6483
|
if (fc.start.type === "flow-seq-start") {
|
|
6504
6484
|
for (const it of fc.items) {
|
|
@@ -6508,11 +6488,11 @@ var require_parser = __commonJS((exports) => {
|
|
|
6508
6488
|
delete it.key;
|
|
6509
6489
|
if (isFlowToken(it.value)) {
|
|
6510
6490
|
if (it.value.end)
|
|
6511
|
-
|
|
6491
|
+
Array.prototype.push.apply(it.value.end, it.sep);
|
|
6512
6492
|
else
|
|
6513
6493
|
it.value.end = it.sep;
|
|
6514
6494
|
} else
|
|
6515
|
-
|
|
6495
|
+
Array.prototype.push.apply(it.start, it.sep);
|
|
6516
6496
|
delete it.sep;
|
|
6517
6497
|
}
|
|
6518
6498
|
}
|
|
@@ -6852,7 +6832,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6852
6832
|
const prev = map.items[map.items.length - 2];
|
|
6853
6833
|
const end = prev?.value?.end;
|
|
6854
6834
|
if (Array.isArray(end)) {
|
|
6855
|
-
|
|
6835
|
+
Array.prototype.push.apply(end, it.start);
|
|
6856
6836
|
end.push(this.sourceToken);
|
|
6857
6837
|
map.items.pop();
|
|
6858
6838
|
return;
|
|
@@ -7040,7 +7020,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
7040
7020
|
const prev = seq.items[seq.items.length - 2];
|
|
7041
7021
|
const end = prev?.value?.end;
|
|
7042
7022
|
if (Array.isArray(end)) {
|
|
7043
|
-
|
|
7023
|
+
Array.prototype.push.apply(end, it.start);
|
|
7044
7024
|
end.push(this.sourceToken);
|
|
7045
7025
|
seq.items.pop();
|
|
7046
7026
|
return;
|
|
@@ -7280,7 +7260,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
7280
7260
|
exports.Parser = Parser;
|
|
7281
7261
|
});
|
|
7282
7262
|
|
|
7283
|
-
// ../../node_modules/.
|
|
7263
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/public-api.js
|
|
7284
7264
|
var require_public_api = __commonJS((exports) => {
|
|
7285
7265
|
var composer = require_composer();
|
|
7286
7266
|
var Document = require_Document();
|
|
@@ -7374,7 +7354,7 @@ var require_public_api = __commonJS((exports) => {
|
|
|
7374
7354
|
exports.stringify = stringify;
|
|
7375
7355
|
});
|
|
7376
7356
|
|
|
7377
|
-
// ../../node_modules/.
|
|
7357
|
+
// ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/index.js
|
|
7378
7358
|
var require_dist = __commonJS((exports) => {
|
|
7379
7359
|
var composer = require_composer();
|
|
7380
7360
|
var Document = require_Document();
|
|
@@ -7427,7 +7407,7 @@ var require_dist = __commonJS((exports) => {
|
|
|
7427
7407
|
var require_package = __commonJS((exports, module) => {
|
|
7428
7408
|
module.exports = {
|
|
7429
7409
|
name: "@ai-setting/roy-agent-cli",
|
|
7430
|
-
version: "1.
|
|
7410
|
+
version: "1.6.1",
|
|
7431
7411
|
type: "module",
|
|
7432
7412
|
description: "CLI for roy-agent - Non-interactive command execution",
|
|
7433
7413
|
main: "./dist/index.js",
|
|
@@ -7937,21 +7917,30 @@ class EnvironmentService {
|
|
|
7937
7917
|
env.registerComponent(memoryComponent);
|
|
7938
7918
|
env.registerComponent(eventSourceComponent);
|
|
7939
7919
|
env.registerComponent(workflowComponent);
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7920
|
+
if (options?.loadPlugins === true) {
|
|
7921
|
+
this.pluginComponent = new PluginComponent;
|
|
7922
|
+
const pluginComponent = this.pluginComponent;
|
|
7923
|
+
await pluginComponent.init({
|
|
7924
|
+
name: "plugin",
|
|
7925
|
+
version: "1.0.0",
|
|
7926
|
+
enabled: true,
|
|
7927
|
+
env,
|
|
7928
|
+
options: {
|
|
7929
|
+
configComponent
|
|
7930
|
+
}
|
|
7931
|
+
});
|
|
7932
|
+
env.registerComponent(pluginComponent);
|
|
7933
|
+
} else {
|
|
7934
|
+
logger.debug(`[EnvironmentService] Skipping PluginComponent init (command=${options?.commandName ?? "<unknown>"}, reason=loadPlugins=false)`);
|
|
7935
|
+
}
|
|
7949
7936
|
await env.init();
|
|
7950
7937
|
await env.start();
|
|
7951
7938
|
await agentComponent.refreshDependencies();
|
|
7952
7939
|
logger.debug("[EnvironmentService] AgentComponent dependencies refreshed after env.start()");
|
|
7953
|
-
if (options?.plugins && options.plugins.length > 0) {
|
|
7940
|
+
if (options?.loadPlugins === true && options?.plugins && options.plugins.length > 0) {
|
|
7954
7941
|
await this.loadPlugins(options.plugins);
|
|
7942
|
+
} else if (options?.loadPlugins !== true && options?.plugins && options.plugins.length > 0) {
|
|
7943
|
+
logger.debug(`[EnvironmentService] Skipping plugin loading because loadPlugins=false (command=${options?.commandName ?? "<unknown>"})`);
|
|
7955
7944
|
}
|
|
7956
7945
|
this.environment = env;
|
|
7957
7946
|
return env;
|
|
@@ -8665,7 +8654,9 @@ function createActCommand(externalEnvService) {
|
|
|
8665
8654
|
await envService.create({
|
|
8666
8655
|
envName: args.env,
|
|
8667
8656
|
configPath: args.config,
|
|
8668
|
-
plugins: [...otherPluginNames, ...coderPluginNames]
|
|
8657
|
+
plugins: [...otherPluginNames, ...coderPluginNames],
|
|
8658
|
+
loadPlugins: true,
|
|
8659
|
+
commandName: "act"
|
|
8669
8660
|
});
|
|
8670
8661
|
}
|
|
8671
8662
|
const env = envService.getEnvironment();
|
|
@@ -10576,7 +10567,9 @@ function createInteractiveCommand(externalEnvService) {
|
|
|
10576
10567
|
if (!externalEnvService) {
|
|
10577
10568
|
await envService.create({
|
|
10578
10569
|
configPath: args.config,
|
|
10579
|
-
plugins: [...componentPluginNames, ...coderPluginNames]
|
|
10570
|
+
plugins: [...componentPluginNames, ...coderPluginNames],
|
|
10571
|
+
loadPlugins: true,
|
|
10572
|
+
commandName: "interactive"
|
|
10580
10573
|
});
|
|
10581
10574
|
}
|
|
10582
10575
|
const env = envService.getEnvironment();
|
|
@@ -11057,6 +11050,42 @@ function inferStatus(session) {
|
|
|
11057
11050
|
return status;
|
|
11058
11051
|
return null;
|
|
11059
11052
|
}
|
|
11053
|
+
async function expandSessionAncestors(sessionComponent, sessions) {
|
|
11054
|
+
const sessionById = new Map;
|
|
11055
|
+
for (const s of sessions)
|
|
11056
|
+
sessionById.set(s.id, s);
|
|
11057
|
+
const queue = [];
|
|
11058
|
+
const visited = new Set;
|
|
11059
|
+
for (const s of sessions) {
|
|
11060
|
+
const pid = s.parentSessionId;
|
|
11061
|
+
if (pid !== null && pid !== undefined && pid !== "" && !sessionById.has(pid) && !visited.has(pid)) {
|
|
11062
|
+
queue.push(pid);
|
|
11063
|
+
visited.add(pid);
|
|
11064
|
+
}
|
|
11065
|
+
}
|
|
11066
|
+
while (queue.length > 0) {
|
|
11067
|
+
const id = queue.shift();
|
|
11068
|
+
const parent = await sessionComponent.get(id);
|
|
11069
|
+
if (!parent)
|
|
11070
|
+
continue;
|
|
11071
|
+
sessionById.set(parent.id, parent);
|
|
11072
|
+
const ppid = parent.parentSessionId;
|
|
11073
|
+
if (ppid !== null && ppid !== undefined && ppid !== "" && !sessionById.has(ppid) && !visited.has(ppid)) {
|
|
11074
|
+
queue.push(ppid);
|
|
11075
|
+
visited.add(ppid);
|
|
11076
|
+
}
|
|
11077
|
+
}
|
|
11078
|
+
const orderedIds = [];
|
|
11079
|
+
for (const s of sessions) {
|
|
11080
|
+
if (!orderedIds.includes(s.id))
|
|
11081
|
+
orderedIds.push(s.id);
|
|
11082
|
+
}
|
|
11083
|
+
for (const id of sessionById.keys()) {
|
|
11084
|
+
if (!orderedIds.includes(id))
|
|
11085
|
+
orderedIds.push(id);
|
|
11086
|
+
}
|
|
11087
|
+
return orderedIds.map((id) => sessionById.get(id));
|
|
11088
|
+
}
|
|
11060
11089
|
|
|
11061
11090
|
// src/commands/sessions/list.ts
|
|
11062
11091
|
var ListCommand = {
|
|
@@ -11100,7 +11129,8 @@ var ListCommand = {
|
|
|
11100
11129
|
const totalCount = await sessionComponent.getCount();
|
|
11101
11130
|
const activeSessionId = sessionComponent.getActiveSessionId();
|
|
11102
11131
|
if (args.graph) {
|
|
11103
|
-
const
|
|
11132
|
+
const expandedSessions = await expandSessionAncestors(sessionComponent, sessions);
|
|
11133
|
+
const tree = buildSessionTree(expandedSessions);
|
|
11104
11134
|
output.log(renderSessionTree(tree, { useShortId: args.shortId === true }));
|
|
11105
11135
|
return;
|
|
11106
11136
|
}
|
|
@@ -12754,7 +12784,7 @@ var SessionsCommand = {
|
|
|
12754
12784
|
};
|
|
12755
12785
|
|
|
12756
12786
|
// src/commands/tasks/list.ts
|
|
12757
|
-
import
|
|
12787
|
+
import chalk19 from "chalk";
|
|
12758
12788
|
|
|
12759
12789
|
// src/commands/tasks/_build-list-json.ts
|
|
12760
12790
|
function buildListTasksJson(tasks, total, args, extras) {
|
|
@@ -12783,6 +12813,150 @@ function buildListTasksJson(tasks, total, args, extras) {
|
|
|
12783
12813
|
};
|
|
12784
12814
|
}
|
|
12785
12815
|
|
|
12816
|
+
// src/commands/tasks/task-graph.ts
|
|
12817
|
+
import chalk18 from "chalk";
|
|
12818
|
+
function buildTaskTree(tasks) {
|
|
12819
|
+
const nodeById = new Map;
|
|
12820
|
+
const byParent = new Map;
|
|
12821
|
+
const roots = [];
|
|
12822
|
+
for (const t of tasks) {
|
|
12823
|
+
nodeById.set(t.id, { task: t, children: [] });
|
|
12824
|
+
}
|
|
12825
|
+
for (const t of tasks) {
|
|
12826
|
+
const pid = t.parent_task_id;
|
|
12827
|
+
if (pid !== undefined && pid !== null && nodeById.has(pid)) {
|
|
12828
|
+
const list = byParent.get(pid) || [];
|
|
12829
|
+
list.push(t);
|
|
12830
|
+
byParent.set(pid, list);
|
|
12831
|
+
} else {
|
|
12832
|
+
roots.push(t);
|
|
12833
|
+
}
|
|
12834
|
+
}
|
|
12835
|
+
for (const [parentId, children] of byParent.entries()) {
|
|
12836
|
+
const parentNode = nodeById.get(parentId);
|
|
12837
|
+
children.sort(compareTasksDesc);
|
|
12838
|
+
parentNode.children = children.map((c) => nodeById.get(c.id));
|
|
12839
|
+
}
|
|
12840
|
+
roots.sort(compareTasksDesc);
|
|
12841
|
+
return roots.map((r) => nodeById.get(r.id));
|
|
12842
|
+
}
|
|
12843
|
+
function compareTasksDesc(a, b) {
|
|
12844
|
+
if (a.updatedAt < b.updatedAt)
|
|
12845
|
+
return 1;
|
|
12846
|
+
if (a.updatedAt > b.updatedAt)
|
|
12847
|
+
return -1;
|
|
12848
|
+
if (a.id < b.id)
|
|
12849
|
+
return 1;
|
|
12850
|
+
if (a.id > b.id)
|
|
12851
|
+
return -1;
|
|
12852
|
+
return 0;
|
|
12853
|
+
}
|
|
12854
|
+
async function expandParentChain(taskComponent, tasks) {
|
|
12855
|
+
const taskById = new Map;
|
|
12856
|
+
for (const t of tasks)
|
|
12857
|
+
taskById.set(t.id, t);
|
|
12858
|
+
const queue = [];
|
|
12859
|
+
const visited = new Set;
|
|
12860
|
+
for (const t of tasks) {
|
|
12861
|
+
const pid = t.parent_task_id;
|
|
12862
|
+
if (pid !== undefined && pid !== null && !taskById.has(pid) && !visited.has(pid)) {
|
|
12863
|
+
queue.push(pid);
|
|
12864
|
+
visited.add(pid);
|
|
12865
|
+
}
|
|
12866
|
+
}
|
|
12867
|
+
while (queue.length > 0) {
|
|
12868
|
+
const id = queue.shift();
|
|
12869
|
+
const parent = await taskComponent.getTask(id);
|
|
12870
|
+
if (!parent)
|
|
12871
|
+
continue;
|
|
12872
|
+
taskById.set(parent.id, parent);
|
|
12873
|
+
const ppid = parent.parent_task_id;
|
|
12874
|
+
if (ppid !== undefined && ppid !== null && !taskById.has(ppid) && !visited.has(ppid)) {
|
|
12875
|
+
queue.push(ppid);
|
|
12876
|
+
visited.add(ppid);
|
|
12877
|
+
}
|
|
12878
|
+
}
|
|
12879
|
+
const orderedIds = [];
|
|
12880
|
+
for (const t of tasks) {
|
|
12881
|
+
if (!orderedIds.includes(t.id))
|
|
12882
|
+
orderedIds.push(t.id);
|
|
12883
|
+
}
|
|
12884
|
+
for (const id of taskById.keys()) {
|
|
12885
|
+
if (!orderedIds.includes(id))
|
|
12886
|
+
orderedIds.push(id);
|
|
12887
|
+
}
|
|
12888
|
+
return orderedIds.map((id) => taskById.get(id));
|
|
12889
|
+
}
|
|
12890
|
+
var TASK_TREE_BRANCH = "├─ ";
|
|
12891
|
+
var TASK_TREE_LAST = "└─ ";
|
|
12892
|
+
var TASK_TREE_VERTICAL = "│ ";
|
|
12893
|
+
var TASK_TREE_EMPTY = " ";
|
|
12894
|
+
function renderTaskTree(roots, options = {}) {
|
|
12895
|
+
if (roots.length === 0) {
|
|
12896
|
+
return "No tasks to display.";
|
|
12897
|
+
}
|
|
12898
|
+
const maxDepth = options.maxDepth !== undefined && options.maxDepth < 0 ? undefined : options.maxDepth;
|
|
12899
|
+
const totalCount = countDeep(roots);
|
|
12900
|
+
const headerSuffix = options.rootId !== undefined ? chalk18.gray(` — subtree of #${options.rootId}`) : "";
|
|
12901
|
+
const lines = [
|
|
12902
|
+
chalk18.bold(`Task Tree (${totalCount} tasks, ${roots.length} roots)`) + headerSuffix,
|
|
12903
|
+
""
|
|
12904
|
+
];
|
|
12905
|
+
for (let i = 0;i < roots.length; i++) {
|
|
12906
|
+
const isLast = i === roots.length - 1;
|
|
12907
|
+
renderNode2(roots[i], "", true, isLast, lines, 0, maxDepth);
|
|
12908
|
+
}
|
|
12909
|
+
return lines.join(`
|
|
12910
|
+
`);
|
|
12911
|
+
}
|
|
12912
|
+
function renderNode2(node, prefix, isRoot, isLast, lines, currentDepth, maxDepth) {
|
|
12913
|
+
if (maxDepth !== undefined && currentDepth > maxDepth) {
|
|
12914
|
+
return;
|
|
12915
|
+
}
|
|
12916
|
+
const connector = isRoot ? "" : isLast ? TASK_TREE_LAST : TASK_TREE_BRANCH;
|
|
12917
|
+
const statusColor = colorByStatus(node.task.status);
|
|
12918
|
+
const label = statusColor(formatTaskLabel(node.task));
|
|
12919
|
+
lines.push(prefix + connector + label);
|
|
12920
|
+
if (node.children.length > 0) {
|
|
12921
|
+
const childPrefix = isRoot ? prefix : prefix + (isLast ? TASK_TREE_EMPTY : TASK_TREE_VERTICAL);
|
|
12922
|
+
for (let i = 0;i < node.children.length; i++) {
|
|
12923
|
+
const isChildLast = i === node.children.length - 1;
|
|
12924
|
+
renderNode2(node.children[i], childPrefix, false, isChildLast, lines, currentDepth + 1, maxDepth);
|
|
12925
|
+
}
|
|
12926
|
+
}
|
|
12927
|
+
}
|
|
12928
|
+
function countDeep(roots) {
|
|
12929
|
+
let count = 0;
|
|
12930
|
+
function walk(n) {
|
|
12931
|
+
count++;
|
|
12932
|
+
for (const c of n.children)
|
|
12933
|
+
walk(c);
|
|
12934
|
+
}
|
|
12935
|
+
for (const r of roots)
|
|
12936
|
+
walk(r);
|
|
12937
|
+
return count;
|
|
12938
|
+
}
|
|
12939
|
+
function formatTaskLabel(task) {
|
|
12940
|
+
const idStr = `#${task.id}`;
|
|
12941
|
+
const typeLabel = task.type && task.type !== "normal" ? ` [${task.type}]` : "";
|
|
12942
|
+
const progressLabel = task.progress > 0 ? ` (${task.progress}%)` : "";
|
|
12943
|
+
return `${idStr}${typeLabel} ${task.title} ${chalk18.gray("[" + task.status + "]")}${progressLabel}`;
|
|
12944
|
+
}
|
|
12945
|
+
function colorByStatus(status) {
|
|
12946
|
+
switch (status) {
|
|
12947
|
+
case "completed":
|
|
12948
|
+
return chalk18.green;
|
|
12949
|
+
case "active":
|
|
12950
|
+
return chalk18.blue;
|
|
12951
|
+
case "paused":
|
|
12952
|
+
return chalk18.yellow;
|
|
12953
|
+
case "cancelled":
|
|
12954
|
+
return chalk18.strikethrough;
|
|
12955
|
+
default:
|
|
12956
|
+
return chalk18.gray;
|
|
12957
|
+
}
|
|
12958
|
+
}
|
|
12959
|
+
|
|
12786
12960
|
// src/commands/tasks/list.ts
|
|
12787
12961
|
var ListCommand2 = {
|
|
12788
12962
|
command: "list",
|
|
@@ -12809,7 +12983,7 @@ var ListCommand2 = {
|
|
|
12809
12983
|
type: "boolean",
|
|
12810
12984
|
default: false,
|
|
12811
12985
|
description: "是否包含已归档任务(status=archived 的任务默认被排除)"
|
|
12812
|
-
}).option("json", { alias: "j", type: "boolean", default: false, description: "JSON 输出" }).option("quiet", { alias: "q", type: "boolean", hidden: true }),
|
|
12986
|
+
}).option("json", { alias: "j", type: "boolean", default: false, description: "JSON 输出" }).option("quiet", { alias: "q", type: "boolean", hidden: true }).option("graph", { alias: "g", type: "boolean", default: false, description: "以层次化树形结构展示任务父子关系" }),
|
|
12813
12987
|
async handler(args) {
|
|
12814
12988
|
const output = new OutputService2;
|
|
12815
12989
|
const envService = new EnvironmentService(output);
|
|
@@ -12837,6 +13011,12 @@ var ListCommand2 = {
|
|
|
12837
13011
|
const listResult = await taskComponent.listTasks(listOptions);
|
|
12838
13012
|
const tasks = listResult.tasks;
|
|
12839
13013
|
const total = listResult.total;
|
|
13014
|
+
if (args.graph) {
|
|
13015
|
+
const expandedTasks = await expandParentChain(taskComponent, tasks);
|
|
13016
|
+
const tree = buildTaskTree(expandedTasks);
|
|
13017
|
+
output.log(renderTaskTree(tree, { maxDepth: args.depth }));
|
|
13018
|
+
return;
|
|
13019
|
+
}
|
|
12840
13020
|
if (args.json) {
|
|
12841
13021
|
output.json(buildListTasksJson(tasks, total, args));
|
|
12842
13022
|
} else if (args.quiet) {
|
|
@@ -12852,17 +13032,17 @@ var ListCommand2 = {
|
|
|
12852
13032
|
output.log(hint);
|
|
12853
13033
|
} else {
|
|
12854
13034
|
const header = [
|
|
12855
|
-
|
|
12856
|
-
|
|
12857
|
-
|
|
12858
|
-
|
|
12859
|
-
|
|
12860
|
-
|
|
12861
|
-
|
|
13035
|
+
chalk19.bold("#"),
|
|
13036
|
+
chalk19.bold("Title"),
|
|
13037
|
+
chalk19.bold("Status"),
|
|
13038
|
+
chalk19.bold("Priority"),
|
|
13039
|
+
chalk19.bold("Type"),
|
|
13040
|
+
chalk19.bold("Progress"),
|
|
13041
|
+
chalk19.bold("Parent")
|
|
12862
13042
|
].join(" │ ");
|
|
12863
13043
|
const rows = tasks.map((t, i) => {
|
|
12864
|
-
const statusColor = t.status === "completed" ?
|
|
12865
|
-
const priorityColor = t.priority === "high" ?
|
|
13044
|
+
const statusColor = t.status === "completed" ? chalk19.green : t.status === "active" ? chalk19.blue : t.status === "paused" ? chalk19.yellow : t.status === "cancelled" ? chalk19.strikethrough : chalk19.gray;
|
|
13045
|
+
const priorityColor = t.priority === "high" ? chalk19.red : t.priority === "medium" ? chalk19.yellow : chalk19.gray;
|
|
12866
13046
|
return [
|
|
12867
13047
|
(args.offset + i + 1).toString(),
|
|
12868
13048
|
t.title.length > 30 ? t.title.slice(0, 27) + "..." : t.title,
|
|
@@ -12870,11 +13050,11 @@ var ListCommand2 = {
|
|
|
12870
13050
|
priorityColor(t.priority),
|
|
12871
13051
|
t.type || "normal",
|
|
12872
13052
|
`${t.progress}%`,
|
|
12873
|
-
t.parent_task_id ? `#${t.parent_task_id}` :
|
|
13053
|
+
t.parent_task_id ? `#${t.parent_task_id}` : chalk19.gray("root")
|
|
12874
13054
|
].join(" │ ");
|
|
12875
13055
|
});
|
|
12876
|
-
const depthNote = args.depth !== undefined ?
|
|
12877
|
-
const archivedNote = args.includeArchived ?
|
|
13056
|
+
const depthNote = args.depth !== undefined ? chalk19.gray(` depth=${args.depth}`) : "";
|
|
13057
|
+
const archivedNote = args.includeArchived ? chalk19.gray(" include-archived") : "";
|
|
12878
13058
|
output.log([
|
|
12879
13059
|
`┌─ Tasks ${"─".repeat(55)}┐`,
|
|
12880
13060
|
`│${header}│`,
|
|
@@ -12882,7 +13062,7 @@ var ListCommand2 = {
|
|
|
12882
13062
|
...rows.map((r) => `│${r}│`),
|
|
12883
13063
|
"└" + "─".repeat(header.length + 2) + "┘",
|
|
12884
13064
|
"",
|
|
12885
|
-
|
|
13065
|
+
chalk19.gray(`Showing ${tasks.length} of ${total} tasks (offset=${args.offset}, limit=${args.limit})${depthNote}${archivedNote}`)
|
|
12886
13066
|
].join(`
|
|
12887
13067
|
`));
|
|
12888
13068
|
}
|
|
@@ -12896,7 +13076,7 @@ var ListCommand2 = {
|
|
|
12896
13076
|
};
|
|
12897
13077
|
|
|
12898
13078
|
// src/commands/tasks/get.ts
|
|
12899
|
-
import
|
|
13079
|
+
import chalk20 from "chalk";
|
|
12900
13080
|
var GetCommand2 = {
|
|
12901
13081
|
command: "get <id>",
|
|
12902
13082
|
aliases: ["show"],
|
|
@@ -12935,10 +13115,10 @@ var GetCommand2 = {
|
|
|
12935
13115
|
if (args.json) {
|
|
12936
13116
|
output.json(result);
|
|
12937
13117
|
} else {
|
|
12938
|
-
output.log(
|
|
13118
|
+
output.log(chalk20.bold(`
|
|
12939
13119
|
Task #${result.task.id}: ${result.task.title}
|
|
12940
13120
|
`));
|
|
12941
|
-
output.log(`Status: ${
|
|
13121
|
+
output.log(`Status: ${chalk20.blue(result.task.status)} | Priority: ${result.task.priority} | Type: ${result.task.type} | Progress: ${result.task.progress}%`);
|
|
12942
13122
|
output.log(`Created: ${result.task.createdAt} | Updated: ${result.task.updatedAt}`);
|
|
12943
13123
|
output.log(`Project Path: ${result.task.project_path}`);
|
|
12944
13124
|
output.log(`Context: ${result.task.context}`);
|
|
@@ -12946,7 +13126,7 @@ Task #${result.task.id}: ${result.task.title}
|
|
|
12946
13126
|
output.log(`
|
|
12947
13127
|
Current Status: ${result.task.current_status}`);
|
|
12948
13128
|
}
|
|
12949
|
-
output.log(
|
|
13129
|
+
output.log(chalk20.bold(`
|
|
12950
13130
|
Operations (${result.operations.length}):
|
|
12951
13131
|
`));
|
|
12952
13132
|
result.operations.forEach((op, i) => {
|
|
@@ -12966,10 +13146,10 @@ Operations (${result.operations.length}):
|
|
|
12966
13146
|
if (args.json) {
|
|
12967
13147
|
output.json(task);
|
|
12968
13148
|
} else {
|
|
12969
|
-
output.log(
|
|
13149
|
+
output.log(chalk20.bold(`
|
|
12970
13150
|
Task #${task.id}: ${task.title}
|
|
12971
13151
|
`));
|
|
12972
|
-
output.log(`Status: ${
|
|
13152
|
+
output.log(`Status: ${chalk20.blue(task.status)} | Priority: ${task.priority} | Type: ${task.type} | Progress: ${task.progress}%`);
|
|
12973
13153
|
output.log(`Created: ${task.createdAt} | Updated: ${task.updatedAt}`);
|
|
12974
13154
|
output.log(`Project Path: ${task.project_path}`);
|
|
12975
13155
|
output.log(`Context: ${task.context}`);
|
|
@@ -12993,7 +13173,7 @@ Description: ${task.description}`);
|
|
|
12993
13173
|
};
|
|
12994
13174
|
|
|
12995
13175
|
// src/commands/tasks/create.ts
|
|
12996
|
-
import
|
|
13176
|
+
import chalk21 from "chalk";
|
|
12997
13177
|
var CreateCommand = {
|
|
12998
13178
|
command: "create <title>",
|
|
12999
13179
|
aliases: ["add", "new"],
|
|
@@ -13071,7 +13251,7 @@ var CreateCommand = {
|
|
|
13071
13251
|
if (args.json) {
|
|
13072
13252
|
output.json(task);
|
|
13073
13253
|
} else {
|
|
13074
|
-
output.log(
|
|
13254
|
+
output.log(chalk21.green(`
|
|
13075
13255
|
✓ Task created: #${task.id}`));
|
|
13076
13256
|
output.log(` Title: ${task.title}`);
|
|
13077
13257
|
output.log(` Status: ${task.status}`);
|
|
@@ -13089,7 +13269,7 @@ var CreateCommand = {
|
|
|
13089
13269
|
};
|
|
13090
13270
|
|
|
13091
13271
|
// src/commands/tasks/update.ts
|
|
13092
|
-
import
|
|
13272
|
+
import chalk22 from "chalk";
|
|
13093
13273
|
var UpdateCommand = {
|
|
13094
13274
|
command: "update <id>",
|
|
13095
13275
|
aliases: ["set"],
|
|
@@ -13147,7 +13327,7 @@ var UpdateCommand = {
|
|
|
13147
13327
|
if (args.json) {
|
|
13148
13328
|
output.json(task);
|
|
13149
13329
|
} else {
|
|
13150
|
-
output.log(
|
|
13330
|
+
output.log(chalk22.green(`
|
|
13151
13331
|
✓ Task updated: #${task.id}`));
|
|
13152
13332
|
output.log(` Title: ${task.title}`);
|
|
13153
13333
|
output.log(` Status: ${task.status}`);
|
|
@@ -13170,7 +13350,7 @@ var UpdateCommand = {
|
|
|
13170
13350
|
};
|
|
13171
13351
|
|
|
13172
13352
|
// src/commands/tasks/delete.ts
|
|
13173
|
-
import
|
|
13353
|
+
import chalk23 from "chalk";
|
|
13174
13354
|
var DeleteCommand2 = {
|
|
13175
13355
|
command: "delete <id>",
|
|
13176
13356
|
aliases: ["remove", "rm", "del"],
|
|
@@ -13206,16 +13386,16 @@ var DeleteCommand2 = {
|
|
|
13206
13386
|
process.exit(1);
|
|
13207
13387
|
}
|
|
13208
13388
|
if (!args.force) {
|
|
13209
|
-
output.log(
|
|
13210
|
-
output.log(
|
|
13211
|
-
output.log(
|
|
13212
|
-
output.log(
|
|
13389
|
+
output.log(chalk23.yellow(`Are you sure you want to delete task #${args.id}?`));
|
|
13390
|
+
output.log(chalk23.yellow(` Title: ${task.title}`));
|
|
13391
|
+
output.log(chalk23.yellow(` Status: ${task.status}`));
|
|
13392
|
+
output.log(chalk23.yellow(`
|
|
13213
13393
|
Use --force to skip this confirmation`));
|
|
13214
13394
|
process.exit(1);
|
|
13215
13395
|
}
|
|
13216
13396
|
const deleted = await taskComponent.deleteTask(args.id);
|
|
13217
13397
|
if (deleted) {
|
|
13218
|
-
output.log(
|
|
13398
|
+
output.log(chalk23.green(`
|
|
13219
13399
|
✓ Task deleted: #${args.id}`));
|
|
13220
13400
|
} else {
|
|
13221
13401
|
output.error(`Failed to delete task: ${args.id}`);
|
|
@@ -13231,7 +13411,7 @@ Use --force to skip this confirmation`));
|
|
|
13231
13411
|
};
|
|
13232
13412
|
|
|
13233
13413
|
// src/commands/tasks/complete.ts
|
|
13234
|
-
import
|
|
13414
|
+
import chalk24 from "chalk";
|
|
13235
13415
|
var CompleteCommand = {
|
|
13236
13416
|
command: "complete <id>",
|
|
13237
13417
|
aliases: ["done", "finish"],
|
|
@@ -13252,7 +13432,9 @@ var CompleteCommand = {
|
|
|
13252
13432
|
try {
|
|
13253
13433
|
await envService.create({
|
|
13254
13434
|
configPath: args.config,
|
|
13255
|
-
plugins: args.plugin
|
|
13435
|
+
plugins: args.plugin,
|
|
13436
|
+
loadPlugins: true,
|
|
13437
|
+
commandName: "tasks:complete"
|
|
13256
13438
|
});
|
|
13257
13439
|
const env = envService.getEnvironment();
|
|
13258
13440
|
if (!env) {
|
|
@@ -13288,7 +13470,7 @@ var CompleteCommand = {
|
|
|
13288
13470
|
if (args.json) {
|
|
13289
13471
|
output.json(task);
|
|
13290
13472
|
} else {
|
|
13291
|
-
output.log(
|
|
13473
|
+
output.log(chalk24.green(`
|
|
13292
13474
|
✓ Task completed: #${task.id}`));
|
|
13293
13475
|
output.log(` Title: ${task.title}`);
|
|
13294
13476
|
output.log(` Progress: ${task.progress}%`);
|
|
@@ -13304,7 +13486,7 @@ var CompleteCommand = {
|
|
|
13304
13486
|
};
|
|
13305
13487
|
|
|
13306
13488
|
// src/commands/tasks/operations.ts
|
|
13307
|
-
import
|
|
13489
|
+
import chalk25 from "chalk";
|
|
13308
13490
|
var OperationsCommand = {
|
|
13309
13491
|
command: "operations <task-id>",
|
|
13310
13492
|
aliases: ["ops", "log"],
|
|
@@ -13354,23 +13536,23 @@ var OperationsCommand = {
|
|
|
13354
13536
|
operations
|
|
13355
13537
|
});
|
|
13356
13538
|
} else {
|
|
13357
|
-
output.log(
|
|
13539
|
+
output.log(chalk25.bold(`
|
|
13358
13540
|
Operations for Task #${task.id}: ${task.title}
|
|
13359
13541
|
`));
|
|
13360
13542
|
if (operations.length === 0) {
|
|
13361
|
-
output.log(
|
|
13543
|
+
output.log(chalk25.gray("No operations found."));
|
|
13362
13544
|
} else {
|
|
13363
13545
|
operations.forEach((op, i) => {
|
|
13364
|
-
const actionColor = op.actionType === "completed" ?
|
|
13365
|
-
output.log(`${
|
|
13366
|
-
output.log(` Session: ${
|
|
13546
|
+
const actionColor = op.actionType === "completed" ? chalk25.green : op.actionType === "milestone" ? chalk25.blue : op.actionType === "problem" ? chalk25.red : chalk25.gray;
|
|
13547
|
+
output.log(`${chalk25.bold(a.offset + i + 1)}. ` + actionColor(`[${op.actionType}]`) + ` ${op.actionTitle}`);
|
|
13548
|
+
output.log(` Session: ${chalk25.cyan(op.sessionId)} | Time: ${op.timestamp}`);
|
|
13367
13549
|
if (op.actionDescription) {
|
|
13368
13550
|
output.log(` ${op.actionDescription}`);
|
|
13369
13551
|
}
|
|
13370
13552
|
output.log("");
|
|
13371
13553
|
});
|
|
13372
13554
|
}
|
|
13373
|
-
output.log(
|
|
13555
|
+
output.log(chalk25.gray(`Total: ${operations.length} operations`));
|
|
13374
13556
|
}
|
|
13375
13557
|
} catch (error) {
|
|
13376
13558
|
output.error(`Failed to list operations: ${error}`);
|
|
@@ -13382,63 +13564,7 @@ Operations for Task #${task.id}: ${task.title}
|
|
|
13382
13564
|
};
|
|
13383
13565
|
|
|
13384
13566
|
// src/commands/tasks/tree.ts
|
|
13385
|
-
import
|
|
13386
|
-
function buildTree(tasks) {
|
|
13387
|
-
const byParent = new Map;
|
|
13388
|
-
const nodeById = new Map;
|
|
13389
|
-
const roots = [];
|
|
13390
|
-
for (const t of tasks) {
|
|
13391
|
-
nodeById.set(t.id, { task: t, children: [] });
|
|
13392
|
-
}
|
|
13393
|
-
for (const t of tasks) {
|
|
13394
|
-
if (t.parent_task_id !== undefined && t.parent_task_id !== null && nodeById.has(t.parent_task_id)) {
|
|
13395
|
-
const list = byParent.get(t.parent_task_id) || [];
|
|
13396
|
-
list.push(t);
|
|
13397
|
-
byParent.set(t.parent_task_id, list);
|
|
13398
|
-
} else {
|
|
13399
|
-
roots.push(t);
|
|
13400
|
-
}
|
|
13401
|
-
}
|
|
13402
|
-
for (const [parentId, children] of byParent.entries()) {
|
|
13403
|
-
const parentNode = nodeById.get(parentId);
|
|
13404
|
-
children.sort((a, b) => a.updatedAt < b.updatedAt ? 1 : -1);
|
|
13405
|
-
parentNode.children = children.map((c) => nodeById.get(c.id));
|
|
13406
|
-
}
|
|
13407
|
-
roots.sort((a, b) => a.updatedAt < b.updatedAt ? 1 : -1);
|
|
13408
|
-
return roots.map((r) => nodeById.get(r.id));
|
|
13409
|
-
}
|
|
13410
|
-
function printTree(nodes, prefix, isRoot, output, currentDepth, maxDepth) {
|
|
13411
|
-
if (maxDepth !== undefined && currentDepth > maxDepth)
|
|
13412
|
-
return;
|
|
13413
|
-
for (let i = 0;i < nodes.length; i++) {
|
|
13414
|
-
const node = nodes[i];
|
|
13415
|
-
const isLast = i === nodes.length - 1;
|
|
13416
|
-
const connector = isRoot ? "" : isLast ? "└─ " : "├─ ";
|
|
13417
|
-
const statusColor = colorByStatus(node.task.status);
|
|
13418
|
-
const typeLabel = node.task.type ? ` [${node.task.type}]` : "";
|
|
13419
|
-
const progressLabel = node.task.progress > 0 ? ` (${node.task.progress}%)` : "";
|
|
13420
|
-
const header = `#${node.task.id}${typeLabel} ${node.task.title} ${chalk25.gray("[" + node.task.status + "]")}${progressLabel}`;
|
|
13421
|
-
output.log(prefix + connector + statusColor(header));
|
|
13422
|
-
if (node.children.length > 0) {
|
|
13423
|
-
const childPrefix = isRoot ? prefix : prefix + (isLast ? " " : "│ ");
|
|
13424
|
-
printTree(node.children, childPrefix, false, output, currentDepth + 1, maxDepth);
|
|
13425
|
-
}
|
|
13426
|
-
}
|
|
13427
|
-
}
|
|
13428
|
-
function colorByStatus(status) {
|
|
13429
|
-
switch (status) {
|
|
13430
|
-
case "completed":
|
|
13431
|
-
return chalk25.green;
|
|
13432
|
-
case "active":
|
|
13433
|
-
return chalk25.blue;
|
|
13434
|
-
case "paused":
|
|
13435
|
-
return chalk25.yellow;
|
|
13436
|
-
case "cancelled":
|
|
13437
|
-
return chalk25.strikethrough;
|
|
13438
|
-
default:
|
|
13439
|
-
return chalk25.gray;
|
|
13440
|
-
}
|
|
13441
|
-
}
|
|
13567
|
+
import chalk26 from "chalk";
|
|
13442
13568
|
var TreeCommand = {
|
|
13443
13569
|
command: "tree",
|
|
13444
13570
|
describe: "以树形结构展示所有任务(基于 parent_task_id)",
|
|
@@ -13512,23 +13638,20 @@ var TreeCommand = {
|
|
|
13512
13638
|
}
|
|
13513
13639
|
tasks = tasks.filter((t) => allowed.has(t.id));
|
|
13514
13640
|
}
|
|
13641
|
+
const tree = buildTaskTree(tasks);
|
|
13515
13642
|
if (args.json) {
|
|
13516
|
-
const tree2 = buildTree(tasks);
|
|
13517
13643
|
output.json({
|
|
13518
13644
|
total: tasks.length,
|
|
13519
|
-
rootCount:
|
|
13520
|
-
tree
|
|
13645
|
+
rootCount: tree.length,
|
|
13646
|
+
tree
|
|
13521
13647
|
});
|
|
13522
13648
|
return;
|
|
13523
13649
|
}
|
|
13524
|
-
const tree = buildTree(tasks);
|
|
13525
13650
|
if (tree.length === 0) {
|
|
13526
|
-
output.log(
|
|
13651
|
+
output.log(chalk26.gray("No tasks to display."));
|
|
13527
13652
|
return;
|
|
13528
13653
|
}
|
|
13529
|
-
output.log(
|
|
13530
|
-
output.log("");
|
|
13531
|
-
printTree(tree, "", true, output, 0, args.maxDepth);
|
|
13654
|
+
output.log(renderTaskTree(tree, { maxDepth: args.maxDepth, rootId: args.rootId }));
|
|
13532
13655
|
} catch (error) {
|
|
13533
13656
|
output.error(`Failed to build task tree: ${error}`);
|
|
13534
13657
|
process.exit(1);
|
|
@@ -13539,7 +13662,7 @@ var TreeCommand = {
|
|
|
13539
13662
|
};
|
|
13540
13663
|
|
|
13541
13664
|
// src/commands/tasks/search.ts
|
|
13542
|
-
import
|
|
13665
|
+
import chalk27 from "chalk";
|
|
13543
13666
|
var SearchCommand = {
|
|
13544
13667
|
command: "search <keywords..>",
|
|
13545
13668
|
aliases: ["find", "grep"],
|
|
@@ -13612,26 +13735,26 @@ var SearchCommand = {
|
|
|
13612
13735
|
output.log(hint);
|
|
13613
13736
|
} else {
|
|
13614
13737
|
const keywordStr = args.keywords.join(" ");
|
|
13615
|
-
output.log(
|
|
13738
|
+
output.log(chalk27.bold(`
|
|
13616
13739
|
\uD83D\uDD0D Search: "${keywordStr}" — ${total} results
|
|
13617
13740
|
`));
|
|
13618
13741
|
if (tasks.length === 0) {
|
|
13619
|
-
output.log(
|
|
13742
|
+
output.log(chalk27.gray(" No matching tasks found."));
|
|
13620
13743
|
return;
|
|
13621
13744
|
}
|
|
13622
13745
|
for (const t of tasks) {
|
|
13623
|
-
const statusColor = t.status === "completed" ?
|
|
13624
|
-
const pid = t.parent_task_id ?
|
|
13746
|
+
const statusColor = t.status === "completed" ? chalk27.green : t.status === "active" ? chalk27.blue : t.status === "paused" ? chalk27.yellow : t.status === "cancelled" ? chalk27.strikethrough : t.status === "archived" ? chalk27.gray : chalk27.gray;
|
|
13747
|
+
const pid = t.parent_task_id ? chalk27.gray(` (#${t.parent_task_id})`) : "";
|
|
13625
13748
|
output.log(` #${t.id} ${statusColor("[" + t.status + "]")} ${t.title}${pid}`);
|
|
13626
13749
|
if (t.current_status) {
|
|
13627
|
-
output.log(` ${
|
|
13750
|
+
output.log(` ${chalk27.gray(t.current_status.slice(0, 80))}`);
|
|
13628
13751
|
}
|
|
13629
13752
|
}
|
|
13630
13753
|
if (total > tasks.length) {
|
|
13631
|
-
output.log(
|
|
13754
|
+
output.log(chalk27.gray(`
|
|
13632
13755
|
... and ${total - tasks.length} more. Use --offset and --limit to paginate.`));
|
|
13633
13756
|
}
|
|
13634
|
-
output.log(
|
|
13757
|
+
output.log(chalk27.gray(` Page: ${Math.floor((args.offset || 0) / (args.limit || 20)) + 1}/${Math.ceil(total / (args.limit || 20))}`));
|
|
13635
13758
|
}
|
|
13636
13759
|
} catch (error) {
|
|
13637
13760
|
output.error(`Failed to search tasks: ${error}`);
|
|
@@ -13891,7 +14014,7 @@ var TasksCommand = {
|
|
|
13891
14014
|
};
|
|
13892
14015
|
|
|
13893
14016
|
// src/commands/skills/list.ts
|
|
13894
|
-
import
|
|
14017
|
+
import chalk28 from "chalk";
|
|
13895
14018
|
var ListCommand3 = {
|
|
13896
14019
|
command: "list",
|
|
13897
14020
|
aliases: ["ls"],
|
|
@@ -13959,26 +14082,26 @@ var ListCommand3 = {
|
|
|
13959
14082
|
output.log(hint);
|
|
13960
14083
|
} else {
|
|
13961
14084
|
const header = [
|
|
13962
|
-
|
|
13963
|
-
|
|
13964
|
-
|
|
14085
|
+
chalk28.bold("Name"),
|
|
14086
|
+
chalk28.bold("Description"),
|
|
14087
|
+
chalk28.bold("Source")
|
|
13965
14088
|
].join(" | ");
|
|
13966
14089
|
const sourceColor = (source) => {
|
|
13967
14090
|
switch (source) {
|
|
13968
14091
|
case "project":
|
|
13969
|
-
return
|
|
14092
|
+
return chalk28.green;
|
|
13970
14093
|
case "user":
|
|
13971
|
-
return
|
|
14094
|
+
return chalk28.blue;
|
|
13972
14095
|
case "built-in":
|
|
13973
|
-
return
|
|
14096
|
+
return chalk28.gray;
|
|
13974
14097
|
default:
|
|
13975
|
-
return
|
|
14098
|
+
return chalk28.white;
|
|
13976
14099
|
}
|
|
13977
14100
|
};
|
|
13978
14101
|
const rows = skills.map((s) => {
|
|
13979
14102
|
const desc2 = s.description.length > 50 ? s.description.slice(0, 47) + "..." : s.description;
|
|
13980
14103
|
return [
|
|
13981
|
-
|
|
14104
|
+
chalk28.cyan(s.name),
|
|
13982
14105
|
desc2,
|
|
13983
14106
|
sourceColor(s.source)(`[${s.source}]`)
|
|
13984
14107
|
].join(" | ");
|
|
@@ -14011,7 +14134,7 @@ var ListCommand3 = {
|
|
|
14011
14134
|
};
|
|
14012
14135
|
|
|
14013
14136
|
// src/commands/skills/get.ts
|
|
14014
|
-
import
|
|
14137
|
+
import chalk29 from "chalk";
|
|
14015
14138
|
var GetCommand3 = {
|
|
14016
14139
|
command: "get <name>",
|
|
14017
14140
|
describe: "获取指定技能内容",
|
|
@@ -14055,13 +14178,13 @@ var GetCommand3 = {
|
|
|
14055
14178
|
content: skill.content
|
|
14056
14179
|
});
|
|
14057
14180
|
} else {
|
|
14058
|
-
output.log(
|
|
14181
|
+
output.log(chalk29.bold.cyan(`# ${skill.name}`));
|
|
14059
14182
|
output.log("");
|
|
14060
|
-
output.log(`${
|
|
14061
|
-
output.log(`${
|
|
14062
|
-
output.log(`${
|
|
14183
|
+
output.log(`${chalk29.gray("Description:")} ${skill.description}`);
|
|
14184
|
+
output.log(`${chalk29.gray("Source:")} ${skill.source}`);
|
|
14185
|
+
output.log(`${chalk29.gray("File:")} ${skill.filePath}`);
|
|
14063
14186
|
output.log("");
|
|
14064
|
-
output.log(
|
|
14187
|
+
output.log(chalk29.bold("--- Content ---"));
|
|
14065
14188
|
output.log("");
|
|
14066
14189
|
output.log(skill.content);
|
|
14067
14190
|
}
|
|
@@ -14075,7 +14198,7 @@ var GetCommand3 = {
|
|
|
14075
14198
|
};
|
|
14076
14199
|
|
|
14077
14200
|
// src/commands/skills/search.ts
|
|
14078
|
-
import
|
|
14201
|
+
import chalk30 from "chalk";
|
|
14079
14202
|
var SearchCommand2 = {
|
|
14080
14203
|
command: "search <term>",
|
|
14081
14204
|
aliases: ["find"],
|
|
@@ -14114,7 +14237,7 @@ var SearchCommand2 = {
|
|
|
14114
14237
|
const term = args.term.toLowerCase();
|
|
14115
14238
|
const results = allSkills.filter((s) => s.name.toLowerCase().includes(term) || s.description.toLowerCase().includes(term));
|
|
14116
14239
|
if (results.length === 0) {
|
|
14117
|
-
output.log(
|
|
14240
|
+
output.log(chalk30.yellow(`No skills found matching: ${args.term}`));
|
|
14118
14241
|
return;
|
|
14119
14242
|
}
|
|
14120
14243
|
if (args.json) {
|
|
@@ -14131,19 +14254,19 @@ var SearchCommand2 = {
|
|
|
14131
14254
|
} else if (args.quiet) {
|
|
14132
14255
|
results.forEach((s) => output.log(s.name));
|
|
14133
14256
|
} else {
|
|
14134
|
-
output.log(
|
|
14257
|
+
output.log(chalk30.bold(`Search results for "${args.term}":`));
|
|
14135
14258
|
output.log("");
|
|
14136
14259
|
const header = [
|
|
14137
|
-
|
|
14138
|
-
|
|
14139
|
-
|
|
14260
|
+
chalk30.bold("Name"),
|
|
14261
|
+
chalk30.bold("Description"),
|
|
14262
|
+
chalk30.bold("Match")
|
|
14140
14263
|
].join(" | ");
|
|
14141
14264
|
const rows = results.map((s) => {
|
|
14142
14265
|
const matchedIn = s.name.toLowerCase().includes(term) ? "name" : "description";
|
|
14143
|
-
const matchColor = matchedIn === "name" ?
|
|
14266
|
+
const matchColor = matchedIn === "name" ? chalk30.green : chalk30.blue;
|
|
14144
14267
|
const desc2 = s.description.length > 40 ? s.description.slice(0, 37) + "..." : s.description;
|
|
14145
14268
|
return [
|
|
14146
|
-
|
|
14269
|
+
chalk30.cyan(s.name),
|
|
14147
14270
|
desc2,
|
|
14148
14271
|
matchColor(`[${matchedIn}]`)
|
|
14149
14272
|
].join(" | ");
|
|
@@ -14155,7 +14278,7 @@ var SearchCommand2 = {
|
|
|
14155
14278
|
...rows.map((r) => `│${r}│`),
|
|
14156
14279
|
"└" + "─".repeat(header.length + 2) + "┘",
|
|
14157
14280
|
"",
|
|
14158
|
-
|
|
14281
|
+
chalk30.gray(`${results.length} matching skill(s) found.`)
|
|
14159
14282
|
].join(`
|
|
14160
14283
|
`));
|
|
14161
14284
|
}
|
|
@@ -14169,7 +14292,7 @@ var SearchCommand2 = {
|
|
|
14169
14292
|
};
|
|
14170
14293
|
|
|
14171
14294
|
// src/commands/skills/reload.ts
|
|
14172
|
-
import
|
|
14295
|
+
import chalk31 from "chalk";
|
|
14173
14296
|
var ReloadCommand = {
|
|
14174
14297
|
command: "reload",
|
|
14175
14298
|
describe: "重新扫描并更新 SkillTool",
|
|
@@ -14192,10 +14315,10 @@ var ReloadCommand = {
|
|
|
14192
14315
|
output.error("SkillComponent not available");
|
|
14193
14316
|
process.exit(1);
|
|
14194
14317
|
}
|
|
14195
|
-
output.log(
|
|
14318
|
+
output.log(chalk31.blue("Reloading skills..."));
|
|
14196
14319
|
await skillComponent.reload();
|
|
14197
14320
|
const skills = skillComponent.getSkillList();
|
|
14198
|
-
output.log(
|
|
14321
|
+
output.log(chalk31.green(`Successfully reloaded ${skills.length} skills`));
|
|
14199
14322
|
} catch (error) {
|
|
14200
14323
|
output.error(`Failed to reload skills: ${error}`);
|
|
14201
14324
|
process.exit(1);
|
|
@@ -14206,7 +14329,7 @@ var ReloadCommand = {
|
|
|
14206
14329
|
};
|
|
14207
14330
|
|
|
14208
14331
|
// src/commands/skills/show-config.ts
|
|
14209
|
-
import
|
|
14332
|
+
import chalk32 from "chalk";
|
|
14210
14333
|
var ShowConfigCommand = {
|
|
14211
14334
|
command: "show-config",
|
|
14212
14335
|
aliases: ["config"],
|
|
@@ -14231,38 +14354,38 @@ var ShowConfigCommand = {
|
|
|
14231
14354
|
process.exit(1);
|
|
14232
14355
|
}
|
|
14233
14356
|
const defaultConfig = skillComponent.getConfig?.();
|
|
14234
|
-
output.log(
|
|
14357
|
+
output.log(chalk32.bold.cyan(`# Skills Configuration
|
|
14235
14358
|
`));
|
|
14236
|
-
output.log(
|
|
14359
|
+
output.log(chalk32.bold(`## Scan Paths
|
|
14237
14360
|
`));
|
|
14238
14361
|
const paths = [
|
|
14239
14362
|
{ type: "user", desc: "用户路径", path: "~/.config/roy-agent/skills/" },
|
|
14240
14363
|
{ type: "project", desc: "项目路径", path: ".roy/skills/" }
|
|
14241
14364
|
];
|
|
14242
14365
|
for (const p of paths) {
|
|
14243
|
-
const typeColor = p.type === "project" ?
|
|
14244
|
-
output.log(` ${typeColor("[ " + p.type + " ]")} ${
|
|
14245
|
-
output.log(` ${
|
|
14366
|
+
const typeColor = p.type === "project" ? chalk32.green : chalk32.blue;
|
|
14367
|
+
output.log(` ${typeColor("[ " + p.type + " ]")} ${chalk32.gray(p.desc)}`);
|
|
14368
|
+
output.log(` ${chalk32.cyan(p.path)}
|
|
14246
14369
|
`);
|
|
14247
14370
|
}
|
|
14248
|
-
output.log(
|
|
14371
|
+
output.log(chalk32.bold(`## Scan Rules
|
|
14249
14372
|
`));
|
|
14250
|
-
output.log(` ${
|
|
14251
|
-
output.log(` ${
|
|
14252
|
-
output.log(` ${
|
|
14373
|
+
output.log(` ${chalk32.gray("Pattern:")} ${chalk32.cyan("**/SKILL.md")}`);
|
|
14374
|
+
output.log(` ${chalk32.gray("Recursive:")} ${chalk32.green("true")}`);
|
|
14375
|
+
output.log(` ${chalk32.gray("Ignore:")} ${chalk32.cyan("**/node_modules/**")}
|
|
14253
14376
|
`);
|
|
14254
|
-
output.log(
|
|
14377
|
+
output.log(chalk32.bold(`## Priority (High to Low)
|
|
14255
14378
|
`));
|
|
14256
|
-
output.log(` ${
|
|
14257
|
-
output.log(` ${
|
|
14258
|
-
output.log(` ${
|
|
14379
|
+
output.log(` ${chalk32.green("1. project")} - 项目路径(最高优先级)`);
|
|
14380
|
+
output.log(` ${chalk32.blue("2. user")} - 用户路径`);
|
|
14381
|
+
output.log(` ${chalk32.gray("3. built-in")} - 内置路径(预留)
|
|
14259
14382
|
`);
|
|
14260
|
-
output.log(
|
|
14383
|
+
output.log(chalk32.bold(`## Usage
|
|
14261
14384
|
`));
|
|
14262
|
-
output.log(` ${
|
|
14263
|
-
output.log(` ${
|
|
14264
|
-
output.log(` ${
|
|
14265
|
-
output.log(` ${
|
|
14385
|
+
output.log(` ${chalk32.cyan("roy-agent skills list")} ${chalk32.gray("- 列出所有技能")}`);
|
|
14386
|
+
output.log(` ${chalk32.cyan("roy-agent skills get <name>")} ${chalk32.gray("- 获取技能内容")}`);
|
|
14387
|
+
output.log(` ${chalk32.cyan("roy-agent skills search <term>")} ${chalk32.gray("- 搜索技能")}`);
|
|
14388
|
+
output.log(` ${chalk32.cyan("roy-agent skills reload")} ${chalk32.gray("- 重新扫描技能")}`);
|
|
14266
14389
|
} catch (error) {
|
|
14267
14390
|
output.error(`Failed to show config: ${error}`);
|
|
14268
14391
|
process.exit(1);
|
|
@@ -14283,7 +14406,7 @@ var SkillsCommand = {
|
|
|
14283
14406
|
};
|
|
14284
14407
|
|
|
14285
14408
|
// src/commands/agents/list.ts
|
|
14286
|
-
import
|
|
14409
|
+
import chalk33 from "chalk";
|
|
14287
14410
|
var ListCommand4 = {
|
|
14288
14411
|
command: "list",
|
|
14289
14412
|
aliases: ["ls"],
|
|
@@ -14369,27 +14492,27 @@ var ListCommand4 = {
|
|
|
14369
14492
|
output.log(hint);
|
|
14370
14493
|
} else {
|
|
14371
14494
|
const header = [
|
|
14372
|
-
|
|
14373
|
-
|
|
14374
|
-
|
|
14375
|
-
|
|
14376
|
-
|
|
14377
|
-
|
|
14495
|
+
chalk33.bold("Name"),
|
|
14496
|
+
chalk33.bold("Type"),
|
|
14497
|
+
chalk33.bold("Source"),
|
|
14498
|
+
chalk33.bold("Model"),
|
|
14499
|
+
chalk33.bold("Workflow"),
|
|
14500
|
+
chalk33.bold("Description")
|
|
14378
14501
|
].join(" | ");
|
|
14379
14502
|
const typeColor = (type) => {
|
|
14380
14503
|
if (type === "primary")
|
|
14381
|
-
return
|
|
14504
|
+
return chalk33.yellow;
|
|
14382
14505
|
if (type === "workflow")
|
|
14383
|
-
return
|
|
14384
|
-
return
|
|
14506
|
+
return chalk33.magenta;
|
|
14507
|
+
return chalk33.blue;
|
|
14385
14508
|
};
|
|
14386
14509
|
const rows = pagedAgents.map((a) => {
|
|
14387
14510
|
const desc2 = (a.description || "").length > 40 ? (a.description || "").slice(0, 37) + "..." : a.description || "-";
|
|
14388
|
-
const workflowDisplay = a.type === "workflow" && a.workflow ?
|
|
14389
|
-
const modelDisplay = a.model ?
|
|
14390
|
-
const sourceDisplay = builtInSubAgentNames.has(a.name) ?
|
|
14511
|
+
const workflowDisplay = a.type === "workflow" && a.workflow ? chalk33.cyan(a.workflow.length > 30 ? a.workflow.slice(0, 27) + "..." : a.workflow) : chalk33.gray("-");
|
|
14512
|
+
const modelDisplay = a.model ? chalk33.yellow(a.model.length > 20 ? a.model.slice(0, 17) + "..." : a.model) : chalk33.gray("-");
|
|
14513
|
+
const sourceDisplay = builtInSubAgentNames.has(a.name) ? chalk33.green("built-in") : chalk33.gray("user");
|
|
14391
14514
|
return [
|
|
14392
|
-
|
|
14515
|
+
chalk33.cyan(a.name),
|
|
14393
14516
|
typeColor(a.type)(a.type),
|
|
14394
14517
|
sourceDisplay,
|
|
14395
14518
|
modelDisplay,
|
|
@@ -14398,9 +14521,9 @@ var ListCommand4 = {
|
|
|
14398
14521
|
].join(" | ");
|
|
14399
14522
|
});
|
|
14400
14523
|
if (rows.length === 0) {
|
|
14401
|
-
output.log(
|
|
14524
|
+
output.log(chalk33.yellow("No agents found."));
|
|
14402
14525
|
output.log("");
|
|
14403
|
-
output.log(
|
|
14526
|
+
output.log(chalk33.gray("Tip: Create agent configs in ~/.local/share/roy-agent/agents/"));
|
|
14404
14527
|
} else {
|
|
14405
14528
|
output.log([
|
|
14406
14529
|
`┌─ Agents ${"─".repeat(50)}┐`,
|
|
@@ -14431,7 +14554,7 @@ var ListCommand4 = {
|
|
|
14431
14554
|
};
|
|
14432
14555
|
|
|
14433
14556
|
// src/commands/agents/get.ts
|
|
14434
|
-
import
|
|
14557
|
+
import chalk34 from "chalk";
|
|
14435
14558
|
var GetCommand4 = {
|
|
14436
14559
|
command: "get <name>",
|
|
14437
14560
|
describe: "获取指定 agent 的详细信息",
|
|
@@ -14490,69 +14613,69 @@ var GetCommand4 = {
|
|
|
14490
14613
|
filterHistory: agent.filterHistory
|
|
14491
14614
|
});
|
|
14492
14615
|
} else {
|
|
14493
|
-
output.log(
|
|
14616
|
+
output.log(chalk34.bold.cyan(`# Agent: ${agent.name}`));
|
|
14494
14617
|
output.log("");
|
|
14495
|
-
output.log(
|
|
14496
|
-
output.log(` ${
|
|
14497
|
-
output.log(` ${
|
|
14618
|
+
output.log(chalk34.bold("Basic Info:"));
|
|
14619
|
+
output.log(` ${chalk34.cyan("name:")} ${agent.name}`);
|
|
14620
|
+
output.log(` ${chalk34.cyan("type:")} ${agent.type}`);
|
|
14498
14621
|
if (agent.description) {
|
|
14499
|
-
output.log(` ${
|
|
14622
|
+
output.log(` ${chalk34.cyan("description:")} ${agent.description}`);
|
|
14500
14623
|
}
|
|
14501
14624
|
output.log("");
|
|
14502
14625
|
if (agent.type === "workflow") {
|
|
14503
|
-
output.log(
|
|
14626
|
+
output.log(chalk34.bold("Workflow:"));
|
|
14504
14627
|
if (agent.workflow) {
|
|
14505
|
-
output.log(` ${
|
|
14506
|
-
output.log(` ${
|
|
14628
|
+
output.log(` ${chalk34.cyan("workflow:")} ${agent.workflow}`);
|
|
14629
|
+
output.log(` ${chalk34.gray("→")} ${chalk34.gray(`roy-agent workflow run ${agent.workflow} --input '{"query":"..."}'`)}`);
|
|
14507
14630
|
} else {
|
|
14508
|
-
output.log(` ${
|
|
14631
|
+
output.log(` ${chalk34.gray("(no workflow configured)")}`);
|
|
14509
14632
|
}
|
|
14510
14633
|
output.log("");
|
|
14511
14634
|
}
|
|
14512
|
-
output.log(
|
|
14635
|
+
output.log(chalk34.bold("System Prompt:"));
|
|
14513
14636
|
if (agent.systemPromptRef) {
|
|
14514
|
-
output.log(` ${
|
|
14637
|
+
output.log(` ${chalk34.green("[ref]")} ${chalk34.cyan("systemPromptRef:")} ${agent.systemPromptRef}`);
|
|
14515
14638
|
}
|
|
14516
14639
|
if (agent.systemPrompt && !agent.systemPromptRef) {
|
|
14517
14640
|
const promptPreview = agent.systemPrompt.length > 100 ? agent.systemPrompt.slice(0, 97) + "..." : agent.systemPrompt;
|
|
14518
|
-
output.log(` ${
|
|
14519
|
-
output.log(` ${
|
|
14641
|
+
output.log(` ${chalk34.gray("[inline]")}`);
|
|
14642
|
+
output.log(` ${chalk34.gray(promptPreview.split(`
|
|
14520
14643
|
`).join(`
|
|
14521
14644
|
`))}`);
|
|
14522
14645
|
}
|
|
14523
14646
|
if (resolvedSystemPrompt) {
|
|
14524
14647
|
const resolvedPreview = resolvedSystemPrompt.length > 200 ? resolvedSystemPrompt.slice(0, 197) + "..." : resolvedSystemPrompt;
|
|
14525
|
-
output.log(` ${
|
|
14526
|
-
output.log(` ${
|
|
14648
|
+
output.log(` ${chalk34.green("[resolved]")}`);
|
|
14649
|
+
output.log(` ${chalk34.gray(resolvedPreview.split(`
|
|
14527
14650
|
`).join(`
|
|
14528
14651
|
`))}`);
|
|
14529
14652
|
}
|
|
14530
14653
|
if (!agent.systemPromptRef && !agent.systemPrompt && !resolvedSystemPrompt) {
|
|
14531
|
-
output.log(` ${
|
|
14654
|
+
output.log(` ${chalk34.gray("(none)")}`);
|
|
14532
14655
|
}
|
|
14533
14656
|
output.log("");
|
|
14534
14657
|
const hasOptions = agent.model || agent.maxIterations || agent.toolTimeout;
|
|
14535
14658
|
if (hasOptions) {
|
|
14536
|
-
output.log(
|
|
14659
|
+
output.log(chalk34.bold("Options:"));
|
|
14537
14660
|
if (agent.model) {
|
|
14538
|
-
output.log(` ${
|
|
14661
|
+
output.log(` ${chalk34.cyan("model:")} ${agent.model}`);
|
|
14539
14662
|
}
|
|
14540
14663
|
if (agent.maxIterations) {
|
|
14541
|
-
output.log(` ${
|
|
14664
|
+
output.log(` ${chalk34.cyan("maxIterations:")} ${agent.maxIterations}`);
|
|
14542
14665
|
}
|
|
14543
14666
|
if (agent.toolTimeout) {
|
|
14544
|
-
output.log(` ${
|
|
14667
|
+
output.log(` ${chalk34.cyan("toolTimeout:")} ${agent.toolTimeout}ms`);
|
|
14545
14668
|
}
|
|
14546
14669
|
output.log("");
|
|
14547
14670
|
}
|
|
14548
14671
|
const hasTools = agent.allowedTools?.length || agent.deniedTools?.length;
|
|
14549
14672
|
if (hasTools) {
|
|
14550
|
-
output.log(
|
|
14673
|
+
output.log(chalk34.bold("Tool Permissions:"));
|
|
14551
14674
|
if (agent.allowedTools?.length) {
|
|
14552
|
-
output.log(` ${
|
|
14675
|
+
output.log(` ${chalk34.green("allowed:")} ${agent.allowedTools.join(", ")}`);
|
|
14553
14676
|
}
|
|
14554
14677
|
if (agent.deniedTools?.length) {
|
|
14555
|
-
output.log(` ${
|
|
14678
|
+
output.log(` ${chalk34.red("denied:")} ${agent.deniedTools.join(", ")}`);
|
|
14556
14679
|
}
|
|
14557
14680
|
output.log("");
|
|
14558
14681
|
}
|
|
@@ -14567,7 +14690,7 @@ var GetCommand4 = {
|
|
|
14567
14690
|
};
|
|
14568
14691
|
|
|
14569
14692
|
// src/commands/agents/add.ts
|
|
14570
|
-
import
|
|
14693
|
+
import chalk35 from "chalk";
|
|
14571
14694
|
function parseToolList(value) {
|
|
14572
14695
|
if (!value?.trim()) {
|
|
14573
14696
|
return;
|
|
@@ -14659,8 +14782,8 @@ var AddCommand = {
|
|
|
14659
14782
|
if (args.json) {
|
|
14660
14783
|
output.json({ agent, filePath });
|
|
14661
14784
|
} else {
|
|
14662
|
-
output.log(
|
|
14663
|
-
output.log(
|
|
14785
|
+
output.log(chalk35.green(`✓ Agent '${args.name}' created`));
|
|
14786
|
+
output.log(chalk35.gray(` ${filePath}`));
|
|
14664
14787
|
}
|
|
14665
14788
|
} catch (error) {
|
|
14666
14789
|
output.error(`Failed to add agent: ${error}`);
|
|
@@ -14672,7 +14795,7 @@ var AddCommand = {
|
|
|
14672
14795
|
};
|
|
14673
14796
|
|
|
14674
14797
|
// src/commands/agents/delete.ts
|
|
14675
|
-
import
|
|
14798
|
+
import chalk36 from "chalk";
|
|
14676
14799
|
var DeleteCommand3 = {
|
|
14677
14800
|
command: "delete <name>",
|
|
14678
14801
|
describe: "删除 agent 配置文件",
|
|
@@ -14714,7 +14837,7 @@ var DeleteCommand3 = {
|
|
|
14714
14837
|
}
|
|
14715
14838
|
const filePath = registry.getAgentFilePath(args.name);
|
|
14716
14839
|
if (!args.yes) {
|
|
14717
|
-
output.log(
|
|
14840
|
+
output.log(chalk36.yellow(`Delete agent '${args.name}'? This removes ${filePath} (use --yes to skip confirmation)`));
|
|
14718
14841
|
process.exit(1);
|
|
14719
14842
|
}
|
|
14720
14843
|
const deleted = await registry.deleteAgent(args.name);
|
|
@@ -14725,7 +14848,7 @@ var DeleteCommand3 = {
|
|
|
14725
14848
|
if (args.json) {
|
|
14726
14849
|
output.json({ deleted: true, name: args.name, filePath });
|
|
14727
14850
|
} else {
|
|
14728
|
-
output.log(
|
|
14851
|
+
output.log(chalk36.green(`✓ Agent '${args.name}' deleted`));
|
|
14729
14852
|
}
|
|
14730
14853
|
} catch (error) {
|
|
14731
14854
|
output.error(`Failed to delete agent: ${error}`);
|
|
@@ -14737,7 +14860,7 @@ var DeleteCommand3 = {
|
|
|
14737
14860
|
};
|
|
14738
14861
|
|
|
14739
14862
|
// src/commands/agents/config-dir.ts
|
|
14740
|
-
import
|
|
14863
|
+
import chalk37 from "chalk";
|
|
14741
14864
|
var ConfigDirCommand = {
|
|
14742
14865
|
command: "config-dir",
|
|
14743
14866
|
describe: "显示 agent 配置目录路径",
|
|
@@ -14768,8 +14891,8 @@ var ConfigDirCommand = {
|
|
|
14768
14891
|
if (args.json) {
|
|
14769
14892
|
output.json({ configDir, exists });
|
|
14770
14893
|
} else {
|
|
14771
|
-
output.log(`${
|
|
14772
|
-
output.log(`${
|
|
14894
|
+
output.log(`${chalk37.cyan("Agent Config Directory:")} ${configDir}`);
|
|
14895
|
+
output.log(`${chalk37.gray("Exists:")} ${exists ? "yes" : "no"}`);
|
|
14773
14896
|
}
|
|
14774
14897
|
} catch (error) {
|
|
14775
14898
|
output.error(`Failed to get config dir: ${error}`);
|
|
@@ -14792,7 +14915,7 @@ var AgentsCommand = {
|
|
|
14792
14915
|
};
|
|
14793
14916
|
|
|
14794
14917
|
// src/commands/prompt/list.ts
|
|
14795
|
-
import
|
|
14918
|
+
import chalk38 from "chalk";
|
|
14796
14919
|
var ListCommand5 = {
|
|
14797
14920
|
command: "list",
|
|
14798
14921
|
aliases: ["ls"],
|
|
@@ -14861,17 +14984,17 @@ var ListCommand5 = {
|
|
|
14861
14984
|
output.log(hint);
|
|
14862
14985
|
} else {
|
|
14863
14986
|
const header = [
|
|
14864
|
-
|
|
14865
|
-
|
|
14987
|
+
chalk38.bold("Name"),
|
|
14988
|
+
chalk38.bold("Source")
|
|
14866
14989
|
].join(" | ");
|
|
14867
14990
|
const rows = prompts.map((p) => {
|
|
14868
14991
|
return [
|
|
14869
|
-
|
|
14870
|
-
|
|
14992
|
+
chalk38.cyan(p.name),
|
|
14993
|
+
chalk38.gray(`[${p.source}]`)
|
|
14871
14994
|
].join(" | ");
|
|
14872
14995
|
});
|
|
14873
14996
|
if (rows.length === 0) {
|
|
14874
|
-
output.log(
|
|
14997
|
+
output.log(chalk38.yellow("No prompts found."));
|
|
14875
14998
|
} else {
|
|
14876
14999
|
output.log([
|
|
14877
15000
|
`┌─ Prompts ${"─".repeat(50)}┐`,
|
|
@@ -14902,7 +15025,7 @@ var ListCommand5 = {
|
|
|
14902
15025
|
};
|
|
14903
15026
|
|
|
14904
15027
|
// src/commands/prompt/get.ts
|
|
14905
|
-
import
|
|
15028
|
+
import chalk39 from "chalk";
|
|
14906
15029
|
var GetCommand5 = {
|
|
14907
15030
|
command: "get <name>",
|
|
14908
15031
|
describe: "获取指定 prompt 的内容",
|
|
@@ -14949,16 +15072,16 @@ var GetCommand5 = {
|
|
|
14949
15072
|
variables: vars
|
|
14950
15073
|
});
|
|
14951
15074
|
} else {
|
|
14952
|
-
output.log(
|
|
15075
|
+
output.log(chalk39.bold.cyan(`# Prompt: ${args.name}`));
|
|
14953
15076
|
output.log("");
|
|
14954
15077
|
if (Object.keys(vars).length > 0) {
|
|
14955
|
-
output.log(
|
|
15078
|
+
output.log(chalk39.gray("Variables:"));
|
|
14956
15079
|
for (const [key, value] of Object.entries(vars)) {
|
|
14957
|
-
output.log(` ${
|
|
15080
|
+
output.log(` ${chalk39.cyan(key + ":")} ${value}`);
|
|
14958
15081
|
}
|
|
14959
15082
|
output.log("");
|
|
14960
15083
|
}
|
|
14961
|
-
output.log(
|
|
15084
|
+
output.log(chalk39.bold("Content:"));
|
|
14962
15085
|
output.log("─".repeat(60));
|
|
14963
15086
|
output.log(prompt);
|
|
14964
15087
|
output.log("─".repeat(60));
|
|
@@ -14988,7 +15111,7 @@ function parseVars(vars) {
|
|
|
14988
15111
|
|
|
14989
15112
|
// src/commands/prompt/add.ts
|
|
14990
15113
|
import { readFile as readFile2 } from "fs/promises";
|
|
14991
|
-
import
|
|
15114
|
+
import chalk40 from "chalk";
|
|
14992
15115
|
var AddCommand2 = {
|
|
14993
15116
|
command: "add <name>",
|
|
14994
15117
|
describe: "添加 prompt 并持久化到 ~/.local/share/roy-agent/prompts/",
|
|
@@ -15039,8 +15162,8 @@ var AddCommand2 = {
|
|
|
15039
15162
|
length: content.trim().length
|
|
15040
15163
|
});
|
|
15041
15164
|
} else {
|
|
15042
|
-
output.log(
|
|
15043
|
-
output.log(
|
|
15165
|
+
output.log(chalk40.green(`✓ Prompt '${args.name}' saved`));
|
|
15166
|
+
output.log(chalk40.gray(` ${filePath}`));
|
|
15044
15167
|
}
|
|
15045
15168
|
} catch (error) {
|
|
15046
15169
|
output.error(`Failed to add prompt: ${error}`);
|
|
@@ -15052,7 +15175,7 @@ var AddCommand2 = {
|
|
|
15052
15175
|
};
|
|
15053
15176
|
|
|
15054
15177
|
// src/commands/prompt/config-dir.ts
|
|
15055
|
-
import
|
|
15178
|
+
import chalk41 from "chalk";
|
|
15056
15179
|
var ConfigDirCommand2 = {
|
|
15057
15180
|
command: "config-dir",
|
|
15058
15181
|
describe: "显示 prompt 持久化目录路径",
|
|
@@ -15082,8 +15205,8 @@ var ConfigDirCommand2 = {
|
|
|
15082
15205
|
if (args.json) {
|
|
15083
15206
|
output.json({ configDir, exists });
|
|
15084
15207
|
} else {
|
|
15085
|
-
output.log(`${
|
|
15086
|
-
output.log(`${
|
|
15208
|
+
output.log(`${chalk41.cyan("Prompt Config Directory:")} ${configDir}`);
|
|
15209
|
+
output.log(`${chalk41.gray("Exists:")} ${exists ? "yes" : "no"}`);
|
|
15087
15210
|
}
|
|
15088
15211
|
} catch (error) {
|
|
15089
15212
|
output.error(`Failed to get config dir: ${error}`);
|
|
@@ -15105,7 +15228,7 @@ var PromptCommand = {
|
|
|
15105
15228
|
};
|
|
15106
15229
|
|
|
15107
15230
|
// src/commands/commands-list.ts
|
|
15108
|
-
import
|
|
15231
|
+
import chalk42 from "chalk";
|
|
15109
15232
|
function truncateVisual(str, maxWidth) {
|
|
15110
15233
|
let result = "";
|
|
15111
15234
|
let width = 0;
|
|
@@ -15120,16 +15243,16 @@ function truncateVisual(str, maxWidth) {
|
|
|
15120
15243
|
}
|
|
15121
15244
|
function formatCommandsTable(commands) {
|
|
15122
15245
|
if (commands.length === 0) {
|
|
15123
|
-
return
|
|
15246
|
+
return chalk42.yellow("命令目录为空,使用 'roy-agent commands add' 添加命令");
|
|
15124
15247
|
}
|
|
15125
15248
|
const NAME_WIDTH = 20;
|
|
15126
15249
|
const SOURCE_WIDTH = 10;
|
|
15127
15250
|
const DESC_WIDTH = 50;
|
|
15128
15251
|
const GAP = " ";
|
|
15129
15252
|
const headerLine = [
|
|
15130
|
-
|
|
15131
|
-
|
|
15132
|
-
|
|
15253
|
+
chalk42.bold("NAME".padEnd(NAME_WIDTH)),
|
|
15254
|
+
chalk42.bold("SOURCE".padEnd(SOURCE_WIDTH)),
|
|
15255
|
+
chalk42.bold("DESCRIPTION")
|
|
15133
15256
|
].join(GAP);
|
|
15134
15257
|
const sepLine = "─".repeat(NAME_WIDTH + SOURCE_WIDTH + DESC_WIDTH + GAP.length * 2);
|
|
15135
15258
|
const formatRow = (cmd) => {
|
|
@@ -15237,7 +15360,7 @@ var CommandsListCommand = {
|
|
|
15237
15360
|
};
|
|
15238
15361
|
|
|
15239
15362
|
// src/commands/commands-add.ts
|
|
15240
|
-
import
|
|
15363
|
+
import chalk43 from "chalk";
|
|
15241
15364
|
var CommandsAddCommand = {
|
|
15242
15365
|
command: "add <name> <target>",
|
|
15243
15366
|
describe: "添加收藏命令(自动创建 symlink)",
|
|
@@ -15298,10 +15421,10 @@ var CommandsAddCommand = {
|
|
|
15298
15421
|
});
|
|
15299
15422
|
const dirs = await commandsComponent.getCommandDirs();
|
|
15300
15423
|
const targetDir = source === "user" ? dirs.user : dirs.project;
|
|
15301
|
-
output.log(
|
|
15302
|
-
output.log(
|
|
15303
|
-
output.log(
|
|
15304
|
-
output.log(
|
|
15424
|
+
output.log(chalk43.green(`✅ 已添加命令 '${args.name}'`));
|
|
15425
|
+
output.log(chalk43.gray(` 目标: ${args.target}`));
|
|
15426
|
+
output.log(chalk43.gray(` 位置: ${targetDir}/${args.name}`));
|
|
15427
|
+
output.log(chalk43.gray(` 级别: ${source === "user" ? "USER" : "PROJECT"}`));
|
|
15305
15428
|
} catch (error) {
|
|
15306
15429
|
output.error(`添加失败: ${error.message}`);
|
|
15307
15430
|
process.exit(1);
|
|
@@ -15312,7 +15435,7 @@ var CommandsAddCommand = {
|
|
|
15312
15435
|
};
|
|
15313
15436
|
|
|
15314
15437
|
// src/commands/commands-remove.ts
|
|
15315
|
-
import
|
|
15438
|
+
import chalk44 from "chalk";
|
|
15316
15439
|
var CommandsRemoveCommand = {
|
|
15317
15440
|
command: "remove <name>",
|
|
15318
15441
|
aliases: ["rm"],
|
|
@@ -15356,7 +15479,7 @@ var CommandsRemoveCommand = {
|
|
|
15356
15479
|
name: args.name,
|
|
15357
15480
|
source: "user"
|
|
15358
15481
|
});
|
|
15359
|
-
output.log(
|
|
15482
|
+
output.log(chalk44.green(`✅ 已从用户目录移除命令 '${args.name}'`));
|
|
15360
15483
|
} catch (error) {
|
|
15361
15484
|
if (!error.message?.includes("不存在")) {
|
|
15362
15485
|
throw error;
|
|
@@ -15369,7 +15492,7 @@ var CommandsRemoveCommand = {
|
|
|
15369
15492
|
name: args.name,
|
|
15370
15493
|
source: "project"
|
|
15371
15494
|
});
|
|
15372
|
-
output.log(
|
|
15495
|
+
output.log(chalk44.green(`✅ 已从项目目录移除命令 '${args.name}'`));
|
|
15373
15496
|
} catch (error) {
|
|
15374
15497
|
if (!error.message?.includes("不存在")) {
|
|
15375
15498
|
throw error;
|
|
@@ -15383,7 +15506,7 @@ var CommandsRemoveCommand = {
|
|
|
15383
15506
|
name: args.name,
|
|
15384
15507
|
source: "user"
|
|
15385
15508
|
});
|
|
15386
|
-
output.log(
|
|
15509
|
+
output.log(chalk44.green(`✅ 已从用户目录移除命令 '${args.name}'`));
|
|
15387
15510
|
removed = true;
|
|
15388
15511
|
} catch (error) {
|
|
15389
15512
|
if (!error.message?.includes("不存在")) {
|
|
@@ -15395,7 +15518,7 @@ var CommandsRemoveCommand = {
|
|
|
15395
15518
|
name: args.name,
|
|
15396
15519
|
source: "project"
|
|
15397
15520
|
});
|
|
15398
|
-
output.log(
|
|
15521
|
+
output.log(chalk44.green(`✅ 已从项目目录移除命令 '${args.name}'`));
|
|
15399
15522
|
removed = true;
|
|
15400
15523
|
} catch (error) {
|
|
15401
15524
|
if (!error.message?.includes("不存在")) {
|
|
@@ -15417,7 +15540,7 @@ var CommandsRemoveCommand = {
|
|
|
15417
15540
|
};
|
|
15418
15541
|
|
|
15419
15542
|
// src/commands/commands-info.ts
|
|
15420
|
-
import
|
|
15543
|
+
import chalk45 from "chalk";
|
|
15421
15544
|
import { exec as exec2 } from "child_process";
|
|
15422
15545
|
import { promisify } from "util";
|
|
15423
15546
|
var execAsync2 = promisify(exec2);
|
|
@@ -15452,12 +15575,12 @@ var CommandsInfoCommand = {
|
|
|
15452
15575
|
output.error(`命令 '${args.name}' 不存在`);
|
|
15453
15576
|
process.exit(1);
|
|
15454
15577
|
}
|
|
15455
|
-
output.log(
|
|
15456
|
-
output.log(
|
|
15457
|
-
output.log(
|
|
15458
|
-
output.log(
|
|
15578
|
+
output.log(chalk45.bold("Name:") + ` ${info.name}`);
|
|
15579
|
+
output.log(chalk45.bold("Path:") + ` ${info.path}`);
|
|
15580
|
+
output.log(chalk45.bold("Source:") + ` ${info.source.toUpperCase()}`);
|
|
15581
|
+
output.log(chalk45.bold("Description:") + ` ${info.shortDescription || "-"}`);
|
|
15459
15582
|
output.log();
|
|
15460
|
-
output.log(
|
|
15583
|
+
output.log(chalk45.gray("─".repeat(50)));
|
|
15461
15584
|
output.log();
|
|
15462
15585
|
try {
|
|
15463
15586
|
const { stdout } = await execAsync2(`${info.path} --help`, { timeout: 5000 });
|
|
@@ -15467,7 +15590,7 @@ var CommandsInfoCommand = {
|
|
|
15467
15590
|
const { stdout } = await execAsync2(`${info.path} -h`, { timeout: 5000 });
|
|
15468
15591
|
output.log(stdout);
|
|
15469
15592
|
} catch {
|
|
15470
|
-
output.log(
|
|
15593
|
+
output.log(chalk45.gray("(无法获取帮助信息)"));
|
|
15471
15594
|
}
|
|
15472
15595
|
}
|
|
15473
15596
|
} catch (error) {
|
|
@@ -15480,7 +15603,7 @@ var CommandsInfoCommand = {
|
|
|
15480
15603
|
};
|
|
15481
15604
|
|
|
15482
15605
|
// src/commands/commands-dirs.ts
|
|
15483
|
-
import
|
|
15606
|
+
import chalk46 from "chalk";
|
|
15484
15607
|
var CommandsDirsCommand = {
|
|
15485
15608
|
command: "dirs",
|
|
15486
15609
|
describe: "显示命令目录",
|
|
@@ -15512,10 +15635,10 @@ var CommandsDirsCommand = {
|
|
|
15512
15635
|
if (args.json) {
|
|
15513
15636
|
output.json(dirs);
|
|
15514
15637
|
} else {
|
|
15515
|
-
output.log(
|
|
15638
|
+
output.log(chalk46.bold("命令目录:"));
|
|
15516
15639
|
output.log();
|
|
15517
|
-
output.log(
|
|
15518
|
-
output.log(
|
|
15640
|
+
output.log(chalk46.cyan("USER:") + ` ${dirs.user}`);
|
|
15641
|
+
output.log(chalk46.cyan("PROJECT:") + ` ${dirs.project}`);
|
|
15519
15642
|
}
|
|
15520
15643
|
} catch (error) {
|
|
15521
15644
|
output.error(`错误: ${error.message}`);
|
|
@@ -15535,7 +15658,7 @@ var CommandsCommand = {
|
|
|
15535
15658
|
};
|
|
15536
15659
|
|
|
15537
15660
|
// src/commands/config/list.ts
|
|
15538
|
-
import
|
|
15661
|
+
import chalk47 from "chalk";
|
|
15539
15662
|
|
|
15540
15663
|
// src/commands/config/config-service.ts
|
|
15541
15664
|
import * as fsSync from "fs";
|
|
@@ -15839,7 +15962,7 @@ var ConfigListCommand = {
|
|
|
15839
15962
|
output.log("");
|
|
15840
15963
|
output.log("Supported components:");
|
|
15841
15964
|
for (const comp of SUPPORTED_COMPONENTS) {
|
|
15842
|
-
output.log(` ${
|
|
15965
|
+
output.log(` ${chalk47.cyan(comp.padEnd(15))} ${COMPONENT_DESCRIPTIONS[comp] || ""}`);
|
|
15843
15966
|
}
|
|
15844
15967
|
process.exit(1);
|
|
15845
15968
|
}
|
|
@@ -15857,27 +15980,27 @@ var ConfigListCommand = {
|
|
|
15857
15980
|
}
|
|
15858
15981
|
};
|
|
15859
15982
|
function showHelp(output) {
|
|
15860
|
-
output.log(
|
|
15983
|
+
output.log(chalk47.bold.cyan("# roy-agent config list"));
|
|
15861
15984
|
output.log("");
|
|
15862
15985
|
output.log("查看 roy-agent 组件配置信息");
|
|
15863
15986
|
output.log("");
|
|
15864
|
-
output.log(
|
|
15865
|
-
output.log(` ${
|
|
15987
|
+
output.log(chalk47.bold("Usage:"));
|
|
15988
|
+
output.log(` ${chalk47.cyan("roy-agent config list [component] [options]")}`);
|
|
15866
15989
|
output.log("");
|
|
15867
|
-
output.log(
|
|
15990
|
+
output.log(chalk47.bold("Components:"));
|
|
15868
15991
|
for (const comp of SUPPORTED_COMPONENTS) {
|
|
15869
|
-
output.log(` ${
|
|
15992
|
+
output.log(` ${chalk47.cyan(comp.padEnd(15))} ${chalk47.gray(COMPONENT_DESCRIPTIONS[comp] || "")}`);
|
|
15870
15993
|
}
|
|
15871
|
-
output.log(` ${
|
|
15994
|
+
output.log(` ${chalk47.cyan("all".padEnd(15))} 显示所有 components 概览`);
|
|
15872
15995
|
output.log("");
|
|
15873
|
-
output.log(
|
|
15874
|
-
output.log(` ${
|
|
15875
|
-
output.log(` ${
|
|
15876
|
-
output.log(` ${
|
|
15996
|
+
output.log(chalk47.bold("Options:"));
|
|
15997
|
+
output.log(` ${chalk47.cyan("-j, --json")} JSON 格式输出`);
|
|
15998
|
+
output.log(` ${chalk47.cyan("-k, --keys")} 只显示配置键`);
|
|
15999
|
+
output.log(` ${chalk47.cyan("-s, --sources")} 只显示配置源`);
|
|
15877
16000
|
output.log("");
|
|
15878
|
-
output.log(
|
|
16001
|
+
output.log(chalk47.bold("Examples:"));
|
|
15879
16002
|
for (const { command: command2, description } of USAGE_COMMANDS) {
|
|
15880
|
-
output.log(` ${
|
|
16003
|
+
output.log(` ${chalk47.cyan(command2.padEnd(40))} ${chalk47.gray(description)}`);
|
|
15881
16004
|
}
|
|
15882
16005
|
}
|
|
15883
16006
|
async function showAllComponents(output, configService) {
|
|
@@ -15886,13 +16009,13 @@ async function showAllComponents(output, configService) {
|
|
|
15886
16009
|
const config = configService.getComponentConfig(compName);
|
|
15887
16010
|
components.push({ name: compName, config });
|
|
15888
16011
|
}
|
|
15889
|
-
output.log(
|
|
16012
|
+
output.log(chalk47.bold.cyan("# All Components Overview"));
|
|
15890
16013
|
output.log("");
|
|
15891
|
-
output.log(` ${
|
|
15892
|
-
output.log(` ${
|
|
16014
|
+
output.log(` ${chalk47.cyan("Component".padEnd(15))} ${chalk47.cyan("Keys".padEnd(10))} ${chalk47.gray("Description")}`);
|
|
16015
|
+
output.log(` ${chalk47.gray("─".repeat(60))}`);
|
|
15893
16016
|
for (const comp of components) {
|
|
15894
16017
|
const keyCount = Object.keys(comp.config).length;
|
|
15895
|
-
output.log(` ${
|
|
16018
|
+
output.log(` ${chalk47.cyan(comp.name.padEnd(15))} ${keyCount.toString().padEnd(10)} ${chalk47.gray(COMPONENT_DESCRIPTIONS[comp.name] || "")}`);
|
|
15896
16019
|
}
|
|
15897
16020
|
}
|
|
15898
16021
|
async function showComponentConfig(componentName, output, configService, options) {
|
|
@@ -15914,22 +16037,22 @@ async function showComponentConfig(componentName, output, configService, options
|
|
|
15914
16037
|
});
|
|
15915
16038
|
return;
|
|
15916
16039
|
}
|
|
15917
|
-
output.log(
|
|
16040
|
+
output.log(chalk47.bold.cyan(`# ${componentName} Component Configuration`));
|
|
15918
16041
|
output.log("");
|
|
15919
16042
|
if (filePath) {
|
|
15920
|
-
output.log(
|
|
15921
|
-
output.log(` ${
|
|
16043
|
+
output.log(chalk47.bold("File:"));
|
|
16044
|
+
output.log(` ${chalk47.cyan(filePath)}`);
|
|
15922
16045
|
output.log("");
|
|
15923
16046
|
}
|
|
15924
16047
|
if (!options.sources) {
|
|
15925
|
-
output.log(
|
|
16048
|
+
output.log(chalk47.bold("Configuration:"));
|
|
15926
16049
|
if (Object.keys(config).length === 0) {
|
|
15927
|
-
output.log(` ${
|
|
16050
|
+
output.log(` ${chalk47.gray("(无配置)")}`);
|
|
15928
16051
|
} else {
|
|
15929
16052
|
const flatConfig = flattenConfig(config);
|
|
15930
16053
|
for (const [key, value] of flatConfig) {
|
|
15931
16054
|
const displayValue = formatValue(value);
|
|
15932
|
-
output.log(` ${
|
|
16055
|
+
output.log(` ${chalk47.cyan(key + ":")} ${displayValue}`);
|
|
15933
16056
|
}
|
|
15934
16057
|
}
|
|
15935
16058
|
output.log("");
|
|
@@ -15944,17 +16067,17 @@ async function showAgentComponentConfig(output, configService, options) {
|
|
|
15944
16067
|
});
|
|
15945
16068
|
return;
|
|
15946
16069
|
}
|
|
15947
|
-
output.log(
|
|
16070
|
+
output.log(chalk47.bold.cyan("# Agent Component Configuration"));
|
|
15948
16071
|
output.log("");
|
|
15949
16072
|
if (!options.sources) {
|
|
15950
|
-
output.log(
|
|
16073
|
+
output.log(chalk47.bold("Configuration:"));
|
|
15951
16074
|
if (Object.keys(config).length === 0) {
|
|
15952
|
-
output.log(` ${
|
|
16075
|
+
output.log(` ${chalk47.gray("(无配置,使用默认值)")}`);
|
|
15953
16076
|
} else {
|
|
15954
16077
|
const flatConfig = flattenConfig(config);
|
|
15955
16078
|
for (const [key, value] of flatConfig) {
|
|
15956
16079
|
const displayValue = formatValue(value);
|
|
15957
|
-
output.log(` ${
|
|
16080
|
+
output.log(` ${chalk47.cyan(key + ":")} ${displayValue}`);
|
|
15958
16081
|
}
|
|
15959
16082
|
}
|
|
15960
16083
|
output.log("");
|
|
@@ -15968,10 +16091,10 @@ async function showAgentComponentConfig(output, configService, options) {
|
|
|
15968
16091
|
const configDir = registry.getConfigDir();
|
|
15969
16092
|
const exists = registry.configDirExists();
|
|
15970
16093
|
const agentCount = registry.list().length;
|
|
15971
|
-
output.log(
|
|
15972
|
-
output.log(` ${
|
|
15973
|
-
output.log(` ${
|
|
15974
|
-
output.log(` ${
|
|
16094
|
+
output.log(chalk47.bold("Agent Config Directory:"));
|
|
16095
|
+
output.log(` ${chalk47.cyan("path:")} ${configDir}`);
|
|
16096
|
+
output.log(` ${chalk47.cyan("exists:")} ${exists ? chalk47.green("yes") : chalk47.red("no")}`);
|
|
16097
|
+
output.log(` ${chalk47.cyan("agents:")} ${agentCount} loaded`);
|
|
15975
16098
|
output.log("");
|
|
15976
16099
|
}
|
|
15977
16100
|
}
|
|
@@ -15987,41 +16110,41 @@ async function showPromptComponentConfig(output, configService, options, envServ
|
|
|
15987
16110
|
});
|
|
15988
16111
|
return;
|
|
15989
16112
|
}
|
|
15990
|
-
output.log(
|
|
16113
|
+
output.log(chalk47.bold.cyan("# Prompt Component Configuration"));
|
|
15991
16114
|
output.log("");
|
|
15992
16115
|
if (filePath) {
|
|
15993
|
-
output.log(
|
|
15994
|
-
output.log(` ${
|
|
16116
|
+
output.log(chalk47.bold("File:"));
|
|
16117
|
+
output.log(` ${chalk47.cyan(filePath)}`);
|
|
15995
16118
|
output.log("");
|
|
15996
16119
|
}
|
|
15997
16120
|
if (!options.sources) {
|
|
15998
|
-
output.log(
|
|
16121
|
+
output.log(chalk47.bold("Configuration:"));
|
|
15999
16122
|
if (Object.keys(config).length === 0) {
|
|
16000
|
-
output.log(` ${
|
|
16123
|
+
output.log(` ${chalk47.gray("(无配置,使用默认值)")}`);
|
|
16001
16124
|
} else {
|
|
16002
16125
|
const flatConfig = flattenConfig(config);
|
|
16003
16126
|
for (const [key, value] of flatConfig) {
|
|
16004
16127
|
const displayValue = formatValue(value);
|
|
16005
|
-
output.log(` ${
|
|
16128
|
+
output.log(` ${chalk47.cyan(key + ":")} ${displayValue}`);
|
|
16006
16129
|
}
|
|
16007
16130
|
}
|
|
16008
16131
|
output.log("");
|
|
16009
16132
|
}
|
|
16010
|
-
output.log(
|
|
16011
|
-
output.log(` ${
|
|
16133
|
+
output.log(chalk47.bold("Prompts:"));
|
|
16134
|
+
output.log(` ${chalk47.gray("- 内置: 5 个(default, coding, review, project-memory, global-memory)")}`);
|
|
16012
16135
|
const promptPaths = config?.promptPaths;
|
|
16013
16136
|
if (promptPaths && Array.isArray(promptPaths) && promptPaths.length > 0) {
|
|
16014
|
-
output.log(` ${
|
|
16137
|
+
output.log(` ${chalk47.gray("- 外部: " + promptPaths.length + " 个路径")}`);
|
|
16015
16138
|
for (const p of promptPaths) {
|
|
16016
|
-
output.log(` ${
|
|
16139
|
+
output.log(` ${chalk47.cyan(p.path)} ${chalk47.gray("(type: " + p.type + ")")}`);
|
|
16017
16140
|
}
|
|
16018
16141
|
} else {
|
|
16019
|
-
output.log(` ${
|
|
16142
|
+
output.log(` ${chalk47.gray("- 外部: 0 个(未配置 promptPaths)")}`);
|
|
16020
16143
|
}
|
|
16021
16144
|
output.log("");
|
|
16022
16145
|
const defaultName = config?.defaultName || "default";
|
|
16023
|
-
output.log(
|
|
16024
|
-
output.log(` ${
|
|
16146
|
+
output.log(chalk47.bold("Default Prompt:"));
|
|
16147
|
+
output.log(` ${chalk47.cyan("defaultName:")} ${defaultName}`);
|
|
16025
16148
|
output.log("");
|
|
16026
16149
|
const env = envService?.getEnvironment?.();
|
|
16027
16150
|
if (env) {
|
|
@@ -16036,10 +16159,10 @@ async function showPromptComponentConfig(output, configService, options, envServ
|
|
|
16036
16159
|
const stored = await store?.loadAll?.();
|
|
16037
16160
|
promptCount = Array.isArray(stored) ? stored.length : 0;
|
|
16038
16161
|
} catch {}
|
|
16039
|
-
output.log(
|
|
16040
|
-
output.log(` ${
|
|
16041
|
-
output.log(` ${
|
|
16042
|
-
output.log(` ${
|
|
16162
|
+
output.log(chalk47.bold("Prompt Storage Directory:"));
|
|
16163
|
+
output.log(` ${chalk47.cyan("path:")} ${configDir}`);
|
|
16164
|
+
output.log(` ${chalk47.cyan("exists:")} ${exists ? chalk47.green("yes") : chalk47.red("no")}`);
|
|
16165
|
+
output.log(` ${chalk47.cyan("prompts:")} ${promptCount} loaded`);
|
|
16043
16166
|
output.log("");
|
|
16044
16167
|
}
|
|
16045
16168
|
}
|
|
@@ -16065,19 +16188,19 @@ function flattenConfig(obj, prefix = "") {
|
|
|
16065
16188
|
}
|
|
16066
16189
|
function formatValue(value) {
|
|
16067
16190
|
if (value === undefined) {
|
|
16068
|
-
return
|
|
16191
|
+
return chalk47.gray("undefined");
|
|
16069
16192
|
}
|
|
16070
16193
|
if (value === null) {
|
|
16071
|
-
return
|
|
16194
|
+
return chalk47.gray("null");
|
|
16072
16195
|
}
|
|
16073
16196
|
if (typeof value === "object") {
|
|
16074
|
-
return
|
|
16197
|
+
return chalk47.gray(JSON.stringify(value));
|
|
16075
16198
|
}
|
|
16076
16199
|
return String(value);
|
|
16077
16200
|
}
|
|
16078
16201
|
|
|
16079
16202
|
// src/commands/config/export.ts
|
|
16080
|
-
import
|
|
16203
|
+
import chalk48 from "chalk";
|
|
16081
16204
|
var ConfigExportCommand = {
|
|
16082
16205
|
command: "export <component>",
|
|
16083
16206
|
describe: "导出组件配置到文件",
|
|
@@ -16122,7 +16245,7 @@ var ConfigExportCommand = {
|
|
|
16122
16245
|
output.log("");
|
|
16123
16246
|
output.log("Supported components:");
|
|
16124
16247
|
for (const comp of SUPPORTED_COMPONENTS) {
|
|
16125
|
-
output.log(` ${
|
|
16248
|
+
output.log(` ${chalk48.cyan(comp)}`);
|
|
16126
16249
|
}
|
|
16127
16250
|
process.exit(1);
|
|
16128
16251
|
}
|
|
@@ -16140,7 +16263,7 @@ var ConfigExportCommand = {
|
|
|
16140
16263
|
};
|
|
16141
16264
|
|
|
16142
16265
|
// src/commands/config/import.ts
|
|
16143
|
-
import
|
|
16266
|
+
import chalk49 from "chalk";
|
|
16144
16267
|
var ConfigImportCommand = {
|
|
16145
16268
|
command: "import <component>",
|
|
16146
16269
|
describe: "从文件导入配置到组件的 file source",
|
|
@@ -16190,7 +16313,7 @@ var ConfigImportCommand = {
|
|
|
16190
16313
|
output.log("");
|
|
16191
16314
|
output.log("Supported components:");
|
|
16192
16315
|
for (const comp of SUPPORTED_COMPONENTS) {
|
|
16193
|
-
output.log(` ${
|
|
16316
|
+
output.log(` ${chalk49.cyan(comp)}`);
|
|
16194
16317
|
}
|
|
16195
16318
|
process.exit(1);
|
|
16196
16319
|
}
|
|
@@ -16205,7 +16328,7 @@ var ConfigImportCommand = {
|
|
|
16205
16328
|
}
|
|
16206
16329
|
if (result.merged && result.changes.length > 0 && args.verbose) {
|
|
16207
16330
|
output.log("");
|
|
16208
|
-
output.log(
|
|
16331
|
+
output.log(chalk49.bold("变更详情:"));
|
|
16209
16332
|
for (const change of result.changes) {
|
|
16210
16333
|
output.log(` ${change.key}: ${JSON.stringify(change.oldValue)} → ${JSON.stringify(change.newValue)}`);
|
|
16211
16334
|
}
|
|
@@ -16229,7 +16352,7 @@ var ConfigCommand = {
|
|
|
16229
16352
|
};
|
|
16230
16353
|
|
|
16231
16354
|
// src/commands/mcp/list.ts
|
|
16232
|
-
import
|
|
16355
|
+
import chalk50 from "chalk";
|
|
16233
16356
|
var ListCommand6 = {
|
|
16234
16357
|
command: "list",
|
|
16235
16358
|
aliases: ["ls"],
|
|
@@ -16289,30 +16412,30 @@ var ListCommand6 = {
|
|
|
16289
16412
|
output.log(hint);
|
|
16290
16413
|
} else {
|
|
16291
16414
|
if (servers.length === 0) {
|
|
16292
|
-
output.log(
|
|
16415
|
+
output.log(chalk50.yellow("No MCP servers configured"));
|
|
16293
16416
|
return;
|
|
16294
16417
|
}
|
|
16295
16418
|
const statusColor = (status) => {
|
|
16296
16419
|
switch (status) {
|
|
16297
16420
|
case "connected":
|
|
16298
|
-
return
|
|
16421
|
+
return chalk50.green;
|
|
16299
16422
|
case "connecting":
|
|
16300
|
-
return
|
|
16423
|
+
return chalk50.yellow;
|
|
16301
16424
|
case "error":
|
|
16302
|
-
return
|
|
16425
|
+
return chalk50.red;
|
|
16303
16426
|
case "disconnected":
|
|
16304
|
-
return
|
|
16427
|
+
return chalk50.gray;
|
|
16305
16428
|
default:
|
|
16306
|
-
return
|
|
16429
|
+
return chalk50.white;
|
|
16307
16430
|
}
|
|
16308
16431
|
};
|
|
16309
16432
|
const header = [
|
|
16310
|
-
|
|
16311
|
-
|
|
16312
|
-
|
|
16433
|
+
chalk50.bold("Name"),
|
|
16434
|
+
chalk50.bold("Status"),
|
|
16435
|
+
chalk50.bold("Tools")
|
|
16313
16436
|
].join(" | ");
|
|
16314
16437
|
const rows = servers.map((s) => [
|
|
16315
|
-
|
|
16438
|
+
chalk50.cyan(s.name),
|
|
16316
16439
|
statusColor(s.status)(`[${s.status}]`),
|
|
16317
16440
|
s.toolsCount !== undefined ? String(s.toolsCount) : "-"
|
|
16318
16441
|
].join(" | "));
|
|
@@ -16343,7 +16466,7 @@ var ListCommand6 = {
|
|
|
16343
16466
|
};
|
|
16344
16467
|
|
|
16345
16468
|
// src/commands/mcp/tools.ts
|
|
16346
|
-
import
|
|
16469
|
+
import chalk51 from "chalk";
|
|
16347
16470
|
var ToolsCommand = {
|
|
16348
16471
|
command: "tools",
|
|
16349
16472
|
aliases: ["t"],
|
|
@@ -16396,7 +16519,7 @@ var ToolsCommand = {
|
|
|
16396
16519
|
tools.forEach((t) => output.log(t.name));
|
|
16397
16520
|
} else {
|
|
16398
16521
|
if (tools.length === 0) {
|
|
16399
|
-
output.log(
|
|
16522
|
+
output.log(chalk51.yellow("No MCP tools available"));
|
|
16400
16523
|
return;
|
|
16401
16524
|
}
|
|
16402
16525
|
const byServer = new Map;
|
|
@@ -16408,15 +16531,15 @@ var ToolsCommand = {
|
|
|
16408
16531
|
byServer.get(serverName).push(tool);
|
|
16409
16532
|
}
|
|
16410
16533
|
for (const [serverName, serverTools] of byServer) {
|
|
16411
|
-
output.log(
|
|
16534
|
+
output.log(chalk51.bold.cyan(`
|
|
16412
16535
|
[${serverName}] ${serverTools.length} tools`));
|
|
16413
16536
|
for (const tool of serverTools) {
|
|
16414
16537
|
const desc2 = tool.description.length > 80 ? tool.description.slice(0, 77) + "..." : tool.description;
|
|
16415
|
-
output.log(` ${
|
|
16416
|
-
output.log(` ${
|
|
16538
|
+
output.log(` ${chalk51.green("+")} ${chalk51.white(tool.name)}`);
|
|
16539
|
+
output.log(` ${chalk51.gray(desc2)}`);
|
|
16417
16540
|
}
|
|
16418
16541
|
}
|
|
16419
|
-
output.log(
|
|
16542
|
+
output.log(chalk51.gray(`
|
|
16420
16543
|
Total: ${tools.length} tools across ${byServer.size} servers`));
|
|
16421
16544
|
}
|
|
16422
16545
|
} catch (error) {
|
|
@@ -16429,7 +16552,7 @@ Total: ${tools.length} tools across ${byServer.size} servers`));
|
|
|
16429
16552
|
};
|
|
16430
16553
|
|
|
16431
16554
|
// src/commands/mcp/reload.ts
|
|
16432
|
-
import
|
|
16555
|
+
import chalk52 from "chalk";
|
|
16433
16556
|
var ReloadCommand2 = {
|
|
16434
16557
|
command: "reload",
|
|
16435
16558
|
aliases: ["r"],
|
|
@@ -16450,19 +16573,19 @@ var ReloadCommand2 = {
|
|
|
16450
16573
|
output.error("McpComponent not available");
|
|
16451
16574
|
process.exit(1);
|
|
16452
16575
|
}
|
|
16453
|
-
output.log(
|
|
16576
|
+
output.log(chalk52.cyan("Reloading MCP servers..."));
|
|
16454
16577
|
await mcpComponent.reload();
|
|
16455
16578
|
const servers = mcpComponent.listServers();
|
|
16456
16579
|
const connected = servers.filter((s) => s.status === "connected").length;
|
|
16457
16580
|
const errors = servers.filter((s) => s.status === "error").length;
|
|
16458
|
-
output.log(
|
|
16581
|
+
output.log(chalk52.green(`✓ Reloaded ${servers.length} servers`));
|
|
16459
16582
|
if (connected > 0) {
|
|
16460
|
-
output.log(
|
|
16583
|
+
output.log(chalk52.green(` • ${connected} connected`));
|
|
16461
16584
|
}
|
|
16462
16585
|
if (errors > 0) {
|
|
16463
16586
|
output.warn(` • ${errors} failed`);
|
|
16464
16587
|
for (const server of servers.filter((s) => s.status === "error")) {
|
|
16465
|
-
output.log(
|
|
16588
|
+
output.log(chalk52.gray(` - ${server.name}: ${server.error}`));
|
|
16466
16589
|
}
|
|
16467
16590
|
}
|
|
16468
16591
|
} catch (error) {
|
|
@@ -16483,7 +16606,7 @@ var McpCommand = {
|
|
|
16483
16606
|
};
|
|
16484
16607
|
|
|
16485
16608
|
// src/commands/tools/list.ts
|
|
16486
|
-
import
|
|
16609
|
+
import chalk53 from "chalk";
|
|
16487
16610
|
var ListCommand7 = {
|
|
16488
16611
|
command: "list",
|
|
16489
16612
|
aliases: ["ls"],
|
|
@@ -16542,16 +16665,16 @@ var ListCommand7 = {
|
|
|
16542
16665
|
output.log(hint);
|
|
16543
16666
|
} else {
|
|
16544
16667
|
const header = [
|
|
16545
|
-
|
|
16546
|
-
|
|
16547
|
-
|
|
16668
|
+
chalk53.bold("Name"),
|
|
16669
|
+
chalk53.bold("Description"),
|
|
16670
|
+
chalk53.bold("Category")
|
|
16548
16671
|
].join(" | ");
|
|
16549
16672
|
const rows = tools.map((t) => {
|
|
16550
16673
|
const desc2 = t.description.length > 40 ? t.description.slice(0, 37) + "..." : t.description;
|
|
16551
16674
|
return [
|
|
16552
|
-
|
|
16675
|
+
chalk53.cyan(t.name),
|
|
16553
16676
|
desc2,
|
|
16554
|
-
t.metadata?.category ?
|
|
16677
|
+
t.metadata?.category ? chalk53.gray(`[${t.metadata.category}]`) : "-"
|
|
16555
16678
|
].join(" | ");
|
|
16556
16679
|
});
|
|
16557
16680
|
output.log([
|
|
@@ -16581,7 +16704,7 @@ var ListCommand7 = {
|
|
|
16581
16704
|
};
|
|
16582
16705
|
|
|
16583
16706
|
// src/commands/tools/get.ts
|
|
16584
|
-
import
|
|
16707
|
+
import chalk54 from "chalk";
|
|
16585
16708
|
|
|
16586
16709
|
// src/commands/tools/shared/schema-helper.ts
|
|
16587
16710
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
@@ -16656,8 +16779,8 @@ var GetCommand6 = {
|
|
|
16656
16779
|
}))
|
|
16657
16780
|
});
|
|
16658
16781
|
} else {
|
|
16659
|
-
output.log(
|
|
16660
|
-
output.log(
|
|
16782
|
+
output.log(chalk54.bold.cyan(`Tool: ${tool.name}`));
|
|
16783
|
+
output.log(chalk54.gray("─".repeat(60)));
|
|
16661
16784
|
output.log(`Description: ${tool.description}`);
|
|
16662
16785
|
if (tool.metadata?.category) {
|
|
16663
16786
|
output.log(`Category: ${tool.metadata.category}`);
|
|
@@ -16666,9 +16789,9 @@ var GetCommand6 = {
|
|
|
16666
16789
|
output.log(`Tags: ${tool.metadata.tags.join(", ")}`);
|
|
16667
16790
|
}
|
|
16668
16791
|
output.log("");
|
|
16669
|
-
output.log(
|
|
16792
|
+
output.log(chalk54.bold("Parameters:"));
|
|
16670
16793
|
for (const param of params) {
|
|
16671
|
-
const required = param.required ?
|
|
16794
|
+
const required = param.required ? chalk54.red("(required)") : chalk54.gray("(optional)");
|
|
16672
16795
|
const defaultVal = param.default !== undefined ? ` [default: ${JSON.stringify(param.default)}]` : "";
|
|
16673
16796
|
output.log(` --${param.name} <${param.type}> ${required}`);
|
|
16674
16797
|
output.log(` ${param.description}${defaultVal}`);
|
|
@@ -16777,14 +16900,14 @@ var ToolsCommand2 = {
|
|
|
16777
16900
|
};
|
|
16778
16901
|
|
|
16779
16902
|
// src/commands/memory/record.ts
|
|
16780
|
-
import
|
|
16903
|
+
import chalk55 from "chalk";
|
|
16781
16904
|
import { createMemoryAgentTools, getBuiltInPrompt } from "@ai-setting/roy-agent-core";
|
|
16782
16905
|
import { bashTool, globTool, readFileTool } from "@ai-setting/roy-agent-core";
|
|
16783
16906
|
async function runExtractMode(output, memoryComponent, agentComponent, sessionComponent, env, options) {
|
|
16784
16907
|
const { scope, sessionId, require: userRequirement } = options;
|
|
16785
|
-
output.log(
|
|
16908
|
+
output.log(chalk55.blue(`
|
|
16786
16909
|
\uD83D\uDD0D Memory Extract Mode (${scope})`));
|
|
16787
|
-
output.log(
|
|
16910
|
+
output.log(chalk55.gray(`正在分析会话历史,生成记忆...
|
|
16788
16911
|
`));
|
|
16789
16912
|
try {
|
|
16790
16913
|
const currentMemory = await memoryComponent.recallMemory(scope) || "(无现有记忆)";
|
|
@@ -16830,13 +16953,13 @@ async function runExtractMode(output, memoryComponent, agentComponent, sessionCo
|
|
|
16830
16953
|
for (const tool of agentTools) {
|
|
16831
16954
|
try {
|
|
16832
16955
|
toolComponent.register(tool);
|
|
16833
|
-
output.log(
|
|
16956
|
+
output.log(chalk55.gray(`Tool registered: ${tool.name}`));
|
|
16834
16957
|
} catch (err) {
|
|
16835
|
-
output.log(
|
|
16958
|
+
output.log(chalk55.gray(`Tool already registered: ${tool.name}`));
|
|
16836
16959
|
}
|
|
16837
16960
|
}
|
|
16838
16961
|
}
|
|
16839
|
-
output.log(
|
|
16962
|
+
output.log(chalk55.gray(`Agent "${agentName}" registered with ${agentTools.length} tools`));
|
|
16840
16963
|
const query = `请分析会话历史,提炼${scope === "project" ? "项目" : "全局"}记忆并写入记忆文件。`;
|
|
16841
16964
|
let result;
|
|
16842
16965
|
try {
|
|
@@ -16850,12 +16973,12 @@ async function runExtractMode(output, memoryComponent, agentComponent, sessionCo
|
|
|
16850
16973
|
if (result && result.startsWith("执行失败")) {
|
|
16851
16974
|
output.error(`提取失败: ${result}`);
|
|
16852
16975
|
} else if (result) {
|
|
16853
|
-
output.log(
|
|
16976
|
+
output.log(chalk55.green(`
|
|
16854
16977
|
✅ 记忆提取完成`));
|
|
16855
|
-
output.log(
|
|
16978
|
+
output.log(chalk55.gray(`记忆已保存到 memory 文件。
|
|
16856
16979
|
`));
|
|
16857
16980
|
if (result.length > 0 && result !== "✅ 记忆提取完成") {
|
|
16858
|
-
output.log(
|
|
16981
|
+
output.log(chalk55.gray(`执行摘要: ${result.substring(0, 200)}${result.length > 200 ? "..." : ""}`));
|
|
16859
16982
|
}
|
|
16860
16983
|
}
|
|
16861
16984
|
agentComponent.unregisterAgent(agentName);
|
|
@@ -16973,11 +17096,11 @@ var RecordCommand = {
|
|
|
16973
17096
|
prepend: "已插入内容到记忆文件开头",
|
|
16974
17097
|
delete: "已删除记忆文件"
|
|
16975
17098
|
};
|
|
16976
|
-
output.log(
|
|
16977
|
-
output.log(
|
|
17099
|
+
output.log(chalk55.green(`✓ ${actionMessages[result.action]}`));
|
|
17100
|
+
output.log(chalk55.gray(`路径: ${result.path}`));
|
|
16978
17101
|
if (result.action !== "delete" && a.content) {
|
|
16979
17102
|
const preview = a.content.substring(0, 100);
|
|
16980
|
-
output.log(
|
|
17103
|
+
output.log(chalk55.gray(`内容预览: ${preview}${a.content.length > 100 ? "..." : ""}`));
|
|
16981
17104
|
}
|
|
16982
17105
|
} catch (error) {
|
|
16983
17106
|
output.error(`Failed to record memory: ${error}`);
|
|
@@ -16989,7 +17112,7 @@ var RecordCommand = {
|
|
|
16989
17112
|
};
|
|
16990
17113
|
|
|
16991
17114
|
// src/commands/memory/recall.ts
|
|
16992
|
-
import
|
|
17115
|
+
import chalk56 from "chalk";
|
|
16993
17116
|
var RecallCommand = {
|
|
16994
17117
|
command: "recall",
|
|
16995
17118
|
aliases: ["load"],
|
|
@@ -17025,7 +17148,7 @@ var RecallCommand = {
|
|
|
17025
17148
|
}
|
|
17026
17149
|
const content = await memoryComponent.recallMemory(a.scope);
|
|
17027
17150
|
if (!content) {
|
|
17028
|
-
output.log(
|
|
17151
|
+
output.log(chalk56.gray("(No memory files found)"));
|
|
17029
17152
|
return;
|
|
17030
17153
|
}
|
|
17031
17154
|
if (a.json) {
|
|
@@ -17051,7 +17174,7 @@ var MemoryCommand = {
|
|
|
17051
17174
|
handler: () => {}
|
|
17052
17175
|
};
|
|
17053
17176
|
// src/commands/eventsource/list.ts
|
|
17054
|
-
import
|
|
17177
|
+
import chalk57 from "chalk";
|
|
17055
17178
|
function truncateVisual2(str, maxWidth) {
|
|
17056
17179
|
let result = "";
|
|
17057
17180
|
let width = 0;
|
|
@@ -17066,7 +17189,7 @@ function truncateVisual2(str, maxWidth) {
|
|
|
17066
17189
|
}
|
|
17067
17190
|
function formatSourcesTable(sources) {
|
|
17068
17191
|
if (sources.length === 0) {
|
|
17069
|
-
return
|
|
17192
|
+
return chalk57.yellow("没有配置的事件源,使用 'roy-agent eventsource add' 添加");
|
|
17070
17193
|
}
|
|
17071
17194
|
const ID_WIDTH = 10;
|
|
17072
17195
|
const NAME_WIDTH = 20;
|
|
@@ -17075,11 +17198,11 @@ function formatSourcesTable(sources) {
|
|
|
17075
17198
|
const ENABLED_WIDTH = 8;
|
|
17076
17199
|
const GAP = " ";
|
|
17077
17200
|
const headerLine = [
|
|
17078
|
-
|
|
17079
|
-
|
|
17080
|
-
|
|
17081
|
-
|
|
17082
|
-
|
|
17201
|
+
chalk57.bold("ID".padEnd(ID_WIDTH)),
|
|
17202
|
+
chalk57.bold("NAME".padEnd(NAME_WIDTH)),
|
|
17203
|
+
chalk57.bold("TYPE".padEnd(TYPE_WIDTH)),
|
|
17204
|
+
chalk57.bold("STATUS".padEnd(STATUS_WIDTH)),
|
|
17205
|
+
chalk57.bold("ENABLED".padEnd(ENABLED_WIDTH))
|
|
17083
17206
|
].join(GAP);
|
|
17084
17207
|
const sepLine = "─".repeat(ID_WIDTH + NAME_WIDTH + TYPE_WIDTH + STATUS_WIDTH + ENABLED_WIDTH + GAP.length * 4);
|
|
17085
17208
|
const formatRow = (src) => {
|
|
@@ -17137,7 +17260,7 @@ var EventSourceListCommand = {
|
|
|
17137
17260
|
sources: []
|
|
17138
17261
|
});
|
|
17139
17262
|
} else {
|
|
17140
|
-
output.log(
|
|
17263
|
+
output.log(chalk57.yellow("没有配置的事件源,使用 'roy-agent eventsource add' 添加"));
|
|
17141
17264
|
}
|
|
17142
17265
|
return;
|
|
17143
17266
|
}
|
|
@@ -17172,21 +17295,21 @@ var EventSourceListCommand = {
|
|
|
17172
17295
|
const rows = sources.map((s) => {
|
|
17173
17296
|
const status = esComponent.getStatus(s.id) || "unknown";
|
|
17174
17297
|
const statusColorMap = {
|
|
17175
|
-
running:
|
|
17176
|
-
stopped:
|
|
17177
|
-
error:
|
|
17178
|
-
starting:
|
|
17179
|
-
created:
|
|
17180
|
-
stopping:
|
|
17181
|
-
unknown:
|
|
17298
|
+
running: chalk57.green,
|
|
17299
|
+
stopped: chalk57.gray,
|
|
17300
|
+
error: chalk57.red,
|
|
17301
|
+
starting: chalk57.yellow,
|
|
17302
|
+
created: chalk57.gray,
|
|
17303
|
+
stopping: chalk57.yellow,
|
|
17304
|
+
unknown: chalk57.gray
|
|
17182
17305
|
};
|
|
17183
|
-
const statusColor = statusColorMap[status] ||
|
|
17306
|
+
const statusColor = statusColorMap[status] || chalk57.gray;
|
|
17184
17307
|
return {
|
|
17185
17308
|
id: s.id.substring(0, 8),
|
|
17186
17309
|
name: s.name,
|
|
17187
17310
|
type: s.type,
|
|
17188
17311
|
status: statusColor(status),
|
|
17189
|
-
enabled: s.enabled ?
|
|
17312
|
+
enabled: s.enabled ? chalk57.green("✓") : chalk57.gray("✗")
|
|
17190
17313
|
};
|
|
17191
17314
|
});
|
|
17192
17315
|
output.log(formatSourcesTable(rows));
|
|
@@ -17208,11 +17331,11 @@ var EventSourceListCommand = {
|
|
|
17208
17331
|
};
|
|
17209
17332
|
|
|
17210
17333
|
// src/commands/eventsource/add.ts
|
|
17211
|
-
import
|
|
17334
|
+
import chalk59 from "chalk";
|
|
17212
17335
|
import { generateId } from "@ai-setting/roy-agent-core";
|
|
17213
17336
|
|
|
17214
17337
|
// src/commands/eventsource/server-url-option.ts
|
|
17215
|
-
import
|
|
17338
|
+
import chalk58 from "chalk";
|
|
17216
17339
|
function addServerUrlOption(yargs) {
|
|
17217
17340
|
return yargs.option("server-url", {
|
|
17218
17341
|
alias: "s",
|
|
@@ -17228,7 +17351,7 @@ function resolveServerUrl(serverUrl, fallback) {
|
|
|
17228
17351
|
return fallback;
|
|
17229
17352
|
const trimmed = serverUrl.replace(/\/+$/, "");
|
|
17230
17353
|
if (!/^(https?|wss?):\/\//.test(trimmed)) {
|
|
17231
|
-
console.error(
|
|
17354
|
+
console.error(chalk58.red(`
|
|
17232
17355
|
✗ Invalid --server-url: "${serverUrl}". Must start with http://, https://, ws://, or wss://
|
|
17233
17356
|
`));
|
|
17234
17357
|
process.exit(1);
|
|
@@ -17321,39 +17444,39 @@ var EventSourceAddCommand = {
|
|
|
17321
17444
|
options: a.prompt ? { prompt: a.prompt } : undefined
|
|
17322
17445
|
};
|
|
17323
17446
|
esComponent.register(config);
|
|
17324
|
-
output.success(
|
|
17447
|
+
output.success(chalk59.green(`事件源 '${a.name}' 添加成功!`));
|
|
17325
17448
|
output.log("");
|
|
17326
|
-
output.log(` ID: ${
|
|
17327
|
-
output.log(` Type: ${
|
|
17449
|
+
output.log(` ID: ${chalk59.gray(config.id)}`);
|
|
17450
|
+
output.log(` Type: ${chalk59.cyan(a.type)}`);
|
|
17328
17451
|
if (eventTypes?.length) {
|
|
17329
|
-
output.log(` Event Types: ${
|
|
17452
|
+
output.log(` Event Types: ${chalk59.gray(eventTypes.join(", "))}`);
|
|
17330
17453
|
}
|
|
17331
17454
|
if (a.command) {
|
|
17332
|
-
output.log(` Command: ${
|
|
17455
|
+
output.log(` Command: ${chalk59.gray(a.command)}`);
|
|
17333
17456
|
}
|
|
17334
17457
|
if (a.interval) {
|
|
17335
|
-
output.log(` Interval: ${
|
|
17458
|
+
output.log(` Interval: ${chalk59.gray(`${a.interval}ms`)}`);
|
|
17336
17459
|
}
|
|
17337
17460
|
if (a.profile) {
|
|
17338
|
-
output.log(` Profile: ${
|
|
17461
|
+
output.log(` Profile: ${chalk59.gray(a.profile)}`);
|
|
17339
17462
|
}
|
|
17340
17463
|
if (a.address) {
|
|
17341
|
-
output.log(` Address: ${
|
|
17464
|
+
output.log(` Address: ${chalk59.gray(a.address)}`);
|
|
17342
17465
|
}
|
|
17343
17466
|
if (a.imServerUrl) {
|
|
17344
|
-
output.log(` IM Server URL: ${
|
|
17467
|
+
output.log(` IM Server URL: ${chalk59.gray(a.imServerUrl)}`);
|
|
17345
17468
|
}
|
|
17346
17469
|
if (resolvedServerUrl) {
|
|
17347
|
-
output.log(` Server URL: ${
|
|
17470
|
+
output.log(` Server URL: ${chalk59.gray(resolvedServerUrl)}`);
|
|
17348
17471
|
}
|
|
17349
17472
|
if (a.tlsSkipVerify) {
|
|
17350
|
-
output.log(` TLS Skip Verify: ${
|
|
17473
|
+
output.log(` TLS Skip Verify: ${chalk59.yellow("⚠ true (自签名场景)")}`);
|
|
17351
17474
|
}
|
|
17352
17475
|
if (a.prompt) {
|
|
17353
|
-
output.log(` Prompt: ${
|
|
17476
|
+
output.log(` Prompt: ${chalk59.gray(a.prompt.length > 60 ? a.prompt.slice(0, 60) + "..." : a.prompt)}`);
|
|
17354
17477
|
}
|
|
17355
17478
|
output.log("");
|
|
17356
|
-
output.log(
|
|
17479
|
+
output.log(chalk59.gray(`使用 'roy-agent eventsource start ${config.id.substring(0, 8)}' 启动它。`));
|
|
17357
17480
|
} finally {
|
|
17358
17481
|
await envService.dispose();
|
|
17359
17482
|
}
|
|
@@ -17361,7 +17484,7 @@ var EventSourceAddCommand = {
|
|
|
17361
17484
|
};
|
|
17362
17485
|
|
|
17363
17486
|
// src/commands/eventsource/update.ts
|
|
17364
|
-
import
|
|
17487
|
+
import chalk60 from "chalk";
|
|
17365
17488
|
function findSource(esComponent, id) {
|
|
17366
17489
|
const sources = esComponent.list();
|
|
17367
17490
|
const matched = sources.find((s) => s.id === id || s.id.startsWith(id));
|
|
@@ -17433,7 +17556,7 @@ var EventSourceUpdateCommand = {
|
|
|
17433
17556
|
const all = esComponent.list();
|
|
17434
17557
|
if (all.length > 0) {
|
|
17435
17558
|
output.info("");
|
|
17436
|
-
output.info(
|
|
17559
|
+
output.info(chalk60.gray("可用的事件源:"));
|
|
17437
17560
|
for (const s of all) {
|
|
17438
17561
|
output.info(` - ${s.id.substring(0, 8)}: ${s.name} (${s.type})`);
|
|
17439
17562
|
}
|
|
@@ -17475,19 +17598,19 @@ var EventSourceUpdateCommand = {
|
|
|
17475
17598
|
}
|
|
17476
17599
|
try {
|
|
17477
17600
|
const result = await esComponent.update(match.fullId, partial);
|
|
17478
|
-
output.success(
|
|
17601
|
+
output.success(chalk60.green(`✅ 事件源已更新: ${match.source.name}`));
|
|
17479
17602
|
output.log("");
|
|
17480
|
-
output.log(
|
|
17603
|
+
output.log(chalk60.bold("修改字段:"));
|
|
17481
17604
|
const before = match.source;
|
|
17482
17605
|
const after = result.updated;
|
|
17483
17606
|
for (const field of result.fields) {
|
|
17484
17607
|
const beforeVal = JSON.stringify(before[field] ?? before.options?.[field]);
|
|
17485
17608
|
const afterVal = JSON.stringify(after[field] ?? after.options?.[field]);
|
|
17486
|
-
output.log(` ${
|
|
17609
|
+
output.log(` ${chalk60.cyan(field)}: ${chalk60.gray(beforeVal)} ${chalk60.gray("→")} ${chalk60.green(afterVal)}`);
|
|
17487
17610
|
}
|
|
17488
17611
|
output.log("");
|
|
17489
17612
|
if (result.wasRunning) {
|
|
17490
|
-
output.info(
|
|
17613
|
+
output.info(chalk60.yellow(`⚠️ 事件源在更新前正在运行,已自动停止。请使用 'roy-agent eventsource start ${match.fullId.substring(0, 8)}' 手动启动以应用新配置。`));
|
|
17491
17614
|
}
|
|
17492
17615
|
} catch (error) {
|
|
17493
17616
|
output.error(`❌ 更新失败: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -17500,7 +17623,7 @@ var EventSourceUpdateCommand = {
|
|
|
17500
17623
|
};
|
|
17501
17624
|
|
|
17502
17625
|
// src/commands/eventsource/remove.ts
|
|
17503
|
-
import
|
|
17626
|
+
import chalk61 from "chalk";
|
|
17504
17627
|
var EventSourceRemoveCommand = {
|
|
17505
17628
|
command: "remove <id>",
|
|
17506
17629
|
aliases: ["rm"],
|
|
@@ -17539,7 +17662,7 @@ var EventSourceRemoveCommand = {
|
|
|
17539
17662
|
const status = esComponent.getStatus(matchedSource.id);
|
|
17540
17663
|
if (status === "running" && !args.force) {
|
|
17541
17664
|
output.error(`事件源正在运行中,请先停止: ${matchedSource.name} (${status})`);
|
|
17542
|
-
output.log(
|
|
17665
|
+
output.log(chalk61.gray(`使用 --force 强制移除或 'roy-agent eventsource stop ${matchedSource.id.substring(0, 8)}' 先停止`));
|
|
17543
17666
|
process.exit(1);
|
|
17544
17667
|
}
|
|
17545
17668
|
if (status === "running") {
|
|
@@ -17548,7 +17671,7 @@ var EventSourceRemoveCommand = {
|
|
|
17548
17671
|
}
|
|
17549
17672
|
const result = esComponent.unregister(matchedSource.id);
|
|
17550
17673
|
if (result) {
|
|
17551
|
-
output.success(
|
|
17674
|
+
output.success(chalk61.green(`事件源已移除: ${matchedSource.name}`));
|
|
17552
17675
|
} else {
|
|
17553
17676
|
output.error("移除失败");
|
|
17554
17677
|
process.exit(1);
|
|
@@ -17560,7 +17683,7 @@ var EventSourceRemoveCommand = {
|
|
|
17560
17683
|
};
|
|
17561
17684
|
|
|
17562
17685
|
// src/commands/eventsource/start.ts
|
|
17563
|
-
import
|
|
17686
|
+
import chalk62 from "chalk";
|
|
17564
17687
|
var EventSourceStartCommand = {
|
|
17565
17688
|
command: "start <id>",
|
|
17566
17689
|
describe: "启动指定的事件源",
|
|
@@ -17597,15 +17720,15 @@ var EventSourceStartCommand = {
|
|
|
17597
17720
|
}
|
|
17598
17721
|
const status = esComponent.getStatus(matchedSource.id);
|
|
17599
17722
|
if (status === "running") {
|
|
17600
|
-
output.log(
|
|
17723
|
+
output.log(chalk62.yellow(`事件源已在运行: ${matchedSource.name}`));
|
|
17601
17724
|
return;
|
|
17602
17725
|
}
|
|
17603
17726
|
output.info(`正在启动事件源 '${matchedSource.name}'...`);
|
|
17604
17727
|
try {
|
|
17605
17728
|
await esComponent.startSource(matchedSource.id);
|
|
17606
|
-
output.success(
|
|
17729
|
+
output.success(chalk62.green(`事件源已启动: ${matchedSource.name}`));
|
|
17607
17730
|
if (!args.background) {
|
|
17608
|
-
output.log(
|
|
17731
|
+
output.log(chalk62.gray("按 Ctrl+C 停止..."));
|
|
17609
17732
|
await new Promise((resolve) => {
|
|
17610
17733
|
const cleanup = () => {
|
|
17611
17734
|
process.removeListener("SIGINT", cleanup);
|
|
@@ -17627,7 +17750,7 @@ var EventSourceStartCommand = {
|
|
|
17627
17750
|
};
|
|
17628
17751
|
|
|
17629
17752
|
// src/commands/eventsource/stop.ts
|
|
17630
|
-
import
|
|
17753
|
+
import chalk63 from "chalk";
|
|
17631
17754
|
var EventSourceStopCommand = {
|
|
17632
17755
|
command: "stop <id>",
|
|
17633
17756
|
aliases: ["kill"],
|
|
@@ -17665,13 +17788,13 @@ var EventSourceStopCommand = {
|
|
|
17665
17788
|
}
|
|
17666
17789
|
const status = esComponent.getStatus(matchedSource.id);
|
|
17667
17790
|
if (status !== "running") {
|
|
17668
|
-
output.log(
|
|
17791
|
+
output.log(chalk63.yellow(`事件源未运行: ${matchedSource.name} (${status || "unknown"})`));
|
|
17669
17792
|
return;
|
|
17670
17793
|
}
|
|
17671
17794
|
output.info(`正在停止事件源 '${matchedSource.name}'...`);
|
|
17672
17795
|
try {
|
|
17673
17796
|
await esComponent.stopSource(matchedSource.id);
|
|
17674
|
-
output.success(
|
|
17797
|
+
output.success(chalk63.green(`事件源已停止: ${matchedSource.name}`));
|
|
17675
17798
|
} catch (error) {
|
|
17676
17799
|
output.error(`停止失败: ${error}`);
|
|
17677
17800
|
process.exit(1);
|
|
@@ -17683,14 +17806,14 @@ var EventSourceStopCommand = {
|
|
|
17683
17806
|
};
|
|
17684
17807
|
|
|
17685
17808
|
// src/commands/eventsource/status.ts
|
|
17686
|
-
import
|
|
17809
|
+
import chalk64 from "chalk";
|
|
17687
17810
|
var STATUS_COLORS = {
|
|
17688
|
-
created:
|
|
17689
|
-
starting:
|
|
17690
|
-
running:
|
|
17691
|
-
stopping:
|
|
17692
|
-
stopped:
|
|
17693
|
-
error:
|
|
17811
|
+
created: chalk64.gray,
|
|
17812
|
+
starting: chalk64.yellow,
|
|
17813
|
+
running: chalk64.green,
|
|
17814
|
+
stopping: chalk64.yellow,
|
|
17815
|
+
stopped: chalk64.gray,
|
|
17816
|
+
error: chalk64.red
|
|
17694
17817
|
};
|
|
17695
17818
|
var STATUS_ICONS = {
|
|
17696
17819
|
created: "○",
|
|
@@ -17744,7 +17867,7 @@ var EventSourceStatusCommand = {
|
|
|
17744
17867
|
process.exit(1);
|
|
17745
17868
|
}
|
|
17746
17869
|
const status = esComponent.getStatus(matchedSource.id) || "unknown";
|
|
17747
|
-
const statusColor = STATUS_COLORS[status] ||
|
|
17870
|
+
const statusColor = STATUS_COLORS[status] || chalk64.gray;
|
|
17748
17871
|
if (args.json) {
|
|
17749
17872
|
output.json({
|
|
17750
17873
|
id: matchedSource.id,
|
|
@@ -17761,31 +17884,31 @@ var EventSourceStatusCommand = {
|
|
|
17761
17884
|
});
|
|
17762
17885
|
return;
|
|
17763
17886
|
}
|
|
17764
|
-
output.log(
|
|
17887
|
+
output.log(chalk64.bold("事件源详情"));
|
|
17765
17888
|
output.log("─".repeat(50));
|
|
17766
|
-
output.log(` ID: ${
|
|
17767
|
-
output.log(` Name: ${
|
|
17768
|
-
output.log(` Type: ${
|
|
17889
|
+
output.log(` ID: ${chalk64.gray(matchedSource.id)}`);
|
|
17890
|
+
output.log(` Name: ${chalk64.cyan(matchedSource.name)}`);
|
|
17891
|
+
output.log(` Type: ${chalk64.cyan(matchedSource.type)}`);
|
|
17769
17892
|
output.log(` Status: ${statusColor(`${STATUS_ICONS[status]} ${STATUS_LABELS[status]}`)}`);
|
|
17770
|
-
output.log(` Enabled: ${matchedSource.enabled ?
|
|
17893
|
+
output.log(` Enabled: ${matchedSource.enabled ? chalk64.green("是") : chalk64.gray("否")}`);
|
|
17771
17894
|
if (matchedSource.eventTypes?.length) {
|
|
17772
|
-
output.log(` Events: ${
|
|
17895
|
+
output.log(` Events: ${chalk64.gray(matchedSource.eventTypes.join(", "))}`);
|
|
17773
17896
|
}
|
|
17774
17897
|
if (matchedSource.command) {
|
|
17775
|
-
output.log(` Command: ${
|
|
17898
|
+
output.log(` Command: ${chalk64.gray(matchedSource.command)}`);
|
|
17776
17899
|
}
|
|
17777
17900
|
if (matchedSource.interval) {
|
|
17778
|
-
output.log(` Interval: ${
|
|
17901
|
+
output.log(` Interval: ${chalk64.gray(`${matchedSource.interval}ms`)}`);
|
|
17779
17902
|
}
|
|
17780
17903
|
if (matchedSource.url) {
|
|
17781
|
-
output.log(` URL: ${
|
|
17904
|
+
output.log(` URL: ${chalk64.gray(matchedSource.url)}`);
|
|
17782
17905
|
}
|
|
17783
17906
|
output.log("");
|
|
17784
17907
|
return;
|
|
17785
17908
|
}
|
|
17786
17909
|
const sources = esComponent.list();
|
|
17787
17910
|
if (sources.length === 0) {
|
|
17788
|
-
output.log(
|
|
17911
|
+
output.log(chalk64.yellow("没有配置的事件源"));
|
|
17789
17912
|
return;
|
|
17790
17913
|
}
|
|
17791
17914
|
if (args.json) {
|
|
@@ -17799,21 +17922,21 @@ var EventSourceStatusCommand = {
|
|
|
17799
17922
|
output.json({ sources: sourcesWithStatus, count: sources.length });
|
|
17800
17923
|
return;
|
|
17801
17924
|
}
|
|
17802
|
-
output.log(
|
|
17925
|
+
output.log(chalk64.bold("事件源状态概览"));
|
|
17803
17926
|
output.log("─".repeat(60));
|
|
17804
17927
|
for (const source of sources) {
|
|
17805
17928
|
const status = esComponent.getStatus(source.id) || "unknown";
|
|
17806
|
-
const statusColor = STATUS_COLORS[status] ||
|
|
17929
|
+
const statusColor = STATUS_COLORS[status] || chalk64.gray;
|
|
17807
17930
|
const icon = STATUS_ICONS[status] || "?";
|
|
17808
17931
|
const label = STATUS_LABELS[status] || status;
|
|
17809
17932
|
output.log("");
|
|
17810
|
-
output.log(` ${
|
|
17933
|
+
output.log(` ${chalk64.cyan(source.name)} ${chalk64.gray(`(${source.type})`)}`);
|
|
17811
17934
|
output.log(` └─ Status: ${statusColor(`${icon} ${label}`)}`);
|
|
17812
|
-
output.log(` ID: ${
|
|
17935
|
+
output.log(` ID: ${chalk64.gray(source.id.substring(0, 8))}...`);
|
|
17813
17936
|
}
|
|
17814
17937
|
output.log("");
|
|
17815
17938
|
const runningCount = sources.filter((s) => esComponent.getStatus(s.id) === "running").length;
|
|
17816
|
-
output.log(
|
|
17939
|
+
output.log(chalk64.green(`✅ ${runningCount}/${sources.length} 运行中`));
|
|
17817
17940
|
} finally {
|
|
17818
17941
|
await envService.dispose();
|
|
17819
17942
|
}
|
|
@@ -18126,7 +18249,7 @@ var DebugCommand = {
|
|
|
18126
18249
|
};
|
|
18127
18250
|
|
|
18128
18251
|
// src/commands/workflow/renderers.ts
|
|
18129
|
-
import
|
|
18252
|
+
import chalk65 from "chalk";
|
|
18130
18253
|
function truncateVisual3(str, maxWidth) {
|
|
18131
18254
|
if (!str)
|
|
18132
18255
|
return "-";
|
|
@@ -18161,18 +18284,18 @@ function formatDuration(ms) {
|
|
|
18161
18284
|
function statusColor(status) {
|
|
18162
18285
|
switch (status) {
|
|
18163
18286
|
case "completed":
|
|
18164
|
-
return
|
|
18287
|
+
return chalk65.green;
|
|
18165
18288
|
case "running":
|
|
18166
18289
|
case "idle":
|
|
18167
|
-
return
|
|
18290
|
+
return chalk65.blue;
|
|
18168
18291
|
case "paused":
|
|
18169
|
-
return
|
|
18292
|
+
return chalk65.yellow;
|
|
18170
18293
|
case "failed":
|
|
18171
|
-
return
|
|
18294
|
+
return chalk65.red;
|
|
18172
18295
|
case "stopped":
|
|
18173
|
-
return
|
|
18296
|
+
return chalk65.gray;
|
|
18174
18297
|
default:
|
|
18175
|
-
return
|
|
18298
|
+
return chalk65.white;
|
|
18176
18299
|
}
|
|
18177
18300
|
}
|
|
18178
18301
|
function renderWorkflowList(workflows, options) {
|
|
@@ -18191,7 +18314,7 @@ function renderWorkflowList(workflows, options) {
|
|
|
18191
18314
|
}, null, 2);
|
|
18192
18315
|
}
|
|
18193
18316
|
if (workflows.length === 0) {
|
|
18194
|
-
return
|
|
18317
|
+
return chalk65.yellow("No workflows found");
|
|
18195
18318
|
}
|
|
18196
18319
|
const NAME_WIDTH = 30;
|
|
18197
18320
|
const VERSION_WIDTH = 10;
|
|
@@ -18199,10 +18322,10 @@ function renderWorkflowList(workflows, options) {
|
|
|
18199
18322
|
const UPDATED_WIDTH = 20;
|
|
18200
18323
|
const GAP = " ";
|
|
18201
18324
|
const headerLine = [
|
|
18202
|
-
|
|
18203
|
-
|
|
18204
|
-
|
|
18205
|
-
|
|
18325
|
+
chalk65.bold("NAME".padEnd(NAME_WIDTH)),
|
|
18326
|
+
chalk65.bold("VER".padEnd(VERSION_WIDTH)),
|
|
18327
|
+
chalk65.bold("TAGS".padEnd(TAGS_WIDTH)),
|
|
18328
|
+
chalk65.bold("UPDATED")
|
|
18206
18329
|
].join(GAP);
|
|
18207
18330
|
const sepLine = "─".repeat(NAME_WIDTH + VERSION_WIDTH + TAGS_WIDTH + UPDATED_WIDTH + GAP.length * 3);
|
|
18208
18331
|
const rows = workflows.map((w) => {
|
|
@@ -18217,18 +18340,18 @@ function renderWorkflowList(workflows, options) {
|
|
|
18217
18340
|
}
|
|
18218
18341
|
function renderWorkflowDetail(workflow, options) {
|
|
18219
18342
|
const lines = [];
|
|
18220
|
-
lines.push(
|
|
18343
|
+
lines.push(chalk65.bold(`
|
|
18221
18344
|
\uD83D\uDCCB Workflow Details
|
|
18222
18345
|
`));
|
|
18223
|
-
lines.push(` ${
|
|
18224
|
-
lines.push(` ${
|
|
18225
|
-
lines.push(` ${
|
|
18226
|
-
lines.push(` ${
|
|
18227
|
-
lines.push(` ${
|
|
18228
|
-
lines.push(` ${
|
|
18229
|
-
lines.push(` ${
|
|
18346
|
+
lines.push(` ${chalk65.cyan("ID:")} ${workflow.id}`);
|
|
18347
|
+
lines.push(` ${chalk65.cyan("Name:")} ${workflow.name}`);
|
|
18348
|
+
lines.push(` ${chalk65.cyan("Version:")} ${workflow.version}`);
|
|
18349
|
+
lines.push(` ${chalk65.cyan("Description:")} ${workflow.description || "-"}`);
|
|
18350
|
+
lines.push(` ${chalk65.cyan("Tags:")} ${workflow.tags.join(", ") || "-"}`);
|
|
18351
|
+
lines.push(` ${chalk65.cyan("Created:")} ${formatDate(workflow.createdAt)}`);
|
|
18352
|
+
lines.push(` ${chalk65.cyan("Updated:")} ${formatDate(workflow.updatedAt)}`);
|
|
18230
18353
|
const nodeCount = workflow.definition.nodes.length;
|
|
18231
|
-
lines.push(
|
|
18354
|
+
lines.push(chalk65.bold(`
|
|
18232
18355
|
\uD83D\uDCCA Nodes Summary
|
|
18233
18356
|
`));
|
|
18234
18357
|
lines.push(` Total: ${nodeCount} nodes`);
|
|
@@ -18240,7 +18363,7 @@ function renderWorkflowDetail(workflow, options) {
|
|
|
18240
18363
|
lines.push(` - ${type}: ${count}`);
|
|
18241
18364
|
}
|
|
18242
18365
|
if (workflow.definition.config) {
|
|
18243
|
-
lines.push(
|
|
18366
|
+
lines.push(chalk65.bold(`
|
|
18244
18367
|
⚙️ Configuration
|
|
18245
18368
|
`));
|
|
18246
18369
|
if (workflow.definition.config.parallel_limit !== undefined) {
|
|
@@ -18254,7 +18377,7 @@ function renderWorkflowDetail(workflow, options) {
|
|
|
18254
18377
|
}
|
|
18255
18378
|
}
|
|
18256
18379
|
if (options?.includeRuns && options.includeRuns.length > 0) {
|
|
18257
|
-
lines.push(
|
|
18380
|
+
lines.push(chalk65.bold(`
|
|
18258
18381
|
\uD83D\uDCDC Recent Runs
|
|
18259
18382
|
`));
|
|
18260
18383
|
lines.push(renderRunsList(options.includeRuns.slice(0, 5)));
|
|
@@ -18278,7 +18401,7 @@ function renderRunsList(runs, options) {
|
|
|
18278
18401
|
}, null, 2);
|
|
18279
18402
|
}
|
|
18280
18403
|
if (runs.length === 0) {
|
|
18281
|
-
return
|
|
18404
|
+
return chalk65.yellow("No runs found");
|
|
18282
18405
|
}
|
|
18283
18406
|
const ID_WIDTH = 20;
|
|
18284
18407
|
const STATUS_WIDTH = 12;
|
|
@@ -18286,10 +18409,10 @@ function renderRunsList(runs, options) {
|
|
|
18286
18409
|
const UPDATED_WIDTH = 20;
|
|
18287
18410
|
const GAP = " ";
|
|
18288
18411
|
const headerLine = [
|
|
18289
|
-
|
|
18290
|
-
|
|
18291
|
-
|
|
18292
|
-
|
|
18412
|
+
chalk65.bold("RUN ID".padEnd(ID_WIDTH)),
|
|
18413
|
+
chalk65.bold("STATUS".padEnd(STATUS_WIDTH)),
|
|
18414
|
+
chalk65.bold("DURATION".padEnd(DURATION_WIDTH)),
|
|
18415
|
+
chalk65.bold("STARTED")
|
|
18293
18416
|
].join(GAP);
|
|
18294
18417
|
const sepLine = "─".repeat(ID_WIDTH + STATUS_WIDTH + DURATION_WIDTH + UPDATED_WIDTH + GAP.length * 3);
|
|
18295
18418
|
const rows = runs.map((r) => {
|
|
@@ -18304,34 +18427,34 @@ function renderRunsList(runs, options) {
|
|
|
18304
18427
|
}
|
|
18305
18428
|
function renderRunDetail(run) {
|
|
18306
18429
|
const lines = [];
|
|
18307
|
-
lines.push(
|
|
18430
|
+
lines.push(chalk65.bold(`
|
|
18308
18431
|
\uD83C\uDFC3 Run Details
|
|
18309
18432
|
`));
|
|
18310
|
-
lines.push(` ${
|
|
18311
|
-
lines.push(` ${
|
|
18312
|
-
lines.push(` ${
|
|
18313
|
-
lines.push(` ${
|
|
18433
|
+
lines.push(` ${chalk65.cyan("Run ID:")} ${run.id}`);
|
|
18434
|
+
lines.push(` ${chalk65.cyan("Workflow:")} ${run.workflowId}`);
|
|
18435
|
+
lines.push(` ${chalk65.cyan("Status:")} ${statusColor(run.status)(run.status)}`);
|
|
18436
|
+
lines.push(` ${chalk65.cyan("Started:")} ${formatDate(run.startedAt)}`);
|
|
18314
18437
|
if (run.pausedAt) {
|
|
18315
|
-
lines.push(` ${
|
|
18438
|
+
lines.push(` ${chalk65.cyan("Paused:")} ${formatDate(run.pausedAt)}`);
|
|
18316
18439
|
}
|
|
18317
18440
|
if (run.resumedAt) {
|
|
18318
|
-
lines.push(` ${
|
|
18441
|
+
lines.push(` ${chalk65.cyan("Resumed:")} ${formatDate(run.resumedAt)}`);
|
|
18319
18442
|
}
|
|
18320
18443
|
if (run.stoppedAt) {
|
|
18321
|
-
lines.push(` ${
|
|
18444
|
+
lines.push(` ${chalk65.cyan("Stopped:")} ${formatDate(run.stoppedAt)}`);
|
|
18322
18445
|
}
|
|
18323
18446
|
if (run.completedAt) {
|
|
18324
|
-
lines.push(` ${
|
|
18447
|
+
lines.push(` ${chalk65.cyan("Completed:")} ${formatDate(run.completedAt)}`);
|
|
18325
18448
|
}
|
|
18326
|
-
lines.push(` ${
|
|
18449
|
+
lines.push(` ${chalk65.cyan("Duration:")} ${formatDuration(run.durationMs)}`);
|
|
18327
18450
|
if (run.error) {
|
|
18328
|
-
lines.push(
|
|
18451
|
+
lines.push(chalk65.bold(`
|
|
18329
18452
|
❌ Error
|
|
18330
18453
|
`));
|
|
18331
|
-
lines.push(` ${
|
|
18454
|
+
lines.push(` ${chalk65.red(run.error)}`);
|
|
18332
18455
|
}
|
|
18333
18456
|
if (run.output) {
|
|
18334
|
-
lines.push(
|
|
18457
|
+
lines.push(chalk65.bold(`
|
|
18335
18458
|
\uD83D\uDCE4 Output
|
|
18336
18459
|
`));
|
|
18337
18460
|
lines.push(" " + JSON.stringify(run.output, null, 2).split(`
|
|
@@ -18342,36 +18465,36 @@ function renderRunDetail(run) {
|
|
|
18342
18465
|
`);
|
|
18343
18466
|
}
|
|
18344
18467
|
function renderWorkflowAdded(workflow) {
|
|
18345
|
-
return
|
|
18468
|
+
return chalk65.green(`
|
|
18346
18469
|
✅ Workflow '${workflow.name}' added successfully
|
|
18347
18470
|
`) + ` ID: ${workflow.id}
|
|
18348
18471
|
` + ` Version: ${workflow.version}
|
|
18349
18472
|
`;
|
|
18350
18473
|
}
|
|
18351
18474
|
function renderWorkflowUpdated(workflow) {
|
|
18352
|
-
return
|
|
18475
|
+
return chalk65.green(`
|
|
18353
18476
|
✅ Workflow '${workflow.name}' updated successfully
|
|
18354
18477
|
`) + ` ID: ${workflow.id}
|
|
18355
18478
|
`;
|
|
18356
18479
|
}
|
|
18357
18480
|
function renderWorkflowDeleted(name) {
|
|
18358
|
-
return
|
|
18481
|
+
return chalk65.green(`
|
|
18359
18482
|
✅ Workflow '${name}' deleted successfully
|
|
18360
18483
|
`);
|
|
18361
18484
|
}
|
|
18362
18485
|
function renderRunResult(result) {
|
|
18363
18486
|
const lines = [];
|
|
18364
18487
|
if (result.status === "completed") {
|
|
18365
|
-
lines.push(
|
|
18488
|
+
lines.push(chalk65.green(`
|
|
18366
18489
|
✅ Workflow completed successfully`));
|
|
18367
18490
|
} else if (result.status === "failed") {
|
|
18368
|
-
lines.push(
|
|
18491
|
+
lines.push(chalk65.red(`
|
|
18369
18492
|
❌ Workflow failed`));
|
|
18370
18493
|
} else if (result.status === "stopped") {
|
|
18371
|
-
lines.push(
|
|
18494
|
+
lines.push(chalk65.yellow(`
|
|
18372
18495
|
⚠️ Workflow stopped`));
|
|
18373
18496
|
} else {
|
|
18374
|
-
lines.push(
|
|
18497
|
+
lines.push(chalk65.blue(`
|
|
18375
18498
|
\uD83D\uDD04 Workflow ${result.status}`));
|
|
18376
18499
|
}
|
|
18377
18500
|
lines.push(` Run ID: ${result.runId}`);
|
|
@@ -18379,11 +18502,11 @@ function renderRunResult(result) {
|
|
|
18379
18502
|
lines.push(` Duration: ${formatDuration(result.durationMs)}`);
|
|
18380
18503
|
}
|
|
18381
18504
|
if (result.error) {
|
|
18382
|
-
lines.push(
|
|
18505
|
+
lines.push(chalk65.red(`
|
|
18383
18506
|
Error: ${result.error}`));
|
|
18384
18507
|
}
|
|
18385
18508
|
if (result.output) {
|
|
18386
|
-
lines.push(
|
|
18509
|
+
lines.push(chalk65.bold(`
|
|
18387
18510
|
\uD83D\uDCE4 Output:`));
|
|
18388
18511
|
lines.push(JSON.stringify(result.output, null, 2));
|
|
18389
18512
|
}
|
|
@@ -18397,10 +18520,10 @@ function renderNodesList(nodes) {
|
|
|
18397
18520
|
const DEPS_WIDTH = 20;
|
|
18398
18521
|
const GAP = " ";
|
|
18399
18522
|
const headerLine = [
|
|
18400
|
-
|
|
18401
|
-
|
|
18402
|
-
|
|
18403
|
-
|
|
18523
|
+
chalk65.bold("NODE ID".padEnd(ID_WIDTH)),
|
|
18524
|
+
chalk65.bold("TYPE".padEnd(TYPE_WIDTH)),
|
|
18525
|
+
chalk65.bold("NAME".padEnd(NAME_WIDTH)),
|
|
18526
|
+
chalk65.bold("DEPENDS ON")
|
|
18404
18527
|
].join(GAP);
|
|
18405
18528
|
const sepLine = "─".repeat(ID_WIDTH + TYPE_WIDTH + NAME_WIDTH + DEPS_WIDTH + GAP.length * 3);
|
|
18406
18529
|
const rows = nodes.map((n) => {
|
|
@@ -18415,7 +18538,7 @@ function renderNodesList(nodes) {
|
|
|
18415
18538
|
}
|
|
18416
18539
|
|
|
18417
18540
|
// src/commands/workflow/commands/list.ts
|
|
18418
|
-
import
|
|
18541
|
+
import chalk66 from "chalk";
|
|
18419
18542
|
import { createWorkflowListTool } from "@ai-setting/roy-agent-core/env/workflow/tools";
|
|
18420
18543
|
function buildListWorkflowsJson(workflows, total, args, availableTags) {
|
|
18421
18544
|
const output = {
|
|
@@ -18575,20 +18698,20 @@ var WorkflowListCommand = {
|
|
|
18575
18698
|
if (total > workflows.length) {
|
|
18576
18699
|
const start = finalOffset + 1;
|
|
18577
18700
|
const end = finalOffset + workflows.length;
|
|
18578
|
-
output.log(
|
|
18701
|
+
output.log(chalk66.green(`
|
|
18579
18702
|
✅ 显示 ${start}-${end} / 共 ${total} 个 Workflow`));
|
|
18580
18703
|
const totalPages = Math.ceil(total / pageSize);
|
|
18581
18704
|
const currentPage = Math.floor(finalOffset / pageSize) + 1;
|
|
18582
18705
|
if (totalPages > 1) {
|
|
18583
|
-
output.log(
|
|
18706
|
+
output.log(chalk66.cyan(`\uD83D\uDCC4 第 ${currentPage} / ${totalPages} 页`));
|
|
18584
18707
|
}
|
|
18585
18708
|
} else {
|
|
18586
|
-
output.log(
|
|
18709
|
+
output.log(chalk66.green(`
|
|
18587
18710
|
✅ 共 ${total} 个 Workflow`));
|
|
18588
18711
|
}
|
|
18589
18712
|
if (availableTags.length > 0) {
|
|
18590
18713
|
const tagsLine = availableTags.map((t) => `${t.name}(${t.count})`).join(", ");
|
|
18591
|
-
output.log(
|
|
18714
|
+
output.log(chalk66.cyan(`
|
|
18592
18715
|
\uD83C\uDFF7️ Available tags: ${tagsLine}`));
|
|
18593
18716
|
}
|
|
18594
18717
|
}
|
|
@@ -19192,7 +19315,7 @@ class WorkflowValidator {
|
|
|
19192
19315
|
|
|
19193
19316
|
// src/commands/workflow/commands/add.ts
|
|
19194
19317
|
import { validateWorkflowDefinition } from "@ai-setting/roy-agent-core/env/workflow/utils";
|
|
19195
|
-
import
|
|
19318
|
+
import chalk67 from "chalk";
|
|
19196
19319
|
import fs3 from "fs";
|
|
19197
19320
|
import path6 from "path";
|
|
19198
19321
|
async function parseWorkflowContent(content, filename) {
|
|
@@ -19334,7 +19457,7 @@ var WorkflowAddCommand = {
|
|
|
19334
19457
|
definition = await parseWorkflowContent(content, filePath);
|
|
19335
19458
|
workflowName = a.name || definition.name || path6.basename(filePath);
|
|
19336
19459
|
if (a.validate) {
|
|
19337
|
-
output.log(
|
|
19460
|
+
output.log(chalk67.blue("\uD83D\uDD0D Validating workflow..."));
|
|
19338
19461
|
const dagResult = validateWorkflowDefinition(definition);
|
|
19339
19462
|
if (!dagResult.valid) {
|
|
19340
19463
|
output.error(`
|
|
@@ -19358,11 +19481,11 @@ var WorkflowAddCommand = {
|
|
|
19358
19481
|
});
|
|
19359
19482
|
process.exit(1);
|
|
19360
19483
|
}
|
|
19361
|
-
output.log(
|
|
19484
|
+
output.log(chalk67.green(`✅ Workflow validation passed
|
|
19362
19485
|
`));
|
|
19363
19486
|
}
|
|
19364
19487
|
} else if (a.desc) {
|
|
19365
|
-
output.log(
|
|
19488
|
+
output.log(chalk67.blue(`\uD83E\uDD16 Generating workflow from description...
|
|
19366
19489
|
`));
|
|
19367
19490
|
const agentComponent = env.getComponent("agent");
|
|
19368
19491
|
if (!agentComponent) {
|
|
@@ -19384,20 +19507,20 @@ ${a.desc}
|
|
|
19384
19507
|
1. 先用 \`roy-agent workflow nodes\` 查看可用的节点类型
|
|
19385
19508
|
2. 生成的 YAML 必须通过 \`roy-agent workflow validate --yaml "<yaml>"\` 验证
|
|
19386
19509
|
3. 验证通过后才输出最终 YAML`;
|
|
19387
|
-
output.log(
|
|
19510
|
+
output.log(chalk67.gray("Running workflow-extract agent..."));
|
|
19388
19511
|
const result = await agentComponent.run("workflow-extract", prompt);
|
|
19389
19512
|
const agentOutput = result.finalText || "";
|
|
19390
19513
|
definition = parseYamlFromAgentOutput(agentOutput);
|
|
19391
19514
|
if (definition === null) {
|
|
19392
19515
|
output.error("Failed to parse workflow from agent output");
|
|
19393
|
-
output.log(
|
|
19516
|
+
output.log(chalk67.gray(`
|
|
19394
19517
|
Agent output:
|
|
19395
19518
|
` + agentOutput.slice(0, 500)));
|
|
19396
19519
|
process.exit(1);
|
|
19397
19520
|
}
|
|
19398
19521
|
workflowName = a.name || definition.name;
|
|
19399
19522
|
if (a.validate) {
|
|
19400
|
-
output.log(
|
|
19523
|
+
output.log(chalk67.blue(`
|
|
19401
19524
|
\uD83D\uDD0D Validating generated workflow...`));
|
|
19402
19525
|
const dagResult = validateWorkflowDefinition(definition);
|
|
19403
19526
|
if (!dagResult.valid) {
|
|
@@ -19406,7 +19529,7 @@ Agent output:
|
|
|
19406
19529
|
dagResult.errors.forEach((msg, i) => {
|
|
19407
19530
|
output.error(`[Error ${i + 1}/${dagResult.errors.length}] ${msg}`);
|
|
19408
19531
|
});
|
|
19409
|
-
output.log(
|
|
19532
|
+
output.log(chalk67.yellow("请修正描述后重新尝试,或使用 --file 选项直接提供 YAML"));
|
|
19410
19533
|
process.exit(1);
|
|
19411
19534
|
}
|
|
19412
19535
|
const validator = new WorkflowValidator;
|
|
@@ -19421,16 +19544,16 @@ Agent output:
|
|
|
19421
19544
|
output.error(` Fix: ${error.fix}
|
|
19422
19545
|
`);
|
|
19423
19546
|
});
|
|
19424
|
-
output.log(
|
|
19547
|
+
output.log(chalk67.yellow("请修正描述后重新尝试,或使用 --file 选项直接提供 YAML"));
|
|
19425
19548
|
process.exit(1);
|
|
19426
19549
|
}
|
|
19427
|
-
output.log(
|
|
19550
|
+
output.log(chalk67.green(`✅ Generated workflow validation passed
|
|
19428
19551
|
`));
|
|
19429
19552
|
}
|
|
19430
19553
|
const yaml = await Promise.resolve().then(() => __toESM(require_dist(), 1));
|
|
19431
|
-
output.log(
|
|
19554
|
+
output.log(chalk67.gray("--- Generated YAML ---"));
|
|
19432
19555
|
output.log(yaml.stringify(definition));
|
|
19433
|
-
output.log(
|
|
19556
|
+
output.log(chalk67.gray(`------------------------
|
|
19434
19557
|
`));
|
|
19435
19558
|
} else {
|
|
19436
19559
|
output.error("Please provide --file or --desc option");
|
|
@@ -19456,10 +19579,10 @@ Agent output:
|
|
|
19456
19579
|
force: a.force
|
|
19457
19580
|
});
|
|
19458
19581
|
output.log(renderWorkflowAdded(workflow));
|
|
19459
|
-
output.log(
|
|
19582
|
+
output.log(chalk67.bold(`
|
|
19460
19583
|
\uD83D\uDCCA Nodes Summary:`));
|
|
19461
19584
|
output.log(renderNodesList(definition.nodes));
|
|
19462
|
-
output.log(
|
|
19585
|
+
output.log(chalk67.green(`
|
|
19463
19586
|
✅ Workflow '${workflowName}' added successfully`));
|
|
19464
19587
|
} catch (error) {
|
|
19465
19588
|
if (error.message?.includes("already exists") && !a.force) {
|
|
@@ -19476,7 +19599,7 @@ Agent output:
|
|
|
19476
19599
|
};
|
|
19477
19600
|
|
|
19478
19601
|
// src/commands/workflow/commands/get.ts
|
|
19479
|
-
import
|
|
19602
|
+
import chalk68 from "chalk";
|
|
19480
19603
|
import { createWorkflowGetTool } from "@ai-setting/roy-agent-core/env/workflow/tools";
|
|
19481
19604
|
var WorkflowGetCommand = {
|
|
19482
19605
|
command: "get <identifier>",
|
|
@@ -19614,15 +19737,15 @@ var WorkflowGetCommand = {
|
|
|
19614
19737
|
} else {
|
|
19615
19738
|
output.log(renderWorkflowDetail(workflow, { includeRuns: runs }));
|
|
19616
19739
|
if (args.includeNodes) {
|
|
19617
|
-
output.log(
|
|
19740
|
+
output.log(chalk68.bold(`
|
|
19618
19741
|
\uD83D\uDCCB All Nodes:`));
|
|
19619
19742
|
output.log(renderNodesList(data.nodes || []));
|
|
19620
19743
|
}
|
|
19621
19744
|
const yaml = await Promise.resolve().then(() => __toESM(require_dist(), 1));
|
|
19622
19745
|
const defYaml = yaml.stringify(data.definition || {}, { indent: 2 });
|
|
19623
|
-
output.log(
|
|
19746
|
+
output.log(chalk68.bold(`
|
|
19624
19747
|
\uD83D\uDCC4 Definition (YAML):`));
|
|
19625
|
-
output.log(
|
|
19748
|
+
output.log(chalk68.gray(defYaml));
|
|
19626
19749
|
}
|
|
19627
19750
|
}
|
|
19628
19751
|
} catch (error) {
|
|
@@ -19635,7 +19758,7 @@ var WorkflowGetCommand = {
|
|
|
19635
19758
|
};
|
|
19636
19759
|
|
|
19637
19760
|
// src/commands/workflow/commands/update.ts
|
|
19638
|
-
import
|
|
19761
|
+
import chalk69 from "chalk";
|
|
19639
19762
|
import fs4 from "fs";
|
|
19640
19763
|
import path7 from "path";
|
|
19641
19764
|
import { parseWorkflowFile } from "@ai-setting/roy-agent-core/env/workflow/types";
|
|
@@ -19708,7 +19831,7 @@ var WorkflowUpdateCommand = {
|
|
|
19708
19831
|
const tags = a.tags ? a.tags.split(",").map((t) => t.trim()) : undefined;
|
|
19709
19832
|
const workflow = await service.updateWorkflow(a.name, updates, { tags });
|
|
19710
19833
|
output.log(renderWorkflowUpdated(workflow));
|
|
19711
|
-
output.log(
|
|
19834
|
+
output.log(chalk69.green(`
|
|
19712
19835
|
✅ Workflow '${a.name}' updated successfully`));
|
|
19713
19836
|
} catch (error) {
|
|
19714
19837
|
output.error(`Failed to update workflow: ${error}`);
|
|
@@ -19720,7 +19843,7 @@ var WorkflowUpdateCommand = {
|
|
|
19720
19843
|
};
|
|
19721
19844
|
|
|
19722
19845
|
// src/commands/workflow/commands/remove.ts
|
|
19723
|
-
import
|
|
19846
|
+
import chalk70 from "chalk";
|
|
19724
19847
|
var WorkflowRemoveCommand = {
|
|
19725
19848
|
command: "remove <name>",
|
|
19726
19849
|
describe: "删除 Workflow",
|
|
@@ -19759,8 +19882,8 @@ var WorkflowRemoveCommand = {
|
|
|
19759
19882
|
process.exit(1);
|
|
19760
19883
|
}
|
|
19761
19884
|
if (!args.force) {
|
|
19762
|
-
output.log(
|
|
19763
|
-
output.log(
|
|
19885
|
+
output.log(chalk70.yellow(`Are you sure you want to delete workflow '${args.name}'?`));
|
|
19886
|
+
output.log(chalk70.gray("Use --force to skip confirmation"));
|
|
19764
19887
|
process.exit(1);
|
|
19765
19888
|
}
|
|
19766
19889
|
const deleted = await service.deleteWorkflow(args.name);
|
|
@@ -19780,7 +19903,7 @@ var WorkflowRemoveCommand = {
|
|
|
19780
19903
|
|
|
19781
19904
|
// src/commands/workflow/commands/run.ts
|
|
19782
19905
|
var import_yaml = __toESM(require_dist(), 1);
|
|
19783
|
-
import
|
|
19906
|
+
import chalk71 from "chalk";
|
|
19784
19907
|
import fs5 from "fs";
|
|
19785
19908
|
import path8 from "path";
|
|
19786
19909
|
import { createRunWorkflowTool } from "@ai-setting/roy-agent-core/env/workflow/tools";
|
|
@@ -19867,7 +19990,7 @@ var runWorkflow = wrapFunction(async function runWorkflowImpl(args) {
|
|
|
19867
19990
|
}
|
|
19868
19991
|
if (args.session) {
|
|
19869
19992
|
const sessionId = args.session;
|
|
19870
|
-
output.log(
|
|
19993
|
+
output.log(chalk71.blue(`\uD83D\uDD04 Resuming workflow from session: ${sessionId}`));
|
|
19871
19994
|
try {
|
|
19872
19995
|
const resumeInput = typeof input === "string" ? { userQuery: input } : input;
|
|
19873
19996
|
const result = await service.resumeSession(sessionId, {
|
|
@@ -19910,17 +20033,17 @@ var runWorkflow = wrapFunction(async function runWorkflowImpl(args) {
|
|
|
19910
20033
|
definition = { ...definition, name: args.name };
|
|
19911
20034
|
}
|
|
19912
20035
|
const workflow = await service.createWorkflow(definition, { force: true });
|
|
19913
|
-
output.log(
|
|
19914
|
-
output.log(
|
|
20036
|
+
output.log(chalk71.blue(`\uD83D\uDCDD Registering workflow: ${registrationName}`));
|
|
20037
|
+
output.log(chalk71.green(`✅ Workflow registered: ${workflow.name} (${workflow.id})`));
|
|
19915
20038
|
if (args.registerOnly) {
|
|
19916
|
-
output.log(
|
|
20039
|
+
output.log(chalk71.gray("ℹ️ Use --register-only, skipping execution"));
|
|
19917
20040
|
if (workflowSpan) {
|
|
19918
20041
|
workflowSpan.end();
|
|
19919
20042
|
}
|
|
19920
20043
|
await envService.dispose();
|
|
19921
20044
|
process.exit(0);
|
|
19922
20045
|
}
|
|
19923
|
-
output.log(
|
|
20046
|
+
output.log(chalk71.blue(`\uD83D\uDE80 Running workflow: ${workflow.name}`));
|
|
19924
20047
|
const result = await service.runWorkflow(definition, input, runOptions);
|
|
19925
20048
|
output.log(renderRunResult({
|
|
19926
20049
|
runId: result.runId,
|
|
@@ -19930,7 +20053,7 @@ var runWorkflow = wrapFunction(async function runWorkflowImpl(args) {
|
|
|
19930
20053
|
durationMs: result.durationMs
|
|
19931
20054
|
}));
|
|
19932
20055
|
if (result.status === "paused") {
|
|
19933
|
-
output.log(
|
|
20056
|
+
output.log(chalk71.gray(`
|
|
19934
20057
|
\uD83D\uDCA1 Use "roy-agent workflow run ${result.runId} --session ${result.runId} --input '<response>'" to resume`));
|
|
19935
20058
|
}
|
|
19936
20059
|
} else {
|
|
@@ -19946,7 +20069,7 @@ var runWorkflow = wrapFunction(async function runWorkflowImpl(args) {
|
|
|
19946
20069
|
output.error(toolResult.error || `Failed to run workflow: ${args.identifier}`);
|
|
19947
20070
|
if (runId) {
|
|
19948
20071
|
output.error(`Run ID: ${runId}`);
|
|
19949
|
-
output.error(
|
|
20072
|
+
output.error(chalk71.gray(`
|
|
19950
20073
|
\uD83D\uDCA1 Use "roy-agent workflow status ${runId}" to check progress, or "roy-agent workflow run ${args.identifier} --session ${runId}" to resume`));
|
|
19951
20074
|
}
|
|
19952
20075
|
process.exit(1);
|
|
@@ -19960,7 +20083,7 @@ var runWorkflow = wrapFunction(async function runWorkflowImpl(args) {
|
|
|
19960
20083
|
durationMs: runData.duration_ms
|
|
19961
20084
|
}));
|
|
19962
20085
|
if (runData.status === "paused") {
|
|
19963
|
-
output.log(
|
|
20086
|
+
output.log(chalk71.gray(`
|
|
19964
20087
|
\uD83D\uDCA1 Use "roy-agent workflow run ${runData.run_id} --session ${runData.run_id} --input '<response>'" to resume`));
|
|
19965
20088
|
}
|
|
19966
20089
|
}
|
|
@@ -20032,7 +20155,7 @@ var WorkflowRunCommand = {
|
|
|
20032
20155
|
};
|
|
20033
20156
|
|
|
20034
20157
|
// src/commands/workflow/commands/stop.ts
|
|
20035
|
-
import
|
|
20158
|
+
import chalk72 from "chalk";
|
|
20036
20159
|
import { createWorkflowRunStopTool } from "@ai-setting/roy-agent-core/env/workflow/tools";
|
|
20037
20160
|
import { wrapFunction as wrapFunction2 } from "@ai-setting/roy-agent-core";
|
|
20038
20161
|
var stopWorkflow = wrapFunction2(async function stopWorkflowImpl(args) {
|
|
@@ -20057,7 +20180,7 @@ var stopWorkflow = wrapFunction2(async function stopWorkflowImpl(args) {
|
|
|
20057
20180
|
output.error(result.error || `Failed to stop workflow: ${args.runId}`);
|
|
20058
20181
|
process.exit(1);
|
|
20059
20182
|
}
|
|
20060
|
-
output.log(
|
|
20183
|
+
output.log(chalk72.red(`
|
|
20061
20184
|
⏹️ Workflow stopped: ${args.runId}`));
|
|
20062
20185
|
} catch (error) {
|
|
20063
20186
|
output.error(`Failed to stop workflow: ${error}`);
|
|
@@ -20081,7 +20204,7 @@ var WorkflowStopCommand = {
|
|
|
20081
20204
|
};
|
|
20082
20205
|
|
|
20083
20206
|
// src/commands/workflow/commands/status.ts
|
|
20084
|
-
import
|
|
20207
|
+
import chalk73 from "chalk";
|
|
20085
20208
|
import { createWorkflowRunStatusTool } from "@ai-setting/roy-agent-core/env/workflow/tools";
|
|
20086
20209
|
var WorkflowStatusCommand = {
|
|
20087
20210
|
command: "status <runId>",
|
|
@@ -20174,7 +20297,7 @@ var WorkflowStatusCommand = {
|
|
|
20174
20297
|
stopped: "⏹️"
|
|
20175
20298
|
};
|
|
20176
20299
|
const emoji = statusEmoji[status] || "❓";
|
|
20177
|
-
output.log(
|
|
20300
|
+
output.log(chalk73.bold(`
|
|
20178
20301
|
${emoji} Status: ${status.toUpperCase()}`));
|
|
20179
20302
|
}
|
|
20180
20303
|
} catch (error) {
|
|
@@ -20187,7 +20310,7 @@ ${emoji} Status: ${status.toUpperCase()}`));
|
|
|
20187
20310
|
};
|
|
20188
20311
|
|
|
20189
20312
|
// src/commands/workflow/commands/nodes.ts
|
|
20190
|
-
import
|
|
20313
|
+
import chalk74 from "chalk";
|
|
20191
20314
|
var BUILT_IN_NODES = [
|
|
20192
20315
|
{
|
|
20193
20316
|
name: "ToolNode",
|
|
@@ -20524,7 +20647,7 @@ nodes:
|
|
|
20524
20647
|
];
|
|
20525
20648
|
function renderNodeTypesTable(nodes) {
|
|
20526
20649
|
const lines = [];
|
|
20527
|
-
lines.push(
|
|
20650
|
+
lines.push(chalk74.bold(`
|
|
20528
20651
|
\uD83D\uDCE6 Built-in Node Types
|
|
20529
20652
|
`));
|
|
20530
20653
|
lines.push("┌────────────┬────────────────────┬─────────────────────────────────────────────────────────────┐");
|
|
@@ -20542,29 +20665,29 @@ function renderNodeTypesTable(nodes) {
|
|
|
20542
20665
|
}
|
|
20543
20666
|
function renderNodeDetail(node) {
|
|
20544
20667
|
const lines = [];
|
|
20545
|
-
lines.push(
|
|
20668
|
+
lines.push(chalk74.bold(`
|
|
20546
20669
|
[${node.type}] ${node.name}`));
|
|
20547
|
-
lines.push(
|
|
20670
|
+
lines.push(chalk74.dim("─".repeat(60)) + `
|
|
20548
20671
|
`);
|
|
20549
|
-
lines.push(
|
|
20672
|
+
lines.push(chalk74.bold("Description:"));
|
|
20550
20673
|
lines.push(` ${node.description}
|
|
20551
20674
|
`);
|
|
20552
|
-
lines.push(
|
|
20675
|
+
lines.push(chalk74.bold("Configuration:"));
|
|
20553
20676
|
lines.push(' type: "' + node.type + '"');
|
|
20554
20677
|
lines.push(" config:");
|
|
20555
20678
|
for (const input of node.inputs) {
|
|
20556
|
-
const required = input.required ?
|
|
20679
|
+
const required = input.required ? chalk74.red("*") : " ";
|
|
20557
20680
|
lines.push(` ${input.name} (${input.type})${required}`);
|
|
20558
20681
|
lines.push(` ${input.description}`);
|
|
20559
20682
|
}
|
|
20560
20683
|
lines.push(`
|
|
20561
|
-
${
|
|
20684
|
+
${chalk74.bold("Output:")} ${node.output}`);
|
|
20562
20685
|
if (node.example) {
|
|
20563
|
-
lines.push(
|
|
20686
|
+
lines.push(chalk74.bold(`
|
|
20564
20687
|
Example:`));
|
|
20565
|
-
lines.push(
|
|
20688
|
+
lines.push(chalk74.gray("```yaml"));
|
|
20566
20689
|
lines.push(node.example);
|
|
20567
|
-
lines.push(
|
|
20690
|
+
lines.push(chalk74.gray("```"));
|
|
20568
20691
|
}
|
|
20569
20692
|
return lines.join(`
|
|
20570
20693
|
`);
|
|
@@ -20580,16 +20703,16 @@ var WorkflowNodesCommand = {
|
|
|
20580
20703
|
const nodeType = args.type?.toLowerCase();
|
|
20581
20704
|
if (!nodeType) {
|
|
20582
20705
|
console.log(renderNodeTypesTable(BUILT_IN_NODES));
|
|
20583
|
-
console.log(
|
|
20584
|
-
Use `) +
|
|
20585
|
-
console.log(
|
|
20706
|
+
console.log(chalk74.gray(`
|
|
20707
|
+
Use `) + chalk74.cyan("roy-agent workflow nodes <type>") + chalk74.gray(" for detailed information"));
|
|
20708
|
+
console.log(chalk74.gray("Available types: ") + chalk74.yellow(BUILT_IN_NODES.map((n) => n.type).join(", ")));
|
|
20586
20709
|
return;
|
|
20587
20710
|
}
|
|
20588
20711
|
const node = BUILT_IN_NODES.find((n) => n.type === nodeType);
|
|
20589
20712
|
if (!node) {
|
|
20590
|
-
console.log(
|
|
20713
|
+
console.log(chalk74.red(`
|
|
20591
20714
|
❌ Unknown node type: ${nodeType}`));
|
|
20592
|
-
console.log(
|
|
20715
|
+
console.log(chalk74.gray("Available types: ") + chalk74.yellow(BUILT_IN_NODES.map((n) => n.type).join(", ")));
|
|
20593
20716
|
process.exit(1);
|
|
20594
20717
|
}
|
|
20595
20718
|
console.log(renderNodeDetail(node));
|
|
@@ -20597,7 +20720,7 @@ Use `) + chalk73.cyan("roy-agent workflow nodes <type>") + chalk73.gray(" for de
|
|
|
20597
20720
|
};
|
|
20598
20721
|
|
|
20599
20722
|
// src/commands/workflow/commands/validate.ts
|
|
20600
|
-
import
|
|
20723
|
+
import chalk75 from "chalk";
|
|
20601
20724
|
import { readFileSync } from "fs";
|
|
20602
20725
|
async function parseWorkflowInput(input, yamlStr) {
|
|
20603
20726
|
const parseYaml = async (content) => {
|
|
@@ -20630,25 +20753,25 @@ function renderResult(result, options) {
|
|
|
20630
20753
|
return;
|
|
20631
20754
|
}
|
|
20632
20755
|
if (result.valid) {
|
|
20633
|
-
console.log(
|
|
20756
|
+
console.log(chalk75.green(`
|
|
20634
20757
|
✅ Workflow validation PASSED
|
|
20635
20758
|
`));
|
|
20636
|
-
console.log(
|
|
20759
|
+
console.log(chalk75.bold(`Workflow: ${result.workflowName}`));
|
|
20637
20760
|
console.log(`Nodes: ${result.nodeCount}`);
|
|
20638
20761
|
console.log(`
|
|
20639
20762
|
Valid nodes:`);
|
|
20640
|
-
console.log(
|
|
20763
|
+
console.log(chalk75.green(" ✓ All nodes passed validation"));
|
|
20641
20764
|
} else {
|
|
20642
|
-
console.log(
|
|
20765
|
+
console.log(chalk75.red(`
|
|
20643
20766
|
❌ Workflow validation FAILED (${result.errors.length} errors found)
|
|
20644
20767
|
`));
|
|
20645
20768
|
result.errors.forEach((error, index) => {
|
|
20646
|
-
console.log(
|
|
20647
|
-
console.log(` ${
|
|
20648
|
-
console.log(` ${
|
|
20649
|
-
console.log(` ${
|
|
20650
|
-
console.log(` ${
|
|
20651
|
-
console.log(` ${
|
|
20769
|
+
console.log(chalk75.red(`[Error ${index + 1}/${result.errors.length}]${error.nodeId ? ` Node "${error.nodeId}"` : ""}`));
|
|
20770
|
+
console.log(` ${chalk75.bold("Type:")} ${error.type}`);
|
|
20771
|
+
console.log(` ${chalk75.bold("Description:")} ${error.description}`);
|
|
20772
|
+
console.log(` ${chalk75.bold("Expected:")} ${error.expected}`);
|
|
20773
|
+
console.log(` ${chalk75.bold("Actual:")} ${error.actual}`);
|
|
20774
|
+
console.log(` ${chalk75.green("Fix:")} ${error.fix}`);
|
|
20652
20775
|
console.log();
|
|
20653
20776
|
});
|
|
20654
20777
|
}
|
|
@@ -20673,7 +20796,7 @@ var WorkflowValidateCommand = {
|
|
|
20673
20796
|
try {
|
|
20674
20797
|
const workflow = await parseWorkflowInput(options.input, options.yaml);
|
|
20675
20798
|
if (!workflow) {
|
|
20676
|
-
console.error(
|
|
20799
|
+
console.error(chalk75.red("Failed to parse workflow input"));
|
|
20677
20800
|
process.exit(1);
|
|
20678
20801
|
}
|
|
20679
20802
|
const validator = new WorkflowValidator;
|
|
@@ -20681,7 +20804,7 @@ var WorkflowValidateCommand = {
|
|
|
20681
20804
|
renderResult(result, options);
|
|
20682
20805
|
process.exit(result.valid ? 0 : 1);
|
|
20683
20806
|
} catch (error) {
|
|
20684
|
-
console.error(
|
|
20807
|
+
console.error(chalk75.red(`
|
|
20685
20808
|
Error: ${error.message}`));
|
|
20686
20809
|
process.exit(1);
|
|
20687
20810
|
}
|
|
@@ -20689,7 +20812,7 @@ Error: ${error.message}`));
|
|
|
20689
20812
|
};
|
|
20690
20813
|
|
|
20691
20814
|
// src/commands/workflow/commands/search.ts
|
|
20692
|
-
import
|
|
20815
|
+
import chalk76 from "chalk";
|
|
20693
20816
|
import { wrapFunction as wrapFunction3 } from "@ai-setting/roy-agent-core";
|
|
20694
20817
|
var WorkflowSearchCommand = {
|
|
20695
20818
|
command: "search",
|
|
@@ -20846,22 +20969,22 @@ var _runWorkflowSearchImpl = async function(opts) {
|
|
|
20846
20969
|
metadata: {}
|
|
20847
20970
|
}));
|
|
20848
20971
|
if (renderWorkflows.length === 0) {
|
|
20849
|
-
output.log(
|
|
20850
|
-
output.log(
|
|
20851
|
-
output.log(
|
|
20972
|
+
output.log(chalk76.yellow("\uD83D\uDD0D No workflows matched the search criteria."));
|
|
20973
|
+
output.log(chalk76.gray(` keyword: ${keyword || "(none)"}`));
|
|
20974
|
+
output.log(chalk76.gray(` tags: ${tags && tags.length > 0 ? tags.join(", ") : "(none)"}`));
|
|
20852
20975
|
} else {
|
|
20853
|
-
output.log(
|
|
20976
|
+
output.log(chalk76.bold(`\uD83D\uDD0D Search results (${renderWorkflows.length}):`));
|
|
20854
20977
|
output.log(renderWorkflowList(renderWorkflows));
|
|
20855
|
-
output.log(
|
|
20978
|
+
output.log(chalk76.green(`
|
|
20856
20979
|
✅ Found ${renderWorkflows.length} workflow(s)`));
|
|
20857
20980
|
}
|
|
20858
20981
|
if (availableTags.length > 0) {
|
|
20859
20982
|
output.log("");
|
|
20860
|
-
output.log(
|
|
20983
|
+
output.log(chalk76.bold("\uD83D\uDCDA Available tags (sorted by usage_count):"));
|
|
20861
20984
|
for (const t of availableTags) {
|
|
20862
20985
|
const name = t.name ?? t.tag;
|
|
20863
20986
|
const count = t.count ?? t.usage_count;
|
|
20864
|
-
output.log(
|
|
20987
|
+
output.log(chalk76.gray(` - ${name} (${count})`));
|
|
20865
20988
|
}
|
|
20866
20989
|
}
|
|
20867
20990
|
};
|
|
@@ -20873,7 +20996,7 @@ var runWorkflowSearch = wrapFunction3(_runWorkflowSearchImpl, "workflow.cli.sear
|
|
|
20873
20996
|
|
|
20874
20997
|
// src/commands/workflow/commands/tag.ts
|
|
20875
20998
|
import { wrapFunction as wrapFunction4 } from "@ai-setting/roy-agent-core";
|
|
20876
|
-
import
|
|
20999
|
+
import chalk77 from "chalk";
|
|
20877
21000
|
var WorkflowTagListCommand = {
|
|
20878
21001
|
command: "list",
|
|
20879
21002
|
describe: "List all workflow tags from the workflow_tags table (sorted by usage_count DESC by default). Use this BEFORE `workflow add` to discover existing tags and reuse them for semantic consistency.",
|
|
@@ -20994,17 +21117,17 @@ var _runWorkflowTagListImpl = async function(opts) {
|
|
|
20994
21117
|
return;
|
|
20995
21118
|
}
|
|
20996
21119
|
if (result.tags.length === 0) {
|
|
20997
|
-
output.log(
|
|
20998
|
-
output.log(
|
|
21120
|
+
output.log(chalk77.yellow("\uD83C\uDFF7️ No tags in the workflow_tags table yet."));
|
|
21121
|
+
output.log(chalk77.gray(" Tags are created automatically when you run `workflow add --tags <name>`."));
|
|
20999
21122
|
return;
|
|
21000
21123
|
}
|
|
21001
|
-
output.log(
|
|
21002
|
-
output.log(
|
|
21124
|
+
output.log(chalk77.bold(`\uD83C\uDFF7️ Workflow tags (${result.total}):`));
|
|
21125
|
+
output.log(chalk77.gray(` ${padRight("NAME", 24)}${padRight("USAGE", 8)}${padRight("CREATED", 22)}`));
|
|
21003
21126
|
for (const t of result.tags) {
|
|
21004
21127
|
const line = ` ${padRight(t.name, 24)}${padRight(String(t.usage_count), 8)}${padRight(formatDate2(t.created_at), 22)}`;
|
|
21005
21128
|
output.log(line);
|
|
21006
21129
|
}
|
|
21007
|
-
output.log(
|
|
21130
|
+
output.log(chalk77.gray(`
|
|
21008
21131
|
\uD83D\uDCA1 Tip: when adding a new workflow, prefer tags from this list to ensure semantic consistency.`));
|
|
21009
21132
|
};
|
|
21010
21133
|
var _runWorkflowTagGetImpl = async function(opts) {
|
|
@@ -21031,7 +21154,7 @@ var _runWorkflowTagGetImpl = async function(opts) {
|
|
|
21031
21154
|
output.json({ error: "Tag not found", name: opts.name });
|
|
21032
21155
|
} else {
|
|
21033
21156
|
output.error(`Tag "${opts.name}" not found in the workflow_tags table.`);
|
|
21034
|
-
output.log(
|
|
21157
|
+
output.log(chalk77.gray(`Tip: run \`roy-agent workflow tag list\` to see available tags.`));
|
|
21035
21158
|
}
|
|
21036
21159
|
process.exitCode = 1;
|
|
21037
21160
|
return;
|
|
@@ -21040,10 +21163,10 @@ var _runWorkflowTagGetImpl = async function(opts) {
|
|
|
21040
21163
|
output.json(tag);
|
|
21041
21164
|
return;
|
|
21042
21165
|
}
|
|
21043
|
-
output.log(
|
|
21044
|
-
output.log(
|
|
21045
|
-
output.log(
|
|
21046
|
-
output.log(
|
|
21166
|
+
output.log(chalk77.bold(`\uD83C\uDFF7️ Tag: ${tag.name}`));
|
|
21167
|
+
output.log(chalk77.gray(` usage_count: ${tag.usage_count}`));
|
|
21168
|
+
output.log(chalk77.gray(` created_at: ${tag.created_at}`));
|
|
21169
|
+
output.log(chalk77.gray(` updated_at: ${tag.updated_at}`));
|
|
21047
21170
|
};
|
|
21048
21171
|
async function callListTags(service, options) {
|
|
21049
21172
|
if (typeof service.listTags !== "function") {
|
|
@@ -21394,7 +21517,11 @@ function readPackageInfo(packageName) {
|
|
|
21394
21517
|
join4(process.cwd(), "node_modules", packageName, "package.json"),
|
|
21395
21518
|
resolve(process.cwd(), "..", "node_modules", packageName, "package.json"),
|
|
21396
21519
|
join4(process.cwd(), ".roy", "plugins", packageName, "package.json"),
|
|
21397
|
-
join4(homedir3(), ".roy-agent", "node_modules", packageName, "package.json")
|
|
21520
|
+
join4(homedir3(), ".roy-agent", "node_modules", packageName, "package.json"),
|
|
21521
|
+
...(() => {
|
|
21522
|
+
const globalRoot = getNpmGlobalRoot();
|
|
21523
|
+
return globalRoot ? [join4(globalRoot, packageName, "package.json")] : [];
|
|
21524
|
+
})()
|
|
21398
21525
|
];
|
|
21399
21526
|
for (const pkgPath of searchPaths) {
|
|
21400
21527
|
try {
|
|
@@ -21414,6 +21541,13 @@ function readPackageInfo(packageName) {
|
|
|
21414
21541
|
console.warn(`⚠️ Could not find package.json for '${packageName}' (searched ${searchPaths.length} paths)`);
|
|
21415
21542
|
return null;
|
|
21416
21543
|
}
|
|
21544
|
+
function getNpmGlobalRoot() {
|
|
21545
|
+
const result = spawnSync("npm", ["root", "-g"], { encoding: "utf-8" });
|
|
21546
|
+
if (result.status === 0 && result.stdout) {
|
|
21547
|
+
return String(result.stdout).trim();
|
|
21548
|
+
}
|
|
21549
|
+
return null;
|
|
21550
|
+
}
|
|
21417
21551
|
function getPackageManagerCommand() {
|
|
21418
21552
|
if (existsSync3(join4(process.cwd(), "pnpm-lock.yaml"))) {
|
|
21419
21553
|
if (existsSync3(join4(process.cwd(), "pnpm-workspace.yaml"))) {
|