wave-code 0.6.1 → 0.6.2

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.
Files changed (66) hide show
  1. package/dist/components/App.d.ts.map +1 -1
  2. package/dist/components/App.js +14 -12
  3. package/dist/components/ChatInterface.d.ts.map +1 -1
  4. package/dist/components/ChatInterface.js +2 -1
  5. package/dist/components/CommandOutputDisplay.d.ts.map +1 -1
  6. package/dist/components/CommandOutputDisplay.js +6 -17
  7. package/dist/components/CommandSelector.d.ts.map +1 -1
  8. package/dist/components/CommandSelector.js +6 -0
  9. package/dist/components/ConfirmationSelector.d.ts.map +1 -1
  10. package/dist/components/ConfirmationSelector.js +1 -1
  11. package/dist/components/DiffDisplay.d.ts.map +1 -1
  12. package/dist/components/DiffDisplay.js +4 -0
  13. package/dist/components/HelpView.d.ts +6 -0
  14. package/dist/components/HelpView.d.ts.map +1 -0
  15. package/dist/components/HelpView.js +24 -0
  16. package/dist/components/InputBox.d.ts +1 -1
  17. package/dist/components/InputBox.d.ts.map +1 -1
  18. package/dist/components/InputBox.js +10 -3
  19. package/dist/components/LoadingIndicator.js +1 -1
  20. package/dist/components/MessageItem.d.ts +1 -1
  21. package/dist/components/MessageItem.d.ts.map +1 -1
  22. package/dist/components/MessageItem.js +3 -4
  23. package/dist/components/MessageList.d.ts.map +1 -1
  24. package/dist/components/MessageList.js +24 -7
  25. package/dist/components/RewindCommand.js +1 -1
  26. package/dist/components/TaskList.d.ts.map +1 -1
  27. package/dist/components/TaskList.js +4 -13
  28. package/dist/components/ToolDisplay.d.ts +9 -0
  29. package/dist/components/ToolDisplay.d.ts.map +1 -0
  30. package/dist/components/ToolDisplay.js +44 -0
  31. package/dist/contexts/useChat.d.ts.map +1 -1
  32. package/dist/contexts/useChat.js +15 -1
  33. package/dist/hooks/useInputManager.d.ts +2 -2
  34. package/dist/hooks/useInputManager.d.ts.map +1 -1
  35. package/dist/hooks/useInputManager.js +12 -8
  36. package/dist/managers/InputManager.d.ts +4 -2
  37. package/dist/managers/InputManager.d.ts.map +1 -1
  38. package/dist/managers/InputManager.js +17 -17
  39. package/dist/print-cli.d.ts.map +1 -1
  40. package/dist/print-cli.js +11 -30
  41. package/package.json +2 -2
  42. package/src/components/App.tsx +16 -15
  43. package/src/components/ChatInterface.tsx +3 -2
  44. package/src/components/CommandOutputDisplay.tsx +16 -38
  45. package/src/components/CommandSelector.tsx +6 -0
  46. package/src/components/ConfirmationSelector.tsx +5 -9
  47. package/src/components/DiffDisplay.tsx +9 -0
  48. package/src/components/HelpView.tsx +59 -0
  49. package/src/components/InputBox.tsx +43 -33
  50. package/src/components/LoadingIndicator.tsx +1 -1
  51. package/src/components/MessageItem.tsx +12 -21
  52. package/src/components/MessageList.tsx +40 -17
  53. package/src/components/RewindCommand.tsx +1 -1
  54. package/src/components/TaskList.tsx +4 -16
  55. package/src/components/{ToolResultDisplay.tsx → ToolDisplay.tsx} +6 -16
  56. package/src/contexts/useChat.tsx +16 -1
  57. package/src/hooks/useInputManager.ts +12 -10
  58. package/src/managers/InputManager.ts +19 -21
  59. package/src/print-cli.ts +17 -35
  60. package/dist/components/SubagentBlock.d.ts +0 -8
  61. package/dist/components/SubagentBlock.d.ts.map +0 -1
  62. package/dist/components/SubagentBlock.js +0 -73
  63. package/dist/components/ToolResultDisplay.d.ts +0 -9
  64. package/dist/components/ToolResultDisplay.d.ts.map +0 -1
  65. package/dist/components/ToolResultDisplay.js +0 -54
  66. package/src/components/SubagentBlock.tsx +0 -152
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/components/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,UAAU,QAAQ;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AA2DD,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAiBlC,CAAC"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/components/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,UAAU,QAAQ;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AA4DD,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAiBlC,CAAC"}
@@ -13,20 +13,22 @@ const ChatInterfaceWithRemount = () => {
13
13
  const [remountKey, setRemountKey] = useState(String(isExpanded) + rewindId + wasLastDetailsTooTall);
14
14
  const prevSessionId = useRef(sessionId);
15
15
  useEffect(() => {
16
- let newKey = String(isExpanded) + rewindId + wasLastDetailsTooTall;
17
- const isSessionChanged = prevSessionId.current && sessionId && prevSessionId.current !== sessionId;
18
- if (isSessionChanged) {
19
- newKey += sessionId;
20
- }
16
+ const newKey = String(isExpanded) +
17
+ rewindId +
18
+ wasLastDetailsTooTall +
19
+ (prevSessionId.current && sessionId && prevSessionId.current !== sessionId
20
+ ? sessionId
21
+ : "");
21
22
  if (newKey !== remountKey) {
22
- stdout?.write("\u001b[2J\u001b[0;0H", (err) => {
23
- if (err) {
24
- console.error("Failed to clear terminal:", err);
25
- }
26
- setTimeout(() => {
23
+ const timeout = setTimeout(() => {
24
+ stdout?.write("\u001b[2J\u001b[0;0H", (err) => {
25
+ if (err) {
26
+ console.error("Failed to clear terminal:", err);
27
+ }
27
28
  setRemountKey(newKey);
28
- }, 100);
29
- });
29
+ });
30
+ }, 100);
31
+ return () => clearTimeout(timeout);
30
32
  }
31
33
  if (sessionId) {
32
34
  prevSessionId.current = sessionId;
@@ -1 +1 @@
1
- {"version":3,"file":"ChatInterface.d.ts","sourceRoot":"","sources":["../../src/components/ChatInterface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAYrD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAwHjC,CAAC"}
1
+ {"version":3,"file":"ChatInterface.d.ts","sourceRoot":"","sources":["../../src/components/ChatInterface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAYrD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAyHjC,CAAC"}
@@ -42,5 +42,6 @@ export const ChatInterface = () => {
42
42
  if (!sessionId)
43
43
  return null;
44
44
  return (_jsxs(Box, { flexDirection: "column", children: [_jsx(MessageList, { messages: messages, isLoading: isLoading, isCommandRunning: isCommandRunning, isExpanded: isExpanded, forceStaticLastMessage: isDetailsTooTall }), (isLoading || isCommandRunning || isCompressing) &&
45
- !isConfirmationVisible && (_jsx(LoadingIndicator, { isLoading: isLoading, isCommandRunning: isCommandRunning, isCompressing: isCompressing, latestTotalTokens: latestTotalTokens })), !isConfirmationVisible && _jsx(TaskList, {}), isConfirmationVisible && (_jsxs(_Fragment, { children: [_jsx(ConfirmationDetails, { toolName: confirmingTool.name, toolInput: confirmingTool.input, isExpanded: isExpanded, onHeightMeasured: handleHeightMeasured }), _jsx(ConfirmationSelector, { toolName: confirmingTool.name, toolInput: confirmingTool.input, suggestedPrefix: confirmingTool.suggestedPrefix, hidePersistentOption: confirmingTool.hidePersistentOption, isExpanded: isExpanded, onDecision: wrappedHandleConfirmationDecision, onCancel: handleConfirmationCancel, onAbort: abortMessage })] })), !isConfirmationVisible && !isExpanded && (_jsx(InputBox, { isLoading: isLoading, isCommandRunning: isCommandRunning, sendMessage: sendMessage, abortMessage: abortMessage, mcpServers: mcpServers, connectMcpServer: connectMcpServer, disconnectMcpServer: disconnectMcpServer, slashCommands: slashCommands, hasSlashCommand: hasSlashCommand }))] }));
45
+ !isConfirmationVisible &&
46
+ !isExpanded && (_jsx(LoadingIndicator, { isLoading: isLoading, isCommandRunning: isCommandRunning, isCompressing: isCompressing, latestTotalTokens: latestTotalTokens })), !isConfirmationVisible && !isExpanded && _jsx(TaskList, {}), isConfirmationVisible && (_jsxs(_Fragment, { children: [_jsx(ConfirmationDetails, { toolName: confirmingTool.name, toolInput: confirmingTool.input, isExpanded: isExpanded, onHeightMeasured: handleHeightMeasured }), _jsx(ConfirmationSelector, { toolName: confirmingTool.name, toolInput: confirmingTool.input, suggestedPrefix: confirmingTool.suggestedPrefix, hidePersistentOption: confirmingTool.hidePersistentOption, isExpanded: isExpanded, onDecision: wrappedHandleConfirmationDecision, onCancel: handleConfirmationCancel, onAbort: abortMessage })] })), !isConfirmationVisible && !isExpanded && (_jsx(InputBox, { isLoading: isLoading, isCommandRunning: isCommandRunning, sendMessage: sendMessage, abortMessage: abortMessage, mcpServers: mcpServers, connectMcpServer: connectMcpServer, disconnectMcpServer: disconnectMcpServer, slashCommands: slashCommands, hasSlashCommand: hasSlashCommand }))] }));
46
47
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CommandOutputDisplay.d.ts","sourceRoot":"","sources":["../../src/components/CommandOutputDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,UAAU,yBAAyB;IACjC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAuEpE,CAAC"}
1
+ {"version":3,"file":"CommandOutputDisplay.d.ts","sourceRoot":"","sources":["../../src/components/CommandOutputDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,UAAU,yBAAyB;IACjC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAiDpE,CAAC"}
@@ -4,7 +4,7 @@ import { Box, Text } from "ink";
4
4
  export const CommandOutputDisplay = ({ block, isExpanded = false, }) => {
5
5
  const { command, output, isRunning, exitCode } = block;
6
6
  const [isOverflowing, setIsOverflowing] = useState(false);
7
- const MAX_LINES = 10; // Set maximum display lines
7
+ const MAX_LINES = 3; // Set maximum display lines
8
8
  // Detect if content is overflowing
9
9
  useEffect(() => {
10
10
  if (output) {
@@ -21,20 +21,9 @@ export const CommandOutputDisplay = ({ block, isExpanded = false, }) => {
21
21
  return "red";
22
22
  return "gray"; // Unknown state
23
23
  };
24
- const getStatusText = () => {
25
- if (isRunning)
26
- return "🔄";
27
- if (exitCode === 0)
28
- return "✅";
29
- if (exitCode === 130)
30
- return "⚠️"; // SIGINT (Ctrl+C)
31
- if (exitCode !== null && exitCode !== 0)
32
- return "❌";
33
- return ""; // Don't display text for unknown state
34
- };
35
- return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { color: "cyan", children: "$ " }), _jsx(Text, { color: "white", children: command }), _jsxs(Text, { color: getStatusColor(), children: [" ", getStatusText()] })] }), output && (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Box, { paddingLeft: 2, borderLeft: true, borderColor: "gray", flexDirection: "column", height: isExpanded
36
- ? undefined
37
- : Math.min(output.split("\n").length, MAX_LINES), overflow: "hidden", children: _jsx(Text, { color: "gray", children: isOverflowing
38
- ? output.split("\n").slice(-MAX_LINES).join("\n")
39
- : output }) }), isOverflowing && (_jsx(Box, { paddingLeft: 2, marginTop: 1, children: _jsxs(Text, { color: "yellow", dimColor: true, children: ["Content truncated (", output.split("\n").length, " lines total, showing last ", MAX_LINES, " lines)"] }) }))] }))] }));
24
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { color: getStatusColor(), children: "$ " }), _jsx(Text, { color: "white", children: command })] }), output && (_jsx(Box, { paddingLeft: 2, height: isExpanded
25
+ ? undefined
26
+ : Math.min(output.split("\n").length, MAX_LINES), overflow: "hidden", children: _jsx(Text, { color: "gray", children: isOverflowing
27
+ ? output.split("\n").slice(-MAX_LINES).join("\n")
28
+ : output }) }))] }));
40
29
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CommandSelector.d.ts","sourceRoot":"","sources":["../../src/components/CommandSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAwBnD,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA0I1D,CAAC"}
1
+ {"version":3,"file":"CommandSelector.d.ts","sourceRoot":"","sources":["../../src/components/CommandSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AA8BnD,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA0I1D,CAAC"}
@@ -20,6 +20,12 @@ const AVAILABLE_COMMANDS = [
20
20
  description: "Revert conversation and file changes to a previous checkpoint",
21
21
  handler: () => { }, // Handler here won't be used, actual processing is in the hook
22
22
  },
23
+ {
24
+ id: "help",
25
+ name: "help",
26
+ description: "Show help and key bindings",
27
+ handler: () => { }, // Handler here won't be used, actual processing is in the hook
28
+ },
23
29
  ];
24
30
  export const CommandSelector = ({ searchQuery, onSelect, onInsert, onCancel, commands = [], // Default to empty array
25
31
  }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmationSelector.d.ts","sourceRoot":"","sources":["../../src/components/ConfirmationSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,kBAAkB,EAAwB,MAAM,gBAAgB,CAAC;AAgB/E,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACnD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AASD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA4apE,CAAC"}
1
+ {"version":3,"file":"ConfirmationSelector.d.ts","sourceRoot":"","sources":["../../src/components/ConfirmationSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,kBAAkB,EAAwB,MAAM,gBAAgB,CAAC;AAgB/E,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACnD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AASD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAwapE,CAAC"}
@@ -248,7 +248,7 @@ export const ConfirmationSelector = ({ toolName, toolInput, suggestedPrefix, hid
248
248
  const showPlaceholder = state.selectedOption === "alternative" && !state.hasUserInput;
249
249
  return (_jsxs(Box, { flexDirection: "column", children: [toolName === ASK_USER_QUESTION_TOOL_NAME &&
250
250
  currentQuestion &&
251
- !isExpanded && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Box, { backgroundColor: getHeaderColor(currentQuestion.header), paddingX: 1, marginRight: 1, children: _jsx(Text, { color: "black", bold: true, children: currentQuestion.header.slice(0, 12).toUpperCase() }) }), _jsx(Text, { bold: true, children: currentQuestion.question })] }), _jsx(Box, { flexDirection: "column", children: [...currentQuestion.options, { label: "Other" }].map((option, index) => {
251
+ !isExpanded && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: getHeaderColor(currentQuestion.header), bold: true, children: currentQuestion.header.slice(0, 12).toUpperCase() }), _jsx(Box, { marginLeft: 1, children: _jsx(Text, { bold: true, children: currentQuestion.question }) })] }), _jsx(Box, { flexDirection: "column", children: [...currentQuestion.options, { label: "Other" }].map((option, index) => {
252
252
  const isSelected = selectedOptionIndex === index;
253
253
  const isChecked = currentQuestion.multiSelect
254
254
  ? selectedOptionIndices.has(index)
@@ -1 +1 @@
1
- {"version":3,"file":"DiffDisplay.d.ts","sourceRoot":"","sources":["../../src/components/DiffDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAUvC,UAAU,gBAAgB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAySlD,CAAC"}
1
+ {"version":3,"file":"DiffDisplay.d.ts","sourceRoot":"","sources":["../../src/components/DiffDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAUvC,UAAU,gBAAgB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAkTlD,CAAC"}
@@ -62,6 +62,10 @@ export const DiffDisplay = ({ toolName, parameters, }) => {
62
62
  const allElements = [];
63
63
  changes.forEach((change, changeIndex) => {
64
64
  try {
65
+ // Add ellipsis between non-contiguous edits in MultiEdit
66
+ if (toolName === MULTI_EDIT_TOOL_NAME && changeIndex > 0) {
67
+ allElements.push(_jsx(Box, { children: _jsx(Text, { color: "gray", children: "..." }) }, `multi-edit-separator-${changeIndex}`));
68
+ }
65
69
  // Get line-level diff to understand the structure
66
70
  const lineDiffs = diffLines(change.oldContent || "", change.newContent || "");
67
71
  // Process line diffs
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ export interface HelpViewProps {
3
+ onCancel: () => void;
4
+ }
5
+ export declare const HelpView: React.FC<HelpViewProps>;
6
+ //# sourceMappingURL=HelpView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HelpView.d.ts","sourceRoot":"","sources":["../../src/components/HelpView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAmD5C,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text, useInput } from "ink";
3
+ export const HelpView = ({ onCancel }) => {
4
+ useInput((_, key) => {
5
+ if (key.escape || key.return) {
6
+ onCancel();
7
+ }
8
+ });
9
+ const helpItems = [
10
+ { key: "@", description: "Reference files" },
11
+ { key: "/", description: "Commands" },
12
+ { key: "Ctrl+R", description: "Search history" },
13
+ { key: "Ctrl+O", description: "Expand/collapse messages" },
14
+ { key: "Ctrl+T", description: "Toggle task list" },
15
+ { key: "Ctrl+B", description: "Background current task" },
16
+ { key: "Ctrl+V", description: "Paste image" },
17
+ { key: "Shift+Tab", description: "Cycle permission mode" },
18
+ {
19
+ key: "Esc",
20
+ description: "Interrupt AI or command / Cancel selector / Close help",
21
+ },
22
+ ];
23
+ return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", borderLeft: false, borderRight: false, paddingX: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "cyan", bold: true, underline: true, children: "Help & Key Bindings" }) }), helpItems.map((item, index) => (_jsxs(Box, { children: [_jsx(Box, { width: 20, children: _jsx(Text, { color: "yellow", children: item.key }) }), _jsx(Text, { color: "white", children: item.description })] }, index))), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Press Esc or Enter to close" }) })] }));
24
+ };
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import type { McpServerStatus, SlashCommand } from "wave-agent-sdk";
3
- export declare const INPUT_PLACEHOLDER_TEXT = "Type your message (use @ to reference files, / for commands, Ctrl+R to search history, Ctrl+O to expand messages, Ctrl+T to toggle tasks)...";
3
+ export declare const INPUT_PLACEHOLDER_TEXT = "Type your message (use /help for more info)...";
4
4
  export declare const INPUT_PLACEHOLDER_TEXT_PREFIX: string;
5
5
  export interface InputBoxProps {
6
6
  isLoading?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"InputBox.d.ts","sourceRoot":"","sources":["../../src/components/InputBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAYzC,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEpE,eAAO,MAAM,sBAAsB,iJAC6G,CAAC;AAEjJ,eAAO,MAAM,6BAA6B,QAGzC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,CACZ,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,KAC/C,IAAI,CAAC;IACV,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAE1B,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5D,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAE/D,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CAClD;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA8M5C,CAAC"}
1
+ {"version":3,"file":"InputBox.d.ts","sourceRoot":"","sources":["../../src/components/InputBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAazC,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEpE,eAAO,MAAM,sBAAsB,mDACe,CAAC;AAEnD,eAAO,MAAM,6BAA6B,QAGzC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,CACZ,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,KAC/C,IAAI,CAAC;IACV,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAE1B,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5D,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAE/D,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CAClD;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAuN5C,CAAC"}
@@ -8,9 +8,10 @@ import { HistorySearch } from "./HistorySearch.js";
8
8
  import { BackgroundTaskManager } from "./BackgroundTaskManager.js";
9
9
  import { McpManager } from "./McpManager.js";
10
10
  import { RewindCommand } from "./RewindCommand.js";
11
+ import { HelpView } from "./HelpView.js";
11
12
  import { useInputManager } from "../hooks/useInputManager.js";
12
13
  import { useChat } from "../contexts/useChat.js";
13
- export const INPUT_PLACEHOLDER_TEXT = "Type your message (use @ to reference files, / for commands, Ctrl+R to search history, Ctrl+O to expand messages, Ctrl+T to toggle tasks)...";
14
+ export const INPUT_PLACEHOLDER_TEXT = "Type your message (use /help for more info)...";
14
15
  export const INPUT_PLACEHOLDER_TEXT_PREFIX = INPUT_PLACEHOLDER_TEXT.substring(0, 10);
15
16
  export const InputBox = ({ isLoading = false, isCommandRunning = false, sendMessage = () => { }, abortMessage = () => { }, mcpServers = [], connectMcpServer = async () => false, disconnectMcpServer = async () => false, slashCommands = [], hasSlashCommand = () => false, }) => {
16
17
  const { permissionMode: chatPermissionMode, setPermissionMode: setChatPermissionMode, handleRewindSelect, backgroundCurrentTask, messages, getFullMessageThread, } = useChat();
@@ -25,7 +26,7 @@ export const InputBox = ({ isLoading = false, isCommandRunning = false, sendMess
25
26
  // History search
26
27
  showHistorySearch, historySearchQuery,
27
28
  // Task/MCP Manager
28
- showBackgroundTaskManager, showMcpManager, showRewindManager, setShowBackgroundTaskManager, setShowMcpManager, setShowRewindManager,
29
+ showBackgroundTaskManager, showMcpManager, showRewindManager, showHelp, setShowBackgroundTaskManager, setShowMcpManager, setShowRewindManager, setShowHelp,
29
30
  // Permission mode
30
31
  permissionMode, setPermissionMode,
31
32
  // Main handler
@@ -74,5 +75,11 @@ export const InputBox = ({ isLoading = false, isCommandRunning = false, sendMess
74
75
  if (showRewindManager) {
75
76
  return (_jsx(RewindCommand, { messages: messages, onSelect: handleRewindSelectWithClose, onCancel: handleRewindCancel, getFullMessageThread: getFullMessageThread }));
76
77
  }
77
- return (_jsxs(Box, { flexDirection: "column", children: [showFileSelector && (_jsx(FileSelector, { files: filteredFiles, searchQuery: searchQuery, onSelect: handleFileSelect, onCancel: handleCancelFileSelect })), showCommandSelector && (_jsx(CommandSelector, { searchQuery: commandSearchQuery, onSelect: handleCommandSelect, onInsert: handleCommandInsert, onCancel: handleCancelCommandSelect, commands: slashCommands })), showHistorySearch && (_jsx(HistorySearch, { searchQuery: historySearchQuery, onSelect: handleHistorySearchSelect, onCancel: handleCancelHistorySearch })), showBackgroundTaskManager && (_jsx(BackgroundTaskManager, { onCancel: () => setShowBackgroundTaskManager(false) })), showMcpManager && (_jsx(McpManager, { onCancel: () => setShowMcpManager(false), servers: mcpServers, onConnectServer: connectMcpServer, onDisconnectServer: disconnectMcpServer })), showBackgroundTaskManager || showMcpManager || showRewindManager || (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { borderStyle: "single", borderColor: "gray", borderLeft: false, borderRight: false, children: _jsx(Text, { color: isPlaceholder ? "gray" : "white", children: shouldShowCursor ? (_jsxs(_Fragment, { children: [beforeCursor, _jsx(Text, { backgroundColor: "white", color: "black", children: atCursor }), afterCursor] })) : (displayText) }) }), _jsx(Box, { paddingRight: 1, justifyContent: "space-between", width: "100%", children: _jsxs(Text, { color: "gray", children: ["Mode:", " ", _jsx(Text, { color: permissionMode === "plan" ? "yellow" : "cyan", children: permissionMode }), " ", "(Shift+Tab to cycle)"] }) })] }))] }));
78
+ if (showHelp) {
79
+ return _jsx(HelpView, { onCancel: () => setShowHelp(false) });
80
+ }
81
+ return (_jsxs(Box, { flexDirection: "column", children: [showFileSelector && (_jsx(FileSelector, { files: filteredFiles, searchQuery: searchQuery, onSelect: handleFileSelect, onCancel: handleCancelFileSelect })), showCommandSelector && (_jsx(CommandSelector, { searchQuery: commandSearchQuery, onSelect: handleCommandSelect, onInsert: handleCommandInsert, onCancel: handleCancelCommandSelect, commands: slashCommands })), showHistorySearch && (_jsx(HistorySearch, { searchQuery: historySearchQuery, onSelect: handleHistorySearchSelect, onCancel: handleCancelHistorySearch })), showBackgroundTaskManager && (_jsx(BackgroundTaskManager, { onCancel: () => setShowBackgroundTaskManager(false) })), showMcpManager && (_jsx(McpManager, { onCancel: () => setShowMcpManager(false), servers: mcpServers, onConnectServer: connectMcpServer, onDisconnectServer: disconnectMcpServer })), showBackgroundTaskManager ||
82
+ showMcpManager ||
83
+ showRewindManager ||
84
+ showHelp || (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { borderStyle: "single", borderColor: "gray", borderLeft: false, borderRight: false, children: _jsx(Text, { color: isPlaceholder ? "gray" : "white", children: shouldShowCursor ? (_jsxs(_Fragment, { children: [beforeCursor, _jsx(Text, { backgroundColor: "white", color: "black", children: atCursor }), afterCursor] })) : (displayText) }) }), _jsx(Box, { paddingRight: 1, justifyContent: "space-between", width: "100%", children: _jsxs(Text, { color: "gray", children: ["Mode:", " ", _jsx(Text, { color: permissionMode === "plan" ? "yellow" : "cyan", children: permissionMode }), " ", "(Shift+Tab to cycle)"] }) })] }))] }));
78
85
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Box, Text } from "ink";
3
3
  export const LoadingIndicator = ({ isLoading = false, isCommandRunning = false, isCompressing = false, latestTotalTokens = 0, }) => {
4
- return (_jsxs(Box, { flexDirection: "column", children: [isLoading && (_jsxs(Box, { children: [_jsx(Text, { color: "yellow", children: "\uD83D\uDCAD AI is thinking... " }), latestTotalTokens > 0 && (_jsxs(_Fragment, { children: [_jsxs(Text, { color: "gray", dimColor: true, children: ["|", " "] }), _jsx(Text, { color: "blue", bold: true, children: latestTotalTokens.toLocaleString() }), _jsxs(Text, { color: "gray", dimColor: true, children: [" ", "tokens", " "] })] })), _jsxs(Text, { color: "gray", dimColor: true, children: ["|", " "] }), _jsx(Text, { color: "red", bold: true, children: "Esc" }), _jsxs(Text, { color: "gray", dimColor: true, children: [" ", "to abort"] })] })), isCommandRunning && _jsx(Text, { color: "blue", children: "\uD83D\uDE80 Command is running..." }), isCompressing && (_jsx(Text, { color: "magenta", children: "\uD83D\uDDDC\uFE0F Compressing message history..." }))] }));
4
+ return (_jsxs(Box, { flexDirection: "column", children: [isLoading && (_jsxs(Box, { children: [_jsx(Text, { color: "yellow", children: "\u273B AI is thinking... " }), latestTotalTokens > 0 && (_jsxs(_Fragment, { children: [_jsxs(Text, { color: "gray", dimColor: true, children: ["|", " "] }), _jsx(Text, { color: "blue", bold: true, children: latestTotalTokens.toLocaleString() }), _jsxs(Text, { color: "gray", dimColor: true, children: [" ", "tokens", " "] })] })), _jsxs(Text, { color: "gray", dimColor: true, children: ["|", " "] }), _jsx(Text, { color: "red", bold: true, children: "Esc" }), _jsxs(Text, { color: "gray", dimColor: true, children: [" ", "to abort"] })] })), isCommandRunning && _jsx(Text, { color: "blue", children: "\uD83D\uDE80 Command is running..." }), isCompressing && (_jsx(Text, { color: "magenta", children: "\uD83D\uDDDC\uFE0F Compressing message history..." }))] }));
5
5
  };
6
6
  LoadingIndicator.displayName = "LoadingIndicator";
@@ -4,5 +4,5 @@ export interface MessageItemProps {
4
4
  isExpanded: boolean;
5
5
  shouldShowHeader: boolean;
6
6
  }
7
- export declare const MessageItem: ({ message, isExpanded, shouldShowHeader, }: MessageItemProps) => import("react/jsx-runtime").JSX.Element | null;
7
+ export declare const MessageItem: ({ message, isExpanded }: MessageItemProps) => import("react/jsx-runtime").JSX.Element | null;
8
8
  //# sourceMappingURL=MessageItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MessageItem.d.ts","sourceRoot":"","sources":["../../src/components/MessageItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAS9C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,WAAW,GAAI,4CAIzB,gBAAgB,mDAwElB,CAAC"}
1
+ {"version":3,"file":"MessageItem.d.ts","sourceRoot":"","sources":["../../src/components/MessageItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,WAAW,GAAI,yBAAyB,gBAAgB,mDAoEpE,CAAC"}
@@ -2,13 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Text } from "ink";
3
3
  import { MessageSource } from "wave-agent-sdk";
4
4
  import { CommandOutputDisplay } from "./CommandOutputDisplay.js";
5
- import { ToolResultDisplay } from "./ToolResultDisplay.js";
5
+ import { ToolDisplay } from "./ToolDisplay.js";
6
6
  import { CompressDisplay } from "./CompressDisplay.js";
7
- import { SubagentBlock } from "./SubagentBlock.js";
8
7
  import { ReasoningDisplay } from "./ReasoningDisplay.js";
9
8
  import { Markdown } from "./Markdown.js";
10
- export const MessageItem = ({ message, isExpanded, shouldShowHeader, }) => {
9
+ export const MessageItem = ({ message, isExpanded }) => {
11
10
  if (message.blocks.length === 0)
12
11
  return null;
13
- return (_jsxs(Box, { flexDirection: "column", gap: 1, marginTop: 1, children: [shouldShowHeader && (_jsx(Box, { children: _jsx(Text, { color: message.role === "user" ? "cyan" : "green", bold: true, children: message.role === "user" ? "👤 You" : "🤖 Assistant" }) })), _jsx(Box, { flexDirection: "column", gap: 1, children: message.blocks.map((block, blockIndex) => (_jsxs(Box, { children: [block.type === "text" && block.content.trim() && (_jsxs(Box, { children: [block.customCommandContent && (_jsxs(Text, { color: "cyan", bold: true, children: ["\u26A1", " "] })), block.source === MessageSource.HOOK && (_jsxs(Text, { color: "magenta", bold: true, children: ["\uD83D\uDD17", " "] })), _jsx(Markdown, { children: block.content })] })), block.type === "error" && (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["\u274C Error: ", block.content] }) })), block.type === "command_output" && (_jsx(CommandOutputDisplay, { block: block, isExpanded: isExpanded })), block.type === "tool" && (_jsx(ToolResultDisplay, { block: block, isExpanded: isExpanded })), block.type === "image" && (_jsxs(Box, { children: [_jsx(Text, { color: "magenta", bold: true, children: "\uD83D\uDCF7 Image" }), block.imageUrls && block.imageUrls.length > 0 && (_jsxs(Text, { color: "gray", dimColor: true, children: [" ", "(", block.imageUrls.length, ")"] }))] })), block.type === "compress" && (_jsx(CompressDisplay, { block: block, isExpanded: isExpanded })), block.type === "subagent" && _jsx(SubagentBlock, { block: block }), block.type === "reasoning" && _jsx(ReasoningDisplay, { block: block })] }, blockIndex))) })] }));
12
+ return (_jsx(Box, { flexDirection: "column", gap: 1, marginTop: 1, children: _jsx(Box, { flexDirection: "column", gap: 1, children: message.blocks.map((block, blockIndex) => (_jsxs(Box, { children: [block.type === "text" && block.content.trim() && (_jsxs(Box, { children: [block.customCommandContent && (_jsx(Text, { color: "cyan", bold: true, children: "\u26A1" })), block.source === MessageSource.HOOK && (_jsx(Text, { color: "magenta", bold: true, children: "\uD83D\uDD17" })), message.role === "user" ? (_jsx(Text, { backgroundColor: "gray", color: "white", children: block.content })) : (_jsx(Markdown, { children: block.content }))] })), block.type === "error" && (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["\u274C Error: ", block.content] }) })), block.type === "command_output" && (_jsx(CommandOutputDisplay, { block: block, isExpanded: isExpanded })), block.type === "tool" && (_jsx(ToolDisplay, { block: block, isExpanded: isExpanded })), block.type === "image" && (_jsxs(Box, { children: [_jsx(Text, { color: "magenta", bold: true, children: "\uD83D\uDCF7 Image" }), block.imageUrls && block.imageUrls.length > 0 && (_jsxs(Text, { color: "gray", dimColor: true, children: [" ", "(", block.imageUrls.length, ")"] }))] })), block.type === "compress" && (_jsx(CompressDisplay, { block: block, isExpanded: isExpanded })), block.type === "reasoning" && _jsx(ReasoningDisplay, { block: block })] }, blockIndex))) }) }));
14
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,eAAO,MAAM,WAAW,6GAOnB,gBAAgB,6CAiFpB,CAAC"}
1
+ {"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAS9C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,eAAO,MAAM,WAAW,6GAOnB,gBAAgB,6CAkGpB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { Box, Text, Static } from "ink";
4
+ import { TASK_CREATE_TOOL_NAME, TASK_GET_TOOL_NAME, TASK_UPDATE_TOOL_NAME, TASK_LIST_TOOL_NAME, } from "wave-agent-sdk";
4
5
  import { MessageItem } from "./MessageItem.js";
5
6
  export const MessageList = React.memo(({ messages, isLoading = false, isCommandRunning = false, isExpanded = false, forceStaticLastMessage = false, }) => {
6
7
  // Empty message state
@@ -10,21 +11,37 @@ export const MessageList = React.memo(({ messages, isLoading = false, isCommandR
10
11
  // Limit messages when expanded to prevent long rendering times
11
12
  const maxExpandedMessages = 20;
12
13
  const shouldLimitMessages = isExpanded && messages.length > maxExpandedMessages;
14
+ // Filter out task management tools and empty messages
15
+ const taskMgmtTools = [
16
+ TASK_CREATE_TOOL_NAME,
17
+ TASK_GET_TOOL_NAME,
18
+ TASK_UPDATE_TOOL_NAME,
19
+ TASK_LIST_TOOL_NAME,
20
+ ];
21
+ const filteredMessages = messages
22
+ .map((message) => ({
23
+ ...message,
24
+ blocks: message.blocks.filter((block) => !(block.type === "tool" &&
25
+ typeof block.name === "string" &&
26
+ taskMgmtTools.includes(block.name))),
27
+ }))
28
+ .filter((message) => message.blocks.length > 0);
13
29
  const displayMessages = shouldLimitMessages
14
- ? messages.slice(-maxExpandedMessages)
15
- : messages;
16
- const omittedCount = shouldLimitMessages
17
- ? messages.length - maxExpandedMessages
18
- : 0;
30
+ ? filteredMessages.slice(-maxExpandedMessages)
31
+ : filteredMessages;
19
32
  // Compute which messages to render statically vs dynamically
20
- const shouldRenderLastDynamic = !forceStaticLastMessage && (isLoading || isCommandRunning);
33
+ const lastMessage = displayMessages[displayMessages.length - 1];
34
+ const hasNonEndTool = lastMessage?.blocks.some((block) => block.type === "tool" && block.stage !== "end");
35
+ const hasRunningCommand = lastMessage?.blocks.some((block) => block.type === "command_output" && block.isRunning);
36
+ const shouldRenderLastDynamic = !forceStaticLastMessage &&
37
+ (isLoading || isCommandRunning || hasNonEndTool || hasRunningCommand);
21
38
  const staticMessages = shouldRenderLastDynamic
22
39
  ? displayMessages.slice(0, -1)
23
40
  : displayMessages;
24
41
  const dynamicMessages = shouldRenderLastDynamic && displayMessages.length > 0
25
42
  ? [displayMessages[displayMessages.length - 1]]
26
43
  : [];
27
- return (_jsxs(Box, { flexDirection: "column", gap: 1, paddingBottom: 1, children: [omittedCount > 0 && (_jsx(Box, { children: _jsxs(Text, { color: "gray", dimColor: true, children: ["... ", omittedCount, " earlier message", omittedCount !== 1 ? "s" : "", " ", "omitted (showing latest ", maxExpandedMessages, ")"] }) })), _jsx(Static, { items: staticMessages, children: (message, key) => {
44
+ return (_jsxs(Box, { flexDirection: "column", paddingBottom: 1, children: [_jsx(Static, { items: staticMessages, children: (message, key) => {
28
45
  // Get previous message
29
46
  const previousMessage = key > 0 ? staticMessages[key - 1] : undefined;
30
47
  return (_jsx(MessageItem, { message: message, shouldShowHeader: previousMessage?.role !== message.role, isExpanded: isExpanded }, key));
@@ -55,5 +55,5 @@ export const RewindCommand = ({ messages: initialMessages, onSelect, onCancel, g
55
55
  .join(" ")
56
56
  .substring(0, 60);
57
57
  return (_jsx(Box, { children: _jsxs(Text, { color: isSelected ? "black" : "white", backgroundColor: isSelected ? "cyan" : undefined, children: [isSelected ? "▶ " : " ", "[", checkpoint.index, "]", " ", content || "(No text content)", index === checkpoints.length - 1 ? " (Latest)" : ""] }) }, checkpoint.index));
58
- }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "\u2191\u2193 navigate \u2022 Enter to rewind \u2022 Esc to cancel" }) }), _jsx(Box, { children: _jsx(Text, { color: "red", dimColor: true, children: "\u26A0\uFE0F Warning: This will delete all subsequent messages and revert file changes." }) })] }));
58
+ }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "\u2191\u2193 navigate \u2022 Enter to rewind \u2022 Esc to cancel" }) }), _jsx(Box, { children: _jsx(Text, { color: "red", dimColor: true, children: "\u26A0\uFE0F Warning: This will delete all subsequent messages and revert file and task list changes." }) })] }));
59
59
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TaskList.d.ts","sourceRoot":"","sources":["../../src/components/TaskList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAgE5B,CAAC"}
1
+ {"version":3,"file":"TaskList.d.ts","sourceRoot":"","sources":["../../src/components/TaskList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAoD5B,CAAC"}
@@ -1,13 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useChat } from "../contexts/useChat.js";
3
- import { Box, Text, useStdout } from "ink";
3
+ import { Box, Text } from "ink";
4
4
  import { useTasks } from "../hooks/useTasks.js";
5
5
  export const TaskList = () => {
6
6
  const tasks = useTasks();
7
7
  const { isTaskListVisible } = useChat();
8
- const { stdout } = useStdout();
9
- const terminalWidth = stdout?.columns ?? 80;
10
- const maxSubjectWidth = Math.max(20, terminalWidth - 10);
11
8
  if (tasks.length === 0 || !isTaskListVisible) {
12
9
  return null;
13
10
  }
@@ -17,9 +14,9 @@ export const TaskList = () => {
17
14
  }
18
15
  switch (status) {
19
16
  case "pending":
20
- return _jsx(Text, { color: "gray", children: "\u25CB" });
17
+ return _jsx(Text, { color: "gray", children: "\u25A1" });
21
18
  case "in_progress":
22
- return _jsx(Text, { color: "yellow", children: "\u25CF" });
19
+ return _jsx(Text, { color: "yellow", children: "\u25A0" });
23
20
  case "completed":
24
21
  return _jsx(Text, { color: "green", children: "\u2713" });
25
22
  case "deleted":
@@ -28,12 +25,6 @@ export const TaskList = () => {
28
25
  return _jsx(Text, { color: "gray", children: "?" });
29
26
  }
30
27
  };
31
- const truncate = (text, maxWidth) => {
32
- if (text.length <= maxWidth) {
33
- return text;
34
- }
35
- return text.slice(0, maxWidth - 3) + "...";
36
- };
37
28
  return (_jsx(Box, { flexDirection: "column", children: tasks.map((task) => {
38
29
  const isDimmed = task.status === "completed" || task.status === "deleted";
39
30
  const isBlocked = task.blockedBy && task.blockedBy.length > 0;
@@ -44,6 +35,6 @@ export const TaskList = () => {
44
35
  ? ` (Blocked by: ${blockingTaskIds.join(", ")})`
45
36
  : "";
46
37
  const fullText = `${task.subject}${blockedByText}`;
47
- return (_jsxs(Box, { gap: 1, children: [getStatusIcon(task.status, isBlocked), _jsx(Text, { dimColor: isDimmed, children: truncate(fullText, maxSubjectWidth) })] }, task.id));
38
+ return (_jsxs(Box, { gap: 1, children: [getStatusIcon(task.status, isBlocked), _jsx(Text, { dimColor: isDimmed, children: fullText })] }, task.id));
48
39
  }) }));
49
40
  };
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import type { ToolBlock } from "wave-agent-sdk";
3
+ interface ToolDisplayProps {
4
+ block: ToolBlock;
5
+ isExpanded?: boolean;
6
+ }
7
+ export declare const ToolDisplay: React.FC<ToolDisplayProps>;
8
+ export {};
9
+ //# sourceMappingURL=ToolDisplay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolDisplay.d.ts","sourceRoot":"","sources":["../../src/components/ToolDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,UAAU,gBAAgB;IACxB,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA+HlD,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ import { DiffDisplay } from "./DiffDisplay.js";
4
+ export const ToolDisplay = ({ block, isExpanded = false, }) => {
5
+ const { parameters, result, compactParams, stage, success, error, name } = block;
6
+ // Directly use compactParams
7
+ // (no change needed as we destructured it above)
8
+ const getStatusColor = () => {
9
+ if (stage === "running")
10
+ return "yellow";
11
+ if (success)
12
+ return "green";
13
+ if (error || success === false)
14
+ return "red";
15
+ return "gray"; // Unknown state or no state information
16
+ };
17
+ const hasImages = () => {
18
+ return block.images && block.images.length > 0;
19
+ };
20
+ const getImageIndicator = () => {
21
+ if (!hasImages())
22
+ return "";
23
+ const imageCount = block.images.length;
24
+ return imageCount === 1 ? "🖼️" : `🖼️×${imageCount}`;
25
+ };
26
+ const toolName = name ? String(name) : "Tool";
27
+ // Get shortResult, if not available show last 5 lines of result
28
+ const getShortResult = () => {
29
+ if (block.shortResult) {
30
+ return block.shortResult;
31
+ }
32
+ // If no shortResult but has result, return last 5 lines
33
+ if (block.result) {
34
+ const lines = block.result.split("\n");
35
+ if (lines.length > 5) {
36
+ return lines.slice(-5).join("\n");
37
+ }
38
+ return block.result;
39
+ }
40
+ return null;
41
+ };
42
+ const shortResult = getShortResult();
43
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsxs(Box, { flexShrink: 0, children: [_jsx(Text, { color: getStatusColor(), children: "\u25CF " }), _jsx(Text, { color: "white", children: toolName })] }), !isExpanded && compactParams && (_jsxs(Text, { color: "gray", children: [" ", compactParams] })), hasImages() && _jsxs(Text, { color: "blue", children: [" ", getImageIndicator()] })] }), !isExpanded && shortResult && !error && (_jsx(Box, { paddingLeft: 2, borderLeft: true, borderColor: "gray", flexDirection: "column", children: shortResult.split("\n").map((line, index) => (_jsx(Text, { color: "gray", children: line }, index))) })), isExpanded && parameters && (_jsxs(Box, { paddingLeft: 2, borderLeft: true, borderColor: "gray", flexDirection: "column", children: [_jsx(Text, { color: "cyan", bold: true, children: "Parameters:" }), _jsx(Text, { color: "gray", children: parameters })] })), isExpanded && result && (_jsx(Box, { flexDirection: "column", children: _jsxs(Box, { paddingLeft: 2, borderLeft: true, borderColor: "green", flexDirection: "column", children: [_jsx(Text, { color: "cyan", bold: true, children: "Result:" }), _jsx(Text, { color: "white", children: result })] }) })), error && (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["Error: ", typeof error === "string" ? error : String(error)] }) })), stage === "end" && success && (_jsx(DiffDisplay, { toolName: name, parameters: parameters }))] }));
44
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"useChat.d.ts","sourceRoot":"","sources":["../../src/contexts/useChat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAGf,OAAO,KAA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,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACnE,wBAAwB,EAAE,MAAM,IAAI,CAAC;IAErC,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAElC,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,oBAAoB,EAAE,MAAM,OAAO,CAAC;QAClC,QAAQ,EAAE,OAAO,EAAE,CAAC;QACpB,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,CAAC,CAAC;IACH,qBAAqB,EAAE,MAAM,CAAC;IAC9B,wBAAwB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;CACxE;AAID,eAAO,MAAM,OAAO,uBAMnB,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA8dpD,CAAC"}
@@ -17,6 +17,11 @@ export const ChatProvider = ({ children, bypassPermissions, pluginDirs, }) => {
17
17
  const { restoreSessionId, continueLastSession } = useAppConfig();
18
18
  // Message Display State
19
19
  const [isExpanded, setIsExpanded] = useState(false);
20
+ const isExpandedRef = useRef(isExpanded);
21
+ const frozenMessagesRef = useRef(null);
22
+ useEffect(() => {
23
+ isExpandedRef.current = isExpanded;
24
+ }, [isExpanded]);
20
25
  const [isTaskListVisible, setIsTaskListVisible] = useState(true);
21
26
  // AI State
22
27
  const [messages, setMessages] = useState([]);
@@ -68,7 +73,12 @@ export const ChatProvider = ({ children, bypassPermissions, pluginDirs, }) => {
68
73
  const initializeAgent = async () => {
69
74
  const callbacks = {
70
75
  onMessagesChange: (newMessages) => {
71
- setMessages([...newMessages]);
76
+ if (isExpandedRef.current) {
77
+ frozenMessagesRef.current = [...newMessages];
78
+ }
79
+ else {
80
+ setMessages([...newMessages]);
81
+ }
72
82
  },
73
83
  onServersChange: (servers) => {
74
84
  setMcpServers([...servers]);
@@ -323,6 +333,10 @@ export const ChatProvider = ({ children, bypassPermissions, pluginDirs, }) => {
323
333
  // Clear terminal screen when expanded state changes
324
334
  setIsExpanded((prev) => {
325
335
  const newExpanded = !prev;
336
+ if (!newExpanded && frozenMessagesRef.current) {
337
+ setMessages(frozenMessagesRef.current);
338
+ frozenMessagesRef.current = null;
339
+ }
326
340
  return newExpanded;
327
341
  });
328
342
  }
@@ -17,6 +17,7 @@ export declare const useInputManager: (callbacks?: Partial<InputManagerCallbacks
17
17
  showBackgroundTaskManager: boolean;
18
18
  showMcpManager: boolean;
19
19
  showRewindManager: boolean;
20
+ showHelp: boolean;
20
21
  permissionMode: PermissionMode;
21
22
  attachedImages: AttachedImage[];
22
23
  isManagerReady: boolean;
@@ -25,8 +26,6 @@ export declare const useInputManager: (callbacks?: Partial<InputManagerCallbacks
25
26
  clearInput: () => void;
26
27
  moveCursorLeft: () => void;
27
28
  moveCursorRight: () => void;
28
- moveCursorToStart: () => void;
29
- moveCursorToEnd: () => void;
30
29
  activateFileSelector: (position: number) => void;
31
30
  handleFileSelect: (filePath: string) => {
32
31
  newInput: string;
@@ -53,6 +52,7 @@ export declare const useInputManager: (callbacks?: Partial<InputManagerCallbacks
53
52
  setShowBackgroundTaskManager: (show: boolean) => void;
54
53
  setShowMcpManager: (show: boolean) => void;
55
54
  setShowRewindManager: (show: boolean) => void;
55
+ setShowHelp: (show: boolean) => void;
56
56
  setPermissionMode: (mode: PermissionMode) => void;
57
57
  addImage: (imagePath: string, mimeType: string) => AttachedImage | undefined;
58
58
  removeImage: (imageId: number) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useInputManager.d.ts","sourceRoot":"","sources":["../../src/hooks/useInputManager.ts"],"names":[],"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