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
@@ -8,10 +8,12 @@
8
8
  * - /log [level] - Set or view log level
9
9
  * - /config - Show current configuration
10
10
  * - /stats - Show system statistics
11
+ * - /stream - Toggle streaming mode for LLM responses
11
12
  */
12
13
  import chalk from 'chalk';
13
14
  import { logger } from '@dexto/core';
14
15
  import { formatForInkCli } from '../utils/format-output.js';
16
+ import { CommandOutputHelper } from '../utils/command-output.js';
15
17
  /**
16
18
  * System commands for configuration and monitoring
17
19
  */
@@ -22,7 +24,7 @@ export const systemCommands = [
22
24
  usage: '/log [level]',
23
25
  category: 'System',
24
26
  aliases: [],
25
- handler: async (args, _agent) => {
27
+ handler: async (args, _agent, _ctx) => {
26
28
  const validLevels = ['error', 'warn', 'info', 'http', 'verbose', 'debug', 'silly'];
27
29
  const level = args[0];
28
30
  if (!level) {
@@ -73,56 +75,66 @@ export const systemCommands = [
73
75
  description: 'Show current configuration',
74
76
  usage: '/config',
75
77
  category: 'System',
76
- handler: async (_args, agent) => {
78
+ handler: async (_args, agent, _ctx) => {
77
79
  try {
78
80
  const config = agent.getEffectiveConfig();
79
- // Build output string
80
- const outputLines = ['\n⚙️ Current Configuration:\n'];
81
- // LLM Config
82
- outputLines.push('🤖 LLM:');
83
- outputLines.push(` Provider: ${config.llm.provider}`);
84
- outputLines.push(` Model: ${config.llm.model}`);
85
- outputLines.push(` Router: ${config.llm.router}`);
86
- // Session Config
87
- outputLines.push('\n💬 Sessions:');
88
- outputLines.push(` Max Sessions: ${config.sessions?.maxSessions?.toString() || 'Default'}`);
89
- outputLines.push(` Session TTL: ${config.sessions?.sessionTTL ? `${config.sessions.sessionTTL / 1000}s` : 'Default'}`);
90
- // MCP Servers
91
- outputLines.push('\n🔌 MCP Servers:');
92
81
  const servers = Object.keys(config.mcpServers || {});
93
- if (servers.length > 0) {
94
- for (const server of servers) {
95
- outputLines.push(` ${server}`);
96
- }
82
+ // Get config file path (may not exist for programmatic agents)
83
+ let configFilePath = null;
84
+ try {
85
+ configFilePath = agent.getAgentFilePath();
97
86
  }
98
- else {
99
- outputLines.push(' No MCP servers configured');
87
+ catch {
88
+ // No config file path available
100
89
  }
101
- const output = outputLines.join('\n') + '\n';
102
- // Log for regular CLI
103
- console.log(chalk.blue('\n⚙️ Current Configuration:\n'));
104
- console.log(chalk.bold('🤖 LLM:'));
105
- console.log(` Provider: ${chalk.cyan(config.llm.provider)}`);
106
- console.log(` Model: ${chalk.cyan(config.llm.model)}`);
107
- console.log(` Router: ${chalk.cyan(config.llm.router)}`);
108
- console.log(chalk.bold('\n💬 Sessions:'));
109
- console.log(` Max Sessions: ${chalk.cyan(config.sessions?.maxSessions?.toString() || 'Default')}`);
110
- console.log(` Session TTL: ${chalk.cyan(config.sessions?.sessionTTL ? `${config.sessions.sessionTTL / 1000}s` : 'Default')}`);
111
- console.log(chalk.bold('\n🔌 MCP Servers:'));
112
- if (servers.length > 0) {
113
- for (const server of servers) {
114
- console.log(` ${chalk.cyan(server)}`);
90
+ // Get enabled plugins
91
+ const pluginsEnabled = [];
92
+ if (config.plugins) {
93
+ // Check built-in plugins
94
+ if (config.plugins.contentPolicy?.enabled) {
95
+ pluginsEnabled.push('contentPolicy');
96
+ }
97
+ if (config.plugins.responseSanitizer?.enabled) {
98
+ pluginsEnabled.push('responseSanitizer');
99
+ }
100
+ // Check custom plugins
101
+ for (const plugin of config.plugins.custom || []) {
102
+ if (plugin.enabled) {
103
+ pluginsEnabled.push(plugin.name);
104
+ }
115
105
  }
116
106
  }
117
- else {
118
- console.log(chalk.dim(' No MCP servers configured'));
119
- }
120
- console.log();
121
- return formatForInkCli(output);
107
+ // Build styled data
108
+ const styledData = {
109
+ configFilePath,
110
+ provider: config.llm.provider,
111
+ model: config.llm.model,
112
+ maxTokens: config.llm.maxOutputTokens ?? null,
113
+ temperature: config.llm.temperature ?? null,
114
+ toolConfirmationMode: config.toolConfirmation?.mode || 'auto',
115
+ maxSessions: config.sessions?.maxSessions?.toString() || 'Default',
116
+ sessionTTL: config.sessions?.sessionTTL
117
+ ? `${config.sessions.sessionTTL / 1000}s`
118
+ : 'Default',
119
+ mcpServers: servers,
120
+ promptsCount: config.prompts?.length || 0,
121
+ pluginsEnabled,
122
+ };
123
+ // Build fallback text (no console.log - interferes with Ink rendering)
124
+ const fallbackLines = [
125
+ 'Configuration:',
126
+ configFilePath ? ` Config: ${configFilePath}` : '',
127
+ ` LLM: ${config.llm.provider} / ${config.llm.model}`,
128
+ ` Tool Confirmation: ${styledData.toolConfirmationMode}`,
129
+ ` Sessions: max=${styledData.maxSessions}, ttl=${styledData.sessionTTL}`,
130
+ ` MCP Servers: ${servers.length > 0 ? servers.join(', ') : 'none'}`,
131
+ ` Prompts: ${styledData.promptsCount}`,
132
+ ].filter(Boolean);
133
+ return CommandOutputHelper.styled('config', styledData, fallbackLines.join('\n'));
122
134
  }
123
135
  catch (error) {
124
136
  const errorMsg = `Failed to get configuration: ${error instanceof Error ? error.message : String(error)}`;
125
- logger.error(errorMsg);
137
+ agent.logger.error(errorMsg);
126
138
  return formatForInkCli(`❌ ${errorMsg}`);
127
139
  }
128
140
  },
@@ -132,59 +144,76 @@ export const systemCommands = [
132
144
  description: 'Show system statistics',
133
145
  usage: '/stats',
134
146
  category: 'System',
135
- handler: async (_args, agent) => {
147
+ handler: async (_args, agent, ctx) => {
136
148
  try {
137
- // Build output string
138
- const outputLines = ['\n📊 System Statistics:\n'];
139
149
  // Session stats
140
150
  const sessionStats = await agent.sessionManager.getSessionStats();
141
- outputLines.push('💬 Sessions:');
142
- outputLines.push(` Total Sessions: ${sessionStats.totalSessions.toString()}`);
143
- outputLines.push(` In Memory: ${sessionStats.inMemorySessions.toString()}`);
144
- outputLines.push(` Max Allowed: ${sessionStats.maxSessions.toString()}`);
145
151
  // MCP stats
146
- outputLines.push('\n🔌 MCP Servers:');
147
152
  const connectedServers = agent.getMcpClients().size;
148
153
  const failedConnections = Object.keys(agent.getMcpFailedConnections()).length;
149
- outputLines.push(` Connected: ${connectedServers.toString()}`);
150
- if (failedConnections > 0) {
151
- outputLines.push(` Failed: ${failedConnections.toString()}`);
152
- }
153
154
  // Tools
155
+ let toolCount = 0;
154
156
  try {
155
157
  const tools = await agent.getAllMcpTools();
156
- outputLines.push(` Available Tools: ${Object.keys(tools).length.toString()}`);
158
+ toolCount = Object.keys(tools).length;
157
159
  }
158
160
  catch {
159
- outputLines.push(' Available Tools: Unable to count');
161
+ // Ignore - toolCount stays 0
160
162
  }
161
- const output = outputLines.join('\n') + '\n';
162
- // Log for regular CLI
163
- console.log(chalk.blue('\n📊 System Statistics:\n'));
164
- console.log(chalk.bold('💬 Sessions:'));
165
- console.log(` Total Sessions: ${chalk.cyan(sessionStats.totalSessions.toString())}`);
166
- console.log(` In Memory: ${chalk.cyan(sessionStats.inMemorySessions.toString())}`);
167
- console.log(` Max Allowed: ${chalk.cyan(sessionStats.maxSessions.toString())}`);
168
- console.log(chalk.bold('\n🔌 MCP Servers:'));
169
- console.log(` Connected: ${chalk.green(connectedServers.toString())}`);
170
- if (failedConnections > 0) {
171
- console.log(` Failed: ${chalk.red(failedConnections.toString())}`);
163
+ // Get token usage from current session metadata
164
+ let tokenUsage;
165
+ let estimatedCost;
166
+ if (ctx.sessionId) {
167
+ const sessionMetadata = await agent.sessionManager.getSessionMetadata(ctx.sessionId);
168
+ if (sessionMetadata?.tokenUsage) {
169
+ tokenUsage = sessionMetadata.tokenUsage;
170
+ }
171
+ estimatedCost = sessionMetadata?.estimatedCost;
172
172
  }
173
- try {
174
- const tools = await agent.getAllMcpTools();
175
- console.log(` Available Tools: ${chalk.cyan(Object.keys(tools).length.toString())}`);
173
+ // Build styled data
174
+ const styledData = {
175
+ sessions: {
176
+ total: sessionStats.totalSessions,
177
+ inMemory: sessionStats.inMemorySessions,
178
+ maxAllowed: sessionStats.maxSessions,
179
+ },
180
+ mcp: {
181
+ connected: connectedServers,
182
+ failed: failedConnections,
183
+ toolCount,
184
+ },
185
+ ...(tokenUsage && { tokenUsage }),
186
+ ...(estimatedCost !== undefined && { estimatedCost }),
187
+ };
188
+ // Build fallback text
189
+ const fallbackLines = [
190
+ 'System Statistics:',
191
+ ` Sessions: ${sessionStats.totalSessions} total, ${sessionStats.inMemorySessions} in memory`,
192
+ ` MCP: ${connectedServers} connected, ${toolCount} tools`,
193
+ ];
194
+ if (failedConnections > 0) {
195
+ fallbackLines.push(` Failed connections: ${failedConnections}`);
176
196
  }
177
- catch {
178
- console.log(` Available Tools: ${chalk.dim('Unable to count')}`);
197
+ if (tokenUsage) {
198
+ fallbackLines.push(` Tokens: ${tokenUsage.totalTokens} total (${tokenUsage.inputTokens} in, ${tokenUsage.outputTokens} out)`);
179
199
  }
180
- console.log();
181
- return formatForInkCli(output);
200
+ return CommandOutputHelper.styled('stats', styledData, fallbackLines.join('\n'));
182
201
  }
183
202
  catch (error) {
184
203
  const errorMsg = `Failed to get statistics: ${error instanceof Error ? error.message : String(error)}`;
185
- logger.error(errorMsg);
204
+ agent.logger.error(errorMsg);
186
205
  return formatForInkCli(`❌ ${errorMsg}`);
187
206
  }
188
207
  },
189
208
  },
209
+ {
210
+ name: 'stream',
211
+ description: 'Toggle streaming mode for LLM responses',
212
+ usage: '/stream',
213
+ category: 'System',
214
+ handler: async (_args, _agent, _ctx) => {
215
+ // Overlay is handled via commandOverlays.ts mapping
216
+ return true;
217
+ },
218
+ },
190
219
  ];
@@ -5,7 +5,7 @@
5
5
  * These commands provide functionality for listing and managing MCP tools.
6
6
  *
7
7
  * Available Tool Commands:
8
- * - /tools - List all available MCP tools
8
+ * - /tools - Interactive tool browser
9
9
  */
10
10
  import type { CommandDefinition } from './command-parser.js';
11
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"tool-commands.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/tool-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG7D;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,iBAAiB,EA0E3C,CAAC"}
1
+ {"version":3,"file":"tool-commands.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/tool-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAkB,MAAM,qBAAqB,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,iBAAiB,EAe3C,CAAC"}
@@ -5,77 +5,20 @@
5
5
  * These commands provide functionality for listing and managing MCP tools.
6
6
  *
7
7
  * Available Tool Commands:
8
- * - /tools - List all available MCP tools
8
+ * - /tools - Interactive tool browser
9
9
  */
10
- import chalk from 'chalk';
11
- import { logger } from '@dexto/core';
12
- import { formatForInkCli } from './utils/format-output.js';
13
10
  /**
14
11
  * Tool management commands
15
12
  */
16
13
  export const toolCommands = [
17
14
  {
18
15
  name: 'tools',
19
- description: 'List all available tools (MCP and internal tools)',
16
+ description: 'Browse available tools interactively',
20
17
  usage: '/tools',
21
18
  category: 'Tool Management',
22
- handler: async (args, agent) => {
23
- try {
24
- const allTools = await agent.getAllTools();
25
- const mcpTools = await agent.getAllMcpTools();
26
- const toolEntries = Object.entries(allTools);
27
- if (toolEntries.length === 0) {
28
- const output = '📋 No tools available';
29
- console.log(chalk.yellow(output));
30
- return formatForInkCli(output);
31
- }
32
- // Build output string
33
- const outputLines = [`\n🔧 Available Tools (${toolEntries.length}):\n`];
34
- // Display tools with descriptions and source
35
- for (const [toolName, toolInfo] of toolEntries) {
36
- const description = toolInfo.description || 'No description available';
37
- const isMcpTool = Object.keys(mcpTools).includes(toolName);
38
- // Determine tool source: internal tools take precedence over MCP tools
39
- let source;
40
- if (!isMcpTool && !toolName.startsWith('mcp--')) {
41
- // Non-MCP tool that doesn't have mcp prefix = internal tool
42
- source = '[Internal]';
43
- }
44
- else if (isMcpTool || toolName.startsWith('mcp--')) {
45
- source = '[MCP]';
46
- }
47
- else {
48
- source = '[Unknown]';
49
- }
50
- outputLines.push(` ${toolName} ${source} - ${description}`);
51
- }
52
- outputLines.push('\n💡 Tools are provided by connected MCP servers and internal tools');
53
- const output = outputLines.join('\n');
54
- // Log for regular CLI (with chalk formatting)
55
- console.log(chalk.bold.green(`\n🔧 Available Tools (${toolEntries.length}):\n`));
56
- for (const [toolName, toolInfo] of toolEntries) {
57
- const description = toolInfo.description || 'No description available';
58
- const isMcpTool = Object.keys(mcpTools).includes(toolName);
59
- let source;
60
- if (!isMcpTool && !toolName.startsWith('mcp--')) {
61
- source = chalk.magenta('[Internal]');
62
- }
63
- else if (isMcpTool || toolName.startsWith('mcp--')) {
64
- source = chalk.blue('[MCP]');
65
- }
66
- else {
67
- source = chalk.gray('[Unknown]');
68
- }
69
- console.log(` ${chalk.yellow(toolName)} ${source} - ${chalk.dim(description)}`);
70
- }
71
- console.log(chalk.dim('\n💡 Tools are provided by connected MCP servers and internal tools'));
72
- return formatForInkCli(output);
73
- }
74
- catch (error) {
75
- const errorMsg = `Failed to list tools: ${error instanceof Error ? error.message : String(error)}`;
76
- logger.error(errorMsg);
77
- return formatForInkCli(`❌ ${errorMsg}`);
78
- }
19
+ handler: async (_args, _agent, _ctx) => {
20
+ // Overlay is handled via commandOverlays.ts mapping
21
+ return true;
79
22
  },
80
23
  },
81
24
  ];
@@ -2,43 +2,39 @@
2
2
  * Command Output Helper
3
3
  * Utilities for consistent command output handling across all slash commands
4
4
  */
5
+ import type { StyledOutput } from '../../../ink-cli/services/CommandService.js';
6
+ import type { StyledMessageType, StyledData } from '../../../ink-cli/state/types.js';
5
7
  /**
6
8
  * Command output helper for consistent display and error handling
9
+ * Returns formatted strings for ink-cli to render (no direct console output)
7
10
  */
8
11
  export declare class CommandOutputHelper {
9
12
  /**
10
- * Display success message consistently
11
- * Logs to console with color and returns formatted string for ink-cli
13
+ * Format success message for ink-cli to display
12
14
  */
13
15
  static success(message: string): string;
14
16
  /**
15
- * Display info message consistently
16
- * Logs to console with color and returns formatted string for ink-cli
17
+ * Format info message for ink-cli to display
17
18
  */
18
19
  static info(message: string): string;
19
20
  /**
20
- * Display warning message consistently
21
- * Logs to console with color and returns formatted string for ink-cli
21
+ * Format warning message for ink-cli to display
22
22
  */
23
23
  static warning(message: string): string;
24
24
  /**
25
- * Handle errors consistently across all commands
26
- * Logs error and returns formatted error string
25
+ * Format error message for ink-cli to display
27
26
  */
28
27
  static error(error: unknown, context?: string): string;
29
28
  /**
30
- * Build multi-line output with consistent formatting
31
- * Logs to console and returns formatted string for ink-cli
29
+ * Format multi-line output for ink-cli to display
32
30
  */
33
31
  static output(lines: string[]): string;
34
32
  /**
35
- * Validate required argument and return error if missing
36
- * Returns null if valid, error string if invalid
33
+ * Create styled output for rich rendering in ink-cli
34
+ * @param styledType - The type of styled rendering
35
+ * @param styledData - The structured data for rendering
36
+ * @param fallbackText - Plain text fallback for logging/non-ink environments
37
37
  */
38
- static validateRequiredArg(args: string[], index: number, argName: string, usage: string): string | null;
39
- /**
40
- * No output (command executed successfully with no output to display)
41
- */
42
- static noOutput(): string;
38
+ static styled(styledType: StyledMessageType, styledData: StyledData, fallbackText: string): StyledOutput;
43
39
  }
44
40
  //# sourceMappingURL=command-output.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-output.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/interactive-commands/utils/command-output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;GAEG;AACH,qBAAa,mBAAmB;IAC5B;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAKvC;;;OAGG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAKpC;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAKvC;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM;IAStD;;;OAGG;IACH,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAMtC;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CACtB,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACd,MAAM,GAAG,IAAI;IAUhB;;OAEG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAG5B"}
1
+ {"version":3,"file":"command-output.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/interactive-commands/utils/command-output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAErF;;;GAGG;AACH,qBAAa,mBAAmB;IAC5B;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAIvC;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAIpC;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAIvC;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM;IAMtD;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAItC;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CACT,UAAU,EAAE,iBAAiB,EAC7B,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,MAAM,GACrB,YAAY;CAOlB"}
@@ -2,74 +2,55 @@
2
2
  * Command Output Helper
3
3
  * Utilities for consistent command output handling across all slash commands
4
4
  */
5
- import chalk from 'chalk';
6
- import { logger } from '@dexto/core';
7
5
  import { formatForInkCli } from './format-output.js';
8
6
  /**
9
7
  * Command output helper for consistent display and error handling
8
+ * Returns formatted strings for ink-cli to render (no direct console output)
10
9
  */
11
10
  export class CommandOutputHelper {
12
11
  /**
13
- * Display success message consistently
14
- * Logs to console with color and returns formatted string for ink-cli
12
+ * Format success message for ink-cli to display
15
13
  */
16
14
  static success(message) {
17
- console.log(chalk.green(message));
18
15
  return formatForInkCli(message);
19
16
  }
20
17
  /**
21
- * Display info message consistently
22
- * Logs to console with color and returns formatted string for ink-cli
18
+ * Format info message for ink-cli to display
23
19
  */
24
20
  static info(message) {
25
- console.log(chalk.blue(message));
26
21
  return formatForInkCli(message);
27
22
  }
28
23
  /**
29
- * Display warning message consistently
30
- * Logs to console with color and returns formatted string for ink-cli
24
+ * Format warning message for ink-cli to display
31
25
  */
32
26
  static warning(message) {
33
- console.log(chalk.yellow(message));
34
- return formatForInkCli(message);
27
+ return formatForInkCli(`⚠️ ${message}`);
35
28
  }
36
29
  /**
37
- * Handle errors consistently across all commands
38
- * Logs error and returns formatted error string
30
+ * Format error message for ink-cli to display
39
31
  */
40
32
  static error(error, context) {
41
33
  const errorMessage = error instanceof Error ? error.message : String(error);
42
34
  const fullMessage = context ? `❌ ${context}: ${errorMessage}` : `❌ ${errorMessage}`;
43
- logger.error(fullMessage);
44
- console.error(chalk.red(fullMessage));
45
35
  return formatForInkCli(fullMessage);
46
36
  }
47
37
  /**
48
- * Build multi-line output with consistent formatting
49
- * Logs to console and returns formatted string for ink-cli
38
+ * Format multi-line output for ink-cli to display
50
39
  */
51
40
  static output(lines) {
52
- const output = lines.join('\n');
53
- console.log(output);
54
- return formatForInkCli(output);
55
- }
56
- /**
57
- * Validate required argument and return error if missing
58
- * Returns null if valid, error string if invalid
59
- */
60
- static validateRequiredArg(args, index, argName, usage) {
61
- if (args.length <= index || !args[index]) {
62
- const errorMsg = `❌ ${argName} is required\nUsage: ${usage}`;
63
- console.error(chalk.red(`❌ ${argName} is required`));
64
- console.error(chalk.dim(`Usage: ${usage}`));
65
- return formatForInkCli(errorMsg);
66
- }
67
- return null;
41
+ return formatForInkCli(lines.join('\n'));
68
42
  }
69
43
  /**
70
- * No output (command executed successfully with no output to display)
44
+ * Create styled output for rich rendering in ink-cli
45
+ * @param styledType - The type of styled rendering
46
+ * @param styledData - The structured data for rendering
47
+ * @param fallbackText - Plain text fallback for logging/non-ink environments
71
48
  */
72
- static noOutput() {
73
- return '';
49
+ static styled(styledType, styledData, fallbackText) {
50
+ return {
51
+ styledType,
52
+ styledData,
53
+ fallbackText: formatForInkCli(fallbackText),
54
+ };
74
55
  }
75
56
  }
@@ -5,12 +5,12 @@ declare const ListAgentsCommandSchema: z.ZodObject<{
5
5
  available: z.ZodDefault<z.ZodBoolean>;
6
6
  }, "strict", z.ZodTypeAny, {
7
7
  installed: boolean;
8
- available: boolean;
9
8
  verbose: boolean;
9
+ available: boolean;
10
10
  }, {
11
11
  installed?: boolean | undefined;
12
- available?: boolean | undefined;
13
12
  verbose?: boolean | undefined;
13
+ available?: boolean | undefined;
14
14
  }>;
15
15
  export type ListAgentsCommandOptions = z.output<typeof ListAgentsCommandSchema>;
16
16
  export type ListAgentsCommandOptionsInput = z.input<typeof ListAgentsCommandSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"list-agents.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/list-agents.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,QAAA,MAAM,uBAAuB;;;;;;;;;;;;EAMhB,CAAC;AAEd,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAChF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AA0HpF;;GAEG;AACH,wBAAsB,uBAAuB,CACzC,OAAO,EAAE,6BAA6B,GACvC,OAAO,CAAC,IAAI,CAAC,CAiIf"}
1
+ {"version":3,"file":"list-agents.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/list-agents.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,QAAA,MAAM,uBAAuB;;;;;;;;;;;;EAMhB,CAAC;AAEd,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAChF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAiIpF;;GAEG;AACH,wBAAsB,uBAAuB,CACzC,OAAO,EAAE,6BAA6B,GACvC,OAAO,CAAC,IAAI,CAAC,CAiIf"}
@@ -4,7 +4,7 @@ import { promises as fs } from 'fs';
4
4
  import path from 'path';
5
5
  import chalk from 'chalk';
6
6
  import { z } from 'zod';
7
- import { getAgentRegistry, getDextoGlobalPath, globalPreferencesExist, loadGlobalPreferences, } from '@dexto/agent-management';
7
+ import { getDextoGlobalPath, globalPreferencesExist, loadGlobalPreferences, loadBundledRegistryAgents, } from '@dexto/agent-management';
8
8
  // Zod schema for list-agents command validation
9
9
  const ListAgentsCommandSchema = z
10
10
  .object({
@@ -21,41 +21,46 @@ async function getInstalledAgents() {
21
21
  if (!existsSync(globalAgentsDir)) {
22
22
  return [];
23
23
  }
24
- const registry = getAgentRegistry();
24
+ const bundledRegistry = loadBundledRegistryAgents();
25
25
  const installedAgents = [];
26
26
  try {
27
27
  const entries = await fs.readdir(globalAgentsDir, { withFileTypes: true });
28
28
  for (const entry of entries) {
29
- if (entry.isDirectory() || entry.name.endsWith('.yml')) {
30
- const agentName = entry.isDirectory()
31
- ? entry.name
32
- : path.basename(entry.name, '.yml');
29
+ // Skip registry.json and temp files
30
+ if (entry.name === 'registry.json' || entry.name.includes('.tmp.')) {
31
+ continue;
32
+ }
33
+ if (entry.isDirectory()) {
34
+ const agentName = entry.name;
33
35
  const agentPath = path.join(globalAgentsDir, entry.name);
34
36
  try {
35
- // Try to resolve main config to get metadata
36
- const mainConfigPath = entry.isDirectory()
37
- ? registry.resolveMainConfig(agentPath, agentName)
38
- : agentPath;
39
- // Get install date from directory/file stats
37
+ // For directory agents, try to find main config
38
+ // Check bundled registry for main field, default to agent.yml
39
+ const bundledEntry = bundledRegistry[agentName];
40
+ const mainFile = bundledEntry?.main || 'agent.yml';
41
+ const mainConfigPath = path.join(agentPath, mainFile);
42
+ // If main config doesn't exist, skip
43
+ if (!existsSync(mainConfigPath)) {
44
+ console.warn(`Warning: Could not find main config for agent '${agentName}' at ${mainConfigPath}`);
45
+ continue;
46
+ }
47
+ // Get install date from directory stats
40
48
  const stats = await fs.stat(agentPath);
41
49
  // Try to extract LLM info from config
42
50
  let llmProvider;
43
51
  let llmModel;
44
- if (existsSync(mainConfigPath)) {
45
- try {
46
- const configContent = await fs.readFile(mainConfigPath, 'utf-8');
47
- const configMatch = configContent.match(/provider:\s*([^\n\r]+)/);
48
- const modelMatch = configContent.match(/model:\s*([^\n\r]+)/);
49
- llmProvider = configMatch?.[1]?.trim();
50
- llmModel = modelMatch?.[1]?.trim();
51
- }
52
- catch (_error) {
53
- // Ignore config parsing errors
54
- }
52
+ try {
53
+ const configContent = await fs.readFile(mainConfigPath, 'utf-8');
54
+ const configMatch = configContent.match(/provider:\s*([^\n\r]+)/);
55
+ const modelMatch = configContent.match(/model:\s*([^\n\r]+)/);
56
+ llmProvider = configMatch?.[1]?.trim();
57
+ llmModel = modelMatch?.[1]?.trim();
58
+ }
59
+ catch (_error) {
60
+ // Ignore config parsing errors
55
61
  }
56
- // Get description from registry if available
57
- const registryData = registry.getAvailableAgents()[agentName];
58
- const description = registryData?.description || 'Custom agent';
62
+ // Get description from bundled registry if available
63
+ const description = bundledEntry?.description || 'Custom agent';
59
64
  const agentInfo = {
60
65
  name: agentName,
61
66
  description,
@@ -85,15 +90,14 @@ async function getInstalledAgents() {
85
90
  * Get information about available agents from registry
86
91
  */
87
92
  function getAvailableAgents() {
88
- const registry = getAgentRegistry();
89
- const availableAgents = registry.getAvailableAgents();
90
- return Object.entries(availableAgents)
93
+ const bundledRegistry = loadBundledRegistryAgents();
94
+ return Object.entries(bundledRegistry)
91
95
  .map(([name, data]) => ({
92
96
  name,
93
- description: data.description,
94
- author: data.author,
95
- tags: data.tags,
96
- type: data.type,
97
+ description: data.description || 'No description',
98
+ author: data.author || 'Unknown',
99
+ tags: data.tags || [],
100
+ type: 'builtin',
97
101
  }))
98
102
  .sort((a, b) => a.name.localeCompare(b.name));
99
103
  }
@@ -1 +1 @@
1
- {"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/uninstall.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,QAAA,MAAM,sBAAsB;;;;;;;;;;;;EAMf,CAAC;AAEd,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAgC9E,wBAAsB,sBAAsB,CACxC,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,EAAE,OAAO,CAAC,uBAAuB,CAAC,GAC1C,OAAO,CAAC,IAAI,CAAC,CA+Gf"}
1
+ {"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/uninstall.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,QAAA,MAAM,sBAAsB;;;;;;;;;;;;EAMf,CAAC;AAEd,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AA+B9E,wBAAsB,sBAAsB,CACxC,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,EAAE,OAAO,CAAC,uBAAuB,CAAC,GAC1C,OAAO,CAAC,IAAI,CAAC,CA8Gf"}