@aria-cli/cli 1.0.56 → 1.0.58

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 (622) hide show
  1. package/bin/aria.mjs +2 -2
  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/attached-local-control-client.js.map +0 -1
  6. package/dist/bootstrap-local-control-client.js +0 -2
  7. package/dist/bootstrap-local-control-client.js.map +0 -1
  8. package/dist/capability-aware-method-proxy.js +0 -42
  9. package/dist/capability-aware-method-proxy.js.map +0 -1
  10. package/dist/cli-context.js +0 -160
  11. package/dist/cli-context.js.map +0 -1
  12. package/dist/commands/arions.js +0 -174
  13. package/dist/commands/arions.js.map +0 -1
  14. package/dist/commands/auth.js +0 -123
  15. package/dist/commands/auth.js.map +0 -1
  16. package/dist/commands/daemon.js +0 -367
  17. package/dist/commands/daemon.js.map +0 -1
  18. package/dist/commands/definitions.js +0 -176
  19. package/dist/commands/definitions.js.map +0 -1
  20. package/dist/commands/index.js +0 -80
  21. package/dist/commands/index.js.map +0 -1
  22. package/dist/commands/login-handler.js +0 -1108
  23. package/dist/commands/login-handler.js.map +0 -1
  24. package/dist/commands/logout-handler.js +0 -92
  25. package/dist/commands/logout-handler.js.map +0 -1
  26. package/dist/commands/memory-handlers.js +0 -89
  27. package/dist/commands/memory-handlers.js.map +0 -1
  28. package/dist/commands/pairing.js +0 -60
  29. package/dist/commands/pairing.js.map +0 -1
  30. package/dist/commands/runtime-cutover-reset-command.js +0 -12
  31. package/dist/commands/runtime-cutover-reset-command.js.map +0 -1
  32. package/dist/commands/runtime-cutover-reset.js +0 -265
  33. package/dist/commands/runtime-cutover-reset.js.map +0 -1
  34. package/dist/commands/terminal-setup.js +0 -84
  35. package/dist/commands/terminal-setup.js.map +0 -1
  36. package/dist/config/aria-config.js +0 -238
  37. package/dist/config/aria-config.js.map +0 -1
  38. package/dist/config/index.js +0 -3
  39. package/dist/config/index.js.map +0 -1
  40. package/dist/config/loader.js +0 -97
  41. package/dist/config/loader.js.map +0 -1
  42. package/dist/config.js +0 -142
  43. package/dist/config.js.map +0 -1
  44. package/dist/daemon-info.js +0 -10
  45. package/dist/daemon-info.js.map +0 -1
  46. package/dist/ensure-daemon.js +0 -128
  47. package/dist/ensure-daemon.js.map +0 -1
  48. package/dist/entrypoints/command-mode.js +0 -5
  49. package/dist/entrypoints/command-mode.js.map +0 -1
  50. package/dist/entrypoints/daemon.js +0 -50
  51. package/dist/entrypoints/daemon.js.map +0 -1
  52. package/dist/entrypoints/headless-stdio.js +0 -25
  53. package/dist/entrypoints/headless-stdio.js.map +0 -1
  54. package/dist/entrypoints/interactive.d.ts.map +0 -1
  55. package/dist/entrypoints/interactive.js +0 -80
  56. package/dist/entrypoints/interactive.js.map +0 -1
  57. package/dist/event-loop-watchdog.js +0 -73
  58. package/dist/event-loop-watchdog.js.map +0 -1
  59. package/dist/headless/auth-orchestrator.js +0 -508
  60. package/dist/headless/auth-orchestrator.js.map +0 -1
  61. package/dist/headless/auth-service.js +0 -43
  62. package/dist/headless/auth-service.js.map +0 -1
  63. package/dist/headless/bootstrap-fast-path.js +0 -112
  64. package/dist/headless/bootstrap-fast-path.js.map +0 -1
  65. package/dist/headless/call-command.js +0 -143
  66. package/dist/headless/call-command.js.map +0 -1
  67. package/dist/headless/daemon-service.js +0 -318
  68. package/dist/headless/daemon-service.js.map +0 -1
  69. package/dist/headless/hook-actions.js +0 -235
  70. package/dist/headless/hook-actions.js.map +0 -1
  71. package/dist/headless/hook-service.js +0 -42
  72. package/dist/headless/hook-service.js.map +0 -1
  73. package/dist/headless/kernel-services.js +0 -216
  74. package/dist/headless/kernel-services.js.map +0 -1
  75. package/dist/headless/kernel.js +0 -785
  76. package/dist/headless/kernel.js.map +0 -1
  77. package/dist/headless/operations/arion.js +0 -119
  78. package/dist/headless/operations/arion.js.map +0 -1
  79. package/dist/headless/operations/auth.js +0 -45
  80. package/dist/headless/operations/auth.js.map +0 -1
  81. package/dist/headless/operations/client.js +0 -31
  82. package/dist/headless/operations/client.js.map +0 -1
  83. package/dist/headless/operations/config.js +0 -69
  84. package/dist/headless/operations/config.js.map +0 -1
  85. package/dist/headless/operations/daemon.js +0 -47
  86. package/dist/headless/operations/daemon.js.map +0 -1
  87. package/dist/headless/operations/hook.js +0 -56
  88. package/dist/headless/operations/hook.js.map +0 -1
  89. package/dist/headless/operations/index.js +0 -11
  90. package/dist/headless/operations/index.js.map +0 -1
  91. package/dist/headless/operations/memory.js +0 -102
  92. package/dist/headless/operations/memory.js.map +0 -1
  93. package/dist/headless/operations/message.js +0 -279
  94. package/dist/headless/operations/message.js.map +0 -1
  95. package/dist/headless/operations/model.js +0 -100
  96. package/dist/headless/operations/model.js.map +0 -1
  97. package/dist/headless/operations/peer.js +0 -56
  98. package/dist/headless/operations/peer.js.map +0 -1
  99. package/dist/headless/operations/run.js +0 -24
  100. package/dist/headless/operations/run.js.map +0 -1
  101. package/dist/headless/operations/session.js +0 -90
  102. package/dist/headless/operations/session.js.map +0 -1
  103. package/dist/headless/operations/system.js +0 -19
  104. package/dist/headless/operations/system.js.map +0 -1
  105. package/dist/headless/operations/utils.js +0 -35
  106. package/dist/headless/operations/utils.js.map +0 -1
  107. package/dist/headless/run-orchestrator.js +0 -703
  108. package/dist/headless/run-orchestrator.js.map +0 -1
  109. package/dist/headless/stdio-server.js +0 -439
  110. package/dist/headless/stdio-server.js.map +0 -1
  111. package/dist/history/SessionHistory.js +0 -8
  112. package/dist/history/SessionHistory.js.map +0 -1
  113. package/dist/history/SessionHistoryClient.js +0 -186
  114. package/dist/history/SessionHistoryClient.js.map +0 -1
  115. package/dist/history/conversation-message.js +0 -112
  116. package/dist/history/conversation-message.js.map +0 -1
  117. package/dist/history/index.js +0 -8
  118. package/dist/history/index.js.map +0 -1
  119. package/dist/history/jsonl-replay.js +0 -154
  120. package/dist/history/jsonl-replay.js.map +0 -1
  121. package/dist/history/repair-tool-pairing.js +0 -84
  122. package/dist/history/repair-tool-pairing.js.map +0 -1
  123. package/dist/history/stall-phase-bridge.js +0 -11
  124. package/dist/history/stall-phase-bridge.js.map +0 -1
  125. package/dist/history/turn-accumulator.js +0 -427
  126. package/dist/history/turn-accumulator.js.map +0 -1
  127. package/dist/index.d.ts.map +0 -1
  128. package/dist/index.js +0 -7
  129. package/dist/index.js.map +0 -1
  130. package/dist/ink-repl.d.ts.map +0 -1
  131. package/dist/ink-repl.js +0 -4183
  132. package/dist/ink-repl.js.map +0 -1
  133. package/dist/local-control-bootstrap.js +0 -26
  134. package/dist/local-control-bootstrap.js.map +0 -1
  135. package/dist/local-control-client.js +0 -2
  136. package/dist/local-control-client.js.map +0 -1
  137. package/dist/local-control-error-reporting.js +0 -34
  138. package/dist/local-control-error-reporting.js.map +0 -1
  139. package/dist/local-control-http-client.js +0 -362
  140. package/dist/local-control-http-client.js.map +0 -1
  141. package/dist/local-control-lazy-wrapper.js +0 -363
  142. package/dist/local-control-lazy-wrapper.js.map +0 -1
  143. package/dist/local-control-manager.js +0 -146
  144. package/dist/local-control-manager.js.map +0 -1
  145. package/dist/main.d.ts.map +0 -1
  146. package/dist/main.js +0 -62
  147. package/dist/main.js.map +0 -1
  148. package/dist/network-security.js +0 -62
  149. package/dist/network-security.js.map +0 -1
  150. package/dist/networking-server.js +0 -38
  151. package/dist/networking-server.js.map +0 -1
  152. package/dist/peer-identity.js +0 -23
  153. package/dist/peer-identity.js.map +0 -1
  154. package/dist/polling-subscription.js +0 -34
  155. package/dist/polling-subscription.js.map +0 -1
  156. package/dist/relaunch.d.ts +0 -63
  157. package/dist/relaunch.d.ts.map +0 -1
  158. package/dist/relaunch.js +0 -617
  159. package/dist/relaunch.js.map +0 -1
  160. package/dist/release-notes.js +0 -35
  161. package/dist/release-notes.js.map +0 -1
  162. package/dist/repl-cleanup.js +0 -47
  163. package/dist/repl-cleanup.js.map +0 -1
  164. package/dist/runtime/configure-bun-sqlite.js +0 -3
  165. package/dist/runtime/configure-bun-sqlite.js.map +0 -1
  166. package/dist/runtime/crash-handlers.js +0 -111
  167. package/dist/runtime/crash-handlers.js.map +0 -1
  168. package/dist/runtime/interactive-invocation.js +0 -39
  169. package/dist/runtime/interactive-invocation.js.map +0 -1
  170. package/dist/runtime/internal-mode.js +0 -14
  171. package/dist/runtime/internal-mode.js.map +0 -1
  172. package/dist/runtime/launch-spec.js +0 -64
  173. package/dist/runtime/launch-spec.js.map +0 -1
  174. package/dist/runtime/owner-lease.js +0 -44
  175. package/dist/runtime/owner-lease.js.map +0 -1
  176. package/dist/runtime/public-mode.js +0 -20
  177. package/dist/runtime/public-mode.js.map +0 -1
  178. package/dist/runtime/run-internal-mode.d.ts.map +0 -1
  179. package/dist/runtime/run-internal-mode.js +0 -18
  180. package/dist/runtime/run-internal-mode.js.map +0 -1
  181. package/dist/runtime/runtime-kind.js +0 -32
  182. package/dist/runtime/runtime-kind.js.map +0 -1
  183. package/dist/runtime/spawn-aria.js +0 -38
  184. package/dist/runtime/spawn-aria.js.map +0 -1
  185. package/dist/selectable-client.js +0 -2
  186. package/dist/selectable-client.js.map +0 -1
  187. package/dist/selectable-peer.js +0 -2
  188. package/dist/selectable-peer.js.map +0 -1
  189. package/dist/session.js +0 -203
  190. package/dist/session.js.map +0 -1
  191. package/dist/slash-commands.js +0 -80
  192. package/dist/slash-commands.js.map +0 -1
  193. package/dist/sounds.js +0 -210
  194. package/dist/sounds.js.map +0 -1
  195. package/dist/ui/App.js +0 -526
  196. package/dist/ui/App.js.map +0 -1
  197. package/dist/ui/components/AnthropicMethodPicker.js +0 -6
  198. package/dist/ui/components/AnthropicMethodPicker.js.map +0 -1
  199. package/dist/ui/components/ArionPrompt.js +0 -15
  200. package/dist/ui/components/ArionPrompt.js.map +0 -1
  201. package/dist/ui/components/AutocompleteDropdown.js +0 -23
  202. package/dist/ui/components/AutocompleteDropdown.js.map +0 -1
  203. package/dist/ui/components/AutonomySelector.js +0 -55
  204. package/dist/ui/components/AutonomySelector.js.map +0 -1
  205. package/dist/ui/components/Banner.js +0 -98
  206. package/dist/ui/components/Banner.js.map +0 -1
  207. package/dist/ui/components/ConversationHistory.js +0 -175
  208. package/dist/ui/components/ConversationHistory.js.map +0 -1
  209. package/dist/ui/components/CopilotDeviceLoginFlow.js +0 -88
  210. package/dist/ui/components/CopilotDeviceLoginFlow.js.map +0 -1
  211. package/dist/ui/components/CopilotSourcePicker.js +0 -50
  212. package/dist/ui/components/CopilotSourcePicker.js.map +0 -1
  213. package/dist/ui/components/Cost.js +0 -10
  214. package/dist/ui/components/Cost.js.map +0 -1
  215. package/dist/ui/components/CustomSelect/option-map.js +0 -30
  216. package/dist/ui/components/CustomSelect/option-map.js.map +0 -1
  217. package/dist/ui/components/CustomSelect/select-option.js +0 -13
  218. package/dist/ui/components/CustomSelect/select-option.js.map +0 -1
  219. package/dist/ui/components/CustomSelect/select.js +0 -42
  220. package/dist/ui/components/CustomSelect/select.js.map +0 -1
  221. package/dist/ui/components/CustomSelect/use-select-state.js +0 -179
  222. package/dist/ui/components/CustomSelect/use-select-state.js.map +0 -1
  223. package/dist/ui/components/CustomSelect/use-select.js +0 -15
  224. package/dist/ui/components/CustomSelect/use-select.js.map +0 -1
  225. package/dist/ui/components/ErrorDisplay.js +0 -35
  226. package/dist/ui/components/ErrorDisplay.js.map +0 -1
  227. package/dist/ui/components/FallbackToolUseRejectedMessage.js +0 -7
  228. package/dist/ui/components/FallbackToolUseRejectedMessage.js.map +0 -1
  229. package/dist/ui/components/FileEditToolUpdatedMessage.js +0 -57
  230. package/dist/ui/components/FileEditToolUpdatedMessage.js.map +0 -1
  231. package/dist/ui/components/HandoffMarker.js +0 -18
  232. package/dist/ui/components/HandoffMarker.js.map +0 -1
  233. package/dist/ui/components/HighlightedCode.js +0 -21
  234. package/dist/ui/components/HighlightedCode.js.map +0 -1
  235. package/dist/ui/components/InputArea.js +0 -187
  236. package/dist/ui/components/InputArea.js.map +0 -1
  237. package/dist/ui/components/Message.js +0 -25
  238. package/dist/ui/components/Message.js.map +0 -1
  239. package/dist/ui/components/OAuthLoginFlow.js +0 -113
  240. package/dist/ui/components/OAuthLoginFlow.js.map +0 -1
  241. package/dist/ui/components/OutputTruncation.js +0 -35
  242. package/dist/ui/components/OutputTruncation.js.map +0 -1
  243. package/dist/ui/components/PermissionPrompt.js +0 -79
  244. package/dist/ui/components/PermissionPrompt.js.map +0 -1
  245. package/dist/ui/components/PipelineTimingPanel.js +0 -15
  246. package/dist/ui/components/PipelineTimingPanel.js.map +0 -1
  247. package/dist/ui/components/ProviderMethodPicker.js +0 -61
  248. package/dist/ui/components/ProviderMethodPicker.js.map +0 -1
  249. package/dist/ui/components/ProviderPicker.js +0 -63
  250. package/dist/ui/components/ProviderPicker.js.map +0 -1
  251. package/dist/ui/components/RenderItemView.js +0 -71
  252. package/dist/ui/components/RenderItemView.js.map +0 -1
  253. package/dist/ui/components/Spinner.js +0 -46
  254. package/dist/ui/components/Spinner.js.map +0 -1
  255. package/dist/ui/components/StatusBar.js +0 -95
  256. package/dist/ui/components/StatusBar.js.map +0 -1
  257. package/dist/ui/components/StreamingIndicator.js +0 -55
  258. package/dist/ui/components/StreamingIndicator.js.map +0 -1
  259. package/dist/ui/components/StructuredDiff.js +0 -168
  260. package/dist/ui/components/StructuredDiff.js.map +0 -1
  261. package/dist/ui/components/TextInputOverlay.js +0 -43
  262. package/dist/ui/components/TextInputOverlay.js.map +0 -1
  263. package/dist/ui/components/ThinkingBlock.js +0 -82
  264. package/dist/ui/components/ThinkingBlock.js.map +0 -1
  265. package/dist/ui/components/ToolCost.js +0 -17
  266. package/dist/ui/components/ToolCost.js.map +0 -1
  267. package/dist/ui/components/ToolExecution.js +0 -61
  268. package/dist/ui/components/ToolExecution.js.map +0 -1
  269. package/dist/ui/components/ToolHeader.js +0 -51
  270. package/dist/ui/components/ToolHeader.js.map +0 -1
  271. package/dist/ui/components/ToolRenderLayoutContext.js +0 -14
  272. package/dist/ui/components/ToolRenderLayoutContext.js.map +0 -1
  273. package/dist/ui/components/ToolResultWrapper.js +0 -6
  274. package/dist/ui/components/ToolResultWrapper.js.map +0 -1
  275. package/dist/ui/components/ToolUseLoader.js +0 -35
  276. package/dist/ui/components/ToolUseLoader.js.map +0 -1
  277. package/dist/ui/components/TraceWaterfall.js +0 -91
  278. package/dist/ui/components/TraceWaterfall.js.map +0 -1
  279. package/dist/ui/components/index.js +0 -33
  280. package/dist/ui/components/index.js.map +0 -1
  281. package/dist/ui/components/messages/AssistantTextMessage.js +0 -25
  282. package/dist/ui/components/messages/AssistantTextMessage.js.map +0 -1
  283. package/dist/ui/components/messages/UserImageMessage.js +0 -12
  284. package/dist/ui/components/messages/UserImageMessage.js.map +0 -1
  285. package/dist/ui/components/messages/UserTextMessage.js +0 -12
  286. package/dist/ui/components/messages/UserTextMessage.js.map +0 -1
  287. package/dist/ui/components/overlays/ArionSelector.js +0 -68
  288. package/dist/ui/components/overlays/ArionSelector.js.map +0 -1
  289. package/dist/ui/components/overlays/ClientSelector.js +0 -62
  290. package/dist/ui/components/overlays/ClientSelector.js.map +0 -1
  291. package/dist/ui/components/overlays/CommandPalette.js +0 -67
  292. package/dist/ui/components/overlays/CommandPalette.js.map +0 -1
  293. package/dist/ui/components/overlays/DaemonControl.js +0 -87
  294. package/dist/ui/components/overlays/DaemonControl.js.map +0 -1
  295. package/dist/ui/components/overlays/InviteShareOverlay.js +0 -15
  296. package/dist/ui/components/overlays/InviteShareOverlay.js.map +0 -1
  297. package/dist/ui/components/overlays/JoinInviteOverlay.js +0 -32
  298. package/dist/ui/components/overlays/JoinInviteOverlay.js.map +0 -1
  299. package/dist/ui/components/overlays/MemoryBrowser.js +0 -100
  300. package/dist/ui/components/overlays/MemoryBrowser.js.map +0 -1
  301. package/dist/ui/components/overlays/MessageSelector.js +0 -123
  302. package/dist/ui/components/overlays/MessageSelector.js.map +0 -1
  303. package/dist/ui/components/overlays/ModelSelector.js +0 -211
  304. package/dist/ui/components/overlays/ModelSelector.js.map +0 -1
  305. package/dist/ui/components/overlays/PairRequestOverlay.js +0 -42
  306. package/dist/ui/components/overlays/PairRequestOverlay.js.map +0 -1
  307. package/dist/ui/components/overlays/PeerSelector.js +0 -84
  308. package/dist/ui/components/overlays/PeerSelector.js.map +0 -1
  309. package/dist/ui/components/overlays/SessionSelector.js +0 -102
  310. package/dist/ui/components/overlays/SessionSelector.js.map +0 -1
  311. package/dist/ui/components/overlays/SoundSelector.js +0 -86
  312. package/dist/ui/components/overlays/SoundSelector.js.map +0 -1
  313. package/dist/ui/components/overlays/ThemeSelector.js +0 -139
  314. package/dist/ui/components/overlays/ThemeSelector.js.map +0 -1
  315. package/dist/ui/components/overlays/index.js +0 -15
  316. package/dist/ui/components/overlays/index.js.map +0 -1
  317. package/dist/ui/components/permissions/BashPermissionRequest/BashPermissionRequest.js +0 -53
  318. package/dist/ui/components/permissions/BashPermissionRequest/BashPermissionRequest.js.map +0 -1
  319. package/dist/ui/components/permissions/FallbackPermissionRequest.js +0 -56
  320. package/dist/ui/components/permissions/FallbackPermissionRequest.js.map +0 -1
  321. package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +0 -76
  322. package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js.map +0 -1
  323. package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js +0 -18
  324. package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js.map +0 -1
  325. package/dist/ui/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +0 -64
  326. package/dist/ui/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js.map +0 -1
  327. package/dist/ui/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js +0 -26
  328. package/dist/ui/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js.map +0 -1
  329. package/dist/ui/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +0 -141
  330. package/dist/ui/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js.map +0 -1
  331. package/dist/ui/components/permissions/PermissionRequest.js +0 -70
  332. package/dist/ui/components/permissions/PermissionRequest.js.map +0 -1
  333. package/dist/ui/components/permissions/PermissionRequestTitle.js +0 -41
  334. package/dist/ui/components/permissions/PermissionRequestTitle.js.map +0 -1
  335. package/dist/ui/components/permissions/hooks.js +0 -10
  336. package/dist/ui/components/permissions/hooks.js.map +0 -1
  337. package/dist/ui/components/permissions/toolUseOptions.js +0 -68
  338. package/dist/ui/components/permissions/toolUseOptions.js.map +0 -1
  339. package/dist/ui/components/permissions/utils.js +0 -10
  340. package/dist/ui/components/permissions/utils.js.map +0 -1
  341. package/dist/ui/components/text-input/Cursor.js +0 -326
  342. package/dist/ui/components/text-input/Cursor.js.map +0 -1
  343. package/dist/ui/components/text-input/TextInput.js +0 -231
  344. package/dist/ui/components/text-input/TextInput.js.map +0 -1
  345. package/dist/ui/components/text-input/imagePaste.js +0 -28
  346. package/dist/ui/components/text-input/imagePaste.js.map +0 -1
  347. package/dist/ui/components/text-input/index.js +0 -6
  348. package/dist/ui/components/text-input/index.js.map +0 -1
  349. package/dist/ui/components/text-input/useDoublePress.js +0 -30
  350. package/dist/ui/components/text-input/useDoublePress.js.map +0 -1
  351. package/dist/ui/components/text-input/useTextInput.js +0 -245
  352. package/dist/ui/components/text-input/useTextInput.js.map +0 -1
  353. package/dist/ui/components/tool-types.js +0 -9
  354. package/dist/ui/components/tool-types.js.map +0 -1
  355. package/dist/ui/constants/figures.js +0 -4
  356. package/dist/ui/constants/figures.js.map +0 -1
  357. package/dist/ui/constants/index.js +0 -3
  358. package/dist/ui/constants/index.js.map +0 -1
  359. package/dist/ui/display-mode.js +0 -93
  360. package/dist/ui/display-mode.js.map +0 -1
  361. package/dist/ui/display-policy.js +0 -19
  362. package/dist/ui/display-policy.js.map +0 -1
  363. package/dist/ui/hooks/index.js +0 -6
  364. package/dist/ui/hooks/index.js.map +0 -1
  365. package/dist/ui/hooks/useCommandAutocomplete.js +0 -93
  366. package/dist/ui/hooks/useCommandAutocomplete.js.map +0 -1
  367. package/dist/ui/hooks/useDoublePress.js +0 -37
  368. package/dist/ui/hooks/useDoublePress.js.map +0 -1
  369. package/dist/ui/hooks/useIndicatorState.js +0 -55
  370. package/dist/ui/hooks/useIndicatorState.js.map +0 -1
  371. package/dist/ui/hooks/useInterval.js +0 -23
  372. package/dist/ui/hooks/useInterval.js.map +0 -1
  373. package/dist/ui/hooks/useKeyboardShortcuts.js +0 -127
  374. package/dist/ui/hooks/useKeyboardShortcuts.js.map +0 -1
  375. package/dist/ui/hooks/useTerminalSize.js +0 -55
  376. package/dist/ui/hooks/useTerminalSize.js.map +0 -1
  377. package/dist/ui/hooks/useUnifiedMessages.js +0 -117
  378. package/dist/ui/hooks/useUnifiedMessages.js.map +0 -1
  379. package/dist/ui/indicator-state.js +0 -44
  380. package/dist/ui/indicator-state.js.map +0 -1
  381. package/dist/ui/markdown/highlight.js +0 -44
  382. package/dist/ui/markdown/highlight.js.map +0 -1
  383. package/dist/ui/markdown/index.js +0 -1460
  384. package/dist/ui/markdown/index.js.map +0 -1
  385. package/dist/ui/markdown/tokenizer.js +0 -24
  386. package/dist/ui/markdown/tokenizer.js.map +0 -1
  387. package/dist/ui/render-item.js +0 -5
  388. package/dist/ui/render-item.js.map +0 -1
  389. package/dist/ui/screens/REPL.js +0 -119
  390. package/dist/ui/screens/REPL.js.map +0 -1
  391. package/dist/ui/screens/approval-lifecycle.js +0 -38
  392. package/dist/ui/screens/approval-lifecycle.js.map +0 -1
  393. package/dist/ui/status-line.js +0 -72
  394. package/dist/ui/status-line.js.map +0 -1
  395. package/dist/ui/theme/index.js +0 -51
  396. package/dist/ui/theme/index.js.map +0 -1
  397. package/dist/ui/theme/themes/claude-dark-daltonized.js +0 -51
  398. package/dist/ui/theme/themes/claude-dark-daltonized.js.map +0 -1
  399. package/dist/ui/theme/themes/claude-dark.js +0 -50
  400. package/dist/ui/theme/themes/claude-dark.js.map +0 -1
  401. package/dist/ui/theme/themes/claude-light-daltonized.js +0 -51
  402. package/dist/ui/theme/themes/claude-light-daltonized.js.map +0 -1
  403. package/dist/ui/theme/themes/claude-light.js +0 -50
  404. package/dist/ui/theme/themes/claude-light.js.map +0 -1
  405. package/dist/ui/theme/themes/dark-accessible.js +0 -18
  406. package/dist/ui/theme/themes/dark-accessible.js.map +0 -1
  407. package/dist/ui/theme/themes/dark.js +0 -49
  408. package/dist/ui/theme/themes/dark.js.map +0 -1
  409. package/dist/ui/theme/themes/light-accessible.js +0 -18
  410. package/dist/ui/theme/themes/light-accessible.js.map +0 -1
  411. package/dist/ui/theme/themes/light.js +0 -49
  412. package/dist/ui/theme/themes/light.js.map +0 -1
  413. package/dist/ui/theme/types.js +0 -3
  414. package/dist/ui/theme/types.js.map +0 -1
  415. package/dist/ui/theme.js +0 -142
  416. package/dist/ui/theme.js.map +0 -1
  417. package/dist/ui/to-render-items.js +0 -145
  418. package/dist/ui/to-render-items.js.map +0 -1
  419. package/dist/ui/tools/AgentTool/index.js +0 -30
  420. package/dist/ui/tools/AgentTool/index.js.map +0 -1
  421. package/dist/ui/tools/ArchitectTool/index.js +0 -31
  422. package/dist/ui/tools/ArchitectTool/index.js.map +0 -1
  423. package/dist/ui/tools/AskUserTool/index.js +0 -46
  424. package/dist/ui/tools/AskUserTool/index.js.map +0 -1
  425. package/dist/ui/tools/BashTool/BashToolResultMessage.js +0 -11
  426. package/dist/ui/tools/BashTool/BashToolResultMessage.js.map +0 -1
  427. package/dist/ui/tools/BashTool/OutputLine.js +0 -21
  428. package/dist/ui/tools/BashTool/OutputLine.js.map +0 -1
  429. package/dist/ui/tools/BashTool/index.js +0 -91
  430. package/dist/ui/tools/BashTool/index.js.map +0 -1
  431. package/dist/ui/tools/BrowseTool/index.js +0 -43
  432. package/dist/ui/tools/BrowseTool/index.js.map +0 -1
  433. package/dist/ui/tools/BrowserTool/index.js +0 -47
  434. package/dist/ui/tools/BrowserTool/index.js.map +0 -1
  435. package/dist/ui/tools/CbmTool/index.js +0 -188
  436. package/dist/ui/tools/CbmTool/index.js.map +0 -1
  437. package/dist/ui/tools/CheckDelegationTool/index.js +0 -46
  438. package/dist/ui/tools/CheckDelegationTool/index.js.map +0 -1
  439. package/dist/ui/tools/CheckMessagesTool/index.js +0 -85
  440. package/dist/ui/tools/CheckMessagesTool/index.js.map +0 -1
  441. package/dist/ui/tools/CreateQuipTool/index.js +0 -30
  442. package/dist/ui/tools/CreateQuipTool/index.js.map +0 -1
  443. package/dist/ui/tools/CreateSkillTool/index.js +0 -22
  444. package/dist/ui/tools/CreateSkillTool/index.js.map +0 -1
  445. package/dist/ui/tools/CreateToolTool/index.js +0 -31
  446. package/dist/ui/tools/CreateToolTool/index.js.map +0 -1
  447. package/dist/ui/tools/DelegateRemoteTool/index.js +0 -42
  448. package/dist/ui/tools/DelegateRemoteTool/index.js.map +0 -1
  449. package/dist/ui/tools/DeployTool/index.js +0 -47
  450. package/dist/ui/tools/DeployTool/index.js.map +0 -1
  451. package/dist/ui/tools/FffTool/index.js +0 -103
  452. package/dist/ui/tools/FffTool/index.js.map +0 -1
  453. package/dist/ui/tools/FileEditTool/index.js +0 -67
  454. package/dist/ui/tools/FileEditTool/index.js.map +0 -1
  455. package/dist/ui/tools/FileReadTool/index.js +0 -68
  456. package/dist/ui/tools/FileReadTool/index.js.map +0 -1
  457. package/dist/ui/tools/FileWriteTool/index.js +0 -61
  458. package/dist/ui/tools/FileWriteTool/index.js.map +0 -1
  459. package/dist/ui/tools/ForkTool/index.js +0 -47
  460. package/dist/ui/tools/ForkTool/index.js.map +0 -1
  461. package/dist/ui/tools/FrgTool/index.js +0 -96
  462. package/dist/ui/tools/FrgTool/index.js.map +0 -1
  463. package/dist/ui/tools/GetThreadTool/index.js +0 -39
  464. package/dist/ui/tools/GetThreadTool/index.js.map +0 -1
  465. package/dist/ui/tools/GlobTool/index.js +0 -50
  466. package/dist/ui/tools/GlobTool/index.js.map +0 -1
  467. package/dist/ui/tools/GrepTool/index.js +0 -84
  468. package/dist/ui/tools/GrepTool/index.js.map +0 -1
  469. package/dist/ui/tools/HatchArionTool/index.js +0 -36
  470. package/dist/ui/tools/HatchArionTool/index.js.map +0 -1
  471. package/dist/ui/tools/LearnSkillTool/index.js +0 -22
  472. package/dist/ui/tools/LearnSkillTool/index.js.map +0 -1
  473. package/dist/ui/tools/LearnTool/index.js +0 -43
  474. package/dist/ui/tools/LearnTool/index.js.map +0 -1
  475. package/dist/ui/tools/LearnToolTool/index.js +0 -22
  476. package/dist/ui/tools/LearnToolTool/index.js.map +0 -1
  477. package/dist/ui/tools/ListClientsTool/index.js +0 -39
  478. package/dist/ui/tools/ListClientsTool/index.js.map +0 -1
  479. package/dist/ui/tools/LspTool/index.js +0 -261
  480. package/dist/ui/tools/LspTool/index.js.map +0 -1
  481. package/dist/ui/tools/MCPTool/index.js +0 -33
  482. package/dist/ui/tools/MCPTool/index.js.map +0 -1
  483. package/dist/ui/tools/ManageNetworkTool/index.js +0 -53
  484. package/dist/ui/tools/ManageNetworkTool/index.js.map +0 -1
  485. package/dist/ui/tools/MemoryReadTool/index.js +0 -64
  486. package/dist/ui/tools/MemoryReadTool/index.js.map +0 -1
  487. package/dist/ui/tools/MemoryWriteTool/index.js +0 -20
  488. package/dist/ui/tools/MemoryWriteTool/index.js.map +0 -1
  489. package/dist/ui/tools/NotebookEditTool/index.js +0 -33
  490. package/dist/ui/tools/NotebookEditTool/index.js.map +0 -1
  491. package/dist/ui/tools/NotebookReadTool/index.js +0 -25
  492. package/dist/ui/tools/NotebookReadTool/index.js.map +0 -1
  493. package/dist/ui/tools/OutlookReadTool/index.js +0 -66
  494. package/dist/ui/tools/OutlookReadTool/index.js.map +0 -1
  495. package/dist/ui/tools/OutlookReplyTool/index.js +0 -49
  496. package/dist/ui/tools/OutlookReplyTool/index.js.map +0 -1
  497. package/dist/ui/tools/OutlookSendTool/index.js +0 -49
  498. package/dist/ui/tools/OutlookSendTool/index.js.map +0 -1
  499. package/dist/ui/tools/PauseDelegationTool/index.js +0 -35
  500. package/dist/ui/tools/PauseDelegationTool/index.js.map +0 -1
  501. package/dist/ui/tools/ProbeTool/index.js +0 -121
  502. package/dist/ui/tools/ProbeTool/index.js.map +0 -1
  503. package/dist/ui/tools/ProcessTool/index.js +0 -66
  504. package/dist/ui/tools/ProcessTool/index.js.map +0 -1
  505. package/dist/ui/tools/QuestListTool/index.js +0 -46
  506. package/dist/ui/tools/QuestListTool/index.js.map +0 -1
  507. package/dist/ui/tools/QuestReportTool/index.js +0 -49
  508. package/dist/ui/tools/QuestReportTool/index.js.map +0 -1
  509. package/dist/ui/tools/QuestUpdateTool/index.js +0 -87
  510. package/dist/ui/tools/QuestUpdateTool/index.js.map +0 -1
  511. package/dist/ui/tools/QuipCommentTool/index.js +0 -69
  512. package/dist/ui/tools/QuipCommentTool/index.js.map +0 -1
  513. package/dist/ui/tools/QuipReadTool/index.js +0 -71
  514. package/dist/ui/tools/QuipReadTool/index.js.map +0 -1
  515. package/dist/ui/tools/RestArionTool/index.js +0 -32
  516. package/dist/ui/tools/RestArionTool/index.js.map +0 -1
  517. package/dist/ui/tools/RestartTool/index.js +0 -35
  518. package/dist/ui/tools/RestartTool/index.js.map +0 -1
  519. package/dist/ui/tools/ResumeDelegationTool/index.js +0 -35
  520. package/dist/ui/tools/ResumeDelegationTool/index.js.map +0 -1
  521. package/dist/ui/tools/RetireArionTool/index.js +0 -32
  522. package/dist/ui/tools/RetireArionTool/index.js.map +0 -1
  523. package/dist/ui/tools/RgTool/index.js +0 -73
  524. package/dist/ui/tools/RgTool/index.js.map +0 -1
  525. package/dist/ui/tools/SearchKnowledgeTool/index.js +0 -43
  526. package/dist/ui/tools/SearchKnowledgeTool/index.js.map +0 -1
  527. package/dist/ui/tools/SearchMessagesTool/index.js +0 -43
  528. package/dist/ui/tools/SearchMessagesTool/index.js.map +0 -1
  529. package/dist/ui/tools/SelfDiagnoseTool/index.js +0 -61
  530. package/dist/ui/tools/SelfDiagnoseTool/index.js.map +0 -1
  531. package/dist/ui/tools/SendMessageTool/index.js +0 -45
  532. package/dist/ui/tools/SendMessageTool/index.js.map +0 -1
  533. package/dist/ui/tools/SerenaTool/index.js +0 -124
  534. package/dist/ui/tools/SerenaTool/index.js.map +0 -1
  535. package/dist/ui/tools/SessionHistoryTool/index.js +0 -52
  536. package/dist/ui/tools/SessionHistoryTool/index.js.map +0 -1
  537. package/dist/ui/tools/SgTool/index.js +0 -80
  538. package/dist/ui/tools/SgTool/index.js.map +0 -1
  539. package/dist/ui/tools/SlackReactTool/index.js +0 -41
  540. package/dist/ui/tools/SlackReactTool/index.js.map +0 -1
  541. package/dist/ui/tools/SlackReadTool/index.js +0 -48
  542. package/dist/ui/tools/SlackReadTool/index.js.map +0 -1
  543. package/dist/ui/tools/SlackSendTool/index.js +0 -45
  544. package/dist/ui/tools/SlackSendTool/index.js.map +0 -1
  545. package/dist/ui/tools/SpawnWorkerTool/index.js +0 -33
  546. package/dist/ui/tools/SpawnWorkerTool/index.js.map +0 -1
  547. package/dist/ui/tools/StickerRequestTool/index.js +0 -19
  548. package/dist/ui/tools/StickerRequestTool/index.js.map +0 -1
  549. package/dist/ui/tools/ThinkTool/index.js +0 -17
  550. package/dist/ui/tools/ThinkTool/index.js.map +0 -1
  551. package/dist/ui/tools/UgTool/index.js +0 -108
  552. package/dist/ui/tools/UgTool/index.js.map +0 -1
  553. package/dist/ui/tools/UseSkillTool/index.js +0 -22
  554. package/dist/ui/tools/UseSkillTool/index.js.map +0 -1
  555. package/dist/ui/tools/WakeArionTool/index.js +0 -32
  556. package/dist/ui/tools/WakeArionTool/index.js.map +0 -1
  557. package/dist/ui/tools/WebFetchTool/index.js +0 -56
  558. package/dist/ui/tools/WebFetchTool/index.js.map +0 -1
  559. package/dist/ui/tools/WebSearchTool/index.js +0 -44
  560. package/dist/ui/tools/WebSearchTool/index.js.map +0 -1
  561. package/dist/ui/tools/lsTool/index.js +0 -58
  562. package/dist/ui/tools/lsTool/index.js.map +0 -1
  563. package/dist/ui/tools/registry.js +0 -197
  564. package/dist/ui/tools/registry.js.map +0 -1
  565. package/dist/ui/tools/tool-renderer.js +0 -11
  566. package/dist/ui/tools/tool-renderer.js.map +0 -1
  567. package/dist/ui/tools/truncation.js +0 -35
  568. package/dist/ui/tools/truncation.js.map +0 -1
  569. package/dist/ui/types/anthropic.js +0 -4
  570. package/dist/ui/types/anthropic.js.map +0 -1
  571. package/dist/ui/types/index.js +0 -2
  572. package/dist/ui/types/index.js.map +0 -1
  573. package/dist/ui/types/message.js +0 -3
  574. package/dist/ui/types/message.js.map +0 -1
  575. package/dist/ui/types/tool.js +0 -4
  576. package/dist/ui/types/tool.js.map +0 -1
  577. package/dist/ui/utils/array.js +0 -4
  578. package/dist/ui/utils/array.js.map +0 -1
  579. package/dist/ui/utils/cursor.js +0 -131
  580. package/dist/ui/utils/cursor.js.map +0 -1
  581. package/dist/ui/utils/diff.js +0 -120
  582. package/dist/ui/utils/diff.js.map +0 -1
  583. package/dist/ui/utils/format.js +0 -42
  584. package/dist/ui/utils/format.js.map +0 -1
  585. package/dist/ui/utils/fuzzy.js +0 -59
  586. package/dist/ui/utils/fuzzy.js.map +0 -1
  587. package/dist/ui/utils/index.js +0 -11
  588. package/dist/ui/utils/index.js.map +0 -1
  589. package/dist/ui/utils/keys.js +0 -8
  590. package/dist/ui/utils/keys.js.map +0 -1
  591. package/dist/ui/utils/patch.js +0 -17
  592. package/dist/ui/utils/patch.js.map +0 -1
  593. package/dist/ui/utils/risk.js +0 -114
  594. package/dist/ui/utils/risk.js.map +0 -1
  595. package/dist/ui/utils/terminal-image.js +0 -70
  596. package/dist/ui/utils/terminal-image.js.map +0 -1
  597. package/dist/ui/utils/validation.js +0 -48
  598. package/dist/ui/utils/validation.js.map +0 -1
  599. package/dist/ui/verb-pairs.js +0 -248
  600. package/dist/ui/verb-pairs.js.map +0 -1
  601. package/dist/ui.js +0 -131
  602. package/dist/ui.js.map +0 -1
  603. package/src/entrypoints/command-mode.ts +0 -5
  604. package/src/entrypoints/daemon.ts +0 -54
  605. package/src/entrypoints/headless-stdio.ts +0 -27
  606. package/src/entrypoints/interactive.ts +0 -112
  607. package/src/main.ts +0 -72
  608. package/src/runtime/configure-bun-sqlite.ts +0 -3
  609. package/src/runtime/crash-handlers.ts +0 -128
  610. package/src/runtime/interactive-invocation.test.ts +0 -42
  611. package/src/runtime/interactive-invocation.ts +0 -51
  612. package/src/runtime/internal-mode.test.ts +0 -19
  613. package/src/runtime/internal-mode.ts +0 -24
  614. package/src/runtime/launch-spec.test.ts +0 -26
  615. package/src/runtime/launch-spec.ts +0 -84
  616. package/src/runtime/owner-lease.ts +0 -52
  617. package/src/runtime/public-mode.test.ts +0 -18
  618. package/src/runtime/public-mode.ts +0 -19
  619. package/src/runtime/run-internal-mode.ts +0 -19
  620. package/src/runtime/runtime-kind.test.ts +0 -23
  621. package/src/runtime/runtime-kind.ts +0 -41
  622. package/src/runtime/spawn-aria.ts +0 -62
@@ -1,112 +0,0 @@
1
- import { ArionManager, ArionStorage } from "@aria-cli/aria";
2
- import { Memoria } from "@aria-cli/memoria";
3
- import { getCliModels } from "@aria-cli/models";
4
- import type { InteractiveInvocation } from "../runtime/interactive-invocation.js";
5
- import { createAttachedCliContext } from "../cli-context.js";
6
- import { getAriaDir } from "../config.js";
7
- import { ensureDaemon } from "../ensure-daemon.js";
8
- import { startInkRepl } from "../ink-repl.js";
9
- import { attachExistingLocalControlClient } from "../local-control-client.js";
10
- import { SessionHistory } from "../history/index.js";
11
- import { ArionSession } from "../session.js";
12
-
13
- async function recallUserName(memoria: Memoria): Promise<string | null> {
14
- try {
15
- const raw = memoria.storage?.getConfigValue?.("user_profile");
16
- return raw ? (JSON.parse(raw).name ?? null) : null;
17
- } catch {
18
- return null;
19
- }
20
- }
21
-
22
- export async function runInteractiveEntrypoint(invocation: InteractiveInvocation): Promise<void> {
23
- const ariaHome = getAriaDir();
24
- const cli = await createAttachedCliContext();
25
-
26
- await ensureDaemon(cli);
27
-
28
- const attached = await attachExistingLocalControlClient({
29
- ariaHome,
30
- clientKind: "tui",
31
- });
32
-
33
- if (!attached) {
34
- throw new Error("[aria] Attached REPL requires an existing local-control runtime");
35
- }
36
-
37
- const memoriaPath = process.env.ARIA_MEMORY_PATH || `${cli.ariaDir}/arions/ARIA/memory.db`;
38
- const memoria = new Memoria({ path: memoriaPath, router: cli.router });
39
- memoria.initialize().catch((error) => {
40
- console.debug(
41
- `[aria] Memoria background init failed (will retry on use): ${error?.message ?? error}`,
42
- );
43
- });
44
-
45
- const aria = {
46
- components: { memoria },
47
- recallUserName: () => recallUserName(memoria),
48
- shutdown: async () => {
49
- await memoria.close();
50
- await cli.pool.closeAll();
51
- },
52
- };
53
-
54
- const storage = new ArionStorage(cli.ariaDir);
55
- const manager = new ArionManager(storage, cli.memoriaFactory);
56
- await manager.initialize();
57
- manager.setRouter(cli.router);
58
-
59
- const activeArion = cli.config.activeArion?.trim() || "ARIA";
60
- const historyPath = SessionHistory.resolvePerArionPath(cli.ariaDir, activeArion);
61
- SessionHistory.migrateJsonlLogs(cli.ariaDir, activeArion);
62
- const history = new SessionHistory(historyPath);
63
- const inputHistory = history.getInputHistory(100);
64
- const appendInputHistory = (value: string) => history.addInputHistory(value);
65
-
66
- let resolvedSessionId: string | undefined;
67
- if (invocation.resumeSessionId) {
68
- const found = history.findSessionByPrefix(invocation.resumeSessionId);
69
- if (!found) {
70
- throw new Error(`Error: No session found matching \"${invocation.resumeSessionId}\"`);
71
- }
72
- resolvedSessionId = found;
73
- } else if (invocation.continueLatest) {
74
- const latest = history.listSessions(1);
75
- if (latest.length === 0) {
76
- throw new Error("Error: No recent sessions to continue");
77
- }
78
- resolvedSessionId = latest[0]?.id;
79
- }
80
-
81
- const session = new ArionSession({
82
- manager,
83
- router: cli.router,
84
- memoria,
85
- onArionRest: async () => {},
86
- });
87
- await session.initialize(cli.config.activeArion);
88
-
89
- const cachedUserName = await recallUserName(memoria);
90
- const initialModelSnapshot = await attached.control.getModelSnapshot?.().catch(() => undefined);
91
-
92
- await startInkRepl(
93
- session,
94
- manager,
95
- cli.router,
96
- aria,
97
- attached,
98
- cli,
99
- inputHistory,
100
- appendInputHistory,
101
- history,
102
- invocation.prompt,
103
- cachedUserName,
104
- resolvedSessionId,
105
- (initialModelSnapshot?.models as
106
- | readonly import("@aria-cli/models").ReadonlyModelDefinition[]
107
- | undefined) ?? getCliModels(),
108
- undefined,
109
- cli.credentialHints,
110
- cli.authResolver,
111
- );
112
- }
package/src/main.ts DELETED
@@ -1,72 +0,0 @@
1
- import "./runtime/configure-bun-sqlite.js";
2
- import { installProcessCrashHandlers } from "./runtime/crash-handlers.js";
3
- import { installOwnerLeaseIfNeeded } from "./runtime/owner-lease.js";
4
- import { parseInternalInvocation } from "./runtime/internal-mode.js";
5
- import { isPublicCommandInvocation } from "./runtime/public-mode.js";
6
- import { parseInteractiveInvocation } from "./runtime/interactive-invocation.js";
7
- import { isChildProcess, superviseInteractiveSession } from "./relaunch.js";
8
- import { isCompiledRuntime } from "./runtime/runtime-kind.js";
9
-
10
- export async function main(argv = process.argv): Promise<void> {
11
- installProcessCrashHandlers();
12
- installOwnerLeaseIfNeeded();
13
-
14
- const userArgs = argv.slice(2);
15
-
16
- const internal = parseInternalInvocation(userArgs);
17
- if (internal) {
18
- const { runInternalMode } = await import("./runtime/run-internal-mode.js");
19
- await runInternalMode(internal);
20
- return;
21
- }
22
-
23
- if (isPublicCommandInvocation(userArgs)) {
24
- const { runCommandMode } = await import("./entrypoints/command-mode.js");
25
- await runCommandMode(argv);
26
- return;
27
- }
28
-
29
- const interactive = parseInteractiveInvocation(userArgs);
30
- if (isChildProcess()) {
31
- const { runInteractiveEntrypoint } = await import("./entrypoints/interactive.js");
32
- await runInteractiveEntrypoint(interactive);
33
- return;
34
- }
35
-
36
- // Compiled binary: run REPL directly in this process instead of spawning
37
- // a supervisor + child (which loads the 82MB binary twice). Saves ~3-13s
38
- // on cold start. Relaunch (rare) spawns a new process in supervisor mode.
39
- // ARIA_USE_SUPERVISOR is set by requestRelaunch() to force the supervisor
40
- // path on respawned processes, preventing waiter process accumulation.
41
- if (isCompiledRuntime() && !process.env.ARIA_USE_SUPERVISOR) {
42
- await runCompiledDirect(interactive);
43
- return;
44
- }
45
-
46
- await superviseInteractiveSession(interactive);
47
- }
48
-
49
- /**
50
- * Compiled-binary direct mode: run the REPL in-process (single binary load).
51
- *
52
- * The normal supervisor pattern loads the 82MB binary twice (parent + child).
53
- * In compiled mode, we skip the supervisor and run the REPL directly. If the
54
- * user requests a relaunch (rare), requestRelaunch() spawns a new process
55
- * with resume env vars — the current process waits and propagates exit code.
56
- */
57
- async function runCompiledDirect(
58
- interactive: import("./runtime/interactive-invocation.js").InteractiveInvocation,
59
- ): Promise<void> {
60
- const { NO_RELAUNCH_ENV } = await import("@aria-cli/types");
61
- process.env[NO_RELAUNCH_ENV] = "true";
62
- const { runInteractiveEntrypoint } = await import("./entrypoints/interactive.js");
63
- await runInteractiveEntrypoint(interactive);
64
- }
65
-
66
- if ((import.meta as ImportMeta & { main?: boolean }).main) {
67
- main(process.argv).catch((error) => {
68
- const message = error instanceof Error ? (error.stack ?? error.message) : String(error);
69
- process.stderr.write(`${message}\n`);
70
- process.exit(1);
71
- });
72
- }
@@ -1,3 +0,0 @@
1
- import { configureBunCustomSqlite } from "@aria-cli/tools";
2
-
3
- configureBunCustomSqlite();
@@ -1,128 +0,0 @@
1
- import { createHash } from "node:crypto";
2
- import { appendFileSync, mkdirSync, writeFileSync } from "node:fs";
3
- import { homedir } from "node:os";
4
- import { join } from "node:path";
5
- import v8 from "node:v8";
6
- import { RESUME_SESSION_ENV } from "@aria-cli/types";
7
-
8
- function getAriaHome(): string {
9
- return process.env.ARIA_HOME?.trim() || join(homedir(), ".aria");
10
- }
11
-
12
- function writeCrashReport(type: string, error: unknown): void {
13
- try {
14
- const crashDir = join(getAriaHome(), "crash-reports");
15
- mkdirSync(crashDir, { recursive: true });
16
-
17
- const err = error instanceof Error ? error : new Error(String(error));
18
- const memory = process.memoryUsage();
19
- const timestamp = new Date().toISOString();
20
- const sessionId = process.env[RESUME_SESSION_ENV] || "unknown";
21
- const payload = {
22
- timestamp,
23
- sessionId,
24
- type,
25
- error: {
26
- message: err.message,
27
- stack: err.stack,
28
- name: err.name,
29
- },
30
- process: {
31
- pid: process.pid,
32
- heapUsedMb: Math.round((memory.heapUsed / 1024 / 1024) * 100) / 100,
33
- rssMb: Math.round((memory.rss / 1024 / 1024) * 100) / 100,
34
- uptime: Math.round(process.uptime()),
35
- },
36
- };
37
-
38
- writeFileSync(join(crashDir, "latest.json"), JSON.stringify(payload, null, 2));
39
-
40
- const stackFirst = err.stack?.split("\n")[1]?.trim() ?? "";
41
- const bucket = Math.floor(Date.now() / 10000);
42
- const fingerprint = createHash("sha256")
43
- .update(`${err.message}|${stackFirst}|${bucket}`)
44
- .digest("hex")
45
- .slice(0, 12);
46
-
47
- appendFileSync(
48
- join(getAriaHome(), "error-events.jsonl"),
49
- `${JSON.stringify({
50
- id: `crash-${fingerprint}`,
51
- timestamp,
52
- severity: 0,
53
- category: "crash",
54
- domain: "cli",
55
- name: err.name,
56
- message: err.message,
57
- stackTrace: err.stack,
58
- recoverable: false,
59
- status: "new",
60
- })}\n`,
61
- "utf-8",
62
- );
63
- } catch {
64
- // Best effort only.
65
- }
66
- }
67
-
68
- let installed = false;
69
-
70
- /**
71
- * Install V8 heap diagnostics for OOM investigation.
72
- *
73
- * - `setHeapSnapshotNearHeapLimit(3)`: Auto-captures up to 3 progressive heap
74
- * snapshots as the heap approaches the V8 limit. Snapshots land in the
75
- * diagnostic directory and survive the crash — load in Chrome DevTools
76
- * Memory tab for retainer trace analysis.
77
- *
78
- * - `process.report.reportOnFatalError`: Generates a diagnostic JSON report
79
- * on fatal errors (including OOM) with native stack, heap space breakdown,
80
- * libuv handles, and resource usage.
81
- *
82
- * Both are lightweight and production-safe — zero overhead until triggered.
83
- */
84
- function installHeapDiagnostics(): void {
85
- const crashDir = join(getAriaHome(), "crash-reports");
86
- mkdirSync(crashDir, { recursive: true });
87
-
88
- // Auto-capture heap snapshots as V8 approaches the heap limit.
89
- // Writes .heapsnapshot files to crashDir before OOM kills the process.
90
- try {
91
- v8.setHeapSnapshotNearHeapLimit(3);
92
- } catch {
93
- // Bun or older Node without this API — non-fatal.
94
- }
95
-
96
- // Generate a diagnostic report JSON on fatal errors (OOM, segfault).
97
- try {
98
- process.report.reportOnFatalError = true;
99
- process.report.directory = crashDir;
100
- } catch {
101
- // Non-fatal if report API is unavailable.
102
- }
103
- }
104
-
105
- export function installProcessCrashHandlers(): void {
106
- if (installed) return;
107
- installed = true;
108
-
109
- installHeapDiagnostics();
110
-
111
- process.on("uncaughtException", (error, origin) => {
112
- writeCrashReport("uncaughtException", error);
113
- process.stderr.write(`[aria] FATAL uncaughtException (origin: ${origin}):\n`);
114
- process.stderr.write(
115
- `${error instanceof Error ? (error.stack ?? error.message) : String(error)}\n`,
116
- );
117
- process.exit(1);
118
- });
119
-
120
- process.on("unhandledRejection", (error) => {
121
- writeCrashReport("unhandledRejection", error);
122
- process.stderr.write("[aria] FATAL unhandledRejection:\n");
123
- process.stderr.write(
124
- `${error instanceof Error ? (error.stack ?? error.message) : String(error)}\n`,
125
- );
126
- process.exit(1);
127
- });
128
- }
@@ -1,42 +0,0 @@
1
- import { afterEach, describe, expect, it } from "vitest";
2
- import { parseInteractiveInvocation } from "./interactive-invocation.js";
3
-
4
- describe("parseInteractiveInvocation", () => {
5
- const originalResume = process.env.ARIA_RESUME_SESSION_ID;
6
- const originalRestartKind = process.env.ARIA_RESTART_KIND;
7
-
8
- afterEach(() => {
9
- if (originalResume === undefined) delete process.env.ARIA_RESUME_SESSION_ID;
10
- else process.env.ARIA_RESUME_SESSION_ID = originalResume;
11
-
12
- if (originalRestartKind === undefined) delete process.env.ARIA_RESTART_KIND;
13
- else process.env.ARIA_RESTART_KIND = originalRestartKind;
14
- });
15
-
16
- it("parses a prompt", () => {
17
- expect(parseInteractiveInvocation(["hello", "world"]).prompt).toBe("hello world");
18
- });
19
-
20
- it("parses resume flag", () => {
21
- expect(parseInteractiveInvocation(["--resume", "sess-1"]).resumeSessionId).toBe("sess-1");
22
- });
23
-
24
- it("parses continue flag", () => {
25
- expect(parseInteractiveInvocation(["--continue"]).continueLatest).toBe(true);
26
- });
27
-
28
- it("consumes resume env when explicit args are absent", () => {
29
- process.env.ARIA_RESUME_SESSION_ID = "sess-env";
30
- process.env.ARIA_RESTART_KIND = "explicit";
31
- const parsed = parseInteractiveInvocation([]);
32
- expect(parsed.resumeSessionId).toBe("sess-env");
33
- expect(process.env.ARIA_RESUME_SESSION_ID).toBeUndefined();
34
- expect(process.env.ARIA_RESTART_KIND).toBeUndefined();
35
- });
36
-
37
- it("rejects resume + continue together", () => {
38
- expect(() => parseInteractiveInvocation(["--resume", "sess-1", "--continue"])).toThrow(
39
- /mutually exclusive/i,
40
- );
41
- });
42
- });
@@ -1,51 +0,0 @@
1
- import { RESUME_SESSION_ENV, RESTART_KIND_ENV } from "@aria-cli/types";
2
-
3
- export interface InteractiveInvocation {
4
- prompt?: string;
5
- resumeSessionId?: string | null;
6
- continueLatest?: boolean;
7
- rawArgs: string[];
8
- }
9
-
10
- export function parseInteractiveInvocation(argv: string[]): InteractiveInvocation {
11
- let resumeSessionId: string | null = null;
12
- let continueLatest = false;
13
- const promptParts: string[] = [];
14
-
15
- for (let i = 0; i < argv.length; i += 1) {
16
- const arg = argv[i];
17
- if (arg === undefined) continue;
18
-
19
- if (arg === "-r" || arg === "--resume") {
20
- const next = argv[i + 1];
21
- if (!next) throw new Error("Error: -r/--resume requires a session ID");
22
- resumeSessionId = next;
23
- i += 1;
24
- continue;
25
- }
26
-
27
- if (arg === "-c" || arg === "--continue") {
28
- continueLatest = true;
29
- continue;
30
- }
31
-
32
- promptParts.push(arg);
33
- }
34
-
35
- if (resumeSessionId && continueLatest) {
36
- throw new Error("Error: -r/--resume and -c/--continue are mutually exclusive");
37
- }
38
-
39
- if (!resumeSessionId && !continueLatest && process.env[RESUME_SESSION_ENV]) {
40
- resumeSessionId = process.env[RESUME_SESSION_ENV] ?? null;
41
- delete process.env[RESUME_SESSION_ENV];
42
- delete process.env[RESTART_KIND_ENV];
43
- }
44
-
45
- return {
46
- prompt: promptParts.length > 0 ? promptParts.join(" ") : undefined,
47
- resumeSessionId,
48
- continueLatest,
49
- rawArgs: [...argv],
50
- };
51
- }
@@ -1,19 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { parseInternalInvocation } from "./internal-mode.js";
3
-
4
- describe("parseInternalInvocation", () => {
5
- it("returns null for public args", () => {
6
- expect(parseInternalInvocation(["auth"])).toBeNull();
7
- });
8
-
9
- it("parses valid internal mode", () => {
10
- expect(parseInternalInvocation(["__internal", "daemon", "--port", "0"])).toEqual({
11
- mode: "daemon",
12
- args: ["--port", "0"],
13
- });
14
- });
15
-
16
- it("throws on unknown internal mode", () => {
17
- expect(() => parseInternalInvocation(["__internal", "wat"])).toThrow(/Unknown internal mode/i);
18
- });
19
- });
@@ -1,24 +0,0 @@
1
- export type InternalMode = "repl" | "daemon" | "headless-stdio";
2
-
3
- export interface InternalInvocation {
4
- mode: InternalMode;
5
- args: string[];
6
- }
7
-
8
- export const INTERNAL_SENTINEL = "__internal";
9
-
10
- export function parseInternalInvocation(argv: string[]): InternalInvocation | null {
11
- if (argv[0] !== INTERNAL_SENTINEL) return null;
12
-
13
- const mode = argv[1];
14
- if (mode !== "repl" && mode !== "daemon" && mode !== "headless-stdio") {
15
- throw new Error(
16
- `[aria] Unknown internal mode \"${String(mode)}\". Expected repl | daemon | headless-stdio.`,
17
- );
18
- }
19
-
20
- return {
21
- mode,
22
- args: argv.slice(2),
23
- };
24
- }
@@ -1,26 +0,0 @@
1
- import { afterEach, describe, expect, it } from "vitest";
2
- import { resolveAriaLaunchSpec } from "./launch-spec.js";
3
-
4
- describe("resolveAriaLaunchSpec", () => {
5
- const originalOverride = process.env.ARIA_RUNTIME_KIND;
6
-
7
- afterEach(() => {
8
- if (originalOverride === undefined) delete process.env.ARIA_RUNTIME_KIND;
9
- else process.env.ARIA_RUNTIME_KIND = originalOverride;
10
- });
11
-
12
- it("resolves source-bun launch spec", () => {
13
- process.env.ARIA_RUNTIME_KIND = "source-bun";
14
- const spec = resolveAriaLaunchSpec({ mode: "daemon", args: ["--port", "0"] });
15
- expect(spec.command === "bun" || spec.command === "bun.exe").toBe(true);
16
- expect(spec.args).toContain("__internal");
17
- expect(spec.args).toContain("daemon");
18
- });
19
-
20
- it("resolves compiled-bun launch spec", () => {
21
- process.env.ARIA_RUNTIME_KIND = "compiled-bun";
22
- const spec = resolveAriaLaunchSpec({ mode: "repl", args: ["--continue"] });
23
- expect(spec.command).toBe(process.execPath);
24
- expect(spec.args.slice(0, 2)).toEqual(["__internal", "repl"]);
25
- });
26
- });
@@ -1,84 +0,0 @@
1
- import { existsSync } from "node:fs";
2
- import { fileURLToPath } from "node:url";
3
- import { getRuntimeKind } from "./runtime-kind.js";
4
-
5
- export type AriaLaunchMode = "repl" | "daemon" | "headless-stdio";
6
-
7
- export interface AriaLaunchSpecInput {
8
- mode: AriaLaunchMode;
9
- args?: string[];
10
- env?: NodeJS.ProcessEnv;
11
- cwd?: string;
12
- }
13
-
14
- export interface LaunchSpec {
15
- command: string;
16
- args: string[];
17
- env: NodeJS.ProcessEnv;
18
- cwd: string;
19
- }
20
-
21
- function getBunCommand(): string {
22
- return process.platform === "win32" ? "bun.exe" : "bun";
23
- }
24
-
25
- function resolveSourceEntrypoint(): string {
26
- const candidates = [
27
- fileURLToPath(new URL("../main.ts", import.meta.url)),
28
- fileURLToPath(new URL("../main.js", import.meta.url)),
29
- ];
30
-
31
- for (const candidate of candidates) {
32
- if (existsSync(candidate)) {
33
- return candidate;
34
- }
35
- }
36
-
37
- throw new Error("[aria] Could not resolve Bun source entrypoint for internal relaunch");
38
- }
39
-
40
- function resolveBundledEntrypoint(): string {
41
- // In npm-installed bundle, argv[1] is the aria.mjs file itself
42
- const argv1 = process.argv[1] ?? "";
43
- if (existsSync(argv1)) return argv1;
44
- // Fallback: look relative to import.meta.url
45
- const candidates = [
46
- fileURLToPath(new URL("../../bin/aria.mjs", import.meta.url)),
47
- fileURLToPath(new URL("../bin/aria.mjs", import.meta.url)),
48
- ];
49
- for (const c of candidates) {
50
- if (existsSync(c)) return c;
51
- }
52
- throw new Error("[aria] Could not resolve bundled entrypoint for internal relaunch");
53
- }
54
-
55
- export function resolveAriaLaunchSpec(input: AriaLaunchSpecInput): LaunchSpec {
56
- const runtimeKind = getRuntimeKind();
57
- const forwardedArgs = input.args ?? [];
58
- const env = { ...process.env, ...(input.env ?? {}) };
59
- const cwd = input.cwd ?? process.cwd();
60
-
61
- switch (runtimeKind) {
62
- case "source-bun":
63
- return {
64
- command: getBunCommand(),
65
- args: [resolveSourceEntrypoint(), "__internal", input.mode, ...forwardedArgs],
66
- env,
67
- cwd,
68
- };
69
- case "bundled-bun":
70
- return {
71
- command: getBunCommand(),
72
- args: [resolveBundledEntrypoint(), "__internal", input.mode, ...forwardedArgs],
73
- env,
74
- cwd,
75
- };
76
- case "compiled-bun":
77
- return {
78
- command: process.execPath,
79
- args: ["__internal", input.mode, ...forwardedArgs],
80
- env,
81
- cwd,
82
- };
83
- }
84
- }
@@ -1,52 +0,0 @@
1
- export function installOwnerLeaseIfNeeded(
2
- options: {
3
- env?: NodeJS.ProcessEnv;
4
- processRef?: Pick<NodeJS.Process, "env" | "kill" | "pid" | "once">;
5
- pollMs?: number;
6
- onOwnerGone?: (ownerPid: number) => void;
7
- } = {},
8
- ): () => void {
9
- const env = options.env ?? process.env;
10
- const processRef = options.processRef ?? process;
11
- const pollMs = options.pollMs ?? 1000;
12
-
13
- const ownerPidRaw = env.ARIA_HARNESS_OWNER_PID;
14
- if (!ownerPidRaw) return () => {};
15
-
16
- const ownerPid = Number.parseInt(ownerPidRaw, 10);
17
- if (!Number.isFinite(ownerPid) || ownerPid <= 0) {
18
- throw new Error(`ARIA_HARNESS_OWNER_PID must be a positive integer, got: ${ownerPidRaw}`);
19
- }
20
-
21
- let released = false;
22
- const interval = setInterval(() => {
23
- if (released) return;
24
- try {
25
- processRef.kill(ownerPid, 0);
26
- } catch (error) {
27
- const code =
28
- error && typeof error === "object" && "code" in error
29
- ? (error as { code?: string }).code
30
- : undefined;
31
- if (code && code !== "ESRCH") return;
32
- released = true;
33
- clearInterval(interval);
34
- if (options.onOwnerGone) {
35
- options.onOwnerGone(ownerPid);
36
- return;
37
- }
38
- processRef.kill(processRef.pid, "SIGTERM");
39
- }
40
- }, pollMs);
41
-
42
- interval.unref?.();
43
-
44
- const dispose = () => {
45
- if (released) return;
46
- released = true;
47
- clearInterval(interval);
48
- };
49
-
50
- processRef.once("exit", dispose);
51
- return dispose;
52
- }
@@ -1,18 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { isPublicCommandInvocation } from "./public-mode.js";
3
-
4
- describe("isPublicCommandInvocation", () => {
5
- it("detects explicit commands", () => {
6
- expect(isPublicCommandInvocation(["auth"])).toBe(true);
7
- expect(isPublicCommandInvocation(["daemon"])).toBe(true);
8
- });
9
-
10
- it("detects top-level flags", () => {
11
- expect(isPublicCommandInvocation(["--version"])).toBe(true);
12
- expect(isPublicCommandInvocation(["--help"])).toBe(true);
13
- });
14
-
15
- it("does not treat prompt text as public command", () => {
16
- expect(isPublicCommandInvocation(["hello", "world"])).toBe(false);
17
- });
18
- });
@@ -1,19 +0,0 @@
1
- const PUBLIC_TOP_LEVELS = new Set([
2
- "daemon",
3
- "auth",
4
- "arions",
5
- "headless",
6
- "call",
7
- "pairing",
8
- "runtime-cutover-reset",
9
- "--help",
10
- "-h",
11
- "--version",
12
- "-v",
13
- ]);
14
-
15
- export function isPublicCommandInvocation(argv: string[]): boolean {
16
- const first = argv[0];
17
- if (!first) return false;
18
- return PUBLIC_TOP_LEVELS.has(first) || first.startsWith("--");
19
- }
@@ -1,19 +0,0 @@
1
- import type { InternalInvocation } from "./internal-mode.js";
2
- import { parseInteractiveInvocation } from "./interactive-invocation.js";
3
- import { runInteractiveEntrypoint } from "../entrypoints/interactive.js";
4
- import { runDaemonEntrypoint } from "../entrypoints/daemon.js";
5
- import { runHeadlessStdioEntrypoint } from "../entrypoints/headless-stdio.js";
6
-
7
- export async function runInternalMode(invocation: InternalInvocation): Promise<void> {
8
- switch (invocation.mode) {
9
- case "repl":
10
- await runInteractiveEntrypoint(parseInteractiveInvocation(invocation.args));
11
- return;
12
- case "daemon":
13
- await runDaemonEntrypoint(invocation.args);
14
- return;
15
- case "headless-stdio":
16
- await runHeadlessStdioEntrypoint(invocation.args);
17
- return;
18
- }
19
- }