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,612 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HostToolBridge —— workspace 工具桥(harness 无关)。
|
|
3
|
+
*
|
|
4
|
+
* 把 omp-agent 时代的 host tool 定义/角色装配/分发逻辑抽为共享模块:
|
|
5
|
+
* - omp:保持原生 host_tool_call → dispatch(经本桥);
|
|
6
|
+
* - codex/dsh/opencode:经 stdio MCP 桥(server/harness/aw-mcp-bridge.mjs)
|
|
7
|
+
* → HTTP agent-tools 面 → impl.dispatchHostTool → 同一本桥;
|
|
8
|
+
* - REST 直调(agent-tools/invoke)同样落本桥。
|
|
9
|
+
* 从而"工具注册一套逻辑、注入与分发全引擎一致"。
|
|
10
|
+
*
|
|
11
|
+
* 分发语义与原 omp 实现逐字节对齐:插件工具优先 → workspace 协作/任务/记忆面 →
|
|
12
|
+
* 工业工具族 → 插件兜底 → 未知工具报错。
|
|
13
|
+
*/
|
|
14
|
+
import { randomUUID } from 'node:crypto'
|
|
15
|
+
import type {
|
|
16
|
+
AgentInfo,
|
|
17
|
+
AgentWorkspace,
|
|
18
|
+
} from './agent-interface'
|
|
19
|
+
import type { A2AArtifact, Part } from '../types/a2a'
|
|
20
|
+
import type { WorkspaceTask } from '../types/task'
|
|
21
|
+
import type { RpcHostToolDefinition } from './adapters/omp-rpc-client'
|
|
22
|
+
import { loadHostToolDefs } from '../prompts/loader'
|
|
23
|
+
import { daqRuntimeSettings } from '../settings'
|
|
24
|
+
import { toolDaqFrames, toolDaqQuery, toolDcwControl, toolDcwJudge, toolDcwJournal, toolDcwRead, toolDcwRollback, toolMyIndustrialNodes } from './industrial-tools'
|
|
25
|
+
import { listPluginTools } from './plugin-tools'
|
|
26
|
+
import { extractTaskMode } from '../runtime/execution-mode'
|
|
27
|
+
|
|
28
|
+
/** host tool 定义(外置 .AgentWorkShop/prompts/host-tools.json;加载器缓存) */
|
|
29
|
+
export const HOST_TOOLS: RpcHostToolDefinition[] = loadHostToolDefs()
|
|
30
|
+
|
|
31
|
+
/** 仅 lead 可见的工具名(dispatch/调度/团队管理面;worker 注册时剔除,压缩工具上下文) */
|
|
32
|
+
export const LEAD_ONLY_TOOL_NAMES = new Set([
|
|
33
|
+
'dispatch_task',
|
|
34
|
+
'get_queue_overview',
|
|
35
|
+
'read_channel_mail',
|
|
36
|
+
'reassign_task',
|
|
37
|
+
'update_task',
|
|
38
|
+
'create_team_agent',
|
|
39
|
+
'update_team_agent',
|
|
40
|
+
'remove_team_agent',
|
|
41
|
+
])
|
|
42
|
+
|
|
43
|
+
/** 占位符动态注入:工具描述里的运行时配置值(每次装配实时计算,配置热重载后 Agent 拿到新值) */
|
|
44
|
+
function applyDescriptionPlaceholders(tools: RpcHostToolDefinition[]): RpcHostToolDefinition[] {
|
|
45
|
+
let q: { defaultBucketMs: number, minBucketMs: number } | null = null
|
|
46
|
+
try {
|
|
47
|
+
q = daqRuntimeSettings().query
|
|
48
|
+
}
|
|
49
|
+
catch { /* 设置系统不可用(单测) → 保留原始描述 */ }
|
|
50
|
+
if (!q) return tools
|
|
51
|
+
const map: Record<string, string> = {
|
|
52
|
+
queryDefaultBucketMs: String(q.defaultBucketMs),
|
|
53
|
+
queryMinBucketMs: String(q.minBucketMs),
|
|
54
|
+
}
|
|
55
|
+
return tools.map(t => ({
|
|
56
|
+
...t,
|
|
57
|
+
description: t.description.replace(/\{(queryDefaultBucketMs|queryMinBucketMs)\}/g, (_, k) => map[k] ?? _),
|
|
58
|
+
parameters: JSON.parse(JSON.stringify(t.parameters ?? {}).replace(/\{(queryDefaultBucketMs|queryMinBucketMs)\}/g, (_m: string, k: string) => map[k] ?? _m)),
|
|
59
|
+
}))
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* 按角色装配 host tools:lead = 全量;worker = 剔除 lead 专属(执行面 + 通信面 + 记忆面);
|
|
64
|
+
* 尾部合并插件注册工具(roles 过滤,缺省双角色可用)。
|
|
65
|
+
* 全 harness 共用:omp 经 set_host_tools 下发;其余引擎经 MCP 桥 tools/list 拉取。
|
|
66
|
+
*/
|
|
67
|
+
export function hostToolsForRole(role: 'lead' | 'worker'): RpcHostToolDefinition[] {
|
|
68
|
+
const base = role === 'lead'
|
|
69
|
+
? HOST_TOOLS
|
|
70
|
+
: HOST_TOOLS.filter(t => !LEAD_ONLY_TOOL_NAMES.has(t.name))
|
|
71
|
+
const out = [...base]
|
|
72
|
+
for (const [name, tool] of listPluginTools()) {
|
|
73
|
+
if (out.some(t => t.name === name)) continue
|
|
74
|
+
if (tool.roles && !tool.roles.includes(role)) continue
|
|
75
|
+
out.push({ name, label: tool.label ?? name, description: tool.description, parameters: tool.parameters ?? {} })
|
|
76
|
+
}
|
|
77
|
+
return applyDescriptionPlaceholders(out)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** 工具调用请求(与引擎协议解耦的规范化形状) */
|
|
81
|
+
export interface HostToolCall {
|
|
82
|
+
toolName: string
|
|
83
|
+
arguments: Record<string, unknown>
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface HostToolResult {
|
|
87
|
+
text: string
|
|
88
|
+
isError?: boolean
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** 会话态(impl 持有,桥读写):当前执行任务 + 待回执上下文 */
|
|
92
|
+
export interface HostToolSessionState {
|
|
93
|
+
currentTaskId: string | null
|
|
94
|
+
replyContext: { fromId: string, messageId: string } | null
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function createSessionState(): HostToolSessionState {
|
|
98
|
+
return { currentTaskId: null, replyContext: null }
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** 桥上下文:impl 注入身份与 workspace 取值器 */
|
|
102
|
+
export interface HostToolBridgeContext {
|
|
103
|
+
identity: { agentId: string, channelId: string, role: 'lead' | 'worker', name: string }
|
|
104
|
+
state: HostToolSessionState
|
|
105
|
+
getWorkspace(): AgentWorkspace | null
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** 从消息 parts 提取纯文本(多 harness 共用) */
|
|
109
|
+
export function partsToText(parts: Part[]): string {
|
|
110
|
+
return parts
|
|
111
|
+
.map((p) => {
|
|
112
|
+
if ('text' in p) return p.text
|
|
113
|
+
if ('data' in p) return JSON.stringify(p.data)
|
|
114
|
+
if ('url' in p) return p.url
|
|
115
|
+
if ('raw' in p) return p.raw
|
|
116
|
+
return ''
|
|
117
|
+
})
|
|
118
|
+
.join('\n')
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* 分发一次 host tool 调用(全引擎唯一入口):
|
|
123
|
+
* 插件工具优先 → workspace 面 → 工业工具族 → 插件兜底 → 未知工具。
|
|
124
|
+
*/
|
|
125
|
+
export async function dispatchHostTool(ctx: HostToolBridgeContext, req: HostToolCall): Promise<HostToolResult> {
|
|
126
|
+
const identity = ctx.identity
|
|
127
|
+
// 插件工具分发(ctx.omp.registerTool 注册的自定义工具;不依赖 workspace,优先于内置面)
|
|
128
|
+
const pluginTool = listPluginTools().get(req.toolName)
|
|
129
|
+
if (pluginTool) {
|
|
130
|
+
try {
|
|
131
|
+
return await pluginTool.handler(req.arguments ?? {}, identity)
|
|
132
|
+
}
|
|
133
|
+
catch (err) {
|
|
134
|
+
return {
|
|
135
|
+
text: `工具执行异常(${req.toolName}): ${err instanceof Error ? err.message : String(err)}`,
|
|
136
|
+
isError: true,
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
const args = req.arguments ?? {}
|
|
141
|
+
|
|
142
|
+
// 工业工具族不依赖 workspace(只按 agentId 查绑定与节点),先于 workspace 门控执行 ——
|
|
143
|
+
// 否则 worker 首回合前的 REST/MCP 直调(my_industrial_nodes 等)会被误拒
|
|
144
|
+
switch (req.toolName) {
|
|
145
|
+
case 'my_industrial_nodes':
|
|
146
|
+
return toolMyIndustrialNodes(identity.agentId)
|
|
147
|
+
case 'dcw_control':
|
|
148
|
+
return toolDcwControl(identity.agentId, args as { node_id?: string, value?: number | string, hypothesis?: string, task_id?: string })
|
|
149
|
+
case 'dcw_read':
|
|
150
|
+
return toolDcwRead(identity.agentId, args as { node_id?: string })
|
|
151
|
+
case 'daq_query':
|
|
152
|
+
return toolDaqQuery(identity.agentId, args as Parameters<typeof toolDaqQuery>[1])
|
|
153
|
+
case 'daq_frames':
|
|
154
|
+
return toolDaqFrames(identity.agentId, args as Parameters<typeof toolDaqFrames>[1])
|
|
155
|
+
case 'dcw_judge':
|
|
156
|
+
return toolDcwJudge(identity.agentId, args as { record_id?: string, verdict?: string, reason?: string })
|
|
157
|
+
case 'dcw_rollback':
|
|
158
|
+
return toolDcwRollback(identity.agentId, args as { record_id?: string, node_id?: string, to?: string })
|
|
159
|
+
case 'dcw_journal':
|
|
160
|
+
return toolDcwJournal(identity.agentId, args as { node_id?: string, recipe_id?: string, limit?: number | string })
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const ws = ctx.getWorkspace()
|
|
164
|
+
if (!ws) {
|
|
165
|
+
return { text: 'workspace 未就绪', isError: true }
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
try {
|
|
169
|
+
switch (req.toolName) {
|
|
170
|
+
case 'report_progress': {
|
|
171
|
+
const progress = args.progress as number
|
|
172
|
+
const message = args.message as string | undefined
|
|
173
|
+
const taskId = ctx.state.currentTaskId
|
|
174
|
+
if (!taskId) return { text: '无当前任务上下文', isError: true }
|
|
175
|
+
await ws.reportTask({ taskId, progress, message })
|
|
176
|
+
return { text: `进度已上报: ${progress}%${message ? ` (${message})` : ''}` }
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
case 'complete_task': {
|
|
180
|
+
const summary = args.summary as string
|
|
181
|
+
const deliverable = args.deliverable as string | undefined
|
|
182
|
+
const taskId = (args.task_id as string | undefined) ?? ctx.state.currentTaskId
|
|
183
|
+
if (!taskId) return { text: '无任务 ID', isError: true }
|
|
184
|
+
// 父任务保护:有未完成子任务时拒绝完成(lead 须等 worker 交付)
|
|
185
|
+
const allTasks = await ws.listTasks()
|
|
186
|
+
const incompleteChildren = allTasks.filter(t => t.parentId === taskId && t.state !== 'COMPLETED' && t.state !== 'CANCELED')
|
|
187
|
+
if (incompleteChildren.length > 0) {
|
|
188
|
+
return {
|
|
189
|
+
text: `任务 ${taskId} 有 ${incompleteChildren.length} 个未完成子任务,不能完成父任务。请等待子任务完成。`,
|
|
190
|
+
isError: true,
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// 终态幂等:任务已被平台收口(看门狗取消/调度器完成)时不撞状态机 ——
|
|
194
|
+
// 给 Agent 明确的"无需再完成,继续下一项"信号,杜绝重复重试烧 token
|
|
195
|
+
const current = await ws.getTask(taskId)
|
|
196
|
+
if (current && current.state !== 'SUBMITTED' && current.state !== 'ASSIGNED' && current.state !== 'WORKING' && current.state !== 'WAITING') {
|
|
197
|
+
if (current.state === 'COMPLETED') {
|
|
198
|
+
return { text: `任务 ${taskId} 已是完成状态(可能已被平台收口),无需重复完成。` }
|
|
199
|
+
}
|
|
200
|
+
try {
|
|
201
|
+
const q = await ws.myQueue()
|
|
202
|
+
const next = q.queued[0]
|
|
203
|
+
return {
|
|
204
|
+
text: `任务 ${taskId} 已被平台${current.state === 'CANCELED' ? '取消(如停滞回收/上级作废)' : '判定失败'},不能再标记完成 —— 这不是你的错误,也无需重试。${next ? `队列还有 ${q.queued.length} 项,下一项「${next.title}」即将开始,请继续处理。` : '队列为空,保持待命。'}`,
|
|
205
|
+
isError: false,
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
return { text: `任务 ${taskId} 已被平台${current.state === 'CANCELED' ? '取消' : '判定失败'},无需再完成,请继续处理队列下一项。` }
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const artifacts: A2AArtifact[] = []
|
|
213
|
+
if (deliverable || summary) {
|
|
214
|
+
artifacts.push({
|
|
215
|
+
artifactId: randomUUID(),
|
|
216
|
+
name: 'deliverable',
|
|
217
|
+
parts: [{ text: deliverable ?? summary }],
|
|
218
|
+
})
|
|
219
|
+
}
|
|
220
|
+
await ws.completeTask(taskId, artifacts)
|
|
221
|
+
ctx.state.currentTaskId = null
|
|
222
|
+
// 完成即衔接:报告队列余量与下一项(状态同步 + 驱动继续处理)
|
|
223
|
+
try {
|
|
224
|
+
const q = await ws.myQueue()
|
|
225
|
+
const next = q.queued[0]
|
|
226
|
+
if (next) {
|
|
227
|
+
return {
|
|
228
|
+
text: `任务 ${taskId} 已完成(状态已同步为 COMPLETED)。你的队列还有 ${q.queued.length} 项待处理,下一项:「${next.title}」(即将自动开始;收到任务指派消息后按工作流执行,完成后同样调用 complete_task)。`,
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return { text: `任务 ${taskId} 已完成(状态已同步为 COMPLETED),队列为空。保持待命:新任务/实时消息会自动到达你的信箱。` }
|
|
232
|
+
}
|
|
233
|
+
catch {
|
|
234
|
+
return { text: `任务 ${taskId} 已完成(状态已同步为 COMPLETED)。` }
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
case 'dispatch_task': {
|
|
239
|
+
const assigneeId = args.assignee_id as string
|
|
240
|
+
const title = args.title as string
|
|
241
|
+
const description = args.description as string | undefined
|
|
242
|
+
const parentTaskId = args.parent_task_id as string | undefined
|
|
243
|
+
const routeReason = args.route_reason as string | undefined
|
|
244
|
+
// 重复派发守卫(真实场景实测:lead 模型可能对同一目标重复派发,引发协调风暴):
|
|
245
|
+
// 同父任务下已存在同标题非终态子任务 → 不再创建,直接指路既有任务
|
|
246
|
+
const dup = await ws.listTasks()
|
|
247
|
+
const existing = dup.find(t =>
|
|
248
|
+
t.parentId === parentTaskId
|
|
249
|
+
&& t.title === title
|
|
250
|
+
&& t.state !== 'COMPLETED' && t.state !== 'FAILED' && t.state !== 'CANCELED')
|
|
251
|
+
if (existing) {
|
|
252
|
+
return {
|
|
253
|
+
text: `未创建:同父任务下已存在同标题进行中子任务 ${existing.id}("${existing.title}",state=${existing.state},assignee=${existing.assigneeId})。请勿重复派发;若需跟进请对该任务 notify 或 reassign。`,
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
const task = await ws.dispatchTask({ assigneeId, title, description, parentTaskId, routeReason })
|
|
257
|
+
return { text: `子任务 ${task.id} 已创建并指派 → ${assigneeId}(父任务 ${parentTaskId ?? '无'},标题: ${title}${routeReason ? `,路由理由: ${routeReason}` : ''})` }
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
case 'send_message_to_agent': {
|
|
261
|
+
const toAgentId = args.to_agent_id as string
|
|
262
|
+
const message = args.message as string
|
|
263
|
+
// 回执自动实时:回复(in_reply_to)默认提升为 immediate——
|
|
264
|
+
// 接收方正等待该结果,realtime 路由会把回复直接注入其运行中的会话
|
|
265
|
+
let priority = (args.priority as string | undefined) ?? 'task'
|
|
266
|
+
const metadata: Record<string, unknown> = {}
|
|
267
|
+
if (args.require_reply === true) metadata['x-aw-require-reply'] = 'true'
|
|
268
|
+
let inReplyTo = args.in_reply_to as string | undefined
|
|
269
|
+
// 自动关联兜底:LLM 省略 in_reply_to 时,按待回执上下文盖章
|
|
270
|
+
const replyCtx = ctx.state.replyContext
|
|
271
|
+
ctx.state.replyContext = null
|
|
272
|
+
if (!inReplyTo && replyCtx && replyCtx.fromId === toAgentId) {
|
|
273
|
+
inReplyTo = replyCtx.messageId
|
|
274
|
+
}
|
|
275
|
+
if (inReplyTo) {
|
|
276
|
+
metadata['x-aw-in-reply-to'] = inReplyTo
|
|
277
|
+
if (priority === 'task') priority = 'immediate'
|
|
278
|
+
}
|
|
279
|
+
metadata['x-aw-msg-priority'] = priority
|
|
280
|
+
const sent = await ws.sendMessage({ toAgentId, parts: [{ text: message }], metadata })
|
|
281
|
+
const triggerNote = inReplyTo
|
|
282
|
+
? `(回复 ${inReplyTo.slice(0, 8)}…,已实时推送给对方)`
|
|
283
|
+
: metadata['x-aw-require-reply'] === 'true' ? '(已要求对方回复)' : ''
|
|
284
|
+
return { text: `消息 ${sent.messageId.slice(0, 8)}… 已发送给 ${toAgentId}(priority=${priority})${triggerNote}` }
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
case 'send_cross_channel_message': {
|
|
288
|
+
const toChannelId = args.to_channel_id as string
|
|
289
|
+
const message = args.message as string
|
|
290
|
+
if (!toChannelId || !message) return { text: '缺少 to_channel_id 或 message', isError: true }
|
|
291
|
+
try {
|
|
292
|
+
const r = await ws.sendCrossChannelMessage({
|
|
293
|
+
toChannelId,
|
|
294
|
+
parts: [{ text: message }],
|
|
295
|
+
requireReply: args.require_reply === true,
|
|
296
|
+
inReplyTo: args.in_reply_to as string | undefined,
|
|
297
|
+
})
|
|
298
|
+
const note = args.require_reply === true ? '(已要求对方 Leader 回复)' : ''
|
|
299
|
+
return { text: `跨 Channel 消息 ${r.messageId.slice(0, 8)}… 已送达 channel「${r.toChannelName}」的 Leader(${r.toLeadAgentId.slice(0, 8)}…)${note}。对方将按你的信息需求处理;其回复会经 mailbox 到达你这里。` }
|
|
300
|
+
}
|
|
301
|
+
catch (err) {
|
|
302
|
+
return { text: `跨 Channel 发送失败: ${err instanceof Error ? err.message : String(err)}(仅 Leader 可跨 Channel 通信)`, isError: true }
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
case 'list_other_teams': {
|
|
307
|
+
const teams = await ws.listOtherTeams()
|
|
308
|
+
if (teams.length === 0) return { text: '当前没有其他团队(或均未启用)。' }
|
|
309
|
+
const text = teams.map((t) => {
|
|
310
|
+
const active = t.activeTasks.length > 0
|
|
311
|
+
? t.activeTasks.map(x => `「${x.title}」(${x.state})`).join('、')
|
|
312
|
+
: '无进行中任务'
|
|
313
|
+
const done = t.recentCompleted.length > 0
|
|
314
|
+
? t.recentCompleted.map(x => `「${x.title}」`).join('、')
|
|
315
|
+
: '无'
|
|
316
|
+
const mem = t.sharedMemories > 0 ? `共享记忆 ${t.sharedMemories} 条(可检索)` : '暂无共享记忆'
|
|
317
|
+
return `- ${t.name}${t.description ? `(${t.description})` : ''} · lead=${t.leadName ?? '?'} · ${mem}\n 进行中: ${active}\n 近期完成: ${done}\n channel_id: ${t.channelId}`
|
|
318
|
+
}).join('\n')
|
|
319
|
+
return { text: `其他团队概览:\n${text}\n(需要协作时用 send_cross_channel_message 向对应团队 Leader 发信;查具体知识用 search_other_teams_memory)` }
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
case 'search_other_teams_memory': {
|
|
323
|
+
const query = (args.query as string | undefined) ?? ''
|
|
324
|
+
if (!query) return { text: '缺少 query', isError: true }
|
|
325
|
+
const rows = await ws.searchOtherTeamsMemory({ query, limit: Number(args.limit ?? 5) })
|
|
326
|
+
if (rows.length === 0) return { text: `其他团队的共享记忆中没有命中「${query}」的内容。` }
|
|
327
|
+
const text = rows.map(r =>
|
|
328
|
+
`- [${r.channelName}] 「${r.title}」(${r.createdAt.slice(0, 10)}): ${r.content}`).join('\n')
|
|
329
|
+
return { text: `其他团队共享记忆命中 ${rows.length} 条:\n${text}` }
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
case 'refuse_task': {
|
|
333
|
+
const taskId = args.task_id as string
|
|
334
|
+
const reason = args.reason as string
|
|
335
|
+
if (!taskId || !reason) return { text: '缺少 task_id 或 reason', isError: true }
|
|
336
|
+
const r = await ws.refuseTask(taskId, reason)
|
|
337
|
+
const notified = r.notifiedTo ? `拒绝回执已送达 ${r.notifiedTo.slice(0, 8)}` : '无回执对象(创建者已不在 channel)'
|
|
338
|
+
return {
|
|
339
|
+
text: `任务 ${taskId.slice(0, 8)}("${r.task.title}") 已拒绝(state=${r.task.state});${notified}。调度器将改派他人,请勿再处理该任务。`,
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
case 'poll_messages': {
|
|
344
|
+
const limit = (args.limit as number | undefined) ?? 10
|
|
345
|
+
const waitSec = Math.min(180, Math.max(0, Number(args.wait_seconds ?? 0) || 0))
|
|
346
|
+
const msgs = await ws.waitMailbox(limit, waitSec * 1000)
|
|
347
|
+
if (msgs.length === 0) {
|
|
348
|
+
return {
|
|
349
|
+
text: waitSec > 0
|
|
350
|
+
? `等待 ${waitSec}s 后收件箱仍为空。若此前已有"[实时消息 from X]"注入你的会话,那就是回复本身(无需再轮询);否则可继续处理其他工作,对方回复会以新回合送达。`
|
|
351
|
+
: '收件箱为空(无未消费消息)。等待回复请用 wait_seconds 参数阻塞等待,不要反复空轮询。',
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
// 读即取:协作消息(非任务投递)取出即确认;任务指派(assign)不确认
|
|
355
|
+
const ackIds = msgs
|
|
356
|
+
.filter(m => !m.metadata?.['x-aw-task-kind'])
|
|
357
|
+
.map(m => m.messageId)
|
|
358
|
+
if (ackIds.length > 0) await ws.ackMailbox(ackIds)
|
|
359
|
+
const trigger = msgs.find(m =>
|
|
360
|
+
m.metadata?.['x-aw-require-reply'] === 'true'
|
|
361
|
+
&& typeof m.metadata?.['x-aw-from-agent'] === 'string')
|
|
362
|
+
if (trigger) {
|
|
363
|
+
ctx.state.replyContext = {
|
|
364
|
+
fromId: String(trigger.metadata!['x-aw-from-agent']),
|
|
365
|
+
messageId: trigger.messageId,
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
const text = msgs.map((m, i) => {
|
|
369
|
+
const from = m.metadata?.['x-aw-from-agent'] ?? '?'
|
|
370
|
+
const reply = m.metadata?.['x-aw-in-reply-to']
|
|
371
|
+
? ` (回复 ${String(m.metadata['x-aw-in-reply-to']).slice(0, 8)}…)`
|
|
372
|
+
: ''
|
|
373
|
+
const needReply = m.metadata?.['x-aw-require-reply'] === 'true'
|
|
374
|
+
? ` [需回复:用 send_message_to_agent 回 ${from},in_reply_to=${m.messageId}]`
|
|
375
|
+
: ''
|
|
376
|
+
const body = m.parts.map(p => 'text' in p ? p.text : '').join(' ')
|
|
377
|
+
return ` [${i + 1}/${msgs.length}] [from ${from}]${needReply}${reply} ${body.slice(0, 2000)}`
|
|
378
|
+
}).join('\n')
|
|
379
|
+
return {
|
|
380
|
+
text:
|
|
381
|
+
`未消费消息(${msgs.length},已读即取):\n${text}`
|
|
382
|
+
+ (msgs.length > 1
|
|
383
|
+
? '\n(收到多条:请按编号逐条处理并逐条回复,不要只回应最后一条或合并敷衍)'
|
|
384
|
+
: ''),
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
case 'read_channel_mail': {
|
|
389
|
+
const limit = (args.limit as number | undefined) ?? 50
|
|
390
|
+
const agentId = args.agent_id as string | undefined
|
|
391
|
+
const mails = await ws.listMail({ limit, agentId })
|
|
392
|
+
if (mails.length === 0) return { text: 'Channel 无邮件记录(或该成员无往来)' }
|
|
393
|
+
const text = mails.map((m) => {
|
|
394
|
+
const from = m.fromAgentId ?? '(系统)'
|
|
395
|
+
const to = m.toAgentId ?? '(广播)'
|
|
396
|
+
const body = partsToText(m.parts).trim().slice(0, 2000)
|
|
397
|
+
const reply = m.metadata?.['x-aw-in-reply-to']
|
|
398
|
+
? ` [回复 ${String(m.metadata['x-aw-in-reply-to']).slice(0, 8)}…]`
|
|
399
|
+
: ''
|
|
400
|
+
const label = m.metadata?.['x-aw-task-kind'] === 'assign'
|
|
401
|
+
? '[任务指派]'
|
|
402
|
+
: m.metadata?.['x-aw-msg-priority'] === 'immediate' ? '[实时]' : '[协作]'
|
|
403
|
+
const state = m.state === 'pending' ? '未读' : m.state === 'consuming' ? '处理中' : '已读'
|
|
404
|
+
return ` ${m.createdAt.slice(11, 19)} ${label} ${from} → ${to} (${state})${reply}: ${body || '(空)'}`
|
|
405
|
+
}).join('\n')
|
|
406
|
+
return { text: `Channel 邮件(${mails.length},倒序;可传 agent_id 查看指定成员信箱):\n${text}` }
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
case 'broadcast_message': {
|
|
410
|
+
const message = args.message as string
|
|
411
|
+
const priority = (args.priority as string | undefined) ?? 'task'
|
|
412
|
+
const agents = await ws.listAgents()
|
|
413
|
+
const others = agents.filter(a => a.id !== identity.agentId)
|
|
414
|
+
for (const agent of others) {
|
|
415
|
+
await ws.sendMessage({
|
|
416
|
+
toAgentId: agent.id,
|
|
417
|
+
parts: [{ text: message }],
|
|
418
|
+
metadata: { 'x-aw-msg-priority': priority },
|
|
419
|
+
})
|
|
420
|
+
}
|
|
421
|
+
return { text: `已广播给 ${others.length} 个 agent(priority=${priority})` }
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
case 'list_channel_tasks': {
|
|
425
|
+
const tasks = await ws.listTasks()
|
|
426
|
+
const text = tasks.map(t =>
|
|
427
|
+
` ${t.id} [${t.state}] "${t.title}" assignee=${t.assigneeId} progress=${t.progress}%`,
|
|
428
|
+
).join('\n')
|
|
429
|
+
return { text: `Channel 任务(${tasks.length}):\n${text || '(空)'}` }
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
case 'get_my_task_queue': {
|
|
433
|
+
const queue = await ws.myQueue()
|
|
434
|
+
const fmt = (t: WorkspaceTask): string =>
|
|
435
|
+
` ${t.id} [${t.state}] "${t.title}" progress=${t.progress}%`
|
|
436
|
+
return {
|
|
437
|
+
text: [
|
|
438
|
+
`我的任务队列(${identity.role}):`,
|
|
439
|
+
`执行中: ${queue.current ? `${queue.current.id} "${queue.current.title}" (${queue.current.progress}%)` : '(无)'}`,
|
|
440
|
+
`待执行(${queue.queued.length},FIFO):`,
|
|
441
|
+
...queue.queued.map(fmt),
|
|
442
|
+
`已完成(${queue.completed.length}):`,
|
|
443
|
+
...queue.completed.map(fmt),
|
|
444
|
+
].join('\n'),
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
case 'get_queue_overview': {
|
|
449
|
+
const overview = await ws.queueOverview()
|
|
450
|
+
const lines = overview.map(s =>
|
|
451
|
+
` ${s.agentId} (${s.name}, role=${s.role}, state=${s.state}, current=${s.currentTaskId ?? '-'}${s.currentTaskTitle ? `「${s.currentTaskTitle}」` : ''}, progress=${s.currentTaskProgress ?? '-'}%, queued=${s.queuedCount}, completed=${s.completedCount})`,
|
|
452
|
+
)
|
|
453
|
+
return { text: `团队队列总览(${overview.length}):\n${lines.join('\n') || '(空)'}` }
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
case 'reassign_task': {
|
|
457
|
+
const taskId = args.task_id as string
|
|
458
|
+
const toAgentId = args.to_agent_id as string
|
|
459
|
+
const task = await ws.reassignTask(taskId, toAgentId)
|
|
460
|
+
return { text: `任务 ${taskId}("${task.title}")已调配 → ${toAgentId}(state=${task.state})` }
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
case 'update_task': {
|
|
464
|
+
const taskId = args.task_id as string
|
|
465
|
+
const title = args.title as string | undefined
|
|
466
|
+
const description = args.description as string | undefined
|
|
467
|
+
const task = await ws.updateTask(taskId, { title, description })
|
|
468
|
+
return { text: `任务 ${taskId} 已更新: "${task.title}"` }
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
case 'cancel_task': {
|
|
472
|
+
const taskId = args.task_id as string
|
|
473
|
+
// 守卫:goal/loop/pipeline 的 mode 父任务是用户的作业主任务,Agent 不得经工具取消
|
|
474
|
+
const target = await ws.getTask(taskId).catch(() => null)
|
|
475
|
+
if (target && extractTaskMode(target)) {
|
|
476
|
+
return {
|
|
477
|
+
text: `拒绝:任务 ${taskId} 是 mode 父任务(${target.title}),不能用 cancel_task 取消。若目标未达成 → dispatch_task 派发子任务补齐差距;若确认无法达成 → complete_task 并在交付中说明未达成原因。终止整个作业请由用户操作。`,
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
await ws.cancelTask(taskId)
|
|
481
|
+
return { text: `任务 ${taskId} 已取消并移出 assignee 队列` }
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
case 'list_team_agents': {
|
|
485
|
+
const agents = await ws.listAgents()
|
|
486
|
+
const text = agents.map(a =>
|
|
487
|
+
` ${a.id} (${a.name}, role=${a.role}, harness=${a.harness})`,
|
|
488
|
+
).join('\n')
|
|
489
|
+
return { text: `团队成员(${agents.length}):\n${text || '(空)'}` }
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
case 'get_task_details': {
|
|
493
|
+
const taskId = args.task_id as string
|
|
494
|
+
const task: WorkspaceTask = await ws.getTask(taskId)
|
|
495
|
+
const artifactText = task.artifacts.map(a =>
|
|
496
|
+
` artifact ${a.artifactId}: ${a.parts.map(p => 'text' in p ? p.text.slice(0, 100) : '').join('; ')}`,
|
|
497
|
+
).join('\n')
|
|
498
|
+
return {
|
|
499
|
+
text: `任务 ${task.id}\n 状态: ${task.state}\n 标题: ${task.title}\n 描述: ${task.description ?? '-'}\n 指派: ${task.assigneeId}\n 进度: ${task.progress}%\n 成果:\n${artifactText || ' (无)'}`,
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
case 'search_memory': {
|
|
504
|
+
const query = args.query as string
|
|
505
|
+
const scope = (args.scope as 'auto' | 'private' | 'shared' | undefined) ?? 'auto'
|
|
506
|
+
const snippets = await ws.recallMemory({ query, scope, limit: args.limit as number | undefined })
|
|
507
|
+
if (snippets.length === 0) {
|
|
508
|
+
return { text: `记忆检索无命中(query="${query}", scope=${scope})。可尝试更换关键词或放宽 scope。` }
|
|
509
|
+
}
|
|
510
|
+
const lines = snippets.map(s =>
|
|
511
|
+
` [${s.source}·${s.kind}·score=${s.score}] ${s.title}\n ${s.content}`,
|
|
512
|
+
)
|
|
513
|
+
return { text: `记忆检索结果(${snippets.length} 条, scope=${scope}):\n${lines.join('\n')}` }
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
case 'save_memory': {
|
|
517
|
+
const title = args.title as string
|
|
518
|
+
const content = args.content as string
|
|
519
|
+
const scope = args.scope as 'private' | 'shared'
|
|
520
|
+
const saved = await ws.saveMemory({
|
|
521
|
+
title,
|
|
522
|
+
content,
|
|
523
|
+
importance: args.importance as number | undefined,
|
|
524
|
+
scope,
|
|
525
|
+
dedupKey: args.dedup_key as string | undefined,
|
|
526
|
+
})
|
|
527
|
+
const where = scope === 'shared' ? 'Channel 公共记忆(全员可检索)' : '本人私有记忆'
|
|
528
|
+
return { text: `已沉淀到${where}: "${title}"(dedupKey=${saved.dedupKey})` }
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
case 'create_team_agent': {
|
|
532
|
+
const name = args.name as string
|
|
533
|
+
const harness = args.harness as string | undefined
|
|
534
|
+
const systemPrompt = args.system_prompt as string | undefined
|
|
535
|
+
const reason = args.reason as string | undefined
|
|
536
|
+
const agent: AgentInfo = await ws.createTeamMember({
|
|
537
|
+
name,
|
|
538
|
+
harness,
|
|
539
|
+
config: systemPrompt ? { systemPromptPrefix: systemPrompt } : undefined,
|
|
540
|
+
reason,
|
|
541
|
+
})
|
|
542
|
+
return {
|
|
543
|
+
text: [
|
|
544
|
+
`团队成员已创建并加入 channel:`,
|
|
545
|
+
` id: ${agent.id}`,
|
|
546
|
+
` name: ${agent.name}(role=worker, harness=${agent.harness})`,
|
|
547
|
+
`新成员当前空闲,可立即 dispatch_task 指派任务;list_team_agents 可随时查看团队名册。`,
|
|
548
|
+
].join('\n'),
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
case 'update_team_agent': {
|
|
553
|
+
const agentId = args.agent_id as string
|
|
554
|
+
const name = args.name as string | undefined
|
|
555
|
+
const systemPrompt = args.system_prompt as string | undefined
|
|
556
|
+
const enabled = args.enabled as boolean | undefined
|
|
557
|
+
const reason = args.reason as string | undefined
|
|
558
|
+
const agent = await ws.updateTeamMember(agentId, {
|
|
559
|
+
name,
|
|
560
|
+
config: systemPrompt !== undefined ? { systemPromptPrefix: systemPrompt } : undefined,
|
|
561
|
+
enabled: enabled === undefined ? undefined : (enabled ? 1 : 0),
|
|
562
|
+
reason,
|
|
563
|
+
})
|
|
564
|
+
return {
|
|
565
|
+
text: `团队成员 ${agentId} 已更新:name="${agent.name}"${enabled !== undefined ? `, enabled=${enabled ? 1 : 0}` : ''};运行时将按新配置重载(下次任务生效)。`,
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
case 'remove_team_agent': {
|
|
570
|
+
const agentId = args.agent_id as string
|
|
571
|
+
const reason = args.reason as string | undefined
|
|
572
|
+
const result = await ws.removeTeamMember(agentId, reason)
|
|
573
|
+
const recycleNote = result.recycledTasks.length > 0
|
|
574
|
+
? `其 ${result.recycledTasks.length} 个在途任务已回收(排队任务重派给剩余最短队列成员;执行中任务转 FAILED 待调度重试)。`
|
|
575
|
+
: `该成员无在途任务。`
|
|
576
|
+
return { text: `团队成员 ${agentId} 已移除。${recycleNote}` }
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
case 'my_industrial_nodes': {
|
|
580
|
+
return toolMyIndustrialNodes(identity.agentId)
|
|
581
|
+
}
|
|
582
|
+
case 'dcw_control': {
|
|
583
|
+
return toolDcwControl(identity.agentId, args as { node_id?: string, value?: number | string, hypothesis?: string, task_id?: string })
|
|
584
|
+
}
|
|
585
|
+
case 'dcw_read': {
|
|
586
|
+
return toolDcwRead(identity.agentId, args as { node_id?: string })
|
|
587
|
+
}
|
|
588
|
+
case 'daq_query': {
|
|
589
|
+
return toolDaqQuery(identity.agentId, args as Parameters<typeof toolDaqQuery>[1])
|
|
590
|
+
}
|
|
591
|
+
case 'daq_frames': {
|
|
592
|
+
return toolDaqFrames(identity.agentId, args as Parameters<typeof toolDaqFrames>[1])
|
|
593
|
+
}
|
|
594
|
+
case 'dcw_judge': {
|
|
595
|
+
return toolDcwJudge(identity.agentId, args as { record_id?: string, verdict?: string, reason?: string })
|
|
596
|
+
}
|
|
597
|
+
case 'dcw_rollback': {
|
|
598
|
+
return toolDcwRollback(identity.agentId, args as { record_id?: string, node_id?: string, to?: string })
|
|
599
|
+
}
|
|
600
|
+
case 'dcw_journal': {
|
|
601
|
+
return toolDcwJournal(identity.agentId, args as { node_id?: string, recipe_id?: string, limit?: number | string })
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
return { text: `未知工具: ${req.toolName}`, isError: true }
|
|
605
|
+
}
|
|
606
|
+
catch (err) {
|
|
607
|
+
return {
|
|
608
|
+
text: `工具执行异常(${req.toolName}): ${err instanceof Error ? err.message : String(err)}`,
|
|
609
|
+
isError: true,
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}
|
|
@@ -14,6 +14,7 @@ import { nodeSemanticCards } from './industrial-context'
|
|
|
14
14
|
import { getDcwController } from '../dcw/dcw-controller'
|
|
15
15
|
import { getActiveLineRun } from '../dcw/line-run'
|
|
16
16
|
import { findDcwTemplate } from '../dcw/dcw-templates'
|
|
17
|
+
import { daqRuntimeSettings } from '../settings'
|
|
17
18
|
import { getDaqNodeRepo } from '../daq/daq-node.repo'
|
|
18
19
|
import { findDaqTemplate } from '../daq/daq-templates'
|
|
19
20
|
import { getRecipeRollBackManager } from '../dcw/recipe-rollback-manager'
|
|
@@ -258,7 +259,12 @@ export async function toolDaqQuery(agentId: string, args: {
|
|
|
258
259
|
|
|
259
260
|
const toMs = Number(args.to_ms) || Date.now()
|
|
260
261
|
const fromMs = Number(args.from_ms) || toMs - (Number(args.last_minutes) || 30) * 60_000
|
|
261
|
-
|
|
262
|
+
// 时间间隔参数(bucket_ms 降采样桶宽):缺省与下限来自 daq.query.*(live 配置,热重载)
|
|
263
|
+
const qCfg = daqRuntimeSettings().query
|
|
264
|
+
const rawBucket = Number(args.bucket_ms)
|
|
265
|
+
const bucketMs = Number.isFinite(rawBucket) && rawBucket > 0
|
|
266
|
+
? Math.max(qCfg.minBucketMs, Math.min(3_600_000, Math.round(rawBucket)))
|
|
267
|
+
: qCfg.defaultBucketMs
|
|
262
268
|
const limit = Math.min(Number(args.limit) || 500, 2000)
|
|
263
269
|
const { getTsdb, tsdbReady } = await import('../daq/storage')
|
|
264
270
|
await tsdbReady
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
import { createLogger } from '../logger'
|
|
11
11
|
import { randomUUID } from 'node:crypto'
|
|
12
|
-
import
|
|
13
|
-
import { dirname, join } from 'node:path'
|
|
12
|
+
import { join } from 'node:path'
|
|
14
13
|
import { ensureDataDir } from '@/shared/config/home.mjs'
|
|
15
14
|
import { AppError, ErrorCodes } from '../../../utils/errors'
|
|
15
|
+
import { loadJsonFile, saveJsonFileAtomic } from '../json-store.mjs'
|
|
16
16
|
|
|
17
17
|
const log = createLogger('workshop.node-bindings')
|
|
18
18
|
|
|
@@ -34,7 +34,7 @@ const DB_PATH = join(ensureDataDir(), 'agent-node-bindings.json')
|
|
|
34
34
|
|
|
35
35
|
function load(): AgentNodeBinding[] {
|
|
36
36
|
try {
|
|
37
|
-
const parsed =
|
|
37
|
+
const parsed = loadJsonFile(DB_PATH, null)
|
|
38
38
|
return Array.isArray(parsed) ? parsed as AgentNodeBinding[] : []
|
|
39
39
|
}
|
|
40
40
|
catch {
|
|
@@ -148,8 +148,7 @@ export class AgentNodeBindingRepo {
|
|
|
148
148
|
|
|
149
149
|
private flush(): void {
|
|
150
150
|
try {
|
|
151
|
-
|
|
152
|
-
fs.writeFileSync(DB_PATH, JSON.stringify(this.list, null, 2), 'utf-8')
|
|
151
|
+
saveJsonFileAtomic(DB_PATH, this.list)
|
|
153
152
|
}
|
|
154
153
|
catch (err) {
|
|
155
154
|
log.error('[agent-node-bindings] 落盘失败:', err)
|