snow-ai 0.6.1 → 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/bundle/cli.mjs +1006 -1075
- 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
|
|
@@ -376012,7 +376012,7 @@ var require_EventEmitter = __commonJS({
|
|
|
376012
376012
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
376013
376013
|
exports2.EventEmitter = void 0;
|
|
376014
376014
|
var mitt_1 = __importDefault2((init_mitt2(), __toCommonJS(mitt_exports)));
|
|
376015
|
-
var
|
|
376015
|
+
var EventEmitter11 = class {
|
|
376016
376016
|
#emitter = (0, mitt_1.default)();
|
|
376017
376017
|
on(type, handler) {
|
|
376018
376018
|
this.#emitter.on(type, handler);
|
|
@@ -376060,7 +376060,7 @@ var require_EventEmitter = __commonJS({
|
|
|
376060
376060
|
return this;
|
|
376061
376061
|
}
|
|
376062
376062
|
};
|
|
376063
|
-
exports2.EventEmitter =
|
|
376063
|
+
exports2.EventEmitter = EventEmitter11;
|
|
376064
376064
|
}
|
|
376065
376065
|
});
|
|
376066
376066
|
|
|
@@ -429561,6 +429561,24 @@ var init_sessionManager = __esm({
|
|
|
429561
429561
|
writable: true,
|
|
429562
429562
|
value: void 0
|
|
429563
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
|
+
});
|
|
429564
429582
|
Object.defineProperty(this, "lastLoadHookError", {
|
|
429565
429583
|
enumerable: true,
|
|
429566
429584
|
configurable: true,
|
|
@@ -429676,6 +429694,7 @@ var init_sessionManager = __esm({
|
|
|
429676
429694
|
await this.ensureSessionsDir(sessionDate);
|
|
429677
429695
|
const sessionPath = this.getSessionPath(session.id, sessionDate, session.projectId);
|
|
429678
429696
|
await fs27.writeFile(sessionPath, JSON.stringify(session, null, 2));
|
|
429697
|
+
this.invalidateCache();
|
|
429679
429698
|
}
|
|
429680
429699
|
/**
|
|
429681
429700
|
* 清理未完成的 tool_calls
|
|
@@ -429863,7 +429882,10 @@ var init_sessionManager = __esm({
|
|
|
429863
429882
|
} catch (error) {
|
|
429864
429883
|
}
|
|
429865
429884
|
}
|
|
429866
|
-
|
|
429885
|
+
const sorted = sessions.sort((a, b) => b.updatedAt - a.updatedAt);
|
|
429886
|
+
this.sessionListCache = sorted;
|
|
429887
|
+
this.cacheTimestamp = Date.now();
|
|
429888
|
+
return sorted;
|
|
429867
429889
|
} catch (error) {
|
|
429868
429890
|
return [];
|
|
429869
429891
|
}
|
|
@@ -429916,7 +429938,14 @@ var init_sessionManager = __esm({
|
|
|
429916
429938
|
}
|
|
429917
429939
|
}
|
|
429918
429940
|
async listSessionsPaginated(page = 0, pageSize = 20, searchQuery) {
|
|
429919
|
-
|
|
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
|
+
}
|
|
429920
429949
|
const normalizedQuery = searchQuery == null ? void 0 : searchQuery.toLowerCase().trim();
|
|
429921
429950
|
const matchesQuery = (session) => {
|
|
429922
429951
|
var _a21;
|
|
@@ -429927,209 +429956,21 @@ var init_sessionManager = __esm({
|
|
|
429927
429956
|
const idMatch = session.id.toLowerCase().includes(normalizedQuery);
|
|
429928
429957
|
return titleMatch || summaryMatch || idMatch;
|
|
429929
429958
|
};
|
|
429959
|
+
const filtered = normalizedQuery ? allSessions.filter(matchesQuery) : allSessions;
|
|
429960
|
+
const total = filtered.length;
|
|
429930
429961
|
const startIndex = page * pageSize;
|
|
429931
429962
|
const endIndex = startIndex + pageSize;
|
|
429932
|
-
const
|
|
429933
|
-
const heap = [];
|
|
429934
|
-
const heapSwap = (i, j) => {
|
|
429935
|
-
const tmp = heap[i];
|
|
429936
|
-
heap[i] = heap[j];
|
|
429937
|
-
heap[j] = tmp;
|
|
429938
|
-
};
|
|
429939
|
-
const heapSiftUp = (idx2) => {
|
|
429940
|
-
let i = idx2;
|
|
429941
|
-
while (i > 0) {
|
|
429942
|
-
const p = Math.floor((i - 1) / 2);
|
|
429943
|
-
if (heap[p].updatedAt <= heap[i].updatedAt)
|
|
429944
|
-
break;
|
|
429945
|
-
heapSwap(i, p);
|
|
429946
|
-
i = p;
|
|
429947
|
-
}
|
|
429948
|
-
};
|
|
429949
|
-
const heapSiftDown = (idx2) => {
|
|
429950
|
-
let i = idx2;
|
|
429951
|
-
while (true) {
|
|
429952
|
-
const l2 = i * 2 + 1;
|
|
429953
|
-
const r = i * 2 + 2;
|
|
429954
|
-
let smallest = i;
|
|
429955
|
-
if (l2 < heap.length && heap[l2].updatedAt < heap[smallest].updatedAt) {
|
|
429956
|
-
smallest = l2;
|
|
429957
|
-
}
|
|
429958
|
-
if (r < heap.length && heap[r].updatedAt < heap[smallest].updatedAt) {
|
|
429959
|
-
smallest = r;
|
|
429960
|
-
}
|
|
429961
|
-
if (smallest === i)
|
|
429962
|
-
break;
|
|
429963
|
-
heapSwap(i, smallest);
|
|
429964
|
-
i = smallest;
|
|
429965
|
-
}
|
|
429966
|
-
};
|
|
429967
|
-
const heapPush = (item) => {
|
|
429968
|
-
heap.push(item);
|
|
429969
|
-
heapSiftUp(heap.length - 1);
|
|
429970
|
-
};
|
|
429971
|
-
const heapReplaceRoot = (item) => {
|
|
429972
|
-
heap[0] = item;
|
|
429973
|
-
heapSiftDown(0);
|
|
429974
|
-
};
|
|
429975
|
-
const consider = (session) => {
|
|
429976
|
-
if (!matchesQuery(session))
|
|
429977
|
-
return;
|
|
429978
|
-
if (k <= 0)
|
|
429979
|
-
return;
|
|
429980
|
-
const item = { updatedAt: session.updatedAt, session };
|
|
429981
|
-
if (heap.length < k) {
|
|
429982
|
-
heapPush(item);
|
|
429983
|
-
return;
|
|
429984
|
-
}
|
|
429985
|
-
if (heap[0] && item.updatedAt > heap[0].updatedAt) {
|
|
429986
|
-
heapReplaceRoot(item);
|
|
429987
|
-
}
|
|
429988
|
-
};
|
|
429989
|
-
const scanNewFormat = async () => {
|
|
429990
|
-
let total2 = 0;
|
|
429991
|
-
try {
|
|
429992
|
-
const projectDir = this.getProjectSessionsDir();
|
|
429993
|
-
const dateFolders = await fs27.readdir(projectDir);
|
|
429994
|
-
for (const dateFolder of dateFolders) {
|
|
429995
|
-
if (!isDateFolder(dateFolder))
|
|
429996
|
-
continue;
|
|
429997
|
-
const datePath = path35.join(projectDir, dateFolder);
|
|
429998
|
-
let files;
|
|
429999
|
-
try {
|
|
430000
|
-
files = await fs27.readdir(datePath);
|
|
430001
|
-
} catch {
|
|
430002
|
-
continue;
|
|
430003
|
-
}
|
|
430004
|
-
for (const file of files) {
|
|
430005
|
-
if (!file.endsWith(".json"))
|
|
430006
|
-
continue;
|
|
430007
|
-
try {
|
|
430008
|
-
const sessionPath = path35.join(datePath, file);
|
|
430009
|
-
const data = await fs27.readFile(sessionPath, "utf-8");
|
|
430010
|
-
const session = JSON.parse(data);
|
|
430011
|
-
const item = {
|
|
430012
|
-
id: session.id,
|
|
430013
|
-
title: this.cleanTitle(session.title),
|
|
430014
|
-
summary: session.summary,
|
|
430015
|
-
createdAt: session.createdAt,
|
|
430016
|
-
updatedAt: session.updatedAt,
|
|
430017
|
-
messageCount: session.messageCount,
|
|
430018
|
-
projectPath: session.projectPath,
|
|
430019
|
-
projectId: session.projectId,
|
|
430020
|
-
compressedFrom: session.compressedFrom,
|
|
430021
|
-
compressedAt: session.compressedAt
|
|
430022
|
-
};
|
|
430023
|
-
if (!matchesQuery(item))
|
|
430024
|
-
continue;
|
|
430025
|
-
total2 += 1;
|
|
430026
|
-
consider(item);
|
|
430027
|
-
} catch {
|
|
430028
|
-
continue;
|
|
430029
|
-
}
|
|
430030
|
-
}
|
|
430031
|
-
}
|
|
430032
|
-
} catch {
|
|
430033
|
-
return 0;
|
|
430034
|
-
}
|
|
430035
|
-
return total2;
|
|
430036
|
-
};
|
|
430037
|
-
const scanLegacyFormat = async () => {
|
|
430038
|
-
let total2 = 0;
|
|
430039
|
-
try {
|
|
430040
|
-
const files = await fs27.readdir(this.sessionsDir);
|
|
430041
|
-
for (const file of files) {
|
|
430042
|
-
const filePath = path35.join(this.sessionsDir, file);
|
|
430043
|
-
let stat4;
|
|
430044
|
-
try {
|
|
430045
|
-
stat4 = await fs27.stat(filePath);
|
|
430046
|
-
} catch {
|
|
430047
|
-
continue;
|
|
430048
|
-
}
|
|
430049
|
-
if (stat4.isDirectory() && isDateFolder(file) && !isProjectFolder(file)) {
|
|
430050
|
-
let legacyFiles;
|
|
430051
|
-
try {
|
|
430052
|
-
legacyFiles = await fs27.readdir(filePath);
|
|
430053
|
-
} catch {
|
|
430054
|
-
continue;
|
|
430055
|
-
}
|
|
430056
|
-
for (const legacyFile of legacyFiles) {
|
|
430057
|
-
if (!legacyFile.endsWith(".json"))
|
|
430058
|
-
continue;
|
|
430059
|
-
try {
|
|
430060
|
-
const sessionPath = path35.join(filePath, legacyFile);
|
|
430061
|
-
const data = await fs27.readFile(sessionPath, "utf-8");
|
|
430062
|
-
const session = JSON.parse(data);
|
|
430063
|
-
if (session.projectPath && session.projectPath !== this.currentProjectPath) {
|
|
430064
|
-
continue;
|
|
430065
|
-
}
|
|
430066
|
-
if (session.projectId && session.projectId !== this.currentProjectId) {
|
|
430067
|
-
continue;
|
|
430068
|
-
}
|
|
430069
|
-
const item = {
|
|
430070
|
-
id: session.id,
|
|
430071
|
-
title: this.cleanTitle(session.title),
|
|
430072
|
-
summary: session.summary,
|
|
430073
|
-
createdAt: session.createdAt,
|
|
430074
|
-
updatedAt: session.updatedAt,
|
|
430075
|
-
messageCount: session.messageCount,
|
|
430076
|
-
projectPath: session.projectPath,
|
|
430077
|
-
projectId: session.projectId,
|
|
430078
|
-
compressedFrom: session.compressedFrom,
|
|
430079
|
-
compressedAt: session.compressedAt
|
|
430080
|
-
};
|
|
430081
|
-
if (!matchesQuery(item))
|
|
430082
|
-
continue;
|
|
430083
|
-
total2 += 1;
|
|
430084
|
-
consider(item);
|
|
430085
|
-
} catch {
|
|
430086
|
-
continue;
|
|
430087
|
-
}
|
|
430088
|
-
}
|
|
430089
|
-
}
|
|
430090
|
-
if (file.endsWith(".json")) {
|
|
430091
|
-
try {
|
|
430092
|
-
const data = await fs27.readFile(filePath, "utf-8");
|
|
430093
|
-
const session = JSON.parse(data);
|
|
430094
|
-
if (session.projectPath && session.projectPath !== this.currentProjectPath) {
|
|
430095
|
-
continue;
|
|
430096
|
-
}
|
|
430097
|
-
if (session.projectId && session.projectId !== this.currentProjectId) {
|
|
430098
|
-
continue;
|
|
430099
|
-
}
|
|
430100
|
-
const item = {
|
|
430101
|
-
id: session.id,
|
|
430102
|
-
title: this.cleanTitle(session.title),
|
|
430103
|
-
summary: session.summary,
|
|
430104
|
-
createdAt: session.createdAt,
|
|
430105
|
-
updatedAt: session.updatedAt,
|
|
430106
|
-
messageCount: session.messageCount,
|
|
430107
|
-
projectPath: session.projectPath,
|
|
430108
|
-
projectId: session.projectId,
|
|
430109
|
-
compressedFrom: session.compressedFrom,
|
|
430110
|
-
compressedAt: session.compressedAt
|
|
430111
|
-
};
|
|
430112
|
-
if (!matchesQuery(item))
|
|
430113
|
-
continue;
|
|
430114
|
-
total2 += 1;
|
|
430115
|
-
consider(item);
|
|
430116
|
-
} catch {
|
|
430117
|
-
continue;
|
|
430118
|
-
}
|
|
430119
|
-
}
|
|
430120
|
-
}
|
|
430121
|
-
} catch {
|
|
430122
|
-
return 0;
|
|
430123
|
-
}
|
|
430124
|
-
return total2;
|
|
430125
|
-
};
|
|
430126
|
-
const totalNew = await scanNewFormat();
|
|
430127
|
-
const total = totalNew > 0 ? totalNew : await scanLegacyFormat();
|
|
430128
|
-
const topK = heap.map((h) => h.session).sort((a, b) => b.updatedAt - a.updatedAt);
|
|
430129
|
-
const sessions = topK.slice(startIndex, endIndex);
|
|
429963
|
+
const sessions = filtered.slice(startIndex, endIndex);
|
|
430130
429964
|
const hasMore = endIndex < total;
|
|
430131
429965
|
return { sessions, total, hasMore };
|
|
430132
429966
|
}
|
|
429967
|
+
/**
|
|
429968
|
+
* 使缓存失效
|
|
429969
|
+
*/
|
|
429970
|
+
invalidateCache() {
|
|
429971
|
+
this.sessionListCache = null;
|
|
429972
|
+
this.cacheTimestamp = 0;
|
|
429973
|
+
}
|
|
430133
429974
|
async readSessionsFromDir(dirPath, sessions) {
|
|
430134
429975
|
try {
|
|
430135
429976
|
const files = await fs27.readdir(dirPath);
|
|
@@ -430734,6 +430575,36 @@ var init_date_utils = __esm({
|
|
|
430734
430575
|
}
|
|
430735
430576
|
});
|
|
430736
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
|
+
|
|
430737
430608
|
// dist/mcp/todo.js
|
|
430738
430609
|
import fs29 from "fs/promises";
|
|
430739
430610
|
import path37 from "path";
|
|
@@ -430742,6 +430613,7 @@ var init_todo = __esm({
|
|
|
430742
430613
|
"dist/mcp/todo.js"() {
|
|
430743
430614
|
"use strict";
|
|
430744
430615
|
init_date_utils();
|
|
430616
|
+
init_todoEvents();
|
|
430745
430617
|
TodoService = class {
|
|
430746
430618
|
constructor(baseDir, getCurrentSessionId) {
|
|
430747
430619
|
Object.defineProperty(this, "todoDir", {
|
|
@@ -430800,6 +430672,7 @@ var init_todo = __esm({
|
|
|
430800
430672
|
updatedAt: now
|
|
430801
430673
|
};
|
|
430802
430674
|
await fs29.writeFile(todoPath, JSON.stringify(todoList, null, 2));
|
|
430675
|
+
todoEvents.emitTodoUpdate(sessionId, todos);
|
|
430803
430676
|
return todoList;
|
|
430804
430677
|
}
|
|
430805
430678
|
/**
|
|
@@ -535982,88 +535855,6 @@ ${simpleLatexToUnicode(latex)}
|
|
|
535982
535855
|
}
|
|
535983
535856
|
});
|
|
535984
535857
|
|
|
535985
|
-
// dist/ui/components/special/TodoTree.js
|
|
535986
|
-
function TodoTree({ todos }) {
|
|
535987
|
-
const { theme: theme14 } = useTheme();
|
|
535988
|
-
if (todos.length === 0) {
|
|
535989
|
-
return null;
|
|
535990
|
-
}
|
|
535991
|
-
const rootTodos = todos.filter((t) => !t.parentId);
|
|
535992
|
-
const childTodosMap = /* @__PURE__ */ new Map();
|
|
535993
|
-
todos.forEach((todo) => {
|
|
535994
|
-
if (todo.parentId) {
|
|
535995
|
-
const children = childTodosMap.get(todo.parentId) || [];
|
|
535996
|
-
children.push(todo);
|
|
535997
|
-
childTodosMap.set(todo.parentId, children);
|
|
535998
|
-
}
|
|
535999
|
-
});
|
|
536000
|
-
const getStatusIcon = (status) => {
|
|
536001
|
-
switch (status) {
|
|
536002
|
-
case "completed":
|
|
536003
|
-
return "[\u2713]";
|
|
536004
|
-
case "pending":
|
|
536005
|
-
return "[ ]";
|
|
536006
|
-
default:
|
|
536007
|
-
return "[ ]";
|
|
536008
|
-
}
|
|
536009
|
-
};
|
|
536010
|
-
const getStatusColor = (status) => {
|
|
536011
|
-
switch (status) {
|
|
536012
|
-
case "completed":
|
|
536013
|
-
return theme14.colors.success;
|
|
536014
|
-
case "pending":
|
|
536015
|
-
return theme14.colors.menuSecondary;
|
|
536016
|
-
}
|
|
536017
|
-
};
|
|
536018
|
-
const renderTodo = (todo, depth = 0) => {
|
|
536019
|
-
const children = childTodosMap.get(todo.id) || [];
|
|
536020
|
-
const indent = " ".repeat(depth);
|
|
536021
|
-
const statusIcon = getStatusIcon(todo.status);
|
|
536022
|
-
const statusColor = getStatusColor(todo.status);
|
|
536023
|
-
return import_react75.default.createElement(
|
|
536024
|
-
Box_default,
|
|
536025
|
-
{ key: todo.id, flexDirection: "column" },
|
|
536026
|
-
import_react75.default.createElement(
|
|
536027
|
-
Box_default,
|
|
536028
|
-
null,
|
|
536029
|
-
import_react75.default.createElement(
|
|
536030
|
-
Text,
|
|
536031
|
-
{ color: statusColor },
|
|
536032
|
-
indent,
|
|
536033
|
-
statusIcon,
|
|
536034
|
-
" ",
|
|
536035
|
-
todo.content
|
|
536036
|
-
)
|
|
536037
|
-
),
|
|
536038
|
-
children.map((child) => renderTodo(child, depth + 1))
|
|
536039
|
-
);
|
|
536040
|
-
};
|
|
536041
|
-
return import_react75.default.createElement(
|
|
536042
|
-
Box_default,
|
|
536043
|
-
{ flexDirection: "column", borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1, marginBottom: 1 },
|
|
536044
|
-
import_react75.default.createElement(
|
|
536045
|
-
Box_default,
|
|
536046
|
-
{ marginBottom: 0 },
|
|
536047
|
-
import_react75.default.createElement(Text, { bold: true, color: theme14.colors.menuInfo }, "TODO List")
|
|
536048
|
-
),
|
|
536049
|
-
rootTodos.map((todo) => renderTodo(todo)),
|
|
536050
|
-
import_react75.default.createElement(
|
|
536051
|
-
Box_default,
|
|
536052
|
-
{ marginTop: 0 },
|
|
536053
|
-
import_react75.default.createElement(Text, { dimColor: true, color: theme14.colors.menuSecondary }, "[ ] Pending \xB7 [\u2713] Completed")
|
|
536054
|
-
)
|
|
536055
|
-
);
|
|
536056
|
-
}
|
|
536057
|
-
var import_react75;
|
|
536058
|
-
var init_TodoTree = __esm({
|
|
536059
|
-
async "dist/ui/components/special/TodoTree.js"() {
|
|
536060
|
-
"use strict";
|
|
536061
|
-
import_react75 = __toESM(require_react(), 1);
|
|
536062
|
-
await init_build2();
|
|
536063
|
-
init_ThemeContext();
|
|
536064
|
-
}
|
|
536065
|
-
});
|
|
536066
|
-
|
|
536067
535858
|
// dist/ui/components/tools/ToolResultPreview.js
|
|
536068
535859
|
function ToolResultPreview({ toolName, result: result2, maxLines = 5, isSubAgentInternal = false }) {
|
|
536069
535860
|
try {
|
|
@@ -536099,10 +535890,10 @@ function renderSubAgentPreview(data, _maxLines) {
|
|
|
536099
535890
|
if (!data.result)
|
|
536100
535891
|
return null;
|
|
536101
535892
|
const lines = data.result.split("\n").filter((line) => line.trim());
|
|
536102
|
-
return
|
|
535893
|
+
return import_react75.default.createElement(
|
|
536103
535894
|
Box_default,
|
|
536104
535895
|
{ marginLeft: 2 },
|
|
536105
|
-
|
|
535896
|
+
import_react75.default.createElement(
|
|
536106
535897
|
Text,
|
|
536107
535898
|
{ color: "gray", dimColor: true },
|
|
536108
535899
|
"\u2514\u2500 Sub-agent completed (",
|
|
@@ -536118,10 +535909,10 @@ function renderTerminalExecutePreview(data, isSubAgentInternal) {
|
|
|
536118
535909
|
const hasStdout = data.stdout && data.stdout.trim();
|
|
536119
535910
|
const hasStderr = data.stderr && data.stderr.trim();
|
|
536120
535911
|
if (isSubAgentInternal) {
|
|
536121
|
-
return
|
|
535912
|
+
return import_react75.default.createElement(
|
|
536122
535913
|
Box_default,
|
|
536123
535914
|
{ marginLeft: 2 },
|
|
536124
|
-
|
|
535915
|
+
import_react75.default.createElement(
|
|
536125
535916
|
Text,
|
|
536126
535917
|
{ color: hasError ? "red" : "gray", dimColor: true },
|
|
536127
535918
|
"\u2514\u2500 Exit code: ",
|
|
@@ -536134,10 +535925,10 @@ function renderTerminalExecutePreview(data, isSubAgentInternal) {
|
|
|
536134
535925
|
const showFullOutput = hasError;
|
|
536135
535926
|
if (!showFullOutput) {
|
|
536136
535927
|
if (!hasStdout) {
|
|
536137
|
-
return
|
|
535928
|
+
return import_react75.default.createElement(
|
|
536138
535929
|
Box_default,
|
|
536139
535930
|
{ marginLeft: 2 },
|
|
536140
|
-
|
|
535931
|
+
import_react75.default.createElement(
|
|
536141
535932
|
Text,
|
|
536142
535933
|
{ color: "green", dimColor: true },
|
|
536143
535934
|
"\u2514\u2500 \u2713 Exit code: ",
|
|
@@ -536145,33 +535936,33 @@ function renderTerminalExecutePreview(data, isSubAgentInternal) {
|
|
|
536145
535936
|
)
|
|
536146
535937
|
);
|
|
536147
535938
|
}
|
|
536148
|
-
return
|
|
535939
|
+
return import_react75.default.createElement(
|
|
536149
535940
|
Box_default,
|
|
536150
535941
|
{ flexDirection: "column", marginLeft: 2 },
|
|
536151
|
-
|
|
535942
|
+
import_react75.default.createElement(
|
|
536152
535943
|
Box_default,
|
|
536153
535944
|
{ flexDirection: "column" },
|
|
536154
|
-
|
|
536155
|
-
|
|
535945
|
+
import_react75.default.createElement(Text, { color: "green", dimColor: true }, "\u251C\u2500 command:"),
|
|
535946
|
+
import_react75.default.createElement(
|
|
536156
535947
|
Box_default,
|
|
536157
535948
|
{ marginLeft: 2 },
|
|
536158
|
-
|
|
535949
|
+
import_react75.default.createElement(Text, { color: "green" }, data.command)
|
|
536159
535950
|
)
|
|
536160
535951
|
),
|
|
536161
|
-
|
|
535952
|
+
import_react75.default.createElement(
|
|
536162
535953
|
Text,
|
|
536163
535954
|
{ color: "green", dimColor: true },
|
|
536164
535955
|
"\u251C\u2500 exitCode: ",
|
|
536165
535956
|
data.exitCode,
|
|
536166
535957
|
" \u2713"
|
|
536167
535958
|
),
|
|
536168
|
-
|
|
535959
|
+
import_react75.default.createElement(
|
|
536169
535960
|
Box_default,
|
|
536170
535961
|
{ flexDirection: "column" },
|
|
536171
|
-
|
|
536172
|
-
|
|
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)))
|
|
536173
535964
|
),
|
|
536174
|
-
|
|
535965
|
+
import_react75.default.createElement(
|
|
536175
535966
|
Text,
|
|
536176
535967
|
{ color: "gray", dimColor: true },
|
|
536177
535968
|
"\u2514\u2500 executedAt: ",
|
|
@@ -536179,39 +535970,39 @@ function renderTerminalExecutePreview(data, isSubAgentInternal) {
|
|
|
536179
535970
|
)
|
|
536180
535971
|
);
|
|
536181
535972
|
}
|
|
536182
|
-
return
|
|
535973
|
+
return import_react75.default.createElement(
|
|
536183
535974
|
Box_default,
|
|
536184
535975
|
{ flexDirection: "column", marginLeft: 2 },
|
|
536185
|
-
|
|
535976
|
+
import_react75.default.createElement(
|
|
536186
535977
|
Box_default,
|
|
536187
535978
|
{ flexDirection: "column" },
|
|
536188
|
-
|
|
536189
|
-
|
|
535979
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u251C\u2500 command:"),
|
|
535980
|
+
import_react75.default.createElement(
|
|
536190
535981
|
Box_default,
|
|
536191
535982
|
{ marginLeft: 2 },
|
|
536192
|
-
|
|
535983
|
+
import_react75.default.createElement(Text, { color: "gray" }, data.command)
|
|
536193
535984
|
)
|
|
536194
535985
|
),
|
|
536195
|
-
|
|
535986
|
+
import_react75.default.createElement(
|
|
536196
535987
|
Text,
|
|
536197
535988
|
{ color: "red", bold: true },
|
|
536198
535989
|
"\u251C\u2500 exitCode: ",
|
|
536199
535990
|
data.exitCode,
|
|
536200
535991
|
" FAILED"
|
|
536201
535992
|
),
|
|
536202
|
-
hasStdout &&
|
|
535993
|
+
hasStdout && import_react75.default.createElement(
|
|
536203
535994
|
Box_default,
|
|
536204
535995
|
{ flexDirection: "column" },
|
|
536205
|
-
|
|
536206
|
-
|
|
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)))
|
|
536207
535998
|
),
|
|
536208
|
-
hasStderr &&
|
|
535999
|
+
hasStderr && import_react75.default.createElement(
|
|
536209
536000
|
Box_default,
|
|
536210
536001
|
{ flexDirection: "column" },
|
|
536211
|
-
|
|
536212
|
-
|
|
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)))
|
|
536213
536004
|
),
|
|
536214
|
-
data.executedAt &&
|
|
536005
|
+
data.executedAt && import_react75.default.createElement(
|
|
536215
536006
|
Text,
|
|
536216
536007
|
{ color: "gray", dimColor: true },
|
|
536217
536008
|
"\u2514\u2500 executedAt: ",
|
|
@@ -536226,10 +536017,10 @@ function renderReadPreview(data, isSubAgentInternal) {
|
|
|
536226
536017
|
const readLineCount = lines.length;
|
|
536227
536018
|
const totalLines = data.totalLines || readLineCount;
|
|
536228
536019
|
if (isSubAgentInternal) {
|
|
536229
|
-
return
|
|
536020
|
+
return import_react75.default.createElement(
|
|
536230
536021
|
Box_default,
|
|
536231
536022
|
{ marginLeft: 2 },
|
|
536232
|
-
|
|
536023
|
+
import_react75.default.createElement(
|
|
536233
536024
|
Text,
|
|
536234
536025
|
{ color: "gray", dimColor: true },
|
|
536235
536026
|
"\u2514\u2500 Read ",
|
|
@@ -536240,10 +536031,10 @@ function renderReadPreview(data, isSubAgentInternal) {
|
|
|
536240
536031
|
);
|
|
536241
536032
|
}
|
|
536242
536033
|
const rangeInfo = data.startLine && data.endLine ? ` (lines ${data.startLine}-${data.endLine})` : "";
|
|
536243
|
-
return
|
|
536034
|
+
return import_react75.default.createElement(
|
|
536244
536035
|
Box_default,
|
|
536245
536036
|
{ marginLeft: 2 },
|
|
536246
|
-
|
|
536037
|
+
import_react75.default.createElement(
|
|
536247
536038
|
Text,
|
|
536248
536039
|
{ color: "gray", dimColor: true },
|
|
536249
536040
|
"\u2514\u2500 Read ",
|
|
@@ -536258,17 +536049,17 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536258
536049
|
var _a21, _b14, _c6, _d4, _e2, _f;
|
|
536259
536050
|
if (toolName === "ace-text-search" || toolName === "ace-text_search") {
|
|
536260
536051
|
if (!data || data.length === 0) {
|
|
536261
|
-
return
|
|
536052
|
+
return import_react75.default.createElement(
|
|
536262
536053
|
Box_default,
|
|
536263
536054
|
{ marginLeft: 2 },
|
|
536264
|
-
|
|
536055
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No matches found")
|
|
536265
536056
|
);
|
|
536266
536057
|
}
|
|
536267
536058
|
const results = Array.isArray(data) ? data : [];
|
|
536268
|
-
return
|
|
536059
|
+
return import_react75.default.createElement(
|
|
536269
536060
|
Box_default,
|
|
536270
536061
|
{ marginLeft: 2 },
|
|
536271
|
-
|
|
536062
|
+
import_react75.default.createElement(
|
|
536272
536063
|
Text,
|
|
536273
536064
|
{ color: "gray", dimColor: true },
|
|
536274
536065
|
"\u2514\u2500 Found ",
|
|
@@ -536281,16 +536072,16 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536281
536072
|
if (toolName === "ace-search-symbols" || toolName === "ace-search_symbols") {
|
|
536282
536073
|
const symbols2 = data.symbols || [];
|
|
536283
536074
|
if (symbols2.length === 0) {
|
|
536284
|
-
return
|
|
536075
|
+
return import_react75.default.createElement(
|
|
536285
536076
|
Box_default,
|
|
536286
536077
|
{ marginLeft: 2 },
|
|
536287
|
-
|
|
536078
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No symbols found")
|
|
536288
536079
|
);
|
|
536289
536080
|
}
|
|
536290
|
-
return
|
|
536081
|
+
return import_react75.default.createElement(
|
|
536291
536082
|
Box_default,
|
|
536292
536083
|
{ marginLeft: 2 },
|
|
536293
|
-
|
|
536084
|
+
import_react75.default.createElement(
|
|
536294
536085
|
Text,
|
|
536295
536086
|
{ color: "gray", dimColor: true },
|
|
536296
536087
|
"\u2514\u2500 Found ",
|
|
@@ -536303,16 +536094,16 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536303
536094
|
if (toolName === "ace-find-references" || toolName === "ace-find_references") {
|
|
536304
536095
|
const references = Array.isArray(data) ? data : [];
|
|
536305
536096
|
if (references.length === 0) {
|
|
536306
|
-
return
|
|
536097
|
+
return import_react75.default.createElement(
|
|
536307
536098
|
Box_default,
|
|
536308
536099
|
{ marginLeft: 2 },
|
|
536309
|
-
|
|
536100
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No references found")
|
|
536310
536101
|
);
|
|
536311
536102
|
}
|
|
536312
|
-
return
|
|
536103
|
+
return import_react75.default.createElement(
|
|
536313
536104
|
Box_default,
|
|
536314
536105
|
{ marginLeft: 2 },
|
|
536315
|
-
|
|
536106
|
+
import_react75.default.createElement(
|
|
536316
536107
|
Text,
|
|
536317
536108
|
{ color: "gray", dimColor: true },
|
|
536318
536109
|
"\u2514\u2500 Found ",
|
|
@@ -536324,16 +536115,16 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536324
536115
|
}
|
|
536325
536116
|
if (toolName === "ace-find-definition" || toolName === "ace-find_definition") {
|
|
536326
536117
|
if (!data) {
|
|
536327
|
-
return
|
|
536118
|
+
return import_react75.default.createElement(
|
|
536328
536119
|
Box_default,
|
|
536329
536120
|
{ marginLeft: 2 },
|
|
536330
|
-
|
|
536121
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 Definition not found")
|
|
536331
536122
|
);
|
|
536332
536123
|
}
|
|
536333
|
-
return
|
|
536124
|
+
return import_react75.default.createElement(
|
|
536334
536125
|
Box_default,
|
|
536335
536126
|
{ marginLeft: 2 },
|
|
536336
|
-
|
|
536127
|
+
import_react75.default.createElement(
|
|
536337
536128
|
Text,
|
|
536338
536129
|
{ color: "gray", dimColor: true },
|
|
536339
536130
|
"\u2514\u2500 Found ",
|
|
@@ -536350,16 +536141,16 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536350
536141
|
if (toolName === "ace-file-outline" || toolName === "ace-file_outline") {
|
|
536351
536142
|
const symbols2 = Array.isArray(data) ? data : [];
|
|
536352
536143
|
if (symbols2.length === 0) {
|
|
536353
|
-
return
|
|
536144
|
+
return import_react75.default.createElement(
|
|
536354
536145
|
Box_default,
|
|
536355
536146
|
{ marginLeft: 2 },
|
|
536356
|
-
|
|
536147
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No symbols in file")
|
|
536357
536148
|
);
|
|
536358
536149
|
}
|
|
536359
|
-
return
|
|
536150
|
+
return import_react75.default.createElement(
|
|
536360
536151
|
Box_default,
|
|
536361
536152
|
{ marginLeft: 2 },
|
|
536362
|
-
|
|
536153
|
+
import_react75.default.createElement(
|
|
536363
536154
|
Text,
|
|
536364
536155
|
{ color: "gray", dimColor: true },
|
|
536365
536156
|
"\u2514\u2500 Found ",
|
|
@@ -536373,16 +536164,16 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536373
536164
|
if (toolName === "ace-semantic-search" || toolName === "ace-semantic_search") {
|
|
536374
536165
|
const totalResults = (((_a21 = data.symbols) == null ? void 0 : _a21.length) || 0) + (((_b14 = data.references) == null ? void 0 : _b14.length) || 0);
|
|
536375
536166
|
if (totalResults === 0) {
|
|
536376
|
-
return
|
|
536167
|
+
return import_react75.default.createElement(
|
|
536377
536168
|
Box_default,
|
|
536378
536169
|
{ marginLeft: 2 },
|
|
536379
|
-
|
|
536170
|
+
import_react75.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No results found")
|
|
536380
536171
|
);
|
|
536381
536172
|
}
|
|
536382
|
-
return
|
|
536173
|
+
return import_react75.default.createElement(
|
|
536383
536174
|
Box_default,
|
|
536384
536175
|
{ flexDirection: "column", marginLeft: 2 },
|
|
536385
|
-
|
|
536176
|
+
import_react75.default.createElement(
|
|
536386
536177
|
Text,
|
|
536387
536178
|
{ color: "gray", dimColor: true },
|
|
536388
536179
|
"\u251C\u2500 ",
|
|
@@ -536390,7 +536181,7 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536390
536181
|
" ",
|
|
536391
536182
|
(((_d4 = data.symbols) == null ? void 0 : _d4.length) || 0) === 1 ? "symbol" : "symbols"
|
|
536392
536183
|
),
|
|
536393
|
-
|
|
536184
|
+
import_react75.default.createElement(
|
|
536394
536185
|
Text,
|
|
536395
536186
|
{ color: "gray", dimColor: true },
|
|
536396
536187
|
"\u2514\u2500 ",
|
|
@@ -536403,10 +536194,10 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
536403
536194
|
return renderGenericPreview(data, maxLines);
|
|
536404
536195
|
}
|
|
536405
536196
|
function renderCreatePreview(data) {
|
|
536406
|
-
return
|
|
536197
|
+
return import_react75.default.createElement(
|
|
536407
536198
|
Box_default,
|
|
536408
536199
|
{ marginLeft: 2 },
|
|
536409
|
-
|
|
536200
|
+
import_react75.default.createElement(
|
|
536410
536201
|
Text,
|
|
536411
536202
|
{ color: "gray", dimColor: true },
|
|
536412
536203
|
"\u2514\u2500 ",
|
|
@@ -536415,16 +536206,16 @@ function renderCreatePreview(data) {
|
|
|
536415
536206
|
);
|
|
536416
536207
|
}
|
|
536417
536208
|
function renderEditSearchPreview(data) {
|
|
536418
|
-
return
|
|
536209
|
+
return import_react75.default.createElement(
|
|
536419
536210
|
Box_default,
|
|
536420
536211
|
{ flexDirection: "column", marginLeft: 2 },
|
|
536421
|
-
data.message &&
|
|
536212
|
+
data.message && import_react75.default.createElement(
|
|
536422
536213
|
Text,
|
|
536423
536214
|
{ color: "gray", dimColor: true },
|
|
536424
536215
|
"\u251C\u2500 ",
|
|
536425
536216
|
data.message
|
|
536426
536217
|
),
|
|
536427
|
-
data.matchLocation &&
|
|
536218
|
+
data.matchLocation && import_react75.default.createElement(
|
|
536428
536219
|
Text,
|
|
536429
536220
|
{ color: "gray", dimColor: true },
|
|
536430
536221
|
"\u251C\u2500 Match: lines ",
|
|
@@ -536432,7 +536223,7 @@ function renderEditSearchPreview(data) {
|
|
|
536432
536223
|
"-",
|
|
536433
536224
|
data.matchLocation.endLine
|
|
536434
536225
|
),
|
|
536435
|
-
data.totalLines &&
|
|
536226
|
+
data.totalLines && import_react75.default.createElement(
|
|
536436
536227
|
Text,
|
|
536437
536228
|
{ color: "gray", dimColor: true },
|
|
536438
536229
|
"\u2514\u2500 Total lines: ",
|
|
@@ -536442,10 +536233,10 @@ function renderEditSearchPreview(data) {
|
|
|
536442
536233
|
}
|
|
536443
536234
|
function renderWebSearchPreview(data, _maxLines) {
|
|
536444
536235
|
if (!data.results || data.results.length === 0) {
|
|
536445
|
-
return
|
|
536236
|
+
return import_react75.default.createElement(
|
|
536446
536237
|
Box_default,
|
|
536447
536238
|
{ marginLeft: 2 },
|
|
536448
|
-
|
|
536239
|
+
import_react75.default.createElement(
|
|
536449
536240
|
Text,
|
|
536450
536241
|
{ color: "gray", dimColor: true },
|
|
536451
536242
|
'\u2514\u2500 No results for "',
|
|
@@ -536454,10 +536245,10 @@ function renderWebSearchPreview(data, _maxLines) {
|
|
|
536454
536245
|
)
|
|
536455
536246
|
);
|
|
536456
536247
|
}
|
|
536457
|
-
return
|
|
536248
|
+
return import_react75.default.createElement(
|
|
536458
536249
|
Box_default,
|
|
536459
536250
|
{ marginLeft: 2 },
|
|
536460
|
-
|
|
536251
|
+
import_react75.default.createElement(
|
|
536461
536252
|
Text,
|
|
536462
536253
|
{ color: "gray", dimColor: true },
|
|
536463
536254
|
"\u2514\u2500 Found ",
|
|
@@ -536471,10 +536262,10 @@ function renderWebSearchPreview(data, _maxLines) {
|
|
|
536471
536262
|
function renderWebFetchPreview(data) {
|
|
536472
536263
|
var _a21;
|
|
536473
536264
|
const contentLength = data.textLength || ((_a21 = data.content) == null ? void 0 : _a21.length) || 0;
|
|
536474
|
-
return
|
|
536265
|
+
return import_react75.default.createElement(
|
|
536475
536266
|
Box_default,
|
|
536476
536267
|
{ marginLeft: 2 },
|
|
536477
|
-
|
|
536268
|
+
import_react75.default.createElement(
|
|
536478
536269
|
Text,
|
|
536479
536270
|
{ color: "gray", dimColor: true },
|
|
536480
536271
|
"\u2514\u2500 Fetched ",
|
|
@@ -536491,9 +536282,9 @@ function renderGenericPreview(data, maxLines) {
|
|
|
536491
536282
|
const entries = Object.entries(data).slice(0, maxLines);
|
|
536492
536283
|
if (entries.length === 0)
|
|
536493
536284
|
return null;
|
|
536494
|
-
return
|
|
536285
|
+
return import_react75.default.createElement(Box_default, { flexDirection: "column", marginLeft: 2 }, entries.map(([key, value], idx2) => {
|
|
536495
536286
|
const valueStr = typeof value === "string" ? value.slice(0, 20) + (value.length > 20 ? "..." : "") : JSON.stringify(value).slice(0, 60);
|
|
536496
|
-
return
|
|
536287
|
+
return import_react75.default.createElement(
|
|
536497
536288
|
Text,
|
|
536498
536289
|
{ key: idx2, color: "gray", dimColor: true },
|
|
536499
536290
|
idx2 === entries.length - 1 ? "\u2514\u2500 " : "\u251C\u2500 ",
|
|
@@ -536509,10 +536300,10 @@ function renderTodoPreview(_toolName, data, _maxLines) {
|
|
|
536509
536300
|
if (data.content && Array.isArray(data.content) && ((_a21 = data.content[0]) == null ? void 0 : _a21.text)) {
|
|
536510
536301
|
const textContent = data.content[0].text;
|
|
536511
536302
|
if (textContent === "No TODO list found" || textContent === "TODO item not found") {
|
|
536512
|
-
return
|
|
536303
|
+
return import_react75.default.createElement(
|
|
536513
536304
|
Box_default,
|
|
536514
536305
|
{ marginLeft: 2 },
|
|
536515
|
-
|
|
536306
|
+
import_react75.default.createElement(
|
|
536516
536307
|
Text,
|
|
536517
536308
|
{ color: "gray", dimColor: true },
|
|
536518
536309
|
"\u2514\u2500 ",
|
|
@@ -536523,10 +536314,10 @@ function renderTodoPreview(_toolName, data, _maxLines) {
|
|
|
536523
536314
|
try {
|
|
536524
536315
|
todoData = JSON.parse(textContent);
|
|
536525
536316
|
} catch (e) {
|
|
536526
|
-
return
|
|
536317
|
+
return import_react75.default.createElement(
|
|
536527
536318
|
Box_default,
|
|
536528
536319
|
{ marginLeft: 2 },
|
|
536529
|
-
|
|
536320
|
+
import_react75.default.createElement(
|
|
536530
536321
|
Text,
|
|
536531
536322
|
{ color: "gray", dimColor: true },
|
|
536532
536323
|
"\u2514\u2500 ",
|
|
@@ -536536,10 +536327,10 @@ function renderTodoPreview(_toolName, data, _maxLines) {
|
|
|
536536
536327
|
}
|
|
536537
536328
|
}
|
|
536538
536329
|
if (!todoData.todos || !Array.isArray(todoData.todos)) {
|
|
536539
|
-
return
|
|
536330
|
+
return import_react75.default.createElement(
|
|
536540
536331
|
Box_default,
|
|
536541
536332
|
{ marginLeft: 2 },
|
|
536542
|
-
|
|
536333
|
+
import_react75.default.createElement(
|
|
536543
536334
|
Text,
|
|
536544
536335
|
{ color: "gray", dimColor: true },
|
|
536545
536336
|
"\u2514\u2500 ",
|
|
@@ -536547,24 +536338,41 @@ function renderTodoPreview(_toolName, data, _maxLines) {
|
|
|
536547
536338
|
)
|
|
536548
536339
|
);
|
|
536549
536340
|
}
|
|
536550
|
-
|
|
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
|
+
);
|
|
536551
536360
|
}
|
|
536552
|
-
var
|
|
536361
|
+
var import_react75;
|
|
536553
536362
|
var init_ToolResultPreview = __esm({
|
|
536554
536363
|
async "dist/ui/components/tools/ToolResultPreview.js"() {
|
|
536555
536364
|
"use strict";
|
|
536556
|
-
|
|
536365
|
+
import_react75 = __toESM(require_react(), 1);
|
|
536557
536366
|
await init_build2();
|
|
536558
|
-
await init_TodoTree();
|
|
536559
536367
|
}
|
|
536560
536368
|
});
|
|
536561
536369
|
|
|
536562
536370
|
// dist/ui/components/special/HookErrorDisplay.js
|
|
536563
|
-
var
|
|
536371
|
+
var import_react76, truncate, HookErrorDisplay;
|
|
536564
536372
|
var init_HookErrorDisplay = __esm({
|
|
536565
536373
|
async "dist/ui/components/special/HookErrorDisplay.js"() {
|
|
536566
536374
|
"use strict";
|
|
536567
|
-
|
|
536375
|
+
import_react76 = __toESM(require_react(), 1);
|
|
536568
536376
|
await init_build2();
|
|
536569
536377
|
truncate = (text3, maxLength) => {
|
|
536570
536378
|
if (text3.length <= maxLength)
|
|
@@ -536577,21 +536385,21 @@ var init_HookErrorDisplay = __esm({
|
|
|
536577
536385
|
const truncatedCommand = truncate(command, 150);
|
|
536578
536386
|
const truncatedOutput = truncate(combinedOutput, 300);
|
|
536579
536387
|
const title = type === "warning" ? "Hook Command Warning" : `Hook Command Failed (Exit Code ${exitCode})`;
|
|
536580
|
-
return
|
|
536388
|
+
return import_react76.default.createElement(
|
|
536581
536389
|
Box_default,
|
|
536582
536390
|
{ flexDirection: "column" },
|
|
536583
|
-
|
|
536584
|
-
|
|
536391
|
+
import_react76.default.createElement(Text, { bold: true, color: "red" }, title),
|
|
536392
|
+
import_react76.default.createElement(
|
|
536585
536393
|
Box_default,
|
|
536586
536394
|
{ marginLeft: 1 },
|
|
536587
|
-
|
|
536588
|
-
|
|
536395
|
+
import_react76.default.createElement(Text, { dimColor: true }, "\u251C\u2500 "),
|
|
536396
|
+
import_react76.default.createElement(Text, null, truncatedCommand)
|
|
536589
536397
|
),
|
|
536590
|
-
|
|
536398
|
+
import_react76.default.createElement(
|
|
536591
536399
|
Box_default,
|
|
536592
536400
|
{ marginLeft: 1 },
|
|
536593
|
-
|
|
536594
|
-
|
|
536401
|
+
import_react76.default.createElement(Text, { dimColor: true }, "\u2514\u2500 "),
|
|
536402
|
+
import_react76.default.createElement(Text, null, truncatedOutput)
|
|
536595
536403
|
)
|
|
536596
536404
|
);
|
|
536597
536405
|
};
|
|
@@ -536630,44 +536438,44 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
|
|
|
536630
536438
|
toolStatusColor = message.role === "subagent" ? "magenta" : "blue";
|
|
536631
536439
|
}
|
|
536632
536440
|
}
|
|
536633
|
-
return
|
|
536634
|
-
|
|
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,
|
|
536635
536443
|
null,
|
|
536636
|
-
isFirstInGroup &&
|
|
536444
|
+
isFirstInGroup && import_react77.default.createElement(
|
|
536637
536445
|
Box_default,
|
|
536638
536446
|
{ marginBottom: 0 },
|
|
536639
|
-
|
|
536447
|
+
import_react77.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, "\u250C\u2500 Parallel execution")
|
|
536640
536448
|
),
|
|
536641
|
-
|
|
536449
|
+
import_react77.default.createElement(
|
|
536642
536450
|
Box_default,
|
|
536643
536451
|
null,
|
|
536644
|
-
|
|
536452
|
+
import_react77.default.createElement(
|
|
536645
536453
|
Text,
|
|
536646
536454
|
{ color: message.role === "user" ? "green" : message.role === "command" ? theme14.colors.menuSecondary : toolStatusColor, bold: true },
|
|
536647
536455
|
shouldShowParallelIndicator && !isFirstInGroup ? "\u2502" : "",
|
|
536648
536456
|
message.role === "user" ? "\u276F" : message.role === "command" ? "\u2318" : "\u2746"
|
|
536649
536457
|
),
|
|
536650
|
-
|
|
536651
|
-
|
|
536458
|
+
import_react77.default.createElement(Box_default, { marginLeft: 1, flexDirection: "column" }, message.role === "command" ? import_react77.default.createElement(
|
|
536459
|
+
import_react77.default.Fragment,
|
|
536652
536460
|
null,
|
|
536653
|
-
!message.hideCommandName &&
|
|
536461
|
+
!message.hideCommandName && import_react77.default.createElement(
|
|
536654
536462
|
Text,
|
|
536655
536463
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
536656
536464
|
"\u2514\u2500 ",
|
|
536657
536465
|
message.commandName
|
|
536658
536466
|
),
|
|
536659
|
-
message.content &&
|
|
536660
|
-
) :
|
|
536661
|
-
|
|
536467
|
+
message.content && import_react77.default.createElement(Text, { color: "white" }, removeAnsiCodes(message.content))
|
|
536468
|
+
) : import_react77.default.createElement(
|
|
536469
|
+
import_react77.default.Fragment,
|
|
536662
536470
|
null,
|
|
536663
|
-
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 || " ")) : (() => {
|
|
536664
536472
|
if (message.hookError) {
|
|
536665
|
-
return
|
|
536473
|
+
return import_react77.default.createElement(HookErrorDisplay, { details: message.hookError });
|
|
536666
536474
|
}
|
|
536667
536475
|
try {
|
|
536668
536476
|
const parsed = JSON.parse(message.content);
|
|
536669
536477
|
if (parsed.type === "hook-error") {
|
|
536670
|
-
return
|
|
536478
|
+
return import_react77.default.createElement(HookErrorDisplay, { details: {
|
|
536671
536479
|
type: "error",
|
|
536672
536480
|
exitCode: parsed.exitCode,
|
|
536673
536481
|
command: parsed.command,
|
|
@@ -536679,17 +536487,17 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
|
|
|
536679
536487
|
}
|
|
536680
536488
|
const hasToolStatus = message.messageStatus !== void 0;
|
|
536681
536489
|
if (hasToolStatus && (message.role === "assistant" || message.role === "subagent")) {
|
|
536682
|
-
return
|
|
536490
|
+
return import_react77.default.createElement(Text, { color: toolStatusColor }, removeAnsiCodes(message.content || " "));
|
|
536683
536491
|
}
|
|
536684
|
-
return
|
|
536685
|
-
|
|
536492
|
+
return import_react77.default.createElement(
|
|
536493
|
+
import_react77.default.Fragment,
|
|
536686
536494
|
null,
|
|
536687
|
-
message.thinking && showThinking &&
|
|
536495
|
+
message.thinking && showThinking && import_react77.default.createElement(
|
|
536688
536496
|
Box_default,
|
|
536689
536497
|
{ flexDirection: "column", marginBottom: 1 },
|
|
536690
|
-
|
|
536498
|
+
import_react77.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true, italic: true }, message.thinking)
|
|
536691
536499
|
),
|
|
536692
|
-
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 || " " })
|
|
536693
536501
|
);
|
|
536694
536502
|
})(),
|
|
536695
536503
|
message.subAgentUsage && (() => {
|
|
@@ -536698,7 +536506,7 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
|
|
|
536698
536506
|
return `${(num / 1e3).toFixed(1)}K`;
|
|
536699
536507
|
return num.toString();
|
|
536700
536508
|
};
|
|
536701
|
-
return
|
|
536509
|
+
return import_react77.default.createElement(
|
|
536702
536510
|
Text,
|
|
536703
536511
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
536704
536512
|
"\u2514\u2500 Usage: In=",
|
|
@@ -536710,7 +536518,7 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
|
|
|
536710
536518
|
);
|
|
536711
536519
|
})(),
|
|
536712
536520
|
message.toolDisplay && message.toolDisplay.args.length > 0 && // Hide tool arguments for sub-agent internal tools
|
|
536713
|
-
!message.subAgentInternal &&
|
|
536521
|
+
!message.subAgentInternal && import_react77.default.createElement(Box_default, { flexDirection: "column" }, message.toolDisplay.args.map((arg, argIndex) => import_react77.default.createElement(
|
|
536714
536522
|
Text,
|
|
536715
536523
|
{ key: argIndex, color: theme14.colors.menuSecondary, dimColor: true },
|
|
536716
536524
|
arg.isLast ? "\u2514\u2500" : "\u251C\u2500",
|
|
@@ -536719,63 +536527,63 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
|
|
|
536719
536527
|
": ",
|
|
536720
536528
|
arg.value
|
|
536721
536529
|
))),
|
|
536722
|
-
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(
|
|
536723
536531
|
Box_default,
|
|
536724
536532
|
{ marginTop: 1 },
|
|
536725
|
-
|
|
536533
|
+
import_react77.default.createElement(DiffViewer, { newContent: message.toolCall.arguments.content, filename: message.toolCall.arguments.path })
|
|
536726
536534
|
),
|
|
536727
|
-
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(
|
|
536728
536536
|
Box_default,
|
|
536729
536537
|
{ marginTop: 1 },
|
|
536730
|
-
|
|
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 })
|
|
536731
536539
|
),
|
|
536732
|
-
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(
|
|
536733
536541
|
Box_default,
|
|
536734
536542
|
{ marginTop: 1 },
|
|
536735
|
-
|
|
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 })
|
|
536736
536544
|
),
|
|
536737
|
-
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) => {
|
|
536738
536546
|
if (fileResult.success && fileResult.oldContent && fileResult.newContent) {
|
|
536739
|
-
return
|
|
536547
|
+
return import_react77.default.createElement(
|
|
536740
536548
|
Box_default,
|
|
536741
536549
|
{ key: index2, flexDirection: "column", marginBottom: 1 },
|
|
536742
|
-
|
|
536743
|
-
|
|
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 })
|
|
536744
536552
|
);
|
|
536745
536553
|
}
|
|
536746
536554
|
return null;
|
|
536747
536555
|
})),
|
|
536748
536556
|
message.messageStatus === "success" && message.toolResult && // 只在没有 diff 数据时显示预览(有 diff 的工具会用 DiffViewer 显示)
|
|
536749
|
-
!(message.toolCall && (((_d4 = message.toolCall.arguments) == null ? void 0 : _d4.oldContent) || ((_e2 = message.toolCall.arguments) == null ? void 0 : _e2.batchResults))) &&
|
|
536750
|
-
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(
|
|
536751
536559
|
Text,
|
|
536752
536560
|
{ key: fileIndex, color: theme14.colors.menuSecondary, dimColor: true },
|
|
536753
536561
|
"\u2514\u2500 ",
|
|
536754
536562
|
file.path,
|
|
536755
536563
|
file.exists ? ` (total line ${file.lineCount})` : " (file not found)"
|
|
536756
536564
|
))),
|
|
536757
|
-
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(
|
|
536758
536566
|
Text,
|
|
536759
536567
|
{ key: imageIndex, color: theme14.colors.menuSecondary, dimColor: true },
|
|
536760
536568
|
"\u2514\u2500 [image #",
|
|
536761
536569
|
imageIndex + 1,
|
|
536762
536570
|
"]"
|
|
536763
536571
|
))),
|
|
536764
|
-
message.discontinued &&
|
|
536572
|
+
message.discontinued && import_react77.default.createElement(Text, { color: "red", bold: true }, t.chatScreen.discontinuedMessage)
|
|
536765
536573
|
))
|
|
536766
536574
|
),
|
|
536767
|
-
!message.plainOutput && isLastInGroup &&
|
|
536575
|
+
!message.plainOutput && isLastInGroup && import_react77.default.createElement(
|
|
536768
536576
|
Box_default,
|
|
536769
536577
|
{ marginTop: 0 },
|
|
536770
|
-
|
|
536578
|
+
import_react77.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, "\u2514\u2500 End parallel execution")
|
|
536771
536579
|
)
|
|
536772
536580
|
));
|
|
536773
536581
|
}
|
|
536774
|
-
var
|
|
536582
|
+
var import_react77;
|
|
536775
536583
|
var init_MessageRenderer = __esm({
|
|
536776
536584
|
async "dist/ui/components/chat/MessageRenderer.js"() {
|
|
536777
536585
|
"use strict";
|
|
536778
|
-
|
|
536586
|
+
import_react77 = __toESM(require_react(), 1);
|
|
536779
536587
|
await init_build2();
|
|
536780
536588
|
init_ThemeContext();
|
|
536781
536589
|
init_I18nContext();
|
|
@@ -536789,18 +536597,18 @@ var init_MessageRenderer = __esm({
|
|
|
536789
536597
|
// dist/ui/components/chat/UserMessagePreview.js
|
|
536790
536598
|
function UserMessagePreview({ content }) {
|
|
536791
536599
|
const { columns: terminalWidth } = useTerminalSize();
|
|
536792
|
-
const message = (0,
|
|
536600
|
+
const message = (0, import_react78.useMemo)(() => ({
|
|
536793
536601
|
role: "user",
|
|
536794
536602
|
content
|
|
536795
536603
|
}), [content]);
|
|
536796
|
-
const filteredMessages = (0,
|
|
536797
|
-
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 });
|
|
536798
536606
|
}
|
|
536799
|
-
var
|
|
536607
|
+
var import_react78;
|
|
536800
536608
|
var init_UserMessagePreview = __esm({
|
|
536801
536609
|
async "dist/ui/components/chat/UserMessagePreview.js"() {
|
|
536802
536610
|
"use strict";
|
|
536803
|
-
|
|
536611
|
+
import_react78 = __toESM(require_react(), 1);
|
|
536804
536612
|
init_useTerminalSize();
|
|
536805
536613
|
await init_MessageRenderer();
|
|
536806
536614
|
}
|
|
@@ -536815,14 +536623,14 @@ function CustomThemeScreen({ onBack }) {
|
|
|
536815
536623
|
var _a21, _b14, _c6, _d4, _e2, _f, _g, _h, _i, _j;
|
|
536816
536624
|
const { setThemeType, refreshCustomTheme } = useTheme();
|
|
536817
536625
|
const { t } = useI18n();
|
|
536818
|
-
const [colors, setColors] = (0,
|
|
536626
|
+
const [colors, setColors] = (0, import_react79.useState)(() => {
|
|
536819
536627
|
const custom2 = getCustomTheme();
|
|
536820
536628
|
return custom2.colors;
|
|
536821
536629
|
});
|
|
536822
|
-
const [editingKey, setEditingKey] = (0,
|
|
536823
|
-
const [editValue, setEditValue] = (0,
|
|
536824
|
-
const [infoText, setInfoText] = (0,
|
|
536825
|
-
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)(() => {
|
|
536826
536634
|
var _a22, _b15, _c7, _d5, _e3, _f2;
|
|
536827
536635
|
const options3 = colorKeys.map((key) => {
|
|
536828
536636
|
var _a23;
|
|
@@ -536849,13 +536657,13 @@ function CustomThemeScreen({ onBack }) {
|
|
|
536849
536657
|
});
|
|
536850
536658
|
return options3;
|
|
536851
536659
|
}, [colors, t]);
|
|
536852
|
-
const saveAndExit = (0,
|
|
536660
|
+
const saveAndExit = (0, import_react79.useCallback)(() => {
|
|
536853
536661
|
saveCustomColors(colors);
|
|
536854
536662
|
refreshCustomTheme == null ? void 0 : refreshCustomTheme();
|
|
536855
536663
|
setThemeType("custom");
|
|
536856
536664
|
onBack("custom");
|
|
536857
536665
|
}, [colors, onBack, refreshCustomTheme, setThemeType]);
|
|
536858
|
-
const handleSelect = (0,
|
|
536666
|
+
const handleSelect = (0, import_react79.useCallback)((value) => {
|
|
536859
536667
|
if (value === "back") {
|
|
536860
536668
|
onBack();
|
|
536861
536669
|
} else if (value === "save") {
|
|
@@ -536869,10 +536677,10 @@ function CustomThemeScreen({ onBack }) {
|
|
|
536869
536677
|
setEditValue(Array.isArray(colorValue) ? colorValue.join(", ") : colorValue);
|
|
536870
536678
|
}
|
|
536871
536679
|
}, [onBack, saveAndExit, colors]);
|
|
536872
|
-
const handleSelectionChange = (0,
|
|
536680
|
+
const handleSelectionChange = (0, import_react79.useCallback)((newInfoText) => {
|
|
536873
536681
|
setInfoText(newInfoText);
|
|
536874
536682
|
}, []);
|
|
536875
|
-
const handleEditSubmit = (0,
|
|
536683
|
+
const handleEditSubmit = (0, import_react79.useCallback)(() => {
|
|
536876
536684
|
if (editingKey && editValue.trim()) {
|
|
536877
536685
|
setColors((prev) => {
|
|
536878
536686
|
const newValue = editingKey === "logoGradient" ? editValue.split(",").map((v) => v.trim()).filter((v) => v) : editValue.trim();
|
|
@@ -536896,47 +536704,47 @@ function CustomThemeScreen({ onBack }) {
|
|
|
536896
536704
|
}
|
|
536897
536705
|
});
|
|
536898
536706
|
if (editingKey) {
|
|
536899
|
-
return
|
|
536707
|
+
return import_react79.default.createElement(
|
|
536900
536708
|
Box_default,
|
|
536901
536709
|
{ flexDirection: "column", padding: 1 },
|
|
536902
|
-
|
|
536710
|
+
import_react79.default.createElement(
|
|
536903
536711
|
Text,
|
|
536904
536712
|
{ bold: true, color: "cyan" },
|
|
536905
536713
|
((_a21 = t.customTheme) == null ? void 0 : _a21.editColor) || "Edit Color",
|
|
536906
536714
|
": ",
|
|
536907
536715
|
editingKey
|
|
536908
536716
|
),
|
|
536909
|
-
|
|
536717
|
+
import_react79.default.createElement(
|
|
536910
536718
|
Box_default,
|
|
536911
536719
|
{ marginTop: 1 },
|
|
536912
|
-
|
|
536720
|
+
import_react79.default.createElement(
|
|
536913
536721
|
Text,
|
|
536914
536722
|
null,
|
|
536915
536723
|
((_b14 = t.customTheme) == null ? void 0 : _b14.currentValue) || "Current",
|
|
536916
536724
|
": "
|
|
536917
536725
|
),
|
|
536918
|
-
|
|
536726
|
+
import_react79.default.createElement(Text, null, Array.isArray(colors[editingKey]) ? colors[editingKey].join(", ") : colors[editingKey])
|
|
536919
536727
|
),
|
|
536920
|
-
|
|
536728
|
+
import_react79.default.createElement(
|
|
536921
536729
|
Box_default,
|
|
536922
536730
|
{ marginTop: 1 },
|
|
536923
|
-
|
|
536731
|
+
import_react79.default.createElement(
|
|
536924
536732
|
Text,
|
|
536925
536733
|
null,
|
|
536926
536734
|
((_c6 = t.customTheme) == null ? void 0 : _c6.newValue) || "New value",
|
|
536927
536735
|
": "
|
|
536928
536736
|
),
|
|
536929
|
-
|
|
536737
|
+
import_react79.default.createElement(build_default2, { value: editValue, onChange: setEditValue, onSubmit: handleEditSubmit })
|
|
536930
536738
|
),
|
|
536931
|
-
|
|
536739
|
+
import_react79.default.createElement(
|
|
536932
536740
|
Box_default,
|
|
536933
536741
|
{ marginTop: 1 },
|
|
536934
|
-
|
|
536742
|
+
import_react79.default.createElement(Text, { dimColor: true }, ((_d4 = t.customTheme) == null ? void 0 : _d4.colorFormat) || "Format: #RRGGBB or color name (red, blue, etc.)")
|
|
536935
536743
|
),
|
|
536936
|
-
|
|
536744
|
+
import_react79.default.createElement(
|
|
536937
536745
|
Box_default,
|
|
536938
536746
|
{ marginTop: 1 },
|
|
536939
|
-
|
|
536747
|
+
import_react79.default.createElement(
|
|
536940
536748
|
Text,
|
|
536941
536749
|
{ dimColor: true },
|
|
536942
536750
|
"ESC: ",
|
|
@@ -536948,25 +536756,25 @@ function CustomThemeScreen({ onBack }) {
|
|
|
536948
536756
|
)
|
|
536949
536757
|
);
|
|
536950
536758
|
}
|
|
536951
|
-
return
|
|
536759
|
+
return import_react79.default.createElement(
|
|
536952
536760
|
Box_default,
|
|
536953
536761
|
{ flexDirection: "column" },
|
|
536954
|
-
|
|
536762
|
+
import_react79.default.createElement(
|
|
536955
536763
|
Box_default,
|
|
536956
536764
|
{ borderStyle: "round", borderColor: "cyan", paddingX: 1 },
|
|
536957
|
-
|
|
536765
|
+
import_react79.default.createElement(Text, { bold: true, color: "cyan" }, ((_g = t.customTheme) == null ? void 0 : _g.title) || "Custom Theme Editor")
|
|
536958
536766
|
),
|
|
536959
|
-
|
|
536960
|
-
|
|
536767
|
+
import_react79.default.createElement(Menu_default, { options: menuOptions, onSelect: handleSelect, onSelectionChange: handleSelectionChange }),
|
|
536768
|
+
import_react79.default.createElement(
|
|
536961
536769
|
Box_default,
|
|
536962
536770
|
{ flexDirection: "column", paddingX: 1, marginTop: 1 },
|
|
536963
|
-
|
|
536771
|
+
import_react79.default.createElement(
|
|
536964
536772
|
Text,
|
|
536965
536773
|
{ color: "gray", dimColor: true },
|
|
536966
536774
|
((_h = t.customTheme) == null ? void 0 : _h.preview) || "Preview",
|
|
536967
536775
|
":"
|
|
536968
536776
|
),
|
|
536969
|
-
|
|
536777
|
+
import_react79.default.createElement(
|
|
536970
536778
|
ThemeContext2.Provider,
|
|
536971
536779
|
{ value: {
|
|
536972
536780
|
theme: { name: "Custom", type: "custom", colors },
|
|
@@ -536974,32 +536782,32 @@ function CustomThemeScreen({ onBack }) {
|
|
|
536974
536782
|
setThemeType,
|
|
536975
536783
|
refreshCustomTheme
|
|
536976
536784
|
} },
|
|
536977
|
-
|
|
536978
|
-
|
|
536785
|
+
import_react79.default.createElement(DiffViewer, { oldContent: sampleOldCode, newContent: sampleNewCode, filename: "example.ts" }),
|
|
536786
|
+
import_react79.default.createElement(
|
|
536979
536787
|
Box_default,
|
|
536980
536788
|
{ marginTop: 1, flexDirection: "column" },
|
|
536981
|
-
|
|
536789
|
+
import_react79.default.createElement(
|
|
536982
536790
|
Text,
|
|
536983
536791
|
{ color: "gray", dimColor: true },
|
|
536984
536792
|
((_i = t.customTheme) == null ? void 0 : _i.userMessagePreview) || "User message preview",
|
|
536985
536793
|
":"
|
|
536986
536794
|
),
|
|
536987
|
-
|
|
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" })
|
|
536988
536796
|
)
|
|
536989
536797
|
)
|
|
536990
536798
|
),
|
|
536991
|
-
infoText &&
|
|
536799
|
+
infoText && import_react79.default.createElement(
|
|
536992
536800
|
Box_default,
|
|
536993
536801
|
{ paddingX: 1, marginTop: 1 },
|
|
536994
|
-
|
|
536802
|
+
import_react79.default.createElement(Text, { color: "gray" }, infoText)
|
|
536995
536803
|
)
|
|
536996
536804
|
);
|
|
536997
536805
|
}
|
|
536998
|
-
var
|
|
536806
|
+
var import_react79, colorKeys, sampleOldCode, sampleNewCode;
|
|
536999
536807
|
var init_CustomThemeScreen = __esm({
|
|
537000
536808
|
async "dist/ui/pages/CustomThemeScreen.js"() {
|
|
537001
536809
|
"use strict";
|
|
537002
|
-
|
|
536810
|
+
import_react79 = __toESM(require_react(), 1);
|
|
537003
536811
|
await init_build2();
|
|
537004
536812
|
await init_build5();
|
|
537005
536813
|
await init_Menu();
|
|
@@ -537048,19 +536856,19 @@ function ThemeSettingsScreen({ onBack, inlineMode = false }) {
|
|
|
537048
536856
|
var _a21;
|
|
537049
536857
|
const { themeType, setThemeType } = useTheme();
|
|
537050
536858
|
const { t } = useI18n();
|
|
537051
|
-
const [selectedTheme, setSelectedTheme] = (0,
|
|
537052
|
-
const [infoText, setInfoText] = (0,
|
|
537053
|
-
const [screen, setScreen] = (0,
|
|
537054
|
-
const [simpleMode, setSimpleModeState] = (0,
|
|
537055
|
-
(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)(() => {
|
|
537056
536864
|
setSimpleModeState(getSimpleMode());
|
|
537057
536865
|
}, []);
|
|
537058
|
-
const handleToggleSimpleMode = (0,
|
|
536866
|
+
const handleToggleSimpleMode = (0, import_react80.useCallback)(() => {
|
|
537059
536867
|
const newSimpleMode = !simpleMode;
|
|
537060
536868
|
setSimpleModeState(newSimpleMode);
|
|
537061
536869
|
setSimpleMode(newSimpleMode);
|
|
537062
536870
|
}, [simpleMode]);
|
|
537063
|
-
const themeOptions = (0,
|
|
536871
|
+
const themeOptions = (0, import_react80.useMemo)(() => {
|
|
537064
536872
|
var _a22, _b14, _c6, _d4, _e2;
|
|
537065
536873
|
return [
|
|
537066
536874
|
{
|
|
@@ -537116,7 +536924,7 @@ function ThemeSettingsScreen({ onBack, inlineMode = false }) {
|
|
|
537116
536924
|
}
|
|
537117
536925
|
];
|
|
537118
536926
|
}, [selectedTheme, simpleMode, t]);
|
|
537119
|
-
const handleSelect = (0,
|
|
536927
|
+
const handleSelect = (0, import_react80.useCallback)((value) => {
|
|
537120
536928
|
if (value === "back") {
|
|
537121
536929
|
setThemeType(selectedTheme);
|
|
537122
536930
|
onBack();
|
|
@@ -537130,7 +536938,7 @@ function ThemeSettingsScreen({ onBack, inlineMode = false }) {
|
|
|
537130
536938
|
setThemeType(newTheme);
|
|
537131
536939
|
}
|
|
537132
536940
|
}, [onBack, setThemeType, selectedTheme, handleToggleSimpleMode]);
|
|
537133
|
-
const handleSelectionChange = (0,
|
|
536941
|
+
const handleSelectionChange = (0, import_react80.useCallback)((newInfoText, value) => {
|
|
537134
536942
|
setInfoText(newInfoText);
|
|
537135
536943
|
if (value === "back" || value === "edit-custom" || value === "simple-mode") {
|
|
537136
536944
|
setThemeType(selectedTheme);
|
|
@@ -537138,7 +536946,7 @@ function ThemeSettingsScreen({ onBack, inlineMode = false }) {
|
|
|
537138
536946
|
setThemeType(value);
|
|
537139
536947
|
}
|
|
537140
536948
|
}, [setThemeType, selectedTheme]);
|
|
537141
|
-
const handleBackFromCustom = (0,
|
|
536949
|
+
const handleBackFromCustom = (0, import_react80.useCallback)((nextSelectedTheme) => {
|
|
537142
536950
|
setScreen("main");
|
|
537143
536951
|
if (nextSelectedTheme) {
|
|
537144
536952
|
setSelectedTheme(nextSelectedTheme);
|
|
@@ -537151,24 +536959,24 @@ function ThemeSettingsScreen({ onBack, inlineMode = false }) {
|
|
|
537151
536959
|
}
|
|
537152
536960
|
}, { isActive: screen === "main" });
|
|
537153
536961
|
if (screen === "custom") {
|
|
537154
|
-
return
|
|
537155
|
-
|
|
537156
|
-
{ fallback:
|
|
537157
|
-
|
|
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 })
|
|
537158
536966
|
);
|
|
537159
536967
|
}
|
|
537160
|
-
return
|
|
536968
|
+
return import_react80.default.createElement(
|
|
537161
536969
|
Box_default,
|
|
537162
536970
|
{ flexDirection: "column" },
|
|
537163
|
-
!inlineMode &&
|
|
536971
|
+
!inlineMode && import_react80.default.createElement(
|
|
537164
536972
|
Box_default,
|
|
537165
536973
|
{ borderStyle: "round", borderColor: "cyan", paddingX: 1 },
|
|
537166
|
-
|
|
536974
|
+
import_react80.default.createElement(Text, { bold: true, color: "cyan" }, t.themeSettings.title)
|
|
537167
536975
|
),
|
|
537168
|
-
|
|
536976
|
+
import_react80.default.createElement(
|
|
537169
536977
|
Box_default,
|
|
537170
536978
|
{ flexDirection: "column", paddingX: 1 },
|
|
537171
|
-
|
|
536979
|
+
import_react80.default.createElement(
|
|
537172
536980
|
Text,
|
|
537173
536981
|
{ color: "gray", dimColor: true },
|
|
537174
536982
|
t.themeSettings.current,
|
|
@@ -537176,31 +536984,31 @@ function ThemeSettingsScreen({ onBack, inlineMode = false }) {
|
|
|
537176
536984
|
((_a21 = themeOptions.find((opt) => opt.value === selectedTheme)) == null ? void 0 : _a21.label.replace("\u2713 ", "")) || selectedTheme
|
|
537177
536985
|
)
|
|
537178
536986
|
),
|
|
537179
|
-
|
|
537180
|
-
|
|
536987
|
+
import_react80.default.createElement(Menu_default, { options: themeOptions, onSelect: handleSelect, onSelectionChange: handleSelectionChange }),
|
|
536988
|
+
import_react80.default.createElement(
|
|
537181
536989
|
Box_default,
|
|
537182
536990
|
{ flexDirection: "column", paddingX: 1 },
|
|
537183
|
-
|
|
537184
|
-
|
|
537185
|
-
|
|
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(
|
|
537186
536994
|
Box_default,
|
|
537187
536995
|
{ marginTop: 1, flexDirection: "column" },
|
|
537188
|
-
|
|
537189
|
-
|
|
536996
|
+
import_react80.default.createElement(Text, { color: "gray", dimColor: true }, t.themeSettings.userMessagePreview),
|
|
536997
|
+
import_react80.default.createElement(UserMessagePreview, { content: t.themeSettings.userMessageSample })
|
|
537190
536998
|
)
|
|
537191
536999
|
),
|
|
537192
|
-
infoText &&
|
|
537000
|
+
infoText && import_react80.default.createElement(
|
|
537193
537001
|
Box_default,
|
|
537194
537002
|
{ paddingX: 1 },
|
|
537195
|
-
|
|
537003
|
+
import_react80.default.createElement(Alert, { variant: "info" }, infoText)
|
|
537196
537004
|
)
|
|
537197
537005
|
);
|
|
537198
537006
|
}
|
|
537199
|
-
var
|
|
537007
|
+
var import_react80, CustomThemeScreen2, sampleOldCode2, sampleNewCode2;
|
|
537200
537008
|
var init_ThemeSettingsScreen = __esm({
|
|
537201
537009
|
async "dist/ui/pages/ThemeSettingsScreen.js"() {
|
|
537202
537010
|
"use strict";
|
|
537203
|
-
|
|
537011
|
+
import_react80 = __toESM(require_react(), 1);
|
|
537204
537012
|
await init_build2();
|
|
537205
537013
|
await init_build4();
|
|
537206
537014
|
await init_Menu();
|
|
@@ -537209,7 +537017,7 @@ var init_ThemeSettingsScreen = __esm({
|
|
|
537209
537017
|
init_ThemeContext();
|
|
537210
537018
|
init_i18n();
|
|
537211
537019
|
init_themeConfig();
|
|
537212
|
-
CustomThemeScreen2 =
|
|
537020
|
+
CustomThemeScreen2 = import_react80.default.lazy(() => init_CustomThemeScreen().then(() => CustomThemeScreen_exports));
|
|
537213
537021
|
sampleOldCode2 = `function greet(name) {
|
|
537214
537022
|
console.log("Hello " + name);
|
|
537215
537023
|
return "Welcome!";
|
|
@@ -537229,23 +537037,23 @@ __export(HooksConfigScreen_exports, {
|
|
|
537229
537037
|
function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPersist }) {
|
|
537230
537038
|
const { theme: theme14 } = useTheme();
|
|
537231
537039
|
const { t } = useI18n();
|
|
537232
|
-
const [screen, setScreen] = (0,
|
|
537233
|
-
const [selectedScope, setSelectedScope] = (0,
|
|
537234
|
-
const [selectedHookType, setSelectedHookType] = (0,
|
|
537235
|
-
const [selectedRuleIndex, setSelectedRuleIndex] = (0,
|
|
537236
|
-
const [editingRule, setEditingRule] = (0,
|
|
537237
|
-
const [selectedHookInfo, setSelectedHookInfo] = (0,
|
|
537238
|
-
const [scopeMenuIndex, setScopeMenuIndex] = (0,
|
|
537239
|
-
|
|
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(() => {
|
|
537240
537048
|
setScopeMenuIndex(defaultScopeIndex);
|
|
537241
537049
|
}, [defaultScopeIndex]);
|
|
537242
|
-
const [editingRuleField, setEditingRuleField] = (0,
|
|
537243
|
-
const [ruleFieldValue, setRuleFieldValue] = (0,
|
|
537244
|
-
const [selectedActionIndex, setSelectedActionIndex] = (0,
|
|
537245
|
-
const [editingAction, setEditingAction] = (0,
|
|
537246
|
-
const [editingActionField, setEditingActionField] = (0,
|
|
537247
|
-
const [actionFieldValue, setActionFieldValue] = (0,
|
|
537248
|
-
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) => {
|
|
537249
537057
|
if (newType === "prompt") {
|
|
537250
537058
|
if (selectedHookType !== "onSubAgentComplete" && selectedHookType !== "onStop") {
|
|
537251
537059
|
return false;
|
|
@@ -537258,7 +537066,7 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537258
537066
|
}
|
|
537259
537067
|
return false;
|
|
537260
537068
|
}, [selectedHookType]);
|
|
537261
|
-
const handleBack = (0,
|
|
537069
|
+
const handleBack = (0, import_react81.useCallback)(() => {
|
|
537262
537070
|
if (screen === "scope-select") {
|
|
537263
537071
|
onBack();
|
|
537264
537072
|
} else if (screen === "hook-list") {
|
|
@@ -537299,10 +537107,10 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537299
537107
|
color: theme14.colors.error
|
|
537300
537108
|
}
|
|
537301
537109
|
];
|
|
537302
|
-
return
|
|
537303
|
-
|
|
537110
|
+
return import_react81.default.createElement(
|
|
537111
|
+
import_react81.default.Fragment,
|
|
537304
537112
|
null,
|
|
537305
|
-
|
|
537113
|
+
import_react81.default.createElement(Menu_default, { options: options3, defaultIndex: scopeMenuIndex, onSelect: (value) => {
|
|
537306
537114
|
if (value === "back") {
|
|
537307
537115
|
onBack();
|
|
537308
537116
|
} else {
|
|
@@ -537317,10 +537125,10 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537317
537125
|
onScopeSelectionPersist == null ? void 0 : onScopeSelectionPersist(index);
|
|
537318
537126
|
}
|
|
537319
537127
|
} }),
|
|
537320
|
-
selectedHookInfo &&
|
|
537128
|
+
selectedHookInfo && import_react81.default.createElement(
|
|
537321
537129
|
Box_default,
|
|
537322
537130
|
{ marginTop: 1 },
|
|
537323
|
-
|
|
537131
|
+
import_react81.default.createElement(Alert, { variant: "info" }, selectedHookInfo)
|
|
537324
537132
|
)
|
|
537325
537133
|
);
|
|
537326
537134
|
};
|
|
@@ -537345,13 +537153,13 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537345
537153
|
infoText: t.hooksConfig.hookList.backInfo,
|
|
537346
537154
|
color: theme14.colors.error
|
|
537347
537155
|
});
|
|
537348
|
-
return
|
|
537349
|
-
|
|
537156
|
+
return import_react81.default.createElement(
|
|
537157
|
+
import_react81.default.Fragment,
|
|
537350
537158
|
null,
|
|
537351
|
-
|
|
537159
|
+
import_react81.default.createElement(
|
|
537352
537160
|
Box_default,
|
|
537353
537161
|
{ marginBottom: 1 },
|
|
537354
|
-
|
|
537162
|
+
import_react81.default.createElement(
|
|
537355
537163
|
Text,
|
|
537356
537164
|
{ bold: true, color: theme14.colors.menuSelected },
|
|
537357
537165
|
t.hooksConfig.hookList.title,
|
|
@@ -537360,7 +537168,7 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537360
537168
|
selectedScope === "global" ? t.hooksConfig.hookList.global : t.hooksConfig.hookList.project
|
|
537361
537169
|
)
|
|
537362
537170
|
),
|
|
537363
|
-
|
|
537171
|
+
import_react81.default.createElement(Menu_default, { options: options3, onSelect: (value) => {
|
|
537364
537172
|
if (value === "back") {
|
|
537365
537173
|
handleBack();
|
|
537366
537174
|
} else {
|
|
@@ -537399,16 +537207,16 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537399
537207
|
infoText: t.hooksConfig.hookDetail.backInfo,
|
|
537400
537208
|
color: theme14.colors.error
|
|
537401
537209
|
});
|
|
537402
|
-
return
|
|
537403
|
-
|
|
537210
|
+
return import_react81.default.createElement(
|
|
537211
|
+
import_react81.default.Fragment,
|
|
537404
537212
|
null,
|
|
537405
|
-
|
|
537213
|
+
import_react81.default.createElement(
|
|
537406
537214
|
Box_default,
|
|
537407
537215
|
{ marginBottom: 1, flexDirection: "column" },
|
|
537408
|
-
|
|
537409
|
-
|
|
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)
|
|
537410
537218
|
),
|
|
537411
|
-
|
|
537219
|
+
import_react81.default.createElement(Menu_default, { options: options3, onSelect: (value) => {
|
|
537412
537220
|
if (value === "back") {
|
|
537413
537221
|
handleBack();
|
|
537414
537222
|
} else if (value === "add") {
|
|
@@ -537435,24 +537243,24 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537435
537243
|
return null;
|
|
537436
537244
|
if (editingRuleField) {
|
|
537437
537245
|
const isMatcherField = editingRuleField === "matcher";
|
|
537438
|
-
return
|
|
537246
|
+
return import_react81.default.createElement(
|
|
537439
537247
|
Box_default,
|
|
537440
537248
|
{ flexDirection: "column" },
|
|
537441
|
-
|
|
537249
|
+
import_react81.default.createElement(
|
|
537442
537250
|
Box_default,
|
|
537443
537251
|
{ marginBottom: 1 },
|
|
537444
|
-
|
|
537252
|
+
import_react81.default.createElement(Text, { bold: true, color: theme14.colors.menuSelected }, editingRuleField === "description" ? t.hooksConfig.ruleEdit.editDescription : t.hooksConfig.ruleEdit.editMatcher)
|
|
537445
537253
|
),
|
|
537446
|
-
isMatcherField &&
|
|
537254
|
+
isMatcherField && import_react81.default.createElement(
|
|
537447
537255
|
Box_default,
|
|
537448
537256
|
{ marginBottom: 1 },
|
|
537449
|
-
|
|
537257
|
+
import_react81.default.createElement(Text, { color: theme14.colors.menuInfo }, t.hooksConfig.ruleEdit.matcherHint)
|
|
537450
537258
|
),
|
|
537451
|
-
|
|
537259
|
+
import_react81.default.createElement(
|
|
537452
537260
|
Box_default,
|
|
537453
537261
|
null,
|
|
537454
|
-
|
|
537455
|
-
|
|
537262
|
+
import_react81.default.createElement(Text, { color: theme14.colors.success }, "> "),
|
|
537263
|
+
import_react81.default.createElement(build_default2, { value: ruleFieldValue, onChange: setRuleFieldValue, onSubmit: () => {
|
|
537456
537264
|
setEditingRule({
|
|
537457
537265
|
...editingRule,
|
|
537458
537266
|
[editingRuleField]: ruleFieldValue
|
|
@@ -537461,10 +537269,10 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537461
537269
|
setRuleFieldValue("");
|
|
537462
537270
|
} })
|
|
537463
537271
|
),
|
|
537464
|
-
|
|
537272
|
+
import_react81.default.createElement(
|
|
537465
537273
|
Box_default,
|
|
537466
537274
|
{ marginTop: 1 },
|
|
537467
|
-
|
|
537275
|
+
import_react81.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.hooksConfig.ruleEdit.enterToSave)
|
|
537468
537276
|
)
|
|
537469
537277
|
);
|
|
537470
537278
|
}
|
|
@@ -537518,16 +537326,16 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537518
537326
|
infoText: t.hooksConfig.ruleEdit.cancelInfo,
|
|
537519
537327
|
color: theme14.colors.error
|
|
537520
537328
|
});
|
|
537521
|
-
return
|
|
537522
|
-
|
|
537329
|
+
return import_react81.default.createElement(
|
|
537330
|
+
import_react81.default.Fragment,
|
|
537523
537331
|
null,
|
|
537524
|
-
|
|
537332
|
+
import_react81.default.createElement(
|
|
537525
537333
|
Box_default,
|
|
537526
537334
|
{ marginBottom: 1, flexDirection: "column" },
|
|
537527
|
-
|
|
537528
|
-
|
|
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)
|
|
537529
537337
|
),
|
|
537530
|
-
|
|
537338
|
+
import_react81.default.createElement(Menu_default, { options: options3, onSelect: (value) => {
|
|
537531
537339
|
if (value === "back") {
|
|
537532
537340
|
handleBack();
|
|
537533
537341
|
} else if (value === "save") {
|
|
@@ -537587,24 +537395,24 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537587
537395
|
if (!editingAction || !editingRule)
|
|
537588
537396
|
return null;
|
|
537589
537397
|
if (editingActionField && editingActionField !== "enabled" && editingActionField !== "type") {
|
|
537590
|
-
return
|
|
537398
|
+
return import_react81.default.createElement(
|
|
537591
537399
|
Box_default,
|
|
537592
537400
|
{ flexDirection: "column" },
|
|
537593
|
-
|
|
537401
|
+
import_react81.default.createElement(
|
|
537594
537402
|
Box_default,
|
|
537595
537403
|
{ marginBottom: 1 },
|
|
537596
|
-
|
|
537404
|
+
import_react81.default.createElement(
|
|
537597
537405
|
Text,
|
|
537598
537406
|
{ bold: true, color: theme14.colors.menuSelected },
|
|
537599
537407
|
"\u7F16\u8F91 ",
|
|
537600
537408
|
editingActionField
|
|
537601
537409
|
)
|
|
537602
537410
|
),
|
|
537603
|
-
|
|
537411
|
+
import_react81.default.createElement(
|
|
537604
537412
|
Box_default,
|
|
537605
537413
|
null,
|
|
537606
|
-
|
|
537607
|
-
|
|
537414
|
+
import_react81.default.createElement(Text, { color: theme14.colors.success }, "> "),
|
|
537415
|
+
import_react81.default.createElement(build_default2, { value: actionFieldValue, onChange: setActionFieldValue, onSubmit: () => {
|
|
537608
537416
|
const value = editingActionField === "timeout" ? actionFieldValue ? parseInt(actionFieldValue) : void 0 : actionFieldValue || void 0;
|
|
537609
537417
|
setEditingAction({
|
|
537610
537418
|
...editingAction,
|
|
@@ -537614,10 +537422,10 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537614
537422
|
setActionFieldValue("");
|
|
537615
537423
|
} })
|
|
537616
537424
|
),
|
|
537617
|
-
|
|
537425
|
+
import_react81.default.createElement(
|
|
537618
537426
|
Box_default,
|
|
537619
537427
|
{ marginTop: 1 },
|
|
537620
|
-
|
|
537428
|
+
import_react81.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.hooksConfig.actionEdit.enterToSave)
|
|
537621
537429
|
)
|
|
537622
537430
|
);
|
|
537623
537431
|
}
|
|
@@ -537673,16 +537481,16 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537673
537481
|
infoText: t.hooksConfig.actionEdit.cancelInfo,
|
|
537674
537482
|
color: theme14.colors.error
|
|
537675
537483
|
});
|
|
537676
|
-
return
|
|
537677
|
-
|
|
537484
|
+
return import_react81.default.createElement(
|
|
537485
|
+
import_react81.default.Fragment,
|
|
537678
537486
|
null,
|
|
537679
|
-
|
|
537487
|
+
import_react81.default.createElement(
|
|
537680
537488
|
Box_default,
|
|
537681
537489
|
{ marginBottom: 1, flexDirection: "column" },
|
|
537682
|
-
|
|
537683
|
-
|
|
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)
|
|
537684
537492
|
),
|
|
537685
|
-
|
|
537493
|
+
import_react81.default.createElement(Menu_default, { options: options3, onSelect: (value) => {
|
|
537686
537494
|
var _a21;
|
|
537687
537495
|
if (value === "back") {
|
|
537688
537496
|
handleBack();
|
|
@@ -537768,7 +537576,7 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537768
537576
|
}
|
|
537769
537577
|
}
|
|
537770
537578
|
}, { isActive: true });
|
|
537771
|
-
return
|
|
537579
|
+
return import_react81.default.createElement(
|
|
537772
537580
|
Box_default,
|
|
537773
537581
|
{ flexDirection: "column", padding: 1 },
|
|
537774
537582
|
screen === "scope-select" && renderScopeSelect(),
|
|
@@ -537776,18 +537584,18 @@ function HooksConfigScreen({ onBack, defaultScopeIndex = 0, onScopeSelectionPers
|
|
|
537776
537584
|
screen === "hook-detail" && renderHookDetail(),
|
|
537777
537585
|
screen === "rule-edit" && renderRuleEdit(),
|
|
537778
537586
|
screen === "action-edit" && renderActionEdit(),
|
|
537779
|
-
selectedHookInfo && screen === "hook-list" &&
|
|
537587
|
+
selectedHookInfo && screen === "hook-list" && import_react81.default.createElement(
|
|
537780
537588
|
Box_default,
|
|
537781
537589
|
{ marginTop: 1 },
|
|
537782
|
-
|
|
537590
|
+
import_react81.default.createElement(Alert, { variant: "info" }, selectedHookInfo)
|
|
537783
537591
|
)
|
|
537784
537592
|
);
|
|
537785
537593
|
}
|
|
537786
|
-
var
|
|
537594
|
+
var import_react81;
|
|
537787
537595
|
var init_HooksConfigScreen = __esm({
|
|
537788
537596
|
async "dist/ui/pages/HooksConfigScreen.js"() {
|
|
537789
537597
|
"use strict";
|
|
537790
|
-
|
|
537598
|
+
import_react81 = __toESM(require_react(), 1);
|
|
537791
537599
|
await init_build2();
|
|
537792
537600
|
await init_build5();
|
|
537793
537601
|
await init_build4();
|
|
@@ -537806,26 +537614,26 @@ __export(WelcomeScreen_exports, {
|
|
|
537806
537614
|
function WelcomeScreen({ version: version3 = "1.0.0", onMenuSelect, defaultMenuIndex = 0, onMenuSelectionPersist }) {
|
|
537807
537615
|
const { t } = useI18n();
|
|
537808
537616
|
const { theme: theme14 } = useTheme();
|
|
537809
|
-
const [infoText, setInfoText] = (0,
|
|
537810
|
-
const [inlineView, setInlineView] = (0,
|
|
537811
|
-
const [updateNotice, setUpdateNoticeState] = (0,
|
|
537812
|
-
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)();
|
|
537813
537621
|
const { columns: terminalWidth } = useTerminalSize();
|
|
537814
537622
|
const { stdout } = use_stdout_default();
|
|
537815
|
-
const isInitialMount = (0,
|
|
537816
|
-
const [currentMenuIndex, setCurrentMenuIndex] = (0,
|
|
537817
|
-
const [subAgentListIndex, setSubAgentListIndex] = (0,
|
|
537818
|
-
const [hooksConfigIndex, setHooksConfigIndex] = (0,
|
|
537819
|
-
(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)(() => {
|
|
537820
537628
|
setCurrentMenuIndex(defaultMenuIndex);
|
|
537821
537629
|
}, [defaultMenuIndex]);
|
|
537822
|
-
(0,
|
|
537630
|
+
(0, import_react82.useEffect)(() => {
|
|
537823
537631
|
const unsubscribe = onUpdateNotice((notice) => {
|
|
537824
537632
|
setUpdateNoticeState(notice);
|
|
537825
537633
|
});
|
|
537826
537634
|
return unsubscribe;
|
|
537827
537635
|
}, []);
|
|
537828
|
-
const menuOptions = (0,
|
|
537636
|
+
const menuOptions = (0, import_react82.useMemo)(() => [
|
|
537829
537637
|
{
|
|
537830
537638
|
label: t.welcome.startChat,
|
|
537831
537639
|
value: "chat",
|
|
@@ -537900,15 +537708,15 @@ function WelcomeScreen({ version: version3 = "1.0.0", onMenuSelect, defaultMenuI
|
|
|
537900
537708
|
infoText: t.welcome.exitInfo
|
|
537901
537709
|
}
|
|
537902
537710
|
], [t]);
|
|
537903
|
-
const [remountKey, setRemountKey] = (0,
|
|
537904
|
-
const optionsIndexMap = (0,
|
|
537711
|
+
const [remountKey, setRemountKey] = (0, import_react82.useState)(0);
|
|
537712
|
+
const optionsIndexMap = (0, import_react82.useMemo)(() => {
|
|
537905
537713
|
const map3 = /* @__PURE__ */ new Map();
|
|
537906
537714
|
menuOptions.forEach((opt, idx2) => {
|
|
537907
537715
|
map3.set(opt.value, idx2);
|
|
537908
537716
|
});
|
|
537909
537717
|
return map3;
|
|
537910
537718
|
}, [menuOptions]);
|
|
537911
|
-
const handleSelectionChange = (0,
|
|
537719
|
+
const handleSelectionChange = (0, import_react82.useCallback)((newInfoText, value) => {
|
|
537912
537720
|
setInfoText((prev) => prev === newInfoText ? prev : newInfoText);
|
|
537913
537721
|
const index = optionsIndexMap.get(value);
|
|
537914
537722
|
if (index !== void 0) {
|
|
@@ -537916,7 +537724,7 @@ function WelcomeScreen({ version: version3 = "1.0.0", onMenuSelect, defaultMenuI
|
|
|
537916
537724
|
onMenuSelectionPersist == null ? void 0 : onMenuSelectionPersist(index);
|
|
537917
537725
|
}
|
|
537918
537726
|
}, [optionsIndexMap, onMenuSelectionPersist]);
|
|
537919
|
-
const handleInlineMenuSelect = (0,
|
|
537727
|
+
const handleInlineMenuSelect = (0, import_react82.useCallback)((value) => {
|
|
537920
537728
|
const index = menuOptions.findIndex((opt) => opt.value === value);
|
|
537921
537729
|
if (index !== -1) {
|
|
537922
537730
|
setCurrentMenuIndex(index);
|
|
@@ -537946,31 +537754,31 @@ function WelcomeScreen({ version: version3 = "1.0.0", onMenuSelect, defaultMenuI
|
|
|
537946
537754
|
onMenuSelect == null ? void 0 : onMenuSelect(value);
|
|
537947
537755
|
}
|
|
537948
537756
|
}, [onMenuSelect, menuOptions, onMenuSelectionPersist]);
|
|
537949
|
-
const handleBackToMenu = (0,
|
|
537757
|
+
const handleBackToMenu = (0, import_react82.useCallback)(() => {
|
|
537950
537758
|
setInlineView("menu");
|
|
537951
537759
|
}, []);
|
|
537952
|
-
const handleConfigSave = (0,
|
|
537760
|
+
const handleConfigSave = (0, import_react82.useCallback)(() => {
|
|
537953
537761
|
setInlineView("menu");
|
|
537954
537762
|
}, []);
|
|
537955
|
-
const handleSubAgentAdd = (0,
|
|
537763
|
+
const handleSubAgentAdd = (0, import_react82.useCallback)(() => {
|
|
537956
537764
|
setEditingAgentId(void 0);
|
|
537957
537765
|
setInlineView("subagent-add");
|
|
537958
537766
|
}, []);
|
|
537959
|
-
const handleSubAgentEdit = (0,
|
|
537767
|
+
const handleSubAgentEdit = (0, import_react82.useCallback)((agentId) => {
|
|
537960
537768
|
setEditingAgentId(agentId);
|
|
537961
537769
|
setInlineView("subagent-edit");
|
|
537962
537770
|
}, []);
|
|
537963
|
-
const handleSubAgentBack = (0,
|
|
537771
|
+
const handleSubAgentBack = (0, import_react82.useCallback)(() => {
|
|
537964
537772
|
stdout.write(base_exports.clearTerminal);
|
|
537965
537773
|
setRemountKey((prev) => prev + 1);
|
|
537966
537774
|
setInlineView("subagent-list");
|
|
537967
537775
|
}, [stdout]);
|
|
537968
|
-
const handleSubAgentSave = (0,
|
|
537776
|
+
const handleSubAgentSave = (0, import_react82.useCallback)(() => {
|
|
537969
537777
|
stdout.write(base_exports.clearTerminal);
|
|
537970
537778
|
setRemountKey((prev) => prev + 1);
|
|
537971
537779
|
setInlineView("subagent-list");
|
|
537972
537780
|
}, [stdout]);
|
|
537973
|
-
(0,
|
|
537781
|
+
(0, import_react82.useEffect)(() => {
|
|
537974
537782
|
if (isInitialMount.current) {
|
|
537975
537783
|
isInitialMount.current = false;
|
|
537976
537784
|
return;
|
|
@@ -537983,37 +537791,37 @@ function WelcomeScreen({ version: version3 = "1.0.0", onMenuSelect, defaultMenuI
|
|
|
537983
537791
|
clearTimeout(handler);
|
|
537984
537792
|
};
|
|
537985
537793
|
}, [terminalWidth, stdout]);
|
|
537986
|
-
const loadingFallback =
|
|
537794
|
+
const loadingFallback = import_react82.default.createElement(
|
|
537987
537795
|
Box_default,
|
|
537988
537796
|
{ paddingX: 1 },
|
|
537989
|
-
|
|
537797
|
+
import_react82.default.createElement(
|
|
537990
537798
|
Text,
|
|
537991
537799
|
{ color: "cyan" },
|
|
537992
|
-
|
|
537800
|
+
import_react82.default.createElement(build_default, { type: "dots" })
|
|
537993
537801
|
),
|
|
537994
|
-
|
|
537802
|
+
import_react82.default.createElement(Text, null, " Loading...")
|
|
537995
537803
|
);
|
|
537996
|
-
return
|
|
537804
|
+
return import_react82.default.createElement(
|
|
537997
537805
|
Box_default,
|
|
537998
537806
|
{ flexDirection: "column", width: terminalWidth },
|
|
537999
|
-
|
|
538000
|
-
|
|
537807
|
+
import_react82.default.createElement(Static, { key: remountKey, items: [
|
|
537808
|
+
import_react82.default.createElement(
|
|
538001
537809
|
Box_default,
|
|
538002
537810
|
{ key: "welcome-header", flexDirection: "row", paddingLeft: 2, paddingTop: 1, paddingBottom: 0, width: terminalWidth },
|
|
538003
|
-
|
|
537811
|
+
import_react82.default.createElement(
|
|
538004
537812
|
Box_default,
|
|
538005
537813
|
{ flexDirection: "column", justifyContent: "center" },
|
|
538006
|
-
|
|
537814
|
+
import_react82.default.createElement(
|
|
538007
537815
|
Box_default,
|
|
538008
537816
|
{ marginBottom: 0 },
|
|
538009
|
-
|
|
537817
|
+
import_react82.default.createElement(
|
|
538010
537818
|
Text,
|
|
538011
537819
|
null,
|
|
538012
|
-
|
|
538013
|
-
|
|
537820
|
+
import_react82.default.createElement(Text, { color: "cyan" }, "\u2746 "),
|
|
537821
|
+
import_react82.default.createElement(dist_default4, { colors: theme14.colors.logoGradient }, "SNOW CLI")
|
|
538014
537822
|
)
|
|
538015
537823
|
),
|
|
538016
|
-
|
|
537824
|
+
import_react82.default.createElement(
|
|
538017
537825
|
Text,
|
|
538018
537826
|
{ color: "gray", dimColor: true },
|
|
538019
537827
|
"v",
|
|
@@ -538024,41 +537832,41 @@ function WelcomeScreen({ version: version3 = "1.0.0", onMenuSelect, defaultMenuI
|
|
|
538024
537832
|
)
|
|
538025
537833
|
)
|
|
538026
537834
|
] }, (item) => item),
|
|
538027
|
-
inlineView === "menu" && updateNotice &&
|
|
537835
|
+
inlineView === "menu" && updateNotice && import_react82.default.createElement(
|
|
538028
537836
|
Box_default,
|
|
538029
537837
|
{ paddingX: 1, marginBottom: 1 },
|
|
538030
|
-
|
|
537838
|
+
import_react82.default.createElement(
|
|
538031
537839
|
Box_default,
|
|
538032
537840
|
{ borderStyle: "double", borderColor: "cyan", paddingX: 2, paddingY: 1, width: terminalWidth - 2 },
|
|
538033
|
-
|
|
537841
|
+
import_react82.default.createElement(
|
|
538034
537842
|
Box_default,
|
|
538035
537843
|
{ flexDirection: "column" },
|
|
538036
|
-
|
|
538037
|
-
|
|
537844
|
+
import_react82.default.createElement(Text, { bold: true, color: "cyan" }, t.welcome.updateNoticeTitle),
|
|
537845
|
+
import_react82.default.createElement(
|
|
538038
537846
|
Text,
|
|
538039
537847
|
{ color: "gray", dimColor: true },
|
|
538040
537848
|
t.welcome.updateNoticeCurrent,
|
|
538041
537849
|
":",
|
|
538042
537850
|
" ",
|
|
538043
|
-
|
|
537851
|
+
import_react82.default.createElement(Text, { color: "gray" }, updateNotice.currentVersion)
|
|
538044
537852
|
),
|
|
538045
|
-
|
|
537853
|
+
import_react82.default.createElement(
|
|
538046
537854
|
Text,
|
|
538047
537855
|
{ color: "gray", dimColor: true },
|
|
538048
537856
|
t.welcome.updateNoticeLatest,
|
|
538049
537857
|
":",
|
|
538050
537858
|
" ",
|
|
538051
|
-
|
|
537859
|
+
import_react82.default.createElement(Text, { color: "yellow", bold: true }, updateNotice.latestVersion)
|
|
538052
537860
|
),
|
|
538053
|
-
|
|
537861
|
+
import_react82.default.createElement(
|
|
538054
537862
|
Text,
|
|
538055
537863
|
{ color: "gray", dimColor: true },
|
|
538056
537864
|
t.welcome.updateNoticeRun,
|
|
538057
537865
|
":",
|
|
538058
537866
|
" ",
|
|
538059
|
-
|
|
537867
|
+
import_react82.default.createElement(Text, { color: "yellow", bold: true }, "snow --update")
|
|
538060
537868
|
),
|
|
538061
|
-
|
|
537869
|
+
import_react82.default.createElement(
|
|
538062
537870
|
Text,
|
|
538063
537871
|
{ color: "gray", dimColor: true },
|
|
538064
537872
|
t.welcome.updateNoticeGithub,
|
|
@@ -538069,131 +537877,131 @@ function WelcomeScreen({ version: version3 = "1.0.0", onMenuSelect, defaultMenuI
|
|
|
538069
537877
|
)
|
|
538070
537878
|
)
|
|
538071
537879
|
),
|
|
538072
|
-
onMenuSelect && inlineView === "menu" &&
|
|
537880
|
+
onMenuSelect && inlineView === "menu" && import_react82.default.createElement(
|
|
538073
537881
|
Box_default,
|
|
538074
537882
|
{ paddingX: 1 },
|
|
538075
|
-
|
|
537883
|
+
import_react82.default.createElement(
|
|
538076
537884
|
Box_default,
|
|
538077
537885
|
{ borderStyle: "round", borderColor: "cyan", paddingX: 1 },
|
|
538078
|
-
|
|
537886
|
+
import_react82.default.createElement(Menu_default, { options: menuOptions, onSelect: handleInlineMenuSelect, onSelectionChange: handleSelectionChange, defaultIndex: currentMenuIndex })
|
|
538079
537887
|
)
|
|
538080
537888
|
),
|
|
538081
|
-
inlineView === "menu" &&
|
|
537889
|
+
inlineView === "menu" && import_react82.default.createElement(
|
|
538082
537890
|
Box_default,
|
|
538083
537891
|
{ paddingX: 1 },
|
|
538084
|
-
|
|
537892
|
+
import_react82.default.createElement(Alert, { variant: "info" }, infoText)
|
|
538085
537893
|
),
|
|
538086
|
-
inlineView === "config" &&
|
|
538087
|
-
|
|
537894
|
+
inlineView === "config" && import_react82.default.createElement(
|
|
537895
|
+
import_react82.Suspense,
|
|
538088
537896
|
{ fallback: loadingFallback },
|
|
538089
|
-
|
|
537897
|
+
import_react82.default.createElement(
|
|
538090
537898
|
Box_default,
|
|
538091
537899
|
{ paddingX: 1 },
|
|
538092
|
-
|
|
537900
|
+
import_react82.default.createElement(ConfigScreen2, { onBack: handleBackToMenu, onSave: handleConfigSave, inlineMode: true })
|
|
538093
537901
|
)
|
|
538094
537902
|
),
|
|
538095
|
-
inlineView === "proxy-config" &&
|
|
538096
|
-
|
|
537903
|
+
inlineView === "proxy-config" && import_react82.default.createElement(
|
|
537904
|
+
import_react82.Suspense,
|
|
538097
537905
|
{ fallback: loadingFallback },
|
|
538098
|
-
|
|
537906
|
+
import_react82.default.createElement(
|
|
538099
537907
|
Box_default,
|
|
538100
537908
|
{ paddingX: 1 },
|
|
538101
|
-
|
|
537909
|
+
import_react82.default.createElement(ProxyConfigScreen2, { onBack: handleBackToMenu, onSave: handleConfigSave, inlineMode: true })
|
|
538102
537910
|
)
|
|
538103
537911
|
),
|
|
538104
|
-
inlineView === "codebase-config" &&
|
|
538105
|
-
|
|
537912
|
+
inlineView === "codebase-config" && import_react82.default.createElement(
|
|
537913
|
+
import_react82.Suspense,
|
|
538106
537914
|
{ fallback: loadingFallback },
|
|
538107
|
-
|
|
537915
|
+
import_react82.default.createElement(
|
|
538108
537916
|
Box_default,
|
|
538109
537917
|
{ paddingX: 1 },
|
|
538110
|
-
|
|
537918
|
+
import_react82.default.createElement(CodeBaseConfigScreen2, { onBack: handleBackToMenu, onSave: handleConfigSave, inlineMode: true })
|
|
538111
537919
|
)
|
|
538112
537920
|
),
|
|
538113
|
-
inlineView === "subagent-list" &&
|
|
538114
|
-
|
|
537921
|
+
inlineView === "subagent-list" && import_react82.default.createElement(
|
|
537922
|
+
import_react82.Suspense,
|
|
538115
537923
|
{ fallback: loadingFallback },
|
|
538116
|
-
|
|
537924
|
+
import_react82.default.createElement(
|
|
538117
537925
|
Box_default,
|
|
538118
537926
|
{ paddingX: 1 },
|
|
538119
|
-
|
|
537927
|
+
import_react82.default.createElement(SubAgentListScreen2, { onBack: handleBackToMenu, onAdd: handleSubAgentAdd, onEdit: handleSubAgentEdit, inlineMode: true, defaultSelectedIndex: subAgentListIndex, onSelectionPersist: setSubAgentListIndex })
|
|
538120
537928
|
)
|
|
538121
537929
|
),
|
|
538122
|
-
inlineView === "subagent-add" &&
|
|
538123
|
-
|
|
537930
|
+
inlineView === "subagent-add" && import_react82.default.createElement(
|
|
537931
|
+
import_react82.Suspense,
|
|
538124
537932
|
{ fallback: loadingFallback },
|
|
538125
|
-
|
|
537933
|
+
import_react82.default.createElement(
|
|
538126
537934
|
Box_default,
|
|
538127
537935
|
{ paddingX: 1 },
|
|
538128
|
-
|
|
537936
|
+
import_react82.default.createElement(SubAgentConfigScreen2, { onBack: handleSubAgentBack, onSave: handleSubAgentSave, inlineMode: true })
|
|
538129
537937
|
)
|
|
538130
537938
|
),
|
|
538131
|
-
inlineView === "subagent-edit" &&
|
|
538132
|
-
|
|
537939
|
+
inlineView === "subagent-edit" && import_react82.default.createElement(
|
|
537940
|
+
import_react82.Suspense,
|
|
538133
537941
|
{ fallback: loadingFallback },
|
|
538134
|
-
|
|
537942
|
+
import_react82.default.createElement(
|
|
538135
537943
|
Box_default,
|
|
538136
537944
|
{ paddingX: 1 },
|
|
538137
|
-
|
|
537945
|
+
import_react82.default.createElement(SubAgentConfigScreen2, { onBack: handleSubAgentBack, onSave: handleSubAgentSave, agentId: editingAgentId, inlineMode: true })
|
|
538138
537946
|
)
|
|
538139
537947
|
),
|
|
538140
|
-
inlineView === "sensitive-commands" &&
|
|
538141
|
-
|
|
537948
|
+
inlineView === "sensitive-commands" && import_react82.default.createElement(
|
|
537949
|
+
import_react82.Suspense,
|
|
538142
537950
|
{ fallback: loadingFallback },
|
|
538143
|
-
|
|
537951
|
+
import_react82.default.createElement(
|
|
538144
537952
|
Box_default,
|
|
538145
537953
|
{ paddingX: 1 },
|
|
538146
|
-
|
|
537954
|
+
import_react82.default.createElement(SensitiveCommandConfigScreen2, { onBack: handleBackToMenu, inlineMode: true })
|
|
538147
537955
|
)
|
|
538148
537956
|
),
|
|
538149
|
-
inlineView === "systemprompt" &&
|
|
538150
|
-
|
|
537957
|
+
inlineView === "systemprompt" && import_react82.default.createElement(
|
|
537958
|
+
import_react82.Suspense,
|
|
538151
537959
|
{ fallback: loadingFallback },
|
|
538152
|
-
|
|
537960
|
+
import_react82.default.createElement(
|
|
538153
537961
|
Box_default,
|
|
538154
537962
|
{ paddingX: 1 },
|
|
538155
|
-
|
|
537963
|
+
import_react82.default.createElement(SystemPromptConfigScreen2, { onBack: handleBackToMenu })
|
|
538156
537964
|
)
|
|
538157
537965
|
),
|
|
538158
|
-
inlineView === "customheaders" &&
|
|
538159
|
-
|
|
537966
|
+
inlineView === "customheaders" && import_react82.default.createElement(
|
|
537967
|
+
import_react82.Suspense,
|
|
538160
537968
|
{ fallback: loadingFallback },
|
|
538161
|
-
|
|
537969
|
+
import_react82.default.createElement(
|
|
538162
537970
|
Box_default,
|
|
538163
537971
|
{ paddingX: 1 },
|
|
538164
|
-
|
|
537972
|
+
import_react82.default.createElement(CustomHeadersScreen2, { onBack: handleBackToMenu })
|
|
538165
537973
|
)
|
|
538166
537974
|
),
|
|
538167
|
-
inlineView === "hooks-config" &&
|
|
538168
|
-
|
|
537975
|
+
inlineView === "hooks-config" && import_react82.default.createElement(
|
|
537976
|
+
import_react82.Suspense,
|
|
538169
537977
|
{ fallback: loadingFallback },
|
|
538170
|
-
|
|
537978
|
+
import_react82.default.createElement(
|
|
538171
537979
|
Box_default,
|
|
538172
537980
|
{ paddingX: 1 },
|
|
538173
|
-
|
|
537981
|
+
import_react82.default.createElement(HooksConfigScreen2, { onBack: handleBackToMenu, defaultScopeIndex: hooksConfigIndex, onScopeSelectionPersist: setHooksConfigIndex })
|
|
538174
537982
|
)
|
|
538175
537983
|
),
|
|
538176
|
-
inlineView === "language-settings" &&
|
|
538177
|
-
|
|
537984
|
+
inlineView === "language-settings" && import_react82.default.createElement(
|
|
537985
|
+
import_react82.Suspense,
|
|
538178
537986
|
{ fallback: loadingFallback },
|
|
538179
|
-
|
|
537987
|
+
import_react82.default.createElement(
|
|
538180
537988
|
Box_default,
|
|
538181
537989
|
{ paddingX: 1 },
|
|
538182
|
-
|
|
537990
|
+
import_react82.default.createElement(LanguageSettingsScreen2, { onBack: handleBackToMenu, inlineMode: true })
|
|
538183
537991
|
)
|
|
538184
537992
|
),
|
|
538185
|
-
inlineView === "theme-settings" &&
|
|
538186
|
-
|
|
537993
|
+
inlineView === "theme-settings" && import_react82.default.createElement(
|
|
537994
|
+
import_react82.Suspense,
|
|
538187
537995
|
{ fallback: loadingFallback },
|
|
538188
|
-
|
|
537996
|
+
import_react82.default.createElement(ThemeSettingsScreen2, { onBack: handleBackToMenu, inlineMode: true })
|
|
538189
537997
|
)
|
|
538190
537998
|
);
|
|
538191
537999
|
}
|
|
538192
|
-
var
|
|
538000
|
+
var import_react82, ConfigScreen2, ProxyConfigScreen2, SubAgentConfigScreen2, SubAgentListScreen2, SensitiveCommandConfigScreen2, CodeBaseConfigScreen2, SystemPromptConfigScreen2, CustomHeadersScreen2, LanguageSettingsScreen2, ThemeSettingsScreen2, HooksConfigScreen2;
|
|
538193
538001
|
var init_WelcomeScreen = __esm({
|
|
538194
538002
|
async "dist/ui/pages/WelcomeScreen.js"() {
|
|
538195
538003
|
"use strict";
|
|
538196
|
-
|
|
538004
|
+
import_react82 = __toESM(require_react(), 1);
|
|
538197
538005
|
await init_build2();
|
|
538198
538006
|
await init_build4();
|
|
538199
538007
|
await init_dist4();
|
|
@@ -538204,17 +538012,17 @@ var init_WelcomeScreen = __esm({
|
|
|
538204
538012
|
init_i18n();
|
|
538205
538013
|
init_updateNotice();
|
|
538206
538014
|
init_ThemeContext();
|
|
538207
|
-
ConfigScreen2 =
|
|
538208
|
-
ProxyConfigScreen2 =
|
|
538209
|
-
SubAgentConfigScreen2 =
|
|
538210
|
-
SubAgentListScreen2 =
|
|
538211
|
-
SensitiveCommandConfigScreen2 =
|
|
538212
|
-
CodeBaseConfigScreen2 =
|
|
538213
|
-
SystemPromptConfigScreen2 =
|
|
538214
|
-
CustomHeadersScreen2 =
|
|
538215
|
-
LanguageSettingsScreen2 =
|
|
538216
|
-
ThemeSettingsScreen2 =
|
|
538217
|
-
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));
|
|
538218
538026
|
}
|
|
538219
538027
|
});
|
|
538220
538028
|
|
|
@@ -538760,13 +538568,13 @@ var init_textBuffer = __esm({
|
|
|
538760
538568
|
|
|
538761
538569
|
// dist/hooks/input/useInputBuffer.js
|
|
538762
538570
|
function useInputBuffer(viewport) {
|
|
538763
|
-
const [, forceRender] = (0,
|
|
538764
|
-
const lastUpdateTime = (0,
|
|
538765
|
-
const bufferRef = (0,
|
|
538766
|
-
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)(() => {
|
|
538767
538575
|
forceRender();
|
|
538768
538576
|
});
|
|
538769
|
-
const triggerUpdateRef = (0,
|
|
538577
|
+
const triggerUpdateRef = (0, import_react83.useRef)(() => {
|
|
538770
538578
|
const now = Date.now();
|
|
538771
538579
|
lastUpdateTime.current = now;
|
|
538772
538580
|
forceUpdateRef.current();
|
|
@@ -538775,17 +538583,17 @@ function useInputBuffer(viewport) {
|
|
|
538775
538583
|
bufferRef.current = new TextBuffer(viewport, triggerUpdateRef.current);
|
|
538776
538584
|
}
|
|
538777
538585
|
const buffer = bufferRef.current;
|
|
538778
|
-
const forceUpdate = (0,
|
|
538586
|
+
const forceUpdate = (0, import_react83.useCallback)(() => {
|
|
538779
538587
|
forceUpdateRef.current();
|
|
538780
538588
|
}, []);
|
|
538781
|
-
const triggerUpdate = (0,
|
|
538589
|
+
const triggerUpdate = (0, import_react83.useCallback)(() => {
|
|
538782
538590
|
triggerUpdateRef.current();
|
|
538783
538591
|
}, []);
|
|
538784
|
-
(0,
|
|
538592
|
+
(0, import_react83.useEffect)(() => {
|
|
538785
538593
|
buffer.updateViewport(viewport);
|
|
538786
538594
|
forceUpdateRef.current();
|
|
538787
538595
|
}, [viewport.width, viewport.height, buffer]);
|
|
538788
|
-
(0,
|
|
538596
|
+
(0, import_react83.useEffect)(() => {
|
|
538789
538597
|
return () => {
|
|
538790
538598
|
buffer.destroy();
|
|
538791
538599
|
};
|
|
@@ -538796,11 +538604,11 @@ function useInputBuffer(viewport) {
|
|
|
538796
538604
|
forceUpdate
|
|
538797
538605
|
};
|
|
538798
538606
|
}
|
|
538799
|
-
var
|
|
538607
|
+
var import_react83;
|
|
538800
538608
|
var init_useInputBuffer = __esm({
|
|
538801
538609
|
"dist/hooks/input/useInputBuffer.js"() {
|
|
538802
538610
|
"use strict";
|
|
538803
|
-
|
|
538611
|
+
import_react83 = __toESM(require_react(), 1);
|
|
538804
538612
|
init_textBuffer();
|
|
538805
538613
|
}
|
|
538806
538614
|
});
|
|
@@ -538985,7 +538793,7 @@ var init_commandUsageManager = __esm({
|
|
|
538985
538793
|
// dist/hooks/ui/useCommandPanel.js
|
|
538986
538794
|
function useCommandPanel(buffer, isProcessing = false) {
|
|
538987
538795
|
const { t } = useI18n();
|
|
538988
|
-
const builtInCommands = (0,
|
|
538796
|
+
const builtInCommands = (0, import_react84.useMemo)(() => [
|
|
538989
538797
|
{ name: "help", description: t.commandPanel.commands.help },
|
|
538990
538798
|
{ name: "clear", description: t.commandPanel.commands.clear },
|
|
538991
538799
|
{ name: "resume", description: t.commandPanel.commands.resume },
|
|
@@ -539066,17 +538874,17 @@ function useCommandPanel(buffer, isProcessing = false) {
|
|
|
539066
538874
|
description: t.commandPanel.commands.quit
|
|
539067
538875
|
}
|
|
539068
538876
|
], [t]);
|
|
539069
|
-
const getAllCommands = (0,
|
|
538877
|
+
const getAllCommands = (0, import_react84.useCallback)(() => {
|
|
539070
538878
|
const customCommands = getCustomCommands().map((cmd) => ({
|
|
539071
538879
|
name: cmd.name,
|
|
539072
538880
|
description: cmd.description || cmd.command
|
|
539073
538881
|
}));
|
|
539074
538882
|
return [...builtInCommands, ...customCommands];
|
|
539075
538883
|
}, [builtInCommands]);
|
|
539076
|
-
const [showCommands, setShowCommands] = (0,
|
|
539077
|
-
const [commandSelectedIndex, setCommandSelectedIndex] = (0,
|
|
539078
|
-
const [usageLoaded, setUsageLoaded] = (0,
|
|
539079
|
-
(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)(() => {
|
|
539080
538888
|
let isMounted = true;
|
|
539081
538889
|
commandUsageManager.ensureLoaded().then(() => {
|
|
539082
538890
|
if (isMounted) {
|
|
@@ -539087,7 +538895,7 @@ function useCommandPanel(buffer, isProcessing = false) {
|
|
|
539087
538895
|
isMounted = false;
|
|
539088
538896
|
};
|
|
539089
538897
|
}, []);
|
|
539090
|
-
const getFilteredCommands = (0,
|
|
538898
|
+
const getFilteredCommands = (0, import_react84.useCallback)(() => {
|
|
539091
538899
|
const text3 = buffer.getFullText();
|
|
539092
538900
|
if (!text3.startsWith("/"))
|
|
539093
538901
|
return [];
|
|
@@ -539123,7 +538931,7 @@ function useCommandPanel(buffer, isProcessing = false) {
|
|
|
539123
538931
|
}).map((item) => item.command);
|
|
539124
538932
|
return filtered;
|
|
539125
538933
|
}, [buffer, getAllCommands, usageLoaded]);
|
|
539126
|
-
const updateCommandPanelState = (0,
|
|
538934
|
+
const updateCommandPanelState = (0, import_react84.useCallback)((text3) => {
|
|
539127
538935
|
if (text3.startsWith("/") && text3.length > 0) {
|
|
539128
538936
|
setShowCommands(true);
|
|
539129
538937
|
setCommandSelectedIndex(0);
|
|
@@ -539145,11 +538953,11 @@ function useCommandPanel(buffer, isProcessing = false) {
|
|
|
539145
538953
|
// Export isProcessing for CommandPanel to use
|
|
539146
538954
|
};
|
|
539147
538955
|
}
|
|
539148
|
-
var
|
|
538956
|
+
var import_react84;
|
|
539149
538957
|
var init_useCommandPanel = __esm({
|
|
539150
538958
|
"dist/hooks/ui/useCommandPanel.js"() {
|
|
539151
538959
|
"use strict";
|
|
539152
|
-
|
|
538960
|
+
import_react84 = __toESM(require_react(), 1);
|
|
539153
538961
|
init_i18n();
|
|
539154
538962
|
init_custom();
|
|
539155
538963
|
init_commandUsageManager();
|
|
@@ -539199,7 +539007,7 @@ function filePickerReducer(state, action) {
|
|
|
539199
539007
|
}
|
|
539200
539008
|
}
|
|
539201
539009
|
function useFilePicker(buffer, triggerUpdate) {
|
|
539202
|
-
const [state, dispatch] = (0,
|
|
539010
|
+
const [state, dispatch] = (0, import_react85.useReducer)(filePickerReducer, {
|
|
539203
539011
|
showFilePicker: false,
|
|
539204
539012
|
fileSelectedIndex: 0,
|
|
539205
539013
|
fileQuery: "",
|
|
@@ -539207,8 +539015,8 @@ function useFilePicker(buffer, triggerUpdate) {
|
|
|
539207
539015
|
filteredFileCount: 0,
|
|
539208
539016
|
searchMode: "file"
|
|
539209
539017
|
});
|
|
539210
|
-
const fileListRef = (0,
|
|
539211
|
-
const updateFilePickerState = (0,
|
|
539018
|
+
const fileListRef = (0, import_react85.useRef)(null);
|
|
539019
|
+
const updateFilePickerState = (0, import_react85.useCallback)((_text, cursorPos) => {
|
|
539212
539020
|
const displayText = buffer.text;
|
|
539213
539021
|
if (!displayText.includes("@")) {
|
|
539214
539022
|
if (state.showFilePicker) {
|
|
@@ -539275,7 +539083,7 @@ function useFilePicker(buffer, triggerUpdate) {
|
|
|
539275
539083
|
state.atSymbolPosition,
|
|
539276
539084
|
state.searchMode
|
|
539277
539085
|
]);
|
|
539278
|
-
const handleFileSelect = (0,
|
|
539086
|
+
const handleFileSelect = (0, import_react85.useCallback)(async (filePath) => {
|
|
539279
539087
|
if (state.atSymbolPosition !== -1) {
|
|
539280
539088
|
const displayText = buffer.text;
|
|
539281
539089
|
const cursorPos = buffer.getCursorPosition();
|
|
@@ -539295,10 +539103,10 @@ function useFilePicker(buffer, triggerUpdate) {
|
|
|
539295
539103
|
triggerUpdate();
|
|
539296
539104
|
}
|
|
539297
539105
|
}, [state.atSymbolPosition, state.searchMode, buffer, triggerUpdate]);
|
|
539298
|
-
const handleFilteredCountChange = (0,
|
|
539106
|
+
const handleFilteredCountChange = (0, import_react85.useCallback)((count) => {
|
|
539299
539107
|
dispatch({ type: "SET_FILTERED_COUNT", count });
|
|
539300
539108
|
}, []);
|
|
539301
|
-
const setShowFilePicker = (0,
|
|
539109
|
+
const setShowFilePicker = (0, import_react85.useCallback)((show) => {
|
|
539302
539110
|
if (show) {
|
|
539303
539111
|
dispatch({
|
|
539304
539112
|
type: "SHOW",
|
|
@@ -539310,7 +539118,7 @@ function useFilePicker(buffer, triggerUpdate) {
|
|
|
539310
539118
|
dispatch({ type: "HIDE" });
|
|
539311
539119
|
}
|
|
539312
539120
|
}, []);
|
|
539313
|
-
const setFileSelectedIndex = (0,
|
|
539121
|
+
const setFileSelectedIndex = (0, import_react85.useCallback)((index) => {
|
|
539314
539122
|
if (typeof index === "function") {
|
|
539315
539123
|
dispatch({
|
|
539316
539124
|
type: "SET_SELECTED_INDEX",
|
|
@@ -539339,11 +539147,11 @@ function useFilePicker(buffer, triggerUpdate) {
|
|
|
539339
539147
|
fileListRef
|
|
539340
539148
|
};
|
|
539341
539149
|
}
|
|
539342
|
-
var
|
|
539150
|
+
var import_react85;
|
|
539343
539151
|
var init_useFilePicker = __esm({
|
|
539344
539152
|
"dist/hooks/picker/useFilePicker.js"() {
|
|
539345
539153
|
"use strict";
|
|
539346
|
-
|
|
539154
|
+
import_react85 = __toESM(require_react(), 1);
|
|
539347
539155
|
}
|
|
539348
539156
|
});
|
|
539349
539157
|
|
|
@@ -539729,30 +539537,30 @@ var init_historyManager = __esm({
|
|
|
539729
539537
|
|
|
539730
539538
|
// dist/hooks/input/useHistoryNavigation.js
|
|
539731
539539
|
function useHistoryNavigation(buffer, triggerUpdate, chatHistory, onHistorySelect) {
|
|
539732
|
-
const [showHistoryMenu, setShowHistoryMenu] = (0,
|
|
539733
|
-
const [historySelectedIndex, setHistorySelectedIndex] = (0,
|
|
539734
|
-
const [escapeKeyCount, setEscapeKeyCount] = (0,
|
|
539735
|
-
const escapeKeyTimer = (0,
|
|
539736
|
-
const [currentHistoryIndex, setCurrentHistoryIndex] = (0,
|
|
539737
|
-
const savedInput = (0,
|
|
539738
|
-
const [persistentHistory, setPersistentHistory] = (0,
|
|
539739
|
-
const persistentHistoryRef = (0,
|
|
539740
|
-
(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)(() => {
|
|
539741
539549
|
persistentHistoryRef.current = persistentHistory;
|
|
539742
539550
|
}, [persistentHistory]);
|
|
539743
|
-
(0,
|
|
539551
|
+
(0, import_react86.useEffect)(() => {
|
|
539744
539552
|
historyManager.getEntries().then((entries) => {
|
|
539745
539553
|
setPersistentHistory(entries);
|
|
539746
539554
|
});
|
|
539747
539555
|
}, []);
|
|
539748
|
-
(0,
|
|
539556
|
+
(0, import_react86.useEffect)(() => {
|
|
539749
539557
|
return () => {
|
|
539750
539558
|
if (escapeKeyTimer.current) {
|
|
539751
539559
|
clearTimeout(escapeKeyTimer.current);
|
|
539752
539560
|
}
|
|
539753
539561
|
};
|
|
539754
539562
|
}, []);
|
|
539755
|
-
const getUserMessages = (0,
|
|
539563
|
+
const getUserMessages = (0, import_react86.useCallback)(() => {
|
|
539756
539564
|
const userMessages = chatHistory.map((msg, index) => ({ ...msg, originalIndex: index })).filter((msg) => msg.role === "user" && msg.content.trim());
|
|
539757
539565
|
return userMessages.map((msg, index) => {
|
|
539758
539566
|
const cleanedContent = cleanIDEContext(msg.content);
|
|
@@ -539765,7 +539573,7 @@ function useHistoryNavigation(buffer, triggerUpdate, chatHistory, onHistorySelec
|
|
|
539765
539573
|
};
|
|
539766
539574
|
});
|
|
539767
539575
|
}, [chatHistory]);
|
|
539768
|
-
const handleHistorySelect = (0,
|
|
539576
|
+
const handleHistorySelect = (0, import_react86.useCallback)((value) => {
|
|
539769
539577
|
const selectedIndex = parseInt(value, 10);
|
|
539770
539578
|
const selectedMessage = chatHistory[selectedIndex];
|
|
539771
539579
|
if (selectedMessage && onHistorySelect) {
|
|
@@ -539778,7 +539586,7 @@ function useHistoryNavigation(buffer, triggerUpdate, chatHistory, onHistorySelec
|
|
|
539778
539586
|
);
|
|
539779
539587
|
}
|
|
539780
539588
|
}, [chatHistory, onHistorySelect]);
|
|
539781
|
-
const navigateHistoryUp = (0,
|
|
539589
|
+
const navigateHistoryUp = (0, import_react86.useCallback)(() => {
|
|
539782
539590
|
const history = persistentHistoryRef.current;
|
|
539783
539591
|
if (history.length === 0)
|
|
539784
539592
|
return false;
|
|
@@ -539794,7 +539602,7 @@ function useHistoryNavigation(buffer, triggerUpdate, chatHistory, onHistorySelec
|
|
|
539794
539602
|
}
|
|
539795
539603
|
return true;
|
|
539796
539604
|
}, [currentHistoryIndex]);
|
|
539797
|
-
const navigateHistoryDown = (0,
|
|
539605
|
+
const navigateHistoryDown = (0, import_react86.useCallback)(() => {
|
|
539798
539606
|
if (currentHistoryIndex === -1)
|
|
539799
539607
|
return false;
|
|
539800
539608
|
const newIndex = currentHistoryIndex - 1;
|
|
@@ -539813,11 +539621,11 @@ function useHistoryNavigation(buffer, triggerUpdate, chatHistory, onHistorySelec
|
|
|
539813
539621
|
triggerUpdate();
|
|
539814
539622
|
return true;
|
|
539815
539623
|
}, [currentHistoryIndex]);
|
|
539816
|
-
const resetHistoryNavigation = (0,
|
|
539624
|
+
const resetHistoryNavigation = (0, import_react86.useCallback)(() => {
|
|
539817
539625
|
setCurrentHistoryIndex(-1);
|
|
539818
539626
|
savedInput.current = "";
|
|
539819
539627
|
}, []);
|
|
539820
|
-
const saveToHistory = (0,
|
|
539628
|
+
const saveToHistory = (0, import_react86.useCallback)(async (content) => {
|
|
539821
539629
|
await historyManager.addEntry(content);
|
|
539822
539630
|
const entries = await historyManager.getEntries();
|
|
539823
539631
|
setPersistentHistory(entries);
|
|
@@ -539840,11 +539648,11 @@ function useHistoryNavigation(buffer, triggerUpdate, chatHistory, onHistorySelec
|
|
|
539840
539648
|
saveToHistory
|
|
539841
539649
|
};
|
|
539842
539650
|
}
|
|
539843
|
-
var
|
|
539651
|
+
var import_react86;
|
|
539844
539652
|
var init_useHistoryNavigation = __esm({
|
|
539845
539653
|
"dist/hooks/input/useHistoryNavigation.js"() {
|
|
539846
539654
|
"use strict";
|
|
539847
|
-
|
|
539655
|
+
import_react86 = __toESM(require_react(), 1);
|
|
539848
539656
|
init_fileUtils();
|
|
539849
539657
|
init_historyManager();
|
|
539850
539658
|
}
|
|
@@ -539853,7 +539661,7 @@ var init_useHistoryNavigation = __esm({
|
|
|
539853
539661
|
// dist/hooks/input/useClipboard.js
|
|
539854
539662
|
import { execSync as execSync5 } from "child_process";
|
|
539855
539663
|
function useClipboard(buffer, updateCommandPanelState, updateFilePickerState, triggerUpdate) {
|
|
539856
|
-
const pasteFromClipboard = (0,
|
|
539664
|
+
const pasteFromClipboard = (0, import_react87.useCallback)(async () => {
|
|
539857
539665
|
try {
|
|
539858
539666
|
if (process.platform === "win32") {
|
|
539859
539667
|
try {
|
|
@@ -539973,11 +539781,11 @@ end try'`;
|
|
|
539973
539781
|
}, [buffer, updateCommandPanelState, updateFilePickerState, triggerUpdate]);
|
|
539974
539782
|
return { pasteFromClipboard };
|
|
539975
539783
|
}
|
|
539976
|
-
var
|
|
539784
|
+
var import_react87;
|
|
539977
539785
|
var init_useClipboard = __esm({
|
|
539978
539786
|
"dist/hooks/input/useClipboard.js"() {
|
|
539979
539787
|
"use strict";
|
|
539980
|
-
|
|
539788
|
+
import_react87 = __toESM(require_react(), 1);
|
|
539981
539789
|
init_logger();
|
|
539982
539790
|
}
|
|
539983
539791
|
});
|
|
@@ -539987,13 +539795,13 @@ function useKeyboardInput(options3) {
|
|
|
539987
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;
|
|
539988
539796
|
void todoSelectedIndex;
|
|
539989
539797
|
void selectedTodos;
|
|
539990
|
-
const inputBuffer = (0,
|
|
539991
|
-
const inputTimer = (0,
|
|
539992
|
-
const isPasting = (0,
|
|
539993
|
-
const inputStartCursorPos = (0,
|
|
539994
|
-
const isProcessingInput = (0,
|
|
539995
|
-
const componentMountTime = (0,
|
|
539996
|
-
(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)(() => {
|
|
539997
539805
|
return () => {
|
|
539998
539806
|
if (inputTimer.current) {
|
|
539999
539807
|
clearTimeout(inputTimer.current);
|
|
@@ -540672,11 +540480,11 @@ function useKeyboardInput(options3) {
|
|
|
540672
540480
|
}
|
|
540673
540481
|
});
|
|
540674
540482
|
}
|
|
540675
|
-
var
|
|
540483
|
+
var import_react88;
|
|
540676
540484
|
var init_useKeyboardInput = __esm({
|
|
540677
540485
|
async "dist/hooks/input/useKeyboardInput.js"() {
|
|
540678
540486
|
"use strict";
|
|
540679
|
-
|
|
540487
|
+
import_react88 = __toESM(require_react(), 1);
|
|
540680
540488
|
await init_build2();
|
|
540681
540489
|
init_commandExecutor();
|
|
540682
540490
|
init_commandUsageManager();
|
|
@@ -540685,8 +540493,8 @@ var init_useKeyboardInput = __esm({
|
|
|
540685
540493
|
|
|
540686
540494
|
// dist/hooks/ui/useTerminalFocus.js
|
|
540687
540495
|
function useTerminalFocus() {
|
|
540688
|
-
const [hasFocus, setHasFocus] = (0,
|
|
540689
|
-
(0,
|
|
540496
|
+
const [hasFocus, setHasFocus] = (0, import_react89.useState)(true);
|
|
540497
|
+
(0, import_react89.useEffect)(() => {
|
|
540690
540498
|
let syncTimer = null;
|
|
540691
540499
|
const handleData = (data) => {
|
|
540692
540500
|
const str2 = data.toString();
|
|
@@ -540728,29 +540536,29 @@ function useTerminalFocus() {
|
|
|
540728
540536
|
};
|
|
540729
540537
|
return { hasFocus, isFocusEvent, ensureFocus };
|
|
540730
540538
|
}
|
|
540731
|
-
var
|
|
540539
|
+
var import_react89;
|
|
540732
540540
|
var init_useTerminalFocus = __esm({
|
|
540733
540541
|
"dist/hooks/ui/useTerminalFocus.js"() {
|
|
540734
540542
|
"use strict";
|
|
540735
|
-
|
|
540543
|
+
import_react89 = __toESM(require_react(), 1);
|
|
540736
540544
|
}
|
|
540737
540545
|
});
|
|
540738
540546
|
|
|
540739
540547
|
// dist/hooks/picker/useAgentPicker.js
|
|
540740
540548
|
function useAgentPicker(buffer, triggerUpdate) {
|
|
540741
|
-
const [showAgentPicker, setShowAgentPicker] = (0,
|
|
540742
|
-
const [agentSelectedIndex, setAgentSelectedIndex] = (0,
|
|
540743
|
-
const [agents, setAgents] = (0,
|
|
540744
|
-
const [agentQuery, setAgentQuery] = (0,
|
|
540745
|
-
const [hashSymbolPosition, setHashSymbolPosition] = (0,
|
|
540746
|
-
(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)(() => {
|
|
540747
540555
|
if (showAgentPicker) {
|
|
540748
540556
|
const loadedAgents = getSubAgents();
|
|
540749
540557
|
setAgents(loadedAgents);
|
|
540750
540558
|
setAgentSelectedIndex(0);
|
|
540751
540559
|
}
|
|
540752
540560
|
}, [showAgentPicker]);
|
|
540753
|
-
const updateAgentPickerState = (0,
|
|
540561
|
+
const updateAgentPickerState = (0, import_react90.useCallback)((_text, cursorPos) => {
|
|
540754
540562
|
const displayText = buffer.text;
|
|
540755
540563
|
const beforeCursor = displayText.slice(0, cursorPos);
|
|
540756
540564
|
let position = -1;
|
|
@@ -540787,14 +540595,14 @@ function useAgentPicker(buffer, triggerUpdate) {
|
|
|
540787
540595
|
}
|
|
540788
540596
|
}
|
|
540789
540597
|
}, [buffer, showAgentPicker, agentQuery, hashSymbolPosition]);
|
|
540790
|
-
const getFilteredAgents = (0,
|
|
540598
|
+
const getFilteredAgents = (0, import_react90.useCallback)(() => {
|
|
540791
540599
|
if (!agentQuery) {
|
|
540792
540600
|
return agents;
|
|
540793
540601
|
}
|
|
540794
540602
|
const query = agentQuery.toLowerCase();
|
|
540795
540603
|
return agents.filter((agent) => agent.id.toLowerCase().includes(query) || agent.name.toLowerCase().includes(query) || agent.description.toLowerCase().includes(query));
|
|
540796
540604
|
}, [agents, agentQuery]);
|
|
540797
|
-
const handleAgentSelect = (0,
|
|
540605
|
+
const handleAgentSelect = (0, import_react90.useCallback)((agent) => {
|
|
540798
540606
|
if (hashSymbolPosition !== -1) {
|
|
540799
540607
|
const displayText = buffer.text;
|
|
540800
540608
|
const cursorPos = buffer.getCursorPosition();
|
|
@@ -540832,11 +540640,11 @@ function useAgentPicker(buffer, triggerUpdate) {
|
|
|
540832
540640
|
handleAgentSelect
|
|
540833
540641
|
};
|
|
540834
540642
|
}
|
|
540835
|
-
var
|
|
540643
|
+
var import_react90;
|
|
540836
540644
|
var init_useAgentPicker = __esm({
|
|
540837
540645
|
"dist/hooks/picker/useAgentPicker.js"() {
|
|
540838
540646
|
"use strict";
|
|
540839
|
-
|
|
540647
|
+
import_react90 = __toESM(require_react(), 1);
|
|
540840
540648
|
init_subAgentConfig();
|
|
540841
540649
|
}
|
|
540842
540650
|
});
|
|
@@ -540992,20 +540800,20 @@ var init_todoScanner = __esm({
|
|
|
540992
540800
|
|
|
540993
540801
|
// dist/hooks/picker/useTodoPicker.js
|
|
540994
540802
|
function useTodoPicker(buffer, triggerUpdate, projectRoot) {
|
|
540995
|
-
const [showTodoPicker, setShowTodoPicker] = (0,
|
|
540996
|
-
const [todoSelectedIndex, setTodoSelectedIndex] = (0,
|
|
540997
|
-
const [allTodos, setAllTodos] = (0,
|
|
540998
|
-
const [selectedTodos, setSelectedTodos] = (0,
|
|
540999
|
-
const [isLoading, setIsLoading] = (0,
|
|
541000
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
541001
|
-
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)(() => {
|
|
541002
540810
|
if (!searchQuery.trim()) {
|
|
541003
540811
|
return allTodos;
|
|
541004
540812
|
}
|
|
541005
540813
|
const query = searchQuery.toLowerCase();
|
|
541006
540814
|
return allTodos.filter((todo) => todo.content.toLowerCase().includes(query) || todo.file.toLowerCase().includes(query));
|
|
541007
540815
|
}, [allTodos, searchQuery]);
|
|
541008
|
-
(0,
|
|
540816
|
+
(0, import_react91.useEffect)(() => {
|
|
541009
540817
|
if (showTodoPicker) {
|
|
541010
540818
|
setIsLoading(true);
|
|
541011
540819
|
setSearchQuery("");
|
|
@@ -541018,7 +540826,7 @@ function useTodoPicker(buffer, triggerUpdate, projectRoot) {
|
|
|
541018
540826
|
}, 0);
|
|
541019
540827
|
}
|
|
541020
540828
|
}, [showTodoPicker, projectRoot]);
|
|
541021
|
-
const toggleTodoSelection = (0,
|
|
540829
|
+
const toggleTodoSelection = (0, import_react91.useCallback)(() => {
|
|
541022
540830
|
if (filteredTodos.length > 0 && todoSelectedIndex < filteredTodos.length) {
|
|
541023
540831
|
const todo = filteredTodos[todoSelectedIndex];
|
|
541024
540832
|
if (todo) {
|
|
@@ -541035,7 +540843,7 @@ function useTodoPicker(buffer, triggerUpdate, projectRoot) {
|
|
|
541035
540843
|
}
|
|
541036
540844
|
}
|
|
541037
540845
|
}, [filteredTodos, todoSelectedIndex, triggerUpdate]);
|
|
541038
|
-
const confirmTodoSelection = (0,
|
|
540846
|
+
const confirmTodoSelection = (0, import_react91.useCallback)(() => {
|
|
541039
540847
|
if (selectedTodos.size === 0) {
|
|
541040
540848
|
setShowTodoPicker(false);
|
|
541041
540849
|
setTodoSelectedIndex(0);
|
|
@@ -541071,24 +540879,24 @@ function useTodoPicker(buffer, triggerUpdate, projectRoot) {
|
|
|
541071
540879
|
totalTodoCount: allTodos.length
|
|
541072
540880
|
};
|
|
541073
540881
|
}
|
|
541074
|
-
var
|
|
540882
|
+
var import_react91;
|
|
541075
540883
|
var init_useTodoPicker = __esm({
|
|
541076
540884
|
"dist/hooks/picker/useTodoPicker.js"() {
|
|
541077
540885
|
"use strict";
|
|
541078
|
-
|
|
540886
|
+
import_react91 = __toESM(require_react(), 1);
|
|
541079
540887
|
init_todoScanner();
|
|
541080
540888
|
}
|
|
541081
540889
|
});
|
|
541082
540890
|
|
|
541083
540891
|
// dist/hooks/input/useBashMode.js
|
|
541084
540892
|
function useBashMode() {
|
|
541085
|
-
const [state, setState] = (0,
|
|
540893
|
+
const [state, setState] = (0, import_react92.useState)({
|
|
541086
540894
|
isExecuting: false,
|
|
541087
540895
|
currentCommand: null,
|
|
541088
540896
|
currentTimeout: null,
|
|
541089
540897
|
executionResults: /* @__PURE__ */ new Map()
|
|
541090
540898
|
});
|
|
541091
|
-
const parseBashCommands = (0,
|
|
540899
|
+
const parseBashCommands = (0, import_react92.useCallback)((message) => {
|
|
541092
540900
|
var _a21;
|
|
541093
540901
|
const commands = [];
|
|
541094
540902
|
const regex2 = /!`([^`]+)`(?:<(\d+)>)?/g;
|
|
@@ -541109,10 +540917,10 @@ function useBashMode() {
|
|
|
541109
540917
|
}
|
|
541110
540918
|
return commands;
|
|
541111
540919
|
}, []);
|
|
541112
|
-
const checkSensitiveCommand = (0,
|
|
540920
|
+
const checkSensitiveCommand = (0, import_react92.useCallback)((command) => {
|
|
541113
540921
|
return isSensitiveCommand(command);
|
|
541114
540922
|
}, []);
|
|
541115
|
-
const executeCommand2 = (0,
|
|
540923
|
+
const executeCommand2 = (0, import_react92.useCallback)(async (command, timeout2 = 3e4) => {
|
|
541116
540924
|
setState((prev) => ({
|
|
541117
540925
|
...prev,
|
|
541118
540926
|
isExecuting: true,
|
|
@@ -541184,7 +540992,7 @@ function useBashMode() {
|
|
|
541184
540992
|
});
|
|
541185
540993
|
});
|
|
541186
540994
|
}, []);
|
|
541187
|
-
const processBashMessage = (0,
|
|
540995
|
+
const processBashMessage = (0, import_react92.useCallback)(async (message, onSensitiveCommand) => {
|
|
541188
540996
|
const commands = parseBashCommands(message);
|
|
541189
540997
|
if (commands.length === 0) {
|
|
541190
540998
|
return {
|
|
@@ -541245,7 +541053,7 @@ ${output2}
|
|
|
541245
541053
|
results
|
|
541246
541054
|
};
|
|
541247
541055
|
}, [parseBashCommands, checkSensitiveCommand, executeCommand2]);
|
|
541248
|
-
const resetState = (0,
|
|
541056
|
+
const resetState = (0, import_react92.useCallback)(() => {
|
|
541249
541057
|
setState({
|
|
541250
541058
|
isExecuting: false,
|
|
541251
541059
|
currentCommand: null,
|
|
@@ -541262,11 +541070,11 @@ ${output2}
|
|
|
541262
541070
|
resetState
|
|
541263
541071
|
};
|
|
541264
541072
|
}
|
|
541265
|
-
var
|
|
541073
|
+
var import_react92;
|
|
541266
541074
|
var init_useBashMode = __esm({
|
|
541267
541075
|
"dist/hooks/input/useBashMode.js"() {
|
|
541268
541076
|
"use strict";
|
|
541269
|
-
|
|
541077
|
+
import_react92 = __toESM(require_react(), 1);
|
|
541270
541078
|
init_sensitiveCommandManager();
|
|
541271
541079
|
}
|
|
541272
541080
|
});
|
|
@@ -541276,21 +541084,21 @@ var CommandPanel_exports = {};
|
|
|
541276
541084
|
__export(CommandPanel_exports, {
|
|
541277
541085
|
default: () => CommandPanel_default
|
|
541278
541086
|
});
|
|
541279
|
-
var
|
|
541087
|
+
var import_react93, CommandPanel, CommandPanel_default;
|
|
541280
541088
|
var init_CommandPanel = __esm({
|
|
541281
541089
|
async "dist/ui/components/panels/CommandPanel.js"() {
|
|
541282
541090
|
"use strict";
|
|
541283
|
-
|
|
541091
|
+
import_react93 = __toESM(require_react(), 1);
|
|
541284
541092
|
await init_build2();
|
|
541285
541093
|
await init_build4();
|
|
541286
541094
|
init_i18n();
|
|
541287
541095
|
init_ThemeContext();
|
|
541288
|
-
CommandPanel = (0,
|
|
541096
|
+
CommandPanel = (0, import_react93.memo)(({ commands, selectedIndex, visible, maxHeight, isProcessing = false }) => {
|
|
541289
541097
|
const { t } = useI18n();
|
|
541290
541098
|
const { theme: theme14 } = useTheme();
|
|
541291
541099
|
const MAX_DISPLAY_ITEMS = 5;
|
|
541292
541100
|
const effectiveMaxItems = maxHeight ? Math.min(maxHeight, MAX_DISPLAY_ITEMS) : MAX_DISPLAY_ITEMS;
|
|
541293
|
-
const displayedCommands = (0,
|
|
541101
|
+
const displayedCommands = (0, import_react93.useMemo)(() => {
|
|
541294
541102
|
if (commands.length <= effectiveMaxItems) {
|
|
541295
541103
|
return commands;
|
|
541296
541104
|
}
|
|
@@ -541302,7 +541110,7 @@ var init_CommandPanel = __esm({
|
|
|
541302
541110
|
}
|
|
541303
541111
|
return commands.slice(startIndex, endIndex);
|
|
541304
541112
|
}, [commands, selectedIndex, effectiveMaxItems]);
|
|
541305
|
-
const displayedSelectedIndex = (0,
|
|
541113
|
+
const displayedSelectedIndex = (0, import_react93.useMemo)(() => {
|
|
541306
541114
|
return displayedCommands.findIndex((cmd) => {
|
|
541307
541115
|
const originalIndex = commands.indexOf(cmd);
|
|
541308
541116
|
return originalIndex === selectedIndex;
|
|
@@ -541312,24 +541120,24 @@ var init_CommandPanel = __esm({
|
|
|
541312
541120
|
return null;
|
|
541313
541121
|
}
|
|
541314
541122
|
if (isProcessing) {
|
|
541315
|
-
return
|
|
541123
|
+
return import_react93.default.createElement(
|
|
541316
541124
|
Box_default,
|
|
541317
541125
|
{ flexDirection: "column" },
|
|
541318
|
-
|
|
541126
|
+
import_react93.default.createElement(
|
|
541319
541127
|
Box_default,
|
|
541320
541128
|
{ width: "100%" },
|
|
541321
|
-
|
|
541129
|
+
import_react93.default.createElement(
|
|
541322
541130
|
Box_default,
|
|
541323
541131
|
{ flexDirection: "column", width: "100%" },
|
|
541324
|
-
|
|
541132
|
+
import_react93.default.createElement(
|
|
541325
541133
|
Box_default,
|
|
541326
541134
|
null,
|
|
541327
|
-
|
|
541135
|
+
import_react93.default.createElement(Text, { color: theme14.colors.warning, bold: true }, t.commandPanel.title)
|
|
541328
541136
|
),
|
|
541329
|
-
|
|
541137
|
+
import_react93.default.createElement(
|
|
541330
541138
|
Box_default,
|
|
541331
541139
|
{ marginTop: 1 },
|
|
541332
|
-
|
|
541140
|
+
import_react93.default.createElement(Alert, { variant: "info" }, t.commandPanel.processingMessage)
|
|
541333
541141
|
)
|
|
541334
541142
|
)
|
|
541335
541143
|
)
|
|
@@ -541338,19 +541146,19 @@ var init_CommandPanel = __esm({
|
|
|
541338
541146
|
if (commands.length === 0) {
|
|
541339
541147
|
return null;
|
|
541340
541148
|
}
|
|
541341
|
-
return
|
|
541149
|
+
return import_react93.default.createElement(
|
|
541342
541150
|
Box_default,
|
|
541343
541151
|
{ flexDirection: "column" },
|
|
541344
|
-
|
|
541152
|
+
import_react93.default.createElement(
|
|
541345
541153
|
Box_default,
|
|
541346
541154
|
{ width: "100%" },
|
|
541347
|
-
|
|
541155
|
+
import_react93.default.createElement(
|
|
541348
541156
|
Box_default,
|
|
541349
541157
|
{ flexDirection: "column", width: "100%" },
|
|
541350
|
-
|
|
541158
|
+
import_react93.default.createElement(
|
|
541351
541159
|
Box_default,
|
|
541352
541160
|
null,
|
|
541353
|
-
|
|
541161
|
+
import_react93.default.createElement(
|
|
541354
541162
|
Text,
|
|
541355
541163
|
{ color: theme14.colors.warning, bold: true },
|
|
541356
541164
|
t.commandPanel.availableCommands,
|
|
@@ -541358,20 +541166,20 @@ var init_CommandPanel = __esm({
|
|
|
541358
541166
|
commands.length > effectiveMaxItems && `(${selectedIndex + 1}/${commands.length})`
|
|
541359
541167
|
)
|
|
541360
541168
|
),
|
|
541361
|
-
displayedCommands.map((command, index) =>
|
|
541169
|
+
displayedCommands.map((command, index) => import_react93.default.createElement(
|
|
541362
541170
|
Box_default,
|
|
541363
541171
|
{ key: command.name, flexDirection: "column", width: "100%" },
|
|
541364
|
-
|
|
541172
|
+
import_react93.default.createElement(
|
|
541365
541173
|
Text,
|
|
541366
541174
|
{ color: index === displayedSelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: true },
|
|
541367
541175
|
index === displayedSelectedIndex ? "\u276F " : " ",
|
|
541368
541176
|
"/",
|
|
541369
541177
|
command.name
|
|
541370
541178
|
),
|
|
541371
|
-
|
|
541179
|
+
import_react93.default.createElement(
|
|
541372
541180
|
Box_default,
|
|
541373
541181
|
{ marginLeft: 3 },
|
|
541374
|
-
|
|
541182
|
+
import_react93.default.createElement(
|
|
541375
541183
|
Text,
|
|
541376
541184
|
{ color: index === displayedSelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, dimColor: true },
|
|
541377
541185
|
"\u2514\u2500 ",
|
|
@@ -541379,10 +541187,10 @@ var init_CommandPanel = __esm({
|
|
|
541379
541187
|
)
|
|
541380
541188
|
)
|
|
541381
541189
|
)),
|
|
541382
|
-
commands.length > effectiveMaxItems &&
|
|
541190
|
+
commands.length > effectiveMaxItems && import_react93.default.createElement(
|
|
541383
541191
|
Box_default,
|
|
541384
541192
|
{ marginTop: 1 },
|
|
541385
|
-
|
|
541193
|
+
import_react93.default.createElement(
|
|
541386
541194
|
Text,
|
|
541387
541195
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
541388
541196
|
t.commandPanel.scrollHint,
|
|
@@ -541407,28 +541215,28 @@ __export(FileList_exports, {
|
|
|
541407
541215
|
});
|
|
541408
541216
|
import fs35 from "fs";
|
|
541409
541217
|
import path47 from "path";
|
|
541410
|
-
var
|
|
541218
|
+
var import_react94, FileList, FileList_default;
|
|
541411
541219
|
var init_FileList = __esm({
|
|
541412
541220
|
async "dist/ui/components/tools/FileList.js"() {
|
|
541413
541221
|
"use strict";
|
|
541414
|
-
|
|
541222
|
+
import_react94 = __toESM(require_react(), 1);
|
|
541415
541223
|
await init_build2();
|
|
541416
541224
|
init_useTerminalSize();
|
|
541417
541225
|
init_ThemeContext();
|
|
541418
541226
|
init_workingDirConfig();
|
|
541419
|
-
FileList = (0,
|
|
541227
|
+
FileList = (0, import_react94.memo)((0, import_react94.forwardRef)(({ query, selectedIndex, visible, maxItems = 10, rootPath = process.cwd(), onFilteredCountChange, searchMode = "file" }, ref) => {
|
|
541420
541228
|
const { theme: theme14 } = useTheme();
|
|
541421
|
-
const [files, setFiles] = (0,
|
|
541422
|
-
const [isLoading, setIsLoading] = (0,
|
|
541423
|
-
const [searchDepth, setSearchDepth] = (0,
|
|
541424
|
-
const [isIncreasingDepth, setIsIncreasingDepth] = (0,
|
|
541425
|
-
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);
|
|
541426
541234
|
const { columns: terminalWidth } = useTerminalSize();
|
|
541427
541235
|
const MAX_DISPLAY_ITEMS = 5;
|
|
541428
|
-
const effectiveMaxItems = (0,
|
|
541236
|
+
const effectiveMaxItems = (0, import_react94.useMemo)(() => {
|
|
541429
541237
|
return maxItems ? Math.min(maxItems, MAX_DISPLAY_ITEMS) : MAX_DISPLAY_ITEMS;
|
|
541430
541238
|
}, [maxItems]);
|
|
541431
|
-
const loadFiles = (0,
|
|
541239
|
+
const loadFiles = (0, import_react94.useCallback)(async () => {
|
|
541432
541240
|
const MAX_FILES = 3e3;
|
|
541433
541241
|
const workingDirs = await getWorkingDirectories();
|
|
541434
541242
|
const allFiles = [];
|
|
@@ -541531,7 +541339,7 @@ var init_FileList = __esm({
|
|
|
541531
541339
|
setHasMoreDepth(hitDepthLimit);
|
|
541532
541340
|
setIsLoading(false);
|
|
541533
541341
|
}, [searchDepth]);
|
|
541534
|
-
const searchFileContent = (0,
|
|
541342
|
+
const searchFileContent = (0, import_react94.useCallback)(async (query2) => {
|
|
541535
541343
|
if (!query2.trim()) {
|
|
541536
541344
|
return [];
|
|
541537
541345
|
}
|
|
@@ -541637,14 +541445,14 @@ var init_FileList = __esm({
|
|
|
541637
541445
|
}
|
|
541638
541446
|
return results;
|
|
541639
541447
|
}, [files, rootPath, terminalWidth]);
|
|
541640
|
-
(0,
|
|
541448
|
+
(0, import_react94.useEffect)(() => {
|
|
541641
541449
|
if (!visible) {
|
|
541642
541450
|
return;
|
|
541643
541451
|
}
|
|
541644
541452
|
loadFiles();
|
|
541645
541453
|
}, [visible, rootPath, loadFiles]);
|
|
541646
|
-
const [allFilteredFiles, setAllFilteredFiles] = (0,
|
|
541647
|
-
(0,
|
|
541454
|
+
const [allFilteredFiles, setAllFilteredFiles] = (0, import_react94.useState)([]);
|
|
541455
|
+
(0, import_react94.useEffect)(() => {
|
|
541648
541456
|
const performSearch = async () => {
|
|
541649
541457
|
if (!query.trim()) {
|
|
541650
541458
|
setAllFilteredFiles(files);
|
|
@@ -541694,7 +541502,7 @@ var init_FileList = __esm({
|
|
|
541694
541502
|
loadFiles,
|
|
541695
541503
|
hasMoreDepth
|
|
541696
541504
|
]);
|
|
541697
|
-
const filteredFiles = (0,
|
|
541505
|
+
const filteredFiles = (0, import_react94.useMemo)(() => {
|
|
541698
541506
|
if (allFilteredFiles.length <= effectiveMaxItems) {
|
|
541699
541507
|
return allFilteredFiles;
|
|
541700
541508
|
}
|
|
@@ -541706,12 +541514,12 @@ var init_FileList = __esm({
|
|
|
541706
541514
|
}
|
|
541707
541515
|
return allFilteredFiles.slice(startIndex, endIndex);
|
|
541708
541516
|
}, [allFilteredFiles, selectedIndex, effectiveMaxItems]);
|
|
541709
|
-
(0,
|
|
541517
|
+
(0, import_react94.useEffect)(() => {
|
|
541710
541518
|
if (onFilteredCountChange) {
|
|
541711
541519
|
onFilteredCountChange(allFilteredFiles.length);
|
|
541712
541520
|
}
|
|
541713
541521
|
}, [allFilteredFiles.length, onFilteredCountChange]);
|
|
541714
|
-
(0,
|
|
541522
|
+
(0, import_react94.useImperativeHandle)(ref, () => ({
|
|
541715
541523
|
getSelectedFile: () => {
|
|
541716
541524
|
if (allFilteredFiles.length > 0 && selectedIndex < allFilteredFiles.length && allFilteredFiles[selectedIndex]) {
|
|
541717
541525
|
const selectedFile = allFilteredFiles[selectedIndex];
|
|
@@ -541725,7 +541533,7 @@ var init_FileList = __esm({
|
|
|
541725
541533
|
return null;
|
|
541726
541534
|
}
|
|
541727
541535
|
}), [allFilteredFiles, selectedIndex, rootPath]);
|
|
541728
|
-
const displaySelectedIndex = (0,
|
|
541536
|
+
const displaySelectedIndex = (0, import_react94.useMemo)(() => {
|
|
541729
541537
|
return filteredFiles.findIndex((file) => {
|
|
541730
541538
|
const originalIndex = allFilteredFiles.indexOf(file);
|
|
541731
541539
|
return originalIndex === selectedIndex;
|
|
@@ -541735,26 +541543,26 @@ var init_FileList = __esm({
|
|
|
541735
541543
|
return null;
|
|
541736
541544
|
}
|
|
541737
541545
|
if (isLoading) {
|
|
541738
|
-
return
|
|
541546
|
+
return import_react94.default.createElement(
|
|
541739
541547
|
Box_default,
|
|
541740
541548
|
{ paddingX: 1, marginTop: 1 },
|
|
541741
|
-
|
|
541549
|
+
import_react94.default.createElement(Text, { color: "blue", dimColor: true }, isIncreasingDepth ? `Searching deeper directories (depth: ${searchDepth})...` : "Loading files...")
|
|
541742
541550
|
);
|
|
541743
541551
|
}
|
|
541744
541552
|
if (filteredFiles.length === 0) {
|
|
541745
|
-
return
|
|
541553
|
+
return import_react94.default.createElement(
|
|
541746
541554
|
Box_default,
|
|
541747
541555
|
{ paddingX: 1, marginTop: 1 },
|
|
541748
|
-
|
|
541556
|
+
import_react94.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, isIncreasingDepth ? "Searching deeper directories..." : "No files found")
|
|
541749
541557
|
);
|
|
541750
541558
|
}
|
|
541751
|
-
return
|
|
541559
|
+
return import_react94.default.createElement(
|
|
541752
541560
|
Box_default,
|
|
541753
541561
|
{ paddingX: 1, marginTop: 1, flexDirection: "column" },
|
|
541754
|
-
|
|
541562
|
+
import_react94.default.createElement(
|
|
541755
541563
|
Box_default,
|
|
541756
541564
|
{ marginBottom: 1 },
|
|
541757
|
-
|
|
541565
|
+
import_react94.default.createElement(
|
|
541758
541566
|
Text,
|
|
541759
541567
|
{ color: "blue", bold: true },
|
|
541760
541568
|
searchMode === "content" ? "\u2261 Content Search" : "\u2261 Files",
|
|
@@ -541762,21 +541570,21 @@ var init_FileList = __esm({
|
|
|
541762
541570
|
allFilteredFiles.length > effectiveMaxItems && `(${selectedIndex + 1}/${allFilteredFiles.length})`
|
|
541763
541571
|
)
|
|
541764
541572
|
),
|
|
541765
|
-
filteredFiles.map((file, index) =>
|
|
541573
|
+
filteredFiles.map((file, index) => import_react94.default.createElement(
|
|
541766
541574
|
Box_default,
|
|
541767
541575
|
{ key: `${file.path}-${file.lineNumber || 0}`, flexDirection: "column" },
|
|
541768
|
-
|
|
541769
|
-
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(
|
|
541770
541578
|
Text,
|
|
541771
541579
|
{ backgroundColor: index === displaySelectedIndex ? theme14.colors.menuSelected : void 0, color: index === displaySelectedIndex ? theme14.colors.menuSecondary : theme14.colors.menuSecondary, dimColor: true },
|
|
541772
541580
|
" ",
|
|
541773
541581
|
file.lineContent
|
|
541774
541582
|
)
|
|
541775
541583
|
)),
|
|
541776
|
-
allFilteredFiles.length > effectiveMaxItems &&
|
|
541584
|
+
allFilteredFiles.length > effectiveMaxItems && import_react94.default.createElement(
|
|
541777
541585
|
Box_default,
|
|
541778
541586
|
{ marginTop: 1 },
|
|
541779
|
-
|
|
541587
|
+
import_react94.default.createElement(
|
|
541780
541588
|
Text,
|
|
541781
541589
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
541782
541590
|
"\u2191\u2193 to scroll \xB7 ",
|
|
@@ -541797,19 +541605,19 @@ var AgentPickerPanel_exports = {};
|
|
|
541797
541605
|
__export(AgentPickerPanel_exports, {
|
|
541798
541606
|
default: () => AgentPickerPanel_default
|
|
541799
541607
|
});
|
|
541800
|
-
var
|
|
541608
|
+
var import_react95, AgentPickerPanel, AgentPickerPanel_default;
|
|
541801
541609
|
var init_AgentPickerPanel = __esm({
|
|
541802
541610
|
async "dist/ui/components/panels/AgentPickerPanel.js"() {
|
|
541803
541611
|
"use strict";
|
|
541804
|
-
|
|
541612
|
+
import_react95 = __toESM(require_react(), 1);
|
|
541805
541613
|
await init_build2();
|
|
541806
541614
|
await init_build4();
|
|
541807
541615
|
init_ThemeContext();
|
|
541808
|
-
AgentPickerPanel = (0,
|
|
541616
|
+
AgentPickerPanel = (0, import_react95.memo)(({ agents, selectedIndex, visible, maxHeight }) => {
|
|
541809
541617
|
const { theme: theme14 } = useTheme();
|
|
541810
541618
|
const MAX_DISPLAY_ITEMS = 5;
|
|
541811
541619
|
const effectiveMaxItems = maxHeight ? Math.min(maxHeight, MAX_DISPLAY_ITEMS) : MAX_DISPLAY_ITEMS;
|
|
541812
|
-
const displayedAgents = (0,
|
|
541620
|
+
const displayedAgents = (0, import_react95.useMemo)(() => {
|
|
541813
541621
|
if (agents.length <= effectiveMaxItems) {
|
|
541814
541622
|
return agents;
|
|
541815
541623
|
}
|
|
@@ -541821,7 +541629,7 @@ var init_AgentPickerPanel = __esm({
|
|
|
541821
541629
|
}
|
|
541822
541630
|
return agents.slice(startIndex, endIndex);
|
|
541823
541631
|
}, [agents, selectedIndex, effectiveMaxItems]);
|
|
541824
|
-
const displayedSelectedIndex = (0,
|
|
541632
|
+
const displayedSelectedIndex = (0, import_react95.useMemo)(() => {
|
|
541825
541633
|
return displayedAgents.findIndex((agent) => {
|
|
541826
541634
|
const originalIndex = agents.indexOf(agent);
|
|
541827
541635
|
return originalIndex === selectedIndex;
|
|
@@ -541831,64 +541639,64 @@ var init_AgentPickerPanel = __esm({
|
|
|
541831
541639
|
return null;
|
|
541832
541640
|
}
|
|
541833
541641
|
if (agents.length === 0) {
|
|
541834
|
-
return
|
|
541642
|
+
return import_react95.default.createElement(
|
|
541835
541643
|
Box_default,
|
|
541836
541644
|
{ flexDirection: "column" },
|
|
541837
|
-
|
|
541645
|
+
import_react95.default.createElement(
|
|
541838
541646
|
Box_default,
|
|
541839
541647
|
{ width: "100%" },
|
|
541840
|
-
|
|
541648
|
+
import_react95.default.createElement(
|
|
541841
541649
|
Box_default,
|
|
541842
541650
|
{ flexDirection: "column", width: "100%" },
|
|
541843
|
-
|
|
541651
|
+
import_react95.default.createElement(
|
|
541844
541652
|
Box_default,
|
|
541845
541653
|
null,
|
|
541846
|
-
|
|
541654
|
+
import_react95.default.createElement(Text, { color: theme14.colors.warning, bold: true }, "Sub-Agent Selection")
|
|
541847
541655
|
),
|
|
541848
|
-
|
|
541656
|
+
import_react95.default.createElement(
|
|
541849
541657
|
Box_default,
|
|
541850
541658
|
{ marginTop: 1 },
|
|
541851
|
-
|
|
541659
|
+
import_react95.default.createElement(Alert, { variant: "warning" }, "No sub-agents configured. Please configure sub-agents first.")
|
|
541852
541660
|
)
|
|
541853
541661
|
)
|
|
541854
541662
|
)
|
|
541855
541663
|
);
|
|
541856
541664
|
}
|
|
541857
|
-
return
|
|
541665
|
+
return import_react95.default.createElement(
|
|
541858
541666
|
Box_default,
|
|
541859
541667
|
{ flexDirection: "column" },
|
|
541860
|
-
|
|
541668
|
+
import_react95.default.createElement(
|
|
541861
541669
|
Box_default,
|
|
541862
541670
|
{ width: "100%" },
|
|
541863
|
-
|
|
541671
|
+
import_react95.default.createElement(
|
|
541864
541672
|
Box_default,
|
|
541865
541673
|
{ flexDirection: "column", width: "100%" },
|
|
541866
|
-
|
|
541674
|
+
import_react95.default.createElement(
|
|
541867
541675
|
Box_default,
|
|
541868
541676
|
null,
|
|
541869
|
-
|
|
541677
|
+
import_react95.default.createElement(
|
|
541870
541678
|
Text,
|
|
541871
541679
|
{ color: theme14.colors.warning, bold: true },
|
|
541872
541680
|
"Select Sub-Agent",
|
|
541873
541681
|
" ",
|
|
541874
541682
|
agents.length > effectiveMaxItems && `(${selectedIndex + 1}/${agents.length})`
|
|
541875
541683
|
),
|
|
541876
|
-
|
|
541684
|
+
import_react95.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, "(Press ESC to close)")
|
|
541877
541685
|
),
|
|
541878
|
-
displayedAgents.map((agent, index) =>
|
|
541686
|
+
displayedAgents.map((agent, index) => import_react95.default.createElement(
|
|
541879
541687
|
Box_default,
|
|
541880
541688
|
{ key: agent.id, flexDirection: "column", width: "100%" },
|
|
541881
|
-
|
|
541689
|
+
import_react95.default.createElement(
|
|
541882
541690
|
Text,
|
|
541883
541691
|
{ color: index === displayedSelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: true },
|
|
541884
541692
|
index === displayedSelectedIndex ? "\u276F " : " ",
|
|
541885
541693
|
"#",
|
|
541886
541694
|
agent.name
|
|
541887
541695
|
),
|
|
541888
|
-
|
|
541696
|
+
import_react95.default.createElement(
|
|
541889
541697
|
Box_default,
|
|
541890
541698
|
{ marginLeft: 3 },
|
|
541891
|
-
|
|
541699
|
+
import_react95.default.createElement(
|
|
541892
541700
|
Text,
|
|
541893
541701
|
{ color: index === displayedSelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, dimColor: true },
|
|
541894
541702
|
"\u2514\u2500 ",
|
|
@@ -541896,10 +541704,10 @@ var init_AgentPickerPanel = __esm({
|
|
|
541896
541704
|
)
|
|
541897
541705
|
)
|
|
541898
541706
|
)),
|
|
541899
|
-
agents.length > effectiveMaxItems &&
|
|
541707
|
+
agents.length > effectiveMaxItems && import_react95.default.createElement(
|
|
541900
541708
|
Box_default,
|
|
541901
541709
|
{ marginTop: 1 },
|
|
541902
|
-
|
|
541710
|
+
import_react95.default.createElement(
|
|
541903
541711
|
Text,
|
|
541904
541712
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
541905
541713
|
"\u2191\u2193 to scroll \xB7 ",
|
|
@@ -541921,19 +541729,19 @@ var TodoPickerPanel_exports = {};
|
|
|
541921
541729
|
__export(TodoPickerPanel_exports, {
|
|
541922
541730
|
default: () => TodoPickerPanel_default
|
|
541923
541731
|
});
|
|
541924
|
-
var
|
|
541732
|
+
var import_react96, TodoPickerPanel, TodoPickerPanel_default;
|
|
541925
541733
|
var init_TodoPickerPanel = __esm({
|
|
541926
541734
|
async "dist/ui/components/panels/TodoPickerPanel.js"() {
|
|
541927
541735
|
"use strict";
|
|
541928
|
-
|
|
541736
|
+
import_react96 = __toESM(require_react(), 1);
|
|
541929
541737
|
await init_build2();
|
|
541930
541738
|
await init_build4();
|
|
541931
541739
|
init_ThemeContext();
|
|
541932
|
-
TodoPickerPanel = (0,
|
|
541740
|
+
TodoPickerPanel = (0, import_react96.memo)(({ todos, selectedIndex, selectedTodos, visible, maxHeight, isLoading = false, searchQuery = "", totalCount = 0 }) => {
|
|
541933
541741
|
const { theme: theme14 } = useTheme();
|
|
541934
541742
|
const MAX_DISPLAY_ITEMS = 5;
|
|
541935
541743
|
const effectiveMaxItems = maxHeight ? Math.min(maxHeight, MAX_DISPLAY_ITEMS) : MAX_DISPLAY_ITEMS;
|
|
541936
|
-
const displayedTodos = (0,
|
|
541744
|
+
const displayedTodos = (0, import_react96.useMemo)(() => {
|
|
541937
541745
|
if (todos.length <= effectiveMaxItems) {
|
|
541938
541746
|
return todos;
|
|
541939
541747
|
}
|
|
@@ -541945,7 +541753,7 @@ var init_TodoPickerPanel = __esm({
|
|
|
541945
541753
|
}
|
|
541946
541754
|
return todos.slice(startIndex, endIndex);
|
|
541947
541755
|
}, [todos, selectedIndex, effectiveMaxItems]);
|
|
541948
|
-
const displayedSelectedIndex = (0,
|
|
541756
|
+
const displayedSelectedIndex = (0, import_react96.useMemo)(() => {
|
|
541949
541757
|
return displayedTodos.findIndex((todo) => {
|
|
541950
541758
|
const originalIndex = todos.indexOf(todo);
|
|
541951
541759
|
return originalIndex === selectedIndex;
|
|
@@ -541955,72 +541763,72 @@ var init_TodoPickerPanel = __esm({
|
|
|
541955
541763
|
return null;
|
|
541956
541764
|
}
|
|
541957
541765
|
if (isLoading) {
|
|
541958
|
-
return
|
|
541766
|
+
return import_react96.default.createElement(
|
|
541959
541767
|
Box_default,
|
|
541960
541768
|
{ flexDirection: "column" },
|
|
541961
|
-
|
|
541769
|
+
import_react96.default.createElement(
|
|
541962
541770
|
Box_default,
|
|
541963
541771
|
{ width: "100%" },
|
|
541964
|
-
|
|
541772
|
+
import_react96.default.createElement(
|
|
541965
541773
|
Box_default,
|
|
541966
541774
|
{ flexDirection: "column", width: "100%" },
|
|
541967
|
-
|
|
541775
|
+
import_react96.default.createElement(
|
|
541968
541776
|
Box_default,
|
|
541969
541777
|
null,
|
|
541970
|
-
|
|
541778
|
+
import_react96.default.createElement(Text, { color: theme14.colors.warning, bold: true }, "TODO Selection")
|
|
541971
541779
|
),
|
|
541972
|
-
|
|
541780
|
+
import_react96.default.createElement(
|
|
541973
541781
|
Box_default,
|
|
541974
541782
|
{ marginTop: 1 },
|
|
541975
|
-
|
|
541783
|
+
import_react96.default.createElement(Alert, { variant: "info" }, "Scanning project for TODO comments...")
|
|
541976
541784
|
)
|
|
541977
541785
|
)
|
|
541978
541786
|
)
|
|
541979
541787
|
);
|
|
541980
541788
|
}
|
|
541981
541789
|
if (todos.length === 0 && !searchQuery) {
|
|
541982
|
-
return
|
|
541790
|
+
return import_react96.default.createElement(
|
|
541983
541791
|
Box_default,
|
|
541984
541792
|
{ flexDirection: "column" },
|
|
541985
|
-
|
|
541793
|
+
import_react96.default.createElement(
|
|
541986
541794
|
Box_default,
|
|
541987
541795
|
{ width: "100%" },
|
|
541988
|
-
|
|
541796
|
+
import_react96.default.createElement(
|
|
541989
541797
|
Box_default,
|
|
541990
541798
|
{ flexDirection: "column", width: "100%" },
|
|
541991
|
-
|
|
541799
|
+
import_react96.default.createElement(
|
|
541992
541800
|
Box_default,
|
|
541993
541801
|
null,
|
|
541994
|
-
|
|
541802
|
+
import_react96.default.createElement(Text, { color: theme14.colors.warning, bold: true }, "TODO Selection")
|
|
541995
541803
|
),
|
|
541996
|
-
|
|
541804
|
+
import_react96.default.createElement(
|
|
541997
541805
|
Box_default,
|
|
541998
541806
|
{ marginTop: 1 },
|
|
541999
|
-
|
|
541807
|
+
import_react96.default.createElement(Alert, { variant: "info" }, "No TODO comments found in the project")
|
|
542000
541808
|
)
|
|
542001
541809
|
)
|
|
542002
541810
|
)
|
|
542003
541811
|
);
|
|
542004
541812
|
}
|
|
542005
541813
|
if (todos.length === 0 && searchQuery) {
|
|
542006
|
-
return
|
|
541814
|
+
return import_react96.default.createElement(
|
|
542007
541815
|
Box_default,
|
|
542008
541816
|
{ flexDirection: "column" },
|
|
542009
|
-
|
|
541817
|
+
import_react96.default.createElement(
|
|
542010
541818
|
Box_default,
|
|
542011
541819
|
{ width: "100%" },
|
|
542012
|
-
|
|
541820
|
+
import_react96.default.createElement(
|
|
542013
541821
|
Box_default,
|
|
542014
541822
|
{ flexDirection: "column", width: "100%" },
|
|
542015
|
-
|
|
541823
|
+
import_react96.default.createElement(
|
|
542016
541824
|
Box_default,
|
|
542017
541825
|
null,
|
|
542018
|
-
|
|
541826
|
+
import_react96.default.createElement(Text, { color: theme14.colors.warning, bold: true }, "TODO Selection")
|
|
542019
541827
|
),
|
|
542020
|
-
|
|
541828
|
+
import_react96.default.createElement(
|
|
542021
541829
|
Box_default,
|
|
542022
541830
|
{ marginTop: 1 },
|
|
542023
|
-
|
|
541831
|
+
import_react96.default.createElement(
|
|
542024
541832
|
Alert,
|
|
542025
541833
|
{ variant: "warning" },
|
|
542026
541834
|
'No TODOs match "',
|
|
@@ -542030,28 +541838,28 @@ var init_TodoPickerPanel = __esm({
|
|
|
542030
541838
|
")"
|
|
542031
541839
|
)
|
|
542032
541840
|
),
|
|
542033
|
-
|
|
541841
|
+
import_react96.default.createElement(
|
|
542034
541842
|
Box_default,
|
|
542035
541843
|
{ marginTop: 1 },
|
|
542036
|
-
|
|
541844
|
+
import_react96.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, "Type to filter \xB7 Backspace to clear search")
|
|
542037
541845
|
)
|
|
542038
541846
|
)
|
|
542039
541847
|
)
|
|
542040
541848
|
);
|
|
542041
541849
|
}
|
|
542042
|
-
return
|
|
541850
|
+
return import_react96.default.createElement(
|
|
542043
541851
|
Box_default,
|
|
542044
541852
|
{ flexDirection: "column" },
|
|
542045
|
-
|
|
541853
|
+
import_react96.default.createElement(
|
|
542046
541854
|
Box_default,
|
|
542047
541855
|
{ width: "100%" },
|
|
542048
|
-
|
|
541856
|
+
import_react96.default.createElement(
|
|
542049
541857
|
Box_default,
|
|
542050
541858
|
{ flexDirection: "column", width: "100%" },
|
|
542051
|
-
|
|
541859
|
+
import_react96.default.createElement(
|
|
542052
541860
|
Box_default,
|
|
542053
541861
|
null,
|
|
542054
|
-
|
|
541862
|
+
import_react96.default.createElement(
|
|
542055
541863
|
Text,
|
|
542056
541864
|
{ color: theme14.colors.warning, bold: true },
|
|
542057
541865
|
"Select TODOs",
|
|
@@ -542061,18 +541869,18 @@ var init_TodoPickerPanel = __esm({
|
|
|
542061
541869
|
searchQuery && totalCount > todos.length && ` (${todos.length}/${totalCount})`
|
|
542062
541870
|
)
|
|
542063
541871
|
),
|
|
542064
|
-
|
|
541872
|
+
import_react96.default.createElement(
|
|
542065
541873
|
Box_default,
|
|
542066
541874
|
{ marginTop: 1 },
|
|
542067
|
-
|
|
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")
|
|
542068
541876
|
),
|
|
542069
541877
|
displayedTodos.map((todo, index) => {
|
|
542070
541878
|
const isSelected = index === displayedSelectedIndex;
|
|
542071
541879
|
const isChecked = selectedTodos.has(todo.id);
|
|
542072
|
-
return
|
|
541880
|
+
return import_react96.default.createElement(
|
|
542073
541881
|
Box_default,
|
|
542074
541882
|
{ key: todo.id, flexDirection: "column", width: "100%" },
|
|
542075
|
-
|
|
541883
|
+
import_react96.default.createElement(
|
|
542076
541884
|
Text,
|
|
542077
541885
|
{ color: isSelected ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: true },
|
|
542078
541886
|
isSelected ? "\u276F " : " ",
|
|
@@ -542082,10 +541890,10 @@ var init_TodoPickerPanel = __esm({
|
|
|
542082
541890
|
":",
|
|
542083
541891
|
todo.line
|
|
542084
541892
|
),
|
|
542085
|
-
|
|
541893
|
+
import_react96.default.createElement(
|
|
542086
541894
|
Box_default,
|
|
542087
541895
|
{ marginLeft: 5 },
|
|
542088
|
-
|
|
541896
|
+
import_react96.default.createElement(
|
|
542089
541897
|
Text,
|
|
542090
541898
|
{ color: isSelected ? theme14.colors.menuSelected : theme14.colors.menuNormal, dimColor: !isSelected },
|
|
542091
541899
|
"\u2514\u2500 ",
|
|
@@ -542094,10 +541902,10 @@ var init_TodoPickerPanel = __esm({
|
|
|
542094
541902
|
)
|
|
542095
541903
|
);
|
|
542096
541904
|
}),
|
|
542097
|
-
todos.length > effectiveMaxItems &&
|
|
541905
|
+
todos.length > effectiveMaxItems && import_react96.default.createElement(
|
|
542098
541906
|
Box_default,
|
|
542099
541907
|
{ marginTop: 1 },
|
|
542100
|
-
|
|
541908
|
+
import_react96.default.createElement(
|
|
542101
541909
|
Text,
|
|
542102
541910
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
542103
541911
|
"\u2191\u2193 to scroll \xB7 ",
|
|
@@ -542105,10 +541913,10 @@ var init_TodoPickerPanel = __esm({
|
|
|
542105
541913
|
" more hidden"
|
|
542106
541914
|
)
|
|
542107
541915
|
),
|
|
542108
|
-
selectedTodos.size > 0 &&
|
|
541916
|
+
selectedTodos.size > 0 && import_react96.default.createElement(
|
|
542109
541917
|
Box_default,
|
|
542110
541918
|
{ marginTop: 1 },
|
|
542111
|
-
|
|
541919
|
+
import_react96.default.createElement(
|
|
542112
541920
|
Text,
|
|
542113
541921
|
{ color: theme14.colors.menuInfo },
|
|
542114
541922
|
selectedTodos.size,
|
|
@@ -542129,20 +541937,20 @@ var ProfilePanel_exports = {};
|
|
|
542129
541937
|
__export(ProfilePanel_exports, {
|
|
542130
541938
|
default: () => ProfilePanel_default
|
|
542131
541939
|
});
|
|
542132
|
-
var
|
|
541940
|
+
var import_react97, ProfilePanel, ProfilePanel_default;
|
|
542133
541941
|
var init_ProfilePanel = __esm({
|
|
542134
541942
|
async "dist/ui/components/panels/ProfilePanel.js"() {
|
|
542135
541943
|
"use strict";
|
|
542136
|
-
|
|
541944
|
+
import_react97 = __toESM(require_react(), 1);
|
|
542137
541945
|
await init_build2();
|
|
542138
541946
|
init_i18n();
|
|
542139
541947
|
init_ThemeContext();
|
|
542140
|
-
ProfilePanel = (0,
|
|
541948
|
+
ProfilePanel = (0, import_react97.memo)(({ profiles, selectedIndex, visible, maxHeight, searchQuery }) => {
|
|
542141
541949
|
const { t } = useI18n();
|
|
542142
541950
|
const { theme: theme14 } = useTheme();
|
|
542143
541951
|
const MAX_DISPLAY_ITEMS = 5;
|
|
542144
541952
|
const effectiveMaxItems = maxHeight ? Math.min(maxHeight, MAX_DISPLAY_ITEMS) : MAX_DISPLAY_ITEMS;
|
|
542145
|
-
const displayedProfiles = (0,
|
|
541953
|
+
const displayedProfiles = (0, import_react97.useMemo)(() => {
|
|
542146
541954
|
if (profiles.length <= effectiveMaxItems) {
|
|
542147
541955
|
return profiles;
|
|
542148
541956
|
}
|
|
@@ -542154,7 +541962,7 @@ var init_ProfilePanel = __esm({
|
|
|
542154
541962
|
}
|
|
542155
541963
|
return profiles.slice(startIndex, endIndex);
|
|
542156
541964
|
}, [profiles, selectedIndex, effectiveMaxItems]);
|
|
542157
|
-
const displayedSelectedIndex = (0,
|
|
541965
|
+
const displayedSelectedIndex = (0, import_react97.useMemo)(() => {
|
|
542158
541966
|
return displayedProfiles.findIndex((profile) => {
|
|
542159
541967
|
const originalIndex = profiles.indexOf(profile);
|
|
542160
541968
|
return originalIndex === selectedIndex;
|
|
@@ -542166,19 +541974,19 @@ var init_ProfilePanel = __esm({
|
|
|
542166
541974
|
if (profiles.length === 0) {
|
|
542167
541975
|
return null;
|
|
542168
541976
|
}
|
|
542169
|
-
return
|
|
541977
|
+
return import_react97.default.createElement(
|
|
542170
541978
|
Box_default,
|
|
542171
541979
|
{ flexDirection: "column" },
|
|
542172
|
-
|
|
541980
|
+
import_react97.default.createElement(
|
|
542173
541981
|
Box_default,
|
|
542174
541982
|
{ width: "100%" },
|
|
542175
|
-
|
|
541983
|
+
import_react97.default.createElement(
|
|
542176
541984
|
Box_default,
|
|
542177
541985
|
{ flexDirection: "column", width: "100%" },
|
|
542178
|
-
|
|
541986
|
+
import_react97.default.createElement(
|
|
542179
541987
|
Box_default,
|
|
542180
541988
|
null,
|
|
542181
|
-
|
|
541989
|
+
import_react97.default.createElement(
|
|
542182
541990
|
Text,
|
|
542183
541991
|
{ color: theme14.colors.warning, bold: true },
|
|
542184
541992
|
t.profilePanel.title,
|
|
@@ -542186,21 +541994,21 @@ var init_ProfilePanel = __esm({
|
|
|
542186
541994
|
profiles.length > effectiveMaxItems && `(${selectedIndex + 1}/${profiles.length})`
|
|
542187
541995
|
)
|
|
542188
541996
|
),
|
|
542189
|
-
searchQuery &&
|
|
541997
|
+
searchQuery && import_react97.default.createElement(
|
|
542190
541998
|
Box_default,
|
|
542191
541999
|
{ marginTop: 1 },
|
|
542192
|
-
|
|
542000
|
+
import_react97.default.createElement(
|
|
542193
542001
|
Text,
|
|
542194
542002
|
{ color: theme14.colors.menuInfo },
|
|
542195
542003
|
t.profilePanel.searchLabel,
|
|
542196
542004
|
" ",
|
|
542197
|
-
|
|
542005
|
+
import_react97.default.createElement(Text, { color: theme14.colors.menuSelected }, searchQuery)
|
|
542198
542006
|
)
|
|
542199
542007
|
),
|
|
542200
|
-
displayedProfiles.map((profile, index) =>
|
|
542008
|
+
displayedProfiles.map((profile, index) => import_react97.default.createElement(
|
|
542201
542009
|
Box_default,
|
|
542202
542010
|
{ key: profile.name, flexDirection: "column", width: "100%" },
|
|
542203
|
-
|
|
542011
|
+
import_react97.default.createElement(
|
|
542204
542012
|
Text,
|
|
542205
542013
|
{ color: index === displayedSelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: true },
|
|
542206
542014
|
index === displayedSelectedIndex ? "> " : " ",
|
|
@@ -542208,10 +542016,10 @@ var init_ProfilePanel = __esm({
|
|
|
542208
542016
|
profile.isActive && ` ${t.profilePanel.activeLabel}`
|
|
542209
542017
|
)
|
|
542210
542018
|
)),
|
|
542211
|
-
profiles.length > effectiveMaxItems &&
|
|
542019
|
+
profiles.length > effectiveMaxItems && import_react97.default.createElement(
|
|
542212
542020
|
Box_default,
|
|
542213
542021
|
{ marginTop: 1 },
|
|
542214
|
-
|
|
542022
|
+
import_react97.default.createElement(
|
|
542215
542023
|
Text,
|
|
542216
542024
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
542217
542025
|
t.profilePanel.scrollHint,
|
|
@@ -542220,10 +542028,10 @@ var init_ProfilePanel = __esm({
|
|
|
542220
542028
|
t.profilePanel.moreHidden.replace("{count}", (profiles.length - effectiveMaxItems).toString())
|
|
542221
542029
|
)
|
|
542222
542030
|
),
|
|
542223
|
-
|
|
542031
|
+
import_react97.default.createElement(
|
|
542224
542032
|
Box_default,
|
|
542225
542033
|
{ marginTop: 1 },
|
|
542226
|
-
|
|
542034
|
+
import_react97.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.profilePanel.escHint)
|
|
542227
542035
|
)
|
|
542228
542036
|
)
|
|
542229
542037
|
)
|
|
@@ -542245,17 +542053,17 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542245
542053
|
const { theme: theme14 } = useTheme();
|
|
542246
542054
|
const { parseBashCommands } = useBashMode();
|
|
542247
542055
|
const { columns: terminalWidth } = useTerminalSize();
|
|
542248
|
-
const prevTerminalWidthRef = (0,
|
|
542056
|
+
const prevTerminalWidthRef = (0, import_react98.useRef)(terminalWidth);
|
|
542249
542057
|
const { hasFocus, ensureFocus } = useTerminalFocus();
|
|
542250
542058
|
const uiOverhead = 8;
|
|
542251
542059
|
const viewportWidth = Math.max(40, terminalWidth - uiOverhead);
|
|
542252
|
-
const viewport = (0,
|
|
542060
|
+
const viewport = (0, import_react98.useMemo)(() => ({
|
|
542253
542061
|
width: viewportWidth,
|
|
542254
542062
|
height: 1
|
|
542255
542063
|
}), [viewportWidth]);
|
|
542256
542064
|
const { buffer, triggerUpdate, forceUpdate } = useInputBuffer(viewport);
|
|
542257
|
-
const [isBashMode, setIsBashMode] =
|
|
542258
|
-
const bashModeDebounceTimer = (0,
|
|
542065
|
+
const [isBashMode, setIsBashMode] = import_react98.default.useState(false);
|
|
542066
|
+
const bashModeDebounceTimer = (0, import_react98.useRef)(null);
|
|
542259
542067
|
const { showCommands, setShowCommands, commandSelectedIndex, setCommandSelectedIndex, getFilteredCommands, updateCommandPanelState, isProcessing: commandPanelIsProcessing } = useCommandPanel(buffer, isProcessing);
|
|
542260
542068
|
const { showFilePicker, setShowFilePicker, fileSelectedIndex, setFileSelectedIndex, fileQuery, setFileQuery, atSymbolPosition, setAtSymbolPosition, filteredFileCount, searchMode, updateFilePickerState, handleFileSelect, handleFilteredCountChange, fileListRef } = useFilePicker(buffer, triggerUpdate);
|
|
542261
542069
|
const { showHistoryMenu, setShowHistoryMenu, historySelectedIndex, setHistorySelectedIndex, escapeKeyCount, setEscapeKeyCount, escapeKeyTimer, getUserMessages, handleHistorySelect, currentHistoryIndex, navigateHistoryUp, navigateHistoryDown, resetHistoryNavigation, saveToHistory } = useHistoryNavigation(buffer, triggerUpdate, chatHistory, onHistorySelect);
|
|
@@ -542344,7 +542152,7 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542344
542152
|
}),
|
|
542345
542153
|
onSwitchProfile
|
|
542346
542154
|
});
|
|
542347
|
-
(0,
|
|
542155
|
+
(0, import_react98.useEffect)(() => {
|
|
542348
542156
|
if (initialContent) {
|
|
542349
542157
|
buffer.setText("");
|
|
542350
542158
|
const text3 = initialContent.text;
|
|
@@ -542379,13 +542187,13 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542379
542187
|
triggerUpdate();
|
|
542380
542188
|
}
|
|
542381
542189
|
}, [initialContent]);
|
|
542382
|
-
(0,
|
|
542190
|
+
(0, import_react98.useEffect)(() => {
|
|
542383
542191
|
const timer2 = setTimeout(() => {
|
|
542384
542192
|
forceUpdate();
|
|
542385
542193
|
}, 10);
|
|
542386
542194
|
return () => clearTimeout(timer2);
|
|
542387
542195
|
}, [showFilePicker, forceUpdate]);
|
|
542388
|
-
(0,
|
|
542196
|
+
(0, import_react98.useEffect)(() => {
|
|
542389
542197
|
if (prevTerminalWidthRef.current === terminalWidth) {
|
|
542390
542198
|
prevTerminalWidthRef.current = terminalWidth;
|
|
542391
542199
|
return;
|
|
@@ -542396,8 +542204,8 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542396
542204
|
}, 100);
|
|
542397
542205
|
return () => clearTimeout(timer2);
|
|
542398
542206
|
}, [terminalWidth, forceUpdate]);
|
|
542399
|
-
const lastPercentageRef = (0,
|
|
542400
|
-
(0,
|
|
542207
|
+
const lastPercentageRef = (0, import_react98.useRef)(0);
|
|
542208
|
+
(0, import_react98.useEffect)(() => {
|
|
542401
542209
|
if (contextUsage && onContextPercentageChange) {
|
|
542402
542210
|
const percentage = calculateContextPercentage(contextUsage);
|
|
542403
542211
|
if (percentage !== lastPercentageRef.current) {
|
|
@@ -542406,7 +542214,7 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542406
542214
|
}
|
|
542407
542215
|
}
|
|
542408
542216
|
}, [contextUsage, onContextPercentageChange]);
|
|
542409
|
-
(0,
|
|
542217
|
+
(0, import_react98.useEffect)(() => {
|
|
542410
542218
|
if (bashModeDebounceTimer.current) {
|
|
542411
542219
|
clearTimeout(bashModeDebounceTimer.current);
|
|
542412
542220
|
}
|
|
@@ -542424,11 +542232,11 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542424
542232
|
}
|
|
542425
542233
|
};
|
|
542426
542234
|
}, [buffer.text, parseBashCommands, isBashMode]);
|
|
542427
|
-
const renderCursor = (0,
|
|
542235
|
+
const renderCursor = (0, import_react98.useCallback)((char) => {
|
|
542428
542236
|
if (hasFocus) {
|
|
542429
|
-
return
|
|
542237
|
+
return import_react98.default.createElement(Text, { backgroundColor: theme14.colors.menuNormal, color: theme14.colors.background }, char);
|
|
542430
542238
|
} else {
|
|
542431
|
-
return
|
|
542239
|
+
return import_react98.default.createElement(Text, null, char);
|
|
542432
542240
|
}
|
|
542433
542241
|
}, [hasFocus, theme14]);
|
|
542434
542242
|
const renderContent = () => {
|
|
@@ -542442,34 +542250,34 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542442
542250
|
const beforeCursor = cpSlice(line, 0, cursorCol);
|
|
542443
542251
|
const atCursor = cpSlice(line, cursorCol, cursorCol + 1) || " ";
|
|
542444
542252
|
const afterCursor = cpSlice(line, cursorCol + 1);
|
|
542445
|
-
renderedLines.push(
|
|
542253
|
+
renderedLines.push(import_react98.default.createElement(
|
|
542446
542254
|
Box_default,
|
|
542447
542255
|
{ key: i, flexDirection: "row" },
|
|
542448
|
-
|
|
542256
|
+
import_react98.default.createElement(Text, null, beforeCursor),
|
|
542449
542257
|
renderCursor(atCursor),
|
|
542450
|
-
|
|
542258
|
+
import_react98.default.createElement(Text, null, afterCursor)
|
|
542451
542259
|
));
|
|
542452
542260
|
} else {
|
|
542453
|
-
renderedLines.push(
|
|
542261
|
+
renderedLines.push(import_react98.default.createElement(Text, { key: i }, line || " "));
|
|
542454
542262
|
}
|
|
542455
542263
|
}
|
|
542456
|
-
return
|
|
542264
|
+
return import_react98.default.createElement(Box_default, { flexDirection: "column" }, renderedLines);
|
|
542457
542265
|
} else {
|
|
542458
|
-
return
|
|
542459
|
-
|
|
542266
|
+
return import_react98.default.createElement(
|
|
542267
|
+
import_react98.default.Fragment,
|
|
542460
542268
|
null,
|
|
542461
542269
|
renderCursor(" "),
|
|
542462
|
-
|
|
542270
|
+
import_react98.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, disabled ? t.chatScreen.waitingForResponse : placeholder)
|
|
542463
542271
|
);
|
|
542464
542272
|
}
|
|
542465
542273
|
};
|
|
542466
|
-
return
|
|
542274
|
+
return import_react98.default.createElement(
|
|
542467
542275
|
Box_default,
|
|
542468
542276
|
{ flexDirection: "column", paddingX: 1, width: terminalWidth },
|
|
542469
|
-
showHistoryMenu &&
|
|
542277
|
+
showHistoryMenu && import_react98.default.createElement(
|
|
542470
542278
|
Box_default,
|
|
542471
542279
|
{ flexDirection: "column", marginBottom: 1, width: terminalWidth - 2 },
|
|
542472
|
-
|
|
542280
|
+
import_react98.default.createElement(Box_default, { flexDirection: "column" }, (() => {
|
|
542473
542281
|
const userMessages = getUserMessages();
|
|
542474
542282
|
const maxVisibleItems = 5;
|
|
542475
542283
|
let startIndex = 0;
|
|
@@ -542481,20 +542289,20 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542481
542289
|
const visibleMessages = userMessages.slice(startIndex, endIndex);
|
|
542482
542290
|
const hasMoreAbove = startIndex > 0;
|
|
542483
542291
|
const hasMoreBelow = endIndex < userMessages.length;
|
|
542484
|
-
return
|
|
542485
|
-
|
|
542292
|
+
return import_react98.default.createElement(
|
|
542293
|
+
import_react98.default.Fragment,
|
|
542486
542294
|
null,
|
|
542487
|
-
|
|
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, " ")),
|
|
542488
542296
|
visibleMessages.map((message, displayIndex) => {
|
|
542489
542297
|
const actualIndex = startIndex + displayIndex;
|
|
542490
542298
|
const singleLineLabel = message.label.replace(/[\r\n\t\v\f\u0000-\u001F\u007F-\u009F]+/g, " ").replace(/\s+/g, " ").trim();
|
|
542491
542299
|
const prefixWidth = 3;
|
|
542492
542300
|
const maxLabelWidth = terminalWidth - 4 - prefixWidth;
|
|
542493
542301
|
const truncatedLabel = singleLineLabel.length > maxLabelWidth ? singleLineLabel.slice(0, maxLabelWidth - 3) + "..." : singleLineLabel;
|
|
542494
|
-
return
|
|
542302
|
+
return import_react98.default.createElement(
|
|
542495
542303
|
Box_default,
|
|
542496
542304
|
{ key: message.value, height: 1 },
|
|
542497
|
-
|
|
542305
|
+
import_react98.default.createElement(
|
|
542498
542306
|
Text,
|
|
542499
542307
|
{ color: actualIndex === historySelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: true, wrap: "truncate" },
|
|
542500
542308
|
actualIndex === historySelectedIndex ? "\u276F " : " ",
|
|
@@ -542502,77 +542310,77 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
542502
542310
|
)
|
|
542503
542311
|
);
|
|
542504
542312
|
}),
|
|
542505
|
-
|
|
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, " "))
|
|
542506
542314
|
);
|
|
542507
542315
|
})()),
|
|
542508
|
-
|
|
542316
|
+
import_react98.default.createElement(
|
|
542509
542317
|
Box_default,
|
|
542510
542318
|
{ marginBottom: 1 },
|
|
542511
|
-
|
|
542319
|
+
import_react98.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, t.chatScreen.historyNavigateHint)
|
|
542512
542320
|
)
|
|
542513
542321
|
),
|
|
542514
|
-
!showHistoryMenu &&
|
|
542515
|
-
|
|
542322
|
+
!showHistoryMenu && import_react98.default.createElement(
|
|
542323
|
+
import_react98.default.Fragment,
|
|
542516
542324
|
null,
|
|
542517
|
-
|
|
542325
|
+
import_react98.default.createElement(
|
|
542518
542326
|
Box_default,
|
|
542519
542327
|
{ flexDirection: "column", width: terminalWidth - 2 },
|
|
542520
|
-
|
|
542521
|
-
|
|
542328
|
+
import_react98.default.createElement(Text, { color: isBashMode ? theme14.colors.success : theme14.colors.menuSecondary }, "\u2500".repeat(terminalWidth - 2)),
|
|
542329
|
+
import_react98.default.createElement(
|
|
542522
542330
|
Box_default,
|
|
542523
542331
|
{ flexDirection: "row" },
|
|
542524
|
-
|
|
542332
|
+
import_react98.default.createElement(
|
|
542525
542333
|
Text,
|
|
542526
542334
|
{ color: isBashMode ? theme14.colors.success : theme14.colors.menuInfo, bold: true },
|
|
542527
542335
|
isBashMode ? ">_" : "\u276F",
|
|
542528
542336
|
" "
|
|
542529
542337
|
),
|
|
542530
|
-
|
|
542338
|
+
import_react98.default.createElement(Box_default, { flexGrow: 1 }, renderContent())
|
|
542531
542339
|
),
|
|
542532
|
-
|
|
542340
|
+
import_react98.default.createElement(Text, { color: isBashMode ? theme14.colors.success : theme14.colors.menuSecondary }, "\u2500".repeat(terminalWidth - 2))
|
|
542533
542341
|
),
|
|
542534
|
-
showCommands && getFilteredCommands().length > 0 || showFilePicker ?
|
|
542342
|
+
showCommands && getFilteredCommands().length > 0 || showFilePicker ? import_react98.default.createElement(
|
|
542535
542343
|
Box_default,
|
|
542536
542344
|
{ marginTop: 1 },
|
|
542537
|
-
|
|
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 : "")
|
|
542538
542346
|
) : null,
|
|
542539
|
-
|
|
542540
|
-
|
|
542347
|
+
import_react98.default.createElement(
|
|
542348
|
+
import_react98.Suspense,
|
|
542541
542349
|
{ fallback: null },
|
|
542542
|
-
|
|
542350
|
+
import_react98.default.createElement(CommandPanel2, { commands: getFilteredCommands(), selectedIndex: commandSelectedIndex, query: buffer.getFullText().slice(1), visible: showCommands, isProcessing: commandPanelIsProcessing })
|
|
542543
542351
|
),
|
|
542544
|
-
|
|
542352
|
+
import_react98.default.createElement(
|
|
542545
542353
|
Box_default,
|
|
542546
542354
|
null,
|
|
542547
|
-
|
|
542548
|
-
|
|
542355
|
+
import_react98.default.createElement(
|
|
542356
|
+
import_react98.Suspense,
|
|
542549
542357
|
{ fallback: null },
|
|
542550
|
-
|
|
542358
|
+
import_react98.default.createElement(FileList2, { ref: fileListRef, query: fileQuery, selectedIndex: fileSelectedIndex, visible: showFilePicker, maxItems: 10, rootPath: process.cwd(), onFilteredCountChange: handleFilteredCountChange, searchMode })
|
|
542551
542359
|
)
|
|
542552
542360
|
),
|
|
542553
|
-
|
|
542554
|
-
|
|
542361
|
+
import_react98.default.createElement(
|
|
542362
|
+
import_react98.Suspense,
|
|
542555
542363
|
{ fallback: null },
|
|
542556
|
-
|
|
542364
|
+
import_react98.default.createElement(AgentPickerPanel2, { agents: getFilteredAgents(), selectedIndex: agentSelectedIndex, visible: showAgentPicker, maxHeight: 5 })
|
|
542557
542365
|
),
|
|
542558
|
-
|
|
542559
|
-
|
|
542366
|
+
import_react98.default.createElement(
|
|
542367
|
+
import_react98.Suspense,
|
|
542560
542368
|
{ fallback: null },
|
|
542561
|
-
|
|
542369
|
+
import_react98.default.createElement(TodoPickerPanel2, { todos, selectedIndex: todoSelectedIndex, selectedTodos, visible: showTodoPicker, maxHeight: 5, isLoading: todoIsLoading, searchQuery: todoSearchQuery, totalCount: totalTodoCount })
|
|
542562
542370
|
),
|
|
542563
|
-
|
|
542564
|
-
|
|
542371
|
+
import_react98.default.createElement(
|
|
542372
|
+
import_react98.Suspense,
|
|
542565
542373
|
{ fallback: null },
|
|
542566
|
-
|
|
542374
|
+
import_react98.default.createElement(ProfilePanel2, { profiles: getFilteredProfiles ? getFilteredProfiles() : [], selectedIndex: profileSelectedIndex, visible: showProfilePicker, maxHeight: 5, searchQuery: profileSearchQuery })
|
|
542567
542375
|
)
|
|
542568
542376
|
)
|
|
542569
542377
|
);
|
|
542570
542378
|
}
|
|
542571
|
-
var
|
|
542379
|
+
var import_react98, CommandPanel2, FileList2, AgentPickerPanel2, TodoPickerPanel2, ProfilePanel2;
|
|
542572
542380
|
var init_ChatInput = __esm({
|
|
542573
542381
|
async "dist/ui/components/chat/ChatInput.js"() {
|
|
542574
542382
|
"use strict";
|
|
542575
|
-
|
|
542383
|
+
import_react98 = __toESM(require_react(), 1);
|
|
542576
542384
|
await init_build2();
|
|
542577
542385
|
init_textUtils();
|
|
542578
542386
|
init_useInputBuffer();
|
|
@@ -542588,11 +542396,11 @@ var init_ChatInput = __esm({
|
|
|
542588
542396
|
init_i18n();
|
|
542589
542397
|
init_ThemeContext();
|
|
542590
542398
|
init_useBashMode();
|
|
542591
|
-
CommandPanel2 = (0,
|
|
542592
|
-
FileList2 = (0,
|
|
542593
|
-
AgentPickerPanel2 = (0,
|
|
542594
|
-
TodoPickerPanel2 = (0,
|
|
542595
|
-
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));
|
|
542596
542404
|
}
|
|
542597
542405
|
});
|
|
542598
542406
|
|
|
@@ -542661,13 +542469,13 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542661
542469
|
color: "yellow"
|
|
542662
542470
|
});
|
|
542663
542471
|
}
|
|
542664
|
-
return
|
|
542472
|
+
return import_react99.default.createElement(
|
|
542665
542473
|
Box_default,
|
|
542666
542474
|
{ flexDirection: "column", paddingX: 1, marginTop: 1 },
|
|
542667
|
-
contextUsage &&
|
|
542475
|
+
contextUsage && import_react99.default.createElement(
|
|
542668
542476
|
Box_default,
|
|
542669
542477
|
{ marginBottom: 1 },
|
|
542670
|
-
|
|
542478
|
+
import_react99.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, (() => {
|
|
542671
542479
|
const isAnthropic = (contextUsage.cacheCreationTokens || 0) > 0 || (contextUsage.cacheReadTokens || 0) > 0;
|
|
542672
542480
|
const isOpenAI = (contextUsage.cachedTokens || 0) > 0;
|
|
542673
542481
|
const percentage = calculateContextPercentage2(contextUsage);
|
|
@@ -542687,29 +542495,29 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542687
542495
|
return num.toString();
|
|
542688
542496
|
};
|
|
542689
542497
|
const hasCacheMetrics = isAnthropic || isOpenAI;
|
|
542690
|
-
return
|
|
542691
|
-
|
|
542498
|
+
return import_react99.default.createElement(
|
|
542499
|
+
import_react99.default.Fragment,
|
|
542692
542500
|
null,
|
|
542693
|
-
|
|
542501
|
+
import_react99.default.createElement(
|
|
542694
542502
|
Text,
|
|
542695
542503
|
{ color },
|
|
542696
542504
|
percentage.toFixed(1),
|
|
542697
542505
|
"%"
|
|
542698
542506
|
),
|
|
542699
|
-
|
|
542700
|
-
|
|
542701
|
-
|
|
542702
|
-
hasCacheMetrics &&
|
|
542703
|
-
|
|
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,
|
|
542704
542512
|
null,
|
|
542705
|
-
|
|
542706
|
-
isAnthropic &&
|
|
542707
|
-
|
|
542513
|
+
import_react99.default.createElement(Text, null, " \xB7 "),
|
|
542514
|
+
isAnthropic && import_react99.default.createElement(
|
|
542515
|
+
import_react99.default.Fragment,
|
|
542708
542516
|
null,
|
|
542709
|
-
(contextUsage.cacheReadTokens || 0) > 0 &&
|
|
542710
|
-
|
|
542517
|
+
(contextUsage.cacheReadTokens || 0) > 0 && import_react99.default.createElement(
|
|
542518
|
+
import_react99.default.Fragment,
|
|
542711
542519
|
null,
|
|
542712
|
-
|
|
542520
|
+
import_react99.default.createElement(
|
|
542713
542521
|
Text,
|
|
542714
542522
|
{ color: theme14.colors.menuInfo },
|
|
542715
542523
|
"\u21AF",
|
|
@@ -542719,11 +542527,11 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542719
542527
|
t.chatScreen.cached
|
|
542720
542528
|
)
|
|
542721
542529
|
),
|
|
542722
|
-
(contextUsage.cacheCreationTokens || 0) > 0 &&
|
|
542723
|
-
|
|
542530
|
+
(contextUsage.cacheCreationTokens || 0) > 0 && import_react99.default.createElement(
|
|
542531
|
+
import_react99.default.Fragment,
|
|
542724
542532
|
null,
|
|
542725
|
-
(contextUsage.cacheReadTokens || 0) > 0 &&
|
|
542726
|
-
|
|
542533
|
+
(contextUsage.cacheReadTokens || 0) > 0 && import_react99.default.createElement(Text, null, " \xB7 "),
|
|
542534
|
+
import_react99.default.createElement(
|
|
542727
542535
|
Text,
|
|
542728
542536
|
{ color: theme14.colors.warning },
|
|
542729
542537
|
"\u25C6",
|
|
@@ -542734,7 +542542,7 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542734
542542
|
)
|
|
542735
542543
|
)
|
|
542736
542544
|
),
|
|
542737
|
-
isOpenAI &&
|
|
542545
|
+
isOpenAI && import_react99.default.createElement(
|
|
542738
542546
|
Text,
|
|
542739
542547
|
{ color: theme14.colors.menuInfo },
|
|
542740
542548
|
"\u21AF ",
|
|
@@ -542746,25 +542554,25 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542746
542554
|
);
|
|
542747
542555
|
})())
|
|
542748
542556
|
),
|
|
542749
|
-
statusItems.length > 0 &&
|
|
542557
|
+
statusItems.length > 0 && import_react99.default.createElement(
|
|
542750
542558
|
Box_default,
|
|
542751
542559
|
null,
|
|
542752
|
-
|
|
542753
|
-
|
|
542560
|
+
import_react99.default.createElement(Text, { dimColor: true }, statusItems.map((item, index) => import_react99.default.createElement(
|
|
542561
|
+
import_react99.default.Fragment,
|
|
542754
542562
|
{ key: index },
|
|
542755
|
-
index > 0 &&
|
|
542756
|
-
|
|
542563
|
+
index > 0 && import_react99.default.createElement(Text, { color: theme14.colors.menuSecondary }, " | "),
|
|
542564
|
+
import_react99.default.createElement(Text, { color: item.color }, item.text)
|
|
542757
542565
|
)))
|
|
542758
542566
|
)
|
|
542759
542567
|
);
|
|
542760
542568
|
}
|
|
542761
|
-
return
|
|
542569
|
+
return import_react99.default.createElement(
|
|
542762
542570
|
Box_default,
|
|
542763
542571
|
{ flexDirection: "column", paddingX: 1, marginTop: 1 },
|
|
542764
|
-
contextUsage &&
|
|
542572
|
+
contextUsage && import_react99.default.createElement(
|
|
542765
542573
|
Box_default,
|
|
542766
542574
|
null,
|
|
542767
|
-
|
|
542575
|
+
import_react99.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, (() => {
|
|
542768
542576
|
const isAnthropic = (contextUsage.cacheCreationTokens || 0) > 0 || (contextUsage.cacheReadTokens || 0) > 0;
|
|
542769
542577
|
const isOpenAI = (contextUsage.cachedTokens || 0) > 0;
|
|
542770
542578
|
const percentage = calculateContextPercentage2(contextUsage);
|
|
@@ -542784,29 +542592,29 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542784
542592
|
return num.toString();
|
|
542785
542593
|
};
|
|
542786
542594
|
const hasCacheMetrics = isAnthropic || isOpenAI;
|
|
542787
|
-
return
|
|
542788
|
-
|
|
542595
|
+
return import_react99.default.createElement(
|
|
542596
|
+
import_react99.default.Fragment,
|
|
542789
542597
|
null,
|
|
542790
|
-
|
|
542598
|
+
import_react99.default.createElement(
|
|
542791
542599
|
Text,
|
|
542792
542600
|
{ color },
|
|
542793
542601
|
percentage.toFixed(1),
|
|
542794
542602
|
"%"
|
|
542795
542603
|
),
|
|
542796
|
-
|
|
542797
|
-
|
|
542798
|
-
|
|
542799
|
-
hasCacheMetrics &&
|
|
542800
|
-
|
|
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,
|
|
542801
542609
|
null,
|
|
542802
|
-
|
|
542803
|
-
isAnthropic &&
|
|
542804
|
-
|
|
542610
|
+
import_react99.default.createElement(Text, null, " \xB7 "),
|
|
542611
|
+
isAnthropic && import_react99.default.createElement(
|
|
542612
|
+
import_react99.default.Fragment,
|
|
542805
542613
|
null,
|
|
542806
|
-
(contextUsage.cacheReadTokens || 0) > 0 &&
|
|
542807
|
-
|
|
542614
|
+
(contextUsage.cacheReadTokens || 0) > 0 && import_react99.default.createElement(
|
|
542615
|
+
import_react99.default.Fragment,
|
|
542808
542616
|
null,
|
|
542809
|
-
|
|
542617
|
+
import_react99.default.createElement(
|
|
542810
542618
|
Text,
|
|
542811
542619
|
{ color: theme14.colors.menuInfo },
|
|
542812
542620
|
"\u21AF",
|
|
@@ -542816,11 +542624,11 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542816
542624
|
t.chatScreen.cached
|
|
542817
542625
|
)
|
|
542818
542626
|
),
|
|
542819
|
-
(contextUsage.cacheCreationTokens || 0) > 0 &&
|
|
542820
|
-
|
|
542627
|
+
(contextUsage.cacheCreationTokens || 0) > 0 && import_react99.default.createElement(
|
|
542628
|
+
import_react99.default.Fragment,
|
|
542821
542629
|
null,
|
|
542822
|
-
(contextUsage.cacheReadTokens || 0) > 0 &&
|
|
542823
|
-
|
|
542630
|
+
(contextUsage.cacheReadTokens || 0) > 0 && import_react99.default.createElement(Text, null, " \xB7 "),
|
|
542631
|
+
import_react99.default.createElement(
|
|
542824
542632
|
Text,
|
|
542825
542633
|
{ color: theme14.colors.warning },
|
|
542826
542634
|
"\u25C6",
|
|
@@ -542831,7 +542639,7 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542831
542639
|
)
|
|
542832
542640
|
)
|
|
542833
542641
|
),
|
|
542834
|
-
isOpenAI &&
|
|
542642
|
+
isOpenAI && import_react99.default.createElement(
|
|
542835
542643
|
Text,
|
|
542836
542644
|
{ color: theme14.colors.menuInfo },
|
|
542837
542645
|
"\u21AF ",
|
|
@@ -542843,10 +542651,10 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542843
542651
|
);
|
|
542844
542652
|
})())
|
|
542845
542653
|
),
|
|
542846
|
-
currentProfileName &&
|
|
542654
|
+
currentProfileName && import_react99.default.createElement(
|
|
542847
542655
|
Box_default,
|
|
542848
542656
|
null,
|
|
542849
|
-
|
|
542657
|
+
import_react99.default.createElement(
|
|
542850
542658
|
Text,
|
|
542851
542659
|
{ color: theme14.colors.menuInfo, dimColor: true },
|
|
542852
542660
|
"\uA6B0 ",
|
|
@@ -542860,37 +542668,37 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542860
542668
|
t.chatScreen.profileSwitchHint
|
|
542861
542669
|
)
|
|
542862
542670
|
),
|
|
542863
|
-
yoloMode &&
|
|
542671
|
+
yoloMode && import_react99.default.createElement(
|
|
542864
542672
|
Box_default,
|
|
542865
542673
|
null,
|
|
542866
|
-
|
|
542674
|
+
import_react99.default.createElement(Text, { color: theme14.colors.warning, dimColor: true }, t.chatScreen.yoloModeActive)
|
|
542867
542675
|
),
|
|
542868
|
-
planMode &&
|
|
542676
|
+
planMode && import_react99.default.createElement(
|
|
542869
542677
|
Box_default,
|
|
542870
542678
|
null,
|
|
542871
|
-
|
|
542679
|
+
import_react99.default.createElement(Text, { color: "#60A5FA", dimColor: true }, t.chatScreen.planModeActive)
|
|
542872
542680
|
),
|
|
542873
|
-
vulnerabilityHuntingMode &&
|
|
542681
|
+
vulnerabilityHuntingMode && import_react99.default.createElement(
|
|
542874
542682
|
Box_default,
|
|
542875
542683
|
null,
|
|
542876
|
-
|
|
542684
|
+
import_react99.default.createElement(Text, { color: "#EF4444", dimColor: true }, t.chatScreen.vulnerabilityHuntingModeActive)
|
|
542877
542685
|
),
|
|
542878
|
-
vscodeConnectionStatus && (vscodeConnectionStatus === "connecting" || vscodeConnectionStatus === "connected" || vscodeConnectionStatus === "error") &&
|
|
542686
|
+
vscodeConnectionStatus && (vscodeConnectionStatus === "connecting" || vscodeConnectionStatus === "connected" || vscodeConnectionStatus === "error") && import_react99.default.createElement(
|
|
542879
542687
|
Box_default,
|
|
542880
542688
|
null,
|
|
542881
|
-
|
|
542882
|
-
|
|
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,
|
|
542883
542691
|
null,
|
|
542884
|
-
|
|
542692
|
+
import_react99.default.createElement(build_default, { type: "dots" }),
|
|
542885
542693
|
" ",
|
|
542886
542694
|
t.chatScreen.ideConnecting
|
|
542887
|
-
) : vscodeConnectionStatus === "error" ?
|
|
542888
|
-
|
|
542695
|
+
) : vscodeConnectionStatus === "error" ? import_react99.default.createElement(
|
|
542696
|
+
import_react99.default.Fragment,
|
|
542889
542697
|
null,
|
|
542890
542698
|
"\u25CB ",
|
|
542891
542699
|
t.chatScreen.ideError
|
|
542892
|
-
) :
|
|
542893
|
-
|
|
542700
|
+
) : import_react99.default.createElement(
|
|
542701
|
+
import_react99.default.Fragment,
|
|
542894
542702
|
null,
|
|
542895
542703
|
"\u25CF ",
|
|
542896
542704
|
t.chatScreen.ideConnected,
|
|
@@ -542898,28 +542706,28 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542898
542706
|
(editorContext == null ? void 0 : editorContext.selectedText) && t.chatScreen.ideSelectedText.replace("{count}", editorContext.selectedText.length.toString())
|
|
542899
542707
|
))
|
|
542900
542708
|
),
|
|
542901
|
-
(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(
|
|
542902
542710
|
Text,
|
|
542903
542711
|
{ color: "cyan", dimColor: true },
|
|
542904
|
-
|
|
542712
|
+
import_react99.default.createElement(build_default, { type: "dots" }),
|
|
542905
542713
|
" ",
|
|
542906
542714
|
t.chatScreen.codebaseIndexing.replace("{processed}", codebaseProgress.processedFiles.toString()).replace("{total}", codebaseProgress.totalFiles.toString()),
|
|
542907
542715
|
codebaseProgress.totalChunks > 0 && ` (${t.chatScreen.codebaseProgress.replace("{chunks}", codebaseProgress.totalChunks.toString())})`
|
|
542908
542716
|
)),
|
|
542909
|
-
!codebaseIndexing && watcherEnabled &&
|
|
542717
|
+
!codebaseIndexing && watcherEnabled && import_react99.default.createElement(
|
|
542910
542718
|
Box_default,
|
|
542911
542719
|
null,
|
|
542912
|
-
|
|
542720
|
+
import_react99.default.createElement(
|
|
542913
542721
|
Text,
|
|
542914
542722
|
{ color: "green", dimColor: true },
|
|
542915
542723
|
"\u2609 ",
|
|
542916
542724
|
t.chatScreen.statusWatcherActive
|
|
542917
542725
|
)
|
|
542918
542726
|
),
|
|
542919
|
-
fileUpdateNotification &&
|
|
542727
|
+
fileUpdateNotification && import_react99.default.createElement(
|
|
542920
542728
|
Box_default,
|
|
542921
542729
|
null,
|
|
542922
|
-
|
|
542730
|
+
import_react99.default.createElement(
|
|
542923
542731
|
Text,
|
|
542924
542732
|
{ color: "yellow", dimColor: true },
|
|
542925
542733
|
"\u26C1",
|
|
@@ -542929,11 +542737,11 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
542929
542737
|
)
|
|
542930
542738
|
);
|
|
542931
542739
|
}
|
|
542932
|
-
var
|
|
542740
|
+
var import_react99, getProfileShortcut;
|
|
542933
542741
|
var init_StatusLine = __esm({
|
|
542934
542742
|
async "dist/ui/components/common/StatusLine.js"() {
|
|
542935
542743
|
"use strict";
|
|
542936
|
-
|
|
542744
|
+
import_react99 = __toESM(require_react(), 1);
|
|
542937
542745
|
await init_build2();
|
|
542938
542746
|
await init_build3();
|
|
542939
542747
|
init_i18n();
|
|
@@ -542996,13 +542804,13 @@ function BackgroundProcessPanel({ processes, selectedIndex, terminalWidth }) {
|
|
|
542996
542804
|
return theme14.colors.success;
|
|
542997
542805
|
return theme14.colors.error;
|
|
542998
542806
|
};
|
|
542999
|
-
return
|
|
542807
|
+
return import_react100.default.createElement(
|
|
543000
542808
|
Box_default,
|
|
543001
542809
|
{ flexDirection: "column", borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1, paddingY: 0, width: terminalWidth - 2 },
|
|
543002
|
-
|
|
542810
|
+
import_react100.default.createElement(
|
|
543003
542811
|
Box_default,
|
|
543004
542812
|
{ paddingTop: 1, paddingX: 1 },
|
|
543005
|
-
|
|
542813
|
+
import_react100.default.createElement(
|
|
543006
542814
|
Text,
|
|
543007
542815
|
{ bold: true, color: theme14.colors.menuInfo },
|
|
543008
542816
|
t.backgroundProcesses.title,
|
|
@@ -543011,29 +542819,29 @@ function BackgroundProcessPanel({ processes, selectedIndex, terminalWidth }) {
|
|
|
543011
542819
|
")"
|
|
543012
542820
|
)
|
|
543013
542821
|
),
|
|
543014
|
-
sortedProcesses.length === 0 ?
|
|
542822
|
+
sortedProcesses.length === 0 ? import_react100.default.createElement(
|
|
543015
542823
|
Box_default,
|
|
543016
542824
|
{ paddingX: 1, paddingY: 1 },
|
|
543017
|
-
|
|
543018
|
-
) :
|
|
543019
|
-
|
|
542825
|
+
import_react100.default.createElement(Text, { dimColor: true }, t.backgroundProcesses.emptyHint)
|
|
542826
|
+
) : import_react100.default.createElement(
|
|
542827
|
+
import_react100.default.Fragment,
|
|
543020
542828
|
null,
|
|
543021
542829
|
visibleProcesses.map((process20, visibleIndex) => {
|
|
543022
542830
|
const actualIndex = scrollOffset + visibleIndex;
|
|
543023
542831
|
const isSelected = actualIndex === selectedIndex;
|
|
543024
|
-
return
|
|
542832
|
+
return import_react100.default.createElement(
|
|
543025
542833
|
Box_default,
|
|
543026
542834
|
{ key: process20.id, flexDirection: "column", paddingY: 0 },
|
|
543027
|
-
|
|
542835
|
+
import_react100.default.createElement(
|
|
543028
542836
|
Box_default,
|
|
543029
542837
|
{ paddingX: 1 },
|
|
543030
|
-
|
|
543031
|
-
|
|
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))
|
|
543032
542840
|
),
|
|
543033
|
-
|
|
542841
|
+
import_react100.default.createElement(
|
|
543034
542842
|
Box_default,
|
|
543035
542843
|
{ paddingLeft: 4 },
|
|
543036
|
-
|
|
542844
|
+
import_react100.default.createElement(
|
|
543037
542845
|
Text,
|
|
543038
542846
|
{ dimColor: true },
|
|
543039
542847
|
"PID: ",
|
|
@@ -543043,8 +542851,8 @@ function BackgroundProcessPanel({ processes, selectedIndex, terminalWidth }) {
|
|
|
543043
542851
|
":",
|
|
543044
542852
|
" "
|
|
543045
542853
|
),
|
|
543046
|
-
|
|
543047
|
-
|
|
542854
|
+
import_react100.default.createElement(Text, { color: getStatusColor(process20.status) }, getStatusText(process20)),
|
|
542855
|
+
import_react100.default.createElement(
|
|
543048
542856
|
Text,
|
|
543049
542857
|
{ dimColor: true },
|
|
543050
542858
|
" ",
|
|
@@ -543057,10 +542865,10 @@ function BackgroundProcessPanel({ processes, selectedIndex, terminalWidth }) {
|
|
|
543057
542865
|
)
|
|
543058
542866
|
);
|
|
543059
542867
|
}),
|
|
543060
|
-
totalItems > maxVisibleItems &&
|
|
542868
|
+
totalItems > maxVisibleItems && import_react100.default.createElement(
|
|
543061
542869
|
Box_default,
|
|
543062
542870
|
{ paddingX: 1, paddingBottom: 1 },
|
|
543063
|
-
|
|
542871
|
+
import_react100.default.createElement(
|
|
543064
542872
|
Text,
|
|
543065
542873
|
{ dimColor: true },
|
|
543066
542874
|
t.backgroundProcesses.navigateHint,
|
|
@@ -543075,31 +542883,151 @@ function BackgroundProcessPanel({ processes, selectedIndex, terminalWidth }) {
|
|
|
543075
542883
|
)
|
|
543076
542884
|
)
|
|
543077
542885
|
),
|
|
543078
|
-
totalItems <= maxVisibleItems &&
|
|
542886
|
+
totalItems <= maxVisibleItems && import_react100.default.createElement(
|
|
543079
542887
|
Box_default,
|
|
543080
542888
|
{ paddingX: 1, paddingY: 1 },
|
|
543081
|
-
|
|
542889
|
+
import_react100.default.createElement(Text, { dimColor: true }, t.backgroundProcesses.navigateHint)
|
|
543082
542890
|
)
|
|
543083
542891
|
);
|
|
543084
542892
|
}
|
|
543085
|
-
var
|
|
542893
|
+
var import_react100;
|
|
543086
542894
|
var init_BackgroundProcessPanel = __esm({
|
|
543087
542895
|
async "dist/ui/components/bash/BackgroundProcessPanel.js"() {
|
|
543088
542896
|
"use strict";
|
|
543089
|
-
|
|
542897
|
+
import_react100 = __toESM(require_react(), 1);
|
|
543090
542898
|
await init_build2();
|
|
543091
542899
|
init_I18nContext();
|
|
543092
542900
|
init_ThemeContext();
|
|
543093
542901
|
}
|
|
543094
542902
|
});
|
|
543095
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
|
+
|
|
543096
542988
|
// dist/ui/components/chat/ChatFooter.js
|
|
543097
542989
|
function ChatFooter(props) {
|
|
543098
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]);
|
|
543099
543022
|
return import_react102.default.createElement(
|
|
543100
543023
|
import_react102.default.Fragment,
|
|
543101
543024
|
null,
|
|
543102
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
|
+
),
|
|
543103
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 }),
|
|
543104
543032
|
props.isCompressing && import_react102.default.createElement(
|
|
543105
543033
|
Box_default,
|
|
@@ -543131,6 +543059,9 @@ var init_ChatFooter = __esm({
|
|
|
543131
543059
|
await init_StatusLine();
|
|
543132
543060
|
init_I18nContext();
|
|
543133
543061
|
await init_BackgroundProcessPanel();
|
|
543062
|
+
await init_TodoTree();
|
|
543063
|
+
init_sessionManager();
|
|
543064
|
+
init_todoEvents();
|
|
543134
543065
|
}
|
|
543135
543066
|
});
|
|
543136
543067
|
|
|
@@ -553723,7 +553654,7 @@ var init_handler = __esm({
|
|
|
553723
553654
|
// node_modules/chokidar/esm/index.js
|
|
553724
553655
|
import { stat as statcb } from "fs";
|
|
553725
553656
|
import { stat as stat3, readdir as readdir4 } from "fs/promises";
|
|
553726
|
-
import { EventEmitter as
|
|
553657
|
+
import { EventEmitter as EventEmitter10 } from "events";
|
|
553727
553658
|
import * as sysPath2 from "path";
|
|
553728
553659
|
function arrify(item) {
|
|
553729
553660
|
return Array.isArray(item) ? item : [item];
|
|
@@ -553925,7 +553856,7 @@ var init_esm4 = __esm({
|
|
|
553925
553856
|
return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
|
|
553926
553857
|
}
|
|
553927
553858
|
};
|
|
553928
|
-
FSWatcher = class extends
|
|
553859
|
+
FSWatcher = class extends EventEmitter10 {
|
|
553929
553860
|
// Not indenting methods for history sake; for now.
|
|
553930
553861
|
constructor(_opts = {}) {
|
|
553931
553862
|
super();
|