@deepseek-harness-tui/dsh-tui 0.17.0 → 0.19.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 (318) hide show
  1. package/README.md +43 -16
  2. package/bin/dsh-tui.js +46 -3
  3. package/cli/adapters/dsh/index.mjs +2 -2
  4. package/guide/dsh-tui-guide/cli.en.md +1 -1
  5. package/guide/dsh-tui-guide/cli.md +1 -1
  6. package/guide/dsh-tui-guide/codex-backend.en.md +2 -2
  7. package/guide/dsh-tui-guide/codex-backend.md +2 -2
  8. package/guide/dsh-tui-guide/configuration.en.md +8 -2
  9. package/guide/dsh-tui-guide/configuration.md +8 -2
  10. package/guide/dsh-tui-guide/getting-started.en.md +174 -6
  11. package/guide/dsh-tui-guide/getting-started.md +125 -15
  12. package/guide/dsh-tui-guide/interaction.en.md +30 -8
  13. package/guide/dsh-tui-guide/interaction.md +18 -5
  14. package/guide/dsh-tui-guide/plugins.en.md +28 -7
  15. package/guide/dsh-tui-guide/plugins.md +18 -5
  16. package/guide/dsh-tui-guide/user-guide.en.md +32 -17
  17. package/guide/dsh-tui-guide/user-guide.md +23 -12
  18. package/lib/settings.json +3 -3
  19. package/lib/types/adapter/channel/ui-policy.d.ts +1 -0
  20. package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
  21. package/lib/types/adapter/channel/ui-policy.js +1 -0
  22. package/lib/types/adapter/ports/channel-ui.d.ts +10 -2
  23. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  24. package/lib/types/adapter/ports/channel-view.d.ts +31 -5
  25. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  26. package/lib/types/adapter/standard/grants.d.ts +60 -0
  27. package/lib/types/adapter/standard/grants.d.ts.map +1 -1
  28. package/lib/types/adapter/standard/grants.js +74 -0
  29. package/lib/types/agent/events.d.ts +16 -3
  30. package/lib/types/agent/events.d.ts.map +1 -1
  31. package/lib/types/agent/session.d.ts +5 -0
  32. package/lib/types/agent/session.d.ts.map +1 -1
  33. package/lib/types/backends/claude/translate/core.d.ts +2 -2
  34. package/lib/types/backends/claude/translate/core.d.ts.map +1 -1
  35. package/lib/types/backends/claude/translate/core.js +10 -6
  36. package/lib/types/backends/codex/session/commands.d.ts +2 -0
  37. package/lib/types/backends/codex/session/commands.d.ts.map +1 -1
  38. package/lib/types/backends/codex/session/commands.js +8 -4
  39. package/lib/types/backends/codex/session/input.d.ts +11 -7
  40. package/lib/types/backends/codex/session/input.d.ts.map +1 -1
  41. package/lib/types/backends/codex/session/input.js +68 -15
  42. package/lib/types/backends/codex/session/session.d.ts.map +1 -1
  43. package/lib/types/backends/codex/session/session.js +2 -3
  44. package/lib/types/channel/projection.d.ts.map +1 -1
  45. package/lib/types/channel/projection.js +78 -10
  46. package/lib/types/channel/questions.d.ts +19 -3
  47. package/lib/types/channel/questions.d.ts.map +1 -1
  48. package/lib/types/channel/sanitize.d.ts.map +1 -1
  49. package/lib/types/channel/sanitize.js +8 -4
  50. package/lib/types/channel/subagent-failure.d.ts +49 -0
  51. package/lib/types/channel/subagent-failure.d.ts.map +1 -0
  52. package/lib/types/channel/subagent-failure.js +59 -0
  53. package/lib/types/channel/transcript.d.ts +17 -0
  54. package/lib/types/channel/transcript.d.ts.map +1 -1
  55. package/lib/types/channel/transcript.js +35 -0
  56. package/lib/types/commands.js +2 -2
  57. package/lib/types/components/GoalTodoPanel.d.ts +71 -6
  58. package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
  59. package/lib/types/components/GoalTodoPanel.js +165 -17
  60. package/lib/types/components/MessageList.d.ts.map +1 -1
  61. package/lib/types/components/MessageList.js +14 -9
  62. package/lib/types/components/PluginGrantList.d.ts +45 -0
  63. package/lib/types/components/PluginGrantList.d.ts.map +1 -0
  64. package/lib/types/components/PluginGrantList.js +126 -0
  65. package/lib/types/components/PluginInstallPane.d.ts.map +1 -1
  66. package/lib/types/components/PluginInstallPane.js +35 -6
  67. package/lib/types/components/PluginManagePane.d.ts.map +1 -1
  68. package/lib/types/components/PluginManagePane.js +65 -8
  69. package/lib/types/components/PromptInput.d.ts.map +1 -1
  70. package/lib/types/components/PromptInput.js +63 -8
  71. package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
  72. package/lib/types/components/SubagentDashboard.js +17 -1
  73. package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
  74. package/lib/types/components/SubagentDetailScene.js +12 -0
  75. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +2 -1
  76. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  77. package/lib/types/components/messages/AssistantToolUseMessage.js +16 -7
  78. package/lib/types/components/onboardingModel.d.ts +2 -2
  79. package/lib/types/components/onboardingModel.js +3 -3
  80. package/lib/types/components/onboardingProviderPlan.d.ts +110 -0
  81. package/lib/types/components/onboardingProviderPlan.d.ts.map +1 -0
  82. package/lib/types/components/onboardingProviderPlan.js +78 -0
  83. package/lib/types/components/questions/AskUserQuestionPanel.d.ts +5 -8
  84. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  85. package/lib/types/components/questions/AskUserQuestionPanel.js +7 -4
  86. package/lib/types/components/questions/PlanReviewPanel.d.ts +3 -6
  87. package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
  88. package/lib/types/components/revealScope.d.ts +15 -0
  89. package/lib/types/components/revealScope.d.ts.map +1 -0
  90. package/lib/types/components/revealScope.js +17 -0
  91. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +41 -1
  92. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
  93. package/lib/types/components/sidePanel/btw/BtwComposer.js +123 -6
  94. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
  95. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +9 -2
  96. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +7 -1
  97. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
  98. package/lib/types/components/sidePanel/btw/BtwThreadScene.js +9 -2
  99. package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts +30 -0
  100. package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts.map +1 -0
  101. package/lib/types/components/sidePanel/btw/useBtwComposerPaste.js +94 -0
  102. package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
  103. package/lib/types/components/sidePanel/builtinPanels.js +14 -2
  104. package/lib/types/components/sidePanel/types.d.ts +2 -0
  105. package/lib/types/components/sidePanel/types.d.ts.map +1 -1
  106. package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
  107. package/lib/types/components/sidePanel/useSidePanel.js +15 -1
  108. package/lib/types/components/smoothReveal.d.ts +36 -6
  109. package/lib/types/components/smoothReveal.d.ts.map +1 -1
  110. package/lib/types/components/smoothReveal.js +92 -21
  111. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +4 -14
  112. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
  113. package/lib/types/components/workspaces/HomeWorkspaceRow.js +26 -17
  114. package/lib/types/dsh-adapter/backend/session.d.ts +7 -1
  115. package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
  116. package/lib/types/dsh-adapter/backend/session.js +74 -6
  117. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  118. package/lib/types/dsh-adapter/backend/translate.js +15 -6
  119. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +1 -1
  120. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -1
  121. package/lib/types/dsh-adapter/channel/agent-view-projection.js +3 -1
  122. package/lib/types/dsh-adapter/channel/attached-context.d.ts +15 -2
  123. package/lib/types/dsh-adapter/channel/attached-context.d.ts.map +1 -1
  124. package/lib/types/dsh-adapter/channel/attached-context.js +26 -3
  125. package/lib/types/dsh-adapter/channel/binding-events.d.ts +3 -0
  126. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
  127. package/lib/types/dsh-adapter/channel/binding-events.js +43 -2
  128. package/lib/types/dsh-adapter/channel/composer-images.d.ts +2 -0
  129. package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
  130. package/lib/types/dsh-adapter/channel/composer-images.js +10 -2
  131. package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
  132. package/lib/types/dsh-adapter/channel/composer-mentions.js +22 -7
  133. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +3 -7
  134. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
  135. package/lib/types/dsh-adapter/channel/context-bookkeeping.js +16 -6
  136. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +6 -0
  137. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
  138. package/lib/types/dsh-adapter/channel/core/binding-feed.js +35 -1
  139. package/lib/types/dsh-adapter/channel/core/compose.d.ts +3 -7
  140. package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
  141. package/lib/types/dsh-adapter/channel/core/compose.js +6 -1
  142. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
  143. package/lib/types/dsh-adapter/channel/core/local-actions.js +3 -26
  144. package/lib/types/dsh-adapter/channel/emitter.js +1 -1
  145. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  146. package/lib/types/dsh-adapter/channel/extensions.js +8 -0
  147. package/lib/types/dsh-adapter/channel/input-actions.d.ts +4 -4
  148. package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
  149. package/lib/types/dsh-adapter/channel/input-actions.js +59 -5
  150. package/lib/types/dsh-adapter/channel/input-delivery.d.ts +3 -7
  151. package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
  152. package/lib/types/dsh-adapter/channel/input-delivery.js +21 -8
  153. package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -1
  154. package/lib/types/dsh-adapter/channel/mentions.js +21 -7
  155. package/lib/types/dsh-adapter/channel/model-actions.d.ts +4 -1
  156. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
  157. package/lib/types/dsh-adapter/channel/model-actions.js +26 -9
  158. package/lib/types/dsh-adapter/channel/model-selection.d.ts +27 -2
  159. package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
  160. package/lib/types/dsh-adapter/channel/model-selection.js +81 -37
  161. package/lib/types/dsh-adapter/channel/model-switch.d.ts +1 -1
  162. package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
  163. package/lib/types/dsh-adapter/channel/paths.d.ts.map +1 -1
  164. package/lib/types/dsh-adapter/channel/paths.js +11 -9
  165. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +1 -1
  166. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
  167. package/lib/types/dsh-adapter/channel/session-live-adoption.js +6 -1
  168. package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
  169. package/lib/types/dsh-adapter/channel/session-reset.js +3 -1
  170. package/lib/types/dsh-adapter/channel/session-resume.d.ts +1 -1
  171. package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
  172. package/lib/types/dsh-adapter/channel/session-resume.js +10 -3
  173. package/lib/types/dsh-adapter/channel/session-rewind.d.ts +1 -1
  174. package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
  175. package/lib/types/dsh-adapter/channel/session-rewind.js +9 -3
  176. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts +1 -1
  177. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
  178. package/lib/types/dsh-adapter/channel/session-tree-actions.js +11 -5
  179. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  180. package/lib/types/dsh-adapter/channel/settings-host.js +6 -3
  181. package/lib/types/dsh-adapter/channel/transcript.d.ts +3 -2
  182. package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
  183. package/lib/types/dsh-adapter/channel/transcript.js +13 -4
  184. package/lib/types/dsh-adapter/channel/types.d.ts +11 -2
  185. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
  186. package/lib/types/dsh-adapter/contract.d.ts +27 -3
  187. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  188. package/lib/types/dsh-adapter/contract.js +47 -5
  189. package/lib/types/dsh-adapter/entry-slot.d.ts +6 -0
  190. package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -1
  191. package/lib/types/dsh-adapter/experimental-bundles.d.ts +3 -0
  192. package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -1
  193. package/lib/types/dsh-adapter/experimental-bundles.js +4 -0
  194. package/lib/types/dsh-adapter/fresh-agent.d.ts +1 -1
  195. package/lib/types/dsh-adapter/fresh-agent.d.ts.map +1 -1
  196. package/lib/types/dsh-adapter/fresh-agent.js +60 -11
  197. package/lib/types/dsh-adapter/grant-file.d.ts +70 -0
  198. package/lib/types/dsh-adapter/grant-file.d.ts.map +1 -0
  199. package/lib/types/dsh-adapter/grant-file.js +178 -0
  200. package/lib/types/dsh-adapter/host-access.d.ts +4 -0
  201. package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
  202. package/lib/types/dsh-adapter/host-access.js +114 -15
  203. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  204. package/lib/types/dsh-adapter/host-contract.d.ts.map +1 -1
  205. package/lib/types/dsh-adapter/host-contract.js +5 -3
  206. package/lib/types/dsh-adapter/host-dsh.d.ts +0 -8
  207. package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
  208. package/lib/types/dsh-adapter/host-dsh.js +27 -6
  209. package/lib/types/dsh-adapter/host-entry.js +4 -0
  210. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  211. package/lib/types/dsh-adapter/index.js +8 -5
  212. package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -1
  213. package/lib/types/dsh-adapter/oauth/profiles.js +14 -1
  214. package/lib/types/dsh-adapter/panels.d.ts +7 -1
  215. package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
  216. package/lib/types/dsh-adapter/plugin-declaration.d.ts +28 -0
  217. package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -1
  218. package/lib/types/dsh-adapter/plugin-declaration.js +43 -1
  219. package/lib/types/dsh-adapter/plugin-install.d.ts +28 -1
  220. package/lib/types/dsh-adapter/plugin-install.d.ts.map +1 -1
  221. package/lib/types/dsh-adapter/plugin-install.js +160 -13
  222. package/lib/types/dsh-adapter/plugin-manage.d.ts +53 -10
  223. package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
  224. package/lib/types/dsh-adapter/plugin-manage.js +240 -51
  225. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  226. package/lib/types/dsh-adapter/plugin.js +203 -58
  227. package/lib/types/dsh-adapter/plugins-info.d.ts +6 -7
  228. package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
  229. package/lib/types/dsh-adapter/plugins-info.js +34 -21
  230. package/lib/types/dsh-adapter/presets.d.ts +41 -10
  231. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  232. package/lib/types/dsh-adapter/presets.js +59 -12
  233. package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
  234. package/lib/types/dsh-adapter/process-exit.js +1 -1
  235. package/lib/types/dsh-adapter/providerWizard.d.ts +2 -0
  236. package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
  237. package/lib/types/dsh-adapter/providerWizard.js +11 -5
  238. package/lib/types/dsh-adapter/questions.d.ts +3 -4
  239. package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
  240. package/lib/types/dsh-adapter/questions.js +1 -1
  241. package/lib/types/dsh-adapter/row-attachment.d.ts +30 -0
  242. package/lib/types/dsh-adapter/row-attachment.d.ts.map +1 -0
  243. package/lib/types/dsh-adapter/row-attachment.js +29 -0
  244. package/lib/types/dsh-adapter/session-list-metadata.js +2 -2
  245. package/lib/types/dsh-adapter/subagents.d.ts +5 -0
  246. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  247. package/lib/types/dsh-adapter/subagents.js +22 -1
  248. package/lib/types/dsh-adapter/team-mode.d.ts +17 -10
  249. package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
  250. package/lib/types/dsh-adapter/team-mode.js +19 -12
  251. package/lib/types/dsh-adapter/tool-scope.d.ts +24 -0
  252. package/lib/types/dsh-adapter/tool-scope.d.ts.map +1 -0
  253. package/lib/types/dsh-adapter/tool-scope.js +127 -0
  254. package/lib/types/dsh-adapter/types.d.ts +2 -1
  255. package/lib/types/dsh-adapter/types.d.ts.map +1 -1
  256. package/lib/types/dsh-adapter/worktree-tool.d.ts +27 -0
  257. package/lib/types/dsh-adapter/worktree-tool.d.ts.map +1 -0
  258. package/lib/types/dsh-adapter/worktree-tool.js +87 -0
  259. package/lib/types/heldInputs.d.ts +75 -0
  260. package/lib/types/heldInputs.d.ts.map +1 -0
  261. package/lib/types/heldInputs.js +409 -0
  262. package/lib/types/i18n.d.ts +577 -34
  263. package/lib/types/i18n.d.ts.map +1 -1
  264. package/lib/types/i18n.js +230 -22
  265. package/lib/types/ink/components/App.d.ts +2 -0
  266. package/lib/types/ink/components/App.d.ts.map +1 -1
  267. package/lib/types/ink/components/App.js +8 -0
  268. package/lib/types/ink/events/input-event.d.ts.map +1 -1
  269. package/lib/types/ink/events/input-event.js +7 -6
  270. package/lib/types/ink/hit-test.d.ts +2 -0
  271. package/lib/types/ink/hit-test.d.ts.map +1 -1
  272. package/lib/types/ink/hit-test.js +10 -0
  273. package/lib/types/ink/hooks/use-program-status.d.ts +1 -1
  274. package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -1
  275. package/lib/types/ink/hooks/use-program-status.js +3 -2
  276. package/lib/types/ink/ink.d.ts +1 -0
  277. package/lib/types/ink/ink.d.ts.map +1 -1
  278. package/lib/types/ink/ink.js +5 -2
  279. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  280. package/lib/types/ink/parse-keypress.js +25 -0
  281. package/lib/types/ink/terminal.d.ts +13 -2
  282. package/lib/types/ink/terminal.d.ts.map +1 -1
  283. package/lib/types/ink/terminal.js +29 -5
  284. package/lib/types/onboardingDraft.d.ts +143 -0
  285. package/lib/types/onboardingDraft.d.ts.map +1 -0
  286. package/lib/types/onboardingDraft.js +71 -0
  287. package/lib/types/screens/Chat.d.ts.map +1 -1
  288. package/lib/types/screens/Chat.js +133 -32
  289. package/lib/types/screens/Onboarding.d.ts +22 -3
  290. package/lib/types/screens/Onboarding.d.ts.map +1 -1
  291. package/lib/types/screens/Onboarding.js +606 -36
  292. package/lib/types/screens/SessionSupervisor.d.ts +3 -6
  293. package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
  294. package/lib/types/screens/SessionSupervisor.js +5 -8
  295. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +1 -2
  296. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
  297. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +2 -2
  298. package/lib/types/screens/sessionSupervisor/model.d.ts +1 -1
  299. package/lib/types/screens/sessionSupervisor/model.js +1 -1
  300. package/lib/types/sessionMounts.d.ts +12 -5
  301. package/lib/types/sessionMounts.d.ts.map +1 -1
  302. package/lib/types/sessionMounts.js +33 -6
  303. package/lib/types/settings/definitions.js +2 -2
  304. package/lib/types/update.d.ts +412 -20
  305. package/lib/types/update.d.ts.map +1 -1
  306. package/lib/types/update.js +2094 -193
  307. package/lib/types/updateHost.d.ts +198 -0
  308. package/lib/types/updateHost.d.ts.map +1 -0
  309. package/lib/types/updateHost.js +608 -0
  310. package/lib/types/utils/paths.d.ts +15 -0
  311. package/lib/types/utils/paths.d.ts.map +1 -1
  312. package/lib/types/utils/paths.js +25 -0
  313. package/lib/types/utils/processName.d.ts +16 -0
  314. package/lib/types/utils/processName.d.ts.map +1 -0
  315. package/lib/types/utils/processName.js +27 -0
  316. package/package.json +114 -108
  317. package/tui-profile/feed/README.md +1 -1
  318. package/tui-profile/feed/first-party.json +1 -1
@@ -15,6 +15,8 @@ import { AlternateScreen, Box, Image, Text, InputCaret, useInput, useApp, useStd
15
15
  import { usePageInset } from '../components/PageMargin.js';
16
16
  import { POINTER } from '../terminal-utils/figures.js';
17
17
  import { previousCodePoint } from '../components/AgentMessageComposer.js';
18
+ import { resetRevealSession } from '../components/smoothReveal.js';
19
+ import { RevealScopeContext } from '../components/revealScope.js';
18
20
  import { isPlainReturnInput } from '../utils/modifiers.js';
19
21
  import { actionMatches, effectiveComboDisplay, primaryComboString } from '../utils/keymap.js';
20
22
  import { formatTokens } from '../terminal-utils/format.js';
@@ -149,6 +151,7 @@ import instances from '../ink/instances.js';
149
151
  import { useExternalVersion } from '../hooks/useExternalVersion.js';
150
152
  import { TrajectoryScene } from './TrajectoryScene.js';
151
153
  import { markHomeSeen } from '../homePrefs.js';
154
+ import { clearOnboardingDraft } from '../onboardingDraft.js';
152
155
  import { markOnboardingDone } from '../onboardingPrefs.js';
153
156
  import { Launchpad, launchpadVisible } from './Launchpad.js';
154
157
  import { resolveLaunchpadActions } from '../components/launchpadActions.js';
@@ -343,6 +346,8 @@ const EMPTY_KERNEL_ENTRIES = [];
343
346
  function peekKey(image, title) {
344
347
  return `${title ?? ''} ${image.id}`;
345
348
  }
349
+ /** Distinguishes reveal keyspaces of concurrently mounted Chat roots. */
350
+ let revealRootSequence = 0;
346
351
  export function Chat({ channel, questionStore, approvalStore, extensionDialogs, bonusNotices, extensionStatus, activityStore, extensionShortcuts, themeHost, onExit, onUpdate, onRestart, onSwitchBackend, onRestartFreshSession, onProbeKernels, kernelEntries = EMPTY_KERNEL_ENTRIES, onResolveSdkInstall, onPluginInstall, onPluginManage, onTeamCommand, kernelPinned, fullscreen = false, trajectorySeen: trajectorySeenProp, injectControllerRef, promptControllerRef: promptControllerRefProp, renderScene, openHomeOnBoot, launchpadOnBoot, onboardingOnBoot, starPrompt, }) {
347
352
  const { internal_eventEmitter: inputEmitter } = useStdin();
348
353
  const writeRaw = React.useContext(TerminalWriteContext);
@@ -556,6 +561,77 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
556
561
  return ok;
557
562
  });
558
563
  };
564
+ /**
565
+ * The guide's access step needs two ACTIONS, and both of them already exist
566
+ * as flows Chat owns: the subscription sign-in (`runOAuthLogin` over the
567
+ * shared question panel — the same one `/login` uses on a backend session)
568
+ * and the `/provider` add flow. Chat hands them to the wizard as plain
569
+ * callbacks, so the screen keeps importing no adapter VALUES of its own and
570
+ * the question panel keeps exactly one owner.
571
+ *
572
+ * The catalog tail is the same consistency `/provider` performs: a sign-in
573
+ * flips a provider's credential-gated catalog from empty to full, so the
574
+ * model picker's cache, `models` and `providerInfos` must be re-read.
575
+ */
576
+ const refreshProviderCatalog = React.useCallback(() => {
577
+ channel.invalidateModelCompletion();
578
+ const generation = ++modelCatalogGeneration.current;
579
+ void channel.listModels().then((list) => {
580
+ if (generation === modelCatalogGeneration.current)
581
+ setModels(list);
582
+ }).catch(() => undefined);
583
+ void channel.listProviders().then((list) => {
584
+ if (generation === modelCatalogGeneration.current)
585
+ setProviderInfos(list);
586
+ }).catch(() => {
587
+ if (generation === modelCatalogGeneration.current)
588
+ setProviderInfos([]);
589
+ });
590
+ }, [channel]);
591
+ const onboardingSignIn = React.useCallback((provider) => {
592
+ const oauth = channel.providerSetup()?.oauth;
593
+ if (oauth === undefined) {
594
+ channel.notify(t('provider-oauth-unmounted', { provider }), { color: 'warning', timeoutMs: 8000 });
595
+ return Promise.resolve('failed');
596
+ }
597
+ return runOAuthLogin({
598
+ ask: (request, options) => questionStore.ask(request, options),
599
+ notify: (text, options) => channel.notify(text, options),
600
+ pushLocal: (title, lines) => channel.pushLocal(title, lines),
601
+ }, oauth, provider).then((outcome) => {
602
+ // A sign-out empties that provider's catalog just as a sign-in fills it.
603
+ if (outcome === 'added' || outcome === 'signed-out')
604
+ refreshProviderCatalog();
605
+ return outcome;
606
+ }).catch(() => 'failed');
607
+ }, [channel, questionStore, refreshProviderCatalog]);
608
+ /** `/provider` and the guide's add-provider action: one wizard wiring, one catalog tail. */
609
+ const runProviderSetup = React.useCallback(() => {
610
+ const host = channel.providerSetup();
611
+ if (host === undefined) {
612
+ channel.notify(t('provider-unavailable'), { color: 'warning', timeoutMs: 8000 });
613
+ return Promise.resolve('failed');
614
+ }
615
+ return runProviderWizard({
616
+ host,
617
+ ask: (request, options) => questionStore.ask(request, options),
618
+ notify: (text, options) => channel.notify(text, options),
619
+ pushLocal: (title, lines) => channel.pushLocal(title, lines),
620
+ working: () => channel.working,
621
+ switchModel: (provider, model) => switchModelRecorded(provider, model),
622
+ currentModel: () => channel.model,
623
+ }).then((outcome) => {
624
+ // A catalog-changing outcome invalidates every cached model surface so
625
+ // `/model` (picker + completion) reflects it immediately; the wizard's
626
+ // live-switch branch already dropped the completion cache via
627
+ // switchModelRecorded — this covers keep-current, add, edit, delete and
628
+ // OAuth login/logout.
629
+ if (outcome === 'added' || outcome === 'updated' || outcome === 'deleted' || outcome === 'signed-out') {
630
+ refreshProviderCatalog();
631
+ }
632
+ return outcome;
633
+ }).catch(() => 'failed');
634
+ }, [channel, questionStore, refreshProviderCatalog, switchModelRecorded]);
559
635
  const modelPicker = useModelPicker({
560
636
  channel, models, providers: providerInfos, recents: modelProviderTabs ? modelRecents : undefined, open: overlay.kind === 'model',
561
637
  onCancel: () => dispatchOverlay({ type: 'close-if', kind: 'model' }),
@@ -1369,7 +1445,27 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
1369
1445
  ink?.clearScrollbackAndRedraw();
1370
1446
  }, 0);
1371
1447
  };
1448
+ // This root's reveal keyspace. A process can hold more than one Chat root
1449
+ // (a plugin recompose or a remount builds a fresh tree), and each owns its
1450
+ // row ids: sharing one table let a rebind in one root clear another's
1451
+ // completed keys, so its history re-typewrote from the start.
1452
+ const revealScopeRef = React.useRef(undefined);
1453
+ if (revealScopeRef.current === undefined)
1454
+ revealScopeRef.current = `chat-root-${++revealRootSequence}`;
1455
+ const bindingGeneration = channel.agentBindingGeneration;
1456
+ // The binding generation is part of the keyspace, not a reset trigger: a
1457
+ // re-resume replays its rows in the same commit that bumps the generation,
1458
+ // so a layout-phase reset would run *after* that frame had already built its
1459
+ // caught-up cursors — the next live delta would repaint the row from zero.
1460
+ // A new scope leaves the old keys unreachable instead, and the effect below
1461
+ // releases them as soon as the scope is replaced.
1462
+ const revealScope = `${revealScopeRef.current}:b${bindingGeneration}`;
1463
+ // The tables are module-level, so a scope that stops being used (a rebind
1464
+ // or the root unmounting) must say so: its keys would otherwise outlive it
1465
+ // for the life of the process.
1466
+ React.useEffect(() => () => resetRevealSession(revealScope), [revealScope]);
1372
1467
  const lastAgentIdRef = React.useRef(undefined);
1468
+ const lastResetScopeRef = React.useRef(revealScope);
1373
1469
  React.useEffect(() => {
1374
1470
  const id = channel.agentId;
1375
1471
  if (lastAgentIdRef.current === undefined) {
@@ -1379,6 +1475,17 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
1379
1475
  if (lastAgentIdRef.current === id)
1380
1476
  return;
1381
1477
  lastAgentIdRef.current = id;
1478
+ // Reveal state is keyed by row id, and ids restart at 0 after an adopt:
1479
+ // without this, a completed `a12` from the old session would suppress (or
1480
+ // an in-flight cursor would resume over) the new session's row 12. A
1481
+ // switch that also bumped the binding generation already moved to a fresh
1482
+ // keyspace, and this frame's replay wrote caught-up cursors into it:
1483
+ // clearing that scope here would repaint the resumed row from zero, so
1484
+ // only a switch that kept the keyspace needs the reset.
1485
+ const sameKeyspace = lastResetScopeRef.current === revealScope;
1486
+ lastResetScopeRef.current = revealScope;
1487
+ if (sameKeyspace)
1488
+ resetRevealSession(revealScope);
1382
1489
  setExpanded(false);
1383
1490
  setExpandedRows(new Set());
1384
1491
  setSelectedId(null);
@@ -1621,6 +1728,9 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
1621
1728
  */
1622
1729
  const closeOnboarding = React.useCallback((outcome) => {
1623
1730
  setOnboardingOpen(false);
1731
+ // The guide's in-process progress (step, diff baseline, in-flight action)
1732
+ // is only meaningful while it is on screen; a later `/setup` starts fresh.
1733
+ clearOnboardingDraft();
1624
1734
  if (outcome === 'done') {
1625
1735
  const written = markOnboardingDone();
1626
1736
  setOnboardingPending(false);
@@ -2339,6 +2449,8 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
2339
2449
  lines.push(t('command-output-truncated'));
2340
2450
  // The report already has a cell cap. Avoid a second UTF-16 preview cut
2341
2451
  // splitting an emoji or a combining sequence in the local row sink.
2452
+ // A side-effect-only command can return no text: with no report there
2453
+ // is nothing to title, so keep the same guard as the block branch.
2342
2454
  if (lines.length > 0)
2343
2455
  channel.pushLocal(`/${name}`, lines, { lineLimit: 65_536, preserveWhitespace: true });
2344
2456
  if (outcome.kind === 'error') {
@@ -2930,7 +3042,11 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
2930
3042
  case 'clear':
2931
3043
  channel.clear();
2932
3044
  // channel.clear() resets row ids to 0; stale expanded/selection
2933
- // state would mis-highlight fresh rows (known-limitation fix).
3045
+ // state would mis-highlight fresh rows (known-limitation fix). The
3046
+ // reveal memory is keyed by the same ids: left alone, the new
3047
+ // session's first rows would hit the old `a0…aN` entries and paint
3048
+ // without their reveal.
3049
+ resetRevealSession(revealScope);
2934
3050
  setExpandedRows(new Set());
2935
3051
  setStreamViewToggledRows(new Set());
2936
3052
  setSelectedId(null);
@@ -3075,36 +3191,10 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
3075
3191
  // Interactive add-provider wizard (/provider): drives the shared
3076
3192
  // question panel, persists profile + key via the channel's settings/
3077
3193
  // credentials seams. No picker state — AskUserQuestionPanel renders it.
3194
+ // The wizard notifies on every handled failure, and the runner never
3195
+ // rejects.
3078
3196
  setHelpOpen(false);
3079
- const host = channel.providerSetup();
3080
- if (!host) {
3081
- channel.notify(t('provider-unavailable'), { color: 'warning', timeoutMs: 8000 });
3082
- return true;
3083
- }
3084
- void runProviderWizard({
3085
- host,
3086
- ask: (request, options) => questionStore.ask(request, options),
3087
- notify: (text, options) => channel.notify(text, options),
3088
- pushLocal: (title, lines) => channel.pushLocal(title, lines),
3089
- working: () => channel.working,
3090
- switchModel: (provider, model) => switchModelRecorded(provider, model),
3091
- }).then((outcome) => {
3092
- // A catalog-changing outcome invalidates every cached model surface
3093
- // so `/model` (picker + completion) reflects it immediately — the
3094
- // same consistency the picker's per-open refetch provides, minus
3095
- // the stale flash on the next open. The wizard's live-switch branch
3096
- // already dropped the completion cache via switchModelRecorded;
3097
- // this covers keep-current, add, edit, delete and OAuth login/logout.
3098
- if (outcome === 'added' || outcome === 'updated'
3099
- || outcome === 'deleted' || outcome === 'signed-out') {
3100
- channel.invalidateModelCompletion();
3101
- void channel.listModels().then(setModels);
3102
- void channel.listProviders().then(setProviderInfos).catch(() => setProviderInfos([]));
3103
- }
3104
- }).catch(() => {
3105
- // The wizard notifies on every handled failure; this only swallows
3106
- // an unexpected reject so it never surfaces as an unhandled promise.
3107
- });
3197
+ void runProviderSetup();
3108
3198
  return true;
3109
3199
  }
3110
3200
  case 'thinking':
@@ -5233,6 +5323,17 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
5233
5323
  event.stopImmediatePropagation();
5234
5324
  }
5235
5325
  }
5326
+ else if (view.step.kind === 'grant') {
5327
+ // registry 装后补授:Enter 写入清单,Esc 跳过(安装保留,浮层收起)。
5328
+ if (plainReturn) {
5329
+ pluginInstall.run(view.flow.grant());
5330
+ event.stopImmediatePropagation();
5331
+ }
5332
+ else if (key.escape) {
5333
+ pluginInstall.close();
5334
+ event.stopImmediatePropagation();
5335
+ }
5336
+ }
5236
5337
  else if (view.step.kind === 'build-blocked') {
5237
5338
  if (plainReturn) {
5238
5339
  pluginInstall.run(view.flow.approve(view.step.builds));
@@ -5985,7 +6086,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
5985
6086
  runFileAction(index, path);
5986
6087
  } }) })), overlay.kind === 'search' && _jsx(TranscriptSearch, { query: searchQuery, cursorOffset: searchCursor, count: searchCount, current: searchCurrent })] }));
5987
6088
  // Every scene retains the title, while its frame state stays in a null leaf.
5988
- const withTitle = (content) => (_jsxs(_Fragment, { children: [_jsx(ChatTitle, { title: channel.sessionTitle, working: channel.working, focused: terminalFocused }), content] }));
6089
+ const withTitle = (content) => (_jsxs(RevealScopeContext.Provider, { value: revealScope, children: [_jsx(ChatTitle, { title: channel.sessionTitle, working: channel.working, focused: terminalFocused }), content] }));
5989
6090
  const screenOpen = channel.pluginScene !== undefined || supervisorOpen || settingsOpen
5990
6091
  || subagentDetailId !== null || subagentDashboardOpen || sceneOpen
5991
6092
  || agentView !== null
@@ -6028,7 +6129,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
6028
6129
  * the user lands on the launcher.
6029
6130
  */
6030
6131
  if (onboardingOpen) {
6031
- const node = (_jsx(Onboarding, { channel: channel, themeHost: themeHost, onClose: closeOnboarding, onApplyLang: applyLang, onRunCommand: (name) => {
6132
+ const node = (_jsx(Onboarding, { channel: channel, themeHost: themeHost, onClose: closeOnboarding, onApplyLang: applyLang, onProviderSignIn: onboardingSignIn, onProviderAddProvider: runProviderSetup, onRunCommand: (name) => {
6032
6133
  // 与落地页的 onAction 同一条规则:打开整屏界面的命令要先把向导收掉。
6033
6134
  // 走 `closeOnboarding('skipped')` 而不是直接置 false——用户是去试命令、
6034
6135
  // 没答完引导,按 skipped 的口径不记账(下次启动还会问)。
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { type Lang } from '../i18n.js';
3
3
  import type { ChannelUi as Channel } from '../adapter/channel/ui-policy.js';
4
+ import type { ProviderWizardOutcome } from '../dsh-adapter/providerWizard.js';
4
5
  import type { TuiThemeHost } from '../dsh-adapter/themes.js';
5
6
  /**
6
7
  * Onboarding —— 首次运行的引导向导(`~/.dsh-tui/onboarding.json` 走一次性记账)。
@@ -15,8 +16,15 @@ import type { TuiThemeHost } from '../dsh-adapter/themes.js';
15
16
  *
16
17
  * **凭证永远只报"有没有",不报值**:`describeCredential` 回的是不含秘密的
17
18
  * 元数据,界面上也照它的原样画。
19
+ *
20
+ * 第一步(账号与模型接入)会把**动作**交给 Chat 执行:订阅登录与 `/provider`
21
+ * 的 key 流程都要用共享问答面板(设备码、授权 URL、密钥输入),而那套面板
22
+ * 归 Chat 的 `questionStore`。面板挂起时本屏会被卸载、回答后重挂,所以进度
23
+ * 落在 `src/onboardingDraft.ts`(模块级,不是 React state)——挂载时读回,
24
+ * 动作回来时按"动作前的目录基线"做差分:订阅登录按 0/1/N 决定是否问默认模型,
25
+ * 加 key 只报结果(向导已经问过)。
18
26
  */
19
- export declare function Onboarding({ channel, themeHost, onClose, onRunCommand, onApplyLang, initialStep, externalNotice, }: {
27
+ export declare function Onboarding({ channel, themeHost, onClose, onRunCommand, onApplyLang, onProviderSignIn, onProviderAddProvider, initialStep, externalNotice, }: {
20
28
  channel: Channel;
21
29
  themeHost?: TuiThemeHost;
22
30
  /** 跳过 / 完成:把状态交回 Chat(它负责记账与切屏)。 */
@@ -29,8 +37,19 @@ export declare function Onboarding({ channel, themeHost, onClose, onRunCommand,
29
37
  * 优先级(env > cordis.yml > 持久化)只有 Chat 手里那一份。
30
38
  */
31
39
  onApplyLang: (lang: Lang) => void;
32
- /** 测试缝:直接落在某一步(探针不重复走前几步)。 */
33
- initialStep?: number;
40
+ /**
41
+ * 订阅账号登录(第一步的动作行):Chat 用既有的 `runOAuthLogin` +
42
+ * `questionStore` 跑完整个 OAuth 流程,只把结果交回来。返回值口径与
43
+ * `/provider` 的 `ProviderWizardOutcome` 一致。
44
+ */
45
+ onProviderSignIn?: (provider: string) => Promise<ProviderWizardOutcome>;
46
+ /**
47
+ * "添加模型提供方(API key)":Chat 用既有的 `runProviderWizard` 跑
48
+ * `/provider` 的 add 流程(route / 端点 / key / 模型多选 / 回滚都在那里)。
49
+ */
50
+ onProviderAddProvider?: () => Promise<ProviderWizardOutcome>;
51
+ /** 测试缝:直接落在某一步(探针不重复走前几步;不给则从 draft 恢复)。 */
52
+ initialStep?: number | undefined;
34
53
  /** 测试缝:外部注入一句提示(真机不传)。 */
35
54
  externalNotice?: string;
36
55
  }): React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"Onboarding.d.ts","sourceRoot":"","sources":["../../../src/screens/Onboarding.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,OAAO,EAAqB,KAAK,IAAI,EAAE,MAAM,YAAY,CAAA;AAkBzD,OAAO,KAAK,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,iCAAiC,CAAA;AAG3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAqC5D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,SAAS,EACT,OAAO,EACP,YAAY,EACZ,WAAW,EACX,WAAe,EACf,cAAc,GACf,EAAE;IACD,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,YAAY,CAAA;IACxB,oCAAoC;IACpC,OAAO,EAAE,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,KAAK,IAAI,CAAA;IAC9C,0DAA0D;IAC1D,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC;;;;OAIG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IACjC,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0BAA0B;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,GAAG,KAAK,CAAC,SAAS,CAydlB"}
1
+ {"version":3,"file":"Onboarding.d.ts","sourceRoot":"","sources":["../../../src/screens/Onboarding.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,OAAO,EAAqB,KAAK,IAAI,EAAE,MAAM,YAAY,CAAA;AAmCzD,OAAO,KAAK,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,iCAAiC,CAAA;AAI3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAgG5D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,SAAS,EACT,OAAO,EACP,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,WAAW,EACX,cAAc,GACf,EAAE;IACD,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,YAAY,CAAA;IACxB,oCAAoC;IACpC,OAAO,EAAE,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,KAAK,IAAI,CAAA;IAC9C,0DAA0D;IAC1D,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC;;;;OAIG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IACjC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAA;IACvE;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAC5D,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,0BAA0B;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,GAAG,KAAK,CAAC,SAAS,CAy+BlB"}