dexto 1.3.0 → 1.5.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 (494) hide show
  1. package/README.md +87 -22
  2. package/dist/agents/agent-registry.json +9 -0
  3. package/dist/agents/agent-template.yml +2 -2
  4. package/dist/agents/coding-agent/coding-agent.yml +27 -16
  5. package/dist/agents/database-agent/database-agent.yml +2 -2
  6. package/dist/agents/default-agent.yml +9 -7
  7. package/dist/agents/github-agent/github-agent.yml +2 -2
  8. package/dist/agents/product-name-researcher/product-name-researcher.yml +2 -2
  9. package/dist/agents/talk2pdf-agent/talk2pdf-agent.yml +2 -2
  10. package/dist/analytics/events.d.ts +13 -6
  11. package/dist/analytics/events.d.ts.map +1 -1
  12. package/dist/analytics/index.d.ts +1 -1
  13. package/dist/analytics/index.d.ts.map +1 -1
  14. package/dist/analytics/index.js +6 -2
  15. package/dist/api/server-hono.d.ts.map +1 -1
  16. package/dist/api/server-hono.js +65 -9
  17. package/dist/cli/cli-subscriber.d.ts +4 -0
  18. package/dist/cli/cli-subscriber.d.ts.map +1 -1
  19. package/dist/cli/cli-subscriber.js +47 -3
  20. package/dist/cli/commands/create-app.d.ts +16 -14
  21. package/dist/cli/commands/create-app.d.ts.map +1 -1
  22. package/dist/cli/commands/create-app.js +626 -102
  23. package/dist/cli/commands/create-image.d.ts +7 -0
  24. package/dist/cli/commands/create-image.d.ts.map +1 -0
  25. package/dist/cli/commands/create-image.js +201 -0
  26. package/dist/cli/commands/helpers/formatters.d.ts.map +1 -1
  27. package/dist/cli/commands/helpers/formatters.js +9 -8
  28. package/dist/cli/commands/index.d.ts +2 -1
  29. package/dist/cli/commands/index.d.ts.map +1 -1
  30. package/dist/cli/commands/index.js +2 -1
  31. package/dist/cli/commands/init-app.js +7 -7
  32. package/dist/cli/commands/install.d.ts +0 -3
  33. package/dist/cli/commands/install.d.ts.map +1 -1
  34. package/dist/cli/commands/install.js +19 -70
  35. package/dist/cli/commands/interactive-commands/command-parser.d.ts +17 -14
  36. package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +1 -1
  37. package/dist/cli/commands/interactive-commands/command-parser.js +7 -22
  38. package/dist/cli/commands/interactive-commands/commands.d.ts +4 -4
  39. package/dist/cli/commands/interactive-commands/commands.d.ts.map +1 -1
  40. package/dist/cli/commands/interactive-commands/commands.js +34 -42
  41. package/dist/cli/commands/interactive-commands/documentation-commands.d.ts.map +1 -1
  42. package/dist/cli/commands/interactive-commands/documentation-commands.js +4 -7
  43. package/dist/cli/commands/interactive-commands/general-commands.d.ts.map +1 -1
  44. package/dist/cli/commands/interactive-commands/general-commands.js +159 -117
  45. package/dist/cli/commands/interactive-commands/mcp/index.d.ts +9 -3
  46. package/dist/cli/commands/interactive-commands/mcp/index.d.ts.map +1 -1
  47. package/dist/cli/commands/interactive-commands/mcp/index.js +18 -3
  48. package/dist/cli/commands/interactive-commands/model/index.d.ts +8 -6
  49. package/dist/cli/commands/interactive-commands/model/index.d.ts.map +1 -1
  50. package/dist/cli/commands/interactive-commands/model/index.js +18 -6
  51. package/dist/cli/commands/interactive-commands/prompt-commands.d.ts +3 -2
  52. package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +1 -1
  53. package/dist/cli/commands/interactive-commands/prompt-commands.js +77 -60
  54. package/dist/cli/commands/interactive-commands/session/index.d.ts +7 -12
  55. package/dist/cli/commands/interactive-commands/session/index.d.ts.map +1 -1
  56. package/dist/cli/commands/interactive-commands/session/index.js +7 -14
  57. package/dist/cli/commands/interactive-commands/session/session-commands.d.ts +10 -24
  58. package/dist/cli/commands/interactive-commands/session/session-commands.d.ts.map +1 -1
  59. package/dist/cli/commands/interactive-commands/session/session-commands.js +16 -371
  60. package/dist/cli/commands/interactive-commands/system/system-commands.d.ts +1 -0
  61. package/dist/cli/commands/interactive-commands/system/system-commands.d.ts.map +1 -1
  62. package/dist/cli/commands/interactive-commands/system/system-commands.js +106 -77
  63. package/dist/cli/commands/interactive-commands/tool-commands.d.ts +1 -1
  64. package/dist/cli/commands/interactive-commands/tool-commands.d.ts.map +1 -1
  65. package/dist/cli/commands/interactive-commands/tool-commands.js +5 -62
  66. package/dist/cli/commands/interactive-commands/utils/command-output.d.ts +13 -17
  67. package/dist/cli/commands/interactive-commands/utils/command-output.d.ts.map +1 -1
  68. package/dist/cli/commands/interactive-commands/utils/command-output.js +18 -37
  69. package/dist/cli/commands/list-agents.d.ts +2 -2
  70. package/dist/cli/commands/list-agents.d.ts.map +1 -1
  71. package/dist/cli/commands/list-agents.js +38 -34
  72. package/dist/cli/commands/session-commands.js +16 -16
  73. package/dist/cli/commands/setup.d.ts +13 -5
  74. package/dist/cli/commands/setup.d.ts.map +1 -1
  75. package/dist/cli/commands/setup.js +860 -65
  76. package/dist/cli/commands/uninstall.d.ts.map +1 -1
  77. package/dist/cli/commands/uninstall.js +4 -6
  78. package/dist/cli/commands/which.d.ts.map +1 -1
  79. package/dist/cli/commands/which.js +18 -4
  80. package/dist/cli/ink-cli/InkCLIRefactored.d.ts +9 -22
  81. package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +1 -1
  82. package/dist/cli/ink-cli/InkCLIRefactored.js +50 -133
  83. package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +26 -3
  84. package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
  85. package/dist/cli/ink-cli/components/ApprovalPrompt.js +182 -45
  86. package/dist/cli/ink-cli/components/CustomInput.js +1 -1
  87. package/dist/cli/ink-cli/components/EditableMultiLineInput.js +4 -4
  88. package/dist/cli/ink-cli/components/ElicitationForm.d.ts +22 -0
  89. package/dist/cli/ink-cli/components/ElicitationForm.d.ts.map +1 -0
  90. package/dist/cli/ink-cli/components/ElicitationForm.js +358 -0
  91. package/dist/cli/ink-cli/components/ErrorBoundary.d.ts.map +1 -1
  92. package/dist/cli/ink-cli/components/ErrorBoundary.js +1 -1
  93. package/dist/cli/ink-cli/components/Footer.d.ts +16 -0
  94. package/dist/cli/ink-cli/components/Footer.d.ts.map +1 -0
  95. package/dist/cli/ink-cli/components/Footer.js +27 -0
  96. package/dist/cli/ink-cli/components/HistorySearchBar.d.ts +17 -0
  97. package/dist/cli/ink-cli/components/HistorySearchBar.d.ts.map +1 -0
  98. package/dist/cli/ink-cli/components/HistorySearchBar.js +8 -0
  99. package/dist/cli/ink-cli/components/MultiLineInput.d.ts.map +1 -1
  100. package/dist/cli/ink-cli/components/MultiLineInput.js +3 -3
  101. package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts +15 -2
  102. package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts.map +1 -1
  103. package/dist/cli/ink-cli/components/ResourceAutocomplete.js +126 -82
  104. package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts +15 -2
  105. package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts.map +1 -1
  106. package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +228 -122
  107. package/dist/cli/ink-cli/components/StatusBar.d.ts +15 -2
  108. package/dist/cli/ink-cli/components/StatusBar.d.ts.map +1 -1
  109. package/dist/cli/ink-cli/components/StatusBar.js +50 -10
  110. package/dist/cli/ink-cli/components/TextBufferInput.d.ts +52 -0
  111. package/dist/cli/ink-cli/components/TextBufferInput.d.ts.map +1 -0
  112. package/dist/cli/ink-cli/components/TextBufferInput.js +471 -0
  113. package/dist/cli/ink-cli/components/base/BaseAutocomplete.js +4 -4
  114. package/dist/cli/ink-cli/components/base/BaseSelector.d.ts +11 -1
  115. package/dist/cli/ink-cli/components/base/BaseSelector.d.ts.map +1 -1
  116. package/dist/cli/ink-cli/components/base/BaseSelector.js +90 -49
  117. package/dist/cli/ink-cli/components/chat/Footer.js +1 -1
  118. package/dist/cli/ink-cli/components/chat/Header.d.ts +1 -0
  119. package/dist/cli/ink-cli/components/chat/Header.d.ts.map +1 -1
  120. package/dist/cli/ink-cli/components/chat/Header.js +6 -3
  121. package/dist/cli/ink-cli/components/chat/MessageItem.d.ts +3 -0
  122. package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +1 -1
  123. package/dist/cli/ink-cli/components/chat/MessageItem.js +95 -9
  124. package/dist/cli/ink-cli/components/chat/MessageList.js +1 -1
  125. package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.d.ts +16 -0
  126. package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.d.ts.map +1 -0
  127. package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.js +27 -0
  128. package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts +5 -3
  129. package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts.map +1 -1
  130. package/dist/cli/ink-cli/components/chat/ToolIcon.js +21 -7
  131. package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.d.ts +10 -0
  132. package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.d.ts.map +1 -0
  133. package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.js +6 -0
  134. package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.d.ts +10 -0
  135. package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.d.ts.map +1 -0
  136. package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.js +15 -0
  137. package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts +10 -0
  138. package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts.map +1 -0
  139. package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.js +9 -0
  140. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.d.ts +10 -0
  141. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.d.ts.map +1 -0
  142. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.js +37 -0
  143. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.d.ts +10 -0
  144. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.d.ts.map +1 -0
  145. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.js +9 -0
  146. package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.d.ts +10 -0
  147. package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.d.ts.map +1 -0
  148. package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.js +6 -0
  149. package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.d.ts +10 -0
  150. package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.d.ts.map +1 -0
  151. package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.js +29 -0
  152. package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.d.ts +45 -0
  153. package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.d.ts.map +1 -0
  154. package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.js +38 -0
  155. package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.d.ts +10 -0
  156. package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.d.ts.map +1 -0
  157. package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.js +6 -0
  158. package/dist/cli/ink-cli/components/chat/styled-boxes/index.d.ts +13 -0
  159. package/dist/cli/ink-cli/components/chat/styled-boxes/index.d.ts.map +1 -0
  160. package/dist/cli/ink-cli/components/chat/styled-boxes/index.js +12 -0
  161. package/dist/cli/ink-cli/components/input/InputArea.d.ts +36 -8
  162. package/dist/cli/ink-cli/components/input/InputArea.d.ts.map +1 -1
  163. package/dist/cli/ink-cli/components/input/InputArea.js +3 -3
  164. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts +25 -0
  165. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +1 -0
  166. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +166 -0
  167. package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts +27 -0
  168. package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +1 -0
  169. package/dist/cli/ink-cli/components/modes/StaticCLI.js +95 -0
  170. package/dist/cli/ink-cli/components/modes/index.d.ts +10 -0
  171. package/dist/cli/ink-cli/components/modes/index.d.ts.map +1 -0
  172. package/dist/cli/ink-cli/components/modes/index.js +9 -0
  173. package/dist/cli/ink-cli/components/overlays/ApiKeyInput.d.ts +26 -0
  174. package/dist/cli/ink-cli/components/overlays/ApiKeyInput.d.ts.map +1 -0
  175. package/dist/cli/ink-cli/components/overlays/ApiKeyInput.js +92 -0
  176. package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts +29 -0
  177. package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts.map +1 -0
  178. package/dist/cli/ink-cli/components/overlays/CustomModelWizard.js +286 -0
  179. package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts +22 -0
  180. package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts.map +1 -0
  181. package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +59 -0
  182. package/dist/cli/ink-cli/components/overlays/McpAddChoice.d.ts +22 -0
  183. package/dist/cli/ink-cli/components/overlays/McpAddChoice.d.ts.map +1 -0
  184. package/dist/cli/ink-cli/components/overlays/McpAddChoice.js +59 -0
  185. package/dist/cli/ink-cli/components/overlays/McpAddSelector.d.ts +26 -0
  186. package/dist/cli/ink-cli/components/overlays/McpAddSelector.d.ts.map +1 -0
  187. package/dist/cli/ink-cli/components/overlays/McpAddSelector.js +73 -0
  188. package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.d.ts +21 -0
  189. package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.d.ts.map +1 -0
  190. package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.js +51 -0
  191. package/dist/cli/ink-cli/components/overlays/McpCustomWizard.d.ts +29 -0
  192. package/dist/cli/ink-cli/components/overlays/McpCustomWizard.d.ts.map +1 -0
  193. package/dist/cli/ink-cli/components/overlays/McpCustomWizard.js +215 -0
  194. package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts +22 -0
  195. package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts.map +1 -0
  196. package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.js +74 -0
  197. package/dist/cli/ink-cli/components/overlays/McpSelector.d.ts +21 -0
  198. package/dist/cli/ink-cli/components/overlays/McpSelector.d.ts.map +1 -0
  199. package/dist/cli/ink-cli/components/overlays/McpSelector.js +52 -0
  200. package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts +28 -0
  201. package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts.map +1 -0
  202. package/dist/cli/ink-cli/components/overlays/McpServerActions.js +84 -0
  203. package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts +29 -0
  204. package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts.map +1 -0
  205. package/dist/cli/ink-cli/components/overlays/McpServerList.js +109 -0
  206. package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts +15 -8
  207. package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
  208. package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +400 -23
  209. package/dist/cli/ink-cli/components/overlays/PromptAddChoice.d.ts +22 -0
  210. package/dist/cli/ink-cli/components/overlays/PromptAddChoice.d.ts.map +1 -0
  211. package/dist/cli/ink-cli/components/overlays/PromptAddChoice.js +52 -0
  212. package/dist/cli/ink-cli/components/overlays/PromptAddWizard.d.ts +29 -0
  213. package/dist/cli/ink-cli/components/overlays/PromptAddWizard.d.ts.map +1 -0
  214. package/dist/cli/ink-cli/components/overlays/PromptAddWizard.js +166 -0
  215. package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.d.ts +27 -0
  216. package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.d.ts.map +1 -0
  217. package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.js +119 -0
  218. package/dist/cli/ink-cli/components/overlays/PromptList.d.ts +33 -0
  219. package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +1 -0
  220. package/dist/cli/ink-cli/components/overlays/PromptList.js +144 -0
  221. package/dist/cli/ink-cli/components/overlays/SearchOverlay.d.ts +23 -0
  222. package/dist/cli/ink-cli/components/overlays/SearchOverlay.d.ts.map +1 -0
  223. package/dist/cli/ink-cli/components/overlays/SearchOverlay.js +189 -0
  224. package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.d.ts +7 -2
  225. package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.d.ts.map +1 -1
  226. package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.js +19 -5
  227. package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.d.ts +21 -0
  228. package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.d.ts.map +1 -0
  229. package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.js +42 -0
  230. package/dist/cli/ink-cli/components/overlays/StreamSelector.d.ts +20 -0
  231. package/dist/cli/ink-cli/components/overlays/StreamSelector.d.ts.map +1 -0
  232. package/dist/cli/ink-cli/components/overlays/StreamSelector.js +58 -0
  233. package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts +25 -0
  234. package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts.map +1 -0
  235. package/dist/cli/ink-cli/components/overlays/ToolBrowser.js +400 -0
  236. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.d.ts +25 -0
  237. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.d.ts.map +1 -0
  238. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.js +609 -0
  239. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/index.d.ts +15 -0
  240. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/index.d.ts.map +1 -0
  241. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/index.js +14 -0
  242. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts +33 -0
  243. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts.map +1 -0
  244. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.js +419 -0
  245. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ApiKeyStep.d.ts +25 -0
  246. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ApiKeyStep.d.ts.map +1 -0
  247. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ApiKeyStep.js +29 -0
  248. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ProviderSelector.d.ts +17 -0
  249. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ProviderSelector.d.ts.map +1 -0
  250. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ProviderSelector.js +11 -0
  251. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/SetupInfoBanner.d.ts +20 -0
  252. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/SetupInfoBanner.d.ts.map +1 -0
  253. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/SetupInfoBanner.js +10 -0
  254. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/WizardStepInput.d.ts +30 -0
  255. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/WizardStepInput.d.ts.map +1 -0
  256. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/WizardStepInput.js +13 -0
  257. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/index.d.ts +8 -0
  258. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/index.d.ts.map +1 -0
  259. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/index.js +7 -0
  260. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/types.d.ts +79 -0
  261. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/types.d.ts.map +1 -0
  262. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/types.js +38 -0
  263. package/dist/cli/ink-cli/components/renderers/DiffRenderer.d.ts +21 -0
  264. package/dist/cli/ink-cli/components/renderers/DiffRenderer.d.ts.map +1 -0
  265. package/dist/cli/ink-cli/components/renderers/DiffRenderer.js +65 -0
  266. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts +28 -0
  267. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts.map +1 -0
  268. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +66 -0
  269. package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts +19 -0
  270. package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts.map +1 -0
  271. package/dist/cli/ink-cli/components/renderers/FileRenderer.js +26 -0
  272. package/dist/cli/ink-cli/components/renderers/GenericRenderer.d.ts +21 -0
  273. package/dist/cli/ink-cli/components/renderers/GenericRenderer.d.ts.map +1 -0
  274. package/dist/cli/ink-cli/components/renderers/GenericRenderer.js +26 -0
  275. package/dist/cli/ink-cli/components/renderers/SearchRenderer.d.ts +20 -0
  276. package/dist/cli/ink-cli/components/renderers/SearchRenderer.d.ts.map +1 -0
  277. package/dist/cli/ink-cli/components/renderers/SearchRenderer.js +12 -0
  278. package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts +21 -0
  279. package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts.map +1 -0
  280. package/dist/cli/ink-cli/components/renderers/ShellRenderer.js +25 -0
  281. package/dist/cli/ink-cli/components/renderers/diff-shared.d.ts +61 -0
  282. package/dist/cli/ink-cli/components/renderers/diff-shared.d.ts.map +1 -0
  283. package/dist/cli/ink-cli/components/renderers/diff-shared.js +158 -0
  284. package/dist/cli/ink-cli/components/renderers/index.d.ts +28 -0
  285. package/dist/cli/ink-cli/components/renderers/index.d.ts.map +1 -0
  286. package/dist/cli/ink-cli/components/renderers/index.js +36 -0
  287. package/dist/cli/ink-cli/components/shared/MarkdownText.d.ts +38 -0
  288. package/dist/cli/ink-cli/components/shared/MarkdownText.d.ts.map +1 -0
  289. package/dist/cli/ink-cli/components/shared/MarkdownText.js +362 -0
  290. package/dist/cli/ink-cli/components/shared/VirtualizedList.d.ts +44 -0
  291. package/dist/cli/ink-cli/components/shared/VirtualizedList.d.ts.map +1 -0
  292. package/dist/cli/ink-cli/components/shared/VirtualizedList.js +300 -0
  293. package/dist/cli/ink-cli/components/shared/text-buffer.d.ts +185 -0
  294. package/dist/cli/ink-cli/components/shared/text-buffer.d.ts.map +1 -0
  295. package/dist/cli/ink-cli/components/shared/text-buffer.js +1338 -0
  296. package/dist/cli/ink-cli/constants/processingPhrases.d.ts +10 -0
  297. package/dist/cli/ink-cli/constants/processingPhrases.d.ts.map +1 -0
  298. package/dist/cli/ink-cli/constants/processingPhrases.js +64 -0
  299. package/dist/cli/ink-cli/constants/tips.d.ts +15 -0
  300. package/dist/cli/ink-cli/constants/tips.d.ts.map +1 -0
  301. package/dist/cli/ink-cli/constants/tips.js +53 -0
  302. package/dist/cli/ink-cli/containers/InputContainer.d.ts +42 -8
  303. package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +1 -1
  304. package/dist/cli/ink-cli/containers/InputContainer.js +513 -85
  305. package/dist/cli/ink-cli/containers/OverlayContainer.d.ts +23 -5
  306. package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +1 -1
  307. package/dist/cli/ink-cli/containers/OverlayContainer.js +1214 -132
  308. package/dist/cli/ink-cli/containers/index.d.ts +1 -1
  309. package/dist/cli/ink-cli/containers/index.d.ts.map +1 -1
  310. package/dist/cli/ink-cli/contexts/KeypressContext.d.ts +36 -0
  311. package/dist/cli/ink-cli/contexts/KeypressContext.d.ts.map +1 -0
  312. package/dist/cli/ink-cli/contexts/KeypressContext.js +461 -0
  313. package/dist/cli/ink-cli/contexts/MouseContext.d.ts +27 -0
  314. package/dist/cli/ink-cli/contexts/MouseContext.d.ts.map +1 -0
  315. package/dist/cli/ink-cli/contexts/MouseContext.js +102 -0
  316. package/dist/cli/ink-cli/contexts/ScrollProvider.d.ts +33 -0
  317. package/dist/cli/ink-cli/contexts/ScrollProvider.d.ts.map +1 -0
  318. package/dist/cli/ink-cli/contexts/ScrollProvider.js +170 -0
  319. package/dist/cli/ink-cli/contexts/index.d.ts +7 -0
  320. package/dist/cli/ink-cli/contexts/index.d.ts.map +1 -0
  321. package/dist/cli/ink-cli/contexts/index.js +6 -0
  322. package/dist/cli/ink-cli/hooks/index.d.ts +5 -0
  323. package/dist/cli/ink-cli/hooks/index.d.ts.map +1 -1
  324. package/dist/cli/ink-cli/hooks/index.js +6 -1
  325. package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts +26 -9
  326. package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts.map +1 -1
  327. package/dist/cli/ink-cli/hooks/useAgentEvents.js +90 -198
  328. package/dist/cli/ink-cli/hooks/useBatchedScroll.d.ts +14 -0
  329. package/dist/cli/ink-cli/hooks/useBatchedScroll.d.ts.map +1 -0
  330. package/dist/cli/ink-cli/hooks/useBatchedScroll.js +25 -0
  331. package/dist/cli/ink-cli/hooks/useCLIState.d.ts +50 -0
  332. package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +1 -0
  333. package/dist/cli/ink-cli/hooks/useCLIState.js +190 -0
  334. package/dist/cli/ink-cli/hooks/useElapsedTime.d.ts +24 -0
  335. package/dist/cli/ink-cli/hooks/useElapsedTime.d.ts.map +1 -0
  336. package/dist/cli/ink-cli/hooks/useElapsedTime.js +69 -0
  337. package/dist/cli/ink-cli/hooks/useHistorySearch.d.ts +61 -0
  338. package/dist/cli/ink-cli/hooks/useHistorySearch.d.ts.map +1 -0
  339. package/dist/cli/ink-cli/hooks/useHistorySearch.js +210 -0
  340. package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts +136 -0
  341. package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts.map +1 -0
  342. package/dist/cli/ink-cli/hooks/useInputOrchestrator.js +663 -0
  343. package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.d.ts.map +1 -1
  344. package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.js +7 -26
  345. package/dist/cli/ink-cli/hooks/useKeypress.d.ts +18 -0
  346. package/dist/cli/ink-cli/hooks/useKeypress.d.ts.map +1 -0
  347. package/dist/cli/ink-cli/hooks/useKeypress.js +26 -0
  348. package/dist/cli/ink-cli/hooks/usePhraseCycler.d.ts +30 -0
  349. package/dist/cli/ink-cli/hooks/usePhraseCycler.d.ts.map +1 -0
  350. package/dist/cli/ink-cli/hooks/usePhraseCycler.js +68 -0
  351. package/dist/cli/ink-cli/hooks/useStreaming.d.ts +19 -0
  352. package/dist/cli/ink-cli/hooks/useStreaming.d.ts.map +1 -0
  353. package/dist/cli/ink-cli/hooks/useStreaming.js +26 -0
  354. package/dist/cli/ink-cli/hooks/useTerminalSize.d.ts +14 -0
  355. package/dist/cli/ink-cli/hooks/useTerminalSize.d.ts.map +1 -0
  356. package/dist/cli/ink-cli/hooks/useTerminalSize.js +31 -0
  357. package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts +42 -0
  358. package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts.map +1 -0
  359. package/dist/cli/ink-cli/hooks/useTokenCounter.js +96 -0
  360. package/dist/cli/ink-cli/services/CommandService.d.ts +32 -1
  361. package/dist/cli/ink-cli/services/CommandService.d.ts.map +1 -1
  362. package/dist/cli/ink-cli/services/CommandService.js +36 -5
  363. package/dist/cli/ink-cli/services/InputService.d.ts +1 -5
  364. package/dist/cli/ink-cli/services/InputService.d.ts.map +1 -1
  365. package/dist/cli/ink-cli/services/InputService.js +1 -8
  366. package/dist/cli/ink-cli/services/index.d.ts +2 -1
  367. package/dist/cli/ink-cli/services/index.d.ts.map +1 -1
  368. package/dist/cli/ink-cli/services/index.js +2 -1
  369. package/dist/cli/ink-cli/services/processStream.d.ts +69 -0
  370. package/dist/cli/ink-cli/services/processStream.d.ts.map +1 -0
  371. package/dist/cli/ink-cli/services/processStream.js +742 -0
  372. package/dist/cli/ink-cli/state/actions.d.ts +30 -60
  373. package/dist/cli/ink-cli/state/actions.d.ts.map +1 -1
  374. package/dist/cli/ink-cli/state/actions.js +3 -0
  375. package/dist/cli/ink-cli/state/index.d.ts +5 -3
  376. package/dist/cli/ink-cli/state/index.d.ts.map +1 -1
  377. package/dist/cli/ink-cli/state/index.js +4 -3
  378. package/dist/cli/ink-cli/state/initialState.d.ts +4 -3
  379. package/dist/cli/ink-cli/state/initialState.d.ts.map +1 -1
  380. package/dist/cli/ink-cli/state/initialState.js +20 -4
  381. package/dist/cli/ink-cli/state/reducer.d.ts +3 -0
  382. package/dist/cli/ink-cli/state/reducer.d.ts.map +1 -1
  383. package/dist/cli/ink-cli/state/reducer.js +62 -168
  384. package/dist/cli/ink-cli/state/streaming-state.d.ts +27 -0
  385. package/dist/cli/ink-cli/state/streaming-state.d.ts.map +1 -0
  386. package/dist/cli/ink-cli/state/streaming-state.js +39 -0
  387. package/dist/cli/ink-cli/state/types.d.ts +223 -6
  388. package/dist/cli/ink-cli/state/types.d.ts.map +1 -1
  389. package/dist/cli/ink-cli/utils/bracketedPaste.d.ts +22 -0
  390. package/dist/cli/ink-cli/utils/bracketedPaste.d.ts.map +1 -0
  391. package/dist/cli/ink-cli/utils/bracketedPaste.js +27 -0
  392. package/dist/cli/ink-cli/utils/clipboardUtils.d.ts +49 -0
  393. package/dist/cli/ink-cli/utils/clipboardUtils.d.ts.map +1 -0
  394. package/dist/cli/ink-cli/utils/clipboardUtils.js +356 -0
  395. package/dist/cli/ink-cli/utils/commandOverlays.d.ts +33 -0
  396. package/dist/cli/ink-cli/utils/commandOverlays.d.ts.map +1 -0
  397. package/dist/cli/ink-cli/utils/commandOverlays.js +78 -0
  398. package/dist/cli/ink-cli/utils/debugLog.d.ts +38 -0
  399. package/dist/cli/ink-cli/utils/debugLog.d.ts.map +1 -0
  400. package/dist/cli/ink-cli/utils/debugLog.js +66 -0
  401. package/dist/cli/ink-cli/utils/index.d.ts +2 -1
  402. package/dist/cli/ink-cli/utils/index.d.ts.map +1 -1
  403. package/dist/cli/ink-cli/utils/index.js +3 -1
  404. package/dist/cli/ink-cli/utils/input.d.ts +25 -0
  405. package/dist/cli/ink-cli/utils/input.d.ts.map +1 -0
  406. package/dist/cli/ink-cli/utils/input.js +56 -0
  407. package/dist/cli/ink-cli/utils/inputParsing.d.ts +0 -9
  408. package/dist/cli/ink-cli/utils/inputParsing.d.ts.map +1 -1
  409. package/dist/cli/ink-cli/utils/inputParsing.js +0 -27
  410. package/dist/cli/ink-cli/utils/messageFormatting.d.ts +59 -3
  411. package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
  412. package/dist/cli/ink-cli/utils/messageFormatting.js +348 -20
  413. package/dist/cli/ink-cli/utils/mouse.d.ts +61 -0
  414. package/dist/cli/ink-cli/utils/mouse.d.ts.map +1 -0
  415. package/dist/cli/ink-cli/utils/mouse.js +209 -0
  416. package/dist/cli/ink-cli/utils/streamSplitter.d.ts +44 -0
  417. package/dist/cli/ink-cli/utils/streamSplitter.d.ts.map +1 -0
  418. package/dist/cli/ink-cli/utils/streamSplitter.js +154 -0
  419. package/dist/cli/ink-cli/utils/textUtils.d.ts +63 -0
  420. package/dist/cli/ink-cli/utils/textUtils.d.ts.map +1 -0
  421. package/dist/cli/ink-cli/utils/textUtils.js +248 -0
  422. package/dist/cli/ink-cli/utils/toolUtils.d.ts +9 -0
  423. package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +1 -0
  424. package/dist/cli/ink-cli/utils/toolUtils.js +15 -0
  425. package/dist/cli/utils/api-key-setup.d.ts +54 -4
  426. package/dist/cli/utils/api-key-setup.d.ts.map +1 -1
  427. package/dist/cli/utils/api-key-setup.js +433 -107
  428. package/dist/cli/utils/api-key-verification.d.ts +17 -0
  429. package/dist/cli/utils/api-key-verification.d.ts.map +1 -0
  430. package/dist/cli/utils/api-key-verification.js +211 -0
  431. package/dist/cli/utils/config-validation.d.ts +22 -2
  432. package/dist/cli/utils/config-validation.d.ts.map +1 -1
  433. package/dist/cli/utils/config-validation.js +354 -25
  434. package/dist/cli/utils/local-model-setup.d.ts +46 -0
  435. package/dist/cli/utils/local-model-setup.d.ts.map +1 -0
  436. package/dist/cli/utils/local-model-setup.js +662 -0
  437. package/dist/cli/utils/options.d.ts.map +1 -1
  438. package/dist/cli/utils/options.js +1 -3
  439. package/dist/cli/utils/prompt-helpers.d.ts +47 -0
  440. package/dist/cli/utils/prompt-helpers.d.ts.map +1 -0
  441. package/dist/cli/utils/prompt-helpers.js +66 -0
  442. package/dist/cli/utils/provider-setup.d.ts +66 -8
  443. package/dist/cli/utils/provider-setup.d.ts.map +1 -1
  444. package/dist/cli/utils/provider-setup.js +324 -84
  445. package/dist/cli/utils/scaffolding-utils.d.ts +76 -0
  446. package/dist/cli/utils/scaffolding-utils.d.ts.map +1 -0
  447. package/dist/cli/utils/scaffolding-utils.js +246 -0
  448. package/dist/cli/utils/setup-utils.d.ts +16 -0
  449. package/dist/cli/utils/setup-utils.d.ts.map +1 -1
  450. package/dist/cli/utils/setup-utils.js +72 -21
  451. package/dist/cli/utils/template-engine.d.ts +65 -0
  452. package/dist/cli/utils/template-engine.d.ts.map +1 -0
  453. package/dist/cli/utils/template-engine.js +1089 -0
  454. package/dist/config/cli-overrides.d.ts +45 -2
  455. package/dist/config/cli-overrides.d.ts.map +1 -1
  456. package/dist/config/cli-overrides.js +107 -10
  457. package/dist/index.js +379 -99
  458. package/dist/utils/agent-helpers.d.ts +95 -0
  459. package/dist/utils/agent-helpers.d.ts.map +1 -0
  460. package/dist/utils/agent-helpers.js +117 -0
  461. package/dist/webui/assets/index-8j-KMkX1.js +2054 -0
  462. package/dist/webui/assets/index-c_AX24V4.css +1 -0
  463. package/dist/webui/assets/{tanstack-DgxBONJY.js → tanstack-Br79RQ-n.js} +1 -1
  464. package/dist/webui/index.html +4 -10
  465. package/dist/webui/logos/aws-color.svg +1 -0
  466. package/dist/webui/logos/dexto/dexto_logo.svg +1 -1
  467. package/dist/webui/logos/dexto/dexto_logo_light.svg +6 -6
  468. package/dist/webui/logos/glama.svg +7 -0
  469. package/dist/webui/logos/litellm.svg +7 -0
  470. package/dist/webui/logos/openrouter.svg +1 -0
  471. package/package.json +18 -15
  472. package/dist/cli/commands/interactive-commands/index.d.ts +0 -63
  473. package/dist/cli/commands/interactive-commands/index.d.ts.map +0 -1
  474. package/dist/cli/commands/interactive-commands/index.js +0 -73
  475. package/dist/cli/commands/interactive-commands/mcp/mcp-add-utils.d.ts +0 -34
  476. package/dist/cli/commands/interactive-commands/mcp/mcp-add-utils.d.ts.map +0 -1
  477. package/dist/cli/commands/interactive-commands/mcp/mcp-add-utils.js +0 -178
  478. package/dist/cli/commands/interactive-commands/mcp/mcp-commands.d.ts +0 -9
  479. package/dist/cli/commands/interactive-commands/mcp/mcp-commands.d.ts.map +0 -1
  480. package/dist/cli/commands/interactive-commands/mcp/mcp-commands.js +0 -325
  481. package/dist/cli/commands/interactive-commands/model/model-commands.d.ts +0 -21
  482. package/dist/cli/commands/interactive-commands/model/model-commands.d.ts.map +0 -1
  483. package/dist/cli/commands/interactive-commands/model/model-commands.js +0 -190
  484. package/dist/cli/ink-cli/components/MultiLineTextInput.d.ts +0 -26
  485. package/dist/cli/ink-cli/components/MultiLineTextInput.d.ts.map +0 -1
  486. package/dist/cli/ink-cli/components/MultiLineTextInput.js +0 -220
  487. package/dist/discord/bot.d.ts +0 -4
  488. package/dist/discord/bot.d.ts.map +0 -1
  489. package/dist/discord/bot.js +0 -193
  490. package/dist/telegram/bot.d.ts +0 -5
  491. package/dist/telegram/bot.d.ts.map +0 -1
  492. package/dist/telegram/bot.js +0 -251
  493. package/dist/webui/assets/index-DKq5Xng1.js +0 -687
  494. package/dist/webui/assets/index-D_0_GBu5.css +0 -1
@@ -0,0 +1,95 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * StaticCLI - Static pattern rendering mode
4
+ *
5
+ * Uses Ink's Static component for copy-friendly terminal output.
6
+ * Features:
7
+ * - Static component for finalized messages (rendered to terminal scrollback)
8
+ * - Native terminal scrolling and text selection
9
+ * - No mouse event interception
10
+ * - Simpler, more compatible with traditional terminal workflows
11
+ *
12
+ * Architecture:
13
+ * - `messages` = finalized messages → rendered in <Static> (permanent output)
14
+ * - `pendingMessages` = streaming/in-progress → rendered dynamically (redrawn)
15
+ * This prevents duplicate output when streaming completes.
16
+ */
17
+ import { useMemo, useState, useEffect, useRef, useCallback } from 'react';
18
+ import { Box, Static, Text, useStdout } from 'ink';
19
+ // ANSI escape sequence to clear terminal (equivalent to ansiEscapes.clearTerminal)
20
+ const CLEAR_TERMINAL = '\x1B[2J\x1B[3J\x1B[H';
21
+ // Hooks
22
+ import { useCLIState } from '../../hooks/useCLIState.js';
23
+ import { useTerminalSize } from '../../hooks/useTerminalSize.js';
24
+ // Components
25
+ import { Header } from '../chat/Header.js';
26
+ import { MessageItem } from '../chat/MessageItem.js';
27
+ import { QueuedMessagesDisplay } from '../chat/QueuedMessagesDisplay.js';
28
+ import { StatusBar } from '../StatusBar.js';
29
+ import { HistorySearchBar } from '../HistorySearchBar.js';
30
+ import { Footer } from '../Footer.js';
31
+ // Containers
32
+ import { InputContainer } from '../../containers/InputContainer.js';
33
+ import { OverlayContainer } from '../../containers/OverlayContainer.js';
34
+ export function StaticCLI({ agent, initialSessionId, startupInfo, useStreaming = true, }) {
35
+ // Use shared CLI state (no keyboard scroll in Static mode)
36
+ const { messages, setMessages, pendingMessages, setPendingMessages, dequeuedBuffer, setDequeuedBuffer, queuedMessages, setQueuedMessages, ui, setUi, input, setInput, session, setSession, approval, setApproval, approvalQueue, setApprovalQueue, inputService, buffer, overlayContainerRef, visibleMessages, } = useCLIState({
37
+ agent,
38
+ initialSessionId,
39
+ startupInfo,
40
+ // No keyboard scroll handler - let terminal handle scrollback
41
+ });
42
+ // Terminal resize handling - clear and re-render Static content
43
+ const { write: stdoutWrite } = useStdout();
44
+ const { columns: terminalWidth } = useTerminalSize();
45
+ const [staticRemountKey, setStaticRemountKey] = useState(0);
46
+ const isInitialMount = useRef(true);
47
+ // Ref to InputContainer for programmatic submit
48
+ const inputContainerRef = useRef(null);
49
+ // Compute whether history search has a match (for HistorySearchBar indicator)
50
+ const historySearchHasMatch = useMemo(() => {
51
+ if (!ui.historySearch.isActive || !ui.historySearch.query)
52
+ return false;
53
+ const query = ui.historySearch.query.toLowerCase();
54
+ return input.history.some((item) => item.toLowerCase().includes(query));
55
+ }, [ui.historySearch.isActive, ui.historySearch.query, input.history]);
56
+ // Callback for OverlayContainer to submit prompt commands through InputContainer
57
+ const handleSubmitPromptCommand = useCallback(async (commandText) => {
58
+ try {
59
+ await inputContainerRef.current?.submit(commandText);
60
+ }
61
+ catch (error) {
62
+ agent.logger.error(`StaticCLI.handleSubmitPromptCommand failed: ${error instanceof Error ? error.message : String(error)}`);
63
+ }
64
+ }, [agent]);
65
+ // Function to refresh static content (clear terminal and force re-render)
66
+ const refreshStatic = useCallback(() => {
67
+ stdoutWrite(CLEAR_TERMINAL);
68
+ setStaticRemountKey((prev) => prev + 1);
69
+ }, [stdoutWrite]);
70
+ // Handle terminal resize - debounced refresh of static content
71
+ useEffect(() => {
72
+ // Skip initial mount to avoid unnecessary clear on startup
73
+ if (isInitialMount.current) {
74
+ isInitialMount.current = false;
75
+ return;
76
+ }
77
+ // Debounce resize handling (300ms)
78
+ const handler = setTimeout(() => {
79
+ refreshStatic();
80
+ }, 300);
81
+ return () => {
82
+ clearTimeout(handler);
83
+ };
84
+ }, [terminalWidth, refreshStatic]);
85
+ // Pre-render static items as JSX elements (Gemini pattern)
86
+ // Header + finalized messages go in <Static> (rendered once, permanent)
87
+ const staticItems = useMemo(() => {
88
+ const items = [
89
+ _jsx(Header, { modelName: session.modelName, sessionId: session.id || undefined, hasActiveSession: session.hasActiveSession, startupInfo: startupInfo }, "header"),
90
+ ...visibleMessages.map((msg) => _jsx(MessageItem, { message: msg }, msg.id)),
91
+ ];
92
+ return items;
93
+ }, [visibleMessages, session.modelName, session.id, session.hasActiveSession, startupInfo]);
94
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Static, { items: staticItems, children: (item) => item }, staticRemountKey), pendingMessages.map((message) => (_jsx(MessageItem, { message: message }, message.id))), dequeuedBuffer.map((message) => (_jsx(MessageItem, { message: message }, message.id))), _jsxs(Box, { flexDirection: "column", flexShrink: 0, children: [_jsx(StatusBar, { agent: agent, isProcessing: ui.isProcessing, isThinking: ui.isThinking, approvalQueueCount: approvalQueue.length, copyModeEnabled: ui.copyModeEnabled, isAwaitingApproval: approval !== null }), _jsx(QueuedMessagesDisplay, { messages: queuedMessages }), _jsx(InputContainer, { ref: inputContainerRef, buffer: buffer, input: input, ui: ui, session: session, approval: approval, queuedMessages: queuedMessages, setInput: setInput, setUi: setUi, setSession: setSession, setMessages: setMessages, setPendingMessages: setPendingMessages, setDequeuedBuffer: setDequeuedBuffer, setQueuedMessages: setQueuedMessages, setApproval: setApproval, setApprovalQueue: setApprovalQueue, agent: agent, inputService: inputService, useStreaming: useStreaming }), _jsx(OverlayContainer, { ref: overlayContainerRef, ui: ui, input: input, session: session, approval: approval, setInput: setInput, setUi: setUi, setSession: setSession, setMessages: setMessages, setApproval: setApproval, setApprovalQueue: setApprovalQueue, agent: agent, inputService: inputService, buffer: buffer, refreshStatic: refreshStatic, onSubmitPromptCommand: handleSubmitPromptCommand }), ui.exitWarningShown && (_jsxs(Box, { paddingX: 1, children: [_jsx(Text, { color: "yellowBright", bold: true, children: "\u26A0 Press Ctrl+C again to exit" }), _jsx(Text, { color: "gray", children: " (or press any key to cancel)" })] })), _jsx(Footer, { modelName: session.modelName, cwd: process.cwd(), autoApproveEdits: ui.autoApproveEdits }), ui.historySearch.isActive && (_jsx(HistorySearchBar, { query: ui.historySearch.query, hasMatch: historySearchHasMatch }))] })] }));
95
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * CLI Rendering Modes
3
+ *
4
+ * Two rendering modes are available:
5
+ * - AlternateBufferCLI: VirtualizedList with mouse scroll, keyboard scroll, copy mode
6
+ * - StaticCLI: Static pattern with native terminal scrollback and selection
7
+ */
8
+ export { AlternateBufferCLI } from './AlternateBufferCLI.js';
9
+ export { StaticCLI } from './StaticCLI.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/ink-cli/components/modes/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * CLI Rendering Modes
3
+ *
4
+ * Two rendering modes are available:
5
+ * - AlternateBufferCLI: VirtualizedList with mouse scroll, keyboard scroll, copy mode
6
+ * - StaticCLI: Static pattern with native terminal scrollback and selection
7
+ */
8
+ export { AlternateBufferCLI } from './AlternateBufferCLI.js';
9
+ export { StaticCLI } from './StaticCLI.js';
@@ -0,0 +1,26 @@
1
+ /**
2
+ * ApiKeyInput Component
3
+ * Interactive overlay for entering API keys when switching to a provider without one
4
+ */
5
+ import React from 'react';
6
+ import type { Key } from '../../hooks/useInputOrchestrator.js';
7
+ import type { LLMProvider } from '@dexto/core';
8
+ export interface ApiKeyInputProps {
9
+ isVisible: boolean;
10
+ provider: LLMProvider;
11
+ onSaved: (meta: {
12
+ provider: LLMProvider;
13
+ envVar: string;
14
+ }) => void;
15
+ onClose: () => void;
16
+ }
17
+ export interface ApiKeyInputHandle {
18
+ handleInput: (input: string, key: Key) => boolean;
19
+ }
20
+ /**
21
+ * API key input overlay - prompts user for API key when switching to a provider
22
+ * that doesn't have a configured key
23
+ */
24
+ declare const ApiKeyInput: React.ForwardRefExoticComponent<ApiKeyInputProps & React.RefAttributes<ApiKeyInputHandle>>;
25
+ export default ApiKeyInput;
26
+ //# sourceMappingURL=ApiKeyInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiKeyInput.d.ts","sourceRoot":"","sources":["../../../../../src/cli/ink-cli/components/overlays/ApiKeyInput.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAA4E,MAAM,OAAO,CAAC;AAEjG,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAS/C,MAAM,WAAW,gBAAgB;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,EAAE,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACnE,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAC9B,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAED;;;GAGG;AACH,QAAA,MAAM,WAAW,4FA+Jf,CAAC;AAEH,eAAe,WAAW,CAAC"}
@@ -0,0 +1,92 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * ApiKeyInput Component
4
+ * Interactive overlay for entering API keys when switching to a provider without one
5
+ */
6
+ import { useState, useEffect, forwardRef, useImperativeHandle, useCallback } from 'react';
7
+ import { Box, Text } from 'ink';
8
+ import { getPrimaryApiKeyEnvVar, saveProviderApiKey } from '@dexto/agent-management';
9
+ import { applyLayeredEnvironmentLoading } from '../../../../utils/env.js';
10
+ import { getProviderDisplayName, isValidApiKeyFormat, getProviderInstructions, } from '../../../utils/provider-setup.js';
11
+ /**
12
+ * API key input overlay - prompts user for API key when switching to a provider
13
+ * that doesn't have a configured key
14
+ */
15
+ const ApiKeyInput = forwardRef(function ApiKeyInput({ isVisible, provider, onSaved, onClose }, ref) {
16
+ const [apiKey, setApiKey] = useState('');
17
+ const [error, setError] = useState(null);
18
+ const [isSaving, setIsSaving] = useState(false);
19
+ // Reset when becoming visible or provider changes
20
+ useEffect(() => {
21
+ if (isVisible) {
22
+ setApiKey('');
23
+ setError(null);
24
+ setIsSaving(false);
25
+ }
26
+ }, [isVisible, provider]);
27
+ const handleSubmit = useCallback(async () => {
28
+ const trimmedKey = apiKey.trim();
29
+ // Validate
30
+ if (!trimmedKey) {
31
+ setError('API key is required');
32
+ return;
33
+ }
34
+ if (!isValidApiKeyFormat(trimmedKey, provider)) {
35
+ setError(`Invalid ${getProviderDisplayName(provider)} API key format`);
36
+ return;
37
+ }
38
+ setError(null);
39
+ setIsSaving(true);
40
+ try {
41
+ const meta = await saveProviderApiKey(provider, trimmedKey, process.cwd());
42
+ // Reload environment variables so the key is available
43
+ await applyLayeredEnvironmentLoading();
44
+ onSaved({ provider, envVar: meta.envVar });
45
+ }
46
+ catch (err) {
47
+ setError(`Failed to save: ${err instanceof Error ? err.message : String(err)}`);
48
+ setIsSaving(false);
49
+ }
50
+ }, [apiKey, provider, onSaved]);
51
+ // Handle keyboard input
52
+ useImperativeHandle(ref, () => ({
53
+ handleInput: (input, key) => {
54
+ if (!isVisible || isSaving)
55
+ return false;
56
+ // Escape to close
57
+ if (key.escape) {
58
+ onClose();
59
+ return true;
60
+ }
61
+ // Enter to submit
62
+ if (key.return) {
63
+ void handleSubmit();
64
+ return true;
65
+ }
66
+ // Backspace
67
+ if (key.backspace || key.delete) {
68
+ setApiKey((prev) => prev.slice(0, -1));
69
+ setError(null);
70
+ return true;
71
+ }
72
+ // Regular character input
73
+ if (input && !key.ctrl && !key.meta) {
74
+ setApiKey((prev) => prev + input);
75
+ setError(null);
76
+ return true;
77
+ }
78
+ return false;
79
+ },
80
+ }), [isVisible, isSaving, onClose, handleSubmit]);
81
+ if (!isVisible)
82
+ return null;
83
+ const providerName = getProviderDisplayName(provider);
84
+ const envVar = getPrimaryApiKeyEnvVar(provider);
85
+ const instructions = getProviderInstructions(provider);
86
+ // Mask the API key for display (show first 4 and last 4 chars)
87
+ const maskedKey = apiKey.length > 8
88
+ ? `${apiKey.slice(0, 4)}${'*'.repeat(Math.min(apiKey.length - 8, 20))}${apiKey.slice(-4)}`
89
+ : '*'.repeat(apiKey.length);
90
+ return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, marginTop: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { bold: true, color: "cyan", children: ["API Key Required for ", providerName] }) }), instructions && (_jsx(Box, { flexDirection: "column", marginBottom: 1, children: _jsx(Text, { color: "gray", children: instructions.content }) })), _jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: "gray", children: "This key will be saved to " }), _jsx(Text, { color: "yellowBright", children: envVar }), _jsx(Text, { color: "gray", children: " in your .env file" })] }), _jsx(Box, { flexDirection: "column", children: _jsxs(Text, { bold: true, children: ["Enter your ", providerName, " API key:"] }) }), _jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: "cyan", children: "> " }), _jsx(Text, { children: maskedKey }), !isSaving && _jsx(Text, { color: "cyan", children: "_" })] }), isSaving && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "yellowBright", children: "Saving API key..." }) })), error && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "red", children: error }) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Enter to save \u2022 Esc to cancel" }) })] }));
91
+ });
92
+ export default ApiKeyInput;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * CustomModelWizard Component
3
+ * Multi-step wizard for adding custom models (openai-compatible, openrouter, litellm, glama, bedrock)
4
+ *
5
+ * Architecture:
6
+ * - Provider configs centralized in ./custom-model-wizard/provider-config.ts
7
+ * - Shared UI components in ./custom-model-wizard/shared/
8
+ * - This file is the orchestrator - handles state, navigation, and keyboard input
9
+ */
10
+ import React from 'react';
11
+ import type { Key } from '../../hooks/useInputOrchestrator.js';
12
+ import { type CustomModel } from '@dexto/agent-management';
13
+ interface CustomModelWizardProps {
14
+ isVisible: boolean;
15
+ onComplete: (model: CustomModel) => void;
16
+ onClose: () => void;
17
+ /** Optional model to edit - if provided, form will be pre-populated */
18
+ initialModel?: CustomModel | null;
19
+ }
20
+ export interface CustomModelWizardHandle {
21
+ handleInput: (input: string, key: Key) => boolean;
22
+ }
23
+ /**
24
+ * Multi-step wizard for custom model configuration.
25
+ * Uses data-driven provider configs instead of scattered conditionals.
26
+ */
27
+ declare const CustomModelWizard: React.ForwardRefExoticComponent<CustomModelWizardProps & React.RefAttributes<CustomModelWizardHandle>>;
28
+ export default CustomModelWizard;
29
+ //# sourceMappingURL=CustomModelWizard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomModelWizard.d.ts","sourceRoot":"","sources":["../../../../../src/cli/ink-cli/components/overlays/CustomModelWizard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAON,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAIH,KAAK,WAAW,EAMnB,MAAM,yBAAyB,CAAC;AAmBjC,UAAU,sBAAsB;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,uEAAuE;IACvE,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,uBAAuB;IACpC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAED;;;GAGG;AACH,QAAA,MAAM,iBAAiB,wGAqXtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,286 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * CustomModelWizard Component
4
+ * Multi-step wizard for adding custom models (openai-compatible, openrouter, litellm, glama, bedrock)
5
+ *
6
+ * Architecture:
7
+ * - Provider configs centralized in ./custom-model-wizard/provider-config.ts
8
+ * - Shared UI components in ./custom-model-wizard/shared/
9
+ * - This file is the orchestrator - handles state, navigation, and keyboard input
10
+ */
11
+ import { useState, useEffect, forwardRef, useImperativeHandle, useCallback, useRef, } from 'react';
12
+ import { Box, Text } from 'ink';
13
+ import { saveCustomModel, deleteCustomModel, CUSTOM_MODEL_PROVIDERS, saveProviderApiKey, getProviderKeyStatus, resolveApiKeyForProvider, determineApiKeyStorage, } from '@dexto/agent-management';
14
+ import { logger } from '@dexto/core';
15
+ // Import from new modular architecture
16
+ import { getProviderConfig, getAvailableProviders, runAsyncValidation, } from './custom-model-wizard/provider-config.js';
17
+ import { ProviderSelector, WizardStepInput, SetupInfoBanner, ApiKeyStep, } from './custom-model-wizard/shared/index.js';
18
+ import LocalModelWizard from './custom-model-wizard/LocalModelWizard.js';
19
+ /**
20
+ * Multi-step wizard for custom model configuration.
21
+ * Uses data-driven provider configs instead of scattered conditionals.
22
+ */
23
+ const CustomModelWizard = forwardRef(function CustomModelWizard({ isVisible, onComplete, onClose, initialModel }, ref) {
24
+ // Provider selection (step 0) then wizard steps
25
+ const [selectedProvider, setSelectedProvider] = useState(null);
26
+ const [providerIndex, setProviderIndex] = useState(0);
27
+ const [currentStep, setCurrentStep] = useState(0);
28
+ const [values, setValues] = useState({});
29
+ const [currentInput, setCurrentInput] = useState('');
30
+ const [error, setError] = useState(null);
31
+ const [isSaving, setIsSaving] = useState(false);
32
+ const [isValidating, setIsValidating] = useState(false);
33
+ // Track original name when editing (to handle renames)
34
+ const [originalName, setOriginalName] = useState(null);
35
+ const isEditing = initialModel !== null && initialModel !== undefined;
36
+ // Ref for LocalModelWizard (specialized wizard for 'local' provider)
37
+ const localModelWizardRef = useRef(null);
38
+ // Get provider config (data-driven, no conditionals)
39
+ const providerConfig = selectedProvider ? getProviderConfig(selectedProvider) : null;
40
+ const wizardSteps = providerConfig?.steps ?? [];
41
+ const currentStepConfig = wizardSteps[currentStep];
42
+ // Reset when becoming visible
43
+ useEffect(() => {
44
+ if (isVisible) {
45
+ if (initialModel) {
46
+ // Editing mode - pre-populate from initialModel
47
+ const provider = initialModel.provider ?? 'openai-compatible';
48
+ setSelectedProvider(provider);
49
+ setOriginalName(initialModel.name);
50
+ setValues({
51
+ name: initialModel.name,
52
+ baseURL: initialModel.baseURL ?? '',
53
+ displayName: initialModel.displayName ?? '',
54
+ maxInputTokens: initialModel.maxInputTokens?.toString() ?? '',
55
+ apiKey: initialModel.apiKey ?? '',
56
+ });
57
+ setCurrentStep(0);
58
+ setCurrentInput(initialModel.name);
59
+ setProviderIndex(CUSTOM_MODEL_PROVIDERS.indexOf(provider));
60
+ }
61
+ else {
62
+ // Adding mode - reset everything
63
+ setSelectedProvider(null);
64
+ setOriginalName(null);
65
+ setProviderIndex(0);
66
+ setCurrentStep(0);
67
+ setValues({});
68
+ setCurrentInput('');
69
+ }
70
+ setError(null);
71
+ setIsSaving(false);
72
+ setIsValidating(false);
73
+ }
74
+ }, [isVisible, initialModel]);
75
+ const handleProviderSelect = useCallback(() => {
76
+ const provider = CUSTOM_MODEL_PROVIDERS[providerIndex];
77
+ if (provider) {
78
+ setSelectedProvider(provider);
79
+ setCurrentStep(0);
80
+ setCurrentInput('');
81
+ setError(null);
82
+ }
83
+ }, [providerIndex]);
84
+ const handleNext = useCallback(async () => {
85
+ if (!currentStepConfig || !selectedProvider || isSaving || isValidating)
86
+ return;
87
+ const value = currentInput.trim();
88
+ // Sync validation
89
+ if (currentStepConfig.validate) {
90
+ const validationError = currentStepConfig.validate(value);
91
+ if (validationError) {
92
+ setError(validationError);
93
+ return;
94
+ }
95
+ }
96
+ else if (currentStepConfig.required && !value) {
97
+ setError(`${currentStepConfig.label} is required`);
98
+ return;
99
+ }
100
+ // Async validation (data-driven - no provider-specific conditionals)
101
+ const asyncError = await (async () => {
102
+ setIsValidating(true);
103
+ setError(null);
104
+ try {
105
+ return await runAsyncValidation(selectedProvider, currentStepConfig.field, value);
106
+ }
107
+ finally {
108
+ setIsValidating(false);
109
+ }
110
+ })();
111
+ if (asyncError) {
112
+ setError(asyncError);
113
+ return;
114
+ }
115
+ // Save value
116
+ const newValues = { ...values, [currentStepConfig.field]: value };
117
+ setValues(newValues);
118
+ setError(null);
119
+ setCurrentInput('');
120
+ // Check if we're done
121
+ if (currentStep >= wizardSteps.length - 1) {
122
+ await saveModel(newValues);
123
+ }
124
+ else {
125
+ const nextStep = currentStep + 1;
126
+ setCurrentStep(nextStep);
127
+ // Pre-populate next step from stored values (for edit mode)
128
+ const nextStepConfig = wizardSteps[nextStep];
129
+ const nextValue = nextStepConfig ? newValues[nextStepConfig.field] : undefined;
130
+ setCurrentInput(nextValue ?? '');
131
+ }
132
+ }, [
133
+ currentInput,
134
+ currentStep,
135
+ currentStepConfig,
136
+ isSaving,
137
+ isValidating,
138
+ selectedProvider,
139
+ values,
140
+ wizardSteps,
141
+ ]);
142
+ /**
143
+ * Build and save the model using provider config's buildModel function.
144
+ */
145
+ const saveModel = useCallback(async (finalValues) => {
146
+ if (!selectedProvider || !providerConfig)
147
+ return;
148
+ // Build model using provider config (no conditionals!)
149
+ const model = providerConfig.buildModel(finalValues, selectedProvider);
150
+ // Handle API key storage
151
+ const userEnteredKey = finalValues.apiKey?.trim();
152
+ const providerKeyStatus = getProviderKeyStatus(selectedProvider);
153
+ const existingProviderKey = resolveApiKeyForProvider(selectedProvider);
154
+ const keyStorage = determineApiKeyStorage(selectedProvider, userEnteredKey, providerKeyStatus.hasApiKey, existingProviderKey);
155
+ if (keyStorage.saveToProviderEnvVar && userEnteredKey) {
156
+ try {
157
+ await saveProviderApiKey(selectedProvider, userEnteredKey, process.cwd());
158
+ }
159
+ catch (err) {
160
+ logger.warn(`Failed to save provider API key: ${err instanceof Error ? err.message : 'Unknown error'}`);
161
+ // Fall back to per-model storage
162
+ keyStorage.saveAsPerModel = true;
163
+ }
164
+ }
165
+ if (keyStorage.saveAsPerModel && userEnteredKey) {
166
+ model.apiKey = userEnteredKey;
167
+ }
168
+ // Save to storage
169
+ setIsSaving(true);
170
+ try {
171
+ // If editing and name changed, delete the old model first
172
+ if (originalName && originalName !== model.name) {
173
+ try {
174
+ await deleteCustomModel(originalName);
175
+ }
176
+ catch (err) {
177
+ // Log but continue - old model might already be deleted
178
+ logger.warn(`Failed to delete old model "${originalName}" during rename: ${err instanceof Error ? err.message : String(err)}`);
179
+ }
180
+ }
181
+ await saveCustomModel(model);
182
+ onComplete(model);
183
+ }
184
+ catch (err) {
185
+ logger.error(`Failed to save custom model: ${err instanceof Error ? err.message : 'Unknown error'}`);
186
+ setError(`Failed to save: ${err instanceof Error ? err.message : 'Unknown error'}`);
187
+ setIsSaving(false);
188
+ }
189
+ }, [selectedProvider, providerConfig, originalName, onComplete]);
190
+ const handleBack = useCallback(() => {
191
+ if (currentStep > 0) {
192
+ setCurrentStep(currentStep - 1);
193
+ // Restore previous value
194
+ const prevStep = wizardSteps[currentStep - 1];
195
+ if (prevStep) {
196
+ setCurrentInput(values[prevStep.field] || '');
197
+ }
198
+ setError(null);
199
+ }
200
+ else if (selectedProvider) {
201
+ // Go back to provider selection
202
+ setSelectedProvider(null);
203
+ setError(null);
204
+ }
205
+ else {
206
+ onClose();
207
+ }
208
+ }, [currentStep, onClose, selectedProvider, values, wizardSteps]);
209
+ // Handle keyboard input
210
+ useImperativeHandle(ref, () => ({
211
+ handleInput: (input, key) => {
212
+ if (!isVisible || isSaving || isValidating)
213
+ return false;
214
+ // Delegate to LocalModelWizard when local provider is selected
215
+ if (selectedProvider === 'local' && localModelWizardRef.current) {
216
+ return localModelWizardRef.current.handleInput(input, key);
217
+ }
218
+ // Escape to go back/close
219
+ if (key.escape) {
220
+ handleBack();
221
+ return true;
222
+ }
223
+ // Provider selection mode
224
+ if (!selectedProvider) {
225
+ const providers = getAvailableProviders();
226
+ if (key.upArrow) {
227
+ setProviderIndex((prev) => prev > 0 ? prev - 1 : providers.length - 1);
228
+ return true;
229
+ }
230
+ if (key.downArrow) {
231
+ setProviderIndex((prev) => prev < providers.length - 1 ? prev + 1 : 0);
232
+ return true;
233
+ }
234
+ if (key.return) {
235
+ handleProviderSelect();
236
+ return true;
237
+ }
238
+ return true; // Consume all input during provider selection
239
+ }
240
+ // Wizard step mode
241
+ if (key.return) {
242
+ void handleNext();
243
+ return true;
244
+ }
245
+ // Backspace
246
+ if (key.backspace || key.delete) {
247
+ setCurrentInput((prev) => prev.slice(0, -1));
248
+ setError(null);
249
+ return true;
250
+ }
251
+ // Regular character input
252
+ if (input && !key.ctrl && !key.meta) {
253
+ setCurrentInput((prev) => prev + input);
254
+ setError(null);
255
+ return true;
256
+ }
257
+ return false;
258
+ },
259
+ }), [
260
+ isVisible,
261
+ isSaving,
262
+ isValidating,
263
+ handleBack,
264
+ handleNext,
265
+ handleProviderSelect,
266
+ selectedProvider,
267
+ ]);
268
+ if (!isVisible)
269
+ return null;
270
+ // Provider selection screen (using shared component)
271
+ if (!selectedProvider) {
272
+ return _jsx(ProviderSelector, { selectedIndex: providerIndex, isEditing: isEditing });
273
+ }
274
+ // Local provider uses specialized wizard with download support
275
+ if (selectedProvider === 'local') {
276
+ return (_jsx(LocalModelWizard, { ref: localModelWizardRef, isVisible: isVisible, onComplete: onComplete, onClose: () => {
277
+ // Go back to provider selection instead of closing completely
278
+ setSelectedProvider(null);
279
+ } }));
280
+ }
281
+ // Wizard steps screen for other providers
282
+ if (!currentStepConfig || !providerConfig)
283
+ return null;
284
+ return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "green", paddingX: 1, marginTop: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { bold: true, color: "green", children: isEditing ? 'Edit Custom Model' : 'Add Custom Model' }), _jsxs(Text, { color: "gray", children: [' ', "(", providerConfig.displayName, ") Step ", currentStep + 1, "/", wizardSteps.length] })] }), providerConfig.setupInfo && currentStep === 0 && (_jsx(SetupInfoBanner, { title: providerConfig.setupInfo.title, description: providerConfig.setupInfo.description, docsUrl: providerConfig.setupInfo.docsUrl })), _jsx(WizardStepInput, { step: currentStepConfig, currentInput: currentInput, error: error, isValidating: isValidating, isSaving: isSaving, additionalContent: currentStepConfig.field === 'apiKey' ? (_jsx(ApiKeyStep, { provider: selectedProvider })) : undefined }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: "gray", children: ["Enter to continue \u2022 Esc to", ' ', currentStep > 0 ? 'go back' : 'back to provider'] }) })] }));
285
+ });
286
+ export default CustomModelWizard;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * LogLevelSelector Component
3
+ * Interactive selector for changing log level
4
+ */
5
+ import React from 'react';
6
+ import type { Key } from '../../hooks/useInputOrchestrator.js';
7
+ import type { DextoAgent } from '@dexto/core';
8
+ interface LogLevelSelectorProps {
9
+ isVisible: boolean;
10
+ onSelect: (level: string) => void;
11
+ onClose: () => void;
12
+ agent: DextoAgent;
13
+ }
14
+ export interface LogLevelSelectorHandle {
15
+ handleInput: (input: string, key: Key) => boolean;
16
+ }
17
+ /**
18
+ * Log level selector - thin wrapper around BaseSelector
19
+ */
20
+ declare const LogLevelSelector: React.ForwardRefExoticComponent<LogLevelSelectorProps & React.RefAttributes<LogLevelSelectorHandle>>;
21
+ export default LogLevelSelector;
22
+ //# sourceMappingURL=LogLevelSelector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogLevelSelector.d.ts","sourceRoot":"","sources":["../../../../../src/cli/ink-cli/components/overlays/LogLevelSelector.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAuE,MAAM,OAAO,CAAC;AAE5F,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,UAAU,qBAAqB;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACnC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAkBD;;GAEG;AACH,QAAA,MAAM,gBAAgB,sGAyFrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /**
3
+ * LogLevelSelector Component
4
+ * Interactive selector for changing log level
5
+ */
6
+ import { useState, useEffect, forwardRef, useRef, useImperativeHandle } from 'react';
7
+ import { Box, Text } from 'ink';
8
+ import { BaseSelector } from '../base/BaseSelector.js';
9
+ // Log levels matching DextoLogger's supported levels
10
+ const LOG_LEVELS = [
11
+ { level: 'error', description: 'Errors only', icon: '❌' },
12
+ { level: 'warn', description: 'Warnings and above', icon: '⚠️' },
13
+ { level: 'info', description: 'Info and above (default)', icon: 'ℹ️' },
14
+ { level: 'debug', description: 'Debug information', icon: '🔍' },
15
+ { level: 'silly', description: 'Everything (most verbose)', icon: '🔬' },
16
+ ];
17
+ /**
18
+ * Log level selector - thin wrapper around BaseSelector
19
+ */
20
+ const LogLevelSelector = forwardRef(function LogLevelSelector({ isVisible, onSelect, onClose, agent }, ref) {
21
+ const baseSelectorRef = useRef(null);
22
+ // Forward handleInput to BaseSelector
23
+ useImperativeHandle(ref, () => ({
24
+ handleInput: (input, key) => {
25
+ return baseSelectorRef.current?.handleInput(input, key) ?? false;
26
+ },
27
+ }), []);
28
+ const [levels, setLevels] = useState([]);
29
+ const [selectedIndex, setSelectedIndex] = useState(0);
30
+ const [logFilePath, setLogFilePath] = useState(null);
31
+ // Build levels list with current indicator
32
+ useEffect(() => {
33
+ if (!isVisible) {
34
+ setLogFilePath(null);
35
+ return;
36
+ }
37
+ // Get current level from agent's logger (shared across all child loggers)
38
+ const currentLevel = agent.logger.getLevel();
39
+ const levelList = LOG_LEVELS.map((l) => ({
40
+ ...l,
41
+ isCurrent: l.level === currentLevel,
42
+ }));
43
+ setLevels(levelList);
44
+ setLogFilePath(agent.logger.getLogFilePath());
45
+ // Set initial selection to current level
46
+ const currentIndex = levelList.findIndex((l) => l.isCurrent);
47
+ if (currentIndex >= 0) {
48
+ setSelectedIndex(currentIndex);
49
+ }
50
+ }, [isVisible, agent]);
51
+ // Format level item for display
52
+ const formatItem = (option, isSelected) => (_jsxs(_Fragment, { children: [_jsxs(Text, { children: [option.icon, " "] }), _jsx(Text, { color: isSelected ? 'cyan' : 'gray', bold: isSelected, children: option.level }), _jsxs(Text, { color: isSelected ? 'white' : 'gray', children: [" - ", option.description] }), option.isCurrent && (_jsxs(Text, { color: isSelected ? 'cyan' : 'gray', bold: isSelected, children: [' ', "\u2190 Current"] }))] }));
53
+ // Handle selection
54
+ const handleSelect = (option) => {
55
+ onSelect(option.level);
56
+ };
57
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(BaseSelector, { ref: baseSelectorRef, items: levels, isVisible: isVisible, isLoading: false, selectedIndex: selectedIndex, onSelectIndex: setSelectedIndex, onSelect: handleSelect, onClose: onClose, formatItem: formatItem, title: "Select Log Level", borderColor: "yellowBright", emptyMessage: "No log levels available" }), logFilePath && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: "gray", children: ["\uD83D\uDCC1 Log file: ", logFilePath] }) }))] }));
58
+ });
59
+ export default LogLevelSelector;