@dexto/tui 1.15.0-beta.0 → 1.15.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (554) hide show
  1. package/dist/InkCLIRefactored.cjs +30 -24
  2. package/dist/InkCLIRefactored.d.ts.map +1 -1
  3. package/dist/InkCLIRefactored.js +30 -24
  4. package/dist/components/ApprovalPrompt.cjs +128 -40
  5. package/dist/components/ApprovalPrompt.d.ts +2 -0
  6. package/dist/components/ApprovalPrompt.d.ts.map +1 -1
  7. package/dist/components/ApprovalPrompt.js +128 -41
  8. package/dist/components/CustomInput.cjs +4 -3
  9. package/dist/components/CustomInput.d.ts.map +1 -1
  10. package/dist/components/CustomInput.js +4 -3
  11. package/dist/components/DeckArea.cjs +43 -0
  12. package/dist/components/DeckArea.d.ts +14 -0
  13. package/dist/components/DeckArea.d.ts.map +1 -0
  14. package/dist/components/DeckArea.js +19 -0
  15. package/dist/components/EditableMultiLineInput.cjs +9 -8
  16. package/dist/components/EditableMultiLineInput.d.ts.map +1 -1
  17. package/dist/components/EditableMultiLineInput.js +9 -8
  18. package/dist/components/ElicitationForm.cjs +78 -18
  19. package/dist/components/ElicitationForm.d.ts.map +1 -1
  20. package/dist/components/ElicitationForm.js +78 -18
  21. package/dist/components/ErrorBoundary.cjs +15 -5
  22. package/dist/components/ErrorBoundary.d.ts.map +1 -1
  23. package/dist/components/ErrorBoundary.js +15 -5
  24. package/dist/components/Footer.cjs +37 -113
  25. package/dist/components/Footer.d.ts +2 -2
  26. package/dist/components/Footer.d.ts.map +1 -1
  27. package/dist/components/Footer.js +40 -119
  28. package/dist/components/HistorySearchBar.cjs +6 -5
  29. package/dist/components/HistorySearchBar.d.ts.map +1 -1
  30. package/dist/components/HistorySearchBar.js +6 -5
  31. package/dist/components/MultiLineInput.cjs +6 -5
  32. package/dist/components/MultiLineInput.d.ts.map +1 -1
  33. package/dist/components/MultiLineInput.js +6 -5
  34. package/dist/components/ResourceAutocomplete.cjs +5 -4
  35. package/dist/components/ResourceAutocomplete.d.ts.map +1 -1
  36. package/dist/components/ResourceAutocomplete.js +5 -4
  37. package/dist/components/SignalGates.test.cjs +215 -0
  38. package/dist/components/SignalGates.test.d.ts +2 -0
  39. package/dist/components/SignalGates.test.d.ts.map +1 -0
  40. package/dist/components/SignalGates.test.js +217 -0
  41. package/dist/components/SlashCommandAutocomplete.cjs +4 -3
  42. package/dist/components/SlashCommandAutocomplete.d.ts.map +1 -1
  43. package/dist/components/SlashCommandAutocomplete.js +4 -3
  44. package/dist/components/StatusBar.cjs +13 -30
  45. package/dist/components/StatusBar.d.ts +1 -3
  46. package/dist/components/StatusBar.d.ts.map +1 -1
  47. package/dist/components/StatusBar.js +13 -30
  48. package/dist/components/TextBufferInput.cjs +13 -12
  49. package/dist/components/TextBufferInput.d.ts.map +1 -1
  50. package/dist/components/TextBufferInput.js +13 -12
  51. package/dist/components/TodoPanel.cjs +23 -16
  52. package/dist/components/TodoPanel.d.ts.map +1 -1
  53. package/dist/components/TodoPanel.js +23 -16
  54. package/dist/components/base/BaseAutocomplete.cjs +7 -6
  55. package/dist/components/base/BaseAutocomplete.d.ts.map +1 -1
  56. package/dist/components/base/BaseAutocomplete.js +7 -6
  57. package/dist/components/base/BaseSelector.cjs +5 -4
  58. package/dist/components/base/BaseSelector.d.ts.map +1 -1
  59. package/dist/components/base/BaseSelector.js +5 -4
  60. package/dist/components/chat/Footer.cjs +2 -1
  61. package/dist/components/chat/Footer.d.ts.map +1 -1
  62. package/dist/components/chat/Footer.js +2 -1
  63. package/dist/components/chat/Header.cjs +20 -16
  64. package/dist/components/chat/Header.d.ts.map +1 -1
  65. package/dist/components/chat/Header.js +20 -16
  66. package/dist/components/chat/MessageItem.cjs +47 -30
  67. package/dist/components/chat/MessageItem.d.ts.map +1 -1
  68. package/dist/components/chat/MessageItem.js +52 -29
  69. package/dist/components/chat/MessageList.cjs +3 -2
  70. package/dist/components/chat/MessageList.d.ts.map +1 -1
  71. package/dist/components/chat/MessageList.js +3 -2
  72. package/dist/components/chat/QueuedMessagesDisplay.cjs +17 -5
  73. package/dist/components/chat/QueuedMessagesDisplay.d.ts.map +1 -1
  74. package/dist/components/chat/QueuedMessagesDisplay.js +18 -6
  75. package/dist/components/chat/SignalMessage.cjs +116 -0
  76. package/dist/components/chat/SignalMessage.d.ts +18 -0
  77. package/dist/components/chat/SignalMessage.d.ts.map +1 -0
  78. package/dist/components/chat/SignalMessage.js +96 -0
  79. package/dist/components/chat/SignalMessage.test.cjs +112 -0
  80. package/dist/components/chat/SignalMessage.test.d.ts +2 -0
  81. package/dist/components/chat/SignalMessage.test.d.ts.map +1 -0
  82. package/dist/components/chat/SignalMessage.test.js +116 -0
  83. package/dist/components/chat/ToolIcon.cjs +6 -5
  84. package/dist/components/chat/ToolIcon.d.ts.map +1 -1
  85. package/dist/components/chat/ToolIcon.js +6 -5
  86. package/dist/components/chat/styled-boxes/ConfigBox.cjs +8 -7
  87. package/dist/components/chat/styled-boxes/ConfigBox.d.ts.map +1 -1
  88. package/dist/components/chat/styled-boxes/ConfigBox.js +8 -7
  89. package/dist/components/chat/styled-boxes/HelpBox.cjs +4 -3
  90. package/dist/components/chat/styled-boxes/HelpBox.d.ts.map +1 -1
  91. package/dist/components/chat/styled-boxes/HelpBox.js +4 -3
  92. package/dist/components/chat/styled-boxes/LogConfigBox.cjs +11 -3
  93. package/dist/components/chat/styled-boxes/LogConfigBox.d.ts.map +1 -1
  94. package/dist/components/chat/styled-boxes/LogConfigBox.js +11 -3
  95. package/dist/components/chat/styled-boxes/SessionHistoryBox.cjs +8 -7
  96. package/dist/components/chat/styled-boxes/SessionHistoryBox.d.ts.map +1 -1
  97. package/dist/components/chat/styled-boxes/SessionHistoryBox.js +8 -7
  98. package/dist/components/chat/styled-boxes/SessionListBox.cjs +19 -11
  99. package/dist/components/chat/styled-boxes/SessionListBox.d.ts.map +1 -1
  100. package/dist/components/chat/styled-boxes/SessionListBox.js +19 -11
  101. package/dist/components/chat/styled-boxes/ShortcutsBox.cjs +4 -3
  102. package/dist/components/chat/styled-boxes/ShortcutsBox.d.ts.map +1 -1
  103. package/dist/components/chat/styled-boxes/ShortcutsBox.js +4 -3
  104. package/dist/components/chat/styled-boxes/StatsBox.cjs +13 -5
  105. package/dist/components/chat/styled-boxes/StatsBox.d.ts.map +1 -1
  106. package/dist/components/chat/styled-boxes/StatsBox.js +13 -5
  107. package/dist/components/chat/styled-boxes/StyledBox.cjs +7 -6
  108. package/dist/components/chat/styled-boxes/StyledBox.d.ts.map +1 -1
  109. package/dist/components/chat/styled-boxes/StyledBox.js +7 -6
  110. package/dist/components/chat/styled-boxes/SyspromptBox.cjs +2 -1
  111. package/dist/components/chat/styled-boxes/SyspromptBox.d.ts.map +1 -1
  112. package/dist/components/chat/styled-boxes/SyspromptBox.js +2 -1
  113. package/dist/components/modes/AlternateBufferCLI.cjs +53 -43
  114. package/dist/components/modes/AlternateBufferCLI.d.ts.map +1 -1
  115. package/dist/components/modes/AlternateBufferCLI.js +53 -43
  116. package/dist/components/modes/StaticCLI.cjs +53 -42
  117. package/dist/components/modes/StaticCLI.d.ts.map +1 -1
  118. package/dist/components/modes/StaticCLI.js +53 -42
  119. package/dist/components/overlays/ApiKeyInput.cjs +12 -11
  120. package/dist/components/overlays/ApiKeyInput.d.ts.map +1 -1
  121. package/dist/components/overlays/ApiKeyInput.js +12 -11
  122. package/dist/components/overlays/ChatGPTUsageCapOverlay.cjs +7 -6
  123. package/dist/components/overlays/ChatGPTUsageCapOverlay.d.ts.map +1 -1
  124. package/dist/components/overlays/ChatGPTUsageCapOverlay.js +7 -6
  125. package/dist/components/overlays/CommandOutputOverlay.cjs +2 -1
  126. package/dist/components/overlays/CommandOutputOverlay.d.ts.map +1 -1
  127. package/dist/components/overlays/CommandOutputOverlay.js +2 -1
  128. package/dist/components/overlays/ConnectOverlay.cjs +10 -9
  129. package/dist/components/overlays/ConnectOverlay.d.ts.map +1 -1
  130. package/dist/components/overlays/ConnectOverlay.js +10 -9
  131. package/dist/components/overlays/ContextStatsOverlay.cjs +48 -37
  132. package/dist/components/overlays/ContextStatsOverlay.d.ts.map +1 -1
  133. package/dist/components/overlays/ContextStatsOverlay.js +48 -37
  134. package/dist/components/overlays/CustomModelWizard.cjs +5 -4
  135. package/dist/components/overlays/CustomModelWizard.d.ts.map +1 -1
  136. package/dist/components/overlays/CustomModelWizard.js +5 -4
  137. package/dist/components/overlays/ExportWizard.cjs +28 -27
  138. package/dist/components/overlays/ExportWizard.d.ts.map +1 -1
  139. package/dist/components/overlays/ExportWizard.js +28 -27
  140. package/dist/components/overlays/InsufficientCreditsOverlay.cjs +8 -7
  141. package/dist/components/overlays/InsufficientCreditsOverlay.d.ts.map +1 -1
  142. package/dist/components/overlays/InsufficientCreditsOverlay.js +8 -7
  143. package/dist/components/overlays/LogLevelSelector.cjs +6 -5
  144. package/dist/components/overlays/LogLevelSelector.d.ts.map +1 -1
  145. package/dist/components/overlays/LogLevelSelector.js +6 -5
  146. package/dist/components/overlays/LoginOverlay.cjs +7 -6
  147. package/dist/components/overlays/LoginOverlay.d.ts.map +1 -1
  148. package/dist/components/overlays/LoginOverlay.js +7 -6
  149. package/dist/components/overlays/LogoutOverlay.cjs +10 -9
  150. package/dist/components/overlays/LogoutOverlay.d.ts.map +1 -1
  151. package/dist/components/overlays/LogoutOverlay.js +10 -9
  152. package/dist/components/overlays/MarketplaceAddPrompt.cjs +12 -11
  153. package/dist/components/overlays/MarketplaceAddPrompt.d.ts.map +1 -1
  154. package/dist/components/overlays/MarketplaceAddPrompt.js +12 -11
  155. package/dist/components/overlays/MarketplaceBrowser.cjs +27 -26
  156. package/dist/components/overlays/MarketplaceBrowser.d.ts.map +1 -1
  157. package/dist/components/overlays/MarketplaceBrowser.js +27 -26
  158. package/dist/components/overlays/McpAddChoice.cjs +4 -3
  159. package/dist/components/overlays/McpAddChoice.d.ts.map +1 -1
  160. package/dist/components/overlays/McpAddChoice.js +4 -3
  161. package/dist/components/overlays/McpAddSelector.cjs +4 -3
  162. package/dist/components/overlays/McpAddSelector.d.ts.map +1 -1
  163. package/dist/components/overlays/McpAddSelector.js +4 -3
  164. package/dist/components/overlays/McpCustomTypeSelector.cjs +4 -3
  165. package/dist/components/overlays/McpCustomTypeSelector.d.ts.map +1 -1
  166. package/dist/components/overlays/McpCustomTypeSelector.js +4 -3
  167. package/dist/components/overlays/McpCustomWizard.cjs +9 -8
  168. package/dist/components/overlays/McpCustomWizard.d.ts.map +1 -1
  169. package/dist/components/overlays/McpCustomWizard.js +9 -8
  170. package/dist/components/overlays/McpRemoveSelector.cjs +5 -4
  171. package/dist/components/overlays/McpRemoveSelector.d.ts.map +1 -1
  172. package/dist/components/overlays/McpRemoveSelector.js +5 -4
  173. package/dist/components/overlays/McpSelector.cjs +4 -3
  174. package/dist/components/overlays/McpSelector.d.ts.map +1 -1
  175. package/dist/components/overlays/McpSelector.js +4 -3
  176. package/dist/components/overlays/McpServerActions.cjs +7 -6
  177. package/dist/components/overlays/McpServerActions.d.ts.map +1 -1
  178. package/dist/components/overlays/McpServerActions.js +7 -6
  179. package/dist/components/overlays/McpServerList.cjs +6 -5
  180. package/dist/components/overlays/McpServerList.d.ts.map +1 -1
  181. package/dist/components/overlays/McpServerList.js +6 -5
  182. package/dist/components/overlays/ModelSelectorRefactored.cjs +32 -17
  183. package/dist/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
  184. package/dist/components/overlays/ModelSelectorRefactored.js +32 -17
  185. package/dist/components/overlays/PermissionsSelector.cjs +6 -5
  186. package/dist/components/overlays/PermissionsSelector.d.ts.map +1 -1
  187. package/dist/components/overlays/PermissionsSelector.js +6 -5
  188. package/dist/components/overlays/PluginActions.cjs +7 -6
  189. package/dist/components/overlays/PluginActions.d.ts.map +1 -1
  190. package/dist/components/overlays/PluginActions.js +7 -6
  191. package/dist/components/overlays/PluginList.cjs +12 -11
  192. package/dist/components/overlays/PluginList.d.ts.map +1 -1
  193. package/dist/components/overlays/PluginList.js +12 -11
  194. package/dist/components/overlays/PluginManager.cjs +13 -5
  195. package/dist/components/overlays/PluginManager.d.ts.map +1 -1
  196. package/dist/components/overlays/PluginManager.js +13 -5
  197. package/dist/components/overlays/PromptAddChoice.cjs +5 -4
  198. package/dist/components/overlays/PromptAddChoice.d.ts.map +1 -1
  199. package/dist/components/overlays/PromptAddChoice.js +5 -4
  200. package/dist/components/overlays/PromptAddWizard.cjs +10 -9
  201. package/dist/components/overlays/PromptAddWizard.d.ts.map +1 -1
  202. package/dist/components/overlays/PromptAddWizard.js +10 -9
  203. package/dist/components/overlays/PromptDeleteSelector.cjs +6 -5
  204. package/dist/components/overlays/PromptDeleteSelector.d.ts.map +1 -1
  205. package/dist/components/overlays/PromptDeleteSelector.js +6 -5
  206. package/dist/components/overlays/PromptList.cjs +10 -9
  207. package/dist/components/overlays/PromptList.d.ts.map +1 -1
  208. package/dist/components/overlays/PromptList.js +10 -9
  209. package/dist/components/overlays/ReasoningOverlay.cjs +30 -23
  210. package/dist/components/overlays/ReasoningOverlay.d.ts.map +1 -1
  211. package/dist/components/overlays/ReasoningOverlay.js +30 -23
  212. package/dist/components/overlays/SearchOverlay.cjs +15 -14
  213. package/dist/components/overlays/SearchOverlay.d.ts.map +1 -1
  214. package/dist/components/overlays/SearchOverlay.js +15 -14
  215. package/dist/components/overlays/SessionRenameOverlay.cjs +9 -8
  216. package/dist/components/overlays/SessionRenameOverlay.d.ts.map +1 -1
  217. package/dist/components/overlays/SessionRenameOverlay.js +9 -8
  218. package/dist/components/overlays/SessionSelectorRefactored.cjs +4 -3
  219. package/dist/components/overlays/SessionSelectorRefactored.d.ts.map +1 -1
  220. package/dist/components/overlays/SessionSelectorRefactored.js +4 -3
  221. package/dist/components/overlays/SessionSubcommandSelector.cjs +4 -3
  222. package/dist/components/overlays/SessionSubcommandSelector.d.ts.map +1 -1
  223. package/dist/components/overlays/SessionSubcommandSelector.js +4 -3
  224. package/dist/components/overlays/SoundsSelector.cjs +15 -7
  225. package/dist/components/overlays/SoundsSelector.d.ts.map +1 -1
  226. package/dist/components/overlays/SoundsSelector.js +15 -7
  227. package/dist/components/overlays/StreamSelector.cjs +5 -4
  228. package/dist/components/overlays/StreamSelector.d.ts.map +1 -1
  229. package/dist/components/overlays/StreamSelector.js +5 -4
  230. package/dist/components/overlays/ToolBrowser.cjs +73 -56
  231. package/dist/components/overlays/ToolBrowser.d.ts.map +1 -1
  232. package/dist/components/overlays/ToolBrowser.js +73 -56
  233. package/dist/components/overlays/custom-model-wizard/LocalModelWizard.cjs +103 -69
  234. package/dist/components/overlays/custom-model-wizard/LocalModelWizard.d.ts.map +1 -1
  235. package/dist/components/overlays/custom-model-wizard/LocalModelWizard.js +103 -69
  236. package/dist/components/overlays/custom-model-wizard/shared/ApiKeyStep.cjs +3 -2
  237. package/dist/components/overlays/custom-model-wizard/shared/ApiKeyStep.d.ts.map +1 -1
  238. package/dist/components/overlays/custom-model-wizard/shared/ApiKeyStep.js +3 -2
  239. package/dist/components/overlays/custom-model-wizard/shared/ProviderSelector.cjs +5 -4
  240. package/dist/components/overlays/custom-model-wizard/shared/ProviderSelector.d.ts.map +1 -1
  241. package/dist/components/overlays/custom-model-wizard/shared/ProviderSelector.js +5 -4
  242. package/dist/components/overlays/custom-model-wizard/shared/SetupInfoBanner.cjs +4 -3
  243. package/dist/components/overlays/custom-model-wizard/shared/SetupInfoBanner.d.ts.map +1 -1
  244. package/dist/components/overlays/custom-model-wizard/shared/SetupInfoBanner.js +4 -3
  245. package/dist/components/overlays/custom-model-wizard/shared/WizardStepInput.cjs +7 -6
  246. package/dist/components/overlays/custom-model-wizard/shared/WizardStepInput.d.ts.map +1 -1
  247. package/dist/components/overlays/custom-model-wizard/shared/WizardStepInput.js +7 -6
  248. package/dist/components/renderers/DiffRenderer.cjs +5 -4
  249. package/dist/components/renderers/DiffRenderer.d.ts.map +1 -1
  250. package/dist/components/renderers/DiffRenderer.js +5 -4
  251. package/dist/components/renderers/FilePreviewRenderer.cjs +23 -13
  252. package/dist/components/renderers/FilePreviewRenderer.d.ts.map +1 -1
  253. package/dist/components/renderers/FilePreviewRenderer.js +23 -13
  254. package/dist/components/renderers/FileRenderer.cjs +9 -8
  255. package/dist/components/renderers/FileRenderer.d.ts.map +1 -1
  256. package/dist/components/renderers/FileRenderer.js +9 -8
  257. package/dist/components/renderers/GenericRenderer.cjs +5 -4
  258. package/dist/components/renderers/GenericRenderer.d.ts.map +1 -1
  259. package/dist/components/renderers/GenericRenderer.js +5 -4
  260. package/dist/components/renderers/SearchRenderer.cjs +4 -3
  261. package/dist/components/renderers/SearchRenderer.d.ts.map +1 -1
  262. package/dist/components/renderers/SearchRenderer.js +4 -3
  263. package/dist/components/renderers/ShellRenderer.cjs +6 -5
  264. package/dist/components/renderers/ShellRenderer.d.ts.map +1 -1
  265. package/dist/components/renderers/ShellRenderer.js +6 -5
  266. package/dist/components/renderers/SignalDiff.cjs +139 -0
  267. package/dist/components/renderers/SignalDiff.d.ts +21 -0
  268. package/dist/components/renderers/SignalDiff.d.ts.map +1 -0
  269. package/dist/components/renderers/SignalDiff.js +106 -0
  270. package/dist/components/renderers/SignalDiff.test.cjs +78 -0
  271. package/dist/components/renderers/SignalDiff.test.d.ts +2 -0
  272. package/dist/components/renderers/SignalDiff.test.d.ts.map +1 -0
  273. package/dist/components/renderers/SignalDiff.test.js +77 -0
  274. package/dist/components/renderers/diff-shared.cjs +13 -7
  275. package/dist/components/renderers/diff-shared.d.ts +5 -0
  276. package/dist/components/renderers/diff-shared.d.ts.map +1 -1
  277. package/dist/components/renderers/diff-shared.js +12 -7
  278. package/dist/components/shared/FocusOverlayFrame.cjs +3 -2
  279. package/dist/components/shared/FocusOverlayFrame.d.ts.map +1 -1
  280. package/dist/components/shared/FocusOverlayFrame.js +3 -2
  281. package/dist/components/shared/HintBar.cjs +2 -1
  282. package/dist/components/shared/HintBar.d.ts.map +1 -1
  283. package/dist/components/shared/HintBar.js +2 -1
  284. package/dist/components/shared/MarkdownText.cjs +36 -53
  285. package/dist/components/shared/MarkdownText.d.ts +2 -0
  286. package/dist/components/shared/MarkdownText.d.ts.map +1 -1
  287. package/dist/components/shared/MarkdownText.js +36 -54
  288. package/dist/components/shared/VirtualizedList.cjs +2 -1
  289. package/dist/components/shared/VirtualizedList.d.ts.map +1 -1
  290. package/dist/components/shared/VirtualizedList.js +2 -1
  291. package/dist/containers/OverlayContainer.cjs +2 -4
  292. package/dist/containers/OverlayContainer.d.ts.map +1 -1
  293. package/dist/containers/OverlayContainer.js +2 -4
  294. package/dist/contexts/KeypressContext.cjs +7 -1
  295. package/dist/contexts/KeypressContext.d.ts.map +1 -1
  296. package/dist/contexts/KeypressContext.js +7 -1
  297. package/dist/contexts/KeypressContext.test.cjs +82 -0
  298. package/dist/contexts/KeypressContext.test.d.ts +2 -0
  299. package/dist/contexts/KeypressContext.test.d.ts.map +1 -0
  300. package/dist/contexts/KeypressContext.test.js +81 -0
  301. package/dist/hooks/useAgentEvents.cjs +1 -74
  302. package/dist/hooks/useAgentEvents.d.ts.map +1 -1
  303. package/dist/hooks/useAgentEvents.js +1 -74
  304. package/dist/hooks/useCLIState.cjs +0 -3
  305. package/dist/hooks/useCLIState.d.ts.map +1 -1
  306. package/dist/hooks/useCLIState.js +0 -3
  307. package/dist/hooks/useContextStats.cjs +91 -0
  308. package/dist/hooks/useContextStats.d.ts +13 -0
  309. package/dist/hooks/useContextStats.d.ts.map +1 -0
  310. package/dist/hooks/useContextStats.js +67 -0
  311. package/dist/hooks/useDeckState.cjs +140 -0
  312. package/dist/hooks/useDeckState.d.ts +20 -0
  313. package/dist/hooks/useDeckState.d.ts.map +1 -0
  314. package/dist/hooks/useDeckState.js +123 -0
  315. package/dist/hooks/useDextoCredits.cjs +81 -0
  316. package/dist/hooks/useDextoCredits.d.ts +14 -0
  317. package/dist/hooks/useDextoCredits.d.ts.map +1 -0
  318. package/dist/hooks/useDextoCredits.js +56 -0
  319. package/dist/hooks/useDextoCredits.test.cjs +73 -0
  320. package/dist/hooks/useDextoCredits.test.d.ts +2 -0
  321. package/dist/hooks/useDextoCredits.test.d.ts.map +1 -0
  322. package/dist/hooks/useDextoCredits.test.js +72 -0
  323. package/dist/hooks/useElapsedTime.cjs +13 -24
  324. package/dist/hooks/useElapsedTime.d.ts +3 -1
  325. package/dist/hooks/useElapsedTime.d.ts.map +1 -1
  326. package/dist/hooks/useElapsedTime.js +13 -24
  327. package/dist/hooks/useElapsedTime.test.cjs +35 -0
  328. package/dist/hooks/useElapsedTime.test.d.ts +2 -0
  329. package/dist/hooks/useElapsedTime.test.d.ts.map +1 -0
  330. package/dist/hooks/useElapsedTime.test.js +34 -0
  331. package/dist/hooks/useGitDirtyFiles.cjs +59 -0
  332. package/dist/hooks/useGitDirtyFiles.d.ts +5 -0
  333. package/dist/hooks/useGitDirtyFiles.d.ts.map +1 -0
  334. package/dist/hooks/useGitDirtyFiles.js +34 -0
  335. package/dist/hooks/useGitDirtyFiles.test.cjs +9 -0
  336. package/dist/hooks/useGitDirtyFiles.test.d.ts +2 -0
  337. package/dist/hooks/useGitDirtyFiles.test.d.ts.map +1 -0
  338. package/dist/hooks/useGitDirtyFiles.test.js +8 -0
  339. package/dist/hooks/useHeldValue.cjs +33 -0
  340. package/dist/hooks/useHeldValue.d.ts +3 -0
  341. package/dist/hooks/useHeldValue.d.ts.map +1 -0
  342. package/dist/hooks/useHeldValue.js +9 -0
  343. package/dist/hooks/useHeldValue.test.cjs +31 -0
  344. package/dist/hooks/useHeldValue.test.d.ts +2 -0
  345. package/dist/hooks/useHeldValue.test.d.ts.map +1 -0
  346. package/dist/hooks/useHeldValue.test.js +30 -0
  347. package/dist/hooks/useInputOrchestrator.cjs +22 -30
  348. package/dist/hooks/useInputOrchestrator.d.ts +2 -0
  349. package/dist/hooks/useInputOrchestrator.d.ts.map +1 -1
  350. package/dist/hooks/useInputOrchestrator.js +21 -30
  351. package/dist/hooks/useInputOrchestrator.test.cjs +24 -0
  352. package/dist/hooks/useInputOrchestrator.test.d.ts +2 -0
  353. package/dist/hooks/useInputOrchestrator.test.d.ts.map +1 -0
  354. package/dist/hooks/useInputOrchestrator.test.js +23 -0
  355. package/dist/interactive-commands/command-parser.cjs +13 -21
  356. package/dist/interactive-commands/command-parser.d.ts.map +1 -1
  357. package/dist/interactive-commands/command-parser.js +13 -11
  358. package/dist/interactive-commands/general-commands.cjs +8 -7
  359. package/dist/interactive-commands/general-commands.d.ts.map +1 -1
  360. package/dist/interactive-commands/general-commands.js +8 -7
  361. package/dist/services/processStream.cjs +31 -19
  362. package/dist/services/processStream.d.ts.map +1 -1
  363. package/dist/services/processStream.js +32 -20
  364. package/dist/services/processStream.test.cjs +51 -3
  365. package/dist/services/processStream.test.js +51 -3
  366. package/dist/signal/background.cjs +154 -0
  367. package/dist/signal/background.d.ts +43 -0
  368. package/dist/signal/background.d.ts.map +1 -0
  369. package/dist/signal/background.js +124 -0
  370. package/dist/signal/background.test.cjs +186 -0
  371. package/dist/signal/background.test.d.ts +2 -0
  372. package/dist/signal/background.test.d.ts.map +1 -0
  373. package/dist/signal/background.test.js +192 -0
  374. package/dist/signal/caps.cjs +100 -0
  375. package/dist/signal/caps.d.ts +23 -0
  376. package/dist/signal/caps.d.ts.map +1 -0
  377. package/dist/signal/caps.js +73 -0
  378. package/dist/signal/caps.test.cjs +56 -0
  379. package/dist/signal/caps.test.d.ts +2 -0
  380. package/dist/signal/caps.test.d.ts.map +1 -0
  381. package/dist/signal/caps.test.js +55 -0
  382. package/dist/signal/components.cjs +257 -0
  383. package/dist/signal/components.d.ts +120 -0
  384. package/dist/signal/components.d.ts.map +1 -0
  385. package/dist/signal/components.js +226 -0
  386. package/dist/signal/components.test.cjs +156 -0
  387. package/dist/signal/components.test.d.ts +2 -0
  388. package/dist/signal/components.test.d.ts.map +1 -0
  389. package/dist/signal/components.test.js +133 -0
  390. package/dist/signal/cut.cjs +103 -0
  391. package/dist/signal/cut.d.ts +11 -0
  392. package/dist/signal/cut.d.ts.map +1 -0
  393. package/dist/signal/cut.js +77 -0
  394. package/dist/signal/cut.test.cjs +20 -0
  395. package/dist/signal/cut.test.d.ts +2 -0
  396. package/dist/signal/cut.test.d.ts.map +1 -0
  397. package/dist/signal/cut.test.js +19 -0
  398. package/dist/signal/deck-layout.cjs +57 -0
  399. package/dist/signal/deck-layout.d.ts +29 -0
  400. package/dist/signal/deck-layout.d.ts.map +1 -0
  401. package/dist/signal/deck-layout.js +30 -0
  402. package/dist/signal/deck-parts.cjs +243 -0
  403. package/dist/signal/deck-parts.d.ts +55 -0
  404. package/dist/signal/deck-parts.d.ts.map +1 -0
  405. package/dist/signal/deck-parts.js +205 -0
  406. package/dist/signal/deck.test.cjs +311 -0
  407. package/dist/signal/deck.test.d.ts +2 -0
  408. package/dist/signal/deck.test.d.ts.map +1 -0
  409. package/dist/signal/deck.test.js +288 -0
  410. package/dist/signal/glyphs.cjs +195 -0
  411. package/dist/signal/glyphs.d.ts +8 -0
  412. package/dist/signal/glyphs.d.ts.map +1 -0
  413. package/dist/signal/glyphs.js +171 -0
  414. package/dist/signal/glyphs.test.cjs +17 -0
  415. package/dist/signal/glyphs.test.d.ts +2 -0
  416. package/dist/signal/glyphs.test.d.ts.map +1 -0
  417. package/dist/signal/glyphs.test.js +16 -0
  418. package/dist/signal/harness.cjs +103 -0
  419. package/dist/signal/harness.d.ts +70 -0
  420. package/dist/signal/harness.d.ts.map +1 -0
  421. package/dist/signal/harness.js +67 -0
  422. package/dist/signal/harness.test.cjs +84 -0
  423. package/dist/signal/harness.test.d.ts +2 -0
  424. package/dist/signal/harness.test.d.ts.map +1 -0
  425. package/dist/signal/harness.test.js +61 -0
  426. package/dist/signal/index.cjs +76 -0
  427. package/dist/signal/index.d.ts +8 -0
  428. package/dist/signal/index.d.ts.map +1 -0
  429. package/dist/signal/index.js +45 -0
  430. package/dist/signal/kit.snapshot.test.cjs +56 -0
  431. package/dist/signal/kit.snapshot.test.d.ts +2 -0
  432. package/dist/signal/kit.snapshot.test.d.ts.map +1 -0
  433. package/dist/signal/kit.snapshot.test.js +55 -0
  434. package/dist/signal/no-raw-colours.test.cjs +32 -0
  435. package/dist/signal/no-raw-colours.test.d.ts +2 -0
  436. package/dist/signal/no-raw-colours.test.d.ts.map +1 -0
  437. package/dist/signal/no-raw-colours.test.js +30 -0
  438. package/dist/signal/paint.cjs +76 -0
  439. package/dist/signal/paint.d.ts +15 -0
  440. package/dist/signal/paint.d.ts.map +1 -0
  441. package/dist/signal/paint.js +41 -0
  442. package/dist/signal/paint.test.cjs +98 -0
  443. package/dist/signal/paint.test.d.ts +2 -0
  444. package/dist/signal/paint.test.d.ts.map +1 -0
  445. package/dist/signal/paint.test.js +75 -0
  446. package/dist/signal/tone.cjs +109 -0
  447. package/dist/signal/tone.d.ts +17 -0
  448. package/dist/signal/tone.d.ts.map +1 -0
  449. package/dist/signal/tone.js +83 -0
  450. package/dist/signal/tone.test.cjs +70 -0
  451. package/dist/signal/tone.test.d.ts +2 -0
  452. package/dist/signal/tone.test.d.ts.map +1 -0
  453. package/dist/signal/tone.test.js +69 -0
  454. package/dist/signal/trace.cjs +142 -0
  455. package/dist/signal/trace.d.ts +41 -0
  456. package/dist/signal/trace.d.ts.map +1 -0
  457. package/dist/signal/trace.js +113 -0
  458. package/dist/signal/trace.test.cjs +50 -0
  459. package/dist/signal/trace.test.d.ts +2 -0
  460. package/dist/signal/trace.test.d.ts.map +1 -0
  461. package/dist/signal/trace.test.js +49 -0
  462. package/dist/signal/use-trace.cjs +73 -0
  463. package/dist/signal/use-trace.d.ts +5 -0
  464. package/dist/signal/use-trace.d.ts.map +1 -0
  465. package/dist/signal/use-trace.js +48 -0
  466. package/dist/signal/wordmark-art.generated.cjs +375 -0
  467. package/dist/signal/wordmark-art.generated.d.ts +3 -0
  468. package/dist/signal/wordmark-art.generated.d.ts.map +1 -0
  469. package/dist/signal/wordmark-art.generated.js +351 -0
  470. package/dist/signal/wordmark.cjs +60 -0
  471. package/dist/signal/wordmark.d.ts +23 -0
  472. package/dist/signal/wordmark.d.ts.map +1 -0
  473. package/dist/signal/wordmark.js +34 -0
  474. package/dist/signal/wordmark.test.cjs +71 -0
  475. package/dist/signal/wordmark.test.d.ts +2 -0
  476. package/dist/signal/wordmark.test.d.ts.map +1 -0
  477. package/dist/signal/wordmark.test.js +70 -0
  478. package/dist/state/initialState.cjs +0 -3
  479. package/dist/state/initialState.d.ts.map +1 -1
  480. package/dist/state/initialState.js +0 -3
  481. package/dist/state/types.d.ts +13 -7
  482. package/dist/state/types.d.ts.map +1 -1
  483. package/dist/utils/approval-response.cjs +45 -0
  484. package/dist/utils/approval-response.d.ts +14 -0
  485. package/dist/utils/approval-response.d.ts.map +1 -0
  486. package/dist/utils/approval-response.js +21 -0
  487. package/dist/utils/approval-response.test.cjs +49 -0
  488. package/dist/utils/approval-response.test.d.ts +2 -0
  489. package/dist/utils/approval-response.test.d.ts.map +1 -0
  490. package/dist/utils/approval-response.test.js +55 -0
  491. package/dist/utils/approvalScope.cjs +12 -0
  492. package/dist/utils/approvalScope.d.ts.map +1 -1
  493. package/dist/utils/approvalScope.js +12 -0
  494. package/dist/utils/approvalScope.test.cjs +23 -0
  495. package/dist/utils/approvalScope.test.d.ts +2 -0
  496. package/dist/utils/approvalScope.test.d.ts.map +1 -0
  497. package/dist/utils/approvalScope.test.js +22 -0
  498. package/dist/utils/background-failure.cjs +51 -0
  499. package/dist/utils/background-failure.d.ts +12 -0
  500. package/dist/utils/background-failure.d.ts.map +1 -0
  501. package/dist/utils/background-failure.js +26 -0
  502. package/dist/utils/chatgpt-rate-limit.cjs +10 -0
  503. package/dist/utils/chatgpt-rate-limit.d.ts +9 -0
  504. package/dist/utils/chatgpt-rate-limit.d.ts.map +1 -1
  505. package/dist/utils/chatgpt-rate-limit.js +9 -0
  506. package/dist/utils/chatgpt-rate-limit.test.cjs +10 -0
  507. package/dist/utils/chatgpt-rate-limit.test.js +11 -0
  508. package/dist/utils/deck-state.cjs +107 -0
  509. package/dist/utils/deck-state.d.ts +79 -0
  510. package/dist/utils/deck-state.d.ts.map +1 -0
  511. package/dist/utils/deck-state.js +76 -0
  512. package/dist/utils/deck-state.test.cjs +208 -0
  513. package/dist/utils/deck-state.test.d.ts +2 -0
  514. package/dist/utils/deck-state.test.d.ts.map +1 -0
  515. package/dist/utils/deck-state.test.js +216 -0
  516. package/dist/utils/fault-block.cjs +37 -0
  517. package/dist/utils/fault-block.d.ts +13 -0
  518. package/dist/utils/fault-block.d.ts.map +1 -0
  519. package/dist/utils/fault-block.js +13 -0
  520. package/dist/utils/fault-block.test.cjs +23 -0
  521. package/dist/utils/fault-block.test.d.ts +2 -0
  522. package/dist/utils/fault-block.test.d.ts.map +1 -0
  523. package/dist/utils/fault-block.test.js +22 -0
  524. package/dist/utils/messageFormatting.cjs +26 -23
  525. package/dist/utils/messageFormatting.d.ts +5 -2
  526. package/dist/utils/messageFormatting.d.ts.map +1 -1
  527. package/dist/utils/messageFormatting.js +25 -21
  528. package/dist/utils/messageFormatting.test.cjs +34 -0
  529. package/dist/utils/messageFormatting.test.js +35 -1
  530. package/dist/utils/reasoning-variant.cjs +35 -0
  531. package/dist/utils/reasoning-variant.d.ts +13 -0
  532. package/dist/utils/reasoning-variant.d.ts.map +1 -0
  533. package/dist/utils/reasoning-variant.js +11 -0
  534. package/dist/utils/resize-reflow.cjs +119 -0
  535. package/dist/utils/resize-reflow.d.ts +18 -0
  536. package/dist/utils/resize-reflow.d.ts.map +1 -0
  537. package/dist/utils/resize-reflow.js +83 -0
  538. package/dist/utils/resize-reflow.test.cjs +100 -0
  539. package/dist/utils/resize-reflow.test.d.ts +2 -0
  540. package/dist/utils/resize-reflow.test.d.ts.map +1 -0
  541. package/dist/utils/resize-reflow.test.js +99 -0
  542. package/dist/utils/tool-step.cjs +183 -0
  543. package/dist/utils/tool-step.d.ts +28 -0
  544. package/dist/utils/tool-step.d.ts.map +1 -0
  545. package/dist/utils/tool-step.js +156 -0
  546. package/dist/utils/tool-step.test.cjs +263 -0
  547. package/dist/utils/tool-step.test.d.ts +2 -0
  548. package/dist/utils/tool-step.test.d.ts.map +1 -0
  549. package/dist/utils/tool-step.test.js +262 -0
  550. package/package.json +7 -3
  551. package/dist/components/BackgroundTasksPanel.cjs +0 -117
  552. package/dist/components/BackgroundTasksPanel.d.ts +0 -18
  553. package/dist/components/BackgroundTasksPanel.d.ts.map +0 -1
  554. package/dist/components/BackgroundTasksPanel.js +0 -93
@@ -18,7 +18,8 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var ApprovalPrompt_exports = {};
20
20
  __export(ApprovalPrompt_exports, {
21
- ApprovalPrompt: () => ApprovalPrompt
21
+ ApprovalPrompt: () => ApprovalPrompt,
22
+ approvalGateTitle: () => approvalGateTitle
22
23
  });
23
24
  module.exports = __toCommonJS(ApprovalPrompt_exports);
24
25
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -27,13 +28,36 @@ var import_ink = require("ink");
27
28
  var import_core = require("@dexto/core");
28
29
  var import_ElicitationForm = require("./ElicitationForm.js");
29
30
  var import_renderers = require("./renderers/index.js");
31
+ var import_SignalDiff = require("./renderers/SignalDiff.js");
30
32
  var import_toolUtils = require("../utils/toolUtils.js");
31
33
  var import_approvalScope = require("../utils/approvalScope.js");
32
34
  var import_messageFormatting = require("../utils/messageFormatting.js");
35
+ var import_diff_shared = require("./renderers/diff-shared.js");
36
+ var import_signal = require("../signal/index.js");
37
+ const OPTION_KEYS = {
38
+ yes: "y",
39
+ "yes-session": "a",
40
+ "yes-accept-edits": "e",
41
+ no: "n"
42
+ };
43
+ function approvalGateTitle(type, toolName) {
44
+ if (type === import_core.ApprovalType.COMMAND_APPROVAL || toolName === "bash_exec") {
45
+ return "NEEDS YOU \xB7 RUN A COMMAND";
46
+ }
47
+ if (toolName === "plan_review") return "NEEDS YOU \xB7 REVIEW THE PLAN";
48
+ if (toolName === "edit_file") return "NEEDS YOU \xB7 EDIT A FILE";
49
+ if (toolName === "write_file") return "NEEDS YOU \xB7 WRITE A FILE";
50
+ return "NEEDS YOU \xB7 USE A TOOL";
51
+ }
52
+ const GATE_INSET = 4;
33
53
  const ApprovalPrompt = (0, import_react.forwardRef)(
34
54
  ({ approval, onApprove, onDeny, onCancel }, ref) => {
35
55
  const isCommandApproval = approval.type === import_core.ApprovalType.COMMAND_APPROVAL;
36
56
  const isElicitation = approval.type === "elicitation";
57
+ const { palette, glyphs } = (0, import_signal.useCaps)();
58
+ const signal = palette === "signal";
59
+ const { stdout } = (0, import_ink.useStdout)();
60
+ const columns = stdout?.columns ?? 80;
37
61
  const toolName = approval.metadata.toolName;
38
62
  const toolArgs = approval.metadata.args || {};
39
63
  const approvalKey = typeof approval.metadata.approvalKey === "string" ? approval.metadata.approvalKey : void 0;
@@ -71,6 +95,13 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
71
95
  const elicitationFormRef = (0, import_react.useRef)(null);
72
96
  const selectedIndexRef = (0, import_react.useRef)(0);
73
97
  const options = [];
98
+ const chooseOption = (id) => {
99
+ if (id === "plan-approve" || id === "yes") onApprove({});
100
+ else if (id === "yes-session") onApprove({ rememberChoice: true });
101
+ else if (id === "plan-approve-accept-edits" || id === "yes-accept-edits") {
102
+ onApprove({ enableAcceptEditsMode: true });
103
+ } else if (id === "no") onDeny();
104
+ };
74
105
  if (isPlanReview) {
75
106
  options.push({ id: "plan-approve", label: "Approve" });
76
107
  options.push({ id: "plan-approve-accept-edits", label: "Approve + Accept All Edits" });
@@ -122,12 +153,12 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
122
153
  }
123
154
  return true;
124
155
  }
125
- if (key.upArrow) {
156
+ if (key.upArrow || signal && !isPlanReview && key.leftArrow) {
126
157
  setSelectedIndex(
127
158
  (current) => current === 0 ? totalOptions - 1 : current - 1
128
159
  );
129
160
  return true;
130
- } else if (key.downArrow) {
161
+ } else if (key.downArrow || signal && !isPlanReview && key.rightArrow) {
131
162
  setSelectedIndex(
132
163
  (current) => current === totalOptions - 1 ? 0 : current + 1
133
164
  );
@@ -135,19 +166,7 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
135
166
  } else if (key.return) {
136
167
  const option = getCurrentOption();
137
168
  if (!option) return false;
138
- if (option.id === "plan-approve") {
139
- onApprove({});
140
- } else if (option.id === "plan-approve-accept-edits") {
141
- onApprove({ enableAcceptEditsMode: true });
142
- } else if (option.id === "yes") {
143
- onApprove({});
144
- } else if (option.id === "yes-session") {
145
- onApprove({ rememberChoice: true });
146
- } else if (option.id === "yes-accept-edits") {
147
- onApprove({ enableAcceptEditsMode: true });
148
- } else if (option.id === "no") {
149
- onDeny();
150
- }
169
+ chooseOption(option.id);
151
170
  return true;
152
171
  } else if (key.shift && key.tab && canAcceptEdits) {
153
172
  onApprove({ enableAcceptEditsMode: true });
@@ -156,10 +175,20 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
156
175
  onCancel();
157
176
  return true;
158
177
  }
178
+ if (signal && !isPlanReview && !key.ctrl && !key.meta) {
179
+ const shortcut = options.find(
180
+ (option) => OPTION_KEYS[option.id] === input.toLowerCase()
181
+ );
182
+ if (shortcut) {
183
+ chooseOption(shortcut.id);
184
+ return true;
185
+ }
186
+ }
159
187
  return false;
160
188
  }
161
189
  }),
162
190
  [
191
+ signal,
163
192
  isElicitation,
164
193
  canAcceptEdits,
165
194
  isPlanReview,
@@ -191,30 +220,30 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
191
220
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_renderers.DiffPreview, { data: displayPreview });
192
221
  case "shell":
193
222
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "column", marginBottom: 1, children: [
194
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginBottom: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "cyan", bold: true, children: displayPreview.title ?? "Bash" }) }),
223
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginBottom: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("teal"), bold: true, children: displayPreview.title ?? "Bash" }) }),
195
224
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
196
225
  import_ink.Box,
197
226
  {
198
227
  flexDirection: "column",
199
228
  borderStyle: "round",
200
- borderColor: "gray",
229
+ borderColor: (0, import_signal.tone)("dim"),
201
230
  paddingX: 1,
202
231
  children: [
203
- displayPreview.command.split("\n").map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "yellowBright", wrap: "wrap", children: [
232
+ displayPreview.command.split("\n").map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("amber"), wrap: "wrap", children: [
204
233
  i === 0 ? "$ " : " ",
205
234
  line
206
235
  ] }, i)),
207
- displayPreview.isBackground && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: "(background)" })
236
+ displayPreview.isBackground && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: "(background)" })
208
237
  ]
209
238
  }
210
239
  ),
211
- callDescription && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginTop: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: callDescription }) })
240
+ callDescription && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginTop: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: callDescription }) })
212
241
  ] });
213
242
  case "file":
214
243
  if (displayPreview.content) {
215
244
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_renderers.CreateFilePreview, { data: displayPreview });
216
245
  }
217
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "gray", children: [
246
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: [
218
247
  displayPreview.operation === "read" && `Read ${displayPreview.lineCount ?? "file"} lines`,
219
248
  displayPreview.operation === "write" && `Write to ${displayPreview.path}`,
220
249
  displayPreview.operation === "delete" && `Delete ${displayPreview.path}`
@@ -224,9 +253,66 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
224
253
  }
225
254
  };
226
255
  const showHeaderBlock = isCommandApproval || !displayPreview;
227
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { paddingX: 0, paddingY: 0, flexDirection: "column", children: [
256
+ if (signal && !isPlanReview) {
257
+ const shellCommand = displayPreview?.type === "shell" ? displayPreview.command : command ?? null;
258
+ const preview = displayPreview?.type === "shell" ? null : displayPreview?.type === "diff" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
259
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { bold: true, color: (0, import_signal.tone)("hi"), children: [
260
+ (0, import_messageFormatting.makeRelativePath)(displayPreview.filename),
261
+ " ",
262
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("add"), children: [
263
+ "+",
264
+ displayPreview.additions
265
+ ] }),
266
+ " ",
267
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("del"), children: (0, import_signal.glyphText)(`\u2212${displayPreview.deletions}`, glyphs) })
268
+ ] }),
269
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SignalDiff.SignalDiff, { data: displayPreview, width: columns - GATE_INSET })
270
+ ] }) : renderPreview();
271
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_diff_shared.DiffInsetContext.Provider, { value: GATE_INSET, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
272
+ import_signal.GateFrame,
273
+ {
274
+ title: approvalGateTitle(approval.type, toolName),
275
+ hint: "\u2190\u2192 choose \xB7 \u23CE confirm \xB7 esc cancel",
276
+ children: [
277
+ shellCommand !== null ? shellCommand.split("\n").map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { bold: true, color: (0, import_signal.tone)("hi"), children: [
278
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("amber"), children: i === 0 ? "$ " : " " }),
279
+ line
280
+ ] }, i)) : preview === null && formattedTool ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("hi"), children: formattedTool.header }) : preview,
281
+ displayPreview?.type === "shell" && displayPreview.isBackground && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: "(background)" }),
282
+ callDescription && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: callDescription }),
283
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexWrap: "wrap", columnGap: 3, children: options.map((option, index) => {
284
+ const selected = index === selectedIndex;
285
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { children: [
286
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { children: [
287
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { bold: true, color: (0, import_signal.tone)("amber"), children: selected ? (0, import_signal.glyphText)("\u203A ", glyphs) : " " }),
288
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
289
+ import_ink.Text,
290
+ {
291
+ bold: true,
292
+ color: (0, import_signal.tone)("amber"),
293
+ backgroundColor: (0, import_signal.tone)("s2"),
294
+ children: ` ${OPTION_KEYS[option.id] ?? ""} `
295
+ }
296
+ ),
297
+ " "
298
+ ] }) }),
299
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexShrink: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
300
+ import_ink.Text,
301
+ {
302
+ bold: selected,
303
+ color: (0, import_signal.tone)(selected ? "hi" : "fg"),
304
+ children: option.label
305
+ }
306
+ ) })
307
+ ] }, option.id);
308
+ }) })
309
+ ]
310
+ }
311
+ ) });
312
+ }
313
+ const prompt = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { paddingX: 0, paddingY: 0, flexDirection: "column", children: [
228
314
  showHeaderBlock && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "column", marginBottom: 0, children: isCommandApproval ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
229
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "yellowBright", bold: true, children: [
315
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("amber"), bold: true, children: [
230
316
  "Confirm command:",
231
317
  " "
232
318
  ] }) }),
@@ -235,22 +321,22 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
235
321
  {
236
322
  flexDirection: "column",
237
323
  borderStyle: "round",
238
- borderColor: "gray",
324
+ borderColor: (0, import_signal.tone)("dim"),
239
325
  paddingX: 1,
240
- children: command.split("\n").map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "red", wrap: "wrap", children: line }, i))
326
+ children: command.split("\n").map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("red"), wrap: "wrap", children: line }, i))
241
327
  }
242
328
  ) })
243
329
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
244
330
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "row", children: [
245
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "yellowBright", bold: true, children: [
331
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("amber"), bold: true, children: [
246
332
  "Confirm:",
247
333
  " "
248
334
  ] }),
249
- formattedTool && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "cyan", children: formattedTool.header })
335
+ formattedTool && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("teal"), children: formattedTool.header })
250
336
  ] }),
251
337
  callDescription && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "row", marginTop: 0, children: [
252
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: " " }),
253
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "gray", children: callDescription })
338
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: " " }),
339
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: callDescription })
254
340
  ] })
255
341
  ] }) }),
256
342
  renderPreview(),
@@ -258,10 +344,10 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
258
344
  options.map((option, index) => {
259
345
  const isSelected = index === selectedIndex;
260
346
  const isNo = option.id === "no";
261
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { children: isSelected ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: isNo ? "red" : "green", bold: true, children: [
347
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { children: isSelected ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: isNo ? (0, import_signal.tone)("red") : (0, import_signal.tone)("add"), bold: true, children: [
262
348
  " \u25B6 ",
263
349
  option.label
264
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "gray", children: [
350
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: [
265
351
  " ",
266
352
  option.label
267
353
  ] }) }, option.id);
@@ -269,32 +355,34 @@ const ApprovalPrompt = (0, import_react.forwardRef)(
269
355
  isPlanReview && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { children: selectedIndex === options.length ? (
270
356
  // Selected - show editable input
271
357
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "row", children: [
272
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "red", bold: true, children: " \u25B6 " }),
273
- feedbackText ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "white", children: [
358
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("red"), bold: true, children: " \u25B6 " }),
359
+ feedbackText ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("hi"), children: [
274
360
  feedbackText,
275
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "cyan", children: "\u258B" })
276
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "gray", children: [
361
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("teal"), children: "\u258B" })
362
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: [
277
363
  "What changes would you like?",
278
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: "cyan", children: "\u258B" })
364
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Text, { color: (0, import_signal.tone)("teal"), children: "\u258B" })
279
365
  ] })
280
366
  ] })
281
367
  ) : (
282
368
  // Not selected - show placeholder
283
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "gray", children: [
369
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: [
284
370
  " ",
285
371
  feedbackText || "What changes would you like?"
286
372
  ] })
287
373
  ) })
288
374
  ] }),
289
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginTop: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "gray", children: [
375
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ink.Box, { marginTop: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: (0, import_signal.tone)("dim"), children: [
290
376
  " ",
291
377
  "\u2191\u2193 to select \u2022 Enter to confirm \u2022 Esc to cancel"
292
378
  ] }) })
293
379
  ] });
380
+ return signal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_diff_shared.DiffInsetContext.Provider, { value: GATE_INSET, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_signal.GateFrame, { title: approvalGateTitle(approval.type, toolName), children: prompt }) }) : prompt;
294
381
  }
295
382
  );
296
383
  ApprovalPrompt.displayName = "ApprovalPrompt";
297
384
  // Annotate the CommonJS export names for ESM import in node:
298
385
  0 && (module.exports = {
299
- ApprovalPrompt
386
+ ApprovalPrompt,
387
+ approvalGateTitle
300
388
  });
@@ -31,6 +31,8 @@ interface ApprovalPromptProps {
31
31
  onDeny: (feedback?: string) => void;
32
32
  onCancel: () => void;
33
33
  }
34
+ /** The gate's title: what the agent is waiting to do. */
35
+ export declare function approvalGateTitle(type: string, toolName: string | undefined): string;
34
36
  /**
35
37
  * Compact approval prompt component that displays above the input area
36
38
  * Shows options based on approval type:
@@ -1 +1 @@
1
- {"version":3,"file":"ApprovalPrompt.d.ts","sourceRoot":"","sources":["../../src/components/ApprovalPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EACR,kBAAkB,EAGlB,0BAA0B,EAC7B,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAO5D,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,0BAA0B,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACjC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,mDAAmD;IACnD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,UAAU,mBAAmB;IACzB,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC9C,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAYD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,kGAsY1B,CAAC"}
1
+ {"version":3,"file":"ApprovalPrompt.d.ts","sourceRoot":"","sources":["../../src/components/ApprovalPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EACR,kBAAkB,EAGlB,0BAA0B,EAC7B,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAU5D,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,0BAA0B,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACjC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,mDAAmD;IACnD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,UAAU,mBAAmB;IACzB,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC9C,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAUD,yDAAyD;AACzD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAQpF;AAeD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,kGAke1B,CAAC"}
@@ -7,17 +7,40 @@ import {
7
7
  useEffect,
8
8
  useMemo
9
9
  } from "react";
10
- import { Box, Text } from "ink";
10
+ import { Box, Text, useStdout } from "ink";
11
11
  import { ApprovalType, isToolPresentationSnapshotV1 } from "@dexto/core";
12
12
  import { ElicitationForm } from "./ElicitationForm.js";
13
13
  import { DiffPreview, CreateFilePreview } from "./renderers/index.js";
14
+ import { SignalDiff } from "./renderers/SignalDiff.js";
14
15
  import { isEditWriteTool } from "../utils/toolUtils.js";
15
16
  import { formatApprovalScope } from "../utils/approvalScope.js";
16
- import { formatToolHeader } from "../utils/messageFormatting.js";
17
+ import { formatToolHeader, makeRelativePath } from "../utils/messageFormatting.js";
18
+ import { DiffInsetContext } from "./renderers/diff-shared.js";
19
+ import { GateFrame, glyphText, tone, useCaps } from "../signal/index.js";
20
+ const OPTION_KEYS = {
21
+ yes: "y",
22
+ "yes-session": "a",
23
+ "yes-accept-edits": "e",
24
+ no: "n"
25
+ };
26
+ function approvalGateTitle(type, toolName) {
27
+ if (type === ApprovalType.COMMAND_APPROVAL || toolName === "bash_exec") {
28
+ return "NEEDS YOU \xB7 RUN A COMMAND";
29
+ }
30
+ if (toolName === "plan_review") return "NEEDS YOU \xB7 REVIEW THE PLAN";
31
+ if (toolName === "edit_file") return "NEEDS YOU \xB7 EDIT A FILE";
32
+ if (toolName === "write_file") return "NEEDS YOU \xB7 WRITE A FILE";
33
+ return "NEEDS YOU \xB7 USE A TOOL";
34
+ }
35
+ const GATE_INSET = 4;
17
36
  const ApprovalPrompt = forwardRef(
18
37
  ({ approval, onApprove, onDeny, onCancel }, ref) => {
19
38
  const isCommandApproval = approval.type === ApprovalType.COMMAND_APPROVAL;
20
39
  const isElicitation = approval.type === "elicitation";
40
+ const { palette, glyphs } = useCaps();
41
+ const signal = palette === "signal";
42
+ const { stdout } = useStdout();
43
+ const columns = stdout?.columns ?? 80;
21
44
  const toolName = approval.metadata.toolName;
22
45
  const toolArgs = approval.metadata.args || {};
23
46
  const approvalKey = typeof approval.metadata.approvalKey === "string" ? approval.metadata.approvalKey : void 0;
@@ -55,6 +78,13 @@ const ApprovalPrompt = forwardRef(
55
78
  const elicitationFormRef = useRef(null);
56
79
  const selectedIndexRef = useRef(0);
57
80
  const options = [];
81
+ const chooseOption = (id) => {
82
+ if (id === "plan-approve" || id === "yes") onApprove({});
83
+ else if (id === "yes-session") onApprove({ rememberChoice: true });
84
+ else if (id === "plan-approve-accept-edits" || id === "yes-accept-edits") {
85
+ onApprove({ enableAcceptEditsMode: true });
86
+ } else if (id === "no") onDeny();
87
+ };
58
88
  if (isPlanReview) {
59
89
  options.push({ id: "plan-approve", label: "Approve" });
60
90
  options.push({ id: "plan-approve-accept-edits", label: "Approve + Accept All Edits" });
@@ -106,12 +136,12 @@ const ApprovalPrompt = forwardRef(
106
136
  }
107
137
  return true;
108
138
  }
109
- if (key.upArrow) {
139
+ if (key.upArrow || signal && !isPlanReview && key.leftArrow) {
110
140
  setSelectedIndex(
111
141
  (current) => current === 0 ? totalOptions - 1 : current - 1
112
142
  );
113
143
  return true;
114
- } else if (key.downArrow) {
144
+ } else if (key.downArrow || signal && !isPlanReview && key.rightArrow) {
115
145
  setSelectedIndex(
116
146
  (current) => current === totalOptions - 1 ? 0 : current + 1
117
147
  );
@@ -119,19 +149,7 @@ const ApprovalPrompt = forwardRef(
119
149
  } else if (key.return) {
120
150
  const option = getCurrentOption();
121
151
  if (!option) return false;
122
- if (option.id === "plan-approve") {
123
- onApprove({});
124
- } else if (option.id === "plan-approve-accept-edits") {
125
- onApprove({ enableAcceptEditsMode: true });
126
- } else if (option.id === "yes") {
127
- onApprove({});
128
- } else if (option.id === "yes-session") {
129
- onApprove({ rememberChoice: true });
130
- } else if (option.id === "yes-accept-edits") {
131
- onApprove({ enableAcceptEditsMode: true });
132
- } else if (option.id === "no") {
133
- onDeny();
134
- }
152
+ chooseOption(option.id);
135
153
  return true;
136
154
  } else if (key.shift && key.tab && canAcceptEdits) {
137
155
  onApprove({ enableAcceptEditsMode: true });
@@ -140,10 +158,20 @@ const ApprovalPrompt = forwardRef(
140
158
  onCancel();
141
159
  return true;
142
160
  }
161
+ if (signal && !isPlanReview && !key.ctrl && !key.meta) {
162
+ const shortcut = options.find(
163
+ (option) => OPTION_KEYS[option.id] === input.toLowerCase()
164
+ );
165
+ if (shortcut) {
166
+ chooseOption(shortcut.id);
167
+ return true;
168
+ }
169
+ }
143
170
  return false;
144
171
  }
145
172
  }),
146
173
  [
174
+ signal,
147
175
  isElicitation,
148
176
  canAcceptEdits,
149
177
  isPlanReview,
@@ -175,30 +203,30 @@ const ApprovalPrompt = forwardRef(
175
203
  return /* @__PURE__ */ jsx(DiffPreview, { data: displayPreview });
176
204
  case "shell":
177
205
  return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
178
- /* @__PURE__ */ jsx(Box, { marginBottom: 0, children: /* @__PURE__ */ jsx(Text, { color: "cyan", bold: true, children: displayPreview.title ?? "Bash" }) }),
206
+ /* @__PURE__ */ jsx(Box, { marginBottom: 0, children: /* @__PURE__ */ jsx(Text, { color: tone("teal"), bold: true, children: displayPreview.title ?? "Bash" }) }),
179
207
  /* @__PURE__ */ jsxs(
180
208
  Box,
181
209
  {
182
210
  flexDirection: "column",
183
211
  borderStyle: "round",
184
- borderColor: "gray",
212
+ borderColor: tone("dim"),
185
213
  paddingX: 1,
186
214
  children: [
187
- displayPreview.command.split("\n").map((line, i) => /* @__PURE__ */ jsxs(Text, { color: "yellowBright", wrap: "wrap", children: [
215
+ displayPreview.command.split("\n").map((line, i) => /* @__PURE__ */ jsxs(Text, { color: tone("amber"), wrap: "wrap", children: [
188
216
  i === 0 ? "$ " : " ",
189
217
  line
190
218
  ] }, i)),
191
- displayPreview.isBackground && /* @__PURE__ */ jsx(Text, { color: "gray", children: "(background)" })
219
+ displayPreview.isBackground && /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: "(background)" })
192
220
  ]
193
221
  }
194
222
  ),
195
- callDescription && /* @__PURE__ */ jsx(Box, { marginTop: 0, children: /* @__PURE__ */ jsx(Text, { color: "gray", children: callDescription }) })
223
+ callDescription && /* @__PURE__ */ jsx(Box, { marginTop: 0, children: /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: callDescription }) })
196
224
  ] });
197
225
  case "file":
198
226
  if (displayPreview.content) {
199
227
  return /* @__PURE__ */ jsx(CreateFilePreview, { data: displayPreview });
200
228
  }
201
- return /* @__PURE__ */ jsx(Box, { marginBottom: 1, children: /* @__PURE__ */ jsxs(Text, { color: "gray", children: [
229
+ return /* @__PURE__ */ jsx(Box, { marginBottom: 1, children: /* @__PURE__ */ jsxs(Text, { color: tone("dim"), children: [
202
230
  displayPreview.operation === "read" && `Read ${displayPreview.lineCount ?? "file"} lines`,
203
231
  displayPreview.operation === "write" && `Write to ${displayPreview.path}`,
204
232
  displayPreview.operation === "delete" && `Delete ${displayPreview.path}`
@@ -208,9 +236,66 @@ const ApprovalPrompt = forwardRef(
208
236
  }
209
237
  };
210
238
  const showHeaderBlock = isCommandApproval || !displayPreview;
211
- return /* @__PURE__ */ jsxs(Box, { paddingX: 0, paddingY: 0, flexDirection: "column", children: [
239
+ if (signal && !isPlanReview) {
240
+ const shellCommand = displayPreview?.type === "shell" ? displayPreview.command : command ?? null;
241
+ const preview = displayPreview?.type === "shell" ? null : displayPreview?.type === "diff" ? /* @__PURE__ */ jsxs(Fragment, { children: [
242
+ /* @__PURE__ */ jsxs(Text, { bold: true, color: tone("hi"), children: [
243
+ makeRelativePath(displayPreview.filename),
244
+ " ",
245
+ /* @__PURE__ */ jsxs(Text, { color: tone("add"), children: [
246
+ "+",
247
+ displayPreview.additions
248
+ ] }),
249
+ " ",
250
+ /* @__PURE__ */ jsx(Text, { color: tone("del"), children: glyphText(`\u2212${displayPreview.deletions}`, glyphs) })
251
+ ] }),
252
+ /* @__PURE__ */ jsx(SignalDiff, { data: displayPreview, width: columns - GATE_INSET })
253
+ ] }) : renderPreview();
254
+ return /* @__PURE__ */ jsx(DiffInsetContext.Provider, { value: GATE_INSET, children: /* @__PURE__ */ jsxs(
255
+ GateFrame,
256
+ {
257
+ title: approvalGateTitle(approval.type, toolName),
258
+ hint: "\u2190\u2192 choose \xB7 \u23CE confirm \xB7 esc cancel",
259
+ children: [
260
+ shellCommand !== null ? shellCommand.split("\n").map((line, i) => /* @__PURE__ */ jsxs(Text, { bold: true, color: tone("hi"), children: [
261
+ /* @__PURE__ */ jsx(Text, { color: tone("amber"), children: i === 0 ? "$ " : " " }),
262
+ line
263
+ ] }, i)) : preview === null && formattedTool ? /* @__PURE__ */ jsx(Text, { color: tone("hi"), children: formattedTool.header }) : preview,
264
+ displayPreview?.type === "shell" && displayPreview.isBackground && /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: "(background)" }),
265
+ callDescription && /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: callDescription }),
266
+ /* @__PURE__ */ jsx(Box, { flexWrap: "wrap", columnGap: 3, children: options.map((option, index) => {
267
+ const selected = index === selectedIndex;
268
+ return /* @__PURE__ */ jsxs(Box, { children: [
269
+ /* @__PURE__ */ jsx(Box, { flexShrink: 0, children: /* @__PURE__ */ jsxs(Text, { children: [
270
+ /* @__PURE__ */ jsx(Text, { bold: true, color: tone("amber"), children: selected ? glyphText("\u203A ", glyphs) : " " }),
271
+ /* @__PURE__ */ jsx(
272
+ Text,
273
+ {
274
+ bold: true,
275
+ color: tone("amber"),
276
+ backgroundColor: tone("s2"),
277
+ children: ` ${OPTION_KEYS[option.id] ?? ""} `
278
+ }
279
+ ),
280
+ " "
281
+ ] }) }),
282
+ /* @__PURE__ */ jsx(Box, { flexShrink: 1, children: /* @__PURE__ */ jsx(
283
+ Text,
284
+ {
285
+ bold: selected,
286
+ color: tone(selected ? "hi" : "fg"),
287
+ children: option.label
288
+ }
289
+ ) })
290
+ ] }, option.id);
291
+ }) })
292
+ ]
293
+ }
294
+ ) });
295
+ }
296
+ const prompt = /* @__PURE__ */ jsxs(Box, { paddingX: 0, paddingY: 0, flexDirection: "column", children: [
212
297
  showHeaderBlock && /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginBottom: 0, children: isCommandApproval ? /* @__PURE__ */ jsxs(Fragment, { children: [
213
- /* @__PURE__ */ jsx(Box, { flexDirection: "row", children: /* @__PURE__ */ jsxs(Text, { color: "yellowBright", bold: true, children: [
298
+ /* @__PURE__ */ jsx(Box, { flexDirection: "row", children: /* @__PURE__ */ jsxs(Text, { color: tone("amber"), bold: true, children: [
214
299
  "Confirm command:",
215
300
  " "
216
301
  ] }) }),
@@ -219,22 +304,22 @@ const ApprovalPrompt = forwardRef(
219
304
  {
220
305
  flexDirection: "column",
221
306
  borderStyle: "round",
222
- borderColor: "gray",
307
+ borderColor: tone("dim"),
223
308
  paddingX: 1,
224
- children: command.split("\n").map((line, i) => /* @__PURE__ */ jsx(Text, { color: "red", wrap: "wrap", children: line }, i))
309
+ children: command.split("\n").map((line, i) => /* @__PURE__ */ jsx(Text, { color: tone("red"), wrap: "wrap", children: line }, i))
225
310
  }
226
311
  ) })
227
312
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
228
313
  /* @__PURE__ */ jsxs(Box, { flexDirection: "row", children: [
229
- /* @__PURE__ */ jsxs(Text, { color: "yellowBright", bold: true, children: [
314
+ /* @__PURE__ */ jsxs(Text, { color: tone("amber"), bold: true, children: [
230
315
  "Confirm:",
231
316
  " "
232
317
  ] }),
233
- formattedTool && /* @__PURE__ */ jsx(Text, { color: "cyan", children: formattedTool.header })
318
+ formattedTool && /* @__PURE__ */ jsx(Text, { color: tone("teal"), children: formattedTool.header })
234
319
  ] }),
235
320
  callDescription && /* @__PURE__ */ jsxs(Box, { flexDirection: "row", marginTop: 0, children: [
236
- /* @__PURE__ */ jsx(Text, { color: "gray", children: " " }),
237
- /* @__PURE__ */ jsx(Text, { color: "gray", children: callDescription })
321
+ /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: " " }),
322
+ /* @__PURE__ */ jsx(Text, { color: tone("dim"), children: callDescription })
238
323
  ] })
239
324
  ] }) }),
240
325
  renderPreview(),
@@ -242,10 +327,10 @@ const ApprovalPrompt = forwardRef(
242
327
  options.map((option, index) => {
243
328
  const isSelected = index === selectedIndex;
244
329
  const isNo = option.id === "no";
245
- return /* @__PURE__ */ jsx(Box, { children: isSelected ? /* @__PURE__ */ jsxs(Text, { color: isNo ? "red" : "green", bold: true, children: [
330
+ return /* @__PURE__ */ jsx(Box, { children: isSelected ? /* @__PURE__ */ jsxs(Text, { color: isNo ? tone("red") : tone("add"), bold: true, children: [
246
331
  " \u25B6 ",
247
332
  option.label
248
- ] }) : /* @__PURE__ */ jsxs(Text, { color: "gray", children: [
333
+ ] }) : /* @__PURE__ */ jsxs(Text, { color: tone("dim"), children: [
249
334
  " ",
250
335
  option.label
251
336
  ] }) }, option.id);
@@ -253,31 +338,33 @@ const ApprovalPrompt = forwardRef(
253
338
  isPlanReview && /* @__PURE__ */ jsx(Box, { children: selectedIndex === options.length ? (
254
339
  // Selected - show editable input
255
340
  /* @__PURE__ */ jsxs(Box, { flexDirection: "row", children: [
256
- /* @__PURE__ */ jsx(Text, { color: "red", bold: true, children: " \u25B6 " }),
257
- feedbackText ? /* @__PURE__ */ jsxs(Text, { color: "white", children: [
341
+ /* @__PURE__ */ jsx(Text, { color: tone("red"), bold: true, children: " \u25B6 " }),
342
+ feedbackText ? /* @__PURE__ */ jsxs(Text, { color: tone("hi"), children: [
258
343
  feedbackText,
259
- /* @__PURE__ */ jsx(Text, { color: "cyan", children: "\u258B" })
260
- ] }) : /* @__PURE__ */ jsxs(Text, { color: "gray", children: [
344
+ /* @__PURE__ */ jsx(Text, { color: tone("teal"), children: "\u258B" })
345
+ ] }) : /* @__PURE__ */ jsxs(Text, { color: tone("dim"), children: [
261
346
  "What changes would you like?",
262
- /* @__PURE__ */ jsx(Text, { color: "cyan", children: "\u258B" })
347
+ /* @__PURE__ */ jsx(Text, { color: tone("teal"), children: "\u258B" })
263
348
  ] })
264
349
  ] })
265
350
  ) : (
266
351
  // Not selected - show placeholder
267
- /* @__PURE__ */ jsxs(Text, { color: "gray", children: [
352
+ /* @__PURE__ */ jsxs(Text, { color: tone("dim"), children: [
268
353
  " ",
269
354
  feedbackText || "What changes would you like?"
270
355
  ] })
271
356
  ) })
272
357
  ] }),
273
- /* @__PURE__ */ jsx(Box, { marginTop: 0, children: /* @__PURE__ */ jsxs(Text, { color: "gray", children: [
358
+ /* @__PURE__ */ jsx(Box, { marginTop: 0, children: /* @__PURE__ */ jsxs(Text, { color: tone("dim"), children: [
274
359
  " ",
275
360
  "\u2191\u2193 to select \u2022 Enter to confirm \u2022 Esc to cancel"
276
361
  ] }) })
277
362
  ] });
363
+ return signal ? /* @__PURE__ */ jsx(DiffInsetContext.Provider, { value: GATE_INSET, children: /* @__PURE__ */ jsx(GateFrame, { title: approvalGateTitle(approval.type, toolName), children: prompt }) }) : prompt;
278
364
  }
279
365
  );
280
366
  ApprovalPrompt.displayName = "ApprovalPrompt";
281
367
  export {
282
- ApprovalPrompt
368
+ ApprovalPrompt,
369
+ approvalGateTitle
283
370
  };