snow-ai 0.6.13 → 0.6.14
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 +791 -684
- package/bundle/package.json +1 -1
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -1429,7 +1429,7 @@ var require_react_development = __commonJS({
|
|
|
1429
1429
|
var dispatcher = resolveDispatcher();
|
|
1430
1430
|
return dispatcher.useReducer(reducer3, initialArg, init);
|
|
1431
1431
|
}
|
|
1432
|
-
function
|
|
1432
|
+
function useRef16(initialValue) {
|
|
1433
1433
|
var dispatcher = resolveDispatcher();
|
|
1434
1434
|
return dispatcher.useRef(initialValue);
|
|
1435
1435
|
}
|
|
@@ -2223,7 +2223,7 @@ var require_react_development = __commonJS({
|
|
|
2223
2223
|
exports2.useLayoutEffect = useLayoutEffect2;
|
|
2224
2224
|
exports2.useMemo = useMemo31;
|
|
2225
2225
|
exports2.useReducer = useReducer8;
|
|
2226
|
-
exports2.useRef =
|
|
2226
|
+
exports2.useRef = useRef16;
|
|
2227
2227
|
exports2.useState = useState64;
|
|
2228
2228
|
exports2.useSyncExternalStore = useSyncExternalStore;
|
|
2229
2229
|
exports2.useTransition = useTransition;
|
|
@@ -9928,9 +9928,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
9928
9928
|
module2.exports = function $$$reconciler($$$hostConfig) {
|
|
9929
9929
|
var exports3 = {};
|
|
9930
9930
|
"use strict";
|
|
9931
|
-
var
|
|
9931
|
+
var React97 = require_react();
|
|
9932
9932
|
var Scheduler2 = require_scheduler();
|
|
9933
|
-
var ReactSharedInternals =
|
|
9933
|
+
var ReactSharedInternals = React97.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
9934
9934
|
var suppressWarning = false;
|
|
9935
9935
|
function setSuppressWarning(newSuppressWarning) {
|
|
9936
9936
|
{
|
|
@@ -46542,7 +46542,7 @@ var init_help = __esm({
|
|
|
46542
46542
|
execute: () => {
|
|
46543
46543
|
return {
|
|
46544
46544
|
success: true,
|
|
46545
|
-
action: "
|
|
46545
|
+
action: "help"
|
|
46546
46546
|
};
|
|
46547
46547
|
}
|
|
46548
46548
|
});
|
|
@@ -84534,7 +84534,7 @@ var init_themes = __esm({
|
|
|
84534
84534
|
type: "light",
|
|
84535
84535
|
colors: {
|
|
84536
84536
|
background: "#ffffff",
|
|
84537
|
-
text: "#
|
|
84537
|
+
text: "#000000",
|
|
84538
84538
|
border: "#e0e0e0",
|
|
84539
84539
|
diffAdded: "#006400",
|
|
84540
84540
|
diffRemoved: "#8B0000",
|
|
@@ -545690,7 +545690,7 @@ function ChatFooter(props) {
|
|
|
545690
545690
|
!props.showReviewCommitPanel && import_react104.default.createElement(
|
|
545691
545691
|
import_react104.default.Fragment,
|
|
545692
545692
|
null,
|
|
545693
|
-
import_react104.default.createElement(ChatInput, { onSubmit: props.onSubmit, onCommand: props.onCommand, placeholder: t.chatScreen.inputPlaceholder, disabled: props.disabled
|
|
545693
|
+
import_react104.default.createElement(ChatInput, { onSubmit: props.onSubmit, onCommand: props.onCommand, placeholder: t.chatScreen.inputPlaceholder, disabled: props.disabled, disableKeyboardNavigation: props.showBackgroundPanel, isProcessing: props.isProcessing, chatHistory: props.chatHistory, onHistorySelect: props.handleHistorySelect, yoloMode: props.yoloMode, setYoloMode: props.setYoloMode, planMode: props.planMode, setPlanMode: props.setPlanMode, vulnerabilityHuntingMode: props.vulnerabilityHuntingMode, setVulnerabilityHuntingMode: props.setVulnerabilityHuntingMode, contextUsage: props.contextUsage, initialContent: props.initialContent, onContextPercentageChange: props.onContextPercentageChange, showProfilePicker: props.showProfilePicker, setShowProfilePicker: props.setShowProfilePicker, profileSelectedIndex: props.profileSelectedIndex, setProfileSelectedIndex: props.setProfileSelectedIndex, getFilteredProfiles: props.getFilteredProfiles, handleProfileSelect: props.handleProfileSelect, profileSearchQuery: props.profileSearchQuery, setProfileSearchQuery: props.setProfileSearchQuery, onSwitchProfile: props.onSwitchProfile }),
|
|
545694
545694
|
showTodos && todos.length > 0 && import_react104.default.createElement(
|
|
545695
545695
|
Box_default,
|
|
545696
545696
|
{ marginTop: 1 },
|
|
@@ -546729,9 +546729,66 @@ function BashCommandExecutionStatus({ command, timeout: timeout2 = 3e4, terminal
|
|
|
546729
546729
|
const maxCommandWidth = Math.max(40, terminalWidth - 20);
|
|
546730
546730
|
const displayCommand = truncateCommand2(command, maxCommandWidth);
|
|
546731
546731
|
const maxOutputLines = 5;
|
|
546732
|
-
const
|
|
546733
|
-
const
|
|
546734
|
-
const
|
|
546732
|
+
const maxStoredOutputLines = 200;
|
|
546733
|
+
const [displayOutputLines, setDisplayOutputLines] = (0, import_react110.useState)([]);
|
|
546734
|
+
const totalCommittedLineCountRef = (0, import_react110.useRef)(0);
|
|
546735
|
+
const lastSeenInputLineCountRef = (0, import_react110.useRef)(0);
|
|
546736
|
+
const pendingLinesRef = (0, import_react110.useRef)([]);
|
|
546737
|
+
const flushTimerRef = (0, import_react110.useRef)(null);
|
|
546738
|
+
(0, import_react110.useEffect)(() => {
|
|
546739
|
+
lastSeenInputLineCountRef.current = 0;
|
|
546740
|
+
totalCommittedLineCountRef.current = 0;
|
|
546741
|
+
pendingLinesRef.current = [];
|
|
546742
|
+
if (flushTimerRef.current) {
|
|
546743
|
+
clearTimeout(flushTimerRef.current);
|
|
546744
|
+
flushTimerRef.current = null;
|
|
546745
|
+
}
|
|
546746
|
+
setDisplayOutputLines([]);
|
|
546747
|
+
}, [command]);
|
|
546748
|
+
(0, import_react110.useEffect)(() => {
|
|
546749
|
+
const incomingLines = output2.flatMap((line) => line.split(/\r?\n/)).map((line) => sanitizePreviewLine(line)).filter((line) => line.length > 0);
|
|
546750
|
+
const prevCount = lastSeenInputLineCountRef.current;
|
|
546751
|
+
if (incomingLines.length <= prevCount) {
|
|
546752
|
+
return;
|
|
546753
|
+
}
|
|
546754
|
+
const newLines = incomingLines.slice(prevCount);
|
|
546755
|
+
lastSeenInputLineCountRef.current = incomingLines.length;
|
|
546756
|
+
pendingLinesRef.current.push(...newLines);
|
|
546757
|
+
const fullBatchCount = pendingLinesRef.current.length - pendingLinesRef.current.length % 5;
|
|
546758
|
+
if (fullBatchCount > 0) {
|
|
546759
|
+
const toCommit = pendingLinesRef.current.splice(0, fullBatchCount);
|
|
546760
|
+
totalCommittedLineCountRef.current += toCommit.length;
|
|
546761
|
+
setDisplayOutputLines((prev) => {
|
|
546762
|
+
const next = [...prev, ...toCommit];
|
|
546763
|
+
return next.length > maxStoredOutputLines ? next.slice(-maxStoredOutputLines) : next;
|
|
546764
|
+
});
|
|
546765
|
+
}
|
|
546766
|
+
if (flushTimerRef.current) {
|
|
546767
|
+
clearTimeout(flushTimerRef.current);
|
|
546768
|
+
}
|
|
546769
|
+
flushTimerRef.current = setTimeout(() => {
|
|
546770
|
+
flushTimerRef.current = null;
|
|
546771
|
+
if (pendingLinesRef.current.length === 0) {
|
|
546772
|
+
return;
|
|
546773
|
+
}
|
|
546774
|
+
const remainder = pendingLinesRef.current.splice(0, pendingLinesRef.current.length);
|
|
546775
|
+
totalCommittedLineCountRef.current += remainder.length;
|
|
546776
|
+
setDisplayOutputLines((prev) => {
|
|
546777
|
+
const next = [...prev, ...remainder];
|
|
546778
|
+
return next.length > maxStoredOutputLines ? next.slice(-maxStoredOutputLines) : next;
|
|
546779
|
+
});
|
|
546780
|
+
}, 150);
|
|
546781
|
+
}, [output2]);
|
|
546782
|
+
(0, import_react110.useEffect)(() => {
|
|
546783
|
+
return () => {
|
|
546784
|
+
if (flushTimerRef.current) {
|
|
546785
|
+
clearTimeout(flushTimerRef.current);
|
|
546786
|
+
flushTimerRef.current = null;
|
|
546787
|
+
}
|
|
546788
|
+
};
|
|
546789
|
+
}, []);
|
|
546790
|
+
const omittedCount = Math.max(0, totalCommittedLineCountRef.current - maxOutputLines);
|
|
546791
|
+
const visibleOutputLines = omittedCount > 0 ? displayOutputLines.slice(-(maxOutputLines - 1)) : displayOutputLines.slice(-maxOutputLines);
|
|
546735
546792
|
const rawProcessedOutput = omittedCount > 0 ? [...visibleOutputLines, `... (${omittedCount} lines omitted)`] : visibleOutputLines;
|
|
546736
546793
|
const processedOutput = [...rawProcessedOutput];
|
|
546737
546794
|
while (processedOutput.length < maxOutputLines) {
|
|
@@ -550518,317 +550575,97 @@ var init_UsagePanel = __esm({
|
|
|
550518
550575
|
}
|
|
550519
550576
|
});
|
|
550520
550577
|
|
|
550521
|
-
// dist/ui/components/panels/HelpPanel.js
|
|
550522
|
-
var HelpPanel_exports = {};
|
|
550523
|
-
__export(HelpPanel_exports, {
|
|
550524
|
-
default: () => HelpPanel
|
|
550525
|
-
});
|
|
550526
|
-
function HelpPanel() {
|
|
550527
|
-
const pasteKey = getPasteKey();
|
|
550528
|
-
const { t } = useI18n();
|
|
550529
|
-
return import_react126.default.createElement(
|
|
550530
|
-
Box_default,
|
|
550531
|
-
{ flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1 },
|
|
550532
|
-
import_react126.default.createElement(
|
|
550533
|
-
Box_default,
|
|
550534
|
-
{ marginBottom: 1 },
|
|
550535
|
-
import_react126.default.createElement(Text, { bold: true, color: "cyan" }, t.helpPanel.title)
|
|
550536
|
-
),
|
|
550537
|
-
import_react126.default.createElement(
|
|
550538
|
-
Box_default,
|
|
550539
|
-
{ flexDirection: "column", marginBottom: 1 },
|
|
550540
|
-
import_react126.default.createElement(Text, { bold: true, color: "yellow" }, t.helpPanel.textEditingTitle),
|
|
550541
|
-
import_react126.default.createElement(
|
|
550542
|
-
Text,
|
|
550543
|
-
null,
|
|
550544
|
-
" \u2022 ",
|
|
550545
|
-
t.helpPanel.deleteToStart
|
|
550546
|
-
),
|
|
550547
|
-
import_react126.default.createElement(
|
|
550548
|
-
Text,
|
|
550549
|
-
null,
|
|
550550
|
-
" \u2022 ",
|
|
550551
|
-
t.helpPanel.deleteToEnd
|
|
550552
|
-
),
|
|
550553
|
-
import_react126.default.createElement(
|
|
550554
|
-
Text,
|
|
550555
|
-
null,
|
|
550556
|
-
" ",
|
|
550557
|
-
"\u2022 ",
|
|
550558
|
-
t.helpPanel.pasteImages.replace("{pasteKey}", pasteKey)
|
|
550559
|
-
)
|
|
550560
|
-
),
|
|
550561
|
-
import_react126.default.createElement(
|
|
550562
|
-
Box_default,
|
|
550563
|
-
{ flexDirection: "column", marginBottom: 1 },
|
|
550564
|
-
import_react126.default.createElement(Text, { bold: true, color: "cyan" }, t.helpPanel.readlineTitle),
|
|
550565
|
-
import_react126.default.createElement(
|
|
550566
|
-
Text,
|
|
550567
|
-
null,
|
|
550568
|
-
" \u2022 ",
|
|
550569
|
-
t.helpPanel.moveToLineStart
|
|
550570
|
-
),
|
|
550571
|
-
import_react126.default.createElement(
|
|
550572
|
-
Text,
|
|
550573
|
-
null,
|
|
550574
|
-
" \u2022 ",
|
|
550575
|
-
t.helpPanel.moveToLineEnd
|
|
550576
|
-
),
|
|
550577
|
-
import_react126.default.createElement(
|
|
550578
|
-
Text,
|
|
550579
|
-
null,
|
|
550580
|
-
" \u2022 ",
|
|
550581
|
-
t.helpPanel.forwardWord
|
|
550582
|
-
),
|
|
550583
|
-
import_react126.default.createElement(
|
|
550584
|
-
Text,
|
|
550585
|
-
null,
|
|
550586
|
-
" \u2022 ",
|
|
550587
|
-
t.helpPanel.backwardWord
|
|
550588
|
-
),
|
|
550589
|
-
import_react126.default.createElement(
|
|
550590
|
-
Text,
|
|
550591
|
-
null,
|
|
550592
|
-
" \u2022 ",
|
|
550593
|
-
t.helpPanel.deleteToLineEnd
|
|
550594
|
-
),
|
|
550595
|
-
import_react126.default.createElement(
|
|
550596
|
-
Text,
|
|
550597
|
-
null,
|
|
550598
|
-
" \u2022 ",
|
|
550599
|
-
t.helpPanel.deleteToLineStart
|
|
550600
|
-
),
|
|
550601
|
-
import_react126.default.createElement(
|
|
550602
|
-
Text,
|
|
550603
|
-
null,
|
|
550604
|
-
" \u2022 ",
|
|
550605
|
-
t.helpPanel.deleteWord
|
|
550606
|
-
),
|
|
550607
|
-
import_react126.default.createElement(
|
|
550608
|
-
Text,
|
|
550609
|
-
null,
|
|
550610
|
-
" \u2022 ",
|
|
550611
|
-
t.helpPanel.deleteChar
|
|
550612
|
-
)
|
|
550613
|
-
),
|
|
550614
|
-
import_react126.default.createElement(
|
|
550615
|
-
Box_default,
|
|
550616
|
-
{ flexDirection: "column", marginBottom: 1 },
|
|
550617
|
-
import_react126.default.createElement(Text, { bold: true, color: "green" }, t.helpPanel.quickAccessTitle),
|
|
550618
|
-
import_react126.default.createElement(
|
|
550619
|
-
Text,
|
|
550620
|
-
null,
|
|
550621
|
-
" \u2022 ",
|
|
550622
|
-
t.helpPanel.insertFiles
|
|
550623
|
-
),
|
|
550624
|
-
import_react126.default.createElement(
|
|
550625
|
-
Text,
|
|
550626
|
-
null,
|
|
550627
|
-
" \u2022 ",
|
|
550628
|
-
t.helpPanel.searchContent
|
|
550629
|
-
),
|
|
550630
|
-
import_react126.default.createElement(
|
|
550631
|
-
Text,
|
|
550632
|
-
null,
|
|
550633
|
-
" \u2022 ",
|
|
550634
|
-
t.helpPanel.selectAgent
|
|
550635
|
-
),
|
|
550636
|
-
import_react126.default.createElement(
|
|
550637
|
-
Text,
|
|
550638
|
-
null,
|
|
550639
|
-
" \u2022 ",
|
|
550640
|
-
t.helpPanel.showCommands
|
|
550641
|
-
)
|
|
550642
|
-
),
|
|
550643
|
-
import_react126.default.createElement(
|
|
550644
|
-
Box_default,
|
|
550645
|
-
{ flexDirection: "column", marginBottom: 1 },
|
|
550646
|
-
import_react126.default.createElement(Text, { bold: true, color: "yellow" }, t.helpPanel.bashModeTitle),
|
|
550647
|
-
import_react126.default.createElement(
|
|
550648
|
-
Text,
|
|
550649
|
-
null,
|
|
550650
|
-
" \u2022 ",
|
|
550651
|
-
t.helpPanel.bashModeTrigger
|
|
550652
|
-
),
|
|
550653
|
-
import_react126.default.createElement(
|
|
550654
|
-
Text,
|
|
550655
|
-
{ dimColor: true },
|
|
550656
|
-
" ",
|
|
550657
|
-
t.helpPanel.bashModeDesc
|
|
550658
|
-
)
|
|
550659
|
-
),
|
|
550660
|
-
import_react126.default.createElement(
|
|
550661
|
-
Box_default,
|
|
550662
|
-
{ flexDirection: "column", marginBottom: 1 },
|
|
550663
|
-
import_react126.default.createElement(Text, { bold: true, color: "blue" }, t.helpPanel.navigationTitle),
|
|
550664
|
-
import_react126.default.createElement(
|
|
550665
|
-
Text,
|
|
550666
|
-
null,
|
|
550667
|
-
" \u2022 ",
|
|
550668
|
-
t.helpPanel.navigateHistory
|
|
550669
|
-
),
|
|
550670
|
-
import_react126.default.createElement(
|
|
550671
|
-
Text,
|
|
550672
|
-
null,
|
|
550673
|
-
" \u2022 ",
|
|
550674
|
-
t.helpPanel.selectItem
|
|
550675
|
-
),
|
|
550676
|
-
import_react126.default.createElement(
|
|
550677
|
-
Text,
|
|
550678
|
-
null,
|
|
550679
|
-
" \u2022 ",
|
|
550680
|
-
t.helpPanel.cancelClose
|
|
550681
|
-
),
|
|
550682
|
-
import_react126.default.createElement(
|
|
550683
|
-
Text,
|
|
550684
|
-
null,
|
|
550685
|
-
" \u2022 ",
|
|
550686
|
-
t.helpPanel.toggleYolo
|
|
550687
|
-
)
|
|
550688
|
-
),
|
|
550689
|
-
import_react126.default.createElement(
|
|
550690
|
-
Box_default,
|
|
550691
|
-
{ flexDirection: "column" },
|
|
550692
|
-
import_react126.default.createElement(Text, { bold: true, color: "magenta" }, t.helpPanel.tipsTitle),
|
|
550693
|
-
import_react126.default.createElement(
|
|
550694
|
-
Text,
|
|
550695
|
-
null,
|
|
550696
|
-
" \u2022 ",
|
|
550697
|
-
t.helpPanel.tipUseHelp
|
|
550698
|
-
),
|
|
550699
|
-
import_react126.default.createElement(
|
|
550700
|
-
Text,
|
|
550701
|
-
null,
|
|
550702
|
-
" \u2022 ",
|
|
550703
|
-
t.helpPanel.tipShowCommands
|
|
550704
|
-
),
|
|
550705
|
-
import_react126.default.createElement(
|
|
550706
|
-
Text,
|
|
550707
|
-
null,
|
|
550708
|
-
" \u2022 ",
|
|
550709
|
-
t.helpPanel.tipInterrupt
|
|
550710
|
-
)
|
|
550711
|
-
),
|
|
550712
|
-
import_react126.default.createElement(
|
|
550713
|
-
Box_default,
|
|
550714
|
-
{ marginTop: 1 },
|
|
550715
|
-
import_react126.default.createElement(Text, { dimColor: true, color: "gray" }, t.helpPanel.closeHint)
|
|
550716
|
-
)
|
|
550717
|
-
);
|
|
550718
|
-
}
|
|
550719
|
-
var import_react126, getPasteKey;
|
|
550720
|
-
var init_HelpPanel = __esm({
|
|
550721
|
-
async "dist/ui/components/panels/HelpPanel.js"() {
|
|
550722
|
-
"use strict";
|
|
550723
|
-
import_react126 = __toESM(require_react(), 1);
|
|
550724
|
-
await init_build2();
|
|
550725
|
-
init_i18n();
|
|
550726
|
-
getPasteKey = () => {
|
|
550727
|
-
return process.platform === "darwin" ? "Ctrl+V" : "Alt+V";
|
|
550728
|
-
};
|
|
550729
|
-
}
|
|
550730
|
-
});
|
|
550731
|
-
|
|
550732
550578
|
// dist/ui/components/panels/PanelsManager.js
|
|
550733
|
-
function PanelsManager({ terminalWidth, workingDirectory, showSessionPanel, showMcpPanel, showUsagePanel,
|
|
550579
|
+
function PanelsManager({ terminalWidth, workingDirectory, showSessionPanel, showMcpPanel, showUsagePanel, showCustomCommandConfig, showSkillsCreation, showRoleCreation, showRoleDeletion, showRoleList, showWorkingDirPanel, setShowSessionPanel, setShowCustomCommandConfig, setShowSkillsCreation, setShowRoleCreation, setShowRoleDeletion, setShowRoleList, setShowWorkingDirPanel, handleSessionPanelSelect, onCustomCommandSave, onSkillsSave, onRoleSave, onRoleDelete }) {
|
|
550734
550580
|
const { theme: theme14 } = useTheme();
|
|
550735
550581
|
const { t } = useI18n();
|
|
550736
|
-
const loadingFallback =
|
|
550582
|
+
const loadingFallback = import_react126.default.createElement(
|
|
550737
550583
|
Box_default,
|
|
550738
550584
|
null,
|
|
550739
|
-
|
|
550585
|
+
import_react126.default.createElement(
|
|
550740
550586
|
Text,
|
|
550741
550587
|
null,
|
|
550742
|
-
|
|
550588
|
+
import_react126.default.createElement(build_default, { type: "dots" }),
|
|
550743
550589
|
" Loading..."
|
|
550744
550590
|
)
|
|
550745
550591
|
);
|
|
550746
|
-
return
|
|
550747
|
-
|
|
550592
|
+
return import_react126.default.createElement(
|
|
550593
|
+
import_react126.default.Fragment,
|
|
550748
550594
|
null,
|
|
550749
|
-
showSessionPanel &&
|
|
550595
|
+
showSessionPanel && import_react126.default.createElement(
|
|
550750
550596
|
Box_default,
|
|
550751
550597
|
{ paddingX: 1, width: terminalWidth },
|
|
550752
|
-
|
|
550753
|
-
|
|
550598
|
+
import_react126.default.createElement(
|
|
550599
|
+
import_react126.Suspense,
|
|
550754
550600
|
{ fallback: loadingFallback },
|
|
550755
|
-
|
|
550601
|
+
import_react126.default.createElement(SessionListPanel2, { onSelectSession: handleSessionPanelSelect, onClose: () => setShowSessionPanel(false) })
|
|
550756
550602
|
)
|
|
550757
550603
|
),
|
|
550758
|
-
showMcpPanel &&
|
|
550604
|
+
showMcpPanel && import_react126.default.createElement(
|
|
550759
550605
|
Box_default,
|
|
550760
550606
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
550761
|
-
|
|
550762
|
-
|
|
550607
|
+
import_react126.default.createElement(
|
|
550608
|
+
import_react126.Suspense,
|
|
550763
550609
|
{ fallback: loadingFallback },
|
|
550764
|
-
|
|
550610
|
+
import_react126.default.createElement(MCPInfoPanel2, null)
|
|
550765
550611
|
),
|
|
550766
|
-
|
|
550612
|
+
import_react126.default.createElement(
|
|
550767
550613
|
Box_default,
|
|
550768
550614
|
{ marginTop: 1 },
|
|
550769
|
-
|
|
550615
|
+
import_react126.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.pressEscToClose)
|
|
550770
550616
|
)
|
|
550771
550617
|
),
|
|
550772
|
-
showUsagePanel &&
|
|
550618
|
+
showUsagePanel && import_react126.default.createElement(
|
|
550773
550619
|
Box_default,
|
|
550774
550620
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
550775
|
-
|
|
550776
|
-
|
|
550621
|
+
import_react126.default.createElement(
|
|
550622
|
+
import_react126.Suspense,
|
|
550777
550623
|
{ fallback: loadingFallback },
|
|
550778
|
-
|
|
550624
|
+
import_react126.default.createElement(UsagePanel2, null)
|
|
550779
550625
|
),
|
|
550780
|
-
|
|
550626
|
+
import_react126.default.createElement(
|
|
550781
550627
|
Box_default,
|
|
550782
550628
|
{ marginTop: 1 },
|
|
550783
|
-
|
|
550629
|
+
import_react126.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.pressEscToClose)
|
|
550784
550630
|
)
|
|
550785
550631
|
),
|
|
550786
|
-
|
|
550632
|
+
showCustomCommandConfig && import_react126.default.createElement(
|
|
550787
550633
|
Box_default,
|
|
550788
550634
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
550789
|
-
|
|
550790
|
-
import_react127.Suspense,
|
|
550791
|
-
{ fallback: loadingFallback },
|
|
550792
|
-
import_react127.default.createElement(HelpPanel2, null)
|
|
550793
|
-
)
|
|
550635
|
+
import_react126.default.createElement(CustomCommandConfigPanel, { projectRoot: workingDirectory, onSave: onCustomCommandSave, onCancel: () => setShowCustomCommandConfig(false) })
|
|
550794
550636
|
),
|
|
550795
|
-
|
|
550637
|
+
showSkillsCreation && import_react126.default.createElement(
|
|
550796
550638
|
Box_default,
|
|
550797
550639
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
550798
|
-
|
|
550640
|
+
import_react126.default.createElement(SkillsCreationPanel, { projectRoot: workingDirectory, onSave: onSkillsSave, onCancel: () => setShowSkillsCreation(false) })
|
|
550799
550641
|
),
|
|
550800
|
-
|
|
550642
|
+
showRoleCreation && import_react126.default.createElement(
|
|
550801
550643
|
Box_default,
|
|
550802
550644
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
550803
|
-
|
|
550645
|
+
import_react126.default.createElement(RoleCreationPanel, { projectRoot: workingDirectory, onSave: onRoleSave, onCancel: () => setShowRoleCreation(false) })
|
|
550804
550646
|
),
|
|
550805
|
-
|
|
550647
|
+
showRoleDeletion && import_react126.default.createElement(
|
|
550806
550648
|
Box_default,
|
|
550807
550649
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
550808
|
-
|
|
550650
|
+
import_react126.default.createElement(RoleDeletionPanel, { projectRoot: workingDirectory, onDelete: onRoleDelete, onCancel: () => setShowRoleDeletion(false) })
|
|
550809
550651
|
),
|
|
550810
|
-
|
|
550652
|
+
showRoleList && import_react126.default.createElement(
|
|
550811
550653
|
Box_default,
|
|
550812
550654
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
550813
|
-
|
|
550655
|
+
import_react126.default.createElement(RoleListPanel, { projectRoot: workingDirectory, onClose: () => setShowRoleList(false) })
|
|
550814
550656
|
),
|
|
550815
|
-
|
|
550657
|
+
showWorkingDirPanel && import_react126.default.createElement(
|
|
550816
550658
|
Box_default,
|
|
550817
550659
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
550818
|
-
|
|
550819
|
-
),
|
|
550820
|
-
showWorkingDirPanel && import_react127.default.createElement(
|
|
550821
|
-
Box_default,
|
|
550822
|
-
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
550823
|
-
import_react127.default.createElement(WorkingDirectoryPanel, { onClose: () => setShowWorkingDirPanel(false) })
|
|
550660
|
+
import_react126.default.createElement(WorkingDirectoryPanel, { onClose: () => setShowWorkingDirPanel(false) })
|
|
550824
550661
|
)
|
|
550825
550662
|
);
|
|
550826
550663
|
}
|
|
550827
|
-
var
|
|
550664
|
+
var import_react126, MCPInfoPanel2, SessionListPanel2, UsagePanel2;
|
|
550828
550665
|
var init_PanelsManager = __esm({
|
|
550829
550666
|
async "dist/ui/components/panels/PanelsManager.js"() {
|
|
550830
550667
|
"use strict";
|
|
550831
|
-
|
|
550668
|
+
import_react126 = __toESM(require_react(), 1);
|
|
550832
550669
|
await init_build2();
|
|
550833
550670
|
await init_build3();
|
|
550834
550671
|
init_ThemeContext();
|
|
@@ -550839,17 +550676,16 @@ var init_PanelsManager = __esm({
|
|
|
550839
550676
|
await init_RoleDeletionPanel();
|
|
550840
550677
|
await init_RoleListPanel();
|
|
550841
550678
|
await init_WorkingDirectoryPanel();
|
|
550842
|
-
MCPInfoPanel2 = (0,
|
|
550843
|
-
SessionListPanel2 = (0,
|
|
550844
|
-
UsagePanel2 = (0,
|
|
550845
|
-
HelpPanel2 = (0, import_react127.lazy)(() => init_HelpPanel().then(() => HelpPanel_exports));
|
|
550679
|
+
MCPInfoPanel2 = (0, import_react126.lazy)(() => init_MCPInfoPanel().then(() => MCPInfoPanel_exports));
|
|
550680
|
+
SessionListPanel2 = (0, import_react126.lazy)(() => init_SessionListPanel().then(() => SessionListPanel_exports));
|
|
550681
|
+
UsagePanel2 = (0, import_react126.lazy)(() => init_UsagePanel().then(() => UsagePanel_exports));
|
|
550846
550682
|
}
|
|
550847
550683
|
});
|
|
550848
550684
|
|
|
550849
550685
|
// dist/hooks/session/useSessionSave.js
|
|
550850
550686
|
function useSessionSave() {
|
|
550851
|
-
const savedMessagesRef = (0,
|
|
550852
|
-
const generateMessageId = (0,
|
|
550687
|
+
const savedMessagesRef = (0, import_react127.useRef)(/* @__PURE__ */ new Set());
|
|
550688
|
+
const generateMessageId = (0, import_react127.useCallback)((message, timestamp) => {
|
|
550853
550689
|
let id = `${message.role}-${message.content.length}-${Math.floor(timestamp / 5e3)}`;
|
|
550854
550690
|
if (message.role === "assistant" && message.tool_calls && message.tool_calls.length > 0) {
|
|
550855
550691
|
const toolCallIds = message.tool_calls.map((tc) => tc.id).sort().join(",");
|
|
@@ -550860,7 +550696,7 @@ function useSessionSave() {
|
|
|
550860
550696
|
}
|
|
550861
550697
|
return id;
|
|
550862
550698
|
}, []);
|
|
550863
|
-
const saveMessage = (0,
|
|
550699
|
+
const saveMessage = (0, import_react127.useCallback)(async (message) => {
|
|
550864
550700
|
const timestamp = Date.now();
|
|
550865
550701
|
const messageId = generateMessageId(message, timestamp);
|
|
550866
550702
|
if (savedMessagesRef.current.has(messageId)) {
|
|
@@ -550878,15 +550714,15 @@ function useSessionSave() {
|
|
|
550878
550714
|
console.error("Failed to save message:", error);
|
|
550879
550715
|
}
|
|
550880
550716
|
}, [generateMessageId]);
|
|
550881
|
-
const saveMessages = (0,
|
|
550717
|
+
const saveMessages = (0, import_react127.useCallback)(async (messages) => {
|
|
550882
550718
|
for (const message of messages) {
|
|
550883
550719
|
await saveMessage(message);
|
|
550884
550720
|
}
|
|
550885
550721
|
}, [saveMessage]);
|
|
550886
|
-
const clearSavedMessages = (0,
|
|
550722
|
+
const clearSavedMessages = (0, import_react127.useCallback)(() => {
|
|
550887
550723
|
savedMessagesRef.current.clear();
|
|
550888
550724
|
}, []);
|
|
550889
|
-
const initializeFromSession = (0,
|
|
550725
|
+
const initializeFromSession = (0, import_react127.useCallback)((messages) => {
|
|
550890
550726
|
savedMessagesRef.current.clear();
|
|
550891
550727
|
messages.forEach((message) => {
|
|
550892
550728
|
const messageId = generateMessageId(message, message.timestamp);
|
|
@@ -550900,11 +550736,11 @@ function useSessionSave() {
|
|
|
550900
550736
|
initializeFromSession
|
|
550901
550737
|
};
|
|
550902
550738
|
}
|
|
550903
|
-
var
|
|
550739
|
+
var import_react127;
|
|
550904
550740
|
var init_useSessionSave = __esm({
|
|
550905
550741
|
"dist/hooks/session/useSessionSave.js"() {
|
|
550906
550742
|
"use strict";
|
|
550907
|
-
|
|
550743
|
+
import_react127 = __toESM(require_react(), 1);
|
|
550908
550744
|
init_sessionManager();
|
|
550909
550745
|
}
|
|
550910
550746
|
});
|
|
@@ -550997,10 +550833,10 @@ var init_permissionsConfig = __esm({
|
|
|
550997
550833
|
|
|
550998
550834
|
// dist/hooks/conversation/useToolConfirmation.js
|
|
550999
550835
|
function useToolConfirmation(workingDirectory) {
|
|
551000
|
-
const [pendingToolConfirmation, setPendingToolConfirmation] = (0,
|
|
551001
|
-
const alwaysApprovedToolsRef = (0,
|
|
551002
|
-
const [alwaysApprovedTools, setAlwaysApprovedTools] = (0,
|
|
551003
|
-
(0,
|
|
550836
|
+
const [pendingToolConfirmation, setPendingToolConfirmation] = (0, import_react128.useState)(null);
|
|
550837
|
+
const alwaysApprovedToolsRef = (0, import_react128.useRef)(/* @__PURE__ */ new Set());
|
|
550838
|
+
const [alwaysApprovedTools, setAlwaysApprovedTools] = (0, import_react128.useState)(/* @__PURE__ */ new Set());
|
|
550839
|
+
(0, import_react128.useEffect)(() => {
|
|
551004
550840
|
const config3 = loadPermissionsConfig(workingDirectory);
|
|
551005
550841
|
const loadedTools = new Set(config3.alwaysApprovedTools);
|
|
551006
550842
|
alwaysApprovedToolsRef.current = loadedTools;
|
|
@@ -551019,20 +550855,20 @@ function useToolConfirmation(workingDirectory) {
|
|
|
551019
550855
|
});
|
|
551020
550856
|
});
|
|
551021
550857
|
};
|
|
551022
|
-
const isToolAutoApproved = (0,
|
|
550858
|
+
const isToolAutoApproved = (0, import_react128.useCallback)((toolName) => {
|
|
551023
550859
|
return alwaysApprovedToolsRef.current.has(toolName) || toolName.startsWith("todo-") || toolName.startsWith("subagent-") || toolName === "askuser-ask_question";
|
|
551024
550860
|
}, []);
|
|
551025
|
-
const addToAlwaysApproved = (0,
|
|
550861
|
+
const addToAlwaysApproved = (0, import_react128.useCallback)((toolName) => {
|
|
551026
550862
|
alwaysApprovedToolsRef.current.add(toolName);
|
|
551027
550863
|
setAlwaysApprovedTools((prev) => /* @__PURE__ */ new Set([...prev, toolName]));
|
|
551028
550864
|
addToolToPermissions(workingDirectory, toolName);
|
|
551029
550865
|
}, [workingDirectory]);
|
|
551030
|
-
const addMultipleToAlwaysApproved = (0,
|
|
550866
|
+
const addMultipleToAlwaysApproved = (0, import_react128.useCallback)((toolNames) => {
|
|
551031
550867
|
toolNames.forEach((name) => alwaysApprovedToolsRef.current.add(name));
|
|
551032
550868
|
setAlwaysApprovedTools((prev) => /* @__PURE__ */ new Set([...prev, ...toolNames]));
|
|
551033
550869
|
addMultipleToolsToPermissions(workingDirectory, toolNames);
|
|
551034
550870
|
}, [workingDirectory]);
|
|
551035
|
-
const removeFromAlwaysApproved = (0,
|
|
550871
|
+
const removeFromAlwaysApproved = (0, import_react128.useCallback)((toolName) => {
|
|
551036
550872
|
alwaysApprovedToolsRef.current.delete(toolName);
|
|
551037
550873
|
setAlwaysApprovedTools((prev) => {
|
|
551038
550874
|
const next = new Set(prev);
|
|
@@ -551041,7 +550877,7 @@ function useToolConfirmation(workingDirectory) {
|
|
|
551041
550877
|
});
|
|
551042
550878
|
removeToolFromPermissions(workingDirectory, toolName);
|
|
551043
550879
|
}, [workingDirectory]);
|
|
551044
|
-
const clearAllAlwaysApproved = (0,
|
|
550880
|
+
const clearAllAlwaysApproved = (0, import_react128.useCallback)(() => {
|
|
551045
550881
|
alwaysApprovedToolsRef.current.clear();
|
|
551046
550882
|
setAlwaysApprovedTools(/* @__PURE__ */ new Set());
|
|
551047
550883
|
clearAllPermissions(workingDirectory);
|
|
@@ -551057,11 +550893,11 @@ function useToolConfirmation(workingDirectory) {
|
|
|
551057
550893
|
clearAllAlwaysApproved
|
|
551058
550894
|
};
|
|
551059
550895
|
}
|
|
551060
|
-
var
|
|
550896
|
+
var import_react128;
|
|
551061
550897
|
var init_useToolConfirmation = __esm({
|
|
551062
550898
|
"dist/hooks/conversation/useToolConfirmation.js"() {
|
|
551063
550899
|
"use strict";
|
|
551064
|
-
|
|
550900
|
+
import_react128 = __toESM(require_react(), 1);
|
|
551065
550901
|
init_permissionsConfig();
|
|
551066
550902
|
}
|
|
551067
550903
|
});
|
|
@@ -552223,7 +552059,7 @@ ${msg.content}`;
|
|
|
552223
552059
|
}
|
|
552224
552060
|
function useCommandHandler(options3) {
|
|
552225
552061
|
const { stdout } = use_stdout_default();
|
|
552226
|
-
const handleCommandExecution = (0,
|
|
552062
|
+
const handleCommandExecution = (0, import_react129.useCallback)(async (commandName, result2) => {
|
|
552227
552063
|
if (commandName === "compact" && result2.success && result2.action === "compact") {
|
|
552228
552064
|
options3.setIsCompressing(true);
|
|
552229
552065
|
options3.setCompressionError(null);
|
|
@@ -552314,6 +552150,7 @@ Output: ${combinedOutput}`;
|
|
|
552314
552150
|
options3.setRemountKey((prev) => prev + 1);
|
|
552315
552151
|
options3.setContextUsage(null);
|
|
552316
552152
|
options3.setCurrentContextPercentage(0);
|
|
552153
|
+
options3.currentContextPercentageRef.current = 0;
|
|
552317
552154
|
const commandMessage = {
|
|
552318
552155
|
role: "command",
|
|
552319
552156
|
content: "",
|
|
@@ -552332,6 +552169,7 @@ Output: ${combinedOutput}`;
|
|
|
552332
552169
|
options3.setRemountKey((prev) => prev + 1);
|
|
552333
552170
|
options3.setContextUsage(null);
|
|
552334
552171
|
options3.setCurrentContextPercentage(0);
|
|
552172
|
+
options3.currentContextPercentageRef.current = 0;
|
|
552335
552173
|
const commandMessage = {
|
|
552336
552174
|
role: "command",
|
|
552337
552175
|
content: "",
|
|
@@ -552387,14 +552225,8 @@ Output: ${combinedOutput}`;
|
|
|
552387
552225
|
commandName
|
|
552388
552226
|
};
|
|
552389
552227
|
options3.setMessages((prev) => [...prev, commandMessage]);
|
|
552390
|
-
} else if (result2.success && result2.action === "
|
|
552391
|
-
|
|
552392
|
-
const commandMessage = {
|
|
552393
|
-
role: "command",
|
|
552394
|
-
content: "",
|
|
552395
|
-
commandName
|
|
552396
|
-
};
|
|
552397
|
-
options3.setMessages((prev) => [...prev, commandMessage]);
|
|
552228
|
+
} else if (result2.success && result2.action === "help") {
|
|
552229
|
+
navigateTo("help");
|
|
552398
552230
|
} else if (result2.success && result2.action === "showCustomCommandConfig") {
|
|
552399
552231
|
options3.setShowCustomCommandConfig(true);
|
|
552400
552232
|
const commandMessage = {
|
|
@@ -552648,12 +552480,12 @@ ${filePath}`,
|
|
|
552648
552480
|
}, [stdout, options3]);
|
|
552649
552481
|
return { handleCommandExecution };
|
|
552650
552482
|
}
|
|
552651
|
-
var
|
|
552483
|
+
var import_react129;
|
|
552652
552484
|
var init_useCommandHandler = __esm({
|
|
552653
552485
|
async "dist/hooks/conversation/useCommandHandler.js"() {
|
|
552654
552486
|
"use strict";
|
|
552655
552487
|
await init_build2();
|
|
552656
|
-
|
|
552488
|
+
import_react129 = __toESM(require_react(), 1);
|
|
552657
552489
|
init_sessionManager();
|
|
552658
552490
|
init_contextCompressor();
|
|
552659
552491
|
init_mcpToolsManager();
|
|
@@ -557400,9 +557232,9 @@ var init_hookResultHandler = __esm({
|
|
|
557400
557232
|
function useChatLogic(props) {
|
|
557401
557233
|
const { t } = useI18n();
|
|
557402
557234
|
const { messages, setMessages, pendingMessages, setPendingMessages, streamingState, vscodeState, snapshotState, bashMode, yoloMode, planMode, vulnerabilityHuntingMode, saveMessage, clearSavedMessages, setRemountKey, requestToolConfirmation, requestUserQuestion, isToolAutoApproved, addMultipleToAlwaysApproved, setRestoreInputContent, setIsCompressing, setCompressionError, currentContextPercentageRef, userInterruptedRef, pendingMessagesRef, setBashSensitiveCommand, pendingUserQuestion, setPendingUserQuestion, initializeFromSession, setShowSessionPanel, setShowReviewCommitPanel, exitApp, codebaseAgentRef, setCodebaseIndexing, setCodebaseProgress, setFileUpdateNotification, setWatcherEnabled, exitingApplicationText } = props;
|
|
557403
|
-
const processMessageRef = (0,
|
|
557235
|
+
const processMessageRef = (0, import_react130.useRef)();
|
|
557404
557236
|
const handleMessageSubmit = async (message, images) => {
|
|
557405
|
-
if (streamingState.
|
|
557237
|
+
if (streamingState.streamStatus !== "idle") {
|
|
557406
557238
|
setPendingMessages((prev) => [...prev, { text: message, images }]);
|
|
557407
557239
|
return;
|
|
557408
557240
|
}
|
|
@@ -558276,11 +558108,11 @@ Please provide your review in a clear, structured format.`;
|
|
|
558276
558108
|
rollbackViaSSE
|
|
558277
558109
|
};
|
|
558278
558110
|
}
|
|
558279
|
-
var
|
|
558111
|
+
var import_react130;
|
|
558280
558112
|
var init_useChatLogic = __esm({
|
|
558281
558113
|
async "dist/hooks/conversation/useChatLogic.js"() {
|
|
558282
558114
|
"use strict";
|
|
558283
|
-
|
|
558115
|
+
import_react130 = __toESM(require_react(), 1);
|
|
558284
558116
|
init_i18n();
|
|
558285
558117
|
init_reviewAgent();
|
|
558286
558118
|
init_sessionManager();
|
|
@@ -558297,12 +558129,12 @@ var init_useChatLogic = __esm({
|
|
|
558297
558129
|
|
|
558298
558130
|
// dist/hooks/integration/useVSCodeState.js
|
|
558299
558131
|
function useVSCodeState() {
|
|
558300
|
-
const [vscodeConnected, setVscodeConnected] = (0,
|
|
558301
|
-
const [vscodeConnectionStatus, setVscodeConnectionStatus] = (0,
|
|
558302
|
-
const [editorContext, setEditorContext] = (0,
|
|
558303
|
-
const lastStatusRef = (0,
|
|
558304
|
-
const lastEditorContextRef = (0,
|
|
558305
|
-
(0,
|
|
558132
|
+
const [vscodeConnected, setVscodeConnected] = (0, import_react131.useState)(false);
|
|
558133
|
+
const [vscodeConnectionStatus, setVscodeConnectionStatus] = (0, import_react131.useState)("disconnected");
|
|
558134
|
+
const [editorContext, setEditorContext] = (0, import_react131.useState)({});
|
|
558135
|
+
const lastStatusRef = (0, import_react131.useRef)("disconnected");
|
|
558136
|
+
const lastEditorContextRef = (0, import_react131.useRef)({});
|
|
558137
|
+
(0, import_react131.useEffect)(() => {
|
|
558306
558138
|
const checkConnectionInterval = setInterval(() => {
|
|
558307
558139
|
const isConnected = vscodeConnection.isConnected();
|
|
558308
558140
|
setVscodeConnected(isConnected);
|
|
@@ -558331,7 +558163,7 @@ function useVSCodeState() {
|
|
|
558331
558163
|
unsubscribe();
|
|
558332
558164
|
};
|
|
558333
558165
|
}, []);
|
|
558334
|
-
(0,
|
|
558166
|
+
(0, import_react131.useEffect)(() => {
|
|
558335
558167
|
if (vscodeConnectionStatus !== "connecting") {
|
|
558336
558168
|
return;
|
|
558337
558169
|
}
|
|
@@ -558358,20 +558190,20 @@ function useVSCodeState() {
|
|
|
558358
558190
|
editorContext
|
|
558359
558191
|
};
|
|
558360
558192
|
}
|
|
558361
|
-
var
|
|
558193
|
+
var import_react131;
|
|
558362
558194
|
var init_useVSCodeState = __esm({
|
|
558363
558195
|
"dist/hooks/integration/useVSCodeState.js"() {
|
|
558364
558196
|
"use strict";
|
|
558365
|
-
|
|
558197
|
+
import_react131 = __toESM(require_react(), 1);
|
|
558366
558198
|
init_vscodeConnection();
|
|
558367
558199
|
}
|
|
558368
558200
|
});
|
|
558369
558201
|
|
|
558370
558202
|
// dist/hooks/session/useSnapshotState.js
|
|
558371
558203
|
function useSnapshotState(messagesLength) {
|
|
558372
|
-
const [snapshotFileCount, setSnapshotFileCount] = (0,
|
|
558373
|
-
const [pendingRollback, setPendingRollback] = (0,
|
|
558374
|
-
(0,
|
|
558204
|
+
const [snapshotFileCount, setSnapshotFileCount] = (0, import_react132.useState)(/* @__PURE__ */ new Map());
|
|
558205
|
+
const [pendingRollback, setPendingRollback] = (0, import_react132.useState)(null);
|
|
558206
|
+
(0, import_react132.useEffect)(() => {
|
|
558375
558207
|
const loadSnapshotFileCounts = async () => {
|
|
558376
558208
|
const currentSession = sessionManager.getCurrentSession();
|
|
558377
558209
|
if (!currentSession)
|
|
@@ -558392,11 +558224,11 @@ function useSnapshotState(messagesLength) {
|
|
|
558392
558224
|
setPendingRollback
|
|
558393
558225
|
};
|
|
558394
558226
|
}
|
|
558395
|
-
var
|
|
558227
|
+
var import_react132;
|
|
558396
558228
|
var init_useSnapshotState = __esm({
|
|
558397
558229
|
"dist/hooks/session/useSnapshotState.js"() {
|
|
558398
558230
|
"use strict";
|
|
558399
|
-
|
|
558231
|
+
import_react132 = __toESM(require_react(), 1);
|
|
558400
558232
|
init_sessionManager();
|
|
558401
558233
|
init_hashBasedSnapshot();
|
|
558402
558234
|
}
|
|
@@ -558404,19 +558236,40 @@ var init_useSnapshotState = __esm({
|
|
|
558404
558236
|
|
|
558405
558237
|
// dist/hooks/conversation/useStreamingState.js
|
|
558406
558238
|
function useStreamingState() {
|
|
558407
|
-
const [
|
|
558408
|
-
const
|
|
558409
|
-
const
|
|
558410
|
-
const
|
|
558411
|
-
|
|
558412
|
-
|
|
558413
|
-
|
|
558414
|
-
|
|
558415
|
-
|
|
558416
|
-
|
|
558417
|
-
|
|
558418
|
-
|
|
558419
|
-
|
|
558239
|
+
const [streamStatus, setStreamStatus] = (0, import_react133.useState)("idle");
|
|
558240
|
+
const isStreaming = streamStatus === "streaming";
|
|
558241
|
+
const isStopping = streamStatus === "stopping";
|
|
558242
|
+
const setIsStreaming = (action) => {
|
|
558243
|
+
setStreamStatus((prev) => {
|
|
558244
|
+
const currentIsStreaming = prev === "streaming";
|
|
558245
|
+
const nextIsStreaming = typeof action === "function" ? action(currentIsStreaming) : action;
|
|
558246
|
+
if (nextIsStreaming)
|
|
558247
|
+
return "streaming";
|
|
558248
|
+
return "idle";
|
|
558249
|
+
});
|
|
558250
|
+
};
|
|
558251
|
+
const setIsStopping = (action) => {
|
|
558252
|
+
setStreamStatus((prev) => {
|
|
558253
|
+
const currentIsStopping = prev === "stopping";
|
|
558254
|
+
const nextIsStopping = typeof action === "function" ? action(currentIsStopping) : action;
|
|
558255
|
+
if (nextIsStopping)
|
|
558256
|
+
return "stopping";
|
|
558257
|
+
if (prev === "stopping")
|
|
558258
|
+
return "idle";
|
|
558259
|
+
return prev;
|
|
558260
|
+
});
|
|
558261
|
+
};
|
|
558262
|
+
const [streamTokenCount, setStreamTokenCount] = (0, import_react133.useState)(0);
|
|
558263
|
+
const [isReasoning, setIsReasoning] = (0, import_react133.useState)(false);
|
|
558264
|
+
const [abortController, setAbortController] = (0, import_react133.useState)(null);
|
|
558265
|
+
const [contextUsage, setContextUsage] = (0, import_react133.useState)(null);
|
|
558266
|
+
const [elapsedSeconds, setElapsedSeconds] = (0, import_react133.useState)(0);
|
|
558267
|
+
const [timerStartTime, setTimerStartTime] = (0, import_react133.useState)(null);
|
|
558268
|
+
const [retryStatus, setRetryStatus] = (0, import_react133.useState)(null);
|
|
558269
|
+
const [animationFrame, setAnimationFrame] = (0, import_react133.useState)(0);
|
|
558270
|
+
const [codebaseSearchStatus, setCodebaseSearchStatus] = (0, import_react133.useState)(null);
|
|
558271
|
+
const [currentModel, setCurrentModel] = (0, import_react133.useState)(null);
|
|
558272
|
+
(0, import_react133.useEffect)(() => {
|
|
558420
558273
|
if (!isStreaming)
|
|
558421
558274
|
return;
|
|
558422
558275
|
const interval = setInterval(() => {
|
|
@@ -558427,7 +558280,7 @@ function useStreamingState() {
|
|
|
558427
558280
|
setAnimationFrame(0);
|
|
558428
558281
|
};
|
|
558429
558282
|
}, [isStreaming]);
|
|
558430
|
-
(0,
|
|
558283
|
+
(0, import_react133.useEffect)(() => {
|
|
558431
558284
|
if (isStreaming && timerStartTime === null) {
|
|
558432
558285
|
setTimerStartTime(Date.now());
|
|
558433
558286
|
setElapsedSeconds(0);
|
|
@@ -558435,7 +558288,7 @@ function useStreamingState() {
|
|
|
558435
558288
|
setTimerStartTime(null);
|
|
558436
558289
|
}
|
|
558437
558290
|
}, [isStreaming, timerStartTime]);
|
|
558438
|
-
(0,
|
|
558291
|
+
(0, import_react133.useEffect)(() => {
|
|
558439
558292
|
if (timerStartTime === null)
|
|
558440
558293
|
return;
|
|
558441
558294
|
const interval = setInterval(() => {
|
|
@@ -558444,7 +558297,7 @@ function useStreamingState() {
|
|
|
558444
558297
|
}, 1e3);
|
|
558445
558298
|
return () => clearInterval(interval);
|
|
558446
558299
|
}, [timerStartTime]);
|
|
558447
|
-
(0,
|
|
558300
|
+
(0, import_react133.useEffect)(() => {
|
|
558448
558301
|
if (!(retryStatus == null ? void 0 : retryStatus.isRetrying))
|
|
558449
558302
|
return;
|
|
558450
558303
|
if (retryStatus.remainingSeconds !== void 0)
|
|
@@ -558454,7 +558307,7 @@ function useStreamingState() {
|
|
|
558454
558307
|
remainingSeconds: Math.ceil(prev.nextDelay / 1e3)
|
|
558455
558308
|
} : null);
|
|
558456
558309
|
}, [retryStatus == null ? void 0 : retryStatus.isRetrying]);
|
|
558457
|
-
(0,
|
|
558310
|
+
(0, import_react133.useEffect)(() => {
|
|
558458
558311
|
if (!retryStatus || !retryStatus.isRetrying)
|
|
558459
558312
|
return;
|
|
558460
558313
|
if (retryStatus.remainingSeconds === void 0)
|
|
@@ -558479,6 +558332,8 @@ function useStreamingState() {
|
|
|
558479
558332
|
return () => clearInterval(interval);
|
|
558480
558333
|
}, [retryStatus == null ? void 0 : retryStatus.isRetrying]);
|
|
558481
558334
|
return {
|
|
558335
|
+
streamStatus,
|
|
558336
|
+
setStreamStatus,
|
|
558482
558337
|
isStreaming,
|
|
558483
558338
|
setIsStreaming,
|
|
558484
558339
|
isStopping,
|
|
@@ -558501,38 +558356,37 @@ function useStreamingState() {
|
|
|
558501
558356
|
setCurrentModel
|
|
558502
558357
|
};
|
|
558503
558358
|
}
|
|
558504
|
-
var
|
|
558359
|
+
var import_react133;
|
|
558505
558360
|
var init_useStreamingState = __esm({
|
|
558506
558361
|
"dist/hooks/conversation/useStreamingState.js"() {
|
|
558507
558362
|
"use strict";
|
|
558508
|
-
|
|
558363
|
+
import_react133 = __toESM(require_react(), 1);
|
|
558509
558364
|
}
|
|
558510
558365
|
});
|
|
558511
558366
|
|
|
558512
558367
|
// dist/hooks/ui/usePanelState.js
|
|
558513
558368
|
function usePanelState() {
|
|
558514
|
-
const [showSessionPanel, setShowSessionPanel] = (0,
|
|
558515
|
-
const [showMcpPanel, setShowMcpPanel] = (0,
|
|
558516
|
-
const [showUsagePanel, setShowUsagePanel] = (0,
|
|
558517
|
-
const [
|
|
558518
|
-
const [
|
|
558519
|
-
const [
|
|
558520
|
-
const [
|
|
558521
|
-
const [
|
|
558522
|
-
const [
|
|
558523
|
-
const [
|
|
558524
|
-
const [
|
|
558525
|
-
const [
|
|
558526
|
-
const [
|
|
558527
|
-
const [
|
|
558528
|
-
const [currentProfileName, setCurrentProfileName] = (0, import_react135.useState)(() => {
|
|
558369
|
+
const [showSessionPanel, setShowSessionPanel] = (0, import_react134.useState)(false);
|
|
558370
|
+
const [showMcpPanel, setShowMcpPanel] = (0, import_react134.useState)(false);
|
|
558371
|
+
const [showUsagePanel, setShowUsagePanel] = (0, import_react134.useState)(false);
|
|
558372
|
+
const [showCustomCommandConfig, setShowCustomCommandConfig] = (0, import_react134.useState)(false);
|
|
558373
|
+
const [showSkillsCreation, setShowSkillsCreation] = (0, import_react134.useState)(false);
|
|
558374
|
+
const [showRoleCreation, setShowRoleCreation] = (0, import_react134.useState)(false);
|
|
558375
|
+
const [showRoleDeletion, setShowRoleDeletion] = (0, import_react134.useState)(false);
|
|
558376
|
+
const [showRoleList, setShowRoleList] = (0, import_react134.useState)(false);
|
|
558377
|
+
const [showWorkingDirPanel, setShowWorkingDirPanel] = (0, import_react134.useState)(false);
|
|
558378
|
+
const [showReviewCommitPanel, setShowReviewCommitPanel] = (0, import_react134.useState)(false);
|
|
558379
|
+
const [showProfilePanel, setShowProfilePanel] = (0, import_react134.useState)(false);
|
|
558380
|
+
const [profileSelectedIndex, setProfileSelectedIndex] = (0, import_react134.useState)(0);
|
|
558381
|
+
const [profileSearchQuery, setProfileSearchQuery] = (0, import_react134.useState)("");
|
|
558382
|
+
const [currentProfileName, setCurrentProfileName] = (0, import_react134.useState)(() => {
|
|
558529
558383
|
const profiles = getAllProfiles();
|
|
558530
558384
|
const activeName = getActiveProfileName();
|
|
558531
558385
|
const profile = profiles.find((p) => p.name === activeName);
|
|
558532
558386
|
return (profile == null ? void 0 : profile.displayName) || activeName;
|
|
558533
558387
|
});
|
|
558534
558388
|
const handleSwitchProfile = (options3) => {
|
|
558535
|
-
if (showSessionPanel || showMcpPanel || showUsagePanel ||
|
|
558389
|
+
if (showSessionPanel || showMcpPanel || showUsagePanel || showCustomCommandConfig || showSkillsCreation || showRoleCreation || showRoleDeletion || showRoleList || showReviewCommitPanel || showProfilePanel || options3.hasPendingRollback || options3.hasPendingToolConfirmation || options3.hasPendingUserQuestion || options3.isStreaming) {
|
|
558536
558390
|
return;
|
|
558537
558391
|
}
|
|
558538
558392
|
setShowProfilePanel(true);
|
|
@@ -558561,10 +558415,6 @@ function usePanelState() {
|
|
|
558561
558415
|
setShowUsagePanel(false);
|
|
558562
558416
|
return true;
|
|
558563
558417
|
}
|
|
558564
|
-
if (showHelpPanel) {
|
|
558565
|
-
setShowHelpPanel(false);
|
|
558566
|
-
return true;
|
|
558567
|
-
}
|
|
558568
558418
|
if (showCustomCommandConfig) {
|
|
558569
558419
|
setShowCustomCommandConfig(false);
|
|
558570
558420
|
return true;
|
|
@@ -558600,14 +558450,13 @@ function usePanelState() {
|
|
|
558600
558450
|
return false;
|
|
558601
558451
|
};
|
|
558602
558452
|
const isAnyPanelOpen = () => {
|
|
558603
|
-
return showSessionPanel || showMcpPanel || showUsagePanel ||
|
|
558453
|
+
return showSessionPanel || showMcpPanel || showUsagePanel || showCustomCommandConfig || showSkillsCreation || showRoleCreation || showRoleDeletion || showRoleList || showWorkingDirPanel || showReviewCommitPanel || showProfilePanel;
|
|
558604
558454
|
};
|
|
558605
558455
|
return {
|
|
558606
558456
|
// State
|
|
558607
558457
|
showSessionPanel,
|
|
558608
558458
|
showMcpPanel,
|
|
558609
558459
|
showUsagePanel,
|
|
558610
|
-
showHelpPanel,
|
|
558611
558460
|
showCustomCommandConfig,
|
|
558612
558461
|
showSkillsCreation,
|
|
558613
558462
|
showRoleCreation,
|
|
@@ -558623,7 +558472,6 @@ function usePanelState() {
|
|
|
558623
558472
|
setShowSessionPanel,
|
|
558624
558473
|
setShowMcpPanel,
|
|
558625
558474
|
setShowUsagePanel,
|
|
558626
|
-
setShowHelpPanel,
|
|
558627
558475
|
setShowCustomCommandConfig,
|
|
558628
558476
|
setShowSkillsCreation,
|
|
558629
558477
|
setShowRoleCreation,
|
|
@@ -558640,11 +558488,11 @@ function usePanelState() {
|
|
|
558640
558488
|
isAnyPanelOpen
|
|
558641
558489
|
};
|
|
558642
558490
|
}
|
|
558643
|
-
var
|
|
558491
|
+
var import_react134;
|
|
558644
558492
|
var init_usePanelState = __esm({
|
|
558645
558493
|
"dist/hooks/ui/usePanelState.js"() {
|
|
558646
558494
|
"use strict";
|
|
558647
|
-
|
|
558495
|
+
import_react134 = __toESM(require_react(), 1);
|
|
558648
558496
|
init_apiConfig();
|
|
558649
558497
|
init_configManager();
|
|
558650
558498
|
}
|
|
@@ -558659,14 +558507,14 @@ function PermissionsPanel({ alwaysApprovedTools, onRemoveTool, onClearAll, onClo
|
|
|
558659
558507
|
const { t } = useI18n();
|
|
558660
558508
|
const { theme: theme14 } = useTheme();
|
|
558661
558509
|
const messages = t.permissionsPanel ?? {};
|
|
558662
|
-
const tools = (0,
|
|
558663
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
558664
|
-
const [confirmTarget, setConfirmTarget] = (0,
|
|
558665
|
-
const [confirmOption, setConfirmOption] = (0,
|
|
558510
|
+
const tools = (0, import_react135.useMemo)(() => Array.from(alwaysApprovedTools).sort((a, b) => a.localeCompare(b)), [alwaysApprovedTools]);
|
|
558511
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react135.useState)(0);
|
|
558512
|
+
const [confirmTarget, setConfirmTarget] = (0, import_react135.useState)(null);
|
|
558513
|
+
const [confirmOption, setConfirmOption] = (0, import_react135.useState)(0);
|
|
558666
558514
|
const hasTools = tools.length > 0;
|
|
558667
558515
|
const clearAllIndex = hasTools ? tools.length : -1;
|
|
558668
558516
|
const optionCount = hasTools ? tools.length + 1 : 0;
|
|
558669
|
-
(0,
|
|
558517
|
+
(0, import_react135.useEffect)(() => {
|
|
558670
558518
|
if (optionCount === 0) {
|
|
558671
558519
|
setSelectedIndex(0);
|
|
558672
558520
|
return;
|
|
@@ -558675,11 +558523,11 @@ function PermissionsPanel({ alwaysApprovedTools, onRemoveTool, onClearAll, onClo
|
|
|
558675
558523
|
setSelectedIndex(optionCount - 1);
|
|
558676
558524
|
}
|
|
558677
558525
|
}, [optionCount, selectedIndex]);
|
|
558678
|
-
(0,
|
|
558526
|
+
(0, import_react135.useEffect)(() => {
|
|
558679
558527
|
setConfirmTarget(null);
|
|
558680
558528
|
setConfirmOption(0);
|
|
558681
558529
|
}, [alwaysApprovedTools]);
|
|
558682
|
-
const handleInput = (0,
|
|
558530
|
+
const handleInput = (0, import_react135.useCallback)((_3, key) => {
|
|
558683
558531
|
if (confirmTarget !== null) {
|
|
558684
558532
|
if (key.escape) {
|
|
558685
558533
|
setConfirmTarget(null);
|
|
@@ -558758,30 +558606,30 @@ function PermissionsPanel({ alwaysApprovedTools, onRemoveTool, onClearAll, onClo
|
|
|
558758
558606
|
if (confirmTarget !== null) {
|
|
558759
558607
|
const isConfirmingClearAll = confirmTarget === "clearAll";
|
|
558760
558608
|
const toolName = getConfirmingToolName();
|
|
558761
|
-
return
|
|
558609
|
+
return import_react135.default.createElement(
|
|
558762
558610
|
Box_default,
|
|
558763
558611
|
{ flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1 },
|
|
558764
|
-
|
|
558765
|
-
!isConfirmingClearAll && toolName &&
|
|
558612
|
+
import_react135.default.createElement(Text, { color: "red", bold: true }, isConfirmingClearAll ? messages.confirmClearAll ?? "Clear all permissions?" : messages.confirmDelete ?? "Delete allowed tool?"),
|
|
558613
|
+
!isConfirmingClearAll && toolName && import_react135.default.createElement(
|
|
558766
558614
|
Box_default,
|
|
558767
558615
|
{ marginTop: 1, flexDirection: "column" },
|
|
558768
|
-
|
|
558616
|
+
import_react135.default.createElement(
|
|
558769
558617
|
Text,
|
|
558770
558618
|
{ color: "white", bold: true },
|
|
558771
558619
|
" ",
|
|
558772
558620
|
toolName
|
|
558773
558621
|
)
|
|
558774
558622
|
),
|
|
558775
|
-
|
|
558623
|
+
import_react135.default.createElement(
|
|
558776
558624
|
Box_default,
|
|
558777
558625
|
{ marginTop: 1, flexDirection: "column" },
|
|
558778
|
-
|
|
558626
|
+
import_react135.default.createElement(
|
|
558779
558627
|
Text,
|
|
558780
558628
|
{ color: confirmOption === 0 ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: confirmOption === 0 },
|
|
558781
558629
|
confirmOption === 0 ? "\u276F " : " ",
|
|
558782
558630
|
messages.yes ?? "Yes"
|
|
558783
558631
|
),
|
|
558784
|
-
|
|
558632
|
+
import_react135.default.createElement(
|
|
558785
558633
|
Text,
|
|
558786
558634
|
{ color: confirmOption === 1 ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: confirmOption === 1 },
|
|
558787
558635
|
confirmOption === 1 ? "\u276F " : " ",
|
|
@@ -558790,49 +558638,49 @@ function PermissionsPanel({ alwaysApprovedTools, onRemoveTool, onClearAll, onClo
|
|
|
558790
558638
|
)
|
|
558791
558639
|
);
|
|
558792
558640
|
}
|
|
558793
|
-
return
|
|
558641
|
+
return import_react135.default.createElement(
|
|
558794
558642
|
Box_default,
|
|
558795
558643
|
{ flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1 },
|
|
558796
|
-
|
|
558797
|
-
hasTools ?
|
|
558644
|
+
import_react135.default.createElement(Text, { color: "cyan", bold: true }, messages.title ?? "Permissions"),
|
|
558645
|
+
hasTools ? import_react135.default.createElement(
|
|
558798
558646
|
Box_default,
|
|
558799
558647
|
{ flexDirection: "column", marginTop: 1 },
|
|
558800
558648
|
tools.map((tool, index) => {
|
|
558801
558649
|
const isSelected = index === selectedIndex;
|
|
558802
|
-
return
|
|
558650
|
+
return import_react135.default.createElement(
|
|
558803
558651
|
Text,
|
|
558804
558652
|
{ key: tool, color: isSelected ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: isSelected },
|
|
558805
558653
|
isSelected ? "\u276F " : " ",
|
|
558806
558654
|
tool
|
|
558807
558655
|
);
|
|
558808
558656
|
}),
|
|
558809
|
-
|
|
558657
|
+
import_react135.default.createElement(
|
|
558810
558658
|
Box_default,
|
|
558811
558659
|
{ marginTop: 1 },
|
|
558812
|
-
|
|
558660
|
+
import_react135.default.createElement(
|
|
558813
558661
|
Text,
|
|
558814
558662
|
{ color: selectedIndex === clearAllIndex ? theme14.colors.warning : theme14.colors.menuSecondary, bold: selectedIndex === clearAllIndex },
|
|
558815
558663
|
selectedIndex === clearAllIndex ? "\u276F " : " ",
|
|
558816
558664
|
messages.clearAll ?? "Clear All"
|
|
558817
558665
|
)
|
|
558818
558666
|
)
|
|
558819
|
-
) :
|
|
558667
|
+
) : import_react135.default.createElement(
|
|
558820
558668
|
Box_default,
|
|
558821
558669
|
{ marginTop: 1 },
|
|
558822
|
-
|
|
558670
|
+
import_react135.default.createElement(Text, { color: "gray", dimColor: true }, messages.noTools ?? "No tools are always approved")
|
|
558823
558671
|
),
|
|
558824
|
-
|
|
558672
|
+
import_react135.default.createElement(
|
|
558825
558673
|
Box_default,
|
|
558826
558674
|
{ marginTop: 1 },
|
|
558827
|
-
|
|
558675
|
+
import_react135.default.createElement(Text, { color: "gray", dimColor: true }, messages.hint ?? "\u2191\u2193 navigate \u2022 Enter remove \u2022 ESC close")
|
|
558828
558676
|
)
|
|
558829
558677
|
);
|
|
558830
558678
|
}
|
|
558831
|
-
var
|
|
558679
|
+
var import_react135;
|
|
558832
558680
|
var init_PermissionsPanel = __esm({
|
|
558833
558681
|
async "dist/ui/components/panels/PermissionsPanel.js"() {
|
|
558834
558682
|
"use strict";
|
|
558835
|
-
|
|
558683
|
+
import_react135 = __toESM(require_react(), 1);
|
|
558836
558684
|
await init_build2();
|
|
558837
558685
|
init_i18n();
|
|
558838
558686
|
init_ThemeContext();
|
|
@@ -558917,21 +558765,21 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
558917
558765
|
const { t } = useI18n();
|
|
558918
558766
|
const { theme: theme14 } = useTheme();
|
|
558919
558767
|
const { exit } = use_app_default();
|
|
558920
|
-
const [messages, setMessages] = (0,
|
|
558921
|
-
const [isSaving] = (0,
|
|
558922
|
-
const [pendingMessages, setPendingMessages] = (0,
|
|
558923
|
-
const pendingMessagesRef = (0,
|
|
558924
|
-
const hasAttemptedAutoVscodeConnect = (0,
|
|
558925
|
-
const userInterruptedRef = (0,
|
|
558926
|
-
const [remountKey, setRemountKey] = (0,
|
|
558927
|
-
const [currentContextPercentage, setCurrentContextPercentage] = (0,
|
|
558928
|
-
const currentContextPercentageRef = (0,
|
|
558929
|
-
const [isExecutingTerminalCommand, setIsExecutingTerminalCommand] = (0,
|
|
558930
|
-
const [customCommandExecution, setCustomCommandExecution] = (0,
|
|
558931
|
-
(0,
|
|
558768
|
+
const [messages, setMessages] = (0, import_react136.useState)([]);
|
|
558769
|
+
const [isSaving] = (0, import_react136.useState)(false);
|
|
558770
|
+
const [pendingMessages, setPendingMessages] = (0, import_react136.useState)([]);
|
|
558771
|
+
const pendingMessagesRef = (0, import_react136.useRef)([]);
|
|
558772
|
+
const hasAttemptedAutoVscodeConnect = (0, import_react136.useRef)(false);
|
|
558773
|
+
const userInterruptedRef = (0, import_react136.useRef)(false);
|
|
558774
|
+
const [remountKey, setRemountKey] = (0, import_react136.useState)(0);
|
|
558775
|
+
const [currentContextPercentage, setCurrentContextPercentage] = (0, import_react136.useState)(0);
|
|
558776
|
+
const currentContextPercentageRef = (0, import_react136.useRef)(0);
|
|
558777
|
+
const [isExecutingTerminalCommand, setIsExecutingTerminalCommand] = (0, import_react136.useState)(false);
|
|
558778
|
+
const [customCommandExecution, setCustomCommandExecution] = (0, import_react136.useState)(null);
|
|
558779
|
+
(0, import_react136.useEffect)(() => {
|
|
558932
558780
|
currentContextPercentageRef.current = currentContextPercentage;
|
|
558933
558781
|
}, [currentContextPercentage]);
|
|
558934
|
-
const [yoloMode, setYoloMode] = (0,
|
|
558782
|
+
const [yoloMode, setYoloMode] = (0, import_react136.useState)(() => {
|
|
558935
558783
|
if (enableYolo !== void 0) {
|
|
558936
558784
|
return enableYolo;
|
|
558937
558785
|
}
|
|
@@ -558942,7 +558790,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
558942
558790
|
return false;
|
|
558943
558791
|
}
|
|
558944
558792
|
});
|
|
558945
|
-
const [planMode, setPlanMode] = (0,
|
|
558793
|
+
const [planMode, setPlanMode] = (0, import_react136.useState)(() => {
|
|
558946
558794
|
if (enablePlan !== void 0) {
|
|
558947
558795
|
return enablePlan;
|
|
558948
558796
|
}
|
|
@@ -558953,7 +558801,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
558953
558801
|
return false;
|
|
558954
558802
|
}
|
|
558955
558803
|
});
|
|
558956
|
-
const [vulnerabilityHuntingMode, setVulnerabilityHuntingMode] = (0,
|
|
558804
|
+
const [vulnerabilityHuntingMode, setVulnerabilityHuntingMode] = (0, import_react136.useState)(() => {
|
|
558957
558805
|
try {
|
|
558958
558806
|
const saved = localStorage.getItem("snow-vulnerability-hunting-mode");
|
|
558959
558807
|
return saved === "true";
|
|
@@ -558961,33 +558809,33 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
558961
558809
|
return false;
|
|
558962
558810
|
}
|
|
558963
558811
|
});
|
|
558964
|
-
const [simpleMode, setSimpleMode2] = (0,
|
|
558812
|
+
const [simpleMode, setSimpleMode2] = (0, import_react136.useState)(() => {
|
|
558965
558813
|
return getSimpleMode();
|
|
558966
558814
|
});
|
|
558967
|
-
const [showThinking, _setShowThinking] = (0,
|
|
558815
|
+
const [showThinking, _setShowThinking] = (0, import_react136.useState)(() => {
|
|
558968
558816
|
const config3 = getOpenAiConfig();
|
|
558969
558817
|
return config3.showThinking !== false;
|
|
558970
558818
|
});
|
|
558971
|
-
const [isCompressing, setIsCompressing] = (0,
|
|
558972
|
-
const [compressionError, setCompressionError] = (0,
|
|
558973
|
-
const [showPermissionsPanel, setShowPermissionsPanel] = (0,
|
|
558974
|
-
const [restoreInputContent, setRestoreInputContent] = (0,
|
|
558975
|
-
const [bashSensitiveCommand, setBashSensitiveCommand] = (0,
|
|
558976
|
-
const [suppressLoadingIndicator, setSuppressLoadingIndicator] = (0,
|
|
558977
|
-
const hadBashSensitiveCommandRef = (0,
|
|
558978
|
-
const [hookError, setHookError] = (0,
|
|
558819
|
+
const [isCompressing, setIsCompressing] = (0, import_react136.useState)(false);
|
|
558820
|
+
const [compressionError, setCompressionError] = (0, import_react136.useState)(null);
|
|
558821
|
+
const [showPermissionsPanel, setShowPermissionsPanel] = (0, import_react136.useState)(false);
|
|
558822
|
+
const [restoreInputContent, setRestoreInputContent] = (0, import_react136.useState)(null);
|
|
558823
|
+
const [bashSensitiveCommand, setBashSensitiveCommand] = (0, import_react136.useState)(null);
|
|
558824
|
+
const [suppressLoadingIndicator, setSuppressLoadingIndicator] = (0, import_react136.useState)(false);
|
|
558825
|
+
const hadBashSensitiveCommandRef = (0, import_react136.useRef)(false);
|
|
558826
|
+
const [hookError, setHookError] = (0, import_react136.useState)(null);
|
|
558979
558827
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
558980
558828
|
const { stdout } = use_stdout_default();
|
|
558981
558829
|
const workingDirectory = process.cwd();
|
|
558982
|
-
const isInitialMount = (0,
|
|
558983
|
-
const [codebaseIndexing, setCodebaseIndexing] = (0,
|
|
558984
|
-
const [codebaseProgress, setCodebaseProgress] = (0,
|
|
558985
|
-
const [watcherEnabled, setWatcherEnabled] = (0,
|
|
558986
|
-
const [fileUpdateNotification, setFileUpdateNotification] = (0,
|
|
558987
|
-
const codebaseAgentRef = (0,
|
|
558830
|
+
const isInitialMount = (0, import_react136.useRef)(true);
|
|
558831
|
+
const [codebaseIndexing, setCodebaseIndexing] = (0, import_react136.useState)(false);
|
|
558832
|
+
const [codebaseProgress, setCodebaseProgress] = (0, import_react136.useState)(null);
|
|
558833
|
+
const [watcherEnabled, setWatcherEnabled] = (0, import_react136.useState)(false);
|
|
558834
|
+
const [fileUpdateNotification, setFileUpdateNotification] = (0, import_react136.useState)(null);
|
|
558835
|
+
const codebaseAgentRef = (0, import_react136.useRef)(null);
|
|
558988
558836
|
useCursorHide();
|
|
558989
558837
|
const streamingState = useStreamingState();
|
|
558990
|
-
(0,
|
|
558838
|
+
(0, import_react136.useEffect)(() => {
|
|
558991
558839
|
const hasPanel = !!bashSensitiveCommand;
|
|
558992
558840
|
const hadPanel = hadBashSensitiveCommandRef.current;
|
|
558993
558841
|
hadBashSensitiveCommandRef.current = hasPanel;
|
|
@@ -559011,8 +558859,8 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559011
558859
|
const backgroundProcesses = useBackgroundProcesses();
|
|
559012
558860
|
const panelState = usePanelState();
|
|
559013
558861
|
const { hasFocus } = useTerminalFocus();
|
|
559014
|
-
const [selectedProcessIndex, setSelectedProcessIndex] = (0,
|
|
559015
|
-
const sortedBackgroundProcesses = (0,
|
|
558862
|
+
const [selectedProcessIndex, setSelectedProcessIndex] = (0, import_react136.useState)(0);
|
|
558863
|
+
const sortedBackgroundProcesses = (0, import_react136.useMemo)(() => {
|
|
559016
558864
|
return [...backgroundProcesses.processes].sort((a, b) => {
|
|
559017
558865
|
if (a.status === "running" && b.status !== "running")
|
|
559018
558866
|
return -1;
|
|
@@ -559021,17 +558869,17 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559021
558869
|
return b.startedAt.getTime() - a.startedAt.getTime();
|
|
559022
558870
|
});
|
|
559023
558871
|
}, [backgroundProcesses.processes]);
|
|
559024
|
-
(0,
|
|
558872
|
+
(0, import_react136.useEffect)(() => {
|
|
559025
558873
|
if (sortedBackgroundProcesses.length > 0 && selectedProcessIndex >= sortedBackgroundProcesses.length) {
|
|
559026
558874
|
setSelectedProcessIndex(sortedBackgroundProcesses.length - 1);
|
|
559027
558875
|
}
|
|
559028
558876
|
}, [sortedBackgroundProcesses.length, selectedProcessIndex]);
|
|
559029
558877
|
const { saveMessage, clearSavedMessages, initializeFromSession } = useSessionSave();
|
|
559030
|
-
(0,
|
|
558878
|
+
(0, import_react136.useEffect)(() => {
|
|
559031
558879
|
pendingMessagesRef.current = pendingMessages;
|
|
559032
558880
|
}, [pendingMessages]);
|
|
559033
|
-
const [commandsLoaded, setCommandsLoaded] = (0,
|
|
559034
|
-
(0,
|
|
558881
|
+
const [commandsLoaded, setCommandsLoaded] = (0, import_react136.useState)(false);
|
|
558882
|
+
(0, import_react136.useEffect)(() => {
|
|
559035
558883
|
Promise.all([
|
|
559036
558884
|
Promise.resolve().then(() => (init_clear(), clear_exports)),
|
|
559037
558885
|
Promise.resolve().then(() => (init_profiles(), profiles_exports)),
|
|
@@ -559065,7 +558913,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559065
558913
|
setCommandsLoaded(true);
|
|
559066
558914
|
});
|
|
559067
558915
|
}, []);
|
|
559068
|
-
(0,
|
|
558916
|
+
(0, import_react136.useEffect)(() => {
|
|
559069
558917
|
const startCodebaseIndexing = async () => {
|
|
559070
558918
|
try {
|
|
559071
558919
|
const config3 = loadCodebaseConfig();
|
|
@@ -559204,7 +559052,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559204
559052
|
}
|
|
559205
559053
|
};
|
|
559206
559054
|
}, []);
|
|
559207
|
-
(0,
|
|
559055
|
+
(0, import_react136.useEffect)(() => {
|
|
559208
559056
|
global.__stopCodebaseIndexing = async () => {
|
|
559209
559057
|
if (codebaseAgentRef.current) {
|
|
559210
559058
|
await codebaseAgentRef.current.stop();
|
|
@@ -559215,25 +559063,25 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559215
559063
|
delete global.__stopCodebaseIndexing;
|
|
559216
559064
|
};
|
|
559217
559065
|
}, []);
|
|
559218
|
-
(0,
|
|
559066
|
+
(0, import_react136.useEffect)(() => {
|
|
559219
559067
|
try {
|
|
559220
559068
|
localStorage.setItem("snow-yolo-mode", String(yoloMode));
|
|
559221
559069
|
} catch {
|
|
559222
559070
|
}
|
|
559223
559071
|
}, [yoloMode]);
|
|
559224
|
-
(0,
|
|
559072
|
+
(0, import_react136.useEffect)(() => {
|
|
559225
559073
|
try {
|
|
559226
559074
|
localStorage.setItem("snow-plan-mode", String(planMode));
|
|
559227
559075
|
} catch {
|
|
559228
559076
|
}
|
|
559229
559077
|
}, [planMode]);
|
|
559230
|
-
(0,
|
|
559078
|
+
(0, import_react136.useEffect)(() => {
|
|
559231
559079
|
try {
|
|
559232
559080
|
localStorage.setItem("snow-vulnerability-hunting-mode", String(vulnerabilityHuntingMode));
|
|
559233
559081
|
} catch {
|
|
559234
559082
|
}
|
|
559235
559083
|
}, [vulnerabilityHuntingMode]);
|
|
559236
|
-
(0,
|
|
559084
|
+
(0, import_react136.useEffect)(() => {
|
|
559237
559085
|
const interval = setInterval(() => {
|
|
559238
559086
|
const currentSimpleMode = getSimpleMode();
|
|
559239
559087
|
if (currentSimpleMode !== simpleMode) {
|
|
@@ -559242,7 +559090,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559242
559090
|
}, 1e3);
|
|
559243
559091
|
return () => clearInterval(interval);
|
|
559244
559092
|
}, [simpleMode]);
|
|
559245
|
-
(0,
|
|
559093
|
+
(0, import_react136.useEffect)(() => {
|
|
559246
559094
|
if (restoreInputContent !== null) {
|
|
559247
559095
|
const timer2 = setTimeout(() => {
|
|
559248
559096
|
setRestoreInputContent(null);
|
|
@@ -559251,7 +559099,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559251
559099
|
}
|
|
559252
559100
|
return void 0;
|
|
559253
559101
|
}, [restoreInputContent]);
|
|
559254
|
-
(0,
|
|
559102
|
+
(0, import_react136.useEffect)(() => {
|
|
559255
559103
|
if (!autoResume) {
|
|
559256
559104
|
sessionManager.clearCurrentSession();
|
|
559257
559105
|
return;
|
|
@@ -559276,7 +559124,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559276
559124
|
};
|
|
559277
559125
|
resumeSession();
|
|
559278
559126
|
}, [autoResume, initializeFromSession]);
|
|
559279
|
-
(0,
|
|
559127
|
+
(0, import_react136.useEffect)(() => {
|
|
559280
559128
|
if (isInitialMount.current) {
|
|
559281
559129
|
isInitialMount.current = false;
|
|
559282
559130
|
return;
|
|
@@ -559289,7 +559137,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559289
559137
|
clearTimeout(handler);
|
|
559290
559138
|
};
|
|
559291
559139
|
}, [terminalWidth]);
|
|
559292
|
-
(0,
|
|
559140
|
+
(0, import_react136.useEffect)(() => {
|
|
559293
559141
|
if (remountKey === 0)
|
|
559294
559142
|
return;
|
|
559295
559143
|
const reloadMessages = async () => {
|
|
@@ -559302,7 +559150,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559302
559150
|
reloadMessages();
|
|
559303
559151
|
}, [remountKey]);
|
|
559304
559152
|
const { pendingToolConfirmation, alwaysApprovedTools, requestToolConfirmation, isToolAutoApproved, addMultipleToAlwaysApproved, removeFromAlwaysApproved, clearAllAlwaysApproved } = useToolConfirmation(workingDirectory);
|
|
559305
|
-
const [pendingUserQuestion, setPendingUserQuestion] = (0,
|
|
559153
|
+
const [pendingUserQuestion, setPendingUserQuestion] = (0, import_react136.useState)(null);
|
|
559306
559154
|
const requestUserQuestion = async (question, options3, toolCall) => {
|
|
559307
559155
|
return new Promise((resolve12) => {
|
|
559308
559156
|
setPendingUserQuestion({
|
|
@@ -559363,7 +559211,6 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559363
559211
|
setShowSessionPanel: panelState.setShowSessionPanel,
|
|
559364
559212
|
setShowMcpPanel: panelState.setShowMcpPanel,
|
|
559365
559213
|
setShowUsagePanel: panelState.setShowUsagePanel,
|
|
559366
|
-
setShowHelpPanel: panelState.setShowHelpPanel,
|
|
559367
559214
|
setShowCustomCommandConfig: panelState.setShowCustomCommandConfig,
|
|
559368
559215
|
setShowSkillsCreation: panelState.setShowSkillsCreation,
|
|
559369
559216
|
setShowRoleCreation: panelState.setShowRoleCreation,
|
|
@@ -559379,6 +559226,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559379
559226
|
setVulnerabilityHuntingMode,
|
|
559380
559227
|
setContextUsage: streamingState.setContextUsage,
|
|
559381
559228
|
setCurrentContextPercentage,
|
|
559229
|
+
currentContextPercentageRef,
|
|
559382
559230
|
setVscodeConnectionStatus: vscodeState.setVscodeConnectionStatus,
|
|
559383
559231
|
setIsExecutingTerminalCommand,
|
|
559384
559232
|
setCustomCommandExecution,
|
|
@@ -559386,7 +559234,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559386
559234
|
onQuit: handleQuit,
|
|
559387
559235
|
onReindexCodebase: handleReindexCodebase
|
|
559388
559236
|
});
|
|
559389
|
-
(0,
|
|
559237
|
+
(0, import_react136.useEffect)(() => {
|
|
559390
559238
|
if (!commandsLoaded) {
|
|
559391
559239
|
return;
|
|
559392
559240
|
}
|
|
@@ -559415,8 +559263,8 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559415
559263
|
}, 0);
|
|
559416
559264
|
return () => clearTimeout(timer2);
|
|
559417
559265
|
}, [commandsLoaded]);
|
|
559418
|
-
(0,
|
|
559419
|
-
if (
|
|
559266
|
+
(0, import_react136.useEffect)(() => {
|
|
559267
|
+
if (streamingState.streamStatus === "idle" && pendingMessages.length > 0) {
|
|
559420
559268
|
const timer2 = setTimeout(() => {
|
|
559421
559269
|
streamingState.setIsStreaming(true);
|
|
559422
559270
|
processPendingMessages();
|
|
@@ -559424,8 +559272,8 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559424
559272
|
return () => clearTimeout(timer2);
|
|
559425
559273
|
}
|
|
559426
559274
|
return void 0;
|
|
559427
|
-
}, [streamingState.
|
|
559428
|
-
(0,
|
|
559275
|
+
}, [streamingState.streamStatus, pendingMessages.length]);
|
|
559276
|
+
(0, import_react136.useEffect)(() => {
|
|
559429
559277
|
const handleSearchEvent = (event) => {
|
|
559430
559278
|
if (event.type === "search-complete") {
|
|
559431
559279
|
streamingState.setCodebaseSearchStatus({
|
|
@@ -559526,6 +559374,10 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559526
559374
|
if (key.escape && panelState.handleEscapeKey()) {
|
|
559527
559375
|
return;
|
|
559528
559376
|
}
|
|
559377
|
+
if (key.escape && streamingState.isStopping && !streamingState.isStreaming) {
|
|
559378
|
+
streamingState.setIsStopping(false);
|
|
559379
|
+
return;
|
|
559380
|
+
}
|
|
559529
559381
|
if (key.escape && streamingState.isStreaming && streamingState.abortController && hasFocus) {
|
|
559530
559382
|
userInterruptedRef.current = true;
|
|
559531
559383
|
streamingState.setIsStopping(true);
|
|
@@ -559559,71 +559411,71 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559559
559411
|
}
|
|
559560
559412
|
const handleProfileSelect = panelState.handleProfileSelect;
|
|
559561
559413
|
if (terminalHeight < MIN_TERMINAL_HEIGHT) {
|
|
559562
|
-
return
|
|
559414
|
+
return import_react136.default.createElement(
|
|
559563
559415
|
Box_default,
|
|
559564
559416
|
{ flexDirection: "column", padding: 2 },
|
|
559565
|
-
|
|
559417
|
+
import_react136.default.createElement(
|
|
559566
559418
|
Box_default,
|
|
559567
559419
|
{ borderStyle: "round", borderColor: "red", padding: 1 },
|
|
559568
|
-
|
|
559420
|
+
import_react136.default.createElement(Text, { color: "red", bold: true }, t.chatScreen.terminalTooSmall)
|
|
559569
559421
|
),
|
|
559570
|
-
|
|
559422
|
+
import_react136.default.createElement(
|
|
559571
559423
|
Box_default,
|
|
559572
559424
|
{ marginTop: 1 },
|
|
559573
|
-
|
|
559425
|
+
import_react136.default.createElement(Text, { color: "yellow" }, t.chatScreen.terminalResizePrompt.replace("{current}", terminalHeight.toString()).replace("{required}", MIN_TERMINAL_HEIGHT.toString()))
|
|
559574
559426
|
),
|
|
559575
|
-
|
|
559427
|
+
import_react136.default.createElement(
|
|
559576
559428
|
Box_default,
|
|
559577
559429
|
{ marginTop: 1 },
|
|
559578
|
-
|
|
559430
|
+
import_react136.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.terminalMinHeight)
|
|
559579
559431
|
)
|
|
559580
559432
|
);
|
|
559581
559433
|
}
|
|
559582
|
-
return
|
|
559434
|
+
return import_react136.default.createElement(
|
|
559583
559435
|
Box_default,
|
|
559584
559436
|
{ flexDirection: "column", height: "100%", width: terminalWidth },
|
|
559585
|
-
|
|
559586
|
-
|
|
559437
|
+
import_react136.default.createElement(Static, { key: remountKey, items: [
|
|
559438
|
+
import_react136.default.createElement(ChatHeader, { key: "header", terminalWidth, simpleMode, workingDirectory }),
|
|
559587
559439
|
...messages.filter((m) => !m.streaming).map((message, index, filteredMessages) => {
|
|
559588
|
-
return
|
|
559440
|
+
return import_react136.default.createElement(MessageRenderer, { key: `msg-${index}`, message, index, filteredMessages, terminalWidth, showThinking });
|
|
559589
559441
|
})
|
|
559590
559442
|
] }, (item) => item),
|
|
559591
|
-
|
|
559592
|
-
|
|
559443
|
+
import_react136.default.createElement(LoadingIndicator, { isStreaming: streamingState.isStreaming, isStopping: streamingState.isStopping, isSaving, hasPendingToolConfirmation: !!pendingToolConfirmation, hasPendingUserQuestion: !!pendingUserQuestion, hasBlockingOverlay: !!bashSensitiveCommand || suppressLoadingIndicator || bashMode.state.isExecuting && !!bashMode.state.currentCommand || terminalExecutionState.state.isExecuting && !terminalExecutionState.state.isBackgrounded && !!terminalExecutionState.state.command || ((customCommandExecution == null ? void 0 : customCommandExecution.isRunning) ?? false), terminalWidth, animationFrame: streamingState.animationFrame, retryStatus: streamingState.retryStatus, codebaseSearchStatus: streamingState.codebaseSearchStatus, isReasoning: streamingState.isReasoning, streamTokenCount: streamingState.streamTokenCount, elapsedSeconds: streamingState.elapsedSeconds, currentModel: streamingState.currentModel }),
|
|
559444
|
+
import_react136.default.createElement(
|
|
559593
559445
|
Box_default,
|
|
559594
559446
|
{ paddingX: 1, width: terminalWidth },
|
|
559595
|
-
|
|
559447
|
+
import_react136.default.createElement(PendingMessages, { pendingMessages })
|
|
559596
559448
|
),
|
|
559597
|
-
hookError &&
|
|
559449
|
+
hookError && import_react136.default.createElement(
|
|
559598
559450
|
Box_default,
|
|
559599
559451
|
{ paddingX: 1, width: terminalWidth, marginBottom: 1 },
|
|
559600
|
-
|
|
559452
|
+
import_react136.default.createElement(HookErrorDisplay, { details: hookError })
|
|
559601
559453
|
),
|
|
559602
|
-
pendingToolConfirmation &&
|
|
559454
|
+
pendingToolConfirmation && import_react136.default.createElement(ToolConfirmation, { toolName: pendingToolConfirmation.batchToolNames || pendingToolConfirmation.tool.function.name, toolArguments: !pendingToolConfirmation.allTools ? pendingToolConfirmation.tool.function.arguments : void 0, allTools: pendingToolConfirmation.allTools, onConfirm: pendingToolConfirmation.resolve, onHookError: (error) => {
|
|
559603
559455
|
setHookError(error);
|
|
559604
559456
|
} }),
|
|
559605
|
-
bashSensitiveCommand &&
|
|
559457
|
+
bashSensitiveCommand && import_react136.default.createElement(
|
|
559606
559458
|
Box_default,
|
|
559607
559459
|
{ paddingX: 1, width: terminalWidth },
|
|
559608
|
-
|
|
559460
|
+
import_react136.default.createElement(BashCommandConfirmation, { command: bashSensitiveCommand.command, onConfirm: bashSensitiveCommand.resolve, terminalWidth })
|
|
559609
559461
|
),
|
|
559610
|
-
bashMode.state.isExecuting && bashMode.state.currentCommand &&
|
|
559462
|
+
bashMode.state.isExecuting && bashMode.state.currentCommand && import_react136.default.createElement(
|
|
559611
559463
|
Box_default,
|
|
559612
559464
|
{ paddingX: 1, width: terminalWidth },
|
|
559613
|
-
|
|
559465
|
+
import_react136.default.createElement(BashCommandExecutionStatus, { command: bashMode.state.currentCommand, timeout: bashMode.state.currentTimeout || 3e4, terminalWidth, output: bashMode.state.output })
|
|
559614
559466
|
),
|
|
559615
|
-
customCommandExecution &&
|
|
559467
|
+
customCommandExecution && import_react136.default.createElement(
|
|
559616
559468
|
Box_default,
|
|
559617
559469
|
{ paddingX: 1, width: terminalWidth },
|
|
559618
|
-
|
|
559470
|
+
import_react136.default.createElement(CustomCommandExecutionDisplay, { command: customCommandExecution.command, commandName: customCommandExecution.commandName, isRunning: customCommandExecution.isRunning, output: customCommandExecution.output, exitCode: customCommandExecution.exitCode, error: customCommandExecution.error })
|
|
559619
559471
|
),
|
|
559620
|
-
terminalExecutionState.state.isExecuting && !terminalExecutionState.state.isBackgrounded && terminalExecutionState.state.command &&
|
|
559472
|
+
terminalExecutionState.state.isExecuting && !terminalExecutionState.state.isBackgrounded && terminalExecutionState.state.command && import_react136.default.createElement(
|
|
559621
559473
|
Box_default,
|
|
559622
559474
|
{ paddingX: 1, width: terminalWidth },
|
|
559623
|
-
|
|
559475
|
+
import_react136.default.createElement(BashCommandExecutionStatus, { command: terminalExecutionState.state.command, timeout: terminalExecutionState.state.timeout || 3e4, terminalWidth, output: terminalExecutionState.state.output, needsInput: terminalExecutionState.state.needsInput, inputPrompt: terminalExecutionState.state.inputPrompt })
|
|
559624
559476
|
),
|
|
559625
|
-
pendingUserQuestion &&
|
|
559626
|
-
|
|
559477
|
+
pendingUserQuestion && import_react136.default.createElement(AskUserQuestion, { question: pendingUserQuestion.question, options: pendingUserQuestion.options, onAnswer: handleUserQuestionAnswer }),
|
|
559478
|
+
import_react136.default.createElement(PanelsManager, { terminalWidth, workingDirectory, showSessionPanel: panelState.showSessionPanel, showMcpPanel: panelState.showMcpPanel, showUsagePanel: panelState.showUsagePanel, showCustomCommandConfig: panelState.showCustomCommandConfig, showSkillsCreation: panelState.showSkillsCreation, showRoleCreation: panelState.showRoleCreation, showRoleDeletion: panelState.showRoleDeletion, showRoleList: panelState.showRoleList, showWorkingDirPanel: panelState.showWorkingDirPanel, setShowSessionPanel: panelState.setShowSessionPanel, setShowCustomCommandConfig: panelState.setShowCustomCommandConfig, setShowSkillsCreation: panelState.setShowSkillsCreation, setShowRoleCreation: panelState.setShowRoleCreation, setShowRoleDeletion: panelState.setShowRoleDeletion, setShowRoleList: panelState.setShowRoleList, setShowWorkingDirPanel: panelState.setShowWorkingDirPanel, handleSessionPanelSelect, onCustomCommandSave: async (name, command, type, location, description) => {
|
|
559627
559479
|
await saveCustomCommand(name, command, type, description, location, workingDirectory);
|
|
559628
559480
|
await registerCustomCommands(workingDirectory);
|
|
559629
559481
|
panelState.setShowCustomCommandConfig(false);
|
|
@@ -559706,26 +559558,26 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559706
559558
|
setMessages((prev) => [...prev, errorMessage]);
|
|
559707
559559
|
}
|
|
559708
559560
|
} }),
|
|
559709
|
-
showPermissionsPanel &&
|
|
559561
|
+
showPermissionsPanel && import_react136.default.createElement(
|
|
559710
559562
|
Box_default,
|
|
559711
559563
|
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
559712
|
-
|
|
559713
|
-
|
|
559714
|
-
{ fallback:
|
|
559564
|
+
import_react136.default.createElement(
|
|
559565
|
+
import_react136.Suspense,
|
|
559566
|
+
{ fallback: import_react136.default.createElement(
|
|
559715
559567
|
Box_default,
|
|
559716
559568
|
null,
|
|
559717
|
-
|
|
559569
|
+
import_react136.default.createElement(
|
|
559718
559570
|
Text,
|
|
559719
559571
|
null,
|
|
559720
|
-
|
|
559572
|
+
import_react136.default.createElement(build_default, { type: "dots" }),
|
|
559721
559573
|
" Loading..."
|
|
559722
559574
|
)
|
|
559723
559575
|
) },
|
|
559724
|
-
|
|
559576
|
+
import_react136.default.createElement(PermissionsPanel2, { alwaysApprovedTools, onRemoveTool: removeFromAlwaysApproved, onClearAll: clearAllAlwaysApproved, onClose: () => setShowPermissionsPanel(false) })
|
|
559725
559577
|
)
|
|
559726
559578
|
),
|
|
559727
|
-
snapshotState.pendingRollback &&
|
|
559728
|
-
!pendingToolConfirmation && !pendingUserQuestion && !bashSensitiveCommand && !terminalExecutionState.state.needsInput && !(panelState.showSessionPanel || panelState.showMcpPanel || panelState.showUsagePanel || panelState.
|
|
559579
|
+
snapshotState.pendingRollback && import_react136.default.createElement(FileRollbackConfirmation, { fileCount: snapshotState.pendingRollback.fileCount, filePaths: snapshotState.pendingRollback.filePaths || [], onConfirm: handleRollbackConfirm }),
|
|
559580
|
+
!pendingToolConfirmation && !pendingUserQuestion && !bashSensitiveCommand && !terminalExecutionState.state.needsInput && !(panelState.showSessionPanel || panelState.showMcpPanel || panelState.showUsagePanel || panelState.showCustomCommandConfig || panelState.showSkillsCreation || panelState.showRoleCreation || panelState.showRoleDeletion || panelState.showRoleList || panelState.showWorkingDirPanel || showPermissionsPanel) && !snapshotState.pendingRollback && import_react136.default.createElement(ChatFooter, { onSubmit: handleMessageSubmit, onCommand: handleCommandExecution, onHistorySelect: handleHistorySelect, onSwitchProfile: handleSwitchProfile, handleProfileSelect, handleHistorySelect, showReviewCommitPanel: panelState.showReviewCommitPanel, setShowReviewCommitPanel: panelState.setShowReviewCommitPanel, onReviewCommitConfirm: handleReviewCommitConfirm, disabled: !!pendingToolConfirmation || !!bashSensitiveCommand || isExecutingTerminalCommand || isCompressing || streamingState.isStopping, isStopping: streamingState.isStopping, isProcessing: streamingState.isStreaming || isSaving || bashMode.state.isExecuting || isCompressing, chatHistory: messages, yoloMode, setYoloMode, planMode, setPlanMode, vulnerabilityHuntingMode, setVulnerabilityHuntingMode, contextUsage: streamingState.contextUsage ? {
|
|
559729
559581
|
inputTokens: streamingState.contextUsage.prompt_tokens,
|
|
559730
559582
|
maxContextTokens: getOpenAiConfig().maxContextTokens || 4e3,
|
|
559731
559583
|
cacheCreationTokens: streamingState.contextUsage.cache_creation_input_tokens,
|
|
@@ -559740,11 +559592,11 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
559740
559592
|
}, profileSearchQuery: panelState.profileSearchQuery, setProfileSearchQuery: panelState.setProfileSearchQuery, vscodeConnectionStatus: vscodeState.vscodeConnectionStatus, editorContext: vscodeState.editorContext, codebaseIndexing, codebaseProgress, watcherEnabled, fileUpdateNotification, currentProfileName: panelState.currentProfileName, isCompressing, compressionError, backgroundProcesses: backgroundProcesses.processes, showBackgroundPanel: backgroundProcesses.showPanel, selectedProcessIndex, terminalWidth })
|
|
559741
559593
|
);
|
|
559742
559594
|
}
|
|
559743
|
-
var
|
|
559595
|
+
var import_react136, PermissionsPanel2;
|
|
559744
559596
|
var init_ChatScreen = __esm({
|
|
559745
559597
|
async "dist/ui/pages/ChatScreen.js"() {
|
|
559746
559598
|
"use strict";
|
|
559747
|
-
|
|
559599
|
+
import_react136 = __toESM(require_react(), 1);
|
|
559748
559600
|
await init_build2();
|
|
559749
559601
|
await init_build3();
|
|
559750
559602
|
init_ansi_escapes();
|
|
@@ -559789,7 +559641,7 @@ var init_ChatScreen = __esm({
|
|
|
559789
559641
|
init_codebaseConfig();
|
|
559790
559642
|
init_codebaseSearchEvents();
|
|
559791
559643
|
init_logger();
|
|
559792
|
-
PermissionsPanel2 = (0,
|
|
559644
|
+
PermissionsPanel2 = (0, import_react136.lazy)(() => init_PermissionsPanel().then(() => PermissionsPanel_exports));
|
|
559793
559645
|
}
|
|
559794
559646
|
});
|
|
559795
559647
|
|
|
@@ -560003,10 +559855,10 @@ ${warningColor}\u26A0 Tool Confirmation Required${resetColor} ${sensitiveCheck.i
|
|
|
560003
559855
|
});
|
|
560004
559856
|
}
|
|
560005
559857
|
function HeadlessModeScreen({ prompt, sessionId, onComplete }) {
|
|
560006
|
-
const [messages, setMessages] = (0,
|
|
560007
|
-
const [isComplete, setIsComplete] = (0,
|
|
560008
|
-
const [lastDisplayedIndex, setLastDisplayedIndex] = (0,
|
|
560009
|
-
const [isWaitingForInput, setIsWaitingForInput] = (0,
|
|
559858
|
+
const [messages, setMessages] = (0, import_react137.useState)([]);
|
|
559859
|
+
const [isComplete, setIsComplete] = (0, import_react137.useState)(false);
|
|
559860
|
+
const [lastDisplayedIndex, setLastDisplayedIndex] = (0, import_react137.useState)(-1);
|
|
559861
|
+
const [isWaitingForInput, setIsWaitingForInput] = (0, import_react137.useState)(false);
|
|
560010
559862
|
const { stdout } = use_stdout_default();
|
|
560011
559863
|
const workingDirectory = process.cwd();
|
|
560012
559864
|
const { t } = useI18n();
|
|
@@ -560014,7 +559866,7 @@ function HeadlessModeScreen({ prompt, sessionId, onComplete }) {
|
|
|
560014
559866
|
const vscodeState = useVSCodeState();
|
|
560015
559867
|
const { saveMessage } = useSessionSave();
|
|
560016
559868
|
const { isToolAutoApproved, addMultipleToAlwaysApproved } = useToolConfirmation(workingDirectory);
|
|
560017
|
-
(0,
|
|
559869
|
+
(0, import_react137.useEffect)(() => {
|
|
560018
559870
|
const lastMessage = messages[messages.length - 1];
|
|
560019
559871
|
const currentIndex = messages.length - 1;
|
|
560020
559872
|
if (!lastMessage || currentIndex <= lastDisplayedIndex)
|
|
@@ -560066,7 +559918,7 @@ function HeadlessModeScreen({ prompt, sessionId, onComplete }) {
|
|
|
560066
559918
|
}
|
|
560067
559919
|
}
|
|
560068
559920
|
}, [messages, lastDisplayedIndex]);
|
|
560069
|
-
(0,
|
|
559921
|
+
(0, import_react137.useEffect)(() => {
|
|
560070
559922
|
if (isWaitingForInput)
|
|
560071
559923
|
return;
|
|
560072
559924
|
if (streamingState.isStreaming) {
|
|
@@ -560228,19 +560080,19 @@ function HeadlessModeScreen({ prompt, sessionId, onComplete }) {
|
|
|
560228
560080
|
}, 1e3);
|
|
560229
560081
|
}
|
|
560230
560082
|
};
|
|
560231
|
-
(0,
|
|
560083
|
+
(0, import_react137.useEffect)(() => {
|
|
560232
560084
|
processMessage();
|
|
560233
560085
|
}, []);
|
|
560234
560086
|
if (isComplete) {
|
|
560235
560087
|
return null;
|
|
560236
560088
|
}
|
|
560237
|
-
return
|
|
560089
|
+
return import_react137.default.createElement(import_react137.default.Fragment, null);
|
|
560238
560090
|
}
|
|
560239
|
-
var
|
|
560091
|
+
var import_react137, import_cli_highlight3, getTheme, getAnsiColor;
|
|
560240
560092
|
var init_HeadlessModeScreen = __esm({
|
|
560241
560093
|
async "dist/ui/pages/HeadlessModeScreen.js"() {
|
|
560242
560094
|
"use strict";
|
|
560243
|
-
|
|
560095
|
+
import_react137 = __toESM(require_react(), 1);
|
|
560244
560096
|
await init_build2();
|
|
560245
560097
|
init_ansi_escapes();
|
|
560246
560098
|
import_cli_highlight3 = __toESM(require_dist14(), 1);
|
|
@@ -560513,18 +560365,18 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560513
560365
|
var _a21;
|
|
560514
560366
|
const { theme: theme14 } = useTheme();
|
|
560515
560367
|
const { t } = useI18n();
|
|
560516
|
-
const [tasks, setTasks] = (0,
|
|
560517
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
560518
|
-
const [scrollOffset, setScrollOffset] = (0,
|
|
560519
|
-
const [markedTasks, setMarkedTasks] = (0,
|
|
560520
|
-
const [isLoading, setIsLoading] = (0,
|
|
560521
|
-
const [viewMode, setViewMode] = (0,
|
|
560522
|
-
const [detailTask, setDetailTask] = (0,
|
|
560523
|
-
const [pendingAction, setPendingAction] = (0,
|
|
560524
|
-
const [rejectInputMode, setRejectInputMode] = (0,
|
|
560525
|
-
const [rejectReason, setRejectReason] = (0,
|
|
560368
|
+
const [tasks, setTasks] = (0, import_react138.useState)([]);
|
|
560369
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react138.useState)(0);
|
|
560370
|
+
const [scrollOffset, setScrollOffset] = (0, import_react138.useState)(0);
|
|
560371
|
+
const [markedTasks, setMarkedTasks] = (0, import_react138.useState)(/* @__PURE__ */ new Set());
|
|
560372
|
+
const [isLoading, setIsLoading] = (0, import_react138.useState)(true);
|
|
560373
|
+
const [viewMode, setViewMode] = (0, import_react138.useState)("list");
|
|
560374
|
+
const [detailTask, setDetailTask] = (0, import_react138.useState)(null);
|
|
560375
|
+
const [pendingAction, setPendingAction] = (0, import_react138.useState)(null);
|
|
560376
|
+
const [rejectInputMode, setRejectInputMode] = (0, import_react138.useState)(false);
|
|
560377
|
+
const [rejectReason, setRejectReason] = (0, import_react138.useState)("");
|
|
560526
560378
|
const VISIBLE_ITEMS2 = 5;
|
|
560527
|
-
const loadTasks = (0,
|
|
560379
|
+
const loadTasks = (0, import_react138.useCallback)(async () => {
|
|
560528
560380
|
setIsLoading(true);
|
|
560529
560381
|
try {
|
|
560530
560382
|
const taskList = await taskManager.listTasks();
|
|
@@ -560536,10 +560388,10 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560536
560388
|
setIsLoading(false);
|
|
560537
560389
|
}
|
|
560538
560390
|
}, []);
|
|
560539
|
-
(0,
|
|
560391
|
+
(0, import_react138.useEffect)(() => {
|
|
560540
560392
|
void loadTasks();
|
|
560541
560393
|
}, [loadTasks]);
|
|
560542
|
-
(0,
|
|
560394
|
+
(0, import_react138.useEffect)(() => {
|
|
560543
560395
|
if (pendingAction) {
|
|
560544
560396
|
const timer2 = setTimeout(() => {
|
|
560545
560397
|
setPendingAction(null);
|
|
@@ -560548,7 +560400,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560548
560400
|
}
|
|
560549
560401
|
return void 0;
|
|
560550
560402
|
}, [pendingAction]);
|
|
560551
|
-
const handleDeleteTask = (0,
|
|
560403
|
+
const handleDeleteTask = (0, import_react138.useCallback)(async (taskId) => {
|
|
560552
560404
|
if (!taskId)
|
|
560553
560405
|
return;
|
|
560554
560406
|
const success = await taskManager.deleteTask(taskId);
|
|
@@ -560743,7 +560595,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560743
560595
|
return;
|
|
560744
560596
|
}
|
|
560745
560597
|
});
|
|
560746
|
-
const getStatusColor = (0,
|
|
560598
|
+
const getStatusColor = (0, import_react138.useCallback)((status) => {
|
|
560747
560599
|
switch (status) {
|
|
560748
560600
|
case "pending":
|
|
560749
560601
|
return "yellow";
|
|
@@ -560759,7 +560611,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560759
560611
|
return "gray";
|
|
560760
560612
|
}
|
|
560761
560613
|
}, []);
|
|
560762
|
-
const getStatusIcon = (0,
|
|
560614
|
+
const getStatusIcon = (0, import_react138.useCallback)((status) => {
|
|
560763
560615
|
switch (status) {
|
|
560764
560616
|
case "pending":
|
|
560765
560617
|
return "\u25CB";
|
|
@@ -560775,7 +560627,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560775
560627
|
return "?";
|
|
560776
560628
|
}
|
|
560777
560629
|
}, []);
|
|
560778
|
-
const formatDate2 = (0,
|
|
560630
|
+
const formatDate2 = (0, import_react138.useCallback)((timestamp) => {
|
|
560779
560631
|
const date = new Date(timestamp);
|
|
560780
560632
|
const now = /* @__PURE__ */ new Date();
|
|
560781
560633
|
const diffMs = now.getTime() - date.getTime();
|
|
@@ -560793,24 +560645,24 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560793
560645
|
return date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
560794
560646
|
}, []);
|
|
560795
560647
|
if (isLoading) {
|
|
560796
|
-
return
|
|
560648
|
+
return import_react138.default.createElement(
|
|
560797
560649
|
Box_default,
|
|
560798
560650
|
{ flexDirection: "column", paddingX: 1 },
|
|
560799
|
-
|
|
560651
|
+
import_react138.default.createElement(
|
|
560800
560652
|
Box_default,
|
|
560801
560653
|
{ borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1 },
|
|
560802
|
-
|
|
560654
|
+
import_react138.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.loadingTasks)
|
|
560803
560655
|
)
|
|
560804
560656
|
);
|
|
560805
560657
|
}
|
|
560806
560658
|
if (tasks.length === 0) {
|
|
560807
|
-
return
|
|
560659
|
+
return import_react138.default.createElement(
|
|
560808
560660
|
Box_default,
|
|
560809
560661
|
{ flexDirection: "column", paddingX: 1 },
|
|
560810
|
-
|
|
560662
|
+
import_react138.default.createElement(
|
|
560811
560663
|
Box_default,
|
|
560812
560664
|
{ borderStyle: "round", borderColor: theme14.colors.warning, paddingX: 1 },
|
|
560813
|
-
|
|
560665
|
+
import_react138.default.createElement(
|
|
560814
560666
|
Text,
|
|
560815
560667
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
560816
560668
|
t.taskManager.noTasksFound,
|
|
@@ -560824,32 +560676,32 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560824
560676
|
);
|
|
560825
560677
|
}
|
|
560826
560678
|
if (viewMode === "detail" && detailTask) {
|
|
560827
|
-
return
|
|
560679
|
+
return import_react138.default.createElement(
|
|
560828
560680
|
Box_default,
|
|
560829
560681
|
{ flexDirection: "column", paddingX: 1 },
|
|
560830
|
-
|
|
560682
|
+
import_react138.default.createElement(
|
|
560831
560683
|
Box_default,
|
|
560832
560684
|
{ borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1, flexDirection: "column" },
|
|
560833
|
-
|
|
560685
|
+
import_react138.default.createElement(
|
|
560834
560686
|
Box_default,
|
|
560835
560687
|
{ flexDirection: "column", marginBottom: 1 },
|
|
560836
|
-
|
|
560837
|
-
|
|
560688
|
+
import_react138.default.createElement(Text, { color: theme14.colors.menuInfo, bold: true }, t.taskManager.taskDetailsTitle),
|
|
560689
|
+
import_react138.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, detailTask.status === "paused" ? t.taskManager.backToList : `${t.taskManager.continueHint} \u2022 ${t.taskManager.backToList}`)
|
|
560838
560690
|
),
|
|
560839
|
-
|
|
560691
|
+
import_react138.default.createElement(
|
|
560840
560692
|
Box_default,
|
|
560841
560693
|
{ flexDirection: "column", gap: 1 },
|
|
560842
|
-
|
|
560694
|
+
import_react138.default.createElement(
|
|
560843
560695
|
Box_default,
|
|
560844
560696
|
{ flexDirection: "column" },
|
|
560845
|
-
|
|
560846
|
-
|
|
560697
|
+
import_react138.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.titleLabel),
|
|
560698
|
+
import_react138.default.createElement(Text, null, detailTask.title || t.taskManager.untitled)
|
|
560847
560699
|
),
|
|
560848
|
-
|
|
560700
|
+
import_react138.default.createElement(
|
|
560849
560701
|
Box_default,
|
|
560850
560702
|
{ flexDirection: "column" },
|
|
560851
|
-
|
|
560852
|
-
|
|
560703
|
+
import_react138.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.statusLabel),
|
|
560704
|
+
import_react138.default.createElement(
|
|
560853
560705
|
Text,
|
|
560854
560706
|
{ color: getStatusColor(detailTask.status) },
|
|
560855
560707
|
getStatusIcon(detailTask.status),
|
|
@@ -560857,64 +560709,64 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560857
560709
|
detailTask.status
|
|
560858
560710
|
)
|
|
560859
560711
|
),
|
|
560860
|
-
|
|
560712
|
+
import_react138.default.createElement(
|
|
560861
560713
|
Box_default,
|
|
560862
560714
|
{ flexDirection: "column" },
|
|
560863
|
-
|
|
560864
|
-
|
|
560715
|
+
import_react138.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.createdLabel),
|
|
560716
|
+
import_react138.default.createElement(Text, null, new Date(detailTask.createdAt).toLocaleString())
|
|
560865
560717
|
),
|
|
560866
|
-
|
|
560718
|
+
import_react138.default.createElement(
|
|
560867
560719
|
Box_default,
|
|
560868
560720
|
{ flexDirection: "column" },
|
|
560869
|
-
|
|
560870
|
-
|
|
560721
|
+
import_react138.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.updatedLabel),
|
|
560722
|
+
import_react138.default.createElement(Text, null, new Date(detailTask.updatedAt).toLocaleString())
|
|
560871
560723
|
),
|
|
560872
|
-
|
|
560724
|
+
import_react138.default.createElement(
|
|
560873
560725
|
Box_default,
|
|
560874
560726
|
{ flexDirection: "column" },
|
|
560875
|
-
|
|
560727
|
+
import_react138.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.messagesLabel.replace("{count}", String(detailTask.messages.length)))
|
|
560876
560728
|
),
|
|
560877
|
-
detailTask.status === "paused" && ((_a21 = detailTask.pausedInfo) == null ? void 0 : _a21.sensitiveCommand) &&
|
|
560729
|
+
detailTask.status === "paused" && ((_a21 = detailTask.pausedInfo) == null ? void 0 : _a21.sensitiveCommand) && import_react138.default.createElement(
|
|
560878
560730
|
Box_default,
|
|
560879
560731
|
{ flexDirection: "column", marginTop: 1 },
|
|
560880
|
-
|
|
560732
|
+
import_react138.default.createElement(
|
|
560881
560733
|
Box_default,
|
|
560882
560734
|
{ flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 1, paddingY: 1 },
|
|
560883
|
-
|
|
560884
|
-
|
|
560735
|
+
import_react138.default.createElement(Text, { color: "yellow", bold: true }, t.taskManager.sensitiveCommandDetected),
|
|
560736
|
+
import_react138.default.createElement(
|
|
560885
560737
|
Box_default,
|
|
560886
560738
|
{ marginTop: 1 },
|
|
560887
|
-
|
|
560739
|
+
import_react138.default.createElement(
|
|
560888
560740
|
Text,
|
|
560889
560741
|
null,
|
|
560890
|
-
|
|
560891
|
-
|
|
560742
|
+
import_react138.default.createElement(Text, { bold: true }, t.taskManager.commandLabel),
|
|
560743
|
+
import_react138.default.createElement(Text, { color: "yellow" }, detailTask.pausedInfo.sensitiveCommand.command)
|
|
560892
560744
|
)
|
|
560893
560745
|
),
|
|
560894
|
-
detailTask.pausedInfo.sensitiveCommand.description &&
|
|
560895
|
-
!rejectInputMode ?
|
|
560746
|
+
detailTask.pausedInfo.sensitiveCommand.description && import_react138.default.createElement(Text, { dimColor: true }, detailTask.pausedInfo.sensitiveCommand.description),
|
|
560747
|
+
!rejectInputMode ? import_react138.default.createElement(
|
|
560896
560748
|
Box_default,
|
|
560897
560749
|
{ marginTop: 1, paddingTop: 1, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: "gray", flexDirection: "column" },
|
|
560898
|
-
|
|
560899
|
-
) :
|
|
560750
|
+
import_react138.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.approveRejectHint)
|
|
560751
|
+
) : import_react138.default.createElement(
|
|
560900
560752
|
Box_default,
|
|
560901
560753
|
{ marginTop: 1, paddingTop: 1, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: "gray", flexDirection: "column" },
|
|
560902
|
-
|
|
560903
|
-
|
|
560754
|
+
import_react138.default.createElement(Text, { color: "yellow", bold: true }, t.taskManager.enterRejectionReason),
|
|
560755
|
+
import_react138.default.createElement(
|
|
560904
560756
|
Text,
|
|
560905
560757
|
null,
|
|
560906
560758
|
rejectReason,
|
|
560907
|
-
|
|
560759
|
+
import_react138.default.createElement(Text, { color: theme14.colors.menuInfo }, "\u2588")
|
|
560908
560760
|
),
|
|
560909
|
-
|
|
560761
|
+
import_react138.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.submitCancelHint)
|
|
560910
560762
|
)
|
|
560911
560763
|
)
|
|
560912
560764
|
)
|
|
560913
560765
|
),
|
|
560914
|
-
(pendingAction == null ? void 0 : pendingAction.type) === "continue" && pendingAction.taskId === detailTask.id &&
|
|
560766
|
+
(pendingAction == null ? void 0 : pendingAction.type) === "continue" && pendingAction.taskId === detailTask.id && import_react138.default.createElement(
|
|
560915
560767
|
Box_default,
|
|
560916
560768
|
{ marginTop: 1 },
|
|
560917
|
-
|
|
560769
|
+
import_react138.default.createElement(Alert, { variant: "warning" }, detailTask.status !== "completed" ? t.taskManager.taskNotCompleted : t.taskManager.confirmConvertToSession)
|
|
560918
560770
|
)
|
|
560919
560771
|
)
|
|
560920
560772
|
);
|
|
@@ -560923,21 +560775,21 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560923
560775
|
const hasMore = tasks.length > scrollOffset + VISIBLE_ITEMS2;
|
|
560924
560776
|
const hasPrevious = scrollOffset > 0;
|
|
560925
560777
|
const currentTask = tasks[selectedIndex];
|
|
560926
|
-
return
|
|
560778
|
+
return import_react138.default.createElement(
|
|
560927
560779
|
Box_default,
|
|
560928
560780
|
{ flexDirection: "column", paddingX: 1 },
|
|
560929
|
-
|
|
560781
|
+
import_react138.default.createElement(
|
|
560930
560782
|
Box_default,
|
|
560931
560783
|
{ borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1, flexDirection: "column" },
|
|
560932
|
-
|
|
560784
|
+
import_react138.default.createElement(
|
|
560933
560785
|
Box_default,
|
|
560934
560786
|
{ flexDirection: "column" },
|
|
560935
|
-
|
|
560787
|
+
import_react138.default.createElement(
|
|
560936
560788
|
Text,
|
|
560937
560789
|
{ color: theme14.colors.menuInfo, dimColor: true },
|
|
560938
560790
|
t.taskManager.tasksCount.replace("{current}", String(selectedIndex + 1)).replace("{total}", String(tasks.length)),
|
|
560939
560791
|
currentTask && ` \u2022 ${t.taskManager.messagesCount.replace("{count}", String(currentTask.messageCount))}`,
|
|
560940
|
-
markedTasks.size > 0 &&
|
|
560792
|
+
markedTasks.size > 0 && import_react138.default.createElement(
|
|
560941
560793
|
Text,
|
|
560942
560794
|
{ color: theme14.colors.warning },
|
|
560943
560795
|
" ",
|
|
@@ -560946,9 +560798,9 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560946
560798
|
t.taskManager.markedCount.replace("{count}", String(markedTasks.size))
|
|
560947
560799
|
)
|
|
560948
560800
|
),
|
|
560949
|
-
|
|
560801
|
+
import_react138.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.navigationHint)
|
|
560950
560802
|
),
|
|
560951
|
-
hasPrevious &&
|
|
560803
|
+
hasPrevious && import_react138.default.createElement(
|
|
560952
560804
|
Text,
|
|
560953
560805
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
560954
560806
|
" ",
|
|
@@ -560961,24 +560813,24 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560961
560813
|
const cleanTitle = (task.title || t.taskManager.untitled).replace(/[\r\n\t]+/g, " ");
|
|
560962
560814
|
const timeStr = formatDate2(task.updatedAt);
|
|
560963
560815
|
const truncatedTitle = cleanTitle.length > 50 ? cleanTitle.slice(0, 47) + "..." : cleanTitle;
|
|
560964
|
-
return
|
|
560816
|
+
return import_react138.default.createElement(
|
|
560965
560817
|
Text,
|
|
560966
560818
|
{ key: task.id },
|
|
560967
|
-
|
|
560819
|
+
import_react138.default.createElement(
|
|
560968
560820
|
Text,
|
|
560969
560821
|
{ color: isSelected ? theme14.colors.menuSelected : "white" },
|
|
560970
560822
|
isSelected ? "\u276F " : " ",
|
|
560971
|
-
isMarked &&
|
|
560823
|
+
isMarked && import_react138.default.createElement(
|
|
560972
560824
|
Text,
|
|
560973
560825
|
{ color: theme14.colors.warning, bold: true },
|
|
560974
560826
|
"\u25CF",
|
|
560975
560827
|
" "
|
|
560976
560828
|
),
|
|
560977
|
-
|
|
560829
|
+
import_react138.default.createElement(Text, { color: getStatusColor(task.status) }, getStatusIcon(task.status)),
|
|
560978
560830
|
" ",
|
|
560979
560831
|
truncatedTitle
|
|
560980
560832
|
),
|
|
560981
|
-
|
|
560833
|
+
import_react138.default.createElement(
|
|
560982
560834
|
Text,
|
|
560983
560835
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
560984
560836
|
" ",
|
|
@@ -560987,25 +560839,25 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
560987
560839
|
)
|
|
560988
560840
|
);
|
|
560989
560841
|
}),
|
|
560990
|
-
hasMore &&
|
|
560842
|
+
hasMore && import_react138.default.createElement(
|
|
560991
560843
|
Text,
|
|
560992
560844
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
560993
560845
|
" ",
|
|
560994
560846
|
t.taskManager.moreBelow.replace("{count}", String(tasks.length - scrollOffset - VISIBLE_ITEMS2))
|
|
560995
560847
|
)
|
|
560996
560848
|
),
|
|
560997
|
-
(pendingAction == null ? void 0 : pendingAction.type) === "delete" &&
|
|
560849
|
+
(pendingAction == null ? void 0 : pendingAction.type) === "delete" && import_react138.default.createElement(
|
|
560998
560850
|
Box_default,
|
|
560999
560851
|
{ marginTop: 1 },
|
|
561000
|
-
|
|
560852
|
+
import_react138.default.createElement(Alert, { variant: "warning" }, pendingAction.taskId ? t.taskManager.deleteConfirm : t.taskManager.deleteMultipleConfirm.replace("{count}", String(markedTasks.size)))
|
|
561001
560853
|
)
|
|
561002
560854
|
);
|
|
561003
560855
|
}
|
|
561004
|
-
var
|
|
560856
|
+
var import_react138;
|
|
561005
560857
|
var init_TaskManagerScreen = __esm({
|
|
561006
560858
|
async "dist/ui/pages/TaskManagerScreen.js"() {
|
|
561007
560859
|
"use strict";
|
|
561008
|
-
|
|
560860
|
+
import_react138 = __toESM(require_react(), 1);
|
|
561009
560861
|
await init_build2();
|
|
561010
560862
|
await init_build4();
|
|
561011
560863
|
init_ThemeContext();
|
|
@@ -561072,7 +560924,7 @@ function getSystemEditor2() {
|
|
|
561072
560924
|
return null;
|
|
561073
560925
|
}
|
|
561074
560926
|
function MCPConfigScreen({ onBack }) {
|
|
561075
|
-
(0,
|
|
560927
|
+
(0, import_react139.useEffect)(() => {
|
|
561076
560928
|
const openEditor = async () => {
|
|
561077
560929
|
const config3 = getMCPConfig();
|
|
561078
560930
|
writeFileSync14(MCP_CONFIG_FILE2, JSON.stringify(config3, null, 2), "utf8");
|
|
@@ -561142,26 +560994,274 @@ function MCPConfigScreen({ onBack }) {
|
|
|
561142
560994
|
}, [onBack]);
|
|
561143
560995
|
return null;
|
|
561144
560996
|
}
|
|
561145
|
-
var
|
|
560997
|
+
var import_react139, CONFIG_DIR9, MCP_CONFIG_FILE2;
|
|
561146
560998
|
var init_MCPConfigScreen = __esm({
|
|
561147
560999
|
"dist/ui/pages/MCPConfigScreen.js"() {
|
|
561148
561000
|
"use strict";
|
|
561149
|
-
|
|
561001
|
+
import_react139 = __toESM(require_react(), 1);
|
|
561150
561002
|
init_apiConfig();
|
|
561151
561003
|
CONFIG_DIR9 = join29(homedir18(), ".snow");
|
|
561152
561004
|
MCP_CONFIG_FILE2 = join29(CONFIG_DIR9, "mcp-config.json");
|
|
561153
561005
|
}
|
|
561154
561006
|
});
|
|
561155
561007
|
|
|
561008
|
+
// dist/ui/components/panels/HelpPanel.js
|
|
561009
|
+
function HelpPanel() {
|
|
561010
|
+
const pasteKey = getPasteKey();
|
|
561011
|
+
const { t } = useI18n();
|
|
561012
|
+
return import_react140.default.createElement(
|
|
561013
|
+
Box_default,
|
|
561014
|
+
{ flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1 },
|
|
561015
|
+
import_react140.default.createElement(
|
|
561016
|
+
Box_default,
|
|
561017
|
+
{ marginBottom: 1 },
|
|
561018
|
+
import_react140.default.createElement(Text, { bold: true, color: "cyan" }, t.helpPanel.title)
|
|
561019
|
+
),
|
|
561020
|
+
import_react140.default.createElement(
|
|
561021
|
+
Box_default,
|
|
561022
|
+
{ flexDirection: "column", marginBottom: 1 },
|
|
561023
|
+
import_react140.default.createElement(Text, { bold: true, color: "yellow" }, t.helpPanel.textEditingTitle),
|
|
561024
|
+
import_react140.default.createElement(
|
|
561025
|
+
Text,
|
|
561026
|
+
null,
|
|
561027
|
+
" \u2022 ",
|
|
561028
|
+
t.helpPanel.deleteToStart
|
|
561029
|
+
),
|
|
561030
|
+
import_react140.default.createElement(
|
|
561031
|
+
Text,
|
|
561032
|
+
null,
|
|
561033
|
+
" \u2022 ",
|
|
561034
|
+
t.helpPanel.deleteToEnd
|
|
561035
|
+
),
|
|
561036
|
+
import_react140.default.createElement(
|
|
561037
|
+
Text,
|
|
561038
|
+
null,
|
|
561039
|
+
" ",
|
|
561040
|
+
"\u2022 ",
|
|
561041
|
+
t.helpPanel.pasteImages.replace("{pasteKey}", pasteKey)
|
|
561042
|
+
)
|
|
561043
|
+
),
|
|
561044
|
+
import_react140.default.createElement(
|
|
561045
|
+
Box_default,
|
|
561046
|
+
{ flexDirection: "column", marginBottom: 1 },
|
|
561047
|
+
import_react140.default.createElement(Text, { bold: true, color: "cyan" }, t.helpPanel.readlineTitle),
|
|
561048
|
+
import_react140.default.createElement(
|
|
561049
|
+
Text,
|
|
561050
|
+
null,
|
|
561051
|
+
" \u2022 ",
|
|
561052
|
+
t.helpPanel.moveToLineStart
|
|
561053
|
+
),
|
|
561054
|
+
import_react140.default.createElement(
|
|
561055
|
+
Text,
|
|
561056
|
+
null,
|
|
561057
|
+
" \u2022 ",
|
|
561058
|
+
t.helpPanel.moveToLineEnd
|
|
561059
|
+
),
|
|
561060
|
+
import_react140.default.createElement(
|
|
561061
|
+
Text,
|
|
561062
|
+
null,
|
|
561063
|
+
" \u2022 ",
|
|
561064
|
+
t.helpPanel.forwardWord
|
|
561065
|
+
),
|
|
561066
|
+
import_react140.default.createElement(
|
|
561067
|
+
Text,
|
|
561068
|
+
null,
|
|
561069
|
+
" \u2022 ",
|
|
561070
|
+
t.helpPanel.backwardWord
|
|
561071
|
+
),
|
|
561072
|
+
import_react140.default.createElement(
|
|
561073
|
+
Text,
|
|
561074
|
+
null,
|
|
561075
|
+
" \u2022 ",
|
|
561076
|
+
t.helpPanel.deleteToLineEnd
|
|
561077
|
+
),
|
|
561078
|
+
import_react140.default.createElement(
|
|
561079
|
+
Text,
|
|
561080
|
+
null,
|
|
561081
|
+
" \u2022 ",
|
|
561082
|
+
t.helpPanel.deleteToLineStart
|
|
561083
|
+
),
|
|
561084
|
+
import_react140.default.createElement(
|
|
561085
|
+
Text,
|
|
561086
|
+
null,
|
|
561087
|
+
" \u2022 ",
|
|
561088
|
+
t.helpPanel.deleteWord
|
|
561089
|
+
),
|
|
561090
|
+
import_react140.default.createElement(
|
|
561091
|
+
Text,
|
|
561092
|
+
null,
|
|
561093
|
+
" \u2022 ",
|
|
561094
|
+
t.helpPanel.deleteChar
|
|
561095
|
+
)
|
|
561096
|
+
),
|
|
561097
|
+
import_react140.default.createElement(
|
|
561098
|
+
Box_default,
|
|
561099
|
+
{ flexDirection: "column", marginBottom: 1 },
|
|
561100
|
+
import_react140.default.createElement(Text, { bold: true, color: "green" }, t.helpPanel.quickAccessTitle),
|
|
561101
|
+
import_react140.default.createElement(
|
|
561102
|
+
Text,
|
|
561103
|
+
null,
|
|
561104
|
+
" \u2022 ",
|
|
561105
|
+
t.helpPanel.insertFiles
|
|
561106
|
+
),
|
|
561107
|
+
import_react140.default.createElement(
|
|
561108
|
+
Text,
|
|
561109
|
+
null,
|
|
561110
|
+
" \u2022 ",
|
|
561111
|
+
t.helpPanel.searchContent
|
|
561112
|
+
),
|
|
561113
|
+
import_react140.default.createElement(
|
|
561114
|
+
Text,
|
|
561115
|
+
null,
|
|
561116
|
+
" \u2022 ",
|
|
561117
|
+
t.helpPanel.selectAgent
|
|
561118
|
+
),
|
|
561119
|
+
import_react140.default.createElement(
|
|
561120
|
+
Text,
|
|
561121
|
+
null,
|
|
561122
|
+
" \u2022 ",
|
|
561123
|
+
t.helpPanel.showCommands
|
|
561124
|
+
)
|
|
561125
|
+
),
|
|
561126
|
+
import_react140.default.createElement(
|
|
561127
|
+
Box_default,
|
|
561128
|
+
{ flexDirection: "column", marginBottom: 1 },
|
|
561129
|
+
import_react140.default.createElement(Text, { bold: true, color: "yellow" }, t.helpPanel.bashModeTitle),
|
|
561130
|
+
import_react140.default.createElement(
|
|
561131
|
+
Text,
|
|
561132
|
+
null,
|
|
561133
|
+
" \u2022 ",
|
|
561134
|
+
t.helpPanel.bashModeTrigger
|
|
561135
|
+
),
|
|
561136
|
+
import_react140.default.createElement(
|
|
561137
|
+
Text,
|
|
561138
|
+
{ dimColor: true },
|
|
561139
|
+
" ",
|
|
561140
|
+
t.helpPanel.bashModeDesc
|
|
561141
|
+
)
|
|
561142
|
+
),
|
|
561143
|
+
import_react140.default.createElement(
|
|
561144
|
+
Box_default,
|
|
561145
|
+
{ flexDirection: "column", marginBottom: 1 },
|
|
561146
|
+
import_react140.default.createElement(Text, { bold: true, color: "blue" }, t.helpPanel.navigationTitle),
|
|
561147
|
+
import_react140.default.createElement(
|
|
561148
|
+
Text,
|
|
561149
|
+
null,
|
|
561150
|
+
" \u2022 ",
|
|
561151
|
+
t.helpPanel.navigateHistory
|
|
561152
|
+
),
|
|
561153
|
+
import_react140.default.createElement(
|
|
561154
|
+
Text,
|
|
561155
|
+
null,
|
|
561156
|
+
" \u2022 ",
|
|
561157
|
+
t.helpPanel.selectItem
|
|
561158
|
+
),
|
|
561159
|
+
import_react140.default.createElement(
|
|
561160
|
+
Text,
|
|
561161
|
+
null,
|
|
561162
|
+
" \u2022 ",
|
|
561163
|
+
t.helpPanel.cancelClose
|
|
561164
|
+
),
|
|
561165
|
+
import_react140.default.createElement(
|
|
561166
|
+
Text,
|
|
561167
|
+
null,
|
|
561168
|
+
" \u2022 ",
|
|
561169
|
+
t.helpPanel.toggleYolo
|
|
561170
|
+
)
|
|
561171
|
+
),
|
|
561172
|
+
import_react140.default.createElement(
|
|
561173
|
+
Box_default,
|
|
561174
|
+
{ flexDirection: "column" },
|
|
561175
|
+
import_react140.default.createElement(Text, { bold: true, color: "magenta" }, t.helpPanel.tipsTitle),
|
|
561176
|
+
import_react140.default.createElement(
|
|
561177
|
+
Text,
|
|
561178
|
+
null,
|
|
561179
|
+
" \u2022 ",
|
|
561180
|
+
t.helpPanel.tipUseHelp
|
|
561181
|
+
),
|
|
561182
|
+
import_react140.default.createElement(
|
|
561183
|
+
Text,
|
|
561184
|
+
null,
|
|
561185
|
+
" \u2022 ",
|
|
561186
|
+
t.helpPanel.tipShowCommands
|
|
561187
|
+
),
|
|
561188
|
+
import_react140.default.createElement(
|
|
561189
|
+
Text,
|
|
561190
|
+
null,
|
|
561191
|
+
" \u2022 ",
|
|
561192
|
+
t.helpPanel.tipInterrupt
|
|
561193
|
+
)
|
|
561194
|
+
),
|
|
561195
|
+
import_react140.default.createElement(
|
|
561196
|
+
Box_default,
|
|
561197
|
+
{ marginTop: 1 },
|
|
561198
|
+
import_react140.default.createElement(Text, { dimColor: true, color: "gray" }, t.helpPanel.closeHint)
|
|
561199
|
+
)
|
|
561200
|
+
);
|
|
561201
|
+
}
|
|
561202
|
+
var import_react140, getPasteKey;
|
|
561203
|
+
var init_HelpPanel = __esm({
|
|
561204
|
+
async "dist/ui/components/panels/HelpPanel.js"() {
|
|
561205
|
+
"use strict";
|
|
561206
|
+
import_react140 = __toESM(require_react(), 1);
|
|
561207
|
+
await init_build2();
|
|
561208
|
+
init_i18n();
|
|
561209
|
+
getPasteKey = () => {
|
|
561210
|
+
return process.platform === "darwin" ? "Ctrl+V" : "Alt+V";
|
|
561211
|
+
};
|
|
561212
|
+
}
|
|
561213
|
+
});
|
|
561214
|
+
|
|
561215
|
+
// dist/ui/pages/HelpScreen.js
|
|
561216
|
+
var HelpScreen_exports = {};
|
|
561217
|
+
__export(HelpScreen_exports, {
|
|
561218
|
+
default: () => HelpScreen
|
|
561219
|
+
});
|
|
561220
|
+
function HelpScreen({ onBackDestination = "chat" }) {
|
|
561221
|
+
const { theme: theme14 } = useTheme();
|
|
561222
|
+
const { t } = useI18n();
|
|
561223
|
+
use_input_default((input2, key) => {
|
|
561224
|
+
if (key.escape) {
|
|
561225
|
+
navigateTo(onBackDestination);
|
|
561226
|
+
return;
|
|
561227
|
+
}
|
|
561228
|
+
if (input2 === "q" || input2 === "Q") {
|
|
561229
|
+
navigateTo(onBackDestination);
|
|
561230
|
+
}
|
|
561231
|
+
});
|
|
561232
|
+
return import_react141.default.createElement(
|
|
561233
|
+
Box_default,
|
|
561234
|
+
{ paddingX: 1, flexDirection: "column" },
|
|
561235
|
+
import_react141.default.createElement(HelpPanel, null),
|
|
561236
|
+
import_react141.default.createElement(
|
|
561237
|
+
Box_default,
|
|
561238
|
+
{ marginTop: 1 },
|
|
561239
|
+
import_react141.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.pressEscToClose)
|
|
561240
|
+
)
|
|
561241
|
+
);
|
|
561242
|
+
}
|
|
561243
|
+
var import_react141;
|
|
561244
|
+
var init_HelpScreen = __esm({
|
|
561245
|
+
async "dist/ui/pages/HelpScreen.js"() {
|
|
561246
|
+
"use strict";
|
|
561247
|
+
import_react141 = __toESM(require_react(), 1);
|
|
561248
|
+
await init_build2();
|
|
561249
|
+
init_ThemeContext();
|
|
561250
|
+
init_I18nContext();
|
|
561251
|
+
await init_HelpPanel();
|
|
561252
|
+
init_useGlobalNavigation();
|
|
561253
|
+
}
|
|
561254
|
+
});
|
|
561255
|
+
|
|
561156
561256
|
// dist/app.js
|
|
561157
561257
|
var app_exports = {};
|
|
561158
561258
|
__export(app_exports, {
|
|
561159
561259
|
default: () => App2
|
|
561160
561260
|
});
|
|
561161
561261
|
function ShowTaskListWrapper() {
|
|
561162
|
-
const [currentView, setCurrentView] = (0,
|
|
561163
|
-
const [chatScreenKey, setChatScreenKey] = (0,
|
|
561164
|
-
const [exitNotification, setExitNotification] = (0,
|
|
561262
|
+
const [currentView, setCurrentView] = (0, import_react142.useState)("tasks");
|
|
561263
|
+
const [chatScreenKey, setChatScreenKey] = (0, import_react142.useState)(0);
|
|
561264
|
+
const [exitNotification, setExitNotification] = (0, import_react142.useState)({
|
|
561165
561265
|
show: false,
|
|
561166
561266
|
message: ""
|
|
561167
561267
|
});
|
|
@@ -561171,45 +561271,45 @@ function ShowTaskListWrapper() {
|
|
|
561171
561271
|
useGlobalExit(setExitNotification);
|
|
561172
561272
|
const renderView = () => {
|
|
561173
561273
|
if (currentView === "chat") {
|
|
561174
|
-
return
|
|
561175
|
-
|
|
561274
|
+
return import_react142.default.createElement(
|
|
561275
|
+
import_react142.Suspense,
|
|
561176
561276
|
{ fallback: loadingFallback },
|
|
561177
|
-
|
|
561277
|
+
import_react142.default.createElement(ChatScreen2, { key: chatScreenKey, autoResume: true, enableYolo: false })
|
|
561178
561278
|
);
|
|
561179
561279
|
}
|
|
561180
|
-
return
|
|
561181
|
-
|
|
561280
|
+
return import_react142.default.createElement(
|
|
561281
|
+
import_react142.Suspense,
|
|
561182
561282
|
{ fallback: loadingFallback },
|
|
561183
|
-
|
|
561283
|
+
import_react142.default.createElement(TaskManagerScreen2, { onBack: () => gracefulExit(), onResumeTask: () => {
|
|
561184
561284
|
setCurrentView("chat");
|
|
561185
561285
|
setChatScreenKey((prev) => prev + 1);
|
|
561186
561286
|
} })
|
|
561187
561287
|
);
|
|
561188
561288
|
};
|
|
561189
|
-
return
|
|
561289
|
+
return import_react142.default.createElement(
|
|
561190
561290
|
Box_default,
|
|
561191
561291
|
{ flexDirection: "column", width: terminalWidth },
|
|
561192
561292
|
renderView(),
|
|
561193
|
-
exitNotification.show &&
|
|
561293
|
+
exitNotification.show && import_react142.default.createElement(
|
|
561194
561294
|
Box_default,
|
|
561195
561295
|
{ paddingX: 1, flexShrink: 0 },
|
|
561196
|
-
|
|
561296
|
+
import_react142.default.createElement(Alert, { variant: "warning" }, exitNotification.message)
|
|
561197
561297
|
)
|
|
561198
561298
|
);
|
|
561199
561299
|
}
|
|
561200
561300
|
function AppContent({ version: version3, skipWelcome, autoResume, enableYolo, enablePlan }) {
|
|
561201
|
-
const [currentView, setCurrentView] = (0,
|
|
561202
|
-
const [chatScreenKey, setChatScreenKey] = (0,
|
|
561203
|
-
const [welcomeMenuIndex, setWelcomeMenuIndex] = (0,
|
|
561204
|
-
const [shouldAutoResume, setShouldAutoResume] = (0,
|
|
561205
|
-
const [exitNotification, setExitNotification] = (0,
|
|
561301
|
+
const [currentView, setCurrentView] = (0, import_react142.useState)(skipWelcome ? "chat" : "welcome");
|
|
561302
|
+
const [chatScreenKey, setChatScreenKey] = (0, import_react142.useState)(0);
|
|
561303
|
+
const [welcomeMenuIndex, setWelcomeMenuIndex] = (0, import_react142.useState)(0);
|
|
561304
|
+
const [shouldAutoResume, setShouldAutoResume] = (0, import_react142.useState)(false);
|
|
561305
|
+
const [exitNotification, setExitNotification] = (0, import_react142.useState)({
|
|
561206
561306
|
show: false,
|
|
561207
561307
|
message: ""
|
|
561208
561308
|
});
|
|
561209
561309
|
const { columns: terminalWidth } = useTerminalSize();
|
|
561210
561310
|
useCursorHide();
|
|
561211
561311
|
useGlobalExit(setExitNotification);
|
|
561212
|
-
(0,
|
|
561312
|
+
(0, import_react142.useEffect)(() => {
|
|
561213
561313
|
const unsubscribe = onNavigate((event) => {
|
|
561214
561314
|
if (event.destination === "welcome" && currentView === "chat") {
|
|
561215
561315
|
setChatScreenKey((prev) => prev + 1);
|
|
@@ -561237,113 +561337,119 @@ function AppContent({ version: version3, skipWelcome, autoResume, enableYolo, en
|
|
|
561237
561337
|
const loadingFallback = null;
|
|
561238
561338
|
switch (currentView) {
|
|
561239
561339
|
case "welcome":
|
|
561240
|
-
return
|
|
561241
|
-
|
|
561340
|
+
return import_react142.default.createElement(
|
|
561341
|
+
import_react142.Suspense,
|
|
561242
561342
|
{ fallback: loadingFallback },
|
|
561243
|
-
|
|
561343
|
+
import_react142.default.createElement(WelcomeScreen2, { version: version3, onMenuSelect: handleMenuSelect, defaultMenuIndex: welcomeMenuIndex, onMenuSelectionPersist: setWelcomeMenuIndex })
|
|
561244
561344
|
);
|
|
561245
561345
|
case "chat":
|
|
561246
|
-
return
|
|
561247
|
-
|
|
561346
|
+
return import_react142.default.createElement(
|
|
561347
|
+
import_react142.Suspense,
|
|
561248
561348
|
{ fallback: loadingFallback },
|
|
561249
|
-
|
|
561349
|
+
import_react142.default.createElement(ChatScreen2, { key: chatScreenKey, autoResume: autoResume || shouldAutoResume, enableYolo, enablePlan })
|
|
561250
561350
|
);
|
|
561251
561351
|
case "settings":
|
|
561252
|
-
return
|
|
561352
|
+
return import_react142.default.createElement(
|
|
561253
561353
|
Box_default,
|
|
561254
561354
|
{ flexDirection: "column" },
|
|
561255
|
-
|
|
561256
|
-
|
|
561355
|
+
import_react142.default.createElement(Text, { color: "blue" }, "Settings"),
|
|
561356
|
+
import_react142.default.createElement(Text, { color: "gray" }, "Settings interface would be implemented here")
|
|
561257
561357
|
);
|
|
561258
561358
|
case "mcp":
|
|
561259
|
-
return
|
|
561260
|
-
|
|
561359
|
+
return import_react142.default.createElement(
|
|
561360
|
+
import_react142.Suspense,
|
|
561261
561361
|
{ fallback: loadingFallback },
|
|
561262
|
-
|
|
561362
|
+
import_react142.default.createElement(MCPConfigScreen2, { onBack: () => setCurrentView("welcome"), onSave: () => setCurrentView("welcome") })
|
|
561263
561363
|
);
|
|
561264
561364
|
case "systemprompt":
|
|
561265
|
-
return
|
|
561266
|
-
|
|
561365
|
+
return import_react142.default.createElement(
|
|
561366
|
+
import_react142.Suspense,
|
|
561367
|
+
{ fallback: loadingFallback },
|
|
561368
|
+
import_react142.default.createElement(SystemPromptConfigScreen3, { onBack: () => setCurrentView("welcome") })
|
|
561369
|
+
);
|
|
561370
|
+
case "help":
|
|
561371
|
+
return import_react142.default.createElement(
|
|
561372
|
+
import_react142.Suspense,
|
|
561267
561373
|
{ fallback: loadingFallback },
|
|
561268
|
-
|
|
561374
|
+
import_react142.default.createElement(HelpScreen2, { onBackDestination: "chat" })
|
|
561269
561375
|
);
|
|
561270
561376
|
case "customheaders":
|
|
561271
|
-
return
|
|
561272
|
-
|
|
561377
|
+
return import_react142.default.createElement(
|
|
561378
|
+
import_react142.Suspense,
|
|
561273
561379
|
{ fallback: loadingFallback },
|
|
561274
|
-
|
|
561380
|
+
import_react142.default.createElement(CustomHeadersScreen3, { onBack: () => setCurrentView("welcome") })
|
|
561275
561381
|
);
|
|
561276
561382
|
case "tasks":
|
|
561277
|
-
return
|
|
561278
|
-
|
|
561383
|
+
return import_react142.default.createElement(
|
|
561384
|
+
import_react142.Suspense,
|
|
561279
561385
|
{ fallback: loadingFallback },
|
|
561280
|
-
|
|
561386
|
+
import_react142.default.createElement(TaskManagerScreen2, { onBack: () => setCurrentView("welcome"), onResumeTask: () => {
|
|
561281
561387
|
setCurrentView("chat");
|
|
561282
561388
|
setChatScreenKey((prev) => prev + 1);
|
|
561283
561389
|
} })
|
|
561284
561390
|
);
|
|
561285
561391
|
default:
|
|
561286
|
-
return
|
|
561287
|
-
|
|
561392
|
+
return import_react142.default.createElement(
|
|
561393
|
+
import_react142.Suspense,
|
|
561288
561394
|
{ fallback: loadingFallback },
|
|
561289
|
-
|
|
561395
|
+
import_react142.default.createElement(WelcomeScreen2, { version: version3, onMenuSelect: handleMenuSelect, defaultMenuIndex: welcomeMenuIndex, onMenuSelectionPersist: setWelcomeMenuIndex })
|
|
561290
561396
|
);
|
|
561291
561397
|
}
|
|
561292
561398
|
};
|
|
561293
|
-
return
|
|
561399
|
+
return import_react142.default.createElement(
|
|
561294
561400
|
Box_default,
|
|
561295
561401
|
{ flexDirection: "column", width: terminalWidth },
|
|
561296
561402
|
renderView(),
|
|
561297
|
-
exitNotification.show &&
|
|
561403
|
+
exitNotification.show && import_react142.default.createElement(
|
|
561298
561404
|
Box_default,
|
|
561299
561405
|
{ paddingX: 1, flexShrink: 0 },
|
|
561300
|
-
|
|
561406
|
+
import_react142.default.createElement(Alert, { variant: "warning" }, exitNotification.message)
|
|
561301
561407
|
)
|
|
561302
561408
|
);
|
|
561303
561409
|
}
|
|
561304
561410
|
function App2({ version: version3, skipWelcome, autoResume, headlessPrompt, headlessSessionId, showTaskList, enableYolo, enablePlan }) {
|
|
561305
561411
|
if (headlessPrompt) {
|
|
561306
561412
|
const loadingFallback = null;
|
|
561307
|
-
return
|
|
561413
|
+
return import_react142.default.createElement(
|
|
561308
561414
|
I18nProvider,
|
|
561309
561415
|
null,
|
|
561310
|
-
|
|
561416
|
+
import_react142.default.createElement(
|
|
561311
561417
|
ThemeProvider,
|
|
561312
561418
|
null,
|
|
561313
|
-
|
|
561314
|
-
|
|
561419
|
+
import_react142.default.createElement(
|
|
561420
|
+
import_react142.Suspense,
|
|
561315
561421
|
{ fallback: loadingFallback },
|
|
561316
|
-
|
|
561422
|
+
import_react142.default.createElement(HeadlessModeScreen2, { prompt: headlessPrompt, sessionId: headlessSessionId, onComplete: () => gracefulExit() })
|
|
561317
561423
|
)
|
|
561318
561424
|
)
|
|
561319
561425
|
);
|
|
561320
561426
|
}
|
|
561321
561427
|
if (showTaskList) {
|
|
561322
|
-
return
|
|
561428
|
+
return import_react142.default.createElement(
|
|
561323
561429
|
I18nProvider,
|
|
561324
561430
|
null,
|
|
561325
|
-
|
|
561431
|
+
import_react142.default.createElement(
|
|
561326
561432
|
ThemeProvider,
|
|
561327
561433
|
null,
|
|
561328
|
-
|
|
561434
|
+
import_react142.default.createElement(ShowTaskListWrapper, null)
|
|
561329
561435
|
)
|
|
561330
561436
|
);
|
|
561331
561437
|
}
|
|
561332
|
-
return
|
|
561438
|
+
return import_react142.default.createElement(
|
|
561333
561439
|
I18nProvider,
|
|
561334
561440
|
null,
|
|
561335
|
-
|
|
561441
|
+
import_react142.default.createElement(
|
|
561336
561442
|
ThemeProvider,
|
|
561337
561443
|
null,
|
|
561338
|
-
|
|
561444
|
+
import_react142.default.createElement(AppContent, { version: version3, skipWelcome, autoResume, enableYolo, enablePlan })
|
|
561339
561445
|
)
|
|
561340
561446
|
);
|
|
561341
561447
|
}
|
|
561342
|
-
var
|
|
561448
|
+
var import_react142, WelcomeScreen2, ChatScreen2, HeadlessModeScreen2, TaskManagerScreen2, MCPConfigScreen2, SystemPromptConfigScreen3, CustomHeadersScreen3, HelpScreen2;
|
|
561343
561449
|
var init_app = __esm({
|
|
561344
561450
|
async "dist/app.js"() {
|
|
561345
561451
|
"use strict";
|
|
561346
|
-
|
|
561452
|
+
import_react142 = __toESM(require_react(), 1);
|
|
561347
561453
|
await init_build2();
|
|
561348
561454
|
await init_build4();
|
|
561349
561455
|
await init_useCursorHide();
|
|
@@ -561354,13 +561460,14 @@ var init_app = __esm({
|
|
|
561354
561460
|
init_ThemeContext();
|
|
561355
561461
|
init_processManager();
|
|
561356
561462
|
init_apiConfig();
|
|
561357
|
-
WelcomeScreen2 =
|
|
561358
|
-
ChatScreen2 =
|
|
561359
|
-
HeadlessModeScreen2 =
|
|
561360
|
-
TaskManagerScreen2 =
|
|
561361
|
-
MCPConfigScreen2 =
|
|
561362
|
-
SystemPromptConfigScreen3 =
|
|
561363
|
-
CustomHeadersScreen3 =
|
|
561463
|
+
WelcomeScreen2 = import_react142.default.lazy(() => init_WelcomeScreen().then(() => WelcomeScreen_exports));
|
|
561464
|
+
ChatScreen2 = import_react142.default.lazy(() => init_ChatScreen().then(() => ChatScreen_exports));
|
|
561465
|
+
HeadlessModeScreen2 = import_react142.default.lazy(() => init_HeadlessModeScreen().then(() => HeadlessModeScreen_exports));
|
|
561466
|
+
TaskManagerScreen2 = import_react142.default.lazy(() => init_TaskManagerScreen().then(() => TaskManagerScreen_exports));
|
|
561467
|
+
MCPConfigScreen2 = import_react142.default.lazy(() => Promise.resolve().then(() => (init_MCPConfigScreen(), MCPConfigScreen_exports)));
|
|
561468
|
+
SystemPromptConfigScreen3 = import_react142.default.lazy(() => init_SystemPromptConfigScreen().then(() => SystemPromptConfigScreen_exports));
|
|
561469
|
+
CustomHeadersScreen3 = import_react142.default.lazy(() => init_CustomHeadersScreen().then(() => CustomHeadersScreen_exports));
|
|
561470
|
+
HelpScreen2 = import_react142.default.lazy(() => init_HelpScreen().then(() => HelpScreen_exports));
|
|
561364
561471
|
}
|
|
561365
561472
|
});
|
|
561366
561473
|
|
|
@@ -562985,17 +563092,17 @@ var SSEServerStatus_exports = {};
|
|
|
562985
563092
|
__export(SSEServerStatus_exports, {
|
|
562986
563093
|
SSEServerStatus: () => SSEServerStatus
|
|
562987
563094
|
});
|
|
562988
|
-
var
|
|
563095
|
+
var import_react143, SSEServerStatus;
|
|
562989
563096
|
var init_SSEServerStatus = __esm({
|
|
562990
563097
|
async "dist/ui/components/sse/SSEServerStatus.js"() {
|
|
562991
563098
|
"use strict";
|
|
562992
|
-
|
|
563099
|
+
import_react143 = __toESM(require_react(), 1);
|
|
562993
563100
|
await init_build2();
|
|
562994
563101
|
init_I18nContext();
|
|
562995
563102
|
SSEServerStatus = ({ port, workingDir, onLogUpdate }) => {
|
|
562996
563103
|
const { t } = useI18n();
|
|
562997
|
-
const [logs, setLogs] = (0,
|
|
562998
|
-
(0,
|
|
563104
|
+
const [logs, setLogs] = (0, import_react143.useState)([]);
|
|
563105
|
+
(0, import_react143.useEffect)(() => {
|
|
562999
563106
|
if (onLogUpdate) {
|
|
563000
563107
|
onLogUpdate((message, level = "info") => {
|
|
563001
563108
|
const timestamp = (/* @__PURE__ */ new Date()).toLocaleTimeString("zh-CN", {
|
|
@@ -563015,89 +563122,89 @@ var init_SSEServerStatus = __esm({
|
|
|
563015
563122
|
return "gray";
|
|
563016
563123
|
}
|
|
563017
563124
|
};
|
|
563018
|
-
return
|
|
563125
|
+
return import_react143.default.createElement(
|
|
563019
563126
|
Box_default,
|
|
563020
563127
|
{ flexDirection: "column" },
|
|
563021
|
-
|
|
563128
|
+
import_react143.default.createElement(
|
|
563022
563129
|
Box_default,
|
|
563023
563130
|
null,
|
|
563024
|
-
|
|
563131
|
+
import_react143.default.createElement(Text, { bold: true, color: "green" }, t.sseServer.started)
|
|
563025
563132
|
),
|
|
563026
|
-
|
|
563133
|
+
import_react143.default.createElement(
|
|
563027
563134
|
Box_default,
|
|
563028
563135
|
null,
|
|
563029
|
-
|
|
563136
|
+
import_react143.default.createElement(
|
|
563030
563137
|
Text,
|
|
563031
563138
|
null,
|
|
563032
563139
|
t.sseServer.port,
|
|
563033
563140
|
": "
|
|
563034
563141
|
),
|
|
563035
|
-
|
|
563036
|
-
workingDir &&
|
|
563037
|
-
|
|
563142
|
+
import_react143.default.createElement(Text, { color: "cyan" }, port),
|
|
563143
|
+
workingDir && import_react143.default.createElement(
|
|
563144
|
+
import_react143.default.Fragment,
|
|
563038
563145
|
null,
|
|
563039
|
-
|
|
563146
|
+
import_react143.default.createElement(
|
|
563040
563147
|
Text,
|
|
563041
563148
|
null,
|
|
563042
563149
|
" | ",
|
|
563043
563150
|
t.sseServer.workingDir,
|
|
563044
563151
|
": "
|
|
563045
563152
|
),
|
|
563046
|
-
|
|
563153
|
+
import_react143.default.createElement(Text, { color: "yellow" }, workingDir)
|
|
563047
563154
|
),
|
|
563048
|
-
|
|
563049
|
-
|
|
563155
|
+
import_react143.default.createElement(Text, null, " | "),
|
|
563156
|
+
import_react143.default.createElement(
|
|
563050
563157
|
Text,
|
|
563051
563158
|
{ color: "green" },
|
|
563052
563159
|
"\u25CF ",
|
|
563053
563160
|
t.sseServer.running
|
|
563054
563161
|
)
|
|
563055
563162
|
),
|
|
563056
|
-
|
|
563163
|
+
import_react143.default.createElement(
|
|
563057
563164
|
Box_default,
|
|
563058
563165
|
{ flexDirection: "column" },
|
|
563059
|
-
|
|
563166
|
+
import_react143.default.createElement(
|
|
563060
563167
|
Text,
|
|
563061
563168
|
{ dimColor: true },
|
|
563062
563169
|
t.sseServer.endpoints,
|
|
563063
563170
|
":"
|
|
563064
563171
|
),
|
|
563065
|
-
|
|
563172
|
+
import_react143.default.createElement(
|
|
563066
563173
|
Text,
|
|
563067
563174
|
{ color: "blue" },
|
|
563068
563175
|
" http://localhost:",
|
|
563069
563176
|
port,
|
|
563070
563177
|
"/events"
|
|
563071
563178
|
),
|
|
563072
|
-
|
|
563179
|
+
import_react143.default.createElement(
|
|
563073
563180
|
Text,
|
|
563074
563181
|
{ color: "blue" },
|
|
563075
563182
|
" POST http://localhost:",
|
|
563076
563183
|
port,
|
|
563077
563184
|
"/message"
|
|
563078
563185
|
),
|
|
563079
|
-
|
|
563186
|
+
import_react143.default.createElement(
|
|
563080
563187
|
Text,
|
|
563081
563188
|
{ color: "blue" },
|
|
563082
563189
|
" POST http://localhost:",
|
|
563083
563190
|
port,
|
|
563084
563191
|
"/session/create"
|
|
563085
563192
|
),
|
|
563086
|
-
|
|
563193
|
+
import_react143.default.createElement(
|
|
563087
563194
|
Text,
|
|
563088
563195
|
{ color: "blue" },
|
|
563089
563196
|
" POST http://localhost:",
|
|
563090
563197
|
port,
|
|
563091
563198
|
"/session/load"
|
|
563092
563199
|
),
|
|
563093
|
-
|
|
563200
|
+
import_react143.default.createElement(
|
|
563094
563201
|
Text,
|
|
563095
563202
|
{ color: "blue" },
|
|
563096
563203
|
" GET http://localhost:",
|
|
563097
563204
|
port,
|
|
563098
563205
|
"/session/list"
|
|
563099
563206
|
),
|
|
563100
|
-
|
|
563207
|
+
import_react143.default.createElement(
|
|
563101
563208
|
Text,
|
|
563102
563209
|
{ color: "blue" },
|
|
563103
563210
|
" ",
|
|
@@ -563105,7 +563212,7 @@ var init_SSEServerStatus = __esm({
|
|
|
563105
563212
|
port,
|
|
563106
563213
|
"/session/rollback-points?sessionId=:sessionId"
|
|
563107
563214
|
),
|
|
563108
|
-
|
|
563215
|
+
import_react143.default.createElement(
|
|
563109
563216
|
Text,
|
|
563110
563217
|
{ color: "blue" },
|
|
563111
563218
|
" ",
|
|
@@ -563113,14 +563220,14 @@ var init_SSEServerStatus = __esm({
|
|
|
563113
563220
|
port,
|
|
563114
563221
|
"/session/:sessionId"
|
|
563115
563222
|
),
|
|
563116
|
-
|
|
563223
|
+
import_react143.default.createElement(
|
|
563117
563224
|
Text,
|
|
563118
563225
|
{ color: "blue" },
|
|
563119
563226
|
" POST http://localhost:",
|
|
563120
563227
|
port,
|
|
563121
563228
|
"/context/compress"
|
|
563122
563229
|
),
|
|
563123
|
-
|
|
563230
|
+
import_react143.default.createElement(
|
|
563124
563231
|
Text,
|
|
563125
563232
|
{ color: "blue" },
|
|
563126
563233
|
" GET http://localhost:",
|
|
@@ -563128,10 +563235,10 @@ var init_SSEServerStatus = __esm({
|
|
|
563128
563235
|
"/health"
|
|
563129
563236
|
)
|
|
563130
563237
|
),
|
|
563131
|
-
|
|
563238
|
+
import_react143.default.createElement(
|
|
563132
563239
|
Box_default,
|
|
563133
563240
|
{ flexDirection: "column" },
|
|
563134
|
-
|
|
563241
|
+
import_react143.default.createElement(
|
|
563135
563242
|
Text,
|
|
563136
563243
|
{ dimColor: true },
|
|
563137
563244
|
t.sseServer.logs,
|
|
@@ -563139,23 +563246,23 @@ var init_SSEServerStatus = __esm({
|
|
|
563139
563246
|
logs.length,
|
|
563140
563247
|
"):"
|
|
563141
563248
|
),
|
|
563142
|
-
|
|
563249
|
+
import_react143.default.createElement(Box_default, { flexDirection: "column" }, logs.map((log, index) => import_react143.default.createElement(
|
|
563143
563250
|
Box_default,
|
|
563144
563251
|
{ key: index },
|
|
563145
|
-
|
|
563252
|
+
import_react143.default.createElement(
|
|
563146
563253
|
Text,
|
|
563147
563254
|
{ dimColor: true },
|
|
563148
563255
|
"[",
|
|
563149
563256
|
log.timestamp,
|
|
563150
563257
|
"] "
|
|
563151
563258
|
),
|
|
563152
|
-
|
|
563259
|
+
import_react143.default.createElement(Text, { color: getLevelColor(log.level) }, log.message)
|
|
563153
563260
|
)))
|
|
563154
563261
|
),
|
|
563155
|
-
|
|
563262
|
+
import_react143.default.createElement(
|
|
563156
563263
|
Box_default,
|
|
563157
563264
|
null,
|
|
563158
|
-
|
|
563265
|
+
import_react143.default.createElement(Text, { dimColor: true }, t.sseServer.stopHint)
|
|
563159
563266
|
)
|
|
563160
563267
|
);
|
|
563161
563268
|
};
|
|
@@ -563463,7 +563570,7 @@ var init_taskExecutor = __esm({
|
|
|
563463
563570
|
});
|
|
563464
563571
|
|
|
563465
563572
|
// dist/cli.js
|
|
563466
|
-
var
|
|
563573
|
+
var import_react144 = __toESM(require_react(), 1);
|
|
563467
563574
|
await init_build2();
|
|
563468
563575
|
init_updateNotice();
|
|
563469
563576
|
await init_build3();
|
|
@@ -564547,10 +564654,10 @@ if (cli.flags.sse) {
|
|
|
564547
564654
|
const { SSEServerStatus: SSEServerStatus2 } = await init_SSEServerStatus().then(() => SSEServerStatus_exports);
|
|
564548
564655
|
const { I18nProvider: I18nProvider2 } = await Promise.resolve().then(() => (init_I18nContext(), I18nContext_exports));
|
|
564549
564656
|
let logUpdater;
|
|
564550
|
-
const { unmount } = render_default(
|
|
564657
|
+
const { unmount } = render_default(import_react144.default.createElement(
|
|
564551
564658
|
I18nProvider2,
|
|
564552
564659
|
null,
|
|
564553
|
-
|
|
564660
|
+
import_react144.default.createElement(SSEServerStatus2, { port, workingDir: workDir || process.cwd(), onLogUpdate: (callback) => {
|
|
564554
564661
|
logUpdater = callback;
|
|
564555
564662
|
} })
|
|
564556
564663
|
));
|
|
@@ -564596,9 +564703,9 @@ if (cli.flags.taskExecute) {
|
|
|
564596
564703
|
process.exit(0);
|
|
564597
564704
|
}
|
|
564598
564705
|
var Startup = ({ version: version3, skipWelcome, autoResume, headlessPrompt, headlessSessionId, showTaskList, isDevMode: isDevMode2, enableYolo, enablePlan }) => {
|
|
564599
|
-
const [appReady, setAppReady] =
|
|
564600
|
-
const [AppComponent, setAppComponent] =
|
|
564601
|
-
|
|
564706
|
+
const [appReady, setAppReady] = import_react144.default.useState(false);
|
|
564707
|
+
const [AppComponent, setAppComponent] = import_react144.default.useState(null);
|
|
564708
|
+
import_react144.default.useEffect(() => {
|
|
564602
564709
|
let mounted = true;
|
|
564603
564710
|
const init = async () => {
|
|
564604
564711
|
const deps = await loadDependencies();
|
|
@@ -564644,22 +564751,22 @@ var Startup = ({ version: version3, skipWelcome, autoResume, headlessPrompt, hea
|
|
|
564644
564751
|
};
|
|
564645
564752
|
}, [version3, isDevMode2]);
|
|
564646
564753
|
if (!appReady || !AppComponent) {
|
|
564647
|
-
return
|
|
564754
|
+
return import_react144.default.createElement(
|
|
564648
564755
|
Box_default,
|
|
564649
564756
|
{ flexDirection: "column" },
|
|
564650
|
-
|
|
564757
|
+
import_react144.default.createElement(
|
|
564651
564758
|
Box_default,
|
|
564652
564759
|
null,
|
|
564653
|
-
|
|
564760
|
+
import_react144.default.createElement(
|
|
564654
564761
|
Text,
|
|
564655
564762
|
{ color: "cyan" },
|
|
564656
|
-
|
|
564763
|
+
import_react144.default.createElement(build_default, { type: "dots" })
|
|
564657
564764
|
),
|
|
564658
|
-
|
|
564765
|
+
import_react144.default.createElement(Text, null, " Loading...")
|
|
564659
564766
|
)
|
|
564660
564767
|
);
|
|
564661
564768
|
}
|
|
564662
|
-
return
|
|
564769
|
+
return import_react144.default.createElement(AppComponent, { version: version3, skipWelcome, autoResume, headlessPrompt, headlessSessionId, showTaskList, enableYolo, enablePlan });
|
|
564663
564770
|
};
|
|
564664
564771
|
process.stdout.write("\x1B[?2004l");
|
|
564665
564772
|
process.stdout.write("\x1B[2K\r");
|
|
@@ -564707,7 +564814,7 @@ process.on("SIGTERM", async () => {
|
|
|
564707
564814
|
await cleanupAsync();
|
|
564708
564815
|
process.exit(0);
|
|
564709
564816
|
});
|
|
564710
|
-
render_default(
|
|
564817
|
+
render_default(import_react144.default.createElement(Startup, { version: VERSION2, skipWelcome: Boolean(cli.flags.c || cli.flags.yolo || cli.flags.yoloP || cli.flags.cYolo), autoResume: Boolean(cli.flags.c || cli.flags.cYolo), headlessPrompt: typeof cli.flags["ask"] === "string" ? cli.flags["ask"] : void 0, headlessSessionId: cli.input[0], showTaskList: cli.flags.taskList, isDevMode: cli.flags.dev, enableYolo: Boolean(cli.flags.yolo || cli.flags.yoloP || cli.flags.cYolo), enablePlan: Boolean(cli.flags.yoloP) }), {
|
|
564711
564818
|
exitOnCtrlC: false,
|
|
564712
564819
|
patchConsole: true
|
|
564713
564820
|
});
|