@deepseek-harness-tui/dsh-tui 0.16.1 → 0.18.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 (488) hide show
  1. package/README.md +213 -34
  2. package/assets/plugin-icon.svg +13 -0
  3. package/assets/windows-installer.cs +308 -0
  4. package/assets/windows-installer.ps1 +17 -0
  5. package/bin/dsh-tui.js +64 -5
  6. package/cli/adapters/dsh/index.mjs +111 -0
  7. package/cli/adapters/dsh/locate.mjs +73 -0
  8. package/cli/adapters/dsh/management-plugin.mjs +111 -0
  9. package/cli/args.mjs +154 -0
  10. package/cli/contracts.d.ts +48 -0
  11. package/cli/engine.mjs +92 -0
  12. package/cli/entry.mjs +48 -0
  13. package/cli/process.mjs +118 -0
  14. package/cli/protocol.mjs +23 -0
  15. package/cli/schema-v1.json +33 -0
  16. package/cordis.patch.yml +3 -1
  17. package/cordis.yml +3 -1
  18. package/guide/dsh-tui-guide/SKILL.md +1 -0
  19. package/guide/dsh-tui-guide/cli.en.md +114 -0
  20. package/guide/dsh-tui-guide/cli.md +114 -0
  21. package/guide/dsh-tui-guide/configuration.en.md +7 -5
  22. package/guide/dsh-tui-guide/configuration.md +7 -5
  23. package/guide/dsh-tui-guide/getting-started.en.md +33 -3
  24. package/guide/dsh-tui-guide/getting-started.md +23 -2
  25. package/guide/dsh-tui-guide/interaction.en.md +50 -17
  26. package/guide/dsh-tui-guide/interaction.md +35 -13
  27. package/guide/dsh-tui-guide/plugins.en.md +63 -11
  28. package/guide/dsh-tui-guide/plugins.md +41 -7
  29. package/guide/dsh-tui-guide/user-guide.en.md +55 -34
  30. package/guide/dsh-tui-guide/user-guide.md +45 -28
  31. package/lib/settings.json +85 -42
  32. package/lib/types/adapter/channel/plugins.d.ts.map +1 -1
  33. package/lib/types/adapter/channel/plugins.js +8 -0
  34. package/lib/types/adapter/channel/ui-policy.d.ts +2 -1
  35. package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
  36. package/lib/types/adapter/channel/ui-policy.js +4 -0
  37. package/lib/types/adapter/ports/channel-display.d.ts +10 -0
  38. package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
  39. package/lib/types/adapter/ports/channel-session.d.ts +2 -0
  40. package/lib/types/adapter/ports/channel-session.d.ts.map +1 -1
  41. package/lib/types/adapter/ports/channel-settings.d.ts +20 -0
  42. package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
  43. package/lib/types/adapter/ports/channel-ui.d.ts +22 -2
  44. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  45. package/lib/types/adapter/ports/channel-view.d.ts +11 -1
  46. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  47. package/lib/types/adapter/ports/channel.d.ts +7 -0
  48. package/lib/types/adapter/ports/channel.d.ts.map +1 -1
  49. package/lib/types/adapter/standard/grants.d.ts +60 -0
  50. package/lib/types/adapter/standard/grants.d.ts.map +1 -1
  51. package/lib/types/adapter/standard/grants.js +74 -0
  52. package/lib/types/agent/capabilities.d.ts +2 -0
  53. package/lib/types/agent/capabilities.d.ts.map +1 -1
  54. package/lib/types/agent/events.d.ts +15 -1
  55. package/lib/types/agent/events.d.ts.map +1 -1
  56. package/lib/types/api.d.ts +2 -2
  57. package/lib/types/api.d.ts.map +1 -1
  58. package/lib/types/backends/claude/translate/events.d.ts.map +1 -1
  59. package/lib/types/backends/claude/translate/events.js +2 -1
  60. package/lib/types/backends/codex/auth/status.js +1 -1
  61. package/lib/types/backends/codex/session/controls.d.ts.map +1 -1
  62. package/lib/types/backends/codex/session/controls.js +6 -5
  63. package/lib/types/backends/codex/session/goals.d.ts.map +1 -1
  64. package/lib/types/backends/codex/session/side-query.d.ts.map +1 -1
  65. package/lib/types/backends/codex/translate/events.d.ts.map +1 -1
  66. package/lib/types/backends/codex/translate/events.js +3 -1
  67. package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -1
  68. package/lib/types/backends/shared/channel-tokens.js +9 -8
  69. package/lib/types/channel/history-restore.d.ts.map +1 -1
  70. package/lib/types/channel/history-restore.js +2 -0
  71. package/lib/types/channel/interaction.d.ts.map +1 -1
  72. package/lib/types/channel/interaction.js +1 -0
  73. package/lib/types/channel/projection.d.ts +1 -1
  74. package/lib/types/channel/projection.d.ts.map +1 -1
  75. package/lib/types/channel/projection.js +19 -4
  76. package/lib/types/channel/questions.d.ts +2 -0
  77. package/lib/types/channel/questions.d.ts.map +1 -1
  78. package/lib/types/channel/sanitize.d.ts +14 -0
  79. package/lib/types/channel/sanitize.d.ts.map +1 -1
  80. package/lib/types/channel/sanitize.js +55 -0
  81. package/lib/types/channel/working-directory.d.ts +9 -0
  82. package/lib/types/channel/working-directory.d.ts.map +1 -0
  83. package/lib/types/channel/working-directory.js +7 -0
  84. package/lib/types/commands.d.ts +8 -1
  85. package/lib/types/commands.d.ts.map +1 -1
  86. package/lib/types/commands.js +14 -5
  87. package/lib/types/components/ChatTitle.d.ts +7 -0
  88. package/lib/types/components/ChatTitle.d.ts.map +1 -0
  89. package/lib/types/components/ChatTitle.js +15 -0
  90. package/lib/types/components/CodeBlockFrame.d.ts.map +1 -1
  91. package/lib/types/components/CodeBlockFrame.js +10 -5
  92. package/lib/types/components/CompactionStatusRow.d.ts.map +1 -1
  93. package/lib/types/components/CompactionStatusRow.js +24 -3
  94. package/lib/types/components/GoalTodoPanel.d.ts +73 -6
  95. package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
  96. package/lib/types/components/GoalTodoPanel.js +165 -17
  97. package/lib/types/components/Markdown.d.ts +9 -1
  98. package/lib/types/components/Markdown.d.ts.map +1 -1
  99. package/lib/types/components/Markdown.js +5 -4
  100. package/lib/types/components/MessageList.d.ts.map +1 -1
  101. package/lib/types/components/MessageList.js +20 -14
  102. package/lib/types/components/PluginGrantList.d.ts +45 -0
  103. package/lib/types/components/PluginGrantList.d.ts.map +1 -0
  104. package/lib/types/components/PluginGrantList.js +126 -0
  105. package/lib/types/components/PluginInstallPane.d.ts.map +1 -1
  106. package/lib/types/components/PluginInstallPane.js +35 -6
  107. package/lib/types/components/PluginManagePane.d.ts.map +1 -1
  108. package/lib/types/components/PluginManagePane.js +65 -8
  109. package/lib/types/components/PromptInput.d.ts +13 -5
  110. package/lib/types/components/PromptInput.d.ts.map +1 -1
  111. package/lib/types/components/PromptInput.js +190 -108
  112. package/lib/types/components/SplitDiffView.d.ts.map +1 -1
  113. package/lib/types/components/SplitDiffView.js +232 -22
  114. package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
  115. package/lib/types/components/SubagentDashboard.js +10 -0
  116. package/lib/types/components/SubagentDetailScene.d.ts +3 -1
  117. package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
  118. package/lib/types/components/SubagentDetailScene.js +17 -1
  119. package/lib/types/components/Whale.d.ts.map +1 -1
  120. package/lib/types/components/Whale.js +8 -5
  121. package/lib/types/components/approvals/ApprovalPanel.d.ts +1 -1
  122. package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
  123. package/lib/types/components/approvals/ApprovalPanel.js +93 -11
  124. package/lib/types/components/bigfont.d.ts.map +1 -1
  125. package/lib/types/components/bigfont.js +2 -1
  126. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +2 -1
  127. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  128. package/lib/types/components/messages/AssistantToolUseMessage.js +24 -11
  129. package/lib/types/components/onboardingModel.d.ts +2 -2
  130. package/lib/types/components/onboardingModel.js +3 -3
  131. package/lib/types/components/onboardingProviderPlan.d.ts +110 -0
  132. package/lib/types/components/onboardingProviderPlan.d.ts.map +1 -0
  133. package/lib/types/components/onboardingProviderPlan.js +78 -0
  134. package/lib/types/components/previewRows.d.ts +19 -0
  135. package/lib/types/components/previewRows.d.ts.map +1 -0
  136. package/lib/types/components/previewRows.js +46 -0
  137. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  138. package/lib/types/components/questions/AskUserQuestionPanel.js +75 -10
  139. package/lib/types/components/sessions/ForeignSessionRow.d.ts +3 -9
  140. package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -1
  141. package/lib/types/components/sessions/ForeignSessionRow.js +6 -10
  142. package/lib/types/components/sessions/SessionListRow.d.ts +4 -9
  143. package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
  144. package/lib/types/components/sessions/SessionListRow.js +18 -10
  145. package/lib/types/components/sidePanel/InfoPanel.d.ts.map +1 -1
  146. package/lib/types/components/sidePanel/InfoPanel.js +4 -3
  147. package/lib/types/components/sidePanel/SidePanelLayout.d.ts.map +1 -1
  148. package/lib/types/components/sidePanel/SidePanelLayout.js +5 -5
  149. package/lib/types/components/sidePanel/WorkspacePanel.d.ts.map +1 -1
  150. package/lib/types/components/sidePanel/WorkspacePanel.js +19 -7
  151. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +7 -0
  152. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
  153. package/lib/types/components/sidePanel/btw/BtwComposer.js +16 -0
  154. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
  155. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +8 -1
  156. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +7 -1
  157. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
  158. package/lib/types/components/sidePanel/btw/BtwThreadScene.js +8 -1
  159. package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts +30 -0
  160. package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts.map +1 -0
  161. package/lib/types/components/sidePanel/btw/useBtwComposerPaste.js +94 -0
  162. package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
  163. package/lib/types/components/sidePanel/builtinPanels.js +36 -18
  164. package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts.map +1 -1
  165. package/lib/types/components/sidePanel/companion/CompanionPanel.js +2 -1
  166. package/lib/types/components/sidePanel/panelMarkdown.d.ts +32 -0
  167. package/lib/types/components/sidePanel/panelMarkdown.d.ts.map +1 -0
  168. package/lib/types/components/sidePanel/panelMarkdown.js +45 -0
  169. package/lib/types/components/sidePanel/pluginPanelAdapter.d.ts.map +1 -1
  170. package/lib/types/components/sidePanel/pluginPanelAdapter.js +6 -1
  171. package/lib/types/components/sidePanel/subagentFailureRead.d.ts +21 -0
  172. package/lib/types/components/sidePanel/subagentFailureRead.d.ts.map +1 -0
  173. package/lib/types/components/sidePanel/subagentFailureRead.js +66 -0
  174. package/lib/types/components/sidePanel/types.d.ts +2 -0
  175. package/lib/types/components/sidePanel/types.d.ts.map +1 -1
  176. package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
  177. package/lib/types/components/sidePanel/useSidePanel.js +39 -7
  178. package/lib/types/components/trajectory/MiniWake.d.ts +2 -2
  179. package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -1
  180. package/lib/types/components/trajectory/MiniWake.js +7 -3
  181. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
  182. package/lib/types/components/workspaces/HomeWorkspaceRow.js +4 -7
  183. package/lib/types/dsh-adapter/backend/session.d.ts +7 -1
  184. package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
  185. package/lib/types/dsh-adapter/backend/session.js +62 -6
  186. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  187. package/lib/types/dsh-adapter/backend/translate.js +18 -4
  188. package/lib/types/dsh-adapter/backend-admission.d.ts +3 -3
  189. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +1 -1
  190. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -1
  191. package/lib/types/dsh-adapter/channel/agent-view-projection.js +3 -1
  192. package/lib/types/dsh-adapter/channel/binding-events.d.ts +5 -1
  193. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
  194. package/lib/types/dsh-adapter/channel/binding-events.js +18 -1
  195. package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
  196. package/lib/types/dsh-adapter/channel/command-completions.js +6 -8
  197. package/lib/types/dsh-adapter/channel/composer-images.d.ts +11 -1
  198. package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
  199. package/lib/types/dsh-adapter/channel/composer-images.js +121 -113
  200. package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
  201. package/lib/types/dsh-adapter/channel/composer-mentions.js +38 -17
  202. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +1 -1
  203. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
  204. package/lib/types/dsh-adapter/channel/context-bookkeeping.js +9 -5
  205. package/lib/types/dsh-adapter/channel/core/actions.d.ts +1 -1
  206. package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -1
  207. package/lib/types/dsh-adapter/channel/core/actions.js +23 -2
  208. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +10 -1
  209. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
  210. package/lib/types/dsh-adapter/channel/core/binding-feed.js +48 -3
  211. package/lib/types/dsh-adapter/channel/core/compose.d.ts +5 -2
  212. package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
  213. package/lib/types/dsh-adapter/channel/core/compose.js +7 -0
  214. package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
  215. package/lib/types/dsh-adapter/channel/core/files.js +2 -1
  216. package/lib/types/dsh-adapter/channel/core/host.d.ts +14 -10
  217. package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -1
  218. package/lib/types/dsh-adapter/channel/core/host.js +192 -13
  219. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +1 -0
  220. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
  221. package/lib/types/dsh-adapter/channel/core/local-actions.js +32 -3
  222. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  223. package/lib/types/dsh-adapter/channel/extensions.js +31 -5
  224. package/lib/types/dsh-adapter/channel/input-actions.d.ts +2 -2
  225. package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
  226. package/lib/types/dsh-adapter/channel/input-actions.js +34 -0
  227. package/lib/types/dsh-adapter/channel/input-delivery.d.ts +5 -2
  228. package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
  229. package/lib/types/dsh-adapter/channel/input-delivery.js +31 -4
  230. package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -1
  231. package/lib/types/dsh-adapter/channel/mentions.js +21 -7
  232. package/lib/types/dsh-adapter/channel/model-actions.d.ts +1 -1
  233. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
  234. package/lib/types/dsh-adapter/channel/model-actions.js +7 -1
  235. package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
  236. package/lib/types/dsh-adapter/channel/model-selection.js +6 -4
  237. package/lib/types/dsh-adapter/channel/paths.d.ts.map +1 -1
  238. package/lib/types/dsh-adapter/channel/paths.js +11 -9
  239. package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
  240. package/lib/types/dsh-adapter/channel/session-fork.js +1 -0
  241. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +1 -1
  242. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
  243. package/lib/types/dsh-adapter/channel/session-live-adoption.js +6 -1
  244. package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
  245. package/lib/types/dsh-adapter/channel/session-metadata.js +15 -2
  246. package/lib/types/dsh-adapter/channel/session-reset.d.ts +1 -1
  247. package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
  248. package/lib/types/dsh-adapter/channel/session-reset.js +7 -1
  249. package/lib/types/dsh-adapter/channel/session-resume.d.ts +1 -1
  250. package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
  251. package/lib/types/dsh-adapter/channel/session-resume.js +56 -36
  252. package/lib/types/dsh-adapter/channel/session-rewind.d.ts +1 -1
  253. package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
  254. package/lib/types/dsh-adapter/channel/session-rewind.js +3 -1
  255. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts +1 -1
  256. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
  257. package/lib/types/dsh-adapter/channel/session-tree-actions.js +3 -1
  258. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  259. package/lib/types/dsh-adapter/channel/settings-host.js +10 -3
  260. package/lib/types/dsh-adapter/channel/state.d.ts +1 -1
  261. package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
  262. package/lib/types/dsh-adapter/channel/state.js +2 -2
  263. package/lib/types/dsh-adapter/channel/types.d.ts +13 -1
  264. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
  265. package/lib/types/dsh-adapter/compat/liveSession.d.ts +3 -3
  266. package/lib/types/dsh-adapter/compat/liveSession.js +3 -3
  267. package/lib/types/dsh-adapter/compat/sessionLog.d.ts +1 -1
  268. package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
  269. package/lib/types/dsh-adapter/compat/sessionLog.js +17 -1
  270. package/lib/types/dsh-adapter/contract.d.ts +7 -5
  271. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  272. package/lib/types/dsh-adapter/contract.js +10 -5
  273. package/lib/types/dsh-adapter/effect-ledger.d.ts +1 -1
  274. package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
  275. package/lib/types/dsh-adapter/effect-ledger.js +1 -0
  276. package/lib/types/dsh-adapter/entry-slot.d.ts +6 -0
  277. package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -1
  278. package/lib/types/dsh-adapter/experimental-bundles.d.ts +29 -0
  279. package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -0
  280. package/lib/types/dsh-adapter/experimental-bundles.js +15 -0
  281. package/lib/types/dsh-adapter/grant-file.d.ts +70 -0
  282. package/lib/types/dsh-adapter/grant-file.d.ts.map +1 -0
  283. package/lib/types/dsh-adapter/grant-file.js +178 -0
  284. package/lib/types/dsh-adapter/host-access.d.ts +4 -0
  285. package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
  286. package/lib/types/dsh-adapter/host-access.js +54 -4
  287. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  288. package/lib/types/dsh-adapter/host-contract.js +2 -2
  289. package/lib/types/dsh-adapter/host-dsh.js +3 -3
  290. package/lib/types/dsh-adapter/index.d.ts +8 -4
  291. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  292. package/lib/types/dsh-adapter/index.js +17 -12
  293. package/lib/types/dsh-adapter/panels.d.ts +28 -8
  294. package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
  295. package/lib/types/dsh-adapter/panels.js +11 -56
  296. package/lib/types/dsh-adapter/plugin-declaration.d.ts +28 -0
  297. package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -1
  298. package/lib/types/dsh-adapter/plugin-declaration.js +43 -1
  299. package/lib/types/dsh-adapter/plugin-install.d.ts +28 -1
  300. package/lib/types/dsh-adapter/plugin-install.d.ts.map +1 -1
  301. package/lib/types/dsh-adapter/plugin-install.js +160 -13
  302. package/lib/types/dsh-adapter/plugin-manage.d.ts +53 -10
  303. package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
  304. package/lib/types/dsh-adapter/plugin-manage.js +240 -51
  305. package/lib/types/dsh-adapter/plugin.d.ts +81 -0
  306. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  307. package/lib/types/dsh-adapter/plugin.js +378 -84
  308. package/lib/types/dsh-adapter/plugins-info.d.ts +6 -7
  309. package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
  310. package/lib/types/dsh-adapter/plugins-info.js +99 -31
  311. package/lib/types/dsh-adapter/presets.d.ts +19 -6
  312. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  313. package/lib/types/dsh-adapter/presets.js +69 -12
  314. package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
  315. package/lib/types/dsh-adapter/process-exit.js +1 -1
  316. package/lib/types/dsh-adapter/providerWizard.d.ts +2 -0
  317. package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
  318. package/lib/types/dsh-adapter/providerWizard.js +11 -5
  319. package/lib/types/dsh-adapter/row-attachment.d.ts +30 -0
  320. package/lib/types/dsh-adapter/row-attachment.d.ts.map +1 -0
  321. package/lib/types/dsh-adapter/row-attachment.js +29 -0
  322. package/lib/types/dsh-adapter/session-tools.d.ts +34 -0
  323. package/lib/types/dsh-adapter/session-tools.d.ts.map +1 -0
  324. package/lib/types/dsh-adapter/session-tools.js +39 -0
  325. package/lib/types/dsh-adapter/settings-sections.d.ts +18 -1
  326. package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
  327. package/lib/types/dsh-adapter/settings-sections.js +73 -0
  328. package/lib/types/dsh-adapter/status.d.ts +88 -1
  329. package/lib/types/dsh-adapter/status.d.ts.map +1 -1
  330. package/lib/types/dsh-adapter/status.js +318 -3
  331. package/lib/types/dsh-adapter/team-mode.d.ts +42 -33
  332. package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
  333. package/lib/types/dsh-adapter/team-mode.js +76 -112
  334. package/lib/types/dsh-adapter/worktree-tool.d.ts +27 -0
  335. package/lib/types/dsh-adapter/worktree-tool.d.ts.map +1 -0
  336. package/lib/types/dsh-adapter/worktree-tool.js +87 -0
  337. package/lib/types/extensions.d.ts +1 -1
  338. package/lib/types/extensions.d.ts.map +1 -1
  339. package/lib/types/force-production-react.js +3 -3
  340. package/lib/types/heldInputs.d.ts +36 -0
  341. package/lib/types/heldInputs.d.ts.map +1 -0
  342. package/lib/types/heldInputs.js +173 -0
  343. package/lib/types/i18n.d.ts +543 -73
  344. package/lib/types/i18n.d.ts.map +1 -1
  345. package/lib/types/i18n.js +265 -46
  346. package/lib/types/ink/colorize.d.ts +7 -1
  347. package/lib/types/ink/colorize.d.ts.map +1 -1
  348. package/lib/types/ink/colorize.js +29 -8
  349. package/lib/types/ink/components/App.d.ts +2 -1
  350. package/lib/types/ink/components/App.d.ts.map +1 -1
  351. package/lib/types/ink/components/App.js +10 -3
  352. package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
  353. package/lib/types/ink/components/ScrollBox.js +1 -0
  354. package/lib/types/ink/dom.d.ts +1 -0
  355. package/lib/types/ink/dom.d.ts.map +1 -1
  356. package/lib/types/ink/hooks/use-program-status.d.ts +78 -0
  357. package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -0
  358. package/lib/types/ink/hooks/use-program-status.js +96 -0
  359. package/lib/types/ink/ink.d.ts +13 -4
  360. package/lib/types/ink/ink.d.ts.map +1 -1
  361. package/lib/types/ink/ink.js +119 -25
  362. package/lib/types/ink/output.d.ts +17 -2
  363. package/lib/types/ink/output.d.ts.map +1 -1
  364. package/lib/types/ink/output.js +85 -2
  365. package/lib/types/ink/parse-keypress.d.ts +1 -0
  366. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  367. package/lib/types/ink/parse-keypress.js +5 -4
  368. package/lib/types/ink/render-node-to-output.d.ts +2 -0
  369. package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
  370. package/lib/types/ink/render-node-to-output.js +79 -10
  371. package/lib/types/ink/root.d.ts +8 -0
  372. package/lib/types/ink/root.d.ts.map +1 -1
  373. package/lib/types/ink/root.js +12 -3
  374. package/lib/types/ink/screen.d.ts +11 -0
  375. package/lib/types/ink/screen.d.ts.map +1 -1
  376. package/lib/types/ink/screen.js +44 -0
  377. package/lib/types/ink/selection.d.ts +7 -2
  378. package/lib/types/ink/selection.d.ts.map +1 -1
  379. package/lib/types/ink/selection.js +187 -44
  380. package/lib/types/ink/shutdown-input.d.ts +15 -0
  381. package/lib/types/ink/shutdown-input.d.ts.map +1 -0
  382. package/lib/types/ink/shutdown-input.js +28 -0
  383. package/lib/types/ink/sixel-cursor-heal.d.ts +21 -0
  384. package/lib/types/ink/sixel-cursor-heal.d.ts.map +1 -0
  385. package/lib/types/ink/sixel-cursor-heal.js +62 -0
  386. package/lib/types/ink/sixel-graphics.d.ts +6 -0
  387. package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
  388. package/lib/types/ink/sixel-graphics.js +18 -0
  389. package/lib/types/ink/styles.d.ts +8 -1
  390. package/lib/types/ink/styles.d.ts.map +1 -1
  391. package/lib/types/ink/terminal-notification-windows.d.ts +195 -0
  392. package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -0
  393. package/lib/types/ink/terminal-notification-windows.js +433 -0
  394. package/lib/types/ink/terminal-notification.d.ts +3 -1
  395. package/lib/types/ink/terminal-notification.d.ts.map +1 -1
  396. package/lib/types/ink/terminal-notification.js +4 -1
  397. package/lib/types/ink/terminal-querier.d.ts +9 -1
  398. package/lib/types/ink/terminal-querier.d.ts.map +1 -1
  399. package/lib/types/ink/terminal-querier.js +32 -1
  400. package/lib/types/ink/terminal.d.ts +23 -2
  401. package/lib/types/ink/terminal.d.ts.map +1 -1
  402. package/lib/types/ink/terminal.js +32 -2
  403. package/lib/types/ink/termio/osc.d.ts +2 -1
  404. package/lib/types/ink/termio/osc.d.ts.map +1 -1
  405. package/lib/types/ink/termio/osc.js +37 -8
  406. package/lib/types/ink/termio/osc7501.d.ts +102 -0
  407. package/lib/types/ink/termio/osc7501.d.ts.map +1 -0
  408. package/lib/types/ink/termio/osc7501.js +229 -0
  409. package/lib/types/ink/termio/tokenize.js +5 -7
  410. package/lib/types/onboardingDraft.d.ts +143 -0
  411. package/lib/types/onboardingDraft.d.ts.map +1 -0
  412. package/lib/types/onboardingDraft.js +71 -0
  413. package/lib/types/panels.d.ts +1 -1
  414. package/lib/types/panels.d.ts.map +1 -1
  415. package/lib/types/screens/AgentTranscriptScene.d.ts +3 -1
  416. package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
  417. package/lib/types/screens/AgentTranscriptScene.js +5 -1
  418. package/lib/types/screens/Chat.d.ts +6 -6
  419. package/lib/types/screens/Chat.d.ts.map +1 -1
  420. package/lib/types/screens/Chat.js +394 -141
  421. package/lib/types/screens/Launchpad.d.ts +8 -2
  422. package/lib/types/screens/Launchpad.d.ts.map +1 -1
  423. package/lib/types/screens/Launchpad.js +32 -12
  424. package/lib/types/screens/Onboarding.d.ts +22 -3
  425. package/lib/types/screens/Onboarding.d.ts.map +1 -1
  426. package/lib/types/screens/Onboarding.js +606 -36
  427. package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
  428. package/lib/types/screens/SessionSupervisor.js +31 -21
  429. package/lib/types/screens/Settings.d.ts +5 -1
  430. package/lib/types/screens/Settings.d.ts.map +1 -1
  431. package/lib/types/screens/Settings.js +528 -51
  432. package/lib/types/screens/StatusLine.d.ts +9 -3
  433. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  434. package/lib/types/screens/StatusLine.js +91 -15
  435. package/lib/types/screens/StatusMetrics.d.ts +2 -11
  436. package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
  437. package/lib/types/screens/StatusMetrics.js +20 -14
  438. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
  439. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +1 -1
  440. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +1 -1
  441. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
  442. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +13 -21
  443. package/lib/types/sessionMounts.d.ts +14 -0
  444. package/lib/types/sessionMounts.d.ts.map +1 -1
  445. package/lib/types/sessionMounts.js +20 -9
  446. package/lib/types/sessions/format.d.ts +39 -0
  447. package/lib/types/sessions/format.d.ts.map +1 -1
  448. package/lib/types/sessions/format.js +83 -0
  449. package/lib/types/sessions/resumeFailure.d.ts +4 -0
  450. package/lib/types/sessions/resumeFailure.d.ts.map +1 -1
  451. package/lib/types/sessions/resumeFailure.js +12 -4
  452. package/lib/types/sessions/workspaceCounts.d.ts +6 -0
  453. package/lib/types/sessions/workspaceCounts.d.ts.map +1 -0
  454. package/lib/types/sessions/workspaceCounts.js +24 -0
  455. package/lib/types/settings/definitions.d.ts +24 -0
  456. package/lib/types/settings/definitions.d.ts.map +1 -1
  457. package/lib/types/settings/definitions.js +40 -15
  458. package/lib/types/tips.js +2 -2
  459. package/lib/types/tuiDisplayPrefs.d.ts +113 -5
  460. package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
  461. package/lib/types/tuiDisplayPrefs.js +276 -14
  462. package/lib/types/update.d.ts +15 -14
  463. package/lib/types/update.d.ts.map +1 -1
  464. package/lib/types/update.js +163 -115
  465. package/lib/types/updateProcess.d.ts +28 -0
  466. package/lib/types/updateProcess.d.ts.map +1 -0
  467. package/lib/types/updateProcess.js +135 -0
  468. package/lib/types/utils/inputWordBoundary.d.ts +5 -0
  469. package/lib/types/utils/inputWordBoundary.d.ts.map +1 -0
  470. package/lib/types/utils/inputWordBoundary.js +18 -0
  471. package/lib/types/utils/keymap.d.ts +1 -1
  472. package/lib/types/utils/keymap.d.ts.map +1 -1
  473. package/lib/types/utils/keymap.js +6 -1
  474. package/lib/types/utils/paths.d.ts +15 -0
  475. package/lib/types/utils/paths.d.ts.map +1 -1
  476. package/lib/types/utils/paths.js +25 -0
  477. package/lib/types/windowsInstaller.d.ts +4 -0
  478. package/lib/types/windowsInstaller.d.ts.map +1 -0
  479. package/lib/types/windowsInstaller.js +237 -0
  480. package/locale/en.json +6 -0
  481. package/locale/zh.json +6 -0
  482. package/package.json +130 -111
  483. package/presets/liangshen/custom-bash.mjs +13 -1
  484. package/presets/liangshen/instruction-hint.mjs +4 -1
  485. package/presets/liangshen/skill-search.mjs +14 -2
  486. package/presets/winbash.mjs +16 -4
  487. package/tui-profile/feed/README.md +17 -8
  488. package/tui-profile/feed/first-party.json +1 -1
@@ -90,8 +90,16 @@ function isTurnRow(row) {
90
90
  function teamSenderOf(row) {
91
91
  return row.label === 'team-message' ? row.sender ?? '' : undefined;
92
92
  }
93
+ /** Keep a settled text-only reply visible when narration is its whole body. */
94
+ function assistantDisplayText(row) {
95
+ const text = row.text ?? '';
96
+ const stripped = stripNarration(text);
97
+ return row.streaming !== true && (row.images?.length ?? 0) === 0 && stripped.trim() === ''
98
+ ? text
99
+ : stripped;
100
+ }
93
101
  function assistantRevealText(row, enabled) {
94
- const stripped = stripNarration(row.text);
102
+ const stripped = assistantDisplayText(row);
95
103
  return revealTextOf(`a${row.id}`, stripped, {
96
104
  enabled,
97
105
  active: row.streaming === true || row.fresh === true,
@@ -103,7 +111,7 @@ function reasoningRevealText(row, enabled) {
103
111
  /** Display length only (layout signature; no slice allocation). */
104
112
  function revealDisplayLen(row, enabled) {
105
113
  if (row.kind === 'assistant') {
106
- const stripped = stripNarration(row.text);
114
+ const stripped = assistantDisplayText(row);
107
115
  return revealLengthOf(`a${row.id}`, stripped, {
108
116
  enabled,
109
117
  active: row.streaming === true || row.fresh === true,
@@ -360,15 +368,12 @@ export function MessageList({ rows, expanded, expandedRows, selectedId, onToggle
360
368
  // that is STILL STREAMING keeps its place even with empty text — the
361
369
  // live dot is the "model is answering" affordance and content may yet
362
370
  // arrive.
363
- // The emptiness test must match what RENDERING shows: the `⏵`
364
- // self-narration line (dsh-working-activity narrate contract) is
365
- // stripped at render (stripNarration below), so a narration-only step —
366
- // thinking, `⏵ …` line, straight to a tool call — has non-empty raw
367
- // text but RENDERS as that same lone `●`. Test the stripped text, or
368
- // the raw-text check lets the dot through forever.
371
+ // Filtering, measurement and rendering share the same display text.
372
+ // A settled narration-only reply has real content; only truly empty
373
+ // text-only rows disappear. Image-only rows retain their own content.
369
374
  const rendersEmptyAssistant = (row) => row.kind === 'assistant' &&
370
375
  row.streaming !== true &&
371
- stripNarration(row.text ?? '').trim() === '' &&
376
+ assistantDisplayText(row).trim() === '' &&
372
377
  (row.images?.length ?? 0) === 0;
373
378
  let hasEmptyAssistant = false;
374
379
  for (const row of sliced) {
@@ -530,8 +535,9 @@ export function MessageList({ rows, expanded, expandedRows, selectedId, onToggle
530
535
  }
531
536
  const visibleRows = visibleRowsCacheRef.current.out;
532
537
  const margins = visibleRowsCacheRef.current.margins;
533
- // Selection keeps its highlight; expanded rows render with no fill (the
534
- // diff line tints inside cards are the only backgrounds in the transcript).
538
+ // Selection keeps its highlight; expanding a row adds no band of its own.
539
+ // A tool card supplies the configured tool-card surface (and its diff line
540
+ // tints) from the inside; the band itself stays limited to selection.
535
541
  const rowBackground = (rowId) => {
536
542
  const isSelected = selectedId === rowId;
537
543
  if (isSelected)
@@ -1297,7 +1303,7 @@ export function MessageList({ rows, expanded, expandedRows, selectedId, onToggle
1297
1303
  let displayText = row.text;
1298
1304
  let displayStreaming = row.streaming === true;
1299
1305
  if (row.kind === 'assistant' && smoothStreaming) {
1300
- const stripped = stripNarration(row.text);
1306
+ const stripped = assistantDisplayText(row);
1301
1307
  displayText = revealTextOf(`a${row.id}`, stripped, {
1302
1308
  enabled: true,
1303
1309
  active: displayStreaming || row.fresh === true,
@@ -1305,7 +1311,7 @@ export function MessageList({ rows, expanded, expandedRows, selectedId, onToggle
1305
1311
  displayStreaming = displayStreaming || displayText.length !== stripped.length;
1306
1312
  }
1307
1313
  else if (row.kind === 'assistant') {
1308
- displayText = stripNarration(row.text);
1314
+ displayText = assistantDisplayText(row);
1309
1315
  }
1310
1316
  else if (row.kind === 'reasoning' && smoothStreaming) {
1311
1317
  displayText = revealTextOf(`r${row.id}`, row.text, { enabled: true, active: displayStreaming });
@@ -1380,7 +1386,7 @@ function TranscriptRow({ rowId, kind, text, interruptBackend, images, textFull,
1380
1386
  path: displaySelectionPath(selectionAttached.path, sessionCwd),
1381
1387
  })] })), text !== '' && sender !== undefined && (_jsx(TeamMessageBubble, { sender: sender, text: displayText, marginTopOnTurn: marginTopOnTurn, isSelected: isSelected })), text !== '' && sender === undefined && (_jsx(UserPromptMessage, { text: displayText, marginTopOnTurn: marginTopOnTurn, isSelected: isSelected })), images !== undefined && (_jsx(Box, { marginTop: text === '' && marginTopOnTurn ? 1 : 0, children: _jsx(TranscriptImages, { images: images, onPreview: onPreviewImage, suppressGraphics: suppressImageGraphics }) }))] }));
1382
1388
  case 'assistant':
1383
- return streaming ? (_jsxs(Box, { alignItems: "flex-start", flexDirection: "row", marginTop: marginTopOnTurn ? 1 : 0, width: "100%", backgroundColor: background, ref: ref, onClick: foldClickable ? foldOnClick : undefined, children: [_jsx(Box, { minWidth: 2, children: _jsx(Text, { color: "text", children: "\u25CF" }) }), _jsxs(Box, { flexDirection: "column", children: [_jsx(StreamingMarkdown, { children: stripNarration(displayText) }), images !== undefined && _jsx(TranscriptImages, { images: images, indent: 0, onPreview: onPreviewImage, suppressGraphics: suppressImageGraphics })] })] })) : (_jsxs(Box, { width: "100%", flexDirection: "column", backgroundColor: background, ref: ref, onClick: foldClickable ? foldOnClick : undefined, children: [expanded && (_jsx(Box, { flexDirection: "row", justifyContent: "flex-end", gap: 1, marginTop: 1, children: _jsx(MessageMetadata, { timestamp: time, model: model }) })), _jsx(AssistantTextLeafRow, { text: stripNarration(displayText), marginTopOnTurn: marginTopOnTurn, isSelected: isSelected, isExpanded: isExpanded }), images !== undefined && _jsx(TranscriptImages, { images: images, onPreview: onPreviewImage, suppressGraphics: suppressImageGraphics })] }));
1389
+ return streaming ? (_jsxs(Box, { alignItems: "flex-start", flexDirection: "row", marginTop: marginTopOnTurn ? 1 : 0, width: "100%", backgroundColor: background, ref: ref, onClick: foldClickable ? foldOnClick : undefined, children: [_jsx(Box, { minWidth: 2, children: _jsx(Text, { color: "text", children: "\u25CF" }) }), _jsxs(Box, { flexDirection: "column", children: [_jsx(StreamingMarkdown, { children: displayText }), images !== undefined && _jsx(TranscriptImages, { images: images, indent: 0, onPreview: onPreviewImage, suppressGraphics: suppressImageGraphics })] })] })) : (_jsxs(Box, { width: "100%", flexDirection: "column", backgroundColor: background, ref: ref, onClick: foldClickable ? foldOnClick : undefined, children: [expanded && (_jsx(Box, { flexDirection: "row", justifyContent: "flex-end", gap: 1, marginTop: 1, children: _jsx(MessageMetadata, { timestamp: time, model: model }) })), _jsx(AssistantTextLeafRow, { text: displayText, marginTopOnTurn: marginTopOnTurn, isSelected: isSelected, isExpanded: isExpanded }), images !== undefined && _jsx(TranscriptImages, { images: images, onPreview: onPreviewImage, suppressGraphics: suppressImageGraphics })] }));
1384
1390
  case 'reasoning': {
1385
1391
  // The setting chooses the live default; a row click reverses it. Global
1386
1392
  // or per-row transcript expansion always wins and shows the full text.
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ import type { GrantPlan } from '../dsh-adapter/grant-file.js';
3
+ /**
4
+ * Rows one localized line occupies inside a `Pane` at the current width.
5
+ *
6
+ * A pane that hands the permission list its frame has to know how tall that
7
+ * frame really is: the trust and notice copy wraps differently at 50 and 80
8
+ * columns, so a fixed row count either folds rows that would have fit or lets
9
+ * the list push the pane title off the overlay. This measures with the
10
+ * renderer's own wrap function (the one `Text` uses) at the pane's content
11
+ * width, so the count matches what is drawn.
12
+ */
13
+ export declare function usePaneTextRows(): (text: string) => number;
14
+ /**
15
+ * The permissions one lifecycle action is about, as the confirmation pane shows
16
+ * them (grant lifecycle plan §8).
17
+ *
18
+ * Both the install confirmation and the lifecycle confirmation read the same
19
+ * list, so they cannot describe the same declaration differently. Ordering is
20
+ * deliberate: default-deny (the interception-class) permissions lead — the risk
21
+ * a person is least likely to expect is what they see first — and inside that
22
+ * block the ones not granted yet come first. Granted entries sink within their
23
+ * own group, never across it, so a hand-edited grant on a default-deny row
24
+ * keeps its place in the leading block instead of disappearing under the
25
+ * default-allow rows.
26
+ *
27
+ * Height is the overlay's, not the terminal's: the pane sits in `OverlayAbove`,
28
+ * which reserves a strip above the prompt and clips whole rows from the top.
29
+ * The list therefore folds to whatever its pane's frame leaves — fewer rows plus
30
+ * `and N more…` — instead of pushing the package identity, the trust notice or
31
+ * the key hint off a short terminal.
32
+ *
33
+ * Presentational only; the state lives in the flows.
34
+ */
35
+ export declare function PluginGrantList({ plan, mode, frameRows }: {
36
+ plan: GrantPlan;
37
+ mode: 'grant' | 'revoke';
38
+ /**
39
+ * Rows the pane spends outside the permission rows: the pane frame, the
40
+ * heading, the facts, the hint. The margin the caller wraps the pane in is
41
+ * reserved here, since it is part of the overlay this list has to fit.
42
+ */
43
+ readonly frameRows: number;
44
+ }): React.ReactNode;
45
+ //# sourceMappingURL=PluginGrantList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PluginGrantList.d.ts","sourceRoot":"","sources":["../../../src/components/PluginGrantList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,8BAA8B,CAAA;AAmB7E;;;;;;;;;GASG;AACH,wBAAgB,eAAe,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAO1D;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IACzD,IAAI,EAAE,SAAS,CAAA;IACf,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAA;IACxB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B,GAAG,KAAK,CAAC,SAAS,CA8DlB"}
@@ -0,0 +1,126 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import wrapText from '../ink/wrap-text.js';
4
+ import { stringWidth } from '../ink/stringWidth.js';
5
+ import { t } from '../i18n.js';
6
+ import { Box, Text, useTerminalSize } from '../ui.js';
7
+ import { cleanRenderText } from '../channel/sanitize.js';
8
+ import { useOverlayListRows } from './OverlayAbove.js';
9
+ /** Rows a confirmation pane shows before folding the rest into one line. */
10
+ const GRANT_LIST_MAX_ROWS = 12;
11
+ /** Per-cell cap: a permission name and a scope are foreign text like any other. */
12
+ const GRANT_CELLS = 48;
13
+ /** Both panes render this list inside `Pane`, which pads two cells on each side. */
14
+ const PANE_PADDING_CELLS = 4;
15
+ /** What one row spends besides its two cells: ` `, ` @ ` and ` `. */
16
+ const ROW_SEPARATOR_CELLS = 7;
17
+ /** Narrower cells than this stop being useful; the row may then lose its tail. */
18
+ const MIN_CELLS = 4;
19
+ /** Unknown names named on the folded line before it becomes a list of its own. */
20
+ const UNKNOWN_NAMES_SHOWN = 3;
21
+ /** The list's own chrome above the heading; the heading itself is measured. */
22
+ const LIST_TOP_MARGIN_ROWS = 1;
23
+ /** Chat wraps every picker pane in one row's margin inside the overlay. */
24
+ const OVERLAY_PANE_MARGIN_ROWS = 1;
25
+ /**
26
+ * Rows one localized line occupies inside a `Pane` at the current width.
27
+ *
28
+ * A pane that hands the permission list its frame has to know how tall that
29
+ * frame really is: the trust and notice copy wraps differently at 50 and 80
30
+ * columns, so a fixed row count either folds rows that would have fit or lets
31
+ * the list push the pane title off the overlay. This measures with the
32
+ * renderer's own wrap function (the one `Text` uses) at the pane's content
33
+ * width, so the count matches what is drawn.
34
+ */
35
+ export function usePaneTextRows() {
36
+ const { columns } = useTerminalSize();
37
+ return React.useCallback((text) => wrapText(text, Math.max(1, columns - PANE_PADDING_CELLS), 'wrap').split('\n').length, [columns]);
38
+ }
39
+ /**
40
+ * The permissions one lifecycle action is about, as the confirmation pane shows
41
+ * them (grant lifecycle plan §8).
42
+ *
43
+ * Both the install confirmation and the lifecycle confirmation read the same
44
+ * list, so they cannot describe the same declaration differently. Ordering is
45
+ * deliberate: default-deny (the interception-class) permissions lead — the risk
46
+ * a person is least likely to expect is what they see first — and inside that
47
+ * block the ones not granted yet come first. Granted entries sink within their
48
+ * own group, never across it, so a hand-edited grant on a default-deny row
49
+ * keeps its place in the leading block instead of disappearing under the
50
+ * default-allow rows.
51
+ *
52
+ * Height is the overlay's, not the terminal's: the pane sits in `OverlayAbove`,
53
+ * which reserves a strip above the prompt and clips whole rows from the top.
54
+ * The list therefore folds to whatever its pane's frame leaves — fewer rows plus
55
+ * `and N more…` — instead of pushing the package identity, the trust notice or
56
+ * the key hint off a short terminal.
57
+ *
58
+ * Presentational only; the state lives in the flows.
59
+ */
60
+ export function PluginGrantList({ plan, mode, frameRows }) {
61
+ // Hooks run before the "nothing to show" return: the pane may re-render this
62
+ // list with another plan, and the hook order must not depend on it.
63
+ const { columns } = useTerminalSize();
64
+ const textRows = usePaneTextRows();
65
+ const overlayRows = useOverlayListRows(0);
66
+ // Nothing to show (a package that declares no permissions): the pane keeps its
67
+ // own layout rather than printing an empty heading.
68
+ if (plan.entries.length === 0 && plan.unknown.length === 0)
69
+ return null;
70
+ // One row per permission. Besides the two foreign cells a row spends ` `,
71
+ // ` @ `, the gap before the status and the localized status itself; `Pane`
72
+ // adds two cells of padding on each side that `useTerminalSize()` does not
73
+ // subtract. Measure the status instead of assuming it: the English labels are
74
+ // wider than the Chinese ones. `wrap="truncate"` is the backstop for terminals
75
+ // narrower than `MIN_CELLS`: an over-long row loses its tail instead of
76
+ // growing a second line and pushing the key hint off the screen.
77
+ // A reduce, not `Math.max(...map)`: the declaration is untrusted input and a
78
+ // manifest can carry more permissions than the argument limit allows.
79
+ const statusCells = plan.entries.reduce((widest, entry) => Math.max(widest, stringWidth(statusOf(entry))), 0);
80
+ const cells = Math.max(MIN_CELLS, Math.min(GRANT_CELLS, Math.floor((columns - PANE_PADDING_CELLS - ROW_SEPARATOR_CELLS - statusCells) / 2)));
81
+ const clean = (value) => cleanRenderText(value, cells);
82
+ const entries = [...plan.entries].sort(compareEntries);
83
+ const title = t(mode === 'grant' ? 'plugins-grant-list-title' : 'plugins-grant-list-title-revoke');
84
+ const unknown = plan.unknown.length === 0
85
+ ? undefined
86
+ : ` ${t('plugins-grant-unknown-line', {
87
+ count: String(plan.unknown.length),
88
+ names: `${plan.unknown.slice(0, UNKNOWN_NAMES_SHOWN).map(clean).join(', ')}${plan.unknown.length > UNKNOWN_NAMES_SHOWN ? '…' : ''}`,
89
+ })}`;
90
+ // Rows left for entry rows and the folded-count line. `overlayRows` is the
91
+ // overlay's own budget (`rows - 8` outside one, the same reserve the pickers
92
+ // assume); the frame is what the pane already spends, and the chrome is this
93
+ // list's gap, heading and unknown line.
94
+ const available = overlayRows - frameRows - OVERLAY_PANE_MARGIN_ROWS - LIST_TOP_MARGIN_ROWS
95
+ - textRows(title) - (unknown === undefined ? 0 : textRows(unknown));
96
+ // A frame that already fills the overlay leaves nothing to fold into: drawing
97
+ // a heading and no rows would only cost the rows above it.
98
+ if (entries.length === 0 && available < 0)
99
+ return null;
100
+ if (entries.length > 0 && available < 1)
101
+ return null;
102
+ const cap = Math.min(GRANT_LIST_MAX_ROWS, Math.max(0, available));
103
+ const needsFold = entries.length > cap;
104
+ const shownCount = needsFold ? Math.min(cap, Math.max(0, available - 1)) : entries.length;
105
+ const shown = entries.slice(0, shownCount);
106
+ const hidden = entries.length - shown.length;
107
+ return (_jsxs(Box, { marginTop: LIST_TOP_MARGIN_ROWS, flexDirection: "column", children: [_jsx(Text, { children: title }), shown.length === 0
108
+ // Not one row fits. Keep a count under the heading (the key hint repeats
109
+ // it) instead of drawing a heading with nothing beneath it.
110
+ ? hidden > 0 && _jsx(Text, { dimColor: true, wrap: "truncate", children: ` ${t('plugins-grant-hidden', { count: String(hidden) })}` })
111
+ : shown.map(entry => (_jsx(Text, { dimColor: entry.granted, wrap: "truncate", children: ` ${clean(entry.name)} @ ${clean(entry.scope)} ${statusOf(entry)}` }, `${entry.name}\u0000${entry.scope}`))), shown.length > 0 && hidden > 0 && _jsx(Text, { dimColor: true, children: ` ${t('plugins-grant-more', { count: String(hidden) })}` }), unknown !== undefined && _jsx(Text, { dimColor: true, children: unknown })] }));
112
+ }
113
+ /** What one row says about itself: its registry default and whether it is granted. */
114
+ function statusOf(entry) {
115
+ const granted = t(entry.granted ? 'plugins-grant-granted' : 'plugins-grant-not-granted');
116
+ const fallback = t(entry.default === 'allow' ? 'plugins-grant-default-allow' : 'plugins-grant-default-deny');
117
+ return `${fallback} ${granted}`;
118
+ }
119
+ /** Default-deny before default-allow, then not-yet-granted before granted. */
120
+ function compareEntries(left, right) {
121
+ if (left.default !== right.default)
122
+ return left.default === 'deny' ? -1 : 1;
123
+ if (left.granted !== right.granted)
124
+ return left.granted ? 1 : -1;
125
+ return 0;
126
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"PluginInstallPane.d.ts","sourceRoot":"","sources":["../../../src/components/PluginInstallPane.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,iBAAiB,EAAqB,MAAM,kCAAkC,CAAA;AAqB5F;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,CAgF7G"}
1
+ {"version":3,"file":"PluginInstallPane.d.ts","sourceRoot":"","sources":["../../../src/components/PluginInstallPane.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,iBAAiB,EAAqB,MAAM,kCAAkC,CAAA;AAsB5F;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,CAqH7G"}
@@ -5,6 +5,7 @@ import { cleanRenderText, NOTICE_CELLS } from '../channel/sanitize.js';
5
5
  import { HintLine } from './design-system/HintLine.js';
6
6
  import { LoadingState } from './design-system/LoadingState.js';
7
7
  import { Pane } from './design-system/Pane.js';
8
+ import { PluginGrantList, usePaneTextRows } from './PluginGrantList.js';
8
9
  /** Foreign text on its way to the screen: control sequences stripped, bounded. */
9
10
  const clean = (value) => cleanRenderText(value, NOTICE_CELLS);
10
11
  /**
@@ -30,19 +31,47 @@ const TARGET_CELLS = 80;
30
31
  * (Enter confirms / retries, Esc cancels), exactly like the SDK install wizard.
31
32
  */
32
33
  export function PluginInstallPane({ step, busy }) {
34
+ const textRows = usePaneTextRows();
33
35
  if (busy) {
34
36
  return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "remember", bold: true, children: t('plugins-install-pane-title') }), _jsx(Box, { marginTop: 1, children: _jsx(LoadingState, { message: t('plugins-install-installing') }) })] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('plugins-install-key-cancel') }) })] }));
35
37
  }
36
38
  if (step.kind === 'confirm') {
37
- const { artifact, trust, notice } = step;
39
+ const { artifact, trust, notice, grants } = step;
38
40
  const spec = artifact.name === undefined
39
41
  ? t('plugins-install-unidentified')
40
42
  : cleanRenderText(`${artifact.name}${artifact.version === undefined ? '' : `@${artifact.version}`}`, TARGET_CELLS);
41
- return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: t('plugins-install-pane-title') }) }), _jsx(Text, { children: t('plugins-install-configure', {
42
- spec,
43
- kind: artifact.kind,
44
- bundle: artifact.bundle === true ? 'bundle' : artifact.bundle === false ? 'not a bundle' : 'unknown',
45
- }) }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [trust.kind === 'third-party' && _jsx(Text, { children: t('plugins-install-trust-third-party') }), notice.kind === 'declared' && _jsx(Text, { dimColor: true, children: t('plugins-install-notice-declared') }), notice.kind === 'undeclared' && _jsx(Text, { children: t('plugins-install-notice-undeclared') }), notice.kind === 'invalid' && _jsx(Text, { children: t('plugins-install-notice-invalid', { err: notice.error }) }), notice.kind === 'unjudged' && _jsx(Text, { children: t('plugins-install-notice-unjudged') })] })] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('plugins-install-key-confirm') }) })] }));
43
+ const title = t('plugins-install-pane-title');
44
+ const configure = t('plugins-install-configure', {
45
+ spec,
46
+ kind: artifact.kind,
47
+ bundle: artifact.bundle === true ? 'bundle' : artifact.bundle === false ? 'not a bundle' : 'unknown',
48
+ });
49
+ const trustText = trust.kind === 'third-party' ? t('plugins-install-trust-third-party') : undefined;
50
+ const noticeText = notice.kind === 'declared' ? t('plugins-install-notice-declared')
51
+ : notice.kind === 'undeclared' ? t('plugins-install-notice-undeclared')
52
+ : notice.kind === 'invalid' ? t('plugins-install-notice-invalid', { err: notice.error })
53
+ : notice.kind === 'unjudged' ? t('plugins-install-notice-unjudged')
54
+ : undefined;
55
+ const grantCount = grants?.entries.length ?? 0;
56
+ const hint = grantCount > 0
57
+ ? t('plugins-install-key-confirm-grant', { count: String(grantCount) })
58
+ : t('plugins-install-key-confirm');
59
+ // Everything the overlay draws besides the permission rows: Pane's top line
60
+ // and padding, the title and its gap, the configure line, the facts gap, the
61
+ // trust/notice copy and the hint. Measured at this width, so the list folds
62
+ // itself instead of pushing them off a short terminal.
63
+ const frameRows = 2 + textRows(title) + 1 + textRows(configure) + 1
64
+ + (trustText === undefined ? 0 : textRows(trustText))
65
+ + (noticeText === undefined ? 0 : textRows(noticeText)) + textRows(hint);
66
+ return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: title }) }), _jsx(Text, { children: configure }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [trustText !== undefined && _jsx(Text, { children: trustText }), noticeText !== undefined && _jsx(Text, { dimColor: notice.kind === 'declared', children: noticeText })] }), grants !== undefined && _jsx(PluginGrantList, { plan: grants, mode: "grant", frameRows: frameRows })] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: hint }) })] }));
67
+ }
68
+ if (step.kind === 'grant') {
69
+ const title = t('plugins-install-pane-title');
70
+ const ask = t('plugins-install-grant-ask', { id: clean(step.plan.id) });
71
+ const hint = t('plugins-install-key-grant', { count: String(step.plan.entries.length) });
72
+ // Pane frame, title and its gap, the question, the hint.
73
+ const frameRows = 2 + textRows(title) + 1 + textRows(ask) + textRows(hint);
74
+ return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: title }) }), _jsx(Text, { children: ask }), _jsx(PluginGrantList, { plan: step.plan, mode: "grant", frameRows: frameRows })] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: hint }) })] }));
46
75
  }
47
76
  if (step.kind === 'build-blocked') {
48
77
  return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "remember", bold: true, children: t('plugins-install-pane-title') }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { children: t('plugins-install-builds-title') }), step.builds.map(build => _jsx(Text, { dimColor: true, children: ` ${clean(build)}` }, build))] })] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('plugins-install-key-builds') }) })] }));
@@ -1 +1 @@
1
- {"version":3,"file":"PluginManagePane.d.ts","sourceRoot":"","sources":["../../../src/components/PluginManagePane.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,gBAAgB,EAAsB,MAAM,iCAAiC,CAAA;AAiB3F;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,CAqD3G"}
1
+ {"version":3,"file":"PluginManagePane.d.ts","sourceRoot":"","sources":["../../../src/components/PluginManagePane.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,gBAAgB,EAAsB,MAAM,iCAAiC,CAAA;AAkB3F;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,CAiF3G"}
@@ -1,10 +1,11 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { t } from '../i18n.js';
3
3
  import { Box, Text } from '../ui.js';
4
4
  import { cleanRenderText, NOTICE_CELLS } from '../channel/sanitize.js';
5
5
  import { HintLine } from './design-system/HintLine.js';
6
6
  import { LoadingState } from './design-system/LoadingState.js';
7
7
  import { Pane } from './design-system/Pane.js';
8
+ import { PluginGrantList, usePaneTextRows } from './PluginGrantList.js';
8
9
  /** Foreign text on its way to the screen: control sequences stripped, bounded. */
9
10
  const clean = (value) => cleanRenderText(value, NOTICE_CELLS);
10
11
  /**
@@ -30,6 +31,7 @@ const TARGET_CELLS = 80;
30
31
  * and the key hints. Keys are handled in Chat (Enter answers, Esc closes).
31
32
  */
32
33
  export function PluginManagePane({ step, busy }) {
34
+ const textRows = usePaneTextRows();
33
35
  if (busy) {
34
36
  // A write is in flight. Esc closes the pane and the write finishes anyway —
35
37
  // the service has no cancellation for these three, and saying "cancelling"
@@ -37,18 +39,73 @@ export function PluginManagePane({ step, busy }) {
37
39
  return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "remember", bold: true, children: t('plugins-manage-pane-title') }), _jsx(Box, { marginTop: 1, children: _jsx(LoadingState, { message: t('plugins-manage-working') }) })] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('plugins-manage-key-busy') }) })] }));
38
40
  }
39
41
  if (step.kind === 'confirm') {
40
- return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: t('plugins-manage-pane-title') }) }), _jsx(Text, { children: t('plugins-manage-configure', {
41
- action: t(actionKeyOf(step.target)),
42
- target: describe(step.target),
43
- }) }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [step.question.kind === 'remove' && (_jsx(Text, { children: t('plugins-manage-remove-facts', {
44
- rows: String(step.target.kind === 'bundle' ? step.target.rows : 0),
45
- overrides: String(step.target.kind === 'bundle' ? step.target.overrides : 0),
46
- }) })), step.question.kind === 'trust' && _jsx(Text, { children: t('plugins-manage-trust-facts') }), step.question.kind === 'host-row' && _jsx(Text, { children: t('plugins-manage-host-row-facts') }), step.question.kind === 'team-active' && (_jsxs(_Fragment, { children: [step.question.members > 0 && _jsx(Text, { children: t('plugins-manage-team-active-facts', { members: String(step.question.members) }) }), step.question.unseen > 0 && _jsx(Text, { children: t('plugins-manage-team-unseen-facts', { members: String(step.question.unseen) }) }), _jsx(Text, { children: t('plugins-manage-team-active-stop') })] }))] })] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('plugins-manage-key-confirm') }) })] }));
42
+ const title = t('plugins-manage-pane-title');
43
+ const configure = t('plugins-manage-configure', {
44
+ action: t(actionKeyOf(step.target)),
45
+ target: describe(step.target),
46
+ });
47
+ const facts = [];
48
+ if (step.question.kind === 'remove') {
49
+ facts.push(t('plugins-manage-remove-facts', {
50
+ rows: String(step.target.kind === 'bundle' ? step.target.rows : 0),
51
+ overrides: String(step.target.kind === 'bundle' ? step.target.overrides : 0),
52
+ }));
53
+ }
54
+ else if (step.question.kind === 'trust') {
55
+ facts.push(t('plugins-manage-trust-facts'));
56
+ }
57
+ else if (step.question.kind === 'host-row') {
58
+ facts.push(t('plugins-manage-host-row-facts'));
59
+ }
60
+ else if (step.question.kind === 'team-active') {
61
+ if (step.question.members > 0) {
62
+ facts.push(t('plugins-manage-team-active-facts', { members: String(step.question.members) }));
63
+ }
64
+ if (step.question.unseen > 0) {
65
+ facts.push(t('plugins-manage-team-unseen-facts', { members: String(step.question.unseen) }));
66
+ }
67
+ facts.push(t('plugins-manage-team-active-stop'));
68
+ }
69
+ const grantFacts = step.target.action === 'remove' && step.grants !== undefined
70
+ ? t('plugins-manage-remove-grant-facts')
71
+ : undefined;
72
+ const hint = hintTextOf(step);
73
+ // Everything the overlay draws besides the permission rows: Pane's top line
74
+ // and padding, the title and its gap, the configure line, the facts gap, the
75
+ // facts themselves, the removal note and the hint. Measured at this width,
76
+ // so the list folds instead of pushing them off a short terminal.
77
+ const frameRows = 2 + textRows(title) + 1 + textRows(configure) + 1
78
+ + facts.reduce((rows, fact) => rows + textRows(fact), 0)
79
+ + (grantFacts === undefined ? 0 : 1 + textRows(grantFacts))
80
+ + textRows(hint);
81
+ return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: title }) }), _jsx(Text, { children: configure }), _jsx(Box, { marginTop: 1, flexDirection: "column", children: facts.map((fact, index) => _jsx(Text, { children: fact }, index)) }), step.target.kind === 'bundle' && step.target.action === 'enable'
82
+ && step.grants !== undefined
83
+ && _jsx(PluginGrantList, { plan: step.grants, mode: "grant", frameRows: frameRows }), step.target.kind === 'bundle' && step.target.action === 'disable'
84
+ && step.grants !== undefined
85
+ && _jsx(PluginGrantList, { plan: step.grants, mode: "revoke", frameRows: frameRows }), grantFacts !== undefined
86
+ && _jsx(Box, { marginTop: 1, children: _jsx(Text, { children: grantFacts }) })] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: hint }) })] }));
47
87
  }
48
88
  // `done` never renders: its lines are already in the transcript, so Chat
49
89
  // closes the pane instead of leaving an empty box behind.
50
90
  return null;
51
91
  }
92
+ /**
93
+ * The key hint for this question. Enabling grants the declared permissions and
94
+ * disabling revokes them, so the hint names both halves of the action when
95
+ * there is something to grant or revoke; a removal keeps the plain hint (its
96
+ * grant fact is a line of its own).
97
+ */
98
+ function hintTextOf(step) {
99
+ const grants = step.grants;
100
+ if (step.target.kind === 'bundle' && grants !== undefined && grants.entries.length > 0) {
101
+ if (step.target.action === 'enable')
102
+ return t('plugins-manage-key-enable-grant', { count: String(grants.entries.length) });
103
+ if (step.target.action === 'disable') {
104
+ return t('plugins-manage-key-disable-revoke', { count: String(grants.entries.length) });
105
+ }
106
+ }
107
+ return t('plugins-manage-key-confirm');
108
+ }
52
109
  /** Which verb the title asks about. */
53
110
  function actionKeyOf(target) {
54
111
  return target.action === 'remove'
@@ -36,7 +36,7 @@ export interface PromptController {
36
36
  * branch calls this first, before its clear/exit semantics.
37
37
  */
38
38
  consumeSelectionCopy(): boolean;
39
- /** Consume selection/editor Esc before Chat's working-turn interrupt. */
39
+ /** Consume a local overlay/editor Esc before Chat's working-turn interrupt. */
40
40
  consumeEscape(): boolean;
41
41
  /** Toggle vim editing mode (`/vim`); returns the new state (true = on). */
42
42
  toggleVim(): boolean;
@@ -85,6 +85,14 @@ export interface PromptInputProps {
85
85
  * empty first value.
86
86
  */
87
87
  draftCache?: PromptDraftCache;
88
+ /**
89
+ * The input can take keys: draft adoption has run and the listener above is
90
+ * live. Fires on mount when already unsuspended, and again whenever
91
+ * `suspended` lifts — a caller replaying keys captured during a screen swap
92
+ * must hold its queue until then, because a replay emitted while suspended
93
+ * is dropped by `isActive: !suspended` with nothing left to retry it.
94
+ */
95
+ onInputReady?: () => void;
88
96
  /** Whether the `?` help menu is open (state lives in the Chat screen). */
89
97
  helpOpen: boolean;
90
98
  onToggleHelp(): void;
@@ -149,9 +157,9 @@ export interface PromptInputProps {
149
157
  onCaretImage?(image: TranscriptImage | undefined, title: string | undefined, reason: 'caret' | 'click'): void;
150
158
  /**
151
159
  * True while the caller shows the caret-driven preview. Esc then goes to
152
- * `onDismissCaretPreview` ahead of every other Esc meaning (the ladder's
153
- * "close the image preview" rung): this input's listener runs before
154
- * Chat's, and the prompt is NOT inert under a caret preview.
160
+ * `onDismissCaretPreview` after help and before ordinary editing (the
161
+ * "close the image preview" rung). Chat can delegate through the prompt
162
+ * controller; the prompt remains active under a caret preview.
155
163
  */
156
164
  caretPreviewOpen?: boolean;
157
165
  onDismissCaretPreview?(): void;
@@ -192,5 +200,5 @@ export interface PromptInputProps {
192
200
  * working) interrupts the turn and delivers them right away; Ctrl+Enter
193
201
  * aborts the turn and sends the current input immediately.
194
202
  */
195
- export declare function PromptInput({ channel, toastSuppressed, suspended, cursorParking, draftCache, helpOpen, onToggleHelp, onRunCommand, selectionActive, fillText, onFillConsumed, onRewindRequest, onBackgroundRequest, onOpenSessions, backendLabel, backgroundAgentsNeedingInput, controllerRef, onCaretImage, caretPreviewOpen, onDismissCaretPreview, now, }: PromptInputProps): React.JSX.Element | null;
203
+ export declare function PromptInput({ channel, toastSuppressed, suspended, cursorParking, draftCache, onInputReady, helpOpen, onToggleHelp, onRunCommand, selectionActive, fillText, onFillConsumed, onRewindRequest, onBackgroundRequest, onOpenSessions, backendLabel, backgroundAgentsNeedingInput, controllerRef, onCaretImage, caretPreviewOpen, onDismissCaretPreview, now, }: PromptInputProps): React.JSX.Element | null;
196
204
  //# sourceMappingURL=PromptInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PromptInput.d.ts","sourceRoot":"","sources":["../../../src/components/PromptInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AA8BzB,OAAO,KAAK,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,KAAK,EACV,gBAAgB,EAGjB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAa1E,OAAO,EAIL,KAAK,gBAAgB,EAEtB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA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