agentworkshop 0.7.23 → 0.7.27
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/0jKrzLuM.js +19 -0
- package/.output/public/_nuxt/2jaJHWIJ.js +1 -0
- package/.output/public/_nuxt/{Cor9siSf.js → 6PZPfFcO.js} +1 -1
- package/.output/public/_nuxt/B7gZokg82.js +209 -0
- package/.output/public/_nuxt/B8kt898d.js +1 -0
- package/.output/public/_nuxt/{B-xskWta.js → BCJFMBQ6.js} +1 -1
- package/.output/public/_nuxt/BFGpEo8S.js +1 -0
- package/.output/public/_nuxt/BG4zduPf.js +14 -0
- package/.output/public/_nuxt/{DNxVTfhe.js → BGhOrgle.js} +1 -1
- package/.output/public/_nuxt/{n3vMFfrv.js → BHcpzI2n.js} +3 -3
- package/.output/public/_nuxt/{CEHmSufQ.js → BTLEvDxM.js} +1 -1
- package/.output/public/_nuxt/{CYBq3kS7.js → BWyR3awA.js} +1 -1
- package/.output/public/_nuxt/Bc89zKq2.js +1 -0
- package/.output/public/_nuxt/BetmGSO4.js +1 -0
- package/.output/public/_nuxt/{DAR70Lf5.js → BgCrZKv_2.js} +1 -1
- package/.output/public/_nuxt/BowTbasd.js +1 -0
- package/.output/public/_nuxt/BvtknqSC2.js +1 -0
- package/.output/public/_nuxt/CJviSvm-.js +1 -0
- package/.output/public/_nuxt/CTfqWGdy.js +1 -0
- package/.output/public/_nuxt/Cb3SnTM8.js +1 -0
- package/.output/public/_nuxt/Chc5pfAA.js +1 -0
- package/.output/public/_nuxt/CmHzfVc5.js +3 -0
- package/.output/public/_nuxt/Cn3J3NXR.js +23 -0
- package/.output/public/_nuxt/CobSUzQv.js +2 -0
- package/.output/public/_nuxt/{kZV5TQvh2.js → CucID8qg2.js} +1 -1
- package/.output/public/_nuxt/{CfVAr2nf.js → Cz9gD2Yo.js} +1 -1
- package/.output/public/_nuxt/{E88a-JCG.js → DGAOugLt.js} +1 -1
- package/.output/public/_nuxt/DHbTyoAV.js +1 -0
- package/.output/public/_nuxt/{BxtpDtzC.js → DNQF_TXX.js} +1 -1
- package/.output/public/_nuxt/DfLUN8kY.js +1 -0
- package/.output/public/_nuxt/DjU9Dx5Y.js +1 -0
- package/.output/public/_nuxt/DnziMlcX.js +1 -0
- package/.output/public/_nuxt/{BBwMH_hG.js → DoAlYsiF.js} +1 -1
- package/.output/public/_nuxt/{DA4lxCWC2.js → DosOJEmZ2.js} +2 -2
- package/.output/public/_nuxt/{DWcEk1ur2.js → DvgKXPgu2.js} +1 -1
- package/.output/public/_nuxt/{ed5qX-x5.js → Q_SJDSgx.js} +1 -1
- package/.output/public/_nuxt/{TownView.zu2rU5nS.css → TownView.CtskuMXS.css} +1 -1
- package/.output/public/_nuxt/XY2z78rj.js +1 -0
- package/.output/public/_nuxt/_id_.DdbYeLqn.css +1 -0
- package/.output/public/_nuxt/bFnZa2yd.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/f7a8e33d-5422-45ac-895d-27168f97e3ad.json +1 -0
- package/.output/public/_nuxt/daq.DGV9QS8d.css +1 -0
- package/.output/public/_nuxt/entry.BN02X8iR.css +1 -0
- package/.output/public/_nuxt/monitor.B--1dPzs.css +1 -0
- package/.output/public/_nuxt/permissions.B1pjGChZ.css +1 -0
- package/.output/public/_nuxt/plugins.DpCuwaJt.css +1 -0
- package/.output/public/_nuxt/rkVgzg62.js +1 -0
- package/.output/public/_nuxt/settings.W6qrYAui.css +1 -0
- package/.output/public/_nuxt/teams.BBXVkyKq.css +1 -0
- package/.output/public/_nuxt/tokens.xRb1fSPU.css +1 -0
- package/.output/public/_nuxt/users.DuAt_Zwf.css +1 -0
- package/.output/public/_nuxt/workshop.BJg84pOK.css +1 -0
- package/.output/public/assets/game/character/yangyang-walk.glb +0 -0
- package/.output/server/chunks/_/host-bindings.mjs +1 -1
- package/.output/server/chunks/_/nitro.mjs +1073 -925
- package/.output/server/chunks/_/nitro.mjs.map +1 -1
- package/.output/server/chunks/build/{OmpTerminalPanel-Ban3yJZ4.mjs → OmpTerminalPanel-Cw_Vw9oO.mjs} +3 -3
- package/.output/server/chunks/build/{OmpTerminalPanel-Ban3yJZ4.mjs.map → OmpTerminalPanel-Cw_Vw9oO.mjs.map} +1 -1
- package/.output/server/chunks/build/{TownView-DxeQe1Bl.mjs → TownView-ftIylqiD.mjs} +178 -151
- package/.output/server/chunks/build/{TownView-DxeQe1Bl.mjs.map → TownView-ftIylqiD.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-DQDqj-cZ.mjs → _id_-3Axz2-gV.mjs} +35 -35
- package/.output/server/chunks/build/{_id_-DQDqj-cZ.mjs.map → _id_-3Axz2-gV.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-DY6v6sqB.mjs → _id_-CahfkmEt.mjs} +5 -5
- package/.output/server/chunks/build/{_id_-DY6v6sqB.mjs.map → _id_-CahfkmEt.mjs.map} +1 -1
- package/.output/server/chunks/build/{_wsId_-C2O5zZsI.mjs → _wsId_-BymlQhzS.mjs} +13 -15
- package/.output/server/chunks/build/{_wsId_-C2O5zZsI.mjs.map → _wsId_-BymlQhzS.mjs.map} +1 -1
- package/.output/server/chunks/build/{agents--6bzGtES.mjs → agents-DuMiSWKp.mjs} +7 -9
- package/.output/server/chunks/build/agents-DuMiSWKp.mjs.map +1 -0
- package/.output/server/chunks/build/button-DEcZFcqN.mjs +1 -1
- package/.output/server/chunks/build/{card-CCPQoKlh.mjs → card-Dipvaykh.mjs} +4 -4
- package/.output/server/chunks/build/{card-CCPQoKlh.mjs.map → card-Dipvaykh.mjs.map} +1 -1
- package/.output/server/chunks/build/{channel-templates-C1Bb-U75.mjs → channel-templates-BStqJ-of.mjs} +5 -7
- package/.output/server/chunks/build/channel-templates-BStqJ-of.mjs.map +1 -0
- package/.output/server/chunks/build/{checkbox-Dv1kjaUZ.mjs → checkbox-C1gABOca.mjs} +5 -5
- package/.output/server/chunks/build/{checkbox-Dv1kjaUZ.mjs.map → checkbox-C1gABOca.mjs.map} +1 -1
- package/.output/server/chunks/build/{daq-B-3xCp_2.mjs → daq-ChYCABz1.mjs} +312 -426
- package/.output/server/chunks/build/daq-ChYCABz1.mjs.map +1 -0
- package/.output/server/chunks/build/{dcw-BL2dhuz7.mjs → dcw-CcQNGggh.mjs} +3 -3
- package/.output/server/chunks/build/{dcw-BL2dhuz7.mjs.map → dcw-CcQNGggh.mjs.map} +1 -1
- package/.output/server/chunks/build/{default-DdV642BY.mjs → default-95-zOTPt.mjs} +3 -4
- package/.output/server/chunks/build/{default-DdV642BY.mjs.map → default-95-zOTPt.mjs.map} +1 -1
- package/.output/server/chunks/build/dropdown-vhn1NPFs.mjs +1 -1
- package/.output/server/chunks/build/{input-number-CZ3ZrCsy.mjs → input-number-Bd55elNN.mjs} +3 -3
- package/.output/server/chunks/build/{input-number-CZ3ZrCsy.mjs.map → input-number-Bd55elNN.mjs.map} +1 -1
- package/.output/server/chunks/build/{input-DxDqeyQW.mjs → input-sf_BT6o6.mjs} +553 -5
- package/.output/server/chunks/build/input-sf_BT6o6.mjs.map +1 -0
- package/.output/server/chunks/build/{logs-Dto_umFY.mjs → logs-D-2UyGtE.mjs} +3 -3
- package/.output/server/chunks/build/{logs-Dto_umFY.mjs.map → logs-D-2UyGtE.mjs.map} +1 -1
- package/.output/server/chunks/build/menu-WCrlpYVh.mjs +2 -2
- package/.output/server/chunks/build/modal-yvUquPj5.mjs +2 -2
- package/.output/server/chunks/build/{monitor-miqq9xHB.mjs → monitor-mfG5jBtz.mjs} +70 -192
- package/.output/server/chunks/build/monitor-mfG5jBtz.mjs.map +1 -0
- package/.output/server/chunks/build/{pages-D9tOoJsf.mjs → pages-Dfosfchr.mjs} +5 -6
- package/.output/server/chunks/build/pages-Dfosfchr.mjs.map +1 -0
- package/.output/server/chunks/build/{permissions-CxEgXic0.mjs → permissions-B-hhZuzm.mjs} +288 -194
- package/.output/server/chunks/build/permissions-B-hhZuzm.mjs.map +1 -0
- package/.output/server/chunks/build/{plugins-wLIKHcIE.mjs → plugins-DZR0T4Mh.mjs} +17 -17
- package/.output/server/chunks/build/{plugins-wLIKHcIE.mjs.map → plugins-DZR0T4Mh.mjs.map} +1 -1
- package/.output/server/chunks/build/popconfirm-CRaHcz5O.mjs +1 -1
- package/.output/server/chunks/build/{segmented-ChmQZwz6.mjs → segmented-LPPREMtZ.mjs} +336 -5
- package/.output/server/chunks/build/{segmented-ChmQZwz6.mjs.map → segmented-LPPREMtZ.mjs.map} +1 -1
- package/.output/server/chunks/build/{settings-BPBll_7K.mjs → settings-BajN9TQW.mjs} +254 -27
- package/.output/server/chunks/build/settings-BajN9TQW.mjs.map +1 -0
- package/.output/server/chunks/build/space-CCBYAkXt.mjs +1 -1
- package/.output/server/chunks/build/switch-CelRXpcy.mjs +1 -1
- package/.output/server/chunks/build/{table-BtksyDlQ.mjs → table-Bf1r2JjE.mjs} +5 -5
- package/.output/server/chunks/build/{table-BtksyDlQ.mjs.map → table-Bf1r2JjE.mjs.map} +1 -1
- package/.output/server/chunks/build/{tabs-DQv-_-R6.mjs → tabs-BM3tAh_J.mjs} +2 -2
- package/.output/server/chunks/build/{tabs-DQv-_-R6.mjs.map → tabs-BM3tAh_J.mjs.map} +1 -1
- package/.output/server/chunks/build/{tag-A0tZ2Ouq.mjs → tag-NO9jEqKy.mjs} +3 -3
- package/.output/server/chunks/build/{tag-A0tZ2Ouq.mjs.map → tag-NO9jEqKy.mjs.map} +1 -1
- package/.output/server/chunks/build/{teams-DD8ZXTKL.mjs → teams-t2SkRlJP.mjs} +349 -51
- package/.output/server/chunks/build/teams-t2SkRlJP.mjs.map +1 -0
- package/.output/server/chunks/build/{tokens-Dxnuw96_.mjs → tokens-DiCojbN8.mjs} +296 -200
- package/.output/server/chunks/build/tokens-DiCojbN8.mjs.map +1 -0
- package/.output/server/chunks/build/{town-Dsh0jlwZ.mjs → town-C7QM8DYK.mjs} +5 -5
- package/.output/server/chunks/build/{town-Dsh0jlwZ.mjs.map → town-C7QM8DYK.mjs.map} +1 -1
- package/.output/server/chunks/build/{useDaqStream-DkRL3tEW.mjs → useDaqStream-BeA2X8KR.mjs} +26 -11
- package/.output/server/chunks/build/useDaqStream-BeA2X8KR.mjs.map +1 -0
- package/.output/server/chunks/build/{useDcwStream-DyB2ufQI.mjs → useDcwStream-BJW_MitY.mjs} +14 -6
- package/.output/server/chunks/build/useDcwStream-BJW_MitY.mjs.map +1 -0
- package/.output/server/chunks/build/{useDeviceTwins-ZbT86L9O.mjs → useDeviceTwins-Dwz_EY_i.mjs} +2 -2
- package/.output/server/chunks/build/{useDeviceTwins-ZbT86L9O.mjs.map → useDeviceTwins-Dwz_EY_i.mjs.map} +1 -1
- package/.output/server/chunks/build/{useOpsLog-8HCYFb6n.mjs → useOpsLog-Dm8QEb1I.mjs} +2 -2
- package/.output/server/chunks/build/{useOpsLog-8HCYFb6n.mjs.map → useOpsLog-Dm8QEb1I.mjs.map} +1 -1
- package/.output/server/chunks/build/{useWorkshopApi-D2gq06N2.mjs → useWorkshopApi-B-L3MmIX.mjs} +9 -2
- package/.output/server/chunks/build/{useWorkshopApi-D2gq06N2.mjs.map → useWorkshopApi-B-L3MmIX.mjs.map} +1 -1
- package/.output/server/chunks/build/{users-D6RNylrW.mjs → users-B9SAdEtH.mjs} +12 -13
- package/.output/server/chunks/build/users-B9SAdEtH.mjs.map +1 -0
- package/.output/server/chunks/build/{workshop-CTcYDq2i.mjs → workshop-81xhz368.mjs} +21 -22
- package/.output/server/chunks/build/workshop-81xhz368.mjs.map +1 -0
- package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs +14 -2
- package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.put.mjs +40 -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/index4.get.mjs +21 -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/index5.get.mjs +33 -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/terminals.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels.post.mjs +15 -1
- 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 +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/bindings.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/test.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bindings.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index3.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index4.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index4.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index5.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index5.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index6.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs +1 -1
- package/.output/server/chunks/routes/renderer.mjs +3 -3
- package/.output/server/chunks/virtual/entry.mjs +381 -438
- package/.output/server/chunks/virtual/entry.mjs.map +1 -1
- package/.output/server/chunks/virtual/precomputed.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/app/app.vue +7 -0
- package/app/assets/css/main.css +12 -1
- package/app/components/workshop/DaqNodeRow.vue +398 -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/useCharacterAssets.ts +1 -0
- package/app/composables/workshop/useDaqStream.ts +24 -5
- package/app/composables/workshop/useDcwStream.ts +13 -4
- package/app/composables/workshop/useWorkshopApi.ts +294 -259
- package/app/pages/daq/[id].vue +27 -3
- package/app/pages/daq/index.vue +8 -355
- package/app/pages/monitor.vue +56 -68
- package/app/pages/permissions/index.vue +86 -82
- package/app/pages/plugins/index.vue +12 -7
- package/app/pages/settings.vue +253 -2
- package/app/pages/tokens.vue +94 -96
- package/app/pages/users.vue +10 -18
- package/app/pages/workshop/index.vue +34 -5
- package/app/pages/workshop/teams.vue +212 -2
- package/i18n/dicts/_en.json +361 -1
- package/i18n/dicts/plugins.json +10 -0
- package/i18n/dicts/settings.json +1 -0
- package/i18n/dicts/teamPlugins.json +10 -0
- package/i18n/locales/en.ts +1861 -1901
- package/i18n/locales/zh-CN.ts +1789 -1830
- package/package.json +149 -148
- package/public/assets/game/character/yangyang-walk.glb +0 -0
- package/scripts/_dbg-cpu-profile.mjs +53 -0
- package/scripts/_dbg-logs-ui-e2e.py +3 -2
- package/scripts/_dbg-render-perf.mjs +142 -0
- package/scripts/_dbg-render-regression.mjs +130 -0
- package/scripts/_dbg-ui-survey.py +52 -0
- package/scripts/i18n-merge.mjs +152 -30
- package/scripts/production-closed-loop-e2e.mjs +254 -0
- package/scripts/team-plugins-api-smoke.mjs +149 -0
- package/scripts/three-system-e2e.mjs +448 -0
- package/server/api/plugins/[name]/[...path].ts +46 -31
- 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/data/dcw-lines.json +14 -0
- package/server/data/dcw-products.json +14 -0
- package/server/data/dcw-recipes.json +23 -1
- package/server/data/dcw-rollback.json +585 -10
- package/server/data/dcw-runs.json +27 -27
- package/server/data/dcw-writes.json +96 -0
- package/server/data/dcws.json +394 -366
- package/server/data/scene-layouts.json +66 -0
- package/server/plugins/aw-plugins.ts +35 -27
- package/server/plugins-builtin/diag-bridge/index.mjs +556 -0
- package/server/plugins-builtin/rag-bridge/index.mjs +364 -0
- package/server/services/workshop/agents/host-tool-bridge.ts +659 -642
- package/server/services/workshop/agents/omp-agent.ts +1178 -1178
- package/server/services/workshop/agents/plugin-tools.ts +10 -1
- package/server/services/workshop/db/channel-plugins.repo.ts +65 -0
- package/server/services/workshop/plugins/host.mjs +52 -4
- package/server/services/workshop/runtime/manager.ts +2976 -2968
- package/shared/config/schema.json +4 -0
- package/.output/public/_nuxt/BJbhwS5o.js +0 -1
- package/.output/public/_nuxt/BUcmySDa2.js +0 -209
- package/.output/public/_nuxt/BWC4HQHQ.js +0 -1
- package/.output/public/_nuxt/BbZAzXjZ2.js +0 -1
- package/.output/public/_nuxt/BgOhoDTI.js +0 -1
- package/.output/public/_nuxt/Bo8t5fkJ.js +0 -1
- package/.output/public/_nuxt/BuiGDfMB.js +0 -1
- package/.output/public/_nuxt/BxPPAkGA.js +0 -3
- package/.output/public/_nuxt/C53drffV.js +0 -1
- package/.output/public/_nuxt/CcwJ2mrD2.js +0 -1
- package/.output/public/_nuxt/Cr9DkD1d.js +0 -1
- package/.output/public/_nuxt/DTYBfjRY.js +0 -1
- package/.output/public/_nuxt/DVoWWlUW.js +0 -1
- package/.output/public/_nuxt/Dc32T41C.js +0 -1
- package/.output/public/_nuxt/Dhqra7NB.js +0 -1
- package/.output/public/_nuxt/DlRO_q5L.js +0 -1
- package/.output/public/_nuxt/DsUUYP292.js +0 -1
- package/.output/public/_nuxt/Dsdy4Ua-.js +0 -1
- package/.output/public/_nuxt/DtzZqC0z.js +0 -1
- package/.output/public/_nuxt/Ko9mMsJj.js +0 -14
- package/.output/public/_nuxt/RzXYI9FM.js +0 -23
- package/.output/public/_nuxt/UtviM1bg.js +0 -1
- package/.output/public/_nuxt/_id_.C-YXjn8Q.css +0 -1
- package/.output/public/_nuxt/bAFueD6a.js +0 -1
- package/.output/public/_nuxt/builds/meta/1adc96e0-8bbd-4a79-ac7e-b6952556fef8.json +0 -1
- package/.output/public/_nuxt/daq.3OKj58HH.css +0 -1
- package/.output/public/_nuxt/dbi5bHkY.js +0 -2
- package/.output/public/_nuxt/eHYnGew0.js +0 -19
- package/.output/public/_nuxt/entry.OR_psZHp.css +0 -1
- package/.output/public/_nuxt/jyQyulh-.js +0 -1
- package/.output/public/_nuxt/monitor.CmwpEUCI.css +0 -1
- package/.output/public/_nuxt/permissions.DTRtZeTw.css +0 -1
- package/.output/public/_nuxt/plugins.BcSEwwGb.css +0 -1
- package/.output/public/_nuxt/settings.BqMF2nfj.css +0 -1
- package/.output/public/_nuxt/teams.DN0pAGGu.css +0 -1
- package/.output/public/_nuxt/tokens.BVXU1jOK.css +0 -1
- package/.output/public/_nuxt/users.D8lcLE62.css +0 -1
- package/.output/public/_nuxt/workshop.CbymC2LY.css +0 -1
- package/.output/public/_nuxt/zVkqCZ78.js +0 -1
- package/.output/server/chunks/build/Col-biaNnEPf.mjs +0 -338
- package/.output/server/chunks/build/Col-biaNnEPf.mjs.map +0 -1
- package/.output/server/chunks/build/agents--6bzGtES.mjs.map +0 -1
- package/.output/server/chunks/build/channel-templates-C1Bb-U75.mjs.map +0 -1
- package/.output/server/chunks/build/daq-B-3xCp_2.mjs.map +0 -1
- package/.output/server/chunks/build/hasIn-vQ9LWt-J.mjs +0 -554
- package/.output/server/chunks/build/hasIn-vQ9LWt-J.mjs.map +0 -1
- package/.output/server/chunks/build/input-DxDqeyQW.mjs.map +0 -1
- package/.output/server/chunks/build/monitor-miqq9xHB.mjs.map +0 -1
- package/.output/server/chunks/build/pages-D9tOoJsf.mjs.map +0 -1
- package/.output/server/chunks/build/permissions-CxEgXic0.mjs.map +0 -1
- package/.output/server/chunks/build/settings-BPBll_7K.mjs.map +0 -1
- package/.output/server/chunks/build/teams-DD8ZXTKL.mjs.map +0 -1
- package/.output/server/chunks/build/tokens-Dxnuw96_.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/useSiteConfig-DJe_KMVr.mjs +0 -27
- package/.output/server/chunks/build/useSiteConfig-DJe_KMVr.mjs.map +0 -1
- package/.output/server/chunks/build/users-D6RNylrW.mjs.map +0 -1
- package/.output/server/chunks/build/workshop-CTcYDq2i.mjs.map +0 -1
- /package/.output/public/_nuxt/{CNs_Ozdc.js → CNs_Ozdc2.js} +0 -0
- /package/.output/public/_nuxt/{Cno6kYiO.js → Cno6kYiO2.js} +0 -0
- /package/.output/public/_nuxt/{ORt9oDIy2.js → ORt9oDIy.js} +0 -0
|
@@ -1,259 +1,294 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workshop API 类型化封装(P0 面:channels/agents/tasks/messages/memories/queue/runtime)。
|
|
3
|
-
* 统一走 $http(Bearer cookie 注入 + envelope 解包);错误由拦截器统一 toast。
|
|
4
|
-
*/
|
|
5
|
-
import type { AepSnapshot } from '#shared/workshop-protocol'
|
|
6
|
-
|
|
7
|
-
export interface ChannelDto {
|
|
8
|
-
id: string
|
|
9
|
-
name: string
|
|
10
|
-
description?: string
|
|
11
|
-
/** channel 级默认 LLM JSON(透传 llmJson;前端解析) */
|
|
12
|
-
llmJson?: string
|
|
13
|
-
/** channel 级作业场景 prompt(设置弹窗可编辑) */
|
|
14
|
-
scenarioPrompt?: string
|
|
15
|
-
leadAgentId: string | null
|
|
16
|
-
workspace?: string
|
|
17
|
-
enabled: number
|
|
18
|
-
/** 归属用户(null = 遗留公共) */
|
|
19
|
-
ownerUserId?: string | null
|
|
20
|
-
createdAt: string
|
|
21
|
-
updatedAt: string
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface AgentInfoDto {
|
|
25
|
-
id: string
|
|
26
|
-
channelId: string
|
|
27
|
-
name: string
|
|
28
|
-
harness: string
|
|
29
|
-
role: 'lead' | 'worker'
|
|
30
|
-
config: Record<string, unknown>
|
|
31
|
-
token?: string
|
|
32
|
-
/** 实例启停(1 启用 / 0 禁用) */
|
|
33
|
-
enabled?: number
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/** harness 注册表元信息(GET /workshop/harnesses;含环境可用性探测结果) */
|
|
37
|
-
export interface HarnessMetaDto {
|
|
38
|
-
id: string
|
|
39
|
-
label: string
|
|
40
|
-
description: string
|
|
41
|
-
capabilities: {
|
|
42
|
-
steer: boolean
|
|
43
|
-
supervise: boolean
|
|
44
|
-
hitl: boolean
|
|
45
|
-
terminal: boolean
|
|
46
|
-
contextStats: boolean
|
|
47
|
-
compact: boolean
|
|
48
|
-
}
|
|
49
|
-
/** 环境探测:引擎可立即使用(进程内引擎恒 true;进程型引擎 = CLI 在 PATH 中) */
|
|
50
|
-
available?: boolean
|
|
51
|
-
/** 进程内引擎(无外部 CLI) */
|
|
52
|
-
inprocess?: boolean
|
|
53
|
-
/** 进程型引擎声明将拉起的命令 */
|
|
54
|
-
command?: string | null
|
|
55
|
-
/** PATH 解析出的可执行文件绝对路径 */
|
|
56
|
-
resolvedPath?: string | null
|
|
57
|
-
/** 不可用原因(available=false 时的人话提示) */
|
|
58
|
-
error?: string | null
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface TaskDto {
|
|
62
|
-
id: string
|
|
63
|
-
channelId: string
|
|
64
|
-
parentId?: string
|
|
65
|
-
assigneeId: string
|
|
66
|
-
title: string
|
|
67
|
-
description?: string
|
|
68
|
-
state: string
|
|
69
|
-
progress: number
|
|
70
|
-
/** 派发路由理由(lead 留痕的审计决策) */
|
|
71
|
-
routeReason?: string
|
|
72
|
-
artifacts: Array<{ artifactId: string, name?: string, parts: Array<{ text?: string }> }>
|
|
73
|
-
createdAt: string
|
|
74
|
-
updatedAt: string
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface MemoryRowDto {
|
|
78
|
-
id: string
|
|
79
|
-
channelId: string
|
|
80
|
-
agentId: string
|
|
81
|
-
kind: string
|
|
82
|
-
title: string
|
|
83
|
-
content: string
|
|
84
|
-
importance: number
|
|
85
|
-
accessCount: number
|
|
86
|
-
createdAt: string
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface MemorySnippetDto {
|
|
90
|
-
id: string
|
|
91
|
-
kind: string
|
|
92
|
-
title: string
|
|
93
|
-
content: string
|
|
94
|
-
importance: number
|
|
95
|
-
createdAt: string
|
|
96
|
-
score: number
|
|
97
|
-
source: 'private' | 'shared'
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export function useWorkshopApi() {
|
|
101
|
-
const http = useHttp()
|
|
102
|
-
|
|
103
|
-
return {
|
|
104
|
-
// channels
|
|
105
|
-
listChannels: () => http.get<{ data: ChannelDto[] }>('/workshop/channels'),
|
|
106
|
-
createChannel: (body: { name: string, description?: string, scenarioPrompt?: string, workspace?: string, leadAgent?: { name: string, harness: string, config?: Record<string, unknown> } }) =>
|
|
107
|
-
http.post<{ data: { channelId: string, leadAgentId?: string, workspace: string } }>('/workshop/channels', body),
|
|
108
|
-
deleteChannel: (id: string) => http.delete<{ data: unknown }>(`/workshop/channels/${id}`),
|
|
109
|
-
/** 修改 Channel 实例设置(场景 prompt / 工作目录热更新;成员运行时自动回收重装配) */
|
|
110
|
-
patchChannel: (id: string, body: { name?: string, description?: string, scenarioPrompt?: string, workspace?: string, enabled?: number }) =>
|
|
111
|
-
http.request<{ data: ChannelDto }>({ method: 'PATCH', url: `/workshop/channels/${id}`, data: body }),
|
|
112
|
-
// channel agents
|
|
113
|
-
listChannelAgents: (id: string) => http.get<{ data: AgentInfoDto[] }>(`/workshop/channels/${id}/agents`),
|
|
114
|
-
addChannelAgent: (id: string, body: { agentId?: string, name?: string, harness?: string, role?: 'lead' | 'worker', config?: Record<string, unknown> }) =>
|
|
115
|
-
http.post<{ data: AgentInfoDto }>(`/workshop/channels/${id}/agents`, body),
|
|
116
|
-
updateChannelAgent: (id: string, agentId: string, body: { name?: string, config?: Record<string, unknown>, enabled?: 0 | 1, reason?: string }) =>
|
|
117
|
-
http.request<{ data: { agentId: string, name: string } }>({ method: 'PATCH', url: `/workshop/channels/${id}/agents/${agentId}`, data: body }),
|
|
118
|
-
removeChannelAgent: (id: string, agentId: string) => http.delete<{ data: unknown }>(`/workshop/channels/${id}/agents/${agentId}`),
|
|
119
|
-
/** HITL:独立中断指定成员运行时(worker/lead 均可;lead 停止同时停调度,下次任务提交自动重激活) */
|
|
120
|
-
stopChannelAgent: (id: string, agentId: string) =>
|
|
121
|
-
http.post<{ data: { agentId: string, stopped: boolean } }>(`/workshop/channels/${id}/agents/${agentId}/stop`, {}),
|
|
122
|
-
// tasks
|
|
123
|
-
listTasks: (id: string) => http.get<{ data: TaskDto[] }>(`/workshop/channels/${id}/tasks`),
|
|
124
|
-
submitTask: (id: string, body: { title: string, description?: string, mode?: 'goal' | 'loop' | 'pipeline', modeConfig?: Record<string, unknown>, assigneeId?: string, fromLabel?: string, parts?: Array<{ text: string }> }) =>
|
|
125
|
-
http.post<{ data: TaskDto }>(`/workshop/channels/${id}/tasks`, body),
|
|
126
|
-
// messages(注入即时消息/队列消息;fromLabel = 人类发送者显示名)
|
|
127
|
-
injectMessage: (id: string, body: { toAgentId: string, text: string, priority?: 'immediate' | 'task', requireReply?: boolean, fromLabel?: string }) =>
|
|
128
|
-
http.post<{ data: unknown }>(`/workshop/channels/${id}/messages`, body),
|
|
129
|
-
// memories
|
|
130
|
-
listAgentMemories: (id: string, agentId: string) => http.get<{ data: MemoryRowDto[] }>(`/workshop/channels/${id}/agents/${agentId}/memories`),
|
|
131
|
-
searchMemories: (id: string, agentId: string, body: { query: string, scope?: 'auto' | 'private' | 'shared', limit?: number }) =>
|
|
132
|
-
http.post<{ data: MemorySnippetDto[] }>(`/workshop/channels/${id}/agents/${agentId}/memories/search`, body),
|
|
133
|
-
saveMemory: (id: string, agentId: string, body: { title: string, content: string, importance?: number, dedupKey?: string, scope?: 'private' | 'shared' }) =>
|
|
134
|
-
http.post<{ data: unknown }>(`/workshop/channels/${id}/agents/${agentId}/memories`, body),
|
|
135
|
-
listTeamMemories: (id: string) => http.get<{ data: MemoryRowDto[] }>(`/workshop/channels/${id}/memories`),
|
|
136
|
-
// queue / runtime
|
|
137
|
-
queueOverview: (id: string) => http.get<{ data: Array<{ agentId: string, name: string, state: string, currentTaskId: string | null, queuedCount: number, completedCount: number }> }>(`/workshop/channels/${id}/queue`),
|
|
138
|
-
runtimeStatus: () => http.get<{ data: { wiredAgents: string[], activeChannels: string[] } }>('/workshop/runtime'),
|
|
139
|
-
/** harness 注册表(引擎下拉/能力徽标;与 factory/manager 校验同源) */
|
|
140
|
-
listHarnesses: () => http.get<{ data: { harnesses: HarnessMetaDto[] } }>('/workshop/harnesses'),
|
|
141
|
-
/** harness 已配置的 LLM provider/model 目录(引擎官方目录面,5 分钟缓存) */
|
|
142
|
-
listHarnessProviders: (harness: string) =>
|
|
143
|
-
http.get<{ data: { catalog: { providers: Array<{ id: string, models: Array<{ id: string, efforts: string[], defaultEffort?: string }> }>, effortMode: 'levels' | 'freetext' | 'unsupported', note?: string } } }>(`/workshop/harnesses/${harness}/providers`),
|
|
144
|
-
// tasks detail / lifecycle(P1 抽屉)
|
|
145
|
-
getTask: (taskId: string) => http.get<{ data: TaskDto }>(`/workshop/tasks/${taskId}`),
|
|
146
|
-
cancelTask: (taskId: string) => http.post<{ data: TaskDto }>(`/workshop/tasks/${taskId}/cancel`, {}),
|
|
147
|
-
/** HITL:重试 FAILED 任务(优先原 assignee,否则队列最短空闲 worker) */
|
|
148
|
-
retryTask: (taskId: string) => http.post<{ data: TaskDto }>(`/workshop/tasks/${taskId}/retry`, {}),
|
|
149
|
-
/** HITL:统一应答路由(omp-dialog/dcw-approval/codex-approval/opencode-permission/dsh-permission) */
|
|
150
|
-
respondHitl: (body: { kind: string, id: string, confirmed?: boolean, cancelled?: boolean, value?: string, response?: string, comment?: string }) =>
|
|
151
|
-
http.post<{ data: { ok: boolean, kind: string, id: string } }>('/workshop/hitl/respond', body),
|
|
152
|
-
// agent 模板库(P1;v10 用户隔离:private 仅本人,public 全员可用,内置只读)
|
|
153
|
-
listTemplates: () => http.get<{ data: AgentTemplateDto[] }>('/workshop/agents'),
|
|
154
|
-
createTemplate: (body: { name: string, harness: string, config?: Record<string, unknown>, visibility?: 'private' | 'public' }) =>
|
|
155
|
-
http.post<{ data: AgentTemplateDto }>('/workshop/agents', body),
|
|
156
|
-
updateTemplate: (id: string, body: { name?: string, harness?: string, config?: Record<string, unknown>, enabled?: number, visibility?: 'private' | 'public' }) =>
|
|
157
|
-
http.request<{ data: AgentTemplateDto }>({ method: 'PATCH', url: `/workshop/agents/${id}`, data: body }),
|
|
158
|
-
deleteTemplate: (id: string) => http.delete<{ data: unknown }>(`/workshop/agents/${id}`),
|
|
159
|
-
// teams(P1 编组库;v10 可见性)
|
|
160
|
-
listTeams: () => http.get<{ data: TeamDto[] }>('/workshop/teams'),
|
|
161
|
-
createTeam: (body: { name: string, description?: string, visibility?: 'private' | 'public' }) => http.post<{ data: TeamDto }>('/workshop/teams', body),
|
|
162
|
-
updateTeam: (id: string, body: { name?: string, description?: string, visibility?: 'private' | 'public' }) =>
|
|
163
|
-
http.request<{ data: TeamDto }>({ method: 'PATCH', url: `/workshop/teams/${id}`, data: body }),
|
|
164
|
-
deleteTeam: (id: string) => http.delete<{ data: unknown }>(`/workshop/teams/${id}`),
|
|
165
|
-
addTeamMember: (id: string, body: { agentId: string, role?: 'lead' | 'worker' }) =>
|
|
166
|
-
http.post<{ data: TeamDto }>(`/workshop/teams/${id}/members`, body),
|
|
167
|
-
removeTeamMember: (id: string, templateId: string) => http.delete<{ data: TeamDto }>(`/workshop/teams/${id}/members/${templateId}`),
|
|
168
|
-
deployTeam: (teamId: string, channelId: string) => http.post<{ data: unknown }>(`/workshop/teams/${teamId}/deploy`, { channelId }),
|
|
169
|
-
// channel 模板库(v10:场景 + 工作目录 + 成员组合;实例化一键建 channel)
|
|
170
|
-
listChannelTemplates: () => http.get<{ data: ChannelTemplateDto[] }>('/workshop/channel-templates'),
|
|
171
|
-
createChannelTemplate: (body: { name: string, description?: string, scenarioPrompt?: string, workspace?: string, lead?: ChannelTemplateDto['lead'], members?: ChannelTemplateMemberDto[], visibility?: 'private' | 'public' }) =>
|
|
172
|
-
http.post<{ data: ChannelTemplateDto }>('/workshop/channel-templates', body),
|
|
173
|
-
captureChannelTemplate: (body: { channelId: string, name: string, description?: string, visibility?: 'private' | 'public' }) =>
|
|
174
|
-
http.post<{ data: ChannelTemplateDto }>('/workshop/channel-templates/from-channel', body),
|
|
175
|
-
updateChannelTemplate: (id: string, body: { name?: string, description?: string, scenarioPrompt?: string, workspace?: string, visibility?: 'private' | 'public' }) =>
|
|
176
|
-
http.request<{ data: ChannelTemplateDto }>({ method: 'PATCH', url: `/workshop/channel-templates/${id}`, data: body }),
|
|
177
|
-
deleteChannelTemplate: (id: string) => http.delete<{ data: unknown }>(`/workshop/channel-templates/${id}`),
|
|
178
|
-
instantiateChannelTemplate: (id: string, name?: string) =>
|
|
179
|
-
http.post<{ data: { channelId: string, workspace: string, agentCount: number, leadAgentId?: string } }>(`/workshop/channel-templates/${id}/instantiate`, { name }),
|
|
180
|
-
/** 从 Channel 模板实例化并挂载到 workspace(替代"挂载已有 Channel") */
|
|
181
|
-
mountChannelTemplate: (wsId: string, tplId: string, name?: string) =>
|
|
182
|
-
http.post<{ data: { channelId: string, workspace: string, agentCount: number, leadAgentId?: string } }>(`/workshop/workspaces/${wsId}/channel-templates/${tplId}`, { name }),
|
|
183
|
-
// channel 成员的 harness 终端会话(rpc-ui 镜像;lanes 控制面板数据源)
|
|
184
|
-
listChannelTerminals: (id: string) => http.get<{ data: TerminalSessionDto[] }>(`/workshop/channels/${id}/terminals`),
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Workshop API 类型化封装(P0 面:channels/agents/tasks/messages/memories/queue/runtime)。
|
|
3
|
+
* 统一走 $http(Bearer cookie 注入 + envelope 解包);错误由拦截器统一 toast。
|
|
4
|
+
*/
|
|
5
|
+
import type { AepSnapshot } from '#shared/workshop-protocol'
|
|
6
|
+
|
|
7
|
+
export interface ChannelDto {
|
|
8
|
+
id: string
|
|
9
|
+
name: string
|
|
10
|
+
description?: string
|
|
11
|
+
/** channel 级默认 LLM JSON(透传 llmJson;前端解析) */
|
|
12
|
+
llmJson?: string
|
|
13
|
+
/** channel 级作业场景 prompt(设置弹窗可编辑) */
|
|
14
|
+
scenarioPrompt?: string
|
|
15
|
+
leadAgentId: string | null
|
|
16
|
+
workspace?: string
|
|
17
|
+
enabled: number
|
|
18
|
+
/** 归属用户(null = 遗留公共) */
|
|
19
|
+
ownerUserId?: string | null
|
|
20
|
+
createdAt: string
|
|
21
|
+
updatedAt: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface AgentInfoDto {
|
|
25
|
+
id: string
|
|
26
|
+
channelId: string
|
|
27
|
+
name: string
|
|
28
|
+
harness: string
|
|
29
|
+
role: 'lead' | 'worker'
|
|
30
|
+
config: Record<string, unknown>
|
|
31
|
+
token?: string
|
|
32
|
+
/** 实例启停(1 启用 / 0 禁用) */
|
|
33
|
+
enabled?: number
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** harness 注册表元信息(GET /workshop/harnesses;含环境可用性探测结果) */
|
|
37
|
+
export interface HarnessMetaDto {
|
|
38
|
+
id: string
|
|
39
|
+
label: string
|
|
40
|
+
description: string
|
|
41
|
+
capabilities: {
|
|
42
|
+
steer: boolean
|
|
43
|
+
supervise: boolean
|
|
44
|
+
hitl: boolean
|
|
45
|
+
terminal: boolean
|
|
46
|
+
contextStats: boolean
|
|
47
|
+
compact: boolean
|
|
48
|
+
}
|
|
49
|
+
/** 环境探测:引擎可立即使用(进程内引擎恒 true;进程型引擎 = CLI 在 PATH 中) */
|
|
50
|
+
available?: boolean
|
|
51
|
+
/** 进程内引擎(无外部 CLI) */
|
|
52
|
+
inprocess?: boolean
|
|
53
|
+
/** 进程型引擎声明将拉起的命令 */
|
|
54
|
+
command?: string | null
|
|
55
|
+
/** PATH 解析出的可执行文件绝对路径 */
|
|
56
|
+
resolvedPath?: string | null
|
|
57
|
+
/** 不可用原因(available=false 时的人话提示) */
|
|
58
|
+
error?: string | null
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface TaskDto {
|
|
62
|
+
id: string
|
|
63
|
+
channelId: string
|
|
64
|
+
parentId?: string
|
|
65
|
+
assigneeId: string
|
|
66
|
+
title: string
|
|
67
|
+
description?: string
|
|
68
|
+
state: string
|
|
69
|
+
progress: number
|
|
70
|
+
/** 派发路由理由(lead 留痕的审计决策) */
|
|
71
|
+
routeReason?: string
|
|
72
|
+
artifacts: Array<{ artifactId: string, name?: string, parts: Array<{ text?: string }> }>
|
|
73
|
+
createdAt: string
|
|
74
|
+
updatedAt: string
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface MemoryRowDto {
|
|
78
|
+
id: string
|
|
79
|
+
channelId: string
|
|
80
|
+
agentId: string
|
|
81
|
+
kind: string
|
|
82
|
+
title: string
|
|
83
|
+
content: string
|
|
84
|
+
importance: number
|
|
85
|
+
accessCount: number
|
|
86
|
+
createdAt: string
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface MemorySnippetDto {
|
|
90
|
+
id: string
|
|
91
|
+
kind: string
|
|
92
|
+
title: string
|
|
93
|
+
content: string
|
|
94
|
+
importance: number
|
|
95
|
+
createdAt: string
|
|
96
|
+
score: number
|
|
97
|
+
source: 'private' | 'shared'
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function useWorkshopApi() {
|
|
101
|
+
const http = useHttp()
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
// channels
|
|
105
|
+
listChannels: () => http.get<{ data: ChannelDto[] }>('/workshop/channels'),
|
|
106
|
+
createChannel: (body: { name: string, description?: string, scenarioPrompt?: string, workspace?: string, leadAgent?: { name: string, harness: string, config?: Record<string, unknown> } }) =>
|
|
107
|
+
http.post<{ data: { channelId: string, leadAgentId?: string, workspace: string } }>('/workshop/channels', body),
|
|
108
|
+
deleteChannel: (id: string) => http.delete<{ data: unknown }>(`/workshop/channels/${id}`),
|
|
109
|
+
/** 修改 Channel 实例设置(场景 prompt / 工作目录热更新;成员运行时自动回收重装配) */
|
|
110
|
+
patchChannel: (id: string, body: { name?: string, description?: string, scenarioPrompt?: string, workspace?: string, enabled?: number }) =>
|
|
111
|
+
http.request<{ data: ChannelDto }>({ method: 'PATCH', url: `/workshop/channels/${id}`, data: body }),
|
|
112
|
+
// channel agents
|
|
113
|
+
listChannelAgents: (id: string) => http.get<{ data: AgentInfoDto[] }>(`/workshop/channels/${id}/agents`),
|
|
114
|
+
addChannelAgent: (id: string, body: { agentId?: string, name?: string, harness?: string, role?: 'lead' | 'worker', config?: Record<string, unknown> }) =>
|
|
115
|
+
http.post<{ data: AgentInfoDto }>(`/workshop/channels/${id}/agents`, body),
|
|
116
|
+
updateChannelAgent: (id: string, agentId: string, body: { name?: string, config?: Record<string, unknown>, enabled?: 0 | 1, reason?: string }) =>
|
|
117
|
+
http.request<{ data: { agentId: string, name: string } }>({ method: 'PATCH', url: `/workshop/channels/${id}/agents/${agentId}`, data: body }),
|
|
118
|
+
removeChannelAgent: (id: string, agentId: string) => http.delete<{ data: unknown }>(`/workshop/channels/${id}/agents/${agentId}`),
|
|
119
|
+
/** HITL:独立中断指定成员运行时(worker/lead 均可;lead 停止同时停调度,下次任务提交自动重激活) */
|
|
120
|
+
stopChannelAgent: (id: string, agentId: string) =>
|
|
121
|
+
http.post<{ data: { agentId: string, stopped: boolean } }>(`/workshop/channels/${id}/agents/${agentId}/stop`, {}),
|
|
122
|
+
// tasks
|
|
123
|
+
listTasks: (id: string) => http.get<{ data: TaskDto[] }>(`/workshop/channels/${id}/tasks`),
|
|
124
|
+
submitTask: (id: string, body: { title: string, description?: string, mode?: 'goal' | 'loop' | 'pipeline', modeConfig?: Record<string, unknown>, assigneeId?: string, fromLabel?: string, parts?: Array<{ text: string }> }) =>
|
|
125
|
+
http.post<{ data: TaskDto }>(`/workshop/channels/${id}/tasks`, body),
|
|
126
|
+
// messages(注入即时消息/队列消息;fromLabel = 人类发送者显示名)
|
|
127
|
+
injectMessage: (id: string, body: { toAgentId: string, text: string, priority?: 'immediate' | 'task', requireReply?: boolean, fromLabel?: string }) =>
|
|
128
|
+
http.post<{ data: unknown }>(`/workshop/channels/${id}/messages`, body),
|
|
129
|
+
// memories
|
|
130
|
+
listAgentMemories: (id: string, agentId: string) => http.get<{ data: MemoryRowDto[] }>(`/workshop/channels/${id}/agents/${agentId}/memories`),
|
|
131
|
+
searchMemories: (id: string, agentId: string, body: { query: string, scope?: 'auto' | 'private' | 'shared', limit?: number }) =>
|
|
132
|
+
http.post<{ data: MemorySnippetDto[] }>(`/workshop/channels/${id}/agents/${agentId}/memories/search`, body),
|
|
133
|
+
saveMemory: (id: string, agentId: string, body: { title: string, content: string, importance?: number, dedupKey?: string, scope?: 'private' | 'shared' }) =>
|
|
134
|
+
http.post<{ data: unknown }>(`/workshop/channels/${id}/agents/${agentId}/memories`, body),
|
|
135
|
+
listTeamMemories: (id: string) => http.get<{ data: MemoryRowDto[] }>(`/workshop/channels/${id}/memories`),
|
|
136
|
+
// queue / runtime
|
|
137
|
+
queueOverview: (id: string) => http.get<{ data: Array<{ agentId: string, name: string, state: string, currentTaskId: string | null, queuedCount: number, completedCount: number }> }>(`/workshop/channels/${id}/queue`),
|
|
138
|
+
runtimeStatus: () => http.get<{ data: { wiredAgents: string[], activeChannels: string[] } }>('/workshop/runtime'),
|
|
139
|
+
/** harness 注册表(引擎下拉/能力徽标;与 factory/manager 校验同源) */
|
|
140
|
+
listHarnesses: () => http.get<{ data: { harnesses: HarnessMetaDto[] } }>('/workshop/harnesses'),
|
|
141
|
+
/** harness 已配置的 LLM provider/model 目录(引擎官方目录面,5 分钟缓存) */
|
|
142
|
+
listHarnessProviders: (harness: string) =>
|
|
143
|
+
http.get<{ data: { catalog: { providers: Array<{ id: string, models: Array<{ id: string, efforts: string[], defaultEffort?: string }> }>, effortMode: 'levels' | 'freetext' | 'unsupported', note?: string } } }>(`/workshop/harnesses/${harness}/providers`),
|
|
144
|
+
// tasks detail / lifecycle(P1 抽屉)
|
|
145
|
+
getTask: (taskId: string) => http.get<{ data: TaskDto }>(`/workshop/tasks/${taskId}`),
|
|
146
|
+
cancelTask: (taskId: string) => http.post<{ data: TaskDto }>(`/workshop/tasks/${taskId}/cancel`, {}),
|
|
147
|
+
/** HITL:重试 FAILED 任务(优先原 assignee,否则队列最短空闲 worker) */
|
|
148
|
+
retryTask: (taskId: string) => http.post<{ data: TaskDto }>(`/workshop/tasks/${taskId}/retry`, {}),
|
|
149
|
+
/** HITL:统一应答路由(omp-dialog/dcw-approval/codex-approval/opencode-permission/dsh-permission) */
|
|
150
|
+
respondHitl: (body: { kind: string, id: string, confirmed?: boolean, cancelled?: boolean, value?: string, response?: string, comment?: string }) =>
|
|
151
|
+
http.post<{ data: { ok: boolean, kind: string, id: string } }>('/workshop/hitl/respond', body),
|
|
152
|
+
// agent 模板库(P1;v10 用户隔离:private 仅本人,public 全员可用,内置只读)
|
|
153
|
+
listTemplates: () => http.get<{ data: AgentTemplateDto[] }>('/workshop/agents'),
|
|
154
|
+
createTemplate: (body: { name: string, harness: string, config?: Record<string, unknown>, visibility?: 'private' | 'public' }) =>
|
|
155
|
+
http.post<{ data: AgentTemplateDto }>('/workshop/agents', body),
|
|
156
|
+
updateTemplate: (id: string, body: { name?: string, harness?: string, config?: Record<string, unknown>, enabled?: number, visibility?: 'private' | 'public' }) =>
|
|
157
|
+
http.request<{ data: AgentTemplateDto }>({ method: 'PATCH', url: `/workshop/agents/${id}`, data: body }),
|
|
158
|
+
deleteTemplate: (id: string) => http.delete<{ data: unknown }>(`/workshop/agents/${id}`),
|
|
159
|
+
// teams(P1 编组库;v10 可见性)
|
|
160
|
+
listTeams: () => http.get<{ data: TeamDto[] }>('/workshop/teams'),
|
|
161
|
+
createTeam: (body: { name: string, description?: string, visibility?: 'private' | 'public', plugins?: Array<{ name: string, enabled: boolean }> }) => http.post<{ data: TeamDto }>('/workshop/teams', body),
|
|
162
|
+
updateTeam: (id: string, body: { name?: string, description?: string, visibility?: 'private' | 'public' }) =>
|
|
163
|
+
http.request<{ data: TeamDto }>({ method: 'PATCH', url: `/workshop/teams/${id}`, data: body }),
|
|
164
|
+
deleteTeam: (id: string) => http.delete<{ data: unknown }>(`/workshop/teams/${id}`),
|
|
165
|
+
addTeamMember: (id: string, body: { agentId: string, role?: 'lead' | 'worker' }) =>
|
|
166
|
+
http.post<{ data: TeamDto }>(`/workshop/teams/${id}/members`, body),
|
|
167
|
+
removeTeamMember: (id: string, templateId: string) => http.delete<{ data: TeamDto }>(`/workshop/teams/${id}/members/${templateId}`),
|
|
168
|
+
deployTeam: (teamId: string, channelId: string) => http.post<{ data: unknown }>(`/workshop/teams/${teamId}/deploy`, { channelId }),
|
|
169
|
+
// channel 模板库(v10:场景 + 工作目录 + 成员组合;实例化一键建 channel)
|
|
170
|
+
listChannelTemplates: () => http.get<{ data: ChannelTemplateDto[] }>('/workshop/channel-templates'),
|
|
171
|
+
createChannelTemplate: (body: { name: string, description?: string, scenarioPrompt?: string, workspace?: string, lead?: ChannelTemplateDto['lead'], members?: ChannelTemplateMemberDto[], visibility?: 'private' | 'public' }) =>
|
|
172
|
+
http.post<{ data: ChannelTemplateDto }>('/workshop/channel-templates', body),
|
|
173
|
+
captureChannelTemplate: (body: { channelId: string, name: string, description?: string, visibility?: 'private' | 'public' }) =>
|
|
174
|
+
http.post<{ data: ChannelTemplateDto }>('/workshop/channel-templates/from-channel', body),
|
|
175
|
+
updateChannelTemplate: (id: string, body: { name?: string, description?: string, scenarioPrompt?: string, workspace?: string, visibility?: 'private' | 'public' }) =>
|
|
176
|
+
http.request<{ data: ChannelTemplateDto }>({ method: 'PATCH', url: `/workshop/channel-templates/${id}`, data: body }),
|
|
177
|
+
deleteChannelTemplate: (id: string) => http.delete<{ data: unknown }>(`/workshop/channel-templates/${id}`),
|
|
178
|
+
instantiateChannelTemplate: (id: string, name?: string) =>
|
|
179
|
+
http.post<{ data: { channelId: string, workspace: string, agentCount: number, leadAgentId?: string } }>(`/workshop/channel-templates/${id}/instantiate`, { name }),
|
|
180
|
+
/** 从 Channel 模板实例化并挂载到 workspace(替代"挂载已有 Channel") */
|
|
181
|
+
mountChannelTemplate: (wsId: string, tplId: string, name?: string) =>
|
|
182
|
+
http.post<{ data: { channelId: string, workspace: string, agentCount: number, leadAgentId?: string } }>(`/workshop/workspaces/${wsId}/channel-templates/${tplId}`, { name }),
|
|
183
|
+
// channel 成员的 harness 终端会话(rpc-ui 镜像;lanes 控制面板数据源)
|
|
184
|
+
listChannelTerminals: (id: string) => http.get<{ data: TerminalSessionDto[] }>(`/workshop/channels/${id}/terminals`),
|
|
185
|
+
// plugins(插件管理:清单为顶层 plugins key,非信封;启停 admin + 热重载;健康走插件自注册 /health)
|
|
186
|
+
listPlugins: () => http.get<{ plugins?: WorkshopPluginDto[], data?: { plugins?: WorkshopPluginDto[] } }>('/workshop/plugins'),
|
|
187
|
+
enablePlugin: (name: string) => http.post<{ data?: { ok?: boolean, enabled?: boolean } }>(`/workshop/plugins/${name}/enable`, {}),
|
|
188
|
+
disablePlugin: (name: string) => http.post<{ data?: { ok?: boolean, enabled?: boolean } }>(`/workshop/plugins/${name}/disable`, {}),
|
|
189
|
+
/** 插件健康检测(原始返回,非信封:rag-bridge 看 backend.ok && web.ok,diag-bridge 看 remote.status==='ok') */
|
|
190
|
+
pluginHealth: (name: string) => http.get<Record<string, unknown>>(`/plugins/${name}/health`),
|
|
191
|
+
// 团队(Channel)级插件开关(channel_plugins 表;source=default 表示未显式配置,默认全启用)
|
|
192
|
+
listChannelPlugins: (id: string) =>
|
|
193
|
+
http.get<{ data?: { plugins?: ChannelPluginStateDto[], source?: 'explicit' | 'default' } }>(`/workshop/channels/${id}/plugins`),
|
|
194
|
+
putChannelPlugins: (id: string, body: { plugins: Array<{ name: string, enabled: boolean }> }) =>
|
|
195
|
+
http.put<{ data?: { plugins?: ChannelPluginStateDto[], source?: 'explicit' | 'default' } }>(`/workshop/channels/${id}/plugins`, body),
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** 平台插件清单条目(GET /workshop/plugins;顶层 plugins key,兼容 {code,data} 信封) */
|
|
200
|
+
export interface WorkshopPluginDto {
|
|
201
|
+
name: string
|
|
202
|
+
version?: string
|
|
203
|
+
description?: string
|
|
204
|
+
scope?: string
|
|
205
|
+
/** 内置插件(桥接插件) */
|
|
206
|
+
builtin?: boolean
|
|
207
|
+
enabled?: boolean
|
|
208
|
+
hasClient?: boolean
|
|
209
|
+
routes?: Array<{ method: string, path: string }>
|
|
210
|
+
/** 装载失败原因 */
|
|
211
|
+
error?: string | null
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/** 团队(Channel)插件开关条目(GET/PUT /workshop/channels/:id/plugins) */
|
|
215
|
+
export interface ChannelPluginStateDto {
|
|
216
|
+
name: string
|
|
217
|
+
description?: string
|
|
218
|
+
builtin?: boolean
|
|
219
|
+
/** 该团队对此插件的开关 */
|
|
220
|
+
enabled: boolean
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/** harness 终端会话视图(GET /workshop/channels/:id/terminals) */
|
|
224
|
+
export interface TerminalSessionDto {
|
|
225
|
+
pid: number
|
|
226
|
+
agentId: string | null
|
|
227
|
+
channelId: string | null
|
|
228
|
+
name: string | null
|
|
229
|
+
role: 'lead' | 'worker' | null
|
|
230
|
+
harness: string
|
|
231
|
+
alive: boolean
|
|
232
|
+
running: boolean
|
|
233
|
+
streaming: boolean
|
|
234
|
+
startedAt: number
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/** Agent 模板详情(全局;instances = 已克隆实例去向;v10 用户隔离字段) */
|
|
238
|
+
export interface AgentTemplateDto {
|
|
239
|
+
id: string
|
|
240
|
+
name: string
|
|
241
|
+
harness: string
|
|
242
|
+
config: Record<string, unknown>
|
|
243
|
+
enabled: number
|
|
244
|
+
/** 可见性:'private' 仅本人 | 'public' 全员可读可用 */
|
|
245
|
+
visibility: 'private' | 'public'
|
|
246
|
+
/** 内置模板(公开只读,任何人不可修改删除) */
|
|
247
|
+
isBuiltin: boolean
|
|
248
|
+
/** 归属用户(null = 内置) */
|
|
249
|
+
ownerUserId: string | null
|
|
250
|
+
/** 归属用户名(列表接口附注;'system' = 内置) */
|
|
251
|
+
ownerName?: string | null
|
|
252
|
+
instances: Array<{ id: string, channelId: string, role: 'lead' | 'worker', token: string }>
|
|
253
|
+
createdAt: string
|
|
254
|
+
updatedAt: string
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/** AgentTeam 详情(v10 用户隔离字段) */
|
|
258
|
+
export interface TeamDto {
|
|
259
|
+
id: string
|
|
260
|
+
name: string
|
|
261
|
+
description?: string
|
|
262
|
+
visibility: 'private' | 'public'
|
|
263
|
+
isBuiltin: boolean
|
|
264
|
+
ownerUserId: string | null
|
|
265
|
+
ownerName?: string | null
|
|
266
|
+
members: Array<{ templateId: string, name: string, harness: string, role: 'lead' | 'worker', addedAt: string }>
|
|
267
|
+
createdAt: string
|
|
268
|
+
updatedAt: string
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** Channel 模板成员条目(引用 Agent 模板或内联定义) */
|
|
272
|
+
export type ChannelTemplateMemberDto
|
|
273
|
+
= | { templateId: string, role: 'lead' | 'worker' }
|
|
274
|
+
| { inline: { name: string, harness: string, config?: Record<string, unknown> }, role: 'lead' | 'worker' }
|
|
275
|
+
|
|
276
|
+
/** Channel 模板详情(场景 + 工作目录 + 成员组合;v10) */
|
|
277
|
+
export interface ChannelTemplateDto {
|
|
278
|
+
id: string
|
|
279
|
+
name: string
|
|
280
|
+
description: string
|
|
281
|
+
scenarioPrompt: string
|
|
282
|
+
workspace: string
|
|
283
|
+
lead: { name: string, harness: string, config?: Record<string, unknown> } | null
|
|
284
|
+
members: ChannelTemplateMemberDto[]
|
|
285
|
+
visibility: 'private' | 'public'
|
|
286
|
+
isBuiltin: boolean
|
|
287
|
+
ownerUserId: string | null
|
|
288
|
+
ownerName?: string | null
|
|
289
|
+
createdAt: string
|
|
290
|
+
updatedAt: string
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/** AepSnapshot 的轻量 REST 对齐(WS 未连时兜底刷新;实际从 WS channel.snapshot 取) */
|
|
294
|
+
export type { AepSnapshot }
|
package/app/pages/daq/[id].vue
CHANGED
|
@@ -291,13 +291,18 @@ function drawChart(): void {
|
|
|
291
291
|
ctx.stroke()
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
-
/** live 趋势(WS hist 环形缓冲;独立小画布,与历史图互补)
|
|
294
|
+
/** live 趋势(WS hist 环形缓冲;独立小画布,与历史图互补)。
|
|
295
|
+
* 绘制门控:hist 未变化跳过重绘;后台标签页暂停;容器 resize 后补绘(免错位模糊)。 */
|
|
295
296
|
const liveCanvas = ref<HTMLCanvasElement | null>(null)
|
|
296
297
|
let uiTimer: ReturnType<typeof setInterval> | null = null
|
|
298
|
+
let liveSig = ''
|
|
297
299
|
function drawLive(): void {
|
|
298
300
|
const cv = liveCanvas.value
|
|
299
301
|
const n = node.value
|
|
300
302
|
if (!cv || !n || n.hist.length < 2) return
|
|
303
|
+
const sig = `${n.hist.length}:${n.hist[n.hist.length - 1]}:${n.hist[0]}`
|
|
304
|
+
if (sig === liveSig) return
|
|
305
|
+
liveSig = sig
|
|
301
306
|
const dpr = Math.min(window.devicePixelRatio || 1, 2)
|
|
302
307
|
const w = cv.clientWidth
|
|
303
308
|
const h = cv.clientHeight
|
|
@@ -323,15 +328,34 @@ function drawLive(): void {
|
|
|
323
328
|
})
|
|
324
329
|
ctx.stroke()
|
|
325
330
|
}
|
|
331
|
+
/** resize 后历史图与 live 图都需补绘(尺寸变化不触发数据变化,原实现会错位) */
|
|
332
|
+
let resizeObs: ResizeObserver | null = null
|
|
333
|
+
let liveHidden = false
|
|
334
|
+
function onVisChange(): void {
|
|
335
|
+
liveHidden = document.hidden
|
|
336
|
+
if (!liveHidden) drawLive()
|
|
337
|
+
}
|
|
326
338
|
onMounted(() => {
|
|
327
339
|
void loadHistory()
|
|
328
|
-
// live 趋势重绘循环(仅浏览器;SSR
|
|
340
|
+
// live 趋势重绘循环(仅浏览器;SSR 安全;绘制由 liveSig 门控,数据未变零开销)
|
|
329
341
|
uiTimer = setInterval(() => {
|
|
330
|
-
drawLive()
|
|
342
|
+
if (!liveHidden) drawLive()
|
|
331
343
|
}, 800)
|
|
344
|
+
document.addEventListener('visibilitychange', onVisChange)
|
|
345
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
346
|
+
resizeObs = new ResizeObserver(() => {
|
|
347
|
+
liveSig = ''
|
|
348
|
+
drawLive()
|
|
349
|
+
drawChart()
|
|
350
|
+
})
|
|
351
|
+
if (liveCanvas.value) resizeObs.observe(liveCanvas.value)
|
|
352
|
+
}
|
|
332
353
|
})
|
|
333
354
|
onBeforeUnmount(() => {
|
|
334
355
|
if (uiTimer) clearInterval(uiTimer)
|
|
356
|
+
document.removeEventListener('visibilitychange', onVisChange)
|
|
357
|
+
resizeObs?.disconnect()
|
|
358
|
+
resizeObs = null
|
|
335
359
|
})
|
|
336
360
|
|
|
337
361
|
watch(bucketMs, () => void loadHistory())
|