agentworkshop 0.7.6 → 0.7.8
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 +1 -1
- package/.output/.AgentWorkShop/prompts/host-tools.json +1 -1
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{rzGB_ojX.js → 3612gD2V.js} +2 -2
- package/.output/public/_nuxt/8eIQAVlb.js +1 -0
- package/.output/public/_nuxt/Ah9qOv1m.js +1 -0
- package/.output/public/_nuxt/{DdPeifHR.js → B4Fia4FB.js} +1 -1
- package/.output/public/_nuxt/B7aqqzkY.js +1 -0
- package/.output/public/_nuxt/BJ-fxrSw.js +1 -0
- package/.output/public/_nuxt/{DPDqAD1e.js → BSXx2vqR.js} +1 -1
- package/.output/public/_nuxt/{CdSgfcYR.js → BVZjSVs2.js} +1 -1
- package/.output/public/_nuxt/{DP6bdyIp.js → BVzDoF8t.js} +1 -1
- package/.output/public/_nuxt/BYL0Rjqj.js +7 -0
- package/.output/public/_nuxt/{CXmkVXS5.js → BjVLsC3M.js} +1 -1
- package/.output/public/_nuxt/{7ZABjMRh2.js → BkfchkK62.js} +1 -1
- package/.output/public/_nuxt/BnVoQ74r.js +1 -0
- package/.output/public/_nuxt/Bnp4vIAf.js +1 -0
- package/.output/public/_nuxt/BsMpJf7S.js +70 -0
- package/.output/public/_nuxt/{Z8k0uMSI.js → Bt_HDizI.js} +1 -1
- package/.output/public/_nuxt/Bu-P92Pe.js +18 -0
- package/.output/public/_nuxt/ButLXkjo.js +2 -0
- package/.output/public/_nuxt/{D8DDDzV62.js → C2iWjzEC2.js} +1 -1
- package/.output/public/_nuxt/{HWXLx5Hz.js → C8dxXc6K.js} +5 -5
- package/.output/public/_nuxt/CGdPdJPP.js +1 -0
- package/.output/public/_nuxt/{CN7Zh8GQ.js → CRGlf1Gb.js} +1 -1
- package/.output/public/_nuxt/{DSBfvCi5.js → CblLEiCZ.js} +7 -7
- package/.output/public/_nuxt/Cd15nPnG2.js +1 -0
- package/.output/public/_nuxt/{OwJ1LJkF.js → CsCpu2Zh.js} +1 -1
- package/.output/public/_nuxt/CvbHIGQY2.js +1 -0
- package/.output/public/_nuxt/Cyk3du4K2.js +1 -0
- package/.output/public/_nuxt/{DVQAz9WI.js → D4qXvjuV.js} +2 -2
- package/.output/public/_nuxt/{CfIXY-ET.js → DCEyMaN-.js} +1 -1
- package/.output/public/_nuxt/{BFYNhG9S.js → DCXIGxzT.js} +1 -1
- package/.output/public/_nuxt/{B9aPoQvt.js → DM8DS9MA.js} +1 -1
- package/.output/public/_nuxt/{ChnfyQHz.js → DNzaswei.js} +1 -1
- package/.output/public/_nuxt/{CrFGZYVB2.js → DYZBdSSg2.js} +1 -1
- package/.output/public/_nuxt/{dObsRdSQ.js → DZk24ego.js} +1 -1
- package/.output/public/_nuxt/{CyygA0q4.js → Dc46i75T.js} +4 -4
- package/.output/public/_nuxt/DeYsUzhr.js +1 -0
- package/.output/public/_nuxt/Dk6pq9JB2.js +1 -0
- package/.output/public/_nuxt/{ByGNWgAr.js → Do88WZG2.js} +3 -3
- package/.output/public/_nuxt/{R_WxTozV2.js → Du-eSpo2.js} +1 -1
- package/.output/public/_nuxt/OmpTerminalPanel.B_Pl5Ynm.css +1 -0
- package/.output/public/_nuxt/R_Wv_Nd9.js +1 -0
- package/.output/public/_nuxt/{Bsc69G4x.js → VnIWJ0ts.js} +3 -3
- package/.output/public/_nuxt/_id_.BzKMZnLe.css +1 -0
- package/.output/public/_nuxt/_id_.CbpDAWRh.css +1 -0
- package/.output/public/_nuxt/{_wsId_.DET_GinP.css → _wsId_.COUzMXpP.css} +1 -1
- package/.output/public/_nuxt/agents.BlejnOOC.css +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/e5bb1803-86d9-43b3-85be-dc787dc9a978.json +1 -0
- package/.output/public/_nuxt/daq.zZ8GR433.css +1 -0
- package/.output/public/_nuxt/{default.D17kXlD6.css → default.V3_hUJq1.css} +1 -1
- package/.output/public/_nuxt/{entry.DvlXlPwx.css → entry.5qf6EqfN.css} +1 -1
- package/.output/public/_nuxt/{B4GHHF6d2.js → fQUs58kX2.js} +1 -1
- package/.output/public/_nuxt/p7wSGMtc.js +1 -0
- package/.output/public/_nuxt/tRBT-plo.js +1 -0
- package/.output/public/_nuxt/workshop.3kAcLB_M.css +1 -0
- package/.output/server/chunks/_/SearchOutlined.mjs +4 -4
- package/.output/server/chunks/_/SearchOutlined.mjs.map +1 -1
- package/.output/server/chunks/_/character-asset.repo.mjs +3 -6
- package/.output/server/chunks/_/character-asset.repo.mjs.map +1 -1
- package/.output/server/chunks/_/host-bindings.mjs +1 -1
- package/.output/server/chunks/_/nitro.mjs +12807 -9814
- package/.output/server/chunks/_/nitro.mjs.map +1 -1
- package/.output/server/chunks/_/scene-layout.repo.mjs +4 -10
- package/.output/server/chunks/_/scene-layout.repo.mjs.map +1 -1
- package/.output/server/chunks/build/{Col-D7fjGDF6.mjs → Col-biaNnEPf.mjs} +2 -2
- package/.output/server/chunks/build/{Col-D7fjGDF6.mjs.map → Col-biaNnEPf.mjs.map} +1 -1
- package/.output/server/chunks/build/{OmpTerminalPanel-B_SYhmgb.mjs → OmpTerminalPanel-COphA1br.mjs} +20 -19
- package/.output/server/chunks/build/OmpTerminalPanel-COphA1br.mjs.map +1 -0
- package/.output/server/chunks/build/{TownView-Bl8Gkcxi.mjs → TownView-B5KifIaT.mjs} +5 -5
- package/.output/server/chunks/build/{TownView-Bl8Gkcxi.mjs.map → TownView-B5KifIaT.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-GnRJPykX.mjs → _id_-C-ewLgfl.mjs} +120 -120
- package/.output/server/chunks/build/{_id_-GnRJPykX.mjs.map → _id_-C-ewLgfl.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-CWLFGZjV.mjs → _id_-Ct4Jhvl1.mjs} +43 -39
- package/.output/server/chunks/build/_id_-Ct4Jhvl1.mjs.map +1 -0
- package/.output/server/chunks/build/{_wsId_-BhQMjyHG.mjs → _wsId_-CanI_6Su.mjs} +591 -53
- package/.output/server/chunks/build/{_wsId_-BhQMjyHG.mjs.map → _wsId_-CanI_6Su.mjs.map} +1 -1
- package/.output/server/chunks/build/{agents-D4l1icvn.mjs → agents-DSOptxXA.mjs} +146 -91
- package/.output/server/chunks/build/agents-DSOptxXA.mjs.map +1 -0
- package/.output/server/chunks/build/{alert-gH-s7yIh.mjs → alert-qJnjyRcP.mjs} +3 -3
- package/.output/server/chunks/build/{alert-gH-s7yIh.mjs.map → alert-qJnjyRcP.mjs.map} +1 -1
- package/.output/server/chunks/build/{button-BhbX5ACI.mjs → button-DEcZFcqN.mjs} +3 -3
- package/.output/server/chunks/build/{button-BhbX5ACI.mjs.map → button-DEcZFcqN.mjs.map} +1 -1
- package/.output/server/chunks/build/{card-l4BbX67w.mjs → card-Dipvaykh.mjs} +5 -5
- package/.output/server/chunks/build/{card-l4BbX67w.mjs.map → card-Dipvaykh.mjs.map} +1 -1
- package/.output/server/chunks/build/{channel-templates-DqjtC-R0.mjs → channel-templates-BK0KuPOd.mjs} +13 -12
- package/.output/server/chunks/build/channel-templates-BK0KuPOd.mjs.map +1 -0
- package/.output/server/chunks/build/{checkbox-BF11p3dH.mjs → checkbox-dzcpU_Cd.mjs} +4 -4
- package/.output/server/chunks/build/{checkbox-BF11p3dH.mjs.map → checkbox-dzcpU_Cd.mjs.map} +1 -1
- package/.output/server/chunks/build/{daq-BOgpn9sl.mjs → daq-D9RA_uze.mjs} +103 -103
- package/.output/server/chunks/build/{daq-BOgpn9sl.mjs.map → daq-D9RA_uze.mjs.map} +1 -1
- package/.output/server/chunks/build/dcw-BTM5YU-B.mjs +2 -2
- package/.output/server/chunks/build/{default-CKJWhkot.mjs → default-BfWGTlbj.mjs} +81 -23
- package/.output/server/chunks/build/{default-CKJWhkot.mjs.map → default-BfWGTlbj.mjs.map} +1 -1
- package/.output/server/chunks/build/{drawer-CVValqoh.mjs → drawer-Cmh90erI.mjs} +3 -3
- package/.output/server/chunks/build/{drawer-CVValqoh.mjs.map → drawer-Cmh90erI.mjs.map} +1 -1
- package/.output/server/chunks/build/{dropdown-ByCsEWlQ.mjs → dropdown-CGQ0KAzA.mjs} +2 -2
- package/.output/server/chunks/build/{dropdown-ByCsEWlQ.mjs.map → dropdown-CGQ0KAzA.mjs.map} +1 -1
- package/.output/server/chunks/build/{dropdown-Dex8PXu6.mjs → dropdown-vhn1NPFs.mjs} +4 -4
- package/.output/server/chunks/build/{dropdown-Dex8PXu6.mjs.map → dropdown-vhn1NPFs.mjs.map} +1 -1
- package/.output/server/chunks/build/{input-number-BBlRoAJ7.mjs → input-number-Bd55elNN.mjs} +5 -5
- package/.output/server/chunks/build/{input-number-BBlRoAJ7.mjs.map → input-number-Bd55elNN.mjs.map} +1 -1
- package/.output/server/chunks/build/{input--KMeLYqZ.mjs → input-sf_BT6o6.mjs} +3 -3
- package/.output/server/chunks/build/{input--KMeLYqZ.mjs.map → input-sf_BT6o6.mjs.map} +1 -1
- package/.output/server/chunks/build/logs-Dyk0I2I9.mjs +1 -1
- package/.output/server/chunks/build/{menu-xN-SXb9Q.mjs → menu-WCrlpYVh.mjs} +3 -3
- package/.output/server/chunks/build/{menu-xN-SXb9Q.mjs.map → menu-WCrlpYVh.mjs.map} +1 -1
- package/.output/server/chunks/build/{modal-DrCOcjrl.mjs → modal-yvUquPj5.mjs} +4 -4
- package/.output/server/chunks/build/{modal-DrCOcjrl.mjs.map → modal-yvUquPj5.mjs.map} +1 -1
- package/.output/server/chunks/build/{monitor-KW8WLOJd.mjs → monitor-MIOvsyLa.mjs} +21 -21
- package/.output/server/chunks/build/{monitor-KW8WLOJd.mjs.map → monitor-MIOvsyLa.mjs.map} +1 -1
- package/.output/server/chunks/build/pages-DR2bzczM.mjs +1 -1
- package/.output/server/chunks/build/{plugins-B-ZNey0Z.mjs → plugins-DnOBIWGg.mjs} +7 -7
- package/.output/server/chunks/build/{plugins-B-ZNey0Z.mjs.map → plugins-DnOBIWGg.mjs.map} +1 -1
- package/.output/server/chunks/build/{popconfirm-C5H1Qoh3.mjs → popconfirm-CRaHcz5O.mjs} +4 -4
- package/.output/server/chunks/build/{popconfirm-C5H1Qoh3.mjs.map → popconfirm-CRaHcz5O.mjs.map} +1 -1
- package/.output/server/chunks/build/{useWorkshopApi-Bh5VUHWu.mjs → segmented-DPe9ZzLO.mjs} +7 -78
- package/.output/server/chunks/build/segmented-DPe9ZzLO.mjs.map +1 -0
- package/.output/server/chunks/build/{select-D7H2ysgT.mjs → select-D-CeE5vY.mjs} +3 -3
- package/.output/server/chunks/build/{select-D7H2ysgT.mjs.map → select-D-CeE5vY.mjs.map} +1 -1
- package/.output/server/chunks/build/{settings-Cr06lbRy.mjs → settings-DA8IkGLo.mjs} +11 -11
- package/.output/server/chunks/build/{settings-Cr06lbRy.mjs.map → settings-DA8IkGLo.mjs.map} +1 -1
- package/.output/server/chunks/build/{space-DCwIlnkI.mjs → space-CCBYAkXt.mjs} +2 -2
- package/.output/server/chunks/build/{space-DCwIlnkI.mjs.map → space-CCBYAkXt.mjs.map} +1 -1
- package/.output/server/chunks/build/{switch-VC0m9ede.mjs → switch-CelRXpcy.mjs} +3 -3
- package/.output/server/chunks/build/{switch-VC0m9ede.mjs.map → switch-CelRXpcy.mjs.map} +1 -1
- package/.output/server/chunks/build/{table-BksLg3Q_.mjs → table-Cswq-l2r.mjs} +10 -10
- package/.output/server/chunks/build/{table-BksLg3Q_.mjs.map → table-Cswq-l2r.mjs.map} +1 -1
- package/.output/server/chunks/build/{tabs-CzUfD3iX.mjs → tabs-BM3tAh_J.mjs} +5 -5
- package/.output/server/chunks/build/{tabs-CzUfD3iX.mjs.map → tabs-BM3tAh_J.mjs.map} +1 -1
- package/.output/server/chunks/build/{tag-oQI3VtqM.mjs → tag-NO9jEqKy.mjs} +4 -4
- package/.output/server/chunks/build/{tag-oQI3VtqM.mjs.map → tag-NO9jEqKy.mjs.map} +1 -1
- package/.output/server/chunks/build/{teams-QR3BBF7A.mjs → teams-BhSKBBBM.mjs} +15 -14
- package/.output/server/chunks/build/teams-BhSKBBBM.mjs.map +1 -0
- package/.output/server/chunks/build/{tokens-DFvr_TLj.mjs → tokens-D_eyxmcv.mjs} +16 -16
- package/.output/server/chunks/build/{tokens-DFvr_TLj.mjs.map → tokens-D_eyxmcv.mjs.map} +1 -1
- package/.output/server/chunks/build/town-BUqRobze.mjs +1 -1
- package/.output/server/chunks/build/{town-_4tEEEVW.mjs → town-DPtOPRRO.mjs} +4 -4
- package/.output/server/chunks/build/{town-_4tEEEVW.mjs.map → town-DPtOPRRO.mjs.map} +1 -1
- package/.output/server/chunks/build/useDaqStream-hwkhJHFU.mjs +1 -1
- package/.output/server/chunks/build/useDcwStream-Bdew_yrr.mjs +1 -1
- package/.output/server/chunks/build/useLocalTime-9a4B-aHv.mjs +42 -0
- package/.output/server/chunks/build/useLocalTime-9a4B-aHv.mjs.map +1 -0
- package/.output/server/chunks/build/useWorkshopApi-D2gq06N2.mjs +81 -0
- package/.output/server/chunks/build/useWorkshopApi-D2gq06N2.mjs.map +1 -0
- package/.output/server/chunks/build/useWorkshopWs-B3j5wIAK.mjs +1 -1
- package/.output/server/chunks/build/user-Dk-ytEUV.mjs +1 -1
- package/.output/server/chunks/build/{users-4FZ0yFUO.mjs → users-CmVvb1oq.mjs} +16 -16
- package/.output/server/chunks/build/{users-4FZ0yFUO.mjs.map → users-CmVvb1oq.mjs.map} +1 -1
- package/.output/server/chunks/build/{workshop-k0XZTFKg.mjs → workshop-D5CQj2A8.mjs} +53 -47
- package/.output/server/chunks/build/workshop-D5CQj2A8.mjs.map +1 -0
- package/.output/server/chunks/build/workspaces-IfORCDJE.mjs +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +1 -1
- package/.output/server/chunks/routes/api/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/mcp/workshop.mjs +1 -1
- package/.output/server/chunks/routes/api/metrics.mjs +1 -1
- package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs +1 -1
- package/.output/server/chunks/routes/api/plugins/client/_name_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/plugins/manifest.get.mjs +1 -1
- package/.output/server/chunks/routes/api/system/config.get.mjs +1 -1
- package/.output/server/chunks/routes/api/system/index.get.mjs +3 -3
- package/.output/server/chunks/routes/api/system/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/index.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/system/monitor/terminal/ws.mjs +1 -1
- package/.output/server/chunks/routes/api/system/monitor/terminate.post.mjs +1 -1
- package/.output/server/chunks/routes/api/system/monitor.get.mjs +1 -1
- package/.output/server/chunks/routes/api/system/settings/events.get.mjs +1 -1
- package/.output/server/chunks/routes/api/system/settings/reset.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id_.put.mjs +1 -1
- package/.output/server/chunks/routes/api/users/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/login.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/logout.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/me.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/register.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/setup-status.get.mjs +25 -0
- package/.output/server/chunks/routes/api/users/setup-status.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/users/tokens/_id/token.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/tokens/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/users/tokens/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/_...path_.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/send.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/approvals/_id/decide.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs +6 -14
- package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs +39 -0
- package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/subscribe.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/approvals/_id/decide.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/character/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/assets/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/audit.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/caller.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +3 -3
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/from-channel.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/activate.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/_memoryId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/search.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/model.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/position.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/range.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/stop.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/events.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index3.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index3.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index4.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index4.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/queue.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs +9 -2
- 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 -1
- package/.output/server/chunks/routes/api/workshop/channels.post.mjs +3 -3
- package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs +7 -4
- 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 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs +247 -0
- package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs +27 -0
- package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs +20 -8
- package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index10.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index3.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index3.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index4.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index4.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index5.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index5.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index6.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index6.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index7.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index7.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index8.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index8.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index9.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/mailbox/all.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/mailbox.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/memories/maintenance.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/plugins/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/runtime.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/scene/layouts.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/complete.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/dispatch.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/report.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/deploy.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/members/_agentId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/users/me.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/users/register.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs +3 -3
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/index.delete.mjs +1 -1
- package/.output/server/chunks/routes/renderer.mjs +2 -2
- package/.output/server/chunks/virtual/entry.mjs +132 -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 +1 -1
- package/.output/server/package.json +1 -1
- package/README-zh.md +27 -7
- package/README.md +455 -435
- package/app/components/AppHeader.vue +56 -2
- package/app/components/workshop/ChannelSessionList.vue +703 -593
- package/app/components/workshop/terminal/OmpTerminalPanel.vue +2 -1
- package/app/composables/workshop/useLocalTime.ts +16 -0
- package/app/composables/workshop/useSceneLayouts.ts +2 -1
- package/app/composables/workshop/useWorkshopApi.ts +249 -224
- package/app/pages/daq/[id].vue +7 -6
- package/app/pages/daq/index.vue +2 -2
- package/app/pages/dcw/[id].vue +3 -3
- package/app/pages/workshop/agents.vue +432 -382
- package/app/pages/workshop/index.vue +25 -6
- package/bin/aw.mjs +0 -0
- package/cli/aw.mjs +8 -1
- package/cli/commands/stop.mjs +7 -4
- package/cli/commands/tui.mjs +10 -1
- package/cli/core/registry.mjs +5 -3
- package/config.yml +144 -134
- package/docs/tui.md +1 -1
- package/i18n/dicts/settings.json +4 -0
- package/i18n/locales/en.ts +9 -0
- package/i18n/locales/zh-CN.ts +9 -0
- package/package.json +148 -140
- package/scripts/_dbg-catalog-smoke.ts +20 -0
- package/scripts/_dbg-codex-handshake.ts +30 -0
- package/scripts/_dbg-codex-probe.mjs +58 -0
- package/scripts/_dbg-codex-sandbox.ts +58 -0
- package/scripts/_dbg-codex-turn.ts +65 -0
- package/scripts/_dbg-dsh-probe.mjs +31 -0
- package/scripts/_dbg-interval-config.mjs +145 -0
- package/scripts/_dbg-interval-scenario.mjs +126 -0
- package/scripts/_dbg-line-spawn.ts +31 -0
- package/scripts/_dbg-live-engine-probe.mjs +80 -0
- package/scripts/_dbg-mcp-bridge-probe.mjs +147 -0
- package/scripts/_dbg-opencode-sse.mjs +101 -0
- package/scripts/_dbg-opencode-start.ts +57 -0
- package/scripts/_dbg-plugin-matrix.mjs +212 -0
- package/scripts/_dbg-protocol-matrix.mjs +425 -0
- package/scripts/_dbg-real-scenario-timeline.log +123 -0
- package/scripts/_dbg-registry-smoke.ts +14 -0
- package/scripts/_dbg-setup-e2e.mjs +88 -0
- package/scripts/_dbg-sim-keeper.mjs +100 -0
- package/scripts/_dbg-team-drill.mjs +173 -0
- package/scripts/dev-guard.mjs +11 -3
- package/scripts/dev-protocol-simulators.mjs +28 -1
- package/scripts/e2e-harness-provider-task.mjs +126 -0
- package/scripts/e2e-multi-harness.ts +374 -0
- package/scripts/e2e-multiharness-team.mjs +319 -0
- package/scripts/e2e-plc-scenario.mjs +292 -0
- package/scripts/e2e-real-scenario.mjs +452 -0
- package/scripts/migrate-local-time.mjs +123 -0
- package/scripts/start.mjs +30 -2
- package/server/api/system/settings/index.get.ts +3 -3
- package/server/api/users/setup-status.get.ts +8 -0
- package/server/api/workshop/agent-tools/invoke.post.ts +27 -41
- package/server/api/workshop/agent-tools/list.get.ts +25 -0
- package/server/api/workshop/channels/[id]/index.patch.ts +38 -30
- package/server/api/workshop/daq/[id]/samples.get.ts +8 -3
- package/server/api/workshop/harnesses/[id]/providers.get.ts +16 -0
- package/server/api/workshop/harnesses.get.ts +12 -0
- package/server/api/workshop/hitl/respond.post.ts +87 -67
- package/server/api/workshop/ws.ts +13 -0
- package/server/data/daqs.json +1421 -19
- package/server/data/dcw-lines.json +273 -0
- package/server/data/dcw-products.json +224 -0
- package/server/data/dcw-recipes.json +868 -0
- package/server/data/dcw-rollback.json +1177 -1
- package/server/data/dcw-runs.json +3032 -2834
- package/server/data/dcw-writes.json +1116 -0
- package/server/data/dcws.json +3447 -297
- package/server/data/line-runs.json +52 -2
- package/server/harness/aw-mcp-bridge.mjs +153 -0
- package/server/plugins/00-local-time.ts +10 -0
- package/server/plugins/aw-plugins.ts +3 -0
- package/server/plugins/backup.ts +116 -97
- package/server/plugins/dev-stability-guard.ts +24 -15
- package/server/plugins/retention.ts +1 -0
- package/server/plugins/security.ts +46 -29
- package/server/plugins/workshop.ts +156 -153
- package/server/repositories/user.repository.ts +15 -22
- package/server/services/system-config.ts +32 -6
- package/server/services/user.service.ts +8 -3
- package/server/services/workshop/.mimosa/hook-state/sess_fed429fb-c8b7-4a50-bbd6-45afc580893f.json +1 -0
- package/server/services/workshop/.mimosa/hook-status/sess_fed429fb-c8b7-4a50-bbd6-45afc580893f-e6b75bbfe6.json +14 -0
- package/server/services/workshop/agents/adapters/line-spawn.ts +111 -0
- package/server/services/workshop/agents/adapters/stdio-jsonrpc.ts +316 -0
- package/server/services/workshop/agents/agent-interface.ts +17 -0
- package/server/services/workshop/agents/codex-agent.ts +822 -0
- package/server/services/workshop/agents/dsh-agent.ts +670 -0
- package/server/services/workshop/agents/factory.ts +4 -16
- package/server/services/workshop/agents/harness-env.ts +54 -0
- package/server/services/workshop/agents/harness-models.ts +270 -0
- package/server/services/workshop/agents/host-tool-bridge.ts +612 -0
- package/server/services/workshop/agents/industrial-tools.ts +7 -1
- package/server/services/workshop/agents/node-bindings.repo.ts +4 -5
- package/server/services/workshop/agents/omp-agent.ts +1178 -1957
- package/server/services/workshop/agents/opencode-agent.ts +987 -0
- package/server/services/workshop/agents/prompt-builder.ts +393 -0
- package/server/services/workshop/agents/registry.ts +125 -0
- package/server/services/workshop/assets/character-asset.repo.ts +3 -5
- package/server/services/workshop/assets/device-twin.repo.ts +3 -5
- package/server/services/workshop/daq/daq-controller.ts +38 -6
- package/server/services/workshop/daq/daq-node.repo.ts +3 -5
- package/server/services/workshop/daq/daq-node.ts +3 -3
- package/server/services/workshop/daq/daq-runtime.ts +4 -3
- package/server/services/workshop/daq/daq-templates.ts +3 -5
- package/server/services/workshop/daq/drivers.ts +41 -12
- package/server/services/workshop/daq/storage/sqlite.adapter.ts +313 -309
- package/server/services/workshop/db/backup-registry.ts +33 -0
- package/server/services/workshop/db/channel.repo.ts +104 -101
- package/server/services/workshop/db/database.ts +956 -949
- package/server/services/workshop/dcw/dcw-controller.ts +5 -1
- package/server/services/workshop/dcw/dcw-line.repo.ts +4 -11
- package/server/services/workshop/dcw/dcw-node.repo.ts +3 -5
- package/server/services/workshop/dcw/dcw-node.ts +13 -1
- package/server/services/workshop/dcw/dcw-product.repo.ts +3 -4
- package/server/services/workshop/dcw/dcw-recipe.repo.ts +3 -19
- package/server/services/workshop/dcw/dcw-templates.ts +3 -5
- package/server/services/workshop/dcw/drivers.ts +37 -13
- package/server/services/workshop/dcw/line-run.ts +3 -5
- package/server/services/workshop/dcw/recipe-rollback.repo.ts +4 -10
- package/server/services/workshop/json-store.mjs +72 -0
- package/server/services/workshop/plugins/host.mjs +2 -1
- package/server/services/workshop/runtime/agent-runtime.ts +44 -0
- package/server/services/workshop/runtime/manager.ts +2953 -2868
- package/server/services/workshop/scene/scene-layout.repo.ts +4 -11
- package/server/services/workshop/settings.ts +30 -0
- package/shared/config/schema.json +9 -0
- package/shared/config/single-instance.mjs +5 -1
- package/shared/local-time.mjs +36 -0
- package/shared/workshop-protocol.ts +11 -5
- package/tui/aw-tui.mjs +28 -10
- package/tui/components/hitl-card.mjs +47 -36
- package/tui/lib/ws.mjs +2 -1
- package/.output/public/_nuxt/9X0fVBD7.js +0 -57
- package/.output/public/_nuxt/B6M2WJWm2.js +0 -1
- package/.output/public/_nuxt/B9Yie5HN.js +0 -2
- package/.output/public/_nuxt/BF9XPEuw.js +0 -1
- package/.output/public/_nuxt/BbQornXa.js +0 -1
- package/.output/public/_nuxt/Bxgaym6j.js +0 -1
- package/.output/public/_nuxt/Bxh5nf8j.js +0 -1
- package/.output/public/_nuxt/CXLI50Sq.js +0 -1
- package/.output/public/_nuxt/CdfAP_IH2.js +0 -1
- package/.output/public/_nuxt/Ce1zyNYu.js +0 -1
- package/.output/public/_nuxt/D-Ne4C9a.js +0 -1
- package/.output/public/_nuxt/DEHNjlTq2.js +0 -1
- package/.output/public/_nuxt/DFnGFEav.js +0 -18
- package/.output/public/_nuxt/DYWgGHNo.js +0 -7
- package/.output/public/_nuxt/OmpTerminalPanel.Bc9GjNU5.css +0 -1
- package/.output/public/_nuxt/W1E3-5ML.js +0 -14
- package/.output/public/_nuxt/XVB9_zwP.js +0 -1
- package/.output/public/_nuxt/Xaf_HIR3.js +0 -1
- package/.output/public/_nuxt/_id_.BeqSLvl_.css +0 -1
- package/.output/public/_nuxt/_id_.DN3U6EF9.css +0 -1
- package/.output/public/_nuxt/agents.BJwgTLFZ.css +0 -1
- package/.output/public/_nuxt/builds/meta/55c10854-ee0e-4be4-924b-a1b0e100fe11.json +0 -1
- package/.output/public/_nuxt/daq.BXsnevQv.css +0 -1
- package/.output/public/_nuxt/workshop.B98sHiJq.css +0 -1
- package/.output/public/_nuxt/yIKY_V1P.js +0 -1
- package/.output/server/chunks/build/OmpTerminalPanel-B_SYhmgb.mjs.map +0 -1
- package/.output/server/chunks/build/_id_-CWLFGZjV.mjs.map +0 -1
- package/.output/server/chunks/build/agents-D4l1icvn.mjs.map +0 -1
- package/.output/server/chunks/build/channel-templates-DqjtC-R0.mjs.map +0 -1
- package/.output/server/chunks/build/interval-WlxgjTzO.mjs +0 -9
- package/.output/server/chunks/build/interval-WlxgjTzO.mjs.map +0 -1
- package/.output/server/chunks/build/teams-QR3BBF7A.mjs.map +0 -1
- package/.output/server/chunks/build/useWorkshopApi-Bh5VUHWu.mjs.map +0 -1
- package/.output/server/chunks/build/workshop-k0XZTFKg.mjs.map +0 -1
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PromptBuilder —— 回合 prompt 组装(harness 无关)。
|
|
3
|
+
*
|
|
4
|
+
* 从 omp-agent 抽出:场景 × 身份 × 工业简报 × 团队名册 × 记忆 × 系统手册 ×
|
|
5
|
+
* 工作流/调度指令的全部组合逻辑。所有 harness impl(omp/codex/dsh/opencode)
|
|
6
|
+
* 用同一函数组装回合 prompt,保证"omp 运行时注入的内容"在其余引擎等价注入。
|
|
7
|
+
* 模板与提示词仍外置 .AgentWorkShop/prompts/(loader 渲染)。
|
|
8
|
+
*/
|
|
9
|
+
import type {
|
|
10
|
+
AgentInfo,
|
|
11
|
+
AgentRunContext,
|
|
12
|
+
SupervisionSnapshot,
|
|
13
|
+
} from './agent-interface'
|
|
14
|
+
import { renderPrompt } from '../prompts/loader'
|
|
15
|
+
import { buildIndustrialContext, industrialLoopGuide } from './industrial-context'
|
|
16
|
+
|
|
17
|
+
/** 工具参数预览(Codex 式紧凑工具行):`name(path)` / `name(a=1, b=2)` */
|
|
18
|
+
export function toolArgsPreview(args: unknown): string {
|
|
19
|
+
if (!args || typeof args !== 'object' || Array.isArray(args)) return ''
|
|
20
|
+
const a = args as Record<string, unknown>
|
|
21
|
+
const single = ['path', 'file', 'filename', 'command', 'cmd', 'query', 'pattern', 'url', 'taskId', 'task_id', 'id', 'name', 'toolName']
|
|
22
|
+
const pick = single.find(k => typeof a[k] === 'string' && (a[k] as string).length > 0)
|
|
23
|
+
let preview: string
|
|
24
|
+
if (pick) {
|
|
25
|
+
preview = (a[pick] as string)
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
const scalars = Object.entries(a)
|
|
29
|
+
.filter(([, v]) => typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean')
|
|
30
|
+
.slice(0, 2)
|
|
31
|
+
.map(([k, v]) => `${k}=${String(v)}`)
|
|
32
|
+
if (scalars.length === 0) return ''
|
|
33
|
+
preview = scalars.join(', ')
|
|
34
|
+
}
|
|
35
|
+
const flat = preview.replace(/\s+/g, ' ').trim()
|
|
36
|
+
if (!flat) return ''
|
|
37
|
+
return `(${flat.length > 64 ? `${flat.slice(0, 64)}…` : flat})`
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** 安全 JSON 解析(容错:提取第一个 JSON 数组;supervise 文本决策兜底用) */
|
|
41
|
+
export function extractJsonArray(text: string): unknown[] | null {
|
|
42
|
+
const trimmed = text.trim()
|
|
43
|
+
try {
|
|
44
|
+
const parsed = JSON.parse(trimmed)
|
|
45
|
+
if (Array.isArray(parsed)) return parsed
|
|
46
|
+
return null
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// 继续
|
|
50
|
+
}
|
|
51
|
+
const start = trimmed.indexOf('[')
|
|
52
|
+
const end = trimmed.lastIndexOf(']')
|
|
53
|
+
if (start >= 0 && end > start) {
|
|
54
|
+
try {
|
|
55
|
+
const parsed = JSON.parse(trimmed.slice(start, end + 1))
|
|
56
|
+
if (Array.isArray(parsed)) return parsed
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// 继续
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return null
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 前置上下文段(channel 场景 + 实例身份):场景优先级最高——用户对整个作业
|
|
67
|
+
* 场景的规范要求,全体成员共享;未设定时注入通用默认场景(prompts/scenario-default.md)。
|
|
68
|
+
* 附工业工况简报与调控作业环(有绑定节点才注入)。
|
|
69
|
+
*/
|
|
70
|
+
export function contextPrefix(opts: {
|
|
71
|
+
scenarioPrompt?: string
|
|
72
|
+
systemPromptPrefix?: string
|
|
73
|
+
agentId: string
|
|
74
|
+
roster?: string
|
|
75
|
+
}): string {
|
|
76
|
+
const scenario = typeof opts.scenarioPrompt === 'string' ? opts.scenarioPrompt.trim() : ''
|
|
77
|
+
const identity = opts.systemPromptPrefix ?? ''
|
|
78
|
+
const parts: string[] = []
|
|
79
|
+
parts.push(
|
|
80
|
+
scenario
|
|
81
|
+
? `## Scenario Brief (channel-wide, highest priority — user-defined operating rules)\n${scenario}`
|
|
82
|
+
: renderPrompt('scenario-default'),
|
|
83
|
+
``,
|
|
84
|
+
)
|
|
85
|
+
if (identity) {
|
|
86
|
+
parts.push(
|
|
87
|
+
`## Your Profile (agent-specific)\n${identity}`,
|
|
88
|
+
``,
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
// 工业工况简报(实时):本 Agent 绑定节点所在的产线运行状态/活动配方窗口/关联设备
|
|
92
|
+
// 孪生遥测 —— 让 Agent 每次回合开头就知道自己在哪条产线、生产什么、窗口多少、
|
|
93
|
+
// 设备当前状态,从而把节点读写放进工艺上下文里决策(而非盲操作)。
|
|
94
|
+
const industrial = buildIndustrialContext(opts.agentId)
|
|
95
|
+
if (industrial) {
|
|
96
|
+
parts.push(industrial, ``)
|
|
97
|
+
}
|
|
98
|
+
// 工业调控作业环(方法论层):有绑定节点才注入 —— 保证 Agent 在拿到任何
|
|
99
|
+
// 工具之前就理解「观察→理解→窗口内小步幅→执行→复测」的调控纪律。
|
|
100
|
+
const loop = industrialLoopGuide(opts.agentId)
|
|
101
|
+
if (loop) {
|
|
102
|
+
parts.push(loop, ``)
|
|
103
|
+
}
|
|
104
|
+
if (opts.roster) {
|
|
105
|
+
parts.push(opts.roster, ``)
|
|
106
|
+
}
|
|
107
|
+
return parts.join('\n')
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** 系统设计手册(prompts/system-manual.md):让 agent 真正理解其运行环境。 */
|
|
111
|
+
export function systemManual(): string {
|
|
112
|
+
return renderPrompt('system-manual')
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface RosterCache {
|
|
116
|
+
/** 名册文本(30s TTL;拉取失败置空下次重试,寻址层另有名字容错兜底) */
|
|
117
|
+
roster(): Promise<string>
|
|
118
|
+
invalidate(): void
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* 团队名册缓存(prompts/team-roster.md):每位成员一行 — id(寻址键)/名字/角色/
|
|
123
|
+
* harness/专长;自己的条目带 ← 你 标记。所有回合(worker/supervise/peer)统一注入。
|
|
124
|
+
*/
|
|
125
|
+
export function createRosterCache(opts: {
|
|
126
|
+
selfAgentId: string
|
|
127
|
+
listAgents: () => Promise<AgentInfo[]>
|
|
128
|
+
}): RosterCache {
|
|
129
|
+
let cache: string | null = null
|
|
130
|
+
let at = 0
|
|
131
|
+
return {
|
|
132
|
+
async roster(): Promise<string> {
|
|
133
|
+
if (cache !== null && Date.now() - at < 30_000) return cache
|
|
134
|
+
try {
|
|
135
|
+
const agents = await opts.listAgents()
|
|
136
|
+
const condense = (s: unknown): string =>
|
|
137
|
+
String(s ?? '').replace(/\s+/g, ' ').trim().slice(0, 110)
|
|
138
|
+
const lines = agents
|
|
139
|
+
.filter(a => a.enabled !== 0)
|
|
140
|
+
.map((a) => {
|
|
141
|
+
const specialty = condense(a.config?.systemPromptPrefix)
|
|
142
|
+
const self = a.id === opts.selfAgentId ? ' ← 你' : ''
|
|
143
|
+
return `- id: ${a.id} | ${a.name}${self} | role=${a.role} | harness=${a.harness}${specialty ? ` | 擅长: ${specialty}` : ''}`
|
|
144
|
+
})
|
|
145
|
+
.join('\n')
|
|
146
|
+
cache = renderPrompt('team-roster', { rosterLines: lines })
|
|
147
|
+
at = Date.now()
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
cache = null
|
|
151
|
+
at = 0
|
|
152
|
+
}
|
|
153
|
+
return cache ?? ''
|
|
154
|
+
},
|
|
155
|
+
invalidate(): void {
|
|
156
|
+
cache = null
|
|
157
|
+
at = 0
|
|
158
|
+
},
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** worker 任务回合 prompt(与原 omp 组装逐段一致) */
|
|
163
|
+
export function workerPrompt(opts: {
|
|
164
|
+
agentName: string
|
|
165
|
+
channelId: string
|
|
166
|
+
taskId: string
|
|
167
|
+
taskText: string
|
|
168
|
+
memory?: string
|
|
169
|
+
ctxPrefix: string
|
|
170
|
+
manual: string
|
|
171
|
+
}): string {
|
|
172
|
+
const parts: string[] = []
|
|
173
|
+
if (opts.ctxPrefix) parts.push(opts.ctxPrefix)
|
|
174
|
+
if (opts.memory) parts.push(opts.memory)
|
|
175
|
+
parts.push(opts.manual)
|
|
176
|
+
parts.push(renderPrompt('worker-workflow', {
|
|
177
|
+
agentName: opts.agentName,
|
|
178
|
+
channelId: opts.channelId,
|
|
179
|
+
taskId: opts.taskId,
|
|
180
|
+
taskText: opts.taskText,
|
|
181
|
+
}))
|
|
182
|
+
return parts.join('\n')
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** 点对点消息回合 prompt(触发器语义/回执关联/跨 Channel 三态,模板外置) */
|
|
186
|
+
export function peerPrompt(opts: {
|
|
187
|
+
agentName: string
|
|
188
|
+
role: 'lead' | 'worker'
|
|
189
|
+
channelId: string
|
|
190
|
+
ctxPrefix: string
|
|
191
|
+
manual: string
|
|
192
|
+
memory?: string
|
|
193
|
+
fromId: string
|
|
194
|
+
messageId: string
|
|
195
|
+
requireReply: boolean
|
|
196
|
+
isReply: boolean
|
|
197
|
+
crossChannel: boolean
|
|
198
|
+
fromChannel: string
|
|
199
|
+
msgText: string
|
|
200
|
+
}): string {
|
|
201
|
+
const roleLine = opts.role === 'lead'
|
|
202
|
+
? `You are "${opts.agentName}", the LEAD coordinator of a multi-agent team (Channel: ${opts.channelId}). A team member sent you a direct message.`
|
|
203
|
+
: `You are "${opts.agentName}", a worker agent in a multi-agent team (Channel: ${opts.channelId}).`
|
|
204
|
+
|
|
205
|
+
const respondBlock = opts.crossChannel
|
|
206
|
+
? renderPrompt('peer-reply-cross-channel', { fromId: opts.fromId, messageId: opts.messageId, fromChannel: opts.fromChannel })
|
|
207
|
+
: renderPrompt(opts.requireReply ? 'peer-reply-required' : 'peer-reply-optional', {
|
|
208
|
+
fromId: opts.fromId,
|
|
209
|
+
messageId: opts.messageId,
|
|
210
|
+
})
|
|
211
|
+
const peerBody = renderPrompt('peer-message', {
|
|
212
|
+
fromId: opts.fromId,
|
|
213
|
+
messageId: opts.messageId,
|
|
214
|
+
requireReply: opts.requireReply,
|
|
215
|
+
isReplyTo: opts.isReply ? `in_reply_to: ${opts.messageId}` : '',
|
|
216
|
+
msgText: opts.msgText,
|
|
217
|
+
respondBlock,
|
|
218
|
+
})
|
|
219
|
+
const lines: string[] = [
|
|
220
|
+
roleLine,
|
|
221
|
+
``, opts.ctxPrefix,
|
|
222
|
+
``, opts.manual,
|
|
223
|
+
``,
|
|
224
|
+
...(opts.memory ? [``, opts.memory] : []),
|
|
225
|
+
``,
|
|
226
|
+
peerBody,
|
|
227
|
+
]
|
|
228
|
+
if (opts.role === 'lead') {
|
|
229
|
+
lines.push(``, renderPrompt('peer-lead-roster'))
|
|
230
|
+
}
|
|
231
|
+
return lines.join('\n')
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* 成员能力画像(koda 运营信号借鉴):按任务历史计算
|
|
236
|
+
* total/completed/failed/successRate/avgDurationMs(仅统计已终态任务)。
|
|
237
|
+
*/
|
|
238
|
+
function capabilityProfiles(snapshot: SupervisionSnapshot): Map<string, { total: number, completed: number, failed: number, successRate: number, avgDurationMs: number }> {
|
|
239
|
+
const byAgent = new Map<string, { total: number, completed: number, failed: number, durationSum: number }>()
|
|
240
|
+
for (const t of snapshot.tasks) {
|
|
241
|
+
if (!['COMPLETED', 'FAILED'].includes(t.state)) continue
|
|
242
|
+
const agg = byAgent.get(t.assigneeId) ?? { total: 0, completed: 0, failed: 0, durationSum: 0 }
|
|
243
|
+
agg.total += 1
|
|
244
|
+
if (t.state === 'COMPLETED') {
|
|
245
|
+
agg.completed += 1
|
|
246
|
+
agg.durationSum += Math.max(0, new Date(t.updatedAt).getTime() - new Date(t.createdAt).getTime())
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
agg.failed += 1
|
|
250
|
+
}
|
|
251
|
+
byAgent.set(t.assigneeId, agg)
|
|
252
|
+
}
|
|
253
|
+
const out = new Map<string, { total: number, completed: number, failed: number, successRate: number, avgDurationMs: number }>()
|
|
254
|
+
for (const [agentId, agg] of byAgent) {
|
|
255
|
+
out.set(agentId, {
|
|
256
|
+
total: agg.total,
|
|
257
|
+
completed: agg.completed,
|
|
258
|
+
failed: agg.failed,
|
|
259
|
+
successRate: agg.total > 0 ? agg.completed / agg.total : 0,
|
|
260
|
+
avgDurationMs: agg.completed > 0 ? agg.durationSum / agg.completed : 0,
|
|
261
|
+
})
|
|
262
|
+
}
|
|
263
|
+
return out
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/** 从 description 前缀检测执行模式 */
|
|
267
|
+
function detectMode(desc: string): { mode: string, criteria?: string, stages?: string[], interval?: number } | null {
|
|
268
|
+
const match = desc.match(/^\[mode:(goal|loop|pipeline)\]/)
|
|
269
|
+
if (!match) return null
|
|
270
|
+
const mode = match[1]!
|
|
271
|
+
const result: { mode: string, criteria?: string, stages?: string[], interval?: number } = { mode }
|
|
272
|
+
if (mode === 'goal') {
|
|
273
|
+
const crit = desc.match(/\[criteria:([^\]]+)\]/)
|
|
274
|
+
if (crit) result.criteria = crit[1]
|
|
275
|
+
}
|
|
276
|
+
if (mode === 'loop') {
|
|
277
|
+
const intv = desc.match(/\[interval:(\d+)\]/)
|
|
278
|
+
if (intv) result.interval = parseInt(intv[1]!, 10)
|
|
279
|
+
}
|
|
280
|
+
if (mode === 'pipeline') {
|
|
281
|
+
const stg = desc.match(/\[stages:([^\]]+)\]/)
|
|
282
|
+
if (stg) result.stages = stg[1]!.split('->')
|
|
283
|
+
}
|
|
284
|
+
return result
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/** 构建模式特定指令(外置 mode-goal/loop/pipeline.md) */
|
|
288
|
+
function buildModeInstructions(modeInfo: { mode: string, criteria?: string, stages?: string[], interval?: number }): string[] {
|
|
289
|
+
if (modeInfo.mode === 'goal') {
|
|
290
|
+
return [renderPrompt('mode-goal', { criteria: modeInfo.criteria ?? '任务描述中的需求已全部完成' })]
|
|
291
|
+
}
|
|
292
|
+
if (modeInfo.mode === 'loop') {
|
|
293
|
+
return [renderPrompt('mode-loop', { interval: (modeInfo.interval ?? 60000) / 1000 })]
|
|
294
|
+
}
|
|
295
|
+
if (modeInfo.mode === 'pipeline') {
|
|
296
|
+
const stageList = modeInfo.stages?.length
|
|
297
|
+
? modeInfo.stages.map((s, i) => ` Stage ${i + 1}: ${s}`).join('\n')
|
|
298
|
+
: ' Decompose the task into sequential stages yourself.'
|
|
299
|
+
return [renderPrompt('mode-pipeline', { stageList })]
|
|
300
|
+
}
|
|
301
|
+
return []
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/** lead 调度回合 prompt(快照格式化 + 能力画像 + 邮件 + 模式指令,与原 omp 一致) */
|
|
305
|
+
export function supervisePrompt(opts: {
|
|
306
|
+
snapshot: SupervisionSnapshot
|
|
307
|
+
agentName: string
|
|
308
|
+
channelId: string
|
|
309
|
+
ctxPrefix: string
|
|
310
|
+
manual: string
|
|
311
|
+
memory?: string
|
|
312
|
+
}): string {
|
|
313
|
+
const snapshot = opts.snapshot
|
|
314
|
+
const parts: string[] = []
|
|
315
|
+
if (opts.ctxPrefix) parts.push(opts.ctxPrefix)
|
|
316
|
+
if (opts.memory) parts.push(opts.memory)
|
|
317
|
+
parts.push(opts.manual)
|
|
318
|
+
|
|
319
|
+
const capability = capabilityProfiles(snapshot)
|
|
320
|
+
const members = snapshot.members.map((m) => {
|
|
321
|
+
const cap = capability.get(m.agentId)
|
|
322
|
+
const capLine = cap && cap.total > 0
|
|
323
|
+
? `, 成功率=${Math.round(cap.successRate * 100)}%, 均耗时=${Math.round(cap.avgDurationMs / 1000)}s, 失败=${cap.failed}`
|
|
324
|
+
: ', 暂无历史'
|
|
325
|
+
const prog = m.currentTaskProgress != null
|
|
326
|
+
? `, progress=${m.currentTaskProgress}%${m.stalled ? ' [STALLED 停滞,请介入:notify/reassign/cancel]' : ''}`
|
|
327
|
+
: ''
|
|
328
|
+
const execTitle = m.currentTaskTitle ? `「${m.currentTaskTitle}」` : ''
|
|
329
|
+
return ` - ${m.agentId} (${m.name}, role=${m.role}, state=${m.state}, executing=${m.currentTaskId ?? '-'}${execTitle}, queued=${m.queued ?? 0}, completed=${m.completedCount ?? 0}${prog}${capLine})`
|
|
330
|
+
}).join('\n')
|
|
331
|
+
|
|
332
|
+
const tasks = snapshot.tasks.map((t) => {
|
|
333
|
+
const deliverable = t.state === 'COMPLETED' && t.artifacts.length > 0
|
|
334
|
+
? ` — 交付:${t.artifacts.map(a => a.parts.map(p => 'text' in p ? p.text : '').join(' ').replace(/\s+/g, ' ').trim().slice(0, 200)).filter(Boolean).join(' / ').slice(0, 400) || '(空)'}`
|
|
335
|
+
: ''
|
|
336
|
+
const artifacts = t.artifacts.length > 0 ? `, artifacts=${t.artifacts.length}` : ''
|
|
337
|
+
return ` - ${t.id} [${t.state}] "${t.title}" (assignee=${t.assigneeId}, progress=${t.progress}%${artifacts})${deliverable}`
|
|
338
|
+
}).join('\n')
|
|
339
|
+
|
|
340
|
+
const pending = Object.entries(snapshot.pendingChildren)
|
|
341
|
+
.map(([parentId, count]) => ` ${parentId}: ${count} pending`)
|
|
342
|
+
.join('\n')
|
|
343
|
+
|
|
344
|
+
const mail = (snapshot.mail ?? []).map((m) => {
|
|
345
|
+
const from = m.fromAgentId ?? '(system)'
|
|
346
|
+
const to = m.toAgentId ?? '(broadcast)'
|
|
347
|
+
const body = m.parts.map(p => 'text' in p ? p.text : JSON.stringify('data' in p ? p.data : p)).join(' ').trim().slice(0, 140)
|
|
348
|
+
const label = m.metadata?.['x-aw-task-kind'] === 'assign'
|
|
349
|
+
? 'task-assign'
|
|
350
|
+
: m.metadata?.['x-aw-msg-priority'] === 'immediate' ? 'immediate' : 'peer'
|
|
351
|
+
return ` - [${m.createdAt.slice(11, 19)}] ${from} → ${to} (${label}): ${body || '(empty)'}`
|
|
352
|
+
}).join('\n')
|
|
353
|
+
|
|
354
|
+
const leadTask = snapshot.tasks.find(t =>
|
|
355
|
+
t.assigneeId === snapshot.members.find(m => m.role === 'lead')?.agentId
|
|
356
|
+
&& (t.state === 'SUBMITTED' || t.state === 'WORKING' || t.state === 'WAITING'),
|
|
357
|
+
)
|
|
358
|
+
const modeInfo = leadTask ? detectMode(leadTask.description ?? '') : null
|
|
359
|
+
|
|
360
|
+
parts.push(
|
|
361
|
+
`You are "${opts.agentName}", the lead coordinator of a multi-agent team (Channel: ${opts.channelId}).`,
|
|
362
|
+
`Tick #${snapshot.tick}`,
|
|
363
|
+
``,
|
|
364
|
+
`## Team Members (state + task queues)`,
|
|
365
|
+
members || ' (none)',
|
|
366
|
+
``,
|
|
367
|
+
`## All Tasks (FIFO order)`,
|
|
368
|
+
tasks || ' (none)',
|
|
369
|
+
``,
|
|
370
|
+
`## Pending Children Count`,
|
|
371
|
+
pending || ' (none)',
|
|
372
|
+
``,
|
|
373
|
+
`## Recent Team Mail (newest first)`,
|
|
374
|
+
mail || ' (none)',
|
|
375
|
+
)
|
|
376
|
+
|
|
377
|
+
if (modeInfo) {
|
|
378
|
+
parts.push('', ...buildModeInstructions(modeInfo))
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
parts.push('', renderPrompt('lead-supervise'))
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
return parts.join('\n')
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/** steer 触发横幅解析(实时注入回执上下文;AgentRuntime.injectSteer 生成,格式固定) */
|
|
388
|
+
export function parseSteerBanner(text: string): { fromId: string, messageId: string } | null {
|
|
389
|
+
const banner = text.match(/\[实时消息 from ([^\]]+)]:[\s\S]*?要求回复\(reply_to=([0-9a-f-]{36})\)/)
|
|
390
|
+
return banner ? { fromId: banner[1]!, messageId: banner[2]! } : null
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export type { AgentRunContext }
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Harness Registry —— 执行引擎注册表(单一事实源)。
|
|
3
|
+
*
|
|
4
|
+
* harness 的全部派生点从此处取:factory 装配、manager 白名单校验、
|
|
5
|
+
* GET /api/workshop/harnesses(前端下拉/能力徽标)。新增引擎 = 注册一项 + 实现一个
|
|
6
|
+
* AgentInterface,上层与前端零改动(下拉动态拉取)。
|
|
7
|
+
*/
|
|
8
|
+
import { AppError } from '../../../utils/errors'
|
|
9
|
+
import type { AgentInfo, AgentInterface } from './agent-interface'
|
|
10
|
+
import { MockAgentImpl } from './mock-agent'
|
|
11
|
+
import { OmpRpcAgentImpl } from './omp-agent'
|
|
12
|
+
import { ClaudeSdkAgentImpl } from './claude-agent'
|
|
13
|
+
import { OpenCodeAgentImpl } from './opencode-agent'
|
|
14
|
+
import { CodexAgentImpl } from './codex-agent'
|
|
15
|
+
import { DshAgentImpl } from './dsh-agent'
|
|
16
|
+
|
|
17
|
+
/** 引擎能力面(如实声明;前端徽标与上层降级依据) */
|
|
18
|
+
export interface HarnessCapabilities {
|
|
19
|
+
/** 同轮 steer 注入(false = 恒 deferred,消息走信箱) */
|
|
20
|
+
steer: boolean
|
|
21
|
+
/** lead 调度回合(prompt 驱动,全引擎可实现) */
|
|
22
|
+
supervise: boolean
|
|
23
|
+
/** 程序化 HITL(权限/审批可经 API 应答) */
|
|
24
|
+
hitl: boolean
|
|
25
|
+
/** /monitor 原始终端镜像 */
|
|
26
|
+
terminal: boolean
|
|
27
|
+
/** 上下文用量快照(getContextStats) */
|
|
28
|
+
contextStats: boolean
|
|
29
|
+
/** 平台可主动触发压缩(onTurnSettled 门控) */
|
|
30
|
+
compact: boolean
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface HarnessDef {
|
|
34
|
+
id: string
|
|
35
|
+
label: string
|
|
36
|
+
description: string
|
|
37
|
+
capabilities: HarnessCapabilities
|
|
38
|
+
create(config: Record<string, unknown>, agent: AgentInfo): AgentInterface
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const mockCaps: HarnessCapabilities = {
|
|
42
|
+
steer: true, supervise: false, hitl: false, terminal: false, contextStats: false, compact: false,
|
|
43
|
+
}
|
|
44
|
+
const ompCaps: HarnessCapabilities = {
|
|
45
|
+
steer: true, supervise: true, hitl: true, terminal: true, contextStats: true, compact: true,
|
|
46
|
+
}
|
|
47
|
+
const opencodeCaps: HarnessCapabilities = {
|
|
48
|
+
steer: true, supervise: true, hitl: true, terminal: false, contextStats: true, compact: true,
|
|
49
|
+
}
|
|
50
|
+
const codexCaps: HarnessCapabilities = {
|
|
51
|
+
steer: true, supervise: true, hitl: true, terminal: false, contextStats: true, compact: true,
|
|
52
|
+
}
|
|
53
|
+
const dshCaps: HarnessCapabilities = {
|
|
54
|
+
steer: false, supervise: true, hitl: true, terminal: false, contextStats: true, compact: false,
|
|
55
|
+
}
|
|
56
|
+
const claudeCaps: HarnessCapabilities = {
|
|
57
|
+
steer: false, supervise: false, hitl: false, terminal: false, contextStats: false, compact: false,
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const HARNESS_REGISTRY: Record<string, HarnessDef> = {
|
|
61
|
+
mock: {
|
|
62
|
+
id: 'mock',
|
|
63
|
+
label: 'mock(测试)',
|
|
64
|
+
description: '进程内模拟引擎:联调/测试,无 LLM 调用',
|
|
65
|
+
capabilities: mockCaps,
|
|
66
|
+
create: (config, agent) => new MockAgentImpl({ ...config, agentId: agent.id, name: agent.name, role: agent.role, channelId: agent.channelId, token: agent.token }),
|
|
67
|
+
},
|
|
68
|
+
omp: {
|
|
69
|
+
id: 'omp',
|
|
70
|
+
label: 'omp(真实 LLM)',
|
|
71
|
+
description: 'omp 子进程(RPC 模式),默认推荐引擎',
|
|
72
|
+
capabilities: ompCaps,
|
|
73
|
+
create: (config, agent) => new OmpRpcAgentImpl({ ...config, agentId: agent.id, name: agent.name, role: agent.role, channelId: agent.channelId, token: agent.token }),
|
|
74
|
+
},
|
|
75
|
+
opencode: {
|
|
76
|
+
id: 'opencode',
|
|
77
|
+
label: 'opencode',
|
|
78
|
+
description: 'OpenCode 引擎(serve 进程 + HTTP/SSE),权限审批走 HITL',
|
|
79
|
+
capabilities: opencodeCaps,
|
|
80
|
+
create: (config, agent) => new OpenCodeAgentImpl({ ...config, agentId: agent.id, name: agent.name, role: agent.role, channelId: agent.channelId, token: agent.token }),
|
|
81
|
+
},
|
|
82
|
+
codex: {
|
|
83
|
+
id: 'codex',
|
|
84
|
+
label: 'codex',
|
|
85
|
+
description: 'OpenAI Codex CLI(app-server JSON-RPC),命令审批走 HITL',
|
|
86
|
+
capabilities: codexCaps,
|
|
87
|
+
create: (config, agent) => new CodexAgentImpl({ ...config, agentId: agent.id, name: agent.name, role: agent.role, channelId: agent.channelId, token: agent.token }),
|
|
88
|
+
},
|
|
89
|
+
dsh: {
|
|
90
|
+
id: 'dsh',
|
|
91
|
+
label: 'dsh(DeepSeek)',
|
|
92
|
+
description: 'DeepSeek Harness(ACP 协议);无同轮 steer,审批走 HITL',
|
|
93
|
+
capabilities: dshCaps,
|
|
94
|
+
create: (config, agent) => new DshAgentImpl({ ...config, agentId: agent.id, name: agent.name, role: agent.role, channelId: agent.channelId, token: agent.token }),
|
|
95
|
+
},
|
|
96
|
+
claude: {
|
|
97
|
+
id: 'claude',
|
|
98
|
+
label: 'claude',
|
|
99
|
+
description: 'Claude Agent SDK(骨架,待接入)',
|
|
100
|
+
capabilities: claudeCaps,
|
|
101
|
+
create: config => new ClaudeSdkAgentImpl(config),
|
|
102
|
+
},
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function knownHarnesses(): string[] {
|
|
106
|
+
return Object.keys(HARNESS_REGISTRY)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function isKnownHarness(harness: string): boolean {
|
|
110
|
+
return harness in HARNESS_REGISTRY
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** registry 元信息(前端下拉/能力徽标;不含实现) */
|
|
114
|
+
export function harnessMetas(): Array<{ id: string, label: string, description: string, capabilities: HarnessCapabilities }> {
|
|
115
|
+
return Object.values(HARNESS_REGISTRY).map(({ id, label, description, capabilities }) => ({ id, label, description, capabilities }))
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** 按 harness 装配 AgentInterface(未知 harness 抛 UNKNOWN_HARNESS) */
|
|
119
|
+
export function createAgentImplByHarness(agent: AgentInfo): AgentInterface {
|
|
120
|
+
const def = HARNESS_REGISTRY[agent.harness]
|
|
121
|
+
if (!def) {
|
|
122
|
+
throw new AppError(400, 'UNKNOWN_HARNESS', `未知 harness: ${agent.harness}(可选 ${knownHarnesses().join('/')})`)
|
|
123
|
+
}
|
|
124
|
+
return def.create(agent.config ?? {}, agent)
|
|
125
|
+
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* 引删保护:appliedTo 里仍有 agent 绑定时,删除改为"停用"而非硬删。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import fs from 'node:fs'
|
|
10
9
|
import { join } from 'node:path'
|
|
11
10
|
import { ensureDataDir } from '@/shared/config/home.mjs'
|
|
11
|
+
import { loadJsonFile, saveJsonFileAtomic } from '../json-store.mjs'
|
|
12
12
|
|
|
13
13
|
export interface CharacterAsset {
|
|
14
14
|
id: string
|
|
@@ -34,8 +34,7 @@ const DB_PATH = join(ensureDataDir(), 'character-assets.json')
|
|
|
34
34
|
|
|
35
35
|
function load(): CharacterAsset[] {
|
|
36
36
|
try {
|
|
37
|
-
const
|
|
38
|
-
const parsed = JSON.parse(raw)
|
|
37
|
+
const parsed = loadJsonFile(DB_PATH, null)
|
|
39
38
|
return Array.isArray(parsed) ? parsed : []
|
|
40
39
|
}
|
|
41
40
|
catch {
|
|
@@ -44,8 +43,7 @@ function load(): CharacterAsset[] {
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
function save(list: CharacterAsset[]): void {
|
|
47
|
-
|
|
48
|
-
fs.writeFileSync(DB_PATH, JSON.stringify(list, null, 2), 'utf-8')
|
|
46
|
+
saveJsonFileAtomic(DB_PATH, list)
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
class CharacterAssetRepo {
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
* 应用级单例,写入 server/data/device-twins.json,进程内缓存,启动读盘。
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import fs from 'node:fs'
|
|
12
11
|
import { join } from 'node:path'
|
|
13
12
|
import { ensureDataDir } from '@/shared/config/home.mjs'
|
|
14
13
|
import { AppError } from '../../../utils/errors'
|
|
14
|
+
import { loadJsonFile, saveJsonFileAtomic } from '../json-store.mjs'
|
|
15
15
|
|
|
16
16
|
export interface DeviceTwin {
|
|
17
17
|
id: string
|
|
@@ -49,8 +49,7 @@ const DB_PATH = join(ensureDataDir(), 'device-twins.json')
|
|
|
49
49
|
|
|
50
50
|
function load(): DeviceTwin[] {
|
|
51
51
|
try {
|
|
52
|
-
const
|
|
53
|
-
const parsed = JSON.parse(raw)
|
|
52
|
+
const parsed = loadJsonFile(DB_PATH, null)
|
|
54
53
|
return Array.isArray(parsed) ? parsed : []
|
|
55
54
|
}
|
|
56
55
|
catch {
|
|
@@ -58,8 +57,7 @@ function load(): DeviceTwin[] {
|
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
function save(list: DeviceTwin[]): void {
|
|
61
|
-
|
|
62
|
-
fs.writeFileSync(DB_PATH, JSON.stringify(list, null, 2), 'utf-8')
|
|
60
|
+
saveJsonFileAtomic(DB_PATH, list)
|
|
63
61
|
}
|
|
64
62
|
|
|
65
63
|
export class DeviceTwinRepo {
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
|
|
24
24
|
import { createLogger } from '../logger'
|
|
25
25
|
import { randomUUID } from 'node:crypto'
|
|
26
|
+
import { daqRuntimeSettings } from '../settings'
|
|
27
|
+
import { getSystemConfigService } from '../../system-config'
|
|
26
28
|
import { daqKeyFromRef, normalizeDataTransform, normalizeSignalKind, DAQ_DRIVERS, type AepDaqControllerState, type AepDaqFrame, type AepDaqReading, type AepDaqNodeChange, type DaqDriverKind, type DaqNodeView, type DataTransform, type DriverTestResult } from '../../../../shared/daq-protocol'
|
|
27
29
|
import { AppError, ErrorCodes } from '../../../utils/errors'
|
|
28
30
|
import { normalizeDriverKind, resolveDaqDriver, probeDriverAvailability, listPluginDrivers, type DaqFrameSample } from './drivers'
|
|
@@ -135,9 +137,15 @@ class DaqController {
|
|
|
135
137
|
private queueUnsub: (() => void) | null = null
|
|
136
138
|
/** 管线就绪前生产者静默(队列/消费必须先在位) */
|
|
137
139
|
private pipelineReady = false
|
|
140
|
+
/** 配置同步/订阅状态(daq.sampling live 配置 → 网关节拍;仅挂一次) */
|
|
141
|
+
private settingsSynced = false
|
|
142
|
+
private settingsUnsub: (() => void) | null = null
|
|
138
143
|
|
|
139
144
|
running = true
|
|
140
|
-
|
|
145
|
+
/** 全局缺省采集间隔(节点 intervalMs=null 跟随;来源 = daq.sampling 配置,live 可调) */
|
|
146
|
+
defaultIntervalMs = 5000
|
|
147
|
+
/** 采样节拍下限(create/patch/存量收敛统一钳制;来源 = daq.sampling.minIntervalMs) */
|
|
148
|
+
minIntervalMs = 1000
|
|
141
149
|
/** 全局缺省 WS 下发间隔(节点 publishIntervalMs=null 跟随;0 = 随采样节拍) */
|
|
142
150
|
defaultPublishIntervalMs = 0
|
|
143
151
|
private producedCount = 0
|
|
@@ -149,6 +157,7 @@ class DaqController {
|
|
|
149
157
|
// ---------- 生命周期 ----------
|
|
150
158
|
|
|
151
159
|
private ensureLoop(): void {
|
|
160
|
+
this.applyRuntimeSettings()
|
|
152
161
|
this.syncRuntimes()
|
|
153
162
|
if (!this.queueInit) {
|
|
154
163
|
this.queueInit = (async () => {
|
|
@@ -168,8 +177,27 @@ class DaqController {
|
|
|
168
177
|
|
|
169
178
|
// ---------- 网关服务面(runtime host 实现;运行时只依赖此接口) ----------
|
|
170
179
|
|
|
171
|
-
|
|
172
|
-
|
|
180
|
+
/** 从运行时设置(daq.sampling.*)同步采样节拍默认值与下限。
|
|
181
|
+
* live 配置链:config.yml < runtime-settings.json < 环境变量 < 设置页/CLI;
|
|
182
|
+
* 设置变更经 system-config 订阅即时回流到这里(热重载,无需重启)。 */
|
|
183
|
+
applyRuntimeSettings(): void {
|
|
184
|
+
if (!this.settingsSynced) {
|
|
185
|
+
this.settingsSynced = true
|
|
186
|
+
try {
|
|
187
|
+
this.settingsUnsub = getSystemConfigService().subscribe(() => this.applyRuntimeSettings())
|
|
188
|
+
}
|
|
189
|
+
catch { /* 设置系统不可用(单测) → 用字段默认值 */ }
|
|
190
|
+
}
|
|
191
|
+
try {
|
|
192
|
+
const s = daqRuntimeSettings().sampling
|
|
193
|
+
if (Number.isFinite(s.defaultIntervalMs) && s.defaultIntervalMs > 0) this.defaultIntervalMs = Math.min(60_000, s.defaultIntervalMs)
|
|
194
|
+
if (Number.isFinite(s.minIntervalMs) && s.minIntervalMs > 0) this.minIntervalMs = Math.max(100, Math.min(this.defaultIntervalMs, s.minIntervalMs))
|
|
195
|
+
}
|
|
196
|
+
catch { /* settings 未就绪 → 保持当前值 */ }
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
private runtimeDefaults(): { intervalMs: number, publishIntervalMs: number, minIntervalMs: number } {
|
|
200
|
+
return { intervalMs: this.defaultIntervalMs, publishIntervalMs: this.defaultPublishIntervalMs, minIntervalMs: this.minIntervalMs }
|
|
173
201
|
}
|
|
174
202
|
|
|
175
203
|
/** 生产面:驱动采样一次(模板域 + 协议参数解析;mock/PLC 统一走驱动注册表)。
|
|
@@ -193,6 +221,9 @@ class DaqController {
|
|
|
193
221
|
if (res == null || typeof res !== 'object' || !('frame' in res) || res.frame == null) return res
|
|
194
222
|
// 下沉管线(生产侧;单步失败保留原帧,永不抛出 —— 见 frames.ts runSinkPipeline)
|
|
195
223
|
const raw = res.frame
|
|
224
|
+
// 契约守卫:帧联合只有 vector/image;驱动返回未知 kind(如误包 scalar)直接丢帧,
|
|
225
|
+
// 绝不蒙成 image 走 blob 管线(会在 sink 派生处炸出 undefined.length)
|
|
226
|
+
if (raw.kind !== 'vector' && raw.kind !== 'image') return null
|
|
196
227
|
let wf: DaqFrameWorking = raw.kind === 'vector'
|
|
197
228
|
? { kind: 'vector', points: raw.points, metrics: raw.metrics }
|
|
198
229
|
: { kind: 'image', blob: raw.blob, mime: raw.mime, width: raw.width, height: raw.height, metrics: raw.metrics }
|
|
@@ -658,6 +689,7 @@ class DaqController {
|
|
|
658
689
|
return {
|
|
659
690
|
running: this.running,
|
|
660
691
|
defaultIntervalMs: this.defaultIntervalMs,
|
|
692
|
+
minIntervalMs: this.minIntervalMs,
|
|
661
693
|
defaultPublishIntervalMs: this.defaultPublishIntervalMs,
|
|
662
694
|
nodesTotal: nodes.length,
|
|
663
695
|
nodesOnline: this.running ? nodes.filter(n => n.enabled).length : 0,
|
|
@@ -764,7 +796,7 @@ class DaqController {
|
|
|
764
796
|
|
|
765
797
|
configure(opts: { defaultIntervalMs?: number, defaultPublishIntervalMs?: number }): AepDaqControllerState {
|
|
766
798
|
let changed = false
|
|
767
|
-
if (typeof opts.defaultIntervalMs === 'number' && opts.defaultIntervalMs >=
|
|
799
|
+
if (typeof opts.defaultIntervalMs === 'number' && opts.defaultIntervalMs >= this.minIntervalMs) {
|
|
768
800
|
this.defaultIntervalMs = Math.min(60_000, Math.round(opts.defaultIntervalMs))
|
|
769
801
|
changed = true
|
|
770
802
|
}
|
|
@@ -802,7 +834,7 @@ class DaqController {
|
|
|
802
834
|
driverConfig: input.driverConfig ?? {},
|
|
803
835
|
transform: normalizeDataTransform(input.transform),
|
|
804
836
|
enabled: input.enabled,
|
|
805
|
-
intervalMs: input.intervalMs
|
|
837
|
+
intervalMs: input.intervalMs == null ? null : Math.max(this.minIntervalMs, Math.min(60_000, Math.round(input.intervalMs))),
|
|
806
838
|
publishIntervalMs: input.publishIntervalMs ?? null,
|
|
807
839
|
unit: input.unit,
|
|
808
840
|
decimals: input.decimals,
|
|
@@ -842,7 +874,7 @@ class DaqController {
|
|
|
842
874
|
if (patch.warnHigh !== undefined) node.warnHigh = patch.warnHigh
|
|
843
875
|
let rearm = false
|
|
844
876
|
if (patch.intervalMs !== undefined) {
|
|
845
|
-
node.intervalMs = patch.intervalMs == null ? null : Math.max(
|
|
877
|
+
node.intervalMs = patch.intervalMs == null ? null : Math.max(this.minIntervalMs, Math.min(60_000, Math.round(patch.intervalMs)))
|
|
846
878
|
rearm = true
|
|
847
879
|
}
|
|
848
880
|
if (patch.publishIntervalMs !== undefined) {
|