agentworkshop 0.7.24 → 0.7.33
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/aml-mission-default.md +20 -0
- package/.AgentWorkShop/prompts/aml-playbook.md +49 -0
- package/.AgentWorkShop/prompts/host-tools.json +314 -0
- package/.output/.AgentWorkShop/prompts/aml-mission-default.md +20 -0
- package/.output/.AgentWorkShop/prompts/aml-playbook.md +49 -0
- package/.output/.AgentWorkShop/prompts/host-tools.json +314 -0
- package/.output/.AgentWorkShop/schema.json +120 -0
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{Djir5rSD.js → 4bHdIqEg.js} +8 -8
- package/.output/public/_nuxt/B7gZokg82.js +209 -0
- package/.output/public/_nuxt/B9nXmjSB.js +19 -0
- package/.output/public/_nuxt/BASN8nZ0.js +1 -0
- package/.output/public/_nuxt/{DNQF_TXX.js → BBBtwOpo.js} +1 -1
- package/.output/public/_nuxt/{DoAlYsiF.js → BBwMH_hG.js} +1 -1
- package/.output/public/_nuxt/BWSE6hR6.js +1 -0
- package/.output/public/_nuxt/BZv4RFYN.js +1 -0
- package/.output/public/_nuxt/Bc0AmjfT.js +1 -0
- package/.output/public/_nuxt/BcmbLh2z2.js +1 -0
- package/.output/public/_nuxt/BgTB6h_q.js +2 -0
- package/.output/public/_nuxt/BkLJA9J5.js +1 -0
- package/.output/public/_nuxt/{CuVGPuP1.js → BuCHayqN.js} +1 -1
- package/.output/public/_nuxt/{0jKrzLuM.js → BuvcLKh1.js} +1 -1
- package/.output/public/_nuxt/C-mDhyEd.js +1 -0
- package/.output/public/_nuxt/{Ct68Z0232.js → C77oC8yC2.js} +2 -2
- package/.output/public/_nuxt/CQvmN-Mi.js +1 -0
- package/.output/public/_nuxt/CUDrOuW7.js +1 -0
- package/.output/public/_nuxt/{Coik560n.js → CZcC-gpk.js} +1 -1
- package/.output/public/_nuxt/{Cz9gD2Yo.js → CbzsPO5H.js} +1 -1
- package/.output/public/_nuxt/CdSOrh2c.js +1 -0
- package/.output/public/_nuxt/Cgx818r-.js +1 -0
- package/.output/public/_nuxt/Cjm7VogC.js +1 -0
- package/.output/public/_nuxt/Cm5mDxzH.js +1 -0
- package/.output/public/_nuxt/Cp6z0RN7.js +1 -0
- package/.output/public/_nuxt/Ct-WOVr4.js +1 -0
- package/.output/public/_nuxt/CwqIxJGj.js +2 -0
- package/.output/public/_nuxt/{BMb80_tm.js → D0fhp-Ga.js} +2 -2
- package/.output/public/_nuxt/DIaTPH1M.js +1 -0
- package/.output/public/_nuxt/DLljr7g0.js +1 -0
- package/.output/public/_nuxt/DTYBfjRY.js +1 -0
- package/.output/public/_nuxt/DYKVPzN-.js +1 -0
- package/.output/public/_nuxt/DZzGarBE2.js +13 -0
- package/.output/public/_nuxt/DaMCzQhv.js +1 -0
- package/.output/public/_nuxt/DoMxCWN52.js +4 -0
- package/.output/public/_nuxt/{kZV5TQvh2.js → DoTdlVVe2.js} +1 -1
- package/.output/public/_nuxt/DsVcWfyR.js +1 -0
- package/.output/public/_nuxt/{BCJFMBQ6.js → DzuC31-i.js} +2 -2
- package/.output/public/_nuxt/FQri3dV3.js +1 -0
- package/.output/public/_nuxt/Lp7Ll94I.js +1 -0
- package/.output/public/_nuxt/PluginSlot.DmjNbrcX.css +1 -0
- package/.output/public/_nuxt/{TownView.zu2rU5nS.css → TownView.CtskuMXS.css} +1 -1
- package/.output/public/_nuxt/_id_.hRYo-EAB.css +1 -0
- package/.output/public/_nuxt/_wsId_.gXMEOYgX.css +1 -0
- package/.output/public/_nuxt/agents.BV70ioCv.css +1 -0
- package/.output/public/_nuxt/aml.WU_bh87J.css +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/291ef3e6-fa6a-4dee-8f46-05da1aeab815.json +1 -0
- package/.output/public/_nuxt/daq.Bb6l44-O.css +1 -0
- package/.output/public/_nuxt/default.jNT73_hq.css +1 -0
- package/.output/public/_nuxt/ekuGmQ7R.js +1 -0
- package/.output/public/_nuxt/entry.jFrFAWuA.css +1 -0
- package/.output/public/_nuxt/pMoIO6rr.js +14 -0
- package/.output/public/_nuxt/pages.Cc8GX9T1.css +1 -0
- package/.output/public/_nuxt/plugins.wIPyfPn-.css +1 -0
- package/.output/public/_nuxt/settings.BCm4NZIc.css +1 -0
- package/.output/public/_nuxt/teams.BC75EGnR.css +1 -0
- package/.output/public/assets/game/character/yangyang-walk.glb +0 -0
- package/.output/server/chunks/_/binding-authz.mjs +23 -0
- package/.output/server/chunks/_/binding-authz.mjs.map +1 -0
- package/.output/server/chunks/_/character-asset.repo.mjs +1 -1
- package/.output/server/chunks/_/host-bindings.mjs +1 -1
- package/.output/server/chunks/_/nitro.mjs +14422 -7551
- package/.output/server/chunks/_/nitro.mjs.map +1 -1
- package/.output/server/chunks/_/scene-layout.repo.mjs +3 -3
- package/.output/server/chunks/_/scene-layout.repo.mjs.map +1 -1
- package/.output/server/chunks/build/Checkbox-eax2M3o-.mjs +207 -0
- package/.output/server/chunks/build/Checkbox-eax2M3o-.mjs.map +1 -0
- package/.output/server/chunks/build/{OmpTerminalPanel-Cw_Vw9oO.mjs → OmpTerminalPanel-Cu_s4i0A.mjs} +2 -2
- package/.output/server/chunks/build/{OmpTerminalPanel-Cw_Vw9oO.mjs.map → OmpTerminalPanel-Cu_s4i0A.mjs.map} +1 -1
- package/.output/server/chunks/build/{alert-qJnjyRcP.mjs → PluginSlot-CcR4Ys3T.mjs} +140 -4
- package/.output/server/chunks/build/PluginSlot-CcR4Ys3T.mjs.map +1 -0
- package/.output/server/chunks/build/{TownView-DxeQe1Bl.mjs → TownView-BdHnAilw.mjs} +178 -151
- package/.output/server/chunks/build/{TownView-DxeQe1Bl.mjs.map → TownView-BdHnAilw.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-DY6v6sqB.mjs → _id_-Cb845FHR.mjs} +7 -5
- package/.output/server/chunks/build/_id_-Cb845FHR.mjs.map +1 -0
- package/.output/server/chunks/build/{_id_-DQDqj-cZ.mjs → _id_-fadFPl2i.mjs} +50 -35
- package/.output/server/chunks/build/_id_-fadFPl2i.mjs.map +1 -0
- package/.output/server/chunks/build/{_wsId_-D38Vx6Ky.mjs → _wsId_-CTZswnm5.mjs} +181 -22
- package/.output/server/chunks/build/{_wsId_-D38Vx6Ky.mjs.map → _wsId_-CTZswnm5.mjs.map} +1 -1
- package/.output/server/chunks/build/{agents-GnmUGZir.mjs → agents-Bvin73QY.mjs} +82 -32
- package/.output/server/chunks/build/agents-Bvin73QY.mjs.map +1 -0
- package/.output/server/chunks/build/aml-uBNIppIf.mjs +508 -0
- package/.output/server/chunks/build/aml-uBNIppIf.mjs.map +1 -0
- package/.output/server/chunks/build/apiClient-BwnfOQU8.mjs +81 -0
- package/.output/server/chunks/build/apiClient-BwnfOQU8.mjs.map +1 -0
- package/.output/server/chunks/build/{channel-templates-B4z6v8Z5.mjs → channel-templates-BTq8570n.mjs} +6 -5
- package/.output/server/chunks/build/channel-templates-BTq8570n.mjs.map +1 -0
- package/.output/server/chunks/build/{checkbox-dzcpU_Cd.mjs → checkbox-8fB-wI-T.mjs} +5 -5
- package/.output/server/chunks/build/{checkbox-dzcpU_Cd.mjs.map → checkbox-8fB-wI-T.mjs.map} +1 -1
- package/.output/server/chunks/build/{daq-B-3xCp_2.mjs → daq-BvihjQyW.mjs} +314 -426
- package/.output/server/chunks/build/daq-BvihjQyW.mjs.map +1 -0
- package/.output/server/chunks/build/{dcw-BL2dhuz7.mjs → dcw-Ks2vJ4PF.mjs} +5 -3
- package/.output/server/chunks/build/dcw-Ks2vJ4PF.mjs.map +1 -0
- package/.output/server/chunks/build/{default-CLf5m0NE.mjs → default-GgHt4O2R.mjs} +164 -101
- package/.output/server/chunks/build/{default-CLf5m0NE.mjs.map → default-GgHt4O2R.mjs.map} +1 -1
- package/.output/server/chunks/build/{input-number-Bd55elNN.mjs → input-number-DzpyYB99.mjs} +2 -2
- package/.output/server/chunks/build/{input-number-Bd55elNN.mjs.map → input-number-DzpyYB99.mjs.map} +1 -1
- package/.output/server/chunks/build/{logs-Dto_umFY.mjs → logs-CYBhkQwh.mjs} +5 -3
- package/.output/server/chunks/build/logs-CYBhkQwh.mjs.map +1 -0
- package/.output/server/chunks/build/{monitor-Cp4V-H2n.mjs → monitor-CyfDt4nR.mjs} +7 -6
- package/.output/server/chunks/build/{monitor-Cp4V-H2n.mjs.map → monitor-CyfDt4nR.mjs.map} +1 -1
- package/.output/server/chunks/build/{pages-Dc2H1QFu.mjs → pages-C-6BRtv8.mjs} +57 -47
- package/.output/server/chunks/build/pages-C-6BRtv8.mjs.map +1 -0
- package/.output/server/chunks/build/{permissions-BTRW2CVd.mjs → permissions-B52oOmaO.mjs} +6 -5
- package/.output/server/chunks/build/permissions-B52oOmaO.mjs.map +1 -0
- package/.output/server/chunks/build/{plugins-DZR0T4Mh.mjs → plugins-dZRegC7m.mjs} +22 -18
- package/.output/server/chunks/build/plugins-dZRegC7m.mjs.map +1 -0
- package/.output/server/chunks/build/{segmented-LPPREMtZ.mjs → segmented-3TrWo0lS.mjs} +3 -3
- package/.output/server/chunks/build/{segmented-LPPREMtZ.mjs.map → segmented-3TrWo0lS.mjs.map} +1 -1
- package/.output/server/chunks/build/settings-CgDLkP3s.mjs +1171 -0
- package/.output/server/chunks/build/settings-CgDLkP3s.mjs.map +1 -0
- package/.output/server/chunks/build/{table-Cswq-l2r.mjs → table-BjSWwmic.mjs} +4 -4
- package/.output/server/chunks/build/{table-Cswq-l2r.mjs.map → table-BjSWwmic.mjs.map} +1 -1
- package/.output/server/chunks/build/{tag-NO9jEqKy.mjs → tag-DNE9vXc0.mjs} +3 -131
- package/.output/server/chunks/build/tag-DNE9vXc0.mjs.map +1 -0
- package/.output/server/chunks/build/{teams-Cbg27MWW.mjs → teams-2kz3CusY.mjs} +350 -49
- package/.output/server/chunks/build/teams-2kz3CusY.mjs.map +1 -0
- package/.output/server/chunks/build/{tokens-Bmm6rDfj.mjs → tokens-BbWLqtVz.mjs} +6 -5
- package/.output/server/chunks/build/tokens-BbWLqtVz.mjs.map +1 -0
- package/.output/server/chunks/build/town-BUqRobze.mjs +1 -0
- package/.output/server/chunks/build/town-BUqRobze.mjs.map +1 -1
- package/.output/server/chunks/build/{town-Dsh0jlwZ.mjs → town-DJ-V5G9U.mjs} +7 -5
- package/.output/server/chunks/build/town-DJ-V5G9U.mjs.map +1 -0
- package/.output/server/chunks/build/{useDaqStream-DkRL3tEW.mjs → useDaqStream-CIBaiGAl.mjs} +27 -11
- package/.output/server/chunks/build/useDaqStream-CIBaiGAl.mjs.map +1 -0
- package/.output/server/chunks/build/{useDcwStream-DyB2ufQI.mjs → useDcwStream-CBbiYnWe.mjs} +16 -84
- package/.output/server/chunks/build/useDcwStream-CBbiYnWe.mjs.map +1 -0
- package/.output/server/chunks/build/{useDeviceTwins-ZbT86L9O.mjs → useDeviceTwins-Yko6nNPF.mjs} +2 -2
- package/.output/server/chunks/build/{useDeviceTwins-ZbT86L9O.mjs.map → useDeviceTwins-Yko6nNPF.mjs.map} +1 -1
- package/.output/server/chunks/build/{useOpsLog-8HCYFb6n.mjs → useOpsLog-CO_VWh7t.mjs} +2 -2
- package/.output/server/chunks/build/{useOpsLog-8HCYFb6n.mjs.map → useOpsLog-CO_VWh7t.mjs.map} +1 -1
- package/.output/server/chunks/build/{useWorkshopApi-D2gq06N2.mjs → useWorkshopApi-NyjL0L3j.mjs} +11 -2
- package/.output/server/chunks/build/{useWorkshopApi-D2gq06N2.mjs.map → useWorkshopApi-NyjL0L3j.mjs.map} +1 -1
- package/.output/server/chunks/build/{users-B50HHrfi.mjs → users-4nzxTjFT.mjs} +6 -5
- package/.output/server/chunks/build/users-4nzxTjFT.mjs.map +1 -0
- package/.output/server/chunks/build/workshop-81xhz368.mjs +1 -0
- package/.output/server/chunks/build/workshop-81xhz368.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +1 -0
- package/.output/server/chunks/routes/api/health.get.mjs.map +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/metrics.mjs +1 -0
- package/.output/server/chunks/routes/api/metrics.mjs.map +1 -1
- package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs +15 -2
- package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs.map +1 -1
- package/.output/server/chunks/routes/api/plugins/client/_name_.get.mjs +1 -0
- package/.output/server/chunks/routes/api/plugins/client/_name_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/plugins/i18n.get.mjs +26 -0
- package/.output/server/chunks/routes/api/plugins/i18n.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/plugins/manifest.get.mjs +2 -1
- package/.output/server/chunks/routes/api/plugins/manifest.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/config-groups/_id_.delete.mjs +32 -0
- package/.output/server/chunks/routes/api/system/config-groups/_id_.delete.mjs.map +1 -0
- package/.output/server/chunks/routes/api/system/config-groups/_id_.patch.mjs +36 -0
- package/.output/server/chunks/routes/api/system/config-groups/_id_.patch.mjs.map +1 -0
- package/.output/server/chunks/routes/api/system/config.get.mjs +1 -0
- package/.output/server/chunks/routes/api/system/config.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/index.get.mjs +7 -2
- package/.output/server/chunks/routes/api/system/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/index.patch.mjs +2 -1
- package/.output/server/chunks/routes/api/system/index.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/index.post.mjs +36 -0
- package/.output/server/chunks/routes/api/system/index.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/system/index2.get.mjs +28 -0
- package/.output/server/chunks/routes/api/system/index2.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/system/monitor/terminal/ws.mjs +2 -1
- package/.output/server/chunks/routes/api/system/monitor/terminal/ws.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/monitor/terminate.post.mjs +2 -1
- package/.output/server/chunks/routes/api/system/monitor/terminate.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/monitor.get.mjs +1 -0
- package/.output/server/chunks/routes/api/system/monitor.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/settings/events.get.mjs +8 -5
- package/.output/server/chunks/routes/api/system/settings/events.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/settings/reset.post.mjs +2 -1
- package/.output/server/chunks/routes/api/system/settings/reset.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/_id_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/users/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/_id_.get.mjs +2 -1
- package/.output/server/chunks/routes/api/users/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/_id_.put.mjs +1 -1
- package/.output/server/chunks/routes/api/users/index.get.mjs +2 -1
- package/.output/server/chunks/routes/api/users/index.get.mjs.map +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 +2 -1
- package/.output/server/chunks/routes/api/users/logout.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/me.get.mjs +2 -1
- package/.output/server/chunks/routes/api/users/me.get.mjs.map +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 +2 -1
- package/.output/server/chunks/routes/api/users/setup-status.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/tokens/_id/token.get.mjs +2 -1
- package/.output/server/chunks/routes/api/users/tokens/_id/token.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/tokens/_id_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/users/tokens/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/users/tokens/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/_...path_.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/_...path_.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.post.mjs +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 +2 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/approvals/_id/decide.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.delete.mjs +5 -2
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.patch.mjs +9 -3
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index2.get.mjs +23 -3
- package/.output/server/chunks/routes/api/workshop/agent-tools/index2.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs +21 -3
- 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 +2 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/subscribe.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/datasets/_id/preview.get.mjs +75 -0
- package/.output/server/chunks/routes/api/workshop/aml/datasets/_id/preview.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.get.mjs +35 -0
- package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/aml/index.get.mjs +35 -0
- package/.output/server/chunks/routes/api/workshop/aml/index.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/aml/index.post.mjs +46 -0
- package/.output/server/chunks/routes/api/workshop/aml/index.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/aml/index2.get.mjs +47 -0
- package/.output/server/chunks/routes/api/workshop/aml/index2.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/aml/index2.post.mjs +48 -0
- package/.output/server/chunks/routes/api/workshop/aml/index2.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/aml/index3.get.mjs +41 -0
- package/.output/server/chunks/routes/api/workshop/aml/index3.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/aml/index4.get.mjs +62 -0
- package/.output/server/chunks/routes/api/workshop/aml/index4.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/cancel.post.mjs +35 -0
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/cancel.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/logs.get.mjs +36 -0
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/logs.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/retry.post.mjs +34 -0
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/retry.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id_.get.mjs +38 -0
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id_.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/aml/models/_id/predict.post.mjs +37 -0
- package/.output/server/chunks/routes/api/workshop/aml/models/_id/predict.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/aml/models/_id/promote.post.mjs +42 -0
- package/.output/server/chunks/routes/api/workshop/aml/models/_id/promote.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/approvals/_id/decide.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/approvals/_id/decide.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/character/_id_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/assets/character/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/assets/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index2.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/assets/index2.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/audit.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/audit.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/caller.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/caller.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs +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 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/activate.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/_memoryId_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/_memoryId_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/search.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/model.patch.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/model.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/position.patch.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/position.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/range.patch.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/range.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/stop.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/stop.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/events.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.put.mjs +41 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.put.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index2.post.mjs +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 +22 -9
- package/.output/server/chunks/routes/api/workshop/channels/_id/index4.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index4.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index5.get.mjs +34 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/index5.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/queue.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/queue.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/channels.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels.post.mjs +16 -2
- package/.output/server/chunks/routes/api/workshop/channels.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/bindings.put.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/bindings.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs +2 -1
- 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 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/test.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs +3 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/index.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/daq/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bindings.put.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bindings.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs +7 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.patch.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/revert.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/revert.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/versions.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/versions.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/index.patch.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/index.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs +32 -1
- package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs +3 -2
- 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 -0
- package/.output/server/chunks/routes/api/workshop/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index.put.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/index.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index10.get.mjs +12 -6
- package/.output/server/chunks/routes/api/workshop/index10.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index11.get.mjs +4 -2
- package/.output/server/chunks/routes/api/workshop/index11.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index12.get.mjs +28 -0
- package/.output/server/chunks/routes/api/workshop/index12.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/index2.get.mjs +17 -11
- package/.output/server/chunks/routes/api/workshop/index2.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index3.get.mjs +11 -4
- package/.output/server/chunks/routes/api/workshop/index3.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index3.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/index3.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index4.get.mjs +5 -27
- package/.output/server/chunks/routes/api/workshop/index4.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index4.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/index4.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index5.get.mjs +24 -18
- package/.output/server/chunks/routes/api/workshop/index5.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index5.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/index5.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index6.get.mjs +23 -5
- package/.output/server/chunks/routes/api/workshop/index6.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index6.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/index6.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index7.get.mjs +4 -17
- package/.output/server/chunks/routes/api/workshop/index7.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index7.post.mjs +8 -3
- package/.output/server/chunks/routes/api/workshop/index7.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index8.get.mjs +20 -21
- package/.output/server/chunks/routes/api/workshop/index8.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index8.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index9.get.mjs +24 -11
- package/.output/server/chunks/routes/api/workshop/index9.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/mailbox/all.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/mailbox/all.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/mailbox.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/mailbox.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/memories/maintenance.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/memories/maintenance.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/plugins/index.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/plugins/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/runtime.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/runtime.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/scene/layouts.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/complete.post.mjs +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 +2 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/report.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks.get.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/tasks.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/deploy.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.put.mjs +44 -0
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.put.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/teams/_id/index2.get.mjs +47 -0
- package/.output/server/chunks/routes/api/workshop/teams/_id/index2.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/teams/_id/members/_agentId_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/members/_agentId_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs +2 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/users/me.get.mjs +2 -0
- package/.output/server/chunks/routes/api/workshop/users/me.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/users/register.post.mjs +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 -0
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.post.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/index.delete.mjs +1 -0
- package/.output/server/chunks/routes/api/workshop/workspaces/index.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/renderer.mjs +2 -2
- package/.output/server/chunks/virtual/entry.mjs +933 -449
- 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 -0
- package/.output/server/node_modules/@anthropic-ai/claude-agent-sdk/package.json +84 -0
- package/.output/server/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +225 -0
- package/.output/server/package.json +2 -1
- package/README-zh.md +507 -478
- package/README.md +517 -486
- package/app/app.vue +17 -2
- package/app/assets/css/main.css +421 -30
- package/app/components/AppHeader.vue +17 -0
- package/app/components/AppSidebar.vue +162 -63
- package/app/components/AwChart.vue +57 -54
- package/app/components/workshop/ChannelSessionList.vue +802 -703
- package/app/components/workshop/DaqNodeRow.vue +554 -0
- package/app/components/workshop/PluginSlot.vue +120 -0
- package/app/components/workshop/town/ModelPreview3D.vue +26 -4
- package/app/components/workshop/town/TownScene3D.ts +60 -12
- package/app/components/workshop/town/TownView.vue +4 -3
- package/app/composables/workshop/useAmlStream.ts +136 -0
- package/app/composables/workshop/useCharacterAssets.ts +1 -0
- package/app/composables/workshop/useDaqStream.ts +32 -6
- package/app/composables/workshop/useDcwStream.ts +13 -4
- package/app/composables/workshop/usePluginPanels.ts +72 -0
- package/app/composables/workshop/useWorkshopApi.ts +301 -259
- package/app/pages/aml/index.vue +1949 -0
- package/app/pages/daq/[id].vue +86 -4
- package/app/pages/daq/index.vue +15 -503
- package/app/pages/index.vue +235 -213
- package/app/pages/plugins/index.vue +280 -274
- package/app/pages/settings.vue +807 -79
- package/app/pages/workshop/agents.vue +23 -1
- package/app/pages/workshop/teams.vue +212 -2
- package/app/plugins/aw-plugins.client.ts +95 -6
- package/app/plugins/runtime-config.client.ts +4 -14
- package/app/plugins/theme.client.ts +13 -3
- package/app/stores/app.ts +9 -2
- package/app/stores/runtime-config.ts +113 -7
- package/cli/aw.mjs +16 -3
- package/cli/commands/build.mjs +8 -8
- package/cli/commands/dev.mjs +5 -13
- package/cli/commands/init.mjs +1 -1
- package/cli/commands/start.mjs +10 -17
- package/cli/core/args.mjs +85 -4
- package/cli/core/child-lifecycle.mjs +136 -0
- package/config.yml +24 -0
- package/docs/plugins.md +128 -220
- package/docs/sdk.md +1 -1
- package/i18n/dicts/_en.json +403 -2
- package/i18n/dicts/aml.json +163 -0
- package/i18n/dicts/channelSessionList.json +4 -1
- package/i18n/dicts/daqDetail.json +1 -0
- package/i18n/dicts/plugins.json +10 -0
- package/i18n/dicts/settings.json +34 -1
- package/i18n/dicts/teamPlugins.json +10 -0
- package/i18n/dicts/teams.json +9 -1
- package/i18n/locales/en.ts +2059 -1867
- package/i18n/locales/zh-CN.ts +2059 -1868
- package/nuxt.config.ts +18 -3
- package/package.json +7 -2
- package/public/assets/game/character/yangyang-walk.glb +0 -0
- package/scripts/_audit/.tmp/audit-data/dcws.json +28 -0
- package/scripts/_audit/.tmp/dcw-writes.json +15650 -0
- package/scripts/_audit/.tmp/dcws.json +9033 -0
- package/scripts/_audit/.tmp/pollution-backup/dcw-rollback.polluted.json +470006 -0
- package/scripts/_audit/.tmp/pollution-backup/dcws.polluted.json +9085 -0
- package/scripts/_audit/.tmp/probe-cwd.txt +1 -0
- package/scripts/_audit/audit-harness-adapters.md +664 -0
- package/scripts/_audit/awhome/commands/README.md +3 -0
- package/scripts/_audit/awhome/commands/hello.mjs +12 -0
- package/scripts/_audit/dcw-controller-e2e.ts +99 -0
- package/scripts/_audit/dcw-flush-cost.ts +43 -0
- package/scripts/_audit/dcw-rollback-ledger.ts +153 -0
- package/scripts/_audit/dcw-unrecorded-write.ts +171 -0
- package/scripts/_audit/dcw-write-mutex.ts +157 -0
- package/scripts/_audit/diag-cwd.ts +20 -0
- package/scripts/_audit/diag-cwd2.ts +19 -0
- package/scripts/_audit/exp-cost-scaling.mjs +54 -0
- package/scripts/_audit/exp-envelope-and-png.mjs +77 -0
- package/scripts/_audit/exp-png-decode.mjs +67 -0
- package/scripts/_audit/exp-retention-plan.mjs +61 -0
- package/scripts/_audit/exp-retention-rescan.mjs +42 -0
- package/scripts/_audit/exp-sweep-fairness.mjs +48 -0
- package/scripts/_audit/hello.mjs +12 -0
- package/scripts/_audit/http-api-authz-audit.md +657 -0
- package/scripts/_audit/ndjson-partial-line-repro.mjs +77 -0
- package/scripts/_audit/opencode-await-ternary-repro.mjs +20 -0
- package/scripts/_audit/part-frag.txt +84 -0
- package/scripts/_audit/part-head.txt +45 -0
- package/scripts/_audit/probe-binding.mjs +103 -0
- package/scripts/_audit/probe-child.mjs +17 -0
- package/scripts/_audit/probe-envelope.mjs +49 -0
- package/scripts/_audit/probe-packlist.mjs +67 -0
- package/scripts/_audit/probe-routes.mjs +47 -0
- package/scripts/_audit/probe-routes2.mjs +38 -0
- package/scripts/_audit/probe.ts +9 -0
- package/scripts/_audit/probe2.ts +6 -0
- package/scripts/_audit/probe3.ts +3 -0
- package/scripts/_audit/probe4.ts +3 -0
- package/scripts/_audit/proj/.AgentWorkShop/commands/echoargs.mjs +13 -0
- package/scripts/_audit/proj/config.yml +1 -0
- package/scripts/_audit/run.mjs +30 -0
- package/scripts/_audit/runtime-audit.md +716 -0
- package/scripts/_audit/ts-resolve-hook.mjs +41 -0
- package/scripts/_audit/tsconfig.probe.json +24 -0
- package/scripts/_audit/typecheck-out.txt +466 -0
- package/scripts/_audit/verify-data-integrity.mjs +112 -0
- package/scripts/_dbg-agents-dropdown-shot.py +33 -0
- package/scripts/_dbg-anim-verify.mjs +1 -1
- package/scripts/_dbg-audit-all-pages.mjs +1 -1
- package/scripts/_dbg-availability-probe.ts +11 -0
- package/scripts/_dbg-bind-bidi-e2e.mjs +1 -1
- package/scripts/_dbg-cf-line-shot.mjs +18 -0
- package/scripts/_dbg-channel-plugin-ui.mjs +94 -0
- package/scripts/_dbg-configroot-audit.mjs +84 -0
- package/scripts/_dbg-cpu-profile.mjs +53 -0
- package/scripts/_dbg-crash-recovery.mjs +1 -1
- package/scripts/_dbg-crush-probe.sh +21 -0
- package/scripts/_dbg-crush-spawn-probe.ts +22 -0
- package/scripts/_dbg-daq-acc-probe.mjs +1 -1
- package/scripts/_dbg-daq-attrib.mjs +1 -1
- package/scripts/_dbg-daq-debug.mjs +1 -1
- package/scripts/_dbg-daq-diag.mjs +1 -1
- package/scripts/_dbg-daq-e2e.mjs +1 -1
- package/scripts/_dbg-daq-filter-e2e.mjs +1 -1
- package/scripts/_dbg-daq-filter-e2e2.mjs +1 -1
- package/scripts/_dbg-daq-final-regression.mjs +1 -1
- package/scripts/_dbg-daq-frame-alarm.mjs +1 -1
- package/scripts/_dbg-daq-frame-ui.mjs +1 -1
- package/scripts/_dbg-daq-frame-ws.mjs +1 -1
- package/scripts/_dbg-daq-frames-e2e.mjs +1 -1
- package/scripts/_dbg-daq-full-check.mjs +1 -1
- package/scripts/_dbg-daq-intervals-func.mjs +94 -0
- package/scripts/_dbg-daq-pages-shot.mjs +1 -1
- package/scripts/_dbg-daq-perf.mjs +1 -1
- package/scripts/_dbg-daq-probe.mjs +1 -1
- package/scripts/_dbg-daq-recipe-e2e.mjs +1 -1
- package/scripts/_dbg-daq-rows-probe.mjs +1 -1
- package/scripts/_dbg-daq-rowstate-e2e.mjs +1 -1
- package/scripts/_dbg-daq-rowstate-shot.mjs +1 -1
- package/scripts/_dbg-daq-rowstate-shot2.mjs +1 -1
- package/scripts/_dbg-daq-rowstyle-verify.mjs +112 -0
- package/scripts/_dbg-dash-console-check.mjs +1 -1
- package/scripts/_dbg-dash-deep-probe.mjs +1 -1
- package/scripts/_dbg-dash-hitpoint.mjs +1 -1
- package/scripts/_dbg-dcw-read-rest.mjs +1 -1
- package/scripts/_dbg-dcw-read-ui.mjs +1 -1
- package/scripts/_dbg-dcw-shot2.mjs +1 -1
- package/scripts/_dbg-diag-mock-loop.mjs +89 -0
- package/scripts/_dbg-diag-watch.mjs +95 -0
- package/scripts/_dbg-error-probe.mjs +2 -2
- package/scripts/_dbg-filter-light-verify.mjs +1 -1
- package/scripts/_dbg-final-acceptance-2.mjs +1 -1
- package/scripts/_dbg-final-acceptance.mjs +1 -1
- package/scripts/_dbg-final-full-e2e.mjs +1 -1
- package/scripts/_dbg-final-shots.mjs +32 -0
- package/scripts/_dbg-final-t6-hitl.mjs +1 -1
- package/scripts/_dbg-fix-unused-imports.py +41 -0
- package/scripts/_dbg-fresh-scene-e2e.mjs +1 -1
- package/scripts/_dbg-goose-probe.mjs +33 -0
- package/scripts/_dbg-goose-probe.sh +10 -0
- package/scripts/_dbg-groups-ui-verify.mjs +122 -0
- package/scripts/_dbg-harness-ui-shot.py +109 -0
- package/scripts/_dbg-hidden-check.mjs +1 -1
- package/scripts/_dbg-home-repro.mjs +1 -1
- package/scripts/_dbg-home-stack.mjs +1 -1
- package/scripts/_dbg-hydration-detail.mjs +1 -1
- package/scripts/_dbg-infra-lifecycle.mjs +1 -1
- package/scripts/_dbg-line-live-e2e.mjs +1 -1
- package/scripts/_dbg-line-repo-test.ts +10 -0
- package/scripts/_dbg-login-debug.py +23 -0
- package/scripts/_dbg-modbus-latency.mjs +22 -0
- package/scripts/_dbg-mqtt-chain-e2e.mjs +1 -1
- package/scripts/_dbg-oneshot-impl-probe.ts +67 -0
- package/scripts/_dbg-opt-team-e2e.mjs +1 -1
- package/scripts/_dbg-panesplitter-fix-check.mjs +1 -1
- package/scripts/_dbg-phase-e3-monitor.mjs +1 -1
- package/scripts/_dbg-pi-spawn-probe.ts +33 -0
- package/scripts/_dbg-plc-e2e.mjs +1 -1
- package/scripts/_dbg-plugin-config-ui.mjs +111 -0
- package/scripts/_dbg-plugin-panels-ui.mjs +54 -0
- package/scripts/_dbg-plugin-sink-rest.mjs +1 -1
- package/scripts/_dbg-plugin-sink-ui.mjs +1 -1
- package/scripts/_dbg-plugin-ui-wizard.mjs +1 -1
- package/scripts/_dbg-plugin-verify-e2e.mjs +1 -1
- package/scripts/_dbg-pop-clamp-verify.mjs +1 -1
- package/scripts/_dbg-preview-console.mjs +1 -1
- package/scripts/_dbg-preview-minrepro.mjs +1 -1
- package/scripts/_dbg-preview-pixels.mjs +1 -1
- package/scripts/_dbg-quality-pages-e2e.mjs +1 -1
- package/scripts/_dbg-qwen-acp-probe.mjs +30 -0
- package/scripts/_dbg-qwen-capture.mjs +21 -0
- package/scripts/_dbg-rail-tree-e2e.mjs +1 -1
- package/scripts/_dbg-real-driver-e2e.mjs +1 -1
- package/scripts/_dbg-real-scenario-timeline.log +55 -123
- package/scripts/_dbg-redesign-shots.mjs +1 -1
- package/scripts/_dbg-release-smoke.mjs +1 -1
- package/scripts/_dbg-render-perf.mjs +142 -0
- package/scripts/_dbg-render-regression.mjs +130 -0
- package/scripts/_dbg-resolve-probe.ts +6 -0
- package/scripts/_dbg-restart-persist.mjs +1 -1
- package/scripts/_dbg-sc001-dispatch.mjs +1 -1
- package/scripts/_dbg-scenario-final-shot.mjs +1 -1
- package/scripts/_dbg-scenario-phase-e2.mjs +1 -1
- package/scripts/_dbg-scenario-phase-e3.mjs +1 -1
- package/scripts/_dbg-scenario-phase1.mjs +1 -1
- package/scripts/_dbg-scenario-phase2.mjs +1 -1
- package/scripts/_dbg-scenario-phase3-monitor.mjs +1 -1
- package/scripts/_dbg-scenario-phase3.mjs +1 -1
- package/scripts/_dbg-settings-draft-probe.mjs +39 -0
- package/scripts/_dbg-settings-probe.mjs +33 -0
- package/scripts/_dbg-task-cancel-probe.mjs +66 -0
- package/scripts/_dbg-town-alarm-e2e.mjs +1 -1
- package/scripts/_dbg-town-daq-shot.mjs +1 -1
- package/scripts/_dbg-town-full-e2e.mjs +1 -1
- package/scripts/_dbg-town-gate.mjs +1 -1
- package/scripts/_dbg-town-ins-probe.mjs +1 -1
- package/scripts/_dbg-town-perf.mjs +1 -1
- package/scripts/_dbg-town-realtime.mjs +1 -1
- package/scripts/_dbg-town-shot.py +25 -0
- package/scripts/_dbg-town-shot3.mjs +1 -1
- package/scripts/_dbg-town-smoke.mjs +54 -0
- package/scripts/_dbg-town-truth.mjs +1 -1
- package/scripts/_dbg-town-truth2.mjs +1 -1
- package/scripts/_dbg-trend-expand-test.mjs +1 -1
- package/scripts/_dbg-twindaq-focus.mjs +1 -1
- package/scripts/_dbg-ui-polish-shot.mjs +1 -1
- package/scripts/_dbg-ui-polish-verify1.mjs +1 -1
- package/scripts/_dbg-ui-polish-verify2.mjs +1 -1
- package/scripts/_dbg-ui-polish-verify3.mjs +1 -1
- package/scripts/_dbg-ui-polish-verify4.mjs +1 -1
- package/scripts/_dbg-unify-shot.mjs +1 -1
- package/scripts/_dbg-uplink-probe.mjs +1 -1
- package/scripts/_dbg-wizard-preview-shot.mjs +1 -1
- package/scripts/_dbg-wizard-ui-e2e.mjs +1 -1
- package/scripts/_dbg-ws-probe.mjs +1 -1
- package/scripts/_dbg-wsdot-sanity.mjs +1 -1
- package/scripts/_node-state-probe.mjs +1 -1
- package/scripts/_tmp-args-probe.mjs +20 -0
- package/scripts/_tmp-cyc-entry.mjs +8 -0
- package/scripts/_tmp-cyc-main.mjs +5 -0
- package/scripts/_tmp-cyc-mod.mjs +2 -0
- package/scripts/_tmp-cycle-a.mjs +6 -0
- package/scripts/_tmp-cycle-b.mjs +2 -0
- package/scripts/_tmp-cycle-probe.mjs +4 -0
- package/scripts/_tmp-entry-variant.mjs +2 -0
- package/scripts/_tmp-help-probe.mjs +19 -0
- package/scripts/_tmp-help-probe2.mjs +2 -0
- package/scripts/_tmp-trace-preload.mjs +1 -0
- package/scripts/aml-agent-bridge.ts +230 -0
- package/scripts/aml-industrial-loop.ts +232 -0
- package/scripts/aml-ui-smoke.mjs +67 -0
- package/scripts/aw-start-smoke.mjs +194 -0
- package/scripts/design-verify-templates.mjs +1 -1
- package/scripts/device-line-restore.mjs +1 -1
- package/scripts/e2e-aml.ts +259 -0
- package/scripts/e2e-config-groups.mjs +238 -0
- package/scripts/e2e-full-closedloop.mjs +911 -0
- package/scripts/e2e-full-scenario.ts +321 -0
- package/scripts/e2e-harness-consistency.ts +204 -0
- package/scripts/e2e-multi-harness.ts +233 -76
- package/scripts/e2e-plc-plugin-closedloop.mjs +518 -0
- package/scripts/e2e-real-scenario.mjs +466 -452
- package/scripts/e2e-template-isolation.mjs +2 -2
- package/scripts/experiment-castfilm-closedloop.mjs +423 -0
- package/scripts/experiment-castfilm-finish.mjs +194 -0
- package/scripts/experiment-castfilm-ui-shot.mjs +52 -0
- package/scripts/experiment-castfilm-viz.mjs +172 -0
- package/scripts/i18n-merge.mjs +152 -30
- package/scripts/production-closed-loop-e2e.mjs +300 -0
- package/scripts/team-plugins-api-smoke.mjs +149 -0
- package/scripts/test-aml-integration.ts +159 -0
- package/scripts/test-aml-job.ts +174 -0
- package/scripts/test-aml-unit.ts +184 -0
- package/scripts/test-cli-exit.mjs +235 -0
- package/scripts/test-daq-frame-race.mjs +310 -0
- package/scripts/test-data-root.mjs +208 -0
- package/scripts/test-log-flooding.mjs +160 -0
- package/scripts/test-lru.mjs +78 -0
- package/scripts/test-memory-month-query.mjs +62 -0
- package/scripts/test-plugin-hardening.mjs +45 -0
- package/scripts/test-rollback-index.mjs +79 -0
- package/scripts/test-sdk-surface.mjs +155 -0
- package/scripts/three-system-e2e.mjs +662 -0
- package/scripts/town-scene-clear.mjs +1 -1
- package/sdk/client.d.mts +110 -0
- package/sdk/client.mjs +144 -124
- package/sdk/context.mjs +161 -1
- package/sdk/index.d.mts +37 -5
- package/sdk/index.mjs +44 -41
- package/sdk/lifecycle.mjs +4 -1
- package/server/api/plugins/[name]/[...path].ts +46 -31
- package/server/api/plugins/i18n.get.ts +12 -0
- package/server/api/system/config-groups/[id].delete.ts +21 -0
- package/server/api/system/config-groups/[id].patch.ts +26 -0
- package/server/api/system/config-groups/index.get.ts +21 -0
- package/server/api/system/config-groups/index.post.ts +33 -0
- package/server/api/system/settings/events.get.ts +8 -4
- package/server/api/workshop/agent-tools/bindings/[id].delete.ts +6 -1
- package/server/api/workshop/agent-tools/bindings/[id].patch.ts +12 -3
- package/server/api/workshop/agent-tools/bindings/index.get.ts +29 -2
- package/server/api/workshop/agent-tools/invoke.post.ts +30 -5
- package/server/api/workshop/aml/datasets/[id]/preview.get.ts +68 -0
- package/server/api/workshop/aml/datasets/[id].get.ts +24 -0
- package/server/api/workshop/aml/datasets/index.get.ts +20 -0
- package/server/api/workshop/aml/datasets/index.post.ts +27 -0
- package/server/api/workshop/aml/experiments/index.get.ts +35 -0
- package/server/api/workshop/aml/index.get.ts +24 -0
- package/server/api/workshop/aml/jobs/[id]/cancel.post.ts +21 -0
- package/server/api/workshop/aml/jobs/[id]/logs.get.ts +23 -0
- package/server/api/workshop/aml/jobs/[id]/retry.post.ts +20 -0
- package/server/api/workshop/aml/jobs/[id].get.ts +23 -0
- package/server/api/workshop/aml/jobs/index.get.ts +26 -0
- package/server/api/workshop/aml/jobs/index.post.ts +44 -0
- package/server/api/workshop/aml/models/[id]/predict.post.ts +24 -0
- package/server/api/workshop/aml/models/[id]/promote.post.ts +30 -0
- package/server/api/workshop/aml/models/index.get.ts +48 -0
- package/server/api/workshop/channels/[id]/plugins/index.get.ts +35 -0
- package/server/api/workshop/channels/[id]/plugins/index.put.ts +39 -0
- package/server/api/workshop/channels.post.ts +17 -0
- package/server/api/workshop/daq/[id].delete.ts +6 -0
- package/server/api/workshop/dcw/[id].patch.ts +14 -2
- package/server/api/workshop/hitl/respond.post.ts +3 -1
- package/server/api/workshop/teams/[id]/plugins/index.get.ts +36 -0
- package/server/api/workshop/teams/[id]/plugins/index.put.ts +42 -0
- package/server/api/workshop/teams/index.post.ts +13 -0
- package/server/api/workshop/users/me.get.ts +5 -0
- package/server/api/workshop/ws.ts +14 -2
- package/server/data/daqs.json +1648 -123
- package/server/data/dcw-lines.json +308 -0
- package/server/data/dcw-products.json +147 -0
- package/server/data/dcw-recipes.json +891 -1
- package/server/data/dcw-rollback.json +11903 -5540
- package/server/data/dcw-runs.json +3745 -3559
- package/server/data/dcw-templates.json +120 -0
- package/server/data/dcw-writes.json +1872 -0
- package/server/data/dcws.json +1723 -434
- package/server/data/line-runs.json +137 -27
- package/server/data/scene-layouts.json +66 -0
- package/server/harness/pi-aw-tools.mjs +51 -0
- package/server/plugins/aw-plugins.ts +35 -27
- package/server/plugins/dev-stability-guard.ts +63 -63
- package/server/plugins/system-config.ts +10 -11
- package/server/plugins/workshop.ts +10 -0
- package/server/plugins-builtin/diag-bridge/client.mjs +84 -0
- package/server/plugins-builtin/diag-bridge/i18n.json +72 -0
- package/server/plugins-builtin/diag-bridge/index.mjs +661 -0
- package/server/plugins-builtin/rag-bridge/client.mjs +108 -0
- package/server/plugins-builtin/rag-bridge/i18n.json +60 -0
- package/server/plugins-builtin/rag-bridge/index.mjs +411 -0
- package/server/services/system-config.ts +610 -396
- package/server/services/workshop/agents/adapters/line-spawn.ts +15 -6
- package/server/services/workshop/agents/adapters/one-shot-cli-agent.ts +530 -0
- package/server/services/workshop/agents/base-agent.ts +210 -0
- package/server/services/workshop/agents/binding-authz.ts +57 -0
- package/server/services/workshop/agents/claude-agent.ts +546 -30
- package/server/services/workshop/agents/codex-agent.ts +729 -822
- package/server/services/workshop/agents/copilot-agent.ts +136 -0
- package/server/services/workshop/agents/crush-agent.ts +107 -0
- package/server/services/workshop/agents/cursor-agent.ts +102 -0
- package/server/services/workshop/agents/dsh-agent.ts +578 -670
- package/server/services/workshop/agents/gemini-agent.ts +121 -0
- package/server/services/workshop/agents/goose-agent.ts +98 -0
- package/server/services/workshop/agents/harness-models.ts +305 -270
- package/server/services/workshop/agents/hermes-agent.ts +528 -0
- package/server/services/workshop/agents/host-tool-bridge.ts +710 -642
- package/server/services/workshop/agents/industrial-tools.ts +659 -7
- package/server/services/workshop/agents/omp-agent.ts +1193 -1178
- package/server/services/workshop/agents/opencode-agent.ts +936 -987
- package/server/services/workshop/agents/pi-agent.ts +108 -0
- package/server/services/workshop/agents/plugin-tools.ts +10 -1
- package/server/services/workshop/agents/qwen-agent.ts +540 -0
- package/server/services/workshop/agents/registry.ts +117 -5
- package/server/services/workshop/agents/tool-approvals.ts +3 -3
- package/server/services/workshop/aml/aml.repo.ts +368 -0
- package/server/services/workshop/aml/clean.ts +120 -0
- package/server/services/workshop/aml/dataset-builder.ts +491 -0
- package/server/services/workshop/aml/gates.ts +121 -0
- package/server/services/workshop/aml/job-orchestrator.ts +650 -0
- package/server/services/workshop/aml/model-registry.ts +169 -0
- package/server/services/workshop/aml/predictor.ts +262 -0
- package/server/services/workshop/aml/python/aml_eval.py +171 -0
- package/server/services/workshop/aml/python/amlkit.py +120 -0
- package/server/services/workshop/aml/python/requirements.txt +7 -0
- package/server/services/workshop/aml/python/train-example.py +92 -0
- package/server/services/workshop/aml/python-runtime.ts +217 -0
- package/server/services/workshop/aml/retention.ts +98 -0
- package/server/services/workshop/aml/runtime.ts +45 -0
- package/server/services/workshop/aml/spec.ts +63 -0
- package/server/services/workshop/aml/stats.ts +140 -0
- package/server/services/workshop/daq/bus/mqtt.adapter.ts +8 -1
- package/server/services/workshop/daq/daq-controller.ts +147 -19
- package/server/services/workshop/daq/daq-node.repo.ts +13 -11
- package/server/services/workshop/daq/daq-runtime.ts +11 -0
- package/server/services/workshop/daq/drivers.ts +89 -8
- package/server/services/workshop/db/aml-team-seeds.ts +118 -0
- package/server/services/workshop/db/channel-plugins.repo.ts +91 -0
- package/server/services/workshop/db/database.ts +89 -1
- package/server/services/workshop/db/memory.repo.ts +31 -0
- package/server/services/workshop/db/user.repo.ts +9 -0
- package/server/services/workshop/dcw/dcw-controller.ts +33 -7
- package/server/services/workshop/dcw/dcw-line.repo.ts +5 -3
- package/server/services/workshop/dcw/dcw-node.repo.ts +4 -4
- package/server/services/workshop/dcw/dcw-product.repo.ts +8 -8
- package/server/services/workshop/dcw/dcw-recipe.repo.ts +6 -7
- package/server/services/workshop/dcw/dcw-runtime.ts +16 -2
- package/server/services/workshop/dcw/dcw-templates.ts +4 -4
- package/server/services/workshop/dcw/line-run.ts +5 -5
- package/server/services/workshop/dcw/recipe-rollback-manager.ts +3 -1
- package/server/services/workshop/dcw/recipe-rollback.repo.ts +155 -52
- package/server/services/workshop/logger.ts +145 -3
- package/server/services/workshop/plugins/host.mjs +857 -518
- package/server/services/workshop/prompts/loader.ts +32 -6
- package/server/services/workshop/runtime/manager.ts +3016 -2968
- package/server/services/workshop/runtime/scheduler-loop.ts +18 -1
- package/server/services/workshop/scene/scene-layout.repo.ts +5 -5
- package/server/services/workshop/settings.ts +64 -0
- package/shared/config/engine.mjs +5 -0
- package/shared/config/groups.mjs +220 -0
- package/shared/config/home.mjs +11 -2
- package/shared/config/schema.json +31 -2
- package/shared/daq-protocol.ts +6 -0
- package/shared/lru.mjs +94 -0
- package/shared/workshop-protocol.ts +2 -2
- package/.output/public/_nuxt/BAfp6tmu.js +0 -14
- package/.output/public/_nuxt/BUcmySDa2.js +0 -209
- package/.output/public/_nuxt/Bc-_IsBP.js +0 -19
- package/.output/public/_nuxt/BvNJUu3s.js +0 -1
- package/.output/public/_nuxt/BytVi9VX2.js +0 -4
- package/.output/public/_nuxt/C1CSiSBN.js +0 -1
- package/.output/public/_nuxt/CAGL7TNK.js +0 -1
- package/.output/public/_nuxt/CDLv-n51.js +0 -1
- package/.output/public/_nuxt/CJviSvm-.js +0 -1
- package/.output/public/_nuxt/CLZWFhZC.js +0 -1
- package/.output/public/_nuxt/CYzpZzB_.js +0 -1
- package/.output/public/_nuxt/Cb3SnTM8.js +0 -1
- package/.output/public/_nuxt/CjXIpPMR.js +0 -1
- package/.output/public/_nuxt/CxY6LfeN.js +0 -1
- package/.output/public/_nuxt/D6HDb-vN2.js +0 -1
- package/.output/public/_nuxt/D95h62Jn.js +0 -1
- package/.output/public/_nuxt/DAR70Lf52.js +0 -1
- package/.output/public/_nuxt/DGAOugLt.js +0 -1
- package/.output/public/_nuxt/DKHcFE1i.js +0 -1
- package/.output/public/_nuxt/DSa2O56y.js +0 -1
- package/.output/public/_nuxt/DUToq-k_.js +0 -1
- package/.output/public/_nuxt/Dfe8vXdG.js +0 -1
- package/.output/public/_nuxt/DjtE7AYt.js +0 -1
- package/.output/public/_nuxt/DvgKXPgu2.js +0 -13
- package/.output/public/_nuxt/JOwsShod.js +0 -2
- package/.output/public/_nuxt/X6IraCTB.js +0 -1
- package/.output/public/_nuxt/_id_.C-YXjn8Q.css +0 -1
- package/.output/public/_nuxt/_wsId_.BqWBlY7X.css +0 -1
- package/.output/public/_nuxt/agents.CB9Ck7VQ.css +0 -1
- package/.output/public/_nuxt/b50gYVZl.js +0 -1
- package/.output/public/_nuxt/builds/meta/024de5f7-6a10-4f53-82ab-bc65f3ec9e35.json +0 -1
- package/.output/public/_nuxt/daq.3OKj58HH.css +0 -1
- package/.output/public/_nuxt/default.BbgdTDCk.css +0 -1
- package/.output/public/_nuxt/entry.AZM1Culo.css +0 -1
- package/.output/public/_nuxt/pages.CG8UJ2TK.css +0 -1
- package/.output/public/_nuxt/plugins.DpCuwaJt.css +0 -1
- package/.output/public/_nuxt/settings.BqMF2nfj.css +0 -1
- package/.output/public/_nuxt/teams.DN0pAGGu.css +0 -1
- package/.output/server/chunks/build/_id_-DQDqj-cZ.mjs.map +0 -1
- package/.output/server/chunks/build/_id_-DY6v6sqB.mjs.map +0 -1
- package/.output/server/chunks/build/agents-GnmUGZir.mjs.map +0 -1
- package/.output/server/chunks/build/alert-qJnjyRcP.mjs.map +0 -1
- package/.output/server/chunks/build/channel-templates-B4z6v8Z5.mjs.map +0 -1
- package/.output/server/chunks/build/daq-B-3xCp_2.mjs.map +0 -1
- package/.output/server/chunks/build/dcw-BL2dhuz7.mjs.map +0 -1
- package/.output/server/chunks/build/logs-Dto_umFY.mjs.map +0 -1
- package/.output/server/chunks/build/pages-Dc2H1QFu.mjs.map +0 -1
- package/.output/server/chunks/build/permissions-BTRW2CVd.mjs.map +0 -1
- package/.output/server/chunks/build/plugins-DZR0T4Mh.mjs.map +0 -1
- package/.output/server/chunks/build/responsiveObserve-CS0UB6wQ.mjs +0 -78
- package/.output/server/chunks/build/responsiveObserve-CS0UB6wQ.mjs.map +0 -1
- package/.output/server/chunks/build/settings-UfGyDgM7.mjs +0 -567
- package/.output/server/chunks/build/settings-UfGyDgM7.mjs.map +0 -1
- package/.output/server/chunks/build/tag-NO9jEqKy.mjs.map +0 -1
- package/.output/server/chunks/build/teams-Cbg27MWW.mjs.map +0 -1
- package/.output/server/chunks/build/tokens-Bmm6rDfj.mjs.map +0 -1
- package/.output/server/chunks/build/town-Dsh0jlwZ.mjs.map +0 -1
- package/.output/server/chunks/build/useDaqStream-DkRL3tEW.mjs.map +0 -1
- package/.output/server/chunks/build/useDcwStream-DyB2ufQI.mjs.map +0 -1
- package/.output/server/chunks/build/users-B50HHrfi.mjs.map +0 -1
- /package/.output/public/_nuxt/{ORt9oDIy.js → ORt9oDIy2.js} +0 -0
|
@@ -1,1178 +1,1193 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OmpRpcAgentImpl — omp harness 的完整 AgentInterface 实现。
|
|
3
|
-
*
|
|
4
|
-
* 通过 OmpRpcClient 驱动真实 omp 子进程(--mode rpc),将 omp 的原生 agent 能力
|
|
5
|
-
* (LLM 推理 + 内置工具 read/write/edit/bash/grep/glob 等)接入 Workshop 的
|
|
6
|
-
* Channel 编排体系。
|
|
7
|
-
*
|
|
8
|
-
* 核心设计:
|
|
9
|
-
* - 每个 Agent 实例持有一个 omp 子进程(lazy spawn,跨消息复用)
|
|
10
|
-
* - AgentWorkspace 方法经 host-tool-bridge 注册为 omp host tools,agent 原生调用
|
|
11
|
-
* report_progress / complete_task / dispatch_task / send_message 等,无需文本解析
|
|
12
|
-
* - omp AgentSessionEvent → AgentEvent 五变体映射
|
|
13
|
-
* - worker run():接收 assign → prompt omp → agent 用原生工具作业 + host tools 管理任务生命周期
|
|
14
|
-
* - lead supervise():格式化快照 → prompt omp → agent 直接用 host tools 执行调度决策 → 返回 []
|
|
15
|
-
* - dispose():杀子进程
|
|
16
|
-
*
|
|
17
|
-
* prompt 组装与工具分发已抽至共享层(prompt-builder / host-tool-bridge),
|
|
18
|
-
* 与 codex/dsh/opencode impl 全引擎一致。协议权威:omp://rpc.md。
|
|
19
|
-
*/
|
|
20
|
-
import { createLogger } from '../logger'
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
import type {
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
type
|
|
37
|
-
type
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
export
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
/** omp
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
|
|
81
|
-
/** omp
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
private
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
private
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
)
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*/
|
|
285
|
-
private
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
this.
|
|
381
|
-
this.
|
|
382
|
-
this.
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
selfAgentId
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
await this.
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
const
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
//
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
if (
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
case '
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
})
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
//
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1
|
+
/**
|
|
2
|
+
* OmpRpcAgentImpl — omp harness 的完整 AgentInterface 实现。
|
|
3
|
+
*
|
|
4
|
+
* 通过 OmpRpcClient 驱动真实 omp 子进程(--mode rpc),将 omp 的原生 agent 能力
|
|
5
|
+
* (LLM 推理 + 内置工具 read/write/edit/bash/grep/glob 等)接入 Workshop 的
|
|
6
|
+
* Channel 编排体系。
|
|
7
|
+
*
|
|
8
|
+
* 核心设计:
|
|
9
|
+
* - 每个 Agent 实例持有一个 omp 子进程(lazy spawn,跨消息复用)
|
|
10
|
+
* - AgentWorkspace 方法经 host-tool-bridge 注册为 omp host tools,agent 原生调用
|
|
11
|
+
* report_progress / complete_task / dispatch_task / send_message 等,无需文本解析
|
|
12
|
+
* - omp AgentSessionEvent → AgentEvent 五变体映射
|
|
13
|
+
* - worker run():接收 assign → prompt omp → agent 用原生工具作业 + host tools 管理任务生命周期
|
|
14
|
+
* - lead supervise():格式化快照 → prompt omp → agent 直接用 host tools 执行调度决策 → 返回 []
|
|
15
|
+
* - dispose():杀子进程
|
|
16
|
+
*
|
|
17
|
+
* prompt 组装与工具分发已抽至共享层(prompt-builder / host-tool-bridge),
|
|
18
|
+
* 与 codex/dsh/opencode impl 全引擎一致。协议权威:omp://rpc.md。
|
|
19
|
+
*/
|
|
20
|
+
import { createLogger } from '../logger'
|
|
21
|
+
import { BaseAgentImpl } from './base-agent'
|
|
22
|
+
import { randomUUID } from 'node:crypto'
|
|
23
|
+
import type {
|
|
24
|
+
AgentEvent,
|
|
25
|
+
AgentInterface,
|
|
26
|
+
AgentInfo,
|
|
27
|
+
AgentRunContext,
|
|
28
|
+
AgentRunRequest,
|
|
29
|
+
SupervisionDecision,
|
|
30
|
+
SupervisionSnapshot,
|
|
31
|
+
} from './agent-interface'
|
|
32
|
+
import type { A2AMessage } from '../types/a2a'
|
|
33
|
+
import type { AgentContextStats } from '../types/task'
|
|
34
|
+
import {
|
|
35
|
+
OmpRpcClient,
|
|
36
|
+
type AgentSessionEvent,
|
|
37
|
+
type CompactionResult,
|
|
38
|
+
type HostToolCallRequest,
|
|
39
|
+
} from './adapters/omp-rpc-client'
|
|
40
|
+
import {
|
|
41
|
+
registerHarnessProcess,
|
|
42
|
+
bindHarnessProcess,
|
|
43
|
+
markHarnessProcessExit,
|
|
44
|
+
killHarnessProcess,
|
|
45
|
+
} from './harness-process'
|
|
46
|
+
import {
|
|
47
|
+
attachTerminalTap,
|
|
48
|
+
markTerminalSessionExit,
|
|
49
|
+
} from './harness-terminal'
|
|
50
|
+
import { hostToolsForRole } from './host-tool-bridge'
|
|
51
|
+
import {
|
|
52
|
+
createRosterCache,
|
|
53
|
+
extractJsonArray,
|
|
54
|
+
parseSteerBanner,
|
|
55
|
+
peerPrompt,
|
|
56
|
+
supervisePrompt,
|
|
57
|
+
systemManual,
|
|
58
|
+
toolArgsPreview,
|
|
59
|
+
workerPrompt,
|
|
60
|
+
} from './prompt-builder'
|
|
61
|
+
import { renderPrompt } from '../prompts/loader'
|
|
62
|
+
import { attachOmpPluginBridge, onPluginToolsChange } from './plugin-tools'
|
|
63
|
+
import { ompSettings } from '../settings'
|
|
64
|
+
|
|
65
|
+
const log = createLogger('workshop.omp')
|
|
66
|
+
|
|
67
|
+
// 兼容再导出(脚本/测试历史导入面;实现在 host-tool-bridge)
|
|
68
|
+
export { HOST_TOOLS, hostToolsForRole } from './host-tool-bridge'
|
|
69
|
+
|
|
70
|
+
// ===== 配置 =====
|
|
71
|
+
|
|
72
|
+
export interface OmpAgentConfig {
|
|
73
|
+
/** omp 可执行文件路径(默认 'omp',从 PATH 查找) */
|
|
74
|
+
command?: string
|
|
75
|
+
/** 额外 CLI 参数 */
|
|
76
|
+
args?: string[]
|
|
77
|
+
/** omp 工作目录(默认 process.cwd()) */
|
|
78
|
+
cwd?: string
|
|
79
|
+
/** 模型 provider(如 'anthropic'/'openai'/'zhipu');省略则用 omp 默认 */
|
|
80
|
+
provider?: string
|
|
81
|
+
/** 模型 ID;省略则用 omp 默认 */
|
|
82
|
+
model?: string
|
|
83
|
+
/** thinking level: off/minimal/low/medium/high/xhigh/max */
|
|
84
|
+
thinkingLevel?: string
|
|
85
|
+
/** 自定义系统 prompt 前缀(拼接到 agent 系统指令之前) */
|
|
86
|
+
systemPromptPrefix?: string
|
|
87
|
+
/** 限制 omp 仅使用指定内置工具(null = 全部) */
|
|
88
|
+
toolNames?: string[]
|
|
89
|
+
/** 每轮停滞超时(ms,默认 300000):整轮无任何 omp 事件才中止;工具内阻塞(poll_messages ≤180s)有 tool 事件刷新计时 */
|
|
90
|
+
promptTimeoutMs?: number
|
|
91
|
+
/** supervise 轮超时(ms,默认 150000) */
|
|
92
|
+
superviseTimeoutMs?: number
|
|
93
|
+
/**
|
|
94
|
+
* omp 输出模式:'rpc-ui'(默认)= RPC 协议 + UI 上下文 —— ask 工具与
|
|
95
|
+
* extension_ui_request 对话框可用(监控终端 HITL 通道,强制 noPty);
|
|
96
|
+
* 'rpc' = 纯协议(无 UI,ask 不可用)。
|
|
97
|
+
*/
|
|
98
|
+
rpcMode?: 'rpc' | 'rpc-ui'
|
|
99
|
+
/** channel 级作业场景 prompt(manager 装配时注入;用户场景规范,全员共享) */
|
|
100
|
+
scenarioPrompt?: string
|
|
101
|
+
/** agent 身份(由 factory 从 AgentInfo 注入) */
|
|
102
|
+
agentId?: string
|
|
103
|
+
name?: string
|
|
104
|
+
role?: 'lead' | 'worker'
|
|
105
|
+
channelId?: string
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// 插件桥接管(host.mjs ctx.omp 排队注册的工具在此回放;幂等)
|
|
109
|
+
attachOmpPluginBridge()
|
|
110
|
+
|
|
111
|
+
/** 在跑 agent 实例表(工具注册表变更 → 热重发 set_host_tools,运行时注入无需重spawn) */
|
|
112
|
+
const gLive = globalThis as typeof globalThis & { __ompLiveAgents?: Set<OmpRpcAgentImpl> }
|
|
113
|
+
function liveAgents(): Set<OmpRpcAgentImpl> {
|
|
114
|
+
return gLive.__ompLiveAgents ??= new Set()
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// 工具注册表变更 → 全部在跑会话热更新工具面
|
|
118
|
+
onPluginToolsChange(() => {
|
|
119
|
+
for (const impl of liveAgents()) {
|
|
120
|
+
try {
|
|
121
|
+
impl.refreshPluginTools()
|
|
122
|
+
}
|
|
123
|
+
catch { /* 单实例失败不影响其他 */ }
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
// ===== OmpRpcAgentImpl =====
|
|
128
|
+
|
|
129
|
+
export class OmpRpcAgentImpl extends BaseAgentImpl implements AgentInterface {
|
|
130
|
+
private readonly config: OmpAgentConfig
|
|
131
|
+
|
|
132
|
+
protected get harnessId(): string {
|
|
133
|
+
return 'omp'
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
protected configRecord(): Record<string, unknown> {
|
|
137
|
+
return this.config as unknown as Record<string, unknown>
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* supervise 用:收齐整个回合的事件。omp 的 supervise() 已整体覆盖(直接解析
|
|
142
|
+
* 决策/执行语义),本实现作为抽象成员的兜底:prompt → text deltas → agent_end,
|
|
143
|
+
* 文本装进单个 artifact 事件(与基类 extractJsonArray 消费形状一致)。
|
|
144
|
+
*/
|
|
145
|
+
protected collectTurnEvents(prompt: string, timeoutMs: number, signal?: AbortSignal): Promise<AgentEvent[]> {
|
|
146
|
+
return new Promise((resolve) => {
|
|
147
|
+
if (!this.client) {
|
|
148
|
+
resolve([])
|
|
149
|
+
return
|
|
150
|
+
}
|
|
151
|
+
let text = ''
|
|
152
|
+
let settled = false
|
|
153
|
+
const finish = (): void => {
|
|
154
|
+
if (settled) return
|
|
155
|
+
settled = true
|
|
156
|
+
unsub()
|
|
157
|
+
clearTimeout(timer)
|
|
158
|
+
signalUnsub?.()
|
|
159
|
+
resolve(text.trim()
|
|
160
|
+
? [{
|
|
161
|
+
kind: 'artifact',
|
|
162
|
+
artifact: { artifactId: randomUUID(), name: 'output', parts: [{ text }] },
|
|
163
|
+
lastChunk: true,
|
|
164
|
+
totalChunks: 1,
|
|
165
|
+
} as AgentEvent]
|
|
166
|
+
: [])
|
|
167
|
+
}
|
|
168
|
+
const abortTurn = (): void => {
|
|
169
|
+
void this.client?.send({ type: 'abort' }).catch(() => {})
|
|
170
|
+
finish()
|
|
171
|
+
}
|
|
172
|
+
const unsub = this.client.onEvent((event) => {
|
|
173
|
+
if (event.type === 'message_update' && event.assistantMessageEvent?.type === 'text_delta') {
|
|
174
|
+
text += event.assistantMessageEvent.delta ?? ''
|
|
175
|
+
}
|
|
176
|
+
if (event.type === 'agent_end' && event.isTerminal !== false) finish()
|
|
177
|
+
if (event.type === '__process_exit__' || event.type === '__error__') finish()
|
|
178
|
+
})
|
|
179
|
+
const timer = setTimeout(abortTurn, Math.max(timeoutMs, 1_000))
|
|
180
|
+
let signalUnsub: (() => void) | undefined
|
|
181
|
+
if (signal) {
|
|
182
|
+
if (signal.aborted) {
|
|
183
|
+
finish()
|
|
184
|
+
return
|
|
185
|
+
}
|
|
186
|
+
const onAbort = (): void => abortTurn()
|
|
187
|
+
signal.addEventListener('abort', onAbort, { once: true })
|
|
188
|
+
signalUnsub = () => signal.removeEventListener('abort', onAbort)
|
|
189
|
+
}
|
|
190
|
+
this.client.send({ type: 'prompt', message: prompt }).catch(() => finish())
|
|
191
|
+
})
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
private client: OmpRpcClient | null = null
|
|
195
|
+
private agentInfo: AgentInfo | null = null
|
|
196
|
+
private hostToolsRegistered = false
|
|
197
|
+
/**
|
|
198
|
+
* 会话回合状态(steer 可靠注入的依据):
|
|
199
|
+
* omp 的 steer 仅在回合 streaming 中生效——prompt 已入列但尚未开始输出时,
|
|
200
|
+
* steer 会"成功"返回但被静默丢弃。因此注入方轮询直到回合输出开始(streamingStarted)
|
|
201
|
+
* 才发送;若回合在等待期间结束,消息保持 pending 由消费循环处理。
|
|
202
|
+
*/
|
|
203
|
+
private streaming = false
|
|
204
|
+
private turnActive = false
|
|
205
|
+
/** 当前回合产生的 assistant 文本(供诊断) */
|
|
206
|
+
private turnText = ''
|
|
207
|
+
/** agent 身份信息(factory 注入;无需等待 init()) */
|
|
208
|
+
private agentRole: 'lead' | 'worker' = 'worker'
|
|
209
|
+
|
|
210
|
+
// ===== 上下文治理(70% 无中断压缩环)=====
|
|
211
|
+
/** 压缩进行中(平台 gate 与 omp 原生压缩共用互斥位) */
|
|
212
|
+
private compacting = false
|
|
213
|
+
private lastCompactAt = 0
|
|
214
|
+
/** omp 不支持 compact 命令(旧版)→ 永久停用平台压缩;原生 auto-compaction 兜底,harvest 照常 */
|
|
215
|
+
private compactLegacy = false
|
|
216
|
+
/** 模型上下文窗口(get_state/get_session_stats 探测;null = 未知,percent 不可算) */
|
|
217
|
+
private contextWindow: number | null = null
|
|
218
|
+
private sessionId: string | null = null
|
|
219
|
+
/** harvest 双路去重(compact 响应与 compaction_end 事件可能双达) */
|
|
220
|
+
private lastHarvestKey = ''
|
|
221
|
+
private lastHarvestAt = 0
|
|
222
|
+
|
|
223
|
+
/** 总开关(omp.compact_enabled;env AW_OMP_COMPACT_ENABLED=0 显式关闭兼容) */
|
|
224
|
+
private compactEnabled(): boolean {
|
|
225
|
+
return ompSettings().compact_enabled
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
private compactThreshold(): number {
|
|
229
|
+
return ompSettings().compact_threshold
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
private compactMinIntervalMs(): number {
|
|
233
|
+
return ompSettings().compact_min_interval_ms
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
private compactWaitMs(): number {
|
|
237
|
+
return ompSettings().compact_wait_ms
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** 被动上下文用量快照(无探测 RPC;getStatus 透出用) */
|
|
241
|
+
getContextStats(): AgentContextStats | null {
|
|
242
|
+
const usage = this.client?.getContextUsage() ?? null
|
|
243
|
+
const window = this.contextWindow ?? usage?.contextWindow ?? null
|
|
244
|
+
if (!usage && window === null) return null
|
|
245
|
+
const usedTokens = usage?.tokens ?? 0
|
|
246
|
+
return {
|
|
247
|
+
usedTokens,
|
|
248
|
+
contextWindow: window,
|
|
249
|
+
percent: window && window > 0 ? Math.min(1, usedTokens / window) : null,
|
|
250
|
+
compacting: this.compacting,
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* 上下文用量探测:get_session_stats 权威值;不可用退化为被动 usage + 已探测窗口。
|
|
256
|
+
* percent 归一化到 0-1(omp 可能返回 0-100)。
|
|
257
|
+
*/
|
|
258
|
+
private async probeUsage(client: OmpRpcClient): Promise<{ tokens: number, contextWindow: number | null, percent: number | null } | null> {
|
|
259
|
+
try {
|
|
260
|
+
const resp = await client.send({ type: 'get_session_stats' })
|
|
261
|
+
const cu = ((resp.data ?? {}) as Record<string, unknown>).contextUsage as
|
|
262
|
+
| { tokens?: number, contextWindow?: number, percent?: number }
|
|
263
|
+
| undefined
|
|
264
|
+
if (cu && typeof cu.tokens === 'number' && cu.tokens > 0) {
|
|
265
|
+
if (typeof cu.contextWindow === 'number' && cu.contextWindow > 0) {
|
|
266
|
+
this.contextWindow = cu.contextWindow
|
|
267
|
+
client.setContextWindow(cu.contextWindow)
|
|
268
|
+
}
|
|
269
|
+
const window = this.contextWindow ?? cu.contextWindow ?? null
|
|
270
|
+
const rawPercent = typeof cu.percent === 'number' ? (cu.percent > 1 ? cu.percent / 100 : cu.percent) : null
|
|
271
|
+
const percent = rawPercent ?? (window && window > 0 ? Math.min(1, cu.tokens / window) : null)
|
|
272
|
+
return { tokens: cu.tokens, contextWindow: window, percent }
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
catch { /* get_session_stats 不可用 → 被动跟踪 */ }
|
|
276
|
+
return client.getContextUsage()
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* 上下文治理门控:三条 prompt 路径(worker/peer/supervise)在回合间隙统一调用;
|
|
281
|
+
* post-settle 经 onTurnSettled 复用同一守卫。任何失败路径都放行——压缩晚一轮
|
|
282
|
+
* 永远好过中断作业。三重防线:仅回合间隙发起 → get_state 复查 isStreaming/
|
|
283
|
+
* isCompacting → compacting 互斥位 + 最小间隔防振荡。
|
|
284
|
+
*/
|
|
285
|
+
private async contextGate(reason: string): Promise<void> {
|
|
286
|
+
if (!this.compactEnabled() || this.compactLegacy || this.compacting) return
|
|
287
|
+
const client = this.client
|
|
288
|
+
if (!client || !client.alive) return
|
|
289
|
+
try {
|
|
290
|
+
const usage = await this.probeUsage(client)
|
|
291
|
+
if (!usage || usage.percent === null || usage.percent < this.compactThreshold()) return
|
|
292
|
+
if (Date.now() - this.lastCompactAt < this.compactMinIntervalMs()) return
|
|
293
|
+
// 回合间隙硬校验:流式中/压缩中绝不发起(不中断执行的硬约束)
|
|
294
|
+
const st = await client.send({ type: 'get_state' })
|
|
295
|
+
const s = (st.data ?? {}) as Record<string, unknown>
|
|
296
|
+
if (s.isStreaming === true || s.isCompacting === true) return
|
|
297
|
+
if (typeof s.sessionId === 'string' && s.sessionId) this.sessionId = s.sessionId
|
|
298
|
+
this.compacting = true
|
|
299
|
+
this.lastCompactAt = Date.now()
|
|
300
|
+
try {
|
|
301
|
+
const result = await this.runCompaction(client)
|
|
302
|
+
if (result?.summary) {
|
|
303
|
+
await this.harvestCompaction(
|
|
304
|
+
result.summary,
|
|
305
|
+
result.tokensBefore,
|
|
306
|
+
result.tokensAfter ?? result.estimatedTokensAfter,
|
|
307
|
+
reason,
|
|
308
|
+
)
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
finally {
|
|
312
|
+
this.compacting = false
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
catch (err) {
|
|
316
|
+
const msg = err instanceof Error ? err.message : String(err)
|
|
317
|
+
if (/compact/i.test(msg) && /unknown|unsupported|invalid|无效|未知|不支持/i.test(msg)) this.compactLegacy = true
|
|
318
|
+
log.warn(`[OmpRpcAgent:${this.selfAgentId}] contextGate(${reason}) 失败,放行: ${msg}`)
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* 发起 compact 并等待 compaction_end(响应内含 result 则立即收口;
|
|
324
|
+
* 超时放行——压缩在 harness 内后台继续,isCompacting 防后续双发)。
|
|
325
|
+
*/
|
|
326
|
+
private runCompaction(client: OmpRpcClient): Promise<CompactionResult | null> {
|
|
327
|
+
return new Promise<CompactionResult | null>((resolve) => {
|
|
328
|
+
let settled = false
|
|
329
|
+
const finish = (r: CompactionResult | null): void => {
|
|
330
|
+
if (settled) return
|
|
331
|
+
settled = true
|
|
332
|
+
off()
|
|
333
|
+
clearTimeout(timer)
|
|
334
|
+
resolve(r)
|
|
335
|
+
}
|
|
336
|
+
const off = client.onEvent((event) => {
|
|
337
|
+
if (event.type === 'compaction_end') {
|
|
338
|
+
finish((event as { result?: CompactionResult }).result ?? null)
|
|
339
|
+
}
|
|
340
|
+
else if (event.type === '__process_exit__') {
|
|
341
|
+
finish(null)
|
|
342
|
+
}
|
|
343
|
+
})
|
|
344
|
+
const timer = setTimeout(() => {
|
|
345
|
+
log.warn(`[OmpRpcAgent:${this.selfAgentId}] compact 等待超时(${this.compactWaitMs()}ms)→ 放行(压缩后台继续)`)
|
|
346
|
+
finish(null)
|
|
347
|
+
}, this.compactWaitMs())
|
|
348
|
+
void client.send({ type: 'compact', customInstructions: this.compactionHints() })
|
|
349
|
+
.then((resp) => {
|
|
350
|
+
const result = (resp.data as { result?: CompactionResult } | undefined)?.result
|
|
351
|
+
if (result?.summary) finish(result)
|
|
352
|
+
// 响应无 result:等 compaction_end 事件(协议权威语义)
|
|
353
|
+
})
|
|
354
|
+
.catch((err) => {
|
|
355
|
+
const msg = err instanceof Error ? err.message : String(err)
|
|
356
|
+
if (/compact/i.test(msg)) this.compactLegacy = true
|
|
357
|
+
log.warn(`[OmpRpcAgent:${this.selfAgentId}] compact 发起失败: ${msg}`)
|
|
358
|
+
finish(null)
|
|
359
|
+
})
|
|
360
|
+
})
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/** 压缩摘要指令(外置 prompts;缺失时省略,omp 用默认策略) */
|
|
364
|
+
private compactionHints(): string | undefined {
|
|
365
|
+
try {
|
|
366
|
+
return renderPrompt('compaction-hints')
|
|
367
|
+
}
|
|
368
|
+
catch {
|
|
369
|
+
return undefined
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* 压缩摘要 harvest(三路统一:平台主动 compact / omp 阈值自动 / overflow):
|
|
375
|
+
* 经 workspace.recordSessionMemory 落库为本人 episodic-session 记忆。
|
|
376
|
+
* 双路去重:同摘要 60s 内只入库一次。
|
|
377
|
+
*/
|
|
378
|
+
private async harvestCompaction(summary: string, tokensBefore?: number, tokensAfter?: number, reason?: string): Promise<void> {
|
|
379
|
+
const key = summary.slice(0, 120)
|
|
380
|
+
if (key === this.lastHarvestKey && Date.now() - this.lastHarvestAt < 60_000) return
|
|
381
|
+
this.lastHarvestKey = key
|
|
382
|
+
this.lastHarvestAt = Date.now()
|
|
383
|
+
try {
|
|
384
|
+
await this.workspace?.recordSessionMemory?.({ summary, tokensBefore, tokensAfter, reason })
|
|
385
|
+
log.info(`[OmpRpcAgent:${this.selfAgentId}] 压缩摘要已入记忆(${summary.length} 字,reason=${reason ?? 'auto'})`)
|
|
386
|
+
}
|
|
387
|
+
catch (err) {
|
|
388
|
+
log.warn(`[OmpRpcAgent:${this.selfAgentId}] 压缩摘要入库失败(不影响会话):`, err instanceof Error ? err.message : err)
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/** 回合落定钩子(AgentRuntime 在信箱空时调用):后台压缩检查,自守卫不抛错 */
|
|
393
|
+
async onTurnSettled(): Promise<void> {
|
|
394
|
+
await this.contextGate('post-settle')
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
constructor(config: Record<string, unknown> = {}) {
|
|
398
|
+
super({
|
|
399
|
+
agentId: typeof config.agentId === 'string' ? config.agentId : '',
|
|
400
|
+
name: typeof config.name === 'string' ? config.name : undefined,
|
|
401
|
+
role: config.role === 'lead' ? 'lead' : 'worker',
|
|
402
|
+
channelId: typeof config.channelId === 'string' ? config.channelId : '',
|
|
403
|
+
})
|
|
404
|
+
this.config = config as OmpAgentConfig
|
|
405
|
+
// effort 统一入口(channel 默认 LLM 注入 config.effort)→ omp thinking 级别
|
|
406
|
+
if (!this.config.thinkingLevel && typeof config.effort === 'string' && config.effort) {
|
|
407
|
+
this.config.thinkingLevel = config.effort
|
|
408
|
+
}
|
|
409
|
+
// factory 注入的 agent 身份(无需等待 init())
|
|
410
|
+
this.selfAgentId = this.config.agentId ?? ''
|
|
411
|
+
this.agentName = this.config.name ?? 'agent'
|
|
412
|
+
this.agentRole = this.config.role ?? 'worker'
|
|
413
|
+
this.channelId = this.config.channelId ?? ''
|
|
414
|
+
this.bridgeCtx.identity = { agentId: this.selfAgentId, channelId: this.channelId, role: this.agentRole, name: this.agentName }
|
|
415
|
+
this.roster = createRosterCache({
|
|
416
|
+
selfAgentId: this.selfAgentId,
|
|
417
|
+
listAgents: () => this.workspace!.listAgents(),
|
|
418
|
+
})
|
|
419
|
+
liveAgents().add(this) // 在跑实例表:插件工具热注入的目标集
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// ===== 生命周期 =====
|
|
423
|
+
|
|
424
|
+
async init(input: { agent: AgentInfo, channelId: string }): Promise<void> {
|
|
425
|
+
this.agentInfo = input.agent
|
|
426
|
+
this.channelId = input.channelId
|
|
427
|
+
this.agentName = input.agent.name
|
|
428
|
+
this.agentRole = input.agent.role
|
|
429
|
+
this.selfAgentId = input.agent.id
|
|
430
|
+
this.bridgeCtx.identity = { agentId: this.selfAgentId, channelId: this.channelId, role: this.agentRole, name: this.agentName }
|
|
431
|
+
this.roster = createRosterCache({
|
|
432
|
+
selfAgentId: this.selfAgentId,
|
|
433
|
+
listAgents: () => this.workspace!.listAgents(),
|
|
434
|
+
})
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
async dispose(): Promise<void> {
|
|
438
|
+
liveAgents().delete(this)
|
|
439
|
+
if (this.client) {
|
|
440
|
+
const pid = this.client.pid
|
|
441
|
+
await this.client.dispose()
|
|
442
|
+
this.client = null
|
|
443
|
+
if (pid) {
|
|
444
|
+
markHarnessProcessExit(pid, null)
|
|
445
|
+
markTerminalSessionExit(pid, null)
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
this.hostToolsRegistered = false
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/** 工具注册表变更 → 热重发 set_host_tools(在跑会话立即获得插件新工具,无需重spawn) */
|
|
452
|
+
refreshPluginTools(): void {
|
|
453
|
+
const client = this.client
|
|
454
|
+
if (!client || !client.alive) return
|
|
455
|
+
void client.send({ type: 'set_host_tools', tools: hostToolsForRole(this.agentRole, this.channelId) }).catch(() => {})
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/** harness 进程资源信息(运行时资源监控;进程未 spawn/已回收 → null) */
|
|
459
|
+
getProcessInfo(): { pid: number, alive: boolean, command: string } | null {
|
|
460
|
+
const client = this.client
|
|
461
|
+
const pid = client?.pid
|
|
462
|
+
if (!pid || !client) return null
|
|
463
|
+
return { pid, alive: client.alive, command: `omp --mode ${this.rpcMode}` }
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/** 强制终止 harness 进程(进程树;终止后由调用方停止对应 AgentRuntime) */
|
|
467
|
+
killProcess(): void {
|
|
468
|
+
const pid = this.client?.pid
|
|
469
|
+
if (pid) {
|
|
470
|
+
markTerminalSessionExit(pid, null)
|
|
471
|
+
killHarnessProcess(pid)
|
|
472
|
+
}
|
|
473
|
+
else {
|
|
474
|
+
this.client?.kill()
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* harness 进程存活校准(manager sweeper 周期性调用;休眠/强杀后 exit 事件
|
|
480
|
+
* 可能不达父进程):按 PID 探 OS 实际存在性,进程已死 → 客户端收敛为已退出,
|
|
481
|
+
* 在途回合经 __process_exit__ 归位,下一回合 ensureClient 重生子进程。
|
|
482
|
+
*/
|
|
483
|
+
reconcileProcess(): void {
|
|
484
|
+
this.client?.reconcile()
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/** omp 输出模式(rpc-ui = 默认,启用 HITL 对话框) */
|
|
488
|
+
private get rpcMode(): 'rpc' | 'rpc-ui' {
|
|
489
|
+
return this.config.rpcMode === 'rpc' ? 'rpc' : 'rpc-ui'
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// ===== 工具桥(共享分发)=====
|
|
493
|
+
|
|
494
|
+
/** 引擎无关工具面:REST/MCP 桥直调与 omp 内部 host_tool_call 共用同一实现 */
|
|
495
|
+
private async handleHostTool(req: HostToolCallRequest): Promise<{ text: string, isError?: boolean }> {
|
|
496
|
+
return this.dispatchHostTool(req.toolName, req.arguments ?? {})
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
// ===== prompt 组合 =====
|
|
500
|
+
|
|
501
|
+
/** 前置上下文(场景 × 身份 × 工业简报 × 名册;共享 prompt-builder) */
|
|
502
|
+
private systemManual(): string {
|
|
503
|
+
return systemManual()
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* 实时消息注入(送达模式协议):
|
|
508
|
+
* - 回合 streaming 中 → 立即 steer,返回 'steer'(同轮可见,唯一可标记消费的路径)
|
|
509
|
+
* - 回合活跃但尚未 streaming(prompt 排队窗口,上限 20s)→ 等 streaming 开始后 steer
|
|
510
|
+
* - 回合被 host 工具阻塞(如 poll_messages 等待)/空闲/发送失败 → 返回 'deferred':
|
|
511
|
+
* 消息保持 pending,poll_messages 的 Mailbox 到信回调即时取走(毫秒级),或本回合
|
|
512
|
+
* 结束后由消费循环按 FIFO 起回合处理。
|
|
513
|
+
*/
|
|
514
|
+
async steer(text: string): Promise<'steer' | 'deferred'> {
|
|
515
|
+
// 从确定性触发横幅提取回执上下文(AgentRuntime.injectSteer 生成,格式固定):
|
|
516
|
+
// "[实时消息 from <id>]: ..." + "[系统触发器] 本消息要求回复(reply_to=<messageId>)。"
|
|
517
|
+
const banner = parseSteerBanner(text)
|
|
518
|
+
if (banner) {
|
|
519
|
+
this.toolState.replyContext = banner
|
|
520
|
+
}
|
|
521
|
+
const client = this.client
|
|
522
|
+
if (!client) return 'deferred'
|
|
523
|
+
try {
|
|
524
|
+
if (this.streaming) {
|
|
525
|
+
await client.send({ type: 'steer', message: text })
|
|
526
|
+
return 'steer'
|
|
527
|
+
}
|
|
528
|
+
if (this.turnActive) {
|
|
529
|
+
// prompt 排队窗口:等 streaming 开始(上限 20s);工具阻塞的回合等不到 → deferred
|
|
530
|
+
const deadline = Date.now() + 20_000
|
|
531
|
+
while (Date.now() < deadline && this.turnActive && !this.streaming) {
|
|
532
|
+
const { promise, resolve } = Promise.withResolvers()
|
|
533
|
+
setTimeout(resolve, 150)
|
|
534
|
+
await promise
|
|
535
|
+
}
|
|
536
|
+
if (this.streaming && this.turnActive) {
|
|
537
|
+
await client.send({ type: 'steer', message: text })
|
|
538
|
+
return 'steer'
|
|
539
|
+
}
|
|
540
|
+
return 'deferred'
|
|
541
|
+
}
|
|
542
|
+
// 空闲/回合已结束:deferred(消息 pending,消费循环 dequeue 即起回合)
|
|
543
|
+
return 'deferred'
|
|
544
|
+
}
|
|
545
|
+
catch (err) {
|
|
546
|
+
log.error(`[OmpRpcAgent:${this.selfAgentId}] steer 注入失败(消息保持 pending):`, err instanceof Error ? err.message : err)
|
|
547
|
+
return 'deferred'
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
// ===== supervise() =====
|
|
552
|
+
|
|
553
|
+
/** supervise 单飞守卫:同一 client 不并发 LLM 回合(残留回合与下一 prompt 混流的根因) */
|
|
554
|
+
private supervising = false
|
|
555
|
+
|
|
556
|
+
async supervise(snapshot: SupervisionSnapshot, ctx: AgentRunContext, opts?: { signal?: AbortSignal }): Promise<SupervisionDecision[]> {
|
|
557
|
+
await this.ensureClient(ctx)
|
|
558
|
+
if (!this.client) return []
|
|
559
|
+
if (this.supervising) return [] // 上一轮 supervise 未收口:跳过本拍(节流即正确)
|
|
560
|
+
|
|
561
|
+
// 上下文门控(≥70% 先压缩再调度;回合间隙发起,失败放行)
|
|
562
|
+
await this.contextGate('supervise')
|
|
563
|
+
|
|
564
|
+
const prompt = supervisePrompt({
|
|
565
|
+
snapshot,
|
|
566
|
+
agentName: this.agentName,
|
|
567
|
+
channelId: this.channelId,
|
|
568
|
+
ctxPrefix: await this.contextPrefix(),
|
|
569
|
+
manual: this.systemManual(),
|
|
570
|
+
memory: ctx.memory,
|
|
571
|
+
})
|
|
572
|
+
// 150s 上界:supervise 持 lead.execLock 期间信箱消费停顿(更久会拖垮 worker 回执处理);
|
|
573
|
+
// supervise 是一次真实 LLM 回合:omp 冷启动(插件/MCP 加载 30~90s)+ 慢 provider
|
|
574
|
+
// 单步可能 >60s,过紧会把正常回合掐成 "Interrupted by user"。默认 150s,
|
|
575
|
+
// 仅拦真僵死(更紧的预算由调用方 config.superviseTimeoutMs 显式传入);真 abort 已实现。
|
|
576
|
+
const timeoutMs = this.config.superviseTimeoutMs ?? 150_000
|
|
577
|
+
|
|
578
|
+
return new Promise<SupervisionDecision[]>((resolve) => {
|
|
579
|
+
let assistantText = ''
|
|
580
|
+
let resolved = false
|
|
581
|
+
|
|
582
|
+
const finish = (decisions: SupervisionDecision[]) => {
|
|
583
|
+
if (resolved) return
|
|
584
|
+
resolved = true
|
|
585
|
+
this.supervising = false
|
|
586
|
+
unsub()
|
|
587
|
+
clearTimeout(timer)
|
|
588
|
+
signalUnsub?.()
|
|
589
|
+
resolve(decisions)
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
const abortTurn = (): void => {
|
|
593
|
+
// 超时/外部取消:真正中止 omp 当前回合 —— 只 resolve 不 abort 会让残留回合
|
|
594
|
+
// 与下一个 prompt 在同一 client 混流(决策错位 + token 空烧)
|
|
595
|
+
log.warn(`[OmpRpcAgent:${this.selfAgentId}] supervise 超时(${timeoutMs}ms)→ abort 当前调度回合`)
|
|
596
|
+
void this.client?.send({ type: 'abort' }).catch(() => {})
|
|
597
|
+
finish([])
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
const unsub = this.client!.onEvent((event) => {
|
|
601
|
+
if (event.type === 'message_update' && event.assistantMessageEvent?.type === 'text_delta') {
|
|
602
|
+
assistantText += event.assistantMessageEvent.delta ?? ''
|
|
603
|
+
}
|
|
604
|
+
if (event.type === 'agent_end' && event.isTerminal !== false) {
|
|
605
|
+
// 尝试从文本解析 JSON 决策(备用:如果 agent 没用 host tools 而是输出 JSON)
|
|
606
|
+
const parsed = extractJsonArray(assistantText)
|
|
607
|
+
if (parsed && parsed.length > 0) {
|
|
608
|
+
finish(parsed as SupervisionDecision[])
|
|
609
|
+
}
|
|
610
|
+
else {
|
|
611
|
+
// agent 可能已通过 host tools 直接执行了调度,返回空(已执行)
|
|
612
|
+
finish([])
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
if (event.type === '__process_exit__' || event.type === '__error__') {
|
|
616
|
+
finish([])
|
|
617
|
+
}
|
|
618
|
+
})
|
|
619
|
+
|
|
620
|
+
const timer = setTimeout(abortTurn, timeoutMs)
|
|
621
|
+
|
|
622
|
+
// 外部取消(调度器 cancel 路径)传导:abort 当前 LLM 回合并立即收口
|
|
623
|
+
let signalUnsub: (() => void) | undefined
|
|
624
|
+
if (opts?.signal) {
|
|
625
|
+
if (opts.signal.aborted) {
|
|
626
|
+
unsub()
|
|
627
|
+
resolve([])
|
|
628
|
+
return
|
|
629
|
+
}
|
|
630
|
+
const onAbort = (): void => abortTurn()
|
|
631
|
+
opts.signal.addEventListener('abort', onAbort, { once: true })
|
|
632
|
+
signalUnsub = () => opts.signal?.removeEventListener('abort', onAbort)
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
this.supervising = true
|
|
636
|
+
this.client!.send({ type: 'prompt', message: prompt }).catch(() => finish([]))
|
|
637
|
+
})
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
// ===== 内部:worker 执行 =====
|
|
641
|
+
|
|
642
|
+
protected async* workerTurn(request: AgentRunRequest, ctx: AgentRunContext): AsyncGenerator<AgentEvent, void, unknown> {
|
|
643
|
+
const taskId = request.taskId
|
|
644
|
+
?? (request.message.metadata?.['x-aw-task-id'] as string | undefined)
|
|
645
|
+
if (!taskId) return
|
|
646
|
+
|
|
647
|
+
this.toolState.currentTaskId = taskId
|
|
648
|
+
|
|
649
|
+
try {
|
|
650
|
+
await this.ensureClient(ctx)
|
|
651
|
+
}
|
|
652
|
+
catch (err) {
|
|
653
|
+
yield {
|
|
654
|
+
kind: 'error',
|
|
655
|
+
error: {
|
|
656
|
+
code: 'OMP_SPAWN_FAILED',
|
|
657
|
+
message: `omp 子进程启动失败: ${err instanceof Error ? err.message : String(err)}`,
|
|
658
|
+
},
|
|
659
|
+
}
|
|
660
|
+
return
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
if (!this.client) {
|
|
664
|
+
yield { kind: 'error', error: { code: 'OMP_NOT_READY', message: 'omp 客户端未就绪' } }
|
|
665
|
+
return
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
// 构建 prompt
|
|
669
|
+
const taskText = request.message.parts.map((p) => {
|
|
670
|
+
if ('text' in p) return p.text
|
|
671
|
+
if ('data' in p) return JSON.stringify(p.data)
|
|
672
|
+
if ('url' in p) return p.url
|
|
673
|
+
if ('raw' in p) return p.raw
|
|
674
|
+
return ''
|
|
675
|
+
}).join('\n')
|
|
676
|
+
const prompt = workerPrompt({
|
|
677
|
+
agentName: this.agentName,
|
|
678
|
+
channelId: this.channelId,
|
|
679
|
+
taskId,
|
|
680
|
+
taskText,
|
|
681
|
+
memory: request.memory,
|
|
682
|
+
ctxPrefix: await this.contextPrefix(),
|
|
683
|
+
manual: this.systemManual(),
|
|
684
|
+
})
|
|
685
|
+
|
|
686
|
+
// 流式执行 + 事件映射
|
|
687
|
+
yield* this.promptAndStream(prompt, taskId, ctx.signal)
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* 点对点消息处理(实时通信驱动;lead 与 worker 通用)。
|
|
692
|
+
* 触发器语义:metadata['x-aw-require-reply']='true' → 必须经 send_message_to_agent
|
|
693
|
+
* 回给发送者:执行结果 + 对方所需内容,in_reply_to 关联原消息,并声明是否需再响应。
|
|
694
|
+
*/
|
|
695
|
+
protected async* peerTurn(request: AgentRunRequest, ctx: AgentRunContext): AsyncGenerator<AgentEvent, void, unknown> {
|
|
696
|
+
try {
|
|
697
|
+
await this.ensureClient(ctx)
|
|
698
|
+
}
|
|
699
|
+
catch (err) {
|
|
700
|
+
// spawn 失败必须显式报错:静默 return 会让 sawRunError=false → 消息被
|
|
701
|
+
// 直接 markConsumed,实时消息一次性丢失且无任何重试;产出 error 事件
|
|
702
|
+
// 走消息 requeue(≤2 次),与 workerRun 同口径
|
|
703
|
+
yield {
|
|
704
|
+
kind: 'error',
|
|
705
|
+
error: {
|
|
706
|
+
code: 'OMP_SPAWN_FAILED',
|
|
707
|
+
message: `omp 子进程启动失败(peer 消息未消费,将重试): ${err instanceof Error ? err.message : String(err)}`,
|
|
708
|
+
},
|
|
709
|
+
}
|
|
710
|
+
return
|
|
711
|
+
}
|
|
712
|
+
if (!this.client) {
|
|
713
|
+
yield { kind: 'error', error: { code: 'OMP_NOT_READY', message: 'omp 客户端未就绪(peer 消息未消费,将重试)' } }
|
|
714
|
+
return
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
const msg = request.message
|
|
718
|
+
// 显示名:agent 同事用 id(名册可解析);人类发送者用 fromLabel;兜底 unknown
|
|
719
|
+
const fromId = request.fromAgentId
|
|
720
|
+
?? (typeof msg.metadata?.['x-aw-from-label'] === 'string' ? msg.metadata['x-aw-from-label'] : undefined)
|
|
721
|
+
?? 'unknown'
|
|
722
|
+
const msgText = msg.parts.map((p) => {
|
|
723
|
+
if ('text' in p) return p.text
|
|
724
|
+
if ('data' in p) return JSON.stringify(p.data)
|
|
725
|
+
if ('url' in p) return p.url
|
|
726
|
+
if ('raw' in p) return p.raw
|
|
727
|
+
return ''
|
|
728
|
+
}).join('\n')
|
|
729
|
+
const requireReply = msg.metadata?.['x-aw-require-reply'] === 'true'
|
|
730
|
+
const isReply = typeof msg.metadata?.['x-aw-in-reply-to'] === 'string'
|
|
731
|
+
// 跨 Channel 来信:发送方是其他 channel 的 lead,回执必须走 send_cross_channel_message
|
|
732
|
+
const crossChannel = msg.metadata?.['x-aw-cross-channel'] === 'true'
|
|
733
|
+
const fromChannel = typeof msg.metadata?.['x-aw-from-channel'] === 'string'
|
|
734
|
+
? String(msg.metadata['x-aw-from-channel'])
|
|
735
|
+
: ''
|
|
736
|
+
// 回执自动关联仅对真实 agent 发送者生效(人类无 agentId 可回投;
|
|
737
|
+
// 对人类的回复经事件流/时间线可见)
|
|
738
|
+
this.toolState.replyContext = requireReply && request.fromAgentId && !crossChannel
|
|
739
|
+
? { fromId: request.fromAgentId, messageId: msg.messageId }
|
|
740
|
+
: null
|
|
741
|
+
|
|
742
|
+
const prompt = peerPrompt({
|
|
743
|
+
agentName: this.agentName,
|
|
744
|
+
role: this.agentRole,
|
|
745
|
+
channelId: this.channelId,
|
|
746
|
+
ctxPrefix: await this.contextPrefix(),
|
|
747
|
+
manual: this.systemManual(),
|
|
748
|
+
memory: request.memory,
|
|
749
|
+
fromId,
|
|
750
|
+
messageId: msg.messageId,
|
|
751
|
+
requireReply,
|
|
752
|
+
isReply,
|
|
753
|
+
crossChannel,
|
|
754
|
+
fromChannel,
|
|
755
|
+
msgText,
|
|
756
|
+
})
|
|
757
|
+
|
|
758
|
+
yield* this.promptAndStream(prompt, undefined, ctx.signal)
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
// ===== 内部:prompt 发送 + 事件流桥接 =====
|
|
762
|
+
|
|
763
|
+
private async* promptAndStream(
|
|
764
|
+
prompt: string,
|
|
765
|
+
taskId: string | undefined,
|
|
766
|
+
signal: AbortSignal,
|
|
767
|
+
): AsyncGenerator<AgentEvent, void, unknown> {
|
|
768
|
+
const client = this.client
|
|
769
|
+
if (!client) {
|
|
770
|
+
throw new Error('omp 客户端未就绪')
|
|
771
|
+
}
|
|
772
|
+
// 上下文门控(≥70% 时在回合间隙先压缩再发 prompt;等待有界,失败放行)
|
|
773
|
+
await this.contextGate('pre-prompt')
|
|
774
|
+
const queue: AgentEvent[] = []
|
|
775
|
+
let resolveWait: (() => void) | null = null
|
|
776
|
+
let isDone = false
|
|
777
|
+
// 回合生命周期:prompt 已发出 → turnActive;首条 message_update → streaming;message_end/turn_end → 结束
|
|
778
|
+
this.turnActive = true
|
|
779
|
+
this.streaming = false
|
|
780
|
+
this.turnText = ''
|
|
781
|
+
// 正文流式差额账本:contentIndex → 已流出长度。部分 provider(reasoning 模型/
|
|
782
|
+
// openai-completions)的 text 块不走 text_delta(只有换行),全文在 text_end.content
|
|
783
|
+
// 落定 —— 差额兜底把未流出部分补发为 delta,保证前端流式不缺正文。
|
|
784
|
+
const textSent = new Map<number, number>()
|
|
785
|
+
const unsubState = client.onEvent((event) => {
|
|
786
|
+
if (event.type === 'message_update') {
|
|
787
|
+
const ev = event.assistantMessageEvent as
|
|
788
|
+
| { type?: string, delta?: string, content?: string, contentIndex?: number }
|
|
789
|
+
| undefined
|
|
790
|
+
if (ev?.type === 'text_delta') {
|
|
791
|
+
this.streaming = true
|
|
792
|
+
const text = ev.delta ?? ''
|
|
793
|
+
const ci = typeof ev.contentIndex === 'number' ? ev.contentIndex : 0
|
|
794
|
+
textSent.set(ci, (textSent.get(ci) ?? 0) + text.length)
|
|
795
|
+
this.turnText += text
|
|
796
|
+
// LLM 流式增量透出(AEP agent.delta 事件源):仅 worker/peer 转本走生成器
|
|
797
|
+
if (text) enqueueDelta(text)
|
|
798
|
+
}
|
|
799
|
+
else if (ev?.type === 'text_end' && typeof ev.content === 'string') {
|
|
800
|
+
const ci = typeof ev.contentIndex === 'number' ? ev.contentIndex : 0
|
|
801
|
+
const sent = textSent.get(ci) ?? 0
|
|
802
|
+
if (ev.content.length > sent) {
|
|
803
|
+
const chunk = ev.content.slice(sent)
|
|
804
|
+
textSent.set(ci, ev.content.length)
|
|
805
|
+
this.streaming = true
|
|
806
|
+
this.turnText += chunk
|
|
807
|
+
enqueueDelta(chunk)
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
if (event.type === 'message_end' || event.type === 'turn_end') {
|
|
812
|
+
this.streaming = false
|
|
813
|
+
flushDelta()
|
|
814
|
+
}
|
|
815
|
+
if (event.type === 'agent_end' && event.isTerminal !== false) {
|
|
816
|
+
this.turnActive = false
|
|
817
|
+
this.streaming = false
|
|
818
|
+
flushDelta()
|
|
819
|
+
}
|
|
820
|
+
if (event.type === '__process_exit__' || event.type === '__error__') {
|
|
821
|
+
this.turnActive = false
|
|
822
|
+
this.streaming = false
|
|
823
|
+
}
|
|
824
|
+
})
|
|
825
|
+
|
|
826
|
+
const enqueue = (event: AgentEvent): void => {
|
|
827
|
+
queue.push(event)
|
|
828
|
+
if (event.kind === 'done' || event.kind === 'error') isDone = true
|
|
829
|
+
lastActivity = Date.now()
|
|
830
|
+
resolveWait?.()
|
|
831
|
+
resolveWait = null
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
// 停滞看门狗:整轮无任何 omp 事件(挂死的 LLM 调用/子进程僵死)时中止回合,
|
|
835
|
+
// 否则消息永久卡 consuming、队友消息无限堆积。host 工具内阻塞
|
|
836
|
+
// (poll_messages 最长 180s)与慢 provider(实测单步可 >5min)都有
|
|
837
|
+
// tool/状态事件刷新计时;默认 600s 覆盖慢回合,只拦真僵死。
|
|
838
|
+
const idleTimeoutMs = this.config.promptTimeoutMs ?? 600_000
|
|
839
|
+
let lastActivity = Date.now()
|
|
840
|
+
let stallTimer: ReturnType<typeof setTimeout> | null = null
|
|
841
|
+
|
|
842
|
+
// LLM 流式增量缓冲:50ms 批量合并为一帧 delta(防高频 text_delta 洪泛 WS)
|
|
843
|
+
let deltaBuf = ''
|
|
844
|
+
let deltaTimer: ReturnType<typeof setTimeout> | null = null
|
|
845
|
+
const flushDelta = (): void => {
|
|
846
|
+
if (deltaTimer) {
|
|
847
|
+
clearTimeout(deltaTimer)
|
|
848
|
+
deltaTimer = null
|
|
849
|
+
}
|
|
850
|
+
if (!deltaBuf) return
|
|
851
|
+
const text = deltaBuf
|
|
852
|
+
deltaBuf = ''
|
|
853
|
+
enqueue({ kind: 'delta', delta: { text } })
|
|
854
|
+
}
|
|
855
|
+
const enqueueDelta = (text: string): void => {
|
|
856
|
+
deltaBuf += text
|
|
857
|
+
deltaTimer ??= setTimeout(() => {
|
|
858
|
+
deltaTimer = null
|
|
859
|
+
flushDelta()
|
|
860
|
+
}, 50)
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
// 订阅 omp 事件流
|
|
864
|
+
const unsub = client.onEvent((event) => {
|
|
865
|
+
for (const mapped of this.mapOmpEvent(event, taskId)) {
|
|
866
|
+
enqueue(mapped)
|
|
867
|
+
}
|
|
868
|
+
})
|
|
869
|
+
|
|
870
|
+
// abort 传导
|
|
871
|
+
const onAbort = (): void => {
|
|
872
|
+
log.warn(`[OmpRpcAgent:${this.selfAgentId}] run 被 abort(signal)→ 中止 omp 回合,taskId=${taskId ?? '-'}`)
|
|
873
|
+
client.send({ type: 'abort' }).catch(() => {})
|
|
874
|
+
if (!isDone) {
|
|
875
|
+
enqueue({ kind: 'done', final: taskId ? { taskId } : undefined })
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
if (signal.aborted) {
|
|
879
|
+
onAbort()
|
|
880
|
+
}
|
|
881
|
+
else {
|
|
882
|
+
signal.addEventListener('abort', onAbort, { once: true })
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
// 发送 prompt
|
|
886
|
+
try {
|
|
887
|
+
await client.send({ type: 'prompt', message: prompt })
|
|
888
|
+
}
|
|
889
|
+
catch (err) {
|
|
890
|
+
unsub()
|
|
891
|
+
signal.removeEventListener('abort', onAbort)
|
|
892
|
+
// 僵死进程回收:prompt send 失败 = stdio 断裂或 60s 命令确认超时 —— 进程
|
|
893
|
+
// "活着但不干活"(alive-but-wedged)。若仅报错不清理,消息重试(≤2 次)会
|
|
894
|
+
// 复用同一僵死 stdio 每次空转 60s;必须杀掉并置空,下回合 ensureClient
|
|
895
|
+
// 全新重生(host tools/模型/终端 tap 随重建)。
|
|
896
|
+
log.warn(`[OmpRpcAgent:${this.selfAgentId}] prompt 失败 → 回收可疑僵死进程 pid=${client.pid}`)
|
|
897
|
+
this.killProcess()
|
|
898
|
+
this.client = null
|
|
899
|
+
this.hostToolsRegistered = false
|
|
900
|
+
yield {
|
|
901
|
+
kind: 'error',
|
|
902
|
+
error: {
|
|
903
|
+
code: 'PROMPT_FAILED',
|
|
904
|
+
message: `omp prompt 失败: ${err instanceof Error ? err.message : String(err)}`,
|
|
905
|
+
},
|
|
906
|
+
}
|
|
907
|
+
return
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
// 产出事件直到 done/error
|
|
911
|
+
try {
|
|
912
|
+
while (!isDone || queue.length > 0) {
|
|
913
|
+
if (queue.length === 0 && !isDone) {
|
|
914
|
+
const remaining = idleTimeoutMs - (Date.now() - lastActivity)
|
|
915
|
+
if (remaining <= 0) {
|
|
916
|
+
client.send({ type: 'abort' }).catch(() => {})
|
|
917
|
+
// 子进程大概率已僵死:击杀并清引用,下回合 ensureClient 全新重生
|
|
918
|
+
this.killProcess()
|
|
919
|
+
this.client = null
|
|
920
|
+
this.hostToolsRegistered = false
|
|
921
|
+
enqueue({
|
|
922
|
+
kind: 'error',
|
|
923
|
+
error: {
|
|
924
|
+
code: 'TURN_STALLED',
|
|
925
|
+
message: `回合停滞 ${Math.round(idleTimeoutMs / 1000)}s 无 omp 事件,已中止重置(消息按已处理落账,后续消息继续)`,
|
|
926
|
+
},
|
|
927
|
+
})
|
|
928
|
+
continue
|
|
929
|
+
}
|
|
930
|
+
await new Promise<void>((r) => {
|
|
931
|
+
resolveWait = r
|
|
932
|
+
stallTimer = setTimeout(() => {
|
|
933
|
+
resolveWait = null
|
|
934
|
+
r()
|
|
935
|
+
}, remaining + 100)
|
|
936
|
+
})
|
|
937
|
+
if (stallTimer) {
|
|
938
|
+
clearTimeout(stallTimer)
|
|
939
|
+
stallTimer = null
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
while (queue.length > 0) {
|
|
943
|
+
yield queue.shift()!
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
finally {
|
|
948
|
+
if (stallTimer) clearTimeout(stallTimer)
|
|
949
|
+
// 事件监听必须全部解除:本 client 跨回合长期复用,残留的 mapOmpEvent
|
|
950
|
+
// 闭包会在后续每一帧继续执行并把事件 push 进孤儿队列(内存/CPU 随
|
|
951
|
+
// 回合数线性劣化,直接违背进程常驻的稳定性目标)
|
|
952
|
+
unsubState()
|
|
953
|
+
unsub()
|
|
954
|
+
signal.removeEventListener('abort', onAbort)
|
|
955
|
+
this.turnActive = false
|
|
956
|
+
this.streaming = false
|
|
957
|
+
this.toolState.currentTaskId = null
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
// ===== 内部:omp 事件 → AgentEvent 映射 =====
|
|
962
|
+
|
|
963
|
+
private mapOmpEvent(event: AgentSessionEvent, taskId: string | undefined): AgentEvent[] {
|
|
964
|
+
switch (event.type) {
|
|
965
|
+
case 'agent_start':
|
|
966
|
+
return [{
|
|
967
|
+
kind: 'status',
|
|
968
|
+
status: { state: 'WORKING', timestamp: new Date().toISOString() },
|
|
969
|
+
}]
|
|
970
|
+
case 'message_end': {
|
|
971
|
+
// 消息完成:如果有 message 内容,产出为 status 事件(任务历史追踪)
|
|
972
|
+
const msg = event.message
|
|
973
|
+
if (msg && Array.isArray(msg.content)) {
|
|
974
|
+
const text = (msg.content as Array<{ type?: string, text?: string }>)
|
|
975
|
+
.filter(c => c.type === 'text')
|
|
976
|
+
.map(c => c.text ?? '')
|
|
977
|
+
.join('')
|
|
978
|
+
if (text) {
|
|
979
|
+
const a2aMsg: A2AMessage = {
|
|
980
|
+
messageId: randomUUID(),
|
|
981
|
+
contextId: this.channelId,
|
|
982
|
+
role: 'ROLE_AGENT',
|
|
983
|
+
parts: [{ text }],
|
|
984
|
+
}
|
|
985
|
+
return [{
|
|
986
|
+
kind: 'status',
|
|
987
|
+
status: { state: 'WORKING', message: a2aMsg, timestamp: new Date().toISOString() },
|
|
988
|
+
}]
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
return []
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
case 'tool_execution_start': {
|
|
995
|
+
const toolName = event.toolName ?? 'tool'
|
|
996
|
+
return [{
|
|
997
|
+
kind: 'status',
|
|
998
|
+
status: {
|
|
999
|
+
state: 'WORKING',
|
|
1000
|
+
message: {
|
|
1001
|
+
messageId: randomUUID(),
|
|
1002
|
+
contextId: this.channelId,
|
|
1003
|
+
role: 'ROLE_AGENT',
|
|
1004
|
+
parts: [{ text: `🔧 ${toolName}${toolArgsPreview(event.args)}` }],
|
|
1005
|
+
},
|
|
1006
|
+
timestamp: new Date().toISOString(),
|
|
1007
|
+
},
|
|
1008
|
+
}]
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
case 'agent_end': {
|
|
1012
|
+
if (event.isTerminal === false) return []
|
|
1013
|
+
const events: AgentEvent[] = []
|
|
1014
|
+
// 提取最终 assistant 文本作为 artifact
|
|
1015
|
+
const messages = event.messages ?? []
|
|
1016
|
+
const assistantText = messages
|
|
1017
|
+
.filter(m => m.role === 'assistant')
|
|
1018
|
+
.flatMap(m => m.content.filter(c => c.type === 'text').map(c => c.text ?? ''))
|
|
1019
|
+
.join('')
|
|
1020
|
+
// 回合内的 provider/API 失败(限额 429、鉴权、上游 5xx 等):omp 把错误挂在最后一条
|
|
1021
|
+
// assistant 消息上(stopReason='error' + errorStatus/errorMessage)而非 __error__ 帧。
|
|
1022
|
+
// 不映射出来,上层只能看到「回合结束无产出」,真实原因彻底丢失(且照常重试到耗尽)。
|
|
1023
|
+
const failure = [...messages].reverse().find((m) => {
|
|
1024
|
+
const mm = m as { role?: string, stopReason?: string, errorMessage?: string }
|
|
1025
|
+
return mm.role === 'assistant' && (mm.stopReason === 'error' || typeof mm.errorMessage === 'string')
|
|
1026
|
+
}) as { errorStatus?: number, errorMessage?: string } | undefined
|
|
1027
|
+
if (failure) {
|
|
1028
|
+
const code = failure.errorStatus != null ? `OMP_LLM_${failure.errorStatus}` : 'OMP_LLM_ERROR'
|
|
1029
|
+
const detail = failure.errorMessage ?? 'harness 回合以错误结束(无错误详情)'
|
|
1030
|
+
log.error(`[OmpRpcAgent:${this.selfAgentId}] harness 回合失败 ${code}: ${detail}`)
|
|
1031
|
+
// error 事件即回合终点(队列侧据此收口),不再追加 done
|
|
1032
|
+
return [{ kind: 'error', error: { code, message: detail } }]
|
|
1033
|
+
}
|
|
1034
|
+
if (assistantText) {
|
|
1035
|
+
events.push({
|
|
1036
|
+
kind: 'artifact',
|
|
1037
|
+
artifact: {
|
|
1038
|
+
artifactId: randomUUID(),
|
|
1039
|
+
name: 'output',
|
|
1040
|
+
parts: [{ text: assistantText }],
|
|
1041
|
+
},
|
|
1042
|
+
lastChunk: true,
|
|
1043
|
+
totalChunks: 1,
|
|
1044
|
+
})
|
|
1045
|
+
}
|
|
1046
|
+
events.push({ kind: 'done', final: taskId ? { taskId } : undefined })
|
|
1047
|
+
return events
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
case '__process_exit__':
|
|
1051
|
+
return [{
|
|
1052
|
+
kind: 'error',
|
|
1053
|
+
error: { code: 'OMP_PROCESS_EXIT', message: 'omp 子进程意外退出' },
|
|
1054
|
+
}]
|
|
1055
|
+
|
|
1056
|
+
// ===== 上下文治理事件(回合中到达的原生阈值/overflow 压缩;不污染事件流)=====
|
|
1057
|
+
case 'compaction_start':
|
|
1058
|
+
this.compacting = true
|
|
1059
|
+
return []
|
|
1060
|
+
|
|
1061
|
+
case 'compaction_end': {
|
|
1062
|
+
this.compacting = false
|
|
1063
|
+
const result = (event as { result?: CompactionResult }).result
|
|
1064
|
+
if (result?.summary) {
|
|
1065
|
+
void this.harvestCompaction(
|
|
1066
|
+
result.summary,
|
|
1067
|
+
result.tokensBefore,
|
|
1068
|
+
result.tokensAfter ?? result.estimatedTokensAfter,
|
|
1069
|
+
(event as { reason?: string }).reason,
|
|
1070
|
+
)
|
|
1071
|
+
}
|
|
1072
|
+
return []
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
// 回合完全落定(无自动重试/压缩重试/排队续跑):后续压缩检查由 AgentRuntime 驱动
|
|
1076
|
+
case 'agent_settled':
|
|
1077
|
+
return []
|
|
1078
|
+
|
|
1079
|
+
case '__error__':
|
|
1080
|
+
return [{
|
|
1081
|
+
kind: 'error',
|
|
1082
|
+
error: { code: 'OMP_ERROR', message: (event as { error?: string }).error ?? 'omp 未知错误' },
|
|
1083
|
+
}]
|
|
1084
|
+
|
|
1085
|
+
default:
|
|
1086
|
+
return []
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
// ===== 内部:omp 客户端管理 =====
|
|
1091
|
+
|
|
1092
|
+
private async ensureClient(ctx: AgentRunContext): Promise<void> {
|
|
1093
|
+
if (!this.workspace) {
|
|
1094
|
+
this.workspace = ctx.workspace
|
|
1095
|
+
}
|
|
1096
|
+
if (!this.agentInfo) {
|
|
1097
|
+
// init() 可能未调用;从 ctx 推断
|
|
1098
|
+
this.channelId = ctx.channelId
|
|
1099
|
+
this.agentRole = ctx.role
|
|
1100
|
+
this.bridgeCtx.identity = { agentId: this.selfAgentId, channelId: this.channelId, role: this.agentRole, name: this.agentName }
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
if (!this.client || !this.client.alive) {
|
|
1104
|
+
// 旧客户端已退出(exit 事件/OS 存活校准 reconcile 触发)——必须丢弃并重生,
|
|
1105
|
+
// 否则后续回合会一直对着死 stdio 报 PROMPT_FAILED 烧重试配额
|
|
1106
|
+
this.client = null
|
|
1107
|
+
this.hostToolsRegistered = false
|
|
1108
|
+
const command = this.config.command ?? 'omp'
|
|
1109
|
+
const client = new OmpRpcClient({
|
|
1110
|
+
command,
|
|
1111
|
+
mode: this.rpcMode,
|
|
1112
|
+
args: [...(this.config.thinkingLevel ? ['--thinking', this.config.thinkingLevel] : [])],
|
|
1113
|
+
args: this.config.args,
|
|
1114
|
+
cwd: this.config.cwd ?? process.cwd(),
|
|
1115
|
+
// 进程退出 → 注册表标记(供运行时资源监控);pid=-1 表示无法取得,忽略
|
|
1116
|
+
onExit: (pid, code) => {
|
|
1117
|
+
if (pid > 0) {
|
|
1118
|
+
markHarnessProcessExit(pid, code)
|
|
1119
|
+
markTerminalSessionExit(pid, code)
|
|
1120
|
+
}
|
|
1121
|
+
},
|
|
1122
|
+
})
|
|
1123
|
+
await client.start()
|
|
1124
|
+
|
|
1125
|
+
// 登记 + 绑定 agent 身份(harness 进程监控的事实源)
|
|
1126
|
+
const pid = client.pid
|
|
1127
|
+
if (pid) {
|
|
1128
|
+
registerHarnessProcess(pid, {
|
|
1129
|
+
harness: 'omp',
|
|
1130
|
+
command,
|
|
1131
|
+
args: ['--mode', this.rpcMode, ...(this.config.args ?? [])],
|
|
1132
|
+
})
|
|
1133
|
+
bindHarnessProcess(pid, {
|
|
1134
|
+
agentId: this.selfAgentId,
|
|
1135
|
+
channelId: this.channelId,
|
|
1136
|
+
name: this.agentName,
|
|
1137
|
+
role: this.agentRole,
|
|
1138
|
+
})
|
|
1139
|
+
// 终端镜像 tap:全部 RPC 帧 → /monitor 终端(实时 TUI 渲染 + HITL)
|
|
1140
|
+
attachTerminalTap(client, {
|
|
1141
|
+
pid,
|
|
1142
|
+
harness: 'omp',
|
|
1143
|
+
agentId: this.selfAgentId,
|
|
1144
|
+
channelId: this.channelId,
|
|
1145
|
+
name: this.agentName,
|
|
1146
|
+
role: this.agentRole,
|
|
1147
|
+
})
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
// 设置模型(如果配置了 provider/model 任一;omp 以当前已设值为缺省补全,
|
|
1151
|
+
// 只配其一时也显式发送,避免 respawn 后静默回落默认模型)
|
|
1152
|
+
if (this.config.provider || this.config.model) {
|
|
1153
|
+
try {
|
|
1154
|
+
// 未配置一侧保持 undefined(JSON 序列化丢键)→ omp 以当前已设值补全
|
|
1155
|
+
await client.send({
|
|
1156
|
+
type: 'set_model',
|
|
1157
|
+
provider: this.config.provider as string,
|
|
1158
|
+
modelId: this.config.model as string,
|
|
1159
|
+
})
|
|
1160
|
+
}
|
|
1161
|
+
catch {
|
|
1162
|
+
// 模型设置失败不致命(用 omp 默认模型)
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
// 注册 host tools(按角色差异化:lead 全量,worker 剔除调度/团队管理专属工具)
|
|
1167
|
+
client.onHostToolCall(req => this.handleHostTool(req))
|
|
1168
|
+
await client.send({ type: 'set_host_tools', tools: hostToolsForRole(this.agentRole, this.channelId) })
|
|
1169
|
+
|
|
1170
|
+
// 上下文治理探测(feature-detect 一次;失败退化被动 usage 跟踪)+ 原生压缩兜底保持开启
|
|
1171
|
+
void this.probeContext(client).catch(() => {})
|
|
1172
|
+
void client.send({ type: 'set_auto_compaction', enabled: true }).catch(() => {})
|
|
1173
|
+
|
|
1174
|
+
this.client = client
|
|
1175
|
+
this.hostToolsRegistered = true
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
/** 上下文状态探测:get_state 取 contextWindow/sessionId(一次;失败仅损失 percent 精度) */
|
|
1180
|
+
private async probeContext(client: OmpRpcClient): Promise<void> {
|
|
1181
|
+
try {
|
|
1182
|
+
const resp = await client.send({ type: 'get_state' })
|
|
1183
|
+
const data = (resp.data ?? {}) as Record<string, unknown>
|
|
1184
|
+
const model = data.model as { contextWindow?: number } | undefined
|
|
1185
|
+
if (typeof model?.contextWindow === 'number' && model.contextWindow > 0) {
|
|
1186
|
+
this.contextWindow = model.contextWindow
|
|
1187
|
+
client.setContextWindow(model.contextWindow)
|
|
1188
|
+
}
|
|
1189
|
+
if (typeof data.sessionId === 'string' && data.sessionId) this.sessionId = data.sessionId
|
|
1190
|
+
}
|
|
1191
|
+
catch { /* get_state 不可用:仅被动 usage */ }
|
|
1192
|
+
}
|
|
1193
|
+
}
|