agentworkshop 0.5.9 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.AgentWorkShop/prompts/compaction-hints.md +9 -9
- package/.AgentWorkShop/prompts/host-tools.json +42 -0
- package/.output/.AgentWorkShop/prompts/compaction-hints.md +9 -9
- package/.output/.AgentWorkShop/prompts/host-tools.json +42 -0
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{Dm5mD6XT.js → BD9D9pl4.js} +1 -1
- package/.output/public/_nuxt/{BdKzfJiM.js → BxD8Fg_Z.js} +1 -1
- package/.output/public/_nuxt/{dRAyjbJ6.js → C-Y5ydB6.js} +3 -3
- package/.output/public/_nuxt/{Bok1DRqh.js → C0FogB-p.js} +1 -1
- package/.output/public/_nuxt/{BUNGEK2z.js → C2QSTAWf.js} +1 -1
- package/.output/public/_nuxt/{CWDzKGtj.js → CclO6GyL.js} +1 -1
- package/.output/public/_nuxt/{B3__nfxM.js → Ck6tznoQ.js} +1 -1
- package/.output/public/_nuxt/CwS_UHeH.js +1 -0
- package/.output/public/_nuxt/{CE2ynNi9.js → CwcOEM8m.js} +1 -1
- package/.output/public/_nuxt/MhK4buEJ.js +1 -0
- package/.output/public/_nuxt/_id_.DN3U6EF9.css +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/a0ac51ef-51c0-4ff9-8484-7c90d8dd10ba.json +1 -0
- package/.output/public/_nuxt/{entry.DjhxLu-f.css → entry.DvlXlPwx.css} +1 -1
- package/.output/public/_nuxt/settings.BG0K9_MG.css +1 -0
- package/.output/server/chunks/_/error-500.mjs.map +1 -1
- package/.output/server/chunks/_/nitro.mjs +2648 -1401
- package/.output/server/chunks/_/nitro.mjs.map +1 -1
- package/.output/server/chunks/build/{OmpTerminalPanel-CZnxR3M_.mjs → OmpTerminalPanel-B_SYhmgb.mjs} +2 -2
- package/.output/server/chunks/build/{OmpTerminalPanel-CZnxR3M_.mjs.map → OmpTerminalPanel-B_SYhmgb.mjs.map} +1 -1
- package/.output/server/chunks/build/{TownView-DYlUNRZe.mjs → TownView-D9yCQe1T.mjs} +6 -6
- package/.output/server/chunks/build/{TownView-DYlUNRZe.mjs.map → TownView-D9yCQe1T.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-BOhG2yz8.mjs → _id_-CmKAEFHV.mjs} +4 -2
- package/.output/server/chunks/build/_id_-CmKAEFHV.mjs.map +1 -0
- package/.output/server/chunks/build/{_id_-CuyMYmhY.mjs → _id_-xR3AChMO.mjs} +74 -26
- package/.output/server/chunks/build/_id_-xR3AChMO.mjs.map +1 -0
- package/.output/server/chunks/build/{_wsId_-B5f5BdW2.mjs → _wsId_-C45nVrl-.mjs} +12 -10
- package/.output/server/chunks/build/{_wsId_-B5f5BdW2.mjs.map → _wsId_-C45nVrl-.mjs.map} +1 -1
- package/.output/server/chunks/build/{agents-BVaxN75W.mjs → agents-D4l1icvn.mjs} +5 -3
- package/.output/server/chunks/build/agents-D4l1icvn.mjs.map +1 -0
- package/.output/server/chunks/build/{channel-templates-D1K2IKrE.mjs → channel-templates-DqjtC-R0.mjs} +5 -3
- package/.output/server/chunks/build/channel-templates-DqjtC-R0.mjs.map +1 -0
- package/.output/server/chunks/build/{client-only-CFTHwakk.mjs → client-only-D5BzSQc6.mjs} +2 -2
- package/.output/server/chunks/build/client-only-D5BzSQc6.mjs.map +1 -0
- package/.output/server/chunks/build/{daq-ObtN1TQ4.mjs → daq-Boz_dlAQ.mjs} +6 -4
- package/.output/server/chunks/build/daq-Boz_dlAQ.mjs.map +1 -0
- package/.output/server/chunks/build/{dcw-fINr-He1.mjs → dcw-wTRwBAUi.mjs} +3 -1
- package/.output/server/chunks/build/dcw-wTRwBAUi.mjs.map +1 -0
- package/.output/server/chunks/build/{default-CVVO40Jj.mjs → default-Dt6xLdpd.mjs} +7 -5
- package/.output/server/chunks/build/{default-CVVO40Jj.mjs.map → default-Dt6xLdpd.mjs.map} +1 -1
- package/.output/server/chunks/build/interval-WlxgjTzO.mjs +9 -0
- package/.output/server/chunks/build/interval-WlxgjTzO.mjs.map +1 -0
- package/.output/server/chunks/build/{logs-DqNgCJAn.mjs → logs-Cdi-eXlN.mjs} +5 -3
- package/.output/server/chunks/build/logs-Cdi-eXlN.mjs.map +1 -0
- package/.output/server/chunks/build/{monitor-CTZLwbdw.mjs → monitor-yNoV98rf.mjs} +6 -4
- package/.output/server/chunks/build/{monitor-CTZLwbdw.mjs.map → monitor-yNoV98rf.mjs.map} +1 -1
- package/.output/server/chunks/build/{pages-DC52d7z7.mjs → pages-bWKy0ZsA.mjs} +6 -4
- package/.output/server/chunks/build/pages-bWKy0ZsA.mjs.map +1 -0
- package/.output/server/chunks/build/{plugins-DVQty7qG.mjs → plugins-B-ZNey0Z.mjs} +4 -2
- package/.output/server/chunks/build/plugins-B-ZNey0Z.mjs.map +1 -0
- package/.output/server/chunks/build/{settings-BeergncK.mjs → settings-C3T5hR2A.mjs} +21 -19
- package/.output/server/chunks/build/settings-C3T5hR2A.mjs.map +1 -0
- package/.output/server/chunks/build/{teams-CFeDlHDh.mjs → teams-QR3BBF7A.mjs} +5 -3
- package/.output/server/chunks/build/teams-QR3BBF7A.mjs.map +1 -0
- package/.output/server/chunks/build/{tokens-CBAUbOce.mjs → tokens-DFvr_TLj.mjs} +4 -2
- package/.output/server/chunks/build/tokens-DFvr_TLj.mjs.map +1 -0
- package/.output/server/chunks/build/town-BUqRobze.mjs +2 -0
- package/.output/server/chunks/build/town-BUqRobze.mjs.map +1 -1
- package/.output/server/chunks/build/{town-BxH-XXth.mjs → town-CKg6Qxba.mjs} +9 -7
- package/.output/server/chunks/build/town-CKg6Qxba.mjs.map +1 -0
- package/.output/server/chunks/build/{useDaqStream-CwORhsD7.mjs → useDaqStream-zHEptJQ_.mjs} +44 -1
- package/.output/server/chunks/build/useDaqStream-zHEptJQ_.mjs.map +1 -0
- package/.output/server/chunks/build/{useSiteConfig-Cc-ABesl.mjs → useSiteConfig-DJe_KMVr.mjs} +1 -1
- package/.output/server/chunks/build/{useSiteConfig-Cc-ABesl.mjs.map → useSiteConfig-DJe_KMVr.mjs.map} +1 -1
- package/.output/server/chunks/build/{useWorkshopApi-5er8_EHZ.mjs → useWorkshopApi-Bh5VUHWu.mjs} +1 -1
- package/.output/server/chunks/build/{useWorkshopApi-5er8_EHZ.mjs.map → useWorkshopApi-Bh5VUHWu.mjs.map} +1 -1
- package/.output/server/chunks/build/{useWorkshopWs-Dwr_1Q8f.mjs → useWorkshopWs-xcdeiSmJ.mjs} +2 -2
- package/.output/server/chunks/build/{useWorkshopWs-Dwr_1Q8f.mjs.map → useWorkshopWs-xcdeiSmJ.mjs.map} +1 -1
- package/.output/server/chunks/build/{user-CpVY4OAA.mjs → user-Dk-ytEUV.mjs} +1 -1
- package/.output/server/chunks/build/{user-CpVY4OAA.mjs.map → user-Dk-ytEUV.mjs.map} +1 -1
- package/.output/server/chunks/build/{users-BMs4s_6K.mjs → users-4FZ0yFUO.mjs} +4 -2
- package/.output/server/chunks/build/users-4FZ0yFUO.mjs.map +1 -0
- package/.output/server/chunks/build/{workshop-CJAyZ5zS.mjs → workshop-CLhwe5eo.mjs} +6 -4
- package/.output/server/chunks/build/workshop-CLhwe5eo.mjs.map +1 -0
- package/.output/server/chunks/build/{workspaces-Dq-1zvu9.mjs → workspaces-IfORCDJE.mjs} +2 -2
- package/.output/server/chunks/build/{workspaces-Dq-1zvu9.mjs.map → workspaces-IfORCDJE.mjs.map} +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +2 -0
- package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get.mjs +2 -0
- package/.output/server/chunks/routes/api/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.post.mjs +2 -0
- package/.output/server/chunks/routes/api/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/mcp/workshop.mjs +2 -0
- package/.output/server/chunks/routes/api/mcp/workshop.mjs.map +1 -1
- package/.output/server/chunks/routes/api/metrics.mjs +2 -0
- package/.output/server/chunks/routes/api/metrics.mjs.map +1 -1
- package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs +2 -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 +2 -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 +2 -0
- package/.output/server/chunks/routes/api/plugins/manifest.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/config.get.mjs +2 -0
- package/.output/server/chunks/routes/api/system/config.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/index.get.mjs +2 -0
- package/.output/server/chunks/routes/api/system/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/index.patch.mjs +2 -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 +2 -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 +2 -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 +2 -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 +3 -2
- 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 +2 -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 +2 -0
- package/.output/server/chunks/routes/api/users/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/_id_.get.mjs +2 -0
- package/.output/server/chunks/routes/api/users/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/_id_.put.mjs +2 -0
- package/.output/server/chunks/routes/api/users/_id_.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/index.get.mjs +2 -0
- package/.output/server/chunks/routes/api/users/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/index.post.mjs +2 -0
- package/.output/server/chunks/routes/api/users/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/login.post.mjs +2 -0
- package/.output/server/chunks/routes/api/users/login.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/logout.post.mjs +2 -0
- package/.output/server/chunks/routes/api/users/logout.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/me.get.mjs +2 -0
- package/.output/server/chunks/routes/api/users/me.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/register.post.mjs +2 -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 +2 -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 +2 -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 +2 -0
- package/.output/server/chunks/routes/api/users/tokens/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/_...path_.mjs +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -0
- package/.output/server/chunks/routes/api/workshop/audit.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/caller.mjs +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -0
- package/.output/server/chunks/routes/api/workshop/channels.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels.post.mjs +2 -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 +2 -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 +36 -0
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs +53 -0
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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/test.post.mjs +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -0
- package/.output/server/chunks/routes/api/workshop/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index.post.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index10.get.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index10.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index2.get.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index2.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index2.post.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index2.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index3.get.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index3.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index3.post.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index3.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index4.get.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index4.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index4.post.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index4.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index5.get.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index5.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index5.post.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index5.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index6.get.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index6.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index6.post.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index6.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index7.get.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index7.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index7.post.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index7.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index8.get.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index8.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index8.post.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/index8.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index9.get.mjs +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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/routes/renderer.mjs.map +1 -1
- package/.output/server/chunks/virtual/entry.mjs +166 -114
- package/.output/server/chunks/virtual/entry.mjs.map +1 -1
- package/.output/server/chunks/virtual/precomputed.mjs +1 -1
- package/.output/server/index.mjs +2 -0
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/app/composables/workshop/useDaqStream.ts +59 -1
- package/app/config/schema.ts +8 -0
- package/app/pages/daq/[id].vue +141 -1
- package/app/pages/settings.vue +10 -5
- package/app/plugins/runtime-config.client.ts +65 -65
- package/app/stores/runtime-config.ts +212 -212
- package/config.yml +77 -70
- package/docker-compose.yml +19 -2
- package/docs/plugins.md +271 -197
- package/i18n/dicts/_en.json +7 -2
- package/i18n/dicts/daqDetail.json +8 -2
- package/i18n/locales/en.ts +55 -29
- package/i18n/locales/zh-CN.ts +55 -29
- package/nuxt.config.ts +1 -1
- package/package.json +144 -143
- package/scripts/_dbg-collab-scenario-e2e.mjs +185 -0
- package/scripts/_dbg-daq-frame-alarm.mjs +49 -0
- package/scripts/_dbg-daq-frame-ui.mjs +62 -0
- package/scripts/_dbg-daq-frame-ws.mjs +72 -0
- package/scripts/_dbg-daq-frames-e2e.mjs +118 -0
- package/scripts/_dbg-host.mjs +16 -0
- package/scripts/_dbg-plugin-agent-read.ts +56 -0
- package/scripts/_dbg-plugin-sink-rest.mjs +70 -0
- package/scripts/_dbg-plugin-sink-ui.mjs +81 -0
- package/scripts/_dbg-prompts-hotreload-test.ts +76 -0
- package/scripts/_dbg-release-smoke.mjs +104 -0
- package/scripts/i18n-merge.mjs +69 -67
- package/scripts/test-context-governor.ts +176 -176
- package/scripts/test-daq-frames.ts +180 -0
- package/scripts/test-daq-minio.ts +77 -0
- package/scripts/test-memory-rrf-mmr.ts +114 -114
- package/scripts/test-plugin-ext.ts +173 -0
- package/server/api/system/settings/events.get.ts +27 -28
- package/server/api/system/settings/index.get.ts +14 -14
- package/server/api/system/settings/index.patch.ts +22 -22
- package/server/api/system/settings/reset.post.ts +12 -12
- package/server/api/workshop/daq/[id]/frames/content.get.ts +24 -0
- package/server/api/workshop/daq/[id]/frames.get.ts +44 -0
- package/server/data/daqs.json +89 -89
- package/server/data/dcw-rollback.json +1 -1
- package/server/data/dcw-runs.json +3136 -2492
- package/server/data/dcw-writes.json +672 -0
- package/server/data/dcws.json +4 -4
- package/server/data/line-runs.json +1 -232
- package/server/plugins/daq.ts +11 -0
- package/server/plugins/system-config.ts +38 -38
- package/server/services/system-config.ts +365 -356
- package/server/services/workshop/agents/industrial-tools.ts +91 -25
- package/server/services/workshop/agents/omp-agent.ts +1955 -1895
- package/server/services/workshop/agents/plugin-tools.ts +145 -0
- package/server/services/workshop/daq/bus/queue-port.ts +18 -0
- package/server/services/workshop/daq/daq-controller.ts +216 -14
- package/server/services/workshop/daq/daq-node.ts +257 -247
- package/server/services/workshop/daq/daq-runtime.ts +36 -4
- package/server/services/workshop/daq/daq-templates.ts +213 -157
- package/server/services/workshop/daq/drivers.ts +134 -30
- package/server/services/workshop/daq/frames.ts +227 -0
- package/server/services/workshop/daq/infra.ts +31 -17
- package/server/services/workshop/daq/objectstore/disk.adapter.ts +38 -0
- package/server/services/workshop/daq/objectstore/index.ts +88 -0
- package/server/services/workshop/daq/objectstore/minio.adapter.ts +60 -0
- package/server/services/workshop/daq/objectstore/objectstore-port.ts +27 -0
- package/server/services/workshop/daq/plugin-bridge.ts +73 -0
- package/server/services/workshop/daq/png-enc.ts +71 -0
- package/server/services/workshop/daq/storage/sqlite.adapter.ts +104 -1
- package/server/services/workshop/daq/storage/timescale.adapter.ts +95 -4
- package/server/services/workshop/daq/storage/tsdb-port.ts +46 -0
- package/server/services/workshop/plugins/host.mjs +479 -417
- package/server/services/workshop/runtime/agent-runtime.ts +744 -744
- package/shared/config/schema.json +6 -1
- package/shared/daq-protocol.ts +88 -0
- package/.output/public/_nuxt/B-PgoIPN.js +0 -1
- package/.output/public/_nuxt/DVNYfGsj.js +0 -1
- package/.output/public/_nuxt/_id_.CbiF5PrV.css +0 -1
- package/.output/public/_nuxt/builds/meta/6f7e40bf-a960-4f51-8a2e-bb1fffeaa5e8.json +0 -1
- package/.output/public/_nuxt/settings.BANibAnV.css +0 -1
- package/.output/server/chunks/build/_id_-BOhG2yz8.mjs.map +0 -1
- package/.output/server/chunks/build/_id_-CuyMYmhY.mjs.map +0 -1
- package/.output/server/chunks/build/agents-BVaxN75W.mjs.map +0 -1
- package/.output/server/chunks/build/channel-templates-D1K2IKrE.mjs.map +0 -1
- package/.output/server/chunks/build/client-only-CFTHwakk.mjs.map +0 -1
- package/.output/server/chunks/build/daq-ObtN1TQ4.mjs.map +0 -1
- package/.output/server/chunks/build/dcw-fINr-He1.mjs.map +0 -1
- package/.output/server/chunks/build/interval-Bt11uRPw.mjs +0 -9
- package/.output/server/chunks/build/interval-Bt11uRPw.mjs.map +0 -1
- package/.output/server/chunks/build/logs-DqNgCJAn.mjs.map +0 -1
- package/.output/server/chunks/build/pages-DC52d7z7.mjs.map +0 -1
- package/.output/server/chunks/build/plugins-DVQty7qG.mjs.map +0 -1
- package/.output/server/chunks/build/settings-BeergncK.mjs.map +0 -1
- package/.output/server/chunks/build/teams-CFeDlHDh.mjs.map +0 -1
- package/.output/server/chunks/build/tokens-CBAUbOce.mjs.map +0 -1
- package/.output/server/chunks/build/town-BxH-XXth.mjs.map +0 -1
- package/.output/server/chunks/build/useDaqStream-CwORhsD7.mjs.map +0 -1
- package/.output/server/chunks/build/users-BMs4s_6K.mjs.map +0 -1
- package/.output/server/chunks/build/workshop-CJAyZ5zS.mjs.map +0 -1
|
@@ -1,356 +1,365 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 系统配置单例服务 —— 运行时设置(持久化 + 热重载 + SSE 广播)。
|
|
3
|
-
*
|
|
4
|
-
* 单一事实来源与优先级(与 CLI / 构建期完全一致):
|
|
5
|
-
* config.yml 默认 < data/runtime-settings.json 运行时覆盖 < 环境变量(AW_*)
|
|
6
|
-
*
|
|
7
|
-
* 生效语义(由 shared/config/schema.json 描述符的 applies 决定):
|
|
8
|
-
* live —— 保存即改内存 runtimeConfig + SSE 广播,前端实时生效(无需刷新)
|
|
9
|
-
* restart —— 落盘持久化,在下一次以对应模式启动时生效(aw dev / aw start)
|
|
10
|
-
*
|
|
11
|
-
* 文件监听:外部写入(aw config set / 手工编辑)runtime-settings.json 或 config.yml
|
|
12
|
-
* → 自动重载 + 广播。前端、CLI、文件三条写入路径最终收敛到同一份覆盖文件。
|
|
13
|
-
*
|
|
14
|
-
* 使用:server/plugins/system-config.ts 在 Nitro 启动时 init();
|
|
15
|
-
* 业务经 getSystemConfigService() 读取(不存在则惰性初始化,幂等)。
|
|
16
|
-
*/
|
|
17
|
-
import {
|
|
18
|
-
import { join
|
|
19
|
-
import { useRuntimeConfig } from '#imports'
|
|
20
|
-
import { AppError } from '../utils/errors'
|
|
21
|
-
import {
|
|
22
|
-
loadDescriptors,
|
|
23
|
-
loadDescriptorMap,
|
|
24
|
-
readSettings,
|
|
25
|
-
saveSettings,
|
|
26
|
-
validateValue,
|
|
27
|
-
envOverridesFromEnv,
|
|
28
|
-
getPath,
|
|
29
|
-
setPath,
|
|
30
|
-
type SettingsDescriptor,
|
|
31
|
-
} from '@/shared/config/engine.mjs'
|
|
32
|
-
|
|
33
|
-
/* ---------- 描述符 key → runtimeConfig 字段映射 ----------
|
|
34
|
-
* nuxt.config runtimeConfig 的结构:
|
|
35
|
-
* public.appTitle/appTitle/description/mode/apiBase/apiTimeout/primaryColor/themeMode/...
|
|
36
|
-
* apiPageSize / apiMaxPageSize / approvalGate / daq.{...}
|
|
37
|
-
*/
|
|
38
|
-
const PUBLIC_FIELDS: Record<string, string> = {
|
|
39
|
-
'server.host': 'serverHost',
|
|
40
|
-
'server.dev.port': 'devPort',
|
|
41
|
-
'server.prod.port': 'prodPort',
|
|
42
|
-
'app.title': 'appTitle',
|
|
43
|
-
'app.description': 'description',
|
|
44
|
-
'api.baseURL': 'apiBase',
|
|
45
|
-
'api.timeout': 'apiTimeout',
|
|
46
|
-
'theme.primaryColor': 'primaryColor',
|
|
47
|
-
'theme.mode': 'themeMode',
|
|
48
|
-
'i18n.defaultLocale': 'defaultLocale',
|
|
49
|
-
}
|
|
50
|
-
const ROOT_FIELDS: Record<string, string> = {
|
|
51
|
-
'api.pageSize': 'apiPageSize',
|
|
52
|
-
'api.maxPageSize': 'apiMaxPageSize',
|
|
53
|
-
'security.approvalGate': 'approvalGate',
|
|
54
|
-
}
|
|
55
|
-
const DAQ_PREFIX = 'daq.'
|
|
56
|
-
|
|
57
|
-
export interface PublicSnapshot {
|
|
58
|
-
descriptors: SettingsDescriptor[]
|
|
59
|
-
effective: Record<string, unknown>
|
|
60
|
-
overrides: Record<string, unknown>
|
|
61
|
-
sources: Record<string, 'config.yml' | 'runtime' | 'env'>
|
|
62
|
-
settingsPath: string
|
|
63
|
-
configPath: string
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/** 广播载荷 */
|
|
67
|
-
export interface ConfigEventPayload {
|
|
68
|
-
type: 'config:changed' | 'config:reset' | 'config:reloaded'
|
|
69
|
-
changed: string[]
|
|
70
|
-
restartRequired: string[]
|
|
71
|
-
effective: Record<string, unknown>
|
|
72
|
-
sources: Record<string, unknown>
|
|
73
|
-
overrides: Record<string, unknown>
|
|
74
|
-
at: string
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
type Listener = (payload: ConfigEventPayload) => void
|
|
78
|
-
|
|
79
|
-
declare global {
|
|
80
|
-
var __systemConfig: SystemConfigService | undefined
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export class SystemConfigService {
|
|
84
|
-
private descriptors: SettingsDescriptor[] = []
|
|
85
|
-
private map = new Map<string, SettingsDescriptor>()
|
|
86
|
-
private overrides: Record<string, unknown> = {}
|
|
87
|
-
private envOverrides: Record<string, unknown> = {}
|
|
88
|
-
private effective: Record<string, unknown> = {}
|
|
89
|
-
private sources: Record<string, 'config.yml' | 'runtime' | 'env'> = {}
|
|
90
|
-
private listeners = new Set<Listener>()
|
|
91
|
-
private configPath = ''
|
|
92
|
-
private settingsPath = ''
|
|
93
|
-
private watcher: ReturnType<typeof watch>[] = []
|
|
94
|
-
private reloadTimer: NodeJS.Timeout | null = null
|
|
95
|
-
private disposed = false
|
|
96
|
-
private applyWarned = false
|
|
97
|
-
|
|
98
|
-
constructor(readonly root: string) {
|
|
99
|
-
this.configPath = join(root, 'config.yml')
|
|
100
|
-
this.settingsPath = join(root, 'data', 'runtime-settings.json')
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/** Nitro 启动时调用:加载覆盖 → 应用到 runtimeConfig → 挂文件监听 */
|
|
104
|
-
init(): void {
|
|
105
|
-
this.descriptors = loadDescriptors()
|
|
106
|
-
this.map = loadDescriptorMap(this.descriptors)
|
|
107
|
-
this.envOverrides = envOverridesFromEnv(process.env, this.descriptors)
|
|
108
|
-
this.reloadFromDisk()
|
|
109
|
-
this.watchFiles()
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/* ---------------- 私有:base / apply ---------------- */
|
|
113
|
-
|
|
114
|
-
/** 从当前 runtimeConfig 读取某 key 的构建期基准值 */
|
|
115
|
-
private readBase(key: string): unknown {
|
|
116
|
-
const rc = useRuntimeConfig() as Record<string,
|
|
117
|
-
if (PUBLIC_FIELDS[key]) return rc.public?.[PUBLIC_FIELDS[key]]
|
|
118
|
-
if (ROOT_FIELDS[key]) return rc[ROOT_FIELDS[key]]
|
|
119
|
-
if (key.startsWith(DAQ_PREFIX)) return getPath(rc.daq, key.slice(DAQ_PREFIX.length))
|
|
120
|
-
return undefined
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/** 把某 key 的生效值写入 runtimeConfig(live 应用;restart 键仅改内存视图供展示)。
|
|
124
|
-
* Nitro 4 中 runtimeConfig.public 为只读对象 → 赋值抛错;此处降级:
|
|
125
|
-
* 视图以本服务内存 effective 为唯一实时源,前端经 SSE 消费;SSR 读取在下次启动后对齐。 */
|
|
126
|
-
private applyToRuntime(key: string, value: unknown): void {
|
|
127
|
-
try {
|
|
128
|
-
const rc = useRuntimeConfig() as Record<string,
|
|
129
|
-
if (PUBLIC_FIELDS[key]) {
|
|
130
|
-
rc.public[PUBLIC_FIELDS[key]] = value
|
|
131
|
-
return
|
|
132
|
-
}
|
|
133
|
-
if (ROOT_FIELDS[key]) {
|
|
134
|
-
rc[ROOT_FIELDS[key]] = value
|
|
135
|
-
return
|
|
136
|
-
}
|
|
137
|
-
if (key.startsWith(DAQ_PREFIX)) {
|
|
138
|
-
if (!rc.daq || typeof rc.daq !== 'object') rc.daq = {}
|
|
139
|
-
setPath(rc.daq, key.slice(DAQ_PREFIX.length), value)
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
catch {
|
|
143
|
-
if (!this.applyWarned) {
|
|
144
|
-
this.applyWarned = true
|
|
145
|
-
console.warn('[system-config] runtimeConfig 只读 → live 应用降级为服务内存视图 + SSE 广播(前端实时;服务端 SSR 完整生效需重启)')
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/** 全部描述符重算 effective + sources(base = runtimeConfig 构建值)
|
|
151
|
-
* 并可选地把 live 键应用到 runtimeConfig */
|
|
152
|
-
private recompute({ applyLive = true } = {}): void {
|
|
153
|
-
const effective: Record<string, unknown> = {}
|
|
154
|
-
const sources: Record<string, 'config.yml' | 'runtime' | 'env'> = {}
|
|
155
|
-
for (const desc of this.descriptors) {
|
|
156
|
-
let value: unknown
|
|
157
|
-
let source: 'config.yml' | 'runtime' | 'env'
|
|
158
|
-
if (this.envOverrides[desc.key] !== undefined) {
|
|
159
|
-
value = this.envOverrides[desc.key]
|
|
160
|
-
source = 'env'
|
|
161
|
-
}
|
|
162
|
-
else if (this.overrides[desc.key] !== undefined) {
|
|
163
|
-
value = this.overrides[desc.key]
|
|
164
|
-
source = 'runtime'
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
const base = this.readBase(desc.key)
|
|
168
|
-
value = base !== undefined ? base : desc.default
|
|
169
|
-
source = 'config.yml'
|
|
170
|
-
}
|
|
171
|
-
effective[desc.key] = value
|
|
172
|
-
sources[desc.key] = source
|
|
173
|
-
if (applyLive || this.overrides[desc.key] !== undefined) this.applyToRuntime(desc.key, value)
|
|
174
|
-
}
|
|
175
|
-
this.effective = effective
|
|
176
|
-
this.sources = sources
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/** 从磁盘重读设置文件 → 校验 → recompute → 广播 */
|
|
180
|
-
reloadFromDisk(): { changed: string[] } {
|
|
181
|
-
const before = this.overrides
|
|
182
|
-
const raw = readSettings(this.settingsPath)
|
|
183
|
-
const validated: Record<string, unknown> = {}
|
|
184
|
-
const changed: string[] = []
|
|
185
|
-
for (const [key, value] of Object.entries(raw)) {
|
|
186
|
-
const desc = this.map.get(key)
|
|
187
|
-
if (!desc) continue // 未知键:忽略(schema 演进容错)
|
|
188
|
-
const errs = validateValue(desc, value)
|
|
189
|
-
if (errs.length) {
|
|
190
|
-
console.warn(`[system-config] 忽略无效运行时覆盖 ${key}=${JSON.stringify(value)}: ${errs.join('; ')}`)
|
|
191
|
-
continue
|
|
192
|
-
}
|
|
193
|
-
validated[key] = value
|
|
194
|
-
if (before[key] !== value) changed.push(key)
|
|
195
|
-
}
|
|
196
|
-
for (const key of Object.keys(before)) {
|
|
197
|
-
if (!(key in validated) && key in before) changed.push(key)
|
|
198
|
-
}
|
|
199
|
-
this.overrides = validated
|
|
200
|
-
this.recompute()
|
|
201
|
-
return { changed }
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/* ---------------- 文件监听(外部写入热重载) ---------------- */
|
|
205
|
-
private watchFiles(): void {
|
|
206
|
-
const dataDir = join(this.root, 'data')
|
|
207
|
-
const handler = (eventType: string, filename: string | null) => {
|
|
208
|
-
const name = filename ?? ''
|
|
209
|
-
const isSettings = name.includes('runtime-settings.json')
|
|
210
|
-
const isConfig = name.includes('config.yml')
|
|
211
|
-
if (!isSettings && !isConfig) return
|
|
212
|
-
// atomic 写(tmp+rename)在 Windows 上会以 rename/unlink 触发;防抖合并
|
|
213
|
-
if (this.reloadTimer) clearTimeout(this.reloadTimer)
|
|
214
|
-
this.reloadTimer = setTimeout(() => {
|
|
215
|
-
if (this.disposed) return
|
|
216
|
-
const { changed } = this.reloadFromDisk()
|
|
217
|
-
this.broadcast({ type: 'config:reloaded', changed, ...this.eventTail() })
|
|
218
|
-
}, 300)
|
|
219
|
-
}
|
|
220
|
-
try {
|
|
221
|
-
if (existsSync(dataDir)) this.watcher.push(watch(dataDir, { persistent: false }, handler))
|
|
222
|
-
if (existsSync(this.root)) this.watcher.push(watch(this.root, { persistent: false }, handler))
|
|
223
|
-
}
|
|
224
|
-
catch (err) {
|
|
225
|
-
console.warn('[system-config] 文件监听不可用(外部写入将不热重载):', String(err?.message ?? err))
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
/* ---------------- 公共 API ---------------- */
|
|
230
|
-
|
|
231
|
-
snapshot(): PublicSnapshot {
|
|
232
|
-
return {
|
|
233
|
-
descriptors: this.descriptors,
|
|
234
|
-
effective: { ...this.effective },
|
|
235
|
-
overrides: { ...this.overrides },
|
|
236
|
-
sources: { ...this.sources },
|
|
237
|
-
settingsPath: this.settingsPath,
|
|
238
|
-
configPath: this.configPath,
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* 应用一批覆盖(PATCH 语义)。
|
|
244
|
-
* @param patch { [key]: value } value === null 表示清除该键覆盖(回落 config.yml/base)
|
|
245
|
-
* @returns { changed, restartRequired, effective, sources }
|
|
246
|
-
*/
|
|
247
|
-
patch(patch: Record<string, unknown>): { changed: string[]
|
|
248
|
-
const errors: Record<string, string[]> = {}
|
|
249
|
-
const next = { ...this.overrides }
|
|
250
|
-
const changed: string[] = []
|
|
251
|
-
for (const [key, rawValue] of Object.entries(patch)) {
|
|
252
|
-
const desc = this.map.get(key)
|
|
253
|
-
if (!desc) {
|
|
254
|
-
errors[key] = ['未知设置项(不在 shared/config/schema.json 中)']
|
|
255
|
-
continue
|
|
256
|
-
}
|
|
257
|
-
// null → 清除覆盖
|
|
258
|
-
if (rawValue === null || rawValue === undefined) {
|
|
259
|
-
if (key in next) {
|
|
260
|
-
delete
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
next[key]
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
this.
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
this.overrides
|
|
288
|
-
|
|
289
|
-
this.
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
return this.descriptors.filter(d => d.applies === 'restart' && this.overrides[d.key] !== undefined).map(d => d.key)
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
private broadcast(payload: ConfigEventPayload): void {
|
|
325
|
-
for (const fn of [...this.listeners]) {
|
|
326
|
-
try {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
export function
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 系统配置单例服务 —— 运行时设置(持久化 + 热重载 + SSE 广播)。
|
|
3
|
+
*
|
|
4
|
+
* 单一事实来源与优先级(与 CLI / 构建期完全一致):
|
|
5
|
+
* config.yml 默认 < data/runtime-settings.json 运行时覆盖 < 环境变量(AW_*)
|
|
6
|
+
*
|
|
7
|
+
* 生效语义(由 shared/config/schema.json 描述符的 applies 决定):
|
|
8
|
+
* live —— 保存即改内存 runtimeConfig + SSE 广播,前端实时生效(无需刷新)
|
|
9
|
+
* restart —— 落盘持久化,在下一次以对应模式启动时生效(aw dev / aw start)
|
|
10
|
+
*
|
|
11
|
+
* 文件监听:外部写入(aw config set / 手工编辑)runtime-settings.json 或 config.yml
|
|
12
|
+
* → 自动重载 + 广播。前端、CLI、文件三条写入路径最终收敛到同一份覆盖文件。
|
|
13
|
+
*
|
|
14
|
+
* 使用:server/plugins/system-config.ts 在 Nitro 启动时 init();
|
|
15
|
+
* 业务经 getSystemConfigService() 读取(不存在则惰性初始化,幂等)。
|
|
16
|
+
*/
|
|
17
|
+
import { watch, existsSync } from 'node:fs'
|
|
18
|
+
import { join } from 'node:path'
|
|
19
|
+
import { useRuntimeConfig } from '#imports'
|
|
20
|
+
import { AppError } from '../utils/errors'
|
|
21
|
+
import {
|
|
22
|
+
loadDescriptors,
|
|
23
|
+
loadDescriptorMap,
|
|
24
|
+
readSettings,
|
|
25
|
+
saveSettings,
|
|
26
|
+
validateValue,
|
|
27
|
+
envOverridesFromEnv,
|
|
28
|
+
getPath,
|
|
29
|
+
setPath,
|
|
30
|
+
type SettingsDescriptor,
|
|
31
|
+
} from '@/shared/config/engine.mjs'
|
|
32
|
+
|
|
33
|
+
/* ---------- 描述符 key → runtimeConfig 字段映射 ----------
|
|
34
|
+
* nuxt.config runtimeConfig 的结构:
|
|
35
|
+
* public.appTitle/appTitle/description/mode/apiBase/apiTimeout/primaryColor/themeMode/...
|
|
36
|
+
* apiPageSize / apiMaxPageSize / approvalGate / daq.{...}
|
|
37
|
+
*/
|
|
38
|
+
const PUBLIC_FIELDS: Record<string, string> = {
|
|
39
|
+
'server.host': 'serverHost',
|
|
40
|
+
'server.dev.port': 'devPort',
|
|
41
|
+
'server.prod.port': 'prodPort',
|
|
42
|
+
'app.title': 'appTitle',
|
|
43
|
+
'app.description': 'description',
|
|
44
|
+
'api.baseURL': 'apiBase',
|
|
45
|
+
'api.timeout': 'apiTimeout',
|
|
46
|
+
'theme.primaryColor': 'primaryColor',
|
|
47
|
+
'theme.mode': 'themeMode',
|
|
48
|
+
'i18n.defaultLocale': 'defaultLocale',
|
|
49
|
+
}
|
|
50
|
+
const ROOT_FIELDS: Record<string, string> = {
|
|
51
|
+
'api.pageSize': 'apiPageSize',
|
|
52
|
+
'api.maxPageSize': 'apiMaxPageSize',
|
|
53
|
+
'security.approvalGate': 'approvalGate',
|
|
54
|
+
}
|
|
55
|
+
const DAQ_PREFIX = 'daq.'
|
|
56
|
+
|
|
57
|
+
export interface PublicSnapshot {
|
|
58
|
+
descriptors: SettingsDescriptor[]
|
|
59
|
+
effective: Record<string, unknown>
|
|
60
|
+
overrides: Record<string, unknown>
|
|
61
|
+
sources: Record<string, 'config.yml' | 'runtime' | 'env'>
|
|
62
|
+
settingsPath: string
|
|
63
|
+
configPath: string
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** 广播载荷 */
|
|
67
|
+
export interface ConfigEventPayload {
|
|
68
|
+
type: 'config:changed' | 'config:reset' | 'config:reloaded'
|
|
69
|
+
changed: string[]
|
|
70
|
+
restartRequired: string[]
|
|
71
|
+
effective: Record<string, unknown>
|
|
72
|
+
sources: Record<string, unknown>
|
|
73
|
+
overrides: Record<string, unknown>
|
|
74
|
+
at: string
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
type Listener = (payload: ConfigEventPayload) => void
|
|
78
|
+
|
|
79
|
+
declare global {
|
|
80
|
+
var __systemConfig: SystemConfigService | undefined
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export class SystemConfigService {
|
|
84
|
+
private descriptors: SettingsDescriptor[] = []
|
|
85
|
+
private map = new Map<string, SettingsDescriptor>()
|
|
86
|
+
private overrides: Record<string, unknown> = {}
|
|
87
|
+
private envOverrides: Record<string, unknown> = {}
|
|
88
|
+
private effective: Record<string, unknown> = {}
|
|
89
|
+
private sources: Record<string, 'config.yml' | 'runtime' | 'env'> = {}
|
|
90
|
+
private listeners = new Set<Listener>()
|
|
91
|
+
private configPath = ''
|
|
92
|
+
private settingsPath = ''
|
|
93
|
+
private watcher: ReturnType<typeof watch>[] = []
|
|
94
|
+
private reloadTimer: NodeJS.Timeout | null = null
|
|
95
|
+
private disposed = false
|
|
96
|
+
private applyWarned = false
|
|
97
|
+
|
|
98
|
+
constructor(readonly root: string) {
|
|
99
|
+
this.configPath = join(root, 'config.yml')
|
|
100
|
+
this.settingsPath = join(root, 'data', 'runtime-settings.json')
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Nitro 启动时调用:加载覆盖 → 应用到 runtimeConfig → 挂文件监听 */
|
|
104
|
+
init(): void {
|
|
105
|
+
this.descriptors = loadDescriptors()
|
|
106
|
+
this.map = loadDescriptorMap(this.descriptors)
|
|
107
|
+
this.envOverrides = envOverridesFromEnv(process.env, this.descriptors)
|
|
108
|
+
this.reloadFromDisk()
|
|
109
|
+
this.watchFiles()
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* ---------------- 私有:base / apply ---------------- */
|
|
113
|
+
|
|
114
|
+
/** 从当前 runtimeConfig 读取某 key 的构建期基准值 */
|
|
115
|
+
private readBase(key: string): unknown {
|
|
116
|
+
const rc = useRuntimeConfig() as Record<string, unknown>
|
|
117
|
+
if (PUBLIC_FIELDS[key]) return rc.public?.[PUBLIC_FIELDS[key]]
|
|
118
|
+
if (ROOT_FIELDS[key]) return rc[ROOT_FIELDS[key]]
|
|
119
|
+
if (key.startsWith(DAQ_PREFIX)) return getPath(rc.daq, key.slice(DAQ_PREFIX.length))
|
|
120
|
+
return undefined
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** 把某 key 的生效值写入 runtimeConfig(live 应用;restart 键仅改内存视图供展示)。
|
|
124
|
+
* Nitro 4 中 runtimeConfig.public 为只读对象 → 赋值抛错;此处降级:
|
|
125
|
+
* 视图以本服务内存 effective 为唯一实时源,前端经 SSE 消费;SSR 读取在下次启动后对齐。 */
|
|
126
|
+
private applyToRuntime(key: string, value: unknown): void {
|
|
127
|
+
try {
|
|
128
|
+
const rc = useRuntimeConfig() as Record<string, unknown>
|
|
129
|
+
if (PUBLIC_FIELDS[key]) {
|
|
130
|
+
rc.public[PUBLIC_FIELDS[key]] = value
|
|
131
|
+
return
|
|
132
|
+
}
|
|
133
|
+
if (ROOT_FIELDS[key]) {
|
|
134
|
+
rc[ROOT_FIELDS[key]] = value
|
|
135
|
+
return
|
|
136
|
+
}
|
|
137
|
+
if (key.startsWith(DAQ_PREFIX)) {
|
|
138
|
+
if (!rc.daq || typeof rc.daq !== 'object') rc.daq = {}
|
|
139
|
+
setPath(rc.daq, key.slice(DAQ_PREFIX.length), value)
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
if (!this.applyWarned) {
|
|
144
|
+
this.applyWarned = true
|
|
145
|
+
console.warn('[system-config] runtimeConfig 只读 → live 应用降级为服务内存视图 + SSE 广播(前端实时;服务端 SSR 完整生效需重启)')
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** 全部描述符重算 effective + sources(base = runtimeConfig 构建值)
|
|
151
|
+
* 并可选地把 live 键应用到 runtimeConfig */
|
|
152
|
+
private recompute({ applyLive = true } = {}): void {
|
|
153
|
+
const effective: Record<string, unknown> = {}
|
|
154
|
+
const sources: Record<string, 'config.yml' | 'runtime' | 'env'> = {}
|
|
155
|
+
for (const desc of this.descriptors) {
|
|
156
|
+
let value: unknown
|
|
157
|
+
let source: 'config.yml' | 'runtime' | 'env'
|
|
158
|
+
if (this.envOverrides[desc.key] !== undefined) {
|
|
159
|
+
value = this.envOverrides[desc.key]
|
|
160
|
+
source = 'env'
|
|
161
|
+
}
|
|
162
|
+
else if (this.overrides[desc.key] !== undefined) {
|
|
163
|
+
value = this.overrides[desc.key]
|
|
164
|
+
source = 'runtime'
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
const base = this.readBase(desc.key)
|
|
168
|
+
value = base !== undefined ? base : desc.default
|
|
169
|
+
source = 'config.yml'
|
|
170
|
+
}
|
|
171
|
+
effective[desc.key] = value
|
|
172
|
+
sources[desc.key] = source
|
|
173
|
+
if (applyLive || this.overrides[desc.key] !== undefined) this.applyToRuntime(desc.key, value)
|
|
174
|
+
}
|
|
175
|
+
this.effective = effective
|
|
176
|
+
this.sources = sources
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** 从磁盘重读设置文件 → 校验 → recompute → 广播 */
|
|
180
|
+
reloadFromDisk(): { changed: string[] } {
|
|
181
|
+
const before = this.overrides
|
|
182
|
+
const raw = readSettings(this.settingsPath)
|
|
183
|
+
const validated: Record<string, unknown> = {}
|
|
184
|
+
const changed: string[] = []
|
|
185
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
186
|
+
const desc = this.map.get(key)
|
|
187
|
+
if (!desc) continue // 未知键:忽略(schema 演进容错)
|
|
188
|
+
const errs = validateValue(desc, value)
|
|
189
|
+
if (errs.length) {
|
|
190
|
+
console.warn(`[system-config] 忽略无效运行时覆盖 ${key}=${JSON.stringify(value)}: ${errs.join('; ')}`)
|
|
191
|
+
continue
|
|
192
|
+
}
|
|
193
|
+
validated[key] = value
|
|
194
|
+
if (before[key] !== value) changed.push(key)
|
|
195
|
+
}
|
|
196
|
+
for (const key of Object.keys(before)) {
|
|
197
|
+
if (!(key in validated) && key in before) changed.push(key)
|
|
198
|
+
}
|
|
199
|
+
this.overrides = validated
|
|
200
|
+
this.recompute()
|
|
201
|
+
return { changed }
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* ---------------- 文件监听(外部写入热重载) ---------------- */
|
|
205
|
+
private watchFiles(): void {
|
|
206
|
+
const dataDir = join(this.root, 'data')
|
|
207
|
+
const handler = (eventType: string, filename: string | null) => {
|
|
208
|
+
const name = filename ?? ''
|
|
209
|
+
const isSettings = name.includes('runtime-settings.json')
|
|
210
|
+
const isConfig = name.includes('config.yml')
|
|
211
|
+
if (!isSettings && !isConfig) return
|
|
212
|
+
// atomic 写(tmp+rename)在 Windows 上会以 rename/unlink 触发;防抖合并
|
|
213
|
+
if (this.reloadTimer) clearTimeout(this.reloadTimer)
|
|
214
|
+
this.reloadTimer = setTimeout(() => {
|
|
215
|
+
if (this.disposed) return
|
|
216
|
+
const { changed } = this.reloadFromDisk()
|
|
217
|
+
this.broadcast({ type: 'config:reloaded', changed, ...this.eventTail() })
|
|
218
|
+
}, 300)
|
|
219
|
+
}
|
|
220
|
+
try {
|
|
221
|
+
if (existsSync(dataDir)) this.watcher.push(watch(dataDir, { persistent: false }, handler))
|
|
222
|
+
if (existsSync(this.root)) this.watcher.push(watch(this.root, { persistent: false }, handler))
|
|
223
|
+
}
|
|
224
|
+
catch (err) {
|
|
225
|
+
console.warn('[system-config] 文件监听不可用(外部写入将不热重载):', String(err?.message ?? err))
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* ---------------- 公共 API ---------------- */
|
|
230
|
+
|
|
231
|
+
snapshot(): PublicSnapshot {
|
|
232
|
+
return {
|
|
233
|
+
descriptors: this.descriptors,
|
|
234
|
+
effective: { ...this.effective },
|
|
235
|
+
overrides: { ...this.overrides },
|
|
236
|
+
sources: { ...this.sources },
|
|
237
|
+
settingsPath: this.settingsPath,
|
|
238
|
+
configPath: this.configPath,
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* 应用一批覆盖(PATCH 语义)。
|
|
244
|
+
* @param patch { [key]: value } value === null 表示清除该键覆盖(回落 config.yml/base)
|
|
245
|
+
* @returns { changed, restartRequired, effective, sources }
|
|
246
|
+
*/
|
|
247
|
+
patch(patch: Record<string, unknown>): { changed: string[], restartRequired: string[], effective: Record<string, unknown>, sources: Record<string, unknown> } {
|
|
248
|
+
const errors: Record<string, string[]> = {}
|
|
249
|
+
const next = { ...this.overrides }
|
|
250
|
+
const changed: string[] = []
|
|
251
|
+
for (const [key, rawValue] of Object.entries(patch)) {
|
|
252
|
+
const desc = this.map.get(key)
|
|
253
|
+
if (!desc) {
|
|
254
|
+
errors[key] = ['未知设置项(不在 shared/config/schema.json 中)']
|
|
255
|
+
continue
|
|
256
|
+
}
|
|
257
|
+
// null → 清除覆盖
|
|
258
|
+
if (rawValue === null || rawValue === undefined) {
|
|
259
|
+
if (key in next) {
|
|
260
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- 撤销覆盖语义
|
|
261
|
+
delete next[key]
|
|
262
|
+
changed.push(key)
|
|
263
|
+
}
|
|
264
|
+
continue
|
|
265
|
+
}
|
|
266
|
+
const errs = validateValue(desc, rawValue)
|
|
267
|
+
if (errs.length) {
|
|
268
|
+
errors[key] = errs
|
|
269
|
+
continue
|
|
270
|
+
}
|
|
271
|
+
if (next[key] !== rawValue) changed.push(key)
|
|
272
|
+
next[key] = rawValue
|
|
273
|
+
}
|
|
274
|
+
if (Object.keys(errors).length) {
|
|
275
|
+
throw new AppError(400, 'VALIDATION_ERROR', `设置校验失败: ${Object.entries(errors).map(([k, e]) => `${k}: ${e.join('; ')}`).join(' | ')}`)
|
|
276
|
+
}
|
|
277
|
+
if (changed.length) {
|
|
278
|
+
this.overrides = next
|
|
279
|
+
saveSettings(next, this.settingsPath)
|
|
280
|
+
this.recompute()
|
|
281
|
+
}
|
|
282
|
+
return this.result(changed)
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/** 清空全部运行时覆盖(回落 config.yml/base + env) */
|
|
286
|
+
reset(): { changed: string[], restartRequired: string[] } {
|
|
287
|
+
const changed = Object.keys(this.overrides)
|
|
288
|
+
this.overrides = {}
|
|
289
|
+
saveSettings({}, this.settingsPath)
|
|
290
|
+
this.recompute()
|
|
291
|
+
const res = this.result(changed)
|
|
292
|
+
this.broadcast({ type: 'config:reset', changed, ...this.eventTail() })
|
|
293
|
+
return res
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/** 手动重载(外部已改文件)并广播 */
|
|
297
|
+
reload(): { changed: string[], restartRequired: string[] } {
|
|
298
|
+
const { changed } = this.reloadFromDisk()
|
|
299
|
+
const res = this.result(changed)
|
|
300
|
+
this.broadcast({ type: 'config:reloaded', changed, ...this.eventTail() })
|
|
301
|
+
return res
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
subscribe(fn: Listener): () => void {
|
|
305
|
+
this.listeners.add(fn)
|
|
306
|
+
return () => this.listeners.delete(fn)
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
private eventTail() {
|
|
310
|
+
return { restartRequired: this.restartRequiredKeys(), effective: { ...this.effective }, sources: { ...this.sources }, overrides: { ...this.overrides }, at: new Date().toISOString() }
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
private result(changed: string[]): { changed: string[], restartRequired: string[], effective: Record<string, unknown>, sources: Record<string, unknown> } {
|
|
314
|
+
const out = this.eventTail()
|
|
315
|
+
const res = { changed, restartRequired: out.restartRequired as string[], effective: out.effective, sources: out.sources }
|
|
316
|
+
if (changed.length) this.broadcast({ type: 'config:changed', changed, ...out })
|
|
317
|
+
return res
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
private restartRequiredKeys(): string[] {
|
|
321
|
+
return this.descriptors.filter(d => d.applies === 'restart' && this.overrides[d.key] !== undefined).map(d => d.key)
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
private broadcast(payload: ConfigEventPayload): void {
|
|
325
|
+
for (const fn of [...this.listeners]) {
|
|
326
|
+
try {
|
|
327
|
+
fn(payload)
|
|
328
|
+
}
|
|
329
|
+
catch (err) {
|
|
330
|
+
console.error('[system-config] 广播监听器异常:', err)
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
dispose(): void {
|
|
336
|
+
this.disposed = true
|
|
337
|
+
for (const w of this.watcher) {
|
|
338
|
+
try {
|
|
339
|
+
w.close()
|
|
340
|
+
}
|
|
341
|
+
catch { /* 忽略 */ }
|
|
342
|
+
}
|
|
343
|
+
this.watcher = []
|
|
344
|
+
this.listeners.clear()
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/** 取服务单例;未初始化时惰性创建(幂等) */
|
|
349
|
+
export function getSystemConfigService(root = process.cwd()): SystemConfigService {
|
|
350
|
+
if (!globalThis.__systemConfig) {
|
|
351
|
+
const service = new SystemConfigService(root)
|
|
352
|
+
globalThis.__systemConfig = service
|
|
353
|
+
}
|
|
354
|
+
return globalThis.__systemConfig
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/** 便捷:读取当前快照(返回 null 表示不可用) */
|
|
358
|
+
export function useSystemConfig(): PublicSnapshot | null {
|
|
359
|
+
try {
|
|
360
|
+
return getSystemConfigService().snapshot()
|
|
361
|
+
}
|
|
362
|
+
catch {
|
|
363
|
+
return null
|
|
364
|
+
}
|
|
365
|
+
}
|