snow-ai 0.5.1 → 0.5.3
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 +1034 -1000
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -441536,26 +441536,195 @@ var init_useTodoPicker = __esm({
|
|
|
441536
441536
|
}
|
|
441537
441537
|
});
|
|
441538
441538
|
|
|
441539
|
+
// dist/hooks/input/useBashMode.js
|
|
441540
|
+
function useBashMode() {
|
|
441541
|
+
const [state, setState] = (0, import_react86.useState)({
|
|
441542
|
+
isExecuting: false,
|
|
441543
|
+
currentCommand: null,
|
|
441544
|
+
currentTimeout: null,
|
|
441545
|
+
executionResults: /* @__PURE__ */ new Map()
|
|
441546
|
+
});
|
|
441547
|
+
const parseBashCommands = (0, import_react86.useCallback)((message) => {
|
|
441548
|
+
var _a21;
|
|
441549
|
+
const commands = [];
|
|
441550
|
+
const regex2 = /!`([^`]+)`(?:<(\d+)>)?/g;
|
|
441551
|
+
let match2;
|
|
441552
|
+
while ((match2 = regex2.exec(message)) !== null) {
|
|
441553
|
+
const command = (_a21 = match2[1]) == null ? void 0 : _a21.trim();
|
|
441554
|
+
const timeoutStr = match2[2];
|
|
441555
|
+
const timeout2 = timeoutStr ? parseInt(timeoutStr, 10) : 3e4;
|
|
441556
|
+
if (command) {
|
|
441557
|
+
commands.push({
|
|
441558
|
+
id: `cmd-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`,
|
|
441559
|
+
command,
|
|
441560
|
+
startIndex: match2.index,
|
|
441561
|
+
endIndex: match2.index + match2[0].length,
|
|
441562
|
+
timeout: timeout2
|
|
441563
|
+
});
|
|
441564
|
+
}
|
|
441565
|
+
}
|
|
441566
|
+
return commands;
|
|
441567
|
+
}, []);
|
|
441568
|
+
const checkSensitiveCommand = (0, import_react86.useCallback)((command) => {
|
|
441569
|
+
return isSensitiveCommand(command);
|
|
441570
|
+
}, []);
|
|
441571
|
+
const executeCommand2 = (0, import_react86.useCallback)(async (command, timeout2 = 3e4) => {
|
|
441572
|
+
setState((prev) => ({
|
|
441573
|
+
...prev,
|
|
441574
|
+
isExecuting: true,
|
|
441575
|
+
currentCommand: command,
|
|
441576
|
+
currentTimeout: timeout2
|
|
441577
|
+
}));
|
|
441578
|
+
return new Promise((resolve10) => {
|
|
441579
|
+
var _a21, _b14;
|
|
441580
|
+
const { spawn: spawn8 } = __require("child_process");
|
|
441581
|
+
const isWindows4 = process.platform === "win32";
|
|
441582
|
+
const shell = isWindows4 ? "cmd" : "sh";
|
|
441583
|
+
const shellArgs = isWindows4 ? ["/c", command] : ["-c", command];
|
|
441584
|
+
const child = spawn8(shell, shellArgs, {
|
|
441585
|
+
cwd: process.cwd(),
|
|
441586
|
+
timeout: timeout2,
|
|
441587
|
+
env: process.env
|
|
441588
|
+
});
|
|
441589
|
+
let stdout = "";
|
|
441590
|
+
let stderr = "";
|
|
441591
|
+
(_a21 = child.stdout) == null ? void 0 : _a21.on("data", (data) => {
|
|
441592
|
+
stdout += data.toString();
|
|
441593
|
+
});
|
|
441594
|
+
(_b14 = child.stderr) == null ? void 0 : _b14.on("data", (data) => {
|
|
441595
|
+
stderr += data.toString();
|
|
441596
|
+
});
|
|
441597
|
+
child.on("close", (code2) => {
|
|
441598
|
+
const result2 = {
|
|
441599
|
+
success: code2 === 0,
|
|
441600
|
+
stdout: stdout.trim(),
|
|
441601
|
+
stderr: stderr.trim(),
|
|
441602
|
+
command
|
|
441603
|
+
};
|
|
441604
|
+
setState((prev) => {
|
|
441605
|
+
const newResults = new Map(prev.executionResults);
|
|
441606
|
+
newResults.set(command, result2);
|
|
441607
|
+
return {
|
|
441608
|
+
...prev,
|
|
441609
|
+
isExecuting: false,
|
|
441610
|
+
currentCommand: null,
|
|
441611
|
+
currentTimeout: null,
|
|
441612
|
+
executionResults: newResults
|
|
441613
|
+
};
|
|
441614
|
+
});
|
|
441615
|
+
resolve10(result2);
|
|
441616
|
+
});
|
|
441617
|
+
child.on("error", (error) => {
|
|
441618
|
+
const result2 = {
|
|
441619
|
+
success: false,
|
|
441620
|
+
stdout: "",
|
|
441621
|
+
stderr: error.message,
|
|
441622
|
+
command
|
|
441623
|
+
};
|
|
441624
|
+
setState((prev) => {
|
|
441625
|
+
const newResults = new Map(prev.executionResults);
|
|
441626
|
+
newResults.set(command, result2);
|
|
441627
|
+
return {
|
|
441628
|
+
...prev,
|
|
441629
|
+
isExecuting: false,
|
|
441630
|
+
currentCommand: null,
|
|
441631
|
+
currentTimeout: null,
|
|
441632
|
+
executionResults: newResults
|
|
441633
|
+
};
|
|
441634
|
+
});
|
|
441635
|
+
resolve10(result2);
|
|
441636
|
+
});
|
|
441637
|
+
});
|
|
441638
|
+
}, []);
|
|
441639
|
+
const processBashMessage = (0, import_react86.useCallback)(async (message, onSensitiveCommand) => {
|
|
441640
|
+
const commands = parseBashCommands(message);
|
|
441641
|
+
if (commands.length === 0) {
|
|
441642
|
+
return {
|
|
441643
|
+
processedMessage: message,
|
|
441644
|
+
hasCommands: false,
|
|
441645
|
+
hasRejectedCommands: false,
|
|
441646
|
+
results: []
|
|
441647
|
+
};
|
|
441648
|
+
}
|
|
441649
|
+
const results = [];
|
|
441650
|
+
let processedMessage = message;
|
|
441651
|
+
let offset = 0;
|
|
441652
|
+
let hasRejectedCommands = false;
|
|
441653
|
+
for (const cmd of commands) {
|
|
441654
|
+
const sensitiveCheck = checkSensitiveCommand(cmd.command);
|
|
441655
|
+
if (sensitiveCheck.isSensitive && onSensitiveCommand) {
|
|
441656
|
+
const shouldContinue = await onSensitiveCommand(cmd.command);
|
|
441657
|
+
if (!shouldContinue) {
|
|
441658
|
+
hasRejectedCommands = true;
|
|
441659
|
+
continue;
|
|
441660
|
+
}
|
|
441661
|
+
}
|
|
441662
|
+
const result2 = await executeCommand2(cmd.command, cmd.timeout || 3e4);
|
|
441663
|
+
results.push(result2);
|
|
441664
|
+
const output2 = result2.success ? result2.stdout || "(no output)" : `Error: ${result2.stderr || "Command failed"}`;
|
|
441665
|
+
const replacement = `
|
|
441666
|
+
--- Command: ${cmd.command} ---
|
|
441667
|
+
${output2}
|
|
441668
|
+
--- End of output ---
|
|
441669
|
+
`;
|
|
441670
|
+
const adjustedStart = cmd.startIndex + offset;
|
|
441671
|
+
const adjustedEnd = cmd.endIndex + offset;
|
|
441672
|
+
processedMessage = processedMessage.slice(0, adjustedStart) + replacement + processedMessage.slice(adjustedEnd);
|
|
441673
|
+
offset += replacement.length - (cmd.endIndex - cmd.startIndex);
|
|
441674
|
+
}
|
|
441675
|
+
return {
|
|
441676
|
+
processedMessage,
|
|
441677
|
+
hasCommands: true,
|
|
441678
|
+
hasRejectedCommands,
|
|
441679
|
+
results
|
|
441680
|
+
};
|
|
441681
|
+
}, [parseBashCommands, checkSensitiveCommand, executeCommand2]);
|
|
441682
|
+
const resetState = (0, import_react86.useCallback)(() => {
|
|
441683
|
+
setState({
|
|
441684
|
+
isExecuting: false,
|
|
441685
|
+
currentCommand: null,
|
|
441686
|
+
currentTimeout: null,
|
|
441687
|
+
executionResults: /* @__PURE__ */ new Map()
|
|
441688
|
+
});
|
|
441689
|
+
}, []);
|
|
441690
|
+
return {
|
|
441691
|
+
state,
|
|
441692
|
+
parseBashCommands,
|
|
441693
|
+
checkSensitiveCommand,
|
|
441694
|
+
executeCommand: executeCommand2,
|
|
441695
|
+
processBashMessage,
|
|
441696
|
+
resetState
|
|
441697
|
+
};
|
|
441698
|
+
}
|
|
441699
|
+
var import_react86;
|
|
441700
|
+
var init_useBashMode = __esm({
|
|
441701
|
+
"dist/hooks/input/useBashMode.js"() {
|
|
441702
|
+
"use strict";
|
|
441703
|
+
import_react86 = __toESM(require_react(), 1);
|
|
441704
|
+
init_sensitiveCommandManager();
|
|
441705
|
+
}
|
|
441706
|
+
});
|
|
441707
|
+
|
|
441539
441708
|
// dist/ui/components/panels/CommandPanel.js
|
|
441540
441709
|
var CommandPanel_exports = {};
|
|
441541
441710
|
__export(CommandPanel_exports, {
|
|
441542
441711
|
default: () => CommandPanel_default
|
|
441543
441712
|
});
|
|
441544
|
-
var
|
|
441713
|
+
var import_react87, CommandPanel, CommandPanel_default;
|
|
441545
441714
|
var init_CommandPanel = __esm({
|
|
441546
441715
|
async "dist/ui/components/panels/CommandPanel.js"() {
|
|
441547
441716
|
"use strict";
|
|
441548
|
-
|
|
441717
|
+
import_react87 = __toESM(require_react(), 1);
|
|
441549
441718
|
await init_build2();
|
|
441550
441719
|
await init_build4();
|
|
441551
441720
|
init_i18n();
|
|
441552
441721
|
init_ThemeContext();
|
|
441553
|
-
CommandPanel = (0,
|
|
441722
|
+
CommandPanel = (0, import_react87.memo)(({ commands, selectedIndex, visible, maxHeight, isProcessing = false }) => {
|
|
441554
441723
|
const { t } = useI18n();
|
|
441555
441724
|
const { theme: theme14 } = useTheme();
|
|
441556
441725
|
const MAX_DISPLAY_ITEMS = 5;
|
|
441557
441726
|
const effectiveMaxItems = maxHeight ? Math.min(maxHeight, MAX_DISPLAY_ITEMS) : MAX_DISPLAY_ITEMS;
|
|
441558
|
-
const displayedCommands = (0,
|
|
441727
|
+
const displayedCommands = (0, import_react87.useMemo)(() => {
|
|
441559
441728
|
if (commands.length <= effectiveMaxItems) {
|
|
441560
441729
|
return commands;
|
|
441561
441730
|
}
|
|
@@ -441567,7 +441736,7 @@ var init_CommandPanel = __esm({
|
|
|
441567
441736
|
}
|
|
441568
441737
|
return commands.slice(startIndex, endIndex);
|
|
441569
441738
|
}, [commands, selectedIndex, effectiveMaxItems]);
|
|
441570
|
-
const displayedSelectedIndex = (0,
|
|
441739
|
+
const displayedSelectedIndex = (0, import_react87.useMemo)(() => {
|
|
441571
441740
|
return displayedCommands.findIndex((cmd) => {
|
|
441572
441741
|
const originalIndex = commands.indexOf(cmd);
|
|
441573
441742
|
return originalIndex === selectedIndex;
|
|
@@ -441577,24 +441746,24 @@ var init_CommandPanel = __esm({
|
|
|
441577
441746
|
return null;
|
|
441578
441747
|
}
|
|
441579
441748
|
if (isProcessing) {
|
|
441580
|
-
return
|
|
441749
|
+
return import_react87.default.createElement(
|
|
441581
441750
|
Box_default,
|
|
441582
441751
|
{ flexDirection: "column" },
|
|
441583
|
-
|
|
441752
|
+
import_react87.default.createElement(
|
|
441584
441753
|
Box_default,
|
|
441585
441754
|
{ width: "100%" },
|
|
441586
|
-
|
|
441755
|
+
import_react87.default.createElement(
|
|
441587
441756
|
Box_default,
|
|
441588
441757
|
{ flexDirection: "column", width: "100%" },
|
|
441589
|
-
|
|
441758
|
+
import_react87.default.createElement(
|
|
441590
441759
|
Box_default,
|
|
441591
441760
|
null,
|
|
441592
|
-
|
|
441761
|
+
import_react87.default.createElement(Text, { color: theme14.colors.warning, bold: true }, t.commandPanel.title)
|
|
441593
441762
|
),
|
|
441594
|
-
|
|
441763
|
+
import_react87.default.createElement(
|
|
441595
441764
|
Box_default,
|
|
441596
441765
|
{ marginTop: 1 },
|
|
441597
|
-
|
|
441766
|
+
import_react87.default.createElement(Alert, { variant: "info" }, t.commandPanel.processingMessage)
|
|
441598
441767
|
)
|
|
441599
441768
|
)
|
|
441600
441769
|
)
|
|
@@ -441603,19 +441772,19 @@ var init_CommandPanel = __esm({
|
|
|
441603
441772
|
if (commands.length === 0) {
|
|
441604
441773
|
return null;
|
|
441605
441774
|
}
|
|
441606
|
-
return
|
|
441775
|
+
return import_react87.default.createElement(
|
|
441607
441776
|
Box_default,
|
|
441608
441777
|
{ flexDirection: "column" },
|
|
441609
|
-
|
|
441778
|
+
import_react87.default.createElement(
|
|
441610
441779
|
Box_default,
|
|
441611
441780
|
{ width: "100%" },
|
|
441612
|
-
|
|
441781
|
+
import_react87.default.createElement(
|
|
441613
441782
|
Box_default,
|
|
441614
441783
|
{ flexDirection: "column", width: "100%" },
|
|
441615
|
-
|
|
441784
|
+
import_react87.default.createElement(
|
|
441616
441785
|
Box_default,
|
|
441617
441786
|
null,
|
|
441618
|
-
|
|
441787
|
+
import_react87.default.createElement(
|
|
441619
441788
|
Text,
|
|
441620
441789
|
{ color: theme14.colors.warning, bold: true },
|
|
441621
441790
|
t.commandPanel.availableCommands,
|
|
@@ -441623,20 +441792,20 @@ var init_CommandPanel = __esm({
|
|
|
441623
441792
|
commands.length > effectiveMaxItems && `(${selectedIndex + 1}/${commands.length})`
|
|
441624
441793
|
)
|
|
441625
441794
|
),
|
|
441626
|
-
displayedCommands.map((command, index) =>
|
|
441795
|
+
displayedCommands.map((command, index) => import_react87.default.createElement(
|
|
441627
441796
|
Box_default,
|
|
441628
441797
|
{ key: command.name, flexDirection: "column", width: "100%" },
|
|
441629
|
-
|
|
441798
|
+
import_react87.default.createElement(
|
|
441630
441799
|
Text,
|
|
441631
441800
|
{ color: index === displayedSelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: true },
|
|
441632
441801
|
index === displayedSelectedIndex ? "\u276F " : " ",
|
|
441633
441802
|
"/",
|
|
441634
441803
|
command.name
|
|
441635
441804
|
),
|
|
441636
|
-
|
|
441805
|
+
import_react87.default.createElement(
|
|
441637
441806
|
Box_default,
|
|
441638
441807
|
{ marginLeft: 3 },
|
|
441639
|
-
|
|
441808
|
+
import_react87.default.createElement(
|
|
441640
441809
|
Text,
|
|
441641
441810
|
{ color: index === displayedSelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, dimColor: true },
|
|
441642
441811
|
"\u2514\u2500 ",
|
|
@@ -441644,10 +441813,10 @@ var init_CommandPanel = __esm({
|
|
|
441644
441813
|
)
|
|
441645
441814
|
)
|
|
441646
441815
|
)),
|
|
441647
|
-
commands.length > effectiveMaxItems &&
|
|
441816
|
+
commands.length > effectiveMaxItems && import_react87.default.createElement(
|
|
441648
441817
|
Box_default,
|
|
441649
441818
|
{ marginTop: 1 },
|
|
441650
|
-
|
|
441819
|
+
import_react87.default.createElement(
|
|
441651
441820
|
Text,
|
|
441652
441821
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
441653
441822
|
t.commandPanel.scrollHint,
|
|
@@ -444416,28 +444585,28 @@ __export(FileList_exports, {
|
|
|
444416
444585
|
});
|
|
444417
444586
|
import fs33 from "fs";
|
|
444418
444587
|
import path41 from "path";
|
|
444419
|
-
var
|
|
444588
|
+
var import_react88, FileList, FileList_default;
|
|
444420
444589
|
var init_FileList = __esm({
|
|
444421
444590
|
async "dist/ui/components/tools/FileList.js"() {
|
|
444422
444591
|
"use strict";
|
|
444423
|
-
|
|
444592
|
+
import_react88 = __toESM(require_react(), 1);
|
|
444424
444593
|
await init_build2();
|
|
444425
444594
|
init_useTerminalSize();
|
|
444426
444595
|
init_ThemeContext();
|
|
444427
444596
|
init_workingDirConfig();
|
|
444428
|
-
FileList = (0,
|
|
444597
|
+
FileList = (0, import_react88.memo)((0, import_react88.forwardRef)(({ query, selectedIndex, visible, maxItems = 10, rootPath = process.cwd(), onFilteredCountChange, searchMode = "file" }, ref) => {
|
|
444429
444598
|
const { theme: theme14 } = useTheme();
|
|
444430
|
-
const [files, setFiles] = (0,
|
|
444431
|
-
const [isLoading, setIsLoading] = (0,
|
|
444432
|
-
const [searchDepth, setSearchDepth] = (0,
|
|
444433
|
-
const [isIncreasingDepth, setIsIncreasingDepth] = (0,
|
|
444434
|
-
const [actualMaxDepth, setActualMaxDepth] = (0,
|
|
444599
|
+
const [files, setFiles] = (0, import_react88.useState)([]);
|
|
444600
|
+
const [isLoading, setIsLoading] = (0, import_react88.useState)(false);
|
|
444601
|
+
const [searchDepth, setSearchDepth] = (0, import_react88.useState)(5);
|
|
444602
|
+
const [isIncreasingDepth, setIsIncreasingDepth] = (0, import_react88.useState)(false);
|
|
444603
|
+
const [actualMaxDepth, setActualMaxDepth] = (0, import_react88.useState)(0);
|
|
444435
444604
|
const { columns: terminalWidth } = useTerminalSize();
|
|
444436
444605
|
const MAX_DISPLAY_ITEMS = 5;
|
|
444437
|
-
const effectiveMaxItems = (0,
|
|
444606
|
+
const effectiveMaxItems = (0, import_react88.useMemo)(() => {
|
|
444438
444607
|
return maxItems ? Math.min(maxItems, MAX_DISPLAY_ITEMS) : MAX_DISPLAY_ITEMS;
|
|
444439
444608
|
}, [maxItems]);
|
|
444440
|
-
const loadFiles = (0,
|
|
444609
|
+
const loadFiles = (0, import_react88.useCallback)(async () => {
|
|
444441
444610
|
const MAX_FILES = 3e3;
|
|
444442
444611
|
const workingDirs = await getWorkingDirectories();
|
|
444443
444612
|
const allFiles = [];
|
|
@@ -444539,7 +444708,7 @@ var init_FileList = __esm({
|
|
|
444539
444708
|
setActualMaxDepth(globalMaxDepth);
|
|
444540
444709
|
setIsLoading(false);
|
|
444541
444710
|
}, [searchDepth]);
|
|
444542
|
-
const searchFileContent = (0,
|
|
444711
|
+
const searchFileContent = (0, import_react88.useCallback)(async (query2) => {
|
|
444543
444712
|
if (!query2.trim()) {
|
|
444544
444713
|
return [];
|
|
444545
444714
|
}
|
|
@@ -444645,14 +444814,14 @@ var init_FileList = __esm({
|
|
|
444645
444814
|
}
|
|
444646
444815
|
return results;
|
|
444647
444816
|
}, [files, rootPath, terminalWidth]);
|
|
444648
|
-
(0,
|
|
444817
|
+
(0, import_react88.useEffect)(() => {
|
|
444649
444818
|
if (!visible) {
|
|
444650
444819
|
return;
|
|
444651
444820
|
}
|
|
444652
444821
|
loadFiles();
|
|
444653
444822
|
}, [visible, rootPath, loadFiles]);
|
|
444654
|
-
const [allFilteredFiles, setAllFilteredFiles] = (0,
|
|
444655
|
-
(0,
|
|
444823
|
+
const [allFilteredFiles, setAllFilteredFiles] = (0, import_react88.useState)([]);
|
|
444824
|
+
(0, import_react88.useEffect)(() => {
|
|
444656
444825
|
const performSearch = async () => {
|
|
444657
444826
|
if (!query.trim()) {
|
|
444658
444827
|
setAllFilteredFiles(files);
|
|
@@ -444705,7 +444874,7 @@ var init_FileList = __esm({
|
|
|
444705
444874
|
loadFiles,
|
|
444706
444875
|
actualMaxDepth
|
|
444707
444876
|
]);
|
|
444708
|
-
const filteredFiles = (0,
|
|
444877
|
+
const filteredFiles = (0, import_react88.useMemo)(() => {
|
|
444709
444878
|
if (allFilteredFiles.length <= effectiveMaxItems) {
|
|
444710
444879
|
return allFilteredFiles;
|
|
444711
444880
|
}
|
|
@@ -444717,12 +444886,12 @@ var init_FileList = __esm({
|
|
|
444717
444886
|
}
|
|
444718
444887
|
return allFilteredFiles.slice(startIndex, endIndex);
|
|
444719
444888
|
}, [allFilteredFiles, selectedIndex, effectiveMaxItems]);
|
|
444720
|
-
(0,
|
|
444889
|
+
(0, import_react88.useEffect)(() => {
|
|
444721
444890
|
if (onFilteredCountChange) {
|
|
444722
444891
|
onFilteredCountChange(allFilteredFiles.length);
|
|
444723
444892
|
}
|
|
444724
444893
|
}, [allFilteredFiles.length, onFilteredCountChange]);
|
|
444725
|
-
(0,
|
|
444894
|
+
(0, import_react88.useImperativeHandle)(ref, () => ({
|
|
444726
444895
|
getSelectedFile: () => {
|
|
444727
444896
|
if (allFilteredFiles.length > 0 && selectedIndex < allFilteredFiles.length && allFilteredFiles[selectedIndex]) {
|
|
444728
444897
|
const selectedFile = allFilteredFiles[selectedIndex];
|
|
@@ -444736,7 +444905,7 @@ var init_FileList = __esm({
|
|
|
444736
444905
|
return null;
|
|
444737
444906
|
}
|
|
444738
444907
|
}), [allFilteredFiles, selectedIndex, rootPath]);
|
|
444739
|
-
const displaySelectedIndex = (0,
|
|
444908
|
+
const displaySelectedIndex = (0, import_react88.useMemo)(() => {
|
|
444740
444909
|
return filteredFiles.findIndex((file) => {
|
|
444741
444910
|
const originalIndex = allFilteredFiles.indexOf(file);
|
|
444742
444911
|
return originalIndex === selectedIndex;
|
|
@@ -444746,26 +444915,26 @@ var init_FileList = __esm({
|
|
|
444746
444915
|
return null;
|
|
444747
444916
|
}
|
|
444748
444917
|
if (isLoading) {
|
|
444749
|
-
return
|
|
444918
|
+
return import_react88.default.createElement(
|
|
444750
444919
|
Box_default,
|
|
444751
444920
|
{ paddingX: 1, marginTop: 1 },
|
|
444752
|
-
|
|
444921
|
+
import_react88.default.createElement(Text, { color: "blue", dimColor: true }, isIncreasingDepth ? `Searching deeper directories (depth: ${searchDepth})...` : "Loading files...")
|
|
444753
444922
|
);
|
|
444754
444923
|
}
|
|
444755
444924
|
if (filteredFiles.length === 0) {
|
|
444756
|
-
return
|
|
444925
|
+
return import_react88.default.createElement(
|
|
444757
444926
|
Box_default,
|
|
444758
444927
|
{ paddingX: 1, marginTop: 1 },
|
|
444759
|
-
|
|
444928
|
+
import_react88.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, isIncreasingDepth ? "Searching deeper directories..." : "No files found")
|
|
444760
444929
|
);
|
|
444761
444930
|
}
|
|
444762
|
-
return
|
|
444931
|
+
return import_react88.default.createElement(
|
|
444763
444932
|
Box_default,
|
|
444764
444933
|
{ paddingX: 1, marginTop: 1, flexDirection: "column" },
|
|
444765
|
-
|
|
444934
|
+
import_react88.default.createElement(
|
|
444766
444935
|
Box_default,
|
|
444767
444936
|
{ marginBottom: 1 },
|
|
444768
|
-
|
|
444937
|
+
import_react88.default.createElement(
|
|
444769
444938
|
Text,
|
|
444770
444939
|
{ color: "blue", bold: true },
|
|
444771
444940
|
searchMode === "content" ? "\u2261 Content Search" : "\u2261 Files",
|
|
@@ -444773,21 +444942,21 @@ var init_FileList = __esm({
|
|
|
444773
444942
|
allFilteredFiles.length > effectiveMaxItems && `(${selectedIndex + 1}/${allFilteredFiles.length})`
|
|
444774
444943
|
)
|
|
444775
444944
|
),
|
|
444776
|
-
filteredFiles.map((file, index) =>
|
|
444945
|
+
filteredFiles.map((file, index) => import_react88.default.createElement(
|
|
444777
444946
|
Box_default,
|
|
444778
444947
|
{ key: `${file.path}-${file.lineNumber || 0}`, flexDirection: "column" },
|
|
444779
|
-
|
|
444780
|
-
searchMode === "content" && file.lineContent &&
|
|
444948
|
+
import_react88.default.createElement(Text, { backgroundColor: index === displaySelectedIndex ? theme14.colors.menuSelected : void 0, color: index === displaySelectedIndex ? theme14.colors.menuNormal : file.isDirectory ? theme14.colors.warning : "white" }, searchMode === "content" && file.lineNumber !== void 0 ? `${file.path}:${file.lineNumber}` : file.isDirectory ? "\u25C7 " + file.path : "\u25C6 " + file.path),
|
|
444949
|
+
searchMode === "content" && file.lineContent && import_react88.default.createElement(
|
|
444781
444950
|
Text,
|
|
444782
444951
|
{ backgroundColor: index === displaySelectedIndex ? theme14.colors.menuSelected : void 0, color: index === displaySelectedIndex ? theme14.colors.menuSecondary : theme14.colors.menuSecondary, dimColor: true },
|
|
444783
444952
|
" ",
|
|
444784
444953
|
file.lineContent
|
|
444785
444954
|
)
|
|
444786
444955
|
)),
|
|
444787
|
-
allFilteredFiles.length > effectiveMaxItems &&
|
|
444956
|
+
allFilteredFiles.length > effectiveMaxItems && import_react88.default.createElement(
|
|
444788
444957
|
Box_default,
|
|
444789
444958
|
{ marginTop: 1 },
|
|
444790
|
-
|
|
444959
|
+
import_react88.default.createElement(
|
|
444791
444960
|
Text,
|
|
444792
444961
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
444793
444962
|
"\u2191\u2193 to scroll \xB7 ",
|
|
@@ -444808,19 +444977,19 @@ var AgentPickerPanel_exports = {};
|
|
|
444808
444977
|
__export(AgentPickerPanel_exports, {
|
|
444809
444978
|
default: () => AgentPickerPanel_default
|
|
444810
444979
|
});
|
|
444811
|
-
var
|
|
444980
|
+
var import_react89, AgentPickerPanel, AgentPickerPanel_default;
|
|
444812
444981
|
var init_AgentPickerPanel = __esm({
|
|
444813
444982
|
async "dist/ui/components/panels/AgentPickerPanel.js"() {
|
|
444814
444983
|
"use strict";
|
|
444815
|
-
|
|
444984
|
+
import_react89 = __toESM(require_react(), 1);
|
|
444816
444985
|
await init_build2();
|
|
444817
444986
|
await init_build4();
|
|
444818
444987
|
init_ThemeContext();
|
|
444819
|
-
AgentPickerPanel = (0,
|
|
444988
|
+
AgentPickerPanel = (0, import_react89.memo)(({ agents, selectedIndex, visible, maxHeight }) => {
|
|
444820
444989
|
const { theme: theme14 } = useTheme();
|
|
444821
444990
|
const MAX_DISPLAY_ITEMS = 5;
|
|
444822
444991
|
const effectiveMaxItems = maxHeight ? Math.min(maxHeight, MAX_DISPLAY_ITEMS) : MAX_DISPLAY_ITEMS;
|
|
444823
|
-
const displayedAgents = (0,
|
|
444992
|
+
const displayedAgents = (0, import_react89.useMemo)(() => {
|
|
444824
444993
|
if (agents.length <= effectiveMaxItems) {
|
|
444825
444994
|
return agents;
|
|
444826
444995
|
}
|
|
@@ -444832,7 +445001,7 @@ var init_AgentPickerPanel = __esm({
|
|
|
444832
445001
|
}
|
|
444833
445002
|
return agents.slice(startIndex, endIndex);
|
|
444834
445003
|
}, [agents, selectedIndex, effectiveMaxItems]);
|
|
444835
|
-
const displayedSelectedIndex = (0,
|
|
445004
|
+
const displayedSelectedIndex = (0, import_react89.useMemo)(() => {
|
|
444836
445005
|
return displayedAgents.findIndex((agent) => {
|
|
444837
445006
|
const originalIndex = agents.indexOf(agent);
|
|
444838
445007
|
return originalIndex === selectedIndex;
|
|
@@ -444842,64 +445011,64 @@ var init_AgentPickerPanel = __esm({
|
|
|
444842
445011
|
return null;
|
|
444843
445012
|
}
|
|
444844
445013
|
if (agents.length === 0) {
|
|
444845
|
-
return
|
|
445014
|
+
return import_react89.default.createElement(
|
|
444846
445015
|
Box_default,
|
|
444847
445016
|
{ flexDirection: "column" },
|
|
444848
|
-
|
|
445017
|
+
import_react89.default.createElement(
|
|
444849
445018
|
Box_default,
|
|
444850
445019
|
{ width: "100%" },
|
|
444851
|
-
|
|
445020
|
+
import_react89.default.createElement(
|
|
444852
445021
|
Box_default,
|
|
444853
445022
|
{ flexDirection: "column", width: "100%" },
|
|
444854
|
-
|
|
445023
|
+
import_react89.default.createElement(
|
|
444855
445024
|
Box_default,
|
|
444856
445025
|
null,
|
|
444857
|
-
|
|
445026
|
+
import_react89.default.createElement(Text, { color: theme14.colors.warning, bold: true }, "Sub-Agent Selection")
|
|
444858
445027
|
),
|
|
444859
|
-
|
|
445028
|
+
import_react89.default.createElement(
|
|
444860
445029
|
Box_default,
|
|
444861
445030
|
{ marginTop: 1 },
|
|
444862
|
-
|
|
445031
|
+
import_react89.default.createElement(Alert, { variant: "warning" }, "No sub-agents configured. Please configure sub-agents first.")
|
|
444863
445032
|
)
|
|
444864
445033
|
)
|
|
444865
445034
|
)
|
|
444866
445035
|
);
|
|
444867
445036
|
}
|
|
444868
|
-
return
|
|
445037
|
+
return import_react89.default.createElement(
|
|
444869
445038
|
Box_default,
|
|
444870
445039
|
{ flexDirection: "column" },
|
|
444871
|
-
|
|
445040
|
+
import_react89.default.createElement(
|
|
444872
445041
|
Box_default,
|
|
444873
445042
|
{ width: "100%" },
|
|
444874
|
-
|
|
445043
|
+
import_react89.default.createElement(
|
|
444875
445044
|
Box_default,
|
|
444876
445045
|
{ flexDirection: "column", width: "100%" },
|
|
444877
|
-
|
|
445046
|
+
import_react89.default.createElement(
|
|
444878
445047
|
Box_default,
|
|
444879
445048
|
null,
|
|
444880
|
-
|
|
445049
|
+
import_react89.default.createElement(
|
|
444881
445050
|
Text,
|
|
444882
445051
|
{ color: theme14.colors.warning, bold: true },
|
|
444883
445052
|
"Select Sub-Agent",
|
|
444884
445053
|
" ",
|
|
444885
445054
|
agents.length > effectiveMaxItems && `(${selectedIndex + 1}/${agents.length})`
|
|
444886
445055
|
),
|
|
444887
|
-
|
|
445056
|
+
import_react89.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, "(Press ESC to close)")
|
|
444888
445057
|
),
|
|
444889
|
-
displayedAgents.map((agent, index) =>
|
|
445058
|
+
displayedAgents.map((agent, index) => import_react89.default.createElement(
|
|
444890
445059
|
Box_default,
|
|
444891
445060
|
{ key: agent.id, flexDirection: "column", width: "100%" },
|
|
444892
|
-
|
|
445061
|
+
import_react89.default.createElement(
|
|
444893
445062
|
Text,
|
|
444894
445063
|
{ color: index === displayedSelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: true },
|
|
444895
445064
|
index === displayedSelectedIndex ? "\u276F " : " ",
|
|
444896
445065
|
"#",
|
|
444897
445066
|
agent.name
|
|
444898
445067
|
),
|
|
444899
|
-
|
|
445068
|
+
import_react89.default.createElement(
|
|
444900
445069
|
Box_default,
|
|
444901
445070
|
{ marginLeft: 3 },
|
|
444902
|
-
|
|
445071
|
+
import_react89.default.createElement(
|
|
444903
445072
|
Text,
|
|
444904
445073
|
{ color: index === displayedSelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, dimColor: true },
|
|
444905
445074
|
"\u2514\u2500 ",
|
|
@@ -444907,10 +445076,10 @@ var init_AgentPickerPanel = __esm({
|
|
|
444907
445076
|
)
|
|
444908
445077
|
)
|
|
444909
445078
|
)),
|
|
444910
|
-
agents.length > effectiveMaxItems &&
|
|
445079
|
+
agents.length > effectiveMaxItems && import_react89.default.createElement(
|
|
444911
445080
|
Box_default,
|
|
444912
445081
|
{ marginTop: 1 },
|
|
444913
|
-
|
|
445082
|
+
import_react89.default.createElement(
|
|
444914
445083
|
Text,
|
|
444915
445084
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
444916
445085
|
"\u2191\u2193 to scroll \xB7 ",
|
|
@@ -444932,19 +445101,19 @@ var TodoPickerPanel_exports = {};
|
|
|
444932
445101
|
__export(TodoPickerPanel_exports, {
|
|
444933
445102
|
default: () => TodoPickerPanel_default
|
|
444934
445103
|
});
|
|
444935
|
-
var
|
|
445104
|
+
var import_react90, TodoPickerPanel, TodoPickerPanel_default;
|
|
444936
445105
|
var init_TodoPickerPanel = __esm({
|
|
444937
445106
|
async "dist/ui/components/panels/TodoPickerPanel.js"() {
|
|
444938
445107
|
"use strict";
|
|
444939
|
-
|
|
445108
|
+
import_react90 = __toESM(require_react(), 1);
|
|
444940
445109
|
await init_build2();
|
|
444941
445110
|
await init_build4();
|
|
444942
445111
|
init_ThemeContext();
|
|
444943
|
-
TodoPickerPanel = (0,
|
|
445112
|
+
TodoPickerPanel = (0, import_react90.memo)(({ todos, selectedIndex, selectedTodos, visible, maxHeight, isLoading = false, searchQuery = "", totalCount = 0 }) => {
|
|
444944
445113
|
const { theme: theme14 } = useTheme();
|
|
444945
445114
|
const MAX_DISPLAY_ITEMS = 5;
|
|
444946
445115
|
const effectiveMaxItems = maxHeight ? Math.min(maxHeight, MAX_DISPLAY_ITEMS) : MAX_DISPLAY_ITEMS;
|
|
444947
|
-
const displayedTodos = (0,
|
|
445116
|
+
const displayedTodos = (0, import_react90.useMemo)(() => {
|
|
444948
445117
|
if (todos.length <= effectiveMaxItems) {
|
|
444949
445118
|
return todos;
|
|
444950
445119
|
}
|
|
@@ -444956,7 +445125,7 @@ var init_TodoPickerPanel = __esm({
|
|
|
444956
445125
|
}
|
|
444957
445126
|
return todos.slice(startIndex, endIndex);
|
|
444958
445127
|
}, [todos, selectedIndex, effectiveMaxItems]);
|
|
444959
|
-
const displayedSelectedIndex = (0,
|
|
445128
|
+
const displayedSelectedIndex = (0, import_react90.useMemo)(() => {
|
|
444960
445129
|
return displayedTodos.findIndex((todo) => {
|
|
444961
445130
|
const originalIndex = todos.indexOf(todo);
|
|
444962
445131
|
return originalIndex === selectedIndex;
|
|
@@ -444966,72 +445135,72 @@ var init_TodoPickerPanel = __esm({
|
|
|
444966
445135
|
return null;
|
|
444967
445136
|
}
|
|
444968
445137
|
if (isLoading) {
|
|
444969
|
-
return
|
|
445138
|
+
return import_react90.default.createElement(
|
|
444970
445139
|
Box_default,
|
|
444971
445140
|
{ flexDirection: "column" },
|
|
444972
|
-
|
|
445141
|
+
import_react90.default.createElement(
|
|
444973
445142
|
Box_default,
|
|
444974
445143
|
{ width: "100%" },
|
|
444975
|
-
|
|
445144
|
+
import_react90.default.createElement(
|
|
444976
445145
|
Box_default,
|
|
444977
445146
|
{ flexDirection: "column", width: "100%" },
|
|
444978
|
-
|
|
445147
|
+
import_react90.default.createElement(
|
|
444979
445148
|
Box_default,
|
|
444980
445149
|
null,
|
|
444981
|
-
|
|
445150
|
+
import_react90.default.createElement(Text, { color: theme14.colors.warning, bold: true }, "TODO Selection")
|
|
444982
445151
|
),
|
|
444983
|
-
|
|
445152
|
+
import_react90.default.createElement(
|
|
444984
445153
|
Box_default,
|
|
444985
445154
|
{ marginTop: 1 },
|
|
444986
|
-
|
|
445155
|
+
import_react90.default.createElement(Alert, { variant: "info" }, "Scanning project for TODO comments...")
|
|
444987
445156
|
)
|
|
444988
445157
|
)
|
|
444989
445158
|
)
|
|
444990
445159
|
);
|
|
444991
445160
|
}
|
|
444992
445161
|
if (todos.length === 0 && !searchQuery) {
|
|
444993
|
-
return
|
|
445162
|
+
return import_react90.default.createElement(
|
|
444994
445163
|
Box_default,
|
|
444995
445164
|
{ flexDirection: "column" },
|
|
444996
|
-
|
|
445165
|
+
import_react90.default.createElement(
|
|
444997
445166
|
Box_default,
|
|
444998
445167
|
{ width: "100%" },
|
|
444999
|
-
|
|
445168
|
+
import_react90.default.createElement(
|
|
445000
445169
|
Box_default,
|
|
445001
445170
|
{ flexDirection: "column", width: "100%" },
|
|
445002
|
-
|
|
445171
|
+
import_react90.default.createElement(
|
|
445003
445172
|
Box_default,
|
|
445004
445173
|
null,
|
|
445005
|
-
|
|
445174
|
+
import_react90.default.createElement(Text, { color: theme14.colors.warning, bold: true }, "TODO Selection")
|
|
445006
445175
|
),
|
|
445007
|
-
|
|
445176
|
+
import_react90.default.createElement(
|
|
445008
445177
|
Box_default,
|
|
445009
445178
|
{ marginTop: 1 },
|
|
445010
|
-
|
|
445179
|
+
import_react90.default.createElement(Alert, { variant: "info" }, "No TODO comments found in the project")
|
|
445011
445180
|
)
|
|
445012
445181
|
)
|
|
445013
445182
|
)
|
|
445014
445183
|
);
|
|
445015
445184
|
}
|
|
445016
445185
|
if (todos.length === 0 && searchQuery) {
|
|
445017
|
-
return
|
|
445186
|
+
return import_react90.default.createElement(
|
|
445018
445187
|
Box_default,
|
|
445019
445188
|
{ flexDirection: "column" },
|
|
445020
|
-
|
|
445189
|
+
import_react90.default.createElement(
|
|
445021
445190
|
Box_default,
|
|
445022
445191
|
{ width: "100%" },
|
|
445023
|
-
|
|
445192
|
+
import_react90.default.createElement(
|
|
445024
445193
|
Box_default,
|
|
445025
445194
|
{ flexDirection: "column", width: "100%" },
|
|
445026
|
-
|
|
445195
|
+
import_react90.default.createElement(
|
|
445027
445196
|
Box_default,
|
|
445028
445197
|
null,
|
|
445029
|
-
|
|
445198
|
+
import_react90.default.createElement(Text, { color: theme14.colors.warning, bold: true }, "TODO Selection")
|
|
445030
445199
|
),
|
|
445031
|
-
|
|
445200
|
+
import_react90.default.createElement(
|
|
445032
445201
|
Box_default,
|
|
445033
445202
|
{ marginTop: 1 },
|
|
445034
|
-
|
|
445203
|
+
import_react90.default.createElement(
|
|
445035
445204
|
Alert,
|
|
445036
445205
|
{ variant: "warning" },
|
|
445037
445206
|
'No TODOs match "',
|
|
@@ -445041,28 +445210,28 @@ var init_TodoPickerPanel = __esm({
|
|
|
445041
445210
|
")"
|
|
445042
445211
|
)
|
|
445043
445212
|
),
|
|
445044
|
-
|
|
445213
|
+
import_react90.default.createElement(
|
|
445045
445214
|
Box_default,
|
|
445046
445215
|
{ marginTop: 1 },
|
|
445047
|
-
|
|
445216
|
+
import_react90.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, "Type to filter \xB7 Backspace to clear search")
|
|
445048
445217
|
)
|
|
445049
445218
|
)
|
|
445050
445219
|
)
|
|
445051
445220
|
);
|
|
445052
445221
|
}
|
|
445053
|
-
return
|
|
445222
|
+
return import_react90.default.createElement(
|
|
445054
445223
|
Box_default,
|
|
445055
445224
|
{ flexDirection: "column" },
|
|
445056
|
-
|
|
445225
|
+
import_react90.default.createElement(
|
|
445057
445226
|
Box_default,
|
|
445058
445227
|
{ width: "100%" },
|
|
445059
|
-
|
|
445228
|
+
import_react90.default.createElement(
|
|
445060
445229
|
Box_default,
|
|
445061
445230
|
{ flexDirection: "column", width: "100%" },
|
|
445062
|
-
|
|
445231
|
+
import_react90.default.createElement(
|
|
445063
445232
|
Box_default,
|
|
445064
445233
|
null,
|
|
445065
|
-
|
|
445234
|
+
import_react90.default.createElement(
|
|
445066
445235
|
Text,
|
|
445067
445236
|
{ color: theme14.colors.warning, bold: true },
|
|
445068
445237
|
"Select TODOs",
|
|
@@ -445072,18 +445241,18 @@ var init_TodoPickerPanel = __esm({
|
|
|
445072
445241
|
searchQuery && totalCount > todos.length && ` (${todos.length}/${totalCount})`
|
|
445073
445242
|
)
|
|
445074
445243
|
),
|
|
445075
|
-
|
|
445244
|
+
import_react90.default.createElement(
|
|
445076
445245
|
Box_default,
|
|
445077
445246
|
{ marginTop: 1 },
|
|
445078
|
-
|
|
445247
|
+
import_react90.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, searchQuery ? "Type to filter \xB7 Backspace to clear \xB7 Space: toggle \xB7 Enter: confirm" : "Type to search \xB7 Space: toggle \xB7 Enter: confirm \xB7 Esc: cancel")
|
|
445079
445248
|
),
|
|
445080
445249
|
displayedTodos.map((todo, index) => {
|
|
445081
445250
|
const isSelected = index === displayedSelectedIndex;
|
|
445082
445251
|
const isChecked = selectedTodos.has(todo.id);
|
|
445083
|
-
return
|
|
445252
|
+
return import_react90.default.createElement(
|
|
445084
445253
|
Box_default,
|
|
445085
445254
|
{ key: todo.id, flexDirection: "column", width: "100%" },
|
|
445086
|
-
|
|
445255
|
+
import_react90.default.createElement(
|
|
445087
445256
|
Text,
|
|
445088
445257
|
{ color: isSelected ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: true },
|
|
445089
445258
|
isSelected ? "\u276F " : " ",
|
|
@@ -445093,10 +445262,10 @@ var init_TodoPickerPanel = __esm({
|
|
|
445093
445262
|
":",
|
|
445094
445263
|
todo.line
|
|
445095
445264
|
),
|
|
445096
|
-
|
|
445265
|
+
import_react90.default.createElement(
|
|
445097
445266
|
Box_default,
|
|
445098
445267
|
{ marginLeft: 5 },
|
|
445099
|
-
|
|
445268
|
+
import_react90.default.createElement(
|
|
445100
445269
|
Text,
|
|
445101
445270
|
{ color: isSelected ? theme14.colors.menuSelected : theme14.colors.menuNormal, dimColor: !isSelected },
|
|
445102
445271
|
"\u2514\u2500 ",
|
|
@@ -445105,10 +445274,10 @@ var init_TodoPickerPanel = __esm({
|
|
|
445105
445274
|
)
|
|
445106
445275
|
);
|
|
445107
445276
|
}),
|
|
445108
|
-
todos.length > effectiveMaxItems &&
|
|
445277
|
+
todos.length > effectiveMaxItems && import_react90.default.createElement(
|
|
445109
445278
|
Box_default,
|
|
445110
445279
|
{ marginTop: 1 },
|
|
445111
|
-
|
|
445280
|
+
import_react90.default.createElement(
|
|
445112
445281
|
Text,
|
|
445113
445282
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
445114
445283
|
"\u2191\u2193 to scroll \xB7 ",
|
|
@@ -445116,10 +445285,10 @@ var init_TodoPickerPanel = __esm({
|
|
|
445116
445285
|
" more hidden"
|
|
445117
445286
|
)
|
|
445118
445287
|
),
|
|
445119
|
-
selectedTodos.size > 0 &&
|
|
445288
|
+
selectedTodos.size > 0 && import_react90.default.createElement(
|
|
445120
445289
|
Box_default,
|
|
445121
445290
|
{ marginTop: 1 },
|
|
445122
|
-
|
|
445291
|
+
import_react90.default.createElement(
|
|
445123
445292
|
Text,
|
|
445124
445293
|
{ color: theme14.colors.menuInfo },
|
|
445125
445294
|
selectedTodos.size,
|
|
@@ -445144,16 +445313,19 @@ function calculateContextPercentage(contextUsage) {
|
|
|
445144
445313
|
function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...", disabled = false, isProcessing = false, chatHistory = [], onHistorySelect, yoloMode = false, setYoloMode, planMode = false, setPlanMode, contextUsage, initialContent = null, onContextPercentageChange, onSwitchProfile }) {
|
|
445145
445314
|
const { t } = useI18n();
|
|
445146
445315
|
const { theme: theme14 } = useTheme();
|
|
445316
|
+
const { parseBashCommands } = useBashMode();
|
|
445147
445317
|
const { columns: terminalWidth } = useTerminalSize();
|
|
445148
|
-
const prevTerminalWidthRef = (0,
|
|
445318
|
+
const prevTerminalWidthRef = (0, import_react91.useRef)(terminalWidth);
|
|
445149
445319
|
const { hasFocus, ensureFocus } = useTerminalFocus();
|
|
445150
445320
|
const uiOverhead = 8;
|
|
445151
445321
|
const viewportWidth = Math.max(40, terminalWidth - uiOverhead);
|
|
445152
|
-
const viewport = (0,
|
|
445322
|
+
const viewport = (0, import_react91.useMemo)(() => ({
|
|
445153
445323
|
width: viewportWidth,
|
|
445154
445324
|
height: 1
|
|
445155
445325
|
}), [viewportWidth]);
|
|
445156
445326
|
const { buffer, triggerUpdate, forceUpdate } = useInputBuffer(viewport);
|
|
445327
|
+
const [isBashMode, setIsBashMode] = import_react91.default.useState(false);
|
|
445328
|
+
const bashModeDebounceTimer = (0, import_react91.useRef)(null);
|
|
445157
445329
|
const { showCommands, setShowCommands, commandSelectedIndex, setCommandSelectedIndex, getFilteredCommands, updateCommandPanelState, isProcessing: commandPanelIsProcessing } = useCommandPanel(buffer, isProcessing);
|
|
445158
445330
|
const { showFilePicker, setShowFilePicker, fileSelectedIndex, setFileSelectedIndex, fileQuery, setFileQuery, atSymbolPosition, setAtSymbolPosition, filteredFileCount, searchMode, updateFilePickerState, handleFileSelect, handleFilteredCountChange, fileListRef } = useFilePicker(buffer, triggerUpdate);
|
|
445159
445331
|
const { showHistoryMenu, setShowHistoryMenu, historySelectedIndex, setHistorySelectedIndex, escapeKeyCount, setEscapeKeyCount, escapeKeyTimer, getUserMessages, handleHistorySelect, currentHistoryIndex, navigateHistoryUp, navigateHistoryDown, resetHistoryNavigation, saveToHistory } = useHistoryNavigation(buffer, triggerUpdate, chatHistory, onHistorySelect);
|
|
@@ -445226,7 +445398,7 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
445226
445398
|
setTodoSearchQuery,
|
|
445227
445399
|
onSwitchProfile
|
|
445228
445400
|
});
|
|
445229
|
-
(0,
|
|
445401
|
+
(0, import_react91.useEffect)(() => {
|
|
445230
445402
|
if (initialContent) {
|
|
445231
445403
|
buffer.setText("");
|
|
445232
445404
|
const text2 = initialContent.text;
|
|
@@ -445261,13 +445433,13 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
445261
445433
|
triggerUpdate();
|
|
445262
445434
|
}
|
|
445263
445435
|
}, [initialContent]);
|
|
445264
|
-
(0,
|
|
445436
|
+
(0, import_react91.useEffect)(() => {
|
|
445265
445437
|
const timer2 = setTimeout(() => {
|
|
445266
445438
|
forceUpdate();
|
|
445267
445439
|
}, 10);
|
|
445268
445440
|
return () => clearTimeout(timer2);
|
|
445269
445441
|
}, [showFilePicker, forceUpdate]);
|
|
445270
|
-
(0,
|
|
445442
|
+
(0, import_react91.useEffect)(() => {
|
|
445271
445443
|
if (prevTerminalWidthRef.current === terminalWidth) {
|
|
445272
445444
|
prevTerminalWidthRef.current = terminalWidth;
|
|
445273
445445
|
return;
|
|
@@ -445278,8 +445450,8 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
445278
445450
|
}, 100);
|
|
445279
445451
|
return () => clearTimeout(timer2);
|
|
445280
445452
|
}, [terminalWidth, forceUpdate]);
|
|
445281
|
-
const lastPercentageRef = (0,
|
|
445282
|
-
(0,
|
|
445453
|
+
const lastPercentageRef = (0, import_react91.useRef)(0);
|
|
445454
|
+
(0, import_react91.useEffect)(() => {
|
|
445283
445455
|
if (contextUsage && onContextPercentageChange) {
|
|
445284
445456
|
const percentage = calculateContextPercentage(contextUsage);
|
|
445285
445457
|
if (percentage !== lastPercentageRef.current) {
|
|
@@ -445288,11 +445460,29 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
445288
445460
|
}
|
|
445289
445461
|
}
|
|
445290
445462
|
}, [contextUsage, onContextPercentageChange]);
|
|
445291
|
-
|
|
445463
|
+
(0, import_react91.useEffect)(() => {
|
|
445464
|
+
if (bashModeDebounceTimer.current) {
|
|
445465
|
+
clearTimeout(bashModeDebounceTimer.current);
|
|
445466
|
+
}
|
|
445467
|
+
bashModeDebounceTimer.current = setTimeout(() => {
|
|
445468
|
+
const text2 = buffer.getFullText();
|
|
445469
|
+
const commands = parseBashCommands(text2);
|
|
445470
|
+
const hasBashCommands = commands.length > 0;
|
|
445471
|
+
if (hasBashCommands !== isBashMode) {
|
|
445472
|
+
setIsBashMode(hasBashCommands);
|
|
445473
|
+
}
|
|
445474
|
+
}, 150);
|
|
445475
|
+
return () => {
|
|
445476
|
+
if (bashModeDebounceTimer.current) {
|
|
445477
|
+
clearTimeout(bashModeDebounceTimer.current);
|
|
445478
|
+
}
|
|
445479
|
+
};
|
|
445480
|
+
}, [buffer.text, parseBashCommands, isBashMode]);
|
|
445481
|
+
const renderCursor = (0, import_react91.useCallback)((char) => {
|
|
445292
445482
|
if (hasFocus) {
|
|
445293
|
-
return
|
|
445483
|
+
return import_react91.default.createElement(Text, { backgroundColor: theme14.colors.menuNormal, color: theme14.colors.background }, char);
|
|
445294
445484
|
} else {
|
|
445295
|
-
return
|
|
445485
|
+
return import_react91.default.createElement(Text, null, char);
|
|
445296
445486
|
}
|
|
445297
445487
|
}, [hasFocus, theme14]);
|
|
445298
445488
|
const renderContent = () => {
|
|
@@ -445306,34 +445496,34 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
445306
445496
|
const beforeCursor = cpSlice(line, 0, cursorCol);
|
|
445307
445497
|
const atCursor = cpSlice(line, cursorCol, cursorCol + 1) || " ";
|
|
445308
445498
|
const afterCursor = cpSlice(line, cursorCol + 1);
|
|
445309
|
-
renderedLines.push(
|
|
445499
|
+
renderedLines.push(import_react91.default.createElement(
|
|
445310
445500
|
Box_default,
|
|
445311
445501
|
{ key: i, flexDirection: "row" },
|
|
445312
|
-
|
|
445502
|
+
import_react91.default.createElement(Text, null, beforeCursor),
|
|
445313
445503
|
renderCursor(atCursor),
|
|
445314
|
-
|
|
445504
|
+
import_react91.default.createElement(Text, null, afterCursor)
|
|
445315
445505
|
));
|
|
445316
445506
|
} else {
|
|
445317
|
-
renderedLines.push(
|
|
445507
|
+
renderedLines.push(import_react91.default.createElement(Text, { key: i }, line || " "));
|
|
445318
445508
|
}
|
|
445319
445509
|
}
|
|
445320
|
-
return
|
|
445510
|
+
return import_react91.default.createElement(Box_default, { flexDirection: "column" }, renderedLines);
|
|
445321
445511
|
} else {
|
|
445322
|
-
return
|
|
445323
|
-
|
|
445512
|
+
return import_react91.default.createElement(
|
|
445513
|
+
import_react91.default.Fragment,
|
|
445324
445514
|
null,
|
|
445325
445515
|
renderCursor(" "),
|
|
445326
|
-
|
|
445516
|
+
import_react91.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, disabled ? t.chatScreen.waitingForResponse : placeholder)
|
|
445327
445517
|
);
|
|
445328
445518
|
}
|
|
445329
445519
|
};
|
|
445330
|
-
return
|
|
445520
|
+
return import_react91.default.createElement(
|
|
445331
445521
|
Box_default,
|
|
445332
445522
|
{ flexDirection: "column", paddingX: 1, width: terminalWidth },
|
|
445333
|
-
showHistoryMenu &&
|
|
445523
|
+
showHistoryMenu && import_react91.default.createElement(
|
|
445334
445524
|
Box_default,
|
|
445335
445525
|
{ flexDirection: "column", marginBottom: 1, width: terminalWidth - 2 },
|
|
445336
|
-
|
|
445526
|
+
import_react91.default.createElement(Box_default, { flexDirection: "column" }, (() => {
|
|
445337
445527
|
const userMessages = getUserMessages();
|
|
445338
445528
|
const maxVisibleItems = 5;
|
|
445339
445529
|
let startIndex = 0;
|
|
@@ -445345,20 +445535,20 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
445345
445535
|
const visibleMessages = userMessages.slice(startIndex, endIndex);
|
|
445346
445536
|
const hasMoreAbove = startIndex > 0;
|
|
445347
445537
|
const hasMoreBelow = endIndex < userMessages.length;
|
|
445348
|
-
return
|
|
445349
|
-
|
|
445538
|
+
return import_react91.default.createElement(
|
|
445539
|
+
import_react91.default.Fragment,
|
|
445350
445540
|
null,
|
|
445351
|
-
|
|
445541
|
+
import_react91.default.createElement(Box_default, { height: 1 }, hasMoreAbove ? import_react91.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.moreAbove.replace("{count}", startIndex.toString())) : import_react91.default.createElement(Text, null, " ")),
|
|
445352
445542
|
visibleMessages.map((message, displayIndex) => {
|
|
445353
445543
|
const actualIndex = startIndex + displayIndex;
|
|
445354
445544
|
const singleLineLabel = message.label.replace(/[\r\n\t\v\f\u0000-\u001F\u007F-\u009F]+/g, " ").replace(/\s+/g, " ").trim();
|
|
445355
445545
|
const prefixWidth = 3;
|
|
445356
445546
|
const maxLabelWidth = terminalWidth - 4 - prefixWidth;
|
|
445357
445547
|
const truncatedLabel = singleLineLabel.length > maxLabelWidth ? singleLineLabel.slice(0, maxLabelWidth - 3) + "..." : singleLineLabel;
|
|
445358
|
-
return
|
|
445548
|
+
return import_react91.default.createElement(
|
|
445359
445549
|
Box_default,
|
|
445360
445550
|
{ key: message.value, height: 1 },
|
|
445361
|
-
|
|
445551
|
+
import_react91.default.createElement(
|
|
445362
445552
|
Text,
|
|
445363
445553
|
{ color: actualIndex === historySelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: true, wrap: "truncate" },
|
|
445364
445554
|
actualIndex === historySelectedIndex ? "\u276F " : " ",
|
|
@@ -445366,72 +445556,72 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
445366
445556
|
)
|
|
445367
445557
|
);
|
|
445368
445558
|
}),
|
|
445369
|
-
|
|
445559
|
+
import_react91.default.createElement(Box_default, { height: 1 }, hasMoreBelow ? import_react91.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.moreBelow.replace("{count}", (userMessages.length - endIndex).toString())) : import_react91.default.createElement(Text, null, " "))
|
|
445370
445560
|
);
|
|
445371
445561
|
})()),
|
|
445372
|
-
|
|
445562
|
+
import_react91.default.createElement(
|
|
445373
445563
|
Box_default,
|
|
445374
445564
|
{ marginBottom: 1 },
|
|
445375
|
-
|
|
445565
|
+
import_react91.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, t.chatScreen.historyNavigateHint)
|
|
445376
445566
|
)
|
|
445377
445567
|
),
|
|
445378
|
-
!showHistoryMenu &&
|
|
445379
|
-
|
|
445568
|
+
!showHistoryMenu && import_react91.default.createElement(
|
|
445569
|
+
import_react91.default.Fragment,
|
|
445380
445570
|
null,
|
|
445381
|
-
|
|
445571
|
+
import_react91.default.createElement(
|
|
445382
445572
|
Box_default,
|
|
445383
445573
|
{ flexDirection: "column", width: terminalWidth - 2 },
|
|
445384
|
-
|
|
445385
|
-
|
|
445574
|
+
import_react91.default.createElement(Text, { color: isBashMode ? theme14.colors.success : theme14.colors.menuSecondary }, "\u2500".repeat(terminalWidth - 2)),
|
|
445575
|
+
import_react91.default.createElement(
|
|
445386
445576
|
Box_default,
|
|
445387
445577
|
{ flexDirection: "row" },
|
|
445388
|
-
|
|
445578
|
+
import_react91.default.createElement(
|
|
445389
445579
|
Text,
|
|
445390
|
-
{ color: theme14.colors.menuInfo, bold: true },
|
|
445391
|
-
"\u276F",
|
|
445580
|
+
{ color: isBashMode ? theme14.colors.success : theme14.colors.menuInfo, bold: true },
|
|
445581
|
+
isBashMode ? ">_" : "\u276F",
|
|
445392
445582
|
" "
|
|
445393
445583
|
),
|
|
445394
|
-
|
|
445584
|
+
import_react91.default.createElement(Box_default, { flexGrow: 1 }, renderContent())
|
|
445395
445585
|
),
|
|
445396
|
-
|
|
445586
|
+
import_react91.default.createElement(Text, { color: isBashMode ? theme14.colors.success : theme14.colors.menuSecondary }, "\u2500".repeat(terminalWidth - 2))
|
|
445397
445587
|
),
|
|
445398
|
-
showCommands && getFilteredCommands().length > 0 || showFilePicker ?
|
|
445588
|
+
showCommands && getFilteredCommands().length > 0 || showFilePicker ? import_react91.default.createElement(
|
|
445399
445589
|
Box_default,
|
|
445400
445590
|
{ marginTop: 1 },
|
|
445401
|
-
|
|
445591
|
+
import_react91.default.createElement(Text, null, showCommands && getFilteredCommands().length > 0 ? t.commandPanel.interactionHint + " \u2022 " + t.chatScreen.typeToFilterCommands : showFilePicker ? searchMode === "content" ? t.chatScreen.contentSearchHint : t.chatScreen.fileSearchHint : "")
|
|
445402
445592
|
) : null,
|
|
445403
|
-
|
|
445404
|
-
|
|
445593
|
+
import_react91.default.createElement(
|
|
445594
|
+
import_react91.Suspense,
|
|
445405
445595
|
{ fallback: null },
|
|
445406
|
-
|
|
445596
|
+
import_react91.default.createElement(CommandPanel2, { commands: getFilteredCommands(), selectedIndex: commandSelectedIndex, query: buffer.getFullText().slice(1), visible: showCommands, isProcessing: commandPanelIsProcessing })
|
|
445407
445597
|
),
|
|
445408
|
-
|
|
445598
|
+
import_react91.default.createElement(
|
|
445409
445599
|
Box_default,
|
|
445410
445600
|
null,
|
|
445411
|
-
|
|
445412
|
-
|
|
445601
|
+
import_react91.default.createElement(
|
|
445602
|
+
import_react91.Suspense,
|
|
445413
445603
|
{ fallback: null },
|
|
445414
|
-
|
|
445604
|
+
import_react91.default.createElement(FileList2, { ref: fileListRef, query: fileQuery, selectedIndex: fileSelectedIndex, visible: showFilePicker, maxItems: 10, rootPath: process.cwd(), onFilteredCountChange: handleFilteredCountChange, searchMode })
|
|
445415
445605
|
)
|
|
445416
445606
|
),
|
|
445417
|
-
|
|
445418
|
-
|
|
445607
|
+
import_react91.default.createElement(
|
|
445608
|
+
import_react91.Suspense,
|
|
445419
445609
|
{ fallback: null },
|
|
445420
|
-
|
|
445610
|
+
import_react91.default.createElement(AgentPickerPanel2, { agents: getFilteredAgents(), selectedIndex: agentSelectedIndex, visible: showAgentPicker, maxHeight: 5 })
|
|
445421
445611
|
),
|
|
445422
|
-
|
|
445423
|
-
|
|
445612
|
+
import_react91.default.createElement(
|
|
445613
|
+
import_react91.Suspense,
|
|
445424
445614
|
{ fallback: null },
|
|
445425
|
-
|
|
445615
|
+
import_react91.default.createElement(TodoPickerPanel2, { todos, selectedIndex: todoSelectedIndex, selectedTodos, visible: showTodoPicker, maxHeight: 5, isLoading: todoIsLoading, searchQuery: todoSearchQuery, totalCount: totalTodoCount })
|
|
445426
445616
|
)
|
|
445427
445617
|
)
|
|
445428
445618
|
);
|
|
445429
445619
|
}
|
|
445430
|
-
var
|
|
445620
|
+
var import_react91, CommandPanel2, FileList2, AgentPickerPanel2, TodoPickerPanel2;
|
|
445431
445621
|
var init_ChatInput = __esm({
|
|
445432
445622
|
async "dist/ui/components/chat/ChatInput.js"() {
|
|
445433
445623
|
"use strict";
|
|
445434
|
-
|
|
445624
|
+
import_react91 = __toESM(require_react(), 1);
|
|
445435
445625
|
await init_build2();
|
|
445436
445626
|
init_textUtils();
|
|
445437
445627
|
init_useInputBuffer();
|
|
@@ -445446,10 +445636,11 @@ var init_ChatInput = __esm({
|
|
|
445446
445636
|
init_useTodoPicker();
|
|
445447
445637
|
init_i18n();
|
|
445448
445638
|
init_ThemeContext();
|
|
445449
|
-
|
|
445450
|
-
|
|
445451
|
-
|
|
445452
|
-
|
|
445639
|
+
init_useBashMode();
|
|
445640
|
+
CommandPanel2 = (0, import_react91.lazy)(() => init_CommandPanel().then(() => CommandPanel_exports));
|
|
445641
|
+
FileList2 = (0, import_react91.lazy)(() => init_FileList().then(() => FileList_exports));
|
|
445642
|
+
AgentPickerPanel2 = (0, import_react91.lazy)(() => init_AgentPickerPanel().then(() => AgentPickerPanel_exports));
|
|
445643
|
+
TodoPickerPanel2 = (0, import_react91.lazy)(() => init_TodoPickerPanel().then(() => TodoPickerPanel_exports));
|
|
445453
445644
|
}
|
|
445454
445645
|
});
|
|
445455
445646
|
|
|
@@ -445459,38 +445650,38 @@ function PendingMessages({ pendingMessages }) {
|
|
|
445459
445650
|
if (pendingMessages.length === 0) {
|
|
445460
445651
|
return null;
|
|
445461
445652
|
}
|
|
445462
|
-
return
|
|
445653
|
+
return import_react92.default.createElement(
|
|
445463
445654
|
Box_default,
|
|
445464
445655
|
{ flexDirection: "column", borderStyle: "round", borderColor: theme14.colors.warning, paddingX: 1 },
|
|
445465
|
-
|
|
445656
|
+
import_react92.default.createElement(
|
|
445466
445657
|
Text,
|
|
445467
445658
|
{ color: theme14.colors.warning, bold: true },
|
|
445468
445659
|
"\u2B11 Pending Messages (",
|
|
445469
445660
|
pendingMessages.length,
|
|
445470
445661
|
")"
|
|
445471
445662
|
),
|
|
445472
|
-
pendingMessages.map((message, index) =>
|
|
445663
|
+
pendingMessages.map((message, index) => import_react92.default.createElement(
|
|
445473
445664
|
Box_default,
|
|
445474
445665
|
{ key: index, marginLeft: 1, marginY: 0, flexDirection: "column" },
|
|
445475
|
-
|
|
445666
|
+
import_react92.default.createElement(
|
|
445476
445667
|
Box_default,
|
|
445477
445668
|
null,
|
|
445478
|
-
|
|
445669
|
+
import_react92.default.createElement(
|
|
445479
445670
|
Text,
|
|
445480
445671
|
{ color: "blue", bold: true },
|
|
445481
445672
|
index + 1,
|
|
445482
445673
|
"."
|
|
445483
445674
|
),
|
|
445484
|
-
|
|
445675
|
+
import_react92.default.createElement(
|
|
445485
445676
|
Box_default,
|
|
445486
445677
|
{ marginLeft: 1 },
|
|
445487
|
-
|
|
445678
|
+
import_react92.default.createElement(Text, { color: theme14.colors.menuSecondary }, message.text.length > 60 ? `${message.text.substring(0, 60)}...` : message.text)
|
|
445488
445679
|
)
|
|
445489
445680
|
),
|
|
445490
|
-
message.images && message.images.length > 0 &&
|
|
445681
|
+
message.images && message.images.length > 0 && import_react92.default.createElement(
|
|
445491
445682
|
Box_default,
|
|
445492
445683
|
{ marginLeft: 3 },
|
|
445493
|
-
|
|
445684
|
+
import_react92.default.createElement(
|
|
445494
445685
|
Text,
|
|
445495
445686
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
445496
445687
|
"\u2514\u2500 ",
|
|
@@ -445501,14 +445692,14 @@ function PendingMessages({ pendingMessages }) {
|
|
|
445501
445692
|
)
|
|
445502
445693
|
)
|
|
445503
445694
|
)),
|
|
445504
|
-
|
|
445695
|
+
import_react92.default.createElement(Text, { color: theme14.colors.warning, dimColor: true }, "Will be sent after tool execution completes")
|
|
445505
445696
|
);
|
|
445506
445697
|
}
|
|
445507
|
-
var
|
|
445698
|
+
var import_react92;
|
|
445508
445699
|
var init_PendingMessages = __esm({
|
|
445509
445700
|
async "dist/ui/components/chat/PendingMessages.js"() {
|
|
445510
445701
|
"use strict";
|
|
445511
|
-
|
|
445702
|
+
import_react92 = __toESM(require_react(), 1);
|
|
445512
445703
|
await init_build2();
|
|
445513
445704
|
init_ThemeContext();
|
|
445514
445705
|
}
|
|
@@ -445516,12 +445707,12 @@ var init_PendingMessages = __esm({
|
|
|
445516
445707
|
|
|
445517
445708
|
// node_modules/ink-select-input/build/Indicator.js
|
|
445518
445709
|
function Indicator({ isSelected = false }) {
|
|
445519
|
-
return
|
|
445710
|
+
return import_react93.default.createElement(Box_default, { marginRight: 1 }, isSelected ? import_react93.default.createElement(Text, { color: "blue" }, figures_default.pointer) : import_react93.default.createElement(Text, null, " "));
|
|
445520
445711
|
}
|
|
445521
|
-
var
|
|
445712
|
+
var import_react93, Indicator_default;
|
|
445522
445713
|
var init_Indicator = __esm({
|
|
445523
445714
|
async "node_modules/ink-select-input/build/Indicator.js"() {
|
|
445524
|
-
|
|
445715
|
+
import_react93 = __toESM(require_react(), 1);
|
|
445525
445716
|
await init_build2();
|
|
445526
445717
|
init_figures();
|
|
445527
445718
|
Indicator_default = Indicator;
|
|
@@ -445573,17 +445764,17 @@ function SelectInput({ items = [], isFocused = true, initialIndex = 0, indicator
|
|
|
445573
445764
|
const hasLimit = typeof customLimit === "number" && items.length > customLimit;
|
|
445574
445765
|
const limit = hasLimit ? Math.min(customLimit, items.length) : items.length;
|
|
445575
445766
|
const lastIndex = limit - 1;
|
|
445576
|
-
const [rotateIndex, setRotateIndex] = (0,
|
|
445577
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
445578
|
-
const previousItems = (0,
|
|
445579
|
-
(0,
|
|
445767
|
+
const [rotateIndex, setRotateIndex] = (0, import_react94.useState)(initialIndex > lastIndex ? lastIndex - initialIndex : 0);
|
|
445768
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react94.useState)(initialIndex ? initialIndex > lastIndex ? lastIndex : initialIndex : 0);
|
|
445769
|
+
const previousItems = (0, import_react94.useRef)(items);
|
|
445770
|
+
(0, import_react94.useEffect)(() => {
|
|
445580
445771
|
if (!isDeepStrictEqual3(previousItems.current.map((item) => item.value), items.map((item) => item.value))) {
|
|
445581
445772
|
setRotateIndex(0);
|
|
445582
445773
|
setSelectedIndex(0);
|
|
445583
445774
|
}
|
|
445584
445775
|
previousItems.current = items;
|
|
445585
445776
|
}, [items]);
|
|
445586
|
-
use_input_default((0,
|
|
445777
|
+
use_input_default((0, import_react94.useCallback)((input2, key) => {
|
|
445587
445778
|
if (input2 === "k" || key.upArrow) {
|
|
445588
445779
|
const lastIndex2 = (hasLimit ? limit : items.length) - 1;
|
|
445589
445780
|
const atFirstIndex = selectedIndex === 0;
|
|
@@ -445635,23 +445826,23 @@ function SelectInput({ items = [], isFocused = true, initialIndex = 0, indicator
|
|
|
445635
445826
|
onHighlight
|
|
445636
445827
|
]), { isActive: isFocused });
|
|
445637
445828
|
const slicedItems = hasLimit ? toRotated(items, rotateIndex).slice(0, limit) : items;
|
|
445638
|
-
return
|
|
445829
|
+
return import_react94.default.createElement(Box_default, { flexDirection: "column" }, slicedItems.map((item, index) => {
|
|
445639
445830
|
const isSelected = index === selectedIndex;
|
|
445640
445831
|
return (
|
|
445641
445832
|
// @ts-expect-error - `key` can't be optional but `item.value` is generic T
|
|
445642
|
-
|
|
445833
|
+
import_react94.default.createElement(
|
|
445643
445834
|
Box_default,
|
|
445644
445835
|
{ key: item.key ?? item.value },
|
|
445645
|
-
|
|
445646
|
-
|
|
445836
|
+
import_react94.default.createElement(indicatorComponent, { isSelected }),
|
|
445837
|
+
import_react94.default.createElement(itemComponent, { ...item, isSelected })
|
|
445647
445838
|
)
|
|
445648
445839
|
);
|
|
445649
445840
|
}));
|
|
445650
445841
|
}
|
|
445651
|
-
var
|
|
445842
|
+
var import_react94, SelectInput_default;
|
|
445652
445843
|
var init_SelectInput = __esm({
|
|
445653
445844
|
async "node_modules/ink-select-input/build/SelectInput.js"() {
|
|
445654
|
-
|
|
445845
|
+
import_react94 = __toESM(require_react(), 1);
|
|
445655
445846
|
init_to_rotated();
|
|
445656
445847
|
await init_build2();
|
|
445657
445848
|
await init_Indicator();
|
|
@@ -445707,10 +445898,10 @@ function ToolConfirmation({ toolName, toolArguments, allTools, onConfirm }) {
|
|
|
445707
445898
|
var _a21, _b14;
|
|
445708
445899
|
const { theme: theme14 } = useTheme();
|
|
445709
445900
|
const { t } = useI18n();
|
|
445710
|
-
const [hasSelected, setHasSelected] = (0,
|
|
445711
|
-
const [showRejectInput, setShowRejectInput] = (0,
|
|
445712
|
-
const [rejectReason, setRejectReason] = (0,
|
|
445713
|
-
const sensitiveCommandCheck = (0,
|
|
445901
|
+
const [hasSelected, setHasSelected] = (0, import_react95.useState)(false);
|
|
445902
|
+
const [showRejectInput, setShowRejectInput] = (0, import_react95.useState)(false);
|
|
445903
|
+
const [rejectReason, setRejectReason] = (0, import_react95.useState)("");
|
|
445904
|
+
const sensitiveCommandCheck = (0, import_react95.useMemo)(() => {
|
|
445714
445905
|
if (toolName !== "terminal-execute" || !toolArguments) {
|
|
445715
445906
|
return { isSensitive: false };
|
|
445716
445907
|
}
|
|
@@ -445724,7 +445915,7 @@ function ToolConfirmation({ toolName, toolArguments, allTools, onConfirm }) {
|
|
|
445724
445915
|
}
|
|
445725
445916
|
return { isSensitive: false };
|
|
445726
445917
|
}, [toolName, toolArguments]);
|
|
445727
|
-
const formattedArgs = (0,
|
|
445918
|
+
const formattedArgs = (0, import_react95.useMemo)(() => {
|
|
445728
445919
|
if (!toolArguments)
|
|
445729
445920
|
return null;
|
|
445730
445921
|
try {
|
|
@@ -445734,7 +445925,7 @@ function ToolConfirmation({ toolName, toolArguments, allTools, onConfirm }) {
|
|
|
445734
445925
|
return null;
|
|
445735
445926
|
}
|
|
445736
445927
|
}, [toolArguments, toolName]);
|
|
445737
|
-
const formattedAllTools = (0,
|
|
445928
|
+
const formattedAllTools = (0, import_react95.useMemo)(() => {
|
|
445738
445929
|
if (!allTools || allTools.length === 0)
|
|
445739
445930
|
return null;
|
|
445740
445931
|
return allTools.map((tool) => {
|
|
@@ -445752,7 +445943,7 @@ function ToolConfirmation({ toolName, toolArguments, allTools, onConfirm }) {
|
|
|
445752
445943
|
}
|
|
445753
445944
|
});
|
|
445754
445945
|
}, [allTools]);
|
|
445755
|
-
const items = (0,
|
|
445946
|
+
const items = (0, import_react95.useMemo)(() => {
|
|
445756
445947
|
const baseItems = [
|
|
445757
445948
|
{
|
|
445758
445949
|
label: t.toolConfirmation.approveOnce,
|
|
@@ -445791,76 +445982,76 @@ function ToolConfirmation({ toolName, toolArguments, allTools, onConfirm }) {
|
|
|
445791
445982
|
onConfirm({ type: "reject_with_reply", reason: rejectReason.trim() });
|
|
445792
445983
|
}
|
|
445793
445984
|
};
|
|
445794
|
-
return
|
|
445985
|
+
return import_react95.default.createElement(
|
|
445795
445986
|
Box_default,
|
|
445796
445987
|
{ flexDirection: "column", marginX: 1, marginY: 1, borderStyle: "round", borderColor: theme14.colors.warning, paddingX: 1 },
|
|
445797
|
-
|
|
445988
|
+
import_react95.default.createElement(
|
|
445798
445989
|
Box_default,
|
|
445799
445990
|
{ marginBottom: 1 },
|
|
445800
|
-
|
|
445991
|
+
import_react95.default.createElement(Text, { bold: true, color: theme14.colors.warning }, t.toolConfirmation.header)
|
|
445801
445992
|
),
|
|
445802
|
-
!formattedAllTools &&
|
|
445803
|
-
|
|
445993
|
+
!formattedAllTools && import_react95.default.createElement(
|
|
445994
|
+
import_react95.default.Fragment,
|
|
445804
445995
|
null,
|
|
445805
|
-
|
|
445996
|
+
import_react95.default.createElement(
|
|
445806
445997
|
Box_default,
|
|
445807
445998
|
{ marginBottom: 1 },
|
|
445808
|
-
|
|
445999
|
+
import_react95.default.createElement(
|
|
445809
446000
|
Text,
|
|
445810
446001
|
null,
|
|
445811
446002
|
t.toolConfirmation.tool,
|
|
445812
446003
|
" ",
|
|
445813
|
-
|
|
446004
|
+
import_react95.default.createElement(Text, { bold: true, color: theme14.colors.menuInfo }, toolName)
|
|
445814
446005
|
)
|
|
445815
446006
|
),
|
|
445816
|
-
sensitiveCommandCheck.isSensitive &&
|
|
446007
|
+
sensitiveCommandCheck.isSensitive && import_react95.default.createElement(
|
|
445817
446008
|
Box_default,
|
|
445818
446009
|
{ flexDirection: "column", marginBottom: 1 },
|
|
445819
|
-
|
|
446010
|
+
import_react95.default.createElement(
|
|
445820
446011
|
Box_default,
|
|
445821
446012
|
{ marginBottom: 1 },
|
|
445822
|
-
|
|
446013
|
+
import_react95.default.createElement(Text, { bold: true, color: theme14.colors.error }, t.toolConfirmation.sensitiveCommandDetected)
|
|
445823
446014
|
),
|
|
445824
|
-
|
|
446015
|
+
import_react95.default.createElement(
|
|
445825
446016
|
Box_default,
|
|
445826
446017
|
{ flexDirection: "column", gap: 0 },
|
|
445827
|
-
|
|
446018
|
+
import_react95.default.createElement(
|
|
445828
446019
|
Box_default,
|
|
445829
446020
|
null,
|
|
445830
|
-
|
|
446021
|
+
import_react95.default.createElement(
|
|
445831
446022
|
Text,
|
|
445832
446023
|
{ dimColor: true },
|
|
445833
446024
|
t.toolConfirmation.pattern,
|
|
445834
446025
|
" "
|
|
445835
446026
|
),
|
|
445836
|
-
|
|
446027
|
+
import_react95.default.createElement(Text, { color: "magenta", bold: true }, (_a21 = sensitiveCommandCheck.matchedCommand) == null ? void 0 : _a21.pattern)
|
|
445837
446028
|
),
|
|
445838
|
-
|
|
446029
|
+
import_react95.default.createElement(
|
|
445839
446030
|
Box_default,
|
|
445840
446031
|
{ marginTop: 0 },
|
|
445841
|
-
|
|
446032
|
+
import_react95.default.createElement(
|
|
445842
446033
|
Text,
|
|
445843
446034
|
{ dimColor: true },
|
|
445844
446035
|
t.toolConfirmation.reason,
|
|
445845
446036
|
" "
|
|
445846
446037
|
),
|
|
445847
|
-
|
|
446038
|
+
import_react95.default.createElement(Text, { color: "white" }, (_b14 = sensitiveCommandCheck.matchedCommand) == null ? void 0 : _b14.description)
|
|
445848
446039
|
)
|
|
445849
446040
|
),
|
|
445850
|
-
|
|
446041
|
+
import_react95.default.createElement(
|
|
445851
446042
|
Box_default,
|
|
445852
446043
|
{ marginTop: 1, paddingX: 1, paddingY: 0 },
|
|
445853
|
-
|
|
446044
|
+
import_react95.default.createElement(Text, { color: theme14.colors.warning, italic: true }, t.toolConfirmation.requiresConfirmation)
|
|
445854
446045
|
)
|
|
445855
446046
|
),
|
|
445856
|
-
formattedArgs && formattedArgs.length > 0 &&
|
|
446047
|
+
formattedArgs && formattedArgs.length > 0 && import_react95.default.createElement(
|
|
445857
446048
|
Box_default,
|
|
445858
446049
|
{ flexDirection: "column", marginBottom: 1 },
|
|
445859
|
-
|
|
445860
|
-
formattedArgs.map((arg, index) =>
|
|
446050
|
+
import_react95.default.createElement(Text, { dimColor: true }, t.toolConfirmation.arguments),
|
|
446051
|
+
formattedArgs.map((arg, index) => import_react95.default.createElement(
|
|
445861
446052
|
Box_default,
|
|
445862
446053
|
{ key: index, flexDirection: "column" },
|
|
445863
|
-
|
|
446054
|
+
import_react95.default.createElement(
|
|
445864
446055
|
Text,
|
|
445865
446056
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
445866
446057
|
arg.isLast ? "\u2514\u2500" : "\u251C\u2500",
|
|
@@ -445868,36 +446059,36 @@ function ToolConfirmation({ toolName, toolArguments, allTools, onConfirm }) {
|
|
|
445868
446059
|
arg.key,
|
|
445869
446060
|
":",
|
|
445870
446061
|
" ",
|
|
445871
|
-
|
|
446062
|
+
import_react95.default.createElement(Text, { color: "white" }, arg.value)
|
|
445872
446063
|
)
|
|
445873
446064
|
))
|
|
445874
446065
|
)
|
|
445875
446066
|
),
|
|
445876
|
-
formattedAllTools &&
|
|
446067
|
+
formattedAllTools && import_react95.default.createElement(
|
|
445877
446068
|
Box_default,
|
|
445878
446069
|
{ flexDirection: "column", marginBottom: 1 },
|
|
445879
|
-
|
|
446070
|
+
import_react95.default.createElement(
|
|
445880
446071
|
Box_default,
|
|
445881
446072
|
{ marginBottom: 1 },
|
|
445882
|
-
|
|
446073
|
+
import_react95.default.createElement(
|
|
445883
446074
|
Text,
|
|
445884
446075
|
null,
|
|
445885
446076
|
t.toolConfirmation.tools,
|
|
445886
446077
|
" ",
|
|
445887
|
-
|
|
446078
|
+
import_react95.default.createElement(Text, { bold: true, color: theme14.colors.menuInfo }, t.toolConfirmation.toolsInParallel.replace("{count}", formattedAllTools.length.toString()))
|
|
445888
446079
|
)
|
|
445889
446080
|
),
|
|
445890
|
-
formattedAllTools.map((tool, toolIndex) =>
|
|
446081
|
+
formattedAllTools.map((tool, toolIndex) => import_react95.default.createElement(
|
|
445891
446082
|
Box_default,
|
|
445892
446083
|
{ key: toolIndex, flexDirection: "column", marginBottom: toolIndex < formattedAllTools.length - 1 ? 1 : 0 },
|
|
445893
|
-
|
|
446084
|
+
import_react95.default.createElement(
|
|
445894
446085
|
Text,
|
|
445895
446086
|
{ color: theme14.colors.menuInfo, bold: true },
|
|
445896
446087
|
toolIndex + 1,
|
|
445897
446088
|
". ",
|
|
445898
446089
|
tool.name
|
|
445899
446090
|
),
|
|
445900
|
-
tool.args.length > 0 &&
|
|
446091
|
+
tool.args.length > 0 && import_react95.default.createElement(Box_default, { flexDirection: "column", paddingLeft: 2 }, tool.args.map((arg, argIndex) => import_react95.default.createElement(
|
|
445901
446092
|
Text,
|
|
445902
446093
|
{ key: argIndex, color: theme14.colors.menuSecondary, dimColor: true },
|
|
445903
446094
|
arg.isLast ? "\u2514\u2500" : "\u251C\u2500",
|
|
@@ -445905,48 +446096,48 @@ function ToolConfirmation({ toolName, toolArguments, allTools, onConfirm }) {
|
|
|
445905
446096
|
arg.key,
|
|
445906
446097
|
":",
|
|
445907
446098
|
" ",
|
|
445908
|
-
|
|
446099
|
+
import_react95.default.createElement(Text, { color: "white" }, arg.value)
|
|
445909
446100
|
)))
|
|
445910
446101
|
))
|
|
445911
446102
|
),
|
|
445912
|
-
|
|
446103
|
+
import_react95.default.createElement(
|
|
445913
446104
|
Box_default,
|
|
445914
446105
|
{ marginBottom: 1 },
|
|
445915
|
-
|
|
446106
|
+
import_react95.default.createElement(Text, { dimColor: true }, t.toolConfirmation.selectAction)
|
|
445916
446107
|
),
|
|
445917
|
-
!hasSelected && !showRejectInput &&
|
|
445918
|
-
showRejectInput && !hasSelected &&
|
|
446108
|
+
!hasSelected && !showRejectInput && import_react95.default.createElement(SelectInput_default, { items, onSelect: handleSelect }),
|
|
446109
|
+
showRejectInput && !hasSelected && import_react95.default.createElement(
|
|
445919
446110
|
Box_default,
|
|
445920
446111
|
{ flexDirection: "column" },
|
|
445921
|
-
|
|
446112
|
+
import_react95.default.createElement(
|
|
445922
446113
|
Box_default,
|
|
445923
446114
|
{ marginBottom: 1 },
|
|
445924
|
-
|
|
446115
|
+
import_react95.default.createElement(Text, { color: theme14.colors.warning }, t.toolConfirmation.enterRejectionReason)
|
|
445925
446116
|
),
|
|
445926
|
-
|
|
446117
|
+
import_react95.default.createElement(
|
|
445927
446118
|
Box_default,
|
|
445928
446119
|
{ marginBottom: 1 },
|
|
445929
|
-
|
|
445930
|
-
|
|
446120
|
+
import_react95.default.createElement(Text, { color: theme14.colors.menuInfo }, "> "),
|
|
446121
|
+
import_react95.default.createElement(build_default2, { value: rejectReason, onChange: setRejectReason, onSubmit: handleRejectReasonSubmit })
|
|
445931
446122
|
),
|
|
445932
|
-
|
|
446123
|
+
import_react95.default.createElement(
|
|
445933
446124
|
Box_default,
|
|
445934
446125
|
null,
|
|
445935
|
-
|
|
446126
|
+
import_react95.default.createElement(Text, { dimColor: true }, t.toolConfirmation.pressEnterToSubmit)
|
|
445936
446127
|
)
|
|
445937
446128
|
),
|
|
445938
|
-
hasSelected &&
|
|
446129
|
+
hasSelected && import_react95.default.createElement(
|
|
445939
446130
|
Box_default,
|
|
445940
446131
|
null,
|
|
445941
|
-
|
|
446132
|
+
import_react95.default.createElement(Text, { color: theme14.colors.success }, t.toolConfirmation.confirmed)
|
|
445942
446133
|
)
|
|
445943
446134
|
);
|
|
445944
446135
|
}
|
|
445945
|
-
var
|
|
446136
|
+
var import_react95;
|
|
445946
446137
|
var init_ToolConfirmation = __esm({
|
|
445947
446138
|
async "dist/ui/components/tools/ToolConfirmation.js"() {
|
|
445948
446139
|
"use strict";
|
|
445949
|
-
|
|
446140
|
+
import_react95 = __toESM(require_react(), 1);
|
|
445950
446141
|
await init_build2();
|
|
445951
446142
|
await init_build5();
|
|
445952
446143
|
await init_build6();
|
|
@@ -445960,15 +446151,15 @@ var init_ToolConfirmation = __esm({
|
|
|
445960
446151
|
function AskUserQuestion({ question, options: options3, onAnswer }) {
|
|
445961
446152
|
const { theme: theme14 } = useTheme();
|
|
445962
446153
|
const { t } = useI18n();
|
|
445963
|
-
const [hasAnswered, setHasAnswered] = (0,
|
|
445964
|
-
const [showCustomInput, setShowCustomInput] = (0,
|
|
445965
|
-
const [customInput, setCustomInput] = (0,
|
|
445966
|
-
const [selectedItem, setSelectedItem] = (0,
|
|
445967
|
-
const handleHighlight = (0,
|
|
446154
|
+
const [hasAnswered, setHasAnswered] = (0, import_react96.useState)(false);
|
|
446155
|
+
const [showCustomInput, setShowCustomInput] = (0, import_react96.useState)(false);
|
|
446156
|
+
const [customInput, setCustomInput] = (0, import_react96.useState)("");
|
|
446157
|
+
const [selectedItem, setSelectedItem] = (0, import_react96.useState)(null);
|
|
446158
|
+
const handleHighlight = (0, import_react96.useCallback)((item) => {
|
|
445968
446159
|
setSelectedItem(item);
|
|
445969
446160
|
}, []);
|
|
445970
446161
|
const CUSTOM_INPUT_VALUE = "custom";
|
|
445971
|
-
const items = (0,
|
|
446162
|
+
const items = (0, import_react96.useMemo)(() => [
|
|
445972
446163
|
...options3.map((option, index) => ({
|
|
445973
446164
|
label: option,
|
|
445974
446165
|
value: `option-${index}`
|
|
@@ -445978,7 +446169,7 @@ function AskUserQuestion({ question, options: options3, onAnswer }) {
|
|
|
445978
446169
|
value: CUSTOM_INPUT_VALUE
|
|
445979
446170
|
}
|
|
445980
446171
|
], [options3, t.askUser.customInputOption]);
|
|
445981
|
-
const handleSelect = (0,
|
|
446172
|
+
const handleSelect = (0, import_react96.useCallback)((item) => {
|
|
445982
446173
|
if (!hasAnswered) {
|
|
445983
446174
|
if (item.value === CUSTOM_INPUT_VALUE) {
|
|
445984
446175
|
setShowCustomInput(true);
|
|
@@ -445990,7 +446181,7 @@ function AskUserQuestion({ question, options: options3, onAnswer }) {
|
|
|
445990
446181
|
}
|
|
445991
446182
|
}
|
|
445992
446183
|
}, [hasAnswered, CUSTOM_INPUT_VALUE, onAnswer]);
|
|
445993
|
-
const handleCustomInputSubmit = (0,
|
|
446184
|
+
const handleCustomInputSubmit = (0, import_react96.useCallback)(() => {
|
|
445994
446185
|
if (!hasAnswered && customInput.trim()) {
|
|
445995
446186
|
setHasAnswered(true);
|
|
445996
446187
|
onAnswer({
|
|
@@ -446014,55 +446205,55 @@ function AskUserQuestion({ question, options: options3, onAnswer }) {
|
|
|
446014
446205
|
}
|
|
446015
446206
|
}
|
|
446016
446207
|
}, { isActive: !showCustomInput && !hasAnswered });
|
|
446017
|
-
return
|
|
446208
|
+
return import_react96.default.createElement(
|
|
446018
446209
|
Box_default,
|
|
446019
446210
|
{ flexDirection: "column", marginX: 1, marginY: 1, borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1 },
|
|
446020
|
-
|
|
446211
|
+
import_react96.default.createElement(
|
|
446021
446212
|
Box_default,
|
|
446022
446213
|
{ marginBottom: 1 },
|
|
446023
|
-
|
|
446214
|
+
import_react96.default.createElement(Text, { bold: true, color: theme14.colors.menuInfo }, t.askUser.header)
|
|
446024
446215
|
),
|
|
446025
|
-
|
|
446216
|
+
import_react96.default.createElement(
|
|
446026
446217
|
Box_default,
|
|
446027
446218
|
{ marginBottom: 1 },
|
|
446028
|
-
|
|
446219
|
+
import_react96.default.createElement(Text, null, question)
|
|
446029
446220
|
),
|
|
446030
|
-
!showCustomInput ?
|
|
446221
|
+
!showCustomInput ? import_react96.default.createElement(
|
|
446031
446222
|
Box_default,
|
|
446032
446223
|
{ flexDirection: "column" },
|
|
446033
|
-
|
|
446224
|
+
import_react96.default.createElement(
|
|
446034
446225
|
Box_default,
|
|
446035
446226
|
{ marginBottom: 1 },
|
|
446036
|
-
|
|
446227
|
+
import_react96.default.createElement(Text, { dimColor: true }, t.askUser.selectPrompt)
|
|
446037
446228
|
),
|
|
446038
|
-
|
|
446039
|
-
|
|
446229
|
+
import_react96.default.createElement(ScrollableSelectInput, { items, onSelect: handleSelect, onHighlight: handleHighlight, isFocused: !showCustomInput }),
|
|
446230
|
+
import_react96.default.createElement(
|
|
446040
446231
|
Box_default,
|
|
446041
446232
|
{ marginTop: 1 },
|
|
446042
|
-
|
|
446233
|
+
import_react96.default.createElement(Text, { dimColor: true }, t.askUser.keyboardHints)
|
|
446043
446234
|
)
|
|
446044
|
-
) :
|
|
446235
|
+
) : import_react96.default.createElement(
|
|
446045
446236
|
Box_default,
|
|
446046
446237
|
{ flexDirection: "column" },
|
|
446047
|
-
|
|
446238
|
+
import_react96.default.createElement(
|
|
446048
446239
|
Box_default,
|
|
446049
446240
|
{ marginBottom: 1 },
|
|
446050
|
-
|
|
446241
|
+
import_react96.default.createElement(Text, { dimColor: true }, t.askUser.enterResponse)
|
|
446051
446242
|
),
|
|
446052
|
-
|
|
446243
|
+
import_react96.default.createElement(
|
|
446053
446244
|
Box_default,
|
|
446054
446245
|
null,
|
|
446055
|
-
|
|
446056
|
-
|
|
446246
|
+
import_react96.default.createElement(Text, { color: theme14.colors.success }, "> "),
|
|
446247
|
+
import_react96.default.createElement(build_default2, { value: customInput, onChange: setCustomInput, onSubmit: handleCustomInputSubmit })
|
|
446057
446248
|
)
|
|
446058
446249
|
)
|
|
446059
446250
|
);
|
|
446060
446251
|
}
|
|
446061
|
-
var
|
|
446252
|
+
var import_react96;
|
|
446062
446253
|
var init_AskUserQuestion = __esm({
|
|
446063
446254
|
async "dist/ui/components/special/AskUserQuestion.js"() {
|
|
446064
446255
|
"use strict";
|
|
446065
|
-
|
|
446256
|
+
import_react96 = __toESM(require_react(), 1);
|
|
446066
446257
|
await init_build2();
|
|
446067
446258
|
await init_build5();
|
|
446068
446259
|
await init_ScrollableSelectInput();
|
|
@@ -446072,88 +446263,88 @@ var init_AskUserQuestion = __esm({
|
|
|
446072
446263
|
});
|
|
446073
446264
|
|
|
446074
446265
|
// dist/ui/components/bash/BashCommandConfirmation.js
|
|
446075
|
-
function BashCommandConfirmation({ command }) {
|
|
446266
|
+
function BashCommandConfirmation({ command, terminalWidth }) {
|
|
446076
446267
|
const { t } = useI18n();
|
|
446077
446268
|
const { theme: theme14 } = useTheme();
|
|
446078
446269
|
const sensitiveCheck = isSensitiveCommand(command);
|
|
446079
|
-
return
|
|
446270
|
+
return import_react97.default.createElement(
|
|
446080
446271
|
Box_default,
|
|
446081
|
-
{ flexDirection: "column", borderStyle: "round", borderColor: theme14.colors.error, paddingX: 2, paddingY: 1 },
|
|
446082
|
-
|
|
446272
|
+
{ flexDirection: "column", borderStyle: "round", borderColor: theme14.colors.error, paddingX: 2, paddingY: 1, width: terminalWidth - 2 },
|
|
446273
|
+
import_react97.default.createElement(
|
|
446083
446274
|
Box_default,
|
|
446084
446275
|
{ marginBottom: 1 },
|
|
446085
|
-
|
|
446276
|
+
import_react97.default.createElement(Text, { bold: true, color: theme14.colors.error }, t.bash.sensitiveCommandDetected)
|
|
446086
446277
|
),
|
|
446087
|
-
|
|
446278
|
+
import_react97.default.createElement(
|
|
446088
446279
|
Box_default,
|
|
446089
446280
|
{ marginBottom: 1, paddingLeft: 2 },
|
|
446090
|
-
|
|
446281
|
+
import_react97.default.createElement(Text, { color: theme14.colors.menuInfo }, command)
|
|
446091
446282
|
),
|
|
446092
|
-
sensitiveCheck.isSensitive && sensitiveCheck.matchedCommand &&
|
|
446093
|
-
|
|
446283
|
+
sensitiveCheck.isSensitive && sensitiveCheck.matchedCommand && import_react97.default.createElement(
|
|
446284
|
+
import_react97.default.Fragment,
|
|
446094
446285
|
null,
|
|
446095
|
-
|
|
446286
|
+
import_react97.default.createElement(
|
|
446096
446287
|
Box_default,
|
|
446097
446288
|
{ marginBottom: 1 },
|
|
446098
|
-
|
|
446289
|
+
import_react97.default.createElement(
|
|
446099
446290
|
Text,
|
|
446100
446291
|
{ color: theme14.colors.warning },
|
|
446101
446292
|
t.bash.sensitivePattern,
|
|
446102
446293
|
" "
|
|
446103
446294
|
),
|
|
446104
|
-
|
|
446295
|
+
import_react97.default.createElement(Text, { dimColor: true }, sensitiveCheck.matchedCommand.pattern)
|
|
446105
446296
|
),
|
|
446106
|
-
|
|
446297
|
+
import_react97.default.createElement(
|
|
446107
446298
|
Box_default,
|
|
446108
446299
|
{ marginBottom: 1 },
|
|
446109
|
-
|
|
446300
|
+
import_react97.default.createElement(
|
|
446110
446301
|
Text,
|
|
446111
446302
|
{ color: theme14.colors.warning },
|
|
446112
446303
|
t.bash.sensitiveReason,
|
|
446113
446304
|
" "
|
|
446114
446305
|
),
|
|
446115
|
-
|
|
446306
|
+
import_react97.default.createElement(Text, { dimColor: true }, sensitiveCheck.matchedCommand.description)
|
|
446116
446307
|
)
|
|
446117
446308
|
),
|
|
446118
|
-
|
|
446309
|
+
import_react97.default.createElement(
|
|
446119
446310
|
Box_default,
|
|
446120
446311
|
{ marginBottom: 1 },
|
|
446121
|
-
|
|
446312
|
+
import_react97.default.createElement(Text, { color: theme14.colors.warning }, t.bash.executeConfirm)
|
|
446122
446313
|
),
|
|
446123
|
-
|
|
446314
|
+
import_react97.default.createElement(
|
|
446124
446315
|
Box_default,
|
|
446125
446316
|
null,
|
|
446126
|
-
|
|
446317
|
+
import_react97.default.createElement(Text, { dimColor: true }, t.bash.confirmHint)
|
|
446127
446318
|
)
|
|
446128
446319
|
);
|
|
446129
446320
|
}
|
|
446130
|
-
function BashCommandExecutionStatus({ command, timeout: timeout2 = 3e4 }) {
|
|
446321
|
+
function BashCommandExecutionStatus({ command, timeout: timeout2 = 3e4, terminalWidth }) {
|
|
446131
446322
|
const { t } = useI18n();
|
|
446132
446323
|
const { theme: theme14 } = useTheme();
|
|
446133
446324
|
const timeoutSeconds = Math.round(timeout2 / 1e3);
|
|
446134
|
-
return
|
|
446325
|
+
return import_react97.default.createElement(
|
|
446135
446326
|
Box_default,
|
|
446136
|
-
{ flexDirection: "column", borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 2, paddingY: 1 },
|
|
446137
|
-
|
|
446327
|
+
{ flexDirection: "column", borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 2, paddingY: 1, width: terminalWidth - 2 },
|
|
446328
|
+
import_react97.default.createElement(
|
|
446138
446329
|
Box_default,
|
|
446139
446330
|
{ marginBottom: 1 },
|
|
446140
|
-
|
|
446331
|
+
import_react97.default.createElement(
|
|
446141
446332
|
Text,
|
|
446142
446333
|
{ bold: true, color: theme14.colors.menuInfo },
|
|
446143
|
-
|
|
446334
|
+
import_react97.default.createElement(build_default, { type: "dots" }),
|
|
446144
446335
|
" ",
|
|
446145
446336
|
t.bash.executingCommand
|
|
446146
446337
|
)
|
|
446147
446338
|
),
|
|
446148
|
-
|
|
446339
|
+
import_react97.default.createElement(
|
|
446149
446340
|
Box_default,
|
|
446150
446341
|
{ marginBottom: 1, paddingLeft: 2 },
|
|
446151
|
-
|
|
446342
|
+
import_react97.default.createElement(Text, { dimColor: true }, command)
|
|
446152
446343
|
),
|
|
446153
|
-
|
|
446344
|
+
import_react97.default.createElement(
|
|
446154
446345
|
Box_default,
|
|
446155
446346
|
null,
|
|
446156
|
-
|
|
446347
|
+
import_react97.default.createElement(
|
|
446157
446348
|
Text,
|
|
446158
446349
|
{ dimColor: true },
|
|
446159
446350
|
t.bash.timeout,
|
|
@@ -446161,16 +446352,16 @@ function BashCommandExecutionStatus({ command, timeout: timeout2 = 3e4 }) {
|
|
|
446161
446352
|
timeoutSeconds,
|
|
446162
446353
|
"s",
|
|
446163
446354
|
" ",
|
|
446164
|
-
timeout2 > 6e4 &&
|
|
446355
|
+
timeout2 > 6e4 && import_react97.default.createElement(Text, { color: theme14.colors.warning }, t.bash.customTimeout)
|
|
446165
446356
|
)
|
|
446166
446357
|
)
|
|
446167
446358
|
);
|
|
446168
446359
|
}
|
|
446169
|
-
var
|
|
446360
|
+
var import_react97;
|
|
446170
446361
|
var init_BashCommandConfirmation = __esm({
|
|
446171
446362
|
async "dist/ui/components/bash/BashCommandConfirmation.js"() {
|
|
446172
446363
|
"use strict";
|
|
446173
|
-
|
|
446364
|
+
import_react97 = __toESM(require_react(), 1);
|
|
446174
446365
|
await init_build2();
|
|
446175
446366
|
await init_build3();
|
|
446176
446367
|
init_I18nContext();
|
|
@@ -446181,9 +446372,9 @@ var init_BashCommandConfirmation = __esm({
|
|
|
446181
446372
|
|
|
446182
446373
|
// dist/ui/components/tools/FileRollbackConfirmation.js
|
|
446183
446374
|
function FileRollbackConfirmation({ fileCount, filePaths, onConfirm }) {
|
|
446184
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
446185
|
-
const [showFullList, setShowFullList] = (0,
|
|
446186
|
-
const [fileScrollIndex, setFileScrollIndex] = (0,
|
|
446375
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react98.useState)(0);
|
|
446376
|
+
const [showFullList, setShowFullList] = (0, import_react98.useState)(false);
|
|
446377
|
+
const [fileScrollIndex, setFileScrollIndex] = (0, import_react98.useState)(0);
|
|
446187
446378
|
const options3 = [
|
|
446188
446379
|
{ label: "Yes, rollback files and conversation", value: true },
|
|
446189
446380
|
{ label: "No, rollback conversation only", value: false }
|
|
@@ -446236,18 +446427,18 @@ function FileRollbackConfirmation({ fileCount, filePaths, onConfirm }) {
|
|
|
446236
446427
|
const remainingCountCompact = fileCount - maxFilesToShowCompact;
|
|
446237
446428
|
const hasMoreAbove = showFullList && fileScrollIndex > 0;
|
|
446238
446429
|
const hasMoreBelow = showFullList && fileScrollIndex + maxFilesToShowFull < filePaths.length;
|
|
446239
|
-
return
|
|
446430
|
+
return import_react98.default.createElement(
|
|
446240
446431
|
Box_default,
|
|
446241
446432
|
{ flexDirection: "column", marginX: 1, marginBottom: 1, padding: 1 },
|
|
446242
|
-
|
|
446433
|
+
import_react98.default.createElement(
|
|
446243
446434
|
Box_default,
|
|
446244
446435
|
{ marginBottom: 1 },
|
|
446245
|
-
|
|
446436
|
+
import_react98.default.createElement(Text, { color: "yellow", bold: true }, "\u26A0 File Rollback Confirmation")
|
|
446246
446437
|
),
|
|
446247
|
-
|
|
446438
|
+
import_react98.default.createElement(
|
|
446248
446439
|
Box_default,
|
|
446249
446440
|
{ marginBottom: 1 },
|
|
446250
|
-
|
|
446441
|
+
import_react98.default.createElement(
|
|
446251
446442
|
Text,
|
|
446252
446443
|
{ color: "white" },
|
|
446253
446444
|
"This checkpoint has ",
|
|
@@ -446257,30 +446448,30 @@ function FileRollbackConfirmation({ fileCount, filePaths, onConfirm }) {
|
|
|
446257
446448
|
" that will be rolled back:"
|
|
446258
446449
|
)
|
|
446259
446450
|
),
|
|
446260
|
-
|
|
446451
|
+
import_react98.default.createElement(
|
|
446261
446452
|
Box_default,
|
|
446262
446453
|
{ flexDirection: "column", marginBottom: 1, marginLeft: 2 },
|
|
446263
|
-
hasMoreAbove &&
|
|
446454
|
+
hasMoreAbove && import_react98.default.createElement(
|
|
446264
446455
|
Text,
|
|
446265
446456
|
{ color: "gray", dimColor: true },
|
|
446266
446457
|
"\u2191 ",
|
|
446267
446458
|
fileScrollIndex,
|
|
446268
446459
|
" more above..."
|
|
446269
446460
|
),
|
|
446270
|
-
displayFiles.map((file, index) =>
|
|
446461
|
+
displayFiles.map((file, index) => import_react98.default.createElement(
|
|
446271
446462
|
Text,
|
|
446272
446463
|
{ key: index, color: "cyan", dimColor: true },
|
|
446273
446464
|
"\u2022 ",
|
|
446274
446465
|
file
|
|
446275
446466
|
)),
|
|
446276
|
-
hasMoreBelow &&
|
|
446467
|
+
hasMoreBelow && import_react98.default.createElement(
|
|
446277
446468
|
Text,
|
|
446278
446469
|
{ color: "gray", dimColor: true },
|
|
446279
446470
|
"\u2193 ",
|
|
446280
446471
|
filePaths.length - (fileScrollIndex + maxFilesToShowFull),
|
|
446281
446472
|
" more below..."
|
|
446282
446473
|
),
|
|
446283
|
-
!showFullList && remainingCountCompact > 0 &&
|
|
446474
|
+
!showFullList && remainingCountCompact > 0 && import_react98.default.createElement(
|
|
446284
446475
|
Text,
|
|
446285
446476
|
{ color: "gray", dimColor: true },
|
|
446286
446477
|
"... and ",
|
|
@@ -446289,18 +446480,18 @@ function FileRollbackConfirmation({ fileCount, filePaths, onConfirm }) {
|
|
|
446289
446480
|
remainingCountCompact > 1 ? "s" : ""
|
|
446290
446481
|
)
|
|
446291
446482
|
),
|
|
446292
|
-
!showFullList &&
|
|
446293
|
-
|
|
446483
|
+
!showFullList && import_react98.default.createElement(
|
|
446484
|
+
import_react98.default.Fragment,
|
|
446294
446485
|
null,
|
|
446295
|
-
|
|
446486
|
+
import_react98.default.createElement(
|
|
446296
446487
|
Box_default,
|
|
446297
446488
|
{ marginBottom: 1 },
|
|
446298
|
-
|
|
446489
|
+
import_react98.default.createElement(Text, { color: "gray", dimColor: true }, "Do you want to rollback the files as well?")
|
|
446299
446490
|
),
|
|
446300
|
-
|
|
446491
|
+
import_react98.default.createElement(Box_default, { flexDirection: "column", marginBottom: 1 }, options3.map((option, index) => import_react98.default.createElement(
|
|
446301
446492
|
Box_default,
|
|
446302
446493
|
{ key: index },
|
|
446303
|
-
|
|
446494
|
+
import_react98.default.createElement(
|
|
446304
446495
|
Text,
|
|
446305
446496
|
{ color: index === selectedIndex ? "green" : "white", bold: index === selectedIndex },
|
|
446306
446497
|
index === selectedIndex ? "\u276F " : " ",
|
|
@@ -446308,26 +446499,26 @@ function FileRollbackConfirmation({ fileCount, filePaths, onConfirm }) {
|
|
|
446308
446499
|
)
|
|
446309
446500
|
)))
|
|
446310
446501
|
),
|
|
446311
|
-
|
|
446502
|
+
import_react98.default.createElement(
|
|
446312
446503
|
Box_default,
|
|
446313
446504
|
null,
|
|
446314
|
-
|
|
446505
|
+
import_react98.default.createElement(Text, { color: "gray", dimColor: true }, showFullList ? "\u2191\u2193 scroll \xB7 Tab back \xB7 ESC close" : fileCount > maxFilesToShowCompact ? `\u2191\u2193 select \xB7 Tab view all (${fileCount} files) \xB7 Enter confirm \xB7 ESC cancel` : "\u2191\u2193 select \xB7 Enter confirm \xB7 ESC cancel")
|
|
446315
446506
|
)
|
|
446316
446507
|
);
|
|
446317
446508
|
}
|
|
446318
|
-
var
|
|
446509
|
+
var import_react98;
|
|
446319
446510
|
var init_FileRollbackConfirmation = __esm({
|
|
446320
446511
|
async "dist/ui/components/tools/FileRollbackConfirmation.js"() {
|
|
446321
446512
|
"use strict";
|
|
446322
|
-
|
|
446513
|
+
import_react98 = __toESM(require_react(), 1);
|
|
446323
446514
|
await init_build2();
|
|
446324
446515
|
}
|
|
446325
446516
|
});
|
|
446326
446517
|
|
|
446327
446518
|
// dist/ui/components/common/ShimmerText.js
|
|
446328
446519
|
function ShimmerText({ text: text2 }) {
|
|
446329
|
-
const [frame, setFrame] = (0,
|
|
446330
|
-
(0,
|
|
446520
|
+
const [frame, setFrame] = (0, import_react99.useState)(0);
|
|
446521
|
+
(0, import_react99.useEffect)(() => {
|
|
446331
446522
|
const interval = setInterval(() => {
|
|
446332
446523
|
setFrame((prev) => (prev + 1) % (text2.length + 5));
|
|
446333
446524
|
}, 100);
|
|
@@ -446343,13 +446534,13 @@ function ShimmerText({ text: text2 }) {
|
|
|
446343
446534
|
output2 += source_default.hex("#1ACEB0")(char);
|
|
446344
446535
|
}
|
|
446345
446536
|
}
|
|
446346
|
-
return
|
|
446537
|
+
return import_react99.default.createElement(Text, null, output2);
|
|
446347
446538
|
}
|
|
446348
|
-
var
|
|
446539
|
+
var import_react99;
|
|
446349
446540
|
var init_ShimmerText = __esm({
|
|
446350
446541
|
async "dist/ui/components/common/ShimmerText.js"() {
|
|
446351
446542
|
"use strict";
|
|
446352
|
-
|
|
446543
|
+
import_react99 = __toESM(require_react(), 1);
|
|
446353
446544
|
await init_build2();
|
|
446354
446545
|
init_source();
|
|
446355
446546
|
}
|
|
@@ -520715,7 +520906,7 @@ function renderTablesWithMarked(content) {
|
|
|
520715
520906
|
}
|
|
520716
520907
|
function renderFallback(content) {
|
|
520717
520908
|
const lines = content.split("\n");
|
|
520718
|
-
return
|
|
520909
|
+
return import_react100.default.createElement(Box_default, { flexDirection: "column" }, lines.map((line, index) => import_react100.default.createElement(Text, { key: index }, line || " ")));
|
|
520719
520910
|
}
|
|
520720
520911
|
function MarkdownRenderer({ content }) {
|
|
520721
520912
|
var _a21, _b14, _c6;
|
|
@@ -520742,9 +520933,9 @@ function MarkdownRenderer({ content }) {
|
|
|
520742
520933
|
totalLines: lines.length,
|
|
520743
520934
|
truncatedTo: 500
|
|
520744
520935
|
});
|
|
520745
|
-
return
|
|
520936
|
+
return import_react100.default.createElement(Box_default, { flexDirection: "column" }, lines.slice(0, 500).map((line, index) => import_react100.default.createElement(Text, { key: index }, line || " ")));
|
|
520746
520937
|
}
|
|
520747
|
-
return
|
|
520938
|
+
return import_react100.default.createElement(Box_default, { flexDirection: "column" }, lines.map((line, index) => import_react100.default.createElement(Text, { key: index }, line || " ")));
|
|
520748
520939
|
} catch (error) {
|
|
520749
520940
|
if ((_c6 = error == null ? void 0 : error.message) == null ? void 0 : _c6.includes("Number must be >")) {
|
|
520750
520941
|
logger_default.warn("[MarkdownRenderer] Invalid list numbering detected, falling back to plain text", {
|
|
@@ -520759,11 +520950,11 @@ function MarkdownRenderer({ content }) {
|
|
|
520759
520950
|
return renderFallback(content);
|
|
520760
520951
|
}
|
|
520761
520952
|
}
|
|
520762
|
-
var
|
|
520953
|
+
var import_react100, import_markdown_it_terminal, import_cli_highlight2, md, originalFenceRule;
|
|
520763
520954
|
var init_MarkdownRenderer = __esm({
|
|
520764
520955
|
async "dist/ui/components/common/MarkdownRenderer.js"() {
|
|
520765
520956
|
"use strict";
|
|
520766
|
-
|
|
520957
|
+
import_react100 = __toESM(require_react(), 1);
|
|
520767
520958
|
await init_build2();
|
|
520768
520959
|
init_markdown_it();
|
|
520769
520960
|
import_markdown_it_terminal = __toESM(require_markdown_it_terminal2(), 1);
|
|
@@ -520858,13 +521049,13 @@ function TodoTree({ todos }) {
|
|
|
520858
521049
|
const indent = " ".repeat(depth);
|
|
520859
521050
|
const statusIcon = getStatusIcon(todo.status);
|
|
520860
521051
|
const statusColor = getStatusColor(todo.status);
|
|
520861
|
-
return
|
|
521052
|
+
return import_react101.default.createElement(
|
|
520862
521053
|
Box_default,
|
|
520863
521054
|
{ key: todo.id, flexDirection: "column" },
|
|
520864
|
-
|
|
521055
|
+
import_react101.default.createElement(
|
|
520865
521056
|
Box_default,
|
|
520866
521057
|
null,
|
|
520867
|
-
|
|
521058
|
+
import_react101.default.createElement(
|
|
520868
521059
|
Text,
|
|
520869
521060
|
{ color: statusColor },
|
|
520870
521061
|
indent,
|
|
@@ -520876,27 +521067,27 @@ function TodoTree({ todos }) {
|
|
|
520876
521067
|
children.map((child) => renderTodo(child, depth + 1))
|
|
520877
521068
|
);
|
|
520878
521069
|
};
|
|
520879
|
-
return
|
|
521070
|
+
return import_react101.default.createElement(
|
|
520880
521071
|
Box_default,
|
|
520881
521072
|
{ flexDirection: "column", borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1, marginBottom: 1 },
|
|
520882
|
-
|
|
521073
|
+
import_react101.default.createElement(
|
|
520883
521074
|
Box_default,
|
|
520884
521075
|
{ marginBottom: 0 },
|
|
520885
|
-
|
|
521076
|
+
import_react101.default.createElement(Text, { bold: true, color: theme14.colors.menuInfo }, "TODO List")
|
|
520886
521077
|
),
|
|
520887
521078
|
rootTodos.map((todo) => renderTodo(todo)),
|
|
520888
|
-
|
|
521079
|
+
import_react101.default.createElement(
|
|
520889
521080
|
Box_default,
|
|
520890
521081
|
{ marginTop: 0 },
|
|
520891
|
-
|
|
521082
|
+
import_react101.default.createElement(Text, { dimColor: true, color: theme14.colors.menuSecondary }, "[ ] Pending \xB7 [\u2713] Completed")
|
|
520892
521083
|
)
|
|
520893
521084
|
);
|
|
520894
521085
|
}
|
|
520895
|
-
var
|
|
521086
|
+
var import_react101;
|
|
520896
521087
|
var init_TodoTree = __esm({
|
|
520897
521088
|
async "dist/ui/components/special/TodoTree.js"() {
|
|
520898
521089
|
"use strict";
|
|
520899
|
-
|
|
521090
|
+
import_react101 = __toESM(require_react(), 1);
|
|
520900
521091
|
await init_build2();
|
|
520901
521092
|
init_ThemeContext();
|
|
520902
521093
|
}
|
|
@@ -520937,10 +521128,10 @@ function renderSubAgentPreview(data, _maxLines) {
|
|
|
520937
521128
|
if (!data.result)
|
|
520938
521129
|
return null;
|
|
520939
521130
|
const lines = data.result.split("\n").filter((line) => line.trim());
|
|
520940
|
-
return
|
|
521131
|
+
return import_react102.default.createElement(
|
|
520941
521132
|
Box_default,
|
|
520942
521133
|
{ marginLeft: 2 },
|
|
520943
|
-
|
|
521134
|
+
import_react102.default.createElement(
|
|
520944
521135
|
Text,
|
|
520945
521136
|
{ color: "gray", dimColor: true },
|
|
520946
521137
|
"\u2514\u2500 Sub-agent completed (",
|
|
@@ -520956,10 +521147,10 @@ function renderTerminalExecutePreview(data, isSubAgentInternal) {
|
|
|
520956
521147
|
const hasStdout = data.stdout && data.stdout.trim();
|
|
520957
521148
|
const hasStderr = data.stderr && data.stderr.trim();
|
|
520958
521149
|
if (isSubAgentInternal) {
|
|
520959
|
-
return
|
|
521150
|
+
return import_react102.default.createElement(
|
|
520960
521151
|
Box_default,
|
|
520961
521152
|
{ marginLeft: 2 },
|
|
520962
|
-
|
|
521153
|
+
import_react102.default.createElement(
|
|
520963
521154
|
Text,
|
|
520964
521155
|
{ color: hasError ? "red" : "gray", dimColor: true },
|
|
520965
521156
|
"\u2514\u2500 Exit code: ",
|
|
@@ -520972,10 +521163,10 @@ function renderTerminalExecutePreview(data, isSubAgentInternal) {
|
|
|
520972
521163
|
const showFullOutput = hasError;
|
|
520973
521164
|
if (!showFullOutput) {
|
|
520974
521165
|
if (!hasStdout) {
|
|
520975
|
-
return
|
|
521166
|
+
return import_react102.default.createElement(
|
|
520976
521167
|
Box_default,
|
|
520977
521168
|
{ marginLeft: 2 },
|
|
520978
|
-
|
|
521169
|
+
import_react102.default.createElement(
|
|
520979
521170
|
Text,
|
|
520980
521171
|
{ color: "green", dimColor: true },
|
|
520981
521172
|
"\u2514\u2500 \u2713 Exit code: ",
|
|
@@ -520983,29 +521174,29 @@ function renderTerminalExecutePreview(data, isSubAgentInternal) {
|
|
|
520983
521174
|
)
|
|
520984
521175
|
);
|
|
520985
521176
|
}
|
|
520986
|
-
return
|
|
521177
|
+
return import_react102.default.createElement(
|
|
520987
521178
|
Box_default,
|
|
520988
521179
|
{ flexDirection: "column", marginLeft: 2 },
|
|
520989
|
-
|
|
521180
|
+
import_react102.default.createElement(
|
|
520990
521181
|
Text,
|
|
520991
521182
|
{ color: "green", dimColor: true },
|
|
520992
521183
|
"\u251C\u2500 command: ",
|
|
520993
521184
|
data.command
|
|
520994
521185
|
),
|
|
520995
|
-
|
|
521186
|
+
import_react102.default.createElement(
|
|
520996
521187
|
Text,
|
|
520997
521188
|
{ color: "green", dimColor: true },
|
|
520998
521189
|
"\u251C\u2500 exitCode: ",
|
|
520999
521190
|
data.exitCode,
|
|
521000
521191
|
" \u2713"
|
|
521001
521192
|
),
|
|
521002
|
-
|
|
521193
|
+
import_react102.default.createElement(
|
|
521003
521194
|
Box_default,
|
|
521004
521195
|
{ flexDirection: "column" },
|
|
521005
|
-
|
|
521006
|
-
|
|
521196
|
+
import_react102.default.createElement(Text, { color: "gray", dimColor: true }, "\u251C\u2500 stdout:"),
|
|
521197
|
+
import_react102.default.createElement(Box_default, { marginLeft: 2, flexDirection: "column" }, data.stdout.split("\n").map((line, idx2) => import_react102.default.createElement(Text, { key: idx2, color: "white" }, line)))
|
|
521007
521198
|
),
|
|
521008
|
-
|
|
521199
|
+
import_react102.default.createElement(
|
|
521009
521200
|
Text,
|
|
521010
521201
|
{ color: "gray", dimColor: true },
|
|
521011
521202
|
"\u2514\u2500 executedAt: ",
|
|
@@ -521013,35 +521204,35 @@ function renderTerminalExecutePreview(data, isSubAgentInternal) {
|
|
|
521013
521204
|
)
|
|
521014
521205
|
);
|
|
521015
521206
|
}
|
|
521016
|
-
return
|
|
521207
|
+
return import_react102.default.createElement(
|
|
521017
521208
|
Box_default,
|
|
521018
521209
|
{ flexDirection: "column", marginLeft: 2 },
|
|
521019
|
-
|
|
521210
|
+
import_react102.default.createElement(
|
|
521020
521211
|
Text,
|
|
521021
521212
|
{ color: "gray", dimColor: true },
|
|
521022
521213
|
"\u251C\u2500 command: ",
|
|
521023
521214
|
data.command
|
|
521024
521215
|
),
|
|
521025
|
-
|
|
521216
|
+
import_react102.default.createElement(
|
|
521026
521217
|
Text,
|
|
521027
521218
|
{ color: "red", bold: true },
|
|
521028
521219
|
"\u251C\u2500 exitCode: ",
|
|
521029
521220
|
data.exitCode,
|
|
521030
521221
|
" \u26A0\uFE0F FAILED"
|
|
521031
521222
|
),
|
|
521032
|
-
hasStdout &&
|
|
521223
|
+
hasStdout && import_react102.default.createElement(
|
|
521033
521224
|
Box_default,
|
|
521034
521225
|
{ flexDirection: "column" },
|
|
521035
|
-
|
|
521036
|
-
|
|
521226
|
+
import_react102.default.createElement(Text, { color: "gray", dimColor: true }, "\u251C\u2500 stdout:"),
|
|
521227
|
+
import_react102.default.createElement(Box_default, { marginLeft: 2, flexDirection: "column" }, data.stdout.split("\n").map((line, idx2) => import_react102.default.createElement(Text, { key: idx2, color: "yellow" }, line)))
|
|
521037
521228
|
),
|
|
521038
|
-
hasStderr &&
|
|
521229
|
+
hasStderr && import_react102.default.createElement(
|
|
521039
521230
|
Box_default,
|
|
521040
521231
|
{ flexDirection: "column" },
|
|
521041
|
-
|
|
521042
|
-
|
|
521232
|
+
import_react102.default.createElement(Text, { color: "red", dimColor: true }, "\u251C\u2500 stderr:"),
|
|
521233
|
+
import_react102.default.createElement(Box_default, { marginLeft: 2, flexDirection: "column" }, data.stderr.split("\n").map((line, idx2) => import_react102.default.createElement(Text, { key: idx2, color: "red" }, line)))
|
|
521043
521234
|
),
|
|
521044
|
-
data.executedAt &&
|
|
521235
|
+
data.executedAt && import_react102.default.createElement(
|
|
521045
521236
|
Text,
|
|
521046
521237
|
{ color: "gray", dimColor: true },
|
|
521047
521238
|
"\u2514\u2500 executedAt: ",
|
|
@@ -521056,10 +521247,10 @@ function renderReadPreview(data, isSubAgentInternal) {
|
|
|
521056
521247
|
const readLineCount = lines.length;
|
|
521057
521248
|
const totalLines = data.totalLines || readLineCount;
|
|
521058
521249
|
if (isSubAgentInternal) {
|
|
521059
|
-
return
|
|
521250
|
+
return import_react102.default.createElement(
|
|
521060
521251
|
Box_default,
|
|
521061
521252
|
{ marginLeft: 2 },
|
|
521062
|
-
|
|
521253
|
+
import_react102.default.createElement(
|
|
521063
521254
|
Text,
|
|
521064
521255
|
{ color: "gray", dimColor: true },
|
|
521065
521256
|
"\u2514\u2500 Read ",
|
|
@@ -521070,10 +521261,10 @@ function renderReadPreview(data, isSubAgentInternal) {
|
|
|
521070
521261
|
);
|
|
521071
521262
|
}
|
|
521072
521263
|
const rangeInfo = data.startLine && data.endLine ? ` (lines ${data.startLine}-${data.endLine})` : "";
|
|
521073
|
-
return
|
|
521264
|
+
return import_react102.default.createElement(
|
|
521074
521265
|
Box_default,
|
|
521075
521266
|
{ marginLeft: 2 },
|
|
521076
|
-
|
|
521267
|
+
import_react102.default.createElement(
|
|
521077
521268
|
Text,
|
|
521078
521269
|
{ color: "gray", dimColor: true },
|
|
521079
521270
|
"\u2514\u2500 Read ",
|
|
@@ -521088,17 +521279,17 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
521088
521279
|
var _a21, _b14, _c6, _d4, _e2, _f;
|
|
521089
521280
|
if (toolName === "ace-text-search" || toolName === "ace-text_search") {
|
|
521090
521281
|
if (!data || data.length === 0) {
|
|
521091
|
-
return
|
|
521282
|
+
return import_react102.default.createElement(
|
|
521092
521283
|
Box_default,
|
|
521093
521284
|
{ marginLeft: 2 },
|
|
521094
|
-
|
|
521285
|
+
import_react102.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No matches found")
|
|
521095
521286
|
);
|
|
521096
521287
|
}
|
|
521097
521288
|
const results = Array.isArray(data) ? data : [];
|
|
521098
|
-
return
|
|
521289
|
+
return import_react102.default.createElement(
|
|
521099
521290
|
Box_default,
|
|
521100
521291
|
{ marginLeft: 2 },
|
|
521101
|
-
|
|
521292
|
+
import_react102.default.createElement(
|
|
521102
521293
|
Text,
|
|
521103
521294
|
{ color: "gray", dimColor: true },
|
|
521104
521295
|
"\u2514\u2500 Found ",
|
|
@@ -521111,16 +521302,16 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
521111
521302
|
if (toolName === "ace-search-symbols" || toolName === "ace-search_symbols") {
|
|
521112
521303
|
const symbols = data.symbols || [];
|
|
521113
521304
|
if (symbols.length === 0) {
|
|
521114
|
-
return
|
|
521305
|
+
return import_react102.default.createElement(
|
|
521115
521306
|
Box_default,
|
|
521116
521307
|
{ marginLeft: 2 },
|
|
521117
|
-
|
|
521308
|
+
import_react102.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No symbols found")
|
|
521118
521309
|
);
|
|
521119
521310
|
}
|
|
521120
|
-
return
|
|
521311
|
+
return import_react102.default.createElement(
|
|
521121
521312
|
Box_default,
|
|
521122
521313
|
{ marginLeft: 2 },
|
|
521123
|
-
|
|
521314
|
+
import_react102.default.createElement(
|
|
521124
521315
|
Text,
|
|
521125
521316
|
{ color: "gray", dimColor: true },
|
|
521126
521317
|
"\u2514\u2500 Found ",
|
|
@@ -521133,16 +521324,16 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
521133
521324
|
if (toolName === "ace-find-references" || toolName === "ace-find_references") {
|
|
521134
521325
|
const references = Array.isArray(data) ? data : [];
|
|
521135
521326
|
if (references.length === 0) {
|
|
521136
|
-
return
|
|
521327
|
+
return import_react102.default.createElement(
|
|
521137
521328
|
Box_default,
|
|
521138
521329
|
{ marginLeft: 2 },
|
|
521139
|
-
|
|
521330
|
+
import_react102.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No references found")
|
|
521140
521331
|
);
|
|
521141
521332
|
}
|
|
521142
|
-
return
|
|
521333
|
+
return import_react102.default.createElement(
|
|
521143
521334
|
Box_default,
|
|
521144
521335
|
{ marginLeft: 2 },
|
|
521145
|
-
|
|
521336
|
+
import_react102.default.createElement(
|
|
521146
521337
|
Text,
|
|
521147
521338
|
{ color: "gray", dimColor: true },
|
|
521148
521339
|
"\u2514\u2500 Found ",
|
|
@@ -521154,16 +521345,16 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
521154
521345
|
}
|
|
521155
521346
|
if (toolName === "ace-find-definition" || toolName === "ace-find_definition") {
|
|
521156
521347
|
if (!data) {
|
|
521157
|
-
return
|
|
521348
|
+
return import_react102.default.createElement(
|
|
521158
521349
|
Box_default,
|
|
521159
521350
|
{ marginLeft: 2 },
|
|
521160
|
-
|
|
521351
|
+
import_react102.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 Definition not found")
|
|
521161
521352
|
);
|
|
521162
521353
|
}
|
|
521163
|
-
return
|
|
521354
|
+
return import_react102.default.createElement(
|
|
521164
521355
|
Box_default,
|
|
521165
521356
|
{ marginLeft: 2 },
|
|
521166
|
-
|
|
521357
|
+
import_react102.default.createElement(
|
|
521167
521358
|
Text,
|
|
521168
521359
|
{ color: "gray", dimColor: true },
|
|
521169
521360
|
"\u2514\u2500 Found ",
|
|
@@ -521180,16 +521371,16 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
521180
521371
|
if (toolName === "ace-file-outline" || toolName === "ace-file_outline") {
|
|
521181
521372
|
const symbols = Array.isArray(data) ? data : [];
|
|
521182
521373
|
if (symbols.length === 0) {
|
|
521183
|
-
return
|
|
521374
|
+
return import_react102.default.createElement(
|
|
521184
521375
|
Box_default,
|
|
521185
521376
|
{ marginLeft: 2 },
|
|
521186
|
-
|
|
521377
|
+
import_react102.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No symbols in file")
|
|
521187
521378
|
);
|
|
521188
521379
|
}
|
|
521189
|
-
return
|
|
521380
|
+
return import_react102.default.createElement(
|
|
521190
521381
|
Box_default,
|
|
521191
521382
|
{ marginLeft: 2 },
|
|
521192
|
-
|
|
521383
|
+
import_react102.default.createElement(
|
|
521193
521384
|
Text,
|
|
521194
521385
|
{ color: "gray", dimColor: true },
|
|
521195
521386
|
"\u2514\u2500 Found ",
|
|
@@ -521203,16 +521394,16 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
521203
521394
|
if (toolName === "ace-semantic-search" || toolName === "ace-semantic_search") {
|
|
521204
521395
|
const totalResults = (((_a21 = data.symbols) == null ? void 0 : _a21.length) || 0) + (((_b14 = data.references) == null ? void 0 : _b14.length) || 0);
|
|
521205
521396
|
if (totalResults === 0) {
|
|
521206
|
-
return
|
|
521397
|
+
return import_react102.default.createElement(
|
|
521207
521398
|
Box_default,
|
|
521208
521399
|
{ marginLeft: 2 },
|
|
521209
|
-
|
|
521400
|
+
import_react102.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No results found")
|
|
521210
521401
|
);
|
|
521211
521402
|
}
|
|
521212
|
-
return
|
|
521403
|
+
return import_react102.default.createElement(
|
|
521213
521404
|
Box_default,
|
|
521214
521405
|
{ flexDirection: "column", marginLeft: 2 },
|
|
521215
|
-
|
|
521406
|
+
import_react102.default.createElement(
|
|
521216
521407
|
Text,
|
|
521217
521408
|
{ color: "gray", dimColor: true },
|
|
521218
521409
|
"\u251C\u2500 ",
|
|
@@ -521220,7 +521411,7 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
521220
521411
|
" ",
|
|
521221
521412
|
(((_d4 = data.symbols) == null ? void 0 : _d4.length) || 0) === 1 ? "symbol" : "symbols"
|
|
521222
521413
|
),
|
|
521223
|
-
|
|
521414
|
+
import_react102.default.createElement(
|
|
521224
521415
|
Text,
|
|
521225
521416
|
{ color: "gray", dimColor: true },
|
|
521226
521417
|
"\u2514\u2500 ",
|
|
@@ -521233,10 +521424,10 @@ function renderACEPreview(toolName, data, maxLines) {
|
|
|
521233
521424
|
return renderGenericPreview(data, maxLines);
|
|
521234
521425
|
}
|
|
521235
521426
|
function renderCreatePreview(data) {
|
|
521236
|
-
return
|
|
521427
|
+
return import_react102.default.createElement(
|
|
521237
521428
|
Box_default,
|
|
521238
521429
|
{ marginLeft: 2 },
|
|
521239
|
-
|
|
521430
|
+
import_react102.default.createElement(
|
|
521240
521431
|
Text,
|
|
521241
521432
|
{ color: "gray", dimColor: true },
|
|
521242
521433
|
"\u2514\u2500 ",
|
|
@@ -521245,16 +521436,16 @@ function renderCreatePreview(data) {
|
|
|
521245
521436
|
);
|
|
521246
521437
|
}
|
|
521247
521438
|
function renderEditSearchPreview(data) {
|
|
521248
|
-
return
|
|
521439
|
+
return import_react102.default.createElement(
|
|
521249
521440
|
Box_default,
|
|
521250
521441
|
{ flexDirection: "column", marginLeft: 2 },
|
|
521251
|
-
data.message &&
|
|
521442
|
+
data.message && import_react102.default.createElement(
|
|
521252
521443
|
Text,
|
|
521253
521444
|
{ color: "gray", dimColor: true },
|
|
521254
521445
|
"\u251C\u2500 ",
|
|
521255
521446
|
data.message
|
|
521256
521447
|
),
|
|
521257
|
-
data.matchLocation &&
|
|
521448
|
+
data.matchLocation && import_react102.default.createElement(
|
|
521258
521449
|
Text,
|
|
521259
521450
|
{ color: "gray", dimColor: true },
|
|
521260
521451
|
"\u251C\u2500 Match: lines ",
|
|
@@ -521262,7 +521453,7 @@ function renderEditSearchPreview(data) {
|
|
|
521262
521453
|
"-",
|
|
521263
521454
|
data.matchLocation.endLine
|
|
521264
521455
|
),
|
|
521265
|
-
data.totalLines &&
|
|
521456
|
+
data.totalLines && import_react102.default.createElement(
|
|
521266
521457
|
Text,
|
|
521267
521458
|
{ color: "gray", dimColor: true },
|
|
521268
521459
|
"\u2514\u2500 Total lines: ",
|
|
@@ -521272,10 +521463,10 @@ function renderEditSearchPreview(data) {
|
|
|
521272
521463
|
}
|
|
521273
521464
|
function renderWebSearchPreview(data, _maxLines) {
|
|
521274
521465
|
if (!data.results || data.results.length === 0) {
|
|
521275
|
-
return
|
|
521466
|
+
return import_react102.default.createElement(
|
|
521276
521467
|
Box_default,
|
|
521277
521468
|
{ marginLeft: 2 },
|
|
521278
|
-
|
|
521469
|
+
import_react102.default.createElement(
|
|
521279
521470
|
Text,
|
|
521280
521471
|
{ color: "gray", dimColor: true },
|
|
521281
521472
|
'\u2514\u2500 No results for "',
|
|
@@ -521284,10 +521475,10 @@ function renderWebSearchPreview(data, _maxLines) {
|
|
|
521284
521475
|
)
|
|
521285
521476
|
);
|
|
521286
521477
|
}
|
|
521287
|
-
return
|
|
521478
|
+
return import_react102.default.createElement(
|
|
521288
521479
|
Box_default,
|
|
521289
521480
|
{ marginLeft: 2 },
|
|
521290
|
-
|
|
521481
|
+
import_react102.default.createElement(
|
|
521291
521482
|
Text,
|
|
521292
521483
|
{ color: "gray", dimColor: true },
|
|
521293
521484
|
"\u2514\u2500 Found ",
|
|
@@ -521301,10 +521492,10 @@ function renderWebSearchPreview(data, _maxLines) {
|
|
|
521301
521492
|
function renderWebFetchPreview(data) {
|
|
521302
521493
|
var _a21;
|
|
521303
521494
|
const contentLength = data.textLength || ((_a21 = data.content) == null ? void 0 : _a21.length) || 0;
|
|
521304
|
-
return
|
|
521495
|
+
return import_react102.default.createElement(
|
|
521305
521496
|
Box_default,
|
|
521306
521497
|
{ marginLeft: 2 },
|
|
521307
|
-
|
|
521498
|
+
import_react102.default.createElement(
|
|
521308
521499
|
Text,
|
|
521309
521500
|
{ color: "gray", dimColor: true },
|
|
521310
521501
|
"\u2514\u2500 Fetched ",
|
|
@@ -521321,9 +521512,9 @@ function renderGenericPreview(data, maxLines) {
|
|
|
521321
521512
|
const entries = Object.entries(data).slice(0, maxLines);
|
|
521322
521513
|
if (entries.length === 0)
|
|
521323
521514
|
return null;
|
|
521324
|
-
return
|
|
521515
|
+
return import_react102.default.createElement(Box_default, { flexDirection: "column", marginLeft: 2 }, entries.map(([key, value], idx2) => {
|
|
521325
521516
|
const valueStr = typeof value === "string" ? value.slice(0, 20) + (value.length > 20 ? "..." : "") : JSON.stringify(value).slice(0, 60);
|
|
521326
|
-
return
|
|
521517
|
+
return import_react102.default.createElement(
|
|
521327
521518
|
Text,
|
|
521328
521519
|
{ key: idx2, color: "gray", dimColor: true },
|
|
521329
521520
|
idx2 === entries.length - 1 ? "\u2514\u2500 " : "\u251C\u2500 ",
|
|
@@ -521339,10 +521530,10 @@ function renderTodoPreview(_toolName, data, _maxLines) {
|
|
|
521339
521530
|
if (data.content && Array.isArray(data.content) && ((_a21 = data.content[0]) == null ? void 0 : _a21.text)) {
|
|
521340
521531
|
const textContent = data.content[0].text;
|
|
521341
521532
|
if (textContent === "No TODO list found" || textContent === "TODO item not found") {
|
|
521342
|
-
return
|
|
521533
|
+
return import_react102.default.createElement(
|
|
521343
521534
|
Box_default,
|
|
521344
521535
|
{ marginLeft: 2 },
|
|
521345
|
-
|
|
521536
|
+
import_react102.default.createElement(
|
|
521346
521537
|
Text,
|
|
521347
521538
|
{ color: "gray", dimColor: true },
|
|
521348
521539
|
"\u2514\u2500 ",
|
|
@@ -521353,10 +521544,10 @@ function renderTodoPreview(_toolName, data, _maxLines) {
|
|
|
521353
521544
|
try {
|
|
521354
521545
|
todoData = JSON.parse(textContent);
|
|
521355
521546
|
} catch (e) {
|
|
521356
|
-
return
|
|
521547
|
+
return import_react102.default.createElement(
|
|
521357
521548
|
Box_default,
|
|
521358
521549
|
{ marginLeft: 2 },
|
|
521359
|
-
|
|
521550
|
+
import_react102.default.createElement(
|
|
521360
521551
|
Text,
|
|
521361
521552
|
{ color: "gray", dimColor: true },
|
|
521362
521553
|
"\u2514\u2500 ",
|
|
@@ -521366,10 +521557,10 @@ function renderTodoPreview(_toolName, data, _maxLines) {
|
|
|
521366
521557
|
}
|
|
521367
521558
|
}
|
|
521368
521559
|
if (!todoData.todos || !Array.isArray(todoData.todos)) {
|
|
521369
|
-
return
|
|
521560
|
+
return import_react102.default.createElement(
|
|
521370
521561
|
Box_default,
|
|
521371
521562
|
{ marginLeft: 2 },
|
|
521372
|
-
|
|
521563
|
+
import_react102.default.createElement(
|
|
521373
521564
|
Text,
|
|
521374
521565
|
{ color: "gray", dimColor: true },
|
|
521375
521566
|
"\u2514\u2500 ",
|
|
@@ -521377,24 +521568,24 @@ function renderTodoPreview(_toolName, data, _maxLines) {
|
|
|
521377
521568
|
)
|
|
521378
521569
|
);
|
|
521379
521570
|
}
|
|
521380
|
-
return
|
|
521571
|
+
return import_react102.default.createElement(TodoTree, { todos: todoData.todos });
|
|
521381
521572
|
}
|
|
521382
|
-
var
|
|
521573
|
+
var import_react102;
|
|
521383
521574
|
var init_ToolResultPreview = __esm({
|
|
521384
521575
|
async "dist/ui/components/tools/ToolResultPreview.js"() {
|
|
521385
521576
|
"use strict";
|
|
521386
|
-
|
|
521577
|
+
import_react102 = __toESM(require_react(), 1);
|
|
521387
521578
|
await init_build2();
|
|
521388
521579
|
await init_TodoTree();
|
|
521389
521580
|
}
|
|
521390
521581
|
});
|
|
521391
521582
|
|
|
521392
521583
|
// dist/ui/components/special/HookErrorDisplay.js
|
|
521393
|
-
var
|
|
521584
|
+
var import_react103, truncate, HookErrorDisplay;
|
|
521394
521585
|
var init_HookErrorDisplay = __esm({
|
|
521395
521586
|
async "dist/ui/components/special/HookErrorDisplay.js"() {
|
|
521396
521587
|
"use strict";
|
|
521397
|
-
|
|
521588
|
+
import_react103 = __toESM(require_react(), 1);
|
|
521398
521589
|
await init_build2();
|
|
521399
521590
|
truncate = (text2, maxLength) => {
|
|
521400
521591
|
if (text2.length <= maxLength)
|
|
@@ -521407,21 +521598,21 @@ var init_HookErrorDisplay = __esm({
|
|
|
521407
521598
|
const truncatedCommand = truncate(command, 150);
|
|
521408
521599
|
const truncatedOutput = truncate(combinedOutput, 300);
|
|
521409
521600
|
const title = type === "warning" ? "Hook Command Warning" : `Hook Command Failed (Exit Code ${exitCode})`;
|
|
521410
|
-
return
|
|
521601
|
+
return import_react103.default.createElement(
|
|
521411
521602
|
Box_default,
|
|
521412
521603
|
{ flexDirection: "column" },
|
|
521413
|
-
|
|
521414
|
-
|
|
521604
|
+
import_react103.default.createElement(Text, { bold: true, color: "red" }, title),
|
|
521605
|
+
import_react103.default.createElement(
|
|
521415
521606
|
Box_default,
|
|
521416
521607
|
{ marginLeft: 1 },
|
|
521417
|
-
|
|
521418
|
-
|
|
521608
|
+
import_react103.default.createElement(Text, { dimColor: true }, "\u251C\u2500 "),
|
|
521609
|
+
import_react103.default.createElement(Text, null, truncatedCommand)
|
|
521419
521610
|
),
|
|
521420
|
-
|
|
521611
|
+
import_react103.default.createElement(
|
|
521421
521612
|
Box_default,
|
|
521422
521613
|
{ marginLeft: 1 },
|
|
521423
|
-
|
|
521424
|
-
|
|
521614
|
+
import_react103.default.createElement(Text, { dimColor: true }, "\u2514\u2500 "),
|
|
521615
|
+
import_react103.default.createElement(Text, null, truncatedOutput)
|
|
521425
521616
|
)
|
|
521426
521617
|
);
|
|
521427
521618
|
};
|
|
@@ -521455,44 +521646,44 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
|
|
|
521455
521646
|
toolStatusColor = message.role === "subagent" ? "magenta" : "blue";
|
|
521456
521647
|
}
|
|
521457
521648
|
}
|
|
521458
|
-
return
|
|
521459
|
-
|
|
521649
|
+
return import_react104.default.createElement(Box_default, { key: `msg-${index}`, marginTop: index > 0 && !shouldShowParallelIndicator ? 1 : 0, marginBottom: isLastMessage ? 1 : 0, paddingX: 1, flexDirection: "column", width: terminalWidth }, message.plainOutput ? import_react104.default.createElement(Text, { color: message.role === "user" ? "white" : toolStatusColor }, removeAnsiCodes(message.content)) : import_react104.default.createElement(
|
|
521650
|
+
import_react104.default.Fragment,
|
|
521460
521651
|
null,
|
|
521461
|
-
isFirstInGroup &&
|
|
521652
|
+
isFirstInGroup && import_react104.default.createElement(
|
|
521462
521653
|
Box_default,
|
|
521463
521654
|
{ marginBottom: 0 },
|
|
521464
|
-
|
|
521655
|
+
import_react104.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, "\u250C\u2500 Parallel execution")
|
|
521465
521656
|
),
|
|
521466
|
-
|
|
521657
|
+
import_react104.default.createElement(
|
|
521467
521658
|
Box_default,
|
|
521468
521659
|
null,
|
|
521469
|
-
|
|
521660
|
+
import_react104.default.createElement(
|
|
521470
521661
|
Text,
|
|
521471
521662
|
{ color: message.role === "user" ? "green" : message.role === "command" ? theme14.colors.menuSecondary : toolStatusColor, bold: true },
|
|
521472
521663
|
shouldShowParallelIndicator && !isFirstInGroup ? "\u2502" : "",
|
|
521473
|
-
message.role === "user" ? "\
|
|
521664
|
+
message.role === "user" ? "\u{16A06} " : message.role === "command" ? "\u2318" : "\u2746"
|
|
521474
521665
|
),
|
|
521475
|
-
|
|
521476
|
-
|
|
521666
|
+
import_react104.default.createElement(Box_default, { marginLeft: 1, flexDirection: "column" }, message.role === "command" ? import_react104.default.createElement(
|
|
521667
|
+
import_react104.default.Fragment,
|
|
521477
521668
|
null,
|
|
521478
|
-
!message.hideCommandName &&
|
|
521669
|
+
!message.hideCommandName && import_react104.default.createElement(
|
|
521479
521670
|
Text,
|
|
521480
521671
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
521481
521672
|
"\u2514\u2500 ",
|
|
521482
521673
|
message.commandName
|
|
521483
521674
|
),
|
|
521484
|
-
message.content &&
|
|
521485
|
-
) :
|
|
521486
|
-
|
|
521675
|
+
message.content && import_react104.default.createElement(Text, { color: "white" }, removeAnsiCodes(message.content))
|
|
521676
|
+
) : import_react104.default.createElement(
|
|
521677
|
+
import_react104.default.Fragment,
|
|
521487
521678
|
null,
|
|
521488
|
-
message.plainOutput ?
|
|
521679
|
+
message.plainOutput ? import_react104.default.createElement(Text, { color: message.role === "user" ? "white" : toolStatusColor, backgroundColor: message.role === "user" ? theme14.colors.border : void 0 }, removeAnsiCodes(message.content || " ")) : (() => {
|
|
521489
521680
|
if (message.hookError) {
|
|
521490
|
-
return
|
|
521681
|
+
return import_react104.default.createElement(HookErrorDisplay, { details: message.hookError });
|
|
521491
521682
|
}
|
|
521492
521683
|
try {
|
|
521493
521684
|
const parsed = JSON.parse(message.content);
|
|
521494
521685
|
if (parsed.type === "hook-error") {
|
|
521495
|
-
return
|
|
521686
|
+
return import_react104.default.createElement(HookErrorDisplay, { details: {
|
|
521496
521687
|
type: "error",
|
|
521497
521688
|
exitCode: parsed.exitCode,
|
|
521498
521689
|
command: parsed.command,
|
|
@@ -521504,9 +521695,9 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
|
|
|
521504
521695
|
}
|
|
521505
521696
|
const hasToolStatusIcon = message.content.includes("\u2687\u26A1") || message.content.includes("\u2687\u2713") || message.content.includes("\u2687\u2717") || message.content.startsWith("\u26A1") || message.content.startsWith("\u2713") || message.content.startsWith("\u2717");
|
|
521506
521697
|
if (hasToolStatusIcon && (message.role === "assistant" || message.role === "subagent")) {
|
|
521507
|
-
return
|
|
521698
|
+
return import_react104.default.createElement(Text, { color: toolStatusColor }, removeAnsiCodes(message.content || " "));
|
|
521508
521699
|
}
|
|
521509
|
-
return
|
|
521700
|
+
return import_react104.default.createElement(MarkdownRenderer, { content: message.content || " " });
|
|
521510
521701
|
})(),
|
|
521511
521702
|
message.subAgentUsage && (() => {
|
|
521512
521703
|
const formatTokens2 = (num) => {
|
|
@@ -521514,7 +521705,7 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
|
|
|
521514
521705
|
return `${(num / 1e3).toFixed(1)}K`;
|
|
521515
521706
|
return num.toString();
|
|
521516
521707
|
};
|
|
521517
|
-
return
|
|
521708
|
+
return import_react104.default.createElement(
|
|
521518
521709
|
Text,
|
|
521519
521710
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
521520
521711
|
"\u2514\u2500 Usage: In=",
|
|
@@ -521526,7 +521717,7 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
|
|
|
521526
521717
|
);
|
|
521527
521718
|
})(),
|
|
521528
521719
|
message.toolDisplay && message.toolDisplay.args.length > 0 && // Hide tool arguments for sub-agent internal tools
|
|
521529
|
-
!message.subAgentInternal &&
|
|
521720
|
+
!message.subAgentInternal && import_react104.default.createElement(Box_default, { flexDirection: "column" }, message.toolDisplay.args.map((arg, argIndex) => import_react104.default.createElement(
|
|
521530
521721
|
Text,
|
|
521531
521722
|
{ key: argIndex, color: theme14.colors.menuSecondary, dimColor: true },
|
|
521532
521723
|
arg.isLast ? "\u2514\u2500" : "\u251C\u2500",
|
|
@@ -521535,63 +521726,63 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
|
|
|
521535
521726
|
": ",
|
|
521536
521727
|
arg.value
|
|
521537
521728
|
))),
|
|
521538
|
-
message.toolCall && message.toolCall.name === "filesystem-create" && message.toolCall.arguments.content &&
|
|
521729
|
+
message.toolCall && message.toolCall.name === "filesystem-create" && message.toolCall.arguments.content && import_react104.default.createElement(
|
|
521539
521730
|
Box_default,
|
|
521540
521731
|
{ marginTop: 1 },
|
|
521541
|
-
|
|
521732
|
+
import_react104.default.createElement(DiffViewer, { newContent: message.toolCall.arguments.content, filename: message.toolCall.arguments.path })
|
|
521542
521733
|
),
|
|
521543
|
-
message.toolCall && message.toolCall.name === "filesystem-edit" && message.toolCall.arguments.oldContent && message.toolCall.arguments.newContent &&
|
|
521734
|
+
message.toolCall && message.toolCall.name === "filesystem-edit" && message.toolCall.arguments.oldContent && message.toolCall.arguments.newContent && import_react104.default.createElement(
|
|
521544
521735
|
Box_default,
|
|
521545
521736
|
{ marginTop: 1 },
|
|
521546
|
-
|
|
521737
|
+
import_react104.default.createElement(DiffViewer, { oldContent: message.toolCall.arguments.oldContent, newContent: message.toolCall.arguments.newContent, filename: message.toolCall.arguments.filename, completeOldContent: message.toolCall.arguments.completeOldContent, completeNewContent: message.toolCall.arguments.completeNewContent, startLineNumber: message.toolCall.arguments.contextStartLine })
|
|
521547
521738
|
),
|
|
521548
|
-
message.toolCall && message.toolCall.name === "filesystem-edit_search" && message.toolCall.arguments.oldContent && message.toolCall.arguments.newContent &&
|
|
521739
|
+
message.toolCall && message.toolCall.name === "filesystem-edit_search" && message.toolCall.arguments.oldContent && message.toolCall.arguments.newContent && import_react104.default.createElement(
|
|
521549
521740
|
Box_default,
|
|
521550
521741
|
{ marginTop: 1 },
|
|
521551
|
-
|
|
521742
|
+
import_react104.default.createElement(DiffViewer, { oldContent: message.toolCall.arguments.oldContent, newContent: message.toolCall.arguments.newContent, filename: message.toolCall.arguments.filename, completeOldContent: message.toolCall.arguments.completeOldContent, completeNewContent: message.toolCall.arguments.completeNewContent, startLineNumber: message.toolCall.arguments.contextStartLine })
|
|
521552
521743
|
),
|
|
521553
|
-
message.toolCall && (message.toolCall.name === "filesystem-edit" || message.toolCall.name === "filesystem-edit_search") && message.toolCall.arguments.isBatch && message.toolCall.arguments.batchResults && Array.isArray(message.toolCall.arguments.batchResults) &&
|
|
521744
|
+
message.toolCall && (message.toolCall.name === "filesystem-edit" || message.toolCall.name === "filesystem-edit_search") && message.toolCall.arguments.isBatch && message.toolCall.arguments.batchResults && Array.isArray(message.toolCall.arguments.batchResults) && import_react104.default.createElement(Box_default, { marginTop: 1, flexDirection: "column" }, message.toolCall.arguments.batchResults.map((fileResult, index2) => {
|
|
521554
521745
|
if (fileResult.success && fileResult.oldContent && fileResult.newContent) {
|
|
521555
|
-
return
|
|
521746
|
+
return import_react104.default.createElement(
|
|
521556
521747
|
Box_default,
|
|
521557
521748
|
{ key: index2, flexDirection: "column", marginBottom: 1 },
|
|
521558
|
-
|
|
521559
|
-
|
|
521749
|
+
import_react104.default.createElement(Text, { bold: true, color: "cyan" }, `File ${index2 + 1}: ${fileResult.path}`),
|
|
521750
|
+
import_react104.default.createElement(DiffViewer, { oldContent: fileResult.oldContent, newContent: fileResult.newContent, filename: fileResult.path, completeOldContent: fileResult.completeOldContent, completeNewContent: fileResult.completeNewContent, startLineNumber: fileResult.contextStartLine })
|
|
521560
521751
|
);
|
|
521561
521752
|
}
|
|
521562
521753
|
return null;
|
|
521563
521754
|
})),
|
|
521564
521755
|
(message.content.startsWith("\u2713") || message.content.includes("\u2687\u2713")) && message.toolResult && // 只在没有 diff 数据时显示预览(有 diff 的工具会用 DiffViewer 显示)
|
|
521565
|
-
!(message.toolCall && (((_d4 = message.toolCall.arguments) == null ? void 0 : _d4.oldContent) || ((_e2 = message.toolCall.arguments) == null ? void 0 : _e2.batchResults))) &&
|
|
521566
|
-
message.files && message.files.length > 0 &&
|
|
521756
|
+
!(message.toolCall && (((_d4 = message.toolCall.arguments) == null ? void 0 : _d4.oldContent) || ((_e2 = message.toolCall.arguments) == null ? void 0 : _e2.batchResults))) && import_react104.default.createElement(ToolResultPreview, { toolName: ((_f = (message.content || "").replace(/^✓\s*/, "").replace(/^⚇✓\s*/, "").replace(/.*⚇✓\s*/, "").replace(/\x1b\[[0-9;]*m/g, "").split("\n")[0]) == null ? void 0 : _f.trim()) || "", result: message.toolResult, maxLines: 5, isSubAgentInternal: message.role === "subagent" || message.subAgentInternal === true }),
|
|
521757
|
+
message.files && message.files.length > 0 && import_react104.default.createElement(Box_default, { flexDirection: "column" }, message.files.map((file, fileIndex) => import_react104.default.createElement(
|
|
521567
521758
|
Text,
|
|
521568
521759
|
{ key: fileIndex, color: theme14.colors.menuSecondary, dimColor: true },
|
|
521569
521760
|
"\u2514\u2500 ",
|
|
521570
521761
|
file.path,
|
|
521571
521762
|
file.exists ? ` (total line ${file.lineCount})` : " (file not found)"
|
|
521572
521763
|
))),
|
|
521573
|
-
message.role === "user" && message.images && message.images.length > 0 &&
|
|
521764
|
+
message.role === "user" && message.images && message.images.length > 0 && import_react104.default.createElement(Box_default, { marginTop: 1, flexDirection: "column" }, message.images.map((_image, imageIndex) => import_react104.default.createElement(
|
|
521574
521765
|
Text,
|
|
521575
521766
|
{ key: imageIndex, color: theme14.colors.menuSecondary, dimColor: true },
|
|
521576
521767
|
"\u2514\u2500 [image #",
|
|
521577
521768
|
imageIndex + 1,
|
|
521578
521769
|
"]"
|
|
521579
521770
|
))),
|
|
521580
|
-
message.discontinued &&
|
|
521771
|
+
message.discontinued && import_react104.default.createElement(Text, { color: "red", bold: true }, "\u2514\u2500 user discontinue")
|
|
521581
521772
|
))
|
|
521582
521773
|
),
|
|
521583
|
-
!message.plainOutput && isLastInGroup &&
|
|
521774
|
+
!message.plainOutput && isLastInGroup && import_react104.default.createElement(
|
|
521584
521775
|
Box_default,
|
|
521585
521776
|
{ marginTop: 0 },
|
|
521586
|
-
|
|
521777
|
+
import_react104.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, "\u2514\u2500 End parallel execution")
|
|
521587
521778
|
)
|
|
521588
521779
|
));
|
|
521589
521780
|
}
|
|
521590
|
-
var
|
|
521781
|
+
var import_react104;
|
|
521591
521782
|
var init_MessageRenderer = __esm({
|
|
521592
521783
|
async "dist/ui/components/chat/MessageRenderer.js"() {
|
|
521593
521784
|
"use strict";
|
|
521594
|
-
|
|
521785
|
+
import_react104 = __toESM(require_react(), 1);
|
|
521595
521786
|
await init_build2();
|
|
521596
521787
|
init_ThemeContext();
|
|
521597
521788
|
await init_MarkdownRenderer();
|
|
@@ -521619,7 +521810,7 @@ function StatusLine({ yoloMode = false, planMode = false, vscodeConnectionStatus
|
|
|
521619
521810
|
const statusItems = [];
|
|
521620
521811
|
if (currentProfileName) {
|
|
521621
521812
|
statusItems.push({
|
|
521622
|
-
text: `\
|
|
521813
|
+
text: `\uA6B0 ${currentProfileName} | ${getProfileShortcut()} ${t.chatScreen.profileSwitchHint}`,
|
|
521623
521814
|
color: theme14.colors.menuInfo
|
|
521624
521815
|
});
|
|
521625
521816
|
}
|
|
@@ -521656,13 +521847,13 @@ function StatusLine({ yoloMode = false, planMode = false, vscodeConnectionStatus
|
|
|
521656
521847
|
color: "yellow"
|
|
521657
521848
|
});
|
|
521658
521849
|
}
|
|
521659
|
-
return
|
|
521850
|
+
return import_react105.default.createElement(
|
|
521660
521851
|
Box_default,
|
|
521661
521852
|
{ flexDirection: "column", paddingX: 1, marginTop: 1 },
|
|
521662
|
-
contextUsage &&
|
|
521853
|
+
contextUsage && import_react105.default.createElement(
|
|
521663
521854
|
Box_default,
|
|
521664
521855
|
{ marginBottom: 1 },
|
|
521665
|
-
|
|
521856
|
+
import_react105.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, (() => {
|
|
521666
521857
|
const isAnthropic = (contextUsage.cacheCreationTokens || 0) > 0 || (contextUsage.cacheReadTokens || 0) > 0;
|
|
521667
521858
|
const isOpenAI = (contextUsage.cachedTokens || 0) > 0;
|
|
521668
521859
|
const percentage = calculateContextPercentage2(contextUsage);
|
|
@@ -521682,29 +521873,29 @@ function StatusLine({ yoloMode = false, planMode = false, vscodeConnectionStatus
|
|
|
521682
521873
|
return num.toString();
|
|
521683
521874
|
};
|
|
521684
521875
|
const hasCacheMetrics = isAnthropic || isOpenAI;
|
|
521685
|
-
return
|
|
521686
|
-
|
|
521876
|
+
return import_react105.default.createElement(
|
|
521877
|
+
import_react105.default.Fragment,
|
|
521687
521878
|
null,
|
|
521688
|
-
|
|
521879
|
+
import_react105.default.createElement(
|
|
521689
521880
|
Text,
|
|
521690
521881
|
{ color },
|
|
521691
521882
|
percentage.toFixed(1),
|
|
521692
521883
|
"%"
|
|
521693
521884
|
),
|
|
521694
|
-
|
|
521695
|
-
|
|
521696
|
-
|
|
521697
|
-
hasCacheMetrics &&
|
|
521698
|
-
|
|
521885
|
+
import_react105.default.createElement(Text, null, " \xB7 "),
|
|
521886
|
+
import_react105.default.createElement(Text, { color }, formatNumber(totalInputTokens)),
|
|
521887
|
+
import_react105.default.createElement(Text, null, t.chatScreen.tokens),
|
|
521888
|
+
hasCacheMetrics && import_react105.default.createElement(
|
|
521889
|
+
import_react105.default.Fragment,
|
|
521699
521890
|
null,
|
|
521700
|
-
|
|
521701
|
-
isAnthropic &&
|
|
521702
|
-
|
|
521891
|
+
import_react105.default.createElement(Text, null, " \xB7 "),
|
|
521892
|
+
isAnthropic && import_react105.default.createElement(
|
|
521893
|
+
import_react105.default.Fragment,
|
|
521703
521894
|
null,
|
|
521704
|
-
(contextUsage.cacheReadTokens || 0) > 0 &&
|
|
521705
|
-
|
|
521895
|
+
(contextUsage.cacheReadTokens || 0) > 0 && import_react105.default.createElement(
|
|
521896
|
+
import_react105.default.Fragment,
|
|
521706
521897
|
null,
|
|
521707
|
-
|
|
521898
|
+
import_react105.default.createElement(
|
|
521708
521899
|
Text,
|
|
521709
521900
|
{ color: theme14.colors.menuInfo },
|
|
521710
521901
|
"\u21AF",
|
|
@@ -521714,11 +521905,11 @@ function StatusLine({ yoloMode = false, planMode = false, vscodeConnectionStatus
|
|
|
521714
521905
|
t.chatScreen.cached
|
|
521715
521906
|
)
|
|
521716
521907
|
),
|
|
521717
|
-
(contextUsage.cacheCreationTokens || 0) > 0 &&
|
|
521718
|
-
|
|
521908
|
+
(contextUsage.cacheCreationTokens || 0) > 0 && import_react105.default.createElement(
|
|
521909
|
+
import_react105.default.Fragment,
|
|
521719
521910
|
null,
|
|
521720
|
-
(contextUsage.cacheReadTokens || 0) > 0 &&
|
|
521721
|
-
|
|
521911
|
+
(contextUsage.cacheReadTokens || 0) > 0 && import_react105.default.createElement(Text, null, " \xB7 "),
|
|
521912
|
+
import_react105.default.createElement(
|
|
521722
521913
|
Text,
|
|
521723
521914
|
{ color: theme14.colors.warning },
|
|
521724
521915
|
"\u25C6",
|
|
@@ -521729,7 +521920,7 @@ function StatusLine({ yoloMode = false, planMode = false, vscodeConnectionStatus
|
|
|
521729
521920
|
)
|
|
521730
521921
|
)
|
|
521731
521922
|
),
|
|
521732
|
-
isOpenAI &&
|
|
521923
|
+
isOpenAI && import_react105.default.createElement(
|
|
521733
521924
|
Text,
|
|
521734
521925
|
{ color: theme14.colors.menuInfo },
|
|
521735
521926
|
"\u21AF ",
|
|
@@ -521741,25 +521932,25 @@ function StatusLine({ yoloMode = false, planMode = false, vscodeConnectionStatus
|
|
|
521741
521932
|
);
|
|
521742
521933
|
})())
|
|
521743
521934
|
),
|
|
521744
|
-
statusItems.length > 0 &&
|
|
521935
|
+
statusItems.length > 0 && import_react105.default.createElement(
|
|
521745
521936
|
Box_default,
|
|
521746
521937
|
null,
|
|
521747
|
-
|
|
521748
|
-
|
|
521938
|
+
import_react105.default.createElement(Text, { dimColor: true }, statusItems.map((item, index) => import_react105.default.createElement(
|
|
521939
|
+
import_react105.default.Fragment,
|
|
521749
521940
|
{ key: index },
|
|
521750
|
-
index > 0 &&
|
|
521751
|
-
|
|
521941
|
+
index > 0 && import_react105.default.createElement(Text, { color: theme14.colors.menuSecondary }, " | "),
|
|
521942
|
+
import_react105.default.createElement(Text, { color: item.color }, item.text)
|
|
521752
521943
|
)))
|
|
521753
521944
|
)
|
|
521754
521945
|
);
|
|
521755
521946
|
}
|
|
521756
|
-
return
|
|
521947
|
+
return import_react105.default.createElement(
|
|
521757
521948
|
Box_default,
|
|
521758
521949
|
{ flexDirection: "column", paddingX: 1, marginTop: 1 },
|
|
521759
|
-
contextUsage &&
|
|
521950
|
+
contextUsage && import_react105.default.createElement(
|
|
521760
521951
|
Box_default,
|
|
521761
521952
|
null,
|
|
521762
|
-
|
|
521953
|
+
import_react105.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, (() => {
|
|
521763
521954
|
const isAnthropic = (contextUsage.cacheCreationTokens || 0) > 0 || (contextUsage.cacheReadTokens || 0) > 0;
|
|
521764
521955
|
const isOpenAI = (contextUsage.cachedTokens || 0) > 0;
|
|
521765
521956
|
const percentage = calculateContextPercentage2(contextUsage);
|
|
@@ -521779,29 +521970,29 @@ function StatusLine({ yoloMode = false, planMode = false, vscodeConnectionStatus
|
|
|
521779
521970
|
return num.toString();
|
|
521780
521971
|
};
|
|
521781
521972
|
const hasCacheMetrics = isAnthropic || isOpenAI;
|
|
521782
|
-
return
|
|
521783
|
-
|
|
521973
|
+
return import_react105.default.createElement(
|
|
521974
|
+
import_react105.default.Fragment,
|
|
521784
521975
|
null,
|
|
521785
|
-
|
|
521976
|
+
import_react105.default.createElement(
|
|
521786
521977
|
Text,
|
|
521787
521978
|
{ color },
|
|
521788
521979
|
percentage.toFixed(1),
|
|
521789
521980
|
"%"
|
|
521790
521981
|
),
|
|
521791
|
-
|
|
521792
|
-
|
|
521793
|
-
|
|
521794
|
-
hasCacheMetrics &&
|
|
521795
|
-
|
|
521982
|
+
import_react105.default.createElement(Text, null, " \xB7 "),
|
|
521983
|
+
import_react105.default.createElement(Text, { color }, formatNumber(totalInputTokens)),
|
|
521984
|
+
import_react105.default.createElement(Text, null, t.chatScreen.tokens),
|
|
521985
|
+
hasCacheMetrics && import_react105.default.createElement(
|
|
521986
|
+
import_react105.default.Fragment,
|
|
521796
521987
|
null,
|
|
521797
|
-
|
|
521798
|
-
isAnthropic &&
|
|
521799
|
-
|
|
521988
|
+
import_react105.default.createElement(Text, null, " \xB7 "),
|
|
521989
|
+
isAnthropic && import_react105.default.createElement(
|
|
521990
|
+
import_react105.default.Fragment,
|
|
521800
521991
|
null,
|
|
521801
|
-
(contextUsage.cacheReadTokens || 0) > 0 &&
|
|
521802
|
-
|
|
521992
|
+
(contextUsage.cacheReadTokens || 0) > 0 && import_react105.default.createElement(
|
|
521993
|
+
import_react105.default.Fragment,
|
|
521803
521994
|
null,
|
|
521804
|
-
|
|
521995
|
+
import_react105.default.createElement(
|
|
521805
521996
|
Text,
|
|
521806
521997
|
{ color: theme14.colors.menuInfo },
|
|
521807
521998
|
"\u21AF",
|
|
@@ -521811,11 +522002,11 @@ function StatusLine({ yoloMode = false, planMode = false, vscodeConnectionStatus
|
|
|
521811
522002
|
t.chatScreen.cached
|
|
521812
522003
|
)
|
|
521813
522004
|
),
|
|
521814
|
-
(contextUsage.cacheCreationTokens || 0) > 0 &&
|
|
521815
|
-
|
|
522005
|
+
(contextUsage.cacheCreationTokens || 0) > 0 && import_react105.default.createElement(
|
|
522006
|
+
import_react105.default.Fragment,
|
|
521816
522007
|
null,
|
|
521817
|
-
(contextUsage.cacheReadTokens || 0) > 0 &&
|
|
521818
|
-
|
|
522008
|
+
(contextUsage.cacheReadTokens || 0) > 0 && import_react105.default.createElement(Text, null, " \xB7 "),
|
|
522009
|
+
import_react105.default.createElement(
|
|
521819
522010
|
Text,
|
|
521820
522011
|
{ color: theme14.colors.warning },
|
|
521821
522012
|
"\u25C6",
|
|
@@ -521826,7 +522017,7 @@ function StatusLine({ yoloMode = false, planMode = false, vscodeConnectionStatus
|
|
|
521826
522017
|
)
|
|
521827
522018
|
)
|
|
521828
522019
|
),
|
|
521829
|
-
isOpenAI &&
|
|
522020
|
+
isOpenAI && import_react105.default.createElement(
|
|
521830
522021
|
Text,
|
|
521831
522022
|
{ color: theme14.colors.menuInfo },
|
|
521832
522023
|
"\u21AF ",
|
|
@@ -521838,13 +522029,13 @@ function StatusLine({ yoloMode = false, planMode = false, vscodeConnectionStatus
|
|
|
521838
522029
|
);
|
|
521839
522030
|
})())
|
|
521840
522031
|
),
|
|
521841
|
-
currentProfileName &&
|
|
522032
|
+
currentProfileName && import_react105.default.createElement(
|
|
521842
522033
|
Box_default,
|
|
521843
522034
|
null,
|
|
521844
|
-
|
|
522035
|
+
import_react105.default.createElement(
|
|
521845
522036
|
Text,
|
|
521846
522037
|
{ color: theme14.colors.menuInfo, dimColor: true },
|
|
521847
|
-
"\
|
|
522038
|
+
"\uA6B0 ",
|
|
521848
522039
|
t.chatScreen.profileCurrent,
|
|
521849
522040
|
": ",
|
|
521850
522041
|
currentProfileName,
|
|
@@ -521855,32 +522046,32 @@ function StatusLine({ yoloMode = false, planMode = false, vscodeConnectionStatus
|
|
|
521855
522046
|
t.chatScreen.profileSwitchHint
|
|
521856
522047
|
)
|
|
521857
522048
|
),
|
|
521858
|
-
yoloMode &&
|
|
522049
|
+
yoloMode && import_react105.default.createElement(
|
|
521859
522050
|
Box_default,
|
|
521860
522051
|
null,
|
|
521861
|
-
|
|
522052
|
+
import_react105.default.createElement(Text, { color: theme14.colors.warning, dimColor: true }, t.chatScreen.yoloModeActive)
|
|
521862
522053
|
),
|
|
521863
|
-
planMode &&
|
|
522054
|
+
planMode && import_react105.default.createElement(
|
|
521864
522055
|
Box_default,
|
|
521865
522056
|
null,
|
|
521866
|
-
|
|
522057
|
+
import_react105.default.createElement(Text, { color: "#60A5FA", dimColor: true }, t.chatScreen.planModeActive)
|
|
521867
522058
|
),
|
|
521868
|
-
vscodeConnectionStatus && (vscodeConnectionStatus === "connecting" || vscodeConnectionStatus === "connected" || vscodeConnectionStatus === "error") &&
|
|
522059
|
+
vscodeConnectionStatus && (vscodeConnectionStatus === "connecting" || vscodeConnectionStatus === "connected" || vscodeConnectionStatus === "error") && import_react105.default.createElement(
|
|
521869
522060
|
Box_default,
|
|
521870
522061
|
null,
|
|
521871
|
-
|
|
521872
|
-
|
|
522062
|
+
import_react105.default.createElement(Text, { color: vscodeConnectionStatus === "connecting" ? "yellow" : vscodeConnectionStatus === "error" ? "gray" : "green", dimColor: true }, vscodeConnectionStatus === "connecting" ? import_react105.default.createElement(
|
|
522063
|
+
import_react105.default.Fragment,
|
|
521873
522064
|
null,
|
|
521874
|
-
|
|
522065
|
+
import_react105.default.createElement(build_default, { type: "dots" }),
|
|
521875
522066
|
" ",
|
|
521876
522067
|
t.chatScreen.ideConnecting
|
|
521877
|
-
) : vscodeConnectionStatus === "error" ?
|
|
521878
|
-
|
|
522068
|
+
) : vscodeConnectionStatus === "error" ? import_react105.default.createElement(
|
|
522069
|
+
import_react105.default.Fragment,
|
|
521879
522070
|
null,
|
|
521880
522071
|
"\u25CB ",
|
|
521881
522072
|
t.chatScreen.ideError
|
|
521882
|
-
) :
|
|
521883
|
-
|
|
522073
|
+
) : import_react105.default.createElement(
|
|
522074
|
+
import_react105.default.Fragment,
|
|
521884
522075
|
null,
|
|
521885
522076
|
"\u25CF ",
|
|
521886
522077
|
t.chatScreen.ideConnected,
|
|
@@ -521888,32 +522079,32 @@ function StatusLine({ yoloMode = false, planMode = false, vscodeConnectionStatus
|
|
|
521888
522079
|
(editorContext == null ? void 0 : editorContext.selectedText) && t.chatScreen.ideSelectedText.replace("{count}", editorContext.selectedText.length.toString())
|
|
521889
522080
|
))
|
|
521890
522081
|
),
|
|
521891
|
-
codebaseIndexing && codebaseProgress &&
|
|
522082
|
+
codebaseIndexing && codebaseProgress && import_react105.default.createElement(
|
|
521892
522083
|
Box_default,
|
|
521893
522084
|
null,
|
|
521894
|
-
|
|
522085
|
+
import_react105.default.createElement(
|
|
521895
522086
|
Text,
|
|
521896
522087
|
{ color: "cyan", dimColor: true },
|
|
521897
|
-
|
|
522088
|
+
import_react105.default.createElement(build_default, { type: "dots" }),
|
|
521898
522089
|
" ",
|
|
521899
522090
|
t.chatScreen.codebaseIndexing.replace("{processed}", codebaseProgress.processedFiles.toString()).replace("{total}", codebaseProgress.totalFiles.toString()),
|
|
521900
522091
|
codebaseProgress.totalChunks > 0 && ` (${t.chatScreen.codebaseProgress.replace("{chunks}", codebaseProgress.totalChunks.toString())})`
|
|
521901
522092
|
)
|
|
521902
522093
|
),
|
|
521903
|
-
!codebaseIndexing && watcherEnabled &&
|
|
522094
|
+
!codebaseIndexing && watcherEnabled && import_react105.default.createElement(
|
|
521904
522095
|
Box_default,
|
|
521905
522096
|
null,
|
|
521906
|
-
|
|
522097
|
+
import_react105.default.createElement(
|
|
521907
522098
|
Text,
|
|
521908
522099
|
{ color: "green", dimColor: true },
|
|
521909
522100
|
"\u2609 ",
|
|
521910
522101
|
t.chatScreen.statusWatcherActive
|
|
521911
522102
|
)
|
|
521912
522103
|
),
|
|
521913
|
-
fileUpdateNotification &&
|
|
522104
|
+
fileUpdateNotification && import_react105.default.createElement(
|
|
521914
522105
|
Box_default,
|
|
521915
522106
|
null,
|
|
521916
|
-
|
|
522107
|
+
import_react105.default.createElement(
|
|
521917
522108
|
Text,
|
|
521918
522109
|
{ color: "yellow", dimColor: true },
|
|
521919
522110
|
"\u26C1",
|
|
@@ -521923,11 +522114,11 @@ function StatusLine({ yoloMode = false, planMode = false, vscodeConnectionStatus
|
|
|
521923
522114
|
)
|
|
521924
522115
|
);
|
|
521925
522116
|
}
|
|
521926
|
-
var
|
|
522117
|
+
var import_react105, getProfileShortcut;
|
|
521927
522118
|
var init_StatusLine = __esm({
|
|
521928
522119
|
async "dist/ui/components/common/StatusLine.js"() {
|
|
521929
522120
|
"use strict";
|
|
521930
|
-
|
|
522121
|
+
import_react105 = __toESM(require_react(), 1);
|
|
521931
522122
|
await init_build2();
|
|
521932
522123
|
await init_build3();
|
|
521933
522124
|
init_i18n();
|
|
@@ -521941,56 +522132,56 @@ var init_StatusLine = __esm({
|
|
|
521941
522132
|
function ChatHeader({ terminalWidth, simpleMode, workingDirectory }) {
|
|
521942
522133
|
const { t } = useI18n();
|
|
521943
522134
|
const { theme: theme14 } = useTheme();
|
|
521944
|
-
return
|
|
522135
|
+
return import_react106.default.createElement(Box_default, { paddingX: 1, width: terminalWidth }, simpleMode ? (
|
|
521945
522136
|
// Simple mode: No border, smaller logo
|
|
521946
|
-
|
|
522137
|
+
import_react106.default.createElement(
|
|
521947
522138
|
Box_default,
|
|
521948
522139
|
{ paddingX: 1, paddingY: 1 },
|
|
521949
|
-
|
|
522140
|
+
import_react106.default.createElement(
|
|
521950
522141
|
Box_default,
|
|
521951
522142
|
{ flexDirection: "column" },
|
|
521952
|
-
|
|
521953
|
-
|
|
522143
|
+
import_react106.default.createElement(ChatHeaderLogo, { terminalWidth, logoGradient: theme14.colors.logoGradient }),
|
|
522144
|
+
import_react106.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.headerWorkingDirectory.replace("{directory}", workingDirectory))
|
|
521954
522145
|
)
|
|
521955
522146
|
)
|
|
521956
522147
|
) : (
|
|
521957
522148
|
// Normal mode: With border and tips
|
|
521958
|
-
|
|
522149
|
+
import_react106.default.createElement(
|
|
521959
522150
|
Box_default,
|
|
521960
|
-
{ borderColor: "cyan", borderStyle: "round", paddingX:
|
|
521961
|
-
|
|
522151
|
+
{ borderColor: "cyan", borderStyle: "round", paddingX: 1, paddingY: 1, width: terminalWidth - 2 },
|
|
522152
|
+
import_react106.default.createElement(
|
|
521962
522153
|
Box_default,
|
|
521963
522154
|
{ flexDirection: "column" },
|
|
521964
|
-
|
|
522155
|
+
import_react106.default.createElement(
|
|
521965
522156
|
Text,
|
|
521966
522157
|
{ color: "white", bold: true },
|
|
521967
|
-
|
|
521968
|
-
|
|
521969
|
-
|
|
522158
|
+
import_react106.default.createElement(Text, { color: "cyan" }, "\u2746 "),
|
|
522159
|
+
import_react106.default.createElement(dist_default4, { name: "rainbow" }, t.chatScreen.headerTitle),
|
|
522160
|
+
import_react106.default.createElement(Text, { color: "white" }, " \u26C7")
|
|
521970
522161
|
),
|
|
521971
|
-
|
|
522162
|
+
import_react106.default.createElement(
|
|
521972
522163
|
Text,
|
|
521973
522164
|
null,
|
|
521974
522165
|
"\u2022 ",
|
|
521975
522166
|
t.chatScreen.headerExplanations
|
|
521976
522167
|
),
|
|
521977
|
-
|
|
522168
|
+
import_react106.default.createElement(
|
|
521978
522169
|
Text,
|
|
521979
522170
|
null,
|
|
521980
522171
|
"\u2022 ",
|
|
521981
522172
|
t.chatScreen.headerInterrupt
|
|
521982
522173
|
),
|
|
521983
|
-
|
|
522174
|
+
import_react106.default.createElement(
|
|
521984
522175
|
Text,
|
|
521985
522176
|
null,
|
|
521986
522177
|
"\u2022 ",
|
|
521987
522178
|
t.chatScreen.headerYolo
|
|
521988
522179
|
),
|
|
521989
|
-
|
|
522180
|
+
import_react106.default.createElement(Text, null, (() => {
|
|
521990
522181
|
const pasteKey = process.platform === "darwin" ? "Ctrl+V" : "Alt+V";
|
|
521991
522182
|
return `\u2022 ${t.chatScreen.headerShortcuts.replace("{pasteKey}", pasteKey)}`;
|
|
521992
522183
|
})()),
|
|
521993
|
-
|
|
522184
|
+
import_react106.default.createElement(
|
|
521994
522185
|
Text,
|
|
521995
522186
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
521996
522187
|
"\u2022",
|
|
@@ -522003,47 +522194,47 @@ function ChatHeader({ terminalWidth, simpleMode, workingDirectory }) {
|
|
|
522003
522194
|
}
|
|
522004
522195
|
function ChatHeaderLogo({ terminalWidth, logoGradient }) {
|
|
522005
522196
|
if (terminalWidth >= 30) {
|
|
522006
|
-
return
|
|
522197
|
+
return import_react106.default.createElement(
|
|
522007
522198
|
Box_default,
|
|
522008
522199
|
{ flexDirection: "column", marginBottom: 0 },
|
|
522009
|
-
|
|
522200
|
+
import_react106.default.createElement(
|
|
522010
522201
|
dist_default4,
|
|
522011
522202
|
{ colors: logoGradient },
|
|
522012
|
-
|
|
522203
|
+
import_react106.default.createElement(Text, null, `\u2554\u2550\u2557\u2554\u2557\u2554\u2554\u2550\u2557\u2566 \u2566 \u2554\u2550\u2557\u2566 \u2566
|
|
522013
522204
|
\u255A\u2550\u2557\u2551\u2551\u2551\u2551 \u2551\u2551\u2551\u2551 \u2551 \u2551 \u2551
|
|
522014
522205
|
\u255A\u2550\u255D\u255D\u255A\u255D\u255A\u2550\u255D\u255A\u2569\u255D \u255A\u2550\u255D\u2569\u2550\u255D\u2569`)
|
|
522015
522206
|
)
|
|
522016
522207
|
);
|
|
522017
522208
|
}
|
|
522018
522209
|
if (terminalWidth >= 20) {
|
|
522019
|
-
return
|
|
522210
|
+
return import_react106.default.createElement(
|
|
522020
522211
|
Box_default,
|
|
522021
522212
|
{ flexDirection: "column", marginBottom: 0 },
|
|
522022
|
-
|
|
522213
|
+
import_react106.default.createElement(
|
|
522023
522214
|
dist_default4,
|
|
522024
522215
|
{ colors: logoGradient },
|
|
522025
|
-
|
|
522216
|
+
import_react106.default.createElement(Text, null, `\u2554\u2550\u2557\u2554\u2557\u2554\u2554\u2550\u2557\u2566 \u2566
|
|
522026
522217
|
\u255A\u2550\u2557\u2551\u2551\u2551\u2551 \u2551\u2551\u2551\u2551
|
|
522027
522218
|
\u255A\u2550\u255D\u255D\u255A\u255D\u255A\u2550\u255D\u255A\u2569\u255D`)
|
|
522028
522219
|
)
|
|
522029
522220
|
);
|
|
522030
522221
|
}
|
|
522031
|
-
return
|
|
522222
|
+
return import_react106.default.createElement(
|
|
522032
522223
|
Box_default,
|
|
522033
522224
|
{ marginBottom: 0 },
|
|
522034
|
-
|
|
522225
|
+
import_react106.default.createElement(
|
|
522035
522226
|
Text,
|
|
522036
522227
|
null,
|
|
522037
|
-
|
|
522038
|
-
|
|
522228
|
+
import_react106.default.createElement(Text, { color: "cyan" }, "\u2746 "),
|
|
522229
|
+
import_react106.default.createElement(dist_default4, { colors: logoGradient }, "SNOW CLI")
|
|
522039
522230
|
)
|
|
522040
522231
|
);
|
|
522041
522232
|
}
|
|
522042
|
-
var
|
|
522233
|
+
var import_react106;
|
|
522043
522234
|
var init_ChatHeader = __esm({
|
|
522044
522235
|
async "dist/ui/components/special/ChatHeader.js"() {
|
|
522045
522236
|
"use strict";
|
|
522046
|
-
|
|
522237
|
+
import_react106 = __toESM(require_react(), 1);
|
|
522047
522238
|
await init_build2();
|
|
522048
522239
|
await init_dist4();
|
|
522049
522240
|
init_I18nContext();
|
|
@@ -522052,11 +522243,11 @@ var init_ChatHeader = __esm({
|
|
|
522052
522243
|
});
|
|
522053
522244
|
|
|
522054
522245
|
// dist/ui/components/panels/CustomCommandConfigPanel.js
|
|
522055
|
-
var
|
|
522246
|
+
var import_react107, CustomCommandConfigPanel;
|
|
522056
522247
|
var init_CustomCommandConfigPanel = __esm({
|
|
522057
522248
|
async "dist/ui/components/panels/CustomCommandConfigPanel.js"() {
|
|
522058
522249
|
"use strict";
|
|
522059
|
-
|
|
522250
|
+
import_react107 = __toESM(require_react(), 1);
|
|
522060
522251
|
await init_build2();
|
|
522061
522252
|
await init_build4();
|
|
522062
522253
|
init_ThemeContext();
|
|
@@ -522065,11 +522256,11 @@ var init_CustomCommandConfigPanel = __esm({
|
|
|
522065
522256
|
CustomCommandConfigPanel = ({ onSave, onCancel }) => {
|
|
522066
522257
|
const { theme: theme14 } = useTheme();
|
|
522067
522258
|
const { t } = useI18n();
|
|
522068
|
-
const [step, setStep] = (0,
|
|
522069
|
-
const [commandName, setCommandName] = (0,
|
|
522070
|
-
const [commandText, setCommandText] = (0,
|
|
522071
|
-
const [commandType, setCommandType] = (0,
|
|
522072
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
522259
|
+
const [step, setStep] = (0, import_react107.useState)("name");
|
|
522260
|
+
const [commandName, setCommandName] = (0, import_react107.useState)("");
|
|
522261
|
+
const [commandText, setCommandText] = (0, import_react107.useState)("");
|
|
522262
|
+
const [commandType, setCommandType] = (0, import_react107.useState)("execute");
|
|
522263
|
+
const [errorMessage, setErrorMessage] = (0, import_react107.useState)("");
|
|
522073
522264
|
use_input_default((input2, key) => {
|
|
522074
522265
|
if (step === "type") {
|
|
522075
522266
|
if (input2.toLowerCase() === "e") {
|
|
@@ -522087,7 +522278,7 @@ var init_CustomCommandConfigPanel = __esm({
|
|
|
522087
522278
|
}
|
|
522088
522279
|
}
|
|
522089
522280
|
}, { isActive: step === "type" || step === "confirm" });
|
|
522090
|
-
const handleNameSubmit = (0,
|
|
522281
|
+
const handleNameSubmit = (0, import_react107.useCallback)((value) => {
|
|
522091
522282
|
if (value.trim()) {
|
|
522092
522283
|
const trimmedName = value.trim();
|
|
522093
522284
|
if (isCommandNameConflict(trimmedName)) {
|
|
@@ -522099,110 +522290,110 @@ var init_CustomCommandConfigPanel = __esm({
|
|
|
522099
522290
|
setStep("command");
|
|
522100
522291
|
}
|
|
522101
522292
|
}, []);
|
|
522102
|
-
const handleCommandSubmit = (0,
|
|
522293
|
+
const handleCommandSubmit = (0, import_react107.useCallback)((value) => {
|
|
522103
522294
|
if (value.trim()) {
|
|
522104
522295
|
setCommandText(value.trim());
|
|
522105
522296
|
setStep("type");
|
|
522106
522297
|
}
|
|
522107
522298
|
}, []);
|
|
522108
|
-
const handleConfirm = (0,
|
|
522299
|
+
const handleConfirm = (0, import_react107.useCallback)(async () => {
|
|
522109
522300
|
await onSave(commandName, commandText, commandType);
|
|
522110
522301
|
}, [commandName, commandText, commandType, onSave]);
|
|
522111
|
-
const handleCancel = (0,
|
|
522302
|
+
const handleCancel = (0, import_react107.useCallback)(() => {
|
|
522112
522303
|
onCancel();
|
|
522113
522304
|
}, [onCancel]);
|
|
522114
|
-
return
|
|
522305
|
+
return import_react107.default.createElement(
|
|
522115
522306
|
Box_default,
|
|
522116
522307
|
{ flexDirection: "column", padding: 1, borderStyle: "round", borderColor: theme14.colors.border },
|
|
522117
|
-
|
|
522308
|
+
import_react107.default.createElement(
|
|
522118
522309
|
Box_default,
|
|
522119
522310
|
{ marginBottom: 1 },
|
|
522120
|
-
|
|
522311
|
+
import_react107.default.createElement(Text, { bold: true, color: theme14.colors.menuSelected }, t.customCommand.title)
|
|
522121
522312
|
),
|
|
522122
|
-
step === "name" &&
|
|
522313
|
+
step === "name" && import_react107.default.createElement(
|
|
522123
522314
|
Box_default,
|
|
522124
522315
|
{ flexDirection: "column" },
|
|
522125
|
-
|
|
522316
|
+
import_react107.default.createElement(
|
|
522126
522317
|
Box_default,
|
|
522127
522318
|
{ marginBottom: 1 },
|
|
522128
|
-
|
|
522319
|
+
import_react107.default.createElement(Text, { color: theme14.colors.text }, t.customCommand.nameLabel)
|
|
522129
522320
|
),
|
|
522130
|
-
|
|
522131
|
-
errorMessage &&
|
|
522321
|
+
import_react107.default.createElement(TextInput, { placeholder: t.customCommand.namePlaceholder, onSubmit: handleNameSubmit }),
|
|
522322
|
+
errorMessage && import_react107.default.createElement(
|
|
522132
522323
|
Box_default,
|
|
522133
522324
|
{ marginTop: 1 },
|
|
522134
|
-
|
|
522325
|
+
import_react107.default.createElement(Text, { color: theme14.colors.error }, errorMessage)
|
|
522135
522326
|
),
|
|
522136
|
-
|
|
522327
|
+
import_react107.default.createElement(
|
|
522137
522328
|
Box_default,
|
|
522138
522329
|
{ marginTop: 1 },
|
|
522139
|
-
|
|
522330
|
+
import_react107.default.createElement(Text, { dimColor: true }, t.customCommand.escCancel)
|
|
522140
522331
|
)
|
|
522141
522332
|
),
|
|
522142
|
-
step === "command" &&
|
|
522333
|
+
step === "command" && import_react107.default.createElement(
|
|
522143
522334
|
Box_default,
|
|
522144
522335
|
{ flexDirection: "column" },
|
|
522145
|
-
|
|
522336
|
+
import_react107.default.createElement(
|
|
522146
522337
|
Box_default,
|
|
522147
522338
|
{ marginBottom: 1 },
|
|
522148
|
-
|
|
522339
|
+
import_react107.default.createElement(
|
|
522149
522340
|
Text,
|
|
522150
522341
|
{ color: theme14.colors.text },
|
|
522151
522342
|
t.customCommand.nameLabel,
|
|
522152
522343
|
" ",
|
|
522153
|
-
|
|
522344
|
+
import_react107.default.createElement(Text, { bold: true, color: theme14.colors.success }, commandName)
|
|
522154
522345
|
)
|
|
522155
522346
|
),
|
|
522156
|
-
|
|
522347
|
+
import_react107.default.createElement(
|
|
522157
522348
|
Box_default,
|
|
522158
522349
|
{ marginBottom: 1 },
|
|
522159
|
-
|
|
522350
|
+
import_react107.default.createElement(Text, { color: theme14.colors.text }, t.customCommand.commandLabel)
|
|
522160
522351
|
),
|
|
522161
|
-
|
|
522162
|
-
|
|
522352
|
+
import_react107.default.createElement(TextInput, { placeholder: t.customCommand.commandPlaceholder, onSubmit: handleCommandSubmit }),
|
|
522353
|
+
import_react107.default.createElement(
|
|
522163
522354
|
Box_default,
|
|
522164
522355
|
{ marginTop: 1 },
|
|
522165
|
-
|
|
522356
|
+
import_react107.default.createElement(Text, { dimColor: true }, t.customCommand.escCancel)
|
|
522166
522357
|
)
|
|
522167
522358
|
),
|
|
522168
|
-
step === "type" &&
|
|
522359
|
+
step === "type" && import_react107.default.createElement(
|
|
522169
522360
|
Box_default,
|
|
522170
522361
|
{ flexDirection: "column" },
|
|
522171
|
-
|
|
522362
|
+
import_react107.default.createElement(
|
|
522172
522363
|
Box_default,
|
|
522173
522364
|
{ marginBottom: 1 },
|
|
522174
|
-
|
|
522365
|
+
import_react107.default.createElement(
|
|
522175
522366
|
Text,
|
|
522176
522367
|
{ color: theme14.colors.text },
|
|
522177
522368
|
"Command:",
|
|
522178
522369
|
" ",
|
|
522179
|
-
|
|
522370
|
+
import_react107.default.createElement(Text, { color: theme14.colors.menuNormal }, commandText)
|
|
522180
522371
|
)
|
|
522181
522372
|
),
|
|
522182
|
-
|
|
522373
|
+
import_react107.default.createElement(
|
|
522183
522374
|
Box_default,
|
|
522184
522375
|
{ marginBottom: 1 },
|
|
522185
|
-
|
|
522376
|
+
import_react107.default.createElement(Text, { color: theme14.colors.text }, t.customCommand.typeLabel)
|
|
522186
522377
|
),
|
|
522187
|
-
|
|
522378
|
+
import_react107.default.createElement(
|
|
522188
522379
|
Box_default,
|
|
522189
522380
|
{ marginTop: 1, gap: 2 },
|
|
522190
|
-
|
|
522381
|
+
import_react107.default.createElement(
|
|
522191
522382
|
Box_default,
|
|
522192
522383
|
null,
|
|
522193
|
-
|
|
522194
|
-
|
|
522384
|
+
import_react107.default.createElement(Text, { color: theme14.colors.success, bold: true }, "[E]"),
|
|
522385
|
+
import_react107.default.createElement(
|
|
522195
522386
|
Text,
|
|
522196
522387
|
{ color: theme14.colors.text },
|
|
522197
522388
|
" ",
|
|
522198
522389
|
t.customCommand.typeExecute
|
|
522199
522390
|
)
|
|
522200
522391
|
),
|
|
522201
|
-
|
|
522392
|
+
import_react107.default.createElement(
|
|
522202
522393
|
Box_default,
|
|
522203
522394
|
null,
|
|
522204
|
-
|
|
522205
|
-
|
|
522395
|
+
import_react107.default.createElement(Text, { color: theme14.colors.menuSelected, bold: true }, "[P]"),
|
|
522396
|
+
import_react107.default.createElement(
|
|
522206
522397
|
Text,
|
|
522207
522398
|
{ color: theme14.colors.text },
|
|
522208
522399
|
" ",
|
|
@@ -522210,72 +522401,72 @@ var init_CustomCommandConfigPanel = __esm({
|
|
|
522210
522401
|
)
|
|
522211
522402
|
)
|
|
522212
522403
|
),
|
|
522213
|
-
|
|
522404
|
+
import_react107.default.createElement(
|
|
522214
522405
|
Box_default,
|
|
522215
522406
|
{ marginTop: 1 },
|
|
522216
|
-
|
|
522407
|
+
import_react107.default.createElement(Text, { dimColor: true }, t.customCommand.escCancel)
|
|
522217
522408
|
)
|
|
522218
522409
|
),
|
|
522219
|
-
step === "confirm" &&
|
|
522410
|
+
step === "confirm" && import_react107.default.createElement(
|
|
522220
522411
|
Box_default,
|
|
522221
522412
|
{ flexDirection: "column" },
|
|
522222
|
-
|
|
522413
|
+
import_react107.default.createElement(
|
|
522223
522414
|
Box_default,
|
|
522224
522415
|
{ marginBottom: 1 },
|
|
522225
|
-
|
|
522416
|
+
import_react107.default.createElement(
|
|
522226
522417
|
Text,
|
|
522227
522418
|
{ color: theme14.colors.text },
|
|
522228
522419
|
t.customCommand.nameLabel,
|
|
522229
522420
|
" ",
|
|
522230
|
-
|
|
522421
|
+
import_react107.default.createElement(Text, { bold: true, color: theme14.colors.success }, commandName)
|
|
522231
522422
|
)
|
|
522232
522423
|
),
|
|
522233
|
-
|
|
522424
|
+
import_react107.default.createElement(
|
|
522234
522425
|
Box_default,
|
|
522235
522426
|
{ marginBottom: 1 },
|
|
522236
|
-
|
|
522427
|
+
import_react107.default.createElement(
|
|
522237
522428
|
Text,
|
|
522238
522429
|
{ color: theme14.colors.text },
|
|
522239
522430
|
"Command:",
|
|
522240
522431
|
" ",
|
|
522241
|
-
|
|
522432
|
+
import_react107.default.createElement(Text, { color: theme14.colors.menuNormal }, commandText)
|
|
522242
522433
|
)
|
|
522243
522434
|
),
|
|
522244
|
-
|
|
522435
|
+
import_react107.default.createElement(
|
|
522245
522436
|
Box_default,
|
|
522246
522437
|
{ marginBottom: 1 },
|
|
522247
|
-
|
|
522438
|
+
import_react107.default.createElement(
|
|
522248
522439
|
Text,
|
|
522249
522440
|
{ color: theme14.colors.text },
|
|
522250
522441
|
"Type:",
|
|
522251
522442
|
" ",
|
|
522252
|
-
|
|
522443
|
+
import_react107.default.createElement(Text, { bold: true, color: theme14.colors.menuSelected }, commandType === "execute" ? t.customCommand.typeExecute : t.customCommand.typePrompt)
|
|
522253
522444
|
)
|
|
522254
522445
|
),
|
|
522255
|
-
|
|
522446
|
+
import_react107.default.createElement(
|
|
522256
522447
|
Box_default,
|
|
522257
522448
|
{ marginTop: 1 },
|
|
522258
|
-
|
|
522449
|
+
import_react107.default.createElement(Text, { color: theme14.colors.text }, t.customCommand.confirmSave)
|
|
522259
522450
|
),
|
|
522260
|
-
|
|
522451
|
+
import_react107.default.createElement(
|
|
522261
522452
|
Box_default,
|
|
522262
522453
|
{ marginTop: 1, gap: 2 },
|
|
522263
|
-
|
|
522454
|
+
import_react107.default.createElement(
|
|
522264
522455
|
Box_default,
|
|
522265
522456
|
null,
|
|
522266
|
-
|
|
522267
|
-
|
|
522457
|
+
import_react107.default.createElement(Text, { color: theme14.colors.success, bold: true }, "[Y]"),
|
|
522458
|
+
import_react107.default.createElement(
|
|
522268
522459
|
Text,
|
|
522269
522460
|
{ color: theme14.colors.text },
|
|
522270
522461
|
" ",
|
|
522271
522462
|
t.customCommand.confirmYes
|
|
522272
522463
|
)
|
|
522273
522464
|
),
|
|
522274
|
-
|
|
522465
|
+
import_react107.default.createElement(
|
|
522275
522466
|
Box_default,
|
|
522276
522467
|
null,
|
|
522277
|
-
|
|
522278
|
-
|
|
522468
|
+
import_react107.default.createElement(Text, { color: theme14.colors.error, bold: true }, "[N]"),
|
|
522469
|
+
import_react107.default.createElement(
|
|
522279
522470
|
Text,
|
|
522280
522471
|
{ color: theme14.colors.text },
|
|
522281
522472
|
" ",
|
|
@@ -522541,11 +522732,11 @@ var init_skills2 = __esm({
|
|
|
522541
522732
|
});
|
|
522542
522733
|
|
|
522543
522734
|
// dist/ui/components/panels/SkillsCreationPanel.js
|
|
522544
|
-
var
|
|
522735
|
+
var import_react108, SkillsCreationPanel;
|
|
522545
522736
|
var init_SkillsCreationPanel = __esm({
|
|
522546
522737
|
async "dist/ui/components/panels/SkillsCreationPanel.js"() {
|
|
522547
522738
|
"use strict";
|
|
522548
|
-
|
|
522739
|
+
import_react108 = __toESM(require_react(), 1);
|
|
522549
522740
|
await init_build2();
|
|
522550
522741
|
await init_build4();
|
|
522551
522742
|
init_ThemeContext();
|
|
@@ -522554,11 +522745,11 @@ var init_SkillsCreationPanel = __esm({
|
|
|
522554
522745
|
SkillsCreationPanel = ({ onSave, onCancel, projectRoot }) => {
|
|
522555
522746
|
const { theme: theme14 } = useTheme();
|
|
522556
522747
|
const { t } = useI18n();
|
|
522557
|
-
const [step, setStep] = (0,
|
|
522558
|
-
const [skillName, setSkillName] = (0,
|
|
522559
|
-
const [description, setDescription] = (0,
|
|
522560
|
-
const [location, setLocation] = (0,
|
|
522561
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
522748
|
+
const [step, setStep] = (0, import_react108.useState)("name");
|
|
522749
|
+
const [skillName, setSkillName] = (0, import_react108.useState)("");
|
|
522750
|
+
const [description, setDescription] = (0, import_react108.useState)("");
|
|
522751
|
+
const [location, setLocation] = (0, import_react108.useState)("global");
|
|
522752
|
+
const [errorMessage, setErrorMessage] = (0, import_react108.useState)("");
|
|
522562
522753
|
use_input_default((input2, key) => {
|
|
522563
522754
|
if (key.escape) {
|
|
522564
522755
|
handleCancel();
|
|
@@ -522580,7 +522771,7 @@ var init_SkillsCreationPanel = __esm({
|
|
|
522580
522771
|
}
|
|
522581
522772
|
}
|
|
522582
522773
|
}, { isActive: step === "location" || step === "confirm" });
|
|
522583
|
-
const handleNameSubmit = (0,
|
|
522774
|
+
const handleNameSubmit = (0, import_react108.useCallback)((value) => {
|
|
522584
522775
|
if (value.trim()) {
|
|
522585
522776
|
const trimmedName = value.trim();
|
|
522586
522777
|
const validation = validateSkillName(trimmedName);
|
|
@@ -522605,214 +522796,214 @@ var init_SkillsCreationPanel = __esm({
|
|
|
522605
522796
|
setStep("description");
|
|
522606
522797
|
}
|
|
522607
522798
|
}, [projectRoot, t.skillsCreation]);
|
|
522608
|
-
const handleDescriptionSubmit = (0,
|
|
522799
|
+
const handleDescriptionSubmit = (0, import_react108.useCallback)((value) => {
|
|
522609
522800
|
if (value.trim()) {
|
|
522610
522801
|
setDescription(value.trim());
|
|
522611
522802
|
setStep("location");
|
|
522612
522803
|
}
|
|
522613
522804
|
}, []);
|
|
522614
|
-
const handleConfirm = (0,
|
|
522805
|
+
const handleConfirm = (0, import_react108.useCallback)(async () => {
|
|
522615
522806
|
await onSave(skillName, description, location);
|
|
522616
522807
|
}, [skillName, description, location, onSave]);
|
|
522617
|
-
const handleCancel = (0,
|
|
522808
|
+
const handleCancel = (0, import_react108.useCallback)(() => {
|
|
522618
522809
|
onCancel();
|
|
522619
522810
|
}, [onCancel]);
|
|
522620
|
-
return
|
|
522811
|
+
return import_react108.default.createElement(
|
|
522621
522812
|
Box_default,
|
|
522622
522813
|
{ flexDirection: "column", padding: 1, borderStyle: "round", borderColor: theme14.colors.border },
|
|
522623
|
-
|
|
522814
|
+
import_react108.default.createElement(
|
|
522624
522815
|
Box_default,
|
|
522625
522816
|
{ marginBottom: 1 },
|
|
522626
|
-
|
|
522817
|
+
import_react108.default.createElement(Text, { bold: true, color: theme14.colors.menuSelected }, t.skillsCreation.title)
|
|
522627
522818
|
),
|
|
522628
|
-
step === "name" &&
|
|
522819
|
+
step === "name" && import_react108.default.createElement(
|
|
522629
522820
|
Box_default,
|
|
522630
522821
|
{ flexDirection: "column" },
|
|
522631
|
-
|
|
522822
|
+
import_react108.default.createElement(
|
|
522632
522823
|
Box_default,
|
|
522633
522824
|
{ marginBottom: 1 },
|
|
522634
|
-
|
|
522825
|
+
import_react108.default.createElement(Text, { color: theme14.colors.text }, t.skillsCreation.nameLabel)
|
|
522635
522826
|
),
|
|
522636
|
-
|
|
522827
|
+
import_react108.default.createElement(
|
|
522637
522828
|
Box_default,
|
|
522638
522829
|
{ marginBottom: 1 },
|
|
522639
|
-
|
|
522830
|
+
import_react108.default.createElement(Text, { dimColor: true }, t.skillsCreation.nameHint)
|
|
522640
522831
|
),
|
|
522641
|
-
|
|
522642
|
-
errorMessage &&
|
|
522832
|
+
import_react108.default.createElement(TextInput, { placeholder: t.skillsCreation.namePlaceholder, onSubmit: handleNameSubmit }),
|
|
522833
|
+
errorMessage && import_react108.default.createElement(
|
|
522643
522834
|
Box_default,
|
|
522644
522835
|
{ marginTop: 1 },
|
|
522645
|
-
|
|
522836
|
+
import_react108.default.createElement(Text, { color: theme14.colors.error }, errorMessage)
|
|
522646
522837
|
),
|
|
522647
|
-
|
|
522838
|
+
import_react108.default.createElement(
|
|
522648
522839
|
Box_default,
|
|
522649
522840
|
{ marginTop: 1 },
|
|
522650
|
-
|
|
522841
|
+
import_react108.default.createElement(Text, { dimColor: true }, t.skillsCreation.escCancel)
|
|
522651
522842
|
)
|
|
522652
522843
|
),
|
|
522653
|
-
step === "description" &&
|
|
522844
|
+
step === "description" && import_react108.default.createElement(
|
|
522654
522845
|
Box_default,
|
|
522655
522846
|
{ flexDirection: "column" },
|
|
522656
|
-
|
|
522847
|
+
import_react108.default.createElement(
|
|
522657
522848
|
Box_default,
|
|
522658
522849
|
{ marginBottom: 1 },
|
|
522659
|
-
|
|
522850
|
+
import_react108.default.createElement(
|
|
522660
522851
|
Text,
|
|
522661
522852
|
{ color: theme14.colors.text },
|
|
522662
522853
|
t.skillsCreation.nameLabel,
|
|
522663
522854
|
" ",
|
|
522664
|
-
|
|
522855
|
+
import_react108.default.createElement(Text, { bold: true, color: theme14.colors.success }, skillName)
|
|
522665
522856
|
)
|
|
522666
522857
|
),
|
|
522667
|
-
|
|
522858
|
+
import_react108.default.createElement(
|
|
522668
522859
|
Box_default,
|
|
522669
522860
|
{ marginBottom: 1 },
|
|
522670
|
-
|
|
522861
|
+
import_react108.default.createElement(Text, { color: theme14.colors.text }, t.skillsCreation.descriptionLabel)
|
|
522671
522862
|
),
|
|
522672
|
-
|
|
522863
|
+
import_react108.default.createElement(
|
|
522673
522864
|
Box_default,
|
|
522674
522865
|
{ marginBottom: 1 },
|
|
522675
|
-
|
|
522866
|
+
import_react108.default.createElement(Text, { dimColor: true }, t.skillsCreation.descriptionHint)
|
|
522676
522867
|
),
|
|
522677
|
-
|
|
522678
|
-
|
|
522868
|
+
import_react108.default.createElement(TextInput, { placeholder: t.skillsCreation.descriptionPlaceholder, onSubmit: handleDescriptionSubmit }),
|
|
522869
|
+
import_react108.default.createElement(
|
|
522679
522870
|
Box_default,
|
|
522680
522871
|
{ marginTop: 1 },
|
|
522681
|
-
|
|
522872
|
+
import_react108.default.createElement(Text, { dimColor: true }, t.skillsCreation.escCancel)
|
|
522682
522873
|
)
|
|
522683
522874
|
),
|
|
522684
|
-
step === "location" &&
|
|
522875
|
+
step === "location" && import_react108.default.createElement(
|
|
522685
522876
|
Box_default,
|
|
522686
522877
|
{ flexDirection: "column" },
|
|
522687
|
-
|
|
522878
|
+
import_react108.default.createElement(
|
|
522688
522879
|
Box_default,
|
|
522689
522880
|
{ marginBottom: 1 },
|
|
522690
|
-
|
|
522881
|
+
import_react108.default.createElement(
|
|
522691
522882
|
Text,
|
|
522692
522883
|
{ color: theme14.colors.text },
|
|
522693
522884
|
t.skillsCreation.nameLabel,
|
|
522694
522885
|
" ",
|
|
522695
|
-
|
|
522886
|
+
import_react108.default.createElement(Text, { bold: true, color: theme14.colors.success }, skillName)
|
|
522696
522887
|
)
|
|
522697
522888
|
),
|
|
522698
|
-
|
|
522889
|
+
import_react108.default.createElement(
|
|
522699
522890
|
Box_default,
|
|
522700
522891
|
{ marginBottom: 1 },
|
|
522701
|
-
|
|
522892
|
+
import_react108.default.createElement(
|
|
522702
522893
|
Text,
|
|
522703
522894
|
{ color: theme14.colors.text },
|
|
522704
522895
|
t.skillsCreation.descriptionLabel,
|
|
522705
522896
|
" ",
|
|
522706
|
-
|
|
522897
|
+
import_react108.default.createElement(Text, { color: theme14.colors.menuNormal }, description)
|
|
522707
522898
|
)
|
|
522708
522899
|
),
|
|
522709
|
-
|
|
522900
|
+
import_react108.default.createElement(
|
|
522710
522901
|
Box_default,
|
|
522711
522902
|
{ marginBottom: 1, marginTop: 1 },
|
|
522712
|
-
|
|
522903
|
+
import_react108.default.createElement(Text, { color: theme14.colors.text }, t.skillsCreation.locationLabel)
|
|
522713
522904
|
),
|
|
522714
|
-
|
|
522905
|
+
import_react108.default.createElement(
|
|
522715
522906
|
Box_default,
|
|
522716
522907
|
{ marginTop: 1, flexDirection: "column", gap: 1 },
|
|
522717
|
-
|
|
522908
|
+
import_react108.default.createElement(
|
|
522718
522909
|
Box_default,
|
|
522719
522910
|
null,
|
|
522720
|
-
|
|
522721
|
-
|
|
522911
|
+
import_react108.default.createElement(Text, { color: theme14.colors.success, bold: true }, "[G]"),
|
|
522912
|
+
import_react108.default.createElement(
|
|
522722
522913
|
Text,
|
|
522723
522914
|
{ color: theme14.colors.text },
|
|
522724
522915
|
" ",
|
|
522725
522916
|
t.skillsCreation.locationGlobal
|
|
522726
522917
|
)
|
|
522727
522918
|
),
|
|
522728
|
-
|
|
522919
|
+
import_react108.default.createElement(
|
|
522729
522920
|
Box_default,
|
|
522730
522921
|
{ marginLeft: 4 },
|
|
522731
|
-
|
|
522922
|
+
import_react108.default.createElement(Text, { dimColor: true }, t.skillsCreation.locationGlobalInfo)
|
|
522732
522923
|
),
|
|
522733
|
-
|
|
522924
|
+
import_react108.default.createElement(
|
|
522734
522925
|
Box_default,
|
|
522735
522926
|
{ marginTop: 1 },
|
|
522736
|
-
|
|
522737
|
-
|
|
522927
|
+
import_react108.default.createElement(Text, { color: theme14.colors.menuSelected, bold: true }, "[P]"),
|
|
522928
|
+
import_react108.default.createElement(
|
|
522738
522929
|
Text,
|
|
522739
522930
|
{ color: theme14.colors.text },
|
|
522740
522931
|
" ",
|
|
522741
522932
|
t.skillsCreation.locationProject
|
|
522742
522933
|
)
|
|
522743
522934
|
),
|
|
522744
|
-
|
|
522935
|
+
import_react108.default.createElement(
|
|
522745
522936
|
Box_default,
|
|
522746
522937
|
{ marginLeft: 4 },
|
|
522747
|
-
|
|
522938
|
+
import_react108.default.createElement(Text, { dimColor: true }, t.skillsCreation.locationProjectInfo)
|
|
522748
522939
|
)
|
|
522749
522940
|
),
|
|
522750
|
-
|
|
522941
|
+
import_react108.default.createElement(
|
|
522751
522942
|
Box_default,
|
|
522752
522943
|
{ marginTop: 1 },
|
|
522753
|
-
|
|
522944
|
+
import_react108.default.createElement(Text, { dimColor: true }, t.skillsCreation.escCancel)
|
|
522754
522945
|
)
|
|
522755
522946
|
),
|
|
522756
|
-
step === "confirm" &&
|
|
522947
|
+
step === "confirm" && import_react108.default.createElement(
|
|
522757
522948
|
Box_default,
|
|
522758
522949
|
{ flexDirection: "column" },
|
|
522759
|
-
|
|
522950
|
+
import_react108.default.createElement(
|
|
522760
522951
|
Box_default,
|
|
522761
522952
|
{ marginBottom: 1 },
|
|
522762
|
-
|
|
522953
|
+
import_react108.default.createElement(
|
|
522763
522954
|
Text,
|
|
522764
522955
|
{ color: theme14.colors.text },
|
|
522765
522956
|
t.skillsCreation.nameLabel,
|
|
522766
522957
|
" ",
|
|
522767
|
-
|
|
522958
|
+
import_react108.default.createElement(Text, { bold: true, color: theme14.colors.success }, skillName)
|
|
522768
522959
|
)
|
|
522769
522960
|
),
|
|
522770
|
-
|
|
522961
|
+
import_react108.default.createElement(
|
|
522771
522962
|
Box_default,
|
|
522772
522963
|
{ marginBottom: 1 },
|
|
522773
|
-
|
|
522964
|
+
import_react108.default.createElement(
|
|
522774
522965
|
Text,
|
|
522775
522966
|
{ color: theme14.colors.text },
|
|
522776
522967
|
t.skillsCreation.descriptionLabel,
|
|
522777
522968
|
" ",
|
|
522778
|
-
|
|
522969
|
+
import_react108.default.createElement(Text, { color: theme14.colors.menuNormal }, description)
|
|
522779
522970
|
)
|
|
522780
522971
|
),
|
|
522781
|
-
|
|
522972
|
+
import_react108.default.createElement(
|
|
522782
522973
|
Box_default,
|
|
522783
522974
|
{ marginBottom: 1 },
|
|
522784
|
-
|
|
522975
|
+
import_react108.default.createElement(
|
|
522785
522976
|
Text,
|
|
522786
522977
|
{ color: theme14.colors.text },
|
|
522787
522978
|
t.skillsCreation.locationLabel,
|
|
522788
522979
|
" ",
|
|
522789
|
-
|
|
522980
|
+
import_react108.default.createElement(Text, { bold: true, color: theme14.colors.menuSelected }, location === "global" ? t.skillsCreation.locationGlobal : t.skillsCreation.locationProject)
|
|
522790
522981
|
)
|
|
522791
522982
|
),
|
|
522792
|
-
|
|
522983
|
+
import_react108.default.createElement(
|
|
522793
522984
|
Box_default,
|
|
522794
522985
|
{ marginTop: 1 },
|
|
522795
|
-
|
|
522986
|
+
import_react108.default.createElement(Text, { color: theme14.colors.text }, t.skillsCreation.confirmQuestion)
|
|
522796
522987
|
),
|
|
522797
|
-
|
|
522988
|
+
import_react108.default.createElement(
|
|
522798
522989
|
Box_default,
|
|
522799
522990
|
{ marginTop: 1, gap: 2 },
|
|
522800
|
-
|
|
522991
|
+
import_react108.default.createElement(
|
|
522801
522992
|
Box_default,
|
|
522802
522993
|
null,
|
|
522803
|
-
|
|
522804
|
-
|
|
522994
|
+
import_react108.default.createElement(Text, { color: theme14.colors.success, bold: true }, "[Y]"),
|
|
522995
|
+
import_react108.default.createElement(
|
|
522805
522996
|
Text,
|
|
522806
522997
|
{ color: theme14.colors.text },
|
|
522807
522998
|
" ",
|
|
522808
522999
|
t.skillsCreation.confirmYes
|
|
522809
523000
|
)
|
|
522810
523001
|
),
|
|
522811
|
-
|
|
523002
|
+
import_react108.default.createElement(
|
|
522812
523003
|
Box_default,
|
|
522813
523004
|
null,
|
|
522814
|
-
|
|
522815
|
-
|
|
523005
|
+
import_react108.default.createElement(Text, { color: theme14.colors.error, bold: true }, "[N]"),
|
|
523006
|
+
import_react108.default.createElement(
|
|
522816
523007
|
Text,
|
|
522817
523008
|
{ color: theme14.colors.text },
|
|
522818
523009
|
" ",
|
|
@@ -522829,16 +523020,16 @@ var init_SkillsCreationPanel = __esm({
|
|
|
522829
523020
|
// dist/ui/components/panels/WorkingDirectoryPanel.js
|
|
522830
523021
|
function WorkingDirectoryPanel({ onClose }) {
|
|
522831
523022
|
const { t } = useI18n();
|
|
522832
|
-
const [directories, setDirectories] = (0,
|
|
522833
|
-
const [loading, setLoading] = (0,
|
|
522834
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
522835
|
-
const [markedDirs, setMarkedDirs] = (0,
|
|
522836
|
-
const [confirmDelete, setConfirmDelete] = (0,
|
|
522837
|
-
const [addingMode, setAddingMode] = (0,
|
|
522838
|
-
const [newDirPath, setNewDirPath] = (0,
|
|
522839
|
-
const [addError, setAddError] = (0,
|
|
522840
|
-
const [showDefaultAlert, setShowDefaultAlert] = (0,
|
|
522841
|
-
(0,
|
|
523023
|
+
const [directories, setDirectories] = (0, import_react109.useState)([]);
|
|
523024
|
+
const [loading, setLoading] = (0, import_react109.useState)(true);
|
|
523025
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react109.useState)(0);
|
|
523026
|
+
const [markedDirs, setMarkedDirs] = (0, import_react109.useState)(/* @__PURE__ */ new Set());
|
|
523027
|
+
const [confirmDelete, setConfirmDelete] = (0, import_react109.useState)(false);
|
|
523028
|
+
const [addingMode, setAddingMode] = (0, import_react109.useState)(false);
|
|
523029
|
+
const [newDirPath, setNewDirPath] = (0, import_react109.useState)("");
|
|
523030
|
+
const [addError, setAddError] = (0, import_react109.useState)(null);
|
|
523031
|
+
const [showDefaultAlert, setShowDefaultAlert] = (0, import_react109.useState)(false);
|
|
523032
|
+
(0, import_react109.useEffect)(() => {
|
|
522842
523033
|
const loadDirs = async () => {
|
|
522843
523034
|
setLoading(true);
|
|
522844
523035
|
try {
|
|
@@ -522853,7 +523044,7 @@ function WorkingDirectoryPanel({ onClose }) {
|
|
|
522853
523044
|
};
|
|
522854
523045
|
void loadDirs();
|
|
522855
523046
|
}, []);
|
|
522856
|
-
(0,
|
|
523047
|
+
(0, import_react109.useEffect)(() => {
|
|
522857
523048
|
if (showDefaultAlert) {
|
|
522858
523049
|
const timer2 = setTimeout(() => {
|
|
522859
523050
|
setShowDefaultAlert(false);
|
|
@@ -522862,7 +523053,7 @@ function WorkingDirectoryPanel({ onClose }) {
|
|
|
522862
523053
|
}
|
|
522863
523054
|
return void 0;
|
|
522864
523055
|
}, [showDefaultAlert]);
|
|
522865
|
-
use_input_default((0,
|
|
523056
|
+
use_input_default((0, import_react109.useCallback)((input2, key) => {
|
|
522866
523057
|
if (addingMode) {
|
|
522867
523058
|
if (key.escape) {
|
|
522868
523059
|
setAddingMode(false);
|
|
@@ -522960,107 +523151,107 @@ function WorkingDirectoryPanel({ onClose }) {
|
|
|
522960
523151
|
}
|
|
522961
523152
|
};
|
|
522962
523153
|
if (addingMode) {
|
|
522963
|
-
return
|
|
523154
|
+
return import_react109.default.createElement(
|
|
522964
523155
|
Box_default,
|
|
522965
523156
|
{ flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "green" },
|
|
522966
|
-
|
|
522967
|
-
|
|
523157
|
+
import_react109.default.createElement(Text, { color: "green", bold: true }, t.workingDirectoryPanel.addTitle),
|
|
523158
|
+
import_react109.default.createElement(
|
|
522968
523159
|
Box_default,
|
|
522969
523160
|
{ marginTop: 1, flexDirection: "column" },
|
|
522970
|
-
|
|
522971
|
-
|
|
523161
|
+
import_react109.default.createElement(Text, null, t.workingDirectoryPanel.addPathPrompt),
|
|
523162
|
+
import_react109.default.createElement(
|
|
522972
523163
|
Box_default,
|
|
522973
523164
|
{ marginTop: 1 },
|
|
522974
|
-
|
|
522975
|
-
|
|
523165
|
+
import_react109.default.createElement(Text, { color: "cyan" }, t.workingDirectoryPanel.addPathLabel),
|
|
523166
|
+
import_react109.default.createElement(build_default2, { value: newDirPath, onChange: setNewDirPath, onSubmit: handleAddSubmit })
|
|
522976
523167
|
),
|
|
522977
|
-
addError &&
|
|
523168
|
+
addError && import_react109.default.createElement(
|
|
522978
523169
|
Box_default,
|
|
522979
523170
|
{ marginTop: 1 },
|
|
522980
|
-
|
|
523171
|
+
import_react109.default.createElement(Text, { color: "red" }, addError)
|
|
522981
523172
|
)
|
|
522982
523173
|
),
|
|
522983
|
-
|
|
523174
|
+
import_react109.default.createElement(
|
|
522984
523175
|
Box_default,
|
|
522985
523176
|
{ marginTop: 1 },
|
|
522986
|
-
|
|
523177
|
+
import_react109.default.createElement(Text, { color: "gray" }, t.workingDirectoryPanel.addHint)
|
|
522987
523178
|
)
|
|
522988
523179
|
);
|
|
522989
523180
|
}
|
|
522990
523181
|
if (loading) {
|
|
522991
|
-
return
|
|
523182
|
+
return import_react109.default.createElement(
|
|
522992
523183
|
Box_default,
|
|
522993
523184
|
{ flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "cyan" },
|
|
522994
|
-
|
|
522995
|
-
|
|
523185
|
+
import_react109.default.createElement(Text, { color: "cyan", bold: true }, t.workingDirectoryPanel.title),
|
|
523186
|
+
import_react109.default.createElement(Text, null, t.workingDirectoryPanel.loading)
|
|
522996
523187
|
);
|
|
522997
523188
|
}
|
|
522998
523189
|
if (confirmDelete) {
|
|
522999
523190
|
const deleteMessage = markedDirs.size > 1 ? t.workingDirectoryPanel.confirmDeleteMessagePlural.replace("{count}", markedDirs.size.toString()) : t.workingDirectoryPanel.confirmDeleteMessage.replace("{count}", markedDirs.size.toString());
|
|
523000
|
-
return
|
|
523191
|
+
return import_react109.default.createElement(
|
|
523001
523192
|
Box_default,
|
|
523002
523193
|
{ flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "yellow" },
|
|
523003
|
-
|
|
523004
|
-
|
|
523005
|
-
|
|
523194
|
+
import_react109.default.createElement(Text, { color: "yellow", bold: true }, t.workingDirectoryPanel.confirmDeleteTitle),
|
|
523195
|
+
import_react109.default.createElement(Text, null, deleteMessage),
|
|
523196
|
+
import_react109.default.createElement(Box_default, { marginTop: 1 }, Array.from(markedDirs).map((dirPath) => import_react109.default.createElement(
|
|
523006
523197
|
Text,
|
|
523007
523198
|
{ key: dirPath, color: "red" },
|
|
523008
523199
|
"- ",
|
|
523009
523200
|
dirPath
|
|
523010
523201
|
))),
|
|
523011
|
-
|
|
523202
|
+
import_react109.default.createElement(
|
|
523012
523203
|
Box_default,
|
|
523013
523204
|
{ marginTop: 1 },
|
|
523014
|
-
|
|
523205
|
+
import_react109.default.createElement(Text, null, t.workingDirectoryPanel.confirmHint)
|
|
523015
523206
|
)
|
|
523016
523207
|
);
|
|
523017
523208
|
}
|
|
523018
|
-
return
|
|
523209
|
+
return import_react109.default.createElement(
|
|
523019
523210
|
Box_default,
|
|
523020
523211
|
{ flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "cyan" },
|
|
523021
|
-
|
|
523022
|
-
directories.length === 0 ?
|
|
523212
|
+
import_react109.default.createElement(Text, { color: "cyan", bold: true }, t.workingDirectoryPanel.title),
|
|
523213
|
+
directories.length === 0 ? import_react109.default.createElement(Text, { color: "gray" }, t.workingDirectoryPanel.noDirectories) : import_react109.default.createElement(Box_default, { flexDirection: "column", marginTop: 1 }, directories.map((dir, index) => {
|
|
523023
523214
|
const isSelected = index === selectedIndex;
|
|
523024
523215
|
const isMarked = markedDirs.has(dir.path);
|
|
523025
|
-
return
|
|
523216
|
+
return import_react109.default.createElement(
|
|
523026
523217
|
Box_default,
|
|
523027
523218
|
{ key: dir.path },
|
|
523028
|
-
|
|
523029
|
-
|
|
523219
|
+
import_react109.default.createElement(Text, { color: isSelected ? "cyan" : "white", bold: isSelected }, isSelected ? "> " : " "),
|
|
523220
|
+
import_react109.default.createElement(
|
|
523030
523221
|
Text,
|
|
523031
523222
|
{ color: isMarked ? "yellow" : isSelected ? "cyan" : "white" },
|
|
523032
523223
|
"[",
|
|
523033
523224
|
isMarked ? "x" : " ",
|
|
523034
523225
|
"]"
|
|
523035
523226
|
),
|
|
523036
|
-
|
|
523037
|
-
dir.isDefault &&
|
|
523227
|
+
import_react109.default.createElement(Text, { color: isSelected ? "cyan" : "white" }, " "),
|
|
523228
|
+
dir.isDefault && import_react109.default.createElement(
|
|
523038
523229
|
Text,
|
|
523039
523230
|
{ color: "green", bold: true },
|
|
523040
523231
|
t.workingDirectoryPanel.defaultLabel,
|
|
523041
523232
|
" "
|
|
523042
523233
|
),
|
|
523043
|
-
|
|
523234
|
+
import_react109.default.createElement(Text, { color: isSelected ? "cyan" : "white" }, dir.path)
|
|
523044
523235
|
);
|
|
523045
523236
|
})),
|
|
523046
|
-
|
|
523237
|
+
import_react109.default.createElement(
|
|
523047
523238
|
Box_default,
|
|
523048
523239
|
{ marginTop: 1, flexDirection: "column" },
|
|
523049
|
-
|
|
523050
|
-
markedDirs.size > 0 &&
|
|
523051
|
-
showDefaultAlert &&
|
|
523240
|
+
import_react109.default.createElement(Text, { color: "gray" }, t.workingDirectoryPanel.navigationHint),
|
|
523241
|
+
markedDirs.size > 0 && import_react109.default.createElement(Text, { color: "yellow" }, t.workingDirectoryPanel.markedCount.replace("{count}", markedDirs.size.toString()).replace("{plural}", markedDirs.size > 1 ? t.workingDirectoryPanel.markedCountPlural : t.workingDirectoryPanel.markedCountSingular)),
|
|
523242
|
+
showDefaultAlert && import_react109.default.createElement(
|
|
523052
523243
|
Box_default,
|
|
523053
523244
|
{ marginTop: 1 },
|
|
523054
|
-
|
|
523245
|
+
import_react109.default.createElement(Alert, { variant: "error" }, t.workingDirectoryPanel.alertDefaultCannotDelete)
|
|
523055
523246
|
)
|
|
523056
523247
|
)
|
|
523057
523248
|
);
|
|
523058
523249
|
}
|
|
523059
|
-
var
|
|
523250
|
+
var import_react109;
|
|
523060
523251
|
var init_WorkingDirectoryPanel = __esm({
|
|
523061
523252
|
async "dist/ui/components/panels/WorkingDirectoryPanel.js"() {
|
|
523062
523253
|
"use strict";
|
|
523063
|
-
|
|
523254
|
+
import_react109 = __toESM(require_react(), 1);
|
|
523064
523255
|
await init_build2();
|
|
523065
523256
|
await init_build4();
|
|
523066
523257
|
await init_build5();
|
|
@@ -523071,8 +523262,8 @@ var init_WorkingDirectoryPanel = __esm({
|
|
|
523071
523262
|
|
|
523072
523263
|
// dist/hooks/session/useSessionSave.js
|
|
523073
523264
|
function useSessionSave() {
|
|
523074
|
-
const savedMessagesRef = (0,
|
|
523075
|
-
const generateMessageId = (0,
|
|
523265
|
+
const savedMessagesRef = (0, import_react110.useRef)(/* @__PURE__ */ new Set());
|
|
523266
|
+
const generateMessageId = (0, import_react110.useCallback)((message, timestamp) => {
|
|
523076
523267
|
let id = `${message.role}-${message.content.length}-${Math.floor(timestamp / 5e3)}`;
|
|
523077
523268
|
if (message.role === "assistant" && message.tool_calls && message.tool_calls.length > 0) {
|
|
523078
523269
|
const toolCallIds = message.tool_calls.map((tc) => tc.id).sort().join(",");
|
|
@@ -523083,7 +523274,7 @@ function useSessionSave() {
|
|
|
523083
523274
|
}
|
|
523084
523275
|
return id;
|
|
523085
523276
|
}, []);
|
|
523086
|
-
const saveMessage = (0,
|
|
523277
|
+
const saveMessage = (0, import_react110.useCallback)(async (message) => {
|
|
523087
523278
|
const timestamp = Date.now();
|
|
523088
523279
|
const messageId = generateMessageId(message, timestamp);
|
|
523089
523280
|
if (savedMessagesRef.current.has(messageId)) {
|
|
@@ -523101,15 +523292,15 @@ function useSessionSave() {
|
|
|
523101
523292
|
console.error("Failed to save message:", error);
|
|
523102
523293
|
}
|
|
523103
523294
|
}, [generateMessageId]);
|
|
523104
|
-
const saveMessages = (0,
|
|
523295
|
+
const saveMessages = (0, import_react110.useCallback)(async (messages) => {
|
|
523105
523296
|
for (const message of messages) {
|
|
523106
523297
|
await saveMessage(message);
|
|
523107
523298
|
}
|
|
523108
523299
|
}, [saveMessage]);
|
|
523109
|
-
const clearSavedMessages = (0,
|
|
523300
|
+
const clearSavedMessages = (0, import_react110.useCallback)(() => {
|
|
523110
523301
|
savedMessagesRef.current.clear();
|
|
523111
523302
|
}, []);
|
|
523112
|
-
const initializeFromSession = (0,
|
|
523303
|
+
const initializeFromSession = (0, import_react110.useCallback)((messages) => {
|
|
523113
523304
|
savedMessagesRef.current.clear();
|
|
523114
523305
|
messages.forEach((message) => {
|
|
523115
523306
|
const messageId = generateMessageId(message, message.timestamp);
|
|
@@ -523123,20 +523314,20 @@ function useSessionSave() {
|
|
|
523123
523314
|
initializeFromSession
|
|
523124
523315
|
};
|
|
523125
523316
|
}
|
|
523126
|
-
var
|
|
523317
|
+
var import_react110;
|
|
523127
523318
|
var init_useSessionSave = __esm({
|
|
523128
523319
|
"dist/hooks/session/useSessionSave.js"() {
|
|
523129
523320
|
"use strict";
|
|
523130
|
-
|
|
523321
|
+
import_react110 = __toESM(require_react(), 1);
|
|
523131
523322
|
init_sessionManager();
|
|
523132
523323
|
}
|
|
523133
523324
|
});
|
|
523134
523325
|
|
|
523135
523326
|
// dist/hooks/conversation/useToolConfirmation.js
|
|
523136
523327
|
function useToolConfirmation() {
|
|
523137
|
-
const [pendingToolConfirmation, setPendingToolConfirmation] = (0,
|
|
523138
|
-
const alwaysApprovedToolsRef = (0,
|
|
523139
|
-
const [alwaysApprovedTools, setAlwaysApprovedTools] = (0,
|
|
523328
|
+
const [pendingToolConfirmation, setPendingToolConfirmation] = (0, import_react111.useState)(null);
|
|
523329
|
+
const alwaysApprovedToolsRef = (0, import_react111.useRef)(/* @__PURE__ */ new Set());
|
|
523330
|
+
const [alwaysApprovedTools, setAlwaysApprovedTools] = (0, import_react111.useState)(/* @__PURE__ */ new Set());
|
|
523140
523331
|
const requestToolConfirmation = async (toolCall, batchToolNames, allTools) => {
|
|
523141
523332
|
return new Promise((resolve10) => {
|
|
523142
523333
|
setPendingToolConfirmation({
|
|
@@ -523150,14 +523341,14 @@ function useToolConfirmation() {
|
|
|
523150
523341
|
});
|
|
523151
523342
|
});
|
|
523152
523343
|
};
|
|
523153
|
-
const isToolAutoApproved = (0,
|
|
523344
|
+
const isToolAutoApproved = (0, import_react111.useCallback)((toolName) => {
|
|
523154
523345
|
return alwaysApprovedToolsRef.current.has(toolName) || toolName.startsWith("todo-") || toolName.startsWith("subagent-");
|
|
523155
523346
|
}, []);
|
|
523156
|
-
const addToAlwaysApproved = (0,
|
|
523347
|
+
const addToAlwaysApproved = (0, import_react111.useCallback)((toolName) => {
|
|
523157
523348
|
alwaysApprovedToolsRef.current.add(toolName);
|
|
523158
523349
|
setAlwaysApprovedTools((prev) => /* @__PURE__ */ new Set([...prev, toolName]));
|
|
523159
523350
|
}, []);
|
|
523160
|
-
const addMultipleToAlwaysApproved = (0,
|
|
523351
|
+
const addMultipleToAlwaysApproved = (0, import_react111.useCallback)((toolNames) => {
|
|
523161
523352
|
toolNames.forEach((name) => alwaysApprovedToolsRef.current.add(name));
|
|
523162
523353
|
setAlwaysApprovedTools((prev) => /* @__PURE__ */ new Set([...prev, ...toolNames]));
|
|
523163
523354
|
}, []);
|
|
@@ -523170,11 +523361,11 @@ function useToolConfirmation() {
|
|
|
523170
523361
|
addMultipleToAlwaysApproved
|
|
523171
523362
|
};
|
|
523172
523363
|
}
|
|
523173
|
-
var
|
|
523364
|
+
var import_react111;
|
|
523174
523365
|
var init_useToolConfirmation = __esm({
|
|
523175
523366
|
"dist/hooks/conversation/useToolConfirmation.js"() {
|
|
523176
523367
|
"use strict";
|
|
523177
|
-
|
|
523368
|
+
import_react111 = __toESM(require_react(), 1);
|
|
523178
523369
|
}
|
|
523179
523370
|
});
|
|
523180
523371
|
|
|
@@ -524272,7 +524463,7 @@ ${compressionResult.summary}`,
|
|
|
524272
524463
|
}
|
|
524273
524464
|
function useCommandHandler(options3) {
|
|
524274
524465
|
const { stdout } = use_stdout_default();
|
|
524275
|
-
const handleCommandExecution = (0,
|
|
524466
|
+
const handleCommandExecution = (0, import_react112.useCallback)(async (commandName, result2) => {
|
|
524276
524467
|
if (commandName === "compact" && result2.success && result2.action === "compact") {
|
|
524277
524468
|
options3.setIsCompressing(true);
|
|
524278
524469
|
options3.setCompressionError(null);
|
|
@@ -524624,12 +524815,12 @@ ${filePath}`,
|
|
|
524624
524815
|
}, [stdout, options3]);
|
|
524625
524816
|
return { handleCommandExecution };
|
|
524626
524817
|
}
|
|
524627
|
-
var
|
|
524818
|
+
var import_react112;
|
|
524628
524819
|
var init_useCommandHandler = __esm({
|
|
524629
524820
|
async "dist/hooks/conversation/useCommandHandler.js"() {
|
|
524630
524821
|
"use strict";
|
|
524631
524822
|
await init_build2();
|
|
524632
|
-
|
|
524823
|
+
import_react112 = __toESM(require_react(), 1);
|
|
524633
524824
|
init_sessionManager();
|
|
524634
524825
|
init_contextCompressor();
|
|
524635
524826
|
init_useGlobalNavigation();
|
|
@@ -526040,12 +526231,12 @@ Original user message: ${userPrompt}`;
|
|
|
526040
526231
|
|
|
526041
526232
|
// dist/hooks/integration/useVSCodeState.js
|
|
526042
526233
|
function useVSCodeState() {
|
|
526043
|
-
const [vscodeConnected, setVscodeConnected] = (0,
|
|
526044
|
-
const [vscodeConnectionStatus, setVscodeConnectionStatus] = (0,
|
|
526045
|
-
const [editorContext, setEditorContext] = (0,
|
|
526046
|
-
const lastStatusRef = (0,
|
|
526047
|
-
const lastEditorContextRef = (0,
|
|
526048
|
-
(0,
|
|
526234
|
+
const [vscodeConnected, setVscodeConnected] = (0, import_react113.useState)(false);
|
|
526235
|
+
const [vscodeConnectionStatus, setVscodeConnectionStatus] = (0, import_react113.useState)("disconnected");
|
|
526236
|
+
const [editorContext, setEditorContext] = (0, import_react113.useState)({});
|
|
526237
|
+
const lastStatusRef = (0, import_react113.useRef)("disconnected");
|
|
526238
|
+
const lastEditorContextRef = (0, import_react113.useRef)({});
|
|
526239
|
+
(0, import_react113.useEffect)(() => {
|
|
526049
526240
|
const checkConnectionInterval = setInterval(() => {
|
|
526050
526241
|
const isConnected = vscodeConnection.isConnected();
|
|
526051
526242
|
setVscodeConnected(isConnected);
|
|
@@ -526074,7 +526265,7 @@ function useVSCodeState() {
|
|
|
526074
526265
|
unsubscribe();
|
|
526075
526266
|
};
|
|
526076
526267
|
}, []);
|
|
526077
|
-
(0,
|
|
526268
|
+
(0, import_react113.useEffect)(() => {
|
|
526078
526269
|
if (vscodeConnectionStatus !== "connecting") {
|
|
526079
526270
|
return;
|
|
526080
526271
|
}
|
|
@@ -526101,20 +526292,20 @@ function useVSCodeState() {
|
|
|
526101
526292
|
editorContext
|
|
526102
526293
|
};
|
|
526103
526294
|
}
|
|
526104
|
-
var
|
|
526295
|
+
var import_react113;
|
|
526105
526296
|
var init_useVSCodeState = __esm({
|
|
526106
526297
|
"dist/hooks/integration/useVSCodeState.js"() {
|
|
526107
526298
|
"use strict";
|
|
526108
|
-
|
|
526299
|
+
import_react113 = __toESM(require_react(), 1);
|
|
526109
526300
|
init_vscodeConnection();
|
|
526110
526301
|
}
|
|
526111
526302
|
});
|
|
526112
526303
|
|
|
526113
526304
|
// dist/hooks/session/useSnapshotState.js
|
|
526114
526305
|
function useSnapshotState(messagesLength) {
|
|
526115
|
-
const [snapshotFileCount, setSnapshotFileCount] = (0,
|
|
526116
|
-
const [pendingRollback, setPendingRollback] = (0,
|
|
526117
|
-
(0,
|
|
526306
|
+
const [snapshotFileCount, setSnapshotFileCount] = (0, import_react114.useState)(/* @__PURE__ */ new Map());
|
|
526307
|
+
const [pendingRollback, setPendingRollback] = (0, import_react114.useState)(null);
|
|
526308
|
+
(0, import_react114.useEffect)(() => {
|
|
526118
526309
|
const loadSnapshotFileCounts = async () => {
|
|
526119
526310
|
const currentSession = sessionManager.getCurrentSession();
|
|
526120
526311
|
if (!currentSession)
|
|
@@ -526135,11 +526326,11 @@ function useSnapshotState(messagesLength) {
|
|
|
526135
526326
|
setPendingRollback
|
|
526136
526327
|
};
|
|
526137
526328
|
}
|
|
526138
|
-
var
|
|
526329
|
+
var import_react114;
|
|
526139
526330
|
var init_useSnapshotState = __esm({
|
|
526140
526331
|
"dist/hooks/session/useSnapshotState.js"() {
|
|
526141
526332
|
"use strict";
|
|
526142
|
-
|
|
526333
|
+
import_react114 = __toESM(require_react(), 1);
|
|
526143
526334
|
init_sessionManager();
|
|
526144
526335
|
init_incrementalSnapshot();
|
|
526145
526336
|
}
|
|
@@ -526147,18 +526338,18 @@ var init_useSnapshotState = __esm({
|
|
|
526147
526338
|
|
|
526148
526339
|
// dist/hooks/conversation/useStreamingState.js
|
|
526149
526340
|
function useStreamingState() {
|
|
526150
|
-
const [isStreaming, setIsStreaming] = (0,
|
|
526151
|
-
const [streamTokenCount, setStreamTokenCount] = (0,
|
|
526152
|
-
const [isReasoning, setIsReasoning] = (0,
|
|
526153
|
-
const [abortController, setAbortController] = (0,
|
|
526154
|
-
const [contextUsage, setContextUsage] = (0,
|
|
526155
|
-
const [elapsedSeconds, setElapsedSeconds] = (0,
|
|
526156
|
-
const [timerStartTime, setTimerStartTime] = (0,
|
|
526157
|
-
const [retryStatus, setRetryStatus] = (0,
|
|
526158
|
-
const [animationFrame, setAnimationFrame] = (0,
|
|
526159
|
-
const [codebaseSearchStatus, setCodebaseSearchStatus] = (0,
|
|
526160
|
-
const [currentModel, setCurrentModel] = (0,
|
|
526161
|
-
(0,
|
|
526341
|
+
const [isStreaming, setIsStreaming] = (0, import_react115.useState)(false);
|
|
526342
|
+
const [streamTokenCount, setStreamTokenCount] = (0, import_react115.useState)(0);
|
|
526343
|
+
const [isReasoning, setIsReasoning] = (0, import_react115.useState)(false);
|
|
526344
|
+
const [abortController, setAbortController] = (0, import_react115.useState)(null);
|
|
526345
|
+
const [contextUsage, setContextUsage] = (0, import_react115.useState)(null);
|
|
526346
|
+
const [elapsedSeconds, setElapsedSeconds] = (0, import_react115.useState)(0);
|
|
526347
|
+
const [timerStartTime, setTimerStartTime] = (0, import_react115.useState)(null);
|
|
526348
|
+
const [retryStatus, setRetryStatus] = (0, import_react115.useState)(null);
|
|
526349
|
+
const [animationFrame, setAnimationFrame] = (0, import_react115.useState)(0);
|
|
526350
|
+
const [codebaseSearchStatus, setCodebaseSearchStatus] = (0, import_react115.useState)(null);
|
|
526351
|
+
const [currentModel, setCurrentModel] = (0, import_react115.useState)(null);
|
|
526352
|
+
(0, import_react115.useEffect)(() => {
|
|
526162
526353
|
if (!isStreaming)
|
|
526163
526354
|
return;
|
|
526164
526355
|
const interval = setInterval(() => {
|
|
@@ -526169,7 +526360,7 @@ function useStreamingState() {
|
|
|
526169
526360
|
setAnimationFrame(0);
|
|
526170
526361
|
};
|
|
526171
526362
|
}, [isStreaming]);
|
|
526172
|
-
(0,
|
|
526363
|
+
(0, import_react115.useEffect)(() => {
|
|
526173
526364
|
if (isStreaming && timerStartTime === null) {
|
|
526174
526365
|
setTimerStartTime(Date.now());
|
|
526175
526366
|
setElapsedSeconds(0);
|
|
@@ -526177,7 +526368,7 @@ function useStreamingState() {
|
|
|
526177
526368
|
setTimerStartTime(null);
|
|
526178
526369
|
}
|
|
526179
526370
|
}, [isStreaming, timerStartTime]);
|
|
526180
|
-
(0,
|
|
526371
|
+
(0, import_react115.useEffect)(() => {
|
|
526181
526372
|
if (timerStartTime === null)
|
|
526182
526373
|
return;
|
|
526183
526374
|
const interval = setInterval(() => {
|
|
@@ -526186,7 +526377,7 @@ function useStreamingState() {
|
|
|
526186
526377
|
}, 1e3);
|
|
526187
526378
|
return () => clearInterval(interval);
|
|
526188
526379
|
}, [timerStartTime]);
|
|
526189
|
-
(0,
|
|
526380
|
+
(0, import_react115.useEffect)(() => {
|
|
526190
526381
|
if (!(retryStatus == null ? void 0 : retryStatus.isRetrying))
|
|
526191
526382
|
return;
|
|
526192
526383
|
if (retryStatus.remainingSeconds !== void 0)
|
|
@@ -526196,7 +526387,7 @@ function useStreamingState() {
|
|
|
526196
526387
|
remainingSeconds: Math.ceil(prev.nextDelay / 1e3)
|
|
526197
526388
|
} : null);
|
|
526198
526389
|
}, [retryStatus == null ? void 0 : retryStatus.isRetrying]);
|
|
526199
|
-
(0,
|
|
526390
|
+
(0, import_react115.useEffect)(() => {
|
|
526200
526391
|
if (!retryStatus || !retryStatus.isRetrying)
|
|
526201
526392
|
return;
|
|
526202
526393
|
if (retryStatus.remainingSeconds === void 0)
|
|
@@ -526241,180 +526432,11 @@ function useStreamingState() {
|
|
|
526241
526432
|
setCurrentModel
|
|
526242
526433
|
};
|
|
526243
526434
|
}
|
|
526244
|
-
var
|
|
526435
|
+
var import_react115;
|
|
526245
526436
|
var init_useStreamingState = __esm({
|
|
526246
526437
|
"dist/hooks/conversation/useStreamingState.js"() {
|
|
526247
|
-
"use strict";
|
|
526248
|
-
import_react114 = __toESM(require_react(), 1);
|
|
526249
|
-
}
|
|
526250
|
-
});
|
|
526251
|
-
|
|
526252
|
-
// dist/hooks/input/useBashMode.js
|
|
526253
|
-
function useBashMode() {
|
|
526254
|
-
const [state, setState] = (0, import_react115.useState)({
|
|
526255
|
-
isExecuting: false,
|
|
526256
|
-
currentCommand: null,
|
|
526257
|
-
currentTimeout: null,
|
|
526258
|
-
executionResults: /* @__PURE__ */ new Map()
|
|
526259
|
-
});
|
|
526260
|
-
const parseBashCommands = (0, import_react115.useCallback)((message) => {
|
|
526261
|
-
var _a21;
|
|
526262
|
-
const commands = [];
|
|
526263
|
-
const regex2 = /!`([^`]+)`(?:<(\d+)>)?/g;
|
|
526264
|
-
let match2;
|
|
526265
|
-
while ((match2 = regex2.exec(message)) !== null) {
|
|
526266
|
-
const command = (_a21 = match2[1]) == null ? void 0 : _a21.trim();
|
|
526267
|
-
const timeoutStr = match2[2];
|
|
526268
|
-
const timeout2 = timeoutStr ? parseInt(timeoutStr, 10) : 3e4;
|
|
526269
|
-
if (command) {
|
|
526270
|
-
commands.push({
|
|
526271
|
-
id: `cmd-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`,
|
|
526272
|
-
command,
|
|
526273
|
-
startIndex: match2.index,
|
|
526274
|
-
endIndex: match2.index + match2[0].length,
|
|
526275
|
-
timeout: timeout2
|
|
526276
|
-
});
|
|
526277
|
-
}
|
|
526278
|
-
}
|
|
526279
|
-
return commands;
|
|
526280
|
-
}, []);
|
|
526281
|
-
const checkSensitiveCommand = (0, import_react115.useCallback)((command) => {
|
|
526282
|
-
return isSensitiveCommand(command);
|
|
526283
|
-
}, []);
|
|
526284
|
-
const executeCommand2 = (0, import_react115.useCallback)(async (command, timeout2 = 3e4) => {
|
|
526285
|
-
setState((prev) => ({
|
|
526286
|
-
...prev,
|
|
526287
|
-
isExecuting: true,
|
|
526288
|
-
currentCommand: command,
|
|
526289
|
-
currentTimeout: timeout2
|
|
526290
|
-
}));
|
|
526291
|
-
return new Promise((resolve10) => {
|
|
526292
|
-
var _a21, _b14;
|
|
526293
|
-
const { spawn: spawn8 } = __require("child_process");
|
|
526294
|
-
const isWindows4 = process.platform === "win32";
|
|
526295
|
-
const shell = isWindows4 ? "cmd" : "sh";
|
|
526296
|
-
const shellArgs = isWindows4 ? ["/c", command] : ["-c", command];
|
|
526297
|
-
const child = spawn8(shell, shellArgs, {
|
|
526298
|
-
cwd: process.cwd(),
|
|
526299
|
-
timeout: timeout2,
|
|
526300
|
-
env: process.env
|
|
526301
|
-
});
|
|
526302
|
-
let stdout = "";
|
|
526303
|
-
let stderr = "";
|
|
526304
|
-
(_a21 = child.stdout) == null ? void 0 : _a21.on("data", (data) => {
|
|
526305
|
-
stdout += data.toString();
|
|
526306
|
-
});
|
|
526307
|
-
(_b14 = child.stderr) == null ? void 0 : _b14.on("data", (data) => {
|
|
526308
|
-
stderr += data.toString();
|
|
526309
|
-
});
|
|
526310
|
-
child.on("close", (code2) => {
|
|
526311
|
-
const result2 = {
|
|
526312
|
-
success: code2 === 0,
|
|
526313
|
-
stdout: stdout.trim(),
|
|
526314
|
-
stderr: stderr.trim(),
|
|
526315
|
-
command
|
|
526316
|
-
};
|
|
526317
|
-
setState((prev) => {
|
|
526318
|
-
const newResults = new Map(prev.executionResults);
|
|
526319
|
-
newResults.set(command, result2);
|
|
526320
|
-
return {
|
|
526321
|
-
...prev,
|
|
526322
|
-
isExecuting: false,
|
|
526323
|
-
currentCommand: null,
|
|
526324
|
-
currentTimeout: null,
|
|
526325
|
-
executionResults: newResults
|
|
526326
|
-
};
|
|
526327
|
-
});
|
|
526328
|
-
resolve10(result2);
|
|
526329
|
-
});
|
|
526330
|
-
child.on("error", (error) => {
|
|
526331
|
-
const result2 = {
|
|
526332
|
-
success: false,
|
|
526333
|
-
stdout: "",
|
|
526334
|
-
stderr: error.message,
|
|
526335
|
-
command
|
|
526336
|
-
};
|
|
526337
|
-
setState((prev) => {
|
|
526338
|
-
const newResults = new Map(prev.executionResults);
|
|
526339
|
-
newResults.set(command, result2);
|
|
526340
|
-
return {
|
|
526341
|
-
...prev,
|
|
526342
|
-
isExecuting: false,
|
|
526343
|
-
currentCommand: null,
|
|
526344
|
-
currentTimeout: null,
|
|
526345
|
-
executionResults: newResults
|
|
526346
|
-
};
|
|
526347
|
-
});
|
|
526348
|
-
resolve10(result2);
|
|
526349
|
-
});
|
|
526350
|
-
});
|
|
526351
|
-
}, []);
|
|
526352
|
-
const processBashMessage = (0, import_react115.useCallback)(async (message, onSensitiveCommand) => {
|
|
526353
|
-
const commands = parseBashCommands(message);
|
|
526354
|
-
if (commands.length === 0) {
|
|
526355
|
-
return {
|
|
526356
|
-
processedMessage: message,
|
|
526357
|
-
hasCommands: false,
|
|
526358
|
-
hasRejectedCommands: false,
|
|
526359
|
-
results: []
|
|
526360
|
-
};
|
|
526361
|
-
}
|
|
526362
|
-
const results = [];
|
|
526363
|
-
let processedMessage = message;
|
|
526364
|
-
let offset = 0;
|
|
526365
|
-
let hasRejectedCommands = false;
|
|
526366
|
-
for (const cmd of commands) {
|
|
526367
|
-
const sensitiveCheck = checkSensitiveCommand(cmd.command);
|
|
526368
|
-
if (sensitiveCheck.isSensitive && onSensitiveCommand) {
|
|
526369
|
-
const shouldContinue = await onSensitiveCommand(cmd.command);
|
|
526370
|
-
if (!shouldContinue) {
|
|
526371
|
-
hasRejectedCommands = true;
|
|
526372
|
-
continue;
|
|
526373
|
-
}
|
|
526374
|
-
}
|
|
526375
|
-
const result2 = await executeCommand2(cmd.command, cmd.timeout || 3e4);
|
|
526376
|
-
results.push(result2);
|
|
526377
|
-
const output2 = result2.success ? result2.stdout || "(no output)" : `Error: ${result2.stderr || "Command failed"}`;
|
|
526378
|
-
const replacement = `
|
|
526379
|
-
--- Command: ${cmd.command} ---
|
|
526380
|
-
${output2}
|
|
526381
|
-
--- End of output ---
|
|
526382
|
-
`;
|
|
526383
|
-
const adjustedStart = cmd.startIndex + offset;
|
|
526384
|
-
const adjustedEnd = cmd.endIndex + offset;
|
|
526385
|
-
processedMessage = processedMessage.slice(0, adjustedStart) + replacement + processedMessage.slice(adjustedEnd);
|
|
526386
|
-
offset += replacement.length - (cmd.endIndex - cmd.startIndex);
|
|
526387
|
-
}
|
|
526388
|
-
return {
|
|
526389
|
-
processedMessage,
|
|
526390
|
-
hasCommands: true,
|
|
526391
|
-
hasRejectedCommands,
|
|
526392
|
-
results
|
|
526393
|
-
};
|
|
526394
|
-
}, [parseBashCommands, checkSensitiveCommand, executeCommand2]);
|
|
526395
|
-
const resetState = (0, import_react115.useCallback)(() => {
|
|
526396
|
-
setState({
|
|
526397
|
-
isExecuting: false,
|
|
526398
|
-
currentCommand: null,
|
|
526399
|
-
currentTimeout: null,
|
|
526400
|
-
executionResults: /* @__PURE__ */ new Map()
|
|
526401
|
-
});
|
|
526402
|
-
}, []);
|
|
526403
|
-
return {
|
|
526404
|
-
state,
|
|
526405
|
-
parseBashCommands,
|
|
526406
|
-
checkSensitiveCommand,
|
|
526407
|
-
executeCommand: executeCommand2,
|
|
526408
|
-
processBashMessage,
|
|
526409
|
-
resetState
|
|
526410
|
-
};
|
|
526411
|
-
}
|
|
526412
|
-
var import_react115;
|
|
526413
|
-
var init_useBashMode = __esm({
|
|
526414
|
-
"dist/hooks/input/useBashMode.js"() {
|
|
526415
526438
|
"use strict";
|
|
526416
526439
|
import_react115 = __toESM(require_react(), 1);
|
|
526417
|
-
init_sensitiveCommandManager();
|
|
526418
526440
|
}
|
|
526419
526441
|
});
|
|
526420
526442
|
|
|
@@ -532940,9 +532962,21 @@ ${errorMsg}`,
|
|
|
532940
532962
|
import_react120.default.createElement(PendingMessages, { pendingMessages })
|
|
532941
532963
|
),
|
|
532942
532964
|
pendingToolConfirmation && import_react120.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 }),
|
|
532943
|
-
bashSensitiveCommand && import_react120.default.createElement(
|
|
532944
|
-
|
|
532945
|
-
|
|
532965
|
+
bashSensitiveCommand && import_react120.default.createElement(
|
|
532966
|
+
Box_default,
|
|
532967
|
+
{ paddingX: 1, width: terminalWidth },
|
|
532968
|
+
import_react120.default.createElement(BashCommandConfirmation, { command: bashSensitiveCommand.command, onConfirm: bashSensitiveCommand.resolve, terminalWidth })
|
|
532969
|
+
),
|
|
532970
|
+
bashMode.state.isExecuting && bashMode.state.currentCommand && import_react120.default.createElement(
|
|
532971
|
+
Box_default,
|
|
532972
|
+
{ paddingX: 1, width: terminalWidth },
|
|
532973
|
+
import_react120.default.createElement(BashCommandExecutionStatus, { command: bashMode.state.currentCommand, timeout: bashMode.state.currentTimeout || 3e4, terminalWidth })
|
|
532974
|
+
),
|
|
532975
|
+
terminalExecutionState.state.isExecuting && terminalExecutionState.state.command && import_react120.default.createElement(
|
|
532976
|
+
Box_default,
|
|
532977
|
+
{ paddingX: 1, width: terminalWidth },
|
|
532978
|
+
import_react120.default.createElement(BashCommandExecutionStatus, { command: terminalExecutionState.state.command, timeout: terminalExecutionState.state.timeout || 3e4, terminalWidth })
|
|
532979
|
+
),
|
|
532946
532980
|
pendingUserQuestion && import_react120.default.createElement(AskUserQuestion, { question: pendingUserQuestion.question, options: pendingUserQuestion.options, onAnswer: handleUserQuestionAnswer }),
|
|
532947
532981
|
showSessionPanel && import_react120.default.createElement(
|
|
532948
532982
|
Box_default,
|