centaurus-cli 3.1.3 → 3.1.4

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 (138) hide show
  1. package/dist/cli-adapter.js +685 -153
  2. package/dist/cli-adapter.js.map +1 -1
  3. package/dist/config/defaultConfig.js +1 -4
  4. package/dist/config/defaultConfig.js.map +1 -1
  5. package/dist/config/models.js +4 -0
  6. package/dist/config/models.js.map +1 -1
  7. package/dist/config/slash-commands.js +66 -2
  8. package/dist/config/slash-commands.js.map +1 -1
  9. package/dist/config/types.js +4 -4
  10. package/dist/config/types.js.map +1 -1
  11. package/dist/index.js +36 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/services/ai-context-injector.js +109 -0
  14. package/dist/services/ai-context-injector.js.map +1 -1
  15. package/dist/services/api-client.js.map +1 -1
  16. package/dist/services/background-task-manager.js +59 -0
  17. package/dist/services/background-task-manager.js.map +1 -1
  18. package/dist/services/local-chat-storage.js +2 -0
  19. package/dist/services/local-chat-storage.js.map +1 -1
  20. package/dist/services/skill-storage.js +141 -0
  21. package/dist/services/skill-storage.js.map +1 -0
  22. package/dist/services/sub-agent-manager.js +49 -8
  23. package/dist/services/sub-agent-manager.js.map +1 -1
  24. package/dist/services/warpify-detector.js +17 -5
  25. package/dist/services/warpify-detector.js.map +1 -1
  26. package/dist/tools/background-command.js +5 -2
  27. package/dist/tools/background-command.js.map +1 -1
  28. package/dist/tools/command.js +367 -109
  29. package/dist/tools/command.js.map +1 -1
  30. package/dist/tools/file-ops.js +23 -6
  31. package/dist/tools/file-ops.js.map +1 -1
  32. package/dist/tools/plan-mode.js +184 -336
  33. package/dist/tools/plan-mode.js.map +1 -1
  34. package/dist/tools/sub-agent.js +24 -5
  35. package/dist/tools/sub-agent.js.map +1 -1
  36. package/dist/tools/todo-list.js +157 -0
  37. package/dist/tools/todo-list.js.map +1 -0
  38. package/dist/types/skill.js +30 -0
  39. package/dist/types/skill.js.map +1 -0
  40. package/dist/ui/components/App.js +956 -162
  41. package/dist/ui/components/App.js.map +1 -1
  42. package/dist/ui/components/AuthScreen.js +3 -1
  43. package/dist/ui/components/AuthScreen.js.map +1 -1
  44. package/dist/ui/components/AuthWelcomeScreen.js +3 -1
  45. package/dist/ui/components/AuthWelcomeScreen.js.map +1 -1
  46. package/dist/ui/components/CodeBlock.js +3 -1
  47. package/dist/ui/components/CodeBlock.js.map +1 -1
  48. package/dist/ui/components/CompactShellPreview.js +44 -0
  49. package/dist/ui/components/CompactShellPreview.js.map +1 -0
  50. package/dist/ui/components/ConfigViewer.js +3 -1
  51. package/dist/ui/components/ConfigViewer.js.map +1 -1
  52. package/dist/ui/components/ConfirmPrompt.js +3 -1
  53. package/dist/ui/components/ConfirmPrompt.js.map +1 -1
  54. package/dist/ui/components/ConnectionStatusMessage.js +3 -1
  55. package/dist/ui/components/ConnectionStatusMessage.js.map +1 -1
  56. package/dist/ui/components/DetailedPlanReviewScreen.js +84 -74
  57. package/dist/ui/components/DetailedPlanReviewScreen.js.map +1 -1
  58. package/dist/ui/components/DiffViewer.js +6 -3
  59. package/dist/ui/components/DiffViewer.js.map +1 -1
  60. package/dist/ui/components/FileCreationPreview.js.map +1 -1
  61. package/dist/ui/components/FileTagAutocomplete.js +4 -2
  62. package/dist/ui/components/FileTagAutocomplete.js.map +1 -1
  63. package/dist/ui/components/InputBox.js +243 -40
  64. package/dist/ui/components/InputBox.js.map +1 -1
  65. package/dist/ui/components/InteractiveShell.js +5 -3
  66. package/dist/ui/components/InteractiveShell.js.map +1 -1
  67. package/dist/ui/components/KeyboardHelp.js +4 -1
  68. package/dist/ui/components/KeyboardHelp.js.map +1 -1
  69. package/dist/ui/components/LoadingIndicator.js +3 -1
  70. package/dist/ui/components/LoadingIndicator.js.map +1 -1
  71. package/dist/ui/components/MCPAddScreen.js +63 -13
  72. package/dist/ui/components/MCPAddScreen.js.map +1 -1
  73. package/dist/ui/components/MarkdownRenderer.js +3 -1
  74. package/dist/ui/components/MarkdownRenderer.js.map +1 -1
  75. package/dist/ui/components/MessageDisplay.js +9 -7
  76. package/dist/ui/components/MessageDisplay.js.map +1 -1
  77. package/dist/ui/components/ModelPicker.js +170 -0
  78. package/dist/ui/components/ModelPicker.js.map +1 -0
  79. package/dist/ui/components/MonitorModeAIPanel.js +3 -1
  80. package/dist/ui/components/MonitorModeAIPanel.js.map +1 -1
  81. package/dist/ui/components/PlanAcceptedMessage.js +12 -6
  82. package/dist/ui/components/PlanAcceptedMessage.js.map +1 -1
  83. package/dist/ui/components/PlanQuestionMessage.js +37 -0
  84. package/dist/ui/components/PlanQuestionMessage.js.map +1 -0
  85. package/dist/ui/components/PlanQuestionScreen.js +138 -0
  86. package/dist/ui/components/PlanQuestionScreen.js.map +1 -0
  87. package/dist/ui/components/PlanReviewScreen.js +7 -9
  88. package/dist/ui/components/PlanReviewScreen.js.map +1 -1
  89. package/dist/ui/components/RulesEditorScreen.js +65 -28
  90. package/dist/ui/components/RulesEditorScreen.js.map +1 -1
  91. package/dist/ui/components/SelectPrompt.js +3 -1
  92. package/dist/ui/components/SelectPrompt.js.map +1 -1
  93. package/dist/ui/components/SkillCreatorScreen.js +217 -0
  94. package/dist/ui/components/SkillCreatorScreen.js.map +1 -0
  95. package/dist/ui/components/SlashCommandAutocomplete.js +4 -2
  96. package/dist/ui/components/SlashCommandAutocomplete.js.map +1 -1
  97. package/dist/ui/components/StatusBar.js +4 -2
  98. package/dist/ui/components/StatusBar.js.map +1 -1
  99. package/dist/ui/components/StreamingMessageDisplay.js +5 -3
  100. package/dist/ui/components/StreamingMessageDisplay.js.map +1 -1
  101. package/dist/ui/components/SubAgentListScreen.js +65 -0
  102. package/dist/ui/components/SubAgentListScreen.js.map +1 -0
  103. package/dist/ui/components/SubAgentViewScreen.js +123 -0
  104. package/dist/ui/components/SubAgentViewScreen.js.map +1 -0
  105. package/dist/ui/components/TaskCompletedMessage.js +40 -8
  106. package/dist/ui/components/TaskCompletedMessage.js.map +1 -1
  107. package/dist/ui/components/TaskProgressIndicator.js +6 -4
  108. package/dist/ui/components/TaskProgressIndicator.js.map +1 -1
  109. package/dist/ui/components/TextEditor.js +297 -0
  110. package/dist/ui/components/TextEditor.js.map +1 -0
  111. package/dist/ui/components/TodoListMessage.js +59 -0
  112. package/dist/ui/components/TodoListMessage.js.map +1 -0
  113. package/dist/ui/components/ToolExecutionMessage.js +134 -84
  114. package/dist/ui/components/ToolExecutionMessage.js.map +1 -1
  115. package/dist/ui/components/ToolExecutionStatus.js +3 -1
  116. package/dist/ui/components/ToolExecutionStatus.js.map +1 -1
  117. package/dist/ui/components/WelcomeBanner.js +33 -33
  118. package/dist/ui/components/WelcomeBanner.js.map +1 -1
  119. package/dist/ui/components/WorkflowCreatorScreen.js +5 -3
  120. package/dist/ui/components/WorkflowCreatorScreen.js.map +1 -1
  121. package/dist/ui/theme.js +97 -0
  122. package/dist/ui/theme.js.map +1 -0
  123. package/dist/ui/utils/chat-history-limit.js +247 -0
  124. package/dist/ui/utils/chat-history-limit.js.map +1 -0
  125. package/dist/utils/chat-formatter.js +22 -9
  126. package/dist/utils/chat-formatter.js.map +1 -1
  127. package/dist/utils/input-classifier.js +11 -1
  128. package/dist/utils/input-classifier.js.map +1 -1
  129. package/dist/utils/output-truncation.js +175 -0
  130. package/dist/utils/output-truncation.js.map +1 -0
  131. package/dist/utils/rule-reference-resolver.js +3 -3
  132. package/dist/utils/rule-reference-resolver.js.map +1 -1
  133. package/dist/utils/tunnel-commands-manager.js +134 -0
  134. package/dist/utils/tunnel-commands-manager.js.map +1 -0
  135. package/package.json +91 -90
  136. package/postinstall.js +4 -11
  137. package/dist/ui/components/MultiLineInput.js +0 -255
  138. package/dist/ui/components/MultiLineInput.js.map +0 -1
@@ -1,10 +1,13 @@
1
1
  import React from "react";
2
2
  import { Box, Text } from "ink";
3
3
  import Spinner from "ink-spinner";
4
+ import stripAnsi from "strip-ansi";
4
5
  import wrapAnsi from "wrap-ansi";
5
6
  import stringWidth from "string-width";
6
7
  import * as path from "path";
8
+ import * as Diff from "diff";
7
9
  import { processTerminalOutput } from "../../utils/terminal-output.js";
10
+ import { useTheme } from "../theme.js";
8
11
  const TOOL_LABELS = {
9
12
  view_file: { verb: "Reading file", emoji: "\u{1F4D6}" },
10
13
  write_to_file: { verb: "Writing file", emoji: "" },
@@ -218,50 +221,73 @@ function getToolDisplayInfo(toolName) {
218
221
  return { ...toolInfo, isMCP: false };
219
222
  }
220
223
  function renderDiffSnippet(removedContent, addedContent, options = {}) {
221
- const { compact } = options;
224
+ const { compact, startLine } = options;
222
225
  if (!removedContent && !addedContent) return null;
223
- const removedLines = removedContent ? removedContent.split("\n") : [];
224
- const addedLines = addedContent ? addedContent.split("\n") : [];
225
- if (removedLines.length === 0 && addedLines.length === 0) return null;
226
+ const oldText = removedContent || "";
227
+ const newText = addedContent || "";
228
+ if (oldText.length === 0 && newText.length === 0) return null;
226
229
  const terminalWidth = process.stdout.columns || 80;
227
230
  const maxPreviewWidth = Math.max(12, terminalWidth - 16);
228
231
  const measuredLineWidths = [];
229
- const wrapDiffLine = (prefix, line) => {
230
- const continuationPrefix = " ".repeat(prefix.length);
231
- const wrapped = wrapAnsi(line.length > 0 ? line : " ", Math.max(1, maxPreviewWidth - prefix.length), {
232
+ const changes = Diff.diffLines(oldText, newText);
233
+ const diffLines = [];
234
+ let oldLineNum = startLine || 1;
235
+ let newLineNum = startLine || 1;
236
+ for (const change of changes) {
237
+ const lines = change.value.replace(/\n$/, "").split("\n");
238
+ for (const line of lines) {
239
+ if (change.added) {
240
+ diffLines.push({ type: "added", text: line, lineNum: newLineNum++ });
241
+ } else if (change.removed) {
242
+ diffLines.push({ type: "removed", text: line, lineNum: oldLineNum++ });
243
+ } else {
244
+ diffLines.push({ type: "context", text: line, lineNum: newLineNum });
245
+ oldLineNum++;
246
+ newLineNum++;
247
+ }
248
+ }
249
+ }
250
+ const maxLineNum = Math.max(oldLineNum, newLineNum) - 1;
251
+ const gutterWidth = startLine !== void 0 ? String(maxLineNum).length : 0;
252
+ const wrapDiffLine = (prefix, line, lineNum) => {
253
+ const gutterStr = lineNum !== void 0 ? `${String(lineNum).padStart(gutterWidth)} ` : "";
254
+ const fullPrefix = `${gutterStr}${prefix}`;
255
+ const continuationPrefix = " ".repeat(fullPrefix.length);
256
+ const wrapped = wrapAnsi(line.length > 0 ? line : " ", Math.max(1, maxPreviewWidth - fullPrefix.length), {
232
257
  hard: true,
233
258
  trim: false
234
259
  }).split("\n");
235
260
  return wrapped.map((segment, idx) => {
236
- const rendered = `${idx === 0 ? prefix : continuationPrefix}${segment.length > 0 ? segment : " "}`;
261
+ const rendered = `${idx === 0 ? fullPrefix : continuationPrefix}${segment.length > 0 ? segment : " "}`;
237
262
  measuredLineWidths.push(stringWidth(rendered));
238
263
  return rendered;
239
264
  });
240
265
  };
241
266
  const items = [];
242
- const previewLimit = 3;
243
- removedLines.slice(0, previewLimit).forEach((line, i) => {
244
- wrapDiffLine("- ", line).forEach((wrappedLine, wrappedIndex) => {
267
+ const maxDiffLines = 50;
268
+ let renderedCount = 0;
269
+ let skippedCount = 0;
270
+ for (const dl of diffLines) {
271
+ if (renderedCount >= maxDiffLines) {
272
+ skippedCount++;
273
+ continue;
274
+ }
275
+ const prefix = dl.type === "added" ? "+ " : dl.type === "removed" ? "- " : " ";
276
+ let color = "#e6e6e6";
277
+ let backgroundColor;
278
+ if (dl.type === "removed") backgroundColor = "#5c1e1e";
279
+ else if (dl.type === "added") backgroundColor = "#1e4d2b";
280
+ else color = "#aaaaaa";
281
+ wrapDiffLine(prefix, dl.text, dl.lineNum).forEach((wrappedLine, wrappedIndex) => {
245
282
  items.push(
246
- /* @__PURE__ */ React.createElement(Box, { key: `rem-${i}-${wrappedIndex}` }, /* @__PURE__ */ React.createElement(Text, { color: "#e6e6e6", backgroundColor: "#5c1e1e", wrap: "truncate-end" }, wrappedLine))
283
+ /* @__PURE__ */ React.createElement(Box, { key: `${dl.type}-${renderedCount}-${wrappedIndex}` }, /* @__PURE__ */ React.createElement(Text, { color, backgroundColor, wrap: "truncate-end" }, wrappedLine))
247
284
  );
248
285
  });
249
- });
250
- if (removedLines.length > previewLimit) {
251
- items.push(
252
- /* @__PURE__ */ React.createElement(Box, { key: "rem-more" }, /* @__PURE__ */ React.createElement(Text, { color: "gray", dimColor: true }, " ... ", removedLines.length - previewLimit, " more lines"))
253
- );
286
+ renderedCount++;
254
287
  }
255
- addedLines.slice(0, previewLimit).forEach((line, i) => {
256
- wrapDiffLine("+ ", line).forEach((wrappedLine, wrappedIndex) => {
257
- items.push(
258
- /* @__PURE__ */ React.createElement(Box, { key: `add-${i}-${wrappedIndex}` }, /* @__PURE__ */ React.createElement(Text, { color: "#e6e6e6", backgroundColor: "#1e4d2b", wrap: "truncate-end" }, wrappedLine))
259
- );
260
- });
261
- });
262
- if (addedLines.length > previewLimit) {
288
+ if (skippedCount > 0) {
263
289
  items.push(
264
- /* @__PURE__ */ React.createElement(Box, { key: "add-more" }, /* @__PURE__ */ React.createElement(Text, { color: "gray", dimColor: true }, " ... ", addedLines.length - previewLimit, " more lines"))
290
+ /* @__PURE__ */ React.createElement(Box, { key: "more" }, /* @__PURE__ */ React.createElement(Text, { color: "gray", dimColor: true }, " ... ", skippedCount, " more lines not shown"))
265
291
  );
266
292
  }
267
293
  const separatorWidth = Math.max(
@@ -273,70 +299,72 @@ function renderDiffSnippet(removedContent, addedContent, options = {}) {
273
299
  );
274
300
  return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: compact ? 0 : 1, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#333333" }, "\u2500".repeat(separatorWidth))), items);
275
301
  }
302
+ const ToolBoxContainer = ({ children }) => /* @__PURE__ */ React.createElement(Box, { width: process.stdout.columns || 80 }, children);
276
303
  const ToolExecutionMessage = React.memo(({ message }) => {
304
+ const theme = useTheme();
277
305
  if (!message.toolExecution) {
278
306
  return null;
279
307
  }
280
308
  const { toolName, status, result, error, arguments: toolArgs } = message.toolExecution;
281
309
  const toolInfo = getToolDisplayInfo(toolName);
282
310
  const thinkingDuration = message.thinkingDuration;
283
- const renderWithThinking = (content) => /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, thinkingDuration !== void 0 && thinkingDuration >= 0 && /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "Thought for ", thinkingDuration, " second", thinkingDuration !== 1 ? "s" : "", " \u203A")), content);
311
+ const renderWithThinking = (content) => /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, thinkingDuration !== void 0 && thinkingDuration >= 0 && /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "Thought for ", thinkingDuration, " second", thinkingDuration !== 1 ? "s" : "", " \u203A")), content));
284
312
  if (status === "executing") {
285
313
  if (toolName === "execute_command") {
286
314
  return null;
287
315
  }
288
- if (toolName === "mark_task_complete" || toolName === "create_plan") {
316
+ if (toolName === "mark_task_complete" || toolName === "create_plan" || toolName === "todo_write") {
289
317
  return null;
290
318
  }
291
319
  if (toolName === "auto_context_compaction") {
292
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#003b59", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, " Auto summarizing context...")));
320
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.bgAccent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: theme.accent, bold: true }, " Auto summarizing context..."))));
293
321
  }
294
322
  if (toolInfo.isMCP) {
295
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#9945FF", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#9945FF", bold: true }, " MCP"), /* @__PURE__ */ React.createElement(Text, { color: "#9945FF" }, " ", toolInfo.serverName, " ", toolInfo.mcpToolName)));
323
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#9945FF", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#9945FF", bold: true }, " MCP"), /* @__PURE__ */ React.createElement(Text, { color: "#9945FF" }, " ", toolInfo.serverName, " ", toolInfo.mcpToolName))));
296
324
  }
297
325
  if (toolName === "view_file" && toolArgs) {
298
326
  const { AbsolutePath, remoteContext } = toolArgs;
299
327
  const lineInfo = getViewFileLineInfo(toolArgs);
300
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#003b59", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, " Reading ", lineInfo, " from "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, formatPathWithContext(AbsolutePath, remoteContext), "...")));
328
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.bgAccent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: theme.accent, bold: true }, " Reading ", lineInfo, " from "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, formatPathWithContext(AbsolutePath, remoteContext), "..."))));
301
329
  }
302
330
  if (toolName === "list_dir" && toolArgs) {
303
331
  const { DirectoryPath, remoteContext } = toolArgs;
304
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#003b59", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, " Listing "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, formatPathWithContext(DirectoryPath, remoteContext), "...")));
332
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.bgAccent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: theme.accent, bold: true }, " Listing "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, formatPathWithContext(DirectoryPath, remoteContext), "..."))));
305
333
  }
306
334
  if (toolName === "grep_search" && toolArgs) {
307
335
  const { Query, SearchPath } = toolArgs;
308
336
  const searchPathRelative = toRelativePath(SearchPath);
309
337
  const hasExtension = /\.[a-zA-Z0-9]{1,10}$/.test(SearchPath || "");
310
338
  const pathType = hasExtension ? "file" : "directory";
311
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#003b59", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, " Searching for "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, '"', Query, '"'), searchPathRelative && /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, " in ", /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, searchPathRelative), " ", pathType, "..."), !searchPathRelative && /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, "...")));
339
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.bgAccent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: theme.accent, bold: true }, " Searching for "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, '"', Query, '"'), searchPathRelative && /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, " in ", /* @__PURE__ */ React.createElement(Text, { color: theme.accent, bold: true }, searchPathRelative), " ", pathType, "..."), !searchPathRelative && /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, "..."))));
312
340
  }
313
341
  if (toolName === "find_files" && toolArgs) {
314
342
  const { pattern } = toolArgs;
315
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#003b59", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, " Finding files matching "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, '"', pattern, '"...')));
343
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.bgAccent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: theme.accent, bold: true }, " Finding files matching "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, '"', pattern, '"...'))));
316
344
  }
317
345
  if (toolName === "fetch_url" && toolArgs) {
318
346
  const { url } = toolArgs;
319
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#003b59", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, " Fetching "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, url, "...")));
347
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.bgAccent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: theme.accent, bold: true }, " Fetching "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, url, "..."))));
320
348
  }
321
349
  if (toolName === "read_binary_file" && toolArgs) {
322
350
  const { file_path, remoteContext } = toolArgs;
323
351
  const fileName = file_path ? path.basename(file_path) : "file";
324
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff9900", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#ff9900", bold: true }, " Reading "), /* @__PURE__ */ React.createElement(Text, { color: "#ff9900" }, formatPathWithContext(file_path, remoteContext), "...")));
352
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff9900", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#ff9900", bold: true }, " Reading "), /* @__PURE__ */ React.createElement(Text, { color: "#ff9900" }, formatPathWithContext(file_path, remoteContext), "..."))));
325
353
  }
326
354
  if (toolName === "write_to_file" && toolArgs) {
327
355
  const { TargetFile, remoteContext } = toolArgs;
328
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#003b59", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, " Writing to "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, formatPathWithContext(TargetFile, remoteContext), "...")));
356
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.bgAccent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: theme.accent, bold: true }, " Writing to "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, formatPathWithContext(TargetFile, remoteContext), "..."))));
329
357
  }
330
358
  if (toolName === "edit_file" && toolArgs) {
331
359
  const { file_path, remoteContext } = toolArgs;
332
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#003b59", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, " Editing "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, formatPathWithContext(file_path, remoteContext), "...")));
360
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.bgAccent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: theme.accent, bold: true }, " Editing "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, formatPathWithContext(file_path, remoteContext), "..."))));
333
361
  }
334
362
  if (toolName === "multi_edit_file" && toolArgs) {
335
363
  const { file_path, remoteContext } = toolArgs;
336
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#003b59", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, " Editing "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, formatPathWithContext(file_path, remoteContext), "...")));
364
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.bgAccent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: theme.accent, bold: true }, " Editing "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, formatPathWithContext(file_path, remoteContext), "..."))));
337
365
  }
338
366
  if (toolName === "create_image") {
339
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff9900", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#ff9900", bold: true }, " Generating image...")));
367
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff9900", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#ff9900", bold: true }, " Generating image..."))));
340
368
  }
341
369
  if (toolName === "background_command" && toolArgs) {
342
370
  const { action, command, task_id, wait_seconds } = toolArgs;
@@ -350,17 +378,17 @@ const ToolExecutionMessage = React.memo(({ message }) => {
350
378
  } else if (action === "wait") {
351
379
  actionText = `Waiting for ${wait_seconds || "?"} second${wait_seconds !== 1 ? "s" : ""}...`;
352
380
  }
353
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff9900", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#ff9900", bold: true }, " ", toolInfo.emoji, " ", actionText)));
381
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff9900", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#ff9900", bold: true }, " ", toolInfo.emoji, " ", actionText))));
354
382
  }
355
383
  if (toolName === "get_diff" && toolArgs) {
356
384
  const { filePath, staged, reason_text } = toolArgs;
357
385
  const diffTarget = filePath ? `for ${filePath}` : "for all files";
358
386
  const stagedText = staged ? " (staged)" : "";
359
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, " ", toolInfo.emoji, " Getting diff ", diffTarget, stagedText, "...")));
387
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: theme.accent, bold: true }, " ", toolInfo.emoji, " Getting diff ", diffTarget, stagedText, "..."))));
360
388
  }
361
389
  if (toolName === "web_search" && toolArgs) {
362
390
  const { query } = toolArgs;
363
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, " ", toolInfo.emoji, " Searching the web for "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, '"', query, '"...')));
391
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: theme.accent, bold: true }, " ", toolInfo.emoji, " Searching the web for "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, '"', query, '"...'))));
364
392
  }
365
393
  if (toolName === "fast_context_search" && toolArgs) {
366
394
  const { query } = toolArgs;
@@ -388,12 +416,12 @@ const ToolExecutionMessage = React.memo(({ message }) => {
388
416
  } catch (e) {
389
417
  }
390
418
  const truncatedQuery = query && query.length > 50 ? query.substring(0, 47) + "..." : query || "";
391
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, " Rapid Context "), /* @__PURE__ */ React.createElement(Text, { color: "#cccccc" }, ' "', truncatedQuery, '"')), scannedFiles.length > 0 && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginLeft: 2, marginTop: 1 }, scannedFiles.map((f, i) => /* @__PURE__ */ React.createElement(Text, { key: i, color: "#666666", wrap: "truncate-end" }, "- ", toRelativePath(f)))));
419
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, " Rapid Context "), /* @__PURE__ */ React.createElement(Text, { color: "#cccccc" }, ' "', truncatedQuery, '"')), scannedFiles.length > 0 && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginLeft: 2, marginTop: 1 }, scannedFiles.map((f, i) => /* @__PURE__ */ React.createElement(Text, { key: i, color: "#666666", wrap: "truncate-end" }, "- ", toRelativePath(f))))));
392
420
  }
393
421
  if (toolName === "inspect_symbol" && toolArgs) {
394
422
  const { filePath, symbols, remoteContext } = toolArgs;
395
423
  const symbolList = Array.isArray(symbols) ? symbols.join(", ") : symbols || "symbols";
396
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, " ", toolInfo.emoji, " Inspecting "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, symbolList, " in ", formatPathWithContext(filePath, remoteContext), "...")));
424
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: theme.accent, bold: true }, " ", toolInfo.emoji, " Inspecting "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, symbolList, " in ", formatPathWithContext(filePath, remoteContext), "..."))));
397
425
  }
398
426
  if (toolName === "sub_agent" && toolArgs) {
399
427
  const action = toolArgs.action;
@@ -406,14 +434,14 @@ const ToolExecutionMessage = React.memo(({ message }) => {
406
434
  const displayLines = promptLines.slice(0, maxLines);
407
435
  const remainingLines = promptLines.length - maxLines;
408
436
  const truncatedPrompt = displayLines.join("\n");
409
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#9945FF", bold: true }, " ", toolInfo.emoji, " Spawning Sub-Agent "), /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "(", modelName, ")")), /* @__PURE__ */ React.createElement(Box, { marginLeft: 2, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, truncatedPrompt), remainingLines > 0 && /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "... ", remainingLines, " more lines")));
437
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#9945FF", bold: true }, " ", toolInfo.emoji, " Spawning Sub-Agent "), /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "(", modelName, ")")), /* @__PURE__ */ React.createElement(Box, { marginLeft: 2, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, truncatedPrompt), remainingLines > 0 && /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "... ", remainingLines, " more lines"))));
410
438
  } else if (action === "wait_for_status" || action === "status") {
411
439
  const delay = toolArgs.time_delay || 0;
412
440
  const agentId = toolArgs.agent_id || "unknown";
413
441
  const waitMessage = delay > 0 ? `Waiting for ${delay} seconds...` : "Checking status...";
414
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#9945FF", bold: true }, " ", toolInfo.emoji, " Sub Agent Status "), /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "(id: ", agentId, ")")), /* @__PURE__ */ React.createElement(Box, { marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, waitMessage)));
442
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#9945FF", bold: true }, " ", toolInfo.emoji, " Sub Agent Status "), /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "(id: ", agentId, ")")), /* @__PURE__ */ React.createElement(Box, { marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, waitMessage))));
415
443
  }
416
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#9945FF", bold: true }, " ", toolInfo.emoji, " Sub Agent "), /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "(", action, ")")));
444
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#9945FF", bold: true }, " ", toolInfo.emoji, " Sub Agent "), /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "(", action, ")"))));
417
445
  }
418
446
  if (toolName === "workflow" && toolArgs) {
419
447
  const action = toolArgs.action;
@@ -421,8 +449,8 @@ const ToolExecutionMessage = React.memo(({ message }) => {
421
449
  const exitType = toolArgs.exit_type;
422
450
  const reason = toolArgs.reason;
423
451
  let actionText = "Workflow action...";
424
- let borderColor = "#00ccff";
425
- let textColor = "#00ccff";
452
+ let borderColor = theme.accent;
453
+ let textColor = theme.accent;
426
454
  if (action === "step_complete") {
427
455
  actionText = `Completing Step ${stepNumber || "?"}...`;
428
456
  borderColor = "#00cc66";
@@ -442,16 +470,16 @@ const ToolExecutionMessage = React.memo(({ message }) => {
442
470
  textColor = "#00cc66";
443
471
  }
444
472
  }
445
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: textColor, bold: true }, " \u{1F504} ", actionText)));
473
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: textColor, bold: true }, " \u{1F504} ", actionText))));
446
474
  }
447
475
  if (toolName === "add_mcp" && toolArgs) {
448
476
  const serverName = toolArgs.name || "unknown";
449
477
  const command = toolArgs.command || "";
450
478
  const serverArgs = Array.isArray(toolArgs.args) ? toolArgs.args.join(" ") : "";
451
479
  const fullCommand = serverArgs ? `${command} ${serverArgs}` : command;
452
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#9945FF", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#9945FF" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#9945FF", bold: true }, " \u{1F50C} Adding MCP server "), /* @__PURE__ */ React.createElement(Text, { color: "#cc99ff", bold: true }, serverName)), fullCommand && /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, " ", fullCommand)));
480
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#9945FF", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#9945FF" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#9945FF", bold: true }, " \u{1F50C} Adding MCP server "), /* @__PURE__ */ React.createElement(Text, { color: "#cc99ff", bold: true }, serverName)), fullCommand && /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, " ", fullCommand))));
453
481
  }
454
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#003b59", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, " ", toolInfo.verb, "...")));
482
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.bgAccent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, /* @__PURE__ */ React.createElement(Spinner, { type: "arc" })), /* @__PURE__ */ React.createElement(Text, { color: theme.accent, bold: true }, " ", toolInfo.verb, "..."))));
455
483
  }
456
484
  if (status === "error") {
457
485
  if (toolName === "execute_command" && toolArgs) {
@@ -460,22 +488,22 @@ const ToolExecutionMessage = React.memo(({ message }) => {
460
488
  const { cwd, remoteContext } = toolArgs;
461
489
  const cleanResult = cleanShellOutput(result);
462
490
  const formattedCwd = cwd && remoteContext ? `${remoteContext}:${cwd.replace(/\\/g, "/")}` : (cwd || "").replace(/\\/g, "/");
463
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff3366", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: "#ff3366", bold: true }, "\u2717 Shell "), /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, truncatedCommand, " "), cwd && /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "[current working directory ", formattedCwd, "]"))), cleanResult && /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { wrap: "wrap" }, cleanResult)));
491
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff3366", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap", marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: "#ff3366", bold: true }, "\u2717 Shell "), /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, truncatedCommand, " "), cwd && /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "[current working directory ", formattedCwd, "]"))), cleanResult && /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { wrap: "wrap" }, cleanResult))));
464
492
  }
465
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff3366", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#ff3366", bold: true }, "\u2717 ", toolInfo.emoji, " ", toolInfo.verb, " failed")), /* @__PURE__ */ React.createElement(Box, { paddingLeft: 1, marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#ff3366" }, error || "The Agent passed invalid parameters")));
493
+ return /* @__PURE__ */ React.createElement(ToolBoxContainer, null, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff3366", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#ff3366", bold: true }, "\u2717 ", toolInfo.emoji, " ", toolInfo.verb, " failed")), /* @__PURE__ */ React.createElement(Box, { paddingLeft: 1, marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#ff3366" }, error || "The Agent passed invalid parameters"))));
466
494
  }
467
495
  if (status === "completed") {
468
496
  if (toolInfo.isMCP) {
469
497
  return renderWithThinking(
470
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00cc66", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 MCP"), /* @__PURE__ */ React.createElement(Text, { color: "#aaaaaa" }, " ", toolInfo.serverName, " ", toolInfo.mcpToolName)))
498
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00cc66", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 MCP"), /* @__PURE__ */ React.createElement(Text, { color: "#aaaaaa" }, " ", toolInfo.serverName, " ", toolInfo.mcpToolName)))
471
499
  );
472
500
  }
473
- if (toolName === "mark_task_complete" || toolName === "create_plan") {
501
+ if (toolName === "mark_task_complete" || toolName === "create_plan" || toolName === "todo_write") {
474
502
  return null;
475
503
  }
476
504
  if (toolName === "auto_context_compaction") {
477
505
  return renderWithThinking(
478
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00cc66", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "Auto compacted context")), result && /* @__PURE__ */ React.createElement(Box, { paddingLeft: 1, marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#aaaaaa" }, result)))
506
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00cc66", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "Auto compacted context")), result && /* @__PURE__ */ React.createElement(Box, { paddingLeft: 1, marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#aaaaaa" }, result)))
479
507
  );
480
508
  }
481
509
  if (toolName === "execute_command" && toolArgs) {
@@ -487,30 +515,36 @@ const ToolExecutionMessage = React.memo(({ message }) => {
487
515
  const { cwd, remoteContext } = toolArgs;
488
516
  const cleanResult = cleanShellOutput(result);
489
517
  const formattedCwd = cwd && remoteContext ? `${remoteContext}:${cwd.replace(/\\/g, "/")}` : (cwd || "").replace(/\\/g, "/");
518
+ const wasTransferred = !!toolArgs?.timeoutTransferred;
519
+ const shellBorderColor = wasTransferred ? "#f59e0b" : "#00cc66";
520
+ const shellHeaderColor = wasTransferred ? "#f59e0b" : "#00cc66";
521
+ const shellIcon = wasTransferred ? "\u23F1" : "\u2713";
490
522
  return renderWithThinking(
491
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00cc66", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 Shell "), /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, truncatedCommand, " "), cwd && /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "[current working directory ", formattedCwd, "]"))), cleanResult && /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { wrap: "wrap" }, cleanResult)))
523
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: shellBorderColor, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap", marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { color: shellHeaderColor, bold: true }, shellIcon, " Shell "), /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, truncatedCommand, " "), cwd && /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "[current working directory ", formattedCwd, "]"))), cleanResult && /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { wrap: "wrap" }, cleanResult)), wasTransferred && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#f59e0b", bold: true }, "\u26A0 Timeout exceeded \u2014 transferred to background shell")))
492
524
  );
493
525
  }
494
526
  if (toolName === "view_file" && toolArgs) {
495
527
  const { AbsolutePath, remoteContext } = toolArgs;
496
528
  const lineInfo = getViewFileLineInfo(toolArgs, result);
497
529
  return renderWithThinking(
498
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Read ", lineInfo, " from "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, formatPathWithContext(AbsolutePath, remoteContext))))
530
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Read ", lineInfo, " from "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, formatPathWithContext(AbsolutePath, remoteContext))))
499
531
  );
500
532
  }
501
533
  if (toolName === "write_to_file" && toolArgs) {
502
534
  const { TargetFile, CodeContent, remoteContext } = toolArgs;
503
535
  const lines = CodeContent ? CodeContent.split("\n").length : 0;
504
536
  return renderWithThinking(
505
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Wrote to "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, formatPathWithContext(TargetFile, remoteContext)), lines > 0 && /* @__PURE__ */ React.createElement(Text, { color: "green" }, " +", lines)), renderDiffSnippet(void 0, CodeContent))
537
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Wrote to "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, formatPathWithContext(TargetFile, remoteContext)), lines > 0 && /* @__PURE__ */ React.createElement(Text, { color: "green" }, " +", lines)), renderDiffSnippet(void 0, CodeContent, { startLine: 1 }))
506
538
  );
507
539
  }
508
540
  if (toolName === "edit_file" && toolArgs) {
509
541
  const { file_path, remoteContext, replacement, search_pattern } = toolArgs;
510
542
  const added = replacement ? replacement.split("\n").length : 0;
511
543
  const removed = search_pattern ? search_pattern.split("\n").length : 0;
544
+ const lineMatch = result?.match(/at line (\d+)/);
545
+ const editStartLine = lineMatch ? parseInt(lineMatch[1], 10) : 1;
512
546
  return renderWithThinking(
513
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Edited "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, formatPathWithContext(file_path, remoteContext)), /* @__PURE__ */ React.createElement(Text, { color: "green" }, " +", added), /* @__PURE__ */ React.createElement(Text, { color: "red" }, " -", removed)), renderDiffSnippet(search_pattern, replacement))
547
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Edited "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, formatPathWithContext(file_path, remoteContext)), /* @__PURE__ */ React.createElement(Text, { color: "green" }, " +", added), /* @__PURE__ */ React.createElement(Text, { color: "red" }, " -", removed)), renderDiffSnippet(search_pattern, replacement, { startLine: editStartLine }))
514
548
  );
515
549
  }
516
550
  if (toolName === "multi_edit_file" && toolArgs) {
@@ -526,14 +560,14 @@ const ToolExecutionMessage = React.memo(({ message }) => {
526
560
  removed += (edit.search_pattern || edit.TargetContent).split("\n").length;
527
561
  }
528
562
  });
529
- const firstEdit = editList[0];
530
- const searchExample = firstEdit ? firstEdit.search_pattern || firstEdit.TargetContent : void 0;
531
- const replaceExample = firstEdit ? firstEdit.replacement || firstEdit.ReplacementContent : void 0;
563
+ const multiLineMatch = result?.match(/at lines ([\d, ]+)/);
564
+ const editLineNumbers = multiLineMatch ? multiLineMatch[1].split(",").map((s) => parseInt(s.trim(), 10)) : [];
532
565
  return renderWithThinking(
533
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Edited "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, formatPathWithContext(file_path, remoteContext)), /* @__PURE__ */ React.createElement(Text, { color: "green" }, " +", added), /* @__PURE__ */ React.createElement(Text, { color: "red" }, " -", removed)), editList.length > 0 ? /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 0 }, editList.map((edit, index) => {
566
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Edited "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, formatPathWithContext(file_path, remoteContext)), /* @__PURE__ */ React.createElement(Text, { color: "green" }, " +", added), /* @__PURE__ */ React.createElement(Text, { color: "red" }, " -", removed)), editList.length > 0 ? /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 0 }, editList.map((edit, index) => {
534
567
  const search = edit.search_pattern || edit.TargetContent;
535
568
  const replace = edit.replacement || edit.ReplacementContent;
536
- return /* @__PURE__ */ React.createElement(React.Fragment, { key: index }, renderDiffSnippet(search, replace, { compact: index > 0 }));
569
+ const editLine = editLineNumbers[index] || 1;
570
+ return /* @__PURE__ */ React.createElement(React.Fragment, { key: index }, renderDiffSnippet(search, replace, { compact: index > 0, startLine: editLine }));
537
571
  })) : null)
538
572
  );
539
573
  }
@@ -541,7 +575,7 @@ const ToolExecutionMessage = React.memo(({ message }) => {
541
575
  const { DirectoryPath, remoteContext } = toolArgs;
542
576
  const itemStats = parseListDirResult(result);
543
577
  return renderWithThinking(
544
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Listed "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, formatPathWithContext(DirectoryPath, remoteContext)), itemStats !== null && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " (", itemStats.dirs, " dir", itemStats.dirs !== 1 ? "s" : "", ", ", itemStats.files, " file", itemStats.files !== 1 ? "s" : "", ")")))
578
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Listed "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, formatPathWithContext(DirectoryPath, remoteContext)), itemStats !== null && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " (", itemStats.dirs, " dir", itemStats.dirs !== 1 ? "s" : "", ", ", itemStats.files, " file", itemStats.files !== 1 ? "s" : "", ")")))
545
579
  );
546
580
  }
547
581
  if (toolName === "grep_search" && toolArgs) {
@@ -551,7 +585,7 @@ const ToolExecutionMessage = React.memo(({ message }) => {
551
585
  const hasExtension = /\.[a-zA-Z0-9]{1,10}$/.test(SearchPath || "");
552
586
  const pathType = hasExtension ? "file" : "directory";
553
587
  return renderWithThinking(
554
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Searched for "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, '"', Query, '"'), searchPathRelative && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " in ", /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, searchPathRelative), " ", pathType), searchResults && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " (", searchResults.matches, " match", searchResults.matches !== 1 ? "es" : "", " in ", searchResults.files, " file", searchResults.files !== 1 ? "s" : "", ")"), !searchResults && result && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " (no matches)")))
588
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Searched for "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, '"', Query, '"'), searchPathRelative && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " in ", /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, searchPathRelative), " ", pathType), searchResults && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " (", searchResults.matches, " match", searchResults.matches !== 1 ? "es" : "", " in ", searchResults.files, " file", searchResults.files !== 1 ? "s" : "", ")"), !searchResults && result && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " (no matches)")))
555
589
  );
556
590
  }
557
591
  if (toolName === "find_files" && toolArgs) {
@@ -559,19 +593,19 @@ const ToolExecutionMessage = React.memo(({ message }) => {
559
593
  const displayPattern = pattern || Pattern || "*";
560
594
  const fileCount = parseFindFilesResult(result);
561
595
  return renderWithThinking(
562
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Found ", fileCount !== null ? fileCount : 0, " files matching "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, '"', displayPattern, '"')))
596
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Found ", fileCount !== null ? fileCount : 0, " files matching "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, '"', displayPattern, '"')))
563
597
  );
564
598
  }
565
599
  if (toolName === "web_search" && toolArgs) {
566
600
  const { query } = toolArgs;
567
601
  return renderWithThinking(
568
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Searched the web for "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, '"', query, '"')))
602
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Searched the web for "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, '"', query, '"')))
569
603
  );
570
604
  }
571
605
  if (toolName === "fetch_url" && toolArgs) {
572
606
  const { url } = toolArgs;
573
607
  return renderWithThinking(
574
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Fetched "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, url)))
608
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Fetched "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, url)))
575
609
  );
576
610
  }
577
611
  if (toolName === "fast_context_search" && toolArgs) {
@@ -595,7 +629,7 @@ const ToolExecutionMessage = React.memo(({ message }) => {
595
629
  const MAX_DISPLAY_FILES = 10;
596
630
  const truncatedQuery = query && query.length > 50 ? query.substring(0, 47) + "..." : query || "";
597
631
  return renderWithThinking(
598
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 Rapid Context "), /* @__PURE__ */ React.createElement(Text, { color: "#cccccc", wrap: "truncate-end" }, '"', truncatedQuery, '" '), stats && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, "(Searched ", stats.filesSearched, " files in ", (stats.duration / 1e3).toFixed(1), "s)")), /* @__PURE__ */ React.createElement(Box, { paddingLeft: 1, marginTop: 1, flexDirection: "column" }, !hasFiles && answer && /* @__PURE__ */ React.createElement(Text, { color: "#aaaaaa", wrap: "truncate-end" }, answer), hasFiles && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 0 }, scannedFiles.slice(0, MAX_DISPLAY_FILES).map((f, i) => {
632
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 Rapid Context "), /* @__PURE__ */ React.createElement(Text, { color: "#cccccc", wrap: "truncate-end" }, '"', truncatedQuery, '" '), stats && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, "(Searched ", stats.filesSearched, " files in ", (stats.duration / 1e3).toFixed(1), "s)")), /* @__PURE__ */ React.createElement(Box, { paddingLeft: 1, marginTop: 1, flexDirection: "column" }, !hasFiles && answer && /* @__PURE__ */ React.createElement(Text, { color: "#aaaaaa", wrap: "truncate-end" }, answer), hasFiles && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 0 }, scannedFiles.slice(0, MAX_DISPLAY_FILES).map((f, i) => {
599
633
  return /* @__PURE__ */ React.createElement(Text, { key: i, color: "#444444", wrap: "truncate-end" }, "- ", path.basename(f), " ", /* @__PURE__ */ React.createElement(Text, { color: "#333333", italic: true }, "(", toRelativePath(f), ")"));
600
634
  }), scannedFiles.length > MAX_DISPLAY_FILES && /* @__PURE__ */ React.createElement(Text, { color: "#444444", italic: true }, "...and ", scannedFiles.length - MAX_DISPLAY_FILES, " more files checked"))))
601
635
  );
@@ -606,7 +640,7 @@ const ToolExecutionMessage = React.memo(({ message }) => {
606
640
  const displayPath = filePath || "unknown";
607
641
  const noSymbols = result?.includes("No symbols found");
608
642
  return renderWithThinking(
609
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Inspected "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, formatPathWithContext(displayPath, remoteContext)), noSymbols && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " (no symbols found)"), !noSymbols && symbolResult.found && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " (", symbolResult.count, " symbol", symbolResult.count !== 1 ? "s" : "", ")")))
643
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Inspected "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, formatPathWithContext(displayPath, remoteContext)), noSymbols && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " (no symbols found)"), !noSymbols && symbolResult.found && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " (", symbolResult.count, " symbol", symbolResult.count !== 1 ? "s" : "", ")")))
610
644
  );
611
645
  }
612
646
  if (toolName === "read_binary_file" && toolArgs) {
@@ -620,7 +654,7 @@ const ToolExecutionMessage = React.memo(({ message }) => {
620
654
  const isError = result?.includes("Error:") || !isSuccess;
621
655
  const errorMessage = result?.match(/Error:\s*(.+?)(?:\n|$)/)?.[1] || "";
622
656
  return renderWithThinking(
623
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: isSuccess ? "#00cc66" : "#ff6666", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, isSuccess ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Read "), /* @__PURE__ */ React.createElement(Text, { color: "#ff9900" }, formatPathWithContext(file_path, remoteContext))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, { color: "#ff6666", bold: true }, "\u2717 ", toolInfo.emoji, " Read failed "), /* @__PURE__ */ React.createElement(Text, { color: "#ff9900" }, formatPathWithContext(file_path, remoteContext)))), isSuccess && (fileType || fileSize) && /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, fileType && `${fileType}`, fileType && fileSize && " \u2022 ", fileSize && fileSize)), isError && errorMessage && /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#ff6666" }, errorMessage)))
657
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: isSuccess ? "#00cc66" : "#ff6666", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, isSuccess ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Read "), /* @__PURE__ */ React.createElement(Text, { color: "#ff9900" }, formatPathWithContext(file_path, remoteContext))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, { color: "#ff6666", bold: true }, "\u2717 ", toolInfo.emoji, " Read failed "), /* @__PURE__ */ React.createElement(Text, { color: "#ff9900" }, formatPathWithContext(file_path, remoteContext)))), isSuccess && (fileType || fileSize) && /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, fileType && `${fileType}`, fileType && fileSize && " \u2022 ", fileSize && fileSize)), isError && errorMessage && /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#ff6666" }, errorMessage)))
624
658
  );
625
659
  }
626
660
  if (toolName === "sub_agent") {
@@ -649,7 +683,7 @@ const ToolExecutionMessage = React.memo(({ message }) => {
649
683
  const spawnedId = idMatch ? idMatch[1] : "unknown";
650
684
  details = `(id: ${spawnedId})`;
651
685
  if (prompt) {
652
- additionalContent = /* @__PURE__ */ React.createElement(Box, { marginTop: 1, marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, prompt));
686
+ additionalContent = /* @__PURE__ */ React.createElement(Box, { marginTop: 1, marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, prompt));
653
687
  }
654
688
  } else if (toolAction === "wait_for_status" || toolAction === "status") {
655
689
  title = "Sub Agent Status";
@@ -670,7 +704,7 @@ const ToolExecutionMessage = React.memo(({ message }) => {
670
704
  if (structResult) {
671
705
  details = `(id: ${structResult.agentId}, duration: ${structResult.duration})`;
672
706
  if (structResult.fileOperations && structResult.fileOperations.length > 0) {
673
- additionalContent = /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, "Files Modified:"), structResult.fileOperations.map((op, i) => /* @__PURE__ */ React.createElement(Box, { key: i, marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, "\u2022 ", op.path, " ", /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "(", op.type, ")")))));
707
+ additionalContent = /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, "Files Modified:"), structResult.fileOperations.map((op, i) => /* @__PURE__ */ React.createElement(Box, { key: i, marginLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, "\u2022 ", op.path, " ", /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "(", op.type, ")")))));
674
708
  }
675
709
  } else {
676
710
  details = `(id: ${agentId})`;
@@ -679,7 +713,7 @@ const ToolExecutionMessage = React.memo(({ message }) => {
679
713
  }
680
714
  }
681
715
  return renderWithThinking(
682
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00cc66", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " ", title, " "), /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, details)), additionalContent)
716
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00cc66", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " ", title, " "), /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, details)), additionalContent)
683
717
  );
684
718
  }
685
719
  if (toolName === "create_image" && toolArgs) {
@@ -690,7 +724,7 @@ const ToolExecutionMessage = React.memo(({ message }) => {
690
724
  const format = formatMatch ? formatMatch[1] : "";
691
725
  const isSuccess = result?.includes("generated successfully");
692
726
  return renderWithThinking(
693
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: isSuccess ? "#00cc66" : "#ff6666", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, isSuccess ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Generated image "), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, toRelativePath(output_path)), (fileSize || format) && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " (", format, format && fileSize ? " \u2022 " : "", fileSize, ")")) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, { color: "#ff6666", bold: true }, "\u2717 ", toolInfo.emoji, " Image generation failed"))))
727
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: isSuccess ? "#00cc66" : "#ff6666", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, isSuccess ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Generated image "), /* @__PURE__ */ React.createElement(Text, { color: theme.accent }, toRelativePath(output_path)), (fileSize || format) && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " (", format, format && fileSize ? " \u2022 " : "", fileSize, ")")) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, { color: "#ff6666", bold: true }, "\u2717 ", toolInfo.emoji, " Image generation failed"))))
694
728
  );
695
729
  }
696
730
  if (toolName === "background_command" && toolArgs) {
@@ -710,8 +744,24 @@ const ToolExecutionMessage = React.memo(({ message }) => {
710
744
  actionText = "Waited for";
711
745
  actionDetail = wait_seconds ? `${wait_seconds} second${wait_seconds !== 1 ? "s" : ""}` : "";
712
746
  }
747
+ let outputPreview = "";
748
+ if ((action === "status" || action === "wait") && result) {
749
+ const sanitized = stripAnsi(processTerminalOutput(result)).replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, "").replace(/\r\n/g, "\n").replace(/\r/g, "\n");
750
+ const outputMatch = sanitized.match(/(?:Output Preview|Recent Output|Output \(last).*?:\n?([\s\S]*?)(?:\n\n|$)/i);
751
+ if (outputMatch) {
752
+ outputPreview = outputMatch[1].trim();
753
+ } else {
754
+ const lines = sanitized.split("\n").filter((l) => l.trim());
755
+ if (lines.length > 2) {
756
+ outputPreview = lines.slice(-5).join("\n");
757
+ }
758
+ }
759
+ if (outputPreview.length > 500) {
760
+ outputPreview = outputPreview.slice(-500);
761
+ }
762
+ }
713
763
  return renderWithThinking(
714
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00cc66", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " ", actionText), actionDetail && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " ", actionDetail)))
764
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00cc66", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " ", actionText), actionDetail && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " ", actionDetail)), outputPreview && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { wrap: "wrap", dimColor: true }, outputPreview)))
715
765
  );
716
766
  }
717
767
  if (toolName === "workflow" && toolArgs) {
@@ -745,7 +795,7 @@ const ToolExecutionMessage = React.memo(({ message }) => {
745
795
  }
746
796
  }
747
797
  return renderWithThinking(
748
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: textColor, bold: true }, icon, " \u{1F504} ", actionText)))
798
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: textColor, bold: true }, icon, " \u{1F504} ", actionText)))
749
799
  );
750
800
  }
751
801
  if (toolName === "get_diff" && toolArgs) {
@@ -774,7 +824,7 @@ const ToolExecutionMessage = React.memo(({ message }) => {
774
824
  }
775
825
  }
776
826
  return renderWithThinking(
777
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00cc66", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Checked diff ", diffTarget ? `for ${diffTarget} ` : "", stagedText), /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, "(", displayInfo, truncated ? ", truncated" : "", ")")))
827
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00cc66", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " Checked diff ", diffTarget ? `for ${diffTarget} ` : "", stagedText), /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, "(", displayInfo, truncated ? ", truncated" : "", ")")))
778
828
  );
779
829
  }
780
830
  if (toolName === "add_mcp" && toolArgs) {
@@ -796,11 +846,11 @@ const ToolExecutionMessage = React.memo(({ message }) => {
796
846
  }
797
847
  }
798
848
  return renderWithThinking(
799
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: statusColor, bold: true }, statusIcon, " \u{1F50C} ", isSuccess ? "Connected" : "Failed", " MCP server "), /* @__PURE__ */ React.createElement(Text, { color: "#cc99ff", bold: true }, serverName), toolCount && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, toolCount)), errorMsg && /* @__PURE__ */ React.createElement(Box, { paddingLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: "#ff6699" }, errorMsg)))
849
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: statusColor, bold: true }, statusIcon, " \u{1F50C} ", isSuccess ? "Connected" : "Failed", " MCP server "), /* @__PURE__ */ React.createElement(Text, { color: "#cc99ff", bold: true }, serverName), toolCount && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, toolCount)), errorMsg && /* @__PURE__ */ React.createElement(Box, { paddingLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { color: "#ff6699" }, errorMsg)))
800
850
  );
801
851
  }
802
852
  return renderWithThinking(
803
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " ", toolInfo.verb)), result && result.length < 300 && /* @__PURE__ */ React.createElement(Box, { paddingLeft: 1, marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#aaaaaa" }, result)))
853
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, flexGrow: 0, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, { flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713 ", toolInfo.emoji, " ", toolInfo.verb)), result && result.length < 300 && /* @__PURE__ */ React.createElement(Box, { paddingLeft: 1, marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#aaaaaa" }, result)))
804
854
  );
805
855
  }
806
856
  return null;