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,181 @@
1
+ /**
2
+ * 配方证据聚合(WP-D1)—— 把散在三处的效果证据按 recipeRunId 串成一条可机器读的链:
3
+ * dcw-runs(试验批次:参数快照/逐参 ACK) ←→ intervention_events(干预台账:verdict/effect/CI/MDE)
4
+ * ←→ analysis_reports(分析结论:recipe_run_id 外键)
5
+ *
6
+ * 为什么需要它:trial 回执里的 runId 只能靠 Agent 自觉"回访",效果指标与配方记录之间
7
+ * 没有外键级关联(审计发现的最大证据断层)。本模块提供单点只读聚合,供
8
+ * recipe_propose 上下文与经验反射复用。
9
+ */
10
+ import type { DatabaseSync } from 'node:sqlite'
11
+ import { getDcwController } from './dcw-controller'
12
+ import { getAmlRuntime } from '../aml/runtime'
13
+
14
+ /** 单个参数的下发/回读摘要(来自试验回执) */
15
+ export interface RecipeRunParamEvidence {
16
+ nodeId: string | null
17
+ value: number
18
+ ok: boolean
19
+ ack?: string
20
+ }
21
+
22
+ /** 一条试验批次的完整证据 */
23
+ export interface RecipeRunEvidence {
24
+ runId: string
25
+ recipeId: string
26
+ recipeName: string
27
+ recipeVersion: string
28
+ startedAt: string
29
+ endedAt: string | null
30
+ ackSummary: Record<string, number>
31
+ params: RecipeRunParamEvidence[]
32
+ /** 干预台账(该批次的下发记录与可辨识性判定) */
33
+ interventions: Array<{
34
+ eventId: string
35
+ nodeName: string
36
+ fromValue: number | null
37
+ toValue: number | null
38
+ actualValue: number | null
39
+ ack: string
40
+ path: string
41
+ verdict: string
42
+ effect: number | null
43
+ ciLow: number | null
44
+ ciHigh: number | null
45
+ mde: number | null
46
+ criterion: Record<string, unknown> | null
47
+ hypothesis: string
48
+ }>
49
+ /** 关联的分析报告(recipe_run_id 外键) */
50
+ reports: Array<{ id: string, title: string, summary: string, createdAt: string }>
51
+ /** 机器可读的成效结论(由 verdict 聚合,不猜测) */
52
+ outcome: 'improved' | 'no_effect' | 'inconclusive' | 'unassessed'
53
+ }
54
+
55
+ /** verdict → 成效结论(identifiable_effect 且 effect != 0 才算 improved) */
56
+ export function recipeRunOutcome(interventions: RecipeRunEvidence['interventions']): RecipeRunEvidence['outcome'] {
57
+ if (interventions.length === 0) return 'unassessed'
58
+ const withVerdict = interventions.filter(i => i.verdict !== 'pending')
59
+ if (withVerdict.length === 0) return 'unassessed'
60
+ if (withVerdict.some(i => i.verdict === 'identifiable_effect' && (i.effect ?? 0) !== 0)) return 'improved'
61
+ if (withVerdict.some(i => i.verdict === 'no_resolvable_effect')) return 'no_effect'
62
+ return 'inconclusive'
63
+ }
64
+
65
+ function parseCriterion(raw: string | null): Record<string, unknown> | null {
66
+ if (!raw) return null
67
+ try {
68
+ const v = JSON.parse(raw) as unknown
69
+ return v && typeof v === 'object' && !Array.isArray(v) ? v as Record<string, unknown> : null
70
+ }
71
+ catch {
72
+ return null
73
+ }
74
+ }
75
+
76
+ /**
77
+ * 按 recipeId 取最近 N 个批次的证据链(默认 3 个)。
78
+ * 数据面:dcw controller 的 run 列表(JSON 文件仓储,权威运行态)+ 平台库台账。
79
+ * 失败不抛:返回空数组(学习环绝不阻断配方工具)。
80
+ */
81
+ export function getRecipeEvidence(db: DatabaseSync, recipeId: string, opts: { limit?: number } = {}): RecipeRunEvidence[] {
82
+ if (!recipeId) return []
83
+ const limit = Math.min(Math.max(opts.limit ?? 3, 1), 10)
84
+ try {
85
+ const ctrl = getDcwController()
86
+ // repo 按创建顺序 append(旧→新);取最近 limit 个,输出按时间倒序(最新在前)
87
+ const runs = ctrl.listRuns()
88
+ .filter(r => r.recipeId === recipeId)
89
+ .sort((a, b) => b.startedAt.localeCompare(a.startedAt))
90
+ .slice(0, limit)
91
+ return runs.map((run) => {
92
+ const interventions = db.prepare(
93
+ `SELECT id, node_name, from_value, to_value, actual_value, ack, path, verdict, effect, ci_low, ci_high, mde, criterion_json, hypothesis
94
+ FROM intervention_events WHERE recipe_run_id = ? ORDER BY ts ASC`,
95
+ ).all(run.id) as Array<{
96
+ id: string
97
+ node_name: string
98
+ from_value: number | null
99
+ to_value: number | null
100
+ actual_value: number | null
101
+ ack: string
102
+ path: string
103
+ verdict: string
104
+ effect: number | null
105
+ ci_low: number | null
106
+ ci_high: number | null
107
+ mde: number | null
108
+ criterion_json: string | null
109
+ hypothesis: string
110
+ }>
111
+ const reports = db.prepare(
112
+ `SELECT id, title, summary, created_at AS createdAt FROM analysis_reports WHERE recipe_run_id = ? ORDER BY created_at DESC`,
113
+ ).all(run.id) as Array<{ id: string, title: string, summary: string, createdAt: string }>
114
+ const mapped = interventions.map(i => ({
115
+ eventId: i.id,
116
+ nodeName: i.node_name,
117
+ fromValue: i.from_value,
118
+ toValue: i.to_value,
119
+ actualValue: i.actual_value,
120
+ ack: i.ack,
121
+ path: i.path,
122
+ verdict: i.verdict,
123
+ effect: i.effect,
124
+ ciLow: i.ci_low,
125
+ ciHigh: i.ci_high,
126
+ mde: i.mde,
127
+ criterion: parseCriterion(i.criterion_json),
128
+ hypothesis: i.hypothesis,
129
+ }))
130
+ return {
131
+ runId: run.id,
132
+ recipeId: run.recipeId,
133
+ recipeName: run.recipeName,
134
+ recipeVersion: String(run.recipeVersion ?? ''),
135
+ startedAt: run.startedAt,
136
+ endedAt: run.endedAt ?? null,
137
+ ackSummary: (run.ackSummary ?? {}) as unknown as Record<string, number>,
138
+ params: (run.results ?? []).map(r => ({ nodeId: r.nodeId, value: r.value, ok: r.ok, ack: r.ack })),
139
+ interventions: mapped,
140
+ reports,
141
+ outcome: recipeRunOutcome(mapped),
142
+ }
143
+ })
144
+ }
145
+ catch {
146
+ return []
147
+ }
148
+ }
149
+
150
+ /**
151
+ * 工具面便捷入口:按 recipeId 取证据链文本(失败返回空串)。
152
+ * db 取 AML 运行时(与平台库同一实例;配方工具运行期恒已装配)。
153
+ */
154
+ export function recipeEvidenceText(recipeId: string, opts: { limit?: number } = {}): string {
155
+ try {
156
+ return formatRecipeEvidence(getRecipeEvidence(getAmlRuntime().db, recipeId, opts))
157
+ }
158
+ catch {
159
+ return ''
160
+ }
161
+ }
162
+
163
+ /**
164
+ * 证据链渲染为工具上下文文本(recipe_propose / recipe_trial 复用)。
165
+ * 每条批次一段:批次头 + 成效结论 + 干预判定 + 关联分析。
166
+ */
167
+ export function formatRecipeEvidence(evidence: RecipeRunEvidence[]): string {
168
+ if (evidence.length === 0) return ''
169
+ const lines: string[] = ['## 配方证据链(按批次;成效结论由 verdict 聚合,非 Agent 自述)']
170
+ for (const e of evidence) {
171
+ const ack = Object.entries(e.ackSummary ?? {}).map(([k, v]) => `${k}=${v}`).join(' ')
172
+ lines.push(`- 批次 ${e.runId}(${e.startedAt.slice(0, 16).replace('T', ' ')}${e.endedAt ? ` ~ ${e.endedAt.slice(0, 16).replace('T', ' ')}` : ''})成效=${e.outcome}${ack ? ` · ACK ${ack}` : ''}`)
173
+ for (const i of e.interventions) {
174
+ const ci = i.ciLow !== null && i.ciHigh !== null ? ` CI[${i.ciLow}, ${i.ciHigh}]` : ''
175
+ const eff = i.effect !== null ? ` effect=${i.effect}` : ''
176
+ lines.push(` · ${i.nodeName} ${i.fromValue ?? '?'}→${i.toValue ?? '?'} 回读=${i.actualValue ?? '?'} ACK=${i.ack} 判定=${i.verdict}${eff}${ci}${i.mde !== null ? ` MDE=${i.mde}` : ''}`)
177
+ }
178
+ for (const r of e.reports) lines.push(` · 分析「${r.title}」${r.summary.slice(0, 60)}`)
179
+ }
180
+ return lines.join('\n')
181
+ }
@@ -0,0 +1,135 @@
1
+ /**
2
+ * 学习性护栏提示(WP-C2)—— advisory 层。
3
+ *
4
+ * 来源:**被拒的治理动作**(write_intent 审批驳回 / HITL 拒绝 / 设备 ACK 未证实)。
5
+ * 这些是"系统明确说过不行"的事实,归纳成 ≤3 条提示注入 prompt,降低重复踩坑。
6
+ *
7
+ * 纪律(与 Harness²/DBR 对齐):
8
+ * - **advisory only**:执行闸门(write_intent/HITL/回读/限界)一行不改,本层只影响提示;
9
+ * - 硬预算:≤3 条、≤200 tok(estimateTokens 口径),且不同时挤占记忆注入预算;
10
+ * - sanitizer:剥掉工具调用语法/代码块/引号内命令,防提示注入把"提示"变成"指令";
11
+ * - 30 天保鲜:过期的教训不再注入(工况会变,旧教条有害)。
12
+ */
13
+ import type { DatabaseSync } from 'node:sqlite'
14
+ import { estimateTokens } from '../runtime/memory/helpers'
15
+
16
+ /** advisory 硬预算(代码常量;改动走评审) */
17
+ export const ADVISORY = {
18
+ maxItems: 3,
19
+ maxTokens: 200,
20
+ freshDays: 30,
21
+ } as const
22
+
23
+ export interface AdvisoryItem {
24
+ /** 来源:审批驳回 / HITL 拒绝 / ACK 未证实 */
25
+ source: 'approval' | 'hitl' | 'ack'
26
+ /** 归纳后的提示行(已 sanitize) */
27
+ text: string
28
+ }
29
+
30
+ /** 危险模式:工具调用语法 / 代码块 / 指令性前缀 —— 一律剥离 */
31
+ const DANGER_PATTERNS: RegExp[] = [
32
+ /```[\s\S]*?```/g,
33
+ /\b[a-z][a-z0-9_]{2,}\s*\([^)]*\)/gi, // fn(...)
34
+ /\btool\s*[:=]\s*\S*/gi,
35
+ /\{\s*"[^"]+"\s*:/g, // JSON 片段
36
+ /<\s*\/?\s*[a-z][^>]*>/gi, // 伪标签
37
+ ]
38
+
39
+ /** 指令性语气降级:把命令句改写成经验陈述(保留信息,不保留祈使) */
40
+ const IMPERATIVE: Array<[RegExp, string]> = [
41
+ [/^\s*(请|必须|务必|立即|不要|禁止|切勿)\s*/g, ''],
42
+ [/\s*(请|必须|务必|立即)\s*(调用|执行|下发|写入)/g, ' 避免 $2'],
43
+ ]
44
+
45
+ /** sanitize 单条提示:剥危险语法 + 归一空白 + 截断 */
46
+ export function sanitizeAdvisory(raw: string, maxChars = 120): string {
47
+ let text = String(raw ?? '')
48
+ for (const re of DANGER_PATTERNS) text = text.replace(re, ' ')
49
+ for (const [re, rep] of IMPERATIVE) text = text.replace(re, rep)
50
+ text = text.replace(/\s+/g, ' ').trim()
51
+ if (text.length > maxChars) text = `${text.slice(0, maxChars - 1)}…`
52
+ return text
53
+ }
54
+
55
+ /**
56
+ * 采集本频道的被拒事实(只读,30 天窗口)。
57
+ * - project_approvals(kind='write_intent', status='rejected') → decision_reason
58
+ * - hitl_requests(status='rejected') → title/detail
59
+ * - intervention_events(ack IN ('unverified','transport-ack')) → 节点名 + 原因
60
+ */
61
+ export function collectAdvisories(db: DatabaseSync, channelId: string, now = new Date()): AdvisoryItem[] {
62
+ const since = new Date(now.getTime() - ADVISORY.freshDays * 86_400_000).toISOString()
63
+ const items: AdvisoryItem[] = []
64
+ try {
65
+ // project_approvals 无 channel 列 → 经 projects.office_channel_id 收窄(防跨频道串味)
66
+ const approvals = db.prepare(
67
+ `SELECT a.decision_reason AS reason
68
+ FROM project_approvals a JOIN projects p ON p.id = a.project_id
69
+ WHERE a.kind = 'write_intent' AND a.status = 'rejected' AND a.created_at >= ?
70
+ AND p.office_channel_id = ?
71
+ ORDER BY a.decided_at DESC LIMIT 10`,
72
+ ).all(since, channelId) as Array<{ reason: string }>
73
+ for (const a of approvals) {
74
+ const text = sanitizeAdvisory(a.reason || '写入意图被驳回(未附原因)')
75
+ if (text) items.push({ source: 'approval', text: `写入审批被驳回:${text}` })
76
+ }
77
+ }
78
+ catch { /* 表/列缺失或旧库:跳过 */ }
79
+ try {
80
+ const hitl = db.prepare(
81
+ `SELECT title, detail FROM hitl_requests
82
+ WHERE channel_id = ? AND status = 'rejected' AND created_at >= ?
83
+ ORDER BY created_at DESC LIMIT 10`,
84
+ ).all(channelId, since) as Array<{ title: string, detail: string }>
85
+ for (const h of hitl) {
86
+ const text = sanitizeAdvisory(h.detail || h.title || '人工拒绝了本次操作')
87
+ if (text) items.push({ source: 'hitl', text: `人工拒绝:${text}` })
88
+ }
89
+ }
90
+ catch { /* 同上 */ }
91
+ try {
92
+ const acks = db.prepare(
93
+ `SELECT node_name AS nodeName, ack FROM intervention_events
94
+ WHERE channel_id = ? AND ack IN ('unverified', 'transport-ack') AND ts >= ?
95
+ ORDER BY ts DESC LIMIT 10`,
96
+ ).all(channelId, since) as Array<{ nodeName: string, ack: string }>
97
+ for (const a of acks) {
98
+ const text = sanitizeAdvisory(`节点「${a.nodeName || '?'}」写入仅链路受理/未证实(ACK=${a.ack}),复测后再判读`)
99
+ if (text) items.push({ source: 'ack', text })
100
+ }
101
+ }
102
+ catch { /* 同上 */ }
103
+ return items
104
+ }
105
+
106
+ /**
107
+ * 生成注入块(≤3 条 / ≤200 tok)。
108
+ * 去重(同文案只留一条)+ 按来源优先级(审批/HITL 的事实强于 ACK)+ 预算截断。
109
+ * 空集返回 ''(prompt 零改动)。
110
+ */
111
+ export function advisoryBlock(db: DatabaseSync, channelId: string, opts: { now?: Date } = {}): string {
112
+ const items = collectAdvisories(db, channelId, opts.now)
113
+ if (items.length === 0) return ''
114
+ const seen = new Set<string>()
115
+ const picked: string[] = []
116
+ for (const item of items) {
117
+ if (seen.has(item.text)) continue
118
+ seen.add(item.text)
119
+ picked.push(item.text)
120
+ if (picked.length >= ADVISORY.maxItems) break
121
+ }
122
+ if (picked.length === 0) return ''
123
+ const head = '## 操作提示(advisory:来自被驳回/未证实的操作,执行闸门不变)'
124
+ const lines: string[] = []
125
+ let used = estimateTokens(head)
126
+ for (const text of picked) {
127
+ const line = `- ${text}`
128
+ const cost = estimateTokens(line)
129
+ if (used + cost > ADVISORY.maxTokens) break
130
+ used += cost
131
+ lines.push(line)
132
+ }
133
+ if (lines.length === 0) return ''
134
+ return [head, ...lines].join('\n')
135
+ }
@@ -0,0 +1,150 @@
1
+ /**
2
+ * 经验/Profile 晋升门(WP-B3/B4)—— 把「候选」变「已验证」的确定性判定。
3
+ *
4
+ * 纪律(对齐 aml/twin/acceptance.ts 的既有口径):
5
+ * - 阈值是**代码常量**,改阈值必须走代码评审(禁止运行时参数);
6
+ * - 门只做判定,不执行写:状态迁移由 REST(owner/admin 人工触发)或 bench 晋升驱动;
7
+ * - 判定拒绝时返回可读理由(谁不满足、差多少),不做"静默通过"。
8
+ */
9
+ import type { MemoryRow } from '../db/database'
10
+ import type { HarnessProfileRow } from './harness-profile'
11
+
12
+ /** 经验晋级阈值(代码常量;改动走评审) */
13
+ export const EXPERIENCE_GATE = {
14
+ /** 晋级 validated 所需的独立任务样本(证据里 taskIds 去重数) */
15
+ minIndependentTasks: 2,
16
+ /** 晋级的证据锚点最低数(任一锚点) */
17
+ minAnchors: 1,
18
+ /** contested 永不自动晋级 */
19
+ contestedBlocksPromotion: true,
20
+ } as const
21
+
22
+ /** Profile 晋升阈值(bench 结果由 WP-B2 产出后传入;缺 bench 数据 → 不得登 shadow) */
23
+ export const PROFILE_GATE = {
24
+ /** shadow → active 需要配对显著性(p < 0.05)或"无回归 + 成本非劣" */
25
+ significanceP: 0.05,
26
+ maxCostDelta: 0.05,
27
+ } as const
28
+
29
+ export interface GateDecision<S extends string> {
30
+ allowed: boolean
31
+ next?: S
32
+ reasons: string[]
33
+ }
34
+
35
+ /** 解析证据 JSON(失败 → 空对象;门按"无锚点"处理) */
36
+ export function evidenceOf(row: Pick<MemoryRow, 'evidenceJson'>): {
37
+ taskIds: string[]
38
+ anchors: string[]
39
+ metrics?: Record<string, number>
40
+ } {
41
+ let obj: Record<string, unknown> = {}
42
+ try {
43
+ const parsed = JSON.parse(row.evidenceJson ?? '{}') as unknown
44
+ if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) obj = parsed as Record<string, unknown>
45
+ }
46
+ catch {
47
+ obj = {}
48
+ }
49
+ const taskIds = Array.isArray(obj.taskIds) ? (obj.taskIds as unknown[]).filter((x): x is string => typeof x === 'string' && x.length > 0) : []
50
+ const anchors = ['traceId', 'runId', 'recipeRunId', 'interventionEventId', 'resultId']
51
+ .filter(k => typeof obj[k] === 'string' && (obj[k] as string).length > 0)
52
+ return {
53
+ taskIds: [...new Set(taskIds)],
54
+ anchors,
55
+ ...(obj.metrics && typeof obj.metrics === 'object' && !Array.isArray(obj.metrics)
56
+ ? { metrics: obj.metrics as Record<string, number> }
57
+ : {}),
58
+ }
59
+ }
60
+
61
+ /**
62
+ * 经验晋级判定(candidate → validated / → retired)。
63
+ * 规则:
64
+ * - retired:过期 或 outcome=negative 且无正向效应 → 允许退休;
65
+ * - validated:证据锚点齐 + 独立任务数 ≥ N + 非 contested;
66
+ * - 其余:拒绝并给出差多少。
67
+ */
68
+ export function evaluateExperienceGate(
69
+ row: Pick<MemoryRow, 'status' | 'outcome' | 'evidenceJson' | 'expiresAt'>,
70
+ target: 'validated' | 'retired',
71
+ nowIso = new Date().toISOString(),
72
+ ): GateDecision<'validated' | 'retired'> {
73
+ const status = row.status ?? 'active'
74
+ if (target === 'retired') {
75
+ if (status === 'retired') return { allowed: false, reasons: ['已经是 retired'] }
76
+ const expired = !!row.expiresAt && row.expiresAt <= nowIso
77
+ return { allowed: true, next: 'retired', reasons: [expired ? '已过期' : '人工退休'] }
78
+ }
79
+ // target === 'validated'
80
+ if (status === 'validated') return { allowed: false, reasons: ['已经是 validated'] }
81
+ if (status === 'retired') return { allowed: false, reasons: ['retired 不可复活(需新建条目)'] }
82
+ if (status === 'contested' && EXPERIENCE_GATE.contestedBlocksPromotion) {
83
+ return { allowed: false, reasons: ['contested(与既有条目矛盾)不得晋级'] }
84
+ }
85
+ const ev = evidenceOf(row)
86
+ const reasons: string[] = []
87
+ if (ev.taskIds.length + ev.anchors.length < EXPERIENCE_GATE.minAnchors) {
88
+ reasons.push('证据锚点缺失')
89
+ }
90
+ if (ev.taskIds.length < EXPERIENCE_GATE.minIndependentTasks) {
91
+ reasons.push(`独立任务样本不足:${ev.taskIds.length}/${EXPERIENCE_GATE.minIndependentTasks}`)
92
+ }
93
+ if (reasons.length > 0) return { allowed: false, reasons }
94
+ return { allowed: true, next: 'validated', reasons: [`证据充分(${ev.taskIds.length} 任务 / ${ev.anchors.length} 锚点)`] }
95
+ }
96
+
97
+ /** bench 配对结果(WP-B2 产出;门只消费结构化字段) */
98
+ export interface PairedBenchResult {
99
+ /** 主终点配对显著性(越小越好;无显著性检验时传 null) */
100
+ pValue: number | null
101
+ /** 相对基线的主终点改善(正=改善) */
102
+ primaryDelta: number
103
+ /** 相对基线的成本变化(正=更贵) */
104
+ costDelta: number
105
+ }
106
+
107
+ /**
108
+ * Profile 晋升判定(candidate → shadow → active)。
109
+ * candidate→shadow:允许(隔离验证期,只在本频道生效)。
110
+ * shadow→active:需配对结果通过(p<P 或 无回归且成本非劣)。
111
+ * active→superseded:由激活新版本隐式完成(B1 单 active 不变量)。
112
+ */
113
+ export function evaluateProfileGate(
114
+ profile: Pick<HarnessProfileRow, 'status' | 'version'>,
115
+ target: 'shadow' | 'active' | 'superseded',
116
+ bench?: PairedBenchResult | null,
117
+ ): GateDecision<'shadow' | 'active' | 'superseded'> {
118
+ const status = profile.status
119
+ if (target === 'shadow') {
120
+ if (status === 'shadow' || status === 'active') return { allowed: false, reasons: [`已处于 ${status}`] }
121
+ if (status === 'superseded') return { allowed: false, reasons: ['superseded 不可复活'] }
122
+ return { allowed: true, next: 'shadow', reasons: ['进入隔离验证期(仅本频道可见)'] }
123
+ }
124
+ if (target === 'active') {
125
+ if (status !== 'shadow') return { allowed: false, reasons: [`仅 shadow 可晋级 active(当前 ${status})`] }
126
+ if (!bench) return { allowed: false, reasons: ['缺少配对评测结果(WP-B2),不得晋级'] }
127
+ const significant = bench.pValue !== null && bench.pValue < PROFILE_GATE.significanceP && bench.primaryDelta > 0
128
+ const nonInferior = bench.primaryDelta >= 0 && bench.costDelta <= PROFILE_GATE.maxCostDelta
129
+ if (significant) return { allowed: true, next: 'active', reasons: [`配对显著改善 p=${bench.pValue}`] }
130
+ if (nonInferior) return { allowed: true, next: 'active', reasons: ['无回归且成本非劣'] }
131
+ return { allowed: false, reasons: [`配对未通过:p=${bench.pValue ?? 'n/a'} Δ主终点=${bench.primaryDelta} Δ成本=${bench.costDelta}`] }
132
+ }
133
+ // superseded
134
+ if (status === 'superseded') return { allowed: false, reasons: ['已 superseded'] }
135
+ return { allowed: true, next: 'superseded', reasons: ['被新 active 版本取代'] }
136
+ }
137
+
138
+ /**
139
+ * 回滚判定(WP-B4):当前 active 劣化 → 建议回退到上一版本。
140
+ * 纯函数:给定版本序列返回应激活的目标版本(无更早版本 → null)。
141
+ */
142
+ export function rollbackTarget(versions: Array<Pick<HarnessProfileRow, 'id' | 'version' | 'status'>>, currentActiveId: string): string | null {
143
+ const current = versions.find(v => v.id === currentActiveId)
144
+ if (!current) return null
145
+ // 回滚目标是「更早的任意版本」——superseded 正是被取代的前一版,必须可选(否则回滚永远为空)
146
+ const candidates = versions
147
+ .filter(v => v.version < current.version)
148
+ .sort((a, b) => b.version - a.version)
149
+ return candidates[0]?.id ?? null
150
+ }
@@ -0,0 +1,159 @@
1
+ /**
2
+ * Harness Profile 仓储与服务(WP-B1)—— per-Channel 的可进化外壳版本。
3
+ *
4
+ * v1 可进化层(ADR-5,刻意收窄):
5
+ * - `overlay`:外置 prompt 附加段(工程师/晋升门可审的纯文本,不执行、不调工具);
6
+ * - `pins`:指定经验条目 id(把「已验证经验」固定进该频道的专属提示段)。
7
+ * **不**含引擎配置(harness/llmJson)——那是部署面,错一次实例起不来。
8
+ *
9
+ * 生效规则:只有 status='active' 的版本被 prompt 装配读取;无 active 版本时
10
+ * 行为与现状**逐字节一致**(回归铁律)。
11
+ */
12
+ import { randomUUID } from 'node:crypto'
13
+ import type { DatabaseSync } from 'node:sqlite'
14
+
15
+ export type HarnessProfileStatus = 'candidate' | 'shadow' | 'active' | 'superseded'
16
+
17
+ export interface HarnessProfileLayers {
18
+ /** prompt 附加段(纯文本;注入时单独成段并带隔离声明) */
19
+ overlay?: string
20
+ /** 固定的经验条目 id(渲染为「已验证经验」要点行) */
21
+ pins?: string[]
22
+ }
23
+
24
+ export interface HarnessProfileRow {
25
+ id: string
26
+ channelId: string
27
+ version: number
28
+ status: HarnessProfileStatus
29
+ layers: HarnessProfileLayers
30
+ origin: Record<string, unknown>
31
+ createdBy: string
32
+ createdAt: string
33
+ updatedAt: string
34
+ }
35
+
36
+ export interface HarnessProfileCreateInput {
37
+ channelId: string
38
+ layers: HarnessProfileLayers
39
+ origin?: Record<string, unknown>
40
+ createdBy?: string
41
+ /** 初始状态(缺省 candidate;bench/门可显式建 shadow) */
42
+ status?: HarnessProfileStatus
43
+ }
44
+
45
+ const COLS = `id, channel_id AS channelId, version, status, layers_json AS layersJson,
46
+ origin_json AS originJson, created_by AS createdBy, created_at AS createdAt, updated_at AS updatedAt`
47
+
48
+ /** 单段 overlay 硬上限(防经验/overlay 挤爆注入预算;按字符计,约 200 tok 量级) */
49
+ export const OVERLAY_MAX_CHARS = 800
50
+ /** pins 上限(每条渲染一行,过多同样挤占预算) */
51
+ export const PINS_MAX = 5
52
+
53
+ function rowOf(r: Record<string, unknown>): HarnessProfileRow {
54
+ const parse = (raw: unknown): Record<string, unknown> => {
55
+ try {
56
+ const v = JSON.parse(String(raw ?? '{}')) as unknown
57
+ return v && typeof v === 'object' && !Array.isArray(v) ? v as Record<string, unknown> : {}
58
+ }
59
+ catch {
60
+ return {}
61
+ }
62
+ }
63
+ return {
64
+ id: String(r.id),
65
+ channelId: String(r.channelId),
66
+ version: Number(r.version),
67
+ status: String(r.status) as HarnessProfileStatus,
68
+ layers: parse(r.layersJson) as HarnessProfileLayers,
69
+ origin: parse(r.originJson),
70
+ createdBy: String(r.createdBy ?? ''),
71
+ createdAt: String(r.createdAt),
72
+ updatedAt: String(r.updatedAt),
73
+ }
74
+ }
75
+
76
+ export type HarnessProfileRepo = ReturnType<typeof createHarnessProfileRepo>
77
+
78
+ export function createHarnessProfileRepo(db: DatabaseSync) {
79
+ const insert = db.prepare(
80
+ `INSERT INTO channel_harness_profiles (id, channel_id, version, status, layers_json, origin_json, created_by, created_at, updated_at)
81
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`,
82
+ )
83
+ const maxVersion = db.prepare(`SELECT COALESCE(MAX(version), 0) AS v FROM channel_harness_profiles WHERE channel_id = ?`)
84
+ const list = db.prepare(`SELECT ${COLS} FROM channel_harness_profiles WHERE channel_id = ? ORDER BY version DESC LIMIT ?`)
85
+ const activeOne = db.prepare(`SELECT ${COLS} FROM channel_harness_profiles WHERE channel_id = ? AND status = 'active' ORDER BY version DESC LIMIT 1`)
86
+ const byId = db.prepare(`SELECT ${COLS} FROM channel_harness_profiles WHERE id = ?`)
87
+ const setStatus = db.prepare(`UPDATE channel_harness_profiles SET status = ?, updated_at = ? WHERE id = ?`)
88
+ const supersedeActive = db.prepare(
89
+ `UPDATE channel_harness_profiles SET status = 'superseded', updated_at = ? WHERE channel_id = ? AND status = 'active' AND id != ?`,
90
+ )
91
+
92
+ return {
93
+ /** 新建版本(版本号自增;overlay/pins 超限直接拒绝,不静默截断) */
94
+ create(input: HarnessProfileCreateInput): HarnessProfileRow {
95
+ const overlay = input.layers.overlay?.trim() ?? ''
96
+ if (overlay.length > OVERLAY_MAX_CHARS) {
97
+ throw new Error(`overlay 超限:${overlay.length} > ${OVERLAY_MAX_CHARS} 字符`)
98
+ }
99
+ const pins = [...new Set((input.layers.pins ?? []).filter(Boolean))]
100
+ if (pins.length > PINS_MAX) {
101
+ throw new Error(`pins 超限:${pins.length} > ${PINS_MAX} 条`)
102
+ }
103
+ const now = new Date().toISOString()
104
+ const id = `hp-${randomUUID().replace(/-/g, '').slice(0, 12)}`
105
+ const version = Number((maxVersion.get(input.channelId) as { v?: number } | undefined)?.v ?? 0) + 1
106
+ insert.run(
107
+ id, input.channelId, version, input.status ?? 'candidate',
108
+ JSON.stringify({ overlay, pins }), JSON.stringify(input.origin ?? {}),
109
+ input.createdBy ?? 'system', now, now,
110
+ )
111
+ return rowOf(byId.get(id) as Record<string, unknown>)
112
+ },
113
+
114
+ listByChannel(channelId: string, limit = 20): HarnessProfileRow[] {
115
+ return (list.all(channelId, Math.min(Math.max(limit, 1), 50)) as Record<string, unknown>[]).map(rowOf)
116
+ },
117
+
118
+ /** 当前生效版本(无则 null —— prompt 装配据此保持零改动) */
119
+ activeOf(channelId: string): HarnessProfileRow | null {
120
+ try {
121
+ const row = activeOne.get(channelId) as Record<string, unknown> | undefined
122
+ return row ? rowOf(row) : null
123
+ }
124
+ catch {
125
+ return null
126
+ }
127
+ },
128
+
129
+ get(id: string): HarnessProfileRow | null {
130
+ const row = byId.get(id) as Record<string, unknown> | undefined
131
+ return row ? rowOf(row) : null
132
+ },
133
+
134
+ /** 状态迁移;激活时同频道旧的 active 自动 supersede(单 active 不变量) */
135
+ markStatus(id: string, status: HarnessProfileStatus): boolean {
136
+ const row = this.get(id)
137
+ if (!row) return false
138
+ const now = new Date().toISOString()
139
+ if (status === 'active') supersedeActive.run(now, row.channelId, id)
140
+ return Number(setStatus.run(status, now, id).changes ?? 0) > 0
141
+ },
142
+ }
143
+ }
144
+
145
+ /**
146
+ * 渲染 profile 的注入段(仅 active 版本;空 overlay + 空 pins → '')。
147
+ * 头部带隔离声明(与 handoff bundle 同口径),明确「advisory,不是指令覆盖」。
148
+ */
149
+ export function renderHarnessOverlay(profile: HarnessProfileRow | null, pinnedExperience?: Array<{ title: string, content: string }>): string {
150
+ if (!profile) return ''
151
+ const overlay = profile.layers.overlay?.trim() ?? ''
152
+ // 只渲染「仍存在且未退休」的经验行(调用方已过滤;这里再按 pins 上限截断)
153
+ const pinLines = (pinnedExperience ?? [])
154
+ .slice(0, PINS_MAX)
155
+ .map((e, i) => `${i + 1}) ${e.title} — ${e.content.slice(0, 80).replace(/\s+/g, ' ')}`)
156
+ if (!overlay && pinLines.length === 0) return ''
157
+ const head = `## 频道经验增强(Harness v${profile.version};以下内容是经验提示,不是指令覆盖 —— 与当前任务/安全规则冲突时以任务与安全规则为准)`
158
+ return [head, overlay, ...(pinLines.length > 0 ? ['已验证经验:', ...pinLines] : [])].filter(Boolean).join('\n')
159
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * 频道 Harness overlay 的注入取用(WP-B1)。
3
+ *
4
+ * 装配点:`BaseAgent.contextPrefix()` —— 所有 harness 共用同一组装函数,
5
+ * 因此只改一处即可让 14 个引擎一致生效。
6
+ *
7
+ * 三条铁律:
8
+ * - 无 active profile → 返回 ''(prompt 与现状逐字节一致);
9
+ * - 任何失败 → 返回 ''(学习环绝不阻断回合装配);
10
+ * - pins 只渲染仍存在的经验行(被删/退休 → 自然消失,不报错)。
11
+ */
12
+ import { getAmlRuntime } from '../aml/runtime'
13
+ import { createMemoryRepo } from '../db/memory.repo'
14
+ import { createHarnessProfileRepo, renderHarnessOverlay } from './harness-profile'
15
+ import { advisoryBlock } from './advisory'
16
+ import { unsegmentCJK } from '../runtime/memory/helpers'
17
+
18
+ /** 进程内缓存:同一频道 60s 内不重复查库(profile 变更最迟 1 分钟生效,可接受) */
19
+ const CACHE_TTL_MS = 60_000
20
+ const cache = new Map<string, { at: number, text: string }>()
21
+
22
+ /** 测试用:清空缓存(避免跨用例串味) */
23
+ export function resetHarnessOverlayCache(): void {
24
+ cache.clear()
25
+ }
26
+
27
+ export function channelOverlayText(channelId: string): string {
28
+ if (!channelId) return ''
29
+ const hit = cache.get(channelId)
30
+ if (hit && Date.now() - hit.at < CACHE_TTL_MS) return hit.text
31
+ let text: string
32
+ try {
33
+ const db = getAmlRuntime().db
34
+ const profile = createHarnessProfileRepo(db).activeOf(channelId)
35
+ const parts: string[] = []
36
+ if (profile) {
37
+ const memRepo = createMemoryRepo(db)
38
+ const pinned = (profile.layers.pins ?? [])
39
+ .map(id => memRepo.getById(id))
40
+ .filter((r): r is NonNullable<typeof r> => !!r && r.status !== 'retired')
41
+ .map(r => ({ title: r.title, content: unsegmentCJK(r.content) }))
42
+ const rendered = renderHarnessOverlay(profile, pinned)
43
+ if (rendered) parts.push(rendered)
44
+ }
45
+ // WP-C2:学习性护栏提示(advisory;≤3 条/≤200 tok;与被拒事实挂钩)
46
+ const advisory = advisoryBlock(db, channelId)
47
+ if (advisory) parts.push(advisory)
48
+ text = parts.join('\n\n')
49
+ }
50
+ catch {
51
+ text = ''
52
+ }
53
+ cache.set(channelId, { at: Date.now(), text })
54
+ return text
55
+ }