@deepseek-harness-tui/dsh-tui 0.15.0 → 0.16.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 (301) hide show
  1. package/README.md +92 -5
  2. package/guide/dsh-tui-guide/codex-backend.en.md +13 -3
  3. package/guide/dsh-tui-guide/codex-backend.md +9 -2
  4. package/guide/dsh-tui-guide/configuration.en.md +39 -2
  5. package/guide/dsh-tui-guide/configuration.md +34 -2
  6. package/guide/dsh-tui-guide/getting-started.en.md +15 -0
  7. package/guide/dsh-tui-guide/getting-started.md +15 -0
  8. package/guide/dsh-tui-guide/interaction.en.md +8 -1
  9. package/guide/dsh-tui-guide/interaction.md +8 -1
  10. package/guide/dsh-tui-guide/plugins.en.md +66 -5
  11. package/guide/dsh-tui-guide/plugins.md +37 -3
  12. package/guide/dsh-tui-guide/user-guide.en.md +3 -2
  13. package/guide/dsh-tui-guide/user-guide.md +3 -2
  14. package/lib/settings.json +1 -1
  15. package/lib/types/adapter/channel/projection.d.ts.map +1 -1
  16. package/lib/types/adapter/channel/projection.js +1 -0
  17. package/lib/types/adapter/channel/ui-policy.d.ts +1 -1
  18. package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
  19. package/lib/types/adapter/channel/ui-policy.js +1 -0
  20. package/lib/types/adapter/ports/channel-catalog.d.ts +5 -1
  21. package/lib/types/adapter/ports/channel-catalog.d.ts.map +1 -1
  22. package/lib/types/adapter/ports/channel-settings.d.ts +5 -3
  23. package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
  24. package/lib/types/adapter/ports/channel-ui.d.ts +7 -1
  25. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  26. package/lib/types/adapter/ports/channel-view.d.ts +47 -0
  27. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  28. package/lib/types/adapter/ports/channel.d.ts +2 -0
  29. package/lib/types/adapter/ports/channel.d.ts.map +1 -1
  30. package/lib/types/agent/events.d.ts +3 -2
  31. package/lib/types/agent/events.d.ts.map +1 -1
  32. package/lib/types/backends/codex/contract.d.ts +3 -0
  33. package/lib/types/backends/codex/contract.d.ts.map +1 -1
  34. package/lib/types/backends/codex/contract.js +3 -0
  35. package/lib/types/backends/codex/session/async-questions.d.ts +17 -0
  36. package/lib/types/backends/codex/session/async-questions.d.ts.map +1 -0
  37. package/lib/types/backends/codex/session/async-questions.js +89 -0
  38. package/lib/types/backends/codex/session/session.d.ts.map +1 -1
  39. package/lib/types/backends/codex/session/session.js +35 -9
  40. package/lib/types/backends/codex/text.d.ts +3 -3
  41. package/lib/types/backends/codex/text.js +1 -1
  42. package/lib/types/backends/codex/translate/items.d.ts.map +1 -1
  43. package/lib/types/backends/codex/translate/items.js +3 -1
  44. package/lib/types/backends/codex/translate/question-reply.d.ts +11 -0
  45. package/lib/types/backends/codex/translate/question-reply.d.ts.map +1 -0
  46. package/lib/types/backends/codex/translate/question-reply.js +53 -0
  47. package/lib/types/channel/projection.d.ts.map +1 -1
  48. package/lib/types/channel/projection.js +10 -0
  49. package/lib/types/commands.d.ts +10 -0
  50. package/lib/types/commands.d.ts.map +1 -1
  51. package/lib/types/commands.js +11 -2
  52. package/lib/types/components/CommandSuggestions.d.ts.map +1 -1
  53. package/lib/types/components/CommandSuggestions.js +4 -1
  54. package/lib/types/components/LogoV2.d.ts +4 -1
  55. package/lib/types/components/LogoV2.d.ts.map +1 -1
  56. package/lib/types/components/LogoV2.js +5 -3
  57. package/lib/types/components/MessageList.d.ts.map +1 -1
  58. package/lib/types/components/MessageList.js +95 -14
  59. package/lib/types/components/PermissionsPicker.d.ts +10 -1
  60. package/lib/types/components/PermissionsPicker.d.ts.map +1 -1
  61. package/lib/types/components/PermissionsPicker.js +24 -16
  62. package/lib/types/components/PluginInstallPane.d.ts +21 -0
  63. package/lib/types/components/PluginInstallPane.d.ts.map +1 -0
  64. package/lib/types/components/PluginInstallPane.js +84 -0
  65. package/lib/types/components/PluginManagePane.d.ts +21 -0
  66. package/lib/types/components/PluginManagePane.d.ts.map +1 -0
  67. package/lib/types/components/PluginManagePane.js +69 -0
  68. package/lib/types/components/PromptInput.d.ts.map +1 -1
  69. package/lib/types/components/PromptInput.js +7 -3
  70. package/lib/types/components/SubagentCard.d.ts +13 -1
  71. package/lib/types/components/SubagentCard.d.ts.map +1 -1
  72. package/lib/types/components/SubagentCard.js +27 -12
  73. package/lib/types/components/SubagentDashboard.d.ts +8 -1
  74. package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
  75. package/lib/types/components/SubagentDashboard.js +58 -16
  76. package/lib/types/components/launchpadLayout.d.ts +14 -1
  77. package/lib/types/components/launchpadLayout.d.ts.map +1 -1
  78. package/lib/types/components/launchpadLayout.js +36 -17
  79. package/lib/types/components/messages/TeamMessageBubble.d.ts +20 -0
  80. package/lib/types/components/messages/TeamMessageBubble.d.ts.map +1 -0
  81. package/lib/types/components/messages/TeamMessageBubble.js +15 -0
  82. package/lib/types/components/sidePanel/PanelHost.d.ts.map +1 -1
  83. package/lib/types/components/sidePanel/PanelHost.js +5 -1
  84. package/lib/types/components/sidePanel/PanelStore.d.ts +8 -0
  85. package/lib/types/components/sidePanel/PanelStore.d.ts.map +1 -1
  86. package/lib/types/components/sidePanel/PanelStore.js +11 -0
  87. package/lib/types/components/sidePanel/SidePanelColumn.d.ts.map +1 -1
  88. package/lib/types/components/sidePanel/SidePanelColumn.js +13 -1
  89. package/lib/types/components/sidePanel/SidePanelRuntimeContext.d.ts +7 -0
  90. package/lib/types/components/sidePanel/SidePanelRuntimeContext.d.ts.map +1 -1
  91. package/lib/types/components/sidePanel/SidePanelRuntimeContext.js +4 -0
  92. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +3 -0
  93. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
  94. package/lib/types/components/sidePanel/btw/BtwComposer.js +20 -8
  95. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts +2 -1
  96. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
  97. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +104 -13
  98. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +6 -2
  99. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
  100. package/lib/types/components/sidePanel/btw/BtwThreadScene.js +61 -15
  101. package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts +14 -4
  102. package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts.map +1 -1
  103. package/lib/types/components/sidePanel/btw/BtwThreadView.js +90 -5
  104. package/lib/types/components/sidePanel/btw/threads.d.ts +18 -0
  105. package/lib/types/components/sidePanel/btw/threads.d.ts.map +1 -1
  106. package/lib/types/components/sidePanel/btw/threads.js +51 -0
  107. package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
  108. package/lib/types/components/sidePanel/builtinPanels.js +5 -1
  109. package/lib/types/components/sidePanel/companion/SplashMascot.d.ts +5 -1
  110. package/lib/types/components/sidePanel/companion/SplashMascot.d.ts.map +1 -1
  111. package/lib/types/components/sidePanel/companion/SplashMascot.js +19 -4
  112. package/lib/types/components/sidePanel/companion/skins.d.ts +8 -0
  113. package/lib/types/components/sidePanel/companion/skins.d.ts.map +1 -1
  114. package/lib/types/components/sidePanel/companion/skins.js +57 -12
  115. package/lib/types/components/sidePanel/types.d.ts +6 -0
  116. package/lib/types/components/sidePanel/types.d.ts.map +1 -1
  117. package/lib/types/components/splashArtRows.d.ts +29 -0
  118. package/lib/types/components/splashArtRows.d.ts.map +1 -0
  119. package/lib/types/components/splashArtRows.js +31 -0
  120. package/lib/types/components/teamRoster.d.ts +70 -0
  121. package/lib/types/components/teamRoster.d.ts.map +1 -0
  122. package/lib/types/components/teamRoster.js +78 -0
  123. package/lib/types/dsh-adapter/admission-loader.d.ts +82 -0
  124. package/lib/types/dsh-adapter/admission-loader.d.ts.map +1 -1
  125. package/lib/types/dsh-adapter/admission-loader.js +73 -28
  126. package/lib/types/dsh-adapter/agent-view.d.ts.map +1 -1
  127. package/lib/types/dsh-adapter/agent-view.js +3 -1
  128. package/lib/types/dsh-adapter/approvals.d.ts +7 -0
  129. package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
  130. package/lib/types/dsh-adapter/approvals.js +45 -1
  131. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  132. package/lib/types/dsh-adapter/backend/translate.js +68 -8
  133. package/lib/types/dsh-adapter/backend-assembly.d.ts +31 -0
  134. package/lib/types/dsh-adapter/backend-assembly.d.ts.map +1 -0
  135. package/lib/types/dsh-adapter/backend-assembly.js +225 -0
  136. package/lib/types/dsh-adapter/backend-contribution.d.ts +36 -0
  137. package/lib/types/dsh-adapter/backend-contribution.d.ts.map +1 -1
  138. package/lib/types/dsh-adapter/backend-contribution.js +41 -0
  139. package/lib/types/dsh-adapter/backend-registry.d.ts.map +1 -1
  140. package/lib/types/dsh-adapter/backend-registry.js +22 -3
  141. package/lib/types/dsh-adapter/backends.d.ts.map +1 -1
  142. package/lib/types/dsh-adapter/backends.js +4 -5
  143. package/lib/types/dsh-adapter/bundled-presets.d.ts.map +1 -1
  144. package/lib/types/dsh-adapter/bundled-presets.js +60 -3
  145. package/lib/types/dsh-adapter/channel/binding-events.d.ts +1 -0
  146. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
  147. package/lib/types/dsh-adapter/channel/binding-events.js +1 -0
  148. package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
  149. package/lib/types/dsh-adapter/channel/command-completions.js +64 -7
  150. package/lib/types/dsh-adapter/channel/compaction.d.ts +7 -2
  151. package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -1
  152. package/lib/types/dsh-adapter/channel/compaction.js +100 -26
  153. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +3 -0
  154. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
  155. package/lib/types/dsh-adapter/channel/core/binding-feed.js +2 -1
  156. package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
  157. package/lib/types/dsh-adapter/channel/core/compose.js +12 -0
  158. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  159. package/lib/types/dsh-adapter/channel/extensions.js +68 -8
  160. package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts +6 -0
  161. package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts.map +1 -1
  162. package/lib/types/dsh-adapter/channel/mode-permission-actions.js +104 -12
  163. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
  164. package/lib/types/dsh-adapter/channel/model-actions.js +8 -1
  165. package/lib/types/dsh-adapter/channel/permissions.d.ts.map +1 -1
  166. package/lib/types/dsh-adapter/channel/permissions.js +4 -1
  167. package/lib/types/dsh-adapter/channel/projection-helpers.d.ts.map +1 -1
  168. package/lib/types/dsh-adapter/channel/projection-helpers.js +2 -0
  169. package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
  170. package/lib/types/dsh-adapter/channel/session-metadata.js +4 -3
  171. package/lib/types/dsh-adapter/channel/session-reset.js +2 -2
  172. package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
  173. package/lib/types/dsh-adapter/channel/session-resume.js +7 -0
  174. package/lib/types/dsh-adapter/channel/settings-host.d.ts +3 -0
  175. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  176. package/lib/types/dsh-adapter/channel/settings-host.js +135 -5
  177. package/lib/types/dsh-adapter/channel/state.d.ts +6 -0
  178. package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
  179. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
  180. package/lib/types/dsh-adapter/channel/subagent-projection.js +18 -6
  181. package/lib/types/dsh-adapter/channel/transcript.d.ts +7 -0
  182. package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
  183. package/lib/types/dsh-adapter/channel/transcript.js +19 -2
  184. package/lib/types/dsh-adapter/compat/agent-team-0.2.0.d.ts +55 -0
  185. package/lib/types/dsh-adapter/compat/agent-team-0.2.0.d.ts.map +1 -0
  186. package/lib/types/dsh-adapter/compat/agent-team-0.2.0.js +96 -0
  187. package/lib/types/dsh-adapter/contract.d.ts +4 -4
  188. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  189. package/lib/types/dsh-adapter/contract.js +5 -5
  190. package/lib/types/dsh-adapter/effect-ledger.d.ts +7 -0
  191. package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
  192. package/lib/types/dsh-adapter/effect-ledger.js +8 -1
  193. package/lib/types/dsh-adapter/entry-slot.d.ts +3 -1
  194. package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -1
  195. package/lib/types/dsh-adapter/entry-slot.js +2 -2
  196. package/lib/types/dsh-adapter/fresh-agent.d.ts.map +1 -1
  197. package/lib/types/dsh-adapter/fresh-agent.js +6 -1
  198. package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
  199. package/lib/types/dsh-adapter/host-access.js +95 -0
  200. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  201. package/lib/types/dsh-adapter/host-contract.d.ts.map +1 -1
  202. package/lib/types/dsh-adapter/host-contract.js +3 -2
  203. package/lib/types/dsh-adapter/host-dsh.d.ts +8 -2
  204. package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
  205. package/lib/types/dsh-adapter/host-dsh.js +45 -30
  206. package/lib/types/dsh-adapter/host-entry.js +35 -10
  207. package/lib/types/dsh-adapter/index.d.ts +9 -10
  208. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  209. package/lib/types/dsh-adapter/index.js +8 -6
  210. package/lib/types/dsh-adapter/invariant.d.ts +7 -2
  211. package/lib/types/dsh-adapter/invariant.d.ts.map +1 -1
  212. package/lib/types/dsh-adapter/invariant.js +6 -3
  213. package/lib/types/dsh-adapter/migrate/index.js +2 -2
  214. package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
  215. package/lib/types/dsh-adapter/panels.js +6 -0
  216. package/lib/types/dsh-adapter/plugin-declaration.d.ts +99 -1
  217. package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -1
  218. package/lib/types/dsh-adapter/plugin-declaration.js +132 -2
  219. package/lib/types/dsh-adapter/plugin-feed.d.ts +94 -0
  220. package/lib/types/dsh-adapter/plugin-feed.d.ts.map +1 -0
  221. package/lib/types/dsh-adapter/plugin-feed.js +135 -0
  222. package/lib/types/dsh-adapter/plugin-guard.d.ts +115 -0
  223. package/lib/types/dsh-adapter/plugin-guard.d.ts.map +1 -0
  224. package/lib/types/dsh-adapter/plugin-guard.js +108 -0
  225. package/lib/types/dsh-adapter/plugin-install.d.ts +160 -0
  226. package/lib/types/dsh-adapter/plugin-install.d.ts.map +1 -0
  227. package/lib/types/dsh-adapter/plugin-install.js +545 -0
  228. package/lib/types/dsh-adapter/plugin-manage.d.ts +178 -0
  229. package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -0
  230. package/lib/types/dsh-adapter/plugin-manage.js +468 -0
  231. package/lib/types/dsh-adapter/plugin-manager.d.ts +78 -2
  232. package/lib/types/dsh-adapter/plugin-manager.d.ts.map +1 -1
  233. package/lib/types/dsh-adapter/plugin-manager.js +32 -0
  234. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  235. package/lib/types/dsh-adapter/plugin.js +49 -2
  236. package/lib/types/dsh-adapter/plugins-info.d.ts +87 -1
  237. package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
  238. package/lib/types/dsh-adapter/plugins-info.js +131 -26
  239. package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
  240. package/lib/types/dsh-adapter/process-exit.d.ts.map +1 -1
  241. package/lib/types/dsh-adapter/process-exit.js +1 -1
  242. package/lib/types/dsh-adapter/session-projection-store.d.ts +66 -0
  243. package/lib/types/dsh-adapter/session-projection-store.d.ts.map +1 -0
  244. package/lib/types/dsh-adapter/session-projection-store.js +149 -0
  245. package/lib/types/dsh-adapter/settingsEditor.js +2 -2
  246. package/lib/types/dsh-adapter/sideQuestion.d.ts +21 -0
  247. package/lib/types/dsh-adapter/sideQuestion.d.ts.map +1 -1
  248. package/lib/types/dsh-adapter/sideQuestion.js +53 -0
  249. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  250. package/lib/types/dsh-adapter/subagents.js +2 -1
  251. package/lib/types/dsh-adapter/team-mode.d.ts +74 -0
  252. package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -0
  253. package/lib/types/dsh-adapter/team-mode.js +188 -0
  254. package/lib/types/dsh-adapter/team-roster.d.ts +67 -0
  255. package/lib/types/dsh-adapter/team-roster.d.ts.map +1 -0
  256. package/lib/types/dsh-adapter/team-roster.js +136 -0
  257. package/lib/types/dsh-adapter/team-tools.d.ts +58 -0
  258. package/lib/types/dsh-adapter/team-tools.d.ts.map +1 -0
  259. package/lib/types/dsh-adapter/team-tools.js +208 -0
  260. package/lib/types/dsh-adapter/types.d.ts +1 -1
  261. package/lib/types/dsh-adapter/types.d.ts.map +1 -1
  262. package/lib/types/i18n.d.ts +607 -16
  263. package/lib/types/i18n.d.ts.map +1 -1
  264. package/lib/types/i18n.js +295 -9
  265. package/lib/types/ink/components/ScrollBox.d.ts +9 -0
  266. package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
  267. package/lib/types/ink/components/ScrollBox.js +23 -0
  268. package/lib/types/ink/dom.d.ts.map +1 -1
  269. package/lib/types/kernelPrefs.d.ts +1 -1
  270. package/lib/types/kernelPrefs.d.ts.map +1 -1
  271. package/lib/types/native-ts/yoga-layout/index.d.ts.map +1 -1
  272. package/lib/types/native-ts/yoga-layout/index.js +8 -1
  273. package/lib/types/permissionPresetLabels.d.ts +25 -0
  274. package/lib/types/permissionPresetLabels.d.ts.map +1 -0
  275. package/lib/types/permissionPresetLabels.js +33 -0
  276. package/lib/types/preset-patch.d.ts +22 -0
  277. package/lib/types/preset-patch.d.ts.map +1 -0
  278. package/lib/types/preset-patch.js +14 -0
  279. package/lib/types/screens/Chat.d.ts +33 -1
  280. package/lib/types/screens/Chat.d.ts.map +1 -1
  281. package/lib/types/screens/Chat.js +301 -9
  282. package/lib/types/screens/Launchpad.d.ts +7 -1
  283. package/lib/types/screens/Launchpad.d.ts.map +1 -1
  284. package/lib/types/screens/Launchpad.js +19 -4
  285. package/lib/types/screens/Settings.d.ts.map +1 -1
  286. package/lib/types/screens/Settings.js +1 -0
  287. package/lib/types/screens/chat/usePluginWriteFlow.d.ts +68 -0
  288. package/lib/types/screens/chat/usePluginWriteFlow.d.ts.map +1 -0
  289. package/lib/types/screens/chat/usePluginWriteFlow.js +92 -0
  290. package/lib/types/screens/chatOverlay.d.ts +19 -1
  291. package/lib/types/screens/chatOverlay.d.ts.map +1 -1
  292. package/lib/types/sessionModes.d.ts +5 -3
  293. package/lib/types/sessionModes.d.ts.map +1 -1
  294. package/lib/types/sessionModes.js +9 -3
  295. package/lib/types/tips.js +2 -2
  296. package/lib/types/utils/paths.d.ts +11 -0
  297. package/lib/types/utils/paths.d.ts.map +1 -1
  298. package/lib/types/utils/paths.js +13 -0
  299. package/package.json +126 -120
  300. package/tui-profile/feed/README.md +63 -0
  301. package/tui-profile/feed/first-party.json +10 -0
@@ -1 +1 @@
1
- {"version":3,"file":"subagents.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/subagents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAGlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAsC,kBAAkB,EAAE,gBAAgB,EAAsB,MAAM,kCAAkC,CAAA;AACxM,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAQtL;gCACgC;AAChC,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,iBAAiB,EAAE,CAAA;IAC5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AAU,SAAc,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAChG,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAChE,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAc,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAE5F,OAAO,CAAC,MAAM;IAuBd;;;sDAGkD;IAClD,KAAK,IAAI,IAAI;IAYb,QAAQ,IAAI,aAAa,EAAE;IAC3B,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAC/C,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAC3C,OAAO,CAAC,MAAM;CACf"}
@@ -1,5 +1,6 @@
1
1
  import { addUsageToCostBuckets, cloneCostBuckets, emptyCostBuckets, isDeepSeekOfficialProvider, isPeakHour, priceForModel } from '../deepseekPricing.js';
2
2
  import { toolResultPayload } from './compat/messages.js';
3
+ import { toolFailureText } from './channel/transcript.js';
3
4
  const MAX_OUTPUT_EVENTS = 160;
4
5
  const MAX_OUTPUT_LINES = 160;
5
6
  /** Keyed labels parked before their row exists (see `earlyLabels`). */
@@ -382,7 +383,7 @@ export class SubagentActivityStore {
382
383
  tool.status = data.error !== undefined || payload.isError ? 'failed' : 'completed';
383
384
  tool.endedAt = Date.now();
384
385
  if (data.error !== undefined)
385
- tool.error = String(data.error);
386
+ tool.error = toolFailureText(data.error, this.previewOf(payload.content) ?? '');
386
387
  else if (payload.isError)
387
388
  tool.error = this.previewOf(payload.content);
388
389
  else {
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Agent Teams on and off at run time (issue #1241, see
3
+ * docs/agent-teams-design.md「开关机制」).
4
+ *
5
+ * The switch is the upstream team bundle itself: `/team on|off` selects or
6
+ * drops its layer through the host plugin manager (the same write
7
+ * `/plugin enable|disable` makes), which persists to the profile and, with
8
+ * `hmr` mounted, applies at once. The team tool plugin installs into every
9
+ * live root Agent and uninstalls on disposal, so the sessions already running
10
+ * follow. What stays here is the one decision that cannot live in a preset —
11
+ * which legacy delegation tools a request carries — and the `/team` command.
12
+ *
13
+ * @module
14
+ */
15
+ import type { Context } from '@deepseek-ai/cordis';
16
+ import type { PromptAssembly } from '@deepseek-ai/dsh-system-prompt';
17
+ import { type PluginManageFlow, type PluginManageSink, type TeamActiveMembers } from './plugin-manage.js';
18
+ /**
19
+ * The install spec the hints name. The team packages ship in lockstep with
20
+ * DSH and pin their DSH peers exactly, so only the bundle of the running
21
+ * kernel's own version installs into this host (npm `latest` and `next`
22
+ * both name other lines).
23
+ * @param kernel - The running DSH version; unknown falls back to the validated line.
24
+ * @returns `<bundle>@<version>`, or undefined on a known kernel that is not a
25
+ * team line: no bundle installs there, DSH has to move to a team line first.
26
+ */
27
+ export declare function teamBundleSpec(kernel: string | undefined): string | undefined;
28
+ /**
29
+ * Keep one delegation tool set per request. Presets keep their legacy rows,
30
+ * so whether the team replaces them is decided where the tools are known: an
31
+ * assembly carrying `spawn_teammate` drops `subagent` / `subagent_fork`. This
32
+ * follows a bundle toggled at run time into the sessions already joined (a
33
+ * preset revision cannot), and a team service that never activated leaves the
34
+ * legacy tools in place. The agent loop diffs these final tools against the
35
+ * logged request header, so the model is told about each swap.
36
+ * @param assembly - Fully assembled prompt inputs for one model request.
37
+ * @returns The original assembly, or a copy without the replaced tools.
38
+ */
39
+ export declare function filterTeamReplacedTools(assembly: PromptAssembly): PromptAssembly;
40
+ /** What `/team` was asked. */
41
+ export type TeamCommand = {
42
+ readonly kind: 'on' | 'off' | 'status';
43
+ } | {
44
+ readonly kind: 'unknown';
45
+ readonly sub: string;
46
+ };
47
+ export declare function parseTeamArgs(args: string): TeamCommand;
48
+ /** What the screen supplies: the plugin flow's sink, plus the team's live state. */
49
+ export interface TeamCommandSink extends PluginManageSink {
50
+ /** Teammates of the bound session, how many are running or provisioning, and how many may be running. */
51
+ readonly members: () => {
52
+ readonly total: number;
53
+ } & TeamActiveMembers;
54
+ }
55
+ /** What one `/team` input turned into. */
56
+ export type TeamCommandOutcome = {
57
+ readonly kind: 'flow';
58
+ readonly flow: PluginManageFlow;
59
+ } | {
60
+ readonly kind: 'lines';
61
+ readonly lines: Promise<readonly string[]>;
62
+ };
63
+ /**
64
+ * Wire `/team` to the running composition.
65
+ * @param ctx - Host context of the composition root.
66
+ * @param options - The profile a manual route names, and the running host's
67
+ * DSH version (this package's entry; otherwise the installed one is read).
68
+ * @returns the command entry the screen calls.
69
+ */
70
+ export declare function createTeamCommandEntry(ctx: Context, options?: {
71
+ readonly profileName?: string | undefined;
72
+ readonly kernelVersion?: string | undefined;
73
+ }): (args: string, sink: TeamCommandSink) => TeamCommandOutcome;
74
+ //# sourceMappingURL=team-mode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team-mode.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/team-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAIpE,OAAO,EAA0B,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAejI;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAG7E;AAaD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,cAAc,GAAG,cAAc,CAIhF;AAED,8BAA8B;AAC9B,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,QAAQ,CAAA;CAAE,GAC1C;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAKvD;AAED,oFAAoF;AACpF,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,yGAAyG;IACzG,QAAQ,CAAC,OAAO,EAAE,MAAM;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,iBAAiB,CAAA;CACvE;AAED,0CAA0C;AAC1C,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAC1D;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAA;CAAE,CAAA;AAE1E;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,OAAO,GAAE;IAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAO,GACvG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,KAAK,kBAAkB,CAqE7D"}
@@ -0,0 +1,188 @@
1
+ import { t } from '../i18n.js';
2
+ import { resolveDshProfileName } from '../update.js';
3
+ import { installedKernelVersion, UPSTREAM_VALIDATED_VERSION } from './contract.js';
4
+ import { createPluginManageFlow } from './plugin-manage.js';
5
+ import { pluginManagerOf } from './plugin-manager.js';
6
+ import { cell } from './plugins-info.js';
7
+ import { TEAM_BUNDLE } from './team-roster.js';
8
+ import { TEAM_SPAWN_TOOL } from './team-tools.js';
9
+ /**
10
+ * The DSH lines whose team bundle this adapter reads: the validated line,
11
+ * 0.2.1-alpha.5 (its team packages differ from rc.2 only in version) and the
12
+ * 0.2.0 compat line (compat/agent-team-0.2.0.ts; rc.1 ships the same team
13
+ * code as rc.2). Other lines' team projection may lack the `wire` view
14
+ * `channel.team` needs.
15
+ */
16
+ const TEAM_LINES = new Set([UPSTREAM_VALIDATED_VERSION, '0.2.1-alpha.5', '0.2.0-rc.1', '0.2.0-rc.2']);
17
+ /**
18
+ * The install spec the hints name. The team packages ship in lockstep with
19
+ * DSH and pin their DSH peers exactly, so only the bundle of the running
20
+ * kernel's own version installs into this host (npm `latest` and `next`
21
+ * both name other lines).
22
+ * @param kernel - The running DSH version; unknown falls back to the validated line.
23
+ * @returns `<bundle>@<version>`, or undefined on a known kernel that is not a
24
+ * team line: no bundle installs there, DSH has to move to a team line first.
25
+ */
26
+ export function teamBundleSpec(kernel) {
27
+ if (kernel === undefined)
28
+ return `${TEAM_BUNDLE}@${UPSTREAM_VALIDATED_VERSION}`;
29
+ return TEAM_LINES.has(kernel) ? `${TEAM_BUNDLE}@${kernel}` : undefined;
30
+ }
31
+ /**
32
+ * Legacy delegation tools that `spawn_teammate` replaces. The four control
33
+ * tools the team shares names with (`send_message`, `list_agents`,
34
+ * `interrupt_agent`, `wait_agent`) need no entry: the team copies live in the
35
+ * Agent's own scope and shadow the preset's, in the assembly and at execution.
36
+ */
37
+ const TEAM_REPLACED_TOOLS = new Set(['subagent', 'subagent_fork']);
38
+ /**
39
+ * Keep one delegation tool set per request. Presets keep their legacy rows,
40
+ * so whether the team replaces them is decided where the tools are known: an
41
+ * assembly carrying `spawn_teammate` drops `subagent` / `subagent_fork`. This
42
+ * follows a bundle toggled at run time into the sessions already joined (a
43
+ * preset revision cannot), and a team service that never activated leaves the
44
+ * legacy tools in place. The agent loop diffs these final tools against the
45
+ * logged request header, so the model is told about each swap.
46
+ * @param assembly - Fully assembled prompt inputs for one model request.
47
+ * @returns The original assembly, or a copy without the replaced tools.
48
+ */
49
+ export function filterTeamReplacedTools(assembly) {
50
+ if (!assembly.tools.some(tool => tool.name === TEAM_SPAWN_TOOL))
51
+ return assembly;
52
+ if (!assembly.tools.some(tool => TEAM_REPLACED_TOOLS.has(tool.name)))
53
+ return assembly;
54
+ return { ...assembly, tools: assembly.tools.filter(tool => !TEAM_REPLACED_TOOLS.has(tool.name)) };
55
+ }
56
+ export function parseTeamArgs(args) {
57
+ const sub = args.trim().split(/\s+/)[0] ?? '';
58
+ if (sub === '' || sub === 'status')
59
+ return { kind: 'status' };
60
+ if (sub === 'on' || sub === 'off')
61
+ return { kind: sub };
62
+ return { kind: 'unknown', sub };
63
+ }
64
+ /**
65
+ * Wire `/team` to the running composition.
66
+ * @param ctx - Host context of the composition root.
67
+ * @param options - The profile a manual route names, and the running host's
68
+ * DSH version (this package's entry; otherwise the installed one is read).
69
+ * @returns the command entry the screen calls.
70
+ */
71
+ export function createTeamCommandEntry(ctx, options = {}) {
72
+ const profile = () => options.profileName ?? resolveDshProfileName() ?? 'dsh-tui';
73
+ // The version does not change in a process: read it once, on the first hint.
74
+ let kernel;
75
+ const hint = (key) => {
76
+ kernel ??= { version: options.kernelVersion ?? installedKernelVersion() };
77
+ const spec = teamBundleSpec(kernel.version);
78
+ return spec === undefined
79
+ ? t('team-cmd-kernel-unsupported', { version: cell(kernel.version ?? ''), lines: [...TEAM_LINES].join(' / ') })
80
+ : t(key, { profile: cell(profile()), bundle: spec });
81
+ };
82
+ return (args, sink) => {
83
+ const parsed = parseTeamArgs(args);
84
+ if (parsed.kind === 'unknown') {
85
+ return { kind: 'lines', lines: Promise.resolve([t('team-cmd-usage', { sub: cell(parsed.sub) })]) };
86
+ }
87
+ const manager = pluginManagerOf(ctx);
88
+ if (parsed.kind === 'status')
89
+ return { kind: 'lines', lines: teamStatusLines(ctx, sink, hint) };
90
+ if (manager === undefined) {
91
+ return { kind: 'lines', lines: Promise.resolve([hint('team-cmd-no-manager')]) };
92
+ }
93
+ const flow = createPluginManageFlow({
94
+ manager,
95
+ action: parsed.kind === 'on' ? 'enable' : 'disable',
96
+ target: TEAM_BUNDLE,
97
+ binding: sink.binding,
98
+ busy: sink.busy,
99
+ onLines: sink.onLines,
100
+ profileName: profile(),
101
+ teamActiveMembers: sink.members,
102
+ });
103
+ // Without the package the lifecycle flow would answer with its generic
104
+ // "no such target" and every addressable name. Say what is missing
105
+ // instead: `on` with how to install it (installing stays an explicit
106
+ // `/plugin install`, it runs third-party code behind its own trust step),
107
+ // `off` that there is nothing to switch off.
108
+ const bindingAtStart = sink.binding();
109
+ return {
110
+ kind: 'flow',
111
+ flow: {
112
+ ...flow,
113
+ async begin() {
114
+ let installed = true;
115
+ let enabled = false;
116
+ try {
117
+ const entry = (await manager.listBundles()).find(candidate => candidate.name === TEAM_BUNDLE);
118
+ installed = entry !== undefined;
119
+ enabled = entry?.enabled === true;
120
+ }
121
+ catch {
122
+ // A failing read is the flow's to report: it reads the same list.
123
+ }
124
+ if (parsed.kind === 'off') {
125
+ if (installed)
126
+ return flow.begin();
127
+ if (sink.binding() === bindingAtStart)
128
+ sink.onLines([t('team-cmd-off-not-installed')]);
129
+ return { kind: 'done' };
130
+ }
131
+ // Already selected: no trust question about code already running,
132
+ // no no-op write. Say whether it is actually running.
133
+ if (installed && !enabled)
134
+ return flow.begin();
135
+ if (sink.binding() === bindingAtStart) {
136
+ sink.onLines(!installed
137
+ ? [hint('team-cmd-not-installed')]
138
+ : [t('team-cmd-already-on'), ...ctx.get('agentTeams', false) === undefined ? [t('team-cmd-pending-on')] : []]);
139
+ }
140
+ return { kind: 'done' };
141
+ },
142
+ },
143
+ };
144
+ };
145
+ }
146
+ /**
147
+ * `/team` and `/team status`: whether the profile selects the bundle, whether
148
+ * the team service is running in this process, and the bound session's team.
149
+ */
150
+ async function teamStatusLines(ctx, sink, hint) {
151
+ const manager = pluginManagerOf(ctx);
152
+ const service = ctx.get('agentTeams', false) !== undefined;
153
+ const lines = [];
154
+ if (manager === undefined) {
155
+ lines.push(t('team-cmd-service', { state: t(service ? 'team-cmd-running' : 'team-cmd-stopped') }));
156
+ lines.push(hint('team-cmd-no-manager'));
157
+ }
158
+ else {
159
+ let selected;
160
+ let installed = false;
161
+ try {
162
+ const bundle = (await manager.listBundles()).find(candidate => candidate.name === TEAM_BUNDLE);
163
+ installed = bundle !== undefined;
164
+ selected = bundle?.enabled;
165
+ }
166
+ catch (error) {
167
+ lines.push(t('plugins-service-error', { err: cell(error instanceof Error ? error.message : String(error)) }));
168
+ }
169
+ if (selected !== undefined || installed) {
170
+ lines.push(t('team-cmd-bundle', { state: t(selected === true ? 'team-cmd-on' : 'team-cmd-off') }));
171
+ }
172
+ else if (lines.length === 0) {
173
+ lines.push(hint('team-cmd-not-installed'));
174
+ }
175
+ lines.push(t('team-cmd-service', { state: t(service ? 'team-cmd-running' : 'team-cmd-stopped') }));
176
+ // The profile says on but nothing runs (a startup-only profile, or the
177
+ // service failed to activate), or the reverse: say which one wins now.
178
+ if (selected === true && !service)
179
+ lines.push(t('team-cmd-pending-on'));
180
+ if (selected === false && service)
181
+ lines.push(t('team-cmd-pending-off'));
182
+ }
183
+ const { total, active, unseen } = sink.members();
184
+ lines.push(total === 0
185
+ ? t('team-cmd-no-members')
186
+ : t(unseen === 0 ? 'team-cmd-members' : 'team-cmd-members-unseen', { total: String(total), active: String(active), unseen: String(unseen) }));
187
+ return lines;
188
+ }
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Read side of DSH's experimental Agent Teams: the Lead session's `agentTeam`
3
+ * projection (roster + non-deleted task board), folded for the session on
4
+ * screen. Inside a teammate it reads the Lead's value, found through the
5
+ * teammate header's `parentSession` (another child of the Lead reads none).
6
+ *
7
+ * The wire value is narrowed locally (`@deepseek-ai/dsh-experimental-agent-team`
8
+ * is never imported); a composition without the team service never publishes
9
+ * the key and the store stays empty.
10
+ *
11
+ * @module
12
+ */
13
+ import type { Context } from '@deepseek-ai/cordis';
14
+ import type { TeamView } from '../adapter/ports/channel-view.js';
15
+ import { type SessionProjectionStore, type WatchedSession } from './session-projection-store.js';
16
+ export declare const TEAM_PROJECTION_KEY = "agentTeam";
17
+ /** The upstream bundle that mounts the team service and tools: the team-mode switch. */
18
+ export declare const TEAM_BUNDLE = "@deepseek-ai/dsh-experimental-agent-team-profile";
19
+ /** What the channel reads: the team of one session, if any. */
20
+ export interface TeamSource {
21
+ /** The team of `sessionId` — `undefined` unless it is the session last
22
+ * seeded (a non-DSH session never seeds, so it never reads a stale team). */
23
+ teamOf(sessionId: string): TeamView | undefined;
24
+ subscribe(listener: () => void): () => void;
25
+ }
26
+ export type TeamRosterStore = SessionProjectionStore<TeamView> & TeamSource;
27
+ /**
28
+ * Narrow one `agentTeam` value into the view the UI renders. A session's
29
+ * implicit team (the Lead alone, no task, no failure) is no team: every root
30
+ * session publishes that baseline once the service is mounted.
31
+ * @param value - Raw projection value.
32
+ * @param leadSessionId - The session the value was published for.
33
+ * @returns the team view, or `undefined` when there is nothing to show.
34
+ */
35
+ export declare function asTeamView(value: unknown, leadSessionId: string): TeamView | undefined;
36
+ interface AgentsLike {
37
+ list(): Iterable<{
38
+ readonly session: {
39
+ readonly id: unknown;
40
+ };
41
+ }>;
42
+ }
43
+ /**
44
+ * The team a bound session belongs to is rooted at itself, or — for a
45
+ * delegated child — at its parent: teammates are direct children of the Lead.
46
+ * @param session - The bound session.
47
+ * @param agents - Live agents, to find the Lead's session object for a baseline.
48
+ * @returns the session whose `agentTeam` value to read.
49
+ */
50
+ export declare function teamRootOf(session: unknown, agents: AgentsLike | undefined): WatchedSession;
51
+ /**
52
+ * The watched team as seen from `sessionId`: the Lead's own, or a listed
53
+ * teammate's. Any other child of the Lead (a plain subagent, a workflow
54
+ * spawn) is watched at the same parent but belongs to no team.
55
+ * @param team - The watched session's team.
56
+ * @param sessionId - The bound session.
57
+ * @returns the team, or `undefined` when the session is not on it.
58
+ */
59
+ export declare function teamFor(team: TeamView | undefined, sessionId: string): TeamView | undefined;
60
+ /**
61
+ * Create the composition root's team store and wire it to the host.
62
+ * @param ctx - Host context of the composition root.
63
+ * @returns the store the channel reads from.
64
+ */
65
+ export declare function createTeamRosterStore(ctx: Context): TeamRosterStore;
66
+ export {};
67
+ //# sourceMappingURL=team-roster.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team-roster.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/team-roster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAwB,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AACtF,OAAO,EAAyD,KAAK,sBAAsB,EAAE,KAAK,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAEvJ,eAAO,MAAM,mBAAmB,cAAc,CAAA;AAE9C,wFAAwF;AACxF,eAAO,MAAM,WAAW,qDAAqD,CAAA;AAE7E,+DAA+D;AAC/D,MAAM,WAAW,UAAU;IACzB;kFAC8E;IAC9E,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAA;IAC/C,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;CAC5C;AAED,MAAM,MAAM,eAAe,GAAG,sBAAsB,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAA;AAkC3E;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAUtF;AAOD,UAAU,UAAU;IAClB,IAAI,IAAI,QAAQ,CAAC;QAAE,QAAQ,CAAC,OAAO,EAAE;YAAE,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAA;SAAE,CAAA;KAAE,CAAC,CAAA;CACjE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,cAAc,CAQ3F;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAG3F;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CAyBnE"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Read side of DSH's experimental Agent Teams: the Lead session's `agentTeam`
3
+ * projection (roster + non-deleted task board), folded for the session on
4
+ * screen. Inside a teammate it reads the Lead's value, found through the
5
+ * teammate header's `parentSession` (another child of the Lead reads none).
6
+ *
7
+ * The wire value is narrowed locally (`@deepseek-ai/dsh-experimental-agent-team`
8
+ * is never imported); a composition without the team service never publishes
9
+ * the key and the store stays empty.
10
+ *
11
+ * @module
12
+ */
13
+ import { attachSessionProjection, createSessionProjectionStore } from './session-projection-store.js';
14
+ export const TEAM_PROJECTION_KEY = 'agentTeam';
15
+ /** The upstream bundle that mounts the team service and tools: the team-mode switch. */
16
+ export const TEAM_BUNDLE = '@deepseek-ai/dsh-experimental-agent-team-profile';
17
+ const PHASES = new Set(['provisioning', 'active', 'failed']);
18
+ const TASK_STATUSES = new Set(['pending', 'in_progress', 'completed']);
19
+ function isRecord(value) {
20
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
21
+ }
22
+ function isStringArray(value) {
23
+ return Array.isArray(value) && value.every(item => typeof item === 'string');
24
+ }
25
+ function asMember(value) {
26
+ if (!isRecord(value))
27
+ return undefined;
28
+ const { id, name, role, phase, error } = value;
29
+ if (typeof id !== 'string' || typeof name !== 'string')
30
+ return undefined;
31
+ if (role !== 'lead' && role !== 'teammate')
32
+ return undefined;
33
+ if (typeof phase !== 'string' || !PHASES.has(phase))
34
+ return undefined;
35
+ return { id, name, role, phase: phase, ...typeof error === 'string' ? { error } : {} };
36
+ }
37
+ function asTask(value) {
38
+ if (!isRecord(value))
39
+ return undefined;
40
+ const { id, revision, subject, description, status, blockedBy, writeScopes, ownerName, ready, writeScopeWarnings } = value;
41
+ if (typeof id !== 'string' || typeof revision !== 'number' || typeof subject !== 'string' || typeof description !== 'string')
42
+ return undefined;
43
+ if (typeof status !== 'string' || !TASK_STATUSES.has(status))
44
+ return undefined;
45
+ if (!isStringArray(blockedBy) || !isStringArray(writeScopes) || !isStringArray(writeScopeWarnings) || typeof ready !== 'boolean')
46
+ return undefined;
47
+ return {
48
+ id, revision, subject, description, status: status, blockedBy, writeScopes, ready, writeScopeWarnings,
49
+ ...typeof ownerName === 'string' ? { ownerName } : {},
50
+ };
51
+ }
52
+ /**
53
+ * Narrow one `agentTeam` value into the view the UI renders. A session's
54
+ * implicit team (the Lead alone, no task, no failure) is no team: every root
55
+ * session publishes that baseline once the service is mounted.
56
+ * @param value - Raw projection value.
57
+ * @param leadSessionId - The session the value was published for.
58
+ * @returns the team view, or `undefined` when there is nothing to show.
59
+ */
60
+ export function asTeamView(value, leadSessionId) {
61
+ if (!isRecord(value) || !Array.isArray(value.members) || !Array.isArray(value.tasks))
62
+ return undefined;
63
+ const members = value.members.map(asMember);
64
+ const tasks = value.tasks.map(asTask);
65
+ if (members.includes(undefined) || tasks.includes(undefined))
66
+ return undefined;
67
+ const failure = typeof value.failure === 'string' ? value.failure : undefined;
68
+ const roster = members;
69
+ const board = tasks;
70
+ if (!roster.some(member => member.role === 'teammate') && board.length === 0 && failure === undefined)
71
+ return undefined;
72
+ return { leadSessionId, members: roster, tasks: board, ...failure === undefined ? {} : { failure } };
73
+ }
74
+ /**
75
+ * The team a bound session belongs to is rooted at itself, or — for a
76
+ * delegated child — at its parent: teammates are direct children of the Lead.
77
+ * @param session - The bound session.
78
+ * @param agents - Live agents, to find the Lead's session object for a baseline.
79
+ * @returns the session whose `agentTeam` value to read.
80
+ */
81
+ export function teamRootOf(session, agents) {
82
+ const own = session;
83
+ const parent = own.header?.origin === 'subagent' ? own.header.parentSession : undefined;
84
+ if (typeof parent !== 'string')
85
+ return { id: String(own.id), session };
86
+ for (const agent of agents?.list() ?? []) {
87
+ if (String(agent.session.id) === parent)
88
+ return { id: parent, session: agent.session };
89
+ }
90
+ return { id: parent };
91
+ }
92
+ /**
93
+ * The watched team as seen from `sessionId`: the Lead's own, or a listed
94
+ * teammate's. Any other child of the Lead (a plain subagent, a workflow
95
+ * spawn) is watched at the same parent but belongs to no team.
96
+ * @param team - The watched session's team.
97
+ * @param sessionId - The bound session.
98
+ * @returns the team, or `undefined` when the session is not on it.
99
+ */
100
+ export function teamFor(team, sessionId) {
101
+ if (team === undefined || team.leadSessionId === sessionId)
102
+ return team;
103
+ return team.members.some(member => member.role === 'teammate' && member.id === sessionId) ? team : undefined;
104
+ }
105
+ /**
106
+ * Create the composition root's team store and wire it to the host.
107
+ * @param ctx - Host context of the composition root.
108
+ * @returns the store the channel reads from.
109
+ */
110
+ export function createTeamRosterStore(ctx) {
111
+ const store = createSessionProjectionStore({
112
+ key: TEAM_PROJECTION_KEY,
113
+ // A team bundle switched off at run time takes the service down before
114
+ // (or while) its projection definition leaves: no service, no team.
115
+ narrow: (value, leadSessionId) => (ctx.get('agentTeams', false) === undefined ? undefined : asTeamView(value, leadSessionId)),
116
+ watch: session => teamRootOf(session, ctx.get('agents')),
117
+ warn: message => { ctx.logger.warn(message); },
118
+ });
119
+ attachSessionProjection(ctx, TEAM_PROJECTION_KEY, store);
120
+ // The plugin manager announces every profile write it applied (`/team`,
121
+ // `/plugin`, the Web UI). Unregistering a projection emits nothing on the
122
+ // change feed, so the bound session is read again: an unmounted team clears
123
+ // the view, a remounted one comes back from the Lead's log.
124
+ ctx.on('plugin-manager/changed', () => { store.reseed(); });
125
+ // Not every service change is announced there (an HMR-applied CLI or hand
126
+ // edit, a late or recovered activation), and the narrow reads the service:
127
+ // follow it directly. A service that comes back before its projection
128
+ // definition reads absent here; the manager event above reads it again.
129
+ ctx.on('internal/service', ((name) => {
130
+ if (name === 'agentTeams')
131
+ store.reseed();
132
+ }));
133
+ return Object.assign(store, {
134
+ teamOf: (sessionId) => (store.boundId === sessionId ? teamFor(store.read(), sessionId) : undefined),
135
+ });
136
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Compact cards for DSH's experimental Agent Teams tools. Their results are
3
+ * compact JSON records and the tools ship no presenters, so the plain card
4
+ * would show a capitalised tool id and a raw `⎿ {"messageId":…}` line. These
5
+ * views fold known shapes into one line; anything else (an error text, a
6
+ * changed upstream shape) falls back to the plain card. A presenter the tool
7
+ * itself registers always wins: these run only when it has none.
8
+ * `spawn_teammate` is not here — it renders as the subagent row, and as a
9
+ * plain card only when it fails before the teammate exists (translate.ts).
10
+ *
11
+ * Three names are shared with the legacy subagent controls, which also ship
12
+ * no presenters: a team call is told apart by its `target` argument (the
13
+ * legacy ones take `agent_id`), a team result by its record shape.
14
+ *
15
+ * {@link teamMessageOf} reads a delivered team message for the transcript
16
+ * translator.
17
+ *
18
+ * @module
19
+ */
20
+ import type { ToolCallView, ToolResultView } from './channel/types.js';
21
+ /** The team's own delegation tool; its presence is what "team on" means to a request. */
22
+ export declare const TEAM_SPAWN_TOOL = "spawn_teammate";
23
+ /** Whether `name` is a team tool with a compact card here (not `spawn_teammate`). */
24
+ export declare function isTeamToolName(name: string): boolean;
25
+ /**
26
+ * Call card for a team tool without its own presenter.
27
+ * @param name - Tool name.
28
+ * @param rawArgs - The call's JSON arguments.
29
+ * @returns the card, or `undefined` when this is not a team tool call it knows.
30
+ */
31
+ export declare function teamToolCallView(name: string, rawArgs: string): ToolCallView | undefined;
32
+ /**
33
+ * Result card for a team tool without its own presenter. It replaces the
34
+ * call card, so it carries the call's title too.
35
+ * @param name - Tool name.
36
+ * @param rawArgs - The call's JSON arguments.
37
+ * @param text - The result's text content.
38
+ * @returns the card, or `undefined` for anything but a known result record.
39
+ */
40
+ export declare function teamToolResultView(name: string, rawArgs: string, text: string): ToolResultView | undefined;
41
+ /**
42
+ * An Agent Teams message delivered to a session (`user/message`): the
43
+ * generic relay (`agent-message` / `relay`) whose first block is exactly
44
+ * `Team message from <name>:`. A relay is any agent's message (the legacy
45
+ * `send_message` writes one too), so only the team's framing block marks it
46
+ * as a team message; the sender label replaces that block. The relay also
47
+ * reaches the agent-message feed, which owns it on a teammate's own pages;
48
+ * this reading is for the receiving transcript. A 0.2.0 log is read through
49
+ * `compat/agent-team-0.2.0.ts` first.
50
+ */
51
+ export declare function teamMessageOf<B extends {
52
+ readonly type: string;
53
+ }>(source: unknown, content: readonly B[]): {
54
+ sender: string;
55
+ blocks: readonly B[];
56
+ text: string;
57
+ } | undefined;
58
+ //# sourceMappingURL=team-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team-tools.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/team-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAgBtE,yFAAyF;AACzF,eAAO,MAAM,eAAe,mBAAmB,CAAA;AAE/C,qFAAqF;AACrF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AA4CD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAKxF;AAmDD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAa1G;AAKD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAgB7K"}