@orion-agents/orion-code 0.1.0 → 0.1.1

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 (458) hide show
  1. package/README.md +20 -5
  2. package/README.zh-CN.md +14 -4
  3. package/dist/cli.js +11 -5
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/index.d.ts +1 -1
  6. package/dist/commands/index.d.ts.map +1 -1
  7. package/dist/commands/index.js +201 -115
  8. package/dist/commands/index.js.map +1 -1
  9. package/dist/commands/target-command.d.ts.map +1 -1
  10. package/dist/commands/target-command.js +1 -1
  11. package/dist/commands/target-command.js.map +1 -1
  12. package/dist/commands/types.d.ts +33 -0
  13. package/dist/commands/types.d.ts.map +1 -1
  14. package/dist/commands/types.js +5 -1
  15. package/dist/commands/types.js.map +1 -1
  16. package/dist/core/state.d.ts +94 -0
  17. package/dist/core/state.d.ts.map +1 -0
  18. package/dist/core/state.js +178 -0
  19. package/dist/core/state.js.map +1 -0
  20. package/dist/framework/query.d.ts +3 -0
  21. package/dist/framework/query.d.ts.map +1 -1
  22. package/dist/framework/query.js +25 -7
  23. package/dist/framework/query.js.map +1 -1
  24. package/dist/harness/context-harness.d.ts.map +1 -1
  25. package/dist/harness/context-harness.js +4 -3
  26. package/dist/harness/context-harness.js.map +1 -1
  27. package/dist/harness/drift-guard.d.ts.map +1 -1
  28. package/dist/harness/drift-guard.js +14 -5
  29. package/dist/harness/drift-guard.js.map +1 -1
  30. package/dist/ink/bidi.d.ts +16 -0
  31. package/dist/ink/bidi.d.ts.map +1 -0
  32. package/dist/ink/bidi.js +124 -0
  33. package/dist/ink/bidi.js.map +1 -0
  34. package/dist/ink/clearTerminal.d.ts +14 -0
  35. package/dist/ink/clearTerminal.d.ts.map +1 -0
  36. package/dist/ink/clearTerminal.js +63 -0
  37. package/dist/ink/clearTerminal.js.map +1 -0
  38. package/dist/ink/colorize.d.ts +17 -0
  39. package/dist/ink/colorize.d.ts.map +1 -0
  40. package/dist/ink/colorize.js +208 -0
  41. package/dist/ink/colorize.js.map +1 -0
  42. package/dist/ink/components/App.d.ts +73 -0
  43. package/dist/ink/components/App.d.ts.map +1 -0
  44. package/dist/ink/components/App.js +646 -0
  45. package/dist/ink/components/App.js.map +1 -0
  46. package/dist/ink/components/AppContext.d.ts +12 -0
  47. package/dist/ink/components/AppContext.d.ts.map +1 -0
  48. package/dist/ink/components/AppContext.js +14 -0
  49. package/dist/ink/components/AppContext.js.map +1 -0
  50. package/dist/ink/components/Box.d.ts +44 -0
  51. package/dist/ink/components/Box.d.ts.map +1 -0
  52. package/dist/ink/components/Box.js +191 -0
  53. package/dist/ink/components/Box.js.map +1 -0
  54. package/dist/ink/components/ClockContext.d.ts +9 -0
  55. package/dist/ink/components/ClockContext.d.ts.map +1 -0
  56. package/dist/ink/components/ClockContext.js +146 -0
  57. package/dist/ink/components/ClockContext.js.map +1 -0
  58. package/dist/ink/components/CursorDeclarationContext.d.ts +23 -0
  59. package/dist/ink/components/CursorDeclarationContext.d.ts.map +1 -0
  60. package/dist/ink/components/CursorDeclarationContext.js +6 -0
  61. package/dist/ink/components/CursorDeclarationContext.js.map +1 -0
  62. package/dist/ink/components/ErrorOverview.d.ts +6 -0
  63. package/dist/ink/components/ErrorOverview.d.ts.map +1 -0
  64. package/dist/ink/components/ErrorOverview.js +27 -0
  65. package/dist/ink/components/ErrorOverview.js.map +1 -0
  66. package/dist/ink/components/Newline.d.ts +13 -0
  67. package/dist/ink/components/Newline.d.ts.map +1 -0
  68. package/dist/ink/components/Newline.js +36 -0
  69. package/dist/ink/components/Newline.js.map +1 -0
  70. package/dist/ink/components/NoSelect.d.ts +20 -0
  71. package/dist/ink/components/NoSelect.d.ts.map +1 -0
  72. package/dist/ink/components/NoSelect.js +63 -0
  73. package/dist/ink/components/NoSelect.js.map +1 -0
  74. package/dist/ink/components/RawAnsi.d.ts +17 -0
  75. package/dist/ink/components/RawAnsi.d.ts.map +1 -0
  76. package/dist/ink/components/RawAnsi.js +52 -0
  77. package/dist/ink/components/RawAnsi.js.map +1 -0
  78. package/dist/ink/components/Spacer.d.ts +6 -0
  79. package/dist/ink/components/Spacer.d.ts.map +1 -0
  80. package/dist/ink/components/Spacer.js +26 -0
  81. package/dist/ink/components/Spacer.js.map +1 -0
  82. package/dist/ink/components/StdinContext.d.ts +28 -0
  83. package/dist/ink/components/StdinContext.d.ts.map +1 -0
  84. package/dist/ink/components/StdinContext.js +19 -0
  85. package/dist/ink/components/StdinContext.js.map +1 -0
  86. package/dist/ink/components/TerminalFocusContext.d.ts +10 -0
  87. package/dist/ink/components/TerminalFocusContext.d.ts.map +1 -0
  88. package/dist/ink/components/TerminalFocusContext.js +81 -0
  89. package/dist/ink/components/TerminalFocusContext.js.map +1 -0
  90. package/dist/ink/components/TerminalSizeContext.d.ts +6 -0
  91. package/dist/ink/components/TerminalSizeContext.d.ts.map +1 -0
  92. package/dist/ink/components/TerminalSizeContext.js +6 -0
  93. package/dist/ink/components/TerminalSizeContext.js.map +1 -0
  94. package/dist/ink/components/Text.d.ts +56 -0
  95. package/dist/ink/components/Text.d.ts.map +1 -0
  96. package/dist/ink/components/Text.js +201 -0
  97. package/dist/ink/components/Text.js.map +1 -0
  98. package/dist/ink/constants.d.ts +2 -0
  99. package/dist/ink/constants.d.ts.map +1 -0
  100. package/dist/ink/constants.js +6 -0
  101. package/dist/ink/constants.js.map +1 -0
  102. package/dist/ink/devtools.d.ts +3 -0
  103. package/dist/ink/devtools.d.ts.map +1 -0
  104. package/dist/ink/devtools.js +5 -0
  105. package/dist/ink/devtools.js.map +1 -0
  106. package/dist/ink/dom.d.ts +77 -0
  107. package/dist/ink/dom.d.ts.map +1 -0
  108. package/dist/ink/dom.js +322 -0
  109. package/dist/ink/dom.js.map +1 -0
  110. package/dist/ink/events/click-event.d.ts +32 -0
  111. package/dist/ink/events/click-event.d.ts.map +1 -0
  112. package/dist/ink/events/click-event.js +30 -0
  113. package/dist/ink/events/click-event.js.map +1 -0
  114. package/dist/ink/events/dispatcher.d.ts +41 -0
  115. package/dist/ink/events/dispatcher.d.ts.map +1 -0
  116. package/dist/ink/events/dispatcher.js +181 -0
  117. package/dist/ink/events/dispatcher.js.map +1 -0
  118. package/dist/ink/events/emitter.d.ts +6 -0
  119. package/dist/ink/events/emitter.d.ts.map +1 -0
  120. package/dist/ink/events/emitter.js +36 -0
  121. package/dist/ink/events/emitter.js.map +1 -0
  122. package/dist/ink/events/event-handlers.d.ts +47 -0
  123. package/dist/ink/events/event-handlers.d.ts.map +1 -0
  124. package/dist/ink/events/event-handlers.js +34 -0
  125. package/dist/ink/events/event-handlers.js.map +1 -0
  126. package/dist/ink/events/event.d.ts +6 -0
  127. package/dist/ink/events/event.d.ts.map +1 -0
  128. package/dist/ink/events/event.js +16 -0
  129. package/dist/ink/events/event.js.map +1 -0
  130. package/dist/ink/events/focus-event.d.ts +14 -0
  131. package/dist/ink/events/focus-event.d.ts.map +1 -0
  132. package/dist/ink/events/focus-event.js +20 -0
  133. package/dist/ink/events/focus-event.js.map +1 -0
  134. package/dist/ink/events/input-event.d.ts +31 -0
  135. package/dist/ink/events/input-event.d.ts.map +1 -0
  136. package/dist/ink/events/input-event.js +163 -0
  137. package/dist/ink/events/input-event.js.map +1 -0
  138. package/dist/ink/events/keyboard-event.d.ts +20 -0
  139. package/dist/ink/events/keyboard-event.d.ts.map +1 -0
  140. package/dist/ink/events/keyboard-event.js +44 -0
  141. package/dist/ink/events/keyboard-event.js.map +1 -0
  142. package/dist/ink/events/terminal-event.d.ts +55 -0
  143. package/dist/ink/events/terminal-event.d.ts.map +1 -0
  144. package/dist/ink/events/terminal-event.js +79 -0
  145. package/dist/ink/events/terminal-event.js.map +1 -0
  146. package/dist/ink/events/terminal-focus-event.d.ts +14 -0
  147. package/dist/ink/events/terminal-focus-event.d.ts.map +1 -0
  148. package/dist/ink/events/terminal-focus-event.js +19 -0
  149. package/dist/ink/events/terminal-focus-event.js.map +1 -0
  150. package/dist/ink/focus.d.ts +44 -0
  151. package/dist/ink/focus.d.ts.map +1 -0
  152. package/dist/ink/focus.js +164 -0
  153. package/dist/ink/focus.js.map +1 -0
  154. package/dist/ink/frame.d.ts +95 -0
  155. package/dist/ink/frame.d.ts.map +1 -0
  156. package/dist/ink/frame.js +35 -0
  157. package/dist/ink/frame.js.map +1 -0
  158. package/dist/ink/get-max-width.d.ts +18 -0
  159. package/dist/ink/get-max-width.d.ts.map +1 -0
  160. package/dist/ink/get-max-width.js +26 -0
  161. package/dist/ink/get-max-width.js.map +1 -0
  162. package/dist/ink/hit-test.d.ts +34 -0
  163. package/dist/ink/hit-test.d.ts.map +1 -0
  164. package/dist/ink/hit-test.js +119 -0
  165. package/dist/ink/hit-test.js.map +1 -0
  166. package/dist/ink/hooks/use-animation-frame.d.ts +27 -0
  167. package/dist/ink/hooks/use-animation-frame.d.ts.map +1 -0
  168. package/dist/ink/hooks/use-animation-frame.js +52 -0
  169. package/dist/ink/hooks/use-animation-frame.js.map +1 -0
  170. package/dist/ink/hooks/use-app.d.ts +6 -0
  171. package/dist/ink/hooks/use-app.d.ts.map +1 -0
  172. package/dist/ink/hooks/use-app.js +13 -0
  173. package/dist/ink/hooks/use-app.js.map +1 -0
  174. package/dist/ink/hooks/use-declared-cursor.d.ts +27 -0
  175. package/dist/ink/hooks/use-declared-cursor.d.ts.map +1 -0
  176. package/dist/ink/hooks/use-declared-cursor.js +67 -0
  177. package/dist/ink/hooks/use-declared-cursor.js.map +1 -0
  178. package/dist/ink/hooks/use-input.d.ts +38 -0
  179. package/dist/ink/hooks/use-input.d.ts.map +1 -0
  180. package/dist/ink/hooks/use-input.js +86 -0
  181. package/dist/ink/hooks/use-input.js.map +1 -0
  182. package/dist/ink/hooks/use-interval.d.ts +19 -0
  183. package/dist/ink/hooks/use-interval.d.ts.map +1 -0
  184. package/dist/ink/hooks/use-interval.js +59 -0
  185. package/dist/ink/hooks/use-interval.js.map +1 -0
  186. package/dist/ink/hooks/use-search-highlight.d.ts +31 -0
  187. package/dist/ink/hooks/use-search-highlight.d.ts.map +1 -0
  188. package/dist/ink/hooks/use-search-highlight.js +39 -0
  189. package/dist/ink/hooks/use-search-highlight.js.map +1 -0
  190. package/dist/ink/hooks/use-selection.d.ts +40 -0
  191. package/dist/ink/hooks/use-selection.d.ts.map +1 -0
  192. package/dist/ink/hooks/use-selection.js +68 -0
  193. package/dist/ink/hooks/use-selection.js.map +1 -0
  194. package/dist/ink/hooks/use-stdin.d.ts +6 -0
  195. package/dist/ink/hooks/use-stdin.d.ts.map +1 -0
  196. package/dist/ink/hooks/use-stdin.js +13 -0
  197. package/dist/ink/hooks/use-stdin.js.map +1 -0
  198. package/dist/ink/hooks/use-tab-status.d.ts +14 -0
  199. package/dist/ink/hooks/use-tab-status.d.ts.map +1 -0
  200. package/dist/ink/hooks/use-tab-status.js +61 -0
  201. package/dist/ink/hooks/use-tab-status.js.map +1 -0
  202. package/dist/ink/hooks/use-terminal-focus.d.ts +11 -0
  203. package/dist/ink/hooks/use-terminal-focus.d.ts.map +1 -0
  204. package/dist/ink/hooks/use-terminal-focus.js +22 -0
  205. package/dist/ink/hooks/use-terminal-focus.js.map +1 -0
  206. package/dist/ink/hooks/use-terminal-title.d.ts +13 -0
  207. package/dist/ink/hooks/use-terminal-title.d.ts.map +1 -0
  208. package/dist/ink/hooks/use-terminal-title.js +36 -0
  209. package/dist/ink/hooks/use-terminal-title.js.map +1 -0
  210. package/dist/ink/hooks/use-terminal-viewport.d.ts +30 -0
  211. package/dist/ink/hooks/use-terminal-viewport.d.ts.map +1 -0
  212. package/dist/ink/hooks/use-terminal-viewport.js +81 -0
  213. package/dist/ink/hooks/use-terminal-viewport.js.map +1 -0
  214. package/dist/ink/ink.d.ts +371 -0
  215. package/dist/ink/ink.d.ts.map +1 -0
  216. package/dist/ink/ink.js +1686 -0
  217. package/dist/ink/ink.js.map +1 -0
  218. package/dist/ink/instances.d.ts +4 -0
  219. package/dist/ink/instances.d.ts.map +1 -0
  220. package/dist/ink/instances.js +10 -0
  221. package/dist/ink/instances.js.map +1 -0
  222. package/dist/ink/line-width-cache.d.ts +2 -0
  223. package/dist/ink/line-width-cache.d.ts.map +1 -0
  224. package/dist/ink/line-width-cache.js +23 -0
  225. package/dist/ink/line-width-cache.js.map +1 -0
  226. package/dist/ink/log-update.d.ts +18 -0
  227. package/dist/ink/log-update.d.ts.map +1 -0
  228. package/dist/ink/log-update.js +637 -0
  229. package/dist/ink/log-update.js.map +1 -0
  230. package/dist/ink/measure-element.d.ts +17 -0
  231. package/dist/ink/measure-element.d.ts.map +1 -0
  232. package/dist/ink/measure-element.js +11 -0
  233. package/dist/ink/measure-element.js.map +1 -0
  234. package/dist/ink/measure-text.d.ts +7 -0
  235. package/dist/ink/measure-text.d.ts.map +1 -0
  236. package/dist/ink/measure-text.js +38 -0
  237. package/dist/ink/measure-text.js.map +1 -0
  238. package/dist/ink/node-cache.d.ts +21 -0
  239. package/dist/ink/node-cache.d.ts.map +1 -0
  240. package/dist/ink/node-cache.js +36 -0
  241. package/dist/ink/node-cache.js.map +1 -0
  242. package/dist/ink/optimizer.d.ts +16 -0
  243. package/dist/ink/optimizer.d.ts.map +1 -0
  244. package/dist/ink/optimizer.js +85 -0
  245. package/dist/ink/optimizer.js.map +1 -0
  246. package/dist/ink/output.d.ts +120 -0
  247. package/dist/ink/output.d.ts.map +1 -0
  248. package/dist/ink/output.js +559 -0
  249. package/dist/ink/output.js.map +1 -0
  250. package/dist/ink/parse-keypress.d.ts +112 -0
  251. package/dist/ink/parse-keypress.d.ts.map +1 -0
  252. package/dist/ink/parse-keypress.js +719 -0
  253. package/dist/ink/parse-keypress.js.map +1 -0
  254. package/dist/ink/parse-keypress.test.d.ts +2 -0
  255. package/dist/ink/parse-keypress.test.d.ts.map +1 -0
  256. package/dist/ink/parse-keypress.test.js +37 -0
  257. package/dist/ink/parse-keypress.test.js.map +1 -0
  258. package/dist/ink/reconciler.d.ts +12 -0
  259. package/dist/ink/reconciler.d.ts.map +1 -0
  260. package/dist/ink/reconciler.js +456 -0
  261. package/dist/ink/reconciler.js.map +1 -0
  262. package/dist/ink/render-border.d.ts +25 -0
  263. package/dist/ink/render-border.d.ts.map +1 -0
  264. package/dist/ink/render-border.js +141 -0
  265. package/dist/ink/render-border.js.map +1 -0
  266. package/dist/ink/render-node-to-output.d.ts +46 -0
  267. package/dist/ink/render-node-to-output.d.ts.map +1 -0
  268. package/dist/ink/render-node-to-output.js +1257 -0
  269. package/dist/ink/render-node-to-output.js.map +1 -0
  270. package/dist/ink/render-to-screen.d.ts +47 -0
  271. package/dist/ink/render-to-screen.d.ts.map +1 -0
  272. package/dist/ink/render-to-screen.js +213 -0
  273. package/dist/ink/render-to-screen.js.map +1 -0
  274. package/dist/ink/renderer.d.ts +15 -0
  275. package/dist/ink/renderer.d.ts.map +1 -0
  276. package/dist/ink/renderer.js +169 -0
  277. package/dist/ink/renderer.js.map +1 -0
  278. package/dist/ink/root.d.ts +75 -0
  279. package/dist/ink/root.d.ts.map +1 -0
  280. package/dist/ink/root.js +89 -0
  281. package/dist/ink/root.js.map +1 -0
  282. package/dist/ink/screen.d.ts +270 -0
  283. package/dist/ink/screen.d.ts.map +1 -0
  284. package/dist/ink/screen.js +1194 -0
  285. package/dist/ink/screen.js.map +1 -0
  286. package/dist/ink/searchHighlight.d.ts +21 -0
  287. package/dist/ink/searchHighlight.d.ts.map +1 -0
  288. package/dist/ink/searchHighlight.js +82 -0
  289. package/dist/ink/searchHighlight.js.map +1 -0
  290. package/dist/ink/selection.d.ts +230 -0
  291. package/dist/ink/selection.d.ts.map +1 -0
  292. package/dist/ink/selection.js +814 -0
  293. package/dist/ink/selection.js.map +1 -0
  294. package/dist/ink/squash-text-nodes.d.ts +23 -0
  295. package/dist/ink/squash-text-nodes.d.ts.map +1 -0
  296. package/dist/ink/squash-text-nodes.js +60 -0
  297. package/dist/ink/squash-text-nodes.js.map +1 -0
  298. package/dist/ink/stringWidth.d.ts +2 -0
  299. package/dist/ink/stringWidth.d.ts.map +1 -0
  300. package/dist/ink/stringWidth.js +207 -0
  301. package/dist/ink/stringWidth.js.map +1 -0
  302. package/dist/ink/styles.d.ts +307 -0
  303. package/dist/ink/styles.d.ts.map +1 -0
  304. package/dist/ink/styles.js +302 -0
  305. package/dist/ink/styles.js.map +1 -0
  306. package/dist/ink/supports-hyperlinks.d.ts +14 -0
  307. package/dist/ink/supports-hyperlinks.d.ts.map +1 -0
  308. package/dist/ink/supports-hyperlinks.js +48 -0
  309. package/dist/ink/supports-hyperlinks.js.map +1 -0
  310. package/dist/ink/tabstops.d.ts +2 -0
  311. package/dist/ink/tabstops.d.ts.map +1 -0
  312. package/dist/ink/tabstops.js +43 -0
  313. package/dist/ink/tabstops.js.map +1 -0
  314. package/dist/ink/terminal-focus-state.d.ts +7 -0
  315. package/dist/ink/terminal-focus-state.d.ts.map +1 -0
  316. package/dist/ink/terminal-focus-state.js +43 -0
  317. package/dist/ink/terminal-focus-state.js.map +1 -0
  318. package/dist/ink/terminal-querier.d.ts +130 -0
  319. package/dist/ink/terminal-querier.d.ts.map +1 -0
  320. package/dist/ink/terminal-querier.js +184 -0
  321. package/dist/ink/terminal-querier.js.map +1 -0
  322. package/dist/ink/terminal.d.ts +56 -0
  323. package/dist/ink/terminal.d.ts.map +1 -0
  324. package/dist/ink/terminal.js +249 -0
  325. package/dist/ink/terminal.js.map +1 -0
  326. package/dist/ink/termio/csi.d.ts +166 -0
  327. package/dist/ink/termio/csi.d.ts.map +1 -0
  328. package/dist/ink/termio/csi.js +285 -0
  329. package/dist/ink/termio/csi.js.map +1 -0
  330. package/dist/ink/termio/dec.d.ts +38 -0
  331. package/dist/ink/termio/dec.d.ts.map +1 -0
  332. package/dist/ink/termio/dec.js +59 -0
  333. package/dist/ink/termio/dec.js.map +1 -0
  334. package/dist/ink/termio.d.ts +25 -0
  335. package/dist/ink/termio.d.ts.map +1 -0
  336. package/dist/ink/termio.js +32 -0
  337. package/dist/ink/termio.js.map +1 -0
  338. package/dist/ink/useTerminalNotification.d.ts +27 -0
  339. package/dist/ink/useTerminalNotification.d.ts.map +1 -0
  340. package/dist/ink/useTerminalNotification.js +62 -0
  341. package/dist/ink/useTerminalNotification.js.map +1 -0
  342. package/dist/ink/warn.d.ts +2 -0
  343. package/dist/ink/warn.d.ts.map +1 -0
  344. package/dist/ink/warn.js +14 -0
  345. package/dist/ink/warn.js.map +1 -0
  346. package/dist/ink/widest-line.d.ts +2 -0
  347. package/dist/ink/widest-line.d.ts.map +1 -0
  348. package/dist/ink/widest-line.js +18 -0
  349. package/dist/ink/widest-line.js.map +1 -0
  350. package/dist/ink/wrap-text.d.ts +3 -0
  351. package/dist/ink/wrap-text.d.ts.map +1 -0
  352. package/dist/ink/wrap-text.js +61 -0
  353. package/dist/ink/wrap-text.js.map +1 -0
  354. package/dist/ink/wrapAnsi.d.ts +8 -0
  355. package/dist/ink/wrapAnsi.d.ts.map +1 -0
  356. package/dist/ink/wrapAnsi.js +13 -0
  357. package/dist/ink/wrapAnsi.js.map +1 -0
  358. package/dist/ink-ui/components/TerminalCursor.d.ts +15 -0
  359. package/dist/ink-ui/components/TerminalCursor.d.ts.map +1 -0
  360. package/dist/ink-ui/components/TerminalCursor.js +49 -0
  361. package/dist/ink-ui/components/TerminalCursor.js.map +1 -0
  362. package/dist/ink-ui/runtime/stdout.d.ts +11 -0
  363. package/dist/ink-ui/runtime/stdout.d.ts.map +1 -0
  364. package/dist/ink-ui/runtime/stdout.js +82 -0
  365. package/dist/ink-ui/runtime/stdout.js.map +1 -0
  366. package/dist/ink-ui/screens/ReplScreen.d.ts.map +1 -1
  367. package/dist/ink-ui/screens/ReplScreen.js +4 -1
  368. package/dist/ink-ui/screens/ReplScreen.js.map +1 -1
  369. package/dist/migration/command.d.ts.map +1 -1
  370. package/dist/migration/command.js +6 -1
  371. package/dist/migration/command.js.map +1 -1
  372. package/dist/migration/migrate.d.ts.map +1 -1
  373. package/dist/migration/migrate.js +4 -1
  374. package/dist/migration/migrate.js.map +1 -1
  375. package/dist/runtime/agent-runtime-controller.d.ts +15 -0
  376. package/dist/runtime/agent-runtime-controller.d.ts.map +1 -1
  377. package/dist/runtime/agent-runtime-controller.js +162 -0
  378. package/dist/runtime/agent-runtime-controller.js.map +1 -1
  379. package/dist/runtime/agent-runtime-protocol.d.ts +7 -0
  380. package/dist/runtime/agent-runtime-protocol.d.ts.map +1 -1
  381. package/dist/runtime/agent-runtime-protocol.js +12 -0
  382. package/dist/runtime/agent-runtime-protocol.js.map +1 -1
  383. package/dist/runtime/chat-controller.d.ts.map +1 -1
  384. package/dist/runtime/chat-controller.js +26 -1
  385. package/dist/runtime/chat-controller.js.map +1 -1
  386. package/dist/runtime/goal-coordinator.d.ts +66 -0
  387. package/dist/runtime/goal-coordinator.d.ts.map +1 -0
  388. package/dist/runtime/goal-coordinator.js +200 -0
  389. package/dist/runtime/goal-coordinator.js.map +1 -0
  390. package/dist/runtime/ui-events.d.ts +4 -0
  391. package/dist/runtime/ui-events.d.ts.map +1 -1
  392. package/dist/runtime/ui-view-model.d.ts +3 -3
  393. package/dist/runtime/ui-view-model.d.ts.map +1 -1
  394. package/dist/runtime/ui-view-model.js +11 -4
  395. package/dist/runtime/ui-view-model.js.map +1 -1
  396. package/dist/screens/REPL.d.ts +21 -0
  397. package/dist/screens/REPL.d.ts.map +1 -0
  398. package/dist/screens/REPL.js +139 -0
  399. package/dist/screens/REPL.js.map +1 -0
  400. package/dist/services/config.d.ts +17 -6
  401. package/dist/services/config.d.ts.map +1 -1
  402. package/dist/services/config.js +29 -12
  403. package/dist/services/config.js.map +1 -1
  404. package/dist/services/doctor.d.ts.map +1 -1
  405. package/dist/services/doctor.js +1 -1
  406. package/dist/services/doctor.js.map +1 -1
  407. package/dist/services/global-config.d.ts +1 -1
  408. package/dist/services/global-config.d.ts.map +1 -1
  409. package/dist/services/goal-sidecar.d.ts +96 -0
  410. package/dist/services/goal-sidecar.d.ts.map +1 -0
  411. package/dist/services/goal-sidecar.js +145 -0
  412. package/dist/services/goal-sidecar.js.map +1 -0
  413. package/dist/terminal-ui/completion.js +1 -1
  414. package/dist/terminal-ui/completion.js.map +1 -1
  415. package/dist/terminal-ui/launch.d.ts +1 -0
  416. package/dist/terminal-ui/launch.d.ts.map +1 -1
  417. package/dist/terminal-ui/launch.js +5 -91
  418. package/dist/terminal-ui/launch.js.map +1 -1
  419. package/dist/tools/goal.d.ts +17 -0
  420. package/dist/tools/goal.d.ts.map +1 -0
  421. package/dist/tools/goal.js +191 -0
  422. package/dist/tools/goal.js.map +1 -0
  423. package/dist/tools/index.d.ts +2 -0
  424. package/dist/tools/index.d.ts.map +1 -1
  425. package/dist/tools/index.js +7 -7
  426. package/dist/tools/index.js.map +1 -1
  427. package/dist/tui-ui/pickers.js +1 -1
  428. package/dist/tui-ui/pickers.js.map +1 -1
  429. package/dist/tui-ui/runner.js +1 -17
  430. package/dist/tui-ui/runner.js.map +1 -1
  431. package/dist/tui-ui/state.d.ts.map +1 -1
  432. package/dist/tui-ui/state.js +1 -0
  433. package/dist/tui-ui/state.js.map +1 -1
  434. package/dist/ui/ink/components/App.d.ts +6 -0
  435. package/dist/ui/ink/components/App.d.ts.map +1 -0
  436. package/dist/ui/ink/components/App.js +38 -0
  437. package/dist/ui/ink/components/App.js.map +1 -0
  438. package/dist/ui/ink/components/CommandPanel.d.ts +13 -0
  439. package/dist/ui/ink/components/CommandPanel.d.ts.map +1 -0
  440. package/dist/ui/ink/components/CommandPanel.js +41 -0
  441. package/dist/ui/ink/components/CommandPanel.js.map +1 -0
  442. package/dist/ui/ink/components/InputLine.d.ts +8 -0
  443. package/dist/ui/ink/components/InputLine.d.ts.map +1 -0
  444. package/dist/ui/ink/components/InputLine.js +15 -0
  445. package/dist/ui/ink/components/InputLine.js.map +1 -0
  446. package/dist/ui/ink/components/StatusBar.d.ts +9 -0
  447. package/dist/ui/ink/components/StatusBar.d.ts.map +1 -0
  448. package/dist/ui/ink/components/StatusBar.js +18 -0
  449. package/dist/ui/ink/components/StatusBar.js.map +1 -0
  450. package/dist/ui/ink/components/index.d.ts +5 -0
  451. package/dist/ui/ink/components/index.d.ts.map +1 -0
  452. package/dist/ui/ink/components/index.js +5 -0
  453. package/dist/ui/ink/components/index.js.map +1 -0
  454. package/dist/utils/chalk.d.ts +9 -0
  455. package/dist/utils/chalk.d.ts.map +1 -0
  456. package/dist/utils/chalk.js +16 -0
  457. package/dist/utils/chalk.js.map +1 -0
  458. package/package.json +2 -1
@@ -30,9 +30,8 @@ const tools_1 = require("../tools");
30
30
  const mcp_1 = require("../tools/mcp");
31
31
  const session_storage_1 = require("../services/session-storage");
32
32
  const session_index_1 = require("../services/session-index");
33
- const coordinator_1 = require("../runtime/goals/coordinator");
34
33
  const auto_compact_1 = require("../services/compact/auto-compact");
35
- const coordinator_2 = require("../services/compact/coordinator");
34
+ const coordinator_1 = require("../services/compact/coordinator");
36
35
  const harness_1 = require("../harness");
37
36
  const skills_1 = require("../skills");
38
37
  const file_context_1 = require("../services/file-context");
@@ -99,10 +98,10 @@ function formatRendererStatus(ctx) {
99
98
  });
100
99
  const status = snapshot.renderer.status === 'deprecated'
101
100
  ? WARN('deprecated')
102
- : snapshot.renderer.status === 'beta' || (0, config_1.isBetaUIRenderer)(snapshot.renderer.name)
103
- ? WARN('beta')
104
- : snapshot.renderer.status === 'stable'
105
- ? SUCCESS('stable')
101
+ : snapshot.renderer.status === 'product'
102
+ ? SUCCESS('product')
103
+ : snapshot.renderer.status === 'technical'
104
+ ? DIM('technical')
106
105
  : snapshot.renderer.status === 'non-interactive'
107
106
  ? DIM('non-interactive')
108
107
  : DIM('custom');
@@ -247,6 +246,9 @@ function isAbortError(error, abortSignal) {
247
246
  }
248
247
  return false;
249
248
  }
249
+ function hasCommandFlag(args, flag) {
250
+ return args.trim().split(/\s+/u).includes(flag);
251
+ }
250
252
  // ============================================================================
251
253
  // 工具参数摘要
252
254
  // ============================================================================
@@ -254,11 +256,11 @@ function isAbortError(error, abortSignal) {
254
256
  // 命令实现
255
257
  // ============================================================================
256
258
  let taskManager = null;
257
- function showHelp() {
259
+ function showHelp(ctx) {
258
260
  console.log();
259
261
  console.log(HEADER('Commands:'));
260
262
  console.log();
261
- const visible = getVisibleCommands();
263
+ const visible = getVisibleCommands(ctx.uiRenderer);
262
264
  for (const category of CATEGORY_ORDER) {
263
265
  const items = visible.filter(cmd => commandCategory(cmd) === category);
264
266
  if (items.length === 0)
@@ -267,8 +269,16 @@ function showHelp() {
267
269
  for (const cmd of items) {
268
270
  const aliases = cmd.aliases ? ` (${cmd.aliases.join(', ')})` : '';
269
271
  const params = cmd.argumentHint || cmd.params?.map(p => `<${p.name}>`).join(' ') || '';
272
+ const lifecycle = cmd.deprecated
273
+ ? ` deprecated since ${cmd.deprecated.since}${cmd.deprecated.replacement ? `; use ${cmd.deprecated.replacement}` : ''}`
274
+ : '';
275
+ const risk = cmd.risk === 'destructive' ? ' destructive' : '';
276
+ const availability = cmd.availability?.(ctx);
277
+ const unavailable = availability && !availability.available
278
+ ? ` unavailable: ${availability.reason ?? 'requirements not met'}`
279
+ : '';
270
280
  console.log(` ${ACCENT(`/${cmd.name}`)}${aliases} ${DIM(params)}`);
271
- console.log(` ${DIM(cmd.description)}`);
281
+ console.log(` ${DIM(`${cmd.description}${lifecycle}${risk}${unavailable}`)}`);
272
282
  }
273
283
  console.log();
274
284
  }
@@ -1865,9 +1875,10 @@ async function handleExit(ctx) {
1865
1875
  }
1866
1876
  (0, session_storage_1.endSession)(ctx.sessionId);
1867
1877
  }
1878
+ ctx.requestShutdown?.('user request');
1868
1879
  await ctx.runtime.shutdown();
1869
- console.log(SUCCESS('Goodbye! 🐴'));
1870
- process.exit(0);
1880
+ console.log(SUCCESS('Goodbye.'));
1881
+ return { success: true };
1871
1882
  }
1872
1883
  function handleCost(ctx) {
1873
1884
  console.log();
@@ -2071,15 +2082,33 @@ function handleDoctor(ctx) {
2071
2082
  function handleStorage(_ctx, args) {
2072
2083
  const trimmed = args.trim();
2073
2084
  const [action = 'doctor'] = trimmed.split(/\s+/);
2085
+ const confirmed = hasCommandFlag(trimmed, '--yes');
2074
2086
  if (action === 'cleanup') {
2075
- const dryRun = /\b--dry-run\b/.test(trimmed);
2087
+ const dryRun = hasCommandFlag(trimmed, '--dry-run') || !confirmed;
2076
2088
  const result = (0, storage_maintenance_1.cleanupStorage)({ dryRun });
2077
2089
  console.log();
2078
2090
  console.log((0, storage_maintenance_1.formatStorageCleanupResult)(result));
2091
+ if (!confirmed) {
2092
+ console.log(DIM('Preview only. Run /storage cleanup --yes to apply these deletions.'));
2093
+ }
2079
2094
  console.log();
2080
2095
  return { success: true };
2081
2096
  }
2082
2097
  if (action === 'repair') {
2098
+ if (!confirmed) {
2099
+ const report = (0, storage_maintenance_1.collectStorageReport)();
2100
+ const repairable = report.issues.filter(issue => issue.kind === 'missing-project-metadata' || issue.kind === 'invalid-project-metadata');
2101
+ console.log();
2102
+ console.log(HEADER('Orion Code Storage Repair Preview'));
2103
+ console.log(DIM('─'.repeat(40)));
2104
+ console.log(` Repairable metadata entries ${ACCENT(String(repairable.length))}`);
2105
+ for (const issue of repairable.slice(0, 12)) {
2106
+ console.log(` ${DIM('•')} ${DIM(issue.path ?? issue.projectKey ?? issue.kind)}`);
2107
+ }
2108
+ console.log(DIM(' Preview only. Run /storage repair --yes to apply metadata changes.'));
2109
+ console.log();
2110
+ return { success: true };
2111
+ }
2083
2112
  const result = (0, storage_maintenance_1.repairProjectMetadata)();
2084
2113
  console.log();
2085
2114
  console.log(HEADER('Orion Code Storage Repair'));
@@ -2098,7 +2127,7 @@ function handleStorage(_ctx, args) {
2098
2127
  if (action !== 'doctor' && action !== 'status') {
2099
2128
  return {
2100
2129
  success: false,
2101
- error: 'Usage: /storage [doctor|status|repair|cleanup --dry-run]',
2130
+ error: 'Usage: /storage [doctor|status|repair [--yes]|cleanup [--dry-run|--yes]]',
2102
2131
  };
2103
2132
  }
2104
2133
  const report = (0, storage_maintenance_1.collectStorageReport)();
@@ -2107,80 +2136,6 @@ function handleStorage(_ctx, args) {
2107
2136
  console.log();
2108
2137
  return { success: true };
2109
2138
  }
2110
- function handleTarget(ctx, args) {
2111
- const trimmed = args.trim();
2112
- // GoalCoordinator needs projectPath + sessionId — derive from context
2113
- const projectPath = ctx.cwd ?? process.cwd();
2114
- const sessionId = ctx.sessionId ?? 'default';
2115
- const coordinator = new coordinator_1.GoalCoordinator(projectPath, sessionId);
2116
- // /target (no args) — show current goal
2117
- if (!trimmed) {
2118
- const snap = coordinator.snapshot();
2119
- if (!snap) {
2120
- console.log(chalk_1.default.gray('No goal is currently set. Use /target <objective> to create one.'));
2121
- return { success: true };
2122
- }
2123
- console.log(chalk_1.default.bold('Goal: ') + snap.objective);
2124
- console.log(chalk_1.default.gray(`Status: ${snap.status} | Continuations: ${snap.continuationCount}`));
2125
- console.log(chalk_1.default.gray(`Tokens: ${snap.tokensUsed} | Time: ${snap.timeUsedMs}ms`));
2126
- return { success: true };
2127
- }
2128
- // Sub-commands
2129
- const subCommand = trimmed.split(/\s+/)[0].toLowerCase();
2130
- const rest = trimmed.slice(subCommand.length).trim();
2131
- switch (subCommand) {
2132
- case 'pause': {
2133
- const ok = coordinator.pause();
2134
- console.log(ok ? chalk_1.default.yellow('Goal paused.') : chalk_1.default.red('Cannot pause.'));
2135
- return { success: ok };
2136
- }
2137
- case 'resume': {
2138
- const ok = coordinator.resume();
2139
- console.log(ok ? chalk_1.default.green('Goal resumed.') : chalk_1.default.red('Cannot resume.'));
2140
- return { success: ok };
2141
- }
2142
- case 'clear': {
2143
- const ok = coordinator.clear();
2144
- console.log(ok ? chalk_1.default.gray('Goal cleared.') : chalk_1.default.gray('No goal to clear.'));
2145
- return { success: ok };
2146
- }
2147
- case 'status': {
2148
- const snap = coordinator.snapshot();
2149
- if (!snap) {
2150
- console.log(chalk_1.default.gray('No goal set.'));
2151
- return { success: true };
2152
- }
2153
- console.log(chalk_1.default.bold(`Status: ${snap.status}`));
2154
- console.log(`Objective: ${snap.objective}`);
2155
- console.log(`Continuations: ${snap.continuationCount} | Tokens: ${snap.tokensUsed}`);
2156
- return { success: true };
2157
- }
2158
- case 'edit': {
2159
- if (!rest) {
2160
- console.log(chalk_1.default.red('Usage: /target edit <new objective text>'));
2161
- return { success: false };
2162
- }
2163
- const ok = coordinator.edit(rest);
2164
- console.log(ok ? chalk_1.default.green('Goal objective updated.') : chalk_1.default.red('Cannot edit.'));
2165
- return { success: ok };
2166
- }
2167
- case 'replace': {
2168
- if (!rest) {
2169
- console.log(chalk_1.default.red('Usage: /target replace <new objective text>'));
2170
- return { success: false };
2171
- }
2172
- const ok = coordinator.replace(rest);
2173
- console.log(ok ? chalk_1.default.green('Goal replaced.') : chalk_1.default.red('Cannot replace.'));
2174
- return { success: ok };
2175
- }
2176
- default: {
2177
- // Treat as new objective
2178
- const result = coordinator.create(trimmed);
2179
- console.log(result.ok ? chalk_1.default.green('Goal created: ') + trimmed : chalk_1.default.red(result.error ?? 'Failed'));
2180
- return { success: result.ok };
2181
- }
2182
- }
2183
- }
2184
2139
  function handleDiff(ctx, args) {
2185
2140
  const maxFilesMatch = args.match(/--max-files(?:=|\s+)(\d+)/);
2186
2141
  const maxFiles = maxFilesMatch ? Number(maxFilesMatch[1]) : 40;
@@ -2246,17 +2201,27 @@ function handleTodos(ctx) {
2246
2201
  console.log();
2247
2202
  return { success: true };
2248
2203
  }
2249
- function handleClearHistory(ctx) {
2204
+ function handleContextClear(ctx, args) {
2250
2205
  const history = ctx.store.getSnapshot().conversationHistory;
2251
2206
  if (history.length === 0) {
2252
- console.log(DIM('Conversation history is already empty'));
2207
+ console.log(DIM('Current in-memory model context is already empty.'));
2253
2208
  console.log();
2254
2209
  return { success: true };
2255
2210
  }
2211
+ if (!hasCommandFlag(args, '--yes')) {
2212
+ return {
2213
+ success: false,
2214
+ error: [
2215
+ `This will clear ${history.length} message(s) from the current in-memory model context.`,
2216
+ 'Saved session history will not be deleted and can still be restored with /resume.',
2217
+ 'Run /context-clear --yes to continue.',
2218
+ ].join('\n'),
2219
+ };
2220
+ }
2256
2221
  ctx.store.resetConversation();
2257
2222
  (0, framework_1.resetToolState)();
2258
- console.log(SUCCESS(`✔ Cleared ${history.length} messages from conversation history`));
2259
- console.log(DIM(' Configuration and system state preserved'));
2223
+ console.log(SUCCESS(`✔ Cleared ${history.length} messages from current model context`));
2224
+ console.log(DIM(' Saved session history, configuration, and system state were preserved.'));
2260
2225
  console.log();
2261
2226
  return { success: true };
2262
2227
  }
@@ -2285,7 +2250,7 @@ async function handleCompact(ctx, args) {
2285
2250
  console.log(DIM((0, agent_status_1.compactStatus)()));
2286
2251
  try {
2287
2252
  const modelId = ctx.llm?.getModel() ?? ctx.store.getSnapshot().currentModel;
2288
- const coordinator = ctx.compactCoordinator ?? new coordinator_2.CompactCoordinator({
2253
+ const coordinator = ctx.compactCoordinator ?? new coordinator_1.CompactCoordinator({
2289
2254
  modelId,
2290
2255
  llm: ctx.llm,
2291
2256
  outputReserveTokens: ctx.llm?.getMaxTokens?.(),
@@ -2877,21 +2842,18 @@ const COMMANDS = [
2877
2842
  // Coding workflows
2878
2843
  {
2879
2844
  name: 'target',
2845
+ aliases: ['goal'],
2880
2846
  description: 'Create, view, pause, resume, or clear a persistent goal target',
2881
- argumentHint: '[objective | pause | resume | clear | status | edit <text>]',
2847
+ argumentHint: '[objective | pause | resume | clear --yes | status | edit <text> | budget <tokens>]',
2882
2848
  category: 'workflow',
2883
2849
  priority: 3,
2884
2850
  type: 'builtin',
2885
- execute: (ctx, args) => handleTarget(ctx, args),
2886
- },
2887
- {
2888
- name: 'goal',
2889
- description: 'Alias for /target manage a persistent goal target',
2890
- argumentHint: '[objective | pause | resume | clear | status | edit <text>]',
2891
- category: 'workflow',
2892
- priority: 2,
2893
- type: 'builtin',
2894
- execute: (ctx, args) => handleTarget(ctx, args),
2851
+ execution: 'builtin',
2852
+ risk: 'state-write',
2853
+ execute: () => ({
2854
+ success: false,
2855
+ error: '/target must be routed through the shared AgentRuntimeController.',
2856
+ }),
2895
2857
  },
2896
2858
  {
2897
2859
  name: 'diff',
@@ -2900,6 +2862,8 @@ const COMMANDS = [
2900
2862
  category: 'workflow',
2901
2863
  priority: 5,
2902
2864
  type: 'builtin',
2865
+ execution: 'builtin',
2866
+ risk: 'read-only',
2903
2867
  execute: (ctx, args) => handleDiff(ctx, args),
2904
2868
  },
2905
2869
  {
@@ -2909,6 +2873,8 @@ const COMMANDS = [
2909
2873
  category: 'workflow',
2910
2874
  priority: 8,
2911
2875
  type: 'builtin',
2876
+ execution: 'builtin',
2877
+ risk: 'read-only',
2912
2878
  execute: (ctx, args) => handleCommitPlan(ctx, args),
2913
2879
  },
2914
2880
  {
@@ -2918,6 +2884,8 @@ const COMMANDS = [
2918
2884
  category: 'workflow',
2919
2885
  priority: 10,
2920
2886
  type: 'chat',
2887
+ execution: 'agent-workflow',
2888
+ risk: 'read-only',
2921
2889
  execute: (_ctx, args) => continueAsSlashChat('review', args),
2922
2890
  },
2923
2891
  {
@@ -2928,6 +2896,8 @@ const COMMANDS = [
2928
2896
  category: 'workflow',
2929
2897
  priority: 20,
2930
2898
  type: 'chat',
2899
+ execution: 'agent-workflow',
2900
+ risk: 'read-only',
2931
2901
  execute: (_ctx, args) => continueAsSlashChat('security', args),
2932
2902
  },
2933
2903
  {
@@ -2938,6 +2908,8 @@ const COMMANDS = [
2938
2908
  category: 'workflow',
2939
2909
  priority: 30,
2940
2910
  type: 'chat',
2911
+ execution: 'agent-workflow',
2912
+ risk: 'state-write',
2941
2913
  execute: (_ctx, args) => continueAsSlashChat('test-gen', args),
2942
2914
  },
2943
2915
  {
@@ -2947,6 +2919,8 @@ const COMMANDS = [
2947
2919
  category: 'workflow',
2948
2920
  priority: 40,
2949
2921
  type: 'builtin',
2922
+ execution: 'builtin',
2923
+ risk: 'read-only',
2950
2924
  execute: (ctx) => handleTodos(ctx),
2951
2925
  },
2952
2926
  // Sessions and context lifecycle
@@ -2957,6 +2931,8 @@ const COMMANDS = [
2957
2931
  category: 'session',
2958
2932
  priority: 10,
2959
2933
  type: 'builtin',
2934
+ execution: 'builtin',
2935
+ risk: 'state-write',
2960
2936
  execute: (ctx, args) => handleResume(ctx, args),
2961
2937
  },
2962
2938
  {
@@ -2966,6 +2942,8 @@ const COMMANDS = [
2966
2942
  category: 'session',
2967
2943
  priority: 20,
2968
2944
  type: 'builtin',
2945
+ execution: 'builtin',
2946
+ risk: 'read-only',
2969
2947
  execute: (ctx, args) => handleSessions(ctx, args),
2970
2948
  },
2971
2949
  {
@@ -2976,6 +2954,8 @@ const COMMANDS = [
2976
2954
  category: 'session',
2977
2955
  priority: 30,
2978
2956
  type: 'builtin',
2957
+ execution: 'builtin',
2958
+ risk: 'state-write',
2979
2959
  execute: (ctx, args) => handleSessionRename(ctx, args),
2980
2960
  },
2981
2961
  {
@@ -2985,16 +2965,34 @@ const COMMANDS = [
2985
2965
  category: 'session',
2986
2966
  priority: 40,
2987
2967
  type: 'builtin',
2968
+ execution: 'builtin',
2969
+ risk: 'state-write',
2988
2970
  execute: (ctx, args) => handleCompact(ctx, args),
2989
2971
  },
2972
+ {
2973
+ name: 'context-clear',
2974
+ description: 'Clear current in-memory model context; preserve saved session history',
2975
+ argumentHint: '--yes',
2976
+ category: 'session',
2977
+ priority: 50,
2978
+ type: 'builtin',
2979
+ execution: 'builtin',
2980
+ risk: 'destructive',
2981
+ execute: (ctx, args) => handleContextClear(ctx, args),
2982
+ },
2990
2983
  {
2991
2984
  name: 'clear-history',
2992
2985
  aliases: ['reset'],
2993
- description: 'Clear conversation history (keep config)',
2994
- category: 'session',
2986
+ description: 'Deprecated alias for clearing only the current in-memory model context',
2987
+ argumentHint: '--yes',
2988
+ category: 'legacy',
2995
2989
  priority: 50,
2996
2990
  type: 'builtin',
2997
- execute: (ctx) => handleClearHistory(ctx),
2991
+ isHidden: true,
2992
+ execution: 'builtin',
2993
+ risk: 'destructive',
2994
+ deprecated: { since: 'v0.1.1', replacement: '/context-clear', removeIn: 'v0.3.0' },
2995
+ execute: (ctx, args) => handleContextClear(ctx, args),
2998
2996
  },
2999
2997
  // Harness, memory, and skills
3000
2998
  {
@@ -3004,6 +3002,8 @@ const COMMANDS = [
3004
3002
  category: 'context',
3005
3003
  priority: 10,
3006
3004
  type: 'builtin',
3005
+ execution: 'builtin',
3006
+ risk: 'read-only',
3007
3007
  execute: (ctx, args) => showHarness(ctx, args),
3008
3008
  },
3009
3009
  {
@@ -3012,6 +3012,8 @@ const COMMANDS = [
3012
3012
  category: 'context',
3013
3013
  priority: 20,
3014
3014
  type: 'builtin',
3015
+ execution: 'builtin',
3016
+ risk: 'read-only',
3015
3017
  execute: (ctx) => handleSkills(ctx),
3016
3018
  },
3017
3019
  {
@@ -3022,6 +3024,8 @@ const COMMANDS = [
3022
3024
  category: 'context',
3023
3025
  priority: 21,
3024
3026
  type: 'chat',
3027
+ execution: 'agent-workflow',
3028
+ risk: 'state-write',
3025
3029
  execute: (ctx, args) => handleSkill(ctx, args),
3026
3030
  },
3027
3031
  {
@@ -3031,6 +3035,8 @@ const COMMANDS = [
3031
3035
  category: 'context',
3032
3036
  priority: 30,
3033
3037
  type: 'builtin',
3038
+ execution: 'builtin',
3039
+ risk: 'state-write',
3034
3040
  execute: (ctx, args) => handleMemory(ctx, args),
3035
3041
  },
3036
3042
  // Tools and safety
@@ -3041,6 +3047,8 @@ const COMMANDS = [
3041
3047
  category: 'tools',
3042
3048
  priority: 10,
3043
3049
  type: 'builtin',
3050
+ execution: 'builtin',
3051
+ risk: 'read-only',
3044
3052
  execute: (ctx) => handleTools(ctx),
3045
3053
  },
3046
3054
  {
@@ -3049,6 +3057,8 @@ const COMMANDS = [
3049
3057
  category: 'tools',
3050
3058
  priority: 15,
3051
3059
  type: 'builtin',
3060
+ execution: 'builtin',
3061
+ risk: 'read-only',
3052
3062
  execute: (ctx) => handleEditPreview(ctx),
3053
3063
  },
3054
3064
  {
@@ -3057,6 +3067,8 @@ const COMMANDS = [
3057
3067
  category: 'tools',
3058
3068
  priority: 20,
3059
3069
  type: 'builtin',
3070
+ execution: 'builtin',
3071
+ risk: 'read-only',
3060
3072
  execute: (ctx) => handleMcp(ctx),
3061
3073
  },
3062
3074
  {
@@ -3065,6 +3077,8 @@ const COMMANDS = [
3065
3077
  category: 'tools',
3066
3078
  priority: 30,
3067
3079
  type: 'builtin',
3080
+ execution: 'builtin',
3081
+ risk: 'read-only',
3068
3082
  execute: (ctx) => showSafety(ctx),
3069
3083
  },
3070
3084
  // Model and runtime configuration
@@ -3075,6 +3089,8 @@ const COMMANDS = [
3075
3089
  category: 'model',
3076
3090
  priority: 10,
3077
3091
  type: 'builtin',
3092
+ execution: 'builtin',
3093
+ risk: 'state-write',
3078
3094
  execute: (ctx, args) => handleModel(ctx, args),
3079
3095
  },
3080
3096
  {
@@ -3085,6 +3101,8 @@ const COMMANDS = [
3085
3101
  category: 'model',
3086
3102
  priority: 20,
3087
3103
  type: 'builtin',
3104
+ execution: 'builtin',
3105
+ risk: 'state-write',
3088
3106
  execute: (ctx, args) => handleMode(ctx, args),
3089
3107
  },
3090
3108
  {
@@ -3093,6 +3111,8 @@ const COMMANDS = [
3093
3111
  category: 'model',
3094
3112
  priority: 30,
3095
3113
  type: 'builtin',
3114
+ execution: 'builtin',
3115
+ risk: 'read-only',
3096
3116
  execute: (ctx) => showConfig(ctx),
3097
3117
  },
3098
3118
  // System commands
@@ -3103,7 +3123,9 @@ const COMMANDS = [
3103
3123
  category: 'system',
3104
3124
  priority: 10,
3105
3125
  type: 'builtin',
3106
- execute: () => showHelp(),
3126
+ execution: 'builtin',
3127
+ risk: 'read-only',
3128
+ execute: ctx => showHelp(ctx),
3107
3129
  },
3108
3130
  {
3109
3131
  name: 'status',
@@ -3112,19 +3134,47 @@ const COMMANDS = [
3112
3134
  category: 'system',
3113
3135
  priority: 20,
3114
3136
  type: 'builtin',
3137
+ execution: 'builtin',
3138
+ risk: 'read-only',
3115
3139
  execute: (ctx) => showStatus(ctx),
3116
3140
  },
3117
3141
  {
3118
3142
  name: 'clear',
3119
- description: 'Clear the terminal screen',
3143
+ description: 'Clear the current view without deleting session data',
3120
3144
  category: 'system',
3121
3145
  priority: 30,
3122
3146
  type: 'builtin',
3123
- execute: () => {
3124
- process.stdout.write('\x1Bc');
3147
+ execution: 'renderer-local',
3148
+ risk: 'read-only',
3149
+ rendererScope: ['tui', 'terminal'],
3150
+ execute: ctx => {
3151
+ ctx.clearView?.();
3125
3152
  return { success: true };
3126
3153
  },
3127
3154
  },
3155
+ {
3156
+ name: 'tool-output',
3157
+ description: 'Set the TUI tool output presentation mode',
3158
+ argumentHint: '[adaptive|collapsed|full]',
3159
+ category: 'system',
3160
+ priority: 32,
3161
+ type: 'builtin',
3162
+ execution: 'renderer-local',
3163
+ risk: 'read-only',
3164
+ rendererScope: ['tui'],
3165
+ execute: () => ({ success: true }),
3166
+ },
3167
+ {
3168
+ name: 'redraw',
3169
+ description: 'Redraw the TUI-owned live region',
3170
+ category: 'system',
3171
+ priority: 34,
3172
+ type: 'builtin',
3173
+ execution: 'renderer-local',
3174
+ risk: 'read-only',
3175
+ rendererScope: ['tui'],
3176
+ execute: () => ({ success: true }),
3177
+ },
3128
3178
  {
3129
3179
  name: 'exit',
3130
3180
  aliases: ['quit', 'q'],
@@ -3132,6 +3182,8 @@ const COMMANDS = [
3132
3182
  category: 'system',
3133
3183
  priority: 40,
3134
3184
  type: 'builtin',
3185
+ execution: 'builtin',
3186
+ risk: 'state-write',
3135
3187
  execute: (ctx) => handleExit(ctx),
3136
3188
  },
3137
3189
  // Diagnostics
@@ -3142,15 +3194,19 @@ const COMMANDS = [
3142
3194
  category: 'diagnostics',
3143
3195
  priority: 5,
3144
3196
  type: 'builtin',
3197
+ execution: 'builtin',
3198
+ risk: 'read-only',
3145
3199
  execute: (ctx) => handleDoctor(ctx),
3146
3200
  },
3147
3201
  {
3148
3202
  name: 'storage',
3149
3203
  description: 'Inspect, repair, or clean Orion Code storage layout',
3150
- argumentHint: '[doctor|repair|cleanup --dry-run]',
3204
+ argumentHint: '[doctor|repair [--yes]|cleanup [--dry-run|--yes]]',
3151
3205
  category: 'diagnostics',
3152
3206
  priority: 8,
3153
3207
  type: 'builtin',
3208
+ execution: 'builtin',
3209
+ risk: 'destructive',
3154
3210
  execute: (ctx, args) => handleStorage(ctx, args),
3155
3211
  },
3156
3212
  {
@@ -3160,6 +3216,8 @@ const COMMANDS = [
3160
3216
  category: 'diagnostics',
3161
3217
  priority: 10,
3162
3218
  type: 'builtin',
3219
+ execution: 'builtin',
3220
+ risk: 'read-only',
3163
3221
  execute: (ctx) => handleUsage(ctx),
3164
3222
  },
3165
3223
  {
@@ -3169,6 +3227,8 @@ const COMMANDS = [
3169
3227
  category: 'diagnostics',
3170
3228
  priority: 12,
3171
3229
  type: 'builtin',
3230
+ execution: 'builtin',
3231
+ risk: 'read-only',
3172
3232
  execute: (ctx) => handleLoopStats(ctx),
3173
3233
  },
3174
3234
  {
@@ -3178,6 +3238,8 @@ const COMMANDS = [
3178
3238
  category: 'diagnostics',
3179
3239
  priority: 14,
3180
3240
  type: 'builtin',
3241
+ execution: 'builtin',
3242
+ risk: 'read-only',
3181
3243
  execute: (ctx, args) => handleTrace(ctx, args),
3182
3244
  },
3183
3245
  {
@@ -3187,6 +3249,8 @@ const COMMANDS = [
3187
3249
  category: 'diagnostics',
3188
3250
  priority: 15,
3189
3251
  type: 'builtin',
3252
+ execution: 'builtin',
3253
+ risk: 'read-only',
3190
3254
  execute: (ctx, args) => handleLastTool(ctx, args),
3191
3255
  },
3192
3256
  {
@@ -3197,6 +3261,8 @@ const COMMANDS = [
3197
3261
  category: 'diagnostics',
3198
3262
  priority: 16,
3199
3263
  type: 'builtin',
3264
+ execution: 'builtin',
3265
+ risk: 'read-only',
3200
3266
  execute: (ctx, args) => handleArtifacts(ctx, args),
3201
3267
  },
3202
3268
  {
@@ -3207,6 +3273,8 @@ const COMMANDS = [
3207
3273
  category: 'diagnostics',
3208
3274
  priority: 18,
3209
3275
  type: 'builtin',
3276
+ execution: 'builtin',
3277
+ risk: 'destructive',
3210
3278
  execute: (ctx, args) => handleCheckpoint(ctx, args),
3211
3279
  },
3212
3280
  {
@@ -3215,6 +3283,9 @@ const COMMANDS = [
3215
3283
  category: 'diagnostics',
3216
3284
  priority: 20,
3217
3285
  type: 'builtin',
3286
+ execution: 'builtin',
3287
+ risk: 'read-only',
3288
+ deprecated: { since: 'v0.1.1', replacement: '/usage', removeIn: 'v0.3.0' },
3218
3289
  execute: (ctx) => handleCost(ctx),
3219
3290
  },
3220
3291
  {
@@ -3223,18 +3294,23 @@ const COMMANDS = [
3223
3294
  category: 'diagnostics',
3224
3295
  priority: 30,
3225
3296
  type: 'builtin',
3297
+ execution: 'builtin',
3298
+ risk: 'read-only',
3299
+ isHidden: true,
3226
3300
  execute: (ctx) => showAgents(ctx),
3227
3301
  },
3228
3302
  {
3229
3303
  name: 'migrate',
3230
3304
  description: 'Migrate data from OpenHorse to Orion Code',
3231
- argumentHint: 'openhorse [--dry-run] [--include-env] [--include-project-files]',
3305
+ argumentHint: 'openhorse [--dry-run | --yes] [--include-env] [--include-project-files]',
3232
3306
  category: 'diagnostics',
3233
3307
  priority: 32,
3234
3308
  type: 'builtin',
3309
+ execution: 'builtin',
3310
+ risk: 'destructive',
3235
3311
  execute: (ctx, args) => (0, command_1.handleMigrateCommand)(ctx, args),
3236
3312
  },
3237
- // Legacy commands kept executable for compatibility, but not shown in Ink help/palette.
3313
+ // Legacy commands kept executable for compatibility, but not shown in help/palette.
3238
3314
  {
3239
3315
  name: 'task',
3240
3316
  description: 'Submit or list tasks',
@@ -3242,6 +3318,9 @@ const COMMANDS = [
3242
3318
  category: 'legacy',
3243
3319
  type: 'builtin',
3244
3320
  isHidden: true,
3321
+ execution: 'builtin',
3322
+ risk: 'state-write',
3323
+ deprecated: { since: 'v0.1.1', replacement: '/target', removeIn: 'v0.3.0' },
3245
3324
  execute: (ctx, args) => handleTask(ctx, args),
3246
3325
  },
3247
3326
  {
@@ -3251,6 +3330,9 @@ const COMMANDS = [
3251
3330
  category: 'legacy',
3252
3331
  type: 'builtin',
3253
3332
  isHidden: true,
3333
+ execution: 'agent-workflow',
3334
+ risk: 'state-write',
3335
+ deprecated: { since: 'v0.1.1', replacement: '/target', removeIn: 'v0.3.0' },
3254
3336
  execute: (ctx, args) => handleRun(ctx, args),
3255
3337
  },
3256
3338
  {
@@ -3260,6 +3342,9 @@ const COMMANDS = [
3260
3342
  category: 'legacy',
3261
3343
  type: 'chat',
3262
3344
  isHidden: true,
3345
+ execution: 'agent-workflow',
3346
+ risk: 'state-write',
3347
+ deprecated: { since: 'v0.1.1', removeIn: 'v0.3.0' },
3263
3348
  execute: (ctx, args) => ({ success: true, continueAsChat: true, chatInput: args }),
3264
3349
  },
3265
3350
  ];
@@ -3269,8 +3354,9 @@ const COMMANDS = [
3269
3354
  function getCommands() {
3270
3355
  return sortCommands(COMMANDS);
3271
3356
  }
3272
- function getVisibleCommands() {
3273
- return sortCommands(COMMANDS.filter(command => !command.isHidden));
3357
+ function getVisibleCommands(renderer) {
3358
+ return sortCommands(COMMANDS.filter(command => !command.isHidden
3359
+ && (!renderer || !command.rendererScope || command.rendererScope.includes(renderer))));
3274
3360
  }
3275
3361
  function findCommand(name) {
3276
3362
  return COMMANDS.find(c => c.name === name || c.aliases?.includes(name));