@aria-cli/cli 1.0.57 → 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 (319) 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/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,2 +0,0 @@
1
- export { assertAttachableRuntimeBootstrap, createLocalControlClient, } from "./local-control-http-client.js";
2
- //# sourceMappingURL=bootstrap-local-control-client.js.map
@@ -1,42 +0,0 @@
1
- function resolveTarget(getTarget) {
2
- const target = getTarget();
3
- if (!target) {
4
- throw new Error("Late-bound service target is unavailable");
5
- }
6
- return target;
7
- }
8
- export function createCapabilityAwareMethodProxy(getTarget) {
9
- return new Proxy({}, {
10
- get(_target, prop) {
11
- if (prop === "then")
12
- return undefined; // not a thenable — prevent Promise machinery crash
13
- const targetRecord = resolveTarget(getTarget);
14
- const method = targetRecord[prop];
15
- if (typeof method !== "function") {
16
- throw new Error(`Late-bound service method ${String(prop)} is unavailable`);
17
- }
18
- return (...args) => method.apply(resolveTarget(getTarget), args);
19
- },
20
- has(_target, prop) {
21
- const targetRecord = getTarget();
22
- return typeof targetRecord?.[prop] === "function";
23
- },
24
- ownKeys() {
25
- const targetRecord = getTarget();
26
- return Reflect.ownKeys(targetRecord ?? {}).filter((prop) => typeof targetRecord?.[prop] === "function");
27
- },
28
- getOwnPropertyDescriptor(_target, prop) {
29
- const targetRecord = getTarget();
30
- if (typeof targetRecord?.[prop] !== "function") {
31
- return undefined;
32
- }
33
- return {
34
- configurable: true,
35
- enumerable: true,
36
- writable: false,
37
- value: targetRecord[prop],
38
- };
39
- },
40
- });
41
- }
42
- //# sourceMappingURL=capability-aware-method-proxy.js.map
@@ -1,160 +0,0 @@
1
- /**
2
- * Shared CLI bootstrap context used by all CLI entry points (REPL, daemon, headless).
3
- *
4
- * Eliminates the duplicated config → env vars → router → pool pattern that
5
- * previously appeared in every CLI command.
6
- */
7
- import { createRuntimeDefaultRouter, getCliModels, ModelDiscovery, } from "@aria-cli/models";
8
- import { createRuntimeAuthContext } from "@aria-cli/auth";
9
- import { MemoriaPool } from "@aria-cli/aria";
10
- import { loadConfig, getAriaDir, saveConfig, persistAwsSelectorHintsFromEnv } from "./config.js";
11
- import { loadAriaConfig } from "./config/index.js";
12
- export async function createAttachedCliContext(opts) {
13
- const config = loadConfig();
14
- const projectConfig = await loadAriaConfig(opts?.cwd ?? process.cwd());
15
- const ariaDir = getAriaDir();
16
- const awsRegion = config.awsRegion;
17
- const awsProfile = config.awsProfile;
18
- const awsConfigFile = config.awsConfigFile;
19
- const awsSharedCredentialsFile = config.awsSharedCredentialsFile;
20
- // envPolicy: "ignore" — the daemon process owns credential resolution, not the
21
- // attached CLI's environment. Env vars in the CLI process must not leak into
22
- // the daemon's auth decisions; use /auth import-env to explicitly import them.
23
- const runtimeAuthContext = createRuntimeAuthContext({
24
- ariaHome: ariaDir,
25
- envPolicy: "ignore",
26
- ...(awsRegion || awsProfile || awsConfigFile || awsSharedCredentialsFile
27
- ? {
28
- bedrock: { awsRegion, awsProfile, awsConfigFile, awsSharedCredentialsFile },
29
- }
30
- : {}),
31
- });
32
- const authResolver = runtimeAuthContext.authResolver;
33
- const router = await createRuntimeDefaultRouter({
34
- ariaHome: ariaDir,
35
- authResolver,
36
- ...(awsRegion || awsProfile || awsConfigFile || awsSharedCredentialsFile
37
- ? {
38
- bedrock: { awsRegion, awsProfile, awsConfigFile, awsSharedCredentialsFile },
39
- }
40
- : {}),
41
- });
42
- const pool = new MemoriaPool(ariaDir, router);
43
- const discovery = new ModelDiscovery({
44
- authResolver,
45
- awsRegion,
46
- awsProfile,
47
- awsConfigFile,
48
- awsSharedCredentialsFile,
49
- cacheDir: ariaDir,
50
- });
51
- const availableModels = getCliModels(discovery.getCachedModels());
52
- return {
53
- config,
54
- router,
55
- pool,
56
- memoriaFactory: pool.toFactory(),
57
- ariaDir,
58
- projectConfig,
59
- discovery,
60
- availableModels,
61
- refreshAvailableModels: async () => getCliModels(discovery.getCachedModels()),
62
- credentialHints: {
63
- availableProviders: [...(awsRegion ? ["bedrock", "bedrock-converse"] : [])],
64
- },
65
- authResolver,
66
- };
67
- }
68
- export async function createCliContext(opts) {
69
- const config = loadConfig();
70
- const projectConfig = await loadAriaConfig(opts?.cwd ?? process.cwd());
71
- const startupMode = opts?.startupMode ?? "interactive";
72
- // Resolve AWS Bedrock selector config.
73
- // We persist only non-secret selectors/file locations from env so the daemon can own
74
- // execution later without depending on the attached client's ambient env.
75
- let awsMigrated = false;
76
- if (persistAwsSelectorHintsFromEnv(config)) {
77
- awsMigrated = true;
78
- }
79
- if (awsMigrated)
80
- saveConfig(config);
81
- const awsRegion = config.awsRegion || process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION;
82
- const awsProfile = config.awsProfile || process.env.AWS_PROFILE;
83
- const awsConfigFile = config.awsConfigFile || process.env.AWS_CONFIG_FILE;
84
- const awsSharedCredentialsFile = config.awsSharedCredentialsFile || process.env.AWS_SHARED_CREDENTIALS_FILE;
85
- const runtimeAuthContext = createRuntimeAuthContext({
86
- ariaHome: getAriaDir(),
87
- ...(awsRegion || awsProfile || awsConfigFile || awsSharedCredentialsFile
88
- ? {
89
- bedrock: { awsRegion, awsProfile, awsConfigFile, awsSharedCredentialsFile },
90
- }
91
- : {}),
92
- });
93
- const authResolver = runtimeAuthContext.authResolver;
94
- // Auth resolution happens inside createRuntimeDefaultRouter (single pass).
95
- // The resolver caches all results (including failures), so subsequent
96
- // resolve() calls are instant.
97
- const router = await createRuntimeDefaultRouter({
98
- ariaHome: getAriaDir(),
99
- authResolver,
100
- ...(awsRegion || awsProfile || awsConfigFile || awsSharedCredentialsFile
101
- ? {
102
- bedrock: { awsRegion, awsProfile, awsConfigFile, awsSharedCredentialsFile },
103
- }
104
- : {}),
105
- });
106
- const ariaDir = getAriaDir();
107
- const pool = new MemoriaPool(ariaDir, router);
108
- // Build credentialHints from the resolver's cached results (warm after router creation).
109
- const resolvedAnthropic = startupMode !== "daemon" ? await authResolver.resolve("anthropic") : null;
110
- const resolvedOpenai = startupMode !== "daemon" ? await authResolver.resolve("openai") : null;
111
- const resolvedGoogle = startupMode !== "daemon" ? await authResolver.resolve("google") : null;
112
- const resolvedCopilot = startupMode !== "daemon" ? await authResolver.resolve("github-copilot") : null;
113
- // Model discovery is explicit-on-demand. Startup must not trigger provider
114
- // probes just to render an attach-only client or open a shell.
115
- const discovery = new ModelDiscovery({
116
- authResolver,
117
- googleApiKey: resolvedGoogle?.apiKey || config.googleApiKey,
118
- anthropicApiKey: resolvedAnthropic?.apiKey || config.anthropicApiKey,
119
- openaiApiKey: resolvedOpenai?.apiKey,
120
- awsRegion,
121
- awsProfile,
122
- awsConfigFile,
123
- awsSharedCredentialsFile,
124
- cacheDir: ariaDir,
125
- });
126
- const availableModels = startupMode === "daemon" ? getCliModels() : getCliModels(discovery.getCachedModels());
127
- const refreshAvailableModels = async (force) => {
128
- if (startupMode === "daemon")
129
- return getCliModels();
130
- const discoveredModels = force
131
- ? await discovery.refresh(true)
132
- : await discovery.getCachedOrRefresh();
133
- return getCliModels(discoveredModels);
134
- };
135
- // availableProviders order = priority. Bedrock first when AWS is configured
136
- // (actively managed SSO > stale API keys).
137
- const credentialHints = {
138
- availableProviders: [
139
- ...(awsRegion ? ["bedrock", "bedrock-converse"] : []),
140
- ...(resolvedAnthropic?.apiKey ? ["anthropic"] : []),
141
- ...(resolvedOpenai?.apiKey ? ["openai"] : []),
142
- ...(resolvedCopilot?.apiKey ? ["github-copilot"] : []),
143
- ...(resolvedGoogle?.apiKey ? ["google"] : []),
144
- ],
145
- };
146
- return {
147
- config,
148
- router,
149
- pool,
150
- memoriaFactory: pool.toFactory(),
151
- ariaDir,
152
- projectConfig,
153
- discovery,
154
- availableModels,
155
- refreshAvailableModels,
156
- credentialHints,
157
- authResolver,
158
- };
159
- }
160
- //# sourceMappingURL=cli-context.js.map
@@ -1,174 +0,0 @@
1
- /**
2
- * Arions command - Manage Arion personas
3
- *
4
- * Subcommands:
5
- * - list: List all Arions with status
6
- * - hatch: Create a new Arion
7
- * - become: Switch to an Arion
8
- * - retire: Retire an Arion
9
- */
10
- import { Command } from "commander";
11
- import { ArionManager, ArionStorage, MemoriaPool } from "@aria-cli/aria";
12
- import { loadConfig, saveConfig, getAriaDir } from "../config.js";
13
- /**
14
- * Create ArionManager with MemoriaPool-backed factory.
15
- * Uses the unified pool instead of inline caching.
16
- */
17
- async function createArionManager() {
18
- const ariaDir = getAriaDir();
19
- const storage = new ArionStorage(ariaDir);
20
- const pool = new MemoriaPool(ariaDir);
21
- const memoriaFactory = pool.toFactory();
22
- const manager = new ArionManager(storage, memoriaFactory);
23
- await manager.initialize();
24
- return manager;
25
- }
26
- /**
27
- * Create the arions command group
28
- */
29
- export function createArionsCommand() {
30
- const arions = new Command("arions").description("Manage Arion personas");
31
- // List subcommand
32
- arions
33
- .command("list")
34
- .description("List all Arions with status")
35
- .option("--status <status>", "Filter by status (active, resting, retired)")
36
- .action(async (options) => {
37
- try {
38
- const manager = await createArionManager();
39
- const allArions = await manager.list();
40
- // Filter by status if provided
41
- const arionsList = options.status
42
- ? allArions.filter((a) => a.status === options.status)
43
- : allArions;
44
- if (arionsList.length === 0) {
45
- console.log("No Arions found.");
46
- return;
47
- }
48
- console.log("\nArions:");
49
- console.log("─".repeat(60));
50
- for (const arion of arionsList) {
51
- const statusIcon = arion.status === "active" ? "●" : arion.status === "resting" ? "○" : "×";
52
- console.log(`${statusIcon} ${arion.name} [${arion.status}]`);
53
- console.log(` Style: ${arion.personality.style}`);
54
- console.log(` Traits: ${arion.personality.traits.join(", ")}`);
55
- if (arion.skills.length > 0) {
56
- console.log(` Skills: ${arion.skills.map((s) => s.name).join(", ")}`);
57
- }
58
- console.log();
59
- }
60
- }
61
- catch (error) {
62
- console.error("Error listing Arions:", error.message);
63
- process.exit(1);
64
- }
65
- });
66
- // Hatch subcommand
67
- arions
68
- .command("hatch")
69
- .description("Create a new Arion")
70
- .argument("<name>", "Name for the new Arion")
71
- .option("-t, --traits <traits>", "Comma-separated personality traits")
72
- .option("-s, --style <style>", "Communication style (formal, casual, technical, friendly)")
73
- .option("--skills <skills>", "Comma-separated skills")
74
- .action(async (name, options) => {
75
- try {
76
- const manager = await createArionManager();
77
- // Parse traits
78
- const traits = options.traits
79
- ? options.traits.split(",").map((t) => t.trim())
80
- : ["helpful", "curious"];
81
- // Parse style
82
- const style = options.style || "friendly";
83
- // Parse skills
84
- const skills = options.skills
85
- ? options.skills.split(",").map((s) => ({
86
- name: s.trim(),
87
- level: "intermediate",
88
- }))
89
- : [];
90
- const arion = await manager.hatch({
91
- name,
92
- personality: { traits, style },
93
- skills,
94
- createdBy: "cli",
95
- });
96
- console.log(`\nHatched new Arion: ${arion.name}`);
97
- console.log(` ID: ${arion.id}`);
98
- console.log(` Status: ${arion.status}`);
99
- console.log(` Style: ${arion.personality.style}`);
100
- console.log(` Traits: ${arion.personality.traits.join(", ")}`);
101
- if (arion.skills.length > 0) {
102
- console.log(` Skills: ${arion.skills.map((s) => s.name).join(", ")}`);
103
- }
104
- }
105
- catch (error) {
106
- console.error("Error hatching Arion:", error.message);
107
- process.exit(1);
108
- }
109
- });
110
- // Become subcommand
111
- arions
112
- .command("become")
113
- .description("Switch to an Arion")
114
- .argument("<name>", "Name of the Arion to switch to")
115
- .action(async (name) => {
116
- try {
117
- const manager = await createArionManager();
118
- const arion = await manager.get(name);
119
- if (!arion) {
120
- console.error(`Arion not found: ${name}`);
121
- process.exit(1);
122
- }
123
- if (arion.status === "retired") {
124
- console.error(`Cannot become retired Arion: ${name}`);
125
- process.exit(1);
126
- }
127
- if (arion.status === "resting") {
128
- // Wake the Arion
129
- await manager.wake(name);
130
- }
131
- // Update config with active Arion
132
- const config = loadConfig();
133
- config.activeArion = arion.name;
134
- saveConfig(config);
135
- console.log(`\nSwitched to Arion: ${arion.name}`);
136
- console.log(` Style: ${arion.personality.style}`);
137
- console.log(` Traits: ${arion.personality.traits.join(", ")}`);
138
- }
139
- catch (error) {
140
- console.error("Error switching Arion:", error.message);
141
- process.exit(1);
142
- }
143
- });
144
- // Retire subcommand
145
- arions
146
- .command("retire")
147
- .description("Retire an Arion (permanent)")
148
- .argument("<name>", "Name of the Arion to retire")
149
- .option("--confirm", "Confirm retirement (required)")
150
- .action(async (name, options) => {
151
- try {
152
- if (!options.confirm) {
153
- console.error("Retirement is permanent. Use --confirm to proceed.");
154
- process.exit(1);
155
- }
156
- const manager = await createArionManager();
157
- await manager.retire(name, { confirm: true });
158
- // If this was the active Arion, clear it from config
159
- const config = loadConfig();
160
- if (config.activeArion?.toLowerCase() === name.toLowerCase()) {
161
- delete config.activeArion;
162
- saveConfig(config);
163
- }
164
- console.log(`\nRetired Arion: ${name}`);
165
- console.log("The Arion can no longer be used but its memories are preserved.");
166
- }
167
- catch (error) {
168
- console.error("Error retiring Arion:", error.message);
169
- process.exit(1);
170
- }
171
- });
172
- return arions;
173
- }
174
- //# sourceMappingURL=arions.js.map
@@ -1,123 +0,0 @@
1
- /**
2
- * Auth command - Manage auth profiles for multi-provider authentication
3
- *
4
- * Subcommands:
5
- * - status: Show all auth profiles and their health
6
- * - add: Add an API key for a provider
7
- * - remove: Remove an auth profile
8
- */
9
- import { Command } from "commander";
10
- import { createInterface } from "node:readline";
11
- import { ensureAuthProfileStore, syncExternalCliCredentials, isProfileInCooldown, upsertAuthProfile, updateAuthProfileStoreWithLockSync, } from "@aria-cli/auth";
12
- const COPILOT_ENV_KEYS = ["COPILOT_GITHUB_TOKEN", "GH_TOKEN", "GITHUB_TOKEN"];
13
- function getCopilotEnvSource(env = process.env) {
14
- for (const key of COPILOT_ENV_KEYS) {
15
- const value = env[key];
16
- if (value && value.length > 8) {
17
- return key;
18
- }
19
- }
20
- return null;
21
- }
22
- /**
23
- * Show all auth profiles, their type, health, and expiry.
24
- */
25
- export async function authStatusCommand() {
26
- const store = updateAuthProfileStoreWithLockSync({
27
- updater: (freshStore) => syncExternalCliCredentials(freshStore),
28
- }) ?? ensureAuthProfileStore();
29
- const profiles = Object.entries(store.profiles);
30
- if (profiles.length === 0) {
31
- console.log("No auth profiles configured.");
32
- console.log("Add one with: aria auth add --provider <name>");
33
- return;
34
- }
35
- for (const [id, cred] of profiles) {
36
- const inCooldown = isProfileInCooldown(store, id);
37
- const status = inCooldown ? "cooldown" : "active";
38
- const typeLabel = cred.type.padEnd(7);
39
- console.log(` ${id.padEnd(30)} [${typeLabel}] ${status}`);
40
- if (cred.email)
41
- console.log(` email: ${cred.email}`);
42
- if ((cred.type === "oauth" || cred.type === "token") && "expires" in cred) {
43
- const expires = cred.expires;
44
- if (expires) {
45
- const remaining = expires - Date.now();
46
- const label = remaining > 0 ? `expires in ${Math.round(remaining / 60000)}min` : "EXPIRED";
47
- console.log(` ${label}`);
48
- }
49
- }
50
- if (cred.provider === "github-copilot") {
51
- const source = getCopilotEnvSource();
52
- if (source) {
53
- console.log(` env override: ${source}`);
54
- }
55
- }
56
- }
57
- }
58
- /**
59
- * Interactively add an API key for a provider.
60
- */
61
- export async function authAddCommand(opts) {
62
- const provider = opts.provider.toLowerCase().trim();
63
- const profileId = `${provider}:manual`;
64
- const rl = createInterface({ input: process.stdin, output: process.stdout });
65
- const key = await new Promise((resolve) => {
66
- rl.question(`Paste API key for ${provider}: `, (answer) => {
67
- rl.close();
68
- resolve(answer.trim());
69
- });
70
- });
71
- if (!key || key.length < 8) {
72
- console.error("API key too short (minimum 8 characters).");
73
- process.exit(1);
74
- }
75
- upsertAuthProfile({
76
- profileId,
77
- credential: { type: "api_key", provider, key },
78
- });
79
- console.log(`Saved auth profile: ${profileId}`);
80
- }
81
- /**
82
- * Remove an auth profile by ID.
83
- */
84
- export async function authRemoveCommand(profileId) {
85
- let removed = false;
86
- const updated = updateAuthProfileStoreWithLockSync({
87
- updater: (store) => {
88
- if (!store.profiles[profileId]) {
89
- return false;
90
- }
91
- delete store.profiles[profileId];
92
- removed = true;
93
- return true;
94
- },
95
- });
96
- if (!removed || !updated) {
97
- console.error(`Profile not found: ${profileId}`);
98
- process.exit(1);
99
- }
100
- console.log(`Removed auth profile: ${profileId}`);
101
- }
102
- /**
103
- * Create the auth command group with status, add, and remove subcommands.
104
- */
105
- export function createAuthCommand() {
106
- const auth = new Command("auth").description("Manage auth profiles");
107
- auth
108
- .command("status")
109
- .description("Show all auth profiles and their health")
110
- .action(authStatusCommand);
111
- auth
112
- .command("add")
113
- .description("Add an API key for a provider")
114
- .requiredOption("--provider <name>", "Provider name (anthropic, openai, google)")
115
- .action(authAddCommand);
116
- auth
117
- .command("remove")
118
- .description("Remove an auth profile")
119
- .argument("<profile-id>", "Profile ID to remove")
120
- .action(authRemoveCommand);
121
- return auth;
122
- }
123
- //# sourceMappingURL=auth.js.map