@aria-cli/cli 1.0.50 → 1.0.51

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 (319) hide show
  1. package/bin/aria.mjs +1 -1
  2. package/dist/.tsbuildinfo +1 -0
  3. package/dist/attached-local-control-client.js +826 -0
  4. package/dist/bootstrap-local-control-client.js +2 -0
  5. package/dist/capability-aware-method-proxy.js +42 -0
  6. package/dist/cli-context.js +160 -0
  7. package/dist/commands/arions.js +174 -0
  8. package/dist/commands/auth.js +123 -0
  9. package/dist/commands/daemon.js +245 -0
  10. package/dist/commands/definitions.js +176 -0
  11. package/dist/commands/index.js +74 -0
  12. package/dist/commands/login-handler.js +1108 -0
  13. package/dist/commands/logout-handler.js +92 -0
  14. package/dist/commands/memory-handlers.js +89 -0
  15. package/dist/commands/pairing.js +60 -0
  16. package/dist/commands/runtime-cutover-reset-command.js +12 -0
  17. package/dist/commands/runtime-cutover-reset.js +265 -0
  18. package/dist/commands/terminal-setup.js +84 -0
  19. package/dist/config/aria-config.js +238 -0
  20. package/dist/config/index.js +3 -0
  21. package/dist/config/loader.js +97 -0
  22. package/dist/config.js +142 -0
  23. package/dist/daemon-info.js +10 -0
  24. package/dist/ensure-daemon.js +128 -0
  25. package/dist/entrypoints/command-mode.js +5 -0
  26. package/dist/entrypoints/daemon.js +50 -0
  27. package/dist/entrypoints/headless-stdio.js +25 -0
  28. package/dist/entrypoints/interactive.js +80 -0
  29. package/dist/event-loop-watchdog.js +73 -0
  30. package/dist/headless/auth-orchestrator.js +508 -0
  31. package/dist/headless/auth-service.js +43 -0
  32. package/dist/headless/bootstrap-fast-path.js +112 -0
  33. package/dist/headless/call-command.js +143 -0
  34. package/dist/headless/daemon-service.js +318 -0
  35. package/dist/headless/hook-actions.js +235 -0
  36. package/dist/headless/hook-service.js +42 -0
  37. package/dist/headless/kernel-services.js +216 -0
  38. package/dist/headless/kernel.js +785 -0
  39. package/dist/headless/operations/arion.js +119 -0
  40. package/dist/headless/operations/auth.js +45 -0
  41. package/dist/headless/operations/client.js +31 -0
  42. package/dist/headless/operations/config.js +69 -0
  43. package/dist/headless/operations/daemon.js +47 -0
  44. package/dist/headless/operations/hook.js +56 -0
  45. package/dist/headless/operations/index.js +11 -0
  46. package/dist/headless/operations/memory.js +102 -0
  47. package/dist/headless/operations/message.js +279 -0
  48. package/dist/headless/operations/model.js +100 -0
  49. package/dist/headless/operations/peer.js +56 -0
  50. package/dist/headless/operations/run.js +24 -0
  51. package/dist/headless/operations/session.js +90 -0
  52. package/dist/headless/operations/system.js +19 -0
  53. package/dist/headless/operations/utils.js +35 -0
  54. package/dist/headless/run-orchestrator.js +703 -0
  55. package/dist/headless/stdio-server.js +439 -0
  56. package/dist/history/SessionHistory.js +8 -0
  57. package/dist/history/SessionHistoryClient.js +186 -0
  58. package/dist/history/conversation-message.js +112 -0
  59. package/dist/history/index.js +8 -0
  60. package/dist/history/jsonl-replay.js +154 -0
  61. package/dist/history/repair-tool-pairing.js +84 -0
  62. package/dist/history/stall-phase-bridge.js +11 -0
  63. package/dist/history/turn-accumulator.js +427 -0
  64. package/dist/index.js +7 -0
  65. package/dist/ink-repl.js +4183 -0
  66. package/dist/local-control-bootstrap.js +26 -0
  67. package/dist/local-control-client.js +2 -0
  68. package/dist/local-control-error-reporting.js +34 -0
  69. package/dist/local-control-http-client.js +362 -0
  70. package/dist/local-control-lazy-wrapper.js +363 -0
  71. package/dist/local-control-manager.js +146 -0
  72. package/dist/main.js +38 -0
  73. package/dist/network-security.js +62 -0
  74. package/dist/networking-server.js +38 -0
  75. package/dist/peer-identity.js +23 -0
  76. package/dist/polling-subscription.js +34 -0
  77. package/dist/relaunch.js +588 -0
  78. package/dist/release-notes.js +35 -0
  79. package/dist/repl-cleanup.js +47 -0
  80. package/dist/runtime/configure-bun-sqlite.js +3 -0
  81. package/dist/runtime/crash-handlers.js +111 -0
  82. package/dist/runtime/interactive-invocation.js +39 -0
  83. package/dist/runtime/internal-mode.js +14 -0
  84. package/dist/runtime/launch-spec.js +64 -0
  85. package/dist/runtime/owner-lease.js +44 -0
  86. package/dist/runtime/public-mode.js +20 -0
  87. package/dist/runtime/run-internal-mode.js +18 -0
  88. package/dist/runtime/runtime-kind.js +32 -0
  89. package/dist/runtime/spawn-aria.js +38 -0
  90. package/dist/selectable-client.js +2 -0
  91. package/dist/selectable-peer.js +2 -0
  92. package/dist/session.js +203 -0
  93. package/dist/slash-commands.js +80 -0
  94. package/dist/sounds.js +210 -0
  95. package/dist/ui/App.js +526 -0
  96. package/dist/ui/components/AnthropicMethodPicker.js +6 -0
  97. package/dist/ui/components/ArionPrompt.js +15 -0
  98. package/dist/ui/components/AutocompleteDropdown.js +23 -0
  99. package/dist/ui/components/AutonomySelector.js +55 -0
  100. package/dist/ui/components/Banner.js +98 -0
  101. package/dist/ui/components/ConversationHistory.js +175 -0
  102. package/dist/ui/components/CopilotDeviceLoginFlow.js +88 -0
  103. package/dist/ui/components/CopilotSourcePicker.js +50 -0
  104. package/dist/ui/components/Cost.js +10 -0
  105. package/dist/ui/components/CustomSelect/option-map.js +30 -0
  106. package/dist/ui/components/CustomSelect/select-option.js +13 -0
  107. package/dist/ui/components/CustomSelect/select.js +42 -0
  108. package/dist/ui/components/CustomSelect/use-select-state.js +179 -0
  109. package/dist/ui/components/CustomSelect/use-select.js +15 -0
  110. package/dist/ui/components/ErrorDisplay.js +35 -0
  111. package/dist/ui/components/FallbackToolUseRejectedMessage.js +7 -0
  112. package/dist/ui/components/FileEditToolUpdatedMessage.js +57 -0
  113. package/dist/ui/components/HandoffMarker.js +18 -0
  114. package/dist/ui/components/HighlightedCode.js +21 -0
  115. package/dist/ui/components/InputArea.js +187 -0
  116. package/dist/ui/components/Message.js +25 -0
  117. package/dist/ui/components/OAuthLoginFlow.js +113 -0
  118. package/dist/ui/components/OutputTruncation.js +35 -0
  119. package/dist/ui/components/PermissionPrompt.js +79 -0
  120. package/dist/ui/components/PipelineTimingPanel.js +15 -0
  121. package/dist/ui/components/ProviderMethodPicker.js +61 -0
  122. package/dist/ui/components/ProviderPicker.js +63 -0
  123. package/dist/ui/components/RenderItemView.js +71 -0
  124. package/dist/ui/components/Spinner.js +46 -0
  125. package/dist/ui/components/StatusBar.js +95 -0
  126. package/dist/ui/components/StreamingIndicator.js +55 -0
  127. package/dist/ui/components/StructuredDiff.js +168 -0
  128. package/dist/ui/components/TextInputOverlay.js +43 -0
  129. package/dist/ui/components/ThinkingBlock.js +82 -0
  130. package/dist/ui/components/ToolCost.js +17 -0
  131. package/dist/ui/components/ToolExecution.js +61 -0
  132. package/dist/ui/components/ToolHeader.js +51 -0
  133. package/dist/ui/components/ToolRenderLayoutContext.js +14 -0
  134. package/dist/ui/components/ToolResultWrapper.js +6 -0
  135. package/dist/ui/components/ToolUseLoader.js +35 -0
  136. package/dist/ui/components/TraceWaterfall.js +91 -0
  137. package/dist/ui/components/index.js +33 -0
  138. package/dist/ui/components/messages/AssistantTextMessage.js +25 -0
  139. package/dist/ui/components/messages/UserImageMessage.js +12 -0
  140. package/dist/ui/components/messages/UserTextMessage.js +12 -0
  141. package/dist/ui/components/overlays/ArionSelector.js +68 -0
  142. package/dist/ui/components/overlays/ClientSelector.js +62 -0
  143. package/dist/ui/components/overlays/CommandPalette.js +67 -0
  144. package/dist/ui/components/overlays/DaemonControl.js +87 -0
  145. package/dist/ui/components/overlays/InviteShareOverlay.js +15 -0
  146. package/dist/ui/components/overlays/JoinInviteOverlay.js +32 -0
  147. package/dist/ui/components/overlays/MemoryBrowser.js +100 -0
  148. package/dist/ui/components/overlays/MessageSelector.js +123 -0
  149. package/dist/ui/components/overlays/ModelSelector.js +211 -0
  150. package/dist/ui/components/overlays/PairRequestOverlay.js +42 -0
  151. package/dist/ui/components/overlays/PeerSelector.js +84 -0
  152. package/dist/ui/components/overlays/SessionSelector.js +102 -0
  153. package/dist/ui/components/overlays/SoundSelector.js +86 -0
  154. package/dist/ui/components/overlays/ThemeSelector.js +139 -0
  155. package/dist/ui/components/overlays/index.js +15 -0
  156. package/dist/ui/components/permissions/BashPermissionRequest/BashPermissionRequest.js +53 -0
  157. package/dist/ui/components/permissions/FallbackPermissionRequest.js +56 -0
  158. package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +76 -0
  159. package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js +18 -0
  160. package/dist/ui/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +64 -0
  161. package/dist/ui/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js +26 -0
  162. package/dist/ui/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +141 -0
  163. package/dist/ui/components/permissions/PermissionRequest.js +70 -0
  164. package/dist/ui/components/permissions/PermissionRequestTitle.js +41 -0
  165. package/dist/ui/components/permissions/hooks.js +10 -0
  166. package/dist/ui/components/permissions/toolUseOptions.js +68 -0
  167. package/dist/ui/components/permissions/utils.js +10 -0
  168. package/dist/ui/components/text-input/Cursor.js +326 -0
  169. package/dist/ui/components/text-input/TextInput.js +231 -0
  170. package/dist/ui/components/text-input/imagePaste.js +28 -0
  171. package/dist/ui/components/text-input/index.js +6 -0
  172. package/dist/ui/components/text-input/useDoublePress.js +30 -0
  173. package/dist/ui/components/text-input/useTextInput.js +245 -0
  174. package/dist/ui/components/tool-types.js +9 -0
  175. package/dist/ui/constants/figures.js +4 -0
  176. package/dist/ui/constants/index.js +3 -0
  177. package/dist/ui/display-mode.js +93 -0
  178. package/dist/ui/display-policy.js +19 -0
  179. package/dist/ui/hooks/index.js +6 -0
  180. package/dist/ui/hooks/useCommandAutocomplete.js +93 -0
  181. package/dist/ui/hooks/useDoublePress.js +37 -0
  182. package/dist/ui/hooks/useIndicatorState.js +55 -0
  183. package/dist/ui/hooks/useInterval.js +23 -0
  184. package/dist/ui/hooks/useKeyboardShortcuts.js +127 -0
  185. package/dist/ui/hooks/useTerminalSize.js +55 -0
  186. package/dist/ui/hooks/useUnifiedMessages.js +117 -0
  187. package/dist/ui/indicator-state.js +44 -0
  188. package/dist/ui/markdown/highlight.js +44 -0
  189. package/dist/ui/markdown/index.js +1460 -0
  190. package/dist/ui/markdown/tokenizer.js +24 -0
  191. package/dist/ui/render-item.js +5 -0
  192. package/dist/ui/screens/REPL.js +119 -0
  193. package/dist/ui/screens/approval-lifecycle.js +38 -0
  194. package/dist/ui/status-line.js +72 -0
  195. package/dist/ui/theme/index.js +51 -0
  196. package/dist/ui/theme/themes/claude-dark-daltonized.js +51 -0
  197. package/dist/ui/theme/themes/claude-dark.js +50 -0
  198. package/dist/ui/theme/themes/claude-light-daltonized.js +51 -0
  199. package/dist/ui/theme/themes/claude-light.js +50 -0
  200. package/dist/ui/theme/themes/dark-accessible.js +18 -0
  201. package/dist/ui/theme/themes/dark.js +49 -0
  202. package/dist/ui/theme/themes/light-accessible.js +18 -0
  203. package/dist/ui/theme/themes/light.js +49 -0
  204. package/dist/ui/theme/types.js +3 -0
  205. package/dist/ui/theme.js +142 -0
  206. package/dist/ui/to-render-items.js +145 -0
  207. package/dist/ui/tools/AgentTool/index.js +30 -0
  208. package/dist/ui/tools/ArchitectTool/index.js +31 -0
  209. package/dist/ui/tools/AskUserTool/index.js +46 -0
  210. package/dist/ui/tools/BashTool/BashToolResultMessage.js +11 -0
  211. package/dist/ui/tools/BashTool/OutputLine.js +21 -0
  212. package/dist/ui/tools/BashTool/index.js +91 -0
  213. package/dist/ui/tools/BrowseTool/index.js +43 -0
  214. package/dist/ui/tools/BrowserTool/index.js +47 -0
  215. package/dist/ui/tools/CbmTool/index.js +188 -0
  216. package/dist/ui/tools/CheckDelegationTool/index.js +46 -0
  217. package/dist/ui/tools/CheckMessagesTool/index.js +85 -0
  218. package/dist/ui/tools/CreateQuipTool/index.js +30 -0
  219. package/dist/ui/tools/CreateSkillTool/index.js +22 -0
  220. package/dist/ui/tools/CreateToolTool/index.js +31 -0
  221. package/dist/ui/tools/DelegateRemoteTool/index.js +42 -0
  222. package/dist/ui/tools/DeployTool/index.js +47 -0
  223. package/dist/ui/tools/FffTool/index.js +103 -0
  224. package/dist/ui/tools/FileEditTool/index.js +67 -0
  225. package/dist/ui/tools/FileReadTool/index.js +68 -0
  226. package/dist/ui/tools/FileWriteTool/index.js +61 -0
  227. package/dist/ui/tools/ForkTool/index.js +47 -0
  228. package/dist/ui/tools/FrgTool/index.js +96 -0
  229. package/dist/ui/tools/GetThreadTool/index.js +39 -0
  230. package/dist/ui/tools/GlobTool/index.js +50 -0
  231. package/dist/ui/tools/GrepTool/index.js +84 -0
  232. package/dist/ui/tools/HatchArionTool/index.js +36 -0
  233. package/dist/ui/tools/LearnSkillTool/index.js +22 -0
  234. package/dist/ui/tools/LearnTool/index.js +43 -0
  235. package/dist/ui/tools/LearnToolTool/index.js +22 -0
  236. package/dist/ui/tools/ListClientsTool/index.js +39 -0
  237. package/dist/ui/tools/LspTool/index.js +261 -0
  238. package/dist/ui/tools/MCPTool/index.js +33 -0
  239. package/dist/ui/tools/ManageNetworkTool/index.js +53 -0
  240. package/dist/ui/tools/MemoryReadTool/index.js +64 -0
  241. package/dist/ui/tools/MemoryWriteTool/index.js +20 -0
  242. package/dist/ui/tools/NotebookEditTool/index.js +33 -0
  243. package/dist/ui/tools/NotebookReadTool/index.js +25 -0
  244. package/dist/ui/tools/OutlookReadTool/index.js +66 -0
  245. package/dist/ui/tools/OutlookReplyTool/index.js +49 -0
  246. package/dist/ui/tools/OutlookSendTool/index.js +49 -0
  247. package/dist/ui/tools/PauseDelegationTool/index.js +35 -0
  248. package/dist/ui/tools/ProbeTool/index.js +121 -0
  249. package/dist/ui/tools/ProcessTool/index.js +66 -0
  250. package/dist/ui/tools/QuestListTool/index.js +46 -0
  251. package/dist/ui/tools/QuestReportTool/index.js +49 -0
  252. package/dist/ui/tools/QuestUpdateTool/index.js +87 -0
  253. package/dist/ui/tools/QuipCommentTool/index.js +69 -0
  254. package/dist/ui/tools/QuipReadTool/index.js +71 -0
  255. package/dist/ui/tools/RestArionTool/index.js +32 -0
  256. package/dist/ui/tools/RestartTool/index.js +35 -0
  257. package/dist/ui/tools/ResumeDelegationTool/index.js +35 -0
  258. package/dist/ui/tools/RetireArionTool/index.js +32 -0
  259. package/dist/ui/tools/RgTool/index.js +73 -0
  260. package/dist/ui/tools/SearchKnowledgeTool/index.js +43 -0
  261. package/dist/ui/tools/SearchMessagesTool/index.js +43 -0
  262. package/dist/ui/tools/SelfDiagnoseTool/index.js +61 -0
  263. package/dist/ui/tools/SendMessageTool/index.js +45 -0
  264. package/dist/ui/tools/SerenaTool/index.js +124 -0
  265. package/dist/ui/tools/SessionHistoryTool/index.js +52 -0
  266. package/dist/ui/tools/SgTool/index.js +80 -0
  267. package/dist/ui/tools/SlackReactTool/index.js +41 -0
  268. package/dist/ui/tools/SlackReadTool/index.js +48 -0
  269. package/dist/ui/tools/SlackSendTool/index.js +45 -0
  270. package/dist/ui/tools/SpawnWorkerTool/index.js +33 -0
  271. package/dist/ui/tools/StickerRequestTool/index.js +19 -0
  272. package/dist/ui/tools/ThinkTool/index.js +17 -0
  273. package/dist/ui/tools/UgTool/index.js +108 -0
  274. package/dist/ui/tools/UseSkillTool/index.js +22 -0
  275. package/dist/ui/tools/WakeArionTool/index.js +32 -0
  276. package/dist/ui/tools/WebFetchTool/index.js +56 -0
  277. package/dist/ui/tools/WebSearchTool/index.js +44 -0
  278. package/dist/ui/tools/lsTool/index.js +58 -0
  279. package/dist/ui/tools/registry.js +197 -0
  280. package/dist/ui/tools/tool-renderer.js +11 -0
  281. package/dist/ui/tools/truncation.js +35 -0
  282. package/dist/ui/types/anthropic.js +4 -0
  283. package/dist/ui/types/index.js +2 -0
  284. package/dist/ui/types/message.js +3 -0
  285. package/dist/ui/types/tool.js +4 -0
  286. package/dist/ui/utils/array.js +4 -0
  287. package/dist/ui/utils/cursor.js +131 -0
  288. package/dist/ui/utils/diff.js +120 -0
  289. package/dist/ui/utils/format.js +42 -0
  290. package/dist/ui/utils/fuzzy.js +59 -0
  291. package/dist/ui/utils/index.js +11 -0
  292. package/dist/ui/utils/keys.js +8 -0
  293. package/dist/ui/utils/patch.js +17 -0
  294. package/dist/ui/utils/risk.js +114 -0
  295. package/dist/ui/utils/terminal-image.js +70 -0
  296. package/dist/ui/utils/validation.js +48 -0
  297. package/dist/ui/verb-pairs.js +248 -0
  298. package/dist/ui.js +131 -0
  299. package/package.json +73 -14
  300. package/src/entrypoints/command-mode.ts +5 -0
  301. package/src/entrypoints/daemon.ts +54 -0
  302. package/src/entrypoints/headless-stdio.ts +27 -0
  303. package/src/entrypoints/interactive.ts +112 -0
  304. package/src/main.ts +44 -0
  305. package/src/runtime/configure-bun-sqlite.ts +3 -0
  306. package/src/runtime/crash-handlers.ts +128 -0
  307. package/src/runtime/interactive-invocation.test.ts +42 -0
  308. package/src/runtime/interactive-invocation.ts +51 -0
  309. package/src/runtime/internal-mode.test.ts +19 -0
  310. package/src/runtime/internal-mode.ts +24 -0
  311. package/src/runtime/launch-spec.test.ts +26 -0
  312. package/src/runtime/launch-spec.ts +84 -0
  313. package/src/runtime/owner-lease.ts +52 -0
  314. package/src/runtime/public-mode.test.ts +18 -0
  315. package/src/runtime/public-mode.ts +19 -0
  316. package/src/runtime/run-internal-mode.ts +19 -0
  317. package/src/runtime/runtime-kind.test.ts +23 -0
  318. package/src/runtime/runtime-kind.ts +41 -0
  319. package/src/runtime/spawn-aria.ts +62 -0
@@ -0,0 +1,67 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
3
+ import { Box, Text } from "ink";
4
+ import { relative } from "path";
5
+ import { FileEditToolUpdatedMessage } from "../../components/FileEditToolUpdatedMessage.js";
6
+ import { safeFallbackText } from "../truncation.js";
7
+ export const FileEditToolRenderers = {
8
+ displayName(input) {
9
+ const oldStr = (input?.old_string ?? input?.oldText ?? "");
10
+ const newStr = (input?.new_string ?? input?.newText ?? "");
11
+ if (oldStr === "")
12
+ return "Create";
13
+ if (newStr === "")
14
+ return "Delete";
15
+ return "Edit";
16
+ },
17
+ renderInput(input, { verbose }) {
18
+ // edit_file / file_edit: { path, oldText, newText }
19
+ const filePath = String(input?.file_path ?? input?.path ?? "");
20
+ if (filePath) {
21
+ return verbose ? filePath : relative(process.cwd(), filePath);
22
+ }
23
+ // apply_patch: { patch, cwd? }
24
+ if (typeof input?.patch === "string") {
25
+ const patch = input.patch;
26
+ // Extract file names from patch header lines like "*** Update path/to/file"
27
+ const files = [...patch.matchAll(/^\*\*\*\s+(?:Update|Add|Delete|Rename)\s+(.+)$/gm)]
28
+ .map((m) => m[1] ?? "")
29
+ .filter(Boolean)
30
+ .slice(0, 3);
31
+ if (files.length > 0) {
32
+ return files.map((f) => (verbose ? f : relative(process.cwd(), f))).join(", ");
33
+ }
34
+ return "patch";
35
+ }
36
+ return "";
37
+ },
38
+ renderOutput(output, { verbose }) {
39
+ if (output == null) {
40
+ return _jsx(Text, { children: "(No content)" });
41
+ }
42
+ // Handle string output (typically error messages) — truncate to avoid flooding
43
+ if (typeof output === "string") {
44
+ return _jsx(Text, { children: safeFallbackText(output, verbose) });
45
+ }
46
+ const obj = output;
47
+ // Structured diff shape: { filePath|path, structuredPatch }
48
+ if (obj.structuredPatch) {
49
+ return (_jsx(FileEditToolUpdatedMessage, { filePath: (obj.filePath ?? obj.path), structuredPatch: obj.structuredPatch, verbose: verbose }));
50
+ }
51
+ // ARIA shape: { path, strategy, matchesFound, replacements, replaceAll, previousHash, currentHash }
52
+ if (obj.path != null) {
53
+ const filePath = verbose ? String(obj.path) : relative(process.cwd(), String(obj.path));
54
+ const replacements = obj.replacements != null ? Number(obj.replacements) : undefined;
55
+ const suffix = replacements != null
56
+ ? ` (${replacements} replacement${replacements !== 1 ? "s" : ""})`
57
+ : "";
58
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Text, { children: ["Edited ", _jsx(Text, { bold: true, children: filePath }), suffix] }) }) }));
59
+ }
60
+ // Default fallback
61
+ return _jsx(Text, { children: safeFallbackText(output, verbose) });
62
+ },
63
+ renderRejection() {
64
+ return _jsx(FallbackToolUseRejectedMessage, {});
65
+ },
66
+ };
67
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,68 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ import { extname, relative } from "path";
4
+ import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
5
+ import { HighlightedCode } from "../../components/HighlightedCode.js";
6
+ import { getTheme } from "../../theme/index.js";
7
+ import { capLines, safeFallbackText, MAX_VERBOSE_LINES } from "../truncation.js";
8
+ const MAX_LINES_TO_RENDER = 3;
9
+ export const FileReadToolRenderers = {
10
+ displayName() {
11
+ return "Read";
12
+ },
13
+ renderInput(input, { verbose }) {
14
+ const filePath = String(input?.file_path ?? input?.path ?? "");
15
+ const { file_path: _fp, path: _p, ...rest } = input;
16
+ const entries = [
17
+ ["path", verbose ? filePath : relative(process.cwd(), filePath)],
18
+ ...Object.entries(rest).filter(([k]) => k !== "file_path" && k !== "path"),
19
+ ];
20
+ return entries.map(([key, value]) => `${key}: ${JSON.stringify(value)}`).join(", ");
21
+ },
22
+ renderOutput(output, { verbose }, input) {
23
+ // ARIA's read_file returns a plain string (file content) for text files,
24
+ // or { type: "media", ... } for images. Legacy shape:
25
+ // { type: "text"|"image", file: { filePath, content, numLines } }.
26
+ const inputObj = (input ?? {});
27
+ const inputPath = String(inputObj.file_path ?? inputObj.path ?? "");
28
+ const langFromInput = inputPath ? extname(inputPath).slice(1) : "";
29
+ if (output == null) {
30
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: "(No content)" }) }) }));
31
+ }
32
+ // ARIA shape: plain string (file content)
33
+ if (typeof output === "string") {
34
+ const contentWithFallback = output || "(No content)";
35
+ const lines = contentWithFallback.split("\n");
36
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Box, { flexDirection: "column", children: [_jsx(HighlightedCode, { code: verbose
37
+ ? capLines(lines.slice(0, MAX_VERBOSE_LINES).join("\n"))
38
+ : capLines(lines
39
+ .slice(0, MAX_LINES_TO_RENDER)
40
+ .filter((_) => _.trim() !== "")
41
+ .join("\n")), language: langFromInput }), lines.length > (verbose ? MAX_VERBOSE_LINES : MAX_LINES_TO_RENDER) && (_jsxs(Text, { color: getTheme().colors.textMuted, children: ["... (+", lines.length - (verbose ? MAX_VERBOSE_LINES : MAX_LINES_TO_RENDER), " lines)"] }))] }) }) }));
42
+ }
43
+ // Object shapes
44
+ const obj = output;
45
+ // ARIA shape: { type: "media", ... } for images
46
+ if (obj.type === "media" || obj.type === "image") {
47
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: "Read image" }) }) }));
48
+ }
49
+ // Legacy shape: { type: "text", file: { filePath, content, numLines } }
50
+ if (obj.type === "text" && obj.file) {
51
+ const file = obj.file;
52
+ const contentWithFallback = file.content || "(No content)";
53
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Box, { flexDirection: "column", children: [_jsx(HighlightedCode, { code: verbose
54
+ ? contentWithFallback
55
+ : capLines(contentWithFallback
56
+ .split("\n")
57
+ .slice(0, MAX_LINES_TO_RENDER)
58
+ .filter((_) => _.trim() !== "")
59
+ .join("\n")), language: extname(file.filePath).slice(1) }), !verbose && file.numLines > MAX_LINES_TO_RENDER && (_jsxs(Text, { color: getTheme().colors.textMuted, children: ["... (+", file.numLines - MAX_LINES_TO_RENDER, " lines)"] }))] }) }) }));
60
+ }
61
+ // Default fallback: JSON.stringify
62
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: safeFallbackText(output, verbose) }) }) }));
63
+ },
64
+ renderRejection() {
65
+ return _jsx(FallbackToolUseRejectedMessage, {});
66
+ },
67
+ };
68
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,61 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
3
+ import { Box, Text } from "ink";
4
+ import { EOL } from "os";
5
+ import { extname, relative } from "path";
6
+ import { FileEditToolUpdatedMessage } from "../../components/FileEditToolUpdatedMessage.js";
7
+ import { HighlightedCode } from "../../components/HighlightedCode.js";
8
+ import { getTheme } from "../../theme/index.js";
9
+ import { capLines, safeFallbackText, MAX_VERBOSE_LINES } from "../truncation.js";
10
+ const MAX_LINES_TO_RENDER = 3;
11
+ export const FileWriteToolRenderers = {
12
+ displayName: () => "Write",
13
+ renderInput(input, { verbose }) {
14
+ const filePath = String(input?.file_path ?? input?.path ?? "");
15
+ if (!filePath)
16
+ return "";
17
+ const display = verbose ? filePath : relative(process.cwd(), filePath);
18
+ const bytes = typeof input?.content === "string" ? ` (${input.content.length} bytes)` : "";
19
+ return display + bytes;
20
+ },
21
+ renderRejection() {
22
+ return _jsx(FallbackToolUseRejectedMessage, {});
23
+ },
24
+ renderOutput(output, { verbose }) {
25
+ if (output == null) {
26
+ return _jsx(Text, { children: "(No content)" });
27
+ }
28
+ // Handle string output
29
+ if (typeof output === "string") {
30
+ return _jsx(Text, { children: safeFallbackText(output, verbose) });
31
+ }
32
+ const obj = output;
33
+ // Structured diff shape: overwrites/appends include structuredPatch from executor
34
+ if (obj.structuredPatch) {
35
+ return (_jsx(FileEditToolUpdatedMessage, { filePath: (obj.filePath ?? obj.path), structuredPatch: obj.structuredPatch, verbose: verbose }));
36
+ }
37
+ // ARIA shape without diff: new files { path, action: "created", bytesWritten }
38
+ if (obj.path != null && obj.action != null) {
39
+ const filePath = verbose ? String(obj.path) : relative(process.cwd(), String(obj.path));
40
+ const bytesWritten = obj.bytesWritten != null ? Number(obj.bytesWritten) : undefined;
41
+ const action = String(obj.action);
42
+ const sizeStr = bytesWritten != null ? `${bytesWritten} bytes to ` : "";
43
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Text, { children: ["Wrote ", sizeStr, _jsx(Text, { bold: true, children: filePath }), " (", action, ")"] }) }) }));
44
+ }
45
+ if (obj.type === "create" && obj.filePath != null) {
46
+ const content = obj.content || "";
47
+ const contentWithFallback = content || "(No content)";
48
+ const numLines = content.split(EOL).length;
49
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: ["Wrote ", numLines, " lines to", " ", _jsx(Text, { bold: true, children: verbose ? obj.filePath : relative(process.cwd(), obj.filePath) })] }), _jsxs(Box, { flexDirection: "column", paddingLeft: 5, children: [_jsx(HighlightedCode, { code: verbose
50
+ ? capLines(contentWithFallback.split("\n").slice(0, MAX_VERBOSE_LINES).join("\n"))
51
+ : capLines(contentWithFallback
52
+ .split("\n")
53
+ .slice(0, MAX_LINES_TO_RENDER)
54
+ .filter((_) => _.trim() !== "")
55
+ .join("\n")), language: extname(obj.filePath).slice(1) }), numLines > (verbose ? MAX_VERBOSE_LINES : MAX_LINES_TO_RENDER) && (_jsxs(Text, { color: getTheme().colors.textMuted, children: ["... (+", numLines - (verbose ? MAX_VERBOSE_LINES : MAX_LINES_TO_RENDER), " lines)"] }))] })] }));
56
+ }
57
+ // Default fallback
58
+ return _jsx(Text, { children: safeFallbackText(output, verbose) });
59
+ },
60
+ };
61
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
4
+ import { getTheme } from "../../theme/index.js";
5
+ import { safeFallbackText } from "../truncation.js";
6
+ export const ForkToolRenderers = {
7
+ displayName() {
8
+ return "Fork";
9
+ },
10
+ renderInput(input, _opts) {
11
+ const parts = [];
12
+ if (input.quests && input.quests.length > 0) {
13
+ parts.push(input.quests.join(", "));
14
+ }
15
+ if (input.mode) {
16
+ parts.push(`mode=${input.mode}`);
17
+ }
18
+ if (input.tier) {
19
+ parts.push(`tier=${input.tier}`);
20
+ }
21
+ if (input.maxCostPerSession !== undefined) {
22
+ parts.push(`budget=$${input.maxCostPerSession}`);
23
+ }
24
+ return parts.length > 0
25
+ ? parts.join(" · ")
26
+ : Object.entries(input)
27
+ .map(([key, value]) => `${key}: ${JSON.stringify(value)}`)
28
+ .join(", ");
29
+ },
30
+ renderRejection() {
31
+ return _jsx(FallbackToolUseRejectedMessage, {});
32
+ },
33
+ renderOutput(output, _opts) {
34
+ const theme = getTheme();
35
+ if (!output) {
36
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { color: theme.colors.textMuted, children: "(No content)" }) }) }));
37
+ }
38
+ if (typeof output === "string") {
39
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: safeFallbackText(output) }) }) }));
40
+ }
41
+ const { id, quests, mode } = output;
42
+ const modeLabel = mode === "fork" ? "forked history" : "clean";
43
+ const questCount = quests?.length ?? 0;
44
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", gap: 1, children: [_jsx(Text, { color: theme.colors.info, children: "\u2442" }), _jsx(Text, { children: "Forked clone " }), _jsx(Text, { bold: true, children: id || "unknown" })] }), _jsx(Box, { flexDirection: "row", paddingLeft: 4, gap: 1, children: _jsxs(Text, { color: theme.colors.textMuted, children: [questCount, " quest", questCount !== 1 ? "s" : "", " \u00B7 ", modeLabel] }) }), quests && quests.length > 0 && (_jsx(Box, { flexDirection: "row", paddingLeft: 4, children: _jsx(Text, { color: theme.colors.textMuted, children: quests.join(", ") }) }))] }));
45
+ },
46
+ };
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,96 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ import { relative } from "path";
4
+ import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
5
+ import { getTheme } from "../../theme/index.js";
6
+ export const FrgToolRenderers = {
7
+ displayName() {
8
+ return "FastRipgrep";
9
+ },
10
+ renderInput(input, { verbose }) {
11
+ const { command, pattern, path } = input;
12
+ if (command === "search" && pattern) {
13
+ const relativePath = path ? relative(process.cwd(), path) : undefined;
14
+ return `search "${pattern}"${relativePath || verbose ? ` in ${verbose && path ? path : relativePath || "."}` : ""}`;
15
+ }
16
+ if (command === "status") {
17
+ const relativePath = path ? relative(process.cwd(), path) : undefined;
18
+ return `status${relativePath || verbose ? ` for ${verbose && path ? path : relativePath || "."}` : ""}`;
19
+ }
20
+ if (command === "index" || command === "init") {
21
+ const relativePath = path ? relative(process.cwd(), path) : undefined;
22
+ return `${command}${relativePath || verbose ? ` at ${verbose && path ? path : relativePath || "."}` : ""}`;
23
+ }
24
+ if (command === "update") {
25
+ return `update index${path ? ` at ${verbose ? path : relative(process.cwd(), path)}` : ""}`;
26
+ }
27
+ return command;
28
+ },
29
+ renderRejection() {
30
+ return _jsx(FallbackToolUseRejectedMessage, {});
31
+ },
32
+ renderOutput(output) {
33
+ const theme = getTheme();
34
+ // Handle null/undefined
35
+ if (output == null) {
36
+ return _jsx(Text, { color: theme.colors.textMuted, children: "No output" });
37
+ }
38
+ // Handle string output
39
+ if (typeof output === "string") {
40
+ const lines = output.trim().split("\n");
41
+ return _jsx(Text, { color: theme.colors.textMuted, children: lines[0] });
42
+ }
43
+ // Handle object output
44
+ if (typeof output === "object" && !Array.isArray(output)) {
45
+ const obj = output;
46
+ // Search results: matches like rg (check BEFORE status — search responses also have `indexed` field)
47
+ if (Array.isArray(obj.matches)) {
48
+ const matches = obj.matches;
49
+ const files = new Set();
50
+ let totalMatches = 0;
51
+ for (const match of matches) {
52
+ if (typeof match.file === "string")
53
+ files.add(match.file);
54
+ else if (typeof match.path === "string")
55
+ files.add(match.path);
56
+ totalMatches++;
57
+ }
58
+ const numFiles = files.size;
59
+ if (numFiles === 0) {
60
+ return _jsx(Text, { color: theme.colors.textMuted, children: "No matches" });
61
+ }
62
+ return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { children: "Found " }), _jsx(Text, { bold: true, children: totalMatches }), _jsxs(Text, { children: [" ", totalMatches === 1 ? "match" : "matches", " in "] }), _jsx(Text, { bold: true, children: numFiles }), _jsxs(Text, { children: [" ", numFiles === 1 ? "file" : "files"] })] }));
63
+ }
64
+ // Count results: { counts: [...], total }
65
+ if (Array.isArray(obj.counts) && typeof obj.total === "number") {
66
+ const counts = obj.counts;
67
+ const total = obj.total;
68
+ const numFiles = counts.length;
69
+ if (numFiles === 0) {
70
+ return _jsx(Text, { color: theme.colors.textMuted, children: "No matches" });
71
+ }
72
+ return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { children: "Found " }), _jsx(Text, { bold: true, children: total }), _jsxs(Text, { children: [" ", total === 1 ? "match" : "matches", " in "] }), _jsx(Text, { bold: true, children: numFiles }), _jsxs(Text, { children: [" ", numFiles === 1 ? "file" : "files"] })] }));
73
+ }
74
+ // Status command: show index info (checked after matches/counts to avoid false hits)
75
+ if (typeof obj.indexed === "boolean" || typeof obj.files === "number") {
76
+ const indexed = obj.indexed === true;
77
+ const files = typeof obj.files === "number" ? obj.files : 0;
78
+ if (indexed) {
79
+ return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { children: "Index: " }), _jsx(Text, { bold: true, children: files }), _jsx(Text, { children: " files indexed" })] }));
80
+ }
81
+ else {
82
+ return _jsx(Text, { color: theme.colors.textMuted, children: "Not indexed" });
83
+ }
84
+ }
85
+ // Generic success/message response
86
+ if (typeof obj.message === "string") {
87
+ return _jsx(Text, { color: theme.colors.textMuted, children: obj.message });
88
+ }
89
+ // Fallback
90
+ return _jsx(Text, { color: theme.colors.textMuted, children: "Command completed" });
91
+ }
92
+ // Fallback for arrays or other types
93
+ return _jsx(Text, { color: theme.colors.textMuted, children: "Done" });
94
+ },
95
+ };
96
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
4
+ import { getTheme } from "../../theme/index.js";
5
+ export const GetThreadToolRenderers = {
6
+ displayName() {
7
+ return "Thread";
8
+ },
9
+ renderInput(input, { verbose } = {}) {
10
+ const messageId = String(input?.messageId ?? input?.message_id ?? "");
11
+ return messageId ? `messageId: ${messageId}` : "Get thread";
12
+ },
13
+ renderRejection() {
14
+ return _jsx(FallbackToolUseRejectedMessage, {});
15
+ },
16
+ renderOutput(output, { verbose } = {}) {
17
+ const theme = getTheme();
18
+ if (output == null) {
19
+ return _jsx(Text, { color: theme.colors.textMuted, children: "No messages in thread" });
20
+ }
21
+ const obj = (output ?? {});
22
+ // Extract messages from output.data
23
+ const data = (obj.data ?? obj);
24
+ const messages = Array.isArray(data.messages) ? data.messages : [];
25
+ if (!messages || messages.length === 0) {
26
+ return _jsx(Text, { color: theme.colors.textMuted, children: "No messages in thread" });
27
+ }
28
+ const count = messages.length;
29
+ const previewCount = Math.min(3, messages.length);
30
+ const previews = messages.slice(0, previewCount);
31
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: [count, " message", count !== 1 ? "s" : "", " in thread"] }), previews.length > 0 && (_jsx(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 2, children: previews.map((msg, idx) => {
32
+ const from = String(msg.from ?? msg.sender ?? "Unknown");
33
+ const content = String(msg.content ?? msg.text ?? "");
34
+ const truncated = content.length > 40 ? content.substring(0, 40) + "…" : content;
35
+ return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { bold: true, children: from }), _jsx(Text, { children: " " }), _jsx(Text, { color: theme.colors.textMuted, children: truncated })] }, idx));
36
+ }) })), messages.length > previewCount && (_jsx(Box, { marginTop: 1, paddingLeft: 2, children: _jsxs(Text, { color: theme.colors.textMuted, children: ["... and ", messages.length - previewCount, " more"] }) }))] }));
37
+ },
38
+ };
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,50 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ import { isAbsolute, relative, resolve } from "path";
4
+ import { Cost } from "../../components/Cost.js";
5
+ import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
6
+ export const GlobToolRenderers = {
7
+ displayName() {
8
+ return "Search";
9
+ },
10
+ renderInput({ pattern, path }, { verbose }) {
11
+ const absolutePath = path
12
+ ? isAbsolute(path)
13
+ ? path
14
+ : resolve(process.cwd(), path)
15
+ : undefined;
16
+ const relativePath = absolutePath ? relative(process.cwd(), absolutePath) : undefined;
17
+ return `pattern: "${pattern}"${relativePath || verbose ? `, path: "${verbose ? absolutePath : relativePath}"` : ""}`;
18
+ },
19
+ renderRejection() {
20
+ return _jsx(FallbackToolUseRejectedMessage, {});
21
+ },
22
+ renderOutput(output) {
23
+ // ARIA's glob returns string[] (file path array).
24
+ // Legacy shape: { numFiles, filenames, durationMs, truncated }.
25
+ // Also handle raw string for backward compatibility.
26
+ let numFiles = 0;
27
+ let durationMs = 0;
28
+ if (Array.isArray(output)) {
29
+ // ARIA shape: string[]
30
+ numFiles = output.length;
31
+ }
32
+ else if (typeof output === "string") {
33
+ try {
34
+ const parsed = JSON.parse(output);
35
+ numFiles = parsed.numFiles ?? 0;
36
+ durationMs = parsed.durationMs ?? 0;
37
+ }
38
+ catch {
39
+ numFiles = 0;
40
+ }
41
+ }
42
+ else if (output != null && typeof output === "object") {
43
+ const obj = output;
44
+ numFiles = typeof obj.numFiles === "number" ? obj.numFiles : 0;
45
+ durationMs = typeof obj.durationMs === "number" ? obj.durationMs : 0;
46
+ }
47
+ return (_jsxs(Box, { justifyContent: "space-between", width: "100%", children: [_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { children: "Found " }), _jsxs(Text, { bold: true, children: [numFiles, " "] }), _jsx(Text, { children: numFiles === 0 || numFiles > 1 ? "files" : "file" })] }), durationMs > 0 && _jsx(Cost, { costUSD: 0, durationMs: durationMs, debug: false })] }));
48
+ },
49
+ };
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,84 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ import { isAbsolute, relative, resolve } from "path";
4
+ import { Cost } from "../../components/Cost.js";
5
+ import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
6
+ export const GrepToolRenderers = {
7
+ displayName() {
8
+ return "Grep";
9
+ },
10
+ renderInput({ pattern, path, include }, { verbose }) {
11
+ const absolutePath = path
12
+ ? isAbsolute(path)
13
+ ? path
14
+ : resolve(process.cwd(), path)
15
+ : undefined;
16
+ const relativePath = absolutePath ? relative(process.cwd(), absolutePath) : undefined;
17
+ return `pattern: "${pattern}"${relativePath || verbose ? `, path: "${verbose ? absolutePath : relativePath}"` : ""}${include ? `, include: "${include}"` : ""}`;
18
+ },
19
+ renderRejection() {
20
+ return _jsx(FallbackToolUseRejectedMessage, {});
21
+ },
22
+ renderOutput(output) {
23
+ // ARIA's grep returns { matches: GrepMatch[], truncated? } where each match has a `file` field.
24
+ // Legacy shape: { numFiles, durationMs }.
25
+ // Also handle array output or string.
26
+ let numMatches = 0;
27
+ let numFiles = 0;
28
+ let durationMs = 0;
29
+ let truncated = false;
30
+ const fileNames = [];
31
+ if (output != null && typeof output === "object" && !Array.isArray(output)) {
32
+ const obj = output;
33
+ if (Array.isArray(obj.matches)) {
34
+ // ARIA shape: { matches: [...], truncated? }
35
+ const files = new Set();
36
+ for (const match of obj.matches) {
37
+ const m = match;
38
+ const f = typeof m.filePath === "string"
39
+ ? m.filePath
40
+ : typeof m.file === "string"
41
+ ? m.file
42
+ : typeof m.path === "string"
43
+ ? m.path
44
+ : undefined;
45
+ if (f)
46
+ files.add(f);
47
+ }
48
+ numMatches = obj.matches.length;
49
+ numFiles = files.size;
50
+ truncated = !!obj.truncated;
51
+ for (const f of files)
52
+ fileNames.push(relative(process.cwd(), f));
53
+ }
54
+ else if (typeof obj.numFiles === "number") {
55
+ numFiles = obj.numFiles;
56
+ durationMs = typeof obj.durationMs === "number" ? obj.durationMs : 0;
57
+ }
58
+ }
59
+ else if (Array.isArray(output)) {
60
+ const files = new Set();
61
+ for (const match of output) {
62
+ if (match != null && typeof match === "object") {
63
+ const m = match;
64
+ const f = typeof m.filePath === "string"
65
+ ? m.filePath
66
+ : typeof m.file === "string"
67
+ ? m.file
68
+ : typeof m.path === "string"
69
+ ? m.path
70
+ : undefined;
71
+ if (f)
72
+ files.add(f);
73
+ }
74
+ }
75
+ numMatches = output.length;
76
+ numFiles = files.size || output.length;
77
+ for (const f of files)
78
+ fileNames.push(relative(process.cwd(), f));
79
+ }
80
+ const MAX_FILES = 4;
81
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { bold: true, children: [numMatches, " "] }), _jsxs(Text, { children: [numMatches === 1 ? "match" : "matches", " in "] }), _jsxs(Text, { bold: true, children: [numFiles, " "] }), _jsx(Text, { children: numFiles === 1 ? "file" : "files" }), truncated && _jsx(Text, { color: "yellow", children: " (truncated)" }), durationMs > 0 && _jsx(Cost, { costUSD: 0, durationMs: durationMs, debug: false })] }), fileNames.slice(0, MAX_FILES).map((f, i) => (_jsx(Box, { paddingLeft: 2, children: _jsx(Text, { dimColor: true, children: f }) }, i))), fileNames.length > MAX_FILES && (_jsx(Box, { paddingLeft: 2, children: _jsxs(Text, { dimColor: true, children: ["+", fileNames.length - MAX_FILES, " more files"] }) }))] }));
82
+ },
83
+ };
84
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
4
+ import { getTheme } from "../../theme/index.js";
5
+ import { safeFallbackText } from "../truncation.js";
6
+ export const HatchArionToolRenderers = {
7
+ displayName() {
8
+ return "Hatch Arion";
9
+ },
10
+ renderInput(input, _opts) {
11
+ if (input.name) {
12
+ return `${input.name}`;
13
+ }
14
+ return Object.entries(input)
15
+ .map(([key, value]) => `${key}: ${JSON.stringify(value)}`)
16
+ .join(", ");
17
+ },
18
+ renderRejection() {
19
+ return _jsx(FallbackToolUseRejectedMessage, {});
20
+ },
21
+ renderOutput(output, _opts) {
22
+ const theme = getTheme();
23
+ if (!output) {
24
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { color: theme.colors.textMuted, children: "(No content)" }) }) }));
25
+ }
26
+ if (typeof output === "string") {
27
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { color: theme.colors.success, children: output.includes("hatched")
28
+ ? safeFallbackText(output)
29
+ : `${safeFallbackText(output)} has hatched!` }) }) }));
30
+ }
31
+ const emoji = output.emoji || "";
32
+ const name = output.name || "Arion";
33
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Text, { color: theme.colors.success, children: [emoji, emoji ? " " : "", name, " has hatched!"] }) }) }));
34
+ },
35
+ };
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
4
+ export const LearnSkillToolRenderers = {
5
+ displayName() {
6
+ return "Learn Skill";
7
+ },
8
+ renderInput(input, _opts) {
9
+ return input.name ?? "skill";
10
+ },
11
+ renderRejection() {
12
+ return _jsx(FallbackToolUseRejectedMessage, {});
13
+ },
14
+ renderOutput(output) {
15
+ if (!output || typeof output !== "object") {
16
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: "(No content)" }) }) }));
17
+ }
18
+ const name = output.name ?? "unknown";
19
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Text, { children: ["Learned skill ", name] }) }) }));
20
+ },
21
+ };
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
4
+ import { safeFallbackText } from "../truncation.js";
5
+ export const LearnToolRenderers = {
6
+ displayName() {
7
+ return "Learn";
8
+ },
9
+ renderInput(input, _opts) {
10
+ // Handle source as string or object { type, command/path }
11
+ let sourceStr;
12
+ if (typeof input.source === "string") {
13
+ sourceStr = input.source;
14
+ }
15
+ else if (input.source && typeof input.source === "object") {
16
+ sourceStr = input.source.type || input.source.command || input.source.path || "unknown";
17
+ }
18
+ else {
19
+ sourceStr = "unknown";
20
+ }
21
+ const name = input.name ?? "";
22
+ return name ? `${sourceStr}: ${name}` : sourceStr;
23
+ },
24
+ renderRejection() {
25
+ return _jsx(FallbackToolUseRejectedMessage, {});
26
+ },
27
+ renderOutput(output) {
28
+ // Handle null/undefined
29
+ if (output == null) {
30
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: "Learned" }) }) }));
31
+ }
32
+ // Handle string
33
+ if (typeof output === "string") {
34
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: safeFallbackText(output) }) }) }));
35
+ }
36
+ const obj = output;
37
+ const name = obj.name ?? "unknown";
38
+ const type = obj.type ?? "";
39
+ const suffix = type ? ` ${type}` : "";
40
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Text, { children: ["Learned", suffix, " ", name] }) }) }));
41
+ },
42
+ };
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
4
+ export const LearnToolToolRenderers = {
5
+ displayName() {
6
+ return "Learn Tool";
7
+ },
8
+ renderInput(input, _opts) {
9
+ return input.name ?? "tool";
10
+ },
11
+ renderRejection() {
12
+ return _jsx(FallbackToolUseRejectedMessage, {});
13
+ },
14
+ renderOutput(output) {
15
+ if (!output || typeof output !== "object") {
16
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsx(Text, { children: "(No content)" }) }) }));
17
+ }
18
+ const name = output.name ?? "unknown";
19
+ return (_jsx(Box, { justifyContent: "space-between", overflowX: "hidden", width: "100%", children: _jsx(Box, { flexDirection: "row", children: _jsxs(Text, { children: ["Learned tool ", name] }) }) }));
20
+ },
21
+ };
22
+ //# sourceMappingURL=index.js.map