agentworkshop 0.6.1 → 0.7.1
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 +17 -0
- package/.env.example +37 -0
- package/.output/.AgentWorkShop/prompts/host-tools.json +17 -0
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{Bc_mM2cU.js → BH0Z05CS.js} +1 -1
- package/.output/public/_nuxt/Bxgaym6j.js +1 -0
- package/.output/public/_nuxt/{DRlJ2-4p.js → By-LNp3k.js} +1 -1
- package/.output/public/_nuxt/{C2QSTAWf.js → Bz40vyZS.js} +1 -1
- package/.output/public/_nuxt/{CwS_UHeH.js → CS8R0_J3.js} +1 -1
- package/.output/public/_nuxt/{ClptO7LA.js → CUxV8Bw_.js} +1 -1
- package/.output/public/_nuxt/CXmkVXS5.js +1 -0
- package/.output/public/_nuxt/DC-QMEk1.js +2 -0
- package/.output/public/_nuxt/{C-Y5ydB6.js → Dgp2wK2U.js} +6 -6
- package/.output/public/_nuxt/{Ck6tznoQ.js → DjqcbFBE.js} +1 -1
- package/.output/public/_nuxt/{B0haAGoq.js → GP2wXyuY.js} +1 -1
- package/.output/public/_nuxt/TownView.Bt33bo1M.css +1 -0
- package/.output/public/_nuxt/{MhK4buEJ.js → XVB9_zwP.js} +1 -1
- package/.output/public/_nuxt/_id_.BeqSLvl_.css +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/0f65fbec-c4c0-45de-9c50-bb41ada375e5.json +1 -0
- package/.output/public/_nuxt/{Bq_KKxCg.js → i_MKObHo.js} +1 -1
- package/.output/public/_nuxt/settings.DeRNNUcP.css +1 -0
- package/.output/public/_nuxt/{CclO6GyL.js → tpDMVY5w.js} +1 -1
- package/.output/public/_nuxt/{C0FogB-p.js → zwdqvGN_.js} +1 -1
- package/.output/server/chunks/_/nitro.mjs +2674 -2347
- package/.output/server/chunks/_/nitro.mjs.map +1 -1
- package/.output/server/chunks/build/{TownView-D9yCQe1T.mjs → TownView-BkHxMiwZ.mjs} +168 -159
- package/.output/server/chunks/build/{TownView-D9yCQe1T.mjs.map → TownView-BkHxMiwZ.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-xR3AChMO.mjs → _id_-Bna1_JuB.mjs} +5 -4
- package/.output/server/chunks/build/_id_-Bna1_JuB.mjs.map +1 -0
- package/.output/server/chunks/build/{_id_-CmKAEFHV.mjs → _id_-GnRJPykX.mjs} +161 -119
- package/.output/server/chunks/build/_id_-GnRJPykX.mjs.map +1 -0
- package/.output/server/chunks/build/{_wsId_-C45nVrl-.mjs → _wsId_-CzLDGT_V.mjs} +6 -5
- package/.output/server/chunks/build/{_wsId_-C45nVrl-.mjs.map → _wsId_-CzLDGT_V.mjs.map} +1 -1
- package/.output/server/chunks/build/agents-D4l1icvn.mjs +1 -0
- package/.output/server/chunks/build/agents-D4l1icvn.mjs.map +1 -1
- package/.output/server/chunks/build/channel-templates-DqjtC-R0.mjs +1 -0
- package/.output/server/chunks/build/channel-templates-DqjtC-R0.mjs.map +1 -1
- package/.output/server/chunks/build/{daq-Boz_dlAQ.mjs → daq-D_W59QOe.mjs} +6 -5
- package/.output/server/chunks/build/daq-D_W59QOe.mjs.map +1 -0
- package/.output/server/chunks/build/{dcw-wTRwBAUi.mjs → dcw-BTM5YU-B.mjs} +3 -2
- package/.output/server/chunks/build/dcw-BTM5YU-B.mjs.map +1 -0
- package/.output/server/chunks/build/default-Dt6xLdpd.mjs +1 -0
- package/.output/server/chunks/build/{logs-Cdi-eXlN.mjs → logs-CUQt1z7D.mjs} +4 -3
- package/.output/server/chunks/build/logs-CUQt1z7D.mjs.map +1 -0
- package/.output/server/chunks/build/monitor-yNoV98rf.mjs +1 -0
- package/.output/server/chunks/build/{pages-bWKy0ZsA.mjs → pages-DR2bzczM.mjs} +4 -3
- package/.output/server/chunks/build/pages-DR2bzczM.mjs.map +1 -0
- package/.output/server/chunks/build/plugins-B-ZNey0Z.mjs +1 -0
- package/.output/server/chunks/build/plugins-B-ZNey0Z.mjs.map +1 -1
- package/.output/server/chunks/build/{settings-C3T5hR2A.mjs → settings-Cr06lbRy.mjs} +26 -18
- package/.output/server/chunks/build/settings-Cr06lbRy.mjs.map +1 -0
- package/.output/server/chunks/build/teams-QR3BBF7A.mjs +1 -0
- package/.output/server/chunks/build/teams-QR3BBF7A.mjs.map +1 -1
- package/.output/server/chunks/build/tokens-DFvr_TLj.mjs +1 -0
- package/.output/server/chunks/build/tokens-DFvr_TLj.mjs.map +1 -1
- package/.output/server/chunks/build/{town-CKg6Qxba.mjs → town-BN4vQPb8.mjs} +6 -5
- package/.output/server/chunks/build/town-BN4vQPb8.mjs.map +1 -0
- package/.output/server/chunks/build/town-BUqRobze.mjs +1 -0
- package/.output/server/chunks/build/town-BUqRobze.mjs.map +1 -1
- package/.output/server/chunks/build/{useDaqStream-zHEptJQ_.mjs → useDaqStream-hwkhJHFU.mjs} +2 -2
- package/.output/server/chunks/build/{useDaqStream-zHEptJQ_.mjs.map → useDaqStream-hwkhJHFU.mjs.map} +1 -1
- package/.output/server/chunks/build/{useDcwStream-BkWDGaWp.mjs → useDcwStream-Bdew_yrr.mjs} +16 -1
- package/.output/server/chunks/build/useDcwStream-Bdew_yrr.mjs.map +1 -0
- package/.output/server/chunks/build/{useDeviceTwins-NhtXqSkU.mjs → useDeviceTwins-C6EBg9oN.mjs} +2 -2
- package/.output/server/chunks/build/{useDeviceTwins-NhtXqSkU.mjs.map → useDeviceTwins-C6EBg9oN.mjs.map} +1 -1
- package/.output/server/chunks/build/{useOpsLog-CU64VDg5.mjs → useOpsLog-DdCqKVVG.mjs} +2 -2
- package/.output/server/chunks/build/{useOpsLog-CU64VDg5.mjs.map → useOpsLog-DdCqKVVG.mjs.map} +1 -1
- package/.output/server/chunks/build/users-4FZ0yFUO.mjs +1 -0
- package/.output/server/chunks/build/users-4FZ0yFUO.mjs.map +1 -1
- package/.output/server/chunks/build/workshop-CLhwe5eo.mjs +1 -0
- package/.output/server/chunks/build/workshop-CLhwe5eo.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +1 -0
- package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get.mjs +1 -0
- package/.output/server/chunks/routes/api/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.post.mjs +1 -0
- package/.output/server/chunks/routes/api/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/mcp/workshop.mjs +1 -0
- package/.output/server/chunks/routes/api/mcp/workshop.mjs.map +1 -1
- package/.output/server/chunks/routes/api/metrics.mjs +1 -0
- package/.output/server/chunks/routes/api/metrics.mjs.map +1 -1
- package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs +1 -0
- package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs.map +1 -1
- package/.output/server/chunks/routes/api/plugins/client/_name_.get.mjs +1 -0
- package/.output/server/chunks/routes/api/plugins/client/_name_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/plugins/manifest.get.mjs +1 -0
- package/.output/server/chunks/routes/api/plugins/manifest.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/config.get.mjs +1 -0
- package/.output/server/chunks/routes/api/system/config.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/index.get.mjs +1 -0
- package/.output/server/chunks/routes/api/system/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/index.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/system/index.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/monitor/terminal/ws.mjs +1 -0
- 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 +1 -0
- package/.output/server/chunks/routes/api/system/monitor/terminate.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/monitor.get.mjs +1 -0
- package/.output/server/chunks/routes/api/system/monitor.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/settings/events.get.mjs +1 -0
- package/.output/server/chunks/routes/api/system/settings/events.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/settings/reset.post.mjs +1 -0
- package/.output/server/chunks/routes/api/system/settings/reset.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/_id_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/users/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/_id_.get.mjs +1 -0
- package/.output/server/chunks/routes/api/users/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/_id_.put.mjs +1 -0
- package/.output/server/chunks/routes/api/users/_id_.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/index.get.mjs +1 -0
- package/.output/server/chunks/routes/api/users/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/index.post.mjs +1 -0
- package/.output/server/chunks/routes/api/users/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/login.post.mjs +1 -0
- package/.output/server/chunks/routes/api/users/login.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/logout.post.mjs +1 -0
- package/.output/server/chunks/routes/api/users/logout.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/me.get.mjs +1 -0
- package/.output/server/chunks/routes/api/users/me.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/register.post.mjs +1 -0
- package/.output/server/chunks/routes/api/users/register.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/tokens/_id/token.get.mjs +1 -0
- package/.output/server/chunks/routes/api/users/tokens/_id/token.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/tokens/_id_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/users/tokens/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/tokens/_id_.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/users/tokens/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/_...path_.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/_...path_.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/send.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/a2a/send.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/approvals/_id/decide.post.mjs +1 -0
- 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 +1 -0
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.get.mjs +1 -0
- 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 +1 -0
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index2.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/agent-tools/index2.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/subscribe.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/agents/subscribe.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/approvals/_id/decide.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/approvals/_id/decide.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/character/_id_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/assets/character/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/assets/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index2.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/assets/index2.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/audit.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/audit.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/caller.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/caller.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +1 -0
- 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 +1 -0
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/from-channel.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channel-templates/from-channel.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/activate.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/activate.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/_memoryId_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/_memoryId_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/search.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/search.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/model.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/model.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/position.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/position.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/range.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/range.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/stop.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/stop.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/events.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/events.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs +1 -0
- 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 +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/index2.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index3.get.mjs +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/index4.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/queue.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/queue.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/test.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/_id/test.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/index.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs +31 -0
- package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index10.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index10.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index2.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index2.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index2.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index2.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index3.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index3.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index3.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index3.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index4.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index4.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index4.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index4.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index5.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index5.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index5.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index5.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index6.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index6.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index6.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index6.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index7.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index7.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index7.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index7.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index8.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index8.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index8.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index8.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index9.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/index9.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/mailbox/all.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/mailbox/all.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/mailbox.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/mailbox.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/memories/maintenance.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/memories/maintenance.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/plugins/index.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/plugins/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/runtime.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/runtime.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/scene/layouts.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/complete.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/tasks/_id/complete.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/dispatch.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/tasks/_id/dispatch.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/report.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/tasks/_id/report.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/tasks.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/deploy.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/teams/_id/deploy.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/members/_agentId_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/teams/_id/members/_agentId_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/teams/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.patch.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/teams/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/users/me.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/users/me.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/users/register.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/users/register.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/index.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/workspaces/index.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/renderer.mjs +1 -1
- package/.output/server/chunks/virtual/entry.mjs +287 -85
- package/.output/server/chunks/virtual/precomputed.mjs +1 -1
- package/.output/server/index.mjs +1 -0
- package/.output/server/package.json +1 -1
- package/README-zh.md +434 -430
- package/README.md +5 -1
- package/app/components/workshop/DeviceTwinPanel.vue +34 -0
- package/app/components/workshop/town/TownView.vue +5 -0
- package/app/composables/workshop/useDcwStream.ts +15 -1
- package/app/config/schema.ts +54 -0
- package/app/pages/dcw/[id].vue +57 -0
- package/app/pages/settings.vue +2 -1
- package/config.yml +58 -1
- package/i18n/dicts/_en.json +56 -2
- package/i18n/dicts/dcwDetail.json +9 -1
- package/i18n/dicts/deviceTwinPanel.json +2 -1
- package/i18n/dicts/settings.json +48 -1
- package/i18n/locales/en.ts +139 -38
- package/i18n/locales/zh-CN.ts +139 -38
- package/package.json +1 -1
- package/scripts/_dbg-agent-dcw-rw.ts +131 -0
- package/scripts/_dbg-config-smoke.ts +28 -0
- package/scripts/_dbg-dcw-read-rest.mjs +103 -0
- package/scripts/_dbg-dcw-read-toolface.ts +13 -0
- package/scripts/_dbg-dcw-read-ui.mjs +74 -0
- package/scripts/_dbg-plugin-ui-wizard.mjs +125 -0
- package/scripts/test-config-precedence.ts +124 -0
- package/scripts/test-dcw-read.ts +153 -0
- package/server/api/workshop/dcw/[id]/read.post.ts +18 -0
- package/server/api/workshop/ws.ts +6 -4
- package/server/data/daqs.json +55 -9
- package/server/data/dcw-rollback.json +221 -1
- package/server/data/dcw-runs.json +41 -18
- package/server/data/dcw-writes.json +264 -0
- package/server/data/dcws.json +646 -4
- package/server/data/line-runs.json +12 -1
- package/server/plugins/backup.ts +7 -5
- package/server/plugins/retention.ts +59 -57
- package/server/plugins/workshop.ts +5 -4
- package/server/services/workshop/agents/industrial-tools.ts +50 -1
- package/server/services/workshop/agents/omp-agent.ts +10 -8
- package/server/services/workshop/agents/tool-approvals.ts +175 -174
- package/server/services/workshop/daq/alarm-notify.ts +102 -100
- package/server/services/workshop/daq/bus/mqtt.adapter.ts +14 -15
- package/server/services/workshop/daq/storage/sqlite.adapter.ts +5 -4
- package/server/services/workshop/daq/storage/timescale.adapter.ts +5 -4
- package/server/services/workshop/db/retention.ts +49 -50
- package/server/services/workshop/dcw/dcw-controller.ts +56 -1
- package/server/services/workshop/dcw/dcw-node.ts +233 -200
- package/server/services/workshop/dcw/dcw-runtime.ts +46 -9
- package/server/services/workshop/dcw/drivers.ts +98 -0
- package/server/services/workshop/dcw/recipe-rollback-manager.ts +16 -15
- package/server/services/workshop/logger.ts +65 -58
- package/server/services/workshop/runtime/embedding-provider.ts +9 -5
- package/server/services/workshop/runtime/manager.ts +16 -7
- package/server/services/workshop/runtime/memory.ts +14 -7
- package/server/services/workshop/settings.ts +143 -0
- package/shared/config/engine.mjs +14 -2
- package/shared/config/schema.json +48 -1
- package/shared/dcw-protocol.ts +21 -0
- package/.output/public/_nuxt/BD9D9pl4.js +0 -1
- package/.output/public/_nuxt/BxD8Fg_Z.js +0 -2
- package/.output/public/_nuxt/CwcOEM8m.js +0 -1
- package/.output/public/_nuxt/TownView.CI2Wpzty.css +0 -1
- package/.output/public/_nuxt/_id_.Ci4u30cR.css +0 -1
- package/.output/public/_nuxt/builds/meta/221de779-a113-4232-b9a1-31a614f5e3c7.json +0 -1
- package/.output/public/_nuxt/settings.BG0K9_MG.css +0 -1
- package/.output/server/chunks/build/_id_-CmKAEFHV.mjs.map +0 -1
- package/.output/server/chunks/build/_id_-xR3AChMO.mjs.map +0 -1
- package/.output/server/chunks/build/daq-Boz_dlAQ.mjs.map +0 -1
- package/.output/server/chunks/build/dcw-wTRwBAUi.mjs.map +0 -1
- package/.output/server/chunks/build/logs-Cdi-eXlN.mjs.map +0 -1
- package/.output/server/chunks/build/pages-bWKy0ZsA.mjs.map +0 -1
- package/.output/server/chunks/build/settings-C3T5hR2A.mjs.map +0 -1
- package/.output/server/chunks/build/town-CKg6Qxba.mjs.map +0 -1
- package/.output/server/chunks/build/useDcwStream-BkWDGaWp.mjs.map +0 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DCW 读写集成 E2E(真实 dev server):
|
|
3
|
+
* ①mock 驱动手动读写闭环(读随写变) ②标定 transform 物理域往返
|
|
4
|
+
* ③周期读服务端调度(不手动读,等节点自己读) ④真实 Modbus TCP(127.0.0.1:1502 从站,
|
|
5
|
+
* 40021 保持寄存器 float32 大端)写→读 roundtrip ×2 ⑤视图字段/视图列表收敛。
|
|
6
|
+
* 运行: node scripts/_dbg-dcw-read-rest.mjs(CLEANUP=1 结束后清理测试节点)
|
|
7
|
+
*/
|
|
8
|
+
const ROOT = process.env.E2E_ROOT ?? 'http://127.0.0.1:3000'
|
|
9
|
+
const CLEANUP = process.env.CLEANUP === '1'
|
|
10
|
+
const sleep = ms => new Promise(r => setTimeout(r, ms))
|
|
11
|
+
let failed = 0
|
|
12
|
+
const check = (name, cond, detail = '') => { console.log(` ${cond ? 'PASS' : 'FAIL'} ${name}${detail ? ` — ${detail}` : ''}`); if (!cond) failed++ }
|
|
13
|
+
|
|
14
|
+
const login = await fetch(`${ROOT}/api/users/login`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ email: 'zhangwei@awshop.io', password: 'Awshop@123' }) }).then(r => r.json())
|
|
15
|
+
const H = { authorization: `Bearer ${login.data.token}`, 'content-type': 'application/json' }
|
|
16
|
+
const j = (u, m = 'GET', b) => fetch(ROOT + u, { method: m, headers: H, body: b ? JSON.stringify(b) : undefined }).then(r => r.json())
|
|
17
|
+
const nodesOf = async () => (await j('/api/workshop/dcw')).data.nodes
|
|
18
|
+
const nodeView = async (id) => (await nodesOf()).find(n => n.id === id)
|
|
19
|
+
const write = (id, value) => j(`/api/workshop/dcw/${id}/write`, 'POST', { value }).then(r => r.data.outcome)
|
|
20
|
+
const read = (id) => j(`/api/workshop/dcw/${id}/read`, 'POST', {}).then(r => r.data.read)
|
|
21
|
+
|
|
22
|
+
const created = []
|
|
23
|
+
async function mkNode(name, extra) {
|
|
24
|
+
const node = (await j('/api/workshop/dcw', 'POST', { templateRef: 'dcw-temp-sp', name, readIntervalMs: 0, ...extra })).data.node
|
|
25
|
+
created.push(node.id)
|
|
26
|
+
return node
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// 幂等清理:上一次异常中断残留的同名节点先删
|
|
30
|
+
for (const stale of (await nodesOf()).filter(n => n.name?.startsWith('读写验证·'))) {
|
|
31
|
+
await j(`/api/workshop/dcw/${stale.id}`, 'DELETE').catch(() => {})
|
|
32
|
+
}
|
|
33
|
+
// mock PLC 状态在服务进程内掉电保持(同真实寄存器):每次运行用独立 key 避免跨运行串扰
|
|
34
|
+
const RUN = Date.now().toString(36)
|
|
35
|
+
|
|
36
|
+
// ===== ① mock 手动读写闭环 =====
|
|
37
|
+
console.log('\n--- ① mock 手动读写闭环 ---')
|
|
38
|
+
{
|
|
39
|
+
const n = await mkNode('读写验证·mock 手动', { driver: 'mock', driverConfig: { key: `rw-e2e-1-${RUN}` } })
|
|
40
|
+
check('视图透出读字段(readValue/readIntervalMs/lastRead*)', 'readValue' in n && 'readIntervalMs' in n && 'lastReadAt' in n && 'lastReadError' in n)
|
|
41
|
+
const before = await read(n.id)
|
|
42
|
+
check('未写入时读取:如实报告失败(mock 无记录)', before.ok === false && before.value == null, before.message.slice(0, 50))
|
|
43
|
+
const w1 = await write(n.id, 165.5)
|
|
44
|
+
check('写 165.5 成功(回读一致)', w1.ok === true, w1.message.slice(0, 60))
|
|
45
|
+
const r1 = await read(n.id)
|
|
46
|
+
check('读回 = 刚写值(165.5)', r1.ok && Math.abs(r1.value - 165.5) < 0.01, `value=${r1.value}`)
|
|
47
|
+
await write(n.id, 180)
|
|
48
|
+
const r2 = await read(n.id)
|
|
49
|
+
check('再写 180 后读随写变', r2.ok && Math.abs(r2.value - 180) < 0.01, `value=${r2.value}`)
|
|
50
|
+
const v = await nodeView(n.id)
|
|
51
|
+
check('节点视图记账(readValue/lastReadAt/SET value)', Math.abs(v.readValue - 180) < 0.01 && v.lastReadAt != null && Math.abs(v.value - 180) < 0.01, `act=${v.readValue} set=${v.value}`)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ===== ② 标定 transform 物理域往返 =====
|
|
55
|
+
console.log('\n--- ② transform 物理域往返 ---')
|
|
56
|
+
{
|
|
57
|
+
const n = await mkNode('读写验证·标定×2', { driver: 'mock', driverConfig: { key: `rw-e2e-2-${RUN}` }, transform: { kind: 'linear', scale: 2, offset: 0 }, min: 0, max: 400 })
|
|
58
|
+
await write(n.id, 100)
|
|
59
|
+
const r = await read(n.id)
|
|
60
|
+
check('物理 100(PLC 50)写→读往返一致', r.ok && Math.abs(r.value - 100) < 0.01, `value=${r.value}(raw=${r.raw})`)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// ===== ③ 周期读服务端调度 =====
|
|
64
|
+
console.log('\n--- ③ 周期读调度(readIntervalMs=1000,不手动读) ---')
|
|
65
|
+
{
|
|
66
|
+
const n = await mkNode('读写验证·周期读', { driver: 'mock', driverConfig: { key: `rw-e2e-3-${RUN}` }, readIntervalMs: 1000 })
|
|
67
|
+
await write(n.id, 155)
|
|
68
|
+
check('写入后 SET 已记账', Math.abs((await nodeView(n.id)).value - 155) < 0.01)
|
|
69
|
+
await sleep(2600)
|
|
70
|
+
const v = await nodeView(n.id)
|
|
71
|
+
check('2.6s 内周期读自动回填 ACT(服务端调度)', Math.abs(v.readValue - 155) < 0.01 && v.lastReadAt != null, `act=${v.readValue} @${v.lastReadAt?.slice(11, 19)}`)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// ===== ④ 真实 Modbus TCP 读写 roundtrip =====
|
|
75
|
+
console.log('\n--- ④ 真实 Modbus TCP(1502 从站,float32 大端) ---')
|
|
76
|
+
{
|
|
77
|
+
const cfg = { host: '127.0.0.1', port: 1502, unitId: 1, register: 40021, dataType: 'float32', byteOrder: 'big' }
|
|
78
|
+
const n = await mkNode('读写验证·Modbus真实链路', { driver: 'modbus-tcp', driverConfig: cfg, min: 0, max: 300 })
|
|
79
|
+
const t = await j(`/api/workshop/dcw/${n.id}/test`, 'POST').then(r => r.data.test)
|
|
80
|
+
check('真实从站连接测试(40021 可访问)', t.ok === true, t.message.slice(0, 60))
|
|
81
|
+
const r0 = await read(n.id)
|
|
82
|
+
check('真实读:初始寄存器值(raw=0 → 0)', r0.ok && r0.raw != null, `raw=${r0.raw}`)
|
|
83
|
+
const w1 = await write(n.id, 3.1416)
|
|
84
|
+
check('真实写:3.1416 下发+同址回读一致', w1.ok === true, w1.message.slice(0, 70))
|
|
85
|
+
const r1 = await read(n.id)
|
|
86
|
+
check('真实读:寄存器回 3.1416(独立于写回读的第二笔读)', r1.ok && Math.abs(r1.raw - 3.1416) < 0.001, `raw=${r1.raw} eng=${r1.value}`)
|
|
87
|
+
const w2 = await write(n.id, 2.71828)
|
|
88
|
+
const r2 = await read(n.id)
|
|
89
|
+
check('第二轮写读:2.71828 roundtrip', w2.ok && r2.ok && Math.abs(r2.raw - 2.71828) < 0.001, `raw=${r2.raw}`)
|
|
90
|
+
const v = await nodeView(n.id)
|
|
91
|
+
check('真实节点视图 ACT 收敛(2.72 MPa? ℃模板域 150~200 → 用原始值展示)', v.readValue != null && v.lastReadAt != null, `act=${v.readValue} raw=${r2.raw}`)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// ===== 收尾 =====
|
|
95
|
+
if (CLEANUP) {
|
|
96
|
+
for (const id of created) await j(`/api/workshop/dcw/${id}`, 'DELETE').catch(() => {})
|
|
97
|
+
console.log(`(cleanup:${created.length} 个测试节点已删)`)
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
console.log(`(节点保留:${created.join(', ')};CLEANUP=1 可清理)`)
|
|
101
|
+
}
|
|
102
|
+
console.log(failed === 0 ? '\nDCW-READ-E2E ALL PASS' : `\nDCW-READ-E2E FAILED(${failed})`)
|
|
103
|
+
process.exit(failed === 0 ? 0 : 1)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 一次性检查:dcw_read 进入 hostToolsForRole 工具面(worker/lead)。
|
|
3
|
+
* 运行: npx tsx --tsconfig .nuxt/tsconfig.server.json scripts/_dbg-dcw-read-toolface.ts
|
|
4
|
+
*/
|
|
5
|
+
import { hostToolsForRole } from '../server/services/workshop/agents/omp-agent'
|
|
6
|
+
|
|
7
|
+
for (const role of ['worker', 'lead'] as const) {
|
|
8
|
+
const names = hostToolsForRole(role).map(t => t.name)
|
|
9
|
+
const hit = names.includes('dcw_read')
|
|
10
|
+
console.log(`${role}: dcw_read ${hit ? '在工具面' : '缺失!'}(${names.length} 个工具)`)
|
|
11
|
+
if (role === 'worker' && !hit) process.exit(1)
|
|
12
|
+
}
|
|
13
|
+
console.log('TOOLFACE PASS')
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DCW 读写集成 UI 目视验证:/dcw/[line] 节点表「PLC 读数」列(含真实 Modbus 节点)
|
|
3
|
+
* + /town 设备卡 ACT 读数行。截图落 .e2e-shots/。
|
|
4
|
+
* 运行: node scripts/_dbg-dcw-read-ui.mjs
|
|
5
|
+
*/
|
|
6
|
+
import puppeteer from 'puppeteer-core'
|
|
7
|
+
import { mkdirSync } from 'node:fs'
|
|
8
|
+
|
|
9
|
+
const ROOT = process.env.E2E_ROOT ?? 'http://127.0.0.1:3000'
|
|
10
|
+
const LINE = process.env.LINE ?? 'ln-af002514'
|
|
11
|
+
const DEV = '循环泵 #01'
|
|
12
|
+
const sleep = ms => new Promise(r => setTimeout(r, ms))
|
|
13
|
+
let failed = 0
|
|
14
|
+
const check = (name, cond, detail = '') => { console.log(` ${cond ? 'PASS' : 'FAIL'} ${name}${detail ? ` — ${detail}` : ''}`); if (!cond) failed++ }
|
|
15
|
+
const shot = async (page, name) => {
|
|
16
|
+
mkdirSync('.e2e-shots', { recursive: true })
|
|
17
|
+
await page.screenshot({ path: `.e2e-shots/${name}.png` })
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const login = await fetch(`${ROOT}/api/users/login`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ email: 'zhangwei@awshop.io', password: 'Awshop@123' }) }).then(r => r.json())
|
|
21
|
+
|
|
22
|
+
const browser = await puppeteer.launch({ executablePath: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', headless: 'new', args: ['--no-sandbox', '--disable-gpu', '--window-size=1600,1000'] })
|
|
23
|
+
const page = await browser.newPage()
|
|
24
|
+
await page.setViewport({ width: 1600, height: 1000 })
|
|
25
|
+
await page.setCookie({ name: 'token', value: login.data.token, domain: '127.0.0.1', path: '/' })
|
|
26
|
+
try {
|
|
27
|
+
// ① /dcw/[line] 节点表:PLC 读数列 + 读取按钮 + 各节点读数值
|
|
28
|
+
await page.goto(`${ROOT}/dcw/${LINE}`, { waitUntil: 'networkidle2', timeout: 90000 })
|
|
29
|
+
await page.waitForSelector('.nodes-table tbody tr', { timeout: 30000 })
|
|
30
|
+
await sleep(3000)
|
|
31
|
+
const head = await page.evaluate(() => [...document.querySelectorAll('.nodes-table th')].map(t => t.textContent.trim()))
|
|
32
|
+
check('①表头含「PLC 读数」列', head.some(t => t.includes('PLC 读数')), head.join('|'))
|
|
33
|
+
const rows = await page.evaluate(() => [...document.querySelectorAll('.nodes-table tbody tr')].map((tr) => {
|
|
34
|
+
const cells = [...tr.querySelectorAll('td')]
|
|
35
|
+
const name = tr.querySelector('td b')?.textContent?.trim() ?? ''
|
|
36
|
+
return { name, read: cells[4]?.textContent?.replace(/\s+/g, ' ').trim() ?? '', hasReadBtn: !!cells[4]?.querySelector('.read-btn') }
|
|
37
|
+
}).filter(r => r.name.includes('读写验证')))
|
|
38
|
+
check('①四个测试节点都在行内', rows.length >= 4, rows.map(r => `${r.name}:${r.read}`).join(' | ').slice(0, 160))
|
|
39
|
+
check('①行内有「读取」按钮', rows.every(r => r.hasReadBtn) && rows.length > 0)
|
|
40
|
+
check('①Modbus 真实节点 ACT 已回填', rows.some(r => r.name.includes('Modbus') && /\d/.test(r.read)), rows.find(r => r.name.includes('Modbus'))?.read)
|
|
41
|
+
await shot(page, 'dcw-line-read-column')
|
|
42
|
+
|
|
43
|
+
// ② 点「读取」按钮 → 读数刷新(手动读 UI 路径)
|
|
44
|
+
const btnOk = await page.evaluate(() => {
|
|
45
|
+
const row = [...document.querySelectorAll('.nodes-table tbody tr')].find(tr => tr.textContent?.includes('mock 手动'))
|
|
46
|
+
const btn = row?.querySelector('.read-btn')
|
|
47
|
+
if (!btn) return false
|
|
48
|
+
btn.click()
|
|
49
|
+
return true
|
|
50
|
+
})
|
|
51
|
+
await sleep(1500)
|
|
52
|
+
check('②点击「读取」按钮执行手动读', btnOk)
|
|
53
|
+
|
|
54
|
+
// ③ /town 设备卡:SET + ACT 两行实时
|
|
55
|
+
await page.goto(`${ROOT}/town`, { waitUntil: 'domcontentloaded', timeout: 90000 })
|
|
56
|
+
await sleep(20000)
|
|
57
|
+
const act = () => page.evaluate((dev) => {
|
|
58
|
+
const card = [...document.querySelectorAll('.twin-card')].find(c => c.querySelector('.twin-name')?.textContent?.includes(dev))
|
|
59
|
+
const items = card ? [...card.querySelectorAll('.dcw-item')].map(e => ({
|
|
60
|
+
set: e.querySelector('.dcw-set')?.textContent?.replace(/\s+/g, '') ?? '',
|
|
61
|
+
act: e.querySelector('.dcw-act b')?.textContent?.replace(/\s+/g, '') ?? null,
|
|
62
|
+
})) : []
|
|
63
|
+
return items
|
|
64
|
+
}, DEV)
|
|
65
|
+
const a1 = await act()
|
|
66
|
+
check('③/town 设备卡出现智控通道(SET)', a1.length > 0, JSON.stringify(a1).slice(0, 120))
|
|
67
|
+
check('③通道带 ACT 读数行', a1.some(r => r.act != null && /\d/.test(r.act)), JSON.stringify(a1.map(r => r.act)))
|
|
68
|
+
await shot(page, 'town-dcw-act')
|
|
69
|
+
}
|
|
70
|
+
finally {
|
|
71
|
+
await browser.close().catch(() => {})
|
|
72
|
+
}
|
|
73
|
+
console.log(failed === 0 ? '\nDCW-READ-UI ALL PASS' : `\nDCW-READ-UI FAILED(${failed})`)
|
|
74
|
+
process.exit(failed === 0 ? 0 : 1)
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件扩展验证 D(浏览器 UI 真实操作):/daq 新增节点向导选择插件模板 →
|
|
3
|
+
* 通过 UI 建节点 → 列表行实时值流入 → /town 孪生面板出现该节点。
|
|
4
|
+
* 截图落 .e2e-shots/(向导/列表/孪生);节点保留(CLEANUP=1 删除)。
|
|
5
|
+
* 运行: node scripts/_dbg-plugin-ui-wizard.mjs
|
|
6
|
+
*/
|
|
7
|
+
import puppeteer from 'puppeteer-core'
|
|
8
|
+
import { mkdirSync, writeFileSync } from 'node:fs'
|
|
9
|
+
|
|
10
|
+
const ROOT = process.env.E2E_ROOT ?? 'http://127.0.0.1:3000'
|
|
11
|
+
const CLEANUP = process.env.CLEANUP === '1'
|
|
12
|
+
const NODE_NAME = process.env.NODE_NAME ?? 'UI向导插件验证'
|
|
13
|
+
const sleep = ms => new Promise(r => setTimeout(r, ms))
|
|
14
|
+
let failed = 0
|
|
15
|
+
const check = (name, cond, detail = '') => { console.log(` ${cond ? 'PASS' : 'FAIL'} ${name}${detail ? ` — ${detail}` : ''}`); if (!cond) failed++ }
|
|
16
|
+
const shot = async (page, name) => {
|
|
17
|
+
mkdirSync('.e2e-shots', { recursive: true })
|
|
18
|
+
await page.screenshot({ path: `.e2e-shots/${name}.png` })
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const login = await fetch(`${ROOT}/api/users/login`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ email: 'zhangwei@awshop.io', password: 'Awshop@123' }) }).then(r => r.json())
|
|
22
|
+
const H = { authorization: `Bearer ${login.data.token}`, 'content-type': 'application/json' }
|
|
23
|
+
const j = (u, m = 'GET', b) => fetch(ROOT + u, { method: m, headers: H, body: b ? JSON.stringify(b) : undefined }).then(r => r.json())
|
|
24
|
+
|
|
25
|
+
const browser = await puppeteer.launch({ executablePath: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', headless: 'new', args: ['--no-sandbox', '--disable-gpu', '--window-size=1600,1000'] })
|
|
26
|
+
const page = await browser.newPage()
|
|
27
|
+
await page.setViewport({ width: 1600, height: 1000 })
|
|
28
|
+
await page.setCookie({ name: 'token', value: login.data.token, domain: '127.0.0.1', path: '/' })
|
|
29
|
+
let createdNodeId = null
|
|
30
|
+
try {
|
|
31
|
+
// ① 打开 /daq → 点「添加节点」→ 向导弹出
|
|
32
|
+
await page.goto(`${ROOT}/daq`, { waitUntil: 'networkidle2', timeout: 90000 })
|
|
33
|
+
await page.waitForSelector('tbody tr', { timeout: 30000 })
|
|
34
|
+
await page.click('button.aw-pill.add-btn:not(.outline)')
|
|
35
|
+
await page.waitForSelector('.modal .f-grid select.inp', { timeout: 15000 })
|
|
36
|
+
|
|
37
|
+
// ② 模板下拉含插件模板(服务端目录直出)
|
|
38
|
+
const opts = await page.$$eval('.modal .f-grid select.inp option', os => os.map(o => ({ v: o.value, t: o.textContent.replace(/\s+/g, ' ').trim() })))
|
|
39
|
+
const plugOpt = opts.find(o => o.v === 'plug-verify-x2-profile')
|
|
40
|
+
check('①向导模板下拉含插件模板', plugOpt != null, plugOpt?.t ?? `共 ${opts.length} 项`)
|
|
41
|
+
check('①插件模板带自定义标记(非内置)', plugOpt != null && /自定义|插件/.test(plugOpt.t), plugOpt?.t)
|
|
42
|
+
|
|
43
|
+
// ③ 选中插件模板 → 命名 → 截图 → UI 保存
|
|
44
|
+
await page.select('.modal .f-grid select.inp', 'plug-verify-x2-profile')
|
|
45
|
+
await page.type('.modal input.inp', NODE_NAME)
|
|
46
|
+
await shot(page, 'wizard-plugin-template')
|
|
47
|
+
await page.click('.m-actions button.aw-pill:not(.outline)')
|
|
48
|
+
await sleep(4000)
|
|
49
|
+
|
|
50
|
+
// ③b 行内产线下拉挂到运行中的产线(采集是配方驱动的:未分配不采样)
|
|
51
|
+
const ctxFile = await import('node:fs')
|
|
52
|
+
const runLine = process.env.RUN_LINE ?? JSON.parse(ctxFile.readFileSync('.e2e-plugin-ctx.json', 'utf-8')).lineId
|
|
53
|
+
const lineName = ((await j('/api/workshop/dcw')).data.lines ?? []).find(l => l.id === runLine)?.name
|
|
54
|
+
const lineOpts = await page.evaluate((nm) => {
|
|
55
|
+
const row = [...document.querySelectorAll('tbody tr')].find(r => r.textContent?.includes(nm))
|
|
56
|
+
const sel = row?.querySelector('select.line-sel')
|
|
57
|
+
return sel ? Array.from(sel.options).map(o => ({ v: o.value, t: o.textContent.trim() })) : null
|
|
58
|
+
}, NODE_NAME)
|
|
59
|
+
const lineOpt = (lineOpts ?? []).find(o => o.t === lineName)
|
|
60
|
+
check('③b 行内产线下拉含运行中产线', lineOpt != null, `${lineName} 选项=${lineOpt?.v ?? '无'}`)
|
|
61
|
+
// puppeteer 的 page.select 需要全局选择器:行内直接派发 change 更稳
|
|
62
|
+
await page.evaluate((nm, lineId) => {
|
|
63
|
+
const row = [...document.querySelectorAll('tbody tr')].find(r => r.textContent?.includes(nm))
|
|
64
|
+
const sel = row?.querySelector('select.line-sel')
|
|
65
|
+
if (!sel) throw new Error('行内无产线下拉')
|
|
66
|
+
sel.value = lineId
|
|
67
|
+
sel.dispatchEvent(new Event('change', { bubbles: true }))
|
|
68
|
+
}, NODE_NAME, runLine)
|
|
69
|
+
await sleep(2500)
|
|
70
|
+
|
|
71
|
+
// ④ 列表行出现且实时值流入(WS 帧驱动)
|
|
72
|
+
const rowVal = () => page.evaluate((nm) => {
|
|
73
|
+
const row = [...document.querySelectorAll('tbody tr')].find(r => r.textContent?.includes(nm))
|
|
74
|
+
const m = row?.textContent?.match(/(\d+\.\d+)\s*mm/)
|
|
75
|
+
return { v: m ? m[1] : null, row: row?.textContent?.replace(/\s+/g, ' ').slice(0, 120) ?? '' }
|
|
76
|
+
}, NODE_NAME)
|
|
77
|
+
const r1 = await rowVal()
|
|
78
|
+
await sleep(5000)
|
|
79
|
+
const r2 = await rowVal()
|
|
80
|
+
check('④UI 建出的插件节点出现在列表', r1.v != null, r1.row)
|
|
81
|
+
check('④列表实时值变化(帧流入)', r1.v != null && r2.v != null && r1.v !== r2.v, `${r1.v} → ${r2.v}`)
|
|
82
|
+
await shot(page, 'daq-list-plugin-node')
|
|
83
|
+
const nodes = (await j('/api/workshop/daq')).data.nodes
|
|
84
|
+
createdNodeId = nodes.find(n => n.name === NODE_NAME)?.id ?? null
|
|
85
|
+
|
|
86
|
+
// ④b 行内设备下拉绑定设备(孪生面板按设备挂数采项)
|
|
87
|
+
const devOpt = await page.evaluate((nm) => {
|
|
88
|
+
const row = [...document.querySelectorAll('tbody tr')].find(r => r.textContent?.includes(nm))
|
|
89
|
+
const sel = row?.querySelectorAll('select.line-sel')[1]
|
|
90
|
+
const first = sel?.querySelector('option[value]:not([value=""])')
|
|
91
|
+
if (!sel || !first) return null
|
|
92
|
+
sel.value = first.value
|
|
93
|
+
sel.dispatchEvent(new Event('change', { bubbles: true }))
|
|
94
|
+
return { v: first.value, t: first.textContent.trim() }
|
|
95
|
+
}, NODE_NAME)
|
|
96
|
+
check('④b 行内绑定设备(第一可绑定项)', devOpt != null, devOpt ? `${devOpt.t}(${devOpt.v})` : '无可绑定设备')
|
|
97
|
+
await sleep(2000)
|
|
98
|
+
|
|
99
|
+
// ⑤ /town 孪生面板出现该节点且实时
|
|
100
|
+
await page.goto(`${ROOT}/town`, { waitUntil: 'domcontentloaded', timeout: 90000 })
|
|
101
|
+
await sleep(20000)
|
|
102
|
+
// 面板项显示模板通道名(d.ch),节点挂在绑定设备卡下 → 按「设备卡 + 通道名」定位
|
|
103
|
+
const panel = () => page.evaluate(() => {
|
|
104
|
+
const card = [...document.querySelectorAll('.twin-card')].find(c => c.querySelector('.twin-name')?.textContent?.includes('循环泵 #01'))
|
|
105
|
+
const item = card ? [...card.querySelectorAll('.daq-item')].find(e => e.textContent?.includes('标定轮廓')) : null
|
|
106
|
+
return { card: !!card, text: item?.textContent?.replace(/\s+/g, '') ?? '', val: item?.querySelector('b')?.textContent?.replace(/\s+/g, '') ?? null }
|
|
107
|
+
})
|
|
108
|
+
const p1 = await panel()
|
|
109
|
+
await sleep(5000)
|
|
110
|
+
const p2 = await panel()
|
|
111
|
+
check('⑤/town 设备卡(循环泵 #01)出现', p1.card)
|
|
112
|
+
check('⑤/town 孪生面板出现插件节点通道(标定轮廓)', p1.text !== '', p1.text.slice(0, 60))
|
|
113
|
+
check('⑤/town 面板实时值变化', p1.val != null && p2.val != null && p1.val !== p2.val, `${p1.val} → ${p2.val}`)
|
|
114
|
+
await shot(page, 'town-panel-plugin-node')
|
|
115
|
+
}
|
|
116
|
+
finally {
|
|
117
|
+
await browser.close().catch(() => {})
|
|
118
|
+
if (CLEANUP && createdNodeId) {
|
|
119
|
+
await j(`/api/workshop/daq/${createdNodeId}`, 'DELETE').catch(() => {})
|
|
120
|
+
console.log(`(cleanup:节点 ${createdNodeId} 已删)`)
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
writeFileSync('.e2e-plugin-ui-node.json', JSON.stringify({ nodeId: createdNodeId, name: NODE_NAME }))
|
|
124
|
+
console.log(failed === 0 ? '\nSTACK-D ALL PASS' : `\nSTACK-D FAILED(${failed})`)
|
|
125
|
+
process.exit(failed === 0 ? 0 : 1)
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 配置驱动回归:优先级链(env > runtime-settings > config.yml > 描述符默认)+
|
|
3
|
+
* 历史别名兼容 + 项目级(.AgentWorkShop)优先/用户级(~/.AgentWorkShop)兜底的路径判定。
|
|
4
|
+
* 运行: npx tsx --tsconfig .nuxt/tsconfig.server.json scripts/test-config-precedence.ts
|
|
5
|
+
*/
|
|
6
|
+
import { mkdirSync, rmSync, writeFileSync } from 'node:fs'
|
|
7
|
+
import { tmpdir } from 'node:os'
|
|
8
|
+
import { join } from 'node:path'
|
|
9
|
+
|
|
10
|
+
let failures = 0
|
|
11
|
+
const check = (name: string, ok: boolean, detail = ''): void => {
|
|
12
|
+
console.log(` ${ok ? 'PASS' : 'FAIL'} ${name}${detail ? ` — ${detail}` : ''}`)
|
|
13
|
+
if (!ok) failures += 1
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const root = mkdtemp()
|
|
17
|
+
function mkdtemp(): string {
|
|
18
|
+
return rm0(join(tmpdir(), 'aw-cfg-prec-'))
|
|
19
|
+
function rm0(p: string): string {
|
|
20
|
+
const dir = `${p}${Math.random().toString(36).slice(2, 8)}`
|
|
21
|
+
mkdirSync(dir, { recursive: true })
|
|
22
|
+
return dir
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const engine = await import('../shared/config/engine.mjs')
|
|
27
|
+
const { loadDescriptors, envOverridesFromEnv, loadEffective } = engine as unknown as {
|
|
28
|
+
loadDescriptors: () => Array<Record<string, unknown>>
|
|
29
|
+
envOverridesFromEnv: (env: Record<string, string | undefined>, d?: unknown) => Record<string, unknown>
|
|
30
|
+
loadEffective: (o: { configPath?: string, settingsPath?: string, env?: Record<string, string | undefined> }) => { effective: Record<string, unknown>, sources: Record<string, string> }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// ===== 1. 描述符完整性:每个键都有 default + labelKey;别名唯一 =====
|
|
34
|
+
{
|
|
35
|
+
const descs = loadDescriptors() as Array<{ key: string, default?: unknown, labelKey?: string, aliases?: string[] }>
|
|
36
|
+
check(`描述符规模(≥62 键,当前 ${descs.length})`, descs.length >= 62)
|
|
37
|
+
check('全部键带 default 与 labelKey', descs.every(d => d.default !== undefined && !!d.labelKey))
|
|
38
|
+
const seen = new Map<string, string>()
|
|
39
|
+
let dup = ''
|
|
40
|
+
for (const d of descs) {
|
|
41
|
+
for (const a of [d.key, ...(d.aliases ?? [])].map(x => x.toUpperCase())) {
|
|
42
|
+
if (seen.has(a) && seen.get(a) !== d.key) dup = `${a}:${seen.get(a)}&${d.key}`
|
|
43
|
+
seen.set(a, d.key)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
check('键+别名无冲突', dup === '')
|
|
47
|
+
// 新迁移组抽查
|
|
48
|
+
const keys = new Set(descs.map(d => d.key))
|
|
49
|
+
for (const k of ['memory.inject_total', 'omp.compact_enabled', 'dcw.rollback_stale_ms', 'backup.keep', 'retention.audit_days', 'log.level', 'daq.mqtt.qos', 'daq.frameRetentionH', 'security.hitl_timeout_ms', 'workshop.idle_grace_ms']) {
|
|
50
|
+
if (!keys.has(k)) {
|
|
51
|
+
check(`迁移键 ${k} 已注册`, false)
|
|
52
|
+
failures++
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
check('迁移键抽查全部注册', true)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ===== 2. env 覆盖:AW_<KEY> 自动名 + 历史别名 =====
|
|
59
|
+
{
|
|
60
|
+
const o = envOverridesFromEnv({
|
|
61
|
+
AW_MEMORY_INJECT_TOTAL: '800',
|
|
62
|
+
DAQ_FRAME_RETENTION_H: '999', // 历史别名(无 AW_ 前缀)
|
|
63
|
+
RETENTION_DISABLED: '1', // 历史别名(boolean "1")
|
|
64
|
+
AWSHOP_LOG_LEVEL: 'warn',
|
|
65
|
+
})
|
|
66
|
+
check('AW_<KEY> 自动名覆盖', o['memory.inject_total'] === 800)
|
|
67
|
+
check('历史别名:DAQ_FRAME_RETENTION_H', o['daq.frameRetentionH'] === 999)
|
|
68
|
+
check('历史别名 boolean "1"', o['retention.disabled'] === true)
|
|
69
|
+
check('历史别名:AWSHOP_LOG_LEVEL', o['log.level'] === 'warn')
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// ===== 3. 完整优先级链:env > runtime-settings > config.yml > 描述符默认 =====
|
|
73
|
+
{
|
|
74
|
+
const configPath = join(root, 'config.yml')
|
|
75
|
+
const settingsPath = join(root, 'runtime-settings.json')
|
|
76
|
+
writeFileSync(configPath, [
|
|
77
|
+
'memory:',
|
|
78
|
+
' primer_tokens: 111',
|
|
79
|
+
'backup:',
|
|
80
|
+
' keep: 5',
|
|
81
|
+
'log:',
|
|
82
|
+
' level: warn',
|
|
83
|
+
].join('\n'))
|
|
84
|
+
writeFileSync(settingsPath, JSON.stringify({ version: 1, overrides: { 'memory.primer_tokens': 222 } }))
|
|
85
|
+
const eff = loadEffective({ configPath, settingsPath, env: { AW_MEMORY_INJECT_TOTAL: '800', BACKUP_KEEP: '3' } })
|
|
86
|
+
check('env 胜 runtime(memory.inject_total=800)', eff.effective['memory.inject_total'] === 800 && eff.sources['memory.inject_total'] === 'env')
|
|
87
|
+
check('runtime 胜 config.yml(memory.primer_tokens=222)', eff.effective['memory.primer_tokens'] === 222 && eff.sources['memory.primer_tokens'] === 'runtime')
|
|
88
|
+
check('config.yml 胜默认(log.level=warn)', eff.effective['log.level'] === 'warn' && eff.sources['log.level'] === 'config.yml')
|
|
89
|
+
check('描述符默认兜底(dcw.rollback_cooldown_ms=300000)', eff.effective['dcw.rollback_cooldown_ms'] === 300000)
|
|
90
|
+
check('别名 env 胜 config.yml(backup.keep=3)', eff.effective['backup.keep'] === 3 && eff.sources['backup.keep'] === 'env')
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// ===== 4. 项目级优先 / 用户级兜底(resolveRunMode 路径判定) =====
|
|
94
|
+
{
|
|
95
|
+
const home = await import('../shared/config/home.mjs') as unknown as {
|
|
96
|
+
resolveRunMode: (o: { cwd: string, packageRoot?: string, env?: Record<string, string | undefined> }) => { mode: string, configRoot: string, dataDir: string, configPath: string, settingsPath: string }
|
|
97
|
+
awHome: (env?: Record<string, string | undefined>) => string
|
|
98
|
+
ensureDataDir: (cwd?: string, env?: Record<string, string | undefined>) => string
|
|
99
|
+
}
|
|
100
|
+
// ④a 项目级:cwd 下存在 .AgentWorkShop → 用它(最高优先)
|
|
101
|
+
const proj = join(root, 'proj')
|
|
102
|
+
mkdirSync(join(proj, '.AgentWorkShop'), { recursive: true })
|
|
103
|
+
const m1 = home.resolveRunMode({ cwd: proj, packageRoot: join(root, 'pkg') })
|
|
104
|
+
check('④项目级 .AgentWorkShop 优先', m1.mode === 'repo' && m1.configRoot === join(proj, '.AgentWorkShop'), m1.configRoot)
|
|
105
|
+
|
|
106
|
+
// ④b 用户级兜底:检出内无 ./.AgentWorkShop → 数据落 ~/.AgentWorkShop(AW_HOME 可重定向)
|
|
107
|
+
const fakeHome = join(root, 'fake-home')
|
|
108
|
+
const m2 = home.resolveRunMode({ cwd: join(root, 'empty-cwd'), packageRoot: join(root, 'pkg'), env: { AW_HOME: fakeHome } })
|
|
109
|
+
check('④无项目根 → 用户级兜底 ~/.AgentWorkShop(AW_HOME)', m2.configRoot === fakeHome, m2.configRoot)
|
|
110
|
+
mkdirSync(fakeHome, { recursive: true })
|
|
111
|
+
const dataDir = home.ensureDataDir(join(root, 'empty-cwd'), { AW_HOME: fakeHome })
|
|
112
|
+
check('④ensureDataDir 初始化创建 <home>/data', dataDir === join(fakeHome, 'data'), dataDir)
|
|
113
|
+
|
|
114
|
+
// ④c home 模式(AW_MODE=home,全局安装载荷):强制用户级
|
|
115
|
+
const m3 = home.resolveRunMode({ cwd: proj, packageRoot: join(root, 'pkg'), env: { AW_MODE: 'home', AW_HOME: fakeHome } })
|
|
116
|
+
check('④AW_MODE=home 强制用户级(项目 .AgentWorkShop 不采用)', m3.mode === 'home' && m3.configRoot === fakeHome)
|
|
117
|
+
|
|
118
|
+
// ④d 默认 awHome = ~/.AgentWorkShop
|
|
119
|
+
check('④awHome 默认 ~/.AgentWorkShop', /AgentWorkShop$/.test(home.awHome({})) === true, home.awHome({}))
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
rmSync(root, { recursive: true, force: true })
|
|
123
|
+
console.log(failures === 0 ? '\nCONFIG-PRECEDENCE ALL PASS' : `\nCONFIG-PRECEDENCE FAILED(${failures})`)
|
|
124
|
+
process.exit(failures === 0 ? 0 : 1)
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DCW 读写集成单元测试:驱动 read 原语(mock/modbus 形态判定)/工程量↔原始值对称映射/
|
|
3
|
+
* 节点读状态记账/运行时周期读调度/手动读取/Agent dcw_read 工具(鉴权+执行,AW_HOME 隔离)。
|
|
4
|
+
* 运行: AW_MODE=home AW_HOME=<tmp> npx tsx --tsconfig .nuxt/tsconfig.server.json scripts/test-dcw-read.ts
|
|
5
|
+
*/
|
|
6
|
+
import { mkdtempSync, rmSync } from 'node:fs'
|
|
7
|
+
import { tmpdir } from 'node:os'
|
|
8
|
+
import { join } from 'node:path'
|
|
9
|
+
|
|
10
|
+
// 工具段需要文件型仓库:整体进程重定向到一次性配置根(避免触碰检出内 .AgentWorkShop)
|
|
11
|
+
const awHome = mkdtempSync(join(tmpdir(), 'aw-dcw-read-'))
|
|
12
|
+
process.env.AW_MODE = 'home'
|
|
13
|
+
process.env.AW_HOME = awHome
|
|
14
|
+
|
|
15
|
+
let failures = 0
|
|
16
|
+
function check(name: string, ok: boolean, detail = ''): void {
|
|
17
|
+
console.log(` ${ok ? 'PASS' : 'FAIL'} ${name}${detail ? ` — ${detail}` : ''}`)
|
|
18
|
+
if (!ok) failures += 1
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// ===== 1. 驱动 read 原语 =====
|
|
22
|
+
console.log('\n--- 驱动 read 原语 ---')
|
|
23
|
+
{
|
|
24
|
+
const { mockDcwDriver, supportsDcwRead } = await import('../server/services/workshop/dcw/drivers')
|
|
25
|
+
const domain = { min: 0, max: 300 }
|
|
26
|
+
const w = await mockDcwDriver.write({ eng: 165, tolerance: 0.1, domain, driverConfig: { key: 't1' } })
|
|
27
|
+
check('mock 写入成功', w.ok)
|
|
28
|
+
const r = await mockDcwDriver.read!({ domain, driverConfig: { key: 't1' } })
|
|
29
|
+
check('mock 读回写值(读写闭环)', r.ok && r.eng === 165 && r.raw === 165, `eng=${r.eng}`)
|
|
30
|
+
const miss = await mockDcwDriver.read!({ domain, driverConfig: { key: 'never-written' } })
|
|
31
|
+
check('mock 未写地址读取明确失败', !miss.ok && miss.eng == null)
|
|
32
|
+
check('读能力判定:mock/modbus-tcp/modbus-rtu/opcua 可读,mqtt/http 不可读',
|
|
33
|
+
supportsDcwRead('mock') && supportsDcwRead('modbus-tcp') && supportsDcwRead('modbus-rtu') && supportsDcwRead('opcua')
|
|
34
|
+
&& !supportsDcwRead('mqtt') && !supportsDcwRead('http'))
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// ===== 2. 工程量↔原始值映射对称 =====
|
|
38
|
+
console.log('\n--- 工程量↔原始值映射 ---')
|
|
39
|
+
{
|
|
40
|
+
const { engToRaw, rawToEng } = await import('../server/services/workshop/dcw/drivers')
|
|
41
|
+
const input = { eng: 50, tolerance: 0, domain: { min: 0, max: 100 }, driverConfig: { rawMin: 0, rawMax: 16383, engMin: 0, engMax: 100 } }
|
|
42
|
+
const raw = engToRaw(50, input)
|
|
43
|
+
check('线性映射:eng 50 → raw 8191.5', Math.abs(raw - 8191.5) < 1e-9, String(raw))
|
|
44
|
+
check('映射对称:rawToEng(engToRaw(x)) = x', Math.abs(rawToEng(raw, input) - 50) < 1e-9)
|
|
45
|
+
const pass = { eng: 7, tolerance: 0, domain: { min: 0, max: 100 }, driverConfig: {} }
|
|
46
|
+
check('无原始量程:直传(float32 语义)', engToRaw(7, pass) === 7 && rawToEng(7, pass) === 7)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ===== 3. 节点读状态记账 =====
|
|
50
|
+
console.log('\n--- 节点读状态 ---')
|
|
51
|
+
{
|
|
52
|
+
const { DcwNode } = await import('../server/services/workshop/dcw/dcw-node')
|
|
53
|
+
const n = new DcwNode({ id: 'dw-t1', templateRef: 'dcw-temp-sp', readIntervalMs: 2000 })
|
|
54
|
+
const at = new Date().toISOString()
|
|
55
|
+
n.applyReadResult(168.456, 168.456, true, '读回', at)
|
|
56
|
+
check('成功读数回填(按 decimals 取整)', n.readValue === 168.5 && n.lastReadAt === at && n.lastReadError == null, `readValue=${n.readValue}`)
|
|
57
|
+
n.applyReadResult(null, null, false, '链路超时', new Date().toISOString())
|
|
58
|
+
check('失败读保留旧值并记原因', n.readValue === 168.5 && n.lastReadError === '链路超时')
|
|
59
|
+
n.applyReadResult(170, 170, true, '读回', new Date().toISOString())
|
|
60
|
+
check('恢复成功后清空错误', n.readValue === 170 && n.lastReadError == null)
|
|
61
|
+
const row = n.toRow()
|
|
62
|
+
const n2 = DcwNode.fromRow(row)
|
|
63
|
+
check('持久化 roundtrip(readIntervalMs/readValue/lastRead*)', n2.readIntervalMs === 2000 && n2.readValue === 170 && n2.lastReadError == null)
|
|
64
|
+
const v = n2.toView()
|
|
65
|
+
check('视图透出读字段', v.readValue === 170 && v.readIntervalMs === 2000 && 'lastReadError' in v)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// ===== 4. 运行时周期读调度 =====
|
|
69
|
+
console.log('\n--- 运行时周期读调度 ---')
|
|
70
|
+
{
|
|
71
|
+
const { DcwNode } = await import('../server/services/workshop/dcw/dcw-node')
|
|
72
|
+
const rtMod = await import('../server/services/workshop/dcw/dcw-runtime')
|
|
73
|
+
const { DcwNodeRuntime } = rtMod
|
|
74
|
+
type DcwRuntimeHost = import('../server/services/workshop/dcw/dcw-runtime').DcwRuntimeHost
|
|
75
|
+
type DcwNodeT = import('../server/services/workshop/dcw/dcw-node').DcwNode
|
|
76
|
+
const reads: number[] = []
|
|
77
|
+
const atNow = () => new Date().toISOString()
|
|
78
|
+
// 记账语义与控制器一致:读成功回填节点 readValue
|
|
79
|
+
const makeHost = (defaults: { holdIntervalMs: number, readIntervalMs: number }): DcwRuntimeHost => ({
|
|
80
|
+
running: () => true,
|
|
81
|
+
defaults: () => defaults,
|
|
82
|
+
executeWrite: async () => ({ ok: true, message: '', raw: null, readback: null }),
|
|
83
|
+
executeRead: async (node: DcwNodeT) => {
|
|
84
|
+
reads.push(Date.now())
|
|
85
|
+
node.applyReadResult(1, 1, true, '读回', atNow())
|
|
86
|
+
return { ok: true, value: 1, raw: 1, message: '', at: atNow() }
|
|
87
|
+
},
|
|
88
|
+
})
|
|
89
|
+
const n = new DcwNode({ id: 'dw-t2', templateRef: 'dcw-temp-sp', readIntervalMs: 1000 })
|
|
90
|
+
const rt = new DcwNodeRuntime(n, makeHost({ holdIntervalMs: 0, readIntervalMs: 5000 }))
|
|
91
|
+
const t0 = 1_000_000
|
|
92
|
+
rt.tick(t0)
|
|
93
|
+
rt.tick(t0 + 500)
|
|
94
|
+
rt.tick(t0 + 1100)
|
|
95
|
+
check('周期读按 readIntervalMs 节拍触发(两次窗内各一次)', reads.length === 2, `reads=${reads.length}`)
|
|
96
|
+
check('写心跳不触发(value=null)', reads.length === 2)
|
|
97
|
+
n.readValue = 165
|
|
98
|
+
const manual = await rt.readNow()
|
|
99
|
+
check('手动读取(readNow)执行并记账', manual.ok && n.readValue === 1 && n.lastReadError == null, `readValue=${n.readValue}`)
|
|
100
|
+
const schedAfterManual = reads.length
|
|
101
|
+
const off = new DcwNode({ id: 'dw-t3', templateRef: 'dcw-temp-sp', readIntervalMs: 0 })
|
|
102
|
+
const rtOff = new DcwNodeRuntime(off, makeHost({ holdIntervalMs: 0, readIntervalMs: 5000 }))
|
|
103
|
+
rtOff.tick(t0)
|
|
104
|
+
rtOff.tick(t0 + 2000)
|
|
105
|
+
check('readIntervalMs=0 关闭周期读', reads.length === schedAfterManual)
|
|
106
|
+
// 在飞互斥:挂起中的读阻塞 readNow → 409
|
|
107
|
+
let release: (() => void) | null = null
|
|
108
|
+
const slowHost: DcwRuntimeHost = {
|
|
109
|
+
running: () => true,
|
|
110
|
+
defaults: () => ({ holdIntervalMs: 0, readIntervalMs: 5000 }),
|
|
111
|
+
executeWrite: async () => ({ ok: true, message: '', raw: null, readback: null }),
|
|
112
|
+
executeRead: async () => {
|
|
113
|
+
await new Promise<void>((r) => {
|
|
114
|
+
release = r
|
|
115
|
+
})
|
|
116
|
+
return { ok: true, value: 1, raw: null, message: '', at: atNow() }
|
|
117
|
+
},
|
|
118
|
+
}
|
|
119
|
+
const rtSlow = new DcwNodeRuntime(new DcwNode({ id: 'dw-t4', templateRef: 'dcw-temp-sp', readIntervalMs: null }), slowHost)
|
|
120
|
+
const inFlight = rtSlow.readNow()
|
|
121
|
+
let conflicted = false
|
|
122
|
+
await rtSlow.readNow().catch((e: unknown) => {
|
|
123
|
+
conflicted = (e as { status?: number }).status === 409
|
|
124
|
+
})
|
|
125
|
+
release!()
|
|
126
|
+
const done = await inFlight
|
|
127
|
+
check('读在飞互斥(并发 readNow → 409)', conflicted && done.ok)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// ===== 5. Agent dcw_read 工具(鉴权 + 执行;隔离配置根) =====
|
|
131
|
+
console.log('\n--- Agent dcw_read 工具 ---')
|
|
132
|
+
{
|
|
133
|
+
const { toolDcwRead } = await import('../server/services/workshop/agents/industrial-tools')
|
|
134
|
+
const denied = await toolDcwRead('agent-x', { node_id: 'dw-none' })
|
|
135
|
+
check('未绑定 agent 读取被拒', denied.isError === true && /未绑定|无权/.test(denied.text))
|
|
136
|
+
const { getDcwController } = await import('../server/services/workshop/dcw/dcw-controller')
|
|
137
|
+
const { getAgentNodeBindingRepo } = await import('../server/services/workshop/agents/node-bindings.repo')
|
|
138
|
+
const node = getDcwController().create({ templateRef: 'dcw-temp-sp', driver: 'mock', driverConfig: { key: 'agent-t' }, readIntervalMs: 0, name: '读链路测试节点' })
|
|
139
|
+
const repo = getAgentNodeBindingRepo()
|
|
140
|
+
repo.bind('agent-a', node.id, 'dcw', 'auto')
|
|
141
|
+
const before = await toolDcwRead('agent-a', { node_id: node.id })
|
|
142
|
+
check('从未下发的节点:鉴权通过并如实报告读取失败(mock 无记录)', before.isError === true && /读取失败/.test(before.text) && !/无权|未绑定/.test(before.text), before.text.slice(0, 80))
|
|
143
|
+
await getDcwController().write(node.id, 172.5, null, { source: 'manual', actor: 'tester' })
|
|
144
|
+
const after = await toolDcwRead('agent-a', { node_id: node.id })
|
|
145
|
+
check('写入后读取:ACT 与 SET 一致', after.isError !== true && /172\.5/.test(after.text) && /一致/.test(after.text), after.text.replace(/\n/g, ' | ').slice(0, 140))
|
|
146
|
+
const other = await toolDcwRead('agent-b', { node_id: node.id })
|
|
147
|
+
check('其他 agent 越权读取被拒', other.isError === true)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// 收尾
|
|
151
|
+
rmSync(awHome, { recursive: true, force: true })
|
|
152
|
+
console.log(failures === 0 ? '\nDCW-READ ALL PASS' : `\nDCW-READ FAILED(${failures})`)
|
|
153
|
+
process.exit(failures === 0 ? 0 : 1)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /api/workshop/dcw/:id/read —— 手动读取 PLC 当前值(读写集成的读半边)。
|
|
3
|
+
* 驱动读(寄存器解码/节点值)→ 标定 decode → 节点读状态记账 + WS dcw.read 直推。
|
|
4
|
+
* 读取是被动观测:不受控制暂停/产线运行门控;不支持读的驱动返回 ok:false 说明。
|
|
5
|
+
*/
|
|
6
|
+
import { getRouterParam } from 'h3'
|
|
7
|
+
import { resolveUser } from '@/server/api/workshop/caller'
|
|
8
|
+
import { defineApiHandler } from '@/server/utils/response'
|
|
9
|
+
import { bindDcwBroadcast, getDcwController } from '@/server/services/workshop/dcw/dcw-controller'
|
|
10
|
+
import { broadcastSceneEvent } from '@/server/services/workshop/scene-events'
|
|
11
|
+
|
|
12
|
+
export default defineApiHandler(async (event) => {
|
|
13
|
+
resolveUser(event)
|
|
14
|
+
bindDcwBroadcast(broadcastSceneEvent)
|
|
15
|
+
const id = getRouterParam(event, 'id') ?? ''
|
|
16
|
+
const read = await getDcwController().readNow(id)
|
|
17
|
+
return { read }
|
|
18
|
+
})
|
|
@@ -26,6 +26,7 @@ import type { AepEnvelope } from '../../../shared/workshop-protocol'
|
|
|
26
26
|
import { parseJson } from '../../services/workshop/db/database'
|
|
27
27
|
import { registerScenePeer, unregisterScenePeer } from '../../services/workshop/scene-events'
|
|
28
28
|
import { createLogger } from '../../services/workshop/logger'
|
|
29
|
+
import { retentionSettings } from '../../services/workshop/settings'
|
|
29
30
|
|
|
30
31
|
const log = createLogger('workshop.ws')
|
|
31
32
|
|
|
@@ -35,8 +36,8 @@ const RING_CAP = 5000
|
|
|
35
36
|
const RING_BYTES_CAP = 4 * 1024 * 1024
|
|
36
37
|
/** 落库聚合缓冲上限(滞留超限即刷,防库故障时缓冲无限涨) */
|
|
37
38
|
const DB_BUFFER_CAP = 2000
|
|
38
|
-
/** 事件保留期(天;
|
|
39
|
-
const EVENTS_RETENTION_DAYS =
|
|
39
|
+
/** 事件保留期(天;retention.events_days,env AW_EVENTS_RETENTION_D 可覆盖) */
|
|
40
|
+
const EVENTS_RETENTION_DAYS = (): number => retentionSettings().events_days
|
|
40
41
|
/** 单 peer 发送预算(字节/秒):超限视为慢消费者断开(1013),客户端重连快照对齐 */
|
|
41
42
|
const PEER_SEND_BUDGET_BYTES = 32 * 1024 * 1024
|
|
42
43
|
|
|
@@ -449,8 +450,9 @@ if (!(hubGlobal as Record<string, unknown>)[RETENTION_TIMER_KEY]) {
|
|
|
449
450
|
const t = setInterval(() => {
|
|
450
451
|
if (!hub.boundManager) return
|
|
451
452
|
try {
|
|
452
|
-
const
|
|
453
|
-
|
|
453
|
+
const days = EVENTS_RETENTION_DAYS()
|
|
454
|
+
const removed = internalsOf(hub.boundManager).deps.repos.channelEvents.sweepRetention(days)
|
|
455
|
+
if (removed > 0) console.log(`[workshop-ws] 事件保留期清理 ${removed} 行(>${days}d)`)
|
|
454
456
|
}
|
|
455
457
|
catch (err) {
|
|
456
458
|
console.error('[workshop-ws] 事件保留期清理失败:', err)
|