agentworkshop 0.13.0 → 0.14.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 (1049) hide show
  1. package/.output/.AgentWorkShop/aml-python/train-example.py +92 -92
  2. package/.output/nitro.json +1 -1
  3. package/.output/public/_nuxt/{Cy0eCUDp.js → B5KL6Ibd.js} +7 -7
  4. package/.output/public/_nuxt/{CcUK7VEO.js → BEkXmA1q.js} +1 -1
  5. package/.output/public/_nuxt/{BhEXWepB2.js → BhXOXzn62.js} +3 -3
  6. package/.output/public/_nuxt/{tDcrlXNq2.js → Budz_Xqj2.js} +1 -1
  7. package/.output/public/_nuxt/{WL1R8lPA.js → C-fzyZIR.js} +1 -1
  8. package/.output/public/_nuxt/{DvsXN5k72.js → CDkD5qXS2.js} +1 -1
  9. package/.output/public/_nuxt/{DkqV7BGi.js → CNBZIUPj.js} +1 -1
  10. package/.output/public/_nuxt/{B2-Wuy0u.js → CYRJE2AK.js} +1 -1
  11. package/.output/public/_nuxt/{DFo96EtE.js → Ce11XYqU.js} +1 -1
  12. package/.output/public/_nuxt/{DJKjjGnC2.js → Cn9We9Xy2.js} +1 -1
  13. package/.output/public/_nuxt/{BSoelv0a.js → DAXKnIk_.js} +1 -1
  14. package/.output/public/_nuxt/{CljTL3qL.js → DEUPXg3Y.js} +1 -1
  15. package/.output/public/_nuxt/{Dasqfjig2.js → DIgcvUmv2.js} +1 -1
  16. package/.output/public/_nuxt/{CsdezMu9.js → DIua0HEu.js} +5 -5
  17. package/.output/public/_nuxt/{psToi-Y5.js → DTJzL6Ce.js} +1 -1
  18. package/.output/public/_nuxt/{C3--I-an2.js → DrYBHPYn2.js} +1 -1
  19. package/.output/public/_nuxt/{OmpTerminalPanel.DJsn-0I7.css → OmpTerminalPanel.CoA7kG4C.css} +1 -1
  20. package/.output/public/_nuxt/PluginSlot.BqBzLD4T.css +1 -0
  21. package/.output/public/_nuxt/{TownView.CY9AeupT.css → TownView.CASu6sUI.css} +1 -1
  22. package/.output/public/_nuxt/{CmuGMxDP.js → TugRY_4O.js} +1 -1
  23. package/.output/public/_nuxt/{_id_.Czwkl50w.css → _id_.yoM542Bz.css} +1 -1
  24. package/.output/public/_nuxt/{_wsId_.zZS-8BeH.css → _wsId_.1Ai43iyE.css} +1 -1
  25. package/.output/public/_nuxt/{C-0XFiGd2.js → aFWYpex82.js} +1 -1
  26. package/.output/public/_nuxt/{agents.x7WDlalC.css → agents.BsyoIGhn.css} +1 -1
  27. package/.output/public/_nuxt/aml.DgOMpDpv.css +1 -0
  28. package/.output/public/_nuxt/builds/latest.json +1 -1
  29. package/.output/public/_nuxt/builds/meta/fa6e11b2-f4e7-42ac-9006-b3df9b6cf455.json +1 -0
  30. package/.output/public/_nuxt/{default.DJtNhtPB.css → default.Diue5wr2.css} +1 -1
  31. package/.output/public/_nuxt/{logs.DicAHMDv.css → logs.Dp8KWwBk.css} +1 -1
  32. package/.output/public/_nuxt/{monitor.CklbBi4c.css → monitor.DdpDx8NP.css} +1 -1
  33. package/.output/public/_nuxt/{ontology.CjBcnrC8.css → ontology.Clux6c4G.css} +1 -1
  34. package/.output/public/_nuxt/{operations.D7nxVu6G.css → operations.Cng_qjn9.css} +1 -1
  35. package/.output/public/_nuxt/{pages.DHQhmiO9.css → pages.ilC7BTfG.css} +1 -1
  36. package/.output/public/_nuxt/{tokens.BDSUWF-L.css → tokens.DKZWCP5v.css} +1 -1
  37. package/.output/public/favicon.svg +14 -14
  38. package/.output/public/robots.txt +3 -3
  39. package/.output/server/chunks/_/bench-run.mjs +8 -4
  40. package/.output/server/chunks/_/bench-run.mjs.map +1 -1
  41. package/.output/server/chunks/_/nitro.mjs +3564 -3133
  42. package/.output/server/chunks/_/nitro.mjs.map +1 -1
  43. package/.output/server/chunks/_/promote.mjs +7 -1
  44. package/.output/server/chunks/_/promote.mjs.map +1 -1
  45. package/.output/server/chunks/build/{OmpTerminalPanel-BMOE0iKV.mjs → OmpTerminalPanel-DGOdjUKG.mjs} +8 -8
  46. package/.output/server/chunks/build/{OmpTerminalPanel-BMOE0iKV.mjs.map → OmpTerminalPanel-DGOdjUKG.mjs.map} +1 -1
  47. package/.output/server/chunks/build/{PluginSlot-DmxAklwb.mjs → PluginSlot-CGwo_Wf0.mjs} +4 -4
  48. package/.output/server/chunks/build/{PluginSlot-DmxAklwb.mjs.map → PluginSlot-CGwo_Wf0.mjs.map} +1 -1
  49. package/.output/server/chunks/build/{TownView-DD1zY8xq.mjs → TownView-CIs-ASV0.mjs} +20 -20
  50. package/.output/server/chunks/build/{TownView-DD1zY8xq.mjs.map → TownView-CIs-ASV0.mjs.map} +1 -1
  51. package/.output/server/chunks/build/{_id_-B9zi8WEg.mjs → _id_-8hYMEcPj.mjs} +95 -95
  52. package/.output/server/chunks/build/{_id_-B9zi8WEg.mjs.map → _id_-8hYMEcPj.mjs.map} +1 -1
  53. package/.output/server/chunks/build/{_id_-BB-OZCsp.mjs → _id_-CunRhZCq.mjs} +12 -12
  54. package/.output/server/chunks/build/{_id_-BB-OZCsp.mjs.map → _id_-CunRhZCq.mjs.map} +1 -1
  55. package/.output/server/chunks/build/{_id_-DLdvNP4J.mjs → _id_-DW3IQyTe.mjs} +1 -1
  56. package/.output/server/chunks/build/{_id_-DLdvNP4J.mjs.map → _id_-DW3IQyTe.mjs.map} +1 -1
  57. package/.output/server/chunks/build/{_wsId_-LDv5SEW_.mjs → _wsId_-ByUqzpvT.mjs} +187 -91
  58. package/.output/server/chunks/build/{_wsId_-LDv5SEW_.mjs.map → _wsId_-ByUqzpvT.mjs.map} +1 -1
  59. package/.output/server/chunks/build/{agents-DeRHs8c9.mjs → agents-B9dtbYwq.mjs} +10 -10
  60. package/.output/server/chunks/build/{agents-DeRHs8c9.mjs.map → agents-B9dtbYwq.mjs.map} +1 -1
  61. package/.output/server/chunks/build/{aml-DVcZDyvA.mjs → aml-ezsP2X2T.mjs} +98 -98
  62. package/.output/server/chunks/build/{aml-DVcZDyvA.mjs.map → aml-ezsP2X2T.mjs.map} +1 -1
  63. package/.output/server/chunks/build/{analysis-DQM-3YKP.mjs → analysis-DB7joxB_.mjs} +9 -9
  64. package/.output/server/chunks/build/{analysis-DQM-3YKP.mjs.map → analysis-DB7joxB_.mjs.map} +1 -1
  65. package/.output/server/chunks/build/{api-DbUqSbs2.mjs → api-CNgiGJ-n.mjs} +3 -3
  66. package/.output/server/chunks/build/{api-DbUqSbs2.mjs.map → api-CNgiGJ-n.mjs.map} +1 -1
  67. package/.output/server/chunks/build/{api-ByIV5jMN.mjs → api-CaQC12S4.mjs} +3 -3
  68. package/.output/server/chunks/build/{api-ByIV5jMN.mjs.map → api-CaQC12S4.mjs.map} +1 -1
  69. package/.output/server/chunks/build/{api-error-BwAQLw44.mjs → api-error-5fRWoNn3.mjs} +1 -1
  70. package/.output/server/chunks/build/{api-error-BwAQLw44.mjs.map → api-error-5fRWoNn3.mjs.map} +1 -1
  71. package/.output/server/chunks/build/{api-BQ9AQHv-.mjs → api-mAmCCaSy.mjs} +3 -3
  72. package/.output/server/chunks/build/{api-BQ9AQHv-.mjs.map → api-mAmCCaSy.mjs.map} +1 -1
  73. package/.output/server/chunks/build/{apiClient-Dl-8IHHL.mjs → apiClient-DyvJNNRd.mjs} +2 -2
  74. package/.output/server/chunks/build/{apiClient-Dl-8IHHL.mjs.map → apiClient-DyvJNNRd.mjs.map} +1 -1
  75. package/.output/server/chunks/build/{board-CKUuAY_Q.mjs → board-IQvGm0ak.mjs} +4 -4
  76. package/.output/server/chunks/build/{board-CKUuAY_Q.mjs.map → board-IQvGm0ak.mjs.map} +1 -1
  77. package/.output/server/chunks/build/{channel-templates-4Zdu0Eyr.mjs → channel-templates-BcmTFt3Z.mjs} +4 -4
  78. package/.output/server/chunks/build/{channel-templates-4Zdu0Eyr.mjs.map → channel-templates-BcmTFt3Z.mjs.map} +1 -1
  79. package/.output/server/chunks/build/{client-only-qNA2OVV_.mjs → client-only-HhHmV5L2.mjs} +1 -1
  80. package/.output/server/chunks/build/{client-only-qNA2OVV_.mjs.map → client-only-HhHmV5L2.mjs.map} +1 -1
  81. package/.output/server/chunks/build/{daq-B5zlUIlb.mjs → daq-BtcHXZsH.mjs} +14 -14
  82. package/.output/server/chunks/build/{daq-B5zlUIlb.mjs.map → daq-BtcHXZsH.mjs.map} +1 -1
  83. package/.output/server/chunks/build/{data-CdyujjU3.mjs → data-JhBFKJDA.mjs} +2 -2
  84. package/.output/server/chunks/build/{data-CdyujjU3.mjs.map → data-JhBFKJDA.mjs.map} +1 -1
  85. package/.output/server/chunks/build/{dcw-B-eoU7sq.mjs → dcw-DM_WZyz_.mjs} +10 -10
  86. package/.output/server/chunks/build/{dcw-B-eoU7sq.mjs.map → dcw-DM_WZyz_.mjs.map} +1 -1
  87. package/.output/server/chunks/build/{default-Bbyb2qEG.mjs → default-4m4XnpDt.mjs} +28 -28
  88. package/.output/server/chunks/build/{default-Bbyb2qEG.mjs.map → default-4m4XnpDt.mjs.map} +1 -1
  89. package/.output/server/chunks/build/{hitl-B-0NShlx.mjs → hitl-DY7FeN1f.mjs} +2 -2
  90. package/.output/server/chunks/build/{hitl-B-0NShlx.mjs.map → hitl-DY7FeN1f.mjs.map} +1 -1
  91. package/.output/server/chunks/build/{interval-DvHBIIZh.mjs → interval-Di_y-Apg.mjs} +1 -1
  92. package/.output/server/chunks/build/{interval-DvHBIIZh.mjs.map → interval-Di_y-Apg.mjs.map} +1 -1
  93. package/.output/server/chunks/build/{logs-ByxK-myz.mjs → logs-lGNg1Ob6.mjs} +13 -13
  94. package/.output/server/chunks/build/{logs-ByxK-myz.mjs.map → logs-lGNg1Ob6.mjs.map} +1 -1
  95. package/.output/server/chunks/build/{monitor-BWd4h4K9.mjs → monitor-CySt7XKY.mjs} +35 -35
  96. package/.output/server/chunks/build/{monitor-BWd4h4K9.mjs.map → monitor-CySt7XKY.mjs.map} +1 -1
  97. package/.output/server/chunks/build/{ontology-C3WzgG5p.mjs → ontology-3K7B6xnD.mjs} +12 -12
  98. package/.output/server/chunks/build/{ontology-C3WzgG5p.mjs.map → ontology-3K7B6xnD.mjs.map} +1 -1
  99. package/.output/server/chunks/build/{operations-tE63Vy9Z.mjs → operations-D_1Qp6MR.mjs} +19 -19
  100. package/.output/server/chunks/build/{operations-tE63Vy9Z.mjs.map → operations-D_1Qp6MR.mjs.map} +1 -1
  101. package/.output/server/chunks/build/{optimizer-A6UyksVT.mjs → optimizer-BXF9x406.mjs} +4 -4
  102. package/.output/server/chunks/build/{optimizer-A6UyksVT.mjs.map → optimizer-BXF9x406.mjs.map} +1 -1
  103. package/.output/server/chunks/build/{pages-D-cFfP_K.mjs → pages-GV_BTwNx.mjs} +19 -19
  104. package/.output/server/chunks/build/{pages-D-cFfP_K.mjs.map → pages-GV_BTwNx.mjs.map} +1 -1
  105. package/.output/server/chunks/build/{permissions-44GsBS_4.mjs → permissions-Cw0vl9oB.mjs} +2 -2
  106. package/.output/server/chunks/build/{permissions-44GsBS_4.mjs.map → permissions-Cw0vl9oB.mjs.map} +1 -1
  107. package/.output/server/chunks/build/{pipeline-B2TDdGx6.mjs → pipeline-DFAdcH6G.mjs} +4 -4
  108. package/.output/server/chunks/build/{pipeline-B2TDdGx6.mjs.map → pipeline-DFAdcH6G.mjs.map} +1 -1
  109. package/.output/server/chunks/build/{plugins-CfVTAFbT.mjs → plugins-DHYkylxk.mjs} +3 -3
  110. package/.output/server/chunks/build/{plugins-CfVTAFbT.mjs.map → plugins-DHYkylxk.mjs.map} +1 -1
  111. package/.output/server/chunks/build/{projects-taoNPGqx.mjs → projects-C7wHfJhz.mjs} +1 -1
  112. package/.output/server/chunks/build/{projects-taoNPGqx.mjs.map → projects-C7wHfJhz.mjs.map} +1 -1
  113. package/.output/server/chunks/build/{schedules-DnHxYWcd.mjs → schedules-hbbkb2k_.mjs} +3 -3
  114. package/.output/server/chunks/build/{schedules-DnHxYWcd.mjs.map → schedules-hbbkb2k_.mjs.map} +1 -1
  115. package/.output/server/chunks/build/{settings-CLIR9BQz.mjs → settings-BI9az0t8.mjs} +5 -5
  116. package/.output/server/chunks/build/{settings-CLIR9BQz.mjs.map → settings-BI9az0t8.mjs.map} +1 -1
  117. package/.output/server/chunks/build/{studio-CB0a63bK.mjs → studio-C1TA240D.mjs} +4 -4
  118. package/.output/server/chunks/build/{studio-CB0a63bK.mjs.map → studio-C1TA240D.mjs.map} +1 -1
  119. package/.output/server/chunks/build/{teams-DkwgH6Ab.mjs → teams-Cqe-XytC.mjs} +10 -10
  120. package/.output/server/chunks/build/{teams-DkwgH6Ab.mjs.map → teams-Cqe-XytC.mjs.map} +1 -1
  121. package/.output/server/chunks/build/{tokens-yzJOx8lm.mjs → tokens-BRNoXKeS.mjs} +12 -12
  122. package/.output/server/chunks/build/{tokens-yzJOx8lm.mjs.map → tokens-BRNoXKeS.mjs.map} +1 -1
  123. package/.output/server/chunks/build/{tools-Bd7u9FCc.mjs → tools-seI8h6cT.mjs} +3 -3
  124. package/.output/server/chunks/build/{tools-Bd7u9FCc.mjs.map → tools-seI8h6cT.mjs.map} +1 -1
  125. package/.output/server/chunks/build/{town-CyJy_4k5.mjs → town-7mjCZbHa.mjs} +11 -11
  126. package/.output/server/chunks/build/{town-CyJy_4k5.mjs.map → town-7mjCZbHa.mjs.map} +1 -1
  127. package/.output/server/chunks/build/{useAgentHarnessOptions-BkPrqFxg.mjs → useAgentHarnessOptions-BBywiyFz.mjs} +2 -2
  128. package/.output/server/chunks/build/{useAgentHarnessOptions-BkPrqFxg.mjs.map → useAgentHarnessOptions-BBywiyFz.mjs.map} +1 -1
  129. package/.output/server/chunks/build/{useAgentTemplateActions-BftyRRwI.mjs → useAgentTemplateActions-DIfbFIeB.mjs} +3 -3
  130. package/.output/server/chunks/build/{useAgentTemplateActions-BftyRRwI.mjs.map → useAgentTemplateActions-DIfbFIeB.mjs.map} +1 -1
  131. package/.output/server/chunks/build/{useAgentTemplateForm-D7NAXZ59.mjs → useAgentTemplateForm-CNrBkoCe.mjs} +3 -3
  132. package/.output/server/chunks/build/{useAgentTemplateForm-D7NAXZ59.mjs.map → useAgentTemplateForm-CNrBkoCe.mjs.map} +1 -1
  133. package/.output/server/chunks/build/{useAgentTemplatesCatalog-DnqTc0oL.mjs → useAgentTemplatesCatalog-cZwCOaMf.mjs} +2 -2
  134. package/.output/server/chunks/build/{useAgentTemplatesCatalog-DnqTc0oL.mjs.map → useAgentTemplatesCatalog-cZwCOaMf.mjs.map} +1 -1
  135. package/.output/server/chunks/build/{useAmlDatasets-Cr25p62c.mjs → useAmlDatasets-Bzx9Hgvy.mjs} +4 -4
  136. package/.output/server/chunks/build/{useAmlDatasets-Cr25p62c.mjs.map → useAmlDatasets-Bzx9Hgvy.mjs.map} +1 -1
  137. package/.output/server/chunks/build/{useAmlEntities-DBDpqmC3.mjs → useAmlEntities-D-0vyKYy.mjs} +4 -4
  138. package/.output/server/chunks/build/{useAmlEntities-DBDpqmC3.mjs.map → useAmlEntities-D-0vyKYy.mjs.map} +1 -1
  139. package/.output/server/chunks/build/{useAmlEnv-B94CxtjW.mjs → useAmlEnv-6s0jiG6P.mjs} +5 -5
  140. package/.output/server/chunks/build/{useAmlEnv-B94CxtjW.mjs.map → useAmlEnv-6s0jiG6P.mjs.map} +1 -1
  141. package/.output/server/chunks/build/{useAmlExperiments-B2HI1odc.mjs → useAmlExperiments-CDct2Fi9.mjs} +4 -4
  142. package/.output/server/chunks/build/{useAmlExperiments-B2HI1odc.mjs.map → useAmlExperiments-CDct2Fi9.mjs.map} +1 -1
  143. package/.output/server/chunks/build/{useAmlJobs-C-EheCdn.mjs → useAmlJobs-D9Awbb--.mjs} +5 -5
  144. package/.output/server/chunks/build/{useAmlJobs-C-EheCdn.mjs.map → useAmlJobs-D9Awbb--.mjs.map} +1 -1
  145. package/.output/server/chunks/build/{useAmlModels-BqWz2YoO.mjs → useAmlModels-C-XBnv_Y.mjs} +4 -4
  146. package/.output/server/chunks/build/{useAmlModels-BqWz2YoO.mjs.map → useAmlModels-C-XBnv_Y.mjs.map} +1 -1
  147. package/.output/server/chunks/build/{useAmlNotes-nRlk9fOE.mjs → useAmlNotes-Dlfao4VV.mjs} +4 -4
  148. package/.output/server/chunks/build/{useAmlNotes-nRlk9fOE.mjs.map → useAmlNotes-Dlfao4VV.mjs.map} +1 -1
  149. package/.output/server/chunks/build/{useAmlPredict-BQbSLob6.mjs → useAmlPredict-ukN3U9qx.mjs} +4 -4
  150. package/.output/server/chunks/build/{useAmlPredict-BQbSLob6.mjs.map → useAmlPredict-ukN3U9qx.mjs.map} +1 -1
  151. package/.output/server/chunks/build/{useAnalysisFeed-CzZmTTqq.mjs → useAnalysisFeed-CkUZTRH4.mjs} +3 -3
  152. package/.output/server/chunks/build/{useAnalysisFeed-CzZmTTqq.mjs.map → useAnalysisFeed-CkUZTRH4.mjs.map} +1 -1
  153. package/.output/server/chunks/build/{useDaqAddNode-Dr5CfMpU.mjs → useDaqAddNode-C39ycTVO.mjs} +4 -4
  154. package/.output/server/chunks/build/{useDaqAddNode-Dr5CfMpU.mjs.map → useDaqAddNode-C39ycTVO.mjs.map} +1 -1
  155. package/.output/server/chunks/build/{useDaqDetailBinding-BAAoyUdv.mjs → useDaqDetailBinding-W1IABCpN.mjs} +5 -5
  156. package/.output/server/chunks/build/{useDaqDetailBinding-BAAoyUdv.mjs.map → useDaqDetailBinding-W1IABCpN.mjs.map} +1 -1
  157. package/.output/server/chunks/build/{useDaqDetailFrames-4zuFL3Q5.mjs → useDaqDetailFrames-D4GgD2hM.mjs} +4 -4
  158. package/.output/server/chunks/build/{useDaqDetailFrames-4zuFL3Q5.mjs.map → useDaqDetailFrames-D4GgD2hM.mjs.map} +1 -1
  159. package/.output/server/chunks/build/{useDaqDetailHistory-CHrHfBOm.mjs → useDaqDetailHistory-CI9oS-7S.mjs} +4 -4
  160. package/.output/server/chunks/build/{useDaqDetailHistory-CHrHfBOm.mjs.map → useDaqDetailHistory-CI9oS-7S.mjs.map} +1 -1
  161. package/.output/server/chunks/build/{useDaqDetailNode-DDq5osE-.mjs → useDaqDetailNode-igTd232l.mjs} +6 -6
  162. package/.output/server/chunks/build/{useDaqDetailNode-DDq5osE-.mjs.map → useDaqDetailNode-igTd232l.mjs.map} +1 -1
  163. package/.output/server/chunks/build/{useDaqDetailParams-DdOcUvHG.mjs → useDaqDetailParams-CnjIfgfH.mjs} +4 -4
  164. package/.output/server/chunks/build/{useDaqDetailParams-DdOcUvHG.mjs.map → useDaqDetailParams-CnjIfgfH.mjs.map} +1 -1
  165. package/.output/server/chunks/build/{useDaqFilters-Y_NRhP6i.mjs → useDaqFilters-KBObkzwt.mjs} +6 -6
  166. package/.output/server/chunks/build/{useDaqFilters-Y_NRhP6i.mjs.map → useDaqFilters-KBObkzwt.mjs.map} +1 -1
  167. package/.output/server/chunks/build/{useDaqOptimizations-O4JdRYUR.mjs → useDaqOptimizations-D4hhy0HN.mjs} +4 -4
  168. package/.output/server/chunks/build/{useDaqOptimizations-O4JdRYUR.mjs.map → useDaqOptimizations-D4hhy0HN.mjs.map} +1 -1
  169. package/.output/server/chunks/build/{useDaqStream-phwM5tIN.mjs → useDaqStream-CbOC6kpc.mjs} +3 -3
  170. package/.output/server/chunks/build/{useDaqStream-phwM5tIN.mjs.map → useDaqStream-CbOC6kpc.mjs.map} +1 -1
  171. package/.output/server/chunks/build/{useDaqTemplates-lKw2b01d.mjs → useDaqTemplates-DlbjELnY.mjs} +4 -4
  172. package/.output/server/chunks/build/{useDaqTemplates-lKw2b01d.mjs.map → useDaqTemplates-DlbjELnY.mjs.map} +1 -1
  173. package/.output/server/chunks/build/{useDashboardData-BBBMb6v_.mjs → useDashboardData-ObuGQUn-.mjs} +6 -6
  174. package/.output/server/chunks/build/{useDashboardData-BBBMb6v_.mjs.map → useDashboardData-ObuGQUn-.mjs.map} +1 -1
  175. package/.output/server/chunks/build/{useDcwAddNode-CT-oOFom.mjs → useDcwAddNode-C2-oveXf.mjs} +4 -4
  176. package/.output/server/chunks/build/{useDcwAddNode-CT-oOFom.mjs.map → useDcwAddNode-C2-oveXf.mjs.map} +1 -1
  177. package/.output/server/chunks/build/{useDcwCards-COffSnEh.mjs → useDcwCards-Ci4SnZ2L.mjs} +4 -4
  178. package/.output/server/chunks/build/{useDcwCards-COffSnEh.mjs.map → useDcwCards-Ci4SnZ2L.mjs.map} +1 -1
  179. package/.output/server/chunks/build/{useDcwDetailScope-CPYeNib2.mjs → useDcwDetailScope-D4TjOlNs.mjs} +6 -6
  180. package/.output/server/chunks/build/{useDcwDetailScope-CPYeNib2.mjs.map → useDcwDetailScope-D4TjOlNs.mjs.map} +1 -1
  181. package/.output/server/chunks/build/{useDcwDetailTemplates-jXerMgzY.mjs → useDcwDetailTemplates-Ctp3cnKX.mjs} +4 -4
  182. package/.output/server/chunks/build/{useDcwDetailTemplates-jXerMgzY.mjs.map → useDcwDetailTemplates-Ctp3cnKX.mjs.map} +1 -1
  183. package/.output/server/chunks/build/{useDcwFilter-BmuVZkbW.mjs → useDcwFilter-C9wUKqpa.mjs} +4 -4
  184. package/.output/server/chunks/build/{useDcwFilter-BmuVZkbW.mjs.map → useDcwFilter-C9wUKqpa.mjs.map} +1 -1
  185. package/.output/server/chunks/build/{useDcwLedger-Do4JjGEu.mjs → useDcwLedger-BHLSE8A3.mjs} +4 -4
  186. package/.output/server/chunks/build/{useDcwLedger-Do4JjGEu.mjs.map → useDcwLedger-BHLSE8A3.mjs.map} +1 -1
  187. package/.output/server/chunks/build/{useDcwLineMutations-BNx-gh7I.mjs → useDcwLineMutations-C_td-b3V.mjs} +4 -4
  188. package/.output/server/chunks/build/{useDcwLineMutations-BNx-gh7I.mjs.map → useDcwLineMutations-C_td-b3V.mjs.map} +1 -1
  189. package/.output/server/chunks/build/{useDcwLineRun-CbJWDWZl.mjs → useDcwLineRun-CyPb_lDB.mjs} +4 -4
  190. package/.output/server/chunks/build/{useDcwLineRun-CbJWDWZl.mjs.map → useDcwLineRun-CyPb_lDB.mjs.map} +1 -1
  191. package/.output/server/chunks/build/{useDcwParamApprovals-BsoHHvme.mjs → useDcwParamApprovals-DN1-qs9p.mjs} +5 -5
  192. package/.output/server/chunks/build/{useDcwParamApprovals-BsoHHvme.mjs.map → useDcwParamApprovals-DN1-qs9p.mjs.map} +1 -1
  193. package/.output/server/chunks/build/{useDcwProducts-CXNhswqK.mjs → useDcwProducts-Bdk1SsiB.mjs} +4 -4
  194. package/.output/server/chunks/build/{useDcwProducts-CXNhswqK.mjs.map → useDcwProducts-Bdk1SsiB.mjs.map} +1 -1
  195. package/.output/server/chunks/build/{useDcwQuery-CBPkHlA7.mjs → useDcwQuery-93hS351p.mjs} +4 -4
  196. package/.output/server/chunks/build/{useDcwQuery-CBPkHlA7.mjs.map → useDcwQuery-93hS351p.mjs.map} +1 -1
  197. package/.output/server/chunks/build/{useDcwQuickActions-By6bAfeD.mjs → useDcwQuickActions-f7bibIWa.mjs} +4 -4
  198. package/.output/server/chunks/build/{useDcwQuickActions-By6bAfeD.mjs.map → useDcwQuickActions-f7bibIWa.mjs.map} +1 -1
  199. package/.output/server/chunks/build/{useDcwRecipes-ZUNE8GaL.mjs → useDcwRecipes-BHj-tnx4.mjs} +4 -4
  200. package/.output/server/chunks/build/{useDcwRecipes-ZUNE8GaL.mjs.map → useDcwRecipes-BHj-tnx4.mjs.map} +1 -1
  201. package/.output/server/chunks/build/{useDcwStream-CNtMGcR0.mjs → useDcwStream-CFKMvd6A.mjs} +3 -3
  202. package/.output/server/chunks/build/{useDcwStream-CNtMGcR0.mjs.map → useDcwStream-CFKMvd6A.mjs.map} +1 -1
  203. package/.output/server/chunks/build/{useDcwTemplates-B5asHSLs.mjs → useDcwTemplates-Dp2aMCHr.mjs} +4 -4
  204. package/.output/server/chunks/build/{useDcwTemplates-B5asHSLs.mjs.map → useDcwTemplates-Dp2aMCHr.mjs.map} +1 -1
  205. package/.output/server/chunks/build/{useDcwWrites-B0RF3zFE.mjs → useDcwWrites-C3y_ZBMf.mjs} +4 -4
  206. package/.output/server/chunks/build/{useDcwWrites-B0RF3zFE.mjs.map → useDcwWrites-C3y_ZBMf.mjs.map} +1 -1
  207. package/.output/server/chunks/build/{useDeviceTwins-Bqrm2_5w.mjs → useDeviceTwins-q7mxv7QC.mjs} +3 -3
  208. package/.output/server/chunks/build/{useDeviceTwins-Bqrm2_5w.mjs.map → useDeviceTwins-q7mxv7QC.mjs.map} +1 -1
  209. package/.output/server/chunks/build/{useExpConfirmations-BxGYvtvI.mjs → useExpConfirmations-OtBkMdsA.mjs} +3 -3
  210. package/.output/server/chunks/build/{useExpConfirmations-BxGYvtvI.mjs.map → useExpConfirmations-OtBkMdsA.mjs.map} +1 -1
  211. package/.output/server/chunks/build/{useLocalTime-Cz6wyFn6.mjs → useLocalTime-CMw71SWy.mjs} +1 -1
  212. package/.output/server/chunks/build/{useLocalTime-Cz6wyFn6.mjs.map → useLocalTime-CMw71SWy.mjs.map} +1 -1
  213. package/.output/server/chunks/build/{useLogsManual-CIcgIGCP.mjs → useLogsManual-BE7RIjmW.mjs} +4 -4
  214. package/.output/server/chunks/build/{useLogsManual-CIcgIGCP.mjs.map → useLogsManual-BE7RIjmW.mjs.map} +1 -1
  215. package/.output/server/chunks/build/{useLogsQuery-CAkEW5e7.mjs → useLogsQuery-817uGXY4.mjs} +4 -4
  216. package/.output/server/chunks/build/{useLogsQuery-CAkEW5e7.mjs.map → useLogsQuery-817uGXY4.mjs.map} +1 -1
  217. package/.output/server/chunks/build/{useLogsScope-DGFmQgcV.mjs → useLogsScope-Dj7vPHyL.mjs} +4 -4
  218. package/.output/server/chunks/build/{useLogsScope-DGFmQgcV.mjs.map → useLogsScope-Dj7vPHyL.mjs.map} +1 -1
  219. package/.output/server/chunks/build/{useMonitorData-CXJzv8yG.mjs → useMonitorData-DuRxpSqM.mjs} +3 -3
  220. package/.output/server/chunks/build/{useMonitorData-CXJzv8yG.mjs.map → useMonitorData-DuRxpSqM.mjs.map} +1 -1
  221. package/.output/server/chunks/build/{useMonitorFormat-BEESOsgH.mjs → useMonitorFormat-Cd-8qYmg.mjs} +2 -2
  222. package/.output/server/chunks/build/{useMonitorFormat-BEESOsgH.mjs.map → useMonitorFormat-Cd-8qYmg.mjs.map} +1 -1
  223. package/.output/server/chunks/build/{useOperationsFeed-BK8B0A0L.mjs → useOperationsFeed-BtLCSGOe.mjs} +4 -4
  224. package/.output/server/chunks/build/{useOperationsFeed-BK8B0A0L.mjs.map → useOperationsFeed-BtLCSGOe.mjs.map} +1 -1
  225. package/.output/server/chunks/build/{useOpsLog-BFxxz-sT.mjs → useOpsLog--SOdQAEJ.mjs} +3 -3
  226. package/.output/server/chunks/build/{useOpsLog-BFxxz-sT.mjs.map → useOpsLog--SOdQAEJ.mjs.map} +1 -1
  227. package/.output/server/chunks/build/{useRecipeDispatchApprovals-NuH_3Bpu.mjs → useRecipeDispatchApprovals-Cw4rAyyh.mjs} +3 -3
  228. package/.output/server/chunks/build/{useRecipeDispatchApprovals-NuH_3Bpu.mjs.map → useRecipeDispatchApprovals-Cw4rAyyh.mjs.map} +1 -1
  229. package/.output/server/chunks/build/{useTeamActions-B4QCFYq8.mjs → useTeamActions-C1-gUkfR.mjs} +3 -3
  230. package/.output/server/chunks/build/{useTeamActions-B4QCFYq8.mjs.map → useTeamActions-C1-gUkfR.mjs.map} +1 -1
  231. package/.output/server/chunks/build/{useTeamAddMemberDialog-CF0Qb5l7.mjs → useTeamAddMemberDialog-Blejsozp.mjs} +3 -3
  232. package/.output/server/chunks/build/{useTeamAddMemberDialog-CF0Qb5l7.mjs.map → useTeamAddMemberDialog-Blejsozp.mjs.map} +1 -1
  233. package/.output/server/chunks/build/{useTeamCreateDialog-B-P-LG3N.mjs → useTeamCreateDialog-CbAjaxDf.mjs} +2 -2
  234. package/.output/server/chunks/build/{useTeamCreateDialog-B-P-LG3N.mjs.map → useTeamCreateDialog-CbAjaxDf.mjs.map} +1 -1
  235. package/.output/server/chunks/build/{useTeamDeployDialog-DHA-c9Tk.mjs → useTeamDeployDialog-ChGWaFpH.mjs} +3 -3
  236. package/.output/server/chunks/build/{useTeamDeployDialog-DHA-c9Tk.mjs.map → useTeamDeployDialog-ChGWaFpH.mjs.map} +1 -1
  237. package/.output/server/chunks/build/{useTeamPluginDialog-CDf1S9ME.mjs → useTeamPluginDialog-CsFH5fAv.mjs} +3 -3
  238. package/.output/server/chunks/build/{useTeamPluginDialog-CDf1S9ME.mjs.map → useTeamPluginDialog-CsFH5fAv.mjs.map} +1 -1
  239. package/.output/server/chunks/build/{useTeamsCatalog-BHP6g4ON.mjs → useTeamsCatalog-C-Kv-bqB.mjs} +2 -2
  240. package/.output/server/chunks/build/{useTeamsCatalog-BHP6g4ON.mjs.map → useTeamsCatalog-C-Kv-bqB.mjs.map} +1 -1
  241. package/.output/server/chunks/build/{useTokenCreate-Bl6fJXjW.mjs → useTokenCreate-BxBGZYv1.mjs} +2 -2
  242. package/.output/server/chunks/build/{useTokenCreate-Bl6fJXjW.mjs.map → useTokenCreate-BxBGZYv1.mjs.map} +1 -1
  243. package/.output/server/chunks/build/{useTokenRename-CHm_kIgW.mjs → useTokenRename-DVcV-UuH.mjs} +2 -2
  244. package/.output/server/chunks/build/{useTokenRename-CHm_kIgW.mjs.map → useTokenRename-DVcV-UuH.mjs.map} +1 -1
  245. package/.output/server/chunks/build/{useTokensList-DnT_Sn0Q.mjs → useTokensList-BuCdwEVo.mjs} +2 -2
  246. package/.output/server/chunks/build/{useTokensList-DnT_Sn0Q.mjs.map → useTokensList-BuCdwEVo.mjs.map} +1 -1
  247. package/.output/server/chunks/build/{useWorkbenchAuth-DgxFoSli.mjs → useWorkbenchAuth-aKsreLd_.mjs} +2 -2
  248. package/.output/server/chunks/build/{useWorkbenchAuth-DgxFoSli.mjs.map → useWorkbenchAuth-aKsreLd_.mjs.map} +1 -1
  249. package/.output/server/chunks/build/{useWorkbenchWorkspaces-BHRTd7aZ.mjs → useWorkbenchWorkspaces-HOdVtb3d.mjs} +5 -5
  250. package/.output/server/chunks/build/{useWorkbenchWorkspaces-BHRTd7aZ.mjs.map → useWorkbenchWorkspaces-HOdVtb3d.mjs.map} +1 -1
  251. package/.output/server/chunks/build/{useWorkshopApi-PvyApp92.mjs → useWorkshopApi-DNO9IeDM.mjs} +1 -1
  252. package/.output/server/chunks/build/{useWorkshopApi-PvyApp92.mjs.map → useWorkshopApi-DNO9IeDM.mjs.map} +1 -1
  253. package/.output/server/chunks/build/{useWorkshopWs-f5D2dm08.mjs → useWorkshopWs-9bGupjEF.mjs} +4 -4
  254. package/.output/server/chunks/build/{useWorkshopWs-f5D2dm08.mjs.map → useWorkshopWs-9bGupjEF.mjs.map} +1 -1
  255. package/.output/server/chunks/build/{useWorkspaceAuth-cgLRP1X_.mjs → useWorkspaceAuth-DWpYDsif.mjs} +1 -1
  256. package/.output/server/chunks/build/{useWorkspaceAuth-cgLRP1X_.mjs.map → useWorkspaceAuth-DWpYDsif.mjs.map} +1 -1
  257. package/.output/server/chunks/build/{useWorkspaceChannels-C4b7dg1J.mjs → useWorkspaceChannels-DdH-FrSb.mjs} +5 -5
  258. package/.output/server/chunks/build/{useWorkspaceChannels-C4b7dg1J.mjs.map → useWorkspaceChannels-DdH-FrSb.mjs.map} +1 -1
  259. package/.output/server/chunks/build/{users-nLXiihNX.mjs → users-CR8UDaPu.mjs} +1 -1
  260. package/.output/server/chunks/build/{users-nLXiihNX.mjs.map → users-CR8UDaPu.mjs.map} +1 -1
  261. package/.output/server/chunks/build/{workshop-DDci854s.mjs → workshop-DgDYnOBE.mjs} +8 -8
  262. package/.output/server/chunks/build/{workshop-DDci854s.mjs.map → workshop-DgDYnOBE.mjs.map} +1 -1
  263. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId/experience.get.mjs +68 -0
  264. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId/experience.get.mjs.map +1 -0
  265. package/.output/server/chunks/routes/renderer.mjs +1 -1
  266. package/.output/server/chunks/virtual/entry.mjs +112 -100
  267. package/.output/server/chunks/virtual/entry.mjs.map +1 -1
  268. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  269. package/.output/server/package.json +1 -1
  270. package/README-zh.md +21 -7
  271. package/README.md +20 -8
  272. package/app/components/AwLogo.vue +75 -75
  273. package/app/components/aml/AmlDatasetFormModal.vue +279 -279
  274. package/app/components/aml/AmlDatasetTable.vue +319 -319
  275. package/app/components/aml/AmlExperimentsTable.vue +142 -142
  276. package/app/components/aml/AmlInfraBanner.vue +23 -23
  277. package/app/components/aml/AmlJobsTable.vue +248 -248
  278. package/app/components/aml/AmlOverviewBar.vue +62 -62
  279. package/app/components/aml/AmlPageHeader.vue +47 -47
  280. package/app/components/aml/AmlPredictConsole.vue +201 -201
  281. package/app/components/app-header/HitlBell.vue +423 -423
  282. package/app/components/daq/DaqAddNodeModal.vue +209 -209
  283. package/app/components/daq/DaqInfraBanner.vue +31 -31
  284. package/app/components/daq/DaqLineBanner.vue +47 -47
  285. package/app/components/daq/DaqOptPanel.vue +197 -197
  286. package/app/components/daq/DaqTemplateModal.vue +246 -246
  287. package/app/components/dashboard/DashboardGaugeBand.vue +78 -78
  288. package/app/components/dashboard/DashboardLineStatePanel.vue +78 -78
  289. package/app/components/dashboard/DashboardNodeStatePanel.vue +46 -46
  290. package/app/components/dashboard/DashboardPipelinePanel.vue +46 -46
  291. package/app/components/dashboard/DashboardTrendPanel.vue +83 -83
  292. package/app/components/dcw/DcwCreateLineModal.vue +105 -105
  293. package/app/components/dcw/DcwDeleteLineModal.vue +73 -73
  294. package/app/components/dcw/DcwDetailTemplateModal.vue +238 -238
  295. package/app/components/dcw/DcwLedgerCard.vue +160 -160
  296. package/app/components/dcw/DcwProductCreateModal.vue +113 -113
  297. package/app/components/dcw/DcwRecipeDispatchHistoryModal.vue +244 -244
  298. package/app/components/dcw/DcwRecipeHistoryModal.vue +165 -165
  299. package/app/components/dcw/DcwRunDataModal.vue +191 -191
  300. package/app/components/dcw/DcwTemplateModal.vue +227 -227
  301. package/app/components/dcw/DcwWriteHistoryCard.vue +96 -96
  302. package/app/components/dcw/ExpConfirmCard.vue +103 -103
  303. package/app/components/dcw/RecipeDispatchApprovalCard.vue +330 -330
  304. package/app/components/logs/LogsPageHead.vue +122 -122
  305. package/app/components/monitor/MonitorAgentTable.vue +143 -143
  306. package/app/components/monitor/MonitorChannelTable.vue +80 -80
  307. package/app/components/monitor/MonitorLoginGate.vue +24 -24
  308. package/app/components/monitor/MonitorPageHead.vue +92 -92
  309. package/app/components/monitor/MonitorProcessTable.vue +159 -159
  310. package/app/components/ontology/OntologyGraph.vue +356 -356
  311. package/app/components/operations/OperationsFilterCard.vue +164 -164
  312. package/app/components/operations/OperationsPageHead.vue +47 -47
  313. package/app/components/tokens/TokenCreateModal.vue +42 -42
  314. package/app/components/tokens/TokenOnceModal.vue +164 -164
  315. package/app/components/tokens/TokenRenameModal.vue +40 -40
  316. package/app/components/tokens/TokensPageHead.vue +76 -76
  317. package/app/components/workshop/A2aRpcDebugger.vue +237 -237
  318. package/app/components/workshop/AgentLanesView.vue +278 -278
  319. package/app/components/workshop/ArtifactCard.vue +120 -120
  320. package/app/components/workshop/DaqTemplateIcon.vue +33 -33
  321. package/app/components/workshop/MemoryPanel.vue +81 -0
  322. package/app/components/workshop/PluginSlot.vue +120 -120
  323. package/app/components/workshop/TranscriptTimeline.vue +223 -223
  324. package/app/components/workshop/blocks/EventBlockAvatar.vue +114 -114
  325. package/app/components/workshop/composer/ReplyChip.vue +65 -65
  326. package/app/components/workshop/lanes/AddMemberModal.vue +270 -270
  327. package/app/components/workshop/lanes/EditMemberModal.vue +106 -106
  328. package/app/components/workshop/lanes/LanesToolbar.vue +97 -97
  329. package/app/components/workshop/session-list/SaveTemplateModal.vue +93 -93
  330. package/app/components/workshop/task-board/Card.vue +172 -172
  331. package/app/components/workshop/task-board/Column.vue +151 -151
  332. package/app/components/workshop/task-board/List.vue +157 -157
  333. package/app/components/workshop/task-board/StatusMenu.vue +88 -88
  334. package/app/components/workshop/teams/TeamAddMemberModal.vue +53 -53
  335. package/app/components/workshop/teams/TeamDeployModal.vue +40 -40
  336. package/app/components/workshop/terminal/TerminalHitlCard.vue +170 -170
  337. package/app/components/workshop/town/TownScene.ts +466 -466
  338. package/app/components/workshop/town/components/AutoModeConfirmModal.vue +94 -94
  339. package/app/components/workshop/town/components/TownLoadingMask.vue +61 -61
  340. package/app/components/workshop/town/components/TownStage.vue +281 -281
  341. package/app/components/workshop/town/scene/town-scene-agents.ts +254 -254
  342. package/app/components/workshop/town/scene/town-scene-behavior.ts +194 -194
  343. package/app/components/workshop/town/scene/town-scene-bubbles.ts +96 -96
  344. package/app/components/workshop/town/scene/town-scene-core.ts +158 -158
  345. package/app/components/workshop/town/scene/town-scene-models.ts +109 -109
  346. package/app/components/workshop/town/scene/town-scene-visuals.ts +279 -279
  347. package/app/components/workshop/town/scene/town-scene3d-agents.ts +308 -308
  348. package/app/components/workshop/town/scene/town-scene3d-blocks.ts +297 -297
  349. package/app/components/workshop/town/scene/town-scene3d-bubbles.ts +281 -281
  350. package/app/components/workshop/town/scene/town-scene3d-camera.ts +282 -282
  351. package/app/components/workshop/town/scene/town-scene3d-devices.ts +433 -433
  352. package/app/components/workshop/town/scene/town-scene3d-editing.ts +490 -490
  353. package/app/components/workshop/town/scene/town-scene3d-events.ts +173 -173
  354. package/app/components/workshop/town/scene/town-scene3d-factory.ts +412 -412
  355. package/app/components/workshop/town/scene/town-scene3d-hud.ts +110 -110
  356. package/app/components/workshop/town/scene/town-scene3d-lifecycle.ts +144 -144
  357. package/app/components/workshop/town/scene/town-scene3d-links.ts +141 -141
  358. package/app/components/workshop/town/scene/town-scene3d-loop.ts +286 -286
  359. package/app/components/workshop/town/scene/town-scene3d-models.ts +154 -154
  360. package/app/components/workshop/town/scene/town-scene3d-nodes.ts +562 -562
  361. package/app/components/workshop/town/scene/town-scene3d-ranges.ts +273 -273
  362. package/app/components/workshop/town/scene/town-scene3d-renderer.ts +320 -320
  363. package/app/components/workshop/town/scene/town-scene3d-selection.ts +257 -257
  364. package/app/components/workshop/town/scene/town-scene3d-types.ts +264 -264
  365. package/app/components/workshop/transcript/TranscriptBlockList.vue +68 -68
  366. package/app/components/workshop/workbench/CreateWorkspaceModal.vue +36 -36
  367. package/app/composables/useResponsive.ts +88 -88
  368. package/app/composables/workshop/device-twin-types.ts +29 -29
  369. package/app/composables/workshop/event-blocks/clusterer.ts +231 -231
  370. package/app/composables/workshop/event-blocks/fold-stream.ts +45 -45
  371. package/app/composables/workshop/event-blocks/markdown.ts +81 -81
  372. package/app/composables/workshop/event-blocks/mentions.ts +49 -49
  373. package/app/composables/workshop/event-blocks/text-utils.ts +100 -100
  374. package/app/composables/workshop/event-blocks/types.ts +40 -40
  375. package/app/composables/workshop/town/town-relay-props.ts +231 -231
  376. package/app/composables/workshop/town/town-view-types.ts +145 -145
  377. package/app/composables/workshop/town/useTownAlarms.ts +36 -36
  378. package/app/composables/workshop/town/useTownCallouts.ts +174 -174
  379. package/app/composables/workshop/town/useTownChannels.ts +220 -220
  380. package/app/composables/workshop/town/useTownHealth.ts +66 -66
  381. package/app/composables/workshop/town/useTownHudTickers.ts +77 -77
  382. package/app/composables/workshop/town/useTownLayout.ts +277 -277
  383. package/app/composables/workshop/town/useTownNavMap.ts +301 -301
  384. package/app/composables/workshop/town/useTownNodeBindings.ts +345 -345
  385. package/app/composables/workshop/town/useTownPanelDrag.ts +91 -91
  386. package/app/composables/workshop/town/useTownSceneControl.ts +92 -92
  387. package/app/composables/workshop/town/useTownSceneInput.ts +275 -275
  388. package/app/composables/workshop/town/useTownSceneRuntime.ts +390 -390
  389. package/app/composables/workshop/town/useTownSheets.ts +41 -41
  390. package/app/composables/workshop/town/useTownTrends.ts +93 -93
  391. package/app/composables/workshop/useChannelList.ts +88 -88
  392. package/app/composables/workshop/useChannelTerminals.ts +65 -65
  393. package/app/composables/workshop/useComposerMentions.ts +130 -130
  394. package/app/composables/workshop/useDeviceTwinDcwWrite.ts +77 -77
  395. package/app/composables/workshop/useDeviceTwinPanel.ts +56 -56
  396. package/app/composables/workshop/useEscClose.ts +44 -44
  397. package/app/composables/workshop/useEventBlockView.ts +159 -159
  398. package/app/composables/workshop/useEventBlocks.ts +33 -33
  399. package/app/composables/workshop/useHitlAnswer.ts +184 -184
  400. package/app/composables/workshop/useLaneWidths.ts +27 -27
  401. package/app/composables/workshop/useOpsLog.ts +191 -191
  402. package/app/composables/workshop/usePluginPanels.ts +72 -72
  403. package/app/composables/workshop/useRuntimeConfigDraft.ts +118 -118
  404. package/app/composables/workshop/useSettingsGroups.ts +243 -243
  405. package/app/composables/workshop/useTaskBoardColumns.ts +47 -47
  406. package/app/composables/workshop/useTerminalRenderer.ts +308 -308
  407. package/app/composables/workshop/useTranscriptEnterStage.ts +48 -48
  408. package/app/composables/workshop/useTranscriptHistory.ts +52 -52
  409. package/app/composables/workshop/useTranscriptScroll.ts +113 -113
  410. package/app/composables/workshop/useVisibleInterval.ts +42 -42
  411. package/app/config/index.ts +1 -1
  412. package/app/middleware/locale-cookie.global.ts +22 -22
  413. package/app/pages/aml/api.ts +6 -6
  414. package/app/pages/aml/composables/useAmlDatasets.ts +38 -38
  415. package/app/pages/aml/composables/useAmlEntities.ts +57 -57
  416. package/app/pages/aml/composables/useAmlEnv.ts +191 -191
  417. package/app/pages/aml/composables/useAmlExperiments.ts +45 -45
  418. package/app/pages/aml/composables/useAmlFormat.ts +44 -44
  419. package/app/pages/aml/composables/useAmlJobs.ts +131 -131
  420. package/app/pages/aml/composables/useAmlModels.ts +56 -56
  421. package/app/pages/aml/composables/useAmlNotes.ts +47 -47
  422. package/app/pages/aml/composables/useAmlPredict.ts +93 -93
  423. package/app/pages/aml/constants.ts +63 -63
  424. package/app/pages/aml/index.vue +236 -236
  425. package/app/pages/daq/composables/useDaqAddNode.ts +126 -126
  426. package/app/pages/daq/composables/useDaqDetailBinding.ts +29 -29
  427. package/app/pages/daq/composables/useDaqDetailFrames.ts +42 -42
  428. package/app/pages/daq/composables/useDaqDetailNode.ts +53 -53
  429. package/app/pages/daq/composables/useDaqDetailParams.ts +138 -138
  430. package/app/pages/daq/composables/useDaqFilters.ts +187 -187
  431. package/app/pages/daq/composables/useDaqNodeWindow.ts +86 -86
  432. package/app/pages/daq/composables/useDaqTemplates.ts +152 -152
  433. package/app/pages/dcw/composables/useDcwCards.ts +27 -27
  434. package/app/pages/dcw/composables/useDcwDetailScope.ts +145 -145
  435. package/app/pages/dcw/composables/useDcwDetailTemplates.ts +94 -94
  436. package/app/pages/dcw/composables/useDcwFilter.ts +29 -29
  437. package/app/pages/dcw/composables/useDcwLedger.ts +34 -34
  438. package/app/pages/dcw/composables/useDcwLineMutations.ts +115 -115
  439. package/app/pages/dcw/composables/useDcwLineRun.ts +60 -60
  440. package/app/pages/dcw/composables/useDcwProducts.ts +54 -54
  441. package/app/pages/dcw/composables/useDcwQuery.ts +68 -68
  442. package/app/pages/dcw/composables/useDcwQuickActions.ts +47 -47
  443. package/app/pages/dcw/index.vue +195 -195
  444. package/app/pages/dcw/types.ts +9 -9
  445. package/app/pages/logs/composables/useLogsFormat.ts +43 -43
  446. package/app/pages/logs/composables/useLogsManual.ts +71 -71
  447. package/app/pages/logs/composables/useLogsScope.ts +39 -39
  448. package/app/pages/monitor/types.ts +61 -61
  449. package/app/pages/tokens/composables/useTokenClipboard.ts +33 -33
  450. package/app/pages/tokens/composables/useTokenCreate.ts +93 -93
  451. package/app/pages/tokens/composables/useTokenRename.ts +54 -54
  452. package/app/pages/tokens/composables/useTokenReveal.ts +84 -84
  453. package/app/pages/tokens/composables/useTokensList.ts +60 -60
  454. package/app/pages/tokens.vue +111 -111
  455. package/app/pages/workshop/agents.vue +130 -130
  456. package/app/pages/workshop/composables/useAgentTemplateActions.ts +42 -42
  457. package/app/pages/workshop/composables/useAgentTemplateDialogState.ts +24 -24
  458. package/app/pages/workshop/composables/useAgentTemplateForm.ts +88 -88
  459. package/app/pages/workshop/composables/useAgentTemplatesCatalog.ts +92 -92
  460. package/app/pages/workshop/composables/useTeamActions.ts +44 -44
  461. package/app/pages/workshop/composables/useTeamAddMemberDialog.ts +49 -49
  462. package/app/pages/workshop/composables/useTeamDeployDialog.ts +49 -49
  463. package/app/pages/workshop/composables/useTeamDialogState.ts +46 -46
  464. package/app/pages/workshop/composables/useTeamPluginDialog.ts +72 -72
  465. package/app/pages/workshop/composables/useTeamsCatalog.ts +100 -100
  466. package/app/pages/workshop/composables/useWorkbenchWorkspaces.ts +123 -123
  467. package/app/pages/workshop/composables/useWorkspaceAuth.ts +31 -31
  468. package/app/plugins/esc-close.client.ts +31 -31
  469. package/app/stores/workshop/hitl.ts +183 -183
  470. package/app/stores/workshop/narrow-fetch.ts +23 -23
  471. package/app/utils/api-error.ts +75 -75
  472. package/app/utils/builtin-catalog.ts +104 -104
  473. package/app/utils/chart-trend.ts +97 -97
  474. package/app/utils/dcw-driver-badge.ts +16 -16
  475. package/app/utils/dcw-recipe-form.ts +26 -26
  476. package/cli/commands/tui.mjs +28 -28
  477. package/cli/commands/update.mjs +124 -124
  478. package/cli/core/child-lifecycle.mjs +136 -136
  479. package/cli/core/meta.mjs +38 -38
  480. package/config.yml +1 -1
  481. package/docker-compose.yml +69 -69
  482. package/docs/cli.en.md +1 -1
  483. package/docs/cli.md +1 -1
  484. package/docs/multi-harness-architecture.md +248 -248
  485. package/docs/plugins.en.md +2 -2
  486. package/docs/plugins.md +2 -2
  487. package/docs/sdk.en.md +1 -1
  488. package/docs/sdk.md +1 -1
  489. package/docs/tui.md +43 -43
  490. package/i18n/dicts/_en.json +1551 -1551
  491. package/i18n/dicts/_en2.json +300 -300
  492. package/i18n/dicts/_en4.json +114 -114
  493. package/i18n/dicts/agentLanesView.json +61 -61
  494. package/i18n/dicts/appHeader.json +17 -17
  495. package/i18n/dicts/channelSessionList.json +51 -51
  496. package/i18n/dicts/clusterTool.json +4 -4
  497. package/i18n/dicts/composer.json +38 -38
  498. package/i18n/dicts/ctpl.json +37 -37
  499. package/i18n/dicts/lineOps.json +14 -14
  500. package/i18n/dicts/multiChannelView.json +13 -13
  501. package/i18n/dicts/notifications.json +13 -13
  502. package/i18n/dicts/taskInspectorDrawer.json +25 -25
  503. package/i18n/dicts/teamPlugins.json +10 -10
  504. package/i18n/dicts/townView.json +211 -211
  505. package/i18n/locales/en.ts +6 -0
  506. package/i18n/locales/zh-CN.ts +6 -0
  507. package/mcp/discovery.mjs +227 -227
  508. package/package.json +1 -1
  509. package/public/favicon.svg +14 -14
  510. package/public/robots.txt +3 -3
  511. package/scripts/_audit/_live-mqtt-e2e-20261028.mjs +219 -219
  512. package/scripts/_audit/audit-harness-adapters.md +664 -664
  513. package/scripts/_audit/aw-mcp-live-e2e.mjs +293 -293
  514. package/scripts/_audit/bump-version.mjs +51 -51
  515. package/scripts/_audit/demo-shot-studio.mjs +37 -37
  516. package/scripts/_audit/demo-shots.mjs +38 -38
  517. package/scripts/_audit/detached-instance.mjs +112 -112
  518. package/scripts/_audit/detached-start.mjs +103 -103
  519. package/scripts/_audit/eda-ui-fix-acceptance.mjs +212 -212
  520. package/scripts/_audit/gen-demo-report.py +69 -69
  521. package/scripts/_audit/governed-learning-evidence.mjs +51 -0
  522. package/scripts/_audit/governed-main-audit.mjs +60 -0
  523. package/scripts/_audit/guard-upstream-liveness.mjs +104 -104
  524. package/scripts/_audit/http-api-authz-audit.md +657 -657
  525. package/scripts/_audit/kb-team-mock-e2e.mjs +146 -146
  526. package/scripts/_audit/kb-team-omp-e2e.mjs +229 -229
  527. package/scripts/_audit/kill-acceptance-strays.mjs +47 -47
  528. package/scripts/_audit/mqtt-pub.mjs +13 -13
  529. package/scripts/_audit/mqtt-topic-probe.mjs +15 -15
  530. package/scripts/_audit/prompt-injection-probe.mts +76 -76
  531. package/scripts/_audit/proto-b3-device-4021.mjs +90 -90
  532. package/scripts/_audit/proto-doc-broker-20261031.mjs +11 -11
  533. package/scripts/_audit/proto-doc-device-20261031.mjs +53 -53
  534. package/scripts/_audit/proto-doc-mqtt-20261031.mjs +32 -32
  535. package/scripts/_audit/run-full-acceptance-20261030.sh +82 -82
  536. package/scripts/_audit/run.mjs +21 -21
  537. package/scripts/_audit/runtime-audit.md +716 -716
  538. package/scripts/_audit/skills-guided-e2e.mjs +316 -316
  539. package/scripts/_audit/stability-soak.mjs +252 -252
  540. package/scripts/_audit/stubs/nuxt-imports.mjs +67 -67
  541. package/scripts/_audit/ts-register-hook.mjs +12 -12
  542. package/scripts/_audit/ts-resolve-hook.mjs +96 -96
  543. package/scripts/_aw0746-stage12.mjs +94 -94
  544. package/scripts/_aw0746-stage34.mjs +136 -136
  545. package/scripts/_aw0746-stage6b-train-sweep.mjs +145 -145
  546. package/scripts/_aw0746-stage6c-jobsmoke.mjs +69 -69
  547. package/scripts/_dbg-configroot-audit.mjs +86 -86
  548. package/scripts/_dbg-daq-intervals-func.mjs +115 -115
  549. package/scripts/_dbg-perms-e2e.mjs +142 -142
  550. package/scripts/_dbg-protocol-matrix.mjs +462 -462
  551. package/scripts/_dbg-render-regression.mjs +193 -193
  552. package/scripts/_dbg-schedule-e2e.mjs +262 -262
  553. package/scripts/_e2e-ui-functional.mjs +371 -371
  554. package/scripts/_lib-aml-python-run.mjs +17 -17
  555. package/scripts/_plc-sim-detached.cjs +22 -22
  556. package/scripts/_provision-injection-line.mjs +39 -39
  557. package/scripts/_run-matrix.ps1 +53 -53
  558. package/scripts/_sweep-button-contrast.mjs +87 -87
  559. package/scripts/acceptance-aml-hybrid-e2e.ts +396 -396
  560. package/scripts/acceptance-aml-hybrid-live.mjs +93 -93
  561. package/scripts/acceptance-aml-model-identity.ts +137 -137
  562. package/scripts/acceptance-governed-product-learning.mjs +110 -0
  563. package/scripts/agent-daq-isolation-e2e.mjs +91 -91
  564. package/scripts/api-contract-smoke.mjs +126 -126
  565. package/scripts/ask-hitl-e2e.mjs +96 -96
  566. package/scripts/aw-expose.mjs +159 -159
  567. package/scripts/channel-interaction-smoke.mjs +80 -80
  568. package/scripts/data-studio-ui-e2e.mjs +163 -163
  569. package/scripts/demo/build-provision-config.mjs +48 -48
  570. package/scripts/demo/create-demo-templates.mjs +84 -84
  571. package/scripts/demo-group-chat-all-real.ts +279 -279
  572. package/scripts/dev-modbus-simulator.mjs +55 -55
  573. package/scripts/docs-shots.mjs +36 -36
  574. package/scripts/e2e-agentteam-chat.mjs +473 -473
  575. package/scripts/e2e-agentteam-goal-closure.mjs +496 -496
  576. package/scripts/e2e-agentteam-real-triage.mjs +421 -421
  577. package/scripts/e2e-aml-decoupled.mjs +162 -162
  578. package/scripts/e2e-analysis-ledger.mjs +202 -202
  579. package/scripts/e2e-aw-tui-global.mjs +277 -277
  580. package/scripts/e2e-binding-modes-real.mjs +442 -442
  581. package/scripts/e2e-business-loop-real.mjs +391 -391
  582. package/scripts/e2e-closedloop/cleanup.mjs +27 -27
  583. package/scripts/e2e-closedloop/lib.mjs +109 -109
  584. package/scripts/e2e-closedloop/main.mjs +59 -59
  585. package/scripts/e2e-closedloop/scenarios-accounts.mjs +210 -210
  586. package/scripts/e2e-closedloop/scenarios-authz.mjs +196 -196
  587. package/scripts/e2e-closedloop/scenarios-daq-dcw.mjs +222 -222
  588. package/scripts/e2e-closedloop/scenarios-plugins.mjs +169 -169
  589. package/scripts/e2e-closedloop/state.mjs +10 -10
  590. package/scripts/e2e-config-groups.mjs +238 -238
  591. package/scripts/e2e-core-bridges-matrix.mjs +303 -303
  592. package/scripts/e2e-crash-cycle.mjs +108 -108
  593. package/scripts/e2e-dcw-halfopen-resilience.mjs +140 -140
  594. package/scripts/e2e-error-handling.mjs +190 -190
  595. package/scripts/e2e-full-closedloop.mjs +16 -16
  596. package/scripts/e2e-golive-matrix.mjs +515 -515
  597. package/scripts/e2e-hil-multi-user.mjs +307 -307
  598. package/scripts/e2e-hil-restart.mjs +339 -339
  599. package/scripts/e2e-idd-results-ui.mjs +182 -182
  600. package/scripts/e2e-line-governance.mjs +352 -352
  601. package/scripts/e2e-mes-mirror-real.mjs +427 -427
  602. package/scripts/e2e-multiexpert-remediation-real.mjs +453 -453
  603. package/scripts/e2e-node-binding-3mode-real.mjs +792 -792
  604. package/scripts/e2e-node-binding-authz.mjs +372 -372
  605. package/scripts/e2e-ontology.mjs +393 -393
  606. package/scripts/e2e-paper-paired-route.mjs +791 -791
  607. package/scripts/e2e-physical-effect-real.mjs +572 -572
  608. package/scripts/e2e-plc-plugin-closedloop.mjs +549 -549
  609. package/scripts/e2e-real-channel-mission.mjs +543 -543
  610. package/scripts/e2e-security-b0.mjs +280 -280
  611. package/scripts/e2e-security-b1.mjs +165 -165
  612. package/scripts/e2e-security-b2b5.mjs +280 -280
  613. package/scripts/full-stack-shots.mjs +145 -145
  614. package/scripts/full-tool-injection-harness-e2e.mjs +214 -214
  615. package/scripts/generate-identifiability-fixtures.ts +98 -98
  616. package/scripts/hitl-reject-e2e.mjs +131 -131
  617. package/scripts/line-log-smoke.mjs +260 -260
  618. package/scripts/live-aml-mockomp.mjs +304 -304
  619. package/scripts/live-aml-optloop-resume.mjs +322 -322
  620. package/scripts/live-aml-optloop.mjs +588 -588
  621. package/scripts/live-aml-stage9.mjs +169 -169
  622. package/scripts/live-aml-two-goals.mjs +315 -315
  623. package/scripts/live-demo-seed.mjs +157 -157
  624. package/scripts/live-optloop-two-modes.mjs +857 -857
  625. package/scripts/mes-agent-integration-e2e.mjs +361 -361
  626. package/scripts/ops-plugins-e2e.mjs +85 -85
  627. package/scripts/scenario-suite-setup.mjs +337 -337
  628. package/scripts/scenario-suite-stability.mjs +144 -144
  629. package/scripts/security-acceptance.mjs +218 -218
  630. package/scripts/team-coordination-e2e.mjs +96 -96
  631. package/scripts/test-agentteam-workflow.ts +472 -472
  632. package/scripts/test-daq-frame-race.mjs +358 -358
  633. package/scripts/test-data-root.mjs +208 -208
  634. package/scripts/test-events-index.mjs +176 -176
  635. package/scripts/test-group-chat-unit/lib.ts +186 -186
  636. package/scripts/test-group-chat-unit/main.ts +45 -45
  637. package/scripts/test-group-chat-unit.ts +35 -35
  638. package/scripts/test-hitl-decision.ts +526 -526
  639. package/scripts/test-hitl-registry.ts +112 -112
  640. package/scripts/test-log-flooding.mjs +160 -160
  641. package/scripts/test-lru.mjs +101 -101
  642. package/scripts/test-plugin-hardening.mjs +90 -90
  643. package/scripts/test-plugin-lifecycle.mjs +173 -173
  644. package/scripts/test-rollback-index.mjs +137 -137
  645. package/scripts/test-schedule-runtime.ts +309 -309
  646. package/scripts/test-sdk-surface.mjs +158 -158
  647. package/scripts/test-serial-bridge.mjs +418 -418
  648. package/scripts/test-tui-commands.mjs +148 -148
  649. package/scripts/test-tui-reducers.mjs +72 -72
  650. package/scripts/three-system-e2e/lib.mjs +79 -79
  651. package/scripts/three-system-e2e/main.mjs +40 -40
  652. package/scripts/three-system-e2e/phases/phase-0-user-token.mjs +42 -42
  653. package/scripts/three-system-e2e/phases/phase-0a2-line-autoselect.mjs +35 -35
  654. package/scripts/three-system-e2e/phases/phase-0b-fixture-grants.mjs +39 -39
  655. package/scripts/three-system-e2e/phases/phase-0c-plugin-outbound-auth.mjs +95 -95
  656. package/scripts/three-system-e2e/phases/stage-1-health.mjs +47 -47
  657. package/scripts/three-system-e2e/phases/stage-2-5-team-plugins.mjs +84 -84
  658. package/scripts/three-system-e2e/phases/stage-2-teams-tools-hitl.mjs +184 -184
  659. package/scripts/three-system-e2e/phases/stage-3-diag.mjs +73 -73
  660. package/scripts/three-system-e2e/phases/stage-4-plugin-toggle.mjs +53 -53
  661. package/scripts/three-system-e2e/state.mjs +87 -87
  662. package/scripts/three-system-e2e.mjs +40 -40
  663. package/scripts/tool-face-batch-identity-e2e.mjs +222 -222
  664. package/scripts/tsconfig.json +14 -14
  665. package/scripts/tui-smoke.mjs +100 -100
  666. package/scripts/typecheck.mjs +75 -75
  667. package/scripts/ui/md-lint.mjs +80 -80
  668. package/scripts/ui/readme-assets.mjs +30 -30
  669. package/scripts/ui/readme-shots.mjs +42 -42
  670. package/scripts/ui/record-demo.mjs +557 -557
  671. package/scripts/ui/record.mjs +225 -225
  672. package/scripts/ui/seed-admin.mjs +68 -68
  673. package/scripts/ui/seed-demo.mjs +83 -83
  674. package/scripts/ui/seed-industrial-demo.mjs +171 -171
  675. package/scripts/ui/shots.mjs +75 -75
  676. package/scripts/ui/verify-nav.mjs +51 -51
  677. package/scripts/ui/verify-responsive.mjs +285 -285
  678. package/sdk/client.d.mts +110 -110
  679. package/sdk/examples/line-sentinel/index.mjs +105 -105
  680. package/sdk/examples/ops-notifier/index.mjs +34 -34
  681. package/sdk/examples/sample-insight/index.mjs +39 -39
  682. package/server/api/plugins/client/[name].get.ts +18 -18
  683. package/server/api/plugins/i18n.get.ts +12 -12
  684. package/server/api/plugins/manifest.get.ts +10 -10
  685. package/server/api/system/backup/list.get.ts +32 -32
  686. package/server/api/system/backup/run.post.ts +21 -21
  687. package/server/api/system/config-groups/[id].delete.ts +21 -21
  688. package/server/api/system/config-groups/[id].patch.ts +26 -26
  689. package/server/api/system/config-groups/index.get.ts +21 -21
  690. package/server/api/system/config-groups/index.post.ts +33 -33
  691. package/server/api/system/timezone.get.ts +20 -20
  692. package/server/api/workshop/[...path].ts +13 -13
  693. package/server/api/workshop/a2a/[agentId]/card/index.get.ts +86 -86
  694. package/server/api/workshop/agent-tools/approvals/index.get.ts +45 -45
  695. package/server/api/workshop/agent-tools/bindings/grant.post.ts +45 -45
  696. package/server/api/workshop/agent-tools/bindings/index.get.ts +41 -41
  697. package/server/api/workshop/agent-tools/bindings/revoke.post.ts +42 -42
  698. package/server/api/workshop/aml/datasets/[id]/preview.get.ts +68 -68
  699. package/server/api/workshop/aml/datasets/[id].delete.ts +39 -39
  700. package/server/api/workshop/aml/datasets/[id].get.ts +53 -53
  701. package/server/api/workshop/aml/datasets/[id].patch.ts +30 -30
  702. package/server/api/workshop/aml/datasets/index.post.ts +27 -27
  703. package/server/api/workshop/aml/entities/index.get.ts +13 -13
  704. package/server/api/workshop/aml/entities/prune.post.ts +28 -28
  705. package/server/api/workshop/aml/env/index.get.ts +13 -13
  706. package/server/api/workshop/aml/env/recheck.post.ts +14 -14
  707. package/server/api/workshop/aml/env/uv.post.ts +21 -21
  708. package/server/api/workshop/aml/env/venv.post.ts +24 -24
  709. package/server/api/workshop/aml/experiments/index.get.ts +35 -35
  710. package/server/api/workshop/aml/index.get.ts +37 -37
  711. package/server/api/workshop/aml/jobs/[id]/cancel.post.ts +21 -21
  712. package/server/api/workshop/aml/jobs/[id]/logs.get.ts +23 -23
  713. package/server/api/workshop/aml/jobs/[id]/retry.post.ts +20 -20
  714. package/server/api/workshop/aml/jobs/[id].delete.ts +44 -44
  715. package/server/api/workshop/aml/jobs/[id].get.ts +23 -23
  716. package/server/api/workshop/aml/models/[id]/predict.post.ts +24 -24
  717. package/server/api/workshop/aml/models/[id]/promote.post.ts +30 -30
  718. package/server/api/workshop/aml/models/index.get.ts +48 -48
  719. package/server/api/workshop/aml/training-plans/[id]/train.post.ts +18 -18
  720. package/server/api/workshop/aml/training-plans/[id].delete.ts +18 -18
  721. package/server/api/workshop/aml/training-plans/[id].patch.ts +30 -30
  722. package/server/api/workshop/aml/training-plans/index.get.ts +9 -9
  723. package/server/api/workshop/aml/training-plans/index.post.ts +43 -43
  724. package/server/api/workshop/analysis/index.post.ts +71 -71
  725. package/server/api/workshop/approvals/index.get.ts +22 -22
  726. package/server/api/workshop/assets/devices/index.post.ts +55 -55
  727. package/server/api/workshop/audit.get.ts +43 -43
  728. package/server/api/workshop/channels/[id]/chat/messages/[messageId]/read.post.ts +22 -22
  729. package/server/api/workshop/channels/[id]/chat/messages/index.get.ts +29 -29
  730. package/server/api/workshop/channels/[id]/chat/messages/index.post.ts +51 -51
  731. package/server/api/workshop/channels/[id]/chat/permissions.get.ts +35 -35
  732. package/server/api/workshop/channels/[id]/members/[userId]/approve.post.ts +20 -20
  733. package/server/api/workshop/channels/[id]/members/[userId].delete.ts +21 -21
  734. package/server/api/workshop/channels/[id]/members/index.get.ts +23 -23
  735. package/server/api/workshop/channels/[id]/members/leave.post.ts +20 -20
  736. package/server/api/workshop/channels/[id]/memories/[memoryId]/experience.get.ts +32 -0
  737. package/server/api/workshop/channels/[id]/twin-profile.get.ts +45 -45
  738. package/server/api/workshop/channels/[id]/twin-profile.patch.ts +91 -91
  739. package/server/api/workshop/daq/storage/retention.put.ts +66 -66
  740. package/server/api/workshop/daq/storage/rollup.post.ts +28 -28
  741. package/server/api/workshop/daq/storage.get.ts +17 -17
  742. package/server/api/workshop/daq/templates/[key].patch.ts +19 -19
  743. package/server/api/workshop/daq/templates/index.post.ts +18 -18
  744. package/server/api/workshop/dcw/[id].delete.ts +41 -41
  745. package/server/api/workshop/dcw/params/[id].delete.ts +19 -19
  746. package/server/api/workshop/dcw/params/[id].patch.ts +23 -23
  747. package/server/api/workshop/dcw/params/index.get.ts +27 -27
  748. package/server/api/workshop/dcw/params/index.post.ts +25 -25
  749. package/server/api/workshop/device-twins/[id].delete.ts +27 -27
  750. package/server/api/workshop/device-twins/[id].patch.ts +31 -31
  751. package/server/api/workshop/eda/runs/[id]/labels.patch.ts +25 -25
  752. package/server/api/workshop/eda/templates/[id].delete.ts +14 -14
  753. package/server/api/workshop/eda/templates/[id].get.ts +15 -15
  754. package/server/api/workshop/eda/templates/[id].patch.ts +20 -20
  755. package/server/api/workshop/eda/templates/index.get.ts +11 -11
  756. package/server/api/workshop/eda/templates/index.post.ts +20 -20
  757. package/server/api/workshop/exp/confirmations/[id]/decide.post.ts +41 -41
  758. package/server/api/workshop/exp/confirmations/index.get.ts +25 -25
  759. package/server/api/workshop/harnesses/[id]/providers.get.ts +16 -16
  760. package/server/api/workshop/notifications/index.get.ts +60 -60
  761. package/server/api/workshop/notifications/read.post.ts +31 -31
  762. package/server/api/workshop/ontology/drafts/[draftId]/subgraph.ts +24 -24
  763. package/server/api/workshop/ops-logs/index.post.ts +92 -92
  764. package/server/api/workshop/plugins/[name]/disable.post.ts +21 -21
  765. package/server/api/workshop/plugins/[name]/enable.post.ts +21 -21
  766. package/server/api/workshop/plugins/[name]/index.get.ts +14 -14
  767. package/server/api/workshop/schedules/[id]/run.post.ts +15 -15
  768. package/server/api/workshop/schedules/[id]/runs.get.ts +15 -15
  769. package/server/api/workshop/schedules/[id].delete.ts +14 -14
  770. package/server/api/workshop/schedules/[id].get.ts +13 -13
  771. package/server/api/workshop/schedules/[id].patch.ts +29 -29
  772. package/server/api/workshop/schedules/index.get.ts +12 -12
  773. package/server/api/workshop/schedules/index.post.ts +32 -32
  774. package/server/api/workshop/tasks/[id]/reassign.post.ts +32 -32
  775. package/server/api/workshop/tasks/[id]/supersede.post.ts +28 -28
  776. package/server/api/workshop/tasks/[id]/update.post.ts +35 -35
  777. package/server/api/workshop/teams/[id]/plugins/index.get.ts +36 -36
  778. package/server/api/workshop/teams/[id]/plugins/index.put.ts +42 -42
  779. package/server/api/workshop/ws/audience.ts +56 -56
  780. package/server/api/workshop/ws/db-buffer.ts +68 -68
  781. package/server/api/workshop/ws/hub.ts +134 -134
  782. package/server/api/workshop/ws/index.ts +23 -23
  783. package/server/api/workshop/ws/notification-uplink.ts +77 -77
  784. package/server/api/workshop/ws/streams.ts +146 -146
  785. package/server/middleware/00-security-headers.ts +45 -45
  786. package/server/middleware/01-rate-guard.ts +129 -129
  787. package/server/plugins/00-daq-credentials.ts +33 -33
  788. package/server/plugins/01-instance-guard.ts +118 -118
  789. package/server/plugins/aml-twin-worker.ts +32 -32
  790. package/server/plugins/backup.ts +268 -268
  791. package/server/plugins/dev-stability-guard.ts +46 -46
  792. package/server/plugins/error-ledger.ts +21 -21
  793. package/server/plugins-builtin/diag-bridge/host/constants.mjs +25 -25
  794. package/server/plugins-builtin/diag-bridge/host/index.mjs +15 -15
  795. package/server/plugins-builtin/diag-bridge/host/snapshot.mjs +93 -93
  796. package/server/plugins-builtin/diag-bridge/index.mjs +9 -9
  797. package/server/plugins-builtin/serial-bridge/drivers.mjs +409 -409
  798. package/server/plugins-builtin/serial-bridge/lib.mjs +208 -208
  799. package/server/plugins-builtin/serial-bridge/rtu.mjs +168 -168
  800. package/server/schemas/user.schema.ts +74 -74
  801. package/server/services/system-config/contracts.ts +29 -29
  802. package/server/services/system-config/dispose.ts +19 -19
  803. package/server/services/system-config/facade.ts +26 -26
  804. package/server/services/system-config/groups.ts +108 -108
  805. package/server/services/system-config/index.ts +21 -21
  806. package/server/services/system-config/init.ts +26 -26
  807. package/server/services/system-config/mutate.ts +110 -110
  808. package/server/services/system-config/plugins.ts +104 -104
  809. package/server/services/system-config/readiness.ts +84 -84
  810. package/server/services/system-config/secrets.ts +50 -50
  811. package/server/services/system-config/state.ts +79 -79
  812. package/server/services/system-config/types.ts +58 -58
  813. package/server/services/workshop/agents/adapters/line-spawn.ts +148 -148
  814. package/server/services/workshop/agents/adapters/omp-rpc-client/api.ts +111 -111
  815. package/server/services/workshop/agents/adapters/omp-rpc-client/contracts.ts +22 -22
  816. package/server/services/workshop/agents/adapters/omp-rpc-client/facade.ts +7 -7
  817. package/server/services/workshop/agents/adapters/omp-rpc-client/helpers.ts +38 -38
  818. package/server/services/workshop/agents/adapters/omp-rpc-client/index.ts +25 -25
  819. package/server/services/workshop/agents/adapters/omp-rpc-client/start.ts +82 -74
  820. package/server/services/workshop/agents/adapters/omp-rpc-client/state.ts +65 -65
  821. package/server/services/workshop/agents/adapters/omp-rpc-client/stdout.ts +92 -92
  822. package/server/services/workshop/agents/adapters/omp-rpc-client/usage.ts +47 -47
  823. package/server/services/workshop/agents/agent-badge.ts +38 -38
  824. package/server/services/workshop/agents/binding-authz.ts +66 -66
  825. package/server/services/workshop/agents/binding-mode.ts +51 -51
  826. package/server/services/workshop/agents/codex-agent/client.ts +170 -170
  827. package/server/services/workshop/agents/codex-agent/core.ts +119 -119
  828. package/server/services/workshop/agents/codex-agent/facade.ts +8 -8
  829. package/server/services/workshop/agents/codex-agent/helpers.ts +13 -13
  830. package/server/services/workshop/agents/codex-agent/hitl.ts +138 -138
  831. package/server/services/workshop/agents/codex-agent/index.ts +14 -14
  832. package/server/services/workshop/agents/codex-agent/types.ts +42 -42
  833. package/server/services/workshop/agents/governance-harness-audit.ts +216 -216
  834. package/server/services/workshop/agents/harness-terminal/api.ts +197 -197
  835. package/server/services/workshop/agents/harness-terminal/index.ts +17 -17
  836. package/server/services/workshop/agents/harness-terminal/io.ts +120 -120
  837. package/server/services/workshop/agents/harness-terminal/park.ts +55 -55
  838. package/server/services/workshop/agents/harness-terminal/sanitize.ts +98 -98
  839. package/server/services/workshop/agents/harness-terminal/session.ts +124 -124
  840. package/server/services/workshop/agents/harness-terminal/shared.ts +74 -74
  841. package/server/services/workshop/agents/hitl-decision/answers.ts +32 -32
  842. package/server/services/workshop/agents/hitl-decision/decide.ts +268 -268
  843. package/server/services/workshop/agents/hitl-decision/payload.ts +45 -45
  844. package/server/services/workshop/agents/hitl-decision/reconcile.ts +12 -0
  845. package/server/services/workshop/agents/hitl-decision/shared.ts +108 -108
  846. package/server/services/workshop/agents/host-tool-bridge/tools/team.ts +70 -70
  847. package/server/services/workshop/agents/industrial/aml-activity.ts +131 -131
  848. package/server/services/workshop/agents/industrial/audit-query.ts +66 -66
  849. package/server/services/workshop/agents/industrial/bench-approval-only.ts +394 -394
  850. package/server/services/workshop/agents/industrial/fallback-hints.ts +31 -31
  851. package/server/services/workshop/agents/industrial/identifiability-tools.ts +247 -247
  852. package/server/services/workshop/agents/industrial/param-tools.ts +69 -69
  853. package/server/services/workshop/agents/node-bindings.repo.ts +210 -210
  854. package/server/services/workshop/agents/node-delegation.ts +204 -204
  855. package/server/services/workshop/agents/omp-agent/agentteam-audit.ts +147 -147
  856. package/server/services/workshop/agents/omp-agent/facade.ts +8 -8
  857. package/server/services/workshop/agents/omp-agent/helpers.ts +37 -37
  858. package/server/services/workshop/agents/omp-agent/index.ts +16 -16
  859. package/server/services/workshop/agents/omp-agent/types.ts +45 -45
  860. package/server/services/workshop/agents/opencode-agent/core.ts +77 -77
  861. package/server/services/workshop/agents/opencode-agent/facade.ts +8 -8
  862. package/server/services/workshop/agents/opencode-agent/helpers.ts +29 -29
  863. package/server/services/workshop/agents/opencode-agent/hitl.ts +113 -113
  864. package/server/services/workshop/agents/opencode-agent/index.ts +16 -16
  865. package/server/services/workshop/agents/opencode-agent/lifecycle.ts +44 -44
  866. package/server/services/workshop/agents/opencode-agent/server.ts +244 -244
  867. package/server/services/workshop/agents/opencode-agent/turn.ts +278 -278
  868. package/server/services/workshop/agents/opencode-agent/types.ts +54 -54
  869. package/server/services/workshop/aml/action-coverage.ts +253 -253
  870. package/server/services/workshop/aml/causal-claim.ts +68 -68
  871. package/server/services/workshop/aml/clean.ts +120 -120
  872. package/server/services/workshop/aml/entity.ts +367 -367
  873. package/server/services/workshop/aml/env-lease.ts +178 -178
  874. package/server/services/workshop/aml/identifiability.ts +335 -335
  875. package/server/services/workshop/aml/job-orchestrator/broadcast.ts +37 -37
  876. package/server/services/workshop/aml/job-orchestrator/control.ts +94 -94
  877. package/server/services/workshop/aml/job-orchestrator/failure.ts +96 -96
  878. package/server/services/workshop/aml/job-orchestrator/index.ts +22 -22
  879. package/server/services/workshop/aml/job-orchestrator/process.ts +101 -101
  880. package/server/services/workshop/aml/job-orchestrator/shared.ts +53 -53
  881. package/server/services/workshop/aml/job-orchestrator/status.ts +20 -20
  882. package/server/services/workshop/aml/job-orchestrator/tick.ts +37 -37
  883. package/server/services/workshop/aml/ontology-learning.ts +143 -143
  884. package/server/services/workshop/aml/python/train-example.py +92 -92
  885. package/server/services/workshop/aml/runtime.ts +137 -137
  886. package/server/services/workshop/aml/stats.ts +140 -140
  887. package/server/services/workshop/aml/twin/calibration-worker.ts +150 -150
  888. package/server/services/workshop/aml/twin/cross-check-service.ts +114 -114
  889. package/server/services/workshop/aml/twin/cross-check.ts +176 -176
  890. package/server/services/workshop/aml/twin/model-backed-provider.ts +332 -332
  891. package/server/services/workshop/aml/twin/physics-spec-draft.ts +185 -185
  892. package/server/services/workshop/aml/twin/prompt-composer.ts +143 -143
  893. package/server/services/workshop/aml/twin/training-plans.ts +260 -260
  894. package/server/services/workshop/aml/twin/write-guard.ts +19 -19
  895. package/server/services/workshop/assets/character-asset.repo.ts +1 -1
  896. package/server/services/workshop/assets/device-twin.repo.ts +1 -1
  897. package/server/services/workshop/bench-mode.ts +22 -22
  898. package/server/services/workshop/daq/alarm-notify.ts +122 -122
  899. package/server/services/workshop/daq/batch-quality.ts +96 -0
  900. package/server/services/workshop/daq/daq-controller/contracts.ts +42 -42
  901. package/server/services/workshop/daq/daq-controller/driver-probe.ts +68 -68
  902. package/server/services/workshop/daq/daq-controller/facade.ts +28 -28
  903. package/server/services/workshop/daq/daq-controller/helpers.ts +52 -52
  904. package/server/services/workshop/daq/daq-controller/index.ts +22 -22
  905. package/server/services/workshop/daq/daq-controller/sweep-alarms.ts +214 -214
  906. package/server/services/workshop/daq/drivers/mock.ts +130 -130
  907. package/server/services/workshop/daq/drivers/modbus-rtu.ts +67 -67
  908. package/server/services/workshop/daq/drivers/modbus-tcp.ts +321 -321
  909. package/server/services/workshop/daq/drivers/opcua.ts +227 -227
  910. package/server/services/workshop/daq/drivers/s7-stub.ts +29 -29
  911. package/server/services/workshop/daq/frame-meta.ts +86 -86
  912. package/server/services/workshop/daq/host-ports.ts +65 -65
  913. package/server/services/workshop/daq/infra-credentials.ts +201 -201
  914. package/server/services/workshop/daq/ingest-policy.ts +80 -80
  915. package/server/services/workshop/daq/node-metadata.ts +79 -79
  916. package/server/services/workshop/daq/objectstore/index.ts +88 -88
  917. package/server/services/workshop/daq/storage/retention.ts +142 -142
  918. package/server/services/workshop/daq/storage/timescale-rollup.ts +612 -612
  919. package/server/services/workshop/db/aml-team-seeds.ts +118 -118
  920. package/server/services/workshop/db/backup-registry.ts +33 -33
  921. package/server/services/workshop/db/channel-member.repo.ts +122 -122
  922. package/server/services/workshop/db/chat-message.repo.ts +261 -261
  923. package/server/services/workshop/db/database/json.ts +14 -14
  924. package/server/services/workshop/db/database/migrations-experience-versions.ts +92 -0
  925. package/server/services/workshop/db/database/migrations-hitl-ref.ts +20 -0
  926. package/server/services/workshop/db/database/open.ts +9 -2
  927. package/server/services/workshop/db/database/schema.ts +101 -1
  928. package/server/services/workshop/db/database/seed-data.ts +60 -60
  929. package/server/services/workshop/db/hitl-request.repo.ts +221 -221
  930. package/server/services/workshop/db/memory.repo.ts +34 -0
  931. package/server/services/workshop/db/readonly.ts +30 -30
  932. package/server/services/workshop/db/scheduled-task.repo.ts +235 -235
  933. package/server/services/workshop/db/transaction.ts +72 -72
  934. package/server/services/workshop/dcw/dcw-controller/actuation.ts +46 -0
  935. package/server/services/workshop/dcw/dcw-controller/control.ts +78 -78
  936. package/server/services/workshop/dcw/dcw-controller/facade.ts +19 -19
  937. package/server/services/workshop/dcw/dcw-controller/helpers.ts +62 -62
  938. package/server/services/workshop/dcw/dcw-controller/index.ts +22 -22
  939. package/server/services/workshop/dcw/dcw-controller/params.ts +97 -97
  940. package/server/services/workshop/dcw/dcw-templates.ts +136 -136
  941. package/server/services/workshop/dcw/mqtt-payload.ts +64 -64
  942. package/server/services/workshop/dcw/param-conversion.ts +78 -78
  943. package/server/services/workshop/dcw/param-map.repo.ts +349 -349
  944. package/server/services/workshop/dcw/plugin-bridge.ts +45 -45
  945. package/server/services/workshop/dcw/recipe-rollback-manager/contracts.ts +26 -26
  946. package/server/services/workshop/dcw/recipe-rollback-manager/facade.ts +13 -13
  947. package/server/services/workshop/dcw/recipe-rollback-manager/helpers.ts +30 -30
  948. package/server/services/workshop/dcw/recipe-rollback-manager/index.ts +17 -17
  949. package/server/services/workshop/dcw/recipe-rollback-manager/internal.ts +33 -33
  950. package/server/services/workshop/dcw/recipe-rollback-manager/judge.ts +52 -52
  951. package/server/services/workshop/dcw/recipe-rollback-manager/lock.ts +138 -138
  952. package/server/services/workshop/dcw/recipe-rollback-manager/state.ts +21 -21
  953. package/server/services/workshop/dcw/recipe-rollback-manager/types.ts +3 -3
  954. package/server/services/workshop/dcw/recipe-rollback-manager/views.ts +214 -214
  955. package/server/services/workshop/dcw/write-attempt-ledger.ts +113 -0
  956. package/server/services/workshop/eda/template-repo.ts +101 -101
  957. package/server/services/workshop/experience/claim-cluster.ts +28 -0
  958. package/server/services/workshop/experience/evaluation-run.ts +175 -0
  959. package/server/services/workshop/experience/evidence-ledger.ts +69 -0
  960. package/server/services/workshop/experience/gates.ts +14 -4
  961. package/server/services/workshop/experience/ontology-proposals.ts +115 -0
  962. package/server/services/workshop/experience/overlay.ts +7 -1
  963. package/server/services/workshop/experience/promote.ts +7 -1
  964. package/server/services/workshop/experience/reflection-effects.ts +155 -0
  965. package/server/services/workshop/experience/release.ts +163 -0
  966. package/server/services/workshop/experience/resolve.ts +142 -0
  967. package/server/services/workshop/experience/trusted-context.ts +90 -0
  968. package/server/services/workshop/experience/types.ts +168 -0
  969. package/server/services/workshop/experience/versions.ts +188 -0
  970. package/server/services/workshop/json-store.mjs +143 -143
  971. package/server/services/workshop/line-scope.ts +80 -80
  972. package/server/services/workshop/mes/mes-hook.ts +594 -594
  973. package/server/services/workshop/net/ssrf.ts +83 -83
  974. package/server/services/workshop/ontology/subgraph.core.ts +300 -300
  975. package/server/services/workshop/ontology/subgraph.service.ts +113 -113
  976. package/server/services/workshop/ops/error-ledger.ts +209 -209
  977. package/server/services/workshop/optimization/python/__pycache__/problems.cpython-312.pyc +0 -0
  978. package/server/services/workshop/plugins/host/config.mjs +135 -135
  979. package/server/services/workshop/plugins/host/index.mjs +23 -23
  980. package/server/services/workshop/plugins/host/init.mjs +140 -140
  981. package/server/services/workshop/plugins/host/state.mjs +54 -54
  982. package/server/services/workshop/plugins/host/toggle.mjs +64 -64
  983. package/server/services/workshop/plugins/host.mjs +9 -9
  984. package/server/services/workshop/projects/plan-progress.ts +140 -0
  985. package/server/services/workshop/projects/service.ts +31 -0
  986. package/server/services/workshop/rsi-adapter/experience.ts +3 -1
  987. package/server/services/workshop/runtime/agent-runtime/facade.ts +7 -7
  988. package/server/services/workshop/runtime/agent-runtime/harness-failure.ts +58 -58
  989. package/server/services/workshop/runtime/agent-runtime/helpers.ts +18 -18
  990. package/server/services/workshop/runtime/agent-runtime/index.ts +19 -19
  991. package/server/services/workshop/runtime/chat-mention.ts +164 -164
  992. package/server/services/workshop/runtime/chat-projection.ts +246 -246
  993. package/server/services/workshop/runtime/embedding-provider.ts +100 -100
  994. package/server/services/workshop/runtime/manager/bus.ts +182 -182
  995. package/server/services/workshop/runtime/manager/channel-template-constants.ts +20 -20
  996. package/server/services/workshop/runtime/manager/chat-reply.ts +181 -181
  997. package/server/services/workshop/runtime/manager/chat.ts +446 -446
  998. package/server/services/workshop/runtime/manager/dependency-health.ts +68 -0
  999. package/server/services/workshop/runtime/manager/facade.ts +24 -24
  1000. package/server/services/workshop/runtime/manager/index.ts +42 -42
  1001. package/server/services/workshop/runtime/manager/internal.ts +73 -73
  1002. package/server/services/workshop/runtime/manager/notifications.ts +108 -108
  1003. package/server/services/workshop/runtime/memory/contracts.ts +18 -18
  1004. package/server/services/workshop/runtime/memory/facade.ts +10 -10
  1005. package/server/services/workshop/runtime/memory/index.ts +27 -27
  1006. package/server/services/workshop/runtime/memory/score.ts +33 -33
  1007. package/server/services/workshop/runtime/memory/state.ts +7 -1
  1008. package/server/services/workshop/runtime/monitor.ts +3 -3
  1009. package/server/services/workshop/runtime/platform-notice.ts +113 -113
  1010. package/server/services/workshop/runtime/schedule-runtime.ts +347 -347
  1011. package/server/services/workshop/runtime/scheduler-loop/facade.ts +7 -7
  1012. package/server/services/workshop/runtime/scheduler-loop/helpers.ts +14 -14
  1013. package/server/services/workshop/runtime/scheduler-loop/index.ts +16 -16
  1014. package/server/services/workshop/runtime/task-engine/facade.ts +7 -7
  1015. package/server/services/workshop/runtime/task-engine/index.ts +15 -15
  1016. package/server/services/workshop/runtime/task-engine/types.ts +3 -3
  1017. package/server/services/workshop/runtime/user-notification-hub.ts +192 -192
  1018. package/server/types/pg.d.ts +49 -49
  1019. package/server/utils/asset-auth.ts +15 -15
  1020. package/server/utils/mojibake-guard.ts +29 -29
  1021. package/server/utils/request-ip.ts +29 -29
  1022. package/server/utils/stability-severity.ts +77 -77
  1023. package/shared/config/groups.mjs +241 -241
  1024. package/shared/lru.mjs +97 -97
  1025. package/tui/README.md +74 -74
  1026. package/tui/aw-tui.mjs +445 -445
  1027. package/tui/commands/index.mjs +287 -287
  1028. package/tui/components/chat-log.mjs +42 -42
  1029. package/tui/components/monitor-pane.mjs +39 -39
  1030. package/tui/components/root.mjs +53 -53
  1031. package/tui/components/status-bar.mjs +33 -33
  1032. package/tui/lib/api.mjs +82 -82
  1033. package/tui/lib/pickers.mjs +121 -121
  1034. package/tui/lib/reducers.mjs +218 -218
  1035. package/tui/lib/state.mjs +86 -86
  1036. package/tui/lib/virtual-terminal.mjs +48 -48
  1037. package/tui/lib/ws.mjs +125 -125
  1038. package/tui/theme.mjs +38 -38
  1039. package/.output/.AgentWorkShop/aml-python/__pycache__/aml_eval.cpython-312.pyc +0 -0
  1040. package/.output/.AgentWorkShop/aml-python/__pycache__/amlkit.cpython-312.pyc +0 -0
  1041. package/.output/.AgentWorkShop/aml-python/__pycache__/train-example.cpython-312.pyc +0 -0
  1042. package/.output/.AgentWorkShop/aml-python/__pycache__/train-hybrid-example.cpython-312.pyc +0 -0
  1043. package/.output/public/_nuxt/PluginSlot.CGH0vb95.css +0 -1
  1044. package/.output/public/_nuxt/aml.PalMp-5n.css +0 -1
  1045. package/.output/public/_nuxt/builds/meta/2f96705b-cf57-4bde-87a4-1b818b268f0f.json +0 -1
  1046. package/server/services/workshop/aml/python/__pycache__/aml_eval.cpython-312.pyc +0 -0
  1047. package/server/services/workshop/aml/python/__pycache__/amlkit.cpython-312.pyc +0 -0
  1048. package/server/services/workshop/aml/python/__pycache__/train-example.cpython-312.pyc +0 -0
  1049. package/server/services/workshop/aml/python/__pycache__/train-hybrid-example.cpython-312.pyc +0 -0
@@ -1,235 +1,235 @@
1
- /**
2
- * ScheduledTask 仓储:scheduled_tasks / scheduled_task_runs 两表 CRUD(v16 定时任务)。
3
- * 工厂接收 DatabaseSync(依赖注入),不持有任何单例;触发决策(next_run_at 计算)在 runtime 层。
4
- */
5
- import { randomUUID } from 'node:crypto'
6
- import type { DatabaseSync } from 'node:sqlite'
7
- import type { ScheduledTaskRow, ScheduledTaskRunRow } from './database'
8
-
9
- const COLS = `id, channel_id AS channelId, name, title, description, mode, interval_ms AS intervalMs,
10
- daily_time AS dailyTime, enabled, state, last_run_at AS lastRunAt, next_run_at AS nextRunAt,
11
- last_task_id AS lastTaskId, run_count AS runCount, fail_count AS failCount,
12
- consecutive_failures AS consecutiveFailures, max_consecutive_failures AS maxConsecutiveFailures,
13
- owner_user_id AS ownerUserId, created_at AS createdAt, updated_at AS updatedAt`
14
-
15
- const RUN_COLS = `id, schedule_id AS scheduleId, trigger_kind AS triggerKind, task_id AS taskId,
16
- state, error, started_at AS startedAt, ended_at AS endedAt`
17
-
18
- /** 每计划保留的运行历史上限(超出裁剪最旧;GC 在每次触发时顺带执行) */
19
- const RUNS_RETAIN_PER_SCHEDULE = 50
20
-
21
- export interface ScheduledTaskCreateInput {
22
- channelId: string
23
- name: string
24
- title: string
25
- description?: string
26
- mode: 'interval' | 'daily'
27
- intervalMs?: number
28
- dailyTime?: string
29
- maxConsecutiveFailures?: number
30
- ownerUserId?: string | null
31
- /** 首次触发时刻(ISO;由 manager/runtime 计算后传入持久化) */
32
- nextRunAt?: string | null
33
- }
34
-
35
- export interface ScheduledTaskPatch {
36
- name?: string
37
- title?: string
38
- description?: string
39
- mode?: 'interval' | 'daily'
40
- intervalMs?: number
41
- dailyTime?: string
42
- enabled?: number
43
- maxConsecutiveFailures?: number
44
- }
45
-
46
- export type ScheduledTaskRepo = ReturnType<typeof createScheduledTaskRepo>
47
-
48
- export function createScheduledTaskRepo(db: DatabaseSync) {
49
- const insert = db.prepare(
50
- `INSERT INTO scheduled_tasks (id, channel_id, name, title, description, mode, interval_ms, daily_time,
51
- enabled, state, next_run_at, max_consecutive_failures, owner_user_id, created_at, updated_at)
52
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
53
- )
54
- const selectById = db.prepare(`SELECT ${COLS} FROM scheduled_tasks WHERE id = ?`)
55
- const selectAll = db.prepare(`SELECT ${COLS} FROM scheduled_tasks ORDER BY createdAt DESC`)
56
- const selectEnabled = db.prepare(`SELECT ${COLS} FROM scheduled_tasks WHERE enabled = 1 ORDER BY next_run_at ASC`)
57
- const selectByChannel = db.prepare(`SELECT ${COLS} FROM scheduled_tasks WHERE channel_id = ? ORDER BY createdAt DESC`)
58
- const countEnabledByChannel = db.prepare(`SELECT COUNT(*) AS n FROM scheduled_tasks WHERE channel_id = ? AND enabled = 1`)
59
- const updateStmt = db.prepare(
60
- `UPDATE scheduled_tasks SET name = ?, title = ?, description = ?, mode = ?, interval_ms = ?, daily_time = ?,
61
- enabled = ?, state = ?, last_run_at = ?, next_run_at = ?, last_task_id = ?, run_count = ?, fail_count = ?,
62
- consecutive_failures = ?, max_consecutive_failures = ?, updated_at = ?
63
- WHERE id = ?`,
64
- )
65
- const removeStmt = db.prepare(`DELETE FROM scheduled_tasks WHERE id = ?`)
66
- const removeByChannelStmt = db.prepare(`DELETE FROM scheduled_tasks WHERE channel_id = ?`)
67
-
68
- const insertRun = db.prepare(
69
- `INSERT INTO scheduled_task_runs (id, schedule_id, trigger_kind, task_id, state, error, started_at, ended_at)
70
- VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,
71
- )
72
- const selectRunsBySchedule = db.prepare(
73
- `SELECT ${RUN_COLS} FROM scheduled_task_runs WHERE schedule_id = ? ORDER BY started_at DESC LIMIT ?`,
74
- )
75
- const findRunById = db.prepare(`SELECT ${RUN_COLS} FROM scheduled_task_runs WHERE id = ?`)
76
- const updateRunStmt = db.prepare(
77
- `UPDATE scheduled_task_runs SET task_id = ?, state = ?, error = ?, ended_at = ? WHERE id = ?`,
78
- )
79
- const listRunningRuns = db.prepare(`SELECT ${RUN_COLS} FROM scheduled_task_runs WHERE state = 'RUNNING'`)
80
- const pruneRunsStmt = db.prepare(
81
- `DELETE FROM scheduled_task_runs WHERE schedule_id = ? AND id NOT IN (
82
- SELECT id FROM scheduled_task_runs WHERE schedule_id = ? ORDER BY started_at DESC LIMIT ${RUNS_RETAIN_PER_SCHEDULE})`,
83
- )
84
-
85
- return {
86
- create(input: ScheduledTaskCreateInput): ScheduledTaskRow {
87
- const now = new Date().toISOString()
88
- const row: ScheduledTaskRow = {
89
- id: randomUUID(),
90
- channelId: input.channelId,
91
- name: input.name,
92
- title: input.title,
93
- description: input.description ?? '',
94
- mode: input.mode,
95
- intervalMs: input.intervalMs ?? 0,
96
- dailyTime: input.dailyTime ?? '',
97
- enabled: 1,
98
- state: 'idle',
99
- lastRunAt: null,
100
- nextRunAt: input.nextRunAt ?? null,
101
- lastTaskId: null,
102
- runCount: 0,
103
- failCount: 0,
104
- consecutiveFailures: 0,
105
- maxConsecutiveFailures: input.maxConsecutiveFailures ?? 0,
106
- ownerUserId: input.ownerUserId ?? null,
107
- createdAt: now,
108
- updatedAt: now,
109
- }
110
- insert.run(row.id, row.channelId, row.name, row.title, row.description, row.mode, row.intervalMs,
111
- row.dailyTime, row.enabled, row.state, row.nextRunAt, row.maxConsecutiveFailures,
112
- row.ownerUserId, row.createdAt, row.updatedAt)
113
- return row
114
- },
115
-
116
- list(): ScheduledTaskRow[] {
117
- return selectAll.all() as unknown as ScheduledTaskRow[]
118
- },
119
-
120
- listEnabled(): ScheduledTaskRow[] {
121
- return selectEnabled.all() as unknown as ScheduledTaskRow[]
122
- },
123
-
124
- listByChannel(channelId: string): ScheduledTaskRow[] {
125
- return selectByChannel.all(channelId) as unknown as ScheduledTaskRow[]
126
- },
127
-
128
- findById(id: string): ScheduledTaskRow | undefined {
129
- return selectById.get(id) as unknown as ScheduledTaskRow | undefined
130
- },
131
-
132
- /** 该 channel 当前启用的定时任务数(Channel「定时」标志的单一事实源) */
133
- countEnabledByChannel(channelId: string): number {
134
- return (countEnabledByChannel.get(channelId) as unknown as { n: number }).n
135
- },
136
-
137
- /** 全量计数(按 channel 分组):channels 列表批量附标志用,一次查询替代 N 次 count */
138
- countEnabledByChannelAll(): Map<string, number> {
139
- const rows = db.prepare(
140
- `SELECT channel_id AS channelId, COUNT(*) AS n FROM scheduled_tasks WHERE enabled = 1 GROUP BY channel_id`,
141
- ).all() as unknown as Array<{ channelId: string, n: number }>
142
- return new Map(rows.map(r => [r.channelId, r.n]))
143
- },
144
-
145
- /** 全量更新(runtime 触发/收敛的主写路径;patch 未给字段沿用现值) */
146
- update(id: string, patch: ScheduledTaskPatch & {
147
- state?: string
148
- lastRunAt?: string | null
149
- nextRunAt?: string | null
150
- lastTaskId?: string | null
151
- runCount?: number
152
- failCount?: number
153
- consecutiveFailures?: number
154
- }): ScheduledTaskRow | undefined {
155
- const current = selectById.get(id) as unknown as ScheduledTaskRow | undefined
156
- if (!current) return undefined
157
- const next: ScheduledTaskRow = {
158
- ...current,
159
- name: patch.name ?? current.name,
160
- title: patch.title ?? current.title,
161
- description: patch.description ?? current.description,
162
- mode: patch.mode ?? current.mode,
163
- intervalMs: patch.intervalMs ?? current.intervalMs,
164
- dailyTime: patch.dailyTime ?? current.dailyTime,
165
- enabled: patch.enabled ?? current.enabled,
166
- state: patch.state ?? current.state,
167
- lastRunAt: patch.lastRunAt !== undefined ? patch.lastRunAt : current.lastRunAt,
168
- nextRunAt: patch.nextRunAt !== undefined ? patch.nextRunAt : current.nextRunAt,
169
- lastTaskId: patch.lastTaskId !== undefined ? patch.lastTaskId : current.lastTaskId,
170
- runCount: patch.runCount ?? current.runCount,
171
- failCount: patch.failCount ?? current.failCount,
172
- consecutiveFailures: patch.consecutiveFailures ?? current.consecutiveFailures,
173
- maxConsecutiveFailures: patch.maxConsecutiveFailures ?? current.maxConsecutiveFailures,
174
- updatedAt: new Date().toISOString(),
175
- }
176
- updateStmt.run(next.name, next.title, next.description, next.mode, next.intervalMs, next.dailyTime,
177
- next.enabled, next.state, next.lastRunAt, next.nextRunAt, next.lastTaskId, next.runCount,
178
- next.failCount, next.consecutiveFailures, next.maxConsecutiveFailures, next.updatedAt, id)
179
- return next
180
- },
181
-
182
- remove(id: string): void {
183
- removeStmt.run(id)
184
- },
185
-
186
- /** channel 级联清理(FK CASCADE 兜底;removeChannel 显式调用以保证旧库无 FK 时也收敛) */
187
- removeByChannel(channelId: string): void {
188
- removeByChannelStmt.run(channelId)
189
- },
190
-
191
- // ===== 运行历史 =====
192
-
193
- createRun(input: { scheduleId: string, triggerKind: 'timer' | 'manual' }): ScheduledTaskRunRow {
194
- const row: ScheduledTaskRunRow = {
195
- id: randomUUID(),
196
- scheduleId: input.scheduleId,
197
- triggerKind: input.triggerKind,
198
- taskId: null,
199
- state: 'RUNNING',
200
- error: '',
201
- startedAt: new Date().toISOString(),
202
- endedAt: null,
203
- }
204
- insertRun.run(row.id, row.scheduleId, row.triggerKind, row.taskId, row.state, row.error, row.startedAt, row.endedAt)
205
- return row
206
- },
207
-
208
- findRun(runId: string): ScheduledTaskRunRow | undefined {
209
- return findRunById.get(runId) as unknown as ScheduledTaskRunRow | undefined
210
- },
211
-
212
- listRuns(scheduleId: string, limit = RUNS_RETAIN_PER_SCHEDULE): ScheduledTaskRunRow[] {
213
- return selectRunsBySchedule.all(scheduleId, limit) as unknown as ScheduledTaskRunRow[]
214
- },
215
-
216
- /** 在途运行(重启恢复/对账用) */
217
- listRunningRuns(): ScheduledTaskRunRow[] {
218
- return listRunningRuns.all() as unknown as ScheduledTaskRunRow[]
219
- },
220
-
221
- finishRun(runId: string, patch: { taskId?: string | null, state: 'COMPLETED' | 'FAILED', error?: string }): void {
222
- updateRunStmt.run(patch.taskId ?? null, patch.state, patch.error ?? '', new Date().toISOString(), runId)
223
- },
224
-
225
- /** 在途 run 回填 taskId(保持 RUNNING;ended_at 不动——收口统一走 finishRun) */
226
- attachTask(runId: string, taskId: string): void {
227
- db.prepare(`UPDATE scheduled_task_runs SET task_id = ? WHERE id = ?`).run(taskId, runId)
228
- },
229
-
230
- /** 保留策略:每计划只留最近 RUNS_RETAIN_PER_SCHEDULE 条(触发时顺带 GC) */
231
- pruneRuns(scheduleId: string): void {
232
- pruneRunsStmt.run(scheduleId, scheduleId)
233
- },
234
- }
235
- }
1
+ /**
2
+ * ScheduledTask 仓储:scheduled_tasks / scheduled_task_runs 两表 CRUD(v16 定时任务)。
3
+ * 工厂接收 DatabaseSync(依赖注入),不持有任何单例;触发决策(next_run_at 计算)在 runtime 层。
4
+ */
5
+ import { randomUUID } from 'node:crypto'
6
+ import type { DatabaseSync } from 'node:sqlite'
7
+ import type { ScheduledTaskRow, ScheduledTaskRunRow } from './database'
8
+
9
+ const COLS = `id, channel_id AS channelId, name, title, description, mode, interval_ms AS intervalMs,
10
+ daily_time AS dailyTime, enabled, state, last_run_at AS lastRunAt, next_run_at AS nextRunAt,
11
+ last_task_id AS lastTaskId, run_count AS runCount, fail_count AS failCount,
12
+ consecutive_failures AS consecutiveFailures, max_consecutive_failures AS maxConsecutiveFailures,
13
+ owner_user_id AS ownerUserId, created_at AS createdAt, updated_at AS updatedAt`
14
+
15
+ const RUN_COLS = `id, schedule_id AS scheduleId, trigger_kind AS triggerKind, task_id AS taskId,
16
+ state, error, started_at AS startedAt, ended_at AS endedAt`
17
+
18
+ /** 每计划保留的运行历史上限(超出裁剪最旧;GC 在每次触发时顺带执行) */
19
+ const RUNS_RETAIN_PER_SCHEDULE = 50
20
+
21
+ export interface ScheduledTaskCreateInput {
22
+ channelId: string
23
+ name: string
24
+ title: string
25
+ description?: string
26
+ mode: 'interval' | 'daily'
27
+ intervalMs?: number
28
+ dailyTime?: string
29
+ maxConsecutiveFailures?: number
30
+ ownerUserId?: string | null
31
+ /** 首次触发时刻(ISO;由 manager/runtime 计算后传入持久化) */
32
+ nextRunAt?: string | null
33
+ }
34
+
35
+ export interface ScheduledTaskPatch {
36
+ name?: string
37
+ title?: string
38
+ description?: string
39
+ mode?: 'interval' | 'daily'
40
+ intervalMs?: number
41
+ dailyTime?: string
42
+ enabled?: number
43
+ maxConsecutiveFailures?: number
44
+ }
45
+
46
+ export type ScheduledTaskRepo = ReturnType<typeof createScheduledTaskRepo>
47
+
48
+ export function createScheduledTaskRepo(db: DatabaseSync) {
49
+ const insert = db.prepare(
50
+ `INSERT INTO scheduled_tasks (id, channel_id, name, title, description, mode, interval_ms, daily_time,
51
+ enabled, state, next_run_at, max_consecutive_failures, owner_user_id, created_at, updated_at)
52
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
53
+ )
54
+ const selectById = db.prepare(`SELECT ${COLS} FROM scheduled_tasks WHERE id = ?`)
55
+ const selectAll = db.prepare(`SELECT ${COLS} FROM scheduled_tasks ORDER BY createdAt DESC`)
56
+ const selectEnabled = db.prepare(`SELECT ${COLS} FROM scheduled_tasks WHERE enabled = 1 ORDER BY next_run_at ASC`)
57
+ const selectByChannel = db.prepare(`SELECT ${COLS} FROM scheduled_tasks WHERE channel_id = ? ORDER BY createdAt DESC`)
58
+ const countEnabledByChannel = db.prepare(`SELECT COUNT(*) AS n FROM scheduled_tasks WHERE channel_id = ? AND enabled = 1`)
59
+ const updateStmt = db.prepare(
60
+ `UPDATE scheduled_tasks SET name = ?, title = ?, description = ?, mode = ?, interval_ms = ?, daily_time = ?,
61
+ enabled = ?, state = ?, last_run_at = ?, next_run_at = ?, last_task_id = ?, run_count = ?, fail_count = ?,
62
+ consecutive_failures = ?, max_consecutive_failures = ?, updated_at = ?
63
+ WHERE id = ?`,
64
+ )
65
+ const removeStmt = db.prepare(`DELETE FROM scheduled_tasks WHERE id = ?`)
66
+ const removeByChannelStmt = db.prepare(`DELETE FROM scheduled_tasks WHERE channel_id = ?`)
67
+
68
+ const insertRun = db.prepare(
69
+ `INSERT INTO scheduled_task_runs (id, schedule_id, trigger_kind, task_id, state, error, started_at, ended_at)
70
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,
71
+ )
72
+ const selectRunsBySchedule = db.prepare(
73
+ `SELECT ${RUN_COLS} FROM scheduled_task_runs WHERE schedule_id = ? ORDER BY started_at DESC LIMIT ?`,
74
+ )
75
+ const findRunById = db.prepare(`SELECT ${RUN_COLS} FROM scheduled_task_runs WHERE id = ?`)
76
+ const updateRunStmt = db.prepare(
77
+ `UPDATE scheduled_task_runs SET task_id = ?, state = ?, error = ?, ended_at = ? WHERE id = ?`,
78
+ )
79
+ const listRunningRuns = db.prepare(`SELECT ${RUN_COLS} FROM scheduled_task_runs WHERE state = 'RUNNING'`)
80
+ const pruneRunsStmt = db.prepare(
81
+ `DELETE FROM scheduled_task_runs WHERE schedule_id = ? AND id NOT IN (
82
+ SELECT id FROM scheduled_task_runs WHERE schedule_id = ? ORDER BY started_at DESC LIMIT ${RUNS_RETAIN_PER_SCHEDULE})`,
83
+ )
84
+
85
+ return {
86
+ create(input: ScheduledTaskCreateInput): ScheduledTaskRow {
87
+ const now = new Date().toISOString()
88
+ const row: ScheduledTaskRow = {
89
+ id: randomUUID(),
90
+ channelId: input.channelId,
91
+ name: input.name,
92
+ title: input.title,
93
+ description: input.description ?? '',
94
+ mode: input.mode,
95
+ intervalMs: input.intervalMs ?? 0,
96
+ dailyTime: input.dailyTime ?? '',
97
+ enabled: 1,
98
+ state: 'idle',
99
+ lastRunAt: null,
100
+ nextRunAt: input.nextRunAt ?? null,
101
+ lastTaskId: null,
102
+ runCount: 0,
103
+ failCount: 0,
104
+ consecutiveFailures: 0,
105
+ maxConsecutiveFailures: input.maxConsecutiveFailures ?? 0,
106
+ ownerUserId: input.ownerUserId ?? null,
107
+ createdAt: now,
108
+ updatedAt: now,
109
+ }
110
+ insert.run(row.id, row.channelId, row.name, row.title, row.description, row.mode, row.intervalMs,
111
+ row.dailyTime, row.enabled, row.state, row.nextRunAt, row.maxConsecutiveFailures,
112
+ row.ownerUserId, row.createdAt, row.updatedAt)
113
+ return row
114
+ },
115
+
116
+ list(): ScheduledTaskRow[] {
117
+ return selectAll.all() as unknown as ScheduledTaskRow[]
118
+ },
119
+
120
+ listEnabled(): ScheduledTaskRow[] {
121
+ return selectEnabled.all() as unknown as ScheduledTaskRow[]
122
+ },
123
+
124
+ listByChannel(channelId: string): ScheduledTaskRow[] {
125
+ return selectByChannel.all(channelId) as unknown as ScheduledTaskRow[]
126
+ },
127
+
128
+ findById(id: string): ScheduledTaskRow | undefined {
129
+ return selectById.get(id) as unknown as ScheduledTaskRow | undefined
130
+ },
131
+
132
+ /** 该 channel 当前启用的定时任务数(Channel「定时」标志的单一事实源) */
133
+ countEnabledByChannel(channelId: string): number {
134
+ return (countEnabledByChannel.get(channelId) as unknown as { n: number }).n
135
+ },
136
+
137
+ /** 全量计数(按 channel 分组):channels 列表批量附标志用,一次查询替代 N 次 count */
138
+ countEnabledByChannelAll(): Map<string, number> {
139
+ const rows = db.prepare(
140
+ `SELECT channel_id AS channelId, COUNT(*) AS n FROM scheduled_tasks WHERE enabled = 1 GROUP BY channel_id`,
141
+ ).all() as unknown as Array<{ channelId: string, n: number }>
142
+ return new Map(rows.map(r => [r.channelId, r.n]))
143
+ },
144
+
145
+ /** 全量更新(runtime 触发/收敛的主写路径;patch 未给字段沿用现值) */
146
+ update(id: string, patch: ScheduledTaskPatch & {
147
+ state?: string
148
+ lastRunAt?: string | null
149
+ nextRunAt?: string | null
150
+ lastTaskId?: string | null
151
+ runCount?: number
152
+ failCount?: number
153
+ consecutiveFailures?: number
154
+ }): ScheduledTaskRow | undefined {
155
+ const current = selectById.get(id) as unknown as ScheduledTaskRow | undefined
156
+ if (!current) return undefined
157
+ const next: ScheduledTaskRow = {
158
+ ...current,
159
+ name: patch.name ?? current.name,
160
+ title: patch.title ?? current.title,
161
+ description: patch.description ?? current.description,
162
+ mode: patch.mode ?? current.mode,
163
+ intervalMs: patch.intervalMs ?? current.intervalMs,
164
+ dailyTime: patch.dailyTime ?? current.dailyTime,
165
+ enabled: patch.enabled ?? current.enabled,
166
+ state: patch.state ?? current.state,
167
+ lastRunAt: patch.lastRunAt !== undefined ? patch.lastRunAt : current.lastRunAt,
168
+ nextRunAt: patch.nextRunAt !== undefined ? patch.nextRunAt : current.nextRunAt,
169
+ lastTaskId: patch.lastTaskId !== undefined ? patch.lastTaskId : current.lastTaskId,
170
+ runCount: patch.runCount ?? current.runCount,
171
+ failCount: patch.failCount ?? current.failCount,
172
+ consecutiveFailures: patch.consecutiveFailures ?? current.consecutiveFailures,
173
+ maxConsecutiveFailures: patch.maxConsecutiveFailures ?? current.maxConsecutiveFailures,
174
+ updatedAt: new Date().toISOString(),
175
+ }
176
+ updateStmt.run(next.name, next.title, next.description, next.mode, next.intervalMs, next.dailyTime,
177
+ next.enabled, next.state, next.lastRunAt, next.nextRunAt, next.lastTaskId, next.runCount,
178
+ next.failCount, next.consecutiveFailures, next.maxConsecutiveFailures, next.updatedAt, id)
179
+ return next
180
+ },
181
+
182
+ remove(id: string): void {
183
+ removeStmt.run(id)
184
+ },
185
+
186
+ /** channel 级联清理(FK CASCADE 兜底;removeChannel 显式调用以保证旧库无 FK 时也收敛) */
187
+ removeByChannel(channelId: string): void {
188
+ removeByChannelStmt.run(channelId)
189
+ },
190
+
191
+ // ===== 运行历史 =====
192
+
193
+ createRun(input: { scheduleId: string, triggerKind: 'timer' | 'manual' }): ScheduledTaskRunRow {
194
+ const row: ScheduledTaskRunRow = {
195
+ id: randomUUID(),
196
+ scheduleId: input.scheduleId,
197
+ triggerKind: input.triggerKind,
198
+ taskId: null,
199
+ state: 'RUNNING',
200
+ error: '',
201
+ startedAt: new Date().toISOString(),
202
+ endedAt: null,
203
+ }
204
+ insertRun.run(row.id, row.scheduleId, row.triggerKind, row.taskId, row.state, row.error, row.startedAt, row.endedAt)
205
+ return row
206
+ },
207
+
208
+ findRun(runId: string): ScheduledTaskRunRow | undefined {
209
+ return findRunById.get(runId) as unknown as ScheduledTaskRunRow | undefined
210
+ },
211
+
212
+ listRuns(scheduleId: string, limit = RUNS_RETAIN_PER_SCHEDULE): ScheduledTaskRunRow[] {
213
+ return selectRunsBySchedule.all(scheduleId, limit) as unknown as ScheduledTaskRunRow[]
214
+ },
215
+
216
+ /** 在途运行(重启恢复/对账用) */
217
+ listRunningRuns(): ScheduledTaskRunRow[] {
218
+ return listRunningRuns.all() as unknown as ScheduledTaskRunRow[]
219
+ },
220
+
221
+ finishRun(runId: string, patch: { taskId?: string | null, state: 'COMPLETED' | 'FAILED', error?: string }): void {
222
+ updateRunStmt.run(patch.taskId ?? null, patch.state, patch.error ?? '', new Date().toISOString(), runId)
223
+ },
224
+
225
+ /** 在途 run 回填 taskId(保持 RUNNING;ended_at 不动——收口统一走 finishRun) */
226
+ attachTask(runId: string, taskId: string): void {
227
+ db.prepare(`UPDATE scheduled_task_runs SET task_id = ? WHERE id = ?`).run(taskId, runId)
228
+ },
229
+
230
+ /** 保留策略:每计划只留最近 RUNS_RETAIN_PER_SCHEDULE 条(触发时顺带 GC) */
231
+ pruneRuns(scheduleId: string): void {
232
+ pruneRunsStmt.run(scheduleId, scheduleId)
233
+ },
234
+ }
235
+ }
@@ -1,72 +1,72 @@
1
- /**
2
- * SQLite 事务工具 —— 全进程统一的"可重入事务"入口。
3
- *
4
- * 为什么需要独立模块(而不是各自 `BEGIN`/`COMMIT`):
5
- * 1. **SQLite 不支持嵌套 `BEGIN`**(实测抛 `cannot start a transaction within a transaction`,
6
- * 且抛出后**外层事务仍处于打开状态** —— 后续写入会被静默并入外层,极难排查)。
7
- * 群聊写入路径会互相调用(发送消息 → 投递台账 → 通知 → outbox),批量发送还可能
8
- * 把多个 `sendChatMessage` 包进一个事务,所以"绝不嵌套"是一条无法靠约定守住的约束,
9
- * 必须由代码保证。
10
- * 2. 同一连接上的**非事务写入**会被并入当前事务(WS 的 400ms 事件落库缓冲就是这种写入)。
11
- * 事务回滚会连带丢弃那些 `channel_events`,因此写入方需要能查询"当前是否在事务里",
12
- * 据此推迟到事务结束后再落库 —— 这就是 `isTransactionOpen()` 的用途。
13
- *
14
- * 语义:
15
- * - 最外层:`BEGIN IMMEDIATE` … `COMMIT` / `ROLLBACK`(写锁前置,避免读→写升级死锁);
16
- * - 嵌套层:`SAVEPOINT` … `RELEASE` / `ROLLBACK TO`(内层失败只回滚内层,由调用方决定是否继续);
17
- * - 任何一层抛出都会向上传播(内层回滚后外层仍可选择回滚)。
18
- *
19
- * 约定:事务体内**只做同步写** —— 不要 await、不要跑 LLM/子进程/网络 IO。
20
- * 持有 `BEGIN IMMEDIATE` 期间会阻塞其它连接写入(busy_timeout 5s)。
21
- */
22
- import type { DatabaseSync } from 'node:sqlite'
23
-
24
- /** 当前事务深度(>0 = 有未提交事务)。进程内单实例:workshop 只有一条主连接。 */
25
- let txDepth = 0
26
-
27
- /** 当前是否处于未提交事务内(WS 落库缓冲等"顺带写入"据此推迟) */
28
- export function isTransactionOpen(): boolean {
29
- return txDepth > 0
30
- }
31
-
32
- /** 当前事务嵌套深度(排障/断言用) */
33
- export function transactionDepth(): number {
34
- return txDepth
35
- }
36
-
37
- /**
38
- * 在事务中执行 `fn`(可重入)。
39
- *
40
- * @throws 原样抛出 `fn` 的错误(已尽力回滚/回滚到保存点)
41
- */
42
- export function withTransaction<T>(db: DatabaseSync, fn: () => T): T {
43
- const nested = txDepth > 0
44
- const savepoint = `aw_sp_${txDepth}`
45
- db.exec(nested ? `SAVEPOINT ${savepoint}` : 'BEGIN IMMEDIATE')
46
- txDepth += 1
47
- try {
48
- const out = fn()
49
- db.exec(nested ? `RELEASE ${savepoint}` : 'COMMIT')
50
- return out
51
- }
52
- catch (err) {
53
- try {
54
- db.exec(nested ? `ROLLBACK TO ${savepoint}` : 'ROLLBACK')
55
- }
56
- catch {
57
- // 事务/保存点已失效(例如连接被关闭):原始错误更重要,继续向上抛
58
- }
59
- throw err
60
- }
61
- finally {
62
- txDepth -= 1
63
- }
64
- }
65
-
66
- /**
67
- * 测试专用:强制复位深度计数。
68
- * 仅在脚手架断言"事务已正确闭合"时使用 —— 生产中调用它等于掩盖未回滚的事务。
69
- */
70
- export function resetTransactionDepthForTest(): void {
71
- txDepth = 0
72
- }
1
+ /**
2
+ * SQLite 事务工具 —— 全进程统一的"可重入事务"入口。
3
+ *
4
+ * 为什么需要独立模块(而不是各自 `BEGIN`/`COMMIT`):
5
+ * 1. **SQLite 不支持嵌套 `BEGIN`**(实测抛 `cannot start a transaction within a transaction`,
6
+ * 且抛出后**外层事务仍处于打开状态** —— 后续写入会被静默并入外层,极难排查)。
7
+ * 群聊写入路径会互相调用(发送消息 → 投递台账 → 通知 → outbox),批量发送还可能
8
+ * 把多个 `sendChatMessage` 包进一个事务,所以"绝不嵌套"是一条无法靠约定守住的约束,
9
+ * 必须由代码保证。
10
+ * 2. 同一连接上的**非事务写入**会被并入当前事务(WS 的 400ms 事件落库缓冲就是这种写入)。
11
+ * 事务回滚会连带丢弃那些 `channel_events`,因此写入方需要能查询"当前是否在事务里",
12
+ * 据此推迟到事务结束后再落库 —— 这就是 `isTransactionOpen()` 的用途。
13
+ *
14
+ * 语义:
15
+ * - 最外层:`BEGIN IMMEDIATE` … `COMMIT` / `ROLLBACK`(写锁前置,避免读→写升级死锁);
16
+ * - 嵌套层:`SAVEPOINT` … `RELEASE` / `ROLLBACK TO`(内层失败只回滚内层,由调用方决定是否继续);
17
+ * - 任何一层抛出都会向上传播(内层回滚后外层仍可选择回滚)。
18
+ *
19
+ * 约定:事务体内**只做同步写** —— 不要 await、不要跑 LLM/子进程/网络 IO。
20
+ * 持有 `BEGIN IMMEDIATE` 期间会阻塞其它连接写入(busy_timeout 5s)。
21
+ */
22
+ import type { DatabaseSync } from 'node:sqlite'
23
+
24
+ /** 当前事务深度(>0 = 有未提交事务)。进程内单实例:workshop 只有一条主连接。 */
25
+ let txDepth = 0
26
+
27
+ /** 当前是否处于未提交事务内(WS 落库缓冲等"顺带写入"据此推迟) */
28
+ export function isTransactionOpen(): boolean {
29
+ return txDepth > 0
30
+ }
31
+
32
+ /** 当前事务嵌套深度(排障/断言用) */
33
+ export function transactionDepth(): number {
34
+ return txDepth
35
+ }
36
+
37
+ /**
38
+ * 在事务中执行 `fn`(可重入)。
39
+ *
40
+ * @throws 原样抛出 `fn` 的错误(已尽力回滚/回滚到保存点)
41
+ */
42
+ export function withTransaction<T>(db: DatabaseSync, fn: () => T): T {
43
+ const nested = txDepth > 0
44
+ const savepoint = `aw_sp_${txDepth}`
45
+ db.exec(nested ? `SAVEPOINT ${savepoint}` : 'BEGIN IMMEDIATE')
46
+ txDepth += 1
47
+ try {
48
+ const out = fn()
49
+ db.exec(nested ? `RELEASE ${savepoint}` : 'COMMIT')
50
+ return out
51
+ }
52
+ catch (err) {
53
+ try {
54
+ db.exec(nested ? `ROLLBACK TO ${savepoint}` : 'ROLLBACK')
55
+ }
56
+ catch {
57
+ // 事务/保存点已失效(例如连接被关闭):原始错误更重要,继续向上抛
58
+ }
59
+ throw err
60
+ }
61
+ finally {
62
+ txDepth -= 1
63
+ }
64
+ }
65
+
66
+ /**
67
+ * 测试专用:强制复位深度计数。
68
+ * 仅在脚手架断言"事务已正确闭合"时使用 —— 生产中调用它等于掩盖未回滚的事务。
69
+ */
70
+ export function resetTransactionDepthForTest(): void {
71
+ txDepth = 0
72
+ }