snow-ai 0.8.8 → 0.8.9
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/bundle/cli.mjs +461 -233
- package/bundle/package.json +1 -1
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -1485,7 +1485,7 @@ var require_react_development = __commonJS({
|
|
|
1485
1485
|
}
|
|
1486
1486
|
return false;
|
|
1487
1487
|
}
|
|
1488
|
-
function
|
|
1488
|
+
function memo12(type, compare) {
|
|
1489
1489
|
{
|
|
1490
1490
|
if (!isValidElementType(type)) {
|
|
1491
1491
|
error42("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type);
|
|
@@ -1565,7 +1565,7 @@ var require_react_development = __commonJS({
|
|
|
1565
1565
|
var dispatcher = resolveDispatcher();
|
|
1566
1566
|
return dispatcher.useCallback(callback, deps);
|
|
1567
1567
|
}
|
|
1568
|
-
function
|
|
1568
|
+
function useMemo53(create3, deps) {
|
|
1569
1569
|
var dispatcher = resolveDispatcher();
|
|
1570
1570
|
return dispatcher.useMemo(create3, deps);
|
|
1571
1571
|
}
|
|
@@ -2325,7 +2325,7 @@ var require_react_development = __commonJS({
|
|
|
2325
2325
|
exports2.forwardRef = forwardRef3;
|
|
2326
2326
|
exports2.isValidElement = isValidElement3;
|
|
2327
2327
|
exports2.lazy = lazy6;
|
|
2328
|
-
exports2.memo =
|
|
2328
|
+
exports2.memo = memo12;
|
|
2329
2329
|
exports2.startTransition = startTransition;
|
|
2330
2330
|
exports2.unstable_act = act;
|
|
2331
2331
|
exports2.useCallback = useCallback77;
|
|
@@ -2337,7 +2337,7 @@ var require_react_development = __commonJS({
|
|
|
2337
2337
|
exports2.useImperativeHandle = useImperativeHandle2;
|
|
2338
2338
|
exports2.useInsertionEffect = useInsertionEffect;
|
|
2339
2339
|
exports2.useLayoutEffect = useLayoutEffect2;
|
|
2340
|
-
exports2.useMemo =
|
|
2340
|
+
exports2.useMemo = useMemo53;
|
|
2341
2341
|
exports2.useReducer = useReducer8;
|
|
2342
2342
|
exports2.useRef = useRef36;
|
|
2343
2343
|
exports2.useState = useState102;
|
|
@@ -47082,6 +47082,7 @@ var init_en = __esm({
|
|
|
47082
47082
|
commandMessage: "Command",
|
|
47083
47083
|
discontinuedMessage: "\u2514\u2500 user discontinue",
|
|
47084
47084
|
aiCompletionTimeMessage: "\u2514\u2500 AI finished at {time}",
|
|
47085
|
+
aiCompletionTimeWithDurationMessage: "\u2514\u2500 AI finished at {time} ({duration})",
|
|
47085
47086
|
compressionSummaryAutoTitle: "Auto-compressed summary collapsed",
|
|
47086
47087
|
compressionSummaryManualTitle: "Manual compressed summary collapsed",
|
|
47087
47088
|
compressionSummaryStats: "{lines} lines \xB7 {chars} chars",
|
|
@@ -47314,6 +47315,7 @@ var init_en = __esm({
|
|
|
47314
47315
|
modeLabel: "Creation Mode:",
|
|
47315
47316
|
modeAi: "AI Generate (describe requirement)",
|
|
47316
47317
|
modeManual: "Manual (create templates)",
|
|
47318
|
+
modeInstall: "Install from GitHub",
|
|
47317
47319
|
requirementLabel: "Requirement:",
|
|
47318
47320
|
requirementHint: "Describe what you want this Skill to do (content will follow this language)",
|
|
47319
47321
|
requirementPlaceholder: "e.g., Generate a Skill for releasing npm packages...",
|
|
@@ -47562,7 +47564,7 @@ var init_en = __esm({
|
|
|
47562
47564
|
emptyHint: "No background processes"
|
|
47563
47565
|
},
|
|
47564
47566
|
fileRollback: {
|
|
47565
|
-
title: "
|
|
47567
|
+
title: "Rollback Confirmation",
|
|
47566
47568
|
description: "This checkpoint has",
|
|
47567
47569
|
filesCount: "{count} file(s) will be rolled back",
|
|
47568
47570
|
filesCountWithSelection: "{count} file(s) will be rolled back ({selected}/{total} selected)",
|
|
@@ -49307,6 +49309,7 @@ var init_zh = __esm({
|
|
|
49307
49309
|
commandMessage: "\u547D\u4EE4",
|
|
49308
49310
|
discontinuedMessage: "\u2514\u2500 \u7528\u6237\u4E2D\u65AD",
|
|
49309
49311
|
aiCompletionTimeMessage: "\u2514\u2500 AI \u7ED3\u675F\u65F6\u95F4\uFF1A{time}",
|
|
49312
|
+
aiCompletionTimeWithDurationMessage: "\u2514\u2500 AI \u7ED3\u675F\u65F6\u95F4\uFF1A{time} (\u8017\u65F6 {duration})",
|
|
49310
49313
|
compressionSummaryAutoTitle: "\u81EA\u52A8\u538B\u7F29\u6458\u8981\u5DF2\u6298\u53E0",
|
|
49311
49314
|
compressionSummaryManualTitle: "\u624B\u52A8\u538B\u7F29\u6458\u8981\u5DF2\u6298\u53E0",
|
|
49312
49315
|
compressionSummaryStats: "{lines} \u884C \xB7 {chars} \u5B57\u7B26",
|
|
@@ -49538,6 +49541,7 @@ var init_zh = __esm({
|
|
|
49538
49541
|
modeLabel: "\u9009\u62E9\u521B\u5EFA\u65B9\u5F0F:",
|
|
49539
49542
|
modeAi: "AI \u751F\u6210\uFF08\u8F93\u5165\u9700\u6C42\u5373\u53EF\uFF09",
|
|
49540
49543
|
modeManual: "\u624B\u52A8\u521B\u5EFA\uFF08\u751F\u6210\u6A21\u677F\uFF09",
|
|
49544
|
+
modeInstall: "\u4ECE GitHub \u5B89\u88C5\u6280\u80FD",
|
|
49541
49545
|
requirementLabel: "\u6280\u80FD\u9700\u6C42:",
|
|
49542
49546
|
requirementHint: "\u7B80\u8981\u63CF\u8FF0\u4F60\u5E0C\u671B\u8BE5\u6280\u80FD\u5B8C\u6210\u4EC0\u4E48\uFF08\u751F\u6210\u5185\u5BB9\u5C06\u8DDF\u968F\u6B64\u8BED\u8A00\uFF09",
|
|
49543
49547
|
requirementPlaceholder: "\u4F8B\u5982\uFF1A\u751F\u6210\u4E00\u4E2A\u7528\u4E8E\u53D1\u5E03 npm \u5305\u7684\u6280\u80FD\u2026",
|
|
@@ -49786,7 +49790,7 @@ var init_zh = __esm({
|
|
|
49786
49790
|
emptyHint: "\u65E0\u540E\u53F0\u8FDB\u7A0B"
|
|
49787
49791
|
},
|
|
49788
49792
|
fileRollback: {
|
|
49789
|
-
title: "\
|
|
49793
|
+
title: "\u56DE\u6EDA\u786E\u8BA4",
|
|
49790
49794
|
description: "\u6B64\u68C0\u67E5\u70B9\u5305\u542B",
|
|
49791
49795
|
filesCount: "{count} \u4E2A\u6587\u4EF6\u5C06\u88AB\u56DE\u6EDA",
|
|
49792
49796
|
filesCountWithSelection: "{count} \u4E2A\u6587\u4EF6\u5C06\u88AB\u56DE\u6EDA ({selected}/{total} \u5DF2\u9009\u62E9)",
|
|
@@ -51531,6 +51535,7 @@ var init_zh_TW = __esm({
|
|
|
51531
51535
|
commandMessage: "\u547D\u4EE4",
|
|
51532
51536
|
discontinuedMessage: "\u2514\u2500 \u4F7F\u7528\u8005\u4E2D\u65B7",
|
|
51533
51537
|
aiCompletionTimeMessage: "\u2514\u2500 AI \u7D50\u675F\u6642\u9593\uFF1A{time}",
|
|
51538
|
+
aiCompletionTimeWithDurationMessage: "\u2514\u2500 AI \u7D50\u675F\u6642\u9593\uFF1A{time} (\u8017\u6642 {duration})",
|
|
51534
51539
|
compressionSummaryAutoTitle: "\u81EA\u52D5\u58D3\u7E2E\u6458\u8981\u5DF2\u647A\u758A",
|
|
51535
51540
|
compressionSummaryManualTitle: "\u624B\u52D5\u58D3\u7E2E\u6458\u8981\u5DF2\u647A\u758A",
|
|
51536
51541
|
compressionSummaryStats: "{lines} \u884C \xB7 {chars} \u5B57\u5143",
|
|
@@ -51762,6 +51767,7 @@ var init_zh_TW = __esm({
|
|
|
51762
51767
|
modeLabel: "\u9078\u64C7\u5275\u5EFA\u65B9\u5F0F:",
|
|
51763
51768
|
modeAi: "AI \u751F\u6210\uFF08\u8F38\u5165\u9700\u6C42\u5373\u53EF\uFF09",
|
|
51764
51769
|
modeManual: "\u624B\u52D5\u5275\u5EFA\uFF08\u751F\u6210\u6A21\u677F\uFF09",
|
|
51770
|
+
modeInstall: "\u5F9E GitHub \u5B89\u88DD\u6280\u80FD",
|
|
51765
51771
|
requirementLabel: "\u6280\u80FD\u9700\u6C42:",
|
|
51766
51772
|
requirementHint: "\u7C21\u8981\u63CF\u8FF0\u4F60\u5E0C\u671B\u8A72\u6280\u80FD\u5B8C\u6210\u4EC0\u9EBC\uFF08\u751F\u6210\u5167\u5BB9\u5C07\u8DDF\u96A8\u6B64\u8A9E\u8A00\uFF09",
|
|
51767
51773
|
requirementPlaceholder: "\u4F8B\u5982\uFF1A\u751F\u6210\u4E00\u500B\u7528\u65BC\u767C\u4F48 npm \u5957\u4EF6\u7684\u6280\u80FD\u2026",
|
|
@@ -52009,7 +52015,7 @@ var init_zh_TW = __esm({
|
|
|
52009
52015
|
emptyHint: "\u7121\u80CC\u666F\u8655\u7406\u7A0B\u5E8F"
|
|
52010
52016
|
},
|
|
52011
52017
|
fileRollback: {
|
|
52012
|
-
title: "\
|
|
52018
|
+
title: "\u56DE\u6EFE\u78BA\u8A8D",
|
|
52013
52019
|
description: "\u6B64\u6AA2\u67E5\u9EDE\u5305\u542B",
|
|
52014
52020
|
filesCount: "{count} \u500B\u6A94\u6848\u5C07\u88AB\u56DE\u6EFE",
|
|
52015
52021
|
filesCountWithSelection: "{count} \u500B\u6A94\u6848\u5C07\u88AB\u56DE\u6EFE ({selected}/{total} \u5DF2\u9078\u64C7)",
|
|
@@ -95688,7 +95694,7 @@ var require_import_in_the_middle = __commonJS({
|
|
|
95688
95694
|
"node_modules/import-in-the-middle/index.js"(exports2, module2) {
|
|
95689
95695
|
var path68 = __require("path");
|
|
95690
95696
|
var moduleDetailsFromPath = require_module_details_from_path();
|
|
95691
|
-
var { fileURLToPath:
|
|
95697
|
+
var { fileURLToPath: fileURLToPath8 } = __require("url");
|
|
95692
95698
|
var { MessageChannel: MessageChannel2 } = __require("worker_threads");
|
|
95693
95699
|
var { isBuiltin } = __require("module");
|
|
95694
95700
|
if (!isBuiltin) {
|
|
@@ -95782,7 +95788,7 @@ var require_import_in_the_middle = __commonJS({
|
|
|
95782
95788
|
const stackTraceLimit = Error.stackTraceLimit;
|
|
95783
95789
|
Error.stackTraceLimit = 0;
|
|
95784
95790
|
try {
|
|
95785
|
-
filePath =
|
|
95791
|
+
filePath = fileURLToPath8(name);
|
|
95786
95792
|
name = filePath;
|
|
95787
95793
|
} catch (e) {
|
|
95788
95794
|
}
|
|
@@ -131276,9 +131282,9 @@ var init_logger = __esm({
|
|
|
131276
131282
|
rotateLog(filePath) {
|
|
131277
131283
|
const timestamp = Date.now();
|
|
131278
131284
|
const ext = path10.extname(filePath);
|
|
131279
|
-
const
|
|
131280
|
-
const
|
|
131281
|
-
const rotatedPath = path10.join(
|
|
131285
|
+
const basename10 = path10.basename(filePath, ext);
|
|
131286
|
+
const dirname14 = path10.dirname(filePath);
|
|
131287
|
+
const rotatedPath = path10.join(dirname14, `${basename10}-${timestamp}${ext}`);
|
|
131282
131288
|
fs9.renameSync(filePath, rotatedPath);
|
|
131283
131289
|
}
|
|
131284
131290
|
writeLog(level, message, meta) {
|
|
@@ -145763,7 +145769,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
145763
145769
|
"node_modules/undici/lib/mock/snapshot-recorder.js"(exports2, module2) {
|
|
145764
145770
|
"use strict";
|
|
145765
145771
|
var { writeFile: writeFile6, readFile: readFile6, mkdir: mkdir6 } = __require("node:fs/promises");
|
|
145766
|
-
var { dirname:
|
|
145772
|
+
var { dirname: dirname14, resolve: resolve15 } = __require("node:path");
|
|
145767
145773
|
var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("node:timers");
|
|
145768
145774
|
var { InvalidArgumentError, UndiciError } = require_errors3();
|
|
145769
145775
|
var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
|
|
@@ -145987,7 +145993,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
145987
145993
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
145988
145994
|
}
|
|
145989
145995
|
const resolvedPath = resolve15(path68);
|
|
145990
|
-
await mkdir6(
|
|
145996
|
+
await mkdir6(dirname14(resolvedPath), { recursive: true });
|
|
145991
145997
|
const data = Array.from(this.#snapshots.entries()).map(([hash, snapshot]) => ({
|
|
145992
145998
|
hash,
|
|
145993
145999
|
snapshot
|
|
@@ -285588,7 +285594,7 @@ ${frame}`;
|
|
|
285588
285594
|
let index = 0;
|
|
285589
285595
|
let depth = 0;
|
|
285590
285596
|
let value;
|
|
285591
|
-
let
|
|
285597
|
+
let memo12 = {};
|
|
285592
285598
|
const advance = () => input2[index++];
|
|
285593
285599
|
const push2 = (node) => {
|
|
285594
285600
|
if (node.type === "text" && prev.type === "dot") {
|
|
@@ -295016,8 +295022,8 @@ ${fromBody}`;
|
|
|
295016
295022
|
}
|
|
295017
295023
|
exports22.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
295018
295024
|
function isAffectDepthOfReadingPattern(pattern) {
|
|
295019
|
-
const
|
|
295020
|
-
return endsWithSlashGlobStar(pattern) || isStaticPattern(
|
|
295025
|
+
const basename10 = path68.basename(pattern);
|
|
295026
|
+
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename10);
|
|
295021
295027
|
}
|
|
295022
295028
|
exports22.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
295023
295029
|
function expandPatternsWithBraceExpansion(patterns) {
|
|
@@ -326583,13 +326589,13 @@ var init_after = __esm({
|
|
|
326583
326589
|
|
|
326584
326590
|
// node_modules/underscore/modules/before.js
|
|
326585
326591
|
function before(times2, func) {
|
|
326586
|
-
var
|
|
326592
|
+
var memo12;
|
|
326587
326593
|
return function() {
|
|
326588
326594
|
if (--times2 > 0) {
|
|
326589
|
-
|
|
326595
|
+
memo12 = func.apply(this, arguments);
|
|
326590
326596
|
}
|
|
326591
326597
|
if (times2 <= 1) func = null;
|
|
326592
|
-
return
|
|
326598
|
+
return memo12;
|
|
326593
326599
|
};
|
|
326594
326600
|
}
|
|
326595
326601
|
var init_before = __esm({
|
|
@@ -326801,21 +326807,21 @@ var init_map = __esm({
|
|
|
326801
326807
|
|
|
326802
326808
|
// node_modules/underscore/modules/_createReduce.js
|
|
326803
326809
|
function createReduce(dir) {
|
|
326804
|
-
var reducer2 = function(obj2, iteratee2,
|
|
326810
|
+
var reducer2 = function(obj2, iteratee2, memo12, initial2) {
|
|
326805
326811
|
var _keys = !isArrayLike_default(obj2) && keys(obj2), length = (_keys || obj2).length, index = dir > 0 ? 0 : length - 1;
|
|
326806
326812
|
if (!initial2) {
|
|
326807
|
-
|
|
326813
|
+
memo12 = obj2[_keys ? _keys[index] : index];
|
|
326808
326814
|
index += dir;
|
|
326809
326815
|
}
|
|
326810
326816
|
for (; index >= 0 && index < length; index += dir) {
|
|
326811
326817
|
var currentKey = _keys ? _keys[index] : index;
|
|
326812
|
-
|
|
326818
|
+
memo12 = iteratee2(memo12, obj2[currentKey], currentKey, obj2);
|
|
326813
326819
|
}
|
|
326814
|
-
return
|
|
326820
|
+
return memo12;
|
|
326815
326821
|
};
|
|
326816
|
-
return function(obj2, iteratee2,
|
|
326822
|
+
return function(obj2, iteratee2, memo12, context3) {
|
|
326817
326823
|
var initial2 = arguments.length >= 3;
|
|
326818
|
-
return reducer2(obj2, optimizeCb(iteratee2, context3, 4),
|
|
326824
|
+
return reducer2(obj2, optimizeCb(iteratee2, context3, 4), memo12, initial2);
|
|
326819
326825
|
};
|
|
326820
326826
|
}
|
|
326821
326827
|
var init_createReduce = __esm({
|
|
@@ -352643,7 +352649,7 @@ var require_files = __commonJS({
|
|
|
352643
352649
|
var fs61 = __require("fs");
|
|
352644
352650
|
var url2 = __require("url");
|
|
352645
352651
|
var os30 = __require("os");
|
|
352646
|
-
var
|
|
352652
|
+
var dirname14 = __require("path").dirname;
|
|
352647
352653
|
var resolvePath = __require("path").resolve;
|
|
352648
352654
|
var isAbsolutePath = require_path_is_absolute();
|
|
352649
352655
|
var promises2 = require_promises();
|
|
@@ -352658,7 +352664,7 @@ var require_files = __commonJS({
|
|
|
352658
352664
|
}
|
|
352659
352665
|
};
|
|
352660
352666
|
}
|
|
352661
|
-
var base = options3.relativeToFile ?
|
|
352667
|
+
var base = options3.relativeToFile ? dirname14(options3.relativeToFile) : null;
|
|
352662
352668
|
function read2(uri, encoding) {
|
|
352663
352669
|
return resolveUri(uri).then(function(path68) {
|
|
352664
352670
|
return readFile6(path68, encoding).caught(function(error42) {
|
|
@@ -354342,9 +354348,9 @@ var require_rules2 = __commonJS({
|
|
|
354342
354348
|
exports2.sequence = function() {
|
|
354343
354349
|
var parsers = Array.prototype.slice.call(arguments, 0);
|
|
354344
354350
|
var rule = function(input2) {
|
|
354345
|
-
var result2 = _3.foldl(parsers, function(
|
|
354346
|
-
var result3 =
|
|
354347
|
-
var hasCut =
|
|
354351
|
+
var result2 = _3.foldl(parsers, function(memo12, parser3) {
|
|
354352
|
+
var result3 = memo12.result;
|
|
354353
|
+
var hasCut = memo12.hasCut;
|
|
354348
354354
|
if (!result3.isSuccess()) {
|
|
354349
354355
|
return { result: result3, hasCut };
|
|
354350
354356
|
}
|
|
@@ -360580,8 +360586,8 @@ var require_xlsx = __commonJS({
|
|
|
360580
360586
|
}
|
|
360581
360587
|
return L.length - R.length;
|
|
360582
360588
|
}
|
|
360583
|
-
function
|
|
360584
|
-
if (p.charAt(p.length - 1) == "/") return p.slice(0, -1).indexOf("/") === -1 ? p :
|
|
360589
|
+
function dirname14(p) {
|
|
360590
|
+
if (p.charAt(p.length - 1) == "/") return p.slice(0, -1).indexOf("/") === -1 ? p : dirname14(p.slice(0, -1));
|
|
360585
360591
|
var c = p.lastIndexOf("/");
|
|
360586
360592
|
return c === -1 ? p : p.slice(0, c + 1);
|
|
360587
360593
|
}
|
|
@@ -361002,7 +361008,7 @@ var require_xlsx = __commonJS({
|
|
|
361002
361008
|
data.push([cfb.FullPaths[i2], cfb.FileIndex[i2]]);
|
|
361003
361009
|
}
|
|
361004
361010
|
for (i2 = 0; i2 < data.length; ++i2) {
|
|
361005
|
-
var dad =
|
|
361011
|
+
var dad = dirname14(data[i2][0]);
|
|
361006
361012
|
s = fullPaths[dad];
|
|
361007
361013
|
if (!s) {
|
|
361008
361014
|
data.push([dad, {
|
|
@@ -361038,13 +361044,13 @@ var require_xlsx = __commonJS({
|
|
|
361038
361044
|
elt.size = 0;
|
|
361039
361045
|
elt.type = 5;
|
|
361040
361046
|
} else if (nm.slice(-1) == "/") {
|
|
361041
|
-
for (j = i2 + 1; j < data.length; ++j) if (
|
|
361047
|
+
for (j = i2 + 1; j < data.length; ++j) if (dirname14(cfb.FullPaths[j]) == nm) break;
|
|
361042
361048
|
elt.C = j >= data.length ? -1 : j;
|
|
361043
|
-
for (j = i2 + 1; j < data.length; ++j) if (
|
|
361049
|
+
for (j = i2 + 1; j < data.length; ++j) if (dirname14(cfb.FullPaths[j]) == dirname14(nm)) break;
|
|
361044
361050
|
elt.R = j >= data.length ? -1 : j;
|
|
361045
361051
|
elt.type = 1;
|
|
361046
361052
|
} else {
|
|
361047
|
-
if (
|
|
361053
|
+
if (dirname14(cfb.FullPaths[i2 + 1] || "") == dirname14(nm)) elt.R = i2 + 1;
|
|
361048
361054
|
elt.type = 2;
|
|
361049
361055
|
}
|
|
361050
361056
|
}
|
|
@@ -366916,7 +366922,7 @@ var require_xlsx = __commonJS({
|
|
|
366916
366922
|
}
|
|
366917
366923
|
prep_blob(d, 0);
|
|
366918
366924
|
var ft = d.read_shift(1);
|
|
366919
|
-
var
|
|
366925
|
+
var memo12 = !!(ft & 136);
|
|
366920
366926
|
var vfp = false, l7 = false;
|
|
366921
366927
|
switch (ft) {
|
|
366922
366928
|
case 2:
|
|
@@ -366927,12 +366933,12 @@ var require_xlsx = __commonJS({
|
|
|
366927
366933
|
// dBASE III
|
|
366928
366934
|
case 48:
|
|
366929
366935
|
vfp = true;
|
|
366930
|
-
|
|
366936
|
+
memo12 = true;
|
|
366931
366937
|
break;
|
|
366932
366938
|
// VFP
|
|
366933
366939
|
case 49:
|
|
366934
366940
|
vfp = true;
|
|
366935
|
-
|
|
366941
|
+
memo12 = true;
|
|
366936
366942
|
break;
|
|
366937
366943
|
// VFP with autoincrement
|
|
366938
366944
|
// 0x43 dBASE IV SQL table files
|
|
@@ -367076,7 +367082,7 @@ var require_xlsx = __commonJS({
|
|
|
367076
367082
|
}
|
|
367077
367083
|
break;
|
|
367078
367084
|
case "M":
|
|
367079
|
-
if (!
|
|
367085
|
+
if (!memo12) throw new Error("DBF Unexpected MEMO for type " + ft.toString(16));
|
|
367080
367086
|
out[R][C] = "##MEMO##" + (l7 ? parseInt(s.trim(), 10) : dd.read_shift(4));
|
|
367081
367087
|
break;
|
|
367082
367088
|
case "N":
|
|
@@ -422263,6 +422269,41 @@ ${exportList}`);
|
|
|
422263
422269
|
* @throws Error if file creation fails
|
|
422264
422270
|
*/
|
|
422265
422271
|
async createFile(filePath, content, createDirectories = true, overwrite = false) {
|
|
422272
|
+
if (Array.isArray(filePath)) {
|
|
422273
|
+
return await executeBatchOperation(filePath, (fileItem) => {
|
|
422274
|
+
if (typeof fileItem === "string") {
|
|
422275
|
+
if (content === void 0) {
|
|
422276
|
+
throw new Error("content is required when filePath is an array of strings");
|
|
422277
|
+
}
|
|
422278
|
+
return {
|
|
422279
|
+
path: fileItem,
|
|
422280
|
+
content,
|
|
422281
|
+
createDirectories,
|
|
422282
|
+
overwrite
|
|
422283
|
+
};
|
|
422284
|
+
}
|
|
422285
|
+
return {
|
|
422286
|
+
path: fileItem.path,
|
|
422287
|
+
content: fileItem.content,
|
|
422288
|
+
createDirectories: fileItem.createDirectories ?? createDirectories,
|
|
422289
|
+
overwrite: fileItem.overwrite ?? overwrite
|
|
422290
|
+
};
|
|
422291
|
+
}, (path68, fileContent, fileCreateDirs, fileOverwrite) => this.createFileSingle(path68, fileContent, fileCreateDirs, fileOverwrite), (path68, result2) => ({
|
|
422292
|
+
path: path68,
|
|
422293
|
+
content: result2.content
|
|
422294
|
+
}));
|
|
422295
|
+
}
|
|
422296
|
+
if (content === void 0 || content === null) {
|
|
422297
|
+
throw new Error("content is required for single file mode");
|
|
422298
|
+
}
|
|
422299
|
+
const singleResult = await this.createFileSingle(filePath, content, createDirectories, overwrite);
|
|
422300
|
+
return singleResult.message;
|
|
422301
|
+
}
|
|
422302
|
+
/**
|
|
422303
|
+
* Internal method: Create a single file
|
|
422304
|
+
* @private
|
|
422305
|
+
*/
|
|
422306
|
+
async createFileSingle(filePath, content, createDirectories = true, overwrite = false) {
|
|
422266
422307
|
try {
|
|
422267
422308
|
const fullPath = this.resolvePath(filePath);
|
|
422268
422309
|
let fileExisted = false;
|
|
@@ -422298,7 +422339,7 @@ ${exportList}`);
|
|
|
422298
422339
|
}
|
|
422299
422340
|
} catch {
|
|
422300
422341
|
}
|
|
422301
|
-
return message;
|
|
422342
|
+
return { message, filePath, content };
|
|
422302
422343
|
} catch (error42) {
|
|
422303
422344
|
throw new Error(`Failed to create file ${filePath}: ${error42 instanceof Error ? error42.message : "Unknown error"}`);
|
|
422304
422345
|
}
|
|
@@ -422533,17 +422574,47 @@ ${exportList}`);
|
|
|
422533
422574
|
},
|
|
422534
422575
|
{
|
|
422535
422576
|
name: "filesystem-create",
|
|
422536
|
-
description: 'Create a new file with content. **PATH REQUIREMENT**: Use EXACT non-empty string path, never undefined/null/empty/placeholders like "path/to/file". Set `overwrite` to true to replace an existing file (original content is backed up for rollback). Automatically creates parent directories.',
|
|
422577
|
+
description: 'Create a new file with content. **PATH REQUIREMENT**: Use EXACT non-empty string path, never undefined/null/empty/placeholders like "path/to/file". Set `overwrite` to true to replace an existing file (original content is backed up for rollback). Automatically creates parent directories. **BATCH**: `filePath` may be a string (single file with top-level `content`), or an array of `{path, content, overwrite?, createDirectories?}` objects for batch creation.',
|
|
422537
422578
|
inputSchema: {
|
|
422538
422579
|
type: "object",
|
|
422539
422580
|
properties: {
|
|
422540
422581
|
filePath: {
|
|
422541
|
-
|
|
422542
|
-
|
|
422582
|
+
oneOf: [
|
|
422583
|
+
{
|
|
422584
|
+
type: "string",
|
|
422585
|
+
description: "Path where the file should be created"
|
|
422586
|
+
},
|
|
422587
|
+
{
|
|
422588
|
+
type: "array",
|
|
422589
|
+
items: {
|
|
422590
|
+
type: "object",
|
|
422591
|
+
properties: {
|
|
422592
|
+
path: {
|
|
422593
|
+
type: "string",
|
|
422594
|
+
description: "Path where the file should be created"
|
|
422595
|
+
},
|
|
422596
|
+
content: {
|
|
422597
|
+
type: "string",
|
|
422598
|
+
description: "Content to write to the file"
|
|
422599
|
+
},
|
|
422600
|
+
overwrite: {
|
|
422601
|
+
type: "boolean",
|
|
422602
|
+
description: "Whether to overwrite the file if it already exists"
|
|
422603
|
+
},
|
|
422604
|
+
createDirectories: {
|
|
422605
|
+
type: "boolean",
|
|
422606
|
+
description: "Whether to create parent directories if they don't exist"
|
|
422607
|
+
}
|
|
422608
|
+
},
|
|
422609
|
+
required: ["path", "content"]
|
|
422610
|
+
},
|
|
422611
|
+
description: "Array of file configs for batch creation"
|
|
422612
|
+
}
|
|
422613
|
+
]
|
|
422543
422614
|
},
|
|
422544
422615
|
content: {
|
|
422545
422616
|
type: "string",
|
|
422546
|
-
description: "Content to write to the file"
|
|
422617
|
+
description: "Content to write to the file (required for single file mode; ignored in batch mode where each item has its own content)"
|
|
422547
422618
|
},
|
|
422548
422619
|
overwrite: {
|
|
422549
422620
|
type: "boolean",
|
|
@@ -422555,7 +422626,7 @@ ${exportList}`);
|
|
|
422555
422626
|
default: true
|
|
422556
422627
|
}
|
|
422557
422628
|
},
|
|
422558
|
-
required: ["filePath", "
|
|
422629
|
+
required: ["filePath", "overwrite"]
|
|
422559
422630
|
}
|
|
422560
422631
|
},
|
|
422561
422632
|
{
|
|
@@ -422680,12 +422751,7 @@ ${exportList}`);
|
|
|
422680
422751
|
description: 'New content to write (for replace and insert_after). Pass empty string "" for delete. Do NOT include line numbers or hashes.'
|
|
422681
422752
|
}
|
|
422682
422753
|
},
|
|
422683
|
-
required: [
|
|
422684
|
-
"type",
|
|
422685
|
-
"startAnchor",
|
|
422686
|
-
"endAnchor",
|
|
422687
|
-
"content"
|
|
422688
|
-
]
|
|
422754
|
+
required: ["type", "startAnchor", "endAnchor", "content"]
|
|
422689
422755
|
},
|
|
422690
422756
|
description: "Array of edit operations for this file"
|
|
422691
422757
|
}
|
|
@@ -498155,10 +498221,10 @@ var require_tiktoken = __commonJS({
|
|
|
498155
498221
|
imports["./tiktoken_bg.js"] = wasm;
|
|
498156
498222
|
var path68 = __require("path");
|
|
498157
498223
|
var fs61 = __require("fs");
|
|
498158
|
-
var candidates = __dirname.split(path68.sep).reduce((
|
|
498224
|
+
var candidates = __dirname.split(path68.sep).reduce((memo12, _3, index, array2) => {
|
|
498159
498225
|
const prefix = array2.slice(0, index + 1).join(path68.sep) + path68.sep;
|
|
498160
498226
|
if (!prefix.includes("node_modules" + path68.sep)) {
|
|
498161
|
-
|
|
498227
|
+
memo12.unshift(
|
|
498162
498228
|
path68.join(
|
|
498163
498229
|
prefix,
|
|
498164
498230
|
"node_modules",
|
|
@@ -498168,7 +498234,7 @@ var require_tiktoken = __commonJS({
|
|
|
498168
498234
|
)
|
|
498169
498235
|
);
|
|
498170
498236
|
}
|
|
498171
|
-
return
|
|
498237
|
+
return memo12;
|
|
498172
498238
|
}, []);
|
|
498173
498239
|
candidates.unshift(path68.join(__dirname, "./tiktoken_bg.wasm"));
|
|
498174
498240
|
var bytes = null;
|
|
@@ -506595,7 +506661,8 @@ ${plan}`);
|
|
|
506595
506661
|
// dist/utils/execution/agentChildProcess.js
|
|
506596
506662
|
import { fork } from "node:child_process";
|
|
506597
506663
|
import { existsSync as existsSync18 } from "node:fs";
|
|
506598
|
-
import { resolve as resolve9 } from "node:path";
|
|
506664
|
+
import { basename as basename4, dirname as dirname7, resolve as resolve9 } from "node:path";
|
|
506665
|
+
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
506599
506666
|
function buildChildPayloadWithConversationContext(payload) {
|
|
506600
506667
|
const conversationContext = getConversationContext();
|
|
506601
506668
|
if (!conversationContext) {
|
|
@@ -506604,14 +506671,20 @@ function buildChildPayloadWithConversationContext(payload) {
|
|
|
506604
506671
|
return { ...payload, conversationContext };
|
|
506605
506672
|
}
|
|
506606
506673
|
function getCliEntryPath() {
|
|
506674
|
+
const moduleFile = fileURLToPath6(import.meta.url);
|
|
506675
|
+
const moduleDir = dirname7(moduleFile);
|
|
506676
|
+
const devEntry = resolve9(moduleDir, "..", "..", "cli.js");
|
|
506677
|
+
if (moduleFile.endsWith(".js") && existsSync18(devEntry)) {
|
|
506678
|
+
return devEntry;
|
|
506679
|
+
}
|
|
506680
|
+
const moduleBaseName = basename4(moduleFile);
|
|
506681
|
+
if ((moduleBaseName === "cli.mjs" || moduleBaseName === "cli.js") && existsSync18(moduleFile)) {
|
|
506682
|
+
return moduleFile;
|
|
506683
|
+
}
|
|
506607
506684
|
const argvEntry = process.argv[1];
|
|
506608
506685
|
if (argvEntry && existsSync18(argvEntry)) {
|
|
506609
506686
|
return argvEntry;
|
|
506610
506687
|
}
|
|
506611
|
-
const fallback = resolve9(process.cwd(), "dist/cli.js");
|
|
506612
|
-
if (existsSync18(fallback)) {
|
|
506613
|
-
return fallback;
|
|
506614
|
-
}
|
|
506615
506688
|
throw new Error("Unable to locate Snow CLI entrypoint for child-process agent execution");
|
|
506616
506689
|
}
|
|
506617
506690
|
function safeSend(child, message) {
|
|
@@ -506760,7 +506833,7 @@ async function runAgentChildProcess(options3) {
|
|
|
506760
506833
|
abortKillTimer = setTimeout(() => {
|
|
506761
506834
|
if (!child.killed)
|
|
506762
506835
|
child.kill("SIGTERM");
|
|
506763
|
-
},
|
|
506836
|
+
}, 5e3);
|
|
506764
506837
|
};
|
|
506765
506838
|
if ((_a20 = options3.abortSignal) == null ? void 0 : _a20.aborted) {
|
|
506766
506839
|
abortChild();
|
|
@@ -506812,6 +506885,10 @@ async function runAgentChildProcess(options3) {
|
|
|
506812
506885
|
if (settled)
|
|
506813
506886
|
return;
|
|
506814
506887
|
const aborted2 = (_a21 = options3.abortSignal) == null ? void 0 : _a21.aborted;
|
|
506888
|
+
if (aborted2 && options3.abortResult !== void 0) {
|
|
506889
|
+
finish(() => resolvePromise(options3.abortResult));
|
|
506890
|
+
return;
|
|
506891
|
+
}
|
|
506815
506892
|
const details = stderr.trim() ? `
|
|
506816
506893
|
Child stderr:
|
|
506817
506894
|
${stderr.trim()}` : "";
|
|
@@ -506861,7 +506938,11 @@ async function executeTeammateInChildProcess(memberId, memberName, prompt, workt
|
|
|
506861
506938
|
addToAlwaysApproved: options3.addToAlwaysApproved,
|
|
506862
506939
|
requestUserQuestion: options3.requestUserQuestion,
|
|
506863
506940
|
messagePump: createTeammateMessagePump(instanceId),
|
|
506864
|
-
abortErrorMessage: "Teammate execution aborted"
|
|
506941
|
+
abortErrorMessage: "Teammate execution aborted",
|
|
506942
|
+
abortResult: {
|
|
506943
|
+
success: true,
|
|
506944
|
+
result: ""
|
|
506945
|
+
}
|
|
506865
506946
|
});
|
|
506866
506947
|
}
|
|
506867
506948
|
var init_agentChildProcess = __esm({
|
|
@@ -508638,7 +508719,7 @@ __export(teamTaskList_exports, {
|
|
|
508638
508719
|
updateTaskStatus: () => updateTaskStatus
|
|
508639
508720
|
});
|
|
508640
508721
|
import { existsSync as existsSync21, mkdirSync as mkdirSync11, readFileSync as readFileSync18, writeFileSync as writeFileSync11, renameSync } from "fs";
|
|
508641
|
-
import { join as join21, dirname as
|
|
508722
|
+
import { join as join21, dirname as dirname8 } from "path";
|
|
508642
508723
|
import { homedir as homedir11 } from "os";
|
|
508643
508724
|
import { randomUUID as randomUUID6 } from "crypto";
|
|
508644
508725
|
function getTaskListPath(teamName) {
|
|
@@ -508662,7 +508743,7 @@ function readTaskList(teamName) {
|
|
|
508662
508743
|
}
|
|
508663
508744
|
function writeTaskList(teamName, data) {
|
|
508664
508745
|
const filePath = getTaskListPath(teamName);
|
|
508665
|
-
ensureDir4(
|
|
508746
|
+
ensureDir4(dirname8(filePath));
|
|
508666
508747
|
const tmpPath = filePath + ".tmp." + process.pid;
|
|
508667
508748
|
data.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
508668
508749
|
writeFileSync11(tmpPath, JSON.stringify(data, null, 2));
|
|
@@ -509431,7 +509512,7 @@ function isFilesystemEditDiffData(value) {
|
|
|
509431
509512
|
return typeof data["oldContent"] === "string" && typeof data["newContent"] === "string" || Array.isArray(data["batchResults"]);
|
|
509432
509513
|
}
|
|
509433
509514
|
function extractFilesystemEditDiffFromRawResult(toolName, toolResult) {
|
|
509434
|
-
if (toolName !== "filesystem-edit" && toolName !== "filesystem-replaceedit") {
|
|
509515
|
+
if (toolName !== "filesystem-edit" && toolName !== "filesystem-replaceedit" && toolName !== "filesystem-create") {
|
|
509435
509516
|
return void 0;
|
|
509436
509517
|
}
|
|
509437
509518
|
if (!toolResult || typeof toolResult !== "object") {
|
|
@@ -509473,7 +509554,7 @@ function extractFilesystemEditDiffFromRawResult(toolName, toolResult) {
|
|
|
509473
509554
|
return void 0;
|
|
509474
509555
|
}
|
|
509475
509556
|
function extractFilesystemEditDiffDataForPersistence(toolName, content) {
|
|
509476
|
-
if (toolName !== "filesystem-edit" && toolName !== "filesystem-replaceedit" || content.startsWith("Error:")) {
|
|
509557
|
+
if (toolName !== "filesystem-edit" && toolName !== "filesystem-replaceedit" && toolName !== "filesystem-create" || content.startsWith("Error:")) {
|
|
509477
509558
|
return void 0;
|
|
509478
509559
|
}
|
|
509479
509560
|
try {
|
|
@@ -509846,59 +509927,10 @@ var init_subAgentMessageHandler = __esm({
|
|
|
509846
509927
|
this.updateGlobalTokenCount();
|
|
509847
509928
|
state.lastTokenFlushTime = now;
|
|
509848
509929
|
}
|
|
509849
|
-
emitStreamLine(
|
|
509930
|
+
emitStreamLine(_lines, _state, _subAgentMessage, _content, _isThinking) {
|
|
509850
509931
|
if (!this.streamingEnabled)
|
|
509851
509932
|
return;
|
|
509852
|
-
|
|
509853
|
-
const isFirstContent = !isThinking && !state.hasStartedContent;
|
|
509854
|
-
if (isFirst)
|
|
509855
|
-
state.isFirstStreamLine = false;
|
|
509856
|
-
if (isFirstContent)
|
|
509857
|
-
state.hasStartedContent = true;
|
|
509858
|
-
state.hasEmittedStreamLine = true;
|
|
509859
|
-
const msg = {
|
|
509860
|
-
role: "assistant",
|
|
509861
|
-
content,
|
|
509862
|
-
streamingLine: true,
|
|
509863
|
-
isThinkingLine: isThinking,
|
|
509864
|
-
isFirstStreamLine: isFirst,
|
|
509865
|
-
isFirstContentLine: isFirstContent,
|
|
509866
|
-
subAgent: {
|
|
509867
|
-
agentId: subAgentMessage.agentId,
|
|
509868
|
-
agentName: subAgentMessage.agentName,
|
|
509869
|
-
isComplete: false
|
|
509870
|
-
},
|
|
509871
|
-
subAgentInternal: true
|
|
509872
|
-
};
|
|
509873
|
-
const agentId = subAgentMessage.agentId;
|
|
509874
|
-
if (this.activeDisplayAgentId === null) {
|
|
509875
|
-
this.activeDisplayAgentId = agentId;
|
|
509876
|
-
this.emitAgentTitle(lines, subAgentMessage);
|
|
509877
|
-
lines.push(msg);
|
|
509878
|
-
} else if (agentId === this.activeDisplayAgentId) {
|
|
509879
|
-
lines.push(msg);
|
|
509880
|
-
} else {
|
|
509881
|
-
if (!this.displayQueue.includes(agentId)) {
|
|
509882
|
-
this.displayQueue.push(agentId);
|
|
509883
|
-
}
|
|
509884
|
-
const buf = this.bufferedStreamLines.get(agentId) || [];
|
|
509885
|
-
buf.push(msg);
|
|
509886
|
-
this.bufferedStreamLines.set(agentId, buf);
|
|
509887
|
-
}
|
|
509888
|
-
}
|
|
509889
|
-
emitAgentTitle(lines, subAgentMessage) {
|
|
509890
|
-
const name = subAgentMessage.agentName;
|
|
509891
|
-
lines.push({
|
|
509892
|
-
role: "subagent",
|
|
509893
|
-
content: `\x1B[36m\u2687 ${name}\x1B[0m`,
|
|
509894
|
-
streaming: false,
|
|
509895
|
-
subAgent: {
|
|
509896
|
-
agentId: subAgentMessage.agentId,
|
|
509897
|
-
agentName: name,
|
|
509898
|
-
isComplete: false
|
|
509899
|
-
},
|
|
509900
|
-
subAgentInternal: true
|
|
509901
|
-
});
|
|
509933
|
+
return;
|
|
509902
509934
|
}
|
|
509903
509935
|
/**
|
|
509904
509936
|
* When the active display agent finishes, flush the next queued agent(s).
|
|
@@ -510081,17 +510113,7 @@ var init_subAgentMessageHandler = __esm({
|
|
|
510081
510113
|
if (state.hasReceivedContentChunk || !this.streamingEnabled) {
|
|
510082
510114
|
return prev;
|
|
510083
510115
|
}
|
|
510084
|
-
|
|
510085
|
-
state.thinkingLineBuffer += incomingDelta;
|
|
510086
|
-
const thinkLines = state.thinkingLineBuffer.split("\n");
|
|
510087
|
-
for (let i = 0; i < thinkLines.length - 1; i++) {
|
|
510088
|
-
const cleaned = this.cleanThinkingContent(thinkLines[i] ?? "");
|
|
510089
|
-
if (cleaned || state.hasEmittedStreamLine) {
|
|
510090
|
-
this.emitStreamLine(newLines, state, subAgentMessage, cleaned, true);
|
|
510091
|
-
}
|
|
510092
|
-
}
|
|
510093
|
-
state.thinkingLineBuffer = thinkLines[thinkLines.length - 1] ?? "";
|
|
510094
|
-
return newLines.length > 0 ? [...prev, ...newLines] : prev;
|
|
510116
|
+
return prev;
|
|
510095
510117
|
}
|
|
510096
510118
|
handleToolCallDelta(prev, subAgentMessage) {
|
|
510097
510119
|
const state = this.getStreamState(subAgentMessage.agentId);
|
|
@@ -510430,7 +510452,7 @@ var init_subAgentMessageHandler = __esm({
|
|
|
510430
510452
|
}
|
|
510431
510453
|
let fileToolData;
|
|
510432
510454
|
if (!isError2 && (msg.tool_name === "filesystem-create" || msg.tool_name === "filesystem-edit" || msg.tool_name === "filesystem-replaceedit")) {
|
|
510433
|
-
if (msg.editDiffData && (typeof msg.editDiffData.oldContent === "string" || Array.isArray(msg.editDiffData.batchResults))) {
|
|
510455
|
+
if (msg.editDiffData && (typeof msg.editDiffData.oldContent === "string" || typeof msg.editDiffData.content === "string" || Array.isArray(msg.editDiffData.batchResults))) {
|
|
510434
510456
|
fileToolData = {
|
|
510435
510457
|
name: msg.tool_name,
|
|
510436
510458
|
arguments: msg.editDiffData
|
|
@@ -510512,22 +510534,11 @@ var init_subAgentMessageHandler = __esm({
|
|
|
510512
510534
|
if (this.shouldFlush(state, now)) {
|
|
510513
510535
|
this.flushTokenCount(subAgentMessage.agentId, now);
|
|
510514
510536
|
}
|
|
510515
|
-
const isFirstContentChunk = !state.hasReceivedContentChunk;
|
|
510516
510537
|
state.hasReceivedContentChunk = true;
|
|
510517
510538
|
if (!this.streamingEnabled) {
|
|
510518
510539
|
return prev;
|
|
510519
510540
|
}
|
|
510520
|
-
|
|
510521
|
-
if (isFirstContentChunk) {
|
|
510522
|
-
this.flushThinkingBuffer(state, newLines, subAgentMessage);
|
|
510523
|
-
}
|
|
510524
|
-
state.contentLineBuffer += incomingContent;
|
|
510525
|
-
const contentLines = state.contentLineBuffer.split("\n");
|
|
510526
|
-
for (let i = 0; i < contentLines.length - 1; i++) {
|
|
510527
|
-
this.processContentLine(state, newLines, contentLines[i] ?? "", subAgentMessage);
|
|
510528
|
-
}
|
|
510529
|
-
state.contentLineBuffer = contentLines[contentLines.length - 1] ?? "";
|
|
510530
|
-
return newLines.length > 0 ? [...prev, ...newLines] : prev;
|
|
510541
|
+
return prev;
|
|
510531
510542
|
}
|
|
510532
510543
|
handleDone(prev, subAgentMessage) {
|
|
510533
510544
|
const state = this.getStreamState(subAgentMessage.agentId);
|
|
@@ -515122,7 +515133,7 @@ __export(skills_exports, {
|
|
|
515122
515133
|
listAvailableSkills: () => listAvailableSkills,
|
|
515123
515134
|
mcpTools: () => mcpTools11
|
|
515124
515135
|
});
|
|
515125
|
-
import { dirname as
|
|
515136
|
+
import { dirname as dirname9, join as join24, relative as relative7 } from "path";
|
|
515126
515137
|
import { existsSync as existsSync25 } from "fs";
|
|
515127
515138
|
import { readFile } from "fs/promises";
|
|
515128
515139
|
import { homedir as homedir13 } from "os";
|
|
@@ -515197,7 +515208,7 @@ async function loadSkillsFromDirectory(skills, baseSkillsDir, location, source2
|
|
|
515197
515208
|
continue;
|
|
515198
515209
|
}
|
|
515199
515210
|
const skillFile = join24(currentDir, entry.name);
|
|
515200
|
-
const skillDir =
|
|
515211
|
+
const skillDir = dirname9(skillFile);
|
|
515201
515212
|
const rawSkillId = relative7(baseSkillsDir, skillDir);
|
|
515202
515213
|
const skillId = normalizeSkillId(rawSkillId);
|
|
515203
515214
|
if (!skillId || skillId === ".") {
|
|
@@ -520605,6 +520616,10 @@ function stripFilesystemDiffPayload(result2) {
|
|
|
520605
520616
|
const { oldContent: _oldContent, newContent: _newContent, completeOldContent: _completeOldContent, completeNewContent: _completeNewContent, replacedContent: _replacedContent, ...rest2 } = result2;
|
|
520606
520617
|
return rest2;
|
|
520607
520618
|
}
|
|
520619
|
+
if (result2.content !== void 0 && result2.message !== void 0) {
|
|
520620
|
+
const { content: _content, ...rest2 } = result2;
|
|
520621
|
+
return rest2;
|
|
520622
|
+
}
|
|
520608
520623
|
if (Array.isArray(result2.results)) {
|
|
520609
520624
|
return {
|
|
520610
520625
|
...result2,
|
|
@@ -520612,7 +520627,7 @@ function stripFilesystemDiffPayload(result2) {
|
|
|
520612
520627
|
if (!item || typeof item !== "object") {
|
|
520613
520628
|
return item;
|
|
520614
520629
|
}
|
|
520615
|
-
const { oldContent: _oldContent, newContent: _newContent, completeOldContent: _completeOldContent, completeNewContent: _completeNewContent, replacedContent: _replacedContent, ...rest2 } = item;
|
|
520630
|
+
const { oldContent: _oldContent, newContent: _newContent, completeOldContent: _completeOldContent, completeNewContent: _completeNewContent, replacedContent: _replacedContent, content: _content, ...rest2 } = item;
|
|
520616
520631
|
return rest2;
|
|
520617
520632
|
})
|
|
520618
520633
|
};
|
|
@@ -520620,7 +520635,7 @@ function stripFilesystemDiffPayload(result2) {
|
|
|
520620
520635
|
return result2;
|
|
520621
520636
|
}
|
|
520622
520637
|
function isFilesystemEditToolName(toolName) {
|
|
520623
|
-
return toolName === "filesystem-edit" || toolName === "filesystem-replaceedit";
|
|
520638
|
+
return toolName === "filesystem-edit" || toolName === "filesystem-replaceedit" || toolName === "filesystem-create";
|
|
520624
520639
|
}
|
|
520625
520640
|
function isTokenLimitBypassToolName(toolName) {
|
|
520626
520641
|
return toolName === "skill-execute";
|
|
@@ -521522,14 +521537,43 @@ AI Tip: Make sure to provide the 'filePath' parameter as a string.`);
|
|
|
521522
521537
|
if (!args2.filePath) {
|
|
521523
521538
|
throw new Error(`Missing required parameter 'filePath' for filesystem-create tool.
|
|
521524
521539
|
Received args: ${JSON.stringify(args2, null, 2)}
|
|
521525
|
-
AI Tip: Make sure to provide the 'filePath' parameter as a string.`);
|
|
521540
|
+
AI Tip: Make sure to provide the 'filePath' parameter as a string or array.`);
|
|
521526
521541
|
}
|
|
521527
|
-
if (
|
|
521528
|
-
|
|
521542
|
+
if (Array.isArray(args2.filePath)) {
|
|
521543
|
+
for (let i = 0; i < args2.filePath.length; i++) {
|
|
521544
|
+
const item = args2.filePath[i];
|
|
521545
|
+
if (!item || typeof item !== "object" || !item.path) {
|
|
521546
|
+
throw new Error(`Invalid item at index ${i} in filePath array for filesystem-create tool.
|
|
521547
|
+
Each item must be an object with 'path' and 'content' properties.
|
|
521548
|
+
Received args: ${JSON.stringify(args2, null, 2)}`);
|
|
521549
|
+
}
|
|
521550
|
+
if (item.content === void 0 || item.content === null) {
|
|
521551
|
+
throw new Error(`Missing 'content' in filePath[${i}] for filesystem-create tool.
|
|
521552
|
+
Received args: ${JSON.stringify(args2, null, 2)}`);
|
|
521553
|
+
}
|
|
521554
|
+
if (typeof item.content !== "string") {
|
|
521555
|
+
throw new Error(`Invalid type for 'content' in filePath[${i}] for filesystem-create tool. Expected string but received ${typeof item.content}.
|
|
521556
|
+
AI Tip: The 'content' field must be a string. If you need to write JSON, serialize it first using JSON.stringify().`);
|
|
521557
|
+
}
|
|
521558
|
+
}
|
|
521559
|
+
result2 = await filesystemService2.createFile(args2.filePath, void 0, args2.createDirectories, args2.overwrite);
|
|
521560
|
+
} else {
|
|
521561
|
+
if (typeof args2.filePath !== "string") {
|
|
521562
|
+
throw new Error(`Invalid type for parameter 'filePath' for filesystem-create tool. Expected string or array but received ${typeof args2.filePath}.
|
|
521563
|
+
Received args: ${JSON.stringify(args2, null, 2)}`);
|
|
521564
|
+
}
|
|
521565
|
+
if (args2.content === void 0 || args2.content === null) {
|
|
521566
|
+
throw new Error(`Missing required parameter 'content' for filesystem-create tool.
|
|
521529
521567
|
Received args: ${JSON.stringify(args2, null, 2)}
|
|
521530
521568
|
AI Tip: Make sure to provide the 'content' parameter as a string (can be empty string "").`);
|
|
521569
|
+
}
|
|
521570
|
+
if (typeof args2.content !== "string") {
|
|
521571
|
+
throw new Error(`Invalid type for parameter 'content' in filesystem-create tool. Expected string but received ${typeof args2.content}.
|
|
521572
|
+
Received args: ${JSON.stringify(args2, null, 2)}
|
|
521573
|
+
AI Tip: The 'content' parameter must be a string. If you need to write JSON, serialize it first using JSON.stringify(). For example: content: JSON.stringify({ ... }) instead of content: { ... }.`);
|
|
521574
|
+
}
|
|
521575
|
+
result2 = await filesystemService2.createFile(args2.filePath, args2.content, args2.createDirectories, args2.overwrite);
|
|
521531
521576
|
}
|
|
521532
|
-
result2 = await filesystemService2.createFile(args2.filePath, args2.content, args2.createDirectories, args2.overwrite);
|
|
521533
521577
|
break;
|
|
521534
521578
|
case "edit":
|
|
521535
521579
|
if (!args2.filePath) {
|
|
@@ -521542,12 +521586,27 @@ AI Tip: Make sure to provide the 'filePath' parameter as a string or array.`);
|
|
|
521542
521586
|
Received args: ${JSON.stringify(args2, null, 2)}
|
|
521543
521587
|
AI Tip: Provide an array of {type, startAnchor, endAnchor, content} operations (endAnchor required; same as startAnchor for single-line edits).`);
|
|
521544
521588
|
}
|
|
521589
|
+
for (let i = 0; i < args2.operations.length; i++) {
|
|
521590
|
+
const op2 = args2.operations[i];
|
|
521591
|
+
if (op2 && op2.content !== void 0 && op2.content !== null && typeof op2.content !== "string") {
|
|
521592
|
+
throw new Error(`Invalid type for 'content' in operations[${i}] for filesystem-edit tool. Expected string but received ${typeof op2.content}.
|
|
521593
|
+
AI Tip: The 'content' field in each operation must be a string. If you need to write JSON, serialize it first using JSON.stringify().`);
|
|
521594
|
+
}
|
|
521595
|
+
}
|
|
521545
521596
|
result2 = await filesystemService2.editFile(args2.filePath, args2.operations, args2.contextLines);
|
|
521546
521597
|
break;
|
|
521547
521598
|
case "replaceedit":
|
|
521548
521599
|
if (!args2.filePath) {
|
|
521549
521600
|
throw new Error(`Missing required parameter 'filePath' for filesystem-replaceedit tool.
|
|
521550
521601
|
Received args: ${JSON.stringify(args2, null, 2)}`);
|
|
521602
|
+
}
|
|
521603
|
+
if (args2.searchContent !== void 0 && args2.searchContent !== null && typeof args2.searchContent !== "string") {
|
|
521604
|
+
throw new Error(`Invalid type for parameter 'searchContent' in filesystem-replaceedit tool. Expected string but received ${typeof args2.searchContent}.
|
|
521605
|
+
AI Tip: The 'searchContent' parameter must be a string. If you need to write JSON, serialize it first using JSON.stringify().`);
|
|
521606
|
+
}
|
|
521607
|
+
if (args2.replaceContent !== void 0 && args2.replaceContent !== null && typeof args2.replaceContent !== "string") {
|
|
521608
|
+
throw new Error(`Invalid type for parameter 'replaceContent' in filesystem-replaceedit tool. Expected string but received ${typeof args2.replaceContent}.
|
|
521609
|
+
AI Tip: The 'replaceContent' parameter must be a string. If you need to write JSON, serialize it first using JSON.stringify().`);
|
|
521551
521610
|
}
|
|
521552
521611
|
result2 = await filesystemService2.editFileBySearch(args2.filePath, args2.searchContent, args2.replaceContent, args2.occurrence ?? 1, args2.contextLines);
|
|
521553
521612
|
break;
|
|
@@ -521876,7 +521935,13 @@ Received: ${JSON.stringify(args2.description)}`
|
|
|
521876
521935
|
throw error42;
|
|
521877
521936
|
}
|
|
521878
521937
|
const { extractFilesystemEditDiffFromRawResult: extractFilesystemEditDiffFromRawResult2 } = await Promise.resolve().then(() => (init_toolDisplayConfig(), toolDisplayConfig_exports));
|
|
521879
|
-
|
|
521938
|
+
let preservedEditDiffData = extractFilesystemEditDiffFromRawResult2(toolName, result2);
|
|
521939
|
+
if (!preservedEditDiffData && toolName === "filesystem-create" && args2 && typeof args2.filePath === "string" && typeof args2.content === "string") {
|
|
521940
|
+
preservedEditDiffData = {
|
|
521941
|
+
content: args2.content,
|
|
521942
|
+
path: args2.filePath
|
|
521943
|
+
};
|
|
521944
|
+
}
|
|
521880
521945
|
const { wrapToolResultWithTokenLimit: wrapToolResultWithTokenLimit2 } = await Promise.resolve().then(() => (init_tokenLimiter(), tokenLimiter_exports));
|
|
521881
521946
|
result2 = await wrapToolResultWithTokenLimit2(result2, toolName);
|
|
521882
521947
|
if (preservedEditDiffData) {
|
|
@@ -530317,6 +530382,13 @@ function restoreConversationContext(payload) {
|
|
|
530317
530382
|
}
|
|
530318
530383
|
setConversationContext(conversationContext.sessionId, conversationContext.messageIndex);
|
|
530319
530384
|
}
|
|
530385
|
+
function ensureIdeConnection() {
|
|
530386
|
+
if (!ideConnectionReady) {
|
|
530387
|
+
ideConnectionReady = vscodeConnection.start().catch(() => {
|
|
530388
|
+
});
|
|
530389
|
+
}
|
|
530390
|
+
return ideConnectionReady;
|
|
530391
|
+
}
|
|
530320
530392
|
function send(message) {
|
|
530321
530393
|
if (process.send) {
|
|
530322
530394
|
process.send(message);
|
|
@@ -530513,6 +530585,7 @@ async function runAgentChildProcessWorker() {
|
|
|
530513
530585
|
installMessageInjectionHandlers();
|
|
530514
530586
|
abortController = new AbortController();
|
|
530515
530587
|
send({ type: "ready" });
|
|
530588
|
+
void ensureIdeConnection();
|
|
530516
530589
|
await new Promise((resolve15) => {
|
|
530517
530590
|
let started = false;
|
|
530518
530591
|
process.on("message", (message) => {
|
|
@@ -530526,6 +530599,7 @@ async function runAgentChildProcessWorker() {
|
|
|
530526
530599
|
void (async () => {
|
|
530527
530600
|
try {
|
|
530528
530601
|
const payload = message.payload;
|
|
530602
|
+
await ensureIdeConnection();
|
|
530529
530603
|
const result2 = payload.kind === "subagent" ? await runSubAgentPayload(payload) : await runTeammatePayload(payload);
|
|
530530
530604
|
await sendAndWaitForAck({ type: "result", result: result2 });
|
|
530531
530605
|
} catch (error42) {
|
|
@@ -530541,7 +530615,7 @@ async function runAgentChildProcessWorker() {
|
|
|
530541
530615
|
});
|
|
530542
530616
|
});
|
|
530543
530617
|
}
|
|
530544
|
-
var pendingRequests, requestCounter2, abortController;
|
|
530618
|
+
var pendingRequests, requestCounter2, abortController, ideConnectionReady;
|
|
530545
530619
|
var init_agentChildProcessWorker = __esm({
|
|
530546
530620
|
"dist/utils/execution/agentChildProcessWorker.js"() {
|
|
530547
530621
|
"use strict";
|
|
@@ -530550,6 +530624,7 @@ var init_agentChildProcessWorker = __esm({
|
|
|
530550
530624
|
init_conversationContext();
|
|
530551
530625
|
init_runningSubAgentTracker();
|
|
530552
530626
|
init_teamTracker();
|
|
530627
|
+
init_vscodeConnection();
|
|
530553
530628
|
pendingRequests = /* @__PURE__ */ new Map();
|
|
530554
530629
|
requestCounter2 = 0;
|
|
530555
530630
|
}
|
|
@@ -532478,10 +532553,10 @@ var init_esm5 = __esm({
|
|
|
532478
532553
|
}
|
|
532479
532554
|
async _formatEntry(dirent, path68) {
|
|
532480
532555
|
let entry;
|
|
532481
|
-
const
|
|
532556
|
+
const basename10 = this._isDirent ? dirent.name : dirent;
|
|
532482
532557
|
try {
|
|
532483
|
-
const fullPath = presolve(pjoin(path68,
|
|
532484
|
-
entry = { path: prelative(this._root, fullPath), fullPath, basename:
|
|
532558
|
+
const fullPath = presolve(pjoin(path68, basename10));
|
|
532559
|
+
entry = { path: prelative(this._root, fullPath), fullPath, basename: basename10 };
|
|
532485
532560
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
532486
532561
|
} catch (err) {
|
|
532487
532562
|
this._onError(err);
|
|
@@ -533009,9 +533084,9 @@ var init_handler = __esm({
|
|
|
533009
533084
|
_watchWithNodeFs(path68, listener) {
|
|
533010
533085
|
const opts = this.fsw.options;
|
|
533011
533086
|
const directory = sysPath.dirname(path68);
|
|
533012
|
-
const
|
|
533087
|
+
const basename10 = sysPath.basename(path68);
|
|
533013
533088
|
const parent = this.fsw._getWatchedDir(directory);
|
|
533014
|
-
parent.add(
|
|
533089
|
+
parent.add(basename10);
|
|
533015
533090
|
const absolutePath = sysPath.resolve(path68);
|
|
533016
533091
|
const options3 = {
|
|
533017
533092
|
persistent: opts.persistent
|
|
@@ -533021,7 +533096,7 @@ var init_handler = __esm({
|
|
|
533021
533096
|
let closer;
|
|
533022
533097
|
if (opts.usePolling) {
|
|
533023
533098
|
const enableBin = opts.interval !== opts.binaryInterval;
|
|
533024
|
-
options3.interval = enableBin && isBinaryPath(
|
|
533099
|
+
options3.interval = enableBin && isBinaryPath(basename10) ? opts.binaryInterval : opts.interval;
|
|
533025
533100
|
closer = setFsWatchFileListener(path68, absolutePath, options3, {
|
|
533026
533101
|
listener,
|
|
533027
533102
|
rawEmitter: this.fsw._emitRaw
|
|
@@ -533043,11 +533118,11 @@ var init_handler = __esm({
|
|
|
533043
533118
|
if (this.fsw.closed) {
|
|
533044
533119
|
return;
|
|
533045
533120
|
}
|
|
533046
|
-
const
|
|
533047
|
-
const
|
|
533048
|
-
const parent = this.fsw._getWatchedDir(
|
|
533121
|
+
const dirname14 = sysPath.dirname(file2);
|
|
533122
|
+
const basename10 = sysPath.basename(file2);
|
|
533123
|
+
const parent = this.fsw._getWatchedDir(dirname14);
|
|
533049
533124
|
let prevStats = stats;
|
|
533050
|
-
if (parent.has(
|
|
533125
|
+
if (parent.has(basename10))
|
|
533051
533126
|
return;
|
|
533052
533127
|
const listener = async (path68, newStats) => {
|
|
533053
533128
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
|
|
@@ -533072,9 +533147,9 @@ var init_handler = __esm({
|
|
|
533072
533147
|
prevStats = newStats2;
|
|
533073
533148
|
}
|
|
533074
533149
|
} catch (error42) {
|
|
533075
|
-
this.fsw._remove(
|
|
533150
|
+
this.fsw._remove(dirname14, basename10);
|
|
533076
533151
|
}
|
|
533077
|
-
} else if (parent.has(
|
|
533152
|
+
} else if (parent.has(basename10)) {
|
|
533078
533153
|
const at = newStats.atimeMs;
|
|
533079
533154
|
const mt = newStats.mtimeMs;
|
|
533080
533155
|
if (!at || at <= mt || mt !== prevStats.mtimeMs) {
|
|
@@ -535017,7 +535092,7 @@ __export(custom_exports, {
|
|
|
535017
535092
|
saveCustomCommand: () => saveCustomCommand
|
|
535018
535093
|
});
|
|
535019
535094
|
import { homedir as homedir17 } from "os";
|
|
535020
|
-
import { dirname as
|
|
535095
|
+
import { dirname as dirname12, join as join32 } from "path";
|
|
535021
535096
|
import { readdir as readdir4, readFile as readFile2, writeFile, mkdir as mkdir3, unlink as unlink3 } from "fs/promises";
|
|
535022
535097
|
import { existsSync as existsSync30 } from "fs";
|
|
535023
535098
|
function isRecord3(value) {
|
|
@@ -535199,7 +535274,7 @@ async function saveCustomCommand(name, command, type, description, location = "g
|
|
|
535199
535274
|
await ensureCommandsDir(location, projectRoot);
|
|
535200
535275
|
const dir = getCustomCommandsDir(location, projectRoot);
|
|
535201
535276
|
const filePath = getCommandJsonFilePath(dir, name);
|
|
535202
|
-
await mkdir3(
|
|
535277
|
+
await mkdir3(dirname12(filePath), { recursive: true });
|
|
535203
535278
|
const data = { name, command, type, description, location };
|
|
535204
535279
|
await writeFile(filePath, JSON.stringify(data, null, 2), "utf-8");
|
|
535205
535280
|
}
|
|
@@ -535246,7 +535321,7 @@ async function importCustomCommandsForLocation(commands, location, projectRoot)
|
|
|
535246
535321
|
throw new Error(`Command name "${command.name}" conflicts with an existing built-in command`);
|
|
535247
535322
|
}
|
|
535248
535323
|
const filePath = getCommandJsonFilePath(dir, command.name);
|
|
535249
|
-
await mkdir3(
|
|
535324
|
+
await mkdir3(dirname12(filePath), { recursive: true });
|
|
535250
535325
|
await writeFile(filePath, JSON.stringify(command, null, 2), "utf-8");
|
|
535251
535326
|
}
|
|
535252
535327
|
}
|
|
@@ -537387,7 +537462,7 @@ function cleanThinkingContent3(content) {
|
|
|
537387
537462
|
function isValidTimestamp(timestamp) {
|
|
537388
537463
|
return typeof timestamp === "number" && Number.isFinite(timestamp);
|
|
537389
537464
|
}
|
|
537390
|
-
function appendAiCompletionTimeMessage(uiMessages, timestamp) {
|
|
537465
|
+
function appendAiCompletionTimeMessage(uiMessages, timestamp, durationMs) {
|
|
537391
537466
|
if (!isValidTimestamp(timestamp)) {
|
|
537392
537467
|
return;
|
|
537393
537468
|
}
|
|
@@ -537395,7 +537470,8 @@ function appendAiCompletionTimeMessage(uiMessages, timestamp) {
|
|
|
537395
537470
|
role: "assistant",
|
|
537396
537471
|
content: "",
|
|
537397
537472
|
streaming: false,
|
|
537398
|
-
aiCompletionTime: new Date(timestamp)
|
|
537473
|
+
aiCompletionTime: new Date(timestamp),
|
|
537474
|
+
aiCompletionDurationMs: typeof durationMs === "number" && Number.isFinite(durationMs) && durationMs >= 0 ? durationMs : void 0
|
|
537399
537475
|
});
|
|
537400
537476
|
}
|
|
537401
537477
|
function convertSessionMessagesToUI(sessionMessages) {
|
|
@@ -537531,7 +537607,7 @@ function convertSessionMessagesToUI(sessionMessages) {
|
|
|
537531
537607
|
let fileToolData = void 0;
|
|
537532
537608
|
if (!isError2 && (toolName === "filesystem-create" || toolName === "filesystem-edit" || toolName === "filesystem-replaceedit")) {
|
|
537533
537609
|
const editDiffData = msg.editDiffData;
|
|
537534
|
-
if (editDiffData && (typeof editDiffData.oldContent === "string" || Array.isArray(editDiffData.batchResults))) {
|
|
537610
|
+
if (editDiffData && (typeof editDiffData.oldContent === "string" || typeof editDiffData.content === "string" || Array.isArray(editDiffData.batchResults))) {
|
|
537535
537611
|
fileToolData = {
|
|
537536
537612
|
name: toolName,
|
|
537537
537613
|
arguments: editDiffData
|
|
@@ -537671,14 +537747,21 @@ function convertSessionMessagesToUI(sessionMessages) {
|
|
|
537671
537747
|
} catch (e) {
|
|
537672
537748
|
toolArgs = {};
|
|
537673
537749
|
}
|
|
537674
|
-
if ((toolName === "filesystem-edit" || toolName === "filesystem-replaceedit") && !isError2) {
|
|
537675
|
-
if (msg.editDiffData && (typeof msg.editDiffData.oldContent === "string" || Array.isArray(msg.editDiffData.batchResults))) {
|
|
537750
|
+
if ((toolName === "filesystem-edit" || toolName === "filesystem-replaceedit" || toolName === "filesystem-create") && !isError2) {
|
|
537751
|
+
if (msg.editDiffData && (typeof msg.editDiffData.oldContent === "string" || typeof msg.editDiffData.content === "string" || Array.isArray(msg.editDiffData.batchResults))) {
|
|
537676
537752
|
editDiffData = msg.editDiffData;
|
|
537677
537753
|
toolArgs = { ...toolArgs, ...msg.editDiffData };
|
|
537678
537754
|
}
|
|
537679
537755
|
try {
|
|
537680
537756
|
const resultData = JSON.parse(msg.content);
|
|
537681
|
-
if (resultData.
|
|
537757
|
+
if (resultData.content) {
|
|
537758
|
+
editDiffData = {
|
|
537759
|
+
content: resultData.content,
|
|
537760
|
+
path: resultData.path || resultData.filename
|
|
537761
|
+
};
|
|
537762
|
+
toolArgs.content = resultData.content;
|
|
537763
|
+
toolArgs.path = resultData.path || resultData.filename;
|
|
537764
|
+
} else if (resultData.oldContent && resultData.newContent) {
|
|
537682
537765
|
editDiffData = {
|
|
537683
537766
|
oldContent: resultData.oldContent,
|
|
537684
537767
|
newContent: resultData.newContent,
|
|
@@ -537771,7 +537854,24 @@ function convertSessionMessagesToUI(sessionMessages) {
|
|
|
537771
537854
|
editorContext: msg.role === "user" ? msg.editorContext : void 0
|
|
537772
537855
|
});
|
|
537773
537856
|
if (msg.role === "assistant") {
|
|
537774
|
-
|
|
537857
|
+
let durationMs;
|
|
537858
|
+
const assistantTimestamp = msg.timestamp;
|
|
537859
|
+
if (isValidTimestamp(assistantTimestamp)) {
|
|
537860
|
+
for (let j = i - 1; j >= 0; j--) {
|
|
537861
|
+
const prevMsg = sessionMessages[j];
|
|
537862
|
+
if (prevMsg && prevMsg.role === "user" && !prevMsg.subAgentInternal) {
|
|
537863
|
+
const userTimestamp = prevMsg.timestamp;
|
|
537864
|
+
if (isValidTimestamp(userTimestamp)) {
|
|
537865
|
+
const diff2 = assistantTimestamp - userTimestamp;
|
|
537866
|
+
if (diff2 >= 0) {
|
|
537867
|
+
durationMs = diff2;
|
|
537868
|
+
}
|
|
537869
|
+
}
|
|
537870
|
+
break;
|
|
537871
|
+
}
|
|
537872
|
+
}
|
|
537873
|
+
}
|
|
537874
|
+
appendAiCompletionTimeMessage(uiMessages, assistantTimestamp, durationMs);
|
|
537775
537875
|
}
|
|
537776
537876
|
continue;
|
|
537777
537877
|
}
|
|
@@ -547474,7 +547574,7 @@ function buildToolResultMessages(toolResults, receivedToolCalls, parallelGroupId
|
|
|
547474
547574
|
return resultMessages;
|
|
547475
547575
|
}
|
|
547476
547576
|
function extractEditDiffData(toolCall, result2) {
|
|
547477
|
-
if (toolCall.function.name !== "filesystem-edit" && toolCall.function.name !== "filesystem-replaceedit") {
|
|
547577
|
+
if (toolCall.function.name !== "filesystem-edit" && toolCall.function.name !== "filesystem-replaceedit" && toolCall.function.name !== "filesystem-create") {
|
|
547478
547578
|
return void 0;
|
|
547479
547579
|
}
|
|
547480
547580
|
const isError2 = result2.content.startsWith("Error:");
|
|
@@ -547500,6 +547600,18 @@ function extractEditDiffData(toolCall, result2) {
|
|
|
547500
547600
|
}
|
|
547501
547601
|
} catch {
|
|
547502
547602
|
}
|
|
547603
|
+
if (toolCall.function.name === "filesystem-create") {
|
|
547604
|
+
try {
|
|
547605
|
+
const callArgs = JSON.parse(toolCall.function.arguments);
|
|
547606
|
+
if (typeof callArgs.filePath === "string" && typeof callArgs.content === "string") {
|
|
547607
|
+
return {
|
|
547608
|
+
content: callArgs.content,
|
|
547609
|
+
path: callArgs.filePath
|
|
547610
|
+
};
|
|
547611
|
+
}
|
|
547612
|
+
} catch {
|
|
547613
|
+
}
|
|
547614
|
+
}
|
|
547503
547615
|
return void 0;
|
|
547504
547616
|
}
|
|
547505
547617
|
var init_toolResultDisplay = __esm({
|
|
@@ -609809,6 +609921,9 @@ function expandTabsForDisplay(line, tabWidth = 2) {
|
|
|
609809
609921
|
return out;
|
|
609810
609922
|
}
|
|
609811
609923
|
function stripLineNumbers(content) {
|
|
609924
|
+
if (typeof content !== "string") {
|
|
609925
|
+
return "";
|
|
609926
|
+
}
|
|
609812
609927
|
const hashlineRe = /^\s*\d+:[0-9a-fA-F]{2}→(.*)$/;
|
|
609813
609928
|
const lineNumArrowRe = /^\s*\d+→(.*)$/;
|
|
609814
609929
|
return content.split("\n").map((line) => {
|
|
@@ -612664,8 +612779,8 @@ var require_utils19 = __commonJS({
|
|
|
612664
612779
|
let code = codeRegex();
|
|
612665
612780
|
let stripped = ("" + str2).replace(code, "");
|
|
612666
612781
|
let split = stripped.split("\n");
|
|
612667
|
-
return split.reduce(function(
|
|
612668
|
-
return stringWidth5(s) >
|
|
612782
|
+
return split.reduce(function(memo12, s) {
|
|
612783
|
+
return stringWidth5(s) > memo12 ? stringWidth5(s) : memo12;
|
|
612669
612784
|
}, 0);
|
|
612670
612785
|
}
|
|
612671
612786
|
function repeat(str2, times2) {
|
|
@@ -642422,10 +642537,13 @@ function compactThinkingContent2(content, maxLength = 200) {
|
|
|
642422
642537
|
const tail = trimmed.slice(-tailLength).trimStart();
|
|
642423
642538
|
return `${head}${ellipsis}${tail}`;
|
|
642424
642539
|
}
|
|
642425
|
-
function
|
|
642426
|
-
var _a20, _b14, _c6, _d4
|
|
642540
|
+
function MessageRendererImpl({ message, terminalWidth, isFirstInGroup = false, isLastInGroup = false, showThinking = true, toolDisplayMode = "full", thinkDisplayMode = "compact" }) {
|
|
642541
|
+
var _a20, _b14, _c6, _d4;
|
|
642427
642542
|
const { theme: theme14 } = useTheme();
|
|
642428
642543
|
const { t } = useI18n();
|
|
642544
|
+
if (message.subAgentContent === true) {
|
|
642545
|
+
return null;
|
|
642546
|
+
}
|
|
642429
642547
|
if (message.streamingLine) {
|
|
642430
642548
|
if (message.isThinkingLine && !showThinking)
|
|
642431
642549
|
return null;
|
|
@@ -642509,7 +642627,7 @@ function MessageRenderer({ message, index, filteredMessages, terminalWidth, show
|
|
|
642509
642627
|
const formatCommandResultLines = (content) => {
|
|
642510
642628
|
const afterSkill = maskSkillInjectedText(content || "");
|
|
642511
642629
|
const displayContent = maskGitLineText(afterSkill.displayText).displayText;
|
|
642512
|
-
return displayContent.split("\n").map((line,
|
|
642630
|
+
return displayContent.split("\n").map((line, index) => parseAnsiCommandLine(`${index === 0 ? "\u2514\u2500 " : " "}${line || " "}`));
|
|
642513
642631
|
};
|
|
642514
642632
|
const formatCompactCount = (value) => {
|
|
642515
642633
|
if (value >= 1e3) {
|
|
@@ -642545,27 +642663,44 @@ function MessageRenderer({ message, index, filteredMessages, terminalWidth, show
|
|
|
642545
642663
|
return date5.toLocaleTimeString(void 0, {
|
|
642546
642664
|
hour: "2-digit",
|
|
642547
642665
|
minute: "2-digit",
|
|
642548
|
-
second: "2-digit"
|
|
642666
|
+
second: "2-digit",
|
|
642667
|
+
hour12: false
|
|
642549
642668
|
});
|
|
642550
642669
|
};
|
|
642670
|
+
const formatAiCompletionDuration = (ms) => {
|
|
642671
|
+
if (!Number.isFinite(ms) || ms < 0) {
|
|
642672
|
+
return "";
|
|
642673
|
+
}
|
|
642674
|
+
const totalSeconds = Math.floor(ms / 1e3);
|
|
642675
|
+
if (totalSeconds < 60) {
|
|
642676
|
+
return `${totalSeconds}s`;
|
|
642677
|
+
}
|
|
642678
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
642679
|
+
const seconds = totalSeconds % 60;
|
|
642680
|
+
if (minutes < 60) {
|
|
642681
|
+
return `${minutes}m${seconds.toString().padStart(2, "0")}s`;
|
|
642682
|
+
}
|
|
642683
|
+
const hours = Math.floor(minutes / 60);
|
|
642684
|
+
const remainMinutes = minutes % 60;
|
|
642685
|
+
return `${hours}h${remainMinutes.toString().padStart(2, "0")}m`;
|
|
642686
|
+
};
|
|
642551
642687
|
if (message.aiCompletionTime) {
|
|
642552
642688
|
const completionTime = formatAiCompletionTime(message.aiCompletionTime);
|
|
642689
|
+
const durationStr = typeof message.aiCompletionDurationMs === "number" && Number.isFinite(message.aiCompletionDurationMs) && message.aiCompletionDurationMs >= 0 ? formatAiCompletionDuration(message.aiCompletionDurationMs) : "";
|
|
642690
|
+
const displayText = durationStr ? t.chatScreen.aiCompletionTimeWithDurationMessage.replace("{time}", completionTime).replace("{duration}", durationStr) : t.chatScreen.aiCompletionTimeMessage.replace("{time}", completionTime);
|
|
642553
642691
|
return import_react88.default.createElement(
|
|
642554
642692
|
Box_default,
|
|
642555
642693
|
{ paddingX: 1, width: terminalWidth, marginBottom: 1 },
|
|
642556
|
-
import_react88.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true },
|
|
642694
|
+
import_react88.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, displayText)
|
|
642557
642695
|
);
|
|
642558
642696
|
}
|
|
642559
642697
|
let toolStatusColor = "cyan";
|
|
642560
642698
|
const isInParallelGroup = message.parallelGroup !== void 0 && message.parallelGroup !== null;
|
|
642561
642699
|
const isTimeConsumingTool = message.toolPending || message.messageStatus === "pending";
|
|
642562
642700
|
const shouldShowParallelIndicator = isInParallelGroup && !isTimeConsumingTool;
|
|
642563
|
-
const
|
|
642564
|
-
|
|
642565
|
-
const
|
|
642566
|
-
const nextInSameGroup = nextMessage && nextMessage.parallelGroup !== void 0 && nextMessage.parallelGroup !== null && nextMessage.parallelGroup === message.parallelGroup;
|
|
642567
|
-
const isLastInGroup = shouldShowParallelIndicator && !nextInSameGroup;
|
|
642568
|
-
const leadingIndicator = shouldShowParallelIndicator && !isFirstInGroup ? "\u2502" : "";
|
|
642701
|
+
const effectiveIsFirstInGroup = shouldShowParallelIndicator && isFirstInGroup;
|
|
642702
|
+
const effectiveIsLastInGroup = shouldShowParallelIndicator && isLastInGroup;
|
|
642703
|
+
const leadingIndicator = shouldShowParallelIndicator && !effectiveIsFirstInGroup ? "\u2502" : "";
|
|
642569
642704
|
const messageIcon = message.role === "user" ? message.subAgentDirected ? "\xBB" : "\u276F" : message.role === "command" ? "\u2318" : "\u2746";
|
|
642570
642705
|
const messagePrefix = `${leadingIndicator}${messageIcon}`;
|
|
642571
642706
|
const contentColumnWidth = Math.max(terminalWidth - 2 - visualWidth(messagePrefix) - 1, 1);
|
|
@@ -642577,17 +642712,17 @@ function MessageRenderer({ message, index, filteredMessages, terminalWidth, show
|
|
|
642577
642712
|
} else if (message.messageStatus === "error") {
|
|
642578
642713
|
toolStatusColor = "red";
|
|
642579
642714
|
} else {
|
|
642580
|
-
if (message.
|
|
642715
|
+
if (message.role === "subagent" && message.subAgentInternal === true) {
|
|
642581
642716
|
toolStatusColor = "cyan";
|
|
642582
642717
|
} else {
|
|
642583
642718
|
toolStatusColor = message.role === "subagent" ? "magenta" : "blue";
|
|
642584
642719
|
}
|
|
642585
642720
|
}
|
|
642586
642721
|
}
|
|
642587
|
-
return import_react88.default.createElement(Box_default, {
|
|
642722
|
+
return import_react88.default.createElement(Box_default, { marginTop: message.role === "user" ? 1 : 0, marginBottom: 1, paddingX: 1, flexDirection: "column", width: terminalWidth }, message.plainOutput ? import_react88.default.createElement(Text, { color: message.role === "user" ? theme14.colors.userMessageText : toolStatusColor }, getDisplayContent(message.content)) : import_react88.default.createElement(
|
|
642588
642723
|
import_react88.default.Fragment,
|
|
642589
642724
|
null,
|
|
642590
|
-
|
|
642725
|
+
effectiveIsFirstInGroup && import_react88.default.createElement(
|
|
642591
642726
|
Box_default,
|
|
642592
642727
|
{ marginBottom: 0 },
|
|
642593
642728
|
import_react88.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, t.chatScreen.parallelStart)
|
|
@@ -642647,8 +642782,7 @@ function MessageRenderer({ message, index, filteredMessages, terminalWidth, show
|
|
|
642647
642782
|
}
|
|
642648
642783
|
const hasToolStatus = message.messageStatus !== void 0;
|
|
642649
642784
|
const isSubAgentInternal = message.subAgentInternal === true;
|
|
642650
|
-
|
|
642651
|
-
if ((hasToolStatus || isSubAgentInternal && !isSubAgentContent) && (message.role === "assistant" || message.role === "subagent")) {
|
|
642785
|
+
if ((hasToolStatus || isSubAgentInternal) && (message.role === "assistant" || message.role === "subagent")) {
|
|
642652
642786
|
const content = message.content || " ";
|
|
642653
642787
|
const lines = content.split("\n");
|
|
642654
642788
|
const titleLine = lines[0] || "";
|
|
@@ -642726,7 +642860,7 @@ function MessageRenderer({ message, index, filteredMessages, terminalWidth, show
|
|
|
642726
642860
|
": ",
|
|
642727
642861
|
arg.value
|
|
642728
642862
|
))),
|
|
642729
|
-
message.toolCall && message.toolCall.name === "filesystem-create" && message.toolCall.arguments.content && import_react88.default.createElement(
|
|
642863
|
+
message.toolCall && message.toolCall.name === "filesystem-create" && !message.toolCall.arguments.isBatch && message.toolCall.arguments.content && import_react88.default.createElement(
|
|
642730
642864
|
Box_default,
|
|
642731
642865
|
{ marginTop: 1 },
|
|
642732
642866
|
import_react88.default.createElement(DiffViewer, { newContent: message.toolCall.arguments.content, filename: message.toolCall.arguments.path })
|
|
@@ -642736,20 +642870,31 @@ function MessageRenderer({ message, index, filteredMessages, terminalWidth, show
|
|
|
642736
642870
|
{ marginTop: 1 },
|
|
642737
642871
|
import_react88.default.createElement(DiffViewer, { oldContent: message.toolCall.arguments.oldContent, newContent: message.toolCall.arguments.newContent, filename: message.toolCall.arguments.filename, completeOldContent: message.toolCall.arguments.completeOldContent, completeNewContent: message.toolCall.arguments.completeNewContent, startLineNumber: message.toolCall.arguments.contextStartLine })
|
|
642738
642872
|
),
|
|
642739
|
-
message.toolCall && (message.toolCall.name === "filesystem-edit" || message.toolCall.name === "filesystem-replaceedit") && message.toolCall.arguments.isBatch && message.toolCall.arguments.batchResults && Array.isArray(message.toolCall.arguments.batchResults) && import_react88.default.createElement(Box_default, { marginTop: 1, flexDirection: "column" }, message.toolCall.arguments.batchResults.map((fileResult,
|
|
642873
|
+
message.toolCall && (message.toolCall.name === "filesystem-edit" || message.toolCall.name === "filesystem-replaceedit") && message.toolCall.arguments.isBatch && message.toolCall.arguments.batchResults && Array.isArray(message.toolCall.arguments.batchResults) && import_react88.default.createElement(Box_default, { marginTop: 1, flexDirection: "column" }, message.toolCall.arguments.batchResults.map((fileResult, index) => {
|
|
642740
642874
|
if (fileResult.success && fileResult.oldContent && fileResult.newContent) {
|
|
642741
642875
|
return import_react88.default.createElement(
|
|
642742
642876
|
Box_default,
|
|
642743
|
-
{ key:
|
|
642744
|
-
import_react88.default.createElement(Text, { bold: true, color: "cyan" }, `File ${
|
|
642877
|
+
{ key: index, flexDirection: "column", marginBottom: 1 },
|
|
642878
|
+
import_react88.default.createElement(Text, { bold: true, color: "cyan" }, `File ${index + 1}: ${fileResult.path}`),
|
|
642745
642879
|
import_react88.default.createElement(DiffViewer, { oldContent: fileResult.oldContent, newContent: fileResult.newContent, filename: fileResult.path, showFilenameInHeader: false, completeOldContent: fileResult.completeOldContent, completeNewContent: fileResult.completeNewContent, startLineNumber: fileResult.contextStartLine })
|
|
642746
642880
|
);
|
|
642747
642881
|
}
|
|
642748
642882
|
return null;
|
|
642749
642883
|
})),
|
|
642884
|
+
message.toolCall && message.toolCall.name === "filesystem-create" && message.toolCall.arguments.isBatch && message.toolCall.arguments.batchResults && Array.isArray(message.toolCall.arguments.batchResults) && import_react88.default.createElement(Box_default, { marginTop: 1, flexDirection: "column" }, message.toolCall.arguments.batchResults.map((fileResult, index) => {
|
|
642885
|
+
if (fileResult.success && fileResult.content) {
|
|
642886
|
+
return import_react88.default.createElement(
|
|
642887
|
+
Box_default,
|
|
642888
|
+
{ key: index, flexDirection: "column", marginBottom: 1 },
|
|
642889
|
+
import_react88.default.createElement(Text, { bold: true, color: "cyan" }, `File ${index + 1}: ${fileResult.path}`),
|
|
642890
|
+
import_react88.default.createElement(DiffViewer, { newContent: fileResult.content, filename: fileResult.path, showFilenameInHeader: false })
|
|
642891
|
+
);
|
|
642892
|
+
}
|
|
642893
|
+
return null;
|
|
642894
|
+
})),
|
|
642750
642895
|
message.messageStatus === "success" && message.toolResult && // 只在没有 diff 数据时显示预览(有 diff 的工具会用 DiffViewer 显示)
|
|
642751
|
-
!(message.toolCall && (((
|
|
642752
|
-
toolDisplayMode === "full" && import_react88.default.createElement(ToolResultPreview, { toolName: ((
|
|
642896
|
+
!(message.toolCall && (((_a20 = message.toolCall.arguments) == null ? void 0 : _a20.oldContent) || ((_b14 = message.toolCall.arguments) == null ? void 0 : _b14.content) || ((_c6 = message.toolCall.arguments) == null ? void 0 : _c6.batchResults))) && // Hide result preview in compact mode
|
|
642897
|
+
toolDisplayMode === "full" && import_react88.default.createElement(ToolResultPreview, { toolName: ((_d4 = (message.content || "").replace(/^✓\s*/, "").replace(/^⚇✓\s*/, "").replace(/.*⚇✓\s*/, "").replace(/\x1b\[[0-9;]*m/g, "").split("\n")[0]) == null ? void 0 : _d4.trim()) || "", result: message.toolResult, maxLines: 5, isSubAgentInternal: message.role === "subagent" || message.subAgentInternal === true }),
|
|
642753
642898
|
message.files && message.files.length > 0 && import_react88.default.createElement(Box_default, { flexDirection: "column" }, message.files.map((file2, fileIndex) => import_react88.default.createElement(
|
|
642754
642899
|
Text,
|
|
642755
642900
|
{ key: fileIndex, color: theme14.colors.menuSecondary, dimColor: true },
|
|
@@ -642768,14 +642913,50 @@ function MessageRenderer({ message, index, filteredMessages, terminalWidth, show
|
|
|
642768
642913
|
)
|
|
642769
642914
|
)
|
|
642770
642915
|
),
|
|
642771
|
-
!message.plainOutput &&
|
|
642916
|
+
!message.plainOutput && effectiveIsLastInGroup && import_react88.default.createElement(
|
|
642772
642917
|
Box_default,
|
|
642773
642918
|
{ marginTop: 0 },
|
|
642774
642919
|
import_react88.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, t.chatScreen.parallelEnd)
|
|
642775
642920
|
)
|
|
642776
642921
|
));
|
|
642777
642922
|
}
|
|
642778
|
-
|
|
642923
|
+
function areMessageRendererPropsEqual(prev, next) {
|
|
642924
|
+
if (prev.message !== next.message)
|
|
642925
|
+
return false;
|
|
642926
|
+
if (prev.terminalWidth !== next.terminalWidth)
|
|
642927
|
+
return false;
|
|
642928
|
+
if (prev.showThinking !== next.showThinking)
|
|
642929
|
+
return false;
|
|
642930
|
+
if (prev.toolDisplayMode !== next.toolDisplayMode)
|
|
642931
|
+
return false;
|
|
642932
|
+
if (prev.thinkDisplayMode !== next.thinkDisplayMode)
|
|
642933
|
+
return false;
|
|
642934
|
+
if (prev.isFirstInGroup !== next.isFirstInGroup)
|
|
642935
|
+
return false;
|
|
642936
|
+
if (prev.isLastInGroup !== next.isLastInGroup)
|
|
642937
|
+
return false;
|
|
642938
|
+
return true;
|
|
642939
|
+
}
|
|
642940
|
+
function computeParallelGroupEdges(messages) {
|
|
642941
|
+
const len = messages.length;
|
|
642942
|
+
const isFirstInGroup = new Array(len).fill(false);
|
|
642943
|
+
const isLastInGroup = new Array(len).fill(false);
|
|
642944
|
+
for (let i = 0; i < len; i++) {
|
|
642945
|
+
const msg = messages[i];
|
|
642946
|
+
const isInParallelGroup = msg.parallelGroup !== void 0 && msg.parallelGroup !== null;
|
|
642947
|
+
const isTimeConsumingTool = msg.toolPending || msg.messageStatus === "pending";
|
|
642948
|
+
const shouldShowParallelIndicator = isInParallelGroup && !isTimeConsumingTool;
|
|
642949
|
+
if (!shouldShowParallelIndicator)
|
|
642950
|
+
continue;
|
|
642951
|
+
const prev = i > 0 ? messages[i - 1] : void 0;
|
|
642952
|
+
isFirstInGroup[i] = !prev || prev.parallelGroup !== msg.parallelGroup || prev.toolPending || prev.messageStatus === "pending";
|
|
642953
|
+
const next = i < len - 1 ? messages[i + 1] : void 0;
|
|
642954
|
+
const nextInSameGroup = next && next.parallelGroup !== void 0 && next.parallelGroup !== null && next.parallelGroup === msg.parallelGroup;
|
|
642955
|
+
isLastInGroup[i] = !nextInSameGroup;
|
|
642956
|
+
}
|
|
642957
|
+
return { isFirstInGroup, isLastInGroup };
|
|
642958
|
+
}
|
|
642959
|
+
var import_react88, MessageRenderer, MessageRenderer_default;
|
|
642779
642960
|
var init_MessageRenderer = __esm({
|
|
642780
642961
|
async "dist/ui/components/chat/MessageRenderer.js"() {
|
|
642781
642962
|
"use strict";
|
|
@@ -642792,6 +642973,9 @@ var init_MessageRenderer = __esm({
|
|
|
642792
642973
|
init_gitLineMask();
|
|
642793
642974
|
init_textUtils();
|
|
642794
642975
|
init_compressionSummaryDisplay();
|
|
642976
|
+
MessageRenderer = (0, import_react88.memo)(MessageRendererImpl, areMessageRendererPropsEqual);
|
|
642977
|
+
MessageRenderer.displayName = "MessageRenderer";
|
|
642978
|
+
MessageRenderer_default = MessageRenderer;
|
|
642795
642979
|
}
|
|
642796
642980
|
});
|
|
642797
642981
|
|
|
@@ -642802,8 +642986,7 @@ function UserMessagePreview({ content }) {
|
|
|
642802
642986
|
role: "user",
|
|
642803
642987
|
content
|
|
642804
642988
|
}), [content]);
|
|
642805
|
-
|
|
642806
|
-
return import_react89.default.createElement(MessageRenderer, { message, index: 0, filteredMessages, terminalWidth, showThinking: false });
|
|
642989
|
+
return import_react89.default.createElement(MessageRenderer_default, { message, terminalWidth, isFirstInGroup: false, isLastInGroup: false, showThinking: false });
|
|
642807
642990
|
}
|
|
642808
642991
|
var import_react89;
|
|
642809
642992
|
var init_UserMessagePreview = __esm({
|
|
@@ -659284,6 +659467,32 @@ function SkillsListPanel({ onClose }) {
|
|
|
659284
659467
|
}
|
|
659285
659468
|
return `${description.slice(0, NON_FOCUSED_SKILL_DESC_MAX_LEN - 3)}...`;
|
|
659286
659469
|
};
|
|
659470
|
+
const { columns } = useTerminalSize();
|
|
659471
|
+
const panelContentWidth = Math.max(1, columns - 6);
|
|
659472
|
+
const wrapTextToWidth = (0, import_react134.useCallback)((text2, maxWidth) => {
|
|
659473
|
+
if (!text2)
|
|
659474
|
+
return [""];
|
|
659475
|
+
const chars = [...text2];
|
|
659476
|
+
const result2 = [];
|
|
659477
|
+
let current = "";
|
|
659478
|
+
let currentWidth = 0;
|
|
659479
|
+
for (const ch of chars) {
|
|
659480
|
+
const chWidth = Math.max(1, visualWidth(ch));
|
|
659481
|
+
if (currentWidth + chWidth > maxWidth) {
|
|
659482
|
+
result2.push(current || " ");
|
|
659483
|
+
current = ch;
|
|
659484
|
+
currentWidth = chWidth;
|
|
659485
|
+
} else {
|
|
659486
|
+
current += ch;
|
|
659487
|
+
currentWidth += chWidth;
|
|
659488
|
+
}
|
|
659489
|
+
}
|
|
659490
|
+
if (current.length > 0) {
|
|
659491
|
+
result2.push(current);
|
|
659492
|
+
}
|
|
659493
|
+
return result2.length > 0 ? result2 : [""];
|
|
659494
|
+
}, []);
|
|
659495
|
+
const wrappedUpdateMessage = (0, import_react134.useMemo)(() => updateMessage ? wrapTextToWidth(updateMessage, panelContentWidth) : [], [updateMessage, wrapTextToWidth, panelContentWidth]);
|
|
659287
659496
|
const handleUpdate = (0, import_react134.useCallback)(async () => {
|
|
659288
659497
|
var _a21, _b15, _c7, _d5, _e3, _f2;
|
|
659289
659498
|
if (updateStatus === "updating")
|
|
@@ -659435,11 +659644,7 @@ function SkillsListPanel({ onClose }) {
|
|
|
659435
659644
|
Box_default,
|
|
659436
659645
|
{ flexDirection: "column" },
|
|
659437
659646
|
import_react134.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, ((_c6 = t.skillsListPanel) == null ? void 0 : _c6.noSkills) || "No skills available"),
|
|
659438
|
-
updateStatus !== "idle" && updateMessage && import_react134.default.createElement(
|
|
659439
|
-
Box_default,
|
|
659440
|
-
{ marginTop: 1 },
|
|
659441
|
-
import_react134.default.createElement(Text, { color: updateStatus === "error" ? theme14.colors.error : updateStatus === "updating" ? theme14.colors.warning : theme14.colors.success }, updateMessage)
|
|
659442
|
-
),
|
|
659647
|
+
updateStatus !== "idle" && updateMessage && import_react134.default.createElement(Box_default, { marginTop: 1, flexDirection: "column" }, wrappedUpdateMessage.map((line, i) => import_react134.default.createElement(Text, { key: i, color: updateStatus === "error" ? theme14.colors.error : updateStatus === "updating" ? theme14.colors.warning : theme14.colors.success }, line))),
|
|
659443
659648
|
import_react134.default.createElement(
|
|
659444
659649
|
Box_default,
|
|
659445
659650
|
{ marginTop: 1 },
|
|
@@ -659499,16 +659704,15 @@ function SkillsListPanel({ onClose }) {
|
|
|
659499
659704
|
);
|
|
659500
659705
|
}),
|
|
659501
659706
|
hiddenBelowCount > 0 && import_react134.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, (((_g = t.skillsListPanel) == null ? void 0 : _g.moreBelow) || "\u2193 {count} more below").replace("{count}", String(hiddenBelowCount))),
|
|
659502
|
-
updateStatus !== "idle" && updateMessage && import_react134.default.createElement(
|
|
659503
|
-
|
|
659504
|
-
|
|
659505
|
-
import_react134.default.createElement(
|
|
659707
|
+
updateStatus !== "idle" && updateMessage && import_react134.default.createElement(Box_default, { marginTop: 1, flexDirection: "column" }, wrappedUpdateMessage.map((line, i) => {
|
|
659708
|
+
const prefix = i === 0 ? updateStatus === "updating" ? "\u27F3 " : updateStatus === "done" ? "\u2713 " : "\u2717 " : "";
|
|
659709
|
+
return import_react134.default.createElement(
|
|
659506
659710
|
Text,
|
|
659507
|
-
{ color: updateStatus === "error" ? theme14.colors.error : updateStatus === "updating" ? theme14.colors.warning : theme14.colors.success },
|
|
659508
|
-
|
|
659509
|
-
|
|
659510
|
-
)
|
|
659511
|
-
),
|
|
659711
|
+
{ key: i, color: updateStatus === "error" ? theme14.colors.error : updateStatus === "updating" ? theme14.colors.warning : theme14.colors.success },
|
|
659712
|
+
prefix,
|
|
659713
|
+
line
|
|
659714
|
+
);
|
|
659715
|
+
})),
|
|
659512
659716
|
import_react134.default.createElement(
|
|
659513
659717
|
Box_default,
|
|
659514
659718
|
{ marginTop: 1 },
|
|
@@ -659525,6 +659729,8 @@ var init_SkillsListPanel = __esm({
|
|
|
659525
659729
|
await init_src();
|
|
659526
659730
|
init_ThemeContext();
|
|
659527
659731
|
init_I18nContext();
|
|
659732
|
+
init_useTerminalSize();
|
|
659733
|
+
init_textUtils();
|
|
659528
659734
|
init_disabledSkills();
|
|
659529
659735
|
init_githubSkillInstaller();
|
|
659530
659736
|
UPDATE_TIMEOUT_MS = 12e4;
|
|
@@ -660030,14 +660236,15 @@ function useMessageProcessing(props) {
|
|
|
660030
660236
|
(0, import_react138.useEffect)(() => {
|
|
660031
660237
|
hasFocusRef.current = hasFocus ?? true;
|
|
660032
660238
|
}, [hasFocus]);
|
|
660033
|
-
const appendAiCompletionTimeMessage2 = () => {
|
|
660239
|
+
const appendAiCompletionTimeMessage2 = (durationMs) => {
|
|
660034
660240
|
setMessages((prev) => [
|
|
660035
660241
|
...prev,
|
|
660036
660242
|
{
|
|
660037
660243
|
role: "assistant",
|
|
660038
660244
|
content: "",
|
|
660039
660245
|
streaming: false,
|
|
660040
|
-
aiCompletionTime: /* @__PURE__ */ new Date()
|
|
660246
|
+
aiCompletionTime: /* @__PURE__ */ new Date(),
|
|
660247
|
+
aiCompletionDurationMs: typeof durationMs === "number" && Number.isFinite(durationMs) && durationMs >= 0 ? durationMs : void 0
|
|
660041
660248
|
}
|
|
660042
660249
|
]);
|
|
660043
660250
|
};
|
|
@@ -660048,6 +660255,7 @@ function useMessageProcessing(props) {
|
|
|
660048
660255
|
};
|
|
660049
660256
|
const processMessage = async (message, images, useBasicModel, hideUserMessage) => {
|
|
660050
660257
|
var _a20, _b14, _c6, _d4, _e2, _f, _g, _h;
|
|
660258
|
+
const turnStartTime = Date.now();
|
|
660051
660259
|
const autoCompressConfig = getSnowConfig();
|
|
660052
660260
|
if (autoCompressConfig.enableAutoCompress !== false && shouldAutoCompress(currentContextPercentageRef.current, autoCompressConfig.autoCompressThreshold ?? DEFAULT_AUTO_COMPRESS_THRESHOLD)) {
|
|
660053
660261
|
setIsCompressing(true);
|
|
@@ -660308,7 +660516,7 @@ ${continuationPrompt}` : continuationPrompt;
|
|
|
660308
660516
|
streamingState.setIsStopping(false);
|
|
660309
660517
|
}
|
|
660310
660518
|
if (!wasCutInterrupt) {
|
|
660311
|
-
appendAiCompletionTimeMessage2();
|
|
660519
|
+
appendAiCompletionTimeMessage2(Date.now() - turnStartTime);
|
|
660312
660520
|
}
|
|
660313
660521
|
streamingState.setIsStreaming(false);
|
|
660314
660522
|
streamingState.setAbortController(null);
|
|
@@ -660507,6 +660715,7 @@ ${messageWithoutTargets}`);
|
|
|
660507
660715
|
const pendingMessages = pendingMessagesRef.current;
|
|
660508
660716
|
if (pendingMessages.length === 0)
|
|
660509
660717
|
return;
|
|
660718
|
+
const turnStartTime = Date.now();
|
|
660510
660719
|
streamingState.setRetryStatus(null);
|
|
660511
660720
|
const messagesToProcess = [...pendingMessages];
|
|
660512
660721
|
setPendingMessages([]);
|
|
@@ -660662,7 +660871,7 @@ ${messageWithoutTargets}`);
|
|
|
660662
660871
|
userInterruptedRef.current = false;
|
|
660663
660872
|
streamingState.setIsStopping(false);
|
|
660664
660873
|
}
|
|
660665
|
-
appendAiCompletionTimeMessage2();
|
|
660874
|
+
appendAiCompletionTimeMessage2(Date.now() - turnStartTime);
|
|
660666
660875
|
streamingState.setIsStreaming(false);
|
|
660667
660876
|
streamingState.setAbortController(null);
|
|
660668
660877
|
streamingState.setStreamTokenCount(0);
|
|
@@ -660796,6 +661005,8 @@ function useRollback(props) {
|
|
|
660796
661005
|
snapshotState.setPendingRollback(null);
|
|
660797
661006
|
return;
|
|
660798
661007
|
}
|
|
661008
|
+
streamingState.setContextUsage(null);
|
|
661009
|
+
currentContextPercentageRef.current = 0;
|
|
660799
661010
|
if (currentSession) {
|
|
660800
661011
|
const messagesAfterSelected = messages.slice(selectedIndex);
|
|
660801
661012
|
const uiUserMessagesToDelete = messagesAfterSelected.filter((msg) => msg.role === "user").length;
|
|
@@ -660884,6 +661095,7 @@ function useRollback(props) {
|
|
|
660884
661095
|
clearSavedMessages();
|
|
660885
661096
|
setMessages(uiMessages);
|
|
660886
661097
|
streamingState.setContextUsage(originalSession.contextUsage ?? null);
|
|
661098
|
+
currentContextPercentageRef.current = 0;
|
|
660887
661099
|
const snapshots = await hashBasedSnapshotManager.listSnapshots(originalSession.id);
|
|
660888
661100
|
const counts = /* @__PURE__ */ new Map();
|
|
660889
661101
|
for (const snapshot of snapshots) {
|
|
@@ -660911,8 +661123,6 @@ function useRollback(props) {
|
|
|
660911
661123
|
}
|
|
660912
661124
|
};
|
|
660913
661125
|
const handleHistorySelect = async (selectedIndex, message, images) => {
|
|
660914
|
-
streamingState.setContextUsage(null);
|
|
660915
|
-
currentContextPercentageRef.current = 0;
|
|
660916
661126
|
const currentSession = sessionManager.getCurrentSession();
|
|
660917
661127
|
if (!currentSession)
|
|
660918
661128
|
return;
|
|
@@ -664409,12 +664619,14 @@ var init_ThinkingStatus = __esm({
|
|
|
664409
664619
|
// dist/ui/pages/chatScreen/ChatScreenConversationView.js
|
|
664410
664620
|
function ChatScreenConversationView({ remountKey, terminalWidth, workingDirectory, simpleMode, messages, showThinking, toolDisplayMode, thinkDisplayMode, pendingMessages, pendingToolConfirmation, pendingUserQuestion, bashSensitiveCommand, terminalExecutionState, schedulerExecutionState, customCommandExecution, bashMode, hookError, handleUserQuestionAnswer, setHookError, compressionStatus, thinkingStatus }) {
|
|
664411
664621
|
var _a20, _b14;
|
|
664622
|
+
const staticMessages = (0, import_react156.useMemo)(() => messages.filter((m) => !m.streaming), [messages]);
|
|
664623
|
+
const { isFirstInGroup, isLastInGroup } = (0, import_react156.useMemo)(() => computeParallelGroupEdges(staticMessages), [staticMessages]);
|
|
664412
664624
|
return import_react156.default.createElement(
|
|
664413
664625
|
import_react156.default.Fragment,
|
|
664414
664626
|
null,
|
|
664415
664627
|
import_react156.default.createElement(Static, { key: remountKey, items: [
|
|
664416
664628
|
import_react156.default.createElement(ChatHeader, { key: "header", terminalWidth, simpleMode, workingDirectory }),
|
|
664417
|
-
...
|
|
664629
|
+
...staticMessages.map((message, index) => import_react156.default.createElement(MessageRenderer_default, { key: `msg-${index}`, message, terminalWidth, isFirstInGroup: isFirstInGroup[index], isLastInGroup: isLastInGroup[index], showThinking, toolDisplayMode, thinkDisplayMode }))
|
|
664418
664630
|
] }, (item) => item),
|
|
664419
664631
|
import_react156.default.createElement(
|
|
664420
664632
|
Box_default,
|
|
@@ -664990,7 +665202,7 @@ var init_SkillsCreationPanel = __esm({
|
|
|
664990
665202
|
init_ThemeContext();
|
|
664991
665203
|
init_I18nContext();
|
|
664992
665204
|
init_skills2();
|
|
664993
|
-
SkillsCreationPanel = ({ onSave, onCancel, projectRoot }) => {
|
|
665205
|
+
SkillsCreationPanel = ({ onSave, onCancel, onInstall, projectRoot }) => {
|
|
664994
665206
|
const { theme: theme14 } = useTheme();
|
|
664995
665207
|
const { t } = useI18n();
|
|
664996
665208
|
const [step, setStep] = (0, import_react158.useState)("mode");
|
|
@@ -665150,6 +665362,8 @@ var init_SkillsCreationPanel = __esm({
|
|
|
665150
665362
|
setDescription("");
|
|
665151
665363
|
setGenerated(void 0);
|
|
665152
665364
|
setStep("ai-requirement");
|
|
665365
|
+
} else if (input2.toLowerCase() === "i" && onInstall) {
|
|
665366
|
+
onInstall();
|
|
665153
665367
|
}
|
|
665154
665368
|
return;
|
|
665155
665369
|
}
|
|
@@ -665240,6 +665454,17 @@ var init_SkillsCreationPanel = __esm({
|
|
|
665240
665454
|
" ",
|
|
665241
665455
|
t.skillsCreation.modeManual
|
|
665242
665456
|
)
|
|
665457
|
+
),
|
|
665458
|
+
onInstall && import_react158.default.createElement(
|
|
665459
|
+
Box_default,
|
|
665460
|
+
null,
|
|
665461
|
+
import_react158.default.createElement(Text, { color: theme14.colors.menuInfo, bold: true }, "[I]"),
|
|
665462
|
+
import_react158.default.createElement(
|
|
665463
|
+
Text,
|
|
665464
|
+
{ color: theme14.colors.text },
|
|
665465
|
+
" ",
|
|
665466
|
+
t.skillsCreation.modeInstall
|
|
665467
|
+
)
|
|
665243
665468
|
)
|
|
665244
665469
|
),
|
|
665245
665470
|
import_react158.default.createElement(
|
|
@@ -670844,7 +671069,10 @@ function PanelsManager({ terminalWidth, workingDirectory, showSessionPanel, show
|
|
|
670844
671069
|
showSkillsCreation && import_react175.default.createElement(
|
|
670845
671070
|
Box_default,
|
|
670846
671071
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
670847
|
-
import_react175.default.createElement(SkillsCreationPanel, { projectRoot: workingDirectory, onSave: onSkillsSave, onCancel: () => setShowSkillsCreation(false)
|
|
671072
|
+
import_react175.default.createElement(SkillsCreationPanel, { projectRoot: workingDirectory, onSave: onSkillsSave, onCancel: () => setShowSkillsCreation(false), onInstall: () => {
|
|
671073
|
+
setShowSkillsCreation(false);
|
|
671074
|
+
setShowSkillsInstall(true);
|
|
671075
|
+
} })
|
|
670848
671076
|
),
|
|
670849
671077
|
showSkillsInstall && import_react175.default.createElement(
|
|
670850
671078
|
Box_default,
|
|
@@ -679186,7 +679414,7 @@ __export(daemonLogger_exports, {
|
|
|
679186
679414
|
DaemonLogger: () => DaemonLogger
|
|
679187
679415
|
});
|
|
679188
679416
|
import { existsSync as existsSync47, statSync as statSync2, renameSync as renameSync2, writeFileSync as writeFileSync25, appendFileSync as appendFileSync2, mkdirSync as mkdirSync24 } from "fs";
|
|
679189
|
-
import { join as join51, dirname as
|
|
679417
|
+
import { join as join51, dirname as dirname13, basename as basename9 } from "path";
|
|
679190
679418
|
var DaemonLogger;
|
|
679191
679419
|
var init_daemonLogger = __esm({
|
|
679192
679420
|
"dist/utils/sse/daemonLogger.js"() {
|
|
@@ -679220,7 +679448,7 @@ var init_daemonLogger = __esm({
|
|
|
679220
679448
|
* 确保日志目录和归档目录存在
|
|
679221
679449
|
*/
|
|
679222
679450
|
ensureLogDirectory() {
|
|
679223
|
-
const logDir =
|
|
679451
|
+
const logDir = dirname13(this.logFilePath);
|
|
679224
679452
|
const archiveDir = join51(logDir, "archive");
|
|
679225
679453
|
if (!existsSync47(logDir)) {
|
|
679226
679454
|
mkdirSync24(logDir, { recursive: true });
|
|
@@ -679276,8 +679504,8 @@ var init_daemonLogger = __esm({
|
|
|
679276
679504
|
* 归档到 archive/YYYY-MM-DD/ 目录下
|
|
679277
679505
|
*/
|
|
679278
679506
|
rotate() {
|
|
679279
|
-
const logDir =
|
|
679280
|
-
const logFileName =
|
|
679507
|
+
const logDir = dirname13(this.logFilePath);
|
|
679508
|
+
const logFileName = basename9(this.logFilePath);
|
|
679281
679509
|
const dateDir = this.getDateDirectory();
|
|
679282
679510
|
const archiveDateDir = join51(logDir, "archive", dateDir);
|
|
679283
679511
|
if (!existsSync47(archiveDateDir)) {
|
|
@@ -692626,7 +692854,7 @@ var require_package4 = __commonJS({
|
|
|
692626
692854
|
"package.json"(exports2, module2) {
|
|
692627
692855
|
module2.exports = {
|
|
692628
692856
|
name: "snow-ai",
|
|
692629
|
-
version: "0.8.
|
|
692857
|
+
version: "0.8.9",
|
|
692630
692858
|
description: "Agentic coding in your terminal",
|
|
692631
692859
|
license: "MIT",
|
|
692632
692860
|
bin: {
|
|
@@ -694860,7 +695088,7 @@ ${heading2(t.summary)}: ${success2(formatTemplate(t.summaryOk, { count: okCount
|
|
|
694860
695088
|
// dist/cli.js
|
|
694861
695089
|
import { readFileSync as readFileSync34 } from "fs";
|
|
694862
695090
|
import { join as join52 } from "path";
|
|
694863
|
-
import { fileURLToPath as
|
|
695091
|
+
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
694864
695092
|
|
|
694865
695093
|
// dist/utils/config/legacyConfigMigration.js
|
|
694866
695094
|
init_unifiedSettings();
|
|
@@ -695168,7 +695396,7 @@ try {
|
|
|
695168
695396
|
runLegacyConfigMigration();
|
|
695169
695397
|
} catch {
|
|
695170
695398
|
}
|
|
695171
|
-
var __dirname2 =
|
|
695399
|
+
var __dirname2 = fileURLToPath7(new URL(".", import.meta.url));
|
|
695172
695400
|
var packageJson = JSON.parse(readFileSync34(join52(__dirname2, "../package.json"), "utf-8"));
|
|
695173
695401
|
var VERSION4 = packageJson.version;
|
|
695174
695402
|
async function loadDependencies() {
|