agentworkshop 0.8.5 → 0.8.6

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 (349) hide show
  1. package/.AgentWorkShop/prompts/host-tools.en.json +3 -3
  2. package/.AgentWorkShop/prompts/host-tools.json +14 -4
  3. package/.output/.AgentWorkShop/prompts/host-tools.en.json +3 -3
  4. package/.output/.AgentWorkShop/prompts/host-tools.json +14 -4
  5. package/.output/nitro.json +1 -1
  6. package/.output/public/_nuxt/{U_n8pryv2.js → 7op-BMk82.js} +1 -1
  7. package/.output/public/_nuxt/{zWZ26UWi.js → B1SIgyrl.js} +1 -1
  8. package/.output/public/_nuxt/{C4tXwpSt.js → BA2lmfW4.js} +1 -1
  9. package/.output/public/_nuxt/{EJkmXP432.js → BDXQqSkl2.js} +1 -1
  10. package/.output/public/_nuxt/{CY_7u1ST2.js → BI9jj13f2.js} +1 -1
  11. package/.output/public/_nuxt/{CGf9neEK2.js → BiXqyYNw2.js} +1 -1
  12. package/.output/public/_nuxt/{D9GoOkyP2.js → BlOm8JIs2.js} +1 -1
  13. package/.output/public/_nuxt/{CQ31GiJU2.js → BoXKUOiN2.js} +1 -1
  14. package/.output/public/_nuxt/{DZzbCFY2.js → BuLoPmcf.js} +1 -1
  15. package/.output/public/_nuxt/{D9ppMCbw.js → BwOK42JQ.js} +1 -1
  16. package/.output/public/_nuxt/{CZJ5cw6r2.js → C1RMfPoB2.js} +1 -1
  17. package/.output/public/_nuxt/{CGviZq4E.js → COfo_Bg3.js} +1 -1
  18. package/.output/public/_nuxt/CTGJHZ8X2.js +1 -0
  19. package/.output/public/_nuxt/{SgsmmrsZ.js → CY2NkFvI.js} +1 -1
  20. package/.output/public/_nuxt/{B4GOTVfN.js → C_4mzQ5X.js} +1 -1
  21. package/.output/public/_nuxt/{DGmFHb7m.js → CdvMP3lv.js} +1 -1
  22. package/.output/public/_nuxt/{iqxZGXsY.js → CooauJ7D.js} +1 -1
  23. package/.output/public/_nuxt/{C3vxePED.js → D1eVi1zr.js} +1 -1
  24. package/.output/public/_nuxt/{DnuJ66Jy.js → D6PUmBb0.js} +1 -1
  25. package/.output/public/_nuxt/{BBhroEeN.js → DC8sMA36.js} +1 -1
  26. package/.output/public/_nuxt/{DOUuGOQR2.js → DDHh85c42.js} +1 -1
  27. package/.output/public/_nuxt/{Cy_HDgSl.js → DDXOfmo2.js} +2 -2
  28. package/.output/public/_nuxt/{Cr2xJ_CY.js → DMFwLxfu.js} +1 -1
  29. package/.output/public/_nuxt/{BZg_MIK42.js → DoprKJ5a2.js} +1 -1
  30. package/.output/public/_nuxt/{BzBBEE-o2.js → Dr1FVeQG2.js} +1 -1
  31. package/.output/public/_nuxt/{W0sNnJQh.js → DtnsTW7e.js} +1 -1
  32. package/.output/public/_nuxt/{gUYi1hLJ2.js → DxDqd6T42.js} +1 -1
  33. package/.output/public/_nuxt/{B0UUODeh.js → DzU3zEKX.js} +1 -1
  34. package/.output/public/_nuxt/{BkO5WdX5.js → EgO70wrE.js} +1 -1
  35. package/.output/public/_nuxt/{7OZQiw002.js → HJKu4eEV2.js} +1 -1
  36. package/.output/public/_nuxt/{ChF6qLpY2.js → K5Xen0wZ2.js} +1 -1
  37. package/.output/public/_nuxt/{CNrRZmSx2.js → Rb4o4o-82.js} +1 -1
  38. package/.output/public/_nuxt/{BqBTlfiz.js → Tf6SJSDj.js} +1 -1
  39. package/.output/public/_nuxt/{DJaGVY4v2.js → ZzOyoXex2.js} +1 -1
  40. package/.output/public/_nuxt/{PbzVdCTA2.js → azOGy_tU2.js} +1 -1
  41. package/.output/public/_nuxt/{D1thFC3z.js → be-4wyTo.js} +1 -1
  42. package/.output/public/_nuxt/builds/latest.json +1 -1
  43. package/.output/public/_nuxt/builds/meta/593b65bd-cf1d-4b7f-a993-57e939c38f36.json +1 -0
  44. package/.output/public/_nuxt/{8b9CKi6F.js → dcjPjLPI.js} +1 -1
  45. package/.output/public/_nuxt/{ae2-5ZPt.js → h-Fn7pRD.js} +1 -1
  46. package/.output/public/_nuxt/{-gy9k_TE2.js → hyLdZsOd2.js} +1 -1
  47. package/.output/public/_nuxt/{BHxG41IQ2.js → o8sYG6xx2.js} +1 -1
  48. package/.output/server/chunks/_/access.mjs +1 -1
  49. package/.output/server/chunks/_/agent-dto.mjs +26 -0
  50. package/.output/server/chunks/_/agent-dto.mjs.map +1 -0
  51. package/.output/server/chunks/_/data-export.mjs +6 -6
  52. package/.output/server/chunks/_/data-query.mjs +3 -3
  53. package/.output/server/chunks/_/eda-run.repo.mjs +2 -2
  54. package/.output/server/chunks/_/features.mjs +5 -5
  55. package/.output/server/chunks/_/golden.mjs +3 -3
  56. package/.output/server/chunks/_/harness-spawn-policy.mjs +77 -0
  57. package/.output/server/chunks/_/harness-spawn-policy.mjs.map +1 -0
  58. package/.output/server/chunks/_/index.mjs +1 -1
  59. package/.output/server/chunks/_/line-scope.mjs +32 -0
  60. package/.output/server/chunks/_/line-scope.mjs.map +1 -0
  61. package/.output/server/chunks/_/mes-console.mjs +1 -1
  62. package/.output/server/chunks/_/nitro.mjs +2429 -1726
  63. package/.output/server/chunks/_/nitro.mjs.map +1 -1
  64. package/.output/server/chunks/_/ocap.mjs +1 -1
  65. package/.output/server/chunks/_/rest-auth.mjs +1 -1
  66. package/.output/server/chunks/_/spc.mjs +1 -1
  67. package/.output/server/chunks/build/TownView-BWMDbosY.mjs +1 -1
  68. package/.output/server/chunks/build/daq-CdxcfY_G.mjs +1 -1
  69. package/.output/server/chunks/build/dcw-BlDQtS4q.mjs +1 -1
  70. package/.output/server/chunks/build/types-D6J7slEa.mjs +1 -1
  71. package/.output/server/chunks/build/useDaqAddNode-D_Rkju0f.mjs +1 -1
  72. package/.output/server/chunks/build/useDaqDetailNode-DeOsDxK5.mjs +1 -1
  73. package/.output/server/chunks/build/useDaqDetailParams-Cm9a9r5G.mjs +1 -1
  74. package/.output/server/chunks/build/useDaqFilters-CctmO03p.mjs +1 -1
  75. package/.output/server/chunks/build/useDaqStream-B9ZBVQrI.mjs +1 -1
  76. package/.output/server/chunks/build/useDaqTemplates-CK37sMfi.mjs +1 -1
  77. package/.output/server/chunks/build/useDcwAddNode-DACVcEHs.mjs +1 -1
  78. package/.output/server/chunks/build/useDcwStream-Dir5ufAU.mjs +1 -1
  79. package/.output/server/chunks/routes/api/mcp/workshop.mjs +1 -1
  80. package/.output/server/chunks/routes/api/system/backup/run.post.mjs +2 -2
  81. package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs +17 -9
  82. package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs.map +1 -1
  83. package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs +3 -0
  84. package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs.map +1 -1
  85. package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +1 -1
  86. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs +6 -0
  87. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs.map +1 -1
  88. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs +5 -0
  89. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs.map +1 -1
  90. package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs +5 -2
  91. package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs.map +1 -1
  92. package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs +7 -1
  93. package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs.map +1 -1
  94. package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs +3 -1
  95. package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs.map +1 -1
  96. package/.output/server/chunks/routes/api/workshop/channels.post.mjs +8 -6
  97. package/.output/server/chunks/routes/api/workshop/channels.post.mjs.map +1 -1
  98. package/.output/server/chunks/routes/api/workshop/daq/_id/ingest.post.mjs +29 -49
  99. package/.output/server/chunks/routes/api/workshop/daq/_id/ingest.post.mjs.map +1 -1
  100. package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs +1 -1
  101. package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs +6 -1
  102. package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs.map +1 -1
  103. package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs +4 -2
  104. package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs.map +1 -1
  105. package/.output/server/chunks/routes/api/workshop/daq/index2.post.mjs +1 -1
  106. package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs +14 -5
  107. package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs.map +1 -1
  108. package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs +1 -1
  109. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs +1 -1
  110. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs +1 -1
  111. package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs +7 -4
  112. package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs.map +1 -1
  113. package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs +1 -1
  114. package/.output/server/chunks/routes/api/workshop/dcw/_id/bindings.put.mjs +1 -1
  115. package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs +6 -2
  116. package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs.map +1 -1
  117. package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs +6 -2
  118. package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs.map +1 -1
  119. package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs +1 -1
  120. package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs +1 -1
  121. package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs +1 -1
  122. package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs +6 -1
  123. package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs.map +1 -1
  124. package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs +1 -1
  125. package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs +7 -4
  126. package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs.map +1 -1
  127. package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs +1 -1
  128. package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs +1 -1
  129. package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs +1 -1
  130. package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs +6 -2
  131. package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs.map +1 -1
  132. package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs +1 -1
  133. package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs +7 -4
  134. package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs.map +1 -1
  135. package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs +1 -1
  136. package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs +1 -1
  137. package/.output/server/chunks/routes/api/workshop/dcw/index5.post.mjs +1 -1
  138. package/.output/server/chunks/routes/api/workshop/dcw/index6.get.mjs +6 -2
  139. package/.output/server/chunks/routes/api/workshop/dcw/index6.get.mjs.map +1 -1
  140. package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs +1 -1
  141. package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs +1 -1
  142. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs +1 -1
  143. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs +1 -1
  144. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs +1 -1
  145. package/.output/server/chunks/routes/api/workshop/dcw/mes-artifacts/file.get.mjs +6 -2
  146. package/.output/server/chunks/routes/api/workshop/dcw/mes-artifacts/file.get.mjs.map +1 -1
  147. package/.output/server/chunks/routes/api/workshop/dcw/mes-hook-test.post.mjs +1 -1
  148. package/.output/server/chunks/routes/api/workshop/dcw/mes-test-read.post.mjs +1 -1
  149. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs +1 -1
  150. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs +1 -1
  151. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs +6 -2
  152. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs.map +1 -1
  153. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs +4 -2
  154. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs.map +1 -1
  155. package/.output/server/chunks/routes/api/workshop/dcw/params/_id/read.post.mjs +5 -2
  156. package/.output/server/chunks/routes/api/workshop/dcw/params/_id/read.post.mjs.map +1 -1
  157. package/.output/server/chunks/routes/api/workshop/dcw/params/_id/write.post.mjs +1 -1
  158. package/.output/server/chunks/routes/api/workshop/dcw/params/_id_.delete.mjs +1 -1
  159. package/.output/server/chunks/routes/api/workshop/dcw/params/_id_.patch.mjs +1 -1
  160. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs +1 -1
  161. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs +1 -1
  162. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs +1 -1
  163. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs +1 -1
  164. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/versions.get.mjs +7 -3
  165. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/versions.get.mjs.map +1 -1
  166. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs +8 -1
  167. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs.map +1 -1
  168. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs +6 -2
  169. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs.map +1 -1
  170. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs +1 -1
  171. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs +1 -1
  172. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs +1 -1
  173. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs +1 -1
  174. package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs +7 -4
  175. package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs.map +1 -1
  176. package/.output/server/chunks/routes/api/workshop/eda/commonality.get.mjs +1 -1
  177. package/.output/server/chunks/routes/api/workshop/eda/vm/predict.post.mjs +1 -1
  178. package/.output/server/chunks/routes/api/workshop/exp/confirmations/_id/decide.post.mjs +1 -1
  179. package/.output/server/chunks/routes/api/workshop/exp/index.get.mjs +1 -1
  180. package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs +1 -1
  181. package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs +1 -1
  182. package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs +1 -1
  183. package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs +1 -1
  184. package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs +1 -1
  185. package/.output/server/chunks/routes/api/workshop/index.mjs +1 -1
  186. package/.output/server/chunks/routes/api/workshop/index.post.mjs +2 -0
  187. package/.output/server/chunks/routes/api/workshop/index.post.mjs.map +1 -1
  188. package/.output/server/chunks/routes/api/workshop/index.put.mjs +1 -1
  189. package/.output/server/chunks/routes/api/workshop/index3.post.mjs +8 -3
  190. package/.output/server/chunks/routes/api/workshop/index3.post.mjs.map +1 -1
  191. package/.output/server/chunks/routes/api/workshop/index5.post.mjs +1 -1
  192. package/.output/server/chunks/routes/api/workshop/index6.get.mjs +1 -1
  193. package/.output/server/chunks/routes/api/workshop/index7.get.mjs +1 -1
  194. package/.output/server/chunks/routes/api/workshop/index7.post.mjs +1 -1
  195. package/.output/server/chunks/routes/api/workshop/mes/datasets.get.mjs +1 -1
  196. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/autofix.mjs +1 -1
  197. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/compile.mjs +1 -1
  198. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/evidence.mjs +1 -1
  199. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/publish.mjs +1 -1
  200. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval-decision.mjs +1 -1
  201. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval.mjs +1 -1
  202. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/transition.mjs +1 -1
  203. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/subgraph.mjs +1 -1
  204. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/validate.mjs +1 -1
  205. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId_.mjs +1 -1
  206. package/.output/server/chunks/routes/api/workshop/ontology/export/_ontologyId_.mjs +1 -1
  207. package/.output/server/chunks/routes/api/workshop/ontology/index.mjs +1 -1
  208. package/.output/server/chunks/routes/api/workshop/ontology/scene.mjs +1 -1
  209. package/.output/server/chunks/routes/api/workshop/ontology/traces/_ontologyId_.mjs +1 -1
  210. package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId/compare.mjs +1 -1
  211. package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId_.mjs +1 -1
  212. package/.output/server/chunks/routes/api/workshop/optimization/capabilities.get.mjs +1 -1
  213. package/.output/server/chunks/routes/api/workshop/optimization/index.get.mjs +1 -1
  214. package/.output/server/chunks/routes/api/workshop/optimization/index.mjs +1 -1
  215. package/.output/server/chunks/routes/api/workshop/optimization/index2.mjs +1 -1
  216. package/.output/server/chunks/routes/api/workshop/optimization/profiles/_id/publish.post.mjs +1 -1
  217. package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/crosscheck.post.mjs +1 -1
  218. package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/dispatch.post.mjs +1 -1
  219. package/.output/server/chunks/routes/api/workshop/optimization/solve.post.mjs +1 -1
  220. package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs +1 -1
  221. package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +1 -1
  222. package/.output/server/chunks/routes/api/workshop/process-model/datasets.post.mjs +1 -1
  223. package/.output/server/chunks/routes/api/workshop/process-model/eligibility.mjs +1 -1
  224. package/.output/server/chunks/routes/api/workshop/process-model/index.mjs +1 -1
  225. package/.output/server/chunks/routes/api/workshop/process-model/specs/_id/publish.post.mjs +1 -1
  226. package/.output/server/chunks/routes/api/workshop/process-model/train.post.mjs +1 -1
  227. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs +1 -1
  228. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +1 -1
  229. package/.output/server/chunks/routes/api/workshop/tools/sync.post.mjs +1 -1
  230. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs +1 -1
  231. package/.output/server/chunks/routes/renderer.mjs +2 -2
  232. package/.output/server/chunks/virtual/entry.mjs +1 -1
  233. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  234. package/.output/server/package.json +1 -1
  235. package/README-zh.md +4 -2
  236. package/README.md +9 -2
  237. package/config.yml +1 -1
  238. package/docker-compose.yml +4 -2
  239. package/docs/cli.en.md +2 -2
  240. package/docs/cli.md +2 -2
  241. package/docs/plugins.en.md +1 -1
  242. package/docs/plugins.md +1 -1
  243. package/docs/sdk.en.md +1 -1
  244. package/docs/sdk.md +1 -1
  245. package/package.json +1 -1
  246. package/scripts/_audit/_live-mqtt-e2e-20261028.mjs +219 -0
  247. package/scripts/_audit/prompt-injection-probe.mts +76 -0
  248. package/scripts/api-live-e2e.mjs +9 -3
  249. package/scripts/e2e-multiexpert-remediation-real.mjs +453 -0
  250. package/scripts/e2e-node-binding-3mode-real.mjs +697 -0
  251. package/scripts/e2e-node-binding-authz.mjs +332 -0
  252. package/scripts/security-acceptance.mjs +218 -0
  253. package/server/api/workshop/agent-tools/bindings/index.post.ts +33 -17
  254. package/server/api/workshop/agents/[id].patch.ts +3 -0
  255. package/server/api/workshop/agents/index.post.ts +3 -0
  256. package/server/api/workshop/channel-templates/[id].patch.ts +5 -0
  257. package/server/api/workshop/channel-templates/index.post.ts +6 -0
  258. package/server/api/workshop/channels/[id]/agents/[agentId].patch.ts +5 -0
  259. package/server/api/workshop/channels/[id]/agents/index.get.ts +8 -2
  260. package/server/api/workshop/channels/[id]/agents/index.post.ts +7 -0
  261. package/server/api/workshop/channels/[id]/index.get.ts +10 -4
  262. package/server/api/workshop/channels.post.ts +3 -0
  263. package/server/api/workshop/daq/[id]/ingest.post.ts +26 -22
  264. package/server/api/workshop/daq/[id].patch.ts +8 -0
  265. package/server/api/workshop/daq/alarms.get.ts +18 -16
  266. package/server/api/workshop/daq/infra/reconnect.post.ts +21 -5
  267. package/server/api/workshop/daq/test-driver.post.ts +10 -3
  268. package/server/api/workshop/dcw/[id]/param-ledger.get.ts +7 -1
  269. package/server/api/workshop/dcw/[id]/read.post.ts +6 -1
  270. package/server/api/workshop/dcw/[id].patch.ts +49 -40
  271. package/server/api/workshop/dcw/journal/index.get.ts +7 -3
  272. package/server/api/workshop/dcw/mes-artifacts/file.get.ts +7 -1
  273. package/server/api/workshop/dcw/mes-artifacts/index.get.ts +7 -1
  274. package/server/api/workshop/dcw/optimizations/[id]/series.get.ts +6 -1
  275. package/server/api/workshop/dcw/optimizations/[id].get.ts +3 -1
  276. package/server/api/workshop/dcw/optimizations/index.get.ts +6 -3
  277. package/server/api/workshop/dcw/params/[id]/read.post.ts +22 -17
  278. package/server/api/workshop/dcw/recipes/[id]/versions.get.ts +20 -14
  279. package/server/api/workshop/dcw/recipes/[id].delete.ts +33 -25
  280. package/server/api/workshop/dcw/recipes/index.get.ts +17 -12
  281. package/server/api/workshop/dcw/runs/[id]/close.post.ts +21 -15
  282. package/server/api/workshop/dcw/test-driver.post.ts +21 -16
  283. package/server/api/workshop/ws/hub.ts +2 -1
  284. package/server/plugins/01-instance-guard.ts +82 -0
  285. package/server/plugins/daq.ts +40 -8
  286. package/server/plugins/workshop.ts +12 -0
  287. package/server/services/workshop/agents/adapters/line-spawn.ts +24 -1
  288. package/server/services/workshop/agents/agent-dto.ts +54 -0
  289. package/server/services/workshop/agents/harness-spawn-policy.ts +114 -0
  290. package/server/services/workshop/agents/host-tool-bridge/dispatch.ts +22 -0
  291. package/server/services/workshop/agents/host-tool-bridge/index.ts +1 -1
  292. package/server/services/workshop/agents/host-tool-bridge/per-agent.ts +17 -3
  293. package/server/services/workshop/agents/host-tool-bridge/tools/tasks.ts +1 -1
  294. package/server/services/workshop/agents/host-tool-bridge/tools/team-delegation.ts +5 -1
  295. package/server/services/workshop/agents/industrial/dcw-tools.ts +6 -2
  296. package/server/services/workshop/agents/industrial/ops-tools.ts +54 -12
  297. package/server/services/workshop/agents/industrial/recipe-gate.ts +68 -15
  298. package/server/services/workshop/agents/industrial/tool-verify-legacy-specs.ts +2 -2
  299. package/server/services/workshop/agents/industrial/tool-verify.ts +31 -2
  300. package/server/services/workshop/agents/node-bindings.repo.ts +4 -3
  301. package/server/services/workshop/agents/node-delegation.ts +49 -4
  302. package/server/services/workshop/agents/tool-approvals.ts +23 -0
  303. package/server/services/workshop/agents/tool-reference-spec.ts +3 -0
  304. package/server/services/workshop/daq/bus/mqtt.adapter.ts +12 -0
  305. package/server/services/workshop/daq/daq-controller/crud.ts +5 -3
  306. package/server/services/workshop/daq/daq-controller/ingest.ts +23 -0
  307. package/server/services/workshop/daq/daq-controller/push.ts +24 -3
  308. package/server/services/workshop/daq/daq-controller/runtime-control.ts +6 -0
  309. package/server/services/workshop/daq/daq-controller/sweep-alarms.ts +3 -1
  310. package/server/services/workshop/daq/daq-controller/tsdb-twin.ts +21 -1
  311. package/server/services/workshop/daq/daq-node.repo.ts +10 -7
  312. package/server/services/workshop/daq/daq-node.ts +2 -0
  313. package/server/services/workshop/daq/daq-runtime.ts +10 -2
  314. package/server/services/workshop/daq/drivers/modbus-tcp.ts +8 -5
  315. package/server/services/workshop/daq/drivers/registry.ts +5 -4
  316. package/server/services/workshop/daq/infra.ts +13 -0
  317. package/server/services/workshop/daq/ingest-policy.ts +24 -1
  318. package/server/services/workshop/daq/storage/timescale.adapter.ts +42 -3
  319. package/server/services/workshop/db/database/migrations.ts +83 -68
  320. package/server/services/workshop/dcw/dcw-controller/crud.ts +27 -2
  321. package/server/services/workshop/dcw/dcw-controller/lines.ts +14 -3
  322. package/server/services/workshop/dcw/dcw-controller/recipes.ts +63 -5
  323. package/server/services/workshop/dcw/dcw-recipe.repo.ts +10 -1
  324. package/server/services/workshop/dcw/dcw-runtime.ts +37 -14
  325. package/server/services/workshop/dcw/drivers/shared.ts +62 -6
  326. package/server/services/workshop/dcw/recipe-op-anchor.ts +28 -0
  327. package/server/services/workshop/dcw/recipe-rollback-manager/rollback.ts +204 -190
  328. package/server/services/workshop/dcw/recipe-rollback-manager/sweep.ts +97 -77
  329. package/server/services/workshop/line-scope.ts +80 -0
  330. package/server/services/workshop/optimization/dispatch.service.ts +18 -2
  331. package/server/services/workshop/permissions.ts +2 -0
  332. package/server/services/workshop/runtime/agent-runtime/message.ts +17 -0
  333. package/server/services/workshop/runtime/agent-runtime/state.ts +9 -3
  334. package/server/services/workshop/runtime/agent-runtime/types.ts +2 -1
  335. package/server/services/workshop/runtime/channel-runtime.ts +3 -1
  336. package/server/services/workshop/runtime/mailbox.ts +6 -3
  337. package/server/services/workshop/runtime/manager/a2a.ts +4 -2
  338. package/server/services/workshop/runtime/manager/admin-channel.ts +1 -1
  339. package/server/services/workshop/runtime/manager/chat.ts +3 -1
  340. package/server/services/workshop/runtime/manager/host-tools.ts +1 -1
  341. package/server/services/workshop/runtime/manager/runtime-wiring.ts +31 -19
  342. package/server/services/workshop/runtime/manager/state.ts +43 -1
  343. package/server/services/workshop/runtime/permission-scope.ts +21 -0
  344. package/server/services/workshop/runtime/scheduler-loop/tick.ts +16 -4
  345. package/server/services/workshop/scene-events.ts +19 -0
  346. package/shared/daq-protocol.ts +24 -5
  347. package/shared/dcw-protocol/catalog.ts +4 -4
  348. package/.output/public/_nuxt/CCI-fwcS2.js +0 -1
  349. package/.output/public/_nuxt/builds/meta/5cd11284-05bf-4fcd-9a69-56a01c9f56dd.json +0 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentworkshop-prod",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "dependencies": {
package/README-zh.md CHANGED
@@ -28,7 +28,7 @@
28
28
 
29
29
  **[English](./README.md)** · **[在线文档](https://kingdol666.github.io/AgentWorkShop)** · **[版本发布](https://github.com/kingdol666/AgentWorkShop/releases)** · **[更新日志](./changelog.md)** · **[插件 API](./docs/plugins.md)** · **[SDK](./docs/sdk.md)**
30
30
 
31
- <sub><b>v0.8.5</b> · 14 个执行引擎 · 6 种现场协议(5 内置 + 串口插件)+ MES REST 集成(镜像与直连双路径)· 数据分析台账(产线级权限隔离)· 工艺参数优化器(过程模型 → AML → OSQP 求解 → 治理下发)· **本体服务 + AI 先行模型闭环**(本体 · 孪生 · 求解器 · AML 采纳)· 104 个宿主工具 · 128 个运行时设置项 · 双语文档(简体中文 / English)</sub>
31
+ <sub><b>v0.8.6</b> · 14 个执行引擎 · 6 种现场协议(5 内置 + 串口插件)+ MES REST 集成(镜像与直连双路径)· 数据分析台账(产线级权限隔离)· 工艺参数优化器(过程模型 → AML → OSQP 求解 → 治理下发)· **本体服务 + AI 先行模型闭环**(本体 · 孪生 · 求解器 · AML 采纳)· 104 个宿主工具 · 128 个运行时设置项 · 双语文档(简体中文 / English)</sub>
32
32
 
33
33
  <br />
34
34
 
@@ -408,7 +408,7 @@ aw update --check # 只报告,不安装
408
408
  npm install -g agentworkshop@latest # 手动等效
409
409
  ```
410
410
 
411
- 版本遵循 semver。每次 `aw start` 都会校验配置根,并把 `home` 之前的旧版 `data/` 布局迁移进来(以最新文件为准),因此数据可以跨版本存活。SQLite schema 迁移在服务端启动时执行。当前版本:**v0.8.4**——见[版本发布](https://github.com/kingdol666/AgentWorkShop/releases)。
411
+ 版本遵循 semver。每次 `aw start` 都会校验配置根,并把 `home` 之前的旧版 `data/` 布局迁移进来(以最新文件为准),因此数据可以跨版本存活。SQLite schema 迁移在服务端启动时执行。当前版本:**v0.8.6**——见[版本发布](https://github.com/kingdol666/AgentWorkShop/releases)。
412
412
 
413
413
  ### 第一次「Agent × 产线」会话(约 2 分钟)
414
414
 
@@ -580,6 +580,7 @@ curl http://localhost:3000/api/workshop/channels \
580
580
  - `admin` / `editor` 为运营角色,不受授权约束(全量全权)。
581
581
  - 普通用户**默认无权**——未授权前看不到任何产线数据。
582
582
  - 强制点在数据面:列表接口按授权过滤,写控/下发接口返回人类可读的 403,Agent↔节点绑定校验产线授权(数采需仅查看+,写控需可操控)。
583
+ - Agent 写授权双轨:`kind='dcw'` 节点绑定 = 点位写授权(trial/apply 的覆盖集须 ⊆ 绑定节点面,跟设备走、换配方不停摆);`kind='recipe'` 配方绑定 = 配方操作权(含版本写入/回退)。两种绑定取并集;节点绑定不授予配方版本权,直写工具仍恒拒,全部写入仍经四层限界/运行门/HITL/逐参数 ACK。
583
584
  - 插件经 `ctx.permissions`(`lineMode` / `visibleLineIds` / `listGrants` / `setGrants`)获得同一能力面,并有 `permissions:changed` 生命周期钩子;SDK REST 客户端提供 `client.permissions.overview()` / `client.permissions.set(...)`。
584
585
 
585
586
  ### 执行模式
@@ -635,6 +636,7 @@ SUBMITTED ─▶ ASSIGNED ─▶ WORKING ─▶ WAITING ─▶ COMPLETED
635
636
 
636
637
  | 套件 | 最新结果 | 覆盖 | 复现 |
637
638
  |---|---|---|---|
639
+ | `e2e-multiexpert-remediation-real.mjs` | **17 / 17**(2026-10-28,`.output` 生产构建 + 真实 `omp` + 本机 **Qwen3.5-9B**,**worker 身份**) | 建 AgentChannel(lead+worker) → worker 绑 DAQ/DCW → **运行时提示词注入**(执行模式卡 + 节点语义卡:量程/单步/手动确认) → 工具注入面按绑定差异化 → `daq_query` 真实取数 → `recipe_trial` 挂 HITL → 人工批准 → **ACK 设备证实** → 节点值变更/版本不变/账本新增/数采可查 | `node scripts/e2e-multiexpert-remediation-real.mjs`(需 LM Studio `127.0.0.1:1234`) |
638
640
  | `real-injection-closed-loop.mjs` | **双 goal 全部 COMPLETED / 0 失败**(2026-09-24,真实 PLC 模拟器 + 真实 `omp` 团队) | 从模拟器供给注塑产线(11 个数控 + 14 个数采节点)→ 真实 AgentTeam(lead/分析/优化) → 受治理写入且**间隔 65.8s ≥ 60s 策略** → 数采复测 → `qualityOk`、判定 `keep` | `AW_BASE=<base> SIM_BASE=http://127.0.0.1:4010 AW_TOKEN=<token> node scripts/real-injection-closed-loop.mjs` |
639
641
  | `_run-real-injection-fifo-goals.mjs` | exit 0(2026-09-24) | **FIFO 根队列多任务串行**:GOAL-2 仅在 GOAL-1 收口后派发;角色门控切换;两次受治理写入间隔 65.04s;两条记录均判定;账本 4 条锚 | `AW_BASE=<base> SIM_BASE=… AW_TOKEN=<token> node scripts/_run-real-injection-fifo-goals.mjs` |
640
642
  | `e2e-plc-plugin-closedloop.mjs` | 核心 Stage A–D 全绿(2026-09-24) | PLC 模拟器 Modbus 16040 真实供给 → 数采交叉核对(AW 采样 197 vs 模拟器寄存器 197.37)→ HITL 闭环写 3 区(寄存器 40021/40023/40025 = 210,真实写穿)→ `dcw_judge` keep;插件段 E–H 需外部诊断服务,按约定显式 SKIP | `AW_BASE=<base> KB_BASE=http://127.0.0.1:8771 AW_E2E_USERS_DB=<home>/data/users.sqlite node scripts/e2e-plc-plugin-closedloop.mjs` |
package/README.md CHANGED
@@ -28,7 +28,7 @@
28
28
 
29
29
  **[简体中文](./README-zh.md)** · **[Documentation](https://kingdol666.github.io/AgentWorkShop)** · **[Releases](https://github.com/kingdol666/AgentWorkShop/releases)** · **[Changelog](./changelog.md)** · **[Plugin API](./docs/plugins.md)** · **[SDK](./docs/sdk.md)**
30
30
 
31
- <sub><b>v0.8.5</b> · 14 engines · 6 field protocols (5 built-in + serial plugin) + MES REST integration (mirror & live) · data-analysis ledger with line-scoped permissions · process optimizer (process model → AML → OSQP solver → governed dispatch) · **ontology service + AI-first model loop** (ontology · twin · solver · AML adoption) · 104 host tools · 128 runtime settings · bilingual docs (简体中文 / English)</sub>
31
+ <sub><b>v0.8.6</b> · 14 engines · 6 field protocols (5 built-in + serial plugin) + MES REST integration (mirror & live) · data-analysis ledger with line-scoped permissions · process optimizer (process model → AML → OSQP solver → governed dispatch) · **ontology service + AI-first model loop** (ontology · twin · solver · AML adoption) · 104 host tools · 128 runtime settings · bilingual docs (简体中文 / English)</sub>
32
32
 
33
33
  <br />
34
34
 
@@ -399,7 +399,7 @@ aw update --check # only report; nothing is installed
399
399
  npm install -g agentworkshop@latest # manual equivalent
400
400
  ```
401
401
 
402
- Releases follow semver. `aw start` verifies the config root on every launch and migrates the legacy pre-`home` `data/` layout into it (newest file wins), so data survives upgrades. SQLite schema migrations run server-side at boot. Current version: **v0.8.4** — see [Releases](https://github.com/kingdol666/AgentWorkShop/releases).
402
+ Releases follow semver. `aw start` verifies the config root on every launch and migrates the legacy pre-`home` `data/` layout into it (newest file wins), so data survives upgrades. SQLite schema migrations run server-side at boot. Current version: **v0.8.6** — see [Releases](https://github.com/kingdol666/AgentWorkShop/releases).
403
403
 
404
404
  ### Your first agent × line session (~2 minutes)
405
405
 
@@ -574,6 +574,12 @@ in the built-in **Permissions** page (`/permissions`, admin-only in the sidebar)
574
574
  - Enforcement lives in the data plane: list endpoints filter by grant, write/dispatch
575
575
  endpoints return a human-readable 403, and Agent↔node bindings validate the line grant
576
576
  (DAQ needs read-only+, DCW needs operate).
577
+ - Agent write authorization is two-track: a `kind='dcw'` node binding is a point-level
578
+ write grant (trial/apply coverage must stay within the bound node face; it follows the
579
+ device and survives recipe switches), while a `kind='recipe'` binding is a recipe-level
580
+ operation right (including version writes/rollback). The two are unioned; node bindings
581
+ never grant recipe version rights, direct-write tools stay rejected, and every write
582
+ still passes the four-layer limits / run gate / HITL / per-parameter ACK.
577
583
  - Plugins get the same surface via `ctx.permissions` (`lineMode` / `visibleLineIds` /
578
584
  `listGrants` / `setGrants`) plus a `permissions:changed` lifecycle hook; the SDK REST
579
585
  client exposes `client.permissions.overview()` / `client.permissions.set(...)`.
@@ -640,6 +646,7 @@ in [`docs/audit/e2e-2026-09-24-all-features.md`](./docs/audit/e2e-2026-09-24-all
640
646
 
641
647
  | Suite | Latest result | What it covers | Reproduce |
642
648
  |---|---|---|---|
649
+ | `e2e-multiexpert-remediation-real.mjs` | **17 / 17** (2026-10-28, `.output` production build + real `omp` + local **Qwen3.5-9B**, **worker identity**) | create AgentChannel (lead + worker) → worker binds DAQ/DCW → **runtime prompt injection** (execution-mode card + node semantic cards: range / step cap / manual-approval) → tool surface differs by binding → `daq_query` on live samples → `recipe_trial` raises HITL → human approval → **ACK verified by device** → node value changed / version unchanged / ledger anchor appended / samples queryable | `node scripts/e2e-multiexpert-remediation-real.mjs` (needs LM Studio at `127.0.0.1:1234`) |
643
650
  | `real-injection-closed-loop.mjs` | **2 goals COMPLETED / 0 failed** (2026-09-24, real PLC simulator + real `omp` team) | injection line provisioned from the simulator (11 DCW + 14 DAQ nodes) → real AgentTeam lead/analyst/optimizer → governed writes with a **65.8 s gap ≥ 60 s policy** → DAQ re-measurement → `qualityOk`, verdict `keep` | `AW_BASE=<base> SIM_BASE=http://127.0.0.1:4010 AW_TOKEN=<token> node scripts/real-injection-closed-loop.mjs` |
644
651
  | `_run-real-injection-fifo-goals.mjs` | exit 0 (2026-09-24) | **FIFO root queue with multi-task serialization**: goal 2 dispatched only after goal 1 closed, role gate flip, two governed writes 65.04 s apart, two judged records, 4-anchor ledger | `AW_BASE=<base> SIM_BASE=… AW_TOKEN=<token> node scripts/_run-real-injection-fifo-goals.mjs` |
645
652
  | `e2e-plc-plugin-closedloop.mjs` | core stages A–D all green (2026-09-24) | PLC simulator supply over Modbus 16040 → DAQ cross-check (AW sample 197 vs simulator register 197.37) → HITL closed-loop write to 3 zones (registers 40021/40023/40025 = 210, verified write-through) → `dcw_judge` keep; plugin stages E–H need the external diagnosis service and are reported as SKIP | `AW_BASE=<base> KB_BASE=http://127.0.0.1:8771 AW_E2E_USERS_DB=<home>/data/users.sqlite node scripts/e2e-plc-plugin-closedloop.mjs` |
package/config.yml CHANGED
@@ -12,7 +12,7 @@
12
12
  app:
13
13
  name: AgentWorkShop
14
14
  title: AgentWorkShop
15
- version: 0.8.4
15
+ version: 0.8.6
16
16
  description: 基于 Nuxt 4 的配置驱动运行范式
17
17
 
18
18
  # 运行模式(dev/prod 实际由启动命令决定,此处仅作运行时展示)
@@ -12,10 +12,12 @@ services:
12
12
  daq-mosquitto:
13
13
  image: eclipse-mosquitto:2
14
14
  container_name: awshop-daq-mosquitto
15
- # no-auth 配置:内网/开发态;生产请挂载自定义 mosquitto.conf 启用鉴权/TLS
15
+ # no-auth 配置:内网/开发态;生产请挂载自定义 mosquitto.conf 启用鉴权/TLS。
16
+ # 2026-10-28(S13):默认只绑 127.0.0.1,避免同网段任意主机向队列注入样本;
17
+ # 跨机部署请显式改回 0.0.0.0 并同时启用 broker 账号/TLS。
16
18
  command: ["mosquitto", "-c", "/mosquitto-no-auth.conf"]
17
19
  ports:
18
- - "1883:1883" # 与 config.yml daq.mqtt.port 一致
20
+ - "127.0.0.1:1883:1883" # 与 config.yml daq.mqtt.port 一致
19
21
  restart: unless-stopped
20
22
 
21
23
  daq-timescale:
package/docs/cli.en.md CHANGED
@@ -62,7 +62,7 @@ pnpm tui # the terminal workbench
62
62
  ### 3. Quick use via npx (no global install)
63
63
 
64
64
  ```bash
65
- npx agentworkshop start # fetch and start (pin a version with: npx agentworkshop@0.8.4 start)
65
+ npx agentworkshop start # fetch and start (pin a version with: npx agentworkshop@0.8.6 start)
66
66
  npx agentworkshop doctor # subcommands work as usual
67
67
  npx -p agentworkshop aw doctor # use -p when you want the name aw
68
68
  ```
@@ -79,7 +79,7 @@ npx -p agentworkshop aw doctor # use -p when you want the name aw
79
79
  | Package manager | `pnpm@11.9.0` (`packageManager`, needed only for source development) |
80
80
  | Module format | ESM (`type: module`) |
81
81
  | License | `Apache-2.0` |
82
- | Current version | `0.8.4` (`package.json`) |
82
+ | Current version | `0.8.6` (`package.json`) |
83
83
 
84
84
  ## 2. First start (the Claude Code experience)
85
85
 
package/docs/cli.md CHANGED
@@ -60,7 +60,7 @@ pnpm tui # 终端工作台
60
60
  ### 3. npx 快速使用(免全局安装)
61
61
 
62
62
  ```bash
63
- npx agentworkshop start # 拉取并启动(可锁定版本: npx agentworkshop@0.8.4 start)
63
+ npx agentworkshop start # 拉取并启动(可锁定版本: npx agentworkshop@0.8.6 start)
64
64
  npx agentworkshop doctor # 子命令照常可用
65
65
  npx -p agentworkshop aw doctor # 需要 aw 这个名字时用 -p 指定包
66
66
  ```
@@ -76,7 +76,7 @@ npx -p agentworkshop aw doctor # 需要 aw 这个名字时用 -p 指定包
76
76
  | 包管理器 | `pnpm@11.9.0`(`packageManager`,仅源码开发需要) |
77
77
  | 模块形态 | ESM(`type: module`) |
78
78
  | 许可证 | `Apache-2.0` |
79
- | 当前版本 | `0.8.4`(`package.json`) |
79
+ | 当前版本 | `0.8.6`(`package.json`) |
80
80
 
81
81
  ## 二、首次启动(Claude Code 式)
82
82
 
@@ -9,7 +9,7 @@
9
9
  >
10
10
  > Applies to: plugin system v2 has been available since **v0.7.29** (frontend component
11
11
  > injection / plugin settings / plugin i18n / runtime services surface); this document
12
- > describes **v0.8.4**. `ctx.sdkVersion` is currently `0.3.0`.
12
+ > describes **v0.8.6**. `ctx.sdkVersion` is currently `0.3.0`.
13
13
 
14
14
  ## 1. Folder layout & quick start
15
15
 
package/docs/plugins.md CHANGED
@@ -6,7 +6,7 @@
6
6
  > 本文是唯一权威参考;`docs/site/plugins/` 的分页文档与本文同源。
7
7
  >
8
8
  > 适用版本:插件系统 v2 自 **v0.7.29** 起可用(前端组件注入 / 插件设置 / 插件 i18n /
9
- > 运行时服务面);本文档对应当前版本 **v0.8.4**。`ctx.sdkVersion` 当前为 `0.3.0`。
9
+ > 运行时服务面);本文档对应当前版本 **v0.8.6**。`ctx.sdkVersion` 当前为 `0.3.0`。
10
10
 
11
11
  ## 一、目录结构与快速开始
12
12
 
package/docs/sdk.en.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  **SDK version constants**: server-side `SDK_VERSION = '0.3.0'`, browser-side `CLIENT_SDK_VERSION = '0.3.0'`.
9
9
  These two constants are the **interface version of the SDK itself** and evolve **independently**
10
- from the npm package version (the `version` field in `package.json`, currently 0.8.4) —
10
+ from the npm package version (the `version` field in `package.json`, currently 0.8.6) —
11
11
  them being out of sync is expected. Never use `SDK_VERSION` to infer the package version, or the reverse.
12
12
  **Module format**: ESM only (only `import` / `export`; there is no CJS entry).
13
13
  **Types**: `sdk/index.d.mts` and `sdk/client.d.mts` ship with the package, so TypeScript projects
package/docs/sdk.md CHANGED
@@ -5,7 +5,7 @@
5
5
  > 零第三方运行时依赖,Node ≥ 23.4 与现代浏览器双端可用。
6
6
 
7
7
  **SDK 版本常量**:服务端 `SDK_VERSION = '0.3.0'`,浏览器端 `CLIENT_SDK_VERSION = '0.3.0'`。
8
- 这两个常量是 **SDK 自身接口的版本号**,与 npm 包版本(`package.json` 的 `version`,当前 0.8.4)
8
+ 这两个常量是 **SDK 自身接口的版本号**,与 npm 包版本(`package.json` 的 `version`,当前 0.8.6)
9
9
  **各自独立演进** —— 常数不同步是预期行为,不要拿 `SDK_VERSION` 去推断包版本,反之亦然。
10
10
  **模块形态**:ESM only(只有 `import` / `export`,没有 CJS 入口)。
11
11
  **类型**:`sdk/index.d.mts`、`sdk/client.d.mts` 随包发布,TS 项目零配置获得提示(覆盖范围见 §7)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentworkshop",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "type": "module",
5
5
  "description": "AgentWorkShop 软件开发系统 - 基于 Nuxt 4 的配置驱动运行范式",
6
6
  "license": "Apache-2.0",
@@ -0,0 +1,219 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * MQTT 全链真实 E2E(2026-10-28;真实 broker 127.0.0.1:1883):
4
+ * 场景:独立平台实例 + 模拟网关(node 客户端,复用仓库 mqtt 依赖)
5
+ * - 网关每 2s 向 mqtte2e/<TAG>/temp 发布 {"data":{"temperature":X,"humidity":Y}}(温度缓升,湿度乱摆——验证 jsonPath 单字段提取)
6
+ * - 网关订阅 mqtte2e/<TAG>/setpoint(控制主题),收到设定值后向 mqtte2e/<TAG>/state 回显 {"data":{"setpoint":X}}(模拟设备回显,供写后回读升级 verified)
7
+ * 断言:
8
+ * T1 DAQ:平台订阅 temp 主题,jsonPath=data.temperature 提取入库;daq_query 点数随发布增长,数值=温度序列(非湿度)
9
+ * T2 DCW:recipe_trial(手动 HITL 批准)下发 238 → 网关控制主题收到 {"setpoint":238}(jsonKey 封装)→ 回显 → 写后回读升级 readback-verified(设备证实✓)
10
+ * T3 稳定性:持续 90s 泡水,daq 点数单调增长、节点保持在线、journal 锚点齐全
11
+ * 运行:node scripts/_audit/_live-mqtt-e2e-20261028.mjs
12
+ */
13
+ import { spawn } from 'node:child_process'
14
+ import net from 'node:net'
15
+ import { mkdirSync, openSync, rmSync, writeFileSync } from 'node:fs'
16
+ import { tmpdir } from 'node:os'
17
+ import { dirname, join, resolve } from 'node:path'
18
+ import { fileURLToPath } from 'node:url'
19
+
20
+ const REPO = resolve(dirname(fileURLToPath(import.meta.url)), '..', '..')
21
+ const EVID = join(REPO, 'docs', 'audit', 'evidence', '2026-10-28-mqtt-live')
22
+ mkdirSync(EVID, { recursive: true })
23
+ const ROOT = join(tmpdir(), 'aw-mqtt-e2e')
24
+ rmSync(join(ROOT, 'home'), { recursive: true, force: true })
25
+ mkdirSync(join(ROOT, 'home'), { recursive: true })
26
+ const TAG = `mq${Date.now().toString(36).slice(-4)}`
27
+ const T_TEMP = `mqtte2e/${TAG}/temp`
28
+ const T_SET = `mqtte2e/${TAG}/setpoint`
29
+ const T_STATE = `mqtte2e/${TAG}/state`
30
+ const BASE = 'http://127.0.0.1:3986'
31
+ const log = (s) => { console.log(`[${new Date().toISOString().slice(11, 19)}] ${s}`) }
32
+ const sleep = ms => new Promise(r => setTimeout(r, ms))
33
+
34
+ // ── 前置:broker 探活 ──
35
+ const brokerUp = await new Promise((res) => {
36
+ const s = net.connect(1883, '127.0.0.1')
37
+ s.setTimeout(2000)
38
+ s.on('connect', () => { s.end(); res(true) })
39
+ s.on('error', () => res(false))
40
+ s.on('timeout', () => { s.destroy(); res(false) })
41
+ })
42
+ if (!brokerUp) {
43
+ console.log('✖ 127.0.0.1:1883 无 MQTT broker —— 先启动 broker(mosquitto -v -p 1883)')
44
+ process.exit(1)
45
+ }
46
+ log('broker 127.0.0.1:1883 在线')
47
+
48
+ // ── 模拟网关:发布温度 JSON + 订阅控制主题回显状态 ──
49
+ const mqtt = (await import('mqtt')).default
50
+ const receivedWrites = []
51
+ let tempVal = 22.5
52
+ const gateway = mqtt.connect('mqtt://127.0.0.1:1883', { connectTimeout: 4000 })
53
+ await new Promise((res, rej) => { gateway.once('connect', res); gateway.once('error', rej) })
54
+ gateway.subscribe(T_SET, { qos: 1 })
55
+ gateway.on('message', (topic, payload) => {
56
+ if (topic !== T_SET) return
57
+ try {
58
+ const msg = JSON.parse(payload.toString())
59
+ receivedWrites.push({ at: Date.now(), raw: payload.toString(), setpoint: msg.setpoint })
60
+ gateway.publish(T_STATE, JSON.stringify({ data: { setpoint: msg.setpoint } }), { qos: 1 })
61
+ log(`网关收到控制令牌:${payload.toString()} → 回显状态主题`)
62
+ }
63
+ catch { /* 非 JSON */ }
64
+ })
65
+ // 温度缓升(22.5 起 +0.3/次),湿度独立乱摆——两者可区分
66
+ const pubTimer = setInterval(() => {
67
+ tempVal = Math.round((tempVal + 0.3) * 100) / 100
68
+ const hum = Math.round(40 + Math.random() * 20)
69
+ gateway.publish(T_TEMP, JSON.stringify({ data: { temperature: tempVal, humidity: hum } }), { qos: 1 })
70
+ }, 2000)
71
+ log(`模拟网关上线:每 2s → ${T_TEMP} = {"data":{"temperature":…,"humidity":…}};订阅 ${T_SET}`)
72
+
73
+ // ── 平台实例 ──
74
+ process.env.NO_PROXY = '127.0.0.1,localhost'
75
+ const logFd = openSync(join(ROOT, 'dev.log'), 'a')
76
+ // build 产物跑(无 nitro 文件监听):并行会话写盘不再触发 HMR 重载风暴(验收 skill 标准跑法)
77
+ const child = spawn(process.execPath, [join(REPO, '.output', 'server', 'index.mjs')], {
78
+ cwd: REPO,
79
+ env: { ...process.env, AW_MODE: 'home', AW_HOME: join(ROOT, 'home'), PORT: '3986', AW_RATE_LIMIT_OFF: '1', NUXT_SESSION_PASSWORD: 'MqttE2e#2026-session-key-0321', NO_PROXY: '127.0.0.1,localhost' },
80
+ stdio: ['ignore', logFd, logFd],
81
+ windowsHide: true,
82
+ })
83
+ let healthy = false
84
+ for (let i = 0; i < 90; i++) {
85
+ await sleep(2000)
86
+ try {
87
+ const h = await fetch(`${BASE}/api/health`, { signal: AbortSignal.timeout(3000) }).then(r => r.json()).catch(() => null)
88
+ if (h?.data?.status === 'ok' && h?.data?.workshop === 'ready') { healthy = true; break }
89
+ }
90
+ catch { /* 未就绪 */ }
91
+ }
92
+ log(`平台实例:${healthy ? '就绪' : '未就绪'}`)
93
+ if (!healthy) process.exit(1)
94
+
95
+ const reg = await fetch(`${BASE}/api/users/register`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ name: `mq-admin-${TAG}`, email: `mq-${TAG}@awshop.local`, password: 'MqE2e#2026' }) }).then(r => r.json())
96
+ const H = () => reg.data.token
97
+ const api = async (method, path, body, timeoutMs = 120_000) => {
98
+ // 兼容旧调用形参:第 4 参可能传的是 token(H())——非数字视为缺省超时
99
+ const timeout = typeof timeoutMs === 'number' ? timeoutMs : 120_000
100
+ const res = await fetch(BASE + path, { method, headers: { 'content-type': 'application/json', 'authorization': `Bearer ${H()}` }, body: body === undefined ? undefined : JSON.stringify(body), signal: AbortSignal.timeout(timeout) })
101
+ let json = null
102
+ try { json = await res.json() } catch { /* 非 JSON */ }
103
+ return { status: res.status, ...json }
104
+ }
105
+ const invText = r => String(r?.data?.result?.text ?? r?.data?.text ?? '')
106
+ const invErr = r => Boolean(r?.data?.result?.isError ?? r?.data?.isError)
107
+ let lead = ''
108
+ const invoke = (tool, args) => api('POST', '/api/workshop/agent-tools/invoke', { agentId: lead, tool, args }, H())
109
+ const results = []
110
+ const ok = (id, name, cond, detail = '') => {
111
+ results.push({ id, pass: Boolean(cond) })
112
+ console.log(`${cond ? '✔' : '✖'} [${id}] ${name}${cond ? '' : ` — ${String(detail).slice(0, 260)}`}`)
113
+ }
114
+
115
+ try {
116
+ // ── 场景供给 ──
117
+ const line = (await api('POST', '/api/workshop/dcw/lines', { name: `MQTT实测线-${TAG}` }, H())).data?.line?.id
118
+ const spNode = (await api('POST', '/api/workshop/dcw', {
119
+ templateRef: 'dcw-temp-sp', name: `MQTT设定-${TAG}`, driver: 'mqtt', lineId: line,
120
+ min: 160, max: 300, stepLimit: 20,
121
+ driverConfig: { host: '127.0.0.1', port: 1883, topic: T_SET, jsonKey: 'setpoint', qos: 1, readTopic: T_STATE, readJsonPath: 'data.setpoint' },
122
+ }, H())).data?.node?.id
123
+ const pvNode = (await api('POST', '/api/workshop/daq', {
124
+ templateRef: 'daq-temp-tc', name: `MQTT温度-${TAG}`, driver: 'mqtt', lineId: line, intervalMs: 2000, publishIntervalMs: 0,
125
+ min: 10, max: 60,
126
+ driverConfig: { host: '127.0.0.1', port: 1883, topic: T_TEMP, jsonPath: 'data.temperature', qos: 1 },
127
+ }, H())).data?.node?.id
128
+ const product = (await api('POST', '/api/workshop/dcw/products', { lineId: line, name: `MQTT产品-${TAG}` }, H())).data?.product?.id
129
+ const recipe = (await api('POST', '/api/workshop/dcw/recipes', { productId: product, name: `MQTT配方-${TAG}`, params: [{ nodeId: spNode, value: 240, min: 160, max: 300 }] }, H())).data?.recipe?.id
130
+ await api('POST', '/api/workshop/dcw/controller', { action: 'start' }, H())
131
+ await api('POST', '/api/workshop/daq/controller', { action: 'start' }, H())
132
+ const ch = (await api('POST', '/api/workshop/channels', { name: `MQTT频道-${TAG}`, leadAgent: { name: `mq-lead-${TAG}`, harness: 'omp' } }, H())).data
133
+ lead = ch.leadAgentId
134
+ await api('PUT', `/api/workshop/channels/${ch.channelId}/line`, { lineId: line }, H())
135
+ await api('POST', `/api/workshop/channels/${ch.channelId}/activate`, {}, H())
136
+ await api('POST', '/api/workshop/agent-tools/bindings', { agentId: ch.leadAgentId, nodeId: pvNode, kind: 'daq' }, H())
137
+ const rb = await api('POST', '/api/workshop/agent-tools/bindings', { agentId: ch.leadAgentId, nodeId: recipe, kind: 'recipe' }, H())
138
+ const bindingId = rb?.data?.binding?.id
139
+ ok('S1', '场景供给(线/MQTT 数采节点/MQTT 设定节点/配方/频道/绑定)', Boolean(line && spNode && pvNode && recipe && ch?.channelId && bindingId),
140
+ JSON.stringify({ line, spNode, pvNode, recipe }).slice(0, 200))
141
+
142
+ // ── T0 开线(HITL):配方参数 240 会经 MQTT 驱动发布到控制主题 ──
143
+ const known0 = new Set((await api('GET', '/api/workshop/hitl/pending', undefined, H())).data?.items?.map(x => x.id) ?? [])
144
+ const p0 = invoke('line_start', { recipe_id: recipe, reason: `MQTT E2E 开线(${TAG})` })
145
+ let card0 = null
146
+ for (let i = 0; i < 40 && !card0; i++) {
147
+ await sleep(1000)
148
+ card0 = ((await api('GET', '/api/workshop/hitl/pending', undefined, H())).data?.items ?? []).find(x => !known0.has(x.id))
149
+ }
150
+ if (card0) await api('POST', '/api/workshop/hitl/respond', { kind: 'dcw-approval', id: card0.id, confirmed: true, choice: 0, comment: 'MQTT E2E 批准开线' }, H())
151
+ const r0 = await p0
152
+ ok('T0', '开线成功且参数设备证实(readback-verified:网关回显经 readTopic)', !invErr(r0) && /readback|设备证实|verified/.test(invText(r0)), invText(r0).slice(0, 200))
153
+ const sawLineStartWrite = receivedWrites.find(w => w.setpoint === 240)
154
+ ok('T0b', '开线下发经 jsonKey 封装为 JSON 到控制主题({"setpoint":240})', Boolean(sawLineStartWrite), JSON.stringify(receivedWrites.slice(0, 3)))
155
+
156
+ // ── T1 DAQ:jsonPath 单字段提取实时入库 ──
157
+ await sleep(16_000)
158
+ const q1 = await api('GET', `/api/workshop/daq/query?node_ids=${pvNode}&last_minutes=1`, undefined, H())
159
+ const pts1 = (q1.data?.series ?? []).reduce((n, s) => n + (s.points?.length ?? 0), 0)
160
+ const pointOf = p => Number(p?.v ?? p?.avg ?? p?.value ?? Number.NaN)
161
+ if (pts1 > 0) writeFileSync(join(EVID, `daq-point-shape-${TAG}.json`), JSON.stringify((q1.data?.series ?? [])[0]?.points?.slice(0, 2) ?? []))
162
+ const vals1 = (q1.data?.series ?? []).flatMap(s => (s.points ?? []).map(pointOf)).filter(Number.isFinite)
163
+ // 数值应落在温度序列区间(22.5 起缓升),而非湿度区间(40-60)
164
+ const inTempRange = vals1.filter(v => v >= 22 && v <= 40).length
165
+ ok('T1a', `DAQ jsonPath 提取:单条 JSON 报文取 data.temperature 入库(${pts1} 点)`, pts1 > 0, `points=${pts1}`)
166
+ ok('T1b', '取的是温度字段而非同报文湿度字段(22~40 区间)', pts1 > 0 && inTempRange === pts1, `vals=${vals1.slice(0, 6)} humidity-range hits=${pts1 - inTempRange}`)
167
+
168
+ // ── T2 DCW:recipe_trial 手动批准 → JSON 下发 + 回读升级 verified ──
169
+ const writesBefore = receivedWrites.length
170
+ const known = new Set((await api('GET', '/api/workshop/hitl/pending', undefined, H())).data?.items?.map(x => x.id) ?? [])
171
+ const p = invoke('recipe_trial', { recipe_id: recipe, params: [{ node_id: spNode, value: 238 }], hypothesis: `MQTT E2E:试 238℃(${TAG})` })
172
+ let card = null
173
+ for (let i = 0; i < 40 && !card; i++) {
174
+ await sleep(1000)
175
+ card = ((await api('GET', '/api/workshop/hitl/pending', undefined, H())).data?.items ?? []).find(x => !known.has(x.id))
176
+ }
177
+ ok('T2a', 'recipe_trial 生成 HITL 审批卡(recipe 只管参数值,封装交给节点配置)', Boolean(card), card?.id ?? '未出现')
178
+ if (card) await api('POST', '/api/workshop/hitl/respond', { kind: 'dcw-approval', id: card.id, confirmed: true, choice: 0, comment: 'MQTT E2E 批准 238' }, H())
179
+ const r = await p
180
+ const txt = invText(r)
181
+ ok('T2b', '批准后执行:写后回读经状态主题升级 readback-verified(设备证实✓)', !invErr(r) && /设备证实|readback/.test(txt), txt.slice(0, 220))
182
+ await sleep(1500)
183
+ const w238 = receivedWrites.filter(w => w.setpoint === 238)
184
+ ok('T2c', '我方订阅端收到 JSON 写报文 {"setpoint":238}', w238.length > 0 && w238[0].raw === '{"setpoint":238}', JSON.stringify(receivedWrites.slice(writesBefore).map(w => w.raw)))
185
+ writeFileSync(join(EVID, `received-writes-${TAG}.json`), JSON.stringify(receivedWrites, null, 2))
186
+
187
+ // ── T3 稳定性泡水 90s:点数持续增长、节点在线 ──
188
+ const qA = await api('GET', `/api/workshop/daq/query?node_ids=${pvNode}&last_minutes=10`, undefined, H())
189
+ const nA = (qA.data?.series ?? []).reduce((n, s) => n + (s.points?.length ?? 0), 0)
190
+ let staleErr = 0
191
+ for (let i = 0; i < 9; i++) {
192
+ await sleep(10_000)
193
+ const d = await api('GET', '/api/workshop/daq', undefined, H())
194
+ const node = (d.data?.nodes ?? []).find(x => x.id === pvNode)
195
+ if (node && (node.state === 'offline' || node.lastError)) staleErr++
196
+ log(`泡水 ${((i + 1) * 10)}s:已入库点数 ${((await api('GET', `/api/workshop/daq/query?node_ids=${pvNode}&last_minutes=10`, undefined, H())).data?.series ?? []).reduce((n, s) => n + (s.points?.length ?? 0), 0)}`)
197
+ }
198
+ const qB = await api('GET', `/api/workshop/daq/query?node_ids=${pvNode}&last_minutes=10`, undefined, H())
199
+ const nB = (qB.data?.series ?? []).reduce((n, s) => n + (s.points?.length ?? 0), 0)
200
+ const valsB = (qB.data?.series ?? []).flatMap(s => (s.points ?? []).map(pointOf)).filter(Number.isFinite)
201
+ ok('T3a', `90s 泡水:点数持续增长(${nA} → ${nB})`, nB > nA + 20, `delta=${nB - nA}`)
202
+ ok('T3b', '泡水期间节点无 offline/无 lastError(陈值看门狗未误报)', staleErr === 0, `offline polling hits=${staleErr}`)
203
+ ok('T3c', '长程数值仍为温度序列且严格递增(缓升序列无乱序/无冻值)', valsB.length > 10 && valsB.every((v, i) => i === 0 || v >= valsB[i - 1]), `head=${valsB.slice(0, 5)} tail=${valsB.slice(-5)}`)
204
+
205
+ // 归档
206
+ writeFileSync(join(EVID, `summary-${TAG}.json`), JSON.stringify({ tag: TAG, topics: { temp: T_TEMP, setpoint: T_SET, state: T_STATE }, line, spNode, pvNode, recipe, receivedWrites, daqPoints: { atT1: pts1, atT3: nB }, results }, null, 2))
207
+ const pass = results.every(r => r.pass)
208
+ console.log(`\n===== MQTT 全链实测:${results.filter(r => r.pass).length}/${results.length} PASS =====`)
209
+ process.exitCode = pass ? 0 : 1
210
+ }
211
+ catch (err) {
212
+ log(`FATAL ${err instanceof Error ? err.message : String(err)}`)
213
+ process.exitCode = 1
214
+ }
215
+ finally {
216
+ clearInterval(pubTimer)
217
+ try { gateway.end(true) } catch { /* ignore */ }
218
+ try { child.kill() } catch { /* ignore */ }
219
+ }
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * 提示词注入取证探针(2026-10-28 多专家整改验收用)。
4
+ *
5
+ * 以同一 AW_HOME 只读方式装配"运行时提示词"里的工业上下文段(工业语义卡 × 执行模式 ×
6
+ * 绑定节点),用于证明 worker 绑定节点后**运行时真的把节点卡注入提示词** —— 该函数
7
+ * (buildIndustrialContext / nodeSemanticCards)就是 prompt-builder 在每回合拼 system
8
+ * prompt 时调用的同一个。
9
+ *
10
+ * 频道执行模式在运行期由 manager 提供(channelIdOfAgent);探针以 channel_agents 表
11
+ * 复刻同一查表(不伪造任何业务状态)。
12
+ *
13
+ * 用法:node --import tsx scripts/_audit/prompt-injection-probe.mts <agentId>
14
+ */
15
+ import { join } from 'node:path'
16
+ import { DatabaseSync } from 'node:sqlite'
17
+
18
+ process.env.AW_MODE = process.env.AW_MODE ?? 'home'
19
+ process.env.AW_SKIP_DATA_LOCK = '1'
20
+
21
+ const agentId = String(process.argv[2] ?? '').trim()
22
+ if (!agentId) {
23
+ console.error('usage: prompt-injection-probe.mts <agentId>')
24
+ process.exit(2)
25
+ }
26
+
27
+ const home = String(process.env.AW_HOME ?? '')
28
+ let channelId: string | null = null
29
+ let profileMode = ''
30
+ try {
31
+ // 只读连接(不跑迁移、不抢写锁):频道执行模式来自 aml_channel_profiles,
32
+ // 与运行时 executionModeOfChannel 同一张表/同一归一语义
33
+ const db = new DatabaseSync(join(home, 'data', 'workshop.sqlite'), { readOnly: true })
34
+ try {
35
+ const row = db.prepare('SELECT channel_id FROM channel_agents WHERE id = ?').get(agentId) as { channel_id?: string } | undefined
36
+ channelId = row?.channel_id ?? null
37
+ const p = channelId
38
+ ? db.prepare('SELECT execution_mode FROM aml_channel_profiles WHERE channel_id = ?').get(channelId) as { execution_mode?: string } | undefined
39
+ : undefined
40
+ profileMode = String(p?.execution_mode ?? '')
41
+ const { configureAmlRuntime } = await import('../../server/services/workshop/aml/runtime')
42
+ configureAmlRuntime(db as never)
43
+ }
44
+ catch { /* 读失败 → 模式卡退化为 auto(与运行时异常同语义) */ }
45
+ }
46
+ catch { /* DB 不可读 → 模式卡退化为 auto(与运行时缺 manager 时同语义) */ }
47
+
48
+ // 运行期由 manager 提供同一查表(探针内等价桩)
49
+ ;(globalThis as Record<string, unknown>).__workshopManager = {
50
+ channelIdOfAgent: (id: string) => (id === agentId ? channelId : null),
51
+ }
52
+
53
+ const { buildIndustrialContext, nodeSemanticCards } = await import('../../server/services/workshop/agents/industrial-context')
54
+ const { getAgentNodeBindingRepo } = await import('../../server/services/workshop/agents/node-bindings.repo')
55
+
56
+ const bindings = getAgentNodeBindingRepo().byAgent(agentId).map(b => ({ nodeId: b.nodeId, kind: b.kind, mode: b.mode }))
57
+ let text = ''
58
+ let cards = ''
59
+ let stale = -1
60
+ let error = ''
61
+ try {
62
+ text = buildIndustrialContext(agentId)
63
+ }
64
+ catch (err) {
65
+ error += `buildIndustrialContext: ${err instanceof Error ? err.message : String(err)}; `
66
+ }
67
+ try {
68
+ const c = nodeSemanticCards(agentId)
69
+ cards = c.text
70
+ stale = c.stale
71
+ }
72
+ catch (err) {
73
+ error += `nodeSemanticCards: ${err instanceof Error ? err.message : String(err)}`
74
+ }
75
+
76
+ process.stdout.write(JSON.stringify({ agentId, channelId, profileMode, bindings, text, cards, stale, error }))
@@ -202,11 +202,17 @@ async function main() {
202
202
 
203
203
  const members = await api('GET', `/api/workshop/channels/${ids.channel}/agents`)
204
204
  check('GET /channels/:id/agents 成员列表', members.code === 0 && members.data.length === 3, `members=${members.data?.length}`)
205
+ // 2026-10-28 安全修复:列表不再回显 agent token(防 worker 冒充 lead);
206
+ // 套件改经"轮换端点一次性取全量 token"(owner/admin 可调,响应只此一次)
205
207
  const leadInfo = members.data.find(a => a.id === ids.lead)
206
208
  const workerInfo = members.data.find(a => a.id === ids.worker)
207
- ids.leadToken = leadInfo?.token
208
- ids.workerToken = workerInfo?.token
209
- check('成员带实例 token(auth 基础)', Boolean(ids.leadToken && ids.workerToken))
209
+ check('成员列表不回显 token(防冒充)', Boolean(leadInfo) && !('token' in leadInfo) && !('token' in workerInfo))
210
+ const rotLead = await api('POST', `/api/workshop/channels/${ids.channel}/agents/${ids.lead}/rotate-token`)
211
+ const rotWorker = await api('POST', `/api/workshop/channels/${ids.channel}/agents/${ids.worker}/rotate-token`)
212
+ ids.leadToken = rotLead?.data?.token
213
+ ids.workerToken = rotWorker?.data?.token
214
+ check('成员实例 token 经轮换端点一次性获取(auth 基础)', Boolean(ids.leadToken && ids.workerToken),
215
+ `leadRot=${rotLead.status} workerRot=${rotWorker.status}`)
210
216
 
211
217
  const dupLead = await api('POST', `/api/workshop/channels/${ids.channel}/agents`, { body: { agentId: tpl2.data.id, role: 'lead' } })
212
218
  check('第二个 lead → 409 LEAD_EXISTS', dupLead.status === 409 || dupLead.code === 'LEAD_EXISTS', `code=${dupLead.code}`)