agentworkshop 0.11.3 → 0.13.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 (457) hide show
  1. package/.AgentWorkShop/prompts/host-tools.json +4 -4
  2. package/.output/.AgentWorkShop/prompts/host-tools.json +4 -4
  3. package/.output/nitro.json +1 -1
  4. package/.output/public/_nuxt/{DXXBGPAc.js → CsdezMu9.js} +4 -4
  5. package/.output/public/_nuxt/WL1R8lPA.js +1 -0
  6. package/.output/public/_nuxt/_id_.Czwkl50w.css +1 -0
  7. package/.output/public/_nuxt/builds/latest.json +1 -1
  8. package/.output/public/_nuxt/builds/meta/2f96705b-cf57-4bde-87a4-1b818b268f0f.json +1 -0
  9. package/.output/server/chunks/_/access.mjs +1 -1
  10. package/.output/server/chunks/_/candidate-store.mjs +1 -1
  11. package/.output/server/chunks/_/catalog-view.mjs +1 -1
  12. package/.output/server/chunks/_/character-asset.repo.mjs +1 -1
  13. package/.output/server/chunks/_/data-export.mjs +6 -6
  14. package/.output/server/chunks/_/data-query.mjs +3 -3
  15. package/.output/server/chunks/_/eda-run.repo.mjs +2 -2
  16. package/.output/server/chunks/_/entity.mjs +1 -1
  17. package/.output/server/chunks/_/features.mjs +5 -5
  18. package/.output/server/chunks/_/golden.mjs +3 -3
  19. package/.output/server/chunks/_/host-bindings.mjs +1 -1
  20. package/.output/server/chunks/_/index.mjs +1 -1
  21. package/.output/server/chunks/_/line-scope.mjs +1 -1
  22. package/.output/server/chunks/_/mes-console.mjs +1 -1
  23. package/.output/server/chunks/_/mes-secrets.repo.mjs +1 -1
  24. package/.output/server/chunks/_/mes-templates.mjs +1 -1
  25. package/.output/server/chunks/_/nitro.mjs +4084 -2343
  26. package/.output/server/chunks/_/nitro.mjs.map +1 -1
  27. package/.output/server/chunks/_/ocap.mjs +1 -1
  28. package/.output/server/chunks/_/orchestrator.mjs +1 -1
  29. package/.output/server/chunks/_/promote.mjs +1 -1
  30. package/.output/server/chunks/_/rest-auth.mjs +1 -1
  31. package/.output/server/chunks/_/runtime.mjs +8 -8
  32. package/.output/server/chunks/_/scene-layout.repo.mjs +1 -1
  33. package/.output/server/chunks/_/spc.mjs +1 -1
  34. package/.output/server/chunks/_/validator.mjs +1 -1
  35. package/.output/server/chunks/build/TownView-DD1zY8xq.mjs +1 -1
  36. package/.output/server/chunks/build/{_id_-C0vNEbts.mjs → _id_-B9zi8WEg.mjs} +23 -12
  37. package/.output/server/chunks/build/_id_-B9zi8WEg.mjs.map +1 -0
  38. package/.output/server/chunks/build/_wsId_-LDv5SEW_.mjs +1 -1
  39. package/.output/server/chunks/build/daq-B5zlUIlb.mjs +1 -1
  40. package/.output/server/chunks/build/dcw-B-eoU7sq.mjs +1 -1
  41. package/.output/server/chunks/build/types-D6J7slEa.mjs +1 -1
  42. package/.output/server/chunks/build/useDaqAddNode-Dr5CfMpU.mjs +1 -1
  43. package/.output/server/chunks/build/useDaqDetailNode-DDq5osE-.mjs +1 -1
  44. package/.output/server/chunks/build/useDaqDetailParams-DdOcUvHG.mjs +1 -1
  45. package/.output/server/chunks/build/useDaqFilters-Y_NRhP6i.mjs +1 -1
  46. package/.output/server/chunks/build/useDaqStream-phwM5tIN.mjs +1 -1
  47. package/.output/server/chunks/build/useDaqTemplates-lKw2b01d.mjs +1 -1
  48. package/.output/server/chunks/build/useDcwAddNode-CT-oOFom.mjs +1 -1
  49. package/.output/server/chunks/build/useDcwStream-CNtMGcR0.mjs +1 -1
  50. package/.output/server/chunks/routes/api/mcp/workshop.mjs +1 -1
  51. package/.output/server/chunks/routes/api/system/backup/run.post.mjs +2 -2
  52. package/.output/server/chunks/routes/api/system/index.patch.mjs +2 -2
  53. package/.output/server/chunks/routes/api/system/shutdown.post.mjs +2 -2
  54. package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs +1 -1
  55. package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs +7 -2
  56. package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs.map +1 -1
  57. package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs +1 -1
  58. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id/preview.get.mjs +1 -1
  59. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.delete.mjs +1 -1
  60. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.get.mjs +1 -1
  61. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.patch.mjs +1 -1
  62. package/.output/server/chunks/routes/api/workshop/aml/env/recheck.post.mjs +1 -1
  63. package/.output/server/chunks/routes/api/workshop/aml/env/uv.post.mjs +1 -1
  64. package/.output/server/chunks/routes/api/workshop/aml/env/venv.post.mjs +1 -1
  65. package/.output/server/chunks/routes/api/workshop/aml/index.get.mjs +1 -1
  66. package/.output/server/chunks/routes/api/workshop/aml/index.post.mjs +1 -1
  67. package/.output/server/chunks/routes/api/workshop/aml/index2.post.mjs +1 -1
  68. package/.output/server/chunks/routes/api/workshop/aml/index3.get.mjs +1 -1
  69. package/.output/server/chunks/routes/api/workshop/aml/index3.post.mjs +1 -1
  70. package/.output/server/chunks/routes/api/workshop/aml/index4.get.mjs +1 -1
  71. package/.output/server/chunks/routes/api/workshop/aml/index5.get.mjs +1 -1
  72. package/.output/server/chunks/routes/api/workshop/aml/index6.get.mjs +1 -1
  73. package/.output/server/chunks/routes/api/workshop/aml/index7.get.mjs +1 -1
  74. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/cancel.post.mjs +1 -1
  75. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/logs.get.mjs +1 -1
  76. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/retry.post.mjs +1 -1
  77. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id_.delete.mjs +1 -1
  78. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id_.get.mjs +1 -1
  79. package/.output/server/chunks/routes/api/workshop/aml/models/_id/predict.post.mjs +1 -1
  80. package/.output/server/chunks/routes/api/workshop/aml/models/_id/promote.post.mjs +1 -1
  81. package/.output/server/chunks/routes/api/workshop/aml/models/_id_.delete.mjs +1 -1
  82. package/.output/server/chunks/routes/api/workshop/aml/models/_id_.patch.mjs +1 -1
  83. package/.output/server/chunks/routes/api/workshop/aml/models/index.get.mjs +1 -1
  84. package/.output/server/chunks/routes/api/workshop/aml/training-plans/_id/train.post.mjs +1 -1
  85. package/.output/server/chunks/routes/api/workshop/aml/training-plans/_id_.delete.mjs +1 -1
  86. package/.output/server/chunks/routes/api/workshop/aml/training-plans/_id_.patch.mjs +1 -1
  87. package/.output/server/chunks/routes/api/workshop/aml/training-plans/index.get.mjs +1 -1
  88. package/.output/server/chunks/routes/api/workshop/aml/twin/providers.get.mjs +1 -1
  89. package/.output/server/chunks/routes/api/workshop/analysis/_id_.delete.mjs +1 -1
  90. package/.output/server/chunks/routes/api/workshop/analysis/_id_.get.mjs +1 -1
  91. package/.output/server/chunks/routes/api/workshop/analysis/_id_.patch.mjs +1 -1
  92. package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs +1 -1
  93. package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs +1 -1
  94. package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs +1 -1
  95. package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +2 -2
  96. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs +1 -1
  97. package/.output/server/chunks/routes/api/workshop/channels/_id/activate.post.mjs +1 -1
  98. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs +1 -1
  99. package/.output/server/chunks/routes/api/workshop/channels/_id/chat/index.post.mjs +1 -1
  100. package/.output/server/chunks/routes/api/workshop/channels/_id/execution-mode.patch.mjs +1 -1
  101. package/.output/server/chunks/routes/api/workshop/channels/_id/harness-profiles/promote.post.mjs +1 -1
  102. package/.output/server/chunks/routes/api/workshop/channels/_id/improvement-proposals/decide.post.mjs +1 -1
  103. package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs +1 -1
  104. package/.output/server/chunks/routes/api/workshop/channels/_id/index.put.mjs +1 -1
  105. package/.output/server/chunks/routes/api/workshop/channels/_id/index11.get.mjs +1 -1
  106. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs +1 -1
  107. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.post.mjs +1 -1
  108. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.put.mjs +1 -1
  109. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.get.mjs +1 -1
  110. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.post.mjs +1 -1
  111. package/.output/server/chunks/routes/api/workshop/channels/_id/index5.post.mjs +1 -1
  112. package/.output/server/chunks/routes/api/workshop/channels/_id/index7.get.mjs +1 -1
  113. package/.output/server/chunks/routes/api/workshop/channels/_id/index7.post.mjs +1 -1
  114. package/.output/server/chunks/routes/api/workshop/channels/_id/line.put.mjs +1 -1
  115. package/.output/server/chunks/routes/api/workshop/channels/_id/members/join.post.mjs +1 -1
  116. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId/promote.post.mjs +1 -1
  117. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/merge.post.mjs +1 -1
  118. package/.output/server/chunks/routes/api/workshop/channels/_id/products.get.mjs +1 -1
  119. package/.output/server/chunks/routes/api/workshop/channels/_id/products.put.mjs +1 -1
  120. package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs +1 -1
  121. package/.output/server/chunks/routes/api/workshop/channels/_id/tool-usage.get.mjs +1 -1
  122. package/.output/server/chunks/routes/api/workshop/channels/_id/tools/reset.post.mjs +1 -1
  123. package/.output/server/chunks/routes/api/workshop/channels/_id/twin-profile.get.mjs +1 -1
  124. package/.output/server/chunks/routes/api/workshop/channels/_id/twin-profile.patch.mjs +1 -1
  125. package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs +1 -1
  126. package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs +1 -1
  127. package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs +1 -1
  128. package/.output/server/chunks/routes/api/workshop/channels.post.mjs +7 -7
  129. package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs +1 -1
  130. package/.output/server/chunks/routes/api/workshop/daq/_id/bindings.put.mjs +1 -1
  131. package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs +1 -1
  132. package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs +1 -1
  133. package/.output/server/chunks/routes/api/workshop/daq/_id/ingest.post.mjs +2 -2
  134. package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs +1 -1
  135. package/.output/server/chunks/routes/api/workshop/daq/_id/test.post.mjs +1 -1
  136. package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs +1 -1
  137. package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs +1 -1
  138. package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs +1 -1
  139. package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs +1 -1
  140. package/.output/server/chunks/routes/api/workshop/daq/index.get.mjs +1 -1
  141. package/.output/server/chunks/routes/api/workshop/daq/index2.post.mjs +1 -1
  142. package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs +1 -1
  143. package/.output/server/chunks/routes/api/workshop/daq/storage/retention.put.mjs +1 -1
  144. package/.output/server/chunks/routes/api/workshop/daq/storage/rollup.post.mjs +1 -1
  145. package/.output/server/chunks/routes/api/workshop/daq/storage.get.mjs +1 -1
  146. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs +1 -1
  147. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs +1 -1
  148. package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs +1 -1
  149. package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs +1 -1
  150. package/.output/server/chunks/routes/api/workshop/dcw/_id/bindings.put.mjs +1 -1
  151. package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs +1 -1
  152. package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs +1 -1
  153. package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs +1 -1
  154. package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs +1 -1
  155. package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs +1 -1
  156. package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs +1 -1
  157. package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs +1 -1
  158. package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs +1 -1
  159. package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs +1 -1
  160. package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs +1 -1
  161. package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs +1 -1
  162. package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs +1 -1
  163. package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs +1 -1
  164. package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs +1 -1
  165. package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs +1 -1
  166. package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs +1 -1
  167. package/.output/server/chunks/routes/api/workshop/dcw/index5.post.mjs +1 -1
  168. package/.output/server/chunks/routes/api/workshop/dcw/index6.get.mjs +1 -1
  169. package/.output/server/chunks/routes/api/workshop/dcw/index7.get.mjs +1 -1
  170. package/.output/server/chunks/routes/api/workshop/dcw/index8.get.mjs +1 -1
  171. package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs +1 -1
  172. package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs +1 -1
  173. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs +1 -1
  174. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs +1 -1
  175. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs +1 -1
  176. package/.output/server/chunks/routes/api/workshop/dcw/lines/index.get.mjs +1 -1
  177. package/.output/server/chunks/routes/api/workshop/dcw/mes-artifacts/file.get.mjs +1 -1
  178. package/.output/server/chunks/routes/api/workshop/dcw/mes-hook-test.post.mjs +1 -1
  179. package/.output/server/chunks/routes/api/workshop/dcw/mes-test-read.post.mjs +1 -1
  180. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs +1 -1
  181. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs +1 -1
  182. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs +1 -1
  183. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs +1 -1
  184. package/.output/server/chunks/routes/api/workshop/dcw/params/_id/read.post.mjs +1 -1
  185. package/.output/server/chunks/routes/api/workshop/dcw/params/_id/write.post.mjs +1 -1
  186. package/.output/server/chunks/routes/api/workshop/dcw/params/_id_.delete.mjs +1 -1
  187. package/.output/server/chunks/routes/api/workshop/dcw/params/_id_.patch.mjs +1 -1
  188. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs +1 -1
  189. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs +1 -1
  190. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs +1 -1
  191. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs +1 -1
  192. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/revert.post.mjs +1 -1
  193. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs +1 -1
  194. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs +2 -2
  195. package/.output/server/chunks/routes/api/workshop/dcw/recipes/index.patch.mjs +1 -1
  196. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs +1 -1
  197. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs +1 -1
  198. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs +1 -1
  199. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs +1 -1
  200. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs +1 -1
  201. package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs +1 -1
  202. package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs +1 -1
  203. package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs +1 -1
  204. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs +1 -1
  205. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs +1 -1
  206. package/.output/server/chunks/routes/api/workshop/eda/commonality.get.mjs +1 -1
  207. package/.output/server/chunks/routes/api/workshop/eda/index6.get.mjs +1 -1
  208. package/.output/server/chunks/routes/api/workshop/eda/index6.post.mjs +1 -1
  209. package/.output/server/chunks/routes/api/workshop/eda/vm/predict.post.mjs +1 -1
  210. package/.output/server/chunks/routes/api/workshop/exp/confirmations/_id/decide.post.mjs +1 -1
  211. package/.output/server/chunks/routes/api/workshop/exp/index.get.mjs +1 -1
  212. package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs +1 -1
  213. package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs +1 -1
  214. package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs +1 -1
  215. package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs +1 -1
  216. package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs +1 -1
  217. package/.output/server/chunks/routes/api/workshop/index.mjs +1 -1
  218. package/.output/server/chunks/routes/api/workshop/index.post.mjs +1 -1
  219. package/.output/server/chunks/routes/api/workshop/index.put.mjs +1 -1
  220. package/.output/server/chunks/routes/api/workshop/index12.get.mjs +1 -1
  221. package/.output/server/chunks/routes/api/workshop/index13.get.mjs +1 -1
  222. package/.output/server/chunks/routes/api/workshop/index14.get.mjs +1 -1
  223. package/.output/server/chunks/routes/api/workshop/index2.get.mjs +1 -1
  224. package/.output/server/chunks/routes/api/workshop/index2.post.mjs +1 -1
  225. package/.output/server/chunks/routes/api/workshop/index3.get.mjs +1 -1
  226. package/.output/server/chunks/routes/api/workshop/index3.post.mjs +1 -1
  227. package/.output/server/chunks/routes/api/workshop/index4.post.mjs +1 -1
  228. package/.output/server/chunks/routes/api/workshop/index5.post.mjs +1 -1
  229. package/.output/server/chunks/routes/api/workshop/index6.get.mjs +1 -1
  230. package/.output/server/chunks/routes/api/workshop/index6.post.mjs +1 -1
  231. package/.output/server/chunks/routes/api/workshop/index7.get.mjs +1 -1
  232. package/.output/server/chunks/routes/api/workshop/index7.post.mjs +1 -1
  233. package/.output/server/chunks/routes/api/workshop/index8.get.mjs +1 -1
  234. package/.output/server/chunks/routes/api/workshop/index8.post.mjs +1 -1
  235. package/.output/server/chunks/routes/api/workshop/index9.post.mjs +1 -1
  236. package/.output/server/chunks/routes/api/workshop/mes/bridge.post.mjs +1 -1
  237. package/.output/server/chunks/routes/api/workshop/mes/datasets.get.mjs +1 -1
  238. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/autofix.mjs +1 -1
  239. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/compile.mjs +1 -1
  240. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/evidence.mjs +1 -1
  241. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/publish.mjs +1 -1
  242. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval-decision.mjs +1 -1
  243. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval.mjs +1 -1
  244. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/transition.mjs +1 -1
  245. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/subgraph.mjs +1 -1
  246. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/validate.mjs +1 -1
  247. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId_.mjs +1 -1
  248. package/.output/server/chunks/routes/api/workshop/ontology/export/_ontologyId_.mjs +1 -1
  249. package/.output/server/chunks/routes/api/workshop/ontology/index.mjs +1 -1
  250. package/.output/server/chunks/routes/api/workshop/ontology/scene.mjs +1 -1
  251. package/.output/server/chunks/routes/api/workshop/ontology/traces/_ontologyId_.mjs +1 -1
  252. package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId/compare.mjs +1 -1
  253. package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId_.mjs +1 -1
  254. package/.output/server/chunks/routes/api/workshop/optimization/capabilities.get.mjs +1 -1
  255. package/.output/server/chunks/routes/api/workshop/optimization/index.get.mjs +1 -1
  256. package/.output/server/chunks/routes/api/workshop/optimization/index.mjs +1 -1
  257. package/.output/server/chunks/routes/api/workshop/optimization/index2.mjs +1 -1
  258. package/.output/server/chunks/routes/api/workshop/optimization/profiles/_id/publish.post.mjs +1 -1
  259. package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/crosscheck.post.mjs +1 -1
  260. package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/dispatch.post.mjs +1 -1
  261. package/.output/server/chunks/routes/api/workshop/optimization/solve.post.mjs +1 -1
  262. package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs +1 -1
  263. package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +1 -1
  264. package/.output/server/chunks/routes/api/workshop/process-model/datasets.post.mjs +1 -1
  265. package/.output/server/chunks/routes/api/workshop/process-model/eligibility.mjs +1 -1
  266. package/.output/server/chunks/routes/api/workshop/process-model/experiments.mjs +1 -1
  267. package/.output/server/chunks/routes/api/workshop/process-model/index.mjs +1 -1
  268. package/.output/server/chunks/routes/api/workshop/process-model/specs/_id/publish.post.mjs +1 -1
  269. package/.output/server/chunks/routes/api/workshop/process-model/train.post.mjs +1 -1
  270. package/.output/server/chunks/routes/api/workshop/projects/_id/activate.post.mjs +1 -1
  271. package/.output/server/chunks/routes/api/workshop/projects/_id/approvals/_aid/decide.post.mjs +1 -1
  272. package/.output/server/chunks/routes/api/workshop/projects/_id/archive.post.mjs +1 -1
  273. package/.output/server/chunks/routes/api/workshop/projects/_id/channels/_channelId_.delete.mjs +1 -1
  274. package/.output/server/chunks/routes/api/workshop/projects/_id/complete.post.mjs +1 -1
  275. package/.output/server/chunks/routes/api/workshop/projects/_id/continue.post.mjs +1 -1
  276. package/.output/server/chunks/routes/api/workshop/projects/_id/deliverables/_did/waive.post.mjs +1 -1
  277. package/.output/server/chunks/routes/api/workshop/projects/_id/deliverables/index.get.mjs +1 -1
  278. package/.output/server/chunks/routes/api/workshop/projects/_id/deliverables/index.patch.mjs +1 -1
  279. package/.output/server/chunks/routes/api/workshop/projects/_id/health.get.mjs +1 -1
  280. package/.output/server/chunks/routes/api/workshop/projects/_id/index.get.mjs +1 -1
  281. package/.output/server/chunks/routes/api/workshop/projects/_id/index.post.mjs +1 -1
  282. package/.output/server/chunks/routes/api/workshop/projects/_id/index2.get.mjs +1 -1
  283. package/.output/server/chunks/routes/api/workshop/projects/_id/index2.post.mjs +1 -1
  284. package/.output/server/chunks/routes/api/workshop/projects/_id/index3.get.mjs +1 -1
  285. package/.output/server/chunks/routes/api/workshop/projects/_id/index3.post.mjs +1 -1
  286. package/.output/server/chunks/routes/api/workshop/projects/_id/index4.get.mjs +1 -1
  287. package/.output/server/chunks/routes/api/workshop/projects/_id/index4.post.mjs +1 -1
  288. package/.output/server/chunks/routes/api/workshop/projects/_id/index5.get.mjs +1 -1
  289. package/.output/server/chunks/routes/api/workshop/projects/_id/index6.get.mjs +1 -1
  290. package/.output/server/chunks/routes/api/workshop/projects/_id/index7.get.mjs +1 -1
  291. package/.output/server/chunks/routes/api/workshop/projects/_id/index8.get.mjs +1 -1
  292. package/.output/server/chunks/routes/api/workshop/projects/_id/kernel/tick.post.mjs +1 -1
  293. package/.output/server/chunks/routes/api/workshop/projects/_id/ledger.get.mjs +1 -1
  294. package/.output/server/chunks/routes/api/workshop/projects/_id/members/_userId_.delete.mjs +1 -1
  295. package/.output/server/chunks/routes/api/workshop/projects/_id/observability/activity.get.mjs +1 -1
  296. package/.output/server/chunks/routes/api/workshop/projects/_id/observability/route.get.mjs +1 -1
  297. package/.output/server/chunks/routes/api/workshop/projects/_id/observability/work-items/_wid_.get.mjs +1 -1
  298. package/.output/server/chunks/routes/api/workshop/projects/_id/observability.get.mjs +1 -1
  299. package/.output/server/chunks/routes/api/workshop/projects/_id/pause.post.mjs +1 -1
  300. package/.output/server/chunks/routes/api/workshop/projects/_id/plan/request-approval.post.mjs +1 -1
  301. package/.output/server/chunks/routes/api/workshop/projects/_id/proposals/_decisionId/apply.post.mjs +1 -1
  302. package/.output/server/chunks/routes/api/workshop/projects/_id/reconcile.post.mjs +1 -1
  303. package/.output/server/chunks/routes/api/workshop/projects/_id/report.get.mjs +1 -1
  304. package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/request-acceptance.post.mjs +1 -1
  305. package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/review.post.mjs +1 -1
  306. package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/submit.post.mjs +1 -1
  307. package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/supersede.post.mjs +1 -1
  308. package/.output/server/chunks/routes/api/workshop/projects/_id/resume.post.mjs +1 -1
  309. package/.output/server/chunks/routes/api/workshop/projects/_id/sessions.get.mjs +1 -1
  310. package/.output/server/chunks/routes/api/workshop/projects/_id/snapshot.get.mjs +1 -1
  311. package/.output/server/chunks/routes/api/workshop/projects/_id/terminate.post.mjs +1 -1
  312. package/.output/server/chunks/routes/api/workshop/projects/_id/trace/_traceId_.get.mjs +1 -1
  313. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/_wid/cancel.post.mjs +1 -1
  314. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/_wid/dispatch.post.mjs +1 -1
  315. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/_wid/retry.post.mjs +1 -1
  316. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/index.get.mjs +1 -1
  317. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/index.patch.mjs +1 -1
  318. package/.output/server/chunks/routes/api/workshop/projects/_id_.get.mjs +1 -1
  319. package/.output/server/chunks/routes/api/workshop/projects/_id_.patch.mjs +1 -1
  320. package/.output/server/chunks/routes/api/workshop/projects/instantiate.post.mjs +1 -1
  321. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs +1 -1
  322. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +1 -1
  323. package/.output/server/chunks/routes/api/workshop/tasks/_id/recovery-disposition.post.mjs +44 -0
  324. package/.output/server/chunks/routes/api/workshop/tasks/_id/recovery-disposition.post.mjs.map +1 -0
  325. package/.output/server/chunks/routes/api/workshop/tasks/recovery-holds.get.mjs +38 -0
  326. package/.output/server/chunks/routes/api/workshop/tasks/recovery-holds.get.mjs.map +1 -0
  327. package/.output/server/chunks/routes/api/workshop/teams/_id/deploy.post.mjs +1 -1
  328. package/.output/server/chunks/routes/api/workshop/teams/_id/index.put.mjs +1 -1
  329. package/.output/server/chunks/routes/api/workshop/teams/_id/index2.get.mjs +1 -1
  330. package/.output/server/chunks/routes/api/workshop/tools/sync.post.mjs +1 -1
  331. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs +2 -2
  332. package/.output/server/chunks/routes/api/workshop/ws/ticket.post.mjs +1 -1
  333. package/.output/server/chunks/routes/renderer.mjs +2 -2
  334. package/.output/server/chunks/virtual/entry.mjs +6 -2
  335. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  336. package/.output/server/package.json +1 -1
  337. package/README-zh.md +19 -7
  338. package/README.md +21 -7
  339. package/app/components/dcw/DcwNodesTable.vue +24 -0
  340. package/config.yml +1 -1
  341. package/docs/cli.en.md +1 -1
  342. package/docs/cli.md +1 -1
  343. package/docs/mcp.en.md +30 -27
  344. package/docs/mcp.md +7 -3
  345. package/docs/plugin-idd-rag-contract.md +87 -0
  346. package/docs/plugins.en.md +5 -3
  347. package/docs/plugins.md +5 -3
  348. package/docs/sdk.en.md +1 -1
  349. package/docs/sdk.md +1 -1
  350. package/i18n/dicts/dcwDetail.json +221 -219
  351. package/i18n/locales/en.ts +2 -0
  352. package/i18n/locales/zh-CN.ts +2 -0
  353. package/package.json +3 -1
  354. package/scripts/check-docs-sync.mjs +20 -9
  355. package/scripts/onboarding/forge-channel.mjs +2 -1
  356. package/scripts/onboarding/lib.mjs +159 -3
  357. package/scripts/onboarding/onboard.mjs +2 -0
  358. package/scripts/onboarding/preflight.mjs +233 -231
  359. package/scripts/onboarding/provision-line.mjs +12 -2
  360. package/scripts/onboarding/sim-attest.mjs +103 -0
  361. package/scripts/onboarding/sim-twin.mjs +115 -19
  362. package/scripts/onboarding/test-connection.mjs +2 -1
  363. package/scripts/onboarding/v6-protected-api.mjs +41 -0
  364. package/scripts/onboarding/v6-protected-fixture.mjs +54 -0
  365. package/scripts/onboarding/verify-line.mjs +179 -136
  366. package/scripts/onboarding/verify-mirror.mjs +149 -145
  367. package/server/api/workshop/agent-tools/list.get.ts +10 -1
  368. package/server/api/workshop/tasks/[id]/recovery-disposition.post.ts +32 -0
  369. package/server/api/workshop/tasks/recovery-holds.get.ts +22 -0
  370. package/server/plugins-builtin/diag-bridge/host/deposit.mjs +232 -0
  371. package/server/plugins-builtin/diag-bridge/host/diagnosis.mjs +121 -38
  372. package/server/plugins-builtin/diag-bridge/host/external-v1.mjs +213 -0
  373. package/server/plugins-builtin/diag-bridge/host/helpers.mjs +4 -2
  374. package/server/plugins-builtin/diag-bridge/host/intents.mjs +65 -62
  375. package/server/plugins-builtin/diag-bridge/host/plugin.mjs +351 -82
  376. package/server/plugins-builtin/diag-bridge/host/receipt.mjs +83 -0
  377. package/server/plugins-builtin/diag-bridge/host/sweep.mjs +70 -91
  378. package/server/plugins-builtin/diag-bridge/i18n.json +4 -0
  379. package/server/plugins-builtin/rag-bridge/i18n.json +18 -0
  380. package/server/plugins-builtin/rag-bridge/index.mjs +570 -64
  381. package/server/services/workshop/agents/agent-interface.ts +3 -0
  382. package/server/services/workshop/agents/base-agent.ts +100 -4
  383. package/server/services/workshop/agents/execution-scope.ts +26 -0
  384. package/server/services/workshop/agents/hitl-capabilities.ts +3 -3
  385. package/server/services/workshop/agents/host-tool-bridge/dispatch.ts +42 -2
  386. package/server/services/workshop/agents/host-tool-bridge/tools/progress.ts +4 -0
  387. package/server/services/workshop/agents/host-tool-bridge/tools/tasks.ts +11 -28
  388. package/server/services/workshop/agents/host-tool-bridge/tools/team-delegation.ts +83 -129
  389. package/server/services/workshop/agents/industrial/dcw-tools.ts +27 -5
  390. package/server/services/workshop/agents/industrial/line-tools.ts +15 -4
  391. package/server/services/workshop/agents/industrial/ops-tools.ts +32 -6
  392. package/server/services/workshop/agents/industrial/optimization-tools.ts +28 -4
  393. package/server/services/workshop/agents/industrial/recipe-propose-tools.ts +26 -3
  394. package/server/services/workshop/agents/omp-agent/client.ts +2 -4
  395. package/server/services/workshop/agents/omp-agent/core.ts +3 -0
  396. package/server/services/workshop/agents/omp-agent/lifecycle.ts +70 -4
  397. package/server/services/workshop/agents/omp-agent/supervision-decision.ts +3 -1
  398. package/server/services/workshop/agents/omp-agent/tools-steer.ts +113 -32
  399. package/server/services/workshop/agents/tool-approvals.ts +113 -29
  400. package/server/services/workshop/agents/tool-classes.ts +72 -56
  401. package/server/services/workshop/db/database/open.ts +5 -2
  402. package/server/services/workshop/db/database/schema.ts +1 -0
  403. package/server/services/workshop/db/database/seed.ts +2 -2
  404. package/server/services/workshop/db/message.repo.ts +134 -26
  405. package/server/services/workshop/db/project-kernel.repo.ts +3 -3
  406. package/server/services/workshop/db/schema.sql +3 -1
  407. package/server/services/workshop/db/task.repo.ts +101 -0
  408. package/server/services/workshop/dcw/dcw-controller/actuation.ts +120 -9
  409. package/server/services/workshop/dcw/dcw-controller/contracts.ts +18 -16
  410. package/server/services/workshop/dcw/dcw-controller/crud.ts +23 -0
  411. package/server/services/workshop/dcw/dcw-controller/lines.ts +34 -2
  412. package/server/services/workshop/dcw/dcw-controller/recipes.ts +80 -6
  413. package/server/services/workshop/dcw/dcw-controller/state.ts +89 -88
  414. package/server/services/workshop/dcw/dcw-controller/types.ts +5 -0
  415. package/server/services/workshop/dcw/dcw-controller/write.ts +9 -6
  416. package/server/services/workshop/dcw/dcw-line.repo.ts +2 -0
  417. package/server/services/workshop/dcw/dcw-node.repo.ts +3 -1
  418. package/server/services/workshop/dcw/dcw-node.ts +346 -307
  419. package/server/services/workshop/dcw/dcw-runtime.ts +8 -4
  420. package/server/services/workshop/projects/effects.ts +47 -29
  421. package/server/services/workshop/projects/kernel.ts +8 -1
  422. package/server/services/workshop/projects/legacy-recovery.ts +36 -0
  423. package/server/services/workshop/projects/service.ts +15 -0
  424. package/server/services/workshop/runtime/agent-runtime/contracts.ts +1 -1
  425. package/server/services/workshop/runtime/agent-runtime/lifecycle.ts +7 -2
  426. package/server/services/workshop/runtime/agent-runtime/message-watchdog.ts +40 -0
  427. package/server/services/workshop/runtime/agent-runtime/message.ts +151 -21
  428. package/server/services/workshop/runtime/agent-runtime/state.ts +69 -13
  429. package/server/services/workshop/runtime/agent-runtime/supervise.ts +219 -42
  430. package/server/services/workshop/runtime/agent-runtime/types.ts +6 -0
  431. package/server/services/workshop/runtime/mailbox.ts +112 -21
  432. package/server/services/workshop/runtime/manager/admin-channel.ts +34 -22
  433. package/server/services/workshop/runtime/manager/host-tools.ts +18 -5
  434. package/server/services/workshop/runtime/manager/runtime-wiring.ts +101 -41
  435. package/server/services/workshop/runtime/manager/schedules.ts +3 -1
  436. package/server/services/workshop/runtime/manager/tasks.ts +41 -0
  437. package/server/services/workshop/runtime/memory/recall.ts +11 -4
  438. package/server/services/workshop/runtime/memory/types.ts +2 -0
  439. package/server/services/workshop/runtime/scheduler-loop/contracts.ts +29 -29
  440. package/server/services/workshop/runtime/scheduler-loop/execute.ts +7 -0
  441. package/server/services/workshop/runtime/scheduler-loop/rules.ts +3 -0
  442. package/server/services/workshop/runtime/scheduler-loop/snapshot.ts +10 -2
  443. package/server/services/workshop/runtime/scheduler-loop/state.ts +12 -0
  444. package/server/services/workshop/runtime/scheduler-loop/tick.ts +54 -5
  445. package/server/services/workshop/runtime/task-engine/create.ts +16 -0
  446. package/server/services/workshop/runtime/task-engine/helpers.ts +5 -0
  447. package/server/services/workshop/runtime/task-engine/legacy-recovery.ts +149 -0
  448. package/server/services/workshop/runtime/task-engine/lifecycle.ts +38 -1
  449. package/server/services/workshop/runtime/task-engine/transition.ts +4 -0
  450. package/server/services/workshop/runtime/task-engine/update.ts +6 -0
  451. package/server/services/workshop/runtime/task-engine/views.ts +61 -0
  452. package/server/services/workshop/tools/policy.ts +16 -1
  453. package/shared/dcw-protocol/line.ts +4 -0
  454. package/.output/public/_nuxt/C8QlHux5.js +0 -1
  455. package/.output/public/_nuxt/_id_.0EnzA0aA.css +0 -1
  456. package/.output/public/_nuxt/builds/meta/846b9c03-1442-4fcb-b3fc-1d9484eaa41b.json +0 -1
  457. package/.output/server/chunks/build/_id_-C0vNEbts.mjs.map +0 -1
@@ -12,31 +12,67 @@ import { classifyHarnessFailure, harnessBreakerActive, recordHarnessFailure, HAR
12
12
  import { fenceFromMetadata } from '../task-engine/lease'
13
13
  import type { ExecutionFence } from '../task-engine/lease'
14
14
  import { randomUUID } from 'node:crypto'
15
+ import type { ExecutionScope } from '../../agents/execution-scope'
16
+
17
+ function interruptedWithoutSettlement(signal: AbortSignal | null): boolean {
18
+ if (!signal?.aborted) return false
19
+ const reason = signal.reason
20
+ const text = reason instanceof Error ? reason.message : String(reason ?? '')
21
+ return /message watchdog|runtime stop|task abort/i.test(text)
22
+ }
15
23
 
16
24
  export abstract class AgentRuntimeMessage extends AgentRuntimeSupervise {
17
- protected async processMessage(msg: A2AMessage): Promise<void> {
25
+ protected async processMessage(msg: A2AMessage, claimToken: string): Promise<void> {
18
26
  const taskId = this.taskIdOf(msg)
19
27
  const taskKind = msg.metadata?.['x-aw-task-kind']
28
+ if (this.deps.mailbox.deadLetterLegacyRecoveryClaim(msg.messageId, claimToken)) return
29
+ if (!this.deps.mailbox.ownsClaim(msg.messageId, claimToken)) return
30
+ if (this.deps.mailbox.isClaimBlocked?.(msg.messageId, claimToken)) {
31
+ this.deps.mailbox.releaseClaim(msg.messageId, claimToken)
32
+ return
33
+ }
34
+ if (taskId && typeof taskKind === 'string' && taskKind !== 'cancel') {
35
+ try {
36
+ if (this.deps.taskEngine.isLegacyRecoveryBlocked?.(taskId)) {
37
+ this.deps.mailbox.releaseClaim(msg.messageId, claimToken)
38
+ log.warn(`[AgentRuntime:${this.agentId}] 任务 ${taskId} 因历史恢复隔离暂不执行`)
39
+ return
40
+ }
41
+ }
42
+ catch (err) {
43
+ this.deps.mailbox.releaseClaim(msg.messageId, claimToken)
44
+ log.error(`[AgentRuntime:${this.agentId}] 历史任务恢复检查失败,暂不执行:`, err)
45
+ return
46
+ }
47
+ }
20
48
  // §5.1 执行代次栅栏:任务消息携带 assignment generation + execution lease。
21
49
  // 运行中 reassign 之后,旧 worker 信箱里残留/被重投的 assign 与它会话中继续吐出的
22
50
  // 事件都带旧代次 —— 一律丢弃,绝不覆盖新执行结果。
23
51
  const fence = fenceFromMetadata(msg.metadata)
24
52
  // cancel 只是控制消息:它负责让已在运行的回合收口,本身不得再启动一次 worker turn。
25
53
  if (taskKind === 'cancel') {
26
- this.deps.mailbox.markConsumed(msg.messageId)
54
+ this.deps.mailbox.markConsumed(msg.messageId, claimToken)
27
55
  return
28
56
  }
29
57
  // 过期任务投递检查:任务已终态(cancel/reassign 后残留的旧 assign/child-completed)→ 跳过执行,
30
58
  // 否则 worker/lead 会对着已终态任务的旧投递真的再跑一轮 harness。
31
- if ((taskKind === 'assign' || taskKind === 'child-completed') && taskId) {
32
- const task = this.deps.taskEngine.get(taskId)
33
- if (!task || TERMINAL_TASK_STATES[task.state]) {
34
- this.deps.mailbox.markConsumed(msg.messageId)
59
+ if (taskKind === 'assign') {
60
+ const task = taskId ? this.deps.taskEngine.get(taskId) : undefined
61
+ if (!taskId || msg.contextId !== this.channelId || !task || task.channelId !== this.channelId
62
+ || task.assigneeId !== this.agentId || TERMINAL_TASK_STATES[task.state]
63
+ || !Number.isSafeInteger(fence?.generation) || (fence?.generation ?? -1) < 0
64
+ || !fence?.leaseId || task.assignmentGeneration !== fence.generation
65
+ || task.executionLeaseId !== fence.leaseId || task.executionLeaseAgentId !== this.agentId
66
+ || task.executionLeaseRevokedAt) {
67
+ log.warn(`[AgentRuntime:${this.agentId}] 拒绝缺失或过期执行租约的任务投递:task=${taskId ?? '-'};请重新派发`)
68
+ this.deps.mailbox.markConsumed(msg.messageId, claimToken)
35
69
  return
36
70
  }
37
- if (!this.assignmentFenceOk(taskId, fence)) {
38
- log.warn(`[AgentRuntime:${this.agentId}] 丢弃过期任务投递(旧执行代次):task=${taskId.slice(0, 8)} kind=${taskKind}`)
39
- this.deps.mailbox.markConsumed(msg.messageId)
71
+ }
72
+ else if (taskKind === 'child-completed' && taskId) {
73
+ const task = this.deps.taskEngine.get(taskId)
74
+ if (!task || TERMINAL_TASK_STATES[task.state] || !this.assignmentFenceOk(taskId, fence)) {
75
+ this.deps.mailbox.markConsumed(msg.messageId, claimToken)
40
76
  return
41
77
  }
42
78
  }
@@ -50,6 +86,9 @@ export abstract class AgentRuntimeMessage extends AgentRuntimeSupervise {
50
86
  /** 失败原因(事件 error / 生成器抛错):写入任务 history,供事后诊断 */
51
87
  let runErrorMessage = ''
52
88
  let runErrorCode = ''
89
+ const controller = new AbortController()
90
+ this.abortController = controller
91
+ const runSignal = controller.signal
53
92
  try {
54
93
  // 任务消息联动:assign → WORKING(自动接取;状态事件由 TaskEngine transition hooks 广播)
55
94
  // 仅 SUBMITTED/ASSIGNED 自动接取:WAITING(已有子任务)的任务由 SchedulerLoop/子任务汇总推进,
@@ -75,8 +114,7 @@ export abstract class AgentRuntimeMessage extends AgentRuntimeSupervise {
75
114
  }
76
115
  }
77
116
  }
78
- // 每次 run 新建 AbortController;abort 后事件流终止
79
- this.abortController = new AbortController()
117
+ if (interruptedWithoutSettlement(runSignal)) return
80
118
  // §2.4/§6.2:worker 回合与 Lead supervise 共用同一 harness 进程/会话 ——
81
119
  // 回合起点观测租约(复用计数 / 重建归因)。
82
120
  this.noteHarnessUse()
@@ -88,10 +126,25 @@ export abstract class AgentRuntimeMessage extends AgentRuntimeSupervise {
88
126
  // sessionId 透传:当前会话作用域记忆在 auto 档获得排序加分(session 行更相关)
89
127
  let memoryBlock: string | undefined
90
128
  try {
91
- memoryBlock = (await this.deps.memory?.recall(partsToText(msg.parts), {
129
+ const recall = this.deps.memory?.recall(partsToText(msg.parts), {
92
130
  relatedTaskIds: this.relatedTaskIdsOf(taskId),
93
131
  sessionId,
94
- })) ?? undefined
132
+ signal: runSignal,
133
+ })
134
+ if (recall) {
135
+ let onAbort!: () => void
136
+ const aborted = new Promise<undefined>((resolve) => {
137
+ onAbort = () => resolve(undefined)
138
+ if (runSignal.aborted) onAbort()
139
+ else runSignal.addEventListener('abort', onAbort, { once: true })
140
+ })
141
+ try {
142
+ memoryBlock = (await Promise.race([recall, aborted])) ?? undefined
143
+ }
144
+ finally {
145
+ runSignal.removeEventListener('abort', onAbort)
146
+ }
147
+ }
95
148
  }
96
149
  catch (err) {
97
150
  log.error(`[AgentRuntime:${this.agentId}] 记忆召回失败:`, err)
@@ -102,14 +155,53 @@ export abstract class AgentRuntimeMessage extends AgentRuntimeSupervise {
102
155
  memoryBlock,
103
156
  runtimeSession ? { id: runtimeSession.id, block: runtimeSession.block } : undefined,
104
157
  )
158
+ if (interruptedWithoutSettlement(runSignal)) return
159
+ const activeRunSignal = runSignal
160
+ const generation = fence?.generation
161
+ const leaseId = fence?.leaseId
162
+ const executionScope: ExecutionScope | undefined = taskKind === 'assign' && taskId && generation != null && leaseId
163
+ ? {
164
+ taskId,
165
+ agentId: this.agentId,
166
+ channelId: msg.contextId,
167
+ assignmentGeneration: generation,
168
+ executionLeaseId: leaseId,
169
+ signal: activeRunSignal,
170
+ assertActive: () => {
171
+ if (activeRunSignal.aborted) throw new Error('task execution aborted')
172
+ if (this.deps.taskEngine.isLegacyRecoveryBlocked?.(taskId)) throw new Error('task blocked by legacy recovery hold')
173
+ const current = this.deps.taskEngine.get(taskId)
174
+ if (!current || current.channelId !== this.channelId || TERMINAL_TASK_STATES[current.state]
175
+ || current.assigneeId !== this.agentId
176
+ || current.assignmentGeneration !== generation
177
+ || current.executionLeaseId !== leaseId
178
+ || current.executionLeaseAgentId !== this.agentId
179
+ || current.executionLeaseRevokedAt) {
180
+ throw new Error('stale task execution lease')
181
+ }
182
+ },
183
+ }
184
+ : undefined
105
185
  const ctx: AgentRunContext = {
106
186
  agentId: this.agentId,
107
187
  channelId: msg.contextId,
108
188
  role: this.role,
109
189
  workspace: this.deps.workspace,
110
- signal: this.abortController.signal,
190
+ signal: runSignal,
191
+ ...(executionScope ? { executionScope } : {}),
111
192
  ...(runtimeSession ? { session: { id: runtimeSession.id, block: runtimeSession.block } } : {}),
112
193
  }
194
+ if (interruptedWithoutSettlement(runSignal)) return
195
+ if (this.deps.mailbox.isClaimBlocked?.(msg.messageId, claimToken)) return
196
+ if (executionScope) {
197
+ try {
198
+ executionScope.assertActive()
199
+ }
200
+ catch (err) {
201
+ log.warn(`[AgentRuntime:${this.agentId}] 回合启动前执行租约失效:`, err)
202
+ return
203
+ }
204
+ }
113
205
  // 补入产出者 agentId(monitor 据此归属事件;不改原 msg,用浅拷贝)
114
206
  const enrichedSource = { ...msg, metadata: { ...msg.metadata, 'x-aw-producing-agent': this.agentId } }
115
207
  // 回复文本收集(V9:omp 不产 message 事件,聚合三类源——message 事件 / status.message / 终态 artifact 'output')
@@ -123,6 +215,10 @@ export abstract class AgentRuntimeMessage extends AgentRuntimeSupervise {
123
215
  }
124
216
  try {
125
217
  for await (const event of this.impl.run(request, ctx)) {
218
+ if (interruptedWithoutSettlement(runSignal) || this.deps.mailbox.isClaimBlocked?.(msg.messageId, claimToken)) break
219
+ // 消息看门狗的活动上报:任何 harness 事件(delta/工具/状态)都证明回合活着,
220
+ // 重置无活动窗口 —— 长治理回合(慢模型逐回合 40s-4min)不应被固定死线误杀。
221
+ this.bumpMessageActivity()
126
222
  this.deps.bus.emit(event, enrichedSource)
127
223
  // LLM 流式增量:只走事件流(AEP agent.delta),不进任务引擎/交付兜底管道;
128
224
  // 但要单独留底 —— 纯文本回合(模型以最终输出作答,不调工具)的回执全靠它
@@ -167,6 +263,7 @@ export abstract class AgentRuntimeMessage extends AgentRuntimeSupervise {
167
263
  this.pendingHarnessFailure = 'RPC_BROKEN'
168
264
  log.error(`[AgentRuntime:${this.agentId}] 回合异常:`, err)
169
265
  }
266
+ if (this.deps.mailbox.isClaimBlocked?.(msg.messageId, claimToken)) return
170
267
  // 人类 requireReply 的平台兜底回执:实测部分引擎/模型不遵从 send_message_to_agent
171
268
  // (回合只产 artifact 文本),请求方将收不到任何应答。平台把回合聚合文本代投回
172
269
  // 时间线(in_reply_to 关联 + x-aw-relayed 标记),保证"要求回复"必有确定应答;
@@ -192,7 +289,8 @@ export abstract class AgentRuntimeMessage extends AgentRuntimeSupervise {
192
289
  if (remainder) relayText = remainder
193
290
  }
194
291
  relayText = relayText.trim().slice(0, 4000)
195
- if (msg.metadata?.['x-aw-require-reply'] === 'true'
292
+ if (!interruptedWithoutSettlement(runSignal)
293
+ && msg.metadata?.['x-aw-require-reply'] === 'true'
196
294
  && typeof msg.metadata?.['x-aw-from-label'] === 'string'
197
295
  && relayText) {
198
296
  const relayMeta = {
@@ -240,7 +338,8 @@ export abstract class AgentRuntimeMessage extends AgentRuntimeSupervise {
240
338
  // 最终文本作为交付物;否则这类引擎的所有任务都会「工作做完了却停滞被回收」。
241
339
  // - 两者皆无(LLM 空转)→ FAILED 交给调度器 retry/reassign。
242
340
  // 仅 worker 的 assign 执行消息生效:lead 由 supervise 协调;WAITING 父任务不属此列。
243
- if (taskId && this.role === 'worker' && taskKind === 'assign'
341
+ if (!interruptedWithoutSettlement(runSignal)
342
+ && taskId && this.role === 'worker' && taskKind === 'assign'
244
343
  && this.assignmentFenceOk(taskId, fence)) {
245
344
  const after = this.deps.taskEngine.get(taskId)
246
345
  if (after && after.assigneeId === this.agentId && after.state === 'WORKING') {
@@ -325,7 +424,7 @@ export abstract class AgentRuntimeMessage extends AgentRuntimeSupervise {
325
424
  }
326
425
 
327
426
  // 记忆沉淀:终态任务 harvest;无 taskId 的点对点消息记协作(异常不阻塞)
328
- if (this.deps.memory) {
427
+ if (!interruptedWithoutSettlement(runSignal) && this.deps.memory) {
329
428
  try {
330
429
  const task = taskId ? this.deps.taskEngine.get(taskId) : undefined
331
430
  if (task && TERMINAL_TASK_STATES[task.state]) {
@@ -342,6 +441,9 @@ export abstract class AgentRuntimeMessage extends AgentRuntimeSupervise {
342
441
  }
343
442
  }
344
443
  finally {
444
+ // Revoke any in-flight host tool continuation before releasing its claim.
445
+ const interrupted = interruptedWithoutSettlement(runSignal)
446
+ if (!runSignal.aborted) controller.abort(new Error('turn settled'))
345
447
  this.abortController = null
346
448
  this.currentTaskId = null
347
449
  // C-P1-2:回合落定即通知 manager。回执成功时 manager 已在 platformReply 里按
@@ -366,6 +468,17 @@ export abstract class AgentRuntimeMessage extends AgentRuntimeSupervise {
366
468
  // 内容不丢,重试回合(通常已是全新子进程)再处理;每消息最多重投 2 次防毒消息死循环。
367
469
  // 任务已终态(取消/收口后 abort 让回合报错)则不再重投 —— 消息依任务终态
368
470
  // 由调度器 reassign/新 assign 驱动,重投只会空转(启动即被终态检查消费)。
471
+ if (interrupted && taskId && fence?.generation != null && fence.leaseId) {
472
+ try {
473
+ const { getToolApprovals } = await import('../../agents/tool-approvals')
474
+ getToolApprovals().cancelPendingForTask(taskId, '任务执行已中止,审批失效,指令未执行', {
475
+ agentId: this.agentId,
476
+ assignmentGeneration: fence.generation,
477
+ executionLeaseId: fence.leaseId,
478
+ })
479
+ }
480
+ catch { /* 审批面未装配时仍保留中止语义 */ }
481
+ }
369
482
  const taskNow = taskId ? this.deps.taskEngine.get(taskId) : undefined
370
483
  const taskDone = !!taskNow && TERMINAL_TASK_STATES[taskNow.state]
371
484
  // ── 缺陷2修复:harness 回合失败分类熔断(2026-10-30)──
@@ -374,7 +487,7 @@ export abstract class AgentRuntimeMessage extends AgentRuntimeSupervise {
374
487
  // 防"任务假活 + 无意义重试打供应商"。冷却窗(5min)后半开:放行探测回合,
375
488
  // 成功整串复位;再失败立即重新熔断。network 等可重试类别不参与熔断。
376
489
  let stopRetry = false
377
- if (sawRunError) {
490
+ if (sawRunError && !interrupted) {
378
491
  const cls = classifyHarnessFailure(runErrorCode, runErrorMessage)
379
492
  const streak = recordHarnessFailure(this.harnessFailStreak, cls)
380
493
  this.harnessFailStreak = streak
@@ -397,8 +510,25 @@ export abstract class AgentRuntimeMessage extends AgentRuntimeSupervise {
397
510
  else {
398
511
  this.harnessFailStreak = null
399
512
  }
400
- if (sawRunError && !taskDone && !stopRetry && (this.runErrorRetries.get(msg.messageId) ?? 0) < 2
401
- && this.deps.mailbox.requeue(msg.messageId)) {
513
+ // A hold introduced during recall or execution must retain the exact claim without retry loss.
514
+ const recoveryBlocked = this.deps.mailbox.isClaimBlocked?.(msg.messageId, claimToken) ?? false
515
+ if (recoveryBlocked) {
516
+ this.deps.mailbox.releaseClaim(msg.messageId, claimToken)
517
+ }
518
+ else if (interrupted) {
519
+ const reason = runSignal.reason instanceof Error ? runSignal.reason.message : String(runSignal.reason ?? '')
520
+ if (reason === 'message watchdog') {
521
+ if (this.deps.mailbox.requeue(msg.messageId, claimToken)) this.deps.mailbox.wake()
522
+ }
523
+ else if (reason === 'runtime stop' && !taskDone) {
524
+ this.deps.mailbox.releaseClaim(msg.messageId, claimToken)
525
+ }
526
+ else {
527
+ this.deps.mailbox.markConsumed(msg.messageId, claimToken)
528
+ }
529
+ }
530
+ else if (sawRunError && !taskDone && !stopRetry && (this.runErrorRetries.get(msg.messageId) ?? 0) < 2
531
+ && this.deps.mailbox.requeue(msg.messageId, claimToken)) {
402
532
  const attempt = (this.runErrorRetries.get(msg.messageId) ?? 0) + 1
403
533
  this.runErrorRetries.set(msg.messageId, attempt)
404
534
  this.emitExternal({
@@ -417,7 +547,7 @@ export abstract class AgentRuntimeMessage extends AgentRuntimeSupervise {
417
547
  }
418
548
  else {
419
549
  this.runErrorRetries.delete(msg.messageId)
420
- this.deps.mailbox.markConsumed(msg.messageId)
550
+ this.deps.mailbox.markConsumed(msg.messageId, claimToken)
421
551
  }
422
552
  // 回合落定:信箱空 → 后台压缩检查(post-settle 路径;impl 自守卫不阻塞)
423
553
  this.maybePostSettle()
@@ -32,12 +32,22 @@ export abstract class AgentRuntimeState extends AgentRuntimeContracts {
32
32
  protected pollWaiters = 0
33
33
  /** run 与 supervise 互斥锁(promise 链) */
34
34
  protected execLock: Promise<void> = Promise.resolve()
35
- protected abortController: AbortController | null = null
35
+ private activeAbortController: AbortController | null = null
36
+ protected turnGeneration = 0
37
+ protected get abortController(): AbortController | null { return this.activeAbortController }
38
+
39
+ protected set abortController(controller: AbortController | null) {
40
+ if (controller) this.turnGeneration += 1
41
+ this.activeAbortController = controller
42
+ }
43
+
36
44
  protected loopPromise: Promise<void> | null = null
37
45
  /** stop() 的单次收尾 promise;manager shutdown 必须等它完成后才可关闭 DB。 */
38
46
  protected stopPromise: Promise<void> | null = null
39
47
  /** 回合收尾后的异步 harness 清理,必须纳入 stop 的等待屏障。 */
40
48
  protected postSettlePromise: Promise<void> | null = null
49
+ /** Steer callbacks may settle messages after the consume loop has exited. */
50
+ protected readonly steerPromises = new Set<Promise<void>>()
41
51
  protected started = false
42
52
  protected supervisionAttempt: SupervisionAttemptView = {
43
53
  attemptId: null, state: 'IDLE', startedAt: null, watchdogAt: null, activeRootId: null, watchdogCount: 0,
@@ -316,7 +326,7 @@ export abstract class AgentRuntimeState extends AgentRuntimeContracts {
316
326
  && this.hasActiveSupervisionAttempt()
317
327
  if (!abortingRun && !abortingSupervision) return false
318
328
  log.warn(`[AgentRuntime:${this.agentId}] abortTask 调用(task=${taskId},state=${this.state})`)
319
- if (abortingRun) this.abortController?.abort()
329
+ if (abortingRun) this.abortController?.abort(new Error('task abort'))
320
330
  if (abortingSupervision) {
321
331
  this.supervisionAttempt = { ...this.supervisionAttempt, state: 'ABORT_REQUESTED' }
322
332
  this.superviseController?.abort()
@@ -359,8 +369,13 @@ export abstract class AgentRuntimeState extends AgentRuntimeContracts {
359
369
  // 关联到本消息(in_reply_to 断链,回执丢失实测)。改走信箱 peer 回合 ——
360
370
  // 稍晚但归属正确、回执必有应答。
361
371
  if (message.metadata?.['x-aw-require-reply'] === 'true') return
372
+ // Bind the acknowledgement to the turn that was active at injection time.
373
+ const turnSignal = this.abortController?.signal ?? this.superviseController?.signal
374
+ if (!turnSignal || turnSignal.aborted) return
375
+ const turnLock = this.execLock
362
376
  // ④ 其余(人类紧急直发):原有 steer 注入路径
363
- if (!this.deps.mailbox.claim(message.messageId)) return
377
+ const claimToken = this.deps.mailbox.claim(message.messageId)
378
+ if (!claimToken) return
364
379
  const text = message.parts
365
380
  .map((p) => {
366
381
  if ('text' in p) return p.text
@@ -378,27 +393,68 @@ export abstract class AgentRuntimeState extends AgentRuntimeContracts {
378
393
  `require_reply=仅当你还需要对方进一步响应时才设 true。`,
379
394
  )
380
395
  }
381
- this.impl.steer(lines.join('\n'))
382
- .then((mode) => {
383
- if (mode === 'steer') {
384
- // 确认注入流式会话 → 消费落定(at-least-once:进程崩溃由 resetConsuming 兜底)
385
- this.deps.mailbox.markConsumed(message.messageId)
396
+ let steering: Promise<'steer' | 'deferred'>
397
+ try {
398
+ steering = this.impl.steer(lines.join('\n'))
399
+ }
400
+ catch (err) {
401
+ log.error(`[AgentRuntime:${this.agentId}] steer 失败(释放认领回 pending 待循环处理):`, err)
402
+ this.releaseSteerClaim(message.messageId, claimToken)
403
+ return
404
+ }
405
+ const settling = steering
406
+ .then(async (mode) => {
407
+ if (mode === 'steer' && !turnSignal.aborted && this.getState() !== 'stopped') {
408
+ // 异步 steer 在途期间任务联动可能已进入 legacy recovery hold/FIFO 屏障:
409
+ // 结算前必须按当前认领 token 复检持久行资格。消费被阻塞的行会静默吞掉
410
+ // 恢复屏障应拥有的投递 —— 改为隔离成 dead(保留原始证据、不重放)。
411
+ if (this.deps.mailbox.isClaimBlocked(message.messageId, claimToken)) {
412
+ if (!this.deps.mailbox.deadLetterLegacyRecoveryClaim(message.messageId, claimToken)) {
413
+ this.deps.mailbox.releaseClaim(message.messageId, claimToken)
414
+ }
415
+ return
416
+ }
417
+ // Only acknowledge injection while its original turn is still live.
418
+ this.deps.mailbox.markConsumed(message.messageId, claimToken)
419
+ }
420
+ else if (turnSignal.aborted || this.getState() === 'stopped') {
421
+ // Do not replay until the interrupted turn has actually left its lock.
422
+ await turnLock
423
+ // 被恢复 hold 阻塞的联动消息不得回 pending 等重放(hold 解除后会双投):
424
+ // 同样隔离为恢复证据;未阻塞的行保持原有"不扣次数释放回 pending"语义。
425
+ if (this.deps.mailbox.isClaimBlocked(message.messageId, claimToken)
426
+ && this.deps.mailbox.deadLetterLegacyRecoveryClaim(message.messageId, claimToken)) {
427
+ return
428
+ }
429
+ this.deps.mailbox.releaseClaim(message.messageId, claimToken)
386
430
  }
387
431
  else {
388
432
  // deferred:释放认领回 pending,poll_messages(250ms 兜底重查)或
389
433
  // 本回合结束后的消费循环(FIFO)接管,消息必达不丢失
390
- this.releaseSteerClaim(message.messageId)
434
+ this.releaseSteerClaim(message.messageId, claimToken)
391
435
  }
392
436
  })
393
- .catch((err) => {
437
+ .catch(async (err) => {
394
438
  log.error(`[AgentRuntime:${this.agentId}] steer 失败(释放认领回 pending 待循环处理):`, err)
395
- this.releaseSteerClaim(message.messageId)
439
+ if (turnSignal.aborted || this.getState() === 'stopped') {
440
+ await turnLock
441
+ this.deps.mailbox.releaseClaim(message.messageId, claimToken)
442
+ }
443
+ else this.releaseSteerClaim(message.messageId, claimToken)
396
444
  })
445
+ this.steerPromises.add(settling)
446
+ void settling.then(
447
+ () => { this.steerPromises.delete(settling) },
448
+ (err) => {
449
+ this.steerPromises.delete(settling)
450
+ log.error(`[AgentRuntime:${this.agentId}] steer 消息收尾失败:`, err)
451
+ },
452
+ )
397
453
  }
398
454
 
399
455
  /** 释放 steer 认领:consuming → pending + 唤醒 dequeue 门闩与到信等待方 */
400
- protected releaseSteerClaim(messageId: string): void {
401
- if (this.deps.mailbox.requeue(messageId)) {
456
+ protected releaseSteerClaim(messageId: string, claimToken: string): void {
457
+ if (this.deps.mailbox.requeue(messageId, claimToken)) {
402
458
  this.deps.mailbox.wake()
403
459
  }
404
460
  }