@aria-cli/cli 1.0.57 → 1.0.59

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 +799 -668
  2. package/package.json +17 -76
  3. package/dist/.tsbuildinfo +0 -1
  4. package/dist/attached-local-control-client.js +0 -826
  5. package/dist/bootstrap-local-control-client.js +0 -2
  6. package/dist/capability-aware-method-proxy.js +0 -42
  7. package/dist/cli-context.js +0 -160
  8. package/dist/commands/arions.js +0 -174
  9. package/dist/commands/auth.js +0 -123
  10. package/dist/commands/daemon.js +0 -367
  11. package/dist/commands/definitions.js +0 -176
  12. package/dist/commands/index.js +0 -80
  13. package/dist/commands/login-handler.js +0 -1108
  14. package/dist/commands/logout-handler.js +0 -92
  15. package/dist/commands/memory-handlers.js +0 -89
  16. package/dist/commands/pairing.js +0 -60
  17. package/dist/commands/runtime-cutover-reset-command.js +0 -12
  18. package/dist/commands/runtime-cutover-reset.js +0 -265
  19. package/dist/commands/terminal-setup.js +0 -84
  20. package/dist/config/aria-config.js +0 -238
  21. package/dist/config/index.js +0 -3
  22. package/dist/config/loader.js +0 -97
  23. package/dist/config.js +0 -142
  24. package/dist/daemon-info.js +0 -10
  25. package/dist/ensure-daemon.js +0 -128
  26. package/dist/entrypoints/command-mode.js +0 -5
  27. package/dist/entrypoints/daemon.js +0 -50
  28. package/dist/entrypoints/headless-stdio.js +0 -25
  29. package/dist/entrypoints/interactive.js +0 -80
  30. package/dist/event-loop-watchdog.js +0 -73
  31. package/dist/headless/auth-orchestrator.js +0 -508
  32. package/dist/headless/auth-service.js +0 -43
  33. package/dist/headless/bootstrap-fast-path.js +0 -112
  34. package/dist/headless/call-command.js +0 -143
  35. package/dist/headless/daemon-service.js +0 -318
  36. package/dist/headless/hook-actions.js +0 -235
  37. package/dist/headless/hook-service.js +0 -42
  38. package/dist/headless/kernel-services.js +0 -216
  39. package/dist/headless/kernel.js +0 -785
  40. package/dist/headless/operations/arion.js +0 -119
  41. package/dist/headless/operations/auth.js +0 -45
  42. package/dist/headless/operations/client.js +0 -31
  43. package/dist/headless/operations/config.js +0 -69
  44. package/dist/headless/operations/daemon.js +0 -47
  45. package/dist/headless/operations/hook.js +0 -56
  46. package/dist/headless/operations/index.js +0 -11
  47. package/dist/headless/operations/memory.js +0 -102
  48. package/dist/headless/operations/message.js +0 -279
  49. package/dist/headless/operations/model.js +0 -100
  50. package/dist/headless/operations/peer.js +0 -56
  51. package/dist/headless/operations/run.js +0 -24
  52. package/dist/headless/operations/session.js +0 -90
  53. package/dist/headless/operations/system.js +0 -19
  54. package/dist/headless/operations/utils.js +0 -35
  55. package/dist/headless/run-orchestrator.js +0 -703
  56. package/dist/headless/stdio-server.js +0 -439
  57. package/dist/history/SessionHistory.js +0 -8
  58. package/dist/history/SessionHistoryClient.js +0 -186
  59. package/dist/history/conversation-message.js +0 -112
  60. package/dist/history/index.js +0 -8
  61. package/dist/history/jsonl-replay.js +0 -154
  62. package/dist/history/repair-tool-pairing.js +0 -84
  63. package/dist/history/stall-phase-bridge.js +0 -11
  64. package/dist/history/turn-accumulator.js +0 -427
  65. package/dist/index.js +0 -7
  66. package/dist/ink-repl.js +0 -4183
  67. package/dist/local-control-bootstrap.js +0 -26
  68. package/dist/local-control-client.js +0 -2
  69. package/dist/local-control-error-reporting.js +0 -34
  70. package/dist/local-control-http-client.js +0 -362
  71. package/dist/local-control-lazy-wrapper.js +0 -363
  72. package/dist/local-control-manager.js +0 -146
  73. package/dist/main.js +0 -62
  74. package/dist/network-security.js +0 -62
  75. package/dist/networking-server.js +0 -38
  76. package/dist/peer-identity.js +0 -23
  77. package/dist/polling-subscription.js +0 -34
  78. package/dist/relaunch.js +0 -617
  79. package/dist/release-notes.js +0 -35
  80. package/dist/repl-cleanup.js +0 -47
  81. package/dist/runtime/configure-bun-sqlite.js +0 -3
  82. package/dist/runtime/crash-handlers.js +0 -111
  83. package/dist/runtime/interactive-invocation.js +0 -39
  84. package/dist/runtime/internal-mode.js +0 -14
  85. package/dist/runtime/launch-spec.js +0 -64
  86. package/dist/runtime/owner-lease.js +0 -44
  87. package/dist/runtime/public-mode.js +0 -20
  88. package/dist/runtime/run-internal-mode.js +0 -18
  89. package/dist/runtime/runtime-kind.js +0 -32
  90. package/dist/runtime/spawn-aria.js +0 -38
  91. package/dist/selectable-client.js +0 -2
  92. package/dist/selectable-peer.js +0 -2
  93. package/dist/session.js +0 -203
  94. package/dist/slash-commands.js +0 -80
  95. package/dist/sounds.js +0 -210
  96. package/dist/ui/App.js +0 -526
  97. package/dist/ui/components/AnthropicMethodPicker.js +0 -6
  98. package/dist/ui/components/ArionPrompt.js +0 -15
  99. package/dist/ui/components/AutocompleteDropdown.js +0 -23
  100. package/dist/ui/components/AutonomySelector.js +0 -55
  101. package/dist/ui/components/Banner.js +0 -98
  102. package/dist/ui/components/ConversationHistory.js +0 -175
  103. package/dist/ui/components/CopilotDeviceLoginFlow.js +0 -88
  104. package/dist/ui/components/CopilotSourcePicker.js +0 -50
  105. package/dist/ui/components/Cost.js +0 -10
  106. package/dist/ui/components/CustomSelect/option-map.js +0 -30
  107. package/dist/ui/components/CustomSelect/select-option.js +0 -13
  108. package/dist/ui/components/CustomSelect/select.js +0 -42
  109. package/dist/ui/components/CustomSelect/use-select-state.js +0 -179
  110. package/dist/ui/components/CustomSelect/use-select.js +0 -15
  111. package/dist/ui/components/ErrorDisplay.js +0 -35
  112. package/dist/ui/components/FallbackToolUseRejectedMessage.js +0 -7
  113. package/dist/ui/components/FileEditToolUpdatedMessage.js +0 -57
  114. package/dist/ui/components/HandoffMarker.js +0 -18
  115. package/dist/ui/components/HighlightedCode.js +0 -21
  116. package/dist/ui/components/InputArea.js +0 -187
  117. package/dist/ui/components/Message.js +0 -25
  118. package/dist/ui/components/OAuthLoginFlow.js +0 -113
  119. package/dist/ui/components/OutputTruncation.js +0 -35
  120. package/dist/ui/components/PermissionPrompt.js +0 -79
  121. package/dist/ui/components/PipelineTimingPanel.js +0 -15
  122. package/dist/ui/components/ProviderMethodPicker.js +0 -61
  123. package/dist/ui/components/ProviderPicker.js +0 -63
  124. package/dist/ui/components/RenderItemView.js +0 -71
  125. package/dist/ui/components/Spinner.js +0 -46
  126. package/dist/ui/components/StatusBar.js +0 -95
  127. package/dist/ui/components/StreamingIndicator.js +0 -55
  128. package/dist/ui/components/StructuredDiff.js +0 -168
  129. package/dist/ui/components/TextInputOverlay.js +0 -43
  130. package/dist/ui/components/ThinkingBlock.js +0 -82
  131. package/dist/ui/components/ToolCost.js +0 -17
  132. package/dist/ui/components/ToolExecution.js +0 -61
  133. package/dist/ui/components/ToolHeader.js +0 -51
  134. package/dist/ui/components/ToolRenderLayoutContext.js +0 -14
  135. package/dist/ui/components/ToolResultWrapper.js +0 -6
  136. package/dist/ui/components/ToolUseLoader.js +0 -35
  137. package/dist/ui/components/TraceWaterfall.js +0 -91
  138. package/dist/ui/components/index.js +0 -33
  139. package/dist/ui/components/messages/AssistantTextMessage.js +0 -25
  140. package/dist/ui/components/messages/UserImageMessage.js +0 -12
  141. package/dist/ui/components/messages/UserTextMessage.js +0 -12
  142. package/dist/ui/components/overlays/ArionSelector.js +0 -68
  143. package/dist/ui/components/overlays/ClientSelector.js +0 -62
  144. package/dist/ui/components/overlays/CommandPalette.js +0 -67
  145. package/dist/ui/components/overlays/DaemonControl.js +0 -87
  146. package/dist/ui/components/overlays/InviteShareOverlay.js +0 -15
  147. package/dist/ui/components/overlays/JoinInviteOverlay.js +0 -32
  148. package/dist/ui/components/overlays/MemoryBrowser.js +0 -100
  149. package/dist/ui/components/overlays/MessageSelector.js +0 -123
  150. package/dist/ui/components/overlays/ModelSelector.js +0 -211
  151. package/dist/ui/components/overlays/PairRequestOverlay.js +0 -42
  152. package/dist/ui/components/overlays/PeerSelector.js +0 -84
  153. package/dist/ui/components/overlays/SessionSelector.js +0 -102
  154. package/dist/ui/components/overlays/SoundSelector.js +0 -86
  155. package/dist/ui/components/overlays/ThemeSelector.js +0 -139
  156. package/dist/ui/components/overlays/index.js +0 -15
  157. package/dist/ui/components/permissions/BashPermissionRequest/BashPermissionRequest.js +0 -53
  158. package/dist/ui/components/permissions/FallbackPermissionRequest.js +0 -56
  159. package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +0 -76
  160. package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js +0 -18
  161. package/dist/ui/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +0 -64
  162. package/dist/ui/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js +0 -26
  163. package/dist/ui/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +0 -141
  164. package/dist/ui/components/permissions/PermissionRequest.js +0 -70
  165. package/dist/ui/components/permissions/PermissionRequestTitle.js +0 -41
  166. package/dist/ui/components/permissions/hooks.js +0 -10
  167. package/dist/ui/components/permissions/toolUseOptions.js +0 -68
  168. package/dist/ui/components/permissions/utils.js +0 -10
  169. package/dist/ui/components/text-input/Cursor.js +0 -326
  170. package/dist/ui/components/text-input/TextInput.js +0 -231
  171. package/dist/ui/components/text-input/imagePaste.js +0 -28
  172. package/dist/ui/components/text-input/index.js +0 -6
  173. package/dist/ui/components/text-input/useDoublePress.js +0 -30
  174. package/dist/ui/components/text-input/useTextInput.js +0 -245
  175. package/dist/ui/components/tool-types.js +0 -9
  176. package/dist/ui/constants/figures.js +0 -4
  177. package/dist/ui/constants/index.js +0 -3
  178. package/dist/ui/display-mode.js +0 -93
  179. package/dist/ui/display-policy.js +0 -19
  180. package/dist/ui/hooks/index.js +0 -6
  181. package/dist/ui/hooks/useCommandAutocomplete.js +0 -93
  182. package/dist/ui/hooks/useDoublePress.js +0 -37
  183. package/dist/ui/hooks/useIndicatorState.js +0 -55
  184. package/dist/ui/hooks/useInterval.js +0 -23
  185. package/dist/ui/hooks/useKeyboardShortcuts.js +0 -127
  186. package/dist/ui/hooks/useTerminalSize.js +0 -55
  187. package/dist/ui/hooks/useUnifiedMessages.js +0 -117
  188. package/dist/ui/indicator-state.js +0 -44
  189. package/dist/ui/markdown/highlight.js +0 -44
  190. package/dist/ui/markdown/index.js +0 -1460
  191. package/dist/ui/markdown/tokenizer.js +0 -24
  192. package/dist/ui/render-item.js +0 -5
  193. package/dist/ui/screens/REPL.js +0 -119
  194. package/dist/ui/screens/approval-lifecycle.js +0 -38
  195. package/dist/ui/status-line.js +0 -72
  196. package/dist/ui/theme/index.js +0 -51
  197. package/dist/ui/theme/themes/claude-dark-daltonized.js +0 -51
  198. package/dist/ui/theme/themes/claude-dark.js +0 -50
  199. package/dist/ui/theme/themes/claude-light-daltonized.js +0 -51
  200. package/dist/ui/theme/themes/claude-light.js +0 -50
  201. package/dist/ui/theme/themes/dark-accessible.js +0 -18
  202. package/dist/ui/theme/themes/dark.js +0 -49
  203. package/dist/ui/theme/themes/light-accessible.js +0 -18
  204. package/dist/ui/theme/themes/light.js +0 -49
  205. package/dist/ui/theme/types.js +0 -3
  206. package/dist/ui/theme.js +0 -142
  207. package/dist/ui/to-render-items.js +0 -145
  208. package/dist/ui/tools/AgentTool/index.js +0 -30
  209. package/dist/ui/tools/ArchitectTool/index.js +0 -31
  210. package/dist/ui/tools/AskUserTool/index.js +0 -46
  211. package/dist/ui/tools/BashTool/BashToolResultMessage.js +0 -11
  212. package/dist/ui/tools/BashTool/OutputLine.js +0 -21
  213. package/dist/ui/tools/BashTool/index.js +0 -91
  214. package/dist/ui/tools/BrowseTool/index.js +0 -43
  215. package/dist/ui/tools/BrowserTool/index.js +0 -47
  216. package/dist/ui/tools/CbmTool/index.js +0 -188
  217. package/dist/ui/tools/CheckDelegationTool/index.js +0 -46
  218. package/dist/ui/tools/CheckMessagesTool/index.js +0 -85
  219. package/dist/ui/tools/CreateQuipTool/index.js +0 -30
  220. package/dist/ui/tools/CreateSkillTool/index.js +0 -22
  221. package/dist/ui/tools/CreateToolTool/index.js +0 -31
  222. package/dist/ui/tools/DelegateRemoteTool/index.js +0 -42
  223. package/dist/ui/tools/DeployTool/index.js +0 -47
  224. package/dist/ui/tools/FffTool/index.js +0 -103
  225. package/dist/ui/tools/FileEditTool/index.js +0 -67
  226. package/dist/ui/tools/FileReadTool/index.js +0 -68
  227. package/dist/ui/tools/FileWriteTool/index.js +0 -61
  228. package/dist/ui/tools/ForkTool/index.js +0 -47
  229. package/dist/ui/tools/FrgTool/index.js +0 -96
  230. package/dist/ui/tools/GetThreadTool/index.js +0 -39
  231. package/dist/ui/tools/GlobTool/index.js +0 -50
  232. package/dist/ui/tools/GrepTool/index.js +0 -84
  233. package/dist/ui/tools/HatchArionTool/index.js +0 -36
  234. package/dist/ui/tools/LearnSkillTool/index.js +0 -22
  235. package/dist/ui/tools/LearnTool/index.js +0 -43
  236. package/dist/ui/tools/LearnToolTool/index.js +0 -22
  237. package/dist/ui/tools/ListClientsTool/index.js +0 -39
  238. package/dist/ui/tools/LspTool/index.js +0 -261
  239. package/dist/ui/tools/MCPTool/index.js +0 -33
  240. package/dist/ui/tools/ManageNetworkTool/index.js +0 -53
  241. package/dist/ui/tools/MemoryReadTool/index.js +0 -64
  242. package/dist/ui/tools/MemoryWriteTool/index.js +0 -20
  243. package/dist/ui/tools/NotebookEditTool/index.js +0 -33
  244. package/dist/ui/tools/NotebookReadTool/index.js +0 -25
  245. package/dist/ui/tools/OutlookReadTool/index.js +0 -66
  246. package/dist/ui/tools/OutlookReplyTool/index.js +0 -49
  247. package/dist/ui/tools/OutlookSendTool/index.js +0 -49
  248. package/dist/ui/tools/PauseDelegationTool/index.js +0 -35
  249. package/dist/ui/tools/ProbeTool/index.js +0 -121
  250. package/dist/ui/tools/ProcessTool/index.js +0 -66
  251. package/dist/ui/tools/QuestListTool/index.js +0 -46
  252. package/dist/ui/tools/QuestReportTool/index.js +0 -49
  253. package/dist/ui/tools/QuestUpdateTool/index.js +0 -87
  254. package/dist/ui/tools/QuipCommentTool/index.js +0 -69
  255. package/dist/ui/tools/QuipReadTool/index.js +0 -71
  256. package/dist/ui/tools/RestArionTool/index.js +0 -32
  257. package/dist/ui/tools/RestartTool/index.js +0 -35
  258. package/dist/ui/tools/ResumeDelegationTool/index.js +0 -35
  259. package/dist/ui/tools/RetireArionTool/index.js +0 -32
  260. package/dist/ui/tools/RgTool/index.js +0 -73
  261. package/dist/ui/tools/SearchKnowledgeTool/index.js +0 -43
  262. package/dist/ui/tools/SearchMessagesTool/index.js +0 -43
  263. package/dist/ui/tools/SelfDiagnoseTool/index.js +0 -61
  264. package/dist/ui/tools/SendMessageTool/index.js +0 -45
  265. package/dist/ui/tools/SerenaTool/index.js +0 -124
  266. package/dist/ui/tools/SessionHistoryTool/index.js +0 -52
  267. package/dist/ui/tools/SgTool/index.js +0 -80
  268. package/dist/ui/tools/SlackReactTool/index.js +0 -41
  269. package/dist/ui/tools/SlackReadTool/index.js +0 -48
  270. package/dist/ui/tools/SlackSendTool/index.js +0 -45
  271. package/dist/ui/tools/SpawnWorkerTool/index.js +0 -33
  272. package/dist/ui/tools/StickerRequestTool/index.js +0 -19
  273. package/dist/ui/tools/ThinkTool/index.js +0 -17
  274. package/dist/ui/tools/UgTool/index.js +0 -108
  275. package/dist/ui/tools/UseSkillTool/index.js +0 -22
  276. package/dist/ui/tools/WakeArionTool/index.js +0 -32
  277. package/dist/ui/tools/WebFetchTool/index.js +0 -56
  278. package/dist/ui/tools/WebSearchTool/index.js +0 -44
  279. package/dist/ui/tools/lsTool/index.js +0 -58
  280. package/dist/ui/tools/registry.js +0 -197
  281. package/dist/ui/tools/tool-renderer.js +0 -11
  282. package/dist/ui/tools/truncation.js +0 -35
  283. package/dist/ui/types/anthropic.js +0 -4
  284. package/dist/ui/types/index.js +0 -2
  285. package/dist/ui/types/message.js +0 -3
  286. package/dist/ui/types/tool.js +0 -4
  287. package/dist/ui/utils/array.js +0 -4
  288. package/dist/ui/utils/cursor.js +0 -131
  289. package/dist/ui/utils/diff.js +0 -120
  290. package/dist/ui/utils/format.js +0 -42
  291. package/dist/ui/utils/fuzzy.js +0 -59
  292. package/dist/ui/utils/index.js +0 -11
  293. package/dist/ui/utils/keys.js +0 -8
  294. package/dist/ui/utils/patch.js +0 -17
  295. package/dist/ui/utils/risk.js +0 -114
  296. package/dist/ui/utils/terminal-image.js +0 -70
  297. package/dist/ui/utils/validation.js +0 -48
  298. package/dist/ui/verb-pairs.js +0 -248
  299. package/dist/ui.js +0 -131
  300. package/src/entrypoints/command-mode.ts +0 -5
  301. package/src/entrypoints/daemon.ts +0 -54
  302. package/src/entrypoints/headless-stdio.ts +0 -27
  303. package/src/entrypoints/interactive.ts +0 -112
  304. package/src/main.ts +0 -72
  305. package/src/runtime/configure-bun-sqlite.ts +0 -3
  306. package/src/runtime/crash-handlers.ts +0 -128
  307. package/src/runtime/interactive-invocation.test.ts +0 -42
  308. package/src/runtime/interactive-invocation.ts +0 -51
  309. package/src/runtime/internal-mode.test.ts +0 -19
  310. package/src/runtime/internal-mode.ts +0 -24
  311. package/src/runtime/launch-spec.test.ts +0 -26
  312. package/src/runtime/launch-spec.ts +0 -84
  313. package/src/runtime/owner-lease.ts +0 -52
  314. package/src/runtime/public-mode.test.ts +0 -18
  315. package/src/runtime/public-mode.ts +0 -19
  316. package/src/runtime/run-internal-mode.ts +0 -19
  317. package/src/runtime/runtime-kind.test.ts +0 -23
  318. package/src/runtime/runtime-kind.ts +0 -41
  319. package/src/runtime/spawn-aria.ts +0 -62
@@ -1,168 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // Core rendering internals (formatDiff, numberDiffLines, LineNumber, HunkDiff)
3
- // with these mechanical substitutions:
4
- // - import { getTheme, ThemeNames } from '../utils/theme' → import { getTheme } from '../theme/index.js'
5
- // - import { wrapText } from '../utils/format' → inlined verbatim
6
- // - theme.secondaryText → theme.colors.textMuted
7
- // - theme.text → theme.colors.text
8
- // - theme.diff.added → theme.colors.diffAdded
9
- // - theme.diff.removed → theme.colors.diffRemoved
10
- // - theme.diff.addedDimmed → theme.colors.diffAddedDimmed
11
- // - theme.diff.removedDimmed → theme.colors.diffRemovedDimmed
12
- // - ThemeNames → string (inlined)
13
- //
14
- // Public exports (StructuredDiff, CompactDiff) accept ARIA's FileDiff interface
15
- // and convert to Hunk format internally.
16
- import { Box, Text } from "ink";
17
- import * as React from "react";
18
- import { useMemo } from "react";
19
- import { getTheme } from "../theme/index.js";
20
- // ── wrapText ──
21
- export function wrapText(text, width) {
22
- const lines = [];
23
- let currentLine = "";
24
- for (const char of text) {
25
- // Important: we need the spread to properly count multi-plane UTF-8 characters (eg. 𑚖)
26
- if ([...currentLine].length < width) {
27
- currentLine += char;
28
- }
29
- else {
30
- lines.push(currentLine);
31
- currentLine = char;
32
- }
33
- }
34
- if (currentLine)
35
- lines.push(currentLine);
36
- return lines;
37
- }
38
- // ── Core rendering (with theme substitutions) ──
39
- /** Hunk-based diff component */
40
- function HunkDiff({ patch, dim, width, overrideTheme, }) {
41
- const diff = useMemo(() => formatDiff(patch.lines, patch.oldStart, width, dim, overrideTheme), [patch.lines, patch.oldStart, width, dim, overrideTheme]);
42
- return diff.map((_, i) => _jsx(Box, { children: _ }, i));
43
- }
44
- function formatDiff(lines, startingLineNumber, width, dim, overrideTheme) {
45
- const theme = getTheme();
46
- const ls = numberDiffLines(lines.map((code) => {
47
- if (code.startsWith("+")) {
48
- return {
49
- code: "+" + code.slice(1),
50
- i: 0,
51
- type: "add",
52
- };
53
- }
54
- if (code.startsWith("-")) {
55
- return {
56
- code: "-" + code.slice(1),
57
- i: 0,
58
- type: "remove",
59
- };
60
- }
61
- return { code, i: 0, type: "nochange" };
62
- }), startingLineNumber);
63
- const maxLineNumber = Math.max(...ls.map(({ i }) => i));
64
- const maxWidth = maxLineNumber.toString().length;
65
- return ls.flatMap(({ type, code, i }) => {
66
- const wrappedLines = wrapText(code, width - maxWidth);
67
- return wrappedLines.map((line, lineIndex) => {
68
- const key = `${type}-${i}-${lineIndex}`;
69
- switch (type) {
70
- case "add":
71
- return (_jsxs(Text, { children: [_jsx(LineNumber, { i: lineIndex === 0 ? i : undefined, width: maxWidth }), _jsx(Text, { color: overrideTheme ? theme.colors.text : undefined, backgroundColor: dim ? theme.colors.diffAddedDimmed : theme.colors.diffAdded, dimColor: dim, children: line })] }, key));
72
- case "remove":
73
- return (_jsxs(Text, { children: [_jsx(LineNumber, { i: lineIndex === 0 ? i : undefined, width: maxWidth }), _jsx(Text, { color: overrideTheme ? theme.colors.text : undefined, backgroundColor: dim ? theme.colors.diffRemovedDimmed : theme.colors.diffRemoved, dimColor: dim, children: line })] }, key));
74
- case "nochange":
75
- return (_jsxs(Text, { children: [_jsx(LineNumber, { i: lineIndex === 0 ? i : undefined, width: maxWidth }), _jsx(Text, { color: overrideTheme ? theme.colors.text : undefined, dimColor: dim, children: line })] }, key));
76
- }
77
- });
78
- });
79
- }
80
- function LineNumber({ i, width }) {
81
- return (_jsxs(Text, { color: getTheme().colors.textMuted, children: [i !== undefined ? i.toString().padStart(width) : " ".repeat(width), " "] }));
82
- }
83
- function numberDiffLines(diff, startLine) {
84
- let i = startLine;
85
- const result = [];
86
- const queue = [...diff];
87
- while (queue.length > 0) {
88
- const { code, type } = queue.shift();
89
- const line = {
90
- code: code,
91
- type,
92
- i,
93
- };
94
- // Update counters based on change type
95
- switch (type) {
96
- case "nochange":
97
- i++;
98
- result.push(line);
99
- break;
100
- case "add":
101
- i++;
102
- result.push(line);
103
- break;
104
- case "remove": {
105
- result.push(line);
106
- let numRemoved = 0;
107
- while (queue[0]?.type === "remove") {
108
- i++;
109
- const { code, type } = queue.shift();
110
- const line = {
111
- code: code,
112
- type,
113
- i,
114
- };
115
- result.push(line);
116
- numRemoved++;
117
- }
118
- i -= numRemoved;
119
- break;
120
- }
121
- }
122
- }
123
- return result;
124
- }
125
- // ── Public API: ARIA's FileDiff interface → rendering internals ──
126
- /** Convert an ARIA DiffHunk to {lines, oldStart} format */
127
- function ariaHunkToLines(hunk) {
128
- const lines = [];
129
- for (const line of hunk.lines) {
130
- switch (line.type) {
131
- case "added":
132
- lines.push("+" + line.content);
133
- break;
134
- case "removed":
135
- lines.push("-" + line.content);
136
- break;
137
- default:
138
- lines.push(" " + line.content);
139
- break;
140
- }
141
- }
142
- return { lines, oldStart: hunk.oldStart };
143
- }
144
- export function StructuredDiff({ diff, width = 60, showHeader = true, maxLines = 50, dim = false, }) {
145
- const theme = getTheme();
146
- // Count total lines and compute per-hunk budget for truncation
147
- const totalLines = diff.hunks.reduce((sum, h) => sum + h.lines.length, 0);
148
- const truncated = totalLines > maxLines;
149
- const perHunkLimit = truncated ? Math.floor(maxLines / diff.hunks.length) : undefined;
150
- const actualRendered = truncated
151
- ? diff.hunks.reduce((sum, h) => sum + Math.min(h.lines.length, perHunkLimit), 0)
152
- : totalLines;
153
- return (_jsxs(Box, { flexDirection: "column", width: width, children: [showHeader && (_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { bold: true, children: diff.filePath }), _jsxs(Text, { color: theme.colors.textMuted, children: [" ", "(", _jsxs(Text, { color: theme.colors.success, children: ["+", diff.additions] }), " / ", _jsxs(Text, { color: theme.colors.error, children: ["-", diff.deletions] }), ")"] })] })), diff.hunks.map((hunk, hunkIndex) => {
154
- // Apply per-hunk truncation if needed
155
- const effectiveHunk = perHunkLimit && hunk.lines.length > perHunkLimit
156
- ? { ...hunk, lines: hunk.lines.slice(0, perHunkLimit) }
157
- : hunk;
158
- const anonHunk = ariaHunkToLines(effectiveHunk);
159
- return (_jsxs(React.Fragment, { children: [hunkIndex > 0 && (_jsx(Box, { paddingY: 0, children: _jsx(Text, { color: theme.colors.textMuted, children: "..." }) })), _jsx(HunkDiff, { patch: anonHunk, dim: dim, width: width })] }, hunkIndex));
160
- }), truncated && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: theme.colors.textMuted, children: ["... ", totalLines - actualRendered, " more lines"] }) }))] }));
161
- }
162
- /**
163
- * Compact diff for permission prompts (fewer lines)
164
- */
165
- export function CompactDiff({ diff, maxLines = 10, }) {
166
- return _jsx(StructuredDiff, { diff: diff, showHeader: false, maxLines: maxLines, width: 55 });
167
- }
168
- //# sourceMappingURL=StructuredDiff.js.map
@@ -1,43 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useRef, useState } from "react";
3
- import { Box, Text, useInput } from "ink";
4
- import { getTheme } from "../theme/index.js";
5
- import { isEscapeInput } from "../utils/keys.js";
6
- export function TextInputOverlay({ title, hint, onSubmit, onCancel, isActive = true, }) {
7
- const theme = getTheme();
8
- const [value, setValue] = useState("");
9
- const submittedRef = useRef(false);
10
- const isRawModeSupported = process.stdin.isTTY ?? false;
11
- useInput((input, key) => {
12
- if (submittedRef.current)
13
- return;
14
- if (isEscapeInput(input, key)) {
15
- submittedRef.current = true;
16
- onCancel();
17
- return;
18
- }
19
- if (key.return) {
20
- if (value.trim().length > 0) {
21
- submittedRef.current = true;
22
- onSubmit(value.trim());
23
- }
24
- return;
25
- }
26
- if (key.backspace || key.delete) {
27
- setValue((v) => v.slice(0, -1));
28
- return;
29
- }
30
- // Ignore control keys (arrows, tab, etc.)
31
- if (key.upArrow || key.downArrow || key.leftArrow || key.rightArrow || key.tab) {
32
- return;
33
- }
34
- // Append printable characters
35
- if (input && !key.ctrl && !key.meta) {
36
- setValue((v) => v + input);
37
- }
38
- }, { isActive: isActive && isRawModeSupported });
39
- // Mask the value to avoid showing API keys in the terminal
40
- const masked = value.length > 0 ? value.slice(0, 4) + "\u2022".repeat(Math.max(0, value.length - 4)) : "";
41
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.colors.secondary, paddingX: 1, paddingY: 1, width: 64, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, children: title }) }), hint && (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: theme.colors.textMuted, dimColor: true, children: hint }) })), _jsxs(Box, { children: [_jsxs(Text, { color: theme.colors.primary, children: ["\u25b8", " "] }), _jsx(Text, { children: masked || " " }), _jsx(Text, { color: theme.colors.textMuted, children: "_" })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: theme.colors.textMuted, children: "Enter Submit Esc Cancel" }) })] }));
42
- }
43
- //# sourceMappingURL=TextInputOverlay.js.map
@@ -1,82 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- // packages/cli/src/ui/components/ThinkingBlock.tsx
3
- import { useRef } from "react";
4
- import { Box, Text } from "ink";
5
- import { getTheme } from "../theme/index.js";
6
- import { applyMarkdown } from "../markdown/index.js";
7
- import { pickRandomVerbPair } from "../verb-pairs.js";
8
- import { useTerminalSize } from "../hooks/useTerminalSize.js";
9
- /** Maximum lines to display when expanded before truncating (Infinity = no limit) */
10
- const DEFAULT_MAX_VISIBLE_LINES = Infinity;
11
- /**
12
- * Count words in a string by splitting on whitespace.
13
- * Returns 0 for empty or whitespace-only strings.
14
- */
15
- export function countWords(text) {
16
- const trimmed = text.trim();
17
- if (!trimmed)
18
- return 0;
19
- return trimmed.split(/\s+/).length;
20
- }
21
- /**
22
- * Format a duration in seconds to a human-readable string.
23
- * Returns empty string for missing/non-positive values.
24
- */
25
- export function formatDuration(seconds) {
26
- if (seconds === undefined || seconds === null)
27
- return "";
28
- if (seconds <= 0)
29
- return "< 1s";
30
- if (seconds < 60)
31
- return `${seconds}s`;
32
- const m = Math.floor(seconds / 60);
33
- const s = seconds % 60;
34
- return `${m}m ${s}s`;
35
- }
36
- /**
37
- * Pick a random past-tense verb.
38
- * Exported for testing backward compat.
39
- */
40
- export function pickRandomVerb() {
41
- return pickRandomVerbPair().past;
42
- }
43
- /**
44
- * ThinkingBlock displays an LLM's thinking/reasoning inline in the conversation.
45
- *
46
- * Collapsed (default):
47
- * 🦋 ARIA ✻ Pondered for 3m 19s
48
- *
49
- * Expanded:
50
- * 🦋 ARIA ✻ Pondered for 3m 19s
51
- * I need to understand how the runner handles
52
- * tool execution. Let me read the source...
53
- * … (+3 lines)
54
- */
55
- export function ThinkingBlock({ content, expanded = false, durationSeconds, verb, arionName, arionEmoji, arionColor, isLive = false, maxLines = DEFAULT_MAX_VISIBLE_LINES, }) {
56
- const theme = getTheme();
57
- const fallbackPair = useRef(pickRandomVerbPair());
58
- const presentVerb = verb || fallbackPair.current.present;
59
- const pastVerb = verb || fallbackPair.current.past;
60
- const duration = formatDuration(durationSeconds);
61
- const hasPrefix = !!(arionEmoji && arionName);
62
- return (_jsxs(Box, { flexDirection: "column", children: [hasPrefix && (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { color: arionColor || theme.colors.textMuted, bold: true, children: [arionEmoji, " ", arionName] }) })), _jsxs(Text, { color: theme.colors.textMuted, children: ["\u273B", " ", isLive ? presentVerb : pastVerb, isLive ? "\u2026" : duration ? ` for ${duration}` : ""] }), isLive && content && _jsx(ThinkingContent, { content: content, maxLines: maxLines, isLive: true }), !isLive && expanded && content && (_jsx(ThinkingContent, { content: content, maxLines: maxLines, isLive: false }))] }));
63
- }
64
- /**
65
- * Renders the thinking content with markdown applied.
66
- */
67
- function ThinkingContent({ content, maxLines, isLive, }) {
68
- const theme = getTheme();
69
- const { columns } = useTerminalSize();
70
- const contentWidth = Math.max(columns - 4, 20);
71
- // Apply markdown to the full content block (not line-by-line) so multi-line
72
- // constructs like code blocks, lists, and bold headers render correctly.
73
- const rendered = applyMarkdown(content, {
74
- width: contentWidth,
75
- mode: isLive ? "streaming" : "final",
76
- });
77
- const allLines = rendered.split("\n");
78
- const visibleLines = allLines.slice(0, maxLines);
79
- const remainingCount = allLines.length - visibleLines.length;
80
- return (_jsxs(Box, { children: [_jsx(Text, { color: theme.colors.textMuted, children: " \u23BF " }), _jsxs(Box, { flexDirection: "column", width: contentWidth, children: [visibleLines.map((line, i) => (_jsx(Text, { color: theme.colors.textMuted, wrap: "wrap", children: line }, i))), remainingCount > 0 && (_jsxs(Text, { color: theme.colors.textMuted, children: ["\u2026", " (+", remainingCount, " line", remainingCount !== 1 ? "s" : "", ")"] }))] })] }));
81
- }
82
- //# sourceMappingURL=ThinkingBlock.js.map
@@ -1,17 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- import { formatTokens, formatCost } from "./StatusBar.js";
4
- export function ToolCost({ durationMs, usage }) {
5
- const parts = [];
6
- if (usage && usage.totalTokens > 0) {
7
- parts.push(`+${formatTokens(usage.totalTokens)} tokens`);
8
- parts.push(formatCost(usage.estimatedCost));
9
- }
10
- if (durationMs) {
11
- parts.push(`${(durationMs / 1000).toFixed(1)}s`);
12
- }
13
- if (parts.length === 0)
14
- return _jsx(_Fragment, {});
15
- return (_jsx(Box, { children: _jsx(Text, { dimColor: true, children: parts.join(" · ") }) }));
16
- }
17
- //# sourceMappingURL=ToolCost.js.map
@@ -1,61 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * Combined tool execution component — renders tool_use header + tool_result
4
- * as ONE visual unit.
5
- *
6
- * Uses TOOL_RENDERERS from registry.ts directly — no adapter layer.
7
- */
8
- import { Box, Text } from "ink";
9
- import { ToolHeader } from "./ToolHeader.js";
10
- import { ToolResultWrapper } from "./ToolResultWrapper.js";
11
- import { ToolCost } from "./ToolCost.js";
12
- import { ToolRenderLayoutProvider } from "./ToolRenderLayoutContext.js";
13
- import { TOOL_RENDERERS } from "../tools/registry.js";
14
- import { safeFallbackText } from "../tools/truncation.js";
15
- const TOOL_RESULT_PREFIX_WIDTH = 5;
16
- export function ToolExecution({ item, verbose }) {
17
- const renderer = TOOL_RENDERERS[item.toolName.toLowerCase()];
18
- const terminalWidth = process.stdout.columns || 80;
19
- const resultContentWidth = Math.max(terminalWidth - TOOL_RESULT_PREFIX_WIDTH, 1);
20
- const renderLayout = {
21
- terminalWidth,
22
- contentWidth: resultContentWidth,
23
- };
24
- // Synthetic inbox messages — render output only, no tool chrome.
25
- if (item.id.includes("synthetic_inbox_") && item.output != null) {
26
- return (_jsx(ToolRenderLayoutProvider, { value: renderLayout, children: safeRender(renderer, item.output, verbose, item.input) ?? (_jsx(Text, { children: safeFallbackText(item.output, verbose) })) }));
27
- }
28
- const displayName = safe(() => renderer?.displayName(item.input)) ?? item.toolName;
29
- const args = safe(() => renderer?.renderInput(item.input, { verbose }));
30
- return (_jsxs(Box, { flexDirection: "column", children: [_jsx(ToolHeader, { displayName: displayName, args: args, status: item.status, durationMs: item.durationMs, verbose: verbose }), item.output != null && item.status !== "error" && (_jsx(ToolResultWrapper, { children: _jsx(ToolRenderLayoutProvider, { value: renderLayout, children: safeRender(renderer, item.output, verbose, item.input) ?? (_jsx(Text, { children: safeFallbackText(item.output, verbose) })) }) })), item.status === "error" && (_jsx(ToolResultWrapper, { children: _jsx(ToolRenderLayoutProvider, { value: renderLayout, children: (item.output != null && safeRender(renderer, item.output, verbose, item.input)) || (_jsx(Text, { color: "red", children: truncateError(item.error ?? "Tool error", verbose) })) }) })), verbose && item.usage && (_jsx(Box, { marginLeft: 2, children: _jsx(ToolCost, { durationMs: item.durationMs, usage: {
31
- inputTokens: item.usage.inputTokens ?? 0,
32
- outputTokens: item.usage.outputTokens ?? 0,
33
- totalTokens: (item.usage.inputTokens ?? 0) + (item.usage.outputTokens ?? 0),
34
- estimatedCost: 0,
35
- } }) }))] }));
36
- }
37
- /** Truncate long error messages to avoid flooding the terminal */
38
- function truncateError(error, verbose) {
39
- return safeFallbackText(error, verbose);
40
- }
41
- /** Safely call a function — catch renderer bugs so UI doesn't crash */
42
- function safe(fn) {
43
- try {
44
- return fn();
45
- }
46
- catch {
47
- return undefined;
48
- }
49
- }
50
- /** Safely call renderOutput — catch renderer bugs so UI doesn't crash */
51
- function safeRender(renderer, output, verbose, input) {
52
- if (!renderer?.renderOutput)
53
- return null;
54
- try {
55
- return renderer.renderOutput(output, { verbose }, input) ?? null;
56
- }
57
- catch {
58
- return null;
59
- }
60
- }
61
- //# sourceMappingURL=ToolExecution.js.map
@@ -1,51 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- import { getTheme } from "../theme/index.js";
4
- import { ToolUseLoader } from "./ToolUseLoader.js";
5
- /**
6
- * Strip argument key names, keep only values.
7
- * "pattern: \"long...\", path: \"src\"" → "\"long...\" \"src\""
8
- */
9
- function stripArgNames(args) {
10
- const parts = args.split(/,\s*(?=\w+:\s)/);
11
- return parts.map((part) => part.replace(/^\w+:\s*/, "")).join(" ");
12
- }
13
- /**
14
- * Collapse whitespace (newlines/tabs → single space) and truncate to maxLen.
15
- * Appends "…" when truncated.
16
- */
17
- function truncateArgs(args, maxLen) {
18
- // Collapse all whitespace runs (newlines, tabs, multiple spaces) to single space
19
- const collapsed = args.replace(/\s+/g, " ").trim();
20
- if (collapsed.length <= maxLen)
21
- return collapsed;
22
- return collapsed.slice(0, maxLen - 1) + "…";
23
- }
24
- export function ToolHeader({ displayName, args, status, durationMs, verbose, }) {
25
- const theme = getTheme();
26
- const isRunning = status === "pending" || status === "running";
27
- const isError = status === "error";
28
- // Format args: strings get truncated, JSX is passed through as-is
29
- let displayArgs;
30
- if (args) {
31
- if (typeof args === "string") {
32
- if (verbose) {
33
- displayArgs = args;
34
- }
35
- else {
36
- const stripped = stripArgNames(args);
37
- const cols = process.stdout.columns || 80;
38
- const reserved = 2 + displayName.length + 1;
39
- const maxLen = Math.max(20, cols - reserved);
40
- displayArgs = truncateArgs(stripped, maxLen);
41
- }
42
- }
43
- else {
44
- // JSX element — render as-is
45
- displayArgs = args;
46
- }
47
- }
48
- return (_jsxs(Box, { flexDirection: "row", children: [_jsx(ToolUseLoader, { shouldAnimate: isRunning, isError: isError, isUnresolved: isRunning }), _jsx(Text, { bold: true, children: displayName }), displayArgs != null &&
49
- (typeof displayArgs === "string" ? (_jsxs(Text, { children: [" ", displayArgs] })) : (_jsxs(Box, { children: [_jsx(Text, { children: " " }), displayArgs] }))), verbose && durationMs != null ? (_jsxs(Text, { color: theme.colors.textMuted, children: [" \u00B7 ", (durationMs / 1000).toFixed(1), "s"] })) : null] }));
50
- }
51
- //# sourceMappingURL=ToolHeader.js.map
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import React from "react";
3
- const defaultTerminalWidth = process.stdout.columns || 80;
4
- const ToolRenderLayoutContext = React.createContext({
5
- terminalWidth: defaultTerminalWidth,
6
- contentWidth: Math.max(defaultTerminalWidth - 5, 1),
7
- });
8
- export function ToolRenderLayoutProvider({ value, children, }) {
9
- return (_jsx(ToolRenderLayoutContext.Provider, { value: value, children: children }));
10
- }
11
- export function useToolRenderLayout() {
12
- return React.useContext(ToolRenderLayoutContext);
13
- }
14
- //# sourceMappingURL=ToolRenderLayoutContext.js.map
@@ -1,6 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- export function ToolResultWrapper({ children }) {
4
- return (_jsx(Box, { flexDirection: "column", children: _jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { children: [" ", "\u23BF", " "] }), _jsx(Box, { flexDirection: "column", flexGrow: 1, children: children })] }) }));
5
- }
6
- //# sourceMappingURL=ToolResultWrapper.js.map
@@ -1,35 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- // ToolUseLoader.tsx
3
- // Substitutions:
4
- // - import { getTheme } from '../utils/theme' → import { getTheme } from '../theme/index.js'
5
- // - import { BLACK_CIRCLE } from '../constants/figures' → inline
6
- // - import { useInterval } from '../hooks/useInterval' → from '../hooks/useInterval.js'
7
- // - theme.secondaryText → theme.colors.textMuted
8
- // - theme.error → theme.colors.error
9
- // - theme.success → theme.colors.success
10
- // Compat: isQueued accepted as alias for isUnresolved (used by ARIA callers)
11
- import { Box, Text } from "ink";
12
- import React from "react";
13
- import { useInterval } from "../hooks/useInterval.js";
14
- import { getTheme } from "../theme/index.js";
15
- const BLACK_CIRCLE = process.platform === "darwin" ? "\u23FA" : "\u25CF";
16
- export function ToolUseLoader({ isError = false, isUnresolved = false, shouldAnimate = true, ...rest }) {
17
- // Support ARIA's isQueued as alias for isUnresolved
18
- const unresolved = isUnresolved || rest.isQueued || false;
19
- const [isVisible, setIsVisible] = React.useState(true);
20
- useInterval(() => {
21
- if (!shouldAnimate) {
22
- return;
23
- }
24
- // To avoid flickering when the tool use confirm is visible, we set the loader to be visible
25
- // when the tool use confirm is visible.
26
- setIsVisible((_) => !_);
27
- }, 600);
28
- const color = unresolved
29
- ? getTheme().colors.textMuted
30
- : isError
31
- ? getTheme().colors.error
32
- : getTheme().colors.success;
33
- return (_jsx(Box, { minWidth: 2, children: _jsx(Text, { color: color, children: isVisible ? BLACK_CIRCLE : " " }) }));
34
- }
35
- //# sourceMappingURL=ToolUseLoader.js.map
@@ -1,91 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- import { getTheme } from "../theme/index.js";
4
- /** Minimum bar width to avoid invisible spans */
5
- const MIN_BAR_WIDTH = 1;
6
- /** Default bar area width in characters */
7
- const DEFAULT_BAR_WIDTH = 20;
8
- /** Short labels for span types */
9
- const SPAN_TYPE_LABELS = {
10
- model_call: "model_call",
11
- tool_execution: "tool_exec",
12
- handoff: "handoff",
13
- approval: "approval",
14
- session_phase: "session",
15
- runner_phase: "runner",
16
- };
17
- /**
18
- * Format a duration in ms to a compact human-readable string.
19
- */
20
- function formatDuration(ms) {
21
- if (ms < 1000)
22
- return `${Math.round(ms)}ms`;
23
- if (ms < 60_000)
24
- return `${(ms / 1000).toFixed(1)}s`;
25
- const mins = Math.floor(ms / 60_000);
26
- const secs = Math.round((ms % 60_000) / 1000);
27
- return `${mins}m ${secs}s`;
28
- }
29
- /**
30
- * Build a single waterfall bar string.
31
- *
32
- * @param barWidth - Total character width of the bar area
33
- * @param offsetFrac - Fraction [0,1) of the bar area before this span starts
34
- * @param widthFrac - Fraction (0,1] of the bar area this span occupies
35
- * @returns The bar string using block characters
36
- */
37
- export function buildBar(barWidth, offsetFrac, widthFrac) {
38
- const offset = Math.round(offsetFrac * barWidth);
39
- const filled = Math.max(MIN_BAR_WIDTH, Math.round(widthFrac * barWidth));
40
- const trailing = Math.max(0, barWidth - offset - filled);
41
- return "\u2591".repeat(offset) + "\u2588".repeat(filled) + "\u2591".repeat(trailing);
42
- }
43
- /**
44
- * TraceWaterfall component for Ink.
45
- *
46
- * Renders an ASCII trace waterfall showing span timing relationships.
47
- * Only renders spans that have end times / durations (in-flight spans are skipped).
48
- */
49
- export function TraceWaterfall({ spans, width }) {
50
- const theme = getTheme();
51
- const barWidth = width ?? DEFAULT_BAR_WIDTH;
52
- // Filter to completed spans only (must have endTime or durationMs)
53
- const completed = spans.filter((s) => s.endTime !== undefined || s.durationMs !== undefined);
54
- if (completed.length === 0) {
55
- return (_jsx(Box, { children: _jsx(Text, { dimColor: true, children: "(no completed spans)" }) }));
56
- }
57
- // Compute effective start/end/duration for each span
58
- const resolved = completed.map((s) => {
59
- const duration = s.durationMs ?? s.endTime - s.startTime;
60
- const endTime = s.endTime ?? s.startTime + duration;
61
- return { ...s, durationMs: duration, endTime };
62
- });
63
- // Compute global time bounds
64
- const globalStart = Math.min(...resolved.map((s) => s.startTime));
65
- const globalEnd = Math.max(...resolved.map((s) => s.endTime));
66
- const totalDuration = globalEnd - globalStart;
67
- // Guard against zero-duration traces
68
- if (totalDuration <= 0) {
69
- return (_jsx(Box, { flexDirection: "column", children: resolved.map((s) => (_jsxs(Text, { dimColor: true, children: [SPAN_TYPE_LABELS[s.spanType] ?? s.spanType, " ", "\u2588", " 0ms (", s.name, ")"] }, s.spanId))) }));
70
- }
71
- // Find the longest type label for alignment
72
- const maxLabelLen = Math.max(...resolved.map((s) => {
73
- const label = SPAN_TYPE_LABELS[s.spanType] ?? s.spanType;
74
- const isChild = s.parentSpanId !== undefined;
75
- return (isChild ? 2 : 0) + label.length;
76
- }));
77
- return (_jsx(Box, { flexDirection: "column", children: resolved.map((s) => {
78
- const isChild = s.parentSpanId !== undefined;
79
- const indent = isChild ? " " : "";
80
- const typeLabel = SPAN_TYPE_LABELS[s.spanType] ?? s.spanType;
81
- const paddedLabel = (indent + typeLabel).padEnd(maxLabelLen);
82
- const offsetFrac = (s.startTime - globalStart) / totalDuration;
83
- const widthFrac = s.durationMs / totalDuration;
84
- const bar = buildBar(barWidth, offsetFrac, widthFrac);
85
- const duration = formatDuration(s.durationMs);
86
- // For tool executions, show the tool name in parens
87
- const nameLabel = s.spanType === "tool_execution" && s.name ? ` (${s.name})` : "";
88
- return (_jsxs(Box, { children: [_jsxs(Text, { color: theme.colors.textMuted, children: [" ", paddedLabel] }), _jsx(Text, { children: " " }), _jsx(Text, { color: isChild ? theme.colors.info : theme.colors.success, children: bar }), _jsx(Text, { children: " " }), _jsxs(Text, { dimColor: true, children: [duration, nameLabel] })] }, s.spanId));
89
- }) }));
90
- }
91
- //# sourceMappingURL=TraceWaterfall.js.map
@@ -1,33 +0,0 @@
1
- export { StatusBar, } from "./StatusBar.js";
2
- export { ArionPrompt } from "./ArionPrompt.js";
3
- export { Message } from "./Message.js";
4
- export { InputArea } from "./InputArea.js";
5
- export { ConversationHistory, } from "./ConversationHistory.js";
6
- export { Spinner } from "./Spinner.js";
7
- export { CopilotDeviceLoginFlow, } from "./CopilotDeviceLoginFlow.js";
8
- export { CopilotSourcePicker, } from "./CopilotSourcePicker.js";
9
- // Phase 1: Foundation
10
- export { Banner } from "./Banner.js";
11
- export { ErrorDisplay, InlineError, SuggestionError, BoxedError, FatalError, } from "./ErrorDisplay.js";
12
- // Phase 3: Power Features
13
- export { AutocompleteDropdown } from "./AutocompleteDropdown.js";
14
- // Phase 4: Tool Safety
15
- export { StructuredDiff, CompactDiff } from "./StructuredDiff.js";
16
- export { PermissionPrompt, ConfirmPrompt } from "./PermissionPrompt.js";
17
- export { AutonomySelector } from "./AutonomySelector.js";
18
- // Phase 2: Observability — ThinkingBlock + HandoffMarker
19
- export { ThinkingBlock, countWords } from "./ThinkingBlock.js";
20
- export { HandoffMarker } from "./HandoffMarker.js";
21
- // Phase 7: OTEL + Trace Visualization
22
- export { TraceWaterfall, buildBar } from "./TraceWaterfall.js";
23
- export { PipelineTimingPanel } from "./PipelineTimingPanel.js";
24
- // UI Overhaul: ToolUseLoader + StreamingIndicator
25
- export { ToolUseLoader } from "./ToolUseLoader.js";
26
- export { StreamingIndicator, } from "./StreamingIndicator.js";
27
- // Forked from: Permission UI (tool-specific permission request components)
28
- export { PermissionRequest, toolUseConfirmGetPrefix, } from "./permissions/PermissionRequest.js";
29
- export { PermissionRequestTitle, textColorForRiskScore, categoryForRiskScore, } from "./permissions/PermissionRequestTitle.js";
30
- export { Select } from "./CustomSelect/select.js";
31
- // Re-export overlays
32
- export * from "./overlays/index.js";
33
- //# sourceMappingURL=index.js.map
@@ -1,25 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- import { Cost } from "../Cost.js";
4
- import { getTheme } from "../../theme/index.js";
5
- import { applyMarkdown } from "../../markdown/index.js";
6
- const BLACK_CIRCLE = process.platform === "darwin" ? "\u23FA" : "\u25CF";
7
- const CANCEL_MESSAGE = "I've cancelled the current action.";
8
- const INTERRUPT_MESSAGE = "I've been interrupted by the user.";
9
- const INTERRUPT_MESSAGE_FOR_TOOL_USE = "Tool use interrupted by the user. The tool was not executed.";
10
- const NO_RESPONSE_REQUESTED = "__no_response_requested__";
11
- function isEmptyMessageText(text) {
12
- return (text.trim() === "" ||
13
- text === CANCEL_MESSAGE ||
14
- text === INTERRUPT_MESSAGE ||
15
- text === INTERRUPT_MESSAGE_FOR_TOOL_USE ||
16
- text === NO_RESPONSE_REQUESTED);
17
- }
18
- export function AssistantTextMessage({ param: { text }, costUSD, durationMs, debug, addMargin, shouldShowDot, columns, }) {
19
- if (isEmptyMessageText(text)) {
20
- return null;
21
- }
22
- const contentWidth = Math.max(columns - 6, 20);
23
- return (_jsxs(Box, { alignItems: "flex-start", flexDirection: "row", justifyContent: "space-between", marginTop: addMargin ? 1 : 0, width: "100%", children: [_jsxs(Box, { flexDirection: "row", children: [shouldShowDot && (_jsx(Box, { minWidth: 2, children: _jsx(Text, { color: getTheme().colors.text, children: BLACK_CIRCLE }) })), _jsx(Box, { flexDirection: "column", width: contentWidth, children: _jsx(Text, { children: applyMarkdown(text, { width: contentWidth }) }) })] }), _jsx(Cost, { costUSD: costUSD, durationMs: durationMs, debug: debug })] }));
24
- }
25
- //# sourceMappingURL=AssistantTextMessage.js.map
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- import { getTheme } from "../../theme/index.js";
4
- import { terminalInlineImageFromDataUri } from "../../utils/terminal-image.js";
5
- export function UserImageMessage({ dataUri, userName, showPrefix = true }) {
6
- const theme = getTheme();
7
- const name = userName || "User";
8
- const prefix = `🦄 ${name}`;
9
- const inlineImage = terminalInlineImageFromDataUri(dataUri);
10
- return (_jsxs(Box, { flexDirection: "column", width: "100%", children: [showPrefix && (_jsx(Text, { bold: true, color: theme.colors.primary, children: prefix })), inlineImage ? _jsx(Text, { children: inlineImage }) : _jsx(Text, { dimColor: true, children: "[Image attachment]" })] }));
11
- }
12
- //# sourceMappingURL=UserImageMessage.js.map