wave-code 0.5.0 → 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 (112) hide show
  1. package/dist/components/App.d.ts.map +1 -1
  2. package/dist/components/App.js +40 -2
  3. package/dist/components/BackgroundTaskManager.d.ts +6 -0
  4. package/dist/components/BackgroundTaskManager.d.ts.map +1 -0
  5. package/dist/components/{TaskManager.js → BackgroundTaskManager.js} +1 -1
  6. package/dist/components/ChatInterface.d.ts.map +1 -1
  7. package/dist/components/ChatInterface.js +40 -5
  8. package/dist/components/CommandOutputDisplay.d.ts.map +1 -1
  9. package/dist/components/CommandOutputDisplay.js +6 -17
  10. package/dist/components/CommandSelector.d.ts.map +1 -1
  11. package/dist/components/CommandSelector.js +16 -2
  12. package/dist/components/CompressDisplay.d.ts.map +1 -1
  13. package/dist/components/CompressDisplay.js +6 -10
  14. package/dist/components/ConfirmationDetails.d.ts +9 -0
  15. package/dist/components/ConfirmationDetails.d.ts.map +1 -0
  16. package/dist/components/ConfirmationDetails.js +53 -0
  17. package/dist/components/{Confirmation.d.ts → ConfirmationSelector.d.ts} +3 -3
  18. package/dist/components/ConfirmationSelector.d.ts.map +1 -0
  19. package/dist/components/{Confirmation.js → ConfirmationSelector.js} +34 -96
  20. package/dist/components/DiffDisplay.d.ts.map +1 -1
  21. package/dist/components/DiffDisplay.js +48 -1
  22. package/dist/components/FileSelector.d.ts.map +1 -1
  23. package/dist/components/FileSelector.js +2 -2
  24. package/dist/components/HelpView.d.ts +6 -0
  25. package/dist/components/HelpView.d.ts.map +1 -0
  26. package/dist/components/HelpView.js +24 -0
  27. package/dist/components/HistorySearch.d.ts.map +1 -1
  28. package/dist/components/HistorySearch.js +12 -4
  29. package/dist/components/InputBox.d.ts +1 -3
  30. package/dist/components/InputBox.d.ts.map +1 -1
  31. package/dist/components/InputBox.js +14 -17
  32. package/dist/components/LoadingIndicator.d.ts +11 -0
  33. package/dist/components/LoadingIndicator.d.ts.map +1 -0
  34. package/dist/components/LoadingIndicator.js +6 -0
  35. package/dist/components/Markdown.d.ts.map +1 -1
  36. package/dist/components/Markdown.js +114 -121
  37. package/dist/components/MessageItem.d.ts +1 -1
  38. package/dist/components/MessageItem.d.ts.map +1 -1
  39. package/dist/components/MessageItem.js +3 -5
  40. package/dist/components/MessageList.d.ts +2 -3
  41. package/dist/components/MessageList.d.ts.map +1 -1
  42. package/dist/components/MessageList.js +29 -12
  43. package/dist/components/PlanDisplay.d.ts.map +1 -1
  44. package/dist/components/PlanDisplay.js +4 -12
  45. package/dist/components/RewindCommand.d.ts +4 -0
  46. package/dist/components/RewindCommand.d.ts.map +1 -1
  47. package/dist/components/RewindCommand.js +20 -3
  48. package/dist/components/TaskList.d.ts +3 -0
  49. package/dist/components/TaskList.d.ts.map +1 -0
  50. package/dist/components/TaskList.js +40 -0
  51. package/dist/components/ToolDisplay.d.ts +9 -0
  52. package/dist/components/ToolDisplay.d.ts.map +1 -0
  53. package/dist/components/ToolDisplay.js +44 -0
  54. package/dist/contexts/useChat.d.ts +11 -3
  55. package/dist/contexts/useChat.d.ts.map +1 -1
  56. package/dist/contexts/useChat.js +51 -32
  57. package/dist/hooks/useInputManager.d.ts +4 -15
  58. package/dist/hooks/useInputManager.d.ts.map +1 -1
  59. package/dist/hooks/useInputManager.js +20 -65
  60. package/dist/hooks/useTasks.d.ts +2 -0
  61. package/dist/hooks/useTasks.d.ts.map +1 -0
  62. package/dist/hooks/useTasks.js +5 -0
  63. package/dist/managers/InputManager.d.ts +8 -30
  64. package/dist/managers/InputManager.d.ts.map +1 -1
  65. package/dist/managers/InputManager.js +38 -144
  66. package/dist/print-cli.d.ts.map +1 -1
  67. package/dist/print-cli.js +11 -30
  68. package/package.json +5 -6
  69. package/src/components/App.tsx +51 -3
  70. package/src/components/{TaskManager.tsx → BackgroundTaskManager.tsx} +4 -2
  71. package/src/components/ChatInterface.tsx +80 -23
  72. package/src/components/CommandOutputDisplay.tsx +16 -38
  73. package/src/components/CommandSelector.tsx +41 -17
  74. package/src/components/CompressDisplay.tsx +5 -22
  75. package/src/components/ConfirmationDetails.tsx +108 -0
  76. package/src/components/{Confirmation.tsx → ConfirmationSelector.tsx} +74 -193
  77. package/src/components/DiffDisplay.tsx +71 -1
  78. package/src/components/FileSelector.tsx +0 -2
  79. package/src/components/HelpView.tsx +59 -0
  80. package/src/components/HistorySearch.tsx +45 -21
  81. package/src/components/InputBox.tsx +51 -63
  82. package/src/components/LoadingIndicator.tsx +56 -0
  83. package/src/components/Markdown.tsx +126 -323
  84. package/src/components/MessageItem.tsx +13 -24
  85. package/src/components/MessageList.tsx +48 -82
  86. package/src/components/PlanDisplay.tsx +4 -27
  87. package/src/components/RewindCommand.tsx +39 -2
  88. package/src/components/TaskList.tsx +58 -0
  89. package/src/components/{ToolResultDisplay.tsx → ToolDisplay.tsx} +8 -18
  90. package/src/contexts/useChat.tsx +73 -41
  91. package/src/hooks/useInputManager.ts +21 -83
  92. package/src/hooks/useTasks.ts +6 -0
  93. package/src/managers/InputManager.ts +43 -179
  94. package/src/print-cli.ts +17 -35
  95. package/dist/components/Confirmation.d.ts.map +0 -1
  96. package/dist/components/MemoryDisplay.d.ts +0 -8
  97. package/dist/components/MemoryDisplay.d.ts.map +0 -1
  98. package/dist/components/MemoryDisplay.js +0 -25
  99. package/dist/components/MemoryTypeSelector.d.ts +0 -8
  100. package/dist/components/MemoryTypeSelector.d.ts.map +0 -1
  101. package/dist/components/MemoryTypeSelector.js +0 -38
  102. package/dist/components/SubagentBlock.d.ts +0 -8
  103. package/dist/components/SubagentBlock.d.ts.map +0 -1
  104. package/dist/components/SubagentBlock.js +0 -70
  105. package/dist/components/TaskManager.d.ts +0 -6
  106. package/dist/components/TaskManager.d.ts.map +0 -1
  107. package/dist/components/ToolResultDisplay.d.ts +0 -9
  108. package/dist/components/ToolResultDisplay.d.ts.map +0 -1
  109. package/dist/components/ToolResultDisplay.js +0 -54
  110. package/src/components/MemoryDisplay.tsx +0 -62
  111. package/src/components/MemoryTypeSelector.tsx +0 -98
  112. package/src/components/SubagentBlock.tsx +0 -143
@@ -1,7 +1,7 @@
1
1
  import React, { useMemo } from "react";
2
- import { Box, Text, useStdout } from "ink";
3
- import { marked, type Token, type Tokens } from "marked";
4
- import { highlight } from "cli-highlight";
2
+ import { Box, Text } from "ink";
3
+ import { Renderer, marked, type Tokens } from "marked";
4
+ import chalk from "chalk";
5
5
 
6
6
  export interface MarkdownProps {
7
7
  children: string;
@@ -17,339 +17,142 @@ const unescapeHtml = (html: string) => {
17
17
  .replace(/'/g, "'");
18
18
  };
19
19
 
20
- const InlineRenderer = ({ tokens }: { tokens: Token[] }) => {
21
- return (
22
- <>
23
- {tokens.map((token, index) => {
24
- switch (token.type) {
25
- case "text": {
26
- const t = token as Tokens.Text;
27
- if (t.tokens) {
28
- return <InlineRenderer key={index} tokens={t.tokens} />;
29
- }
30
- return <Text key={index}>{unescapeHtml(t.text)}</Text>;
31
- }
32
- case "strong":
33
- return (
34
- <Text key={index} bold>
35
- {token.tokens ? (
36
- <InlineRenderer tokens={token.tokens} />
37
- ) : (
38
- unescapeHtml((token as Tokens.Strong).text)
39
- )}
40
- </Text>
41
- );
42
- case "em":
43
- return (
44
- <Text key={index} italic>
45
- {token.tokens ? (
46
- <InlineRenderer tokens={token.tokens} />
47
- ) : (
48
- unescapeHtml((token as Tokens.Em).text)
49
- )}
50
- </Text>
51
- );
52
- case "codespan":
53
- return (
54
- <Text key={index} color="yellow">
55
- {unescapeHtml((token as Tokens.Codespan).text)}
56
- </Text>
57
- );
58
- case "link": {
59
- const t = token as Tokens.Link;
60
- return (
61
- <Text key={index}>
62
- <Text color="blue" underline>
63
- {t.tokens ? (
64
- <InlineRenderer tokens={t.tokens} />
65
- ) : (
66
- unescapeHtml(t.text)
67
- )}
68
- </Text>
69
- <Text color="gray"> ({t.href})</Text>
70
- </Text>
71
- );
72
- }
73
- case "br":
74
- return <Text key={index}>{"\n"}</Text>;
75
- case "del":
76
- return (
77
- <Text key={index} strikethrough>
78
- {token.tokens ? (
79
- <InlineRenderer tokens={token.tokens} />
80
- ) : (
81
- unescapeHtml((token as Tokens.Del).text)
82
- )}
83
- </Text>
84
- );
85
- default:
86
- return <Text key={index}>{token.raw}</Text>;
87
- }
88
- })}
89
- </>
90
- );
91
- };
92
-
93
- const TableRenderer = ({ token }: { token: Tokens.Table }) => {
94
- const { stdout } = useStdout();
95
- const terminalWidth = (stdout?.columns || 80) - 2;
20
+ class AnsiRenderer extends Renderer<string> {
21
+ override code({ text, lang }: Tokens.Code): string {
22
+ const prefix = lang ? `\`\`\`${lang}` : "```";
23
+ const suffix = "```";
24
+ return `\n${chalk.gray(prefix)}\n${text}\n${chalk.gray(suffix)}\n`;
25
+ }
96
26
 
97
- const columnWidths = useMemo(() => {
98
- const numCols = token.header.length;
99
- const minWidth = 5;
100
- const maxColWidth = 40;
101
- const widths = token.header.map((h) =>
102
- Math.min(maxColWidth, Math.max(minWidth, h.text.length)),
27
+ override blockquote({ tokens }: Tokens.Blockquote): string {
28
+ const body = this.parser.parse(tokens);
29
+ return (
30
+ "\n" +
31
+ body
32
+ .trim()
33
+ .split("\n")
34
+ .map((line) => chalk.gray("> ") + line)
35
+ .join("\n") +
36
+ "\n"
103
37
  );
38
+ }
104
39
 
105
- token.rows.forEach((row) => {
106
- row.forEach((cell, i) => {
107
- widths[i] = Math.min(
108
- maxColWidth,
109
- Math.max(widths[i] || minWidth, cell.text.length),
110
- );
111
- });
112
- });
40
+ override heading({ tokens, depth }: Tokens.Heading): string {
41
+ const text = this.parser.parseInline(tokens);
42
+ const hashes = "#".repeat(depth);
43
+ return `\n${chalk.cyan(`${hashes} ${text}`)}\n`;
44
+ }
113
45
 
114
- const paddedWidths = widths.map((w) => w + 2);
115
- const totalWidth = paddedWidths.reduce((a, b) => a + b, 0) + numCols + 1;
46
+ override hr(): string {
47
+ return `\n${chalk.gray("─".repeat(20))}\n`;
48
+ }
116
49
 
117
- if (totalWidth <= terminalWidth) {
118
- return paddedWidths;
119
- }
50
+ override list(token: Tokens.List): string {
51
+ const body = token.items
52
+ .map((item, i) => {
53
+ const text = this.listitem(item);
54
+ const prefix = token.ordered
55
+ ? chalk.gray(`${(token.start || 1) + i}. `)
56
+ : chalk.gray("• ");
57
+ const lines = text.split("\n");
58
+ const firstLine = prefix + lines[0];
59
+ const restLines = lines
60
+ .slice(1)
61
+ .filter((line) => line.length > 0)
62
+ .map((line) => " " + line);
63
+ return [firstLine, ...restLines].join("\n") + "\n";
64
+ })
65
+ .join("");
66
+ return `\n${body}`;
67
+ }
120
68
 
121
- // If table is too wide, scale down columns proportionally
122
- const availableWidth = terminalWidth - numCols - 1;
123
- const scaleFactor = availableWidth / (totalWidth - numCols - 1);
124
- return paddedWidths.map((w) =>
125
- Math.max(minWidth, Math.floor(w * scaleFactor)),
126
- );
127
- }, [token, terminalWidth]);
69
+ override listitem(item: Tokens.ListItem): string {
70
+ return `${this.parser.parse(item.tokens).trim()}\n`;
71
+ }
128
72
 
129
- return (
130
- <Box
131
- flexDirection="column"
132
- marginBottom={1}
133
- borderStyle="single"
134
- borderColor="gray"
135
- width={columnWidths.reduce((a, b) => a + b, 0) + token.header.length + 1}
136
- >
137
- {/* Header */}
138
- <Box
139
- flexDirection="row"
140
- borderStyle="single"
141
- borderBottom
142
- borderTop={false}
143
- borderLeft={false}
144
- borderRight={false}
145
- borderColor="gray"
146
- >
147
- {token.header.map((cell, i) => (
148
- <Box
149
- key={i}
150
- width={columnWidths[i]}
151
- paddingX={1}
152
- borderStyle="single"
153
- borderLeft={i > 0}
154
- borderRight={false}
155
- borderTop={false}
156
- borderBottom={false}
157
- borderColor="gray"
158
- >
159
- <Text bold wrap="wrap">
160
- <InlineRenderer tokens={cell.tokens} />
161
- </Text>
162
- </Box>
163
- ))}
164
- </Box>
165
- {/* Rows */}
166
- {token.rows.map((row, rowIndex) => (
167
- <Box key={rowIndex} flexDirection="row">
168
- {row.map((cell, i) => (
169
- <Box
170
- key={i}
171
- width={columnWidths[i]}
172
- paddingX={1}
173
- borderStyle="single"
174
- borderLeft={i > 0}
175
- borderRight={false}
176
- borderTop={false}
177
- borderBottom={false}
178
- borderColor="gray"
179
- >
180
- <Text wrap="wrap">
181
- <InlineRenderer tokens={cell.tokens} />
182
- </Text>
183
- </Box>
184
- ))}
185
- </Box>
186
- ))}
187
- </Box>
188
- );
189
- };
73
+ override checkbox({ checked }: Tokens.Checkbox): string {
74
+ return checked ? chalk.green("[x] ") : chalk.gray("[ ] ");
75
+ }
190
76
 
191
- const BlockRenderer = ({ tokens }: { tokens: Token[] }) => {
192
- return (
193
- <>
194
- {tokens.map((token, index) => {
195
- switch (token.type) {
196
- case "heading": {
197
- const t = token as Tokens.Heading;
198
- return (
199
- <Box key={index} marginBottom={1} flexDirection="column">
200
- <Text bold color="cyan">
201
- {"#".repeat(t.depth)} <InlineRenderer tokens={t.tokens} />
202
- </Text>
203
- </Box>
204
- );
205
- }
206
- case "paragraph": {
207
- const t = token as Tokens.Paragraph;
208
- return (
209
- <Box key={index} marginBottom={1} flexDirection="row">
210
- <Text>
211
- <InlineRenderer tokens={t.tokens} />
212
- </Text>
213
- </Box>
214
- );
215
- }
216
- case "code": {
217
- const t = token as Tokens.Code;
218
- if (t.lang !== undefined) {
219
- const raw = token.raw.endsWith("\n")
220
- ? token.raw.slice(0, -1)
221
- : token.raw;
222
- const lines = raw.split("\n");
223
- const opening = lines[0];
224
- const closing = lines[lines.length - 1];
225
- const content = lines.slice(1, -1).join("\n");
226
- const highlighted = content
227
- ? highlight(unescapeHtml(content), {
228
- language: t.lang,
229
- ignoreIllegals: true,
230
- })
231
- : "";
232
- return (
233
- <Box
234
- key={index}
235
- flexDirection="column"
236
- paddingX={1}
237
- marginBottom={1}
238
- >
239
- <Text color="gray">{opening}</Text>
240
- {highlighted && <Text>{highlighted}</Text>}
241
- <Text color="gray">{closing}</Text>
242
- </Box>
243
- );
244
- }
245
- return (
246
- <Box
247
- key={index}
248
- flexDirection="column"
249
- paddingX={1}
250
- marginBottom={1}
251
- >
252
- <Text>{unescapeHtml(t.text)}</Text>
253
- </Box>
254
- );
255
- }
256
- case "list": {
257
- const t = token as Tokens.List;
258
- return (
259
- <Box
260
- key={index}
261
- flexDirection="column"
262
- marginBottom={1}
263
- paddingLeft={2}
264
- >
265
- {t.items.map((item, i) => {
266
- const start = t.start || 1;
267
- return (
268
- <Box key={i} flexDirection="row">
269
- <Text color="gray">
270
- {t.ordered ? `${start + i}. ` : "• "}
271
- </Text>
272
- <Box flexDirection="column" flexGrow={1}>
273
- {item.tokens.map((itemToken, itemIndex) => {
274
- if (
275
- itemToken.type === "text" ||
276
- itemToken.type === "paragraph"
277
- ) {
278
- const it = itemToken as
279
- | Tokens.Text
280
- | Tokens.Paragraph;
281
- return (
282
- <Box key={itemIndex} flexDirection="row">
283
- <Text>
284
- <InlineRenderer
285
- tokens={it.tokens || [itemToken]}
286
- />
287
- </Text>
288
- </Box>
289
- );
290
- }
291
- return (
292
- <BlockRenderer
293
- key={itemIndex}
294
- tokens={[itemToken]}
295
- />
296
- );
297
- })}
298
- </Box>
299
- </Box>
300
- );
301
- })}
302
- </Box>
303
- );
304
- }
305
- case "blockquote": {
306
- const t = token as Tokens.Blockquote;
307
- return (
308
- <Box
309
- key={index}
310
- flexDirection="column"
311
- paddingLeft={2}
312
- borderStyle="single"
313
- borderLeft
314
- borderRight={false}
315
- borderTop={false}
316
- borderBottom={false}
317
- borderColor="gray"
318
- marginBottom={1}
319
- >
320
- <BlockRenderer tokens={t.tokens} />
321
- </Box>
322
- );
323
- }
324
- case "hr":
325
- return (
326
- <Box key={index} marginBottom={1}>
327
- <Text color="gray">{"─".repeat(20)}</Text>
328
- </Box>
329
- );
330
- case "table":
331
- return <TableRenderer key={index} token={token as Tokens.Table} />;
332
- case "space":
333
- return null;
334
- default:
335
- return (
336
- <Box key={index} marginBottom={1}>
337
- <Text>{token.raw}</Text>
338
- </Box>
339
- );
340
- }
341
- })}
342
- </>
343
- );
344
- };
77
+ override paragraph({ tokens }: Tokens.Paragraph): string {
78
+ const text = this.parser.parseInline(tokens);
79
+ return `\n${text}\n`;
80
+ }
81
+
82
+ override table(token: Tokens.Table): string {
83
+ const header = token.header.map((cell) => this.tablecell(cell)).join("");
84
+ const body = token.rows
85
+ .map((row) => row.map((cell) => this.tablecell(cell)).join("") + "\n")
86
+ .join("");
87
+ return `\n${header}\n${body}\n`;
88
+ }
89
+
90
+ override tablerow({ text }: Tokens.TableRow): string {
91
+ return text + "\n";
92
+ }
93
+
94
+ override tablecell(token: Tokens.TableCell): string {
95
+ const text = token.header ? chalk.bold(token.text) : token.text;
96
+ return text + " | ";
97
+ }
98
+
99
+ override strong({ tokens }: Tokens.Strong): string {
100
+ const text = this.parser.parseInline(tokens);
101
+ return chalk.bold(text);
102
+ }
103
+
104
+ override em({ tokens }: Tokens.Em): string {
105
+ const text = this.parser.parseInline(tokens);
106
+ return chalk.italic(text);
107
+ }
108
+
109
+ override codespan({ text }: Tokens.Codespan): string {
110
+ return chalk.yellow(text);
111
+ }
112
+
113
+ override br(): string {
114
+ return "\n";
115
+ }
116
+
117
+ override del({ tokens }: Tokens.Del): string {
118
+ const text = this.parser.parseInline(tokens);
119
+ return chalk.strikethrough(text);
120
+ }
121
+
122
+ override link({ href, tokens }: Tokens.Link): string {
123
+ const text = this.parser.parseInline(tokens);
124
+ const linkText = chalk.blue.underline(text);
125
+ const hrefText = chalk.gray(`(${href})`);
126
+ return `${linkText} ${hrefText}`;
127
+ }
128
+
129
+ override image({ href, tokens, text }: Tokens.Image): string {
130
+ const alt = this.parser.parseInline(tokens) || text;
131
+ return chalk.gray(`![${alt}](${href})`);
132
+ }
133
+
134
+ override text(token: Tokens.Text | Tokens.Escape): string {
135
+ return "tokens" in token && token.tokens
136
+ ? this.parser.parseInline(token.tokens)
137
+ : unescapeHtml(token.text);
138
+ }
139
+ }
140
+
141
+ const renderer = new AnsiRenderer();
345
142
 
346
- // Markdown component using custom Ink-based renderer
143
+ // Markdown component using custom ANSI renderer
347
144
  export const Markdown = React.memo(({ children }: MarkdownProps) => {
348
- const tokens = useMemo(() => marked.lexer(children), [children]);
145
+ const ansiContent = useMemo(() => {
146
+ return marked.parse(children, {
147
+ renderer,
148
+ gfm: true,
149
+ breaks: true,
150
+ }) as string;
151
+ }, [children]);
349
152
 
350
153
  return (
351
154
  <Box flexDirection="column">
352
- <BlockRenderer tokens={tokens} />
155
+ <Text>{ansiContent.trim()}</Text>
353
156
  </Box>
354
157
  );
355
158
  });
@@ -3,10 +3,8 @@ import { Box, Text } from "ink";
3
3
  import type { Message } from "wave-agent-sdk";
4
4
  import { MessageSource } from "wave-agent-sdk";
5
5
  import { CommandOutputDisplay } from "./CommandOutputDisplay.js";
6
- import { ToolResultDisplay } from "./ToolResultDisplay.js";
7
- import { MemoryDisplay } from "./MemoryDisplay.js";
6
+ import { ToolDisplay } from "./ToolDisplay.js";
8
7
  import { CompressDisplay } from "./CompressDisplay.js";
9
- import { SubagentBlock } from "./SubagentBlock.js";
10
8
  import { ReasoningDisplay } from "./ReasoningDisplay.js";
11
9
  import { Markdown } from "./Markdown.js";
12
10
 
@@ -16,22 +14,11 @@ export interface MessageItemProps {
16
14
  shouldShowHeader: boolean;
17
15
  }
18
16
 
19
- export const MessageItem = ({
20
- message,
21
- isExpanded,
22
- shouldShowHeader,
23
- }: MessageItemProps) => {
17
+ export const MessageItem = ({ message, isExpanded }: MessageItemProps) => {
24
18
  if (message.blocks.length === 0) return null;
19
+
25
20
  return (
26
21
  <Box flexDirection="column" gap={1} marginTop={1}>
27
- {shouldShowHeader && (
28
- <Box>
29
- <Text color={message.role === "user" ? "cyan" : "green"} bold>
30
- {message.role === "user" ? "👤 You" : "🤖 Assistant"}
31
- </Text>
32
- </Box>
33
- )}
34
-
35
22
  <Box flexDirection="column" gap={1}>
36
23
  {message.blocks.map((block, blockIndex) => (
37
24
  <Box key={blockIndex}>
@@ -39,15 +26,21 @@ export const MessageItem = ({
39
26
  <Box>
40
27
  {block.customCommandContent && (
41
28
  <Text color="cyan" bold>
42
- {" "}
29
+
43
30
  </Text>
44
31
  )}
45
32
  {block.source === MessageSource.HOOK && (
46
33
  <Text color="magenta" bold>
47
- 🔗{" "}
34
+ 🔗
35
+ </Text>
36
+ )}
37
+ {message.role === "user" ? (
38
+ <Text backgroundColor="gray" color="white">
39
+ {block.content}
48
40
  </Text>
41
+ ) : (
42
+ <Markdown>{block.content}</Markdown>
49
43
  )}
50
- <Markdown>{block.content}</Markdown>
51
44
  </Box>
52
45
  )}
53
46
 
@@ -62,7 +55,7 @@ export const MessageItem = ({
62
55
  )}
63
56
 
64
57
  {block.type === "tool" && (
65
- <ToolResultDisplay block={block} isExpanded={isExpanded} />
58
+ <ToolDisplay block={block} isExpanded={isExpanded} />
66
59
  )}
67
60
 
68
61
  {block.type === "image" && (
@@ -79,14 +72,10 @@ export const MessageItem = ({
79
72
  </Box>
80
73
  )}
81
74
 
82
- {block.type === "memory" && <MemoryDisplay block={block} />}
83
-
84
75
  {block.type === "compress" && (
85
76
  <CompressDisplay block={block} isExpanded={isExpanded} />
86
77
  )}
87
78
 
88
- {block.type === "subagent" && <SubagentBlock block={block} />}
89
-
90
79
  {block.type === "reasoning" && <ReasoningDisplay block={block} />}
91
80
  </Box>
92
81
  ))}