dexto 1.3.0 → 1.4.0

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 (400) hide show
  1. package/README.md +25 -15
  2. package/dist/agents/agent-registry.json +9 -0
  3. package/dist/agents/coding-agent/coding-agent.yml +5 -0
  4. package/dist/agents/default-agent.yml +2 -2
  5. package/dist/api/server-hono.d.ts.map +1 -1
  6. package/dist/api/server-hono.js +39 -5
  7. package/dist/cli/cli-subscriber.d.ts.map +1 -1
  8. package/dist/cli/cli-subscriber.js +7 -1
  9. package/dist/cli/commands/helpers/formatters.d.ts.map +1 -1
  10. package/dist/cli/commands/helpers/formatters.js +2 -1
  11. package/dist/cli/commands/install.d.ts.map +1 -1
  12. package/dist/cli/commands/install.js +14 -40
  13. package/dist/cli/commands/interactive-commands/command-parser.d.ts +17 -14
  14. package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +1 -1
  15. package/dist/cli/commands/interactive-commands/command-parser.js +0 -15
  16. package/dist/cli/commands/interactive-commands/commands.d.ts +4 -4
  17. package/dist/cli/commands/interactive-commands/commands.d.ts.map +1 -1
  18. package/dist/cli/commands/interactive-commands/commands.js +34 -42
  19. package/dist/cli/commands/interactive-commands/documentation-commands.d.ts.map +1 -1
  20. package/dist/cli/commands/interactive-commands/documentation-commands.js +4 -7
  21. package/dist/cli/commands/interactive-commands/general-commands.d.ts.map +1 -1
  22. package/dist/cli/commands/interactive-commands/general-commands.js +159 -117
  23. package/dist/cli/commands/interactive-commands/mcp/index.d.ts +9 -3
  24. package/dist/cli/commands/interactive-commands/mcp/index.d.ts.map +1 -1
  25. package/dist/cli/commands/interactive-commands/mcp/index.js +18 -3
  26. package/dist/cli/commands/interactive-commands/model/index.d.ts +8 -6
  27. package/dist/cli/commands/interactive-commands/model/index.d.ts.map +1 -1
  28. package/dist/cli/commands/interactive-commands/model/index.js +18 -6
  29. package/dist/cli/commands/interactive-commands/prompt-commands.d.ts +3 -2
  30. package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +1 -1
  31. package/dist/cli/commands/interactive-commands/prompt-commands.js +69 -52
  32. package/dist/cli/commands/interactive-commands/session/index.d.ts +7 -12
  33. package/dist/cli/commands/interactive-commands/session/index.d.ts.map +1 -1
  34. package/dist/cli/commands/interactive-commands/session/index.js +7 -14
  35. package/dist/cli/commands/interactive-commands/session/session-commands.d.ts +10 -24
  36. package/dist/cli/commands/interactive-commands/session/session-commands.d.ts.map +1 -1
  37. package/dist/cli/commands/interactive-commands/session/session-commands.js +16 -371
  38. package/dist/cli/commands/interactive-commands/system/system-commands.d.ts +1 -0
  39. package/dist/cli/commands/interactive-commands/system/system-commands.d.ts.map +1 -1
  40. package/dist/cli/commands/interactive-commands/system/system-commands.js +103 -74
  41. package/dist/cli/commands/interactive-commands/tool-commands.d.ts +1 -1
  42. package/dist/cli/commands/interactive-commands/tool-commands.d.ts.map +1 -1
  43. package/dist/cli/commands/interactive-commands/tool-commands.js +5 -62
  44. package/dist/cli/commands/interactive-commands/utils/command-output.d.ts +13 -17
  45. package/dist/cli/commands/interactive-commands/utils/command-output.d.ts.map +1 -1
  46. package/dist/cli/commands/interactive-commands/utils/command-output.js +18 -37
  47. package/dist/cli/commands/list-agents.d.ts +2 -2
  48. package/dist/cli/commands/list-agents.d.ts.map +1 -1
  49. package/dist/cli/commands/list-agents.js +36 -32
  50. package/dist/cli/commands/uninstall.d.ts.map +1 -1
  51. package/dist/cli/commands/uninstall.js +4 -6
  52. package/dist/cli/commands/which.d.ts.map +1 -1
  53. package/dist/cli/commands/which.js +17 -3
  54. package/dist/cli/ink-cli/InkCLIRefactored.d.ts +9 -22
  55. package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +1 -1
  56. package/dist/cli/ink-cli/InkCLIRefactored.js +50 -133
  57. package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +24 -3
  58. package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
  59. package/dist/cli/ink-cli/components/ApprovalPrompt.js +160 -45
  60. package/dist/cli/ink-cli/components/ElicitationForm.d.ts +22 -0
  61. package/dist/cli/ink-cli/components/ElicitationForm.d.ts.map +1 -0
  62. package/dist/cli/ink-cli/components/ElicitationForm.js +358 -0
  63. package/dist/cli/ink-cli/components/Footer.d.ts +16 -0
  64. package/dist/cli/ink-cli/components/Footer.d.ts.map +1 -0
  65. package/dist/cli/ink-cli/components/Footer.js +27 -0
  66. package/dist/cli/ink-cli/components/HistorySearchBar.d.ts +17 -0
  67. package/dist/cli/ink-cli/components/HistorySearchBar.d.ts.map +1 -0
  68. package/dist/cli/ink-cli/components/HistorySearchBar.js +8 -0
  69. package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts +15 -2
  70. package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts.map +1 -1
  71. package/dist/cli/ink-cli/components/ResourceAutocomplete.js +126 -82
  72. package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts +15 -2
  73. package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts.map +1 -1
  74. package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +228 -122
  75. package/dist/cli/ink-cli/components/StatusBar.d.ts +15 -2
  76. package/dist/cli/ink-cli/components/StatusBar.d.ts.map +1 -1
  77. package/dist/cli/ink-cli/components/StatusBar.js +46 -8
  78. package/dist/cli/ink-cli/components/TextBufferInput.d.ts +52 -0
  79. package/dist/cli/ink-cli/components/TextBufferInput.d.ts.map +1 -0
  80. package/dist/cli/ink-cli/components/TextBufferInput.js +471 -0
  81. package/dist/cli/ink-cli/components/base/BaseSelector.d.ts +11 -1
  82. package/dist/cli/ink-cli/components/base/BaseSelector.d.ts.map +1 -1
  83. package/dist/cli/ink-cli/components/base/BaseSelector.js +90 -49
  84. package/dist/cli/ink-cli/components/chat/Header.d.ts +1 -0
  85. package/dist/cli/ink-cli/components/chat/Header.d.ts.map +1 -1
  86. package/dist/cli/ink-cli/components/chat/Header.js +7 -2
  87. package/dist/cli/ink-cli/components/chat/MessageItem.d.ts +3 -0
  88. package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +1 -1
  89. package/dist/cli/ink-cli/components/chat/MessageItem.js +95 -9
  90. package/dist/cli/ink-cli/components/chat/MessageList.js +1 -1
  91. package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.d.ts +16 -0
  92. package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.d.ts.map +1 -0
  93. package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.js +27 -0
  94. package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts +4 -2
  95. package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts.map +1 -1
  96. package/dist/cli/ink-cli/components/chat/ToolIcon.js +19 -5
  97. package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.d.ts +10 -0
  98. package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.d.ts.map +1 -0
  99. package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.js +6 -0
  100. package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.d.ts +10 -0
  101. package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.d.ts.map +1 -0
  102. package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.js +15 -0
  103. package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts +10 -0
  104. package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts.map +1 -0
  105. package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.js +9 -0
  106. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.d.ts +10 -0
  107. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.d.ts.map +1 -0
  108. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.js +37 -0
  109. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.d.ts +10 -0
  110. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.d.ts.map +1 -0
  111. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.js +9 -0
  112. package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.d.ts +10 -0
  113. package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.d.ts.map +1 -0
  114. package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.js +6 -0
  115. package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.d.ts +10 -0
  116. package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.d.ts.map +1 -0
  117. package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.js +29 -0
  118. package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.d.ts +45 -0
  119. package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.d.ts.map +1 -0
  120. package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.js +38 -0
  121. package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.d.ts +10 -0
  122. package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.d.ts.map +1 -0
  123. package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.js +6 -0
  124. package/dist/cli/ink-cli/components/chat/styled-boxes/index.d.ts +13 -0
  125. package/dist/cli/ink-cli/components/chat/styled-boxes/index.d.ts.map +1 -0
  126. package/dist/cli/ink-cli/components/chat/styled-boxes/index.js +12 -0
  127. package/dist/cli/ink-cli/components/input/InputArea.d.ts +36 -8
  128. package/dist/cli/ink-cli/components/input/InputArea.d.ts.map +1 -1
  129. package/dist/cli/ink-cli/components/input/InputArea.js +3 -3
  130. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts +25 -0
  131. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +1 -0
  132. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +166 -0
  133. package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts +27 -0
  134. package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +1 -0
  135. package/dist/cli/ink-cli/components/modes/StaticCLI.js +95 -0
  136. package/dist/cli/ink-cli/components/modes/index.d.ts +10 -0
  137. package/dist/cli/ink-cli/components/modes/index.d.ts.map +1 -0
  138. package/dist/cli/ink-cli/components/modes/index.js +9 -0
  139. package/dist/cli/ink-cli/components/overlays/ApiKeyInput.d.ts +26 -0
  140. package/dist/cli/ink-cli/components/overlays/ApiKeyInput.d.ts.map +1 -0
  141. package/dist/cli/ink-cli/components/overlays/ApiKeyInput.js +92 -0
  142. package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts +21 -0
  143. package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts.map +1 -0
  144. package/dist/cli/ink-cli/components/overlays/CustomModelWizard.js +177 -0
  145. package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts +22 -0
  146. package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts.map +1 -0
  147. package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +59 -0
  148. package/dist/cli/ink-cli/components/overlays/McpAddChoice.d.ts +22 -0
  149. package/dist/cli/ink-cli/components/overlays/McpAddChoice.d.ts.map +1 -0
  150. package/dist/cli/ink-cli/components/overlays/McpAddChoice.js +59 -0
  151. package/dist/cli/ink-cli/components/overlays/McpAddSelector.d.ts +26 -0
  152. package/dist/cli/ink-cli/components/overlays/McpAddSelector.d.ts.map +1 -0
  153. package/dist/cli/ink-cli/components/overlays/McpAddSelector.js +73 -0
  154. package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.d.ts +21 -0
  155. package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.d.ts.map +1 -0
  156. package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.js +51 -0
  157. package/dist/cli/ink-cli/components/overlays/McpCustomWizard.d.ts +29 -0
  158. package/dist/cli/ink-cli/components/overlays/McpCustomWizard.d.ts.map +1 -0
  159. package/dist/cli/ink-cli/components/overlays/McpCustomWizard.js +215 -0
  160. package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts +22 -0
  161. package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts.map +1 -0
  162. package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.js +74 -0
  163. package/dist/cli/ink-cli/components/overlays/McpSelector.d.ts +21 -0
  164. package/dist/cli/ink-cli/components/overlays/McpSelector.d.ts.map +1 -0
  165. package/dist/cli/ink-cli/components/overlays/McpSelector.js +52 -0
  166. package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts +28 -0
  167. package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts.map +1 -0
  168. package/dist/cli/ink-cli/components/overlays/McpServerActions.js +84 -0
  169. package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts +29 -0
  170. package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts.map +1 -0
  171. package/dist/cli/ink-cli/components/overlays/McpServerList.js +109 -0
  172. package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts +15 -8
  173. package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
  174. package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +247 -24
  175. package/dist/cli/ink-cli/components/overlays/PromptAddChoice.d.ts +22 -0
  176. package/dist/cli/ink-cli/components/overlays/PromptAddChoice.d.ts.map +1 -0
  177. package/dist/cli/ink-cli/components/overlays/PromptAddChoice.js +52 -0
  178. package/dist/cli/ink-cli/components/overlays/PromptAddWizard.d.ts +29 -0
  179. package/dist/cli/ink-cli/components/overlays/PromptAddWizard.d.ts.map +1 -0
  180. package/dist/cli/ink-cli/components/overlays/PromptAddWizard.js +166 -0
  181. package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.d.ts +27 -0
  182. package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.d.ts.map +1 -0
  183. package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.js +119 -0
  184. package/dist/cli/ink-cli/components/overlays/PromptList.d.ts +33 -0
  185. package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +1 -0
  186. package/dist/cli/ink-cli/components/overlays/PromptList.js +144 -0
  187. package/dist/cli/ink-cli/components/overlays/SearchOverlay.d.ts +23 -0
  188. package/dist/cli/ink-cli/components/overlays/SearchOverlay.d.ts.map +1 -0
  189. package/dist/cli/ink-cli/components/overlays/SearchOverlay.js +189 -0
  190. package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.d.ts +7 -2
  191. package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.d.ts.map +1 -1
  192. package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.js +19 -5
  193. package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.d.ts +21 -0
  194. package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.d.ts.map +1 -0
  195. package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.js +42 -0
  196. package/dist/cli/ink-cli/components/overlays/StreamSelector.d.ts +20 -0
  197. package/dist/cli/ink-cli/components/overlays/StreamSelector.d.ts.map +1 -0
  198. package/dist/cli/ink-cli/components/overlays/StreamSelector.js +58 -0
  199. package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts +25 -0
  200. package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts.map +1 -0
  201. package/dist/cli/ink-cli/components/overlays/ToolBrowser.js +400 -0
  202. package/dist/cli/ink-cli/components/renderers/DiffRenderer.d.ts +21 -0
  203. package/dist/cli/ink-cli/components/renderers/DiffRenderer.d.ts.map +1 -0
  204. package/dist/cli/ink-cli/components/renderers/DiffRenderer.js +65 -0
  205. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts +28 -0
  206. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts.map +1 -0
  207. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +66 -0
  208. package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts +19 -0
  209. package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts.map +1 -0
  210. package/dist/cli/ink-cli/components/renderers/FileRenderer.js +26 -0
  211. package/dist/cli/ink-cli/components/renderers/GenericRenderer.d.ts +21 -0
  212. package/dist/cli/ink-cli/components/renderers/GenericRenderer.d.ts.map +1 -0
  213. package/dist/cli/ink-cli/components/renderers/GenericRenderer.js +26 -0
  214. package/dist/cli/ink-cli/components/renderers/SearchRenderer.d.ts +20 -0
  215. package/dist/cli/ink-cli/components/renderers/SearchRenderer.d.ts.map +1 -0
  216. package/dist/cli/ink-cli/components/renderers/SearchRenderer.js +12 -0
  217. package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts +21 -0
  218. package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts.map +1 -0
  219. package/dist/cli/ink-cli/components/renderers/ShellRenderer.js +25 -0
  220. package/dist/cli/ink-cli/components/renderers/diff-shared.d.ts +61 -0
  221. package/dist/cli/ink-cli/components/renderers/diff-shared.d.ts.map +1 -0
  222. package/dist/cli/ink-cli/components/renderers/diff-shared.js +158 -0
  223. package/dist/cli/ink-cli/components/renderers/index.d.ts +28 -0
  224. package/dist/cli/ink-cli/components/renderers/index.d.ts.map +1 -0
  225. package/dist/cli/ink-cli/components/renderers/index.js +36 -0
  226. package/dist/cli/ink-cli/components/shared/MarkdownText.d.ts +38 -0
  227. package/dist/cli/ink-cli/components/shared/MarkdownText.d.ts.map +1 -0
  228. package/dist/cli/ink-cli/components/shared/MarkdownText.js +360 -0
  229. package/dist/cli/ink-cli/components/shared/VirtualizedList.d.ts +44 -0
  230. package/dist/cli/ink-cli/components/shared/VirtualizedList.d.ts.map +1 -0
  231. package/dist/cli/ink-cli/components/shared/VirtualizedList.js +300 -0
  232. package/dist/cli/ink-cli/components/shared/text-buffer.d.ts +185 -0
  233. package/dist/cli/ink-cli/components/shared/text-buffer.d.ts.map +1 -0
  234. package/dist/cli/ink-cli/components/shared/text-buffer.js +1338 -0
  235. package/dist/cli/ink-cli/constants/processingPhrases.d.ts +10 -0
  236. package/dist/cli/ink-cli/constants/processingPhrases.d.ts.map +1 -0
  237. package/dist/cli/ink-cli/constants/processingPhrases.js +64 -0
  238. package/dist/cli/ink-cli/constants/tips.d.ts +15 -0
  239. package/dist/cli/ink-cli/constants/tips.d.ts.map +1 -0
  240. package/dist/cli/ink-cli/constants/tips.js +53 -0
  241. package/dist/cli/ink-cli/containers/InputContainer.d.ts +42 -8
  242. package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +1 -1
  243. package/dist/cli/ink-cli/containers/InputContainer.js +491 -85
  244. package/dist/cli/ink-cli/containers/OverlayContainer.d.ts +23 -5
  245. package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +1 -1
  246. package/dist/cli/ink-cli/containers/OverlayContainer.js +1156 -130
  247. package/dist/cli/ink-cli/containers/index.d.ts +1 -1
  248. package/dist/cli/ink-cli/containers/index.d.ts.map +1 -1
  249. package/dist/cli/ink-cli/contexts/KeypressContext.d.ts +36 -0
  250. package/dist/cli/ink-cli/contexts/KeypressContext.d.ts.map +1 -0
  251. package/dist/cli/ink-cli/contexts/KeypressContext.js +461 -0
  252. package/dist/cli/ink-cli/contexts/MouseContext.d.ts +27 -0
  253. package/dist/cli/ink-cli/contexts/MouseContext.d.ts.map +1 -0
  254. package/dist/cli/ink-cli/contexts/MouseContext.js +102 -0
  255. package/dist/cli/ink-cli/contexts/ScrollProvider.d.ts +33 -0
  256. package/dist/cli/ink-cli/contexts/ScrollProvider.d.ts.map +1 -0
  257. package/dist/cli/ink-cli/contexts/ScrollProvider.js +170 -0
  258. package/dist/cli/ink-cli/contexts/index.d.ts +7 -0
  259. package/dist/cli/ink-cli/contexts/index.d.ts.map +1 -0
  260. package/dist/cli/ink-cli/contexts/index.js +6 -0
  261. package/dist/cli/ink-cli/hooks/index.d.ts +5 -0
  262. package/dist/cli/ink-cli/hooks/index.d.ts.map +1 -1
  263. package/dist/cli/ink-cli/hooks/index.js +6 -1
  264. package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts +26 -9
  265. package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts.map +1 -1
  266. package/dist/cli/ink-cli/hooks/useAgentEvents.js +86 -198
  267. package/dist/cli/ink-cli/hooks/useBatchedScroll.d.ts +14 -0
  268. package/dist/cli/ink-cli/hooks/useBatchedScroll.d.ts.map +1 -0
  269. package/dist/cli/ink-cli/hooks/useBatchedScroll.js +25 -0
  270. package/dist/cli/ink-cli/hooks/useCLIState.d.ts +50 -0
  271. package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +1 -0
  272. package/dist/cli/ink-cli/hooks/useCLIState.js +188 -0
  273. package/dist/cli/ink-cli/hooks/useElapsedTime.d.ts +24 -0
  274. package/dist/cli/ink-cli/hooks/useElapsedTime.d.ts.map +1 -0
  275. package/dist/cli/ink-cli/hooks/useElapsedTime.js +69 -0
  276. package/dist/cli/ink-cli/hooks/useHistorySearch.d.ts +61 -0
  277. package/dist/cli/ink-cli/hooks/useHistorySearch.d.ts.map +1 -0
  278. package/dist/cli/ink-cli/hooks/useHistorySearch.js +210 -0
  279. package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts +136 -0
  280. package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts.map +1 -0
  281. package/dist/cli/ink-cli/hooks/useInputOrchestrator.js +663 -0
  282. package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.d.ts.map +1 -1
  283. package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.js +7 -26
  284. package/dist/cli/ink-cli/hooks/useKeypress.d.ts +18 -0
  285. package/dist/cli/ink-cli/hooks/useKeypress.d.ts.map +1 -0
  286. package/dist/cli/ink-cli/hooks/useKeypress.js +26 -0
  287. package/dist/cli/ink-cli/hooks/usePhraseCycler.d.ts +30 -0
  288. package/dist/cli/ink-cli/hooks/usePhraseCycler.d.ts.map +1 -0
  289. package/dist/cli/ink-cli/hooks/usePhraseCycler.js +68 -0
  290. package/dist/cli/ink-cli/hooks/useStreaming.d.ts +19 -0
  291. package/dist/cli/ink-cli/hooks/useStreaming.d.ts.map +1 -0
  292. package/dist/cli/ink-cli/hooks/useStreaming.js +26 -0
  293. package/dist/cli/ink-cli/hooks/useTerminalSize.d.ts +14 -0
  294. package/dist/cli/ink-cli/hooks/useTerminalSize.d.ts.map +1 -0
  295. package/dist/cli/ink-cli/hooks/useTerminalSize.js +31 -0
  296. package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts +42 -0
  297. package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts.map +1 -0
  298. package/dist/cli/ink-cli/hooks/useTokenCounter.js +96 -0
  299. package/dist/cli/ink-cli/services/CommandService.d.ts +32 -1
  300. package/dist/cli/ink-cli/services/CommandService.d.ts.map +1 -1
  301. package/dist/cli/ink-cli/services/CommandService.js +36 -5
  302. package/dist/cli/ink-cli/services/InputService.d.ts +1 -5
  303. package/dist/cli/ink-cli/services/InputService.d.ts.map +1 -1
  304. package/dist/cli/ink-cli/services/InputService.js +1 -8
  305. package/dist/cli/ink-cli/services/index.d.ts +2 -1
  306. package/dist/cli/ink-cli/services/index.d.ts.map +1 -1
  307. package/dist/cli/ink-cli/services/index.js +2 -1
  308. package/dist/cli/ink-cli/services/processStream.d.ts +69 -0
  309. package/dist/cli/ink-cli/services/processStream.d.ts.map +1 -0
  310. package/dist/cli/ink-cli/services/processStream.js +674 -0
  311. package/dist/cli/ink-cli/state/actions.d.ts +30 -60
  312. package/dist/cli/ink-cli/state/actions.d.ts.map +1 -1
  313. package/dist/cli/ink-cli/state/actions.js +3 -0
  314. package/dist/cli/ink-cli/state/index.d.ts +5 -3
  315. package/dist/cli/ink-cli/state/index.d.ts.map +1 -1
  316. package/dist/cli/ink-cli/state/index.js +4 -3
  317. package/dist/cli/ink-cli/state/initialState.d.ts +4 -3
  318. package/dist/cli/ink-cli/state/initialState.d.ts.map +1 -1
  319. package/dist/cli/ink-cli/state/initialState.js +20 -4
  320. package/dist/cli/ink-cli/state/reducer.d.ts +3 -0
  321. package/dist/cli/ink-cli/state/reducer.d.ts.map +1 -1
  322. package/dist/cli/ink-cli/state/reducer.js +62 -168
  323. package/dist/cli/ink-cli/state/streaming-state.d.ts +27 -0
  324. package/dist/cli/ink-cli/state/streaming-state.d.ts.map +1 -0
  325. package/dist/cli/ink-cli/state/streaming-state.js +39 -0
  326. package/dist/cli/ink-cli/state/types.d.ts +222 -6
  327. package/dist/cli/ink-cli/state/types.d.ts.map +1 -1
  328. package/dist/cli/ink-cli/utils/bracketedPaste.d.ts +22 -0
  329. package/dist/cli/ink-cli/utils/bracketedPaste.d.ts.map +1 -0
  330. package/dist/cli/ink-cli/utils/bracketedPaste.js +27 -0
  331. package/dist/cli/ink-cli/utils/clipboardUtils.d.ts +49 -0
  332. package/dist/cli/ink-cli/utils/clipboardUtils.d.ts.map +1 -0
  333. package/dist/cli/ink-cli/utils/clipboardUtils.js +356 -0
  334. package/dist/cli/ink-cli/utils/commandOverlays.d.ts +33 -0
  335. package/dist/cli/ink-cli/utils/commandOverlays.d.ts.map +1 -0
  336. package/dist/cli/ink-cli/utils/commandOverlays.js +78 -0
  337. package/dist/cli/ink-cli/utils/debugLog.d.ts +38 -0
  338. package/dist/cli/ink-cli/utils/debugLog.d.ts.map +1 -0
  339. package/dist/cli/ink-cli/utils/debugLog.js +66 -0
  340. package/dist/cli/ink-cli/utils/index.d.ts +2 -1
  341. package/dist/cli/ink-cli/utils/index.d.ts.map +1 -1
  342. package/dist/cli/ink-cli/utils/index.js +3 -1
  343. package/dist/cli/ink-cli/utils/input.d.ts +25 -0
  344. package/dist/cli/ink-cli/utils/input.d.ts.map +1 -0
  345. package/dist/cli/ink-cli/utils/input.js +56 -0
  346. package/dist/cli/ink-cli/utils/inputParsing.d.ts +0 -9
  347. package/dist/cli/ink-cli/utils/inputParsing.d.ts.map +1 -1
  348. package/dist/cli/ink-cli/utils/inputParsing.js +0 -27
  349. package/dist/cli/ink-cli/utils/messageFormatting.d.ts +54 -3
  350. package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
  351. package/dist/cli/ink-cli/utils/messageFormatting.js +290 -20
  352. package/dist/cli/ink-cli/utils/mouse.d.ts +61 -0
  353. package/dist/cli/ink-cli/utils/mouse.d.ts.map +1 -0
  354. package/dist/cli/ink-cli/utils/mouse.js +209 -0
  355. package/dist/cli/ink-cli/utils/streamSplitter.d.ts +44 -0
  356. package/dist/cli/ink-cli/utils/streamSplitter.d.ts.map +1 -0
  357. package/dist/cli/ink-cli/utils/streamSplitter.js +154 -0
  358. package/dist/cli/ink-cli/utils/textUtils.d.ts +63 -0
  359. package/dist/cli/ink-cli/utils/textUtils.d.ts.map +1 -0
  360. package/dist/cli/ink-cli/utils/textUtils.js +248 -0
  361. package/dist/cli/ink-cli/utils/toolUtils.d.ts +9 -0
  362. package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +1 -0
  363. package/dist/cli/ink-cli/utils/toolUtils.js +13 -0
  364. package/dist/cli/utils/options.d.ts.map +1 -1
  365. package/dist/cli/utils/options.js +0 -2
  366. package/dist/config/cli-overrides.d.ts +1 -1
  367. package/dist/config/cli-overrides.d.ts.map +1 -1
  368. package/dist/config/cli-overrides.js +5 -10
  369. package/dist/index.js +66 -48
  370. package/dist/utils/agent-helpers.d.ts +95 -0
  371. package/dist/utils/agent-helpers.d.ts.map +1 -0
  372. package/dist/utils/agent-helpers.js +117 -0
  373. package/dist/webui/assets/index-BkwPkZpd.css +1 -0
  374. package/dist/webui/assets/index-D9u1XfyH.js +2025 -0
  375. package/dist/webui/assets/{tanstack-DgxBONJY.js → tanstack-Br79RQ-n.js} +1 -1
  376. package/dist/webui/index.html +3 -3
  377. package/package.json +16 -14
  378. package/dist/cli/commands/interactive-commands/index.d.ts +0 -63
  379. package/dist/cli/commands/interactive-commands/index.d.ts.map +0 -1
  380. package/dist/cli/commands/interactive-commands/index.js +0 -73
  381. package/dist/cli/commands/interactive-commands/mcp/mcp-add-utils.d.ts +0 -34
  382. package/dist/cli/commands/interactive-commands/mcp/mcp-add-utils.d.ts.map +0 -1
  383. package/dist/cli/commands/interactive-commands/mcp/mcp-add-utils.js +0 -178
  384. package/dist/cli/commands/interactive-commands/mcp/mcp-commands.d.ts +0 -9
  385. package/dist/cli/commands/interactive-commands/mcp/mcp-commands.d.ts.map +0 -1
  386. package/dist/cli/commands/interactive-commands/mcp/mcp-commands.js +0 -325
  387. package/dist/cli/commands/interactive-commands/model/model-commands.d.ts +0 -21
  388. package/dist/cli/commands/interactive-commands/model/model-commands.d.ts.map +0 -1
  389. package/dist/cli/commands/interactive-commands/model/model-commands.js +0 -190
  390. package/dist/cli/ink-cli/components/MultiLineTextInput.d.ts +0 -26
  391. package/dist/cli/ink-cli/components/MultiLineTextInput.d.ts.map +0 -1
  392. package/dist/cli/ink-cli/components/MultiLineTextInput.js +0 -220
  393. package/dist/discord/bot.d.ts +0 -4
  394. package/dist/discord/bot.d.ts.map +0 -1
  395. package/dist/discord/bot.js +0 -193
  396. package/dist/telegram/bot.d.ts +0 -5
  397. package/dist/telegram/bot.d.ts.map +0 -1
  398. package/dist/telegram/bot.js +0 -251
  399. package/dist/webui/assets/index-DKq5Xng1.js +0 -687
  400. package/dist/webui/assets/index-D_0_GBu5.css +0 -1
@@ -1,6 +1,6 @@
1
1
  // packages/cli/src/cli/commands/uninstall.ts
2
2
  import { z } from 'zod';
3
- import { getAgentRegistry } from '@dexto/agent-management';
3
+ import { uninstallAgent, listInstalledAgents } from '../../utils/agent-helpers.js';
4
4
  import { capture } from '../../analytics/index.js';
5
5
  // Zod schema for uninstall command validation
6
6
  const UninstallCommandSchema = z
@@ -20,8 +20,7 @@ async function validateUninstallCommand(agents, options) {
20
20
  agents,
21
21
  });
22
22
  // Business logic validation
23
- const registry = getAgentRegistry();
24
- const installedAgents = await registry.getInstalledAgents();
23
+ const installedAgents = await listInstalledAgents();
25
24
  if (installedAgents.length === 0) {
26
25
  throw new Error('No agents are currently installed.');
27
26
  }
@@ -33,8 +32,7 @@ async function validateUninstallCommand(agents, options) {
33
32
  export async function handleUninstallCommand(agents, options) {
34
33
  // Validate command with Zod
35
34
  const validated = await validateUninstallCommand(agents, options);
36
- const registry = getAgentRegistry();
37
- const installedAgents = await registry.getInstalledAgents();
35
+ const installedAgents = await listInstalledAgents();
38
36
  if (installedAgents.length === 0) {
39
37
  console.log('📋 No agents are currently installed.');
40
38
  return;
@@ -64,7 +62,7 @@ export async function handleUninstallCommand(agents, options) {
64
62
  for (const agentName of agentsToUninstall) {
65
63
  try {
66
64
  console.log(`\n🗑️ Uninstalling ${agentName}...`);
67
- await registry.uninstallAgent(agentName, validated.force);
65
+ await uninstallAgent(agentName);
68
66
  successCount++;
69
67
  console.log(`✅ ${agentName} uninstalled successfully`);
70
68
  uninstalled.push(agentName);
@@ -1 +1 @@
1
- {"version":3,"file":"which.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/which.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,kBAAkB;;;;;;EAIX,CAAC;AAEd,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEtE;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBzE"}
1
+ {"version":3,"file":"which.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/which.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,kBAAkB;;;;;;EAIX,CAAC;AAEd,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAgBtE;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBzE"}
@@ -1,21 +1,35 @@
1
1
  // packages/cli/src/cli/commands/which.ts
2
+ import { readFileSync } from 'fs';
2
3
  import chalk from 'chalk';
3
4
  import { z } from 'zod';
4
- import { resolveAgentPath, getAgentRegistry } from '@dexto/agent-management';
5
+ import { resolveAgentPath, resolveBundledScript } from '@dexto/agent-management';
5
6
  // Zod schema for which command validation
6
7
  const WhichCommandSchema = z
7
8
  .object({
8
9
  agentName: z.string().min(1, 'Agent name cannot be empty'),
9
10
  })
10
11
  .strict();
12
+ /**
13
+ * Load available agent names from bundled registry
14
+ */
15
+ function getAvailableAgentNames() {
16
+ try {
17
+ const registryPath = resolveBundledScript('agents/agent-registry.json');
18
+ const content = readFileSync(registryPath, 'utf-8');
19
+ const registry = JSON.parse(content);
20
+ return Object.keys(registry.agents || {});
21
+ }
22
+ catch (_error) {
23
+ return [];
24
+ }
25
+ }
11
26
  /**
12
27
  * Handle the which command
13
28
  */
14
29
  export async function handleWhichCommand(agentName) {
15
30
  // Validate command with Zod
16
31
  const validated = WhichCommandSchema.parse({ agentName });
17
- const registry = getAgentRegistry();
18
- const availableAgents = Object.keys(registry.getAvailableAgents());
32
+ const availableAgents = getAvailableAgentNames();
19
33
  try {
20
34
  const resolvedPath = await resolveAgentPath(validated.agentName, false, false); // Don't auto-install, don't inject preferences
21
35
  console.log(resolvedPath);
@@ -1,20 +1,14 @@
1
1
  /**
2
2
  * InkCLI Component (Refactored)
3
3
  *
4
- * Main orchestrator component - dramatically simplified from 1150 lines to ~150 lines
4
+ * Entry point for the Ink-based CLI. Selects between two rendering modes:
5
+ * - AlternateBufferCLI: VirtualizedList with mouse scroll, keyboard scroll, copy mode
6
+ * - StaticCLI: Static pattern with native terminal scrollback and selection
5
7
  *
6
- * Architecture:
7
- * - State managed by useReducer with typed actions
8
- * - Business logic in services
9
- * - Event handling via custom hooks
10
- * - UI in presentational components
11
- * - Smart containers orchestrate interactions
12
- *
13
- * Before: 50+ useState hooks, 15+ useEffect hooks, complex state management
14
- * After: 1 useReducer, 5 custom hooks, clear separation of concerns
8
+ * The mode is selected via USE_ALTERNATE_BUFFER constant.
15
9
  */
16
10
  import type { DextoAgent } from '@dexto/core';
17
- import { type StartupInfo } from './state/index.js';
11
+ import type { StartupInfo } from './state/types.js';
18
12
  interface InkCLIProps {
19
13
  agent: DextoAgent;
20
14
  initialSessionId: string | null;
@@ -23,21 +17,14 @@ interface InkCLIProps {
23
17
  /**
24
18
  * Modern CLI interface using React Ink
25
19
  *
26
- * Refactored for:
27
- * - Clear separation of concerns
28
- * - Testability
29
- * - Maintainability
30
- * - Performance
31
- * - Type safety
32
- *
33
- * Uses explicit sessionId in state (like WebUI) instead of defaultSession pattern
20
+ * Wraps the CLI with:
21
+ * - ErrorBoundary for graceful error handling
22
+ * - KeypressProvider for unified keyboard input
23
+ * - MouseProvider (only in alternate buffer mode)
34
24
  */
35
25
  export declare function InkCLIRefactored({ agent, initialSessionId, startupInfo }: InkCLIProps): import("react/jsx-runtime").JSX.Element;
36
26
  /**
37
27
  * Start the modern Ink-based CLI
38
- * Entry point for the refactored CLI
39
- * @param agent - The DextoAgent instance
40
- * @param initialSessionId - The session ID to use for this CLI session
41
28
  */
42
29
  export declare function startInkCliRefactored(agent: DextoAgent, initialSessionId: string | null): Promise<void>;
43
30
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"InkCLIRefactored.d.ts","sourceRoot":"","sources":["../../../src/cli/ink-cli/InkCLIRefactored.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C,OAAO,EAAkC,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAqBpF,UAAU,WAAW;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,WAAW,CAAC;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,EAAE,WAAW,2CA2IrF;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACvC,KAAK,EAAE,UAAU,EACjB,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAChC,OAAO,CAAC,IAAI,CAAC,CAsBf"}
1
+ {"version":3,"file":"InkCLIRefactored.d.ts","sourceRoot":"","sources":["../../../src/cli/ink-cli/InkCLIRefactored.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAoBpD,UAAU,WAAW;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,WAAW,CAAC;CAC5B;AAyCD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,EAAE,WAAW,2CAerF;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACvC,KAAK,EAAE,UAAU,EACjB,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAChC,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
@@ -1,158 +1,75 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  /**
3
3
  * InkCLI Component (Refactored)
4
4
  *
5
- * Main orchestrator component - dramatically simplified from 1150 lines to ~150 lines
5
+ * Entry point for the Ink-based CLI. Selects between two rendering modes:
6
+ * - AlternateBufferCLI: VirtualizedList with mouse scroll, keyboard scroll, copy mode
7
+ * - StaticCLI: Static pattern with native terminal scrollback and selection
6
8
  *
7
- * Architecture:
8
- * - State managed by useReducer with typed actions
9
- * - Business logic in services
10
- * - Event handling via custom hooks
11
- * - UI in presentational components
12
- * - Smart containers orchestrate interactions
13
- *
14
- * Before: 50+ useState hooks, 15+ useEffect hooks, complex state management
15
- * After: 1 useReducer, 5 custom hooks, clear separation of concerns
9
+ * The mode is selected via USE_ALTERNATE_BUFFER constant.
16
10
  */
17
- import { useReducer, useMemo, useEffect } from 'react';
18
- import { Box, render } from 'ink';
11
+ import { useCallback, useState } from 'react';
12
+ import { render } from 'ink';
19
13
  import { registerGracefulShutdown } from '../../utils/graceful-shutdown.js';
20
- // State management
21
- import { cliReducer, createInitialState } from './state/index.js';
22
- // Custom hooks
23
- import { useAgentEvents, useKeyboardShortcuts } from './hooks/index.js';
24
- // Services
25
- import { InputService, MessageService } from './services/index.js';
26
- // Utils
27
- import { getStartupInfo, convertHistoryToUIMessages } from './utils/messageFormatting.js';
14
+ import { enableBracketedPaste, disableBracketedPaste } from './utils/bracketedPaste.js';
15
+ // Contexts (keyboard/mouse providers)
16
+ import { KeypressProvider, MouseProvider, ScrollProvider } from './contexts/index.js';
28
17
  // Components
29
- import { ChatView } from './components/chat/ChatView.js';
30
- import { Footer } from './components/chat/Footer.js';
31
18
  import { ErrorBoundary } from './components/ErrorBoundary.js';
32
- import { StatusBar } from './components/StatusBar.js';
33
- // Containers
34
- import { InputContainer } from './containers/InputContainer.js';
35
- import { OverlayContainer } from './containers/OverlayContainer.js';
19
+ import { AlternateBufferCLI, StaticCLI } from './components/modes/index.js';
20
+ // Hooks
21
+ import { useStreaming } from './hooks/useStreaming.js';
22
+ // Utils
23
+ import { getStartupInfo } from './utils/messageFormatting.js';
24
+ // Rendering mode: true = alternate buffer with VirtualizedList, false = Static pattern
25
+ // Toggle this to switch between modes for testing
26
+ //const USE_ALTERNATE_BUFFER = true;
27
+ const USE_ALTERNATE_BUFFER = false;
28
+ /**
29
+ * Inner component that wraps the mode-specific component with providers
30
+ */
31
+ function InkCLIInner({ agent, initialSessionId, startupInfo }) {
32
+ // Selection hint callback for alternate buffer mode
33
+ const [, setSelectionHintShown] = useState(false);
34
+ // Streaming mode - can be toggled via /stream command
35
+ const { streaming } = useStreaming();
36
+ const handleSelectionAttempt = useCallback(() => {
37
+ setSelectionHintShown(true);
38
+ }, []);
39
+ if (USE_ALTERNATE_BUFFER) {
40
+ return (_jsx(ScrollProvider, { onSelectionAttempt: handleSelectionAttempt, children: _jsx(AlternateBufferCLI, { agent: agent, initialSessionId: initialSessionId, startupInfo: startupInfo, onSelectionAttempt: handleSelectionAttempt, useStreaming: streaming }) }));
41
+ }
42
+ // Static mode - no ScrollProvider needed
43
+ return (_jsx(StaticCLI, { agent: agent, initialSessionId: initialSessionId, startupInfo: startupInfo, useStreaming: streaming }));
44
+ }
36
45
  /**
37
46
  * Modern CLI interface using React Ink
38
47
  *
39
- * Refactored for:
40
- * - Clear separation of concerns
41
- * - Testability
42
- * - Maintainability
43
- * - Performance
44
- * - Type safety
45
- *
46
- * Uses explicit sessionId in state (like WebUI) instead of defaultSession pattern
48
+ * Wraps the CLI with:
49
+ * - ErrorBoundary for graceful error handling
50
+ * - KeypressProvider for unified keyboard input
51
+ * - MouseProvider (only in alternate buffer mode)
47
52
  */
48
53
  export function InkCLIRefactored({ agent, initialSessionId, startupInfo }) {
49
- // Initialize state with reducer and set initial sessionId (may be null for deferred creation)
50
- const [state, dispatch] = useReducer(cliReducer, undefined, () => {
51
- const initialModelName = agent.getCurrentLLMConfig().model;
52
- const initial = createInitialState([], initialModelName);
53
- initial.session.id = initialSessionId;
54
- initial.session.hasActiveSession = initialSessionId !== null;
55
- return initial;
56
- });
57
- // Initialize services (memoized)
58
- const inputService = useMemo(() => new InputService(), []);
59
- const messageService = useMemo(() => new MessageService(), []);
60
- // Setup event bus subscriptions
61
- useAgentEvents({ agent, dispatch, isCancelling: state.ui.isCancelling });
62
- // Session is now managed in state - no need for sync hook
63
- // useSessionSync removed - sessionId is in state from initialization or SESSION_SET actions
64
- // Input history navigation is now handled by MultiLineTextInput component
65
- // Setup global keyboard shortcuts
66
- useKeyboardShortcuts({ state, dispatch, agent });
67
- // Hydrate conversation history when resuming a session
68
- useEffect(() => {
69
- if (!initialSessionId || !state.session.hasActiveSession || state.messages.length > 0) {
70
- return;
71
- }
72
- let cancelled = false;
73
- (async () => {
74
- try {
75
- const history = await agent.getSessionHistory(initialSessionId);
76
- if (!history?.length || cancelled)
77
- return;
78
- const historyMessages = convertHistoryToUIMessages(history, initialSessionId);
79
- dispatch({ type: 'MESSAGE_ADD_MULTIPLE', messages: historyMessages });
80
- }
81
- catch (error) {
82
- if (cancelled)
83
- return;
84
- dispatch({
85
- type: 'ERROR',
86
- errorMessage: error instanceof Error ? error.message : String(error),
87
- });
88
- }
89
- })();
90
- return () => {
91
- cancelled = true;
92
- };
93
- }, [agent, dispatch, initialSessionId, state.messages.length, state.session.hasActiveSession]);
94
- // Detect overlays based on input (with guards to prevent infinite loop)
95
- useEffect(() => {
96
- // Don't detect overlays if processing or approval is active
97
- if (state.ui.isProcessing || state.approval)
98
- return;
99
- const autocompleteType = inputService.detectAutocompleteType(state.input.value);
100
- const selectorType = inputService.detectInteractiveSelector(state.input.value);
101
- // Determine what overlay should be shown
102
- let desiredOverlay = 'none';
103
- // Priority: selector > autocomplete
104
- if (selectorType === 'model') {
105
- desiredOverlay = 'model-selector';
106
- }
107
- else if (selectorType === 'session') {
108
- desiredOverlay = 'session-selector';
109
- }
110
- else if (autocompleteType === 'slash') {
111
- desiredOverlay = 'slash-autocomplete';
112
- }
113
- else if (autocompleteType === 'resource') {
114
- desiredOverlay = 'resource-autocomplete';
115
- }
116
- // Only dispatch if overlay needs to change
117
- if (desiredOverlay !== state.ui.activeOverlay && state.ui.activeOverlay !== 'approval') {
118
- if (desiredOverlay === 'none') {
119
- dispatch({ type: 'CLOSE_OVERLAY' });
120
- }
121
- else {
122
- dispatch({ type: 'SHOW_OVERLAY', overlay: desiredOverlay });
123
- }
124
- }
125
- }, [
126
- state.input.value,
127
- state.ui.isProcessing,
128
- state.approval,
129
- state.ui.activeOverlay,
130
- inputService,
131
- dispatch,
132
- ]);
133
- // Get visible messages (performance optimization)
134
- // Limit to last 30 messages to prevent scrolling issues
135
- const visibleMessages = useMemo(() => {
136
- return messageService.getVisibleMessages(state.messages, 30);
137
- }, [state.messages, messageService]);
138
- return (_jsx(ErrorBoundary, { children: _jsxs(Box, { flexDirection: "column", minHeight: 0, children: [_jsx(ChatView, { messages: visibleMessages, modelName: state.session.modelName, sessionId: state.session.id || undefined, hasActiveSession: state.session.hasActiveSession, startupInfo: startupInfo }), _jsx(StatusBar, { isProcessing: state.ui.isProcessing, isThinking: state.ui.isThinking, approvalQueueCount: state.approvalQueue.length, exitWarningShown: state.ui.exitWarningShown }), _jsx(OverlayContainer, { state: state, dispatch: dispatch, agent: agent, inputService: inputService }), _jsx(InputContainer, { state: state, dispatch: dispatch, agent: agent, inputService: inputService }), _jsx(Footer, {})] }) }));
54
+ return (_jsx(ErrorBoundary, { children: _jsx(KeypressProvider, { children: _jsx(MouseProvider, { mouseEventsEnabled: USE_ALTERNATE_BUFFER, children: _jsx(InkCLIInner, { agent: agent, initialSessionId: initialSessionId, startupInfo: startupInfo }) }) }) }));
139
55
  }
140
56
  /**
141
57
  * Start the modern Ink-based CLI
142
- * Entry point for the refactored CLI
143
- * @param agent - The DextoAgent instance
144
- * @param initialSessionId - The session ID to use for this CLI session
145
58
  */
146
59
  export async function startInkCliRefactored(agent, initialSessionId) {
147
- // Use inkMode to let Ctrl+C be handled by the UI for exit warning
148
60
  registerGracefulShutdown(() => agent, { inkMode: true });
149
- // Note: Console suppression is done in index.ts before calling this function
61
+ // Enable bracketed paste mode so we can detect pasted text
62
+ // This wraps pastes with escape sequences that our KeypressContext handles
63
+ enableBracketedPaste();
150
64
  const startupInfo = await getStartupInfo(agent);
151
65
  const inkApp = render(_jsx(InkCLIRefactored, { agent: agent, initialSessionId: initialSessionId, startupInfo: startupInfo }), {
152
- // Disable default Ctrl+C exit to handle it ourselves with double-press warning
153
66
  exitOnCtrlC: false,
67
+ alternateBuffer: USE_ALTERNATE_BUFFER,
68
+ // Incremental rendering works better with VirtualizedList
69
+ // Static pattern doesn't need it (and may work better without)
70
+ incrementalRendering: USE_ALTERNATE_BUFFER,
154
71
  });
155
- // Wait for the Ink app to exit before resolving
156
- // This ensures console suppression remains active until the UI is fully closed
157
72
  await inkApp.waitUntilExit();
73
+ // Disable bracketed paste mode to restore normal terminal behavior
74
+ disableBracketedPaste();
158
75
  }
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+ import type { Key } from '../hooks/useInputOrchestrator.js';
1
3
  export interface ApprovalRequest {
2
4
  approvalId: string;
3
5
  type: string;
@@ -6,16 +8,35 @@ export interface ApprovalRequest {
6
8
  timestamp: Date;
7
9
  metadata: Record<string, unknown>;
8
10
  }
11
+ export interface ApprovalPromptHandle {
12
+ handleInput: (input: string, key: Key) => boolean;
13
+ }
14
+ /**
15
+ * Options passed when approving a request
16
+ */
17
+ export interface ApprovalOptions {
18
+ /** Remember this tool for the entire session (approves ALL uses) */
19
+ rememberChoice?: boolean;
20
+ /** Remember a specific command pattern for bash (e.g., "git *") */
21
+ rememberPattern?: string;
22
+ /** Form data for elicitation requests */
23
+ formData?: Record<string, unknown>;
24
+ /** Enable "accept all edits" mode (auto-approve future edit_file/write_file) */
25
+ enableAcceptEditsMode?: boolean;
26
+ }
9
27
  interface ApprovalPromptProps {
10
28
  approval: ApprovalRequest;
11
- onApprove: (rememberChoice: boolean) => void;
29
+ onApprove: (options: ApprovalOptions) => void;
12
30
  onDeny: () => void;
13
31
  onCancel: () => void;
14
32
  }
15
33
  /**
16
34
  * Compact approval prompt component that displays above the input area
17
- * Shows three options in a vertical list: Yes, Yes for Session, and No
35
+ * Shows options based on approval type:
36
+ * - Tool confirmation: Yes, Yes (Session), No
37
+ * - Bash with patterns: Yes (once), pattern options, Yes (all bash), No
38
+ * - Elicitation: Form with input fields
18
39
  */
19
- export declare function ApprovalPrompt({ approval, onApprove, onDeny, onCancel }: ApprovalPromptProps): import("react/jsx-runtime").JSX.Element;
40
+ export declare const ApprovalPrompt: React.ForwardRefExoticComponent<ApprovalPromptProps & React.RefAttributes<ApprovalPromptHandle>>;
20
41
  export {};
21
42
  //# sourceMappingURL=ApprovalPrompt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApprovalPrompt.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/components/ApprovalPrompt.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,UAAU,mBAAmB;IACzB,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAID;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CA6G5F"}
1
+ {"version":3,"file":"ApprovalPrompt.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/components/ApprovalPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuE,MAAM,OAAO,CAAC;AAG5F,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAK5D,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACjC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,oEAAoE;IACpE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,UAAU,mBAAmB;IACzB,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC9C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAOD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,kGAoP1B,CAAC"}
@@ -1,55 +1,170 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import { Box, Text, useInput } from 'ink';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useState, useImperativeHandle, useRef, useEffect } from 'react';
3
+ import { Box, Text } from 'ink';
4
+ import { ElicitationForm } from './ElicitationForm.js';
5
+ import { DiffPreview, CreateFilePreview } from './renderers/index.js';
6
+ import { isEditWriteTool } from '../utils/toolUtils.js';
4
7
  /**
5
8
  * Compact approval prompt component that displays above the input area
6
- * Shows three options in a vertical list: Yes, Yes for Session, and No
9
+ * Shows options based on approval type:
10
+ * - Tool confirmation: Yes, Yes (Session), No
11
+ * - Bash with patterns: Yes (once), pattern options, Yes (all bash), No
12
+ * - Elicitation: Form with input fields
7
13
  */
8
- export function ApprovalPrompt({ approval, onApprove, onDeny, onCancel }) {
14
+ export const ApprovalPrompt = forwardRef(({ approval, onApprove, onDeny, onCancel }, ref) => {
9
15
  const isCommandConfirmation = approval.type === 'command_confirmation';
10
- const [selectedOption, setSelectedOption] = useState('yes');
11
- // Handle keyboard navigation (vertical)
12
- useInput((input, key) => {
13
- if (key.upArrow) {
14
- // Move up (skip yes-session for command confirmations)
15
- setSelectedOption((current) => {
16
- if (current === 'yes')
17
- return 'no';
18
- if (current === 'yes-session')
19
- return 'yes';
20
- // no -> yes-session (or yes for command confirmations)
21
- return isCommandConfirmation ? 'yes' : 'yes-session';
22
- });
23
- }
24
- else if (key.downArrow) {
25
- // Move down (skip yes-session for command confirmations)
26
- setSelectedOption((current) => {
27
- if (current === 'yes')
28
- return isCommandConfirmation ? 'no' : 'yes-session';
29
- if (current === 'yes-session')
30
- return 'no';
31
- return 'yes'; // no -> yes (wrap)
16
+ const isElicitation = approval.type === 'elicitation';
17
+ // Extract suggested patterns for bash tools
18
+ const suggestedPatterns = approval.metadata.suggestedPatterns ?? [];
19
+ const hasBashPatterns = suggestedPatterns.length > 0;
20
+ // Check if this is an edit/write file tool
21
+ const toolName = approval.metadata.toolName;
22
+ const isEditOrWriteTool = isEditWriteTool(toolName);
23
+ const [selectedIndex, setSelectedIndex] = useState(0);
24
+ // Ref for elicitation form
25
+ const elicitationFormRef = useRef(null);
26
+ // Use ref to avoid stale closure issues in handleInput
27
+ const selectedIndexRef = useRef(0);
28
+ // Build the list of options based on approval type
29
+ const options = [];
30
+ if (hasBashPatterns) {
31
+ // Bash tool with pattern suggestions
32
+ options.push({ id: 'yes', label: 'Yes (once)' });
33
+ suggestedPatterns.forEach((pattern, i) => {
34
+ options.push({
35
+ id: `pattern-${i}`,
36
+ label: `Yes, allow "${pattern}"`,
32
37
  });
33
- }
34
- else if (key.return) {
35
- // Enter key - confirm selection
36
- if (selectedOption === 'yes') {
37
- onApprove(false);
38
+ });
39
+ options.push({ id: 'yes-session', label: 'Yes, allow all bash' });
40
+ options.push({ id: 'no', label: 'No' });
41
+ }
42
+ else if (isCommandConfirmation) {
43
+ // Command confirmation (no session option)
44
+ options.push({ id: 'yes', label: 'Yes' });
45
+ options.push({ id: 'no', label: 'No' });
46
+ }
47
+ else if (isEditOrWriteTool) {
48
+ // Edit/write file tools - offer "accept all edits" mode instead of session
49
+ options.push({ id: 'yes', label: 'Yes' });
50
+ options.push({ id: 'yes-accept-edits', label: 'Yes, and accept all edits' });
51
+ options.push({ id: 'no', label: 'No' });
52
+ }
53
+ else {
54
+ // Standard tool confirmation
55
+ options.push({ id: 'yes', label: 'Yes' });
56
+ options.push({ id: 'yes-session', label: 'Yes (Session)' });
57
+ options.push({ id: 'no', label: 'No' });
58
+ }
59
+ // Keep ref in sync with state
60
+ useEffect(() => {
61
+ selectedIndexRef.current = selectedIndex;
62
+ }, [selectedIndex]);
63
+ // Helper to get the option at current index
64
+ const getCurrentOption = () => options[selectedIndexRef.current];
65
+ // Expose handleInput method via ref
66
+ useImperativeHandle(ref, () => ({
67
+ handleInput: (input, key) => {
68
+ // For elicitation, delegate to the form
69
+ if (isElicitation && elicitationFormRef.current) {
70
+ return elicitationFormRef.current.handleInput(input, key);
38
71
  }
39
- else if (selectedOption === 'yes-session') {
40
- onApprove(true);
72
+ if (key.upArrow) {
73
+ setSelectedIndex((current) => current === 0 ? options.length - 1 : current - 1);
74
+ return true;
41
75
  }
42
- else {
43
- onDeny();
76
+ else if (key.downArrow) {
77
+ setSelectedIndex((current) => current === options.length - 1 ? 0 : current + 1);
78
+ return true;
44
79
  }
45
- }
46
- else if (key.escape) {
47
- // Escape key - cancel
48
- onCancel();
49
- }
50
- }, { isActive: true });
80
+ else if (key.return) {
81
+ const option = getCurrentOption();
82
+ if (!option)
83
+ return false;
84
+ if (option.id === 'yes') {
85
+ onApprove({});
86
+ }
87
+ else if (option.id === 'yes-session') {
88
+ onApprove({ rememberChoice: true });
89
+ }
90
+ else if (option.id === 'yes-accept-edits') {
91
+ // Approve and enable "accept all edits" mode
92
+ onApprove({ enableAcceptEditsMode: true });
93
+ }
94
+ else if (option.id === 'no') {
95
+ onDeny();
96
+ }
97
+ else if (option.id.startsWith('pattern-')) {
98
+ // Extract pattern index and get the pattern string
99
+ const patternIndex = parseInt(option.id.replace('pattern-', ''), 10);
100
+ const pattern = suggestedPatterns[patternIndex];
101
+ if (pattern) {
102
+ onApprove({ rememberPattern: pattern });
103
+ }
104
+ else {
105
+ onApprove({});
106
+ }
107
+ }
108
+ return true;
109
+ }
110
+ else if (key.shift && key.tab && isEditOrWriteTool) {
111
+ // Shift+Tab on edit/write tool: approve and enable "accept all edits" mode
112
+ onApprove({ enableAcceptEditsMode: true });
113
+ return true;
114
+ }
115
+ else if (key.escape) {
116
+ onCancel();
117
+ return true;
118
+ }
119
+ return false;
120
+ },
121
+ }), [
122
+ isElicitation,
123
+ isEditOrWriteTool,
124
+ options,
125
+ suggestedPatterns,
126
+ onApprove,
127
+ onDeny,
128
+ onCancel,
129
+ ]);
130
+ // For elicitation, render the form
131
+ if (isElicitation) {
132
+ const metadata = approval.metadata;
133
+ return (_jsx(ElicitationForm, { ref: elicitationFormRef, metadata: metadata, onSubmit: (formData) => onApprove({ formData }), onCancel: onCancel }));
134
+ }
51
135
  // Extract information from metadata based on approval type
52
- const toolName = approval.metadata.toolName;
53
136
  const command = approval.metadata.command;
54
- return (_jsxs(Box, { borderStyle: "single", borderColor: "yellow", paddingX: 1, paddingY: 0, flexDirection: "column", children: [_jsxs(Box, { flexDirection: "column", marginBottom: 0, children: [_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: "yellow", bold: true, children: ["\uD83D\uDD10 Approval:", ' '] }), toolName && _jsx(Text, { color: "cyan", children: toolName })] }), isCommandConfirmation && command && (_jsxs(Box, { flexDirection: "row", marginTop: 0, children: [_jsx(Text, { color: "gray", children: ' Command: ' }), _jsx(Text, { color: "red", children: command })] }))] }), _jsxs(Box, { flexDirection: "column", marginTop: 0, children: [_jsx(Box, { children: selectedOption === 'yes' ? (_jsxs(Text, { color: "green", bold: true, children: [' ▶ ', "Yes"] })) : (_jsxs(Text, { color: "gray", children: [' ', "Yes"] })) }), !isCommandConfirmation && (_jsx(Box, { children: selectedOption === 'yes-session' ? (_jsxs(Text, { color: "green", bold: true, children: [' ▶ ', "Yes (Session)"] })) : (_jsxs(Text, { color: "gray", children: [' ', "Yes (Session)"] })) })), _jsx(Box, { children: selectedOption === 'no' ? (_jsxs(Text, { color: "red", bold: true, children: [' ▶ ', "No"] })) : (_jsxs(Text, { color: "gray", children: [' ', "No"] })) })] }), _jsx(Box, { marginTop: 0, children: _jsxs(Text, { color: "gray", dimColor: true, children: [' ', "\u2191\u2193 to select \u2022 Enter to confirm \u2022 Esc to cancel"] }) })] }));
55
- }
137
+ const displayPreview = approval.metadata.displayPreview;
138
+ // Render preview based on display type
139
+ const renderPreview = () => {
140
+ if (!displayPreview)
141
+ return null;
142
+ switch (displayPreview.type) {
143
+ case 'diff': {
144
+ const isOverwrite = toolName === 'internal--write_file' || toolName === 'write_file';
145
+ return (_jsx(DiffPreview, { data: displayPreview, headerType: isOverwrite ? 'overwrite' : 'edit' }));
146
+ }
147
+ case 'shell':
148
+ // For shell preview, just show the command (no output yet)
149
+ return (_jsxs(Box, { marginBottom: 1, flexDirection: "row", children: [_jsx(Text, { dimColor: true, children: "$ " }), _jsx(Text, { color: "yellow", children: displayPreview.command }), displayPreview.isBackground && _jsx(Text, { dimColor: true, children: " (background)" })] }));
150
+ case 'file':
151
+ // Use enhanced file preview with full content for new file creation
152
+ if (displayPreview.operation === 'create' && displayPreview.content) {
153
+ return _jsx(CreateFilePreview, { data: displayPreview });
154
+ }
155
+ // Fallback for other file operations
156
+ return (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { dimColor: true, children: [displayPreview.operation === 'read' &&
157
+ `Read ${displayPreview.lineCount ?? 'file'} lines`, displayPreview.operation === 'write' &&
158
+ `Write to ${displayPreview.path}`, displayPreview.operation === 'delete' &&
159
+ `Delete ${displayPreview.path}`] }) }));
160
+ default:
161
+ return null;
162
+ }
163
+ };
164
+ return (_jsxs(Box, { paddingX: 0, paddingY: 0, flexDirection: "column", children: [_jsxs(Box, { flexDirection: "column", marginBottom: 0, children: [_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: "yellow", bold: true, children: ["\uD83D\uDD10 Approval:", ' '] }), toolName && _jsx(Text, { color: "cyan", children: toolName })] }), isCommandConfirmation && command && (_jsxs(Box, { flexDirection: "row", marginTop: 0, children: [_jsx(Text, { color: "gray", children: ' Command: ' }), _jsx(Text, { color: "red", children: command })] }))] }), renderPreview(), _jsx(Box, { flexDirection: "column", marginTop: 0, children: options.map((option, index) => {
165
+ const isSelected = index === selectedIndex;
166
+ const isNo = option.id === 'no';
167
+ return (_jsx(Box, { children: isSelected ? (_jsxs(Text, { color: isNo ? 'red' : 'green', bold: true, children: [' ▶ ', option.label] })) : (_jsxs(Text, { color: "gray", children: [' ', option.label] })) }, option.id));
168
+ }) }), _jsx(Box, { marginTop: 0, children: _jsxs(Text, { color: "gray", dimColor: true, children: [' ', "\u2191\u2193 to select \u2022 Enter to confirm \u2022 Esc to cancel"] }) })] }));
169
+ });
170
+ ApprovalPrompt.displayName = 'ApprovalPrompt';
@@ -0,0 +1,22 @@
1
+ /**
2
+ * ElicitationForm Component
3
+ * Renders a form for ask_user/elicitation requests in the CLI
4
+ * Supports string, number, boolean, and enum field types
5
+ */
6
+ import React from 'react';
7
+ import type { Key } from '../hooks/useInputOrchestrator.js';
8
+ import type { ElicitationMetadata } from '@dexto/core';
9
+ export interface ElicitationFormHandle {
10
+ handleInput: (input: string, key: Key) => boolean;
11
+ }
12
+ interface ElicitationFormProps {
13
+ metadata: ElicitationMetadata;
14
+ onSubmit: (formData: Record<string, unknown>) => void;
15
+ onCancel: () => void;
16
+ }
17
+ /**
18
+ * Form component for elicitation/ask_user requests
19
+ */
20
+ export declare const ElicitationForm: React.ForwardRefExoticComponent<ElicitationFormProps & React.RefAttributes<ElicitationFormHandle>>;
21
+ export {};
22
+ //# sourceMappingURL=ElicitationForm.d.ts.map