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
@@ -0,0 +1,248 @@
1
+ /**
2
+ * Unicode-aware text utilities for terminal rendering
3
+ *
4
+ * These utilities work at the code-point level rather than UTF-16 code units,
5
+ * so that surrogate-pair emoji count as one "column".
6
+ */
7
+ import stripAnsi from 'strip-ansi';
8
+ import stringWidth from 'string-width';
9
+ // Cache for code points to reduce GC pressure
10
+ const codePointsCache = new Map();
11
+ const MAX_STRING_LENGTH_TO_CACHE = 1000;
12
+ /**
13
+ * Convert a string to an array of code points (handles surrogate pairs correctly)
14
+ */
15
+ export function toCodePoints(str) {
16
+ // ASCII fast path - check if all chars are ASCII (0-127)
17
+ let isAscii = true;
18
+ for (let i = 0; i < str.length; i++) {
19
+ if (str.charCodeAt(i) > 127) {
20
+ isAscii = false;
21
+ break;
22
+ }
23
+ }
24
+ if (isAscii) {
25
+ return str.split('');
26
+ }
27
+ // Cache short strings
28
+ // We return a copy ([...cached]) to prevent callers from mutating the cache.
29
+ // This has O(n) overhead but n is bounded by MAX_STRING_LENGTH_TO_CACHE (1000).
30
+ if (str.length <= MAX_STRING_LENGTH_TO_CACHE) {
31
+ const cached = codePointsCache.get(str);
32
+ if (cached) {
33
+ return [...cached];
34
+ }
35
+ }
36
+ const result = Array.from(str);
37
+ // Cache result
38
+ if (str.length <= MAX_STRING_LENGTH_TO_CACHE) {
39
+ codePointsCache.set(str, result);
40
+ }
41
+ return result;
42
+ }
43
+ /**
44
+ * Get the code-point length of a string
45
+ */
46
+ export function cpLen(str) {
47
+ return toCodePoints(str).length;
48
+ }
49
+ /**
50
+ * Slice a string by code-point indices
51
+ */
52
+ export function cpSlice(str, start, end) {
53
+ const arr = toCodePoints(str).slice(start, end);
54
+ return arr.join('');
55
+ }
56
+ /**
57
+ * Strip characters that can break terminal rendering.
58
+ *
59
+ * Characters stripped:
60
+ * - ANSI escape sequences
61
+ * - C0 control chars (0x00-0x1F) except CR/LF/TAB
62
+ * - C1 control chars (0x80-0x9F)
63
+ *
64
+ * Characters preserved:
65
+ * - All printable Unicode including emojis
66
+ * - CR/LF (0x0D/0x0A) - needed for line breaks
67
+ * - TAB (0x09)
68
+ */
69
+ export function stripUnsafeCharacters(str) {
70
+ const strippedAnsi = stripAnsi(str);
71
+ return toCodePoints(strippedAnsi)
72
+ .filter((char) => {
73
+ const code = char.codePointAt(0);
74
+ if (code === undefined)
75
+ return false;
76
+ // Preserve CR/LF/TAB for line handling
77
+ if (code === 0x0a || code === 0x0d || code === 0x09)
78
+ return true;
79
+ // Remove C0 control chars (except CR/LF/TAB)
80
+ if (code >= 0x00 && code <= 0x1f)
81
+ return false;
82
+ // Remove DEL control char
83
+ if (code === 0x7f)
84
+ return false;
85
+ // Remove C1 control chars (0x80-0x9f)
86
+ if (code >= 0x80 && code <= 0x9f)
87
+ return false;
88
+ // Preserve all other characters including Unicode/emojis
89
+ return true;
90
+ })
91
+ .join('');
92
+ }
93
+ // String width caching for performance optimization
94
+ const stringWidthCache = new Map();
95
+ /**
96
+ * Cached version of stringWidth function for better performance
97
+ */
98
+ export function getCachedStringWidth(str) {
99
+ // ASCII printable chars have width 1
100
+ if (/^[\x20-\x7E]*$/.test(str)) {
101
+ return str.length;
102
+ }
103
+ if (stringWidthCache.has(str)) {
104
+ return stringWidthCache.get(str);
105
+ }
106
+ const width = stringWidth(str);
107
+ stringWidthCache.set(str, width);
108
+ return width;
109
+ }
110
+ /**
111
+ * Clear the string width cache
112
+ */
113
+ export function clearStringWidthCache() {
114
+ stringWidthCache.clear();
115
+ }
116
+ // Word character detection helpers
117
+ // These accept string | undefined to safely handle array bounds access (chars[i] may be undefined)
118
+ export const isWordCharStrict = (char) => char !== undefined && /[\w\p{L}\p{N}]/u.test(char);
119
+ export const isWhitespace = (char) => char !== undefined && /\s/.test(char);
120
+ export const isCombiningMark = (char) => char !== undefined && /\p{M}/u.test(char);
121
+ export const isWordCharWithCombining = (char) => isWordCharStrict(char) || isCombiningMark(char);
122
+ // Get the script of a character (simplified for common scripts)
123
+ export const getCharScript = (char) => {
124
+ if (!char)
125
+ return 'other';
126
+ if (/[\p{Script=Latin}]/u.test(char))
127
+ return 'latin';
128
+ if (/[\p{Script=Han}]/u.test(char))
129
+ return 'han';
130
+ if (/[\p{Script=Arabic}]/u.test(char))
131
+ return 'arabic';
132
+ if (/[\p{Script=Hiragana}]/u.test(char))
133
+ return 'hiragana';
134
+ if (/[\p{Script=Katakana}]/u.test(char))
135
+ return 'katakana';
136
+ if (/[\p{Script=Cyrillic}]/u.test(char))
137
+ return 'cyrillic';
138
+ return 'other';
139
+ };
140
+ export const isDifferentScript = (char1, char2) => {
141
+ if (!isWordCharStrict(char1) || !isWordCharStrict(char2))
142
+ return false;
143
+ return getCharScript(char1) !== getCharScript(char2);
144
+ };
145
+ // Initialize segmenter for word boundary detection
146
+ const segmenter = new Intl.Segmenter(undefined, { granularity: 'word' });
147
+ /**
148
+ * Find previous word boundary in a line
149
+ */
150
+ export function findPrevWordBoundary(line, cursorCol) {
151
+ const codePoints = toCodePoints(line);
152
+ // Convert cursorCol (CP index) to string index
153
+ const prefix = codePoints.slice(0, cursorCol).join('');
154
+ const cursorIdx = prefix.length;
155
+ let targetIdx = 0;
156
+ for (const seg of segmenter.segment(line)) {
157
+ if (seg.index >= cursorIdx)
158
+ break;
159
+ if (seg.isWordLike) {
160
+ targetIdx = seg.index;
161
+ }
162
+ }
163
+ return toCodePoints(line.slice(0, targetIdx)).length;
164
+ }
165
+ /**
166
+ * Find next word boundary in a line
167
+ */
168
+ export function findNextWordBoundary(line, cursorCol) {
169
+ const codePoints = toCodePoints(line);
170
+ const prefix = codePoints.slice(0, cursorCol).join('');
171
+ const cursorIdx = prefix.length;
172
+ let targetIdx = line.length;
173
+ for (const seg of segmenter.segment(line)) {
174
+ const segEnd = seg.index + seg.segment.length;
175
+ if (segEnd > cursorIdx) {
176
+ if (seg.isWordLike) {
177
+ targetIdx = segEnd;
178
+ break;
179
+ }
180
+ }
181
+ }
182
+ return toCodePoints(line.slice(0, targetIdx)).length;
183
+ }
184
+ /**
185
+ * Find next word start within a line, starting from col
186
+ */
187
+ export function findNextWordStartInLine(line, col) {
188
+ const chars = toCodePoints(line);
189
+ let i = col;
190
+ if (i >= chars.length)
191
+ return null;
192
+ const currentChar = chars[i];
193
+ // Skip current word/sequence based on character type
194
+ if (isWordCharStrict(currentChar)) {
195
+ while (i < chars.length && isWordCharWithCombining(chars[i])) {
196
+ if (i + 1 < chars.length &&
197
+ isWordCharStrict(chars[i + 1]) &&
198
+ isDifferentScript(chars[i], chars[i + 1])) {
199
+ i++;
200
+ break;
201
+ }
202
+ i++;
203
+ }
204
+ }
205
+ else if (!isWhitespace(currentChar)) {
206
+ while (i < chars.length && !isWordCharStrict(chars[i]) && !isWhitespace(chars[i])) {
207
+ i++;
208
+ }
209
+ }
210
+ // Skip whitespace
211
+ while (i < chars.length && isWhitespace(chars[i])) {
212
+ i++;
213
+ }
214
+ return i < chars.length ? i : null;
215
+ }
216
+ /**
217
+ * Find previous word start within a line
218
+ */
219
+ export function findPrevWordStartInLine(line, col) {
220
+ const chars = toCodePoints(line);
221
+ let i = col;
222
+ if (i <= 0)
223
+ return null;
224
+ i--;
225
+ // Skip whitespace moving backwards
226
+ while (i >= 0 && isWhitespace(chars[i])) {
227
+ i--;
228
+ }
229
+ if (i < 0)
230
+ return null;
231
+ if (isWordCharStrict(chars[i])) {
232
+ while (i >= 0 && isWordCharStrict(chars[i])) {
233
+ if (i - 1 >= 0 &&
234
+ isWordCharStrict(chars[i - 1]) &&
235
+ isDifferentScript(chars[i], chars[i - 1])) {
236
+ return i;
237
+ }
238
+ i--;
239
+ }
240
+ return i + 1;
241
+ }
242
+ else {
243
+ while (i >= 0 && !isWordCharStrict(chars[i]) && !isWhitespace(chars[i])) {
244
+ i--;
245
+ }
246
+ return i + 1;
247
+ }
248
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Tool utility functions for CLI
3
+ */
4
+ /**
5
+ * Check if a tool is an edit or write file tool.
6
+ * Used for "accept all edits" mode which auto-approves these tools.
7
+ */
8
+ export declare function isEditWriteTool(toolName: string | undefined): boolean;
9
+ //# sourceMappingURL=toolUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolUtils.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/utils/toolUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAOrE"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Tool utility functions for CLI
3
+ */
4
+ /**
5
+ * Check if a tool is an edit or write file tool.
6
+ * Used for "accept all edits" mode which auto-approves these tools.
7
+ */
8
+ export function isEditWriteTool(toolName) {
9
+ return (toolName === 'internal--edit_file' ||
10
+ toolName === 'internal--write_file' ||
11
+ toolName === 'edit_file' ||
12
+ toolName === 'write_file');
13
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/options.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,CA2FlD;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAoB3D"}
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/options.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,CAyFlD;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAoB3D"}
@@ -32,7 +32,6 @@ export function validateCliOptions(opts) {
32
32
  .describe('Automatically approve all tool executions when true'),
33
33
  provider: z.string().optional(),
34
34
  model: z.string().optional(),
35
- router: z.enum(['vercel', 'in-built']).optional(),
36
35
  interactive: z
37
36
  .boolean()
38
37
  .optional()
@@ -75,7 +74,6 @@ export function validateCliOptions(opts) {
75
74
  port: opts.port,
76
75
  provider: opts.provider,
77
76
  model: opts.model,
78
- router: opts.router,
79
77
  interactive: opts.interactive,
80
78
  autoApprove: opts.autoApprove,
81
79
  });
@@ -7,7 +7,7 @@ import type { AgentConfig, LLMConfig } from '@dexto/core';
7
7
  * CLI config override type for fields that can be overridden via CLI
8
8
  * Uses input type (LLMConfig) since these represent user-provided CLI arguments
9
9
  */
10
- export interface CLIConfigOverrides extends Partial<Pick<LLMConfig, 'provider' | 'model' | 'router' | 'apiKey'>> {
10
+ export interface CLIConfigOverrides extends Partial<Pick<LLMConfig, 'provider' | 'model' | 'apiKey'>> {
11
11
  autoApprove?: boolean;
12
12
  }
13
13
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"cli-overrides.d.ts","sourceRoot":"","sources":["../../src/config/cli-overrides.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,kBACb,SAAQ,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC;IAC5E,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC7B,UAAU,EAAE,WAAW,EACvB,YAAY,CAAC,EAAE,kBAAkB,GAClC,WAAW,CAuCb"}
1
+ {"version":3,"file":"cli-overrides.d.ts","sourceRoot":"","sources":["../../src/config/cli-overrides.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,kBACb,SAAQ,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC;IACjE,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC7B,UAAU,EAAE,WAAW,EACvB,YAAY,CAAC,EAAE,kBAAkB,GAClC,WAAW,CA+Bb"}
@@ -18,29 +18,24 @@ export function applyCLIOverrides(baseConfig, cliOverrides) {
18
18
  }
19
19
  // Create a deep copy of the base config for modification
20
20
  const mergedConfig = JSON.parse(JSON.stringify(baseConfig));
21
- // Ensure llm section exists
22
- if (!mergedConfig.llm) {
23
- mergedConfig.llm = {};
24
- }
25
- // Apply CLI overrides to LLM config
21
+ // Apply CLI overrides to LLM config (llm is required in AgentConfig)
26
22
  if (cliOverrides.provider) {
27
23
  mergedConfig.llm.provider = cliOverrides.provider;
28
24
  }
29
25
  if (cliOverrides.model) {
30
26
  mergedConfig.llm.model = cliOverrides.model;
31
27
  }
32
- if (cliOverrides.router) {
33
- mergedConfig.llm.router = cliOverrides.router;
34
- }
35
28
  if (cliOverrides.apiKey) {
36
29
  mergedConfig.llm.apiKey = cliOverrides.apiKey;
37
30
  }
38
31
  if (cliOverrides.autoApprove) {
39
32
  // Ensure toolConfirmation section exists before overriding
40
33
  if (!mergedConfig.toolConfirmation) {
41
- mergedConfig.toolConfirmation = {};
34
+ mergedConfig.toolConfirmation = { mode: 'auto-approve' };
35
+ }
36
+ else {
37
+ mergedConfig.toolConfirmation.mode = 'auto-approve';
42
38
  }
43
- mergedConfig.toolConfirmation.mode = 'auto-approve';
44
39
  }
45
40
  // Return merged config without validation - validation happens later
46
41
  return mergedConfig;
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  import { applyLayeredEnvironmentLoading } from './utils/env.js';
4
4
  // Apply layered environment loading before any other imports
5
5
  await applyLayeredEnvironmentLoading();
6
- import { existsSync } from 'fs';
6
+ import { existsSync, readFileSync } from 'fs';
7
7
  import { createRequire } from 'module';
8
8
  import path from 'path';
9
9
  import { Command } from 'commander';
@@ -15,10 +15,8 @@ import { withAnalytics, safeExit, ExitSignal } from './analytics/wrapper.js';
15
15
  const require = createRequire(import.meta.url);
16
16
  const pkg = require('../package.json');
17
17
  import { logger, getProviderFromModel, getAllSupportedModels, DextoAgent, isPath, resolveApiKeyForProvider, getPrimaryApiKeyEnvVar, } from '@dexto/core';
18
- import { resolveAgentPath, getAgentRegistry, loadAgentConfig, globalPreferencesExist, loadGlobalPreferences, } from '@dexto/agent-management';
18
+ import { resolveAgentPath, loadAgentConfig, globalPreferencesExist, loadGlobalPreferences, resolveBundledScript, } from '@dexto/agent-management';
19
19
  import { startHonoApiServer } from './api/server-hono.js';
20
- import { startDiscordBot } from './discord/bot.js';
21
- import { startTelegramBot } from './telegram/bot.js';
22
20
  import { validateCliOptions, handleCliOptionsError } from './cli/utils/options.js';
23
21
  import { validateAgentConfig } from './cli/utils/config-validation.js';
24
22
  import { applyCLIOverrides } from './config/cli-overrides.js';
@@ -48,11 +46,10 @@ program
48
46
  .option('--no-interactive', 'Disable interactive prompts and API key setup')
49
47
  .option('--skip-setup', 'Skip global setup validation (useful for MCP mode, automation)')
50
48
  .option('-m, --model <model>', 'Specify the LLM model to use')
51
- .option('--router <router>', 'Specify the LLM router to use (vercel or in-built)')
52
49
  .option('--auto-approve', 'Always approve tool executions without confirmation prompts')
53
50
  .option('-c, --continue', 'Continue most recent session (requires -p/prompt)')
54
51
  .option('-r, --resume <sessionId>', 'Resume specific session (requires -p/prompt)')
55
- .option('--mode <mode>', 'The application in which dexto should talk to you - web | cli | server | discord | telegram | mcp', 'web')
52
+ .option('--mode <mode>', 'The application in which dexto should talk to you - web | cli | server | mcp', 'web')
56
53
  .option('--port <port>', 'port for the server (default: 3000 for web, 3001 for server mode)')
57
54
  .option('--no-auto-install', 'Disable automatic installation of missing agents from registry')
58
55
  .enablePositionalOptions();
@@ -239,16 +236,22 @@ async function bootstrapAgentFromGlobalOpts() {
239
236
  const resolvedPath = await resolveAgentPath(globalOpts.agent, globalOpts.autoInstall !== false, true);
240
237
  const rawConfig = await loadAgentConfig(resolvedPath);
241
238
  const mergedConfig = applyCLIOverrides(rawConfig, globalOpts);
242
- const enrichedConfig = enrichAgentConfig(mergedConfig, resolvedPath);
239
+ const enrichedConfig = enrichAgentConfig(mergedConfig, resolvedPath, {
240
+ logLevel: 'info', // CLI uses info-level logging for visibility
241
+ });
243
242
  // Override approval config for read-only commands (never run conversations)
244
243
  // This avoids needing to set up unused approval handlers
245
244
  enrichedConfig.toolConfirmation = {
246
245
  mode: 'auto-approve',
247
- timeout: enrichedConfig.toolConfirmation?.timeout ?? 120000,
246
+ ...(enrichedConfig.toolConfirmation?.timeout !== undefined && {
247
+ timeout: enrichedConfig.toolConfirmation.timeout,
248
+ }),
248
249
  };
249
250
  enrichedConfig.elicitation = {
250
251
  enabled: false,
251
- timeout: enrichedConfig.elicitation?.timeout ?? 120000,
252
+ ...(enrichedConfig.elicitation?.timeout !== undefined && {
253
+ timeout: enrichedConfig.elicitation.timeout,
254
+ }),
252
255
  };
253
256
  const agent = new DextoAgent(enrichedConfig, resolvedPath);
254
257
  await agent.start();
@@ -439,7 +442,7 @@ program
439
442
  safeExit('mcp', 1, 'mcp-agg-failed');
440
443
  }
441
444
  }, { timeoutMs: 0 }));
442
- // 10) Main dexto CLI - Interactive/One shot (CLI/HEADLESS) or run in other modes (--mode web/discord/telegram)
445
+ // 10) Main dexto CLI - Interactive/One shot (CLI/HEADLESS) or run in other modes (--mode web/server/mcp)
443
446
  program
444
447
  .argument('[prompt...]', 'Natural-language prompt to run once. If not passed, dexto will start as an interactive CLI')
445
448
  // Main customer facing description
@@ -469,8 +472,6 @@ program
469
472
  ' dexto --auto-approve Auto-approve all tool executions\n\n' +
470
473
  'Advanced Modes:\n' +
471
474
  ' dexto --mode server Run as API server\n' +
472
- ' dexto --mode discord Run as Discord bot\n' +
473
- ' dexto --mode telegram Run as Telegram bot\n' +
474
475
  ' dexto --mode mcp Run as MCP server\n\n' +
475
476
  'See https://docs.dexto.ai for documentation and examples')
476
477
  .action(withAnalytics('main', async (prompt = []) => {
@@ -573,19 +574,29 @@ program
573
574
  else {
574
575
  // Early registry validation for named agents
575
576
  if (opts.agent) {
576
- const registry = getAgentRegistry();
577
- if (!registry.hasAgent(opts.agent)) {
578
- console.error(`❌ Agent '${opts.agent}' not found in registry`);
579
- // Show available agents
580
- const available = Object.keys(registry.getAvailableAgents());
581
- if (available.length > 0) {
582
- console.log(`📋 Available agents: ${available.join(', ')}`);
583
- }
584
- else {
585
- console.log('📋 No agents available in registry');
577
+ // Load bundled registry to check if agent exists
578
+ try {
579
+ const bundledRegistryPath = resolveBundledScript('agents/agent-registry.json');
580
+ const registryContent = readFileSync(bundledRegistryPath, 'utf-8');
581
+ const bundledRegistry = JSON.parse(registryContent);
582
+ // Check if agent exists in bundled registry
583
+ if (!(opts.agent in bundledRegistry.agents)) {
584
+ console.error(`❌ Agent '${opts.agent}' not found in registry`);
585
+ // Show available agents
586
+ const available = Object.keys(bundledRegistry.agents);
587
+ if (available.length > 0) {
588
+ console.log(`📋 Available agents: ${available.join(', ')}`);
589
+ }
590
+ else {
591
+ console.log('📋 No agents available in registry');
592
+ }
593
+ safeExit('main', 1, 'agent-not-in-registry');
594
+ return;
586
595
  }
587
- safeExit('main', 1, 'agent-not-in-registry');
588
- return;
596
+ }
597
+ catch (error) {
598
+ logger.warn(`Could not validate agent against registry: ${error instanceof Error ? error.message : String(error)}`);
599
+ // Continue anyway - resolver will handle it
589
600
  }
590
601
  }
591
602
  // Check setup state and auto-trigger if needed
@@ -608,7 +619,10 @@ program
608
619
  // Enrichment adds filesystem paths to storage (schema has in-memory defaults)
609
620
  // Interactive CLI mode: only log to file (console would interfere with chat UI)
610
621
  const isInteractiveCli = opts.mode === 'cli' && !headlessInput;
611
- const enrichedConfig = enrichAgentConfig(mergedConfig, resolvedPath, isInteractiveCli);
622
+ const enrichedConfig = enrichAgentConfig(mergedConfig, resolvedPath, {
623
+ isInteractiveCli,
624
+ logLevel: 'info', // CLI uses info-level logging for visibility
625
+ });
612
626
  // Validate enriched config with interactive setup if needed (for API key issues)
613
627
  validatedConfig = await validateAgentConfig(enrichedConfig, opts.interactive !== false);
614
628
  }
@@ -704,6 +718,15 @@ program
704
718
  const approvalCoordinator = new ApprovalCoordinator();
705
719
  const handler = createManualApprovalHandler(approvalCoordinator);
706
720
  agent.setApprovalHandler(handler);
721
+ // Bridge approval events between coordinator and agent event bus for Ink CLI
722
+ // Forward requests from coordinator to event bus (for UI to receive)
723
+ approvalCoordinator.on('approval:request', (request) => {
724
+ agent.agentEventBus.emit('approval:request', request);
725
+ });
726
+ // Forward responses from event bus to coordinator (for handler to receive)
727
+ agent.agentEventBus.on('approval:response', (response) => {
728
+ approvalCoordinator.emitResponse(response);
729
+ });
707
730
  logger.debug('Event-based approval handler configured for Ink CLI');
708
731
  }
709
732
  // Start the agent now that approval handler is configured
@@ -799,8 +822,9 @@ program
799
822
  else {
800
823
  // Interactive mode - session management handled via /resume command
801
824
  // Note: -c and -r flags are validated to require a prompt (headless mode only)
802
- // Defer session creation until first message is sent to prevent stale empty sessions
803
- const cliSessionId = null;
825
+ // Create session eagerly so slash commands work immediately
826
+ const session = await agent.createSession();
827
+ const cliSessionId = session.id;
804
828
  // Interactive mode - use Ink CLI with session support
805
829
  // Suppress console output before starting Ink UI
806
830
  const originalConsole = {
@@ -903,26 +927,6 @@ program
903
927
  console.log(' SSE support available for real-time events');
904
928
  break;
905
929
  }
906
- case 'discord':
907
- console.log('🤖 Starting Discord bot…');
908
- try {
909
- startDiscordBot(agent);
910
- }
911
- catch (err) {
912
- console.error('❌ Discord startup failed:', err);
913
- safeExit('main', 1, 'discord-startup-failed');
914
- }
915
- break;
916
- case 'telegram':
917
- console.log('🤖 Starting Telegram bot…');
918
- try {
919
- startTelegramBot(agent);
920
- }
921
- catch (err) {
922
- console.error('❌ Telegram startup failed:', err);
923
- safeExit('main', 1, 'telegram-startup-failed');
924
- }
925
- break;
926
930
  // TODO: Remove if server mode is stable and supports mcp
927
931
  // Starts dexto as a local mcp server
928
932
  // Use `dexto --mode mcp` to start dexto as a local mcp server
@@ -953,7 +957,21 @@ program
953
957
  break;
954
958
  }
955
959
  default:
956
- console.error(`❌ Unknown mode '${opts.mode}'. Use web, cli, server, discord, telegram, or mcp.`);
960
+ if (opts.mode === 'discord' || opts.mode === 'telegram') {
961
+ console.error(`❌ Error: '${opts.mode}' mode has been moved to examples`);
962
+ console.error('');
963
+ console.error(`The ${opts.mode} bot is now a standalone example that you can customize.`);
964
+ console.error('');
965
+ console.error(`📖 See: examples/${opts.mode}-bot/README.md`);
966
+ console.error('');
967
+ console.error(`To run it:`);
968
+ console.error(` cd examples/${opts.mode}-bot`);
969
+ console.error(` pnpm install`);
970
+ console.error(` pnpm start`);
971
+ }
972
+ else {
973
+ console.error(`❌ Unknown mode '${opts.mode}'. Use web, cli, server, or mcp.`);
974
+ }
957
975
  safeExit('main', 1, 'unknown-mode');
958
976
  }
959
977
  }, { timeoutMs: 0 }));
@@ -0,0 +1,95 @@
1
+ import { AgentManager, type InstallOptions, type AgentMetadata } from '@dexto/agent-management';
2
+ /**
3
+ * Get or create the CLI AgentManager instance
4
+ *
5
+ * This manager operates on the global agents directory (~/.dexto/agents)
6
+ * and uses the user registry file (~/.dexto/agents/registry.json).
7
+ *
8
+ * @returns AgentManager instance for CLI operations
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * const manager = getCLIAgentManager();
13
+ * await manager.loadRegistry();
14
+ * const agents = manager.listAgents();
15
+ * ```
16
+ */
17
+ export declare function getCLIAgentManager(): AgentManager;
18
+ /**
19
+ * Reset the CLI AgentManager singleton (primarily for testing)
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * // In tests
24
+ * resetCLIAgentManager();
25
+ * const manager = getCLIAgentManager(); // Creates fresh instance
26
+ * ```
27
+ */
28
+ export declare function resetCLIAgentManager(): void;
29
+ /**
30
+ * Install bundled agent from registry to ~/.dexto/agents
31
+ *
32
+ * @param agentId ID of the agent to install from bundled registry
33
+ * @param options Installation options (agentsDir defaults to ~/.dexto/agents)
34
+ * @returns Path to the installed agent's main config file
35
+ *
36
+ * @throws {Error} If agent not found in bundled registry or installation fails
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * await installBundledAgent('coding-agent');
41
+ * console.log('Agent installed to ~/.dexto/agents/coding-agent');
42
+ * ```
43
+ */
44
+ export declare function installBundledAgent(agentId: string, options?: InstallOptions): Promise<string>;
45
+ /**
46
+ * Install custom agent from local path to ~/.dexto/agents
47
+ *
48
+ * @param agentId Unique ID for the custom agent
49
+ * @param sourcePath Absolute path to agent YAML file or directory
50
+ * @param metadata Agent metadata (name, description, author, tags)
51
+ * @param options Installation options (agentsDir defaults to ~/.dexto/agents)
52
+ * @returns Path to the installed agent's main config file
53
+ *
54
+ * @throws {Error} If agent ID already exists or installation fails
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * await installCustomAgent('my-agent', '/path/to/agent.yml', {
59
+ * name: 'My Agent',
60
+ * description: 'Custom agent for my use case',
61
+ * author: 'John Doe',
62
+ * tags: ['custom']
63
+ * });
64
+ * ```
65
+ */
66
+ export declare function installCustomAgent(agentId: string, sourcePath: string, metadata: Pick<AgentMetadata, 'name' | 'description' | 'author' | 'tags'>, options?: InstallOptions): Promise<string>;
67
+ /**
68
+ * Uninstall agent by removing it from disk and user registry
69
+ *
70
+ * @param agentId ID of the agent to uninstall
71
+ * @param options Installation options (agentsDir defaults to ~/.dexto/agents)
72
+ *
73
+ * @throws {Error} If agent not found or uninstallation fails
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * await uninstallAgent('my-custom-agent');
78
+ * console.log('Agent uninstalled');
79
+ * ```
80
+ */
81
+ export declare function uninstallAgent(agentId: string, options?: InstallOptions): Promise<void>;
82
+ /**
83
+ * List installed agents from ~/.dexto/agents
84
+ *
85
+ * @param options Installation options (agentsDir defaults to ~/.dexto/agents)
86
+ * @returns Array of installed agent IDs
87
+ *
88
+ * @example
89
+ * ```typescript
90
+ * const installed = await listInstalledAgents();
91
+ * console.log(installed); // ['coding-agent', 'my-custom-agent']
92
+ * ```
93
+ */
94
+ export declare function listInstalledAgents(options?: InstallOptions): Promise<string[]>;
95
+ //# sourceMappingURL=agent-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/agent-helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,YAAY,EAMZ,KAAK,cAAc,EACnB,KAAK,aAAa,EACrB,MAAM,yBAAyB,CAAC;AAQjC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,IAAI,YAAY,CAMjD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,kBAAkB,CACpC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,CAAC,EACzE,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7F;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAErF"}