dsh-botgroup 0.7.2 → 0.7.3

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 (402) hide show
  1. package/README.en.md +13 -7
  2. package/README.md +13 -7
  3. package/lib/client.js +8806 -7597
  4. package/lib/client.js.map +4 -4
  5. package/lib/host/activity/first-user.js +1 -1
  6. package/lib/host/activity/preview.js +1 -1
  7. package/lib/host/activity/remote.js +1 -1
  8. package/lib/host/activity/tracker.js +1 -1
  9. package/lib/host/automation/coordinator.js +1 -1
  10. package/lib/host/automation/delivery.js +1 -1
  11. package/lib/host/automation/errors.js +1 -1
  12. package/lib/host/automation/index.js +1 -1
  13. package/lib/host/automation/remote.js +1 -1
  14. package/lib/host/automation/store.js +1 -1
  15. package/lib/host/bot-context.js +44 -15
  16. package/lib/host/bot-context.js.map +1 -1
  17. package/lib/host/capabilities/platform.js +1 -1
  18. package/lib/host/capabilities/remote.js +1 -1
  19. package/lib/host/capabilities/service.js +1 -1
  20. package/lib/host/collaboration/remote.js +1 -1
  21. package/lib/host/collaboration/service.js +1 -1
  22. package/lib/host/common/integration-stores.js +1 -1
  23. package/lib/host/common/native-ambient-source.js +1 -1
  24. package/lib/host/common/operations.js +1 -1
  25. package/lib/host/common/subagent-activation.js +1 -1
  26. package/lib/host/composer.js +1 -1
  27. package/lib/host/connectors/remote.js +1 -1
  28. package/lib/host/connectors/service.js +1 -1
  29. package/lib/host/data-flow/agent-binding.js +1 -1
  30. package/lib/host/data-flow/connector-boundary.js +1 -1
  31. package/lib/host/data-flow/delegation.js +1 -1
  32. package/lib/host/data-flow/egress.js +1 -1
  33. package/lib/host/data-flow/grants.js +1 -1
  34. package/lib/host/data-flow/graph-capability.js +1 -1
  35. package/lib/host/data-flow/labels.js +1 -1
  36. package/lib/host/data-flow/lineage.js +1 -1
  37. package/lib/host/data-flow/managed-copies.d.ts +2 -0
  38. package/lib/host/data-flow/managed-copies.js +1 -1
  39. package/lib/host/data-flow/native-policy.js +1 -1
  40. package/lib/host/data-flow/outlets.d.ts +4 -1
  41. package/lib/host/data-flow/outlets.js +21 -3
  42. package/lib/host/data-flow/outlets.js.map +1 -1
  43. package/lib/host/data-flow/tool-guard.js +1 -1
  44. package/lib/host/delegate/continuation.js +1 -1
  45. package/lib/host/delegate/guard.js +1 -1
  46. package/lib/host/delegate/tool.js +3 -2
  47. package/lib/host/delegate/tool.js.map +1 -1
  48. package/lib/host/errors.js +1 -1
  49. package/lib/host/groups/concurrent.js +26 -8
  50. package/lib/host/groups/concurrent.js.map +1 -1
  51. package/lib/host/groups/context-flow.js +1 -1
  52. package/lib/host/groups/data-flow.d.ts +7 -2
  53. package/lib/host/groups/data-flow.js +29 -6
  54. package/lib/host/groups/data-flow.js.map +1 -1
  55. package/lib/host/groups/deletion.d.ts +15 -0
  56. package/lib/host/groups/deletion.js +200 -0
  57. package/lib/host/groups/deletion.js.map +1 -0
  58. package/lib/host/groups/export-pending.js +1 -1
  59. package/lib/host/groups/export-review.d.ts +3 -2
  60. package/lib/host/groups/export-review.js +26 -8
  61. package/lib/host/groups/export-review.js.map +1 -1
  62. package/lib/host/groups/export-settings.js +1 -1
  63. package/lib/host/groups/failure.js +1 -1
  64. package/lib/host/groups/guest-question.d.ts +13 -0
  65. package/lib/host/groups/guest-question.js +54 -0
  66. package/lib/host/groups/guest-question.js.map +1 -0
  67. package/lib/host/groups/members.js +3 -1
  68. package/lib/host/groups/members.js.map +1 -1
  69. package/lib/host/groups/memory-status.js +1 -1
  70. package/lib/host/groups/messages.d.ts +58 -0
  71. package/lib/host/groups/messages.js +23 -5
  72. package/lib/host/groups/messages.js.map +1 -1
  73. package/lib/host/groups/model-selection.js +1 -1
  74. package/lib/host/groups/model.d.ts +46 -4
  75. package/lib/host/groups/model.js +6 -8
  76. package/lib/host/groups/model.js.map +1 -1
  77. package/lib/host/groups/owner-follow-up.js +1 -1
  78. package/lib/host/groups/recall-sessions.js +1 -1
  79. package/lib/host/groups/recall-tool.js +1 -1
  80. package/lib/host/groups/recall.js +1 -1
  81. package/lib/host/groups/relay-answer.d.ts +35 -0
  82. package/lib/host/groups/relay-answer.js +61 -0
  83. package/lib/host/groups/relay-answer.js.map +1 -0
  84. package/lib/host/groups/relay-details.d.ts +6 -0
  85. package/lib/host/groups/relay-details.js +133 -0
  86. package/lib/host/groups/relay-details.js.map +1 -0
  87. package/lib/host/groups/relay-receipts.d.ts +9 -0
  88. package/lib/host/groups/relay-receipts.js +87 -0
  89. package/lib/host/groups/relay-receipts.js.map +1 -0
  90. package/lib/host/groups/relay-recovery.d.ts +4 -0
  91. package/lib/host/groups/relay-recovery.js +82 -0
  92. package/lib/host/groups/relay-recovery.js.map +1 -0
  93. package/lib/host/groups/remote.d.ts +116 -0
  94. package/lib/host/groups/remote.js +17 -1
  95. package/lib/host/groups/remote.js.map +1 -1
  96. package/lib/host/groups/root-guard.js +1 -1
  97. package/lib/host/groups/roots.js +18 -3
  98. package/lib/host/groups/roots.js.map +1 -1
  99. package/lib/host/groups/round-robin.js +1 -1
  100. package/lib/host/groups/routing.d.ts +6 -2
  101. package/lib/host/groups/routing.js +33 -7
  102. package/lib/host/groups/routing.js.map +1 -1
  103. package/lib/host/groups/service.d.ts +297 -0
  104. package/lib/host/groups/service.js +58 -30
  105. package/lib/host/groups/service.js.map +1 -1
  106. package/lib/host/groups/state.d.ts +97 -2
  107. package/lib/host/groups/state.js +3 -1
  108. package/lib/host/groups/state.js.map +1 -1
  109. package/lib/host/groups/supergroup-admission.js +1 -1
  110. package/lib/host/groups/team-recipes.js +1 -1
  111. package/lib/host/groups/turn-runner.d.ts +30 -1
  112. package/lib/host/groups/turn-runner.js +61 -40
  113. package/lib/host/groups/turn-runner.js.map +1 -1
  114. package/lib/host/groups/turns.d.ts +233 -0
  115. package/lib/host/groups/turns.js +144 -33
  116. package/lib/host/groups/turns.js.map +1 -1
  117. package/lib/host/groups/worker-capabilities.d.ts +9 -0
  118. package/lib/host/groups/worker-capabilities.js +56 -0
  119. package/lib/host/groups/worker-capabilities.js.map +1 -0
  120. package/lib/host/groups/worker-tool.d.ts +10 -1
  121. package/lib/host/groups/worker-tool.js +46 -18
  122. package/lib/host/groups/worker-tool.js.map +1 -1
  123. package/lib/host/home.js +1 -1
  124. package/lib/host/im/service.js +1 -1
  125. package/lib/host/index.js +1 -1
  126. package/lib/host/live-persona.js +1 -1
  127. package/lib/host/main-session.js +1 -1
  128. package/lib/host/memory/admission.js +1 -1
  129. package/lib/host/memory/auto-share.js +1 -1
  130. package/lib/host/memory/confirmation.js +1 -1
  131. package/lib/host/memory/conflicts.js +1 -1
  132. package/lib/host/memory/consolidation-config.js +1 -1
  133. package/lib/host/memory/consolidation-native.js +1 -1
  134. package/lib/host/memory/consolidation-source.js +1 -1
  135. package/lib/host/memory/consolidation.js +1 -1
  136. package/lib/host/memory/context.js +1 -1
  137. package/lib/host/memory/domain-v2.js +1 -1
  138. package/lib/host/memory/facade.js +1 -1
  139. package/lib/host/memory/forget-preview.js +1 -1
  140. package/lib/host/memory/forget-runner.js +1 -1
  141. package/lib/host/memory/forget-service.js +1 -1
  142. package/lib/host/memory/history-proof.js +1 -1
  143. package/lib/host/memory/history.js +1 -1
  144. package/lib/host/memory/layout-upgrade.js +1 -1
  145. package/lib/host/memory/migration.js +1 -1
  146. package/lib/host/memory/op-log.js +1 -1
  147. package/lib/host/memory/open-v2.js +1 -1
  148. package/lib/host/memory/owner-lease.js +1 -1
  149. package/lib/host/memory/persistent-map.js +1 -1
  150. package/lib/host/memory/port.d.ts +1 -1
  151. package/lib/host/memory/port.js +1 -1
  152. package/lib/host/memory/preserve-inbox.js +1 -1
  153. package/lib/host/memory/projection.js +1 -1
  154. package/lib/host/memory/prompt.js +1 -1
  155. package/lib/host/memory/query.js +1 -1
  156. package/lib/host/memory/quota-replay.js +1 -1
  157. package/lib/host/memory/quota.js +1 -1
  158. package/lib/host/memory/remote.js +1 -1
  159. package/lib/host/memory/retrieval-config.js +1 -1
  160. package/lib/host/memory/retrieval-rank.js +1 -1
  161. package/lib/host/memory/retrieval-text.js +1 -1
  162. package/lib/host/memory/root-instructions.js +1 -1
  163. package/lib/host/memory/secrets.js +1 -1
  164. package/lib/host/memory/service.d.ts +3 -2
  165. package/lib/host/memory/service.js +10 -13
  166. package/lib/host/memory/service.js.map +1 -1
  167. package/lib/host/memory/shards.js +1 -1
  168. package/lib/host/memory/store-v2.d.ts +1 -1
  169. package/lib/host/memory/store-v2.js +3 -3
  170. package/lib/host/memory/store-v2.js.map +1 -1
  171. package/lib/host/memory/temporal.d.ts +1 -0
  172. package/lib/host/memory/temporal.js +5 -1
  173. package/lib/host/memory/temporal.js.map +1 -1
  174. package/lib/host/memory/tool-guidance.js +1 -1
  175. package/lib/host/memory/tools.d.ts +1 -1
  176. package/lib/host/memory/tools.js +14 -6
  177. package/lib/host/memory/tools.js.map +1 -1
  178. package/lib/host/memory/trusted-ingress.js +1 -1
  179. package/lib/host/memory/version.js +1 -1
  180. package/lib/host/messaging/config.js +1 -1
  181. package/lib/host/messaging/core.d.ts +2 -0
  182. package/lib/host/messaging/core.js +1 -1
  183. package/lib/host/messaging/delivery.js +1 -1
  184. package/lib/host/messaging/display-turn.js +1 -1
  185. package/lib/host/messaging/evidence.js +1 -1
  186. package/lib/host/messaging/interrupt.js +1 -1
  187. package/lib/host/messaging/peer-result.js +3 -2
  188. package/lib/host/messaging/peer-result.js.map +1 -1
  189. package/lib/host/messaging/recovery.js +1 -1
  190. package/lib/host/messaging/remote.js +1 -1
  191. package/lib/host/messaging/reply-routing.js +1 -1
  192. package/lib/host/messaging/result-recall.js +38 -22
  193. package/lib/host/messaging/result-recall.js.map +1 -1
  194. package/lib/host/messaging/safety.js +16 -32
  195. package/lib/host/messaging/safety.js.map +1 -1
  196. package/lib/host/messaging/scoped-projection.d.ts +3 -0
  197. package/lib/host/messaging/scoped-projection.js +12 -5
  198. package/lib/host/messaging/scoped-projection.js.map +1 -1
  199. package/lib/host/messaging/service.js +1 -1
  200. package/lib/host/messaging/store.d.ts +8 -0
  201. package/lib/host/messaging/store.js +1 -1
  202. package/lib/host/messaging/tool.js +3 -2
  203. package/lib/host/messaging/tool.js.map +1 -1
  204. package/lib/host/messaging/wake.js +1 -1
  205. package/lib/host/native-schedule/outcomes.js +1 -1
  206. package/lib/host/native-schedule/service.js +1 -1
  207. package/lib/host/notifications/data-flow.js +1 -1
  208. package/lib/host/notifications/remote.js +1 -1
  209. package/lib/host/notifications/service.js +1 -1
  210. package/lib/host/notifications/time.js +1 -1
  211. package/lib/host/notifications/tool.js +1 -1
  212. package/lib/host/onboarding/coordinator.js +1 -1
  213. package/lib/host/onboarding/guard.js +1 -1
  214. package/lib/host/proactive/auto-admission.js +1 -1
  215. package/lib/host/proactive/config.js +1 -1
  216. package/lib/host/proactive/coordinator-client.js +1 -1
  217. package/lib/host/proactive/deferred-notices.js +1 -1
  218. package/lib/host/proactive/execution-prompt.js +1 -1
  219. package/lib/host/proactive/execution.js +1 -1
  220. package/lib/host/proactive/executors/command.js +1 -1
  221. package/lib/host/proactive/executors/json-command-bridge-entry.js +1 -1
  222. package/lib/host/proactive/executors/json-command-bridge.js +1 -1
  223. package/lib/host/proactive/executors/loopback.js +1 -1
  224. package/lib/host/proactive/feedback-workflow.js +1 -1
  225. package/lib/host/proactive/feedback.js +1 -1
  226. package/lib/host/proactive/follow-up-events.js +1 -1
  227. package/lib/host/proactive/follow-up-facts.js +1 -1
  228. package/lib/host/proactive/follow-up-tool.js +3 -2
  229. package/lib/host/proactive/follow-up-tool.js.map +1 -1
  230. package/lib/host/proactive/governance-artifacts.js +1 -1
  231. package/lib/host/proactive/governance-service.js +1 -1
  232. package/lib/host/proactive/group-budget.js +1 -1
  233. package/lib/host/proactive/group-follow-up.js +1 -1
  234. package/lib/host/proactive/group-repair.js +1 -1
  235. package/lib/host/proactive/index.js +1 -1
  236. package/lib/host/proactive/lifecycle.js +1 -1
  237. package/lib/host/proactive/method-evaluation.js +1 -1
  238. package/lib/host/proactive/method-package.js +1 -1
  239. package/lib/host/proactive/method-skill.js +1 -1
  240. package/lib/host/proactive/model-budget.js +1 -1
  241. package/lib/host/proactive/notice-pump.js +1 -1
  242. package/lib/host/proactive/notification-bridge.js +1 -1
  243. package/lib/host/proactive/read-query.js +1 -1
  244. package/lib/host/proactive/remote.js +1 -1
  245. package/lib/host/proactive/repair.js +1 -1
  246. package/lib/host/proactive/result-journal.js +1 -1
  247. package/lib/host/proactive/service.js +1 -1
  248. package/lib/host/proactive/session-history.js +1 -1
  249. package/lib/host/proactive/setup.js +1 -1
  250. package/lib/host/proactive/sources/ci-feed.js +1 -1
  251. package/lib/host/proactive/sources/ci.js +1 -1
  252. package/lib/host/proactive/sources/github-ci.js +1 -1
  253. package/lib/host/proactive/task-cost.js +1 -1
  254. package/lib/host/proactive/wire.js +1 -1
  255. package/lib/host/proactive/work-continuation.js +1 -1
  256. package/lib/host/proactive/workspace-process.js +1 -1
  257. package/lib/host/proactive/workspace-repair.js +1 -1
  258. package/lib/host/reference-memory/backend.js +1 -1
  259. package/lib/host/reference-memory/cleanup-files.js +1 -1
  260. package/lib/host/reference-memory/copies.js +1 -1
  261. package/lib/host/reference-memory/files.js +1 -1
  262. package/lib/host/reference-memory/model.js +1 -1
  263. package/lib/host/reference-memory/service.js +1 -1
  264. package/lib/host/reference-memory/writer.js +1 -1
  265. package/lib/host/registry/identity.js +1 -1
  266. package/lib/host/registry/lifecycle.js +1 -1
  267. package/lib/host/registry/mutations.js +1 -1
  268. package/lib/host/registry/presets.js +1 -1
  269. package/lib/host/registry/types.js +1 -1
  270. package/lib/host/registry-config.js +1 -1
  271. package/lib/host/registry.js +1 -1
  272. package/lib/host/shadow/budget.js +1 -1
  273. package/lib/host/shadow/config.js +1 -1
  274. package/lib/host/shadow/notification-adapter.js +1 -1
  275. package/lib/host/shadow/planner.js +1 -1
  276. package/lib/host/shadow/schedule-adapter.js +1 -1
  277. package/lib/host/shadow/service.js +1 -1
  278. package/lib/host/store.js +1 -1
  279. package/lib/host/stores/activity.js +1 -1
  280. package/lib/host/stores/bots.js +1 -1
  281. package/lib/host/stores/domain.js +1 -1
  282. package/lib/host/stores/memory.js +1 -1
  283. package/lib/host/supergroup/collaboration.js +4 -2
  284. package/lib/host/supergroup/collaboration.js.map +1 -1
  285. package/lib/host/supergroup/config.js +1 -1
  286. package/lib/host/supergroup/input-capability.js +1 -1
  287. package/lib/host/supergroup/peer-task.js +1 -1
  288. package/lib/host/supergroup/recovery-view.js +1 -1
  289. package/lib/host/supergroup/remote.d.ts +96 -0
  290. package/lib/host/supergroup/remote.js +1 -1
  291. package/lib/host/supergroup/service.d.ts +24 -0
  292. package/lib/host/supergroup/service.js +1 -1
  293. package/lib/host/supergroup/task-support.js +1 -1
  294. package/lib/host/supergroup/tool.js +1 -1
  295. package/lib/host/tools/bot-manage.js +13 -9
  296. package/lib/host/tools/bot-manage.js.map +1 -1
  297. package/lib/host/workspace/remote.js +1 -1
  298. package/lib/host/workspace/service.js +1 -1
  299. package/lib/index.d.ts +1 -1
  300. package/lib/index.js +1 -1
  301. package/lib/module-manifest.json +303 -292
  302. package/lib/proactive-coordinator/main.mjs +15 -0
  303. package/lib/proactive-coordinator/provenance.json +1 -1
  304. package/lib/shared/activity-preview.js +1 -1
  305. package/lib/shared/activity.js +1 -1
  306. package/lib/shared/addressed-bot.d.ts +30 -0
  307. package/lib/shared/addressed-bot.js +98 -0
  308. package/lib/shared/addressed-bot.js.map +1 -0
  309. package/lib/shared/automation-contract.js +1 -1
  310. package/lib/shared/automation.js +1 -1
  311. package/lib/shared/bot-brand.js +1 -1
  312. package/lib/shared/capabilities-contract.js +1 -1
  313. package/lib/shared/collaboration-contract.js +1 -1
  314. package/lib/shared/collaboration.js +1 -1
  315. package/lib/shared/connectors.js +1 -1
  316. package/lib/shared/data-flow.js +1 -1
  317. package/lib/shared/eval-budget.js +1 -1
  318. package/lib/shared/group-export-review.js +2 -2
  319. package/lib/shared/group-export-review.js.map +1 -1
  320. package/lib/shared/group-limits.js +1 -1
  321. package/lib/shared/group-memory-intent.d.ts +57 -0
  322. package/lib/shared/group-memory-intent.js +20 -0
  323. package/lib/shared/group-memory-intent.js.map +1 -0
  324. package/lib/shared/group-mentions.d.ts +20 -0
  325. package/lib/shared/group-mentions.js +62 -0
  326. package/lib/shared/group-mentions.js.map +1 -0
  327. package/lib/shared/group-recall-reads.js +1 -1
  328. package/lib/shared/group-recall.js +1 -1
  329. package/lib/shared/group-relay-details.d.ts +62 -0
  330. package/lib/shared/group-relay-details.js +16 -0
  331. package/lib/shared/group-relay-details.js.map +1 -0
  332. package/lib/shared/groups-contract.d.ts +577 -0
  333. package/lib/shared/groups-contract.js +8 -1
  334. package/lib/shared/groups-contract.js.map +1 -1
  335. package/lib/shared/groups.d.ts +65 -0
  336. package/lib/shared/groups.js +14 -1
  337. package/lib/shared/groups.js.map +1 -1
  338. package/lib/shared/identity.d.ts +1 -0
  339. package/lib/shared/identity.js +7 -1
  340. package/lib/shared/identity.js.map +1 -1
  341. package/lib/shared/ids.js +1 -1
  342. package/lib/shared/integrations-contract.js +1 -1
  343. package/lib/shared/integrations.js +1 -1
  344. package/lib/shared/managed-flow.js +1 -1
  345. package/lib/shared/memory-consolidation.js +1 -1
  346. package/lib/shared/memory-forget.js +1 -1
  347. package/lib/shared/memory-management.js +1 -1
  348. package/lib/shared/memory-ops.js +1 -1
  349. package/lib/shared/memory-tool-names.js +1 -1
  350. package/lib/shared/memory-v2.js +1 -1
  351. package/lib/shared/messaging-contract.js +1 -1
  352. package/lib/shared/messaging.d.ts +4 -0
  353. package/lib/shared/messaging.js +2 -1
  354. package/lib/shared/messaging.js.map +1 -1
  355. package/lib/shared/native-schedule.js +1 -1
  356. package/lib/shared/notifications.js +1 -1
  357. package/lib/shared/onboarding-source.js +1 -1
  358. package/lib/shared/onboarding.js +1 -1
  359. package/lib/shared/operation-errors.d.ts +7 -0
  360. package/lib/shared/operation-errors.js +8 -1
  361. package/lib/shared/operation-errors.js.map +1 -1
  362. package/lib/shared/proactive/activity.js +1 -1
  363. package/lib/shared/proactive/document.js +1 -1
  364. package/lib/shared/proactive/feedback.js +1 -1
  365. package/lib/shared/proactive/follow-up.js +1 -1
  366. package/lib/shared/proactive/governance.js +1 -1
  367. package/lib/shared/proactive/group-follow-up.js +1 -1
  368. package/lib/shared/proactive/group-repair.js +1 -1
  369. package/lib/shared/proactive/handoff.js +1 -1
  370. package/lib/shared/proactive/method-evaluation.js +1 -1
  371. package/lib/shared/proactive/method-package.js +1 -1
  372. package/lib/shared/proactive/notices.js +1 -1
  373. package/lib/shared/proactive/outcomes.js +1 -1
  374. package/lib/shared/proactive/protocol.js +1 -1
  375. package/lib/shared/proactive/remote-contract.js +1 -1
  376. package/lib/shared/proactive/repair.js +1 -1
  377. package/lib/shared/proactive/responsibility.js +1 -1
  378. package/lib/shared/proactive/setup.js +1 -1
  379. package/lib/shared/proactive/work-progress.js +1 -1
  380. package/lib/shared/proactive/work.js +1 -1
  381. package/lib/shared/proactive/workspace-repair.js +1 -1
  382. package/lib/shared/reference-memory.js +1 -1
  383. package/lib/shared/remote-contract.js +1 -1
  384. package/lib/shared/routine-outcomes.js +1 -1
  385. package/lib/shared/schema.js +1 -1
  386. package/lib/shared/secrets.js +1 -1
  387. package/lib/shared/shadow.js +1 -1
  388. package/lib/shared/supergroup-contract.d.ts +300 -0
  389. package/lib/shared/supergroup-contract.js +1 -1
  390. package/lib/shared/supergroup.d.ts +54 -0
  391. package/lib/shared/supergroup.js +1 -1
  392. package/lib/shared/task-materials.js +1 -1
  393. package/lib/shared/team-recipes.js +1 -1
  394. package/lib/shared/version.d.ts +1 -1
  395. package/lib/shared/version.js +2 -2
  396. package/lib/shared/workspace-contract.js +1 -1
  397. package/lib/shared/workspace.js +1 -1
  398. package/lib/typert.host.js +1 -1
  399. package/lib/typert.remote-client.js +1 -1
  400. package/locale/en.json +90 -2
  401. package/locale/zh.json +90 -2
  402. package/package.json +1 -1
@@ -3,6 +3,7 @@ import type { Context } from '@deepseek-ai/cordis';
3
3
  import type { Domain } from '@deepseek-ai/dsh-storage-domain';
4
4
  import type { DshBotRegistry } from '../registry.js';
5
5
  import { type groupsDomain } from './model.js';
6
+ import type { RelayDetailsRequest } from '../../shared/group-relay-details.js';
6
7
  import { GroupRoots } from './roots.js';
7
8
  import { TeamRecipes } from './team-recipes.js';
8
9
  import { GroupMembers } from './members.js';
@@ -24,6 +25,7 @@ export interface GroupFactPage {
24
25
  export declare class Groups {
25
26
  private state;
26
27
  private roots;
28
+ private deletion;
27
29
  private membership;
28
30
  readonly teamRecipes: TeamRecipes;
29
31
  readonly exportReview: GroupExportReview;
@@ -43,6 +45,7 @@ export declare class Groups {
43
45
  sessionId: string;
44
46
  workspaceId: string;
45
47
  }>;
48
+ deleteGroup(key: GroupKey, expectedRevision: number): Promise<boolean>;
46
49
  create(value: unknown): Promise<{
47
50
  id: string;
48
51
  operationId: string;
@@ -412,6 +415,23 @@ export declare class Groups {
412
415
  cardId: string;
413
416
  cardRevision: number;
414
417
  } | undefined;
418
+ guestQuestion?: {
419
+ bot: {
420
+ botId: string;
421
+ botCreatedAt: number;
422
+ };
423
+ name: string;
424
+ via?: {
425
+ bot: {
426
+ botId: string;
427
+ botCreatedAt: number;
428
+ };
429
+ name: string;
430
+ memberId: string;
431
+ botRevision: number;
432
+ presetId: string;
433
+ } | undefined;
434
+ } | undefined;
415
435
  proactive?: {
416
436
  ticketId: string;
417
437
  assignmentId: string;
@@ -783,6 +803,23 @@ export declare class Groups {
783
803
  cardId: string;
784
804
  cardRevision: number;
785
805
  } | undefined;
806
+ guestQuestion?: {
807
+ bot: {
808
+ botId: string;
809
+ botCreatedAt: number;
810
+ };
811
+ name: string;
812
+ via?: {
813
+ bot: {
814
+ botId: string;
815
+ botCreatedAt: number;
816
+ };
817
+ name: string;
818
+ memberId: string;
819
+ botRevision: number;
820
+ presetId: string;
821
+ } | undefined;
822
+ } | undefined;
786
823
  proactive?: {
787
824
  ticketId: string;
788
825
  assignmentId: string;
@@ -872,6 +909,9 @@ export declare class Groups {
872
909
  revision?: number | undefined;
873
910
  updatedAt?: number | undefined;
874
911
  automatic?: boolean | undefined;
912
+ acceptedAt?: number | undefined;
913
+ answeredAt?: number | undefined;
914
+ relayAnswerFlowId?: string | undefined;
875
915
  startedAt?: number | undefined;
876
916
  endedAt?: number | undefined;
877
917
  nativeRunId?: string | undefined;
@@ -896,6 +936,7 @@ export declare class Groups {
896
936
  requestId?: string | undefined;
897
937
  status?: number | undefined;
898
938
  } | undefined;
939
+ relayMarker?: "unavailable" | "unconfirmed" | undefined;
899
940
  staleExportClosedAt?: number | undefined;
900
941
  }[];
901
942
  messages: {
@@ -941,6 +982,8 @@ export declare class Groups {
941
982
  avatarColor?: "--dsw-alias-state-business-primary" | "--dsw-alias-state-success-primary" | "--dsw-alias-state-warn-label" | "--dsw-alias-state-error-primary" | "teal" | "cyan" | "indigo" | "purple" | "rose" | "orange" | "olive" | "slate" | undefined;
942
983
  avatarVariant?: "classic" | "glasses" | "spout" | "baby" | "hat" | "sleeping" | "auto" | undefined;
943
984
  } | undefined;
985
+ guestReply?: true | undefined;
986
+ relayReply?: true | undefined;
944
987
  childSessionId?: string | undefined;
945
988
  stopReason?: string | undefined;
946
989
  failure?: {
@@ -967,6 +1010,7 @@ export declare class Groups {
967
1010
  } | undefined;
968
1011
  } | undefined;
969
1012
  reason?: "recovery-needed" | "root-owned-elsewhere" | "root-unavailable" | undefined;
1013
+ memberLimit?: number | undefined;
970
1014
  }>;
971
1015
  recall(...args: Parameters<GroupRecall['query']>): Promise<{
972
1016
  items: {
@@ -997,6 +1041,28 @@ export declare class Groups {
997
1041
  }>;
998
1042
  validateRecall(...args: Parameters<GroupRecall['validate']>): Promise<boolean>;
999
1043
  validateRecallReferences(...args: Parameters<GroupRecall['validateReferences']>): Promise<boolean>;
1044
+ relayDetails(request: RelayDetailsRequest, signal?: AbortSignal): Promise<{
1045
+ sender: string;
1046
+ guest: string;
1047
+ question?: {
1048
+ state: "readable";
1049
+ text: string;
1050
+ } | {
1051
+ state: "pending" | "unavailable" | "restricted";
1052
+ } | undefined;
1053
+ answer?: {
1054
+ state: "readable";
1055
+ text: string;
1056
+ } | {
1057
+ state: "pending" | "unavailable" | "restricted";
1058
+ } | undefined;
1059
+ report?: {
1060
+ state: "readable";
1061
+ text: string;
1062
+ } | {
1063
+ state: "pending" | "unavailable" | "restricted";
1064
+ } | undefined;
1065
+ }>;
1000
1066
  followUpSubject(key: GroupKey): Promise<{
1001
1067
  id: string;
1002
1068
  operationId: string;
@@ -1090,6 +1156,134 @@ export declare class Groups {
1090
1156
  }[];
1091
1157
  next?: GroupFactPage;
1092
1158
  }>;
1159
+ sendOwner(key: GroupKey, value: unknown): Promise<{
1160
+ id: string;
1161
+ group: {
1162
+ groupId: string;
1163
+ groupCreatedAt: number;
1164
+ };
1165
+ operationId: string;
1166
+ requestDigest: string;
1167
+ inputMessageId: string;
1168
+ createdAt: number;
1169
+ updatedAt: number;
1170
+ revision: number;
1171
+ schemaVersion: 1;
1172
+ membershipRevision: number;
1173
+ orderedMemberIds: string[];
1174
+ mode: "natural" | "mention" | "round-robin";
1175
+ contextThroughSeq: number;
1176
+ state: "running" | "completed" | "cancelled" | "accepted" | "recovery_needed" | "idle" | "paused" | "partial";
1177
+ inputFlowId?: string | undefined;
1178
+ inputFlowSessionId?: string | undefined;
1179
+ ownerFollowUp?: {
1180
+ predecessorTurnId: string;
1181
+ predecessorTurnRevision: number;
1182
+ membershipRevision: number;
1183
+ modelRevision: number;
1184
+ memberId: string;
1185
+ bot: {
1186
+ botId: string;
1187
+ botCreatedAt: number;
1188
+ };
1189
+ botRevision: number;
1190
+ modelSelection: {
1191
+ provider: string;
1192
+ model: string;
1193
+ reasoningEffort?: string | undefined;
1194
+ };
1195
+ cardId: string;
1196
+ cardRevision: number;
1197
+ } | undefined;
1198
+ guestQuestion?: {
1199
+ bot: {
1200
+ botId: string;
1201
+ botCreatedAt: number;
1202
+ };
1203
+ name: string;
1204
+ via?: {
1205
+ bot: {
1206
+ botId: string;
1207
+ botCreatedAt: number;
1208
+ };
1209
+ name: string;
1210
+ memberId: string;
1211
+ botRevision: number;
1212
+ presetId: string;
1213
+ } | undefined;
1214
+ } | undefined;
1215
+ proactive?: {
1216
+ ticketId: string;
1217
+ assignmentId: string;
1218
+ provider: string;
1219
+ model: string;
1220
+ botRevisions: [number, number] | [number];
1221
+ memberModels?: {
1222
+ memberId: string;
1223
+ modelSelection: {
1224
+ provider: string;
1225
+ model: string;
1226
+ reasoningEffort?: string | undefined;
1227
+ };
1228
+ }[] | undefined;
1229
+ modelRevision?: number | undefined;
1230
+ followUp?: {
1231
+ predecessorTurnId: string;
1232
+ factId: string;
1233
+ } | undefined;
1234
+ requestBudget?: {
1235
+ maxTokens: number;
1236
+ outputTokens: number;
1237
+ deadlineAt: string;
1238
+ } | undefined;
1239
+ repair?: {
1240
+ phase: "plan" | "implement" | "review";
1241
+ maxTokens: number;
1242
+ outputTokens: number;
1243
+ deadlineAt: string;
1244
+ predecessorTurnId?: string | undefined;
1245
+ } | undefined;
1246
+ } | undefined;
1247
+ inputSeq?: number | undefined;
1248
+ routing?: {
1249
+ strategy: "explicit" | "legacy" | "local-role" | "fallback";
1250
+ version: 1;
1251
+ candidateMemberIds: string[];
1252
+ selectedMemberIds: string[];
1253
+ reason: "failed" | "disabled" | "mode" | "mention" | "reply" | "round" | "role-match" | "no-match";
1254
+ deciderCalls: 0;
1255
+ plannedCalls: number;
1256
+ modelRequests?: number | undefined;
1257
+ } | undefined;
1258
+ modelSelection?: {
1259
+ provider: string;
1260
+ model: string;
1261
+ reasoningEffort?: string | undefined;
1262
+ } | undefined;
1263
+ memberModelSelections?: {
1264
+ memberId: string;
1265
+ modelSelection: {
1266
+ provider: string;
1267
+ model: string;
1268
+ reasoningEffort?: string | undefined;
1269
+ };
1270
+ }[] | undefined;
1271
+ predecessorTurnIds?: string[] | undefined;
1272
+ followups?: {
1273
+ operationId: string;
1274
+ requestDigest: string;
1275
+ deliveryId: string;
1276
+ messageId: string;
1277
+ state: "unknown" | "accepted" | "dispatching";
1278
+ childMessageId?: string | undefined;
1279
+ }[] | undefined;
1280
+ replyTo?: string | undefined;
1281
+ protocol?: 2 | undefined;
1282
+ memoryStatusOnly?: true | undefined;
1283
+ automaticExecutions?: number | undefined;
1284
+ continuationAllowance?: number | undefined;
1285
+ stoppedMemberIds?: string[] | undefined;
1286
+ }>;
1093
1287
  send(...args: Parameters<GroupTurns['send']>): Promise<{
1094
1288
  id: string;
1095
1289
  group: {
@@ -1129,6 +1323,23 @@ export declare class Groups {
1129
1323
  cardId: string;
1130
1324
  cardRevision: number;
1131
1325
  } | undefined;
1326
+ guestQuestion?: {
1327
+ bot: {
1328
+ botId: string;
1329
+ botCreatedAt: number;
1330
+ };
1331
+ name: string;
1332
+ via?: {
1333
+ bot: {
1334
+ botId: string;
1335
+ botCreatedAt: number;
1336
+ };
1337
+ name: string;
1338
+ memberId: string;
1339
+ botRevision: number;
1340
+ presetId: string;
1341
+ } | undefined;
1342
+ } | undefined;
1132
1343
  proactive?: {
1133
1344
  ticketId: string;
1134
1345
  assignmentId: string;
@@ -1240,6 +1451,23 @@ export declare class Groups {
1240
1451
  cardId: string;
1241
1452
  cardRevision: number;
1242
1453
  } | undefined;
1454
+ guestQuestion?: {
1455
+ bot: {
1456
+ botId: string;
1457
+ botCreatedAt: number;
1458
+ };
1459
+ name: string;
1460
+ via?: {
1461
+ bot: {
1462
+ botId: string;
1463
+ botCreatedAt: number;
1464
+ };
1465
+ name: string;
1466
+ memberId: string;
1467
+ botRevision: number;
1468
+ presetId: string;
1469
+ } | undefined;
1470
+ } | undefined;
1243
1471
  proactive?: {
1244
1472
  ticketId: string;
1245
1473
  assignmentId: string;
@@ -1368,6 +1596,23 @@ export declare class Groups {
1368
1596
  cardId: string;
1369
1597
  cardRevision: number;
1370
1598
  } | undefined;
1599
+ guestQuestion?: {
1600
+ bot: {
1601
+ botId: string;
1602
+ botCreatedAt: number;
1603
+ };
1604
+ name: string;
1605
+ via?: {
1606
+ bot: {
1607
+ botId: string;
1608
+ botCreatedAt: number;
1609
+ };
1610
+ name: string;
1611
+ memberId: string;
1612
+ botRevision: number;
1613
+ presetId: string;
1614
+ } | undefined;
1615
+ } | undefined;
1371
1616
  proactive?: {
1372
1617
  ticketId: string;
1373
1618
  assignmentId: string;
@@ -1444,6 +1689,7 @@ export declare class Groups {
1444
1689
  abandonOwnerFollowUp<T>(key: GroupKey, operationId: string, abandon: () => Promise<T>): Promise<T>;
1445
1690
  waitForProactiveReview(turnId: string): Promise<void>;
1446
1691
  purgeProactiveCopies(assignmentIds: readonly string[]): Promise<boolean>;
1692
+ private proactiveRefs;
1447
1693
  private proactiveInputRef;
1448
1694
  proactiveRequestAllowance(turnId: string): {
1449
1695
  inputAllowance: number;
@@ -1493,6 +1739,23 @@ export declare class Groups {
1493
1739
  cardId: string;
1494
1740
  cardRevision: number;
1495
1741
  } | undefined;
1742
+ guestQuestion?: {
1743
+ bot: {
1744
+ botId: string;
1745
+ botCreatedAt: number;
1746
+ };
1747
+ name: string;
1748
+ via?: {
1749
+ bot: {
1750
+ botId: string;
1751
+ botCreatedAt: number;
1752
+ };
1753
+ name: string;
1754
+ memberId: string;
1755
+ botRevision: number;
1756
+ presetId: string;
1757
+ } | undefined;
1758
+ } | undefined;
1496
1759
  proactive?: {
1497
1760
  ticketId: string;
1498
1761
  assignmentId: string;
@@ -1614,6 +1877,23 @@ export declare class Groups {
1614
1877
  cardId: string;
1615
1878
  cardRevision: number;
1616
1879
  } | undefined;
1880
+ guestQuestion?: {
1881
+ bot: {
1882
+ botId: string;
1883
+ botCreatedAt: number;
1884
+ };
1885
+ name: string;
1886
+ via?: {
1887
+ bot: {
1888
+ botId: string;
1889
+ botCreatedAt: number;
1890
+ };
1891
+ name: string;
1892
+ memberId: string;
1893
+ botRevision: number;
1894
+ presetId: string;
1895
+ } | undefined;
1896
+ } | undefined;
1617
1897
  proactive?: {
1618
1898
  ticketId: string;
1619
1899
  assignmentId: string;
@@ -1725,6 +2005,23 @@ export declare class Groups {
1725
2005
  cardId: string;
1726
2006
  cardRevision: number;
1727
2007
  } | undefined;
2008
+ guestQuestion?: {
2009
+ bot: {
2010
+ botId: string;
2011
+ botCreatedAt: number;
2012
+ };
2013
+ name: string;
2014
+ via?: {
2015
+ bot: {
2016
+ botId: string;
2017
+ botCreatedAt: number;
2018
+ };
2019
+ name: string;
2020
+ memberId: string;
2021
+ botRevision: number;
2022
+ presetId: string;
2023
+ } | undefined;
2024
+ } | undefined;
1728
2025
  proactive?: {
1729
2026
  ticketId: string;
1730
2027
  assignmentId: string;
@@ -3,8 +3,10 @@ import { getGroupWorkerBinding, installWorkerTools, isLiveGroupWorker } from './
3
3
  import { SessionSeq } from '@deepseek-ai/dsh-session';
4
4
  import { GROUP_ROOT_PRESET } from '../../shared/groups.js';
5
5
  import { groupExportReviewsDomain } from './model.js';
6
+ import { readRelayDetails } from './relay-details.js';
6
7
  import { GroupState } from './state.js';
7
8
  import { GroupRoots } from './roots.js';
9
+ import { GroupDeletionService } from './deletion.js';
8
10
  import { TeamRecipes } from './team-recipes.js';
9
11
  import { GroupMembers } from './members.js';
10
12
  import { GroupMessages } from './messages.js';
@@ -20,6 +22,7 @@ export { groupsDomain } from './model.js';
20
22
  export class Groups {
21
23
  state;
22
24
  roots;
25
+ deletion;
23
26
  membership;
24
27
  teamRecipes;
25
28
  exportReview;
@@ -30,7 +33,14 @@ export class Groups {
30
33
  constructor(ctx, registry, domain, changed) {
31
34
  this.state = new GroupState(ctx, registry, domain, changed);
32
35
  this.roots = new GroupRoots(this.state);
33
- this.exportReview = new GroupExportReview(this.state, this.roots);
36
+ this.deletion = new GroupDeletionService(this.state, this.roots, async (group, mode) => {
37
+ const turns = this.state.turns(group).filter(turn => turn.proactive);
38
+ if (!turns.length)
39
+ return true;
40
+ const refs = this.proactiveRefs(turns);
41
+ return !!refs && !!await outlets(this.state.registry)?.purgeProactiveGroupCopies(new Set(), refs, mode);
42
+ });
43
+ this.exportReview = new GroupExportReview(this.state, this.roots, t => this.turns.resumeRelay(t));
34
44
  this.exportSettings = new GroupExportSettings(this.state);
35
45
  this.membership = new GroupMembers(this.state, this.roots);
36
46
  this.teamRecipes = new TeamRecipes(this.state, this.membership);
@@ -50,9 +60,11 @@ export class Groups {
50
60
  }
51
61
  async start() {
52
62
  this.state.exportReviews = await this.state.ctx.storageDomain.open(groupExportReviewsDomain);
63
+ await this.deletion.recover();
53
64
  await this.roots.start();
54
65
  }
55
66
  open(...args) { return this.roots.open(...args); }
67
+ deleteGroup(key, expectedRevision) { return this.deletion.remove(key, expectedRevision); }
56
68
  create(value) { return this.membership.create(value); }
57
69
  createSupergroup(value, authority) { return this.membership.create(value, authority); }
58
70
  edit(key, value) { return this.membership.edit(key, value); }
@@ -115,6 +127,9 @@ export class Groups {
115
127
  validateRecallReferences(...args) {
116
128
  return this.recallReader.validateReferences(...args);
117
129
  }
130
+ relayDetails(request, signal) {
131
+ return this.state.queue.run(() => readRelayDetails(this.state, request, signal));
132
+ }
118
133
  followUpSubject(key) {
119
134
  return this.state.queue.run(async () => structuredClone(this.state.record(key)));
120
135
  }
@@ -161,7 +176,7 @@ export class Groups {
161
176
  const group = this.state.record(key);
162
177
  const read = (id) => {
163
178
  const turn = this.state.table('turns').get(id);
164
- return turn && !turn.proactive && turn.group.groupId === group.id && turn.group.groupCreatedAt === group.createdAt
179
+ return turn && !turn.proactive && !turn.guestQuestion && turn.group.groupId === group.id && turn.group.groupCreatedAt === group.createdAt
165
180
  ? [{ turn, deliveries: this.state.deliveries(turn.id).sort((a, b) => a.ordinal - b.ordinal || a.id.localeCompare(b.id)) }] : [];
166
181
  };
167
182
  if (request.turnId)
@@ -170,7 +185,7 @@ export class Groups {
170
185
  const prior = request.page;
171
186
  const page = prior && prior.group.groupId === group.id && prior.group.groupCreatedAt === group.createdAt && prior.since === since
172
187
  ? prior
173
- : { group: key, since, offset: 0, ids: this.state.turns(group).filter(turn => !turn.proactive && (['accepted', 'running'].includes(turn.state) || turn.updatedAt >= since ||
188
+ : { group: key, since, offset: 0, ids: this.state.turns(group).filter(turn => !turn.proactive && !turn.guestQuestion && (['accepted', 'running'].includes(turn.state) || turn.updatedAt >= since ||
174
189
  this.state.deliveries(turn.id).some(row => (row.updatedAt ?? row.endedAt ?? row.startedAt ?? 0) >= since))).map(turn => turn.id).sort((a, b) => a.localeCompare(b)) };
175
190
  const offset = page.offset + 16;
176
191
  return {
@@ -179,6 +194,9 @@ export class Groups {
179
194
  };
180
195
  });
181
196
  }
197
+ sendOwner(key, value) {
198
+ return this.turns.sendOwner(key, value);
199
+ }
182
200
  send(...args) {
183
201
  return this.turns.send(...args);
184
202
  }
@@ -208,31 +226,35 @@ export class Groups {
208
226
  if (!flow)
209
227
  return false;
210
228
  const selected = new Set(assignmentIds);
211
- const refs = new Map();
212
- for (const [, turn] of this.state.table('turns').entries()) {
213
- if (!turn.proactive || !selected.has(turn.proactive.assignmentId))
214
- continue;
215
- if (this.state.chains.has(turn.id) || !['completed', 'partial', 'cancelled'].includes(turn.state))
216
- return false;
217
- const group = this.state.table('groups').get(turn.group.groupId);
218
- if (group?.createdAt !== turn.group.groupCreatedAt)
219
- return false;
220
- refs.set(turn.id, this.proactiveInputRef(turn, group, turn.id, turn.inputFlowId, turn.inputFlowSessionId));
221
- const deliveries = this.state.deliveries(turn.id);
222
- if (deliveries.length !== turn.orderedMemberIds.length ||
223
- deliveries.some((delivery, index) => delivery.memberId !== turn.orderedMemberIds[index]))
224
- return false;
225
- for (const delivery of deliveries) {
226
- if (['pending', 'starting', 'running', 'unknown'].includes(delivery.state) ||
227
- this.state.proactiveDrains.get(delivery.id) === false)
228
- return false;
229
- refs.set(delivery.id, this.proactiveInputRef(turn, group, delivery.id, delivery.inputFlowId, delivery.inputFlowSessionId, delivery.bot));
230
- refs.set(`${delivery.id}:result`, { sessionId: delivery.childSessionId, outlet: 'group-result' });
231
- }
232
- }
233
- return flow.purgeProactiveGroupCopies(selected, refs);
229
+ const turns = Array.from(this.state.table('turns').entries(), ([, turn]) => turn)
230
+ .filter(turn => turn.proactive && selected.has(turn.proactive.assignmentId));
231
+ const refs = this.proactiveRefs(turns);
232
+ return !!refs && flow.purgeProactiveGroupCopies(selected, refs);
234
233
  });
235
234
  }
235
+ proactiveRefs(turns) {
236
+ const refs = new Map();
237
+ for (const turn of turns) {
238
+ if (this.state.chains.has(turn.id) || !['completed', 'partial', 'cancelled'].includes(turn.state))
239
+ return undefined;
240
+ const group = this.state.table('groups').get(turn.group.groupId);
241
+ if (group?.createdAt !== turn.group.groupCreatedAt)
242
+ return undefined;
243
+ refs.set(turn.id, this.proactiveInputRef(turn, group, turn.id, turn.inputFlowId, turn.inputFlowSessionId));
244
+ const deliveries = this.state.deliveries(turn.id);
245
+ if (deliveries.length !== turn.orderedMemberIds.length ||
246
+ deliveries.some((delivery, index) => delivery.memberId !== turn.orderedMemberIds[index]))
247
+ return undefined;
248
+ for (const delivery of deliveries) {
249
+ if (['pending', 'starting', 'running', 'unknown'].includes(delivery.state) ||
250
+ this.state.proactiveDrains.get(delivery.id) === false)
251
+ return undefined;
252
+ refs.set(delivery.id, this.proactiveInputRef(turn, group, delivery.id, delivery.inputFlowId, delivery.inputFlowSessionId, delivery.bot));
253
+ refs.set(`${delivery.id}:result`, { sessionId: delivery.childSessionId, outlet: 'group-result' });
254
+ }
255
+ }
256
+ return refs;
257
+ }
236
258
  proactiveInputRef(turn, group, call, flowId, sessionId, bot) {
237
259
  if (flowId)
238
260
  return { flowId, sessionId, outlet: 'group-input' };
@@ -349,10 +371,16 @@ export class Groups {
349
371
  this.state.proactiveDrains.clear();
350
372
  this.state.proactiveAllowances.clear();
351
373
  this.state.shutdownPhase = 'disposing-roots';
352
- for (const a of this.state.activations.values())
353
- await attempt(() => a.dispose());
374
+ for (const [id, activation] of this.state.activations)
375
+ await attempt(async () => {
376
+ await activation.dispose();
377
+ if (this.state.activations.get(id) === activation)
378
+ this.state.activations.delete(id);
379
+ });
354
380
  for (const h of this.state.roots.values()) {
355
- await attempt(async () => this.state.ctx.subagents.drainChildren(h.agent, (await this.state.ctx.subagents.listChildren(h.agent.id)).map(c => c.id)));
381
+ // This permanently closes new child admission until the parent leaves the registry.
382
+ if (h.ownership === 'owned')
383
+ await attempt(() => this.state.ctx.subagents.drainDescendants([h.agent]));
356
384
  await attempt(() => this.roots.flush(h));
357
385
  await attempt(() => this.roots.release(h));
358
386
  }
@@ -370,4 +398,4 @@ export class Groups {
370
398
  }
371
399
  }
372
400
  //# sourceMappingURL=service.js.map
373
- export const DSH_BOT_MODULE_VERSION = '0.7.2';
401
+ export const DSH_BOT_MODULE_VERSION = '0.7.3';