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