snow-ai 0.6.16 → 0.6.17
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 +1656 -762
- 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 useState65(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 useEffect57(create3, deps) {
|
|
1437
1437
|
var dispatcher = resolveDispatcher();
|
|
1438
1438
|
return dispatcher.useEffect(create3, deps);
|
|
1439
1439
|
}
|
|
@@ -1445,11 +1445,11 @@ var require_react_development = __commonJS({
|
|
|
1445
1445
|
var dispatcher = resolveDispatcher();
|
|
1446
1446
|
return dispatcher.useLayoutEffect(create3, deps);
|
|
1447
1447
|
}
|
|
1448
|
-
function
|
|
1448
|
+
function useCallback46(callback, deps) {
|
|
1449
1449
|
var dispatcher = resolveDispatcher();
|
|
1450
1450
|
return dispatcher.useCallback(callback, deps);
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1452
|
+
function useMemo32(create3, deps) {
|
|
1453
1453
|
var dispatcher = resolveDispatcher();
|
|
1454
1454
|
return dispatcher.useMemo(create3, deps);
|
|
1455
1455
|
}
|
|
@@ -2212,19 +2212,19 @@ var require_react_development = __commonJS({
|
|
|
2212
2212
|
exports2.memo = memo6;
|
|
2213
2213
|
exports2.startTransition = startTransition;
|
|
2214
2214
|
exports2.unstable_act = act;
|
|
2215
|
-
exports2.useCallback =
|
|
2215
|
+
exports2.useCallback = useCallback46;
|
|
2216
2216
|
exports2.useContext = useContext13;
|
|
2217
2217
|
exports2.useDebugValue = useDebugValue;
|
|
2218
2218
|
exports2.useDeferredValue = useDeferredValue;
|
|
2219
|
-
exports2.useEffect =
|
|
2219
|
+
exports2.useEffect = useEffect57;
|
|
2220
2220
|
exports2.useId = useId;
|
|
2221
2221
|
exports2.useImperativeHandle = useImperativeHandle2;
|
|
2222
2222
|
exports2.useInsertionEffect = useInsertionEffect;
|
|
2223
2223
|
exports2.useLayoutEffect = useLayoutEffect2;
|
|
2224
|
-
exports2.useMemo =
|
|
2224
|
+
exports2.useMemo = useMemo32;
|
|
2225
2225
|
exports2.useReducer = useReducer8;
|
|
2226
2226
|
exports2.useRef = useRef16;
|
|
2227
|
-
exports2.useState =
|
|
2227
|
+
exports2.useState = useState65;
|
|
2228
2228
|
exports2.useSyncExternalStore = useSyncExternalStore;
|
|
2229
2229
|
exports2.useTransition = useTransition;
|
|
2230
2230
|
exports2.version = ReactVersion;
|
|
@@ -9928,9 +9928,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
9928
9928
|
module2.exports = function $$$reconciler($$$hostConfig) {
|
|
9929
9929
|
var exports3 = {};
|
|
9930
9930
|
"use strict";
|
|
9931
|
-
var
|
|
9931
|
+
var React98 = require_react();
|
|
9932
9932
|
var Scheduler2 = require_scheduler();
|
|
9933
|
-
var ReactSharedInternals =
|
|
9933
|
+
var ReactSharedInternals = React98.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
9934
9934
|
var suppressWarning = false;
|
|
9935
9935
|
function setSuppressWarning(newSuppressWarning) {
|
|
9936
9936
|
{
|
|
@@ -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 EventEmitter12 = __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 EventEmitter12 {
|
|
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 EventEmitter12 = __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 EventEmitter12 {
|
|
29500
29500
|
/**
|
|
29501
29501
|
* Create a `WebSocketServer` instance.
|
|
29502
29502
|
*
|
|
@@ -46833,23 +46833,18 @@ function isCodebaseEnabled2() {
|
|
|
46833
46833
|
}
|
|
46834
46834
|
function getCurrentTimeInfo() {
|
|
46835
46835
|
const now = /* @__PURE__ */ new Date();
|
|
46836
|
-
|
|
46837
|
-
|
|
46838
|
-
|
|
46839
|
-
|
|
46840
|
-
};
|
|
46836
|
+
const year = now.getFullYear();
|
|
46837
|
+
const month = String(now.getMonth() + 1).padStart(2, "0");
|
|
46838
|
+
const day = String(now.getDate()).padStart(2, "0");
|
|
46839
|
+
return { date: `${year}-${month}-${day}` };
|
|
46841
46840
|
}
|
|
46842
46841
|
function appendSystemContext(prompt, systemEnv, timeInfo) {
|
|
46843
46842
|
return `${prompt}
|
|
46844
46843
|
|
|
46845
|
-
|
|
46846
|
-
|
|
46844
|
+
System Environment:
|
|
46847
46845
|
${systemEnv}
|
|
46848
46846
|
|
|
46849
|
-
|
|
46850
|
-
|
|
46851
|
-
Year: ${timeInfo.year}
|
|
46852
|
-
Month: ${timeInfo.month}`;
|
|
46847
|
+
Current Date: ${timeInfo.date}`;
|
|
46853
46848
|
}
|
|
46854
46849
|
var init_promptHelpers = __esm({
|
|
46855
46850
|
"dist/prompt/shared/promptHelpers.js"() {
|
|
@@ -46927,16 +46922,14 @@ function getVulnerabilityHuntingModeSystemPrompt() {
|
|
|
46927
46922
|
|
|
46928
46923
|
---
|
|
46929
46924
|
|
|
46930
|
-
|
|
46925
|
+
Reference Information (Context Only - Not Your Primary Focus)
|
|
46931
46926
|
|
|
46932
|
-
|
|
46927
|
+
System Environment:
|
|
46933
46928
|
${systemEnv}
|
|
46934
46929
|
|
|
46935
|
-
|
|
46936
|
-
Year: ${timeInfo.year}
|
|
46937
|
-
Month: ${timeInfo.month}
|
|
46930
|
+
Current Date: ${timeInfo.date}
|
|
46938
46931
|
|
|
46939
|
-
|
|
46932
|
+
REMINDER: The above information is ONLY context. Your PRIMARY task is the user's current question/request.`;
|
|
46940
46933
|
return finalPrompt + referenceContext;
|
|
46941
46934
|
}
|
|
46942
46935
|
var VULNERABILITY_HUNTING_MODE_SYSTEM_PROMPT;
|
|
@@ -50661,10 +50654,10 @@ var require_wrap_handler = __commonJS({
|
|
|
50661
50654
|
var require_dispatcher = __commonJS({
|
|
50662
50655
|
"node_modules/undici/lib/dispatcher/dispatcher.js"(exports2, module2) {
|
|
50663
50656
|
"use strict";
|
|
50664
|
-
var
|
|
50657
|
+
var EventEmitter12 = __require("node:events");
|
|
50665
50658
|
var WrapHandler = require_wrap_handler();
|
|
50666
50659
|
var wrapInterceptor = (dispatch) => (opts, handler) => dispatch(opts, WrapHandler.wrap(handler));
|
|
50667
|
-
var Dispatcher = class extends
|
|
50660
|
+
var Dispatcher = class extends EventEmitter12 {
|
|
50668
50661
|
dispatch() {
|
|
50669
50662
|
throw new Error("not implemented");
|
|
50670
50663
|
}
|
|
@@ -63067,9 +63060,9 @@ var require_memory_cache_store = __commonJS({
|
|
|
63067
63060
|
"node_modules/undici/lib/cache/memory-cache-store.js"(exports2, module2) {
|
|
63068
63061
|
"use strict";
|
|
63069
63062
|
var { Writable } = __require("node:stream");
|
|
63070
|
-
var { EventEmitter:
|
|
63063
|
+
var { EventEmitter: EventEmitter12 } = __require("node:events");
|
|
63071
63064
|
var { assertCacheKey, assertCacheValue } = require_cache();
|
|
63072
|
-
var MemoryCacheStore = class extends
|
|
63065
|
+
var MemoryCacheStore = class extends EventEmitter12 {
|
|
63073
63066
|
#maxCount = 1024;
|
|
63074
63067
|
#maxSize = 104857600;
|
|
63075
63068
|
// 100MB
|
|
@@ -81279,6 +81272,7 @@ var init_en = __esm({
|
|
|
81279
81272
|
permissions: "Manage always-approved tools permissions",
|
|
81280
81273
|
backend: "Show background processes panel",
|
|
81281
81274
|
profiles: "Switch configuration profiles",
|
|
81275
|
+
models: "Open model switching panel",
|
|
81282
81276
|
vulnerabilityHunting: "Toggle vulnerability hunting mode for security-focused code analysis",
|
|
81283
81277
|
quit: "Exit the application"
|
|
81284
81278
|
}
|
|
@@ -81293,6 +81287,37 @@ var init_en = __esm({
|
|
|
81293
81287
|
yes: "Yes",
|
|
81294
81288
|
no: "No"
|
|
81295
81289
|
},
|
|
81290
|
+
modelsPanel: {
|
|
81291
|
+
title: "Model Switching",
|
|
81292
|
+
subtitle: "Tab to switch tabs | Enter to select",
|
|
81293
|
+
tabAdvanced: "Advanced Model",
|
|
81294
|
+
tabBasic: "Basic Model",
|
|
81295
|
+
tabThinking: "Thinking",
|
|
81296
|
+
currentModel: "Current Model:",
|
|
81297
|
+
notSet: "Not Set",
|
|
81298
|
+
loadingModels: "Loading models...",
|
|
81299
|
+
hint: "Enter to select model | m for manual input | Esc to close",
|
|
81300
|
+
manualInputTitle: "Manual Input",
|
|
81301
|
+
manualInputHint: "Enter to save, Esc to close",
|
|
81302
|
+
filterLabel: "Filter:",
|
|
81303
|
+
manualInputOption: "Manual Input",
|
|
81304
|
+
requestMethod: "Request Method:",
|
|
81305
|
+
showThinkingProcess: "Show Thinking Process:",
|
|
81306
|
+
enableThinking: "Enable Thinking:",
|
|
81307
|
+
thinkingStrength: "Thinking Strength:",
|
|
81308
|
+
inputNumberHint: "Enter number, press Enter to save",
|
|
81309
|
+
escCancel: "Esc to cancel",
|
|
81310
|
+
navigationHint: "\u2191\u2193 to select | Enter to toggle | Esc to close",
|
|
81311
|
+
notSupported: "Not Supported",
|
|
81312
|
+
advancedModelLabel: "Advanced Model",
|
|
81313
|
+
basicModelLabel: "Basic Model",
|
|
81314
|
+
thinkingLabel: "Thinking",
|
|
81315
|
+
requestMethodNotSupportedForThinking: "Current request method ({requestMethod}) does not support thinking",
|
|
81316
|
+
requestMethodNotSupportedForThinkingStrength: "Current request method ({requestMethod}) does not support thinking strength settings",
|
|
81317
|
+
saveFailed: "Save failed",
|
|
81318
|
+
modelSaveFailed: "Model save failed",
|
|
81319
|
+
tipLabel: "Tip:"
|
|
81320
|
+
},
|
|
81296
81321
|
profilePanel: {
|
|
81297
81322
|
title: "Select Profile",
|
|
81298
81323
|
scrollHint: "\u2191\u2193 to scroll",
|
|
@@ -82446,6 +82471,7 @@ var init_zh = __esm({
|
|
|
82446
82471
|
vulnerabilityHunting: "\u5207\u6362\u6F0F\u6D1E\u68C0\u67E5\u6A21\u5F0F\uFF0C\u8FDB\u884C\u5B89\u5168\u6027\u4EE3\u7801\u5206\u6790",
|
|
82447
82472
|
backend: "\u663E\u793A\u540E\u53F0\u8FDB\u7A0B\u9762\u677F",
|
|
82448
82473
|
profiles: "\u6253\u5F00\u914D\u7F6E\u6587\u4EF6\u5207\u6362\u9762\u677F",
|
|
82474
|
+
models: "\u6253\u5F00\u6A21\u578B\u5207\u6362\u9762\u677F",
|
|
82449
82475
|
quit: "\u9000\u51FA\u5E94\u7528\u7A0B\u5E8F"
|
|
82450
82476
|
}
|
|
82451
82477
|
},
|
|
@@ -82459,6 +82485,37 @@ var init_zh = __esm({
|
|
|
82459
82485
|
yes: "\u662F",
|
|
82460
82486
|
no: "\u5426"
|
|
82461
82487
|
},
|
|
82488
|
+
modelsPanel: {
|
|
82489
|
+
title: "\u6A21\u578B\u5207\u6362",
|
|
82490
|
+
subtitle: "Tab \u5207\u6362\u6807\u7B7E | Enter \u9009\u62E9",
|
|
82491
|
+
tabAdvanced: "\u9AD8\u7EA7\u6A21\u578B",
|
|
82492
|
+
tabBasic: "\u57FA\u7840\u6A21\u578B",
|
|
82493
|
+
tabThinking: "\u601D\u8003",
|
|
82494
|
+
currentModel: "\u5F53\u524D\u6A21\u578B:",
|
|
82495
|
+
notSet: "\u672A\u8BBE\u7F6E",
|
|
82496
|
+
loadingModels: "\u6B63\u5728\u52A0\u8F7D\u6A21\u578B...",
|
|
82497
|
+
hint: "Enter \u9009\u62E9\u6A21\u578B | m \u624B\u52A8\u8F93\u5165 | Esc \u5173\u95ED",
|
|
82498
|
+
manualInputTitle: "\u624B\u52A8\u8F93\u5165",
|
|
82499
|
+
manualInputHint: "Enter\u4FDD\u5B58 | Esc \u5173\u95ED",
|
|
82500
|
+
filterLabel: "\u7B5B\u9009:",
|
|
82501
|
+
manualInputOption: "\u624B\u52A8\u8F93\u5165",
|
|
82502
|
+
requestMethod: "\u8BF7\u6C42\u65B9\u5F0F:",
|
|
82503
|
+
showThinkingProcess: "\u663E\u793A\u601D\u8003\u8FC7\u7A0B:",
|
|
82504
|
+
enableThinking: "\u542F\u7528\u601D\u8003:",
|
|
82505
|
+
thinkingStrength: "\u601D\u8003\u5F3A\u5EA6:",
|
|
82506
|
+
inputNumberHint: "\u8F93\u5165\u6570\u5B57\uFF0C\u56DE\u8F66\u4FDD\u5B58",
|
|
82507
|
+
escCancel: "Esc \u53D6\u6D88",
|
|
82508
|
+
navigationHint: "\u2191\u2193\u952E\u9009\u62E9 | Enter \u5207\u6362 | Esc \u5173\u95ED",
|
|
82509
|
+
notSupported: "\u4E0D\u652F\u6301",
|
|
82510
|
+
advancedModelLabel: "\u9AD8\u7EA7\u6A21\u578B",
|
|
82511
|
+
basicModelLabel: "\u57FA\u7840\u6A21\u578B",
|
|
82512
|
+
thinkingLabel: "\u601D\u8003",
|
|
82513
|
+
requestMethodNotSupportedForThinking: "\u5F53\u524D\u8BF7\u6C42\u65B9\u5F0F({requestMethod})\u4E0D\u652F\u6301\u601D\u8003",
|
|
82514
|
+
requestMethodNotSupportedForThinkingStrength: "\u5F53\u524D\u8BF7\u6C42\u65B9\u5F0F({requestMethod})\u4E0D\u652F\u6301\u601D\u8003\u5F3A\u5EA6\u8BBE\u7F6E",
|
|
82515
|
+
saveFailed: "\u4FDD\u5B58\u5931\u8D25",
|
|
82516
|
+
modelSaveFailed: "\u6A21\u578B\u4FDD\u5B58\u5931\u8D25",
|
|
82517
|
+
tipLabel: "\u63D0\u793A:"
|
|
82518
|
+
},
|
|
82462
82519
|
profilePanel: {
|
|
82463
82520
|
title: "\u9009\u62E9\u914D\u7F6E",
|
|
82464
82521
|
scrollHint: "\u2191\u2193 \u6EDA\u52A8",
|
|
@@ -83611,6 +83668,7 @@ var init_zh_TW = __esm({
|
|
|
83611
83668
|
vulnerabilityHunting: "\u5207\u63DB\u6F0F\u6D1E\u6AA2\u67E5\u6A21\u5F0F\uFF0C\u9032\u884C\u5B89\u5168\u6027\u4EE3\u78BC\u5206\u6790",
|
|
83612
83669
|
backend: "\u986F\u793A\u80CC\u666F\u8655\u7406\u7A0B\u5E8F\u9762\u677F",
|
|
83613
83670
|
profiles: "\u958B\u555F\u8A2D\u5B9A\u6A94\u5207\u63DB\u9762\u677F",
|
|
83671
|
+
models: "\u958B\u555F\u6A21\u578B\u5207\u63DB\u9762\u677F",
|
|
83614
83672
|
quit: "\u9000\u51FA\u61C9\u7528\u7A0B\u5F0F"
|
|
83615
83673
|
}
|
|
83616
83674
|
},
|
|
@@ -83624,6 +83682,37 @@ var init_zh_TW = __esm({
|
|
|
83624
83682
|
yes: "\u662F",
|
|
83625
83683
|
no: "\u5426"
|
|
83626
83684
|
},
|
|
83685
|
+
modelsPanel: {
|
|
83686
|
+
title: "\u6A21\u578B\u5207\u63DB",
|
|
83687
|
+
subtitle: "Tab \u5207\u63DB\u6A19\u7C64 | Enter \u9078\u64C7",
|
|
83688
|
+
tabAdvanced: "\u9032\u968E\u6A21\u578B",
|
|
83689
|
+
tabBasic: "\u57FA\u790E\u6A21\u578B",
|
|
83690
|
+
tabThinking: "\u601D\u8003",
|
|
83691
|
+
currentModel: "\u76EE\u524D\u6A21\u578B:",
|
|
83692
|
+
notSet: "\u672A\u8A2D\u5B9A",
|
|
83693
|
+
loadingModels: "\u6B63\u5728\u8F09\u5165\u6A21\u578B...",
|
|
83694
|
+
hint: "Enter \u9078\u64C7\u6A21\u578B | m \u624B\u52D5\u8F38\u5165 | Esc \u95DC\u9589",
|
|
83695
|
+
manualInputTitle: "\u624B\u52D5\u8F38\u5165",
|
|
83696
|
+
manualInputHint: "Enter\u5132\u5B58 | Esc \u95DC\u9589",
|
|
83697
|
+
filterLabel: "\u7BE9\u9078:",
|
|
83698
|
+
manualInputOption: "\u624B\u52D5\u8F38\u5165",
|
|
83699
|
+
requestMethod: "\u8ACB\u6C42\u65B9\u5F0F:",
|
|
83700
|
+
showThinkingProcess: "\u986F\u793A\u601D\u8003\u904E\u7A0B:",
|
|
83701
|
+
enableThinking: "\u555F\u7528\u601D\u8003:",
|
|
83702
|
+
thinkingStrength: "\u601D\u8003\u5F37\u5EA6:",
|
|
83703
|
+
inputNumberHint: "\u8F38\u5165\u6578\u5B57,Enter\u5132\u5B58",
|
|
83704
|
+
escCancel: "Esc \u53D6\u6D88",
|
|
83705
|
+
navigationHint: "\u2191\u2193\u9078\u64C7 | Enter \u5207\u63DB | Esc \u95DC\u9589",
|
|
83706
|
+
notSupported: "\u4E0D\u652F\u63F4",
|
|
83707
|
+
advancedModelLabel: "\u9032\u968E\u6A21\u578B",
|
|
83708
|
+
basicModelLabel: "\u57FA\u790E\u6A21\u578B",
|
|
83709
|
+
thinkingLabel: "\u601D\u8003",
|
|
83710
|
+
requestMethodNotSupportedForThinking: "\u76EE\u524D\u8ACB\u6C42\u65B9\u5F0F({requestMethod})\u4E0D\u652F\u63F4\u601D\u8003",
|
|
83711
|
+
requestMethodNotSupportedForThinkingStrength: "\u76EE\u524D\u8ACB\u6C42\u65B9\u5F0F({requestMethod})\u4E0D\u652F\u63F4\u601D\u8003\u5F37\u5EA6\u8A2D\u5B9A",
|
|
83712
|
+
saveFailed: "\u5132\u5B58\u5931\u6557",
|
|
83713
|
+
modelSaveFailed: "\u6A21\u578B\u5132\u5B58\u5931\u6557",
|
|
83714
|
+
tipLabel: "\u63D0\u793A:"
|
|
83715
|
+
},
|
|
83627
83716
|
profilePanel: {
|
|
83628
83717
|
title: "\u9078\u64C7\u8A2D\u5B9A\u6A94",
|
|
83629
83718
|
scrollHint: "\u2191\u2193 \u6372\u52D5",
|
|
@@ -377698,7 +377787,7 @@ var require_EventEmitter = __commonJS({
|
|
|
377698
377787
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
377699
377788
|
exports2.EventEmitter = void 0;
|
|
377700
377789
|
var mitt_1 = __importDefault2((init_mitt2(), __toCommonJS(mitt_exports)));
|
|
377701
|
-
var
|
|
377790
|
+
var EventEmitter12 = class {
|
|
377702
377791
|
#emitter = (0, mitt_1.default)();
|
|
377703
377792
|
on(type, handler) {
|
|
377704
377793
|
this.#emitter.on(type, handler);
|
|
@@ -377746,7 +377835,7 @@ var require_EventEmitter = __commonJS({
|
|
|
377746
377835
|
return this;
|
|
377747
377836
|
}
|
|
377748
377837
|
};
|
|
377749
|
-
exports2.EventEmitter =
|
|
377838
|
+
exports2.EventEmitter = EventEmitter12;
|
|
377750
377839
|
}
|
|
377751
377840
|
});
|
|
377752
377841
|
|
|
@@ -431025,6 +431114,10 @@ function isOpenAIEmbeddingsResponse(data) {
|
|
|
431025
431114
|
function isOllamaEmbedResponse(data) {
|
|
431026
431115
|
return Boolean(data) && typeof data.model === "string" && Array.isArray(data.embeddings);
|
|
431027
431116
|
}
|
|
431117
|
+
function isGeminiEmbedResponse(data) {
|
|
431118
|
+
var _a21;
|
|
431119
|
+
return Boolean(data) && (Boolean((_a21 = data.embedding) == null ? void 0 : _a21.values) || Boolean(data.embeddings));
|
|
431120
|
+
}
|
|
431028
431121
|
function resolveOllamaEmbeddingsEndpoint(baseUrl) {
|
|
431029
431122
|
const trimmed = baseUrl.trim().replace(/\/+$/, "");
|
|
431030
431123
|
if (trimmed.endsWith("/v1/embeddings")) {
|
|
@@ -431115,6 +431208,54 @@ function normalizeOllamaResponse(params) {
|
|
|
431115
431208
|
}
|
|
431116
431209
|
throw new Error(`Unexpected Ollama embeddings response format from ${url}. Try setting baseUrl to http://localhost:11434 (or /v1 for OpenAI-compatible mode).`);
|
|
431117
431210
|
}
|
|
431211
|
+
function normalizeGeminiResponse(params) {
|
|
431212
|
+
var _a21, _b14, _c6;
|
|
431213
|
+
const { data, model, expectedDimensions } = params;
|
|
431214
|
+
if (!isGeminiEmbedResponse(data)) {
|
|
431215
|
+
throw new Error("Unexpected Gemini embeddings response format");
|
|
431216
|
+
}
|
|
431217
|
+
if ((_a21 = data.embedding) == null ? void 0 : _a21.values) {
|
|
431218
|
+
const actualDimensions = data.embedding.values.length;
|
|
431219
|
+
if (expectedDimensions && actualDimensions !== expectedDimensions) {
|
|
431220
|
+
logger.warn(`Gemini embedding dimension mismatch (expected ${expectedDimensions}, got ${actualDimensions})`, { model, expectedDimensions, actualDimensions });
|
|
431221
|
+
}
|
|
431222
|
+
return {
|
|
431223
|
+
model,
|
|
431224
|
+
object: "list",
|
|
431225
|
+
usage: {
|
|
431226
|
+
total_tokens: 0,
|
|
431227
|
+
prompt_tokens: 0
|
|
431228
|
+
},
|
|
431229
|
+
data: [
|
|
431230
|
+
{
|
|
431231
|
+
object: "embedding",
|
|
431232
|
+
index: 0,
|
|
431233
|
+
embedding: data.embedding.values
|
|
431234
|
+
}
|
|
431235
|
+
]
|
|
431236
|
+
};
|
|
431237
|
+
}
|
|
431238
|
+
if (data.embeddings && Array.isArray(data.embeddings)) {
|
|
431239
|
+
const actualDimensions = data.embeddings.length > 0 ? (_c6 = (_b14 = data.embeddings[0]) == null ? void 0 : _b14.values) == null ? void 0 : _c6.length : void 0;
|
|
431240
|
+
if (expectedDimensions && actualDimensions && actualDimensions !== expectedDimensions) {
|
|
431241
|
+
logger.warn(`Gemini embedding dimension mismatch (expected ${expectedDimensions}, got ${actualDimensions})`, { model, expectedDimensions, actualDimensions });
|
|
431242
|
+
}
|
|
431243
|
+
return {
|
|
431244
|
+
model,
|
|
431245
|
+
object: "list",
|
|
431246
|
+
usage: {
|
|
431247
|
+
total_tokens: 0,
|
|
431248
|
+
prompt_tokens: 0
|
|
431249
|
+
},
|
|
431250
|
+
data: data.embeddings.map((emb, index) => ({
|
|
431251
|
+
object: "embedding",
|
|
431252
|
+
index,
|
|
431253
|
+
embedding: emb.values
|
|
431254
|
+
}))
|
|
431255
|
+
};
|
|
431256
|
+
}
|
|
431257
|
+
throw new Error("Gemini response missing embedding data");
|
|
431258
|
+
}
|
|
431118
431259
|
async function createEmbeddings(options3) {
|
|
431119
431260
|
const config3 = loadCodebaseConfig();
|
|
431120
431261
|
const model = options3.model || config3.embedding.modelName;
|
|
@@ -431131,23 +431272,40 @@ async function createEmbeddings(options3) {
|
|
|
431131
431272
|
if (!input2 || input2.length === 0) {
|
|
431132
431273
|
throw new Error("Input texts are required");
|
|
431133
431274
|
}
|
|
431134
|
-
const requestBody = {
|
|
431135
|
-
model,
|
|
431136
|
-
input: input2
|
|
431137
|
-
};
|
|
431138
|
-
if (task) {
|
|
431139
|
-
requestBody.task = task;
|
|
431140
|
-
}
|
|
431141
|
-
if (dimensions) {
|
|
431142
|
-
requestBody.dimensions = dimensions;
|
|
431143
|
-
}
|
|
431144
431275
|
const embeddingType = config3.embedding.type || "jina";
|
|
431276
|
+
let requestBody;
|
|
431277
|
+
if (embeddingType === "gemini") {
|
|
431278
|
+
requestBody = {
|
|
431279
|
+
content: {
|
|
431280
|
+
parts: input2.map((text3) => ({ text: text3 }))
|
|
431281
|
+
}
|
|
431282
|
+
};
|
|
431283
|
+
if (task) {
|
|
431284
|
+
requestBody.taskType = task;
|
|
431285
|
+
}
|
|
431286
|
+
if (dimensions) {
|
|
431287
|
+
requestBody.output_dimensionality = dimensions;
|
|
431288
|
+
}
|
|
431289
|
+
} else {
|
|
431290
|
+
requestBody = {
|
|
431291
|
+
model,
|
|
431292
|
+
input: input2
|
|
431293
|
+
};
|
|
431294
|
+
if (task) {
|
|
431295
|
+
requestBody.task = task;
|
|
431296
|
+
}
|
|
431297
|
+
if (dimensions) {
|
|
431298
|
+
requestBody.dimensions = dimensions;
|
|
431299
|
+
}
|
|
431300
|
+
}
|
|
431145
431301
|
let url;
|
|
431146
431302
|
let ollamaMode;
|
|
431147
431303
|
if (embeddingType === "ollama") {
|
|
431148
431304
|
const resolved = resolveOllamaEmbeddingsEndpoint(baseUrl);
|
|
431149
431305
|
url = resolved.url;
|
|
431150
431306
|
ollamaMode = resolved.mode;
|
|
431307
|
+
} else if (embeddingType === "gemini") {
|
|
431308
|
+
url = `${baseUrl.trim().replace(/\/+$/, "")}/models/${model}:embedContent`;
|
|
431151
431309
|
} else {
|
|
431152
431310
|
url = resolveOpenAICompatibleEmbeddingsEndpoint(baseUrl);
|
|
431153
431311
|
}
|
|
@@ -431155,8 +431313,14 @@ async function createEmbeddings(options3) {
|
|
|
431155
431313
|
"Content-Type": "application/json",
|
|
431156
431314
|
"x-snow": getVersionHeader()
|
|
431157
431315
|
};
|
|
431158
|
-
if (
|
|
431159
|
-
|
|
431316
|
+
if (embeddingType === "gemini") {
|
|
431317
|
+
if (apiKey) {
|
|
431318
|
+
headers["x-goog-api-key"] = apiKey;
|
|
431319
|
+
}
|
|
431320
|
+
} else {
|
|
431321
|
+
if (apiKey) {
|
|
431322
|
+
headers["Authorization"] = `Bearer ${apiKey}`;
|
|
431323
|
+
}
|
|
431160
431324
|
}
|
|
431161
431325
|
const fetchOptions = addProxyToFetchOptions(url, {
|
|
431162
431326
|
method: "POST",
|
|
@@ -431178,6 +431342,13 @@ async function createEmbeddings(options3) {
|
|
|
431178
431342
|
url
|
|
431179
431343
|
});
|
|
431180
431344
|
}
|
|
431345
|
+
if (embeddingType === "gemini") {
|
|
431346
|
+
return normalizeGeminiResponse({
|
|
431347
|
+
data,
|
|
431348
|
+
model,
|
|
431349
|
+
expectedDimensions: dimensions
|
|
431350
|
+
});
|
|
431351
|
+
}
|
|
431181
431352
|
return data;
|
|
431182
431353
|
}
|
|
431183
431354
|
async function createEmbedding(text3, options3) {
|
|
@@ -446116,7 +446287,8 @@ function CodeBaseConfigScreen({ onBack, onSave, inlineMode = false }) {
|
|
|
446116
446287
|
];
|
|
446117
446288
|
const embeddingTypeOptions = [
|
|
446118
446289
|
{ label: "Jina & OpenAI", value: "jina" },
|
|
446119
|
-
{ label: "Ollama", value: "ollama" }
|
|
446290
|
+
{ label: "Ollama", value: "ollama" },
|
|
446291
|
+
{ label: "Gemini", value: "gemini" }
|
|
446120
446292
|
];
|
|
446121
446293
|
const currentFieldIndex = allFields.indexOf(currentField);
|
|
446122
446294
|
const totalFields = allFields.length;
|
|
@@ -538709,6 +538881,9 @@ function MessageRenderer({ message, index, filteredMessages, terminalWidth, show
|
|
|
538709
538881
|
var _a21, _b14, _c6, _d4, _e2, _f;
|
|
538710
538882
|
const { theme: theme14 } = useTheme();
|
|
538711
538883
|
const { t } = useI18n();
|
|
538884
|
+
if (!showThinking && message.thinking && !message.content && !message.toolCall && !message.toolResult && !message.terminalResult && !message.discontinued && !message.hookError) {
|
|
538885
|
+
return null;
|
|
538886
|
+
}
|
|
538712
538887
|
const removeAnsiCodes = (text3) => {
|
|
538713
538888
|
return text3.replace(/\x1b\[[0-9;]*m/g, "");
|
|
538714
538889
|
};
|
|
@@ -540324,6 +540499,27 @@ var init_WelcomeScreen = __esm({
|
|
|
540324
540499
|
}
|
|
540325
540500
|
});
|
|
540326
540501
|
|
|
540502
|
+
// dist/utils/config/configEvents.js
|
|
540503
|
+
import { EventEmitter as EventEmitter10 } from "events";
|
|
540504
|
+
var ConfigEventEmitter, configEvents;
|
|
540505
|
+
var init_configEvents = __esm({
|
|
540506
|
+
"dist/utils/config/configEvents.js"() {
|
|
540507
|
+
"use strict";
|
|
540508
|
+
ConfigEventEmitter = class extends EventEmitter10 {
|
|
540509
|
+
emitConfigChange(event) {
|
|
540510
|
+
this.emit("config-change", event);
|
|
540511
|
+
}
|
|
540512
|
+
onConfigChange(callback) {
|
|
540513
|
+
this.on("config-change", callback);
|
|
540514
|
+
}
|
|
540515
|
+
removeConfigChangeListener(callback) {
|
|
540516
|
+
this.off("config-change", callback);
|
|
540517
|
+
}
|
|
540518
|
+
};
|
|
540519
|
+
configEvents = new ConfigEventEmitter();
|
|
540520
|
+
}
|
|
540521
|
+
});
|
|
540522
|
+
|
|
540327
540523
|
// dist/utils/core/textUtils.js
|
|
540328
540524
|
function toCodePoints(str2) {
|
|
540329
540525
|
return Array.from(str2);
|
|
@@ -540338,6 +540534,31 @@ function cpSlice(str2, start, end) {
|
|
|
540338
540534
|
function visualWidth(str2) {
|
|
540339
540535
|
return stringWidth(str2);
|
|
540340
540536
|
}
|
|
540537
|
+
function codePointToVisualPos(str2, codePointIndex) {
|
|
540538
|
+
const codePoints = toCodePoints(str2);
|
|
540539
|
+
let visualPos = 0;
|
|
540540
|
+
for (let i = 0; i < Math.min(codePointIndex, codePoints.length); i++) {
|
|
540541
|
+
const char = codePoints[i] || "";
|
|
540542
|
+
visualPos += visualWidth(char);
|
|
540543
|
+
}
|
|
540544
|
+
return visualPos;
|
|
540545
|
+
}
|
|
540546
|
+
function visualPosToCodePoint(str2, visualPos) {
|
|
540547
|
+
const codePoints = toCodePoints(str2);
|
|
540548
|
+
let currentVisualPos = 0;
|
|
540549
|
+
for (let i = 0; i < codePoints.length; i++) {
|
|
540550
|
+
const char = codePoints[i] || "";
|
|
540551
|
+
const charWidth = visualWidth(char);
|
|
540552
|
+
if (currentVisualPos + charWidth > visualPos) {
|
|
540553
|
+
return i;
|
|
540554
|
+
}
|
|
540555
|
+
currentVisualPos += charWidth;
|
|
540556
|
+
if (currentVisualPos >= visualPos) {
|
|
540557
|
+
return i + 1;
|
|
540558
|
+
}
|
|
540559
|
+
}
|
|
540560
|
+
return codePoints.length;
|
|
540561
|
+
}
|
|
540341
540562
|
function formatElapsedTime(seconds) {
|
|
540342
540563
|
if (seconds < 60) {
|
|
540343
540564
|
return `${seconds}s`;
|
|
@@ -540787,13 +541008,17 @@ var init_textBuffer = __esm({
|
|
|
540787
541008
|
const clamped = Math.max(0, Math.min(position, totalLength));
|
|
540788
541009
|
for (let i = this.visualLines.length - 1; i >= 0; i--) {
|
|
540789
541010
|
const start = this.visualLineStarts[i] ?? 0;
|
|
540790
|
-
|
|
541011
|
+
const nextStart = this.visualLineStarts[i + 1];
|
|
541012
|
+
const lineEnd = typeof nextStart === "number" ? nextStart - 1 : totalLength;
|
|
541013
|
+
if (clamped >= start && clamped <= lineEnd) {
|
|
540791
541014
|
const line = this.visualLines[i] ?? "";
|
|
540792
|
-
const
|
|
541015
|
+
const lineOffset = Math.max(0, clamped - start);
|
|
541016
|
+
const withinLine = cpSlice(this.content, start, start + lineOffset);
|
|
541017
|
+
const col = Math.min(visualWidth(line), codePointToVisualPos(withinLine, cpLen(withinLine)));
|
|
540793
541018
|
return [i, col];
|
|
540794
541019
|
}
|
|
540795
541020
|
}
|
|
540796
|
-
return [0,
|
|
541021
|
+
return [0, 0];
|
|
540797
541022
|
}
|
|
540798
541023
|
moveCursorToVisualRow(targetRow) {
|
|
540799
541024
|
if (this.visualLines.length === 0) {
|
|
@@ -540804,10 +541029,11 @@ var init_textBuffer = __esm({
|
|
|
540804
541029
|
const row = Math.max(0, Math.min(targetRow, this.visualLines.length - 1));
|
|
540805
541030
|
const start = this.visualLineStarts[row] ?? 0;
|
|
540806
541031
|
const line = this.visualLines[row] ?? "";
|
|
540807
|
-
const
|
|
540808
|
-
const
|
|
540809
|
-
|
|
540810
|
-
this.
|
|
541032
|
+
const lineVisualWidth = visualWidth(line);
|
|
541033
|
+
const visualColumn = Math.min(this.preferredVisualCol, lineVisualWidth);
|
|
541034
|
+
const codePointOffset = visualPosToCodePoint(line, visualColumn);
|
|
541035
|
+
this.cursorIndex = start + codePointOffset;
|
|
541036
|
+
this.visualCursorPos = [row, visualColumn];
|
|
540811
541037
|
}
|
|
540812
541038
|
recomputeVisualCursorOnly() {
|
|
540813
541039
|
this.visualCursorPos = this.computeVisualCursorFromIndex(this.cursorIndex);
|
|
@@ -541131,6 +541357,10 @@ function useCommandPanel(buffer, isProcessing = false) {
|
|
|
541131
541357
|
name: "profiles",
|
|
541132
541358
|
description: t.commandPanel.commands.profiles
|
|
541133
541359
|
},
|
|
541360
|
+
{
|
|
541361
|
+
name: "models",
|
|
541362
|
+
description: t.commandPanel.commands.models
|
|
541363
|
+
},
|
|
541134
541364
|
{
|
|
541135
541365
|
name: "export",
|
|
541136
541366
|
description: t.commandPanel.commands.export
|
|
@@ -542102,6 +542332,7 @@ function useKeyboardInput(options3) {
|
|
|
542102
542332
|
const isPasting = (0, import_react89.useRef)(false);
|
|
542103
542333
|
const inputStartCursorPos = (0, import_react89.useRef)(0);
|
|
542104
542334
|
const isProcessingInput = (0, import_react89.useRef)(false);
|
|
542335
|
+
const inputSessionId = (0, import_react89.useRef)(0);
|
|
542105
542336
|
const componentMountTime = (0, import_react89.useRef)(Date.now());
|
|
542106
542337
|
(0, import_react89.useEffect)(() => {
|
|
542107
542338
|
return () => {
|
|
@@ -542142,6 +542373,7 @@ function useKeyboardInput(options3) {
|
|
|
542142
542373
|
clearTimeout(inputTimer.current);
|
|
542143
542374
|
inputTimer.current = null;
|
|
542144
542375
|
}
|
|
542376
|
+
inputSessionId.current += 1;
|
|
542145
542377
|
const accumulated = inputBuffer.current;
|
|
542146
542378
|
const savedCursorPosition = inputStartCursorPos.current;
|
|
542147
542379
|
inputBuffer.current = "";
|
|
@@ -542764,11 +542996,13 @@ function useKeyboardInput(options3) {
|
|
|
542764
542996
|
if (isStartingNewInput) {
|
|
542765
542997
|
inputStartCursorPos.current = buffer.getCursorPosition();
|
|
542766
542998
|
isProcessingInput.current = true;
|
|
542999
|
+
inputSessionId.current += 1;
|
|
542767
543000
|
}
|
|
542768
543001
|
inputBuffer.current += input2;
|
|
542769
543002
|
if (inputTimer.current) {
|
|
542770
543003
|
clearTimeout(inputTimer.current);
|
|
542771
543004
|
}
|
|
543005
|
+
const activeSessionId = inputSessionId.current;
|
|
542772
543006
|
const currentLength = inputBuffer.current.length;
|
|
542773
543007
|
if (currentLength > 300 && !isPasting.current) {
|
|
542774
543008
|
isPasting.current = true;
|
|
@@ -542781,6 +543015,9 @@ function useKeyboardInput(options3) {
|
|
|
542781
543015
|
triggerUpdate();
|
|
542782
543016
|
}
|
|
542783
543017
|
inputTimer.current = setTimeout(() => {
|
|
543018
|
+
if (activeSessionId !== inputSessionId.current) {
|
|
543019
|
+
return;
|
|
543020
|
+
}
|
|
542784
543021
|
const accumulated = inputBuffer.current;
|
|
542785
543022
|
const savedCursorPosition = inputStartCursorPos.current;
|
|
542786
543023
|
const wasPasting = isPasting.current;
|
|
@@ -544852,9 +545089,10 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
544852
545089
|
for (let i = 0; i < visualLines.length; i++) {
|
|
544853
545090
|
const line = visualLines[i] || "";
|
|
544854
545091
|
if (i === cursorRow) {
|
|
544855
|
-
const
|
|
544856
|
-
const
|
|
544857
|
-
const
|
|
545092
|
+
const cursorIndex = visualPosToCodePoint(line, cursorCol);
|
|
545093
|
+
const beforeCursor = cpSlice(line, 0, cursorIndex);
|
|
545094
|
+
const atCursor = cpSlice(line, cursorIndex, cursorIndex + 1) || " ";
|
|
545095
|
+
const afterCursor = cpSlice(line, cursorIndex + 1);
|
|
544858
545096
|
renderedLines.push(import_react99.default.createElement(
|
|
544859
545097
|
Box_default,
|
|
544860
545098
|
{ key: i, flexDirection: "row" },
|
|
@@ -549572,21 +549810,617 @@ var init_RoleListPanel = __esm({
|
|
|
549572
549810
|
}
|
|
549573
549811
|
});
|
|
549574
549812
|
|
|
549813
|
+
// dist/ui/components/panels/ModelsPanel.js
|
|
549814
|
+
var import_react122, ModelsPanel;
|
|
549815
|
+
var init_ModelsPanel = __esm({
|
|
549816
|
+
async "dist/ui/components/panels/ModelsPanel.js"() {
|
|
549817
|
+
"use strict";
|
|
549818
|
+
import_react122 = __toESM(require_react(), 1);
|
|
549819
|
+
await init_build2();
|
|
549820
|
+
await init_build3();
|
|
549821
|
+
await init_ScrollableSelectInput();
|
|
549822
|
+
init_models();
|
|
549823
|
+
init_apiConfig();
|
|
549824
|
+
init_ThemeContext();
|
|
549825
|
+
init_i18n();
|
|
549826
|
+
init_configEvents();
|
|
549827
|
+
ModelsPanel = ({ advancedModel, basicModel, visible, onClose }) => {
|
|
549828
|
+
const { theme: theme14 } = useTheme();
|
|
549829
|
+
const { t } = useI18n();
|
|
549830
|
+
const [activeTab, setActiveTab] = (0, import_react122.useState)("advanced");
|
|
549831
|
+
const isModelTab = activeTab === "advanced" || activeTab === "basic";
|
|
549832
|
+
const [localAdvancedModel, setLocalAdvancedModel] = (0, import_react122.useState)(advancedModel);
|
|
549833
|
+
const [localBasicModel, setLocalBasicModel] = (0, import_react122.useState)(basicModel);
|
|
549834
|
+
const [models, setModels] = (0, import_react122.useState)([]);
|
|
549835
|
+
const [loading, setLoading] = (0, import_react122.useState)(false);
|
|
549836
|
+
const [errorMessage, setErrorMessage] = (0, import_react122.useState)("");
|
|
549837
|
+
const [isSelecting, setIsSelecting] = (0, import_react122.useState)(false);
|
|
549838
|
+
const [searchTerm, setSearchTerm] = (0, import_react122.useState)("");
|
|
549839
|
+
const [manualInputMode, setManualInputMode] = (0, import_react122.useState)(false);
|
|
549840
|
+
const [manualInputValue, setManualInputValue] = (0, import_react122.useState)("");
|
|
549841
|
+
const [hasStartedLoading, setHasStartedLoading] = (0, import_react122.useState)(false);
|
|
549842
|
+
const [requestMethod, setRequestMethod] = (0, import_react122.useState)("chat");
|
|
549843
|
+
const [showThinking, setShowThinking] = (0, import_react122.useState)(true);
|
|
549844
|
+
const [thinkingEnabled, setThinkingEnabled] = (0, import_react122.useState)(false);
|
|
549845
|
+
const [thinkingBudgetTokens, setThinkingBudgetTokens] = (0, import_react122.useState)(1e4);
|
|
549846
|
+
const [geminiThinkingEnabled, setGeminiThinkingEnabled] = (0, import_react122.useState)(false);
|
|
549847
|
+
const [geminiThinkingBudget, setGeminiThinkingBudget] = (0, import_react122.useState)(1024);
|
|
549848
|
+
const [responsesReasoningEnabled, setResponsesReasoningEnabled] = (0, import_react122.useState)(false);
|
|
549849
|
+
const [responsesReasoningEffort, setResponsesReasoningEffort] = (0, import_react122.useState)("high");
|
|
549850
|
+
const [thinkingFocusIndex, setThinkingFocusIndex] = (0, import_react122.useState)(0);
|
|
549851
|
+
const [thinkingInputMode, setThinkingInputMode] = (0, import_react122.useState)(null);
|
|
549852
|
+
const [thinkingInputValue, setThinkingInputValue] = (0, import_react122.useState)("");
|
|
549853
|
+
const [isThinkingEffortSelecting, setIsThinkingEffortSelecting] = (0, import_react122.useState)(false);
|
|
549854
|
+
(0, import_react122.useEffect)(() => {
|
|
549855
|
+
var _a21, _b14, _c6, _d4, _e2, _f;
|
|
549856
|
+
if (!visible) {
|
|
549857
|
+
return;
|
|
549858
|
+
}
|
|
549859
|
+
setActiveTab("advanced");
|
|
549860
|
+
setLocalAdvancedModel(advancedModel);
|
|
549861
|
+
setLocalBasicModel(basicModel);
|
|
549862
|
+
setIsSelecting(false);
|
|
549863
|
+
setSearchTerm("");
|
|
549864
|
+
setManualInputMode(false);
|
|
549865
|
+
setManualInputValue("");
|
|
549866
|
+
setHasStartedLoading(false);
|
|
549867
|
+
setThinkingFocusIndex(0);
|
|
549868
|
+
setThinkingInputMode(null);
|
|
549869
|
+
setThinkingInputValue("");
|
|
549870
|
+
setIsThinkingEffortSelecting(false);
|
|
549871
|
+
setErrorMessage("");
|
|
549872
|
+
const cfg = getOpenAiConfig();
|
|
549873
|
+
setRequestMethod(cfg.requestMethod || "chat");
|
|
549874
|
+
setShowThinking(cfg.showThinking !== false);
|
|
549875
|
+
setThinkingEnabled(((_a21 = cfg.thinking) == null ? void 0 : _a21.type) === "enabled" || false);
|
|
549876
|
+
setThinkingBudgetTokens(((_b14 = cfg.thinking) == null ? void 0 : _b14.budget_tokens) || 1e4);
|
|
549877
|
+
setGeminiThinkingEnabled(((_c6 = cfg.geminiThinking) == null ? void 0 : _c6.enabled) || false);
|
|
549878
|
+
setGeminiThinkingBudget(((_d4 = cfg.geminiThinking) == null ? void 0 : _d4.budget) || 1024);
|
|
549879
|
+
setResponsesReasoningEnabled(((_e2 = cfg.responsesReasoning) == null ? void 0 : _e2.enabled) || false);
|
|
549880
|
+
setResponsesReasoningEffort(((_f = cfg.responsesReasoning) == null ? void 0 : _f.effort) || "high");
|
|
549881
|
+
}, [visible, advancedModel, basicModel]);
|
|
549882
|
+
const modelTarget = activeTab === "basic" ? "basic" : activeTab === "thinking" ? "thinking" : "advanced";
|
|
549883
|
+
const currentModel = modelTarget === "advanced" ? localAdvancedModel : modelTarget === "basic" ? localBasicModel : "";
|
|
549884
|
+
const currentLabel = modelTarget === "advanced" ? t.modelsPanel.advancedModelLabel : modelTarget === "basic" ? t.modelsPanel.basicModelLabel : t.modelsPanel.thinkingLabel;
|
|
549885
|
+
const loadModels = (0, import_react122.useCallback)(async () => {
|
|
549886
|
+
setLoading(true);
|
|
549887
|
+
setErrorMessage("");
|
|
549888
|
+
try {
|
|
549889
|
+
const fetchedModels = await fetchAvailableModels();
|
|
549890
|
+
setModels(fetchedModels);
|
|
549891
|
+
return fetchedModels;
|
|
549892
|
+
} catch (err) {
|
|
549893
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.loadingModels;
|
|
549894
|
+
setErrorMessage(message);
|
|
549895
|
+
throw err;
|
|
549896
|
+
} finally {
|
|
549897
|
+
setLoading(false);
|
|
549898
|
+
}
|
|
549899
|
+
}, [t]);
|
|
549900
|
+
const applyModel = (0, import_react122.useCallback)(async (value, target) => {
|
|
549901
|
+
setErrorMessage("");
|
|
549902
|
+
try {
|
|
549903
|
+
if (target === "advanced") {
|
|
549904
|
+
await updateOpenAiConfig({ advancedModel: value });
|
|
549905
|
+
setLocalAdvancedModel(value);
|
|
549906
|
+
} else {
|
|
549907
|
+
await updateOpenAiConfig({ basicModel: value });
|
|
549908
|
+
setLocalBasicModel(value);
|
|
549909
|
+
}
|
|
549910
|
+
} catch (err) {
|
|
549911
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.modelSaveFailed;
|
|
549912
|
+
setErrorMessage(message);
|
|
549913
|
+
}
|
|
549914
|
+
}, []);
|
|
549915
|
+
const filteredModels = (0, import_react122.useMemo)(() => filterModels(models, searchTerm), [models, searchTerm]);
|
|
549916
|
+
const currentOptions = (0, import_react122.useMemo)(() => [
|
|
549917
|
+
{ label: t.modelsPanel.manualInputOption, value: "__MANUAL_INPUT__" },
|
|
549918
|
+
...filteredModels.map((model) => ({
|
|
549919
|
+
label: model.id,
|
|
549920
|
+
value: model.id
|
|
549921
|
+
}))
|
|
549922
|
+
], [filteredModels, t]);
|
|
549923
|
+
const handleModelSelect = (0, import_react122.useCallback)((value) => {
|
|
549924
|
+
if (value === "__MANUAL_INPUT__") {
|
|
549925
|
+
setIsSelecting(false);
|
|
549926
|
+
setSearchTerm("");
|
|
549927
|
+
setManualInputMode(true);
|
|
549928
|
+
setManualInputValue(currentModel);
|
|
549929
|
+
return;
|
|
549930
|
+
}
|
|
549931
|
+
if (modelTarget !== "thinking") {
|
|
549932
|
+
void applyModel(value, modelTarget);
|
|
549933
|
+
}
|
|
549934
|
+
setIsSelecting(false);
|
|
549935
|
+
setSearchTerm("");
|
|
549936
|
+
}, [applyModel, currentModel, modelTarget]);
|
|
549937
|
+
const handleManualSave = (0, import_react122.useCallback)(() => {
|
|
549938
|
+
const cleaned = manualInputValue.trim();
|
|
549939
|
+
if (cleaned && modelTarget !== "thinking") {
|
|
549940
|
+
void applyModel(cleaned, modelTarget);
|
|
549941
|
+
}
|
|
549942
|
+
setManualInputMode(false);
|
|
549943
|
+
setManualInputValue("");
|
|
549944
|
+
setSearchTerm("");
|
|
549945
|
+
}, [applyModel, manualInputValue, modelTarget]);
|
|
549946
|
+
const thinkingEnabledValue = (0, import_react122.useMemo)(() => {
|
|
549947
|
+
if (requestMethod === "anthropic") {
|
|
549948
|
+
return thinkingEnabled;
|
|
549949
|
+
}
|
|
549950
|
+
if (requestMethod === "gemini") {
|
|
549951
|
+
return geminiThinkingEnabled;
|
|
549952
|
+
}
|
|
549953
|
+
if (requestMethod === "responses") {
|
|
549954
|
+
return responsesReasoningEnabled;
|
|
549955
|
+
}
|
|
549956
|
+
return false;
|
|
549957
|
+
}, [
|
|
549958
|
+
requestMethod,
|
|
549959
|
+
thinkingEnabled,
|
|
549960
|
+
geminiThinkingEnabled,
|
|
549961
|
+
responsesReasoningEnabled
|
|
549962
|
+
]);
|
|
549963
|
+
const thinkingStrengthValue = (0, import_react122.useMemo)(() => {
|
|
549964
|
+
if (requestMethod === "anthropic") {
|
|
549965
|
+
return String(thinkingBudgetTokens);
|
|
549966
|
+
}
|
|
549967
|
+
if (requestMethod === "gemini") {
|
|
549968
|
+
return String(geminiThinkingBudget);
|
|
549969
|
+
}
|
|
549970
|
+
if (requestMethod === "responses") {
|
|
549971
|
+
return responsesReasoningEffort;
|
|
549972
|
+
}
|
|
549973
|
+
return t.modelsPanel.notSupported;
|
|
549974
|
+
}, [
|
|
549975
|
+
requestMethod,
|
|
549976
|
+
thinkingBudgetTokens,
|
|
549977
|
+
geminiThinkingBudget,
|
|
549978
|
+
responsesReasoningEffort,
|
|
549979
|
+
t
|
|
549980
|
+
]);
|
|
549981
|
+
const applyShowThinking = (0, import_react122.useCallback)(async (next) => {
|
|
549982
|
+
setErrorMessage("");
|
|
549983
|
+
try {
|
|
549984
|
+
setShowThinking(next);
|
|
549985
|
+
await updateOpenAiConfig({ showThinking: next });
|
|
549986
|
+
configEvents.emitConfigChange({
|
|
549987
|
+
type: "showThinking",
|
|
549988
|
+
value: next
|
|
549989
|
+
});
|
|
549990
|
+
} catch (err) {
|
|
549991
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
549992
|
+
setErrorMessage(message);
|
|
549993
|
+
}
|
|
549994
|
+
}, []);
|
|
549995
|
+
const applyThinkingEnabled = (0, import_react122.useCallback)(async (next) => {
|
|
549996
|
+
setErrorMessage("");
|
|
549997
|
+
try {
|
|
549998
|
+
if (requestMethod === "anthropic") {
|
|
549999
|
+
setThinkingEnabled(next);
|
|
550000
|
+
await updateOpenAiConfig({
|
|
550001
|
+
thinking: next ? { type: "enabled", budget_tokens: thinkingBudgetTokens } : void 0
|
|
550002
|
+
});
|
|
550003
|
+
return;
|
|
550004
|
+
}
|
|
550005
|
+
if (requestMethod === "gemini") {
|
|
550006
|
+
setGeminiThinkingEnabled(next);
|
|
550007
|
+
await updateOpenAiConfig({
|
|
550008
|
+
geminiThinking: next ? { enabled: true, budget: geminiThinkingBudget } : void 0
|
|
550009
|
+
});
|
|
550010
|
+
return;
|
|
550011
|
+
}
|
|
550012
|
+
if (requestMethod === "responses") {
|
|
550013
|
+
setResponsesReasoningEnabled(next);
|
|
550014
|
+
await updateOpenAiConfig({
|
|
550015
|
+
responsesReasoning: {
|
|
550016
|
+
enabled: next,
|
|
550017
|
+
effort: responsesReasoningEffort
|
|
550018
|
+
}
|
|
550019
|
+
});
|
|
550020
|
+
return;
|
|
550021
|
+
}
|
|
550022
|
+
setErrorMessage(t.modelsPanel.requestMethodNotSupportedForThinking.replace("{requestMethod}", requestMethod));
|
|
550023
|
+
} catch (err) {
|
|
550024
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
550025
|
+
setErrorMessage(message);
|
|
550026
|
+
}
|
|
550027
|
+
}, [
|
|
550028
|
+
requestMethod,
|
|
550029
|
+
thinkingBudgetTokens,
|
|
550030
|
+
geminiThinkingBudget,
|
|
550031
|
+
responsesReasoningEffort
|
|
550032
|
+
]);
|
|
550033
|
+
const applyAnthropicBudgetTokens = (0, import_react122.useCallback)(async (next) => {
|
|
550034
|
+
setErrorMessage("");
|
|
550035
|
+
try {
|
|
550036
|
+
setThinkingBudgetTokens(next);
|
|
550037
|
+
await updateOpenAiConfig({
|
|
550038
|
+
thinking: thinkingEnabled ? { type: "enabled", budget_tokens: next } : void 0
|
|
550039
|
+
});
|
|
550040
|
+
} catch (err) {
|
|
550041
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
550042
|
+
setErrorMessage(message);
|
|
550043
|
+
}
|
|
550044
|
+
}, [thinkingEnabled]);
|
|
550045
|
+
const applyGeminiBudget = (0, import_react122.useCallback)(async (next) => {
|
|
550046
|
+
setErrorMessage("");
|
|
550047
|
+
try {
|
|
550048
|
+
setGeminiThinkingBudget(next);
|
|
550049
|
+
await updateOpenAiConfig({
|
|
550050
|
+
geminiThinking: geminiThinkingEnabled ? { enabled: true, budget: next } : void 0
|
|
550051
|
+
});
|
|
550052
|
+
} catch (err) {
|
|
550053
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
550054
|
+
setErrorMessage(message);
|
|
550055
|
+
}
|
|
550056
|
+
}, [geminiThinkingEnabled]);
|
|
550057
|
+
const applyResponsesEffort = (0, import_react122.useCallback)(async (effort) => {
|
|
550058
|
+
setErrorMessage("");
|
|
550059
|
+
try {
|
|
550060
|
+
setResponsesReasoningEffort(effort);
|
|
550061
|
+
await updateOpenAiConfig({
|
|
550062
|
+
responsesReasoning: {
|
|
550063
|
+
enabled: responsesReasoningEnabled,
|
|
550064
|
+
effort
|
|
550065
|
+
}
|
|
550066
|
+
});
|
|
550067
|
+
} catch (err) {
|
|
550068
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
550069
|
+
setErrorMessage(message);
|
|
550070
|
+
}
|
|
550071
|
+
}, [responsesReasoningEnabled]);
|
|
550072
|
+
const selectedIndex = Math.max(0, currentOptions.findIndex((option) => option.value === currentModel));
|
|
550073
|
+
const tabActiveBackground = theme14.colors.menuSelected.startsWith("#") && theme14.colors.menuSelected.length === 9 ? theme14.colors.menuSelected.slice(0, 7) : theme14.colors.menuSelected;
|
|
550074
|
+
use_input_default((input2, key) => {
|
|
550075
|
+
if (!visible) {
|
|
550076
|
+
return;
|
|
550077
|
+
}
|
|
550078
|
+
if (key.escape) {
|
|
550079
|
+
if (thinkingInputMode) {
|
|
550080
|
+
setThinkingInputMode(null);
|
|
550081
|
+
setThinkingInputValue("");
|
|
550082
|
+
return;
|
|
550083
|
+
}
|
|
550084
|
+
if (isThinkingEffortSelecting) {
|
|
550085
|
+
setIsThinkingEffortSelecting(false);
|
|
550086
|
+
return;
|
|
550087
|
+
}
|
|
550088
|
+
if (manualInputMode) {
|
|
550089
|
+
setManualInputMode(false);
|
|
550090
|
+
setManualInputValue("");
|
|
550091
|
+
setSearchTerm("");
|
|
550092
|
+
setHasStartedLoading(false);
|
|
550093
|
+
return;
|
|
550094
|
+
}
|
|
550095
|
+
if (isSelecting) {
|
|
550096
|
+
setIsSelecting(false);
|
|
550097
|
+
setSearchTerm("");
|
|
550098
|
+
setHasStartedLoading(false);
|
|
550099
|
+
return;
|
|
550100
|
+
}
|
|
550101
|
+
if (loading || hasStartedLoading) {
|
|
550102
|
+
setHasStartedLoading(false);
|
|
550103
|
+
return;
|
|
550104
|
+
}
|
|
550105
|
+
onClose();
|
|
550106
|
+
return;
|
|
550107
|
+
}
|
|
550108
|
+
if (thinkingInputMode) {
|
|
550109
|
+
if (key.return) {
|
|
550110
|
+
const parsed = Number.parseInt(thinkingInputValue.trim(), 10);
|
|
550111
|
+
if (!Number.isNaN(parsed) && parsed >= 0) {
|
|
550112
|
+
if (thinkingInputMode === "anthropicBudgetTokens") {
|
|
550113
|
+
void applyAnthropicBudgetTokens(parsed);
|
|
550114
|
+
} else {
|
|
550115
|
+
void applyGeminiBudget(parsed);
|
|
550116
|
+
}
|
|
550117
|
+
}
|
|
550118
|
+
setThinkingInputMode(null);
|
|
550119
|
+
setThinkingInputValue("");
|
|
550120
|
+
return;
|
|
550121
|
+
}
|
|
550122
|
+
if (key.backspace || key.delete) {
|
|
550123
|
+
setThinkingInputValue((prev) => prev.slice(0, -1));
|
|
550124
|
+
return;
|
|
550125
|
+
}
|
|
550126
|
+
if (input2 && /[0-9]/.test(input2)) {
|
|
550127
|
+
setThinkingInputValue((prev) => prev + input2);
|
|
550128
|
+
}
|
|
550129
|
+
return;
|
|
550130
|
+
}
|
|
550131
|
+
if (manualInputMode) {
|
|
550132
|
+
if (key.return) {
|
|
550133
|
+
handleManualSave();
|
|
550134
|
+
return;
|
|
550135
|
+
}
|
|
550136
|
+
if (key.backspace || key.delete) {
|
|
550137
|
+
setManualInputValue((prev) => prev.slice(0, -1));
|
|
550138
|
+
return;
|
|
550139
|
+
}
|
|
550140
|
+
if (input2 && /[a-zA-Z0-9-_./:]/.test(input2)) {
|
|
550141
|
+
setManualInputValue((prev) => prev + input2);
|
|
550142
|
+
}
|
|
550143
|
+
return;
|
|
550144
|
+
}
|
|
550145
|
+
if (isSelecting) {
|
|
550146
|
+
if (input2 && /[a-zA-Z0-9-_.]/.test(input2)) {
|
|
550147
|
+
setSearchTerm((prev) => prev + input2);
|
|
550148
|
+
return;
|
|
550149
|
+
}
|
|
550150
|
+
if (key.backspace || key.delete) {
|
|
550151
|
+
setSearchTerm((prev) => prev.slice(0, -1));
|
|
550152
|
+
}
|
|
550153
|
+
return;
|
|
550154
|
+
}
|
|
550155
|
+
if (isThinkingEffortSelecting) {
|
|
550156
|
+
return;
|
|
550157
|
+
}
|
|
550158
|
+
if (key.tab) {
|
|
550159
|
+
setActiveTab((prev) => prev === "advanced" ? "basic" : prev === "basic" ? "thinking" : "advanced");
|
|
550160
|
+
return;
|
|
550161
|
+
}
|
|
550162
|
+
if (activeTab === "thinking") {
|
|
550163
|
+
if (key.upArrow) {
|
|
550164
|
+
setThinkingFocusIndex((prev) => prev === 0 ? 2 : prev - 1);
|
|
550165
|
+
return;
|
|
550166
|
+
}
|
|
550167
|
+
if (key.downArrow) {
|
|
550168
|
+
setThinkingFocusIndex((prev) => prev === 2 ? 0 : prev + 1);
|
|
550169
|
+
return;
|
|
550170
|
+
}
|
|
550171
|
+
if (key.return) {
|
|
550172
|
+
if (thinkingFocusIndex === 0) {
|
|
550173
|
+
void applyShowThinking(!showThinking);
|
|
550174
|
+
} else if (thinkingFocusIndex === 1) {
|
|
550175
|
+
void applyThinkingEnabled(!thinkingEnabledValue);
|
|
550176
|
+
} else if (thinkingFocusIndex === 2) {
|
|
550177
|
+
if (requestMethod === "anthropic") {
|
|
550178
|
+
setThinkingInputMode("anthropicBudgetTokens");
|
|
550179
|
+
setThinkingInputValue(thinkingBudgetTokens.toString());
|
|
550180
|
+
} else if (requestMethod === "gemini") {
|
|
550181
|
+
setThinkingInputMode("geminiThinkingBudget");
|
|
550182
|
+
setThinkingInputValue(geminiThinkingBudget.toString());
|
|
550183
|
+
} else if (requestMethod === "responses") {
|
|
550184
|
+
setIsThinkingEffortSelecting(true);
|
|
550185
|
+
} else {
|
|
550186
|
+
setErrorMessage(t.modelsPanel.requestMethodNotSupportedForThinkingStrength.replace("{requestMethod}", requestMethod));
|
|
550187
|
+
}
|
|
550188
|
+
}
|
|
550189
|
+
return;
|
|
550190
|
+
}
|
|
550191
|
+
return;
|
|
550192
|
+
}
|
|
550193
|
+
if (key.return) {
|
|
550194
|
+
setErrorMessage("");
|
|
550195
|
+
setHasStartedLoading(true);
|
|
550196
|
+
void loadModels().then(() => setIsSelecting(true)).catch(() => {
|
|
550197
|
+
setManualInputMode(true);
|
|
550198
|
+
setManualInputValue(currentModel);
|
|
550199
|
+
});
|
|
550200
|
+
return;
|
|
550201
|
+
}
|
|
550202
|
+
if ((input2 === "m" || input2 === "M") && isModelTab) {
|
|
550203
|
+
setManualInputMode(true);
|
|
550204
|
+
setManualInputValue(currentModel);
|
|
550205
|
+
}
|
|
550206
|
+
}, { isActive: visible });
|
|
550207
|
+
if (!visible) {
|
|
550208
|
+
return null;
|
|
550209
|
+
}
|
|
550210
|
+
return import_react122.default.createElement(
|
|
550211
|
+
Box_default,
|
|
550212
|
+
{ flexDirection: "column", paddingX: 1, paddingY: 0 },
|
|
550213
|
+
import_react122.default.createElement(
|
|
550214
|
+
Box_default,
|
|
550215
|
+
{ marginBottom: 1 },
|
|
550216
|
+
import_react122.default.createElement(Text, { bold: true, color: theme14.colors.warning }, t.modelsPanel.title),
|
|
550217
|
+
import_react122.default.createElement(Text, { dimColor: true }, " - "),
|
|
550218
|
+
import_react122.default.createElement(Text, { color: theme14.colors.menuInfo }, t.modelsPanel.subtitle)
|
|
550219
|
+
),
|
|
550220
|
+
import_react122.default.createElement(
|
|
550221
|
+
Box_default,
|
|
550222
|
+
{ marginBottom: 1 },
|
|
550223
|
+
import_react122.default.createElement(Text, { bold: activeTab === "advanced", color: activeTab === "advanced" ? theme14.colors.menuNormal : theme14.colors.menuSecondary, backgroundColor: activeTab === "advanced" ? tabActiveBackground : void 0 }, t.modelsPanel.tabAdvanced),
|
|
550224
|
+
import_react122.default.createElement(Text, null, " "),
|
|
550225
|
+
import_react122.default.createElement(Text, { bold: activeTab === "basic", color: activeTab === "basic" ? theme14.colors.menuNormal : theme14.colors.menuSecondary, backgroundColor: activeTab === "basic" ? tabActiveBackground : void 0 }, t.modelsPanel.tabBasic),
|
|
550226
|
+
import_react122.default.createElement(Text, null, " "),
|
|
550227
|
+
import_react122.default.createElement(Text, { bold: activeTab === "thinking", color: activeTab === "thinking" ? theme14.colors.menuNormal : theme14.colors.menuSecondary, backgroundColor: activeTab === "thinking" ? tabActiveBackground : void 0 }, t.modelsPanel.tabThinking)
|
|
550228
|
+
),
|
|
550229
|
+
loading && activeTab !== "thinking" && import_react122.default.createElement(
|
|
550230
|
+
Box_default,
|
|
550231
|
+
null,
|
|
550232
|
+
import_react122.default.createElement(build_default, { type: "dots" }),
|
|
550233
|
+
import_react122.default.createElement(
|
|
550234
|
+
Text,
|
|
550235
|
+
{ color: theme14.colors.menuInfo },
|
|
550236
|
+
" ",
|
|
550237
|
+
t.modelsPanel.loadingModels
|
|
550238
|
+
)
|
|
550239
|
+
),
|
|
550240
|
+
errorMessage && !loading && import_react122.default.createElement(
|
|
550241
|
+
Box_default,
|
|
550242
|
+
{ flexDirection: "column" },
|
|
550243
|
+
import_react122.default.createElement(Text, { color: theme14.colors.warning }, t.modelsPanel.tipLabel),
|
|
550244
|
+
import_react122.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, errorMessage)
|
|
550245
|
+
),
|
|
550246
|
+
activeTab === "thinking" ? import_react122.default.createElement(
|
|
550247
|
+
Box_default,
|
|
550248
|
+
{ flexDirection: "column", paddingX: 1, paddingY: 0 },
|
|
550249
|
+
import_react122.default.createElement(
|
|
550250
|
+
Box_default,
|
|
550251
|
+
null,
|
|
550252
|
+
import_react122.default.createElement(Text, { color: theme14.colors.menuInfo }, t.modelsPanel.requestMethod),
|
|
550253
|
+
import_react122.default.createElement(
|
|
550254
|
+
Text,
|
|
550255
|
+
{ color: theme14.colors.menuSelected },
|
|
550256
|
+
" ",
|
|
550257
|
+
requestMethod
|
|
550258
|
+
)
|
|
550259
|
+
),
|
|
550260
|
+
import_react122.default.createElement(
|
|
550261
|
+
Box_default,
|
|
550262
|
+
{ marginTop: 1 },
|
|
550263
|
+
import_react122.default.createElement(
|
|
550264
|
+
Text,
|
|
550265
|
+
{ color: thinkingFocusIndex === 0 ? theme14.colors.menuSelected : theme14.colors.menuNormal },
|
|
550266
|
+
thinkingFocusIndex === 0 ? "\u276F " : " ",
|
|
550267
|
+
t.modelsPanel.showThinkingProcess
|
|
550268
|
+
),
|
|
550269
|
+
import_react122.default.createElement(
|
|
550270
|
+
Text,
|
|
550271
|
+
{ color: theme14.colors.menuSelected },
|
|
550272
|
+
" ",
|
|
550273
|
+
showThinking ? "[\u2713]" : "[ ]"
|
|
550274
|
+
)
|
|
550275
|
+
),
|
|
550276
|
+
import_react122.default.createElement(
|
|
550277
|
+
Box_default,
|
|
550278
|
+
null,
|
|
550279
|
+
import_react122.default.createElement(
|
|
550280
|
+
Text,
|
|
550281
|
+
{ color: thinkingFocusIndex === 1 ? theme14.colors.menuSelected : theme14.colors.menuNormal },
|
|
550282
|
+
thinkingFocusIndex === 1 ? "\u276F " : " ",
|
|
550283
|
+
t.modelsPanel.enableThinking
|
|
550284
|
+
),
|
|
550285
|
+
import_react122.default.createElement(
|
|
550286
|
+
Text,
|
|
550287
|
+
{ color: theme14.colors.menuSelected },
|
|
550288
|
+
" ",
|
|
550289
|
+
thinkingEnabledValue ? "[\u2713]" : "[ ]"
|
|
550290
|
+
)
|
|
550291
|
+
),
|
|
550292
|
+
import_react122.default.createElement(
|
|
550293
|
+
Box_default,
|
|
550294
|
+
null,
|
|
550295
|
+
import_react122.default.createElement(
|
|
550296
|
+
Text,
|
|
550297
|
+
{ color: thinkingFocusIndex === 2 ? theme14.colors.menuSelected : theme14.colors.menuNormal },
|
|
550298
|
+
thinkingFocusIndex === 2 ? "\u276F " : " ",
|
|
550299
|
+
t.modelsPanel.thinkingStrength
|
|
550300
|
+
),
|
|
550301
|
+
import_react122.default.createElement(
|
|
550302
|
+
Text,
|
|
550303
|
+
{ color: theme14.colors.menuSelected },
|
|
550304
|
+
" ",
|
|
550305
|
+
thinkingStrengthValue
|
|
550306
|
+
)
|
|
550307
|
+
),
|
|
550308
|
+
thinkingInputMode && import_react122.default.createElement(
|
|
550309
|
+
Box_default,
|
|
550310
|
+
{ flexDirection: "column", marginTop: 1 },
|
|
550311
|
+
import_react122.default.createElement(Text, { color: theme14.colors.menuInfo }, t.modelsPanel.inputNumberHint),
|
|
550312
|
+
import_react122.default.createElement(
|
|
550313
|
+
Box_default,
|
|
550314
|
+
{ marginLeft: 1 },
|
|
550315
|
+
import_react122.default.createElement(
|
|
550316
|
+
Text,
|
|
550317
|
+
{ color: theme14.colors.menuSelected },
|
|
550318
|
+
`\u276F ${thinkingInputValue}`,
|
|
550319
|
+
import_react122.default.createElement(Text, { color: theme14.colors.menuNormal }, "_")
|
|
550320
|
+
)
|
|
550321
|
+
),
|
|
550322
|
+
import_react122.default.createElement(
|
|
550323
|
+
Box_default,
|
|
550324
|
+
null,
|
|
550325
|
+
import_react122.default.createElement(Text, { dimColor: true, color: theme14.colors.menuSecondary }, t.modelsPanel.escCancel)
|
|
550326
|
+
)
|
|
550327
|
+
),
|
|
550328
|
+
isThinkingEffortSelecting && import_react122.default.createElement(
|
|
550329
|
+
Box_default,
|
|
550330
|
+
{ marginTop: 1 },
|
|
550331
|
+
import_react122.default.createElement(ScrollableSelectInput, { items: [
|
|
550332
|
+
{ label: "low", value: "low" },
|
|
550333
|
+
{ label: "medium", value: "medium" },
|
|
550334
|
+
{ label: "high", value: "high" },
|
|
550335
|
+
{ label: "xhigh", value: "xhigh" }
|
|
550336
|
+
].map((i) => ({
|
|
550337
|
+
label: i.label,
|
|
550338
|
+
value: i.value
|
|
550339
|
+
})), limit: 6, disableNumberShortcuts: true, initialIndex: Math.max(0, ["low", "medium", "high", "xhigh"].indexOf(responsesReasoningEffort)), isFocused: true, onSelect: (item) => {
|
|
550340
|
+
void applyResponsesEffort(item.value);
|
|
550341
|
+
setIsThinkingEffortSelecting(false);
|
|
550342
|
+
} })
|
|
550343
|
+
),
|
|
550344
|
+
!thinkingInputMode && !isThinkingEffortSelecting && import_react122.default.createElement(
|
|
550345
|
+
Box_default,
|
|
550346
|
+
{ marginTop: 1 },
|
|
550347
|
+
import_react122.default.createElement(Text, { dimColor: true, color: theme14.colors.menuSecondary }, t.modelsPanel.navigationHint)
|
|
550348
|
+
)
|
|
550349
|
+
) : manualInputMode ? import_react122.default.createElement(
|
|
550350
|
+
Box_default,
|
|
550351
|
+
{ flexDirection: "column", paddingX: 1, paddingY: 0 },
|
|
550352
|
+
import_react122.default.createElement(
|
|
550353
|
+
Text,
|
|
550354
|
+
{ color: theme14.colors.menuInfo },
|
|
550355
|
+
t.modelsPanel.manualInputTitle,
|
|
550356
|
+
currentLabel
|
|
550357
|
+
),
|
|
550358
|
+
import_react122.default.createElement(
|
|
550359
|
+
Box_default,
|
|
550360
|
+
{ marginLeft: 1 },
|
|
550361
|
+
import_react122.default.createElement(
|
|
550362
|
+
Text,
|
|
550363
|
+
{ color: theme14.colors.menuSelected },
|
|
550364
|
+
`\u276F ${manualInputValue}`,
|
|
550365
|
+
import_react122.default.createElement(Text, { color: theme14.colors.menuNormal }, "_")
|
|
550366
|
+
)
|
|
550367
|
+
),
|
|
550368
|
+
import_react122.default.createElement(
|
|
550369
|
+
Box_default,
|
|
550370
|
+
null,
|
|
550371
|
+
import_react122.default.createElement(Text, { dimColor: true, color: theme14.colors.menuSecondary }, t.modelsPanel.manualInputHint)
|
|
550372
|
+
)
|
|
550373
|
+
) : isSelecting ? import_react122.default.createElement(
|
|
550374
|
+
Box_default,
|
|
550375
|
+
{ flexDirection: "column", paddingX: 1, paddingY: 0 },
|
|
550376
|
+
searchTerm && import_react122.default.createElement(
|
|
550377
|
+
Text,
|
|
550378
|
+
{ color: theme14.colors.menuInfo },
|
|
550379
|
+
t.modelsPanel.filterLabel,
|
|
550380
|
+
" ",
|
|
550381
|
+
searchTerm
|
|
550382
|
+
),
|
|
550383
|
+
import_react122.default.createElement(ScrollableSelectInput, { items: currentOptions, limit: 10, disableNumberShortcuts: true, initialIndex: selectedIndex, isFocused: true, onSelect: (item) => handleModelSelect(item.value) })
|
|
550384
|
+
) : import_react122.default.createElement(
|
|
550385
|
+
Box_default,
|
|
550386
|
+
{ flexDirection: "column", paddingX: 1, paddingY: 0 },
|
|
550387
|
+
import_react122.default.createElement(
|
|
550388
|
+
Box_default,
|
|
550389
|
+
null,
|
|
550390
|
+
import_react122.default.createElement(Text, { color: theme14.colors.menuInfo }, t.modelsPanel.currentModel),
|
|
550391
|
+
import_react122.default.createElement(
|
|
550392
|
+
Text,
|
|
550393
|
+
{ color: theme14.colors.menuSelected },
|
|
550394
|
+
" ",
|
|
550395
|
+
currentModel || t.modelsPanel.notSet
|
|
550396
|
+
)
|
|
550397
|
+
),
|
|
550398
|
+
import_react122.default.createElement(
|
|
550399
|
+
Box_default,
|
|
550400
|
+
null,
|
|
550401
|
+
import_react122.default.createElement(Text, { dimColor: true, color: theme14.colors.menuSecondary }, t.modelsPanel.hint)
|
|
550402
|
+
)
|
|
550403
|
+
)
|
|
550404
|
+
);
|
|
550405
|
+
};
|
|
550406
|
+
}
|
|
550407
|
+
});
|
|
550408
|
+
|
|
549575
550409
|
// dist/ui/components/panels/WorkingDirectoryPanel.js
|
|
549576
550410
|
function WorkingDirectoryPanel({ onClose }) {
|
|
549577
550411
|
const { t } = useI18n();
|
|
549578
550412
|
const { theme: theme14 } = useTheme();
|
|
549579
|
-
const [directories, setDirectories] = (0,
|
|
549580
|
-
const [loading, setLoading] = (0,
|
|
549581
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
549582
|
-
const [markedDirs, setMarkedDirs] = (0,
|
|
549583
|
-
const [confirmDelete, setConfirmDelete] = (0,
|
|
549584
|
-
const [addingMode, setAddingMode] = (0,
|
|
549585
|
-
const [newDirPath, setNewDirPath] = (0,
|
|
549586
|
-
const [addError, setAddError] = (0,
|
|
549587
|
-
const [showDefaultAlert, setShowDefaultAlert] = (0,
|
|
549588
|
-
const [sshMode, setSSHMode] = (0,
|
|
549589
|
-
const [sshForm, setSSHForm] = (0,
|
|
550413
|
+
const [directories, setDirectories] = (0, import_react123.useState)([]);
|
|
550414
|
+
const [loading, setLoading] = (0, import_react123.useState)(true);
|
|
550415
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react123.useState)(0);
|
|
550416
|
+
const [markedDirs, setMarkedDirs] = (0, import_react123.useState)(/* @__PURE__ */ new Set());
|
|
550417
|
+
const [confirmDelete, setConfirmDelete] = (0, import_react123.useState)(false);
|
|
550418
|
+
const [addingMode, setAddingMode] = (0, import_react123.useState)(false);
|
|
550419
|
+
const [newDirPath, setNewDirPath] = (0, import_react123.useState)("");
|
|
550420
|
+
const [addError, setAddError] = (0, import_react123.useState)(null);
|
|
550421
|
+
const [showDefaultAlert, setShowDefaultAlert] = (0, import_react123.useState)(false);
|
|
550422
|
+
const [sshMode, setSSHMode] = (0, import_react123.useState)(false);
|
|
550423
|
+
const [sshForm, setSSHForm] = (0, import_react123.useState)({
|
|
549590
550424
|
host: "",
|
|
549591
550425
|
port: "22",
|
|
549592
550426
|
username: "",
|
|
@@ -549595,11 +550429,11 @@ function WorkingDirectoryPanel({ onClose }) {
|
|
|
549595
550429
|
privateKeyPath: "~/.ssh/id_rsa",
|
|
549596
550430
|
remotePath: "/home"
|
|
549597
550431
|
});
|
|
549598
|
-
const [sshActiveField, setSSHActiveField] = (0,
|
|
549599
|
-
const [sshConnecting, setSSHConnecting] = (0,
|
|
549600
|
-
const [sshMessage, setSSHMessage] = (0,
|
|
549601
|
-
const sshFormRef = (0,
|
|
549602
|
-
(0,
|
|
550432
|
+
const [sshActiveField, setSSHActiveField] = (0, import_react123.useState)("host");
|
|
550433
|
+
const [sshConnecting, setSSHConnecting] = (0, import_react123.useState)(false);
|
|
550434
|
+
const [sshMessage, setSSHMessage] = (0, import_react123.useState)(null);
|
|
550435
|
+
const sshFormRef = (0, import_react123.useRef)(sshForm);
|
|
550436
|
+
(0, import_react123.useEffect)(() => {
|
|
549603
550437
|
const loadDirs = async () => {
|
|
549604
550438
|
setLoading(true);
|
|
549605
550439
|
try {
|
|
@@ -549614,7 +550448,7 @@ function WorkingDirectoryPanel({ onClose }) {
|
|
|
549614
550448
|
};
|
|
549615
550449
|
void loadDirs();
|
|
549616
550450
|
}, []);
|
|
549617
|
-
(0,
|
|
550451
|
+
(0, import_react123.useEffect)(() => {
|
|
549618
550452
|
if (showDefaultAlert) {
|
|
549619
550453
|
const timer2 = setTimeout(() => {
|
|
549620
550454
|
setShowDefaultAlert(false);
|
|
@@ -549623,7 +550457,7 @@ function WorkingDirectoryPanel({ onClose }) {
|
|
|
549623
550457
|
}
|
|
549624
550458
|
return void 0;
|
|
549625
550459
|
}, [showDefaultAlert]);
|
|
549626
|
-
use_input_default((0,
|
|
550460
|
+
use_input_default((0, import_react123.useCallback)((input2, key) => {
|
|
549627
550461
|
if (addingMode) {
|
|
549628
550462
|
if (key.escape) {
|
|
549629
550463
|
setAddingMode(false);
|
|
@@ -549858,36 +550692,36 @@ function WorkingDirectoryPanel({ onClose }) {
|
|
|
549858
550692
|
sshFormRef.current = newForm;
|
|
549859
550693
|
};
|
|
549860
550694
|
if (sshMode) {
|
|
549861
|
-
return
|
|
550695
|
+
return import_react123.default.createElement(
|
|
549862
550696
|
Box_default,
|
|
549863
550697
|
{ flexDirection: "column", padding: 1, borderStyle: "round", borderColor: theme14.colors.border },
|
|
549864
|
-
|
|
549865
|
-
|
|
550698
|
+
import_react123.default.createElement(Text, { color: theme14.colors.menuSelected, bold: true }, t.workingDirectoryPanel.sshTitle),
|
|
550699
|
+
import_react123.default.createElement(
|
|
549866
550700
|
Box_default,
|
|
549867
550701
|
{ marginTop: 1, flexDirection: "column" },
|
|
549868
|
-
|
|
550702
|
+
import_react123.default.createElement(
|
|
549869
550703
|
Box_default,
|
|
549870
550704
|
null,
|
|
549871
|
-
|
|
549872
|
-
|
|
550705
|
+
import_react123.default.createElement(Text, { color: sshActiveField === "host" ? theme14.colors.menuSelected : theme14.colors.text }, t.workingDirectoryPanel.sshHostLabel),
|
|
550706
|
+
import_react123.default.createElement(build_default2, { value: sshForm.host, onChange: (v) => handleSSHFieldChange("host", v), onSubmit: handleSSHSubmit, focus: sshActiveField === "host" })
|
|
549873
550707
|
),
|
|
549874
|
-
|
|
550708
|
+
import_react123.default.createElement(
|
|
549875
550709
|
Box_default,
|
|
549876
550710
|
null,
|
|
549877
|
-
|
|
549878
|
-
|
|
550711
|
+
import_react123.default.createElement(Text, { color: sshActiveField === "port" ? theme14.colors.menuSelected : theme14.colors.text }, t.workingDirectoryPanel.sshPortLabel),
|
|
550712
|
+
import_react123.default.createElement(build_default2, { value: sshForm.port, onChange: (v) => handleSSHFieldChange("port", v), onSubmit: handleSSHSubmit, focus: sshActiveField === "port" })
|
|
549879
550713
|
),
|
|
549880
|
-
|
|
550714
|
+
import_react123.default.createElement(
|
|
549881
550715
|
Box_default,
|
|
549882
550716
|
null,
|
|
549883
|
-
|
|
549884
|
-
|
|
550717
|
+
import_react123.default.createElement(Text, { color: sshActiveField === "username" ? theme14.colors.menuSelected : theme14.colors.text }, t.workingDirectoryPanel.sshUsernameLabel),
|
|
550718
|
+
import_react123.default.createElement(build_default2, { value: sshForm.username, onChange: (v) => handleSSHFieldChange("username", v), onSubmit: handleSSHSubmit, focus: sshActiveField === "username" })
|
|
549885
550719
|
),
|
|
549886
|
-
|
|
550720
|
+
import_react123.default.createElement(
|
|
549887
550721
|
Box_default,
|
|
549888
550722
|
null,
|
|
549889
|
-
|
|
549890
|
-
|
|
550723
|
+
import_react123.default.createElement(Text, { color: sshActiveField === "authMethod" ? theme14.colors.menuSelected : theme14.colors.text }, t.workingDirectoryPanel.sshAuthMethodLabel),
|
|
550724
|
+
import_react123.default.createElement(
|
|
549891
550725
|
Text,
|
|
549892
550726
|
{ color: sshActiveField === "authMethod" ? theme14.colors.menuSelected : theme14.colors.text, bold: sshActiveField === "authMethod" },
|
|
549893
550727
|
sshActiveField === "authMethod" ? "< " : "",
|
|
@@ -549895,144 +550729,144 @@ function WorkingDirectoryPanel({ onClose }) {
|
|
|
549895
550729
|
sshActiveField === "authMethod" ? " >" : ""
|
|
549896
550730
|
)
|
|
549897
550731
|
),
|
|
549898
|
-
sshForm.authMethod === "password" &&
|
|
550732
|
+
sshForm.authMethod === "password" && import_react123.default.createElement(
|
|
549899
550733
|
Box_default,
|
|
549900
550734
|
null,
|
|
549901
|
-
|
|
549902
|
-
|
|
550735
|
+
import_react123.default.createElement(Text, { color: sshActiveField === "password" ? theme14.colors.menuSelected : theme14.colors.text }, t.workingDirectoryPanel.sshPasswordLabel),
|
|
550736
|
+
import_react123.default.createElement(build_default2, { value: sshForm.password, onChange: (v) => handleSSHFieldChange("password", v), onSubmit: handleSSHSubmit, mask: "*", focus: sshActiveField === "password" })
|
|
549903
550737
|
),
|
|
549904
|
-
sshForm.authMethod === "privateKey" &&
|
|
550738
|
+
sshForm.authMethod === "privateKey" && import_react123.default.createElement(
|
|
549905
550739
|
Box_default,
|
|
549906
550740
|
null,
|
|
549907
|
-
|
|
549908
|
-
|
|
550741
|
+
import_react123.default.createElement(Text, { color: sshActiveField === "privateKeyPath" ? theme14.colors.menuSelected : theme14.colors.text }, t.workingDirectoryPanel.sshPrivateKeyLabel),
|
|
550742
|
+
import_react123.default.createElement(build_default2, { value: sshForm.privateKeyPath, onChange: (v) => handleSSHFieldChange("privateKeyPath", v), onSubmit: handleSSHSubmit, focus: sshActiveField === "privateKeyPath" })
|
|
549909
550743
|
),
|
|
549910
|
-
|
|
550744
|
+
import_react123.default.createElement(
|
|
549911
550745
|
Box_default,
|
|
549912
550746
|
null,
|
|
549913
|
-
|
|
549914
|
-
|
|
550747
|
+
import_react123.default.createElement(Text, { color: sshActiveField === "remotePath" ? theme14.colors.menuSelected : theme14.colors.text }, t.workingDirectoryPanel.sshRemotePathLabel),
|
|
550748
|
+
import_react123.default.createElement(build_default2, { value: sshForm.remotePath, onChange: (v) => handleSSHFieldChange("remotePath", v), onSubmit: handleSSHSubmit, focus: sshActiveField === "remotePath" })
|
|
549915
550749
|
)
|
|
549916
550750
|
),
|
|
549917
|
-
sshConnecting &&
|
|
550751
|
+
sshConnecting && import_react123.default.createElement(
|
|
549918
550752
|
Box_default,
|
|
549919
550753
|
{ marginTop: 1 },
|
|
549920
|
-
|
|
550754
|
+
import_react123.default.createElement(Text, { color: theme14.colors.warning }, t.workingDirectoryPanel.sshConnecting)
|
|
549921
550755
|
),
|
|
549922
|
-
sshMessage &&
|
|
550756
|
+
sshMessage && import_react123.default.createElement(
|
|
549923
550757
|
Box_default,
|
|
549924
550758
|
{ marginTop: 1 },
|
|
549925
|
-
|
|
550759
|
+
import_react123.default.createElement(Alert, { variant: sshMessage.type === "success" ? "success" : "error" }, sshMessage.text)
|
|
549926
550760
|
),
|
|
549927
|
-
|
|
550761
|
+
import_react123.default.createElement(
|
|
549928
550762
|
Box_default,
|
|
549929
550763
|
{ marginTop: 1 },
|
|
549930
|
-
|
|
550764
|
+
import_react123.default.createElement(Text, { dimColor: true }, t.workingDirectoryPanel.sshHint)
|
|
549931
550765
|
)
|
|
549932
550766
|
);
|
|
549933
550767
|
}
|
|
549934
550768
|
if (addingMode) {
|
|
549935
|
-
return
|
|
550769
|
+
return import_react123.default.createElement(
|
|
549936
550770
|
Box_default,
|
|
549937
550771
|
{ flexDirection: "column", padding: 1, borderStyle: "round", borderColor: theme14.colors.border },
|
|
549938
|
-
|
|
549939
|
-
|
|
550772
|
+
import_react123.default.createElement(Text, { color: theme14.colors.menuSelected, bold: true }, t.workingDirectoryPanel.addTitle),
|
|
550773
|
+
import_react123.default.createElement(
|
|
549940
550774
|
Box_default,
|
|
549941
550775
|
{ marginTop: 1, flexDirection: "column" },
|
|
549942
|
-
|
|
549943
|
-
|
|
550776
|
+
import_react123.default.createElement(Text, { color: theme14.colors.text }, t.workingDirectoryPanel.addPathPrompt),
|
|
550777
|
+
import_react123.default.createElement(
|
|
549944
550778
|
Box_default,
|
|
549945
550779
|
{ marginTop: 1 },
|
|
549946
|
-
|
|
549947
|
-
|
|
550780
|
+
import_react123.default.createElement(Text, { color: theme14.colors.menuSelected }, t.workingDirectoryPanel.addPathLabel),
|
|
550781
|
+
import_react123.default.createElement(build_default2, { value: newDirPath, onChange: setNewDirPath, onSubmit: handleAddSubmit })
|
|
549948
550782
|
),
|
|
549949
|
-
addError &&
|
|
550783
|
+
addError && import_react123.default.createElement(
|
|
549950
550784
|
Box_default,
|
|
549951
550785
|
{ marginTop: 1 },
|
|
549952
|
-
|
|
550786
|
+
import_react123.default.createElement(Text, { color: theme14.colors.error }, addError)
|
|
549953
550787
|
)
|
|
549954
550788
|
),
|
|
549955
|
-
|
|
550789
|
+
import_react123.default.createElement(
|
|
549956
550790
|
Box_default,
|
|
549957
550791
|
{ marginTop: 1 },
|
|
549958
|
-
|
|
550792
|
+
import_react123.default.createElement(Text, { dimColor: true }, t.workingDirectoryPanel.addHint)
|
|
549959
550793
|
)
|
|
549960
550794
|
);
|
|
549961
550795
|
}
|
|
549962
550796
|
if (loading) {
|
|
549963
|
-
return
|
|
550797
|
+
return import_react123.default.createElement(
|
|
549964
550798
|
Box_default,
|
|
549965
550799
|
{ flexDirection: "column", padding: 1, borderStyle: "round", borderColor: theme14.colors.border },
|
|
549966
|
-
|
|
549967
|
-
|
|
550800
|
+
import_react123.default.createElement(Text, { color: theme14.colors.menuSelected, bold: true }, t.workingDirectoryPanel.title),
|
|
550801
|
+
import_react123.default.createElement(Text, { color: theme14.colors.text }, t.workingDirectoryPanel.loading)
|
|
549968
550802
|
);
|
|
549969
550803
|
}
|
|
549970
550804
|
if (confirmDelete) {
|
|
549971
550805
|
const deleteMessage = markedDirs.size > 1 ? t.workingDirectoryPanel.confirmDeleteMessagePlural.replace("{count}", markedDirs.size.toString()) : t.workingDirectoryPanel.confirmDeleteMessage.replace("{count}", markedDirs.size.toString());
|
|
549972
|
-
return
|
|
550806
|
+
return import_react123.default.createElement(
|
|
549973
550807
|
Box_default,
|
|
549974
550808
|
{ flexDirection: "column", padding: 1, borderStyle: "round", borderColor: theme14.colors.border },
|
|
549975
|
-
|
|
549976
|
-
|
|
549977
|
-
|
|
550809
|
+
import_react123.default.createElement(Text, { color: theme14.colors.menuSelected, bold: true }, t.workingDirectoryPanel.confirmDeleteTitle),
|
|
550810
|
+
import_react123.default.createElement(Text, { color: theme14.colors.text }, deleteMessage),
|
|
550811
|
+
import_react123.default.createElement(Box_default, { marginTop: 1 }, Array.from(markedDirs).map((dirPath) => import_react123.default.createElement(
|
|
549978
550812
|
Text,
|
|
549979
550813
|
{ key: dirPath, color: theme14.colors.error },
|
|
549980
550814
|
"- ",
|
|
549981
550815
|
dirPath
|
|
549982
550816
|
))),
|
|
549983
|
-
|
|
550817
|
+
import_react123.default.createElement(
|
|
549984
550818
|
Box_default,
|
|
549985
550819
|
{ marginTop: 1 },
|
|
549986
|
-
|
|
550820
|
+
import_react123.default.createElement(Text, { color: theme14.colors.text }, t.workingDirectoryPanel.confirmHint)
|
|
549987
550821
|
)
|
|
549988
550822
|
);
|
|
549989
550823
|
}
|
|
549990
|
-
return
|
|
550824
|
+
return import_react123.default.createElement(
|
|
549991
550825
|
Box_default,
|
|
549992
550826
|
{ flexDirection: "column", padding: 1, borderStyle: "round", borderColor: theme14.colors.border },
|
|
549993
|
-
|
|
549994
|
-
directories.length === 0 ?
|
|
550827
|
+
import_react123.default.createElement(Text, { color: theme14.colors.menuSelected, bold: true }, t.workingDirectoryPanel.title),
|
|
550828
|
+
directories.length === 0 ? import_react123.default.createElement(Text, { dimColor: true }, t.workingDirectoryPanel.noDirectories) : import_react123.default.createElement(Box_default, { flexDirection: "column", marginTop: 1 }, directories.map((dir, index) => {
|
|
549995
550829
|
const isSelected = index === selectedIndex;
|
|
549996
550830
|
const isMarked = markedDirs.has(dir.path);
|
|
549997
|
-
return
|
|
550831
|
+
return import_react123.default.createElement(
|
|
549998
550832
|
Box_default,
|
|
549999
550833
|
{ key: dir.path },
|
|
550000
|
-
|
|
550001
|
-
|
|
550834
|
+
import_react123.default.createElement(Text, { color: isSelected ? theme14.colors.menuSelected : theme14.colors.text, bold: isSelected }, isSelected ? "> " : " "),
|
|
550835
|
+
import_react123.default.createElement(
|
|
550002
550836
|
Text,
|
|
550003
550837
|
{ color: isMarked ? theme14.colors.warning : isSelected ? theme14.colors.menuSelected : theme14.colors.text },
|
|
550004
550838
|
"[",
|
|
550005
550839
|
isMarked ? "x" : " ",
|
|
550006
550840
|
"]"
|
|
550007
550841
|
),
|
|
550008
|
-
|
|
550009
|
-
dir.isDefault &&
|
|
550842
|
+
import_react123.default.createElement(Text, { color: isSelected ? theme14.colors.menuSelected : theme14.colors.text }, " "),
|
|
550843
|
+
dir.isDefault && import_react123.default.createElement(
|
|
550010
550844
|
Text,
|
|
550011
550845
|
{ color: theme14.colors.success, bold: true },
|
|
550012
550846
|
t.workingDirectoryPanel.defaultLabel,
|
|
550013
550847
|
" "
|
|
550014
550848
|
),
|
|
550015
|
-
|
|
550849
|
+
import_react123.default.createElement(Text, { color: isSelected ? theme14.colors.menuSelected : theme14.colors.text }, dir.path)
|
|
550016
550850
|
);
|
|
550017
550851
|
})),
|
|
550018
|
-
|
|
550852
|
+
import_react123.default.createElement(
|
|
550019
550853
|
Box_default,
|
|
550020
550854
|
{ marginTop: 1, flexDirection: "column" },
|
|
550021
|
-
|
|
550022
|
-
markedDirs.size > 0 &&
|
|
550023
|
-
showDefaultAlert &&
|
|
550855
|
+
import_react123.default.createElement(Text, { dimColor: true }, t.workingDirectoryPanel.navigationHint),
|
|
550856
|
+
markedDirs.size > 0 && import_react123.default.createElement(Text, { color: theme14.colors.warning }, t.workingDirectoryPanel.markedCount.replace("{count}", markedDirs.size.toString()).replace("{plural}", markedDirs.size > 1 ? t.workingDirectoryPanel.markedCountPlural : t.workingDirectoryPanel.markedCountSingular)),
|
|
550857
|
+
showDefaultAlert && import_react123.default.createElement(
|
|
550024
550858
|
Box_default,
|
|
550025
550859
|
{ marginTop: 1 },
|
|
550026
|
-
|
|
550860
|
+
import_react123.default.createElement(Alert, { variant: "error" }, t.workingDirectoryPanel.alertDefaultCannotDelete)
|
|
550027
550861
|
)
|
|
550028
550862
|
)
|
|
550029
550863
|
);
|
|
550030
550864
|
}
|
|
550031
|
-
var
|
|
550865
|
+
var import_react123;
|
|
550032
550866
|
var init_WorkingDirectoryPanel = __esm({
|
|
550033
550867
|
async "dist/ui/components/panels/WorkingDirectoryPanel.js"() {
|
|
550034
550868
|
"use strict";
|
|
550035
|
-
|
|
550869
|
+
import_react123 = __toESM(require_react(), 1);
|
|
550036
550870
|
await init_build2();
|
|
550037
550871
|
await init_build4();
|
|
550038
550872
|
await init_build5();
|
|
@@ -550050,12 +550884,12 @@ __export(MCPInfoPanel_exports, {
|
|
|
550050
550884
|
});
|
|
550051
550885
|
function MCPInfoPanel() {
|
|
550052
550886
|
const { t } = useI18n();
|
|
550053
|
-
const [mcpStatus, setMcpStatus] = (0,
|
|
550054
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
550055
|
-
const [isLoading, setIsLoading] = (0,
|
|
550056
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
550057
|
-
const [isReconnecting, setIsReconnecting] = (0,
|
|
550058
|
-
const [togglingService, setTogglingService] = (0,
|
|
550887
|
+
const [mcpStatus, setMcpStatus] = (0, import_react124.useState)([]);
|
|
550888
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react124.useState)(0);
|
|
550889
|
+
const [isLoading, setIsLoading] = (0, import_react124.useState)(true);
|
|
550890
|
+
const [errorMessage, setErrorMessage] = (0, import_react124.useState)(null);
|
|
550891
|
+
const [isReconnecting, setIsReconnecting] = (0, import_react124.useState)(false);
|
|
550892
|
+
const [togglingService, setTogglingService] = (0, import_react124.useState)(null);
|
|
550059
550893
|
const loadMCPStatus = async () => {
|
|
550060
550894
|
try {
|
|
550061
550895
|
const servicesInfo = await getMCPServicesInfo();
|
|
@@ -550080,7 +550914,7 @@ function MCPInfoPanel() {
|
|
|
550080
550914
|
setIsLoading(false);
|
|
550081
550915
|
}
|
|
550082
550916
|
};
|
|
550083
|
-
(0,
|
|
550917
|
+
(0, import_react124.useEffect)(() => {
|
|
550084
550918
|
let isMounted = true;
|
|
550085
550919
|
const load = async () => {
|
|
550086
550920
|
await loadMCPStatus();
|
|
@@ -550165,36 +550999,36 @@ function MCPInfoPanel() {
|
|
|
550165
550999
|
}))
|
|
550166
551000
|
];
|
|
550167
551001
|
if (isLoading) {
|
|
550168
|
-
return
|
|
551002
|
+
return import_react124.default.createElement(Text, { color: "gray" }, t.mcpInfoPanel.loading);
|
|
550169
551003
|
}
|
|
550170
551004
|
if (errorMessage) {
|
|
550171
|
-
return
|
|
551005
|
+
return import_react124.default.createElement(
|
|
550172
551006
|
Box_default,
|
|
550173
551007
|
{ borderColor: "red", borderStyle: "round", paddingX: 2, paddingY: 0 },
|
|
550174
|
-
|
|
551008
|
+
import_react124.default.createElement(Text, { color: "red", dimColor: true }, t.mcpInfoPanel.error.replace("{message}", errorMessage))
|
|
550175
551009
|
);
|
|
550176
551010
|
}
|
|
550177
551011
|
if (mcpStatus.length === 0) {
|
|
550178
|
-
return
|
|
551012
|
+
return import_react124.default.createElement(
|
|
550179
551013
|
Box_default,
|
|
550180
551014
|
{ borderColor: "cyan", borderStyle: "round", paddingX: 2, paddingY: 0 },
|
|
550181
|
-
|
|
551015
|
+
import_react124.default.createElement(Text, { color: "gray", dimColor: true }, t.mcpInfoPanel.noServices)
|
|
550182
551016
|
);
|
|
550183
551017
|
}
|
|
550184
|
-
return
|
|
551018
|
+
return import_react124.default.createElement(
|
|
550185
551019
|
Box_default,
|
|
550186
551020
|
{ borderColor: "cyan", borderStyle: "round", paddingX: 2, paddingY: 0 },
|
|
550187
|
-
|
|
551021
|
+
import_react124.default.createElement(
|
|
550188
551022
|
Box_default,
|
|
550189
551023
|
{ flexDirection: "column" },
|
|
550190
|
-
|
|
551024
|
+
import_react124.default.createElement(Text, { color: "cyan", bold: true }, isReconnecting ? t.mcpInfoPanel.refreshing : togglingService ? t.mcpInfoPanel.toggling.replace("{service}", togglingService) : t.mcpInfoPanel.title),
|
|
550191
551025
|
!isReconnecting && !togglingService && selectItems.map((item, index) => {
|
|
550192
551026
|
const isSelected = index === selectedIndex;
|
|
550193
551027
|
if (item.isRefreshAll) {
|
|
550194
|
-
return
|
|
551028
|
+
return import_react124.default.createElement(
|
|
550195
551029
|
Box_default,
|
|
550196
551030
|
{ key: item.value },
|
|
550197
|
-
|
|
551031
|
+
import_react124.default.createElement(
|
|
550198
551032
|
Text,
|
|
550199
551033
|
{ color: isSelected ? "cyan" : "blue" },
|
|
550200
551034
|
isSelected ? "\u276F " : " ",
|
|
@@ -550206,29 +551040,29 @@ function MCPInfoPanel() {
|
|
|
550206
551040
|
const isEnabled = item.enabled !== false;
|
|
550207
551041
|
const statusColor = !isEnabled ? "gray" : item.connected ? "green" : "red";
|
|
550208
551042
|
const suffix = item.isBuiltIn ? t.mcpInfoPanel.statusSystem : !isEnabled ? t.mcpInfoPanel.statusDisabled : item.connected ? t.mcpInfoPanel.statusExternal : ` - ${item.error || t.mcpInfoPanel.statusFailed}`;
|
|
550209
|
-
return
|
|
551043
|
+
return import_react124.default.createElement(
|
|
550210
551044
|
Box_default,
|
|
550211
551045
|
{ key: item.value },
|
|
550212
|
-
|
|
551046
|
+
import_react124.default.createElement(
|
|
550213
551047
|
Text,
|
|
550214
551048
|
null,
|
|
550215
551049
|
isSelected ? "\u276F " : " ",
|
|
550216
|
-
|
|
550217
|
-
|
|
550218
|
-
|
|
551050
|
+
import_react124.default.createElement(Text, { color: statusColor }, "\u25CF "),
|
|
551051
|
+
import_react124.default.createElement(Text, { color: isSelected ? "cyan" : !isEnabled ? "gray" : "white" }, item.label),
|
|
551052
|
+
import_react124.default.createElement(Text, { color: "gray", dimColor: true }, suffix)
|
|
550219
551053
|
)
|
|
550220
551054
|
);
|
|
550221
551055
|
}),
|
|
550222
|
-
(isReconnecting || togglingService) &&
|
|
550223
|
-
!isReconnecting && !togglingService &&
|
|
551056
|
+
(isReconnecting || togglingService) && import_react124.default.createElement(Text, { color: "yellow", dimColor: true }, t.mcpInfoPanel.pleaseWait),
|
|
551057
|
+
!isReconnecting && !togglingService && import_react124.default.createElement(Text, { color: "gray", dimColor: true }, t.mcpInfoPanel.navigationHint)
|
|
550224
551058
|
)
|
|
550225
551059
|
);
|
|
550226
551060
|
}
|
|
550227
|
-
var
|
|
551061
|
+
var import_react124;
|
|
550228
551062
|
var init_MCPInfoPanel = __esm({
|
|
550229
551063
|
async "dist/ui/components/panels/MCPInfoPanel.js"() {
|
|
550230
551064
|
"use strict";
|
|
550231
|
-
|
|
551065
|
+
import_react124 = __toESM(require_react(), 1);
|
|
550232
551066
|
await init_build2();
|
|
550233
551067
|
init_mcpToolsManager();
|
|
550234
551068
|
init_apiConfig();
|
|
@@ -550243,30 +551077,30 @@ __export(SessionListPanel_exports, {
|
|
|
550243
551077
|
});
|
|
550244
551078
|
function SessionListPanel({ onSelectSession, onClose }) {
|
|
550245
551079
|
const { t } = useI18n();
|
|
550246
|
-
const [sessions, setSessions] = (0,
|
|
550247
|
-
const [loading, setLoading] = (0,
|
|
550248
|
-
const [loadingMore, setLoadingMore] = (0,
|
|
550249
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
550250
|
-
const [scrollOffset, setScrollOffset] = (0,
|
|
550251
|
-
const [markedSessions, setMarkedSessions] = (0,
|
|
550252
|
-
const [currentPage, setCurrentPage] = (0,
|
|
550253
|
-
const [hasMore, setHasMore] = (0,
|
|
550254
|
-
const [totalCount, setTotalCount] = (0,
|
|
550255
|
-
const [searchInput, setSearchInput] = (0,
|
|
550256
|
-
const [debouncedSearch, setDebouncedSearch] = (0,
|
|
550257
|
-
const [renamingSessionId, setRenamingSessionId] = (0,
|
|
550258
|
-
const [renameInput, setRenameInput] = (0,
|
|
550259
|
-
const [isRenaming, setIsRenaming] = (0,
|
|
551080
|
+
const [sessions, setSessions] = (0, import_react125.useState)([]);
|
|
551081
|
+
const [loading, setLoading] = (0, import_react125.useState)(true);
|
|
551082
|
+
const [loadingMore, setLoadingMore] = (0, import_react125.useState)(false);
|
|
551083
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react125.useState)(0);
|
|
551084
|
+
const [scrollOffset, setScrollOffset] = (0, import_react125.useState)(0);
|
|
551085
|
+
const [markedSessions, setMarkedSessions] = (0, import_react125.useState)(/* @__PURE__ */ new Set());
|
|
551086
|
+
const [currentPage, setCurrentPage] = (0, import_react125.useState)(0);
|
|
551087
|
+
const [hasMore, setHasMore] = (0, import_react125.useState)(true);
|
|
551088
|
+
const [totalCount, setTotalCount] = (0, import_react125.useState)(0);
|
|
551089
|
+
const [searchInput, setSearchInput] = (0, import_react125.useState)("");
|
|
551090
|
+
const [debouncedSearch, setDebouncedSearch] = (0, import_react125.useState)("");
|
|
551091
|
+
const [renamingSessionId, setRenamingSessionId] = (0, import_react125.useState)(null);
|
|
551092
|
+
const [renameInput, setRenameInput] = (0, import_react125.useState)("");
|
|
551093
|
+
const [isRenaming, setIsRenaming] = (0, import_react125.useState)(false);
|
|
550260
551094
|
const VISIBLE_ITEMS2 = 5;
|
|
550261
551095
|
const PAGE_SIZE2 = 20;
|
|
550262
551096
|
const SEARCH_DEBOUNCE_MS = 300;
|
|
550263
|
-
(0,
|
|
551097
|
+
(0, import_react125.useEffect)(() => {
|
|
550264
551098
|
const timer2 = setTimeout(() => {
|
|
550265
551099
|
setDebouncedSearch(searchInput);
|
|
550266
551100
|
}, SEARCH_DEBOUNCE_MS);
|
|
550267
551101
|
return () => clearTimeout(timer2);
|
|
550268
551102
|
}, [searchInput]);
|
|
550269
|
-
(0,
|
|
551103
|
+
(0, import_react125.useEffect)(() => {
|
|
550270
551104
|
const loadSessions = async () => {
|
|
550271
551105
|
setLoading(true);
|
|
550272
551106
|
try {
|
|
@@ -550286,7 +551120,7 @@ function SessionListPanel({ onSelectSession, onClose }) {
|
|
|
550286
551120
|
};
|
|
550287
551121
|
void loadSessions();
|
|
550288
551122
|
}, [debouncedSearch]);
|
|
550289
|
-
const loadMoreSessions = (0,
|
|
551123
|
+
const loadMoreSessions = (0, import_react125.useCallback)(async () => {
|
|
550290
551124
|
if (loadingMore || !hasMore)
|
|
550291
551125
|
return;
|
|
550292
551126
|
setLoadingMore(true);
|
|
@@ -550302,7 +551136,7 @@ function SessionListPanel({ onSelectSession, onClose }) {
|
|
|
550302
551136
|
setLoadingMore(false);
|
|
550303
551137
|
}
|
|
550304
551138
|
}, [currentPage, hasMore, loadingMore, debouncedSearch]);
|
|
550305
|
-
const formatDate2 = (0,
|
|
551139
|
+
const formatDate2 = (0, import_react125.useCallback)((timestamp) => {
|
|
550306
551140
|
const date = new Date(timestamp);
|
|
550307
551141
|
const now = /* @__PURE__ */ new Date();
|
|
550308
551142
|
const diffMs = now.getTime() - date.getTime();
|
|
@@ -550456,13 +551290,13 @@ function SessionListPanel({ onSelectSession, onClose }) {
|
|
|
550456
551290
|
const hasMoreInView = sessions.length > scrollOffset + VISIBLE_ITEMS2;
|
|
550457
551291
|
const hasPrevious = scrollOffset > 0;
|
|
550458
551292
|
const currentSession = sessions[selectedIndex];
|
|
550459
|
-
return
|
|
551293
|
+
return import_react125.default.createElement(
|
|
550460
551294
|
Box_default,
|
|
550461
551295
|
{ borderStyle: "round", borderColor: "cyan", paddingX: 1, flexDirection: "column" },
|
|
550462
|
-
|
|
551296
|
+
import_react125.default.createElement(
|
|
550463
551297
|
Box_default,
|
|
550464
551298
|
{ flexDirection: "column" },
|
|
550465
|
-
|
|
551299
|
+
import_react125.default.createElement(
|
|
550466
551300
|
Text,
|
|
550467
551301
|
{ color: "cyan", dimColor: true },
|
|
550468
551302
|
t.sessionListPanel.title,
|
|
@@ -550473,7 +551307,7 @@ function SessionListPanel({ onSelectSession, onClose }) {
|
|
|
550473
551307
|
totalCount > sessions.length && ` of ${totalCount}`,
|
|
550474
551308
|
")",
|
|
550475
551309
|
currentSession && ` \u2022 ${currentSession.messageCount} ${t.sessionListPanel.messages.replace("{count}", "")}`,
|
|
550476
|
-
markedSessions.size > 0 &&
|
|
551310
|
+
markedSessions.size > 0 && import_react125.default.createElement(
|
|
550477
551311
|
Text,
|
|
550478
551312
|
{ color: "yellow" },
|
|
550479
551313
|
" ",
|
|
@@ -550481,46 +551315,46 @@ function SessionListPanel({ onSelectSession, onClose }) {
|
|
|
550481
551315
|
" ",
|
|
550482
551316
|
t.sessionListPanel.marked.replace("{count}", String(markedSessions.size))
|
|
550483
551317
|
),
|
|
550484
|
-
loadingMore &&
|
|
551318
|
+
loadingMore && import_react125.default.createElement(
|
|
550485
551319
|
Text,
|
|
550486
551320
|
{ color: "gray" },
|
|
550487
551321
|
" \u2022 ",
|
|
550488
551322
|
t.sessionListPanel.loadingMore
|
|
550489
551323
|
)
|
|
550490
551324
|
),
|
|
550491
|
-
searchInput ?
|
|
551325
|
+
searchInput ? import_react125.default.createElement(
|
|
550492
551326
|
Text,
|
|
550493
551327
|
{ color: "green" },
|
|
550494
551328
|
t.sessionListPanel.searchLabel,
|
|
550495
551329
|
" ",
|
|
550496
551330
|
searchInput,
|
|
550497
|
-
searchInput !== debouncedSearch &&
|
|
551331
|
+
searchInput !== debouncedSearch && import_react125.default.createElement(
|
|
550498
551332
|
Text,
|
|
550499
551333
|
{ color: "gray" },
|
|
550500
551334
|
" (",
|
|
550501
551335
|
t.sessionListPanel.searching,
|
|
550502
551336
|
")"
|
|
550503
551337
|
)
|
|
550504
|
-
) : renamingSessionId ?
|
|
551338
|
+
) : renamingSessionId ? import_react125.default.createElement(
|
|
550505
551339
|
Text,
|
|
550506
551340
|
{ color: "yellow" },
|
|
550507
551341
|
t.sessionListPanel.renamePrompt,
|
|
550508
551342
|
":",
|
|
550509
551343
|
" ",
|
|
550510
|
-
|
|
550511
|
-
isRenaming &&
|
|
551344
|
+
import_react125.default.createElement(Text, { color: "white" }, renameInput),
|
|
551345
|
+
isRenaming && import_react125.default.createElement(
|
|
550512
551346
|
Text,
|
|
550513
551347
|
{ color: "gray" },
|
|
550514
551348
|
" (",
|
|
550515
551349
|
t.sessionListPanel.renaming,
|
|
550516
551350
|
")"
|
|
550517
551351
|
)
|
|
550518
|
-
) :
|
|
551352
|
+
) : import_react125.default.createElement(Text, { color: "gray", dimColor: true }, t.sessionListPanel.navigationHint)
|
|
550519
551353
|
),
|
|
550520
|
-
loading ?
|
|
550521
|
-
|
|
551354
|
+
loading ? import_react125.default.createElement(Text, { color: "gray", dimColor: true }, t.sessionListPanel.loading) : sessions.length === 0 ? import_react125.default.createElement(Text, { color: "gray", dimColor: true }, debouncedSearch ? t.sessionListPanel.noResults.replace("{query}", debouncedSearch) : t.sessionListPanel.noConversations) : import_react125.default.createElement(
|
|
551355
|
+
import_react125.default.Fragment,
|
|
550522
551356
|
null,
|
|
550523
|
-
hasPrevious &&
|
|
551357
|
+
hasPrevious && import_react125.default.createElement(
|
|
550524
551358
|
Text,
|
|
550525
551359
|
{ color: "gray", dimColor: true },
|
|
550526
551360
|
" ",
|
|
@@ -550533,13 +551367,13 @@ function SessionListPanel({ onSelectSession, onClose }) {
|
|
|
550533
551367
|
const cleanTitle = (session.title || t.sessionListPanel.untitled).replace(/[\r\n\t]+/g, " ");
|
|
550534
551368
|
const timeStr = formatDate2(session.updatedAt);
|
|
550535
551369
|
const truncatedLabel = cleanTitle.length > 50 ? cleanTitle.slice(0, 47) + "..." : cleanTitle;
|
|
550536
|
-
return
|
|
551370
|
+
return import_react125.default.createElement(
|
|
550537
551371
|
Box_default,
|
|
550538
551372
|
{ key: session.id },
|
|
550539
|
-
|
|
550540
|
-
|
|
550541
|
-
|
|
550542
|
-
|
|
551373
|
+
import_react125.default.createElement(Text, { color: isMarked ? "green" : "gray" }, isMarked ? "\u2714 " : " "),
|
|
551374
|
+
import_react125.default.createElement(Text, { color: isSelected ? "green" : "gray" }, isSelected ? "\u276F " : " "),
|
|
551375
|
+
import_react125.default.createElement(Text, { color: isSelected ? "cyan" : isMarked ? "green" : "white" }, truncatedLabel),
|
|
551376
|
+
import_react125.default.createElement(
|
|
550543
551377
|
Text,
|
|
550544
551378
|
{ color: "gray", dimColor: true },
|
|
550545
551379
|
" ",
|
|
@@ -550549,7 +551383,7 @@ function SessionListPanel({ onSelectSession, onClose }) {
|
|
|
550549
551383
|
);
|
|
550550
551384
|
})
|
|
550551
551385
|
),
|
|
550552
|
-
!loading && sessions.length > 0 && hasMoreInView &&
|
|
551386
|
+
!loading && sessions.length > 0 && hasMoreInView && import_react125.default.createElement(
|
|
550553
551387
|
Text,
|
|
550554
551388
|
{ color: "gray", dimColor: true },
|
|
550555
551389
|
" ",
|
|
@@ -550558,11 +551392,11 @@ function SessionListPanel({ onSelectSession, onClose }) {
|
|
|
550558
551392
|
)
|
|
550559
551393
|
);
|
|
550560
551394
|
}
|
|
550561
|
-
var
|
|
551395
|
+
var import_react125;
|
|
550562
551396
|
var init_SessionListPanel = __esm({
|
|
550563
551397
|
async "dist/ui/components/panels/SessionListPanel.js"() {
|
|
550564
551398
|
"use strict";
|
|
550565
|
-
|
|
551399
|
+
import_react125 = __toESM(require_react(), 1);
|
|
550566
551400
|
await init_build2();
|
|
550567
551401
|
init_sessionManager();
|
|
550568
551402
|
init_i18n();
|
|
@@ -550726,7 +551560,7 @@ function formatTokens(tokens2, compact2 = false) {
|
|
|
550726
551560
|
}
|
|
550727
551561
|
function renderStackedBarChart(stats, terminalWidth, scrollOffset, t) {
|
|
550728
551562
|
if (stats.models.size === 0) {
|
|
550729
|
-
return
|
|
551563
|
+
return import_react126.default.createElement(Text, { color: "gray", dimColor: true }, t.usagePanel.chart.noData);
|
|
550730
551564
|
}
|
|
550731
551565
|
const sortedModels = Array.from(stats.models.entries()).sort((a, b) => b[1].total - a[1].total);
|
|
550732
551566
|
const isNarrow = terminalWidth < 100;
|
|
@@ -550738,72 +551572,72 @@ function renderStackedBarChart(stats, terminalWidth, scrollOffset, t) {
|
|
|
550738
551572
|
const hasMoreBelow = endIdx < sortedModels.length;
|
|
550739
551573
|
const maxTotal = Math.max(...Array.from(stats.models.values()).map((s) => s.total + s.cacheCreation + s.cacheRead));
|
|
550740
551574
|
const maxBarWidth = Math.min(isNarrow ? 50 : 70, terminalWidth - 10);
|
|
550741
|
-
return
|
|
551575
|
+
return import_react126.default.createElement(
|
|
550742
551576
|
Box_default,
|
|
550743
551577
|
{ flexDirection: "column" },
|
|
550744
|
-
|
|
551578
|
+
import_react126.default.createElement(
|
|
550745
551579
|
Box_default,
|
|
550746
551580
|
{ marginBottom: 1 },
|
|
550747
|
-
|
|
550748
|
-
|
|
551581
|
+
import_react126.default.createElement(Text, { color: "cyan" }, "\u2588"),
|
|
551582
|
+
import_react126.default.createElement(
|
|
550749
551583
|
Text,
|
|
550750
551584
|
{ color: "gray", dimColor: true },
|
|
550751
551585
|
" ",
|
|
550752
551586
|
t.usagePanel.chart.usage,
|
|
550753
551587
|
" "
|
|
550754
551588
|
),
|
|
550755
|
-
|
|
550756
|
-
|
|
551589
|
+
import_react126.default.createElement(Text, { color: "green" }, "\u2588"),
|
|
551590
|
+
import_react126.default.createElement(
|
|
550757
551591
|
Text,
|
|
550758
551592
|
{ color: "gray", dimColor: true },
|
|
550759
551593
|
" ",
|
|
550760
551594
|
t.usagePanel.chart.cacheHit,
|
|
550761
551595
|
" "
|
|
550762
551596
|
),
|
|
550763
|
-
|
|
550764
|
-
|
|
551597
|
+
import_react126.default.createElement(Text, { color: "yellow" }, "\u2588"),
|
|
551598
|
+
import_react126.default.createElement(
|
|
550765
551599
|
Text,
|
|
550766
551600
|
{ color: "gray", dimColor: true },
|
|
550767
551601
|
" ",
|
|
550768
551602
|
t.usagePanel.chart.cacheCreate
|
|
550769
551603
|
)
|
|
550770
551604
|
),
|
|
550771
|
-
hasMoreAbove &&
|
|
551605
|
+
hasMoreAbove && import_react126.default.createElement(
|
|
550772
551606
|
Box_default,
|
|
550773
551607
|
{ marginBottom: 1 },
|
|
550774
|
-
|
|
551608
|
+
import_react126.default.createElement(Text, { color: "yellow", dimColor: true }, t.usagePanel.chart.moreAbove.replace("{count}", String(startIdx)))
|
|
550775
551609
|
),
|
|
550776
551610
|
visibleModels.map(([modelName, modelStats]) => {
|
|
550777
551611
|
const shortName = getModelShortName(modelName, 30);
|
|
550778
551612
|
const usageLength = modelStats.total > 0 ? Math.max(1, Math.round(modelStats.total / maxTotal * maxBarWidth)) : 0;
|
|
550779
551613
|
const cacheHitLength = modelStats.cacheRead > 0 ? Math.max(1, Math.round(modelStats.cacheRead / maxTotal * maxBarWidth)) : 0;
|
|
550780
551614
|
const cacheCreateLength = modelStats.cacheCreation > 0 ? Math.max(1, Math.round(modelStats.cacheCreation / maxTotal * maxBarWidth)) : 0;
|
|
550781
|
-
return
|
|
551615
|
+
return import_react126.default.createElement(
|
|
550782
551616
|
Box_default,
|
|
550783
551617
|
{ key: modelName, flexDirection: "column", marginBottom: 1 },
|
|
550784
|
-
|
|
551618
|
+
import_react126.default.createElement(
|
|
550785
551619
|
Box_default,
|
|
550786
551620
|
null,
|
|
550787
|
-
|
|
551621
|
+
import_react126.default.createElement(Text, { bold: true, color: "white" }, shortName)
|
|
550788
551622
|
),
|
|
550789
|
-
|
|
551623
|
+
import_react126.default.createElement(
|
|
550790
551624
|
Box_default,
|
|
550791
551625
|
null,
|
|
550792
|
-
usageLength > 0 &&
|
|
550793
|
-
cacheHitLength > 0 &&
|
|
550794
|
-
cacheCreateLength > 0 &&
|
|
551626
|
+
usageLength > 0 && import_react126.default.createElement(Text, { color: "cyan" }, "\u2588".repeat(usageLength)),
|
|
551627
|
+
cacheHitLength > 0 && import_react126.default.createElement(Text, { color: "green" }, "\u2588".repeat(cacheHitLength)),
|
|
551628
|
+
cacheCreateLength > 0 && import_react126.default.createElement(Text, { color: "yellow" }, "\u2588".repeat(cacheCreateLength))
|
|
550795
551629
|
),
|
|
550796
|
-
|
|
551630
|
+
import_react126.default.createElement(
|
|
550797
551631
|
Box_default,
|
|
550798
551632
|
null,
|
|
550799
|
-
|
|
551633
|
+
import_react126.default.createElement(
|
|
550800
551634
|
Text,
|
|
550801
551635
|
{ color: "cyan" },
|
|
550802
551636
|
t.usagePanel.chart.usage,
|
|
550803
551637
|
" ",
|
|
550804
551638
|
formatTokens(modelStats.total, isNarrow)
|
|
550805
551639
|
),
|
|
550806
|
-
|
|
551640
|
+
import_react126.default.createElement(
|
|
550807
551641
|
Text,
|
|
550808
551642
|
{ color: "gray", dimColor: true },
|
|
550809
551643
|
" ",
|
|
@@ -550818,34 +551652,34 @@ function renderStackedBarChart(stats, terminalWidth, scrollOffset, t) {
|
|
|
550818
551652
|
formatTokens(modelStats.output, isNarrow),
|
|
550819
551653
|
")"
|
|
550820
551654
|
),
|
|
550821
|
-
(modelStats.cacheRead > 0 || modelStats.cacheCreation > 0) &&
|
|
550822
|
-
|
|
551655
|
+
(modelStats.cacheRead > 0 || modelStats.cacheCreation > 0) && import_react126.default.createElement(
|
|
551656
|
+
import_react126.default.Fragment,
|
|
550823
551657
|
null,
|
|
550824
|
-
|
|
551658
|
+
import_react126.default.createElement(
|
|
550825
551659
|
Text,
|
|
550826
551660
|
{ color: "gray", dimColor: true },
|
|
550827
551661
|
" ",
|
|
550828
551662
|
"|",
|
|
550829
551663
|
" "
|
|
550830
551664
|
),
|
|
550831
|
-
modelStats.cacheRead > 0 &&
|
|
550832
|
-
|
|
551665
|
+
modelStats.cacheRead > 0 && import_react126.default.createElement(
|
|
551666
|
+
import_react126.default.Fragment,
|
|
550833
551667
|
null,
|
|
550834
|
-
|
|
551668
|
+
import_react126.default.createElement(
|
|
550835
551669
|
Text,
|
|
550836
551670
|
{ color: "green" },
|
|
550837
551671
|
t.usagePanel.chart.hit,
|
|
550838
551672
|
" ",
|
|
550839
551673
|
formatTokens(modelStats.cacheRead, isNarrow)
|
|
550840
551674
|
),
|
|
550841
|
-
modelStats.cacheCreation > 0 &&
|
|
551675
|
+
modelStats.cacheCreation > 0 && import_react126.default.createElement(
|
|
550842
551676
|
Text,
|
|
550843
551677
|
{ color: "gray", dimColor: true },
|
|
550844
551678
|
",",
|
|
550845
551679
|
" "
|
|
550846
551680
|
)
|
|
550847
551681
|
),
|
|
550848
|
-
modelStats.cacheCreation > 0 &&
|
|
551682
|
+
modelStats.cacheCreation > 0 && import_react126.default.createElement(
|
|
550849
551683
|
Text,
|
|
550850
551684
|
{ color: "yellow" },
|
|
550851
551685
|
t.usagePanel.chart.create,
|
|
@@ -550856,31 +551690,31 @@ function renderStackedBarChart(stats, terminalWidth, scrollOffset, t) {
|
|
|
550856
551690
|
)
|
|
550857
551691
|
);
|
|
550858
551692
|
}),
|
|
550859
|
-
sortedModels.length > 1 &&
|
|
551693
|
+
sortedModels.length > 1 && import_react126.default.createElement(
|
|
550860
551694
|
Box_default,
|
|
550861
551695
|
{ marginTop: 1, flexDirection: "column" },
|
|
550862
|
-
|
|
550863
|
-
|
|
551696
|
+
import_react126.default.createElement(Text, { color: "gray", dimColor: true }, "\u2500".repeat(Math.min(terminalWidth - 8, 70))),
|
|
551697
|
+
import_react126.default.createElement(
|
|
550864
551698
|
Box_default,
|
|
550865
551699
|
null,
|
|
550866
|
-
|
|
551700
|
+
import_react126.default.createElement(
|
|
550867
551701
|
Text,
|
|
550868
551702
|
{ bold: true, color: "white" },
|
|
550869
551703
|
t.usagePanel.chart.total,
|
|
550870
551704
|
" "
|
|
550871
551705
|
),
|
|
550872
|
-
|
|
550873
|
-
Array.from(stats.models.values()).reduce((sum, s) => sum + s.cacheRead, 0) > 0 &&
|
|
550874
|
-
|
|
551706
|
+
import_react126.default.createElement(Text, { color: "cyan", bold: true }, formatTokens(stats.grandTotal)),
|
|
551707
|
+
Array.from(stats.models.values()).reduce((sum, s) => sum + s.cacheRead, 0) > 0 && import_react126.default.createElement(
|
|
551708
|
+
import_react126.default.Fragment,
|
|
550875
551709
|
null,
|
|
550876
|
-
|
|
551710
|
+
import_react126.default.createElement(
|
|
550877
551711
|
Text,
|
|
550878
551712
|
{ color: "gray", dimColor: true },
|
|
550879
551713
|
" ",
|
|
550880
551714
|
"|",
|
|
550881
551715
|
" "
|
|
550882
551716
|
),
|
|
550883
|
-
|
|
551717
|
+
import_react126.default.createElement(
|
|
550884
551718
|
Text,
|
|
550885
551719
|
{ color: "green", bold: true },
|
|
550886
551720
|
t.usagePanel.chart.hit,
|
|
@@ -550888,16 +551722,16 @@ function renderStackedBarChart(stats, terminalWidth, scrollOffset, t) {
|
|
|
550888
551722
|
formatTokens(Array.from(stats.models.values()).reduce((sum, s) => sum + s.cacheRead, 0))
|
|
550889
551723
|
)
|
|
550890
551724
|
),
|
|
550891
|
-
Array.from(stats.models.values()).reduce((sum, s) => sum + s.cacheCreation, 0) > 0 &&
|
|
550892
|
-
|
|
551725
|
+
Array.from(stats.models.values()).reduce((sum, s) => sum + s.cacheCreation, 0) > 0 && import_react126.default.createElement(
|
|
551726
|
+
import_react126.default.Fragment,
|
|
550893
551727
|
null,
|
|
550894
|
-
|
|
551728
|
+
import_react126.default.createElement(
|
|
550895
551729
|
Text,
|
|
550896
551730
|
{ color: "gray", dimColor: true },
|
|
550897
551731
|
",",
|
|
550898
551732
|
" "
|
|
550899
551733
|
),
|
|
550900
|
-
|
|
551734
|
+
import_react126.default.createElement(
|
|
550901
551735
|
Text,
|
|
550902
551736
|
{ color: "yellow", bold: true },
|
|
550903
551737
|
t.usagePanel.chart.create,
|
|
@@ -550907,23 +551741,23 @@ function renderStackedBarChart(stats, terminalWidth, scrollOffset, t) {
|
|
|
550907
551741
|
)
|
|
550908
551742
|
)
|
|
550909
551743
|
),
|
|
550910
|
-
hasMoreBelow &&
|
|
551744
|
+
hasMoreBelow && import_react126.default.createElement(
|
|
550911
551745
|
Box_default,
|
|
550912
551746
|
{ marginTop: 1 },
|
|
550913
|
-
|
|
551747
|
+
import_react126.default.createElement(Text, { color: "yellow", dimColor: true }, t.usagePanel.chart.moreBelow.replace("{count}", String(sortedModels.length - endIdx)))
|
|
550914
551748
|
)
|
|
550915
551749
|
);
|
|
550916
551750
|
}
|
|
550917
551751
|
function UsagePanel() {
|
|
550918
551752
|
const { t } = useI18n();
|
|
550919
|
-
const [granularity, setGranularity] = (0,
|
|
550920
|
-
const [stats, setStats] = (0,
|
|
551753
|
+
const [granularity, setGranularity] = (0, import_react126.useState)("week");
|
|
551754
|
+
const [stats, setStats] = (0, import_react126.useState)({
|
|
550921
551755
|
models: /* @__PURE__ */ new Map(),
|
|
550922
551756
|
grandTotal: 0
|
|
550923
551757
|
});
|
|
550924
|
-
const [isLoading, setIsLoading] = (0,
|
|
550925
|
-
const [error, setError] = (0,
|
|
550926
|
-
const [scrollOffset, setScrollOffset] = (0,
|
|
551758
|
+
const [isLoading, setIsLoading] = (0, import_react126.useState)(true);
|
|
551759
|
+
const [error, setError] = (0, import_react126.useState)(null);
|
|
551760
|
+
const [scrollOffset, setScrollOffset] = (0, import_react126.useState)(0);
|
|
550927
551761
|
const { columns: terminalWidth } = useTerminalSize();
|
|
550928
551762
|
const granularityLabels = {
|
|
550929
551763
|
hour: t.usagePanel.granularity.last24h,
|
|
@@ -550931,7 +551765,7 @@ function UsagePanel() {
|
|
|
550931
551765
|
week: t.usagePanel.granularity.last30d,
|
|
550932
551766
|
month: t.usagePanel.granularity.last12m
|
|
550933
551767
|
};
|
|
550934
|
-
(0,
|
|
551768
|
+
(0, import_react126.useEffect)(() => {
|
|
550935
551769
|
const load = async () => {
|
|
550936
551770
|
setIsLoading(true);
|
|
550937
551771
|
try {
|
|
@@ -550948,7 +551782,7 @@ function UsagePanel() {
|
|
|
550948
551782
|
};
|
|
550949
551783
|
load();
|
|
550950
551784
|
}, [granularity]);
|
|
550951
|
-
(0,
|
|
551785
|
+
(0, import_react126.useEffect)(() => {
|
|
550952
551786
|
setScrollOffset(0);
|
|
550953
551787
|
}, [granularity]);
|
|
550954
551788
|
use_input_default((_input, key) => {
|
|
@@ -550970,48 +551804,48 @@ function UsagePanel() {
|
|
|
550970
551804
|
}
|
|
550971
551805
|
});
|
|
550972
551806
|
if (isLoading) {
|
|
550973
|
-
return
|
|
551807
|
+
return import_react126.default.createElement(
|
|
550974
551808
|
Box_default,
|
|
550975
551809
|
{ borderColor: "cyan", borderStyle: "round", paddingX: 2, paddingY: 0 },
|
|
550976
|
-
|
|
551810
|
+
import_react126.default.createElement(Text, { color: "gray" }, t.usagePanel.loading)
|
|
550977
551811
|
);
|
|
550978
551812
|
}
|
|
550979
551813
|
if (error) {
|
|
550980
|
-
return
|
|
551814
|
+
return import_react126.default.createElement(
|
|
550981
551815
|
Box_default,
|
|
550982
551816
|
{ borderColor: "red", borderStyle: "round", paddingX: 2, paddingY: 0 },
|
|
550983
|
-
|
|
551817
|
+
import_react126.default.createElement(Text, { color: "red" }, t.usagePanel.error.replace("{error}", error))
|
|
550984
551818
|
);
|
|
550985
551819
|
}
|
|
550986
|
-
return
|
|
551820
|
+
return import_react126.default.createElement(
|
|
550987
551821
|
Box_default,
|
|
550988
551822
|
{ borderColor: "cyan", borderStyle: "round", paddingX: 2, paddingY: 1, flexDirection: "column" },
|
|
550989
|
-
|
|
551823
|
+
import_react126.default.createElement(
|
|
550990
551824
|
Box_default,
|
|
550991
551825
|
{ marginBottom: 1 },
|
|
550992
|
-
|
|
550993
|
-
|
|
551826
|
+
import_react126.default.createElement(Text, { color: "cyan", bold: true }, t.usagePanel.title),
|
|
551827
|
+
import_react126.default.createElement(
|
|
550994
551828
|
Text,
|
|
550995
551829
|
{ color: "gray" },
|
|
550996
551830
|
" (",
|
|
550997
551831
|
granularityLabels[granularity],
|
|
550998
551832
|
")"
|
|
550999
551833
|
),
|
|
551000
|
-
|
|
551834
|
+
import_react126.default.createElement(
|
|
551001
551835
|
Text,
|
|
551002
551836
|
{ color: "gray", dimColor: true },
|
|
551003
551837
|
" ",
|
|
551004
551838
|
t.usagePanel.tabToSwitch
|
|
551005
551839
|
)
|
|
551006
551840
|
),
|
|
551007
|
-
stats.models.size === 0 ?
|
|
551841
|
+
stats.models.size === 0 ? import_react126.default.createElement(Text, { color: "gray", dimColor: true }, t.usagePanel.noDataForPeriod) : renderStackedBarChart(stats, terminalWidth, scrollOffset, t)
|
|
551008
551842
|
);
|
|
551009
551843
|
}
|
|
551010
|
-
var
|
|
551844
|
+
var import_react126;
|
|
551011
551845
|
var init_UsagePanel = __esm({
|
|
551012
551846
|
async "dist/ui/components/panels/UsagePanel.js"() {
|
|
551013
551847
|
"use strict";
|
|
551014
|
-
|
|
551848
|
+
import_react126 = __toESM(require_react(), 1);
|
|
551015
551849
|
await init_build2();
|
|
551016
551850
|
init_useTerminalSize();
|
|
551017
551851
|
init_i18n();
|
|
@@ -551019,96 +551853,101 @@ var init_UsagePanel = __esm({
|
|
|
551019
551853
|
});
|
|
551020
551854
|
|
|
551021
551855
|
// dist/ui/components/panels/PanelsManager.js
|
|
551022
|
-
function PanelsManager({ terminalWidth, workingDirectory, showSessionPanel, showMcpPanel, showUsagePanel, showCustomCommandConfig, showSkillsCreation, showRoleCreation, showRoleDeletion, showRoleList, showWorkingDirPanel, setShowSessionPanel, setShowCustomCommandConfig, setShowSkillsCreation, setShowRoleCreation, setShowRoleDeletion, setShowRoleList, setShowWorkingDirPanel, handleSessionPanelSelect, onCustomCommandSave, onSkillsSave, onRoleSave, onRoleDelete }) {
|
|
551856
|
+
function PanelsManager({ terminalWidth, workingDirectory, showSessionPanel, showMcpPanel, showUsagePanel, showModelsPanel, showCustomCommandConfig, showSkillsCreation, showRoleCreation, showRoleDeletion, showRoleList, showWorkingDirPanel, advancedModel, basicModel, setShowSessionPanel, setShowModelsPanel, setShowCustomCommandConfig, setShowSkillsCreation, setShowRoleCreation, setShowRoleDeletion, setShowRoleList, setShowWorkingDirPanel, handleSessionPanelSelect, onCustomCommandSave, onSkillsSave, onRoleSave, onRoleDelete }) {
|
|
551023
551857
|
const { theme: theme14 } = useTheme();
|
|
551024
551858
|
const { t } = useI18n();
|
|
551025
|
-
const loadingFallback =
|
|
551859
|
+
const loadingFallback = import_react127.default.createElement(
|
|
551026
551860
|
Box_default,
|
|
551027
551861
|
null,
|
|
551028
|
-
|
|
551862
|
+
import_react127.default.createElement(
|
|
551029
551863
|
Text,
|
|
551030
551864
|
null,
|
|
551031
|
-
|
|
551865
|
+
import_react127.default.createElement(build_default, { type: "dots" }),
|
|
551032
551866
|
" Loading..."
|
|
551033
551867
|
)
|
|
551034
551868
|
);
|
|
551035
|
-
return
|
|
551036
|
-
|
|
551869
|
+
return import_react127.default.createElement(
|
|
551870
|
+
import_react127.default.Fragment,
|
|
551037
551871
|
null,
|
|
551038
|
-
showSessionPanel &&
|
|
551872
|
+
showSessionPanel && import_react127.default.createElement(
|
|
551039
551873
|
Box_default,
|
|
551040
551874
|
{ paddingX: 1, width: terminalWidth },
|
|
551041
|
-
|
|
551042
|
-
|
|
551875
|
+
import_react127.default.createElement(
|
|
551876
|
+
import_react127.Suspense,
|
|
551043
551877
|
{ fallback: loadingFallback },
|
|
551044
|
-
|
|
551878
|
+
import_react127.default.createElement(SessionListPanel2, { onSelectSession: handleSessionPanelSelect, onClose: () => setShowSessionPanel(false) })
|
|
551045
551879
|
)
|
|
551046
551880
|
),
|
|
551047
|
-
showMcpPanel &&
|
|
551881
|
+
showMcpPanel && import_react127.default.createElement(
|
|
551048
551882
|
Box_default,
|
|
551049
551883
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
551050
|
-
|
|
551051
|
-
|
|
551884
|
+
import_react127.default.createElement(
|
|
551885
|
+
import_react127.Suspense,
|
|
551052
551886
|
{ fallback: loadingFallback },
|
|
551053
|
-
|
|
551887
|
+
import_react127.default.createElement(MCPInfoPanel2, null)
|
|
551054
551888
|
),
|
|
551055
|
-
|
|
551889
|
+
import_react127.default.createElement(
|
|
551056
551890
|
Box_default,
|
|
551057
551891
|
{ marginTop: 1 },
|
|
551058
|
-
|
|
551892
|
+
import_react127.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.pressEscToClose)
|
|
551059
551893
|
)
|
|
551060
551894
|
),
|
|
551061
|
-
showUsagePanel &&
|
|
551895
|
+
showUsagePanel && import_react127.default.createElement(
|
|
551062
551896
|
Box_default,
|
|
551063
551897
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
551064
|
-
|
|
551065
|
-
|
|
551898
|
+
import_react127.default.createElement(
|
|
551899
|
+
import_react127.Suspense,
|
|
551066
551900
|
{ fallback: loadingFallback },
|
|
551067
|
-
|
|
551901
|
+
import_react127.default.createElement(UsagePanel2, null)
|
|
551068
551902
|
),
|
|
551069
|
-
|
|
551903
|
+
import_react127.default.createElement(
|
|
551070
551904
|
Box_default,
|
|
551071
551905
|
{ marginTop: 1 },
|
|
551072
|
-
|
|
551906
|
+
import_react127.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.pressEscToClose)
|
|
551073
551907
|
)
|
|
551074
551908
|
),
|
|
551075
|
-
|
|
551909
|
+
showModelsPanel && import_react127.default.createElement(
|
|
551076
551910
|
Box_default,
|
|
551077
551911
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
551078
|
-
|
|
551912
|
+
import_react127.default.createElement(ModelsPanel, { advancedModel, basicModel, visible: showModelsPanel, onClose: () => setShowModelsPanel(false) })
|
|
551079
551913
|
),
|
|
551080
|
-
|
|
551914
|
+
showCustomCommandConfig && import_react127.default.createElement(
|
|
551081
551915
|
Box_default,
|
|
551082
551916
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
551083
|
-
|
|
551917
|
+
import_react127.default.createElement(CustomCommandConfigPanel, { projectRoot: workingDirectory, onSave: onCustomCommandSave, onCancel: () => setShowCustomCommandConfig(false) })
|
|
551084
551918
|
),
|
|
551085
|
-
|
|
551919
|
+
showSkillsCreation && import_react127.default.createElement(
|
|
551086
551920
|
Box_default,
|
|
551087
551921
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
551088
|
-
|
|
551922
|
+
import_react127.default.createElement(SkillsCreationPanel, { projectRoot: workingDirectory, onSave: onSkillsSave, onCancel: () => setShowSkillsCreation(false) })
|
|
551089
551923
|
),
|
|
551090
|
-
|
|
551924
|
+
showRoleCreation && import_react127.default.createElement(
|
|
551091
551925
|
Box_default,
|
|
551092
551926
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
551093
|
-
|
|
551927
|
+
import_react127.default.createElement(RoleCreationPanel, { projectRoot: workingDirectory, onSave: onRoleSave, onCancel: () => setShowRoleCreation(false) })
|
|
551094
551928
|
),
|
|
551095
|
-
|
|
551929
|
+
showRoleDeletion && import_react127.default.createElement(
|
|
551096
551930
|
Box_default,
|
|
551097
551931
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
551098
|
-
|
|
551932
|
+
import_react127.default.createElement(RoleDeletionPanel, { projectRoot: workingDirectory, onDelete: onRoleDelete, onCancel: () => setShowRoleDeletion(false) })
|
|
551099
551933
|
),
|
|
551100
|
-
|
|
551934
|
+
showRoleList && import_react127.default.createElement(
|
|
551101
551935
|
Box_default,
|
|
551102
551936
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
551103
|
-
|
|
551937
|
+
import_react127.default.createElement(RoleListPanel, { projectRoot: workingDirectory, onClose: () => setShowRoleList(false) })
|
|
551938
|
+
),
|
|
551939
|
+
showWorkingDirPanel && import_react127.default.createElement(
|
|
551940
|
+
Box_default,
|
|
551941
|
+
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
551942
|
+
import_react127.default.createElement(WorkingDirectoryPanel, { onClose: () => setShowWorkingDirPanel(false) })
|
|
551104
551943
|
)
|
|
551105
551944
|
);
|
|
551106
551945
|
}
|
|
551107
|
-
var
|
|
551946
|
+
var import_react127, MCPInfoPanel2, SessionListPanel2, UsagePanel2;
|
|
551108
551947
|
var init_PanelsManager = __esm({
|
|
551109
551948
|
async "dist/ui/components/panels/PanelsManager.js"() {
|
|
551110
551949
|
"use strict";
|
|
551111
|
-
|
|
551950
|
+
import_react127 = __toESM(require_react(), 1);
|
|
551112
551951
|
await init_build2();
|
|
551113
551952
|
await init_build3();
|
|
551114
551953
|
init_ThemeContext();
|
|
@@ -551118,17 +551957,18 @@ var init_PanelsManager = __esm({
|
|
|
551118
551957
|
await init_RoleCreationPanel();
|
|
551119
551958
|
await init_RoleDeletionPanel();
|
|
551120
551959
|
await init_RoleListPanel();
|
|
551960
|
+
await init_ModelsPanel();
|
|
551121
551961
|
await init_WorkingDirectoryPanel();
|
|
551122
|
-
MCPInfoPanel2 = (0,
|
|
551123
|
-
SessionListPanel2 = (0,
|
|
551124
|
-
UsagePanel2 = (0,
|
|
551962
|
+
MCPInfoPanel2 = (0, import_react127.lazy)(() => init_MCPInfoPanel().then(() => MCPInfoPanel_exports));
|
|
551963
|
+
SessionListPanel2 = (0, import_react127.lazy)(() => init_SessionListPanel().then(() => SessionListPanel_exports));
|
|
551964
|
+
UsagePanel2 = (0, import_react127.lazy)(() => init_UsagePanel().then(() => UsagePanel_exports));
|
|
551125
551965
|
}
|
|
551126
551966
|
});
|
|
551127
551967
|
|
|
551128
551968
|
// dist/hooks/session/useSessionSave.js
|
|
551129
551969
|
function useSessionSave() {
|
|
551130
|
-
const savedMessagesRef = (0,
|
|
551131
|
-
const generateMessageId = (0,
|
|
551970
|
+
const savedMessagesRef = (0, import_react128.useRef)(/* @__PURE__ */ new Set());
|
|
551971
|
+
const generateMessageId = (0, import_react128.useCallback)((message, timestamp) => {
|
|
551132
551972
|
let id = `${message.role}-${message.content.length}-${Math.floor(timestamp / 5e3)}`;
|
|
551133
551973
|
if (message.role === "assistant" && message.tool_calls && message.tool_calls.length > 0) {
|
|
551134
551974
|
const toolCallIds = message.tool_calls.map((tc) => tc.id).sort().join(",");
|
|
@@ -551139,7 +551979,7 @@ function useSessionSave() {
|
|
|
551139
551979
|
}
|
|
551140
551980
|
return id;
|
|
551141
551981
|
}, []);
|
|
551142
|
-
const saveMessage = (0,
|
|
551982
|
+
const saveMessage = (0, import_react128.useCallback)(async (message) => {
|
|
551143
551983
|
const timestamp = Date.now();
|
|
551144
551984
|
const messageId = generateMessageId(message, timestamp);
|
|
551145
551985
|
if (savedMessagesRef.current.has(messageId)) {
|
|
@@ -551157,15 +551997,15 @@ function useSessionSave() {
|
|
|
551157
551997
|
console.error("Failed to save message:", error);
|
|
551158
551998
|
}
|
|
551159
551999
|
}, [generateMessageId]);
|
|
551160
|
-
const saveMessages = (0,
|
|
552000
|
+
const saveMessages = (0, import_react128.useCallback)(async (messages) => {
|
|
551161
552001
|
for (const message of messages) {
|
|
551162
552002
|
await saveMessage(message);
|
|
551163
552003
|
}
|
|
551164
552004
|
}, [saveMessage]);
|
|
551165
|
-
const clearSavedMessages = (0,
|
|
552005
|
+
const clearSavedMessages = (0, import_react128.useCallback)(() => {
|
|
551166
552006
|
savedMessagesRef.current.clear();
|
|
551167
552007
|
}, []);
|
|
551168
|
-
const initializeFromSession = (0,
|
|
552008
|
+
const initializeFromSession = (0, import_react128.useCallback)((messages) => {
|
|
551169
552009
|
savedMessagesRef.current.clear();
|
|
551170
552010
|
messages.forEach((message) => {
|
|
551171
552011
|
const messageId = generateMessageId(message, message.timestamp);
|
|
@@ -551179,11 +552019,11 @@ function useSessionSave() {
|
|
|
551179
552019
|
initializeFromSession
|
|
551180
552020
|
};
|
|
551181
552021
|
}
|
|
551182
|
-
var
|
|
552022
|
+
var import_react128;
|
|
551183
552023
|
var init_useSessionSave = __esm({
|
|
551184
552024
|
"dist/hooks/session/useSessionSave.js"() {
|
|
551185
552025
|
"use strict";
|
|
551186
|
-
|
|
552026
|
+
import_react128 = __toESM(require_react(), 1);
|
|
551187
552027
|
init_sessionManager();
|
|
551188
552028
|
}
|
|
551189
552029
|
});
|
|
@@ -551276,10 +552116,10 @@ var init_permissionsConfig = __esm({
|
|
|
551276
552116
|
|
|
551277
552117
|
// dist/hooks/conversation/useToolConfirmation.js
|
|
551278
552118
|
function useToolConfirmation(workingDirectory) {
|
|
551279
|
-
const [pendingToolConfirmation, setPendingToolConfirmation] = (0,
|
|
551280
|
-
const alwaysApprovedToolsRef = (0,
|
|
551281
|
-
const [alwaysApprovedTools, setAlwaysApprovedTools] = (0,
|
|
551282
|
-
(0,
|
|
552119
|
+
const [pendingToolConfirmation, setPendingToolConfirmation] = (0, import_react129.useState)(null);
|
|
552120
|
+
const alwaysApprovedToolsRef = (0, import_react129.useRef)(/* @__PURE__ */ new Set());
|
|
552121
|
+
const [alwaysApprovedTools, setAlwaysApprovedTools] = (0, import_react129.useState)(/* @__PURE__ */ new Set());
|
|
552122
|
+
(0, import_react129.useEffect)(() => {
|
|
551283
552123
|
const config3 = loadPermissionsConfig(workingDirectory);
|
|
551284
552124
|
const loadedTools = new Set(config3.alwaysApprovedTools);
|
|
551285
552125
|
alwaysApprovedToolsRef.current = loadedTools;
|
|
@@ -551298,20 +552138,20 @@ function useToolConfirmation(workingDirectory) {
|
|
|
551298
552138
|
});
|
|
551299
552139
|
});
|
|
551300
552140
|
};
|
|
551301
|
-
const isToolAutoApproved = (0,
|
|
552141
|
+
const isToolAutoApproved = (0, import_react129.useCallback)((toolName) => {
|
|
551302
552142
|
return alwaysApprovedToolsRef.current.has(toolName) || toolName.startsWith("todo-") || toolName.startsWith("subagent-") || toolName === "askuser-ask_question";
|
|
551303
552143
|
}, []);
|
|
551304
|
-
const addToAlwaysApproved = (0,
|
|
552144
|
+
const addToAlwaysApproved = (0, import_react129.useCallback)((toolName) => {
|
|
551305
552145
|
alwaysApprovedToolsRef.current.add(toolName);
|
|
551306
552146
|
setAlwaysApprovedTools((prev) => /* @__PURE__ */ new Set([...prev, toolName]));
|
|
551307
552147
|
addToolToPermissions(workingDirectory, toolName);
|
|
551308
552148
|
}, [workingDirectory]);
|
|
551309
|
-
const addMultipleToAlwaysApproved = (0,
|
|
552149
|
+
const addMultipleToAlwaysApproved = (0, import_react129.useCallback)((toolNames) => {
|
|
551310
552150
|
toolNames.forEach((name) => alwaysApprovedToolsRef.current.add(name));
|
|
551311
552151
|
setAlwaysApprovedTools((prev) => /* @__PURE__ */ new Set([...prev, ...toolNames]));
|
|
551312
552152
|
addMultipleToolsToPermissions(workingDirectory, toolNames);
|
|
551313
552153
|
}, [workingDirectory]);
|
|
551314
|
-
const removeFromAlwaysApproved = (0,
|
|
552154
|
+
const removeFromAlwaysApproved = (0, import_react129.useCallback)((toolName) => {
|
|
551315
552155
|
alwaysApprovedToolsRef.current.delete(toolName);
|
|
551316
552156
|
setAlwaysApprovedTools((prev) => {
|
|
551317
552157
|
const next = new Set(prev);
|
|
@@ -551320,7 +552160,7 @@ function useToolConfirmation(workingDirectory) {
|
|
|
551320
552160
|
});
|
|
551321
552161
|
removeToolFromPermissions(workingDirectory, toolName);
|
|
551322
552162
|
}, [workingDirectory]);
|
|
551323
|
-
const clearAllAlwaysApproved = (0,
|
|
552163
|
+
const clearAllAlwaysApproved = (0, import_react129.useCallback)(() => {
|
|
551324
552164
|
alwaysApprovedToolsRef.current.clear();
|
|
551325
552165
|
setAlwaysApprovedTools(/* @__PURE__ */ new Set());
|
|
551326
552166
|
clearAllPermissions(workingDirectory);
|
|
@@ -551336,11 +552176,11 @@ function useToolConfirmation(workingDirectory) {
|
|
|
551336
552176
|
clearAllAlwaysApproved
|
|
551337
552177
|
};
|
|
551338
552178
|
}
|
|
551339
|
-
var
|
|
552179
|
+
var import_react129;
|
|
551340
552180
|
var init_useToolConfirmation = __esm({
|
|
551341
552181
|
"dist/hooks/conversation/useToolConfirmation.js"() {
|
|
551342
552182
|
"use strict";
|
|
551343
|
-
|
|
552183
|
+
import_react129 = __toESM(require_react(), 1);
|
|
551344
552184
|
init_permissionsConfig();
|
|
551345
552185
|
}
|
|
551346
552186
|
});
|
|
@@ -552502,7 +553342,7 @@ ${msg.content}`;
|
|
|
552502
553342
|
}
|
|
552503
553343
|
function useCommandHandler(options3) {
|
|
552504
553344
|
const { stdout } = use_stdout_default();
|
|
552505
|
-
const handleCommandExecution = (0,
|
|
553345
|
+
const handleCommandExecution = (0, import_react130.useCallback)(async (commandName, result2) => {
|
|
552506
553346
|
if (commandName === "compact" && result2.success && result2.action === "compact") {
|
|
552507
553347
|
options3.setIsCompressing(true);
|
|
552508
553348
|
options3.setCompressionError(null);
|
|
@@ -552647,6 +553487,14 @@ Output: ${combinedOutput}`;
|
|
|
552647
553487
|
commandName
|
|
552648
553488
|
};
|
|
552649
553489
|
options3.setMessages((prev) => [...prev, commandMessage]);
|
|
553490
|
+
} else if (result2.success && result2.action === "showModelsPanel") {
|
|
553491
|
+
options3.setShowModelsPanel(true);
|
|
553492
|
+
const commandMessage = {
|
|
553493
|
+
role: "command",
|
|
553494
|
+
content: "",
|
|
553495
|
+
commandName
|
|
553496
|
+
};
|
|
553497
|
+
options3.setMessages((prev) => [...prev, commandMessage]);
|
|
552650
553498
|
} else if (result2.success && result2.action === "showBackgroundPanel") {
|
|
552651
553499
|
options3.setShowBackgroundPanel();
|
|
552652
553500
|
const commandMessage = {
|
|
@@ -552937,12 +553785,12 @@ ${filePath}`,
|
|
|
552937
553785
|
}, [stdout, options3]);
|
|
552938
553786
|
return { handleCommandExecution };
|
|
552939
553787
|
}
|
|
552940
|
-
var
|
|
553788
|
+
var import_react130;
|
|
552941
553789
|
var init_useCommandHandler = __esm({
|
|
552942
553790
|
async "dist/hooks/conversation/useCommandHandler.js"() {
|
|
552943
553791
|
"use strict";
|
|
552944
553792
|
await init_build2();
|
|
552945
|
-
|
|
553793
|
+
import_react130 = __toESM(require_react(), 1);
|
|
552946
553794
|
init_sessionManager();
|
|
552947
553795
|
init_contextCompressor();
|
|
552948
553796
|
init_mcpToolsManager();
|
|
@@ -556156,7 +557004,7 @@ var init_handler = __esm({
|
|
|
556156
557004
|
// node_modules/chokidar/esm/index.js
|
|
556157
557005
|
import { stat as statcb } from "fs";
|
|
556158
557006
|
import { stat as stat3, readdir as readdir4 } from "fs/promises";
|
|
556159
|
-
import { EventEmitter as
|
|
557007
|
+
import { EventEmitter as EventEmitter11 } from "events";
|
|
556160
557008
|
import * as sysPath2 from "path";
|
|
556161
557009
|
function arrify(item) {
|
|
556162
557010
|
return Array.isArray(item) ? item : [item];
|
|
@@ -556358,7 +557206,7 @@ var init_esm4 = __esm({
|
|
|
556358
557206
|
return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
|
|
556359
557207
|
}
|
|
556360
557208
|
};
|
|
556361
|
-
FSWatcher = class extends
|
|
557209
|
+
FSWatcher = class extends EventEmitter11 {
|
|
556362
557210
|
// Not indenting methods for history sake; for now.
|
|
556363
557211
|
constructor(_opts = {}) {
|
|
556364
557212
|
super();
|
|
@@ -557678,7 +558526,7 @@ var init_hookResultHandler = __esm({
|
|
|
557678
558526
|
function useChatLogic(props) {
|
|
557679
558527
|
const { t } = useI18n();
|
|
557680
558528
|
const { messages, setMessages, pendingMessages, setPendingMessages, streamingState, vscodeState, snapshotState, bashMode, yoloMode, planMode, vulnerabilityHuntingMode, saveMessage, clearSavedMessages, setRemountKey, requestToolConfirmation, requestUserQuestion, isToolAutoApproved, addMultipleToAlwaysApproved, setRestoreInputContent, setIsCompressing, setCompressionError, currentContextPercentageRef, userInterruptedRef, pendingMessagesRef, setBashSensitiveCommand, pendingUserQuestion, setPendingUserQuestion, initializeFromSession, setShowSessionPanel, setShowReviewCommitPanel, exitApp, codebaseAgentRef, setCodebaseIndexing, setCodebaseProgress, setFileUpdateNotification, setWatcherEnabled, exitingApplicationText } = props;
|
|
557681
|
-
const processMessageRef = (0,
|
|
558529
|
+
const processMessageRef = (0, import_react131.useRef)();
|
|
557682
558530
|
const handleMessageSubmit = async (message, images) => {
|
|
557683
558531
|
if (streamingState.streamStatus !== "idle") {
|
|
557684
558532
|
setPendingMessages((prev) => [...prev, { text: message, images }]);
|
|
@@ -558587,11 +559435,11 @@ Please provide your review in a clear, structured format.`;
|
|
|
558587
559435
|
rollbackViaSSE
|
|
558588
559436
|
};
|
|
558589
559437
|
}
|
|
558590
|
-
var
|
|
559438
|
+
var import_react131;
|
|
558591
559439
|
var init_useChatLogic = __esm({
|
|
558592
559440
|
async "dist/hooks/conversation/useChatLogic.js"() {
|
|
558593
559441
|
"use strict";
|
|
558594
|
-
|
|
559442
|
+
import_react131 = __toESM(require_react(), 1);
|
|
558595
559443
|
init_i18n();
|
|
558596
559444
|
init_reviewAgent();
|
|
558597
559445
|
init_sessionManager();
|
|
@@ -558608,12 +559456,12 @@ var init_useChatLogic = __esm({
|
|
|
558608
559456
|
|
|
558609
559457
|
// dist/hooks/integration/useVSCodeState.js
|
|
558610
559458
|
function useVSCodeState() {
|
|
558611
|
-
const [vscodeConnected, setVscodeConnected] = (0,
|
|
558612
|
-
const [vscodeConnectionStatus, setVscodeConnectionStatus] = (0,
|
|
558613
|
-
const [editorContext, setEditorContext] = (0,
|
|
558614
|
-
const lastStatusRef = (0,
|
|
558615
|
-
const lastEditorContextRef = (0,
|
|
558616
|
-
(0,
|
|
559459
|
+
const [vscodeConnected, setVscodeConnected] = (0, import_react132.useState)(false);
|
|
559460
|
+
const [vscodeConnectionStatus, setVscodeConnectionStatus] = (0, import_react132.useState)("disconnected");
|
|
559461
|
+
const [editorContext, setEditorContext] = (0, import_react132.useState)({});
|
|
559462
|
+
const lastStatusRef = (0, import_react132.useRef)("disconnected");
|
|
559463
|
+
const lastEditorContextRef = (0, import_react132.useRef)({});
|
|
559464
|
+
(0, import_react132.useEffect)(() => {
|
|
558617
559465
|
const checkConnectionInterval = setInterval(() => {
|
|
558618
559466
|
const isConnected = vscodeConnection.isConnected();
|
|
558619
559467
|
setVscodeConnected(isConnected);
|
|
@@ -558642,7 +559490,7 @@ function useVSCodeState() {
|
|
|
558642
559490
|
unsubscribe();
|
|
558643
559491
|
};
|
|
558644
559492
|
}, []);
|
|
558645
|
-
(0,
|
|
559493
|
+
(0, import_react132.useEffect)(() => {
|
|
558646
559494
|
if (vscodeConnectionStatus !== "connecting") {
|
|
558647
559495
|
return;
|
|
558648
559496
|
}
|
|
@@ -558669,20 +559517,20 @@ function useVSCodeState() {
|
|
|
558669
559517
|
editorContext
|
|
558670
559518
|
};
|
|
558671
559519
|
}
|
|
558672
|
-
var
|
|
559520
|
+
var import_react132;
|
|
558673
559521
|
var init_useVSCodeState = __esm({
|
|
558674
559522
|
"dist/hooks/integration/useVSCodeState.js"() {
|
|
558675
559523
|
"use strict";
|
|
558676
|
-
|
|
559524
|
+
import_react132 = __toESM(require_react(), 1);
|
|
558677
559525
|
init_vscodeConnection();
|
|
558678
559526
|
}
|
|
558679
559527
|
});
|
|
558680
559528
|
|
|
558681
559529
|
// dist/hooks/session/useSnapshotState.js
|
|
558682
559530
|
function useSnapshotState(messagesLength) {
|
|
558683
|
-
const [snapshotFileCount, setSnapshotFileCount] = (0,
|
|
558684
|
-
const [pendingRollback, setPendingRollback] = (0,
|
|
558685
|
-
(0,
|
|
559531
|
+
const [snapshotFileCount, setSnapshotFileCount] = (0, import_react133.useState)(/* @__PURE__ */ new Map());
|
|
559532
|
+
const [pendingRollback, setPendingRollback] = (0, import_react133.useState)(null);
|
|
559533
|
+
(0, import_react133.useEffect)(() => {
|
|
558686
559534
|
const loadSnapshotFileCounts = async () => {
|
|
558687
559535
|
const currentSession = sessionManager.getCurrentSession();
|
|
558688
559536
|
if (!currentSession)
|
|
@@ -558703,11 +559551,11 @@ function useSnapshotState(messagesLength) {
|
|
|
558703
559551
|
setPendingRollback
|
|
558704
559552
|
};
|
|
558705
559553
|
}
|
|
558706
|
-
var
|
|
559554
|
+
var import_react133;
|
|
558707
559555
|
var init_useSnapshotState = __esm({
|
|
558708
559556
|
"dist/hooks/session/useSnapshotState.js"() {
|
|
558709
559557
|
"use strict";
|
|
558710
|
-
|
|
559558
|
+
import_react133 = __toESM(require_react(), 1);
|
|
558711
559559
|
init_sessionManager();
|
|
558712
559560
|
init_hashBasedSnapshot();
|
|
558713
559561
|
}
|
|
@@ -558715,7 +559563,7 @@ var init_useSnapshotState = __esm({
|
|
|
558715
559563
|
|
|
558716
559564
|
// dist/hooks/conversation/useStreamingState.js
|
|
558717
559565
|
function useStreamingState() {
|
|
558718
|
-
const [streamStatus, setStreamStatus] = (0,
|
|
559566
|
+
const [streamStatus, setStreamStatus] = (0, import_react134.useState)("idle");
|
|
558719
559567
|
const isStreaming = streamStatus === "streaming";
|
|
558720
559568
|
const isStopping = streamStatus === "stopping";
|
|
558721
559569
|
const setIsStreaming = (action) => {
|
|
@@ -558738,17 +559586,17 @@ function useStreamingState() {
|
|
|
558738
559586
|
return prev;
|
|
558739
559587
|
});
|
|
558740
559588
|
};
|
|
558741
|
-
const [streamTokenCount, setStreamTokenCount] = (0,
|
|
558742
|
-
const [isReasoning, setIsReasoning] = (0,
|
|
558743
|
-
const [abortController, setAbortController] = (0,
|
|
558744
|
-
const [contextUsage, setContextUsage] = (0,
|
|
558745
|
-
const [elapsedSeconds, setElapsedSeconds] = (0,
|
|
558746
|
-
const [timerStartTime, setTimerStartTime] = (0,
|
|
558747
|
-
const [retryStatus, setRetryStatus] = (0,
|
|
558748
|
-
const [animationFrame, setAnimationFrame] = (0,
|
|
558749
|
-
const [codebaseSearchStatus, setCodebaseSearchStatus] = (0,
|
|
558750
|
-
const [currentModel, setCurrentModel] = (0,
|
|
558751
|
-
(0,
|
|
559589
|
+
const [streamTokenCount, setStreamTokenCount] = (0, import_react134.useState)(0);
|
|
559590
|
+
const [isReasoning, setIsReasoning] = (0, import_react134.useState)(false);
|
|
559591
|
+
const [abortController, setAbortController] = (0, import_react134.useState)(null);
|
|
559592
|
+
const [contextUsage, setContextUsage] = (0, import_react134.useState)(null);
|
|
559593
|
+
const [elapsedSeconds, setElapsedSeconds] = (0, import_react134.useState)(0);
|
|
559594
|
+
const [timerStartTime, setTimerStartTime] = (0, import_react134.useState)(null);
|
|
559595
|
+
const [retryStatus, setRetryStatus] = (0, import_react134.useState)(null);
|
|
559596
|
+
const [animationFrame, setAnimationFrame] = (0, import_react134.useState)(0);
|
|
559597
|
+
const [codebaseSearchStatus, setCodebaseSearchStatus] = (0, import_react134.useState)(null);
|
|
559598
|
+
const [currentModel, setCurrentModel] = (0, import_react134.useState)(null);
|
|
559599
|
+
(0, import_react134.useEffect)(() => {
|
|
558752
559600
|
if (!isStreaming)
|
|
558753
559601
|
return;
|
|
558754
559602
|
const interval = setInterval(() => {
|
|
@@ -558759,7 +559607,7 @@ function useStreamingState() {
|
|
|
558759
559607
|
setAnimationFrame(0);
|
|
558760
559608
|
};
|
|
558761
559609
|
}, [isStreaming]);
|
|
558762
|
-
(0,
|
|
559610
|
+
(0, import_react134.useEffect)(() => {
|
|
558763
559611
|
if (isStreaming && timerStartTime === null) {
|
|
558764
559612
|
setTimerStartTime(Date.now());
|
|
558765
559613
|
setElapsedSeconds(0);
|
|
@@ -558767,7 +559615,7 @@ function useStreamingState() {
|
|
|
558767
559615
|
setTimerStartTime(null);
|
|
558768
559616
|
}
|
|
558769
559617
|
}, [isStreaming, timerStartTime]);
|
|
558770
|
-
(0,
|
|
559618
|
+
(0, import_react134.useEffect)(() => {
|
|
558771
559619
|
if (timerStartTime === null)
|
|
558772
559620
|
return;
|
|
558773
559621
|
const interval = setInterval(() => {
|
|
@@ -558776,7 +559624,7 @@ function useStreamingState() {
|
|
|
558776
559624
|
}, 1e3);
|
|
558777
559625
|
return () => clearInterval(interval);
|
|
558778
559626
|
}, [timerStartTime]);
|
|
558779
|
-
(0,
|
|
559627
|
+
(0, import_react134.useEffect)(() => {
|
|
558780
559628
|
if (!(retryStatus == null ? void 0 : retryStatus.isRetrying))
|
|
558781
559629
|
return;
|
|
558782
559630
|
if (retryStatus.remainingSeconds !== void 0)
|
|
@@ -558786,7 +559634,7 @@ function useStreamingState() {
|
|
|
558786
559634
|
remainingSeconds: Math.ceil(prev.nextDelay / 1e3)
|
|
558787
559635
|
} : null);
|
|
558788
559636
|
}, [retryStatus == null ? void 0 : retryStatus.isRetrying]);
|
|
558789
|
-
(0,
|
|
559637
|
+
(0, import_react134.useEffect)(() => {
|
|
558790
559638
|
if (!retryStatus || !retryStatus.isRetrying)
|
|
558791
559639
|
return;
|
|
558792
559640
|
if (retryStatus.remainingSeconds === void 0)
|
|
@@ -558835,37 +559683,38 @@ function useStreamingState() {
|
|
|
558835
559683
|
setCurrentModel
|
|
558836
559684
|
};
|
|
558837
559685
|
}
|
|
558838
|
-
var
|
|
559686
|
+
var import_react134;
|
|
558839
559687
|
var init_useStreamingState = __esm({
|
|
558840
559688
|
"dist/hooks/conversation/useStreamingState.js"() {
|
|
558841
559689
|
"use strict";
|
|
558842
|
-
|
|
559690
|
+
import_react134 = __toESM(require_react(), 1);
|
|
558843
559691
|
}
|
|
558844
559692
|
});
|
|
558845
559693
|
|
|
558846
559694
|
// dist/hooks/ui/usePanelState.js
|
|
558847
559695
|
function usePanelState() {
|
|
558848
|
-
const [showSessionPanel, setShowSessionPanel] = (0,
|
|
558849
|
-
const [showMcpPanel, setShowMcpPanel] = (0,
|
|
558850
|
-
const [showUsagePanel, setShowUsagePanel] = (0,
|
|
558851
|
-
const [showCustomCommandConfig, setShowCustomCommandConfig] = (0,
|
|
558852
|
-
const [showSkillsCreation, setShowSkillsCreation] = (0,
|
|
558853
|
-
const [showRoleCreation, setShowRoleCreation] = (0,
|
|
558854
|
-
const [showRoleDeletion, setShowRoleDeletion] = (0,
|
|
558855
|
-
const [showRoleList, setShowRoleList] = (0,
|
|
558856
|
-
const [showWorkingDirPanel, setShowWorkingDirPanel] = (0,
|
|
558857
|
-
const [showReviewCommitPanel, setShowReviewCommitPanel] = (0,
|
|
558858
|
-
const [showProfilePanel, setShowProfilePanel] = (0,
|
|
558859
|
-
const [
|
|
558860
|
-
const [
|
|
558861
|
-
const [
|
|
559696
|
+
const [showSessionPanel, setShowSessionPanel] = (0, import_react135.useState)(false);
|
|
559697
|
+
const [showMcpPanel, setShowMcpPanel] = (0, import_react135.useState)(false);
|
|
559698
|
+
const [showUsagePanel, setShowUsagePanel] = (0, import_react135.useState)(false);
|
|
559699
|
+
const [showCustomCommandConfig, setShowCustomCommandConfig] = (0, import_react135.useState)(false);
|
|
559700
|
+
const [showSkillsCreation, setShowSkillsCreation] = (0, import_react135.useState)(false);
|
|
559701
|
+
const [showRoleCreation, setShowRoleCreation] = (0, import_react135.useState)(false);
|
|
559702
|
+
const [showRoleDeletion, setShowRoleDeletion] = (0, import_react135.useState)(false);
|
|
559703
|
+
const [showRoleList, setShowRoleList] = (0, import_react135.useState)(false);
|
|
559704
|
+
const [showWorkingDirPanel, setShowWorkingDirPanel] = (0, import_react135.useState)(false);
|
|
559705
|
+
const [showReviewCommitPanel, setShowReviewCommitPanel] = (0, import_react135.useState)(false);
|
|
559706
|
+
const [showProfilePanel, setShowProfilePanel] = (0, import_react135.useState)(false);
|
|
559707
|
+
const [showModelsPanel, setShowModelsPanel] = (0, import_react135.useState)(false);
|
|
559708
|
+
const [profileSelectedIndex, setProfileSelectedIndex] = (0, import_react135.useState)(0);
|
|
559709
|
+
const [profileSearchQuery, setProfileSearchQuery] = (0, import_react135.useState)("");
|
|
559710
|
+
const [currentProfileName, setCurrentProfileName] = (0, import_react135.useState)(() => {
|
|
558862
559711
|
const profiles = getAllProfiles();
|
|
558863
559712
|
const activeName = getActiveProfileName();
|
|
558864
559713
|
const profile = profiles.find((p) => p.name === activeName);
|
|
558865
559714
|
return (profile == null ? void 0 : profile.displayName) || activeName;
|
|
558866
559715
|
});
|
|
558867
559716
|
const handleSwitchProfile = (options3) => {
|
|
558868
|
-
if (showSessionPanel || showMcpPanel || showUsagePanel || showCustomCommandConfig || showSkillsCreation || showRoleCreation || showRoleDeletion || showRoleList || showReviewCommitPanel || showProfilePanel || options3.hasPendingRollback || options3.hasPendingToolConfirmation || options3.hasPendingUserQuestion || options3.isStreaming) {
|
|
559717
|
+
if (showSessionPanel || showMcpPanel || showUsagePanel || showCustomCommandConfig || showSkillsCreation || showRoleCreation || showRoleDeletion || showRoleList || showReviewCommitPanel || showProfilePanel || showModelsPanel || options3.hasPendingRollback || options3.hasPendingToolConfirmation || options3.hasPendingUserQuestion || options3.isStreaming) {
|
|
558869
559718
|
return;
|
|
558870
559719
|
}
|
|
558871
559720
|
setShowProfilePanel(true);
|
|
@@ -558926,10 +559775,13 @@ function usePanelState() {
|
|
|
558926
559775
|
setShowProfilePanel(false);
|
|
558927
559776
|
return true;
|
|
558928
559777
|
}
|
|
559778
|
+
if (showModelsPanel) {
|
|
559779
|
+
return false;
|
|
559780
|
+
}
|
|
558929
559781
|
return false;
|
|
558930
559782
|
};
|
|
558931
559783
|
const isAnyPanelOpen = () => {
|
|
558932
|
-
return showSessionPanel || showMcpPanel || showUsagePanel || showCustomCommandConfig || showSkillsCreation || showRoleCreation || showRoleDeletion || showRoleList || showWorkingDirPanel || showReviewCommitPanel || showProfilePanel;
|
|
559784
|
+
return showSessionPanel || showMcpPanel || showUsagePanel || showCustomCommandConfig || showSkillsCreation || showRoleCreation || showRoleDeletion || showRoleList || showWorkingDirPanel || showReviewCommitPanel || showProfilePanel || showModelsPanel;
|
|
558933
559785
|
};
|
|
558934
559786
|
return {
|
|
558935
559787
|
// State
|
|
@@ -558944,6 +559796,7 @@ function usePanelState() {
|
|
|
558944
559796
|
showWorkingDirPanel,
|
|
558945
559797
|
showReviewCommitPanel,
|
|
558946
559798
|
showProfilePanel,
|
|
559799
|
+
showModelsPanel,
|
|
558947
559800
|
profileSelectedIndex,
|
|
558948
559801
|
profileSearchQuery,
|
|
558949
559802
|
currentProfileName,
|
|
@@ -558959,6 +559812,7 @@ function usePanelState() {
|
|
|
558959
559812
|
setShowWorkingDirPanel,
|
|
558960
559813
|
setShowReviewCommitPanel,
|
|
558961
559814
|
setShowProfilePanel,
|
|
559815
|
+
setShowModelsPanel,
|
|
558962
559816
|
setProfileSelectedIndex,
|
|
558963
559817
|
setProfileSearchQuery,
|
|
558964
559818
|
handleSwitchProfile,
|
|
@@ -558967,11 +559821,11 @@ function usePanelState() {
|
|
|
558967
559821
|
isAnyPanelOpen
|
|
558968
559822
|
};
|
|
558969
559823
|
}
|
|
558970
|
-
var
|
|
559824
|
+
var import_react135;
|
|
558971
559825
|
var init_usePanelState = __esm({
|
|
558972
559826
|
"dist/hooks/ui/usePanelState.js"() {
|
|
558973
559827
|
"use strict";
|
|
558974
|
-
|
|
559828
|
+
import_react135 = __toESM(require_react(), 1);
|
|
558975
559829
|
init_apiConfig();
|
|
558976
559830
|
init_configManager();
|
|
558977
559831
|
}
|
|
@@ -558986,14 +559840,14 @@ function PermissionsPanel({ alwaysApprovedTools, onRemoveTool, onClearAll, onClo
|
|
|
558986
559840
|
const { t } = useI18n();
|
|
558987
559841
|
const { theme: theme14 } = useTheme();
|
|
558988
559842
|
const messages = t.permissionsPanel ?? {};
|
|
558989
|
-
const tools = (0,
|
|
558990
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
558991
|
-
const [confirmTarget, setConfirmTarget] = (0,
|
|
558992
|
-
const [confirmOption, setConfirmOption] = (0,
|
|
559843
|
+
const tools = (0, import_react136.useMemo)(() => Array.from(alwaysApprovedTools).sort((a, b) => a.localeCompare(b)), [alwaysApprovedTools]);
|
|
559844
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react136.useState)(0);
|
|
559845
|
+
const [confirmTarget, setConfirmTarget] = (0, import_react136.useState)(null);
|
|
559846
|
+
const [confirmOption, setConfirmOption] = (0, import_react136.useState)(0);
|
|
558993
559847
|
const hasTools = tools.length > 0;
|
|
558994
559848
|
const clearAllIndex = hasTools ? tools.length : -1;
|
|
558995
559849
|
const optionCount = hasTools ? tools.length + 1 : 0;
|
|
558996
|
-
(0,
|
|
559850
|
+
(0, import_react136.useEffect)(() => {
|
|
558997
559851
|
if (optionCount === 0) {
|
|
558998
559852
|
setSelectedIndex(0);
|
|
558999
559853
|
return;
|
|
@@ -559002,11 +559856,11 @@ function PermissionsPanel({ alwaysApprovedTools, onRemoveTool, onClearAll, onClo
|
|
|
559002
559856
|
setSelectedIndex(optionCount - 1);
|
|
559003
559857
|
}
|
|
559004
559858
|
}, [optionCount, selectedIndex]);
|
|
559005
|
-
(0,
|
|
559859
|
+
(0, import_react136.useEffect)(() => {
|
|
559006
559860
|
setConfirmTarget(null);
|
|
559007
559861
|
setConfirmOption(0);
|
|
559008
559862
|
}, [alwaysApprovedTools]);
|
|
559009
|
-
const handleInput = (0,
|
|
559863
|
+
const handleInput = (0, import_react136.useCallback)((_3, key) => {
|
|
559010
559864
|
if (confirmTarget !== null) {
|
|
559011
559865
|
if (key.escape) {
|
|
559012
559866
|
setConfirmTarget(null);
|
|
@@ -559085,30 +559939,30 @@ function PermissionsPanel({ alwaysApprovedTools, onRemoveTool, onClearAll, onClo
|
|
|
559085
559939
|
if (confirmTarget !== null) {
|
|
559086
559940
|
const isConfirmingClearAll = confirmTarget === "clearAll";
|
|
559087
559941
|
const toolName = getConfirmingToolName();
|
|
559088
|
-
return
|
|
559942
|
+
return import_react136.default.createElement(
|
|
559089
559943
|
Box_default,
|
|
559090
559944
|
{ flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1 },
|
|
559091
|
-
|
|
559092
|
-
!isConfirmingClearAll && toolName &&
|
|
559945
|
+
import_react136.default.createElement(Text, { color: "red", bold: true }, isConfirmingClearAll ? messages.confirmClearAll ?? "Clear all permissions?" : messages.confirmDelete ?? "Delete allowed tool?"),
|
|
559946
|
+
!isConfirmingClearAll && toolName && import_react136.default.createElement(
|
|
559093
559947
|
Box_default,
|
|
559094
559948
|
{ marginTop: 1, flexDirection: "column" },
|
|
559095
|
-
|
|
559949
|
+
import_react136.default.createElement(
|
|
559096
559950
|
Text,
|
|
559097
559951
|
{ color: "white", bold: true },
|
|
559098
559952
|
" ",
|
|
559099
559953
|
toolName
|
|
559100
559954
|
)
|
|
559101
559955
|
),
|
|
559102
|
-
|
|
559956
|
+
import_react136.default.createElement(
|
|
559103
559957
|
Box_default,
|
|
559104
559958
|
{ marginTop: 1, flexDirection: "column" },
|
|
559105
|
-
|
|
559959
|
+
import_react136.default.createElement(
|
|
559106
559960
|
Text,
|
|
559107
559961
|
{ color: confirmOption === 0 ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: confirmOption === 0 },
|
|
559108
559962
|
confirmOption === 0 ? "\u276F " : " ",
|
|
559109
559963
|
messages.yes ?? "Yes"
|
|
559110
559964
|
),
|
|
559111
|
-
|
|
559965
|
+
import_react136.default.createElement(
|
|
559112
559966
|
Text,
|
|
559113
559967
|
{ color: confirmOption === 1 ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: confirmOption === 1 },
|
|
559114
559968
|
confirmOption === 1 ? "\u276F " : " ",
|
|
@@ -559117,49 +559971,49 @@ function PermissionsPanel({ alwaysApprovedTools, onRemoveTool, onClearAll, onClo
|
|
|
559117
559971
|
)
|
|
559118
559972
|
);
|
|
559119
559973
|
}
|
|
559120
|
-
return
|
|
559974
|
+
return import_react136.default.createElement(
|
|
559121
559975
|
Box_default,
|
|
559122
559976
|
{ flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1 },
|
|
559123
|
-
|
|
559124
|
-
hasTools ?
|
|
559977
|
+
import_react136.default.createElement(Text, { color: "cyan", bold: true }, messages.title ?? "Permissions"),
|
|
559978
|
+
hasTools ? import_react136.default.createElement(
|
|
559125
559979
|
Box_default,
|
|
559126
559980
|
{ flexDirection: "column", marginTop: 1 },
|
|
559127
559981
|
tools.map((tool, index) => {
|
|
559128
559982
|
const isSelected = index === selectedIndex;
|
|
559129
|
-
return
|
|
559983
|
+
return import_react136.default.createElement(
|
|
559130
559984
|
Text,
|
|
559131
559985
|
{ key: tool, color: isSelected ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: isSelected },
|
|
559132
559986
|
isSelected ? "\u276F " : " ",
|
|
559133
559987
|
tool
|
|
559134
559988
|
);
|
|
559135
559989
|
}),
|
|
559136
|
-
|
|
559990
|
+
import_react136.default.createElement(
|
|
559137
559991
|
Box_default,
|
|
559138
559992
|
{ marginTop: 1 },
|
|
559139
|
-
|
|
559993
|
+
import_react136.default.createElement(
|
|
559140
559994
|
Text,
|
|
559141
559995
|
{ color: selectedIndex === clearAllIndex ? theme14.colors.warning : theme14.colors.menuSecondary, bold: selectedIndex === clearAllIndex },
|
|
559142
559996
|
selectedIndex === clearAllIndex ? "\u276F " : " ",
|
|
559143
559997
|
messages.clearAll ?? "Clear All"
|
|
559144
559998
|
)
|
|
559145
559999
|
)
|
|
559146
|
-
) :
|
|
560000
|
+
) : import_react136.default.createElement(
|
|
559147
560001
|
Box_default,
|
|
559148
560002
|
{ marginTop: 1 },
|
|
559149
|
-
|
|
560003
|
+
import_react136.default.createElement(Text, { color: "gray", dimColor: true }, messages.noTools ?? "No tools are always approved")
|
|
559150
560004
|
),
|
|
559151
|
-
|
|
560005
|
+
import_react136.default.createElement(
|
|
559152
560006
|
Box_default,
|
|
559153
560007
|
{ marginTop: 1 },
|
|
559154
|
-
|
|
560008
|
+
import_react136.default.createElement(Text, { color: "gray", dimColor: true }, messages.hint ?? "\u2191\u2193 navigate \u2022 Enter remove \u2022 ESC close")
|
|
559155
560009
|
)
|
|
559156
560010
|
);
|
|
559157
560011
|
}
|
|
559158
|
-
var
|
|
560012
|
+
var import_react136;
|
|
559159
560013
|
var init_PermissionsPanel = __esm({
|
|
559160
560014
|
async "dist/ui/components/panels/PermissionsPanel.js"() {
|
|
559161
560015
|
"use strict";
|
|
559162
|
-
|
|
560016
|
+
import_react136 = __toESM(require_react(), 1);
|
|
559163
560017
|
await init_build2();
|
|
559164
560018
|
init_i18n();
|
|
559165
560019
|
init_ThemeContext();
|
|
@@ -559300,6 +560154,29 @@ var init_backend = __esm({
|
|
|
559300
560154
|
}
|
|
559301
560155
|
});
|
|
559302
560156
|
|
|
560157
|
+
// dist/utils/commands/models.js
|
|
560158
|
+
var models_exports = {};
|
|
560159
|
+
__export(models_exports, {
|
|
560160
|
+
default: () => models_default
|
|
560161
|
+
});
|
|
560162
|
+
var models_default;
|
|
560163
|
+
var init_models2 = __esm({
|
|
560164
|
+
"dist/utils/commands/models.js"() {
|
|
560165
|
+
"use strict";
|
|
560166
|
+
init_commandExecutor();
|
|
560167
|
+
registerCommand("models", {
|
|
560168
|
+
execute: () => {
|
|
560169
|
+
return {
|
|
560170
|
+
success: true,
|
|
560171
|
+
action: "showModelsPanel",
|
|
560172
|
+
message: "Opening model switching panel"
|
|
560173
|
+
};
|
|
560174
|
+
}
|
|
560175
|
+
});
|
|
560176
|
+
models_default = {};
|
|
560177
|
+
}
|
|
560178
|
+
});
|
|
560179
|
+
|
|
559303
560180
|
// dist/ui/pages/ChatScreen.js
|
|
559304
560181
|
var ChatScreen_exports = {};
|
|
559305
560182
|
__export(ChatScreen_exports, {
|
|
@@ -559309,21 +560186,21 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559309
560186
|
const { t } = useI18n();
|
|
559310
560187
|
const { theme: theme14 } = useTheme();
|
|
559311
560188
|
const { exit } = use_app_default();
|
|
559312
|
-
const [messages, setMessages] = (0,
|
|
559313
|
-
const [isSaving] = (0,
|
|
559314
|
-
const [pendingMessages, setPendingMessages] = (0,
|
|
559315
|
-
const pendingMessagesRef = (0,
|
|
559316
|
-
const hasAttemptedAutoVscodeConnect = (0,
|
|
559317
|
-
const userInterruptedRef = (0,
|
|
559318
|
-
const [remountKey, setRemountKey] = (0,
|
|
559319
|
-
const [currentContextPercentage, setCurrentContextPercentage] = (0,
|
|
559320
|
-
const currentContextPercentageRef = (0,
|
|
559321
|
-
const [isExecutingTerminalCommand, setIsExecutingTerminalCommand] = (0,
|
|
559322
|
-
const [customCommandExecution, setCustomCommandExecution] = (0,
|
|
559323
|
-
(0,
|
|
560189
|
+
const [messages, setMessages] = (0, import_react137.useState)([]);
|
|
560190
|
+
const [isSaving] = (0, import_react137.useState)(false);
|
|
560191
|
+
const [pendingMessages, setPendingMessages] = (0, import_react137.useState)([]);
|
|
560192
|
+
const pendingMessagesRef = (0, import_react137.useRef)([]);
|
|
560193
|
+
const hasAttemptedAutoVscodeConnect = (0, import_react137.useRef)(false);
|
|
560194
|
+
const userInterruptedRef = (0, import_react137.useRef)(false);
|
|
560195
|
+
const [remountKey, setRemountKey] = (0, import_react137.useState)(0);
|
|
560196
|
+
const [currentContextPercentage, setCurrentContextPercentage] = (0, import_react137.useState)(0);
|
|
560197
|
+
const currentContextPercentageRef = (0, import_react137.useRef)(0);
|
|
560198
|
+
const [isExecutingTerminalCommand, setIsExecutingTerminalCommand] = (0, import_react137.useState)(false);
|
|
560199
|
+
const [customCommandExecution, setCustomCommandExecution] = (0, import_react137.useState)(null);
|
|
560200
|
+
(0, import_react137.useEffect)(() => {
|
|
559324
560201
|
currentContextPercentageRef.current = currentContextPercentage;
|
|
559325
560202
|
}, [currentContextPercentage]);
|
|
559326
|
-
const [yoloMode, setYoloMode] = (0,
|
|
560203
|
+
const [yoloMode, setYoloMode] = (0, import_react137.useState)(() => {
|
|
559327
560204
|
if (enableYolo !== void 0) {
|
|
559328
560205
|
return enableYolo;
|
|
559329
560206
|
}
|
|
@@ -559334,7 +560211,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559334
560211
|
return false;
|
|
559335
560212
|
}
|
|
559336
560213
|
});
|
|
559337
|
-
const [planMode, setPlanMode] = (0,
|
|
560214
|
+
const [planMode, setPlanMode] = (0, import_react137.useState)(() => {
|
|
559338
560215
|
if (enablePlan !== void 0) {
|
|
559339
560216
|
return enablePlan;
|
|
559340
560217
|
}
|
|
@@ -559345,7 +560222,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559345
560222
|
return false;
|
|
559346
560223
|
}
|
|
559347
560224
|
});
|
|
559348
|
-
const [vulnerabilityHuntingMode, setVulnerabilityHuntingMode] = (0,
|
|
560225
|
+
const [vulnerabilityHuntingMode, setVulnerabilityHuntingMode] = (0, import_react137.useState)(() => {
|
|
559349
560226
|
try {
|
|
559350
560227
|
const saved = localStorage.getItem("snow-vulnerability-hunting-mode");
|
|
559351
560228
|
return saved === "true";
|
|
@@ -559353,33 +560230,36 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559353
560230
|
return false;
|
|
559354
560231
|
}
|
|
559355
560232
|
});
|
|
559356
|
-
const [simpleMode, setSimpleMode2] = (0,
|
|
560233
|
+
const [simpleMode, setSimpleMode2] = (0, import_react137.useState)(() => {
|
|
559357
560234
|
return getSimpleMode();
|
|
559358
560235
|
});
|
|
559359
|
-
const [showThinking,
|
|
560236
|
+
const [showThinking, setShowThinking] = (0, import_react137.useState)(() => {
|
|
559360
560237
|
const config3 = getOpenAiConfig();
|
|
559361
560238
|
return config3.showThinking !== false;
|
|
559362
560239
|
});
|
|
559363
|
-
const [isCompressing, setIsCompressing] = (0,
|
|
559364
|
-
const [compressionError, setCompressionError] = (0,
|
|
559365
|
-
const [showPermissionsPanel, setShowPermissionsPanel] = (0,
|
|
559366
|
-
const [restoreInputContent, setRestoreInputContent] = (0,
|
|
559367
|
-
const [bashSensitiveCommand, setBashSensitiveCommand] = (0,
|
|
559368
|
-
const [suppressLoadingIndicator, setSuppressLoadingIndicator] = (0,
|
|
559369
|
-
const hadBashSensitiveCommandRef = (0,
|
|
559370
|
-
const [hookError, setHookError] = (0,
|
|
560240
|
+
const [isCompressing, setIsCompressing] = (0, import_react137.useState)(false);
|
|
560241
|
+
const [compressionError, setCompressionError] = (0, import_react137.useState)(null);
|
|
560242
|
+
const [showPermissionsPanel, setShowPermissionsPanel] = (0, import_react137.useState)(false);
|
|
560243
|
+
const [restoreInputContent, setRestoreInputContent] = (0, import_react137.useState)(null);
|
|
560244
|
+
const [bashSensitiveCommand, setBashSensitiveCommand] = (0, import_react137.useState)(null);
|
|
560245
|
+
const [suppressLoadingIndicator, setSuppressLoadingIndicator] = (0, import_react137.useState)(false);
|
|
560246
|
+
const hadBashSensitiveCommandRef = (0, import_react137.useRef)(false);
|
|
560247
|
+
const [hookError, setHookError] = (0, import_react137.useState)(null);
|
|
559371
560248
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
559372
560249
|
const { stdout } = use_stdout_default();
|
|
559373
560250
|
const workingDirectory = process.cwd();
|
|
559374
|
-
const
|
|
559375
|
-
const
|
|
559376
|
-
const
|
|
559377
|
-
const
|
|
559378
|
-
const [
|
|
559379
|
-
const
|
|
560251
|
+
const apiConfig = getOpenAiConfig();
|
|
560252
|
+
const advancedModel = apiConfig.advancedModel || "";
|
|
560253
|
+
const basicModel = apiConfig.basicModel || "";
|
|
560254
|
+
const isInitialMount = (0, import_react137.useRef)(true);
|
|
560255
|
+
const [codebaseIndexing, setCodebaseIndexing] = (0, import_react137.useState)(false);
|
|
560256
|
+
const [codebaseProgress, setCodebaseProgress] = (0, import_react137.useState)(null);
|
|
560257
|
+
const [watcherEnabled, setWatcherEnabled] = (0, import_react137.useState)(false);
|
|
560258
|
+
const [fileUpdateNotification, setFileUpdateNotification] = (0, import_react137.useState)(null);
|
|
560259
|
+
const codebaseAgentRef = (0, import_react137.useRef)(null);
|
|
559380
560260
|
useCursorHide();
|
|
559381
560261
|
const streamingState = useStreamingState();
|
|
559382
|
-
(0,
|
|
560262
|
+
(0, import_react137.useEffect)(() => {
|
|
559383
560263
|
const hasPanel = !!bashSensitiveCommand;
|
|
559384
560264
|
const hadPanel = hadBashSensitiveCommandRef.current;
|
|
559385
560265
|
hadBashSensitiveCommandRef.current = hasPanel;
|
|
@@ -559403,8 +560283,8 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559403
560283
|
const backgroundProcesses = useBackgroundProcesses();
|
|
559404
560284
|
const panelState = usePanelState();
|
|
559405
560285
|
const { hasFocus } = useTerminalFocus();
|
|
559406
|
-
const [selectedProcessIndex, setSelectedProcessIndex] = (0,
|
|
559407
|
-
const sortedBackgroundProcesses = (0,
|
|
560286
|
+
const [selectedProcessIndex, setSelectedProcessIndex] = (0, import_react137.useState)(0);
|
|
560287
|
+
const sortedBackgroundProcesses = (0, import_react137.useMemo)(() => {
|
|
559408
560288
|
return [...backgroundProcesses.processes].sort((a, b) => {
|
|
559409
560289
|
if (a.status === "running" && b.status !== "running")
|
|
559410
560290
|
return -1;
|
|
@@ -559413,17 +560293,17 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559413
560293
|
return b.startedAt.getTime() - a.startedAt.getTime();
|
|
559414
560294
|
});
|
|
559415
560295
|
}, [backgroundProcesses.processes]);
|
|
559416
|
-
(0,
|
|
560296
|
+
(0, import_react137.useEffect)(() => {
|
|
559417
560297
|
if (sortedBackgroundProcesses.length > 0 && selectedProcessIndex >= sortedBackgroundProcesses.length) {
|
|
559418
560298
|
setSelectedProcessIndex(sortedBackgroundProcesses.length - 1);
|
|
559419
560299
|
}
|
|
559420
560300
|
}, [sortedBackgroundProcesses.length, selectedProcessIndex]);
|
|
559421
560301
|
const { saveMessage, clearSavedMessages, initializeFromSession } = useSessionSave();
|
|
559422
|
-
(0,
|
|
560302
|
+
(0, import_react137.useEffect)(() => {
|
|
559423
560303
|
pendingMessagesRef.current = pendingMessages;
|
|
559424
560304
|
}, [pendingMessages]);
|
|
559425
|
-
const [commandsLoaded, setCommandsLoaded] = (0,
|
|
559426
|
-
(0,
|
|
560305
|
+
const [commandsLoaded, setCommandsLoaded] = (0, import_react137.useState)(false);
|
|
560306
|
+
(0, import_react137.useEffect)(() => {
|
|
559427
560307
|
Promise.all([
|
|
559428
560308
|
Promise.resolve().then(() => (init_clear(), clear_exports)),
|
|
559429
560309
|
Promise.resolve().then(() => (init_profiles(), profiles_exports)),
|
|
@@ -559449,7 +560329,8 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559449
560329
|
Promise.resolve().then(() => (init_codebase(), codebase_exports)),
|
|
559450
560330
|
Promise.resolve().then(() => (init_addDir(), addDir_exports)),
|
|
559451
560331
|
Promise.resolve().then(() => (init_permissions(), permissions_exports)),
|
|
559452
|
-
Promise.resolve().then(() => (init_backend(), backend_exports))
|
|
560332
|
+
Promise.resolve().then(() => (init_backend(), backend_exports)),
|
|
560333
|
+
Promise.resolve().then(() => (init_models2(), models_exports))
|
|
559453
560334
|
]).then(async () => {
|
|
559454
560335
|
await registerCustomCommands(workingDirectory);
|
|
559455
560336
|
setCommandsLoaded(true);
|
|
@@ -559458,7 +560339,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559458
560339
|
setCommandsLoaded(true);
|
|
559459
560340
|
});
|
|
559460
560341
|
}, []);
|
|
559461
|
-
(0,
|
|
560342
|
+
(0, import_react137.useEffect)(() => {
|
|
559462
560343
|
const startCodebaseIndexing = async () => {
|
|
559463
560344
|
try {
|
|
559464
560345
|
const config3 = loadCodebaseConfig();
|
|
@@ -559597,7 +560478,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559597
560478
|
}
|
|
559598
560479
|
};
|
|
559599
560480
|
}, []);
|
|
559600
|
-
(0,
|
|
560481
|
+
(0, import_react137.useEffect)(() => {
|
|
559601
560482
|
global.__stopCodebaseIndexing = async () => {
|
|
559602
560483
|
if (codebaseAgentRef.current) {
|
|
559603
560484
|
await codebaseAgentRef.current.stop();
|
|
@@ -559608,25 +560489,25 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559608
560489
|
delete global.__stopCodebaseIndexing;
|
|
559609
560490
|
};
|
|
559610
560491
|
}, []);
|
|
559611
|
-
(0,
|
|
560492
|
+
(0, import_react137.useEffect)(() => {
|
|
559612
560493
|
try {
|
|
559613
560494
|
localStorage.setItem("snow-yolo-mode", String(yoloMode));
|
|
559614
560495
|
} catch {
|
|
559615
560496
|
}
|
|
559616
560497
|
}, [yoloMode]);
|
|
559617
|
-
(0,
|
|
560498
|
+
(0, import_react137.useEffect)(() => {
|
|
559618
560499
|
try {
|
|
559619
560500
|
localStorage.setItem("snow-plan-mode", String(planMode));
|
|
559620
560501
|
} catch {
|
|
559621
560502
|
}
|
|
559622
560503
|
}, [planMode]);
|
|
559623
|
-
(0,
|
|
560504
|
+
(0, import_react137.useEffect)(() => {
|
|
559624
560505
|
try {
|
|
559625
560506
|
localStorage.setItem("snow-vulnerability-hunting-mode", String(vulnerabilityHuntingMode));
|
|
559626
560507
|
} catch {
|
|
559627
560508
|
}
|
|
559628
560509
|
}, [vulnerabilityHuntingMode]);
|
|
559629
|
-
(0,
|
|
560510
|
+
(0, import_react137.useEffect)(() => {
|
|
559630
560511
|
const interval = setInterval(() => {
|
|
559631
560512
|
const currentSimpleMode = getSimpleMode();
|
|
559632
560513
|
if (currentSimpleMode !== simpleMode) {
|
|
@@ -559635,7 +560516,18 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559635
560516
|
}, 1e3);
|
|
559636
560517
|
return () => clearInterval(interval);
|
|
559637
560518
|
}, [simpleMode]);
|
|
559638
|
-
(0,
|
|
560519
|
+
(0, import_react137.useEffect)(() => {
|
|
560520
|
+
const handleConfigChange = (event) => {
|
|
560521
|
+
if (event.type === "showThinking") {
|
|
560522
|
+
setShowThinking(event.value);
|
|
560523
|
+
}
|
|
560524
|
+
};
|
|
560525
|
+
configEvents.onConfigChange(handleConfigChange);
|
|
560526
|
+
return () => {
|
|
560527
|
+
configEvents.removeConfigChangeListener(handleConfigChange);
|
|
560528
|
+
};
|
|
560529
|
+
}, []);
|
|
560530
|
+
(0, import_react137.useEffect)(() => {
|
|
559639
560531
|
if (restoreInputContent !== null) {
|
|
559640
560532
|
const timer2 = setTimeout(() => {
|
|
559641
560533
|
setRestoreInputContent(null);
|
|
@@ -559644,7 +560536,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559644
560536
|
}
|
|
559645
560537
|
return void 0;
|
|
559646
560538
|
}, [restoreInputContent]);
|
|
559647
|
-
(0,
|
|
560539
|
+
(0, import_react137.useEffect)(() => {
|
|
559648
560540
|
if (!autoResume) {
|
|
559649
560541
|
sessionManager.clearCurrentSession();
|
|
559650
560542
|
return;
|
|
@@ -559669,7 +560561,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559669
560561
|
};
|
|
559670
560562
|
resumeSession();
|
|
559671
560563
|
}, [autoResume, initializeFromSession]);
|
|
559672
|
-
(0,
|
|
560564
|
+
(0, import_react137.useEffect)(() => {
|
|
559673
560565
|
if (isInitialMount.current) {
|
|
559674
560566
|
isInitialMount.current = false;
|
|
559675
560567
|
return;
|
|
@@ -559682,7 +560574,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559682
560574
|
clearTimeout(handler);
|
|
559683
560575
|
};
|
|
559684
560576
|
}, [terminalWidth]);
|
|
559685
|
-
(0,
|
|
560577
|
+
(0, import_react137.useEffect)(() => {
|
|
559686
560578
|
if (remountKey === 0)
|
|
559687
560579
|
return;
|
|
559688
560580
|
const reloadMessages = async () => {
|
|
@@ -559695,7 +560587,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559695
560587
|
reloadMessages();
|
|
559696
560588
|
}, [remountKey]);
|
|
559697
560589
|
const { pendingToolConfirmation, alwaysApprovedTools, requestToolConfirmation, isToolAutoApproved, addMultipleToAlwaysApproved, removeFromAlwaysApproved, clearAllAlwaysApproved } = useToolConfirmation(workingDirectory);
|
|
559698
|
-
const [pendingUserQuestion, setPendingUserQuestion] = (0,
|
|
560590
|
+
const [pendingUserQuestion, setPendingUserQuestion] = (0, import_react137.useState)(null);
|
|
559699
560591
|
const requestUserQuestion = async (question, options3, toolCall) => {
|
|
559700
560592
|
return new Promise((resolve12) => {
|
|
559701
560593
|
setPendingUserQuestion({
|
|
@@ -559756,6 +560648,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559756
560648
|
setShowSessionPanel: panelState.setShowSessionPanel,
|
|
559757
560649
|
setShowMcpPanel: panelState.setShowMcpPanel,
|
|
559758
560650
|
setShowUsagePanel: panelState.setShowUsagePanel,
|
|
560651
|
+
setShowModelsPanel: panelState.setShowModelsPanel,
|
|
559759
560652
|
setShowCustomCommandConfig: panelState.setShowCustomCommandConfig,
|
|
559760
560653
|
setShowSkillsCreation: panelState.setShowSkillsCreation,
|
|
559761
560654
|
setShowRoleCreation: panelState.setShowRoleCreation,
|
|
@@ -559780,7 +560673,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559780
560673
|
onReindexCodebase: handleReindexCodebase,
|
|
559781
560674
|
onToggleCodebase: handleToggleCodebase
|
|
559782
560675
|
});
|
|
559783
|
-
(0,
|
|
560676
|
+
(0, import_react137.useEffect)(() => {
|
|
559784
560677
|
if (!commandsLoaded) {
|
|
559785
560678
|
return;
|
|
559786
560679
|
}
|
|
@@ -559809,7 +560702,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559809
560702
|
}, 0);
|
|
559810
560703
|
return () => clearTimeout(timer2);
|
|
559811
560704
|
}, [commandsLoaded]);
|
|
559812
|
-
(0,
|
|
560705
|
+
(0, import_react137.useEffect)(() => {
|
|
559813
560706
|
if (streamingState.streamStatus === "idle" && pendingMessages.length > 0) {
|
|
559814
560707
|
const timer2 = setTimeout(() => {
|
|
559815
560708
|
streamingState.setIsStreaming(true);
|
|
@@ -559819,7 +560712,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559819
560712
|
}
|
|
559820
560713
|
return void 0;
|
|
559821
560714
|
}, [streamingState.streamStatus, pendingMessages.length]);
|
|
559822
|
-
(0,
|
|
560715
|
+
(0, import_react137.useEffect)(() => {
|
|
559823
560716
|
const handleSearchEvent = (event) => {
|
|
559824
560717
|
if (event.type === "search-complete") {
|
|
559825
560718
|
streamingState.setCodebaseSearchStatus({
|
|
@@ -559957,71 +560850,71 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559957
560850
|
}
|
|
559958
560851
|
const handleProfileSelect = panelState.handleProfileSelect;
|
|
559959
560852
|
if (terminalHeight < MIN_TERMINAL_HEIGHT) {
|
|
559960
|
-
return
|
|
560853
|
+
return import_react137.default.createElement(
|
|
559961
560854
|
Box_default,
|
|
559962
560855
|
{ flexDirection: "column", padding: 2 },
|
|
559963
|
-
|
|
560856
|
+
import_react137.default.createElement(
|
|
559964
560857
|
Box_default,
|
|
559965
560858
|
{ borderStyle: "round", borderColor: "red", padding: 1 },
|
|
559966
|
-
|
|
560859
|
+
import_react137.default.createElement(Text, { color: "red", bold: true }, t.chatScreen.terminalTooSmall)
|
|
559967
560860
|
),
|
|
559968
|
-
|
|
560861
|
+
import_react137.default.createElement(
|
|
559969
560862
|
Box_default,
|
|
559970
560863
|
{ marginTop: 1 },
|
|
559971
|
-
|
|
560864
|
+
import_react137.default.createElement(Text, { color: "yellow" }, t.chatScreen.terminalResizePrompt.replace("{current}", terminalHeight.toString()).replace("{required}", MIN_TERMINAL_HEIGHT.toString()))
|
|
559972
560865
|
),
|
|
559973
|
-
|
|
560866
|
+
import_react137.default.createElement(
|
|
559974
560867
|
Box_default,
|
|
559975
560868
|
{ marginTop: 1 },
|
|
559976
|
-
|
|
560869
|
+
import_react137.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.terminalMinHeight)
|
|
559977
560870
|
)
|
|
559978
560871
|
);
|
|
559979
560872
|
}
|
|
559980
|
-
return
|
|
560873
|
+
return import_react137.default.createElement(
|
|
559981
560874
|
Box_default,
|
|
559982
560875
|
{ flexDirection: "column", height: "100%", width: terminalWidth },
|
|
559983
|
-
|
|
559984
|
-
|
|
560876
|
+
import_react137.default.createElement(Static, { key: remountKey, items: [
|
|
560877
|
+
import_react137.default.createElement(ChatHeader, { key: "header", terminalWidth, simpleMode, workingDirectory }),
|
|
559985
560878
|
...messages.filter((m) => !m.streaming).map((message, index, filteredMessages) => {
|
|
559986
|
-
return
|
|
560879
|
+
return import_react137.default.createElement(MessageRenderer, { key: `msg-${index}`, message, index, filteredMessages, terminalWidth, showThinking });
|
|
559987
560880
|
})
|
|
559988
560881
|
] }, (item) => item),
|
|
559989
|
-
|
|
559990
|
-
|
|
560882
|
+
import_react137.default.createElement(LoadingIndicator, { isStreaming: streamingState.isStreaming, isStopping: streamingState.isStopping, isSaving, hasPendingToolConfirmation: !!pendingToolConfirmation, hasPendingUserQuestion: !!pendingUserQuestion, hasBlockingOverlay: !!bashSensitiveCommand || suppressLoadingIndicator || bashMode.state.isExecuting && !!bashMode.state.currentCommand || terminalExecutionState.state.isExecuting && !terminalExecutionState.state.isBackgrounded && !!terminalExecutionState.state.command || ((customCommandExecution == null ? void 0 : customCommandExecution.isRunning) ?? false), terminalWidth, animationFrame: streamingState.animationFrame, retryStatus: streamingState.retryStatus, codebaseSearchStatus: streamingState.codebaseSearchStatus, isReasoning: streamingState.isReasoning, streamTokenCount: streamingState.streamTokenCount, elapsedSeconds: streamingState.elapsedSeconds, currentModel: streamingState.currentModel }),
|
|
560883
|
+
import_react137.default.createElement(
|
|
559991
560884
|
Box_default,
|
|
559992
560885
|
{ paddingX: 1, width: terminalWidth },
|
|
559993
|
-
|
|
560886
|
+
import_react137.default.createElement(PendingMessages, { pendingMessages })
|
|
559994
560887
|
),
|
|
559995
|
-
hookError &&
|
|
560888
|
+
hookError && import_react137.default.createElement(
|
|
559996
560889
|
Box_default,
|
|
559997
560890
|
{ paddingX: 1, width: terminalWidth, marginBottom: 1 },
|
|
559998
|
-
|
|
560891
|
+
import_react137.default.createElement(HookErrorDisplay, { details: hookError })
|
|
559999
560892
|
),
|
|
560000
|
-
pendingToolConfirmation &&
|
|
560893
|
+
pendingToolConfirmation && import_react137.default.createElement(ToolConfirmation, { toolName: pendingToolConfirmation.batchToolNames || pendingToolConfirmation.tool.function.name, toolArguments: !pendingToolConfirmation.allTools ? pendingToolConfirmation.tool.function.arguments : void 0, allTools: pendingToolConfirmation.allTools, onConfirm: pendingToolConfirmation.resolve, onHookError: (error) => {
|
|
560001
560894
|
setHookError(error);
|
|
560002
560895
|
} }),
|
|
560003
|
-
bashSensitiveCommand &&
|
|
560896
|
+
bashSensitiveCommand && import_react137.default.createElement(
|
|
560004
560897
|
Box_default,
|
|
560005
560898
|
{ paddingX: 1, width: terminalWidth },
|
|
560006
|
-
|
|
560899
|
+
import_react137.default.createElement(BashCommandConfirmation, { command: bashSensitiveCommand.command, onConfirm: bashSensitiveCommand.resolve, terminalWidth })
|
|
560007
560900
|
),
|
|
560008
|
-
bashMode.state.isExecuting && bashMode.state.currentCommand &&
|
|
560901
|
+
bashMode.state.isExecuting && bashMode.state.currentCommand && import_react137.default.createElement(
|
|
560009
560902
|
Box_default,
|
|
560010
560903
|
{ paddingX: 1, width: terminalWidth },
|
|
560011
|
-
|
|
560904
|
+
import_react137.default.createElement(BashCommandExecutionStatus, { command: bashMode.state.currentCommand, timeout: bashMode.state.currentTimeout || 3e4, terminalWidth, output: bashMode.state.output })
|
|
560012
560905
|
),
|
|
560013
|
-
customCommandExecution &&
|
|
560906
|
+
customCommandExecution && import_react137.default.createElement(
|
|
560014
560907
|
Box_default,
|
|
560015
560908
|
{ paddingX: 1, width: terminalWidth },
|
|
560016
|
-
|
|
560909
|
+
import_react137.default.createElement(CustomCommandExecutionDisplay, { command: customCommandExecution.command, commandName: customCommandExecution.commandName, isRunning: customCommandExecution.isRunning, output: customCommandExecution.output, exitCode: customCommandExecution.exitCode, error: customCommandExecution.error })
|
|
560017
560910
|
),
|
|
560018
|
-
terminalExecutionState.state.isExecuting && !terminalExecutionState.state.isBackgrounded && terminalExecutionState.state.command &&
|
|
560911
|
+
terminalExecutionState.state.isExecuting && !terminalExecutionState.state.isBackgrounded && terminalExecutionState.state.command && import_react137.default.createElement(
|
|
560019
560912
|
Box_default,
|
|
560020
560913
|
{ paddingX: 1, width: terminalWidth },
|
|
560021
|
-
|
|
560914
|
+
import_react137.default.createElement(BashCommandExecutionStatus, { command: terminalExecutionState.state.command, timeout: terminalExecutionState.state.timeout || 3e4, terminalWidth, output: terminalExecutionState.state.output, needsInput: terminalExecutionState.state.needsInput, inputPrompt: terminalExecutionState.state.inputPrompt })
|
|
560022
560915
|
),
|
|
560023
|
-
pendingUserQuestion &&
|
|
560024
|
-
|
|
560916
|
+
pendingUserQuestion && import_react137.default.createElement(AskUserQuestion, { question: pendingUserQuestion.question, options: pendingUserQuestion.options, onAnswer: handleUserQuestionAnswer }),
|
|
560917
|
+
import_react137.default.createElement(PanelsManager, { terminalWidth, workingDirectory, showSessionPanel: panelState.showSessionPanel, showMcpPanel: panelState.showMcpPanel, showUsagePanel: panelState.showUsagePanel, showModelsPanel: panelState.showModelsPanel, showCustomCommandConfig: panelState.showCustomCommandConfig, showSkillsCreation: panelState.showSkillsCreation, showRoleCreation: panelState.showRoleCreation, showRoleDeletion: panelState.showRoleDeletion, showRoleList: panelState.showRoleList, showWorkingDirPanel: panelState.showWorkingDirPanel, advancedModel, basicModel, setShowSessionPanel: panelState.setShowSessionPanel, setShowModelsPanel: panelState.setShowModelsPanel, setShowCustomCommandConfig: panelState.setShowCustomCommandConfig, setShowSkillsCreation: panelState.setShowSkillsCreation, setShowRoleCreation: panelState.setShowRoleCreation, setShowRoleDeletion: panelState.setShowRoleDeletion, setShowRoleList: panelState.setShowRoleList, setShowWorkingDirPanel: panelState.setShowWorkingDirPanel, handleSessionPanelSelect, onCustomCommandSave: async (name, command, type, location, description) => {
|
|
560025
560918
|
await saveCustomCommand(name, command, type, description, location, workingDirectory);
|
|
560026
560919
|
await registerCustomCommands(workingDirectory);
|
|
560027
560920
|
panelState.setShowCustomCommandConfig(false);
|
|
@@ -560104,26 +560997,26 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
560104
560997
|
setMessages((prev) => [...prev, errorMessage]);
|
|
560105
560998
|
}
|
|
560106
560999
|
} }),
|
|
560107
|
-
showPermissionsPanel &&
|
|
561000
|
+
showPermissionsPanel && import_react137.default.createElement(
|
|
560108
561001
|
Box_default,
|
|
560109
561002
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
560110
|
-
|
|
560111
|
-
|
|
560112
|
-
{ fallback:
|
|
561003
|
+
import_react137.default.createElement(
|
|
561004
|
+
import_react137.Suspense,
|
|
561005
|
+
{ fallback: import_react137.default.createElement(
|
|
560113
561006
|
Box_default,
|
|
560114
561007
|
null,
|
|
560115
|
-
|
|
561008
|
+
import_react137.default.createElement(
|
|
560116
561009
|
Text,
|
|
560117
561010
|
null,
|
|
560118
|
-
|
|
561011
|
+
import_react137.default.createElement(build_default, { type: "dots" }),
|
|
560119
561012
|
" Loading..."
|
|
560120
561013
|
)
|
|
560121
561014
|
) },
|
|
560122
|
-
|
|
561015
|
+
import_react137.default.createElement(PermissionsPanel2, { alwaysApprovedTools, onRemoveTool: removeFromAlwaysApproved, onClearAll: clearAllAlwaysApproved, onClose: () => setShowPermissionsPanel(false) })
|
|
560123
561016
|
)
|
|
560124
561017
|
),
|
|
560125
|
-
snapshotState.pendingRollback &&
|
|
560126
|
-
!pendingToolConfirmation && !pendingUserQuestion && !bashSensitiveCommand && !terminalExecutionState.state.needsInput && !(panelState.showSessionPanel || panelState.showMcpPanel || panelState.showUsagePanel || panelState.showCustomCommandConfig || panelState.showSkillsCreation || panelState.showRoleCreation || panelState.showRoleDeletion || panelState.showRoleList || panelState.showWorkingDirPanel || showPermissionsPanel) && !snapshotState.pendingRollback &&
|
|
561018
|
+
snapshotState.pendingRollback && import_react137.default.createElement(FileRollbackConfirmation, { fileCount: snapshotState.pendingRollback.fileCount, filePaths: snapshotState.pendingRollback.filePaths || [], onConfirm: handleRollbackConfirm }),
|
|
561019
|
+
!pendingToolConfirmation && !pendingUserQuestion && !bashSensitiveCommand && !terminalExecutionState.state.needsInput && !(panelState.showSessionPanel || panelState.showMcpPanel || panelState.showUsagePanel || panelState.showModelsPanel || panelState.showCustomCommandConfig || panelState.showSkillsCreation || panelState.showRoleCreation || panelState.showRoleDeletion || panelState.showRoleList || panelState.showWorkingDirPanel || showPermissionsPanel) && !snapshotState.pendingRollback && import_react137.default.createElement(ChatFooter, { onSubmit: handleMessageSubmit, onCommand: handleCommandExecution, onHistorySelect: handleHistorySelect, onSwitchProfile: handleSwitchProfile, handleProfileSelect, handleHistorySelect, showReviewCommitPanel: panelState.showReviewCommitPanel, setShowReviewCommitPanel: panelState.setShowReviewCommitPanel, onReviewCommitConfirm: handleReviewCommitConfirm, disabled: !!pendingToolConfirmation || !!bashSensitiveCommand || isExecutingTerminalCommand || isCompressing || streamingState.isStopping, isStopping: streamingState.isStopping, isProcessing: streamingState.isStreaming || isSaving || bashMode.state.isExecuting || isCompressing, chatHistory: messages, yoloMode, setYoloMode, planMode, setPlanMode, vulnerabilityHuntingMode, setVulnerabilityHuntingMode, contextUsage: streamingState.contextUsage ? {
|
|
560127
561020
|
inputTokens: streamingState.contextUsage.prompt_tokens,
|
|
560128
561021
|
maxContextTokens: getOpenAiConfig().maxContextTokens || 4e3,
|
|
560129
561022
|
cacheCreationTokens: streamingState.contextUsage.cache_creation_input_tokens,
|
|
@@ -560143,16 +561036,17 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
560143
561036
|
}, profileSearchQuery: panelState.profileSearchQuery, setProfileSearchQuery: panelState.setProfileSearchQuery, vscodeConnectionStatus: vscodeState.vscodeConnectionStatus, editorContext: vscodeState.editorContext, codebaseIndexing, codebaseProgress, watcherEnabled, fileUpdateNotification, currentProfileName: panelState.currentProfileName, isCompressing, compressionError, backgroundProcesses: backgroundProcesses.processes, showBackgroundPanel: backgroundProcesses.showPanel, selectedProcessIndex, terminalWidth })
|
|
560144
561037
|
);
|
|
560145
561038
|
}
|
|
560146
|
-
var
|
|
561039
|
+
var import_react137, PermissionsPanel2;
|
|
560147
561040
|
var init_ChatScreen = __esm({
|
|
560148
561041
|
async "dist/ui/pages/ChatScreen.js"() {
|
|
560149
561042
|
"use strict";
|
|
560150
|
-
|
|
561043
|
+
import_react137 = __toESM(require_react(), 1);
|
|
560151
561044
|
await init_build2();
|
|
560152
561045
|
await init_build3();
|
|
560153
561046
|
init_ansi_escapes();
|
|
560154
561047
|
init_I18nContext();
|
|
560155
561048
|
init_ThemeContext();
|
|
561049
|
+
init_configEvents();
|
|
560156
561050
|
await init_ChatFooter();
|
|
560157
561051
|
await init_PendingMessages();
|
|
560158
561052
|
await init_ToolConfirmation();
|
|
@@ -560192,7 +561086,7 @@ var init_ChatScreen = __esm({
|
|
|
560192
561086
|
init_codebaseConfig();
|
|
560193
561087
|
init_codebaseSearchEvents();
|
|
560194
561088
|
init_logger();
|
|
560195
|
-
PermissionsPanel2 = (0,
|
|
561089
|
+
PermissionsPanel2 = (0, import_react137.lazy)(() => init_PermissionsPanel().then(() => PermissionsPanel_exports));
|
|
560196
561090
|
}
|
|
560197
561091
|
});
|
|
560198
561092
|
|
|
@@ -560406,10 +561300,10 @@ ${warningColor}\u26A0 Tool Confirmation Required${resetColor} ${sensitiveCheck.i
|
|
|
560406
561300
|
});
|
|
560407
561301
|
}
|
|
560408
561302
|
function HeadlessModeScreen({ prompt, sessionId, onComplete }) {
|
|
560409
|
-
const [messages, setMessages] = (0,
|
|
560410
|
-
const [isComplete, setIsComplete] = (0,
|
|
560411
|
-
const [lastDisplayedIndex, setLastDisplayedIndex] = (0,
|
|
560412
|
-
const [isWaitingForInput, setIsWaitingForInput] = (0,
|
|
561303
|
+
const [messages, setMessages] = (0, import_react138.useState)([]);
|
|
561304
|
+
const [isComplete, setIsComplete] = (0, import_react138.useState)(false);
|
|
561305
|
+
const [lastDisplayedIndex, setLastDisplayedIndex] = (0, import_react138.useState)(-1);
|
|
561306
|
+
const [isWaitingForInput, setIsWaitingForInput] = (0, import_react138.useState)(false);
|
|
560413
561307
|
const { stdout } = use_stdout_default();
|
|
560414
561308
|
const workingDirectory = process.cwd();
|
|
560415
561309
|
const { t } = useI18n();
|
|
@@ -560417,7 +561311,7 @@ function HeadlessModeScreen({ prompt, sessionId, onComplete }) {
|
|
|
560417
561311
|
const vscodeState = useVSCodeState();
|
|
560418
561312
|
const { saveMessage } = useSessionSave();
|
|
560419
561313
|
const { isToolAutoApproved, addMultipleToAlwaysApproved } = useToolConfirmation(workingDirectory);
|
|
560420
|
-
(0,
|
|
561314
|
+
(0, import_react138.useEffect)(() => {
|
|
560421
561315
|
const lastMessage = messages[messages.length - 1];
|
|
560422
561316
|
const currentIndex = messages.length - 1;
|
|
560423
561317
|
if (!lastMessage || currentIndex <= lastDisplayedIndex)
|
|
@@ -560469,7 +561363,7 @@ function HeadlessModeScreen({ prompt, sessionId, onComplete }) {
|
|
|
560469
561363
|
}
|
|
560470
561364
|
}
|
|
560471
561365
|
}, [messages, lastDisplayedIndex]);
|
|
560472
|
-
(0,
|
|
561366
|
+
(0, import_react138.useEffect)(() => {
|
|
560473
561367
|
if (isWaitingForInput)
|
|
560474
561368
|
return;
|
|
560475
561369
|
if (streamingState.isStreaming) {
|
|
@@ -560631,19 +561525,19 @@ function HeadlessModeScreen({ prompt, sessionId, onComplete }) {
|
|
|
560631
561525
|
}, 1e3);
|
|
560632
561526
|
}
|
|
560633
561527
|
};
|
|
560634
|
-
(0,
|
|
561528
|
+
(0, import_react138.useEffect)(() => {
|
|
560635
561529
|
processMessage();
|
|
560636
561530
|
}, []);
|
|
560637
561531
|
if (isComplete) {
|
|
560638
561532
|
return null;
|
|
560639
561533
|
}
|
|
560640
|
-
return
|
|
561534
|
+
return import_react138.default.createElement(import_react138.default.Fragment, null);
|
|
560641
561535
|
}
|
|
560642
|
-
var
|
|
561536
|
+
var import_react138, import_cli_highlight3, getTheme, getAnsiColor;
|
|
560643
561537
|
var init_HeadlessModeScreen = __esm({
|
|
560644
561538
|
async "dist/ui/pages/HeadlessModeScreen.js"() {
|
|
560645
561539
|
"use strict";
|
|
560646
|
-
|
|
561540
|
+
import_react138 = __toESM(require_react(), 1);
|
|
560647
561541
|
await init_build2();
|
|
560648
561542
|
init_ansi_escapes();
|
|
560649
561543
|
import_cli_highlight3 = __toESM(require_dist14(), 1);
|
|
@@ -560916,18 +561810,18 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560916
561810
|
var _a21;
|
|
560917
561811
|
const { theme: theme14 } = useTheme();
|
|
560918
561812
|
const { t } = useI18n();
|
|
560919
|
-
const [tasks, setTasks] = (0,
|
|
560920
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
560921
|
-
const [scrollOffset, setScrollOffset] = (0,
|
|
560922
|
-
const [markedTasks, setMarkedTasks] = (0,
|
|
560923
|
-
const [isLoading, setIsLoading] = (0,
|
|
560924
|
-
const [viewMode, setViewMode] = (0,
|
|
560925
|
-
const [detailTask, setDetailTask] = (0,
|
|
560926
|
-
const [pendingAction, setPendingAction] = (0,
|
|
560927
|
-
const [rejectInputMode, setRejectInputMode] = (0,
|
|
560928
|
-
const [rejectReason, setRejectReason] = (0,
|
|
561813
|
+
const [tasks, setTasks] = (0, import_react139.useState)([]);
|
|
561814
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react139.useState)(0);
|
|
561815
|
+
const [scrollOffset, setScrollOffset] = (0, import_react139.useState)(0);
|
|
561816
|
+
const [markedTasks, setMarkedTasks] = (0, import_react139.useState)(/* @__PURE__ */ new Set());
|
|
561817
|
+
const [isLoading, setIsLoading] = (0, import_react139.useState)(true);
|
|
561818
|
+
const [viewMode, setViewMode] = (0, import_react139.useState)("list");
|
|
561819
|
+
const [detailTask, setDetailTask] = (0, import_react139.useState)(null);
|
|
561820
|
+
const [pendingAction, setPendingAction] = (0, import_react139.useState)(null);
|
|
561821
|
+
const [rejectInputMode, setRejectInputMode] = (0, import_react139.useState)(false);
|
|
561822
|
+
const [rejectReason, setRejectReason] = (0, import_react139.useState)("");
|
|
560929
561823
|
const VISIBLE_ITEMS2 = 5;
|
|
560930
|
-
const loadTasks = (0,
|
|
561824
|
+
const loadTasks = (0, import_react139.useCallback)(async () => {
|
|
560931
561825
|
setIsLoading(true);
|
|
560932
561826
|
try {
|
|
560933
561827
|
const taskList = await taskManager.listTasks();
|
|
@@ -560939,10 +561833,10 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560939
561833
|
setIsLoading(false);
|
|
560940
561834
|
}
|
|
560941
561835
|
}, []);
|
|
560942
|
-
(0,
|
|
561836
|
+
(0, import_react139.useEffect)(() => {
|
|
560943
561837
|
void loadTasks();
|
|
560944
561838
|
}, [loadTasks]);
|
|
560945
|
-
(0,
|
|
561839
|
+
(0, import_react139.useEffect)(() => {
|
|
560946
561840
|
if (pendingAction) {
|
|
560947
561841
|
const timer2 = setTimeout(() => {
|
|
560948
561842
|
setPendingAction(null);
|
|
@@ -560951,7 +561845,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560951
561845
|
}
|
|
560952
561846
|
return void 0;
|
|
560953
561847
|
}, [pendingAction]);
|
|
560954
|
-
const handleDeleteTask = (0,
|
|
561848
|
+
const handleDeleteTask = (0, import_react139.useCallback)(async (taskId) => {
|
|
560955
561849
|
if (!taskId)
|
|
560956
561850
|
return;
|
|
560957
561851
|
const success = await taskManager.deleteTask(taskId);
|
|
@@ -561146,7 +562040,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
561146
562040
|
return;
|
|
561147
562041
|
}
|
|
561148
562042
|
});
|
|
561149
|
-
const getStatusColor = (0,
|
|
562043
|
+
const getStatusColor = (0, import_react139.useCallback)((status) => {
|
|
561150
562044
|
switch (status) {
|
|
561151
562045
|
case "pending":
|
|
561152
562046
|
return "yellow";
|
|
@@ -561162,7 +562056,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
561162
562056
|
return "gray";
|
|
561163
562057
|
}
|
|
561164
562058
|
}, []);
|
|
561165
|
-
const getStatusIcon = (0,
|
|
562059
|
+
const getStatusIcon = (0, import_react139.useCallback)((status) => {
|
|
561166
562060
|
switch (status) {
|
|
561167
562061
|
case "pending":
|
|
561168
562062
|
return "\u25CB";
|
|
@@ -561178,7 +562072,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
561178
562072
|
return "?";
|
|
561179
562073
|
}
|
|
561180
562074
|
}, []);
|
|
561181
|
-
const formatDate2 = (0,
|
|
562075
|
+
const formatDate2 = (0, import_react139.useCallback)((timestamp) => {
|
|
561182
562076
|
const date = new Date(timestamp);
|
|
561183
562077
|
const now = /* @__PURE__ */ new Date();
|
|
561184
562078
|
const diffMs = now.getTime() - date.getTime();
|
|
@@ -561196,24 +562090,24 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
561196
562090
|
return date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
561197
562091
|
}, []);
|
|
561198
562092
|
if (isLoading) {
|
|
561199
|
-
return
|
|
562093
|
+
return import_react139.default.createElement(
|
|
561200
562094
|
Box_default,
|
|
561201
562095
|
{ flexDirection: "column", paddingX: 1 },
|
|
561202
|
-
|
|
562096
|
+
import_react139.default.createElement(
|
|
561203
562097
|
Box_default,
|
|
561204
562098
|
{ borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1 },
|
|
561205
|
-
|
|
562099
|
+
import_react139.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.loadingTasks)
|
|
561206
562100
|
)
|
|
561207
562101
|
);
|
|
561208
562102
|
}
|
|
561209
562103
|
if (tasks.length === 0) {
|
|
561210
|
-
return
|
|
562104
|
+
return import_react139.default.createElement(
|
|
561211
562105
|
Box_default,
|
|
561212
562106
|
{ flexDirection: "column", paddingX: 1 },
|
|
561213
|
-
|
|
562107
|
+
import_react139.default.createElement(
|
|
561214
562108
|
Box_default,
|
|
561215
562109
|
{ borderStyle: "round", borderColor: theme14.colors.warning, paddingX: 1 },
|
|
561216
|
-
|
|
562110
|
+
import_react139.default.createElement(
|
|
561217
562111
|
Text,
|
|
561218
562112
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
561219
562113
|
t.taskManager.noTasksFound,
|
|
@@ -561227,32 +562121,32 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
561227
562121
|
);
|
|
561228
562122
|
}
|
|
561229
562123
|
if (viewMode === "detail" && detailTask) {
|
|
561230
|
-
return
|
|
562124
|
+
return import_react139.default.createElement(
|
|
561231
562125
|
Box_default,
|
|
561232
562126
|
{ flexDirection: "column", paddingX: 1 },
|
|
561233
|
-
|
|
562127
|
+
import_react139.default.createElement(
|
|
561234
562128
|
Box_default,
|
|
561235
562129
|
{ borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1, flexDirection: "column" },
|
|
561236
|
-
|
|
562130
|
+
import_react139.default.createElement(
|
|
561237
562131
|
Box_default,
|
|
561238
562132
|
{ flexDirection: "column", marginBottom: 1 },
|
|
561239
|
-
|
|
561240
|
-
|
|
562133
|
+
import_react139.default.createElement(Text, { color: theme14.colors.menuInfo, bold: true }, t.taskManager.taskDetailsTitle),
|
|
562134
|
+
import_react139.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, detailTask.status === "paused" ? t.taskManager.backToList : `${t.taskManager.continueHint} \u2022 ${t.taskManager.backToList}`)
|
|
561241
562135
|
),
|
|
561242
|
-
|
|
562136
|
+
import_react139.default.createElement(
|
|
561243
562137
|
Box_default,
|
|
561244
562138
|
{ flexDirection: "column", gap: 1 },
|
|
561245
|
-
|
|
562139
|
+
import_react139.default.createElement(
|
|
561246
562140
|
Box_default,
|
|
561247
562141
|
{ flexDirection: "column" },
|
|
561248
|
-
|
|
561249
|
-
|
|
562142
|
+
import_react139.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.titleLabel),
|
|
562143
|
+
import_react139.default.createElement(Text, null, detailTask.title || t.taskManager.untitled)
|
|
561250
562144
|
),
|
|
561251
|
-
|
|
562145
|
+
import_react139.default.createElement(
|
|
561252
562146
|
Box_default,
|
|
561253
562147
|
{ flexDirection: "column" },
|
|
561254
|
-
|
|
561255
|
-
|
|
562148
|
+
import_react139.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.statusLabel),
|
|
562149
|
+
import_react139.default.createElement(
|
|
561256
562150
|
Text,
|
|
561257
562151
|
{ color: getStatusColor(detailTask.status) },
|
|
561258
562152
|
getStatusIcon(detailTask.status),
|
|
@@ -561260,64 +562154,64 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
561260
562154
|
detailTask.status
|
|
561261
562155
|
)
|
|
561262
562156
|
),
|
|
561263
|
-
|
|
562157
|
+
import_react139.default.createElement(
|
|
561264
562158
|
Box_default,
|
|
561265
562159
|
{ flexDirection: "column" },
|
|
561266
|
-
|
|
561267
|
-
|
|
562160
|
+
import_react139.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.createdLabel),
|
|
562161
|
+
import_react139.default.createElement(Text, null, new Date(detailTask.createdAt).toLocaleString())
|
|
561268
562162
|
),
|
|
561269
|
-
|
|
562163
|
+
import_react139.default.createElement(
|
|
561270
562164
|
Box_default,
|
|
561271
562165
|
{ flexDirection: "column" },
|
|
561272
|
-
|
|
561273
|
-
|
|
562166
|
+
import_react139.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.updatedLabel),
|
|
562167
|
+
import_react139.default.createElement(Text, null, new Date(detailTask.updatedAt).toLocaleString())
|
|
561274
562168
|
),
|
|
561275
|
-
|
|
562169
|
+
import_react139.default.createElement(
|
|
561276
562170
|
Box_default,
|
|
561277
562171
|
{ flexDirection: "column" },
|
|
561278
|
-
|
|
562172
|
+
import_react139.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.messagesLabel.replace("{count}", String(detailTask.messages.length)))
|
|
561279
562173
|
),
|
|
561280
|
-
detailTask.status === "paused" && ((_a21 = detailTask.pausedInfo) == null ? void 0 : _a21.sensitiveCommand) &&
|
|
562174
|
+
detailTask.status === "paused" && ((_a21 = detailTask.pausedInfo) == null ? void 0 : _a21.sensitiveCommand) && import_react139.default.createElement(
|
|
561281
562175
|
Box_default,
|
|
561282
562176
|
{ flexDirection: "column", marginTop: 1 },
|
|
561283
|
-
|
|
562177
|
+
import_react139.default.createElement(
|
|
561284
562178
|
Box_default,
|
|
561285
562179
|
{ flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 1, paddingY: 1 },
|
|
561286
|
-
|
|
561287
|
-
|
|
562180
|
+
import_react139.default.createElement(Text, { color: "yellow", bold: true }, t.taskManager.sensitiveCommandDetected),
|
|
562181
|
+
import_react139.default.createElement(
|
|
561288
562182
|
Box_default,
|
|
561289
562183
|
{ marginTop: 1 },
|
|
561290
|
-
|
|
562184
|
+
import_react139.default.createElement(
|
|
561291
562185
|
Text,
|
|
561292
562186
|
null,
|
|
561293
|
-
|
|
561294
|
-
|
|
562187
|
+
import_react139.default.createElement(Text, { bold: true }, t.taskManager.commandLabel),
|
|
562188
|
+
import_react139.default.createElement(Text, { color: "yellow" }, detailTask.pausedInfo.sensitiveCommand.command)
|
|
561295
562189
|
)
|
|
561296
562190
|
),
|
|
561297
|
-
detailTask.pausedInfo.sensitiveCommand.description &&
|
|
561298
|
-
!rejectInputMode ?
|
|
562191
|
+
detailTask.pausedInfo.sensitiveCommand.description && import_react139.default.createElement(Text, { dimColor: true }, detailTask.pausedInfo.sensitiveCommand.description),
|
|
562192
|
+
!rejectInputMode ? import_react139.default.createElement(
|
|
561299
562193
|
Box_default,
|
|
561300
562194
|
{ marginTop: 1, paddingTop: 1, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: "gray", flexDirection: "column" },
|
|
561301
|
-
|
|
561302
|
-
) :
|
|
562195
|
+
import_react139.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.approveRejectHint)
|
|
562196
|
+
) : import_react139.default.createElement(
|
|
561303
562197
|
Box_default,
|
|
561304
562198
|
{ marginTop: 1, paddingTop: 1, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: "gray", flexDirection: "column" },
|
|
561305
|
-
|
|
561306
|
-
|
|
562199
|
+
import_react139.default.createElement(Text, { color: "yellow", bold: true }, t.taskManager.enterRejectionReason),
|
|
562200
|
+
import_react139.default.createElement(
|
|
561307
562201
|
Text,
|
|
561308
562202
|
null,
|
|
561309
562203
|
rejectReason,
|
|
561310
|
-
|
|
562204
|
+
import_react139.default.createElement(Text, { color: theme14.colors.menuInfo }, "\u2588")
|
|
561311
562205
|
),
|
|
561312
|
-
|
|
562206
|
+
import_react139.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.submitCancelHint)
|
|
561313
562207
|
)
|
|
561314
562208
|
)
|
|
561315
562209
|
)
|
|
561316
562210
|
),
|
|
561317
|
-
(pendingAction == null ? void 0 : pendingAction.type) === "continue" && pendingAction.taskId === detailTask.id &&
|
|
562211
|
+
(pendingAction == null ? void 0 : pendingAction.type) === "continue" && pendingAction.taskId === detailTask.id && import_react139.default.createElement(
|
|
561318
562212
|
Box_default,
|
|
561319
562213
|
{ marginTop: 1 },
|
|
561320
|
-
|
|
562214
|
+
import_react139.default.createElement(Alert, { variant: "warning" }, detailTask.status !== "completed" ? t.taskManager.taskNotCompleted : t.taskManager.confirmConvertToSession)
|
|
561321
562215
|
)
|
|
561322
562216
|
)
|
|
561323
562217
|
);
|
|
@@ -561326,21 +562220,21 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
561326
562220
|
const hasMore = tasks.length > scrollOffset + VISIBLE_ITEMS2;
|
|
561327
562221
|
const hasPrevious = scrollOffset > 0;
|
|
561328
562222
|
const currentTask = tasks[selectedIndex];
|
|
561329
|
-
return
|
|
562223
|
+
return import_react139.default.createElement(
|
|
561330
562224
|
Box_default,
|
|
561331
562225
|
{ flexDirection: "column", paddingX: 1 },
|
|
561332
|
-
|
|
562226
|
+
import_react139.default.createElement(
|
|
561333
562227
|
Box_default,
|
|
561334
562228
|
{ borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1, flexDirection: "column" },
|
|
561335
|
-
|
|
562229
|
+
import_react139.default.createElement(
|
|
561336
562230
|
Box_default,
|
|
561337
562231
|
{ flexDirection: "column" },
|
|
561338
|
-
|
|
562232
|
+
import_react139.default.createElement(
|
|
561339
562233
|
Text,
|
|
561340
562234
|
{ color: theme14.colors.menuInfo, dimColor: true },
|
|
561341
562235
|
t.taskManager.tasksCount.replace("{current}", String(selectedIndex + 1)).replace("{total}", String(tasks.length)),
|
|
561342
562236
|
currentTask && ` \u2022 ${t.taskManager.messagesCount.replace("{count}", String(currentTask.messageCount))}`,
|
|
561343
|
-
markedTasks.size > 0 &&
|
|
562237
|
+
markedTasks.size > 0 && import_react139.default.createElement(
|
|
561344
562238
|
Text,
|
|
561345
562239
|
{ color: theme14.colors.warning },
|
|
561346
562240
|
" ",
|
|
@@ -561349,9 +562243,9 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
561349
562243
|
t.taskManager.markedCount.replace("{count}", String(markedTasks.size))
|
|
561350
562244
|
)
|
|
561351
562245
|
),
|
|
561352
|
-
|
|
562246
|
+
import_react139.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.navigationHint)
|
|
561353
562247
|
),
|
|
561354
|
-
hasPrevious &&
|
|
562248
|
+
hasPrevious && import_react139.default.createElement(
|
|
561355
562249
|
Text,
|
|
561356
562250
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
561357
562251
|
" ",
|
|
@@ -561364,24 +562258,24 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
561364
562258
|
const cleanTitle = (task.title || t.taskManager.untitled).replace(/[\r\n\t]+/g, " ");
|
|
561365
562259
|
const timeStr = formatDate2(task.updatedAt);
|
|
561366
562260
|
const truncatedTitle = cleanTitle.length > 50 ? cleanTitle.slice(0, 47) + "..." : cleanTitle;
|
|
561367
|
-
return
|
|
562261
|
+
return import_react139.default.createElement(
|
|
561368
562262
|
Text,
|
|
561369
562263
|
{ key: task.id },
|
|
561370
|
-
|
|
562264
|
+
import_react139.default.createElement(
|
|
561371
562265
|
Text,
|
|
561372
562266
|
{ color: isSelected ? theme14.colors.menuSelected : "white" },
|
|
561373
562267
|
isSelected ? "\u276F " : " ",
|
|
561374
|
-
isMarked &&
|
|
562268
|
+
isMarked && import_react139.default.createElement(
|
|
561375
562269
|
Text,
|
|
561376
562270
|
{ color: theme14.colors.warning, bold: true },
|
|
561377
562271
|
"\u25CF",
|
|
561378
562272
|
" "
|
|
561379
562273
|
),
|
|
561380
|
-
|
|
562274
|
+
import_react139.default.createElement(Text, { color: getStatusColor(task.status) }, getStatusIcon(task.status)),
|
|
561381
562275
|
" ",
|
|
561382
562276
|
truncatedTitle
|
|
561383
562277
|
),
|
|
561384
|
-
|
|
562278
|
+
import_react139.default.createElement(
|
|
561385
562279
|
Text,
|
|
561386
562280
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
561387
562281
|
" ",
|
|
@@ -561390,25 +562284,25 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
561390
562284
|
)
|
|
561391
562285
|
);
|
|
561392
562286
|
}),
|
|
561393
|
-
hasMore &&
|
|
562287
|
+
hasMore && import_react139.default.createElement(
|
|
561394
562288
|
Text,
|
|
561395
562289
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
561396
562290
|
" ",
|
|
561397
562291
|
t.taskManager.moreBelow.replace("{count}", String(tasks.length - scrollOffset - VISIBLE_ITEMS2))
|
|
561398
562292
|
)
|
|
561399
562293
|
),
|
|
561400
|
-
(pendingAction == null ? void 0 : pendingAction.type) === "delete" &&
|
|
562294
|
+
(pendingAction == null ? void 0 : pendingAction.type) === "delete" && import_react139.default.createElement(
|
|
561401
562295
|
Box_default,
|
|
561402
562296
|
{ marginTop: 1 },
|
|
561403
|
-
|
|
562297
|
+
import_react139.default.createElement(Alert, { variant: "warning" }, pendingAction.taskId ? t.taskManager.deleteConfirm : t.taskManager.deleteMultipleConfirm.replace("{count}", String(markedTasks.size)))
|
|
561404
562298
|
)
|
|
561405
562299
|
);
|
|
561406
562300
|
}
|
|
561407
|
-
var
|
|
562301
|
+
var import_react139;
|
|
561408
562302
|
var init_TaskManagerScreen = __esm({
|
|
561409
562303
|
async "dist/ui/pages/TaskManagerScreen.js"() {
|
|
561410
562304
|
"use strict";
|
|
561411
|
-
|
|
562305
|
+
import_react139 = __toESM(require_react(), 1);
|
|
561412
562306
|
await init_build2();
|
|
561413
562307
|
await init_build4();
|
|
561414
562308
|
init_ThemeContext();
|
|
@@ -561475,7 +562369,7 @@ function getSystemEditor2() {
|
|
|
561475
562369
|
return null;
|
|
561476
562370
|
}
|
|
561477
562371
|
function MCPConfigScreen({ onBack }) {
|
|
561478
|
-
(0,
|
|
562372
|
+
(0, import_react140.useEffect)(() => {
|
|
561479
562373
|
const openEditor = async () => {
|
|
561480
562374
|
const config3 = getMCPConfig();
|
|
561481
562375
|
writeFileSync14(MCP_CONFIG_FILE2, JSON.stringify(config3, null, 2), "utf8");
|
|
@@ -561545,11 +562439,11 @@ function MCPConfigScreen({ onBack }) {
|
|
|
561545
562439
|
}, [onBack]);
|
|
561546
562440
|
return null;
|
|
561547
562441
|
}
|
|
561548
|
-
var
|
|
562442
|
+
var import_react140, CONFIG_DIR9, MCP_CONFIG_FILE2;
|
|
561549
562443
|
var init_MCPConfigScreen = __esm({
|
|
561550
562444
|
"dist/ui/pages/MCPConfigScreen.js"() {
|
|
561551
562445
|
"use strict";
|
|
561552
|
-
|
|
562446
|
+
import_react140 = __toESM(require_react(), 1);
|
|
561553
562447
|
init_apiConfig();
|
|
561554
562448
|
CONFIG_DIR9 = join29(homedir18(), ".snow");
|
|
561555
562449
|
MCP_CONFIG_FILE2 = join29(CONFIG_DIR9, "mcp-config.json");
|
|
@@ -561560,31 +562454,31 @@ var init_MCPConfigScreen = __esm({
|
|
|
561560
562454
|
function HelpPanel() {
|
|
561561
562455
|
const pasteKey = getPasteKey();
|
|
561562
562456
|
const { t } = useI18n();
|
|
561563
|
-
return
|
|
562457
|
+
return import_react141.default.createElement(
|
|
561564
562458
|
Box_default,
|
|
561565
562459
|
{ flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1 },
|
|
561566
|
-
|
|
562460
|
+
import_react141.default.createElement(
|
|
561567
562461
|
Box_default,
|
|
561568
562462
|
{ marginBottom: 1 },
|
|
561569
|
-
|
|
562463
|
+
import_react141.default.createElement(Text, { bold: true, color: "cyan" }, t.helpPanel.title)
|
|
561570
562464
|
),
|
|
561571
|
-
|
|
562465
|
+
import_react141.default.createElement(
|
|
561572
562466
|
Box_default,
|
|
561573
562467
|
{ flexDirection: "column", marginBottom: 1 },
|
|
561574
|
-
|
|
561575
|
-
|
|
562468
|
+
import_react141.default.createElement(Text, { bold: true, color: "yellow" }, t.helpPanel.textEditingTitle),
|
|
562469
|
+
import_react141.default.createElement(
|
|
561576
562470
|
Text,
|
|
561577
562471
|
null,
|
|
561578
562472
|
" \u2022 ",
|
|
561579
562473
|
t.helpPanel.deleteToStart
|
|
561580
562474
|
),
|
|
561581
|
-
|
|
562475
|
+
import_react141.default.createElement(
|
|
561582
562476
|
Text,
|
|
561583
562477
|
null,
|
|
561584
562478
|
" \u2022 ",
|
|
561585
562479
|
t.helpPanel.deleteToEnd
|
|
561586
562480
|
),
|
|
561587
|
-
|
|
562481
|
+
import_react141.default.createElement(
|
|
561588
562482
|
Text,
|
|
561589
562483
|
null,
|
|
561590
562484
|
" ",
|
|
@@ -561592,169 +562486,169 @@ function HelpPanel() {
|
|
|
561592
562486
|
t.helpPanel.pasteImages.replace("{pasteKey}", pasteKey)
|
|
561593
562487
|
)
|
|
561594
562488
|
),
|
|
561595
|
-
|
|
562489
|
+
import_react141.default.createElement(
|
|
561596
562490
|
Box_default,
|
|
561597
562491
|
{ flexDirection: "column", marginBottom: 1 },
|
|
561598
|
-
|
|
561599
|
-
|
|
562492
|
+
import_react141.default.createElement(Text, { bold: true, color: "cyan" }, t.helpPanel.readlineTitle),
|
|
562493
|
+
import_react141.default.createElement(
|
|
561600
562494
|
Text,
|
|
561601
562495
|
null,
|
|
561602
562496
|
" \u2022 ",
|
|
561603
562497
|
t.helpPanel.moveToLineStart
|
|
561604
562498
|
),
|
|
561605
|
-
|
|
562499
|
+
import_react141.default.createElement(
|
|
561606
562500
|
Text,
|
|
561607
562501
|
null,
|
|
561608
562502
|
" \u2022 ",
|
|
561609
562503
|
t.helpPanel.moveToLineEnd
|
|
561610
562504
|
),
|
|
561611
|
-
|
|
562505
|
+
import_react141.default.createElement(
|
|
561612
562506
|
Text,
|
|
561613
562507
|
null,
|
|
561614
562508
|
" \u2022 ",
|
|
561615
562509
|
t.helpPanel.forwardWord
|
|
561616
562510
|
),
|
|
561617
|
-
|
|
562511
|
+
import_react141.default.createElement(
|
|
561618
562512
|
Text,
|
|
561619
562513
|
null,
|
|
561620
562514
|
" \u2022 ",
|
|
561621
562515
|
t.helpPanel.backwardWord
|
|
561622
562516
|
),
|
|
561623
|
-
|
|
562517
|
+
import_react141.default.createElement(
|
|
561624
562518
|
Text,
|
|
561625
562519
|
null,
|
|
561626
562520
|
" \u2022 ",
|
|
561627
562521
|
t.helpPanel.deleteToLineEnd
|
|
561628
562522
|
),
|
|
561629
|
-
|
|
562523
|
+
import_react141.default.createElement(
|
|
561630
562524
|
Text,
|
|
561631
562525
|
null,
|
|
561632
562526
|
" \u2022 ",
|
|
561633
562527
|
t.helpPanel.deleteToLineStart
|
|
561634
562528
|
),
|
|
561635
|
-
|
|
562529
|
+
import_react141.default.createElement(
|
|
561636
562530
|
Text,
|
|
561637
562531
|
null,
|
|
561638
562532
|
" \u2022 ",
|
|
561639
562533
|
t.helpPanel.deleteWord
|
|
561640
562534
|
),
|
|
561641
|
-
|
|
562535
|
+
import_react141.default.createElement(
|
|
561642
562536
|
Text,
|
|
561643
562537
|
null,
|
|
561644
562538
|
" \u2022 ",
|
|
561645
562539
|
t.helpPanel.deleteChar
|
|
561646
562540
|
)
|
|
561647
562541
|
),
|
|
561648
|
-
|
|
562542
|
+
import_react141.default.createElement(
|
|
561649
562543
|
Box_default,
|
|
561650
562544
|
{ flexDirection: "column", marginBottom: 1 },
|
|
561651
|
-
|
|
561652
|
-
|
|
562545
|
+
import_react141.default.createElement(Text, { bold: true, color: "green" }, t.helpPanel.quickAccessTitle),
|
|
562546
|
+
import_react141.default.createElement(
|
|
561653
562547
|
Text,
|
|
561654
562548
|
null,
|
|
561655
562549
|
" \u2022 ",
|
|
561656
562550
|
t.helpPanel.insertFiles
|
|
561657
562551
|
),
|
|
561658
|
-
|
|
562552
|
+
import_react141.default.createElement(
|
|
561659
562553
|
Text,
|
|
561660
562554
|
null,
|
|
561661
562555
|
" \u2022 ",
|
|
561662
562556
|
t.helpPanel.searchContent
|
|
561663
562557
|
),
|
|
561664
|
-
|
|
562558
|
+
import_react141.default.createElement(
|
|
561665
562559
|
Text,
|
|
561666
562560
|
null,
|
|
561667
562561
|
" \u2022 ",
|
|
561668
562562
|
t.helpPanel.selectAgent
|
|
561669
562563
|
),
|
|
561670
|
-
|
|
562564
|
+
import_react141.default.createElement(
|
|
561671
562565
|
Text,
|
|
561672
562566
|
null,
|
|
561673
562567
|
" \u2022 ",
|
|
561674
562568
|
t.helpPanel.showCommands
|
|
561675
562569
|
)
|
|
561676
562570
|
),
|
|
561677
|
-
|
|
562571
|
+
import_react141.default.createElement(
|
|
561678
562572
|
Box_default,
|
|
561679
562573
|
{ flexDirection: "column", marginBottom: 1 },
|
|
561680
|
-
|
|
561681
|
-
|
|
562574
|
+
import_react141.default.createElement(Text, { bold: true, color: "yellow" }, t.helpPanel.bashModeTitle),
|
|
562575
|
+
import_react141.default.createElement(
|
|
561682
562576
|
Text,
|
|
561683
562577
|
null,
|
|
561684
562578
|
" \u2022 ",
|
|
561685
562579
|
t.helpPanel.bashModeTrigger
|
|
561686
562580
|
),
|
|
561687
|
-
|
|
562581
|
+
import_react141.default.createElement(
|
|
561688
562582
|
Text,
|
|
561689
562583
|
{ dimColor: true },
|
|
561690
562584
|
" ",
|
|
561691
562585
|
t.helpPanel.bashModeDesc
|
|
561692
562586
|
)
|
|
561693
562587
|
),
|
|
561694
|
-
|
|
562588
|
+
import_react141.default.createElement(
|
|
561695
562589
|
Box_default,
|
|
561696
562590
|
{ flexDirection: "column", marginBottom: 1 },
|
|
561697
|
-
|
|
561698
|
-
|
|
562591
|
+
import_react141.default.createElement(Text, { bold: true, color: "blue" }, t.helpPanel.navigationTitle),
|
|
562592
|
+
import_react141.default.createElement(
|
|
561699
562593
|
Text,
|
|
561700
562594
|
null,
|
|
561701
562595
|
" \u2022 ",
|
|
561702
562596
|
t.helpPanel.navigateHistory
|
|
561703
562597
|
),
|
|
561704
|
-
|
|
562598
|
+
import_react141.default.createElement(
|
|
561705
562599
|
Text,
|
|
561706
562600
|
null,
|
|
561707
562601
|
" \u2022 ",
|
|
561708
562602
|
t.helpPanel.selectItem
|
|
561709
562603
|
),
|
|
561710
|
-
|
|
562604
|
+
import_react141.default.createElement(
|
|
561711
562605
|
Text,
|
|
561712
562606
|
null,
|
|
561713
562607
|
" \u2022 ",
|
|
561714
562608
|
t.helpPanel.cancelClose
|
|
561715
562609
|
),
|
|
561716
|
-
|
|
562610
|
+
import_react141.default.createElement(
|
|
561717
562611
|
Text,
|
|
561718
562612
|
null,
|
|
561719
562613
|
" \u2022 ",
|
|
561720
562614
|
t.helpPanel.toggleYolo
|
|
561721
562615
|
)
|
|
561722
562616
|
),
|
|
561723
|
-
|
|
562617
|
+
import_react141.default.createElement(
|
|
561724
562618
|
Box_default,
|
|
561725
562619
|
{ flexDirection: "column" },
|
|
561726
|
-
|
|
561727
|
-
|
|
562620
|
+
import_react141.default.createElement(Text, { bold: true, color: "magenta" }, t.helpPanel.tipsTitle),
|
|
562621
|
+
import_react141.default.createElement(
|
|
561728
562622
|
Text,
|
|
561729
562623
|
null,
|
|
561730
562624
|
" \u2022 ",
|
|
561731
562625
|
t.helpPanel.tipUseHelp
|
|
561732
562626
|
),
|
|
561733
|
-
|
|
562627
|
+
import_react141.default.createElement(
|
|
561734
562628
|
Text,
|
|
561735
562629
|
null,
|
|
561736
562630
|
" \u2022 ",
|
|
561737
562631
|
t.helpPanel.tipShowCommands
|
|
561738
562632
|
),
|
|
561739
|
-
|
|
562633
|
+
import_react141.default.createElement(
|
|
561740
562634
|
Text,
|
|
561741
562635
|
null,
|
|
561742
562636
|
" \u2022 ",
|
|
561743
562637
|
t.helpPanel.tipInterrupt
|
|
561744
562638
|
)
|
|
561745
562639
|
),
|
|
561746
|
-
|
|
562640
|
+
import_react141.default.createElement(
|
|
561747
562641
|
Box_default,
|
|
561748
562642
|
{ marginTop: 1 },
|
|
561749
|
-
|
|
562643
|
+
import_react141.default.createElement(Text, { dimColor: true, color: "gray" }, t.helpPanel.closeHint)
|
|
561750
562644
|
)
|
|
561751
562645
|
);
|
|
561752
562646
|
}
|
|
561753
|
-
var
|
|
562647
|
+
var import_react141, getPasteKey;
|
|
561754
562648
|
var init_HelpPanel = __esm({
|
|
561755
562649
|
async "dist/ui/components/panels/HelpPanel.js"() {
|
|
561756
562650
|
"use strict";
|
|
561757
|
-
|
|
562651
|
+
import_react141 = __toESM(require_react(), 1);
|
|
561758
562652
|
await init_build2();
|
|
561759
562653
|
init_i18n();
|
|
561760
562654
|
getPasteKey = () => {
|
|
@@ -561780,22 +562674,22 @@ function HelpScreen({ onBackDestination = "chat" }) {
|
|
|
561780
562674
|
navigateTo(onBackDestination);
|
|
561781
562675
|
}
|
|
561782
562676
|
});
|
|
561783
|
-
return
|
|
562677
|
+
return import_react142.default.createElement(
|
|
561784
562678
|
Box_default,
|
|
561785
562679
|
{ paddingX: 1, flexDirection: "column" },
|
|
561786
|
-
|
|
561787
|
-
|
|
562680
|
+
import_react142.default.createElement(HelpPanel, null),
|
|
562681
|
+
import_react142.default.createElement(
|
|
561788
562682
|
Box_default,
|
|
561789
562683
|
{ marginTop: 1 },
|
|
561790
|
-
|
|
562684
|
+
import_react142.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.pressEscToClose)
|
|
561791
562685
|
)
|
|
561792
562686
|
);
|
|
561793
562687
|
}
|
|
561794
|
-
var
|
|
562688
|
+
var import_react142;
|
|
561795
562689
|
var init_HelpScreen = __esm({
|
|
561796
562690
|
async "dist/ui/pages/HelpScreen.js"() {
|
|
561797
562691
|
"use strict";
|
|
561798
|
-
|
|
562692
|
+
import_react142 = __toESM(require_react(), 1);
|
|
561799
562693
|
await init_build2();
|
|
561800
562694
|
init_ThemeContext();
|
|
561801
562695
|
init_I18nContext();
|
|
@@ -561810,9 +562704,9 @@ __export(app_exports, {
|
|
|
561810
562704
|
default: () => App2
|
|
561811
562705
|
});
|
|
561812
562706
|
function ShowTaskListWrapper() {
|
|
561813
|
-
const [currentView, setCurrentView] = (0,
|
|
561814
|
-
const [chatScreenKey, setChatScreenKey] = (0,
|
|
561815
|
-
const [exitNotification, setExitNotification] = (0,
|
|
562707
|
+
const [currentView, setCurrentView] = (0, import_react143.useState)("tasks");
|
|
562708
|
+
const [chatScreenKey, setChatScreenKey] = (0, import_react143.useState)(0);
|
|
562709
|
+
const [exitNotification, setExitNotification] = (0, import_react143.useState)({
|
|
561816
562710
|
show: false,
|
|
561817
562711
|
message: ""
|
|
561818
562712
|
});
|
|
@@ -561822,45 +562716,45 @@ function ShowTaskListWrapper() {
|
|
|
561822
562716
|
useGlobalExit(setExitNotification);
|
|
561823
562717
|
const renderView = () => {
|
|
561824
562718
|
if (currentView === "chat") {
|
|
561825
|
-
return
|
|
561826
|
-
|
|
562719
|
+
return import_react143.default.createElement(
|
|
562720
|
+
import_react143.Suspense,
|
|
561827
562721
|
{ fallback: loadingFallback },
|
|
561828
|
-
|
|
562722
|
+
import_react143.default.createElement(ChatScreen2, { key: chatScreenKey, autoResume: true, enableYolo: false })
|
|
561829
562723
|
);
|
|
561830
562724
|
}
|
|
561831
|
-
return
|
|
561832
|
-
|
|
562725
|
+
return import_react143.default.createElement(
|
|
562726
|
+
import_react143.Suspense,
|
|
561833
562727
|
{ fallback: loadingFallback },
|
|
561834
|
-
|
|
562728
|
+
import_react143.default.createElement(TaskManagerScreen2, { onBack: () => gracefulExit(), onResumeTask: () => {
|
|
561835
562729
|
setCurrentView("chat");
|
|
561836
562730
|
setChatScreenKey((prev) => prev + 1);
|
|
561837
562731
|
} })
|
|
561838
562732
|
);
|
|
561839
562733
|
};
|
|
561840
|
-
return
|
|
562734
|
+
return import_react143.default.createElement(
|
|
561841
562735
|
Box_default,
|
|
561842
562736
|
{ flexDirection: "column", width: terminalWidth },
|
|
561843
562737
|
renderView(),
|
|
561844
|
-
exitNotification.show &&
|
|
562738
|
+
exitNotification.show && import_react143.default.createElement(
|
|
561845
562739
|
Box_default,
|
|
561846
562740
|
{ paddingX: 1, flexShrink: 0 },
|
|
561847
|
-
|
|
562741
|
+
import_react143.default.createElement(Alert, { variant: "warning" }, exitNotification.message)
|
|
561848
562742
|
)
|
|
561849
562743
|
);
|
|
561850
562744
|
}
|
|
561851
562745
|
function AppContent({ version: version3, skipWelcome, autoResume, enableYolo, enablePlan }) {
|
|
561852
|
-
const [currentView, setCurrentView] = (0,
|
|
561853
|
-
const [chatScreenKey, setChatScreenKey] = (0,
|
|
561854
|
-
const [welcomeMenuIndex, setWelcomeMenuIndex] = (0,
|
|
561855
|
-
const [shouldAutoResume, setShouldAutoResume] = (0,
|
|
561856
|
-
const [exitNotification, setExitNotification] = (0,
|
|
562746
|
+
const [currentView, setCurrentView] = (0, import_react143.useState)(skipWelcome ? "chat" : "welcome");
|
|
562747
|
+
const [chatScreenKey, setChatScreenKey] = (0, import_react143.useState)(0);
|
|
562748
|
+
const [welcomeMenuIndex, setWelcomeMenuIndex] = (0, import_react143.useState)(0);
|
|
562749
|
+
const [shouldAutoResume, setShouldAutoResume] = (0, import_react143.useState)(false);
|
|
562750
|
+
const [exitNotification, setExitNotification] = (0, import_react143.useState)({
|
|
561857
562751
|
show: false,
|
|
561858
562752
|
message: ""
|
|
561859
562753
|
});
|
|
561860
562754
|
const { columns: terminalWidth } = useTerminalSize();
|
|
561861
562755
|
useCursorHide();
|
|
561862
562756
|
useGlobalExit(setExitNotification);
|
|
561863
|
-
(0,
|
|
562757
|
+
(0, import_react143.useEffect)(() => {
|
|
561864
562758
|
const unsubscribe = onNavigate((event) => {
|
|
561865
562759
|
if (event.destination === "welcome" && currentView === "chat") {
|
|
561866
562760
|
setChatScreenKey((prev) => prev + 1);
|
|
@@ -561888,119 +562782,119 @@ function AppContent({ version: version3, skipWelcome, autoResume, enableYolo, en
|
|
|
561888
562782
|
const loadingFallback = null;
|
|
561889
562783
|
switch (currentView) {
|
|
561890
562784
|
case "welcome":
|
|
561891
|
-
return
|
|
561892
|
-
|
|
562785
|
+
return import_react143.default.createElement(
|
|
562786
|
+
import_react143.Suspense,
|
|
561893
562787
|
{ fallback: loadingFallback },
|
|
561894
|
-
|
|
562788
|
+
import_react143.default.createElement(WelcomeScreen2, { version: version3, onMenuSelect: handleMenuSelect, defaultMenuIndex: welcomeMenuIndex, onMenuSelectionPersist: setWelcomeMenuIndex })
|
|
561895
562789
|
);
|
|
561896
562790
|
case "chat":
|
|
561897
|
-
return
|
|
561898
|
-
|
|
562791
|
+
return import_react143.default.createElement(
|
|
562792
|
+
import_react143.Suspense,
|
|
561899
562793
|
{ fallback: loadingFallback },
|
|
561900
|
-
|
|
562794
|
+
import_react143.default.createElement(ChatScreen2, { key: chatScreenKey, autoResume: autoResume || shouldAutoResume, enableYolo, enablePlan })
|
|
561901
562795
|
);
|
|
561902
562796
|
case "settings":
|
|
561903
|
-
return
|
|
562797
|
+
return import_react143.default.createElement(
|
|
561904
562798
|
Box_default,
|
|
561905
562799
|
{ flexDirection: "column" },
|
|
561906
|
-
|
|
561907
|
-
|
|
562800
|
+
import_react143.default.createElement(Text, { color: "blue" }, "Settings"),
|
|
562801
|
+
import_react143.default.createElement(Text, { color: "gray" }, "Settings interface would be implemented here")
|
|
561908
562802
|
);
|
|
561909
562803
|
case "mcp":
|
|
561910
|
-
return
|
|
561911
|
-
|
|
562804
|
+
return import_react143.default.createElement(
|
|
562805
|
+
import_react143.Suspense,
|
|
561912
562806
|
{ fallback: loadingFallback },
|
|
561913
|
-
|
|
562807
|
+
import_react143.default.createElement(MCPConfigScreen2, { onBack: () => setCurrentView("welcome"), onSave: () => setCurrentView("welcome") })
|
|
561914
562808
|
);
|
|
561915
562809
|
case "systemprompt":
|
|
561916
|
-
return
|
|
561917
|
-
|
|
562810
|
+
return import_react143.default.createElement(
|
|
562811
|
+
import_react143.Suspense,
|
|
561918
562812
|
{ fallback: loadingFallback },
|
|
561919
|
-
|
|
562813
|
+
import_react143.default.createElement(SystemPromptConfigScreen3, { onBack: () => setCurrentView("welcome") })
|
|
561920
562814
|
);
|
|
561921
562815
|
case "help":
|
|
561922
|
-
return
|
|
561923
|
-
|
|
562816
|
+
return import_react143.default.createElement(
|
|
562817
|
+
import_react143.Suspense,
|
|
561924
562818
|
{ fallback: loadingFallback },
|
|
561925
|
-
|
|
562819
|
+
import_react143.default.createElement(HelpScreen2, { onBackDestination: "chat" })
|
|
561926
562820
|
);
|
|
561927
562821
|
case "customheaders":
|
|
561928
|
-
return
|
|
561929
|
-
|
|
562822
|
+
return import_react143.default.createElement(
|
|
562823
|
+
import_react143.Suspense,
|
|
561930
562824
|
{ fallback: loadingFallback },
|
|
561931
|
-
|
|
562825
|
+
import_react143.default.createElement(CustomHeadersScreen3, { onBack: () => setCurrentView("welcome") })
|
|
561932
562826
|
);
|
|
561933
562827
|
case "tasks":
|
|
561934
|
-
return
|
|
561935
|
-
|
|
562828
|
+
return import_react143.default.createElement(
|
|
562829
|
+
import_react143.Suspense,
|
|
561936
562830
|
{ fallback: loadingFallback },
|
|
561937
|
-
|
|
562831
|
+
import_react143.default.createElement(TaskManagerScreen2, { onBack: () => setCurrentView("welcome"), onResumeTask: () => {
|
|
561938
562832
|
setCurrentView("chat");
|
|
561939
562833
|
setChatScreenKey((prev) => prev + 1);
|
|
561940
562834
|
} })
|
|
561941
562835
|
);
|
|
561942
562836
|
default:
|
|
561943
|
-
return
|
|
561944
|
-
|
|
562837
|
+
return import_react143.default.createElement(
|
|
562838
|
+
import_react143.Suspense,
|
|
561945
562839
|
{ fallback: loadingFallback },
|
|
561946
|
-
|
|
562840
|
+
import_react143.default.createElement(WelcomeScreen2, { version: version3, onMenuSelect: handleMenuSelect, defaultMenuIndex: welcomeMenuIndex, onMenuSelectionPersist: setWelcomeMenuIndex })
|
|
561947
562841
|
);
|
|
561948
562842
|
}
|
|
561949
562843
|
};
|
|
561950
|
-
return
|
|
562844
|
+
return import_react143.default.createElement(
|
|
561951
562845
|
Box_default,
|
|
561952
562846
|
{ flexDirection: "column", width: terminalWidth },
|
|
561953
562847
|
renderView(),
|
|
561954
|
-
exitNotification.show &&
|
|
562848
|
+
exitNotification.show && import_react143.default.createElement(
|
|
561955
562849
|
Box_default,
|
|
561956
562850
|
{ paddingX: 1, flexShrink: 0 },
|
|
561957
|
-
|
|
562851
|
+
import_react143.default.createElement(Alert, { variant: "warning" }, exitNotification.message)
|
|
561958
562852
|
)
|
|
561959
562853
|
);
|
|
561960
562854
|
}
|
|
561961
562855
|
function App2({ version: version3, skipWelcome, autoResume, headlessPrompt, headlessSessionId, showTaskList, enableYolo, enablePlan }) {
|
|
561962
562856
|
if (headlessPrompt) {
|
|
561963
562857
|
const loadingFallback = null;
|
|
561964
|
-
return
|
|
562858
|
+
return import_react143.default.createElement(
|
|
561965
562859
|
I18nProvider,
|
|
561966
562860
|
null,
|
|
561967
|
-
|
|
562861
|
+
import_react143.default.createElement(
|
|
561968
562862
|
ThemeProvider,
|
|
561969
562863
|
null,
|
|
561970
|
-
|
|
561971
|
-
|
|
562864
|
+
import_react143.default.createElement(
|
|
562865
|
+
import_react143.Suspense,
|
|
561972
562866
|
{ fallback: loadingFallback },
|
|
561973
|
-
|
|
562867
|
+
import_react143.default.createElement(HeadlessModeScreen2, { prompt: headlessPrompt, sessionId: headlessSessionId, onComplete: () => gracefulExit() })
|
|
561974
562868
|
)
|
|
561975
562869
|
)
|
|
561976
562870
|
);
|
|
561977
562871
|
}
|
|
561978
562872
|
if (showTaskList) {
|
|
561979
|
-
return
|
|
562873
|
+
return import_react143.default.createElement(
|
|
561980
562874
|
I18nProvider,
|
|
561981
562875
|
null,
|
|
561982
|
-
|
|
562876
|
+
import_react143.default.createElement(
|
|
561983
562877
|
ThemeProvider,
|
|
561984
562878
|
null,
|
|
561985
|
-
|
|
562879
|
+
import_react143.default.createElement(ShowTaskListWrapper, null)
|
|
561986
562880
|
)
|
|
561987
562881
|
);
|
|
561988
562882
|
}
|
|
561989
|
-
return
|
|
562883
|
+
return import_react143.default.createElement(
|
|
561990
562884
|
I18nProvider,
|
|
561991
562885
|
null,
|
|
561992
|
-
|
|
562886
|
+
import_react143.default.createElement(
|
|
561993
562887
|
ThemeProvider,
|
|
561994
562888
|
null,
|
|
561995
|
-
|
|
562889
|
+
import_react143.default.createElement(AppContent, { version: version3, skipWelcome, autoResume, enableYolo, enablePlan })
|
|
561996
562890
|
)
|
|
561997
562891
|
);
|
|
561998
562892
|
}
|
|
561999
|
-
var
|
|
562893
|
+
var import_react143, WelcomeScreen2, ChatScreen2, HeadlessModeScreen2, TaskManagerScreen2, MCPConfigScreen2, SystemPromptConfigScreen3, CustomHeadersScreen3, HelpScreen2;
|
|
562000
562894
|
var init_app = __esm({
|
|
562001
562895
|
async "dist/app.js"() {
|
|
562002
562896
|
"use strict";
|
|
562003
|
-
|
|
562897
|
+
import_react143 = __toESM(require_react(), 1);
|
|
562004
562898
|
await init_build2();
|
|
562005
562899
|
await init_build4();
|
|
562006
562900
|
await init_useCursorHide();
|
|
@@ -562011,14 +562905,14 @@ var init_app = __esm({
|
|
|
562011
562905
|
init_ThemeContext();
|
|
562012
562906
|
init_processManager();
|
|
562013
562907
|
init_apiConfig();
|
|
562014
|
-
WelcomeScreen2 =
|
|
562015
|
-
ChatScreen2 =
|
|
562016
|
-
HeadlessModeScreen2 =
|
|
562017
|
-
TaskManagerScreen2 =
|
|
562018
|
-
MCPConfigScreen2 =
|
|
562019
|
-
SystemPromptConfigScreen3 =
|
|
562020
|
-
CustomHeadersScreen3 =
|
|
562021
|
-
HelpScreen2 =
|
|
562908
|
+
WelcomeScreen2 = import_react143.default.lazy(() => init_WelcomeScreen().then(() => WelcomeScreen_exports));
|
|
562909
|
+
ChatScreen2 = import_react143.default.lazy(() => init_ChatScreen().then(() => ChatScreen_exports));
|
|
562910
|
+
HeadlessModeScreen2 = import_react143.default.lazy(() => init_HeadlessModeScreen().then(() => HeadlessModeScreen_exports));
|
|
562911
|
+
TaskManagerScreen2 = import_react143.default.lazy(() => init_TaskManagerScreen().then(() => TaskManagerScreen_exports));
|
|
562912
|
+
MCPConfigScreen2 = import_react143.default.lazy(() => Promise.resolve().then(() => (init_MCPConfigScreen(), MCPConfigScreen_exports)));
|
|
562913
|
+
SystemPromptConfigScreen3 = import_react143.default.lazy(() => init_SystemPromptConfigScreen().then(() => SystemPromptConfigScreen_exports));
|
|
562914
|
+
CustomHeadersScreen3 = import_react143.default.lazy(() => init_CustomHeadersScreen().then(() => CustomHeadersScreen_exports));
|
|
562915
|
+
HelpScreen2 = import_react143.default.lazy(() => init_HelpScreen().then(() => HelpScreen_exports));
|
|
562022
562916
|
}
|
|
562023
562917
|
});
|
|
562024
562918
|
|
|
@@ -563643,17 +564537,17 @@ var SSEServerStatus_exports = {};
|
|
|
563643
564537
|
__export(SSEServerStatus_exports, {
|
|
563644
564538
|
SSEServerStatus: () => SSEServerStatus
|
|
563645
564539
|
});
|
|
563646
|
-
var
|
|
564540
|
+
var import_react144, SSEServerStatus;
|
|
563647
564541
|
var init_SSEServerStatus = __esm({
|
|
563648
564542
|
async "dist/ui/components/sse/SSEServerStatus.js"() {
|
|
563649
564543
|
"use strict";
|
|
563650
|
-
|
|
564544
|
+
import_react144 = __toESM(require_react(), 1);
|
|
563651
564545
|
await init_build2();
|
|
563652
564546
|
init_I18nContext();
|
|
563653
564547
|
SSEServerStatus = ({ port, workingDir, onLogUpdate }) => {
|
|
563654
564548
|
const { t } = useI18n();
|
|
563655
|
-
const [logs, setLogs] = (0,
|
|
563656
|
-
(0,
|
|
564549
|
+
const [logs, setLogs] = (0, import_react144.useState)([]);
|
|
564550
|
+
(0, import_react144.useEffect)(() => {
|
|
563657
564551
|
if (onLogUpdate) {
|
|
563658
564552
|
onLogUpdate((message, level = "info") => {
|
|
563659
564553
|
const timestamp = (/* @__PURE__ */ new Date()).toLocaleTimeString("zh-CN", {
|
|
@@ -563673,89 +564567,89 @@ var init_SSEServerStatus = __esm({
|
|
|
563673
564567
|
return "gray";
|
|
563674
564568
|
}
|
|
563675
564569
|
};
|
|
563676
|
-
return
|
|
564570
|
+
return import_react144.default.createElement(
|
|
563677
564571
|
Box_default,
|
|
563678
564572
|
{ flexDirection: "column" },
|
|
563679
|
-
|
|
564573
|
+
import_react144.default.createElement(
|
|
563680
564574
|
Box_default,
|
|
563681
564575
|
null,
|
|
563682
|
-
|
|
564576
|
+
import_react144.default.createElement(Text, { bold: true, color: "green" }, t.sseServer.started)
|
|
563683
564577
|
),
|
|
563684
|
-
|
|
564578
|
+
import_react144.default.createElement(
|
|
563685
564579
|
Box_default,
|
|
563686
564580
|
null,
|
|
563687
|
-
|
|
564581
|
+
import_react144.default.createElement(
|
|
563688
564582
|
Text,
|
|
563689
564583
|
null,
|
|
563690
564584
|
t.sseServer.port,
|
|
563691
564585
|
": "
|
|
563692
564586
|
),
|
|
563693
|
-
|
|
563694
|
-
workingDir &&
|
|
563695
|
-
|
|
564587
|
+
import_react144.default.createElement(Text, { color: "cyan" }, port),
|
|
564588
|
+
workingDir && import_react144.default.createElement(
|
|
564589
|
+
import_react144.default.Fragment,
|
|
563696
564590
|
null,
|
|
563697
|
-
|
|
564591
|
+
import_react144.default.createElement(
|
|
563698
564592
|
Text,
|
|
563699
564593
|
null,
|
|
563700
564594
|
" | ",
|
|
563701
564595
|
t.sseServer.workingDir,
|
|
563702
564596
|
": "
|
|
563703
564597
|
),
|
|
563704
|
-
|
|
564598
|
+
import_react144.default.createElement(Text, { color: "yellow" }, workingDir)
|
|
563705
564599
|
),
|
|
563706
|
-
|
|
563707
|
-
|
|
564600
|
+
import_react144.default.createElement(Text, null, " | "),
|
|
564601
|
+
import_react144.default.createElement(
|
|
563708
564602
|
Text,
|
|
563709
564603
|
{ color: "green" },
|
|
563710
564604
|
"\u25CF ",
|
|
563711
564605
|
t.sseServer.running
|
|
563712
564606
|
)
|
|
563713
564607
|
),
|
|
563714
|
-
|
|
564608
|
+
import_react144.default.createElement(
|
|
563715
564609
|
Box_default,
|
|
563716
564610
|
{ flexDirection: "column" },
|
|
563717
|
-
|
|
564611
|
+
import_react144.default.createElement(
|
|
563718
564612
|
Text,
|
|
563719
564613
|
{ dimColor: true },
|
|
563720
564614
|
t.sseServer.endpoints,
|
|
563721
564615
|
":"
|
|
563722
564616
|
),
|
|
563723
|
-
|
|
564617
|
+
import_react144.default.createElement(
|
|
563724
564618
|
Text,
|
|
563725
564619
|
{ color: "blue" },
|
|
563726
564620
|
" http://localhost:",
|
|
563727
564621
|
port,
|
|
563728
564622
|
"/events"
|
|
563729
564623
|
),
|
|
563730
|
-
|
|
564624
|
+
import_react144.default.createElement(
|
|
563731
564625
|
Text,
|
|
563732
564626
|
{ color: "blue" },
|
|
563733
564627
|
" POST http://localhost:",
|
|
563734
564628
|
port,
|
|
563735
564629
|
"/message"
|
|
563736
564630
|
),
|
|
563737
|
-
|
|
564631
|
+
import_react144.default.createElement(
|
|
563738
564632
|
Text,
|
|
563739
564633
|
{ color: "blue" },
|
|
563740
564634
|
" POST http://localhost:",
|
|
563741
564635
|
port,
|
|
563742
564636
|
"/session/create"
|
|
563743
564637
|
),
|
|
563744
|
-
|
|
564638
|
+
import_react144.default.createElement(
|
|
563745
564639
|
Text,
|
|
563746
564640
|
{ color: "blue" },
|
|
563747
564641
|
" POST http://localhost:",
|
|
563748
564642
|
port,
|
|
563749
564643
|
"/session/load"
|
|
563750
564644
|
),
|
|
563751
|
-
|
|
564645
|
+
import_react144.default.createElement(
|
|
563752
564646
|
Text,
|
|
563753
564647
|
{ color: "blue" },
|
|
563754
564648
|
" GET http://localhost:",
|
|
563755
564649
|
port,
|
|
563756
564650
|
"/session/list"
|
|
563757
564651
|
),
|
|
563758
|
-
|
|
564652
|
+
import_react144.default.createElement(
|
|
563759
564653
|
Text,
|
|
563760
564654
|
{ color: "blue" },
|
|
563761
564655
|
" ",
|
|
@@ -563763,7 +564657,7 @@ var init_SSEServerStatus = __esm({
|
|
|
563763
564657
|
port,
|
|
563764
564658
|
"/session/rollback-points?sessionId=:sessionId"
|
|
563765
564659
|
),
|
|
563766
|
-
|
|
564660
|
+
import_react144.default.createElement(
|
|
563767
564661
|
Text,
|
|
563768
564662
|
{ color: "blue" },
|
|
563769
564663
|
" ",
|
|
@@ -563771,14 +564665,14 @@ var init_SSEServerStatus = __esm({
|
|
|
563771
564665
|
port,
|
|
563772
564666
|
"/session/:sessionId"
|
|
563773
564667
|
),
|
|
563774
|
-
|
|
564668
|
+
import_react144.default.createElement(
|
|
563775
564669
|
Text,
|
|
563776
564670
|
{ color: "blue" },
|
|
563777
564671
|
" POST http://localhost:",
|
|
563778
564672
|
port,
|
|
563779
564673
|
"/context/compress"
|
|
563780
564674
|
),
|
|
563781
|
-
|
|
564675
|
+
import_react144.default.createElement(
|
|
563782
564676
|
Text,
|
|
563783
564677
|
{ color: "blue" },
|
|
563784
564678
|
" GET http://localhost:",
|
|
@@ -563786,10 +564680,10 @@ var init_SSEServerStatus = __esm({
|
|
|
563786
564680
|
"/health"
|
|
563787
564681
|
)
|
|
563788
564682
|
),
|
|
563789
|
-
|
|
564683
|
+
import_react144.default.createElement(
|
|
563790
564684
|
Box_default,
|
|
563791
564685
|
{ flexDirection: "column" },
|
|
563792
|
-
|
|
564686
|
+
import_react144.default.createElement(
|
|
563793
564687
|
Text,
|
|
563794
564688
|
{ dimColor: true },
|
|
563795
564689
|
t.sseServer.logs,
|
|
@@ -563797,23 +564691,23 @@ var init_SSEServerStatus = __esm({
|
|
|
563797
564691
|
logs.length,
|
|
563798
564692
|
"):"
|
|
563799
564693
|
),
|
|
563800
|
-
|
|
564694
|
+
import_react144.default.createElement(Box_default, { flexDirection: "column" }, logs.map((log, index) => import_react144.default.createElement(
|
|
563801
564695
|
Box_default,
|
|
563802
564696
|
{ key: index },
|
|
563803
|
-
|
|
564697
|
+
import_react144.default.createElement(
|
|
563804
564698
|
Text,
|
|
563805
564699
|
{ dimColor: true },
|
|
563806
564700
|
"[",
|
|
563807
564701
|
log.timestamp,
|
|
563808
564702
|
"] "
|
|
563809
564703
|
),
|
|
563810
|
-
|
|
564704
|
+
import_react144.default.createElement(Text, { color: getLevelColor(log.level) }, log.message)
|
|
563811
564705
|
)))
|
|
563812
564706
|
),
|
|
563813
|
-
|
|
564707
|
+
import_react144.default.createElement(
|
|
563814
564708
|
Box_default,
|
|
563815
564709
|
null,
|
|
563816
|
-
|
|
564710
|
+
import_react144.default.createElement(Text, { dimColor: true }, t.sseServer.stopHint)
|
|
563817
564711
|
)
|
|
563818
564712
|
);
|
|
563819
564713
|
};
|
|
@@ -564121,7 +565015,7 @@ var init_taskExecutor = __esm({
|
|
|
564121
565015
|
});
|
|
564122
565016
|
|
|
564123
565017
|
// dist/cli.js
|
|
564124
|
-
var
|
|
565018
|
+
var import_react145 = __toESM(require_react(), 1);
|
|
564125
565019
|
await init_build2();
|
|
564126
565020
|
init_updateNotice();
|
|
564127
565021
|
await init_build3();
|
|
@@ -565205,10 +566099,10 @@ if (cli.flags.sse) {
|
|
|
565205
566099
|
const { SSEServerStatus: SSEServerStatus2 } = await init_SSEServerStatus().then(() => SSEServerStatus_exports);
|
|
565206
566100
|
const { I18nProvider: I18nProvider2 } = await Promise.resolve().then(() => (init_I18nContext(), I18nContext_exports));
|
|
565207
566101
|
let logUpdater;
|
|
565208
|
-
const { unmount } = render_default(
|
|
566102
|
+
const { unmount } = render_default(import_react145.default.createElement(
|
|
565209
566103
|
I18nProvider2,
|
|
565210
566104
|
null,
|
|
565211
|
-
|
|
566105
|
+
import_react145.default.createElement(SSEServerStatus2, { port, workingDir: workDir || process.cwd(), onLogUpdate: (callback) => {
|
|
565212
566106
|
logUpdater = callback;
|
|
565213
566107
|
} })
|
|
565214
566108
|
));
|
|
@@ -565254,9 +566148,9 @@ if (cli.flags.taskExecute) {
|
|
|
565254
566148
|
process.exit(0);
|
|
565255
566149
|
}
|
|
565256
566150
|
var Startup = ({ version: version3, skipWelcome, autoResume, headlessPrompt, headlessSessionId, showTaskList, isDevMode: isDevMode2, enableYolo, enablePlan }) => {
|
|
565257
|
-
const [appReady, setAppReady] =
|
|
565258
|
-
const [AppComponent, setAppComponent] =
|
|
565259
|
-
|
|
566151
|
+
const [appReady, setAppReady] = import_react145.default.useState(false);
|
|
566152
|
+
const [AppComponent, setAppComponent] = import_react145.default.useState(null);
|
|
566153
|
+
import_react145.default.useEffect(() => {
|
|
565260
566154
|
let mounted = true;
|
|
565261
566155
|
const init = async () => {
|
|
565262
566156
|
const deps = await loadDependencies();
|
|
@@ -565302,22 +566196,22 @@ var Startup = ({ version: version3, skipWelcome, autoResume, headlessPrompt, hea
|
|
|
565302
566196
|
};
|
|
565303
566197
|
}, [version3, isDevMode2]);
|
|
565304
566198
|
if (!appReady || !AppComponent) {
|
|
565305
|
-
return
|
|
566199
|
+
return import_react145.default.createElement(
|
|
565306
566200
|
Box_default,
|
|
565307
566201
|
{ flexDirection: "column" },
|
|
565308
|
-
|
|
566202
|
+
import_react145.default.createElement(
|
|
565309
566203
|
Box_default,
|
|
565310
566204
|
null,
|
|
565311
|
-
|
|
566205
|
+
import_react145.default.createElement(
|
|
565312
566206
|
Text,
|
|
565313
566207
|
{ color: "cyan" },
|
|
565314
|
-
|
|
566208
|
+
import_react145.default.createElement(build_default, { type: "dots" })
|
|
565315
566209
|
),
|
|
565316
|
-
|
|
566210
|
+
import_react145.default.createElement(Text, null, " Loading...")
|
|
565317
566211
|
)
|
|
565318
566212
|
);
|
|
565319
566213
|
}
|
|
565320
|
-
return
|
|
566214
|
+
return import_react145.default.createElement(AppComponent, { version: version3, skipWelcome, autoResume, headlessPrompt, headlessSessionId, showTaskList, enableYolo, enablePlan });
|
|
565321
566215
|
};
|
|
565322
566216
|
process.stdout.write("\x1B[?2004l");
|
|
565323
566217
|
process.stdout.write("\x1B[2K\r");
|
|
@@ -565365,7 +566259,7 @@ process.on("SIGTERM", async () => {
|
|
|
565365
566259
|
await cleanupAsync();
|
|
565366
566260
|
process.exit(0);
|
|
565367
566261
|
});
|
|
565368
|
-
render_default(
|
|
566262
|
+
render_default(import_react145.default.createElement(Startup, { version: VERSION2, skipWelcome: Boolean(cli.flags.c || cli.flags.yolo || cli.flags.yoloP || cli.flags.cYolo), autoResume: Boolean(cli.flags.c || cli.flags.cYolo), headlessPrompt: typeof cli.flags["ask"] === "string" ? cli.flags["ask"] : void 0, headlessSessionId: cli.input[0], showTaskList: cli.flags.taskList, isDevMode: cli.flags.dev, enableYolo: Boolean(cli.flags.yolo || cli.flags.yoloP || cli.flags.cYolo), enablePlan: Boolean(cli.flags.yoloP) }), {
|
|
565369
566263
|
exitOnCtrlC: false,
|
|
565370
566264
|
patchConsole: true
|
|
565371
566265
|
});
|