dsh-botgroup 0.6.7 → 0.7.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 (397) hide show
  1. package/README.en.md +60 -122
  2. package/README.md +59 -121
  3. package/lib/client.js +9117 -5624
  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 +42 -14
  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.d.ts +7 -0
  24. package/lib/host/common/native-ambient-source.js +15 -0
  25. package/lib/host/common/native-ambient-source.js.map +1 -0
  26. package/lib/host/common/operations.js +1 -1
  27. package/lib/host/common/subagent-activation.d.ts +7 -0
  28. package/lib/host/common/subagent-activation.js +10 -0
  29. package/lib/host/common/subagent-activation.js.map +1 -0
  30. package/lib/host/composer.js +1 -1
  31. package/lib/host/connectors/remote.js +1 -1
  32. package/lib/host/connectors/service.js +1 -1
  33. package/lib/host/data-flow/agent-binding.js +1 -1
  34. package/lib/host/data-flow/connector-boundary.js +1 -1
  35. package/lib/host/data-flow/delegation.js +4 -3
  36. package/lib/host/data-flow/delegation.js.map +1 -1
  37. package/lib/host/data-flow/egress.js +1 -1
  38. package/lib/host/data-flow/grants.js +1 -1
  39. package/lib/host/data-flow/graph-capability.js +1 -1
  40. package/lib/host/data-flow/labels.js +1 -1
  41. package/lib/host/data-flow/lineage.js +1 -1
  42. package/lib/host/data-flow/managed-copies.d.ts +11 -3
  43. package/lib/host/data-flow/managed-copies.js +1 -1
  44. package/lib/host/data-flow/native-policy.js +1 -1
  45. package/lib/host/data-flow/outlets.js +1 -1
  46. package/lib/host/data-flow/tool-guard.js +12 -3
  47. package/lib/host/data-flow/tool-guard.js.map +1 -1
  48. package/lib/host/delegate/continuation.js +1 -1
  49. package/lib/host/delegate/guard.js +9 -5
  50. package/lib/host/delegate/guard.js.map +1 -1
  51. package/lib/host/delegate/tool.js +29 -2
  52. package/lib/host/delegate/tool.js.map +1 -1
  53. package/lib/host/errors.js +1 -1
  54. package/lib/host/groups/concurrent.js +12 -7
  55. package/lib/host/groups/concurrent.js.map +1 -1
  56. package/lib/host/groups/data-flow.js +10 -5
  57. package/lib/host/groups/data-flow.js.map +1 -1
  58. package/lib/host/groups/failure.js +1 -1
  59. package/lib/host/groups/members.d.ts +69 -2
  60. package/lib/host/groups/members.js +41 -3
  61. package/lib/host/groups/members.js.map +1 -1
  62. package/lib/host/groups/messages.d.ts +54 -0
  63. package/lib/host/groups/messages.js +5 -2
  64. package/lib/host/groups/messages.js.map +1 -1
  65. package/lib/host/groups/model-selection.js +1 -1
  66. package/lib/host/groups/model.d.ts +65 -0
  67. package/lib/host/groups/model.js +6 -2
  68. package/lib/host/groups/model.js.map +1 -1
  69. package/lib/host/groups/owner-follow-up.js +1 -1
  70. package/lib/host/groups/recall-sessions.js +1 -1
  71. package/lib/host/groups/recall-tool.js +1 -1
  72. package/lib/host/groups/recall.d.ts +2 -2
  73. package/lib/host/groups/recall.js +1 -1
  74. package/lib/host/groups/remote.d.ts +317 -0
  75. package/lib/host/groups/remote.js +32 -1
  76. package/lib/host/groups/remote.js.map +1 -1
  77. package/lib/host/groups/root-guard.js +1 -1
  78. package/lib/host/groups/roots.js +1 -1
  79. package/lib/host/groups/round-robin.js +1 -1
  80. package/lib/host/groups/routing.d.ts +28 -1
  81. package/lib/host/groups/routing.js +33 -3
  82. package/lib/host/groups/routing.js.map +1 -1
  83. package/lib/host/groups/service.d.ts +502 -2
  84. package/lib/host/groups/service.js +43 -5
  85. package/lib/host/groups/service.js.map +1 -1
  86. package/lib/host/groups/state.d.ts +158 -1
  87. package/lib/host/groups/state.js +4 -2
  88. package/lib/host/groups/state.js.map +1 -1
  89. package/lib/host/groups/supergroup-admission.d.ts +87 -0
  90. package/lib/host/groups/supergroup-admission.js +99 -0
  91. package/lib/host/groups/supergroup-admission.js.map +1 -0
  92. package/lib/host/groups/team-recipes.d.ts +113 -0
  93. package/lib/host/groups/team-recipes.js +92 -0
  94. package/lib/host/groups/team-recipes.js.map +1 -0
  95. package/lib/host/groups/turn-runner.d.ts +3 -0
  96. package/lib/host/groups/turn-runner.js +43 -8
  97. package/lib/host/groups/turn-runner.js.map +1 -1
  98. package/lib/host/groups/turns.d.ts +84 -1
  99. package/lib/host/groups/turns.js +44 -11
  100. package/lib/host/groups/turns.js.map +1 -1
  101. package/lib/host/groups/worker-tool.d.ts +8 -1
  102. package/lib/host/groups/worker-tool.js +80 -9
  103. package/lib/host/groups/worker-tool.js.map +1 -1
  104. package/lib/host/home.js +1 -1
  105. package/lib/host/im/service.js +1 -1
  106. package/lib/host/index.d.ts +2 -1
  107. package/lib/host/index.js +30 -2
  108. package/lib/host/index.js.map +1 -1
  109. package/lib/host/live-persona.js +1 -1
  110. package/lib/host/main-session.js +1 -1
  111. package/lib/host/memory/admission.js +1 -1
  112. package/lib/host/memory/auto-share.js +1 -1
  113. package/lib/host/memory/confirmation.d.ts +4 -4
  114. package/lib/host/memory/confirmation.js +1 -1
  115. package/lib/host/memory/conflicts.js +1 -1
  116. package/lib/host/memory/context.js +1 -1
  117. package/lib/host/memory/domain-v2.d.ts +8 -8
  118. package/lib/host/memory/domain-v2.js +1 -1
  119. package/lib/host/memory/facade.d.ts +131 -3
  120. package/lib/host/memory/facade.js +101 -2
  121. package/lib/host/memory/facade.js.map +1 -1
  122. package/lib/host/memory/forget-preview.js +1 -1
  123. package/lib/host/memory/forget-runner.js +1 -1
  124. package/lib/host/memory/forget-service.js +1 -1
  125. package/lib/host/memory/history-proof.js +1 -1
  126. package/lib/host/memory/history.js +1 -1
  127. package/lib/host/memory/layout-upgrade.js +1 -1
  128. package/lib/host/memory/migration.js +1 -1
  129. package/lib/host/memory/op-log.js +1 -1
  130. package/lib/host/memory/open-v2.js +1 -1
  131. package/lib/host/memory/owner-lease.js +1 -1
  132. package/lib/host/memory/persistent-map.js +1 -1
  133. package/lib/host/memory/port.js +1 -1
  134. package/lib/host/memory/preserve-inbox.js +1 -1
  135. package/lib/host/memory/projection.js +1 -1
  136. package/lib/host/memory/prompt.js +1 -1
  137. package/lib/host/memory/query.js +1 -1
  138. package/lib/host/memory/quota-replay.js +1 -1
  139. package/lib/host/memory/quota.d.ts +4 -4
  140. package/lib/host/memory/quota.js +1 -1
  141. package/lib/host/memory/remote.d.ts +124 -0
  142. package/lib/host/memory/remote.js +12 -1
  143. package/lib/host/memory/remote.js.map +1 -1
  144. package/lib/host/memory/retrieval-config.js +1 -1
  145. package/lib/host/memory/retrieval-rank.js +1 -1
  146. package/lib/host/memory/retrieval-text.js +1 -1
  147. package/lib/host/memory/root-instructions.js +1 -1
  148. package/lib/host/memory/secrets.js +1 -1
  149. package/lib/host/memory/service.js +1 -1
  150. package/lib/host/memory/shards.js +1 -1
  151. package/lib/host/memory/store-v2.js +1 -1
  152. package/lib/host/memory/temporal.js +1 -1
  153. package/lib/host/memory/tool-guidance.js +1 -1
  154. package/lib/host/memory/tools.js +1 -1
  155. package/lib/host/memory/trusted-ingress.js +1 -1
  156. package/lib/host/memory/version.d.ts +4 -4
  157. package/lib/host/memory/version.js +1 -1
  158. package/lib/host/messaging/config.js +1 -1
  159. package/lib/host/messaging/core.d.ts +11 -3
  160. package/lib/host/messaging/core.js +4 -3
  161. package/lib/host/messaging/core.js.map +1 -1
  162. package/lib/host/messaging/delivery.js +3 -1
  163. package/lib/host/messaging/delivery.js.map +1 -1
  164. package/lib/host/messaging/evidence.js +1 -1
  165. package/lib/host/messaging/interrupt.js +1 -1
  166. package/lib/host/messaging/recovery.js +1 -1
  167. package/lib/host/messaging/remote.d.ts +1 -1
  168. package/lib/host/messaging/remote.js +1 -1
  169. package/lib/host/messaging/reply-routing.js +1 -1
  170. package/lib/host/messaging/safety.js +8 -3
  171. package/lib/host/messaging/safety.js.map +1 -1
  172. package/lib/host/messaging/scoped-projection.d.ts +43 -0
  173. package/lib/host/messaging/scoped-projection.js +136 -0
  174. package/lib/host/messaging/scoped-projection.js.map +1 -0
  175. package/lib/host/messaging/service.d.ts +5 -2
  176. package/lib/host/messaging/service.js +16 -6
  177. package/lib/host/messaging/service.js.map +1 -1
  178. package/lib/host/messaging/store.d.ts +45 -13
  179. package/lib/host/messaging/store.js +4 -3
  180. package/lib/host/messaging/store.js.map +1 -1
  181. package/lib/host/messaging/tool.js +24 -5
  182. package/lib/host/messaging/tool.js.map +1 -1
  183. package/lib/host/messaging/wake.js +3 -3
  184. package/lib/host/messaging/wake.js.map +1 -1
  185. package/lib/host/native-schedule/outcomes.js +1 -1
  186. package/lib/host/native-schedule/service.js +1 -1
  187. package/lib/host/notifications/data-flow.js +1 -1
  188. package/lib/host/notifications/remote.js +1 -1
  189. package/lib/host/notifications/service.js +1 -1
  190. package/lib/host/notifications/time.js +1 -1
  191. package/lib/host/notifications/tool.js +1 -1
  192. package/lib/host/onboarding/coordinator.js +1 -1
  193. package/lib/host/onboarding/guard.js +1 -1
  194. package/lib/host/proactive/auto-admission.js +1 -1
  195. package/lib/host/proactive/config.js +1 -1
  196. package/lib/host/proactive/coordinator-client.js +1 -1
  197. package/lib/host/proactive/deferred-notices.js +1 -1
  198. package/lib/host/proactive/execution-prompt.js +1 -1
  199. package/lib/host/proactive/execution.js +1 -1
  200. package/lib/host/proactive/executors/command.js +1 -1
  201. package/lib/host/proactive/executors/json-command-bridge-entry.js +1 -1
  202. package/lib/host/proactive/executors/json-command-bridge.js +1 -1
  203. package/lib/host/proactive/executors/loopback.js +1 -1
  204. package/lib/host/proactive/feedback-workflow.js +1 -1
  205. package/lib/host/proactive/feedback.js +1 -1
  206. package/lib/host/proactive/follow-up-events.d.ts +2 -0
  207. package/lib/host/proactive/follow-up-events.js +63 -4
  208. package/lib/host/proactive/follow-up-events.js.map +1 -1
  209. package/lib/host/proactive/follow-up-facts.js +1 -1
  210. package/lib/host/proactive/follow-up-tool.js +3 -3
  211. package/lib/host/proactive/follow-up-tool.js.map +1 -1
  212. package/lib/host/proactive/governance-artifacts.js +1 -1
  213. package/lib/host/proactive/governance-service.js +1 -1
  214. package/lib/host/proactive/group-budget.js +1 -1
  215. package/lib/host/proactive/group-follow-up.js +1 -1
  216. package/lib/host/proactive/group-repair.js +1 -1
  217. package/lib/host/proactive/index.js +1 -1
  218. package/lib/host/proactive/lifecycle.js +1 -1
  219. package/lib/host/proactive/method-evaluation.js +1 -1
  220. package/lib/host/proactive/method-package.js +1 -1
  221. package/lib/host/proactive/method-skill.js +1 -1
  222. package/lib/host/proactive/model-budget.js +1 -1
  223. package/lib/host/proactive/notice-pump.js +1 -1
  224. package/lib/host/proactive/notification-bridge.js +1 -1
  225. package/lib/host/proactive/read-query.js +1 -1
  226. package/lib/host/proactive/remote.d.ts +166 -0
  227. package/lib/host/proactive/remote.js +1 -1
  228. package/lib/host/proactive/repair.js +1 -1
  229. package/lib/host/proactive/result-journal.js +1 -1
  230. package/lib/host/proactive/service.d.ts +1711 -51
  231. package/lib/host/proactive/service.js +1 -1
  232. package/lib/host/proactive/setup.js +1 -1
  233. package/lib/host/proactive/sources/ci-feed.js +1 -1
  234. package/lib/host/proactive/sources/ci.js +1 -1
  235. package/lib/host/proactive/sources/github-ci.js +1 -1
  236. package/lib/host/proactive/task-cost.js +1 -1
  237. package/lib/host/proactive/wire.js +1 -1
  238. package/lib/host/proactive/work-continuation.js +1 -1
  239. package/lib/host/proactive/workspace-process.js +1 -1
  240. package/lib/host/proactive/workspace-repair.js +1 -1
  241. package/lib/host/reference-memory/backend.js +1 -1
  242. package/lib/host/reference-memory/cleanup-files.js +1 -1
  243. package/lib/host/reference-memory/copies.js +1 -1
  244. package/lib/host/reference-memory/files.js +1 -1
  245. package/lib/host/reference-memory/model.js +1 -1
  246. package/lib/host/reference-memory/service.js +1 -1
  247. package/lib/host/reference-memory/writer.js +1 -1
  248. package/lib/host/registry/identity.js +1 -1
  249. package/lib/host/registry/lifecycle.d.ts +2 -1
  250. package/lib/host/registry/lifecycle.js +1 -1
  251. package/lib/host/registry/mutations.js +1 -1
  252. package/lib/host/registry/presets.js +1 -1
  253. package/lib/host/registry/types.js +1 -1
  254. package/lib/host/registry-config.d.ts +4 -1
  255. package/lib/host/registry-config.js +3 -1
  256. package/lib/host/registry-config.js.map +1 -1
  257. package/lib/host/registry.d.ts +3 -0
  258. package/lib/host/registry.js +2 -1
  259. package/lib/host/registry.js.map +1 -1
  260. package/lib/host/shadow/budget.js +1 -1
  261. package/lib/host/shadow/config.js +1 -1
  262. package/lib/host/shadow/notification-adapter.js +1 -1
  263. package/lib/host/shadow/planner.js +1 -1
  264. package/lib/host/shadow/schedule-adapter.js +1 -1
  265. package/lib/host/shadow/service.js +1 -1
  266. package/lib/host/store.js +1 -1
  267. package/lib/host/stores/activity.js +1 -1
  268. package/lib/host/stores/bots.js +1 -1
  269. package/lib/host/stores/domain.js +1 -1
  270. package/lib/host/stores/memory.js +1 -1
  271. package/lib/host/supergroup/collaboration.d.ts +99 -0
  272. package/lib/host/supergroup/collaboration.js +361 -0
  273. package/lib/host/supergroup/collaboration.js.map +1 -0
  274. package/lib/host/supergroup/config.d.ts +15 -0
  275. package/lib/host/supergroup/config.js +33 -0
  276. package/lib/host/supergroup/config.js.map +1 -0
  277. package/lib/host/supergroup/input-capability.d.ts +4 -0
  278. package/lib/host/supergroup/input-capability.js +21 -0
  279. package/lib/host/supergroup/input-capability.js.map +1 -0
  280. package/lib/host/supergroup/remote.d.ts +1944 -0
  281. package/lib/host/supergroup/remote.js +123 -0
  282. package/lib/host/supergroup/remote.js.map +1 -0
  283. package/lib/host/supergroup/service.d.ts +935 -0
  284. package/lib/host/supergroup/service.js +921 -0
  285. package/lib/host/supergroup/service.js.map +1 -0
  286. package/lib/host/supergroup/task-support.d.ts +245 -0
  287. package/lib/host/supergroup/task-support.js +310 -0
  288. package/lib/host/supergroup/task-support.js.map +1 -0
  289. package/lib/host/supergroup/tool.d.ts +4 -0
  290. package/lib/host/supergroup/tool.js +74 -0
  291. package/lib/host/supergroup/tool.js.map +1 -0
  292. package/lib/host/tools/bot-manage.js +7 -3
  293. package/lib/host/tools/bot-manage.js.map +1 -1
  294. package/lib/host/workspace/remote.js +1 -1
  295. package/lib/host/workspace/service.js +1 -1
  296. package/lib/index.d.ts +1 -1
  297. package/lib/index.js +1 -1
  298. package/lib/module-manifest.json +274 -258
  299. package/lib/proactive-coordinator/main.mjs +176 -9
  300. package/lib/proactive-coordinator/provenance.json +1 -1
  301. package/lib/shared/activity-preview.js +1 -1
  302. package/lib/shared/activity.js +1 -1
  303. package/lib/shared/automation-contract.js +1 -1
  304. package/lib/shared/automation.js +1 -1
  305. package/lib/shared/bot-brand.js +1 -1
  306. package/lib/shared/capabilities-contract.js +1 -1
  307. package/lib/shared/collaboration-contract.js +1 -1
  308. package/lib/shared/collaboration.js +1 -1
  309. package/lib/shared/connectors.js +1 -1
  310. package/lib/shared/data-flow.js +1 -1
  311. package/lib/shared/eval-budget.js +1 -1
  312. package/lib/shared/group-recall-reads.js +1 -1
  313. package/lib/shared/group-recall.js +1 -1
  314. package/lib/shared/groups-contract.d.ts +1777 -0
  315. package/lib/shared/groups-contract.js +9 -1
  316. package/lib/shared/groups-contract.js.map +1 -1
  317. package/lib/shared/groups.d.ts +161 -0
  318. package/lib/shared/groups.js +18 -1
  319. package/lib/shared/groups.js.map +1 -1
  320. package/lib/shared/identity.js +1 -1
  321. package/lib/shared/ids.js +1 -1
  322. package/lib/shared/integrations-contract.js +1 -1
  323. package/lib/shared/integrations.js +1 -1
  324. package/lib/shared/managed-flow.js +1 -1
  325. package/lib/shared/memory-forget.js +1 -1
  326. package/lib/shared/memory-management.d.ts +426 -0
  327. package/lib/shared/memory-management.js +9 -1
  328. package/lib/shared/memory-management.js.map +1 -1
  329. package/lib/shared/memory-ops.js +1 -1
  330. package/lib/shared/memory-tool-names.js +1 -1
  331. package/lib/shared/memory-v2.js +1 -1
  332. package/lib/shared/messaging-contract.d.ts +1 -1
  333. package/lib/shared/messaging-contract.js +1 -1
  334. package/lib/shared/messaging.d.ts +21 -10
  335. package/lib/shared/messaging.js +3 -1
  336. package/lib/shared/messaging.js.map +1 -1
  337. package/lib/shared/native-schedule.js +1 -1
  338. package/lib/shared/notifications.js +1 -1
  339. package/lib/shared/onboarding-source.js +1 -1
  340. package/lib/shared/onboarding.js +1 -1
  341. package/lib/shared/operation-errors.d.ts +3 -0
  342. package/lib/shared/operation-errors.js +4 -1
  343. package/lib/shared/operation-errors.js.map +1 -1
  344. package/lib/shared/proactive/activity.js +1 -1
  345. package/lib/shared/proactive/document.js +1 -1
  346. package/lib/shared/proactive/feedback.js +1 -1
  347. package/lib/shared/proactive/follow-up.d.ts +460 -0
  348. package/lib/shared/proactive/follow-up.js +15 -1
  349. package/lib/shared/proactive/follow-up.js.map +1 -1
  350. package/lib/shared/proactive/governance.js +1 -1
  351. package/lib/shared/proactive/group-follow-up.js +1 -1
  352. package/lib/shared/proactive/group-repair.js +1 -1
  353. package/lib/shared/proactive/handoff.js +1 -1
  354. package/lib/shared/proactive/method-evaluation.js +1 -1
  355. package/lib/shared/proactive/method-package.js +1 -1
  356. package/lib/shared/proactive/notices.js +1 -1
  357. package/lib/shared/proactive/outcomes.js +1 -1
  358. package/lib/shared/proactive/protocol.d.ts +627 -0
  359. package/lib/shared/proactive/protocol.js +1 -1
  360. package/lib/shared/proactive/remote-contract.d.ts +792 -0
  361. package/lib/shared/proactive/remote-contract.js +1 -1
  362. package/lib/shared/proactive/repair.js +1 -1
  363. package/lib/shared/proactive/responsibility.js +1 -1
  364. package/lib/shared/proactive/setup.d.ts +83 -0
  365. package/lib/shared/proactive/setup.js +1 -1
  366. package/lib/shared/proactive/work-progress.js +1 -1
  367. package/lib/shared/proactive/work.js +1 -1
  368. package/lib/shared/proactive/workspace-repair.js +1 -1
  369. package/lib/shared/reference-memory.js +1 -1
  370. package/lib/shared/remote-contract.d.ts +531 -8
  371. package/lib/shared/remote-contract.js +10 -2
  372. package/lib/shared/remote-contract.js.map +1 -1
  373. package/lib/shared/routine-outcomes.js +1 -1
  374. package/lib/shared/schema.js +1 -1
  375. package/lib/shared/secrets.js +1 -1
  376. package/lib/shared/shadow.js +1 -1
  377. package/lib/shared/supergroup-contract.d.ts +7119 -0
  378. package/lib/shared/supergroup-contract.js +26 -0
  379. package/lib/shared/supergroup-contract.js.map +1 -0
  380. package/lib/shared/supergroup.d.ts +1441 -0
  381. package/lib/shared/supergroup.js +56 -0
  382. package/lib/shared/supergroup.js.map +1 -0
  383. package/lib/shared/task-materials.d.ts +166 -0
  384. package/lib/shared/task-materials.js +40 -0
  385. package/lib/shared/task-materials.js.map +1 -0
  386. package/lib/shared/team-recipes.d.ts +109 -0
  387. package/lib/shared/team-recipes.js +25 -0
  388. package/lib/shared/team-recipes.js.map +1 -0
  389. package/lib/shared/version.d.ts +1 -1
  390. package/lib/shared/version.js +2 -2
  391. package/lib/shared/workspace-contract.js +1 -1
  392. package/lib/shared/workspace.js +1 -1
  393. package/lib/typert.host.js +1 -1
  394. package/lib/typert.remote-client.js +1 -1
  395. package/locale/en.json +239 -7
  396. package/locale/zh.json +239 -7
  397. package/package.json +2 -1
@@ -0,0 +1,935 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import { type UserMessage } from '@deepseek-ai/dsh-llm';
3
+ import type { TaskMaterialInput, TaskResumeInput } from '../../shared/task-materials.js';
4
+ import type { Agent } from '@deepseek-ai/dsh-agent';
5
+ import { type Domain } from '@deepseek-ai/dsh-storage-domain';
6
+ import { z } from 'zod';
7
+ import { type GroupKey } from '../../shared/groups.js';
8
+ import type { BotKey } from '../../shared/identity.js';
9
+ import { type SupergroupSendGroupInput, type SupergroupWorkView } from '../../shared/supergroup.js';
10
+ import type { DshBotRegistry } from '../registry.js';
11
+ import type { Groups } from '../groups/service.js';
12
+ import { type SupergroupConfig } from './config.js';
13
+ export declare const supergroupDomain: {
14
+ name: string;
15
+ version: number;
16
+ tables: {
17
+ works: import("@deepseek-ai/dsh-storage-domain").DomainTableSpec<string, {
18
+ id: string;
19
+ revision: number;
20
+ owner: {
21
+ botId: string;
22
+ botCreatedAt: number;
23
+ };
24
+ originSessionId: string;
25
+ inputMessageId: string;
26
+ inputMessageIds: string[];
27
+ configDigest: string;
28
+ readers: {
29
+ botId: string;
30
+ botCreatedAt: number;
31
+ }[];
32
+ createdAt: number;
33
+ updatedAt: number;
34
+ expiresAt: number;
35
+ turnIds: string[];
36
+ state: "unknown" | "running" | "completed" | "cancelled" | "creating" | "partial";
37
+ groupInputs: {
38
+ operationId: string;
39
+ digest: string;
40
+ messageId: string;
41
+ expectedRevision: number;
42
+ state: "unknown" | "queued" | "running" | "completed" | "cancelled" | "conflict" | "stored";
43
+ seq?: number | undefined;
44
+ acceptedRevision?: number | undefined;
45
+ memberIds?: string[] | undefined;
46
+ replyTo?: string | undefined;
47
+ reason?: string | undefined;
48
+ delivery?: {
49
+ id: string;
50
+ messageId: string;
51
+ digest: string;
52
+ targetSessionId: string;
53
+ resultVersion: string;
54
+ state: "unknown" | "queued" | "cancelled" | "dispatching" | "delivered" | "prepared" | "undeliverable";
55
+ inputSeq?: number | undefined;
56
+ answerMessageId?: string | undefined;
57
+ reason?: string | undefined;
58
+ } | undefined;
59
+ }[];
60
+ experts: {
61
+ id: string;
62
+ digest: string;
63
+ botId: string;
64
+ memberId: string;
65
+ turnId: string;
66
+ childSessionId: string;
67
+ state: "failed" | "pending" | "invited";
68
+ reason?: string | undefined;
69
+ }[];
70
+ group?: {
71
+ groupId: string;
72
+ groupCreatedAt: number;
73
+ } | undefined;
74
+ collaboration?: {
75
+ requests: number;
76
+ operations: {
77
+ id: string;
78
+ digest: string;
79
+ target: {
80
+ botId: string;
81
+ botCreatedAt: number;
82
+ };
83
+ state: "unknown" | "completed" | "failed" | "cancelled" | "prepared";
84
+ childId?: string | undefined;
85
+ status?: string | undefined;
86
+ resultDigest?: string | undefined;
87
+ errorCode?: string | undefined;
88
+ diagnostic?: string | undefined;
89
+ }[];
90
+ } | undefined;
91
+ initialPending?: boolean | undefined;
92
+ materials?: {
93
+ id: string;
94
+ operationId: string;
95
+ requestDigest: string;
96
+ kind: "file" | "input-text" | "github-ci";
97
+ name: string;
98
+ sourceId: string;
99
+ sourceVersion: string;
100
+ digest: string;
101
+ text: string;
102
+ question: string;
103
+ citation: string;
104
+ readers: {
105
+ botId: string;
106
+ botCreatedAt: number;
107
+ }[];
108
+ createdAt: number;
109
+ }[] | undefined;
110
+ blockers?: {
111
+ id: string;
112
+ assignmentId: string;
113
+ desiredRevision: number;
114
+ reason: string;
115
+ observedAt: number;
116
+ state: "ready" | "superseded" | "waiting" | "continued";
117
+ name?: string | undefined;
118
+ }[] | undefined;
119
+ resumes?: {
120
+ operationId: string;
121
+ digest: string;
122
+ messageId: string;
123
+ expectedRevision: number;
124
+ state: "unknown" | "queued" | "dispatching";
125
+ blockerIds: string[];
126
+ createdAt: number;
127
+ contentDigest?: string | undefined;
128
+ originalDigest?: string | undefined;
129
+ previousMessageId?: string | undefined;
130
+ }[] | undefined;
131
+ reason?: string | undefined;
132
+ }>;
133
+ };
134
+ };
135
+ export declare const supergroupInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
136
+ action: z.ZodLiteral<"start">;
137
+ memberIds: z.ZodArray<z.ZodString>;
138
+ }, z.core.$strict>, z.ZodObject<{
139
+ action: z.ZodLiteral<"continue">;
140
+ workId: z.ZodOptional<z.ZodString>;
141
+ }, z.core.$strict>, z.ZodObject<{
142
+ action: z.ZodLiteral<"status">;
143
+ workId: z.ZodOptional<z.ZodString>;
144
+ }, z.core.$strict>, z.ZodObject<{
145
+ action: z.ZodLiteral<"cancel">;
146
+ workId: z.ZodOptional<z.ZodString>;
147
+ }, z.core.$strict>], "action">;
148
+ export type SupergroupInput = z.output<typeof supergroupInputSchema>;
149
+ /** Same bounded, deterministic directory for model discovery and Host admission. */
150
+ export declare function supergroupCandidateIds(ownerId: string, directory: readonly {
151
+ id: string;
152
+ }[], config: Pick<SupergroupConfig, 'allowedBotIds' | 'maxExperts'>): string[];
153
+ /** Work links and admission receipts only; Groups and native Sessions own execution. */
154
+ export declare class Supergroup {
155
+ private readonly ctx;
156
+ private readonly registry;
157
+ private readonly groups;
158
+ private readonly domain;
159
+ private readonly serial;
160
+ private readonly active;
161
+ private readonly groupInputTails;
162
+ private readonly capabilities;
163
+ private readonly returns;
164
+ private stopped;
165
+ private offExpert?;
166
+ private closing?;
167
+ private collaboration?;
168
+ private releaseCollaboration?;
169
+ private readonly support;
170
+ private readonly proposedContinuations;
171
+ constructor(ctx: Context, registry: DshBotRegistry, groups: Groups, domain: Domain<typeof supergroupDomain>);
172
+ taskSupport(id: string): Promise<{
173
+ workId: string;
174
+ revision: number;
175
+ originSessionId: string;
176
+ inputMessageId: string;
177
+ owner: {
178
+ botId: string;
179
+ botCreatedAt: number;
180
+ };
181
+ readers: {
182
+ botId: string;
183
+ botCreatedAt: number;
184
+ }[];
185
+ blockers: {
186
+ id: string;
187
+ assignmentId: string;
188
+ desiredRevision: number;
189
+ reason: string;
190
+ observedAt: number;
191
+ state: "ready" | "superseded" | "waiting" | "continued";
192
+ name?: string | undefined;
193
+ }[];
194
+ materials: {
195
+ id: string;
196
+ operationId: string;
197
+ requestDigest: string;
198
+ kind: "file" | "input-text" | "github-ci";
199
+ name: string;
200
+ sourceId: string;
201
+ sourceVersion: string;
202
+ digest: string;
203
+ text: string;
204
+ question: string;
205
+ citation: string;
206
+ readers: {
207
+ botId: string;
208
+ botCreatedAt: number;
209
+ }[];
210
+ createdAt: number;
211
+ }[];
212
+ resumes: {
213
+ operationId: string;
214
+ digest: string;
215
+ messageId: string;
216
+ expectedRevision: number;
217
+ state: "unknown" | "queued" | "dispatching";
218
+ blockerIds: string[];
219
+ createdAt: number;
220
+ contentDigest?: string | undefined;
221
+ originalDigest?: string | undefined;
222
+ previousMessageId?: string | undefined;
223
+ }[];
224
+ inputs: {
225
+ messageId: string;
226
+ name: string;
227
+ version: string;
228
+ }[];
229
+ ci: {
230
+ id: string;
231
+ name: string;
232
+ version: string;
233
+ citation: string;
234
+ }[];
235
+ ownerName?: string | undefined;
236
+ originalQuestion?: string | undefined;
237
+ readerNames?: string[] | undefined;
238
+ }>;
239
+ addMaterial(input: TaskMaterialInput): Promise<{
240
+ workId: string;
241
+ revision: number;
242
+ originSessionId: string;
243
+ inputMessageId: string;
244
+ owner: {
245
+ botId: string;
246
+ botCreatedAt: number;
247
+ };
248
+ readers: {
249
+ botId: string;
250
+ botCreatedAt: number;
251
+ }[];
252
+ blockers: {
253
+ id: string;
254
+ assignmentId: string;
255
+ desiredRevision: number;
256
+ reason: string;
257
+ observedAt: number;
258
+ state: "ready" | "superseded" | "waiting" | "continued";
259
+ name?: string | undefined;
260
+ }[];
261
+ materials: {
262
+ id: string;
263
+ operationId: string;
264
+ requestDigest: string;
265
+ kind: "file" | "input-text" | "github-ci";
266
+ name: string;
267
+ sourceId: string;
268
+ sourceVersion: string;
269
+ digest: string;
270
+ text: string;
271
+ question: string;
272
+ citation: string;
273
+ readers: {
274
+ botId: string;
275
+ botCreatedAt: number;
276
+ }[];
277
+ createdAt: number;
278
+ }[];
279
+ resumes: {
280
+ operationId: string;
281
+ digest: string;
282
+ messageId: string;
283
+ expectedRevision: number;
284
+ state: "unknown" | "queued" | "dispatching";
285
+ blockerIds: string[];
286
+ createdAt: number;
287
+ contentDigest?: string | undefined;
288
+ originalDigest?: string | undefined;
289
+ previousMessageId?: string | undefined;
290
+ }[];
291
+ inputs: {
292
+ messageId: string;
293
+ name: string;
294
+ version: string;
295
+ }[];
296
+ ci: {
297
+ id: string;
298
+ name: string;
299
+ version: string;
300
+ citation: string;
301
+ }[];
302
+ ownerName?: string | undefined;
303
+ originalQuestion?: string | undefined;
304
+ readerNames?: string[] | undefined;
305
+ }>;
306
+ resumeWork(input: TaskResumeInput): Promise<{
307
+ workId: string;
308
+ revision: number;
309
+ originSessionId: string;
310
+ inputMessageId: string;
311
+ owner: {
312
+ botId: string;
313
+ botCreatedAt: number;
314
+ };
315
+ readers: {
316
+ botId: string;
317
+ botCreatedAt: number;
318
+ }[];
319
+ blockers: {
320
+ id: string;
321
+ assignmentId: string;
322
+ desiredRevision: number;
323
+ reason: string;
324
+ observedAt: number;
325
+ state: "ready" | "superseded" | "waiting" | "continued";
326
+ name?: string | undefined;
327
+ }[];
328
+ materials: {
329
+ id: string;
330
+ operationId: string;
331
+ requestDigest: string;
332
+ kind: "file" | "input-text" | "github-ci";
333
+ name: string;
334
+ sourceId: string;
335
+ sourceVersion: string;
336
+ digest: string;
337
+ text: string;
338
+ question: string;
339
+ citation: string;
340
+ readers: {
341
+ botId: string;
342
+ botCreatedAt: number;
343
+ }[];
344
+ createdAt: number;
345
+ }[];
346
+ resumes: {
347
+ operationId: string;
348
+ digest: string;
349
+ messageId: string;
350
+ expectedRevision: number;
351
+ state: "unknown" | "queued" | "dispatching";
352
+ blockerIds: string[];
353
+ createdAt: number;
354
+ contentDigest?: string | undefined;
355
+ originalDigest?: string | undefined;
356
+ previousMessageId?: string | undefined;
357
+ }[];
358
+ inputs: {
359
+ messageId: string;
360
+ name: string;
361
+ version: string;
362
+ }[];
363
+ ci: {
364
+ id: string;
365
+ name: string;
366
+ version: string;
367
+ citation: string;
368
+ }[];
369
+ ownerName?: string | undefined;
370
+ originalQuestion?: string | undefined;
371
+ readerNames?: string[] | undefined;
372
+ }>;
373
+ pendingTasks(): Promise<{
374
+ workId: string;
375
+ revision: number;
376
+ originSessionId: string;
377
+ inputMessageId: string;
378
+ owner: {
379
+ botId: string;
380
+ botCreatedAt: number;
381
+ };
382
+ readers: {
383
+ botId: string;
384
+ botCreatedAt: number;
385
+ }[];
386
+ blockers: {
387
+ id: string;
388
+ assignmentId: string;
389
+ desiredRevision: number;
390
+ reason: string;
391
+ observedAt: number;
392
+ state: "ready" | "superseded" | "waiting" | "continued";
393
+ name?: string | undefined;
394
+ }[];
395
+ materials: {
396
+ id: string;
397
+ operationId: string;
398
+ requestDigest: string;
399
+ kind: "file" | "input-text" | "github-ci";
400
+ name: string;
401
+ sourceId: string;
402
+ sourceVersion: string;
403
+ digest: string;
404
+ text: string;
405
+ question: string;
406
+ citation: string;
407
+ readers: {
408
+ botId: string;
409
+ botCreatedAt: number;
410
+ }[];
411
+ createdAt: number;
412
+ }[];
413
+ resumes: {
414
+ operationId: string;
415
+ digest: string;
416
+ messageId: string;
417
+ expectedRevision: number;
418
+ state: "unknown" | "queued" | "dispatching";
419
+ blockerIds: string[];
420
+ createdAt: number;
421
+ contentDigest?: string | undefined;
422
+ originalDigest?: string | undefined;
423
+ previousMessageId?: string | undefined;
424
+ }[];
425
+ inputs: {
426
+ messageId: string;
427
+ name: string;
428
+ version: string;
429
+ }[];
430
+ ci: {
431
+ id: string;
432
+ name: string;
433
+ version: string;
434
+ citation: string;
435
+ }[];
436
+ ownerName?: string | undefined;
437
+ originalQuestion?: string | undefined;
438
+ readerNames?: string[] | undefined;
439
+ }[]>;
440
+ start(): Promise<void>;
441
+ settings(): {
442
+ enabled: boolean;
443
+ };
444
+ /** Owner Remote only. Native ConfigEditor owns persistence and volatile apply. */
445
+ configure(value: {
446
+ enabled: boolean;
447
+ expectedEnabled: boolean;
448
+ }): Promise<{
449
+ enabled: boolean;
450
+ }>;
451
+ private config;
452
+ private configDigest;
453
+ private read;
454
+ private put;
455
+ /** The latest substantive input must really be human. Ambient context is not authorization. */
456
+ private human;
457
+ private authorizeCollaboration;
458
+ continuationInstruction(agent: Agent): string;
459
+ checkContinuation(agent: Agent, messages?: readonly UserMessage[]): Promise<void>;
460
+ observeContinuation(agent: Agent): Promise<void>;
461
+ private reserveCollaborationRequest;
462
+ private reserveWorkRequest;
463
+ private finishCollaboration;
464
+ private pool;
465
+ private runtime;
466
+ private chosen;
467
+ invoke(agent: Agent, input: SupergroupInput, signal: AbortSignal): Promise<unknown>;
468
+ private execute;
469
+ private result;
470
+ private expert;
471
+ private ownerAgent;
472
+ private updateInput;
473
+ private reconcileDelivery;
474
+ private project;
475
+ catalog(input?: {
476
+ bot?: BotKey;
477
+ group?: GroupKey;
478
+ }): Promise<SupergroupWorkView[]>;
479
+ byGroup(group: GroupKey): Promise<SupergroupWorkView | null>;
480
+ /** Owner Remote only. Persist the original group human event even when its revision conflicts. */
481
+ sendGroupInput(value: SupergroupSendGroupInput): Promise<{
482
+ view: {
483
+ work: {
484
+ id: string;
485
+ revision: number;
486
+ owner: {
487
+ botId: string;
488
+ botCreatedAt: number;
489
+ };
490
+ originSessionId: string;
491
+ inputMessageId: string;
492
+ inputMessageIds: string[];
493
+ configDigest: string;
494
+ readers: {
495
+ botId: string;
496
+ botCreatedAt: number;
497
+ }[];
498
+ createdAt: number;
499
+ updatedAt: number;
500
+ expiresAt: number;
501
+ turnIds: string[];
502
+ state: "unknown" | "running" | "completed" | "cancelled" | "creating" | "partial";
503
+ groupInputs: {
504
+ operationId: string;
505
+ digest: string;
506
+ messageId: string;
507
+ expectedRevision: number;
508
+ state: "unknown" | "queued" | "running" | "completed" | "cancelled" | "conflict" | "stored";
509
+ seq?: number | undefined;
510
+ acceptedRevision?: number | undefined;
511
+ memberIds?: string[] | undefined;
512
+ replyTo?: string | undefined;
513
+ reason?: string | undefined;
514
+ delivery?: {
515
+ id: string;
516
+ messageId: string;
517
+ digest: string;
518
+ targetSessionId: string;
519
+ resultVersion: string;
520
+ state: "unknown" | "queued" | "cancelled" | "dispatching" | "delivered" | "prepared" | "undeliverable";
521
+ inputSeq?: number | undefined;
522
+ answerMessageId?: string | undefined;
523
+ reason?: string | undefined;
524
+ } | undefined;
525
+ }[];
526
+ experts: {
527
+ id: string;
528
+ digest: string;
529
+ botId: string;
530
+ memberId: string;
531
+ turnId: string;
532
+ childSessionId: string;
533
+ state: "failed" | "pending" | "invited";
534
+ reason?: string | undefined;
535
+ }[];
536
+ group?: {
537
+ groupId: string;
538
+ groupCreatedAt: number;
539
+ } | undefined;
540
+ collaboration?: {
541
+ requests: number;
542
+ operations: {
543
+ id: string;
544
+ digest: string;
545
+ target: {
546
+ botId: string;
547
+ botCreatedAt: number;
548
+ };
549
+ state: "unknown" | "completed" | "failed" | "cancelled" | "prepared";
550
+ childId?: string | undefined;
551
+ status?: string | undefined;
552
+ resultDigest?: string | undefined;
553
+ errorCode?: string | undefined;
554
+ diagnostic?: string | undefined;
555
+ }[];
556
+ } | undefined;
557
+ initialPending?: boolean | undefined;
558
+ materials?: {
559
+ id: string;
560
+ operationId: string;
561
+ requestDigest: string;
562
+ kind: "file" | "input-text" | "github-ci";
563
+ name: string;
564
+ sourceId: string;
565
+ sourceVersion: string;
566
+ digest: string;
567
+ text: string;
568
+ question: string;
569
+ citation: string;
570
+ readers: {
571
+ botId: string;
572
+ botCreatedAt: number;
573
+ }[];
574
+ createdAt: number;
575
+ }[] | undefined;
576
+ blockers?: {
577
+ id: string;
578
+ assignmentId: string;
579
+ desiredRevision: number;
580
+ reason: string;
581
+ observedAt: number;
582
+ state: "ready" | "superseded" | "waiting" | "continued";
583
+ name?: string | undefined;
584
+ }[] | undefined;
585
+ resumes?: {
586
+ operationId: string;
587
+ digest: string;
588
+ messageId: string;
589
+ expectedRevision: number;
590
+ state: "unknown" | "queued" | "dispatching";
591
+ blockerIds: string[];
592
+ createdAt: number;
593
+ contentDigest?: string | undefined;
594
+ originalDigest?: string | undefined;
595
+ previousMessageId?: string | undefined;
596
+ }[] | undefined;
597
+ reason?: string | undefined;
598
+ };
599
+ group?: {
600
+ unread: boolean;
601
+ readRevision: number;
602
+ group: {
603
+ id: string;
604
+ operationId: string;
605
+ createDigest: string;
606
+ createdAt: number;
607
+ updatedAt: number;
608
+ schemaVersion: 1;
609
+ name: string;
610
+ rootSessionId: string;
611
+ rootPresetId: "dsh-bot-group-root";
612
+ cwd: string;
613
+ mode: "natural" | "mention" | "round-robin";
614
+ membershipRevision: number;
615
+ revision: number;
616
+ archived: boolean;
617
+ state: "ready" | "creating" | "recovery_needed";
618
+ onDemand?: boolean | undefined;
619
+ memberRoles?: {
620
+ bot: {
621
+ botId: string;
622
+ botCreatedAt: number;
623
+ };
624
+ role: string;
625
+ }[] | undefined;
626
+ modelSelection?: {
627
+ provider: string;
628
+ model: string;
629
+ reasoningEffort?: string | undefined;
630
+ } | undefined;
631
+ memberModelSelections?: {
632
+ memberId: string;
633
+ modelSelection: {
634
+ provider: string;
635
+ model: string;
636
+ reasoningEffort?: string | undefined;
637
+ };
638
+ }[] | undefined;
639
+ modelRevision?: number | undefined;
640
+ nextMemberId?: string | undefined;
641
+ supergroup?: {
642
+ workId: string;
643
+ originSessionId: string;
644
+ originMessageId: string;
645
+ owner: {
646
+ botId: string;
647
+ botCreatedAt: number;
648
+ };
649
+ readers: {
650
+ botId: string;
651
+ botCreatedAt: number;
652
+ }[];
653
+ expiresAt: number;
654
+ } | undefined;
655
+ };
656
+ members: {
657
+ id: string;
658
+ group: {
659
+ groupId: string;
660
+ groupCreatedAt: number;
661
+ };
662
+ bot: {
663
+ botId: string;
664
+ botCreatedAt: number;
665
+ };
666
+ order: number;
667
+ joinedAt: number;
668
+ enabled: boolean;
669
+ removedAt?: number | undefined;
670
+ }[];
671
+ unavailableMemberIds: string[];
672
+ running: boolean;
673
+ turns: {
674
+ id: string;
675
+ group: {
676
+ groupId: string;
677
+ groupCreatedAt: number;
678
+ };
679
+ operationId: string;
680
+ requestDigest: string;
681
+ inputMessageId: string;
682
+ createdAt: number;
683
+ updatedAt: number;
684
+ revision: number;
685
+ schemaVersion: 1;
686
+ membershipRevision: number;
687
+ orderedMemberIds: string[];
688
+ mode: "natural" | "mention" | "round-robin";
689
+ contextThroughSeq: number;
690
+ state: "running" | "completed" | "cancelled" | "accepted" | "recovery_needed" | "idle" | "paused" | "partial";
691
+ ownerFollowUp?: {
692
+ predecessorTurnId: string;
693
+ predecessorTurnRevision: number;
694
+ membershipRevision: number;
695
+ modelRevision: number;
696
+ memberId: string;
697
+ bot: {
698
+ botId: string;
699
+ botCreatedAt: number;
700
+ };
701
+ botRevision: number;
702
+ modelSelection: {
703
+ provider: string;
704
+ model: string;
705
+ reasoningEffort?: string | undefined;
706
+ };
707
+ cardId: string;
708
+ cardRevision: number;
709
+ } | undefined;
710
+ proactive?: {
711
+ ticketId: string;
712
+ assignmentId: string;
713
+ provider: string;
714
+ model: string;
715
+ botRevisions: [number, number] | [number];
716
+ memberModels?: {
717
+ memberId: string;
718
+ modelSelection: {
719
+ provider: string;
720
+ model: string;
721
+ reasoningEffort?: string | undefined;
722
+ };
723
+ }[] | undefined;
724
+ modelRevision?: number | undefined;
725
+ followUp?: {
726
+ predecessorTurnId: string;
727
+ factId: string;
728
+ } | undefined;
729
+ requestBudget?: {
730
+ maxTokens: number;
731
+ outputTokens: number;
732
+ deadlineAt: string;
733
+ } | undefined;
734
+ repair?: {
735
+ phase: "plan" | "implement" | "review";
736
+ maxTokens: number;
737
+ outputTokens: number;
738
+ deadlineAt: string;
739
+ predecessorTurnId?: string | undefined;
740
+ } | undefined;
741
+ } | undefined;
742
+ inputSeq?: number | undefined;
743
+ routing?: {
744
+ strategy: "explicit" | "legacy" | "local-role" | "fallback";
745
+ version: 1;
746
+ candidateMemberIds: string[];
747
+ selectedMemberIds: string[];
748
+ reason: "failed" | "disabled" | "mode" | "mention" | "reply" | "round" | "role-match" | "no-match";
749
+ deciderCalls: 0;
750
+ plannedCalls: number;
751
+ modelRequests?: number | undefined;
752
+ } | undefined;
753
+ modelSelection?: {
754
+ provider: string;
755
+ model: string;
756
+ reasoningEffort?: string | undefined;
757
+ } | undefined;
758
+ memberModelSelections?: {
759
+ memberId: string;
760
+ modelSelection: {
761
+ provider: string;
762
+ model: string;
763
+ reasoningEffort?: string | undefined;
764
+ };
765
+ }[] | undefined;
766
+ predecessorTurnIds?: string[] | undefined;
767
+ followups?: {
768
+ operationId: string;
769
+ requestDigest: string;
770
+ deliveryId: string;
771
+ messageId: string;
772
+ state: "unknown" | "accepted" | "dispatching";
773
+ childMessageId?: string | undefined;
774
+ }[] | undefined;
775
+ replyTo?: string | undefined;
776
+ protocol?: 2 | undefined;
777
+ automaticExecutions?: number | undefined;
778
+ continuationAllowance?: number | undefined;
779
+ stoppedMemberIds?: string[] | undefined;
780
+ }[];
781
+ deliveries: {
782
+ id: string;
783
+ turnId: string;
784
+ memberId: string;
785
+ ordinal: number;
786
+ bot: {
787
+ botId: string;
788
+ botCreatedAt: number;
789
+ };
790
+ botRevision: number;
791
+ presetId: string;
792
+ contextOutputMessageIds: string[];
793
+ contextTruncated: boolean;
794
+ state: "unknown" | "running" | "completed" | "failed" | "cancelled" | "pending" | "starting" | "skipped";
795
+ revision?: number | undefined;
796
+ updatedAt?: number | undefined;
797
+ automatic?: boolean | undefined;
798
+ startedAt?: number | undefined;
799
+ endedAt?: number | undefined;
800
+ nativeRunId?: string | undefined;
801
+ childMessageId?: string | undefined;
802
+ joinedDeliveryId?: string | undefined;
803
+ childSessionId?: string | undefined;
804
+ triggerMessageId?: string | undefined;
805
+ returnMemberId?: string | undefined;
806
+ requestDigest?: string | undefined;
807
+ skipped?: boolean | undefined;
808
+ outputMessageId?: string | undefined;
809
+ outputSeq?: number | undefined;
810
+ stopReason?: string | undefined;
811
+ reasonCode?: string | undefined;
812
+ failure?: {
813
+ message: string;
814
+ code?: string | undefined;
815
+ status?: number | undefined;
816
+ } | undefined;
817
+ }[];
818
+ messages: {
819
+ id: string;
820
+ seq: number;
821
+ at: number;
822
+ text: string;
823
+ turnId: string;
824
+ hasNonText?: boolean | undefined;
825
+ attachments?: ({
826
+ type: "file";
827
+ attachment: {
828
+ attachmentId: string;
829
+ name: string;
830
+ bytes: number;
831
+ };
832
+ } | {
833
+ type: "image";
834
+ attachment: {
835
+ attachmentId: string;
836
+ mediaType: "image/png" | "image/jpeg" | "image/webp" | "image/gif";
837
+ bytes: number;
838
+ width: number;
839
+ height: number;
840
+ name?: string | undefined;
841
+ originalDimensions?: {
842
+ width: number;
843
+ height: number;
844
+ } | undefined;
845
+ };
846
+ offloaded?: true | undefined;
847
+ })[] | undefined;
848
+ replyTo?: string | undefined;
849
+ authorKind?: "bot" | "proactive" | "user" | undefined;
850
+ causeId?: string | undefined;
851
+ speaker?: {
852
+ bot: {
853
+ botId: string;
854
+ botCreatedAt: number;
855
+ };
856
+ name: string;
857
+ avatar?: string | undefined;
858
+ 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;
859
+ avatarVariant?: "classic" | "glasses" | "spout" | "baby" | "hat" | "sleeping" | "auto" | undefined;
860
+ } | undefined;
861
+ childSessionId?: string | undefined;
862
+ stopReason?: string | undefined;
863
+ failure?: {
864
+ message: string;
865
+ code?: string | undefined;
866
+ status?: number | undefined;
867
+ } | undefined;
868
+ }[];
869
+ hasEarlier: boolean;
870
+ latest?: {
871
+ seq: number;
872
+ at: number;
873
+ speaker?: {
874
+ bot: {
875
+ botId: string;
876
+ botCreatedAt: number;
877
+ };
878
+ name: string;
879
+ avatar?: string | undefined;
880
+ 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;
881
+ avatarVariant?: "classic" | "glasses" | "spout" | "baby" | "hat" | "sleeping" | "auto" | undefined;
882
+ } | undefined;
883
+ } | undefined;
884
+ reason?: "recovery-needed" | "root-owned-elsewhere" | "root-unavailable" | undefined;
885
+ } | undefined;
886
+ };
887
+ receipt: {
888
+ operationId: string;
889
+ digest: string;
890
+ messageId: string;
891
+ expectedRevision: number;
892
+ state: "unknown" | "queued" | "running" | "completed" | "cancelled" | "conflict" | "stored";
893
+ seq?: number | undefined;
894
+ acceptedRevision?: number | undefined;
895
+ memberIds?: string[] | undefined;
896
+ replyTo?: string | undefined;
897
+ reason?: string | undefined;
898
+ delivery?: {
899
+ id: string;
900
+ messageId: string;
901
+ digest: string;
902
+ targetSessionId: string;
903
+ resultVersion: string;
904
+ state: "unknown" | "queued" | "cancelled" | "dispatching" | "delivered" | "prepared" | "undeliverable";
905
+ inputSeq?: number | undefined;
906
+ answerMessageId?: string | undefined;
907
+ reason?: string | undefined;
908
+ } | undefined;
909
+ };
910
+ }>;
911
+ private scheduleGroupInput;
912
+ private deliverGroupResult;
913
+ forSession(input: {
914
+ sessionId: string;
915
+ messageId: string;
916
+ }): Promise<SupergroupWorkView | null>;
917
+ cancel(id: string, expectedRevision: number): Promise<void>;
918
+ private cancelCurrent;
919
+ configChanged(): Promise<void>;
920
+ close(): Promise<void>;
921
+ }
922
+ declare module '@deepseek-ai/dsh-llm' {
923
+ interface MessageSourceMap {
924
+ 'dsh-bot-supergroup-result': {
925
+ kind: 'dsh-bot-supergroup-result';
926
+ deliveryId: string;
927
+ workId: string;
928
+ group: GroupKey;
929
+ originSessionId: string;
930
+ originMessageId: string;
931
+ originSeq: number;
932
+ resultVersion: string;
933
+ };
934
+ }
935
+ }