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,562 +1,562 @@
1
- /**
2
- * AgentTeam RPG 小镇(Three.js 3D 表现层)— 面向对象节点。
3
- *
4
- * 自 TownScene3D.ts 抽出:三类「场景实体实例」的封装,只通过宿主契约
5
- * (BlockHost / AgentHost / DeviceHost,见 town-scene3d-types.ts)回调场景,
6
- * 不直接依赖 TownScene3D 的其余实现。
7
- *
8
- * - Block3D:频道领地(布局/网格/成员,封装移动/边界/成员钳制);
9
- * - Agent3D:角色(模型/状态/行为 FSM/动画/活动范围);
10
- * - DeviceNode:数字孪生设备(节点网格/状态/遥测/状态环/transform 记忆)。
11
- */
12
- import * as THREE from 'three'
13
- import {
14
- AGENT_SPEED, ARRIVE, GROUND_Y, WAIT_MS,
15
- boundaryPoints, clampToAgentRange, clampToBoundary, normLayout, pointInBoundary,
16
- type AgentRangeLayout, type ChannelLayout,
17
- } from '#shared/town-scene-math'
18
- import { stepToward } from '#shared/town-behavior'
19
- import type {
20
- AgentHost, BlockHost, BehaviorState, DeviceHost, DeviceTwinSync,
21
- } from './town-scene3d-types'
22
-
23
- /** 边界几何体:椭圆/矩形线框,弯折朝向 rotationY(度)。
24
- * 轮廓点来自 #shared/town-scene-math.boundaryPoints(纯几何,场景只做渲染)。 */
25
- export function makeBoundary(shape: 'ellipse' | 'rect', rx: number, rz: number, color: number): THREE.LineLoop {
26
- const pts = boundaryPoints(shape, rx, rz, 48).map(([x, z]) => new THREE.Vector3(x, 0, z))
27
- const geo = new THREE.BufferGeometry().setFromPoints(pts)
28
- const line = new THREE.LineLoop(geo, new THREE.LineBasicMaterial({ color, transparent: true, opacity: 0.75, depthTest: false }))
29
- return line
30
- }
31
-
32
- /** 频道领地 3D 实例(面向对象:持有布局/网格/成员,封装移动/边界/成员钳制等行为)。
33
- * 数据来自 scene-layouts 持久化,由场景按数据库元数据实例化,并注入宿主控制器。 */
34
- export class Block3D {
35
- channelId!: string
36
- name!: string
37
- x!: number
38
- z!: number
39
- radiusX!: number
40
- radiusZ!: number
41
- shape!: 'ellipse' | 'rect'
42
- rotationY!: number
43
- color!: number
44
- platform!: THREE.Mesh
45
- /** 领地边缘发光环(工业孪生边界告示;随平台移动) */
46
- padRing!: THREE.Mesh
47
- /** 中央信标(HMI 定位销:点击 → 定位频道中心 + 唤醒边界编辑) */
48
- beacon!: THREE.Group
49
- /** 活动边界(编辑高亮) */
50
- boundary!: THREE.LineLoop
51
- label!: THREE.Sprite
52
- /** 本频道的 Agent3D 成员实例(面向对象聚合) */
53
- members: Agent3D[] = []
54
- /** 宿主场景控制器(实例化后注入;提供跨实体服务) */
55
- host!: BlockHost
56
-
57
- constructor(init: {
58
- channelId: string
59
- name: string
60
- x: number
61
- z: number
62
- radiusX: number
63
- radiusZ: number
64
- shape: 'ellipse' | 'rect'
65
- rotationY: number
66
- color: number
67
- platform: THREE.Mesh
68
- padRing: THREE.Mesh
69
- beacon: THREE.Group
70
- boundary: THREE.LineLoop
71
- label: THREE.Sprite
72
- }) {
73
- Object.assign(this, init)
74
- }
75
-
76
- /** 当前布局(与共享 ChannelLayout 同构;供边界面板/落库/E2E) */
77
- layout(): ChannelLayout {
78
- return { channelId: this.channelId, x: this.x, z: this.z, radiusX: this.radiusX, radiusZ: this.radiusZ, shape: this.shape, rotationY: this.rotationY }
79
- }
80
-
81
- /** 归一化布局(radius 钳制下限) */
82
- normLayout(): ChannelLayout {
83
- return normLayout(this.layout())
84
- }
85
-
86
- /** 边界手柄本地坐标(矩形四角 / 椭圆轴向四点;radius 是半轴或半宽)。 */
87
- handlePoints(): Array<[number, number]> {
88
- if (this.shape === 'rect') return [[this.radiusX, this.radiusZ], [-this.radiusX, this.radiusZ], [-this.radiusX, -this.radiusZ], [this.radiusX, -this.radiusZ]]
89
- return [[this.radiusX, 0], [-this.radiusX, 0], [0, this.radiusZ], [0, -this.radiusZ]]
90
- }
91
-
92
- /** 世界点是否落在领地边界内(点选/命中判定) */
93
- pointIn(x: number, z: number): boolean {
94
- return pointInBoundary(this.layout(), x, z)
95
- }
96
-
97
- /** 整体平移:更新中心、平台/边界/名牌网格,并携带全部成员落点与各自活动范围(行为内聚) */
98
- moveBy(dx: number, dz: number): void {
99
- this.x += dx
100
- this.z += dz
101
- this.platform.position.set(this.x, 0.16, this.z)
102
- this.padRing.position.set(this.x, 0.32, this.z)
103
- this.beacon.position.set(this.x, 0, this.z)
104
- this.boundary.position.set(this.x, 0.3, this.z)
105
- this.boundary.rotation.y = this.rotationY * Math.PI / 180
106
- this.label.position.set(this.x, 30, this.z)
107
- for (const a of this.members) {
108
- a.root.position.x += dx
109
- a.root.position.z += dz
110
- a.homeX += dx
111
- a.homeZ += dz
112
- if (a.range) {
113
- a.range.x += dx
114
- a.range.z += dz
115
- a.renderRangeLine()
116
- }
117
- }
118
- this.host.trackLayout(this)
119
- }
120
-
121
- /** 按补丁更新布局字段(边界编辑;钳制下限由宿主统一保证) */
122
- applyPatch(patch: Partial<ChannelLayout>): void {
123
- if (patch.x !== undefined) this.x = patch.x
124
- if (patch.z !== undefined) this.z = patch.z
125
- if (patch.radiusX !== undefined) this.radiusX = patch.radiusX
126
- if (patch.radiusZ !== undefined) this.radiusZ = patch.radiusZ
127
- if (patch.shape !== undefined) this.shape = patch.shape
128
- if (patch.rotationY !== undefined) this.rotationY = patch.rotationY
129
- }
130
-
131
- /** 把成员落点与各自活动范围收进当前频道边界(边界缩放/整体移动后调用) */
132
- clampMembersAndRanges(): void {
133
- const layout = this.layout()
134
- for (const a of this.members) {
135
- const c = clampToBoundary(layout, a.root.position.x, a.root.position.z, 16)
136
- a.root.position.x = c.x
137
- a.root.position.z = c.z
138
- a.homeX = c.x
139
- a.homeZ = c.z
140
- if (a.range) {
141
- a.renderRangeLine()
142
- const cc = clampToAgentRange(a.range, a.homeX, a.homeZ, 0)
143
- if (cc.x !== a.homeX || cc.z !== a.homeZ) {
144
- a.homeX = cc.x
145
- a.homeZ = cc.z
146
- a.root.position.x = cc.x
147
- a.root.position.z = cc.z
148
- }
149
- }
150
- }
151
- this.host.markDirty()
152
- }
153
- }
154
-
155
- /** 角色 3D 实例(面向对象:持有模型/状态/行为,封装漫游 FSM、移动钳制、动画、活动范围)。
156
- * 由场景按 entities/数据库元数据(home/range/modelRef)实例化并注入宿主;动画状态驱动 motion 事件。 */
157
- export class Agent3D {
158
- channelId!: string
159
- agentId!: string
160
- name!: string
161
- role!: 'lead' | 'worker'
162
- /** 根 Group(位置=落地点,脚底) */
163
- root!: THREE.Group
164
- /** 模型子节点(换模型时替换) —— 始终存在(空组占位) */
165
- model!: THREE.Group
166
- mixer!: THREE.AnimationMixer | null
167
- /** 当前模型动画 clip(若有) */
168
- clips!: THREE.AnimationClip[]
169
- /** 身份色(频道哈希色;气泡/小地图等取色数据源) */
170
- colorNum!: number
171
- /** 头顶名字 Sprite */
172
- nameSprite!: THREE.Sprite
173
- /** 当前气泡 */
174
- bubble!: THREE.Sprite | null
175
- /** 当前头顶聊天气泡文本(调试/HUD 用;null = 无气泡) */
176
- bubbleText!: string | null
177
- bubbleTimer!: ReturnType<typeof setTimeout> | null
178
- /** 状态/进度/行为 */
179
- state!: 'idle' | 'busy' | 'stopped'
180
- progress!: number | null
181
- /** 行为 FSM */
182
- behavior!: BehaviorState
183
- /** 用户拖动中 */
184
- dragging!: boolean
185
- /** home(行为结束后回归) */
186
- homeX!: number
187
- homeZ!: number
188
- /** 独立活动范围(编辑模式框选/手柄;null = 沿用频道边界) */
189
- range!: AgentRangeLayout | null
190
- /** 活动范围线框(随 range 渲染;清除/重建时移除) */
191
- rangeLine!: THREE.LineLoop | null
192
- textureKey!: string
193
- modelRef!: string
194
- /** 当前动画状态(数据驱动模型:idle/walk;经宿主 motion 事件监听) */
195
- animState: 'idle' | 'walk' = 'idle'
196
- /** 当前 mixer action(crossfade 切换用;null = 未开始) */
197
- activeAction: THREE.AnimationAction | null = null
198
- /** 宿主场景控制器(实例化后注入) */
199
- host!: AgentHost
200
- /** 本帧是否在移动(update 结束时驱动动画) */
201
- private moving = false
202
- /** 脚下光环组(频道色身份标识;root 子节点,随移动跟随,零每帧定位成本) */
203
- aura: THREE.Group | null = null
204
- /** 光环材质(渲染循环呼吸;userData.baseOp 存基准透明度) */
205
- auraMats: THREE.MeshBasicMaterial[] = []
206
- /** 呼吸相位(每实例随机,避免全场同频闪烁) */
207
- auraPhase = 0
208
-
209
- /** 挂脚下光环(频道色,与领地同源;lead 加外环 —— 角色身份一眼可辨) */
210
- attachAura(color: number, role: 'lead' | 'worker'): void {
211
- const g = new THREE.Group()
212
- const mats: THREE.MeshBasicMaterial[] = []
213
- const mk = (r0: number, r1: number, y: number, op: number): void => {
214
- const m = new THREE.MeshBasicMaterial({ color, transparent: true, opacity: op, side: THREE.DoubleSide, depthWrite: false, blending: THREE.AdditiveBlending })
215
- m.userData.baseOp = op
216
- mats.push(m)
217
- const mesh = new THREE.Mesh(new THREE.RingGeometry(r0, r1, 44), m)
218
- mesh.rotation.x = -Math.PI / 2
219
- mesh.position.y = y
220
- g.add(mesh)
221
- }
222
- mk(34, 40, 0.36, 0.26)
223
- if (role === 'lead') mk(46, 50, 0.42, 0.2)
224
- this.root.add(g)
225
- this.aura = g
226
- this.auraMats = mats
227
- this.auraPhase = Math.random() * Math.PI * 2
228
- }
229
-
230
- constructor(init: {
231
- channelId: string
232
- agentId: string
233
- name: string
234
- role: 'lead' | 'worker'
235
- root: THREE.Group
236
- model: THREE.Group
237
- mixer: THREE.AnimationMixer | null
238
- clips: THREE.AnimationClip[]
239
- colorNum: number
240
- nameSprite: THREE.Sprite
241
- bubble: THREE.Sprite | null
242
- bubbleText: string | null
243
- bubbleTimer: ReturnType<typeof setTimeout> | null
244
- state: 'idle' | 'busy' | 'stopped'
245
- progress: number | null
246
- behavior: BehaviorState
247
- dragging: boolean
248
- homeX: number
249
- homeZ: number
250
- range: AgentRangeLayout | null
251
- rangeLine: THREE.LineLoop | null
252
- textureKey: string
253
- modelRef: string
254
- }) {
255
- Object.assign(this, init)
256
- }
257
-
258
- /** 到达判定 */
259
- reached(target: { x: number, z: number }): boolean {
260
- return Math.hypot(this.root.position.x - target.x, this.root.position.z - target.z) <= ARRIVE
261
- }
262
-
263
- /** 朝目标匀速走一步(按自身活动范围/频道边界钳制;驱动朝向与动画) */
264
- driveToward(target: { x: number, z: number }, speed: number, dt: number): void {
265
- this.moving = true
266
- const cur = { x: this.root.position.x, z: this.root.position.z }
267
- const next = stepToward({ x: cur.x, y: cur.z }, { x: target.x, y: target.z }, speed, dt)
268
- let nx = next.x
269
- let nz = next.y
270
- if (this.range) {
271
- const clamped = clampToAgentRange(this.range, nx, nz, 6)
272
- nx = clamped.x
273
- nz = clamped.z
274
- }
275
- else {
276
- const layout = this.host.blockLayoutOf(this.channelId)
277
- if (layout) {
278
- const clamped = clampToBoundary(layout, nx, nz, 6)
279
- nx = clamped.x
280
- nz = clamped.z
281
- }
282
- }
283
- this.root.position.x = nx
284
- this.root.position.z = nz
285
- // 朝向平滑:朝移动方向插值转动(左/右两态,不用瞬间 snap,2.5D 行走更顺)
286
- const dir = next.dir
287
- const targetY = dir === 'left' ? Math.PI : 0
288
- const curY = this.root.rotation.y
289
- // 最短角差插值(0 ↔ π 之间取捷径;步长限速防抖)
290
- let d = targetY - curY
291
- if (d > Math.PI) d -= Math.PI * 2
292
- else if (d < -Math.PI) d += Math.PI * 2
293
- const maxStep = dt * 3.2
294
- this.root.rotation.y = curY + Math.max(-maxStep, Math.min(maxStep, d))
295
- void dt
296
- }
297
-
298
- /** 行为 FSM(idle/roam/approach/wait/returnHome);由渲染循环每帧驱动,动画随移动状态切换 */
299
- update(dt: number): void {
300
- this.moving = false
301
- try {
302
- this.updateBehavior(dt)
303
- }
304
- finally {
305
- this.playWalkAnim(this.moving)
306
- }
307
- }
308
-
309
- private updateBehavior(dt: number): void {
310
- const b = this.behavior
311
- if (b.mode === 'idle' || b.mode === 'roam') {
312
- if (b.engaged || this.dragging) return
313
- b.mode = 'roam'
314
- if (!b.roamTarget) {
315
- // 到达后就地停顿片刻:保持 idle 动画,营造走走停停的闲逛节奏(并产生 motion 事件)
316
- if (performance.now() < b.pauseUntil) return
317
- // 漫游目标:有独立活动范围 → 在自身范围内取点;否则沿用频道边界内取点
318
- const layout = this.host.blockLayoutOf(this.channelId)
319
- let tx: number
320
- let tz: number
321
- if (this.range) {
322
- tx = this.homeX + (Math.random() * 2 - 1) * this.range.radiusX * 0.9
323
- tz = this.homeZ + (Math.random() * 2 - 1) * this.range.radiusZ * 0.9
324
- const clamped = clampToAgentRange(this.range, tx, tz, 8)
325
- tx = clamped.x
326
- tz = clamped.z
327
- }
328
- else {
329
- const range = layout ? Math.min(layout.radiusX, layout.radiusZ) * 0.45 : 80
330
- tx = this.homeX + (Math.random() * 2 - 1) * range
331
- tz = this.homeZ + (Math.random() * 2 - 1) * range * 0.6
332
- if (layout) {
333
- const clamped = clampToBoundary(layout, tx, tz, 16)
334
- tx = clamped.x
335
- tz = clamped.z
336
- }
337
- }
338
- b.roamTarget = { x: tx, z: tz }
339
- }
340
- this.driveToward(b.roamTarget, AGENT_SPEED * 0.5, dt)
341
- if (this.reached(b.roamTarget)) {
342
- b.roamTarget = null
343
- b.pauseUntil = performance.now() + 350 + Math.random() * 900
344
- }
345
- return
346
- }
347
- if (b.mode === 'approach') {
348
- const target = b.targetId ? this.host.getAgent(b.targetId) : undefined
349
- if (!target) {
350
- b.mode = 'idle'
351
- return
352
- }
353
- let pos = { x: target.root.position.x, z: target.root.position.z }
354
- // 目标在自身活动范围外 → 逼近到自身范围边界(送达交接在边界处完成)
355
- if (this.range) {
356
- const c = clampToAgentRange(this.range, pos.x, pos.z, 8)
357
- pos = { x: c.x, z: c.z }
358
- }
359
- this.driveToward(pos, AGENT_SPEED, dt)
360
- if (this.reached(pos)) {
361
- this.host.deliverBehavior(this, target)
362
- if (b.action?.requireReply) {
363
- b.mode = 'wait'
364
- b.waitUntil = performance.now() + WAIT_MS
365
- }
366
- else {
367
- b.mode = 'returnHome'
368
- this.host.releaseEngaged(this)
369
- b.targetId = null
370
- }
371
- }
372
- return
373
- }
374
- if (b.mode === 'wait') {
375
- if (this.dragging) return
376
- const target = b.targetId ? this.host.getAgent(b.targetId) : undefined
377
- if (target && !target.dragging) {
378
- const stand = { x: target.root.position.x + 28, z: target.root.position.z + 8 }
379
- this.driveToward(stand, AGENT_SPEED * 0.6, dt)
380
- }
381
- if (performance.now() >= b.waitUntil) {
382
- b.mode = 'returnHome'
383
- this.host.releaseEngaged(this)
384
- }
385
- return
386
- }
387
- if (b.mode === 'returnHome') {
388
- if (this.dragging) return
389
- const home = { x: this.homeX, z: this.homeZ }
390
- this.driveToward(home, AGENT_SPEED * 0.7, dt)
391
- if (this.reached(home)) {
392
- this.root.position.set(this.homeX, GROUND_Y, this.homeZ)
393
- b.mode = 'idle'
394
- b.targetId = null
395
- b.action = undefined
396
- }
397
- }
398
- }
399
-
400
- /** 动画状态切换(有 clip: idle/walk 动作;无 clip: 上下浮动 bob);切换时经宿主广播 motion 事件 */
401
- playWalkAnim(moving: boolean): void {
402
- const next = moving ? 'walk' : 'idle'
403
- if (this.animState !== next) {
404
- this.animState = next
405
- this.host.notifyMotion(this)
406
- }
407
- const bob = () => {
408
- // 程序化动作绑定(model 局部,色环/名牌保持贴地稳定):
409
- // 待机呼吸浮动 + 行走跳跃颠簸 + 行走左右微摆
410
- const t = performance.now()
411
- const breathe = 1.2 + Math.sin(t * 0.0016) * 1.6
412
- const hop = Math.abs(Math.sin(t * 0.005)) * 6
413
- this.model.position.y = moving ? hop : breathe
414
- const swayTarget = moving ? Math.sin(t * 0.006) * 0.07 : 0
415
- this.model.rotation.z += (swayTarget - this.model.rotation.z) * 0.12
416
- }
417
- if (this.clips.length === 0) {
418
- bob()
419
- return
420
- }
421
- // 有动画 clip:名字感知选择(剪辑命名各异:WALK/Walk、idle/stand/breath...),
422
- // 先按语义匹配,找不到回退索引(idle→0,walk→1);仅含走路剪辑的模型待机时
423
- // 回退程序化 bob,避免原地播放走路。crossfade 平滑过渡(避免双 action 叠加)。
424
- if (!this.mixer) return
425
- const lower = (c: THREE.AnimationClip) => c.name.toLowerCase()
426
- const clip = moving
427
- ? (this.clips.find(c => /walk|run|move/.test(lower(c))) ?? this.clips[Math.min(1, this.clips.length - 1)])
428
- : (this.clips.find(c => /idle|stand|breath/.test(lower(c))) ?? (this.clips.length > 1 ? this.clips[0] : null))
429
- if (!clip) {
430
- if (this.activeAction) {
431
- this.activeAction.fadeOut(0.15)
432
- this.activeAction = null
433
- }
434
- bob()
435
- return
436
- }
437
- const nextAction = this.mixer.clipAction(clip)
438
- if (this.activeAction === nextAction) {
439
- nextAction.timeScale = moving ? 1.3 : 0.9
440
- return
441
- }
442
- nextAction.reset().setEffectiveTimeScale(moving ? 1.3 : 0.9).fadeIn(0.15).play()
443
- if (this.activeAction) this.activeAction.fadeOut(0.15)
444
- this.activeAction = nextAction
445
- }
446
-
447
- /** 更新 home 落点(行为结束后回归点;含拖拽/范围位移后落库路径) */
448
- setHome(x: number, z: number): void {
449
- this.homeX = x
450
- this.homeZ = z
451
- }
452
-
453
- /** 渲染/刷新活动范围线框(数据驱动:range 变更 → 线框重建)+ 可见性 */
454
- renderRangeLine(): void {
455
- if (this.rangeLine) {
456
- this.host.threeScene.remove(this.rangeLine)
457
- this.rangeLine = null
458
- }
459
- if (!this.range) return
460
- const color = 0x41c8f4
461
- const line = makeBoundary(this.range.shape, this.range.radiusX, this.range.radiusZ, color)
462
- // 虚线描边(与频道实线边界区分;2.5D 可读性)
463
- line.material = new THREE.LineDashedMaterial({ color, transparent: true, opacity: 0.75, depthTest: false, dashSize: 14, gapSize: 9 })
464
- line.computeLineDistances()
465
- line.position.set(this.range.x, 0.5, this.range.z)
466
- line.rotation.y = this.range.rotationY * Math.PI / 180
467
- line.visible = this.host.rangeLineVisibleFor(this)
468
- this.host.threeScene.add(line)
469
- this.rangeLine = line
470
- this.host.markDirty()
471
- }
472
-
473
- /** 挂气泡(替换旧气泡;宿主完成纹理渲染) */
474
- attachBubble(sprite: THREE.Sprite, text: string): void {
475
- if (this.bubble) {
476
- this.host.threeScene.remove(this.bubble)
477
- this.bubbleText = null
478
- }
479
- this.bubble = sprite
480
- this.bubbleText = text
481
- }
482
-
483
- /** 移除气泡(宿主负责从场景摘除) */
484
- clearBubble(): void {
485
- if (!this.bubble) return
486
- this.host.threeScene.remove(this.bubble)
487
- this.bubble = null
488
- this.bubbleText = null
489
- }
490
- }
491
-
492
- /** 数字孪生设备 3D 实例(面向对象:持有节点网格/状态/遥测,封装讑生同步、状态环、模型重挂、transform 记忆)。
493
- * 由场景按 device-twins 数据库元数据实例化;state/telemetry 数据驱动渲染。 */
494
- export class DeviceNode {
495
- twinId!: string
496
- name!: string
497
- modelRef!: string
498
- root!: THREE.Group
499
- /** 模型挂载组(换模型时 clear 重挂;缩放施加于此) */
500
- holder!: THREE.Group
501
- ring!: THREE.Mesh
502
- /** 运行态动效弧(仅 running 可见;渲染循环缓转 —— 语义动效:设备在转 = 在产) */
503
- arc: THREE.Mesh | null = null
504
- label!: THREE.Sprite
505
- state!: 'idle' | 'running' | 'offline' | 'alarm'
506
- telemetry!: Record<string, number | string | boolean>
507
- /** 宿主场景控制器(实例化后注入) */
508
- host!: DeviceHost
509
-
510
- constructor(init: {
511
- twinId: string
512
- name: string
513
- modelRef: string
514
- root: THREE.Group
515
- holder: THREE.Group
516
- ring: THREE.Mesh
517
- label: THREE.Sprite
518
- state: 'idle' | 'running' | 'offline' | 'alarm'
519
- telemetry: Record<string, number | string | boolean>
520
- }) {
521
- Object.assign(this, init)
522
- }
523
-
524
- /** 模型顶面世界高度缓存(HUD/callout 每帧读取;缩放变更时失效) */
525
- topYCache: number | null = null
526
- /** 当前产线光晕色(空 = 未分配) */
527
- lineColor = ''
528
- /** 产线换色回调(recreateDaqNode 装配;applyTwin 检测变化时重 tint) */
529
- applyLine: ((color: string) => void) | null = null
530
-
531
- /** 状态环颜色(数据驱动:状态变化/产线换色时调用,渲染循环不再每帧重刷)。
532
- * 分配了产线的节点(数采)环随产线色 —— 状态生命感已由 LED 呼吸环表达;常规设备环 = 状态色。 */
533
- updateRing(): void {
534
- const mat = this.ring.material as THREE.MeshBasicMaterial
535
- if (this.lineColor) mat.color.set(this.lineColor)
536
- else mat.color.setHex(this.state === 'alarm' ? 0xff6b6b : this.state === 'offline' ? 0x8496a5 : this.state === 'running' ? 0x35e0a0 : 0xf6c453)
537
- if (this.arc) this.arc.visible = this.state === 'running'
538
- }
539
-
540
- /** 与数据库讑生记录收敛(状态/遥测/名称/模型/产线光晕;宿主完成名牌与模型重挂) */
541
- applyTwin(t: DeviceTwinSync): void {
542
- if (t.state) this.state = t.state
543
- if (t.telemetry) this.telemetry = { ...this.telemetry, ...t.telemetry }
544
- if (t.name && t.name !== this.name) this.host.renameDeviceSprite(this, t.name)
545
- if (t.modelRef && t.modelRef !== this.modelRef) this.host.swapDeviceModelSprite(this, t.modelRef)
546
- if ((t.lineColor ?? '') !== this.lineColor) {
547
- this.lineColor = t.lineColor ?? ''
548
- this.applyLine?.(this.lineColor)
549
- }
550
- this.updateRing()
551
- this.host.markDirty()
552
- }
553
-
554
- /** 记录当前 transform(供防抖落库快照) */
555
- rememberTransform(): { posX: number, posZ: number, rotationY: number } {
556
- return {
557
- posX: Math.round(this.root.position.x * 10) / 10,
558
- posZ: Math.round(this.root.position.z * 10) / 10,
559
- rotationY: Math.round(THREE.MathUtils.radToDeg(this.root.rotation.y) * 10) / 10,
560
- }
561
- }
562
- }
1
+ /**
2
+ * AgentTeam RPG 小镇(Three.js 3D 表现层)— 面向对象节点。
3
+ *
4
+ * 自 TownScene3D.ts 抽出:三类「场景实体实例」的封装,只通过宿主契约
5
+ * (BlockHost / AgentHost / DeviceHost,见 town-scene3d-types.ts)回调场景,
6
+ * 不直接依赖 TownScene3D 的其余实现。
7
+ *
8
+ * - Block3D:频道领地(布局/网格/成员,封装移动/边界/成员钳制);
9
+ * - Agent3D:角色(模型/状态/行为 FSM/动画/活动范围);
10
+ * - DeviceNode:数字孪生设备(节点网格/状态/遥测/状态环/transform 记忆)。
11
+ */
12
+ import * as THREE from 'three'
13
+ import {
14
+ AGENT_SPEED, ARRIVE, GROUND_Y, WAIT_MS,
15
+ boundaryPoints, clampToAgentRange, clampToBoundary, normLayout, pointInBoundary,
16
+ type AgentRangeLayout, type ChannelLayout,
17
+ } from '#shared/town-scene-math'
18
+ import { stepToward } from '#shared/town-behavior'
19
+ import type {
20
+ AgentHost, BlockHost, BehaviorState, DeviceHost, DeviceTwinSync,
21
+ } from './town-scene3d-types'
22
+
23
+ /** 边界几何体:椭圆/矩形线框,弯折朝向 rotationY(度)。
24
+ * 轮廓点来自 #shared/town-scene-math.boundaryPoints(纯几何,场景只做渲染)。 */
25
+ export function makeBoundary(shape: 'ellipse' | 'rect', rx: number, rz: number, color: number): THREE.LineLoop {
26
+ const pts = boundaryPoints(shape, rx, rz, 48).map(([x, z]) => new THREE.Vector3(x, 0, z))
27
+ const geo = new THREE.BufferGeometry().setFromPoints(pts)
28
+ const line = new THREE.LineLoop(geo, new THREE.LineBasicMaterial({ color, transparent: true, opacity: 0.75, depthTest: false }))
29
+ return line
30
+ }
31
+
32
+ /** 频道领地 3D 实例(面向对象:持有布局/网格/成员,封装移动/边界/成员钳制等行为)。
33
+ * 数据来自 scene-layouts 持久化,由场景按数据库元数据实例化,并注入宿主控制器。 */
34
+ export class Block3D {
35
+ channelId!: string
36
+ name!: string
37
+ x!: number
38
+ z!: number
39
+ radiusX!: number
40
+ radiusZ!: number
41
+ shape!: 'ellipse' | 'rect'
42
+ rotationY!: number
43
+ color!: number
44
+ platform!: THREE.Mesh
45
+ /** 领地边缘发光环(工业孪生边界告示;随平台移动) */
46
+ padRing!: THREE.Mesh
47
+ /** 中央信标(HMI 定位销:点击 → 定位频道中心 + 唤醒边界编辑) */
48
+ beacon!: THREE.Group
49
+ /** 活动边界(编辑高亮) */
50
+ boundary!: THREE.LineLoop
51
+ label!: THREE.Sprite
52
+ /** 本频道的 Agent3D 成员实例(面向对象聚合) */
53
+ members: Agent3D[] = []
54
+ /** 宿主场景控制器(实例化后注入;提供跨实体服务) */
55
+ host!: BlockHost
56
+
57
+ constructor(init: {
58
+ channelId: string
59
+ name: string
60
+ x: number
61
+ z: number
62
+ radiusX: number
63
+ radiusZ: number
64
+ shape: 'ellipse' | 'rect'
65
+ rotationY: number
66
+ color: number
67
+ platform: THREE.Mesh
68
+ padRing: THREE.Mesh
69
+ beacon: THREE.Group
70
+ boundary: THREE.LineLoop
71
+ label: THREE.Sprite
72
+ }) {
73
+ Object.assign(this, init)
74
+ }
75
+
76
+ /** 当前布局(与共享 ChannelLayout 同构;供边界面板/落库/E2E) */
77
+ layout(): ChannelLayout {
78
+ return { channelId: this.channelId, x: this.x, z: this.z, radiusX: this.radiusX, radiusZ: this.radiusZ, shape: this.shape, rotationY: this.rotationY }
79
+ }
80
+
81
+ /** 归一化布局(radius 钳制下限) */
82
+ normLayout(): ChannelLayout {
83
+ return normLayout(this.layout())
84
+ }
85
+
86
+ /** 边界手柄本地坐标(矩形四角 / 椭圆轴向四点;radius 是半轴或半宽)。 */
87
+ handlePoints(): Array<[number, number]> {
88
+ if (this.shape === 'rect') return [[this.radiusX, this.radiusZ], [-this.radiusX, this.radiusZ], [-this.radiusX, -this.radiusZ], [this.radiusX, -this.radiusZ]]
89
+ return [[this.radiusX, 0], [-this.radiusX, 0], [0, this.radiusZ], [0, -this.radiusZ]]
90
+ }
91
+
92
+ /** 世界点是否落在领地边界内(点选/命中判定) */
93
+ pointIn(x: number, z: number): boolean {
94
+ return pointInBoundary(this.layout(), x, z)
95
+ }
96
+
97
+ /** 整体平移:更新中心、平台/边界/名牌网格,并携带全部成员落点与各自活动范围(行为内聚) */
98
+ moveBy(dx: number, dz: number): void {
99
+ this.x += dx
100
+ this.z += dz
101
+ this.platform.position.set(this.x, 0.16, this.z)
102
+ this.padRing.position.set(this.x, 0.32, this.z)
103
+ this.beacon.position.set(this.x, 0, this.z)
104
+ this.boundary.position.set(this.x, 0.3, this.z)
105
+ this.boundary.rotation.y = this.rotationY * Math.PI / 180
106
+ this.label.position.set(this.x, 30, this.z)
107
+ for (const a of this.members) {
108
+ a.root.position.x += dx
109
+ a.root.position.z += dz
110
+ a.homeX += dx
111
+ a.homeZ += dz
112
+ if (a.range) {
113
+ a.range.x += dx
114
+ a.range.z += dz
115
+ a.renderRangeLine()
116
+ }
117
+ }
118
+ this.host.trackLayout(this)
119
+ }
120
+
121
+ /** 按补丁更新布局字段(边界编辑;钳制下限由宿主统一保证) */
122
+ applyPatch(patch: Partial<ChannelLayout>): void {
123
+ if (patch.x !== undefined) this.x = patch.x
124
+ if (patch.z !== undefined) this.z = patch.z
125
+ if (patch.radiusX !== undefined) this.radiusX = patch.radiusX
126
+ if (patch.radiusZ !== undefined) this.radiusZ = patch.radiusZ
127
+ if (patch.shape !== undefined) this.shape = patch.shape
128
+ if (patch.rotationY !== undefined) this.rotationY = patch.rotationY
129
+ }
130
+
131
+ /** 把成员落点与各自活动范围收进当前频道边界(边界缩放/整体移动后调用) */
132
+ clampMembersAndRanges(): void {
133
+ const layout = this.layout()
134
+ for (const a of this.members) {
135
+ const c = clampToBoundary(layout, a.root.position.x, a.root.position.z, 16)
136
+ a.root.position.x = c.x
137
+ a.root.position.z = c.z
138
+ a.homeX = c.x
139
+ a.homeZ = c.z
140
+ if (a.range) {
141
+ a.renderRangeLine()
142
+ const cc = clampToAgentRange(a.range, a.homeX, a.homeZ, 0)
143
+ if (cc.x !== a.homeX || cc.z !== a.homeZ) {
144
+ a.homeX = cc.x
145
+ a.homeZ = cc.z
146
+ a.root.position.x = cc.x
147
+ a.root.position.z = cc.z
148
+ }
149
+ }
150
+ }
151
+ this.host.markDirty()
152
+ }
153
+ }
154
+
155
+ /** 角色 3D 实例(面向对象:持有模型/状态/行为,封装漫游 FSM、移动钳制、动画、活动范围)。
156
+ * 由场景按 entities/数据库元数据(home/range/modelRef)实例化并注入宿主;动画状态驱动 motion 事件。 */
157
+ export class Agent3D {
158
+ channelId!: string
159
+ agentId!: string
160
+ name!: string
161
+ role!: 'lead' | 'worker'
162
+ /** 根 Group(位置=落地点,脚底) */
163
+ root!: THREE.Group
164
+ /** 模型子节点(换模型时替换) —— 始终存在(空组占位) */
165
+ model!: THREE.Group
166
+ mixer!: THREE.AnimationMixer | null
167
+ /** 当前模型动画 clip(若有) */
168
+ clips!: THREE.AnimationClip[]
169
+ /** 身份色(频道哈希色;气泡/小地图等取色数据源) */
170
+ colorNum!: number
171
+ /** 头顶名字 Sprite */
172
+ nameSprite!: THREE.Sprite
173
+ /** 当前气泡 */
174
+ bubble!: THREE.Sprite | null
175
+ /** 当前头顶聊天气泡文本(调试/HUD 用;null = 无气泡) */
176
+ bubbleText!: string | null
177
+ bubbleTimer!: ReturnType<typeof setTimeout> | null
178
+ /** 状态/进度/行为 */
179
+ state!: 'idle' | 'busy' | 'stopped'
180
+ progress!: number | null
181
+ /** 行为 FSM */
182
+ behavior!: BehaviorState
183
+ /** 用户拖动中 */
184
+ dragging!: boolean
185
+ /** home(行为结束后回归) */
186
+ homeX!: number
187
+ homeZ!: number
188
+ /** 独立活动范围(编辑模式框选/手柄;null = 沿用频道边界) */
189
+ range!: AgentRangeLayout | null
190
+ /** 活动范围线框(随 range 渲染;清除/重建时移除) */
191
+ rangeLine!: THREE.LineLoop | null
192
+ textureKey!: string
193
+ modelRef!: string
194
+ /** 当前动画状态(数据驱动模型:idle/walk;经宿主 motion 事件监听) */
195
+ animState: 'idle' | 'walk' = 'idle'
196
+ /** 当前 mixer action(crossfade 切换用;null = 未开始) */
197
+ activeAction: THREE.AnimationAction | null = null
198
+ /** 宿主场景控制器(实例化后注入) */
199
+ host!: AgentHost
200
+ /** 本帧是否在移动(update 结束时驱动动画) */
201
+ private moving = false
202
+ /** 脚下光环组(频道色身份标识;root 子节点,随移动跟随,零每帧定位成本) */
203
+ aura: THREE.Group | null = null
204
+ /** 光环材质(渲染循环呼吸;userData.baseOp 存基准透明度) */
205
+ auraMats: THREE.MeshBasicMaterial[] = []
206
+ /** 呼吸相位(每实例随机,避免全场同频闪烁) */
207
+ auraPhase = 0
208
+
209
+ /** 挂脚下光环(频道色,与领地同源;lead 加外环 —— 角色身份一眼可辨) */
210
+ attachAura(color: number, role: 'lead' | 'worker'): void {
211
+ const g = new THREE.Group()
212
+ const mats: THREE.MeshBasicMaterial[] = []
213
+ const mk = (r0: number, r1: number, y: number, op: number): void => {
214
+ const m = new THREE.MeshBasicMaterial({ color, transparent: true, opacity: op, side: THREE.DoubleSide, depthWrite: false, blending: THREE.AdditiveBlending })
215
+ m.userData.baseOp = op
216
+ mats.push(m)
217
+ const mesh = new THREE.Mesh(new THREE.RingGeometry(r0, r1, 44), m)
218
+ mesh.rotation.x = -Math.PI / 2
219
+ mesh.position.y = y
220
+ g.add(mesh)
221
+ }
222
+ mk(34, 40, 0.36, 0.26)
223
+ if (role === 'lead') mk(46, 50, 0.42, 0.2)
224
+ this.root.add(g)
225
+ this.aura = g
226
+ this.auraMats = mats
227
+ this.auraPhase = Math.random() * Math.PI * 2
228
+ }
229
+
230
+ constructor(init: {
231
+ channelId: string
232
+ agentId: string
233
+ name: string
234
+ role: 'lead' | 'worker'
235
+ root: THREE.Group
236
+ model: THREE.Group
237
+ mixer: THREE.AnimationMixer | null
238
+ clips: THREE.AnimationClip[]
239
+ colorNum: number
240
+ nameSprite: THREE.Sprite
241
+ bubble: THREE.Sprite | null
242
+ bubbleText: string | null
243
+ bubbleTimer: ReturnType<typeof setTimeout> | null
244
+ state: 'idle' | 'busy' | 'stopped'
245
+ progress: number | null
246
+ behavior: BehaviorState
247
+ dragging: boolean
248
+ homeX: number
249
+ homeZ: number
250
+ range: AgentRangeLayout | null
251
+ rangeLine: THREE.LineLoop | null
252
+ textureKey: string
253
+ modelRef: string
254
+ }) {
255
+ Object.assign(this, init)
256
+ }
257
+
258
+ /** 到达判定 */
259
+ reached(target: { x: number, z: number }): boolean {
260
+ return Math.hypot(this.root.position.x - target.x, this.root.position.z - target.z) <= ARRIVE
261
+ }
262
+
263
+ /** 朝目标匀速走一步(按自身活动范围/频道边界钳制;驱动朝向与动画) */
264
+ driveToward(target: { x: number, z: number }, speed: number, dt: number): void {
265
+ this.moving = true
266
+ const cur = { x: this.root.position.x, z: this.root.position.z }
267
+ const next = stepToward({ x: cur.x, y: cur.z }, { x: target.x, y: target.z }, speed, dt)
268
+ let nx = next.x
269
+ let nz = next.y
270
+ if (this.range) {
271
+ const clamped = clampToAgentRange(this.range, nx, nz, 6)
272
+ nx = clamped.x
273
+ nz = clamped.z
274
+ }
275
+ else {
276
+ const layout = this.host.blockLayoutOf(this.channelId)
277
+ if (layout) {
278
+ const clamped = clampToBoundary(layout, nx, nz, 6)
279
+ nx = clamped.x
280
+ nz = clamped.z
281
+ }
282
+ }
283
+ this.root.position.x = nx
284
+ this.root.position.z = nz
285
+ // 朝向平滑:朝移动方向插值转动(左/右两态,不用瞬间 snap,2.5D 行走更顺)
286
+ const dir = next.dir
287
+ const targetY = dir === 'left' ? Math.PI : 0
288
+ const curY = this.root.rotation.y
289
+ // 最短角差插值(0 ↔ π 之间取捷径;步长限速防抖)
290
+ let d = targetY - curY
291
+ if (d > Math.PI) d -= Math.PI * 2
292
+ else if (d < -Math.PI) d += Math.PI * 2
293
+ const maxStep = dt * 3.2
294
+ this.root.rotation.y = curY + Math.max(-maxStep, Math.min(maxStep, d))
295
+ void dt
296
+ }
297
+
298
+ /** 行为 FSM(idle/roam/approach/wait/returnHome);由渲染循环每帧驱动,动画随移动状态切换 */
299
+ update(dt: number): void {
300
+ this.moving = false
301
+ try {
302
+ this.updateBehavior(dt)
303
+ }
304
+ finally {
305
+ this.playWalkAnim(this.moving)
306
+ }
307
+ }
308
+
309
+ private updateBehavior(dt: number): void {
310
+ const b = this.behavior
311
+ if (b.mode === 'idle' || b.mode === 'roam') {
312
+ if (b.engaged || this.dragging) return
313
+ b.mode = 'roam'
314
+ if (!b.roamTarget) {
315
+ // 到达后就地停顿片刻:保持 idle 动画,营造走走停停的闲逛节奏(并产生 motion 事件)
316
+ if (performance.now() < b.pauseUntil) return
317
+ // 漫游目标:有独立活动范围 → 在自身范围内取点;否则沿用频道边界内取点
318
+ const layout = this.host.blockLayoutOf(this.channelId)
319
+ let tx: number
320
+ let tz: number
321
+ if (this.range) {
322
+ tx = this.homeX + (Math.random() * 2 - 1) * this.range.radiusX * 0.9
323
+ tz = this.homeZ + (Math.random() * 2 - 1) * this.range.radiusZ * 0.9
324
+ const clamped = clampToAgentRange(this.range, tx, tz, 8)
325
+ tx = clamped.x
326
+ tz = clamped.z
327
+ }
328
+ else {
329
+ const range = layout ? Math.min(layout.radiusX, layout.radiusZ) * 0.45 : 80
330
+ tx = this.homeX + (Math.random() * 2 - 1) * range
331
+ tz = this.homeZ + (Math.random() * 2 - 1) * range * 0.6
332
+ if (layout) {
333
+ const clamped = clampToBoundary(layout, tx, tz, 16)
334
+ tx = clamped.x
335
+ tz = clamped.z
336
+ }
337
+ }
338
+ b.roamTarget = { x: tx, z: tz }
339
+ }
340
+ this.driveToward(b.roamTarget, AGENT_SPEED * 0.5, dt)
341
+ if (this.reached(b.roamTarget)) {
342
+ b.roamTarget = null
343
+ b.pauseUntil = performance.now() + 350 + Math.random() * 900
344
+ }
345
+ return
346
+ }
347
+ if (b.mode === 'approach') {
348
+ const target = b.targetId ? this.host.getAgent(b.targetId) : undefined
349
+ if (!target) {
350
+ b.mode = 'idle'
351
+ return
352
+ }
353
+ let pos = { x: target.root.position.x, z: target.root.position.z }
354
+ // 目标在自身活动范围外 → 逼近到自身范围边界(送达交接在边界处完成)
355
+ if (this.range) {
356
+ const c = clampToAgentRange(this.range, pos.x, pos.z, 8)
357
+ pos = { x: c.x, z: c.z }
358
+ }
359
+ this.driveToward(pos, AGENT_SPEED, dt)
360
+ if (this.reached(pos)) {
361
+ this.host.deliverBehavior(this, target)
362
+ if (b.action?.requireReply) {
363
+ b.mode = 'wait'
364
+ b.waitUntil = performance.now() + WAIT_MS
365
+ }
366
+ else {
367
+ b.mode = 'returnHome'
368
+ this.host.releaseEngaged(this)
369
+ b.targetId = null
370
+ }
371
+ }
372
+ return
373
+ }
374
+ if (b.mode === 'wait') {
375
+ if (this.dragging) return
376
+ const target = b.targetId ? this.host.getAgent(b.targetId) : undefined
377
+ if (target && !target.dragging) {
378
+ const stand = { x: target.root.position.x + 28, z: target.root.position.z + 8 }
379
+ this.driveToward(stand, AGENT_SPEED * 0.6, dt)
380
+ }
381
+ if (performance.now() >= b.waitUntil) {
382
+ b.mode = 'returnHome'
383
+ this.host.releaseEngaged(this)
384
+ }
385
+ return
386
+ }
387
+ if (b.mode === 'returnHome') {
388
+ if (this.dragging) return
389
+ const home = { x: this.homeX, z: this.homeZ }
390
+ this.driveToward(home, AGENT_SPEED * 0.7, dt)
391
+ if (this.reached(home)) {
392
+ this.root.position.set(this.homeX, GROUND_Y, this.homeZ)
393
+ b.mode = 'idle'
394
+ b.targetId = null
395
+ b.action = undefined
396
+ }
397
+ }
398
+ }
399
+
400
+ /** 动画状态切换(有 clip: idle/walk 动作;无 clip: 上下浮动 bob);切换时经宿主广播 motion 事件 */
401
+ playWalkAnim(moving: boolean): void {
402
+ const next = moving ? 'walk' : 'idle'
403
+ if (this.animState !== next) {
404
+ this.animState = next
405
+ this.host.notifyMotion(this)
406
+ }
407
+ const bob = () => {
408
+ // 程序化动作绑定(model 局部,色环/名牌保持贴地稳定):
409
+ // 待机呼吸浮动 + 行走跳跃颠簸 + 行走左右微摆
410
+ const t = performance.now()
411
+ const breathe = 1.2 + Math.sin(t * 0.0016) * 1.6
412
+ const hop = Math.abs(Math.sin(t * 0.005)) * 6
413
+ this.model.position.y = moving ? hop : breathe
414
+ const swayTarget = moving ? Math.sin(t * 0.006) * 0.07 : 0
415
+ this.model.rotation.z += (swayTarget - this.model.rotation.z) * 0.12
416
+ }
417
+ if (this.clips.length === 0) {
418
+ bob()
419
+ return
420
+ }
421
+ // 有动画 clip:名字感知选择(剪辑命名各异:WALK/Walk、idle/stand/breath...),
422
+ // 先按语义匹配,找不到回退索引(idle→0,walk→1);仅含走路剪辑的模型待机时
423
+ // 回退程序化 bob,避免原地播放走路。crossfade 平滑过渡(避免双 action 叠加)。
424
+ if (!this.mixer) return
425
+ const lower = (c: THREE.AnimationClip) => c.name.toLowerCase()
426
+ const clip = moving
427
+ ? (this.clips.find(c => /walk|run|move/.test(lower(c))) ?? this.clips[Math.min(1, this.clips.length - 1)])
428
+ : (this.clips.find(c => /idle|stand|breath/.test(lower(c))) ?? (this.clips.length > 1 ? this.clips[0] : null))
429
+ if (!clip) {
430
+ if (this.activeAction) {
431
+ this.activeAction.fadeOut(0.15)
432
+ this.activeAction = null
433
+ }
434
+ bob()
435
+ return
436
+ }
437
+ const nextAction = this.mixer.clipAction(clip)
438
+ if (this.activeAction === nextAction) {
439
+ nextAction.timeScale = moving ? 1.3 : 0.9
440
+ return
441
+ }
442
+ nextAction.reset().setEffectiveTimeScale(moving ? 1.3 : 0.9).fadeIn(0.15).play()
443
+ if (this.activeAction) this.activeAction.fadeOut(0.15)
444
+ this.activeAction = nextAction
445
+ }
446
+
447
+ /** 更新 home 落点(行为结束后回归点;含拖拽/范围位移后落库路径) */
448
+ setHome(x: number, z: number): void {
449
+ this.homeX = x
450
+ this.homeZ = z
451
+ }
452
+
453
+ /** 渲染/刷新活动范围线框(数据驱动:range 变更 → 线框重建)+ 可见性 */
454
+ renderRangeLine(): void {
455
+ if (this.rangeLine) {
456
+ this.host.threeScene.remove(this.rangeLine)
457
+ this.rangeLine = null
458
+ }
459
+ if (!this.range) return
460
+ const color = 0x41c8f4
461
+ const line = makeBoundary(this.range.shape, this.range.radiusX, this.range.radiusZ, color)
462
+ // 虚线描边(与频道实线边界区分;2.5D 可读性)
463
+ line.material = new THREE.LineDashedMaterial({ color, transparent: true, opacity: 0.75, depthTest: false, dashSize: 14, gapSize: 9 })
464
+ line.computeLineDistances()
465
+ line.position.set(this.range.x, 0.5, this.range.z)
466
+ line.rotation.y = this.range.rotationY * Math.PI / 180
467
+ line.visible = this.host.rangeLineVisibleFor(this)
468
+ this.host.threeScene.add(line)
469
+ this.rangeLine = line
470
+ this.host.markDirty()
471
+ }
472
+
473
+ /** 挂气泡(替换旧气泡;宿主完成纹理渲染) */
474
+ attachBubble(sprite: THREE.Sprite, text: string): void {
475
+ if (this.bubble) {
476
+ this.host.threeScene.remove(this.bubble)
477
+ this.bubbleText = null
478
+ }
479
+ this.bubble = sprite
480
+ this.bubbleText = text
481
+ }
482
+
483
+ /** 移除气泡(宿主负责从场景摘除) */
484
+ clearBubble(): void {
485
+ if (!this.bubble) return
486
+ this.host.threeScene.remove(this.bubble)
487
+ this.bubble = null
488
+ this.bubbleText = null
489
+ }
490
+ }
491
+
492
+ /** 数字孪生设备 3D 实例(面向对象:持有节点网格/状态/遥测,封装讑生同步、状态环、模型重挂、transform 记忆)。
493
+ * 由场景按 device-twins 数据库元数据实例化;state/telemetry 数据驱动渲染。 */
494
+ export class DeviceNode {
495
+ twinId!: string
496
+ name!: string
497
+ modelRef!: string
498
+ root!: THREE.Group
499
+ /** 模型挂载组(换模型时 clear 重挂;缩放施加于此) */
500
+ holder!: THREE.Group
501
+ ring!: THREE.Mesh
502
+ /** 运行态动效弧(仅 running 可见;渲染循环缓转 —— 语义动效:设备在转 = 在产) */
503
+ arc: THREE.Mesh | null = null
504
+ label!: THREE.Sprite
505
+ state!: 'idle' | 'running' | 'offline' | 'alarm'
506
+ telemetry!: Record<string, number | string | boolean>
507
+ /** 宿主场景控制器(实例化后注入) */
508
+ host!: DeviceHost
509
+
510
+ constructor(init: {
511
+ twinId: string
512
+ name: string
513
+ modelRef: string
514
+ root: THREE.Group
515
+ holder: THREE.Group
516
+ ring: THREE.Mesh
517
+ label: THREE.Sprite
518
+ state: 'idle' | 'running' | 'offline' | 'alarm'
519
+ telemetry: Record<string, number | string | boolean>
520
+ }) {
521
+ Object.assign(this, init)
522
+ }
523
+
524
+ /** 模型顶面世界高度缓存(HUD/callout 每帧读取;缩放变更时失效) */
525
+ topYCache: number | null = null
526
+ /** 当前产线光晕色(空 = 未分配) */
527
+ lineColor = ''
528
+ /** 产线换色回调(recreateDaqNode 装配;applyTwin 检测变化时重 tint) */
529
+ applyLine: ((color: string) => void) | null = null
530
+
531
+ /** 状态环颜色(数据驱动:状态变化/产线换色时调用,渲染循环不再每帧重刷)。
532
+ * 分配了产线的节点(数采)环随产线色 —— 状态生命感已由 LED 呼吸环表达;常规设备环 = 状态色。 */
533
+ updateRing(): void {
534
+ const mat = this.ring.material as THREE.MeshBasicMaterial
535
+ if (this.lineColor) mat.color.set(this.lineColor)
536
+ else mat.color.setHex(this.state === 'alarm' ? 0xff6b6b : this.state === 'offline' ? 0x8496a5 : this.state === 'running' ? 0x35e0a0 : 0xf6c453)
537
+ if (this.arc) this.arc.visible = this.state === 'running'
538
+ }
539
+
540
+ /** 与数据库讑生记录收敛(状态/遥测/名称/模型/产线光晕;宿主完成名牌与模型重挂) */
541
+ applyTwin(t: DeviceTwinSync): void {
542
+ if (t.state) this.state = t.state
543
+ if (t.telemetry) this.telemetry = { ...this.telemetry, ...t.telemetry }
544
+ if (t.name && t.name !== this.name) this.host.renameDeviceSprite(this, t.name)
545
+ if (t.modelRef && t.modelRef !== this.modelRef) this.host.swapDeviceModelSprite(this, t.modelRef)
546
+ if ((t.lineColor ?? '') !== this.lineColor) {
547
+ this.lineColor = t.lineColor ?? ''
548
+ this.applyLine?.(this.lineColor)
549
+ }
550
+ this.updateRing()
551
+ this.host.markDirty()
552
+ }
553
+
554
+ /** 记录当前 transform(供防抖落库快照) */
555
+ rememberTransform(): { posX: number, posZ: number, rotationY: number } {
556
+ return {
557
+ posX: Math.round(this.root.position.x * 10) / 10,
558
+ posZ: Math.round(this.root.position.z * 10) / 10,
559
+ rotationY: Math.round(THREE.MathUtils.radToDeg(this.root.rotation.y) * 10) / 10,
560
+ }
561
+ }
562
+ }