snow-ai 0.7.21 → 0.7.22
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 +1584 -425
- package/bundle/package.json +1 -1
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -1505,7 +1505,7 @@ var require_react_development = __commonJS({
|
|
|
1505
1505
|
}
|
|
1506
1506
|
return dispatcher.useContext(Context);
|
|
1507
1507
|
}
|
|
1508
|
-
function
|
|
1508
|
+
function useState93(initialState) {
|
|
1509
1509
|
var dispatcher = resolveDispatcher();
|
|
1510
1510
|
return dispatcher.useState(initialState);
|
|
1511
1511
|
}
|
|
@@ -1513,11 +1513,11 @@ var require_react_development = __commonJS({
|
|
|
1513
1513
|
var dispatcher = resolveDispatcher();
|
|
1514
1514
|
return dispatcher.useReducer(reducer2, initialArg, init);
|
|
1515
1515
|
}
|
|
1516
|
-
function
|
|
1516
|
+
function useRef28(initialValue) {
|
|
1517
1517
|
var dispatcher = resolveDispatcher();
|
|
1518
1518
|
return dispatcher.useRef(initialValue);
|
|
1519
1519
|
}
|
|
1520
|
-
function
|
|
1520
|
+
function useEffect87(create3, deps) {
|
|
1521
1521
|
var dispatcher = resolveDispatcher();
|
|
1522
1522
|
return dispatcher.useEffect(create3, deps);
|
|
1523
1523
|
}
|
|
@@ -1529,11 +1529,11 @@ var require_react_development = __commonJS({
|
|
|
1529
1529
|
var dispatcher = resolveDispatcher();
|
|
1530
1530
|
return dispatcher.useLayoutEffect(create3, deps);
|
|
1531
1531
|
}
|
|
1532
|
-
function
|
|
1532
|
+
function useCallback69(callback, deps) {
|
|
1533
1533
|
var dispatcher = resolveDispatcher();
|
|
1534
1534
|
return dispatcher.useCallback(callback, deps);
|
|
1535
1535
|
}
|
|
1536
|
-
function
|
|
1536
|
+
function useMemo47(create3, deps) {
|
|
1537
1537
|
var dispatcher = resolveDispatcher();
|
|
1538
1538
|
return dispatcher.useMemo(create3, deps);
|
|
1539
1539
|
}
|
|
@@ -2296,19 +2296,19 @@ var require_react_development = __commonJS({
|
|
|
2296
2296
|
exports2.memo = memo11;
|
|
2297
2297
|
exports2.startTransition = startTransition;
|
|
2298
2298
|
exports2.unstable_act = act;
|
|
2299
|
-
exports2.useCallback =
|
|
2299
|
+
exports2.useCallback = useCallback69;
|
|
2300
2300
|
exports2.useContext = useContext14;
|
|
2301
2301
|
exports2.useDebugValue = useDebugValue;
|
|
2302
2302
|
exports2.useDeferredValue = useDeferredValue;
|
|
2303
|
-
exports2.useEffect =
|
|
2303
|
+
exports2.useEffect = useEffect87;
|
|
2304
2304
|
exports2.useId = useId;
|
|
2305
2305
|
exports2.useImperativeHandle = useImperativeHandle2;
|
|
2306
2306
|
exports2.useInsertionEffect = useInsertionEffect;
|
|
2307
2307
|
exports2.useLayoutEffect = useLayoutEffect2;
|
|
2308
|
-
exports2.useMemo =
|
|
2308
|
+
exports2.useMemo = useMemo47;
|
|
2309
2309
|
exports2.useReducer = useReducer8;
|
|
2310
|
-
exports2.useRef =
|
|
2311
|
-
exports2.useState =
|
|
2310
|
+
exports2.useRef = useRef28;
|
|
2311
|
+
exports2.useState = useState93;
|
|
2312
2312
|
exports2.useSyncExternalStore = useSyncExternalStore4;
|
|
2313
2313
|
exports2.useTransition = useTransition;
|
|
2314
2314
|
exports2.version = ReactVersion;
|
|
@@ -10447,9 +10447,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
10447
10447
|
module2.exports = function $$$reconciler($$$hostConfig) {
|
|
10448
10448
|
var exports3 = {};
|
|
10449
10449
|
"use strict";
|
|
10450
|
-
var
|
|
10450
|
+
var React129 = require_react();
|
|
10451
10451
|
var Scheduler2 = require_scheduler();
|
|
10452
|
-
var ReactSharedInternals =
|
|
10452
|
+
var ReactSharedInternals = React129.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
10453
10453
|
var suppressWarning = false;
|
|
10454
10454
|
function setSuppressWarning(newSuppressWarning) {
|
|
10455
10455
|
{
|
|
@@ -180635,6 +180635,7 @@ var init_en = __esm({
|
|
|
180635
180635
|
backend: "Show background processes panel",
|
|
180636
180636
|
loop: "Schedule a session-scoped recurring task. Usage: /loop 5m <prompt>",
|
|
180637
180637
|
profiles: "Switch configuration profiles",
|
|
180638
|
+
models: "Open the model switching panel",
|
|
180638
180639
|
subAgentDepth: "Set the maximum nested spawn depth for sub-agents",
|
|
180639
180640
|
vulnerabilityHunting: "Toggle vulnerability hunting mode for security-focused code analysis",
|
|
180640
180641
|
autoFormat: "Auto-formatting switch after file editing. Usage: /auto-format [on|off|status]",
|
|
@@ -180732,6 +180733,41 @@ var init_en = __esm({
|
|
|
180732
180733
|
hint: "Enter save \u2022 Esc close \u2022 digits only",
|
|
180733
180734
|
fileHint: "This setting is persisted to .snow/settings.json in the project root"
|
|
180734
180735
|
},
|
|
180736
|
+
modelsPanel: {
|
|
180737
|
+
title: "Model Switching",
|
|
180738
|
+
subtitle: "Tab to switch tabs | Enter to select",
|
|
180739
|
+
tabAdvanced: "Advanced Model",
|
|
180740
|
+
tabBasic: "Basic Model",
|
|
180741
|
+
tabThinking: "Thinking",
|
|
180742
|
+
currentModel: "Current Model:",
|
|
180743
|
+
notSet: "Not Set",
|
|
180744
|
+
loadingModels: "Loading models...",
|
|
180745
|
+
hint: "Enter to select model | m for manual input | Esc to close",
|
|
180746
|
+
manualInputTitle: "Manual Input",
|
|
180747
|
+
manualInputHint: "Enter to save, Esc to close",
|
|
180748
|
+
filterLabel: "Filter:",
|
|
180749
|
+
manualInputOption: "Manual Input",
|
|
180750
|
+
requestMethod: "Request Method:",
|
|
180751
|
+
showThinkingProcess: "Show Thinking Process:",
|
|
180752
|
+
enableThinking: "Enable Thinking:",
|
|
180753
|
+
thinkingMode: "Thinking Mode:",
|
|
180754
|
+
thinkingStrength: "Thinking Strength:",
|
|
180755
|
+
inputNumberHint: "Enter number, press Enter to save",
|
|
180756
|
+
escCancel: "Esc to cancel",
|
|
180757
|
+
navigationHint: "\u2191\u2193 to select | Enter to toggle | Esc to close",
|
|
180758
|
+
notSupported: "Not Supported",
|
|
180759
|
+
advancedModelLabel: "Advanced Model",
|
|
180760
|
+
basicModelLabel: "Basic Model",
|
|
180761
|
+
thinkingLabel: "Thinking",
|
|
180762
|
+
requestMethodNotSupportedForThinking: "Current request method ({requestMethod}) does not support thinking",
|
|
180763
|
+
requestMethodNotSupportedForThinkingStrength: "Current request method ({requestMethod}) does not support thinking strength settings",
|
|
180764
|
+
anthropicSpeed: "Speed:",
|
|
180765
|
+
saveFailed: "Save failed",
|
|
180766
|
+
modelSaveFailed: "Model save failed",
|
|
180767
|
+
tipLabel: "Tip:",
|
|
180768
|
+
modelCount: "{count} models",
|
|
180769
|
+
scrollHint: "\u2191\u2193 scroll for more"
|
|
180770
|
+
},
|
|
180735
180771
|
profilePanel: {
|
|
180736
180772
|
title: "Select Profile",
|
|
180737
180773
|
scrollHint: "\u2191\u2193 to scroll",
|
|
@@ -182275,6 +182311,7 @@ var init_zh = __esm({
|
|
|
182275
182311
|
backend: "\u663E\u793A\u540E\u53F0\u8FDB\u7A0B\u9762\u677F",
|
|
182276
182312
|
loop: "\u521B\u5EFA\u4F1A\u8BDD\u7EA7\u5FAA\u73AF\u4EFB\u52A1\u3002\u7528\u6CD5: /loop 5m <\u63D0\u793A\u8BCD>",
|
|
182277
182313
|
profiles: "\u6253\u5F00\u914D\u7F6E\u6587\u4EF6\u5207\u6362\u9762\u677F",
|
|
182314
|
+
models: "\u6253\u5F00\u6A21\u578B\u5207\u6362\u9762\u677F",
|
|
182278
182315
|
subAgentDepth: "\u8BBE\u7F6E\u5B50\u4EE3\u7406\u5D4C\u5957\u521B\u5EFA\u6DF1\u5EA6\u4E0A\u9650",
|
|
182279
182316
|
vulnerabilityHunting: "\u5207\u6362\u6F0F\u6D1E\u68C0\u67E5\u6A21\u5F0F\uFF0C\u8FDB\u884C\u5B89\u5168\u6027\u4EE3\u7801\u5206\u6790",
|
|
182280
182317
|
autoFormat: "\u6587\u4EF6\u7F16\u8F91\u540E\u81EA\u52A8\u683C\u5F0F\u5316\u5F00\u5173\u3002\u7528\u6CD5: /auto-format [on|off|status]",
|
|
@@ -182372,6 +182409,41 @@ var init_zh = __esm({
|
|
|
182372
182409
|
hint: "Enter \u4FDD\u5B58 \u2022 Esc \u5173\u95ED \u2022 \u4EC5\u652F\u6301\u6570\u5B57\u8F93\u5165",
|
|
182373
182410
|
fileHint: "\u8BE5\u8BBE\u7F6E\u4F1A\u6301\u4E45\u5316\u5230\u9879\u76EE\u6839\u76EE\u5F55\u7684 .snow/settings.json"
|
|
182374
182411
|
},
|
|
182412
|
+
modelsPanel: {
|
|
182413
|
+
title: "\u6A21\u578B\u5207\u6362",
|
|
182414
|
+
subtitle: "Tab \u5207\u6362\u6807\u7B7E | Enter \u9009\u62E9",
|
|
182415
|
+
tabAdvanced: "\u9AD8\u7EA7\u6A21\u578B",
|
|
182416
|
+
tabBasic: "\u57FA\u7840\u6A21\u578B",
|
|
182417
|
+
tabThinking: "\u601D\u8003",
|
|
182418
|
+
currentModel: "\u5F53\u524D\u6A21\u578B:",
|
|
182419
|
+
notSet: "\u672A\u8BBE\u7F6E",
|
|
182420
|
+
loadingModels: "\u6B63\u5728\u52A0\u8F7D\u6A21\u578B...",
|
|
182421
|
+
hint: "Enter \u9009\u62E9\u6A21\u578B | m \u624B\u52A8\u8F93\u5165 | Esc \u5173\u95ED",
|
|
182422
|
+
manualInputTitle: "\u624B\u52A8\u8F93\u5165",
|
|
182423
|
+
manualInputHint: "Enter \u4FDD\u5B58 | Esc \u5173\u95ED",
|
|
182424
|
+
filterLabel: "\u7B5B\u9009:",
|
|
182425
|
+
manualInputOption: "\u624B\u52A8\u8F93\u5165",
|
|
182426
|
+
requestMethod: "\u8BF7\u6C42\u65B9\u5F0F:",
|
|
182427
|
+
showThinkingProcess: "\u663E\u793A\u601D\u8003\u8FC7\u7A0B:",
|
|
182428
|
+
enableThinking: "\u542F\u7528\u601D\u8003:",
|
|
182429
|
+
thinkingMode: "\u601D\u8003\u6A21\u5F0F:",
|
|
182430
|
+
thinkingStrength: "\u601D\u8003\u5F3A\u5EA6:",
|
|
182431
|
+
inputNumberHint: "\u8F93\u5165\u6570\u5B57\uFF0C\u56DE\u8F66\u4FDD\u5B58",
|
|
182432
|
+
escCancel: "Esc \u53D6\u6D88",
|
|
182433
|
+
navigationHint: "\u2191\u2193\u952E\u9009\u62E9 | Enter \u5207\u6362 | Esc \u5173\u95ED",
|
|
182434
|
+
notSupported: "\u4E0D\u652F\u6301",
|
|
182435
|
+
advancedModelLabel: "\u9AD8\u7EA7\u6A21\u578B",
|
|
182436
|
+
basicModelLabel: "\u57FA\u7840\u6A21\u578B",
|
|
182437
|
+
thinkingLabel: "\u601D\u8003",
|
|
182438
|
+
requestMethodNotSupportedForThinking: "\u5F53\u524D\u8BF7\u6C42\u65B9\u5F0F({requestMethod})\u4E0D\u652F\u6301\u601D\u8003",
|
|
182439
|
+
requestMethodNotSupportedForThinkingStrength: "\u5F53\u524D\u8BF7\u6C42\u65B9\u5F0F({requestMethod})\u4E0D\u652F\u6301\u601D\u8003\u5F3A\u5EA6\u8BBE\u7F6E",
|
|
182440
|
+
anthropicSpeed: "Speed:",
|
|
182441
|
+
saveFailed: "\u4FDD\u5B58\u5931\u8D25",
|
|
182442
|
+
modelSaveFailed: "\u6A21\u578B\u4FDD\u5B58\u5931\u8D25",
|
|
182443
|
+
tipLabel: "\u63D0\u793A:",
|
|
182444
|
+
modelCount: "\u5171 {count} \u4E2A\u6A21\u578B",
|
|
182445
|
+
scrollHint: "\u2191\u2193 \u6EDA\u52A8\u6D4F\u89C8\u66F4\u591A\u6A21\u578B"
|
|
182446
|
+
},
|
|
182375
182447
|
profilePanel: {
|
|
182376
182448
|
title: "\u9009\u62E9\u914D\u7F6E",
|
|
182377
182449
|
scrollHint: "\u2191\u2193 \u6EDA\u52A8",
|
|
@@ -182741,7 +182813,7 @@ var init_zh = __esm({
|
|
|
182741
182813
|
toolSearchEnabled: "\u267E\uFE0E \u5DE5\u5177\u641C\u7D22\u5DF2\u5F00\u542F - \u6309\u9700\u641C\u7D22\u52A0\u8F7D\u5DE5\u5177",
|
|
182742
182814
|
hybridCompressEnabled: "\u21CC \u6DF7\u5408\u538B\u7F29\u5DF2\u5F00\u542F - AI \u6458\u8981 + \u667A\u80FD\u622A\u65AD",
|
|
182743
182815
|
teamModeActive: "\u2691 Agent Team \u6A21\u5F0F\u5DF2\u6FC0\u6D3B - \u591A\u4EE3\u7406\u72EC\u7ACB Worktree \u534F\u540C\u5DE5\u4F5C",
|
|
182744
|
-
tokens: " \
|
|
182816
|
+
tokens: " \u4E2A\u8BCD\u5143",
|
|
182745
182817
|
cached: "\u5DF2\u7F13\u5B58",
|
|
182746
182818
|
newCache: "\u65B0\u7F13\u5B58"
|
|
182747
182819
|
},
|
|
@@ -183914,6 +183986,7 @@ var init_zh_TW = __esm({
|
|
|
183914
183986
|
backend: "\u986F\u793A\u80CC\u666F\u8655\u7406\u7A0B\u5E8F\u9762\u677F",
|
|
183915
183987
|
loop: "\u5EFA\u7ACB\u6703\u8A71\u7D1A\u5FAA\u74B0\u4EFB\u52D9\u3002\u7528\u6CD5: /loop 5m <\u63D0\u793A\u8A5E>",
|
|
183916
183988
|
profiles: "\u958B\u555F\u8A2D\u5B9A\u6A94\u5207\u63DB\u9762\u677F",
|
|
183989
|
+
models: "\u958B\u555F\u6A21\u578B\u5207\u63DB\u9762\u677F",
|
|
183917
183990
|
subAgentDepth: "\u8A2D\u5B9A\u5B50\u4EE3\u7406\u5DE2\u72C0\u5EFA\u7ACB\u6DF1\u5EA6\u4E0A\u9650",
|
|
183918
183991
|
vulnerabilityHunting: "\u5207\u63DB\u6F0F\u6D1E\u6AA2\u67E5\u6A21\u5F0F\uFF0C\u9032\u884C\u5B89\u5168\u6027\u4EE3\u78BC\u5206\u6790",
|
|
183919
183992
|
autoFormat: "\u6587\u4EF6\u7DE8\u8F2F\u5F8C\u81EA\u52D5\u683C\u5F0F\u5316\u958B\u95DC\u3002\u7528\u6CD5: /auto-format [on|off|status]",
|
|
@@ -184011,6 +184084,41 @@ var init_zh_TW = __esm({
|
|
|
184011
184084
|
hint: "Enter \u5132\u5B58 \u2022 Esc \u95DC\u9589 \u2022 \u50C5\u652F\u63F4\u6578\u5B57\u8F38\u5165",
|
|
184012
184085
|
fileHint: "\u6B64\u8A2D\u5B9A\u6703\u6301\u4E45\u5316\u5230\u5C08\u6848\u6839\u76EE\u9304\u7684 .snow/settings.json"
|
|
184013
184086
|
},
|
|
184087
|
+
modelsPanel: {
|
|
184088
|
+
title: "\u6A21\u578B\u5207\u63DB",
|
|
184089
|
+
subtitle: "Tab \u5207\u63DB\u6A19\u7C64 | Enter \u9078\u64C7",
|
|
184090
|
+
tabAdvanced: "\u9032\u968E\u6A21\u578B",
|
|
184091
|
+
tabBasic: "\u57FA\u790E\u6A21\u578B",
|
|
184092
|
+
tabThinking: "\u601D\u8003",
|
|
184093
|
+
currentModel: "\u76EE\u524D\u6A21\u578B:",
|
|
184094
|
+
notSet: "\u672A\u8A2D\u5B9A",
|
|
184095
|
+
loadingModels: "\u6B63\u5728\u8F09\u5165\u6A21\u578B...",
|
|
184096
|
+
hint: "Enter \u9078\u64C7\u6A21\u578B | m \u624B\u52D5\u8F38\u5165 | Esc \u95DC\u9589",
|
|
184097
|
+
manualInputTitle: "\u624B\u52D5\u8F38\u5165",
|
|
184098
|
+
manualInputHint: "Enter \u5132\u5B58 | Esc \u95DC\u9589",
|
|
184099
|
+
filterLabel: "\u7BE9\u9078:",
|
|
184100
|
+
manualInputOption: "\u624B\u52D5\u8F38\u5165",
|
|
184101
|
+
requestMethod: "\u8ACB\u6C42\u65B9\u5F0F:",
|
|
184102
|
+
showThinkingProcess: "\u986F\u793A\u601D\u8003\u904E\u7A0B:",
|
|
184103
|
+
enableThinking: "\u555F\u7528\u601D\u8003:",
|
|
184104
|
+
thinkingMode: "\u601D\u8003\u6A21\u5F0F:",
|
|
184105
|
+
thinkingStrength: "\u601D\u8003\u5F37\u5EA6:",
|
|
184106
|
+
inputNumberHint: "\u8F38\u5165\u6578\u5B57\uFF0CEnter \u5132\u5B58",
|
|
184107
|
+
escCancel: "Esc \u53D6\u6D88",
|
|
184108
|
+
navigationHint: "\u2191\u2193 \u9078\u64C7 | Enter \u5207\u63DB | Esc \u95DC\u9589",
|
|
184109
|
+
notSupported: "\u4E0D\u652F\u63F4",
|
|
184110
|
+
advancedModelLabel: "\u9032\u968E\u6A21\u578B",
|
|
184111
|
+
basicModelLabel: "\u57FA\u790E\u6A21\u578B",
|
|
184112
|
+
thinkingLabel: "\u601D\u8003",
|
|
184113
|
+
requestMethodNotSupportedForThinking: "\u76EE\u524D\u8ACB\u6C42\u65B9\u5F0F({requestMethod})\u4E0D\u652F\u63F4\u601D\u8003",
|
|
184114
|
+
requestMethodNotSupportedForThinkingStrength: "\u76EE\u524D\u8ACB\u6C42\u65B9\u5F0F({requestMethod})\u4E0D\u652F\u63F4\u601D\u8003\u5F37\u5EA6\u8A2D\u5B9A",
|
|
184115
|
+
anthropicSpeed: "Speed:",
|
|
184116
|
+
saveFailed: "\u5132\u5B58\u5931\u6557",
|
|
184117
|
+
modelSaveFailed: "\u6A21\u578B\u5132\u5B58\u5931\u6557",
|
|
184118
|
+
tipLabel: "\u63D0\u793A:",
|
|
184119
|
+
modelCount: "\u5171 {count} \u500B\u6A21\u578B",
|
|
184120
|
+
scrollHint: "\u2191\u2193 \u6372\u52D5\u700F\u89BD\u66F4\u591A\u6A21\u578B"
|
|
184121
|
+
},
|
|
184014
184122
|
profilePanel: {
|
|
184015
184123
|
title: "\u9078\u64C7\u8A2D\u5B9A\u6A94",
|
|
184016
184124
|
scrollHint: "\u2191\u2193 \u6372\u52D5",
|
|
@@ -184380,7 +184488,7 @@ var init_zh_TW = __esm({
|
|
|
184380
184488
|
toolSearchEnabled: "\u267E\uFE0E \u5DE5\u5177\u641C\u5C0B\u5DF2\u958B\u555F - \u6309\u9700\u641C\u5C0B\u8F09\u5165\u5DE5\u5177",
|
|
184381
184489
|
hybridCompressEnabled: "\u21CC \u6DF7\u5408\u58D3\u7E2E\u5DF2\u958B\u555F - AI \u6458\u8981 + \u667A\u6167\u622A\u65B7",
|
|
184382
184490
|
teamModeActive: "\u2691 Agent Team \u6A21\u5F0F\u5DF2\u555F\u7528 - \u591A\u4EE3\u7406\u7368\u7ACB Worktree \u5354\u540C\u5DE5\u4F5C",
|
|
184383
|
-
tokens: " \
|
|
184491
|
+
tokens: " \u500B\u8A5E\u5143",
|
|
184384
184492
|
cached: "\u5DF2\u5FEB\u53D6",
|
|
184385
184493
|
newCache: "\u65B0\u5FEB\u53D6"
|
|
184386
184494
|
},
|
|
@@ -468659,6 +468767,14 @@ function useCommandHandler(options3) {
|
|
|
468659
468767
|
commandName
|
|
468660
468768
|
};
|
|
468661
468769
|
options3.setMessages((prev) => [...prev, commandMessage]);
|
|
468770
|
+
} else if (result2.success && result2.action === "showModelsPanel") {
|
|
468771
|
+
options3.setShowModelsPanel(true);
|
|
468772
|
+
const commandMessage = {
|
|
468773
|
+
role: "command",
|
|
468774
|
+
content: "",
|
|
468775
|
+
commandName
|
|
468776
|
+
};
|
|
468777
|
+
options3.setMessages((prev) => [...prev, commandMessage]);
|
|
468662
468778
|
} else if (result2.success && result2.action === "showBackgroundPanel") {
|
|
468663
468779
|
options3.setShowBackgroundPanel();
|
|
468664
468780
|
const commandMessage = {
|
|
@@ -470696,6 +470812,29 @@ var init_mcp = __esm({
|
|
|
470696
470812
|
}
|
|
470697
470813
|
});
|
|
470698
470814
|
|
|
470815
|
+
// dist/utils/commands/models.js
|
|
470816
|
+
var models_exports = {};
|
|
470817
|
+
__export(models_exports, {
|
|
470818
|
+
default: () => models_default
|
|
470819
|
+
});
|
|
470820
|
+
var models_default;
|
|
470821
|
+
var init_models = __esm({
|
|
470822
|
+
"dist/utils/commands/models.js"() {
|
|
470823
|
+
"use strict";
|
|
470824
|
+
init_commandExecutor();
|
|
470825
|
+
registerCommand("models", {
|
|
470826
|
+
execute: () => {
|
|
470827
|
+
return {
|
|
470828
|
+
success: true,
|
|
470829
|
+
action: "showModelsPanel",
|
|
470830
|
+
message: "Opening model switching panel"
|
|
470831
|
+
};
|
|
470832
|
+
}
|
|
470833
|
+
});
|
|
470834
|
+
models_default = {};
|
|
470835
|
+
}
|
|
470836
|
+
});
|
|
470837
|
+
|
|
470699
470838
|
// dist/utils/commands/subagentDepth.js
|
|
470700
470839
|
var subagentDepth_exports = {};
|
|
470701
470840
|
__export(subagentDepth_exports, {
|
|
@@ -472718,6 +472857,7 @@ var init_utils2 = __esm({
|
|
|
472718
472857
|
init_init();
|
|
472719
472858
|
init_loop();
|
|
472720
472859
|
init_mcp();
|
|
472860
|
+
init_models();
|
|
472721
472861
|
init_subagentDepth();
|
|
472722
472862
|
init_newPrompt();
|
|
472723
472863
|
init_permissions();
|
|
@@ -476591,7 +476731,7 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
476591
476731
|
if (process.env.NODE_ENV !== "production") {
|
|
476592
476732
|
(function() {
|
|
476593
476733
|
"use strict";
|
|
476594
|
-
var
|
|
476734
|
+
var React129 = require_react();
|
|
476595
476735
|
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
476596
476736
|
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
476597
476737
|
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
@@ -476617,7 +476757,7 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
476617
476757
|
}
|
|
476618
476758
|
return null;
|
|
476619
476759
|
}
|
|
476620
|
-
var ReactSharedInternals =
|
|
476760
|
+
var ReactSharedInternals = React129.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
476621
476761
|
function error40(format3) {
|
|
476622
476762
|
{
|
|
476623
476763
|
{
|
|
@@ -479417,7 +479557,7 @@ function filterModels(models, searchTerm) {
|
|
|
479417
479557
|
const lowerSearchTerm = searchTerm.toLowerCase();
|
|
479418
479558
|
return models.filter((model) => model.id.toLowerCase().includes(lowerSearchTerm));
|
|
479419
479559
|
}
|
|
479420
|
-
var
|
|
479560
|
+
var init_models2 = __esm({
|
|
479421
479561
|
"dist/api/models.js"() {
|
|
479422
479562
|
"use strict";
|
|
479423
479563
|
init_apiConfig();
|
|
@@ -480175,7 +480315,7 @@ var init_useConfigState = __esm({
|
|
|
480175
480315
|
"use strict";
|
|
480176
480316
|
import_react68 = __toESM(require_react(), 1);
|
|
480177
480317
|
init_apiConfig();
|
|
480178
|
-
|
|
480318
|
+
init_models2();
|
|
480179
480319
|
init_configManager();
|
|
480180
480320
|
init_i18n();
|
|
480181
480321
|
init_ThemeContext();
|
|
@@ -565433,6 +565573,10 @@ function useCommandPanel(buffer, isProcessing = false) {
|
|
|
565433
565573
|
name: "profiles",
|
|
565434
565574
|
description: t.commandPanel.commands.profiles
|
|
565435
565575
|
},
|
|
565576
|
+
{
|
|
565577
|
+
name: "models",
|
|
565578
|
+
description: t.commandPanel.commands.models || "Open the model switching panel"
|
|
565579
|
+
},
|
|
565436
565580
|
{
|
|
565437
565581
|
name: "loop",
|
|
565438
565582
|
description: t.commandPanel.commands.loop || "Schedule a session-scoped recurring task. Usage: /loop 5m <prompt>"
|
|
@@ -576677,6 +576821,7 @@ function usePanelState() {
|
|
|
576677
576821
|
const [showProfilePanel, setShowProfilePanel] = (0, import_react140.useState)(false);
|
|
576678
576822
|
const [showProfileEditPanel, setShowProfileEditPanel] = (0, import_react140.useState)(false);
|
|
576679
576823
|
const [editingProfileName, setEditingProfileName] = (0, import_react140.useState)(null);
|
|
576824
|
+
const [showModelsPanel, setShowModelsPanel] = (0, import_react140.useState)(false);
|
|
576680
576825
|
const [showDiffReviewPanel, setShowDiffReviewPanel] = (0, import_react140.useState)(false);
|
|
576681
576826
|
const [showConnectionPanel, setShowConnectionPanel] = (0, import_react140.useState)(false);
|
|
576682
576827
|
const [showNewPromptPanel, setShowNewPromptPanel] = (0, import_react140.useState)(false);
|
|
@@ -576693,7 +576838,7 @@ function usePanelState() {
|
|
|
576693
576838
|
return (profile == null ? void 0 : profile.displayName) || activeName;
|
|
576694
576839
|
});
|
|
576695
576840
|
const handleSwitchProfile = (options3) => {
|
|
576696
|
-
if (showSessionPanel || showMcpPanel || showUsagePanel || showCustomCommandConfig || showSkillsCreation || showRoleCreation || showRoleDeletion || showRoleList || showRoleSubagentCreation || showRoleSubagentDeletion || showRoleSubagentList || showReviewCommitPanel || showBranchPanel || showProfilePanel || showDiffReviewPanel || showConnectionPanel || showNewPromptPanel || showTodoListPanel || showPixelEditor || showIdeSelectPanel || options3.hasPendingRollback || options3.hasPendingToolConfirmation || options3.hasPendingUserQuestion || options3.isStreaming) {
|
|
576841
|
+
if (showSessionPanel || showMcpPanel || showUsagePanel || showCustomCommandConfig || showSkillsCreation || showRoleCreation || showRoleDeletion || showRoleList || showRoleSubagentCreation || showRoleSubagentDeletion || showRoleSubagentList || showReviewCommitPanel || showBranchPanel || showProfilePanel || showModelsPanel || showDiffReviewPanel || showConnectionPanel || showNewPromptPanel || showTodoListPanel || showPixelEditor || showIdeSelectPanel || options3.hasPendingRollback || options3.hasPendingToolConfirmation || options3.hasPendingUserQuestion || options3.isStreaming) {
|
|
576697
576842
|
return;
|
|
576698
576843
|
}
|
|
576699
576844
|
setShowProfilePanel(true);
|
|
@@ -576789,6 +576934,9 @@ function usePanelState() {
|
|
|
576789
576934
|
setShowProfilePanel(false);
|
|
576790
576935
|
return true;
|
|
576791
576936
|
}
|
|
576937
|
+
if (showModelsPanel) {
|
|
576938
|
+
return false;
|
|
576939
|
+
}
|
|
576792
576940
|
if (showNewPromptPanel) {
|
|
576793
576941
|
return false;
|
|
576794
576942
|
}
|
|
@@ -576806,7 +576954,7 @@ function usePanelState() {
|
|
|
576806
576954
|
return false;
|
|
576807
576955
|
};
|
|
576808
576956
|
const isAnyPanelOpen = () => {
|
|
576809
|
-
return showSessionPanel || showMcpPanel || showUsagePanel || showCustomCommandConfig || showSkillsCreation || showRoleCreation || showRoleDeletion || showRoleList || showRoleSubagentCreation || showRoleSubagentDeletion || showRoleSubagentList || showWorkingDirPanel || showReviewCommitPanel || showBranchPanel || showProfilePanel || showProfileEditPanel || showDiffReviewPanel || showConnectionPanel || showNewPromptPanel || showTodoListPanel || showPixelEditor || showIdeSelectPanel;
|
|
576957
|
+
return showSessionPanel || showMcpPanel || showUsagePanel || showCustomCommandConfig || showSkillsCreation || showRoleCreation || showRoleDeletion || showRoleList || showRoleSubagentCreation || showRoleSubagentDeletion || showRoleSubagentList || showWorkingDirPanel || showReviewCommitPanel || showBranchPanel || showProfilePanel || showProfileEditPanel || showModelsPanel || showDiffReviewPanel || showConnectionPanel || showNewPromptPanel || showTodoListPanel || showPixelEditor || showIdeSelectPanel;
|
|
576810
576958
|
};
|
|
576811
576959
|
return {
|
|
576812
576960
|
// State
|
|
@@ -576828,6 +576976,7 @@ function usePanelState() {
|
|
|
576828
576976
|
showProfilePanel,
|
|
576829
576977
|
showProfileEditPanel,
|
|
576830
576978
|
editingProfileName,
|
|
576979
|
+
showModelsPanel,
|
|
576831
576980
|
showDiffReviewPanel,
|
|
576832
576981
|
showConnectionPanel,
|
|
576833
576982
|
showNewPromptPanel,
|
|
@@ -576857,6 +577006,7 @@ function usePanelState() {
|
|
|
576857
577006
|
setShowProfilePanel,
|
|
576858
577007
|
setShowProfileEditPanel,
|
|
576859
577008
|
setEditingProfileName,
|
|
577009
|
+
setShowModelsPanel,
|
|
576860
577010
|
openProfileEdit,
|
|
576861
577011
|
closeProfileEditAndReturnToPicker,
|
|
576862
577012
|
setShowDiffReviewPanel,
|
|
@@ -586284,13 +586434,1020 @@ var init_ProfileEditPanel = __esm({
|
|
|
586284
586434
|
}
|
|
586285
586435
|
});
|
|
586286
586436
|
|
|
586437
|
+
// dist/utils/config/configEvents.js
|
|
586438
|
+
import { EventEmitter as EventEmitter11 } from "events";
|
|
586439
|
+
var ConfigEventEmitter, configEvents;
|
|
586440
|
+
var init_configEvents = __esm({
|
|
586441
|
+
"dist/utils/config/configEvents.js"() {
|
|
586442
|
+
"use strict";
|
|
586443
|
+
ConfigEventEmitter = class extends EventEmitter11 {
|
|
586444
|
+
emitConfigChange(event) {
|
|
586445
|
+
this.emit("config-change", event);
|
|
586446
|
+
}
|
|
586447
|
+
onConfigChange(callback) {
|
|
586448
|
+
this.on("config-change", callback);
|
|
586449
|
+
}
|
|
586450
|
+
removeConfigChangeListener(callback) {
|
|
586451
|
+
this.off("config-change", callback);
|
|
586452
|
+
}
|
|
586453
|
+
};
|
|
586454
|
+
configEvents = new ConfigEventEmitter();
|
|
586455
|
+
}
|
|
586456
|
+
});
|
|
586457
|
+
|
|
586458
|
+
// dist/ui/components/panels/ModelsPanel.js
|
|
586459
|
+
var ModelsPanel_exports = {};
|
|
586460
|
+
__export(ModelsPanel_exports, {
|
|
586461
|
+
ModelsPanel: () => ModelsPanel,
|
|
586462
|
+
default: () => ModelsPanel_default
|
|
586463
|
+
});
|
|
586464
|
+
var import_react176, ModelsPanel, ModelsPanel_default;
|
|
586465
|
+
var init_ModelsPanel = __esm({
|
|
586466
|
+
async "dist/ui/components/panels/ModelsPanel.js"() {
|
|
586467
|
+
"use strict";
|
|
586468
|
+
import_react176 = __toESM(require_react(), 1);
|
|
586469
|
+
await init_src();
|
|
586470
|
+
await init_build2();
|
|
586471
|
+
await init_build3();
|
|
586472
|
+
await init_ScrollableSelectInput();
|
|
586473
|
+
init_models2();
|
|
586474
|
+
init_apiConfig();
|
|
586475
|
+
init_ThemeContext();
|
|
586476
|
+
init_i18n();
|
|
586477
|
+
init_configEvents();
|
|
586478
|
+
ModelsPanel = ({ advancedModel, basicModel, visible, onClose }) => {
|
|
586479
|
+
const { theme: theme14 } = useTheme();
|
|
586480
|
+
const { t } = useI18n();
|
|
586481
|
+
const [activeTab, setActiveTab] = (0, import_react176.useState)("advanced");
|
|
586482
|
+
const isModelTab = activeTab === "advanced" || activeTab === "basic";
|
|
586483
|
+
const [localAdvancedModel, setLocalAdvancedModel] = (0, import_react176.useState)(advancedModel);
|
|
586484
|
+
const [localBasicModel, setLocalBasicModel] = (0, import_react176.useState)(basicModel);
|
|
586485
|
+
const [models, setModels] = (0, import_react176.useState)([]);
|
|
586486
|
+
const [loading, setLoading] = (0, import_react176.useState)(false);
|
|
586487
|
+
const [errorMessage, setErrorMessage] = (0, import_react176.useState)("");
|
|
586488
|
+
const [isSelecting, setIsSelecting] = (0, import_react176.useState)(false);
|
|
586489
|
+
const [searchTerm, setSearchTerm] = (0, import_react176.useState)("");
|
|
586490
|
+
const [manualInputMode, setManualInputMode] = (0, import_react176.useState)(false);
|
|
586491
|
+
const [manualInputValue, setManualInputValue] = (0, import_react176.useState)("");
|
|
586492
|
+
const [hasStartedLoading, setHasStartedLoading] = (0, import_react176.useState)(false);
|
|
586493
|
+
const [highlightedModelIndex, setHighlightedModelIndex] = (0, import_react176.useState)(0);
|
|
586494
|
+
const isSelectingRef = (0, import_react176.useRef)(false);
|
|
586495
|
+
const manualInputModeRef = (0, import_react176.useRef)(false);
|
|
586496
|
+
const [requestMethod, setRequestMethod] = (0, import_react176.useState)("chat");
|
|
586497
|
+
const [showThinking, setShowThinking] = (0, import_react176.useState)(true);
|
|
586498
|
+
const [thinkingEnabled, setThinkingEnabled] = (0, import_react176.useState)(false);
|
|
586499
|
+
const [thinkingMode, setThinkingMode] = (0, import_react176.useState)("tokens");
|
|
586500
|
+
const [thinkingBudgetTokens, setThinkingBudgetTokens] = (0, import_react176.useState)(1e4);
|
|
586501
|
+
const [thinkingEffort, setThinkingEffort] = (0, import_react176.useState)("high");
|
|
586502
|
+
const [geminiThinkingEnabled, setGeminiThinkingEnabled] = (0, import_react176.useState)(false);
|
|
586503
|
+
const [geminiThinkingLevel, setGeminiThinkingLevel] = (0, import_react176.useState)("high");
|
|
586504
|
+
const [isGeminiLevelSelecting, setIsGeminiLevelSelecting] = (0, import_react176.useState)(false);
|
|
586505
|
+
const [responsesReasoningEnabled, setResponsesReasoningEnabled] = (0, import_react176.useState)(false);
|
|
586506
|
+
const [responsesReasoningEffort, setResponsesReasoningEffort] = (0, import_react176.useState)("high");
|
|
586507
|
+
const [responsesFastMode, setResponsesFastMode] = (0, import_react176.useState)(false);
|
|
586508
|
+
const [responsesVerbosity, setResponsesVerbosity] = (0, import_react176.useState)("medium");
|
|
586509
|
+
const [thinkingFocusIndex, setThinkingFocusIndex] = (0, import_react176.useState)(0);
|
|
586510
|
+
const [thinkingInputMode, setThinkingInputMode] = (0, import_react176.useState)(null);
|
|
586511
|
+
const [thinkingInputValue, setThinkingInputValue] = (0, import_react176.useState)("");
|
|
586512
|
+
const [isThinkingModeSelecting, setIsThinkingModeSelecting] = (0, import_react176.useState)(false);
|
|
586513
|
+
const [isThinkingEffortSelecting, setIsThinkingEffortSelecting] = (0, import_react176.useState)(false);
|
|
586514
|
+
const [isVerbositySelecting, setIsVerbositySelecting] = (0, import_react176.useState)(false);
|
|
586515
|
+
const [anthropicSpeed, setAnthropicSpeed] = (0, import_react176.useState)(void 0);
|
|
586516
|
+
const [isSpeedSelecting, setIsSpeedSelecting] = (0, import_react176.useState)(false);
|
|
586517
|
+
const [chatThinkingEnabled, setChatThinkingEnabled] = (0, import_react176.useState)(false);
|
|
586518
|
+
const [chatReasoningEffort, setChatReasoningEffort] = (0, import_react176.useState)("high");
|
|
586519
|
+
const [isChatEffortSelecting, setIsChatEffortSelecting] = (0, import_react176.useState)(false);
|
|
586520
|
+
(0, import_react176.useEffect)(() => {
|
|
586521
|
+
var _a20, _b14, _c6, _d4, _e2, _f, _g, _h, _i, _j, _k;
|
|
586522
|
+
if (!visible) {
|
|
586523
|
+
return;
|
|
586524
|
+
}
|
|
586525
|
+
setActiveTab("advanced");
|
|
586526
|
+
setLocalAdvancedModel(advancedModel);
|
|
586527
|
+
setLocalBasicModel(basicModel);
|
|
586528
|
+
setIsSelecting(false);
|
|
586529
|
+
isSelectingRef.current = false;
|
|
586530
|
+
setSearchTerm("");
|
|
586531
|
+
setManualInputMode(false);
|
|
586532
|
+
manualInputModeRef.current = false;
|
|
586533
|
+
setManualInputValue("");
|
|
586534
|
+
setHasStartedLoading(false);
|
|
586535
|
+
setHighlightedModelIndex(0);
|
|
586536
|
+
setThinkingFocusIndex(0);
|
|
586537
|
+
setThinkingInputMode(null);
|
|
586538
|
+
setThinkingInputValue("");
|
|
586539
|
+
setIsThinkingEffortSelecting(false);
|
|
586540
|
+
setIsVerbositySelecting(false);
|
|
586541
|
+
setIsSpeedSelecting(false);
|
|
586542
|
+
setErrorMessage("");
|
|
586543
|
+
const cfg = getSnowConfig();
|
|
586544
|
+
setRequestMethod(cfg.requestMethod || "chat");
|
|
586545
|
+
setShowThinking(cfg.showThinking !== false);
|
|
586546
|
+
setThinkingEnabled(((_a20 = cfg.thinking) == null ? void 0 : _a20.type) === "enabled" || ((_b14 = cfg.thinking) == null ? void 0 : _b14.type) === "adaptive" || false);
|
|
586547
|
+
setThinkingMode(((_c6 = cfg.thinking) == null ? void 0 : _c6.type) === "adaptive" ? "adaptive" : "tokens");
|
|
586548
|
+
setThinkingBudgetTokens(((_d4 = cfg.thinking) == null ? void 0 : _d4.budget_tokens) || 1e4);
|
|
586549
|
+
setThinkingEffort(((_e2 = cfg.thinking) == null ? void 0 : _e2.effort) || "high");
|
|
586550
|
+
setGeminiThinkingEnabled(((_f = cfg.geminiThinking) == null ? void 0 : _f.enabled) || false);
|
|
586551
|
+
setGeminiThinkingLevel(((_g = cfg.geminiThinking) == null ? void 0 : _g.thinkingLevel) || "high");
|
|
586552
|
+
setIsGeminiLevelSelecting(false);
|
|
586553
|
+
setResponsesReasoningEnabled(((_h = cfg.responsesReasoning) == null ? void 0 : _h.enabled) || false);
|
|
586554
|
+
setResponsesReasoningEffort(((_i = cfg.responsesReasoning) == null ? void 0 : _i.effort) || "high");
|
|
586555
|
+
setResponsesFastMode(cfg.responsesFastMode || false);
|
|
586556
|
+
setResponsesVerbosity(cfg.responsesVerbosity || "medium");
|
|
586557
|
+
setAnthropicSpeed(cfg.anthropicSpeed);
|
|
586558
|
+
setChatThinkingEnabled(((_j = cfg.chatThinking) == null ? void 0 : _j.enabled) || false);
|
|
586559
|
+
setChatReasoningEffort(((_k = cfg.chatThinking) == null ? void 0 : _k.reasoning_effort) || "high");
|
|
586560
|
+
setIsChatEffortSelecting(false);
|
|
586561
|
+
}, [visible, advancedModel, basicModel]);
|
|
586562
|
+
(0, import_react176.useEffect)(() => {
|
|
586563
|
+
if (errorMessage) {
|
|
586564
|
+
const timer2 = setTimeout(() => {
|
|
586565
|
+
setErrorMessage("");
|
|
586566
|
+
}, 3e3);
|
|
586567
|
+
return () => clearTimeout(timer2);
|
|
586568
|
+
}
|
|
586569
|
+
return void 0;
|
|
586570
|
+
}, [errorMessage]);
|
|
586571
|
+
const modelTarget = activeTab === "basic" ? "basic" : activeTab === "thinking" ? "thinking" : "advanced";
|
|
586572
|
+
const currentModel = modelTarget === "advanced" ? localAdvancedModel : modelTarget === "basic" ? localBasicModel : "";
|
|
586573
|
+
const currentLabel = modelTarget === "advanced" ? t.modelsPanel.advancedModelLabel : modelTarget === "basic" ? t.modelsPanel.basicModelLabel : t.modelsPanel.thinkingLabel;
|
|
586574
|
+
const loadModels = (0, import_react176.useCallback)(async () => {
|
|
586575
|
+
setLoading(true);
|
|
586576
|
+
setErrorMessage("");
|
|
586577
|
+
try {
|
|
586578
|
+
const fetchedModels = await fetchAvailableModels();
|
|
586579
|
+
setModels(fetchedModels);
|
|
586580
|
+
return fetchedModels;
|
|
586581
|
+
} catch (err) {
|
|
586582
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.loadingModels;
|
|
586583
|
+
setErrorMessage(message);
|
|
586584
|
+
throw err;
|
|
586585
|
+
} finally {
|
|
586586
|
+
setLoading(false);
|
|
586587
|
+
}
|
|
586588
|
+
}, [t]);
|
|
586589
|
+
const applyModel = (0, import_react176.useCallback)(async (value, target) => {
|
|
586590
|
+
setErrorMessage("");
|
|
586591
|
+
try {
|
|
586592
|
+
if (target === "advanced") {
|
|
586593
|
+
await updateSnowConfig({ advancedModel: value });
|
|
586594
|
+
setLocalAdvancedModel(value);
|
|
586595
|
+
} else {
|
|
586596
|
+
await updateSnowConfig({ basicModel: value });
|
|
586597
|
+
setLocalBasicModel(value);
|
|
586598
|
+
}
|
|
586599
|
+
} catch (err) {
|
|
586600
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.modelSaveFailed;
|
|
586601
|
+
setErrorMessage(message);
|
|
586602
|
+
}
|
|
586603
|
+
}, []);
|
|
586604
|
+
const filteredModels = (0, import_react176.useMemo)(() => filterModels(models, searchTerm), [models, searchTerm]);
|
|
586605
|
+
const currentOptions = (0, import_react176.useMemo)(() => {
|
|
586606
|
+
const seen = /* @__PURE__ */ new Set();
|
|
586607
|
+
const uniqueModels = filteredModels.filter((model) => {
|
|
586608
|
+
if (seen.has(model.id))
|
|
586609
|
+
return false;
|
|
586610
|
+
seen.add(model.id);
|
|
586611
|
+
return true;
|
|
586612
|
+
});
|
|
586613
|
+
return [
|
|
586614
|
+
{ label: t.modelsPanel.manualInputOption, value: "__MANUAL_INPUT__" },
|
|
586615
|
+
...uniqueModels.map((model) => ({
|
|
586616
|
+
label: model.id,
|
|
586617
|
+
value: model.id
|
|
586618
|
+
}))
|
|
586619
|
+
];
|
|
586620
|
+
}, [filteredModels, t]);
|
|
586621
|
+
const handleModelSelect = (0, import_react176.useCallback)((value) => {
|
|
586622
|
+
if (value === "__MANUAL_INPUT__") {
|
|
586623
|
+
isSelectingRef.current = false;
|
|
586624
|
+
setIsSelecting(false);
|
|
586625
|
+
setSearchTerm("");
|
|
586626
|
+
manualInputModeRef.current = true;
|
|
586627
|
+
setManualInputMode(true);
|
|
586628
|
+
setManualInputValue(currentModel);
|
|
586629
|
+
setHasStartedLoading(false);
|
|
586630
|
+
return;
|
|
586631
|
+
}
|
|
586632
|
+
if (modelTarget !== "thinking") {
|
|
586633
|
+
void applyModel(value, modelTarget);
|
|
586634
|
+
}
|
|
586635
|
+
isSelectingRef.current = false;
|
|
586636
|
+
setIsSelecting(false);
|
|
586637
|
+
setSearchTerm("");
|
|
586638
|
+
setHasStartedLoading(false);
|
|
586639
|
+
}, [applyModel, currentModel, modelTarget]);
|
|
586640
|
+
const handleManualSave = (0, import_react176.useCallback)(() => {
|
|
586641
|
+
const cleaned = manualInputValue.trim();
|
|
586642
|
+
if (cleaned && modelTarget !== "thinking") {
|
|
586643
|
+
void applyModel(cleaned, modelTarget);
|
|
586644
|
+
}
|
|
586645
|
+
manualInputModeRef.current = false;
|
|
586646
|
+
setManualInputMode(false);
|
|
586647
|
+
setManualInputValue("");
|
|
586648
|
+
setSearchTerm("");
|
|
586649
|
+
setHasStartedLoading(false);
|
|
586650
|
+
}, [applyModel, manualInputValue, modelTarget]);
|
|
586651
|
+
const thinkingEnabledValue = (0, import_react176.useMemo)(() => {
|
|
586652
|
+
if (requestMethod === "anthropic") {
|
|
586653
|
+
return thinkingEnabled;
|
|
586654
|
+
}
|
|
586655
|
+
if (requestMethod === "gemini") {
|
|
586656
|
+
return geminiThinkingEnabled;
|
|
586657
|
+
}
|
|
586658
|
+
if (requestMethod === "responses") {
|
|
586659
|
+
return responsesReasoningEnabled;
|
|
586660
|
+
}
|
|
586661
|
+
if (requestMethod === "chat") {
|
|
586662
|
+
return chatThinkingEnabled;
|
|
586663
|
+
}
|
|
586664
|
+
return false;
|
|
586665
|
+
}, [
|
|
586666
|
+
requestMethod,
|
|
586667
|
+
thinkingEnabled,
|
|
586668
|
+
geminiThinkingEnabled,
|
|
586669
|
+
responsesReasoningEnabled,
|
|
586670
|
+
chatThinkingEnabled
|
|
586671
|
+
]);
|
|
586672
|
+
const thinkingStrengthValue = (0, import_react176.useMemo)(() => {
|
|
586673
|
+
if (requestMethod === "anthropic") {
|
|
586674
|
+
return thinkingMode === "adaptive" ? thinkingEffort : String(thinkingBudgetTokens);
|
|
586675
|
+
}
|
|
586676
|
+
if (requestMethod === "gemini") {
|
|
586677
|
+
return geminiThinkingLevel.toUpperCase();
|
|
586678
|
+
}
|
|
586679
|
+
if (requestMethod === "responses") {
|
|
586680
|
+
return responsesReasoningEffort;
|
|
586681
|
+
}
|
|
586682
|
+
if (requestMethod === "chat") {
|
|
586683
|
+
return chatReasoningEffort.toUpperCase();
|
|
586684
|
+
}
|
|
586685
|
+
return t.modelsPanel.notSupported;
|
|
586686
|
+
}, [
|
|
586687
|
+
requestMethod,
|
|
586688
|
+
thinkingMode,
|
|
586689
|
+
thinkingBudgetTokens,
|
|
586690
|
+
thinkingEffort,
|
|
586691
|
+
geminiThinkingLevel,
|
|
586692
|
+
responsesReasoningEffort,
|
|
586693
|
+
chatReasoningEffort,
|
|
586694
|
+
t
|
|
586695
|
+
]);
|
|
586696
|
+
const applyShowThinking = (0, import_react176.useCallback)(async (next) => {
|
|
586697
|
+
setErrorMessage("");
|
|
586698
|
+
try {
|
|
586699
|
+
setShowThinking(next);
|
|
586700
|
+
await updateSnowConfig({ showThinking: next });
|
|
586701
|
+
configEvents.emitConfigChange({
|
|
586702
|
+
type: "showThinking",
|
|
586703
|
+
value: next
|
|
586704
|
+
});
|
|
586705
|
+
} catch (err) {
|
|
586706
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
586707
|
+
setErrorMessage(message);
|
|
586708
|
+
}
|
|
586709
|
+
}, []);
|
|
586710
|
+
const applyChatThinkingEnabled = (0, import_react176.useCallback)(async (next) => {
|
|
586711
|
+
setErrorMessage("");
|
|
586712
|
+
try {
|
|
586713
|
+
if (!next && showThinking) {
|
|
586714
|
+
setShowThinking(false);
|
|
586715
|
+
await updateSnowConfig({ showThinking: false });
|
|
586716
|
+
configEvents.emitConfigChange({ type: "showThinking", value: false });
|
|
586717
|
+
}
|
|
586718
|
+
setChatThinkingEnabled(next);
|
|
586719
|
+
await updateSnowConfig({
|
|
586720
|
+
chatThinking: next ? { enabled: true, reasoning_effort: chatReasoningEffort } : void 0
|
|
586721
|
+
});
|
|
586722
|
+
} catch (err) {
|
|
586723
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
586724
|
+
setErrorMessage(message);
|
|
586725
|
+
}
|
|
586726
|
+
}, [showThinking, chatReasoningEffort]);
|
|
586727
|
+
const applyThinkingEnabled = (0, import_react176.useCallback)(async (next) => {
|
|
586728
|
+
setErrorMessage("");
|
|
586729
|
+
try {
|
|
586730
|
+
if (!next && showThinking) {
|
|
586731
|
+
setShowThinking(false);
|
|
586732
|
+
await updateSnowConfig({ showThinking: false });
|
|
586733
|
+
configEvents.emitConfigChange({ type: "showThinking", value: false });
|
|
586734
|
+
}
|
|
586735
|
+
if (requestMethod === "anthropic") {
|
|
586736
|
+
setThinkingEnabled(next);
|
|
586737
|
+
await updateSnowConfig({
|
|
586738
|
+
thinking: next ? thinkingMode === "adaptive" ? { type: "adaptive", effort: thinkingEffort } : {
|
|
586739
|
+
type: "enabled",
|
|
586740
|
+
budget_tokens: thinkingBudgetTokens
|
|
586741
|
+
} : void 0
|
|
586742
|
+
});
|
|
586743
|
+
return;
|
|
586744
|
+
}
|
|
586745
|
+
if (requestMethod === "gemini") {
|
|
586746
|
+
setGeminiThinkingEnabled(next);
|
|
586747
|
+
await updateSnowConfig({
|
|
586748
|
+
geminiThinking: next ? { enabled: true, thinkingLevel: geminiThinkingLevel } : void 0
|
|
586749
|
+
});
|
|
586750
|
+
return;
|
|
586751
|
+
}
|
|
586752
|
+
if (requestMethod === "responses") {
|
|
586753
|
+
setResponsesReasoningEnabled(next);
|
|
586754
|
+
await updateSnowConfig({
|
|
586755
|
+
responsesReasoning: {
|
|
586756
|
+
enabled: next,
|
|
586757
|
+
effort: responsesReasoningEffort
|
|
586758
|
+
}
|
|
586759
|
+
});
|
|
586760
|
+
return;
|
|
586761
|
+
}
|
|
586762
|
+
if (requestMethod === "chat") {
|
|
586763
|
+
void applyChatThinkingEnabled(next);
|
|
586764
|
+
return;
|
|
586765
|
+
}
|
|
586766
|
+
setErrorMessage(t.modelsPanel.requestMethodNotSupportedForThinking.replace("{requestMethod}", requestMethod));
|
|
586767
|
+
} catch (err) {
|
|
586768
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
586769
|
+
setErrorMessage(message);
|
|
586770
|
+
}
|
|
586771
|
+
}, [
|
|
586772
|
+
requestMethod,
|
|
586773
|
+
showThinking,
|
|
586774
|
+
thinkingMode,
|
|
586775
|
+
thinkingBudgetTokens,
|
|
586776
|
+
thinkingEffort,
|
|
586777
|
+
geminiThinkingLevel,
|
|
586778
|
+
responsesReasoningEffort,
|
|
586779
|
+
applyChatThinkingEnabled,
|
|
586780
|
+
t
|
|
586781
|
+
]);
|
|
586782
|
+
const applyAnthropicBudgetTokens = (0, import_react176.useCallback)(async (next) => {
|
|
586783
|
+
setErrorMessage("");
|
|
586784
|
+
try {
|
|
586785
|
+
setThinkingBudgetTokens(next);
|
|
586786
|
+
await updateSnowConfig({
|
|
586787
|
+
thinking: thinkingEnabled ? thinkingMode === "adaptive" ? { type: "adaptive", effort: thinkingEffort } : { type: "enabled", budget_tokens: next } : void 0
|
|
586788
|
+
});
|
|
586789
|
+
} catch (err) {
|
|
586790
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
586791
|
+
setErrorMessage(message);
|
|
586792
|
+
}
|
|
586793
|
+
}, [thinkingEnabled, thinkingMode, thinkingEffort]);
|
|
586794
|
+
const applyThinkingMode = (0, import_react176.useCallback)(async (next) => {
|
|
586795
|
+
setErrorMessage("");
|
|
586796
|
+
try {
|
|
586797
|
+
setThinkingMode(next);
|
|
586798
|
+
await updateSnowConfig({
|
|
586799
|
+
thinking: thinkingEnabled ? next === "adaptive" ? { type: "adaptive", effort: thinkingEffort } : { type: "enabled", budget_tokens: thinkingBudgetTokens } : void 0
|
|
586800
|
+
});
|
|
586801
|
+
} catch (err) {
|
|
586802
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
586803
|
+
setErrorMessage(message);
|
|
586804
|
+
}
|
|
586805
|
+
}, [thinkingEnabled, thinkingEffort, thinkingBudgetTokens]);
|
|
586806
|
+
const applyThinkingEffort = (0, import_react176.useCallback)(async (next) => {
|
|
586807
|
+
setErrorMessage("");
|
|
586808
|
+
try {
|
|
586809
|
+
setThinkingEffort(next);
|
|
586810
|
+
await updateSnowConfig({
|
|
586811
|
+
thinking: thinkingEnabled ? { type: "adaptive", effort: next } : void 0
|
|
586812
|
+
});
|
|
586813
|
+
} catch (err) {
|
|
586814
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
586815
|
+
setErrorMessage(message);
|
|
586816
|
+
}
|
|
586817
|
+
}, [thinkingEnabled]);
|
|
586818
|
+
const applyGeminiLevel = (0, import_react176.useCallback)(async (next) => {
|
|
586819
|
+
setErrorMessage("");
|
|
586820
|
+
try {
|
|
586821
|
+
setGeminiThinkingLevel(next);
|
|
586822
|
+
await updateSnowConfig({
|
|
586823
|
+
geminiThinking: geminiThinkingEnabled ? { enabled: true, thinkingLevel: next } : void 0
|
|
586824
|
+
});
|
|
586825
|
+
} catch (err) {
|
|
586826
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
586827
|
+
setErrorMessage(message);
|
|
586828
|
+
}
|
|
586829
|
+
}, [geminiThinkingEnabled]);
|
|
586830
|
+
const applyResponsesEffort = (0, import_react176.useCallback)(async (effort) => {
|
|
586831
|
+
setErrorMessage("");
|
|
586832
|
+
try {
|
|
586833
|
+
setResponsesReasoningEffort(effort);
|
|
586834
|
+
await updateSnowConfig({
|
|
586835
|
+
responsesReasoning: {
|
|
586836
|
+
enabled: responsesReasoningEnabled,
|
|
586837
|
+
effort
|
|
586838
|
+
}
|
|
586839
|
+
});
|
|
586840
|
+
} catch (err) {
|
|
586841
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
586842
|
+
setErrorMessage(message);
|
|
586843
|
+
}
|
|
586844
|
+
}, [responsesReasoningEnabled]);
|
|
586845
|
+
const applyResponsesVerbosity = (0, import_react176.useCallback)(async (verbosity2) => {
|
|
586846
|
+
setErrorMessage("");
|
|
586847
|
+
try {
|
|
586848
|
+
setResponsesVerbosity(verbosity2);
|
|
586849
|
+
await updateSnowConfig({
|
|
586850
|
+
responsesVerbosity: verbosity2
|
|
586851
|
+
});
|
|
586852
|
+
} catch (err) {
|
|
586853
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
586854
|
+
setErrorMessage(message);
|
|
586855
|
+
}
|
|
586856
|
+
}, []);
|
|
586857
|
+
const applyChatReasoningEffort = (0, import_react176.useCallback)(async (effort) => {
|
|
586858
|
+
setErrorMessage("");
|
|
586859
|
+
try {
|
|
586860
|
+
setChatReasoningEffort(effort);
|
|
586861
|
+
await updateSnowConfig({
|
|
586862
|
+
chatThinking: {
|
|
586863
|
+
enabled: chatThinkingEnabled,
|
|
586864
|
+
reasoning_effort: effort
|
|
586865
|
+
}
|
|
586866
|
+
});
|
|
586867
|
+
} catch (err) {
|
|
586868
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
586869
|
+
setErrorMessage(message);
|
|
586870
|
+
}
|
|
586871
|
+
}, [chatThinkingEnabled]);
|
|
586872
|
+
const applyAnthropicSpeed = (0, import_react176.useCallback)(async (next) => {
|
|
586873
|
+
setErrorMessage("");
|
|
586874
|
+
try {
|
|
586875
|
+
setAnthropicSpeed(next);
|
|
586876
|
+
await updateSnowConfig({
|
|
586877
|
+
anthropicSpeed: next
|
|
586878
|
+
});
|
|
586879
|
+
} catch (err) {
|
|
586880
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
586881
|
+
setErrorMessage(message);
|
|
586882
|
+
}
|
|
586883
|
+
}, []);
|
|
586884
|
+
const applyResponsesFastMode = (0, import_react176.useCallback)(async (next) => {
|
|
586885
|
+
setErrorMessage("");
|
|
586886
|
+
try {
|
|
586887
|
+
setResponsesFastMode(next);
|
|
586888
|
+
await updateSnowConfig({
|
|
586889
|
+
responsesFastMode: next
|
|
586890
|
+
});
|
|
586891
|
+
} catch (err) {
|
|
586892
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
586893
|
+
setErrorMessage(message);
|
|
586894
|
+
}
|
|
586895
|
+
}, []);
|
|
586896
|
+
const maxThinkingIndex = (0, import_react176.useMemo)(() => {
|
|
586897
|
+
if (requestMethod === "anthropic")
|
|
586898
|
+
return 4;
|
|
586899
|
+
if (requestMethod === "responses")
|
|
586900
|
+
return 4;
|
|
586901
|
+
if (requestMethod === "gemini")
|
|
586902
|
+
return 2;
|
|
586903
|
+
if (requestMethod === "chat")
|
|
586904
|
+
return 2;
|
|
586905
|
+
return 1;
|
|
586906
|
+
}, [requestMethod]);
|
|
586907
|
+
const selectedIndex = Math.max(0, currentOptions.findIndex((option) => option.value === currentModel));
|
|
586908
|
+
const tabActiveBackground = theme14.colors.menuSelected.startsWith("#") && theme14.colors.menuSelected.length === 9 ? theme14.colors.menuSelected.slice(0, 7) : theme14.colors.menuSelected;
|
|
586909
|
+
use_input_default((input2, key) => {
|
|
586910
|
+
if (!visible) {
|
|
586911
|
+
return;
|
|
586912
|
+
}
|
|
586913
|
+
if (key.escape) {
|
|
586914
|
+
if (thinkingInputMode) {
|
|
586915
|
+
setThinkingInputMode(null);
|
|
586916
|
+
setThinkingInputValue("");
|
|
586917
|
+
return;
|
|
586918
|
+
}
|
|
586919
|
+
if (isThinkingModeSelecting) {
|
|
586920
|
+
setIsThinkingModeSelecting(false);
|
|
586921
|
+
return;
|
|
586922
|
+
}
|
|
586923
|
+
if (isGeminiLevelSelecting) {
|
|
586924
|
+
setIsGeminiLevelSelecting(false);
|
|
586925
|
+
return;
|
|
586926
|
+
}
|
|
586927
|
+
if (isThinkingEffortSelecting) {
|
|
586928
|
+
setIsThinkingEffortSelecting(false);
|
|
586929
|
+
return;
|
|
586930
|
+
}
|
|
586931
|
+
if (isVerbositySelecting) {
|
|
586932
|
+
setIsVerbositySelecting(false);
|
|
586933
|
+
return;
|
|
586934
|
+
}
|
|
586935
|
+
if (isSpeedSelecting) {
|
|
586936
|
+
setIsSpeedSelecting(false);
|
|
586937
|
+
return;
|
|
586938
|
+
}
|
|
586939
|
+
if (isChatEffortSelecting) {
|
|
586940
|
+
setIsChatEffortSelecting(false);
|
|
586941
|
+
return;
|
|
586942
|
+
}
|
|
586943
|
+
if (manualInputModeRef.current || manualInputMode) {
|
|
586944
|
+
manualInputModeRef.current = false;
|
|
586945
|
+
setManualInputMode(false);
|
|
586946
|
+
setManualInputValue("");
|
|
586947
|
+
setSearchTerm("");
|
|
586948
|
+
setHasStartedLoading(false);
|
|
586949
|
+
return;
|
|
586950
|
+
}
|
|
586951
|
+
if (isSelectingRef.current || isSelecting) {
|
|
586952
|
+
isSelectingRef.current = false;
|
|
586953
|
+
setIsSelecting(false);
|
|
586954
|
+
setSearchTerm("");
|
|
586955
|
+
setHasStartedLoading(false);
|
|
586956
|
+
return;
|
|
586957
|
+
}
|
|
586958
|
+
if (loading || hasStartedLoading) {
|
|
586959
|
+
setHasStartedLoading(false);
|
|
586960
|
+
return;
|
|
586961
|
+
}
|
|
586962
|
+
onClose();
|
|
586963
|
+
return;
|
|
586964
|
+
}
|
|
586965
|
+
if (thinkingInputMode) {
|
|
586966
|
+
if (key.return) {
|
|
586967
|
+
const parsed = Number.parseInt(thinkingInputValue.trim(), 10);
|
|
586968
|
+
if (!Number.isNaN(parsed) && parsed >= 0) {
|
|
586969
|
+
if (thinkingInputMode === "anthropicBudgetTokens") {
|
|
586970
|
+
void applyAnthropicBudgetTokens(parsed);
|
|
586971
|
+
}
|
|
586972
|
+
}
|
|
586973
|
+
setThinkingInputMode(null);
|
|
586974
|
+
setThinkingInputValue("");
|
|
586975
|
+
return;
|
|
586976
|
+
}
|
|
586977
|
+
if (key.backspace || key.delete) {
|
|
586978
|
+
setThinkingInputValue((prev) => prev.slice(0, -1));
|
|
586979
|
+
return;
|
|
586980
|
+
}
|
|
586981
|
+
if (input2 && /[0-9]/.test(input2)) {
|
|
586982
|
+
setThinkingInputValue((prev) => prev + input2);
|
|
586983
|
+
}
|
|
586984
|
+
return;
|
|
586985
|
+
}
|
|
586986
|
+
if (manualInputMode) {
|
|
586987
|
+
if (key.return) {
|
|
586988
|
+
handleManualSave();
|
|
586989
|
+
return;
|
|
586990
|
+
}
|
|
586991
|
+
if (key.backspace || key.delete) {
|
|
586992
|
+
setManualInputValue((prev) => prev.slice(0, -1));
|
|
586993
|
+
return;
|
|
586994
|
+
}
|
|
586995
|
+
if (input2) {
|
|
586996
|
+
setManualInputValue((prev) => prev + input2);
|
|
586997
|
+
}
|
|
586998
|
+
return;
|
|
586999
|
+
}
|
|
587000
|
+
if (isSelecting) {
|
|
587001
|
+
if (input2 && /[a-zA-Z0-9-_.]/.test(input2)) {
|
|
587002
|
+
setSearchTerm((prev) => prev + input2);
|
|
587003
|
+
return;
|
|
587004
|
+
}
|
|
587005
|
+
if (key.backspace || key.delete) {
|
|
587006
|
+
setSearchTerm((prev) => prev.slice(0, -1));
|
|
587007
|
+
}
|
|
587008
|
+
return;
|
|
587009
|
+
}
|
|
587010
|
+
if (isThinkingModeSelecting || isGeminiLevelSelecting || isThinkingEffortSelecting || isVerbositySelecting || isSpeedSelecting || isChatEffortSelecting) {
|
|
587011
|
+
return;
|
|
587012
|
+
}
|
|
587013
|
+
if (key.tab) {
|
|
587014
|
+
setActiveTab((prev) => prev === "advanced" ? "basic" : prev === "basic" ? "thinking" : "advanced");
|
|
587015
|
+
return;
|
|
587016
|
+
}
|
|
587017
|
+
if (activeTab === "thinking") {
|
|
587018
|
+
if (key.upArrow) {
|
|
587019
|
+
setThinkingFocusIndex((prev) => prev === 0 ? maxThinkingIndex : prev - 1);
|
|
587020
|
+
return;
|
|
587021
|
+
}
|
|
587022
|
+
if (key.downArrow) {
|
|
587023
|
+
setThinkingFocusIndex((prev) => prev === maxThinkingIndex ? 0 : prev + 1);
|
|
587024
|
+
return;
|
|
587025
|
+
}
|
|
587026
|
+
if (key.return) {
|
|
587027
|
+
if (thinkingFocusIndex === 0) {
|
|
587028
|
+
void applyShowThinking(!showThinking);
|
|
587029
|
+
} else if (thinkingFocusIndex === 1) {
|
|
587030
|
+
void applyThinkingEnabled(!thinkingEnabledValue);
|
|
587031
|
+
} else if (thinkingFocusIndex === 2) {
|
|
587032
|
+
if (requestMethod === "anthropic") {
|
|
587033
|
+
setIsThinkingModeSelecting(true);
|
|
587034
|
+
} else if (requestMethod === "gemini") {
|
|
587035
|
+
setIsGeminiLevelSelecting(true);
|
|
587036
|
+
} else if (requestMethod === "responses") {
|
|
587037
|
+
setIsThinkingEffortSelecting(true);
|
|
587038
|
+
} else if (requestMethod === "chat") {
|
|
587039
|
+
setIsChatEffortSelecting(true);
|
|
587040
|
+
}
|
|
587041
|
+
} else if (thinkingFocusIndex === 3) {
|
|
587042
|
+
if (requestMethod === "anthropic") {
|
|
587043
|
+
if (thinkingMode === "tokens") {
|
|
587044
|
+
setThinkingInputMode("anthropicBudgetTokens");
|
|
587045
|
+
setThinkingInputValue(thinkingBudgetTokens.toString());
|
|
587046
|
+
} else {
|
|
587047
|
+
setIsThinkingEffortSelecting(true);
|
|
587048
|
+
}
|
|
587049
|
+
} else if (requestMethod === "responses") {
|
|
587050
|
+
setIsVerbositySelecting(true);
|
|
587051
|
+
}
|
|
587052
|
+
} else if (thinkingFocusIndex === 4) {
|
|
587053
|
+
if (requestMethod === "anthropic") {
|
|
587054
|
+
setIsSpeedSelecting(true);
|
|
587055
|
+
} else if (requestMethod === "responses") {
|
|
587056
|
+
void applyResponsesFastMode(!responsesFastMode);
|
|
587057
|
+
}
|
|
587058
|
+
}
|
|
587059
|
+
return;
|
|
587060
|
+
}
|
|
587061
|
+
return;
|
|
587062
|
+
}
|
|
587063
|
+
if (key.return) {
|
|
587064
|
+
setErrorMessage("");
|
|
587065
|
+
setHasStartedLoading(true);
|
|
587066
|
+
void loadModels().then(() => {
|
|
587067
|
+
isSelectingRef.current = true;
|
|
587068
|
+
setIsSelecting(true);
|
|
587069
|
+
}).catch(() => {
|
|
587070
|
+
manualInputModeRef.current = true;
|
|
587071
|
+
setManualInputMode(true);
|
|
587072
|
+
setManualInputValue(currentModel);
|
|
587073
|
+
});
|
|
587074
|
+
return;
|
|
587075
|
+
}
|
|
587076
|
+
if ((input2 === "m" || input2 === "M") && isModelTab) {
|
|
587077
|
+
manualInputModeRef.current = true;
|
|
587078
|
+
setManualInputMode(true);
|
|
587079
|
+
setManualInputValue(currentModel);
|
|
587080
|
+
}
|
|
587081
|
+
}, { isActive: visible });
|
|
587082
|
+
if (!visible) {
|
|
587083
|
+
return null;
|
|
587084
|
+
}
|
|
587085
|
+
return import_react176.default.createElement(
|
|
587086
|
+
Box_default,
|
|
587087
|
+
{ flexDirection: "column", paddingX: 1, paddingY: 0 },
|
|
587088
|
+
import_react176.default.createElement(
|
|
587089
|
+
Box_default,
|
|
587090
|
+
{ marginBottom: 1 },
|
|
587091
|
+
import_react176.default.createElement(Text, { bold: true, color: theme14.colors.warning }, t.modelsPanel.title),
|
|
587092
|
+
import_react176.default.createElement(Text, { dimColor: true }, " - "),
|
|
587093
|
+
import_react176.default.createElement(Text, { color: theme14.colors.menuInfo }, t.modelsPanel.subtitle)
|
|
587094
|
+
),
|
|
587095
|
+
import_react176.default.createElement(
|
|
587096
|
+
Box_default,
|
|
587097
|
+
{ marginBottom: 1 },
|
|
587098
|
+
import_react176.default.createElement(Text, { bold: activeTab === "advanced", color: activeTab === "advanced" ? theme14.colors.menuNormal : theme14.colors.menuSecondary, backgroundColor: activeTab === "advanced" ? tabActiveBackground : void 0 }, t.modelsPanel.tabAdvanced),
|
|
587099
|
+
import_react176.default.createElement(Text, null, " "),
|
|
587100
|
+
import_react176.default.createElement(Text, { bold: activeTab === "basic", color: activeTab === "basic" ? theme14.colors.menuNormal : theme14.colors.menuSecondary, backgroundColor: activeTab === "basic" ? tabActiveBackground : void 0 }, t.modelsPanel.tabBasic),
|
|
587101
|
+
import_react176.default.createElement(Text, null, " "),
|
|
587102
|
+
import_react176.default.createElement(Text, { bold: activeTab === "thinking", color: activeTab === "thinking" ? theme14.colors.menuNormal : theme14.colors.menuSecondary, backgroundColor: activeTab === "thinking" ? tabActiveBackground : void 0 }, t.modelsPanel.tabThinking)
|
|
587103
|
+
),
|
|
587104
|
+
loading && activeTab !== "thinking" && import_react176.default.createElement(
|
|
587105
|
+
Box_default,
|
|
587106
|
+
null,
|
|
587107
|
+
import_react176.default.createElement(build_default, { type: "dots" }),
|
|
587108
|
+
import_react176.default.createElement(
|
|
587109
|
+
Text,
|
|
587110
|
+
{ color: theme14.colors.menuInfo },
|
|
587111
|
+
" ",
|
|
587112
|
+
t.modelsPanel.loadingModels
|
|
587113
|
+
)
|
|
587114
|
+
),
|
|
587115
|
+
errorMessage && !loading && import_react176.default.createElement(Alert, { variant: "error" }, errorMessage),
|
|
587116
|
+
activeTab === "thinking" ? import_react176.default.createElement(
|
|
587117
|
+
Box_default,
|
|
587118
|
+
{ flexDirection: "column", paddingX: 1, paddingY: 0 },
|
|
587119
|
+
import_react176.default.createElement(
|
|
587120
|
+
Box_default,
|
|
587121
|
+
null,
|
|
587122
|
+
import_react176.default.createElement(Text, { color: theme14.colors.menuInfo }, t.modelsPanel.requestMethod),
|
|
587123
|
+
import_react176.default.createElement(
|
|
587124
|
+
Text,
|
|
587125
|
+
{ color: theme14.colors.menuSelected },
|
|
587126
|
+
" ",
|
|
587127
|
+
requestMethod
|
|
587128
|
+
)
|
|
587129
|
+
),
|
|
587130
|
+
import_react176.default.createElement(
|
|
587131
|
+
Box_default,
|
|
587132
|
+
{ marginTop: 1 },
|
|
587133
|
+
import_react176.default.createElement(
|
|
587134
|
+
Text,
|
|
587135
|
+
{ color: thinkingFocusIndex === 0 ? theme14.colors.menuSelected : theme14.colors.menuNormal },
|
|
587136
|
+
thinkingFocusIndex === 0 ? "\u276F " : " ",
|
|
587137
|
+
t.modelsPanel.showThinkingProcess
|
|
587138
|
+
),
|
|
587139
|
+
import_react176.default.createElement(
|
|
587140
|
+
Text,
|
|
587141
|
+
{ color: theme14.colors.menuSelected },
|
|
587142
|
+
" ",
|
|
587143
|
+
showThinking ? "[\u2713]" : "[ ]"
|
|
587144
|
+
)
|
|
587145
|
+
),
|
|
587146
|
+
(requestMethod === "anthropic" || requestMethod === "gemini" || requestMethod === "responses" || requestMethod === "chat") && import_react176.default.createElement(
|
|
587147
|
+
Box_default,
|
|
587148
|
+
null,
|
|
587149
|
+
import_react176.default.createElement(
|
|
587150
|
+
Text,
|
|
587151
|
+
{ color: thinkingFocusIndex === 1 ? theme14.colors.menuSelected : theme14.colors.menuNormal },
|
|
587152
|
+
thinkingFocusIndex === 1 ? "\u276F " : " ",
|
|
587153
|
+
t.modelsPanel.enableThinking
|
|
587154
|
+
),
|
|
587155
|
+
import_react176.default.createElement(
|
|
587156
|
+
Text,
|
|
587157
|
+
{ color: theme14.colors.menuSelected },
|
|
587158
|
+
" ",
|
|
587159
|
+
thinkingEnabledValue ? "[\u2713]" : "[ ]"
|
|
587160
|
+
)
|
|
587161
|
+
),
|
|
587162
|
+
requestMethod === "anthropic" && import_react176.default.createElement(
|
|
587163
|
+
Box_default,
|
|
587164
|
+
null,
|
|
587165
|
+
import_react176.default.createElement(
|
|
587166
|
+
Text,
|
|
587167
|
+
{ color: thinkingFocusIndex === 2 ? theme14.colors.menuSelected : theme14.colors.menuNormal },
|
|
587168
|
+
thinkingFocusIndex === 2 ? "\u276F " : " ",
|
|
587169
|
+
t.configScreen.thinkingMode
|
|
587170
|
+
),
|
|
587171
|
+
import_react176.default.createElement(
|
|
587172
|
+
Text,
|
|
587173
|
+
{ color: theme14.colors.menuSelected },
|
|
587174
|
+
" ",
|
|
587175
|
+
thinkingMode === "tokens" ? t.configScreen.thinkingModeTokens : t.configScreen.thinkingModeAdaptive
|
|
587176
|
+
)
|
|
587177
|
+
),
|
|
587178
|
+
(requestMethod === "anthropic" || requestMethod === "gemini" || requestMethod === "responses" || requestMethod === "chat") && import_react176.default.createElement(
|
|
587179
|
+
Box_default,
|
|
587180
|
+
null,
|
|
587181
|
+
import_react176.default.createElement(
|
|
587182
|
+
Text,
|
|
587183
|
+
{ color: thinkingFocusIndex === (requestMethod === "anthropic" ? 3 : 2) ? theme14.colors.menuSelected : theme14.colors.menuNormal },
|
|
587184
|
+
thinkingFocusIndex === (requestMethod === "anthropic" ? 3 : 2) ? "\u276F " : " ",
|
|
587185
|
+
t.modelsPanel.thinkingStrength
|
|
587186
|
+
),
|
|
587187
|
+
import_react176.default.createElement(
|
|
587188
|
+
Text,
|
|
587189
|
+
{ color: theme14.colors.menuSelected },
|
|
587190
|
+
" ",
|
|
587191
|
+
thinkingStrengthValue
|
|
587192
|
+
)
|
|
587193
|
+
),
|
|
587194
|
+
requestMethod === "anthropic" && import_react176.default.createElement(
|
|
587195
|
+
Box_default,
|
|
587196
|
+
null,
|
|
587197
|
+
import_react176.default.createElement(
|
|
587198
|
+
Text,
|
|
587199
|
+
{ color: thinkingFocusIndex === 4 ? theme14.colors.menuSelected : theme14.colors.menuNormal },
|
|
587200
|
+
thinkingFocusIndex === 4 ? "\u276F " : " ",
|
|
587201
|
+
t.modelsPanel.anthropicSpeed
|
|
587202
|
+
),
|
|
587203
|
+
import_react176.default.createElement(
|
|
587204
|
+
Text,
|
|
587205
|
+
{ color: theme14.colors.menuSelected },
|
|
587206
|
+
" ",
|
|
587207
|
+
anthropicSpeed === "fast" ? t.configScreen.anthropicSpeedFast : anthropicSpeed === "standard" ? t.configScreen.anthropicSpeedStandard : t.configScreen.anthropicSpeedNotUsed
|
|
587208
|
+
)
|
|
587209
|
+
),
|
|
587210
|
+
requestMethod === "responses" && import_react176.default.createElement(
|
|
587211
|
+
Box_default,
|
|
587212
|
+
null,
|
|
587213
|
+
import_react176.default.createElement(
|
|
587214
|
+
Text,
|
|
587215
|
+
{ color: thinkingFocusIndex === 3 ? theme14.colors.menuSelected : theme14.colors.menuNormal },
|
|
587216
|
+
thinkingFocusIndex === 3 ? "\u276F " : " ",
|
|
587217
|
+
t.configScreen.responsesVerbosity
|
|
587218
|
+
),
|
|
587219
|
+
import_react176.default.createElement(
|
|
587220
|
+
Text,
|
|
587221
|
+
{ color: theme14.colors.menuSelected },
|
|
587222
|
+
" ",
|
|
587223
|
+
responsesVerbosity.toUpperCase()
|
|
587224
|
+
)
|
|
587225
|
+
),
|
|
587226
|
+
requestMethod === "responses" && import_react176.default.createElement(
|
|
587227
|
+
Box_default,
|
|
587228
|
+
null,
|
|
587229
|
+
import_react176.default.createElement(
|
|
587230
|
+
Text,
|
|
587231
|
+
{ color: thinkingFocusIndex === 4 ? theme14.colors.menuSelected : theme14.colors.menuNormal },
|
|
587232
|
+
thinkingFocusIndex === 4 ? "\u276F " : " ",
|
|
587233
|
+
t.configScreen.responsesFastMode
|
|
587234
|
+
),
|
|
587235
|
+
import_react176.default.createElement(
|
|
587236
|
+
Text,
|
|
587237
|
+
{ color: theme14.colors.menuSelected },
|
|
587238
|
+
" ",
|
|
587239
|
+
responsesFastMode ? "[\u2713]" : "[ ]"
|
|
587240
|
+
)
|
|
587241
|
+
),
|
|
587242
|
+
thinkingInputMode && import_react176.default.createElement(
|
|
587243
|
+
Box_default,
|
|
587244
|
+
{ flexDirection: "column", marginTop: 1 },
|
|
587245
|
+
import_react176.default.createElement(Text, { color: theme14.colors.menuInfo }, t.modelsPanel.inputNumberHint),
|
|
587246
|
+
import_react176.default.createElement(
|
|
587247
|
+
Box_default,
|
|
587248
|
+
{ marginLeft: 1 },
|
|
587249
|
+
import_react176.default.createElement(
|
|
587250
|
+
Text,
|
|
587251
|
+
{ color: theme14.colors.menuSelected },
|
|
587252
|
+
`\u276F ${thinkingInputValue}`,
|
|
587253
|
+
import_react176.default.createElement(Text, { color: theme14.colors.menuNormal }, "_")
|
|
587254
|
+
)
|
|
587255
|
+
),
|
|
587256
|
+
import_react176.default.createElement(
|
|
587257
|
+
Box_default,
|
|
587258
|
+
null,
|
|
587259
|
+
import_react176.default.createElement(Text, { dimColor: true, color: theme14.colors.menuSecondary }, t.modelsPanel.escCancel)
|
|
587260
|
+
)
|
|
587261
|
+
),
|
|
587262
|
+
isThinkingModeSelecting && import_react176.default.createElement(
|
|
587263
|
+
Box_default,
|
|
587264
|
+
{ marginTop: 1 },
|
|
587265
|
+
import_react176.default.createElement(ScrollableSelectInput, { items: [
|
|
587266
|
+
{ label: t.configScreen.thinkingModeTokens, value: "tokens" },
|
|
587267
|
+
{
|
|
587268
|
+
label: t.configScreen.thinkingModeAdaptive,
|
|
587269
|
+
value: "adaptive"
|
|
587270
|
+
}
|
|
587271
|
+
], initialIndex: thinkingMode === "tokens" ? 0 : 1, isFocused: true, onSelect: (item) => {
|
|
587272
|
+
void applyThinkingMode(item.value);
|
|
587273
|
+
setIsThinkingModeSelecting(false);
|
|
587274
|
+
} })
|
|
587275
|
+
),
|
|
587276
|
+
isThinkingEffortSelecting && import_react176.default.createElement(
|
|
587277
|
+
Box_default,
|
|
587278
|
+
{ marginTop: 1 },
|
|
587279
|
+
import_react176.default.createElement(ScrollableSelectInput, { items: (requestMethod === "anthropic" ? [
|
|
587280
|
+
{ label: "low", value: "low" },
|
|
587281
|
+
{ label: "medium", value: "medium" },
|
|
587282
|
+
{ label: "high", value: "high" },
|
|
587283
|
+
{ label: "max", value: "max" }
|
|
587284
|
+
] : [
|
|
587285
|
+
{ label: "none", value: "none" },
|
|
587286
|
+
{ label: "low", value: "low" },
|
|
587287
|
+
{ label: "medium", value: "medium" },
|
|
587288
|
+
{ label: "high", value: "high" },
|
|
587289
|
+
{ label: "xhigh", value: "xhigh" }
|
|
587290
|
+
]).map((i) => ({
|
|
587291
|
+
label: i.label,
|
|
587292
|
+
value: i.value
|
|
587293
|
+
})), limit: 6, disableNumberShortcuts: true, initialIndex: Math.max(0, requestMethod === "anthropic" ? ["low", "medium", "high", "max"].indexOf(thinkingEffort) : ["none", "low", "medium", "high", "xhigh"].indexOf(responsesReasoningEffort)), isFocused: true, onSelect: (item) => {
|
|
587294
|
+
if (requestMethod === "anthropic") {
|
|
587295
|
+
void applyThinkingEffort(item.value);
|
|
587296
|
+
} else {
|
|
587297
|
+
void applyResponsesEffort(item.value);
|
|
587298
|
+
}
|
|
587299
|
+
setIsThinkingEffortSelecting(false);
|
|
587300
|
+
} })
|
|
587301
|
+
),
|
|
587302
|
+
isVerbositySelecting && import_react176.default.createElement(
|
|
587303
|
+
Box_default,
|
|
587304
|
+
{ marginTop: 1 },
|
|
587305
|
+
import_react176.default.createElement(ScrollableSelectInput, { items: [
|
|
587306
|
+
{ label: "low", value: "low" },
|
|
587307
|
+
{ label: "medium", value: "medium" },
|
|
587308
|
+
{ label: "high", value: "high" }
|
|
587309
|
+
], limit: 6, disableNumberShortcuts: true, initialIndex: Math.max(0, ["low", "medium", "high"].indexOf(responsesVerbosity)), isFocused: true, onSelect: (item) => {
|
|
587310
|
+
void applyResponsesVerbosity(item.value);
|
|
587311
|
+
setIsVerbositySelecting(false);
|
|
587312
|
+
} })
|
|
587313
|
+
),
|
|
587314
|
+
isGeminiLevelSelecting && import_react176.default.createElement(
|
|
587315
|
+
Box_default,
|
|
587316
|
+
{ marginTop: 1 },
|
|
587317
|
+
import_react176.default.createElement(ScrollableSelectInput, { items: [
|
|
587318
|
+
{ label: "MINIMAL", value: "minimal" },
|
|
587319
|
+
{ label: "LOW", value: "low" },
|
|
587320
|
+
{ label: "MEDIUM", value: "medium" },
|
|
587321
|
+
{ label: "HIGH", value: "high" }
|
|
587322
|
+
], limit: 6, disableNumberShortcuts: true, initialIndex: Math.max(0, ["minimal", "low", "medium", "high"].indexOf(geminiThinkingLevel)), isFocused: true, onSelect: (item) => {
|
|
587323
|
+
void applyGeminiLevel(item.value);
|
|
587324
|
+
setIsGeminiLevelSelecting(false);
|
|
587325
|
+
} })
|
|
587326
|
+
),
|
|
587327
|
+
isSpeedSelecting && import_react176.default.createElement(
|
|
587328
|
+
Box_default,
|
|
587329
|
+
{ marginTop: 1 },
|
|
587330
|
+
import_react176.default.createElement(ScrollableSelectInput, { items: [
|
|
587331
|
+
{
|
|
587332
|
+
label: t.configScreen.anthropicSpeedNotUsed,
|
|
587333
|
+
value: "__NONE__"
|
|
587334
|
+
},
|
|
587335
|
+
{ label: t.configScreen.anthropicSpeedFast, value: "fast" },
|
|
587336
|
+
{
|
|
587337
|
+
label: t.configScreen.anthropicSpeedStandard,
|
|
587338
|
+
value: "standard"
|
|
587339
|
+
}
|
|
587340
|
+
], limit: 6, disableNumberShortcuts: true, initialIndex: anthropicSpeed === "fast" ? 1 : anthropicSpeed === "standard" ? 2 : 0, isFocused: true, onSelect: (item) => {
|
|
587341
|
+
void applyAnthropicSpeed(item.value === "__NONE__" ? void 0 : item.value);
|
|
587342
|
+
setIsSpeedSelecting(false);
|
|
587343
|
+
} })
|
|
587344
|
+
),
|
|
587345
|
+
isChatEffortSelecting && import_react176.default.createElement(
|
|
587346
|
+
Box_default,
|
|
587347
|
+
{ marginTop: 1 },
|
|
587348
|
+
import_react176.default.createElement(ScrollableSelectInput, { items: [
|
|
587349
|
+
{ label: "LOW", value: "low" },
|
|
587350
|
+
{ label: "MEDIUM", value: "medium" },
|
|
587351
|
+
{ label: "HIGH", value: "high" },
|
|
587352
|
+
{ label: "MAX", value: "max" }
|
|
587353
|
+
], limit: 6, disableNumberShortcuts: true, initialIndex: Math.max(0, ["low", "medium", "high", "max"].indexOf(chatReasoningEffort)), isFocused: true, onSelect: (item) => {
|
|
587354
|
+
void applyChatReasoningEffort(item.value);
|
|
587355
|
+
setIsChatEffortSelecting(false);
|
|
587356
|
+
} })
|
|
587357
|
+
),
|
|
587358
|
+
!thinkingInputMode && !isThinkingModeSelecting && !isGeminiLevelSelecting && !isThinkingEffortSelecting && !isVerbositySelecting && !isSpeedSelecting && !isChatEffortSelecting && import_react176.default.createElement(
|
|
587359
|
+
Box_default,
|
|
587360
|
+
{ marginTop: 1 },
|
|
587361
|
+
import_react176.default.createElement(Text, { dimColor: true, color: theme14.colors.menuSecondary }, t.modelsPanel.navigationHint)
|
|
587362
|
+
)
|
|
587363
|
+
) : manualInputMode ? import_react176.default.createElement(
|
|
587364
|
+
Box_default,
|
|
587365
|
+
{ flexDirection: "column", paddingX: 1, paddingY: 0 },
|
|
587366
|
+
import_react176.default.createElement(
|
|
587367
|
+
Text,
|
|
587368
|
+
{ color: theme14.colors.menuInfo },
|
|
587369
|
+
t.modelsPanel.manualInputTitle,
|
|
587370
|
+
currentLabel
|
|
587371
|
+
),
|
|
587372
|
+
import_react176.default.createElement(
|
|
587373
|
+
Box_default,
|
|
587374
|
+
{ marginLeft: 1 },
|
|
587375
|
+
import_react176.default.createElement(
|
|
587376
|
+
Text,
|
|
587377
|
+
{ color: theme14.colors.menuSelected },
|
|
587378
|
+
`\u276F ${manualInputValue}`,
|
|
587379
|
+
import_react176.default.createElement(Text, { color: theme14.colors.menuNormal }, "_")
|
|
587380
|
+
)
|
|
587381
|
+
),
|
|
587382
|
+
import_react176.default.createElement(
|
|
587383
|
+
Box_default,
|
|
587384
|
+
null,
|
|
587385
|
+
import_react176.default.createElement(Text, { dimColor: true, color: theme14.colors.menuSecondary }, t.modelsPanel.manualInputHint)
|
|
587386
|
+
)
|
|
587387
|
+
) : isSelecting ? import_react176.default.createElement(
|
|
587388
|
+
Box_default,
|
|
587389
|
+
{ flexDirection: "column", paddingX: 1, paddingY: 0 },
|
|
587390
|
+
import_react176.default.createElement(
|
|
587391
|
+
Box_default,
|
|
587392
|
+
null,
|
|
587393
|
+
searchTerm && import_react176.default.createElement(
|
|
587394
|
+
Text,
|
|
587395
|
+
{ color: theme14.colors.menuInfo },
|
|
587396
|
+
t.modelsPanel.filterLabel,
|
|
587397
|
+
" ",
|
|
587398
|
+
searchTerm,
|
|
587399
|
+
" "
|
|
587400
|
+
),
|
|
587401
|
+
import_react176.default.createElement(
|
|
587402
|
+
Text,
|
|
587403
|
+
{ color: theme14.colors.warning, bold: true },
|
|
587404
|
+
t.modelsPanel.modelCount.replace("{count}", (currentOptions.length - 1).toString()),
|
|
587405
|
+
currentOptions.length > 10 && ` (${highlightedModelIndex + 1}/${currentOptions.length})`
|
|
587406
|
+
)
|
|
587407
|
+
),
|
|
587408
|
+
import_react176.default.createElement(ScrollableSelectInput, { items: currentOptions, limit: 10, disableNumberShortcuts: true, initialIndex: selectedIndex, isFocused: isSelecting, onSelect: (item) => handleModelSelect(item.value), onHighlight: (item) => {
|
|
587409
|
+
const idx = currentOptions.findIndex((o) => o.value === item.value);
|
|
587410
|
+
if (idx >= 0)
|
|
587411
|
+
setHighlightedModelIndex(idx);
|
|
587412
|
+
} }),
|
|
587413
|
+
currentOptions.length > 10 && import_react176.default.createElement(
|
|
587414
|
+
Box_default,
|
|
587415
|
+
null,
|
|
587416
|
+
import_react176.default.createElement(Text, { dimColor: true, color: theme14.colors.menuSecondary }, t.modelsPanel.scrollHint)
|
|
587417
|
+
)
|
|
587418
|
+
) : import_react176.default.createElement(
|
|
587419
|
+
Box_default,
|
|
587420
|
+
{ flexDirection: "column", paddingX: 1, paddingY: 0 },
|
|
587421
|
+
import_react176.default.createElement(
|
|
587422
|
+
Box_default,
|
|
587423
|
+
null,
|
|
587424
|
+
import_react176.default.createElement(Text, { color: theme14.colors.menuInfo }, t.modelsPanel.currentModel),
|
|
587425
|
+
import_react176.default.createElement(
|
|
587426
|
+
Text,
|
|
587427
|
+
{ color: theme14.colors.menuSelected },
|
|
587428
|
+
" ",
|
|
587429
|
+
currentModel || t.modelsPanel.notSet
|
|
587430
|
+
)
|
|
587431
|
+
),
|
|
587432
|
+
import_react176.default.createElement(
|
|
587433
|
+
Box_default,
|
|
587434
|
+
null,
|
|
587435
|
+
import_react176.default.createElement(Text, { dimColor: true, color: theme14.colors.menuSecondary }, t.modelsPanel.hint)
|
|
587436
|
+
)
|
|
587437
|
+
)
|
|
587438
|
+
);
|
|
587439
|
+
};
|
|
587440
|
+
ModelsPanel_default = ModelsPanel;
|
|
587441
|
+
}
|
|
587442
|
+
});
|
|
587443
|
+
|
|
586287
587444
|
// dist/ui/pages/chatScreen/ChatScreenPanels.js
|
|
586288
|
-
function ChatScreenPanels({ terminalWidth, workingDirectory, panelState, snapshotState, handleSessionPanelSelect, showPermissionsPanel, setShowPermissionsPanel, showSubAgentDepthPanel, setShowSubAgentDepthPanel, alwaysApprovedTools, removeFromAlwaysApproved, clearAllAlwaysApproved, setMessages, t, onPromptAccept, handleRollbackConfirm }) {
|
|
587445
|
+
function ChatScreenPanels({ terminalWidth, workingDirectory, panelState, snapshotState, handleSessionPanelSelect, showPermissionsPanel, setShowPermissionsPanel, showSubAgentDepthPanel, setShowSubAgentDepthPanel, modelsPanelAdvancedModel, modelsPanelBasicModel, alwaysApprovedTools, removeFromAlwaysApproved, clearAllAlwaysApproved, setMessages, t, onPromptAccept, handleRollbackConfirm }) {
|
|
586289
587446
|
var _a20;
|
|
586290
|
-
return
|
|
586291
|
-
|
|
587447
|
+
return import_react177.default.createElement(
|
|
587448
|
+
import_react177.default.Fragment,
|
|
586292
587449
|
null,
|
|
586293
|
-
|
|
587450
|
+
import_react177.default.createElement(PanelsManager, { terminalWidth, workingDirectory, showSessionPanel: panelState.showSessionPanel, showMcpPanel: panelState.showMcpPanel, showUsagePanel: panelState.showUsagePanel, showHelpPanel: panelState.showHelpPanel, showCustomCommandConfig: panelState.showCustomCommandConfig, showSkillsCreation: panelState.showSkillsCreation, showRoleCreation: panelState.showRoleCreation, showRoleDeletion: panelState.showRoleDeletion, showRoleList: panelState.showRoleList, showRoleSubagentCreation: panelState.showRoleSubagentCreation, showRoleSubagentDeletion: panelState.showRoleSubagentDeletion, showRoleSubagentList: panelState.showRoleSubagentList, showWorkingDirPanel: panelState.showWorkingDirPanel, showBranchPanel: panelState.showBranchPanel, showConnectionPanel: panelState.showConnectionPanel, showTodoListPanel: panelState.showTodoListPanel, connectionPanelApiUrl: panelState.connectionPanelApiUrl, setShowSessionPanel: panelState.setShowSessionPanel, setShowMcpPanel: panelState.setShowMcpPanel, setShowCustomCommandConfig: panelState.setShowCustomCommandConfig, setShowSkillsCreation: panelState.setShowSkillsCreation, setShowRoleCreation: panelState.setShowRoleCreation, setShowRoleDeletion: panelState.setShowRoleDeletion, setShowRoleList: panelState.setShowRoleList, setShowRoleSubagentCreation: panelState.setShowRoleSubagentCreation, setShowRoleSubagentDeletion: panelState.setShowRoleSubagentDeletion, setShowRoleSubagentList: panelState.setShowRoleSubagentList, setShowWorkingDirPanel: panelState.setShowWorkingDirPanel, setShowBranchPanel: panelState.setShowBranchPanel, setShowConnectionPanel: panelState.setShowConnectionPanel, setShowTodoListPanel: panelState.setShowTodoListPanel, handleSessionPanelSelect, onCustomCommandSave: async (name, command, type, location, description) => {
|
|
586294
587451
|
await saveCustomCommand(name, command, type, description, location, workingDirectory);
|
|
586295
587452
|
await registerCustomCommands(workingDirectory);
|
|
586296
587453
|
panelState.setShowCustomCommandConfig(false);
|
|
@@ -586421,22 +587578,22 @@ function ChatScreenPanels({ terminalWidth, workingDirectory, panelState, snapsho
|
|
|
586421
587578
|
setMessages((prev) => [...prev, errorMessage]);
|
|
586422
587579
|
}
|
|
586423
587580
|
} }),
|
|
586424
|
-
panelState.showNewPromptPanel &&
|
|
587581
|
+
panelState.showNewPromptPanel && import_react177.default.createElement(
|
|
586425
587582
|
Box_default,
|
|
586426
587583
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
586427
|
-
|
|
586428
|
-
|
|
586429
|
-
{ fallback:
|
|
587584
|
+
import_react177.default.createElement(
|
|
587585
|
+
import_react177.Suspense,
|
|
587586
|
+
{ fallback: import_react177.default.createElement(
|
|
586430
587587
|
Box_default,
|
|
586431
587588
|
null,
|
|
586432
|
-
|
|
587589
|
+
import_react177.default.createElement(
|
|
586433
587590
|
Text,
|
|
586434
587591
|
null,
|
|
586435
|
-
|
|
587592
|
+
import_react177.default.createElement(build_default, { type: "dots" }),
|
|
586436
587593
|
" Loading..."
|
|
586437
587594
|
)
|
|
586438
587595
|
) },
|
|
586439
|
-
|
|
587596
|
+
import_react177.default.createElement(NewPromptPanel2, { onAccept: (prompt) => {
|
|
586440
587597
|
panelState.setShowNewPromptPanel(false);
|
|
586441
587598
|
onPromptAccept(prompt);
|
|
586442
587599
|
}, onCancel: () => {
|
|
@@ -586444,73 +587601,91 @@ function ChatScreenPanels({ terminalWidth, workingDirectory, panelState, snapsho
|
|
|
586444
587601
|
} })
|
|
586445
587602
|
)
|
|
586446
587603
|
),
|
|
586447
|
-
showSubAgentDepthPanel &&
|
|
587604
|
+
showSubAgentDepthPanel && import_react177.default.createElement(
|
|
586448
587605
|
Box_default,
|
|
586449
587606
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
586450
|
-
|
|
586451
|
-
|
|
586452
|
-
{ fallback:
|
|
587607
|
+
import_react177.default.createElement(
|
|
587608
|
+
import_react177.Suspense,
|
|
587609
|
+
{ fallback: import_react177.default.createElement(
|
|
586453
587610
|
Box_default,
|
|
586454
587611
|
null,
|
|
586455
|
-
|
|
587612
|
+
import_react177.default.createElement(
|
|
586456
587613
|
Text,
|
|
586457
587614
|
null,
|
|
586458
|
-
|
|
587615
|
+
import_react177.default.createElement(build_default, { type: "dots" }),
|
|
586459
587616
|
" Loading..."
|
|
586460
587617
|
)
|
|
586461
587618
|
) },
|
|
586462
|
-
|
|
587619
|
+
import_react177.default.createElement(SubAgentDepthPanel2, { visible: showSubAgentDepthPanel, onClose: () => setShowSubAgentDepthPanel(false) })
|
|
586463
587620
|
)
|
|
586464
587621
|
),
|
|
586465
|
-
showPermissionsPanel &&
|
|
587622
|
+
showPermissionsPanel && import_react177.default.createElement(
|
|
586466
587623
|
Box_default,
|
|
586467
587624
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
586468
|
-
|
|
586469
|
-
|
|
586470
|
-
{ fallback:
|
|
587625
|
+
import_react177.default.createElement(
|
|
587626
|
+
import_react177.Suspense,
|
|
587627
|
+
{ fallback: import_react177.default.createElement(
|
|
586471
587628
|
Box_default,
|
|
586472
587629
|
null,
|
|
586473
|
-
|
|
587630
|
+
import_react177.default.createElement(
|
|
586474
587631
|
Text,
|
|
586475
587632
|
null,
|
|
586476
|
-
|
|
587633
|
+
import_react177.default.createElement(build_default, { type: "dots" }),
|
|
586477
587634
|
" Loading..."
|
|
586478
587635
|
)
|
|
586479
587636
|
) },
|
|
586480
|
-
|
|
587637
|
+
import_react177.default.createElement(PermissionsPanel2, { alwaysApprovedTools, onRemoveTool: removeFromAlwaysApproved, onClearAll: clearAllAlwaysApproved, onClose: () => setShowPermissionsPanel(false) })
|
|
586481
587638
|
)
|
|
586482
587639
|
),
|
|
586483
|
-
snapshotState.pendingRollback &&
|
|
586484
|
-
panelState.showPixelEditor &&
|
|
587640
|
+
snapshotState.pendingRollback && import_react177.default.createElement(FileRollbackConfirmation, { fileCount: snapshotState.pendingRollback.fileCount, filePaths: snapshotState.pendingRollback.filePaths || [], notebookCount: snapshotState.pendingRollback.notebookCount, teamCount: snapshotState.pendingRollback.teamCount, previewSessionId: (_a20 = sessionManager.getCurrentSession()) == null ? void 0 : _a20.id, previewTargetMessageIndex: snapshotState.pendingRollback.messageIndex, terminalWidth, onConfirm: handleRollbackConfirm }),
|
|
587641
|
+
panelState.showPixelEditor && import_react177.default.createElement(
|
|
586485
587642
|
Box_default,
|
|
586486
587643
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
586487
|
-
|
|
587644
|
+
import_react177.default.createElement(PixelEditorScreen, { onBack: () => panelState.setShowPixelEditor(false) })
|
|
586488
587645
|
),
|
|
586489
|
-
panelState.
|
|
587646
|
+
panelState.showModelsPanel && import_react177.default.createElement(
|
|
586490
587647
|
Box_default,
|
|
586491
587648
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
586492
|
-
|
|
586493
|
-
|
|
586494
|
-
{ fallback:
|
|
587649
|
+
import_react177.default.createElement(
|
|
587650
|
+
import_react177.Suspense,
|
|
587651
|
+
{ fallback: import_react177.default.createElement(
|
|
586495
587652
|
Box_default,
|
|
586496
587653
|
null,
|
|
586497
|
-
|
|
587654
|
+
import_react177.default.createElement(
|
|
586498
587655
|
Text,
|
|
586499
587656
|
null,
|
|
586500
|
-
|
|
587657
|
+
import_react177.default.createElement(build_default, { type: "dots" }),
|
|
586501
587658
|
" Loading..."
|
|
586502
587659
|
)
|
|
586503
587660
|
) },
|
|
586504
|
-
|
|
587661
|
+
import_react177.default.createElement(ModelsPanel2, { advancedModel: modelsPanelAdvancedModel, basicModel: modelsPanelBasicModel, visible: panelState.showModelsPanel, onClose: () => panelState.setShowModelsPanel(false) })
|
|
587662
|
+
)
|
|
587663
|
+
),
|
|
587664
|
+
panelState.showProfileEditPanel && panelState.editingProfileName && import_react177.default.createElement(
|
|
587665
|
+
Box_default,
|
|
587666
|
+
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
587667
|
+
import_react177.default.createElement(
|
|
587668
|
+
import_react177.Suspense,
|
|
587669
|
+
{ fallback: import_react177.default.createElement(
|
|
587670
|
+
Box_default,
|
|
587671
|
+
null,
|
|
587672
|
+
import_react177.default.createElement(
|
|
587673
|
+
Text,
|
|
587674
|
+
null,
|
|
587675
|
+
import_react177.default.createElement(build_default, { type: "dots" }),
|
|
587676
|
+
" Loading..."
|
|
587677
|
+
)
|
|
587678
|
+
) },
|
|
587679
|
+
import_react177.default.createElement(ProfileEditPanel2, { profileName: panelState.editingProfileName, onClose: panelState.closeProfileEditAndReturnToPicker })
|
|
586505
587680
|
)
|
|
586506
587681
|
)
|
|
586507
587682
|
);
|
|
586508
587683
|
}
|
|
586509
|
-
var
|
|
587684
|
+
var import_react177, PermissionsPanel2, NewPromptPanel2, SubAgentDepthPanel2, ProfileEditPanel2, ModelsPanel2;
|
|
586510
587685
|
var init_ChatScreenPanels = __esm({
|
|
586511
587686
|
async "dist/ui/pages/chatScreen/ChatScreenPanels.js"() {
|
|
586512
587687
|
"use strict";
|
|
586513
|
-
|
|
587688
|
+
import_react177 = __toESM(require_react(), 1);
|
|
586514
587689
|
await init_src();
|
|
586515
587690
|
await init_build2();
|
|
586516
587691
|
await init_PanelsManager();
|
|
@@ -586519,17 +587694,20 @@ var init_ChatScreenPanels = __esm({
|
|
|
586519
587694
|
init_skills2();
|
|
586520
587695
|
init_sessionManager();
|
|
586521
587696
|
await init_PixelEditorScreen();
|
|
586522
|
-
PermissionsPanel2 = (0,
|
|
586523
|
-
NewPromptPanel2 = (0,
|
|
586524
|
-
SubAgentDepthPanel2 = (0,
|
|
586525
|
-
ProfileEditPanel2 = (0,
|
|
587697
|
+
PermissionsPanel2 = (0, import_react177.lazy)(() => init_PermissionsPanel().then(() => PermissionsPanel_exports));
|
|
587698
|
+
NewPromptPanel2 = (0, import_react177.lazy)(() => init_NewPromptPanel().then(() => NewPromptPanel_exports));
|
|
587699
|
+
SubAgentDepthPanel2 = (0, import_react177.lazy)(() => init_SubAgentDepthPanel().then(() => SubAgentDepthPanel_exports));
|
|
587700
|
+
ProfileEditPanel2 = (0, import_react177.lazy)(() => init_ProfileEditPanel().then(() => ProfileEditPanel_exports));
|
|
587701
|
+
ModelsPanel2 = (0, import_react177.lazy)(() => init_ModelsPanel().then(() => ModelsPanel_exports).then((m) => ({
|
|
587702
|
+
default: m.ModelsPanel
|
|
587703
|
+
})));
|
|
586526
587704
|
}
|
|
586527
587705
|
});
|
|
586528
587706
|
|
|
586529
587707
|
// dist/ui/pages/chatScreen/useBackgroundProcessSelection.js
|
|
586530
587708
|
function useBackgroundProcessSelection(processes) {
|
|
586531
|
-
const [selectedProcessIndex, setSelectedProcessIndex] = (0,
|
|
586532
|
-
const sortedBackgroundProcesses = (0,
|
|
587709
|
+
const [selectedProcessIndex, setSelectedProcessIndex] = (0, import_react178.useState)(0);
|
|
587710
|
+
const sortedBackgroundProcesses = (0, import_react178.useMemo)(() => {
|
|
586533
587711
|
return [...processes].sort((a, b) => {
|
|
586534
587712
|
if (a.status === "running" && b.status !== "running")
|
|
586535
587713
|
return -1;
|
|
@@ -586538,7 +587716,7 @@ function useBackgroundProcessSelection(processes) {
|
|
|
586538
587716
|
return b.startedAt.getTime() - a.startedAt.getTime();
|
|
586539
587717
|
});
|
|
586540
587718
|
}, [processes]);
|
|
586541
|
-
(0,
|
|
587719
|
+
(0, import_react178.useEffect)(() => {
|
|
586542
587720
|
if (sortedBackgroundProcesses.length > 0 && selectedProcessIndex >= sortedBackgroundProcesses.length) {
|
|
586543
587721
|
setSelectedProcessIndex(sortedBackgroundProcesses.length - 1);
|
|
586544
587722
|
}
|
|
@@ -586549,11 +587727,11 @@ function useBackgroundProcessSelection(processes) {
|
|
|
586549
587727
|
sortedBackgroundProcesses
|
|
586550
587728
|
};
|
|
586551
587729
|
}
|
|
586552
|
-
var
|
|
587730
|
+
var import_react178;
|
|
586553
587731
|
var init_useBackgroundProcessSelection = __esm({
|
|
586554
587732
|
"dist/ui/pages/chatScreen/useBackgroundProcessSelection.js"() {
|
|
586555
587733
|
"use strict";
|
|
586556
|
-
|
|
587734
|
+
import_react178 = __toESM(require_react(), 1);
|
|
586557
587735
|
}
|
|
586558
587736
|
});
|
|
586559
587737
|
|
|
@@ -586581,8 +587759,8 @@ var init_pixel = __esm({
|
|
|
586581
587759
|
|
|
586582
587760
|
// dist/ui/pages/chatScreen/useChatScreenCommands.js
|
|
586583
587761
|
function useChatScreenCommands(workingDirectory) {
|
|
586584
|
-
const [commandsLoaded, setCommandsLoaded] = (0,
|
|
586585
|
-
(0,
|
|
587762
|
+
const [commandsLoaded, setCommandsLoaded] = (0, import_react179.useState)(false);
|
|
587763
|
+
(0, import_react179.useEffect)(() => {
|
|
586586
587764
|
let isMounted = true;
|
|
586587
587765
|
Promise.all([
|
|
586588
587766
|
Promise.resolve().then(() => (init_clear(), clear_exports)),
|
|
@@ -586615,6 +587793,7 @@ function useChatScreenCommands(workingDirectory) {
|
|
|
586615
587793
|
Promise.resolve().then(() => (init_branch(), branch_exports)),
|
|
586616
587794
|
Promise.resolve().then(() => (init_backend(), backend_exports)),
|
|
586617
587795
|
Promise.resolve().then(() => (init_loop(), loop_exports)),
|
|
587796
|
+
Promise.resolve().then(() => (init_models(), models_exports)),
|
|
586618
587797
|
Promise.resolve().then(() => (init_subagentDepth(), subagentDepth_exports)),
|
|
586619
587798
|
Promise.resolve().then(() => (init_worktree(), worktree_exports)),
|
|
586620
587799
|
Promise.resolve().then(() => (init_newPrompt(), newPrompt_exports)),
|
|
@@ -586641,11 +587820,11 @@ function useChatScreenCommands(workingDirectory) {
|
|
|
586641
587820
|
}, [workingDirectory]);
|
|
586642
587821
|
return commandsLoaded;
|
|
586643
587822
|
}
|
|
586644
|
-
var
|
|
587823
|
+
var import_react179;
|
|
586645
587824
|
var init_useChatScreenCommands = __esm({
|
|
586646
587825
|
"dist/ui/pages/chatScreen/useChatScreenCommands.js"() {
|
|
586647
587826
|
"use strict";
|
|
586648
|
-
|
|
587827
|
+
import_react179 = __toESM(require_react(), 1);
|
|
586649
587828
|
init_custom();
|
|
586650
587829
|
}
|
|
586651
587830
|
});
|
|
@@ -586734,37 +587913,37 @@ var init_useChatScreenInputHandler = __esm({
|
|
|
586734
587913
|
|
|
586735
587914
|
// dist/ui/pages/chatScreen/useChatScreenLocalState.js
|
|
586736
587915
|
function useChatScreenLocalState() {
|
|
586737
|
-
const [messages, setMessages] = (0,
|
|
586738
|
-
const [isSaving] = (0,
|
|
586739
|
-
const [pendingMessages, setPendingMessages] = (0,
|
|
586740
|
-
const pendingMessagesRef = (0,
|
|
586741
|
-
const userInterruptedRef = (0,
|
|
586742
|
-
const [remountKey, setRemountKey] = (0,
|
|
586743
|
-
const [currentContextPercentage, setCurrentContextPercentage] = (0,
|
|
586744
|
-
const currentContextPercentageRef = (0,
|
|
586745
|
-
const [isExecutingTerminalCommand, setIsExecutingTerminalCommand] = (0,
|
|
586746
|
-
const [customCommandExecution, setCustomCommandExecution] = (0,
|
|
586747
|
-
const [isCompressing, setIsCompressing] = (0,
|
|
586748
|
-
const [compressionError, setCompressionError] = (0,
|
|
586749
|
-
const [showPermissionsPanel, setShowPermissionsPanel] = (0,
|
|
586750
|
-
const [showSubAgentDepthPanel, setShowSubAgentDepthPanel] = (0,
|
|
586751
|
-
const [restoreInputContent, setRestoreInputContent] = (0,
|
|
586752
|
-
const [inputDraftContent, setInputDraftContent] = (0,
|
|
586753
|
-
const [bashSensitiveCommand, setBashSensitiveCommand] = (0,
|
|
586754
|
-
const [suppressLoadingIndicator, setSuppressLoadingIndicator] = (0,
|
|
586755
|
-
const hadBashSensitiveCommandRef = (0,
|
|
586756
|
-
const [hookError, setHookError] = (0,
|
|
586757
|
-
const [pendingUserQuestion, setPendingUserQuestion] = (0,
|
|
586758
|
-
const [compressionStatus, setCompressionStatus] = (0,
|
|
586759
|
-
const [isResumingSession, setIsResumingSession] = (0,
|
|
586760
|
-
const [btwPrompt, setBtwPrompt] = (0,
|
|
586761
|
-
(0,
|
|
587916
|
+
const [messages, setMessages] = (0, import_react180.useState)([]);
|
|
587917
|
+
const [isSaving] = (0, import_react180.useState)(false);
|
|
587918
|
+
const [pendingMessages, setPendingMessages] = (0, import_react180.useState)([]);
|
|
587919
|
+
const pendingMessagesRef = (0, import_react180.useRef)([]);
|
|
587920
|
+
const userInterruptedRef = (0, import_react180.useRef)(false);
|
|
587921
|
+
const [remountKey, setRemountKey] = (0, import_react180.useState)(0);
|
|
587922
|
+
const [currentContextPercentage, setCurrentContextPercentage] = (0, import_react180.useState)(0);
|
|
587923
|
+
const currentContextPercentageRef = (0, import_react180.useRef)(0);
|
|
587924
|
+
const [isExecutingTerminalCommand, setIsExecutingTerminalCommand] = (0, import_react180.useState)(false);
|
|
587925
|
+
const [customCommandExecution, setCustomCommandExecution] = (0, import_react180.useState)(null);
|
|
587926
|
+
const [isCompressing, setIsCompressing] = (0, import_react180.useState)(false);
|
|
587927
|
+
const [compressionError, setCompressionError] = (0, import_react180.useState)(null);
|
|
587928
|
+
const [showPermissionsPanel, setShowPermissionsPanel] = (0, import_react180.useState)(false);
|
|
587929
|
+
const [showSubAgentDepthPanel, setShowSubAgentDepthPanel] = (0, import_react180.useState)(false);
|
|
587930
|
+
const [restoreInputContent, setRestoreInputContent] = (0, import_react180.useState)(null);
|
|
587931
|
+
const [inputDraftContent, setInputDraftContent] = (0, import_react180.useState)(null);
|
|
587932
|
+
const [bashSensitiveCommand, setBashSensitiveCommand] = (0, import_react180.useState)(null);
|
|
587933
|
+
const [suppressLoadingIndicator, setSuppressLoadingIndicator] = (0, import_react180.useState)(false);
|
|
587934
|
+
const hadBashSensitiveCommandRef = (0, import_react180.useRef)(false);
|
|
587935
|
+
const [hookError, setHookError] = (0, import_react180.useState)(null);
|
|
587936
|
+
const [pendingUserQuestion, setPendingUserQuestion] = (0, import_react180.useState)(null);
|
|
587937
|
+
const [compressionStatus, setCompressionStatus] = (0, import_react180.useState)(null);
|
|
587938
|
+
const [isResumingSession, setIsResumingSession] = (0, import_react180.useState)(false);
|
|
587939
|
+
const [btwPrompt, setBtwPrompt] = (0, import_react180.useState)(null);
|
|
587940
|
+
(0, import_react180.useEffect)(() => {
|
|
586762
587941
|
currentContextPercentageRef.current = currentContextPercentage;
|
|
586763
587942
|
}, [currentContextPercentage]);
|
|
586764
|
-
(0,
|
|
587943
|
+
(0, import_react180.useEffect)(() => {
|
|
586765
587944
|
pendingMessagesRef.current = pendingMessages;
|
|
586766
587945
|
}, [pendingMessages]);
|
|
586767
|
-
(0,
|
|
587946
|
+
(0, import_react180.useEffect)(() => {
|
|
586768
587947
|
const hasPanel = !!bashSensitiveCommand;
|
|
586769
587948
|
const hadPanel = hadBashSensitiveCommandRef.current;
|
|
586770
587949
|
hadBashSensitiveCommandRef.current = hasPanel;
|
|
@@ -586781,7 +587960,7 @@ function useChatScreenLocalState() {
|
|
|
586781
587960
|
}
|
|
586782
587961
|
return void 0;
|
|
586783
587962
|
}, [bashSensitiveCommand]);
|
|
586784
|
-
const requestUserQuestion = (0,
|
|
587963
|
+
const requestUserQuestion = (0, import_react180.useCallback)(async (question, options3, toolCall) => {
|
|
586785
587964
|
return new Promise((resolve13) => {
|
|
586786
587965
|
setPendingUserQuestion({
|
|
586787
587966
|
question,
|
|
@@ -586837,77 +588016,56 @@ function useChatScreenLocalState() {
|
|
|
586837
588016
|
setBtwPrompt
|
|
586838
588017
|
};
|
|
586839
588018
|
}
|
|
586840
|
-
var
|
|
588019
|
+
var import_react180;
|
|
586841
588020
|
var init_useChatScreenLocalState = __esm({
|
|
586842
588021
|
"dist/ui/pages/chatScreen/useChatScreenLocalState.js"() {
|
|
586843
588022
|
"use strict";
|
|
586844
|
-
|
|
586845
|
-
}
|
|
586846
|
-
});
|
|
586847
|
-
|
|
586848
|
-
// dist/utils/config/configEvents.js
|
|
586849
|
-
import { EventEmitter as EventEmitter11 } from "events";
|
|
586850
|
-
var ConfigEventEmitter, configEvents;
|
|
586851
|
-
var init_configEvents = __esm({
|
|
586852
|
-
"dist/utils/config/configEvents.js"() {
|
|
586853
|
-
"use strict";
|
|
586854
|
-
ConfigEventEmitter = class extends EventEmitter11 {
|
|
586855
|
-
emitConfigChange(event) {
|
|
586856
|
-
this.emit("config-change", event);
|
|
586857
|
-
}
|
|
586858
|
-
onConfigChange(callback) {
|
|
586859
|
-
this.on("config-change", callback);
|
|
586860
|
-
}
|
|
586861
|
-
removeConfigChangeListener(callback) {
|
|
586862
|
-
this.off("config-change", callback);
|
|
586863
|
-
}
|
|
586864
|
-
};
|
|
586865
|
-
configEvents = new ConfigEventEmitter();
|
|
588023
|
+
import_react180 = __toESM(require_react(), 1);
|
|
586866
588024
|
}
|
|
586867
588025
|
});
|
|
586868
588026
|
|
|
586869
588027
|
// dist/ui/pages/chatScreen/useChatScreenModes.js
|
|
586870
588028
|
function useChatScreenModes({ enableYolo, enablePlan }) {
|
|
586871
|
-
const [yoloMode, setYoloMode2] = (0,
|
|
588029
|
+
const [yoloMode, setYoloMode2] = (0, import_react181.useState)(() => {
|
|
586872
588030
|
if (enableYolo !== void 0) {
|
|
586873
588031
|
return enableYolo;
|
|
586874
588032
|
}
|
|
586875
588033
|
return getYoloMode();
|
|
586876
588034
|
});
|
|
586877
|
-
const [planMode, setPlanMode2] = (0,
|
|
588035
|
+
const [planMode, setPlanMode2] = (0, import_react181.useState)(() => {
|
|
586878
588036
|
if (enablePlan !== void 0) {
|
|
586879
588037
|
return enablePlan;
|
|
586880
588038
|
}
|
|
586881
588039
|
return getPlanMode();
|
|
586882
588040
|
});
|
|
586883
|
-
const [vulnerabilityHuntingMode, setVulnerabilityHuntingMode2] = (0,
|
|
586884
|
-
const [toolSearchDisabled, setToolSearchDisabled] = (0,
|
|
586885
|
-
const [hybridCompressEnabled, setHybridCompressEnabled2] = (0,
|
|
586886
|
-
const [teamMode, setTeamMode2] = (0,
|
|
586887
|
-
const [simpleMode, setSimpleMode2] = (0,
|
|
586888
|
-
const [showThinking, setShowThinking] = (0,
|
|
588041
|
+
const [vulnerabilityHuntingMode, setVulnerabilityHuntingMode2] = (0, import_react181.useState)(() => getVulnerabilityHuntingMode());
|
|
588042
|
+
const [toolSearchDisabled, setToolSearchDisabled] = (0, import_react181.useState)(() => !getToolSearchEnabled());
|
|
588043
|
+
const [hybridCompressEnabled, setHybridCompressEnabled2] = (0, import_react181.useState)(() => getHybridCompressEnabled());
|
|
588044
|
+
const [teamMode, setTeamMode2] = (0, import_react181.useState)(() => getTeamMode());
|
|
588045
|
+
const [simpleMode, setSimpleMode2] = (0, import_react181.useState)(() => getSimpleMode());
|
|
588046
|
+
const [showThinking, setShowThinking] = (0, import_react181.useState)(() => {
|
|
586889
588047
|
const config3 = getSnowConfig();
|
|
586890
588048
|
return config3.showThinking !== false;
|
|
586891
588049
|
});
|
|
586892
|
-
(0,
|
|
588050
|
+
(0, import_react181.useEffect)(() => {
|
|
586893
588051
|
setYoloMode(yoloMode);
|
|
586894
588052
|
}, [yoloMode]);
|
|
586895
|
-
(0,
|
|
588053
|
+
(0, import_react181.useEffect)(() => {
|
|
586896
588054
|
setPlanMode(planMode);
|
|
586897
588055
|
}, [planMode]);
|
|
586898
|
-
(0,
|
|
588056
|
+
(0, import_react181.useEffect)(() => {
|
|
586899
588057
|
setVulnerabilityHuntingMode(vulnerabilityHuntingMode);
|
|
586900
588058
|
}, [vulnerabilityHuntingMode]);
|
|
586901
|
-
(0,
|
|
588059
|
+
(0, import_react181.useEffect)(() => {
|
|
586902
588060
|
setToolSearchEnabled(!toolSearchDisabled);
|
|
586903
588061
|
}, [toolSearchDisabled]);
|
|
586904
|
-
(0,
|
|
588062
|
+
(0, import_react181.useEffect)(() => {
|
|
586905
588063
|
setHybridCompressEnabled(hybridCompressEnabled);
|
|
586906
588064
|
}, [hybridCompressEnabled]);
|
|
586907
|
-
(0,
|
|
588065
|
+
(0, import_react181.useEffect)(() => {
|
|
586908
588066
|
setTeamMode(teamMode);
|
|
586909
588067
|
}, [teamMode]);
|
|
586910
|
-
(0,
|
|
588068
|
+
(0, import_react181.useEffect)(() => {
|
|
586911
588069
|
const interval = setInterval(() => {
|
|
586912
588070
|
const currentSimpleMode = getSimpleMode();
|
|
586913
588071
|
if (currentSimpleMode !== simpleMode) {
|
|
@@ -586916,7 +588074,7 @@ function useChatScreenModes({ enableYolo, enablePlan }) {
|
|
|
586916
588074
|
}, 1e3);
|
|
586917
588075
|
return () => clearInterval(interval);
|
|
586918
588076
|
}, [simpleMode]);
|
|
586919
|
-
(0,
|
|
588077
|
+
(0, import_react181.useEffect)(() => {
|
|
586920
588078
|
const handleConfigChange = (event) => {
|
|
586921
588079
|
if (event.type === "showThinking") {
|
|
586922
588080
|
setShowThinking(event.value);
|
|
@@ -586944,11 +588102,11 @@ function useChatScreenModes({ enableYolo, enablePlan }) {
|
|
|
586944
588102
|
showThinking
|
|
586945
588103
|
};
|
|
586946
588104
|
}
|
|
586947
|
-
var
|
|
588105
|
+
var import_react181;
|
|
586948
588106
|
var init_useChatScreenModes = __esm({
|
|
586949
588107
|
"dist/ui/pages/chatScreen/useChatScreenModes.js"() {
|
|
586950
588108
|
"use strict";
|
|
586951
|
-
|
|
588109
|
+
import_react181 = __toESM(require_react(), 1);
|
|
586952
588110
|
init_configEvents();
|
|
586953
588111
|
init_apiConfig();
|
|
586954
588112
|
init_projectSettings();
|
|
@@ -586959,8 +588117,8 @@ var init_useChatScreenModes = __esm({
|
|
|
586959
588117
|
// dist/ui/pages/chatScreen/useChatScreenSessionLifecycle.js
|
|
586960
588118
|
function useChatScreenSessionLifecycle({ autoResume, resumeSessionId: resumeSessionId2, terminalWidth, remountKey, setRemountKey, setMessages, initializeFromSession, setIsResumingSession, setContextUsage }) {
|
|
586961
588119
|
const { stdout } = use_stdout_default();
|
|
586962
|
-
const isInitialMount = (0,
|
|
586963
|
-
(0,
|
|
588120
|
+
const isInitialMount = (0, import_react182.useRef)(true);
|
|
588121
|
+
(0, import_react182.useEffect)(() => {
|
|
586964
588122
|
if (!autoResume) {
|
|
586965
588123
|
sessionManager.clearCurrentSession();
|
|
586966
588124
|
return;
|
|
@@ -586993,7 +588151,7 @@ function useChatScreenSessionLifecycle({ autoResume, resumeSessionId: resumeSess
|
|
|
586993
588151
|
};
|
|
586994
588152
|
resumeSession();
|
|
586995
588153
|
}, [autoResume, resumeSessionId2, initializeFromSession, setMessages]);
|
|
586996
|
-
(0,
|
|
588154
|
+
(0, import_react182.useEffect)(() => {
|
|
586997
588155
|
if (isInitialMount.current) {
|
|
586998
588156
|
isInitialMount.current = false;
|
|
586999
588157
|
return;
|
|
@@ -587006,7 +588164,7 @@ function useChatScreenSessionLifecycle({ autoResume, resumeSessionId: resumeSess
|
|
|
587006
588164
|
clearTimeout(handler);
|
|
587007
588165
|
};
|
|
587008
588166
|
}, [terminalWidth, setRemountKey]);
|
|
587009
|
-
(0,
|
|
588167
|
+
(0, import_react182.useEffect)(() => {
|
|
587010
588168
|
if (remountKey === 0) {
|
|
587011
588169
|
return;
|
|
587012
588170
|
}
|
|
@@ -587020,11 +588178,11 @@ function useChatScreenSessionLifecycle({ autoResume, resumeSessionId: resumeSess
|
|
|
587020
588178
|
reloadMessages();
|
|
587021
588179
|
}, [remountKey, setMessages]);
|
|
587022
588180
|
}
|
|
587023
|
-
var
|
|
588181
|
+
var import_react182;
|
|
587024
588182
|
var init_useChatScreenSessionLifecycle = __esm({
|
|
587025
588183
|
async "dist/ui/pages/chatScreen/useChatScreenSessionLifecycle.js"() {
|
|
587026
588184
|
"use strict";
|
|
587027
|
-
|
|
588185
|
+
import_react182 = __toESM(require_react(), 1);
|
|
587028
588186
|
await init_src();
|
|
587029
588187
|
init_ansi_escapes();
|
|
587030
588188
|
init_sessionManager();
|
|
@@ -587044,12 +588202,12 @@ function toProgressState(progressData) {
|
|
|
587044
588202
|
};
|
|
587045
588203
|
}
|
|
587046
588204
|
function useCodebaseIndexing(workingDirectory) {
|
|
587047
|
-
const [codebaseIndexing, setCodebaseIndexing] = (0,
|
|
587048
|
-
const [codebaseProgress, setCodebaseProgress] = (0,
|
|
587049
|
-
const [watcherEnabled, setWatcherEnabled] = (0,
|
|
587050
|
-
const [fileUpdateNotification, setFileUpdateNotification] = (0,
|
|
587051
|
-
const codebaseAgentRef = (0,
|
|
587052
|
-
(0,
|
|
588205
|
+
const [codebaseIndexing, setCodebaseIndexing] = (0, import_react183.useState)(false);
|
|
588206
|
+
const [codebaseProgress, setCodebaseProgress] = (0, import_react183.useState)(null);
|
|
588207
|
+
const [watcherEnabled, setWatcherEnabled] = (0, import_react183.useState)(false);
|
|
588208
|
+
const [fileUpdateNotification, setFileUpdateNotification] = (0, import_react183.useState)(null);
|
|
588209
|
+
const codebaseAgentRef = (0, import_react183.useRef)(null);
|
|
588210
|
+
(0, import_react183.useEffect)(() => {
|
|
587053
588211
|
const notifyFileUpdate = (file2) => {
|
|
587054
588212
|
setFileUpdateNotification({
|
|
587055
588213
|
file: file2,
|
|
@@ -587134,7 +588292,7 @@ function useCodebaseIndexing(workingDirectory) {
|
|
|
587134
588292
|
}
|
|
587135
588293
|
};
|
|
587136
588294
|
}, [workingDirectory]);
|
|
587137
|
-
(0,
|
|
588295
|
+
(0, import_react183.useEffect)(() => {
|
|
587138
588296
|
global.__stopCodebaseIndexing = async () => {
|
|
587139
588297
|
if (codebaseAgentRef.current) {
|
|
587140
588298
|
await codebaseAgentRef.current.stop();
|
|
@@ -587161,11 +588319,11 @@ function useCodebaseIndexing(workingDirectory) {
|
|
|
587161
588319
|
codebaseAgentRef
|
|
587162
588320
|
};
|
|
587163
588321
|
}
|
|
587164
|
-
var
|
|
588322
|
+
var import_react183;
|
|
587165
588323
|
var init_useCodebaseIndexing = __esm({
|
|
587166
588324
|
"dist/ui/pages/chatScreen/useCodebaseIndexing.js"() {
|
|
587167
588325
|
"use strict";
|
|
587168
|
-
|
|
588326
|
+
import_react183 = __toESM(require_react(), 1);
|
|
587169
588327
|
init_codebaseIndexAgent();
|
|
587170
588328
|
init_gitignoreValidator();
|
|
587171
588329
|
init_codebaseConfig();
|
|
@@ -587200,8 +588358,8 @@ function ChatScreen({ autoResume, resumeSessionId: resumeSessionId2, enableYolo,
|
|
|
587200
588358
|
const commandsLoaded = useChatScreenCommands(workingDirectory);
|
|
587201
588359
|
const { codebaseIndexing, setCodebaseIndexing, codebaseProgress, setCodebaseProgress, watcherEnabled, setWatcherEnabled, fileUpdateNotification, setFileUpdateNotification, codebaseAgentRef } = useCodebaseIndexing(workingDirectory);
|
|
587202
588360
|
const { pendingToolConfirmation, alwaysApprovedTools, requestToolConfirmation, isToolAutoApproved, addMultipleToAlwaysApproved, removeFromAlwaysApproved, clearAllAlwaysApproved } = useToolConfirmation(workingDirectory);
|
|
587203
|
-
const handleCommandExecutionRef = (0,
|
|
587204
|
-
(0,
|
|
588361
|
+
const handleCommandExecutionRef = (0, import_react184.useRef)(void 0);
|
|
588362
|
+
(0, import_react184.useEffect)(() => {
|
|
587205
588363
|
connectionManager.setStreamingState(streamingState.streamStatus);
|
|
587206
588364
|
}, [streamingState.streamStatus]);
|
|
587207
588365
|
useChatScreenSessionLifecycle({
|
|
@@ -587296,6 +588454,7 @@ function ChatScreen({ autoResume, resumeSessionId: resumeSessionId2, enableYolo,
|
|
|
587296
588454
|
setShowMcpPanel: panelState.setShowMcpPanel,
|
|
587297
588455
|
setShowHelpPanel: panelState.setShowHelpPanel,
|
|
587298
588456
|
setShowUsagePanel: panelState.setShowUsagePanel,
|
|
588457
|
+
setShowModelsPanel: panelState.setShowModelsPanel,
|
|
587299
588458
|
setShowSubAgentDepthPanel,
|
|
587300
588459
|
setShowCustomCommandConfig: panelState.setShowCustomCommandConfig,
|
|
587301
588460
|
setShowSkillsCreation: panelState.setShowSkillsCreation,
|
|
@@ -587337,10 +588496,10 @@ function ChatScreen({ autoResume, resumeSessionId: resumeSessionId2, enableYolo,
|
|
|
587337
588496
|
onToggleCodebase: handleToggleCodebase,
|
|
587338
588497
|
onCompressionStatus: setCompressionStatus
|
|
587339
588498
|
});
|
|
587340
|
-
(0,
|
|
588499
|
+
(0, import_react184.useEffect)(() => {
|
|
587341
588500
|
handleCommandExecutionRef.current = handleCommandExecution;
|
|
587342
588501
|
}, [handleCommandExecution]);
|
|
587343
|
-
(0,
|
|
588502
|
+
(0, import_react184.useEffect)(() => {
|
|
587344
588503
|
if (streamingState.contextUsage) {
|
|
587345
588504
|
updateGlobalTokenUsage({
|
|
587346
588505
|
prompt_tokens: streamingState.contextUsage.prompt_tokens || 0,
|
|
@@ -587386,15 +588545,15 @@ function ChatScreen({ autoResume, resumeSessionId: resumeSessionId2, enableYolo,
|
|
|
587386
588545
|
}
|
|
587387
588546
|
return profilesWithMemoryState.filter((profile) => profile.name.toLowerCase().includes(query) || profile.displayName.toLowerCase().includes(query));
|
|
587388
588547
|
};
|
|
587389
|
-
const hasBlockingPanel = panelState.showSessionPanel || panelState.showMcpPanel || panelState.showUsagePanel || panelState.showHelpPanel || panelState.showProfileEditPanel || panelState.showCustomCommandConfig || panelState.showSkillsCreation || panelState.showRoleCreation || panelState.showRoleDeletion || panelState.showRoleList || panelState.showRoleSubagentCreation || panelState.showRoleSubagentDeletion || panelState.showRoleSubagentList || panelState.showWorkingDirPanel || panelState.showBranchPanel || panelState.showConnectionPanel || panelState.showNewPromptPanel || panelState.showTodoListPanel || panelState.showPixelEditor || showPermissionsPanel || showSubAgentDepthPanel;
|
|
588548
|
+
const hasBlockingPanel = panelState.showSessionPanel || panelState.showMcpPanel || panelState.showUsagePanel || panelState.showHelpPanel || panelState.showProfileEditPanel || panelState.showModelsPanel || panelState.showCustomCommandConfig || panelState.showSkillsCreation || panelState.showRoleCreation || panelState.showRoleDeletion || panelState.showRoleList || panelState.showRoleSubagentCreation || panelState.showRoleSubagentDeletion || panelState.showRoleSubagentList || panelState.showWorkingDirPanel || panelState.showBranchPanel || panelState.showConnectionPanel || panelState.showNewPromptPanel || panelState.showTodoListPanel || panelState.showPixelEditor || showPermissionsPanel || showSubAgentDepthPanel;
|
|
587390
588549
|
const shouldShowFooter = !pendingToolConfirmation && !pendingUserQuestion && !bashSensitiveCommand && !terminalExecutionState.state.needsInput && !schedulerExecutionState.state.isRunning && !hasBlockingPanel && !snapshotState.pendingRollback;
|
|
587391
|
-
(0,
|
|
588550
|
+
(0, import_react184.useEffect)(() => {
|
|
587392
588551
|
if (!shouldShowFooter) {
|
|
587393
588552
|
setInputDraftContent(null);
|
|
587394
588553
|
}
|
|
587395
588554
|
}, [shouldShowFooter, setInputDraftContent]);
|
|
587396
|
-
const remountKeyRef = (0,
|
|
587397
|
-
(0,
|
|
588555
|
+
const remountKeyRef = (0, import_react184.useRef)(remountKey);
|
|
588556
|
+
(0, import_react184.useEffect)(() => {
|
|
587398
588557
|
if (remountKey !== remountKeyRef.current) {
|
|
587399
588558
|
remountKeyRef.current = remountKey;
|
|
587400
588559
|
setInputDraftContent(null);
|
|
@@ -587408,46 +588567,46 @@ function ChatScreen({ autoResume, resumeSessionId: resumeSessionId2, enableYolo,
|
|
|
587408
588567
|
cachedTokens: streamingState.contextUsage.cached_tokens
|
|
587409
588568
|
} : void 0;
|
|
587410
588569
|
if (terminalHeight < MIN_TERMINAL_HEIGHT) {
|
|
587411
|
-
return
|
|
588570
|
+
return import_react184.default.createElement(
|
|
587412
588571
|
Box_default,
|
|
587413
588572
|
{ flexDirection: "column", padding: 2 },
|
|
587414
|
-
|
|
588573
|
+
import_react184.default.createElement(
|
|
587415
588574
|
Box_default,
|
|
587416
588575
|
{ borderStyle: "round", borderColor: "red", padding: 1 },
|
|
587417
|
-
|
|
588576
|
+
import_react184.default.createElement(Text, { color: "red", bold: true }, t.chatScreen.terminalTooSmall)
|
|
587418
588577
|
),
|
|
587419
|
-
|
|
588578
|
+
import_react184.default.createElement(
|
|
587420
588579
|
Box_default,
|
|
587421
588580
|
{ marginTop: 1 },
|
|
587422
|
-
|
|
588581
|
+
import_react184.default.createElement(Text, { color: "yellow" }, t.chatScreen.terminalResizePrompt.replace("{current}", terminalHeight.toString()).replace("{required}", MIN_TERMINAL_HEIGHT.toString()))
|
|
587423
588582
|
),
|
|
587424
|
-
|
|
588583
|
+
import_react184.default.createElement(
|
|
587425
588584
|
Box_default,
|
|
587426
588585
|
{ marginTop: 1 },
|
|
587427
|
-
|
|
588586
|
+
import_react184.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.terminalMinHeight)
|
|
587428
588587
|
)
|
|
587429
588588
|
);
|
|
587430
588589
|
}
|
|
587431
588590
|
if (!commandsLoaded || isResumingSession) {
|
|
587432
|
-
return
|
|
588591
|
+
return import_react184.default.createElement(
|
|
587433
588592
|
Box_default,
|
|
587434
588593
|
{ flexDirection: "column", justifyContent: "center", alignItems: "center", height: "100%", width: terminalWidth },
|
|
587435
|
-
|
|
588594
|
+
import_react184.default.createElement(
|
|
587436
588595
|
Text,
|
|
587437
588596
|
{ color: "cyan" },
|
|
587438
|
-
|
|
588597
|
+
import_react184.default.createElement(build_default, { type: "dots" })
|
|
587439
588598
|
),
|
|
587440
|
-
|
|
588599
|
+
import_react184.default.createElement(Text, null, isResumingSession ? t.chatScreen.sessionLoading : t.chatScreen.chatInitializing)
|
|
587441
588600
|
);
|
|
587442
588601
|
}
|
|
587443
|
-
return
|
|
588602
|
+
return import_react184.default.createElement(
|
|
587444
588603
|
Box_default,
|
|
587445
588604
|
{ flexDirection: "column", height: "100%", width: terminalWidth },
|
|
587446
|
-
|
|
587447
|
-
|
|
588605
|
+
import_react184.default.createElement(ChatScreenConversationView, { remountKey, terminalWidth, workingDirectory, simpleMode, messages, showThinking, pendingMessages, pendingToolConfirmation, pendingUserQuestion, bashSensitiveCommand, terminalExecutionState, schedulerExecutionState, customCommandExecution, bashMode, hookError, handleUserQuestionAnswer, setHookError, compressionStatus }),
|
|
588606
|
+
import_react184.default.createElement(ChatScreenPanels, { terminalWidth, workingDirectory, panelState, snapshotState, handleSessionPanelSelect, showPermissionsPanel, setShowPermissionsPanel, showSubAgentDepthPanel, setShowSubAgentDepthPanel, modelsPanelAdvancedModel: getSnowConfig().advancedModel || "", modelsPanelBasicModel: getSnowConfig().basicModel || "", alwaysApprovedTools, removeFromAlwaysApproved, clearAllAlwaysApproved, setMessages, t, onPromptAccept: (prompt) => {
|
|
587448
588607
|
setRestoreInputContent({ text: prompt });
|
|
587449
588608
|
}, handleRollbackConfirm }),
|
|
587450
|
-
shouldShowFooter &&
|
|
588609
|
+
shouldShowFooter && import_react184.default.createElement(ChatFooter_default, {
|
|
587451
588610
|
onSubmit: handleMessageSubmit,
|
|
587452
588611
|
onCommand: handleCommandExecution,
|
|
587453
588612
|
onHistorySelect: handleHistorySelect,
|
|
@@ -587534,11 +588693,11 @@ function ChatScreen({ autoResume, resumeSessionId: resumeSessionId2, enableYolo,
|
|
|
587534
588693
|
})
|
|
587535
588694
|
);
|
|
587536
588695
|
}
|
|
587537
|
-
var
|
|
588696
|
+
var import_react184, MIN_TERMINAL_HEIGHT;
|
|
587538
588697
|
var init_ChatScreen = __esm({
|
|
587539
588698
|
async "dist/ui/pages/ChatScreen.js"() {
|
|
587540
588699
|
"use strict";
|
|
587541
|
-
|
|
588700
|
+
import_react184 = __toESM(require_react(), 1);
|
|
587542
588701
|
await init_src();
|
|
587543
588702
|
await init_build2();
|
|
587544
588703
|
init_I18nContext();
|
|
@@ -587787,10 +588946,10 @@ ${warningColor}\u26A0 Tool Confirmation Required${resetColor} ${sensitiveCheck.i
|
|
|
587787
588946
|
});
|
|
587788
588947
|
}
|
|
587789
588948
|
function HeadlessModeScreen({ prompt, sessionId, onComplete }) {
|
|
587790
|
-
const [messages, setMessages] = (0,
|
|
587791
|
-
const [isComplete, setIsComplete] = (0,
|
|
587792
|
-
const [lastDisplayedIndex, setLastDisplayedIndex] = (0,
|
|
587793
|
-
const [isWaitingForInput, setIsWaitingForInput] = (0,
|
|
588949
|
+
const [messages, setMessages] = (0, import_react185.useState)([]);
|
|
588950
|
+
const [isComplete, setIsComplete] = (0, import_react185.useState)(false);
|
|
588951
|
+
const [lastDisplayedIndex, setLastDisplayedIndex] = (0, import_react185.useState)(-1);
|
|
588952
|
+
const [isWaitingForInput, setIsWaitingForInput] = (0, import_react185.useState)(false);
|
|
587794
588953
|
const { stdout } = use_stdout_default();
|
|
587795
588954
|
const workingDirectory = process.cwd();
|
|
587796
588955
|
const { t } = useI18n();
|
|
@@ -587799,7 +588958,7 @@ function HeadlessModeScreen({ prompt, sessionId, onComplete }) {
|
|
|
587799
588958
|
const vscodeState = useVSCodeState();
|
|
587800
588959
|
const { saveMessage } = useSessionSave();
|
|
587801
588960
|
const { isToolAutoApproved, addMultipleToAlwaysApproved } = useToolConfirmation(workingDirectory);
|
|
587802
|
-
(0,
|
|
588961
|
+
(0, import_react185.useEffect)(() => {
|
|
587803
588962
|
const lastMessage = messages[messages.length - 1];
|
|
587804
588963
|
const currentIndex = messages.length - 1;
|
|
587805
588964
|
if (!lastMessage || currentIndex <= lastDisplayedIndex)
|
|
@@ -587851,7 +589010,7 @@ function HeadlessModeScreen({ prompt, sessionId, onComplete }) {
|
|
|
587851
589010
|
}
|
|
587852
589011
|
}
|
|
587853
589012
|
}, [messages, lastDisplayedIndex]);
|
|
587854
|
-
(0,
|
|
589013
|
+
(0, import_react185.useEffect)(() => {
|
|
587855
589014
|
if (isWaitingForInput)
|
|
587856
589015
|
return;
|
|
587857
589016
|
if (streamingState.isStreaming) {
|
|
@@ -588013,19 +589172,19 @@ function HeadlessModeScreen({ prompt, sessionId, onComplete }) {
|
|
|
588013
589172
|
}, 1e3);
|
|
588014
589173
|
}
|
|
588015
589174
|
};
|
|
588016
|
-
(0,
|
|
589175
|
+
(0, import_react185.useEffect)(() => {
|
|
588017
589176
|
processMessage();
|
|
588018
589177
|
}, []);
|
|
588019
589178
|
if (isComplete) {
|
|
588020
589179
|
return null;
|
|
588021
589180
|
}
|
|
588022
|
-
return
|
|
589181
|
+
return import_react185.default.createElement(import_react185.default.Fragment, null);
|
|
588023
589182
|
}
|
|
588024
|
-
var
|
|
589183
|
+
var import_react185, import_cli_highlight4, getTheme, getAnsiColor;
|
|
588025
589184
|
var init_HeadlessModeScreen = __esm({
|
|
588026
589185
|
async "dist/ui/pages/HeadlessModeScreen.js"() {
|
|
588027
589186
|
"use strict";
|
|
588028
|
-
|
|
589187
|
+
import_react185 = __toESM(require_react(), 1);
|
|
588029
589188
|
await init_src();
|
|
588030
589189
|
init_ansi_escapes();
|
|
588031
589190
|
import_cli_highlight4 = __toESM(require_dist14(), 1);
|
|
@@ -588071,18 +589230,18 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
588071
589230
|
const { theme: theme14 } = useTheme();
|
|
588072
589231
|
const { t } = useI18n();
|
|
588073
589232
|
useTerminalTitle(`Snow CLI - ${t.taskManager.title}`);
|
|
588074
|
-
const [tasks, setTasks] = (0,
|
|
588075
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
588076
|
-
const [scrollOffset, setScrollOffset] = (0,
|
|
588077
|
-
const [markedTasks, setMarkedTasks] = (0,
|
|
588078
|
-
const [isLoading, setIsLoading] = (0,
|
|
588079
|
-
const [viewMode, setViewMode] = (0,
|
|
588080
|
-
const [detailTask, setDetailTask] = (0,
|
|
588081
|
-
const [pendingAction, setPendingAction] = (0,
|
|
588082
|
-
const [rejectInputMode, setRejectInputMode] = (0,
|
|
588083
|
-
const [rejectReason, setRejectReason] = (0,
|
|
589233
|
+
const [tasks, setTasks] = (0, import_react186.useState)([]);
|
|
589234
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react186.useState)(0);
|
|
589235
|
+
const [scrollOffset, setScrollOffset] = (0, import_react186.useState)(0);
|
|
589236
|
+
const [markedTasks, setMarkedTasks] = (0, import_react186.useState)(/* @__PURE__ */ new Set());
|
|
589237
|
+
const [isLoading, setIsLoading] = (0, import_react186.useState)(true);
|
|
589238
|
+
const [viewMode, setViewMode] = (0, import_react186.useState)("list");
|
|
589239
|
+
const [detailTask, setDetailTask] = (0, import_react186.useState)(null);
|
|
589240
|
+
const [pendingAction, setPendingAction] = (0, import_react186.useState)(null);
|
|
589241
|
+
const [rejectInputMode, setRejectInputMode] = (0, import_react186.useState)(false);
|
|
589242
|
+
const [rejectReason, setRejectReason] = (0, import_react186.useState)("");
|
|
588084
589243
|
const VISIBLE_ITEMS2 = 5;
|
|
588085
|
-
const loadTasks = (0,
|
|
589244
|
+
const loadTasks = (0, import_react186.useCallback)(async () => {
|
|
588086
589245
|
setIsLoading(true);
|
|
588087
589246
|
try {
|
|
588088
589247
|
const taskList = await taskManager.listTasks();
|
|
@@ -588094,10 +589253,10 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
588094
589253
|
setIsLoading(false);
|
|
588095
589254
|
}
|
|
588096
589255
|
}, []);
|
|
588097
|
-
(0,
|
|
589256
|
+
(0, import_react186.useEffect)(() => {
|
|
588098
589257
|
void loadTasks();
|
|
588099
589258
|
}, [loadTasks]);
|
|
588100
|
-
(0,
|
|
589259
|
+
(0, import_react186.useEffect)(() => {
|
|
588101
589260
|
if (pendingAction) {
|
|
588102
589261
|
const timer2 = setTimeout(() => {
|
|
588103
589262
|
setPendingAction(null);
|
|
@@ -588106,7 +589265,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
588106
589265
|
}
|
|
588107
589266
|
return void 0;
|
|
588108
589267
|
}, [pendingAction]);
|
|
588109
|
-
const handleDeleteTask = (0,
|
|
589268
|
+
const handleDeleteTask = (0, import_react186.useCallback)(async (taskId) => {
|
|
588110
589269
|
if (!taskId)
|
|
588111
589270
|
return;
|
|
588112
589271
|
const success2 = await taskManager.deleteTask(taskId);
|
|
@@ -588301,7 +589460,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
588301
589460
|
return;
|
|
588302
589461
|
}
|
|
588303
589462
|
});
|
|
588304
|
-
const getStatusColor = (0,
|
|
589463
|
+
const getStatusColor = (0, import_react186.useCallback)((status) => {
|
|
588305
589464
|
switch (status) {
|
|
588306
589465
|
case "pending":
|
|
588307
589466
|
return "yellow";
|
|
@@ -588317,7 +589476,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
588317
589476
|
return "gray";
|
|
588318
589477
|
}
|
|
588319
589478
|
}, []);
|
|
588320
|
-
const getStatusIcon2 = (0,
|
|
589479
|
+
const getStatusIcon2 = (0, import_react186.useCallback)((status) => {
|
|
588321
589480
|
switch (status) {
|
|
588322
589481
|
case "pending":
|
|
588323
589482
|
return "\u25CB";
|
|
@@ -588333,7 +589492,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
588333
589492
|
return "?";
|
|
588334
589493
|
}
|
|
588335
589494
|
}, []);
|
|
588336
|
-
const formatDate3 = (0,
|
|
589495
|
+
const formatDate3 = (0, import_react186.useCallback)((timestamp) => {
|
|
588337
589496
|
const date5 = new Date(timestamp);
|
|
588338
589497
|
const now = /* @__PURE__ */ new Date();
|
|
588339
589498
|
const diffMs = now.getTime() - date5.getTime();
|
|
@@ -588351,24 +589510,24 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
588351
589510
|
return date5.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
588352
589511
|
}, []);
|
|
588353
589512
|
if (isLoading) {
|
|
588354
|
-
return
|
|
589513
|
+
return import_react186.default.createElement(
|
|
588355
589514
|
Box_default,
|
|
588356
589515
|
{ flexDirection: "column", paddingX: 1 },
|
|
588357
|
-
|
|
589516
|
+
import_react186.default.createElement(
|
|
588358
589517
|
Box_default,
|
|
588359
589518
|
{ borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1 },
|
|
588360
|
-
|
|
589519
|
+
import_react186.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.loadingTasks)
|
|
588361
589520
|
)
|
|
588362
589521
|
);
|
|
588363
589522
|
}
|
|
588364
589523
|
if (tasks.length === 0) {
|
|
588365
|
-
return
|
|
589524
|
+
return import_react186.default.createElement(
|
|
588366
589525
|
Box_default,
|
|
588367
589526
|
{ flexDirection: "column", paddingX: 1 },
|
|
588368
|
-
|
|
589527
|
+
import_react186.default.createElement(
|
|
588369
589528
|
Box_default,
|
|
588370
589529
|
{ borderStyle: "round", borderColor: theme14.colors.warning, paddingX: 1 },
|
|
588371
|
-
|
|
589530
|
+
import_react186.default.createElement(
|
|
588372
589531
|
Text,
|
|
588373
589532
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
588374
589533
|
t.taskManager.noTasksFound,
|
|
@@ -588382,32 +589541,32 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
588382
589541
|
);
|
|
588383
589542
|
}
|
|
588384
589543
|
if (viewMode === "detail" && detailTask) {
|
|
588385
|
-
return
|
|
589544
|
+
return import_react186.default.createElement(
|
|
588386
589545
|
Box_default,
|
|
588387
589546
|
{ flexDirection: "column", paddingX: 1 },
|
|
588388
|
-
|
|
589547
|
+
import_react186.default.createElement(
|
|
588389
589548
|
Box_default,
|
|
588390
589549
|
{ borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1, flexDirection: "column" },
|
|
588391
|
-
|
|
589550
|
+
import_react186.default.createElement(
|
|
588392
589551
|
Box_default,
|
|
588393
589552
|
{ flexDirection: "column", marginBottom: 1 },
|
|
588394
|
-
|
|
588395
|
-
|
|
589553
|
+
import_react186.default.createElement(Text, { color: theme14.colors.menuInfo, bold: true }, t.taskManager.taskDetailsTitle),
|
|
589554
|
+
import_react186.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, detailTask.status === "paused" ? t.taskManager.backToList : `${t.taskManager.continueHint} \u2022 ${t.taskManager.backToList}`)
|
|
588396
589555
|
),
|
|
588397
|
-
|
|
589556
|
+
import_react186.default.createElement(
|
|
588398
589557
|
Box_default,
|
|
588399
589558
|
{ flexDirection: "column", gap: 1 },
|
|
588400
|
-
|
|
589559
|
+
import_react186.default.createElement(
|
|
588401
589560
|
Box_default,
|
|
588402
589561
|
{ flexDirection: "column" },
|
|
588403
|
-
|
|
588404
|
-
|
|
589562
|
+
import_react186.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.titleLabel),
|
|
589563
|
+
import_react186.default.createElement(Text, null, detailTask.title || t.taskManager.untitled)
|
|
588405
589564
|
),
|
|
588406
|
-
|
|
589565
|
+
import_react186.default.createElement(
|
|
588407
589566
|
Box_default,
|
|
588408
589567
|
{ flexDirection: "column" },
|
|
588409
|
-
|
|
588410
|
-
|
|
589568
|
+
import_react186.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.statusLabel),
|
|
589569
|
+
import_react186.default.createElement(
|
|
588411
589570
|
Text,
|
|
588412
589571
|
{ color: getStatusColor(detailTask.status) },
|
|
588413
589572
|
getStatusIcon2(detailTask.status),
|
|
@@ -588415,64 +589574,64 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
588415
589574
|
detailTask.status
|
|
588416
589575
|
)
|
|
588417
589576
|
),
|
|
588418
|
-
|
|
589577
|
+
import_react186.default.createElement(
|
|
588419
589578
|
Box_default,
|
|
588420
589579
|
{ flexDirection: "column" },
|
|
588421
|
-
|
|
588422
|
-
|
|
589580
|
+
import_react186.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.createdLabel),
|
|
589581
|
+
import_react186.default.createElement(Text, null, new Date(detailTask.createdAt).toLocaleString())
|
|
588423
589582
|
),
|
|
588424
|
-
|
|
589583
|
+
import_react186.default.createElement(
|
|
588425
589584
|
Box_default,
|
|
588426
589585
|
{ flexDirection: "column" },
|
|
588427
|
-
|
|
588428
|
-
|
|
589586
|
+
import_react186.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.updatedLabel),
|
|
589587
|
+
import_react186.default.createElement(Text, null, new Date(detailTask.updatedAt).toLocaleString())
|
|
588429
589588
|
),
|
|
588430
|
-
|
|
589589
|
+
import_react186.default.createElement(
|
|
588431
589590
|
Box_default,
|
|
588432
589591
|
{ flexDirection: "column" },
|
|
588433
|
-
|
|
589592
|
+
import_react186.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.messagesLabel.replace("{count}", String(detailTask.messages.length)))
|
|
588434
589593
|
),
|
|
588435
|
-
detailTask.status === "paused" && ((_a20 = detailTask.pausedInfo) == null ? void 0 : _a20.sensitiveCommand) &&
|
|
589594
|
+
detailTask.status === "paused" && ((_a20 = detailTask.pausedInfo) == null ? void 0 : _a20.sensitiveCommand) && import_react186.default.createElement(
|
|
588436
589595
|
Box_default,
|
|
588437
589596
|
{ flexDirection: "column", marginTop: 1 },
|
|
588438
|
-
|
|
589597
|
+
import_react186.default.createElement(
|
|
588439
589598
|
Box_default,
|
|
588440
589599
|
{ flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 1, paddingY: 1 },
|
|
588441
|
-
|
|
588442
|
-
|
|
589600
|
+
import_react186.default.createElement(Text, { color: "yellow", bold: true }, t.taskManager.sensitiveCommandDetected),
|
|
589601
|
+
import_react186.default.createElement(
|
|
588443
589602
|
Box_default,
|
|
588444
589603
|
{ marginTop: 1 },
|
|
588445
|
-
|
|
589604
|
+
import_react186.default.createElement(
|
|
588446
589605
|
Text,
|
|
588447
589606
|
null,
|
|
588448
|
-
|
|
588449
|
-
|
|
589607
|
+
import_react186.default.createElement(Text, { bold: true }, t.taskManager.commandLabel),
|
|
589608
|
+
import_react186.default.createElement(Text, { color: "yellow" }, detailTask.pausedInfo.sensitiveCommand.command)
|
|
588450
589609
|
)
|
|
588451
589610
|
),
|
|
588452
|
-
detailTask.pausedInfo.sensitiveCommand.description &&
|
|
588453
|
-
!rejectInputMode ?
|
|
589611
|
+
detailTask.pausedInfo.sensitiveCommand.description && import_react186.default.createElement(Text, { dimColor: true }, detailTask.pausedInfo.sensitiveCommand.description),
|
|
589612
|
+
!rejectInputMode ? import_react186.default.createElement(
|
|
588454
589613
|
Box_default,
|
|
588455
589614
|
{ marginTop: 1, paddingTop: 1, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: "gray", flexDirection: "column" },
|
|
588456
|
-
|
|
588457
|
-
) :
|
|
589615
|
+
import_react186.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.approveRejectHint)
|
|
589616
|
+
) : import_react186.default.createElement(
|
|
588458
589617
|
Box_default,
|
|
588459
589618
|
{ marginTop: 1, paddingTop: 1, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: "gray", flexDirection: "column" },
|
|
588460
|
-
|
|
588461
|
-
|
|
589619
|
+
import_react186.default.createElement(Text, { color: "yellow", bold: true }, t.taskManager.enterRejectionReason),
|
|
589620
|
+
import_react186.default.createElement(
|
|
588462
589621
|
Text,
|
|
588463
589622
|
null,
|
|
588464
589623
|
rejectReason,
|
|
588465
|
-
|
|
589624
|
+
import_react186.default.createElement(Text, { color: theme14.colors.menuInfo }, "\u2588")
|
|
588466
589625
|
),
|
|
588467
|
-
|
|
589626
|
+
import_react186.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.submitCancelHint)
|
|
588468
589627
|
)
|
|
588469
589628
|
)
|
|
588470
589629
|
)
|
|
588471
589630
|
),
|
|
588472
|
-
(pendingAction == null ? void 0 : pendingAction.type) === "continue" && pendingAction.taskId === detailTask.id &&
|
|
589631
|
+
(pendingAction == null ? void 0 : pendingAction.type) === "continue" && pendingAction.taskId === detailTask.id && import_react186.default.createElement(
|
|
588473
589632
|
Box_default,
|
|
588474
589633
|
{ marginTop: 1 },
|
|
588475
|
-
|
|
589634
|
+
import_react186.default.createElement(Alert, { variant: "warning" }, detailTask.status !== "completed" ? t.taskManager.taskNotCompleted : t.taskManager.confirmConvertToSession)
|
|
588476
589635
|
)
|
|
588477
589636
|
)
|
|
588478
589637
|
);
|
|
@@ -588481,21 +589640,21 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
588481
589640
|
const hasMore = tasks.length > scrollOffset + VISIBLE_ITEMS2;
|
|
588482
589641
|
const hasPrevious = scrollOffset > 0;
|
|
588483
589642
|
const currentTask = tasks[selectedIndex];
|
|
588484
|
-
return
|
|
589643
|
+
return import_react186.default.createElement(
|
|
588485
589644
|
Box_default,
|
|
588486
589645
|
{ flexDirection: "column", paddingX: 1 },
|
|
588487
|
-
|
|
589646
|
+
import_react186.default.createElement(
|
|
588488
589647
|
Box_default,
|
|
588489
589648
|
{ borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1, flexDirection: "column" },
|
|
588490
|
-
|
|
589649
|
+
import_react186.default.createElement(
|
|
588491
589650
|
Box_default,
|
|
588492
589651
|
{ flexDirection: "column" },
|
|
588493
|
-
|
|
589652
|
+
import_react186.default.createElement(
|
|
588494
589653
|
Text,
|
|
588495
589654
|
{ color: theme14.colors.menuInfo, dimColor: true },
|
|
588496
589655
|
t.taskManager.tasksCount.replace("{current}", String(selectedIndex + 1)).replace("{total}", String(tasks.length)),
|
|
588497
589656
|
currentTask && ` \u2022 ${t.taskManager.messagesCount.replace("{count}", String(currentTask.messageCount))}`,
|
|
588498
|
-
markedTasks.size > 0 &&
|
|
589657
|
+
markedTasks.size > 0 && import_react186.default.createElement(
|
|
588499
589658
|
Text,
|
|
588500
589659
|
{ color: theme14.colors.warning },
|
|
588501
589660
|
" ",
|
|
@@ -588504,9 +589663,9 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
588504
589663
|
t.taskManager.markedCount.replace("{count}", String(markedTasks.size))
|
|
588505
589664
|
)
|
|
588506
589665
|
),
|
|
588507
|
-
|
|
589666
|
+
import_react186.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.navigationHint)
|
|
588508
589667
|
),
|
|
588509
|
-
hasPrevious &&
|
|
589668
|
+
hasPrevious && import_react186.default.createElement(
|
|
588510
589669
|
Text,
|
|
588511
589670
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
588512
589671
|
" ",
|
|
@@ -588519,24 +589678,24 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
588519
589678
|
const cleanTitle = (task.title || t.taskManager.untitled).replace(/[\r\n\t]+/g, " ");
|
|
588520
589679
|
const timeStr = formatDate3(task.updatedAt);
|
|
588521
589680
|
const truncatedTitle = cleanTitle.length > 50 ? cleanTitle.slice(0, 47) + "..." : cleanTitle;
|
|
588522
|
-
return
|
|
589681
|
+
return import_react186.default.createElement(
|
|
588523
589682
|
Text,
|
|
588524
589683
|
{ key: task.id },
|
|
588525
|
-
|
|
589684
|
+
import_react186.default.createElement(
|
|
588526
589685
|
Text,
|
|
588527
589686
|
{ color: isSelected ? theme14.colors.menuSelected : "white" },
|
|
588528
589687
|
isSelected ? "\u276F " : " ",
|
|
588529
|
-
isMarked &&
|
|
589688
|
+
isMarked && import_react186.default.createElement(
|
|
588530
589689
|
Text,
|
|
588531
589690
|
{ color: theme14.colors.warning, bold: true },
|
|
588532
589691
|
"\u25CF",
|
|
588533
589692
|
" "
|
|
588534
589693
|
),
|
|
588535
|
-
|
|
589694
|
+
import_react186.default.createElement(Text, { color: getStatusColor(task.status) }, getStatusIcon2(task.status)),
|
|
588536
589695
|
" ",
|
|
588537
589696
|
truncatedTitle
|
|
588538
589697
|
),
|
|
588539
|
-
|
|
589698
|
+
import_react186.default.createElement(
|
|
588540
589699
|
Text,
|
|
588541
589700
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
588542
589701
|
" ",
|
|
@@ -588545,25 +589704,25 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
588545
589704
|
)
|
|
588546
589705
|
);
|
|
588547
589706
|
}),
|
|
588548
|
-
hasMore &&
|
|
589707
|
+
hasMore && import_react186.default.createElement(
|
|
588549
589708
|
Text,
|
|
588550
589709
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
588551
589710
|
" ",
|
|
588552
589711
|
t.taskManager.moreBelow.replace("{count}", String(tasks.length - scrollOffset - VISIBLE_ITEMS2))
|
|
588553
589712
|
)
|
|
588554
589713
|
),
|
|
588555
|
-
(pendingAction == null ? void 0 : pendingAction.type) === "delete" &&
|
|
589714
|
+
(pendingAction == null ? void 0 : pendingAction.type) === "delete" && import_react186.default.createElement(
|
|
588556
589715
|
Box_default,
|
|
588557
589716
|
{ marginTop: 1 },
|
|
588558
|
-
|
|
589717
|
+
import_react186.default.createElement(Alert, { variant: "warning" }, pendingAction.taskId ? t.taskManager.deleteConfirm : t.taskManager.deleteMultipleConfirm.replace("{count}", String(markedTasks.size)))
|
|
588559
589718
|
)
|
|
588560
589719
|
);
|
|
588561
589720
|
}
|
|
588562
|
-
var
|
|
589721
|
+
var import_react186;
|
|
588563
589722
|
var init_TaskManagerScreen = __esm({
|
|
588564
589723
|
async "dist/ui/pages/TaskManagerScreen.js"() {
|
|
588565
589724
|
"use strict";
|
|
588566
|
-
|
|
589725
|
+
import_react186 = __toESM(require_react(), 1);
|
|
588567
589726
|
await init_src();
|
|
588568
589727
|
await init_build3();
|
|
588569
589728
|
init_ThemeContext();
|
|
@@ -588591,22 +589750,22 @@ function HelpScreen({ onBackDestination = "chat" }) {
|
|
|
588591
589750
|
navigateTo(onBackDestination);
|
|
588592
589751
|
}
|
|
588593
589752
|
});
|
|
588594
|
-
return
|
|
589753
|
+
return import_react187.default.createElement(
|
|
588595
589754
|
Box_default,
|
|
588596
589755
|
{ paddingX: 1, flexDirection: "column" },
|
|
588597
|
-
|
|
588598
|
-
|
|
589756
|
+
import_react187.default.createElement(HelpPanel, null),
|
|
589757
|
+
import_react187.default.createElement(
|
|
588599
589758
|
Box_default,
|
|
588600
589759
|
{ marginTop: 1 },
|
|
588601
|
-
|
|
589760
|
+
import_react187.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.pressEscToClose)
|
|
588602
589761
|
)
|
|
588603
589762
|
);
|
|
588604
589763
|
}
|
|
588605
|
-
var
|
|
589764
|
+
var import_react187;
|
|
588606
589765
|
var init_HelpScreen = __esm({
|
|
588607
589766
|
async "dist/ui/pages/HelpScreen.js"() {
|
|
588608
589767
|
"use strict";
|
|
588609
|
-
|
|
589768
|
+
import_react187 = __toESM(require_react(), 1);
|
|
588610
589769
|
await init_src();
|
|
588611
589770
|
init_ThemeContext();
|
|
588612
589771
|
init_I18nContext();
|
|
@@ -588633,17 +589792,17 @@ function ExitScreen({ version: version4 = "1.0.0" }) {
|
|
|
588633
589792
|
useTerminalTitle(`Snow CLI - ${t.exitScreen.title}`);
|
|
588634
589793
|
const { theme: theme14 } = useTheme();
|
|
588635
589794
|
const { columns: terminalWidth } = useTerminalSize();
|
|
588636
|
-
const [sessionId] = (0,
|
|
589795
|
+
const [sessionId] = (0, import_react188.useState)(() => {
|
|
588637
589796
|
var _a20;
|
|
588638
589797
|
return (_a20 = sessionManager.getCurrentSession()) == null ? void 0 : _a20.id;
|
|
588639
589798
|
});
|
|
588640
589799
|
const versionText = t.exitScreen.version.replace("{version}", version4);
|
|
588641
589800
|
const dotWidth = Math.max(12, Math.min(terminalWidth - 8, 42));
|
|
588642
|
-
const dots = (0,
|
|
589801
|
+
const dots = (0, import_react188.useMemo)(() => dotLine(dotWidth), [dotWidth]);
|
|
588643
589802
|
const colors = theme14.colors;
|
|
588644
|
-
const [exitImageGrid, setExitImageGrid] = (0,
|
|
588645
|
-
const [isExitScreenReady, setIsExitScreenReady] = (0,
|
|
588646
|
-
(0,
|
|
589803
|
+
const [exitImageGrid, setExitImageGrid] = (0, import_react188.useState)(void 0);
|
|
589804
|
+
const [isExitScreenReady, setIsExitScreenReady] = (0, import_react188.useState)(false);
|
|
589805
|
+
(0, import_react188.useEffect)(() => {
|
|
588647
589806
|
let active = true;
|
|
588648
589807
|
const loadExitImage = async () => {
|
|
588649
589808
|
try {
|
|
@@ -588671,12 +589830,12 @@ function ExitScreen({ version: version4 = "1.0.0" }) {
|
|
|
588671
589830
|
active = false;
|
|
588672
589831
|
};
|
|
588673
589832
|
}, []);
|
|
588674
|
-
(0,
|
|
589833
|
+
(0, import_react188.useEffect)(() => {
|
|
588675
589834
|
if (!isExitScreenReady)
|
|
588676
589835
|
return;
|
|
588677
589836
|
gracefulExit();
|
|
588678
589837
|
}, [isExitScreenReady]);
|
|
588679
|
-
const exitImageRows = (0,
|
|
589838
|
+
const exitImageRows = (0, import_react188.useMemo)(() => {
|
|
588680
589839
|
var _a20, _b14, _c6;
|
|
588681
589840
|
if (!exitImageGrid)
|
|
588682
589841
|
return [];
|
|
@@ -588696,62 +589855,62 @@ function ExitScreen({ version: version4 = "1.0.0" }) {
|
|
|
588696
589855
|
}
|
|
588697
589856
|
return rows;
|
|
588698
589857
|
}, [exitImageGrid]);
|
|
588699
|
-
return
|
|
589858
|
+
return import_react188.default.createElement(
|
|
588700
589859
|
Box_default,
|
|
588701
589860
|
{ flexDirection: "column", alignItems: "center", justifyContent: "center", paddingY: 1, width: terminalWidth },
|
|
588702
|
-
|
|
589861
|
+
import_react188.default.createElement(
|
|
588703
589862
|
Box_default,
|
|
588704
589863
|
{ flexDirection: "column", alignItems: "center" },
|
|
588705
|
-
|
|
588706
|
-
exitImageRows.length > 0 &&
|
|
588707
|
-
|
|
589864
|
+
import_react188.default.createElement(Text, { color: colors.border, dimColor: true }, dots),
|
|
589865
|
+
exitImageRows.length > 0 && import_react188.default.createElement(Box_default, { marginTop: 1, flexDirection: "column", alignItems: "center" }, exitImageRows.map((row, i) => import_react188.default.createElement(Text, { key: i }, row))),
|
|
589866
|
+
import_react188.default.createElement(
|
|
588708
589867
|
Box_default,
|
|
588709
589868
|
{ marginTop: 1 },
|
|
588710
|
-
|
|
589869
|
+
import_react188.default.createElement(
|
|
588711
589870
|
Text,
|
|
588712
589871
|
null,
|
|
588713
|
-
|
|
588714
|
-
|
|
589872
|
+
import_react188.default.createElement(Text, { color: colors.cyan }, "\u2746 "),
|
|
589873
|
+
import_react188.default.createElement(dist_default5, { colors: colors.logoGradient }, "SNOW CLI")
|
|
588715
589874
|
)
|
|
588716
589875
|
),
|
|
588717
|
-
|
|
589876
|
+
import_react188.default.createElement(
|
|
588718
589877
|
Box_default,
|
|
588719
589878
|
{ marginTop: 1 },
|
|
588720
|
-
|
|
588721
|
-
|
|
588722
|
-
|
|
589879
|
+
import_react188.default.createElement(Text, { color: colors.border, dimColor: true }, "\u2500\u2500 "),
|
|
589880
|
+
import_react188.default.createElement(Text, { color: colors.menuInfo, bold: true }, t.exitScreen.title),
|
|
589881
|
+
import_react188.default.createElement(Text, { color: colors.border, dimColor: true }, " \u2500\u2500")
|
|
588723
589882
|
),
|
|
588724
|
-
|
|
589883
|
+
import_react188.default.createElement(
|
|
588725
589884
|
Box_default,
|
|
588726
589885
|
{ marginTop: 1 },
|
|
588727
|
-
|
|
589886
|
+
import_react188.default.createElement(Text, { color: colors.text }, t.exitScreen.goodbye)
|
|
588728
589887
|
),
|
|
588729
|
-
|
|
588730
|
-
sessionId &&
|
|
589888
|
+
import_react188.default.createElement(Text, { color: colors.menuSecondary }, t.exitScreen.thankYou),
|
|
589889
|
+
sessionId && import_react188.default.createElement(
|
|
588731
589890
|
Box_default,
|
|
588732
589891
|
{ marginTop: 1, flexDirection: "column", alignItems: "center" },
|
|
588733
|
-
|
|
588734
|
-
|
|
589892
|
+
import_react188.default.createElement(Text, { color: colors.menuSecondary, dimColor: true }, `\u2500\u2500\u2500 ${t.exitScreen.resumeSession} \u2500\u2500\u2500`),
|
|
589893
|
+
import_react188.default.createElement(
|
|
588735
589894
|
Box_default,
|
|
588736
589895
|
{ marginTop: 0 },
|
|
588737
|
-
|
|
588738
|
-
|
|
589896
|
+
import_react188.default.createElement(Text, { color: colors.cyan }, "snow -c "),
|
|
589897
|
+
import_react188.default.createElement(Text, { color: colors.menuInfo }, sessionId)
|
|
588739
589898
|
)
|
|
588740
589899
|
),
|
|
588741
|
-
|
|
589900
|
+
import_react188.default.createElement(
|
|
588742
589901
|
Box_default,
|
|
588743
589902
|
{ marginTop: 1 },
|
|
588744
|
-
|
|
589903
|
+
import_react188.default.createElement(Text, { color: colors.border, dimColor: true }, dots)
|
|
588745
589904
|
),
|
|
588746
|
-
|
|
589905
|
+
import_react188.default.createElement(Text, { color: colors.menuSecondary, dimColor: true }, versionText)
|
|
588747
589906
|
)
|
|
588748
589907
|
);
|
|
588749
589908
|
}
|
|
588750
|
-
var
|
|
589909
|
+
var import_react188, EXIT_IMAGE_PATH2, BLOCK_CHAR2;
|
|
588751
589910
|
var init_ExitScreen = __esm({
|
|
588752
589911
|
async "dist/ui/pages/ExitScreen.js"() {
|
|
588753
589912
|
"use strict";
|
|
588754
|
-
|
|
589913
|
+
import_react188 = __toESM(require_react(), 1);
|
|
588755
589914
|
await init_src();
|
|
588756
589915
|
await init_dist7();
|
|
588757
589916
|
init_source();
|
|
@@ -588772,16 +589931,16 @@ __export(app_exports, {
|
|
|
588772
589931
|
default: () => App2
|
|
588773
589932
|
});
|
|
588774
589933
|
function ShowTaskListWrapper() {
|
|
588775
|
-
const [currentView, setCurrentView] = (0,
|
|
588776
|
-
const [chatScreenKey, setChatScreenKey] = (0,
|
|
588777
|
-
const [exitNotification, setExitNotification] = (0,
|
|
589934
|
+
const [currentView, setCurrentView] = (0, import_react189.useState)("tasks");
|
|
589935
|
+
const [chatScreenKey, setChatScreenKey] = (0, import_react189.useState)(0);
|
|
589936
|
+
const [exitNotification, setExitNotification] = (0, import_react189.useState)({
|
|
588778
589937
|
show: false,
|
|
588779
589938
|
message: ""
|
|
588780
589939
|
});
|
|
588781
589940
|
const { columns: terminalWidth } = useTerminalSize();
|
|
588782
589941
|
const loadingFallback = null;
|
|
588783
589942
|
useGlobalExit(setExitNotification);
|
|
588784
|
-
(0,
|
|
589943
|
+
(0, import_react189.useEffect)(() => {
|
|
588785
589944
|
const unsubscribe = onNavigate((event) => {
|
|
588786
589945
|
if (event.destination === "exit" || event.destination === "tasks" || event.destination === "chat") {
|
|
588787
589946
|
setCurrentView(event.destination);
|
|
@@ -588791,51 +589950,51 @@ function ShowTaskListWrapper() {
|
|
|
588791
589950
|
}, []);
|
|
588792
589951
|
const renderView = () => {
|
|
588793
589952
|
if (currentView === "exit") {
|
|
588794
|
-
return
|
|
588795
|
-
|
|
589953
|
+
return import_react189.default.createElement(
|
|
589954
|
+
import_react189.Suspense,
|
|
588796
589955
|
{ fallback: loadingFallback },
|
|
588797
|
-
|
|
589956
|
+
import_react189.default.createElement(ExitScreen2, null)
|
|
588798
589957
|
);
|
|
588799
589958
|
}
|
|
588800
589959
|
if (currentView === "chat") {
|
|
588801
|
-
return
|
|
588802
|
-
|
|
589960
|
+
return import_react189.default.createElement(
|
|
589961
|
+
import_react189.Suspense,
|
|
588803
589962
|
{ fallback: loadingFallback },
|
|
588804
|
-
|
|
589963
|
+
import_react189.default.createElement(ChatScreen2, { key: chatScreenKey, autoResume: true, enableYolo: false })
|
|
588805
589964
|
);
|
|
588806
589965
|
}
|
|
588807
|
-
return
|
|
588808
|
-
|
|
589966
|
+
return import_react189.default.createElement(
|
|
589967
|
+
import_react189.Suspense,
|
|
588809
589968
|
{ fallback: loadingFallback },
|
|
588810
|
-
|
|
589969
|
+
import_react189.default.createElement(TaskManagerScreen2, { onBack: () => gracefulExit(), onResumeTask: () => {
|
|
588811
589970
|
setCurrentView("chat");
|
|
588812
589971
|
setChatScreenKey((prev) => prev + 1);
|
|
588813
589972
|
} })
|
|
588814
589973
|
);
|
|
588815
589974
|
};
|
|
588816
|
-
return
|
|
589975
|
+
return import_react189.default.createElement(
|
|
588817
589976
|
Box_default,
|
|
588818
589977
|
{ flexDirection: "column", width: terminalWidth },
|
|
588819
589978
|
renderView(),
|
|
588820
|
-
exitNotification.show && currentView !== "exit" &&
|
|
589979
|
+
exitNotification.show && currentView !== "exit" && import_react189.default.createElement(
|
|
588821
589980
|
Box_default,
|
|
588822
589981
|
{ paddingX: 1, flexShrink: 0 },
|
|
588823
|
-
|
|
589982
|
+
import_react189.default.createElement(Alert, { variant: "warning" }, exitNotification.message)
|
|
588824
589983
|
)
|
|
588825
589984
|
);
|
|
588826
589985
|
}
|
|
588827
589986
|
function AppContent({ version: version4, skipWelcome, autoResume, resumeSessionId: resumeSessionId2, enableYolo, enablePlan }) {
|
|
588828
|
-
const [currentView, setCurrentView] = (0,
|
|
588829
|
-
const [chatScreenKey, setChatScreenKey] = (0,
|
|
588830
|
-
const [welcomeMenuIndex, setWelcomeMenuIndex] = (0,
|
|
588831
|
-
const [shouldAutoResume, setShouldAutoResume] = (0,
|
|
588832
|
-
const [exitNotification, setExitNotification] = (0,
|
|
589987
|
+
const [currentView, setCurrentView] = (0, import_react189.useState)(skipWelcome ? "chat" : "welcome");
|
|
589988
|
+
const [chatScreenKey, setChatScreenKey] = (0, import_react189.useState)(0);
|
|
589989
|
+
const [welcomeMenuIndex, setWelcomeMenuIndex] = (0, import_react189.useState)(0);
|
|
589990
|
+
const [shouldAutoResume, setShouldAutoResume] = (0, import_react189.useState)(false);
|
|
589991
|
+
const [exitNotification, setExitNotification] = (0, import_react189.useState)({
|
|
588833
589992
|
show: false,
|
|
588834
589993
|
message: ""
|
|
588835
589994
|
});
|
|
588836
589995
|
const { columns: terminalWidth } = useTerminalSize();
|
|
588837
589996
|
useGlobalExit(setExitNotification);
|
|
588838
|
-
(0,
|
|
589997
|
+
(0, import_react189.useEffect)(() => {
|
|
588839
589998
|
const unsubscribe = onNavigate((event) => {
|
|
588840
589999
|
if (event.destination === "welcome" && currentView === "chat") {
|
|
588841
590000
|
setChatScreenKey((prev) => prev + 1);
|
|
@@ -588865,119 +590024,119 @@ function AppContent({ version: version4, skipWelcome, autoResume, resumeSessionI
|
|
|
588865
590024
|
const loadingFallback = null;
|
|
588866
590025
|
switch (currentView) {
|
|
588867
590026
|
case "welcome":
|
|
588868
|
-
return
|
|
588869
|
-
|
|
590027
|
+
return import_react189.default.createElement(
|
|
590028
|
+
import_react189.Suspense,
|
|
588870
590029
|
{ fallback: loadingFallback },
|
|
588871
|
-
|
|
590030
|
+
import_react189.default.createElement(WelcomeScreen2, { version: version4, onMenuSelect: handleMenuSelect, defaultMenuIndex: welcomeMenuIndex, onMenuSelectionPersist: setWelcomeMenuIndex })
|
|
588872
590031
|
);
|
|
588873
590032
|
case "chat":
|
|
588874
|
-
return
|
|
588875
|
-
|
|
590033
|
+
return import_react189.default.createElement(
|
|
590034
|
+
import_react189.Suspense,
|
|
588876
590035
|
{ fallback: loadingFallback },
|
|
588877
|
-
|
|
590036
|
+
import_react189.default.createElement(ChatScreen2, { key: chatScreenKey, autoResume: autoResume || shouldAutoResume, resumeSessionId: resumeSessionId2, enableYolo, enablePlan })
|
|
588878
590037
|
);
|
|
588879
590038
|
case "settings":
|
|
588880
|
-
return
|
|
590039
|
+
return import_react189.default.createElement(
|
|
588881
590040
|
Box_default,
|
|
588882
590041
|
{ flexDirection: "column" },
|
|
588883
|
-
|
|
588884
|
-
|
|
590042
|
+
import_react189.default.createElement(Text, { color: "blue" }, "Settings"),
|
|
590043
|
+
import_react189.default.createElement(Text, { color: "gray" }, "Settings interface would be implemented here")
|
|
588885
590044
|
);
|
|
588886
590045
|
case "systemprompt":
|
|
588887
|
-
return
|
|
588888
|
-
|
|
590046
|
+
return import_react189.default.createElement(
|
|
590047
|
+
import_react189.Suspense,
|
|
588889
590048
|
{ fallback: loadingFallback },
|
|
588890
|
-
|
|
590049
|
+
import_react189.default.createElement(SystemPromptConfigScreen3, { onBack: () => setCurrentView("welcome") })
|
|
588891
590050
|
);
|
|
588892
590051
|
case "help":
|
|
588893
|
-
return
|
|
588894
|
-
|
|
590052
|
+
return import_react189.default.createElement(
|
|
590053
|
+
import_react189.Suspense,
|
|
588895
590054
|
{ fallback: loadingFallback },
|
|
588896
|
-
|
|
590055
|
+
import_react189.default.createElement(HelpScreen2, { onBackDestination: "chat" })
|
|
588897
590056
|
);
|
|
588898
590057
|
case "customheaders":
|
|
588899
|
-
return
|
|
588900
|
-
|
|
590058
|
+
return import_react189.default.createElement(
|
|
590059
|
+
import_react189.Suspense,
|
|
588901
590060
|
{ fallback: loadingFallback },
|
|
588902
|
-
|
|
590061
|
+
import_react189.default.createElement(CustomHeadersScreen3, { onBack: () => setCurrentView("welcome") })
|
|
588903
590062
|
);
|
|
588904
590063
|
case "tasks":
|
|
588905
|
-
return
|
|
588906
|
-
|
|
590064
|
+
return import_react189.default.createElement(
|
|
590065
|
+
import_react189.Suspense,
|
|
588907
590066
|
{ fallback: loadingFallback },
|
|
588908
|
-
|
|
590067
|
+
import_react189.default.createElement(TaskManagerScreen2, { onBack: () => setCurrentView("chat"), onResumeTask: () => {
|
|
588909
590068
|
setCurrentView("chat");
|
|
588910
590069
|
setChatScreenKey((prev) => prev + 1);
|
|
588911
590070
|
} })
|
|
588912
590071
|
);
|
|
588913
590072
|
case "exit":
|
|
588914
|
-
return
|
|
588915
|
-
|
|
590073
|
+
return import_react189.default.createElement(
|
|
590074
|
+
import_react189.Suspense,
|
|
588916
590075
|
{ fallback: loadingFallback },
|
|
588917
|
-
|
|
590076
|
+
import_react189.default.createElement(ExitScreen2, { version: version4 })
|
|
588918
590077
|
);
|
|
588919
590078
|
default:
|
|
588920
|
-
return
|
|
588921
|
-
|
|
590079
|
+
return import_react189.default.createElement(
|
|
590080
|
+
import_react189.Suspense,
|
|
588922
590081
|
{ fallback: loadingFallback },
|
|
588923
|
-
|
|
590082
|
+
import_react189.default.createElement(WelcomeScreen2, { version: version4, onMenuSelect: handleMenuSelect, defaultMenuIndex: welcomeMenuIndex, onMenuSelectionPersist: setWelcomeMenuIndex })
|
|
588924
590083
|
);
|
|
588925
590084
|
}
|
|
588926
590085
|
};
|
|
588927
|
-
return
|
|
590086
|
+
return import_react189.default.createElement(
|
|
588928
590087
|
Box_default,
|
|
588929
590088
|
{ flexDirection: "column", width: terminalWidth },
|
|
588930
590089
|
renderView(),
|
|
588931
|
-
exitNotification.show && currentView !== "exit" &&
|
|
590090
|
+
exitNotification.show && currentView !== "exit" && import_react189.default.createElement(
|
|
588932
590091
|
Box_default,
|
|
588933
590092
|
{ paddingX: 1, flexShrink: 0 },
|
|
588934
|
-
|
|
590093
|
+
import_react189.default.createElement(Alert, { variant: "warning" }, exitNotification.message)
|
|
588935
590094
|
)
|
|
588936
590095
|
);
|
|
588937
590096
|
}
|
|
588938
590097
|
function App2({ version: version4, skipWelcome, autoResume, resumeSessionId: resumeSessionId2, headlessPrompt, headlessSessionId, showTaskList, enableYolo, enablePlan }) {
|
|
588939
590098
|
if (headlessPrompt) {
|
|
588940
590099
|
const loadingFallback = null;
|
|
588941
|
-
return
|
|
590100
|
+
return import_react189.default.createElement(
|
|
588942
590101
|
I18nProvider,
|
|
588943
590102
|
null,
|
|
588944
|
-
|
|
590103
|
+
import_react189.default.createElement(
|
|
588945
590104
|
ThemeProvider,
|
|
588946
590105
|
null,
|
|
588947
|
-
|
|
588948
|
-
|
|
590106
|
+
import_react189.default.createElement(
|
|
590107
|
+
import_react189.Suspense,
|
|
588949
590108
|
{ fallback: loadingFallback },
|
|
588950
|
-
|
|
590109
|
+
import_react189.default.createElement(HeadlessModeScreen2, { prompt: headlessPrompt, sessionId: headlessSessionId, onComplete: () => gracefulExit() })
|
|
588951
590110
|
)
|
|
588952
590111
|
)
|
|
588953
590112
|
);
|
|
588954
590113
|
}
|
|
588955
590114
|
if (showTaskList) {
|
|
588956
|
-
return
|
|
590115
|
+
return import_react189.default.createElement(
|
|
588957
590116
|
I18nProvider,
|
|
588958
590117
|
null,
|
|
588959
|
-
|
|
590118
|
+
import_react189.default.createElement(
|
|
588960
590119
|
ThemeProvider,
|
|
588961
590120
|
null,
|
|
588962
|
-
|
|
590121
|
+
import_react189.default.createElement(ShowTaskListWrapper, null)
|
|
588963
590122
|
)
|
|
588964
590123
|
);
|
|
588965
590124
|
}
|
|
588966
|
-
return
|
|
590125
|
+
return import_react189.default.createElement(
|
|
588967
590126
|
I18nProvider,
|
|
588968
590127
|
null,
|
|
588969
|
-
|
|
590128
|
+
import_react189.default.createElement(
|
|
588970
590129
|
ThemeProvider,
|
|
588971
590130
|
null,
|
|
588972
|
-
|
|
590131
|
+
import_react189.default.createElement(AppContent, { version: version4, skipWelcome, autoResume, resumeSessionId: resumeSessionId2, enableYolo, enablePlan })
|
|
588973
590132
|
)
|
|
588974
590133
|
);
|
|
588975
590134
|
}
|
|
588976
|
-
var
|
|
590135
|
+
var import_react189, WelcomeScreen2, ChatScreen2, HeadlessModeScreen2, TaskManagerScreen2, SystemPromptConfigScreen3, CustomHeadersScreen3, HelpScreen2, ExitScreen2;
|
|
588977
590136
|
var init_app = __esm({
|
|
588978
590137
|
async "dist/app.js"() {
|
|
588979
590138
|
"use strict";
|
|
588980
|
-
|
|
590139
|
+
import_react189 = __toESM(require_react(), 1);
|
|
588981
590140
|
await init_src();
|
|
588982
590141
|
await init_build3();
|
|
588983
590142
|
await init_useGlobalExit();
|
|
@@ -588987,14 +590146,14 @@ var init_app = __esm({
|
|
|
588987
590146
|
init_ThemeContext();
|
|
588988
590147
|
init_processManager();
|
|
588989
590148
|
init_apiConfig();
|
|
588990
|
-
WelcomeScreen2 =
|
|
588991
|
-
ChatScreen2 =
|
|
588992
|
-
HeadlessModeScreen2 =
|
|
588993
|
-
TaskManagerScreen2 =
|
|
588994
|
-
SystemPromptConfigScreen3 =
|
|
588995
|
-
CustomHeadersScreen3 =
|
|
588996
|
-
HelpScreen2 =
|
|
588997
|
-
ExitScreen2 =
|
|
590149
|
+
WelcomeScreen2 = import_react189.default.lazy(() => init_WelcomeScreen().then(() => WelcomeScreen_exports));
|
|
590150
|
+
ChatScreen2 = import_react189.default.lazy(() => init_ChatScreen().then(() => ChatScreen_exports));
|
|
590151
|
+
HeadlessModeScreen2 = import_react189.default.lazy(() => init_HeadlessModeScreen().then(() => HeadlessModeScreen_exports));
|
|
590152
|
+
TaskManagerScreen2 = import_react189.default.lazy(() => init_TaskManagerScreen().then(() => TaskManagerScreen_exports));
|
|
590153
|
+
SystemPromptConfigScreen3 = import_react189.default.lazy(() => init_SystemPromptConfigScreen().then(() => SystemPromptConfigScreen_exports));
|
|
590154
|
+
CustomHeadersScreen3 = import_react189.default.lazy(() => init_CustomHeadersScreen().then(() => CustomHeadersScreen_exports));
|
|
590155
|
+
HelpScreen2 = import_react189.default.lazy(() => init_HelpScreen().then(() => HelpScreen_exports));
|
|
590156
|
+
ExitScreen2 = import_react189.default.lazy(() => init_ExitScreen().then(() => ExitScreen_exports));
|
|
588998
590157
|
}
|
|
588999
590158
|
});
|
|
589000
590159
|
|
|
@@ -590619,17 +591778,17 @@ var SSEServerStatus_exports = {};
|
|
|
590619
591778
|
__export(SSEServerStatus_exports, {
|
|
590620
591779
|
SSEServerStatus: () => SSEServerStatus
|
|
590621
591780
|
});
|
|
590622
|
-
var
|
|
591781
|
+
var import_react190, SSEServerStatus;
|
|
590623
591782
|
var init_SSEServerStatus = __esm({
|
|
590624
591783
|
async "dist/ui/components/sse/SSEServerStatus.js"() {
|
|
590625
591784
|
"use strict";
|
|
590626
|
-
|
|
591785
|
+
import_react190 = __toESM(require_react(), 1);
|
|
590627
591786
|
await init_src();
|
|
590628
591787
|
init_I18nContext();
|
|
590629
591788
|
SSEServerStatus = ({ port, workingDir, onLogUpdate }) => {
|
|
590630
591789
|
const { t } = useI18n();
|
|
590631
|
-
const [logs, setLogs] = (0,
|
|
590632
|
-
(0,
|
|
591790
|
+
const [logs, setLogs] = (0, import_react190.useState)([]);
|
|
591791
|
+
(0, import_react190.useEffect)(() => {
|
|
590633
591792
|
if (onLogUpdate) {
|
|
590634
591793
|
onLogUpdate((message, level = "info") => {
|
|
590635
591794
|
const timestamp = (/* @__PURE__ */ new Date()).toLocaleTimeString("zh-CN", {
|
|
@@ -590649,89 +591808,89 @@ var init_SSEServerStatus = __esm({
|
|
|
590649
591808
|
return "gray";
|
|
590650
591809
|
}
|
|
590651
591810
|
};
|
|
590652
|
-
return
|
|
591811
|
+
return import_react190.default.createElement(
|
|
590653
591812
|
Box_default,
|
|
590654
591813
|
{ flexDirection: "column" },
|
|
590655
|
-
|
|
591814
|
+
import_react190.default.createElement(
|
|
590656
591815
|
Box_default,
|
|
590657
591816
|
null,
|
|
590658
|
-
|
|
591817
|
+
import_react190.default.createElement(Text, { bold: true, color: "green" }, t.sseServer.started)
|
|
590659
591818
|
),
|
|
590660
|
-
|
|
591819
|
+
import_react190.default.createElement(
|
|
590661
591820
|
Box_default,
|
|
590662
591821
|
null,
|
|
590663
|
-
|
|
591822
|
+
import_react190.default.createElement(
|
|
590664
591823
|
Text,
|
|
590665
591824
|
null,
|
|
590666
591825
|
t.sseServer.port,
|
|
590667
591826
|
": "
|
|
590668
591827
|
),
|
|
590669
|
-
|
|
590670
|
-
workingDir &&
|
|
590671
|
-
|
|
591828
|
+
import_react190.default.createElement(Text, { color: "cyan" }, port),
|
|
591829
|
+
workingDir && import_react190.default.createElement(
|
|
591830
|
+
import_react190.default.Fragment,
|
|
590672
591831
|
null,
|
|
590673
|
-
|
|
591832
|
+
import_react190.default.createElement(
|
|
590674
591833
|
Text,
|
|
590675
591834
|
null,
|
|
590676
591835
|
" | ",
|
|
590677
591836
|
t.sseServer.workingDir,
|
|
590678
591837
|
": "
|
|
590679
591838
|
),
|
|
590680
|
-
|
|
591839
|
+
import_react190.default.createElement(Text, { color: "yellow" }, workingDir)
|
|
590681
591840
|
),
|
|
590682
|
-
|
|
590683
|
-
|
|
591841
|
+
import_react190.default.createElement(Text, null, " | "),
|
|
591842
|
+
import_react190.default.createElement(
|
|
590684
591843
|
Text,
|
|
590685
591844
|
{ color: "green" },
|
|
590686
591845
|
"\u25CF ",
|
|
590687
591846
|
t.sseServer.running
|
|
590688
591847
|
)
|
|
590689
591848
|
),
|
|
590690
|
-
|
|
591849
|
+
import_react190.default.createElement(
|
|
590691
591850
|
Box_default,
|
|
590692
591851
|
{ flexDirection: "column" },
|
|
590693
|
-
|
|
591852
|
+
import_react190.default.createElement(
|
|
590694
591853
|
Text,
|
|
590695
591854
|
{ dimColor: true },
|
|
590696
591855
|
t.sseServer.endpoints,
|
|
590697
591856
|
":"
|
|
590698
591857
|
),
|
|
590699
|
-
|
|
591858
|
+
import_react190.default.createElement(
|
|
590700
591859
|
Text,
|
|
590701
591860
|
{ color: "blue" },
|
|
590702
591861
|
" http://localhost:",
|
|
590703
591862
|
port,
|
|
590704
591863
|
"/events"
|
|
590705
591864
|
),
|
|
590706
|
-
|
|
591865
|
+
import_react190.default.createElement(
|
|
590707
591866
|
Text,
|
|
590708
591867
|
{ color: "blue" },
|
|
590709
591868
|
" POST http://localhost:",
|
|
590710
591869
|
port,
|
|
590711
591870
|
"/message"
|
|
590712
591871
|
),
|
|
590713
|
-
|
|
591872
|
+
import_react190.default.createElement(
|
|
590714
591873
|
Text,
|
|
590715
591874
|
{ color: "blue" },
|
|
590716
591875
|
" POST http://localhost:",
|
|
590717
591876
|
port,
|
|
590718
591877
|
"/session/create"
|
|
590719
591878
|
),
|
|
590720
|
-
|
|
591879
|
+
import_react190.default.createElement(
|
|
590721
591880
|
Text,
|
|
590722
591881
|
{ color: "blue" },
|
|
590723
591882
|
" POST http://localhost:",
|
|
590724
591883
|
port,
|
|
590725
591884
|
"/session/load"
|
|
590726
591885
|
),
|
|
590727
|
-
|
|
591886
|
+
import_react190.default.createElement(
|
|
590728
591887
|
Text,
|
|
590729
591888
|
{ color: "blue" },
|
|
590730
591889
|
" GET http://localhost:",
|
|
590731
591890
|
port,
|
|
590732
591891
|
"/session/list"
|
|
590733
591892
|
),
|
|
590734
|
-
|
|
591893
|
+
import_react190.default.createElement(
|
|
590735
591894
|
Text,
|
|
590736
591895
|
{ color: "blue" },
|
|
590737
591896
|
" ",
|
|
@@ -590739,7 +591898,7 @@ var init_SSEServerStatus = __esm({
|
|
|
590739
591898
|
port,
|
|
590740
591899
|
"/session/rollback-points?sessionId=:sessionId"
|
|
590741
591900
|
),
|
|
590742
|
-
|
|
591901
|
+
import_react190.default.createElement(
|
|
590743
591902
|
Text,
|
|
590744
591903
|
{ color: "blue" },
|
|
590745
591904
|
" ",
|
|
@@ -590747,14 +591906,14 @@ var init_SSEServerStatus = __esm({
|
|
|
590747
591906
|
port,
|
|
590748
591907
|
"/session/:sessionId"
|
|
590749
591908
|
),
|
|
590750
|
-
|
|
591909
|
+
import_react190.default.createElement(
|
|
590751
591910
|
Text,
|
|
590752
591911
|
{ color: "blue" },
|
|
590753
591912
|
" POST http://localhost:",
|
|
590754
591913
|
port,
|
|
590755
591914
|
"/context/compress"
|
|
590756
591915
|
),
|
|
590757
|
-
|
|
591916
|
+
import_react190.default.createElement(
|
|
590758
591917
|
Text,
|
|
590759
591918
|
{ color: "blue" },
|
|
590760
591919
|
" GET http://localhost:",
|
|
@@ -590762,10 +591921,10 @@ var init_SSEServerStatus = __esm({
|
|
|
590762
591921
|
"/health"
|
|
590763
591922
|
)
|
|
590764
591923
|
),
|
|
590765
|
-
|
|
591924
|
+
import_react190.default.createElement(
|
|
590766
591925
|
Box_default,
|
|
590767
591926
|
{ flexDirection: "column" },
|
|
590768
|
-
|
|
591927
|
+
import_react190.default.createElement(
|
|
590769
591928
|
Text,
|
|
590770
591929
|
{ dimColor: true },
|
|
590771
591930
|
t.sseServer.logs,
|
|
@@ -590773,23 +591932,23 @@ var init_SSEServerStatus = __esm({
|
|
|
590773
591932
|
logs.length,
|
|
590774
591933
|
"):"
|
|
590775
591934
|
),
|
|
590776
|
-
|
|
591935
|
+
import_react190.default.createElement(Box_default, { flexDirection: "column" }, logs.map((log, index) => import_react190.default.createElement(
|
|
590777
591936
|
Box_default,
|
|
590778
591937
|
{ key: index },
|
|
590779
|
-
|
|
591938
|
+
import_react190.default.createElement(
|
|
590780
591939
|
Text,
|
|
590781
591940
|
{ dimColor: true },
|
|
590782
591941
|
"[",
|
|
590783
591942
|
log.timestamp,
|
|
590784
591943
|
"] "
|
|
590785
591944
|
),
|
|
590786
|
-
|
|
591945
|
+
import_react190.default.createElement(Text, { color: getLevelColor(log.level) }, log.message)
|
|
590787
591946
|
)))
|
|
590788
591947
|
),
|
|
590789
|
-
|
|
591948
|
+
import_react190.default.createElement(
|
|
590790
591949
|
Box_default,
|
|
590791
591950
|
null,
|
|
590792
|
-
|
|
591951
|
+
import_react190.default.createElement(Text, { dimColor: true }, t.sseServer.stopHint)
|
|
590793
591952
|
)
|
|
590794
591953
|
);
|
|
590795
591954
|
};
|
|
@@ -603911,7 +605070,7 @@ var require_package3 = __commonJS({
|
|
|
603911
605070
|
"package.json"(exports2, module2) {
|
|
603912
605071
|
module2.exports = {
|
|
603913
605072
|
name: "snow-ai",
|
|
603914
|
-
version: "0.7.
|
|
605073
|
+
version: "0.7.22",
|
|
603915
605074
|
description: "Agentic coding in your terminal",
|
|
603916
605075
|
license: "MIT",
|
|
603917
605076
|
bin: {
|
|
@@ -604572,7 +605731,7 @@ var init_acpManager = __esm({
|
|
|
604572
605731
|
});
|
|
604573
605732
|
|
|
604574
605733
|
// dist/cli.js
|
|
604575
|
-
var
|
|
605734
|
+
var import_react191 = __toESM(require_react(), 1);
|
|
604576
605735
|
await init_src();
|
|
604577
605736
|
init_updateNotice();
|
|
604578
605737
|
await init_build2();
|
|
@@ -605704,10 +606863,10 @@ if (cli.flags.sse) {
|
|
|
605704
606863
|
const { SSEServerStatus: SSEServerStatus2 } = await init_SSEServerStatus().then(() => SSEServerStatus_exports);
|
|
605705
606864
|
const { I18nProvider: I18nProvider2 } = await Promise.resolve().then(() => (init_I18nContext(), I18nContext_exports));
|
|
605706
606865
|
let logUpdater;
|
|
605707
|
-
const { unmount } = render_default(
|
|
606866
|
+
const { unmount } = render_default(import_react191.default.createElement(
|
|
605708
606867
|
I18nProvider2,
|
|
605709
606868
|
null,
|
|
605710
|
-
|
|
606869
|
+
import_react191.default.createElement(SSEServerStatus2, { port, workingDir: workDir || process.cwd(), onLogUpdate: (callback) => {
|
|
605711
606870
|
logUpdater = callback;
|
|
605712
606871
|
} })
|
|
605713
606872
|
));
|
|
@@ -605758,9 +606917,9 @@ if (cli.flags.taskExecute) {
|
|
|
605758
606917
|
process.exit(0);
|
|
605759
606918
|
}
|
|
605760
606919
|
var Startup = ({ version: version4, skipWelcome, autoResume, resumeSessionId: resumeSessionId2, headlessPrompt, headlessSessionId, showTaskList, isDevMode: isDevMode2, enableYolo, enablePlan }) => {
|
|
605761
|
-
const [appReady, setAppReady] =
|
|
605762
|
-
const [AppComponent, setAppComponent] =
|
|
605763
|
-
|
|
606920
|
+
const [appReady, setAppReady] = import_react191.default.useState(false);
|
|
606921
|
+
const [AppComponent, setAppComponent] = import_react191.default.useState(null);
|
|
606922
|
+
import_react191.default.useEffect(() => {
|
|
605764
606923
|
let mounted = true;
|
|
605765
606924
|
const init = async () => {
|
|
605766
606925
|
const deps = await loadDependencies();
|
|
@@ -605806,22 +606965,22 @@ var Startup = ({ version: version4, skipWelcome, autoResume, resumeSessionId: re
|
|
|
605806
606965
|
};
|
|
605807
606966
|
}, [version4, isDevMode2]);
|
|
605808
606967
|
if (!appReady || !AppComponent) {
|
|
605809
|
-
return
|
|
606968
|
+
return import_react191.default.createElement(
|
|
605810
606969
|
Box_default,
|
|
605811
606970
|
{ flexDirection: "column" },
|
|
605812
|
-
|
|
606971
|
+
import_react191.default.createElement(
|
|
605813
606972
|
Box_default,
|
|
605814
606973
|
null,
|
|
605815
|
-
|
|
606974
|
+
import_react191.default.createElement(
|
|
605816
606975
|
Text,
|
|
605817
606976
|
{ color: "cyan" },
|
|
605818
|
-
|
|
606977
|
+
import_react191.default.createElement(build_default, { type: "dots" })
|
|
605819
606978
|
),
|
|
605820
|
-
|
|
606979
|
+
import_react191.default.createElement(Text, null, " Loading...")
|
|
605821
606980
|
)
|
|
605822
606981
|
);
|
|
605823
606982
|
}
|
|
605824
|
-
return
|
|
606983
|
+
return import_react191.default.createElement(AppComponent, { version: version4, skipWelcome, autoResume, resumeSessionId: resumeSessionId2, headlessPrompt, headlessSessionId, showTaskList, enableYolo, enablePlan });
|
|
605825
606984
|
};
|
|
605826
606985
|
process.stdout.write("\x1B[?2004l");
|
|
605827
606986
|
process.stdout.write("\x1B[2K\r");
|
|
@@ -605910,7 +607069,7 @@ process.on("SIGTERM", async () => {
|
|
|
605910
607069
|
});
|
|
605911
607070
|
var isResumeMode = Boolean(cli.flags.c || cli.flags.cYolo);
|
|
605912
607071
|
var resumeSessionId = isResumeMode ? cli.input[0] : void 0;
|
|
605913
|
-
var mainInk = render_default(
|
|
607072
|
+
var mainInk = render_default(import_react191.default.createElement(Startup, { version: VERSION2, skipWelcome: Boolean(cli.flags.c || cli.flags.yolo || cli.flags.yoloP || cli.flags.cYolo), autoResume: isResumeMode, resumeSessionId, headlessPrompt: typeof cli.flags["ask"] === "string" ? cli.flags["ask"] : void 0, headlessSessionId: isResumeMode ? void 0 : cli.input[0], showTaskList: cli.flags.taskList, isDevMode: cli.flags.dev, enableYolo: cli.flags.yolo || cli.flags.yoloP || cli.flags.cYolo ? true : void 0, enablePlan: cli.flags.yoloP ? true : void 0 }), {
|
|
605914
607073
|
exitOnCtrlC: false,
|
|
605915
607074
|
patchConsole: true
|
|
605916
607075
|
});
|