agentworkshop 0.10.0 → 0.11.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 (531) hide show
  1. package/.AgentWorkShop/prompts/host-tools.json +47 -6
  2. package/.output/.AgentWorkShop/prompts/host-tools.json +47 -6
  3. package/.output/nitro.json +1 -1
  4. package/.output/public/_nuxt/2v5GdspM2.js +1 -0
  5. package/.output/public/_nuxt/79qPRzcC2.js +3 -0
  6. package/.output/public/_nuxt/{DXcrmAEB.js → B1h4ZjKu.js} +6 -6
  7. package/.output/public/_nuxt/{CtHO6S5H2.js → CMDDJOia2.js} +1 -1
  8. package/.output/public/_nuxt/{BntjKfNX2.js → CUdJHUOd2.js} +1 -1
  9. package/.output/public/_nuxt/CjCc77Ql.js +1 -0
  10. package/.output/public/_nuxt/D2EC-BTb2.js +1 -0
  11. package/.output/public/_nuxt/D4ZePemJ.js +1 -0
  12. package/.output/public/_nuxt/{Bn4GxfTn.js → DDVBwkyn.js} +1 -1
  13. package/.output/public/_nuxt/DkfR8ywD.js +1 -0
  14. package/.output/public/_nuxt/Dv_vyxzC.js +1 -0
  15. package/.output/public/_nuxt/LiHaSoeY.js +2 -0
  16. package/.output/public/_nuxt/PWLUz4KM2.js +1 -0
  17. package/.output/public/_nuxt/ZMaEnWy-.js +1 -0
  18. package/.output/public/_nuxt/_id_.CHcnHuNN.css +1 -0
  19. package/.output/public/_nuxt/{_wsId_.DDEHesFu.css → _wsId_.2GiFh9as.css} +1 -1
  20. package/.output/public/_nuxt/builds/latest.json +1 -1
  21. package/.output/public/_nuxt/builds/meta/cf638aaa-655e-454c-9786-ffa73903190a.json +1 -0
  22. package/.output/public/_nuxt/{default.DfmSp-wb.css → default.CwrtJt16.css} +1 -1
  23. package/.output/public/_nuxt/{entry.cd1EADeI.css → entry.DttkgxyK.css} +1 -1
  24. package/.output/public/_nuxt/kHiXWyIi.js +1 -0
  25. package/.output/public/_nuxt/projects.B0DecJy4.css +1 -0
  26. package/.output/public/_nuxt/workshop.Csi6_Wwg.css +1 -0
  27. package/.output/server/chunks/_/{TownView-uicih2T8.mjs → TownView-Cpb_4CFs.mjs} +4 -4
  28. package/.output/server/chunks/_/TownView-Cpb_4CFs.mjs.map +1 -0
  29. package/.output/server/chunks/_/{_id_-DMxiYYGr.mjs → _id_-7j1H6aZV.mjs} +8 -8
  30. package/.output/server/chunks/_/_id_-7j1H6aZV.mjs.map +1 -0
  31. package/.output/server/chunks/_/{_id_-BX8hihhe.mjs → _id_-Ca3d9Npk.mjs} +13 -13
  32. package/.output/server/chunks/_/_id_-Ca3d9Npk.mjs.map +1 -0
  33. package/.output/server/chunks/_/_id_-Dl378h-P.mjs +995 -0
  34. package/.output/server/chunks/_/_id_-Dl378h-P.mjs.map +1 -0
  35. package/.output/server/chunks/_/{_wsId_-DzfJ2fFZ.mjs → _wsId_-e7Fm33hR.mjs} +16 -10
  36. package/.output/server/chunks/_/{_wsId_-DzfJ2fFZ.mjs.map → _wsId_-e7Fm33hR.mjs.map} +1 -1
  37. package/.output/server/chunks/_/access.mjs +1 -1
  38. package/.output/server/chunks/_/{analysis-DVLO0bCy.mjs → analysis-DvtU3Ots.mjs} +3 -3
  39. package/.output/server/chunks/_/analysis-DvtU3Ots.mjs.map +1 -0
  40. package/.output/server/chunks/_/catalog-view.mjs +1 -1
  41. package/.output/server/chunks/_/{daq-CWiRcs2W.mjs → daq-WT075QK5.mjs} +8 -8
  42. package/.output/server/chunks/_/daq-WT075QK5.mjs.map +1 -0
  43. package/.output/server/chunks/_/data-export.mjs +6 -6
  44. package/.output/server/chunks/_/data-query.mjs +3 -3
  45. package/.output/server/chunks/_/{dcw-BrEWEFnj.mjs → dcw-BhY0QjNL.mjs} +8 -8
  46. package/.output/server/chunks/_/dcw-BhY0QjNL.mjs.map +1 -0
  47. package/.output/server/chunks/_/{default-CAvZHtuk.mjs → default-C3L2_Bnq.mjs} +18 -8
  48. package/.output/server/chunks/_/{default-CAvZHtuk.mjs.map → default-C3L2_Bnq.mjs.map} +1 -1
  49. package/.output/server/chunks/_/eda-run.repo.mjs +2 -2
  50. package/.output/server/chunks/_/features.mjs +4 -4
  51. package/.output/server/chunks/_/golden.mjs +2 -2
  52. package/.output/server/chunks/_/host-bindings.mjs +1 -1
  53. package/.output/server/chunks/_/index.mjs +1 -1
  54. package/.output/server/chunks/_/{logs-Lx7w3LYH.mjs → logs-ClfR5sWn.mjs} +3 -3
  55. package/.output/server/chunks/_/logs-ClfR5sWn.mjs.map +1 -0
  56. package/.output/server/chunks/_/mes-console.mjs +1 -1
  57. package/.output/server/chunks/_/mes-templates.mjs +1 -1
  58. package/.output/server/chunks/_/nitro.mjs +4434 -2470
  59. package/.output/server/chunks/_/nitro.mjs.map +1 -1
  60. package/.output/server/chunks/_/{operations--xLPUg-f.mjs → operations-4t5GxQcD.mjs} +3 -3
  61. package/.output/server/chunks/_/operations-4t5GxQcD.mjs.map +1 -0
  62. package/.output/server/chunks/_/{pages-CzF3fZqL.mjs → pages-BwA6EqWo.mjs} +4 -4
  63. package/.output/server/chunks/_/pages-BwA6EqWo.mjs.map +1 -0
  64. package/.output/server/chunks/_/projects-k6arYbBh.mjs +345 -0
  65. package/.output/server/chunks/_/projects-k6arYbBh.mjs.map +1 -0
  66. package/.output/server/chunks/_/promote.mjs +186 -0
  67. package/.output/server/chunks/_/promote.mjs.map +1 -0
  68. package/.output/server/chunks/_/rest-auth.mjs +1 -1
  69. package/.output/server/chunks/_/spc.mjs +1 -1
  70. package/.output/server/chunks/_/{town-HjaOuPYS.mjs → town-CCkZYizH.mjs} +4 -4
  71. package/.output/server/chunks/_/town-CCkZYizH.mjs.map +1 -0
  72. package/.output/server/chunks/_/types-D6J7slEa.mjs +1 -1
  73. package/.output/server/chunks/_/{useDaqAddNode-CkGitJOy.mjs → useDaqAddNode-qUTVIBD0.mjs} +3 -3
  74. package/.output/server/chunks/_/useDaqAddNode-qUTVIBD0.mjs.map +1 -0
  75. package/.output/server/chunks/_/{useDaqDetailBinding-BKi46wvJ.mjs → useDaqDetailBinding-D0JkQZhl.mjs} +2 -2
  76. package/.output/server/chunks/_/useDaqDetailBinding-D0JkQZhl.mjs.map +1 -0
  77. package/.output/server/chunks/_/{useDaqDetailFrames-B6cqF1w1.mjs → useDaqDetailFrames-Du_raRy1.mjs} +2 -2
  78. package/.output/server/chunks/_/useDaqDetailFrames-Du_raRy1.mjs.map +1 -0
  79. package/.output/server/chunks/_/{useDaqDetailHistory-D0sdKiWx.mjs → useDaqDetailHistory-BQx0cKA6.mjs} +2 -2
  80. package/.output/server/chunks/_/useDaqDetailHistory-BQx0cKA6.mjs.map +1 -0
  81. package/.output/server/chunks/_/{useDaqDetailNode-DgxYQZBG.mjs → useDaqDetailNode-UCnodI1A.mjs} +4 -4
  82. package/.output/server/chunks/_/useDaqDetailNode-UCnodI1A.mjs.map +1 -0
  83. package/.output/server/chunks/_/{useDaqDetailParams-D-ZJw2GJ.mjs → useDaqDetailParams-D4ZVxVla.mjs} +3 -3
  84. package/.output/server/chunks/_/useDaqDetailParams-D4ZVxVla.mjs.map +1 -0
  85. package/.output/server/chunks/_/{useDaqFilters-Bi8Ybyhl.mjs → useDaqFilters-CugTQrIt.mjs} +4 -4
  86. package/.output/server/chunks/_/useDaqFilters-CugTQrIt.mjs.map +1 -0
  87. package/.output/server/chunks/_/{useDaqOptimizations-XodbRzgb.mjs → useDaqOptimizations-_P1sco7P.mjs} +2 -2
  88. package/.output/server/chunks/_/useDaqOptimizations-_P1sco7P.mjs.map +1 -0
  89. package/.output/server/chunks/_/{useDaqStream-CGbftQdw.mjs → useDaqStream-BVFNKAP9.mjs} +2 -2
  90. package/.output/server/chunks/_/useDaqStream-BVFNKAP9.mjs.map +1 -0
  91. package/.output/server/chunks/_/{useDaqTemplates-Bo_sE1xp.mjs → useDaqTemplates-DmcUC_Aw.mjs} +3 -3
  92. package/.output/server/chunks/_/useDaqTemplates-DmcUC_Aw.mjs.map +1 -0
  93. package/.output/server/chunks/_/{useDashboardData-BJ30kVLq.mjs → useDashboardData-Dv1SJs3v.mjs} +3 -3
  94. package/.output/server/chunks/_/useDashboardData-Dv1SJs3v.mjs.map +1 -0
  95. package/.output/server/chunks/_/{useDcwAddNode-BLqwQe59.mjs → useDcwAddNode-CZtXylAe.mjs} +3 -3
  96. package/.output/server/chunks/_/useDcwAddNode-CZtXylAe.mjs.map +1 -0
  97. package/.output/server/chunks/_/{useDcwCards-CofBoHat.mjs → useDcwCards-CItS2A_F.mjs} +2 -2
  98. package/.output/server/chunks/_/useDcwCards-CItS2A_F.mjs.map +1 -0
  99. package/.output/server/chunks/_/{useDcwDetailScope-DhkBcKaS.mjs → useDcwDetailScope-Dyu0bYy9.mjs} +3 -3
  100. package/.output/server/chunks/_/useDcwDetailScope-Dyu0bYy9.mjs.map +1 -0
  101. package/.output/server/chunks/_/{useDcwDetailTemplates-BSmmOkFn.mjs → useDcwDetailTemplates-CwK1rb2i.mjs} +2 -2
  102. package/.output/server/chunks/_/useDcwDetailTemplates-CwK1rb2i.mjs.map +1 -0
  103. package/.output/server/chunks/_/{useDcwFilter-Bh8dJ1of.mjs → useDcwFilter-CvuCOvU2.mjs} +2 -2
  104. package/.output/server/chunks/_/useDcwFilter-CvuCOvU2.mjs.map +1 -0
  105. package/.output/server/chunks/_/{useDcwLedger-UEB2x63E.mjs → useDcwLedger-CI-AK4j3.mjs} +2 -2
  106. package/.output/server/chunks/_/useDcwLedger-CI-AK4j3.mjs.map +1 -0
  107. package/.output/server/chunks/_/{useDcwLineMutations-9PElT2Fz.mjs → useDcwLineMutations-CsS2rDUh.mjs} +2 -2
  108. package/.output/server/chunks/_/useDcwLineMutations-CsS2rDUh.mjs.map +1 -0
  109. package/.output/server/chunks/_/{useDcwLineRun-BPm0ZPs1.mjs → useDcwLineRun-B1uLN_MJ.mjs} +2 -2
  110. package/.output/server/chunks/_/useDcwLineRun-B1uLN_MJ.mjs.map +1 -0
  111. package/.output/server/chunks/_/{useDcwParamApprovals-Ctczj8Lm.mjs → useDcwParamApprovals-CVab6q8T.mjs} +2 -2
  112. package/.output/server/chunks/_/useDcwParamApprovals-CVab6q8T.mjs.map +1 -0
  113. package/.output/server/chunks/_/{useDcwProducts-hgfkZhht.mjs → useDcwProducts-OAvQBk5O.mjs} +2 -2
  114. package/.output/server/chunks/_/useDcwProducts-OAvQBk5O.mjs.map +1 -0
  115. package/.output/server/chunks/_/{useDcwQuery-Dd411JAJ.mjs → useDcwQuery-dgEkZDAy.mjs} +2 -2
  116. package/.output/server/chunks/_/useDcwQuery-dgEkZDAy.mjs.map +1 -0
  117. package/.output/server/chunks/_/{useDcwQuickActions-C7cIVK0F.mjs → useDcwQuickActions-C3ItztwI.mjs} +2 -2
  118. package/.output/server/chunks/_/useDcwQuickActions-C3ItztwI.mjs.map +1 -0
  119. package/.output/server/chunks/_/{useDcwRecipes-DaQAxk7t.mjs → useDcwRecipes-BD4PjvzG.mjs} +2 -2
  120. package/.output/server/chunks/_/useDcwRecipes-BD4PjvzG.mjs.map +1 -0
  121. package/.output/server/chunks/_/{useDcwStream-2-KfS0lN.mjs → useDcwStream-BTcOZh5H.mjs} +2 -2
  122. package/.output/server/chunks/_/useDcwStream-BTcOZh5H.mjs.map +1 -0
  123. package/.output/server/chunks/_/{useDcwTemplates-BXtYJspX.mjs → useDcwTemplates-CsR6b3ws.mjs} +2 -2
  124. package/.output/server/chunks/_/useDcwTemplates-CsR6b3ws.mjs.map +1 -0
  125. package/.output/server/chunks/_/{useDcwWrites-IOVVc-Sz.mjs → useDcwWrites-C55DL7Fe.mjs} +2 -2
  126. package/.output/server/chunks/_/useDcwWrites-C55DL7Fe.mjs.map +1 -0
  127. package/.output/server/chunks/_/{useLogsScope-BFU7kLl9.mjs → useLogsScope-CUxlAoQN.mjs} +2 -2
  128. package/.output/server/chunks/_/useLogsScope-CUxlAoQN.mjs.map +1 -0
  129. package/.output/server/chunks/_/{workshop-CeaToa_8.mjs → workshop-D2ucb128.mjs} +4 -4
  130. package/.output/server/chunks/_/workshop-D2ucb128.mjs.map +1 -0
  131. package/.output/server/chunks/routes/api/mcp/workshop.mjs +1 -1
  132. package/.output/server/chunks/routes/api/system/backup/run.post.mjs +2 -2
  133. package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs +1 -1
  134. package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs +8 -9
  135. package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs.map +1 -1
  136. package/.output/server/chunks/routes/api/workshop/aml/index.get.mjs +15 -5
  137. package/.output/server/chunks/routes/api/workshop/aml/index.get.mjs.map +1 -1
  138. package/.output/server/chunks/routes/api/workshop/aml/index5.get.mjs +10 -5
  139. package/.output/server/chunks/routes/api/workshop/aml/index5.get.mjs.map +1 -1
  140. package/.output/server/chunks/routes/api/workshop/aml/models/index.get.mjs +39 -0
  141. package/.output/server/chunks/routes/api/workshop/aml/models/index.get.mjs.map +1 -0
  142. package/.output/server/chunks/routes/api/workshop/aml/training-plans/index.get.mjs +37 -0
  143. package/.output/server/chunks/routes/api/workshop/aml/training-plans/index.get.mjs.map +1 -0
  144. package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +1 -1
  145. package/.output/server/chunks/routes/api/workshop/channels/_id/harness-profiles/promote.post.mjs +62 -0
  146. package/.output/server/chunks/routes/api/workshop/channels/_id/harness-profiles/promote.post.mjs.map +1 -0
  147. package/.output/server/chunks/routes/api/workshop/channels/_id/improvement-stats.get.mjs +37 -0
  148. package/.output/server/chunks/routes/api/workshop/channels/_id/improvement-stats.get.mjs.map +1 -0
  149. package/.output/server/chunks/routes/api/workshop/channels/_id/index.put.mjs +1 -1
  150. package/.output/server/chunks/routes/api/workshop/channels/_id/index10.get.mjs +41 -0
  151. package/.output/server/chunks/routes/api/workshop/channels/_id/index10.get.mjs.map +1 -0
  152. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs +7 -5
  153. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs.map +1 -1
  154. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.post.mjs +24 -22
  155. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.post.mjs.map +1 -1
  156. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.put.mjs +1 -1
  157. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.get.mjs +9 -13
  158. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.get.mjs.map +1 -1
  159. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.post.mjs +22 -72
  160. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.post.mjs.map +1 -1
  161. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.get.mjs +14 -27
  162. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.get.mjs.map +1 -1
  163. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.post.mjs +72 -7
  164. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.post.mjs.map +1 -1
  165. package/.output/server/chunks/routes/api/workshop/channels/_id/index5.get.mjs +28 -22
  166. package/.output/server/chunks/routes/api/workshop/channels/_id/index5.get.mjs.map +1 -1
  167. package/.output/server/chunks/routes/api/workshop/channels/_id/index5.post.mjs +7 -66
  168. package/.output/server/chunks/routes/api/workshop/channels/_id/index5.post.mjs.map +1 -1
  169. package/.output/server/chunks/routes/api/workshop/channels/_id/index6.get.mjs +20 -38
  170. package/.output/server/chunks/routes/api/workshop/channels/_id/index6.get.mjs.map +1 -1
  171. package/.output/server/chunks/routes/api/workshop/channels/_id/index6.post.mjs +99 -0
  172. package/.output/server/chunks/routes/api/workshop/channels/_id/index6.post.mjs.map +1 -0
  173. package/.output/server/chunks/routes/api/workshop/channels/_id/index7.get.mjs +34 -4
  174. package/.output/server/chunks/routes/api/workshop/channels/_id/index7.get.mjs.map +1 -1
  175. package/.output/server/chunks/routes/api/workshop/channels/_id/index8.get.mjs +9 -8
  176. package/.output/server/chunks/routes/api/workshop/channels/_id/index8.get.mjs.map +1 -1
  177. package/.output/server/chunks/routes/api/workshop/channels/_id/index9.get.mjs +38 -0
  178. package/.output/server/chunks/routes/api/workshop/channels/_id/index9.get.mjs.map +1 -0
  179. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId/promote.post.mjs +46 -0
  180. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId/promote.post.mjs.map +1 -0
  181. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/experience-stats.get.mjs +37 -0
  182. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/experience-stats.get.mjs.map +1 -0
  183. package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs +1 -1
  184. package/.output/server/chunks/routes/api/workshop/channels/_id/tools/reset.post.mjs +1 -1
  185. package/.output/server/chunks/routes/api/workshop/channels/_id/twin-profile.get.mjs +1 -1
  186. package/.output/server/chunks/routes/api/workshop/channels/_id/twin-profile.patch.mjs +1 -1
  187. package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs +1 -1
  188. package/.output/server/chunks/routes/api/workshop/channels.post.mjs +6 -6
  189. package/.output/server/chunks/routes/api/workshop/daq/_id/ingest.post.mjs +2 -2
  190. package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs +1 -1
  191. package/.output/server/chunks/routes/api/workshop/daq/index.get.mjs +9 -7
  192. package/.output/server/chunks/routes/api/workshop/daq/index.get.mjs.map +1 -1
  193. package/.output/server/chunks/routes/api/workshop/daq/index2.get.mjs +38 -0
  194. package/.output/server/chunks/routes/api/workshop/daq/index2.get.mjs.map +1 -0
  195. package/.output/server/chunks/routes/api/workshop/daq/index2.post.mjs +1 -1
  196. package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs +1 -1
  197. package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs +1 -1
  198. package/.output/server/chunks/routes/api/workshop/daq/query.get.mjs +34 -16
  199. package/.output/server/chunks/routes/api/workshop/daq/query.get.mjs.map +1 -1
  200. package/.output/server/chunks/routes/api/workshop/daq/storage/retention.put.mjs +1 -1
  201. package/.output/server/chunks/routes/api/workshop/daq/storage/rollup.post.mjs +1 -1
  202. package/.output/server/chunks/routes/api/workshop/daq/storage.get.mjs +1 -1
  203. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs +1 -1
  204. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs +1 -1
  205. package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs +1 -1
  206. package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs +1 -1
  207. package/.output/server/chunks/routes/api/workshop/dcw/_id/bindings.put.mjs +1 -1
  208. package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs +1 -1
  209. package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs +1 -1
  210. package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs +1 -1
  211. package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs +1 -1
  212. package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs +1 -1
  213. package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs +1 -1
  214. package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs +1 -1
  215. package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs +7 -13
  216. package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs.map +1 -1
  217. package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs +1 -1
  218. package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs +14 -8
  219. package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs.map +1 -1
  220. package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs +1 -1
  221. package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs +9 -20
  222. package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs.map +1 -1
  223. package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs +1 -1
  224. package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs +17 -14
  225. package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs.map +1 -1
  226. package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs +1 -1
  227. package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs +15 -12
  228. package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs.map +1 -1
  229. package/.output/server/chunks/routes/api/workshop/dcw/index5.post.mjs +1 -1
  230. package/.output/server/chunks/routes/api/workshop/dcw/index6.get.mjs +11 -5
  231. package/.output/server/chunks/routes/api/workshop/dcw/index6.get.mjs.map +1 -1
  232. package/.output/server/chunks/routes/api/workshop/dcw/index7.get.mjs +7 -2
  233. package/.output/server/chunks/routes/api/workshop/dcw/index7.get.mjs.map +1 -1
  234. package/.output/server/chunks/routes/api/workshop/dcw/index8.get.mjs +33 -0
  235. package/.output/server/chunks/routes/api/workshop/dcw/index8.get.mjs.map +1 -0
  236. package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs +1 -1
  237. package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs +1 -1
  238. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs +1 -1
  239. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs +1 -1
  240. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs +1 -1
  241. package/.output/server/chunks/routes/api/workshop/dcw/lines/index.get.mjs +41 -0
  242. package/.output/server/chunks/routes/api/workshop/dcw/lines/index.get.mjs.map +1 -0
  243. package/.output/server/chunks/routes/api/workshop/dcw/mes-artifacts/file.get.mjs +1 -1
  244. package/.output/server/chunks/routes/api/workshop/dcw/mes-hook-test.post.mjs +1 -1
  245. package/.output/server/chunks/routes/api/workshop/dcw/mes-test-read.post.mjs +1 -1
  246. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs +1 -1
  247. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs +1 -1
  248. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs +1 -1
  249. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs +1 -1
  250. package/.output/server/chunks/routes/api/workshop/dcw/params/_id/read.post.mjs +1 -1
  251. package/.output/server/chunks/routes/api/workshop/dcw/params/_id/write.post.mjs +8 -5
  252. package/.output/server/chunks/routes/api/workshop/dcw/params/_id/write.post.mjs.map +1 -1
  253. package/.output/server/chunks/routes/api/workshop/dcw/params/_id_.delete.mjs +1 -1
  254. package/.output/server/chunks/routes/api/workshop/dcw/params/_id_.patch.mjs +1 -1
  255. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs +1 -1
  256. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs +1 -1
  257. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs +1 -1
  258. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs +1 -1
  259. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs +1 -1
  260. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs +1 -1
  261. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs +1 -1
  262. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs +1 -1
  263. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs +1 -1
  264. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs +1 -1
  265. package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs +1 -1
  266. package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs +8 -6
  267. package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs.map +1 -1
  268. package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs +1 -1
  269. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs +1 -1
  270. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs +1 -1
  271. package/.output/server/chunks/routes/api/workshop/eda/vm/predict.post.mjs +1 -1
  272. package/.output/server/chunks/routes/api/workshop/exp/confirmations/_id/decide.post.mjs +1 -1
  273. package/.output/server/chunks/routes/api/workshop/exp/index.get.mjs +1 -1
  274. package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs +1 -1
  275. package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs +1 -1
  276. package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs +1 -1
  277. package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs +1 -1
  278. package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs +17 -10
  279. package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs.map +1 -1
  280. package/.output/server/chunks/routes/api/workshop/index.mjs +1 -1
  281. package/.output/server/chunks/routes/api/workshop/index.put.mjs +16 -11
  282. package/.output/server/chunks/routes/api/workshop/index.put.mjs.map +1 -1
  283. package/.output/server/chunks/routes/api/workshop/index12.get.mjs +1 -1
  284. package/.output/server/chunks/routes/api/workshop/index13.get.mjs +1 -1
  285. package/.output/server/chunks/routes/api/workshop/index4.post.mjs +1 -1
  286. package/.output/server/chunks/routes/api/workshop/index5.post.mjs +1 -1
  287. package/.output/server/chunks/routes/api/workshop/index6.get.mjs +1 -1
  288. package/.output/server/chunks/routes/api/workshop/index6.post.mjs +1 -1
  289. package/.output/server/chunks/routes/api/workshop/index7.get.mjs +1 -1
  290. package/.output/server/chunks/routes/api/workshop/index7.post.mjs +1 -1
  291. package/.output/server/chunks/routes/api/workshop/index8.get.mjs +1 -1
  292. package/.output/server/chunks/routes/api/workshop/index8.post.mjs +1 -1
  293. package/.output/server/chunks/routes/api/workshop/mes/bridge.post.mjs +1 -1
  294. package/.output/server/chunks/routes/api/workshop/mes/datasets.get.mjs +1 -1
  295. package/.output/server/chunks/routes/api/workshop/mes/index.put.mjs +7 -8
  296. package/.output/server/chunks/routes/api/workshop/mes/index.put.mjs.map +1 -1
  297. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/autofix.mjs +1 -1
  298. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/compile.mjs +1 -1
  299. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/evidence.mjs +1 -1
  300. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/publish.mjs +1 -1
  301. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval-decision.mjs +1 -1
  302. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval.mjs +1 -1
  303. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/transition.mjs +1 -1
  304. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/subgraph.mjs +1 -1
  305. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/validate.mjs +1 -1
  306. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId_.mjs +1 -1
  307. package/.output/server/chunks/routes/api/workshop/ontology/export/_ontologyId_.mjs +1 -1
  308. package/.output/server/chunks/routes/api/workshop/ontology/index.mjs +1 -1
  309. package/.output/server/chunks/routes/api/workshop/ontology/scene.mjs +1 -1
  310. package/.output/server/chunks/routes/api/workshop/ontology/traces/_ontologyId_.mjs +1 -1
  311. package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId/compare.mjs +1 -1
  312. package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId_.mjs +1 -1
  313. package/.output/server/chunks/routes/api/workshop/optimization/capabilities.get.mjs +1 -1
  314. package/.output/server/chunks/routes/api/workshop/optimization/index.get.mjs +1 -1
  315. package/.output/server/chunks/routes/api/workshop/optimization/index.mjs +1 -1
  316. package/.output/server/chunks/routes/api/workshop/optimization/index2.mjs +1 -1
  317. package/.output/server/chunks/routes/api/workshop/optimization/profiles/_id/publish.post.mjs +1 -1
  318. package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/crosscheck.post.mjs +1 -1
  319. package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/dispatch.post.mjs +1 -1
  320. package/.output/server/chunks/routes/api/workshop/optimization/solve.post.mjs +1 -1
  321. package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs +1 -1
  322. package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +1 -1
  323. package/.output/server/chunks/routes/api/workshop/process-model/datasets.post.mjs +1 -1
  324. package/.output/server/chunks/routes/api/workshop/process-model/eligibility.mjs +1 -1
  325. package/.output/server/chunks/routes/api/workshop/process-model/experiments.mjs +1 -1
  326. package/.output/server/chunks/routes/api/workshop/process-model/index.mjs +1 -1
  327. package/.output/server/chunks/routes/api/workshop/process-model/specs/_id/publish.post.mjs +1 -1
  328. package/.output/server/chunks/routes/api/workshop/process-model/train.post.mjs +1 -1
  329. package/.output/server/chunks/routes/api/workshop/projects/_id/deliverables/index.get.mjs +37 -0
  330. package/.output/server/chunks/routes/api/workshop/projects/_id/deliverables/index.get.mjs.map +1 -0
  331. package/.output/server/chunks/routes/api/workshop/projects/_id/kernel/tick.post.mjs +1 -1
  332. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/index.get.mjs +37 -0
  333. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/index.get.mjs.map +1 -0
  334. package/.output/server/chunks/routes/api/workshop/projects/instantiate.post.mjs +1 -1
  335. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs +1 -1
  336. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +1 -1
  337. package/.output/server/chunks/routes/api/workshop/teams/_id/index.put.mjs +1 -1
  338. package/.output/server/chunks/routes/api/workshop/teams/_id/index2.get.mjs +1 -1
  339. package/.output/server/chunks/routes/api/workshop/tools/sync.post.mjs +1 -1
  340. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs +1 -1
  341. package/.output/server/chunks/routes/renderer.mjs +2 -2
  342. package/.output/server/chunks/virtual/entry.mjs +50 -46
  343. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  344. package/.output/server/package.json +1 -1
  345. package/README-zh.md +53 -8
  346. package/README.md +53 -8
  347. package/app/components/AppSidebar.vue +2 -0
  348. package/app/components/workshop/CommandPalette.vue +1 -0
  349. package/app/components/workshop/workbench/WorkbenchHead.vue +35 -7
  350. package/app/composables/useRouteMeta.ts +1 -0
  351. package/app/pages/projects/[id].vue +2882 -1603
  352. package/app/pages/projects/index.vue +982 -176
  353. package/config.yml +1 -1
  354. package/docs/cli.en.md +3 -3
  355. package/docs/cli.md +2 -2
  356. package/docs/plugins.en.md +1 -1
  357. package/docs/plugins.md +1 -1
  358. package/docs/sdk.en.md +1 -1
  359. package/docs/sdk.md +1 -1
  360. package/i18n/locales/en.ts +2 -0
  361. package/i18n/locales/zh-CN.ts +2 -0
  362. package/package.json +2 -2
  363. package/scripts/_audit/_readme-canvas-shot.mjs +48 -48
  364. package/scripts/_audit/cal3-staged-live.mjs +3 -0
  365. package/scripts/_audit/desktop-demo-shot.mjs +31 -31
  366. package/scripts/_audit/frontend-interaction-demo.mjs +99 -99
  367. package/scripts/_audit/multi-harness-isolation-live.mjs +132 -132
  368. package/scripts/_audit/omp-channel-project-session-live.mjs +481 -0
  369. package/scripts/_audit/omp-project-single-live.mjs +167 -0
  370. package/scripts/_audit/project-blueprint-live.mjs +63 -42
  371. package/scripts/_audit/project-landing-live.mjs +659 -0
  372. package/scripts/acceptance-rsi-evolution.ts +188 -0
  373. package/scripts/acceptance-rsi-live-e2e.mjs +611 -0
  374. package/scripts/acceptance-rsi-stage1.ts +208 -0
  375. package/scripts/check-rsi-redline.mjs +73 -0
  376. package/scripts/demo/accept-harness-fix.mjs +178 -0
  377. package/scripts/e2e-final-assertions.mjs +51 -51
  378. package/scripts/e2e-landing-scenario.mjs +409 -409
  379. package/scripts/e2e-landing-shot.mjs +24 -24
  380. package/scripts/e2e-page-shot.mjs +71 -71
  381. package/scripts/e2e-session-shot.mjs +82 -82
  382. package/scripts/e2e-ui-capture.mjs +125 -125
  383. package/scripts/e2e-us7-close.mjs +88 -88
  384. package/scripts/e2e-us7-final.mjs +132 -132
  385. package/scripts/e2e-us7-retry.mjs +136 -136
  386. package/scripts/session-memory-runtime-acceptance.mjs +245 -245
  387. package/server/api/workshop/agent-tools/invoke.post.ts +15 -7
  388. package/server/api/workshop/aml/datasets/index.get.ts +20 -4
  389. package/server/api/workshop/aml/jobs/index.get.ts +15 -4
  390. package/server/api/workshop/aml/models/[id]/index.get.ts +24 -0
  391. package/server/api/workshop/aml/training-plans/[id]/index.get.ts +19 -0
  392. package/server/api/workshop/channels/[id]/harness-profiles/index.get.ts +27 -0
  393. package/server/api/workshop/channels/[id]/harness-profiles/index.post.ts +46 -0
  394. package/server/api/workshop/channels/[id]/harness-profiles/promote.post.ts +48 -0
  395. package/server/api/workshop/channels/[id]/improvement-stats.get.ts +20 -0
  396. package/server/api/workshop/channels/[id]/memories/[memoryId]/promote.post.ts +33 -0
  397. package/server/api/workshop/channels/[id]/memories/experience-stats.get.ts +19 -0
  398. package/server/api/workshop/channels/[id]/verifications/index.get.ts +23 -0
  399. package/server/api/workshop/daq/[id]/index.get.ts +25 -0
  400. package/server/api/workshop/daq/query.get.ts +42 -14
  401. package/server/api/workshop/dcw/[id]/index.get.ts +24 -0
  402. package/server/api/workshop/dcw/lines/[id]/index.get.ts +27 -0
  403. package/server/api/workshop/dcw/params/[id]/write.post.ts +12 -3
  404. package/server/api/workshop/device-twins/[id]/control.post.ts +12 -4
  405. package/server/api/workshop/hitl/respond.post.ts +19 -21
  406. package/server/api/workshop/mes/secrets/index.put.ts +11 -6
  407. package/server/api/workshop/permissions/index.put.ts +20 -9
  408. package/server/api/workshop/projects/[id]/deliverables/[did]/index.get.ts +19 -0
  409. package/server/api/workshop/projects/[id]/work-items/[wid]/index.get.ts +20 -0
  410. package/server/plugins/workshop.ts +3 -0
  411. package/server/services/workshop/agents/agent-interface.ts +63 -2
  412. package/server/services/workshop/agents/base-agent.ts +7 -1
  413. package/server/services/workshop/agents/host-tool-bridge/dispatch.ts +3 -0
  414. package/server/services/workshop/agents/host-tool-bridge/tools/improvement.ts +33 -0
  415. package/server/services/workshop/agents/host-tool-bridge/tools/memory.ts +68 -12
  416. package/server/services/workshop/agents/industrial/analysis-tools.ts +3 -0
  417. package/server/services/workshop/agents/industrial/line-tools.ts +11 -1
  418. package/server/services/workshop/agents/industrial/ops-tools.ts +22 -0
  419. package/server/services/workshop/agents/industrial/recipe-propose-tools.ts +8 -2
  420. package/server/services/workshop/agents/omp-agent/client.ts +18 -1
  421. package/server/services/workshop/agents/omp-agent/context-governance.ts +13 -1
  422. package/server/services/workshop/agents/omp-agent/core.ts +6 -0
  423. package/server/services/workshop/agents/task-channel-profile.ts +55 -0
  424. package/server/services/workshop/agents/task-channel.ts +3 -0
  425. package/server/services/workshop/aml/intervention-ledger.ts +14 -0
  426. package/server/services/workshop/analysis/analysis.repo.ts +6 -4
  427. package/server/services/workshop/db/database/index.ts +1 -1
  428. package/server/services/workshop/db/database/migrations-blind-verification.ts +33 -0
  429. package/server/services/workshop/db/database/migrations-experience.ts +38 -0
  430. package/server/services/workshop/db/database/migrations-harness-profile.ts +28 -0
  431. package/server/services/workshop/db/database/migrations-improvement-actions.ts +30 -0
  432. package/server/services/workshop/db/database/migrations-improvement.ts +36 -0
  433. package/server/services/workshop/db/database/migrations-project.ts +179 -179
  434. package/server/services/workshop/db/database/open.ts +134 -117
  435. package/server/services/workshop/db/database/rows.ts +22 -2
  436. package/server/services/workshop/db/database/schema.ts +1675 -1667
  437. package/server/services/workshop/db/improvement-action.repo.ts +82 -0
  438. package/server/services/workshop/db/improvement.repo.ts +139 -0
  439. package/server/services/workshop/db/memory.repo.ts +238 -22
  440. package/server/services/workshop/dcw/dcw-controller/lines.ts +3 -3
  441. package/server/services/workshop/dcw/recipe-evidence.ts +181 -0
  442. package/server/services/workshop/experience/advisory.ts +135 -0
  443. package/server/services/workshop/experience/gates.ts +150 -0
  444. package/server/services/workshop/experience/harness-profile.ts +159 -0
  445. package/server/services/workshop/experience/overlay.ts +55 -0
  446. package/server/services/workshop/experience/promote.ts +123 -0
  447. package/server/services/workshop/optimization/python/__pycache__/problems.cpython-312.pyc +0 -0
  448. package/server/services/workshop/plugins/host/reload-swap.mjs +68 -0
  449. package/server/services/workshop/plugins/host/reload.mjs +42 -12
  450. package/server/services/workshop/projects/criteria-metrics.ts +54 -0
  451. package/server/services/workshop/projects/service.ts +158 -3
  452. package/server/services/workshop/runtime/manager/a2a.ts +61 -0
  453. package/server/services/workshop/runtime/manager/admin-agents.ts +68 -2
  454. package/server/services/workshop/runtime/manager/contracts.ts +23 -0
  455. package/server/services/workshop/runtime/manager/state.ts +132 -0
  456. package/server/services/workshop/runtime/manager/types.ts +3 -0
  457. package/server/services/workshop/runtime/manager/workspace.ts +18 -2
  458. package/server/services/workshop/runtime/memory/helpers.ts +4 -0
  459. package/server/services/workshop/runtime/memory/recall.ts +41 -10
  460. package/server/services/workshop/runtime/memory/reflect-collector.ts +213 -0
  461. package/server/services/workshop/runtime/memory/reflector.ts +321 -0
  462. package/server/services/workshop/runtime/memory/state.ts +2 -0
  463. package/server/services/workshop/runtime/memory/types.ts +16 -0
  464. package/server/services/workshop/runtime/memory/write.ts +68 -1
  465. package/server/services/workshop/verify/blind-verifier.ts +291 -0
  466. package/.output/public/_nuxt/-XI3FWdE2.js +0 -1
  467. package/.output/public/_nuxt/B2azkP06.js +0 -1
  468. package/.output/public/_nuxt/B7Xvcvc72.js +0 -1
  469. package/.output/public/_nuxt/BjERGiA_.js +0 -1
  470. package/.output/public/_nuxt/BuNUABSV.js +0 -1
  471. package/.output/public/_nuxt/BxCzghnC.js +0 -1
  472. package/.output/public/_nuxt/ChaPv2ma2.js +0 -1
  473. package/.output/public/_nuxt/CtR6fOPv.js +0 -1
  474. package/.output/public/_nuxt/D3ucelqH.js +0 -1
  475. package/.output/public/_nuxt/DYj0LL7W2.js +0 -2
  476. package/.output/public/_nuxt/DxCWsK3w2.js +0 -2
  477. package/.output/public/_nuxt/_id_.CHfy_h7D.css +0 -1
  478. package/.output/public/_nuxt/builds/meta/41ef012e-5907-4063-b58c-16c4d02de1b7.json +0 -1
  479. package/.output/public/_nuxt/projects.BYLuJvrX.css +0 -1
  480. package/.output/public/_nuxt/workshop.Dr7XdziI.css +0 -1
  481. package/.output/server/chunks/_/TownView-uicih2T8.mjs.map +0 -1
  482. package/.output/server/chunks/_/_id_-BX8hihhe.mjs.map +0 -1
  483. package/.output/server/chunks/_/_id_-CEoXvYq6.mjs +0 -619
  484. package/.output/server/chunks/_/_id_-CEoXvYq6.mjs.map +0 -1
  485. package/.output/server/chunks/_/_id_-DMxiYYGr.mjs.map +0 -1
  486. package/.output/server/chunks/_/analysis-DVLO0bCy.mjs.map +0 -1
  487. package/.output/server/chunks/_/daq-CWiRcs2W.mjs.map +0 -1
  488. package/.output/server/chunks/_/dcw-BrEWEFnj.mjs.map +0 -1
  489. package/.output/server/chunks/_/logs-Lx7w3LYH.mjs.map +0 -1
  490. package/.output/server/chunks/_/operations--xLPUg-f.mjs.map +0 -1
  491. package/.output/server/chunks/_/pages-CzF3fZqL.mjs.map +0 -1
  492. package/.output/server/chunks/_/projects-BYn-GiAJ.mjs +0 -85
  493. package/.output/server/chunks/_/projects-BYn-GiAJ.mjs.map +0 -1
  494. package/.output/server/chunks/_/town-HjaOuPYS.mjs.map +0 -1
  495. package/.output/server/chunks/_/useDaqAddNode-CkGitJOy.mjs.map +0 -1
  496. package/.output/server/chunks/_/useDaqDetailBinding-BKi46wvJ.mjs.map +0 -1
  497. package/.output/server/chunks/_/useDaqDetailFrames-B6cqF1w1.mjs.map +0 -1
  498. package/.output/server/chunks/_/useDaqDetailHistory-D0sdKiWx.mjs.map +0 -1
  499. package/.output/server/chunks/_/useDaqDetailNode-DgxYQZBG.mjs.map +0 -1
  500. package/.output/server/chunks/_/useDaqDetailParams-D-ZJw2GJ.mjs.map +0 -1
  501. package/.output/server/chunks/_/useDaqFilters-Bi8Ybyhl.mjs.map +0 -1
  502. package/.output/server/chunks/_/useDaqOptimizations-XodbRzgb.mjs.map +0 -1
  503. package/.output/server/chunks/_/useDaqStream-CGbftQdw.mjs.map +0 -1
  504. package/.output/server/chunks/_/useDaqTemplates-Bo_sE1xp.mjs.map +0 -1
  505. package/.output/server/chunks/_/useDashboardData-BJ30kVLq.mjs.map +0 -1
  506. package/.output/server/chunks/_/useDcwAddNode-BLqwQe59.mjs.map +0 -1
  507. package/.output/server/chunks/_/useDcwCards-CofBoHat.mjs.map +0 -1
  508. package/.output/server/chunks/_/useDcwDetailScope-DhkBcKaS.mjs.map +0 -1
  509. package/.output/server/chunks/_/useDcwDetailTemplates-BSmmOkFn.mjs.map +0 -1
  510. package/.output/server/chunks/_/useDcwFilter-Bh8dJ1of.mjs.map +0 -1
  511. package/.output/server/chunks/_/useDcwLedger-UEB2x63E.mjs.map +0 -1
  512. package/.output/server/chunks/_/useDcwLineMutations-9PElT2Fz.mjs.map +0 -1
  513. package/.output/server/chunks/_/useDcwLineRun-BPm0ZPs1.mjs.map +0 -1
  514. package/.output/server/chunks/_/useDcwParamApprovals-Ctczj8Lm.mjs.map +0 -1
  515. package/.output/server/chunks/_/useDcwProducts-hgfkZhht.mjs.map +0 -1
  516. package/.output/server/chunks/_/useDcwQuery-Dd411JAJ.mjs.map +0 -1
  517. package/.output/server/chunks/_/useDcwQuickActions-C7cIVK0F.mjs.map +0 -1
  518. package/.output/server/chunks/_/useDcwRecipes-DaQAxk7t.mjs.map +0 -1
  519. package/.output/server/chunks/_/useDcwStream-2-KfS0lN.mjs.map +0 -1
  520. package/.output/server/chunks/_/useDcwTemplates-BXtYJspX.mjs.map +0 -1
  521. package/.output/server/chunks/_/useDcwWrites-IOVVc-Sz.mjs.map +0 -1
  522. package/.output/server/chunks/_/useLogsScope-BFU7kLl9.mjs.map +0 -1
  523. package/.output/server/chunks/_/workshop-CeaToa_8.mjs.map +0 -1
  524. package/scripts/_audit/_fix-report.mjs +0 -32
  525. /package/.output/public/_nuxt/{B5D1k6CB2.js → B5D1k6CB.js} +0 -0
  526. /package/.output/public/_nuxt/{B6Olw0Op2.js → B6Olw0Op.js} +0 -0
  527. /package/.output/public/_nuxt/{BclHgAY6.js → BclHgAY62.js} +0 -0
  528. /package/.output/public/_nuxt/{D9saExk9.js → D9saExk92.js} +0 -0
  529. /package/.output/public/_nuxt/{DFI6asjj.js → DFI6asjj2.js} +0 -0
  530. /package/.output/public/_nuxt/{DkJVtqfc.js → DkJVtqfc2.js} +0 -0
  531. /package/.output/public/_nuxt/{OVP8I5uy2.js → OVP8I5uy.js} +0 -0
@@ -0,0 +1,213 @@
1
+ /**
2
+ * RSI 经验事实采集器(WP-A2)—— 从平台库**只读**聚合三类触发点所需的结构化事实,
3
+ * 再交给 reflector 蒸馏。所有查询单库完成(AML 与平台共用同一 DatabaseSync 实例)。
4
+ *
5
+ * 链接口径(为什么不按 task_id 关联干预):
6
+ * - intervention_events 只带 channel_id/line_id/recipe_run_id/approval_id,**没有 task_id**;
7
+ * 按时间窗/频道猜测关联会产生假归因(比不关联更糟),因此干预经验走自己的触发点,
8
+ * 任务经验只记录"判据是否通过 + 失败分类"这些确定事实。
9
+ */
10
+ import type { DatabaseSync } from 'node:sqlite'
11
+ import { parseJson } from '../../db/database'
12
+ import type { InterventionFact, ReviewFact, TaskFact } from './reflector'
13
+
14
+ /** 任务行投影(只取必需列,避免宽表读取) */
15
+ interface TaskRowLite {
16
+ id: string
17
+ channel_id: string
18
+ title: string
19
+ description: string | null
20
+ state: string
21
+ session_id: string | null
22
+ artifacts_json: string | null
23
+ }
24
+
25
+ /** project_results 关键投影(criteria/有效性域/血缘) */
26
+ interface ResultRowLite {
27
+ id: string
28
+ channel_id: string
29
+ line_id: string
30
+ title: string
31
+ summary: string
32
+ status: string
33
+ validity_scope: string
34
+ criteria_check_json: string
35
+ trace_id: string
36
+ source_task_id: string
37
+ author_agent_id: string | null
38
+ }
39
+
40
+ /** 干预台账行投影 */
41
+ interface InterventionRowLite {
42
+ id: string
43
+ channel_id: string
44
+ line_id: string
45
+ node_name: string
46
+ from_value: number | null
47
+ to_value: number | null
48
+ actual_value: number | null
49
+ ack: string
50
+ hypothesis: string
51
+ recipe_run_id: string | null
52
+ criterion_json: string | null
53
+ verdict: string
54
+ effect: number | null
55
+ ci_low: number | null
56
+ ci_high: number | null
57
+ mde: number | null
58
+ }
59
+
60
+ /** artifacts_json → 纯文本(优先 deliverable/summary 命名成果,其余兜底拼接) */
61
+ function artifactsText(artifactsJson: string | null): string {
62
+ const artifacts = parseJson<Array<{ name?: string, parts?: Array<{ text?: string }> }>>(artifactsJson, [])
63
+ if (!Array.isArray(artifacts) || artifacts.length === 0) return ''
64
+ const preferred = artifacts.filter(a => a.name === 'deliverable' || a.name === 'summary')
65
+ const source = preferred.length > 0 ? preferred : artifacts
66
+ return source
67
+ .flatMap(a => (a.parts ?? []).map(p => p.text ?? ''))
68
+ .join(' ')
69
+ .trim()
70
+ }
71
+
72
+ /** 频道绑定的产线(作用域锚点;未绑定返回 '') */
73
+ export function channelLineId(db: DatabaseSync, channelId: string): string {
74
+ const row = db.prepare('SELECT line_id AS lineId FROM channels WHERE id = ?').get(channelId) as { lineId?: string } | undefined
75
+ return row?.lineId ?? ''
76
+ }
77
+
78
+ /** 任务终态事实(判据来自 project_results.criteria_check_json;失败分类来自 attempt) */
79
+ export function collectTaskFact(
80
+ db: DatabaseSync,
81
+ input: { channelId: string, taskId: string, agentId: string },
82
+ ): TaskFact | null {
83
+ const task = db.prepare(
84
+ `SELECT id, channel_id, title, description, state, session_id, artifacts_json FROM tasks WHERE id = ?`,
85
+ ).get(input.taskId) as TaskRowLite | undefined
86
+ if (!task) return null
87
+
88
+ // 项目任务:根任务 COMPLETED 时自动生成的 draft 成果携带 L0 判据结果
89
+ const result = db.prepare(
90
+ `SELECT criteria_check_json FROM project_results WHERE source_task_id = ? ORDER BY version DESC LIMIT 1`,
91
+ ).get(input.taskId) as { criteria_check_json: string } | undefined
92
+ const criteriaRaw = parseJson<Record<string, unknown>>(result?.criteria_check_json ?? '{}', {})
93
+ const criteria = Object.keys(criteriaRaw).length > 0
94
+ ? {
95
+ ok: criteriaRaw['ok'] === true,
96
+ checks: Array.isArray(criteriaRaw['checks'])
97
+ ? (criteriaRaw['checks'] as Array<Record<string, unknown>>).map(c => ({
98
+ id: typeof c['id'] === 'string' ? c['id'] : undefined,
99
+ kind: typeof c['kind'] === 'string' ? c['kind'] : undefined,
100
+ ok: c['ok'] === true,
101
+ detail: typeof c['detail'] === 'string' ? c['detail'] : undefined,
102
+ }))
103
+ : [],
104
+ }
105
+ : undefined
106
+
107
+ // 失败分类(项目 attempt 才有;普通频道任务为空)
108
+ const attempt = db.prepare(
109
+ `SELECT failure_class FROM project_work_item_attempts WHERE channel_task_id = ? AND failure_class != '' ORDER BY created_at DESC LIMIT 1`,
110
+ ).get(input.taskId) as { failure_class: string } | undefined
111
+
112
+ return {
113
+ source: 'task',
114
+ channelId: input.channelId,
115
+ agentId: input.agentId,
116
+ taskId: task.id,
117
+ title: task.title,
118
+ state: task.state,
119
+ sessionId: task.session_id ?? '',
120
+ deliverable: artifactsText(task.artifacts_json) || (task.description ?? ''),
121
+ criteria,
122
+ failureClass: attempt?.failure_class || undefined,
123
+ lineId: channelLineId(db, input.channelId) || undefined,
124
+ }
125
+ }
126
+
127
+ /**
128
+ * 评审终态事实。
129
+ * verdict 映射:成果 approved → approved;rejected/rework_required → rejected。
130
+ * validity_scope 允许 `line:<id>` / `product:<id>` 形式(历史数据也接受裸 key + kind 列缺失)。
131
+ */
132
+ export function collectReviewFact(
133
+ db: DatabaseSync,
134
+ input: { resultId: string, verdict: 'approved' | 'rejected' },
135
+ ): ReviewFact | null {
136
+ const row = db.prepare(
137
+ `SELECT id, channel_id, line_id, title, summary, status, validity_scope, criteria_check_json,
138
+ trace_id, source_task_id, author_agent_id
139
+ FROM project_results WHERE id = ?`,
140
+ ).get(input.resultId) as ResultRowLite | undefined
141
+ if (!row) return null
142
+ const scopeRaw = (row.validity_scope ?? '').trim()
143
+ let validityScope: { kind?: string, key?: string } | undefined
144
+ if (scopeRaw) {
145
+ const [kind, ...rest] = scopeRaw.split(':')
146
+ validityScope = rest.length > 0
147
+ ? { kind, key: rest.join(':') }
148
+ : (kind === 'line' || kind === 'product' ? { kind } : { key: kind })
149
+ }
150
+ return {
151
+ source: 'review',
152
+ channelId: row.channel_id,
153
+ agentId: row.author_agent_id ?? 'system:review',
154
+ resultId: row.id,
155
+ verdict: input.verdict,
156
+ title: row.title,
157
+ summary: row.summary,
158
+ validityScope,
159
+ lineId: row.line_id || channelLineId(db, row.channel_id) || undefined,
160
+ taskId: row.source_task_id || undefined,
161
+ traceId: row.trace_id || undefined,
162
+ }
163
+ }
164
+
165
+ /** 干预 verdict 事实(verdict 回填后采集;pending/unassessed 由 reflector 过滤) */
166
+ export function collectInterventionFact(db: DatabaseSync, eventId: string): InterventionFact | null {
167
+ const row = db.prepare(
168
+ `SELECT id, channel_id, line_id, node_name, from_value, to_value, actual_value, ack, hypothesis,
169
+ recipe_run_id, criterion_json, verdict, effect, ci_low, ci_high, mde
170
+ FROM intervention_events WHERE id = ?`,
171
+ ).get(eventId) as InterventionRowLite | undefined
172
+ if (!row) return null
173
+ const verdict = row.verdict as InterventionFact['verdict']
174
+ return {
175
+ source: 'intervention',
176
+ channelId: row.channel_id,
177
+ agentId: 'system:ledger',
178
+ eventId: row.id,
179
+ verdict,
180
+ nodeName: row.node_name,
181
+ fromValue: row.from_value,
182
+ toValue: row.to_value,
183
+ actualValue: row.actual_value,
184
+ ack: row.ack,
185
+ hypothesis: row.hypothesis,
186
+ recipeRunId: row.recipe_run_id,
187
+ effect: row.effect,
188
+ ciLow: row.ci_low,
189
+ ciHigh: row.ci_high,
190
+ mde: row.mde,
191
+ criterion: parseJson<Record<string, unknown> | null>(row.criterion_json ?? '', null),
192
+ lineId: row.line_id || channelLineId(db, row.channel_id) || undefined,
193
+ }
194
+ }
195
+
196
+ /**
197
+ * 干预台账补扫:把 verdict 已回填但尚未沉淀为经验的台账行批量采集。
198
+ * 经验 dedupKey=`exp:int:<eventId>` 保证重复扫描幂等。
199
+ * 由维护定时器驱动(attachAssessment 的即时 hook 之外的兜底)。
200
+ */
201
+ export function listUnreflectedInterventions(db: DatabaseSync, opts: { sinceIso: string, limit?: number }): string[] {
202
+ const rows = db.prepare(
203
+ `SELECT e.id FROM intervention_events e
204
+ WHERE e.verdict IN ('identifiable_effect','no_resolvable_effect','underpowered','confounded','unassessed')
205
+ AND e.updated_at >= ?
206
+ AND NOT EXISTS (
207
+ SELECT 1 FROM agent_memories m
208
+ WHERE m.kind = 'experience' AND m.dedup_key = 'exp:int:' || e.id
209
+ )
210
+ ORDER BY e.updated_at ASC LIMIT ?`,
211
+ ).all(opts.sinceIso, Math.min(Math.max(opts.limit ?? 50, 1), 500)) as Array<{ id: string }>
212
+ return rows.map(r => r.id)
213
+ }
@@ -0,0 +1,321 @@
1
+ /**
2
+ * RSI 经验反射器(WP-A2)—— 把「任务结果 + 验收判定 + 干预 verdict」**确定性蒸馏**为
3
+ * 带证据链的经验条目(kind='experience')。
4
+ *
5
+ * 设计纪律(plan ADR-2 / G2):
6
+ * - Tier1 确定性蒸馏,零 LLM:输入全部是结构化事实(state/verdict/criteria/metrics),
7
+ * 输出内容可机器复核 —— 经验进库看 verdict,不看 Agent 自述;
8
+ * - 无 verdict 背书的因果断言 → outcome='unknown' + status='candidate' + `[anecdotal]` 前缀;
9
+ * - 证据锚点缺失由 repo.upsertExperience fail-closed 拒绝(绝不产生无证据经验);
10
+ * - line/product 作用域一律 candidate(先验证再晋级,防错误经验复利),channel/session 为 active。
11
+ *
12
+ * 三类事实的 scope 归属:
13
+ * - 任务终态:channel(本频道经验;sessionId 一并保留供 session 档检索)
14
+ * - 项目评审:approved/rejected 带 validityScope → line/product;否则 channel
15
+ * - 干预 verdict:line(有 lineId 时)否则 channel
16
+ */
17
+ import type { MemoryScopeKind, MemoryStatus } from '../../db/database'
18
+ import type { ExperienceEvidence, MemoryRepo } from '../../db/memory.repo'
19
+ import type { EmbeddingProvider } from '../embedding-provider'
20
+ import { segmentCJK, vectorizeMemory } from './helpers'
21
+
22
+ /** 任务终态事实(message.ts / supervise.ts / 调度器 bus 单点收口后采集) */
23
+ export interface TaskFact {
24
+ source: 'task'
25
+ channelId: string
26
+ agentId: string
27
+ taskId: string
28
+ title: string
29
+ state: string
30
+ sessionId?: string
31
+ /** 交付物/结论原文(可为空;空则回退 description/title) */
32
+ deliverable?: string
33
+ /** 项目任务附带的 L0 判据结果(criteria_check_json 投影) */
34
+ criteria?: { ok: boolean, checks: Array<{ id?: string, kind?: string, ok?: boolean, detail?: string }> }
35
+ /** 同频道同产线的干预 verdict 摘要(来自 intervention_events;可为空) */
36
+ intervention?: { eventId: string, verdict: string, effect?: number | null, recipeRunId?: string | null }
37
+ /** 产线/产品锚点(channel line 绑定解析;用于作用域与证据) */
38
+ lineId?: string
39
+ productId?: string
40
+ /** 失败场合的失败分类(project_work_item_attempts.failure_class) */
41
+ failureClass?: string
42
+ }
43
+
44
+ /** 项目成果评审终态事实(reviewResult / decideApproval 之后采集) */
45
+ export interface ReviewFact {
46
+ source: 'review'
47
+ channelId: string
48
+ agentId: string
49
+ resultId: string
50
+ /** approved | rejected(L1 技术验收与 L2 业务签核合一语义:通过/驳回) */
51
+ verdict: 'approved' | 'rejected'
52
+ title: string
53
+ /** 成果摘要/驳回原因 */
54
+ summary?: string
55
+ /** 成果声明的有效域(validity_scope:line/product) */
56
+ validityScope?: { kind?: string, key?: string }
57
+ lineId?: string
58
+ productId?: string
59
+ taskId?: string
60
+ traceId?: string
61
+ }
62
+
63
+ /** 干预 verdict 回填事实(intervention_events.attachAssessment 后采集) */
64
+ export interface InterventionFact {
65
+ source: 'intervention'
66
+ channelId: string
67
+ agentId: string
68
+ eventId: string
69
+ verdict: 'identifiable_effect' | 'no_resolvable_effect' | 'underpowered' | 'confounded' | 'unassessed'
70
+ nodeName?: string
71
+ fromValue?: number | null
72
+ toValue?: number | null
73
+ actualValue?: number | null
74
+ ack?: string | null
75
+ hypothesis?: string | null
76
+ recipeRunId?: string | null
77
+ effect?: number | null
78
+ ciLow?: number | null
79
+ ciHigh?: number | null
80
+ mde?: number | null
81
+ criterion?: Record<string, unknown> | null
82
+ lineId?: string
83
+ productId?: string
84
+ }
85
+
86
+ export type ExperienceFact = TaskFact | ReviewFact | InterventionFact
87
+
88
+ /** 蒸馏产物(可直接交给 repo.upsertExperience) */
89
+ export interface DistilledExperience {
90
+ title: string
91
+ content: string
92
+ outcome: 'positive' | 'negative' | 'neutral' | 'unknown'
93
+ status: MemoryStatus
94
+ scopeKind: MemoryScopeKind
95
+ scopeKey: string
96
+ importance: number
97
+ sessionId: string
98
+ dedupKey: string
99
+ evidence: ExperienceEvidence
100
+ /** 附带指标(已并入 evidence.metrics;此处保留供测试/观测) */
101
+ metrics?: Record<string, number>
102
+ }
103
+
104
+ const ANECDOTAL = '[anecdotal] '
105
+
106
+ /** 数字格式化(避免 1e-7 之类的科学计数进入可读内容;无效值返回 null) */
107
+ function num(v: number | null | undefined): string | null {
108
+ if (typeof v !== 'number' || !Number.isFinite(v)) return null
109
+ const fixed = Math.abs(v) >= 100 ? v.toFixed(1) : v.toFixed(3)
110
+ return fixed.replace(/\.?0+$/, '')
111
+ }
112
+
113
+ /** 判据摘要(metric op threshold → 一行) */
114
+ function criterionText(c: Record<string, unknown> | null | undefined): string {
115
+ if (!c) return ''
116
+ const metric = typeof c['metric'] === 'string' ? c['metric'] : ''
117
+ const op = typeof c['op'] === 'string' ? c['op'] : ''
118
+ const threshold = num(typeof c['threshold'] === 'number' ? c['threshold'] : null)
119
+ if (!metric) return ''
120
+ return `${metric}${op}${threshold ?? '?'}`
121
+ }
122
+
123
+ /** 作用域与状态:line/product 一律 candidate(ADR-7),其余 active */
124
+ function scopeOf(kind: MemoryScopeKind, key: string): { scopeKind: MemoryScopeKind, scopeKey: string, status: MemoryStatus } {
125
+ if ((kind === 'line' || kind === 'product') && key) {
126
+ return { scopeKind: kind, scopeKey: key, status: 'candidate' }
127
+ }
128
+ return { scopeKind: 'channel', scopeKey: '', status: 'active' }
129
+ }
130
+
131
+ /**
132
+ * 蒸馏任务终态事实。
133
+ * 返回 null 表示"没有可沉淀的内容"(无交付物且无判据)—— 宁缺毋滥,不写空经验。
134
+ */
135
+ export function distillTaskFact(f: TaskFact): DistilledExperience | null {
136
+ const completed = f.state === 'COMPLETED'
137
+ const criteriaFailed = f.criteria ? f.criteria.ok === false : false
138
+ const verdictText = f.intervention
139
+ ? `干预判定 ${f.intervention.verdict}${f.intervention.effect !== null && f.intervention.effect !== undefined ? `(effect=${num(f.intervention.effect)})` : ''}`
140
+ : ''
141
+ const body = (f.deliverable ?? '').trim().slice(0, 300)
142
+ if (!body && !criteriaFailed && !verdictText) return null
143
+
144
+ const outcome = criteriaFailed || !completed
145
+ ? 'negative' as const
146
+ : f.intervention?.verdict === 'identifiable_effect'
147
+ ? 'positive' as const
148
+ : f.intervention && f.intervention.verdict !== 'identifiable_effect'
149
+ ? 'unknown' as const
150
+ : 'positive' as const
151
+
152
+ const hasVerdict = !!f.intervention && f.intervention.verdict !== 'unassessed'
153
+ const scope = scopeOf(f.lineId ? 'line' : 'channel', f.lineId ?? '')
154
+
155
+ const parts = [
156
+ `任务「${f.title}」终态 ${f.state}`,
157
+ criteriaFailed ? `L0 判据未通过(${(f.criteria?.checks ?? []).filter(c => c.ok === false).map(c => c.id ?? c.kind ?? '?').join('、')})` : '',
158
+ f.failureClass ? `失败分类 ${f.failureClass}` : '',
159
+ verdictText,
160
+ body ? `结论:${body}` : '',
161
+ ].filter(Boolean)
162
+
163
+ const evidence: ExperienceEvidence = {
164
+ taskIds: [f.taskId],
165
+ ...(f.intervention?.eventId ? { interventionEventId: f.intervention.eventId } : {}),
166
+ ...(f.intervention?.recipeRunId ? { recipeRunId: f.intervention.recipeRunId } : {}),
167
+ ...(f.intervention?.effect !== null && f.intervention?.effect !== undefined ? { metrics: { effect: f.intervention.effect } } : {}),
168
+ }
169
+
170
+ return {
171
+ title: `${completed ? '完成' : '未完成'}:${f.title}`,
172
+ content: segmentCJK((hasVerdict ? '' : ANECDOTAL) + parts.join(';')),
173
+ outcome,
174
+ status: scope.status,
175
+ scopeKind: scope.scopeKind,
176
+ scopeKey: scope.scopeKey,
177
+ importance: completed && !criteriaFailed ? 0.8 : 0.6,
178
+ sessionId: f.sessionId ?? '',
179
+ dedupKey: `exp:task:${f.taskId}`,
180
+ evidence,
181
+ }
182
+ }
183
+
184
+ /** 蒸馏评审终态事实:通过=正向(带产出),驳回=负向教训 */
185
+ export function distillReviewFact(f: ReviewFact): DistilledExperience {
186
+ const approved = f.verdict === 'approved'
187
+ const scopeKind = (f.validityScope?.kind === 'line' || f.validityScope?.kind === 'product') ? f.validityScope.kind : null
188
+ const scopeKey = f.validityScope?.key ?? ''
189
+ const byScope = scopeKind && scopeKey ? scopeOf(scopeKind, scopeKey) : scopeOf('channel', '')
190
+ const parts = [
191
+ `项目成果评审 ${approved ? '通过' : '驳回'}:${f.title}`,
192
+ f.summary ? `结论:${f.summary.slice(0, 300)}` : '',
193
+ approved ? '可在作用域内复用该成果' : '该路径不可复用,需返工',
194
+ ].filter(Boolean)
195
+ const evidence: ExperienceEvidence = {
196
+ resultId: f.resultId,
197
+ ...(f.taskId ? { taskIds: [f.taskId] } : {}),
198
+ ...(f.traceId ? { traceId: f.traceId } : {}),
199
+ }
200
+ return {
201
+ title: `${approved ? '成果通过' : '成果驳回'}:${f.title}`,
202
+ content: segmentCJK(parts.join(';')),
203
+ outcome: approved ? 'positive' : 'negative',
204
+ status: byScope.status,
205
+ scopeKind: byScope.scopeKind,
206
+ scopeKey: byScope.scopeKey,
207
+ importance: approved ? 0.85 : 0.7,
208
+ sessionId: '',
209
+ dedupKey: `exp:review:${f.resultId}:${f.verdict}`,
210
+ evidence,
211
+ }
212
+ }
213
+
214
+ /**
215
+ * 蒸馏干预 verdict 事实(科学判定 → 可复用经验)。
216
+ * unassessed 不产生经验(无判定上下文,凭它沉淀等于凭噪声学习)。
217
+ */
218
+ export function distillInterventionFact(f: InterventionFact): DistilledExperience | null {
219
+ if (f.verdict === 'unassessed') return null
220
+ const change = [num(f.fromValue), num(f.toValue)].every(v => v !== null)
221
+ ? `${num(f.fromValue)}→${num(f.toValue)}`
222
+ : (f.hypothesis ?? '').slice(0, 80)
223
+ const effectText = num(f.effect)
224
+ const ciText = num(f.ciLow) !== null && num(f.ciHigh) !== null ? `CI[${num(f.ciLow)}, ${num(f.ciHigh)}]` : ''
225
+ const parts = [
226
+ `节点「${f.nodeName ?? '?'}」干预 ${change || '(无数值)'}`,
227
+ f.actualValue !== null && f.actualValue !== undefined ? `回读 ${num(f.actualValue)}` : '',
228
+ f.ack ? `ACK ${f.ack}` : '',
229
+ criterionText(f.criterion) ? `判据 ${criterionText(f.criterion)}` : '',
230
+ `判定 ${f.verdict}`,
231
+ effectText !== null ? `effect=${effectText}` : '',
232
+ ciText,
233
+ num(f.mde) !== null ? `MDE=${num(f.mde)}` : '',
234
+ ].filter(Boolean)
235
+
236
+ const positive = f.verdict === 'identifiable_effect' && (f.effect ?? 0) !== 0
237
+ const outcome = f.verdict === 'identifiable_effect'
238
+ ? (positive ? 'positive' as const : 'neutral' as const)
239
+ : f.verdict === 'no_resolvable_effect'
240
+ ? 'negative' as const
241
+ : 'unknown' as const
242
+ const metrics: Record<string, number> = {}
243
+ if (effectText !== null && f.effect !== null && f.effect !== undefined) metrics.effect = f.effect
244
+ if (typeof f.mde === 'number') metrics.mde = f.mde
245
+
246
+ const scope = scopeOf(f.lineId ? 'line' : 'channel', f.lineId ?? '')
247
+ const evidence: ExperienceEvidence = {
248
+ interventionEventId: f.eventId,
249
+ ...(f.recipeRunId ? { recipeRunId: f.recipeRunId } : {}),
250
+ ...(Object.keys(metrics).length > 0 ? { metrics } : {}),
251
+ ...(f.criterion ? { criterion: f.criterion } : {}),
252
+ }
253
+ return {
254
+ title: `干预判定 ${f.verdict}:${f.nodeName ?? '节点'}`,
255
+ content: segmentCJK(parts.join(';')),
256
+ outcome,
257
+ status: scope.status,
258
+ scopeKind: scope.scopeKind,
259
+ scopeKey: scope.scopeKey,
260
+ importance: f.verdict === 'identifiable_effect' ? 0.9 : 0.6,
261
+ sessionId: '',
262
+ dedupKey: `exp:int:${f.eventId}`,
263
+ evidence,
264
+ metrics,
265
+ }
266
+ }
267
+
268
+ /** 统一蒸馏入口(未知 source → null,防御性) */
269
+ export function distillExperience(fact: ExperienceFact): DistilledExperience | null {
270
+ switch (fact.source) {
271
+ case 'task': return distillTaskFact(fact)
272
+ case 'review': return distillReviewFact(fact)
273
+ case 'intervention': return distillInterventionFact(fact)
274
+ default: return null
275
+ }
276
+ }
277
+
278
+ export interface ReflectResult {
279
+ written: boolean
280
+ id?: string
281
+ dedupKey?: string
282
+ reason?: string
283
+ }
284
+
285
+ /**
286
+ * 蒸馏并落库(含向量化)。
287
+ * 失败不抛出:学习环故障绝不打断产线主链路(调用方已 try/catch,本层再兜一层)。
288
+ */
289
+ export async function reflectExperience(
290
+ repo: MemoryRepo,
291
+ embedder: EmbeddingProvider | null,
292
+ fact: ExperienceFact,
293
+ ): Promise<ReflectResult> {
294
+ const distilled = distillExperience(fact)
295
+ if (!distilled) return { written: false, reason: 'nothing-to-distill' }
296
+ try {
297
+ const { id } = repo.upsertExperience({
298
+ channelId: fact.channelId,
299
+ agentId: fact.agentId,
300
+ kind: 'experience',
301
+ title: distilled.title,
302
+ titleFts: segmentCJK(distilled.title),
303
+ content: distilled.content,
304
+ importance: distilled.importance,
305
+ taskId: fact.source === 'task' ? fact.taskId : (fact.source === 'review' ? fact.taskId ?? null : null),
306
+ sessionId: distilled.sessionId,
307
+ dedupKey: distilled.dedupKey,
308
+ outcome: distilled.outcome,
309
+ evidence: distilled.evidence,
310
+ scopeKind: distilled.scopeKind,
311
+ scopeKey: distilled.scopeKey,
312
+ status: distilled.status,
313
+ expiresAt: null,
314
+ })
315
+ await vectorizeMemory(repo, embedder, fact.channelId, fact.agentId, distilled.dedupKey, distilled.content)
316
+ return { written: true, id, dedupKey: distilled.dedupKey }
317
+ }
318
+ catch (err) {
319
+ return { written: false, reason: err instanceof Error ? err.message : String(err) }
320
+ }
321
+ }
@@ -29,6 +29,8 @@ export abstract class AgentMemoryState extends AgentMemoryContracts {
29
29
 
30
30
  /** scope 过滤:private 仅本人行;shared 仅本 channel 的 team 行;session 仅本人/本 channel 的当前会话行;auto 双域 */
31
31
  protected inScope(row: MemoryRow, scope: MemoryScope, sessionId?: string | null): boolean {
32
+ // RSI(WP-A3):retired 经验不参与任何档位检索/注入(过期或劣化回滚后的行只保留审计价值)
33
+ if (row.status === 'retired') return false
32
34
  const isTeam = row.agentId === TEAM_AGENT_ID
33
35
  if (isTeam && row.channelId !== this.opts.channelId) return false
34
36
  if (scope === 'session') {
@@ -23,6 +23,17 @@ export interface RecallOptions {
23
23
  sessionId?: string | null
24
24
  /** 任务关联集(自身+父+兄弟 ≤20):命中行终分 +RELATED_TASK_BOOST(任务需求驱动的相关性) */
25
25
  relatedTaskIds?: string[]
26
+ /**
27
+ * 作用域上下文(WP-A3):经验行 scopeKey 命中时加分(同产线 +0.2 / 同产品 +0.1)。
28
+ * 缺省由 repo.channelScope(channelId) 自动解析 lineId(channels.line_id)。
29
+ */
30
+ scopeContext?: ScopeContext
31
+ }
32
+
33
+ /** 作用域上下文(产线/产品锚点;null/空串 = 该维度不参与加分) */
34
+ export interface ScopeContext {
35
+ lineId?: string | null
36
+ productId?: string | null
26
37
  }
27
38
 
28
39
  /**
@@ -51,4 +62,9 @@ export interface MemorySnippet {
51
62
  sessionId?: string | null
52
63
  rootId?: string | null
53
64
  visibility?: 'channel-shared' | 'private' | 'cross-channel'
65
+ /** RSI 经验元信息(WP-A3;非经验行缺省):极性 / 生命周期 / 作用域 */
66
+ outcome?: string
67
+ status?: string
68
+ scopeKind?: string
69
+ scopeKey?: string
54
70
  }
@@ -14,8 +14,27 @@ export abstract class AgentMemoryWrite extends AgentMemoryRecall {
14
14
  * Agent 主动沉淀(save_memory 工具):把作业过程中的可复用结论/经验写入记忆库。
15
15
  * scope='private' → 本人 semantic 域;scope='shared' → Channel 公共域(全员可检索;
16
16
  * dedupKey 按来源 Agent 命名空间隔离,避免多 Agent 同 key 互相覆盖)。写入后自动向量化。
17
+ *
18
+ * RSI(WP-A4)扩展:scope='line'|'global' → **经验条目**(kind=experience)。
19
+ * - 必须带 taskId 锚点(无锚点自述不配进跨频道经验层,fail-closed);
20
+ * - 需要会话 memoryPolicy='shared'(否则拒绝,不静默降级);
21
+ * - line 需要频道已绑定产线(scope_key=channels.line_id);
22
+ * - 一律 status='candidate'(先验证再晋级,ADR-7),outcome='unknown'。
17
23
  */
18
- async save(input: { title: string, content: string, importance?: number, scope: 'private' | 'shared', dedupKey?: string, sessionId?: string | null }): Promise<{ scope: 'private' | 'shared', dedupKey: string }> {
24
+ async save(input: {
25
+ title: string
26
+ content: string
27
+ importance?: number
28
+ scope: 'private' | 'shared' | 'line' | 'global'
29
+ dedupKey?: string
30
+ sessionId?: string | null
31
+ /** 跨频道经验的证据锚点(scope=line|global 必填) */
32
+ taskId?: string | null
33
+ }): Promise<{ scope: 'private' | 'shared' | 'line' | 'global', dedupKey: string }> {
34
+ if (input.scope === 'line' || input.scope === 'global') {
35
+ const expScope: 'line' | 'global' = input.scope
36
+ return this.saveExperience({ ...input, scope: expScope })
37
+ }
19
38
  const shared = input.scope === 'shared'
20
39
  const rawKey = input.dedupKey?.trim() || `agent-save:${randomUUID().slice(0, 8)}`
21
40
  // 共享域命名空间:同 channel 多 agent 各自的沉淀互不覆盖
@@ -95,6 +114,54 @@ export abstract class AgentMemoryWrite extends AgentMemoryRecall {
95
114
  return { scope: input.scope, dedupKey: finalKey }
96
115
  }
97
116
 
117
+ /**
118
+ * 跨频道经验写入(line/global 档;WP-A4)。
119
+ * 纪律:策略门(shared)→ 产线绑定门(line)→ 证据锚点门(taskId)→ 一律 candidate。
120
+ */
121
+ protected async saveExperience(input: {
122
+ title: string
123
+ content: string
124
+ importance?: number
125
+ scope: 'line' | 'global'
126
+ dedupKey?: string
127
+ sessionId?: string | null
128
+ taskId?: string | null
129
+ }): Promise<{ scope: 'line' | 'global', dedupKey: string }> {
130
+ const policy = this.repo.sessionMemoryPolicy(input.sessionId ?? '')
131
+ if (policy !== 'shared') {
132
+ throw new Error(`memory policy "${policy}" 不允许写入 ${input.scope} 作用域经验(需会话 memoryPolicy=shared)`)
133
+ }
134
+ if (!input.taskId) {
135
+ throw new Error(`${input.scope} 作用域经验必须带 taskId 锚点(无证据的自述不进入跨频道经验层)`)
136
+ }
137
+ let scopeKey = ''
138
+ if (input.scope === 'line') {
139
+ scopeKey = this.repo.channelScope(this.opts.channelId).lineId ?? ''
140
+ if (!scopeKey) throw new Error('line 作用域经验需要频道已绑定产线(channels.line_id 为空)')
141
+ }
142
+ const rawKey = input.dedupKey?.trim() || `agent-save:${randomUUID().slice(0, 8)}`
143
+ const dedupKey = `exp:${input.scope}:${this.opts.agentId}:${rawKey}`
144
+ this.repo.upsertExperience({
145
+ channelId: this.opts.channelId,
146
+ agentId: this.opts.agentId,
147
+ kind: 'experience',
148
+ title: input.title,
149
+ titleFts: segmentCJK(input.title),
150
+ content: segmentCJK(input.content).slice(0, CONTENT_STORE_LIMIT),
151
+ importance: input.importance ?? 0.7,
152
+ taskId: input.taskId,
153
+ sessionId: input.sessionId ?? '',
154
+ dedupKey,
155
+ outcome: 'unknown',
156
+ evidence: { taskIds: [input.taskId] },
157
+ scopeKind: input.scope,
158
+ scopeKey,
159
+ status: 'candidate',
160
+ })
161
+ await vectorizeMemory(this.repo, this.embedder, this.opts.channelId, this.opts.agentId, dedupKey, input.content)
162
+ return { scope: input.scope, dedupKey }
163
+ }
164
+
98
165
  /** run 后(任务路径;仅终态调用):harvest TaskEngine 终态 + deliverable,并刷新 L0 简报 */
99
166
  async recordTaskOutcome(task: WorkspaceTask): Promise<void> {
100
167
  // 优先 deliverable/summary 命名成果;harness 任意命名(如 mock 的 result)兜底取全部成果