dsh-botgroup 0.7.1 → 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 (447) hide show
  1. package/README.en.md +14 -8
  2. package/README.md +14 -8
  3. package/lib/client.js +8886 -7560
  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 +53 -20
  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 +3 -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 +6 -3
  41. package/lib/host/data-flow/outlets.js +44 -9
  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.d.ts +1 -1
  49. package/lib/host/errors.js +1 -1
  50. package/lib/host/errors.js.map +1 -1
  51. package/lib/host/groups/concurrent.js +26 -8
  52. package/lib/host/groups/concurrent.js.map +1 -1
  53. package/lib/host/groups/context-flow.js +1 -1
  54. package/lib/host/groups/data-flow.d.ts +7 -2
  55. package/lib/host/groups/data-flow.js +29 -6
  56. package/lib/host/groups/data-flow.js.map +1 -1
  57. package/lib/host/groups/deletion.d.ts +15 -0
  58. package/lib/host/groups/deletion.js +200 -0
  59. package/lib/host/groups/deletion.js.map +1 -0
  60. package/lib/host/groups/export-pending.d.ts +2 -2
  61. package/lib/host/groups/export-pending.js +3 -3
  62. package/lib/host/groups/export-pending.js.map +1 -1
  63. package/lib/host/groups/export-review.d.ts +3 -2
  64. package/lib/host/groups/export-review.js +26 -8
  65. package/lib/host/groups/export-review.js.map +1 -1
  66. package/lib/host/groups/export-settings.js +1 -1
  67. package/lib/host/groups/failure.js +1 -1
  68. package/lib/host/groups/guest-question.d.ts +13 -0
  69. package/lib/host/groups/guest-question.js +54 -0
  70. package/lib/host/groups/guest-question.js.map +1 -0
  71. package/lib/host/groups/members.js +3 -1
  72. package/lib/host/groups/members.js.map +1 -1
  73. package/lib/host/groups/memory-status.js +1 -1
  74. package/lib/host/groups/messages.d.ts +280 -2
  75. package/lib/host/groups/messages.js +47 -17
  76. package/lib/host/groups/messages.js.map +1 -1
  77. package/lib/host/groups/model-selection.js +1 -1
  78. package/lib/host/groups/model.d.ts +46 -4
  79. package/lib/host/groups/model.js +6 -8
  80. package/lib/host/groups/model.js.map +1 -1
  81. package/lib/host/groups/owner-follow-up.js +1 -1
  82. package/lib/host/groups/recall-sessions.js +1 -1
  83. package/lib/host/groups/recall-tool.js +1 -1
  84. package/lib/host/groups/recall.js +1 -1
  85. package/lib/host/groups/relay-answer.d.ts +35 -0
  86. package/lib/host/groups/relay-answer.js +61 -0
  87. package/lib/host/groups/relay-answer.js.map +1 -0
  88. package/lib/host/groups/relay-details.d.ts +6 -0
  89. package/lib/host/groups/relay-details.js +133 -0
  90. package/lib/host/groups/relay-details.js.map +1 -0
  91. package/lib/host/groups/relay-receipts.d.ts +9 -0
  92. package/lib/host/groups/relay-receipts.js +87 -0
  93. package/lib/host/groups/relay-receipts.js.map +1 -0
  94. package/lib/host/groups/relay-recovery.d.ts +4 -0
  95. package/lib/host/groups/relay-recovery.js +82 -0
  96. package/lib/host/groups/relay-recovery.js.map +1 -0
  97. package/lib/host/groups/remote.d.ts +116 -0
  98. package/lib/host/groups/remote.js +17 -1
  99. package/lib/host/groups/remote.js.map +1 -1
  100. package/lib/host/groups/root-guard.js +1 -1
  101. package/lib/host/groups/roots.js +18 -3
  102. package/lib/host/groups/roots.js.map +1 -1
  103. package/lib/host/groups/round-robin.js +1 -1
  104. package/lib/host/groups/routing.d.ts +6 -2
  105. package/lib/host/groups/routing.js +33 -7
  106. package/lib/host/groups/routing.js.map +1 -1
  107. package/lib/host/groups/service.d.ts +297 -0
  108. package/lib/host/groups/service.js +58 -30
  109. package/lib/host/groups/service.js.map +1 -1
  110. package/lib/host/groups/state.d.ts +97 -2
  111. package/lib/host/groups/state.js +3 -1
  112. package/lib/host/groups/state.js.map +1 -1
  113. package/lib/host/groups/supergroup-admission.js +1 -1
  114. package/lib/host/groups/team-recipes.js +1 -1
  115. package/lib/host/groups/turn-runner.d.ts +30 -1
  116. package/lib/host/groups/turn-runner.js +61 -40
  117. package/lib/host/groups/turn-runner.js.map +1 -1
  118. package/lib/host/groups/turns.d.ts +233 -0
  119. package/lib/host/groups/turns.js +144 -33
  120. package/lib/host/groups/turns.js.map +1 -1
  121. package/lib/host/groups/worker-capabilities.d.ts +9 -0
  122. package/lib/host/groups/worker-capabilities.js +56 -0
  123. package/lib/host/groups/worker-capabilities.js.map +1 -0
  124. package/lib/host/groups/worker-tool.d.ts +10 -1
  125. package/lib/host/groups/worker-tool.js +46 -18
  126. package/lib/host/groups/worker-tool.js.map +1 -1
  127. package/lib/host/home.js +1 -1
  128. package/lib/host/im/service.js +1 -1
  129. package/lib/host/index.js +1 -1
  130. package/lib/host/live-persona.js +1 -1
  131. package/lib/host/main-session.js +1 -1
  132. package/lib/host/memory/admission.js +1 -1
  133. package/lib/host/memory/auto-share.js +1 -1
  134. package/lib/host/memory/confirmation.js +1 -1
  135. package/lib/host/memory/conflicts.js +1 -1
  136. package/lib/host/memory/consolidation-config.js +1 -1
  137. package/lib/host/memory/consolidation-native.js +1 -1
  138. package/lib/host/memory/consolidation-source.js +1 -1
  139. package/lib/host/memory/consolidation.js +28 -16
  140. package/lib/host/memory/consolidation.js.map +1 -1
  141. package/lib/host/memory/context.js +1 -1
  142. package/lib/host/memory/domain-v2.js +1 -1
  143. package/lib/host/memory/facade.js +10 -3
  144. package/lib/host/memory/facade.js.map +1 -1
  145. package/lib/host/memory/forget-preview.js +1 -1
  146. package/lib/host/memory/forget-runner.js +1 -1
  147. package/lib/host/memory/forget-service.js +1 -1
  148. package/lib/host/memory/history-proof.js +1 -1
  149. package/lib/host/memory/history.js +1 -1
  150. package/lib/host/memory/layout-upgrade.js +1 -1
  151. package/lib/host/memory/migration.js +1 -1
  152. package/lib/host/memory/op-log.js +1 -1
  153. package/lib/host/memory/open-v2.js +1 -1
  154. package/lib/host/memory/owner-lease.js +1 -1
  155. package/lib/host/memory/persistent-map.js +1 -1
  156. package/lib/host/memory/port.d.ts +1 -1
  157. package/lib/host/memory/port.js +1 -1
  158. package/lib/host/memory/preserve-inbox.js +1 -1
  159. package/lib/host/memory/projection.js +1 -1
  160. package/lib/host/memory/prompt.js +1 -1
  161. package/lib/host/memory/query.js +1 -1
  162. package/lib/host/memory/quota-replay.js +1 -1
  163. package/lib/host/memory/quota.js +1 -1
  164. package/lib/host/memory/remote.js +1 -1
  165. package/lib/host/memory/retrieval-config.js +1 -1
  166. package/lib/host/memory/retrieval-rank.js +1 -1
  167. package/lib/host/memory/retrieval-text.js +1 -1
  168. package/lib/host/memory/root-instructions.js +1 -1
  169. package/lib/host/memory/secrets.js +1 -1
  170. package/lib/host/memory/service.d.ts +3 -2
  171. package/lib/host/memory/service.js +10 -13
  172. package/lib/host/memory/service.js.map +1 -1
  173. package/lib/host/memory/shards.js +1 -1
  174. package/lib/host/memory/store-v2.d.ts +1 -1
  175. package/lib/host/memory/store-v2.js +28 -7
  176. package/lib/host/memory/store-v2.js.map +1 -1
  177. package/lib/host/memory/temporal.d.ts +1 -0
  178. package/lib/host/memory/temporal.js +5 -1
  179. package/lib/host/memory/temporal.js.map +1 -1
  180. package/lib/host/memory/tool-guidance.js +1 -1
  181. package/lib/host/memory/tools.d.ts +1 -1
  182. package/lib/host/memory/tools.js +14 -6
  183. package/lib/host/memory/tools.js.map +1 -1
  184. package/lib/host/memory/trusted-ingress.js +1 -1
  185. package/lib/host/memory/version.js +1 -1
  186. package/lib/host/messaging/config.js +1 -1
  187. package/lib/host/messaging/core.d.ts +5 -2
  188. package/lib/host/messaging/core.js +1 -1
  189. package/lib/host/messaging/core.js.map +1 -1
  190. package/lib/host/messaging/delivery.d.ts +1 -1
  191. package/lib/host/messaging/delivery.js +6 -5
  192. package/lib/host/messaging/delivery.js.map +1 -1
  193. package/lib/host/messaging/display-turn.d.ts +5 -0
  194. package/lib/host/messaging/display-turn.js +58 -0
  195. package/lib/host/messaging/display-turn.js.map +1 -0
  196. package/lib/host/messaging/evidence.js +1 -1
  197. package/lib/host/messaging/interrupt.js +1 -1
  198. package/lib/host/messaging/peer-result.d.ts +25 -0
  199. package/lib/host/messaging/peer-result.js +113 -0
  200. package/lib/host/messaging/peer-result.js.map +1 -0
  201. package/lib/host/messaging/recovery.js +1 -1
  202. package/lib/host/messaging/remote.d.ts +1 -0
  203. package/lib/host/messaging/remote.js +1 -1
  204. package/lib/host/messaging/reply-routing.js +65 -28
  205. package/lib/host/messaging/reply-routing.js.map +1 -1
  206. package/lib/host/messaging/result-recall.d.ts +59 -0
  207. package/lib/host/messaging/result-recall.js +65 -0
  208. package/lib/host/messaging/result-recall.js.map +1 -0
  209. package/lib/host/messaging/safety.d.ts +3 -3
  210. package/lib/host/messaging/safety.js +16 -32
  211. package/lib/host/messaging/safety.js.map +1 -1
  212. package/lib/host/messaging/scoped-projection.d.ts +3 -0
  213. package/lib/host/messaging/scoped-projection.js +18 -8
  214. package/lib/host/messaging/scoped-projection.js.map +1 -1
  215. package/lib/host/messaging/service.d.ts +26 -0
  216. package/lib/host/messaging/service.js +40 -1
  217. package/lib/host/messaging/service.js.map +1 -1
  218. package/lib/host/messaging/store.d.ts +14 -0
  219. package/lib/host/messaging/store.js +12 -1
  220. package/lib/host/messaging/store.js.map +1 -1
  221. package/lib/host/messaging/tool.js +38 -30
  222. package/lib/host/messaging/tool.js.map +1 -1
  223. package/lib/host/messaging/wake.js +1 -1
  224. package/lib/host/native-schedule/outcomes.js +1 -1
  225. package/lib/host/native-schedule/service.js +1 -1
  226. package/lib/host/notifications/data-flow.js +1 -1
  227. package/lib/host/notifications/remote.js +1 -1
  228. package/lib/host/notifications/service.js +1 -1
  229. package/lib/host/notifications/time.js +1 -1
  230. package/lib/host/notifications/tool.js +1 -1
  231. package/lib/host/onboarding/coordinator.js +1 -1
  232. package/lib/host/onboarding/guard.js +1 -1
  233. package/lib/host/proactive/auto-admission.js +1 -1
  234. package/lib/host/proactive/config.js +1 -1
  235. package/lib/host/proactive/coordinator-client.js +1 -1
  236. package/lib/host/proactive/deferred-notices.d.ts +6 -0
  237. package/lib/host/proactive/deferred-notices.js +29 -4
  238. package/lib/host/proactive/deferred-notices.js.map +1 -1
  239. package/lib/host/proactive/execution-prompt.js +1 -1
  240. package/lib/host/proactive/execution.js +1 -1
  241. package/lib/host/proactive/executors/command.js +1 -1
  242. package/lib/host/proactive/executors/json-command-bridge-entry.js +1 -1
  243. package/lib/host/proactive/executors/json-command-bridge.js +1 -1
  244. package/lib/host/proactive/executors/loopback.js +1 -1
  245. package/lib/host/proactive/feedback-workflow.js +1 -1
  246. package/lib/host/proactive/feedback.js +1 -1
  247. package/lib/host/proactive/follow-up-events.js +7 -4
  248. package/lib/host/proactive/follow-up-events.js.map +1 -1
  249. package/lib/host/proactive/follow-up-facts.js +1 -1
  250. package/lib/host/proactive/follow-up-tool.js +3 -2
  251. package/lib/host/proactive/follow-up-tool.js.map +1 -1
  252. package/lib/host/proactive/governance-artifacts.js +1 -1
  253. package/lib/host/proactive/governance-service.js +1 -1
  254. package/lib/host/proactive/group-budget.js +1 -1
  255. package/lib/host/proactive/group-follow-up.js +1 -1
  256. package/lib/host/proactive/group-repair.js +1 -1
  257. package/lib/host/proactive/index.js +1 -1
  258. package/lib/host/proactive/lifecycle.js +1 -1
  259. package/lib/host/proactive/method-evaluation.js +1 -1
  260. package/lib/host/proactive/method-package.js +1 -1
  261. package/lib/host/proactive/method-skill.js +1 -1
  262. package/lib/host/proactive/model-budget.js +1 -1
  263. package/lib/host/proactive/notice-pump.d.ts +1 -0
  264. package/lib/host/proactive/notice-pump.js +90 -68
  265. package/lib/host/proactive/notice-pump.js.map +1 -1
  266. package/lib/host/proactive/notification-bridge.js +1 -1
  267. package/lib/host/proactive/read-query.js +1 -1
  268. package/lib/host/proactive/remote.d.ts +2 -0
  269. package/lib/host/proactive/remote.js +1 -1
  270. package/lib/host/proactive/repair.js +1 -1
  271. package/lib/host/proactive/result-journal.js +1 -1
  272. package/lib/host/proactive/service.d.ts +20 -0
  273. package/lib/host/proactive/service.js +3 -2
  274. package/lib/host/proactive/service.js.map +1 -1
  275. package/lib/host/proactive/session-history.js +1 -1
  276. package/lib/host/proactive/setup.js +1 -1
  277. package/lib/host/proactive/sources/ci-feed.js +1 -1
  278. package/lib/host/proactive/sources/ci.js +1 -1
  279. package/lib/host/proactive/sources/github-ci.js +109 -39
  280. package/lib/host/proactive/sources/github-ci.js.map +1 -1
  281. package/lib/host/proactive/task-cost.js +1 -1
  282. package/lib/host/proactive/wire.js +1 -1
  283. package/lib/host/proactive/work-continuation.js +1 -1
  284. package/lib/host/proactive/workspace-process.js +1 -1
  285. package/lib/host/proactive/workspace-repair.js +1 -1
  286. package/lib/host/reference-memory/backend.js +1 -1
  287. package/lib/host/reference-memory/cleanup-files.js +1 -1
  288. package/lib/host/reference-memory/copies.js +1 -1
  289. package/lib/host/reference-memory/files.js +1 -1
  290. package/lib/host/reference-memory/model.js +1 -1
  291. package/lib/host/reference-memory/service.js +1 -1
  292. package/lib/host/reference-memory/writer.js +1 -1
  293. package/lib/host/registry/identity.js +1 -1
  294. package/lib/host/registry/lifecycle.js +1 -1
  295. package/lib/host/registry/mutations.js +1 -1
  296. package/lib/host/registry/presets.js +1 -1
  297. package/lib/host/registry/types.js +1 -1
  298. package/lib/host/registry-config.js +1 -1
  299. package/lib/host/registry.js +17 -18
  300. package/lib/host/registry.js.map +1 -1
  301. package/lib/host/shadow/budget.js +1 -1
  302. package/lib/host/shadow/config.js +1 -1
  303. package/lib/host/shadow/notification-adapter.js +1 -1
  304. package/lib/host/shadow/planner.js +1 -1
  305. package/lib/host/shadow/schedule-adapter.js +1 -1
  306. package/lib/host/shadow/service.js +1 -1
  307. package/lib/host/store.js +1 -1
  308. package/lib/host/stores/activity.js +1 -1
  309. package/lib/host/stores/bots.js +1 -1
  310. package/lib/host/stores/domain.js +1 -1
  311. package/lib/host/stores/memory.js +1 -1
  312. package/lib/host/supergroup/collaboration.d.ts +13 -2
  313. package/lib/host/supergroup/collaboration.js +24 -9
  314. package/lib/host/supergroup/collaboration.js.map +1 -1
  315. package/lib/host/supergroup/config.js +1 -1
  316. package/lib/host/supergroup/input-capability.js +1 -1
  317. package/lib/host/supergroup/peer-task.d.ts +6 -0
  318. package/lib/host/supergroup/peer-task.js +48 -0
  319. package/lib/host/supergroup/peer-task.js.map +1 -0
  320. package/lib/host/supergroup/recovery-view.js +1 -1
  321. package/lib/host/supergroup/remote.d.ts +96 -0
  322. package/lib/host/supergroup/remote.js +1 -1
  323. package/lib/host/supergroup/service.d.ts +32 -0
  324. package/lib/host/supergroup/service.js +92 -12
  325. package/lib/host/supergroup/service.js.map +1 -1
  326. package/lib/host/supergroup/task-support.js +1 -1
  327. package/lib/host/supergroup/tool.js +1 -1
  328. package/lib/host/tools/bot-manage.js +13 -9
  329. package/lib/host/tools/bot-manage.js.map +1 -1
  330. package/lib/host/workspace/remote.js +1 -1
  331. package/lib/host/workspace/service.js +1 -1
  332. package/lib/index.d.ts +1 -1
  333. package/lib/index.js +1 -1
  334. package/lib/module-manifest.json +303 -288
  335. package/lib/proactive-coordinator/main.mjs +27 -5
  336. package/lib/proactive-coordinator/provenance.json +1 -1
  337. package/lib/shared/activity-preview.js +1 -1
  338. package/lib/shared/activity.d.ts +2 -0
  339. package/lib/shared/activity.js +2 -1
  340. package/lib/shared/activity.js.map +1 -1
  341. package/lib/shared/addressed-bot.d.ts +30 -0
  342. package/lib/shared/addressed-bot.js +98 -0
  343. package/lib/shared/addressed-bot.js.map +1 -0
  344. package/lib/shared/automation-contract.js +1 -1
  345. package/lib/shared/automation.js +1 -1
  346. package/lib/shared/bot-brand.js +1 -1
  347. package/lib/shared/capabilities-contract.js +1 -1
  348. package/lib/shared/collaboration-contract.js +1 -1
  349. package/lib/shared/collaboration.js +1 -1
  350. package/lib/shared/connectors.js +1 -1
  351. package/lib/shared/data-flow.js +1 -1
  352. package/lib/shared/eval-budget.js +1 -1
  353. package/lib/shared/group-export-review.js +2 -2
  354. package/lib/shared/group-export-review.js.map +1 -1
  355. package/lib/shared/group-limits.js +1 -1
  356. package/lib/shared/group-memory-intent.d.ts +57 -0
  357. package/lib/shared/group-memory-intent.js +20 -0
  358. package/lib/shared/group-memory-intent.js.map +1 -0
  359. package/lib/shared/group-mentions.d.ts +20 -0
  360. package/lib/shared/group-mentions.js +62 -0
  361. package/lib/shared/group-mentions.js.map +1 -0
  362. package/lib/shared/group-recall-reads.js +1 -1
  363. package/lib/shared/group-recall.js +1 -1
  364. package/lib/shared/group-relay-details.d.ts +62 -0
  365. package/lib/shared/group-relay-details.js +16 -0
  366. package/lib/shared/group-relay-details.js.map +1 -0
  367. package/lib/shared/groups-contract.d.ts +577 -0
  368. package/lib/shared/groups-contract.js +8 -1
  369. package/lib/shared/groups-contract.js.map +1 -1
  370. package/lib/shared/groups.d.ts +66 -0
  371. package/lib/shared/groups.js +16 -2
  372. package/lib/shared/groups.js.map +1 -1
  373. package/lib/shared/identity.d.ts +1 -0
  374. package/lib/shared/identity.js +7 -1
  375. package/lib/shared/identity.js.map +1 -1
  376. package/lib/shared/ids.js +1 -1
  377. package/lib/shared/integrations-contract.js +1 -1
  378. package/lib/shared/integrations.js +1 -1
  379. package/lib/shared/managed-flow.js +1 -1
  380. package/lib/shared/memory-consolidation.js +1 -1
  381. package/lib/shared/memory-forget.js +1 -1
  382. package/lib/shared/memory-management.d.ts +1 -0
  383. package/lib/shared/memory-management.js +2 -2
  384. package/lib/shared/memory-management.js.map +1 -1
  385. package/lib/shared/memory-ops.js +1 -1
  386. package/lib/shared/memory-tool-names.js +1 -1
  387. package/lib/shared/memory-v2.js +1 -1
  388. package/lib/shared/messaging-contract.d.ts +4 -0
  389. package/lib/shared/messaging-contract.js +1 -1
  390. package/lib/shared/messaging.d.ts +71 -0
  391. package/lib/shared/messaging.js +9 -1
  392. package/lib/shared/messaging.js.map +1 -1
  393. package/lib/shared/native-schedule.js +1 -1
  394. package/lib/shared/notifications.js +1 -1
  395. package/lib/shared/onboarding-source.js +1 -1
  396. package/lib/shared/onboarding.js +1 -1
  397. package/lib/shared/operation-errors.d.ts +7 -0
  398. package/lib/shared/operation-errors.js +8 -1
  399. package/lib/shared/operation-errors.js.map +1 -1
  400. package/lib/shared/proactive/activity.js +1 -1
  401. package/lib/shared/proactive/document.js +1 -1
  402. package/lib/shared/proactive/feedback.js +1 -1
  403. package/lib/shared/proactive/follow-up.d.ts +30 -0
  404. package/lib/shared/proactive/follow-up.js +2 -1
  405. package/lib/shared/proactive/follow-up.js.map +1 -1
  406. package/lib/shared/proactive/governance.js +1 -1
  407. package/lib/shared/proactive/group-follow-up.js +1 -1
  408. package/lib/shared/proactive/group-repair.js +1 -1
  409. package/lib/shared/proactive/handoff.js +1 -1
  410. package/lib/shared/proactive/method-evaluation.js +1 -1
  411. package/lib/shared/proactive/method-package.js +1 -1
  412. package/lib/shared/proactive/notices.js +1 -1
  413. package/lib/shared/proactive/outcomes.js +1 -1
  414. package/lib/shared/proactive/protocol.d.ts +36 -0
  415. package/lib/shared/proactive/protocol.js +1 -1
  416. package/lib/shared/proactive/remote-contract.d.ts +16 -0
  417. package/lib/shared/proactive/remote-contract.js +1 -1
  418. package/lib/shared/proactive/repair.js +1 -1
  419. package/lib/shared/proactive/responsibility.js +1 -1
  420. package/lib/shared/proactive/setup.d.ts +6 -0
  421. package/lib/shared/proactive/setup.js +1 -1
  422. package/lib/shared/proactive/work-progress.js +1 -1
  423. package/lib/shared/proactive/work.js +1 -1
  424. package/lib/shared/proactive/workspace-repair.js +1 -1
  425. package/lib/shared/reference-memory.js +1 -1
  426. package/lib/shared/remote-contract.d.ts +6 -0
  427. package/lib/shared/remote-contract.js +1 -1
  428. package/lib/shared/remote-contract.js.map +1 -1
  429. package/lib/shared/routine-outcomes.js +1 -1
  430. package/lib/shared/schema.js +1 -1
  431. package/lib/shared/secrets.js +1 -1
  432. package/lib/shared/shadow.js +1 -1
  433. package/lib/shared/supergroup-contract.d.ts +300 -0
  434. package/lib/shared/supergroup-contract.js +1 -1
  435. package/lib/shared/supergroup.d.ts +54 -0
  436. package/lib/shared/supergroup.js +1 -1
  437. package/lib/shared/task-materials.js +1 -1
  438. package/lib/shared/team-recipes.js +1 -1
  439. package/lib/shared/version.d.ts +1 -1
  440. package/lib/shared/version.js +2 -2
  441. package/lib/shared/workspace-contract.js +1 -1
  442. package/lib/shared/workspace.js +1 -1
  443. package/lib/typert.host.js +1 -1
  444. package/lib/typert.remote-client.js +1 -1
  445. package/locale/en.json +110 -4
  446. package/locale/zh.json +110 -4
  447. package/package.json +1 -1
@@ -0,0 +1,48 @@
1
+ import { hasCredential } from '../../shared/secrets.js';
2
+ /** Extract the addressed part of a real human input. Never accept the main model's proposed
3
+ * text as evidence that a private chat fragment can be forwarded. */
4
+ export function addressedPeerTask(raw, targetId, directory) {
5
+ const input = raw.trimStart();
6
+ // "What can Jarvis do? Ask him." Limit the projection to the last self-contained
7
+ // question and require an unambiguous directory identity in that question.
8
+ const trailing = /([^\n\r::,,;;。!?!?]+[??])\s*(?:你(?:再|帮我)?)?(?:问问|问一下|问下)(?:他|她|对方)[。!!]?\s*$/u.exec(input);
9
+ if (trailing) {
10
+ const question = trailing[1].trim();
11
+ const identities = directory.filter(bot => [bot.name, bot.id].some(alias => {
12
+ if (!alias)
13
+ return false;
14
+ const escaped = alias.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
15
+ return new RegExp(`(?<![a-z0-9_-])${escaped}(?![a-z0-9_-])`, 'iu').test(question);
16
+ }));
17
+ if (identities.length === 1 && identities[0].id === targetId && !hasCredential(question))
18
+ return question;
19
+ }
20
+ const prefix = /^(?:@|(?:请|麻烦)?(?:你)?(?:再|直接)?(?:帮我)?(?:问(?:问|一下|下)?|让|请|告诉|通知|转告|追问)\s*@?|(?:please\s+)?(?:ask|tell|notify|message)\s+@?)/iu.exec(input);
21
+ if (!prefix)
22
+ return;
23
+ const rest = input.slice(prefix[0].length);
24
+ const matches = directory.flatMap(bot => [...new Set([bot.name, bot.id])].filter(alias => {
25
+ if (!alias || !rest.toLowerCase().startsWith(alias.toLowerCase()))
26
+ return false;
27
+ const after = rest.slice(alias.length);
28
+ return /^(?:\s|[::,,]|查|调研|研究|分析|解释|比较|总结|核对|给|看看|帮|再|搜|为什么|如何|怎么|能否|是否)/u.test(after);
29
+ }).map(alias => ({ id: bot.id, length: alias.length }))).sort((a, b) => b.length - a.length);
30
+ const match = matches[0];
31
+ // A user may also delegate the choice of teammate to their Bot.
32
+ const anyPeer = /^(?:(?:一位|一个|其他|别的|合适的)(?:合适的)?\s*(?:bot|机器人|助手)|(?:a|another) teammate)\s*/iu.exec(rest);
33
+ if (match && (match.id !== targetId || matches.some(row => row.length === match.length && row.id !== targetId)))
34
+ return;
35
+ const length = match?.length ?? anyPeer?.[0].length;
36
+ if (!length)
37
+ return;
38
+ const body = rest.slice(length).replace(/^\s*[::,,]?\s*/u, '');
39
+ // Explicit quotes delimit the entire intended material. For an unquoted directive,
40
+ // take only the addressed clause, excluding following commentary to the main Bot.
41
+ const quoted = /^(?:「([^」]+)」|“([^”]+)”|"([^"\n]+)")/u.exec(body);
42
+ if (!quoted && /^["“「]/u.test(body))
43
+ return;
44
+ const text = (quoted ? quoted[1] ?? quoted[2] ?? quoted[3] : /^[^\n\r,,;;。!?!?]+[。!?!?]?/u.exec(body)?.[0]?.split(/\.\s/u)[0])?.trim();
45
+ return text && !hasCredential(text) ? text : undefined;
46
+ }
47
+ //# sourceMappingURL=peer-task.js.map
48
+ export const DSH_BOT_MODULE_VERSION = '0.7.3';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"peer-task.js","sourceRoot":"","sources":["../../../src/host/supergroup/peer-task.ts"],"names":[],"mappings":"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"}
@@ -35,4 +35,4 @@ export function recoveryView(work, events, agentBusy) {
35
35
  timerWakeup: continuousCapabilities.timerWakeup, durableToolResume: continuousCapabilities.durableToolResume };
36
36
  }
37
37
  //# sourceMappingURL=recovery-view.js.map
38
- export const DSH_BOT_MODULE_VERSION = '0.7.1';
38
+ export const DSH_BOT_MODULE_VERSION = '0.7.3';
@@ -554,6 +554,23 @@ export declare class SupergroupRemote extends TypertRemoteService {
554
554
  cardId: string;
555
555
  cardRevision: number;
556
556
  } | undefined;
557
+ guestQuestion?: {
558
+ bot: {
559
+ botId: string;
560
+ botCreatedAt: number;
561
+ };
562
+ name: string;
563
+ via?: {
564
+ bot: {
565
+ botId: string;
566
+ botCreatedAt: number;
567
+ };
568
+ name: string;
569
+ memberId: string;
570
+ botRevision: number;
571
+ presetId: string;
572
+ } | undefined;
573
+ } | undefined;
557
574
  proactive?: {
558
575
  ticketId: string;
559
576
  assignmentId: string;
@@ -643,6 +660,9 @@ export declare class SupergroupRemote extends TypertRemoteService {
643
660
  revision?: number | undefined;
644
661
  updatedAt?: number | undefined;
645
662
  automatic?: boolean | undefined;
663
+ acceptedAt?: number | undefined;
664
+ answeredAt?: number | undefined;
665
+ relayAnswerFlowId?: string | undefined;
646
666
  startedAt?: number | undefined;
647
667
  endedAt?: number | undefined;
648
668
  nativeRunId?: string | undefined;
@@ -667,6 +687,7 @@ export declare class SupergroupRemote extends TypertRemoteService {
667
687
  requestId?: string | undefined;
668
688
  status?: number | undefined;
669
689
  } | undefined;
690
+ relayMarker?: "unavailable" | "unconfirmed" | undefined;
670
691
  staleExportClosedAt?: number | undefined;
671
692
  }[];
672
693
  messages: {
@@ -712,6 +733,8 @@ export declare class SupergroupRemote extends TypertRemoteService {
712
733
  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;
713
734
  avatarVariant?: "classic" | "glasses" | "spout" | "baby" | "hat" | "sleeping" | "auto" | undefined;
714
735
  } | undefined;
736
+ guestReply?: true | undefined;
737
+ relayReply?: true | undefined;
715
738
  childSessionId?: string | undefined;
716
739
  stopReason?: string | undefined;
717
740
  failure?: {
@@ -738,6 +761,7 @@ export declare class SupergroupRemote extends TypertRemoteService {
738
761
  } | undefined;
739
762
  } | undefined;
740
763
  reason?: "recovery-needed" | "root-owned-elsewhere" | "root-unavailable" | undefined;
764
+ memberLimit?: number | undefined;
741
765
  } | undefined;
742
766
  }[]>;
743
767
  byGroup(input: unknown): Promise<{
@@ -982,6 +1006,23 @@ export declare class SupergroupRemote extends TypertRemoteService {
982
1006
  cardId: string;
983
1007
  cardRevision: number;
984
1008
  } | undefined;
1009
+ guestQuestion?: {
1010
+ bot: {
1011
+ botId: string;
1012
+ botCreatedAt: number;
1013
+ };
1014
+ name: string;
1015
+ via?: {
1016
+ bot: {
1017
+ botId: string;
1018
+ botCreatedAt: number;
1019
+ };
1020
+ name: string;
1021
+ memberId: string;
1022
+ botRevision: number;
1023
+ presetId: string;
1024
+ } | undefined;
1025
+ } | undefined;
985
1026
  proactive?: {
986
1027
  ticketId: string;
987
1028
  assignmentId: string;
@@ -1071,6 +1112,9 @@ export declare class SupergroupRemote extends TypertRemoteService {
1071
1112
  revision?: number | undefined;
1072
1113
  updatedAt?: number | undefined;
1073
1114
  automatic?: boolean | undefined;
1115
+ acceptedAt?: number | undefined;
1116
+ answeredAt?: number | undefined;
1117
+ relayAnswerFlowId?: string | undefined;
1074
1118
  startedAt?: number | undefined;
1075
1119
  endedAt?: number | undefined;
1076
1120
  nativeRunId?: string | undefined;
@@ -1095,6 +1139,7 @@ export declare class SupergroupRemote extends TypertRemoteService {
1095
1139
  requestId?: string | undefined;
1096
1140
  status?: number | undefined;
1097
1141
  } | undefined;
1142
+ relayMarker?: "unavailable" | "unconfirmed" | undefined;
1098
1143
  staleExportClosedAt?: number | undefined;
1099
1144
  }[];
1100
1145
  messages: {
@@ -1140,6 +1185,8 @@ export declare class SupergroupRemote extends TypertRemoteService {
1140
1185
  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;
1141
1186
  avatarVariant?: "classic" | "glasses" | "spout" | "baby" | "hat" | "sleeping" | "auto" | undefined;
1142
1187
  } | undefined;
1188
+ guestReply?: true | undefined;
1189
+ relayReply?: true | undefined;
1143
1190
  childSessionId?: string | undefined;
1144
1191
  stopReason?: string | undefined;
1145
1192
  failure?: {
@@ -1166,6 +1213,7 @@ export declare class SupergroupRemote extends TypertRemoteService {
1166
1213
  } | undefined;
1167
1214
  } | undefined;
1168
1215
  reason?: "recovery-needed" | "root-owned-elsewhere" | "root-unavailable" | undefined;
1216
+ memberLimit?: number | undefined;
1169
1217
  } | undefined;
1170
1218
  } | null>;
1171
1219
  sendGroupInput(input: unknown): Promise<{
@@ -1411,6 +1459,23 @@ export declare class SupergroupRemote extends TypertRemoteService {
1411
1459
  cardId: string;
1412
1460
  cardRevision: number;
1413
1461
  } | undefined;
1462
+ guestQuestion?: {
1463
+ bot: {
1464
+ botId: string;
1465
+ botCreatedAt: number;
1466
+ };
1467
+ name: string;
1468
+ via?: {
1469
+ bot: {
1470
+ botId: string;
1471
+ botCreatedAt: number;
1472
+ };
1473
+ name: string;
1474
+ memberId: string;
1475
+ botRevision: number;
1476
+ presetId: string;
1477
+ } | undefined;
1478
+ } | undefined;
1414
1479
  proactive?: {
1415
1480
  ticketId: string;
1416
1481
  assignmentId: string;
@@ -1500,6 +1565,9 @@ export declare class SupergroupRemote extends TypertRemoteService {
1500
1565
  revision?: number | undefined;
1501
1566
  updatedAt?: number | undefined;
1502
1567
  automatic?: boolean | undefined;
1568
+ acceptedAt?: number | undefined;
1569
+ answeredAt?: number | undefined;
1570
+ relayAnswerFlowId?: string | undefined;
1503
1571
  startedAt?: number | undefined;
1504
1572
  endedAt?: number | undefined;
1505
1573
  nativeRunId?: string | undefined;
@@ -1524,6 +1592,7 @@ export declare class SupergroupRemote extends TypertRemoteService {
1524
1592
  requestId?: string | undefined;
1525
1593
  status?: number | undefined;
1526
1594
  } | undefined;
1595
+ relayMarker?: "unavailable" | "unconfirmed" | undefined;
1527
1596
  staleExportClosedAt?: number | undefined;
1528
1597
  }[];
1529
1598
  messages: {
@@ -1569,6 +1638,8 @@ export declare class SupergroupRemote extends TypertRemoteService {
1569
1638
  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;
1570
1639
  avatarVariant?: "classic" | "glasses" | "spout" | "baby" | "hat" | "sleeping" | "auto" | undefined;
1571
1640
  } | undefined;
1641
+ guestReply?: true | undefined;
1642
+ relayReply?: true | undefined;
1572
1643
  childSessionId?: string | undefined;
1573
1644
  stopReason?: string | undefined;
1574
1645
  failure?: {
@@ -1595,6 +1666,7 @@ export declare class SupergroupRemote extends TypertRemoteService {
1595
1666
  } | undefined;
1596
1667
  } | undefined;
1597
1668
  reason?: "recovery-needed" | "root-owned-elsewhere" | "root-unavailable" | undefined;
1669
+ memberLimit?: number | undefined;
1598
1670
  } | undefined;
1599
1671
  };
1600
1672
  receipt: {
@@ -1863,6 +1935,23 @@ export declare class SupergroupRemote extends TypertRemoteService {
1863
1935
  cardId: string;
1864
1936
  cardRevision: number;
1865
1937
  } | undefined;
1938
+ guestQuestion?: {
1939
+ bot: {
1940
+ botId: string;
1941
+ botCreatedAt: number;
1942
+ };
1943
+ name: string;
1944
+ via?: {
1945
+ bot: {
1946
+ botId: string;
1947
+ botCreatedAt: number;
1948
+ };
1949
+ name: string;
1950
+ memberId: string;
1951
+ botRevision: number;
1952
+ presetId: string;
1953
+ } | undefined;
1954
+ } | undefined;
1866
1955
  proactive?: {
1867
1956
  ticketId: string;
1868
1957
  assignmentId: string;
@@ -1952,6 +2041,9 @@ export declare class SupergroupRemote extends TypertRemoteService {
1952
2041
  revision?: number | undefined;
1953
2042
  updatedAt?: number | undefined;
1954
2043
  automatic?: boolean | undefined;
2044
+ acceptedAt?: number | undefined;
2045
+ answeredAt?: number | undefined;
2046
+ relayAnswerFlowId?: string | undefined;
1955
2047
  startedAt?: number | undefined;
1956
2048
  endedAt?: number | undefined;
1957
2049
  nativeRunId?: string | undefined;
@@ -1976,6 +2068,7 @@ export declare class SupergroupRemote extends TypertRemoteService {
1976
2068
  requestId?: string | undefined;
1977
2069
  status?: number | undefined;
1978
2070
  } | undefined;
2071
+ relayMarker?: "unavailable" | "unconfirmed" | undefined;
1979
2072
  staleExportClosedAt?: number | undefined;
1980
2073
  }[];
1981
2074
  messages: {
@@ -2021,6 +2114,8 @@ export declare class SupergroupRemote extends TypertRemoteService {
2021
2114
  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;
2022
2115
  avatarVariant?: "classic" | "glasses" | "spout" | "baby" | "hat" | "sleeping" | "auto" | undefined;
2023
2116
  } | undefined;
2117
+ guestReply?: true | undefined;
2118
+ relayReply?: true | undefined;
2024
2119
  childSessionId?: string | undefined;
2025
2120
  stopReason?: string | undefined;
2026
2121
  failure?: {
@@ -2047,6 +2142,7 @@ export declare class SupergroupRemote extends TypertRemoteService {
2047
2142
  } | undefined;
2048
2143
  } | undefined;
2049
2144
  reason?: "recovery-needed" | "root-owned-elsewhere" | "root-unavailable" | undefined;
2145
+ memberLimit?: number | undefined;
2050
2146
  } | undefined;
2051
2147
  } | null>;
2052
2148
  cancel(input: unknown): Promise<null>;
@@ -120,4 +120,4 @@ let SupergroupRemote = (() => {
120
120
  })();
121
121
  export { SupergroupRemote };
122
122
  //# sourceMappingURL=remote.js.map
123
- export const DSH_BOT_MODULE_VERSION = '0.7.1';
123
+ export const DSH_BOT_MODULE_VERSION = '0.7.3';
@@ -480,9 +480,16 @@ export declare class Supergroup {
480
480
  private groupMemberLimit;
481
481
  private configDigest;
482
482
  private read;
483
+ /** Narrow Host-only lookup. A delivered chat card can also be a failure diagnostic. */
484
+ peerReplyStatus(workId: string, operationId: string, target: BotKey, origin: {
485
+ bot: BotKey;
486
+ sessionId: string;
487
+ userMessageId: string;
488
+ }, expectedDigest?: string): 'completed' | 'pending' | 'closed' | 'unknown';
483
489
  private put;
484
490
  /** The latest substantive input must really be human. Ambient context is not authorization. */
485
491
  private human;
492
+ private peerTask;
486
493
  private authorizeCollaboration;
487
494
  continuationInstruction(agent: Agent): string;
488
495
  checkContinuation(agent: Agent, messages?: readonly UserMessage[]): Promise<void>;
@@ -491,6 +498,7 @@ export declare class Supergroup {
491
498
  private reserveWorkRequest;
492
499
  private finishCollaboration;
493
500
  private pool;
501
+ private workEnabled;
494
502
  private runtime;
495
503
  private chosen;
496
504
  invoke(agent: Agent, input: SupergroupInput, signal: AbortSignal): Promise<unknown>;
@@ -750,6 +758,23 @@ export declare class Supergroup {
750
758
  cardId: string;
751
759
  cardRevision: number;
752
760
  } | undefined;
761
+ guestQuestion?: {
762
+ bot: {
763
+ botId: string;
764
+ botCreatedAt: number;
765
+ };
766
+ name: string;
767
+ via?: {
768
+ bot: {
769
+ botId: string;
770
+ botCreatedAt: number;
771
+ };
772
+ name: string;
773
+ memberId: string;
774
+ botRevision: number;
775
+ presetId: string;
776
+ } | undefined;
777
+ } | undefined;
753
778
  proactive?: {
754
779
  ticketId: string;
755
780
  assignmentId: string;
@@ -839,6 +864,9 @@ export declare class Supergroup {
839
864
  revision?: number | undefined;
840
865
  updatedAt?: number | undefined;
841
866
  automatic?: boolean | undefined;
867
+ acceptedAt?: number | undefined;
868
+ answeredAt?: number | undefined;
869
+ relayAnswerFlowId?: string | undefined;
842
870
  startedAt?: number | undefined;
843
871
  endedAt?: number | undefined;
844
872
  nativeRunId?: string | undefined;
@@ -863,6 +891,7 @@ export declare class Supergroup {
863
891
  requestId?: string | undefined;
864
892
  status?: number | undefined;
865
893
  } | undefined;
894
+ relayMarker?: "unavailable" | "unconfirmed" | undefined;
866
895
  staleExportClosedAt?: number | undefined;
867
896
  }[];
868
897
  messages: {
@@ -908,6 +937,8 @@ export declare class Supergroup {
908
937
  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;
909
938
  avatarVariant?: "classic" | "glasses" | "spout" | "baby" | "hat" | "sleeping" | "auto" | undefined;
910
939
  } | undefined;
940
+ guestReply?: true | undefined;
941
+ relayReply?: true | undefined;
911
942
  childSessionId?: string | undefined;
912
943
  stopReason?: string | undefined;
913
944
  failure?: {
@@ -934,6 +965,7 @@ export declare class Supergroup {
934
965
  } | undefined;
935
966
  } | undefined;
936
967
  reason?: "recovery-needed" | "root-owned-elsewhere" | "root-unavailable" | undefined;
968
+ memberLimit?: number | undefined;
937
969
  } | undefined;
938
970
  };
939
971
  receipt: {
@@ -14,6 +14,8 @@ import { OperationError, Serial } from '../common/operations.js';
14
14
  import { isNativeAmbientSource } from '../common/native-ambient-source.js';
15
15
  import { Config } from './config.js';
16
16
  import { ScopedCollaboration, getScopedCollaborationBinding } from './collaboration.js';
17
+ import { addressedPeerTask } from './peer-task.js';
18
+ import { precedingPeerAsk } from '../messaging/result-recall.js';
17
19
  export const supergroupDomain = defineDomain({ name: 'dsh_bot_supergroup', version: 1,
18
20
  tables: { works: domainTable(supergroupWorkSchema) } });
19
21
  export const supergroupInputSchema = z.discriminatedUnion('action', [
@@ -101,6 +103,12 @@ export class Supergroup {
101
103
  }
102
104
  this.offExpert = this.groups.setExpertHandler(request => this.expert(request));
103
105
  this.collaboration = new ScopedCollaboration(this.ctx, this.registry, {
106
+ peerTask: (...args) => this.peerTask(...args),
107
+ hasSharedWork: async (agent, targetId) => {
108
+ const messageId = this.ctx.get('dshBotMessaging')?.provenance(agent).userMessageId;
109
+ const work = messageId && this.domain.table('works').get(`supergroup:${hash([agent.id, messageId])}`);
110
+ return !!work && !!this.active.get(work.id) && work.readers.some(reader => reader.botId === targetId);
111
+ },
104
112
  authorize: (...args) => this.authorizeCollaboration(...args),
105
113
  reserve: scope => this.reserveCollaborationRequest(scope),
106
114
  finish: (scope, result) => this.finishCollaboration(scope, result),
@@ -160,6 +168,25 @@ export class Supergroup {
160
168
  throw new OperationError('not-found');
161
169
  return row;
162
170
  }
171
+ /** Narrow Host-only lookup. A delivered chat card can also be a failure diagnostic. */
172
+ peerReplyStatus(workId, operationId, target, origin, expectedDigest) {
173
+ const work = !this.stopped && this.domain.table('works').get(workId);
174
+ if (!work || work.id !== workId || !same(work.owner, origin.bot) || work.originSessionId !== origin.sessionId ||
175
+ (work.inputMessageId !== origin.userMessageId && !work.inputMessageIds.includes(origin.userMessageId) &&
176
+ !work.groupInputs.some(input => input.messageId === origin.userMessageId)))
177
+ return 'unknown';
178
+ const matches = work.collaboration?.operations.filter(row => row.id === operationId), op = matches?.[0];
179
+ if (!op || matches?.length !== 1 || !same(op.target, target))
180
+ return 'unknown';
181
+ if (work.state === 'cancelled' || op.state === 'failed' || op.state === 'cancelled')
182
+ return 'closed';
183
+ if (work.state === 'unknown' || op.state === 'unknown')
184
+ return 'unknown';
185
+ if (op.state === 'prepared')
186
+ return work.state === 'running' || work.state === 'creating' ? 'pending' : 'unknown';
187
+ return op.state === 'completed' && op.status === 'completed' && op.childId && !op.errorCode &&
188
+ expectedDigest && op.resultDigest === expectedDigest ? 'completed' : 'unknown';
189
+ }
163
190
  async put(work) {
164
191
  const value = supergroupWorkSchema.parse({ ...work, revision: work.revision + 1, updatedAt: Date.now() });
165
192
  await this.domain.table('works').put(value.id, value);
@@ -185,7 +212,47 @@ export class Supergroup {
185
212
  throw new OperationError('invalid');
186
213
  return { owner, bot, messageId: event.data.id, text };
187
214
  }
188
- async authorizeCollaboration(agent, targetId, callId, signal, argumentDigest) {
215
+ async peerTask(agent, targetId, args) {
216
+ if (!this.registry.config.messagingEnabled)
217
+ return;
218
+ // A real incoming peer message belongs to native messaging and its managed data outlet.
219
+ const messaging = this.ctx.get('dshBotMessaging');
220
+ if (!messaging?.provenance(agent).userMessageId)
221
+ return;
222
+ const human = await this.human(agent);
223
+ const directory = await this.registry.list();
224
+ const bot = directory.find(row => row.id === targetId);
225
+ if (!bot || bot.id === human.owner.botId)
226
+ throw new OperationError('invalid');
227
+ const prior = precedingPeerAsk(agent, messaging, human.messageId);
228
+ const samePeer = prior?.to.botId === targetId && prior.to.botCreatedAt === bot.createdAt;
229
+ const aliases = samePeer ? [...directory, ...['他', '她', '对方', 'them'].map(name => ({ id: targetId, name }))] : directory;
230
+ const addressed = addressedPeerTask(human.text, targetId, aliases);
231
+ const explicit = args.inReplyToContext;
232
+ // A named follow-up or a short neutral elaboration can use the last shared answer.
233
+ // Arbitrary new DM prose and the model's private draft are never spliced into it.
234
+ const neutral = /^(?:请|再|请再)?(?:具体说明(?:一下)?|展开说说|举个例子|解释一下|为什么|还有呢|能举个例子吗|can you elaborate|give (?:me )?an example)[??!!。.]?$/iu.test(human.text.trim());
235
+ const target = { botId: bot.id, botCreatedAt: bot.createdAt };
236
+ const text = addressed ?? (samePeer && neutral ? human.text.trim() : undefined);
237
+ if (!text)
238
+ return;
239
+ const task = { target, messageId: human.messageId, inputDigest: hash(human.text), text };
240
+ const continuation = neutral || /^(?:其中|刚才|该|这个|那(?:个|条)|上(?:个|一条)|基于|再|why\b|can you elaborate)/iu.test(text);
241
+ const requestId = explicit ?? (samePeer && continuation ? prior.id : undefined);
242
+ if (!requestId)
243
+ return task;
244
+ const read = () => messaging.peerResult(agent, targetId, requestId, true);
245
+ const result = await read();
246
+ if (result.status !== 'completed' || !result.scoped)
247
+ throw new OperationError('conflict');
248
+ return { ...task, text: JSON.stringify({ followUp: text, previousQuestion: result.question, previousAnswer: result.content }),
249
+ validate: async () => {
250
+ const current = await read();
251
+ if (current.status !== 'completed' || !current.scoped || current.question !== result.question || current.content !== result.content)
252
+ throw new OperationError('conflict');
253
+ } };
254
+ }
255
+ async authorizeCollaboration(agent, targetId, callId, signal, argumentDigest, peer) {
189
256
  signal.throwIfAborted();
190
257
  const parent = getScopedCollaborationBinding(agent);
191
258
  if (parent && parent.agent !== agent)
@@ -193,16 +260,23 @@ export class Supergroup {
193
260
  if (parent)
194
261
  await parent.scope.check();
195
262
  const origin = parent?.scope.origin ?? agent, human = await this.human(origin);
196
- const id = parent?.scope.workId ?? `supergroup:${hash([origin.id, human.messageId])}`;
263
+ if (peer && (parent || peer.messageId !== human.messageId || peer.inputDigest !== hash(human.text) || peer.target.botId !== targetId))
264
+ throw new OperationError('conflict');
265
+ // One directed (or freely chosen) peer per source task. Re-evaluating tool
266
+ // arguments cannot select a second recipient for the same human permission.
267
+ const id = peer ? `peer:${hash([origin.id, human.messageId])}`
268
+ : parent?.scope.workId ?? `supergroup:${hash([origin.id, human.messageId])}`;
197
269
  let runtime, operationId;
198
270
  await this.serial.run(async () => {
199
- const config = this.config(), pool = await this.pool(human.owner);
271
+ const config = this.config(), pool = peer ? [human.bot, await this.registry.get(targetId)] : await this.pool(human.owner);
200
272
  const target = pool.find(bot => bot.id === targetId);
201
- if (!target || parent && !parent.scope.readers.some(key => key.botId === target.id && key.botCreatedAt === target.createdAt))
273
+ if (!target || peer && target.createdAt !== peer.target.botCreatedAt ||
274
+ parent && !parent.scope.readers.some(key => key.botId === target.id && key.botCreatedAt === target.createdAt))
202
275
  throw new OperationError('approval-denied');
203
276
  let work = this.domain.table('works').get(id);
204
277
  if (work && (work.inputMessageId !== human.messageId || ['cancelled', 'unknown'].includes(work.state) ||
205
- work.configDigest !== this.configDigest() || Date.now() >= work.expiresAt))
278
+ work.configDigest !== this.configDigest() || Date.now() >= work.expiresAt ||
279
+ peer && !work.readers.some(key => same(key, peer.target))))
206
280
  throw new OperationError('approval-denied');
207
281
  if (!work) {
208
282
  const now = Date.now();
@@ -214,7 +288,7 @@ export class Supergroup {
214
288
  throw new OperationError('approval-denied');
215
289
  runtime = this.active.get(id);
216
290
  if (!runtime) {
217
- runtime = this.runtime(work, origin, await this.support.project(work, origin, human.messageId, human.text), human.messageId, new Map(pool.map(bot => [bot.id, bot.updatedAt])), new AbortController().signal);
291
+ runtime = this.runtime(work, origin, peer?.text ?? await this.support.project(work, origin, human.messageId, human.text), human.messageId, new Map(pool.map(bot => [bot.id, bot.updatedAt])), new AbortController().signal, undefined, peer?.inputDigest);
218
292
  this.active.set(id, runtime);
219
293
  runtime.timer = setTimeout(() => {
220
294
  if (this.read(id).state === 'completed') {
@@ -246,8 +320,9 @@ export class Supergroup {
246
320
  }
247
321
  });
248
322
  const work = this.read(id);
249
- return { workId: id, operationId, origin, messageId: human.messageId, text: await this.support.project(work, origin, human.messageId, human.text), owner: work.owner,
250
- readers: work.readers, expiresAt: work.expiresAt, signal: runtime.controller.signal, check: runtime.authority.check };
323
+ return { workId: id, operationId, origin, messageId: human.messageId, text: peer?.text ?? await this.support.project(work, origin, human.messageId, human.text), owner: work.owner,
324
+ readers: work.readers, expiresAt: work.expiresAt, signal: runtime.controller.signal,
325
+ check: async () => { await runtime.authority.check(); await peer?.validate?.(); } };
251
326
  }
252
327
  continuationInstruction(agent) {
253
328
  if (this.stopped || !this.config().enabled || this.ctx.agents.get(agent.id) !== agent)
@@ -334,7 +409,7 @@ export class Supergroup {
334
409
  async reserveWorkRequest(id) {
335
410
  await this.serial.run(async () => {
336
411
  const work = this.read(id), collaboration = work.collaboration ?? { requests: 0, operations: [] };
337
- if (this.stopped || !this.config().enabled || ['cancelled', 'unknown'].includes(work.state) || Date.now() >= work.expiresAt ||
412
+ if (!this.workEnabled(work) || ['cancelled', 'unknown'].includes(work.state) || Date.now() >= work.expiresAt ||
338
413
  work.configDigest !== this.configDigest())
339
414
  throw new OperationError('approval-denied');
340
415
  if (collaboration.requests >= this.config().maxRequests)
@@ -373,7 +448,10 @@ export class Supergroup {
373
448
  return bot;
374
449
  });
375
450
  }
376
- runtime(work, agent, text, messageId, revisions, signal, groupInput) {
451
+ workEnabled(work) {
452
+ return !this.stopped && (work.id.startsWith('peer:') ? this.registry.config.messagingEnabled : this.config().enabled);
453
+ }
454
+ runtime(work, agent, text, messageId, revisions, signal, groupInput, peerInputDigest) {
377
455
  const controller = new AbortController();
378
456
  const abort = () => controller.abort(signal.reason);
379
457
  signal.addEventListener('abort', abort, { once: true });
@@ -384,6 +462,8 @@ export class Supergroup {
384
462
  controller.signal.throwIfAborted();
385
463
  const current = this.read(work.id);
386
464
  const input = groupInput ? { owner: work.owner, messageId } : await this.human(agent);
465
+ if (peerInputDigest && (!('text' in input) || hash(input.text) !== peerInputDigest))
466
+ throw new OperationError('conflict');
387
467
  if (groupInput) {
388
468
  await this.ownerAgent(current, agent);
389
469
  const receipt = current.groupInputs.find(row => row.messageId === groupInput.messageId);
@@ -393,7 +473,7 @@ export class Supergroup {
393
473
  text: event.data.content.map(block => block.type === 'text' ? block.text : '').join('\n'), memberIds: receipt.memberIds ?? [], replyTo: receipt.replyTo }) !== receipt.digest)
394
474
  throw new OperationError('approval-denied');
395
475
  }
396
- if (this.stopped || !this.config().enabled || current.state === 'cancelled' || current.state === 'unknown' ||
476
+ if (!this.workEnabled(current) || current.state === 'cancelled' || current.state === 'unknown' ||
397
477
  current.configDigest !== this.configDigest() || Date.now() >= current.expiresAt || input.messageId !== messageId ||
398
478
  !same(input.owner, current.owner))
399
479
  throw new OperationError('approval-denied');
@@ -942,4 +1022,4 @@ export class Supergroup {
942
1022
  }
943
1023
  }
944
1024
  //# sourceMappingURL=service.js.map
945
- export const DSH_BOT_MODULE_VERSION = '0.7.1';
1025
+ export const DSH_BOT_MODULE_VERSION = '0.7.3';