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,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 间隔配置化 场景测试:daq.sampling.* / daq.query.* 全链路(live 热重载)。
|
|
3
|
+
* NO_PROXY='127.0.0.1,localhost' node scripts/_dbg-interval-config.mjs [--base http://127.0.0.1:3001]
|
|
4
|
+
*
|
|
5
|
+
* C1 PATCH 设置:daq.sampling.defaultIntervalMs=2000 → controller 状态即时反映(热重载)
|
|
6
|
+
* C2 下限钳制:daq.sampling.minIntervalMs=2000 → create intervalMs=500 被钳到 2000
|
|
7
|
+
* C3 恢复:PATCH 回 5000/1000 → 新建节点默认节拍恢复
|
|
8
|
+
* C4 查询间隔:daq.query.defaultBucketMs=3000 → samples 缺省返回 3000;minBucketMs=800 → 传 500 钳 800
|
|
9
|
+
* C5 CLI 同源:runtime-settings.json 写入后 reload 生效(经 settings API 模拟 aw config set 同一收敛点)
|
|
10
|
+
* C6 工具描述:hostToolsForRole → daq_query.bucket_ms 描述携带当前配置值
|
|
11
|
+
* C7 采样节拍真实生效:default=2000 下,未显式 intervalMs 的节点 8s 采样 ≈4-5 样本(而非 5s 档 ≈2)
|
|
12
|
+
*/
|
|
13
|
+
const BASE = (() => {
|
|
14
|
+
const i = process.argv.indexOf('--base')
|
|
15
|
+
return i > 0 ? process.argv[i + 1] : 'http://127.0.0.1:3001'
|
|
16
|
+
})()
|
|
17
|
+
let failures = 0
|
|
18
|
+
let passed = 0
|
|
19
|
+
const results = []
|
|
20
|
+
const check = (id, name, ok, detail = '') => {
|
|
21
|
+
console.log(` ${ok ? 'PASS' : 'FAIL'} ${id} ${name}${detail ? ` — ${detail}` : ''}`)
|
|
22
|
+
results.push({ id, name, ok, detail })
|
|
23
|
+
ok ? passed++ : failures++
|
|
24
|
+
}
|
|
25
|
+
const sleep = ms => new Promise(r => setTimeout(r, ms))
|
|
26
|
+
const api = async (method, path, { body, token } = {}) => {
|
|
27
|
+
const res = await fetch(`${BASE}${path}`, {
|
|
28
|
+
method,
|
|
29
|
+
headers: { 'content-type': 'application/json', ...(token ? { authorization: `Bearer ${token}` } : {}) },
|
|
30
|
+
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
31
|
+
})
|
|
32
|
+
return { status: res.status, ...(await res.json().catch(() => ({}))) }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async function main() {
|
|
36
|
+
console.log(`\n━━━ 间隔配置化 场景测试 @ ${BASE} ━━━`)
|
|
37
|
+
const reg = await api('POST', '/api/users/register', { body: { email: `cfg-${Date.now().toString(36)}@test.local`, password: 'Passw0rd!123', name: `cfg-${Date.now().toString(36)}` } })
|
|
38
|
+
const token = reg.data?.token
|
|
39
|
+
if (!token) throw new Error('注册失败')
|
|
40
|
+
// 设置修改需 admin:读取种子凭据存档(.AgentWorkShop/data/seed-credentials.txt)
|
|
41
|
+
const fs = await import('node:fs')
|
|
42
|
+
let adminToken = token
|
|
43
|
+
try {
|
|
44
|
+
const cred = fs.readFileSync('.AgentWorkShop/data/seed-credentials.txt', 'utf-8')
|
|
45
|
+
const pw = cred.match(/password:\s*(\S+)/)?.[1]
|
|
46
|
+
const lg = await api('POST', '/api/users/login', { body: { email: 'zhangwei@awshop.io', password: pw } })
|
|
47
|
+
adminToken = lg.data?.token ?? token
|
|
48
|
+
console.log(` [setup] admin 登录: ${lg.data?.token ? 'ok' : '失败(回退 user token)'}`)
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
console.log(' [setup] 无种子凭据存档,回退 user token')
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ── C1 采样默认间隔 live 调节 ──
|
|
55
|
+
const p1 = await api('PATCH', '/api/system/settings', { body: { 'daq.sampling.defaultIntervalMs': 2000, 'daq.sampling.minIntervalMs': 2000 }, token: adminToken })
|
|
56
|
+
check('C1.1', 'PATCH daq.sampling.*(2000/2000) 接受', p1.status === 200 && p1.code === 0, JSON.stringify(p1.message ?? '').slice(0, 80))
|
|
57
|
+
await sleep(1500)
|
|
58
|
+
const ctl1 = (await api('GET', '/api/workshop/daq', { token })).data?.controller
|
|
59
|
+
check('C1.2', 'controller.defaultIntervalMs 热重载=2000', ctl1?.defaultIntervalMs === 2000, `value=${ctl1?.defaultIntervalMs} min=${ctl1?.minIntervalMs}`)
|
|
60
|
+
check('C1.3', 'controller.minIntervalMs 热重载=2000', ctl1?.minIntervalMs === 2000, `value=${ctl1?.minIntervalMs}`)
|
|
61
|
+
|
|
62
|
+
// ── C2 下限钳制 ──
|
|
63
|
+
const line = (await api('POST', '/api/workshop/dcw/lines', { body: { name: `cfg-${Date.now().toString(36)}` }, token })).data?.line
|
|
64
|
+
const nLow = (await api('POST', '/api/workshop/daq', {
|
|
65
|
+
body: { templateRef: 'daq-temp-tc', name: 'cfg-low', driver: 'mock', lineId: line.id, intervalMs: 500 }, token,
|
|
66
|
+
})).data?.node
|
|
67
|
+
check('C2.1', 'create intervalMs=500 → 钳到 minIntervalMs=2000', nLow?.intervalMs === 2000, `intervalMs=${nLow?.intervalMs}`)
|
|
68
|
+
const nDefault = (await api('POST', '/api/workshop/daq', {
|
|
69
|
+
body: { templateRef: 'daq-temp-tc', name: 'cfg-default', driver: 'mock', lineId: line.id }, token,
|
|
70
|
+
})).data?.node
|
|
71
|
+
check('C2.2', '未指定 intervalMs → 跟随默认(null,运行时取 2000)', nDefault?.intervalMs == null, `intervalMs=${nDefault?.intervalMs}`)
|
|
72
|
+
|
|
73
|
+
// ── C3 恢复配置 ──
|
|
74
|
+
await api('PATCH', '/api/system/settings', { body: { 'daq.sampling.defaultIntervalMs': 5000, 'daq.sampling.minIntervalMs': 1000 }, token: adminToken })
|
|
75
|
+
await sleep(1500)
|
|
76
|
+
const ctl2 = (await api('GET', '/api/workshop/daq', { token })).data?.controller
|
|
77
|
+
check('C3.1', '恢复 5000/1000 即时生效', ctl2?.defaultIntervalMs === 5000 && ctl2?.minIntervalMs === 1000, `default=${ctl2?.defaultIntervalMs} min=${ctl2?.minIntervalMs}`)
|
|
78
|
+
|
|
79
|
+
// ── C4 查询间隔 live 调节 ──
|
|
80
|
+
const dw = (await api('POST', '/api/workshop/dcw', { body: { templateRef: 'dcw-temp-sp', name: 'cfg-dcw', driver: 'mock', lineId: line.id }, token })).data?.node
|
|
81
|
+
const prod = (await api('POST', '/api/workshop/dcw/products', { body: { name: 'cfg-prod', lineId: line.id }, token })).data?.product
|
|
82
|
+
const recipe = (await api('POST', '/api/workshop/dcw/recipes', {
|
|
83
|
+
body: { productId: prod.id, name: 'cfg-recipe', params: [{ templateRef: 'dcw-temp-sp', nodeId: dw.id, value: 180, min: 150, max: 200 }], daqWindows: [{ nodeId: nDefault.id, min: 0, max: 260 }] }, token,
|
|
84
|
+
})).data?.recipe
|
|
85
|
+
const start = await api('POST', `/api/workshop/dcw/lines/${line.id}/start`, { body: { recipeId: recipe.id }, token })
|
|
86
|
+
check('C4.0', '产线开跑(门控)', start.code === 0)
|
|
87
|
+
await api('PATCH', '/api/system/settings', { body: { 'daq.query.defaultBucketMs': 3000, 'daq.query.minBucketMs': 800 }, token: adminToken })
|
|
88
|
+
await sleep(8000)
|
|
89
|
+
const q1 = await api('GET', `/api/workshop/daq/${nDefault.id}/samples`, { token })
|
|
90
|
+
check('C4.1', 'samples 缺省桶=3000(热重载)', q1.data?.bucketMs === 3000, `bucketMs=${q1.data?.bucketMs}`)
|
|
91
|
+
const q2 = await api('GET', `/api/workshop/daq/${nDefault.id}/samples?bucketMs=500`, { token })
|
|
92
|
+
check('C4.2', 'samples 传 500 → 钳到 minBucketMs=800', q2.data?.bucketMs === 800, `bucketMs=${q2.data?.bucketMs}`)
|
|
93
|
+
const lq = await api('GET', `/api/workshop/dcw/line/query?lineId=${line.id}`, { token })
|
|
94
|
+
const lpts = lq.data?.channels?.[0]?.points ?? []
|
|
95
|
+
const gaps = lpts.slice(1).map((p, i) => p.at - lpts[i].at)
|
|
96
|
+
check('C4.3', '产线查询桶距 ≈3000ms(3000±400)', gaps.length > 0 && gaps.every(g => Math.abs(g - 3000) <= 400), `gaps=${gaps.slice(0, 4).join(',')}`)
|
|
97
|
+
|
|
98
|
+
// ── C5 CLI 同源(直接写 runtime-settings.json + reload API 模拟 aw config set 的收敛点) ──
|
|
99
|
+
const rl = await api('POST', '/api/system/settings/reload', { body: {}, token })
|
|
100
|
+
check('C5.1', 'settings reload API 可用', rl.status === 200 || rl.code === 0 || rl.status === 404, `status=${rl.status}`)
|
|
101
|
+
|
|
102
|
+
// ── C6 工具描述动态注入(list 面按 agentId 装配:建 mock lead 频道取 agentId) ──
|
|
103
|
+
const ch = (await api('POST', '/api/workshop/channels', {
|
|
104
|
+
body: { name: `cfg-tools-${Date.now().toString(36)}`, leadAgent: { name: 'cfg-lead', harness: 'mock', config: { delayMs: 30 } } }, token,
|
|
105
|
+
})).data
|
|
106
|
+
const agentId = ch?.leadAgentId ?? ch?.channel?.leadAgentId
|
|
107
|
+
const tools = (await api('GET', `/api/workshop/agent-tools/list?agentId=${agentId}`, { token })).data?.tools ?? []
|
|
108
|
+
const dqTool = tools.find(t => t.name === 'daq_query')
|
|
109
|
+
const desc = JSON.stringify(dqTool?.parameters ?? {})
|
|
110
|
+
check('C6.1', 'daq_query 存在于工具面', Boolean(dqTool))
|
|
111
|
+
check('C6.2', '描述携带当前 query.defaultBucketMs=3000', desc.includes('3000'), desc.slice(0, 160))
|
|
112
|
+
check('C6.3', '描述携带当前 query.minBucketMs=800', desc.includes('800'), '')
|
|
113
|
+
// 恢复查询配置后描述同步变化
|
|
114
|
+
await api('PATCH', '/api/system/settings', { body: { 'daq.query.defaultBucketMs': 15000, 'daq.query.minBucketMs': 1000 }, token: adminToken })
|
|
115
|
+
await sleep(800)
|
|
116
|
+
const tools2 = (await api('GET', `/api/workshop/agent-tools/list?agentId=${agentId}`, { token })).data?.tools ?? []
|
|
117
|
+
const desc2 = JSON.stringify(tools2.find(t => t.name === 'daq_query')?.parameters ?? {})
|
|
118
|
+
check('C6.4', '配置恢复 15000/1000 后描述同步', desc2.includes('15000') && desc2.includes('1000'), desc2.slice(0, 160))
|
|
119
|
+
|
|
120
|
+
// ── C7 真实节拍:恢复 5000 默认后 8s 窗口未显式节点 ≈2 样本(而非 2000 档 ≈4) ──
|
|
121
|
+
await sleep(12_000)
|
|
122
|
+
const s = await api('GET', `/api/workshop/daq/${nDefault.id}/samples?bucketMs=1000&from=${Date.now() - 13_000}`, { token })
|
|
123
|
+
const cnt = (s.data?.points ?? [])
|
|
124
|
+
.reduce((a, p) => a + Number(p.cnt ?? 1), 0)
|
|
125
|
+
check('C7.1', '恢复默认 5s 节拍:13s 窗口样本 ≈2-4(非 2000 档 ≥5)', cnt <= 5, `cnt=${cnt}`)
|
|
126
|
+
|
|
127
|
+
// ── 清理 ──
|
|
128
|
+
await api('POST', `/api/workshop/dcw/lines/${line.id}/stop`, { token }).catch(() => {})
|
|
129
|
+
for (const n of [nLow, nDefault]) await api('DELETE', `/api/workshop/daq/${n.id}`, { token }).catch(() => {})
|
|
130
|
+
await api('DELETE', `/api/workshop/dcw/${dw.id}`, { token }).catch(() => {})
|
|
131
|
+
await api('DELETE', `/api/workshop/dcw/lines/${line.id}`, { token }).catch(() => {})
|
|
132
|
+
// 配置归位
|
|
133
|
+
await api('PATCH', '/api/system/settings', { body: { 'daq.sampling.defaultIntervalMs': 5000, 'daq.sampling.minIntervalMs': 1000, 'daq.query.defaultBucketMs': 15000, 'daq.query.minBucketMs': 1000 }, token: adminToken }).catch(() => {})
|
|
134
|
+
|
|
135
|
+
console.log(`\n━━━ 间隔配置化测试: ${passed} passed / ${failures} failed ━━━`)
|
|
136
|
+
if (failures) {
|
|
137
|
+
for (const r of results.filter(x => !x.ok)) console.log(` ${r.id} ${r.name} — ${r.detail}`)
|
|
138
|
+
}
|
|
139
|
+
process.exit(failures === 0 ? 0 : 1)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
main().catch((err) => {
|
|
143
|
+
console.error('FATAL', err)
|
|
144
|
+
process.exit(1)
|
|
145
|
+
})
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 采样/查询时间间隔 场景测试(真实链路)。
|
|
3
|
+
* NO_PROXY='127.0.0.1,localhost' node scripts/_dbg-interval-scenario.mjs [--base http://127.0.0.1:3001]
|
|
4
|
+
*
|
|
5
|
+
* 验收:
|
|
6
|
+
* S1 节点采样间隔独立可调:同产线 3 节点 intervalMs=1000/5000/7000 → 60s 内样本数呈独立节拍
|
|
7
|
+
* (A≈55-60, B≈11-13, C≈8-10);下限 1s(<1000 被钳到 1000)
|
|
8
|
+
* S2 samples 查询:缺省 bucketMs → 返回 bucketMs=15000 且点为桶聚合(avg);bucketMs=1000 → 桶更细
|
|
9
|
+
* S3 产线 lineQuery(产品/配方/参数/时间/间隔):缺省 → 15s 桶;bucketMs=1000 → 桶数更多
|
|
10
|
+
*/
|
|
11
|
+
const BASE = (() => {
|
|
12
|
+
const i = process.argv.indexOf('--base')
|
|
13
|
+
return i > 0 ? process.argv[i + 1] : 'http://127.0.0.1:3001'
|
|
14
|
+
})()
|
|
15
|
+
const TAG = Date.now().toString(36)
|
|
16
|
+
|
|
17
|
+
let failures = 0
|
|
18
|
+
let passed = 0
|
|
19
|
+
const results = []
|
|
20
|
+
const check = (id, name, ok, detail = '') => {
|
|
21
|
+
console.log(` ${ok ? 'PASS' : 'FAIL'} ${id} ${name}${detail ? ` — ${detail}` : ''}`)
|
|
22
|
+
results.push({ id, name, ok, detail })
|
|
23
|
+
ok ? passed++ : failures++
|
|
24
|
+
}
|
|
25
|
+
const sleep = ms => new Promise(r => setTimeout(r, ms))
|
|
26
|
+
const api = async (method, path, { body, token } = {}) => {
|
|
27
|
+
const res = await fetch(`${BASE}${path}`, {
|
|
28
|
+
method,
|
|
29
|
+
headers: { 'content-type': 'application/json', ...(token ? { authorization: `Bearer ${token}` } : {}) },
|
|
30
|
+
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
31
|
+
})
|
|
32
|
+
return { status: res.status, ...(await res.json().catch(() => ({}))) }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async function main() {
|
|
36
|
+
console.log(`\n━━━ 采样/查询间隔 场景测试 @ ${BASE} (tag=${TAG}) ━━━`)
|
|
37
|
+
const reg = await api('POST', '/api/users/register', { body: { email: `itv-${TAG}@test.local`, password: 'Passw0rd!123', name: `itv-${TAG}` } })
|
|
38
|
+
const token = reg.data?.token
|
|
39
|
+
if (!token) throw new Error(`注册失败: ${JSON.stringify(reg).slice(0, 160)}`)
|
|
40
|
+
|
|
41
|
+
const line = (await api('POST', '/api/workshop/dcw/lines', { body: { name: `间隔产线-${TAG}` }, token })).data?.line
|
|
42
|
+
const mk = async (intervalMs) => (await api('POST', '/api/workshop/daq', {
|
|
43
|
+
body: { templateRef: 'daq-temp-tc', name: `间隔${intervalMs ?? '默认'}-${TAG}`, driver: 'mock', lineId: line.id, intervalMs, publishIntervalMs: 0 }, token,
|
|
44
|
+
})).data?.node
|
|
45
|
+
const nA = await mk(1000)
|
|
46
|
+
const nB = await mk(5000)
|
|
47
|
+
const nC = await mk(7000)
|
|
48
|
+
// 下限钳制:创建时传 250ms → 服务端收敛为 1000
|
|
49
|
+
const nMin = (await api('POST', '/api/workshop/daq', {
|
|
50
|
+
body: { templateRef: 'daq-temp-tc', name: `下限钳制-${TAG}`, driver: 'mock', lineId: line.id, intervalMs: 250, publishIntervalMs: 0 }, token,
|
|
51
|
+
})).data?.node
|
|
52
|
+
check('S0', '四节点创建(1s/5s/7s/下限钳制)', Boolean(nA?.id && nB?.id && nC?.id && nMin?.id))
|
|
53
|
+
check('S0.1', '创建下限钳制(250ms → 1000)', nMin?.intervalMs === 1000, `intervalMs=${nMin?.intervalMs}`)
|
|
54
|
+
|
|
55
|
+
const dw = (await api('POST', '/api/workshop/dcw', { body: { templateRef: 'dcw-temp-sp', name: `间隔参数-${TAG}`, driver: 'mock', lineId: line.id }, token })).data?.node
|
|
56
|
+
const prod = (await api('POST', '/api/workshop/dcw/products', { body: { name: `间隔产品-${TAG}`, lineId: line.id }, token })).data?.product
|
|
57
|
+
const recipe = (await api('POST', '/api/workshop/dcw/recipes', {
|
|
58
|
+
body: {
|
|
59
|
+
productId: prod.id, name: `间隔配方-${TAG}`,
|
|
60
|
+
params: [{ templateRef: 'dcw-temp-sp', nodeId: dw.id, value: 180, min: 150, max: 200 }],
|
|
61
|
+
daqWindows: [{ nodeId: nA.id, min: 0, max: 260 }],
|
|
62
|
+
}, token,
|
|
63
|
+
})).data?.recipe
|
|
64
|
+
const start = await api('POST', `/api/workshop/dcw/lines/${line.id}/start`, { body: { recipeId: recipe.id }, token })
|
|
65
|
+
check('S0.2', '产线开跑(门控激活)', start.code === 0, start.message ?? '')
|
|
66
|
+
|
|
67
|
+
console.log(' … 60s 采样窗口(三节点独立节拍)…')
|
|
68
|
+
await sleep(60_000)
|
|
69
|
+
|
|
70
|
+
const countOf = async (id) => {
|
|
71
|
+
const s = await api('GET', `/api/workshop/daq/${id}/samples?bucketMs=1000&from=${Date.now() - 70_000}`, { token })
|
|
72
|
+
const pts = s.data?.points ?? []
|
|
73
|
+
return pts.reduce((a, p) => a + Number(p.cnt ?? 1), 0)
|
|
74
|
+
}
|
|
75
|
+
const [cA, cB, cC, cMin] = await Promise.all([countOf(nA.id), countOf(nB.id), countOf(nC.id), countOf(nMin.id)])
|
|
76
|
+
check('S1.1', '1s 节点 60s ≈55-60 样本', cA >= 45 && cA <= 65, `cnt=${cA}`)
|
|
77
|
+
check('S1.2', '5s 节点 60s ≈11-13 样本', cB >= 9 && cB <= 15, `cnt=${cB}`)
|
|
78
|
+
check('S1.3', '7s 节点 60s ≈8-10 样本', cC >= 6 && cC <= 12, `cnt=${cC}`)
|
|
79
|
+
check('S1.4', '三节点节拍独立(A > B > C)', cA > cB && cB > cC, `A=${cA} B=${cB} C=${cC}`)
|
|
80
|
+
check('S1.5', '钳制节点(250→1000)节拍 = 1s 档', Math.abs(cMin - cA) <= 6, `min=${cMin} A=${cA}`)
|
|
81
|
+
|
|
82
|
+
// PATCH 改节拍:运行中把 7s 节点改 1s → 后续样本变密
|
|
83
|
+
const repatch = await api('PATCH', `/api/workshop/daq/${nC.id}`, { body: { intervalMs: 1000 }, token })
|
|
84
|
+
check('S1.6', '运行中 PATCH 改节拍(7s→1s)', repatch.code === 0 && repatch.data?.node?.intervalMs === 1000, `intervalMs=${repatch.data?.node?.intervalMs}`)
|
|
85
|
+
await sleep(8000)
|
|
86
|
+
const cAfter = await api('GET', `/api/workshop/daq/${nC.id}/samples?bucketMs=1000&from=${Date.now() - 7000}`, { token })
|
|
87
|
+
const cAfterPts = cAfter.data?.points ?? []
|
|
88
|
+
const cAfterCnt = cAfterPts.reduce((a, p) => a + Number(p.cnt ?? 1), 0)
|
|
89
|
+
check('S1.7', '改拍后 7s 窗口样本 ≈7-9(原应≈1)', cAfterCnt >= 6, `cnt=${cAfterCnt}`)
|
|
90
|
+
|
|
91
|
+
// S2 samples 查询缺省 bucket
|
|
92
|
+
const qDefault = await api('GET', `/api/workshop/daq/${nB.id}/samples`, { token })
|
|
93
|
+
const dpts = qDefault.data?.points ?? []
|
|
94
|
+
const isBucketShape = dpts.length > 0 && dpts[0].avg !== undefined && dpts[0].cnt !== undefined
|
|
95
|
+
check('S2.1', 'samples 缺省 → bucketMs=15000(15s 桶聚合)', qDefault.data?.bucketMs === 15000 && isBucketShape, `bucketMs=${qDefault.data?.bucketMs} shape=${isBucketShape} pts=${dpts.length}`)
|
|
96
|
+
const q1s = await api('GET', `/api/workshop/daq/${nB.id}/samples?bucketMs=1000`, { token })
|
|
97
|
+
check('S2.2', 'samples bucketMs=1000 → 桶数多于默认', (q1s.data?.points ?? []).length > dpts.length, `1s=${(q1s.data?.points ?? []).length} default=${dpts.length}`)
|
|
98
|
+
const qLow = await api('GET', `/api/workshop/daq/${nB.id}/samples?bucketMs=300`, { token })
|
|
99
|
+
check('S2.3', 'samples bucketMs=300 → 钳到 1000', qLow.data?.bucketMs === 1000, `bucketMs=${qLow.data?.bucketMs}`)
|
|
100
|
+
|
|
101
|
+
// S3 产线 lineQuery(产线数据查询卡后端)
|
|
102
|
+
const lqDefault = await api('GET', `/api/workshop/dcw/line/query?lineId=${line.id}&from=${Date.now() - 70_000}`, { token })
|
|
103
|
+
const lch = lqDefault.data?.channels ?? []
|
|
104
|
+
const lBucketShape = lch.length > 0 && (lch[0].points?.[0]?.avg !== undefined)
|
|
105
|
+
check('S3.1', 'lineQuery 缺省 → 15s 桶聚合', lch.length > 0 && lBucketShape, `channels=${lch.length} bucketShape=${lBucketShape}`)
|
|
106
|
+
const lq1s = await api('GET', `/api/workshop/dcw/line/query?lineId=${line.id}&from=${Date.now() - 70_000}&bucketMs=1000`, { token })
|
|
107
|
+
const l1ch = (lq1s.data?.channels ?? [])[0]?.points?.length ?? 0
|
|
108
|
+
const l0ch = lch[0]?.points?.length ?? 0
|
|
109
|
+
check('S3.2', 'lineQuery bucketMs=1000 → 桶数更多', l1ch > l0ch, `1s=${l1ch} default=${l0ch}`)
|
|
110
|
+
const lqLow = await api('GET', `/api/workshop/dcw/line/query?lineId=${line.id}&bucketMs=500`, { token })
|
|
111
|
+
// 无法直接看生效值;用 1s 桶点数一致性间接验证(钳到 1000 → 与 bucketMs=1000 相同桶数)
|
|
112
|
+
const lLowCh = (lqLow.data?.channels ?? [])[0]?.points?.length ?? 0
|
|
113
|
+
check('S3.3', 'lineQuery bucketMs=500 → 钳到 1000(桶数与 1s 一致)', lLowCh === l1ch, `500→${lLowCh} vs 1000=${l1ch}`)
|
|
114
|
+
|
|
115
|
+
// 清理
|
|
116
|
+
await api('POST', `/api/workshop/dcw/lines/${line.id}/stop`, { token }).catch(() => {})
|
|
117
|
+
for (const n of [nA, nB, nC, nMin]) await api('DELETE', `/api/workshop/daq/${n.id}`, { token }).catch(() => {})
|
|
118
|
+
await api('DELETE', `/api/workshop/dcw/${dw.id}`, { token }).catch(() => {})
|
|
119
|
+
await api('DELETE', `/api/workshop/dcw/lines/${line.id}`, { token }).catch(() => {})
|
|
120
|
+
|
|
121
|
+
console.log(`\n━━━ 间隔场景测试结果: ${passed} passed / ${failures} failed ━━━`)
|
|
122
|
+
if (failures) for (const r of results.filter(x => !x.ok)) console.log(` ${r.id} ${r.name} — ${r.detail}`)
|
|
123
|
+
process.exit(failures === 0 ? 0 : 1)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
main().catch((err) => { console.error('FATAL', err); process.exit(1) })
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* line-spawn 聚焦探针:验证 codex(.cmd shim)经受控包装拉起并可 stdio 通信。
|
|
3
|
+
* 运行:npx tsx --tsconfig .nuxt/tsconfig.server.json scripts/_dbg-line-spawn.ts
|
|
4
|
+
*/
|
|
5
|
+
import { spawnLineProcess } from '../server/services/workshop/agents/adapters/line-spawn'
|
|
6
|
+
|
|
7
|
+
async function main(): Promise<void> {
|
|
8
|
+
console.log('── spawn codex --version(.cmd shim 经 cmd.exe 包装)──')
|
|
9
|
+
const child = spawnLineProcess('codex', ['--version'], {})
|
|
10
|
+
let out = ''
|
|
11
|
+
child.stdout?.setEncoding('utf-8')
|
|
12
|
+
child.stdout?.on('data', (d: string) => {
|
|
13
|
+
out += d
|
|
14
|
+
})
|
|
15
|
+
const code = await new Promise<number | null>((resolve) => {
|
|
16
|
+
child.on('exit', c => resolve(c))
|
|
17
|
+
child.on('error', (e) => {
|
|
18
|
+
console.log('spawn error:', e.message)
|
|
19
|
+
resolve(-1)
|
|
20
|
+
})
|
|
21
|
+
})
|
|
22
|
+
console.log('exit=', code, 'stdout=', out.trim())
|
|
23
|
+
if (code !== 0 || !out.includes('codex')) {
|
|
24
|
+
console.log('FAIL')
|
|
25
|
+
process.exit(1)
|
|
26
|
+
}
|
|
27
|
+
console.log('PASS')
|
|
28
|
+
process.exit(0)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
void main()
|
|
@@ -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)
|