snow-ai 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bundle/cli.mjs +1048 -1091
- package/bundle/package.json +1 -1
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -1421,7 +1421,7 @@ var require_react_development = __commonJS({
|
|
|
1421
1421
|
}
|
|
1422
1422
|
return dispatcher.useContext(Context);
|
|
1423
1423
|
}
|
|
1424
|
-
function
|
|
1424
|
+
function useState61(initialState) {
|
|
1425
1425
|
var dispatcher = resolveDispatcher();
|
|
1426
1426
|
return dispatcher.useState(initialState);
|
|
1427
1427
|
}
|
|
@@ -1433,7 +1433,7 @@ var require_react_development = __commonJS({
|
|
|
1433
1433
|
var dispatcher = resolveDispatcher();
|
|
1434
1434
|
return dispatcher.useRef(initialValue);
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1436
|
+
function useEffect53(create3, deps) {
|
|
1437
1437
|
var dispatcher = resolveDispatcher();
|
|
1438
1438
|
return dispatcher.useEffect(create3, deps);
|
|
1439
1439
|
}
|
|
@@ -2216,7 +2216,7 @@ var require_react_development = __commonJS({
|
|
|
2216
2216
|
exports2.useContext = useContext13;
|
|
2217
2217
|
exports2.useDebugValue = useDebugValue;
|
|
2218
2218
|
exports2.useDeferredValue = useDeferredValue;
|
|
2219
|
-
exports2.useEffect =
|
|
2219
|
+
exports2.useEffect = useEffect53;
|
|
2220
2220
|
exports2.useId = useId;
|
|
2221
2221
|
exports2.useImperativeHandle = useImperativeHandle2;
|
|
2222
2222
|
exports2.useInsertionEffect = useInsertionEffect;
|
|
@@ -2224,7 +2224,7 @@ var require_react_development = __commonJS({
|
|
|
2224
2224
|
exports2.useMemo = useMemo30;
|
|
2225
2225
|
exports2.useReducer = useReducer8;
|
|
2226
2226
|
exports2.useRef = useRef14;
|
|
2227
|
-
exports2.useState =
|
|
2227
|
+
exports2.useState = useState61;
|
|
2228
2228
|
exports2.useSyncExternalStore = useSyncExternalStore;
|
|
2229
2229
|
exports2.useTransition = useTransition;
|
|
2230
2230
|
exports2.version = ReactVersion;
|
|
@@ -28457,7 +28457,7 @@ var require_extension = __commonJS({
|
|
|
28457
28457
|
var require_websocket = __commonJS({
|
|
28458
28458
|
"node_modules/ws/lib/websocket.js"(exports2, module2) {
|
|
28459
28459
|
"use strict";
|
|
28460
|
-
var
|
|
28460
|
+
var EventEmitter11 = __require("events");
|
|
28461
28461
|
var https2 = __require("https");
|
|
28462
28462
|
var http2 = __require("http");
|
|
28463
28463
|
var net = __require("net");
|
|
@@ -28489,7 +28489,7 @@ var require_websocket = __commonJS({
|
|
|
28489
28489
|
var protocolVersions = [8, 13];
|
|
28490
28490
|
var readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"];
|
|
28491
28491
|
var subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
|
|
28492
|
-
var WebSocket3 = class _WebSocket extends
|
|
28492
|
+
var WebSocket3 = class _WebSocket extends EventEmitter11 {
|
|
28493
28493
|
/**
|
|
28494
28494
|
* Create a new `WebSocket`.
|
|
28495
28495
|
*
|
|
@@ -29483,7 +29483,7 @@ var require_subprotocol = __commonJS({
|
|
|
29483
29483
|
var require_websocket_server = __commonJS({
|
|
29484
29484
|
"node_modules/ws/lib/websocket-server.js"(exports2, module2) {
|
|
29485
29485
|
"use strict";
|
|
29486
|
-
var
|
|
29486
|
+
var EventEmitter11 = __require("events");
|
|
29487
29487
|
var http2 = __require("http");
|
|
29488
29488
|
var { Duplex } = __require("stream");
|
|
29489
29489
|
var { createHash: createHash3 } = __require("crypto");
|
|
@@ -29496,7 +29496,7 @@ var require_websocket_server = __commonJS({
|
|
|
29496
29496
|
var RUNNING = 0;
|
|
29497
29497
|
var CLOSING = 1;
|
|
29498
29498
|
var CLOSED = 2;
|
|
29499
|
-
var WebSocketServer2 = class extends
|
|
29499
|
+
var WebSocketServer2 = class extends EventEmitter11 {
|
|
29500
29500
|
/**
|
|
29501
29501
|
* Create a `WebSocketServer` instance.
|
|
29502
29502
|
*
|
|
@@ -50543,10 +50543,10 @@ var require_wrap_handler = __commonJS({
|
|
|
50543
50543
|
var require_dispatcher = __commonJS({
|
|
50544
50544
|
"node_modules/undici/lib/dispatcher/dispatcher.js"(exports2, module2) {
|
|
50545
50545
|
"use strict";
|
|
50546
|
-
var
|
|
50546
|
+
var EventEmitter11 = __require("node:events");
|
|
50547
50547
|
var WrapHandler = require_wrap_handler();
|
|
50548
50548
|
var wrapInterceptor = (dispatch) => (opts, handler) => dispatch(opts, WrapHandler.wrap(handler));
|
|
50549
|
-
var Dispatcher = class extends
|
|
50549
|
+
var Dispatcher = class extends EventEmitter11 {
|
|
50550
50550
|
dispatch() {
|
|
50551
50551
|
throw new Error("not implemented");
|
|
50552
50552
|
}
|
|
@@ -62949,9 +62949,9 @@ var require_memory_cache_store = __commonJS({
|
|
|
62949
62949
|
"node_modules/undici/lib/cache/memory-cache-store.js"(exports2, module2) {
|
|
62950
62950
|
"use strict";
|
|
62951
62951
|
var { Writable } = __require("node:stream");
|
|
62952
|
-
var { EventEmitter:
|
|
62952
|
+
var { EventEmitter: EventEmitter11 } = __require("node:events");
|
|
62953
62953
|
var { assertCacheKey, assertCacheValue } = require_cache();
|
|
62954
|
-
var MemoryCacheStore = class extends
|
|
62954
|
+
var MemoryCacheStore = class extends EventEmitter11 {
|
|
62955
62955
|
#maxCount = 1024;
|
|
62956
62956
|
#maxSize = 104857600;
|
|
62957
62957
|
// 100MB
|
|
@@ -80866,6 +80866,7 @@ var init_en = __esm({
|
|
|
80866
80866
|
reindex: "Rebuild codebase index, detect changed, deleted, new and modified files",
|
|
80867
80867
|
permissions: "Manage always-approved tools permissions",
|
|
80868
80868
|
backend: "Show background processes panel",
|
|
80869
|
+
profiles: "Switch configuration profiles",
|
|
80869
80870
|
vulnerabilityHunting: "Toggle vulnerability hunting mode for security-focused code analysis",
|
|
80870
80871
|
quit: "Exit the application"
|
|
80871
80872
|
}
|
|
@@ -81659,7 +81660,7 @@ var init_zh = __esm({
|
|
|
81659
81660
|
advancedModel: "\u9AD8\u7EA7\u6A21\u578B(\u952E\u5165\u53EF\u641C\u7D22):",
|
|
81660
81661
|
basicModel: "\u57FA\u7840\u6A21\u578B(\u952E\u5165\u53EF\u641C\u7D22):",
|
|
81661
81662
|
maxContextTokens: "\u6700\u5927\u4E0A\u4E0B\u6587\u4EE4\u724C:",
|
|
81662
|
-
maxTokens: "\u6700\u5927\u4EE4\u724C\u6570:",
|
|
81663
|
+
maxTokens: "\u6700\u5927\u56DE\u590D\u4EE4\u724C\u6570:",
|
|
81663
81664
|
editSimilarityThreshold: "\u6587\u4EF6\u7F16\u8F91\u76F8\u4F3C\u5EA6\u9608\u503C(0-1, \u975E\u5FC5\u8981\u4E0D\u6539):",
|
|
81664
81665
|
notSet: "\u672A\u8BBE\u7F6E",
|
|
81665
81666
|
enabled: "[\u2713] \u5DF2\u542F\u7528",
|
|
@@ -81951,6 +81952,7 @@ var init_zh = __esm({
|
|
|
81951
81952
|
permissions: "\u7BA1\u7406\u59CB\u7EC8\u6279\u51C6\u7684\u5DE5\u5177\u6743\u9650",
|
|
81952
81953
|
vulnerabilityHunting: "\u5207\u6362\u6F0F\u6D1E\u68C0\u67E5\u6A21\u5F0F\uFF0C\u8FDB\u884C\u5B89\u5168\u6027\u4EE3\u7801\u5206\u6790",
|
|
81953
81954
|
backend: "\u663E\u793A\u540E\u53F0\u8FDB\u7A0B\u9762\u677F",
|
|
81955
|
+
profiles: "\u6253\u5F00\u914D\u7F6E\u6587\u4EF6\u5207\u6362\u9762\u677F",
|
|
81954
81956
|
quit: "\u9000\u51FA\u5E94\u7528\u7A0B\u5E8F"
|
|
81955
81957
|
}
|
|
81956
81958
|
},
|
|
@@ -82743,7 +82745,7 @@ var init_zh_TW = __esm({
|
|
|
82743
82745
|
advancedModel: "\u9032\u968E\u6A21\u578B(\u8F38\u5165\u5F8C\u53EF\u4EE5\u641C\u5C0B):",
|
|
82744
82746
|
basicModel: "\u57FA\u790E\u6A21\u578B(\u8F38\u5165\u5F8C\u53EF\u4EE5\u641C\u5C0B):",
|
|
82745
82747
|
maxContextTokens: "\u6700\u5927\u4E0A\u4E0B\u6587\u4EE4\u724C:",
|
|
82746
|
-
maxTokens: "\u6700\u5927\u4EE4\u724C\u6578:",
|
|
82748
|
+
maxTokens: "\u6700\u5927\u56DE\u590D\u4EE4\u724C\u6578:",
|
|
82747
82749
|
editSimilarityThreshold: "\u6A94\u6848\u7DE8\u8F2F\u76F8\u4F3C\u5EA6\u95BE\u503C(0-1, \u975E\u5FC5\u8981\u4E0D\u6539):",
|
|
82748
82750
|
notSet: "\u672A\u8A2D\u5B9A",
|
|
82749
82751
|
enabled: "[\u2713] \u5DF2\u555F\u7528",
|
|
@@ -83035,6 +83037,7 @@ var init_zh_TW = __esm({
|
|
|
83035
83037
|
permissions: "\u7BA1\u7406\u6C38\u9060\u5141\u8A31\u7684\u5DE5\u5177\u6B0A\u9650",
|
|
83036
83038
|
vulnerabilityHunting: "\u5207\u63DB\u6F0F\u6D1E\u6AA2\u67E5\u6A21\u5F0F\uFF0C\u9032\u884C\u5B89\u5168\u6027\u4EE3\u78BC\u5206\u6790",
|
|
83037
83039
|
backend: "\u986F\u793A\u80CC\u666F\u8655\u7406\u7A0B\u5E8F\u9762\u677F",
|
|
83040
|
+
profiles: "\u958B\u555F\u8A2D\u5B9A\u6A94\u5207\u63DB\u9762\u677F",
|
|
83038
83041
|
quit: "\u9000\u51FA\u61C9\u7528\u7A0B\u5F0F"
|
|
83039
83042
|
}
|
|
83040
83043
|
},
|
|
@@ -376009,7 +376012,7 @@ var require_EventEmitter = __commonJS({
|
|
|
376009
376012
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
376010
376013
|
exports2.EventEmitter = void 0;
|
|
376011
376014
|
var mitt_1 = __importDefault2((init_mitt2(), __toCommonJS(mitt_exports)));
|
|
376012
|
-
var
|
|
376015
|
+
var EventEmitter11 = class {
|
|
376013
376016
|
#emitter = (0, mitt_1.default)();
|
|
376014
376017
|
on(type, handler) {
|
|
376015
376018
|
this.#emitter.on(type, handler);
|
|
@@ -376057,7 +376060,7 @@ var require_EventEmitter = __commonJS({
|
|
|
376057
376060
|
return this;
|
|
376058
376061
|
}
|
|
376059
376062
|
};
|
|
376060
|
-
exports2.EventEmitter =
|
|
376063
|
+
exports2.EventEmitter = EventEmitter11;
|
|
376061
376064
|
}
|
|
376062
376065
|
});
|
|
376063
376066
|
|
|
@@ -429558,6 +429561,24 @@ var init_sessionManager = __esm({
|
|
|
429558
429561
|
writable: true,
|
|
429559
429562
|
value: void 0
|
|
429560
429563
|
});
|
|
429564
|
+
Object.defineProperty(this, "sessionListCache", {
|
|
429565
|
+
enumerable: true,
|
|
429566
|
+
configurable: true,
|
|
429567
|
+
writable: true,
|
|
429568
|
+
value: null
|
|
429569
|
+
});
|
|
429570
|
+
Object.defineProperty(this, "cacheTimestamp", {
|
|
429571
|
+
enumerable: true,
|
|
429572
|
+
configurable: true,
|
|
429573
|
+
writable: true,
|
|
429574
|
+
value: 0
|
|
429575
|
+
});
|
|
429576
|
+
Object.defineProperty(this, "CACHE_TTL", {
|
|
429577
|
+
enumerable: true,
|
|
429578
|
+
configurable: true,
|
|
429579
|
+
writable: true,
|
|
429580
|
+
value: 5e3
|
|
429581
|
+
});
|
|
429561
429582
|
Object.defineProperty(this, "lastLoadHookError", {
|
|
429562
429583
|
enumerable: true,
|
|
429563
429584
|
configurable: true,
|
|
@@ -429673,6 +429694,7 @@ var init_sessionManager = __esm({
|
|
|
429673
429694
|
await this.ensureSessionsDir(sessionDate);
|
|
429674
429695
|
const sessionPath = this.getSessionPath(session.id, sessionDate, session.projectId);
|
|
429675
429696
|
await fs27.writeFile(sessionPath, JSON.stringify(session, null, 2));
|
|
429697
|
+
this.invalidateCache();
|
|
429676
429698
|
}
|
|
429677
429699
|
/**
|
|
429678
429700
|
* 清理未完成的 tool_calls
|
|
@@ -429860,7 +429882,10 @@ var init_sessionManager = __esm({
|
|
|
429860
429882
|
} catch (error) {
|
|
429861
429883
|
}
|
|
429862
429884
|
}
|
|
429863
|
-
|
|
429885
|
+
const sorted = sessions.sort((a, b) => b.updatedAt - a.updatedAt);
|
|
429886
|
+
this.sessionListCache = sorted;
|
|
429887
|
+
this.cacheTimestamp = Date.now();
|
|
429888
|
+
return sorted;
|
|
429864
429889
|
} catch (error) {
|
|
429865
429890
|
return [];
|
|
429866
429891
|
}
|
|
@@ -429913,7 +429938,14 @@ var init_sessionManager = __esm({
|
|
|
429913
429938
|
}
|
|
429914
429939
|
}
|
|
429915
429940
|
async listSessionsPaginated(page = 0, pageSize = 20, searchQuery) {
|
|
429916
|
-
|
|
429941
|
+
const now = Date.now();
|
|
429942
|
+
const cacheValid = this.sessionListCache && now - this.cacheTimestamp < this.CACHE_TTL;
|
|
429943
|
+
let allSessions;
|
|
429944
|
+
if (cacheValid && !searchQuery) {
|
|
429945
|
+
allSessions = this.sessionListCache;
|
|
429946
|
+
} else {
|
|
429947
|
+
allSessions = await this.listSessions();
|
|
429948
|
+
}
|
|
429917
429949
|
const normalizedQuery = searchQuery == null ? void 0 : searchQuery.toLowerCase().trim();
|
|
429918
429950
|
const matchesQuery = (session) => {
|
|
429919
429951
|
var _a21;
|
|
@@ -429924,209 +429956,21 @@ var init_sessionManager = __esm({
|
|
|
429924
429956
|
const idMatch = session.id.toLowerCase().includes(normalizedQuery);
|
|
429925
429957
|
return titleMatch || summaryMatch || idMatch;
|
|
429926
429958
|
};
|
|
429959
|
+
const filtered = normalizedQuery ? allSessions.filter(matchesQuery) : allSessions;
|
|
429960
|
+
const total = filtered.length;
|
|
429927
429961
|
const startIndex = page * pageSize;
|
|
429928
429962
|
const endIndex = startIndex + pageSize;
|
|
429929
|
-
const
|
|
429930
|
-
const heap = [];
|
|
429931
|
-
const heapSwap = (i, j) => {
|
|
429932
|
-
const tmp = heap[i];
|
|
429933
|
-
heap[i] = heap[j];
|
|
429934
|
-
heap[j] = tmp;
|
|
429935
|
-
};
|
|
429936
|
-
const heapSiftUp = (idx2) => {
|
|
429937
|
-
let i = idx2;
|
|
429938
|
-
while (i > 0) {
|
|
429939
|
-
const p = Math.floor((i - 1) / 2);
|
|
429940
|
-
if (heap[p].updatedAt <= heap[i].updatedAt)
|
|
429941
|
-
break;
|
|
429942
|
-
heapSwap(i, p);
|
|
429943
|
-
i = p;
|
|
429944
|
-
}
|
|
429945
|
-
};
|
|
429946
|
-
const heapSiftDown = (idx2) => {
|
|
429947
|
-
let i = idx2;
|
|
429948
|
-
while (true) {
|
|
429949
|
-
const l2 = i * 2 + 1;
|
|
429950
|
-
const r = i * 2 + 2;
|
|
429951
|
-
let smallest = i;
|
|
429952
|
-
if (l2 < heap.length && heap[l2].updatedAt < heap[smallest].updatedAt) {
|
|
429953
|
-
smallest = l2;
|
|
429954
|
-
}
|
|
429955
|
-
if (r < heap.length && heap[r].updatedAt < heap[smallest].updatedAt) {
|
|
429956
|
-
smallest = r;
|
|
429957
|
-
}
|
|
429958
|
-
if (smallest === i)
|
|
429959
|
-
break;
|
|
429960
|
-
heapSwap(i, smallest);
|
|
429961
|
-
i = smallest;
|
|
429962
|
-
}
|
|
429963
|
-
};
|
|
429964
|
-
const heapPush = (item) => {
|
|
429965
|
-
heap.push(item);
|
|
429966
|
-
heapSiftUp(heap.length - 1);
|
|
429967
|
-
};
|
|
429968
|
-
const heapReplaceRoot = (item) => {
|
|
429969
|
-
heap[0] = item;
|
|
429970
|
-
heapSiftDown(0);
|
|
429971
|
-
};
|
|
429972
|
-
const consider = (session) => {
|
|
429973
|
-
if (!matchesQuery(session))
|
|
429974
|
-
return;
|
|
429975
|
-
if (k <= 0)
|
|
429976
|
-
return;
|
|
429977
|
-
const item = { updatedAt: session.updatedAt, session };
|
|
429978
|
-
if (heap.length < k) {
|
|
429979
|
-
heapPush(item);
|
|
429980
|
-
return;
|
|
429981
|
-
}
|
|
429982
|
-
if (heap[0] && item.updatedAt > heap[0].updatedAt) {
|
|
429983
|
-
heapReplaceRoot(item);
|
|
429984
|
-
}
|
|
429985
|
-
};
|
|
429986
|
-
const scanNewFormat = async () => {
|
|
429987
|
-
let total2 = 0;
|
|
429988
|
-
try {
|
|
429989
|
-
const projectDir = this.getProjectSessionsDir();
|
|
429990
|
-
const dateFolders = await fs27.readdir(projectDir);
|
|
429991
|
-
for (const dateFolder of dateFolders) {
|
|
429992
|
-
if (!isDateFolder(dateFolder))
|
|
429993
|
-
continue;
|
|
429994
|
-
const datePath = path35.join(projectDir, dateFolder);
|
|
429995
|
-
let files;
|
|
429996
|
-
try {
|
|
429997
|
-
files = await fs27.readdir(datePath);
|
|
429998
|
-
} catch {
|
|
429999
|
-
continue;
|
|
430000
|
-
}
|
|
430001
|
-
for (const file of files) {
|
|
430002
|
-
if (!file.endsWith(".json"))
|
|
430003
|
-
continue;
|
|
430004
|
-
try {
|
|
430005
|
-
const sessionPath = path35.join(datePath, file);
|
|
430006
|
-
const data = await fs27.readFile(sessionPath, "utf-8");
|
|
430007
|
-
const session = JSON.parse(data);
|
|
430008
|
-
const item = {
|
|
430009
|
-
id: session.id,
|
|
430010
|
-
title: this.cleanTitle(session.title),
|
|
430011
|
-
summary: session.summary,
|
|
430012
|
-
createdAt: session.createdAt,
|
|
430013
|
-
updatedAt: session.updatedAt,
|
|
430014
|
-
messageCount: session.messageCount,
|
|
430015
|
-
projectPath: session.projectPath,
|
|
430016
|
-
projectId: session.projectId,
|
|
430017
|
-
compressedFrom: session.compressedFrom,
|
|
430018
|
-
compressedAt: session.compressedAt
|
|
430019
|
-
};
|
|
430020
|
-
if (!matchesQuery(item))
|
|
430021
|
-
continue;
|
|
430022
|
-
total2 += 1;
|
|
430023
|
-
consider(item);
|
|
430024
|
-
} catch {
|
|
430025
|
-
continue;
|
|
430026
|
-
}
|
|
430027
|
-
}
|
|
430028
|
-
}
|
|
430029
|
-
} catch {
|
|
430030
|
-
return 0;
|
|
430031
|
-
}
|
|
430032
|
-
return total2;
|
|
430033
|
-
};
|
|
430034
|
-
const scanLegacyFormat = async () => {
|
|
430035
|
-
let total2 = 0;
|
|
430036
|
-
try {
|
|
430037
|
-
const files = await fs27.readdir(this.sessionsDir);
|
|
430038
|
-
for (const file of files) {
|
|
430039
|
-
const filePath = path35.join(this.sessionsDir, file);
|
|
430040
|
-
let stat4;
|
|
430041
|
-
try {
|
|
430042
|
-
stat4 = await fs27.stat(filePath);
|
|
430043
|
-
} catch {
|
|
430044
|
-
continue;
|
|
430045
|
-
}
|
|
430046
|
-
if (stat4.isDirectory() && isDateFolder(file) && !isProjectFolder(file)) {
|
|
430047
|
-
let legacyFiles;
|
|
430048
|
-
try {
|
|
430049
|
-
legacyFiles = await fs27.readdir(filePath);
|
|
430050
|
-
} catch {
|
|
430051
|
-
continue;
|
|
430052
|
-
}
|
|
430053
|
-
for (const legacyFile of legacyFiles) {
|
|
430054
|
-
if (!legacyFile.endsWith(".json"))
|
|
430055
|
-
continue;
|
|
430056
|
-
try {
|
|
430057
|
-
const sessionPath = path35.join(filePath, legacyFile);
|
|
430058
|
-
const data = await fs27.readFile(sessionPath, "utf-8");
|
|
430059
|
-
const session = JSON.parse(data);
|
|
430060
|
-
if (session.projectPath && session.projectPath !== this.currentProjectPath) {
|
|
430061
|
-
continue;
|
|
430062
|
-
}
|
|
430063
|
-
if (session.projectId && session.projectId !== this.currentProjectId) {
|
|
430064
|
-
continue;
|
|
430065
|
-
}
|
|
430066
|
-
const item = {
|
|
430067
|
-
id: session.id,
|
|
430068
|
-
title: this.cleanTitle(session.title),
|
|
430069
|
-
summary: session.summary,
|
|
430070
|
-
createdAt: session.createdAt,
|
|
430071
|
-
updatedAt: session.updatedAt,
|
|
430072
|
-
messageCount: session.messageCount,
|
|
430073
|
-
projectPath: session.projectPath,
|
|
430074
|
-
projectId: session.projectId,
|
|
430075
|
-
compressedFrom: session.compressedFrom,
|
|
430076
|
-
compressedAt: session.compressedAt
|
|
430077
|
-
};
|
|
430078
|
-
if (!matchesQuery(item))
|
|
430079
|
-
continue;
|
|
430080
|
-
total2 += 1;
|
|
430081
|
-
consider(item);
|
|
430082
|
-
} catch {
|
|
430083
|
-
continue;
|
|
430084
|
-
}
|
|
430085
|
-
}
|
|
430086
|
-
}
|
|
430087
|
-
if (file.endsWith(".json")) {
|
|
430088
|
-
try {
|
|
430089
|
-
const data = await fs27.readFile(filePath, "utf-8");
|
|
430090
|
-
const session = JSON.parse(data);
|
|
430091
|
-
if (session.projectPath && session.projectPath !== this.currentProjectPath) {
|
|
430092
|
-
continue;
|
|
430093
|
-
}
|
|
430094
|
-
if (session.projectId && session.projectId !== this.currentProjectId) {
|
|
430095
|
-
continue;
|
|
430096
|
-
}
|
|
430097
|
-
const item = {
|
|
430098
|
-
id: session.id,
|
|
430099
|
-
title: this.cleanTitle(session.title),
|
|
430100
|
-
summary: session.summary,
|
|
430101
|
-
createdAt: session.createdAt,
|
|
430102
|
-
updatedAt: session.updatedAt,
|
|
430103
|
-
messageCount: session.messageCount,
|
|
430104
|
-
projectPath: session.projectPath,
|
|
430105
|
-
projectId: session.projectId,
|
|
430106
|
-
compressedFrom: session.compressedFrom,
|
|
430107
|
-
compressedAt: session.compressedAt
|
|
430108
|
-
};
|
|
430109
|
-
if (!matchesQuery(item))
|
|
430110
|
-
continue;
|
|
430111
|
-
total2 += 1;
|
|
430112
|
-
consider(item);
|
|
430113
|
-
} catch {
|
|
430114
|
-
continue;
|
|
430115
|
-
}
|
|
430116
|
-
}
|
|
430117
|
-
}
|
|
430118
|
-
} catch {
|
|
430119
|
-
return 0;
|
|
430120
|
-
}
|
|
430121
|
-
return total2;
|
|
430122
|
-
};
|
|
430123
|
-
const totalNew = await scanNewFormat();
|
|
430124
|
-
const total = totalNew > 0 ? totalNew : await scanLegacyFormat();
|
|
430125
|
-
const topK = heap.map((h) => h.session).sort((a, b) => b.updatedAt - a.updatedAt);
|
|
430126
|
-
const sessions = topK.slice(startIndex, endIndex);
|
|
429963
|
+
const sessions = filtered.slice(startIndex, endIndex);
|
|
430127
429964
|
const hasMore = endIndex < total;
|
|
430128
429965
|
return { sessions, total, hasMore };
|
|
430129
429966
|
}
|
|
429967
|
+
/**
|
|
429968
|
+
* 使缓存失效
|
|
429969
|
+
*/
|
|
429970
|
+
invalidateCache() {
|
|
429971
|
+
this.sessionListCache = null;
|
|
429972
|
+
this.cacheTimestamp = 0;
|
|
429973
|
+
}
|
|
430130
429974
|
async readSessionsFromDir(dirPath, sessions) {
|
|
430131
429975
|
try {
|
|
430132
429976
|
const files = await fs27.readdir(dirPath);
|
|
@@ -430731,6 +430575,36 @@ var init_date_utils = __esm({
|
|
|
430731
430575
|
}
|
|
430732
430576
|
});
|
|
430733
430577
|
|
|
430578
|
+
// dist/utils/events/todoEvents.js
|
|
430579
|
+
import { EventEmitter as EventEmitter9 } from "events";
|
|
430580
|
+
var TodoEventEmitter, todoEvents;
|
|
430581
|
+
var init_todoEvents = __esm({
|
|
430582
|
+
"dist/utils/events/todoEvents.js"() {
|
|
430583
|
+
"use strict";
|
|
430584
|
+
TodoEventEmitter = class extends EventEmitter9 {
|
|
430585
|
+
/**
|
|
430586
|
+
* 触发 TODO 更新事件
|
|
430587
|
+
*/
|
|
430588
|
+
emitTodoUpdate(sessionId, todos) {
|
|
430589
|
+
this.emit("todo-update", { sessionId, todos });
|
|
430590
|
+
}
|
|
430591
|
+
/**
|
|
430592
|
+
* 监听 TODO 更新事件
|
|
430593
|
+
*/
|
|
430594
|
+
onTodoUpdate(callback) {
|
|
430595
|
+
this.on("todo-update", callback);
|
|
430596
|
+
}
|
|
430597
|
+
/**
|
|
430598
|
+
* 移除 TODO 更新监听器
|
|
430599
|
+
*/
|
|
430600
|
+
offTodoUpdate(callback) {
|
|
430601
|
+
this.off("todo-update", callback);
|
|
430602
|
+
}
|
|
430603
|
+
};
|
|
430604
|
+
todoEvents = new TodoEventEmitter();
|
|
430605
|
+
}
|
|
430606
|
+
});
|
|
430607
|
+
|
|
430734
430608
|
// dist/mcp/todo.js
|
|
430735
430609
|
import fs29 from "fs/promises";
|
|
430736
430610
|
import path37 from "path";
|
|
@@ -430739,6 +430613,7 @@ var init_todo = __esm({
|
|
|
430739
430613
|
"dist/mcp/todo.js"() {
|
|
430740
430614
|
"use strict";
|
|
430741
430615
|
init_date_utils();
|
|
430616
|
+
init_todoEvents();
|
|
430742
430617
|
TodoService = class {
|
|
430743
430618
|
constructor(baseDir, getCurrentSessionId) {
|
|
430744
430619
|
Object.defineProperty(this, "todoDir", {
|
|
@@ -430797,6 +430672,7 @@ var init_todo = __esm({
|
|
|
430797
430672
|
updatedAt: now
|
|
430798
430673
|
};
|
|
430799
430674
|
await fs29.writeFile(todoPath, JSON.stringify(todoList, null, 2));
|
|
430675
|
+
todoEvents.emitTodoUpdate(sessionId, todos);
|
|
430800
430676
|
return todoList;
|
|
430801
430677
|
}
|
|
430802
430678
|
/**
|
|
@@ -535979,88 +535855,6 @@ ${simpleLatexToUnicode(latex)}
|
|
|
535979
535855
|
}
|
|
535980
535856
|
});
|
|
535981
535857
|
|
|
535982
|
-
// dist/ui/components/special/TodoTree.js
|
|
535983
|
-
function TodoTree({ todos }) {
|
|
535984
|
-
const { theme: theme14 } = useTheme();
|
|
535985
|
-
if (todos.length === 0) {
|
|
535986
|
-
return null;
|
|
535987
|
-
}
|
|
535988
|
-
const rootTodos = todos.filter((t) => !t.parentId);
|
|
535989
|
-
const childTodosMap = /* @__PURE__ */ new Map();
|
|
535990
|
-
todos.forEach((todo) => {
|
|
535991
|
-
if (todo.parentId) {
|
|
535992
|
-
const children = childTodosMap.get(todo.parentId) || [];
|
|
535993
|
-
children.push(todo);
|
|
535994
|
-
childTodosMap.set(todo.parentId, children);
|
|
535995
|
-
}
|
|
535996
|
-
});
|
|
535997
|
-
const getStatusIcon = (status) => {
|
|
535998
|
-
switch (status) {
|
|
535999
|
-
case "completed":
|
|
536000
|
-
return "[\u2713]";
|
|
536001
|
-
case "pending":
|
|
536002
|
-
return "[ ]";
|
|
536003
|
-
default:
|
|
536004
|
-
return "[ ]";
|
|
536005
|
-
}
|
|
536006
|
-
};
|
|
536007
|
-
const getStatusColor = (status) => {
|
|
536008
|
-
switch (status) {
|
|
536009
|
-
case "completed":
|
|
536010
|
-
return theme14.colors.success;
|
|
536011
|
-
case "pending":
|
|
536012
|
-
return theme14.colors.menuSecondary;
|
|
536013
|
-
}
|
|
536014
|
-
};
|
|
536015
|
-
const renderTodo = (todo, depth = 0) => {
|
|
536016
|
-
const children = childTodosMap.get(todo.id) || [];
|
|
536017
|
-
const indent = " ".repeat(depth);
|
|
536018
|
-
const statusIcon = getStatusIcon(todo.status);
|
|
536019
|
-
const statusColor = getStatusColor(todo.status);
|
|
536020
|
-
return import_react75.default.createElement(
|
|
536021
|
-
Box_default,
|
|
536022
|
-
{ key: todo.id, flexDirection: "column" },
|
|
536023
|
-
import_react75.default.createElement(
|
|
536024
|
-
Box_default,
|
|
536025
|
-
null,
|
|
536026
|
-
import_react75.default.createElement(
|
|
536027
|
-
Text,
|
|
536028
|
-
{ color: statusColor },
|
|
536029
|
-
indent,
|
|
536030
|
-
statusIcon,
|
|
536031
|
-
" ",
|
|
536032
|
-
todo.content
|
|
536033
|
-
)
|
|
536034
|
-
),
|
|
536035
|
-
children.map((child) => renderTodo(child, depth + 1))
|
|
536036
|
-
);
|
|
536037
|
-
};
|
|
536038
|
-
return import_react75.default.createElement(
|
|
536039
|
-
Box_default,
|
|
536040
|
-
{ flexDirection: "column", borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1, marginBottom: 1 },
|
|
536041
|
-
import_react75.default.createElement(
|
|
536042
|
-
Box_default,
|
|
536043
|
-
{ marginBottom: 0 },
|
|
536044
|
-
import_react75.default.createElement(Text, { bold: true, color: theme14.colors.menuInfo }, "TODO List")
|
|
536045
|
-
),
|
|
536046
|
-
rootTodos.map((todo) => renderTodo(todo)),
|
|
536047
|
-
import_react75.default.createElement(
|
|
536048
|
-
Box_default,
|
|
536049
|
-
{ marginTop: 0 },
|
|
536050
|
-
import_react75.default.createElement(Text, { dimColor: true, color: theme14.colors.menuSecondary }, "[ ] Pending \xB7 [\u2713] Completed")
|
|
536051
|
-
)
|
|
536052
|
-
);
|
|
536053
|
-
}
|
|
536054
|
-
var import_react75;
|
|
536055
|
-
var init_TodoTree = __esm({
|
|
536056
|
-
async "dist/ui/components/special/TodoTree.js"() {
|
|
536057
|
-
"use strict";
|
|
536058
|
-
import_react75 = __toESM(require_react(), 1);
|
|
536059
|
-
await init_build2();
|
|
536060
|
-
init_ThemeContext();
|
|
536061
|
-
}
|
|
536062
|
-
});
|
|
536063
|
-
|
|
536064
535858
|
// dist/ui/components/tools/ToolResultPreview.js
|
|
536065
535859
|
function ToolResultPreview({ toolName, result: result2, maxLines = 5, isSubAgentInternal = false }) {
|
|
536066
535860
|
try {
|
|
@@ -536096,10 +535890,10 @@ function renderSubAgentPreview(data, _maxLines) {
|
|
|
536096
535890
|
if (!data.result)
|
|
536097
535891
|
return null;
|
|
536098
535892
|
const lines = data.result.split("\n").filter((line) => line.trim());
|
|
536099
|
-
return
|
|
535893
|
+
return import_react75.default.createElement(
|
|
536100
535894
|
Box_default,
|
|
536101
535895
|
{ marginLeft: 2 },
|
|
536102
|
-
|
|
535896
|
+
import_react75.default.createElement(
|
|
536103
535897
|
Text,
|
|
536104
535898
|
{ color: "gray", dimColor: true },
|
|
536105
535899
|
"\u2514\u2500 Sub-agent completed (",
|
|
@@ -536115,10 +535909,10 @@ function renderTerminalExecutePreview(data, isSubAgentInternal) {
|
|
|
536115
535909
|
const hasStdout = data.stdout && data.stdout.trim();
|
|
536116
535910
|
const hasStderr = data.stderr && data.stderr.trim();
|
|
536117
535911
|
if (isSubAgentInternal) {
|
|
536118
|
-
return
|
|
535912
|
+
return import_react75.default.createElement(
|
|
536119
535913
|
Box_default,
|
|
536120
535914
|
{ marginLeft: 2 },
|
|
536121
|
-
|
|
535915
|
+
import_react75.default.createElement(
|
|
536122
535916
|
Text,
|
|
536123
535917
|
{ color: hasError ? "red" : "gray", dimColor: true },
|
|
536124
535918
|
"\u2514\u2500 Exit code: ",
|
|
@@ -536131,10 +535925,10 @@ function renderTerminalExecutePreview(data, isSubAgentInternal) {
|
|
|
536131
535925
|
const showFullOutput = hasError;
|
|
536132
535926
|
if (!showFullOutput) {
|
|
536133
535927
|
if (!hasStdout) {
|
|
536134
|
-
return
|
|
535928
|
+
return import_react75.default.createElement(
|
|
536135
535929
|
Box_default,
|
|
536136
535930
|
{ marginLeft: 2 },
|
|
536137
|
-
|
|
535931
|
+
import_react75.default.createElement(
|
|
536138
535932
|
Text,
|
|
536139
535933
|
{ color: "green", dimColor: true },
|
|
536140
535934
|
"\u2514\u2500 \u2713 Exit code: ",
|
|
@@ -536142,33 +535936,33 @@ function renderTerminalExecutePreview(data, isSubAgentInternal) {
|
|
|
536142
535936
|
)
|
|
536143
535937
|
);
|
|
536144
535938
|
}
|
|
536145
|
-
return
|
|
535939
|
+
return import_react75.default.createElement(
|
|
536146
535940
|
Box_default,
|
|
536147
535941
|
{ flexDirection: "column", marginLeft: 2 },
|
|
536148
|
-
|
|
535942
|
+
import_react75.default.createElement(
|
|
536149
535943
|
Box_default,
|
|
536150
535944
|
{ flexDirection: "column" },
|
|
536151
|
-
|
|
536152
|
-
|
|
535945
|
+
import_react75.default.createElement(Text, { color: "green", dimColor: true }, "\u251C\u2500 command:"),
|
|
535946
|
+
import_react75.default.createElement(
|
|
536153
535947
|
Box_default,
|
|
536154
535948
|
{ marginLeft: 2 },
|
|
536155
|
-
|
|
535949
|
+
import_react75.default.createElement(Text, { color: "green" }, data.command)
|
|
536156
535950
|
)
|
|
536157
535951
|
),
|
|
536158
|
-
|
|
535952
|
+
import_react75.default.createElement(
|
|
536159
535953
|
Text,
|
|
536160
535954
|
{ color: "green", dimColor: true },
|
|
536161
535955
|
"\u251C\u2500 exitCode: ",
|
|
536162
535956
|
data.exitCode,
|
|
536163
535957
|
" \u2713"
|
|
536164
535958
|
),
|
|
536165
|
-
|
|
535959
|
+
import_react75.default.createElement(
|
|
536166
535960
|
Box_default,
|
|
536167
535961
|
{ flexDirection: "column" },
|
|
536168
|
-
|
|
536169
|
-
|
|
535962
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u251C\u2500 stdout:"),
|
|
535963
|
+
import_react75.default.createElement(Box_default, { marginLeft: 2, flexDirection: "column" }, data.stdout.split("\n").map((line, idx2) => import_react75.default.createElement(Text, { key: idx2, color: "white" }, line)))
|
|
536170
535964
|
),
|
|
536171
|
-
|
|
535965
|
+
import_react75.default.createElement(
|
|
536172
535966
|
Text,
|
|
536173
535967
|
{ color: "gray", dimColor: true },
|
|
536174
535968
|
"\u2514\u2500 executedAt: ",
|
|
@@ -536176,39 +535970,39 @@ function renderTerminalExecutePreview(data, isSubAgentInternal) {
|
|
|
536176
535970
|
)
|
|
536177
535971
|
);
|
|
536178
535972
|
}
|
|
536179
|
-
return
|
|
535973
|
+
return import_react75.default.createElement(
|
|
536180
535974
|
Box_default,
|
|
536181
535975
|
{ flexDirection: "column", marginLeft: 2 },
|
|
536182
|
-
|
|
535976
|
+
import_react75.default.createElement(
|
|
536183
535977
|
Box_default,
|
|
536184
535978
|
{ flexDirection: "column" },
|
|
536185
|
-
|
|
536186
|
-
|
|
535979
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u251C\u2500 command:"),
|
|
535980
|
+
import_react75.default.createElement(
|
|
536187
535981
|
Box_default,
|
|
536188
535982
|
{ marginLeft: 2 },
|
|
536189
|
-
|
|
535983
|
+
import_react75.default.createElement(Text, { color: "gray" }, data.command)
|
|
536190
535984
|
)
|
|
536191
535985
|
),
|
|
536192
|
-
|
|
535986
|
+
import_react75.default.createElement(
|
|
536193
535987
|
Text,
|
|
536194
535988
|
{ color: "red", bold: true },
|
|
536195
535989
|
"\u251C\u2500 exitCode: ",
|
|
536196
535990
|
data.exitCode,
|
|
536197
535991
|
" FAILED"
|
|
536198
535992
|
),
|
|
536199
|
-
hasStdout &&
|
|
535993
|
+
hasStdout && import_react75.default.createElement(
|
|
536200
535994
|
Box_default,
|
|
536201
535995
|
{ flexDirection: "column" },
|
|
536202
|
-
|
|
536203
|
-
|
|
535996
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u251C\u2500 stdout:"),
|
|
535997
|
+
import_react75.default.createElement(Box_default, { marginLeft: 2, flexDirection: "column" }, data.stdout.split("\n").map((line, idx2) => import_react75.default.createElement(Text, { key: idx2, color: "yellow" }, line)))
|
|
536204
535998
|
),
|
|
536205
|
-
hasStderr &&
|
|
535999
|
+
hasStderr && import_react75.default.createElement(
|
|
536206
536000
|
Box_default,
|
|
536207
536001
|
{ flexDirection: "column" },
|
|
536208
|
-
|
|
536209
|
-
|
|
536002
|
+
import_react75.default.createElement(Text, { color: "red", dimColor: true }, "\u251C\u2500 stderr:"),
|
|
536003
|
+
import_react75.default.createElement(Box_default, { marginLeft: 2, flexDirection: "column" }, data.stderr.split("\n").map((line, idx2) => import_react75.default.createElement(Text, { key: idx2, color: "red" }, line)))
|
|
536210
536004
|
),
|
|
536211
|
-
data.executedAt &&
|
|
536005
|
+
data.executedAt && import_react75.default.createElement(
|
|
536212
536006
|
Text,
|
|
536213
536007
|
{ color: "gray", dimColor: true },
|
|
536214
536008
|
"\u2514\u2500 executedAt: ",
|
|
@@ -536223,10 +536017,10 @@ function renderReadPreview(data, isSubAgentInternal) {
|
|
|
536223
536017
|
const readLineCount = lines.length;
|
|
536224
536018
|
const totalLines = data.totalLines || readLineCount;
|
|
536225
536019
|
if (isSubAgentInternal) {
|
|
536226
|
-
return
|
|
536020
|
+
return import_react75.default.createElement(
|
|
536227
536021
|
Box_default,
|
|
536228
536022
|
{ marginLeft: 2 },
|
|
536229
|
-
|
|
536023
|
+
import_react75.default.createElement(
|
|
536230
536024
|
Text,
|
|
536231
536025
|
{ color: "gray", dimColor: true },
|
|
536232
536026
|
"\u2514\u2500 Read ",
|
|
@@ -536237,10 +536031,10 @@ function renderReadPreview(data, isSubAgentInternal) {
|
|
|
536237
536031
|
);
|
|
536238
536032
|
}
|
|
536239
536033
|
const rangeInfo = data.startLine && data.endLine ? ` (lines ${data.startLine}-${data.endLine})` : "";
|
|
536240
|
-
return
|
|
536034
|
+
return import_react75.default.createElement(
|
|
536241
536035
|
Box_default,
|
|
536242
536036
|
{ marginLeft: 2 },
|
|
536243
|
-
|
|
536037
|
+
import_react75.default.createElement(
|
|
536244
536038
|
Text,
|
|
536245
536039
|
{ color: "gray", dimColor: true },
|
|
536246
536040
|
"\u2514\u2500 Read ",
|
|
@@ -536255,17 +536049,17 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536255
536049
|
var _a21, _b14, _c6, _d4, _e2, _f;
|
|
536256
536050
|
if (toolName === "ace-text-search" || toolName === "ace-text_search") {
|
|
536257
536051
|
if (!data || data.length === 0) {
|
|
536258
|
-
return
|
|
536052
|
+
return import_react75.default.createElement(
|
|
536259
536053
|
Box_default,
|
|
536260
536054
|
{ marginLeft: 2 },
|
|
536261
|
-
|
|
536055
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No matches found")
|
|
536262
536056
|
);
|
|
536263
536057
|
}
|
|
536264
536058
|
const results = Array.isArray(data) ? data : [];
|
|
536265
|
-
return
|
|
536059
|
+
return import_react75.default.createElement(
|
|
536266
536060
|
Box_default,
|
|
536267
536061
|
{ marginLeft: 2 },
|
|
536268
|
-
|
|
536062
|
+
import_react75.default.createElement(
|
|
536269
536063
|
Text,
|
|
536270
536064
|
{ color: "gray", dimColor: true },
|
|
536271
536065
|
"\u2514\u2500 Found ",
|
|
@@ -536278,16 +536072,16 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536278
536072
|
if (toolName === "ace-search-symbols" || toolName === "ace-search_symbols") {
|
|
536279
536073
|
const symbols2 = data.symbols || [];
|
|
536280
536074
|
if (symbols2.length === 0) {
|
|
536281
|
-
return
|
|
536075
|
+
return import_react75.default.createElement(
|
|
536282
536076
|
Box_default,
|
|
536283
536077
|
{ marginLeft: 2 },
|
|
536284
|
-
|
|
536078
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No symbols found")
|
|
536285
536079
|
);
|
|
536286
536080
|
}
|
|
536287
|
-
return
|
|
536081
|
+
return import_react75.default.createElement(
|
|
536288
536082
|
Box_default,
|
|
536289
536083
|
{ marginLeft: 2 },
|
|
536290
|
-
|
|
536084
|
+
import_react75.default.createElement(
|
|
536291
536085
|
Text,
|
|
536292
536086
|
{ color: "gray", dimColor: true },
|
|
536293
536087
|
"\u2514\u2500 Found ",
|
|
@@ -536300,16 +536094,16 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536300
536094
|
if (toolName === "ace-find-references" || toolName === "ace-find_references") {
|
|
536301
536095
|
const references = Array.isArray(data) ? data : [];
|
|
536302
536096
|
if (references.length === 0) {
|
|
536303
|
-
return
|
|
536097
|
+
return import_react75.default.createElement(
|
|
536304
536098
|
Box_default,
|
|
536305
536099
|
{ marginLeft: 2 },
|
|
536306
|
-
|
|
536100
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No references found")
|
|
536307
536101
|
);
|
|
536308
536102
|
}
|
|
536309
|
-
return
|
|
536103
|
+
return import_react75.default.createElement(
|
|
536310
536104
|
Box_default,
|
|
536311
536105
|
{ marginLeft: 2 },
|
|
536312
|
-
|
|
536106
|
+
import_react75.default.createElement(
|
|
536313
536107
|
Text,
|
|
536314
536108
|
{ color: "gray", dimColor: true },
|
|
536315
536109
|
"\u2514\u2500 Found ",
|
|
@@ -536321,16 +536115,16 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536321
536115
|
}
|
|
536322
536116
|
if (toolName === "ace-find-definition" || toolName === "ace-find_definition") {
|
|
536323
536117
|
if (!data) {
|
|
536324
|
-
return
|
|
536118
|
+
return import_react75.default.createElement(
|
|
536325
536119
|
Box_default,
|
|
536326
536120
|
{ marginLeft: 2 },
|
|
536327
|
-
|
|
536121
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 Definition not found")
|
|
536328
536122
|
);
|
|
536329
536123
|
}
|
|
536330
|
-
return
|
|
536124
|
+
return import_react75.default.createElement(
|
|
536331
536125
|
Box_default,
|
|
536332
536126
|
{ marginLeft: 2 },
|
|
536333
|
-
|
|
536127
|
+
import_react75.default.createElement(
|
|
536334
536128
|
Text,
|
|
536335
536129
|
{ color: "gray", dimColor: true },
|
|
536336
536130
|
"\u2514\u2500 Found ",
|
|
@@ -536347,16 +536141,16 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536347
536141
|
if (toolName === "ace-file-outline" || toolName === "ace-file_outline") {
|
|
536348
536142
|
const symbols2 = Array.isArray(data) ? data : [];
|
|
536349
536143
|
if (symbols2.length === 0) {
|
|
536350
|
-
return
|
|
536144
|
+
return import_react75.default.createElement(
|
|
536351
536145
|
Box_default,
|
|
536352
536146
|
{ marginLeft: 2 },
|
|
536353
|
-
|
|
536147
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No symbols in file")
|
|
536354
536148
|
);
|
|
536355
536149
|
}
|
|
536356
|
-
return
|
|
536150
|
+
return import_react75.default.createElement(
|
|
536357
536151
|
Box_default,
|
|
536358
536152
|
{ marginLeft: 2 },
|
|
536359
|
-
|
|
536153
|
+
import_react75.default.createElement(
|
|
536360
536154
|
Text,
|
|
536361
536155
|
{ color: "gray", dimColor: true },
|
|
536362
536156
|
"\u2514\u2500 Found ",
|
|
@@ -536370,16 +536164,16 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536370
536164
|
if (toolName === "ace-semantic-search" || toolName === "ace-semantic_search") {
|
|
536371
536165
|
const totalResults = (((_a21 = data.symbols) == null ? void 0 : _a21.length) || 0) + (((_b14 = data.references) == null ? void 0 : _b14.length) || 0);
|
|
536372
536166
|
if (totalResults === 0) {
|
|
536373
|
-
return
|
|
536167
|
+
return import_react75.default.createElement(
|
|
536374
536168
|
Box_default,
|
|
536375
536169
|
{ marginLeft: 2 },
|
|
536376
|
-
|
|
536170
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No results found")
|
|
536377
536171
|
);
|
|
536378
536172
|
}
|
|
536379
|
-
return
|
|
536173
|
+
return import_react75.default.createElement(
|
|
536380
536174
|
Box_default,
|
|
536381
536175
|
{ flexDirection: "column", marginLeft: 2 },
|
|
536382
|
-
|
|
536176
|
+
import_react75.default.createElement(
|
|
536383
536177
|
Text,
|
|
536384
536178
|
{ color: "gray", dimColor: true },
|
|
536385
536179
|
"\u251C\u2500 ",
|
|
@@ -536387,7 +536181,7 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536387
536181
|
" ",
|
|
536388
536182
|
(((_d4 = data.symbols) == null ? void 0 : _d4.length) || 0) === 1 ? "symbol" : "symbols"
|
|
536389
536183
|
),
|
|
536390
|
-
|
|
536184
|
+
import_react75.default.createElement(
|
|
536391
536185
|
Text,
|
|
536392
536186
|
{ color: "gray", dimColor: true },
|
|
536393
536187
|
"\u2514\u2500 ",
|
|
@@ -536400,10 +536194,10 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536400
536194
|
return renderGenericPreview(data, maxLines);
|
|
536401
536195
|
}
|
|
536402
536196
|
function renderCreatePreview(data) {
|
|
536403
|
-
return
|
|
536197
|
+
return import_react75.default.createElement(
|
|
536404
536198
|
Box_default,
|
|
536405
536199
|
{ marginLeft: 2 },
|
|
536406
|
-
|
|
536200
|
+
import_react75.default.createElement(
|
|
536407
536201
|
Text,
|
|
536408
536202
|
{ color: "gray", dimColor: true },
|
|
536409
536203
|
"\u2514\u2500 ",
|
|
@@ -536412,16 +536206,16 @@ function renderCreatePreview(data) {
|
|
|
536412
536206
|
);
|
|
536413
536207
|
}
|
|
536414
536208
|
function renderEditSearchPreview(data) {
|
|
536415
|
-
return
|
|
536209
|
+
return import_react75.default.createElement(
|
|
536416
536210
|
Box_default,
|
|
536417
536211
|
{ flexDirection: "column", marginLeft: 2 },
|
|
536418
|
-
data.message &&
|
|
536212
|
+
data.message && import_react75.default.createElement(
|
|
536419
536213
|
Text,
|
|
536420
536214
|
{ color: "gray", dimColor: true },
|
|
536421
536215
|
"\u251C\u2500 ",
|
|
536422
536216
|
data.message
|
|
536423
536217
|
),
|
|
536424
|
-
data.matchLocation &&
|
|
536218
|
+
data.matchLocation && import_react75.default.createElement(
|
|
536425
536219
|
Text,
|
|
536426
536220
|
{ color: "gray", dimColor: true },
|
|
536427
536221
|
"\u251C\u2500 Match: lines ",
|
|
@@ -536429,7 +536223,7 @@ function renderEditSearchPreview(data) {
|
|
|
536429
536223
|
"-",
|
|
536430
536224
|
data.matchLocation.endLine
|
|
536431
536225
|
),
|
|
536432
|
-
data.totalLines &&
|
|
536226
|
+
data.totalLines && import_react75.default.createElement(
|
|
536433
536227
|
Text,
|
|
536434
536228
|
{ color: "gray", dimColor: true },
|
|
536435
536229
|
"\u2514\u2500 Total lines: ",
|
|
@@ -536439,10 +536233,10 @@ function renderEditSearchPreview(data) {
|
|
|
536439
536233
|
}
|
|
536440
536234
|
function renderWebSearchPreview(data, _maxLines) {
|
|
536441
536235
|
if (!data.results || data.results.length === 0) {
|
|
536442
|
-
return
|
|
536236
|
+
return import_react75.default.createElement(
|
|
536443
536237
|
Box_default,
|
|
536444
536238
|
{ marginLeft: 2 },
|
|
536445
|
-
|
|
536239
|
+
import_react75.default.createElement(
|
|
536446
536240
|
Text,
|
|
536447
536241
|
{ color: "gray", dimColor: true },
|
|
536448
536242
|
'\u2514\u2500 No results for "',
|
|
@@ -536451,10 +536245,10 @@ function renderWebSearchPreview(data, _maxLines) {
|
|
|
536451
536245
|
)
|
|
536452
536246
|
);
|
|
536453
536247
|
}
|
|
536454
|
-
return
|
|
536248
|
+
return import_react75.default.createElement(
|
|
536455
536249
|
Box_default,
|
|
536456
536250
|
{ marginLeft: 2 },
|
|
536457
|
-
|
|
536251
|
+
import_react75.default.createElement(
|
|
536458
536252
|
Text,
|
|
536459
536253
|
{ color: "gray", dimColor: true },
|
|
536460
536254
|
"\u2514\u2500 Found ",
|
|
@@ -536468,10 +536262,10 @@ function renderWebSearchPreview(data, _maxLines) {
|
|
|
536468
536262
|
function renderWebFetchPreview(data) {
|
|
536469
536263
|
var _a21;
|
|
536470
536264
|
const contentLength = data.textLength || ((_a21 = data.content) == null ? void 0 : _a21.length) || 0;
|
|
536471
|
-
return
|
|
536265
|
+
return import_react75.default.createElement(
|
|
536472
536266
|
Box_default,
|
|
536473
536267
|
{ marginLeft: 2 },
|
|
536474
|
-
|
|
536268
|
+
import_react75.default.createElement(
|
|
536475
536269
|
Text,
|
|
536476
536270
|
{ color: "gray", dimColor: true },
|
|
536477
536271
|
"\u2514\u2500 Fetched ",
|
|
@@ -536488,9 +536282,9 @@ function renderGenericPreview(data, maxLines) {
|
|
|
536488
536282
|
const entries = Object.entries(data).slice(0, maxLines);
|
|
536489
536283
|
if (entries.length === 0)
|
|
536490
536284
|
return null;
|
|
536491
|
-
return
|
|
536285
|
+
return import_react75.default.createElement(Box_default, { flexDirection: "column", marginLeft: 2 }, entries.map(([key, value], idx2) => {
|
|
536492
536286
|
const valueStr = typeof value === "string" ? value.slice(0, 20) + (value.length > 20 ? "..." : "") : JSON.stringify(value).slice(0, 60);
|
|
536493
|
-
return
|
|
536287
|
+
return import_react75.default.createElement(
|
|
536494
536288
|
Text,
|
|
536495
536289
|
{ key: idx2, color: "gray", dimColor: true },
|
|
536496
536290
|
idx2 === entries.length - 1 ? "\u2514\u2500 " : "\u251C\u2500 ",
|
|
@@ -536506,10 +536300,10 @@ function renderTodoPreview(_toolName, data, _maxLines) {
|
|
|
536506
536300
|
if (data.content && Array.isArray(data.content) && ((_a21 = data.content[0]) == null ? void 0 : _a21.text)) {
|
|
536507
536301
|
const textContent = data.content[0].text;
|
|
536508
536302
|
if (textContent === "No TODO list found" || textContent === "TODO item not found") {
|
|
536509
|
-
return
|
|
536303
|
+
return import_react75.default.createElement(
|
|
536510
536304
|
Box_default,
|
|
536511
536305
|
{ marginLeft: 2 },
|
|
536512
|
-
|
|
536306
|
+
import_react75.default.createElement(
|
|
536513
536307
|
Text,
|
|
536514
536308
|
{ color: "gray", dimColor: true },
|
|
536515
536309
|
"\u2514\u2500 ",
|
|
@@ -536520,10 +536314,10 @@ function renderTodoPreview(_toolName, data, _maxLines) {
|
|
|
536520
536314
|
try {
|
|
536521
536315
|
todoData = JSON.parse(textContent);
|
|
536522
536316
|
} catch (e) {
|
|
536523
|
-
return
|
|
536317
|
+
return import_react75.default.createElement(
|
|
536524
536318
|
Box_default,
|
|
536525
536319
|
{ marginLeft: 2 },
|
|
536526
|
-
|
|
536320
|
+
import_react75.default.createElement(
|
|
536527
536321
|
Text,
|
|
536528
536322
|
{ color: "gray", dimColor: true },
|
|
536529
536323
|
"\u2514\u2500 ",
|
|
@@ -536533,10 +536327,10 @@ function renderTodoPreview(_toolName, data, _maxLines) {
|
|
|
536533
536327
|
}
|
|
536534
536328
|
}
|
|
536535
536329
|
if (!todoData.todos || !Array.isArray(todoData.todos)) {
|
|
536536
|
-
return
|
|
536330
|
+
return import_react75.default.createElement(
|
|
536537
536331
|
Box_default,
|
|
536538
536332
|
{ marginLeft: 2 },
|
|
536539
|
-
|
|
536333
|
+
import_react75.default.createElement(
|
|
536540
536334
|
Text,
|
|
536541
536335
|
{ color: "gray", dimColor: true },
|
|
536542
536336
|
"\u2514\u2500 ",
|
|
@@ -536544,24 +536338,41 @@ function renderTodoPreview(_toolName, data, _maxLines) {
|
|
|
536544
536338
|
)
|
|
536545
536339
|
);
|
|
536546
536340
|
}
|
|
536547
|
-
|
|
536341
|
+
const totalTodos = todoData.todos.length;
|
|
536342
|
+
const completedTodos = todoData.todos.filter((todo) => todo.status === "completed").length;
|
|
536343
|
+
const pendingTodos = totalTodos - completedTodos;
|
|
536344
|
+
return import_react75.default.createElement(
|
|
536345
|
+
Box_default,
|
|
536346
|
+
{ marginLeft: 2 },
|
|
536347
|
+
import_react75.default.createElement(
|
|
536348
|
+
Text,
|
|
536349
|
+
{ color: "gray", dimColor: true },
|
|
536350
|
+
"\u2514\u2500 TODO: ",
|
|
536351
|
+
pendingTodos,
|
|
536352
|
+
" pending, ",
|
|
536353
|
+
completedTodos,
|
|
536354
|
+
" completed (total:",
|
|
536355
|
+
" ",
|
|
536356
|
+
totalTodos,
|
|
536357
|
+
")"
|
|
536358
|
+
)
|
|
536359
|
+
);
|
|
536548
536360
|
}
|
|
536549
|
-
var
|
|
536361
|
+
var import_react75;
|
|
536550
536362
|
var init_ToolResultPreview = __esm({
|
|
536551
536363
|
async "dist/ui/components/tools/ToolResultPreview.js"() {
|
|
536552
536364
|
"use strict";
|
|
536553
|
-
|
|
536365
|
+
import_react75 = __toESM(require_react(), 1);
|
|
536554
536366
|
await init_build2();
|
|
536555
|
-
await init_TodoTree();
|
|
536556
536367
|
}
|
|
536557
536368
|
});
|
|
536558
536369
|
|
|
536559
536370
|
// dist/ui/components/special/HookErrorDisplay.js
|
|
536560
|
-
var
|
|
536371
|
+
var import_react76, truncate, HookErrorDisplay;
|
|
536561
536372
|
var init_HookErrorDisplay = __esm({
|
|
536562
536373
|
async "dist/ui/components/special/HookErrorDisplay.js"() {
|
|
536563
536374
|
"use strict";
|
|
536564
|
-
|
|
536375
|
+
import_react76 = __toESM(require_react(), 1);
|
|
536565
536376
|
await init_build2();
|
|
536566
536377
|
truncate = (text3, maxLength) => {
|
|
536567
536378
|
if (text3.length <= maxLength)
|
|
@@ -536574,21 +536385,21 @@ var init_HookErrorDisplay = __esm({
|
|
|
536574
536385
|
const truncatedCommand = truncate(command, 150);
|
|
536575
536386
|
const truncatedOutput = truncate(combinedOutput, 300);
|
|
536576
536387
|
const title = type === "warning" ? "Hook Command Warning" : `Hook Command Failed (Exit Code ${exitCode})`;
|
|
536577
|
-
return
|
|
536388
|
+
return import_react76.default.createElement(
|
|
536578
536389
|
Box_default,
|
|
536579
536390
|
{ flexDirection: "column" },
|
|
536580
|
-
|
|
536581
|
-
|
|
536391
|
+
import_react76.default.createElement(Text, { bold: true, color: "red" }, title),
|
|
536392
|
+
import_react76.default.createElement(
|
|
536582
536393
|
Box_default,
|
|
536583
536394
|
{ marginLeft: 1 },
|
|
536584
|
-
|
|
536585
|
-
|
|
536395
|
+
import_react76.default.createElement(Text, { dimColor: true }, "\u251C\u2500 "),
|
|
536396
|
+
import_react76.default.createElement(Text, null, truncatedCommand)
|
|
536586
536397
|
),
|
|
536587
|
-
|
|
536398
|
+
import_react76.default.createElement(
|
|
536588
536399
|
Box_default,
|
|
536589
536400
|
{ marginLeft: 1 },
|
|
536590
|
-
|
|
536591
|
-
|
|
536401
|
+
import_react76.default.createElement(Text, { dimColor: true }, "\u2514\u2500 "),
|
|
536402
|
+
import_react76.default.createElement(Text, null, truncatedOutput)
|
|
536592
536403
|
)
|
|
536593
536404
|
);
|
|
536594
536405
|
};
|
|
@@ -536627,44 +536438,44 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
|
|
|
536627
536438
|
toolStatusColor = message.role === "subagent" ? "magenta" : "blue";
|
|
536628
536439
|
}
|
|
536629
536440
|
}
|
|
536630
|
-
return
|
|
536631
|
-
|
|
536441
|
+
return import_react77.default.createElement(Box_default, { key: `msg-${index}`, marginTop: index > 0 && !shouldShowParallelIndicator ? 1 : 0, marginBottom: isLastMessage ? 1 : 0, paddingX: 1, flexDirection: "column", width: terminalWidth }, message.plainOutput ? import_react77.default.createElement(Text, { color: message.role === "user" ? "white" : toolStatusColor }, removeAnsiCodes(message.content)) : import_react77.default.createElement(
|
|
536442
|
+
import_react77.default.Fragment,
|
|
536632
536443
|
null,
|
|
536633
|
-
isFirstInGroup &&
|
|
536444
|
+
isFirstInGroup && import_react77.default.createElement(
|
|
536634
536445
|
Box_default,
|
|
536635
536446
|
{ marginBottom: 0 },
|
|
536636
|
-
|
|
536447
|
+
import_react77.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, "\u250C\u2500 Parallel execution")
|
|
536637
536448
|
),
|
|
536638
|
-
|
|
536449
|
+
import_react77.default.createElement(
|
|
536639
536450
|
Box_default,
|
|
536640
536451
|
null,
|
|
536641
|
-
|
|
536452
|
+
import_react77.default.createElement(
|
|
536642
536453
|
Text,
|
|
536643
536454
|
{ color: message.role === "user" ? "green" : message.role === "command" ? theme14.colors.menuSecondary : toolStatusColor, bold: true },
|
|
536644
536455
|
shouldShowParallelIndicator && !isFirstInGroup ? "\u2502" : "",
|
|
536645
536456
|
message.role === "user" ? "\u276F" : message.role === "command" ? "\u2318" : "\u2746"
|
|
536646
536457
|
),
|
|
536647
|
-
|
|
536648
|
-
|
|
536458
|
+
import_react77.default.createElement(Box_default, { marginLeft: 1, flexDirection: "column" }, message.role === "command" ? import_react77.default.createElement(
|
|
536459
|
+
import_react77.default.Fragment,
|
|
536649
536460
|
null,
|
|
536650
|
-
!message.hideCommandName &&
|
|
536461
|
+
!message.hideCommandName && import_react77.default.createElement(
|
|
536651
536462
|
Text,
|
|
536652
536463
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
536653
536464
|
"\u2514\u2500 ",
|
|
536654
536465
|
message.commandName
|
|
536655
536466
|
),
|
|
536656
|
-
message.content &&
|
|
536657
|
-
) :
|
|
536658
|
-
|
|
536467
|
+
message.content && import_react77.default.createElement(Text, { color: "white" }, removeAnsiCodes(message.content))
|
|
536468
|
+
) : import_react77.default.createElement(
|
|
536469
|
+
import_react77.default.Fragment,
|
|
536659
536470
|
null,
|
|
536660
|
-
message.plainOutput ?
|
|
536471
|
+
message.plainOutput ? import_react77.default.createElement(Text, { color: message.role === "user" ? "white" : toolStatusColor, backgroundColor: message.role === "user" ? theme14.colors.border : void 0 }, removeAnsiCodes(message.content || " ")) : (() => {
|
|
536661
536472
|
if (message.hookError) {
|
|
536662
|
-
return
|
|
536473
|
+
return import_react77.default.createElement(HookErrorDisplay, { details: message.hookError });
|
|
536663
536474
|
}
|
|
536664
536475
|
try {
|
|
536665
536476
|
const parsed = JSON.parse(message.content);
|
|
536666
536477
|
if (parsed.type === "hook-error") {
|
|
536667
|
-
return
|
|
536478
|
+
return import_react77.default.createElement(HookErrorDisplay, { details: {
|
|
536668
536479
|
type: "error",
|
|
536669
536480
|
exitCode: parsed.exitCode,
|
|
536670
536481
|
command: parsed.command,
|
|
@@ -536676,17 +536487,17 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
|
|
|
536676
536487
|
}
|
|
536677
536488
|
const hasToolStatus = message.messageStatus !== void 0;
|
|
536678
536489
|
if (hasToolStatus && (message.role === "assistant" || message.role === "subagent")) {
|
|
536679
|
-
return
|
|
536490
|
+
return import_react77.default.createElement(Text, { color: toolStatusColor }, removeAnsiCodes(message.content || " "));
|
|
536680
536491
|
}
|
|
536681
|
-
return
|
|
536682
|
-
|
|
536492
|
+
return import_react77.default.createElement(
|
|
536493
|
+
import_react77.default.Fragment,
|
|
536683
536494
|
null,
|
|
536684
|
-
message.thinking && showThinking &&
|
|
536495
|
+
message.thinking && showThinking && import_react77.default.createElement(
|
|
536685
536496
|
Box_default,
|
|
536686
536497
|
{ flexDirection: "column", marginBottom: 1 },
|
|
536687
|
-
|
|
536498
|
+
import_react77.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true, italic: true }, message.thinking)
|
|
536688
536499
|
),
|
|
536689
|
-
message.role === "user" ?
|
|
536500
|
+
message.role === "user" ? import_react77.default.createElement(Text, { color: "white", backgroundColor: theme14.colors.userMessageBackground }, formatUserBubbleText(removeAnsiCodes(message.content))) : import_react77.default.createElement(MarkdownRenderer, { content: message.content || " " })
|
|
536690
536501
|
);
|
|
536691
536502
|
})(),
|
|
536692
536503
|
message.subAgentUsage && (() => {
|
|
@@ -536695,7 +536506,7 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
|
|
|
536695
536506
|
return `${(num / 1e3).toFixed(1)}K`;
|
|
536696
536507
|
return num.toString();
|
|
536697
536508
|
};
|
|
536698
|
-
return
|
|
536509
|
+
return import_react77.default.createElement(
|
|
536699
536510
|
Text,
|
|
536700
536511
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
536701
536512
|
"\u2514\u2500 Usage: In=",
|
|
@@ -536707,7 +536518,7 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
|
|
|
536707
536518
|
);
|
|
536708
536519
|
})(),
|
|
536709
536520
|
message.toolDisplay && message.toolDisplay.args.length > 0 && // Hide tool arguments for sub-agent internal tools
|
|
536710
|
-
!message.subAgentInternal &&
|
|
536521
|
+
!message.subAgentInternal && import_react77.default.createElement(Box_default, { flexDirection: "column" }, message.toolDisplay.args.map((arg, argIndex) => import_react77.default.createElement(
|
|
536711
536522
|
Text,
|
|
536712
536523
|
{ key: argIndex, color: theme14.colors.menuSecondary, dimColor: true },
|
|
536713
536524
|
arg.isLast ? "\u2514\u2500" : "\u251C\u2500",
|
|
@@ -536716,63 +536527,63 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
|
|
|
536716
536527
|
": ",
|
|
536717
536528
|
arg.value
|
|
536718
536529
|
))),
|
|
536719
|
-
message.toolCall && message.toolCall.name === "filesystem-create" && message.toolCall.arguments.content &&
|
|
536530
|
+
message.toolCall && message.toolCall.name === "filesystem-create" && message.toolCall.arguments.content && import_react77.default.createElement(
|
|
536720
536531
|
Box_default,
|
|
536721
536532
|
{ marginTop: 1 },
|
|
536722
|
-
|
|
536533
|
+
import_react77.default.createElement(DiffViewer, { newContent: message.toolCall.arguments.content, filename: message.toolCall.arguments.path })
|
|
536723
536534
|
),
|
|
536724
|
-
message.toolCall && message.toolCall.name === "filesystem-edit" && message.toolCall.arguments.oldContent && message.toolCall.arguments.newContent &&
|
|
536535
|
+
message.toolCall && message.toolCall.name === "filesystem-edit" && message.toolCall.arguments.oldContent && message.toolCall.arguments.newContent && import_react77.default.createElement(
|
|
536725
536536
|
Box_default,
|
|
536726
536537
|
{ marginTop: 1 },
|
|
536727
|
-
|
|
536538
|
+
import_react77.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 })
|
|
536728
536539
|
),
|
|
536729
|
-
message.toolCall && message.toolCall.name === "filesystem-edit_search" && message.toolCall.arguments.oldContent && message.toolCall.arguments.newContent &&
|
|
536540
|
+
message.toolCall && message.toolCall.name === "filesystem-edit_search" && message.toolCall.arguments.oldContent && message.toolCall.arguments.newContent && import_react77.default.createElement(
|
|
536730
536541
|
Box_default,
|
|
536731
536542
|
{ marginTop: 1 },
|
|
536732
|
-
|
|
536543
|
+
import_react77.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 })
|
|
536733
536544
|
),
|
|
536734
|
-
message.toolCall && (message.toolCall.name === "filesystem-edit" || message.toolCall.name === "filesystem-edit_search") && message.toolCall.arguments.isBatch && message.toolCall.arguments.batchResults && Array.isArray(message.toolCall.arguments.batchResults) &&
|
|
536545
|
+
message.toolCall && (message.toolCall.name === "filesystem-edit" || message.toolCall.name === "filesystem-edit_search") && message.toolCall.arguments.isBatch && message.toolCall.arguments.batchResults && Array.isArray(message.toolCall.arguments.batchResults) && import_react77.default.createElement(Box_default, { marginTop: 1, flexDirection: "column" }, message.toolCall.arguments.batchResults.map((fileResult, index2) => {
|
|
536735
536546
|
if (fileResult.success && fileResult.oldContent && fileResult.newContent) {
|
|
536736
|
-
return
|
|
536547
|
+
return import_react77.default.createElement(
|
|
536737
536548
|
Box_default,
|
|
536738
536549
|
{ key: index2, flexDirection: "column", marginBottom: 1 },
|
|
536739
|
-
|
|
536740
|
-
|
|
536550
|
+
import_react77.default.createElement(Text, { bold: true, color: "cyan" }, `File ${index2 + 1}: ${fileResult.path}`),
|
|
536551
|
+
import_react77.default.createElement(DiffViewer, { oldContent: fileResult.oldContent, newContent: fileResult.newContent, filename: fileResult.path, completeOldContent: fileResult.completeOldContent, completeNewContent: fileResult.completeNewContent, startLineNumber: fileResult.contextStartLine })
|
|
536741
536552
|
);
|
|
536742
536553
|
}
|
|
536743
536554
|
return null;
|
|
536744
536555
|
})),
|
|
536745
536556
|
message.messageStatus === "success" && message.toolResult && // 只在没有 diff 数据时显示预览(有 diff 的工具会用 DiffViewer 显示)
|
|
536746
|
-
!(message.toolCall && (((_d4 = message.toolCall.arguments) == null ? void 0 : _d4.oldContent) || ((_e2 = message.toolCall.arguments) == null ? void 0 : _e2.batchResults))) &&
|
|
536747
|
-
message.files && message.files.length > 0 &&
|
|
536557
|
+
!(message.toolCall && (((_d4 = message.toolCall.arguments) == null ? void 0 : _d4.oldContent) || ((_e2 = message.toolCall.arguments) == null ? void 0 : _e2.batchResults))) && import_react77.default.createElement(ToolResultPreview, { toolName: ((_f = (message.content || "").replace(/^✓\s*/, "").replace(/^⚇✓\s*/, "").replace(/.*⚇✓\s*/, "").replace(/\x1b\[[0-9;]*m/g, "").split("\n")[0]) == null ? void 0 : _f.trim()) || "", result: message.toolResult, maxLines: 5, isSubAgentInternal: message.role === "subagent" || message.subAgentInternal === true }),
|
|
536558
|
+
message.files && message.files.length > 0 && import_react77.default.createElement(Box_default, { flexDirection: "column" }, message.files.map((file, fileIndex) => import_react77.default.createElement(
|
|
536748
536559
|
Text,
|
|
536749
536560
|
{ key: fileIndex, color: theme14.colors.menuSecondary, dimColor: true },
|
|
536750
536561
|
"\u2514\u2500 ",
|
|
536751
536562
|
file.path,
|
|
536752
536563
|
file.exists ? ` (total line ${file.lineCount})` : " (file not found)"
|
|
536753
536564
|
))),
|
|
536754
|
-
message.role === "user" && message.images && message.images.length > 0 &&
|
|
536565
|
+
message.role === "user" && message.images && message.images.length > 0 && import_react77.default.createElement(Box_default, { marginTop: 1, flexDirection: "column" }, message.images.map((_image, imageIndex) => import_react77.default.createElement(
|
|
536755
536566
|
Text,
|
|
536756
536567
|
{ key: imageIndex, color: theme14.colors.menuSecondary, dimColor: true },
|
|
536757
536568
|
"\u2514\u2500 [image #",
|
|
536758
536569
|
imageIndex + 1,
|
|
536759
536570
|
"]"
|
|
536760
536571
|
))),
|
|
536761
|
-
message.discontinued &&
|
|
536572
|
+
message.discontinued && import_react77.default.createElement(Text, { color: "red", bold: true }, t.chatScreen.discontinuedMessage)
|
|
536762
536573
|
))
|
|
536763
536574
|
),
|
|
536764
|
-
!message.plainOutput && isLastInGroup &&
|
|
536575
|
+
!message.plainOutput && isLastInGroup && import_react77.default.createElement(
|
|
536765
536576
|
Box_default,
|
|
536766
536577
|
{ marginTop: 0 },
|
|
536767
|
-
|
|
536578
|
+
import_react77.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, "\u2514\u2500 End parallel execution")
|
|
536768
536579
|
)
|
|
536769
536580
|
));
|
|
536770
536581
|
}
|
|
536771
|
-
var
|
|
536582
|
+
var import_react77;
|
|
536772
536583
|
var init_MessageRenderer = __esm({
|
|
536773
536584
|
async "dist/ui/components/chat/MessageRenderer.js"() {
|
|
536774
536585
|
"use strict";
|
|
536775
|
-
|
|
536586
|
+
import_react77 = __toESM(require_react(), 1);
|
|
536776
536587
|
await init_build2();
|
|
536777
536588
|
init_ThemeContext();
|
|
536778
536589
|
init_I18nContext();
|
|
@@ -536786,18 +536597,18 @@ var init_MessageRenderer = __esm({
|
|
|
536786
536597
|
// dist/ui/components/chat/UserMessagePreview.js
|
|
536787
536598
|
function UserMessagePreview({ content }) {
|
|
536788
536599
|
const { columns: terminalWidth } = useTerminalSize();
|
|
536789
|
-
const message = (0,
|
|
536600
|
+
const message = (0, import_react78.useMemo)(() => ({
|
|
536790
536601
|
role: "user",
|
|
536791
536602
|
content
|
|
536792
536603
|
}), [content]);
|
|
536793
|
-
const filteredMessages = (0,
|
|
536794
|
-
return
|
|
536604
|
+
const filteredMessages = (0, import_react78.useMemo)(() => [message], [message]);
|
|
536605
|
+
return import_react78.default.createElement(MessageRenderer, { message, index: 0, isLastMessage: false, filteredMessages, terminalWidth, showThinking: false });
|
|
536795
536606
|
}
|
|
536796
|
-
var
|
|
536607
|
+
var import_react78;
|
|
536797
536608
|
var init_UserMessagePreview = __esm({
|
|
536798
536609
|
async "dist/ui/components/chat/UserMessagePreview.js"() {
|
|
536799
536610
|
"use strict";
|
|
536800
|
-
|
|
536611
|
+
import_react78 = __toESM(require_react(), 1);
|
|
536801
536612
|
init_useTerminalSize();
|
|
536802
536613
|
await init_MessageRenderer();
|
|
536803
536614
|
}
|
|
@@ -536812,14 +536623,14 @@ function CustomThemeScreen({ onBack }) {
|
|
|
536812
536623
|
var _a21, _b14, _c6, _d4, _e2, _f, _g, _h, _i, _j;
|
|
536813
536624
|
const { setThemeType, refreshCustomTheme } = useTheme();
|
|
536814
536625
|
const { t } = useI18n();
|
|
536815
|
-
const [colors, setColors] = (0,
|
|
536626
|
+
const [colors, setColors] = (0, import_react79.useState)(() => {
|
|
536816
536627
|
const custom2 = getCustomTheme();
|
|
536817
536628
|
return custom2.colors;
|
|
536818
536629
|
});
|
|
536819
|
-
const [editingKey, setEditingKey] = (0,
|
|
536820
|
-
const [editValue, setEditValue] = (0,
|
|
536821
|
-
const [infoText, setInfoText] = (0,
|
|
536822
|
-
const menuOptions = (0,
|
|
536630
|
+
const [editingKey, setEditingKey] = (0, import_react79.useState)(null);
|
|
536631
|
+
const [editValue, setEditValue] = (0, import_react79.useState)("");
|
|
536632
|
+
const [infoText, setInfoText] = (0, import_react79.useState)("");
|
|
536633
|
+
const menuOptions = (0, import_react79.useMemo)(() => {
|
|
536823
536634
|
var _a22, _b15, _c7, _d5, _e3, _f2;
|
|
536824
536635
|
const options3 = colorKeys.map((key) => {
|
|
536825
536636
|
var _a23;
|
|
@@ -536846,13 +536657,13 @@ function CustomThemeScreen({ onBack }) {
|
|
|
536846
536657
|
});
|
|
536847
536658
|
return options3;
|
|
536848
536659
|
}, [colors, t]);
|
|
536849
|
-
const saveAndExit = (0,
|
|
536660
|
+
const saveAndExit = (0, import_react79.useCallback)(() => {
|
|
536850
536661
|
saveCustomColors(colors);
|
|
536851
536662
|
refreshCustomTheme == null ? void 0 : refreshCustomTheme();
|
|
536852
536663
|
setThemeType("custom");
|
|
536853
536664
|
onBack("custom");
|
|
536854
536665
|
}, [colors, onBack, refreshCustomTheme, setThemeType]);
|
|
536855
|
-
const handleSelect = (0,
|
|
536666
|
+
const handleSelect = (0, import_react79.useCallback)((value) => {
|
|
536856
536667
|
if (value === "back") {
|
|
536857
536668
|
onBack();
|
|
536858
536669
|
} else if (value === "save") {
|
|
@@ -536866,10 +536677,10 @@ function CustomThemeScreen({ onBack }) {
|
|
|
536866
536677
|
setEditValue(Array.isArray(colorValue) ? colorValue.join(", ") : colorValue);
|
|
536867
536678
|
}
|
|
536868
536679
|
}, [onBack, saveAndExit, colors]);
|
|
536869
|
-
const handleSelectionChange = (0,
|
|
536680
|
+
const handleSelectionChange = (0, import_react79.useCallback)((newInfoText) => {
|
|
536870
536681
|
setInfoText(newInfoText);
|
|
536871
536682
|
}, []);
|
|
536872
|
-
const handleEditSubmit = (0,
|
|
536683
|
+
const handleEditSubmit = (0, import_react79.useCallback)(() => {
|
|
536873
536684
|
if (editingKey && editValue.trim()) {
|
|
536874
536685
|
setColors((prev) => {
|
|
536875
536686
|
const newValue = editingKey === "logoGradient" ? editValue.split(",").map((v) => v.trim()).filter((v) => v) : editValue.trim();
|
|
@@ -536893,47 +536704,47 @@ function CustomThemeScreen({ onBack }) {
|
|
|
536893
536704
|
}
|
|
536894
536705
|
});
|
|
536895
536706
|
if (editingKey) {
|
|
536896
|
-
return
|
|
536707
|
+
return import_react79.default.createElement(
|
|
536897
536708
|
Box_default,
|
|
536898
536709
|
{ flexDirection: "column", padding: 1 },
|
|
536899
|
-
|
|
536710
|
+
import_react79.default.createElement(
|
|
536900
536711
|
Text,
|
|
536901
536712
|
{ bold: true, color: "cyan" },
|
|
536902
536713
|
((_a21 = t.customTheme) == null ? void 0 : _a21.editColor) || "Edit Color",
|
|
536903
536714
|
": ",
|
|
536904
536715
|
editingKey
|
|
536905
536716
|
),
|
|
536906
|
-
|
|
536717
|
+
import_react79.default.createElement(
|
|
536907
536718
|
Box_default,
|
|
536908
536719
|
{ marginTop: 1 },
|
|
536909
|
-
|
|
536720
|
+
import_react79.default.createElement(
|
|
536910
536721
|
Text,
|
|
536911
536722
|
null,
|
|
536912
536723
|
((_b14 = t.customTheme) == null ? void 0 : _b14.currentValue) || "Current",
|
|
536913
536724
|
": "
|
|
536914
536725
|
),
|
|
536915
|
-
|
|
536726
|
+
import_react79.default.createElement(Text, null, Array.isArray(colors[editingKey]) ? colors[editingKey].join(", ") : colors[editingKey])
|
|
536916
536727
|
),
|
|
536917
|
-
|
|
536728
|
+
import_react79.default.createElement(
|
|
536918
536729
|
Box_default,
|
|
536919
536730
|
{ marginTop: 1 },
|
|
536920
|
-
|
|
536731
|
+
import_react79.default.createElement(
|
|
536921
536732
|
Text,
|
|
536922
536733
|
null,
|
|
536923
536734
|
((_c6 = t.customTheme) == null ? void 0 : _c6.newValue) || "New value",
|
|
536924
536735
|
": "
|
|
536925
536736
|
),
|
|
536926
|
-
|
|
536737
|
+
import_react79.default.createElement(build_default2, { value: editValue, onChange: setEditValue, onSubmit: handleEditSubmit })
|
|
536927
536738
|
),
|
|
536928
|
-
|
|
536739
|
+
import_react79.default.createElement(
|
|
536929
536740
|
Box_default,
|
|
536930
536741
|
{ marginTop: 1 },
|
|
536931
|
-
|
|
536742
|
+
import_react79.default.createElement(Text, { dimColor: true }, ((_d4 = t.customTheme) == null ? void 0 : _d4.colorFormat) || "Format: #RRGGBB or color name (red, blue, etc.)")
|
|
536932
536743
|
),
|
|
536933
|
-
|
|
536744
|
+
import_react79.default.createElement(
|
|
536934
536745
|
Box_default,
|
|
536935
536746
|
{ marginTop: 1 },
|
|
536936
|
-
|
|
536747
|
+
import_react79.default.createElement(
|
|
536937
536748
|
Text,
|
|
536938
536749
|
{ dimColor: true },
|
|
536939
536750
|
"ESC: ",
|
|
@@ -536945,25 +536756,25 @@ function CustomThemeScreen({ onBack }) {
|
|
|
536945
536756
|
)
|
|
536946
536757
|
);
|
|
536947
536758
|
}
|
|
536948
|
-
return
|
|
536759
|
+
return import_react79.default.createElement(
|
|
536949
536760
|
Box_default,
|
|
536950
536761
|
{ flexDirection: "column" },
|
|
536951
|
-
|
|
536762
|
+
import_react79.default.createElement(
|
|
536952
536763
|
Box_default,
|
|
536953
536764
|
{ borderStyle: "round", borderColor: "cyan", paddingX: 1 },
|
|
536954
|
-
|
|
536765
|
+
import_react79.default.createElement(Text, { bold: true, color: "cyan" }, ((_g = t.customTheme) == null ? void 0 : _g.title) || "Custom Theme Editor")
|
|
536955
536766
|
),
|
|
536956
|
-
|
|
536957
|
-
|
|
536767
|
+
import_react79.default.createElement(Menu_default, { options: menuOptions, onSelect: handleSelect, onSelectionChange: handleSelectionChange }),
|
|
536768
|
+
import_react79.default.createElement(
|
|
536958
536769
|
Box_default,
|
|
536959
536770
|
{ flexDirection: "column", paddingX: 1, marginTop: 1 },
|
|
536960
|
-
|
|
536771
|
+
import_react79.default.createElement(
|
|
536961
536772
|
Text,
|
|
536962
536773
|
{ color: "gray", dimColor: true },
|
|
536963
536774
|
((_h = t.customTheme) == null ? void 0 : _h.preview) || "Preview",
|
|
536964
536775
|
":"
|
|
536965
536776
|
),
|
|
536966
|
-
|
|
536777
|
+
import_react79.default.createElement(
|
|
536967
536778
|
ThemeContext2.Provider,
|
|
536968
536779
|
{ value: {
|
|
536969
536780
|
theme: { name: "Custom", type: "custom", colors },
|
|
@@ -536971,32 +536782,32 @@ function CustomThemeScreen({ onBack }) {
|
|
|
536971
536782
|
setThemeType,
|
|
536972
536783
|
refreshCustomTheme
|
|
536973
536784
|
} },
|
|
536974
|
-
|
|
536975
|
-
|
|
536785
|
+
import_react79.default.createElement(DiffViewer, { oldContent: sampleOldCode, newContent: sampleNewCode, filename: "example.ts" }),
|
|
536786
|
+
import_react79.default.createElement(
|
|
536976
536787
|
Box_default,
|
|
536977
536788
|
{ marginTop: 1, flexDirection: "column" },
|
|
536978
|
-
|
|
536789
|
+
import_react79.default.createElement(
|
|
536979
536790
|
Text,
|
|
536980
536791
|
{ color: "gray", dimColor: true },
|
|
536981
536792
|
((_i = t.customTheme) == null ? void 0 : _i.userMessagePreview) || "User message preview",
|
|
536982
536793
|
":"
|
|
536983
536794
|
),
|
|
536984
|
-
|
|
536795
|
+
import_react79.default.createElement(UserMessagePreview, { content: ((_j = t.customTheme) == null ? void 0 : _j.userMessageSample) || "\u8FD9\u4E2A\u9884\u89C8\u7528\u4E8E\u68C0\u67E5 userMessageBackground \u662F\u5426\u5408\u9002" })
|
|
536985
536796
|
)
|
|
536986
536797
|
)
|
|
536987
536798
|
),
|
|
536988
|
-
infoText &&
|
|
536799
|
+
infoText && import_react79.default.createElement(
|
|
536989
536800
|
Box_default,
|
|
536990
536801
|
{ paddingX: 1, marginTop: 1 },
|
|
536991
|
-
|
|
536802
|
+
import_react79.default.createElement(Text, { color: "gray" }, infoText)
|
|
536992
536803
|
)
|
|
536993
536804
|
);
|
|
536994
536805
|
}
|
|
536995
|
-
var
|
|
536806
|
+
var import_react79, colorKeys, sampleOldCode, sampleNewCode;
|
|
536996
536807
|
var init_CustomThemeScreen = __esm({
|
|
536997
536808
|
async "dist/ui/pages/CustomThemeScreen.js"() {
|
|
536998
536809
|
"use strict";
|
|
536999
|
-
|
|
536810
|
+
import_react79 = __toESM(require_react(), 1);
|
|
537000
536811
|
await init_build2();
|
|
537001
536812
|
await init_build5();
|
|
537002
536813
|
await init_Menu();
|
|
@@ -537045,19 +536856,19 @@ function ThemeSettingsScreen({ onBack, inlineMode = false }) {
|
|
|
537045
536856
|
var _a21;
|
|
537046
536857
|
const { themeType, setThemeType } = useTheme();
|
|
537047
536858
|
const { t } = useI18n();
|
|
537048
|
-
const [selectedTheme, setSelectedTheme] = (0,
|
|
537049
|
-
const [infoText, setInfoText] = (0,
|
|
537050
|
-
const [screen, setScreen] = (0,
|
|
537051
|
-
const [simpleMode, setSimpleModeState] = (0,
|
|
537052
|
-
(0,
|
|
536859
|
+
const [selectedTheme, setSelectedTheme] = (0, import_react80.useState)(themeType);
|
|
536860
|
+
const [infoText, setInfoText] = (0, import_react80.useState)("");
|
|
536861
|
+
const [screen, setScreen] = (0, import_react80.useState)("main");
|
|
536862
|
+
const [simpleMode, setSimpleModeState] = (0, import_react80.useState)(() => getSimpleMode());
|
|
536863
|
+
(0, import_react80.useEffect)(() => {
|
|
537053
536864
|
setSimpleModeState(getSimpleMode());
|
|
537054
536865
|
}, []);
|
|
537055
|
-
const handleToggleSimpleMode = (0,
|
|
536866
|
+
const handleToggleSimpleMode = (0, import_react80.useCallback)(() => {
|
|
537056
536867
|
const newSimpleMode = !simpleMode;
|
|
537057
536868
|
setSimpleModeState(newSimpleMode);
|
|
537058
536869
|
setSimpleMode(newSimpleMode);
|
|
537059
536870
|
}, [simpleMode]);
|
|
537060
|
-
const themeOptions = (0,
|
|
536871
|
+
const themeOptions = (0, import_react80.useMemo)(() => {
|
|
537061
536872
|
var _a22, _b14, _c6, _d4, _e2;
|
|
537062
536873
|
return [
|
|
537063
536874
|
{
|
|
@@ -537113,7 +536924,7 @@ function ThemeSettingsScreen({ onBack, inlineMode = false }) {
|
|
|
537113
536924
|
}
|
|
537114
536925
|
];
|
|
537115
536926
|
}, [selectedTheme, simpleMode, t]);
|
|
537116
|
-
const handleSelect = (0,
|
|
536927
|
+
const handleSelect = (0, import_react80.useCallback)((value) => {
|
|
537117
536928
|
if (value === "back") {
|
|
537118
536929
|
setThemeType(selectedTheme);
|
|
537119
536930
|
onBack();
|
|
@@ -537127,7 +536938,7 @@ function ThemeSettingsScreen({ onBack, inlineMode = false }) {
|
|
|
537127
536938
|
setThemeType(newTheme);
|
|
537128
536939
|
}
|
|
537129
536940
|
}, [onBack, setThemeType, selectedTheme, handleToggleSimpleMode]);
|
|
537130
|
-
const handleSelectionChange = (0,
|
|
536941
|
+
const handleSelectionChange = (0, import_react80.useCallback)((newInfoText, value) => {
|
|
537131
536942
|
setInfoText(newInfoText);
|
|
537132
536943
|
if (value === "back" || value === "edit-custom" || value === "simple-mode") {
|
|
537133
536944
|
setThemeType(selectedTheme);
|
|
@@ -537135,7 +536946,7 @@ function ThemeSettingsScreen({ onBack, inlineMode = false }) {
|
|
|
537135
536946
|
setThemeType(value);
|
|
537136
536947
|
}
|
|
537137
536948
|
}, [setThemeType, selectedTheme]);
|
|
537138
|
-
const handleBackFromCustom = (0,
|
|
536949
|
+
const handleBackFromCustom = (0, import_react80.useCallback)((nextSelectedTheme) => {
|
|
537139
536950
|
setScreen("main");
|
|
537140
536951
|
if (nextSelectedTheme) {
|
|
537141
536952
|
setSelectedTheme(nextSelectedTheme);
|
|
@@ -537148,24 +536959,24 @@ function ThemeSettingsScreen({ onBack, inlineMode = false }) {
|
|
|
537148
536959
|
}
|
|
537149
536960
|
}, { isActive: screen === "main" });
|
|
537150
536961
|
if (screen === "custom") {
|
|
537151
|
-
return
|
|
537152
|
-
|
|
537153
|
-
{ fallback:
|
|
537154
|
-
|
|
536962
|
+
return import_react80.default.createElement(
|
|
536963
|
+
import_react80.Suspense,
|
|
536964
|
+
{ fallback: import_react80.default.createElement(Spinner2, { label: "Loading..." }) },
|
|
536965
|
+
import_react80.default.createElement(CustomThemeScreen2, { onBack: handleBackFromCustom })
|
|
537155
536966
|
);
|
|
537156
536967
|
}
|
|
537157
|
-
return
|
|
536968
|
+
return import_react80.default.createElement(
|
|
537158
536969
|
Box_default,
|
|
537159
536970
|
{ flexDirection: "column" },
|
|
537160
|
-
!inlineMode &&
|
|
536971
|
+
!inlineMode && import_react80.default.createElement(
|
|
537161
536972
|
Box_default,
|
|
537162
536973
|
{ borderStyle: "round", borderColor: "cyan", paddingX: 1 },
|
|
537163
|
-
|
|
536974
|
+
import_react80.default.createElement(Text, { bold: true, color: "cyan" }, t.themeSettings.title)
|
|
537164
536975
|
),
|
|
537165
|
-
|
|
536976
|
+
import_react80.default.createElement(
|
|
537166
536977
|
Box_default,
|
|
537167
536978
|
{ flexDirection: "column", paddingX: 1 },
|
|
537168
|
-
|
|
536979
|
+
import_react80.default.createElement(
|
|
537169
536980
|
Text,
|
|
537170
536981
|
{ color: "gray", dimColor: true },
|
|
537171
536982
|
t.themeSettings.current,
|
|
@@ -537173,31 +536984,31 @@ function ThemeSettingsScreen({ onBack, inlineMode = false }) {
|
|
|
537173
536984
|
((_a21 = themeOptions.find((opt) => opt.value === selectedTheme)) == null ? void 0 : _a21.label.replace("\u2713 ", "")) || selectedTheme
|
|
537174
536985
|
)
|
|
537175
536986
|
),
|
|
537176
|
-
|
|
537177
|
-
|
|
536987
|
+
import_react80.default.createElement(Menu_default, { options: themeOptions, onSelect: handleSelect, onSelectionChange: handleSelectionChange }),
|
|
536988
|
+
import_react80.default.createElement(
|
|
537178
536989
|
Box_default,
|
|
537179
536990
|
{ flexDirection: "column", paddingX: 1 },
|
|
537180
|
-
|
|
537181
|
-
|
|
537182
|
-
|
|
536991
|
+
import_react80.default.createElement(Text, { color: "gray", dimColor: true }, t.themeSettings.preview),
|
|
536992
|
+
import_react80.default.createElement(DiffViewer, { oldContent: sampleOldCode2, newContent: sampleNewCode2, filename: "example.ts" }),
|
|
536993
|
+
import_react80.default.createElement(
|
|
537183
536994
|
Box_default,
|
|
537184
536995
|
{ marginTop: 1, flexDirection: "column" },
|
|
537185
|
-
|
|
537186
|
-
|
|
536996
|
+
import_react80.default.createElement(Text, { color: "gray", dimColor: true }, t.themeSettings.userMessagePreview),
|
|
536997
|
+
import_react80.default.createElement(UserMessagePreview, { content: t.themeSettings.userMessageSample })
|
|
537187
536998
|
)
|
|
537188
536999
|
),
|
|
537189
|
-
infoText &&
|
|
537000
|
+
infoText && import_react80.default.createElement(
|
|
537190
537001
|
Box_default,
|
|
537191
537002
|
{ paddingX: 1 },
|
|
537192
|
-
|
|
537003
|
+
import_react80.default.createElement(Alert, { variant: "info" }, infoText)
|
|
537193
537004
|
)
|
|
537194
537005
|
);
|
|
537195
537006
|
}
|
|
537196
|
-
var
|
|
537007
|
+
var import_react80, CustomThemeScreen2, sampleOldCode2, sampleNewCode2;
|
|
537197
537008
|
var init_ThemeSettingsScreen = __esm({
|
|
537198
537009
|
async "dist/ui/pages/ThemeSettingsScreen.js"() {
|
|
537199
537010
|
"use strict";
|
|
537200
|
-
|
|
537011
|
+
import_react80 = __toESM(require_react(), 1);
|
|
537201
537012
|
await init_build2();
|
|
537202
537013
|
await init_build4();
|
|
537203
537014
|
await init_Menu();
|
|
@@ -537206,7 +537017,7 @@ var init_ThemeSettingsScreen = __esm({
|
|
|
537206
537017
|
init_ThemeContext();
|
|
537207
537018
|
init_i18n();
|
|
537208
537019
|
init_themeConfig();
|
|
537209
|
-
CustomThemeScreen2 =
|
|
537020
|
+
CustomThemeScreen2 = import_react80.default.lazy(() => init_CustomThemeScreen().then(() => CustomThemeScreen_exports));
|
|
537210
537021
|
sampleOldCode2 = `function greet(name) {
|
|
537211
537022
|
console.log("Hello " + name);
|
|
537212
537023
|
return "Welcome!";
|
|
@@ -537226,23 +537037,23 @@ __export(HooksConfigScreen_exports, {
|
|
|
537226
537037
|
function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPersist }) {
|
|
537227
537038
|
const { theme: theme14 } = useTheme();
|
|
537228
537039
|
const { t } = useI18n();
|
|
537229
|
-
const [screen, setScreen] = (0,
|
|
537230
|
-
const [selectedScope, setSelectedScope] = (0,
|
|
537231
|
-
const [selectedHookType, setSelectedHookType] = (0,
|
|
537232
|
-
const [selectedRuleIndex, setSelectedRuleIndex] = (0,
|
|
537233
|
-
const [editingRule, setEditingRule] = (0,
|
|
537234
|
-
const [selectedHookInfo, setSelectedHookInfo] = (0,
|
|
537235
|
-
const [scopeMenuIndex, setScopeMenuIndex] = (0,
|
|
537236
|
-
|
|
537040
|
+
const [screen, setScreen] = (0, import_react81.useState)("scope-select");
|
|
537041
|
+
const [selectedScope, setSelectedScope] = (0, import_react81.useState)("project");
|
|
537042
|
+
const [selectedHookType, setSelectedHookType] = (0, import_react81.useState)(null);
|
|
537043
|
+
const [selectedRuleIndex, setSelectedRuleIndex] = (0, import_react81.useState)(-1);
|
|
537044
|
+
const [editingRule, setEditingRule] = (0, import_react81.useState)(null);
|
|
537045
|
+
const [selectedHookInfo, setSelectedHookInfo] = (0, import_react81.useState)("");
|
|
537046
|
+
const [scopeMenuIndex, setScopeMenuIndex] = (0, import_react81.useState)(defaultScopeIndex);
|
|
537047
|
+
import_react81.default.useEffect(() => {
|
|
537237
537048
|
setScopeMenuIndex(defaultScopeIndex);
|
|
537238
537049
|
}, [defaultScopeIndex]);
|
|
537239
|
-
const [editingRuleField, setEditingRuleField] = (0,
|
|
537240
|
-
const [ruleFieldValue, setRuleFieldValue] = (0,
|
|
537241
|
-
const [selectedActionIndex, setSelectedActionIndex] = (0,
|
|
537242
|
-
const [editingAction, setEditingAction] = (0,
|
|
537243
|
-
const [editingActionField, setEditingActionField] = (0,
|
|
537244
|
-
const [actionFieldValue, setActionFieldValue] = (0,
|
|
537245
|
-
const canAddActionType = (0,
|
|
537050
|
+
const [editingRuleField, setEditingRuleField] = (0, import_react81.useState)(null);
|
|
537051
|
+
const [ruleFieldValue, setRuleFieldValue] = (0, import_react81.useState)("");
|
|
537052
|
+
const [selectedActionIndex, setSelectedActionIndex] = (0, import_react81.useState)(-1);
|
|
537053
|
+
const [editingAction, setEditingAction] = (0, import_react81.useState)(null);
|
|
537054
|
+
const [editingActionField, setEditingActionField] = (0, import_react81.useState)(null);
|
|
537055
|
+
const [actionFieldValue, setActionFieldValue] = (0, import_react81.useState)("");
|
|
537056
|
+
const canAddActionType = (0, import_react81.useCallback)((newType, currentHooks) => {
|
|
537246
537057
|
if (newType === "prompt") {
|
|
537247
537058
|
if (selectedHookType !== "onSubAgentComplete" && selectedHookType !== "onStop") {
|
|
537248
537059
|
return false;
|
|
@@ -537255,7 +537066,7 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537255
537066
|
}
|
|
537256
537067
|
return false;
|
|
537257
537068
|
}, [selectedHookType]);
|
|
537258
|
-
const handleBack = (0,
|
|
537069
|
+
const handleBack = (0, import_react81.useCallback)(() => {
|
|
537259
537070
|
if (screen === "scope-select") {
|
|
537260
537071
|
onBack();
|
|
537261
537072
|
} else if (screen === "hook-list") {
|
|
@@ -537296,10 +537107,10 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537296
537107
|
color: theme14.colors.error
|
|
537297
537108
|
}
|
|
537298
537109
|
];
|
|
537299
|
-
return
|
|
537300
|
-
|
|
537110
|
+
return import_react81.default.createElement(
|
|
537111
|
+
import_react81.default.Fragment,
|
|
537301
537112
|
null,
|
|
537302
|
-
|
|
537113
|
+
import_react81.default.createElement(Menu_default, { options: options3, defaultIndex: scopeMenuIndex, onSelect: (value) => {
|
|
537303
537114
|
if (value === "back") {
|
|
537304
537115
|
onBack();
|
|
537305
537116
|
} else {
|
|
@@ -537314,10 +537125,10 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537314
537125
|
onScopeSelectionPersist == null ? void 0 : onScopeSelectionPersist(index);
|
|
537315
537126
|
}
|
|
537316
537127
|
} }),
|
|
537317
|
-
selectedHookInfo &&
|
|
537128
|
+
selectedHookInfo && import_react81.default.createElement(
|
|
537318
537129
|
Box_default,
|
|
537319
537130
|
{ marginTop: 1 },
|
|
537320
|
-
|
|
537131
|
+
import_react81.default.createElement(Alert, { variant: "info" }, selectedHookInfo)
|
|
537321
537132
|
)
|
|
537322
537133
|
);
|
|
537323
537134
|
};
|
|
@@ -537342,13 +537153,13 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537342
537153
|
infoText: t.hooksConfig.hookList.backInfo,
|
|
537343
537154
|
color: theme14.colors.error
|
|
537344
537155
|
});
|
|
537345
|
-
return
|
|
537346
|
-
|
|
537156
|
+
return import_react81.default.createElement(
|
|
537157
|
+
import_react81.default.Fragment,
|
|
537347
537158
|
null,
|
|
537348
|
-
|
|
537159
|
+
import_react81.default.createElement(
|
|
537349
537160
|
Box_default,
|
|
537350
537161
|
{ marginBottom: 1 },
|
|
537351
|
-
|
|
537162
|
+
import_react81.default.createElement(
|
|
537352
537163
|
Text,
|
|
537353
537164
|
{ bold: true, color: theme14.colors.menuSelected },
|
|
537354
537165
|
t.hooksConfig.hookList.title,
|
|
@@ -537357,7 +537168,7 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537357
537168
|
selectedScope === "global" ? t.hooksConfig.hookList.global : t.hooksConfig.hookList.project
|
|
537358
537169
|
)
|
|
537359
537170
|
),
|
|
537360
|
-
|
|
537171
|
+
import_react81.default.createElement(Menu_default, { options: options3, onSelect: (value) => {
|
|
537361
537172
|
if (value === "back") {
|
|
537362
537173
|
handleBack();
|
|
537363
537174
|
} else {
|
|
@@ -537396,16 +537207,16 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537396
537207
|
infoText: t.hooksConfig.hookDetail.backInfo,
|
|
537397
537208
|
color: theme14.colors.error
|
|
537398
537209
|
});
|
|
537399
|
-
return
|
|
537400
|
-
|
|
537210
|
+
return import_react81.default.createElement(
|
|
537211
|
+
import_react81.default.Fragment,
|
|
537401
537212
|
null,
|
|
537402
|
-
|
|
537213
|
+
import_react81.default.createElement(
|
|
537403
537214
|
Box_default,
|
|
537404
537215
|
{ marginBottom: 1, flexDirection: "column" },
|
|
537405
|
-
|
|
537406
|
-
|
|
537216
|
+
import_react81.default.createElement(Text, { bold: true, color: theme14.colors.menuSelected }, selectedHookType),
|
|
537217
|
+
import_react81.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.hooksConfig.hookTypes[selectedHookType] || selectedHookType)
|
|
537407
537218
|
),
|
|
537408
|
-
|
|
537219
|
+
import_react81.default.createElement(Menu_default, { options: options3, onSelect: (value) => {
|
|
537409
537220
|
if (value === "back") {
|
|
537410
537221
|
handleBack();
|
|
537411
537222
|
} else if (value === "add") {
|
|
@@ -537432,24 +537243,24 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537432
537243
|
return null;
|
|
537433
537244
|
if (editingRuleField) {
|
|
537434
537245
|
const isMatcherField = editingRuleField === "matcher";
|
|
537435
|
-
return
|
|
537246
|
+
return import_react81.default.createElement(
|
|
537436
537247
|
Box_default,
|
|
537437
537248
|
{ flexDirection: "column" },
|
|
537438
|
-
|
|
537249
|
+
import_react81.default.createElement(
|
|
537439
537250
|
Box_default,
|
|
537440
537251
|
{ marginBottom: 1 },
|
|
537441
|
-
|
|
537252
|
+
import_react81.default.createElement(Text, { bold: true, color: theme14.colors.menuSelected }, editingRuleField === "description" ? t.hooksConfig.ruleEdit.editDescription : t.hooksConfig.ruleEdit.editMatcher)
|
|
537442
537253
|
),
|
|
537443
|
-
isMatcherField &&
|
|
537254
|
+
isMatcherField && import_react81.default.createElement(
|
|
537444
537255
|
Box_default,
|
|
537445
537256
|
{ marginBottom: 1 },
|
|
537446
|
-
|
|
537257
|
+
import_react81.default.createElement(Text, { color: theme14.colors.menuInfo }, t.hooksConfig.ruleEdit.matcherHint)
|
|
537447
537258
|
),
|
|
537448
|
-
|
|
537259
|
+
import_react81.default.createElement(
|
|
537449
537260
|
Box_default,
|
|
537450
537261
|
null,
|
|
537451
|
-
|
|
537452
|
-
|
|
537262
|
+
import_react81.default.createElement(Text, { color: theme14.colors.success }, "> "),
|
|
537263
|
+
import_react81.default.createElement(build_default2, { value: ruleFieldValue, onChange: setRuleFieldValue, onSubmit: () => {
|
|
537453
537264
|
setEditingRule({
|
|
537454
537265
|
...editingRule,
|
|
537455
537266
|
[editingRuleField]: ruleFieldValue
|
|
@@ -537458,10 +537269,10 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537458
537269
|
setRuleFieldValue("");
|
|
537459
537270
|
} })
|
|
537460
537271
|
),
|
|
537461
|
-
|
|
537272
|
+
import_react81.default.createElement(
|
|
537462
537273
|
Box_default,
|
|
537463
537274
|
{ marginTop: 1 },
|
|
537464
|
-
|
|
537275
|
+
import_react81.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.hooksConfig.ruleEdit.enterToSave)
|
|
537465
537276
|
)
|
|
537466
537277
|
);
|
|
537467
537278
|
}
|
|
@@ -537515,16 +537326,16 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537515
537326
|
infoText: t.hooksConfig.ruleEdit.cancelInfo,
|
|
537516
537327
|
color: theme14.colors.error
|
|
537517
537328
|
});
|
|
537518
|
-
return
|
|
537519
|
-
|
|
537329
|
+
return import_react81.default.createElement(
|
|
537330
|
+
import_react81.default.Fragment,
|
|
537520
537331
|
null,
|
|
537521
|
-
|
|
537332
|
+
import_react81.default.createElement(
|
|
537522
537333
|
Box_default,
|
|
537523
537334
|
{ marginBottom: 1, flexDirection: "column" },
|
|
537524
|
-
|
|
537525
|
-
|
|
537335
|
+
import_react81.default.createElement(Text, { bold: true, color: theme14.colors.menuSelected }, t.hooksConfig.ruleEdit.title),
|
|
537336
|
+
import_react81.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.hooksConfig.ruleEdit.hint)
|
|
537526
537337
|
),
|
|
537527
|
-
|
|
537338
|
+
import_react81.default.createElement(Menu_default, { options: options3, onSelect: (value) => {
|
|
537528
537339
|
if (value === "back") {
|
|
537529
537340
|
handleBack();
|
|
537530
537341
|
} else if (value === "save") {
|
|
@@ -537584,24 +537395,24 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537584
537395
|
if (!editingAction || !editingRule)
|
|
537585
537396
|
return null;
|
|
537586
537397
|
if (editingActionField && editingActionField !== "enabled" && editingActionField !== "type") {
|
|
537587
|
-
return
|
|
537398
|
+
return import_react81.default.createElement(
|
|
537588
537399
|
Box_default,
|
|
537589
537400
|
{ flexDirection: "column" },
|
|
537590
|
-
|
|
537401
|
+
import_react81.default.createElement(
|
|
537591
537402
|
Box_default,
|
|
537592
537403
|
{ marginBottom: 1 },
|
|
537593
|
-
|
|
537404
|
+
import_react81.default.createElement(
|
|
537594
537405
|
Text,
|
|
537595
537406
|
{ bold: true, color: theme14.colors.menuSelected },
|
|
537596
537407
|
"\u7F16\u8F91 ",
|
|
537597
537408
|
editingActionField
|
|
537598
537409
|
)
|
|
537599
537410
|
),
|
|
537600
|
-
|
|
537411
|
+
import_react81.default.createElement(
|
|
537601
537412
|
Box_default,
|
|
537602
537413
|
null,
|
|
537603
|
-
|
|
537604
|
-
|
|
537414
|
+
import_react81.default.createElement(Text, { color: theme14.colors.success }, "> "),
|
|
537415
|
+
import_react81.default.createElement(build_default2, { value: actionFieldValue, onChange: setActionFieldValue, onSubmit: () => {
|
|
537605
537416
|
const value = editingActionField === "timeout" ? actionFieldValue ? parseInt(actionFieldValue) : void 0 : actionFieldValue || void 0;
|
|
537606
537417
|
setEditingAction({
|
|
537607
537418
|
...editingAction,
|
|
@@ -537611,10 +537422,10 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537611
537422
|
setActionFieldValue("");
|
|
537612
537423
|
} })
|
|
537613
537424
|
),
|
|
537614
|
-
|
|
537425
|
+
import_react81.default.createElement(
|
|
537615
537426
|
Box_default,
|
|
537616
537427
|
{ marginTop: 1 },
|
|
537617
|
-
|
|
537428
|
+
import_react81.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.hooksConfig.actionEdit.enterToSave)
|
|
537618
537429
|
)
|
|
537619
537430
|
);
|
|
537620
537431
|
}
|
|
@@ -537670,16 +537481,16 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537670
537481
|
infoText: t.hooksConfig.actionEdit.cancelInfo,
|
|
537671
537482
|
color: theme14.colors.error
|
|
537672
537483
|
});
|
|
537673
|
-
return
|
|
537674
|
-
|
|
537484
|
+
return import_react81.default.createElement(
|
|
537485
|
+
import_react81.default.Fragment,
|
|
537675
537486
|
null,
|
|
537676
|
-
|
|
537487
|
+
import_react81.default.createElement(
|
|
537677
537488
|
Box_default,
|
|
537678
537489
|
{ marginBottom: 1, flexDirection: "column" },
|
|
537679
|
-
|
|
537680
|
-
|
|
537490
|
+
import_react81.default.createElement(Text, { bold: true, color: theme14.colors.menuSelected }, t.hooksConfig.actionEdit.title),
|
|
537491
|
+
import_react81.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.hooksConfig.actionEdit.hint)
|
|
537681
537492
|
),
|
|
537682
|
-
|
|
537493
|
+
import_react81.default.createElement(Menu_default, { options: options3, onSelect: (value) => {
|
|
537683
537494
|
var _a21;
|
|
537684
537495
|
if (value === "back") {
|
|
537685
537496
|
handleBack();
|
|
@@ -537765,7 +537576,7 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537765
537576
|
}
|
|
537766
537577
|
}
|
|
537767
537578
|
}, { isActive: true });
|
|
537768
|
-
return
|
|
537579
|
+
return import_react81.default.createElement(
|
|
537769
537580
|
Box_default,
|
|
537770
537581
|
{ flexDirection: "column", padding: 1 },
|
|
537771
537582
|
screen === "scope-select" && renderScopeSelect(),
|
|
@@ -537773,18 +537584,18 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537773
537584
|
screen === "hook-detail" && renderHookDetail(),
|
|
537774
537585
|
screen === "rule-edit" && renderRuleEdit(),
|
|
537775
537586
|
screen === "action-edit" && renderActionEdit(),
|
|
537776
|
-
selectedHookInfo && screen === "hook-list" &&
|
|
537587
|
+
selectedHookInfo && screen === "hook-list" && import_react81.default.createElement(
|
|
537777
537588
|
Box_default,
|
|
537778
537589
|
{ marginTop: 1 },
|
|
537779
|
-
|
|
537590
|
+
import_react81.default.createElement(Alert, { variant: "info" }, selectedHookInfo)
|
|
537780
537591
|
)
|
|
537781
537592
|
);
|
|
537782
537593
|
}
|
|
537783
|
-
var
|
|
537594
|
+
var import_react81;
|
|
537784
537595
|
var init_HooksConfigScreen = __esm({
|
|
537785
537596
|
async "dist/ui/pages/HooksConfigScreen.js"() {
|
|
537786
537597
|
"use strict";
|
|
537787
|
-
|
|
537598
|
+
import_react81 = __toESM(require_react(), 1);
|
|
537788
537599
|
await init_build2();
|
|
537789
537600
|
await init_build5();
|
|
537790
537601
|
await init_build4();
|
|
@@ -537803,26 +537614,26 @@ __export(WelcomeScreen_exports, {
|
|
|
537803
537614
|
function WelcomeScreen({ version: version3 = "1.0.0", onMenuSelect, defaultMenuIndex = 0, onMenuSelectionPersist }) {
|
|
537804
537615
|
const { t } = useI18n();
|
|
537805
537616
|
const { theme: theme14 } = useTheme();
|
|
537806
|
-
const [infoText, setInfoText] = (0,
|
|
537807
|
-
const [inlineView, setInlineView] = (0,
|
|
537808
|
-
const [updateNotice, setUpdateNoticeState] = (0,
|
|
537809
|
-
const [editingAgentId, setEditingAgentId] = (0,
|
|
537617
|
+
const [infoText, setInfoText] = (0, import_react82.useState)(t.welcome.startChatInfo);
|
|
537618
|
+
const [inlineView, setInlineView] = (0, import_react82.useState)("menu");
|
|
537619
|
+
const [updateNotice, setUpdateNoticeState] = (0, import_react82.useState)(getUpdateNotice());
|
|
537620
|
+
const [editingAgentId, setEditingAgentId] = (0, import_react82.useState)();
|
|
537810
537621
|
const { columns: terminalWidth } = useTerminalSize();
|
|
537811
537622
|
const { stdout } = use_stdout_default();
|
|
537812
|
-
const isInitialMount = (0,
|
|
537813
|
-
const [currentMenuIndex, setCurrentMenuIndex] = (0,
|
|
537814
|
-
const [subAgentListIndex, setSubAgentListIndex] = (0,
|
|
537815
|
-
const [hooksConfigIndex, setHooksConfigIndex] = (0,
|
|
537816
|
-
(0,
|
|
537623
|
+
const isInitialMount = (0, import_react82.useRef)(true);
|
|
537624
|
+
const [currentMenuIndex, setCurrentMenuIndex] = (0, import_react82.useState)(defaultMenuIndex);
|
|
537625
|
+
const [subAgentListIndex, setSubAgentListIndex] = (0, import_react82.useState)(0);
|
|
537626
|
+
const [hooksConfigIndex, setHooksConfigIndex] = (0, import_react82.useState)(0);
|
|
537627
|
+
(0, import_react82.useEffect)(() => {
|
|
537817
537628
|
setCurrentMenuIndex(defaultMenuIndex);
|
|
537818
537629
|
}, [defaultMenuIndex]);
|
|
537819
|
-
(0,
|
|
537630
|
+
(0, import_react82.useEffect)(() => {
|
|
537820
537631
|
const unsubscribe = onUpdateNotice((notice) => {
|
|
537821
537632
|
setUpdateNoticeState(notice);
|
|
537822
537633
|
});
|
|
537823
537634
|
return unsubscribe;
|
|
537824
537635
|
}, []);
|
|
537825
|
-
const menuOptions = (0,
|
|
537636
|
+
const menuOptions = (0, import_react82.useMemo)(() => [
|
|
537826
537637
|
{
|
|
537827
537638
|
label: t.welcome.startChat,
|
|
537828
537639
|
value: "chat",
|
|
@@ -537897,15 +537708,15 @@ function WelcomeScreen({ version: version3 = "1.0.0", onMenuSelect, defaultMenuI
|
|
|
537897
537708
|
infoText: t.welcome.exitInfo
|
|
537898
537709
|
}
|
|
537899
537710
|
], [t]);
|
|
537900
|
-
const [remountKey, setRemountKey] = (0,
|
|
537901
|
-
const optionsIndexMap = (0,
|
|
537711
|
+
const [remountKey, setRemountKey] = (0, import_react82.useState)(0);
|
|
537712
|
+
const optionsIndexMap = (0, import_react82.useMemo)(() => {
|
|
537902
537713
|
const map3 = /* @__PURE__ */ new Map();
|
|
537903
537714
|
menuOptions.forEach((opt, idx2) => {
|
|
537904
537715
|
map3.set(opt.value, idx2);
|
|
537905
537716
|
});
|
|
537906
537717
|
return map3;
|
|
537907
537718
|
}, [menuOptions]);
|
|
537908
|
-
const handleSelectionChange = (0,
|
|
537719
|
+
const handleSelectionChange = (0, import_react82.useCallback)((newInfoText, value) => {
|
|
537909
537720
|
setInfoText((prev) => prev === newInfoText ? prev : newInfoText);
|
|
537910
537721
|
const index = optionsIndexMap.get(value);
|
|
537911
537722
|
if (index !== void 0) {
|
|
@@ -537913,7 +537724,7 @@ function WelcomeScreen({ version: version3 = "1.0.0", onMenuSelect, defaultMenuI
|
|
|
537913
537724
|
onMenuSelectionPersist == null ? void 0 : onMenuSelectionPersist(index);
|
|
537914
537725
|
}
|
|
537915
537726
|
}, [optionsIndexMap, onMenuSelectionPersist]);
|
|
537916
|
-
const handleInlineMenuSelect = (0,
|
|
537727
|
+
const handleInlineMenuSelect = (0, import_react82.useCallback)((value) => {
|
|
537917
537728
|
const index = menuOptions.findIndex((opt) => opt.value === value);
|
|
537918
537729
|
if (index !== -1) {
|
|
537919
537730
|
setCurrentMenuIndex(index);
|
|
@@ -537943,31 +537754,31 @@ function WelcomeScreen({ version: version3 = "1.0.0", onMenuSelect, defaultMenuI
|
|
|
537943
537754
|
onMenuSelect == null ? void 0 : onMenuSelect(value);
|
|
537944
537755
|
}
|
|
537945
537756
|
}, [onMenuSelect, menuOptions, onMenuSelectionPersist]);
|
|
537946
|
-
const handleBackToMenu = (0,
|
|
537757
|
+
const handleBackToMenu = (0, import_react82.useCallback)(() => {
|
|
537947
537758
|
setInlineView("menu");
|
|
537948
537759
|
}, []);
|
|
537949
|
-
const handleConfigSave = (0,
|
|
537760
|
+
const handleConfigSave = (0, import_react82.useCallback)(() => {
|
|
537950
537761
|
setInlineView("menu");
|
|
537951
537762
|
}, []);
|
|
537952
|
-
const handleSubAgentAdd = (0,
|
|
537763
|
+
const handleSubAgentAdd = (0, import_react82.useCallback)(() => {
|
|
537953
537764
|
setEditingAgentId(void 0);
|
|
537954
537765
|
setInlineView("subagent-add");
|
|
537955
537766
|
}, []);
|
|
537956
|
-
const handleSubAgentEdit = (0,
|
|
537767
|
+
const handleSubAgentEdit = (0, import_react82.useCallback)((agentId) => {
|
|
537957
537768
|
setEditingAgentId(agentId);
|
|
537958
537769
|
setInlineView("subagent-edit");
|
|
537959
537770
|
}, []);
|
|
537960
|
-
const handleSubAgentBack = (0,
|
|
537771
|
+
const handleSubAgentBack = (0, import_react82.useCallback)(() => {
|
|
537961
537772
|
stdout.write(base_exports.clearTerminal);
|
|
537962
537773
|
setRemountKey((prev) => prev + 1);
|
|
537963
537774
|
setInlineView("subagent-list");
|
|
537964
537775
|
}, [stdout]);
|
|
537965
|
-
const handleSubAgentSave = (0,
|
|
537776
|
+
const handleSubAgentSave = (0, import_react82.useCallback)(() => {
|
|
537966
537777
|
stdout.write(base_exports.clearTerminal);
|
|
537967
537778
|
setRemountKey((prev) => prev + 1);
|
|
537968
537779
|
setInlineView("subagent-list");
|
|
537969
537780
|
}, [stdout]);
|
|
537970
|
-
(0,
|
|
537781
|
+
(0, import_react82.useEffect)(() => {
|
|
537971
537782
|
if (isInitialMount.current) {
|
|
537972
537783
|
isInitialMount.current = false;
|
|
537973
537784
|
return;
|
|
@@ -537980,37 +537791,37 @@ function WelcomeScreen({ version: version3 = "1.0.0", onMenuSelect, defaultMenuI
|
|
|
537980
537791
|
clearTimeout(handler);
|
|
537981
537792
|
};
|
|
537982
537793
|
}, [terminalWidth, stdout]);
|
|
537983
|
-
const loadingFallback =
|
|
537794
|
+
const loadingFallback = import_react82.default.createElement(
|
|
537984
537795
|
Box_default,
|
|
537985
537796
|
{ paddingX: 1 },
|
|
537986
|
-
|
|
537797
|
+
import_react82.default.createElement(
|
|
537987
537798
|
Text,
|
|
537988
537799
|
{ color: "cyan" },
|
|
537989
|
-
|
|
537800
|
+
import_react82.default.createElement(build_default, { type: "dots" })
|
|
537990
537801
|
),
|
|
537991
|
-
|
|
537802
|
+
import_react82.default.createElement(Text, null, " Loading...")
|
|
537992
537803
|
);
|
|
537993
|
-
return
|
|
537804
|
+
return import_react82.default.createElement(
|
|
537994
537805
|
Box_default,
|
|
537995
537806
|
{ flexDirection: "column", width: terminalWidth },
|
|
537996
|
-
|
|
537997
|
-
|
|
537807
|
+
import_react82.default.createElement(Static, { key: remountKey, items: [
|
|
537808
|
+
import_react82.default.createElement(
|
|
537998
537809
|
Box_default,
|
|
537999
537810
|
{ key: "welcome-header", flexDirection: "row", paddingLeft: 2, paddingTop: 1, paddingBottom: 0, width: terminalWidth },
|
|
538000
|
-
|
|
537811
|
+
import_react82.default.createElement(
|
|
538001
537812
|
Box_default,
|
|
538002
537813
|
{ flexDirection: "column", justifyContent: "center" },
|
|
538003
|
-
|
|
537814
|
+
import_react82.default.createElement(
|
|
538004
537815
|
Box_default,
|
|
538005
537816
|
{ marginBottom: 0 },
|
|
538006
|
-
|
|
537817
|
+
import_react82.default.createElement(
|
|
538007
537818
|
Text,
|
|
538008
537819
|
null,
|
|
538009
|
-
|
|
538010
|
-
|
|
537820
|
+
import_react82.default.createElement(Text, { color: "cyan" }, "\u2746 "),
|
|
537821
|
+
import_react82.default.createElement(dist_default4, { colors: theme14.colors.logoGradient }, "SNOW CLI")
|
|
538011
537822
|
)
|
|
538012
537823
|
),
|
|
538013
|
-
|
|
537824
|
+
import_react82.default.createElement(
|
|
538014
537825
|
Text,
|
|
538015
537826
|
{ color: "gray", dimColor: true },
|
|
538016
537827
|
"v",
|
|
@@ -538021,41 +537832,41 @@ function WelcomeScreen({ version: version3 = "1.0.0", onMenuSelect, defaultMenuI
|
|
|
538021
537832
|
)
|
|
538022
537833
|
)
|
|
538023
537834
|
] }, (item) => item),
|
|
538024
|
-
inlineView === "menu" && updateNotice &&
|
|
537835
|
+
inlineView === "menu" && updateNotice && import_react82.default.createElement(
|
|
538025
537836
|
Box_default,
|
|
538026
537837
|
{ paddingX: 1, marginBottom: 1 },
|
|
538027
|
-
|
|
537838
|
+
import_react82.default.createElement(
|
|
538028
537839
|
Box_default,
|
|
538029
537840
|
{ borderStyle: "double", borderColor: "cyan", paddingX: 2, paddingY: 1, width: terminalWidth - 2 },
|
|
538030
|
-
|
|
537841
|
+
import_react82.default.createElement(
|
|
538031
537842
|
Box_default,
|
|
538032
537843
|
{ flexDirection: "column" },
|
|
538033
|
-
|
|
538034
|
-
|
|
537844
|
+
import_react82.default.createElement(Text, { bold: true, color: "cyan" }, t.welcome.updateNoticeTitle),
|
|
537845
|
+
import_react82.default.createElement(
|
|
538035
537846
|
Text,
|
|
538036
537847
|
{ color: "gray", dimColor: true },
|
|
538037
537848
|
t.welcome.updateNoticeCurrent,
|
|
538038
537849
|
":",
|
|
538039
537850
|
" ",
|
|
538040
|
-
|
|
537851
|
+
import_react82.default.createElement(Text, { color: "gray" }, updateNotice.currentVersion)
|
|
538041
537852
|
),
|
|
538042
|
-
|
|
537853
|
+
import_react82.default.createElement(
|
|
538043
537854
|
Text,
|
|
538044
537855
|
{ color: "gray", dimColor: true },
|
|
538045
537856
|
t.welcome.updateNoticeLatest,
|
|
538046
537857
|
":",
|
|
538047
537858
|
" ",
|
|
538048
|
-
|
|
537859
|
+
import_react82.default.createElement(Text, { color: "yellow", bold: true }, updateNotice.latestVersion)
|
|
538049
537860
|
),
|
|
538050
|
-
|
|
537861
|
+
import_react82.default.createElement(
|
|
538051
537862
|
Text,
|
|
538052
537863
|
{ color: "gray", dimColor: true },
|
|
538053
537864
|
t.welcome.updateNoticeRun,
|
|
538054
537865
|
":",
|
|
538055
537866
|
" ",
|
|
538056
|
-
|
|
537867
|
+
import_react82.default.createElement(Text, { color: "yellow", bold: true }, "snow --update")
|
|
538057
537868
|
),
|
|
538058
|
-
|
|
537869
|
+
import_react82.default.createElement(
|
|
538059
537870
|
Text,
|
|
538060
537871
|
{ color: "gray", dimColor: true },
|
|
538061
537872
|
t.welcome.updateNoticeGithub,
|
|
@@ -538066,131 +537877,131 @@ function WelcomeScreen({ version: version3 = "1.0.0", onMenuSelect, defaultMenuI
|
|
|
538066
537877
|
)
|
|
538067
537878
|
)
|
|
538068
537879
|
),
|
|
538069
|
-
onMenuSelect && inlineView === "menu" &&
|
|
537880
|
+
onMenuSelect && inlineView === "menu" && import_react82.default.createElement(
|
|
538070
537881
|
Box_default,
|
|
538071
537882
|
{ paddingX: 1 },
|
|
538072
|
-
|
|
537883
|
+
import_react82.default.createElement(
|
|
538073
537884
|
Box_default,
|
|
538074
537885
|
{ borderStyle: "round", borderColor: "cyan", paddingX: 1 },
|
|
538075
|
-
|
|
537886
|
+
import_react82.default.createElement(Menu_default, { options: menuOptions, onSelect: handleInlineMenuSelect, onSelectionChange: handleSelectionChange, defaultIndex: currentMenuIndex })
|
|
538076
537887
|
)
|
|
538077
537888
|
),
|
|
538078
|
-
inlineView === "menu" &&
|
|
537889
|
+
inlineView === "menu" && import_react82.default.createElement(
|
|
538079
537890
|
Box_default,
|
|
538080
537891
|
{ paddingX: 1 },
|
|
538081
|
-
|
|
537892
|
+
import_react82.default.createElement(Alert, { variant: "info" }, infoText)
|
|
538082
537893
|
),
|
|
538083
|
-
inlineView === "config" &&
|
|
538084
|
-
|
|
537894
|
+
inlineView === "config" && import_react82.default.createElement(
|
|
537895
|
+
import_react82.Suspense,
|
|
538085
537896
|
{ fallback: loadingFallback },
|
|
538086
|
-
|
|
537897
|
+
import_react82.default.createElement(
|
|
538087
537898
|
Box_default,
|
|
538088
537899
|
{ paddingX: 1 },
|
|
538089
|
-
|
|
537900
|
+
import_react82.default.createElement(ConfigScreen2, { onBack: handleBackToMenu, onSave: handleConfigSave, inlineMode: true })
|
|
538090
537901
|
)
|
|
538091
537902
|
),
|
|
538092
|
-
inlineView === "proxy-config" &&
|
|
538093
|
-
|
|
537903
|
+
inlineView === "proxy-config" && import_react82.default.createElement(
|
|
537904
|
+
import_react82.Suspense,
|
|
538094
537905
|
{ fallback: loadingFallback },
|
|
538095
|
-
|
|
537906
|
+
import_react82.default.createElement(
|
|
538096
537907
|
Box_default,
|
|
538097
537908
|
{ paddingX: 1 },
|
|
538098
|
-
|
|
537909
|
+
import_react82.default.createElement(ProxyConfigScreen2, { onBack: handleBackToMenu, onSave: handleConfigSave, inlineMode: true })
|
|
538099
537910
|
)
|
|
538100
537911
|
),
|
|
538101
|
-
inlineView === "codebase-config" &&
|
|
538102
|
-
|
|
537912
|
+
inlineView === "codebase-config" && import_react82.default.createElement(
|
|
537913
|
+
import_react82.Suspense,
|
|
538103
537914
|
{ fallback: loadingFallback },
|
|
538104
|
-
|
|
537915
|
+
import_react82.default.createElement(
|
|
538105
537916
|
Box_default,
|
|
538106
537917
|
{ paddingX: 1 },
|
|
538107
|
-
|
|
537918
|
+
import_react82.default.createElement(CodeBaseConfigScreen2, { onBack: handleBackToMenu, onSave: handleConfigSave, inlineMode: true })
|
|
538108
537919
|
)
|
|
538109
537920
|
),
|
|
538110
|
-
inlineView === "subagent-list" &&
|
|
538111
|
-
|
|
537921
|
+
inlineView === "subagent-list" && import_react82.default.createElement(
|
|
537922
|
+
import_react82.Suspense,
|
|
538112
537923
|
{ fallback: loadingFallback },
|
|
538113
|
-
|
|
537924
|
+
import_react82.default.createElement(
|
|
538114
537925
|
Box_default,
|
|
538115
537926
|
{ paddingX: 1 },
|
|
538116
|
-
|
|
537927
|
+
import_react82.default.createElement(SubAgentListScreen2, { onBack: handleBackToMenu, onAdd: handleSubAgentAdd, onEdit: handleSubAgentEdit, inlineMode: true, defaultSelectedIndex: subAgentListIndex, onSelectionPersist: setSubAgentListIndex })
|
|
538117
537928
|
)
|
|
538118
537929
|
),
|
|
538119
|
-
inlineView === "subagent-add" &&
|
|
538120
|
-
|
|
537930
|
+
inlineView === "subagent-add" && import_react82.default.createElement(
|
|
537931
|
+
import_react82.Suspense,
|
|
538121
537932
|
{ fallback: loadingFallback },
|
|
538122
|
-
|
|
537933
|
+
import_react82.default.createElement(
|
|
538123
537934
|
Box_default,
|
|
538124
537935
|
{ paddingX: 1 },
|
|
538125
|
-
|
|
537936
|
+
import_react82.default.createElement(SubAgentConfigScreen2, { onBack: handleSubAgentBack, onSave: handleSubAgentSave, inlineMode: true })
|
|
538126
537937
|
)
|
|
538127
537938
|
),
|
|
538128
|
-
inlineView === "subagent-edit" &&
|
|
538129
|
-
|
|
537939
|
+
inlineView === "subagent-edit" && import_react82.default.createElement(
|
|
537940
|
+
import_react82.Suspense,
|
|
538130
537941
|
{ fallback: loadingFallback },
|
|
538131
|
-
|
|
537942
|
+
import_react82.default.createElement(
|
|
538132
537943
|
Box_default,
|
|
538133
537944
|
{ paddingX: 1 },
|
|
538134
|
-
|
|
537945
|
+
import_react82.default.createElement(SubAgentConfigScreen2, { onBack: handleSubAgentBack, onSave: handleSubAgentSave, agentId: editingAgentId, inlineMode: true })
|
|
538135
537946
|
)
|
|
538136
537947
|
),
|
|
538137
|
-
inlineView === "sensitive-commands" &&
|
|
538138
|
-
|
|
537948
|
+
inlineView === "sensitive-commands" && import_react82.default.createElement(
|
|
537949
|
+
import_react82.Suspense,
|
|
538139
537950
|
{ fallback: loadingFallback },
|
|
538140
|
-
|
|
537951
|
+
import_react82.default.createElement(
|
|
538141
537952
|
Box_default,
|
|
538142
537953
|
{ paddingX: 1 },
|
|
538143
|
-
|
|
537954
|
+
import_react82.default.createElement(SensitiveCommandConfigScreen2, { onBack: handleBackToMenu, inlineMode: true })
|
|
538144
537955
|
)
|
|
538145
537956
|
),
|
|
538146
|
-
inlineView === "systemprompt" &&
|
|
538147
|
-
|
|
537957
|
+
inlineView === "systemprompt" && import_react82.default.createElement(
|
|
537958
|
+
import_react82.Suspense,
|
|
538148
537959
|
{ fallback: loadingFallback },
|
|
538149
|
-
|
|
537960
|
+
import_react82.default.createElement(
|
|
538150
537961
|
Box_default,
|
|
538151
537962
|
{ paddingX: 1 },
|
|
538152
|
-
|
|
537963
|
+
import_react82.default.createElement(SystemPromptConfigScreen2, { onBack: handleBackToMenu })
|
|
538153
537964
|
)
|
|
538154
537965
|
),
|
|
538155
|
-
inlineView === "customheaders" &&
|
|
538156
|
-
|
|
537966
|
+
inlineView === "customheaders" && import_react82.default.createElement(
|
|
537967
|
+
import_react82.Suspense,
|
|
538157
537968
|
{ fallback: loadingFallback },
|
|
538158
|
-
|
|
537969
|
+
import_react82.default.createElement(
|
|
538159
537970
|
Box_default,
|
|
538160
537971
|
{ paddingX: 1 },
|
|
538161
|
-
|
|
537972
|
+
import_react82.default.createElement(CustomHeadersScreen2, { onBack: handleBackToMenu })
|
|
538162
537973
|
)
|
|
538163
537974
|
),
|
|
538164
|
-
inlineView === "hooks-config" &&
|
|
538165
|
-
|
|
537975
|
+
inlineView === "hooks-config" && import_react82.default.createElement(
|
|
537976
|
+
import_react82.Suspense,
|
|
538166
537977
|
{ fallback: loadingFallback },
|
|
538167
|
-
|
|
537978
|
+
import_react82.default.createElement(
|
|
538168
537979
|
Box_default,
|
|
538169
537980
|
{ paddingX: 1 },
|
|
538170
|
-
|
|
537981
|
+
import_react82.default.createElement(HooksConfigScreen2, { onBack: handleBackToMenu, defaultScopeIndex: hooksConfigIndex, onScopeSelectionPersist: setHooksConfigIndex })
|
|
538171
537982
|
)
|
|
538172
537983
|
),
|
|
538173
|
-
inlineView === "language-settings" &&
|
|
538174
|
-
|
|
537984
|
+
inlineView === "language-settings" && import_react82.default.createElement(
|
|
537985
|
+
import_react82.Suspense,
|
|
538175
537986
|
{ fallback: loadingFallback },
|
|
538176
|
-
|
|
537987
|
+
import_react82.default.createElement(
|
|
538177
537988
|
Box_default,
|
|
538178
537989
|
{ paddingX: 1 },
|
|
538179
|
-
|
|
537990
|
+
import_react82.default.createElement(LanguageSettingsScreen2, { onBack: handleBackToMenu, inlineMode: true })
|
|
538180
537991
|
)
|
|
538181
537992
|
),
|
|
538182
|
-
inlineView === "theme-settings" &&
|
|
538183
|
-
|
|
537993
|
+
inlineView === "theme-settings" && import_react82.default.createElement(
|
|
537994
|
+
import_react82.Suspense,
|
|
538184
537995
|
{ fallback: loadingFallback },
|
|
538185
|
-
|
|
537996
|
+
import_react82.default.createElement(ThemeSettingsScreen2, { onBack: handleBackToMenu, inlineMode: true })
|
|
538186
537997
|
)
|
|
538187
537998
|
);
|
|
538188
537999
|
}
|
|
538189
|
-
var
|
|
538000
|
+
var import_react82, ConfigScreen2, ProxyConfigScreen2, SubAgentConfigScreen2, SubAgentListScreen2, SensitiveCommandConfigScreen2, CodeBaseConfigScreen2, SystemPromptConfigScreen2, CustomHeadersScreen2, LanguageSettingsScreen2, ThemeSettingsScreen2, HooksConfigScreen2;
|
|
538190
538001
|
var init_WelcomeScreen = __esm({
|
|
538191
538002
|
async "dist/ui/pages/WelcomeScreen.js"() {
|
|
538192
538003
|
"use strict";
|
|
538193
|
-
|
|
538004
|
+
import_react82 = __toESM(require_react(), 1);
|
|
538194
538005
|
await init_build2();
|
|
538195
538006
|
await init_build4();
|
|
538196
538007
|
await init_dist4();
|
|
@@ -538201,17 +538012,17 @@ var init_WelcomeScreen = __esm({
|
|
|
538201
538012
|
init_i18n();
|
|
538202
538013
|
init_updateNotice();
|
|
538203
538014
|
init_ThemeContext();
|
|
538204
|
-
ConfigScreen2 =
|
|
538205
|
-
ProxyConfigScreen2 =
|
|
538206
|
-
SubAgentConfigScreen2 =
|
|
538207
|
-
SubAgentListScreen2 =
|
|
538208
|
-
SensitiveCommandConfigScreen2 =
|
|
538209
|
-
CodeBaseConfigScreen2 =
|
|
538210
|
-
SystemPromptConfigScreen2 =
|
|
538211
|
-
CustomHeadersScreen2 =
|
|
538212
|
-
LanguageSettingsScreen2 =
|
|
538213
|
-
ThemeSettingsScreen2 =
|
|
538214
|
-
HooksConfigScreen2 =
|
|
538015
|
+
ConfigScreen2 = import_react82.default.lazy(() => init_ConfigScreen().then(() => ConfigScreen_exports));
|
|
538016
|
+
ProxyConfigScreen2 = import_react82.default.lazy(() => init_ProxyConfigScreen().then(() => ProxyConfigScreen_exports));
|
|
538017
|
+
SubAgentConfigScreen2 = import_react82.default.lazy(() => init_SubAgentConfigScreen().then(() => SubAgentConfigScreen_exports));
|
|
538018
|
+
SubAgentListScreen2 = import_react82.default.lazy(() => init_SubAgentListScreen().then(() => SubAgentListScreen_exports));
|
|
538019
|
+
SensitiveCommandConfigScreen2 = import_react82.default.lazy(() => init_SensitiveCommandConfigScreen().then(() => SensitiveCommandConfigScreen_exports));
|
|
538020
|
+
CodeBaseConfigScreen2 = import_react82.default.lazy(() => init_CodeBaseConfigScreen().then(() => CodeBaseConfigScreen_exports));
|
|
538021
|
+
SystemPromptConfigScreen2 = import_react82.default.lazy(() => init_SystemPromptConfigScreen().then(() => SystemPromptConfigScreen_exports));
|
|
538022
|
+
CustomHeadersScreen2 = import_react82.default.lazy(() => init_CustomHeadersScreen().then(() => CustomHeadersScreen_exports));
|
|
538023
|
+
LanguageSettingsScreen2 = import_react82.default.lazy(() => init_LanguageSettingsScreen().then(() => LanguageSettingsScreen_exports));
|
|
538024
|
+
ThemeSettingsScreen2 = import_react82.default.lazy(() => init_ThemeSettingsScreen().then(() => ThemeSettingsScreen_exports));
|
|
538025
|
+
HooksConfigScreen2 = import_react82.default.lazy(() => init_HooksConfigScreen().then(() => HooksConfigScreen_exports));
|
|
538215
538026
|
}
|
|
538216
538027
|
});
|
|
538217
538028
|
|
|
@@ -538757,13 +538568,13 @@ var init_textBuffer = __esm({
|
|
|
538757
538568
|
|
|
538758
538569
|
// dist/hooks/input/useInputBuffer.js
|
|
538759
538570
|
function useInputBuffer(viewport) {
|
|
538760
|
-
const [, forceRender] = (0,
|
|
538761
|
-
const lastUpdateTime = (0,
|
|
538762
|
-
const bufferRef = (0,
|
|
538763
|
-
const forceUpdateRef = (0,
|
|
538571
|
+
const [, forceRender] = (0, import_react83.useReducer)((x) => x + 1, 0);
|
|
538572
|
+
const lastUpdateTime = (0, import_react83.useRef)(0);
|
|
538573
|
+
const bufferRef = (0, import_react83.useRef)(null);
|
|
538574
|
+
const forceUpdateRef = (0, import_react83.useRef)(() => {
|
|
538764
538575
|
forceRender();
|
|
538765
538576
|
});
|
|
538766
|
-
const triggerUpdateRef = (0,
|
|
538577
|
+
const triggerUpdateRef = (0, import_react83.useRef)(() => {
|
|
538767
538578
|
const now = Date.now();
|
|
538768
538579
|
lastUpdateTime.current = now;
|
|
538769
538580
|
forceUpdateRef.current();
|
|
@@ -538772,17 +538583,17 @@ function useInputBuffer(viewport) {
|
|
|
538772
538583
|
bufferRef.current = new TextBuffer(viewport, triggerUpdateRef.current);
|
|
538773
538584
|
}
|
|
538774
538585
|
const buffer = bufferRef.current;
|
|
538775
|
-
const forceUpdate = (0,
|
|
538586
|
+
const forceUpdate = (0, import_react83.useCallback)(() => {
|
|
538776
538587
|
forceUpdateRef.current();
|
|
538777
538588
|
}, []);
|
|
538778
|
-
const triggerUpdate = (0,
|
|
538589
|
+
const triggerUpdate = (0, import_react83.useCallback)(() => {
|
|
538779
538590
|
triggerUpdateRef.current();
|
|
538780
538591
|
}, []);
|
|
538781
|
-
(0,
|
|
538592
|
+
(0, import_react83.useEffect)(() => {
|
|
538782
538593
|
buffer.updateViewport(viewport);
|
|
538783
538594
|
forceUpdateRef.current();
|
|
538784
538595
|
}, [viewport.width, viewport.height, buffer]);
|
|
538785
|
-
(0,
|
|
538596
|
+
(0, import_react83.useEffect)(() => {
|
|
538786
538597
|
return () => {
|
|
538787
538598
|
buffer.destroy();
|
|
538788
538599
|
};
|
|
@@ -538793,11 +538604,11 @@ function useInputBuffer(viewport) {
|
|
|
538793
538604
|
forceUpdate
|
|
538794
538605
|
};
|
|
538795
538606
|
}
|
|
538796
|
-
var
|
|
538607
|
+
var import_react83;
|
|
538797
538608
|
var init_useInputBuffer = __esm({
|
|
538798
538609
|
"dist/hooks/input/useInputBuffer.js"() {
|
|
538799
538610
|
"use strict";
|
|
538800
|
-
|
|
538611
|
+
import_react83 = __toESM(require_react(), 1);
|
|
538801
538612
|
init_textBuffer();
|
|
538802
538613
|
}
|
|
538803
538614
|
});
|
|
@@ -538982,15 +538793,12 @@ var init_commandUsageManager = __esm({
|
|
|
538982
538793
|
// dist/hooks/ui/useCommandPanel.js
|
|
538983
538794
|
function useCommandPanel(buffer, isProcessing = false) {
|
|
538984
538795
|
const { t } = useI18n();
|
|
538985
|
-
const builtInCommands = (0,
|
|
538796
|
+
const builtInCommands = (0, import_react84.useMemo)(() => [
|
|
538986
538797
|
{ name: "help", description: t.commandPanel.commands.help },
|
|
538987
538798
|
{ name: "clear", description: t.commandPanel.commands.clear },
|
|
538988
538799
|
{ name: "resume", description: t.commandPanel.commands.resume },
|
|
538989
538800
|
{ name: "mcp", description: t.commandPanel.commands.mcp },
|
|
538990
|
-
{
|
|
538991
|
-
name: "yolo",
|
|
538992
|
-
description: t.commandPanel.commands.yolo
|
|
538993
|
-
},
|
|
538801
|
+
{ name: "yolo", description: t.commandPanel.commands.yolo },
|
|
538994
538802
|
{
|
|
538995
538803
|
name: "plan",
|
|
538996
538804
|
description: t.commandPanel.commands.plan
|
|
@@ -539021,6 +538829,10 @@ function useCommandPanel(buffer, isProcessing = false) {
|
|
|
539021
538829
|
name: "backend",
|
|
539022
538830
|
description: t.commandPanel.commands.backend || "Show background processes"
|
|
539023
538831
|
},
|
|
538832
|
+
{
|
|
538833
|
+
name: "profiles",
|
|
538834
|
+
description: t.commandPanel.commands.profiles
|
|
538835
|
+
},
|
|
539024
538836
|
{
|
|
539025
538837
|
name: "export",
|
|
539026
538838
|
description: t.commandPanel.commands.export
|
|
@@ -539062,17 +538874,17 @@ function useCommandPanel(buffer, isProcessing = false) {
|
|
|
539062
538874
|
description: t.commandPanel.commands.quit
|
|
539063
538875
|
}
|
|
539064
538876
|
], [t]);
|
|
539065
|
-
const getAllCommands = (0,
|
|
538877
|
+
const getAllCommands = (0, import_react84.useCallback)(() => {
|
|
539066
538878
|
const customCommands = getCustomCommands().map((cmd) => ({
|
|
539067
538879
|
name: cmd.name,
|
|
539068
538880
|
description: cmd.description || cmd.command
|
|
539069
538881
|
}));
|
|
539070
538882
|
return [...builtInCommands, ...customCommands];
|
|
539071
538883
|
}, [builtInCommands]);
|
|
539072
|
-
const [showCommands, setShowCommands] = (0,
|
|
539073
|
-
const [commandSelectedIndex, setCommandSelectedIndex] = (0,
|
|
539074
|
-
const [usageLoaded, setUsageLoaded] = (0,
|
|
539075
|
-
(0,
|
|
538884
|
+
const [showCommands, setShowCommands] = (0, import_react84.useState)(false);
|
|
538885
|
+
const [commandSelectedIndex, setCommandSelectedIndex] = (0, import_react84.useState)(0);
|
|
538886
|
+
const [usageLoaded, setUsageLoaded] = (0, import_react84.useState)(false);
|
|
538887
|
+
(0, import_react84.useEffect)(() => {
|
|
539076
538888
|
let isMounted = true;
|
|
539077
538889
|
commandUsageManager.ensureLoaded().then(() => {
|
|
539078
538890
|
if (isMounted) {
|
|
@@ -539083,7 +538895,7 @@ function useCommandPanel(buffer, isProcessing = false) {
|
|
|
539083
538895
|
isMounted = false;
|
|
539084
538896
|
};
|
|
539085
538897
|
}, []);
|
|
539086
|
-
const getFilteredCommands = (0,
|
|
538898
|
+
const getFilteredCommands = (0, import_react84.useCallback)(() => {
|
|
539087
538899
|
const text3 = buffer.getFullText();
|
|
539088
538900
|
if (!text3.startsWith("/"))
|
|
539089
538901
|
return [];
|
|
@@ -539119,7 +538931,7 @@ function useCommandPanel(buffer, isProcessing = false) {
|
|
|
539119
538931
|
}).map((item) => item.command);
|
|
539120
538932
|
return filtered;
|
|
539121
538933
|
}, [buffer, getAllCommands, usageLoaded]);
|
|
539122
|
-
const updateCommandPanelState = (0,
|
|
538934
|
+
const updateCommandPanelState = (0, import_react84.useCallback)((text3) => {
|
|
539123
538935
|
if (text3.startsWith("/") && text3.length > 0) {
|
|
539124
538936
|
setShowCommands(true);
|
|
539125
538937
|
setCommandSelectedIndex(0);
|
|
@@ -539141,11 +538953,11 @@ function useCommandPanel(buffer, isProcessing = false) {
|
|
|
539141
538953
|
// Export isProcessing for CommandPanel to use
|
|
539142
538954
|
};
|
|
539143
538955
|
}
|
|
539144
|
-
var
|
|
538956
|
+
var import_react84;
|
|
539145
538957
|
var init_useCommandPanel = __esm({
|
|
539146
538958
|
"dist/hooks/ui/useCommandPanel.js"() {
|
|
539147
538959
|
"use strict";
|
|
539148
|
-
|
|
538960
|
+
import_react84 = __toESM(require_react(), 1);
|
|
539149
538961
|
init_i18n();
|
|
539150
538962
|
init_custom();
|
|
539151
538963
|
init_commandUsageManager();
|
|
@@ -539195,7 +539007,7 @@ function filePickerReducer(state, action) {
|
|
|
539195
539007
|
}
|
|
539196
539008
|
}
|
|
539197
539009
|
function useFilePicker(buffer, triggerUpdate) {
|
|
539198
|
-
const [state, dispatch] = (0,
|
|
539010
|
+
const [state, dispatch] = (0, import_react85.useReducer)(filePickerReducer, {
|
|
539199
539011
|
showFilePicker: false,
|
|
539200
539012
|
fileSelectedIndex: 0,
|
|
539201
539013
|
fileQuery: "",
|
|
@@ -539203,8 +539015,8 @@ function useFilePicker(buffer, triggerUpdate) {
|
|
|
539203
539015
|
filteredFileCount: 0,
|
|
539204
539016
|
searchMode: "file"
|
|
539205
539017
|
});
|
|
539206
|
-
const fileListRef = (0,
|
|
539207
|
-
const updateFilePickerState = (0,
|
|
539018
|
+
const fileListRef = (0, import_react85.useRef)(null);
|
|
539019
|
+
const updateFilePickerState = (0, import_react85.useCallback)((_text, cursorPos) => {
|
|
539208
539020
|
const displayText = buffer.text;
|
|
539209
539021
|
if (!displayText.includes("@")) {
|
|
539210
539022
|
if (state.showFilePicker) {
|
|
@@ -539271,7 +539083,7 @@ function useFilePicker(buffer, triggerUpdate) {
|
|
|
539271
539083
|
state.atSymbolPosition,
|
|
539272
539084
|
state.searchMode
|
|
539273
539085
|
]);
|
|
539274
|
-
const handleFileSelect = (0,
|
|
539086
|
+
const handleFileSelect = (0, import_react85.useCallback)(async (filePath) => {
|
|
539275
539087
|
if (state.atSymbolPosition !== -1) {
|
|
539276
539088
|
const displayText = buffer.text;
|
|
539277
539089
|
const cursorPos = buffer.getCursorPosition();
|
|
@@ -539291,10 +539103,10 @@ function useFilePicker(buffer, triggerUpdate) {
|
|
|
539291
539103
|
triggerUpdate();
|
|
539292
539104
|
}
|
|
539293
539105
|
}, [state.atSymbolPosition, state.searchMode, buffer, triggerUpdate]);
|
|
539294
|
-
const handleFilteredCountChange = (0,
|
|
539106
|
+
const handleFilteredCountChange = (0, import_react85.useCallback)((count) => {
|
|
539295
539107
|
dispatch({ type: "SET_FILTERED_COUNT", count });
|
|
539296
539108
|
}, []);
|
|
539297
|
-
const setShowFilePicker = (0,
|
|
539109
|
+
const setShowFilePicker = (0, import_react85.useCallback)((show) => {
|
|
539298
539110
|
if (show) {
|
|
539299
539111
|
dispatch({
|
|
539300
539112
|
type: "SHOW",
|
|
@@ -539306,7 +539118,7 @@ function useFilePicker(buffer, triggerUpdate) {
|
|
|
539306
539118
|
dispatch({ type: "HIDE" });
|
|
539307
539119
|
}
|
|
539308
539120
|
}, []);
|
|
539309
|
-
const setFileSelectedIndex = (0,
|
|
539121
|
+
const setFileSelectedIndex = (0, import_react85.useCallback)((index) => {
|
|
539310
539122
|
if (typeof index === "function") {
|
|
539311
539123
|
dispatch({
|
|
539312
539124
|
type: "SET_SELECTED_INDEX",
|
|
@@ -539335,11 +539147,11 @@ function useFilePicker(buffer, triggerUpdate) {
|
|
|
539335
539147
|
fileListRef
|
|
539336
539148
|
};
|
|
539337
539149
|
}
|
|
539338
|
-
var
|
|
539150
|
+
var import_react85;
|
|
539339
539151
|
var init_useFilePicker = __esm({
|
|
539340
539152
|
"dist/hooks/picker/useFilePicker.js"() {
|
|
539341
539153
|
"use strict";
|
|
539342
|
-
|
|
539154
|
+
import_react85 = __toESM(require_react(), 1);
|
|
539343
539155
|
}
|
|
539344
539156
|
});
|
|
539345
539157
|
|
|
@@ -539725,30 +539537,30 @@ var init_historyManager = __esm({
|
|
|
539725
539537
|
|
|
539726
539538
|
// dist/hooks/input/useHistoryNavigation.js
|
|
539727
539539
|
function useHistoryNavigation(buffer, triggerUpdate, chatHistory, onHistorySelect) {
|
|
539728
|
-
const [showHistoryMenu, setShowHistoryMenu] = (0,
|
|
539729
|
-
const [historySelectedIndex, setHistorySelectedIndex] = (0,
|
|
539730
|
-
const [escapeKeyCount, setEscapeKeyCount] = (0,
|
|
539731
|
-
const escapeKeyTimer = (0,
|
|
539732
|
-
const [currentHistoryIndex, setCurrentHistoryIndex] = (0,
|
|
539733
|
-
const savedInput = (0,
|
|
539734
|
-
const [persistentHistory, setPersistentHistory] = (0,
|
|
539735
|
-
const persistentHistoryRef = (0,
|
|
539736
|
-
(0,
|
|
539540
|
+
const [showHistoryMenu, setShowHistoryMenu] = (0, import_react86.useState)(false);
|
|
539541
|
+
const [historySelectedIndex, setHistorySelectedIndex] = (0, import_react86.useState)(0);
|
|
539542
|
+
const [escapeKeyCount, setEscapeKeyCount] = (0, import_react86.useState)(0);
|
|
539543
|
+
const escapeKeyTimer = (0, import_react86.useRef)(null);
|
|
539544
|
+
const [currentHistoryIndex, setCurrentHistoryIndex] = (0, import_react86.useState)(-1);
|
|
539545
|
+
const savedInput = (0, import_react86.useRef)("");
|
|
539546
|
+
const [persistentHistory, setPersistentHistory] = (0, import_react86.useState)([]);
|
|
539547
|
+
const persistentHistoryRef = (0, import_react86.useRef)([]);
|
|
539548
|
+
(0, import_react86.useEffect)(() => {
|
|
539737
539549
|
persistentHistoryRef.current = persistentHistory;
|
|
539738
539550
|
}, [persistentHistory]);
|
|
539739
|
-
(0,
|
|
539551
|
+
(0, import_react86.useEffect)(() => {
|
|
539740
539552
|
historyManager.getEntries().then((entries) => {
|
|
539741
539553
|
setPersistentHistory(entries);
|
|
539742
539554
|
});
|
|
539743
539555
|
}, []);
|
|
539744
|
-
(0,
|
|
539556
|
+
(0, import_react86.useEffect)(() => {
|
|
539745
539557
|
return () => {
|
|
539746
539558
|
if (escapeKeyTimer.current) {
|
|
539747
539559
|
clearTimeout(escapeKeyTimer.current);
|
|
539748
539560
|
}
|
|
539749
539561
|
};
|
|
539750
539562
|
}, []);
|
|
539751
|
-
const getUserMessages = (0,
|
|
539563
|
+
const getUserMessages = (0, import_react86.useCallback)(() => {
|
|
539752
539564
|
const userMessages = chatHistory.map((msg, index) => ({ ...msg, originalIndex: index })).filter((msg) => msg.role === "user" && msg.content.trim());
|
|
539753
539565
|
return userMessages.map((msg, index) => {
|
|
539754
539566
|
const cleanedContent = cleanIDEContext(msg.content);
|
|
@@ -539761,7 +539573,7 @@ function useHistoryNavigation(buffer, triggerUpdate, chatHistory, onHistorySelec
|
|
|
539761
539573
|
};
|
|
539762
539574
|
});
|
|
539763
539575
|
}, [chatHistory]);
|
|
539764
|
-
const handleHistorySelect = (0,
|
|
539576
|
+
const handleHistorySelect = (0, import_react86.useCallback)((value) => {
|
|
539765
539577
|
const selectedIndex = parseInt(value, 10);
|
|
539766
539578
|
const selectedMessage = chatHistory[selectedIndex];
|
|
539767
539579
|
if (selectedMessage && onHistorySelect) {
|
|
@@ -539774,7 +539586,7 @@ function useHistoryNavigation(buffer, triggerUpdate, chatHistory, onHistorySelec
|
|
|
539774
539586
|
);
|
|
539775
539587
|
}
|
|
539776
539588
|
}, [chatHistory, onHistorySelect]);
|
|
539777
|
-
const navigateHistoryUp = (0,
|
|
539589
|
+
const navigateHistoryUp = (0, import_react86.useCallback)(() => {
|
|
539778
539590
|
const history = persistentHistoryRef.current;
|
|
539779
539591
|
if (history.length === 0)
|
|
539780
539592
|
return false;
|
|
@@ -539790,7 +539602,7 @@ function useHistoryNavigation(buffer, triggerUpdate, chatHistory, onHistorySelec
|
|
|
539790
539602
|
}
|
|
539791
539603
|
return true;
|
|
539792
539604
|
}, [currentHistoryIndex]);
|
|
539793
|
-
const navigateHistoryDown = (0,
|
|
539605
|
+
const navigateHistoryDown = (0, import_react86.useCallback)(() => {
|
|
539794
539606
|
if (currentHistoryIndex === -1)
|
|
539795
539607
|
return false;
|
|
539796
539608
|
const newIndex = currentHistoryIndex - 1;
|
|
@@ -539809,11 +539621,11 @@ function useHistoryNavigation(buffer, triggerUpdate, chatHistory, onHistorySelec
|
|
|
539809
539621
|
triggerUpdate();
|
|
539810
539622
|
return true;
|
|
539811
539623
|
}, [currentHistoryIndex]);
|
|
539812
|
-
const resetHistoryNavigation = (0,
|
|
539624
|
+
const resetHistoryNavigation = (0, import_react86.useCallback)(() => {
|
|
539813
539625
|
setCurrentHistoryIndex(-1);
|
|
539814
539626
|
savedInput.current = "";
|
|
539815
539627
|
}, []);
|
|
539816
|
-
const saveToHistory = (0,
|
|
539628
|
+
const saveToHistory = (0, import_react86.useCallback)(async (content) => {
|
|
539817
539629
|
await historyManager.addEntry(content);
|
|
539818
539630
|
const entries = await historyManager.getEntries();
|
|
539819
539631
|
setPersistentHistory(entries);
|
|
@@ -539836,11 +539648,11 @@ function useHistoryNavigation(buffer, triggerUpdate, chatHistory, onHistorySelec
|
|
|
539836
539648
|
saveToHistory
|
|
539837
539649
|
};
|
|
539838
539650
|
}
|
|
539839
|
-
var
|
|
539651
|
+
var import_react86;
|
|
539840
539652
|
var init_useHistoryNavigation = __esm({
|
|
539841
539653
|
"dist/hooks/input/useHistoryNavigation.js"() {
|
|
539842
539654
|
"use strict";
|
|
539843
|
-
|
|
539655
|
+
import_react86 = __toESM(require_react(), 1);
|
|
539844
539656
|
init_fileUtils();
|
|
539845
539657
|
init_historyManager();
|
|
539846
539658
|
}
|
|
@@ -539849,7 +539661,7 @@ var init_useHistoryNavigation = __esm({
|
|
|
539849
539661
|
// dist/hooks/input/useClipboard.js
|
|
539850
539662
|
import { execSync as execSync5 } from "child_process";
|
|
539851
539663
|
function useClipboard(buffer, updateCommandPanelState, updateFilePickerState, triggerUpdate) {
|
|
539852
|
-
const pasteFromClipboard = (0,
|
|
539664
|
+
const pasteFromClipboard = (0, import_react87.useCallback)(async () => {
|
|
539853
539665
|
try {
|
|
539854
539666
|
if (process.platform === "win32") {
|
|
539855
539667
|
try {
|
|
@@ -539969,11 +539781,11 @@ end try'`;
|
|
|
539969
539781
|
}, [buffer, updateCommandPanelState, updateFilePickerState, triggerUpdate]);
|
|
539970
539782
|
return { pasteFromClipboard };
|
|
539971
539783
|
}
|
|
539972
|
-
var
|
|
539784
|
+
var import_react87;
|
|
539973
539785
|
var init_useClipboard = __esm({
|
|
539974
539786
|
"dist/hooks/input/useClipboard.js"() {
|
|
539975
539787
|
"use strict";
|
|
539976
|
-
|
|
539788
|
+
import_react87 = __toESM(require_react(), 1);
|
|
539977
539789
|
init_logger();
|
|
539978
539790
|
}
|
|
539979
539791
|
});
|
|
@@ -539983,13 +539795,13 @@ function useKeyboardInput(options3) {
|
|
|
539983
539795
|
const { buffer, disabled, disableKeyboardNavigation = false, triggerUpdate, forceUpdate, yoloMode, setYoloMode, planMode, setPlanMode, vulnerabilityHuntingMode: _vulnerabilityHuntingMode, setVulnerabilityHuntingMode, showCommands, setShowCommands, commandSelectedIndex, setCommandSelectedIndex, getFilteredCommands, updateCommandPanelState, onCommand, showFilePicker, setShowFilePicker, fileSelectedIndex, setFileSelectedIndex, setFileQuery, setAtSymbolPosition, filteredFileCount, updateFilePickerState, handleFileSelect, fileListRef, showHistoryMenu, setShowHistoryMenu, historySelectedIndex, setHistorySelectedIndex, escapeKeyCount, setEscapeKeyCount, escapeKeyTimer, getUserMessages, handleHistorySelect, currentHistoryIndex, navigateHistoryUp, navigateHistoryDown, resetHistoryNavigation, saveToHistory, pasteFromClipboard, onSubmit, ensureFocus, showAgentPicker, setShowAgentPicker, agentSelectedIndex, setAgentSelectedIndex, updateAgentPickerState, getFilteredAgents, handleAgentSelect, showTodoPicker, setShowTodoPicker, todoSelectedIndex, setTodoSelectedIndex, todos, selectedTodos, toggleTodoSelection, confirmTodoSelection, todoSearchQuery, setTodoSearchQuery, showProfilePicker, setShowProfilePicker, profileSelectedIndex, setProfileSelectedIndex, getFilteredProfiles, handleProfileSelect, profileSearchQuery, setProfileSearchQuery, onSwitchProfile } = options3;
|
|
539984
539796
|
void todoSelectedIndex;
|
|
539985
539797
|
void selectedTodos;
|
|
539986
|
-
const inputBuffer = (0,
|
|
539987
|
-
const inputTimer = (0,
|
|
539988
|
-
const isPasting = (0,
|
|
539989
|
-
const inputStartCursorPos = (0,
|
|
539990
|
-
const isProcessingInput = (0,
|
|
539991
|
-
const componentMountTime = (0,
|
|
539992
|
-
(0,
|
|
539798
|
+
const inputBuffer = (0, import_react88.useRef)("");
|
|
539799
|
+
const inputTimer = (0, import_react88.useRef)(null);
|
|
539800
|
+
const isPasting = (0, import_react88.useRef)(false);
|
|
539801
|
+
const inputStartCursorPos = (0, import_react88.useRef)(0);
|
|
539802
|
+
const isProcessingInput = (0, import_react88.useRef)(false);
|
|
539803
|
+
const componentMountTime = (0, import_react88.useRef)(Date.now());
|
|
539804
|
+
(0, import_react88.useEffect)(() => {
|
|
539993
539805
|
return () => {
|
|
539994
539806
|
if (inputTimer.current) {
|
|
539995
539807
|
clearTimeout(inputTimer.current);
|
|
@@ -540668,11 +540480,11 @@ function useKeyboardInput(options3) {
|
|
|
540668
540480
|
}
|
|
540669
540481
|
});
|
|
540670
540482
|
}
|
|
540671
|
-
var
|
|
540483
|
+
var import_react88;
|
|
540672
540484
|
var init_useKeyboardInput = __esm({
|
|
540673
540485
|
async "dist/hooks/input/useKeyboardInput.js"() {
|
|
540674
540486
|
"use strict";
|
|
540675
|
-
|
|
540487
|
+
import_react88 = __toESM(require_react(), 1);
|
|
540676
540488
|
await init_build2();
|
|
540677
540489
|
init_commandExecutor();
|
|
540678
540490
|
init_commandUsageManager();
|
|
@@ -540681,8 +540493,8 @@ var init_useKeyboardInput = __esm({
|
|
|
540681
540493
|
|
|
540682
540494
|
// dist/hooks/ui/useTerminalFocus.js
|
|
540683
540495
|
function useTerminalFocus() {
|
|
540684
|
-
const [hasFocus, setHasFocus] = (0,
|
|
540685
|
-
(0,
|
|
540496
|
+
const [hasFocus, setHasFocus] = (0, import_react89.useState)(true);
|
|
540497
|
+
(0, import_react89.useEffect)(() => {
|
|
540686
540498
|
let syncTimer = null;
|
|
540687
540499
|
const handleData = (data) => {
|
|
540688
540500
|
const str2 = data.toString();
|
|
@@ -540724,29 +540536,29 @@ function useTerminalFocus() {
|
|
|
540724
540536
|
};
|
|
540725
540537
|
return { hasFocus, isFocusEvent, ensureFocus };
|
|
540726
540538
|
}
|
|
540727
|
-
var
|
|
540539
|
+
var import_react89;
|
|
540728
540540
|
var init_useTerminalFocus = __esm({
|
|
540729
540541
|
"dist/hooks/ui/useTerminalFocus.js"() {
|
|
540730
540542
|
"use strict";
|
|
540731
|
-
|
|
540543
|
+
import_react89 = __toESM(require_react(), 1);
|
|
540732
540544
|
}
|
|
540733
540545
|
});
|
|
540734
540546
|
|
|
540735
540547
|
// dist/hooks/picker/useAgentPicker.js
|
|
540736
540548
|
function useAgentPicker(buffer, triggerUpdate) {
|
|
540737
|
-
const [showAgentPicker, setShowAgentPicker] = (0,
|
|
540738
|
-
const [agentSelectedIndex, setAgentSelectedIndex] = (0,
|
|
540739
|
-
const [agents, setAgents] = (0,
|
|
540740
|
-
const [agentQuery, setAgentQuery] = (0,
|
|
540741
|
-
const [hashSymbolPosition, setHashSymbolPosition] = (0,
|
|
540742
|
-
(0,
|
|
540549
|
+
const [showAgentPicker, setShowAgentPicker] = (0, import_react90.useState)(false);
|
|
540550
|
+
const [agentSelectedIndex, setAgentSelectedIndex] = (0, import_react90.useState)(0);
|
|
540551
|
+
const [agents, setAgents] = (0, import_react90.useState)([]);
|
|
540552
|
+
const [agentQuery, setAgentQuery] = (0, import_react90.useState)("");
|
|
540553
|
+
const [hashSymbolPosition, setHashSymbolPosition] = (0, import_react90.useState)(-1);
|
|
540554
|
+
(0, import_react90.useEffect)(() => {
|
|
540743
540555
|
if (showAgentPicker) {
|
|
540744
540556
|
const loadedAgents = getSubAgents();
|
|
540745
540557
|
setAgents(loadedAgents);
|
|
540746
540558
|
setAgentSelectedIndex(0);
|
|
540747
540559
|
}
|
|
540748
540560
|
}, [showAgentPicker]);
|
|
540749
|
-
const updateAgentPickerState = (0,
|
|
540561
|
+
const updateAgentPickerState = (0, import_react90.useCallback)((_text, cursorPos) => {
|
|
540750
540562
|
const displayText = buffer.text;
|
|
540751
540563
|
const beforeCursor = displayText.slice(0, cursorPos);
|
|
540752
540564
|
let position = -1;
|
|
@@ -540783,14 +540595,14 @@ function useAgentPicker(buffer, triggerUpdate) {
|
|
|
540783
540595
|
}
|
|
540784
540596
|
}
|
|
540785
540597
|
}, [buffer, showAgentPicker, agentQuery, hashSymbolPosition]);
|
|
540786
|
-
const getFilteredAgents = (0,
|
|
540598
|
+
const getFilteredAgents = (0, import_react90.useCallback)(() => {
|
|
540787
540599
|
if (!agentQuery) {
|
|
540788
540600
|
return agents;
|
|
540789
540601
|
}
|
|
540790
540602
|
const query = agentQuery.toLowerCase();
|
|
540791
540603
|
return agents.filter((agent) => agent.id.toLowerCase().includes(query) || agent.name.toLowerCase().includes(query) || agent.description.toLowerCase().includes(query));
|
|
540792
540604
|
}, [agents, agentQuery]);
|
|
540793
|
-
const handleAgentSelect = (0,
|
|
540605
|
+
const handleAgentSelect = (0, import_react90.useCallback)((agent) => {
|
|
540794
540606
|
if (hashSymbolPosition !== -1) {
|
|
540795
540607
|
const displayText = buffer.text;
|
|
540796
540608
|
const cursorPos = buffer.getCursorPosition();
|
|
@@ -540828,11 +540640,11 @@ function useAgentPicker(buffer, triggerUpdate) {
|
|
|
540828
540640
|
handleAgentSelect
|
|
540829
540641
|
};
|
|
540830
540642
|
}
|
|
540831
|
-
var
|
|
540643
|
+
var import_react90;
|
|
540832
540644
|
var init_useAgentPicker = __esm({
|
|
540833
540645
|
"dist/hooks/picker/useAgentPicker.js"() {
|
|
540834
540646
|
"use strict";
|
|
540835
|
-
|
|
540647
|
+
import_react90 = __toESM(require_react(), 1);
|
|
540836
540648
|
init_subAgentConfig();
|
|
540837
540649
|
}
|
|
540838
540650
|
});
|
|
@@ -540988,20 +540800,20 @@ var init_todoScanner = __esm({
|
|
|
540988
540800
|
|
|
540989
540801
|
// dist/hooks/picker/useTodoPicker.js
|
|
540990
540802
|
function useTodoPicker(buffer, triggerUpdate, projectRoot) {
|
|
540991
|
-
const [showTodoPicker, setShowTodoPicker] = (0,
|
|
540992
|
-
const [todoSelectedIndex, setTodoSelectedIndex] = (0,
|
|
540993
|
-
const [allTodos, setAllTodos] = (0,
|
|
540994
|
-
const [selectedTodos, setSelectedTodos] = (0,
|
|
540995
|
-
const [isLoading, setIsLoading] = (0,
|
|
540996
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
540997
|
-
const filteredTodos = (0,
|
|
540803
|
+
const [showTodoPicker, setShowTodoPicker] = (0, import_react91.useState)(false);
|
|
540804
|
+
const [todoSelectedIndex, setTodoSelectedIndex] = (0, import_react91.useState)(0);
|
|
540805
|
+
const [allTodos, setAllTodos] = (0, import_react91.useState)([]);
|
|
540806
|
+
const [selectedTodos, setSelectedTodos] = (0, import_react91.useState)(/* @__PURE__ */ new Set());
|
|
540807
|
+
const [isLoading, setIsLoading] = (0, import_react91.useState)(false);
|
|
540808
|
+
const [searchQuery, setSearchQuery] = (0, import_react91.useState)("");
|
|
540809
|
+
const filteredTodos = (0, import_react91.useMemo)(() => {
|
|
540998
540810
|
if (!searchQuery.trim()) {
|
|
540999
540811
|
return allTodos;
|
|
541000
540812
|
}
|
|
541001
540813
|
const query = searchQuery.toLowerCase();
|
|
541002
540814
|
return allTodos.filter((todo) => todo.content.toLowerCase().includes(query) || todo.file.toLowerCase().includes(query));
|
|
541003
540815
|
}, [allTodos, searchQuery]);
|
|
541004
|
-
(0,
|
|
540816
|
+
(0, import_react91.useEffect)(() => {
|
|
541005
540817
|
if (showTodoPicker) {
|
|
541006
540818
|
setIsLoading(true);
|
|
541007
540819
|
setSearchQuery("");
|
|
@@ -541014,7 +540826,7 @@ function useTodoPicker(buffer, triggerUpdate, projectRoot) {
|
|
|
541014
540826
|
}, 0);
|
|
541015
540827
|
}
|
|
541016
540828
|
}, [showTodoPicker, projectRoot]);
|
|
541017
|
-
const toggleTodoSelection = (0,
|
|
540829
|
+
const toggleTodoSelection = (0, import_react91.useCallback)(() => {
|
|
541018
540830
|
if (filteredTodos.length > 0 && todoSelectedIndex < filteredTodos.length) {
|
|
541019
540831
|
const todo = filteredTodos[todoSelectedIndex];
|
|
541020
540832
|
if (todo) {
|
|
@@ -541031,7 +540843,7 @@ function useTodoPicker(buffer, triggerUpdate, projectRoot) {
|
|
|
541031
540843
|
}
|
|
541032
540844
|
}
|
|
541033
540845
|
}, [filteredTodos, todoSelectedIndex, triggerUpdate]);
|
|
541034
|
-
const confirmTodoSelection = (0,
|
|
540846
|
+
const confirmTodoSelection = (0, import_react91.useCallback)(() => {
|
|
541035
540847
|
if (selectedTodos.size === 0) {
|
|
541036
540848
|
setShowTodoPicker(false);
|
|
541037
540849
|
setTodoSelectedIndex(0);
|
|
@@ -541067,24 +540879,24 @@ function useTodoPicker(buffer, triggerUpdate, projectRoot) {
|
|
|
541067
540879
|
totalTodoCount: allTodos.length
|
|
541068
540880
|
};
|
|
541069
540881
|
}
|
|
541070
|
-
var
|
|
540882
|
+
var import_react91;
|
|
541071
540883
|
var init_useTodoPicker = __esm({
|
|
541072
540884
|
"dist/hooks/picker/useTodoPicker.js"() {
|
|
541073
540885
|
"use strict";
|
|
541074
|
-
|
|
540886
|
+
import_react91 = __toESM(require_react(), 1);
|
|
541075
540887
|
init_todoScanner();
|
|
541076
540888
|
}
|
|
541077
540889
|
});
|
|
541078
540890
|
|
|
541079
540891
|
// dist/hooks/input/useBashMode.js
|
|
541080
540892
|
function useBashMode() {
|
|
541081
|
-
const [state, setState] = (0,
|
|
540893
|
+
const [state, setState] = (0, import_react92.useState)({
|
|
541082
540894
|
isExecuting: false,
|
|
541083
540895
|
currentCommand: null,
|
|
541084
540896
|
currentTimeout: null,
|
|
541085
540897
|
executionResults: /* @__PURE__ */ new Map()
|
|
541086
540898
|
});
|
|
541087
|
-
const parseBashCommands = (0,
|
|
540899
|
+
const parseBashCommands = (0, import_react92.useCallback)((message) => {
|
|
541088
540900
|
var _a21;
|
|
541089
540901
|
const commands = [];
|
|
541090
540902
|
const regex2 = /!`([^`]+)`(?:<(\d+)>)?/g;
|
|
@@ -541105,10 +540917,10 @@ function useBashMode() {
|
|
|
541105
540917
|
}
|
|
541106
540918
|
return commands;
|
|
541107
540919
|
}, []);
|
|
541108
|
-
const checkSensitiveCommand = (0,
|
|
540920
|
+
const checkSensitiveCommand = (0, import_react92.useCallback)((command) => {
|
|
541109
540921
|
return isSensitiveCommand(command);
|
|
541110
540922
|
}, []);
|
|
541111
|
-
const executeCommand2 = (0,
|
|
540923
|
+
const executeCommand2 = (0, import_react92.useCallback)(async (command, timeout2 = 3e4) => {
|
|
541112
540924
|
setState((prev) => ({
|
|
541113
540925
|
...prev,
|
|
541114
540926
|
isExecuting: true,
|
|
@@ -541180,7 +540992,7 @@ function useBashMode() {
|
|
|
541180
540992
|
});
|
|
541181
540993
|
});
|
|
541182
540994
|
}, []);
|
|
541183
|
-
const processBashMessage = (0,
|
|
540995
|
+
const processBashMessage = (0, import_react92.useCallback)(async (message, onSensitiveCommand) => {
|
|
541184
540996
|
const commands = parseBashCommands(message);
|
|
541185
540997
|
if (commands.length === 0) {
|
|
541186
540998
|
return {
|
|
@@ -541241,7 +541053,7 @@ ${output2}
|
|
|
541241
541053
|
results
|
|
541242
541054
|
};
|
|
541243
541055
|
}, [parseBashCommands, checkSensitiveCommand, executeCommand2]);
|
|
541244
|
-
const resetState = (0,
|
|
541056
|
+
const resetState = (0, import_react92.useCallback)(() => {
|
|
541245
541057
|
setState({
|
|
541246
541058
|
isExecuting: false,
|
|
541247
541059
|
currentCommand: null,
|
|
@@ -541258,11 +541070,11 @@ ${output2}
|
|
|
541258
541070
|
resetState
|
|
541259
541071
|
};
|
|
541260
541072
|
}
|
|
541261
|
-
var
|
|
541073
|
+
var import_react92;
|
|
541262
541074
|
var init_useBashMode = __esm({
|
|
541263
541075
|
"dist/hooks/input/useBashMode.js"() {
|
|
541264
541076
|
"use strict";
|
|
541265
|
-
|
|
541077
|
+
import_react92 = __toESM(require_react(), 1);
|
|
541266
541078
|
init_sensitiveCommandManager();
|
|
541267
541079
|
}
|
|
541268
541080
|
});
|
|
@@ -541272,21 +541084,21 @@ var CommandPanel_exports = {};
|
|
|
541272
541084
|
__export(CommandPanel_exports, {
|
|
541273
541085
|
default: () => CommandPanel_default
|
|
541274
541086
|
});
|
|
541275
|
-
var
|
|
541087
|
+
var import_react93, CommandPanel, CommandPanel_default;
|
|
541276
541088
|
var init_CommandPanel = __esm({
|
|
541277
541089
|
async "dist/ui/components/panels/CommandPanel.js"() {
|
|
541278
541090
|
"use strict";
|
|
541279
|
-
|
|
541091
|
+
import_react93 = __toESM(require_react(), 1);
|
|
541280
541092
|
await init_build2();
|
|
541281
541093
|
await init_build4();
|
|
541282
541094
|
init_i18n();
|
|
541283
541095
|
init_ThemeContext();
|
|
541284
|
-
CommandPanel = (0,
|
|
541096
|
+
CommandPanel = (0, import_react93.memo)(({ commands, selectedIndex, visible, maxHeight, isProcessing = false }) => {
|
|
541285
541097
|
const { t } = useI18n();
|
|
541286
541098
|
const { theme: theme14 } = useTheme();
|
|
541287
541099
|
const MAX_DISPLAY_ITEMS = 5;
|
|
541288
541100
|
const effectiveMaxItems = maxHeight ? Math.min(maxHeight, MAX_DISPLAY_ITEMS) : MAX_DISPLAY_ITEMS;
|
|
541289
|
-
const displayedCommands = (0,
|
|
541101
|
+
const displayedCommands = (0, import_react93.useMemo)(() => {
|
|
541290
541102
|
if (commands.length <= effectiveMaxItems) {
|
|
541291
541103
|
return commands;
|
|
541292
541104
|
}
|
|
@@ -541298,7 +541110,7 @@ var init_CommandPanel = __esm({
|
|
|
541298
541110
|
}
|
|
541299
541111
|
return commands.slice(startIndex, endIndex);
|
|
541300
541112
|
}, [commands, selectedIndex, effectiveMaxItems]);
|
|
541301
|
-
const displayedSelectedIndex = (0,
|
|
541113
|
+
const displayedSelectedIndex = (0, import_react93.useMemo)(() => {
|
|
541302
541114
|
return displayedCommands.findIndex((cmd) => {
|
|
541303
541115
|
const originalIndex = commands.indexOf(cmd);
|
|
541304
541116
|
return originalIndex === selectedIndex;
|
|
@@ -541308,24 +541120,24 @@ var init_CommandPanel = __esm({
|
|
|
541308
541120
|
return null;
|
|
541309
541121
|
}
|
|
541310
541122
|
if (isProcessing) {
|
|
541311
|
-
return
|
|
541123
|
+
return import_react93.default.createElement(
|
|
541312
541124
|
Box_default,
|
|
541313
541125
|
{ flexDirection: "column" },
|
|
541314
|
-
|
|
541126
|
+
import_react93.default.createElement(
|
|
541315
541127
|
Box_default,
|
|
541316
541128
|
{ width: "100%" },
|
|
541317
|
-
|
|
541129
|
+
import_react93.default.createElement(
|
|
541318
541130
|
Box_default,
|
|
541319
541131
|
{ flexDirection: "column", width: "100%" },
|
|
541320
|
-
|
|
541132
|
+
import_react93.default.createElement(
|
|
541321
541133
|
Box_default,
|
|
541322
541134
|
null,
|
|
541323
|
-
|
|
541135
|
+
import_react93.default.createElement(Text, { color: theme14.colors.warning, bold: true }, t.commandPanel.title)
|
|
541324
541136
|
),
|
|
541325
|
-
|
|
541137
|
+
import_react93.default.createElement(
|
|
541326
541138
|
Box_default,
|
|
541327
541139
|
{ marginTop: 1 },
|
|
541328
|
-
|
|
541140
|
+
import_react93.default.createElement(Alert, { variant: "info" }, t.commandPanel.processingMessage)
|
|
541329
541141
|
)
|
|
541330
541142
|
)
|
|
541331
541143
|
)
|
|
@@ -541334,19 +541146,19 @@ var init_CommandPanel = __esm({
|
|
|
541334
541146
|
if (commands.length === 0) {
|
|
541335
541147
|
return null;
|
|
541336
541148
|
}
|
|
541337
|
-
return
|
|
541149
|
+
return import_react93.default.createElement(
|
|
541338
541150
|
Box_default,
|
|
541339
541151
|
{ flexDirection: "column" },
|
|
541340
|
-
|
|
541152
|
+
import_react93.default.createElement(
|
|
541341
541153
|
Box_default,
|
|
541342
541154
|
{ width: "100%" },
|
|
541343
|
-
|
|
541155
|
+
import_react93.default.createElement(
|
|
541344
541156
|
Box_default,
|
|
541345
541157
|
{ flexDirection: "column", width: "100%" },
|
|
541346
|
-
|
|
541158
|
+
import_react93.default.createElement(
|
|
541347
541159
|
Box_default,
|
|
541348
541160
|
null,
|
|
541349
|
-
|
|
541161
|
+
import_react93.default.createElement(
|
|
541350
541162
|
Text,
|
|
541351
541163
|
{ color: theme14.colors.warning, bold: true },
|
|
541352
541164
|
t.commandPanel.availableCommands,
|
|
@@ -541354,20 +541166,20 @@ var init_CommandPanel = __esm({
|
|
|
541354
541166
|
commands.length > effectiveMaxItems && `(${selectedIndex + 1}/${commands.length})`
|
|
541355
541167
|
)
|
|
541356
541168
|
),
|
|
541357
|
-
displayedCommands.map((command, index) =>
|
|
541169
|
+
displayedCommands.map((command, index) => import_react93.default.createElement(
|
|
541358
541170
|
Box_default,
|
|
541359
541171
|
{ key: command.name, flexDirection: "column", width: "100%" },
|
|
541360
|
-
|
|
541172
|
+
import_react93.default.createElement(
|
|
541361
541173
|
Text,
|
|
541362
541174
|
{ color: index === displayedSelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: true },
|
|
541363
541175
|
index === displayedSelectedIndex ? "\u276F " : " ",
|
|
541364
541176
|
"/",
|
|
541365
541177
|
command.name
|
|
541366
541178
|
),
|
|
541367
|
-
|
|
541179
|
+
import_react93.default.createElement(
|
|
541368
541180
|
Box_default,
|
|
541369
541181
|
{ marginLeft: 3 },
|
|
541370
|
-
|
|
541182
|
+
import_react93.default.createElement(
|
|
541371
541183
|
Text,
|
|
541372
541184
|
{ color: index === displayedSelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, dimColor: true },
|
|
541373
541185
|
"\u2514\u2500 ",
|
|
@@ -541375,10 +541187,10 @@ var init_CommandPanel = __esm({
|
|
|
541375
541187
|
)
|
|
541376
541188
|
)
|
|
541377
541189
|
)),
|
|
541378
|
-
commands.length > effectiveMaxItems &&
|
|
541190
|
+
commands.length > effectiveMaxItems && import_react93.default.createElement(
|
|
541379
541191
|
Box_default,
|
|
541380
541192
|
{ marginTop: 1 },
|
|
541381
|
-
|
|
541193
|
+
import_react93.default.createElement(
|
|
541382
541194
|
Text,
|
|
541383
541195
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
541384
541196
|
t.commandPanel.scrollHint,
|
|
@@ -541403,28 +541215,28 @@ __export(FileList_exports, {
|
|
|
541403
541215
|
});
|
|
541404
541216
|
import fs35 from "fs";
|
|
541405
541217
|
import path47 from "path";
|
|
541406
|
-
var
|
|
541218
|
+
var import_react94, FileList, FileList_default;
|
|
541407
541219
|
var init_FileList = __esm({
|
|
541408
541220
|
async "dist/ui/components/tools/FileList.js"() {
|
|
541409
541221
|
"use strict";
|
|
541410
|
-
|
|
541222
|
+
import_react94 = __toESM(require_react(), 1);
|
|
541411
541223
|
await init_build2();
|
|
541412
541224
|
init_useTerminalSize();
|
|
541413
541225
|
init_ThemeContext();
|
|
541414
541226
|
init_workingDirConfig();
|
|
541415
|
-
FileList = (0,
|
|
541227
|
+
FileList = (0, import_react94.memo)((0, import_react94.forwardRef)(({ query, selectedIndex, visible, maxItems = 10, rootPath = process.cwd(), onFilteredCountChange, searchMode = "file" }, ref) => {
|
|
541416
541228
|
const { theme: theme14 } = useTheme();
|
|
541417
|
-
const [files, setFiles] = (0,
|
|
541418
|
-
const [isLoading, setIsLoading] = (0,
|
|
541419
|
-
const [searchDepth, setSearchDepth] = (0,
|
|
541420
|
-
const [isIncreasingDepth, setIsIncreasingDepth] = (0,
|
|
541421
|
-
const [hasMoreDepth, setHasMoreDepth] = (0,
|
|
541229
|
+
const [files, setFiles] = (0, import_react94.useState)([]);
|
|
541230
|
+
const [isLoading, setIsLoading] = (0, import_react94.useState)(false);
|
|
541231
|
+
const [searchDepth, setSearchDepth] = (0, import_react94.useState)(5);
|
|
541232
|
+
const [isIncreasingDepth, setIsIncreasingDepth] = (0, import_react94.useState)(false);
|
|
541233
|
+
const [hasMoreDepth, setHasMoreDepth] = (0, import_react94.useState)(true);
|
|
541422
541234
|
const { columns: terminalWidth } = useTerminalSize();
|
|
541423
541235
|
const MAX_DISPLAY_ITEMS = 5;
|
|
541424
|
-
const effectiveMaxItems = (0,
|
|
541236
|
+
const effectiveMaxItems = (0, import_react94.useMemo)(() => {
|
|
541425
541237
|
return maxItems ? Math.min(maxItems, MAX_DISPLAY_ITEMS) : MAX_DISPLAY_ITEMS;
|
|
541426
541238
|
}, [maxItems]);
|
|
541427
|
-
const loadFiles = (0,
|
|
541239
|
+
const loadFiles = (0, import_react94.useCallback)(async () => {
|
|
541428
541240
|
const MAX_FILES = 3e3;
|
|
541429
541241
|
const workingDirs = await getWorkingDirectories();
|
|
541430
541242
|
const allFiles = [];
|
|
@@ -541527,7 +541339,7 @@ var init_FileList = __esm({
|
|
|
541527
541339
|
setHasMoreDepth(hitDepthLimit);
|
|
541528
541340
|
setIsLoading(false);
|
|
541529
541341
|
}, [searchDepth]);
|
|
541530
|
-
const searchFileContent = (0,
|
|
541342
|
+
const searchFileContent = (0, import_react94.useCallback)(async (query2) => {
|
|
541531
541343
|
if (!query2.trim()) {
|
|
541532
541344
|
return [];
|
|
541533
541345
|
}
|
|
@@ -541633,14 +541445,14 @@ var init_FileList = __esm({
|
|
|
541633
541445
|
}
|
|
541634
541446
|
return results;
|
|
541635
541447
|
}, [files, rootPath, terminalWidth]);
|
|
541636
|
-
(0,
|
|
541448
|
+
(0, import_react94.useEffect)(() => {
|
|
541637
541449
|
if (!visible) {
|
|
541638
541450
|
return;
|
|
541639
541451
|
}
|
|
541640
541452
|
loadFiles();
|
|
541641
541453
|
}, [visible, rootPath, loadFiles]);
|
|
541642
|
-
const [allFilteredFiles, setAllFilteredFiles] = (0,
|
|
541643
|
-
(0,
|
|
541454
|
+
const [allFilteredFiles, setAllFilteredFiles] = (0, import_react94.useState)([]);
|
|
541455
|
+
(0, import_react94.useEffect)(() => {
|
|
541644
541456
|
const performSearch = async () => {
|
|
541645
541457
|
if (!query.trim()) {
|
|
541646
541458
|
setAllFilteredFiles(files);
|
|
@@ -541690,7 +541502,7 @@ var init_FileList = __esm({
|
|
|
541690
541502
|
loadFiles,
|
|
541691
541503
|
hasMoreDepth
|
|
541692
541504
|
]);
|
|
541693
|
-
const filteredFiles = (0,
|
|
541505
|
+
const filteredFiles = (0, import_react94.useMemo)(() => {
|
|
541694
541506
|
if (allFilteredFiles.length <= effectiveMaxItems) {
|
|
541695
541507
|
return allFilteredFiles;
|
|
541696
541508
|
}
|
|
@@ -541702,12 +541514,12 @@ var init_FileList = __esm({
|
|
|
541702
541514
|
}
|
|
541703
541515
|
return allFilteredFiles.slice(startIndex, endIndex);
|
|
541704
541516
|
}, [allFilteredFiles, selectedIndex, effectiveMaxItems]);
|
|
541705
|
-
(0,
|
|
541517
|
+
(0, import_react94.useEffect)(() => {
|
|
541706
541518
|
if (onFilteredCountChange) {
|
|
541707
541519
|
onFilteredCountChange(allFilteredFiles.length);
|
|
541708
541520
|
}
|
|
541709
541521
|
}, [allFilteredFiles.length, onFilteredCountChange]);
|
|
541710
|
-
(0,
|
|
541522
|
+
(0, import_react94.useImperativeHandle)(ref, () => ({
|
|
541711
541523
|
getSelectedFile: () => {
|
|
541712
541524
|
if (allFilteredFiles.length > 0 && selectedIndex < allFilteredFiles.length && allFilteredFiles[selectedIndex]) {
|
|
541713
541525
|
const selectedFile = allFilteredFiles[selectedIndex];
|
|
@@ -541721,7 +541533,7 @@ var init_FileList = __esm({
|
|
|
541721
541533
|
return null;
|
|
541722
541534
|
}
|
|
541723
541535
|
}), [allFilteredFiles, selectedIndex, rootPath]);
|
|
541724
|
-
const displaySelectedIndex = (0,
|
|
541536
|
+
const displaySelectedIndex = (0, import_react94.useMemo)(() => {
|
|
541725
541537
|
return filteredFiles.findIndex((file) => {
|
|
541726
541538
|
const originalIndex = allFilteredFiles.indexOf(file);
|
|
541727
541539
|
return originalIndex === selectedIndex;
|
|
@@ -541731,26 +541543,26 @@ var init_FileList = __esm({
|
|
|
541731
541543
|
return null;
|
|
541732
541544
|
}
|
|
541733
541545
|
if (isLoading) {
|
|
541734
|
-
return
|
|
541546
|
+
return import_react94.default.createElement(
|
|
541735
541547
|
Box_default,
|
|
541736
541548
|
{ paddingX: 1, marginTop: 1 },
|
|
541737
|
-
|
|
541549
|
+
import_react94.default.createElement(Text, { color: "blue", dimColor: true }, isIncreasingDepth ? `Searching deeper directories (depth: ${searchDepth})...` : "Loading files...")
|
|
541738
541550
|
);
|
|
541739
541551
|
}
|
|
541740
541552
|
if (filteredFiles.length === 0) {
|
|
541741
|
-
return
|
|
541553
|
+
return import_react94.default.createElement(
|
|
541742
541554
|
Box_default,
|
|
541743
541555
|
{ paddingX: 1, marginTop: 1 },
|
|
541744
|
-
|
|
541556
|
+
import_react94.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, isIncreasingDepth ? "Searching deeper directories..." : "No files found")
|
|
541745
541557
|
);
|
|
541746
541558
|
}
|
|
541747
|
-
return
|
|
541559
|
+
return import_react94.default.createElement(
|
|
541748
541560
|
Box_default,
|
|
541749
541561
|
{ paddingX: 1, marginTop: 1, flexDirection: "column" },
|
|
541750
|
-
|
|
541562
|
+
import_react94.default.createElement(
|
|
541751
541563
|
Box_default,
|
|
541752
541564
|
{ marginBottom: 1 },
|
|
541753
|
-
|
|
541565
|
+
import_react94.default.createElement(
|
|
541754
541566
|
Text,
|
|
541755
541567
|
{ color: "blue", bold: true },
|
|
541756
541568
|
searchMode === "content" ? "\u2261 Content Search" : "\u2261 Files",
|
|
@@ -541758,21 +541570,21 @@ var init_FileList = __esm({
|
|
|
541758
541570
|
allFilteredFiles.length > effectiveMaxItems && `(${selectedIndex + 1}/${allFilteredFiles.length})`
|
|
541759
541571
|
)
|
|
541760
541572
|
),
|
|
541761
|
-
filteredFiles.map((file, index) =>
|
|
541573
|
+
filteredFiles.map((file, index) => import_react94.default.createElement(
|
|
541762
541574
|
Box_default,
|
|
541763
541575
|
{ key: `${file.path}-${file.lineNumber || 0}`, flexDirection: "column" },
|
|
541764
|
-
|
|
541765
|
-
searchMode === "content" && file.lineContent &&
|
|
541576
|
+
import_react94.default.createElement(Text, { backgroundColor: index === displaySelectedIndex ? theme14.colors.menuSelected : void 0, color: index === displaySelectedIndex ? theme14.colors.menuNormal : file.isDirectory ? theme14.colors.warning : "white" }, searchMode === "content" && file.lineNumber !== void 0 ? `${file.path}:${file.lineNumber}` : file.isDirectory ? "\u25C7 " + file.path : "\u25C6 " + file.path),
|
|
541577
|
+
searchMode === "content" && file.lineContent && import_react94.default.createElement(
|
|
541766
541578
|
Text,
|
|
541767
541579
|
{ backgroundColor: index === displaySelectedIndex ? theme14.colors.menuSelected : void 0, color: index === displaySelectedIndex ? theme14.colors.menuSecondary : theme14.colors.menuSecondary, dimColor: true },
|
|
541768
541580
|
" ",
|
|
541769
541581
|
file.lineContent
|
|
541770
541582
|
)
|
|
541771
541583
|
)),
|
|
541772
|
-
allFilteredFiles.length > effectiveMaxItems &&
|
|
541584
|
+
allFilteredFiles.length > effectiveMaxItems && import_react94.default.createElement(
|
|
541773
541585
|
Box_default,
|
|
541774
541586
|
{ marginTop: 1 },
|
|
541775
|
-
|
|
541587
|
+
import_react94.default.createElement(
|
|
541776
541588
|
Text,
|
|
541777
541589
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
541778
541590
|
"\u2191\u2193 to scroll \xB7 ",
|
|
@@ -541793,19 +541605,19 @@ var AgentPickerPanel_exports = {};
|
|
|
541793
541605
|
__export(AgentPickerPanel_exports, {
|
|
541794
541606
|
default: () => AgentPickerPanel_default
|
|
541795
541607
|
});
|
|
541796
|
-
var
|
|
541608
|
+
var import_react95, AgentPickerPanel, AgentPickerPanel_default;
|
|
541797
541609
|
var init_AgentPickerPanel = __esm({
|
|
541798
541610
|
async "dist/ui/components/panels/AgentPickerPanel.js"() {
|
|
541799
541611
|
"use strict";
|
|
541800
|
-
|
|
541612
|
+
import_react95 = __toESM(require_react(), 1);
|
|
541801
541613
|
await init_build2();
|
|
541802
541614
|
await init_build4();
|
|
541803
541615
|
init_ThemeContext();
|
|
541804
|
-
AgentPickerPanel = (0,
|
|
541616
|
+
AgentPickerPanel = (0, import_react95.memo)(({ agents, selectedIndex, visible, maxHeight }) => {
|
|
541805
541617
|
const { theme: theme14 } = useTheme();
|
|
541806
541618
|
const MAX_DISPLAY_ITEMS = 5;
|
|
541807
541619
|
const effectiveMaxItems = maxHeight ? Math.min(maxHeight, MAX_DISPLAY_ITEMS) : MAX_DISPLAY_ITEMS;
|
|
541808
|
-
const displayedAgents = (0,
|
|
541620
|
+
const displayedAgents = (0, import_react95.useMemo)(() => {
|
|
541809
541621
|
if (agents.length <= effectiveMaxItems) {
|
|
541810
541622
|
return agents;
|
|
541811
541623
|
}
|
|
@@ -541817,7 +541629,7 @@ var init_AgentPickerPanel = __esm({
|
|
|
541817
541629
|
}
|
|
541818
541630
|
return agents.slice(startIndex, endIndex);
|
|
541819
541631
|
}, [agents, selectedIndex, effectiveMaxItems]);
|
|
541820
|
-
const displayedSelectedIndex = (0,
|
|
541632
|
+
const displayedSelectedIndex = (0, import_react95.useMemo)(() => {
|
|
541821
541633
|
return displayedAgents.findIndex((agent) => {
|
|
541822
541634
|
const originalIndex = agents.indexOf(agent);
|
|
541823
541635
|
return originalIndex === selectedIndex;
|
|
@@ -541827,64 +541639,64 @@ var init_AgentPickerPanel = __esm({
|
|
|
541827
541639
|
return null;
|
|
541828
541640
|
}
|
|
541829
541641
|
if (agents.length === 0) {
|
|
541830
|
-
return
|
|
541642
|
+
return import_react95.default.createElement(
|
|
541831
541643
|
Box_default,
|
|
541832
541644
|
{ flexDirection: "column" },
|
|
541833
|
-
|
|
541645
|
+
import_react95.default.createElement(
|
|
541834
541646
|
Box_default,
|
|
541835
541647
|
{ width: "100%" },
|
|
541836
|
-
|
|
541648
|
+
import_react95.default.createElement(
|
|
541837
541649
|
Box_default,
|
|
541838
541650
|
{ flexDirection: "column", width: "100%" },
|
|
541839
|
-
|
|
541651
|
+
import_react95.default.createElement(
|
|
541840
541652
|
Box_default,
|
|
541841
541653
|
null,
|
|
541842
|
-
|
|
541654
|
+
import_react95.default.createElement(Text, { color: theme14.colors.warning, bold: true }, "Sub-Agent Selection")
|
|
541843
541655
|
),
|
|
541844
|
-
|
|
541656
|
+
import_react95.default.createElement(
|
|
541845
541657
|
Box_default,
|
|
541846
541658
|
{ marginTop: 1 },
|
|
541847
|
-
|
|
541659
|
+
import_react95.default.createElement(Alert, { variant: "warning" }, "No sub-agents configured. Please configure sub-agents first.")
|
|
541848
541660
|
)
|
|
541849
541661
|
)
|
|
541850
541662
|
)
|
|
541851
541663
|
);
|
|
541852
541664
|
}
|
|
541853
|
-
return
|
|
541665
|
+
return import_react95.default.createElement(
|
|
541854
541666
|
Box_default,
|
|
541855
541667
|
{ flexDirection: "column" },
|
|
541856
|
-
|
|
541668
|
+
import_react95.default.createElement(
|
|
541857
541669
|
Box_default,
|
|
541858
541670
|
{ width: "100%" },
|
|
541859
|
-
|
|
541671
|
+
import_react95.default.createElement(
|
|
541860
541672
|
Box_default,
|
|
541861
541673
|
{ flexDirection: "column", width: "100%" },
|
|
541862
|
-
|
|
541674
|
+
import_react95.default.createElement(
|
|
541863
541675
|
Box_default,
|
|
541864
541676
|
null,
|
|
541865
|
-
|
|
541677
|
+
import_react95.default.createElement(
|
|
541866
541678
|
Text,
|
|
541867
541679
|
{ color: theme14.colors.warning, bold: true },
|
|
541868
541680
|
"Select Sub-Agent",
|
|
541869
541681
|
" ",
|
|
541870
541682
|
agents.length > effectiveMaxItems && `(${selectedIndex + 1}/${agents.length})`
|
|
541871
541683
|
),
|
|
541872
|
-
|
|
541684
|
+
import_react95.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, "(Press ESC to close)")
|
|
541873
541685
|
),
|
|
541874
|
-
displayedAgents.map((agent, index) =>
|
|
541686
|
+
displayedAgents.map((agent, index) => import_react95.default.createElement(
|
|
541875
541687
|
Box_default,
|
|
541876
541688
|
{ key: agent.id, flexDirection: "column", width: "100%" },
|
|
541877
|
-
|
|
541689
|
+
import_react95.default.createElement(
|
|
541878
541690
|
Text,
|
|
541879
541691
|
{ color: index === displayedSelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: true },
|
|
541880
541692
|
index === displayedSelectedIndex ? "\u276F " : " ",
|
|
541881
541693
|
"#",
|
|
541882
541694
|
agent.name
|
|
541883
541695
|
),
|
|
541884
|
-
|
|
541696
|
+
import_react95.default.createElement(
|
|
541885
541697
|
Box_default,
|
|
541886
541698
|
{ marginLeft: 3 },
|
|
541887
|
-
|
|
541699
|
+
import_react95.default.createElement(
|
|
541888
541700
|
Text,
|
|
541889
541701
|
{ color: index === displayedSelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, dimColor: true },
|
|
541890
541702
|
"\u2514\u2500 ",
|
|
@@ -541892,10 +541704,10 @@ var init_AgentPickerPanel = __esm({
|
|
|
541892
541704
|
)
|
|
541893
541705
|
)
|
|
541894
541706
|
)),
|
|
541895
|
-
agents.length > effectiveMaxItems &&
|
|
541707
|
+
agents.length > effectiveMaxItems && import_react95.default.createElement(
|
|
541896
541708
|
Box_default,
|
|
541897
541709
|
{ marginTop: 1 },
|
|
541898
|
-
|
|
541710
|
+
import_react95.default.createElement(
|
|
541899
541711
|
Text,
|
|
541900
541712
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
541901
541713
|
"\u2191\u2193 to scroll \xB7 ",
|
|
@@ -541917,19 +541729,19 @@ var TodoPickerPanel_exports = {};
|
|
|
541917
541729
|
__export(TodoPickerPanel_exports, {
|
|
541918
541730
|
default: () => TodoPickerPanel_default
|
|
541919
541731
|
});
|
|
541920
|
-
var
|
|
541732
|
+
var import_react96, TodoPickerPanel, TodoPickerPanel_default;
|
|
541921
541733
|
var init_TodoPickerPanel = __esm({
|
|
541922
541734
|
async "dist/ui/components/panels/TodoPickerPanel.js"() {
|
|
541923
541735
|
"use strict";
|
|
541924
|
-
|
|
541736
|
+
import_react96 = __toESM(require_react(), 1);
|
|
541925
541737
|
await init_build2();
|
|
541926
541738
|
await init_build4();
|
|
541927
541739
|
init_ThemeContext();
|
|
541928
|
-
TodoPickerPanel = (0,
|
|
541740
|
+
TodoPickerPanel = (0, import_react96.memo)(({ todos, selectedIndex, selectedTodos, visible, maxHeight, isLoading = false, searchQuery = "", totalCount = 0 }) => {
|
|
541929
541741
|
const { theme: theme14 } = useTheme();
|
|
541930
541742
|
const MAX_DISPLAY_ITEMS = 5;
|
|
541931
541743
|
const effectiveMaxItems = maxHeight ? Math.min(maxHeight, MAX_DISPLAY_ITEMS) : MAX_DISPLAY_ITEMS;
|
|
541932
|
-
const displayedTodos = (0,
|
|
541744
|
+
const displayedTodos = (0, import_react96.useMemo)(() => {
|
|
541933
541745
|
if (todos.length <= effectiveMaxItems) {
|
|
541934
541746
|
return todos;
|
|
541935
541747
|
}
|
|
@@ -541941,7 +541753,7 @@ var init_TodoPickerPanel = __esm({
|
|
|
541941
541753
|
}
|
|
541942
541754
|
return todos.slice(startIndex, endIndex);
|
|
541943
541755
|
}, [todos, selectedIndex, effectiveMaxItems]);
|
|
541944
|
-
const displayedSelectedIndex = (0,
|
|
541756
|
+
const displayedSelectedIndex = (0, import_react96.useMemo)(() => {
|
|
541945
541757
|
return displayedTodos.findIndex((todo) => {
|
|
541946
541758
|
const originalIndex = todos.indexOf(todo);
|
|
541947
541759
|
return originalIndex === selectedIndex;
|
|
@@ -541951,72 +541763,72 @@ var init_TodoPickerPanel = __esm({
|
|
|
541951
541763
|
return null;
|
|
541952
541764
|
}
|
|
541953
541765
|
if (isLoading) {
|
|
541954
|
-
return
|
|
541766
|
+
return import_react96.default.createElement(
|
|
541955
541767
|
Box_default,
|
|
541956
541768
|
{ flexDirection: "column" },
|
|
541957
|
-
|
|
541769
|
+
import_react96.default.createElement(
|
|
541958
541770
|
Box_default,
|
|
541959
541771
|
{ width: "100%" },
|
|
541960
|
-
|
|
541772
|
+
import_react96.default.createElement(
|
|
541961
541773
|
Box_default,
|
|
541962
541774
|
{ flexDirection: "column", width: "100%" },
|
|
541963
|
-
|
|
541775
|
+
import_react96.default.createElement(
|
|
541964
541776
|
Box_default,
|
|
541965
541777
|
null,
|
|
541966
|
-
|
|
541778
|
+
import_react96.default.createElement(Text, { color: theme14.colors.warning, bold: true }, "TODO Selection")
|
|
541967
541779
|
),
|
|
541968
|
-
|
|
541780
|
+
import_react96.default.createElement(
|
|
541969
541781
|
Box_default,
|
|
541970
541782
|
{ marginTop: 1 },
|
|
541971
|
-
|
|
541783
|
+
import_react96.default.createElement(Alert, { variant: "info" }, "Scanning project for TODO comments...")
|
|
541972
541784
|
)
|
|
541973
541785
|
)
|
|
541974
541786
|
)
|
|
541975
541787
|
);
|
|
541976
541788
|
}
|
|
541977
541789
|
if (todos.length === 0 && !searchQuery) {
|
|
541978
|
-
return
|
|
541790
|
+
return import_react96.default.createElement(
|
|
541979
541791
|
Box_default,
|
|
541980
541792
|
{ flexDirection: "column" },
|
|
541981
|
-
|
|
541793
|
+
import_react96.default.createElement(
|
|
541982
541794
|
Box_default,
|
|
541983
541795
|
{ width: "100%" },
|
|
541984
|
-
|
|
541796
|
+
import_react96.default.createElement(
|
|
541985
541797
|
Box_default,
|
|
541986
541798
|
{ flexDirection: "column", width: "100%" },
|
|
541987
|
-
|
|
541799
|
+
import_react96.default.createElement(
|
|
541988
541800
|
Box_default,
|
|
541989
541801
|
null,
|
|
541990
|
-
|
|
541802
|
+
import_react96.default.createElement(Text, { color: theme14.colors.warning, bold: true }, "TODO Selection")
|
|
541991
541803
|
),
|
|
541992
|
-
|
|
541804
|
+
import_react96.default.createElement(
|
|
541993
541805
|
Box_default,
|
|
541994
541806
|
{ marginTop: 1 },
|
|
541995
|
-
|
|
541807
|
+
import_react96.default.createElement(Alert, { variant: "info" }, "No TODO comments found in the project")
|
|
541996
541808
|
)
|
|
541997
541809
|
)
|
|
541998
541810
|
)
|
|
541999
541811
|
);
|
|
542000
541812
|
}
|
|
542001
541813
|
if (todos.length === 0 && searchQuery) {
|
|
542002
|
-
return
|
|
541814
|
+
return import_react96.default.createElement(
|
|
542003
541815
|
Box_default,
|
|
542004
541816
|
{ flexDirection: "column" },
|
|
542005
|
-
|
|
541817
|
+
import_react96.default.createElement(
|
|
542006
541818
|
Box_default,
|
|
542007
541819
|
{ width: "100%" },
|
|
542008
|
-
|
|
541820
|
+
import_react96.default.createElement(
|
|
542009
541821
|
Box_default,
|
|
542010
541822
|
{ flexDirection: "column", width: "100%" },
|
|
542011
|
-
|
|
541823
|
+
import_react96.default.createElement(
|
|
542012
541824
|
Box_default,
|
|
542013
541825
|
null,
|
|
542014
|
-
|
|
541826
|
+
import_react96.default.createElement(Text, { color: theme14.colors.warning, bold: true }, "TODO Selection")
|
|
542015
541827
|
),
|
|
542016
|
-
|
|
541828
|
+
import_react96.default.createElement(
|
|
542017
541829
|
Box_default,
|
|
542018
541830
|
{ marginTop: 1 },
|
|
542019
|
-
|
|
541831
|
+
import_react96.default.createElement(
|
|
542020
541832
|
Alert,
|
|
542021
541833
|
{ variant: "warning" },
|
|
542022
541834
|
'No TODOs match "',
|
|
@@ -542026,28 +541838,28 @@ var init_TodoPickerPanel = __esm({
|
|
|
542026
541838
|
")"
|
|
542027
541839
|
)
|
|
542028
541840
|
),
|
|
542029
|
-
|
|
541841
|
+
import_react96.default.createElement(
|
|
542030
541842
|
Box_default,
|
|
542031
541843
|
{ marginTop: 1 },
|
|
542032
|
-
|
|
541844
|
+
import_react96.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, "Type to filter \xB7 Backspace to clear search")
|
|
542033
541845
|
)
|
|
542034
541846
|
)
|
|
542035
541847
|
)
|
|
542036
541848
|
);
|
|
542037
541849
|
}
|
|
542038
|
-
return
|
|
541850
|
+
return import_react96.default.createElement(
|
|
542039
541851
|
Box_default,
|
|
542040
541852
|
{ flexDirection: "column" },
|
|
542041
|
-
|
|
541853
|
+
import_react96.default.createElement(
|
|
542042
541854
|
Box_default,
|
|
542043
541855
|
{ width: "100%" },
|
|
542044
|
-
|
|
541856
|
+
import_react96.default.createElement(
|
|
542045
541857
|
Box_default,
|
|
542046
541858
|
{ flexDirection: "column", width: "100%" },
|
|
542047
|
-
|
|
541859
|
+
import_react96.default.createElement(
|
|
542048
541860
|
Box_default,
|
|
542049
541861
|
null,
|
|
542050
|
-
|
|
541862
|
+
import_react96.default.createElement(
|
|
542051
541863
|
Text,
|
|
542052
541864
|
{ color: theme14.colors.warning, bold: true },
|
|
542053
541865
|
"Select TODOs",
|
|
@@ -542057,18 +541869,18 @@ var init_TodoPickerPanel = __esm({
|
|
|
542057
541869
|
searchQuery && totalCount > todos.length && ` (${todos.length}/${totalCount})`
|
|
542058
541870
|
)
|
|
542059
541871
|
),
|
|
542060
|
-
|
|
541872
|
+
import_react96.default.createElement(
|
|
542061
541873
|
Box_default,
|
|
542062
541874
|
{ marginTop: 1 },
|
|
542063
|
-
|
|
541875
|
+
import_react96.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, searchQuery ? "Type to filter \xB7 Backspace to clear \xB7 Space: toggle \xB7 Enter: confirm" : "Type to search \xB7 Space: toggle \xB7 Enter: confirm \xB7 Esc: cancel")
|
|
542064
541876
|
),
|
|
542065
541877
|
displayedTodos.map((todo, index) => {
|
|
542066
541878
|
const isSelected = index === displayedSelectedIndex;
|
|
542067
541879
|
const isChecked = selectedTodos.has(todo.id);
|
|
542068
|
-
return
|
|
541880
|
+
return import_react96.default.createElement(
|
|
542069
541881
|
Box_default,
|
|
542070
541882
|
{ key: todo.id, flexDirection: "column", width: "100%" },
|
|
542071
|
-
|
|
541883
|
+
import_react96.default.createElement(
|
|
542072
541884
|
Text,
|
|
542073
541885
|
{ color: isSelected ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: true },
|
|
542074
541886
|
isSelected ? "\u276F " : " ",
|
|
@@ -542078,10 +541890,10 @@ var init_TodoPickerPanel = __esm({
|
|
|
542078
541890
|
":",
|
|
542079
541891
|
todo.line
|
|
542080
541892
|
),
|
|
542081
|
-
|
|
541893
|
+
import_react96.default.createElement(
|
|
542082
541894
|
Box_default,
|
|
542083
541895
|
{ marginLeft: 5 },
|
|
542084
|
-
|
|
541896
|
+
import_react96.default.createElement(
|
|
542085
541897
|
Text,
|
|
542086
541898
|
{ color: isSelected ? theme14.colors.menuSelected : theme14.colors.menuNormal, dimColor: !isSelected },
|
|
542087
541899
|
"\u2514\u2500 ",
|
|
@@ -542090,10 +541902,10 @@ var init_TodoPickerPanel = __esm({
|
|
|
542090
541902
|
)
|
|
542091
541903
|
);
|
|
542092
541904
|
}),
|
|
542093
|
-
todos.length > effectiveMaxItems &&
|
|
541905
|
+
todos.length > effectiveMaxItems && import_react96.default.createElement(
|
|
542094
541906
|
Box_default,
|
|
542095
541907
|
{ marginTop: 1 },
|
|
542096
|
-
|
|
541908
|
+
import_react96.default.createElement(
|
|
542097
541909
|
Text,
|
|
542098
541910
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
542099
541911
|
"\u2191\u2193 to scroll \xB7 ",
|
|
@@ -542101,10 +541913,10 @@ var init_TodoPickerPanel = __esm({
|
|
|
542101
541913
|
" more hidden"
|
|
542102
541914
|
)
|
|
542103
541915
|
),
|
|
542104
|
-
selectedTodos.size > 0 &&
|
|
541916
|
+
selectedTodos.size > 0 && import_react96.default.createElement(
|
|
542105
541917
|
Box_default,
|
|
542106
541918
|
{ marginTop: 1 },
|
|
542107
|
-
|
|
541919
|
+
import_react96.default.createElement(
|
|
542108
541920
|
Text,
|
|
542109
541921
|
{ color: theme14.colors.menuInfo },
|
|
542110
541922
|
selectedTodos.size,
|
|
@@ -542125,20 +541937,20 @@ var ProfilePanel_exports = {};
|
|
|
542125
541937
|
__export(ProfilePanel_exports, {
|
|
542126
541938
|
default: () => ProfilePanel_default
|
|
542127
541939
|
});
|
|
542128
|
-
var
|
|
541940
|
+
var import_react97, ProfilePanel, ProfilePanel_default;
|
|
542129
541941
|
var init_ProfilePanel = __esm({
|
|
542130
541942
|
async "dist/ui/components/panels/ProfilePanel.js"() {
|
|
542131
541943
|
"use strict";
|
|
542132
|
-
|
|
541944
|
+
import_react97 = __toESM(require_react(), 1);
|
|
542133
541945
|
await init_build2();
|
|
542134
541946
|
init_i18n();
|
|
542135
541947
|
init_ThemeContext();
|
|
542136
|
-
ProfilePanel = (0,
|
|
541948
|
+
ProfilePanel = (0, import_react97.memo)(({ profiles, selectedIndex, visible, maxHeight, searchQuery }) => {
|
|
542137
541949
|
const { t } = useI18n();
|
|
542138
541950
|
const { theme: theme14 } = useTheme();
|
|
542139
541951
|
const MAX_DISPLAY_ITEMS = 5;
|
|
542140
541952
|
const effectiveMaxItems = maxHeight ? Math.min(maxHeight, MAX_DISPLAY_ITEMS) : MAX_DISPLAY_ITEMS;
|
|
542141
|
-
const displayedProfiles = (0,
|
|
541953
|
+
const displayedProfiles = (0, import_react97.useMemo)(() => {
|
|
542142
541954
|
if (profiles.length <= effectiveMaxItems) {
|
|
542143
541955
|
return profiles;
|
|
542144
541956
|
}
|
|
@@ -542150,7 +541962,7 @@ var init_ProfilePanel = __esm({
|
|
|
542150
541962
|
}
|
|
542151
541963
|
return profiles.slice(startIndex, endIndex);
|
|
542152
541964
|
}, [profiles, selectedIndex, effectiveMaxItems]);
|
|
542153
|
-
const displayedSelectedIndex = (0,
|
|
541965
|
+
const displayedSelectedIndex = (0, import_react97.useMemo)(() => {
|
|
542154
541966
|
return displayedProfiles.findIndex((profile) => {
|
|
542155
541967
|
const originalIndex = profiles.indexOf(profile);
|
|
542156
541968
|
return originalIndex === selectedIndex;
|
|
@@ -542162,19 +541974,19 @@ var init_ProfilePanel = __esm({
|
|
|
542162
541974
|
if (profiles.length === 0) {
|
|
542163
541975
|
return null;
|
|
542164
541976
|
}
|
|
542165
|
-
return
|
|
541977
|
+
return import_react97.default.createElement(
|
|
542166
541978
|
Box_default,
|
|
542167
541979
|
{ flexDirection: "column" },
|
|
542168
|
-
|
|
541980
|
+
import_react97.default.createElement(
|
|
542169
541981
|
Box_default,
|
|
542170
541982
|
{ width: "100%" },
|
|
542171
|
-
|
|
541983
|
+
import_react97.default.createElement(
|
|
542172
541984
|
Box_default,
|
|
542173
541985
|
{ flexDirection: "column", width: "100%" },
|
|
542174
|
-
|
|
541986
|
+
import_react97.default.createElement(
|
|
542175
541987
|
Box_default,
|
|
542176
541988
|
null,
|
|
542177
|
-
|
|
541989
|
+
import_react97.default.createElement(
|
|
542178
541990
|
Text,
|
|
542179
541991
|
{ color: theme14.colors.warning, bold: true },
|
|
542180
541992
|
t.profilePanel.title,
|
|
@@ -542182,21 +541994,21 @@ var init_ProfilePanel = __esm({
|
|
|
542182
541994
|
profiles.length > effectiveMaxItems && `(${selectedIndex + 1}/${profiles.length})`
|
|
542183
541995
|
)
|
|
542184
541996
|
),
|
|
542185
|
-
searchQuery &&
|
|
541997
|
+
searchQuery && import_react97.default.createElement(
|
|
542186
541998
|
Box_default,
|
|
542187
541999
|
{ marginTop: 1 },
|
|
542188
|
-
|
|
542000
|
+
import_react97.default.createElement(
|
|
542189
542001
|
Text,
|
|
542190
542002
|
{ color: theme14.colors.menuInfo },
|
|
542191
542003
|
t.profilePanel.searchLabel,
|
|
542192
542004
|
" ",
|
|
542193
|
-
|
|
542005
|
+
import_react97.default.createElement(Text, { color: theme14.colors.menuSelected }, searchQuery)
|
|
542194
542006
|
)
|
|
542195
542007
|
),
|
|
542196
|
-
displayedProfiles.map((profile, index) =>
|
|
542008
|
+
displayedProfiles.map((profile, index) => import_react97.default.createElement(
|
|
542197
542009
|
Box_default,
|
|
542198
542010
|
{ key: profile.name, flexDirection: "column", width: "100%" },
|
|
542199
|
-
|
|
542011
|
+
import_react97.default.createElement(
|
|
542200
542012
|
Text,
|
|
542201
542013
|
{ color: index === displayedSelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: true },
|
|
542202
542014
|
index === displayedSelectedIndex ? "> " : " ",
|
|
@@ -542204,10 +542016,10 @@ var init_ProfilePanel = __esm({
|
|
|
542204
542016
|
profile.isActive && ` ${t.profilePanel.activeLabel}`
|
|
542205
542017
|
)
|
|
542206
542018
|
)),
|
|
542207
|
-
profiles.length > effectiveMaxItems &&
|
|
542019
|
+
profiles.length > effectiveMaxItems && import_react97.default.createElement(
|
|
542208
542020
|
Box_default,
|
|
542209
542021
|
{ marginTop: 1 },
|
|
542210
|
-
|
|
542022
|
+
import_react97.default.createElement(
|
|
542211
542023
|
Text,
|
|
542212
542024
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
542213
542025
|
t.profilePanel.scrollHint,
|
|
@@ -542216,10 +542028,10 @@ var init_ProfilePanel = __esm({
|
|
|
542216
542028
|
t.profilePanel.moreHidden.replace("{count}", (profiles.length - effectiveMaxItems).toString())
|
|
542217
542029
|
)
|
|
542218
542030
|
),
|
|
542219
|
-
|
|
542031
|
+
import_react97.default.createElement(
|
|
542220
542032
|
Box_default,
|
|
542221
542033
|
{ marginTop: 1 },
|
|
542222
|
-
|
|
542034
|
+
import_react97.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.profilePanel.escHint)
|
|
542223
542035
|
)
|
|
542224
542036
|
)
|
|
542225
542037
|
)
|
|
@@ -542241,17 +542053,17 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542241
542053
|
const { theme: theme14 } = useTheme();
|
|
542242
542054
|
const { parseBashCommands } = useBashMode();
|
|
542243
542055
|
const { columns: terminalWidth } = useTerminalSize();
|
|
542244
|
-
const prevTerminalWidthRef = (0,
|
|
542056
|
+
const prevTerminalWidthRef = (0, import_react98.useRef)(terminalWidth);
|
|
542245
542057
|
const { hasFocus, ensureFocus } = useTerminalFocus();
|
|
542246
542058
|
const uiOverhead = 8;
|
|
542247
542059
|
const viewportWidth = Math.max(40, terminalWidth - uiOverhead);
|
|
542248
|
-
const viewport = (0,
|
|
542060
|
+
const viewport = (0, import_react98.useMemo)(() => ({
|
|
542249
542061
|
width: viewportWidth,
|
|
542250
542062
|
height: 1
|
|
542251
542063
|
}), [viewportWidth]);
|
|
542252
542064
|
const { buffer, triggerUpdate, forceUpdate } = useInputBuffer(viewport);
|
|
542253
|
-
const [isBashMode, setIsBashMode] =
|
|
542254
|
-
const bashModeDebounceTimer = (0,
|
|
542065
|
+
const [isBashMode, setIsBashMode] = import_react98.default.useState(false);
|
|
542066
|
+
const bashModeDebounceTimer = (0, import_react98.useRef)(null);
|
|
542255
542067
|
const { showCommands, setShowCommands, commandSelectedIndex, setCommandSelectedIndex, getFilteredCommands, updateCommandPanelState, isProcessing: commandPanelIsProcessing } = useCommandPanel(buffer, isProcessing);
|
|
542256
542068
|
const { showFilePicker, setShowFilePicker, fileSelectedIndex, setFileSelectedIndex, fileQuery, setFileQuery, atSymbolPosition, setAtSymbolPosition, filteredFileCount, searchMode, updateFilePickerState, handleFileSelect, handleFilteredCountChange, fileListRef } = useFilePicker(buffer, triggerUpdate);
|
|
542257
542069
|
const { showHistoryMenu, setShowHistoryMenu, historySelectedIndex, setHistorySelectedIndex, escapeKeyCount, setEscapeKeyCount, escapeKeyTimer, getUserMessages, handleHistorySelect, currentHistoryIndex, navigateHistoryUp, navigateHistoryDown, resetHistoryNavigation, saveToHistory } = useHistoryNavigation(buffer, triggerUpdate, chatHistory, onHistorySelect);
|
|
@@ -542340,7 +542152,7 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542340
542152
|
}),
|
|
542341
542153
|
onSwitchProfile
|
|
542342
542154
|
});
|
|
542343
|
-
(0,
|
|
542155
|
+
(0, import_react98.useEffect)(() => {
|
|
542344
542156
|
if (initialContent) {
|
|
542345
542157
|
buffer.setText("");
|
|
542346
542158
|
const text3 = initialContent.text;
|
|
@@ -542375,13 +542187,13 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542375
542187
|
triggerUpdate();
|
|
542376
542188
|
}
|
|
542377
542189
|
}, [initialContent]);
|
|
542378
|
-
(0,
|
|
542190
|
+
(0, import_react98.useEffect)(() => {
|
|
542379
542191
|
const timer2 = setTimeout(() => {
|
|
542380
542192
|
forceUpdate();
|
|
542381
542193
|
}, 10);
|
|
542382
542194
|
return () => clearTimeout(timer2);
|
|
542383
542195
|
}, [showFilePicker, forceUpdate]);
|
|
542384
|
-
(0,
|
|
542196
|
+
(0, import_react98.useEffect)(() => {
|
|
542385
542197
|
if (prevTerminalWidthRef.current === terminalWidth) {
|
|
542386
542198
|
prevTerminalWidthRef.current = terminalWidth;
|
|
542387
542199
|
return;
|
|
@@ -542392,8 +542204,8 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542392
542204
|
}, 100);
|
|
542393
542205
|
return () => clearTimeout(timer2);
|
|
542394
542206
|
}, [terminalWidth, forceUpdate]);
|
|
542395
|
-
const lastPercentageRef = (0,
|
|
542396
|
-
(0,
|
|
542207
|
+
const lastPercentageRef = (0, import_react98.useRef)(0);
|
|
542208
|
+
(0, import_react98.useEffect)(() => {
|
|
542397
542209
|
if (contextUsage && onContextPercentageChange) {
|
|
542398
542210
|
const percentage = calculateContextPercentage(contextUsage);
|
|
542399
542211
|
if (percentage !== lastPercentageRef.current) {
|
|
@@ -542402,7 +542214,7 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542402
542214
|
}
|
|
542403
542215
|
}
|
|
542404
542216
|
}, [contextUsage, onContextPercentageChange]);
|
|
542405
|
-
(0,
|
|
542217
|
+
(0, import_react98.useEffect)(() => {
|
|
542406
542218
|
if (bashModeDebounceTimer.current) {
|
|
542407
542219
|
clearTimeout(bashModeDebounceTimer.current);
|
|
542408
542220
|
}
|
|
@@ -542420,11 +542232,11 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542420
542232
|
}
|
|
542421
542233
|
};
|
|
542422
542234
|
}, [buffer.text, parseBashCommands, isBashMode]);
|
|
542423
|
-
const renderCursor = (0,
|
|
542235
|
+
const renderCursor = (0, import_react98.useCallback)((char) => {
|
|
542424
542236
|
if (hasFocus) {
|
|
542425
|
-
return
|
|
542237
|
+
return import_react98.default.createElement(Text, { backgroundColor: theme14.colors.menuNormal, color: theme14.colors.background }, char);
|
|
542426
542238
|
} else {
|
|
542427
|
-
return
|
|
542239
|
+
return import_react98.default.createElement(Text, null, char);
|
|
542428
542240
|
}
|
|
542429
542241
|
}, [hasFocus, theme14]);
|
|
542430
542242
|
const renderContent = () => {
|
|
@@ -542438,34 +542250,34 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542438
542250
|
const beforeCursor = cpSlice(line, 0, cursorCol);
|
|
542439
542251
|
const atCursor = cpSlice(line, cursorCol, cursorCol + 1) || " ";
|
|
542440
542252
|
const afterCursor = cpSlice(line, cursorCol + 1);
|
|
542441
|
-
renderedLines.push(
|
|
542253
|
+
renderedLines.push(import_react98.default.createElement(
|
|
542442
542254
|
Box_default,
|
|
542443
542255
|
{ key: i, flexDirection: "row" },
|
|
542444
|
-
|
|
542256
|
+
import_react98.default.createElement(Text, null, beforeCursor),
|
|
542445
542257
|
renderCursor(atCursor),
|
|
542446
|
-
|
|
542258
|
+
import_react98.default.createElement(Text, null, afterCursor)
|
|
542447
542259
|
));
|
|
542448
542260
|
} else {
|
|
542449
|
-
renderedLines.push(
|
|
542261
|
+
renderedLines.push(import_react98.default.createElement(Text, { key: i }, line || " "));
|
|
542450
542262
|
}
|
|
542451
542263
|
}
|
|
542452
|
-
return
|
|
542264
|
+
return import_react98.default.createElement(Box_default, { flexDirection: "column" }, renderedLines);
|
|
542453
542265
|
} else {
|
|
542454
|
-
return
|
|
542455
|
-
|
|
542266
|
+
return import_react98.default.createElement(
|
|
542267
|
+
import_react98.default.Fragment,
|
|
542456
542268
|
null,
|
|
542457
542269
|
renderCursor(" "),
|
|
542458
|
-
|
|
542270
|
+
import_react98.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, disabled ? t.chatScreen.waitingForResponse : placeholder)
|
|
542459
542271
|
);
|
|
542460
542272
|
}
|
|
542461
542273
|
};
|
|
542462
|
-
return
|
|
542274
|
+
return import_react98.default.createElement(
|
|
542463
542275
|
Box_default,
|
|
542464
542276
|
{ flexDirection: "column", paddingX: 1, width: terminalWidth },
|
|
542465
|
-
showHistoryMenu &&
|
|
542277
|
+
showHistoryMenu && import_react98.default.createElement(
|
|
542466
542278
|
Box_default,
|
|
542467
542279
|
{ flexDirection: "column", marginBottom: 1, width: terminalWidth - 2 },
|
|
542468
|
-
|
|
542280
|
+
import_react98.default.createElement(Box_default, { flexDirection: "column" }, (() => {
|
|
542469
542281
|
const userMessages = getUserMessages();
|
|
542470
542282
|
const maxVisibleItems = 5;
|
|
542471
542283
|
let startIndex = 0;
|
|
@@ -542477,20 +542289,20 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542477
542289
|
const visibleMessages = userMessages.slice(startIndex, endIndex);
|
|
542478
542290
|
const hasMoreAbove = startIndex > 0;
|
|
542479
542291
|
const hasMoreBelow = endIndex < userMessages.length;
|
|
542480
|
-
return
|
|
542481
|
-
|
|
542292
|
+
return import_react98.default.createElement(
|
|
542293
|
+
import_react98.default.Fragment,
|
|
542482
542294
|
null,
|
|
542483
|
-
|
|
542295
|
+
import_react98.default.createElement(Box_default, { height: 1 }, hasMoreAbove ? import_react98.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.moreAbove.replace("{count}", startIndex.toString())) : import_react98.default.createElement(Text, null, " ")),
|
|
542484
542296
|
visibleMessages.map((message, displayIndex) => {
|
|
542485
542297
|
const actualIndex = startIndex + displayIndex;
|
|
542486
542298
|
const singleLineLabel = message.label.replace(/[\r\n\t\v\f\u0000-\u001F\u007F-\u009F]+/g, " ").replace(/\s+/g, " ").trim();
|
|
542487
542299
|
const prefixWidth = 3;
|
|
542488
542300
|
const maxLabelWidth = terminalWidth - 4 - prefixWidth;
|
|
542489
542301
|
const truncatedLabel = singleLineLabel.length > maxLabelWidth ? singleLineLabel.slice(0, maxLabelWidth - 3) + "..." : singleLineLabel;
|
|
542490
|
-
return
|
|
542302
|
+
return import_react98.default.createElement(
|
|
542491
542303
|
Box_default,
|
|
542492
542304
|
{ key: message.value, height: 1 },
|
|
542493
|
-
|
|
542305
|
+
import_react98.default.createElement(
|
|
542494
542306
|
Text,
|
|
542495
542307
|
{ color: actualIndex === historySelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: true, wrap: "truncate" },
|
|
542496
542308
|
actualIndex === historySelectedIndex ? "\u276F " : " ",
|
|
@@ -542498,77 +542310,77 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542498
542310
|
)
|
|
542499
542311
|
);
|
|
542500
542312
|
}),
|
|
542501
|
-
|
|
542313
|
+
import_react98.default.createElement(Box_default, { height: 1 }, hasMoreBelow ? import_react98.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.moreBelow.replace("{count}", (userMessages.length - endIndex).toString())) : import_react98.default.createElement(Text, null, " "))
|
|
542502
542314
|
);
|
|
542503
542315
|
})()),
|
|
542504
|
-
|
|
542316
|
+
import_react98.default.createElement(
|
|
542505
542317
|
Box_default,
|
|
542506
542318
|
{ marginBottom: 1 },
|
|
542507
|
-
|
|
542319
|
+
import_react98.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, t.chatScreen.historyNavigateHint)
|
|
542508
542320
|
)
|
|
542509
542321
|
),
|
|
542510
|
-
!showHistoryMenu &&
|
|
542511
|
-
|
|
542322
|
+
!showHistoryMenu && import_react98.default.createElement(
|
|
542323
|
+
import_react98.default.Fragment,
|
|
542512
542324
|
null,
|
|
542513
|
-
|
|
542325
|
+
import_react98.default.createElement(
|
|
542514
542326
|
Box_default,
|
|
542515
542327
|
{ flexDirection: "column", width: terminalWidth - 2 },
|
|
542516
|
-
|
|
542517
|
-
|
|
542328
|
+
import_react98.default.createElement(Text, { color: isBashMode ? theme14.colors.success : theme14.colors.menuSecondary }, "\u2500".repeat(terminalWidth - 2)),
|
|
542329
|
+
import_react98.default.createElement(
|
|
542518
542330
|
Box_default,
|
|
542519
542331
|
{ flexDirection: "row" },
|
|
542520
|
-
|
|
542332
|
+
import_react98.default.createElement(
|
|
542521
542333
|
Text,
|
|
542522
542334
|
{ color: isBashMode ? theme14.colors.success : theme14.colors.menuInfo, bold: true },
|
|
542523
542335
|
isBashMode ? ">_" : "\u276F",
|
|
542524
542336
|
" "
|
|
542525
542337
|
),
|
|
542526
|
-
|
|
542338
|
+
import_react98.default.createElement(Box_default, { flexGrow: 1 }, renderContent())
|
|
542527
542339
|
),
|
|
542528
|
-
|
|
542340
|
+
import_react98.default.createElement(Text, { color: isBashMode ? theme14.colors.success : theme14.colors.menuSecondary }, "\u2500".repeat(terminalWidth - 2))
|
|
542529
542341
|
),
|
|
542530
|
-
showCommands && getFilteredCommands().length > 0 || showFilePicker ?
|
|
542342
|
+
showCommands && getFilteredCommands().length > 0 || showFilePicker ? import_react98.default.createElement(
|
|
542531
542343
|
Box_default,
|
|
542532
542344
|
{ marginTop: 1 },
|
|
542533
|
-
|
|
542345
|
+
import_react98.default.createElement(Text, null, showCommands && getFilteredCommands().length > 0 ? t.commandPanel.interactionHint + " \u2022 " + t.chatScreen.typeToFilterCommands : showFilePicker ? searchMode === "content" ? t.chatScreen.contentSearchHint : t.chatScreen.fileSearchHint : "")
|
|
542534
542346
|
) : null,
|
|
542535
|
-
|
|
542536
|
-
|
|
542347
|
+
import_react98.default.createElement(
|
|
542348
|
+
import_react98.Suspense,
|
|
542537
542349
|
{ fallback: null },
|
|
542538
|
-
|
|
542350
|
+
import_react98.default.createElement(CommandPanel2, { commands: getFilteredCommands(), selectedIndex: commandSelectedIndex, query: buffer.getFullText().slice(1), visible: showCommands, isProcessing: commandPanelIsProcessing })
|
|
542539
542351
|
),
|
|
542540
|
-
|
|
542352
|
+
import_react98.default.createElement(
|
|
542541
542353
|
Box_default,
|
|
542542
542354
|
null,
|
|
542543
|
-
|
|
542544
|
-
|
|
542355
|
+
import_react98.default.createElement(
|
|
542356
|
+
import_react98.Suspense,
|
|
542545
542357
|
{ fallback: null },
|
|
542546
|
-
|
|
542358
|
+
import_react98.default.createElement(FileList2, { ref: fileListRef, query: fileQuery, selectedIndex: fileSelectedIndex, visible: showFilePicker, maxItems: 10, rootPath: process.cwd(), onFilteredCountChange: handleFilteredCountChange, searchMode })
|
|
542547
542359
|
)
|
|
542548
542360
|
),
|
|
542549
|
-
|
|
542550
|
-
|
|
542361
|
+
import_react98.default.createElement(
|
|
542362
|
+
import_react98.Suspense,
|
|
542551
542363
|
{ fallback: null },
|
|
542552
|
-
|
|
542364
|
+
import_react98.default.createElement(AgentPickerPanel2, { agents: getFilteredAgents(), selectedIndex: agentSelectedIndex, visible: showAgentPicker, maxHeight: 5 })
|
|
542553
542365
|
),
|
|
542554
|
-
|
|
542555
|
-
|
|
542366
|
+
import_react98.default.createElement(
|
|
542367
|
+
import_react98.Suspense,
|
|
542556
542368
|
{ fallback: null },
|
|
542557
|
-
|
|
542369
|
+
import_react98.default.createElement(TodoPickerPanel2, { todos, selectedIndex: todoSelectedIndex, selectedTodos, visible: showTodoPicker, maxHeight: 5, isLoading: todoIsLoading, searchQuery: todoSearchQuery, totalCount: totalTodoCount })
|
|
542558
542370
|
),
|
|
542559
|
-
|
|
542560
|
-
|
|
542371
|
+
import_react98.default.createElement(
|
|
542372
|
+
import_react98.Suspense,
|
|
542561
542373
|
{ fallback: null },
|
|
542562
|
-
|
|
542374
|
+
import_react98.default.createElement(ProfilePanel2, { profiles: getFilteredProfiles ? getFilteredProfiles() : [], selectedIndex: profileSelectedIndex, visible: showProfilePicker, maxHeight: 5, searchQuery: profileSearchQuery })
|
|
542563
542375
|
)
|
|
542564
542376
|
)
|
|
542565
542377
|
);
|
|
542566
542378
|
}
|
|
542567
|
-
var
|
|
542379
|
+
var import_react98, CommandPanel2, FileList2, AgentPickerPanel2, TodoPickerPanel2, ProfilePanel2;
|
|
542568
542380
|
var init_ChatInput = __esm({
|
|
542569
542381
|
async "dist/ui/components/chat/ChatInput.js"() {
|
|
542570
542382
|
"use strict";
|
|
542571
|
-
|
|
542383
|
+
import_react98 = __toESM(require_react(), 1);
|
|
542572
542384
|
await init_build2();
|
|
542573
542385
|
init_textUtils();
|
|
542574
542386
|
init_useInputBuffer();
|
|
@@ -542584,11 +542396,11 @@ var init_ChatInput = __esm({
|
|
|
542584
542396
|
init_i18n();
|
|
542585
542397
|
init_ThemeContext();
|
|
542586
542398
|
init_useBashMode();
|
|
542587
|
-
CommandPanel2 = (0,
|
|
542588
|
-
FileList2 = (0,
|
|
542589
|
-
AgentPickerPanel2 = (0,
|
|
542590
|
-
TodoPickerPanel2 = (0,
|
|
542591
|
-
ProfilePanel2 = (0,
|
|
542399
|
+
CommandPanel2 = (0, import_react98.lazy)(() => init_CommandPanel().then(() => CommandPanel_exports));
|
|
542400
|
+
FileList2 = (0, import_react98.lazy)(() => init_FileList().then(() => FileList_exports));
|
|
542401
|
+
AgentPickerPanel2 = (0, import_react98.lazy)(() => init_AgentPickerPanel().then(() => AgentPickerPanel_exports));
|
|
542402
|
+
TodoPickerPanel2 = (0, import_react98.lazy)(() => init_TodoPickerPanel().then(() => TodoPickerPanel_exports));
|
|
542403
|
+
ProfilePanel2 = (0, import_react98.lazy)(() => init_ProfilePanel().then(() => ProfilePanel_exports));
|
|
542592
542404
|
}
|
|
542593
542405
|
});
|
|
542594
542406
|
|
|
@@ -542657,13 +542469,13 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542657
542469
|
color: "yellow"
|
|
542658
542470
|
});
|
|
542659
542471
|
}
|
|
542660
|
-
return
|
|
542472
|
+
return import_react99.default.createElement(
|
|
542661
542473
|
Box_default,
|
|
542662
542474
|
{ flexDirection: "column", paddingX: 1, marginTop: 1 },
|
|
542663
|
-
contextUsage &&
|
|
542475
|
+
contextUsage && import_react99.default.createElement(
|
|
542664
542476
|
Box_default,
|
|
542665
542477
|
{ marginBottom: 1 },
|
|
542666
|
-
|
|
542478
|
+
import_react99.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, (() => {
|
|
542667
542479
|
const isAnthropic = (contextUsage.cacheCreationTokens || 0) > 0 || (contextUsage.cacheReadTokens || 0) > 0;
|
|
542668
542480
|
const isOpenAI = (contextUsage.cachedTokens || 0) > 0;
|
|
542669
542481
|
const percentage = calculateContextPercentage2(contextUsage);
|
|
@@ -542683,29 +542495,29 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542683
542495
|
return num.toString();
|
|
542684
542496
|
};
|
|
542685
542497
|
const hasCacheMetrics = isAnthropic || isOpenAI;
|
|
542686
|
-
return
|
|
542687
|
-
|
|
542498
|
+
return import_react99.default.createElement(
|
|
542499
|
+
import_react99.default.Fragment,
|
|
542688
542500
|
null,
|
|
542689
|
-
|
|
542501
|
+
import_react99.default.createElement(
|
|
542690
542502
|
Text,
|
|
542691
542503
|
{ color },
|
|
542692
542504
|
percentage.toFixed(1),
|
|
542693
542505
|
"%"
|
|
542694
542506
|
),
|
|
542695
|
-
|
|
542696
|
-
|
|
542697
|
-
|
|
542698
|
-
hasCacheMetrics &&
|
|
542699
|
-
|
|
542507
|
+
import_react99.default.createElement(Text, null, " \xB7 "),
|
|
542508
|
+
import_react99.default.createElement(Text, { color }, formatNumber(totalInputTokens)),
|
|
542509
|
+
import_react99.default.createElement(Text, null, t.chatScreen.tokens),
|
|
542510
|
+
hasCacheMetrics && import_react99.default.createElement(
|
|
542511
|
+
import_react99.default.Fragment,
|
|
542700
542512
|
null,
|
|
542701
|
-
|
|
542702
|
-
isAnthropic &&
|
|
542703
|
-
|
|
542513
|
+
import_react99.default.createElement(Text, null, " \xB7 "),
|
|
542514
|
+
isAnthropic && import_react99.default.createElement(
|
|
542515
|
+
import_react99.default.Fragment,
|
|
542704
542516
|
null,
|
|
542705
|
-
(contextUsage.cacheReadTokens || 0) > 0 &&
|
|
542706
|
-
|
|
542517
|
+
(contextUsage.cacheReadTokens || 0) > 0 && import_react99.default.createElement(
|
|
542518
|
+
import_react99.default.Fragment,
|
|
542707
542519
|
null,
|
|
542708
|
-
|
|
542520
|
+
import_react99.default.createElement(
|
|
542709
542521
|
Text,
|
|
542710
542522
|
{ color: theme14.colors.menuInfo },
|
|
542711
542523
|
"\u21AF",
|
|
@@ -542715,11 +542527,11 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542715
542527
|
t.chatScreen.cached
|
|
542716
542528
|
)
|
|
542717
542529
|
),
|
|
542718
|
-
(contextUsage.cacheCreationTokens || 0) > 0 &&
|
|
542719
|
-
|
|
542530
|
+
(contextUsage.cacheCreationTokens || 0) > 0 && import_react99.default.createElement(
|
|
542531
|
+
import_react99.default.Fragment,
|
|
542720
542532
|
null,
|
|
542721
|
-
(contextUsage.cacheReadTokens || 0) > 0 &&
|
|
542722
|
-
|
|
542533
|
+
(contextUsage.cacheReadTokens || 0) > 0 && import_react99.default.createElement(Text, null, " \xB7 "),
|
|
542534
|
+
import_react99.default.createElement(
|
|
542723
542535
|
Text,
|
|
542724
542536
|
{ color: theme14.colors.warning },
|
|
542725
542537
|
"\u25C6",
|
|
@@ -542730,7 +542542,7 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542730
542542
|
)
|
|
542731
542543
|
)
|
|
542732
542544
|
),
|
|
542733
|
-
isOpenAI &&
|
|
542545
|
+
isOpenAI && import_react99.default.createElement(
|
|
542734
542546
|
Text,
|
|
542735
542547
|
{ color: theme14.colors.menuInfo },
|
|
542736
542548
|
"\u21AF ",
|
|
@@ -542742,25 +542554,25 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542742
542554
|
);
|
|
542743
542555
|
})())
|
|
542744
542556
|
),
|
|
542745
|
-
statusItems.length > 0 &&
|
|
542557
|
+
statusItems.length > 0 && import_react99.default.createElement(
|
|
542746
542558
|
Box_default,
|
|
542747
542559
|
null,
|
|
542748
|
-
|
|
542749
|
-
|
|
542560
|
+
import_react99.default.createElement(Text, { dimColor: true }, statusItems.map((item, index) => import_react99.default.createElement(
|
|
542561
|
+
import_react99.default.Fragment,
|
|
542750
542562
|
{ key: index },
|
|
542751
|
-
index > 0 &&
|
|
542752
|
-
|
|
542563
|
+
index > 0 && import_react99.default.createElement(Text, { color: theme14.colors.menuSecondary }, " | "),
|
|
542564
|
+
import_react99.default.createElement(Text, { color: item.color }, item.text)
|
|
542753
542565
|
)))
|
|
542754
542566
|
)
|
|
542755
542567
|
);
|
|
542756
542568
|
}
|
|
542757
|
-
return
|
|
542569
|
+
return import_react99.default.createElement(
|
|
542758
542570
|
Box_default,
|
|
542759
542571
|
{ flexDirection: "column", paddingX: 1, marginTop: 1 },
|
|
542760
|
-
contextUsage &&
|
|
542572
|
+
contextUsage && import_react99.default.createElement(
|
|
542761
542573
|
Box_default,
|
|
542762
542574
|
null,
|
|
542763
|
-
|
|
542575
|
+
import_react99.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, (() => {
|
|
542764
542576
|
const isAnthropic = (contextUsage.cacheCreationTokens || 0) > 0 || (contextUsage.cacheReadTokens || 0) > 0;
|
|
542765
542577
|
const isOpenAI = (contextUsage.cachedTokens || 0) > 0;
|
|
542766
542578
|
const percentage = calculateContextPercentage2(contextUsage);
|
|
@@ -542780,29 +542592,29 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542780
542592
|
return num.toString();
|
|
542781
542593
|
};
|
|
542782
542594
|
const hasCacheMetrics = isAnthropic || isOpenAI;
|
|
542783
|
-
return
|
|
542784
|
-
|
|
542595
|
+
return import_react99.default.createElement(
|
|
542596
|
+
import_react99.default.Fragment,
|
|
542785
542597
|
null,
|
|
542786
|
-
|
|
542598
|
+
import_react99.default.createElement(
|
|
542787
542599
|
Text,
|
|
542788
542600
|
{ color },
|
|
542789
542601
|
percentage.toFixed(1),
|
|
542790
542602
|
"%"
|
|
542791
542603
|
),
|
|
542792
|
-
|
|
542793
|
-
|
|
542794
|
-
|
|
542795
|
-
hasCacheMetrics &&
|
|
542796
|
-
|
|
542604
|
+
import_react99.default.createElement(Text, null, " \xB7 "),
|
|
542605
|
+
import_react99.default.createElement(Text, { color }, formatNumber(totalInputTokens)),
|
|
542606
|
+
import_react99.default.createElement(Text, null, t.chatScreen.tokens),
|
|
542607
|
+
hasCacheMetrics && import_react99.default.createElement(
|
|
542608
|
+
import_react99.default.Fragment,
|
|
542797
542609
|
null,
|
|
542798
|
-
|
|
542799
|
-
isAnthropic &&
|
|
542800
|
-
|
|
542610
|
+
import_react99.default.createElement(Text, null, " \xB7 "),
|
|
542611
|
+
isAnthropic && import_react99.default.createElement(
|
|
542612
|
+
import_react99.default.Fragment,
|
|
542801
542613
|
null,
|
|
542802
|
-
(contextUsage.cacheReadTokens || 0) > 0 &&
|
|
542803
|
-
|
|
542614
|
+
(contextUsage.cacheReadTokens || 0) > 0 && import_react99.default.createElement(
|
|
542615
|
+
import_react99.default.Fragment,
|
|
542804
542616
|
null,
|
|
542805
|
-
|
|
542617
|
+
import_react99.default.createElement(
|
|
542806
542618
|
Text,
|
|
542807
542619
|
{ color: theme14.colors.menuInfo },
|
|
542808
542620
|
"\u21AF",
|
|
@@ -542812,11 +542624,11 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542812
542624
|
t.chatScreen.cached
|
|
542813
542625
|
)
|
|
542814
542626
|
),
|
|
542815
|
-
(contextUsage.cacheCreationTokens || 0) > 0 &&
|
|
542816
|
-
|
|
542627
|
+
(contextUsage.cacheCreationTokens || 0) > 0 && import_react99.default.createElement(
|
|
542628
|
+
import_react99.default.Fragment,
|
|
542817
542629
|
null,
|
|
542818
|
-
(contextUsage.cacheReadTokens || 0) > 0 &&
|
|
542819
|
-
|
|
542630
|
+
(contextUsage.cacheReadTokens || 0) > 0 && import_react99.default.createElement(Text, null, " \xB7 "),
|
|
542631
|
+
import_react99.default.createElement(
|
|
542820
542632
|
Text,
|
|
542821
542633
|
{ color: theme14.colors.warning },
|
|
542822
542634
|
"\u25C6",
|
|
@@ -542827,7 +542639,7 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542827
542639
|
)
|
|
542828
542640
|
)
|
|
542829
542641
|
),
|
|
542830
|
-
isOpenAI &&
|
|
542642
|
+
isOpenAI && import_react99.default.createElement(
|
|
542831
542643
|
Text,
|
|
542832
542644
|
{ color: theme14.colors.menuInfo },
|
|
542833
542645
|
"\u21AF ",
|
|
@@ -542839,10 +542651,10 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542839
542651
|
);
|
|
542840
542652
|
})())
|
|
542841
542653
|
),
|
|
542842
|
-
currentProfileName &&
|
|
542654
|
+
currentProfileName && import_react99.default.createElement(
|
|
542843
542655
|
Box_default,
|
|
542844
542656
|
null,
|
|
542845
|
-
|
|
542657
|
+
import_react99.default.createElement(
|
|
542846
542658
|
Text,
|
|
542847
542659
|
{ color: theme14.colors.menuInfo, dimColor: true },
|
|
542848
542660
|
"\uA6B0 ",
|
|
@@ -542856,37 +542668,37 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542856
542668
|
t.chatScreen.profileSwitchHint
|
|
542857
542669
|
)
|
|
542858
542670
|
),
|
|
542859
|
-
yoloMode &&
|
|
542671
|
+
yoloMode && import_react99.default.createElement(
|
|
542860
542672
|
Box_default,
|
|
542861
542673
|
null,
|
|
542862
|
-
|
|
542674
|
+
import_react99.default.createElement(Text, { color: theme14.colors.warning, dimColor: true }, t.chatScreen.yoloModeActive)
|
|
542863
542675
|
),
|
|
542864
|
-
planMode &&
|
|
542676
|
+
planMode && import_react99.default.createElement(
|
|
542865
542677
|
Box_default,
|
|
542866
542678
|
null,
|
|
542867
|
-
|
|
542679
|
+
import_react99.default.createElement(Text, { color: "#60A5FA", dimColor: true }, t.chatScreen.planModeActive)
|
|
542868
542680
|
),
|
|
542869
|
-
vulnerabilityHuntingMode &&
|
|
542681
|
+
vulnerabilityHuntingMode && import_react99.default.createElement(
|
|
542870
542682
|
Box_default,
|
|
542871
542683
|
null,
|
|
542872
|
-
|
|
542684
|
+
import_react99.default.createElement(Text, { color: "#EF4444", dimColor: true }, t.chatScreen.vulnerabilityHuntingModeActive)
|
|
542873
542685
|
),
|
|
542874
|
-
vscodeConnectionStatus && (vscodeConnectionStatus === "connecting" || vscodeConnectionStatus === "connected" || vscodeConnectionStatus === "error") &&
|
|
542686
|
+
vscodeConnectionStatus && (vscodeConnectionStatus === "connecting" || vscodeConnectionStatus === "connected" || vscodeConnectionStatus === "error") && import_react99.default.createElement(
|
|
542875
542687
|
Box_default,
|
|
542876
542688
|
null,
|
|
542877
|
-
|
|
542878
|
-
|
|
542689
|
+
import_react99.default.createElement(Text, { color: vscodeConnectionStatus === "connecting" ? "yellow" : vscodeConnectionStatus === "error" ? "gray" : "green", dimColor: true }, vscodeConnectionStatus === "connecting" ? import_react99.default.createElement(
|
|
542690
|
+
import_react99.default.Fragment,
|
|
542879
542691
|
null,
|
|
542880
|
-
|
|
542692
|
+
import_react99.default.createElement(build_default, { type: "dots" }),
|
|
542881
542693
|
" ",
|
|
542882
542694
|
t.chatScreen.ideConnecting
|
|
542883
|
-
) : vscodeConnectionStatus === "error" ?
|
|
542884
|
-
|
|
542695
|
+
) : vscodeConnectionStatus === "error" ? import_react99.default.createElement(
|
|
542696
|
+
import_react99.default.Fragment,
|
|
542885
542697
|
null,
|
|
542886
542698
|
"\u25CB ",
|
|
542887
542699
|
t.chatScreen.ideError
|
|
542888
|
-
) :
|
|
542889
|
-
|
|
542700
|
+
) : import_react99.default.createElement(
|
|
542701
|
+
import_react99.default.Fragment,
|
|
542890
542702
|
null,
|
|
542891
542703
|
"\u25CF ",
|
|
542892
542704
|
t.chatScreen.ideConnected,
|
|
@@ -542894,28 +542706,28 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542894
542706
|
(editorContext == null ? void 0 : editorContext.selectedText) && t.chatScreen.ideSelectedText.replace("{count}", editorContext.selectedText.length.toString())
|
|
542895
542707
|
))
|
|
542896
542708
|
),
|
|
542897
|
-
(codebaseIndexing || (codebaseProgress == null ? void 0 : codebaseProgress.error)) && codebaseProgress &&
|
|
542709
|
+
(codebaseIndexing || (codebaseProgress == null ? void 0 : codebaseProgress.error)) && codebaseProgress && import_react99.default.createElement(Box_default, null, codebaseProgress.error ? import_react99.default.createElement(Text, { color: "red", dimColor: true }, codebaseProgress.error) : import_react99.default.createElement(
|
|
542898
542710
|
Text,
|
|
542899
542711
|
{ color: "cyan", dimColor: true },
|
|
542900
|
-
|
|
542712
|
+
import_react99.default.createElement(build_default, { type: "dots" }),
|
|
542901
542713
|
" ",
|
|
542902
542714
|
t.chatScreen.codebaseIndexing.replace("{processed}", codebaseProgress.processedFiles.toString()).replace("{total}", codebaseProgress.totalFiles.toString()),
|
|
542903
542715
|
codebaseProgress.totalChunks > 0 && ` (${t.chatScreen.codebaseProgress.replace("{chunks}", codebaseProgress.totalChunks.toString())})`
|
|
542904
542716
|
)),
|
|
542905
|
-
!codebaseIndexing && watcherEnabled &&
|
|
542717
|
+
!codebaseIndexing && watcherEnabled && import_react99.default.createElement(
|
|
542906
542718
|
Box_default,
|
|
542907
542719
|
null,
|
|
542908
|
-
|
|
542720
|
+
import_react99.default.createElement(
|
|
542909
542721
|
Text,
|
|
542910
542722
|
{ color: "green", dimColor: true },
|
|
542911
542723
|
"\u2609 ",
|
|
542912
542724
|
t.chatScreen.statusWatcherActive
|
|
542913
542725
|
)
|
|
542914
542726
|
),
|
|
542915
|
-
fileUpdateNotification &&
|
|
542727
|
+
fileUpdateNotification && import_react99.default.createElement(
|
|
542916
542728
|
Box_default,
|
|
542917
542729
|
null,
|
|
542918
|
-
|
|
542730
|
+
import_react99.default.createElement(
|
|
542919
542731
|
Text,
|
|
542920
542732
|
{ color: "yellow", dimColor: true },
|
|
542921
542733
|
"\u26C1",
|
|
@@ -542925,11 +542737,11 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542925
542737
|
)
|
|
542926
542738
|
);
|
|
542927
542739
|
}
|
|
542928
|
-
var
|
|
542740
|
+
var import_react99, getProfileShortcut;
|
|
542929
542741
|
var init_StatusLine = __esm({
|
|
542930
542742
|
async "dist/ui/components/common/StatusLine.js"() {
|
|
542931
542743
|
"use strict";
|
|
542932
|
-
|
|
542744
|
+
import_react99 = __toESM(require_react(), 1);
|
|
542933
542745
|
await init_build2();
|
|
542934
542746
|
await init_build3();
|
|
542935
542747
|
init_i18n();
|
|
@@ -542992,13 +542804,13 @@ function BackgroundProcessPanel({ processes, selectedIndex, terminalWidth }) {
|
|
|
542992
542804
|
return theme14.colors.success;
|
|
542993
542805
|
return theme14.colors.error;
|
|
542994
542806
|
};
|
|
542995
|
-
return
|
|
542807
|
+
return import_react100.default.createElement(
|
|
542996
542808
|
Box_default,
|
|
542997
542809
|
{ flexDirection: "column", borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1, paddingY: 0, width: terminalWidth - 2 },
|
|
542998
|
-
|
|
542810
|
+
import_react100.default.createElement(
|
|
542999
542811
|
Box_default,
|
|
543000
542812
|
{ paddingTop: 1, paddingX: 1 },
|
|
543001
|
-
|
|
542813
|
+
import_react100.default.createElement(
|
|
543002
542814
|
Text,
|
|
543003
542815
|
{ bold: true, color: theme14.colors.menuInfo },
|
|
543004
542816
|
t.backgroundProcesses.title,
|
|
@@ -543007,29 +542819,29 @@ function BackgroundProcessPanel({ processes, selectedIndex, terminalWidth }) {
|
|
|
543007
542819
|
")"
|
|
543008
542820
|
)
|
|
543009
542821
|
),
|
|
543010
|
-
sortedProcesses.length === 0 ?
|
|
542822
|
+
sortedProcesses.length === 0 ? import_react100.default.createElement(
|
|
543011
542823
|
Box_default,
|
|
543012
542824
|
{ paddingX: 1, paddingY: 1 },
|
|
543013
|
-
|
|
543014
|
-
) :
|
|
543015
|
-
|
|
542825
|
+
import_react100.default.createElement(Text, { dimColor: true }, t.backgroundProcesses.emptyHint)
|
|
542826
|
+
) : import_react100.default.createElement(
|
|
542827
|
+
import_react100.default.Fragment,
|
|
543016
542828
|
null,
|
|
543017
542829
|
visibleProcesses.map((process20, visibleIndex) => {
|
|
543018
542830
|
const actualIndex = scrollOffset + visibleIndex;
|
|
543019
542831
|
const isSelected = actualIndex === selectedIndex;
|
|
543020
|
-
return
|
|
542832
|
+
return import_react100.default.createElement(
|
|
543021
542833
|
Box_default,
|
|
543022
542834
|
{ key: process20.id, flexDirection: "column", paddingY: 0 },
|
|
543023
|
-
|
|
542835
|
+
import_react100.default.createElement(
|
|
543024
542836
|
Box_default,
|
|
543025
542837
|
{ paddingX: 1 },
|
|
543026
|
-
|
|
543027
|
-
|
|
542838
|
+
import_react100.default.createElement(Text, { color: isSelected ? theme14.colors.warning : void 0, bold: isSelected }, isSelected ? "> " : " "),
|
|
542839
|
+
import_react100.default.createElement(Text, { dimColor: !isSelected }, truncateCommand(process20.command, maxCommandWidth))
|
|
543028
542840
|
),
|
|
543029
|
-
|
|
542841
|
+
import_react100.default.createElement(
|
|
543030
542842
|
Box_default,
|
|
543031
542843
|
{ paddingLeft: 4 },
|
|
543032
|
-
|
|
542844
|
+
import_react100.default.createElement(
|
|
543033
542845
|
Text,
|
|
543034
542846
|
{ dimColor: true },
|
|
543035
542847
|
"PID: ",
|
|
@@ -543039,8 +542851,8 @@ function BackgroundProcessPanel({ processes, selectedIndex, terminalWidth }) {
|
|
|
543039
542851
|
":",
|
|
543040
542852
|
" "
|
|
543041
542853
|
),
|
|
543042
|
-
|
|
543043
|
-
|
|
542854
|
+
import_react100.default.createElement(Text, { color: getStatusColor(process20.status) }, getStatusText(process20)),
|
|
542855
|
+
import_react100.default.createElement(
|
|
543044
542856
|
Text,
|
|
543045
542857
|
{ dimColor: true },
|
|
543046
542858
|
" ",
|
|
@@ -543053,10 +542865,10 @@ function BackgroundProcessPanel({ processes, selectedIndex, terminalWidth }) {
|
|
|
543053
542865
|
)
|
|
543054
542866
|
);
|
|
543055
542867
|
}),
|
|
543056
|
-
totalItems > maxVisibleItems &&
|
|
542868
|
+
totalItems > maxVisibleItems && import_react100.default.createElement(
|
|
543057
542869
|
Box_default,
|
|
543058
542870
|
{ paddingX: 1, paddingBottom: 1 },
|
|
543059
|
-
|
|
542871
|
+
import_react100.default.createElement(
|
|
543060
542872
|
Text,
|
|
543061
542873
|
{ dimColor: true },
|
|
543062
542874
|
t.backgroundProcesses.navigateHint,
|
|
@@ -543071,31 +542883,151 @@ function BackgroundProcessPanel({ processes, selectedIndex, terminalWidth }) {
|
|
|
543071
542883
|
)
|
|
543072
542884
|
)
|
|
543073
542885
|
),
|
|
543074
|
-
totalItems <= maxVisibleItems &&
|
|
542886
|
+
totalItems <= maxVisibleItems && import_react100.default.createElement(
|
|
543075
542887
|
Box_default,
|
|
543076
542888
|
{ paddingX: 1, paddingY: 1 },
|
|
543077
|
-
|
|
542889
|
+
import_react100.default.createElement(Text, { dimColor: true }, t.backgroundProcesses.navigateHint)
|
|
543078
542890
|
)
|
|
543079
542891
|
);
|
|
543080
542892
|
}
|
|
543081
|
-
var
|
|
542893
|
+
var import_react100;
|
|
543082
542894
|
var init_BackgroundProcessPanel = __esm({
|
|
543083
542895
|
async "dist/ui/components/bash/BackgroundProcessPanel.js"() {
|
|
543084
542896
|
"use strict";
|
|
543085
|
-
|
|
542897
|
+
import_react100 = __toESM(require_react(), 1);
|
|
543086
542898
|
await init_build2();
|
|
543087
542899
|
init_I18nContext();
|
|
543088
542900
|
init_ThemeContext();
|
|
543089
542901
|
}
|
|
543090
542902
|
});
|
|
543091
542903
|
|
|
542904
|
+
// dist/ui/components/special/TodoTree.js
|
|
542905
|
+
function TodoTree({ todos }) {
|
|
542906
|
+
const { theme: theme14 } = useTheme();
|
|
542907
|
+
if (todos.length === 0) {
|
|
542908
|
+
return null;
|
|
542909
|
+
}
|
|
542910
|
+
const completedCount = todos.filter((t) => t.status === "completed").length;
|
|
542911
|
+
const totalCount = todos.length;
|
|
542912
|
+
const rootTodos = todos.filter((t) => !t.parentId);
|
|
542913
|
+
const childTodosMap = /* @__PURE__ */ new Map();
|
|
542914
|
+
todos.forEach((todo) => {
|
|
542915
|
+
if (todo.parentId) {
|
|
542916
|
+
const children = childTodosMap.get(todo.parentId) || [];
|
|
542917
|
+
children.push(todo);
|
|
542918
|
+
childTodosMap.set(todo.parentId, children);
|
|
542919
|
+
}
|
|
542920
|
+
});
|
|
542921
|
+
const getStatusIcon = (status) => {
|
|
542922
|
+
return status === "completed" ? "\u2713" : "\u25CB";
|
|
542923
|
+
};
|
|
542924
|
+
const getStatusColor = (status) => {
|
|
542925
|
+
return status === "completed" ? theme14.colors.success : theme14.colors.menuSecondary;
|
|
542926
|
+
};
|
|
542927
|
+
const renderTodo = (todo, depth = 0, isLast = true, parentPrefixes = []) => {
|
|
542928
|
+
const children = childTodosMap.get(todo.id) || [];
|
|
542929
|
+
const statusIcon = getStatusIcon(todo.status);
|
|
542930
|
+
const statusColor = getStatusColor(todo.status);
|
|
542931
|
+
let prefix = "";
|
|
542932
|
+
if (depth > 0) {
|
|
542933
|
+
prefix = parentPrefixes.join("");
|
|
542934
|
+
prefix += isLast ? "\u2514\u2500" : "\u251C\u2500";
|
|
542935
|
+
}
|
|
542936
|
+
const childPrefixes = [...parentPrefixes];
|
|
542937
|
+
if (depth > 0) {
|
|
542938
|
+
childPrefixes.push(isLast ? " " : "\u2502 ");
|
|
542939
|
+
}
|
|
542940
|
+
return import_react101.default.createElement(
|
|
542941
|
+
Box_default,
|
|
542942
|
+
{ key: todo.id, flexDirection: "column" },
|
|
542943
|
+
import_react101.default.createElement(
|
|
542944
|
+
Text,
|
|
542945
|
+
null,
|
|
542946
|
+
import_react101.default.createElement(Text, { dimColor: true }, prefix),
|
|
542947
|
+
import_react101.default.createElement(Text, { color: statusColor }, statusIcon),
|
|
542948
|
+
import_react101.default.createElement(
|
|
542949
|
+
Text,
|
|
542950
|
+
{ color: statusColor, dimColor: todo.status === "completed" },
|
|
542951
|
+
" ",
|
|
542952
|
+
todo.content
|
|
542953
|
+
)
|
|
542954
|
+
),
|
|
542955
|
+
children.map((child, index) => renderTodo(child, depth + 1, index === children.length - 1, childPrefixes))
|
|
542956
|
+
);
|
|
542957
|
+
};
|
|
542958
|
+
return import_react101.default.createElement(
|
|
542959
|
+
Box_default,
|
|
542960
|
+
{ flexDirection: "column", paddingLeft: 2 },
|
|
542961
|
+
import_react101.default.createElement(
|
|
542962
|
+
Text,
|
|
542963
|
+
null,
|
|
542964
|
+
import_react101.default.createElement(Text, { dimColor: true }, "TODO "),
|
|
542965
|
+
import_react101.default.createElement(
|
|
542966
|
+
Text,
|
|
542967
|
+
{ color: theme14.colors.menuInfo },
|
|
542968
|
+
"(",
|
|
542969
|
+
completedCount,
|
|
542970
|
+
"/",
|
|
542971
|
+
totalCount,
|
|
542972
|
+
")"
|
|
542973
|
+
)
|
|
542974
|
+
),
|
|
542975
|
+
rootTodos.map((todo, index) => renderTodo(todo, 0, index === rootTodos.length - 1, []))
|
|
542976
|
+
);
|
|
542977
|
+
}
|
|
542978
|
+
var import_react101;
|
|
542979
|
+
var init_TodoTree = __esm({
|
|
542980
|
+
async "dist/ui/components/special/TodoTree.js"() {
|
|
542981
|
+
"use strict";
|
|
542982
|
+
import_react101 = __toESM(require_react(), 1);
|
|
542983
|
+
await init_build2();
|
|
542984
|
+
init_ThemeContext();
|
|
542985
|
+
}
|
|
542986
|
+
});
|
|
542987
|
+
|
|
543092
542988
|
// dist/ui/components/chat/ChatFooter.js
|
|
543093
542989
|
function ChatFooter(props) {
|
|
543094
542990
|
const { t } = useI18n();
|
|
542991
|
+
const [todos, setTodos] = (0, import_react102.useState)([]);
|
|
542992
|
+
const [showTodos, setShowTodos] = (0, import_react102.useState)(false);
|
|
542993
|
+
(0, import_react102.useEffect)(() => {
|
|
542994
|
+
const currentSession = sessionManager.getCurrentSession();
|
|
542995
|
+
if (!currentSession) {
|
|
542996
|
+
setShowTodos(false);
|
|
542997
|
+
setTodos([]);
|
|
542998
|
+
return;
|
|
542999
|
+
}
|
|
543000
|
+
const handleTodoUpdate = (data) => {
|
|
543001
|
+
if (data.sessionId === currentSession.id) {
|
|
543002
|
+
setTodos(data.todos);
|
|
543003
|
+
if (data.todos.length > 0 && props.isProcessing) {
|
|
543004
|
+
setShowTodos(true);
|
|
543005
|
+
}
|
|
543006
|
+
}
|
|
543007
|
+
};
|
|
543008
|
+
todoEvents.onTodoUpdate(handleTodoUpdate);
|
|
543009
|
+
return () => {
|
|
543010
|
+
todoEvents.offTodoUpdate(handleTodoUpdate);
|
|
543011
|
+
};
|
|
543012
|
+
}, [props.isProcessing]);
|
|
543013
|
+
(0, import_react102.useEffect)(() => {
|
|
543014
|
+
if (!props.isProcessing && showTodos) {
|
|
543015
|
+
const timeoutId = setTimeout(() => {
|
|
543016
|
+
setShowTodos(false);
|
|
543017
|
+
}, 1e3);
|
|
543018
|
+
return () => clearTimeout(timeoutId);
|
|
543019
|
+
}
|
|
543020
|
+
return void 0;
|
|
543021
|
+
}, [props.isProcessing, showTodos]);
|
|
543095
543022
|
return import_react102.default.createElement(
|
|
543096
543023
|
import_react102.default.Fragment,
|
|
543097
543024
|
null,
|
|
543098
543025
|
import_react102.default.createElement(ChatInput, { onSubmit: props.onSubmit, onCommand: props.onCommand, placeholder: t.chatScreen.inputPlaceholder, disabled: props.disabled || props.isStopping, disableKeyboardNavigation: props.showBackgroundPanel, isProcessing: props.isProcessing, chatHistory: props.chatHistory, onHistorySelect: props.handleHistorySelect, yoloMode: props.yoloMode, setYoloMode: props.setYoloMode, planMode: props.planMode, setPlanMode: props.setPlanMode, vulnerabilityHuntingMode: props.vulnerabilityHuntingMode, setVulnerabilityHuntingMode: props.setVulnerabilityHuntingMode, contextUsage: props.contextUsage, initialContent: props.initialContent, onContextPercentageChange: props.onContextPercentageChange, showProfilePicker: props.showProfilePicker, setShowProfilePicker: props.setShowProfilePicker, profileSelectedIndex: props.profileSelectedIndex, setProfileSelectedIndex: props.setProfileSelectedIndex, getFilteredProfiles: props.getFilteredProfiles, handleProfileSelect: props.handleProfileSelect, profileSearchQuery: props.profileSearchQuery, setProfileSearchQuery: props.setProfileSearchQuery, onSwitchProfile: props.onSwitchProfile }),
|
|
543026
|
+
showTodos && todos.length > 0 && import_react102.default.createElement(
|
|
543027
|
+
Box_default,
|
|
543028
|
+
{ marginTop: 1 },
|
|
543029
|
+
import_react102.default.createElement(TodoTree, { todos })
|
|
543030
|
+
),
|
|
543099
543031
|
import_react102.default.createElement(StatusLine, { yoloMode: props.yoloMode, planMode: props.planMode, vulnerabilityHuntingMode: props.vulnerabilityHuntingMode, vscodeConnectionStatus: props.vscodeConnectionStatus, editorContext: props.editorContext, contextUsage: props.contextUsage, codebaseIndexing: props.codebaseIndexing, codebaseProgress: props.codebaseProgress, watcherEnabled: props.watcherEnabled, fileUpdateNotification: props.fileUpdateNotification, currentProfileName: props.currentProfileName }),
|
|
543100
543032
|
props.isCompressing && import_react102.default.createElement(
|
|
543101
543033
|
Box_default,
|
|
@@ -543127,6 +543059,9 @@ var init_ChatFooter = __esm({
|
|
|
543127
543059
|
await init_StatusLine();
|
|
543128
543060
|
init_I18nContext();
|
|
543129
543061
|
await init_BackgroundProcessPanel();
|
|
543062
|
+
await init_TodoTree();
|
|
543063
|
+
init_sessionManager();
|
|
543064
|
+
init_todoEvents();
|
|
543130
543065
|
}
|
|
543131
543066
|
});
|
|
543132
543067
|
|
|
@@ -549120,14 +549055,11 @@ Output: ${combinedOutput}`;
|
|
|
549120
549055
|
commandName
|
|
549121
549056
|
};
|
|
549122
549057
|
options3.setMessages((prev) => [...prev, commandMessage]);
|
|
549123
|
-
} else if (result2.success && result2.action === "
|
|
549124
|
-
options3.
|
|
549125
|
-
|
|
549126
|
-
|
|
549127
|
-
|
|
549128
|
-
commandName
|
|
549129
|
-
};
|
|
549130
|
-
options3.setMessages((prev) => [...prev, commandMessage]);
|
|
549058
|
+
} else if (result2.success && result2.action === "showProfilePanel") {
|
|
549059
|
+
options3.onSwitchProfile();
|
|
549060
|
+
} else if (result2.success && result2.action === "home") {
|
|
549061
|
+
resetTerminal(stdout);
|
|
549062
|
+
navigateTo("welcome");
|
|
549131
549063
|
} else if (result2.success && result2.action === "showUsagePanel") {
|
|
549132
549064
|
options3.setShowUsagePanel(true);
|
|
549133
549065
|
const commandMessage = {
|
|
@@ -553722,7 +553654,7 @@ var init_handler = __esm({
|
|
|
553722
553654
|
// node_modules/chokidar/esm/index.js
|
|
553723
553655
|
import { stat as statcb } from "fs";
|
|
553724
553656
|
import { stat as stat3, readdir as readdir4 } from "fs/promises";
|
|
553725
|
-
import { EventEmitter as
|
|
553657
|
+
import { EventEmitter as EventEmitter10 } from "events";
|
|
553726
553658
|
import * as sysPath2 from "path";
|
|
553727
553659
|
function arrify(item) {
|
|
553728
553660
|
return Array.isArray(item) ? item : [item];
|
|
@@ -553924,7 +553856,7 @@ var init_esm4 = __esm({
|
|
|
553924
553856
|
return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
|
|
553925
553857
|
}
|
|
553926
553858
|
};
|
|
553927
|
-
FSWatcher = class extends
|
|
553859
|
+
FSWatcher = class extends EventEmitter10 {
|
|
553928
553860
|
// Not indenting methods for history sake; for now.
|
|
553929
553861
|
constructor(_opts = {}) {
|
|
553930
553862
|
super();
|
|
@@ -555335,6 +555267,29 @@ var init_PermissionsPanel = __esm({
|
|
|
555335
555267
|
}
|
|
555336
555268
|
});
|
|
555337
555269
|
|
|
555270
|
+
// dist/utils/commands/profiles.js
|
|
555271
|
+
var profiles_exports = {};
|
|
555272
|
+
__export(profiles_exports, {
|
|
555273
|
+
default: () => profiles_default
|
|
555274
|
+
});
|
|
555275
|
+
var profiles_default;
|
|
555276
|
+
var init_profiles = __esm({
|
|
555277
|
+
"dist/utils/commands/profiles.js"() {
|
|
555278
|
+
"use strict";
|
|
555279
|
+
init_commandExecutor();
|
|
555280
|
+
registerCommand("profiles", {
|
|
555281
|
+
execute: () => {
|
|
555282
|
+
return {
|
|
555283
|
+
success: true,
|
|
555284
|
+
action: "showProfilePanel",
|
|
555285
|
+
message: "Opening profile switching panel"
|
|
555286
|
+
};
|
|
555287
|
+
}
|
|
555288
|
+
});
|
|
555289
|
+
profiles_default = {};
|
|
555290
|
+
}
|
|
555291
|
+
});
|
|
555292
|
+
|
|
555338
555293
|
// dist/utils/commands/permissions.js
|
|
555339
555294
|
var permissions_exports = {};
|
|
555340
555295
|
__export(permissions_exports, {
|
|
@@ -555483,6 +555438,7 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
555483
555438
|
(0, import_react133.useEffect)(() => {
|
|
555484
555439
|
Promise.all([
|
|
555485
555440
|
Promise.resolve().then(() => (init_clear(), clear_exports)),
|
|
555441
|
+
Promise.resolve().then(() => (init_profiles(), profiles_exports)),
|
|
555486
555442
|
Promise.resolve().then(() => (init_resume(), resume_exports)),
|
|
555487
555443
|
Promise.resolve().then(() => (init_mcp(), mcp_exports)),
|
|
555488
555444
|
Promise.resolve().then(() => (init_yolo(), yolo_exports)),
|
|
@@ -555887,6 +555843,7 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
555887
555843
|
setShowRoleDeletion: panelState.setShowRoleDeletion,
|
|
555888
555844
|
setShowWorkingDirPanel: panelState.setShowWorkingDirPanel,
|
|
555889
555845
|
setShowPermissionsPanel,
|
|
555846
|
+
onSwitchProfile: handleSwitchProfile,
|
|
555890
555847
|
setShowBackgroundPanel: backgroundProcesses.enablePanel,
|
|
555891
555848
|
setYoloMode,
|
|
555892
555849
|
setPlanMode,
|
|
@@ -556048,14 +556005,14 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
556048
556005
|
setPendingMessages([]);
|
|
556049
556006
|
}
|
|
556050
556007
|
});
|
|
556051
|
-
|
|
556008
|
+
function handleSwitchProfile() {
|
|
556052
556009
|
panelState.handleSwitchProfile({
|
|
556053
556010
|
isStreaming: streamingState.isStreaming,
|
|
556054
556011
|
hasPendingRollback: !!snapshotState.pendingRollback,
|
|
556055
556012
|
hasPendingToolConfirmation: !!pendingToolConfirmation,
|
|
556056
556013
|
hasPendingUserQuestion: !!pendingUserQuestion
|
|
556057
556014
|
});
|
|
556058
|
-
}
|
|
556015
|
+
}
|
|
556059
556016
|
const handleProfileSelect = panelState.handleProfileSelect;
|
|
556060
556017
|
const handleSessionPanelSelect = async (sessionId) => {
|
|
556061
556018
|
panelState.setShowSessionPanel(false);
|