agentworkshop 0.7.6 → 0.7.7
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/C-GarxYC.js +1 -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/{CyygA0q4.js → CQiKcuoG.js} +4 -4
- 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/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/{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/14df171d-89cb-43ec-ad6f-9df72d6da7f5.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/{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/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 +4967 -2035
- 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} +4 -4
- 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} +119 -119
- 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} +42 -38
- 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} +102 -102
- 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 +1 -1
- 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/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-iCzNRifn.mjs} +9 -9
- package/.output/server/chunks/build/{workshop-k0XZTFKg.mjs.map → workshop-iCzNRifn.mjs.map} +1 -1
- 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/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 +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +2 -2
- 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 +2 -2
- 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 +6 -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 +1 -1
- package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs +19 -7
- 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 +1 -1
- package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +1 -1
- 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 +1 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +1 -1
- 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 +2 -2
- 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 +1 -1
- package/.output/server/chunks/virtual/entry.mjs +123 -113
- 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/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/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 +134 -134
- package/docs/tui.md +1 -1
- package/i18n/locales/en.ts +5 -0
- package/i18n/locales/zh-CN.ts +5 -0
- package/package.json +148 -140
- package/scripts/_dbg-catalog-smoke.ts +20 -0
- package/scripts/_dbg-codex-probe.mjs +58 -0
- package/scripts/_dbg-dsh-probe.mjs +31 -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-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-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/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 +6 -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 +1366 -16
- package/server/data/dcw-lines.json +266 -0
- package/server/data/dcw-products.json +203 -0
- package/server/data/dcw-recipes.json +784 -0
- package/server/data/dcw-rollback.json +1144 -1
- package/server/data/dcw-runs.json +983 -791
- package/server/data/dcw-writes.json +1080 -0
- package/server/data/dcws.json +3278 -203
- 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 +24 -3
- package/server/plugins/workshop.ts +156 -153
- package/server/repositories/user.repository.ts +414 -391
- package/server/services/system-config.ts +30 -6
- 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 +108 -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 +592 -0
- package/server/services/workshop/agents/industrial-tools.ts +5 -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 +8 -4
- package/server/services/workshop/daq/daq-node.repo.ts +3 -5
- package/server/services/workshop/daq/daq-node.ts +2 -2
- 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 +3 -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 +7 -0
- package/shared/config/schema.json +5 -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/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
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 最小实时探针:单 worker(harness 可选)+ mock lead,注入 requireReply 消息,
|
|
3
|
+
* 全量拉取 AEP 事件(含 error/delta/status),观察引擎回合的真实行为。
|
|
4
|
+
* 运行:node scripts/_dbg-live-engine-probe.mjs codex|dsh|omp
|
|
5
|
+
*/
|
|
6
|
+
const BASE = process.env.AW_BASE ?? 'http://127.0.0.1:3000'
|
|
7
|
+
const harness = process.argv[2] ?? 'dsh'
|
|
8
|
+
|
|
9
|
+
const reg = await fetch(`${BASE}/api/workshop/users/register`, {
|
|
10
|
+
method: 'POST', headers: { 'content-type': 'application/json' },
|
|
11
|
+
body: JSON.stringify({ name: `probe-${harness}-${Date.now() % 100000}` }),
|
|
12
|
+
}).then(r => r.json())
|
|
13
|
+
const T = reg?.data?.token
|
|
14
|
+
if (!T) { console.error('注册失败'); process.exit(1) }
|
|
15
|
+
const api = async (method, path, body) => {
|
|
16
|
+
const res = await fetch(`${BASE}${path}`, {
|
|
17
|
+
method, headers: { 'content-type': 'application/json', authorization: `Bearer ${T}` },
|
|
18
|
+
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
19
|
+
})
|
|
20
|
+
return await res.json().catch(() => ({}))
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const ch = await api('POST', '/api/workshop/channels', { name: `probe-${harness}`, leadAgent: { name: 'lead', harness: 'mock' } })
|
|
24
|
+
const cid = ch?.data?.channelId
|
|
25
|
+
const w = await api('POST', `/api/workshop/channels/${cid}/agents`, {
|
|
26
|
+
name: `w-${harness}`, harness, role: 'worker',
|
|
27
|
+
config: harness === 'codex' ? { approvalPolicy: 'on-request', sandbox: 'workspace-write' } : {},
|
|
28
|
+
})
|
|
29
|
+
console.log(`channel=${cid} worker=${w?.data?.id} harness=${harness}`)
|
|
30
|
+
|
|
31
|
+
// 事件录制流由首个 WS 订阅触发(无订阅者不落库),故先接 WS 再触发事件
|
|
32
|
+
const { createRequire } = await import('node:module')
|
|
33
|
+
const sleep = (ms) => new Promise(r => setTimeout(r, ms))
|
|
34
|
+
const { WebSocket } = createRequire(import.meta.url)('D:/codes/ABO/AgentWorkShop/node_modules/.pnpm/ws@8.21.3/node_modules/ws')
|
|
35
|
+
const ws = new WebSocket(BASE.replace(/^http/, 'ws') + '/api/workshop/ws')
|
|
36
|
+
ws.on('open', () => ws.send(JSON.stringify({ type: 'sub', channelId: cid, token: T })))
|
|
37
|
+
ws.on('error', (e) => console.log('[ws error]', e.message))
|
|
38
|
+
await sleep(1200)
|
|
39
|
+
|
|
40
|
+
const seen = []
|
|
41
|
+
let lastSeq = 0
|
|
42
|
+
const poll = async () => {
|
|
43
|
+
const res = await api('GET', `/api/workshop/channels/${cid}/events?limit=500`)
|
|
44
|
+
for (const f of (res?.data?.items ?? [])) {
|
|
45
|
+
if (Number(f.seq ?? 0) > lastSeq) {
|
|
46
|
+
lastSeq = Number(f.seq)
|
|
47
|
+
seen.push(f)
|
|
48
|
+
const p = f.payload ?? {}
|
|
49
|
+
if (f.type === 'error') console.log(`[evt] ERROR ${p.code}: ${String(p.message ?? '').slice(0, 200)}`)
|
|
50
|
+
else if (f.type === 'a2a.message') console.log(`[evt] message ${(p.parts ?? []).map(x => x.text ?? '').join('').slice(0, 120)}`)
|
|
51
|
+
else if (f.type === 'agent.status.message') console.log(`[evt] status: ${String(p.text ?? '').slice(0, 140)}`)
|
|
52
|
+
else if (f.type === 'agent.delta') process.stdout.write('.')
|
|
53
|
+
else if (f.type === 'a2a.artifact') console.log(`[evt] artifact: ${(p.artifact?.parts ?? []).map(x => x.text ?? '').join('').slice(0, 260)}`)
|
|
54
|
+
else if (f.type === 'task.status') console.log(`[evt] task ${p.state}`)
|
|
55
|
+
else if (f.type === 'hitl.request') console.log(`[evt] HITL ${p.kind}`)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const poller = setInterval(() => { void poll().catch(() => {}) }, 1500)
|
|
60
|
+
|
|
61
|
+
const m = await api('POST', `/api/workshop/channels/${cid}/messages`, {
|
|
62
|
+
toAgentId: w?.data?.id, fromLabel: '探针员', requireReply: true,
|
|
63
|
+
text: `兼容性检查:请用一句话说明你的引擎(${harness}),然后原样回复"${harness} 在线"。`,
|
|
64
|
+
})
|
|
65
|
+
console.log('message sent:', m.status, m?.data?.messageId?.slice(0, 8))
|
|
66
|
+
|
|
67
|
+
const deadline = Date.now() + 300_000
|
|
68
|
+
let replied = false
|
|
69
|
+
while (Date.now() < deadline) {
|
|
70
|
+
await new Promise(r => setTimeout(r, 2000))
|
|
71
|
+
await poll()
|
|
72
|
+
replied = seen.some(f => f.type === 'a2a.message' && f.payload?.metadata?.['x-aw-in-reply-to'] === m?.data?.messageId)
|
|
73
|
+
if (replied) break
|
|
74
|
+
}
|
|
75
|
+
clearInterval(poller)
|
|
76
|
+
console.log(replied ? '\n=== 回执已收到 ===' : '\n=== 300s 未收到回执 ===')
|
|
77
|
+
const byType = {}
|
|
78
|
+
for (const f of seen) byType[f.type] = (byType[f.type] ?? 0) + 1
|
|
79
|
+
console.log('帧分布:', JSON.stringify(byType))
|
|
80
|
+
process.exit(0)
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* MCP 桥探针:验证 aw-mcp-bridge.mjs 的 MCP stdio ↔ HTTP 回程转译(不依赖真实引擎)。
|
|
4
|
+
* 运行:node scripts/_dbg-mcp-bridge-probe.mjs
|
|
5
|
+
*/
|
|
6
|
+
import { spawn } from 'node:child_process'
|
|
7
|
+
import { createServer } from 'node:http'
|
|
8
|
+
import { createInterface } from 'node:readline'
|
|
9
|
+
import { randomUUID } from 'node:crypto'
|
|
10
|
+
import { join, dirname } from 'node:path'
|
|
11
|
+
import { fileURLToPath } from 'node:url'
|
|
12
|
+
|
|
13
|
+
const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..')
|
|
14
|
+
const BRIDGE = join(ROOT, 'server', 'harness', 'aw-mcp-bridge.mjs')
|
|
15
|
+
const AGENT_ID = `a-${randomUUID().slice(0, 8)}`
|
|
16
|
+
const TOKEN = `t-${randomUUID()}`
|
|
17
|
+
|
|
18
|
+
let failures = 0
|
|
19
|
+
const check = (name, ok, detail = '') => {
|
|
20
|
+
console.log(` ${ok ? 'PASS' : 'FAIL'} ${name}${detail ? ` — ${detail}` : ''}`)
|
|
21
|
+
if (!ok) failures += 1
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const seen = { listToken: null, invokeToken: null, invokeBody: null }
|
|
25
|
+
|
|
26
|
+
/** HTTP stub:模拟平台 agent-tools 面 */
|
|
27
|
+
const server = createServer((req, res) => {
|
|
28
|
+
const token = req.headers['x-aw-agent-token']
|
|
29
|
+
if (req.method === 'GET' && req.url?.startsWith('/api/workshop/agent-tools/list')) {
|
|
30
|
+
seen.listToken = token
|
|
31
|
+
if (token !== TOKEN) {
|
|
32
|
+
res.writeHead(401, { 'content-type': 'application/json' })
|
|
33
|
+
res.end(JSON.stringify({ code: 401, message: 'bad token' }))
|
|
34
|
+
return
|
|
35
|
+
}
|
|
36
|
+
res.writeHead(200, { 'content-type': 'application/json' })
|
|
37
|
+
res.end(JSON.stringify({
|
|
38
|
+
code: 0,
|
|
39
|
+
data: {
|
|
40
|
+
tools: [
|
|
41
|
+
{ name: 'report_progress', description: 'Report progress', parameters: { type: 'object', properties: { progress: { type: 'number' } }, required: ['progress'] } },
|
|
42
|
+
{ name: 'probe_tool', description: 'Probe tool', parameters: { type: 'object', properties: { q: { type: 'string' } } } },
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
}))
|
|
46
|
+
return
|
|
47
|
+
}
|
|
48
|
+
if (req.method === 'POST' && req.url?.startsWith('/api/workshop/agent-tools/invoke')) {
|
|
49
|
+
seen.invokeToken = token
|
|
50
|
+
let body = ''
|
|
51
|
+
req.on('data', (d) => { body += d })
|
|
52
|
+
req.on('end', () => {
|
|
53
|
+
seen.invokeBody = JSON.parse(body || '{}')
|
|
54
|
+
if (token !== TOKEN) {
|
|
55
|
+
res.writeHead(401, { 'content-type': 'application/json' })
|
|
56
|
+
res.end(JSON.stringify({ code: 401, message: 'bad token' }))
|
|
57
|
+
return
|
|
58
|
+
}
|
|
59
|
+
const tool = seen.invokeBody.tool
|
|
60
|
+
res.writeHead(200, { 'content-type': 'application/json' })
|
|
61
|
+
if (tool === 'boom') {
|
|
62
|
+
res.end(JSON.stringify({ code: 0, data: { result: { text: '模拟工具失败', isError: true } } }))
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
res.end(JSON.stringify({ code: 0, data: { result: { text: `OK ${tool} q=${seen.invokeBody.args?.q ?? ''}` } } }))
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
return
|
|
69
|
+
}
|
|
70
|
+
res.writeHead(404)
|
|
71
|
+
res.end()
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
await new Promise((resolve) => { server.listen(0, '127.0.0.1', resolve) })
|
|
75
|
+
const port = server.address().port
|
|
76
|
+
|
|
77
|
+
function rpc(child, msg, timeoutMs = 10_000) {
|
|
78
|
+
return new Promise((resolve, reject) => {
|
|
79
|
+
const timer = setTimeout(() => reject(new Error(`RPC 超时: ${msg.method ?? msg.id}`)), timeoutMs)
|
|
80
|
+
const rl = child.rl
|
|
81
|
+
const onLine = (line) => {
|
|
82
|
+
try {
|
|
83
|
+
const frame = JSON.parse(line)
|
|
84
|
+
if (frame.id === msg.id) {
|
|
85
|
+
clearTimeout(timer)
|
|
86
|
+
rl.removeListener('line', onLine)
|
|
87
|
+
resolve(frame)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch { /* 忽略非 JSON 行 */ }
|
|
91
|
+
}
|
|
92
|
+
rl.on('line', onLine)
|
|
93
|
+
child.stdin.write(JSON.stringify(msg) + '\n')
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
console.log('━━━ MCP 桥探针(aw-mcp-bridge.mjs)━━━')
|
|
98
|
+
try {
|
|
99
|
+
const proc = spawn(process.execPath, [BRIDGE], {
|
|
100
|
+
env: { ...process.env, AW_BASE_URL: `http://127.0.0.1:${port}`, AW_AGENT_ID: AGENT_ID, AW_AGENT_TOKEN: TOKEN },
|
|
101
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
102
|
+
})
|
|
103
|
+
proc.rl = createInterface({ input: proc.stdout })
|
|
104
|
+
let stderr = ''
|
|
105
|
+
proc.stderr.on('data', (d) => { stderr += d })
|
|
106
|
+
|
|
107
|
+
// 1. initialize
|
|
108
|
+
const init = await rpc(proc, { jsonrpc: '2.0', id: 1, method: 'initialize', params: { protocolVersion: '2024-11-05' } })
|
|
109
|
+
check('initialize 握手', init.result?.serverInfo?.name === 'aw-host-tools', `serverInfo=${JSON.stringify(init.result?.serverInfo)}`)
|
|
110
|
+
|
|
111
|
+
// 2. tools/list(验证 token 头与工具面透传)
|
|
112
|
+
const list = await rpc(proc, { jsonrpc: '2.0', id: 2, method: 'tools/list' })
|
|
113
|
+
const names = (list.result?.tools ?? []).map(t => t.name)
|
|
114
|
+
check('tools/list 携带 agent token', seen.listToken === TOKEN)
|
|
115
|
+
check('tools/list 透传平台工具面', names.includes('report_progress') && names.includes('probe_tool'), `names=${names.join(',')}`)
|
|
116
|
+
const probe = (list.result?.tools ?? []).find(t => t.name === 'probe_tool')
|
|
117
|
+
check('inputSchema = parameters', JSON.stringify(probe?.inputSchema ?? {}).includes('q'))
|
|
118
|
+
|
|
119
|
+
// 3. tools/call 成功路径
|
|
120
|
+
const call = await rpc(proc, { jsonrpc: '2.0', id: 3, method: 'tools/call', params: { name: 'probe_tool', arguments: { q: 'hello' } } })
|
|
121
|
+
check('tools/call 回程 HTTP', seen.invokeBody?.tool === 'probe_tool' && seen.invokeBody?.agentId === AGENT_ID)
|
|
122
|
+
check('tools/call 结果转译', call.result?.content?.[0]?.text === 'OK probe_tool q=hello', `text=${call.result?.content?.[0]?.text}`)
|
|
123
|
+
check('tools/call 携带 agent token', seen.invokeToken === TOKEN)
|
|
124
|
+
|
|
125
|
+
// 4. isError 透传
|
|
126
|
+
const boom = await rpc(proc, { jsonrpc: '2.0', id: 4, method: 'tools/call', params: { name: 'boom', arguments: {} } })
|
|
127
|
+
check('isError 透传', boom.result?.isError === true, `text=${boom.result?.content?.[0]?.text}`)
|
|
128
|
+
|
|
129
|
+
proc.kill('SIGKILL')
|
|
130
|
+
}
|
|
131
|
+
catch (err) {
|
|
132
|
+
check('桥进程往返', false, err.message)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// 5. 缺 token → 桥拒绝启动
|
|
136
|
+
const bad = spawn(process.execPath, [BRIDGE], {
|
|
137
|
+
env: { ...process.env, AW_BASE_URL: `http://127.0.0.1:${port}`, AW_AGENT_ID: '', AW_AGENT_TOKEN: '' },
|
|
138
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
139
|
+
})
|
|
140
|
+
let badStderr = ''
|
|
141
|
+
bad.stderr.on('data', (d) => { badStderr += d })
|
|
142
|
+
const badExit = await new Promise((resolve) => { bad.on('exit', (code) => resolve(code)) })
|
|
143
|
+
check('缺 AW_AGENT_ID 拒绝启动', badExit === 1, `exit=${badExit} stderr=${badStderr.trim().slice(0, 80)}`)
|
|
144
|
+
|
|
145
|
+
server.close()
|
|
146
|
+
console.log(failures === 0 ? '\n━━━ 全部通过 ━━━' : `\n━━━ ${failures} 项失败 ━━━`)
|
|
147
|
+
process.exit(failures === 0 ? 0 : 1)
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* opencode serve SSE 裸探针:复现 impl 的调用形状,原样打印事件流。
|
|
3
|
+
* 运行:node scripts/_dbg-opencode-sse.mjs
|
|
4
|
+
*/
|
|
5
|
+
import { spawn } from 'node:child_process'
|
|
6
|
+
import { randomUUID } from 'node:crypto'
|
|
7
|
+
import { mkdtempSync, copyFileSync, mkdirSync } from 'node:fs'
|
|
8
|
+
import { join, dirname } from 'node:path'
|
|
9
|
+
import { homedir, tmpdir } from 'node:os'
|
|
10
|
+
|
|
11
|
+
const dataDir = mkdtempSync(join(tmpdir(), 'aw-oc-data-'))
|
|
12
|
+
const configDir = mkdtempSync(join(tmpdir(), 'aw-oc-cfg-'))
|
|
13
|
+
mkdirSync(join(dataDir, 'opencode'), { recursive: true })
|
|
14
|
+
try { copyFileSync(join(homedir(), '.local', 'share', 'opencode', 'auth.json'), join(dataDir, 'opencode', 'auth.json')) } catch (e) { console.log('auth copy fail', e.message) }
|
|
15
|
+
console.log('dataDir=', dataDir)
|
|
16
|
+
|
|
17
|
+
const port = 20000 + Math.floor(Math.random() * 20000)
|
|
18
|
+
const pw = randomUUID()
|
|
19
|
+
const child = spawn('opencode', ['serve', '--port', String(port), '--hostname', '127.0.0.1'], {
|
|
20
|
+
env: { ...process.env, OPENCODE_SERVER_PASSWORD: pw, XDG_DATA_HOME: dataDir, XDG_CONFIG_HOME: configDir },
|
|
21
|
+
stdio: ['ignore', 'pipe', 'pipe'], shell: false,
|
|
22
|
+
})
|
|
23
|
+
child.stderr.on('data', (d) => process.stderr.write('[err] ' + d))
|
|
24
|
+
|
|
25
|
+
const auth = { headers: { authorization: `Basic ${Buffer.from(`opencode:${pw}`).toString('base64')}`, 'content-type': 'application/json' } }
|
|
26
|
+
|
|
27
|
+
setTimeout(async () => {
|
|
28
|
+
// 健康探测
|
|
29
|
+
let healthy = false
|
|
30
|
+
for (let i = 0; i < 60; i++) {
|
|
31
|
+
try {
|
|
32
|
+
const r = await fetch(`http://127.0.0.1:${port}/global/health`, { headers: { authorization: auth.headers.authorization }, signal: AbortSignal.timeout(2000) })
|
|
33
|
+
if (r.ok) { healthy = true; break }
|
|
34
|
+
}
|
|
35
|
+
catch {}
|
|
36
|
+
await new Promise(r => setTimeout(r, 500))
|
|
37
|
+
}
|
|
38
|
+
console.log('healthy=', healthy)
|
|
39
|
+
if (!healthy) process.exit(1)
|
|
40
|
+
|
|
41
|
+
// MCP 桥注册(与 impl 同形状)
|
|
42
|
+
const bridge = process.env.AW_BRIDGE_PATH ?? join(process.cwd(), 'server', 'harness', 'aw-mcp-bridge.mjs')
|
|
43
|
+
const mcpRes = await fetch(`http://127.0.0.1:${port}/mcp`, { ...auth, method: 'POST', body: JSON.stringify({
|
|
44
|
+
name: 'aw-host-tools',
|
|
45
|
+
config: { type: 'local', command: [process.execPath, bridge], environment: { AW_BASE_URL: 'http://127.0.0.1:1', AW_AGENT_ID: 'x', AW_AGENT_TOKEN: 'y' } },
|
|
46
|
+
}) })
|
|
47
|
+
console.log('mcp register:', mcpRes.status, (await mcpRes.text()).slice(0, 120))
|
|
48
|
+
|
|
49
|
+
// 建会话(带权限规则)
|
|
50
|
+
const sesRes = await fetch(`http://127.0.0.1:${port}/session`, { ...auth, method: 'POST', body: JSON.stringify({
|
|
51
|
+
title: 'probe',
|
|
52
|
+
permission: [{ permission: 'edit', action: 'ask' }, { permission: 'bash', pattern: '*', action: 'ask' }],
|
|
53
|
+
}) })
|
|
54
|
+
const ses = await sesRes.json()
|
|
55
|
+
console.log('session:', sesRes.status, JSON.stringify(ses).slice(0, 200))
|
|
56
|
+
const sid = ses.id
|
|
57
|
+
|
|
58
|
+
// 事件流
|
|
59
|
+
const es = await fetch(`http://127.0.0.1:${port}/event`, { headers: auth.headers })
|
|
60
|
+
const reader = es.body.getReader()
|
|
61
|
+
const dec = new TextDecoder()
|
|
62
|
+
let buf = ''
|
|
63
|
+
const events = []
|
|
64
|
+
;(async () => {
|
|
65
|
+
for (;;) {
|
|
66
|
+
const { done, value } = await reader.read()
|
|
67
|
+
if (done) break
|
|
68
|
+
buf += dec.decode(value, { stream: true })
|
|
69
|
+
const parts = buf.split('\n\n'); buf = parts.pop()
|
|
70
|
+
for (const chunk of parts) for (const line of chunk.split('\n')) {
|
|
71
|
+
if (!line.startsWith('data:')) continue
|
|
72
|
+
try { events.push(JSON.parse(line.slice(5))) } catch {}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
})()
|
|
76
|
+
|
|
77
|
+
// 投递
|
|
78
|
+
const pr = await fetch(`http://127.0.0.1:${port}/session/${sid}/prompt_async`, { ...auth, method: 'POST', body: JSON.stringify({
|
|
79
|
+
model: { providerID: 'zhipuai-coding-plan', modelID: 'glm-5.3-flash' },
|
|
80
|
+
parts: [{ type: 'text', text: 'Reply with exactly: OK' }],
|
|
81
|
+
}) })
|
|
82
|
+
console.log('prompt_async:', pr.status)
|
|
83
|
+
|
|
84
|
+
const deadline = Date.now() + 90_000
|
|
85
|
+
while (Date.now() < deadline) {
|
|
86
|
+
await new Promise(r => setTimeout(r, 1500))
|
|
87
|
+
const err = events.find(e => e.type === 'session.error')
|
|
88
|
+
const idle = events.find(e => e.type === 'session.idle')
|
|
89
|
+
if (err || idle) break
|
|
90
|
+
}
|
|
91
|
+
console.log('--- events (deduped by type) ---')
|
|
92
|
+
const seen = new Map()
|
|
93
|
+
for (const e of events) {
|
|
94
|
+
const key = e.type + ':' + (e.properties?.part?.type ?? '')
|
|
95
|
+
if (!seen.has(key)) { seen.set(key, 1); console.log(e.type, JSON.stringify(e.properties ?? {}).slice(0, 260)) }
|
|
96
|
+
else seen.set(key, seen.get(key) + 1)
|
|
97
|
+
}
|
|
98
|
+
for (const [k, n] of seen) if (n > 1) console.log(`(${k} x${n})`)
|
|
99
|
+
child.kill('SIGKILL')
|
|
100
|
+
process.exit(0)
|
|
101
|
+
}, 3000)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* opencode impl 启动聚焦探针:复现 e2e 的 spawn+健康探测路径,逐次打印探测结果。
|
|
3
|
+
* 运行:npx tsx --tsconfig .nuxt/tsconfig.server.json scripts/_dbg-opencode-start.ts
|
|
4
|
+
*/
|
|
5
|
+
import { spawn as launchChildProcess } from 'node:child_process'
|
|
6
|
+
import { randomUUID } from 'node:crypto'
|
|
7
|
+
import { createServer } from 'node:net'
|
|
8
|
+
|
|
9
|
+
async function freePort(): Promise<number> {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
const srv = createServer()
|
|
12
|
+
srv.unref()
|
|
13
|
+
srv.on('error', reject)
|
|
14
|
+
srv.listen(0, '127.0.0.1', () => {
|
|
15
|
+
const addr = srv.address()
|
|
16
|
+
const port = typeof addr === 'object' && addr ? addr.port : 0
|
|
17
|
+
srv.close(() => (port ? resolve(port) : reject(new Error('无可用端口'))))
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const port = await freePort()
|
|
23
|
+
const password = randomUUID()
|
|
24
|
+
console.log('port=', port)
|
|
25
|
+
const child = launchChildProcess('opencode', ['serve', '--port', String(port), '--hostname', '127.0.0.1'], {
|
|
26
|
+
cwd: process.cwd(),
|
|
27
|
+
env: { ...process.env, OPENCODE_SERVER_PASSWORD: password },
|
|
28
|
+
windowsHide: true,
|
|
29
|
+
shell: false,
|
|
30
|
+
})
|
|
31
|
+
console.log('pid=', child.pid)
|
|
32
|
+
child.stdout?.on('data', (d: Buffer) => process.stdout.write(`[out] ${d}`))
|
|
33
|
+
child.stderr?.on('data', (d: Buffer) => process.stderr.write(`[err] ${d}`))
|
|
34
|
+
child.on('exit', code => console.log('exit', code))
|
|
35
|
+
child.on('error', err => console.log('spawn error', err.message))
|
|
36
|
+
|
|
37
|
+
const basic = `Basic ${Buffer.from(`opencode:${password}`).toString('base64')}`
|
|
38
|
+
const deadline = Date.now() + 45_000
|
|
39
|
+
let n = 0
|
|
40
|
+
while (Date.now() < deadline) {
|
|
41
|
+
n++
|
|
42
|
+
try {
|
|
43
|
+
const res = await fetch(`http://127.0.0.1:${port}/global/health`, {
|
|
44
|
+
headers: { authorization: basic },
|
|
45
|
+
signal: AbortSignal.timeout(2000),
|
|
46
|
+
})
|
|
47
|
+
const text = await res.text()
|
|
48
|
+
console.log(`attempt ${n}: ${res.status} ${text.slice(0, 80)}`)
|
|
49
|
+
if (res.ok) break
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
if (n % 10 === 0) console.log(`attempt ${n}: ${(err as Error).message}`)
|
|
53
|
+
}
|
|
54
|
+
await new Promise(r => setTimeout(r, 500))
|
|
55
|
+
}
|
|
56
|
+
child.kill('SIGKILL')
|
|
57
|
+
process.exit(0)
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件系统全链路实测:默认下沉路径(MinIO 图像帧) + 自定义模板插件安装/连接/加工验证。
|
|
3
|
+
* NO_PROXY='*' node scripts/_dbg-plugin-matrix.mjs [--base http://127.0.0.1:3000]
|
|
4
|
+
*
|
|
5
|
+
* R-10 默认节点(默认下沉):ccd-image(mock)→ 帧落对象存储(MinIO/磁盘降级)→ /frames + content;
|
|
6
|
+
* 标量节点 Timescale 落库与 WS 已由 _dbg-protocol-matrix.mjs 覆盖。
|
|
7
|
+
* R-11 自定义插件安装:落盘 .AgentWorkShop/plugins/aw-matrix-plugin → REST enable(热重载)。
|
|
8
|
+
* R-12 插件模板节点接模拟工况:驱动(matrix-thermo→HTTP 模拟设备)→ 自定义算法(1.02x+0.5)
|
|
9
|
+
* → 自定义处理器(matrix-derate)→ 入库/WS;断言入库值 ≈ 43.85(非原始 42.5)。
|
|
10
|
+
* R-13 Agent 工具 + 观测路由:omp 工具注册 + /api/plugins/aw-matrix-plugin/stats。
|
|
11
|
+
*/
|
|
12
|
+
const BASE = (() => {
|
|
13
|
+
const i = process.argv.indexOf('--base')
|
|
14
|
+
return i > 0 ? process.argv[i + 1] : 'http://127.0.0.1:3000'
|
|
15
|
+
})()
|
|
16
|
+
const TAG = Date.now().toString(36)
|
|
17
|
+
|
|
18
|
+
let failures = 0
|
|
19
|
+
let passed = 0
|
|
20
|
+
const results = []
|
|
21
|
+
const check = (id, name, ok, detail = '') => {
|
|
22
|
+
console.log(` ${ok ? 'PASS' : 'FAIL'} ${id} ${name}${detail ? ` — ${detail}` : ''}`)
|
|
23
|
+
results.push({ id, name, ok, detail })
|
|
24
|
+
ok ? passed++ : failures++
|
|
25
|
+
}
|
|
26
|
+
const sleep = ms => new Promise(r => setTimeout(r, ms))
|
|
27
|
+
|
|
28
|
+
const api = async (method, path, { body, token } = {}, attempt = 0) => {
|
|
29
|
+
const headers = { 'content-type': 'application/json' }
|
|
30
|
+
if (token) headers.authorization = `Bearer ${token}`
|
|
31
|
+
try {
|
|
32
|
+
const res = await fetch(`${BASE}${path}`, { method, headers, body: body !== undefined ? JSON.stringify(body) : undefined })
|
|
33
|
+
return { status: res.status, ...(await res.json().catch(() => ({}))) }
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
if (attempt < 3) { await sleep(2500); return api(method, path, { body, token }, attempt + 1) }
|
|
37
|
+
throw err
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async function main() {
|
|
42
|
+
console.log(`\n━━━ 插件系统全链路实测 @ ${BASE} (tag=${TAG}) ━━━`)
|
|
43
|
+
|
|
44
|
+
const fs = await import('node:fs')
|
|
45
|
+
const { spawnSync, spawn } = await import('node:child_process')
|
|
46
|
+
const resolve2 = (await import('node:path')).resolve
|
|
47
|
+
// preflight:dev server 自愈(外部击杀 → 清僵尸 guard → 重启,最多等 90s)
|
|
48
|
+
{
|
|
49
|
+
let ok = false
|
|
50
|
+
for (let i = 0; i < 30 && !ok; i++) {
|
|
51
|
+
try { ok = (await fetch(`${BASE}/api/health`)).status === 200 } catch { ok = false }
|
|
52
|
+
if (!ok) {
|
|
53
|
+
if (i === 0) {
|
|
54
|
+
const lockPath = resolve2('.AgentWorkShop/.runtime/aw.lock')
|
|
55
|
+
let lockPid = 0
|
|
56
|
+
try { lockPid = Number(JSON.parse(fs.readFileSync(lockPath, 'utf-8')).pid ?? 0) } catch { /* 无锁 */ }
|
|
57
|
+
if (lockPid) {
|
|
58
|
+
spawnSync('cmd', ['/c', `taskkill /F /PID ${lockPid}`])
|
|
59
|
+
try { fs.unlinkSync(lockPath) } catch { /* 无锁 */ }
|
|
60
|
+
console.log(` [preflight] dev server 僵尸 guard(pid=${lockPid})已清,重启…`)
|
|
61
|
+
const fd = fs.openSync(resolve2('.AgentWorkShop/data/dev-server.log'), 'a')
|
|
62
|
+
const { spawn } = await import('node:child_process')
|
|
63
|
+
const child = spawn(process.execPath, ['bin/aw.mjs', 'dev'], {
|
|
64
|
+
cwd: process.cwd(), env: { ...process.env, NO_PROXY: '127.0.0.1,localhost' },
|
|
65
|
+
detached: true, stdio: ['ignore', fd, fd],
|
|
66
|
+
})
|
|
67
|
+
child.unref()
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
await sleep(3000)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (!ok) throw new Error('preflight:dev server 90s 未恢复')
|
|
74
|
+
}
|
|
75
|
+
console.log(' [preflight] dev server 健康')
|
|
76
|
+
|
|
77
|
+
// preflight:模拟工况自愈(清旧持有者 → 唯一实例)
|
|
78
|
+
{
|
|
79
|
+
const net = await import('node:net')
|
|
80
|
+
const SIMS = [
|
|
81
|
+
{ name: 'mqtt-http', ports: [18830, 1889], cmd: 'scripts/dev-protocol-simulators.mjs', env: { MQTT_SIM_PORT: '18830', HTTP_SIM_PORT: '1889' }, log: 'sim-mqtt-http.log' },
|
|
82
|
+
{ name: 'modbus-tcp', ports: [1502], cmd: 'scripts/dev-modbus-simulator.mjs', env: {}, log: 'sim-modbus-tcp.log' },
|
|
83
|
+
{ name: 'opcua', ports: [4840], cmd: 'scripts/dev-opcua-simulator.mjs', env: { OPCUA_SIM_PORT: '4840' }, log: 'sim-opcua.log' },
|
|
84
|
+
{ name: 'plc', ports: [15040], cmd: 'scripts/dev-plc-simulator.mjs', env: {}, args: ['--port', '15040'], log: 'sim-plc.log' },
|
|
85
|
+
{ name: 'rtu', ports: [15030], cmd: 'scripts/_rtu-mini-slave.mjs', env: {}, log: 'sim-rtu.log' },
|
|
86
|
+
]
|
|
87
|
+
const portUp = (port) => new Promise((res) => {
|
|
88
|
+
const s = net.connect(port, '127.0.0.1')
|
|
89
|
+
const t = setTimeout(() => { s.destroy(); res(false) }, 1000)
|
|
90
|
+
s.on('connect', () => { clearTimeout(t); s.destroy(); res(true) })
|
|
91
|
+
s.on('error', () => { clearTimeout(t); res(false) })
|
|
92
|
+
})
|
|
93
|
+
for (const sim of SIMS) {
|
|
94
|
+
const owners = spawnSync('cmd', ['/c', `netstat -ano | findstr :${sim.ports[0]} | findstr LISTENING`], { encoding: 'utf-8' })
|
|
95
|
+
for (const line of (owners.stdout ?? '').split('\n')) {
|
|
96
|
+
const m = line.trim().match(/\s(\d+)\s*$/)
|
|
97
|
+
if (m) { spawnSync('cmd', ['/c', `taskkill /F /PID ${m[1]}`]); await sleep(300) }
|
|
98
|
+
}
|
|
99
|
+
const fd = fs.openSync(resolve2('.AgentWorkShop/data', sim.log), 'a')
|
|
100
|
+
const child = spawn(process.execPath, [sim.cmd, ...(sim.args ?? [])], {
|
|
101
|
+
cwd: process.cwd(), env: { ...process.env, NO_PROXY: '127.0.0.1,localhost', ...sim.env },
|
|
102
|
+
detached: true, stdio: ['ignore', fd, fd],
|
|
103
|
+
})
|
|
104
|
+
child.unref()
|
|
105
|
+
let up = false
|
|
106
|
+
for (let i = 0; i < 15 && !up; i++) { await sleep(1000); up = await portUp(sim.ports[0]) }
|
|
107
|
+
if (!up) throw new Error(`preflight:${sim.name} 拉起失败`)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
console.log(' [preflight] 模拟工况六端口就绪')
|
|
111
|
+
|
|
112
|
+
const reg = await api('POST', '/api/users/register', {
|
|
113
|
+
body: { email: `plug-${TAG}@test.local`, password: 'Passw0rd!123', name: `plug-${TAG}` },
|
|
114
|
+
})
|
|
115
|
+
const token = reg.data?.token
|
|
116
|
+
if (!token) throw new Error(`注册失败: ${JSON.stringify(reg).slice(0, 200)}`)
|
|
117
|
+
|
|
118
|
+
// ═══ R-10 默认节点:图像帧默认下沉(对象存储 MinIO/磁盘) ═══
|
|
119
|
+
const line = (await api('POST', '/api/workshop/dcw/lines', { body: { name: `插件产线-${TAG}` }, token })).data?.line
|
|
120
|
+
const img = (await api('POST', '/api/workshop/daq', {
|
|
121
|
+
body: { templateRef: 'daq-ccd-image', name: `视觉相机-${TAG}`, driver: 'mock', lineId: line.id, intervalMs: 700, publishIntervalMs: 0 }, token,
|
|
122
|
+
})).data?.node
|
|
123
|
+
check('R10.1', '默认节点创建(ccd-image,mock 模拟工况)', Boolean(img?.id))
|
|
124
|
+
// 配方 mock 参数节点 + 开跑(数采门控需要 active run)
|
|
125
|
+
const dwMock = (await api('POST', '/api/workshop/dcw', { body: { templateRef: 'dcw-temp-sp', name: `插件参数-${TAG}`, driver: 'mock', lineId: line.id }, token })).data?.node
|
|
126
|
+
const prod = (await api('POST', '/api/workshop/dcw/products', { body: { name: `插件产品-${TAG}`, lineId: line.id }, token })).data?.product
|
|
127
|
+
const recipe = (await api('POST', '/api/workshop/dcw/recipes', {
|
|
128
|
+
body: {
|
|
129
|
+
productId: prod.id, name: `插件配方-${TAG}`,
|
|
130
|
+
params: [{ templateRef: 'dcw-temp-sp', nodeId: dwMock.id, value: 180, min: 150, max: 200 }],
|
|
131
|
+
daqWindows: [{ nodeId: img.id, min: 0, max: 255 }],
|
|
132
|
+
}, token,
|
|
133
|
+
})).data?.recipe
|
|
134
|
+
const start = await api('POST', `/api/workshop/dcw/lines/${line.id}/start`, { body: { recipeId: recipe.id }, token })
|
|
135
|
+
check('R10.0', '产线开跑(激活数采门控)', start.code === 0, start.message ?? '')
|
|
136
|
+
await sleep(4500)
|
|
137
|
+
const frames = await api('GET', `/api/workshop/daq/${img.id}/frames?limit=5`, { token })
|
|
138
|
+
const frameItems = frames.data?.frames ?? frames.data?.items ?? frames.data ?? []
|
|
139
|
+
check('R10.2', '图像帧落对象存储(/frames 元数据)', Array.isArray(frameItems) && frameItems.length >= 2, `frames=${Array.isArray(frameItems) ? frameItems.length : 'undefined'}`)
|
|
140
|
+
const firstFrame = Array.isArray(frameItems) ? frameItems[0] : null
|
|
141
|
+
const contentUrl = firstFrame?.contentUrl
|
|
142
|
+
const fTs = firstFrame?.ts ?? firstFrame?.at
|
|
143
|
+
if (contentUrl || fTs) {
|
|
144
|
+
const url = contentUrl ?? `/api/workshop/daq/${img.id}/frames/content?ts=${fTs}`
|
|
145
|
+
const content = await fetch(`${BASE}${url}`, { headers: { authorization: `Bearer ${token}` } })
|
|
146
|
+
const buf = await content.arrayBuffer()
|
|
147
|
+
check('R10.3', '帧内容可回源(MinIO/对象存储 GET)', content.status === 200 && buf.byteLength > 100, `status=${content.status} bytes=${buf.byteLength}`)
|
|
148
|
+
} else {
|
|
149
|
+
check('R10.3', '帧内容可回源(MinIO/对象存储 GET)', false, `无回源地址 frame=${JSON.stringify(firstFrame ?? {}).slice(0, 100)}`)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// ═══ R-11 自定义插件:安装(落盘已完成)→ 发现/启用态 ═══
|
|
153
|
+
const list0 = await api('GET', '/api/workshop/plugins', { token })
|
|
154
|
+
const plugins0 = list0.plugins ?? list0.data?.plugins ?? []
|
|
155
|
+
const mine0 = plugins0.find(p => p.name === 'aw-matrix-plugin')
|
|
156
|
+
check('R11.1', '插件被发现(plugins 列表)', Boolean(mine0), `enabled=${mine0?.enabled} 共${plugins0.length}个`)
|
|
157
|
+
if (mine0 && mine0.enabled === false) {
|
|
158
|
+
const en = await api('POST', '/api/workshop/plugins/aw-matrix-plugin/enable', { body: {}, token })
|
|
159
|
+
check('R11.2', 'REST 启用插件(热重载)', en.code === 0 || en.status === 200, en.message ?? '')
|
|
160
|
+
await sleep(3000)
|
|
161
|
+
} else {
|
|
162
|
+
check('R11.2', '插件已处于启用态(发现即装载)', true)
|
|
163
|
+
}
|
|
164
|
+
const daqList = await api('GET', '/api/workshop/daq', { token })
|
|
165
|
+
const tplItems = daqList.data?.templates ?? []
|
|
166
|
+
const mineTpl = tplItems.find(t => t.key === 'plug-matrix-profile')
|
|
167
|
+
check('R11.3', '自定义模板已注册(plug-matrix-profile)', Boolean(mineTpl), `templates=${tplItems.length}`)
|
|
168
|
+
|
|
169
|
+
// ═══ R-12 插件模板节点接模拟工况:自定义驱动+算法+处理器全链路 ═══
|
|
170
|
+
const drvTest = await api('POST', '/api/workshop/daq/test-driver', { body: { driver: 'matrix-thermo', driverConfig: {} }, token })
|
|
171
|
+
check('R12.1', '插件自定义驱动连接测试(→HTTP 模拟工况)', drvTest.data?.test?.ok === true, JSON.stringify(drvTest.data?.test ?? {}).slice(0, 100))
|
|
172
|
+
const calib = (await api('POST', '/api/workshop/daq', {
|
|
173
|
+
body: { templateRef: 'plug-matrix-profile', name: `插件标定-${TAG}`, driver: 'matrix-thermo', driverConfig: {}, lineId: line.id, intervalMs: 700, publishIntervalMs: 0 }, token,
|
|
174
|
+
})).data?.node
|
|
175
|
+
check('R12.2', '插件模板节点创建', Boolean(calib?.id))
|
|
176
|
+
await sleep(6000)
|
|
177
|
+
const samples = await api('GET', `/api/workshop/daq/${calib.id}/samples?bucketMs=1000`, { token })
|
|
178
|
+
const pts = samples.data?.points ?? []
|
|
179
|
+
const vals = pts.map(p => Number(Object.values(p)[1])).filter(Number.isFinite)
|
|
180
|
+
// 原始值 42.5±0.5 → 补偿后 1.02x+0.5 ≈ 43.85±1(>48 削峰不会触发)
|
|
181
|
+
const calibrated = vals.filter(v => v > 42.2 && v < 46)
|
|
182
|
+
check('R12.3', '自定义算法生效(入库=1.02×42.5+0.5≈43.85,非原始 42.5)', vals.length >= 4 && calibrated.length >= Math.floor(vals.length * 0.6),
|
|
183
|
+
`points=${pts.length} last=${vals.at(-1)} 原始恒为 42.5±0.5`)
|
|
184
|
+
|
|
185
|
+
// ═══ R-13 插件观测路由 + Agent 工具 ═══
|
|
186
|
+
const stats = await api('GET', '/api/plugins/aw-matrix-plugin/stats', { token })
|
|
187
|
+
const sbody = stats.body ?? stats.data?.body ?? stats.data ?? {}
|
|
188
|
+
check('R13.1', '插件 REST 路由(/stats)+ 钩子计数', sbody.ok === true && Number(sbody.samples) > 0,
|
|
189
|
+
`samples=${sbody.samples} frames=${sbody.frames} last=${sbody.lastValue}`)
|
|
190
|
+
const tools = await api('GET', '/api/workshop/plugins', { token })
|
|
191
|
+
const mineNow = (tools.plugins ?? tools.data?.plugins ?? []).find(p => p.name === 'aw-matrix-plugin')
|
|
192
|
+
check('R13.2', '插件管理面可见(启用态)', Boolean(mineNow?.enabled), `enabled=${mineNow?.enabled}`)
|
|
193
|
+
|
|
194
|
+
// ═══ 清理 ═══
|
|
195
|
+
await api('POST', `/api/workshop/dcw/lines/${line.id}/stop`, { token }).catch(() => {})
|
|
196
|
+
await api('DELETE', `/api/workshop/daq/${img.id}`, { token }).catch(() => {})
|
|
197
|
+
await api('DELETE', `/api/workshop/daq/${calib.id}`, { token }).catch(() => {})
|
|
198
|
+
await api('DELETE', `/api/workshop/dcw/${dwMock.id}`, { token }).catch(() => {})
|
|
199
|
+
await api('DELETE', `/api/workshop/dcw/lines/${line.id}`, { token }).catch(() => {})
|
|
200
|
+
|
|
201
|
+
console.log(`\n━━━ 插件矩阵结果: ${passed} passed / ${failures} failed ━━━`)
|
|
202
|
+
if (failures) {
|
|
203
|
+
console.log('失败项:')
|
|
204
|
+
for (const r of results.filter(x => !x.ok)) console.log(` ${r.id} ${r.name} — ${r.detail}`)
|
|
205
|
+
}
|
|
206
|
+
process.exit(failures === 0 ? 0 : 1)
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
main().catch((err) => {
|
|
210
|
+
console.error('FATAL', err)
|
|
211
|
+
process.exit(1)
|
|
212
|
+
})
|