agentworkshop 0.7.41 → 0.7.46
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.
- package/.AgentWorkShop/prompts/host-tools.json +265 -6
- package/.AgentWorkShop/prompts/lead-supervise.md +54 -29
- package/.AgentWorkShop/prompts/peer-reply-optional.md +6 -2
- package/.AgentWorkShop/prompts/peer-reply-required.md +8 -7
- package/.output/.AgentWorkShop/aml-python/amlkit.py +185 -120
- package/.output/.AgentWorkShop/aml-python/requirements.txt +9 -7
- package/.output/.AgentWorkShop/aml-python/train-hybrid-example.py +87 -0
- package/.output/.AgentWorkShop/prompts/host-tools.json +265 -6
- package/.output/.AgentWorkShop/prompts/lead-supervise.md +54 -29
- package/.output/.AgentWorkShop/prompts/peer-reply-optional.md +6 -2
- package/.output/.AgentWorkShop/prompts/peer-reply-required.md +8 -7
- package/.output/.AgentWorkShop/schema.json +12 -0
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/-hB4kEmt.js +1 -0
- package/.output/public/_nuxt/1g9IT9Qh2.js +1 -0
- package/.output/public/_nuxt/74x7BOWv2.js +1 -0
- package/.output/public/_nuxt/9c5GOgbu.js +1 -0
- package/.output/public/_nuxt/9zrLAN2o2.js +1 -0
- package/.output/public/_nuxt/B1RT9NTO2.js +1 -0
- package/.output/public/_nuxt/B2x8SKRO.js +1 -0
- package/.output/public/_nuxt/B6Olw0Op.js +1 -0
- package/.output/public/_nuxt/B7jlMWsz.js +1 -0
- package/.output/public/_nuxt/B8cnjDtt.js +1 -0
- package/.output/public/_nuxt/B9rIcCX12.js +1 -0
- package/.output/public/_nuxt/BACBBVdw.js +1 -0
- package/.output/public/_nuxt/BBhLVYdM.js +1 -0
- package/.output/public/_nuxt/BDmNbZ252.js +1 -0
- package/.output/public/_nuxt/BFVf8HLR.js +1 -0
- package/.output/public/_nuxt/BGKUW7ra.js +1 -0
- package/.output/public/_nuxt/BH3obZJ42.js +1 -0
- package/.output/public/_nuxt/BHwG4yNs.js +1 -0
- package/.output/public/_nuxt/BIOq3xqe2.js +1 -0
- package/.output/public/_nuxt/BITZvQBK.js +1 -0
- package/.output/public/_nuxt/BL_dbd2v2.js +1 -0
- package/.output/public/_nuxt/BMMoqi94.js +1 -0
- package/.output/public/_nuxt/BNnnYEYh2.js +1 -0
- package/.output/public/_nuxt/BQXCMsXk.js +1 -0
- package/.output/public/_nuxt/BS9P_Ies2.js +1 -0
- package/.output/public/_nuxt/BWU1pvLL.js +1 -0
- package/.output/public/_nuxt/B_9_BM9G.js +3 -0
- package/.output/public/_nuxt/B_LcD7qE2.js +1 -0
- package/.output/public/_nuxt/BcQXL8pb.js +1 -0
- package/.output/public/_nuxt/BdM_Qr752.js +1 -0
- package/.output/public/_nuxt/BiOSWsjD.js +2 -0
- package/.output/public/_nuxt/BkSViqQd.js +1 -0
- package/.output/public/_nuxt/Bl5dYv4m.js +1 -0
- package/.output/public/_nuxt/BmiMC_BC.js +2 -0
- package/.output/public/_nuxt/BnpY_zNx.js +1 -0
- package/.output/public/_nuxt/BqYVLAcm.js +1 -0
- package/.output/public/_nuxt/Br3AySNQ.js +1 -0
- package/.output/public/_nuxt/Br3MggOL.js +1 -0
- package/.output/public/_nuxt/BrRX-l9B2.js +4108 -0
- package/.output/public/_nuxt/Bt2ZL5332.js +1 -0
- package/.output/public/_nuxt/Bub2P5me.js +28 -0
- package/.output/public/_nuxt/BvRk9kiK.js +0 -0
- package/.output/public/_nuxt/BvRk9kiK2.js +0 -0
- package/.output/public/_nuxt/Bwc6lt2X.js +3 -0
- package/.output/public/_nuxt/BxHBIVAg.js +1 -0
- package/.output/public/_nuxt/BxYTM0hb.js +1 -0
- package/.output/public/_nuxt/ByMj6e7s.js +3 -0
- package/.output/public/_nuxt/BzvHUfRR2.js +1 -0
- package/.output/public/_nuxt/C2YYOgMe.js +42 -0
- package/.output/public/_nuxt/C3twEwTh2.js +1 -0
- package/.output/public/_nuxt/C4WhK2wq.js +1 -0
- package/.output/public/_nuxt/C50LmoI1.js +0 -0
- package/.output/public/_nuxt/CAaSPBqk.js +1 -0
- package/.output/public/_nuxt/CBDX7p73.js +1 -0
- package/.output/public/_nuxt/CD9lpEz22.js +13 -0
- package/.output/public/_nuxt/CGZVhYJ4.js +1 -0
- package/.output/public/_nuxt/CJRDL4EG.js +1 -0
- package/.output/public/_nuxt/CKQPwwZa2.js +1 -0
- package/.output/public/_nuxt/CLySL7mW.js +75 -0
- package/.output/public/_nuxt/CMXcOb6W.js +1 -0
- package/.output/public/_nuxt/CN1CDAwe.js +1 -0
- package/.output/public/_nuxt/CP0I2l-6.js +1 -0
- package/.output/public/_nuxt/CP0Nep9S.js +1 -0
- package/.output/public/_nuxt/CPeZNE4S2.js +1 -0
- package/.output/public/_nuxt/CPmNRTBk2.js +21 -0
- package/.output/public/_nuxt/CQabB0oy.js +1 -0
- package/.output/public/_nuxt/CT-vTjcG.js +1 -0
- package/.output/public/_nuxt/CTVfcnjU.js +3 -0
- package/.output/public/_nuxt/CWzp2R6G.js +1 -0
- package/.output/public/_nuxt/C_VAXV7I2.js +7 -0
- package/.output/public/_nuxt/CavpkQb0.js +1 -0
- package/.output/public/_nuxt/CeWnOF3O.js +1 -0
- package/.output/public/_nuxt/CfLUvgr32.js +1 -0
- package/.output/public/_nuxt/Ch1P2mIf.js +1 -0
- package/.output/public/_nuxt/ChoLwR-s.js +1 -0
- package/.output/public/_nuxt/Chphw5IA2.js +1 -0
- package/.output/public/_nuxt/ChtjzEpK2.js +19 -0
- package/.output/public/_nuxt/CiTQY_n32.js +1 -0
- package/.output/public/_nuxt/Ck5oMvUk.js +1 -0
- package/.output/public/_nuxt/Ckafrjnw2.js +1 -0
- package/.output/public/_nuxt/Cm_PTn9t2.js +1 -0
- package/.output/public/_nuxt/Cmp8PMrA.js +1 -0
- package/.output/public/_nuxt/Cnrmlixo.js +3 -0
- package/.output/public/_nuxt/Cr518Gh02.js +1 -0
- package/.output/public/_nuxt/Crbir9cT.js +1 -0
- package/.output/public/_nuxt/CtPNnATm2.js +31 -0
- package/.output/public/_nuxt/Cu8c3oMN2.js +1 -0
- package/.output/public/_nuxt/CwLQAKay2.js +1 -0
- package/.output/public/_nuxt/CzlUIbK32.js +17 -0
- package/.output/public/_nuxt/D6lZftfy.js +1 -0
- package/.output/public/_nuxt/D83nVQPl.js +1 -0
- package/.output/public/_nuxt/D89BUtx6.js +1 -0
- package/.output/public/_nuxt/DCtk3qqr.js +1 -0
- package/.output/public/_nuxt/DD6Z0yPN2.js +1 -0
- package/.output/public/_nuxt/DGw8juu_.js +2 -0
- package/.output/public/_nuxt/DHSDk8Bq2.js +4 -0
- package/.output/public/_nuxt/DJdDFnjG2.js +1 -0
- package/.output/public/_nuxt/DJyNDnag.js +1 -0
- package/.output/public/_nuxt/DK3Fl9T5.js +1 -0
- package/.output/public/_nuxt/DLPuRMeG.js +19 -0
- package/.output/public/_nuxt/DMYYS5sK.js +1 -0
- package/.output/public/_nuxt/DNno23Jf2.js +1 -0
- package/.output/public/_nuxt/DNoEoo8t.js +1 -0
- package/.output/public/_nuxt/DPUXbTg92.js +1 -0
- package/.output/public/_nuxt/DRpFsrno.js +1 -0
- package/.output/public/_nuxt/DXIaadqv.js +1 -0
- package/.output/public/_nuxt/D_7AzAWe.js +1 -0
- package/.output/public/_nuxt/Dbe9TFc9.js +1 -0
- package/.output/public/_nuxt/DdNujZN5.js +1 -0
- package/.output/public/_nuxt/DdvQ7LRI.js +14 -0
- package/.output/public/_nuxt/DhFv8S2Z.js +1 -0
- package/.output/public/_nuxt/DkJVtqfc.js +1 -0
- package/.output/public/_nuxt/DkLCjrCk2.js +47 -0
- package/.output/public/_nuxt/DkpmSnHX.js +1 -0
- package/.output/public/_nuxt/DlUQa0wn2.js +1 -0
- package/.output/public/_nuxt/DoKpLEqc.js +1 -0
- package/.output/public/_nuxt/DpqA8D8_.js +1 -0
- package/.output/public/_nuxt/Dq0emNZi2.js +1 -0
- package/.output/public/_nuxt/DqtgGFEc.js +1 -0
- package/.output/public/_nuxt/DqtnqNgL2.js +1 -0
- package/.output/public/_nuxt/Dqz5HiXa.js +2 -0
- package/.output/public/_nuxt/Du9v6qGB.js +1 -0
- package/.output/public/_nuxt/DxagrjB8.js +1 -0
- package/.output/public/_nuxt/Dy3oXKdn2.js +1 -0
- package/.output/public/_nuxt/DzBbYWrw2.js +1 -0
- package/.output/public/_nuxt/EhhQmlBV2.js +1 -0
- package/.output/public/_nuxt/H2rNs1O82.js +1 -0
- package/.output/public/_nuxt/H6pPjo0l.js +1 -0
- package/.output/public/_nuxt/JAM4aNC_.js +1 -0
- package/.output/public/_nuxt/JgheoP3e.js +1 -0
- package/.output/public/_nuxt/LwIFGLgF.js +1 -0
- package/.output/public/_nuxt/Nw_6OpQZ2.js +1 -0
- package/.output/public/_nuxt/OXtV_ukR.js +1 -0
- package/.output/public/_nuxt/OmpTerminalPanel.ComMDrA8.css +1 -0
- package/.output/public/_nuxt/PLGqdko0.js +1 -0
- package/.output/public/_nuxt/PixDfCSm.js +1 -0
- package/.output/public/_nuxt/RAqsw632.js +1 -0
- package/.output/public/_nuxt/Sjjmp5OD2.js +1 -0
- package/.output/public/_nuxt/TOWR4WpO.js +1 -0
- package/.output/public/_nuxt/TownView.BvlfuLtP.css +1 -0
- package/.output/public/_nuxt/U8oQxruK.js +1 -0
- package/.output/public/_nuxt/WleoCtUX.js +1 -0
- package/.output/public/_nuxt/YaroNkJZ2.js +1 -0
- package/.output/public/_nuxt/Z-Z6EhXs.js +1 -0
- package/.output/public/_nuxt/ZuQtOnfI.js +1 -0
- package/.output/public/_nuxt/ZvXovq7N2.js +1 -0
- package/.output/public/_nuxt/_id_.BTrFUIHX.css +1 -0
- package/.output/public/_nuxt/_id_.Bossmhv1.css +1 -0
- package/.output/public/_nuxt/_wsId_.D-u-dbP9.css +1 -0
- package/.output/public/_nuxt/agents.Cgm_JG9L.css +1 -0
- package/.output/public/_nuxt/aml.Bi5X6_oi.css +1 -0
- package/.output/public/_nuxt/bg2adfck.js +1 -0
- package/.output/public/_nuxt/bt__BP-I.js +13 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/7827fe9f-b4c2-461f-b1fb-c0c7da7d66b8.json +1 -0
- package/.output/public/_nuxt/cBI0JqsV2.js +209 -0
- package/.output/public/_nuxt/cDcDztgb2.js +1 -0
- package/.output/public/_nuxt/cGSl2GZp.js +1 -0
- package/.output/public/_nuxt/channel-templates.DplM1pJ3.css +1 -0
- package/.output/public/_nuxt/csitHKnE2.js +1 -0
- package/.output/public/_nuxt/d-w5jR8R.js +1 -0
- package/.output/public/_nuxt/daq.0uieKcZk.css +1 -0
- package/.output/public/_nuxt/dcw.pQRVkAi_.css +1 -0
- package/.output/public/_nuxt/default.uao9U50c.css +1 -0
- package/.output/public/_nuxt/e7BBCLxr.js +1 -0
- package/.output/public/_nuxt/entry.6DEjPWvR.css +1 -0
- package/.output/public/_nuxt/eutnXI4F.js +24 -0
- package/.output/public/_nuxt/fxWyOzyp2.js +1 -0
- package/.output/public/_nuxt/hkMGMTqt.js +1 -0
- package/.output/public/_nuxt/ikAUnxx3.js +1 -0
- package/.output/public/_nuxt/lWYQbIR3.js +1 -0
- package/.output/public/_nuxt/logs.CD0Olr3c.css +1 -0
- package/.output/public/_nuxt/monitor.CI2v5Nvl.css +1 -0
- package/.output/public/_nuxt/pages.CMhSEhEb.css +1 -0
- package/.output/public/_nuxt/permissions.DxuOOIqQ.css +1 -0
- package/.output/public/_nuxt/plugins.C50x1qZp.css +1 -0
- package/.output/public/_nuxt/qOlYoGLf.js +1 -0
- package/.output/public/_nuxt/schedules.BXNJ9q_I.css +1 -0
- package/.output/public/_nuxt/settings.Bo5EYkLI.css +1 -0
- package/.output/public/_nuxt/teams.sGmx1AdX.css +1 -0
- package/.output/public/_nuxt/tokens.DFMFaCYU.css +1 -0
- package/.output/public/_nuxt/uI9Ki_XZ.js +9 -0
- package/.output/public/_nuxt/users.DBxcKnfg.css +1 -0
- package/.output/public/_nuxt/v55S8LnT.js +1 -0
- package/.output/public/_nuxt/wDPc4SSR.js +106 -0
- package/.output/public/_nuxt/workshop.b4YRXEe0.css +1 -0
- package/.output/public/_nuxt/y9kob70X.js +1 -0
- package/.output/public/_nuxt/zh-S_7rN.js +1 -0
- package/.output/server/chunks/_/LeftOutlined.mjs +1 -1
- package/.output/server/chunks/_/SearchOutlined.mjs +1243 -279
- package/.output/server/chunks/_/SearchOutlined.mjs.map +1 -1
- package/.output/server/chunks/_/binding-authz.mjs +1 -1
- package/.output/server/chunks/_/character-asset.repo.mjs +1 -1
- package/.output/server/chunks/_/entity.mjs +1 -1
- package/.output/server/chunks/_/env-manager.mjs +1 -1
- package/.output/server/chunks/_/host-bindings.mjs +1 -1
- package/.output/server/chunks/_/nitro.mjs +26659 -18787
- package/.output/server/chunks/_/nitro.mjs.map +1 -1
- package/.output/server/chunks/_/scene-layout.repo.mjs +1 -1
- package/.output/server/chunks/build/Checkbox-4EdGAAl_.mjs +206 -0
- package/.output/server/chunks/build/Checkbox-4EdGAAl_.mjs.map +1 -0
- package/.output/server/chunks/build/FormItemContext-4ORSzhWv.mjs +72 -0
- package/.output/server/chunks/build/FormItemContext-4ORSzhWv.mjs.map +1 -0
- package/.output/server/chunks/build/OmpTerminalPanel-EQHrOJbw.mjs +942 -0
- package/.output/server/chunks/build/OmpTerminalPanel-EQHrOJbw.mjs.map +1 -0
- package/.output/server/chunks/build/PluginSlot-BP_qedpQ.mjs +399 -0
- package/.output/server/chunks/build/PluginSlot-BP_qedpQ.mjs.map +1 -0
- package/.output/server/chunks/build/TownView-BAR8CPIZ.mjs +6373 -0
- package/.output/server/chunks/build/TownView-BAR8CPIZ.mjs.map +1 -0
- package/.output/server/chunks/build/_id_-DgMpjM3_.mjs +1354 -0
- package/.output/server/chunks/build/_id_-DgMpjM3_.mjs.map +1 -0
- package/.output/server/chunks/build/_id_-Dv3BQbYV.mjs +388 -0
- package/.output/server/chunks/build/_id_-Dv3BQbYV.mjs.map +1 -0
- package/.output/server/chunks/build/_wsId_-BKJvFmyf.mjs +13109 -0
- package/.output/server/chunks/build/_wsId_-BKJvFmyf.mjs.map +1 -0
- package/.output/server/chunks/build/agents-B2GLPmn2.mjs +1085 -0
- package/.output/server/chunks/build/agents-B2GLPmn2.mjs.map +1 -0
- package/.output/server/chunks/build/aml-DdWicH3t.mjs +806 -0
- package/.output/server/chunks/build/aml-DdWicH3t.mjs.map +1 -0
- package/.output/server/chunks/build/api-BY6ji7RC.mjs +50 -0
- package/.output/server/chunks/build/api-BY6ji7RC.mjs.map +1 -0
- package/.output/server/chunks/build/api-error-BwAQLw44.mjs +47 -0
- package/.output/server/chunks/build/api-error-BwAQLw44.mjs.map +1 -0
- package/.output/server/chunks/build/apiClient-D281qrK2.mjs +81 -0
- package/.output/server/chunks/build/apiClient-D281qrK2.mjs.map +1 -0
- package/.output/server/chunks/build/builtin-catalog-edpDcgfL.mjs +117 -0
- package/.output/server/chunks/build/builtin-catalog-edpDcgfL.mjs.map +1 -0
- package/.output/server/chunks/build/card-CUSocE9p.mjs +953 -0
- package/.output/server/chunks/build/card-CUSocE9p.mjs.map +1 -0
- package/.output/server/chunks/build/channel-templates-RPOtkgRf.mjs +846 -0
- package/.output/server/chunks/build/channel-templates-RPOtkgRf.mjs.map +1 -0
- package/.output/server/chunks/build/checkbox-C4AKj81e.mjs +439 -0
- package/.output/server/chunks/build/checkbox-C4AKj81e.mjs.map +1 -0
- package/.output/server/chunks/build/client-only-qNA2OVV_.mjs +43 -0
- package/.output/server/chunks/build/client-only-qNA2OVV_.mjs.map +1 -0
- package/.output/server/chunks/build/constants-HPHJvjne.mjs +139 -0
- package/.output/server/chunks/build/constants-HPHJvjne.mjs.map +1 -0
- package/.output/server/chunks/build/core-CgTOPS4t.mjs +294 -0
- package/.output/server/chunks/build/core-CgTOPS4t.mjs.map +1 -0
- package/.output/server/chunks/build/daq-CPtsh0e7.mjs +1253 -0
- package/.output/server/chunks/build/daq-CPtsh0e7.mjs.map +1 -0
- package/.output/server/chunks/build/dcw-ry5Gyw6Y.mjs +478 -0
- package/.output/server/chunks/build/dcw-ry5Gyw6Y.mjs.map +1 -0
- package/.output/server/chunks/build/default-DxOE1eB0.mjs +2061 -0
- package/.output/server/chunks/build/default-DxOE1eB0.mjs.map +1 -0
- package/.output/server/chunks/build/descriptions-CFaUq4y4.mjs +406 -0
- package/.output/server/chunks/build/descriptions-CFaUq4y4.mjs.map +1 -0
- package/.output/server/chunks/build/drawer-Cfh9_zft.mjs +834 -0
- package/.output/server/chunks/build/drawer-Cfh9_zft.mjs.map +1 -0
- package/.output/server/chunks/build/dropdown-KdKWCS5K.mjs +556 -0
- package/.output/server/chunks/build/dropdown-KdKWCS5K.mjs.map +1 -0
- package/.output/server/chunks/build/dropdown-Yev6knaj.mjs +14 -0
- package/.output/server/chunks/build/dropdown-Yev6knaj.mjs.map +1 -0
- package/.output/server/chunks/build/form-uSlNqIAV.mjs +4711 -0
- package/.output/server/chunks/build/form-uSlNqIAV.mjs.map +1 -0
- package/.output/server/chunks/build/input-Cr_KFj4T.mjs +1381 -0
- package/.output/server/chunks/build/input-Cr_KFj4T.mjs.map +1 -0
- package/.output/server/chunks/build/input-number-BRVnxeiA.mjs +1119 -0
- package/.output/server/chunks/build/input-number-BRVnxeiA.mjs.map +1 -0
- package/.output/server/chunks/build/interval-DvHBIIZh.mjs +9 -0
- package/.output/server/chunks/build/interval-DvHBIIZh.mjs.map +1 -0
- package/.output/server/chunks/build/logs-CeaiO3y9.mjs +367 -0
- package/.output/server/chunks/build/logs-CeaiO3y9.mjs.map +1 -0
- package/.output/server/chunks/build/menu-BgkRSSx7.mjs +1949 -0
- package/.output/server/chunks/build/menu-BgkRSSx7.mjs.map +1 -0
- package/.output/server/chunks/build/monitor-DnuXEIi5.mjs +2245 -0
- package/.output/server/chunks/build/monitor-DnuXEIi5.mjs.map +1 -0
- package/.output/server/chunks/build/narrow-fetch-CcG-BPxc.mjs +6 -0
- package/.output/server/chunks/build/narrow-fetch-CcG-BPxc.mjs.map +1 -0
- package/.output/server/chunks/build/pages-Bn90ijKD.mjs +539 -0
- package/.output/server/chunks/build/pages-Bn90ijKD.mjs.map +1 -0
- package/.output/server/chunks/build/permissions-DL70W1YD.mjs +629 -0
- package/.output/server/chunks/build/permissions-DL70W1YD.mjs.map +1 -0
- package/.output/server/chunks/build/plugins-DrsZo--K.mjs +246 -0
- package/.output/server/chunks/build/plugins-DrsZo--K.mjs.map +1 -0
- package/.output/server/chunks/build/popconfirm-Ox-_2V8A.mjs +339 -0
- package/.output/server/chunks/build/popconfirm-Ox-_2V8A.mjs.map +1 -0
- package/.output/server/chunks/build/schedules-VLzNcjnW.mjs +7164 -0
- package/.output/server/chunks/build/schedules-VLzNcjnW.mjs.map +1 -0
- package/.output/server/chunks/build/segmented-C61yLHvo.mjs +341 -0
- package/.output/server/chunks/build/segmented-C61yLHvo.mjs.map +1 -0
- package/.output/server/chunks/build/select-rdBWytVK.mjs +3922 -0
- package/.output/server/chunks/build/select-rdBWytVK.mjs.map +1 -0
- package/.output/server/chunks/build/settings-DVAUVMsX.mjs +1089 -0
- package/.output/server/chunks/build/settings-DVAUVMsX.mjs.map +1 -0
- package/.output/server/chunks/build/space-B2uhHJG8.mjs +110 -0
- package/.output/server/chunks/build/space-B2uhHJG8.mjs.map +1 -0
- package/.output/server/chunks/build/spin-C2cuvGth.mjs +357 -0
- package/.output/server/chunks/build/spin-C2cuvGth.mjs.map +1 -0
- package/.output/server/chunks/build/switch-DZAUIbIN.mjs +377 -0
- package/.output/server/chunks/build/switch-DZAUIbIN.mjs.map +1 -0
- package/.output/server/chunks/build/table-DOFAvY-v.mjs +8881 -0
- package/.output/server/chunks/build/table-DOFAvY-v.mjs.map +1 -0
- package/.output/server/chunks/build/tabs-DTeIuZeP.mjs +1923 -0
- package/.output/server/chunks/build/tabs-DTeIuZeP.mjs.map +1 -0
- package/.output/server/chunks/build/tag-CHLGvNM6.mjs +1029 -0
- package/.output/server/chunks/build/tag-CHLGvNM6.mjs.map +1 -0
- package/.output/server/chunks/build/teams-Mc07PYO8.mjs +1195 -0
- package/.output/server/chunks/build/teams-Mc07PYO8.mjs.map +1 -0
- package/.output/server/chunks/build/tokens-DiwD5qni.mjs +1036 -0
- package/.output/server/chunks/build/tokens-DiwD5qni.mjs.map +1 -0
- package/.output/server/chunks/build/town-BIn3be5v.mjs +39 -0
- package/.output/server/chunks/build/town-BIn3be5v.mjs.map +1 -0
- package/.output/server/chunks/build/town-D8VmTCmN.mjs +128 -0
- package/.output/server/chunks/build/town-D8VmTCmN.mjs.map +1 -0
- package/.output/server/chunks/build/types-D6J7slEa.mjs +5561 -0
- package/.output/server/chunks/build/types-D6J7slEa.mjs.map +1 -0
- package/.output/server/chunks/build/useAgentHarnessOptions-CPn5dzKe.mjs +121 -0
- package/.output/server/chunks/build/useAgentHarnessOptions-CPn5dzKe.mjs.map +1 -0
- package/.output/server/chunks/build/useAgentTemplateActions-DQWzVnZ0.mjs +74 -0
- package/.output/server/chunks/build/useAgentTemplateActions-DQWzVnZ0.mjs.map +1 -0
- package/.output/server/chunks/build/useAgentTemplateDialogState-CZzpu5og.mjs +64 -0
- package/.output/server/chunks/build/useAgentTemplateDialogState-CZzpu5og.mjs.map +1 -0
- package/.output/server/chunks/build/useAgentTemplateForm-vqyiRPtt.mjs +114 -0
- package/.output/server/chunks/build/useAgentTemplateForm-vqyiRPtt.mjs.map +1 -0
- package/.output/server/chunks/build/useAgentTemplatesCatalog-DcQbsOik.mjs +130 -0
- package/.output/server/chunks/build/useAgentTemplatesCatalog-DcQbsOik.mjs.map +1 -0
- package/.output/server/chunks/build/useAmlDatasets-BM0lZu40.mjs +89 -0
- package/.output/server/chunks/build/useAmlDatasets-BM0lZu40.mjs.map +1 -0
- package/.output/server/chunks/build/useAmlEntities-BjXWvFd_.mjs +83 -0
- package/.output/server/chunks/build/useAmlEntities-BjXWvFd_.mjs.map +1 -0
- package/.output/server/chunks/build/useAmlEnv-BB7p6x_w.mjs +191 -0
- package/.output/server/chunks/build/useAmlEnv-BB7p6x_w.mjs.map +1 -0
- package/.output/server/chunks/build/useAmlExperiments-BtyW32PO.mjs +86 -0
- package/.output/server/chunks/build/useAmlExperiments-BtyW32PO.mjs.map +1 -0
- package/.output/server/chunks/build/useAmlFormat-WrKuRfw2.mjs +79 -0
- package/.output/server/chunks/build/useAmlFormat-WrKuRfw2.mjs.map +1 -0
- package/.output/server/chunks/build/useAmlJobs-DBuLvWMF.mjs +263 -0
- package/.output/server/chunks/build/useAmlJobs-DBuLvWMF.mjs.map +1 -0
- package/.output/server/chunks/build/useAmlModels-VurmkBYe.mjs +90 -0
- package/.output/server/chunks/build/useAmlModels-VurmkBYe.mjs.map +1 -0
- package/.output/server/chunks/build/useAmlNotes-BUdj3X6Y.mjs +83 -0
- package/.output/server/chunks/build/useAmlNotes-BUdj3X6Y.mjs.map +1 -0
- package/.output/server/chunks/build/useAmlPredict-DFy-Do10.mjs +127 -0
- package/.output/server/chunks/build/useAmlPredict-DFy-Do10.mjs.map +1 -0
- package/.output/server/chunks/build/useDaqAddNode-kW7uTSMQ.mjs +139 -0
- package/.output/server/chunks/build/useDaqAddNode-kW7uTSMQ.mjs.map +1 -0
- package/.output/server/chunks/build/useDaqDetailBinding-cpBz4hSL.mjs +67 -0
- package/.output/server/chunks/build/useDaqDetailBinding-cpBz4hSL.mjs.map +1 -0
- package/.output/server/chunks/build/useDaqDetailFrames-BZGtKKXW.mjs +76 -0
- package/.output/server/chunks/build/useDaqDetailFrames-BZGtKKXW.mjs.map +1 -0
- package/.output/server/chunks/build/useDaqDetailHistory-C4_hVeqZ.mjs +173 -0
- package/.output/server/chunks/build/useDaqDetailHistory-C4_hVeqZ.mjs.map +1 -0
- package/.output/server/chunks/build/useDaqDetailNode-Bwid_iA8.mjs +96 -0
- package/.output/server/chunks/build/useDaqDetailNode-Bwid_iA8.mjs.map +1 -0
- package/.output/server/chunks/build/useDaqDetailParams-JfqHvTxr.mjs +156 -0
- package/.output/server/chunks/build/useDaqDetailParams-JfqHvTxr.mjs.map +1 -0
- package/.output/server/chunks/build/useDaqFilters-C13836p-.mjs +219 -0
- package/.output/server/chunks/build/useDaqFilters-C13836p-.mjs.map +1 -0
- package/.output/server/chunks/build/useDaqNodeWindow-1DWj2H5G.mjs +87 -0
- package/.output/server/chunks/build/useDaqNodeWindow-1DWj2H5G.mjs.map +1 -0
- package/.output/server/chunks/build/useDaqOptimizations-Ct-TSXxy.mjs +133 -0
- package/.output/server/chunks/build/useDaqOptimizations-Ct-TSXxy.mjs.map +1 -0
- package/.output/server/chunks/build/useDaqStream-wOxZcMDA.mjs +395 -0
- package/.output/server/chunks/build/useDaqStream-wOxZcMDA.mjs.map +1 -0
- package/.output/server/chunks/build/useDaqTemplates-BqQRdrIm.mjs +184 -0
- package/.output/server/chunks/build/useDaqTemplates-BqQRdrIm.mjs.map +1 -0
- package/.output/server/chunks/build/useDashboardCharts-DZysNDUX.mjs +351 -0
- package/.output/server/chunks/build/useDashboardCharts-DZysNDUX.mjs.map +1 -0
- package/.output/server/chunks/build/useDashboardData-Ny_wtbo6.mjs +150 -0
- package/.output/server/chunks/build/useDashboardData-Ny_wtbo6.mjs.map +1 -0
- package/.output/server/chunks/build/useDcwAddNode-C8nE7geh.mjs +148 -0
- package/.output/server/chunks/build/useDcwAddNode-C8nE7geh.mjs.map +1 -0
- package/.output/server/chunks/build/useDcwCards-ETEsHvVy.mjs +64 -0
- package/.output/server/chunks/build/useDcwCards-ETEsHvVy.mjs.map +1 -0
- package/.output/server/chunks/build/useDcwDetailScope-BNrpDzbO.mjs +181 -0
- package/.output/server/chunks/build/useDcwDetailScope-BNrpDzbO.mjs.map +1 -0
- package/.output/server/chunks/build/useDcwDetailTemplates-IcKAJ37Y.mjs +145 -0
- package/.output/server/chunks/build/useDcwDetailTemplates-IcKAJ37Y.mjs.map +1 -0
- package/.output/server/chunks/build/useDcwFilter-FfVlDdyS.mjs +68 -0
- package/.output/server/chunks/build/useDcwFilter-FfVlDdyS.mjs.map +1 -0
- package/.output/server/chunks/build/useDcwLedger-BLoMmcu1.mjs +76 -0
- package/.output/server/chunks/build/useDcwLedger-BLoMmcu1.mjs.map +1 -0
- package/.output/server/chunks/build/useDcwLineMutations-BMC5BTWU.mjs +134 -0
- package/.output/server/chunks/build/useDcwLineMutations-BMC5BTWU.mjs.map +1 -0
- package/.output/server/chunks/build/useDcwLineRun-Bpxk4mse.mjs +101 -0
- package/.output/server/chunks/build/useDcwLineRun-Bpxk4mse.mjs.map +1 -0
- package/.output/server/chunks/build/useDcwProducts-D-zrMaeV.mjs +90 -0
- package/.output/server/chunks/build/useDcwProducts-D-zrMaeV.mjs.map +1 -0
- package/.output/server/chunks/build/useDcwQuery-1lYHOaU6.mjs +95 -0
- package/.output/server/chunks/build/useDcwQuery-1lYHOaU6.mjs.map +1 -0
- package/.output/server/chunks/build/useDcwQuickActions-C-tgcXIr.mjs +85 -0
- package/.output/server/chunks/build/useDcwQuickActions-C-tgcXIr.mjs.map +1 -0
- package/.output/server/chunks/build/useDcwRecipes-BzGOymqz.mjs +237 -0
- package/.output/server/chunks/build/useDcwRecipes-BzGOymqz.mjs.map +1 -0
- package/.output/server/chunks/build/useDcwStream-D04kCV3J.mjs +435 -0
- package/.output/server/chunks/build/useDcwStream-D04kCV3J.mjs.map +1 -0
- package/.output/server/chunks/build/useDcwTemplates-Dsjw9u6U.mjs +88 -0
- package/.output/server/chunks/build/useDcwTemplates-Dsjw9u6U.mjs.map +1 -0
- package/.output/server/chunks/build/useDcwWrites-3RxwN36I.mjs +120 -0
- package/.output/server/chunks/build/useDcwWrites-3RxwN36I.mjs.map +1 -0
- package/.output/server/chunks/build/useDeviceTwins-CbVad1M3.mjs +128 -0
- package/.output/server/chunks/build/useDeviceTwins-CbVad1M3.mjs.map +1 -0
- package/.output/server/chunks/build/useLocalTime-9a4B-aHv.mjs +1 -8
- package/.output/server/chunks/build/useLocalTime-9a4B-aHv.mjs.map +1 -1
- package/.output/server/chunks/build/useLogsFormat-BlwLpyzy.mjs +74 -0
- package/.output/server/chunks/build/useLogsFormat-BlwLpyzy.mjs.map +1 -0
- package/.output/server/chunks/build/useLogsManual-Deev2Cjk.mjs +81 -0
- package/.output/server/chunks/build/useLogsManual-Deev2Cjk.mjs.map +1 -0
- package/.output/server/chunks/build/useLogsQuery-CRAm2hmS.mjs +112 -0
- package/.output/server/chunks/build/useLogsQuery-CRAm2hmS.mjs.map +1 -0
- package/.output/server/chunks/build/useLogsScope-ClNijVj4.mjs +80 -0
- package/.output/server/chunks/build/useLogsScope-ClNijVj4.mjs.map +1 -0
- package/.output/server/chunks/build/useMonitorColumns-ylxrUNTK.mjs +212 -0
- package/.output/server/chunks/build/useMonitorColumns-ylxrUNTK.mjs.map +1 -0
- package/.output/server/chunks/build/useMonitorData-CEpKXoD4.mjs +131 -0
- package/.output/server/chunks/build/useMonitorData-CEpKXoD4.mjs.map +1 -0
- package/.output/server/chunks/build/useMonitorFormat-_7zLapf3.mjs +87 -0
- package/.output/server/chunks/build/useMonitorFormat-_7zLapf3.mjs.map +1 -0
- package/.output/server/chunks/build/useMonitorTerminal-Dj4QwRNW.mjs +68 -0
- package/.output/server/chunks/build/useMonitorTerminal-Dj4QwRNW.mjs.map +1 -0
- package/.output/server/chunks/build/useOpsLog-CgnNG7_n.mjs +137 -0
- package/.output/server/chunks/build/useOpsLog-CgnNG7_n.mjs.map +1 -0
- package/.output/server/chunks/build/useTeamActions-D6sxdpkP.mjs +76 -0
- package/.output/server/chunks/build/useTeamActions-D6sxdpkP.mjs.map +1 -0
- package/.output/server/chunks/build/useTeamAddMemberDialog-Q-ntQ6Vo.mjs +81 -0
- package/.output/server/chunks/build/useTeamAddMemberDialog-Q-ntQ6Vo.mjs.map +1 -0
- package/.output/server/chunks/build/useTeamCreateDialog-D7OMfDTM.mjs +94 -0
- package/.output/server/chunks/build/useTeamCreateDialog-D7OMfDTM.mjs.map +1 -0
- package/.output/server/chunks/build/useTeamDeployDialog-vBRqjiut.mjs +77 -0
- package/.output/server/chunks/build/useTeamDeployDialog-vBRqjiut.mjs.map +1 -0
- package/.output/server/chunks/build/useTeamDialogState-CFRUQxAf.mjs +79 -0
- package/.output/server/chunks/build/useTeamDialogState-CFRUQxAf.mjs.map +1 -0
- package/.output/server/chunks/build/useTeamPluginDialog-B8kxewpZ.mjs +100 -0
- package/.output/server/chunks/build/useTeamPluginDialog-B8kxewpZ.mjs.map +1 -0
- package/.output/server/chunks/build/useTeamsCatalog-xRhk7ezA.mjs +120 -0
- package/.output/server/chunks/build/useTeamsCatalog-xRhk7ezA.mjs.map +1 -0
- package/.output/server/chunks/build/useTokenClipboard-CwQpoFeP.mjs +69 -0
- package/.output/server/chunks/build/useTokenClipboard-CwQpoFeP.mjs.map +1 -0
- package/.output/server/chunks/build/useTokenCreate-DpDcF1Vx.mjs +112 -0
- package/.output/server/chunks/build/useTokenCreate-DpDcF1Vx.mjs.map +1 -0
- package/.output/server/chunks/build/useTokenRename-BRejFrtc.mjs +84 -0
- package/.output/server/chunks/build/useTokenRename-BRejFrtc.mjs.map +1 -0
- package/.output/server/chunks/build/useTokenReveal-DER2afAS.mjs +115 -0
- package/.output/server/chunks/build/useTokenReveal-DER2afAS.mjs.map +1 -0
- package/.output/server/chunks/build/useTokensList-DHt65IOY.mjs +89 -0
- package/.output/server/chunks/build/useTokensList-DHt65IOY.mjs.map +1 -0
- package/.output/server/chunks/build/useWorkbenchAuth-B2j-zILO.mjs +135 -0
- package/.output/server/chunks/build/useWorkbenchAuth-B2j-zILO.mjs.map +1 -0
- package/.output/server/chunks/build/useWorkbenchWorkspaces-B_2mOxN6.mjs +133 -0
- package/.output/server/chunks/build/useWorkbenchWorkspaces-B_2mOxN6.mjs.map +1 -0
- package/.output/server/chunks/build/useWorkshopApi-B1B9vd4m.mjs +102 -0
- package/.output/server/chunks/build/useWorkshopApi-B1B9vd4m.mjs.map +1 -0
- package/.output/server/chunks/build/useWorkshopWs-B-Es2Xg3.mjs +1782 -0
- package/.output/server/chunks/build/useWorkshopWs-B-Es2Xg3.mjs.map +1 -0
- package/.output/server/chunks/build/useWorkspaceAuth-tQ1ORWXo.mjs +57 -0
- package/.output/server/chunks/build/useWorkspaceAuth-tQ1ORWXo.mjs.map +1 -0
- package/.output/server/chunks/build/useWorkspaceChannels-BwB6TAWY.mjs +87 -0
- package/.output/server/chunks/build/useWorkspaceChannels-BwB6TAWY.mjs.map +1 -0
- package/.output/server/chunks/build/useWorkspacePanels-CuAmDpT5.mjs +75 -0
- package/.output/server/chunks/build/useWorkspacePanels-CuAmDpT5.mjs.map +1 -0
- package/.output/server/chunks/build/useWorkspaceShell-CcQ4JlqO.mjs +165 -0
- package/.output/server/chunks/build/useWorkspaceShell-CcQ4JlqO.mjs.map +1 -0
- package/.output/server/chunks/build/users-De2HygNt.mjs +561 -0
- package/.output/server/chunks/build/users-De2HygNt.mjs.map +1 -0
- package/.output/server/chunks/build/workshop-CmgpTwyf.mjs +1018 -0
- package/.output/server/chunks/build/workshop-CmgpTwyf.mjs.map +1 -0
- package/.output/server/chunks/build/workspaces-DVIEk1Bl.mjs +139 -0
- package/.output/server/chunks/build/workspaces-DVIEk1Bl.mjs.map +1 -0
- package/.output/server/chunks/routes/api/health.get.mjs +2 -2
- package/.output/server/chunks/routes/api/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/mcp/workshop.mjs +2 -2
- package/.output/server/chunks/routes/api/metrics.mjs +2 -2
- package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs +2 -2
- package/.output/server/chunks/routes/api/plugins/client/_name_.get.mjs +2 -2
- package/.output/server/chunks/routes/api/plugins/i18n.get.mjs +2 -2
- package/.output/server/chunks/routes/api/plugins/manifest.get.mjs +2 -2
- package/.output/server/chunks/routes/api/system/config-groups/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/system/config-groups/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/system/config.get.mjs +2 -2
- package/.output/server/chunks/routes/api/system/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/system/index.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/system/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/system/index2.get.mjs +2 -2
- package/.output/server/chunks/routes/api/system/monitor/terminal/ws.mjs +35 -4
- package/.output/server/chunks/routes/api/system/monitor/terminal/ws.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/monitor/terminate.post.mjs +2 -2
- package/.output/server/chunks/routes/api/system/monitor.get.mjs +2 -2
- package/.output/server/chunks/routes/api/system/settings/events.get.mjs +2 -2
- package/.output/server/chunks/routes/api/system/settings/reset.post.mjs +2 -2
- package/.output/server/chunks/routes/api/users/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/users/_id_.get.mjs +2 -2
- package/.output/server/chunks/routes/api/users/_id_.put.mjs +2 -2
- package/.output/server/chunks/routes/api/users/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/users/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/users/login.post.mjs +2 -2
- package/.output/server/chunks/routes/api/users/logout.post.mjs +2 -2
- package/.output/server/chunks/routes/api/users/me.get.mjs +2 -2
- package/.output/server/chunks/routes/api/users/register.post.mjs +2 -2
- package/.output/server/chunks/routes/api/users/setup-status.get.mjs +2 -2
- package/.output/server/chunks/routes/api/users/tokens/_id/token.get.mjs +2 -2
- package/.output/server/chunks/routes/api/users/tokens/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/users/tokens/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/_...path_.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/a2a/send.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/agent-tools/approvals/_id/decide.post.mjs +38 -6
- package/.output/server/chunks/routes/api/workshop/agent-tools/approvals/_id/decide.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.get.mjs +14 -5
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/agent-tools/index2.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/agents/subscribe.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/datasets/_id/preview.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/entities/prune.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/env/recheck.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/env/uv.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/env/venv.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/index2.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/index2.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/index3.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/index4.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/index5.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/index6.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/cancel.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/logs.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/retry.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id_.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/models/_id/predict.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/models/_id/promote.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/models/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/models/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/approvals/_id/decide.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/assets/character/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/audit.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/caller.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +10 -5
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channel-templates/from-channel.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/activate.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/_memoryId_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/search.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/model.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/position.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/range.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/stop.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/chat/index.get.mjs +41 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/chat/index.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/chat/index.post.mjs +52 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/chat/index.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/chat/messages/_messageId/read.post.mjs +33 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/chat/messages/_messageId/read.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/chat/permissions.get.mjs +48 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/chat/permissions.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/events.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.put.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs +10 -14
- package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index2.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/index3.get.mjs +15 -28
- package/.output/server/chunks/routes/api/workshop/channels/_id/index3.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index3.post.mjs +3 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/index3.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index4.get.mjs +29 -23
- package/.output/server/chunks/routes/api/workshop/channels/_id/index4.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index4.post.mjs +9 -4
- package/.output/server/chunks/routes/api/workshop/channels/_id/index4.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index5.get.mjs +22 -10
- package/.output/server/chunks/routes/api/workshop/channels/_id/index5.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index6.get.mjs +34 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/index6.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/members/_userId/approve.post.mjs +33 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/members/_userId/approve.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/members/_userId_.delete.mjs +34 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/members/_userId_.delete.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/members/join.post.mjs +35 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/members/join.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/members/leave.post.mjs +33 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/members/leave.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/queue.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs +22 -6
- package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels.get.mjs +21 -3
- package/.output/server/chunks/routes/api/workshop/channels.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels.post.mjs +5 -5
- package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id/bindings.put.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id/test.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bindings.put.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index5.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index6.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/params/_id/read.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/params/_id/write.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/params/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/params/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/revert.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/versions.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/index.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs +11 -4
- package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs +28 -36
- package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index.put.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index10.get.mjs +26 -12
- package/.output/server/chunks/routes/api/workshop/index10.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index11.get.mjs +12 -7
- package/.output/server/chunks/routes/api/workshop/index11.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index12.get.mjs +3 -3
- package/.output/server/chunks/routes/api/workshop/index12.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index13.get.mjs +29 -0
- package/.output/server/chunks/routes/api/workshop/index13.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/index14.get.mjs +28 -0
- package/.output/server/chunks/routes/api/workshop/index14.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/index2.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index2.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index3.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index3.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index4.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index4.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index5.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index5.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index6.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index6.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index7.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index7.post.mjs +14 -16
- package/.output/server/chunks/routes/api/workshop/index7.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index8.get.mjs +40 -19
- package/.output/server/chunks/routes/api/workshop/index8.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index8.post.mjs +19 -5
- package/.output/server/chunks/routes/api/workshop/index8.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index9.get.mjs +20 -24
- package/.output/server/chunks/routes/api/workshop/index9.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index9.post.mjs +30 -0
- package/.output/server/chunks/routes/api/workshop/index9.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/mailbox/all.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/mailbox.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/memories/maintenance.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/notifications/read.post.mjs +41 -0
- package/.output/server/chunks/routes/api/workshop/notifications/read.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/plugins/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/runtime.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/scene/layouts.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/schedules/_id/run.post.mjs +29 -0
- package/.output/server/chunks/routes/api/workshop/schedules/_id/run.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/schedules/_id/runs.get.mjs +31 -0
- package/.output/server/chunks/routes/api/workshop/schedules/_id/runs.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/schedules/_id_.delete.mjs +30 -0
- package/.output/server/chunks/routes/api/workshop/schedules/_id_.delete.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/schedules/_id_.get.mjs +29 -0
- package/.output/server/chunks/routes/api/workshop/schedules/_id_.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/schedules/_id_.patch.mjs +40 -0
- package/.output/server/chunks/routes/api/workshop/schedules/_id_.patch.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/tasks/_id/complete.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/tasks/_id/dispatch.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/tasks/_id/reassign.post.mjs +39 -0
- package/.output/server/chunks/routes/api/workshop/tasks/_id/reassign.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/tasks/_id/report.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/tasks/_id/update.post.mjs +44 -0
- package/.output/server/chunks/routes/api/workshop/tasks/_id/update.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs +9 -5
- package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/teams/_id/deploy.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.put.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/teams/_id/index2.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/teams/_id/members/_agentId_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/teams/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/teams/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/users/me.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/users/register.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs +3 -3
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/workspaces/index.delete.mjs +2 -2
- package/.output/server/chunks/routes/renderer.mjs +3 -3
- package/.output/server/chunks/virtual/entry.mjs +5704 -722
- package/.output/server/chunks/virtual/entry.mjs.map +1 -1
- package/.output/server/chunks/virtual/precomputed.mjs +1 -1
- package/.output/server/index.mjs +15 -5549
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/README-zh.md +109 -45
- package/README.md +115 -38
- package/app/components/AppHeader.vue +284 -959
- package/app/components/aml/AmlDatasetFormModal.vue +279 -0
- package/app/components/aml/AmlDatasetTable.vue +319 -0
- package/app/components/aml/AmlEnvPanel.vue +230 -0
- package/app/components/aml/AmlExperimentsTable.vue +142 -0
- package/app/components/aml/AmlInfraBanner.vue +23 -0
- package/app/components/aml/AmlJobsTable.vue +248 -0
- package/app/components/aml/AmlModelsTable.vue +173 -0
- package/app/components/aml/AmlOverviewBar.vue +62 -0
- package/app/components/aml/AmlPageHeader.vue +47 -0
- package/app/components/aml/AmlPredictConsole.vue +201 -0
- package/app/components/app-header/HeaderTools.vue +208 -0
- package/app/components/app-header/HitlBell.vue +423 -0
- package/app/components/app-header/TrailNav.vue +261 -0
- package/app/components/app-header/UserChip.vue +150 -0
- package/app/components/daq/DaqAddNodeModal.vue +209 -0
- package/app/components/daq/DaqAlarmBar.vue +46 -0
- package/app/components/daq/DaqControlCard.vue +159 -0
- package/app/components/daq/DaqDetailFramesTile.vue +139 -0
- package/app/components/daq/DaqDetailHistoryCard.vue +128 -0
- package/app/components/daq/DaqDetailLiveCard.vue +92 -0
- package/app/components/daq/DaqDetailParamForm.vue +350 -0
- package/app/components/daq/DaqInfraBanner.vue +31 -0
- package/app/components/daq/DaqLineBanner.vue +47 -0
- package/app/components/daq/DaqNodePanel.vue +396 -0
- package/app/components/daq/DaqOptPanel.vue +197 -0
- package/app/components/daq/DaqTemplateModal.vue +246 -0
- package/app/components/dashboard/DashboardFleetPanel.vue +228 -0
- package/app/components/dashboard/DashboardGaugeBand.vue +78 -0
- package/app/components/dashboard/DashboardHarnessPanel.vue +149 -0
- package/app/components/dashboard/DashboardHero.vue +209 -0
- package/app/components/dashboard/DashboardLineStatePanel.vue +78 -0
- package/app/components/dashboard/DashboardNodeStatePanel.vue +46 -0
- package/app/components/dashboard/DashboardPipelinePanel.vue +46 -0
- package/app/components/dashboard/DashboardTrendPanel.vue +83 -0
- package/app/components/dashboard/DashboardWritePanel.vue +52 -0
- package/app/components/dcw/DcwAddNodeModal.vue +328 -0
- package/app/components/dcw/DcwAdoptCard.vue +89 -0
- package/app/components/dcw/DcwCreateLineModal.vue +105 -0
- package/app/components/dcw/DcwDeleteLineModal.vue +73 -0
- package/app/components/dcw/DcwDetailHead.vue +65 -0
- package/app/components/dcw/DcwDetailTemplateModal.vue +238 -0
- package/app/components/dcw/DcwEditLineModal.vue +108 -0
- package/app/components/dcw/DcwGatewayBar.vue +94 -0
- package/app/components/dcw/DcwLedgerCard.vue +160 -0
- package/app/components/dcw/DcwLineCard.vue +117 -0
- package/app/components/dcw/DcwLineRunCard.vue +158 -0
- package/app/components/dcw/DcwNodesTable.vue +253 -0
- package/app/components/dcw/DcwProductCreateModal.vue +113 -0
- package/app/components/dcw/DcwQueryCard.vue +251 -0
- package/app/components/dcw/DcwRecipeEditModal.vue +285 -0
- package/app/components/dcw/DcwRecipeHistoryModal.vue +165 -0
- package/app/components/dcw/DcwRecipePanel.vue +367 -0
- package/app/components/dcw/DcwRunDataModal.vue +191 -0
- package/app/components/dcw/DcwTemplateModal.vue +227 -0
- package/app/components/dcw/DcwWriteHistoryCard.vue +96 -0
- package/app/components/logs/LogsEventTable.vue +309 -0
- package/app/components/logs/LogsFilterCard.vue +234 -0
- package/app/components/logs/LogsManualModal.vue +231 -0
- package/app/components/logs/LogsPageHead.vue +71 -0
- package/app/components/monitor/MonitorAgentTable.vue +143 -0
- package/app/components/monitor/MonitorChannelTable.vue +80 -0
- package/app/components/monitor/MonitorLoginGate.vue +24 -0
- package/app/components/monitor/MonitorPageHead.vue +92 -0
- package/app/components/monitor/MonitorProcessTable.vue +159 -0
- package/app/components/monitor/MonitorStatGrid.vue +165 -0
- package/app/components/settings/AppearancePane.vue +282 -0
- package/app/components/settings/PluginsSection.vue +280 -0
- package/app/components/settings/RuntimeFieldRow.vue +189 -0
- package/app/components/settings/RuntimeGroupSection.vue +290 -0
- package/app/components/settings/RuntimePane.vue +235 -0
- package/app/components/settings/SystemPane.vue +83 -0
- package/app/components/tokens/TokenCreateModal.vue +42 -0
- package/app/components/tokens/TokenOnceModal.vue +164 -0
- package/app/components/tokens/TokenRenameModal.vue +40 -0
- package/app/components/tokens/TokensAuthGate.vue +47 -0
- package/app/components/tokens/TokensPageHead.vue +76 -0
- package/app/components/tokens/TokensTable.vue +227 -0
- package/app/components/workshop/A2aRpcDebugger.vue +237 -237
- package/app/components/workshop/AgentInspectorDrawer.vue +424 -424
- package/app/components/workshop/AgentLanesView.vue +278 -998
- package/app/components/workshop/ArtifactCard.vue +120 -120
- package/app/components/workshop/AssetLibrary.vue +452 -452
- package/app/components/workshop/ChannelSessionList.vue +377 -804
- package/app/components/workshop/ChatMemberPanel.vue +555 -0
- package/app/components/workshop/ChatTimeline.vue +569 -0
- package/app/components/workshop/CommandPalette.vue +270 -269
- package/app/components/workshop/Composer.vue +540 -827
- package/app/components/workshop/DeviceTwinPanel.vue +167 -643
- package/app/components/workshop/EventBlock.vue +214 -602
- package/app/components/workshop/FileSelectorModal.vue +188 -188
- package/app/components/workshop/InspectorPanel.vue +301 -301
- package/app/components/workshop/MemoryPanel.vue +48 -7
- package/app/components/workshop/MultiChannelView.vue +4 -4
- package/app/components/workshop/NotificationCenter.vue +325 -0
- package/app/components/workshop/TaskBoardView.vue +121 -547
- package/app/components/workshop/TaskInspectorDrawer.vue +101 -7
- package/app/components/workshop/TranscriptTimeline.vue +223 -601
- package/app/components/workshop/agents/AgentTemplateEditModal.vue +139 -0
- package/app/components/workshop/agents/AgentTemplateTable.vue +269 -0
- package/app/components/workshop/agents/AgentTemplateToolbar.vue +67 -0
- package/app/components/workshop/blocks/ClusterArtifact.vue +61 -61
- package/app/components/workshop/blocks/ClusterError.vue +85 -85
- package/app/components/workshop/blocks/ClusterLife.vue +87 -87
- package/app/components/workshop/blocks/ClusterMember.vue +95 -93
- package/app/components/workshop/blocks/ClusterMemory.vue +84 -84
- package/app/components/workshop/blocks/ClusterOther.vue +67 -67
- package/app/components/workshop/blocks/ClusterRoute.vue +1 -1
- package/app/components/workshop/blocks/ClusterStatus.vue +149 -147
- package/app/components/workshop/blocks/ClusterTool.vue +158 -158
- package/app/components/workshop/blocks/EventBlockAvatar.vue +114 -0
- package/app/components/workshop/blocks/EventBlockHead.vue +232 -0
- package/app/components/workshop/composer/ComposerToolbar.vue +278 -0
- package/app/components/workshop/composer/MentionMenu.vue +135 -0
- package/app/components/workshop/composer/ReplyChip.vue +65 -0
- package/app/components/workshop/composer/StatusChip.vue +171 -0
- package/app/components/workshop/console/CenterPane.vue +94 -0
- package/app/components/workshop/console/Dock.vue +71 -0
- package/app/components/workshop/console/LeftPane.vue +84 -0
- package/app/components/workshop/console/RightPane.vue +95 -0
- package/app/components/workshop/console/Topbar.vue +289 -0
- package/app/components/workshop/device-twin/DeviceTwinCard.vue +265 -0
- package/app/components/workshop/device-twin/DeviceTwinDcwSection.vue +203 -0
- package/app/components/workshop/lanes/AddMemberModal.vue +270 -0
- package/app/components/workshop/lanes/EditMemberModal.vue +106 -0
- package/app/components/workshop/lanes/LaneHeader.vue +432 -0
- package/app/components/workshop/lanes/LanesToolbar.vue +97 -0
- package/app/components/workshop/session-list/ChannelSettingsModal.vue +329 -0
- package/app/components/workshop/session-list/MountChannelModal.vue +124 -0
- package/app/components/workshop/session-list/SaveTemplateModal.vue +93 -0
- package/app/components/workshop/task-board/Card.vue +172 -0
- package/app/components/workshop/task-board/Column.vue +151 -0
- package/app/components/workshop/task-board/List.vue +157 -0
- package/app/components/workshop/task-board/StatusMenu.vue +88 -0
- package/app/components/workshop/teams/TeamAddMemberModal.vue +53 -0
- package/app/components/workshop/teams/TeamCard.vue +183 -0
- package/app/components/workshop/teams/TeamCreateModal.vue +94 -0
- package/app/components/workshop/teams/TeamDeployModal.vue +40 -0
- package/app/components/workshop/teams/TeamPluginModal.vue +119 -0
- package/app/components/workshop/terminal/OmpTerminalPanel.vue +270 -1011
- package/app/components/workshop/terminal/TerminalHitlCard.vue +170 -0
- package/app/components/workshop/town/TownScene.ts +72 -961
- package/app/components/workshop/town/TownScene3D.ts +357 -4045
- package/app/components/workshop/town/TownView.vue +461 -7405
- package/app/components/workshop/town/components/TownAgentBindings.vue +380 -0
- package/app/components/workshop/town/components/TownAgentInspector.vue +546 -0
- package/app/components/workshop/town/components/TownAlarmList.vue +147 -0
- package/app/components/workshop/town/components/TownBoundaryPanel.vue +350 -0
- package/app/components/workshop/town/components/TownCalloutLayer.vue +147 -0
- package/app/components/workshop/town/components/TownChannelDock.vue +116 -0
- package/app/components/workshop/town/components/TownControlDock.vue +400 -0
- package/app/components/workshop/town/components/TownDaqNodeInspector.vue +345 -0
- package/app/components/workshop/town/components/TownDaqTree.vue +366 -0
- package/app/components/workshop/town/components/TownDcwBindSection.vue +473 -0
- package/app/components/workshop/town/components/TownDcwNodeInspector.vue +185 -0
- package/app/components/workshop/town/components/TownDcwTree.vue +280 -0
- package/app/components/workshop/town/components/TownDeviceBindings.vue +394 -0
- package/app/components/workshop/town/components/TownDeviceTransform.vue +248 -0
- package/app/components/workshop/town/components/TownEventList.vue +120 -0
- package/app/components/workshop/town/components/TownHealthBody.vue +100 -0
- package/app/components/workshop/town/components/TownKpiStrip.vue +207 -0
- package/app/components/workshop/town/components/TownLeftRail.vue +308 -0
- package/app/components/workshop/town/components/TownLoadingMask.vue +61 -0
- package/app/components/workshop/town/components/TownNavMap.vue +154 -0
- package/app/components/workshop/town/components/TownRightRail.vue +540 -0
- package/app/components/workshop/town/components/TownStage.vue +281 -0
- package/app/components/workshop/town/components/TownStageTop.vue +238 -0
- package/app/components/workshop/town/components/TownStatusBar.vue +108 -0
- package/app/components/workshop/town/components/TownTopNav.vue +367 -0
- package/app/components/workshop/town/components/TownTrendDock.vue +178 -0
- package/app/components/workshop/town/scene/town-scene-agents.ts +254 -0
- package/app/components/workshop/town/scene/town-scene-behavior.ts +194 -0
- package/app/components/workshop/town/scene/town-scene-bubbles.ts +96 -0
- package/app/components/workshop/town/scene/town-scene-core.ts +158 -0
- package/app/components/workshop/town/scene/town-scene-models.ts +109 -0
- package/app/components/workshop/town/scene/town-scene-visuals.ts +279 -0
- package/app/components/workshop/town/scene/town-scene3d-agents.ts +308 -0
- package/app/components/workshop/town/scene/town-scene3d-blocks.ts +297 -0
- package/app/components/workshop/town/scene/town-scene3d-bubbles.ts +281 -0
- package/app/components/workshop/town/scene/town-scene3d-camera.ts +282 -0
- package/app/components/workshop/town/scene/town-scene3d-devices.ts +433 -0
- package/app/components/workshop/town/scene/town-scene3d-editing.ts +490 -0
- package/app/components/workshop/town/scene/town-scene3d-events.ts +173 -0
- package/app/components/workshop/town/scene/town-scene3d-factory.ts +412 -0
- package/app/components/workshop/town/scene/town-scene3d-hud.ts +110 -0
- package/app/components/workshop/town/scene/town-scene3d-lifecycle.ts +144 -0
- package/app/components/workshop/town/scene/town-scene3d-links.ts +141 -0
- package/app/components/workshop/town/scene/town-scene3d-loop.ts +286 -0
- package/app/components/workshop/town/scene/town-scene3d-models.ts +154 -0
- package/app/components/workshop/town/scene/town-scene3d-nodes.ts +562 -0
- package/app/components/workshop/town/scene/town-scene3d-ranges.ts +273 -0
- package/app/components/workshop/town/scene/town-scene3d-renderer.ts +320 -0
- package/app/components/workshop/town/scene/town-scene3d-selection.ts +257 -0
- package/app/components/workshop/town/scene/town-scene3d-types.ts +264 -0
- package/app/components/workshop/transcript/TranscriptBlockList.vue +68 -0
- package/app/components/workshop/transcript/TranscriptEarlierPager.vue +81 -0
- package/app/components/workshop/transcript/TranscriptEmptyState.vue +153 -0
- package/app/components/workshop/transcript/TranscriptFilterBar.vue +126 -0
- package/app/components/workshop/workbench/AuthGate.vue +179 -0
- package/app/components/workshop/workbench/CreateWorkspaceModal.vue +36 -0
- package/app/components/workshop/workbench/WorkbenchHead.vue +129 -0
- package/app/components/workshop/workbench/WorkspaceCard.vue +198 -0
- package/app/components/workshop/workbench/WorkspaceEmpty.vue +56 -0
- package/app/composables/workshop/device-twin-types.ts +29 -0
- package/app/composables/workshop/event-blocks/attention.ts +58 -0
- package/app/composables/workshop/event-blocks/classify.ts +44 -0
- package/app/composables/workshop/event-blocks/clusterer.ts +231 -0
- package/app/composables/workshop/event-blocks/constants.ts +48 -0
- package/app/composables/workshop/event-blocks/fold-stream.ts +45 -0
- package/app/composables/workshop/event-blocks/markdown.ts +81 -0
- package/app/composables/workshop/event-blocks/mentions.ts +49 -0
- package/app/composables/workshop/event-blocks/text-utils.ts +100 -0
- package/app/composables/workshop/event-blocks/types.ts +40 -0
- package/app/composables/workshop/town/town-relay-props.ts +226 -0
- package/app/composables/workshop/town/town-view-types.ts +145 -0
- package/app/composables/workshop/town/useTownAgentBindings.ts +115 -0
- package/app/composables/workshop/town/useTownAgentChat.ts +203 -0
- package/app/composables/workshop/town/useTownAlarms.ts +36 -0
- package/app/composables/workshop/town/useTownCallouts.ts +174 -0
- package/app/composables/workshop/town/useTownChannels.ts +220 -0
- package/app/composables/workshop/town/useTownHealth.ts +66 -0
- package/app/composables/workshop/town/useTownHudTickers.ts +77 -0
- package/app/composables/workshop/town/useTownLayout.ts +277 -0
- package/app/composables/workshop/town/useTownNavMap.ts +301 -0
- package/app/composables/workshop/town/useTownNodeBindings.ts +345 -0
- package/app/composables/workshop/town/useTownPanelDrag.ts +91 -0
- package/app/composables/workshop/town/useTownRailData.ts +421 -0
- package/app/composables/workshop/town/useTownSceneControl.ts +92 -0
- package/app/composables/workshop/town/useTownSceneInput.ts +275 -0
- package/app/composables/workshop/town/useTownSceneRuntime.ts +390 -0
- package/app/composables/workshop/town/useTownSheets.ts +41 -0
- package/app/composables/workshop/town/useTownTrends.ts +93 -0
- package/app/composables/workshop/useChannelList.ts +88 -0
- package/app/composables/workshop/useChannelTerminals.ts +65 -0
- package/app/composables/workshop/useComposerMentions.ts +130 -0
- package/app/composables/workshop/useDeviceTwinDcwWrite.ts +77 -0
- package/app/composables/workshop/useDeviceTwinPanel.ts +56 -0
- package/app/composables/workshop/useEventBlockView.ts +159 -0
- package/app/composables/workshop/useEventBlocks.ts +33 -662
- package/app/composables/workshop/useHitlAnswer.ts +184 -0
- package/app/composables/workshop/useLaneWidths.ts +27 -0
- package/app/composables/workshop/useOmpTerminalSession.ts +424 -0
- package/app/composables/workshop/usePluginAdmin.ts +152 -0
- package/app/composables/workshop/useRuntimeConfigDraft.ts +118 -0
- package/app/composables/workshop/useSettingsGroups.ts +243 -0
- package/app/composables/workshop/useTaskBoardColumns.ts +47 -0
- package/app/composables/workshop/useTaskBoardDrag.ts +78 -0
- package/app/composables/workshop/useTaskBoardMenu.ts +60 -0
- package/app/composables/workshop/useTaskBoardTasks.ts +74 -0
- package/app/composables/workshop/useTerminalRenderer.ts +308 -0
- package/app/composables/workshop/useTranscriptEnterStage.ts +48 -0
- package/app/composables/workshop/useTranscriptHistory.ts +52 -0
- package/app/composables/workshop/useTranscriptScroll.ts +113 -0
- package/app/composables/workshop/useWorkshopApi.ts +85 -2
- package/app/composables/workshop/useWorkshopWs.ts +265 -126
- package/app/config/schema.ts +13 -0
- package/app/layouts/town.vue +21 -16
- package/app/middleware/locale-cookie.global.ts +22 -0
- package/app/pages/aml/api.ts +6 -0
- package/app/pages/aml/composables/useAmlDatasets.ts +38 -0
- package/app/pages/aml/composables/useAmlEntities.ts +57 -0
- package/app/pages/aml/composables/useAmlEnv.ts +191 -0
- package/app/pages/aml/composables/useAmlExperiments.ts +45 -0
- package/app/pages/aml/composables/useAmlFormat.ts +44 -0
- package/app/pages/aml/composables/useAmlJobs.ts +131 -0
- package/app/pages/aml/composables/useAmlModels.ts +56 -0
- package/app/pages/aml/composables/useAmlNotes.ts +47 -0
- package/app/pages/aml/composables/useAmlPredict.ts +93 -0
- package/app/pages/aml/constants.ts +63 -0
- package/app/pages/aml/index.vue +143 -2574
- package/app/pages/aml/styles.css +420 -0
- package/app/pages/aml/types.ts +189 -0
- package/app/pages/composables/useDashboardCharts.ts +192 -0
- package/app/pages/composables/useDashboardData.ts +144 -0
- package/app/pages/daq/[id].vue +59 -929
- package/app/pages/daq/composables/useDaqAddNode.ts +126 -0
- package/app/pages/daq/composables/useDaqDetailBinding.ts +29 -0
- package/app/pages/daq/composables/useDaqDetailFrames.ts +42 -0
- package/app/pages/daq/composables/useDaqDetailHistory.ts +199 -0
- package/app/pages/daq/composables/useDaqDetailNode.ts +53 -0
- package/app/pages/daq/composables/useDaqDetailParams.ts +138 -0
- package/app/pages/daq/composables/useDaqFilters.ts +187 -0
- package/app/pages/daq/composables/useDaqNodeWindow.ts +86 -0
- package/app/pages/daq/composables/useDaqOptimizations.ts +99 -0
- package/app/pages/daq/composables/useDaqTemplates.ts +152 -0
- package/app/pages/daq/daq-page.css +681 -0
- package/app/pages/daq/index.vue +260 -2316
- package/app/pages/dcw/[id].vue +297 -2616
- package/app/pages/dcw/composables/useDcwAddNode.ts +121 -0
- package/app/pages/dcw/composables/useDcwCards.ts +27 -0
- package/app/pages/dcw/composables/useDcwDetailScope.ts +145 -0
- package/app/pages/dcw/composables/useDcwDetailTemplates.ts +94 -0
- package/app/pages/dcw/composables/useDcwFilter.ts +29 -0
- package/app/pages/dcw/composables/useDcwLedger.ts +34 -0
- package/app/pages/dcw/composables/useDcwLineMutations.ts +115 -0
- package/app/pages/dcw/composables/useDcwLineRun.ts +60 -0
- package/app/pages/dcw/composables/useDcwProducts.ts +54 -0
- package/app/pages/dcw/composables/useDcwQuery.ts +68 -0
- package/app/pages/dcw/composables/useDcwQuickActions.ts +47 -0
- package/app/pages/dcw/composables/useDcwRecipes.ts +239 -0
- package/app/pages/dcw/composables/useDcwTemplates.ts +50 -0
- package/app/pages/dcw/composables/useDcwWrites.ts +81 -0
- package/app/pages/dcw/dcw-page.css +344 -0
- package/app/pages/dcw/index.vue +64 -986
- package/app/pages/dcw/types.ts +9 -0
- package/app/pages/index.vue +126 -981
- package/app/pages/logs/composables/useLogsFormat.ts +43 -0
- package/app/pages/logs/composables/useLogsManual.ts +63 -0
- package/app/pages/logs/composables/useLogsQuery.ts +52 -0
- package/app/pages/logs/composables/useLogsScope.ts +39 -0
- package/app/pages/logs/index.vue +57 -728
- package/app/pages/monitor/composables/useMonitorColumns.ts +69 -0
- package/app/pages/monitor/composables/useMonitorData.ts +124 -0
- package/app/pages/monitor/composables/useMonitorFormat.ts +39 -0
- package/app/pages/monitor/composables/useMonitorTerminal.ts +28 -0
- package/app/pages/monitor/types.ts +61 -0
- package/app/pages/monitor.vue +88 -658
- package/app/pages/permissions/index.vue +3 -2
- package/app/pages/plugins/index.vue +318 -311
- package/app/pages/settings.vue +168 -1562
- package/app/pages/tokens/composables/useTokenClipboard.ts +33 -0
- package/app/pages/tokens/composables/useTokenCreate.ts +93 -0
- package/app/pages/tokens/composables/useTokenRename.ts +54 -0
- package/app/pages/tokens/composables/useTokenReveal.ts +84 -0
- package/app/pages/tokens/composables/useTokensList.ts +60 -0
- package/app/pages/tokens.vue +79 -597
- package/app/pages/users.vue +5 -4
- package/app/pages/workshop/agents.vue +130 -609
- package/app/pages/workshop/channel-templates.vue +18 -11
- package/app/pages/workshop/composables/useAgentHarnessOptions.ts +59 -0
- package/app/pages/workshop/composables/useAgentTemplateActions.ts +42 -0
- package/app/pages/workshop/composables/useAgentTemplateDialogState.ts +24 -0
- package/app/pages/workshop/composables/useAgentTemplateForm.ts +88 -0
- package/app/pages/workshop/composables/useAgentTemplatesCatalog.ts +92 -0
- package/app/pages/workshop/composables/useTeamActions.ts +44 -0
- package/app/pages/workshop/composables/useTeamAddMemberDialog.ts +49 -0
- package/app/pages/workshop/composables/useTeamCreateDialog.ts +67 -0
- package/app/pages/workshop/composables/useTeamDeployDialog.ts +49 -0
- package/app/pages/workshop/composables/useTeamDialogState.ts +46 -0
- package/app/pages/workshop/composables/useTeamPluginDialog.ts +72 -0
- package/app/pages/workshop/composables/useTeamsCatalog.ts +100 -0
- package/app/pages/workshop/composables/useWorkbenchAuth.ts +125 -0
- package/app/pages/workshop/composables/useWorkbenchWorkspaces.ts +123 -0
- package/app/pages/workshop/composables/useWorkspaceAuth.ts +31 -0
- package/app/pages/workshop/composables/useWorkspaceChannels.ts +62 -0
- package/app/pages/workshop/composables/useWorkspacePanels.ts +56 -0
- package/app/pages/workshop/composables/useWorkspaceShell.ts +136 -0
- package/app/pages/workshop/index.vue +116 -668
- package/app/pages/workshop/schedules.vue +553 -0
- package/app/pages/workshop/teams.vue +233 -740
- package/app/pages/workshop/w/[wsId].vue +221 -704
- package/app/plugins/locale-restore.client.ts +16 -1
- package/app/stores/workshop/chat.ts +434 -0
- package/app/stores/workshop/entities.ts +385 -283
- package/app/stores/workshop/events.ts +5 -4
- package/app/stores/workshop/hitl.ts +110 -7
- package/app/stores/workshop/narrow-fetch.ts +23 -0
- package/app/stores/workshop/notifications.ts +288 -0
- package/app/stores/workshop/user.ts +23 -10
- package/app/stores/workshop/workspaces.ts +12 -2
- package/app/utils/builtin-catalog.ts +104 -0
- package/config.yml +176 -170
- package/docs/aml.md +10 -0
- package/docs/cli.en.md +5 -5
- package/docs/cli.md +5 -5
- package/docs/full-test-plan.md +17 -4
- package/docs/plugins.en.md +1 -1
- package/docs/plugins.md +1 -1
- package/docs/sdk.en.md +1 -1
- package/docs/sdk.md +1 -1
- package/i18n/dicts/dcwDetail.json +2 -0
- package/i18n/locales/en.ts +364 -35
- package/i18n/locales/zh-CN.ts +336 -7
- package/package.json +3 -4
- package/scripts/_audit/detached-instance.mjs +112 -0
- package/scripts/_audit/schedules-ui/schedules-page.png +0 -0
- package/scripts/_audit/schedules-ui/workspace-channel-tag.png +0 -0
- package/scripts/_audit/stubs/nuxt-imports.mjs +67 -0
- package/scripts/_audit/ts-register-hook.mjs +12 -0
- package/scripts/_audit/ts-resolve-hook.mjs +25 -5
- package/scripts/_audit/watchdog-recovery-test.mjs +24 -2
- package/scripts/_dbg-comm-verify.mjs +188 -0
- package/scripts/_dbg-full-feature-e2e.mjs +19 -11
- package/scripts/_dbg-im-e2e.mjs +169 -0
- package/scripts/_dbg-opt2-run.mjs +114 -0
- package/scripts/_dbg-opt2-setup.mjs +95 -0
- package/scripts/_dbg-param-map-e2e.ts +1 -1
- package/scripts/_dbg-param-map-rest-smoke.mjs +1 -1
- package/scripts/_dbg-perms-e2e.mjs +132 -109
- package/scripts/_dbg-real-scenario-e2e.mjs +246 -0
- package/scripts/_dbg-schedule-e2e.mjs +262 -0
- package/scripts/_dbg-schedule-ui-verify.mjs +115 -0
- package/scripts/_dbg-team-matrix.mjs +148 -0
- package/scripts/_dbg-ui-fullcrawl.mjs +91 -0
- package/scripts/_dbg-ui-static-audit.mjs +65 -0
- package/scripts/_dbg-write-lock-e2e.mjs +131 -0
- package/scripts/_demo-agentteam-capture.mjs +278 -0
- package/scripts/_e2e-ui-functional.mjs +371 -0
- package/scripts/_i18n-en-cjk-scan.mjs +28 -0
- package/scripts/_i18n-en-verify.mjs +107 -0
- package/scripts/_i18n-extra-checks.mjs +53 -0
- package/scripts/_i18n-scan-hardcoded.mjs +180 -0
- package/scripts/_i18n-verify-keys.mjs +50 -0
- package/scripts/_loop-biax-campaign.mjs +15 -9
- package/scripts/_probe-daq-omp-task.mjs +100 -0
- package/scripts/_probe-daq-scope-default.mjs +123 -0
- package/scripts/_probe-recipe-switch.mjs +92 -0
- package/scripts/_provision-injection-line.mjs +39 -0
- package/scripts/_run-matrix.ps1 +53 -0
- package/scripts/_run-real-injection-fifo-goals.mjs +367 -0
- package/scripts/_sweep-button-contrast.mjs +87 -0
- package/scripts/acceptance-aml-db.ts +23 -0
- package/scripts/acceptance-aml-hybrid-live.mjs +94 -0
- package/scripts/acceptance-aml-hybrid-twin.ts +93 -0
- package/scripts/acceptance-hybrid-python.py +51 -0
- package/scripts/aml-ui-smoke.mjs +2 -0
- package/scripts/api-live-e2e.mjs +32 -7
- package/scripts/demo-group-chat-all-real.ts +279 -0
- package/scripts/demo-group-chat-omp-cases.ts +210 -0
- package/scripts/demo-group-chat-omp.ts +184 -0
- package/scripts/demo-group-chat-order.ts +197 -0
- package/scripts/e2e-agent-team.mjs +6 -4
- package/scripts/e2e-agentteam-chat.mjs +473 -0
- package/scripts/e2e-agentteam-real-triage.mjs +421 -0
- package/scripts/e2e-agentteam-task-flow-real.ts +443 -0
- package/scripts/e2e-aw-tui-global.mjs +8 -8
- package/scripts/e2e-channel-isolation.ts +5 -1
- package/scripts/e2e-closedloop/cleanup.mjs +27 -0
- package/scripts/e2e-closedloop/lib.mjs +109 -0
- package/scripts/e2e-closedloop/main.mjs +59 -0
- package/scripts/e2e-closedloop/scenarios-accounts.mjs +208 -0
- package/scripts/e2e-closedloop/scenarios-authz.mjs +190 -0
- package/scripts/e2e-closedloop/scenarios-daq-dcw.mjs +219 -0
- package/scripts/e2e-closedloop/scenarios-plugins.mjs +169 -0
- package/scripts/e2e-closedloop/state.mjs +10 -0
- package/scripts/e2e-crash-cycle.mjs +108 -0
- package/scripts/e2e-full-closedloop.mjs +6 -919
- package/scripts/e2e-hil-multi-user.mjs +307 -0
- package/scripts/e2e-hil-restart.mjs +339 -0
- package/scripts/e2e-hitl-live.mjs +336 -323
- package/scripts/e2e-lead-team-mgmt.ts +1 -1
- package/scripts/e2e-memory-system.ts +70 -89
- package/scripts/e2e-multiharness-team.mjs +32 -15
- package/scripts/e2e-omp-workspace.ts +21 -6
- package/scripts/e2e-parallel-execution.mjs +20 -6
- package/scripts/e2e-plc-plugin-closedloop.mjs +96 -65
- package/scripts/e2e-rest-memory.mjs +26 -11
- package/scripts/e2e-resume-crash.mjs +22 -7
- package/scripts/e2e-task-queue.ts +8 -8
- package/scripts/e2e-template-isolation.mjs +4 -2
- package/scripts/proof-omp-real.ts +189 -0
- package/scripts/real-injection-closed-loop.mjs +383 -0
- package/scripts/test-agent-runtime.ts +5 -1
- package/scripts/test-agentteam-guardrails.ts +113 -0
- package/scripts/test-agentteam-task-chat-flow.ts +420 -0
- package/scripts/test-agentteam-workflow.ts +472 -0
- package/scripts/test-collab-e2e.mjs +17 -3
- package/scripts/test-dcw-read.ts +9 -2
- package/scripts/test-event-persistence.mjs +10 -2
- package/scripts/test-full-system.ts +16 -3
- package/scripts/test-group-chat-hardening.ts +265 -0
- package/scripts/test-group-chat-unit/lib.ts +186 -0
- package/scripts/test-group-chat-unit/main.ts +45 -0
- package/scripts/test-group-chat-unit/section-a-migration.ts +75 -0
- package/scripts/test-group-chat-unit/section-b-permission-matrix.ts +88 -0
- package/scripts/test-group-chat-unit/section-c-member-lifecycle.ts +64 -0
- package/scripts/test-group-chat-unit/section-d-mention-resolution.ts +36 -0
- package/scripts/test-group-chat-unit/section-e-chat-facts.ts +97 -0
- package/scripts/test-group-chat-unit/section-f-user-notifications.ts +52 -0
- package/scripts/test-group-chat-unit/section-g-member-projection.ts +44 -0
- package/scripts/test-group-chat-unit/section-h-outbox-consistency.ts +30 -0
- package/scripts/test-group-chat-unit/section-i-read-idempotency.ts +24 -0
- package/scripts/test-group-chat-unit/section-j-permission-scope.ts +150 -0
- package/scripts/test-group-chat-unit.ts +35 -0
- package/scripts/test-hitl-decision.ts +526 -0
- package/scripts/test-hitl-legacy-channel-auth.ts +143 -0
- package/scripts/test-lane-history-live.mjs +30 -7
- package/scripts/test-memory-vector.ts +10 -0
- package/scripts/test-orchestration.ts +7 -2
- package/scripts/test-persistence-lazy.ts +7 -1
- package/scripts/test-prompt-system.mjs +46 -20
- package/scripts/test-route-reason.mjs +9 -2
- package/scripts/test-schedule-runtime.ts +309 -0
- package/scripts/test-scheduler-loop/lib.ts +321 -0
- package/scripts/test-scheduler-loop/main.ts +40 -0
- package/scripts/test-scheduler-loop/scenarios-modes.ts +95 -0
- package/scripts/test-scheduler-loop/scenarios-runtime.ts +58 -0
- package/scripts/test-scheduler-loop/scenarios-supervise.ts +183 -0
- package/scripts/test-scheduler-loop/scenarios-triage.ts +102 -0
- package/scripts/test-scheduler-loop.ts +5 -460
- package/scripts/test-supervision-watchdog.ts +105 -0
- package/scripts/test-task-engine.ts +27 -5
- package/scripts/test-task-lease-fencing.ts +154 -0
- package/scripts/test-terminal-e2e.mjs +9 -3
- package/scripts/three-system-e2e/lib.mjs +79 -0
- package/scripts/three-system-e2e/main.mjs +40 -0
- package/scripts/three-system-e2e/phases/phase-0-user-token.mjs +42 -0
- package/scripts/three-system-e2e/phases/phase-0a2-line-autoselect.mjs +35 -0
- package/scripts/three-system-e2e/phases/phase-0b-fixture-grants.mjs +39 -0
- package/scripts/three-system-e2e/phases/phase-0c-plugin-outbound-auth.mjs +95 -0
- package/scripts/three-system-e2e/phases/stage-1-health.mjs +47 -0
- package/scripts/three-system-e2e/phases/stage-2-5-team-plugins.mjs +84 -0
- package/scripts/three-system-e2e/phases/stage-2-teams-tools-hitl.mjs +184 -0
- package/scripts/three-system-e2e/phases/stage-3-diag.mjs +73 -0
- package/scripts/three-system-e2e/phases/stage-4-plugin-toggle.mjs +53 -0
- package/scripts/three-system-e2e/state.mjs +87 -0
- package/scripts/three-system-e2e.mjs +24 -646
- package/scripts/typecheck.mjs +75 -0
- package/scripts/ui/lib.mjs +14 -2
- package/scripts/ui/record-demo.mjs +557 -0
- package/scripts/ui/smoke-refactor.mjs +258 -0
- package/scripts/verify-a2a-live.mjs +15 -1
- package/scripts/verify-ws-events.mjs +19 -1
- package/server/api/system/monitor/terminal/ws.ts +51 -1
- package/server/api/workshop/agent-tools/approvals/[id]/decide.post.ts +59 -5
- package/server/api/workshop/agent-tools/approvals/index.get.ts +28 -3
- package/server/api/workshop/channel-templates/[id]/instantiate.post.ts +6 -1
- package/server/api/workshop/channels/[id]/chat/messages/[messageId]/read.post.ts +22 -0
- package/server/api/workshop/channels/[id]/chat/messages/index.get.ts +29 -0
- package/server/api/workshop/channels/[id]/chat/messages/index.post.ts +51 -0
- package/server/api/workshop/channels/[id]/chat/permissions.get.ts +35 -0
- package/server/api/workshop/channels/[id]/index.patch.ts +34 -8
- package/server/api/workshop/channels/[id]/members/[userId]/approve.post.ts +20 -0
- package/server/api/workshop/channels/[id]/members/[userId].delete.ts +21 -0
- package/server/api/workshop/channels/[id]/members/index.get.ts +23 -0
- package/server/api/workshop/channels/[id]/members/join.post.ts +30 -0
- package/server/api/workshop/channels/[id]/members/leave.post.ts +20 -0
- package/server/api/workshop/channels/[id]/messages/index.post.ts +3 -0
- package/server/api/workshop/channels/[id]/tasks/index.post.ts +8 -0
- package/server/api/workshop/channels.get.ts +21 -1
- package/server/api/workshop/hitl/pending.get.ts +27 -7
- package/server/api/workshop/hitl/respond.post.ts +86 -89
- package/server/api/workshop/notifications/index.get.ts +60 -0
- package/server/api/workshop/notifications/read.post.ts +31 -0
- package/server/api/workshop/schedules/[id]/run.post.ts +15 -0
- package/server/api/workshop/schedules/[id]/runs.get.ts +15 -0
- package/server/api/workshop/schedules/[id].delete.ts +14 -0
- package/server/api/workshop/schedules/[id].get.ts +13 -0
- package/server/api/workshop/schedules/[id].patch.ts +29 -0
- package/server/api/workshop/schedules/index.get.ts +12 -0
- package/server/api/workshop/schedules/index.post.ts +32 -0
- package/server/api/workshop/tasks/[id]/reassign.post.ts +32 -0
- package/server/api/workshop/tasks/[id]/update.post.ts +35 -0
- package/server/api/workshop/tasks/[id].get.ts +15 -6
- package/server/api/workshop/ws/audience.ts +56 -0
- package/server/api/workshop/ws/db-buffer.ts +68 -0
- package/server/api/workshop/ws/event-mapping.ts +47 -0
- package/server/api/workshop/ws/handlers.ts +132 -0
- package/server/api/workshop/ws/hub.ts +133 -0
- package/server/api/workshop/ws/index.ts +23 -0
- package/server/api/workshop/ws/notification-uplink.ts +77 -0
- package/server/api/workshop/ws/peer-sub.ts +128 -0
- package/server/api/workshop/ws/publish.ts +122 -0
- package/server/api/workshop/ws/shared.ts +94 -0
- package/server/api/workshop/ws/streams.ts +146 -0
- package/server/api/workshop/ws/subscriptions.ts +137 -0
- package/server/plugins/workshop.ts +30 -0
- package/server/plugins-builtin/diag-bridge/host/constants.mjs +25 -0
- package/server/plugins-builtin/diag-bridge/host/diagnosis.mjs +56 -0
- package/server/plugins-builtin/diag-bridge/host/helpers.mjs +126 -0
- package/server/plugins-builtin/diag-bridge/host/index.mjs +15 -0
- package/server/plugins-builtin/diag-bridge/host/plugin.mjs +296 -0
- package/server/plugins-builtin/diag-bridge/host/snapshot.mjs +93 -0
- package/server/plugins-builtin/diag-bridge/host/sweep.mjs +51 -0
- package/server/plugins-builtin/diag-bridge/index.mjs +9 -661
- package/server/plugins-builtin/rag-bridge/index.mjs +57 -133
- package/server/repositories/user.repository.ts +13 -0
- package/server/services/system-config/contracts.ts +29 -0
- package/server/services/system-config/dispose.ts +19 -0
- package/server/services/system-config/facade.ts +26 -0
- package/server/services/system-config/groups.ts +108 -0
- package/server/services/system-config/helpers.ts +41 -0
- package/server/services/system-config/index.ts +21 -0
- package/server/services/system-config/init.ts +26 -0
- package/server/services/system-config/mutate.ts +103 -0
- package/server/services/system-config/plugins.ts +104 -0
- package/server/services/system-config/recompute.ts +66 -0
- package/server/services/system-config/snapshot.ts +59 -0
- package/server/services/system-config/state.ts +79 -0
- package/server/services/system-config/types.ts +58 -0
- package/server/services/workshop/agents/adapters/line-spawn.ts +2 -2
- package/server/services/workshop/agents/adapters/omp-rpc-client/api.ts +111 -0
- package/server/services/workshop/agents/adapters/omp-rpc-client/contracts.ts +22 -0
- package/server/services/workshop/agents/adapters/omp-rpc-client/facade.ts +7 -0
- package/server/services/workshop/agents/adapters/omp-rpc-client/frames.ts +111 -0
- package/server/services/workshop/agents/adapters/omp-rpc-client/helpers.ts +38 -0
- package/server/services/workshop/agents/adapters/omp-rpc-client/index.ts +25 -0
- package/server/services/workshop/agents/adapters/omp-rpc-client/start.ts +70 -0
- package/server/services/workshop/agents/adapters/omp-rpc-client/state.ts +65 -0
- package/server/services/workshop/agents/adapters/omp-rpc-client/stdout.ts +92 -0
- package/server/services/workshop/agents/adapters/omp-rpc-client/types.ts +115 -0
- package/server/services/workshop/agents/adapters/omp-rpc-client/usage.ts +47 -0
- package/server/services/workshop/agents/agent-interface.ts +52 -4
- package/server/services/workshop/agents/base-agent.ts +36 -8
- package/server/services/workshop/agents/claude-agent.ts +5 -0
- package/server/services/workshop/agents/codex-agent/client.ts +170 -0
- package/server/services/workshop/agents/codex-agent/core.ts +119 -0
- package/server/services/workshop/agents/codex-agent/facade.ts +8 -0
- package/server/services/workshop/agents/codex-agent/helpers.ts +13 -0
- package/server/services/workshop/agents/codex-agent/hitl.ts +138 -0
- package/server/services/workshop/agents/codex-agent/index.ts +14 -0
- package/server/services/workshop/agents/codex-agent/turn.ts +367 -0
- package/server/services/workshop/agents/codex-agent/types.ts +42 -0
- package/server/services/workshop/agents/dsh-agent.ts +5 -0
- package/server/services/workshop/agents/harness-availability.ts +127 -127
- package/server/services/workshop/agents/harness-terminal/api.ts +197 -0
- package/server/services/workshop/agents/harness-terminal/index.ts +17 -0
- package/server/services/workshop/agents/harness-terminal/io.ts +120 -0
- package/server/services/workshop/agents/harness-terminal/park.ts +55 -0
- package/server/services/workshop/agents/harness-terminal/sanitize.ts +98 -0
- package/server/services/workshop/agents/harness-terminal/session.ts +124 -0
- package/server/services/workshop/agents/harness-terminal/shared.ts +74 -0
- package/server/services/workshop/agents/hermes-agent.ts +5 -0
- package/server/services/workshop/agents/hitl-capabilities.ts +312 -0
- package/server/services/workshop/agents/hitl-decision/answers.ts +27 -0
- package/server/services/workshop/agents/hitl-decision/decide.ts +268 -0
- package/server/services/workshop/agents/hitl-decision/dispatcher.ts +81 -0
- package/server/services/workshop/agents/hitl-decision/index.ts +24 -0
- package/server/services/workshop/agents/hitl-decision/payload.ts +45 -0
- package/server/services/workshop/agents/hitl-decision/reconcile.ts +70 -0
- package/server/services/workshop/agents/hitl-decision/shared.ts +106 -0
- package/server/services/workshop/agents/hitl-decision/visibility.ts +94 -0
- package/server/services/workshop/agents/hitl-registry.ts +403 -7
- package/server/services/workshop/agents/host-tool-bridge/catalog.ts +78 -0
- package/server/services/workshop/agents/host-tool-bridge/dispatch.ts +167 -0
- package/server/services/workshop/agents/host-tool-bridge/index.ts +15 -0
- package/server/services/workshop/agents/host-tool-bridge/session.ts +22 -0
- package/server/services/workshop/agents/host-tool-bridge/tools/industrial.ts +64 -0
- package/server/services/workshop/agents/host-tool-bridge/tools/memory.ts +44 -0
- package/server/services/workshop/agents/host-tool-bridge/tools/messaging.ts +182 -0
- package/server/services/workshop/agents/host-tool-bridge/tools/progress.ts +84 -0
- package/server/services/workshop/agents/host-tool-bridge/tools/tasks.ts +120 -0
- package/server/services/workshop/agents/host-tool-bridge/tools/team.ts +70 -0
- package/server/services/workshop/agents/host-tool-bridge/types.ts +31 -0
- package/server/services/workshop/agents/industrial/aml-dataset-tools.ts +276 -0
- package/server/services/workshop/agents/industrial/aml-job-tools.ts +363 -0
- package/server/services/workshop/agents/industrial/daq-tools.ts +251 -0
- package/server/services/workshop/agents/industrial/dcw-judge-tools.ts +153 -0
- package/server/services/workshop/agents/industrial/dcw-tools.ts +213 -0
- package/server/services/workshop/agents/industrial/index.ts +24 -0
- package/server/services/workshop/agents/industrial/ops-tools.ts +382 -0
- package/server/services/workshop/agents/industrial/param-tools.ts +172 -0
- package/server/services/workshop/agents/industrial/twin-tools.ts +175 -0
- package/server/services/workshop/agents/mock-agent.ts +136 -12
- package/server/services/workshop/agents/omp-agent/client.ts +116 -0
- package/server/services/workshop/agents/omp-agent/context-governance.ts +204 -0
- package/server/services/workshop/agents/omp-agent/core.ts +146 -0
- package/server/services/workshop/agents/omp-agent/event-mapping.ts +142 -0
- package/server/services/workshop/agents/omp-agent/facade.ts +8 -0
- package/server/services/workshop/agents/omp-agent/helpers.ts +37 -0
- package/server/services/workshop/agents/omp-agent/index.ts +16 -0
- package/server/services/workshop/agents/omp-agent/lifecycle.ts +80 -0
- package/server/services/workshop/agents/omp-agent/tools-steer.ts +487 -0
- package/server/services/workshop/agents/omp-agent/types.ts +45 -0
- package/server/services/workshop/agents/opencode-agent/core.ts +77 -0
- package/server/services/workshop/agents/opencode-agent/engine-agnostic.ts +274 -0
- package/server/services/workshop/agents/opencode-agent/facade.ts +8 -0
- package/server/services/workshop/agents/opencode-agent/helpers.ts +29 -0
- package/server/services/workshop/agents/opencode-agent/hitl.ts +113 -0
- package/server/services/workshop/agents/opencode-agent/index.ts +16 -0
- package/server/services/workshop/agents/opencode-agent/lifecycle.ts +44 -0
- package/server/services/workshop/agents/opencode-agent/server.ts +244 -0
- package/server/services/workshop/agents/opencode-agent/turn.ts +278 -0
- package/server/services/workshop/agents/opencode-agent/types.ts +54 -0
- package/server/services/workshop/agents/prompt-builder.ts +16 -6
- package/server/services/workshop/agents/qwen-agent.ts +6 -2
- package/server/services/workshop/agents/registry.ts +32 -2
- package/server/services/workshop/aml/job-orchestrator/broadcast.ts +37 -0
- package/server/services/workshop/aml/job-orchestrator/control.ts +94 -0
- package/server/services/workshop/aml/job-orchestrator/failure.ts +77 -0
- package/server/services/workshop/aml/job-orchestrator/index.ts +22 -0
- package/server/services/workshop/aml/job-orchestrator/process.ts +100 -0
- package/server/services/workshop/aml/job-orchestrator/shared.ts +51 -0
- package/server/services/workshop/aml/job-orchestrator/stages.ts +96 -0
- package/server/services/workshop/aml/job-orchestrator/start-job.ts +124 -0
- package/server/services/workshop/aml/job-orchestrator/status.ts +20 -0
- package/server/services/workshop/aml/job-orchestrator/submit.ts +120 -0
- package/server/services/workshop/aml/job-orchestrator/tick.ts +37 -0
- package/server/services/workshop/aml/python/amlkit.py +185 -120
- package/server/services/workshop/aml/python/requirements.txt +9 -7
- package/server/services/workshop/aml/python/train-hybrid-example.py +87 -0
- package/server/services/workshop/aml/twin/acceptance.ts +68 -0
- package/server/services/workshop/aml/twin/calibration-scheduler.ts +48 -0
- package/server/services/workshop/aml/twin/channel-profile.ts +43 -0
- package/server/services/workshop/aml/twin/contracts.ts +215 -0
- package/server/services/workshop/aml/twin/physics-runtime.ts +165 -0
- package/server/services/workshop/aml/twin/repo.ts +26 -0
- package/server/services/workshop/aml/twin/snapshot-service.ts +81 -0
- package/server/services/workshop/aml/twin/trial-service.ts +89 -0
- package/server/services/workshop/aml/twin/uq-ood.ts +66 -0
- package/server/services/workshop/daq/daq-controller/contracts.ts +39 -0
- package/server/services/workshop/daq/daq-controller/crud.ts +202 -0
- package/server/services/workshop/daq/daq-controller/driver-probe.ts +64 -0
- package/server/services/workshop/daq/daq-controller/facade.ts +28 -0
- package/server/services/workshop/daq/daq-controller/frames.ts +137 -0
- package/server/services/workshop/daq/daq-controller/helpers.ts +52 -0
- package/server/services/workshop/daq/daq-controller/index.ts +22 -0
- package/server/services/workshop/daq/daq-controller/ingest.ts +189 -0
- package/server/services/workshop/daq/daq-controller/runtime-control.ts +72 -0
- package/server/services/workshop/daq/daq-controller/state.ts +194 -0
- package/server/services/workshop/daq/daq-controller/sweep-alarms.ts +164 -0
- package/server/services/workshop/daq/daq-controller/tsdb-twin.ts +138 -0
- package/server/services/workshop/daq/daq-controller/types.ts +68 -0
- package/server/services/workshop/daq/daq-controller/views.ts +84 -0
- package/server/services/workshop/daq/drivers/http.ts +95 -0
- package/server/services/workshop/daq/drivers/index.ts +29 -0
- package/server/services/workshop/daq/drivers/mock.ts +130 -0
- package/server/services/workshop/daq/drivers/modbus-rtu.ts +67 -0
- package/server/services/workshop/daq/drivers/modbus-tcp.ts +307 -0
- package/server/services/workshop/daq/drivers/mqtt.ts +182 -0
- package/server/services/workshop/daq/drivers/opcua.ts +227 -0
- package/server/services/workshop/daq/drivers/registry.ts +144 -0
- package/server/services/workshop/daq/drivers/s7-stub.ts +29 -0
- package/server/services/workshop/daq/drivers/shared.ts +60 -0
- package/server/services/workshop/db/channel-member.repo.ts +122 -0
- package/server/services/workshop/db/channel.repo.ts +93 -8
- package/server/services/workshop/db/chat-message.repo.ts +233 -0
- package/server/services/workshop/db/database/index.ts +18 -0
- package/server/services/workshop/db/database/json.ts +14 -0
- package/server/services/workshop/db/database/migrations.ts +367 -0
- package/server/services/workshop/db/database/open.ts +76 -0
- package/server/services/workshop/db/database/rows.ts +374 -0
- package/server/services/workshop/db/database/schema.ts +651 -0
- package/server/services/workshop/db/database/seed-data.ts +60 -0
- package/server/services/workshop/db/database/seed.ts +145 -0
- package/server/services/workshop/db/hitl-request.repo.ts +221 -0
- package/server/services/workshop/db/notification.repo.ts +199 -0
- package/server/services/workshop/db/outbox.repo.ts +127 -0
- package/server/services/workshop/db/scheduled-task.repo.ts +235 -0
- package/server/services/workshop/db/schema.sql +185 -0
- package/server/services/workshop/db/task.repo.ts +185 -69
- package/server/services/workshop/db/transaction.ts +72 -0
- package/server/services/workshop/dcw/dcw-controller/actuation.ts +127 -0
- package/server/services/workshop/dcw/dcw-controller/bindings.ts +83 -0
- package/server/services/workshop/dcw/dcw-controller/contracts.ts +16 -0
- package/server/services/workshop/dcw/dcw-controller/control.ts +78 -0
- package/server/services/workshop/dcw/dcw-controller/crud.ts +152 -0
- package/server/services/workshop/dcw/dcw-controller/facade.ts +19 -0
- package/server/services/workshop/dcw/dcw-controller/helpers.ts +57 -0
- package/server/services/workshop/dcw/dcw-controller/index.ts +22 -0
- package/server/services/workshop/dcw/dcw-controller/lines.ts +213 -0
- package/server/services/workshop/dcw/dcw-controller/params.ts +97 -0
- package/server/services/workshop/dcw/dcw-controller/products.ts +103 -0
- package/server/services/workshop/dcw/dcw-controller/recipes.ts +137 -0
- package/server/services/workshop/dcw/dcw-controller/state.ts +66 -0
- package/server/services/workshop/dcw/dcw-controller/types.ts +57 -0
- package/server/services/workshop/dcw/dcw-controller/write.ts +147 -0
- package/server/services/workshop/dcw/dcw-node.ts +8 -0
- package/server/services/workshop/dcw/drivers/http.ts +66 -0
- package/server/services/workshop/dcw/drivers/index.ts +26 -0
- package/server/services/workshop/dcw/drivers/mock.ts +44 -0
- package/server/services/workshop/dcw/drivers/modbus-rtu.ts +93 -0
- package/server/services/workshop/dcw/drivers/modbus.ts +139 -0
- package/server/services/workshop/dcw/drivers/mqtt.ts +108 -0
- package/server/services/workshop/dcw/drivers/opcua.ts +110 -0
- package/server/services/workshop/dcw/drivers/registry.ts +118 -0
- package/server/services/workshop/dcw/drivers/shared.ts +113 -0
- package/server/services/workshop/dcw/recipe-rollback-manager/contracts.ts +26 -0
- package/server/services/workshop/dcw/recipe-rollback-manager/facade.ts +13 -0
- package/server/services/workshop/dcw/recipe-rollback-manager/helpers.ts +30 -0
- package/server/services/workshop/dcw/recipe-rollback-manager/index.ts +17 -0
- package/server/services/workshop/dcw/recipe-rollback-manager/internal.ts +33 -0
- package/server/services/workshop/dcw/recipe-rollback-manager/judge.ts +52 -0
- package/server/services/workshop/dcw/recipe-rollback-manager/lock.ts +137 -0
- package/server/services/workshop/dcw/recipe-rollback-manager/rollback.ts +190 -0
- package/server/services/workshop/dcw/recipe-rollback-manager/state.ts +21 -0
- package/server/services/workshop/dcw/recipe-rollback-manager/sweep.ts +77 -0
- package/server/services/workshop/dcw/recipe-rollback-manager/types.ts +3 -0
- package/server/services/workshop/dcw/recipe-rollback-manager/views.ts +214 -0
- package/server/services/workshop/plugins/host/api.mjs +90 -0
- package/server/services/workshop/plugins/host/config.mjs +135 -0
- package/server/services/workshop/plugins/host/index.mjs +23 -0
- package/server/services/workshop/plugins/host/init.mjs +101 -0
- package/server/services/workshop/plugins/host/load.mjs +321 -0
- package/server/services/workshop/plugins/host/reload.mjs +94 -0
- package/server/services/workshop/plugins/host/rollback.mjs +72 -0
- package/server/services/workshop/plugins/host/services.mjs +58 -0
- package/server/services/workshop/plugins/host/state.mjs +54 -0
- package/server/services/workshop/plugins/host/toggle.mjs +64 -0
- package/server/services/workshop/plugins/host.mjs +6 -890
- package/server/services/workshop/runtime/agent-runtime/contracts.ts +25 -0
- package/server/services/workshop/runtime/agent-runtime/facade.ts +7 -0
- package/server/services/workshop/runtime/agent-runtime/helpers.ts +18 -0
- package/server/services/workshop/runtime/agent-runtime/index.ts +19 -0
- package/server/services/workshop/runtime/agent-runtime/lifecycle.ts +119 -0
- package/server/services/workshop/runtime/agent-runtime/message.ts +409 -0
- package/server/services/workshop/runtime/agent-runtime/state.ts +371 -0
- package/server/services/workshop/runtime/agent-runtime/supervise.ts +188 -0
- package/server/services/workshop/runtime/agent-runtime/types.ts +186 -0
- package/server/services/workshop/runtime/channel-runtime.ts +7 -0
- package/server/services/workshop/runtime/chat-mention.ts +164 -0
- package/server/services/workshop/runtime/chat-projection.ts +246 -0
- package/server/services/workshop/runtime/execution-mode.ts +11 -2
- package/server/services/workshop/runtime/manager/a2a.ts +283 -0
- package/server/services/workshop/runtime/manager/access.ts +483 -0
- package/server/services/workshop/runtime/manager/admin-agents.ts +268 -0
- package/server/services/workshop/runtime/manager/admin-channel.ts +276 -0
- package/server/services/workshop/runtime/manager/bus.ts +182 -0
- package/server/services/workshop/runtime/manager/channel-templates.ts +171 -0
- package/server/services/workshop/runtime/manager/chat-reply.ts +181 -0
- package/server/services/workshop/runtime/manager/chat.ts +384 -0
- package/server/services/workshop/runtime/manager/contracts.ts +210 -0
- package/server/services/workshop/runtime/manager/facade.ts +24 -0
- package/server/services/workshop/runtime/manager/helpers.ts +119 -0
- package/server/services/workshop/runtime/manager/host-tools.ts +249 -0
- package/server/services/workshop/runtime/manager/index.ts +42 -0
- package/server/services/workshop/runtime/manager/internal.ts +73 -0
- package/server/services/workshop/runtime/manager/lead-team.ts +161 -0
- package/server/services/workshop/runtime/manager/notifications.ts +108 -0
- package/server/services/workshop/runtime/manager/runtime-observe.ts +300 -0
- package/server/services/workshop/runtime/manager/runtime-wiring.ts +307 -0
- package/server/services/workshop/runtime/manager/schedules.ts +302 -0
- package/server/services/workshop/runtime/manager/state.ts +644 -0
- package/server/services/workshop/runtime/manager/tasks.ts +518 -0
- package/server/services/workshop/runtime/manager/teams.ts +148 -0
- package/server/services/workshop/runtime/manager/types.ts +245 -0
- package/server/services/workshop/runtime/manager/workspace.ts +136 -0
- package/server/services/workshop/runtime/memory/contracts.ts +18 -0
- package/server/services/workshop/runtime/memory/facade.ts +10 -0
- package/server/services/workshop/runtime/memory/governance.ts +184 -0
- package/server/services/workshop/runtime/memory/helpers.ts +196 -0
- package/server/services/workshop/runtime/memory/index.ts +27 -0
- package/server/services/workshop/runtime/memory/recall.ts +216 -0
- package/server/services/workshop/runtime/memory/score.ts +33 -0
- package/server/services/workshop/runtime/memory/state.ts +40 -0
- package/server/services/workshop/runtime/memory/types.ts +44 -0
- package/server/services/workshop/runtime/memory/write.ts +93 -0
- package/server/services/workshop/runtime/permission-scope.ts +81 -0
- package/server/services/workshop/runtime/schedule-runtime.ts +320 -0
- package/server/services/workshop/runtime/scheduler-loop/contracts.ts +29 -0
- package/server/services/workshop/runtime/scheduler-loop/execute.ts +295 -0
- package/server/services/workshop/runtime/scheduler-loop/facade.ts +7 -0
- package/server/services/workshop/runtime/scheduler-loop/helpers.ts +14 -0
- package/server/services/workshop/runtime/scheduler-loop/index.ts +16 -0
- package/server/services/workshop/runtime/scheduler-loop/rules.ts +131 -0
- package/server/services/workshop/runtime/scheduler-loop/snapshot.ts +99 -0
- package/server/services/workshop/runtime/scheduler-loop/state.ts +150 -0
- package/server/services/workshop/runtime/scheduler-loop/tick.ts +157 -0
- package/server/services/workshop/runtime/scheduler-loop/types.ts +50 -0
- package/server/services/workshop/runtime/task-engine/contracts.ts +16 -0
- package/server/services/workshop/runtime/task-engine/create.ts +145 -0
- package/server/services/workshop/runtime/task-engine/facade.ts +7 -0
- package/server/services/workshop/runtime/task-engine/helpers.ts +87 -0
- package/server/services/workshop/runtime/task-engine/index.ts +15 -0
- package/server/services/workshop/runtime/task-engine/lease.ts +79 -0
- package/server/services/workshop/runtime/task-engine/lifecycle.ts +308 -0
- package/server/services/workshop/runtime/task-engine/policy.ts +113 -0
- package/server/services/workshop/runtime/task-engine/transition.ts +146 -0
- package/server/services/workshop/runtime/task-engine/types.ts +3 -0
- package/server/services/workshop/runtime/task-engine/update.ts +116 -0
- package/server/services/workshop/runtime/task-engine/views.ts +169 -0
- package/server/services/workshop/runtime/user-notification-hub.ts +192 -0
- package/server/services/workshop/settings.ts +32 -0
- package/server/services/workshop/types/task.ts +85 -0
- package/server/utils/errors.ts +2 -0
- package/server/utils/mojibake-guard.ts +29 -0
- package/shared/config/schema.json +12 -0
- package/shared/dcw-protocol/catalog.ts +203 -0
- package/shared/dcw-protocol/closed-loop.ts +137 -0
- package/shared/dcw-protocol/index.ts +19 -0
- package/shared/dcw-protocol/line.ts +131 -0
- package/shared/dcw-protocol/recipe.ts +301 -0
- package/shared/workshop-protocol.ts +327 -5
- package/tui/aw-tui.mjs +27 -6
- package/tui/lib/pickers.mjs +21 -2
- package/.output/public/_nuxt/4sIEbgcl.js +0 -42
- package/.output/public/_nuxt/88GOowgO2.js +0 -1
- package/.output/public/_nuxt/B7gZokg82.js +0 -209
- package/.output/public/_nuxt/BC9wjTJK2.js +0 -4
- package/.output/public/_nuxt/BCGafdXT.js +0 -2
- package/.output/public/_nuxt/BDmh31hl.js +0 -1
- package/.output/public/_nuxt/BFjGV-RV2.js +0 -4108
- package/.output/public/_nuxt/BHA40aHa.js +0 -1
- package/.output/public/_nuxt/BJHKLJJU.js +0 -1
- package/.output/public/_nuxt/BN16aRdQ.js +0 -1
- package/.output/public/_nuxt/BN6iuJEg2.js +0 -1
- package/.output/public/_nuxt/BU83-NnX.js +0 -106
- package/.output/public/_nuxt/BWVhZntO.js +0 -1
- package/.output/public/_nuxt/BXxH0UQE.js +0 -1
- package/.output/public/_nuxt/BYhEUx8t.js +0 -17
- package/.output/public/_nuxt/BneN7fbu.js +0 -75
- package/.output/public/_nuxt/BsROmY89.js +0 -1
- package/.output/public/_nuxt/C0ZrS1KL.js +0 -19
- package/.output/public/_nuxt/C3J6FYKa.js +0 -1
- package/.output/public/_nuxt/C3gwHTz0.js +0 -1
- package/.output/public/_nuxt/C4DWUZ6d2.js +0 -1
- package/.output/public/_nuxt/C4oW1HsE.js +0 -1
- package/.output/public/_nuxt/C4s_niy-.js +0 -14
- package/.output/public/_nuxt/CClOy-Hz2.js +0 -1
- package/.output/public/_nuxt/CFxtLwjp.js +0 -1
- package/.output/public/_nuxt/CS50LB_l.js +0 -1
- package/.output/public/_nuxt/CSkxz2NX.js +0 -3
- package/.output/public/_nuxt/CWoJjWmZ.js +0 -1
- package/.output/public/_nuxt/CYWVXZTS2.js +0 -7
- package/.output/public/_nuxt/C__m4EhR.js +0 -1
- package/.output/public/_nuxt/CoNpEq5X.js +0 -1
- package/.output/public/_nuxt/Crod5z2f.js +0 -1
- package/.output/public/_nuxt/CssgYAAL2.js +0 -1
- package/.output/public/_nuxt/CzlMDL5H.js +0 -13
- package/.output/public/_nuxt/D0ZBQrN_2.js +0 -1
- package/.output/public/_nuxt/D6mbFA-a.js +0 -1
- package/.output/public/_nuxt/D6uzXueg.js +0 -2
- package/.output/public/_nuxt/D98NH8kG.js +0 -1
- package/.output/public/_nuxt/D9Oidm5I.js +0 -1
- package/.output/public/_nuxt/DBHNsT1Y.js +0 -23
- package/.output/public/_nuxt/DDgJcSET.js +0 -19
- package/.output/public/_nuxt/DGIuvyRN2.js +0 -1
- package/.output/public/_nuxt/DGbd-UiG.js +0 -1
- package/.output/public/_nuxt/DGj-WEBg.js +0 -1
- package/.output/public/_nuxt/DHFrCUxA2.js +0 -13
- package/.output/public/_nuxt/DIaZ2PTo2.js +0 -1
- package/.output/public/_nuxt/DPnwL14Y.js +0 -1
- package/.output/public/_nuxt/DR12_WCA.js +0 -3
- package/.output/public/_nuxt/DS8qj8EL.js +0 -1
- package/.output/public/_nuxt/DTFCy6h-.js +0 -1
- package/.output/public/_nuxt/DUjW5Yq5.js +0 -1
- package/.output/public/_nuxt/DYr1VMiQ.js +0 -6
- package/.output/public/_nuxt/DZtm4l-P2.js +0 -1
- package/.output/public/_nuxt/D_OTvQza.js +0 -1
- package/.output/public/_nuxt/Dap5PmTL.js +0 -2
- package/.output/public/_nuxt/DdD9mCHM.js +0 -1
- package/.output/public/_nuxt/DeJykBFf.js +0 -9
- package/.output/public/_nuxt/DeyBFhKH2.js +0 -4
- package/.output/public/_nuxt/DkGQ7lnb2.js +0 -1
- package/.output/public/_nuxt/Dqw1lpr-.js +0 -1
- package/.output/public/_nuxt/DtYHUi5Z.js +0 -1
- package/.output/public/_nuxt/DvLxILQP.js +0 -1
- package/.output/public/_nuxt/Dz_Q3Lpw2.js +0 -1
- package/.output/public/_nuxt/DzbFpZRk.js +0 -3
- package/.output/public/_nuxt/IREZ1eC2.js +0 -1
- package/.output/public/_nuxt/JCoYF4IJ.js +0 -31
- package/.output/public/_nuxt/JTLM-kqr2.js +0 -1
- package/.output/public/_nuxt/KZQX7xoM.js +0 -3
- package/.output/public/_nuxt/OmpTerminalPanel.B_Pl5Ynm.css +0 -1
- package/.output/public/_nuxt/RYFtK4qZ2.js +0 -1
- package/.output/public/_nuxt/TownView.f-YOdXRs.css +0 -1
- package/.output/public/_nuxt/YnQxK3eG.js +0 -1
- package/.output/public/_nuxt/_id_.D9ymtHB5.css +0 -1
- package/.output/public/_nuxt/_id_.jf-_8E_c.css +0 -1
- package/.output/public/_nuxt/_wsId_.B4WiqkIS.css +0 -1
- package/.output/public/_nuxt/aLLjF2K-2.js +0 -1
- package/.output/public/_nuxt/aWWIh8YL.js +0 -24
- package/.output/public/_nuxt/agents.ZD0rVdHE.css +0 -1
- package/.output/public/_nuxt/aml.BN8ZEW4h.css +0 -1
- package/.output/public/_nuxt/builds/meta/78a295bb-2072-48a4-8b46-6d545fdae743.json +0 -1
- package/.output/public/_nuxt/ca4TJ3Op.js +0 -1
- package/.output/public/_nuxt/channel-templates.BOtahzPi.css +0 -1
- package/.output/public/_nuxt/daq.DjSgY94l.css +0 -1
- package/.output/public/_nuxt/dcw.8Y7FqCVN.css +0 -1
- package/.output/public/_nuxt/default.J32SgqFY.css +0 -1
- package/.output/public/_nuxt/entry.bdm0tv6M.css +0 -1
- package/.output/public/_nuxt/eqq3wWQF.js +0 -18
- package/.output/public/_nuxt/jZsY8yYz.js +0 -1
- package/.output/public/_nuxt/logs.BpKzmKsh.css +0 -1
- package/.output/public/_nuxt/monitor.D9pe7qN6.css +0 -1
- package/.output/public/_nuxt/pages.D7aSDlUI.css +0 -1
- package/.output/public/_nuxt/pdk8jLGT.js +0 -1
- package/.output/public/_nuxt/permissions.DwTVlFe6.css +0 -1
- package/.output/public/_nuxt/plugins.sb4nDGqr.css +0 -1
- package/.output/public/_nuxt/qr6R6Ha1.js +0 -1
- package/.output/public/_nuxt/settings.BTgR-NiE.css +0 -1
- package/.output/public/_nuxt/teams.CxnxKVVs.css +0 -1
- package/.output/public/_nuxt/tokens.BFY7qv4f.css +0 -1
- package/.output/public/_nuxt/town.BLrD9-WH.css +0 -1
- package/.output/public/_nuxt/users.DLgZ1D0h.css +0 -1
- package/.output/public/_nuxt/vRTjoWqd.js +0 -1
- package/.output/public/_nuxt/workshop.CR_QzeAN.css +0 -1
- package/.output/public/_nuxt/xh3_vYcu.js +0 -1
- package/.output/public/_nuxt/yF0aYMF1.js +0 -4
- package/.output/public/_nuxt/zq5t1vyX.js +0 -1
- package/.output/server/chunks/build/Checkbox-eax2M3o-.mjs +0 -207
- package/.output/server/chunks/build/Checkbox-eax2M3o-.mjs.map +0 -1
- package/.output/server/chunks/build/OmpTerminalPanel-Cu_s4i0A.mjs +0 -915
- package/.output/server/chunks/build/OmpTerminalPanel-Cu_s4i0A.mjs.map +0 -1
- package/.output/server/chunks/build/PluginSlot-CcR4Ys3T.mjs +0 -400
- package/.output/server/chunks/build/PluginSlot-CcR4Ys3T.mjs.map +0 -1
- package/.output/server/chunks/build/TownView--otsnr_7.mjs +0 -2790
- package/.output/server/chunks/build/TownView--otsnr_7.mjs.map +0 -1
- package/.output/server/chunks/build/_id_-Brv-JSvr.mjs +0 -803
- package/.output/server/chunks/build/_id_-Brv-JSvr.mjs.map +0 -1
- package/.output/server/chunks/build/_id_-D9pl1OZy.mjs +0 -381
- package/.output/server/chunks/build/_id_-D9pl1OZy.mjs.map +0 -1
- package/.output/server/chunks/build/_wsId_-BASfDf0s.mjs +0 -10066
- package/.output/server/chunks/build/_wsId_-BASfDf0s.mjs.map +0 -1
- package/.output/server/chunks/build/agents-CLQqJF2y.mjs +0 -1111
- package/.output/server/chunks/build/agents-CLQqJF2y.mjs.map +0 -1
- package/.output/server/chunks/build/aml-_7FdFL2p.mjs +0 -588
- package/.output/server/chunks/build/aml-_7FdFL2p.mjs.map +0 -1
- package/.output/server/chunks/build/api-error-dul30BYQ.mjs +0 -47
- package/.output/server/chunks/build/api-error-dul30BYQ.mjs.map +0 -1
- package/.output/server/chunks/build/apiClient-BwnfOQU8.mjs +0 -81
- package/.output/server/chunks/build/apiClient-BwnfOQU8.mjs.map +0 -1
- package/.output/server/chunks/build/button-DEcZFcqN.mjs +0 -1938
- package/.output/server/chunks/build/button-DEcZFcqN.mjs.map +0 -1
- package/.output/server/chunks/build/card-Dipvaykh.mjs +0 -955
- package/.output/server/chunks/build/card-Dipvaykh.mjs.map +0 -1
- package/.output/server/chunks/build/channel-templates-p6SZNjlM.mjs +0 -835
- package/.output/server/chunks/build/channel-templates-p6SZNjlM.mjs.map +0 -1
- package/.output/server/chunks/build/checkbox-8fB-wI-T.mjs +0 -439
- package/.output/server/chunks/build/checkbox-8fB-wI-T.mjs.map +0 -1
- package/.output/server/chunks/build/client-only-D5BzSQc6.mjs +0 -43
- package/.output/server/chunks/build/client-only-D5BzSQc6.mjs.map +0 -1
- package/.output/server/chunks/build/daq-DkMvD8sg.mjs +0 -1058
- package/.output/server/chunks/build/daq-DkMvD8sg.mjs.map +0 -1
- package/.output/server/chunks/build/dcw-C1jgVJkO.mjs +0 -249
- package/.output/server/chunks/build/dcw-C1jgVJkO.mjs.map +0 -1
- package/.output/server/chunks/build/default-BE4r0FZN.mjs +0 -1486
- package/.output/server/chunks/build/default-BE4r0FZN.mjs.map +0 -1
- package/.output/server/chunks/build/drawer-Cmh90erI.mjs +0 -836
- package/.output/server/chunks/build/drawer-Cmh90erI.mjs.map +0 -1
- package/.output/server/chunks/build/dropdown-CGQ0KAzA.mjs +0 -14
- package/.output/server/chunks/build/dropdown-CGQ0KAzA.mjs.map +0 -1
- package/.output/server/chunks/build/dropdown-vhn1NPFs.mjs +0 -558
- package/.output/server/chunks/build/dropdown-vhn1NPFs.mjs.map +0 -1
- package/.output/server/chunks/build/initDefaultProps-DIbWwP4R.mjs +0 -21
- package/.output/server/chunks/build/initDefaultProps-DIbWwP4R.mjs.map +0 -1
- package/.output/server/chunks/build/input-number-DzpyYB99.mjs +0 -1521
- package/.output/server/chunks/build/input-number-DzpyYB99.mjs.map +0 -1
- package/.output/server/chunks/build/input-sf_BT6o6.mjs +0 -2617
- package/.output/server/chunks/build/input-sf_BT6o6.mjs.map +0 -1
- package/.output/server/chunks/build/logs--dByNyhw.mjs +0 -198
- package/.output/server/chunks/build/logs--dByNyhw.mjs.map +0 -1
- package/.output/server/chunks/build/menu-WCrlpYVh.mjs +0 -1950
- package/.output/server/chunks/build/menu-WCrlpYVh.mjs.map +0 -1
- package/.output/server/chunks/build/modal-yvUquPj5.mjs +0 -1272
- package/.output/server/chunks/build/modal-yvUquPj5.mjs.map +0 -1
- package/.output/server/chunks/build/monitor-C0okQaXz.mjs +0 -2212
- package/.output/server/chunks/build/monitor-C0okQaXz.mjs.map +0 -1
- package/.output/server/chunks/build/pages-B0bUWnC6.mjs +0 -512
- package/.output/server/chunks/build/pages-B0bUWnC6.mjs.map +0 -1
- package/.output/server/chunks/build/permissions-68SsNjex.mjs +0 -629
- package/.output/server/chunks/build/permissions-68SsNjex.mjs.map +0 -1
- package/.output/server/chunks/build/plugins-lGlUr1lj.mjs +0 -240
- package/.output/server/chunks/build/plugins-lGlUr1lj.mjs.map +0 -1
- package/.output/server/chunks/build/popconfirm-CRaHcz5O.mjs +0 -342
- package/.output/server/chunks/build/popconfirm-CRaHcz5O.mjs.map +0 -1
- package/.output/server/chunks/build/segmented-3TrWo0lS.mjs +0 -5047
- package/.output/server/chunks/build/segmented-3TrWo0lS.mjs.map +0 -1
- package/.output/server/chunks/build/select-D-CeE5vY.mjs +0 -3923
- package/.output/server/chunks/build/select-D-CeE5vY.mjs.map +0 -1
- package/.output/server/chunks/build/settings-Ddd1qx2Z.mjs +0 -1174
- package/.output/server/chunks/build/settings-Ddd1qx2Z.mjs.map +0 -1
- package/.output/server/chunks/build/space-CCBYAkXt.mjs +0 -197
- package/.output/server/chunks/build/space-CCBYAkXt.mjs.map +0 -1
- package/.output/server/chunks/build/spin-HVY81X_L.mjs +0 -358
- package/.output/server/chunks/build/spin-HVY81X_L.mjs.map +0 -1
- package/.output/server/chunks/build/switch-CelRXpcy.mjs +0 -377
- package/.output/server/chunks/build/switch-CelRXpcy.mjs.map +0 -1
- package/.output/server/chunks/build/table-BjSWwmic.mjs +0 -8883
- package/.output/server/chunks/build/table-BjSWwmic.mjs.map +0 -1
- package/.output/server/chunks/build/tabs-BM3tAh_J.mjs +0 -1925
- package/.output/server/chunks/build/tabs-BM3tAh_J.mjs.map +0 -1
- package/.output/server/chunks/build/tag-DNE9vXc0.mjs +0 -1029
- package/.output/server/chunks/build/tag-DNE9vXc0.mjs.map +0 -1
- package/.output/server/chunks/build/teams-MEDLZdMn.mjs +0 -1215
- package/.output/server/chunks/build/teams-MEDLZdMn.mjs.map +0 -1
- package/.output/server/chunks/build/tokens-C7fTM5C2.mjs +0 -888
- package/.output/server/chunks/build/tokens-C7fTM5C2.mjs.map +0 -1
- package/.output/server/chunks/build/town-BUqRobze.mjs +0 -52
- package/.output/server/chunks/build/town-BUqRobze.mjs.map +0 -1
- package/.output/server/chunks/build/town-CoQdblbZ.mjs +0 -124
- package/.output/server/chunks/build/town-CoQdblbZ.mjs.map +0 -1
- package/.output/server/chunks/build/useDaqStream-DfCFpb3p.mjs +0 -395
- package/.output/server/chunks/build/useDaqStream-DfCFpb3p.mjs.map +0 -1
- package/.output/server/chunks/build/useDcwStream-UPiX-3iO.mjs +0 -435
- package/.output/server/chunks/build/useDcwStream-UPiX-3iO.mjs.map +0 -1
- package/.output/server/chunks/build/useDeviceTwins-Yko6nNPF.mjs +0 -128
- package/.output/server/chunks/build/useDeviceTwins-Yko6nNPF.mjs.map +0 -1
- package/.output/server/chunks/build/useOpsLog-CO_VWh7t.mjs +0 -137
- package/.output/server/chunks/build/useOpsLog-CO_VWh7t.mjs.map +0 -1
- package/.output/server/chunks/build/useWorkshopApi-NyjL0L3j.mjs +0 -90
- package/.output/server/chunks/build/useWorkshopApi-NyjL0L3j.mjs.map +0 -1
- package/.output/server/chunks/build/useWorkshopWs-C_I7q9As.mjs +0 -1319
- package/.output/server/chunks/build/useWorkshopWs-C_I7q9As.mjs.map +0 -1
- package/.output/server/chunks/build/users-Cfd5-l2-.mjs +0 -561
- package/.output/server/chunks/build/users-Cfd5-l2-.mjs.map +0 -1
- package/.output/server/chunks/build/workshop-BL5bhfs0.mjs +0 -931
- package/.output/server/chunks/build/workshop-BL5bhfs0.mjs.map +0 -1
- package/.output/server/chunks/build/workspaces-Bgz5Ekwp.mjs +0 -139
- package/.output/server/chunks/build/workspaces-Bgz5Ekwp.mjs.map +0 -1
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.continue.json +0 -1
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.json +0 -1
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/054bb4bc4e4217a2ab0b0c6b663747214a9af464f5568ea60e784704e340bb0f.source +0 -153
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/0554197c3d2bac203a1f5c48a5d52495d1336db1bd7aa4f4c19875810363e684.source +0 -153
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/05c203d12a954fffba942e1d626e3f5fec05b18a5aef2bac003b7884a4b77406.source +0 -431
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/145a6e6ba811af35aed31e0cc3211f53706a14980fa069ee9e3c1591139f96f0.source +0 -180
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/1ae0fb281f97899c025e368ca73f41349b01fb5f85b19e08d7ebccff49095ed5.source +0 -112
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/20ee9967aa0541c516db7575bdd4a1a745939bc7016bd10d7635903113edb8ec.source +0 -227
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/233751843aeba9d4c5263f275b8102de00443c06f286918cbd23e0b6729e01aa.source +0 -131
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/263c2e05b425e5c322e60c6475279f963bab3a873eb521b21df7fec935a46597.source +0 -160
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/2ac5eaac28eaaee2178c4b32014df8e732f9dd432a285a872f5b7f31c1395fa4.source +0 -157
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/33a0db0d2d95d2c11d0720090458e5fba1425376f5ceb5b422d1d3471be3226b.source +0 -348
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/359e474ae83db35e4615d3728de6bf694b64d4dce9b536730a3b6518f9c0494a.source +0 -296
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/37a4c3c31c4b70f6b719c53d1e9c4fcba603f31adfdd11bb6ef9f0d094923c56.source +0 -285
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/461feca1c14a695eb8b0f17a6f95fe97eeceabc0510faaea4ba6d25bde147d8d.source +0 -217
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/4cfadbda8591f29d5e1e230dc000e701b756e850441b3900fb596a4d2f6e98c2.source +0 -301
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/50ca2810cf0b248c96948994c0c404531bbad6e553166b6816b3b03bfa0f75d2.source +0 -151
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/52d9e8cb591a9ae86e238c3620a610cd386717bee222c0f37b25b2ac7e523dc4.source +0 -135
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/6c87daafa4c006560a954636a97333f6123153c9d34d96203f7ee3a14e556357.source +0 -156
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/77bc47854b577900621cacf1697f81fa2bc005af129d37614a97a3441c08f99f.source +0 -72
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/7bbb789d3a527817118cf8399ed1861d6a962ade10878fd07223435d333a7089.source +0 -469
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/86b7c1daafc8b60ba9982dde5bf1bcc74265709483c176e71f23ec6fc267451f.source +0 -259
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/8df66d62bd41984d0970e8236882080c5085ac937d07a29779463d6a03b37c76.source +0 -97
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/9962f2d1b3a85137bd40cc835725600b39f89ee02a27c06b2e0402e1eafde115.source +0 -277
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/a1090ea066b792cb201739f4994e37bf7c12f52e805239a1eab87f18a537f266.source +0 -171
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/a5241091650134d0919897e086a606a3846c8b2b54f8b4c84a8696c145ac3e9e.source +0 -425
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/af19fa4c6e34d5540028be4b17600161283af3a2a2dfc61a3fdc0834436a0c14.source +0 -99
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/b3713d78e2b2f93905ff6be8d58a8d0a2f42dea322eb67c987fda22ff6a084d5.source +0 -325
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/b3849943c3aff102d1af815631fc843a2a52c17646a4b04696ece323e483bbec.source +0 -332
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/bac735a3803a6650b7f1eb8f587e6dc5c68ea055000c3c99a11789438b78e837.source +0 -43
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/d32c24d61eb8b33c73e5a8fc7e4dc7ef437aed238ee4371c2b00617e6104090a.source +0 -154
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/d5170dc9a9879fda04fdf91d8a110d4efb6787ee38dda596d4da899883d36a72.source +0 -531
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/dc59bcd7bb397be63ba2f2c3fec23f3782dcb17d2d75a9981eeced761f33eb32.source +0 -439
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/eb5ff8cf66b92aec7bf6726781d8df74faa2b030c3aaac17d6b00c1fc04c9b32.source +0 -323
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/f10615a6fae18436e70d1201b2d44fdae3174a3aa7bb4db97dea1b3ed291d721.source +0 -433
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/f36d3e271668bc1260c2823542d22dbf1d0f7041ff16b1ac175bce2256e582ca.source +0 -280
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/f94449380af09f31ac352152007146a75cc80bae8d6411ffe57b2c56f933b0ff.source +0 -117
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/fe4dfd81178fd6b648335f6405d9ede71319aebde796008e50db21f8adf44c99.source +0 -160
- package/scripts/.mimosa/hook-state/sess_aeaecb58-8833-4b83-b93c-050467d21e03.mtxwtxme-61028-1f4519fbc4.baseline/ffb4e3aa548cfdadabaa44ab599f9b6a3ca6288176a2cc7a4b2fc2a12b5fb848.source +0 -101
- package/scripts/.mimosa/hook-status/sess_aeaecb58-8833-4b83-b93c-050467d21e03-d944d71bb3.json +0 -14
- package/scripts/_dbg-audit-all-pages.mjs +0 -43
- package/scripts/_dbg-daq-frames-e2e.mjs +0 -118
- package/scripts/_dbg-daq-rowstyle-verify.mjs +0 -112
- package/scripts/_dbg-hitl-timeout-e2e.mjs +0 -93
- package/scripts/_dbg-live-line-e2e.mjs +0 -279
- package/scripts/_dbg-minimal-omp.mjs +0 -77
- package/scripts/_dbg-mode-nav.mjs +0 -173
- package/scripts/_dbg-real-scenario-timeline.log +0 -55
- package/scripts/_dbg-team-repro.mjs +0 -76
- package/scripts/_dbg-town-agents-probe.mjs +0 -60
- package/scripts/_dbg-visual-acceptance.mjs +0 -63
- package/scripts/_townview_style.css +0 -1185
- package/scripts/_townview_template.html +0 -1215
- package/scripts/test-agent-brain.ts +0 -135
- package/scripts/test-game-session.ts +0 -160
- package/scripts/test-protocol.ts +0 -156
- package/scripts/verify-game.mjs +0 -477
- package/server/api/workshop/ws.ts +0 -763
- package/server/data/agent-node-bindings.json +0 -554
- package/server/data/daq-templates.json +0 -16
- package/server/data/daqs.json +0 -7464
- package/server/data/dcw-lines.json +0 -1787
- package/server/data/dcw-products.json +0 -1626
- package/server/data/dcw-recipes.json +0 -4672
- package/server/data/dcw-rollback.json +0 -20754
- package/server/data/dcw-runs.json +0 -6354
- package/server/data/dcw-templates.json +0 -146
- package/server/data/dcw-writes.json +0 -15650
- package/server/data/dcws.json +0 -9033
- package/server/data/device-twins.json +0 -133
- package/server/data/line-runs.json +0 -322
- package/server/data/scene-layouts.json +0 -277
- package/server/services/system-config.ts +0 -629
- package/server/services/workshop/agents/adapters/omp-rpc-client.ts +0 -604
- package/server/services/workshop/agents/codex-agent.ts +0 -743
- package/server/services/workshop/agents/harness-terminal.ts +0 -625
- package/server/services/workshop/agents/host-tool-bridge.ts +0 -714
- package/server/services/workshop/agents/industrial-tools.ts +0 -1680
- package/server/services/workshop/agents/omp-agent.ts +0 -1199
- package/server/services/workshop/agents/opencode-agent.ts +0 -960
- package/server/services/workshop/aml/job-orchestrator.ts +0 -639
- package/server/services/workshop/daq/daq-controller.ts +0 -1284
- package/server/services/workshop/daq/drivers.ts +0 -1185
- package/server/services/workshop/db/database.ts +0 -1044
- package/server/services/workshop/dcw/dcw-controller.ts +0 -1176
- package/server/services/workshop/dcw/drivers.ts +0 -731
- package/server/services/workshop/dcw/recipe-rollback-manager.ts +0 -713
- package/server/services/workshop/runtime/agent-runtime.ts +0 -821
- package/server/services/workshop/runtime/manager.ts +0 -3050
- package/server/services/workshop/runtime/memory.ts +0 -681
- package/server/services/workshop/runtime/scheduler-loop.ts +0 -799
- package/server/services/workshop/runtime/task-engine.ts +0 -574
- package/shared/dcw-protocol.ts +0 -747
- /package/.output/public/_nuxt/{BrIJiJSN.js → BrIJiJSN2.js} +0 -0
- /package/.output/public/_nuxt/{CNs_Ozdc2.js → CNs_Ozdc.js} +0 -0
- /package/.output/public/_nuxt/{DIOBYJe3.js → DIOBYJe32.js} +0 -0
- /package/.output/public/_nuxt/{lO5tpDZ5.js → lO5tpDZ52.js} +0 -0
|
@@ -1,1680 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IndustrialTools —— Agent 工业工具核心(daq_query / dcw_control)。
|
|
3
|
-
*
|
|
4
|
-
* 权限模型:Agent 只能操作「绑定」给它的节点(node-bindings.repo);
|
|
5
|
-
* 数控下发的安全校验与手动写完全同源(节点全局量程 + 活动配方工艺窗口联锁
|
|
6
|
-
* 在 DcwController.write 内),manual 模式额外经用户批准(可附备注)。
|
|
7
|
-
* 所有工具结果都携带物理语义(参数含义/单位/量程/窗口/回读),让 AI 理解数值。
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import type { AgentNodeBinding } from './node-bindings.repo'
|
|
11
|
-
import { getAgentNodeBindingRepo } from './node-bindings.repo'
|
|
12
|
-
import { getToolApprovals } from './tool-approvals'
|
|
13
|
-
import { nodeSemanticCards } from './industrial-context'
|
|
14
|
-
import { agentBadgeLabel } from './agent-badge'
|
|
15
|
-
import { getDcwController } from '../dcw/dcw-controller'
|
|
16
|
-
import { getActiveLineRun } from '../dcw/line-run'
|
|
17
|
-
import { findDcwTemplate } from '../dcw/dcw-templates'
|
|
18
|
-
import { daqRuntimeSettings } from '../settings'
|
|
19
|
-
import { getDaqNodeRepo } from '../daq/daq-node.repo'
|
|
20
|
-
import { findDaqTemplate } from '../daq/daq-templates'
|
|
21
|
-
import { getRecipeRollBackManager } from '../dcw/recipe-rollback-manager'
|
|
22
|
-
import { getDcwParamRepo } from '../dcw/param-map.repo'
|
|
23
|
-
import { limitsBreakdownOf } from '../dcw/param-limits'
|
|
24
|
-
import type { DcwParamView } from '../../../../shared/dcw-protocol'
|
|
25
|
-
import { getOps, recordOps } from '../ops/ops'
|
|
26
|
-
import { getDcwLineRepo } from '../dcw/dcw-line.repo'
|
|
27
|
-
import { getDcwProductRepo } from '../dcw/dcw-product.repo'
|
|
28
|
-
import { getDcwRecipeRepo } from '../dcw/dcw-recipe.repo'
|
|
29
|
-
import { readFileSync } from 'node:fs'
|
|
30
|
-
import { join } from 'node:path'
|
|
31
|
-
import { getAmlRuntime } from '../aml/runtime'
|
|
32
|
-
import { parseDatasetSpec } from '../aml/spec'
|
|
33
|
-
import { buildDataset, type AmlDatasetReport } from '../aml/dataset-builder'
|
|
34
|
-
import { cancelJob, jobLogsTail, runtimeStatus, submitJob } from '../aml/job-orchestrator'
|
|
35
|
-
import { transitionModel } from '../aml/model-registry'
|
|
36
|
-
import { predictProduction, readIoSpecFor } from '../aml/predictor'
|
|
37
|
-
import { alignToGrid } from '../aml/clean'
|
|
38
|
-
import type { AmlDatasetRow, AmlJobRow } from '../aml/aml.repo'
|
|
39
|
-
|
|
40
|
-
export async function toolMyIndustrialNodes(agentId: string): Promise<{ text: string }> {
|
|
41
|
-
const repo = getAgentNodeBindingRepo()
|
|
42
|
-
const bindings = repo.byAgent(agentId)
|
|
43
|
-
if (bindings.length === 0) {
|
|
44
|
-
return { text: '你尚未绑定任何工业节点。请在数字孪生界面的 Agent 详情面板中绑定数控/数采节点后再调用工业工具。' }
|
|
45
|
-
}
|
|
46
|
-
const cards = nodeSemanticCards(agentId)
|
|
47
|
-
if (cards.stale > 0) repo.removeAgentNodeStale(agentId, bindings.filter((b) => {
|
|
48
|
-
const has = b.kind === 'dcw' ? !!getDcwController().byId(b.nodeId) : !!getDaqNodeRepo().byId(b.nodeId)
|
|
49
|
-
return !has
|
|
50
|
-
}).map(b => b.id))
|
|
51
|
-
if (!cards.text) return { text: '绑定的节点均已不存在(可能被删除),请重新绑定。' }
|
|
52
|
-
const staleNote = cards.stale > 0
|
|
53
|
-
? `
|
|
54
|
-
(另有 ${cards.stale} 条失效绑定已自动清理)`
|
|
55
|
-
: ''
|
|
56
|
-
// 调控闭环洞察:每个数控节点的 open 优化记录 / lastGood / 最近判定(Agent 驱动的状态面)
|
|
57
|
-
const rb = getRecipeRollBackManager()
|
|
58
|
-
const insights: string[] = []
|
|
59
|
-
for (const b of bindings.filter(x => x.kind === 'dcw')) {
|
|
60
|
-
try {
|
|
61
|
-
const ins = rb.nodeInsight(b.nodeId)
|
|
62
|
-
const parts: string[] = []
|
|
63
|
-
if (ins.openRecord)
|
|
64
|
-
parts.push(`进行中优化 ${ins.openRecord.id}: ${ins.openRecord.params[0]?.from ?? '?'}→${ins.openRecord.params[0]?.to}(setAt ${ins.openRecord.setAt.slice(11, 19)},policy=${ins.openRecord.policy})`)
|
|
65
|
-
if (ins.lastGood != null)
|
|
66
|
-
parts.push(`上次良好值 ${ins.lastGood}`)
|
|
67
|
-
for (const j of ins.recentJudges.slice(0, 1))
|
|
68
|
-
parts.push(`最近判定 ${j.verdict}(${j.by}):${j.reason.slice(0, 60)}`)
|
|
69
|
-
if (parts.length > 0)
|
|
70
|
-
insights.push(`- ${b.nodeId}: ${parts.join(';')}`)
|
|
71
|
-
}
|
|
72
|
-
catch { /* 节点刚被删等情况忽略 */ }
|
|
73
|
-
}
|
|
74
|
-
const insightBlock = insights.length > 0 ? `\n\n调控闭环状态:\n${insights.join('\n')}` : ''
|
|
75
|
-
return {
|
|
76
|
-
text: `${cards.text}${staleNote}${insightBlock}
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
通用规则:
|
|
80
|
-
1. 一个 Agent 可绑定多个节点;先读本清单理解每个节点的物理意义与操作守则,再动手。
|
|
81
|
-
2. 数控下发优先用 param_control(param, value) 以**工艺参数**寻址(key 语义稳定,跨批次/换配方不变);
|
|
82
|
-
dcw_control(node_id, value) 为节点直接寻址的兼容面。设定值受四层限界联锁
|
|
83
|
-
(节点安全量程 ∩ 工艺参数基准限界 ∩ 活动产品限界 ∩ 活动配方工艺窗口)逐层收窄,
|
|
84
|
-
越界一律拒绝 —— 用户与 Agent 一体约束,无旁路。下发前/后用 param_read(param) 读 PLC 当前值取证复核(被动观测免审批)。
|
|
85
|
-
3. 数据获取 daq_query(不传 node_id = 全部数采节点),支持按产线/产品/配方/时间检索;解读数据时结合语义卡的判读方法。
|
|
86
|
-
4. 改动设定后等待工艺响应(热惯性/传动惯量)再评估,避免连续大幅调整。
|
|
87
|
-
5. 调控闭环:每次下发自动开一条优化记录(open);观察数采后用 dcw_judge 落判定(keep/rollback/uncertain);
|
|
88
|
-
判 rollback 后用 dcw_rollback 执行回退;dcw_journal 可查节点参数变更史。未判定前再下发,旧记录会被标记 superseded。
|
|
89
|
-
若节点被他人的 open 记录阻塞(对方已消失),超时(30 分钟)后你可接管:dcw_judge 会带接管标记入册。
|
|
90
|
-
6. 自查面:line_context 看你控制的产线/产品/配方全景(动手前必读,确认归属);
|
|
91
|
-
ops_log 查你负责产线的运维日志(谁/何时做了什么,来源区分 Agent/用户/系统;
|
|
92
|
-
参数 line_id/node_id/kind/actor_kind/minutes/limit/mine);recipe_log 查配方下发与回退事件;
|
|
93
|
-
recipe_versions 查配方参数版本史(谁改的/为什么/参数 diff)。
|
|
94
|
-
7. 配方操控闭环(在线优化框架):验证过参数更优 → recipe_update 保存进配方(记录你的名字与原因,
|
|
95
|
-
生成新版本);发现优化有问题 → recipe_rollback 回退到稳定版本(version)或已知良好批次
|
|
96
|
-
(to_last_good=true);运行中 PLC 当前值用 dcw_control 下发,配方定义供后续批次生效。`,
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/** 工具:dcw_control —— 数控下发(鉴权 → 停线守卫 → 手动审批 → 安全联锁 → 回读语义结果)。
|
|
101
|
-
* 调控闭环:下发自动开优化记录;args.hypothesis 声明本次假设(入册),args.task_id 关联任务。 */
|
|
102
|
-
export async function toolDcwControl(agentId: string, args: { node_id?: string, value?: number | string, hypothesis?: string, task_id?: string }): Promise<{ text: string, isError?: boolean }> {
|
|
103
|
-
const nodeId = String(args.node_id ?? '').trim()
|
|
104
|
-
const value = Number(args.value)
|
|
105
|
-
const repo = getAgentNodeBindingRepo()
|
|
106
|
-
const binding: AgentNodeBinding | undefined = nodeId ? repo.find(agentId, nodeId, 'dcw') : undefined
|
|
107
|
-
if (!binding) {
|
|
108
|
-
const mine = repo.byAgent(agentId).filter(b => b.kind === 'dcw')
|
|
109
|
-
return {
|
|
110
|
-
text: mine.length
|
|
111
|
-
? `无权操作节点 ${nodeId || '(空)'}。你有权控制的数控节点:${mine.map(b => b.nodeId).join(', ')}(可用 my_industrial_nodes 查看物理含义)。`
|
|
112
|
-
: '你尚未绑定任何数控节点,无权下发控制指令。请在数字孪生界面绑定数控节点。',
|
|
113
|
-
isError: true,
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
if (!Number.isFinite(value)) {
|
|
117
|
-
return { text: '设定值 value 必须为数字。', isError: true }
|
|
118
|
-
}
|
|
119
|
-
const node = getDcwController().byId(nodeId)
|
|
120
|
-
if (!node) {
|
|
121
|
-
// 节点已被删除 → 绑定失效自清理,提示重新绑定
|
|
122
|
-
repo.removeAgentNode(agentId, nodeId, 'dcw')
|
|
123
|
-
return { text: `数控节点 ${nodeId} 已不存在(可能被删除),原绑定已自动清理,请重新绑定。`, isError: true }
|
|
124
|
-
}
|
|
125
|
-
// 停用/解绑守卫:停用节点拒绝下发(与手动/配方同源语义,给出恢复路径)
|
|
126
|
-
if (!node.enabled) {
|
|
127
|
-
return { text: `节点「${node.name}」已停用(控制已暂停),无法下发。请先让用户在产线/数采界面恢复该节点的控制,或改派其他节点。`, isError: true }
|
|
128
|
-
}
|
|
129
|
-
// 停线守卫:产线未开跑时手动写允许(调试),但提示当前无配方窗口约束
|
|
130
|
-
const tpl = findDcwTemplate(node.templateKey)
|
|
131
|
-
|
|
132
|
-
// 手动确认模式:挂起等待用户批准(备注会回给 Agent)
|
|
133
|
-
// 同 Agent 同节点的挂起审批去重:防止审批面板堆积(前一条未决,拒绝新的)
|
|
134
|
-
if (binding.mode === 'manual') {
|
|
135
|
-
const approvals = getToolApprovals()
|
|
136
|
-
if (approvals.hasPendingFor(agentId, nodeId)) {
|
|
137
|
-
return { text: `你对该节点已有一条待审批的下发指令,请等待用户处理后再发新指令(避免审批堆积)。`, isError: true }
|
|
138
|
-
}
|
|
139
|
-
const bd = limitsBreakdownOf(node)
|
|
140
|
-
const detail = `${node.name}(${tpl?.ch ?? node.templateKey})设定 ${value}${node.unit},有效写入区间 ${bd.effective.min}~${bd.effective.max}${node.unit}(${bd.layers.map(l => l.label).join(' ∩ ')})`
|
|
141
|
-
const ap = await approvals.request(agentId, nodeId, 'dcw', detail)
|
|
142
|
-
if (!ap.approved) {
|
|
143
|
-
return { text: `指令未执行:用户${ap.comment.includes('超时') ? '未在时限内批准(超时)' : `拒绝了本次下发`}。用户备注:${ap.comment || '(无)'}` }
|
|
144
|
-
}
|
|
145
|
-
// 审批期间节点可能被解绑/删除(权限在批准时失效):二次校验
|
|
146
|
-
if (!repo.find(agentId, nodeId, 'dcw')) {
|
|
147
|
-
return { text: '指令未执行:审批通过时你的该节点绑定已被解除(权限在批准时失效)。', isError: true }
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
try {
|
|
152
|
-
const meta = {
|
|
153
|
-
source: 'agent' as const,
|
|
154
|
-
actor: agentId,
|
|
155
|
-
// 人话操作者:「Channel名/成员名」——/logs 来源=Agent 与用户/系统操作可区分追溯
|
|
156
|
-
actorName: agentBadgeLabel(agentId),
|
|
157
|
-
taskId: args.task_id ? String(args.task_id) : undefined,
|
|
158
|
-
hypothesis: args.hypothesis ? String(args.hypothesis) : '',
|
|
159
|
-
}
|
|
160
|
-
const outcome = await getDcwController().write(nodeId, value, null, meta)
|
|
161
|
-
const run = node.lineId ? getActiveLineRun(node.lineId) : null
|
|
162
|
-
const winTxt = run
|
|
163
|
-
? `当前活动配方「${run.recipeName}」`
|
|
164
|
-
: '当前无活动配方(全局量程约束)'
|
|
165
|
-
if (outcome.ok) {
|
|
166
|
-
// 调控闭环回包:记录 id + 上一稳定锚 + 策略提示(安全网信息,Agent 据此规划判定)
|
|
167
|
-
const rb = getRecipeRollBackManager()
|
|
168
|
-
const stable = rb.journal({ nodeId, limit: 10 }).find(a => a.prevValue != null && a.prevValue !== a.newValue)
|
|
169
|
-
const policyHint = binding.mode === 'manual'
|
|
170
|
-
? '本节点为手动确认模式:判定回退将推请用户确认'
|
|
171
|
-
: '本节点为自动模式:越配方监控窗将触发系统自动回退'
|
|
172
|
-
const loopTxt = [
|
|
173
|
-
outcome.recordId ? `优化记录 ${outcome.recordId} 已开窗(观察数采后 dcw_judge 落判定)` : null,
|
|
174
|
-
stable ? `上一稳定锚:${stable.prevValue}${node.unit}(可 dcw_rollback 回退)` : null,
|
|
175
|
-
policyHint,
|
|
176
|
-
].filter(Boolean).join(';')
|
|
177
|
-
return {
|
|
178
|
-
text: `下发成功:${node.name}(${tpl?.ch ?? node.templateKey})设定 ${value}${node.unit} → PLC 原始值 ${outcome.raw ?? '-'};回读 ${outcome.readback != null ? `${outcome.readback}${node.unit}` : '不支持'}一致。${winTxt}。${outcome.message}\n[调控闭环] ${loopTxt}`,
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
// 失败文案带自我纠正线索:当前保持原值 + 建议动作(缩小步进/稍后重试)
|
|
182
|
-
const keptHint = `当前设定值保持 ${node.value ?? '原值'}${node.unit} 未被改动`
|
|
183
|
-
const retryHint = /忙|busy/i.test(outcome.message) ? '链路忙属瞬时状态,可稍后重试' : '可缩小步进幅度后重试'
|
|
184
|
-
return { text: `下发失败:${outcome.message}(节点 ${node.name},物理量 ${tpl?.ch ?? node.templateKey},安全量程 ${node.min}~${node.max}${node.unit};${keptHint};${retryHint})`, isError: true }
|
|
185
|
-
}
|
|
186
|
-
catch (err) {
|
|
187
|
-
const msg = err instanceof Error ? err.message : String(err)
|
|
188
|
-
const retryHint = /忙|busy/i.test(msg) ? '链路忙属瞬时状态,可稍后重试' : '设定值必须落在安全量程与活动配方工艺窗口内'
|
|
189
|
-
return { text: `下发被拒绝:${msg}(节点 ${node.name},物理量 ${tpl?.ch ?? node.templateKey};${retryHint})`, isError: true }
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/** 工具:dcw_read —— 读取数控节点的 PLC 当前值(读写集成的读半边;被动观测免审批)。
|
|
194
|
-
* 返回 PLC 实时读数(标定解码后的物理量)与当前设定值对照,供下发前取证/下发后复核。 */
|
|
195
|
-
export async function toolDcwRead(agentId: string, args: { node_id?: string }): Promise<{ text: string, isError?: boolean }> {
|
|
196
|
-
const nodeId = String(args.node_id ?? '').trim()
|
|
197
|
-
const repo = getAgentNodeBindingRepo()
|
|
198
|
-
const binding: AgentNodeBinding | undefined = nodeId ? repo.find(agentId, nodeId, 'dcw') : undefined
|
|
199
|
-
if (!binding) {
|
|
200
|
-
const mine = repo.byAgent(agentId).filter(b => b.kind === 'dcw')
|
|
201
|
-
return {
|
|
202
|
-
text: mine.length
|
|
203
|
-
? `无权读取节点 ${nodeId || '(空)'}。你有权读取的数控节点:${mine.map(b => b.nodeId).join(', ')}。`
|
|
204
|
-
: '你尚未绑定任何数控节点,无权读取控制通道数据。请在数字孪生界面绑定数控节点。',
|
|
205
|
-
isError: true,
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
const node = getDcwController().byId(nodeId)
|
|
209
|
-
if (!node) {
|
|
210
|
-
repo.removeAgentNode(agentId, nodeId, 'dcw')
|
|
211
|
-
return { text: `数控节点 ${nodeId} 已不存在(可能被删除),原绑定已自动清理,请重新绑定。`, isError: true }
|
|
212
|
-
}
|
|
213
|
-
const tpl = findDcwTemplate(node.templateKey)
|
|
214
|
-
try {
|
|
215
|
-
const read = await getDcwController().readNow(nodeId)
|
|
216
|
-
if (!read.ok && read.value == null && !node.readValue) {
|
|
217
|
-
return { text: `读取失败:${read.message}(节点 ${node.name},驱动 ${node.driver} 可能不支持读取;可改用 daq_query 查关联数采通道)`, isError: true }
|
|
218
|
-
}
|
|
219
|
-
const setTxt = node.value != null ? `${node.value}${node.unit}` : '从未下发'
|
|
220
|
-
const readTxt = read.value != null
|
|
221
|
-
? `${Number(read.value.toFixed(node.decimals))}${node.unit}`
|
|
222
|
-
: (node.readValue != null ? `${node.readValue}${node.unit}(最近一次)` : '无读数')
|
|
223
|
-
const devTxt = read.value != null && node.value != null
|
|
224
|
-
? (Math.abs(read.value - node.value) < writeToleranceOf(node)
|
|
225
|
-
? '读数与设定一致(设定已生效)'
|
|
226
|
-
: '读数与设定存在偏差(可能工艺在响应或被本地修改)')
|
|
227
|
-
: '设定与读数暂不可对照'
|
|
228
|
-
return {
|
|
229
|
-
text: `读取成功:${node.name}(${tpl?.ch ?? node.templateKey})\n PLC 读数(ACT): ${readTxt} @ ${read.at.slice(11, 19)}\n 当前设定(SET): ${setTxt}\n 对照: ${devTxt}${read.raw != null ? `\n 原始值(raw): ${Number(read.raw.toFixed(4))}` : ''}`,
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
catch (err) {
|
|
233
|
-
return { text: `读取被拒绝:${err instanceof Error ? err.message : String(err)}(节点 ${node.name})`, isError: true }
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
/** 读/设定偏差对照容差(与服务端回读死区同口径) */
|
|
238
|
-
function writeToleranceOf(node: { decimals: number, min: number, max: number }): number {
|
|
239
|
-
return Math.max(0.5 * 10 ** -node.decimals, (node.max - node.min) * 0.005)
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/** 工艺参数解析(param_control/param_read 共用):pp-id 优先,其次按 key;跨产线同名需 line_id 消歧 */
|
|
243
|
-
function resolveParamRef(ref: string, lineId?: string): { ok: true, param: DcwParamView } | { ok: false, text: string, isError: true } {
|
|
244
|
-
const repo = getDcwParamRepo()
|
|
245
|
-
const trimmed = String(ref ?? '').trim()
|
|
246
|
-
if (!trimmed) {
|
|
247
|
-
return { ok: false, text: 'param 必填:工艺参数 id(pp-*)或参数 key(见 my_industrial_nodes)。', isError: true }
|
|
248
|
-
}
|
|
249
|
-
const row = trimmed.startsWith('pp-') ? repo.byId(trimmed) : undefined
|
|
250
|
-
if (row) {
|
|
251
|
-
const view = repo.viewOf(row)
|
|
252
|
-
if (!view) return { ok: false, text: `工艺参数 ${trimmed} 的执行节点已不存在(映射悬空)。`, isError: true }
|
|
253
|
-
if (lineId && view.lineId !== lineId) {
|
|
254
|
-
return { ok: false, text: `工艺参数 ${view.key} 不属于产线 ${lineId}(实际归属:${view.lineId || '未分配'})。`, isError: true }
|
|
255
|
-
}
|
|
256
|
-
return { ok: true, param: view }
|
|
257
|
-
}
|
|
258
|
-
const hits = repo.byKey(trimmed)
|
|
259
|
-
.map(r => repo.viewOf(r))
|
|
260
|
-
.filter((v): v is DcwParamView => v != null)
|
|
261
|
-
const scoped = lineId ? hits.filter(v => v.lineId === lineId) : hits
|
|
262
|
-
if (scoped.length === 1) return { ok: true, param: scoped[0]! }
|
|
263
|
-
if (scoped.length === 0) {
|
|
264
|
-
const catalog = repo.listViews().slice(0, 12).map(v => `${v.key}(${v.name})`).join('、')
|
|
265
|
-
return { ok: false, text: `未找到工艺参数「${trimmed}」${lineId ? `(产线 ${lineId})` : ''}。可用参数:${catalog || '无 —— 请先让用户创建写控节点生成参数面'}。`, isError: true }
|
|
266
|
-
}
|
|
267
|
-
return { ok: false, text: `工艺参数「${trimmed}」命中 ${scoped.length} 条同名映射,请附加 line_id 消歧或改用参数 id(${scoped.map(v => v.id).join(' / ')})。`, isError: true }
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/** 参数面权限摘要(工具回包统一口径;不透出寄存器等 PLC 寻址细节) */
|
|
271
|
-
function paramLimitsText(param: DcwParamView): string {
|
|
272
|
-
const node = getDcwController().byId(param.nodeId)
|
|
273
|
-
if (!node) return '执行节点已删除'
|
|
274
|
-
const bd = limitsBreakdownOf(node)
|
|
275
|
-
const layers = bd.layers.filter(l => l.min != null || l.max != null).map(l => l.label).join(' ∩ ')
|
|
276
|
-
return `有效写入区间 ${bd.effective.min}~${bd.effective.max}${param.unit}(约束层:${layers || '无'})`
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
/** 工具:param_control —— 按工艺参数下发设定值(推荐的参数语义寻址面)。
|
|
280
|
-
* 权限沿用节点绑定(参数 → 执行节点);限界联锁(参数基准 ∩ 产品 ∩ 配方 ∩ 节点安全量程)
|
|
281
|
-
* 在网关咽喉点统一生效。args.hypothesis 声明本次假设(入册),args.task_id 关联任务。 */
|
|
282
|
-
export async function toolParamControl(agentId: string, args: {
|
|
283
|
-
param?: string
|
|
284
|
-
value?: number | string
|
|
285
|
-
hypothesis?: string
|
|
286
|
-
task_id?: string
|
|
287
|
-
line_id?: string
|
|
288
|
-
}): Promise<{ text: string, isError?: boolean }> {
|
|
289
|
-
const resolved = resolveParamRef(String(args.param ?? ''), args.line_id ? String(args.line_id) : undefined)
|
|
290
|
-
if (!resolved.ok) return resolved
|
|
291
|
-
const param = resolved.param
|
|
292
|
-
const value = Number(args.value)
|
|
293
|
-
if (!Number.isFinite(value)) {
|
|
294
|
-
return { text: '设定值 value 必须为数字。', isError: true }
|
|
295
|
-
}
|
|
296
|
-
const repo = getAgentNodeBindingRepo()
|
|
297
|
-
const binding = repo.find(agentId, param.nodeId, 'dcw')
|
|
298
|
-
if (!binding) {
|
|
299
|
-
const mine = repo.byAgent(agentId).filter(b => b.kind === 'dcw')
|
|
300
|
-
return {
|
|
301
|
-
text: mine.length
|
|
302
|
-
? `无权操作工艺参数「${param.key}」(执行节点 ${param.nodeId} 未绑定给你)。你有权控制的数控节点:${mine.map(b => b.nodeId).join(', ')}。`
|
|
303
|
-
: '你尚未绑定任何数控节点,无权下发控制指令。请在数字孪生界面绑定数控节点。',
|
|
304
|
-
isError: true,
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
const node = getDcwController().byId(param.nodeId)
|
|
308
|
-
if (!node) {
|
|
309
|
-
repo.removeAgentNode(agentId, param.nodeId, 'dcw')
|
|
310
|
-
return { text: `工艺参数「${param.key}」的执行节点已不存在(可能被删除),原绑定已自动清理。`, isError: true }
|
|
311
|
-
}
|
|
312
|
-
if (!node.enabled) {
|
|
313
|
-
return { text: `工艺参数「${param.key}」的执行节点「${node.name}」已停用(控制已暂停),无法下发。`, isError: true }
|
|
314
|
-
}
|
|
315
|
-
// 手动确认模式:与 dcw_control 同源审批面,备注回给 Agent
|
|
316
|
-
if (binding.mode === 'manual') {
|
|
317
|
-
const approvals = getToolApprovals()
|
|
318
|
-
if (approvals.hasPendingFor(agentId, param.nodeId)) {
|
|
319
|
-
return { text: '你对该执行节点已有一条待审批的下发指令,请等待用户处理后再发新指令(避免审批堆积)。', isError: true }
|
|
320
|
-
}
|
|
321
|
-
const detail = `工艺参数「${param.key}」(${param.name})设定 ${value}${param.unit},${paramLimitsText(param)}`
|
|
322
|
-
const ap = await approvals.request(agentId, param.nodeId, 'dcw', detail)
|
|
323
|
-
if (!ap.approved) {
|
|
324
|
-
return { text: `指令未执行:用户${ap.comment.includes('超时') ? '未在时限内批准(超时)' : `拒绝了本次下发`}。用户备注:${ap.comment || '(无)'}` }
|
|
325
|
-
}
|
|
326
|
-
if (!repo.find(agentId, param.nodeId, 'dcw')) {
|
|
327
|
-
return { text: '指令未执行:审批通过时你的该节点绑定已被解除(权限在批准时失效)。', isError: true }
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
try {
|
|
331
|
-
const meta = {
|
|
332
|
-
source: 'agent' as const,
|
|
333
|
-
actor: agentId,
|
|
334
|
-
actorName: agentBadgeLabel(agentId),
|
|
335
|
-
taskId: args.task_id ? String(args.task_id) : undefined,
|
|
336
|
-
hypothesis: args.hypothesis ? String(args.hypothesis) : '',
|
|
337
|
-
}
|
|
338
|
-
const outcome = await getDcwController().writeParam(param.id, value, meta)
|
|
339
|
-
if (outcome.ok) {
|
|
340
|
-
const stable = getRecipeRollBackManager().journal({ nodeId: param.nodeId, limit: 10 }).find(a => a.prevValue != null && a.prevValue !== a.newValue)
|
|
341
|
-
const loopTxt = [
|
|
342
|
-
outcome.recordId ? `优化记录 ${outcome.recordId} 已开窗(观察数采后 dcw_judge 落判定)` : null,
|
|
343
|
-
stable ? `上一稳定锚:${stable.prevValue}${param.unit}(可 dcw_rollback 回退)` : null,
|
|
344
|
-
].filter(Boolean).join(';')
|
|
345
|
-
return {
|
|
346
|
-
text: `下发成功:工艺参数「${param.key}」(${param.name})设定 ${value}${param.unit} → 执行节点「${node.name}」;回读 ${outcome.readback != null ? `${outcome.readback}${param.unit}` : '不支持'}一致。${paramLimitsText(param)}。${outcome.message}${loopTxt ? `\n[调控闭环] ${loopTxt}` : ''}`,
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
return { text: `下发失败:${outcome.message}(工艺参数 ${param.key},执行节点「${node.name}」;${paramLimitsText(param)};当前设定值保持 ${node.value ?? '原值'}${param.unit} 未被改动)`, isError: true }
|
|
350
|
-
}
|
|
351
|
-
catch (err) {
|
|
352
|
-
const msg = err instanceof Error ? err.message : String(err)
|
|
353
|
-
return { text: `下发被拒绝:${msg}(工艺参数 ${param.key};${paramLimitsText(param)})`, isError: true }
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
/** 工具:param_read —— 按工艺参数读取 PLC 当前值(被动观测免审批) */
|
|
358
|
-
export async function toolParamRead(agentId: string, args: {
|
|
359
|
-
param?: string
|
|
360
|
-
line_id?: string
|
|
361
|
-
}): Promise<{ text: string, isError?: boolean }> {
|
|
362
|
-
const resolved = resolveParamRef(String(args.param ?? ''), args.line_id ? String(args.line_id) : undefined)
|
|
363
|
-
if (!resolved.ok) return resolved
|
|
364
|
-
const param = resolved.param
|
|
365
|
-
const repo = getAgentNodeBindingRepo()
|
|
366
|
-
if (!repo.find(agentId, param.nodeId, 'dcw')) {
|
|
367
|
-
const mine = repo.byAgent(agentId).filter(b => b.kind === 'dcw')
|
|
368
|
-
return {
|
|
369
|
-
text: mine.length
|
|
370
|
-
? `无权读取工艺参数「${param.key}」(执行节点 ${param.nodeId} 未绑定给你)。你有权读取的数控节点:${mine.map(b => b.nodeId).join(', ')}。`
|
|
371
|
-
: '你尚未绑定任何数控节点,无权读取控制通道数据。请在数字孪生界面绑定数控节点。',
|
|
372
|
-
isError: true,
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
const node = getDcwController().byId(param.nodeId)
|
|
376
|
-
if (!node) {
|
|
377
|
-
repo.removeAgentNode(agentId, param.nodeId, 'dcw')
|
|
378
|
-
return { text: `工艺参数「${param.key}」的执行节点已不存在(可能被删除),原绑定已自动清理。`, isError: true }
|
|
379
|
-
}
|
|
380
|
-
try {
|
|
381
|
-
const read = await getDcwController().readParam(param.id)
|
|
382
|
-
if (!read.ok && read.value == null && !node.readValue) {
|
|
383
|
-
return { text: `读取失败:${read.message}(执行节点「${node.name}」驱动 ${node.driver} 可能不支持读取;可改用 daq_query 查关联数采通道)`, isError: true }
|
|
384
|
-
}
|
|
385
|
-
const readTxt = read.value != null
|
|
386
|
-
? `${Number(read.value.toFixed(param.decimals))}${param.unit} @ ${read.at.slice(11, 19)}`
|
|
387
|
-
: (node.readValue != null ? `${node.readValue}${param.unit}(最近一次)` : '无读数')
|
|
388
|
-
return {
|
|
389
|
-
text: `读取成功:工艺参数「${param.key}」(${param.name})\n PLC 读数(ACT): ${readTxt}\n 当前设定(SET): ${node.value != null ? `${node.value}${param.unit}` : '从未下发'}\n ${paramLimitsText(param)}`,
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
catch (err) {
|
|
393
|
-
return { text: `读取被拒绝:${err instanceof Error ? err.message : String(err)}(工艺参数 ${param.key})`, isError: true }
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
/**
|
|
398
|
-
* 数采目标集解析(工具共用鉴权面):Agent 绑定(kind=daq)为权限边界 ——
|
|
399
|
-
* node_id/line_id 只能缩小范围,不能放大(越权节点一律拒绝)。
|
|
400
|
-
*/
|
|
401
|
-
function daqTargetsOf(agentId: string, nodeIdArg: unknown, lineIdArg: unknown):
|
|
402
|
-
{ targets: string[], daqBindings: ReturnType<ReturnType<typeof getAgentNodeBindingRepo>['byAgent']> }
|
|
403
|
-
| { error: { text: string, isError: true } } {
|
|
404
|
-
const repo = getAgentNodeBindingRepo()
|
|
405
|
-
const daqBindings = repo.byAgent(agentId).filter(b => b.kind === 'daq')
|
|
406
|
-
if (daqBindings.length === 0) {
|
|
407
|
-
return { error: { text: '你尚未绑定任何数采节点,无权查询采集数据。请在数字孪生界面绑定数采节点。', isError: true } }
|
|
408
|
-
}
|
|
409
|
-
const wanted = nodeIdArg ? String(nodeIdArg) : ''
|
|
410
|
-
if (wanted && !daqBindings.some(b => b.nodeId === wanted)) {
|
|
411
|
-
return { error: { text: `无权查询节点 ${wanted}。你有权访问的数采节点:${daqBindings.map(b => b.nodeId).join(', ')}`, isError: true } }
|
|
412
|
-
}
|
|
413
|
-
const lineFilter = lineIdArg ? String(lineIdArg).trim() : ''
|
|
414
|
-
const lineOf = (id: string): string => getDaqNodeRepo().byId(id)?.lineId ?? ''
|
|
415
|
-
if (lineFilter && wanted && lineOf(wanted) !== lineFilter) {
|
|
416
|
-
return { error: { text: `节点 ${wanted} 不属于产线 ${lineFilter}(实际归属:${lineOf(wanted) || '未分配'}),line_id 与 node_id 过滤冲突。`, isError: true } }
|
|
417
|
-
}
|
|
418
|
-
let targets = wanted ? [wanted] : daqBindings.map(b => b.nodeId)
|
|
419
|
-
if (lineFilter && !wanted) {
|
|
420
|
-
const onLine = targets.filter(id => lineOf(id) === lineFilter)
|
|
421
|
-
if (onLine.length === 0) {
|
|
422
|
-
return { error: { text: `你绑定的数采节点中没有归属产线 ${lineFilter} 的(各节点归属:${daqBindings.map(b => `${b.nodeId}=${lineOf(b.nodeId) || '未分配'}`).join('; ')})。`, isError: true } }
|
|
423
|
-
}
|
|
424
|
-
targets = onLine
|
|
425
|
-
}
|
|
426
|
-
return { targets, daqBindings }
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
/** 工具:daq_query —— 数采数据检索(产线/产品/配方/时间/节点;结果带物理语义) */
|
|
430
|
-
export async function toolDaqQuery(agentId: string, args: {
|
|
431
|
-
node_id?: string
|
|
432
|
-
line_id?: string
|
|
433
|
-
product_id?: string
|
|
434
|
-
recipe_id?: string
|
|
435
|
-
last_minutes?: number | string
|
|
436
|
-
from_ms?: number | string
|
|
437
|
-
to_ms?: number | string
|
|
438
|
-
bucket_ms?: number | string
|
|
439
|
-
limit?: number | string
|
|
440
|
-
}): Promise<{ text: string, isError?: boolean }> {
|
|
441
|
-
const auth = daqTargetsOf(agentId, args.node_id, args.line_id)
|
|
442
|
-
if ('error' in auth) return auth.error
|
|
443
|
-
const { targets } = auth
|
|
444
|
-
const lineFilter = args.line_id ? String(args.line_id).trim() : ''
|
|
445
|
-
|
|
446
|
-
const toMs = Number(args.to_ms) || Date.now()
|
|
447
|
-
const fromMs = Number(args.from_ms) || toMs - (Number(args.last_minutes) || 30) * 60_000
|
|
448
|
-
// 时间间隔参数(bucket_ms 降采样桶宽):缺省与下限来自 daq.query.*(live 配置,热重载)
|
|
449
|
-
const qCfg = daqRuntimeSettings().query
|
|
450
|
-
const rawBucket = Number(args.bucket_ms)
|
|
451
|
-
const bucketMs = Number.isFinite(rawBucket) && rawBucket > 0
|
|
452
|
-
? Math.max(qCfg.minBucketMs, Math.min(3_600_000, Math.round(rawBucket)))
|
|
453
|
-
: qCfg.defaultBucketMs
|
|
454
|
-
const limit = Math.min(Number(args.limit) || 500, 2000)
|
|
455
|
-
const { getTsdb, tsdbReady } = await import('../daq/storage')
|
|
456
|
-
await tsdbReady
|
|
457
|
-
const tsdb = getTsdb()
|
|
458
|
-
|
|
459
|
-
const sections: string[] = []
|
|
460
|
-
for (const nodeId of targets) {
|
|
461
|
-
const node = getDaqNodeRepo().byId(nodeId)
|
|
462
|
-
if (!node) continue
|
|
463
|
-
const tpl = findDaqTemplate(node.templateKey)
|
|
464
|
-
const ch = tpl?.ch ?? node.templateKey
|
|
465
|
-
try {
|
|
466
|
-
let points: Array<{ at: number, value?: number, avg?: number, min?: number, max?: number, cnt?: number }>
|
|
467
|
-
if (args.product_id || args.recipe_id) {
|
|
468
|
-
const series = await tsdb.queryTagged({
|
|
469
|
-
lineId: node.lineId || undefined,
|
|
470
|
-
productId: args.product_id ? String(args.product_id) : undefined,
|
|
471
|
-
recipeId: args.recipe_id ? String(args.recipe_id) : undefined,
|
|
472
|
-
nodeIds: [nodeId],
|
|
473
|
-
fromMs,
|
|
474
|
-
toMs,
|
|
475
|
-
bucketMs,
|
|
476
|
-
limit,
|
|
477
|
-
})
|
|
478
|
-
points = series.get(nodeId) ?? []
|
|
479
|
-
}
|
|
480
|
-
else {
|
|
481
|
-
points = await tsdb.query(nodeId, { fromMs, toMs, bucketMs, limit })
|
|
482
|
-
}
|
|
483
|
-
const head = `■ ${node.name}(${ch})单位 ${node.unit},正常量程 ${node.min}~${node.max}${node.unit},当前状态 ${node.state},时间窗 ${new Date(fromMs).toISOString().slice(0, 16)} ~ ${new Date(toMs).toISOString().slice(0, 16)}${bucketMs ? `(降采样 ${bucketMs}ms)` : ''}`
|
|
484
|
-
// 工况判读容器(具体判读在 values 计算后追加)
|
|
485
|
-
const readout: string[] = []
|
|
486
|
-
if (points.length === 0) {
|
|
487
|
-
sections.push(`${head}\n 窗口内无数据(产线未运行或过滤条件不匹配;仅产线运行中的样本被持久化打标)`)
|
|
488
|
-
continue
|
|
489
|
-
}
|
|
490
|
-
const values = points.map(p => p.value ?? p.avg ?? 0).filter(Number.isFinite)
|
|
491
|
-
const latest = values[values.length - 1]!
|
|
492
|
-
// 工况判读:最新值相对活动配方监控窗口/同线数控设定的位置(数据 → 语义)
|
|
493
|
-
const latestRaw = latest
|
|
494
|
-
const rw = node.lineId ? getActiveLineRun(node.lineId) : null
|
|
495
|
-
const recipeR = rw ? getDcwController().listRecipes().find(r => r.id === rw.recipeId) : undefined
|
|
496
|
-
const rwin = recipeR?.daqWindows?.find(w2 => w2.nodeId === nodeId)
|
|
497
|
-
if (rw && rwin) {
|
|
498
|
-
const inWin = (rwin.min == null || latestRaw >= rwin.min) && (rwin.max == null || latestRaw <= rwin.max)
|
|
499
|
-
readout.push(`活动配方「${rw.recipeName}」监控窗口 [${rwin.min ?? '-∞'}, ${rwin.max ?? '+∞'}]:当前 ${latestRaw}${node.unit} ${inWin ? '窗口内(正常)' : '**越限(该节点应已报警)**'}`)
|
|
500
|
-
}
|
|
501
|
-
{
|
|
502
|
-
const dcwAll = getDcwController().listViews().filter(d => d.lineId === node.lineId && d.value != null)
|
|
503
|
-
if (dcwAll.length > 0) {
|
|
504
|
-
readout.push(`同产线数控设定: ${dcwAll.map(d => `${d.name}=${d.value}${d.unit}`).join(';')}(判读时考虑设定↔实际量的耦合与滞后)`)
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
const avg = values.reduce((a, b) => a + b, 0) / values.length
|
|
508
|
-
const tail = points.slice(-12).map(p => `${new Date(p.at).toISOString().slice(11, 19)}=${p.value != null ? p.value : `avg ${Number((p.avg ?? 0).toFixed(2))}`}`)
|
|
509
|
-
sections.push(
|
|
510
|
-
`${head}\n 样本 ${values.length} 点 | 最新 ${latest}${node.unit} | 均值 ${Number(avg.toFixed(3))} | 最小 ${Math.min(...values)} | 最大 ${Math.max(...values)}\n 最近序列: ${tail.join('; ')}${readout.length > 0 ? `\n 工况判读: ${readout.join(' | ')}` : ''}`,
|
|
511
|
-
)
|
|
512
|
-
}
|
|
513
|
-
catch (err) {
|
|
514
|
-
sections.push(`■ ${node.name}:查询失败 ${err instanceof Error ? err.message : String(err)}`)
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
const prov = (args.product_id || args.recipe_id || lineFilter)
|
|
518
|
-
? `\n(过滤条件:${lineFilter ? ` 产线 ${lineFilter}` : ''}${args.product_id ? ` 产品 ${args.product_id}` : ''}${args.recipe_id ? ` 配方 ${args.recipe_id}` : ''}${(args.product_id || args.recipe_id) ? ' —— 产品/配方过滤基于活动批次窗口内逐样本打标' : ''})`
|
|
519
|
-
: ''
|
|
520
|
-
return { text: `数采数据查询结果(${targets.length} 个节点):\n\n${sections.join('\n\n')}${prov}\n\n数值均为经标定钩子处理后的真实物理量纲;调整工艺前请结合 my_industrial_nodes 的节点判读方法与操作守则。` }
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
/**
|
|
524
|
-
* 写向工具的统一鉴权闸门(绑定必查)。
|
|
525
|
-
*
|
|
526
|
-
* 背景:dcw_control / dcw_read 各自抄了一份 `repo.find(agentId, nodeId, 'dcw')` 判定,
|
|
527
|
-
* 而 dcw_rollback / dcw_judge 的「接管孤儿记录」分支忘了这一步 —— 任何 agent(哪怕
|
|
528
|
-
* 零绑定)都能借 record_id 或超时接管,驱动真实 PLC 执行回退。这是权限模型里的
|
|
529
|
-
* **默认放行**,与 node-bindings.repo 自述的「未绑定节点一律拒绝」直接冲突。
|
|
530
|
-
* 收敛为单一入口后,新增写向工具不会再漏。
|
|
531
|
-
*
|
|
532
|
-
* @returns 命中返回绑定对象;未命中返回可直接回给模型的拒绝文本(isError)
|
|
533
|
-
*/
|
|
534
|
-
function requireDcwBinding(agentId: string, nodeId: string, action: string): { binding: AgentNodeBinding } | { error: { text: string, isError: true } } {
|
|
535
|
-
const repo = getAgentNodeBindingRepo()
|
|
536
|
-
const binding = nodeId ? repo.find(agentId, nodeId, 'dcw') : undefined
|
|
537
|
-
if (binding) return { binding }
|
|
538
|
-
const mine = repo.byAgent(agentId).filter(b => b.kind === 'dcw')
|
|
539
|
-
return {
|
|
540
|
-
error: {
|
|
541
|
-
text: mine.length
|
|
542
|
-
? `无权${action}节点 ${nodeId || '(空)'}。你有权控制的数控节点:${mine.map(b => b.nodeId).join(', ')}(可用 my_industrial_nodes 查看物理含义)。`
|
|
543
|
-
: `你尚未绑定任何数控节点,无权${action}。请在数字孪生界面绑定数控节点。`,
|
|
544
|
-
isError: true,
|
|
545
|
-
},
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
/** 工具:dcw_judge —— 对自己的优化记录落判定(keep/rollback/uncertain)。
|
|
550
|
-
* 判定与执行分离:rollback 判定只入册,执行必须再调 dcw_rollback。
|
|
551
|
-
* 鉴权:记录所属节点必须仍在你的 dcw 绑定内 —— 接管孤儿记录同样受此约束。 */
|
|
552
|
-
export async function toolDcwJudge(agentId: string, args: { record_id?: string, verdict?: string, reason?: string }): Promise<{ text: string, isError?: boolean }> {
|
|
553
|
-
const recordId = String(args.record_id ?? '').trim()
|
|
554
|
-
const verdict = String(args.verdict ?? '').trim() as 'keep' | 'rollback' | 'uncertain'
|
|
555
|
-
const reason = String(args.reason ?? '').trim()
|
|
556
|
-
if (!recordId)
|
|
557
|
-
return { text: 'record_id 必填(优化记录 id,dcw_control 下发成功后会返回)。', isError: true }
|
|
558
|
-
if (!['keep', 'rollback', 'uncertain'].includes(verdict))
|
|
559
|
-
return { text: 'verdict 必须为 keep / rollback / uncertain。', isError: true }
|
|
560
|
-
if (!reason)
|
|
561
|
-
return { text: 'reason 必填:判定必须引用数采证据(建议先 daq_query 取窗口数据再判定)。', isError: true }
|
|
562
|
-
const rb = getRecipeRollBackManager()
|
|
563
|
-
const record = rb.recordById(recordId)
|
|
564
|
-
if (!record)
|
|
565
|
-
return { text: `优化记录 ${recordId} 不存在。`, isError: true }
|
|
566
|
-
const takeover = record.agentId !== agentId && rb.isStale(record)
|
|
567
|
-
if (record.agentId !== agentId && !takeover)
|
|
568
|
-
return { text: `记录 ${recordId} 不是你发起的优化(发起者:${record.agentId ?? '用户'}),Agent 仅可判定自己的记录;他人记录请请用户在界面判定。`, isError: true }
|
|
569
|
-
// 接管是「时间」判定,不是「权限」判定 —— 权限必须单独查绑定(早先漏了这一步)
|
|
570
|
-
const auth = requireDcwBinding(agentId, record.nodeId, '判定该记录')
|
|
571
|
-
if ('error' in auth) return auth.error
|
|
572
|
-
try {
|
|
573
|
-
const finalReason = takeover ? `[接管孤儿记录,原属主 ${record.agentId ?? '?'} 超时未判定] ${reason}` : reason
|
|
574
|
-
const updated = rb.judge(recordId, verdict, finalReason, 'agent', agentId, { takeover, actorName: agentBadgeLabel(agentId) })
|
|
575
|
-
const next = verdict === 'rollback'
|
|
576
|
-
? '判定已入册;请立即用 dcw_rollback(record_id) 执行回退(判定不自动改 PLC)。'
|
|
577
|
-
: verdict === 'keep'
|
|
578
|
-
? `已定档为已验证经验${updated.recipeId ? '(配方已标记 lastGood)' : ''}。`
|
|
579
|
-
: '记录保持 open,继续观察或等下次设定关闭。'
|
|
580
|
-
return { text: `判定已入册:记录 ${recordId} → ${verdict}(${reason})。${next}` }
|
|
581
|
-
}
|
|
582
|
-
catch (err) {
|
|
583
|
-
return { text: `判定失败:${err instanceof Error ? err.message : String(err)}`, isError: true }
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
/** 工具:dcw_rollback —— 执行回退(自己的记录直接执行;他人记录需用户在界面执行)。
|
|
588
|
-
* 鉴权:节点必须绑定给该 agent(record_id 路径先解析出 record.nodeId);
|
|
589
|
-
* manual 模式绑定与 dcw_control 同源 —— 回退也会改 PLC,必须推请用户确认。
|
|
590
|
-
* args: record_id(回退该记录到其 from 值)或 node_id(单步撤销到最近稳定锚);to = 指定目标锚。 */
|
|
591
|
-
export async function toolDcwRollback(agentId: string, args: { record_id?: string, node_id?: string, to?: string }): Promise<{ text: string, isError?: boolean }> {
|
|
592
|
-
const rb = getRecipeRollBackManager()
|
|
593
|
-
const recordId = String(args.record_id ?? '').trim()
|
|
594
|
-
const nodeId = String(args.node_id ?? '').trim()
|
|
595
|
-
const to = String(args.to ?? '').trim() || undefined
|
|
596
|
-
if (!recordId && !nodeId)
|
|
597
|
-
return { text: 'record_id 或 node_id 至少提供一个。', isError: true }
|
|
598
|
-
try {
|
|
599
|
-
// 归属解析:record_id 路径的节点来自记录本身,node_id 路径直接用入参
|
|
600
|
-
const record = recordId ? rb.recordById(recordId) : undefined
|
|
601
|
-
if (recordId && !record)
|
|
602
|
-
return { text: `优化记录 ${recordId} 不存在。`, isError: true }
|
|
603
|
-
const targetNodeId = record?.nodeId ?? nodeId
|
|
604
|
-
if (record) {
|
|
605
|
-
const takeover = record.agentId !== agentId && rb.isStale(record)
|
|
606
|
-
if (record.agentId !== agentId && !takeover)
|
|
607
|
-
return { text: `记录 ${recordId} 不是你发起的优化(发起者:${record.agentId ?? '用户'}),回退他人记录请请用户在数采中心/产线详情执行;若原属主已消失(超时未判定),可先 dcw_judge 接管后再回退。`, isError: true }
|
|
608
|
-
}
|
|
609
|
-
// 授权闸门(早先整段缺失 → 任意 agent 可回退任意节点)
|
|
610
|
-
const auth = requireDcwBinding(agentId, targetNodeId, '回退')
|
|
611
|
-
if ('error' in auth) return auth.error
|
|
612
|
-
// manual 模式:回退是真实 PLC 写入,与 dcw_control 同源推请用户批准
|
|
613
|
-
if (auth.binding.mode === 'manual') {
|
|
614
|
-
const node = getDcwController().byId(targetNodeId)
|
|
615
|
-
const approvals = getToolApprovals()
|
|
616
|
-
if (approvals.hasPendingFor(agentId, targetNodeId))
|
|
617
|
-
return { text: '你对该节点已有一条待审批指令,请等待用户处理后再发新的回退请求(避免审批堆积)。', isError: true }
|
|
618
|
-
const detail = `${node?.name ?? targetNodeId} 回退到${record ? `记录 ${recordId} 的 from 值` : '最近稳定锚'}${to ? `(${to})` : ''}`
|
|
619
|
-
const ap = await approvals.request(agentId, targetNodeId, 'dcw', detail)
|
|
620
|
-
if (!ap.approved) {
|
|
621
|
-
return { text: `回退未执行:用户${ap.comment.includes('超时') ? '未在时限内批准(超时)' : '拒绝了本次回退'}。用户备注:${ap.comment || '(无)'}` }
|
|
622
|
-
}
|
|
623
|
-
// 审批期间绑定可能已被解除:批准时二次校验(与 dcw_control 同口径)
|
|
624
|
-
if (!getAgentNodeBindingRepo().find(agentId, targetNodeId, 'dcw'))
|
|
625
|
-
return { text: '回退未执行:审批通过时你的该节点绑定已被解除(权限在批准时失效)。', isError: true }
|
|
626
|
-
}
|
|
627
|
-
if (record) {
|
|
628
|
-
const fresh = await rb.rollbackRecord(recordId, agentId, 'agent', undefined, { actorName: agentBadgeLabel(agentId) })
|
|
629
|
-
return { text: `回退已执行:记录 ${recordId} 标记 rolled-back;下发恢复值 ${fresh?.params[0]?.to}${'(以回读为准)'};新回退记录 ${fresh?.id} 已入册。请 daq_query 复测确认恢复。` }
|
|
630
|
-
}
|
|
631
|
-
const fresh = await rb.rollbackNode(targetNodeId, agentId, 'agent', to, { actorName: agentBadgeLabel(agentId) })
|
|
632
|
-
return { text: `节点单步回退已执行:恢复到最近稳定锚值;新回退记录 ${fresh?.id} 已入册。请 daq_query 复测确认恢复。` }
|
|
633
|
-
}
|
|
634
|
-
catch (err) {
|
|
635
|
-
const msg = err instanceof Error ? err.message : String(err)
|
|
636
|
-
return { text: `回退被拒绝:${msg}(回退经与下发相同的安全门控;冷却期内禁止重复回退)`, isError: true }
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
/** 工具:dcw_journal —— 参数变更史/优化记录查询(在册审计;谁/何时/从多少到多少/判定) */
|
|
641
|
-
export async function toolDcwJournal(agentId: string, args: { node_id?: string, recipe_id?: string, limit?: number | string }): Promise<{ text: string, isError?: boolean }> {
|
|
642
|
-
const rb = getRecipeRollBackManager()
|
|
643
|
-
const nodeId = String(args.node_id ?? '').trim()
|
|
644
|
-
const recipeId = String(args.recipe_id ?? '').trim()
|
|
645
|
-
const limit = Math.min(Number(args.limit) || 20, 100)
|
|
646
|
-
const repo = getAgentNodeBindingRepo()
|
|
647
|
-
const bound = new Set(repo.byAgent(agentId).map(b => b.nodeId))
|
|
648
|
-
if (nodeId && !bound.has(nodeId))
|
|
649
|
-
return { text: `无权查询节点 ${nodeId} 的账本(仅可查自己绑定的节点)。`, isError: true }
|
|
650
|
-
const records = rb.records({ nodeId: nodeId || undefined, recipeId: recipeId || undefined, limit })
|
|
651
|
-
if (records.length === 0)
|
|
652
|
-
return { text: '窗口内无优化记录(该节点/配方尚无 Agent 调控历史)。' }
|
|
653
|
-
const lines = records.map((r) => {
|
|
654
|
-
const p = r.params[0]
|
|
655
|
-
const judge = r.judge ? `${r.judge.verdict}(${r.judge.by}:${r.judge.reason.slice(0, 50)})` : '未判定'
|
|
656
|
-
const closed = r.closedAt ? `,关闭于 ${r.closedAt.slice(11, 19)}(${r.closedBy})` : ',进行中'
|
|
657
|
-
return `- ${r.id} [${r.status}] ${r.nodeName}: ${p?.from ?? '?'} → ${p?.to},设定 ${r.setAt.slice(11, 19)},判定 ${judge}${closed}${r.hypothesis ? `\n 假设: ${r.hypothesis.slice(0, 80)}` : ''}`
|
|
658
|
-
})
|
|
659
|
-
const anchors = nodeId ? rb.journal({ nodeId, limit }) : []
|
|
660
|
-
const anchorLines = anchors.slice(0, 10).map(a => `- ${a.at.slice(11, 19)} [${a.source}/${a.actor}] ${a.prevValue ?? '?'} → ${a.newValue}`)
|
|
661
|
-
return {
|
|
662
|
-
text: `优化记录(${records.length} 条,含参数/判定/窗口):\n${lines.join('\n')}${nodeId ? `\n\n参数变更锚(最近 ${anchorLines.length} 条):\n${anchorLines.join('\n')}` : ''}\n\n判定与执行分离:rollback 判定后需 dcw_rollback 执行;回退同样入册可审计。`,
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
/** 工具:daq_frames —— 多形态帧检索(v2:测厚/扫描仪多点轮廓与 CCD 图像元数据)。
|
|
667
|
-
* 向量返回点列摘要(≤16 点预览 + 派生指标);图像返回对象引用与内容 URL(像素不入 LLM)。 */
|
|
668
|
-
export async function toolDaqFrames(agentId: string, args: {
|
|
669
|
-
node_id?: string
|
|
670
|
-
line_id?: string
|
|
671
|
-
kind?: string
|
|
672
|
-
last_minutes?: number | string
|
|
673
|
-
from_ms?: number | string
|
|
674
|
-
to_ms?: number | string
|
|
675
|
-
limit?: number | string
|
|
676
|
-
}): Promise<{ text: string, isError?: boolean }> {
|
|
677
|
-
const auth = daqTargetsOf(agentId, args.node_id, args.line_id)
|
|
678
|
-
if ('error' in auth) return auth.error
|
|
679
|
-
const { targets } = auth
|
|
680
|
-
const kind = args.kind === 'vector' || args.kind === 'image' ? args.kind : undefined
|
|
681
|
-
const toMs = Number(args.to_ms) || Date.now()
|
|
682
|
-
const fromMs = Number(args.from_ms) || toMs - (Number(args.last_minutes) || 30) * 60_000
|
|
683
|
-
const limit = Math.min(Number(args.limit) || 20, 100)
|
|
684
|
-
const { getTsdb, tsdbReady } = await import('../daq/storage')
|
|
685
|
-
await tsdbReady
|
|
686
|
-
const tsdb = getTsdb()
|
|
687
|
-
|
|
688
|
-
const sections: string[] = []
|
|
689
|
-
for (const nodeId of targets) {
|
|
690
|
-
const node = getDaqNodeRepo().byId(nodeId)
|
|
691
|
-
if (!node) continue
|
|
692
|
-
const tpl = findDaqTemplate(node.templateKey)
|
|
693
|
-
const signalKind = tpl?.signalKind ?? 'scalar'
|
|
694
|
-
if (signalKind === 'scalar') {
|
|
695
|
-
sections.push(`■ ${node.name}:单点标量节点(模板 ${node.templateKey}),无帧数据 —— 请用 daq_query 查时序数值。`)
|
|
696
|
-
continue
|
|
697
|
-
}
|
|
698
|
-
try {
|
|
699
|
-
const frames = await tsdb.queryFrames(nodeId, { fromMs, toMs, kind, limit })
|
|
700
|
-
if (frames.length === 0) {
|
|
701
|
-
sections.push(`■ ${node.name}(${tpl?.ch ?? node.templateKey}):窗口内无帧(产线未运行或过滤条件不匹配;仅产线运行中的帧被持久化)`)
|
|
702
|
-
continue
|
|
703
|
-
}
|
|
704
|
-
const head = `■ ${node.name}(${tpl?.ch ?? node.templateKey})形态 ${signalKind},帧数 ${frames.length},时间窗 ${new Date(fromMs).toISOString().slice(0, 16)} ~ ${new Date(toMs).toISOString().slice(0, 16)}`
|
|
705
|
-
const lines = frames.slice(0, 10).map((f) => {
|
|
706
|
-
const at = new Date(f.at).toISOString().slice(11, 19)
|
|
707
|
-
if (f.kind === 'vector') {
|
|
708
|
-
const pts = f.points ?? []
|
|
709
|
-
const preview = pts.slice(0, 16).map(p => Number(p.toFixed(3))).join(',')
|
|
710
|
-
return ` ${at} 轮廓 ${pts.length} 点[${preview}${pts.length > 16 ? ',…' : ''}] 指标 {${Object.entries(f.metrics).slice(0, 6).map(([k, v]) => `${k}=${v}`).join(', ')}}`
|
|
711
|
-
}
|
|
712
|
-
const width = f.meta.width ?? '?'
|
|
713
|
-
const height = f.meta.height ?? '?'
|
|
714
|
-
return ` ${at} 图像 ${width}x${height} ${f.meta.mime ?? 'image/png'} 对象=${String(f.meta.objectKey ?? '-').slice(-24)} 指标 {${Object.entries(f.metrics).slice(0, 4).map(([k, v]) => `${k}=${v}`).join(', ')}}(像素不入上下文;前端画廊可看)`
|
|
715
|
-
})
|
|
716
|
-
sections.push(`${head}\n${lines.join('\n')}${frames.length > 10 ? `\n (仅展示最近 10 帧)` : ''}`)
|
|
717
|
-
}
|
|
718
|
-
catch (err) {
|
|
719
|
-
sections.push(`■ ${node.name}:帧查询失败 ${err instanceof Error ? err.message : String(err)}`)
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
return { text: `数采帧查询结果(${targets.length} 个节点):\n\n${sections.join('\n\n')}\n\n向量=多点工程量轮廓(完整点列前端可查);图像=像素在对象存储,指标供判读(brightness 过低=曝光不足/遮挡)。` }
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
// ================================================================
|
|
726
|
-
// 运维日志 / Recipe 变更史查询(Agent 自查面:负责产线 scoped)
|
|
727
|
-
// ================================================================
|
|
728
|
-
|
|
729
|
-
/** Agent 负责范围 = 绑定节点的全集(节点 id 集 + 这些节点所属产线集);无绑定 = 无范围 */
|
|
730
|
-
function agentOpsScope(agentId: string): { lineIds: string[], nodeIds: Set<string> } | null {
|
|
731
|
-
const bindings = getAgentNodeBindingRepo().byAgent(agentId)
|
|
732
|
-
if (bindings.length === 0) return null
|
|
733
|
-
const lineIds = new Set<string>()
|
|
734
|
-
const nodeIds = new Set<string>()
|
|
735
|
-
for (const b of bindings) {
|
|
736
|
-
nodeIds.add(b.nodeId)
|
|
737
|
-
try {
|
|
738
|
-
const n = b.kind === 'dcw' ? getDcwController().byId(b.nodeId) : getDaqNodeRepo().byId(b.nodeId)
|
|
739
|
-
if (n?.lineId) lineIds.add(n.lineId)
|
|
740
|
-
}
|
|
741
|
-
catch { /* 节点刚被删等情况忽略 */ }
|
|
742
|
-
}
|
|
743
|
-
return { lineIds: [...lineIds], nodeIds }
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
/** 配方参数的节点失效态(数据一致性展示/Agent 提示共用):null=正常 */
|
|
747
|
-
function nodeRefStatus(nodeId: string, lineId: string): { code: 'deleted' | 'disabled' | 'unbound', label: string } | null {
|
|
748
|
-
const node = getDcwController().byId(nodeId)
|
|
749
|
-
if (!node) return { code: 'deleted', label: '已删除' }
|
|
750
|
-
if (!node.enabled) return { code: 'disabled', label: '已停用' }
|
|
751
|
-
if (node.lineId !== lineId) return { code: 'unbound', label: '已取消绑定' }
|
|
752
|
-
return null
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
const OPS_ACTOR_LABEL: Record<string, string> = { agent: 'Agent', user: '用户', system: '系统' }
|
|
756
|
-
|
|
757
|
-
function fmtAuditAt(iso: string): string {
|
|
758
|
-
return iso.length >= 19 ? iso.slice(5, 19).replace('T', ' ') : iso
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
/** 工具:ops_log —— 负责产线的运维/审计日志查询(全部下发/判定/回退/配方/产线事件)。
|
|
762
|
-
* 权限:仅自己绑定节点所覆盖的产线;node_id 须为绑定节点。来源(actor_kind)区分 Agent/用户/系统。 */
|
|
763
|
-
export async function toolOpsLog(agentId: string, args: {
|
|
764
|
-
line_id?: string
|
|
765
|
-
node_id?: string
|
|
766
|
-
kind?: string
|
|
767
|
-
actor_kind?: string
|
|
768
|
-
minutes?: number | string
|
|
769
|
-
limit?: number | string
|
|
770
|
-
mine?: boolean | string
|
|
771
|
-
}): Promise<{ text: string, isError?: boolean }> {
|
|
772
|
-
const audit = getOps()?.audit
|
|
773
|
-
if (!audit) return { text: '审计仓储未装配(服务未就绪),请稍后重试。', isError: true }
|
|
774
|
-
const scope = agentOpsScope(agentId)
|
|
775
|
-
if (!scope) return { text: '你尚未绑定任何工业节点,无日志可查(日志权限跟随节点绑定)。', isError: true }
|
|
776
|
-
const nodeId = String(args.node_id ?? '').trim()
|
|
777
|
-
const lineId = String(args.line_id ?? '').trim()
|
|
778
|
-
if (nodeId && !scope.nodeIds.has(nodeId))
|
|
779
|
-
return { text: `无权查询节点 ${nodeId} 的日志(仅可查自己绑定的节点;用 my_industrial_nodes 查看绑定)。`, isError: true }
|
|
780
|
-
if (lineId && !scope.lineIds.includes(lineId))
|
|
781
|
-
return { text: `无权查询产线 ${lineId} 的日志(你的负责产线:${scope.lineIds.join(', ') || '(绑定节点均未分配产线)'})。`, isError: true }
|
|
782
|
-
const kind = String(args.kind ?? '').trim() || undefined
|
|
783
|
-
const actorKind = String(args.actor_kind ?? '').trim() || undefined
|
|
784
|
-
const mine = args.mine === true || args.mine === 'true'
|
|
785
|
-
const minutes = Number(args.minutes) || 1440
|
|
786
|
-
const limit = Math.min(Number(args.limit) || 20, 100)
|
|
787
|
-
const from = new Date(Date.now() - minutes * 60_000).toISOString()
|
|
788
|
-
|
|
789
|
-
const lines = lineId ? [lineId] : scope.lineIds
|
|
790
|
-
const byId = new Map<string, Record<string, unknown>>()
|
|
791
|
-
for (const lid of lines) {
|
|
792
|
-
for (const r of audit.query({ lineId: lid, kind, actorKind, actor: mine ? agentId : undefined, from, limit }))
|
|
793
|
-
byId.set(String(r.id), r)
|
|
794
|
-
}
|
|
795
|
-
let rows = [...byId.values()]
|
|
796
|
-
if (nodeId) rows = rows.filter(r => r.targetId === nodeId)
|
|
797
|
-
rows.sort((a, b) => String(b.at).localeCompare(String(a.at)))
|
|
798
|
-
rows = rows.slice(0, limit)
|
|
799
|
-
if (rows.length === 0) return { text: `窗口(近 ${minutes} 分钟)内无匹配日志。可调大 minutes,或放宽 kind/actor_kind/node_id 过滤。` }
|
|
800
|
-
|
|
801
|
-
const body = rows.map((r) => {
|
|
802
|
-
const src = OPS_ACTOR_LABEL[String(r.actorKind)] ?? String(r.actorKind)
|
|
803
|
-
return `- [${fmtAuditAt(String(r.at))}] 来源=${src} 操作者=${String(r.actorName) || String(r.actor)} | ${String(r.action)} | ${String(r.summary)}`
|
|
804
|
-
})
|
|
805
|
-
const scopeNote = lineId ? `产线 ${lineId}` : `负责产线 ${scope.lineIds.length} 条`
|
|
806
|
-
return {
|
|
807
|
-
text: `运维日志(${scopeNote},近 ${minutes} 分钟,${rows.length} 条,新→旧):\n${body.join('\n')}\n\n说明:来源=Agent 的操作者格式为「Channel名/成员名」;需要节点级参数值变更史用 dcw_journal,配方下发/回退专门视图用 recipe_log。`,
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
/** 工具:recipe_log —— 负责产线的配方下发与回退历史(recipe.apply + 优化开窗/判定/回退)。
|
|
812
|
-
* Agent 据此知道 Recipe 层面发生过哪些下发变更、谁做的、是否已回退。 */
|
|
813
|
-
export async function toolRecipeLog(agentId: string, args: {
|
|
814
|
-
line_id?: string
|
|
815
|
-
recipe_id?: string
|
|
816
|
-
minutes?: number | string
|
|
817
|
-
limit?: number | string
|
|
818
|
-
}): Promise<{ text: string, isError?: boolean }> {
|
|
819
|
-
const audit = getOps()?.audit
|
|
820
|
-
if (!audit) return { text: '审计仓储未装配(服务未就绪),请稍后重试。', isError: true }
|
|
821
|
-
const scope = agentOpsScope(agentId)
|
|
822
|
-
if (!scope) return { text: '你尚未绑定任何工业节点,无 Recipe 历史可查(权限跟随节点绑定)。', isError: true }
|
|
823
|
-
const lineId = String(args.line_id ?? '').trim()
|
|
824
|
-
if (lineId && !scope.lineIds.includes(lineId))
|
|
825
|
-
return { text: `无权查询产线 ${lineId} 的 Recipe 历史(你的负责产线:${scope.lineIds.join(', ') || '(无)'})。`, isError: true }
|
|
826
|
-
const recipeId = String(args.recipe_id ?? '').trim() || undefined
|
|
827
|
-
const minutes = Number(args.minutes) || 1440
|
|
828
|
-
const limit = Math.min(Number(args.limit) || 20, 100)
|
|
829
|
-
const from = new Date(Date.now() - minutes * 60_000).toISOString()
|
|
830
|
-
|
|
831
|
-
const lines = lineId ? [lineId] : scope.lineIds
|
|
832
|
-
const byId = new Map<string, Record<string, unknown>>()
|
|
833
|
-
for (const lid of lines) {
|
|
834
|
-
for (const kind of ['recipe', 'rollback']) {
|
|
835
|
-
for (const r of audit.query({ lineId: lid, kind, recipeId, from, limit }))
|
|
836
|
-
byId.set(String(r.id), r)
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
const rows = [...byId.values()].sort((a, b) => String(b.at).localeCompare(String(a.at))).slice(0, limit)
|
|
840
|
-
if (rows.length === 0) return { text: `窗口(近 ${minutes} 分钟)内无配方下发/回退记录。可调大 minutes 或换 line_id。` }
|
|
841
|
-
|
|
842
|
-
const body = rows.map((r) => {
|
|
843
|
-
const src = OPS_ACTOR_LABEL[String(r.actorKind)] ?? String(r.actorKind)
|
|
844
|
-
const action = String(r.action)
|
|
845
|
-
const tag = action === 'recipe.apply'
|
|
846
|
-
? '配方下发'
|
|
847
|
-
: action === 'optimization.open'
|
|
848
|
-
? '优化开窗'
|
|
849
|
-
: action === 'optimization.judge'
|
|
850
|
-
? '优化判定'
|
|
851
|
-
: action === 'optimization.rollback'
|
|
852
|
-
? '回退执行'
|
|
853
|
-
: action
|
|
854
|
-
return `- [${fmtAuditAt(String(r.at))}] ${tag} 来源=${src} 操作者=${String(r.actorName) || String(r.actor)} | ${String(r.summary)}${r.recipeId ? `(配方 ${String(r.recipeId).slice(0, 8)})` : ''}`
|
|
855
|
-
})
|
|
856
|
-
return {
|
|
857
|
-
text: `Recipe 变更史(${lineId ? `产线 ${lineId}` : `负责产线 ${scope.lineIds.length} 条`},近 ${minutes} 分钟,${rows.length} 条,新→旧):\n${body.join('\n')}\n\n说明:配方下发=整批参数写命令;优化开窗=单次设定变更(含 Agent 假设);回退执行=已恢复基线值。节点级参数值逐笔历史用 dcw_journal(node_id)。`,
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
// ================================================================
|
|
862
|
-
// 产线上下文 + Recipe 版本管理(Agent 操控闭环:知道改什么 → 保存 → 可回退)
|
|
863
|
-
// ================================================================
|
|
864
|
-
|
|
865
|
-
/** 工具:line_context —— 我控制的产线/产品/Recipe 全景(归属认知 + 完整参数面)。
|
|
866
|
-
* 逐产线输出:产线名/运行态、活动批次(产品/配方/版本/参数)、我的节点绑定、
|
|
867
|
-
* 配方目标 vs PLC 当前值对照、lastGood 批次。 */
|
|
868
|
-
export async function toolLineContext(agentId: string, args: { line_id?: string } = {}): Promise<{ text: string, isError?: boolean }> {
|
|
869
|
-
const scope = agentOpsScope(agentId)
|
|
870
|
-
if (!scope) return { text: '你尚未绑定任何工业节点,暂无产线上下文(请先在数字孪生界面绑定节点)。' }
|
|
871
|
-
const wanted = String(args.line_id ?? '').trim()
|
|
872
|
-
const lineIds = wanted ? [wanted] : scope.lineIds
|
|
873
|
-
if (wanted && !scope.lineIds.includes(wanted)) {
|
|
874
|
-
return { text: `产线 ${wanted} 不在你的负责范围(你绑定节点覆盖的产线:${scope.lineIds.join(', ') || '无'})。`, isError: true }
|
|
875
|
-
}
|
|
876
|
-
if (lineIds.length === 0) return { text: '你绑定的节点均未分配产线(未挂线的节点没有产线/产品/配方上下文)。' }
|
|
877
|
-
|
|
878
|
-
const sections: string[] = []
|
|
879
|
-
for (const lid of lineIds) {
|
|
880
|
-
const line = getDcwLineRepo().byId(lid)
|
|
881
|
-
const run = getActiveLineRun(lid)
|
|
882
|
-
const recipe = run?.recipeId ? getDcwController().listRecipes().find(r => r.id === run.recipeId) : undefined
|
|
883
|
-
const parts: string[] = []
|
|
884
|
-
parts.push(`■ 产线 ${line?.name ?? lid}(${lid})· 状态:${run ? '运行中' : '待机/停线'}`)
|
|
885
|
-
if (run) {
|
|
886
|
-
parts.push(` 活动批次 ${run.runId.slice(0, 8)} · 产品「${run.productName}」(${run.productId}) · 开跑 ${run.startedAt.slice(11, 19)} · 已打标 ${run.taggedSamples} 样本`)
|
|
887
|
-
}
|
|
888
|
-
const myDcw = getAgentNodeBindingRepo().byAgent(agentId)
|
|
889
|
-
.filter(b => b.kind === 'dcw')
|
|
890
|
-
.map(b => getDcwController().byId(b.nodeId))
|
|
891
|
-
.filter(n => n?.lineId === lid)
|
|
892
|
-
const myDaq = getAgentNodeBindingRepo().byAgent(agentId)
|
|
893
|
-
.filter(b => b.kind === 'daq')
|
|
894
|
-
.map(b => getDaqNodeRepo().byId(b.nodeId))
|
|
895
|
-
.filter(n => n?.lineId === lid)
|
|
896
|
-
parts.push(` 我绑定的节点:数控 [${myDcw.map(n => n!.name).join(', ') || '无'}];数采 [${myDaq.map(n => n!.name).join(', ') || '无'}]`)
|
|
897
|
-
if (recipe) {
|
|
898
|
-
parts.push(` 配方「${recipe.name}」(${recipe.id}) v${recipe.version ?? 1}${recipe.description ? ` — ${recipe.description}` : ''}`)
|
|
899
|
-
for (const p of recipe.params) {
|
|
900
|
-
const node = getDcwController().byId(p.nodeId)
|
|
901
|
-
const mine = myDcw.some(n => n!.id === p.nodeId)
|
|
902
|
-
const stale = nodeRefStatus(p.nodeId, recipe.lineId)
|
|
903
|
-
const staleTag = stale ? ` [${stale.label},参数不下发]` : ''
|
|
904
|
-
const cur = node?.value != null ? node.value : '?'
|
|
905
|
-
const win = p.min != null || p.max != null ? `(窗口 ${p.min ?? '-∞'}~${p.max ?? '+∞'})` : ''
|
|
906
|
-
parts.push(` · ${node?.name ?? p.nodeId} = ${p.value}${node?.unit ?? ''}${win} | PLC 当前 ${cur}${node?.unit ?? ''}${mine ? ' [我负责]' : ''}${staleTag}`)
|
|
907
|
-
}
|
|
908
|
-
const good = recipe.lastGoodRunId ? getDcwRecipeRepo().runById(recipe.lastGoodRunId) : undefined
|
|
909
|
-
parts.push(` 已知良好批次:${good ? `${good.id.slice(0, 8)}(${good.startedAt.slice(0, 19).replace('T', ' ')})` : '未标记'};当前参数版本 v${recipe.version ?? 1}`)
|
|
910
|
-
}
|
|
911
|
-
else {
|
|
912
|
-
// 无活动批次:列出该产线的配方定义(产线未开跑也有配方上下文)
|
|
913
|
-
const lineRecipes = getDcwController().listRecipes().filter(r => r.lineId === lid).slice(0, 3)
|
|
914
|
-
if (lineRecipes.length === 0) {
|
|
915
|
-
parts.push(' 当前无活动配方(产线未开跑;该产线也暂无配方定义)')
|
|
916
|
-
}
|
|
917
|
-
else {
|
|
918
|
-
parts.push(` 当前无活动批次;产线已有 ${lineRecipes.length} 个配方定义(开跑时绑定):`)
|
|
919
|
-
for (const r of lineRecipes) {
|
|
920
|
-
const product = r.productId ? getDcwProductRepo().byId(r.productId) : undefined
|
|
921
|
-
const pp = r.params.map((p) => {
|
|
922
|
-
const node = getDcwController().byId(p.nodeId)
|
|
923
|
-
const cur = node?.value != null ? node.value : '?'
|
|
924
|
-
const stale = nodeRefStatus(p.nodeId, r.lineId)
|
|
925
|
-
const tag = stale ? `[${stale.label},参数不下发]` : ''
|
|
926
|
-
return `${node?.name ?? p.nodeId}=${p.value}${node?.unit ?? ''}(PLC 当前 ${cur})${tag}`
|
|
927
|
-
}).join(', ')
|
|
928
|
-
parts.push(` · 配方「${r.name}」(${r.id}) v${r.version ?? 1} · 产品「${product?.name ?? r.productId}」: ${pp}${r.lastGoodRunId ? ` [良好批次 ${r.lastGoodRunId.slice(0, 8)}]` : ''}`)
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
sections.push(parts.join('\n'))
|
|
933
|
-
}
|
|
934
|
-
return {
|
|
935
|
-
text: `你控制的产线全景(${sections.length} 条):\n\n${sections.join('\n\n')}\n\n说明:配方目标=开跑批次冻结的工艺窗口;PLC 当前值=实时读数。把验证过的最佳参数固化到配方用 recipe_update;回退配方到稳定版本用 recipe_rollback;逐节点参数变更史用 dcw_journal;配方版本史用 recipe_versions。`,
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
/** 工具:recipe_versions —— 配方参数版本史(谁/何时/为什么改了什么;旧→新)。
|
|
940
|
-
* 每条含 by(user/agent/system)、操作者人话名、变更描述、参数 diff。 */
|
|
941
|
-
export async function toolRecipeVersions(agentId: string, args: { recipe_id?: string, limit?: number | string }): Promise<{ text: string, isError?: boolean }> {
|
|
942
|
-
const recipeId = String(args.recipe_id ?? '').trim()
|
|
943
|
-
if (!recipeId) return { text: 'recipe_id 必填(line_context 可看到当前配方的 id)。', isError: true }
|
|
944
|
-
const recipe = getDcwController().listRecipes().find(r => r.id === recipeId)
|
|
945
|
-
if (!recipe) return { text: `配方 ${recipeId} 不存在。`, isError: true }
|
|
946
|
-
const scope = agentOpsScope(agentId)
|
|
947
|
-
if (!scope || !recipe.lineId || !scope.lineIds.includes(recipe.lineId)) {
|
|
948
|
-
return { text: `无权查看配方 ${recipeId} 的版本史(该配方不在你负责的产线上)。`, isError: true }
|
|
949
|
-
}
|
|
950
|
-
const rows = getDcwController().recipeVersions(recipeId)
|
|
951
|
-
const limit = Math.min(Number(args.limit) || 20, 50)
|
|
952
|
-
const shown = rows.slice(-limit)
|
|
953
|
-
const srcLabel: Record<string, string> = { user: '用户', agent: 'Agent', system: '系统' }
|
|
954
|
-
const lines = shown.map((v, i) => {
|
|
955
|
-
const prev = shown[i - 1]
|
|
956
|
-
let diff = '初始版本'
|
|
957
|
-
if (prev) {
|
|
958
|
-
const nodeName = (id: string): string => {
|
|
959
|
-
const n = getDcwController().byId(id)
|
|
960
|
-
return n ? n.name : `${id}(已删除)`
|
|
961
|
-
}
|
|
962
|
-
const changed = v.params
|
|
963
|
-
.map(p => ({ p, old: prev.params.find(x => x.nodeId === p.nodeId) }))
|
|
964
|
-
.filter(({ p, old }) => !old || old.value !== p.value)
|
|
965
|
-
.map(({ p, old }) => `${nodeName(p.nodeId)} ${old?.value ?? '新增'}→${p.value}`)
|
|
966
|
-
const removed = prev.params.filter(o => !v.params.some(x => x.nodeId === o.nodeId)).map(o => `${nodeName(o.nodeId)} 移除`)
|
|
967
|
-
const all = [...changed, ...removed]
|
|
968
|
-
diff = all.length > 0 ? `变更:${all.join(';')}` : '参数未变'
|
|
969
|
-
}
|
|
970
|
-
const src = v.by ? (srcLabel[v.by] ?? v.by) : '—'
|
|
971
|
-
return `- v${v.version} [${v.at.slice(0, 19).replace('T', ' ')}] 来源=${src} 操作者=${v.actorName ?? '—'}${v.description ? ` | ${v.description}` : ''}\n ${diff}`
|
|
972
|
-
})
|
|
973
|
-
return {
|
|
974
|
-
text: `配方「${recipe.name}」版本史(当前 v${recipe.version ?? 1},共 ${rows.length} 条,旧→新):\n${lines.join('\n')}\n\n回退用 recipe_rollback(recipe_id + version 或 to_last_good=true);保存新参数用 recipe_update。`,
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
/** 工具:recipe_update —— 把验证过的最佳参数保存进配方(生成新版本,带归因与原因)。
|
|
979
|
-
* 只改配方定义(下一批次生效);不改运行中 PLC 当前值(那用 dcw_control 逐节点下发)。 */
|
|
980
|
-
export async function toolRecipeUpdate(agentId: string, args: {
|
|
981
|
-
recipe_id?: string
|
|
982
|
-
params?: Array<{ node_id?: string, value?: number | string, min?: number | string, max?: number | string }>
|
|
983
|
-
reason?: string
|
|
984
|
-
task_id?: string
|
|
985
|
-
}): Promise<{ text: string, isError?: boolean }> {
|
|
986
|
-
const recipeId = String(args.recipe_id ?? '').trim()
|
|
987
|
-
const reason = String(args.reason ?? '').trim()
|
|
988
|
-
if (!recipeId) return { text: 'recipe_id 必填(line_context 可看到当前配方的 id)。', isError: true }
|
|
989
|
-
if (!reason) return { text: 'reason 必填:保存参数必须说明依据(如数采证据/判定结论),便于版本史追溯。', isError: true }
|
|
990
|
-
const list = (args.params ?? []).filter(p => p && String(p.node_id ?? '').trim() && Number.isFinite(Number(p.value)))
|
|
991
|
-
if (list.length === 0) return { text: 'params 至少提供一条 {node_id, value}(value 必须为数字)。', isError: true }
|
|
992
|
-
const recipe = getDcwController().listRecipes().find(r => r.id === recipeId)
|
|
993
|
-
if (!recipe) return { text: `配方 ${recipeId} 不存在。`, isError: true }
|
|
994
|
-
const repo = getAgentNodeBindingRepo()
|
|
995
|
-
for (const p of list) {
|
|
996
|
-
const nodeId = String(p.node_id).trim()
|
|
997
|
-
const node = getDcwController().byId(nodeId)
|
|
998
|
-
if (!node) return { text: `节点 ${nodeId} 已删除,不能作为配方参数保存。请改用仍在线的节点。`, isError: true }
|
|
999
|
-
if (node.lineId !== recipe.lineId) return { text: `节点「${node.name}」已取消绑定(不在配方「${recipe.name}」所在产线),不可混入。`, isError: true }
|
|
1000
|
-
if (!node.enabled) return { text: `节点「${node.name}」已停用,参数保存被拒。请先让用户恢复节点控制,或保存到其他节点。`, isError: true }
|
|
1001
|
-
if (!repo.find(agentId, nodeId, 'dcw')) {
|
|
1002
|
-
return { text: `无权修改节点「${node.name}」的配方参数(仅可改自己绑定 dcw 的节点)。`, isError: true }
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
// 部分合并:只更新提供的节点,其余参数保持不变;
|
|
1006
|
-
// 基线中的失效参数(节点已删除/已解绑/已改挂)自动剪除并如实告知 —— 否则整次保存会被归一化拒绝
|
|
1007
|
-
const dropped: string[] = []
|
|
1008
|
-
const merged = recipe.params
|
|
1009
|
-
.filter((p) => {
|
|
1010
|
-
const node = getDcwController().byId(p.nodeId)
|
|
1011
|
-
if (!node || node.lineId !== recipe.lineId) {
|
|
1012
|
-
dropped.push(node?.name ?? p.nodeId)
|
|
1013
|
-
return false
|
|
1014
|
-
}
|
|
1015
|
-
return true
|
|
1016
|
-
})
|
|
1017
|
-
.map((p) => {
|
|
1018
|
-
const patch = list.find(x => String(x.node_id).trim() === p.nodeId)
|
|
1019
|
-
if (!patch) return { nodeId: p.nodeId, templateRef: p.templateRef, value: p.value, min: p.min, max: p.max }
|
|
1020
|
-
const out: { nodeId: string, templateRef?: string, value: number, min?: number, max?: number } = { nodeId: p.nodeId, templateRef: p.templateRef, value: Number(patch.value) }
|
|
1021
|
-
if (p.min != null) out.min = p.min
|
|
1022
|
-
if (patch.min != null && Number.isFinite(Number(patch.min))) out.min = Number(patch.min)
|
|
1023
|
-
if (p.max != null) out.max = p.max
|
|
1024
|
-
if (patch.max != null && Number.isFinite(Number(patch.max))) out.max = Number(patch.max)
|
|
1025
|
-
return out
|
|
1026
|
-
})
|
|
1027
|
-
const extra = list.filter(p => !recipe.params.some(x => x.nodeId === String(p.node_id).trim()))
|
|
1028
|
-
for (const p of extra) merged.push({ nodeId: String(p.node_id).trim(), value: Number(p.value) })
|
|
1029
|
-
try {
|
|
1030
|
-
const updated = getDcwController().updateRecipe(recipeId, { params: merged }, {
|
|
1031
|
-
by: 'agent',
|
|
1032
|
-
actorName: agentBadgeLabel(agentId),
|
|
1033
|
-
actor: agentId,
|
|
1034
|
-
description: reason,
|
|
1035
|
-
})
|
|
1036
|
-
const changedNodes = list.map((p) => {
|
|
1037
|
-
const node = getDcwController().byId(String(p.node_id).trim())
|
|
1038
|
-
const before = recipe.params.find(x => x.nodeId === String(p.node_id).trim())?.value
|
|
1039
|
-
return `${node?.name ?? p.node_id} ${before ?? '?'}→${Number(p.value)}`
|
|
1040
|
-
}).join(';')
|
|
1041
|
-
const droppedNote = dropped.length > 0 ? `\n注意:已自动剔除失效参数(${dropped.join('、')}:节点已删除或改挂其他产线),这些参数不再属于本配方。` : ''
|
|
1042
|
-
return {
|
|
1043
|
-
text: `已保存为 v${updated.version ?? 1}:「${updated.name}」参数 ${changedNodes};原因:${reason}。${droppedNote}\n注意:配方定义已更新,运行中批次仍按开跑时冻结的参数生产,新参数从下次开跑/一键下发生效;要把新值写入运行中的 PLC,用 dcw_control 逐节点下发(走安全联锁)。回退用 recipe_rollback。`,
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
catch (err) {
|
|
1047
|
-
return { text: `保存失败:${err instanceof Error ? err.message : String(err)}`, isError: true }
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
|
-
/** 工具:recipe_rollback —— 回退配方参数到稳定版本(指定历史版本或已知良好批次快照)。
|
|
1052
|
-
* 生成新版本(非破坏,历史保留);不改运行中 PLC 当前值。 */
|
|
1053
|
-
export async function toolRecipeRollback(agentId: string, args: {
|
|
1054
|
-
recipe_id?: string
|
|
1055
|
-
version?: number | string
|
|
1056
|
-
to_last_good?: boolean | string
|
|
1057
|
-
reason?: string
|
|
1058
|
-
}): Promise<{ text: string, isError?: boolean }> {
|
|
1059
|
-
const recipeId = String(args.recipe_id ?? '').trim()
|
|
1060
|
-
const reason = String(args.reason ?? '').trim()
|
|
1061
|
-
const toLastGood = args.to_last_good === true || args.to_last_good === 'true'
|
|
1062
|
-
const version = Number(args.version)
|
|
1063
|
-
if (!recipeId) return { text: 'recipe_id 必填。', isError: true }
|
|
1064
|
-
if (!reason) return { text: 'reason 必填:回退必须说明原因(如优化翻车/越限),便于版本史追溯。', isError: true }
|
|
1065
|
-
if (!toLastGood && !Number.isFinite(version)) return { text: '需提供 version(历史版本号)或 to_last_good=true。', isError: true }
|
|
1066
|
-
const recipe = getDcwController().listRecipes().find(r => r.id === recipeId)
|
|
1067
|
-
if (!recipe) return { text: `配方 ${recipeId} 不存在。`, isError: true }
|
|
1068
|
-
const scope = agentOpsScope(agentId)
|
|
1069
|
-
if (!scope || !recipe.lineId || !scope.lineIds.includes(recipe.lineId)) {
|
|
1070
|
-
return { text: `无权回退配方 ${recipeId}(该配方不在你负责的产线上)。`, isError: true }
|
|
1071
|
-
}
|
|
1072
|
-
if (!toLastGood && Number.isFinite(version) && version >= (recipe.version ?? 1)) {
|
|
1073
|
-
return { text: `不能回退到 v${version}(当前已是 v${recipe.version ?? 1};回退目标是更早的版本)。`, isError: true }
|
|
1074
|
-
}
|
|
1075
|
-
try {
|
|
1076
|
-
const updated = getDcwController().revertRecipe(recipeId, {
|
|
1077
|
-
version: toLastGood ? undefined : version,
|
|
1078
|
-
toLastGood,
|
|
1079
|
-
}, {
|
|
1080
|
-
by: 'agent',
|
|
1081
|
-
actorName: agentBadgeLabel(agentId),
|
|
1082
|
-
actor: agentId,
|
|
1083
|
-
description: reason,
|
|
1084
|
-
})
|
|
1085
|
-
return {
|
|
1086
|
-
text: `回退完成:配方「${updated.name}」已生成 v${updated.version ?? 1},参数恢复为目标版本(${toLastGood ? '已知良好批次冻结' : `v${version}`});原因:${reason}。\n运行中批次不受影响(仍按开跑冻结参数);新参数下次开跑生效。版本史用 recipe_versions 复核。`,
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
catch (err) {
|
|
1090
|
-
return { text: `回退失败:${err instanceof Error ? err.message : String(err)}`, isError: true }
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
|
|
1094
|
-
// ================================================================
|
|
1095
|
-
// AML 自动建模工具族(aml_*):数据集 → 训练作业 → 实验谱系 → 模型晋升 → 影子参考
|
|
1096
|
-
// 权限模型:数据集构建节点级鉴权(daq 绑定,只缩不放)+ 归属产线一致;晋升走 HITL 人工审批;
|
|
1097
|
-
// 作业提交/取消按 agentId 归因( submitJob 内部已记 ops,工具层不重复记提交动作)。
|
|
1098
|
-
// ================================================================
|
|
1099
|
-
|
|
1100
|
-
/** recordOps 的 AML 分类(与 job-orchestrator/model-registry 的 kind='aml' 同源;仓储联合类型暂未列 'aml',此处收口断言) */
|
|
1101
|
-
const AML_AUDIT_KIND = 'aml' as unknown as 'system'
|
|
1102
|
-
|
|
1103
|
-
function amlErr(text: string): { text: string, isError: true } {
|
|
1104
|
-
return { text, isError: true }
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
/** 数值展示(4 位有效小数;空值统一 '-') */
|
|
1108
|
-
function fmtAmlNum(v: number | null | undefined, digits = 4): string {
|
|
1109
|
-
if (v == null || !Number.isFinite(v)) return '-'
|
|
1110
|
-
return String(Number(v.toFixed(digits)))
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1113
|
-
function amlNodeName(nodeId: string): string {
|
|
1114
|
-
return getDaqNodeRepo().byId(nodeId)?.name ?? nodeId
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
function amlNodeUnit(nodeId: string): string {
|
|
1118
|
-
const n = getDaqNodeRepo().byId(nodeId)
|
|
1119
|
-
return n?.unit ?? findDaqTemplate(n?.templateKey ?? '')?.unit ?? ''
|
|
1120
|
-
}
|
|
1121
|
-
|
|
1122
|
-
/** 数据集构建报告惰性读(report.json 与 manifest 同目录) */
|
|
1123
|
-
function amlReportOf(dataset: AmlDatasetRow): AmlDatasetReport | null {
|
|
1124
|
-
try {
|
|
1125
|
-
return JSON.parse(readFileSync(join(dataset.path, 'report.json'), 'utf8')) as AmlDatasetReport
|
|
1126
|
-
}
|
|
1127
|
-
catch {
|
|
1128
|
-
return null
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
/** 门禁报告 → 逐项文本(解析失败降级为原始串) */
|
|
1133
|
-
function amlGatesLines(gatesJson: string | null): string {
|
|
1134
|
-
if (!gatesJson) return ''
|
|
1135
|
-
try {
|
|
1136
|
-
const g = JSON.parse(gatesJson) as { checks?: Array<{ id: string, name: string, value: number | null, threshold: number | null, pass: boolean, detail: string }> }
|
|
1137
|
-
if (!g.checks?.length) return ''
|
|
1138
|
-
return g.checks
|
|
1139
|
-
.map(c => ` ${c.id} ${c.pass ? '✓' : '✗'} ${c.name}: ${c.detail}`)
|
|
1140
|
-
.join('\n')
|
|
1141
|
-
}
|
|
1142
|
-
catch {
|
|
1143
|
-
return ` (门禁数据解析失败) ${gatesJson.slice(0, 120)}`
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
/** 作业行 → 详情卡片(状态/阶段/进度/指标/门禁逐项/错误) */
|
|
1148
|
-
function amlJobCard(job: AmlJobRow): string {
|
|
1149
|
-
const gates = amlGatesLines(job.gatesJson)
|
|
1150
|
-
let metrics = ''
|
|
1151
|
-
try {
|
|
1152
|
-
const m = JSON.parse(job.metricsJson ?? '{}') as { oneStepVal?: { windows?: number, nrmse?: number } | null, oneStepTest?: { windows?: number, nrmse?: number } | null, rolloutTest?: { windows?: number, nrmse?: number, horizon?: number } | null }
|
|
1153
|
-
const parts: string[] = []
|
|
1154
|
-
if (m.oneStepVal) parts.push(`单步验证 NRMSE=${fmtAmlNum(m.oneStepVal.nrmse)}(${m.oneStepVal.windows ?? '?'} 窗)`)
|
|
1155
|
-
if (m.oneStepTest) parts.push(`单步测试 NRMSE=${fmtAmlNum(m.oneStepTest.nrmse)}(${m.oneStepTest.windows ?? '?'} 窗)`)
|
|
1156
|
-
if (m.rolloutTest) parts.push(`滚动测试 NRMSE=${fmtAmlNum(m.rolloutTest.nrmse)}(horizon=${m.rolloutTest.horizon ?? '?'})`)
|
|
1157
|
-
metrics = parts.join(' | ')
|
|
1158
|
-
}
|
|
1159
|
-
catch { /* 无指标 */ }
|
|
1160
|
-
return [
|
|
1161
|
-
`■ 作业 ${job.id}`,
|
|
1162
|
-
` 状态 ${job.status} | 阶段 ${job.stage || '-'} | 进度 ${job.progress}% | purpose=${job.purpose}`,
|
|
1163
|
-
` dataset: ${job.datasetId} | 提交者: ${job.agentId || '-'} | 重试 ${job.retryCount}/2`,
|
|
1164
|
-
` 创建 ${job.createdAt.slice(0, 19).replace('T', ' ')}${job.startedAt ? ` | 开跑 ${job.startedAt.slice(0, 19).replace('T', ' ')}` : ''}${job.endedAt ? ` | 结束 ${job.endedAt.slice(0, 19).replace('T', ' ')}` : ''}`,
|
|
1165
|
-
metrics ? ` 指标: ${metrics}` : null,
|
|
1166
|
-
gates ? ` 门禁逐项:\n${gates}` : ' 门禁: 未产出(作业未完成评估)',
|
|
1167
|
-
job.error ? ` 错误: ${job.error}` : null,
|
|
1168
|
-
].filter(x => x !== null).join('\n')
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
/** 工具:aml_node_catalog —— 我可用的 AML 建模节点(daq 绑定面;物理语义 + 近 24h 批次数据可用性) */
|
|
1172
|
-
export async function toolAmlNodeCatalog(agentId: string): Promise<{ text: string }> {
|
|
1173
|
-
const bindings = getAgentNodeBindingRepo().byAgent(agentId).filter(b => b.kind === 'daq')
|
|
1174
|
-
if (bindings.length === 0) {
|
|
1175
|
-
return { text: '你尚未绑定任何数采节点,AML 自动建模工具不可用(数据集构建要求所用节点均有你的 daq 绑定,绑定只缩不放)。请在数字孪生界面绑定数采节点后重试。' }
|
|
1176
|
-
}
|
|
1177
|
-
const { getTsdb, tsdbReady } = await import('../daq/storage')
|
|
1178
|
-
await tsdbReady
|
|
1179
|
-
const tsdb = getTsdb()
|
|
1180
|
-
const from24h = Date.now() - 24 * 3_600_000
|
|
1181
|
-
const cards: string[] = []
|
|
1182
|
-
for (const b of bindings) {
|
|
1183
|
-
const node = getDaqNodeRepo().byId(b.nodeId)
|
|
1184
|
-
if (!node) continue
|
|
1185
|
-
const tpl = findDaqTemplate(node.templateKey)
|
|
1186
|
-
let dataTag = '近 24h 无批次数据(产线未运行?建模前先确认采集)'
|
|
1187
|
-
try {
|
|
1188
|
-
const pts = await tsdb.query(b.nodeId, { fromMs: from24h, toMs: Date.now(), limit: 1 })
|
|
1189
|
-
if (pts.length > 0) dataTag = '近 24h 有批次打标数据(可建模)'
|
|
1190
|
-
}
|
|
1191
|
-
catch { /* 时序库异常按无数据处理 */ }
|
|
1192
|
-
const lineTxt = node.lineId
|
|
1193
|
-
? `${getDcwLineRepo().byId(node.lineId)?.name ?? node.lineId}(${node.lineId})`
|
|
1194
|
-
: '未分配产线(无批次打标,不能参与建模)'
|
|
1195
|
-
cards.push(
|
|
1196
|
-
`■ ${node.name} · node_id=${node.id}\n`
|
|
1197
|
-
+ ` 物理量 ${tpl?.ch ?? node.templateKey} | 单位 ${node.unit} | 正常量程 ${node.min}~${node.max}${node.unit}\n`
|
|
1198
|
-
+ ` 产线: ${lineTxt} | 数据: ${dataTag}${tpl?.semantics ? `\n 语义: ${tpl.semantics.slice(0, 160)}` : ''}`,
|
|
1199
|
-
)
|
|
1200
|
-
}
|
|
1201
|
-
return {
|
|
1202
|
-
text: `你可用的 AML 建模节点(${cards.length} 个 daq 绑定):\n\n${cards.join('\n\n')}\n\n---\n建模路径:aml_dataset_build(选 control/target 节点组数据集)→ aml_job_submit(提交训练代码)→ aml_job_status / aml_job_logs 轮询 → aml_leaderboard 看实验谱系 → aml_model_promote(lead 专属,人工审批)→ aml_model_reference(调参前查影子参考)。\nrole 语义:control=可控输入(未来轨迹已知)/ target=预测目标(必选 ≥1)/ feature=仅历史特征。`,
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
|
|
1206
|
-
/** 工具:aml_dataset_build —— 组建训练数据集(节点级鉴权:daq 绑定 + 归属产线一致;隔离三元组防配方串味) */
|
|
1207
|
-
export async function toolAmlDatasetBuild(agentId: string, args: {
|
|
1208
|
-
line_id?: string
|
|
1209
|
-
product_id?: string
|
|
1210
|
-
recipe_id?: string
|
|
1211
|
-
nodes?: Array<{ node_id?: string, role?: string }>
|
|
1212
|
-
beat_ms?: number | string
|
|
1213
|
-
history_steps?: number | string
|
|
1214
|
-
horizon_steps?: number | string
|
|
1215
|
-
split_seed?: number | string
|
|
1216
|
-
val_ratio?: number | string
|
|
1217
|
-
test_ratio?: number | string
|
|
1218
|
-
purpose?: string
|
|
1219
|
-
note?: string
|
|
1220
|
-
run_ids?: string[]
|
|
1221
|
-
from_ms?: number | string
|
|
1222
|
-
to_ms?: number | string
|
|
1223
|
-
}): Promise<{ text: string, isError?: boolean }> {
|
|
1224
|
-
const lineId = String(args.line_id ?? '').trim()
|
|
1225
|
-
const productId = String(args.product_id ?? '').trim()
|
|
1226
|
-
const recipeId = String(args.recipe_id ?? '').trim()
|
|
1227
|
-
if (!lineId || !productId || !recipeId) {
|
|
1228
|
-
return amlErr('line_id / product_id / recipe_id 必填(隔离三元组,防配方串味;line_context 可查看当前批次的三个 id)。')
|
|
1229
|
-
}
|
|
1230
|
-
const beatMs = Number(args.beat_ms)
|
|
1231
|
-
const historySteps = Number(args.history_steps)
|
|
1232
|
-
const horizonSteps = Number(args.horizon_steps)
|
|
1233
|
-
if (!Number.isInteger(beatMs) || beatMs < 1000) return amlErr('beat_ms 必须为 ≥1000 的整数(数据对齐节拍,ms)。')
|
|
1234
|
-
if (!Number.isInteger(historySteps) || historySteps < 1 || historySteps > 2048) return amlErr('history_steps 必须为 1~2048 的整数(历史窗口步数)。')
|
|
1235
|
-
if (!Number.isInteger(horizonSteps) || horizonSteps < 1 || horizonSteps > 512) return amlErr('horizon_steps 必须为 1~512 的整数(预测步长)。')
|
|
1236
|
-
const nodes = (Array.isArray(args.nodes) ? args.nodes : [])
|
|
1237
|
-
.map(n => ({ nodeId: String(n?.node_id ?? '').trim(), role: String(n?.role ?? '').trim() }))
|
|
1238
|
-
.filter(n => n.nodeId)
|
|
1239
|
-
if (nodes.length < 2) return amlErr('nodes 至少 2 项({node_id, role}),且必须含 1 个 target(预测目标)。')
|
|
1240
|
-
if (nodes.some(n => !['control', 'feature', 'target'].includes(n.role))) return amlErr('nodes 的 role 必须为 control / feature / target。')
|
|
1241
|
-
if (!nodes.some(n => n.role === 'target')) return amlErr('nodes 必须含至少 1 个 target 节点(预测目标)。')
|
|
1242
|
-
// 鉴权:每个节点都要有该 Agent 的 daq 绑定,且归属参数给定的产线(绑定只缩不放)
|
|
1243
|
-
const repo = getAgentNodeBindingRepo()
|
|
1244
|
-
const daqBound = repo.byAgent(agentId).filter(b => b.kind === 'daq')
|
|
1245
|
-
for (const n of nodes) {
|
|
1246
|
-
if (!daqBound.some(b => b.nodeId === n.nodeId)) {
|
|
1247
|
-
return amlErr(`无权使用节点 ${n.nodeId}(无你的 daq 绑定;绑定只缩不放)。你有权访问的数采节点:${daqBound.map(b => b.nodeId).join(', ') || '(无)'},可先 aml_node_catalog 查看语义。`)
|
|
1248
|
-
}
|
|
1249
|
-
const nodeLine = getDaqNodeRepo().byId(n.nodeId)?.lineId ?? ''
|
|
1250
|
-
if (nodeLine !== lineId) {
|
|
1251
|
-
return amlErr(`节点 ${amlNodeName(n.nodeId)}(${n.nodeId})归属产线 ${nodeLine || '未分配'},与 line_id=${lineId} 不一致;数据集节点必须全部归属同一条产线(绑定只缩不放)。`)
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
const purpose = args.purpose === 'quality_predict' ? 'quality_predict' : 'mpc_surrogate'
|
|
1255
|
-
try {
|
|
1256
|
-
const spec = parseDatasetSpec({
|
|
1257
|
-
lineId,
|
|
1258
|
-
productId,
|
|
1259
|
-
recipeId,
|
|
1260
|
-
runIds: Array.isArray(args.run_ids) ? args.run_ids.map(r => String(r)).filter(Boolean) : undefined,
|
|
1261
|
-
nodes: nodes.map(n => ({ nodeId: n.nodeId, role: n.role as 'control' | 'feature' | 'target' })),
|
|
1262
|
-
fromMs: Number(args.from_ms) || undefined,
|
|
1263
|
-
toMs: Number(args.to_ms) || undefined,
|
|
1264
|
-
beatMs,
|
|
1265
|
-
window: { historySteps, horizonSteps },
|
|
1266
|
-
split: {
|
|
1267
|
-
valRatio: Number.isFinite(Number(args.val_ratio)) ? Number(args.val_ratio) : 0.15,
|
|
1268
|
-
testRatio: Number.isFinite(Number(args.test_ratio)) ? Number(args.test_ratio) : 0.15,
|
|
1269
|
-
seed: Number.isFinite(Number(args.split_seed)) ? Math.trunc(Number(args.split_seed)) : 42,
|
|
1270
|
-
},
|
|
1271
|
-
purpose,
|
|
1272
|
-
note: args.note ? String(args.note) : undefined,
|
|
1273
|
-
})
|
|
1274
|
-
const { dataset, report } = await buildDataset(spec, { id: agentId, kind: 'agent' })
|
|
1275
|
-
recordOps({
|
|
1276
|
-
actor: agentId,
|
|
1277
|
-
actorName: agentBadgeLabel(agentId),
|
|
1278
|
-
actorKind: 'agent',
|
|
1279
|
-
action: 'aml.dataset.build',
|
|
1280
|
-
kind: AML_AUDIT_KIND,
|
|
1281
|
-
summary: `构建数据集 ${dataset.id}(行数 ${dataset.rowCount},批次 ${report.runsUsed.length},窗口 train/val/test ${report.windowCount.train}/${report.windowCount.val}/${report.windowCount.test})`,
|
|
1282
|
-
targetKind: 'aml_dataset',
|
|
1283
|
-
targetId: dataset.id,
|
|
1284
|
-
lineId: dataset.lineId,
|
|
1285
|
-
productId: dataset.productId,
|
|
1286
|
-
recipeId: dataset.recipeId,
|
|
1287
|
-
})
|
|
1288
|
-
const cleanLines = report.nodeSummaries.map((s) => {
|
|
1289
|
-
const c = report.cleaning[s.nodeId]
|
|
1290
|
-
return `- ${amlNodeName(s.nodeId)}(${s.nodeId},${s.role}):样本 ${fmtAmlNum(s.count, 0)},剔除率 ${(100 * s.cleanedRatio).toFixed(1)}%(状态 ${c?.droppedState ?? 0}/量程 ${c?.droppedRange ?? 0}/尖峰 ${c?.droppedHampel ?? 0}),插值 ${c?.interpolated ?? 0} 点,缺失率 ${(100 * s.missingRatio).toFixed(1)}%`
|
|
1291
|
-
})
|
|
1292
|
-
const lagLines = report.lagEstimates.map(l =>
|
|
1293
|
-
`- ${amlNodeName(l.controlId)} → ${amlNodeName(l.targetId)}:滞后 ${l.lagSteps} 拍(≈${fmtAmlNum((l.lagSteps * beatMs) / 1000, 1)}s),互相关 ${l.corr.toFixed(2)}`)
|
|
1294
|
-
const dropLines = report.runsDropped.map(d => `- ${d.runId}: ${d.reason}`)
|
|
1295
|
-
return {
|
|
1296
|
-
text: [
|
|
1297
|
-
`数据集构建完成:`,
|
|
1298
|
-
` dataset_id: ${dataset.id}`,
|
|
1299
|
-
` 三元组: 产线 ${dataset.lineId} / 产品 ${getDcwProductRepo().byId(dataset.productId)?.name ?? dataset.productId} / 配方 ${getDcwRecipeRepo().byId(dataset.recipeId)?.name ?? dataset.recipeId}(purpose=${purpose},beat=${beatMs}ms,history=${historySteps},horizon=${horizonSteps})`,
|
|
1300
|
-
` 行数 ${dataset.rowCount} | 窗口 train ${report.windowCount.train} / val ${report.windowCount.val} / test ${report.windowCount.test} | 批次 ${report.runsUsed.length} 个参与构建`,
|
|
1301
|
-
cleanLines.length ? `\n逐节点清洗摘要:\n${cleanLines.join('\n')}` : null,
|
|
1302
|
-
lagLines.length ? `\n滞后估计(控制→目标,正 = 控制领先;训练/调参时参考):\n${lagLines.join('\n')}` : null,
|
|
1303
|
-
dropLines.length ? `\n丢弃批次(${dropLines.length}):\n${dropLines.join('\n')}` : null,
|
|
1304
|
-
`\n下一步:aml_dataset_stats { dataset_id: "${dataset.id}" } 看完整统计;确认后 aml_job_submit 提交训练(训练代码契约见该工具说明)。`,
|
|
1305
|
-
].filter(x => x !== null).join('\n'),
|
|
1306
|
-
}
|
|
1307
|
-
}
|
|
1308
|
-
catch (err) {
|
|
1309
|
-
return { text: `数据集构建失败:${err instanceof Error ? err.message : String(err)}(常见原因:窗口内无批次打标数据/节点数据缺失率过高;可先 daq_query 确认目标时段数据)。`, isError: true }
|
|
1310
|
-
}
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
|
-
/** 工具:aml_dataset_stats —— 数据集完整统计报告(逐节点统计/滞后/run 轮廓/窗口计数) */
|
|
1314
|
-
export async function toolAmlDatasetStats(_agentId: string, args: { dataset_id?: string }): Promise<{ text: string, isError?: boolean }> {
|
|
1315
|
-
const datasetId = String(args.dataset_id ?? '').trim()
|
|
1316
|
-
if (!datasetId) return amlErr('dataset_id 必填(aml_dataset_build 返回的 id)。')
|
|
1317
|
-
const rt = getAmlRuntime()
|
|
1318
|
-
const dataset = rt.repo.dataset.get(datasetId)
|
|
1319
|
-
if (!dataset) return amlErr(`数据集 ${datasetId} 不存在(aml_node_catalog → aml_dataset_build 先建数据集)。`)
|
|
1320
|
-
const spec = (() => {
|
|
1321
|
-
try {
|
|
1322
|
-
return JSON.parse(dataset.specJson) as { window?: { historySteps?: number, horizonSteps?: number }, beatMs?: number, purpose?: string }
|
|
1323
|
-
}
|
|
1324
|
-
catch { return {} }
|
|
1325
|
-
})()
|
|
1326
|
-
const report = amlReportOf(dataset)
|
|
1327
|
-
if (!report) {
|
|
1328
|
-
return { text: `数据集 ${datasetId} 元数据:行数 ${dataset.rowCount},批次 ${dataset.runIds.length} 个,创建于 ${dataset.createdAt.slice(0, 19).replace('T', ' ')}(统计报告文件缺失,可能为旧版数据集)。` }
|
|
1329
|
-
}
|
|
1330
|
-
const beatMs = spec.beatMs ?? 1000
|
|
1331
|
-
const statLines = report.nodeSummaries.map(s =>
|
|
1332
|
-
`- ${amlNodeName(s.nodeId)}(${s.nodeId},${s.role}):n=${fmtAmlNum(s.count, 0)} 均值 ${fmtAmlNum(s.mean)} std ${fmtAmlNum(s.std)} | p05 ${fmtAmlNum(s.p05)} / p50 ${fmtAmlNum(s.p50)} / p95 ${fmtAmlNum(s.p95)} | 缺失率 ${(100 * s.missingRatio).toFixed(1)}% 清洗率 ${(100 * s.cleanedRatio).toFixed(1)}%`)
|
|
1333
|
-
const lagLines = report.lagEstimates.map(l =>
|
|
1334
|
-
`- ${amlNodeName(l.controlId)} → ${amlNodeName(l.targetId)}:滞后 ${l.lagSteps} 拍(≈${fmtAmlNum((l.lagSteps * beatMs) / 1000, 1)}s),互相关 ${l.corr.toFixed(2)}`)
|
|
1335
|
-
const profileLines = report.runProfiles.map(p =>
|
|
1336
|
-
`- ${p.runId.slice(0, 8)}: ${p.steps} 拍,目标均值 {${Object.entries(p.targetMeans).map(([k, v]) => `${amlNodeName(k)}=${fmtAmlNum(v, 3)}`).join(', ')}}`)
|
|
1337
|
-
return {
|
|
1338
|
-
text: [
|
|
1339
|
-
`数据集 ${datasetId} 统计报告(beat=${beatMs}ms,history=${spec.window?.historySteps ?? '?'} 拍,horizon=${spec.window?.horizonSteps ?? '?'} 拍,purpose=${spec.purpose ?? '-'})`,
|
|
1340
|
-
` 三元组: ${dataset.lineId} / ${dataset.productId} / ${dataset.recipeId} | 行数 ${dataset.rowCount} | 批次 ${dataset.runIds.length}(${report.runsUsed.length} 参与构建)| 创建 ${dataset.createdAt.slice(0, 19).replace('T', ' ')}`,
|
|
1341
|
-
statLines.length ? `\n逐节点统计(train 切分):\n${statLines.join('\n')}` : null,
|
|
1342
|
-
lagLines.length ? `\n控制→目标滞后(互相关峰值,正 = 控制领先):\n${lagLines.join('\n')}` : null,
|
|
1343
|
-
profileLines.length ? `\nrun 轮廓(逐批次目标均值,漂移检测):\n${profileLines.join('\n')}` : null,
|
|
1344
|
-
`\n窗口计数:train ${report.windowCount.train} / val ${report.windowCount.val} / test ${report.windowCount.test}(byRun 分层切分,防同批泄漏)`,
|
|
1345
|
-
report.runsDropped.length > 0 ? `丢弃批次:\n${report.runsDropped.map(d => `- ${d.runId}: ${d.reason}`).join('\n')}` : null,
|
|
1346
|
-
`\n下一步:aml_job_submit { dataset_id: "${datasetId}", code } 提交训练。`,
|
|
1347
|
-
].filter(x => x !== null).join('\n'),
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
|
|
1351
|
-
/** 工具:aml_job_submit —— 提交训练作业(train.py 全文内联;归因 agentId;队列 FIFO) */
|
|
1352
|
-
export async function toolAmlJobSubmit(agentId: string, args: {
|
|
1353
|
-
dataset_id?: string
|
|
1354
|
-
code?: string
|
|
1355
|
-
change_note?: string
|
|
1356
|
-
params?: Record<string, unknown>
|
|
1357
|
-
seed?: number | string
|
|
1358
|
-
purpose?: string
|
|
1359
|
-
parent_experiment_id?: string
|
|
1360
|
-
}): Promise<{ text: string, isError?: boolean }> {
|
|
1361
|
-
const datasetId = String(args.dataset_id ?? '').trim()
|
|
1362
|
-
const code = typeof args.code === 'string' ? args.code : ''
|
|
1363
|
-
if (!datasetId) return amlErr('dataset_id 必填(aml_dataset_build 返回的 id)。')
|
|
1364
|
-
if (!code.trim()) return amlErr('code 必填:train.py 全文(单文件;契约见工具说明)。')
|
|
1365
|
-
if (code.length > 512_000) return amlErr(`code 过大(${Math.round(code.length / 1024)}KB),上限 500KB;精简训练代码(模型定义/训练循环拆薄)后重试。`)
|
|
1366
|
-
if (!/\bimport\s+amlkit\b/.test(code)) {
|
|
1367
|
-
return amlErr('code 必须 import amlkit(平台数据/进度/导出契约):amlkit.load_bundle(datasetPath) 取数、amlkit.report_progress(pct, note) 报进度、amlkit.export_torch_onnx(model, manifest) 导出。缺契约的作业必然失败。')
|
|
1368
|
-
}
|
|
1369
|
-
const purpose = args.purpose === 'quality_predict' ? 'quality_predict' : args.purpose === 'mpc_surrogate' ? 'mpc_surrogate' : undefined
|
|
1370
|
-
const changeNote = String(args.change_note ?? '').trim()
|
|
1371
|
-
if (!changeNote) return amlErr('change_note 必填:单组件改动纪律 —— 每次实验只改一个组件(网络结构/特征/超参之一),写清改了什么与预期,实验谱系靠它归因。')
|
|
1372
|
-
try {
|
|
1373
|
-
const job = submitJob({
|
|
1374
|
-
datasetId,
|
|
1375
|
-
purpose,
|
|
1376
|
-
changeNote,
|
|
1377
|
-
params: args.params && typeof args.params === 'object' && !Array.isArray(args.params) ? args.params : undefined,
|
|
1378
|
-
seed: Number.isInteger(Number(args.seed)) ? Number(args.seed) : undefined,
|
|
1379
|
-
parentExperimentId: String(args.parent_experiment_id ?? '').trim() || undefined,
|
|
1380
|
-
code,
|
|
1381
|
-
agent: { id: agentId },
|
|
1382
|
-
})
|
|
1383
|
-
const st = await runtimeStatus()
|
|
1384
|
-
return {
|
|
1385
|
-
text: [
|
|
1386
|
-
`训练作业已提交:`,
|
|
1387
|
-
` job_id: ${job.id}`,
|
|
1388
|
-
` dataset: ${job.datasetId} | purpose=${job.purpose} | seed=${fmtAmlNum(Number(job.budget.seed ?? 42), 0)} | change_note: ${changeNote}`,
|
|
1389
|
-
` 队列: 排队 ${st.queued} 个(含本作业)/ 在跑 ${st.running} 个 | python ${st.python.ok ? (st.python.version ?? 'ok') : `不可用(${st.python.reason ?? '?'};作业会失败,请联系用户修复环境)`}`,
|
|
1390
|
-
`\n用 aml_job_status { job_id: "${job.id}" } 看状态/阶段/门禁,aml_job_logs { job_id: "${job.id}" } 看日志尾;训练完成后 aml_leaderboard 看谱系与门禁。`,
|
|
1391
|
-
].join('\n'),
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
catch (err) {
|
|
1395
|
-
return { text: `提交失败:${err instanceof Error ? err.message : String(err)}`, isError: true }
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
/** 工具:aml_job_status —— 作业状态(单作业详情 / 缺省列最近 10 个) */
|
|
1400
|
-
export async function toolAmlJobStatus(_agentId: string, args: { job_id?: string }): Promise<{ text: string, isError?: boolean }> {
|
|
1401
|
-
const rt = getAmlRuntime()
|
|
1402
|
-
const jobId = String(args.job_id ?? '').trim()
|
|
1403
|
-
if (jobId) {
|
|
1404
|
-
const job = rt.repo.job.get(jobId)
|
|
1405
|
-
if (!job) return amlErr(`作业 ${jobId} 不存在(aml_job_status 不带参数可列出最近 10 个)。`)
|
|
1406
|
-
return { text: `${amlJobCard(job)}\n\n轮询建议:training 阶段 30~60s 查一次;终态(done/failed)后看门禁与错误,失败原因可 in aml_job_logs 定位。` }
|
|
1407
|
-
}
|
|
1408
|
-
const jobs = rt.repo.job.list({ limit: 10 })
|
|
1409
|
-
if (jobs.length === 0) {
|
|
1410
|
-
return { text: '尚无训练作业。路径:aml_node_catalog 确认节点 → aml_dataset_build 组数据集 → aml_job_submit 提交训练。' }
|
|
1411
|
-
}
|
|
1412
|
-
const rows = jobs.map(j => `- ${j.id} [${j.status}] ${j.stage || '-'} ${j.progress}% dataset=${j.datasetId}${j.error ? ` | 错误: ${j.error.slice(0, 100)}` : ''}`)
|
|
1413
|
-
return { text: `最近 ${jobs.length} 个作业(新→旧):\n${rows.join('\n')}\n\n传 job_id 查看单作业详情(指标/门禁逐项/错误)。` }
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
/** 工具:aml_job_logs —— 作业日志尾随(平台 ##AML 协议行 + 训练输出) */
|
|
1417
|
-
export async function toolAmlJobLogs(_agentId: string, args: { job_id?: string, lines?: number | string }): Promise<{ text: string, isError?: boolean }> {
|
|
1418
|
-
const jobId = String(args.job_id ?? '').trim()
|
|
1419
|
-
if (!jobId) return amlErr('job_id 必填(aml_job_status 不带参数可列出最近作业)。')
|
|
1420
|
-
const job = getAmlRuntime().repo.job.get(jobId)
|
|
1421
|
-
if (!job) return amlErr(`作业 ${jobId} 不存在。`)
|
|
1422
|
-
const n = Math.min(Math.max(Number(args.lines) || 80, 5), 400)
|
|
1423
|
-
const rows = jobLogsTail(jobId, n)
|
|
1424
|
-
if (rows.length === 0) {
|
|
1425
|
-
return { text: `作业 ${jobId} 暂无日志(${job.status === 'queued' ? '仍在排队,开跑后产生日志' : '日志未落盘或已被清理'});稍后重试或用 aml_job_status 看状态。` }
|
|
1426
|
-
}
|
|
1427
|
-
return { text: `作业 ${jobId} 日志尾(最近 ${rows.length} 行,时间正序;##AML 前缀行 = 平台协议事件):\n${rows.join('\n')}` }
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
/** 工具:aml_job_cancel —— 取消排队/运行中的作业(归因入册) */
|
|
1431
|
-
export async function toolAmlJobCancel(agentId: string, args: { job_id?: string }): Promise<{ text: string, isError?: boolean }> {
|
|
1432
|
-
const jobId = String(args.job_id ?? '').trim()
|
|
1433
|
-
if (!jobId) return amlErr('job_id 必填。')
|
|
1434
|
-
const rt = getAmlRuntime()
|
|
1435
|
-
const job = rt.repo.job.get(jobId)
|
|
1436
|
-
if (!job) return amlErr(`作业 ${jobId} 不存在。`)
|
|
1437
|
-
if (['done', 'failed', 'cancelled', 'timeout'].includes(job.status)) {
|
|
1438
|
-
return amlErr(`作业 ${jobId} 已是终态(${job.status}),无需取消;aml_job_status 复核。`)
|
|
1439
|
-
}
|
|
1440
|
-
const ok = cancelJob(jobId, { id: agentId, kind: 'agent' })
|
|
1441
|
-
if (!ok) return amlErr(`取消失败:作业 ${jobId} 不在排队/运行中(可能恰好结束);aml_job_status 复核。`)
|
|
1442
|
-
const dataset = rt.repo.dataset.get(job.datasetId)
|
|
1443
|
-
recordOps({
|
|
1444
|
-
actor: agentId,
|
|
1445
|
-
actorName: agentBadgeLabel(agentId),
|
|
1446
|
-
actorKind: 'agent',
|
|
1447
|
-
action: 'aml.job.cancel',
|
|
1448
|
-
kind: AML_AUDIT_KIND,
|
|
1449
|
-
summary: `取消训练作业 ${jobId}(原状态 ${job.status})`,
|
|
1450
|
-
targetKind: 'aml_job',
|
|
1451
|
-
targetId: jobId,
|
|
1452
|
-
lineId: dataset?.lineId,
|
|
1453
|
-
productId: dataset?.productId,
|
|
1454
|
-
recipeId: dataset?.recipeId,
|
|
1455
|
-
})
|
|
1456
|
-
return { text: `作业 ${jobId} 已取消(运行中的会终止进程树)。数据集 ${job.datasetId} 仍可复用;需要重训直接 aml_job_submit。` }
|
|
1457
|
-
}
|
|
1458
|
-
|
|
1459
|
-
/** 工具:aml_leaderboard —— 数据集的实验谱系与门禁对照(标当前最优) */
|
|
1460
|
-
export async function toolAmlLeaderboard(_agentId: string, args: { dataset_id?: string }): Promise<{ text: string, isError?: boolean }> {
|
|
1461
|
-
const datasetId = String(args.dataset_id ?? '').trim()
|
|
1462
|
-
if (!datasetId) return amlErr('dataset_id 必填(aml_dataset_build 返回的 id)。')
|
|
1463
|
-
const rt = getAmlRuntime()
|
|
1464
|
-
const dataset = rt.repo.dataset.get(datasetId)
|
|
1465
|
-
if (!dataset) return amlErr(`数据集 ${datasetId} 不存在。`)
|
|
1466
|
-
const exps = rt.repo.experiment.listByDataset(datasetId, 50)
|
|
1467
|
-
if (exps.length === 0) {
|
|
1468
|
-
return { text: `数据集 ${datasetId}(${dataset.rowCount} 行)尚无实验:aml_job_submit 提交训练后,此处给出谱系与门禁对照。` }
|
|
1469
|
-
}
|
|
1470
|
-
const parsed = exps.map((e) => {
|
|
1471
|
-
let metrics: { oneStepTest?: { nrmse?: number }, rolloutTest?: { nrmse?: number } } = {}
|
|
1472
|
-
let gates: { passed?: boolean } = {}
|
|
1473
|
-
try {
|
|
1474
|
-
metrics = JSON.parse(e.metricsJson)
|
|
1475
|
-
}
|
|
1476
|
-
catch { /* 无指标 */ }
|
|
1477
|
-
try {
|
|
1478
|
-
gates = JSON.parse(e.gatesJson)
|
|
1479
|
-
}
|
|
1480
|
-
catch { /* 无门禁 */ }
|
|
1481
|
-
return { e, g1: metrics.oneStepTest?.nrmse ?? null, g2: metrics.rolloutTest?.nrmse ?? null, passed: gates.passed === true || e.status === 'gates_passed' }
|
|
1482
|
-
})
|
|
1483
|
-
const passers = parsed.filter(p => p.passed && p.g1 != null)
|
|
1484
|
-
const bestId = passers.length > 0 ? passers.reduce((a, b) => ((a.g1 ?? Infinity) <= (b.g1 ?? Infinity) ? a : b)).e.id : null
|
|
1485
|
-
const rows = parsed.map(p =>
|
|
1486
|
-
`- ${p.e.id} [${p.e.status}] ${p.e.changeNote ? `「${p.e.changeNote.slice(0, 60)}」` : '(无备注)'}${p.e.parentExperimentId ? ` ← 父 ${p.e.parentExperimentId}` : ''} | G1=${fmtAmlNum(p.g1)}${p.g2 != null ? ` G2=${fmtAmlNum(p.g2)}` : ''} | 门禁 ${p.passed ? '通过' : '未通过'}${p.e.id === bestId ? ' ★当前最优' : ''}`)
|
|
1487
|
-
const models = rt.repo.model.list({ limit: 100 }).filter(m => m.datasetId === datasetId)
|
|
1488
|
-
const modelLines = models.map(m => `- ${m.id} [${m.stage}] purpose=${m.purpose}(实验 ${m.experimentId})`)
|
|
1489
|
-
return {
|
|
1490
|
-
text: [
|
|
1491
|
-
`实验谱系(数据集 ${datasetId} · ${dataset.productId}/${dataset.recipeId} · ${exps.length} 条,新→旧):`,
|
|
1492
|
-
...rows,
|
|
1493
|
-
modelLines.length > 0 ? `\n已登记模型(晋升对象;aml_leaderboard 最优 = 门禁通过且 G1 最小):` : null,
|
|
1494
|
-
...modelLines,
|
|
1495
|
-
`\nG1=单步测试 NRMSE,G2=多步滚动 NRMSE(越小越好)。优化纪律:每次只改一个组件,change_note 写明;把最优模型推上生产用 aml_model_promote(lead 专属,需人工审批)。`,
|
|
1496
|
-
].filter(x => x !== null).join('\n'),
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
|
|
1500
|
-
/** 工具:aml_model_promote —— 模型晋升 shadow/production(lead 专属;HITL 人工审批;流转入册由 transitionModel 内部完成) */
|
|
1501
|
-
export async function toolAmlModelPromote(agentId: string, args: { model_id?: string, to_stage?: string }): Promise<{ text: string, isError?: boolean }> {
|
|
1502
|
-
// 治理硬守卫:晋升仅限 lead 实例(注入层过滤 + 分发层双重校验,HTTP 直调不可绕过)
|
|
1503
|
-
const roleRow = getAmlRuntime().db.prepare('SELECT role FROM channel_agents WHERE id = ? AND enabled = 1').get(agentId) as { role?: string } | undefined
|
|
1504
|
-
if (roleRow?.role !== 'lead') {
|
|
1505
|
-
return amlErr(`aml_model_promote 为 lead 专属工具:实例 ${agentId}(role=${roleRow?.role ?? '未知'})无权晋升模型。请由团队 lead 发起,晋升需人工 HITL 批准。`)
|
|
1506
|
-
}
|
|
1507
|
-
const modelId = String(args.model_id ?? '').trim()
|
|
1508
|
-
const toStage = String(args.to_stage ?? '').trim()
|
|
1509
|
-
if (!modelId) return amlErr('model_id 必填(aml_leaderboard 的「已登记模型」段可查)。')
|
|
1510
|
-
if (toStage !== 'shadow' && toStage !== 'production') return amlErr('to_stage 必须为 \'shadow\'(影子观测)或 \'production\'(生产生效)。')
|
|
1511
|
-
const rt = getAmlRuntime()
|
|
1512
|
-
const model = rt.repo.model.get(modelId)
|
|
1513
|
-
if (!model) return amlErr(`模型 ${modelId} 不存在。`)
|
|
1514
|
-
if (model.stage === toStage) return amlErr(`模型 ${modelId} 已是 ${toStage},无需流转。`)
|
|
1515
|
-
// production 预检:同组 (product, recipe, purpose) 旧生产将被退役
|
|
1516
|
-
let oldProdId: string | undefined
|
|
1517
|
-
if (toStage === 'production') {
|
|
1518
|
-
oldProdId = rt.repo.model
|
|
1519
|
-
.list({ stage: 'production', productId: model.productId, recipeId: model.recipeId, limit: 50 })
|
|
1520
|
-
.find(m => m.id !== modelId && m.purpose === model.purpose)?.id
|
|
1521
|
-
}
|
|
1522
|
-
// 同模型挂起审批去重(防审批面板堆积,与 dcw_control 同纪律)
|
|
1523
|
-
const approvals = getToolApprovals()
|
|
1524
|
-
if (approvals.hasPendingFor(agentId, modelId)) {
|
|
1525
|
-
return amlErr(`模型 ${modelId} 已有一条待审批的晋升请求,请等待用户处理后再发起新请求。`)
|
|
1526
|
-
}
|
|
1527
|
-
const detail = `AML 模型晋升:${modelId} ${model.stage} → ${toStage}(产品 ${model.productId} / 配方 ${model.recipeId} / purpose=${model.purpose}${oldProdId ? `;批准后原生产模型 ${oldProdId} 将自动退役` : ''})`
|
|
1528
|
-
const ap = await approvals.request(agentId, modelId, 'dcw', detail, { title: 'AML 模型晋升审批' })
|
|
1529
|
-
if (!ap.approved) {
|
|
1530
|
-
return { text: `人工未批准:模型 ${modelId} 保持 ${model.stage} 阶段。用户备注:${ap.comment || '(无)'}。可回炉重训(aml_job_submit)或换候选模型后再申请。` }
|
|
1531
|
-
}
|
|
1532
|
-
try {
|
|
1533
|
-
const r = transitionModel(modelId, toStage, agentBadgeLabel(agentId), 'agent')
|
|
1534
|
-
// 归属审计已由 transitionModel 内部 recordOps(aml.model.promote)完成,此处不重复记录
|
|
1535
|
-
return {
|
|
1536
|
-
text: `晋升完成:${modelId} ${r.from} → ${toStage}。${r.retiredId ? `原生产模型 ${r.retiredId} 已自动退役。` : ''}${toStage === 'shadow'
|
|
1537
|
-
? '影子阶段:用 aml_model_reference 观测其预测与实际偏差,积累证据后再申请 production。'
|
|
1538
|
-
: '该模型已作为生产模型生效:aml_model_reference 的影子参考即来自它;调控 Agent 调参前请先查它。'}`,
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1541
|
-
catch (err) {
|
|
1542
|
-
return { text: `晋升失败:${err instanceof Error ? err.message : String(err)}(审批已通过;若为并发竞态可刷新状态重试)。`, isError: true }
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1546
|
-
/** 工具:aml_model_reference —— 生产模型影子参考:拉最近历史组装模型输入 → 预测未来目标轨迹(调参前先问影子模型) */
|
|
1547
|
-
export async function toolAmlModelReference(agentId: string, args: {
|
|
1548
|
-
line_id?: string
|
|
1549
|
-
product_id?: string
|
|
1550
|
-
recipe_id?: string
|
|
1551
|
-
purpose?: string
|
|
1552
|
-
controls?: Record<string, number | string>
|
|
1553
|
-
steps?: number | string
|
|
1554
|
-
}): Promise<{ text: string, isError?: boolean }> {
|
|
1555
|
-
// 0. 绑定面:至少一个 daq 绑定;line_id 只缩不放
|
|
1556
|
-
const repo = getAgentNodeBindingRepo()
|
|
1557
|
-
const daqBindings = repo.byAgent(agentId).filter(b => b.kind === 'daq')
|
|
1558
|
-
if (daqBindings.length === 0) {
|
|
1559
|
-
return amlErr('你尚未绑定任何数采节点,无法组装影子参考所需的历史输入;请先绑定数采节点。')
|
|
1560
|
-
}
|
|
1561
|
-
const lineOf = (id: string): string => getDaqNodeRepo().byId(id)?.lineId ?? ''
|
|
1562
|
-
const scopeLines = [...new Set(daqBindings.map(b => lineOf(b.nodeId)).filter(Boolean))]
|
|
1563
|
-
const lineFilter = String(args.line_id ?? '').trim()
|
|
1564
|
-
if (lineFilter && !scopeLines.includes(lineFilter)) {
|
|
1565
|
-
return amlErr(`产线 ${lineFilter} 不在你的负责范围(你绑定节点覆盖:${scopeLines.join(', ') || '无'};绑定只缩不放)。`)
|
|
1566
|
-
}
|
|
1567
|
-
const purpose = args.purpose === 'quality_predict' ? 'quality_predict' : 'mpc_surrogate'
|
|
1568
|
-
|
|
1569
|
-
// 1. 解析 (productId, recipeId):参数给全用参数;缺省回退到候选产线的唯一活动批次
|
|
1570
|
-
let productId = String(args.product_id ?? '').trim()
|
|
1571
|
-
let recipeId = String(args.recipe_id ?? '').trim()
|
|
1572
|
-
let resolveHow = '参数指定'
|
|
1573
|
-
if (!productId || !recipeId) {
|
|
1574
|
-
const candidateLines = lineFilter ? [lineFilter] : scopeLines
|
|
1575
|
-
const runs = candidateLines
|
|
1576
|
-
.map(lid => getActiveLineRun(lid))
|
|
1577
|
-
.filter((r): r is NonNullable<ReturnType<typeof getActiveLineRun>> => !!r && !!r.productId && !!r.recipeId)
|
|
1578
|
-
if (runs.length === 1) {
|
|
1579
|
-
const run = runs[0]!
|
|
1580
|
-
if (!productId) productId = run.productId
|
|
1581
|
-
if (!recipeId) recipeId = run.recipeId
|
|
1582
|
-
resolveHow = `产线 ${run.lineId} 唯一活动批次 ${run.runId.slice(0, 8)}(产品「${run.productName}」/配方「${run.recipeName}」)`
|
|
1583
|
-
}
|
|
1584
|
-
else if (runs.length === 0) {
|
|
1585
|
-
return { text: `无法确定产品/配方:${candidateLines.length > 0 ? `产线 ${candidateLines.join(', ')}` : '你绑定节点所属产线'}当前无活动批次,且 product_id/recipe_id 未给全。请开跑后重试,或显式传 product_id 与 recipe_id(line_context 可查)。`, isError: true }
|
|
1586
|
-
}
|
|
1587
|
-
else {
|
|
1588
|
-
return { text: `无法确定产品/配方:候选产线存在多个活动批次(${runs.map(r => `${r.lineId} → ${r.productName}/${r.recipeName}`).join('; ')})。请传 line_id 缩小范围,或显式传 product_id 与 recipe_id。`, isError: true }
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
|
|
1592
|
-
// 2. 生产模型(无则指引建模范式)
|
|
1593
|
-
const rt = getAmlRuntime()
|
|
1594
|
-
const model = rt.repo.model.productionOf(productId, recipeId, purpose)
|
|
1595
|
-
if (!model) {
|
|
1596
|
-
const cands = rt.repo.model.list({ productId, recipeId, limit: 20 })
|
|
1597
|
-
return { text: `尚无生产模型:(${productId}, ${recipeId}, ${purpose}) 下没有 stage=production 的模型。${cands.length > 0 ? `现有候选:${cands.map(m => `${m.id}(${m.stage})`).join(', ')} —— 请 lead 用 aml_model_promote 晋升(需人工审批)。` : '该三元组下还没有任何模型:aml_dataset_build → aml_job_submit 训练,门禁通过后申请晋升。在此之前调参请依据 dcw_journal 历史经验与 daq_query 证据。'}` }
|
|
1598
|
-
}
|
|
1599
|
-
// 3. 产线归属鉴权(绑定只缩不放;模型归属线经数据集追溯)
|
|
1600
|
-
const ds = rt.repo.dataset.get(model.datasetId)
|
|
1601
|
-
const modelLine = ds?.lineId ?? ''
|
|
1602
|
-
if (modelLine && !scopeLines.includes(modelLine)) {
|
|
1603
|
-
return amlErr(`模型 ${model.id} 归属产线 ${modelLine},不在你绑定节点覆盖的产线(${scopeLines.join(', ')})内;绑定只缩不放。`)
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
|
-
// 4. io 契约 → 拉最近历史 → 网格对齐 → 组 [H][nAll](原始物理量,顺序 = allNodes)
|
|
1607
|
-
const io = readIoSpecFor(model.id)
|
|
1608
|
-
const H = io.historySteps
|
|
1609
|
-
const beatMs = io.beatMs
|
|
1610
|
-
const now = Date.now()
|
|
1611
|
-
const fromMs = now - H * beatMs - 5 * beatMs
|
|
1612
|
-
const { getTsdb, tsdbReady } = await import('../daq/storage')
|
|
1613
|
-
await tsdbReady
|
|
1614
|
-
const tsdb = getTsdb()
|
|
1615
|
-
const columns = new Map<string, number[]>()
|
|
1616
|
-
const shortage: string[] = []
|
|
1617
|
-
for (const nodeId of io.allNodes) {
|
|
1618
|
-
try {
|
|
1619
|
-
const pts = await tsdb.query(nodeId, { fromMs, toMs: now, limit: Math.min(Math.max(H * 10, 600), 5000) })
|
|
1620
|
-
const { grid } = alignToGrid(
|
|
1621
|
-
pts.map(p => ({ at: p.at, value: p.value ?? p.avg ?? 0 })).filter(p => Number.isFinite(p.value)),
|
|
1622
|
-
{ beatMs, maxInterpMs: beatMs * 2 },
|
|
1623
|
-
)
|
|
1624
|
-
const tail = grid.slice(-H).map(g => g.value)
|
|
1625
|
-
if (tail.length < H) {
|
|
1626
|
-
shortage.push(`${amlNodeName(nodeId)}(${nodeId})仅 ${tail.length}/${H} 格点`)
|
|
1627
|
-
continue
|
|
1628
|
-
}
|
|
1629
|
-
columns.set(nodeId, tail)
|
|
1630
|
-
}
|
|
1631
|
-
catch (err) {
|
|
1632
|
-
shortage.push(`${amlNodeName(nodeId)}(${nodeId})查询失败:${err instanceof Error ? err.message : String(err)}`)
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1635
|
-
if (shortage.length > 0) {
|
|
1636
|
-
return { text: `历史数据不足,无法组装模型输入:${shortage.join(';')}。需要从 ${new Date(fromMs).toISOString().slice(0, 16)} 起连续约 ${(H * beatMs / 60_000).toFixed(0)} 分钟的运行数据(产线须在跑);等数据积累后重试,或缩短 steps/换更短 history 的模型。`, isError: true }
|
|
1637
|
-
}
|
|
1638
|
-
const history: number[][] = []
|
|
1639
|
-
for (let i = 0; i < H; i++) history.push(io.allNodes.map(n => columns.get(n)![i]!))
|
|
1640
|
-
|
|
1641
|
-
// 5. 控制轨迹:controls 映射(节点 id → 值,常数外推 steps 行);缺省行持最后观测
|
|
1642
|
-
const steps = Math.max(1, Math.min(Number(args.steps) || io.horizonSteps, io.horizonSteps))
|
|
1643
|
-
const lastRow = history[history.length - 1]!
|
|
1644
|
-
const unknownKeys = args.controls ? Object.keys(args.controls).filter(k => !io.controlNodes.includes(k)) : []
|
|
1645
|
-
const controlRow = io.controlNodes.map((c) => {
|
|
1646
|
-
const provided = args.controls?.[c]
|
|
1647
|
-
const v = provided != null ? Number(provided) : Number.NaN
|
|
1648
|
-
return Number.isFinite(v) ? v : lastRow[io.allNodes.indexOf(c)]!
|
|
1649
|
-
})
|
|
1650
|
-
const controls: number[][] = Array.from({ length: steps }, () => [...controlRow])
|
|
1651
|
-
|
|
1652
|
-
// 6. 预测 + 人话报告
|
|
1653
|
-
try {
|
|
1654
|
-
const r = await predictProduction(productId, recipeId, purpose, { history, controls, steps })
|
|
1655
|
-
const header = `步 | ${r.targetNodes.map(t => `${amlNodeName(t)}(${amlNodeUnit(t)})`).join(' | ')}`
|
|
1656
|
-
const forecastLines = r.forecast.map((row, i) =>
|
|
1657
|
-
` ${i + 1}(+${fmtAmlNum(((i + 1) * r.beatMs) / 1000, 0)}s) | ${row.map(v => fmtAmlNum(v, 3)).join(' | ')}`)
|
|
1658
|
-
const ctrlTxt = io.controlNodes.length > 0
|
|
1659
|
-
? io.controlNodes.map((c) => {
|
|
1660
|
-
const provided = args.controls?.[c]
|
|
1661
|
-
return `${amlNodeName(c)}=${Number.isFinite(Number(provided)) ? Number(provided) : `${fmtAmlNum(lastRow[io.allNodes.indexOf(c)], 3)}(持最后观测)`}${amlNodeUnit(c)}`
|
|
1662
|
-
}).join(', ')
|
|
1663
|
-
: '无控制节点'
|
|
1664
|
-
return {
|
|
1665
|
-
text: [
|
|
1666
|
-
`影子模型参考(调参前先问影子模型;预测≠承诺,真实下发仍走 dcw_control 安全联锁):`,
|
|
1667
|
-
` 模型 ${r.modelId}(stage=${r.stage},purpose=${purpose})| 三元组:产品 ${getDcwProductRepo().byId(productId)?.name ?? productId} / 配方 ${getDcwRecipeRepo().byId(recipeId)?.name ?? recipeId}(解析:${resolveHow})`,
|
|
1668
|
-
` 输入:最近 ${H} 拍 × ${io.allNodes.length} 节点(beat=${beatMs}ms),截至 ${new Date(now).toISOString().slice(11, 19)};控制轨迹(共 ${steps} 步):${ctrlTxt}${unknownKeys.length > 0 ? `(已忽略非控制节点的键:${unknownKeys.join(', ')})` : ''}`,
|
|
1669
|
-
` 预测(steps=${steps},每拍 ${beatMs / 1000}s):`,
|
|
1670
|
-
` ${header}`,
|
|
1671
|
-
...forecastLines,
|
|
1672
|
-
` 假设: ${r.assumptions}`,
|
|
1673
|
-
`\n用法:把候选设定值作为 controls 传入(键 = 控制节点 id)对比不同方案的预测轨迹;选定后 dcw_control 下发并 daq_query 复测。`,
|
|
1674
|
-
].join('\n'),
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
catch (err) {
|
|
1678
|
-
return { text: `预测失败:${err instanceof Error ? err.message : String(err)}(模型 ${model.id};若为工件缺失可重训同规格数据集)。`, isError: true }
|
|
1679
|
-
}
|
|
1680
|
-
}
|