@pentoshi/clai 2.0.62 → 3.5.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 (475) hide show
  1. package/README.md +262 -368
  2. package/dist/agent/classic-renderer.js +9 -1
  3. package/dist/agent/classic-renderer.js.map +1 -1
  4. package/dist/agent/context-manager.d.ts +5 -0
  5. package/dist/agent/context-manager.js +14 -2
  6. package/dist/agent/context-manager.js.map +1 -1
  7. package/dist/agent/events.d.ts +9 -1
  8. package/dist/agent/plan-tool.js +80 -8
  9. package/dist/agent/plan-tool.js.map +1 -1
  10. package/dist/agent/runner.js +261 -122
  11. package/dist/agent/runner.js.map +1 -1
  12. package/dist/agent/tool-call-parser.d.ts +20 -0
  13. package/dist/agent/tool-call-parser.js +186 -2
  14. package/dist/agent/tool-call-parser.js.map +1 -1
  15. package/dist/app/adapters/agent-event-adapter.d.ts +29 -0
  16. package/dist/app/adapters/agent-event-adapter.js +148 -0
  17. package/dist/app/adapters/agent-event-adapter.js.map +1 -0
  18. package/dist/app/adapters/current-agent-adapter.d.ts +7 -0
  19. package/dist/app/adapters/current-agent-adapter.js +27 -0
  20. package/dist/app/adapters/current-agent-adapter.js.map +1 -0
  21. package/dist/app/adapters/current-jobs-adapter.d.ts +4 -0
  22. package/dist/app/adapters/current-jobs-adapter.js +13 -0
  23. package/dist/app/adapters/current-jobs-adapter.js.map +1 -0
  24. package/dist/app/adapters/current-store-adapter.d.ts +3 -0
  25. package/dist/app/adapters/current-store-adapter.js +22 -0
  26. package/dist/app/adapters/current-store-adapter.js.map +1 -0
  27. package/dist/app/adapters/current-terminal-adapter.d.ts +9 -0
  28. package/dist/app/adapters/current-terminal-adapter.js +31 -0
  29. package/dist/app/adapters/current-terminal-adapter.js.map +1 -0
  30. package/dist/app/adapters/current-updates-adapter.d.ts +7 -0
  31. package/dist/app/adapters/current-updates-adapter.js +31 -0
  32. package/dist/app/adapters/current-updates-adapter.js.map +1 -0
  33. package/dist/app/adapters/in-memory-clipboard-adapter.d.ts +10 -0
  34. package/dist/app/adapters/in-memory-clipboard-adapter.js +20 -0
  35. package/dist/app/adapters/in-memory-clipboard-adapter.js.map +1 -0
  36. package/dist/app/commands/command.d.ts +24 -0
  37. package/dist/app/commands/command.js +4 -0
  38. package/dist/app/commands/command.js.map +1 -0
  39. package/dist/app/commands/registry.d.ts +45 -0
  40. package/dist/app/commands/registry.js +164 -0
  41. package/dist/app/commands/registry.js.map +1 -0
  42. package/dist/app/controllers/disposable.d.ts +15 -0
  43. package/dist/app/controllers/disposable.js +38 -0
  44. package/dist/app/controllers/disposable.js.map +1 -0
  45. package/dist/app/controllers/job-controller.d.ts +22 -0
  46. package/dist/app/controllers/job-controller.js +35 -0
  47. package/dist/app/controllers/job-controller.js.map +1 -0
  48. package/dist/app/controllers/plan-controller.d.ts +31 -0
  49. package/dist/app/controllers/plan-controller.js +69 -0
  50. package/dist/app/controllers/plan-controller.js.map +1 -0
  51. package/dist/app/controllers/session-controller.d.ts +167 -0
  52. package/dist/app/controllers/session-controller.js +467 -0
  53. package/dist/app/controllers/session-controller.js.map +1 -0
  54. package/dist/app/controllers/turn-controller.d.ts +52 -0
  55. package/dist/app/controllers/turn-controller.js +118 -0
  56. package/dist/app/controllers/turn-controller.js.map +1 -0
  57. package/dist/app/events/app-event.d.ts +122 -0
  58. package/dist/app/events/app-event.js +25 -0
  59. package/dist/app/events/app-event.js.map +1 -0
  60. package/dist/app/events/event-buffer.d.ts +51 -0
  61. package/dist/app/events/event-buffer.js +109 -0
  62. package/dist/app/events/event-buffer.js.map +1 -0
  63. package/dist/app/events/sequencer.d.ts +32 -0
  64. package/dist/app/events/sequencer.js +55 -0
  65. package/dist/app/events/sequencer.js.map +1 -0
  66. package/dist/app/ports/agent-port.d.ts +29 -0
  67. package/dist/app/ports/agent-port.js +2 -0
  68. package/dist/app/ports/agent-port.js.map +1 -0
  69. package/dist/app/ports/clipboard-port.d.ts +9 -0
  70. package/dist/app/ports/clipboard-port.js +2 -0
  71. package/dist/app/ports/clipboard-port.js.map +1 -0
  72. package/dist/app/ports/confirm-port.d.ts +17 -0
  73. package/dist/app/ports/confirm-port.js +2 -0
  74. package/dist/app/ports/confirm-port.js.map +1 -0
  75. package/dist/app/ports/jobs-port.d.ts +18 -0
  76. package/dist/app/ports/jobs-port.js +2 -0
  77. package/dist/app/ports/jobs-port.js.map +1 -0
  78. package/dist/app/ports/persistence-port.d.ts +21 -0
  79. package/dist/app/ports/persistence-port.js +2 -0
  80. package/dist/app/ports/persistence-port.js.map +1 -0
  81. package/dist/app/ports/secret-port.d.ts +12 -0
  82. package/dist/app/ports/secret-port.js +2 -0
  83. package/dist/app/ports/secret-port.js.map +1 -0
  84. package/dist/app/ports/terminal-port.d.ts +18 -0
  85. package/dist/app/ports/terminal-port.js +2 -0
  86. package/dist/app/ports/terminal-port.js.map +1 -0
  87. package/dist/app/ports/updates-port.d.ts +12 -0
  88. package/dist/app/ports/updates-port.js +2 -0
  89. package/dist/app/ports/updates-port.js.map +1 -0
  90. package/dist/commands/doctor.js +19 -0
  91. package/dist/commands/doctor.js.map +1 -1
  92. package/dist/commands/update.js +1 -1
  93. package/dist/commands/update.js.map +1 -1
  94. package/dist/index.js +47 -12
  95. package/dist/index.js.map +1 -1
  96. package/dist/llm/router.js +4 -2
  97. package/dist/llm/router.js.map +1 -1
  98. package/dist/prompts/index.d.ts +1 -1
  99. package/dist/prompts/index.js +11 -8
  100. package/dist/prompts/index.js.map +1 -1
  101. package/dist/repl/slash-commands.js +1 -1
  102. package/dist/repl/slash-commands.js.map +1 -1
  103. package/dist/repl.js +35 -107
  104. package/dist/repl.js.map +1 -1
  105. package/dist/store/config.js +3 -1
  106. package/dist/store/config.js.map +1 -1
  107. package/dist/store/history.d.ts +26 -2
  108. package/dist/store/history.js +383 -72
  109. package/dist/store/history.js.map +1 -1
  110. package/dist/store/logs.js +3 -3
  111. package/dist/store/logs.js.map +1 -1
  112. package/dist/store/paths.d.ts +6 -0
  113. package/dist/store/paths.js +38 -0
  114. package/dist/store/paths.js.map +1 -0
  115. package/dist/store/plan.js +8 -5
  116. package/dist/store/plan.js.map +1 -1
  117. package/dist/tools/fs.d.ts +6 -0
  118. package/dist/tools/fs.js +56 -6
  119. package/dist/tools/fs.js.map +1 -1
  120. package/dist/tools/jobs.js +2 -2
  121. package/dist/tools/jobs.js.map +1 -1
  122. package/dist/tools/registry.js +189 -67
  123. package/dist/tools/registry.js.map +1 -1
  124. package/dist/tools/shell.js +2 -2
  125. package/dist/tools/shell.js.map +1 -1
  126. package/dist/tui/runtime.d.ts +19 -0
  127. package/dist/tui/runtime.js +92 -0
  128. package/dist/tui/runtime.js.map +1 -0
  129. package/dist/tui/state.js +22 -17
  130. package/dist/tui/state.js.map +1 -1
  131. package/dist/tui-v2/actions/action-id.d.ts +14 -0
  132. package/dist/tui-v2/actions/action-id.js +109 -0
  133. package/dist/tui-v2/actions/action-id.js.map +1 -0
  134. package/dist/tui-v2/actions/action-router.d.ts +18 -0
  135. package/dist/tui-v2/actions/action-router.js +62 -0
  136. package/dist/tui-v2/actions/action-router.js.map +1 -0
  137. package/dist/tui-v2/actions/chord-from-key.d.ts +26 -0
  138. package/dist/tui-v2/actions/chord-from-key.js +45 -0
  139. package/dist/tui-v2/actions/chord-from-key.js.map +1 -0
  140. package/dist/tui-v2/actions/keymap.d.ts +24 -0
  141. package/dist/tui-v2/actions/keymap.js +134 -0
  142. package/dist/tui-v2/actions/keymap.js.map +1 -0
  143. package/dist/tui-v2/app/App.d.ts +13 -0
  144. package/dist/tui-v2/app/App.js +332 -0
  145. package/dist/tui-v2/app/App.js.map +1 -0
  146. package/dist/tui-v2/app/command-handlers.d.ts +8 -0
  147. package/dist/tui-v2/app/command-handlers.js +66 -0
  148. package/dist/tui-v2/app/command-handlers.js.map +1 -0
  149. package/dist/tui-v2/app/commands/config-commands.d.ts +14 -0
  150. package/dist/tui-v2/app/commands/config-commands.js +161 -0
  151. package/dist/tui-v2/app/commands/config-commands.js.map +1 -0
  152. package/dist/tui-v2/app/commands/key-commands.d.ts +9 -0
  153. package/dist/tui-v2/app/commands/key-commands.js +263 -0
  154. package/dist/tui-v2/app/commands/key-commands.js.map +1 -0
  155. package/dist/tui-v2/app/commands/picker-commands.d.ts +24 -0
  156. package/dist/tui-v2/app/commands/picker-commands.js +423 -0
  157. package/dist/tui-v2/app/commands/picker-commands.js.map +1 -0
  158. package/dist/tui-v2/app/commands/session-commands.d.ts +19 -0
  159. package/dist/tui-v2/app/commands/session-commands.js +162 -0
  160. package/dist/tui-v2/app/commands/session-commands.js.map +1 -0
  161. package/dist/tui-v2/app/plan-lifecycle.d.ts +22 -0
  162. package/dist/tui-v2/app/plan-lifecycle.js +95 -0
  163. package/dist/tui-v2/app/plan-lifecycle.js.map +1 -0
  164. package/dist/tui-v2/app/providers.d.ts +17 -0
  165. package/dist/tui-v2/app/providers.js +32 -0
  166. package/dist/tui-v2/app/providers.js.map +1 -0
  167. package/dist/tui-v2/bootstrap/capabilities.d.ts +35 -0
  168. package/dist/tui-v2/bootstrap/capabilities.js +93 -0
  169. package/dist/tui-v2/bootstrap/capabilities.js.map +1 -0
  170. package/dist/tui-v2/bootstrap/composition-root.d.ts +85 -0
  171. package/dist/tui-v2/bootstrap/composition-root.js +131 -0
  172. package/dist/tui-v2/bootstrap/composition-root.js.map +1 -0
  173. package/dist/tui-v2/bootstrap/disable-native-selection.d.ts +11 -0
  174. package/dist/tui-v2/bootstrap/disable-native-selection.js +13 -0
  175. package/dist/tui-v2/bootstrap/disable-native-selection.js.map +1 -0
  176. package/dist/tui-v2/bootstrap/lifecycle.d.ts +62 -0
  177. package/dist/tui-v2/bootstrap/lifecycle.js +123 -0
  178. package/dist/tui-v2/bootstrap/lifecycle.js.map +1 -0
  179. package/dist/tui-v2/bootstrap/osc52-clipboard.d.ts +28 -0
  180. package/dist/tui-v2/bootstrap/osc52-clipboard.js +44 -0
  181. package/dist/tui-v2/bootstrap/osc52-clipboard.js.map +1 -0
  182. package/dist/tui-v2/bootstrap/overlay-ports.d.ts +12 -0
  183. package/dist/{tui/confirm.js → tui-v2/bootstrap/overlay-ports.js} +17 -25
  184. package/dist/tui-v2/bootstrap/overlay-ports.js.map +1 -0
  185. package/dist/tui-v2/bootstrap/pager-export.d.ts +24 -0
  186. package/dist/tui-v2/bootstrap/pager-export.js +87 -0
  187. package/dist/tui-v2/bootstrap/pager-export.js.map +1 -0
  188. package/dist/tui-v2/bootstrap/start-tui-v2.d.ts +15 -0
  189. package/dist/tui-v2/bootstrap/start-tui-v2.js +95 -0
  190. package/dist/tui-v2/bootstrap/start-tui-v2.js.map +1 -0
  191. package/dist/tui-v2/bootstrap/ui-selection.d.ts +30 -0
  192. package/dist/tui-v2/bootstrap/ui-selection.js +59 -0
  193. package/dist/tui-v2/bootstrap/ui-selection.js.map +1 -0
  194. package/dist/tui-v2/components/completion/completion-menu.d.ts +23 -0
  195. package/dist/tui-v2/components/completion/completion-menu.js +84 -0
  196. package/dist/tui-v2/components/completion/completion-menu.js.map +1 -0
  197. package/dist/tui-v2/components/jobs/jobs-panel.d.ts +16 -0
  198. package/dist/tui-v2/components/jobs/jobs-panel.js +92 -0
  199. package/dist/tui-v2/components/jobs/jobs-panel.js.map +1 -0
  200. package/dist/tui-v2/components/modal/confirm-modal.d.ts +20 -0
  201. package/dist/tui-v2/components/modal/confirm-modal.js +110 -0
  202. package/dist/tui-v2/components/modal/confirm-modal.js.map +1 -0
  203. package/dist/tui-v2/components/modal/prompt-actions-modal.d.ts +15 -0
  204. package/dist/tui-v2/components/modal/prompt-actions-modal.js +80 -0
  205. package/dist/tui-v2/components/modal/prompt-actions-modal.js.map +1 -0
  206. package/dist/tui-v2/components/modal/secret-modal.d.ts +18 -0
  207. package/dist/tui-v2/components/modal/secret-modal.js +50 -0
  208. package/dist/tui-v2/components/modal/secret-modal.js.map +1 -0
  209. package/dist/tui-v2/components/overlay/overlay-host.d.ts +26 -0
  210. package/dist/tui-v2/components/overlay/overlay-host.js +43 -0
  211. package/dist/tui-v2/components/overlay/overlay-host.js.map +1 -0
  212. package/dist/tui-v2/components/pager/pager.d.ts +20 -0
  213. package/dist/tui-v2/components/pager/pager.js +396 -0
  214. package/dist/tui-v2/components/pager/pager.js.map +1 -0
  215. package/dist/tui-v2/components/picker/picker.d.ts +17 -0
  216. package/dist/tui-v2/components/picker/picker.js +222 -0
  217. package/dist/tui-v2/components/picker/picker.js.map +1 -0
  218. package/dist/tui-v2/components/plan/plan-view.d.ts +20 -0
  219. package/dist/tui-v2/components/plan/plan-view.js +120 -0
  220. package/dist/tui-v2/components/plan/plan-view.js.map +1 -0
  221. package/dist/tui-v2/components/queue/queue-panel.d.ts +23 -0
  222. package/dist/tui-v2/components/queue/queue-panel.js +58 -0
  223. package/dist/tui-v2/components/queue/queue-panel.js.map +1 -0
  224. package/dist/tui-v2/components/status/status-line.d.ts +27 -0
  225. package/dist/tui-v2/components/status/status-line.js +167 -0
  226. package/dist/tui-v2/components/status/status-line.js.map +1 -0
  227. package/dist/tui-v2/components/toast/toast-host.d.ts +15 -0
  228. package/dist/tui-v2/components/toast/toast-host.js +48 -0
  229. package/dist/tui-v2/components/toast/toast-host.js.map +1 -0
  230. package/dist/tui-v2/components/transcript/assistant-message.d.ts +20 -0
  231. package/dist/tui-v2/components/transcript/assistant-message.js +41 -0
  232. package/dist/tui-v2/components/transcript/assistant-message.js.map +1 -0
  233. package/dist/tui-v2/components/transcript/compacted-row.d.ts +19 -0
  234. package/dist/tui-v2/components/transcript/compacted-row.js +69 -0
  235. package/dist/tui-v2/components/transcript/compacted-row.js.map +1 -0
  236. package/dist/tui-v2/components/transcript/intro-card.d.ts +19 -0
  237. package/dist/tui-v2/components/transcript/intro-card.js +50 -0
  238. package/dist/tui-v2/components/transcript/intro-card.js.map +1 -0
  239. package/dist/tui-v2/components/transcript/linkable-text.d.ts +21 -0
  240. package/dist/tui-v2/components/transcript/linkable-text.js +46 -0
  241. package/dist/tui-v2/components/transcript/linkable-text.js.map +1 -0
  242. package/dist/tui-v2/components/transcript/notice-row.d.ts +14 -0
  243. package/dist/tui-v2/components/transcript/notice-row.js +40 -0
  244. package/dist/tui-v2/components/transcript/notice-row.js.map +1 -0
  245. package/dist/tui-v2/components/transcript/search-bar.d.ts +19 -0
  246. package/dist/tui-v2/components/transcript/search-bar.js +7 -0
  247. package/dist/tui-v2/components/transcript/search-bar.js.map +1 -0
  248. package/dist/tui-v2/components/transcript/thinking-block.d.ts +22 -0
  249. package/dist/tui-v2/components/transcript/thinking-block.js +27 -0
  250. package/dist/tui-v2/components/transcript/thinking-block.js.map +1 -0
  251. package/dist/tui-v2/components/transcript/tool-card.d.ts +26 -0
  252. package/dist/tui-v2/components/transcript/tool-card.js +205 -0
  253. package/dist/tui-v2/components/transcript/tool-card.js.map +1 -0
  254. package/dist/tui-v2/components/transcript/transcript-row.d.ts +25 -0
  255. package/dist/tui-v2/components/transcript/transcript-row.js +37 -0
  256. package/dist/tui-v2/components/transcript/transcript-row.js.map +1 -0
  257. package/dist/tui-v2/components/transcript/transcript-scroll-port.d.ts +52 -0
  258. package/dist/tui-v2/components/transcript/transcript-scroll-port.js +86 -0
  259. package/dist/tui-v2/components/transcript/transcript-scroll-port.js.map +1 -0
  260. package/dist/tui-v2/components/transcript/transcript-view.d.ts +24 -0
  261. package/dist/tui-v2/components/transcript/transcript-view.js +403 -0
  262. package/dist/tui-v2/components/transcript/transcript-view.js.map +1 -0
  263. package/dist/tui-v2/components/transcript/use-click-without-drag.d.ts +13 -0
  264. package/dist/tui-v2/components/transcript/use-click-without-drag.js +35 -0
  265. package/dist/tui-v2/components/transcript/use-click-without-drag.js.map +1 -0
  266. package/dist/tui-v2/components/transcript/use-native-selection-copy.d.ts +10 -0
  267. package/dist/tui-v2/components/transcript/use-native-selection-copy.js +37 -0
  268. package/dist/tui-v2/components/transcript/use-native-selection-copy.js.map +1 -0
  269. package/dist/tui-v2/components/transcript/use-transcript-selection.d.ts +23 -0
  270. package/dist/tui-v2/components/transcript/use-transcript-selection.js +136 -0
  271. package/dist/tui-v2/components/transcript/use-transcript-selection.js.map +1 -0
  272. package/dist/tui-v2/components/transcript/user-message.d.ts +10 -0
  273. package/dist/tui-v2/components/transcript/user-message.js +23 -0
  274. package/dist/tui-v2/components/transcript/user-message.js.map +1 -0
  275. package/dist/tui-v2/composer/arrow-intent.d.ts +23 -0
  276. package/dist/tui-v2/composer/arrow-intent.js +35 -0
  277. package/dist/tui-v2/composer/arrow-intent.js.map +1 -0
  278. package/dist/tui-v2/composer/completion.d.ts +37 -0
  279. package/dist/tui-v2/composer/completion.js +67 -0
  280. package/dist/tui-v2/composer/completion.js.map +1 -0
  281. package/dist/tui-v2/composer/composer-editor.d.ts +33 -0
  282. package/dist/tui-v2/composer/composer-editor.js +620 -0
  283. package/dist/tui-v2/composer/composer-editor.js.map +1 -0
  284. package/dist/tui-v2/composer/composer-height.d.ts +21 -0
  285. package/dist/tui-v2/composer/composer-height.js +29 -0
  286. package/dist/tui-v2/composer/composer-height.js.map +1 -0
  287. package/dist/tui-v2/composer/composer-meta.d.ts +9 -0
  288. package/dist/tui-v2/composer/composer-meta.js +38 -0
  289. package/dist/tui-v2/composer/composer-meta.js.map +1 -0
  290. package/dist/tui-v2/composer/history-nav.d.ts +15 -0
  291. package/dist/tui-v2/composer/history-nav.js +16 -0
  292. package/dist/tui-v2/composer/history-nav.js.map +1 -0
  293. package/dist/tui-v2/composer/newline-hint.d.ts +13 -0
  294. package/dist/tui-v2/composer/newline-hint.js +13 -0
  295. package/dist/tui-v2/composer/newline-hint.js.map +1 -0
  296. package/dist/tui-v2/composer/paste-placeholder.d.ts +35 -0
  297. package/dist/tui-v2/composer/paste-placeholder.js +55 -0
  298. package/dist/tui-v2/composer/paste-placeholder.js.map +1 -0
  299. package/dist/tui-v2/composer/prompt-history.d.ts +22 -0
  300. package/dist/tui-v2/composer/prompt-history.js +51 -0
  301. package/dist/tui-v2/composer/prompt-history.js.map +1 -0
  302. package/dist/tui-v2/composer/secret-buffer.d.ts +20 -0
  303. package/dist/tui-v2/composer/secret-buffer.js +42 -0
  304. package/dist/tui-v2/composer/secret-buffer.js.map +1 -0
  305. package/dist/tui-v2/composer/textarea-keybindings.d.ts +22 -0
  306. package/dist/tui-v2/composer/textarea-keybindings.js +27 -0
  307. package/dist/tui-v2/composer/textarea-keybindings.js.map +1 -0
  308. package/dist/tui-v2/controllers/focus-controller.d.ts +30 -0
  309. package/dist/tui-v2/controllers/focus-controller.js +80 -0
  310. package/dist/tui-v2/controllers/focus-controller.js.map +1 -0
  311. package/dist/tui-v2/controllers/overlay-controller.d.ts +99 -0
  312. package/dist/tui-v2/controllers/overlay-controller.js +195 -0
  313. package/dist/tui-v2/controllers/overlay-controller.js.map +1 -0
  314. package/dist/tui-v2/controllers/selection-controller.d.ts +76 -0
  315. package/dist/tui-v2/controllers/selection-controller.js +238 -0
  316. package/dist/tui-v2/controllers/selection-controller.js.map +1 -0
  317. package/dist/tui-v2/controllers/toast-controller.d.ts +35 -0
  318. package/dist/tui-v2/controllers/toast-controller.js +88 -0
  319. package/dist/tui-v2/controllers/toast-controller.js.map +1 -0
  320. package/dist/tui-v2/layout/compute-layout.d.ts +59 -0
  321. package/dist/tui-v2/layout/compute-layout.js +170 -0
  322. package/dist/tui-v2/layout/compute-layout.js.map +1 -0
  323. package/dist/tui-v2/rendering/ansi-to-styled.d.ts +17 -0
  324. package/dist/tui-v2/rendering/ansi-to-styled.js +217 -0
  325. package/dist/tui-v2/rendering/ansi-to-styled.js.map +1 -0
  326. package/dist/tui-v2/rendering/batch-sections.d.ts +57 -0
  327. package/dist/tui-v2/rendering/batch-sections.js +177 -0
  328. package/dist/tui-v2/rendering/batch-sections.js.map +1 -0
  329. package/dist/tui-v2/rendering/link-detector.d.ts +16 -0
  330. package/dist/tui-v2/rendering/link-detector.js +43 -0
  331. package/dist/tui-v2/rendering/link-detector.js.map +1 -0
  332. package/dist/tui-v2/rendering/open-tool-output.d.ts +28 -0
  333. package/dist/tui-v2/rendering/open-tool-output.js +138 -0
  334. package/dist/tui-v2/rendering/open-tool-output.js.map +1 -0
  335. package/dist/tui-v2/rendering/picker-filter.d.ts +22 -0
  336. package/dist/tui-v2/rendering/picker-filter.js +68 -0
  337. package/dist/tui-v2/rendering/picker-filter.js.map +1 -0
  338. package/dist/tui-v2/rendering/plan-view.d.ts +32 -0
  339. package/dist/tui-v2/rendering/plan-view.js +196 -0
  340. package/dist/tui-v2/rendering/plan-view.js.map +1 -0
  341. package/dist/tui-v2/rendering/render-markdown-lines.d.ts +29 -0
  342. package/dist/tui-v2/rendering/render-markdown-lines.js +46 -0
  343. package/dist/tui-v2/rendering/render-markdown-lines.js.map +1 -0
  344. package/dist/tui-v2/rendering/sanitize-display.d.ts +13 -0
  345. package/dist/tui-v2/rendering/sanitize-display.js +24 -0
  346. package/dist/tui-v2/rendering/sanitize-display.js.map +1 -0
  347. package/dist/tui-v2/rendering/strip-tool-surfaces.d.ts +10 -0
  348. package/dist/tui-v2/rendering/strip-tool-surfaces.js +32 -0
  349. package/dist/tui-v2/rendering/strip-tool-surfaces.js.map +1 -0
  350. package/dist/tui-v2/rendering/theme.d.ts +67 -0
  351. package/dist/tui-v2/rendering/theme.js +74 -0
  352. package/dist/tui-v2/rendering/theme.js.map +1 -0
  353. package/dist/tui-v2/rendering/tool-presenter.d.ts +39 -0
  354. package/dist/tui-v2/rendering/tool-presenter.js +209 -0
  355. package/dist/tui-v2/rendering/tool-presenter.js.map +1 -0
  356. package/dist/tui-v2/rendering/transcript-export.d.ts +11 -0
  357. package/dist/tui-v2/rendering/transcript-export.js +18 -0
  358. package/dist/tui-v2/rendering/transcript-export.js.map +1 -0
  359. package/dist/tui-v2/rendering/transcript-semantic.d.ts +17 -0
  360. package/dist/tui-v2/rendering/transcript-semantic.js +67 -0
  361. package/dist/tui-v2/rendering/transcript-semantic.js.map +1 -0
  362. package/dist/tui-v2/state/pager-search.d.ts +22 -0
  363. package/dist/tui-v2/state/pager-search.js +78 -0
  364. package/dist/tui-v2/state/pager-search.js.map +1 -0
  365. package/dist/tui-v2/state/semantic-document.d.ts +34 -0
  366. package/dist/tui-v2/state/semantic-document.js +201 -0
  367. package/dist/tui-v2/state/semantic-document.js.map +1 -0
  368. package/dist/tui-v2/state/transcript-compaction.d.ts +24 -0
  369. package/dist/tui-v2/state/transcript-compaction.js +79 -0
  370. package/dist/tui-v2/state/transcript-compaction.js.map +1 -0
  371. package/dist/tui-v2/state/transcript-hydrate.d.ts +27 -0
  372. package/dist/tui-v2/state/transcript-hydrate.js +276 -0
  373. package/dist/tui-v2/state/transcript-hydrate.js.map +1 -0
  374. package/dist/tui-v2/state/transcript-reducer.d.ts +10 -0
  375. package/dist/tui-v2/state/transcript-reducer.js +339 -0
  376. package/dist/tui-v2/state/transcript-reducer.js.map +1 -0
  377. package/dist/tui-v2/state/transcript-search.d.ts +17 -0
  378. package/dist/tui-v2/state/transcript-search.js +38 -0
  379. package/dist/tui-v2/state/transcript-search.js.map +1 -0
  380. package/dist/tui-v2/state/transcript-store.d.ts +32 -0
  381. package/dist/tui-v2/state/transcript-store.js +66 -0
  382. package/dist/tui-v2/state/transcript-store.js.map +1 -0
  383. package/dist/tui-v2/state/transcript-struct.d.ts +15 -0
  384. package/dist/tui-v2/state/transcript-struct.js +133 -0
  385. package/dist/tui-v2/state/transcript-struct.js.map +1 -0
  386. package/dist/tui-v2/state/transcript-types.d.ts +76 -0
  387. package/dist/tui-v2/state/transcript-types.js +65 -0
  388. package/dist/tui-v2/state/transcript-types.js.map +1 -0
  389. package/dist/tui-v2/state/use-overlay.d.ts +3 -0
  390. package/dist/tui-v2/state/use-overlay.js +6 -0
  391. package/dist/tui-v2/state/use-overlay.js.map +1 -0
  392. package/dist/tui-v2/state/use-plan.d.ts +4 -0
  393. package/dist/tui-v2/state/use-plan.js +6 -0
  394. package/dist/tui-v2/state/use-plan.js.map +1 -0
  395. package/dist/tui-v2/state/use-session-state.d.ts +2 -0
  396. package/dist/tui-v2/state/use-session-state.js +7 -0
  397. package/dist/tui-v2/state/use-session-state.js.map +1 -0
  398. package/dist/tui-v2/state/use-toast.d.ts +3 -0
  399. package/dist/tui-v2/state/use-toast.js +15 -0
  400. package/dist/tui-v2/state/use-toast.js.map +1 -0
  401. package/dist/tui-v2/state/use-transcript-store.d.ts +10 -0
  402. package/dist/tui-v2/state/use-transcript-store.js +12 -0
  403. package/dist/tui-v2/state/use-transcript-store.js.map +1 -0
  404. package/dist/ui/intro-card.js +3 -3
  405. package/dist/ui/intro-card.js.map +1 -1
  406. package/dist/ui/intro-header.d.ts +23 -0
  407. package/dist/ui/intro-header.js +232 -0
  408. package/dist/ui/intro-header.js.map +1 -0
  409. package/dist/ui/markdown.js +0 -1
  410. package/dist/ui/markdown.js.map +1 -1
  411. package/dist/ui/mentions.d.ts +9 -2
  412. package/dist/ui/mentions.js +102 -4
  413. package/dist/ui/mentions.js.map +1 -1
  414. package/dist/ui/output-pane.js +1 -1
  415. package/dist/ui/output-pane.js.map +1 -1
  416. package/dist/ui/plan-pane.d.ts +8 -0
  417. package/dist/ui/plan-pane.js +38 -0
  418. package/dist/ui/plan-pane.js.map +1 -1
  419. package/dist/ui/wordmark.d.ts +5 -0
  420. package/dist/ui/wordmark.js +6 -1
  421. package/dist/ui/wordmark.js.map +1 -1
  422. package/package.json +25 -12
  423. package/dist/tui/App.d.ts +0 -12
  424. package/dist/tui/App.js +0 -2174
  425. package/dist/tui/App.js.map +0 -1
  426. package/dist/tui/components/ConfirmModal.d.ts +0 -9
  427. package/dist/tui/components/ConfirmModal.js +0 -55
  428. package/dist/tui/components/ConfirmModal.js.map +0 -1
  429. package/dist/tui/components/JobsPanel.d.ts +0 -11
  430. package/dist/tui/components/JobsPanel.js +0 -55
  431. package/dist/tui/components/JobsPanel.js.map +0 -1
  432. package/dist/tui/components/Pager.d.ts +0 -14
  433. package/dist/tui/components/Pager.js +0 -56
  434. package/dist/tui/components/Pager.js.map +0 -1
  435. package/dist/tui/components/PickerPanel.d.ts +0 -15
  436. package/dist/tui/components/PickerPanel.js +0 -126
  437. package/dist/tui/components/PickerPanel.js.map +0 -1
  438. package/dist/tui/components/PlanSidebar.d.ts +0 -6
  439. package/dist/tui/components/PlanSidebar.js +0 -99
  440. package/dist/tui/components/PlanSidebar.js.map +0 -1
  441. package/dist/tui/components/SecretInputPanel.d.ts +0 -7
  442. package/dist/tui/components/SecretInputPanel.js +0 -38
  443. package/dist/tui/components/SecretInputPanel.js.map +0 -1
  444. package/dist/tui/confirm.d.ts +0 -16
  445. package/dist/tui/confirm.js.map +0 -1
  446. package/dist/tui/default.d.ts +0 -6
  447. package/dist/tui/default.js +0 -11
  448. package/dist/tui/default.js.map +0 -1
  449. package/dist/tui/hooks/useAgentRunner.d.ts +0 -73
  450. package/dist/tui/hooks/useAgentRunner.js +0 -277
  451. package/dist/tui/hooks/useAgentRunner.js.map +0 -1
  452. package/dist/tui/hooks/useJobs.d.ts +0 -7
  453. package/dist/tui/hooks/useJobs.js +0 -39
  454. package/dist/tui/hooks/useJobs.js.map +0 -1
  455. package/dist/tui/hooks/useSpinner.d.ts +0 -5
  456. package/dist/tui/hooks/useSpinner.js +0 -21
  457. package/dist/tui/hooks/useSpinner.js.map +0 -1
  458. package/dist/tui/hooks/useTerminalSize.d.ts +0 -9
  459. package/dist/tui/hooks/useTerminalSize.js +0 -26
  460. package/dist/tui/hooks/useTerminalSize.js.map +0 -1
  461. package/dist/tui/index.d.ts +0 -10
  462. package/dist/tui/index.js +0 -37
  463. package/dist/tui/index.js.map +0 -1
  464. package/dist/tui/key-intent.d.ts +0 -36
  465. package/dist/tui/key-intent.js +0 -54
  466. package/dist/tui/key-intent.js.map +0 -1
  467. package/dist/tui/mouse.d.ts +0 -8
  468. package/dist/tui/mouse.js +0 -34
  469. package/dist/tui/mouse.js.map +0 -1
  470. package/dist/tui/plan-sidebar-lines.d.ts +0 -2
  471. package/dist/tui/plan-sidebar-lines.js +0 -140
  472. package/dist/tui/plan-sidebar-lines.js.map +0 -1
  473. package/dist/tui/render-lines.d.ts +0 -22
  474. package/dist/tui/render-lines.js +0 -611
  475. package/dist/tui/render-lines.js.map +0 -1
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Default keymap and conflict validation (V2-033).
3
+ *
4
+ * A chord is a normalized, case-insensitive string ("ctrl+c", "shift+enter",
5
+ * "up"). Bindings are data: help/status text and tests read them so no
6
+ * component hardcodes terminal bytes. `validateKeymap` guarantees a context
7
+ * never binds one chord to two different actions, which is asserted in tests so
8
+ * new bindings cannot silently shadow existing ones.
9
+ */
10
+ const MODIFIER_ORDER = ["ctrl", "alt", "shift", "meta"];
11
+ /** Normalize a chord to `ctrl+alt+shift+meta+key` with a lowercase key. */
12
+ export function normalizeChord(chord) {
13
+ const parts = chord
14
+ .split("+")
15
+ .map((p) => p.trim().toLowerCase())
16
+ .filter(Boolean);
17
+ const mods = new Set(parts.filter((p) => MODIFIER_ORDER.includes(p)));
18
+ const keys = parts.filter((p) => !MODIFIER_ORDER.includes(p));
19
+ const key = keys[keys.length - 1] ?? "";
20
+ const ordered = MODIFIER_ORDER.filter((m) => mods.has(m));
21
+ return [...ordered, key].filter(Boolean).join("+");
22
+ }
23
+ function binding(chord, action, context) {
24
+ return { chord: normalizeChord(chord), action, context };
25
+ }
26
+ export const defaultKeymap = [
27
+ // global
28
+ // Ctrl+C: abort-then-quit (double press). Esc: abort/dismiss only — never quit.
29
+ binding("ctrl+c", "app.interrupt", "global"),
30
+ binding("escape", "app.cancel", "global"),
31
+ binding("ctrl+d", "app.quit", "global"),
32
+ binding("ctrl+g", "app.help", "global"),
33
+ binding("ctrl+h", "app.toggle-plan", "global"),
34
+ binding("ctrl+p", "plan.toggle-detail", "global"),
35
+ binding("ctrl+j", "app.jobs", "global"),
36
+ binding("ctrl+t", "transcript.toggle-thinking", "global"),
37
+ binding("ctrl+o", "transcript.toggle-output", "global"),
38
+ binding("tab", "focus.next-region", "global"),
39
+ // composer
40
+ binding("enter", "editor.submit", "composer"),
41
+ binding("shift+enter", "editor.newline", "composer"),
42
+ binding("alt+enter", "editor.newline", "composer"),
43
+ binding("up", "editor.history-prev", "composer"),
44
+ binding("down", "editor.history-next", "composer"),
45
+ binding("ctrl+u", "editor.clear", "composer"),
46
+ // transcript
47
+ binding("up", "transcript.scroll-up", "transcript"),
48
+ binding("down", "transcript.scroll-down", "transcript"),
49
+ binding("pageup", "transcript.page-up", "transcript"),
50
+ binding("pagedown", "transcript.page-down", "transcript"),
51
+ binding("g", "transcript.top", "transcript"),
52
+ binding("shift+g", "transcript.bottom", "transcript"),
53
+ binding("ctrl+r", "transcript.search", "transcript"),
54
+ binding("enter", "transcript.expand-toggle", "transcript"),
55
+ // Terminals that reserve Ctrl+C for copy use Ctrl+Shift+C for selection copy.
56
+ binding("ctrl+shift+c", "selection.copy", "transcript"),
57
+ binding("escape", "selection.clear", "transcript"),
58
+ binding("ctrl+a", "selection.select-all", "transcript"),
59
+ binding("shift+left", "selection.extend-left", "transcript"),
60
+ binding("shift+right", "selection.extend-right", "transcript"),
61
+ binding("shift+up", "selection.extend-up", "transcript"),
62
+ binding("shift+down", "selection.extend-down", "transcript"),
63
+ binding("ctrl+shift+left", "selection.extend-word-left", "transcript"),
64
+ binding("ctrl+shift+right", "selection.extend-word-right", "transcript"),
65
+ binding("shift+home", "selection.extend-line-start", "transcript"),
66
+ binding("shift+end", "selection.extend-line-end", "transcript"),
67
+ // picker
68
+ binding("up", "picker.up", "picker"),
69
+ binding("down", "picker.down", "picker"),
70
+ binding("enter", "picker.accept", "picker"),
71
+ binding("escape", "picker.dismiss", "picker"),
72
+ // modal
73
+ binding("y", "modal.confirm", "modal"),
74
+ binding("n", "modal.deny", "modal"),
75
+ binding("escape", "modal.dismiss", "modal"),
76
+ // plan
77
+ binding("down", "plan.next-task", "plan"),
78
+ binding("up", "plan.prev-task", "plan"),
79
+ binding("enter", "plan.toggle-detail", "plan"),
80
+ // transcript search
81
+ binding("escape", "picker.dismiss", "transcript-search"),
82
+ binding("enter", "picker.accept", "transcript-search"),
83
+ // pager
84
+ binding("up", "pager.line-up", "pager"),
85
+ binding("k", "pager.line-up", "pager"),
86
+ binding("down", "pager.line-down", "pager"),
87
+ binding("j", "pager.line-down", "pager"),
88
+ binding("pageup", "pager.page-up", "pager"),
89
+ binding("pagedown", "pager.page-down", "pager"),
90
+ binding("ctrl+u", "pager.half-page-up", "pager"),
91
+ binding("ctrl+d", "pager.half-page-down", "pager"),
92
+ binding("g", "pager.top", "pager"),
93
+ binding("shift+g", "pager.bottom", "pager"),
94
+ binding("ctrl+r", "pager.search", "pager"),
95
+ binding("n", "pager.next-match", "pager"),
96
+ binding("shift+n", "pager.prev-match", "pager"),
97
+ // Many terminals drop Shift on Ctrl chords, so bind both forms. Bare `s`
98
+ // is also available (pager traps input; no conflict with transcript search).
99
+ binding("ctrl+shift+s", "pager.export-scrollback", "pager"),
100
+ binding("ctrl+s", "pager.export-scrollback", "pager"),
101
+ binding("s", "pager.export-scrollback", "pager"),
102
+ binding("ctrl+shift+e", "pager.export-editor", "pager"),
103
+ binding("ctrl+e", "pager.export-editor", "pager"),
104
+ binding("e", "pager.export-editor", "pager"),
105
+ binding("c", "pager.copy", "pager"),
106
+ binding("q", "pager.close", "pager"),
107
+ binding("escape", "pager.close", "pager"),
108
+ // jobs
109
+ binding("up", "jobs.up", "jobs"),
110
+ binding("down", "jobs.down", "jobs"),
111
+ binding("enter", "jobs.tail", "jobs"),
112
+ binding("t", "jobs.tail", "jobs"),
113
+ binding("k", "jobs.stop", "jobs"),
114
+ binding("q", "jobs.close", "jobs"),
115
+ binding("escape", "jobs.close", "jobs"),
116
+ ];
117
+ export function validateKeymap(bindings) {
118
+ const byKey = new Map();
119
+ for (const b of bindings) {
120
+ const key = `${b.context}::${b.chord}`;
121
+ const set = byKey.get(key) ?? new Set();
122
+ set.add(b.action);
123
+ byKey.set(key, set);
124
+ }
125
+ const conflicts = [];
126
+ for (const [key, actions] of byKey) {
127
+ if (actions.size > 1) {
128
+ const [context, chord] = key.split("::");
129
+ conflicts.push({ context, chord, actions: [...actions] });
130
+ }
131
+ }
132
+ return conflicts;
133
+ }
134
+ //# sourceMappingURL=keymap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keymap.js","sourceRoot":"","sources":["../../../src/tui-v2/actions/keymap.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAEjE,2EAA2E;AAC3E,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,MAAM,KAAK,GAAG,KAAK;SAChB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;SAClC,MAAM,CAAC,OAAO,CAAC,CAAC;IACnB,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAE,cAAoC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7F,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAE,cAAoC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACrF,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACxC,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,OAAO,CAAC,GAAG,OAAO,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,OAAO,CACd,KAAa,EACb,MAAgB,EAChB,OAAsB;IAEtB,OAAO,EAAE,KAAK,EAAE,cAAc,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,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAClB,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACtB,CAAC;IACD,MAAM,SAAS,GAAqB,EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,KAAK,EAAE,CAAC;QACnC,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YACrB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAA4B,CAAC;YACpE,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,13 @@
1
+ /** @jsxImportSource @opentui/react */
2
+ /**
3
+ * Responsive v2 shell (V2-032, Phase 7 plan/overlay host).
4
+ *
5
+ * Legacy-style layout: scrollable transcript (intro card + messages), optional
6
+ * plan, completion menu + composer at the bottom, OverlayHost for pickers.
7
+ *
8
+ * Confirm/secret dock above the composer (in-flow). Pickers, pager, and jobs
9
+ * live in a full-bleed absolute host so they never reflow the intro card.
10
+ * Plan split/overlay reserves chat width so the agent card stays intact.
11
+ */
12
+ import { type ReactNode } from "react";
13
+ export declare function App(): ReactNode;
@@ -0,0 +1,332 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
+ /** @jsxImportSource @opentui/react */
3
+ /**
4
+ * Responsive v2 shell (V2-032, Phase 7 plan/overlay host).
5
+ *
6
+ * Legacy-style layout: scrollable transcript (intro card + messages), optional
7
+ * plan, completion menu + composer at the bottom, OverlayHost for pickers.
8
+ *
9
+ * Confirm/secret dock above the composer (in-flow). Pickers, pager, and jobs
10
+ * live in a full-bleed absolute host so they never reflow the intro card.
11
+ * Plan split/overlay reserves chat width so the agent card stays intact.
12
+ */
13
+ import { useEffect, useRef, useState } from "react";
14
+ import { useKeyboard, useTerminalDimensions } from "@opentui/react";
15
+ import { COMPOSER_MAX_HEIGHT, MIN_CHAT_ROWS, computeLayout, } from "../layout/compute-layout.js";
16
+ import { ComposerEditor } from "../composer/composer-editor.js";
17
+ import { maxComposerTextRows } from "../composer/composer-height.js";
18
+ import { TranscriptView } from "../components/transcript/transcript-view.js";
19
+ import { PlanView } from "../components/plan/plan-view.js";
20
+ import { OverlayHost } from "../components/overlay/overlay-host.js";
21
+ import { QueuePanel } from "../components/queue/queue-panel.js";
22
+ import { chordFromKeyEvent } from "../actions/chord-from-key.js";
23
+ import { usePlan } from "../state/use-plan.js";
24
+ import { useOverlayState } from "../state/use-overlay.js";
25
+ import { useTranscriptState } from "../state/use-transcript-store.js";
26
+ import { useSessionState } from "../state/use-session-state.js";
27
+ import { useServices, useTheme } from "./providers.js";
28
+ import { promptPlanApprovalIfNeeded } from "./plan-lifecycle.js";
29
+ import { StatusLine } from "../components/status/status-line.js";
30
+ import { ToastHost } from "../components/toast/toast-host.js";
31
+ import { transcriptScrollPort } from "../components/transcript/transcript-scroll-port.js";
32
+ const CTRL_C_QUIT_WINDOW_MS = 1500;
33
+ /** Floating plan panel width — kept in sync with the overlay box style. */
34
+ function planOverlayWidth(termWidth) {
35
+ return Math.min(52, Math.max(34, Math.floor(termWidth * 0.4)));
36
+ }
37
+ export function App() {
38
+ const { width, height } = useTerminalDimensions();
39
+ const services = useServices();
40
+ const theme = useTheme();
41
+ const [focusContext, setFocusContext] = useState(services.focus.activeContext());
42
+ const [planVisible, setPlanVisible] = useState(false);
43
+ const plan = usePlan(services.plan);
44
+ const overlay = useOverlayState(services.overlay);
45
+ const transcript = useTranscriptState(services.transcript);
46
+ const lastCtrlC = useRef(0);
47
+ const seenPlanKey = useRef(undefined);
48
+ /** Seed the composer when the user clicks Edit on a queued prompt. */
49
+ const [composerSeed, setComposerSeed] = useState(undefined);
50
+ useEffect(() => services.focus.onChange(setFocusContext), [services.focus]);
51
+ useEffect(() => {
52
+ return services.session.onTurnEnd((result) => {
53
+ if (result.status === "completed")
54
+ void promptPlanApprovalIfNeeded(services);
55
+ // Drain "send now" priority + remaining queue after every settled turn
56
+ // (including abort). Without this, queued prompts never auto-ran in v2.
57
+ void services.session.continueQueue();
58
+ });
59
+ }, [services]);
60
+ useEffect(() => {
61
+ if (!plan) {
62
+ seenPlanKey.current = undefined;
63
+ return;
64
+ }
65
+ const key = `${plan.sessionId}:${plan.updatedAt}`;
66
+ if (seenPlanKey.current === key)
67
+ return;
68
+ seenPlanKey.current = key;
69
+ setPlanVisible(true);
70
+ }, [plan]);
71
+ const layout = computeLayout({
72
+ columns: width,
73
+ rows: height,
74
+ planVisible,
75
+ splitEnabled: layoutSupportsSplit(width),
76
+ });
77
+ // Budget for multi-line input growth (Shift+Enter / wrap). Layout still
78
+ // prefers a single idle row; the editor expands within this cap.
79
+ const composerMaxTextRows = maxComposerTextRows({
80
+ terminalRows: height,
81
+ statusHeight: layout.status.height,
82
+ minChatRows: MIN_CHAT_ROWS,
83
+ maxCap: COMPOSER_MAX_HEIGHT,
84
+ });
85
+ const session = useSessionState(services.session);
86
+ const horizontalPadding = width >= 56 ? 2 : width >= 28 ? 1 : 0;
87
+ const completionRows = Math.max(6, Math.min(12, Math.floor(height / 3)));
88
+ // Chat pane column budget (inside padded shell). Plan split and floating
89
+ // overlay both shrink this so the intro card + messages reflow cleanly
90
+ // instead of overflowing mid-border under Ctrl+H.
91
+ const contentInnerWidth = Math.max(10, width - horizontalPadding * 2);
92
+ // Breathing room between chat text and the plan/task pane border.
93
+ const planChatGap = planVisible && layout.plan.placement === "split"
94
+ ? 2
95
+ : planVisible && layout.plan.placement === "overlay"
96
+ ? 2
97
+ : 0;
98
+ const splitPlanW = planVisible && layout.plan.placement === "split"
99
+ ? layout.plan.width
100
+ : 0;
101
+ const overlayPlanW = planVisible && layout.plan.placement === "overlay"
102
+ ? planOverlayWidth(width) + planChatGap
103
+ : 0;
104
+ const chatContentWidth = Math.max(24, contentInnerWidth - splitPlanW - overlayPlanW);
105
+ useKeyboard((key) => {
106
+ if (key.eventType === "release" || overlay.kind !== "none")
107
+ return;
108
+ const chord = chordFromKeyEvent(key);
109
+ // Tab belongs to the completion menu while the composer is active. The
110
+ // previous global focus binding consumed it first, which made `/mod` + Tab
111
+ // appear to freeze the input instead of completing `/model`.
112
+ if (focusContext === "composer" && chord === "tab")
113
+ return;
114
+ const action = services.router.resolve(chord, focusContext);
115
+ if (!action)
116
+ return;
117
+ switch (action) {
118
+ case "app.cancel":
119
+ // Esc: abort a live turn only. Never exit — multi-Esc used to quit
120
+ // because it shared the double-press path with Ctrl+C.
121
+ key.preventDefault();
122
+ if (services.session.getState().running) {
123
+ services.session.abort();
124
+ }
125
+ break;
126
+ case "app.interrupt": {
127
+ // Ctrl+C: first press aborts if running (and arms quit); second press
128
+ // within the window exits. Idle: first arms, second exits.
129
+ key.preventDefault();
130
+ const now = Date.now();
131
+ if (services.session.getState().running) {
132
+ services.session.abort();
133
+ lastCtrlC.current = now;
134
+ services.session.notice("info", "turn aborted · Ctrl+C again to exit");
135
+ break;
136
+ }
137
+ if (lastCtrlC.current > 0 &&
138
+ now - lastCtrlC.current < CTRL_C_QUIT_WINDOW_MS) {
139
+ services.requestExit();
140
+ }
141
+ else {
142
+ lastCtrlC.current = now;
143
+ services.session.notice("info", "Ctrl+C again to exit");
144
+ }
145
+ break;
146
+ }
147
+ case "app.quit":
148
+ key.preventDefault();
149
+ services.requestExit();
150
+ break;
151
+ case "app.toggle-plan":
152
+ key.preventDefault();
153
+ // If the panel is about to open and we have no in-memory plan, try
154
+ // loading the plan for this session from disk (history resume, or
155
+ // plan created before a restart).
156
+ setPlanVisible((v) => {
157
+ const next = !v;
158
+ if (next && !services.plan.current()) {
159
+ void services.plan
160
+ .load(services.session.sessionId)
161
+ .then((loaded) => {
162
+ if (!loaded) {
163
+ services.session.notice("info", "no plan for this session yet");
164
+ }
165
+ })
166
+ .catch(() => undefined);
167
+ }
168
+ return next;
169
+ });
170
+ break;
171
+ case "app.jobs":
172
+ key.preventDefault();
173
+ services.overlay.openJobs();
174
+ break;
175
+ case "app.help":
176
+ key.preventDefault();
177
+ services.overlay.openPager("Commands", formatHelp(services.commands.help()));
178
+ break;
179
+ case "plan.toggle-detail":
180
+ key.preventDefault();
181
+ // Ctrl+P: full plan detail pager. Reload from disk if memory is empty
182
+ // (e.g. after /history resume before the plan controller was refreshed).
183
+ void (async () => {
184
+ let live = services.plan.current() ?? plan;
185
+ if (!live) {
186
+ live = await services.plan
187
+ .load(services.session.sessionId)
188
+ .catch(() => undefined);
189
+ }
190
+ if (live) {
191
+ const { formatPlanPagerDocument } = await import("../rendering/plan-view.js");
192
+ services.overlay.openPager(`Plan · ${live.goal}`, formatPlanPagerDocument(live));
193
+ }
194
+ else {
195
+ services.session.notice("info", "no active plan yet — Ctrl+P views plan detail");
196
+ }
197
+ })();
198
+ break;
199
+ case "transcript.toggle-thinking":
200
+ key.preventDefault();
201
+ services.transcript.toggleThinkingGlobal();
202
+ break;
203
+ case "transcript.toggle-output":
204
+ key.preventDefault();
205
+ services.transcript.toggleOutputGlobal();
206
+ break;
207
+ case "focus.next-region":
208
+ key.preventDefault();
209
+ services.focus.cycleRegion(planVisible && layout.plan.placement !== "hidden"
210
+ ? ["composer", "transcript", "plan"]
211
+ : ["composer", "transcript"]);
212
+ break;
213
+ default:
214
+ break;
215
+ }
216
+ });
217
+ const planPaneWidth = layout.plan.placement === "split"
218
+ ? layout.plan.width
219
+ : planOverlayWidth(width);
220
+ const planPanel = planVisible && layout.plan.placement !== "hidden" ? (_jsx(PlanView, { theme: theme, plan: plan, services: services, width: planPaneWidth })) : null;
221
+ // Composer only owns the keyboard when the focus region is composer.
222
+ // Clicking the transcript leaves focus there so ↑/↓ scroll the chat instead
223
+ // of walking prompt history in the textarea.
224
+ const composerFocused = overlay.kind === "none" && focusContext === "composer";
225
+ /**
226
+ * Wheel/trackpad outside focused regions that own their own scroll (plan
227
+ * pane, overlays) scrolls the chat. Plan wheel handlers stopPropagation so
228
+ * this does not also move the transcript when scrolling tasks.
229
+ */
230
+ function onAppWheel(event) {
231
+ if (!event.scroll || overlay.kind !== "none")
232
+ return;
233
+ // Plan pane owns its ScrollBox — never steal its wheel into chat.
234
+ if (focusContext === "plan")
235
+ return;
236
+ event.preventDefault();
237
+ event.stopPropagation();
238
+ services.focus.focusRegion("transcript");
239
+ const { direction, delta } = event.scroll;
240
+ const step = Math.max(1, delta || 1) * 3;
241
+ const dy = direction === "up" ? -step : direction === "down" ? step : 0;
242
+ if (dy !== 0)
243
+ transcriptScrollPort.scrollBy(dy);
244
+ }
245
+ /** Plan pane wheel: claim focus + stop bubble so chat does not scroll too. */
246
+ function onPlanWheel(event) {
247
+ if (!event.scroll)
248
+ return;
249
+ event.stopPropagation();
250
+ services.focus.focusRegion("plan");
251
+ // Native ScrollBox under PlanView handles the actual list motion.
252
+ }
253
+ /** Keep chat edge-scrolling while drag-selecting even over composer/status. */
254
+ function onAppMouseDrag(event) {
255
+ if (!event.isDragging || overlay.kind !== "none")
256
+ return;
257
+ transcriptScrollPort.updateAutoScroll(event.x, event.y);
258
+ }
259
+ function onAppMouseUp() {
260
+ transcriptScrollPort.stopAutoScroll();
261
+ }
262
+ return (_jsxs("box", { style: {
263
+ width,
264
+ height,
265
+ flexDirection: "column",
266
+ backgroundColor: theme.background,
267
+ position: "relative",
268
+ }, onMouseScroll: onAppWheel, onMouseDrag: onAppMouseDrag, onMouseUp: onAppMouseUp, onMouseDragEnd: onAppMouseUp, children: [_jsxs("box", { style: {
269
+ flexGrow: 1,
270
+ flexDirection: "column",
271
+ width: "100%",
272
+ height: "100%",
273
+ paddingLeft: horizontalPadding,
274
+ paddingRight: horizontalPadding,
275
+ }, children: [_jsxs("box", { style: { flexGrow: 1, flexDirection: "row", width: "100%" }, children: [_jsx("box", { style: {
276
+ // Explicit width so OpenTUI does not let the plan panel steal
277
+ // columns from under a flex-grown intro card mid-frame.
278
+ width: chatContentWidth,
279
+ flexGrow: layout.plan.placement === "split" || overlayPlanW > 0 ? 0 : 1,
280
+ flexShrink: 1,
281
+ backgroundColor: theme.background,
282
+ // Keep transcript text off the plan border when the task pane is open.
283
+ paddingRight: planChatGap > 0 ? planChatGap : 0,
284
+ }, children: _jsx(TranscriptView, { services: services, theme: theme, focused: focusContext === "transcript" && overlay.kind === "none", contentWidth: Math.max(20, chatContentWidth - planChatGap) }) }), layout.plan.placement === "split" ? (_jsx("box", { title: " Plan ", border: true, borderStyle: "rounded", style: {
285
+ width: layout.plan.width,
286
+ height: "100%",
287
+ flexShrink: 0,
288
+ // CLAI wordmark top-of-"I" magenta (same as agent card frame).
289
+ borderColor: theme.magenta,
290
+ backgroundColor: theme.statusBackground,
291
+ }, onMouseDown: () => services.focus.focusRegion("plan"), onMouseScroll: onPlanWheel, children: planPanel })) : null] }), _jsx(QueuePanel, { services: services, theme: theme, width: contentInnerWidth, onEdit: (text) => {
292
+ setComposerSeed({ token: Date.now(), text });
293
+ services.focus.focusRegion("composer");
294
+ } }), _jsx(OverlayHost, { services: services, theme: theme, width: contentInnerWidth, height: height, docked: true }), _jsx(ComposerEditor, { services: services, theme: theme, width: contentInnerWidth, height: composerMaxTextRows, focused: composerFocused, maxSuggestions: completionRows, running: session.running, seedDraft: composerSeed }), layout.status.height > 0 ? (_jsx(StatusLine, { session: services.session, theme: theme, activity: transcript.runningStatus, width: contentInnerWidth, planVisible: planVisible, thinkingExpanded: transcript.expandThinkingGlobal, outputExpanded: transcript.expandOutputGlobal, onToggleThinking: () => services.transcript.toggleThinkingGlobal(), onToggleOutput: () => services.transcript.toggleOutputGlobal(), onTogglePlan: () => {
295
+ // Same path as Ctrl+H — open loads plan from disk when empty.
296
+ setPlanVisible((v) => {
297
+ const next = !v;
298
+ if (next && !services.plan.current()) {
299
+ void services.plan
300
+ .load(services.session.sessionId)
301
+ .then((loaded) => {
302
+ if (!loaded) {
303
+ services.session.notice("info", "no plan for this session yet");
304
+ }
305
+ })
306
+ .catch(() => undefined);
307
+ }
308
+ return next;
309
+ });
310
+ } })) : null] }), layout.plan.placement === "overlay" && planVisible ? (_jsx("box", { title: " Plan ", border: true, borderStyle: "rounded", style: {
311
+ position: "absolute",
312
+ top: Math.max(1, Math.floor(height * 0.08)),
313
+ // Sit flush with the right edge of the padded content column
314
+ // so the plan pane aligns with where the input box ends.
315
+ right: horizontalPadding,
316
+ width: planOverlayWidth(width),
317
+ height: Math.max(12, Math.floor(height * 0.72)),
318
+ // CLAI wordmark top-of-"I" magenta (same as agent card frame).
319
+ borderColor: theme.magenta,
320
+ backgroundColor: theme.statusBackground,
321
+ zIndex: 50,
322
+ }, onMouseDown: () => services.focus.focusRegion("plan"), onMouseScroll: onPlanWheel, children: planPanel })) : null, _jsx(OverlayHost, { services: services, theme: theme, width: width, height: height }), _jsx(ToastHost, { toast: services.toast, theme: theme, termWidth: width, termHeight: height })] }));
323
+ }
324
+ function layoutSupportsSplit(columns) {
325
+ return columns >= 120;
326
+ }
327
+ function formatHelp(entries) {
328
+ return entries
329
+ .map((e) => `${e.command}${e.usage ? ` ${e.usage}` : ""} — ${e.description}${e.aliases.length ? ` (aliases: ${e.aliases.join(", ")})` : ""}`)
330
+ .join("\n");
331
+ }
332
+ //# sourceMappingURL=App.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App.js","sourceRoot":"","sources":["../../../src/tui-v2/app/App.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,GACd,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE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AAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,WAAW,GAC9D,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAC7D,EAAE,CACL;SACA,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Attaches UI-coupled handlers to the shared command registry (V2-072, V2-080).
3
+ *
4
+ * Registry metadata lives in Phase 2; each frontend attaches handler bodies.
5
+ * Implementations are split by surface under `./commands/*`.
6
+ */
7
+ import type { AppServices } from "../bootstrap/composition-root.js";
8
+ export declare function attachCommandHandlers(services: AppServices): void;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Attaches UI-coupled handlers to the shared command registry (V2-072, V2-080).
3
+ *
4
+ * Registry metadata lives in Phase 2; each frontend attaches handler bodies.
5
+ * Implementations are split by surface under `./commands/*`.
6
+ */
7
+ import { discardPlan, implementPlan } from "./plan-lifecycle.js";
8
+ import { handleAllow, handleClean, handleClear, handleCompact, handleContext, handleCwd, handleDisallow, handleMode, handleNew, handleReset, handleSave, handleThink, } from "./commands/session-commands.js";
9
+ import { handleExit, handleFallback, handleFreeOnly, handleHelp, handleJobs, handleMouse, handlePrivacy, handleScope, handleUpdate, } from "./commands/config-commands.js";
10
+ import { handleInfo, handleKeys, handleSet, handleUnset } from "./commands/key-commands.js";
11
+ import { handleHistory, handleModel, handleOutput, handlePermissions, handlePlanPager, handleProvider, handleReasoning, handleSearch, } from "./commands/picker-commands.js";
12
+ export function attachCommandHandlers(services) {
13
+ const c = services.commands;
14
+ c.setHandler("ask", () => handleMode(services, "ask"));
15
+ c.setHandler("agent", () => handleMode(services, "agent"));
16
+ c.setHandler("model", (i) => handleModel(services, i));
17
+ c.setHandler("provider", (i) => handleProvider(services, i));
18
+ c.setHandler("search", (i) => handleSearch(services, i));
19
+ c.setHandler("variants", (i) => handleReasoning(services, i));
20
+ c.setHandler("history", () => void handleHistory(services));
21
+ c.setHandler("permissions", (i) => handlePermissions(services, i));
22
+ c.setHandler("output", (i) => handleOutput(services, i));
23
+ c.setHandler("plan", () => handlePlanPager(services));
24
+ c.setHandler("implement", () => {
25
+ if (services.session.getState().running) {
26
+ services.session.notice("warn", "a turn is already running");
27
+ return;
28
+ }
29
+ void implementPlan(services);
30
+ });
31
+ c.setHandler("discard", () => void (async () => {
32
+ const before = services.plan.current();
33
+ if (!before) {
34
+ services.session.notice("info", "no active plan to discard");
35
+ return;
36
+ }
37
+ await discardPlan(services);
38
+ services.session.notice("info", `plan discarded · ${before.goal}`);
39
+ })());
40
+ c.setHandler("clear", () => handleClear(services));
41
+ c.setHandler("new", () => void handleNew(services));
42
+ c.setHandler("clean", () => handleClean(services));
43
+ c.setHandler("think", () => handleThink(services));
44
+ c.setHandler("context", () => handleContext(services));
45
+ c.setHandler("compact", () => void handleCompact(services));
46
+ c.setHandler("save", (i) => void handleSave(services, i));
47
+ c.setHandler("reset", () => void handleReset(services));
48
+ c.setHandler("allow", (i) => handleAllow(services, i));
49
+ c.setHandler("disallow", (i) => handleDisallow(services, i));
50
+ c.setHandler("cwd", (i) => handleCwd(services, i));
51
+ c.setHandler("freeonly", (i) => handleFreeOnly(services, i));
52
+ c.setHandler("fallback", (i) => handleFallback(services, i));
53
+ c.setHandler("mouse", (i) => handleMouse(services, i));
54
+ c.setHandler("scope", (i) => void handleScope(services, i));
55
+ c.setHandler("privacy", (i) => void handlePrivacy(services, i));
56
+ c.setHandler("update", () => void handleUpdate(services));
57
+ c.setHandler("help", () => handleHelp(services));
58
+ c.setHandler("exit", () => handleExit(services));
59
+ c.setHandler("set", (i) => void handleSet(services, i));
60
+ c.setHandler("unset", (i) => void handleUnset(services, i));
61
+ c.setHandler("keys", () => void handleKeys(services));
62
+ c.setHandler("info", (i) => void handleInfo(services, i));
63
+ if (c.has("jobs"))
64
+ c.setHandler("jobs", () => handleJobs(services));
65
+ }
66
+ //# sourceMappingURL=command-handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-handlers.js","sourceRoot":"","sources":["../../../src/tui-v2/app/command-handlers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,SAAS,EACT,cAAc,EACd,UAAU,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,WAAW,GACZ,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,UAAU,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACX,YAAY,GACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EACL,aAAa,EACb,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,eAAe,EACf,YAAY,GACb,MAAM,+BAA+B,CAAC;AAEvC,MAAM,UAAU,qBAAqB,CAAC,QAAqB;IACzD,MAAM,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC;IAC5B,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;IACvD,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3D,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;I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CAAC;IACjD,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1D,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;QAAE,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtE,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Config/toggles/scope/privacy/help/exit/update/mouse (V2-080).
3
+ */
4
+ import type { CommandInvocation } from "../../../app/commands/command.js";
5
+ import type { AppServices } from "../../bootstrap/composition-root.js";
6
+ export declare function handleFreeOnly(services: AppServices, invocation: CommandInvocation): void;
7
+ export declare function handleFallback(services: AppServices, invocation: CommandInvocation): void;
8
+ export declare function handleMouse(services: AppServices, invocation: CommandInvocation): void;
9
+ export declare function handleScope(services: AppServices, invocation: CommandInvocation): Promise<void>;
10
+ export declare function handlePrivacy(services: AppServices, invocation: CommandInvocation): Promise<void>;
11
+ export declare function handleUpdate(services: AppServices): Promise<void>;
12
+ export declare function handleHelp(services: AppServices): void;
13
+ export declare function handleExit(services: AppServices): void;
14
+ export declare function handleJobs(services: AppServices): void;