@deepseek-harness-tui/dsh-tui 0.18.0 → 0.20.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 +90 -59
  2. package/bin/dsh-tui.js +46 -3
  3. package/cordis.patch.yml +5 -3
  4. package/cordis.yml +3 -2
  5. package/guide/dsh-tui-guide/codex-backend.en.md +2 -2
  6. package/guide/dsh-tui-guide/codex-backend.md +2 -2
  7. package/guide/dsh-tui-guide/configuration.en.md +7 -2
  8. package/guide/dsh-tui-guide/configuration.md +7 -2
  9. package/guide/dsh-tui-guide/getting-started.en.md +168 -4
  10. package/guide/dsh-tui-guide/getting-started.md +121 -14
  11. package/guide/dsh-tui-guide/interaction.en.md +11 -10
  12. package/guide/dsh-tui-guide/interaction.md +5 -4
  13. package/guide/dsh-tui-guide/user-guide.en.md +12 -6
  14. package/guide/dsh-tui-guide/user-guide.md +12 -6
  15. package/lib/settings.json +24 -8
  16. package/lib/types/adapter/ports/channel-ui.d.ts +10 -7
  17. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  18. package/lib/types/adapter/ports/channel-view.d.ts +67 -8
  19. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  20. package/lib/types/agent/events.d.ts +14 -5
  21. package/lib/types/agent/events.d.ts.map +1 -1
  22. package/lib/types/agent/session.d.ts +5 -0
  23. package/lib/types/agent/session.d.ts.map +1 -1
  24. package/lib/types/backends/claude/tools.d.ts.map +1 -1
  25. package/lib/types/backends/claude/tools.js +8 -3
  26. package/lib/types/backends/claude/translate/core.d.ts +2 -2
  27. package/lib/types/backends/claude/translate/core.d.ts.map +1 -1
  28. package/lib/types/backends/claude/translate/core.js +10 -6
  29. package/lib/types/backends/codex/session/commands.d.ts +2 -0
  30. package/lib/types/backends/codex/session/commands.d.ts.map +1 -1
  31. package/lib/types/backends/codex/session/commands.js +8 -4
  32. package/lib/types/backends/codex/session/input.d.ts +11 -7
  33. package/lib/types/backends/codex/session/input.d.ts.map +1 -1
  34. package/lib/types/backends/codex/session/input.js +68 -15
  35. package/lib/types/backends/codex/session/session.d.ts.map +1 -1
  36. package/lib/types/backends/codex/session/session.js +2 -3
  37. package/lib/types/backends/codex/translate/presentation.d.ts.map +1 -1
  38. package/lib/types/backends/codex/translate/presentation.js +5 -2
  39. package/lib/types/channel/interaction.d.ts.map +1 -1
  40. package/lib/types/channel/interaction.js +1 -0
  41. package/lib/types/channel/permissions.d.ts +15 -0
  42. package/lib/types/channel/permissions.d.ts.map +1 -1
  43. package/lib/types/channel/permissions.js +28 -0
  44. package/lib/types/channel/projection.d.ts.map +1 -1
  45. package/lib/types/channel/projection.js +89 -11
  46. package/lib/types/channel/questions.d.ts +45 -3
  47. package/lib/types/channel/questions.d.ts.map +1 -1
  48. package/lib/types/channel/questions.js +43 -0
  49. package/lib/types/channel/sanitize.d.ts.map +1 -1
  50. package/lib/types/channel/sanitize.js +8 -4
  51. package/lib/types/channel/subagent-failure.d.ts +49 -0
  52. package/lib/types/channel/subagent-failure.d.ts.map +1 -0
  53. package/lib/types/channel/subagent-failure.js +59 -0
  54. package/lib/types/channel/transcript.d.ts +17 -0
  55. package/lib/types/channel/transcript.d.ts.map +1 -1
  56. package/lib/types/channel/transcript.js +35 -0
  57. package/lib/types/commands.js +2 -2
  58. package/lib/types/components/MessageList.d.ts.map +1 -1
  59. package/lib/types/components/MessageList.js +14 -10
  60. package/lib/types/components/PromptInput.d.ts.map +1 -1
  61. package/lib/types/components/PromptInput.js +61 -6
  62. package/lib/types/components/SplitDiffView.d.ts.map +1 -1
  63. package/lib/types/components/SplitDiffView.js +3 -2
  64. package/lib/types/components/StarPrompt.d.ts +5 -3
  65. package/lib/types/components/StarPrompt.d.ts.map +1 -1
  66. package/lib/types/components/StarPrompt.js +56 -6
  67. package/lib/types/components/SubagentCard.d.ts.map +1 -1
  68. package/lib/types/components/SubagentCard.js +1 -1
  69. package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
  70. package/lib/types/components/SubagentDashboard.js +9 -2
  71. package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
  72. package/lib/types/components/SubagentDetailScene.js +1 -1
  73. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  74. package/lib/types/components/messages/AssistantToolUseMessage.js +126 -25
  75. package/lib/types/components/questions/AskUserQuestionPanel.d.ts +5 -8
  76. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  77. package/lib/types/components/questions/AskUserQuestionPanel.js +7 -4
  78. package/lib/types/components/questions/PlanReviewPanel.d.ts +3 -6
  79. package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
  80. package/lib/types/components/revealScope.d.ts +15 -0
  81. package/lib/types/components/revealScope.d.ts.map +1 -0
  82. package/lib/types/components/revealScope.js +17 -0
  83. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +34 -1
  84. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
  85. package/lib/types/components/sidePanel/btw/BtwComposer.js +108 -7
  86. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
  87. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +1 -1
  88. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
  89. package/lib/types/components/sidePanel/btw/BtwThreadScene.js +1 -1
  90. package/lib/types/components/smoothReveal.d.ts +36 -6
  91. package/lib/types/components/smoothReveal.d.ts.map +1 -1
  92. package/lib/types/components/smoothReveal.js +92 -21
  93. package/lib/types/components/teamRoster.d.ts +6 -3
  94. package/lib/types/components/teamRoster.d.ts.map +1 -1
  95. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +4 -14
  96. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
  97. package/lib/types/components/workspaces/HomeWorkspaceRow.js +26 -17
  98. package/lib/types/dsh-adapter/approvals.d.ts +19 -0
  99. package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
  100. package/lib/types/dsh-adapter/approvals.js +17 -1
  101. package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
  102. package/lib/types/dsh-adapter/backend/session.js +12 -0
  103. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  104. package/lib/types/dsh-adapter/backend/translate.js +21 -4
  105. package/lib/types/dsh-adapter/channel/attached-context.d.ts +15 -2
  106. package/lib/types/dsh-adapter/channel/attached-context.d.ts.map +1 -1
  107. package/lib/types/dsh-adapter/channel/attached-context.js +26 -3
  108. package/lib/types/dsh-adapter/channel/binding-events.d.ts +3 -0
  109. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
  110. package/lib/types/dsh-adapter/channel/binding-events.js +43 -2
  111. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +2 -6
  112. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
  113. package/lib/types/dsh-adapter/channel/context-bookkeeping.js +7 -1
  114. package/lib/types/dsh-adapter/channel/core/compose.d.ts +2 -6
  115. package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
  116. package/lib/types/dsh-adapter/channel/core/compose.js +1 -1
  117. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
  118. package/lib/types/dsh-adapter/channel/core/local-actions.js +3 -26
  119. package/lib/types/dsh-adapter/channel/emitter.js +1 -1
  120. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  121. package/lib/types/dsh-adapter/channel/extensions.js +15 -4
  122. package/lib/types/dsh-adapter/channel/input-actions.d.ts +2 -2
  123. package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
  124. package/lib/types/dsh-adapter/channel/input-actions.js +34 -10
  125. package/lib/types/dsh-adapter/channel/input-delivery.d.ts +3 -7
  126. package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
  127. package/lib/types/dsh-adapter/channel/input-delivery.js +14 -5
  128. package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
  129. package/lib/types/dsh-adapter/channel/local-actions.js +7 -3
  130. package/lib/types/dsh-adapter/channel/model-actions.d.ts +4 -1
  131. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
  132. package/lib/types/dsh-adapter/channel/model-actions.js +26 -9
  133. package/lib/types/dsh-adapter/channel/model-selection.d.ts +27 -2
  134. package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
  135. package/lib/types/dsh-adapter/channel/model-selection.js +81 -37
  136. package/lib/types/dsh-adapter/channel/model-switch.d.ts +1 -1
  137. package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
  138. package/lib/types/dsh-adapter/channel/projection-helpers.d.ts.map +1 -1
  139. package/lib/types/dsh-adapter/channel/projection-helpers.js +4 -2
  140. package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
  141. package/lib/types/dsh-adapter/channel/session-rewind.js +6 -2
  142. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
  143. package/lib/types/dsh-adapter/channel/session-tree-actions.js +8 -4
  144. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  145. package/lib/types/dsh-adapter/channel/settings-host.js +185 -36
  146. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +55 -4
  147. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
  148. package/lib/types/dsh-adapter/channel/subagent-projection.js +80 -16
  149. package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts +1 -1
  150. package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts.map +1 -1
  151. package/lib/types/dsh-adapter/channel/subagent-transcript.js +6 -5
  152. package/lib/types/dsh-adapter/channel/task-completion.js +2 -10
  153. package/lib/types/dsh-adapter/channel/transcript.d.ts +3 -2
  154. package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
  155. package/lib/types/dsh-adapter/channel/transcript.js +13 -4
  156. package/lib/types/dsh-adapter/channel/types.d.ts +11 -2
  157. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
  158. package/lib/types/dsh-adapter/compat/compaction-previews.d.ts +11 -0
  159. package/lib/types/dsh-adapter/compat/compaction-previews.d.ts.map +1 -0
  160. package/lib/types/dsh-adapter/compat/compaction-previews.js +38 -0
  161. package/lib/types/dsh-adapter/compat/messages.d.ts +1 -1
  162. package/lib/types/dsh-adapter/compat/messages.d.ts.map +1 -1
  163. package/lib/types/dsh-adapter/compat/messages.js +2 -2
  164. package/lib/types/dsh-adapter/contract.d.ts +29 -3
  165. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  166. package/lib/types/dsh-adapter/contract.js +48 -5
  167. package/lib/types/dsh-adapter/experimental-bundles.d.ts +5 -0
  168. package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -1
  169. package/lib/types/dsh-adapter/experimental-bundles.js +0 -2
  170. package/lib/types/dsh-adapter/fresh-agent.d.ts +1 -1
  171. package/lib/types/dsh-adapter/fresh-agent.d.ts.map +1 -1
  172. package/lib/types/dsh-adapter/fresh-agent.js +60 -11
  173. package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
  174. package/lib/types/dsh-adapter/host-access.js +60 -11
  175. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  176. package/lib/types/dsh-adapter/host-contract.d.ts.map +1 -1
  177. package/lib/types/dsh-adapter/host-contract.js +5 -3
  178. package/lib/types/dsh-adapter/host-dsh.d.ts +2 -8
  179. package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
  180. package/lib/types/dsh-adapter/host-dsh.js +30 -6
  181. package/lib/types/dsh-adapter/host-entry.js +4 -0
  182. package/lib/types/dsh-adapter/index.d.ts +9 -1
  183. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  184. package/lib/types/dsh-adapter/index.js +5 -0
  185. package/lib/types/dsh-adapter/oauth/account-notifications.d.ts +73 -0
  186. package/lib/types/dsh-adapter/oauth/account-notifications.d.ts.map +1 -0
  187. package/lib/types/dsh-adapter/oauth/account-notifications.js +250 -0
  188. package/lib/types/dsh-adapter/oauth/bonus.d.ts +34 -9
  189. package/lib/types/dsh-adapter/oauth/bonus.d.ts.map +1 -1
  190. package/lib/types/dsh-adapter/oauth/bonus.js +47 -5
  191. package/lib/types/dsh-adapter/oauth/deepseek.d.ts +7 -2
  192. package/lib/types/dsh-adapter/oauth/deepseek.d.ts.map +1 -1
  193. package/lib/types/dsh-adapter/oauth/deepseek.js +6 -1
  194. package/lib/types/dsh-adapter/oauth/index.d.ts.map +1 -1
  195. package/lib/types/dsh-adapter/oauth/index.js +44 -0
  196. package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -1
  197. package/lib/types/dsh-adapter/oauth/profiles.js +14 -1
  198. package/lib/types/dsh-adapter/oauth/service.d.ts.map +1 -1
  199. package/lib/types/dsh-adapter/oauth/service.js +5 -6
  200. package/lib/types/dsh-adapter/plugin-manage.d.ts +6 -4
  201. package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
  202. package/lib/types/dsh-adapter/plugin-manage.js +3 -2
  203. package/lib/types/dsh-adapter/plugin.d.ts +237 -6
  204. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  205. package/lib/types/dsh-adapter/plugin.js +751 -67
  206. package/lib/types/dsh-adapter/presets.d.ts +38 -11
  207. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  208. package/lib/types/dsh-adapter/presets.js +46 -17
  209. package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
  210. package/lib/types/dsh-adapter/process-exit.js +1 -1
  211. package/lib/types/dsh-adapter/questions.d.ts +3 -4
  212. package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
  213. package/lib/types/dsh-adapter/questions.js +1 -1
  214. package/lib/types/dsh-adapter/session-list-metadata.js +2 -2
  215. package/lib/types/dsh-adapter/session-projection-store.d.ts +1 -1
  216. package/lib/types/dsh-adapter/session-projection-store.d.ts.map +1 -1
  217. package/lib/types/dsh-adapter/session-projection-store.js +30 -23
  218. package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -1
  219. package/lib/types/dsh-adapter/sessionTree.js +4 -1
  220. package/lib/types/dsh-adapter/subagents.d.ts +6 -0
  221. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  222. package/lib/types/dsh-adapter/subagents.js +32 -3
  223. package/lib/types/dsh-adapter/team-mode.d.ts +46 -27
  224. package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
  225. package/lib/types/dsh-adapter/team-mode.js +157 -29
  226. package/lib/types/dsh-adapter/team-roster.d.ts +53 -18
  227. package/lib/types/dsh-adapter/team-roster.d.ts.map +1 -1
  228. package/lib/types/dsh-adapter/team-roster.js +206 -39
  229. package/lib/types/dsh-adapter/team-tools.d.ts +25 -12
  230. package/lib/types/dsh-adapter/team-tools.d.ts.map +1 -1
  231. package/lib/types/dsh-adapter/team-tools.js +81 -26
  232. package/lib/types/dsh-adapter/tool-scope.d.ts +24 -0
  233. package/lib/types/dsh-adapter/tool-scope.d.ts.map +1 -0
  234. package/lib/types/dsh-adapter/tool-scope.js +127 -0
  235. package/lib/types/dsh-adapter/types.d.ts +2 -1
  236. package/lib/types/dsh-adapter/types.d.ts.map +1 -1
  237. package/lib/types/heldInputs.d.ts +55 -16
  238. package/lib/types/heldInputs.d.ts.map +1 -1
  239. package/lib/types/heldInputs.js +277 -41
  240. package/lib/types/i18n.d.ts +292 -20
  241. package/lib/types/i18n.d.ts.map +1 -1
  242. package/lib/types/i18n.js +89 -13
  243. package/lib/types/ink/components/App.d.ts +2 -0
  244. package/lib/types/ink/components/App.d.ts.map +1 -1
  245. package/lib/types/ink/components/App.js +8 -0
  246. package/lib/types/ink/dom.d.ts.map +1 -1
  247. package/lib/types/ink/dom.js +13 -3
  248. package/lib/types/ink/events/input-event.d.ts.map +1 -1
  249. package/lib/types/ink/events/input-event.js +7 -6
  250. package/lib/types/ink/flush-tick.d.ts +6 -0
  251. package/lib/types/ink/flush-tick.d.ts.map +1 -1
  252. package/lib/types/ink/flush-tick.js +31 -0
  253. package/lib/types/ink/hit-test.d.ts +2 -0
  254. package/lib/types/ink/hit-test.d.ts.map +1 -1
  255. package/lib/types/ink/hit-test.js +10 -0
  256. package/lib/types/ink/hooks/use-program-status.d.ts +1 -1
  257. package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -1
  258. package/lib/types/ink/hooks/use-program-status.js +3 -2
  259. package/lib/types/ink/hooks/use-terminal-title.d.ts +15 -0
  260. package/lib/types/ink/hooks/use-terminal-title.d.ts.map +1 -1
  261. package/lib/types/ink/hooks/use-terminal-title.js +23 -3
  262. package/lib/types/ink/ink.d.ts +1 -0
  263. package/lib/types/ink/ink.d.ts.map +1 -1
  264. package/lib/types/ink/ink.js +7 -4
  265. package/lib/types/ink/jumpback-state.d.ts +33 -0
  266. package/lib/types/ink/jumpback-state.d.ts.map +1 -0
  267. package/lib/types/ink/jumpback-state.js +51 -0
  268. package/lib/types/ink/jumpback.d.ts +78 -0
  269. package/lib/types/ink/jumpback.d.ts.map +1 -0
  270. package/lib/types/ink/jumpback.js +515 -0
  271. package/lib/types/ink/log-update.js +37 -14
  272. package/lib/types/ink/notify-helper/activate.cs +836 -0
  273. package/lib/types/ink/notify-helper/compile.d.ts +30 -0
  274. package/lib/types/ink/notify-helper/compile.d.ts.map +1 -0
  275. package/lib/types/ink/notify-helper/compile.js +235 -0
  276. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  277. package/lib/types/ink/parse-keypress.js +25 -0
  278. package/lib/types/ink/terminal-notification-windows.d.ts +8 -4
  279. package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -1
  280. package/lib/types/ink/terminal-notification-windows.js +14 -21
  281. package/lib/types/ink/terminal-notification.d.ts +31 -2
  282. package/lib/types/ink/terminal-notification.d.ts.map +1 -1
  283. package/lib/types/ink/terminal-notification.js +51 -0
  284. package/lib/types/ink/terminal.d.ts +15 -3
  285. package/lib/types/ink/terminal.d.ts.map +1 -1
  286. package/lib/types/ink/terminal.js +38 -9
  287. package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
  288. package/lib/types/screens/AgentTranscriptScene.js +1 -1
  289. package/lib/types/screens/Chat.d.ts +4 -3
  290. package/lib/types/screens/Chat.d.ts.map +1 -1
  291. package/lib/types/screens/Chat.js +81 -11
  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.d.ts +12 -0
  304. package/lib/types/settings/definitions.d.ts.map +1 -1
  305. package/lib/types/settings/definitions.js +15 -7
  306. package/lib/types/update.d.ts +412 -20
  307. package/lib/types/update.d.ts.map +1 -1
  308. package/lib/types/update.js +2094 -193
  309. package/lib/types/updateHost.d.ts +198 -0
  310. package/lib/types/updateHost.d.ts.map +1 -0
  311. package/lib/types/updateHost.js +608 -0
  312. package/lib/types/utils/processName.d.ts +16 -0
  313. package/lib/types/utils/processName.d.ts.map +1 -0
  314. package/lib/types/utils/processName.js +27 -0
  315. package/package.json +114 -111
  316. package/presets/liangshen/agent.cordis.yml +4 -0
  317. package/tui-profile/feed/README.md +1 -1
  318. package/tui-profile/feed/first-party.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/transcript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EA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,CAqDR;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,YAAY,EAAE,EAAE,KAAK,CAAC,EAAE,iBAAiB,GAAG,MAAM,CA8C5G;AAED,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CA+B3E;AAED,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,CAAC,aAAa,CAAC,GAAG,MAAM,CAEzE;AAED,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAKpD,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,GACxC,cAAc,GAAG,SAAS,CA4C5B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,CAAC,aAAa,CAAC,GAAG,MAAM,CAIxE;AAED;;;;;sBAKsB;AACtB,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAWxE;AAED,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,CAAC,aAAa,CAAC,GAAG,IAAI,CAUxF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,YAAY,EAAE,CA2BnF"}
@@ -1,10 +1,10 @@
1
1
  import { toolResultPayload } from '../compat/messages.js';
2
2
  import { t } from '../../i18n.js';
3
3
  import { markChannelReadDirty } from '../../adapter/channel/read-view.js';
4
- import { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, RESULT_PREVIEW_LIMIT } from '../../channel/transcript.js';
4
+ import { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, previewIndented, RESULT_PREVIEW_LIMIT, trimLocalRows } from '../../channel/transcript.js';
5
5
  // Limits and the preview helper are backend-neutral (src/channel/transcript.ts);
6
6
  // re-exported here for the existing importers.
7
- export { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, RESULT_PREVIEW_LIMIT };
7
+ export { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, previewIndented, RESULT_PREVIEW_LIMIT, trimLocalRows };
8
8
  /**
9
9
  * Fold the oldest rows beyond the transcript window cap: drop each row's
10
10
  * full-text fields (assistant/reasoning text, tool args/results) and keep
@@ -32,7 +32,14 @@ restorable) {
32
32
  // there was the O(rows) per-frame term of long-session streaming. Rows
33
33
  // prepended ahead of the window (older history) shift every index: a new
34
34
  // head restarts the pass.
35
- const from = cursor === undefined ? 0 : cursor.rows === rows && cursor.head === rows[0] ? cursor.index : 0;
35
+ let from = cursor === undefined ? 0 : cursor.rows === rows && cursor.head === rows[0] ? cursor.index : 0;
36
+ // A local-block splice can move rows under the cursor with or without
37
+ // changing the array length, so the old boundary row is the witness: if it
38
+ // moved, rescan from the head — otherwise the shifted rows stay unfolded
39
+ // forever. A quiet streaming frame keeps the same boundary and stays
40
+ // incremental. This must run for every shift, not only the shrunken ones.
41
+ if (cursor !== undefined && from > 0 && rows[from - 1] !== cursor.boundary)
42
+ from = 0;
36
43
  if (cursor !== undefined) {
37
44
  cursor.rows = rows;
38
45
  cursor.head = rows[0];
@@ -66,8 +73,10 @@ restorable) {
66
73
  markChannelReadDirty(row);
67
74
  markChannelReadDirty(rows);
68
75
  }
69
- if (cursor !== undefined)
76
+ if (cursor !== undefined) {
70
77
  cursor.index = excess;
78
+ cursor.boundary = rows[excess - 1];
79
+ }
71
80
  return folded;
72
81
  }
73
82
  /**
@@ -1,6 +1,6 @@
1
1
  import type { ChannelUi } from '../../adapter/ports/channel-ui.js';
2
- import type { RawTrajEvent, ChatRow, ToolCallView, ToolResultView, NotificationItem, TodoPanelItem, PendingMessage, StagedImageAdjustment, TrajectorySource } from '../../adapter/ports/channel-view.js';
3
- export type { ChatRow, ToolRow, ToolCallView, ToolFileDiff, ToolResultView, SubagentRow, JobGroupRow, JobRow, TokenUsage, TokenBucket, CostTokenBuckets, SessionCostByModel, SubagentCostEntry, NotificationItem, ChannelGoal, TodoPanelItem, LoadedContext, LoadedContextEntry, LoadedContextFile, LoadedContextSkill, LoadedContextTool, PendingMessage, SubagentControl, SubagentTranscriptView, JobControl, StagedImageInput, StagedImageAdjustment, StagedImageHandle, ComposerImageRef, ComposerSubmission, ExternalCommandOutcome, TranscriptImage, ResumeResult, EffortOption, PermissionPresetSnapshot, PermissionPresetAvailability, PermissionPresetOption, PermissionPresetCurrent, PresetOption, SkillInfo, CredentialStatus, AgentViewRow, AgentViewStatus, AgentViewDispatchResult, BackgroundResult, BackendModeOption, BackendChannelOption, TrajectorySource } from '../../adapter/ports/channel-view.js';
2
+ import type { AttachedContext, RawTrajEvent, ChatRow, ToolCallView, ToolResultView, NotificationItem, TodoPanelItem, PendingMessage, StagedImageAdjustment, ComposerImageRef, TrajectorySource } from '../../adapter/ports/channel-view.js';
3
+ export type { AttachedContext, ChatRow, ToolRow, ToolCallView, ToolFileDiff, ToolResultView, SubagentRow, JobGroupRow, JobRow, TokenUsage, TokenBucket, CostTokenBuckets, SessionCostByModel, SubagentCostEntry, NotificationItem, ChannelGoal, TodoPanelItem, LoadedContext, LoadedContextEntry, LoadedContextFile, LoadedContextSkill, LoadedContextTool, PendingMessage, SubagentControl, SubagentTranscriptView, JobControl, StagedImageInput, StagedImageAdjustment, StagedImageHandle, ComposerImageRef, ComposerSubmission, ExternalCommandOutcome, TranscriptImage, ResumeResult, EffortOption, PermissionPresetSnapshot, PermissionPresetAvailability, PermissionPresetOption, PermissionPresetCurrent, PresetOption, SkillInfo, CredentialStatus, AgentViewRow, AgentViewStatus, AgentViewDispatchResult, BackgroundResult, BackendModeOption, BackendChannelOption, TrajectorySource } from '../../adapter/ports/channel-view.js';
4
4
  import { type ContentBlock, type StreamChunk } from '@deepseek-ai/dsh-llm';
5
5
  import { type SessionEvent } from '@deepseek-ai/dsh-session';
6
6
  import { type BackgroundJobState } from '../jobs.js';
@@ -114,6 +114,15 @@ export type FileSuggestionFs = {
114
114
  };
115
115
  }>>;
116
116
  };
117
+ /** One pending-row snapshot handed to `trackPending` before a submit: the
118
+ * dock re-sends it later, so everything the message needs to be rebuilt
119
+ * (`contexts` included) travels with it. */
120
+ export interface PendingTrackInput {
121
+ readonly id: string;
122
+ readonly text: string;
123
+ readonly images?: readonly ComposerImageRef[];
124
+ readonly contexts?: readonly AttachedContext[];
125
+ }
117
126
  /** The fs-service surface `@`-mention expansion consumes (dsh-fs-local). */
118
127
  export interface MentionFs {
119
128
  resolve(path: string): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAW,YAAY,EAAgB,cAAc,EAAsH,gBAAgB,EAAe,aAAa,EAA+F,cAAc,EAAyE,qBAAqB,EAAuY,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AACz4B,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE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E,MAAM,CAAA;KAAE,EAAE,CAAA;CACnD"}
@@ -0,0 +1,11 @@
1
+ /** Match a partial checkpoint to its durable summary, never to framing prose. */
2
+ import type { SessionEvent } from '@deepseek-ai/dsh-session';
3
+ export declare class CompactionPreviews {
4
+ private readonly summaries;
5
+ observe(event: SessionEvent): void;
6
+ take(source: {
7
+ kind: string;
8
+ }): string | undefined;
9
+ clear(): void;
10
+ }
11
+ //# sourceMappingURL=compaction-previews.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compaction-previews.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/compat/compaction-previews.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA4B;IAEtD,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAkBlC,IAAI,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,GAAG,SAAS;IASlD,KAAK,IAAI,IAAI;CAGd"}
@@ -0,0 +1,38 @@
1
+ export class CompactionPreviews {
2
+ summaries = new Map();
3
+ observe(event) {
4
+ const type = event.type;
5
+ if (type !== 'compaction/summary' && type !== 'compaction/end')
6
+ return;
7
+ const data = event.data;
8
+ if (typeof data.compactionId !== 'string')
9
+ return;
10
+ if (type === 'compaction/end') {
11
+ this.summaries.delete(data.compactionId);
12
+ return;
13
+ }
14
+ if (!Array.isArray(data.summary))
15
+ return;
16
+ const text = data.summary.flatMap((block) => {
17
+ if (block === null || typeof block !== 'object')
18
+ return [];
19
+ const item = block;
20
+ return item.type === 'text' && typeof item.text === 'string' ? [item.text] : [];
21
+ }).join('\n').trim();
22
+ if (text)
23
+ this.summaries.set(data.compactionId, text);
24
+ }
25
+ take(source) {
26
+ if (source.kind !== 'spine-checkpoint')
27
+ return undefined;
28
+ const id = source.compactionId;
29
+ if (typeof id !== 'string')
30
+ return undefined;
31
+ const text = this.summaries.get(id);
32
+ this.summaries.delete(id);
33
+ return text;
34
+ }
35
+ clear() {
36
+ this.summaries.clear();
37
+ }
38
+ }
@@ -13,7 +13,7 @@ export declare function answeredToolCallIds(message: {
13
13
  readonly toolCallId?: string;
14
14
  readonly content: readonly ContentBlock[];
15
15
  }): string[];
16
- /** Preserve old checkpoints while recognizing the V4 producer-owned source. */
16
+ /** Full and partial checkpoints share transcript cards, not replacement scope. */
17
17
  export declare function isCompactionCheckpointSource(source: {
18
18
  kind: string;
19
19
  plugin?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/compat/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,OAAO,EAAE;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAA;IAC1C,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAC3B,GAAG,SAAS,GAAG;IAAE,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAarE;AAED,2FAA2F;AAC3F,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;CAC1C,GAAG,MAAM,EAAE,CAMX;AAED,+EAA+E;AAC/E,wBAAgB,4BAA4B,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAE/F"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/compat/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,OAAO,EAAE;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAA;IAC1C,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAC3B,GAAG,SAAS,GAAG;IAAE,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAarE;AAED,2FAA2F;AAC3F,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;CAC1C,GAAG,MAAM,EAAE,CAMX;AAED,kFAAkF;AAClF,wBAAgB,4BAA4B,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAE/F"}
@@ -18,7 +18,7 @@ export function answeredToolCallIds(message) {
18
18
  }
19
19
  return ids;
20
20
  }
21
- /** Preserve old checkpoints while recognizing the V4 producer-owned source. */
21
+ /** Full and partial checkpoints share transcript cards, not replacement scope. */
22
22
  export function isCompactionCheckpointSource(source) {
23
- return source.kind === 'compact-checkpoint' || (source.kind === 'plugin' && source.plugin === 'compact');
23
+ return source.kind === 'spine-checkpoint' || source.kind === 'compact-checkpoint' || (source.kind === 'plugin' && source.plugin === 'compact');
24
24
  }
@@ -1,9 +1,26 @@
1
1
  /** Primary validated upstream line (newest). */
2
- export declare const UPSTREAM_VALIDATED_VERSION = "0.2.1-rc.5";
2
+ export declare const UPSTREAM_VALIDATED_VERSION = "0.2.2-rc.2";
3
+ /**
4
+ * The host CLI package whose installation `/update` aligns with the TUI.
5
+ * Re-exported here (the literal stays in host-contract.ts) so engine planning
6
+ * can name it without importing the host-only module.
7
+ */
8
+ export declare const UPSTREAM_HOST_PACKAGE = "@deepseek-ai/dsh";
9
+ /**
10
+ * The host-side peer whose enumerated range defines the engine line a TUI
11
+ * release validates (`@deepseek-ai/dsh-app-boot`, lockstep with the CLI).
12
+ * Derived from the host contract: the literal lives only in host-contract.ts.
13
+ */
14
+ export declare const UPSTREAM_HOST_PEER_PACKAGE: "@deepseek-ai/dsh-app-boot";
3
15
  /**
4
16
  * Explicitly supported upstream prerelease lines, oldest first.
5
17
  *
6
- * 0.2.1-rc.5 = primary continuous-CI line; 0.2.1-rc.4/rc.3/rc.2 = earlier
18
+ * 0.2.2-rc.2 = primary continuous-CI line (AgentTeam moved into dsh-base
19
+ * with a per-session switch and named subagents, account notifications
20
+ * replaced the bonus API, DeepSeek Search/Fetch split their settings);
21
+ * 0.2.2-rc.1 = previous 0.2.2 prerelease (the model-selection projection,
22
+ * Agent.model seam and PromptPresentation split land there); 0.2.1-rc.5 =
23
+ * previous family still source-checked where CI covers it; 0.2.1-rc.4/rc.3/rc.2 = earlier
7
24
  * prereleases of the same family (published code compared with the primary);
8
25
  * 0.2.0-rc.2/rc.1 = previous family (mapped compatibility);
9
26
  * 0.1.7-rc.2/rc.1 = previous family (mapped compatibility);
@@ -19,7 +36,7 @@ export declare const UPSTREAM_VALIDATED_VERSION = "0.2.1-rc.5";
19
36
  * The peer range in package.json is deliberately wider than this list: an
20
37
  * install on an older or newer line is allowed but reports drift at boot.
21
38
  */
22
- export declare const UPSTREAM_VALIDATED_VERSIONS: readonly ["0.1.0-rc.6", "0.1.0-rc.7", "0.1.0-rc.8", "0.1.1-rc.1", "0.1.1-rc.2", "0.1.2-alpha.3", "0.1.2-alpha.4", "0.1.2-alpha.5", "0.1.2-rc.1", "0.1.3-alpha.2", "0.1.5-alpha.1", "0.1.5-alpha.2", "0.1.5-rc.1", "0.1.7-rc.1", "0.1.7-rc.2", "0.2.0-rc.1", "0.2.0-rc.2", "0.2.1-rc.2", "0.2.1-rc.3", "0.2.1-rc.4", "0.2.1-rc.5"];
39
+ export declare const UPSTREAM_VALIDATED_VERSIONS: readonly ["0.1.0-rc.6", "0.1.0-rc.7", "0.1.0-rc.8", "0.1.1-rc.1", "0.1.1-rc.2", "0.1.2-alpha.3", "0.1.2-alpha.4", "0.1.2-alpha.5", "0.1.2-rc.1", "0.1.3-alpha.2", "0.1.5-alpha.1", "0.1.5-alpha.2", "0.1.5-rc.1", "0.1.7-rc.1", "0.1.7-rc.2", "0.2.0-rc.1", "0.2.0-rc.2", "0.2.1-rc.2", "0.2.1-rc.3", "0.2.1-rc.4", "0.2.1-rc.5", "0.2.2-rc.1", "0.2.2-rc.2"];
23
40
  /**
24
41
  * Framework packages version on their own lines; the contract validates
25
42
  * their MAJOR (breaking surface), not the harness prerelease number.
@@ -65,6 +82,15 @@ export declare function installedUpstreamVersion(packageName: string): UpstreamV
65
82
  * 两级都读不到 → undefined(调用方只画 TUI 版本,不编造)。
66
83
  */
67
84
  export declare function installedKernelVersion(): string | undefined;
85
+ /**
86
+ * 已装宿主(`@deepseek-ai/dsh`)包的真实目录;源码 checkout(宿主不是本包
87
+ * 依赖)下为 undefined。
88
+ *
89
+ * `/update` 用它定位「这次该往哪个全局前缀里装引擎」:profile 副本的
90
+ * `node_modules/@deepseek-ai/dsh` 是指向全局安装的模块回退链接,realpath 后
91
+ * 就是布局判定的输入(`src/updateHost.ts` 的 `detectHostInstall`)。
92
+ */
93
+ export declare function installedKernelPackageDir(): string | undefined;
68
94
  /**
69
95
  * Whether the installed version of `packageName` is at or beyond `minimum`
70
96
  * (a literal like `'0.1.0-rc.8'`). Unparseable or older installs return
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/contract.ts"],"names":[],"mappings":"AAmBA,gDAAgD;AAChD,eAAO,MAAM,0BAA0B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AM,GAAG,SAAS,CAAC,CAA+B,GAC5F,kBAAkB,EAAE,CAuBtB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEtE,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,iBAAiB,CAAA;IACvB,sFAAsF;IACtF,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,iBAAiB,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAA+B,GAC5F,oBAAoB,GAAG,SAAS,CA0BlC"}
@@ -2,7 +2,7 @@
2
2
  * Upstream compatibility contract.
3
3
  *
4
4
  * The TUI is validated against a set of upstream prerelease lines — the
5
- * current primary (0.2.1-rc.5) plus older lines kept in backward
5
+ * current primary (0.2.2-rc.2) plus older lines kept in backward
6
6
  * compatibility across the 0.2.0, 0.1.7, 0.1.5, 0.1.3, 0.1.2, 0.1.1 and 0.1.0
7
7
  * release families.
8
8
  * Every official package this adapter touches is blessed here; anything
@@ -13,15 +13,40 @@
13
13
  * `upstreamDriftSummary()` collapses the per-package entries into the
14
14
  * single natural-language boot notice the logo header shows (see LogoV2).
15
15
  */
16
- import { readFileSync } from 'node:fs';
16
+ import { readFileSync, realpathSync } from 'node:fs';
17
+ import { dirname } from 'node:path';
17
18
  import { fileURLToPath } from 'node:url';
18
- import { ADAPTER_TYPE_PACKAGES, HOST_TYPE_PACKAGES } from './host-contract.js';
19
+ import { ADAPTER_TYPE_PACKAGES, HOST_MODULES, HOST_PACKAGE, HOST_TYPE_PACKAGES } from './host-contract.js';
19
20
  /** Primary validated upstream line (newest). */
20
- export const UPSTREAM_VALIDATED_VERSION = '0.2.1-rc.5';
21
+ export const UPSTREAM_VALIDATED_VERSION = '0.2.2-rc.2';
22
+ /**
23
+ * The host CLI package whose installation `/update` aligns with the TUI.
24
+ * Re-exported here (the literal stays in host-contract.ts) so engine planning
25
+ * can name it without importing the host-only module.
26
+ */
27
+ export const UPSTREAM_HOST_PACKAGE = HOST_PACKAGE;
28
+ const APP_BOOT_MODULE = HOST_MODULES.find(module => module.key === 'appBoot');
29
+ if (APP_BOOT_MODULE === undefined) {
30
+ // A broken host contract is a build-time fault, not a runtime state: the
31
+ // gate (verify:contract) fails on the same edit. Name it instead of letting
32
+ // a bare TypeError crash every boot.
33
+ throw new Error('host contract: HOST_MODULES has no appBoot entry (run pnpm verify:contract)');
34
+ }
35
+ /**
36
+ * The host-side peer whose enumerated range defines the engine line a TUI
37
+ * release validates (`@deepseek-ai/dsh-app-boot`, lockstep with the CLI).
38
+ * Derived from the host contract: the literal lives only in host-contract.ts.
39
+ */
40
+ export const UPSTREAM_HOST_PEER_PACKAGE = APP_BOOT_MODULE.specifier;
21
41
  /**
22
42
  * Explicitly supported upstream prerelease lines, oldest first.
23
43
  *
24
- * 0.2.1-rc.5 = primary continuous-CI line; 0.2.1-rc.4/rc.3/rc.2 = earlier
44
+ * 0.2.2-rc.2 = primary continuous-CI line (AgentTeam moved into dsh-base
45
+ * with a per-session switch and named subagents, account notifications
46
+ * replaced the bonus API, DeepSeek Search/Fetch split their settings);
47
+ * 0.2.2-rc.1 = previous 0.2.2 prerelease (the model-selection projection,
48
+ * Agent.model seam and PromptPresentation split land there); 0.2.1-rc.5 =
49
+ * previous family still source-checked where CI covers it; 0.2.1-rc.4/rc.3/rc.2 = earlier
25
50
  * prereleases of the same family (published code compared with the primary);
26
51
  * 0.2.0-rc.2/rc.1 = previous family (mapped compatibility);
27
52
  * 0.1.7-rc.2/rc.1 = previous family (mapped compatibility);
@@ -59,6 +84,8 @@ export const UPSTREAM_VALIDATED_VERSIONS = [
59
84
  '0.2.1-rc.3',
60
85
  '0.2.1-rc.4',
61
86
  '0.2.1-rc.5',
87
+ '0.2.2-rc.1',
88
+ '0.2.2-rc.2',
62
89
  ];
63
90
  /**
64
91
  * Framework packages version on their own lines; the contract validates
@@ -230,6 +257,22 @@ export function installedKernelVersion() {
230
257
  }
231
258
  return installedUpstreamVersions()['@deepseek-ai/dsh-agent'];
232
259
  }
260
+ /**
261
+ * 已装宿主(`@deepseek-ai/dsh`)包的真实目录;源码 checkout(宿主不是本包
262
+ * 依赖)下为 undefined。
263
+ *
264
+ * `/update` 用它定位「这次该往哪个全局前缀里装引擎」:profile 副本的
265
+ * `node_modules/@deepseek-ai/dsh` 是指向全局安装的模块回退链接,realpath 后
266
+ * 就是布局判定的输入(`src/updateHost.ts` 的 `detectHostInstall`)。
267
+ */
268
+ export function installedKernelPackageDir() {
269
+ try {
270
+ return realpathSync(dirname(fileURLToPath(import.meta.resolve('@deepseek-ai/dsh/package.json'))));
271
+ }
272
+ catch {
273
+ return undefined;
274
+ }
275
+ }
233
276
  /**
234
277
  * Whether the installed version of `packageName` is at or beyond `minimum`
235
278
  * (a literal like `'0.1.0-rc.8'`). Unparseable or older installs return
@@ -8,6 +8,11 @@
8
8
  * intersects this list with what the running installation supplies, so an
9
9
  * older dsh simply shows nothing.
10
10
  *
11
+ * Agent Teams is deliberately absent: `0.2.2-rc.2` moved it into `dsh-base`
12
+ * as a per-session selection (`/team on|off`), so there is no bundle to
13
+ * advertise or install. A bundle host (`0.2.2-rc.1` and earlier) still ships
14
+ * the retired profile package, but the TUI no longer sells it.
15
+ *
11
16
  * @module
12
17
  */
13
18
  import type { I18nKey } from '../i18n.js';
@@ -1 +1 @@
1
- {"version":3,"file":"experimental-bundles.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/experimental-bundles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAGzC,2DAA2D;AAC3D,eAAO,MAAM,kBAAkB,8CAA8C,CAAA;AAE7E,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,iDAAiD,CAAA;AAEnF;4EAC4E;AAC5E,eAAO,MAAM,eAAe,gDAAgD,CAAA;AAE5E,uEAAuE;AACvE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CACvB;AAED,gEAAgE;AAChE,eAAO,MAAM,wBAAwB,EAAE,SAAS,qBAAqB,EAKpE,CAAA"}
1
+ {"version":3,"file":"experimental-bundles.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/experimental-bundles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,2DAA2D;AAC3D,eAAO,MAAM,kBAAkB,8CAA8C,CAAA;AAE7E,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,iDAAiD,CAAA;AAEnF;4EAC4E;AAC5E,eAAO,MAAM,eAAe,gDAAgD,CAAA;AAE5E,uEAAuE;AACvE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CACvB;AAED,gEAAgE;AAChE,eAAO,MAAM,wBAAwB,EAAE,SAAS,qBAAqB,EAIpE,CAAA"}
@@ -1,4 +1,3 @@
1
- import { TEAM_BUNDLE } from './team-roster.js';
2
1
  /** The bundle that mounts the `auto` permission preset. */
3
2
  export const AUTO_REVIEW_BUNDLE = '@deepseek-ai/dsh-experimental-auto-review';
4
3
  /** The bundle that mounts the five read-only session-search tools. */
@@ -8,7 +7,6 @@ export const SESSION_SEARCH_BUNDLE = '@deepseek-ai/dsh-experimental-session-sear
8
7
  export const WORKTREE_BUNDLE = '@deepseek-ai/dsh-experimental-tool-worktree';
9
8
  /** The features `/plugin list` advertises, in product order. */
10
9
  export const TUI_EXPERIMENTAL_BUNDLES = [
11
- { name: TEAM_BUNDLE, hint: 'plugins-experimental-team-hint' },
12
10
  { name: AUTO_REVIEW_BUNDLE, hint: 'plugins-experimental-auto-review-hint' },
13
11
  { name: SESSION_SEARCH_BUNDLE, hint: 'plugins-experimental-session-search-hint' },
14
12
  { name: WORKTREE_BUNDLE, hint: 'plugins-experimental-worktree-hint' },
@@ -4,7 +4,7 @@ import type { Session, SessionEvent } from '@deepseek-ai/dsh-session';
4
4
  type AgentCreator = {
5
5
  create(options: CreateAgentOptions): Promise<AgentHandle>;
6
6
  };
7
- /** Policy facts held in memory until the session has further activity. */
7
+ /** Policy and model-route facts held until the session has further activity. */
8
8
  export declare const INITIAL_POLICY_EVENTS: ReadonlySet<string>;
9
9
  /** Source-less legacy messages and explicit user messages count as human input. */
10
10
  export declare function isHumanSource(source: unknown): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"fresh-agent.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/fresh-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAc,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AACzF,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAiB,MAAM,0BAA0B,CAAA;AAkBpF,KAAK,YAAY,GAAG;IAAE,MAAM,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;CAAE,CAAA;AAyCjF,0EAA0E;AAC1E,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,MAAM,CAAkF,CAAA;AAKxI,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAItD;AAED,8EAA8E;AAC9E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAWlE;AAID,2EAA2E;AAC3E,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAE5E;AA4FD;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAsB5H"}
1
+ {"version":3,"file":"fresh-agent.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/fresh-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAc,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AACzF,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAiB,MAAM,0BAA0B,CAAA;AAkBpF,KAAK,YAAY,GAAG;IAAE,MAAM,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;CAAE,CAAA;AAmFjF,gFAAgF;AAChF,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,MAAM,CAAqG,CAAA;AAK3J,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAItD;AAED,8EAA8E;AAC9E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAWlE;AAID,2EAA2E;AAC3E,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAE5E;AA4FD;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CA8B5H"}
@@ -38,8 +38,44 @@ function captureWriter(source, id, receive) {
38
38
  capture.restore();
39
39
  };
40
40
  }
41
- /** Policy facts held in memory until the session has further activity. */
42
- export const INITIAL_POLICY_EVENTS = new Set(['permission/preset', 'sandbox/mode', 'approval/policy', 'plan/mode']);
41
+ const entryCaptures = new WeakMap();
42
+ /** Install the filter before newer stores snapshot it into their event carrier. */
43
+ function captureSessionEntry(store, id, receive) {
44
+ let capture = entryCaptures.get(store);
45
+ if (capture === undefined) {
46
+ const descriptor = Object.getOwnPropertyDescriptor(store, 'enter');
47
+ const enter = store.enter;
48
+ const receivers = new Map();
49
+ const tapped = function (session) {
50
+ receivers.get(String(session.id))?.(this.ctx, session);
51
+ return enter.call(this, session);
52
+ };
53
+ store.enter = tapped;
54
+ capture = {
55
+ receivers,
56
+ restore() {
57
+ if (store.enter === tapped) {
58
+ if (descriptor === undefined)
59
+ delete store.enter;
60
+ else
61
+ Object.defineProperty(store, 'enter', descriptor);
62
+ }
63
+ entryCaptures.delete(store);
64
+ },
65
+ };
66
+ entryCaptures.set(store, capture);
67
+ }
68
+ if (capture.receivers.has(id))
69
+ throw new Error(`dsh-tui: fresh session "${id}" is already entering the store`);
70
+ capture.receivers.set(id, receive);
71
+ return () => {
72
+ capture.receivers.delete(id);
73
+ if (capture.receivers.size === 0)
74
+ capture.restore();
75
+ };
76
+ }
77
+ /** Policy and model-route facts held until the session has further activity. */
78
+ export const INITIAL_POLICY_EVENTS = new Set(['permission/preset', 'sandbox/mode', 'approval/policy', 'plan/mode', 'model/selection']);
43
79
  /** The command envelope a session-policy switch runs through. */
44
80
  const POLICY_ACTIVITY_EVENTS = new Set(['command/run', 'command/done']);
45
81
  /** Source-less legacy messages and explicit user messages count as human input. */
@@ -202,25 +238,38 @@ export async function createFreshAgent(ctx, agents, options) {
202
238
  return agents.create(options);
203
239
  const source = concreteService(service);
204
240
  let writer;
241
+ let deferred = false;
242
+ const defer = (owner, session) => {
243
+ if (deferred || writer === undefined || session.seq !== 0)
244
+ return;
245
+ deferInitialPolicy(owner, session, writer, source);
246
+ deferred = true;
247
+ };
205
248
  const stopCapture = captureWriter(source, String(options.sessionId), value => { writer = value; });
249
+ let stopEntry = () => { };
206
250
  const setup = async (agentCtx, agent) => {
207
251
  const commit = await options.setup?.(agentCtx, agent);
208
- const defer = () => {
209
- if (writer !== undefined)
210
- deferInitialPolicy(agentCtx, agent.session, writer, source);
211
- };
212
252
  if (commit === undefined) {
213
- defer();
253
+ defer(agentCtx, agent.session);
214
254
  return;
215
255
  }
216
- // Setup history belongs to the factory's pre-publication append. Install
217
- // the gate only after the original commit has finished composing it.
218
- return { commit() { commit.commit(); defer(); } };
256
+ // Older stores do not capture a carrier at entry; retain their original
257
+ // post-commit fallback. New stores already own the gate before setup.
258
+ return { commit() { commit.commit(); defer(agentCtx, agent.session); } };
219
259
  };
220
260
  try {
261
+ const sessions = ctx.get('sessions');
262
+ if (typeof sessions?.enter === 'function') {
263
+ stopEntry = captureSessionEntry(concreteService(sessions), String(options.sessionId), defer);
264
+ }
221
265
  return await agents.create({ ...options, setup });
222
266
  }
223
267
  finally {
224
- stopCapture();
268
+ try {
269
+ stopEntry();
270
+ }
271
+ finally {
272
+ stopCapture();
273
+ }
225
274
  }
226
275
  }
@@ -1 +1 @@
1
- {"version":3,"file":"host-access.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/host-access.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAS,MAAM,qBAAqB,CAAA;AAmLpD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,IAAI,CAKlE;AAWD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAE1D;AAkID;;uEAEuE;AACvE,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAE9D;AAED;;8EAE8E;AAC9E,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAEzD;AAmOD,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAe/D;AAED;0EAC0E;AAC1E,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,OAAO,E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E,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAEzD;AA4QD,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAe/D;AAED;0EAC0E;AAC1E,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,OAAO,EACvB,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,OAAO,KAAK,IAAI,GAC9C,OAAO,CA2BT;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAMhE;AAED;+EAC+E;AAC/E,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAInE;AAED;;;6EAG6E;AAC7E,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAIrD;AAiHD;;;4EAG4E;AAC5E,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAO3E;AAED;;;iEAGiE;AACjE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAehH;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAmBlG"}
@@ -468,9 +468,9 @@ const projectionRegistryRoots = new WeakSet();
468
468
  const guardedProjectionRegistries = new WeakSet();
469
469
  /**
470
470
  * `sessionProjections.register` hangs its disposer on the receiver's context
471
- * (the registry's documented ownership: the calling fiber). DSH's agent-team
472
- * service reaches it through `ctx.root`, which lands that effect on the root
473
- * fiber and the guard above refuses it. Admit that one call with host
471
+ * (the registry's documented ownership: the calling fiber). Legacy DSH's
472
+ * agent-team service reaches it through `ctx.root`, which lands that effect on
473
+ * the root fiber and the guard above refuses it. Admit that one call with host
474
474
  * capability, so the registration sits where it would without the guard and
475
475
  * the caller's disposer releases it in the caller's own order; the plugin's
476
476
  * unload releases one it leaves behind ({@link releaseAfterUnload}). The
@@ -514,8 +514,8 @@ function admitRootProjectionRegistrations(root) {
514
514
  // disposer itself (DSH's TeamService unregisters after its async
515
515
  // runtime teardown, which still reads the key). On the caller's fiber
516
516
  // it would be a sibling effect, and Cordis unloads siblings at once.
517
- const dispose = withHostRootCapability(() => Reflect.apply(original, this, args));
518
- return releaseAfterUnload(root, token.fiber, dispose);
517
+ const registration = withHostRootCapability(() => Reflect.apply(original, this, args));
518
+ return releaseAfterUnload(root, token.fiber, registration);
519
519
  },
520
520
  });
521
521
  });
@@ -536,27 +536,76 @@ function admitRootProjectionRegistrations(root) {
536
536
  * still dies with that plugin: if the plugin never disposes it, it goes once
537
537
  * the plugin's fiber has finished unloading (every effect settled, async
538
538
  * teardown included), whether the fiber reloads or not.
539
- * @returns the disposer handed to the plugin; calling it also drops the watch.
539
+ * Preserve the registration's await result too: old Cordis effects yield an
540
+ * async disposer, while 0.2.2 projections yield a retained reader handle.
541
+ * @returns the callable registration; every disposal face drops the watch.
540
542
  */
541
543
  function releaseAfterUnload(root, fiber, dispose) {
542
544
  let unwatch;
545
+ let released = false;
546
+ let disposal;
543
547
  const release = () => {
544
- unwatch?.();
545
- unwatch = undefined;
546
- dispose();
548
+ if (released)
549
+ return disposal;
550
+ released = true;
551
+ return disposal = withHostRootCapability(() => {
552
+ unwatch?.();
553
+ unwatch = undefined;
554
+ return dispose();
555
+ });
547
556
  };
548
557
  try {
549
558
  unwatch = withHostRootCapability(() => root.on('internal/status', (changed, oldState) => {
550
559
  // Cordis uses 5 for UNLOADING (see rememberFiber). The event carries
551
560
  // either the activation's fiber or the wrapper normalized to it.
552
- if (oldState === 5 && (changed === fiber || rememberFiber(changed, root) === fiber))
561
+ const subject = changed === fiber || rememberFiber(changed, root) === fiber
562
+ ? changed
563
+ : undefined;
564
+ if (subject === undefined)
565
+ return;
566
+ // Up to Cordis 4.0.5 the settle transition (5 → disposed/loading) reached
567
+ // root listeners, so the state alone timed the release.
568
+ if (oldState === 5) {
553
569
  release();
570
+ return;
571
+ }
572
+ // 4.1 drops that emission once the fiber's context is gone; entering
573
+ // UNLOADING still arrives, so follow the transition promise it publishes
574
+ // instead — releasing after the plugin's async teardown, never before.
575
+ if (oldState === 2 && subject.state === 5) {
576
+ const inertia = subject.inertia;
577
+ if (inertia === undefined)
578
+ release();
579
+ else
580
+ void inertia.then(release, release);
581
+ }
554
582
  }, { global: true }));
555
583
  }
556
584
  catch {
557
585
  // Without the event helper only the plugin's own disposer releases it.
558
586
  }
559
- return release;
587
+ if (typeof dispose.then !== 'function')
588
+ return release;
589
+ // Observe lazily so callers that keep the deprecated synchronous disposer
590
+ // retain the registry's own unobserved-readiness error reporting.
591
+ let ready;
592
+ const whenReady = () => ready ??= Promise.resolve(dispose).then(value => {
593
+ if (typeof value === 'function')
594
+ return async () => { await release(); };
595
+ if (value !== null && typeof value === 'object' && typeof Reflect.get(value, 'dispose') === 'function') {
596
+ return { ...value, dispose: async () => { await release(); } };
597
+ }
598
+ return value;
599
+ }, error => {
600
+ release();
601
+ throw error;
602
+ });
603
+ return Object.assign(release, {
604
+ then: (resolve, reject) => whenReady().then(resolve, reject),
605
+ catch: (reject) => whenReady().catch(reject),
606
+ finally: (done) => whenReady().finally(done),
607
+ [Symbol.toStringTag]: 'Promise',
608
+ });
560
609
  }
561
610
  function guardFiberMethod(target, method, root, capability) {
562
611
  const descriptor = Reflect.getOwnPropertyDescriptor(target, method);
@@ -7,7 +7,7 @@
7
7
  /** The host CLI package whose installation the entry loads. */
8
8
  export declare const HOST_PACKAGE = "@deepseek-ai/dsh";
9
9
  /** The host line the reproduced pieces were checked against (host-replica.snapshot.json). */
10
- export declare const HOST_REPLICA_VERSION = "0.2.1-rc.5";
10
+ export declare const HOST_REPLICA_VERSION = "0.2.2-rc.2";
11
11
  /** Where the entry resolves a host module from. */
12
12
  export type HostModuleVia =
13
13
  /** The host package's own `createRequire` (its nested node_modules). */