agentworkshop 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.AgentWorkShop/prompts/host-tools.json +123 -0
- package/.output/.AgentWorkShop/prompts/host-tools.json +123 -0
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{DJJDigim2.js → -FhgRqJl2.js} +1 -1
- package/.output/public/_nuxt/{CGk_VUhO2.js → 0qvcO_KM2.js} +1 -1
- package/.output/public/_nuxt/26OL4Ao82.js +1 -0
- package/.output/public/_nuxt/{sBDZymdy2.js → 2Kwo_j9G2.js} +1 -1
- package/.output/public/_nuxt/{BqYVLAcm.js → 2v5GdspM.js} +1 -1
- package/.output/public/_nuxt/{DkQBMVTs2.js → 8M7wFbEN2.js} +1 -1
- package/.output/public/_nuxt/{DtiY69xi2.js → 8SZLbrI42.js} +1 -1
- package/.output/public/_nuxt/{DF32f5EL2.js → B2NbzUau2.js} +1 -1
- package/.output/public/_nuxt/{CwZW1ZCe2.js → B4JlRHBB2.js} +1 -1
- package/.output/public/_nuxt/{BQOn0q6Y.js → B6C4WofF.js} +1 -1
- package/.output/public/_nuxt/{BC7W6lNm.js → B6UwtJ1a.js} +1 -1
- package/.output/public/_nuxt/{BfQ-ptH0.js → B8HFUsMH.js} +1 -1
- package/.output/public/_nuxt/{DzBbYWrw2.js → BBB_j2LU2.js} +1 -1
- package/.output/public/_nuxt/BCLUwdP52.js +1 -0
- package/.output/public/_nuxt/{CLxmY3Rh.js → BK4wbfGS.js} +1 -1
- package/.output/public/_nuxt/{BRMVDfPl2.js → BKidykmV2.js} +1 -1
- package/.output/public/_nuxt/BPUQZ9Lq2.js +8 -0
- package/.output/public/_nuxt/BRYBzVMJ.js +1 -0
- package/.output/public/_nuxt/{Bj5sjA5O.js → BRci9D_l.js} +1 -1
- package/.output/public/_nuxt/{Dmgqz2np2.js → BVGzwAxr2.js} +1 -1
- package/.output/public/_nuxt/BVg2R2VB2.js +1 -0
- package/.output/public/_nuxt/{C3aUN4Vp2.js → BW2uTUx52.js} +1 -1
- package/.output/public/_nuxt/{B5FKaMM02.js → BY3Lbz3h2.js} +1 -1
- package/.output/public/_nuxt/{DIwmMa_7.js → BYzim_Bn.js} +1 -1
- package/.output/public/_nuxt/{D8xUsQGt.js → B_Obcbiu.js} +1 -1
- package/.output/public/_nuxt/BaYDgyaR.js +3 -0
- package/.output/public/_nuxt/{DZJ11BTI.js → BbACaREb.js} +1 -1
- package/.output/public/_nuxt/{BJrj5JVe2.js → BcosvNXb2.js} +1 -1
- package/.output/public/_nuxt/{B_-vAvzb.js → BfeXib9G.js} +1 -1
- package/.output/public/_nuxt/{CeLqojCJ.js → BfgTar9L.js} +1 -1
- package/.output/public/_nuxt/BfvuWqSa.js +1 -0
- package/.output/public/_nuxt/{D8r8PNQa2.js → BiZWwdcD2.js} +1 -1
- package/.output/public/_nuxt/{DIFkTkdS.js → BkEokGX5.js} +1 -1
- package/.output/public/_nuxt/{CJSohaqk2.js → BklGqEto2.js} +2 -2
- package/.output/public/_nuxt/{DkpmSnHX.js → Bko5adbu.js} +1 -1
- package/.output/public/_nuxt/{DTQTGA6v2.js → BmBlIIJo2.js} +1 -1
- package/.output/public/_nuxt/{D_NjL-Hz.js → Bmvt9ydE.js} +1 -1
- package/.output/public/_nuxt/{Cp4r6Eiz.js → BoyuIoSm.js} +1 -1
- package/.output/public/_nuxt/{62J4vljm.js → Bq-tmkst.js} +1 -1
- package/.output/public/_nuxt/{BMMoqi94.js → BqFaZ4kS.js} +1 -1
- package/.output/public/_nuxt/BsJYieAL2.js +1 -0
- package/.output/public/_nuxt/{DD4J2Otc.js → BtZKe9ZV.js} +1 -1
- package/.output/public/_nuxt/{BnpY_zNx.js → BtumQhZK.js} +1 -1
- package/.output/public/_nuxt/{BjLzqWJH2.js → BwWs9EdO2.js} +1 -1
- package/.output/public/_nuxt/{Bx2a9cuY2.js → BxxpJxZf2.js} +1 -1
- package/.output/public/_nuxt/{qRXa-PM22.js → ByTnUqFw2.js} +1 -1
- package/.output/public/_nuxt/{DvOETuoT2.js → Byiiiwc72.js} +1 -1
- package/.output/public/_nuxt/{Car2lkbb.js → C1-SuwUN.js} +1 -1
- package/.output/public/_nuxt/{Dg81dOEO.js → C14pM5G4.js} +1 -1
- package/.output/public/_nuxt/{MDhaRQq_.js → C2Yp-B8m.js} +1 -1
- package/.output/public/_nuxt/{BJ2nJNlK2.js → C4e6_nom2.js} +1 -1
- package/.output/public/_nuxt/{CiCEprsp2.js → C5OStZJ62.js} +1 -1
- package/.output/public/_nuxt/{ByMj6e7s.js → C6lssmvl.js} +2 -2
- package/.output/public/_nuxt/{C6uBP0Xa.js → CC-GEjfN.js} +1 -1
- package/.output/public/_nuxt/CC2Pv8VL2.js +1 -0
- package/.output/public/_nuxt/{DKiqdYnj.js → CCcMgxV9.js} +1 -1
- package/.output/public/_nuxt/{5S26I34j2.js → CDL30A2z2.js} +1 -1
- package/.output/public/_nuxt/{B8C-QJB5.js → CDYLasP8.js} +1 -1
- package/.output/public/_nuxt/CElzwyXQ.js +1 -0
- package/.output/public/_nuxt/{2KE8xGVm.js → CEvJu-xI.js} +1 -1
- package/.output/public/_nuxt/{CR612R752.js → CFQRFctQ2.js} +1 -1
- package/.output/public/_nuxt/{DnzjxC0u.js → CHk9XxNi.js} +2 -2
- package/.output/public/_nuxt/{Bx4MR0jd.js → CLFmtXU7.js} +1 -1
- package/.output/public/_nuxt/{DW8k_0dQ.js → CMJi6yYS.js} +1 -1
- package/.output/public/_nuxt/{DD-r0S1p.js → CPvFGbr8.js} +1 -1
- package/.output/public/_nuxt/{CCgbgkid.js → CQSxS_Ek.js} +2 -2
- package/.output/public/_nuxt/{jGxHnjW6.js → CQuo31jF.js} +1 -1
- package/.output/public/_nuxt/{SoO2K-di.js → CRCrWy-6.js} +1 -1
- package/.output/public/_nuxt/CUCFFL9m.js +84 -0
- package/.output/public/_nuxt/CZYNy60j2.js +1 -0
- package/.output/public/_nuxt/{WPwdj9pg.js → CZsFf7ck.js} +1 -1
- package/.output/public/_nuxt/CfFUK6932.js +2 -0
- package/.output/public/_nuxt/{DAsjfdZD.js → CfIbFnJz.js} +1 -1
- package/.output/public/_nuxt/{Tk6TQZjU.js → CjF4QY9h.js} +1 -1
- package/.output/public/_nuxt/{DlUQa0wn.js → Cjo1t2IF.js} +1 -1
- package/.output/public/_nuxt/{CDn0eDn8.js → CmuGMxDP.js} +1 -1
- package/.output/public/_nuxt/Cn6EojFe.js +1 -0
- package/.output/public/_nuxt/{DLqSQbGv.js → CnYazk8d.js} +1 -1
- package/.output/public/_nuxt/{DQfy6R_2.js → CnrGVJIr.js} +1 -1
- package/.output/public/_nuxt/{C0YL0HKK.js → CtcBhkci.js} +1 -1
- package/.output/public/_nuxt/{h5gsh8E92.js → Cv-Mv7_h2.js} +1 -1
- package/.output/public/_nuxt/{vPcnBJsa2.js → CzlZrfq82.js} +1 -1
- package/.output/public/_nuxt/{C2YYOgMe.js → CznnUTZx.js} +2 -2
- package/.output/public/_nuxt/{csitHKnE2.js → D-80EfyA2.js} +1 -1
- package/.output/public/_nuxt/{BRdoISnJ2.js → D1C6qtS12.js} +1 -1
- package/.output/public/_nuxt/{Cnrmlixo.js → D1MkndMZ.js} +2 -2
- package/.output/public/_nuxt/{BLwDhlaa.js → D37gODe0.js} +1 -1
- package/.output/public/_nuxt/{NXY37IO62.js → D6FhDrYe2.js} +1 -1
- package/.output/public/_nuxt/{Btx8wL4-.js → D7TZLu4F.js} +1 -1
- package/.output/public/_nuxt/{qoUdVDnC.js → D7tEwf-o.js} +3 -3
- package/.output/public/_nuxt/D8HQPtm62.js +1 -0
- package/.output/public/_nuxt/D9O4L4jK.js +1 -0
- package/.output/public/_nuxt/{aQ1B7BZa2.js → D9lL3fJM2.js} +2 -2
- package/.output/public/_nuxt/{CT-vTjcG2.js → DC-2eKo62.js} +1 -1
- package/.output/public/_nuxt/DF9ETYJ32.js +1 -0
- package/.output/public/_nuxt/DGGBrc0q2.js +1 -0
- package/.output/public/_nuxt/DGu_fna7.js +1 -0
- package/.output/public/_nuxt/{BupBjt6B.js → DKOvbitt.js} +1 -1
- package/.output/public/_nuxt/{B1PzYsqN.js → DNxudyND.js} +1 -1
- package/.output/public/_nuxt/{BfX6_AjY.js → DOT-XQyi.js} +1 -1
- package/.output/public/_nuxt/{BsTZnkVK.js → DPPC9Teq.js} +1 -1
- package/.output/public/_nuxt/{HxohXQ_r.js → DRskyE7l.js} +1 -1
- package/.output/public/_nuxt/{B-U7E_Mc2.js → DW4ZgInh2.js} +1 -1
- package/.output/public/_nuxt/{BErG4kzc2.js → DWe6BMlp2.js} +1 -1
- package/.output/public/_nuxt/{BH8RvpVy.js → DWy0AjON.js} +1 -1
- package/.output/public/_nuxt/{Bc_k6AVA.js → DXgw1dVL.js} +4 -4
- package/.output/public/_nuxt/{C3sWJ8SD2.js → DZsKIzKD2.js} +1 -1
- package/.output/public/_nuxt/D_59BNP1.js +14 -0
- package/.output/public/_nuxt/{BQIO4MkA2.js → D_FZ3KZI2.js} +1 -1
- package/.output/public/_nuxt/{n_Njdwii2.js → D__vJGHF2.js} +1 -1
- package/.output/public/_nuxt/{C9gErLQc2.js → DaizNGUm2.js} +1 -1
- package/.output/public/_nuxt/{C-MY-JQE.js → DdyE0ylS.js} +1 -1
- package/.output/public/_nuxt/DhLlTxQh2.js +1 -0
- package/.output/public/_nuxt/{CxVhG0Xx.js → DhW7cFOa.js} +1 -1
- package/.output/public/_nuxt/{Rt2i6k7C2.js → DhjgWrB62.js} +1 -1
- package/.output/public/_nuxt/{KwT4sN_d.js → DiWcX4gj.js} +1 -1
- package/.output/public/_nuxt/DiloA8vK.js +1 -0
- package/.output/public/_nuxt/{DX-c5laM2.js → DlS-SkQ42.js} +1 -1
- package/.output/public/_nuxt/{D_Zspo1y.js → DmHp9yQ3.js} +1 -1
- package/.output/public/_nuxt/{dq1HKoGD.js → DoL9u6wu.js} +1 -1
- package/.output/public/_nuxt/{CIvMT5Ic.js → DqxBCeDe.js} +1 -1
- package/.output/public/_nuxt/{BnNmkGJS2.js → DrlnrdvY2.js} +3 -3
- package/.output/public/_nuxt/{BAcjVcku2.js → Dt8TL8_X2.js} +1 -1
- package/.output/public/_nuxt/{BtfwbNC0.js → Du7gS8RU.js} +1 -1
- package/.output/public/_nuxt/DuUc4bbY2.js +1 -0
- package/.output/public/_nuxt/{DPUXbTg9.js → DudoisLM.js} +1 -1
- package/.output/public/_nuxt/{Ce5R-ZGf2.js → DwgVlehj2.js} +1 -1
- package/.output/public/_nuxt/Dyxf2xZw.js +1 -0
- package/.output/public/_nuxt/Dz9C2pTa.js +1 -0
- package/.output/public/_nuxt/{BYxG9Hb2.js → EMbqTHfT.js} +1 -1
- package/.output/public/_nuxt/{B1SzppY12.js → FsRVXpyF2.js} +1 -1
- package/.output/public/_nuxt/{0MLy6ogg2.js → GQrEW8nk2.js} +1 -1
- package/.output/public/_nuxt/{Tuz5LcLM.js → IXR1BWP5.js} +1 -1
- package/.output/public/_nuxt/{-jpUnM1I2.js → Iub61dX92.js} +1 -1
- package/.output/public/_nuxt/{CQgOzpvI.js → JegDslce.js} +2 -2
- package/.output/public/_nuxt/{DrF3TWoj.js → KzK37yIr.js} +1 -1
- package/.output/public/_nuxt/{Br3MggOL.js → N-CCmCsX.js} +1 -1
- package/.output/public/_nuxt/{DHhmq7s_.js → NfvZ5Lzv.js} +1 -1
- package/.output/public/_nuxt/{CzX_kaPL.js → POTcePF_.js} +1 -1
- package/.output/public/_nuxt/{D7s96J3r2.js → Q-JpBT032.js} +1 -1
- package/.output/public/_nuxt/{DzwIZ81f2.js → R1g64DNi2.js} +1 -1
- package/.output/public/_nuxt/{JgheoP3e.js → R5Pz7BqB.js} +1 -1
- package/.output/public/_nuxt/{yLyz0-Yz.js → SvjzWbn8.js} +1 -1
- package/.output/public/_nuxt/{Dd7MZc_Q.js → XqXoaoDs.js} +1 -1
- package/.output/public/_nuxt/{B6jtLy6z.js → YAA98rWJ.js} +11 -11
- package/.output/public/_nuxt/{HX4_xnak2.js → YLYSczSq2.js} +1 -1
- package/.output/public/_nuxt/{BBw9ylUY2.js → YNhAoK-R2.js} +1 -1
- package/.output/public/_nuxt/Zkbt8Uk5.js +1 -0
- package/.output/public/_nuxt/aml.PalMp-5n.css +1 -0
- package/.output/public/_nuxt/{C41CcsiD.js → b7UcqLKi.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/fa0af8b5-3929-428d-a6de-3b5cc6b8248f.json +1 -0
- package/.output/public/_nuxt/{DVkFSOZi.js → cKj4vSo5.js} +1 -1
- package/.output/public/_nuxt/{r1CpGsFp.js → dHwWyr6b.js} +1 -1
- package/.output/public/_nuxt/{DlcA9Gxl.js → eePbiWEh.js} +1 -1
- package/.output/public/_nuxt/{cjRzSvAg2.js → eymRov9Y2.js} +1 -1
- package/.output/public/_nuxt/{B8cViLJT.js → geMze5qw.js} +1 -1
- package/.output/public/_nuxt/{uu1wfdfR2.js → gh-WMxV_2.js} +1 -1
- package/.output/public/_nuxt/{Ce6e1mPk2.js → hCN555XP2.js} +1 -1
- package/.output/public/_nuxt/{rdUE8Khf.js → hZG5MLjK.js} +3 -3
- package/.output/public/_nuxt/{CcX_jP-d.js → hlfahYxK.js} +1 -1
- package/.output/public/_nuxt/{cGSl2GZp2.js → ilJHF1nA2.js} +1 -1
- package/.output/public/_nuxt/{D6ZcgHPz.js → jDuiDtGb.js} +1 -1
- package/.output/public/_nuxt/{DbeNMehP.js → k9b520K-.js} +1 -1
- package/.output/public/_nuxt/ontology.B_3Wn907.css +1 -0
- package/.output/public/_nuxt/optimizer.CLA8I1sy.css +1 -0
- package/.output/public/_nuxt/{DSORcpTJ.js → rDvMijKA.js} +2 -2
- package/.output/public/_nuxt/{CAiHhX8P2.js → rF7mggl72.js} +2 -2
- package/.output/public/_nuxt/ri9UF8rk.js +2 -0
- package/.output/public/_nuxt/{KgnxOsMr.js → toG_qAMH.js} +1 -1
- package/.output/public/_nuxt/{KQZmHR_K.js → u3h4pGpm.js} +2 -2
- package/.output/public/_nuxt/{dJ7gK7C2.js → uomnHjhM.js} +1 -1
- package/.output/public/_nuxt/{BUTg4W_x2.js → v77qozuJ2.js} +1 -1
- package/.output/public/_nuxt/{BcEr7tIB.js → v7cV7hJa.js} +1 -1
- package/.output/public/_nuxt/{D25dVZ822.js → vkQoYNQR2.js} +2 -2
- package/.output/public/_nuxt/{wR_w07322.js → vp3LtnTz2.js} +1 -1
- package/.output/public/_nuxt/{Bnc8HELj2.js → we7-sMSo2.js} +1 -1
- package/.output/public/_nuxt/{kN3ZzR1-.js → wxISMS1i.js} +1 -1
- package/.output/public/_nuxt/{DGrrucbG.js → zy7efYKR.js} +1 -1
- package/.output/server/chunks/_/data-export.mjs +5 -5
- package/.output/server/chunks/_/data-query.mjs +2 -2
- package/.output/server/chunks/_/eda-run.repo.mjs +2 -2
- package/.output/server/chunks/_/features.mjs +4 -4
- package/.output/server/chunks/_/golden.mjs +2 -2
- package/.output/server/chunks/_/index.mjs +1 -1
- package/.output/server/chunks/_/mes-console.mjs +1 -1
- package/.output/server/chunks/_/nitro.mjs +2149 -1520
- package/.output/server/chunks/_/nitro.mjs.map +1 -1
- package/.output/server/chunks/_/spc.mjs +1 -1
- package/.output/server/chunks/build/TownView-BWMDbosY.mjs +1 -1
- package/.output/server/chunks/build/{_wsId_-BNKrrV1H.mjs → _wsId_-BPy-Aj9L.mjs} +3 -3
- package/.output/server/chunks/build/{_wsId_-BNKrrV1H.mjs.map → _wsId_-BPy-Aj9L.mjs.map} +1 -1
- package/.output/server/chunks/build/{agents-8tV9xL97.mjs → agents-CpNLdI8E.mjs} +6 -6
- package/.output/server/chunks/build/{agents-8tV9xL97.mjs.map → agents-CpNLdI8E.mjs.map} +1 -1
- package/.output/server/chunks/build/{aml-BNTEDOsl.mjs → aml-DRAFRcGU.mjs} +15 -12
- package/.output/server/chunks/build/{aml-BNTEDOsl.mjs.map → aml-DRAFRcGU.mjs.map} +1 -1
- package/.output/server/chunks/build/{channel-templates-Iot9Y3vV.mjs → channel-templates-ByHOQQkO.mjs} +2 -2
- package/.output/server/chunks/build/{channel-templates-Iot9Y3vV.mjs.map → channel-templates-ByHOQQkO.mjs.map} +1 -1
- package/.output/server/chunks/build/daq-CdxcfY_G.mjs +1 -1
- package/.output/server/chunks/build/dcw-BlDQtS4q.mjs +1 -1
- package/.output/server/chunks/build/{default-CJkOcmrm.mjs → default-CNWS6NUw.mjs} +4 -4
- package/.output/server/chunks/build/{default-CJkOcmrm.mjs.map → default-CNWS6NUw.mjs.map} +1 -1
- package/.output/server/chunks/build/{dropdown-CjwsxU39.mjs → dropdown-BNwTVGde.mjs} +2 -2
- package/.output/server/chunks/build/{dropdown-CjwsxU39.mjs.map → dropdown-BNwTVGde.mjs.map} +1 -1
- package/.output/server/chunks/build/{dropdown-C6YH_kSO.mjs → dropdown-Cd-xPhR6.mjs} +2 -2
- package/.output/server/chunks/build/{dropdown-C6YH_kSO.mjs.map → dropdown-Cd-xPhR6.mjs.map} +1 -1
- package/.output/server/chunks/build/input-number-BNlNDK7H.mjs +1 -1
- package/.output/server/chunks/build/{logs-BTfJQ6vQ.mjs → logs-pRb-TMWa.mjs} +3 -3
- package/.output/server/chunks/build/{logs-BTfJQ6vQ.mjs.map → logs-pRb-TMWa.mjs.map} +1 -1
- package/.output/server/chunks/build/{monitor-DvaR3yo8.mjs → monitor-Cq6hRFeQ.mjs} +6 -6
- package/.output/server/chunks/build/{monitor-DvaR3yo8.mjs.map → monitor-Cq6hRFeQ.mjs.map} +1 -1
- package/.output/server/chunks/build/{ontology-C3HS5pMo.mjs → ontology-DK0Mf0zT.mjs} +510 -81
- package/.output/server/chunks/build/ontology-DK0Mf0zT.mjs.map +1 -0
- package/.output/server/chunks/build/{operations-Cl8nVm9D.mjs → operations-SMQrRAcr.mjs} +3 -3
- package/.output/server/chunks/build/{operations-Cl8nVm9D.mjs.map → operations-SMQrRAcr.mjs.map} +1 -1
- package/.output/server/chunks/build/optimizer-BlWTsM-W.mjs +202 -0
- package/.output/server/chunks/build/optimizer-BlWTsM-W.mjs.map +1 -0
- package/.output/server/chunks/build/{pagination-KaIvHBzi.mjs → pagination-DTAconUo.mjs} +2 -2
- package/.output/server/chunks/build/{pagination-KaIvHBzi.mjs.map → pagination-DTAconUo.mjs.map} +1 -1
- package/.output/server/chunks/build/{permissions-CVTfixZj.mjs → permissions-DgXQZSyx.mjs} +6 -6
- package/.output/server/chunks/build/{permissions-CVTfixZj.mjs.map → permissions-DgXQZSyx.mjs.map} +1 -1
- package/.output/server/chunks/build/{schedules-BLhn2CLn.mjs → schedules-dSnr8url.mjs} +6 -6
- package/.output/server/chunks/build/{schedules-BLhn2CLn.mjs.map → schedules-dSnr8url.mjs.map} +1 -1
- package/.output/server/chunks/build/{select--XFl7CtY.mjs → select-B3Dsb9yq.mjs} +3 -3
- package/.output/server/chunks/build/{select--XFl7CtY.mjs.map → select-B3Dsb9yq.mjs.map} +1 -1
- package/.output/server/chunks/build/{settings-DIf_iYdu.mjs → settings-BrIhnS2Z.mjs} +2 -2
- package/.output/server/chunks/build/{settings-DIf_iYdu.mjs.map → settings-BrIhnS2Z.mjs.map} +1 -1
- package/.output/server/chunks/build/{table-DIu_YCJN.mjs → table-CmVD-cA9.mjs} +4 -4
- package/.output/server/chunks/build/{table-DIu_YCJN.mjs.map → table-CmVD-cA9.mjs.map} +1 -1
- package/.output/server/chunks/build/{teams-B2J6ouRY.mjs → teams-B1d32eHK.mjs} +4 -4
- package/.output/server/chunks/build/{teams-B2J6ouRY.mjs.map → teams-B1d32eHK.mjs.map} +1 -1
- package/.output/server/chunks/build/{tokens-DFQGaN2n.mjs → tokens-GYaGJ35Z.mjs} +6 -6
- package/.output/server/chunks/build/{tokens-DFQGaN2n.mjs.map → tokens-GYaGJ35Z.mjs.map} +1 -1
- package/.output/server/chunks/build/{tools-DWJFnU_t.mjs → tools-s_9U1Djj.mjs} +6 -6
- package/.output/server/chunks/build/{tools-DWJFnU_t.mjs.map → tools-s_9U1Djj.mjs.map} +1 -1
- package/.output/server/chunks/build/types-D6J7slEa.mjs +1 -1
- package/.output/server/chunks/build/useDaqAddNode-D_Rkju0f.mjs +1 -1
- package/.output/server/chunks/build/useDaqDetailNode-DeOsDxK5.mjs +1 -1
- package/.output/server/chunks/build/useDaqDetailParams-Cm9a9r5G.mjs +1 -1
- package/.output/server/chunks/build/useDaqFilters-CctmO03p.mjs +1 -1
- package/.output/server/chunks/build/useDaqStream-B9ZBVQrI.mjs +1 -1
- package/.output/server/chunks/build/useDaqTemplates-CK37sMfi.mjs +1 -1
- package/.output/server/chunks/build/useDcwAddNode-DACVcEHs.mjs +1 -1
- package/.output/server/chunks/build/useDcwStream-Dir5ufAU.mjs +1 -1
- package/.output/server/chunks/build/{users-BWw0VCr9.mjs → users-DjiVC_tS.mjs} +6 -6
- package/.output/server/chunks/build/{users-BWw0VCr9.mjs.map → users-DjiVC_tS.mjs.map} +1 -1
- package/.output/server/chunks/routes/api/mcp/workshop.mjs +1 -1
- package/.output/server/chunks/routes/api/system/backup/run.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/aml/models/_id_.patch.mjs +7 -1
- package/.output/server/chunks/routes/api/workshop/aml/models/_id_.patch.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.post.mjs +6 -6
- package/.output/server/chunks/routes/api/workshop/daq/_id/ingest.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/autofix.mjs +52 -0
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/autofix.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/compile.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/evidence.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/publish.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval-decision.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/transition.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/subgraph.mjs +38 -0
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/subgraph.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/validate.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/export/_ontologyId_.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/index.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/scene.mjs +8 -1
- package/.output/server/chunks/routes/api/workshop/ontology/scene.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/traces/_ontologyId_.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId/compare.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId_.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/optimization/capabilities.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/optimization/index.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/optimization/index2.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/optimization/profiles/_id/publish.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/crosscheck.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/dispatch.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/optimization/solve.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/process-model/datasets.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/process-model/eligibility.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/process-model/index.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/process-model/specs/_id/publish.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/process-model/train.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/tools/sync.post.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 +2 -2
- package/.output/server/chunks/virtual/entry.mjs +92 -18
- package/.output/server/chunks/virtual/precomputed.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/README-zh.md +5 -4
- package/README.md +6 -5
- package/app/components/aml/AmlModelsTable.vue +5 -0
- package/app/components/ontology/OntologyGraph.vue +356 -0
- package/app/pages/aml/styles.css +1 -0
- package/app/pages/ontology/index.vue +318 -35
- package/app/pages/ontology/types.ts +42 -0
- package/app/pages/optimizer/index.vue +21 -4
- package/config.yml +1 -1
- package/docs/cli.en.md +2 -2
- package/docs/cli.md +2 -2
- package/docs/plugins.en.md +1 -1
- package/docs/plugins.md +1 -1
- package/docs/sdk.en.md +1 -1
- package/docs/sdk.md +1 -1
- package/i18n/locales/en.ts +26 -0
- package/i18n/locales/zh-CN.ts +26 -0
- package/mcp/aw-mcp-server.mjs +20 -2
- package/package.json +1 -1
- package/scripts/e2e-direct-rest-simulator-paper.mjs +624 -0
- package/scripts/e2e-idd-results.mjs +177 -0
- package/scripts/e2e-model-loop-live.mjs +58 -4
- package/scripts/e2e-ontology-live.mjs +138 -3
- package/scripts/e2e-ontology.mjs +393 -328
- package/scripts/e2e-pi-simulator-paper.mjs +2316 -0
- package/scripts/e2e-registered-harness-simulator-paper.mjs +1926 -0
- package/scripts/e2e-simulator-optimizer-paper.mjs +264 -0
- package/scripts/fixtures/omp-paper-harness.mjs +163 -0
- package/sdk/context.mjs +6 -0
- package/sdk/index.d.mts +2 -0
- package/server/api/workshop/aml/models/[id].patch.ts +36 -30
- package/server/api/workshop/ontology/drafts/[draftId]/autofix.ts +31 -0
- package/server/api/workshop/ontology/drafts/[draftId]/subgraph.ts +24 -0
- package/server/api/workshop/ontology/scene.ts +14 -1
- package/server/plugins-builtin/diag-bridge/client.mjs +390 -239
- package/server/plugins-builtin/diag-bridge/host/helpers.mjs +80 -0
- package/server/plugins-builtin/diag-bridge/host/plugin.mjs +264 -2
- package/server/plugins-builtin/diag-bridge/i18n.json +84 -4
- package/server/services/workshop/agents/adapters/omp-rpc-client/frames.ts +129 -111
- package/server/services/workshop/agents/host-tool-bridge/tools/industrial.ts +6 -3
- package/server/services/workshop/agents/industrial/aml-job-tools.ts +602 -569
- package/server/services/workshop/agents/industrial/grant-guard.ts +15 -1
- package/server/services/workshop/agents/industrial/index.ts +2 -2
- package/server/services/workshop/agents/industrial/ontology-tools.ts +66 -6
- package/server/services/workshop/agents/industrial/ops-tools.ts +54 -16
- package/server/services/workshop/agents/industrial/optimizer-tools.ts +2 -0
- package/server/services/workshop/agents/industrial/recipe-gate.ts +19 -6
- package/server/services/workshop/agents/industrial/recipe-propose-tools.ts +1 -1
- package/server/services/workshop/agents/omp-agent/supervision-history.ts +38 -0
- package/server/services/workshop/agents/omp-agent/tools-steer.ts +18 -1
- package/server/services/workshop/aml/aml.repo.ts +16 -0
- package/server/services/workshop/daq/bus/index.ts +12 -5
- package/server/services/workshop/db/database/open.ts +97 -97
- package/server/services/workshop/db/database/schema.ts +1 -0
- package/server/services/workshop/ontology/autofix.ts +198 -0
- package/server/services/workshop/ontology/contracts.ts +3 -1
- package/server/services/workshop/ontology/index.ts +2 -0
- package/server/services/workshop/ontology/ontology.service.ts +46 -0
- package/server/services/workshop/ontology/subgraph.core.ts +300 -0
- package/server/services/workshop/ontology/subgraph.service.ts +113 -0
- package/server/services/workshop/optimization/contracts.ts +2 -0
- package/server/services/workshop/optimization/profile-adopt.service.ts +5 -0
- package/server/services/workshop/optimization/profile.repo.ts +6 -4
- package/.output/public/_nuxt/B3Y5bCrM.js +0 -1
- package/.output/public/_nuxt/B8N8nsad2.js +0 -2
- package/.output/public/_nuxt/BO0BJx3w2.js +0 -8
- package/.output/public/_nuxt/BWn-lfCp2.js +0 -1
- package/.output/public/_nuxt/Bcs9zzO62.js +0 -1
- package/.output/public/_nuxt/BwO2Y5FH2.js +0 -1
- package/.output/public/_nuxt/Byf4IxU2.js +0 -14
- package/.output/public/_nuxt/C-LU6xv_.js +0 -1
- package/.output/public/_nuxt/CJ0bjZ6v2.js +0 -1
- package/.output/public/_nuxt/CJ3Vul2u.js +0 -1
- package/.output/public/_nuxt/CNwx04ln.js +0 -84
- package/.output/public/_nuxt/CVCscYzb2.js +0 -1
- package/.output/public/_nuxt/C_A0MCol2.js +0 -1
- package/.output/public/_nuxt/CnP6snIz.js +0 -3
- package/.output/public/_nuxt/D0mzKkZr.js +0 -1
- package/.output/public/_nuxt/D3buuIkE.js +0 -1
- package/.output/public/_nuxt/D4_INWgq.js +0 -1
- package/.output/public/_nuxt/D5kCimyw2.js +0 -1
- package/.output/public/_nuxt/DBtXLkyA.js +0 -1
- package/.output/public/_nuxt/DHURbGkn2.js +0 -1
- package/.output/public/_nuxt/DaBzS-iu.js +0 -1
- package/.output/public/_nuxt/DnlhV7Xe.js +0 -1
- package/.output/public/_nuxt/GtI6PUI32.js +0 -1
- package/.output/public/_nuxt/Nw_6OpQZ.js +0 -1
- package/.output/public/_nuxt/Y4sMSPrS2.js +0 -1
- package/.output/public/_nuxt/aml.CeLxRzvI.css +0 -1
- package/.output/public/_nuxt/builds/meta/7a79a7e4-d691-4cf5-ae3a-3b01814479fb.json +0 -1
- package/.output/public/_nuxt/goF_oZHF.js +0 -2
- package/.output/public/_nuxt/ontology.QMGeh66l.css +0 -1
- package/.output/public/_nuxt/optimizer.B8gCbU1b.css +0 -1
- package/.output/public/_nuxt/rJ7To74v2.js +0 -1
- package/.output/server/chunks/build/ontology-C3HS5pMo.mjs.map +0 -1
- package/.output/server/chunks/build/optimizer-BOtGWEtc.mjs +0 -200
- package/.output/server/chunks/build/optimizer-BOtGWEtc.mjs.map +0 -1
|
@@ -37,7 +37,10 @@ const WRITE_TOOLS = new Set([
|
|
|
37
37
|
// 本体(ONT):知识起草与发布提议属产线域写向动作(不写设备,但会改变控制侧知识来源)
|
|
38
38
|
'ontology_draft_create',
|
|
39
39
|
'ontology_draft_update',
|
|
40
|
+
'ontology_draft_autofix',
|
|
40
41
|
'ontology_publish_propose',
|
|
42
|
+
// AML 模型人读身份(名称/描述)维护:写元数据,不触达产线设备
|
|
43
|
+
'aml_model_annotate',
|
|
41
44
|
])
|
|
42
45
|
|
|
43
46
|
/** 无需复核的纯协作/管理面工具(不触达产线数据) */
|
|
@@ -125,7 +128,18 @@ async function resolveTargetLines(agentId: string, toolName: string, args: Recor
|
|
|
125
128
|
}
|
|
126
129
|
}
|
|
127
130
|
}
|
|
128
|
-
//
|
|
131
|
+
// AML 模型 → 数据集所属产线(model_id 元数据写/引用面)
|
|
132
|
+
const modelIdArg = one(args.model_id ?? args.modelId)
|
|
133
|
+
if (modelIdArg) {
|
|
134
|
+
const { getAmlRuntime } = await import('@/server/services/workshop/aml/runtime')
|
|
135
|
+
const db = getAmlRuntime().db
|
|
136
|
+
const m = db.prepare('SELECT dataset_id AS datasetId FROM aml_models WHERE id = ?').get(modelIdArg) as { datasetId?: string } | undefined
|
|
137
|
+
if (m?.datasetId) {
|
|
138
|
+
const d = db.prepare('SELECT line_id AS lineId FROM aml_datasets WHERE id = ?').get(m.datasetId) as { lineId?: string } | undefined
|
|
139
|
+
if (d?.lineId) lines.add(d.lineId)
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// 本体版本 → 版本产线(版本比较的归属面)
|
|
129
143
|
const ontologyId = one(args.ontology_id ?? args.ontologyId)
|
|
130
144
|
if (ontologyId) {
|
|
131
145
|
const { getAmlRuntime } = await import('@/server/services/workshop/aml/runtime')
|
|
@@ -22,7 +22,7 @@ export { toolDcwJudge, toolDcwRollback, toolDcwJournal } from './dcw-judge-tools
|
|
|
22
22
|
export { toolOpsLog, toolRecipeLog, toolRecipeCatalog, toolRecipeCreate, toolLineContext, toolRecipeVersions, toolRecipeUpdate, toolRecipeRollback, toolRecipeTrial, toolRecipeApply } from './ops-tools'
|
|
23
23
|
export { toolMesCatalog, toolMesFetch, toolMesExport, toolMesDatasetRead, toolMesDatasets } from './mes-tools'
|
|
24
24
|
export { toolAmlNodeCatalog, toolAmlDatasetBuild, toolAmlDatasetStats } from './aml-dataset-tools'
|
|
25
|
-
export { toolAmlJobSubmit, toolAmlJobStatus, toolAmlJobLogs, toolAmlJobCancel, toolAmlLeaderboard, toolAmlModelFind, toolAmlModelPromote, toolAmlModelReference, toolAmlTrainingPlanList, toolAmlTrainingPlanTrain, toolAmlTrainingPlanCreate } from './aml-job-tools'
|
|
25
|
+
export { toolAmlJobSubmit, toolAmlJobStatus, toolAmlJobLogs, toolAmlJobCancel, toolAmlLeaderboard, toolAmlModelFind, toolAmlModelPromote, toolAmlModelReference, toolAmlModelAnnotate, toolAmlTrainingPlanList, toolAmlTrainingPlanTrain, toolAmlTrainingPlanCreate } from './aml-job-tools'
|
|
26
26
|
|
|
27
27
|
export { toolOptimizationExplore } from './optimization-tools'
|
|
28
28
|
export { toolTwinProviderCatalog, toolTwinSceneDiscover, toolTwinSceneCompile, toolTwinSceneFreeze, toolTwinSceneRead, toolTwinPhysicsSpecDraft, toolTwinPhysicsSpecValidate, toolTwinPhysicsSpecCompile, toolTwinSnapshotCreate, toolTwinTrialRun, toolMpcOptimize, toolTwinGateEvaluate, toolTwinCalibrationRequest, toolTwinBayesOptimize } from './twin-tools'
|
|
@@ -32,7 +32,7 @@ export { toolLineStart, toolLineStop, toolLineStatus } from './line-tools'
|
|
|
32
32
|
export { toolAnalysisSave, toolAnalysisQuery } from './analysis-tools'
|
|
33
33
|
export { toolOptimizerProfilePropose } from './optimizer-tools'
|
|
34
34
|
export {
|
|
35
|
-
toolOntologySceneInspect, toolOntologyDraftCreate, toolOntologyDraftValidate,
|
|
35
|
+
toolOntologySceneInspect, toolOntologyNodeNeighbors, toolOntologyDraftCreate, toolOntologyDraftValidate, toolOntologyDraftAutofix,
|
|
36
36
|
toolOntologyDraftUpdate, toolOntologyRuleExplain, toolOntologyCompilePreview,
|
|
37
37
|
toolOntologyPublishPropose, toolOntologyVersionCompare,
|
|
38
38
|
} from './ontology-tools'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 本体工具族(
|
|
2
|
+
* 本体工具族(10 件)—— Agent 侧的「读 / 邻接 / 起草 / 校验 / 解释 / 编译预览 / 提议发布 / 版本比较」。
|
|
3
3
|
*
|
|
4
|
-
* 治理:本族由 grant-guard(WVO: publish_propose 属写族)
|
|
5
|
-
*
|
|
6
|
-
* Agent 只能 draft_create 起草、publish_propose 提请第二人批准。
|
|
4
|
+
* 治理:本族由 grant-guard(WVO: draft_create/draft_update/draft_autofix/publish_propose 属写族)
|
|
5
|
+
* 与 tool-verify(引用面)复核;**没有**任何工具能直接发布版本或写设备 ——
|
|
6
|
+
* 发布仅 admin 在 REST 面执行,Agent 只能 draft_create 起草、publish_propose 提请第二人批准。
|
|
7
7
|
*
|
|
8
8
|
* 归属:Agent 起草的草稿 owner = agentId(审计可见 actorKind='agent');
|
|
9
9
|
* 读取面按 agentOpsScope 的产线/节点范围收窄。
|
|
@@ -15,8 +15,10 @@ import { getOntologyRepo, parseDraftRow } from '../../ontology/repo'
|
|
|
15
15
|
import type { Actor } from '../../ontology/ontology.service'
|
|
16
16
|
import {
|
|
17
17
|
compileDraft, createDraft, getDraft, requestRuleApproval, sceneSubgraph,
|
|
18
|
-
updateDraft, validateDraft, compareVersions, getVersion, listVersions,
|
|
18
|
+
updateDraft, validateDraft, compareVersions, getVersion, listVersions, autoFixDraft,
|
|
19
19
|
} from '../../ontology/ontology.service'
|
|
20
|
+
import { parseSubgraphOptions } from '../../ontology/subgraph.core'
|
|
21
|
+
import { subgraphAroundForLine } from '../../ontology/subgraph.service'
|
|
20
22
|
|
|
21
23
|
import type { OntologyDraftDoc } from '../../ontology/contracts'
|
|
22
24
|
|
|
@@ -91,7 +93,42 @@ export async function toolOntologySceneInspect(agentId: string, args: Record<str
|
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
95
|
|
|
94
|
-
/** 2)
|
|
96
|
+
/** 2) 节点邻接/多跳子图(只读):回答「这个节点关联哪些边、间接关联什么」 */
|
|
97
|
+
export async function toolOntologyNodeNeighbors(agentId: string, args: Record<string, unknown>): Promise<HostToolResult> {
|
|
98
|
+
const lineId = stringArg(args, 'line_id')
|
|
99
|
+
const entityKey = stringArg(args, 'entity_key')
|
|
100
|
+
if (!lineId) return fail('ontology_node_neighbors 需要 line_id(line_context 可看到当前产线 id)')
|
|
101
|
+
if (!entityKey) return fail('ontology_node_neighbors 需要 entity_key(可先用 ontology_scene_inspect 查实体 key)')
|
|
102
|
+
try {
|
|
103
|
+
assertLineInScope(agentId, lineId)
|
|
104
|
+
const opts = parseSubgraphOptions({
|
|
105
|
+
hops: args.hops,
|
|
106
|
+
direction: args.direction,
|
|
107
|
+
kinds: args.kinds,
|
|
108
|
+
})
|
|
109
|
+
const sub = subgraphAroundForLine(lineId, entityKey, opts)
|
|
110
|
+
if (!sub) return ok(`产线 ${lineId} 尚未发布任何本体(0 实体/0 规则);可先用 ontology_draft_create 起草。`)
|
|
111
|
+
const neighbors = sub.nodes.filter(n => n.hop > 0)
|
|
112
|
+
return ok([
|
|
113
|
+
`邻接子图: center=${entityKey} 本体=${sub.ontologyId}@${sub.version} hops=${opts.hops} direction=${opts.direction}`
|
|
114
|
+
+ ` nodes=${sub.nodes.length} edges=${sub.edges.length}${sub.truncated ? ' truncated=true(受 limit 截断)' : ''}`,
|
|
115
|
+
`中心: ${sub.center.key} [${sub.center.kind}/${sub.center.role ?? '未定角色'}] ${sub.center.name}`
|
|
116
|
+
+ `${sub.center.unit ? `(${sub.center.unit})` : ''}${sub.center.description ? ` — ${sub.center.description}` : ''}`
|
|
117
|
+
+ `${sub.center.bindings.length ? ` ← ${sub.center.bindings.map(b => `${b.platformKind}:${b.platformId}${b.targetSub ? `#${b.targetSub}` : ''}(${b.direction},${b.status})`).join(', ')}` : '(未绑定)'}`,
|
|
118
|
+
neighbors.length ? '邻居节点:' : '邻居节点: (无)',
|
|
119
|
+
...neighbors.map(n => `- ${n.key} hop=${n.hop} [${n.kind}/${n.role ?? '未定角色'}] ${n.name}`
|
|
120
|
+
+ `${n.unit ? `(${n.unit})` : ''}`),
|
|
121
|
+
sub.edges.length ? '关联边:' : '关联边: (无)',
|
|
122
|
+
...sub.edges.map(e => `- ${e.id} kind=${e.kind} ${e.srcKey} -> ${e.dstKey} hop=${e.hop} dir=${e.direction} tier=${e.evidenceTier}`),
|
|
123
|
+
'提示:需要规则/守卫/绑定全貌用 ontology_scene_inspect;解释单条规则用 ontology_rule_explain;版本差异用 ontology_version_compare。',
|
|
124
|
+
].join('\n'))
|
|
125
|
+
}
|
|
126
|
+
catch (err) {
|
|
127
|
+
return fail((err as Error).message)
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** 3) 创建草稿(可空白起点或克隆已发布版本) */
|
|
95
132
|
export async function toolOntologyDraftCreate(agentId: string, args: Record<string, unknown>): Promise<HostToolResult> {
|
|
96
133
|
const ontologyId = stringArg(args, 'ontology_id')
|
|
97
134
|
const lineId = stringArg(args, 'line_id')
|
|
@@ -142,6 +179,29 @@ export async function toolOntologyDraftValidate(agentId: string, args: Record<st
|
|
|
142
179
|
}
|
|
143
180
|
}
|
|
144
181
|
|
|
182
|
+
/** 3b) 自动修复草稿(安全规范化;证据不伪造,平台绑定漂移仍如实报告) */
|
|
183
|
+
export async function toolOntologyDraftAutofix(agentId: string, args: Record<string, unknown>): Promise<HostToolResult> {
|
|
184
|
+
const draftId = stringArg(args, 'draft_id')
|
|
185
|
+
if (!draftId) return fail('ontology_draft_autofix 需要 draft_id')
|
|
186
|
+
try {
|
|
187
|
+
const detail = autoFixDraft(draftId, agentActor(agentId))
|
|
188
|
+
const errors = detail.validation.issues.filter(i => i.severity === 'error')
|
|
189
|
+
return ok([
|
|
190
|
+
detail.fixes.length
|
|
191
|
+
? `草稿 ${draftId} 自动修复 ${detail.fixes.length} 项(rev=${detail.draft.rev}):`
|
|
192
|
+
: `草稿 ${draftId} 无需修复(rev=${detail.draft.rev})。`,
|
|
193
|
+
...detail.fixes.slice(0, 20).map(f => `- [${f.code}] ${f.path}: ${f.message}`),
|
|
194
|
+
`修复后校验:${detail.validation.ok ? '通过' : `未通过(${errors.length} 个错误)`}${detail.bindings.ok ? '' : `;绑定失败 ${detail.bindings.failures.length} 项(平台侧,需核对真实节点/配方)`}`,
|
|
195
|
+
errors.length ? '剩余错误:' : '',
|
|
196
|
+
...errors.slice(0, 10).map(i => `- [${i.code}] ${i.path}: ${i.message}`),
|
|
197
|
+
detail.validation.ok ? '下一步:ontology_draft_validate 复核 → ontology_publish_propose 提请发布。' : '剩余错误需补充真实证据/实体后再修复,不能由自动修复伪造。',
|
|
198
|
+
].filter(Boolean).join('\n'))
|
|
199
|
+
}
|
|
200
|
+
catch (err) {
|
|
201
|
+
return fail((err as Error).message)
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
145
205
|
/** 4) 规则解释(DSL + 决策 + 人读来源) */
|
|
146
206
|
export async function toolOntologyRuleExplain(agentId: string, args: Record<string, unknown>): Promise<HostToolResult> {
|
|
147
207
|
const ruleId = stringArg(args, 'rule_id')
|
|
@@ -16,7 +16,7 @@ import { getDcwParamRepo } from '../../dcw/param-map.repo'
|
|
|
16
16
|
import { getOps } from '../../ops/ops'
|
|
17
17
|
import { settingOf } from '../../settings'
|
|
18
18
|
import { fanoutQuery, windowOf } from './audit-query'
|
|
19
|
-
import { assertRecipeCreate, assertRecipeOperation, recipeApprovalPayload } from './recipe-gate'
|
|
19
|
+
import { assertRecipeCreate, assertRecipeOperation, recipeApprovalPayload, type ActiveRecipeContext } from './recipe-gate'
|
|
20
20
|
|
|
21
21
|
// ================================================================
|
|
22
22
|
// 运维日志 / Recipe 变更史查询(Agent 自查面:负责产线 scoped)
|
|
@@ -779,7 +779,7 @@ export async function toolRecipeUpdate(agentId: string, args: {
|
|
|
779
779
|
const old = recipe.params.find(x => x.nodeId === String(p.node_id).trim())?.value
|
|
780
780
|
return { nodeId: String(p.node_id).trim(), name: node?.name ?? String(p.node_id), from: old ?? null, to: Number(p.value), unit: node?.unit }
|
|
781
781
|
}),
|
|
782
|
-
|
|
782
|
+
context: gate.activeContext,
|
|
783
783
|
}) },
|
|
784
784
|
)
|
|
785
785
|
if (!gateDecision.approved) {
|
|
@@ -788,7 +788,7 @@ export async function toolRecipeUpdate(agentId: string, args: {
|
|
|
788
788
|
}
|
|
789
789
|
}
|
|
790
790
|
if (gateDecision.comment) hitlNote = `\n人工附言:${gateDecision.comment}`
|
|
791
|
-
const stale = await revalidateApprovedAction(agentId, recipe, 'update', 'recipe_update', { recipe_id: recipeId })
|
|
791
|
+
const stale = await revalidateApprovedAction(agentId, recipe, 'update', 'recipe_update', { recipe_id: recipeId }, gate.activeContext)
|
|
792
792
|
if (stale) return stale
|
|
793
793
|
}
|
|
794
794
|
// 旧值快照(repo.update 原地改写 recipe.params,事后再取会把 before 读成新值)
|
|
@@ -887,7 +887,7 @@ export async function toolRecipeRollback(agentId: string, args: {
|
|
|
887
887
|
recipe.id,
|
|
888
888
|
`${emergency ? '【应急豁免频控】' : ''}配方回退:「${recipe.name}」→ ${toLastGood ? '已知良好批次冻结' : `v${version}`}${dispatch ? '(统一回退:定义回退+整批重下发)' : '(仅定义回退)'} | 理由:${reason} | 批准=执行回退;拒绝可附指导`,
|
|
889
889
|
`${emergency ? '【应急】' : ''}配方回退审批`,
|
|
890
|
-
{ payload: { ...recipeApprovalPayload('rollback', recipe.id, recipe.name, { reason,
|
|
890
|
+
{ payload: { ...recipeApprovalPayload('rollback', recipe.id, recipe.name, { reason, context: gate.activeContext }), ...(emergency ? { emergency: true } : {}) } },
|
|
891
891
|
)
|
|
892
892
|
gateApprovalId = gateDecision.id
|
|
893
893
|
if (!gateDecision.approved) {
|
|
@@ -896,11 +896,15 @@ export async function toolRecipeRollback(agentId: string, args: {
|
|
|
896
896
|
}
|
|
897
897
|
}
|
|
898
898
|
if (gateDecision.comment) hitlNote = `\n人工附言:${gateDecision.comment}`
|
|
899
|
-
const stale = await revalidateApprovedAction(agentId, recipe, 'rollback', 'recipe_rollback', { recipe_id: recipeId })
|
|
899
|
+
const stale = await revalidateApprovedAction(agentId, recipe, 'rollback', 'recipe_rollback', { recipe_id: recipeId }, gate.activeContext)
|
|
900
900
|
if (stale) return stale
|
|
901
901
|
}
|
|
902
902
|
try {
|
|
903
903
|
if (dispatch) {
|
|
904
|
+
if (gate.hitlRequired) {
|
|
905
|
+
const staleAtDispatch = approvedContextError(agentId, recipe, 'rollback', gate.activeContext)
|
|
906
|
+
if (staleAtDispatch) return staleAtDispatch
|
|
907
|
+
}
|
|
904
908
|
const { recipe: updated, run, definitionNoop } = await getDcwController().rollbackRecipeAndDispatch(recipeId, {
|
|
905
909
|
version: toLastGood ? undefined : version,
|
|
906
910
|
toLastGood,
|
|
@@ -979,23 +983,46 @@ async function hitlDispatchGate(agentId: string, recipeId: string, detail: strin
|
|
|
979
983
|
}
|
|
980
984
|
|
|
981
985
|
/**
|
|
982
|
-
*
|
|
983
|
-
*
|
|
986
|
+
* 审批返回「批准」后的二次状态复核:审批可能挂起数分钟,
|
|
987
|
+
* 期间绑定/产线授权/活动产线上下文都可能变化。批准不等于授权与上下文仍然有效:
|
|
984
988
|
* - 重新跑 assertRecipeOperation(绑定/二级认证/运行门);
|
|
989
|
+
* - 将当前 line/product/recipe/run 元组与审批时快照比较,变化即拒绝;
|
|
985
990
|
* - 重新跑 grant-guard(频道属主的产线 grant,收权即失活)。
|
|
986
|
-
* 任一失败 → 本次不执行,回包说明原因(Agent
|
|
991
|
+
* 任一失败 → 本次不执行,回包说明原因(Agent 可据此核实上下文并重新申请)。
|
|
987
992
|
*/
|
|
993
|
+
function approvedContextError(
|
|
994
|
+
agentId: string,
|
|
995
|
+
recipe: { id: string, name: string, lineId?: string, access?: { requireAuth?: boolean, authorizedAgentIds?: string[] } },
|
|
996
|
+
op: 'update' | 'dispatch' | 'trial' | 'rollback',
|
|
997
|
+
expectedContext: ActiveRecipeContext,
|
|
998
|
+
): { text: string, isError: true } | null {
|
|
999
|
+
const currentGate = assertRecipeOperation(agentId, recipe, op)
|
|
1000
|
+
if (!currentGate.ok) {
|
|
1001
|
+
return { text: `人工已批准,但审批期间授权已失效,本次未执行:${currentGate.text}`, isError: true }
|
|
1002
|
+
}
|
|
1003
|
+
const current = currentGate.activeContext
|
|
1004
|
+
if (current.lineId !== expectedContext.lineId
|
|
1005
|
+
|| current.runId !== expectedContext.runId
|
|
1006
|
+
|| current.recipeId !== expectedContext.recipeId
|
|
1007
|
+
|| current.productId !== expectedContext.productId) {
|
|
1008
|
+
return {
|
|
1009
|
+
text: '人工已批准,但审批期间产线/产品/配方/批次上下文已变化,本次未执行。请核查当前运行上下文后重新提交。',
|
|
1010
|
+
isError: true,
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
return null
|
|
1014
|
+
}
|
|
1015
|
+
|
|
988
1016
|
export async function revalidateApprovedAction(
|
|
989
1017
|
agentId: string,
|
|
990
1018
|
recipe: { id: string, name: string, lineId?: string, access?: { requireAuth?: boolean, authorizedAgentIds?: string[] } },
|
|
991
1019
|
op: 'update' | 'dispatch' | 'trial' | 'rollback',
|
|
992
1020
|
toolName: string,
|
|
993
1021
|
args: Record<string, unknown>,
|
|
1022
|
+
expectedContext: ActiveRecipeContext,
|
|
994
1023
|
): Promise<{ text: string, isError: true } | null> {
|
|
995
|
-
const
|
|
996
|
-
if (
|
|
997
|
-
return { text: `人工已批准,但审批期间授权已失效,本次未执行:${again.text}`, isError: true }
|
|
998
|
-
}
|
|
1024
|
+
const initialContextError = approvedContextError(agentId, recipe, op, expectedContext)
|
|
1025
|
+
if (initialContextError) return initialContextError
|
|
999
1026
|
try {
|
|
1000
1027
|
// manager 未装配(单测/嵌入)→ 只做绑定与运行门复核;装配后叠加产线 grant 复核
|
|
1001
1028
|
const g = globalThis as typeof globalThis & {
|
|
@@ -1011,6 +1038,11 @@ export async function revalidateApprovedAction(
|
|
|
1011
1038
|
catch (err) {
|
|
1012
1039
|
return { text: `人工已批准,但审批后权限复核不可用,本次未执行:${err instanceof Error ? err.message : String(err)}。请稍后重试。`, isError: true }
|
|
1013
1040
|
}
|
|
1041
|
+
// Grant lookup is asynchronous. Re-read the active tuple after that await so
|
|
1042
|
+
// queued line/run changes cannot pass between the initial comparison and the
|
|
1043
|
+
// caller's dispatch continuation.
|
|
1044
|
+
const changedAfterGrantCheck = approvedContextError(agentId, recipe, op, expectedContext)
|
|
1045
|
+
if (changedAfterGrantCheck) return changedAfterGrantCheck
|
|
1014
1046
|
return null
|
|
1015
1047
|
}
|
|
1016
1048
|
|
|
@@ -1086,7 +1118,7 @@ export async function toolRecipeTrial(agentId: string, args: {
|
|
|
1086
1118
|
const old = recipe.params.find(x => x.nodeId === p.nodeId)?.value
|
|
1087
1119
|
return { nodeId: p.nodeId, name: node?.name ?? p.nodeId, from: old ?? null, to: p.value, unit: node?.unit }
|
|
1088
1120
|
}),
|
|
1089
|
-
|
|
1121
|
+
context: gate.activeContext,
|
|
1090
1122
|
}), ...(emergency ? { emergency: true } : {}) } },
|
|
1091
1123
|
)
|
|
1092
1124
|
gateApprovalId = gateDecision.id
|
|
@@ -1097,8 +1129,10 @@ export async function toolRecipeTrial(agentId: string, args: {
|
|
|
1097
1129
|
}
|
|
1098
1130
|
// 人工附言随批准回执回流(Agent 与审计都能看到放行时人的原话)
|
|
1099
1131
|
if (gateDecision.comment) hitlNote = `\n人工附言:${gateDecision.comment}`
|
|
1100
|
-
const stale = await revalidateApprovedAction(agentId, recipe, 'trial', 'recipe_trial', { recipe_id: recipeId })
|
|
1132
|
+
const stale = await revalidateApprovedAction(agentId, recipe, 'trial', 'recipe_trial', { recipe_id: recipeId }, gate.activeContext)
|
|
1101
1133
|
if (stale) return stale
|
|
1134
|
+
const staleAtDispatch = approvedContextError(agentId, recipe, 'trial', gate.activeContext)
|
|
1135
|
+
if (staleAtDispatch) return staleAtDispatch
|
|
1102
1136
|
}
|
|
1103
1137
|
const run = await getDcwController().applyRecipe(recipeId, { overrides: list, trial: true, agentDispatch: true, agentApprovalId: gateApprovalId, emergency })
|
|
1104
1138
|
// ACK 鉴定三段口径(2026-10-08):ok 只是命令受理,未证实/失败必须如实回给 Agent
|
|
@@ -1187,7 +1221,7 @@ export async function toolRecipeApply(agentId: string, args: {
|
|
|
1187
1221
|
const node = getDcwController().byId(p.nodeId)
|
|
1188
1222
|
return { nodeId: p.nodeId, name: node?.name ?? p.nodeId, from: null, to: p.value, unit: node?.unit }
|
|
1189
1223
|
}),
|
|
1190
|
-
|
|
1224
|
+
context: gate.activeContext,
|
|
1191
1225
|
}), recipeVersion: dispatch.version, ...(emergency ? { emergency: true } : {}) } },
|
|
1192
1226
|
)
|
|
1193
1227
|
gateApprovalId = gateDecision.id
|
|
@@ -1198,7 +1232,7 @@ export async function toolRecipeApply(agentId: string, args: {
|
|
|
1198
1232
|
}
|
|
1199
1233
|
// 人工附言随批准回执回流(与 recipe_trial 同口径)
|
|
1200
1234
|
if (gateDecision.comment) hitlNote = `\n人工附言:${gateDecision.comment}`
|
|
1201
|
-
const stale = await revalidateApprovedAction(agentId, recipe, 'dispatch', 'recipe_apply', { recipe_id: recipeId })
|
|
1235
|
+
const stale = await revalidateApprovedAction(agentId, recipe, 'dispatch', 'recipe_apply', { recipe_id: recipeId }, gate.activeContext)
|
|
1202
1236
|
if (stale) return stale
|
|
1203
1237
|
}
|
|
1204
1238
|
// 放在最后一次 await 之后,与 applyRecipe 的同步取值/建批之间不再让出执行权。
|
|
@@ -1206,6 +1240,10 @@ export async function toolRecipeApply(agentId: string, args: {
|
|
|
1206
1240
|
if (!currentRecipe || JSON.stringify(currentRecipe) !== approvedDefinition) {
|
|
1207
1241
|
return { text: '配方在审批期间已变更,与本次审批展示的快照不一致,本次未执行。请核查最新配方后重新提交 recipe_apply。', isError: true }
|
|
1208
1242
|
}
|
|
1243
|
+
if (gate.hitlRequired) {
|
|
1244
|
+
const staleAtDispatch = approvedContextError(agentId, recipe, 'dispatch', gate.activeContext)
|
|
1245
|
+
if (staleAtDispatch) return staleAtDispatch
|
|
1246
|
+
}
|
|
1209
1247
|
// 完整覆盖集让控制器复制每个已批准值,逐参数异步写期间也不再共享可变配方参数。
|
|
1210
1248
|
const run = await getDcwController().applyRecipe(recipeId, { overrides: dispatch.params, agentDispatch: true, agentApprovalId: gateApprovalId, emergency })
|
|
1211
1249
|
// ACK 鉴定三段口径(2026-10-08):ok 只是命令受理,未证实/失败必须如实回给 Agent
|
|
@@ -233,6 +233,8 @@ export async function toolOptimizerProfilePropose(agentId: string, args: Record<
|
|
|
233
233
|
templateRef: args.template_ref as Parameters<typeof proposeProfileAdoption>[0]['templateRef'],
|
|
234
234
|
solverRef: args.solver_ref as Parameters<typeof proposeProfileAdoption>[0]['solverRef'],
|
|
235
235
|
reason,
|
|
236
|
+
profileName: str(args.profile_name),
|
|
237
|
+
profileDescription: str(args.profile_description),
|
|
236
238
|
})
|
|
237
239
|
|
|
238
240
|
if (!result.decision.approved) {
|
|
@@ -20,12 +20,19 @@ import { getActiveLineRun } from '../../dcw/line-run'
|
|
|
20
20
|
|
|
21
21
|
export type RecipeOp = 'update' | 'dispatch' | 'trial' | 'rollback' | 'create'
|
|
22
22
|
|
|
23
|
+
export type ActiveRecipeContext = {
|
|
24
|
+
lineId: string
|
|
25
|
+
runId: string
|
|
26
|
+
recipeId: string
|
|
27
|
+
productId: string
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
export type RecipeGateResult
|
|
24
|
-
= | { ok: true, binding: AgentNodeBinding, hitlRequired: boolean,
|
|
31
|
+
= | { ok: true, binding: AgentNodeBinding, hitlRequired: boolean, activeContext: ActiveRecipeContext }
|
|
25
32
|
| { ok: false, text: string }
|
|
26
33
|
|
|
27
34
|
/** 运行门:该配方当前是否有活动批次(未结束的 run) */
|
|
28
|
-
export function activeRunOfRecipe(recipeId: string):
|
|
35
|
+
export function activeRunOfRecipe(recipeId: string): ActiveRecipeContext | null {
|
|
29
36
|
const run = getDcwController().listRuns().find(r => r.recipeId === recipeId && !r.endedAt)
|
|
30
37
|
if (!run) return null
|
|
31
38
|
// 反僵尸交叉校验(鲁棒性):DB 行未结束 ≠ 产线在运行 —— 多次 apply/崩溃/重启会泄漏
|
|
@@ -33,8 +40,13 @@ export function activeRunOfRecipe(recipeId: string): { id: string } | null {
|
|
|
33
40
|
// 权威运行态是 line-run 注册表(内存+line-runs.json 落盘,崩溃可恢复):
|
|
34
41
|
// run 所属产线必须在注册表中运行,且注册表的活跃批次就是本批次。
|
|
35
42
|
const active = getActiveLineRun(run.lineId)
|
|
36
|
-
if (!active || active.runId !== run.id) return null
|
|
37
|
-
return {
|
|
43
|
+
if (!active || active.runId !== run.id || active.recipeId !== recipeId) return null
|
|
44
|
+
return {
|
|
45
|
+
lineId: active.lineId,
|
|
46
|
+
runId: active.runId,
|
|
47
|
+
recipeId: active.recipeId,
|
|
48
|
+
productId: active.productId,
|
|
49
|
+
}
|
|
38
50
|
}
|
|
39
51
|
|
|
40
52
|
/** 统一鉴权门:绑定 → 二级认证 → 运行门;返回绑定与 HITL 判定(不做挂起,挂起由调用方执行) */
|
|
@@ -74,7 +86,7 @@ export function assertRecipeOperation(
|
|
|
74
86
|
// ⑤ 全局开关兼容位:security.recipeDispatchApproval 开启时即便 auto 也挂审批(保留语义)
|
|
75
87
|
const globalGate = false // 由调用方按 settingOf('security.recipeDispatchApproval') 叠加(本模块不依赖设置服务)
|
|
76
88
|
void globalGate
|
|
77
|
-
return { ok: true, binding, hitlRequired: binding.mode === 'manual' || lineManual,
|
|
89
|
+
return { ok: true, binding, hitlRequired: binding.mode === 'manual' || lineManual, activeContext: run }
|
|
78
90
|
}
|
|
79
91
|
|
|
80
92
|
/** 新建配方的授权门(尚无 recipe 可绑定):要求 Agent 在该线至少有一个写向绑定
|
|
@@ -116,6 +128,7 @@ export function assertRecipeCreate(agentId: string, lineId: string): { ok: true,
|
|
|
116
128
|
export function recipeApprovalPayload(op: RecipeOp, recipeId: string, recipeName: string, extra: {
|
|
117
129
|
reason: string
|
|
118
130
|
params?: Array<{ nodeId: string, name: string, from: number | null, to: number, unit?: string }>
|
|
131
|
+
context?: ActiveRecipeContext
|
|
119
132
|
runId?: string
|
|
120
133
|
}): Record<string, unknown> {
|
|
121
134
|
return {
|
|
@@ -126,6 +139,6 @@ export function recipeApprovalPayload(op: RecipeOp, recipeId: string, recipeName
|
|
|
126
139
|
recipeName,
|
|
127
140
|
reason: extra.reason,
|
|
128
141
|
...(extra.params ? { params: extra.params } : {}),
|
|
129
|
-
...(extra.runId ? { runId: extra.runId } : {}),
|
|
142
|
+
...(extra.context ? { context: { ...extra.context }, runId: extra.context.runId } : extra.runId ? { runId: extra.runId } : {}),
|
|
130
143
|
}
|
|
131
144
|
}
|
|
@@ -278,7 +278,7 @@ export async function toolRecipePropose(agentId: string, args: {
|
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
// 批准不等于授权仍有效:复核绑定/认证/运行门/产线 grant(审批期间可能被撤销)
|
|
281
|
-
const stale = await revalidateApprovedAction(agentId, recipe, 'dispatch', 'recipe_propose', { recipe_id: recipeId })
|
|
281
|
+
const stale = await revalidateApprovedAction(agentId, recipe, 'dispatch', 'recipe_propose', { recipe_id: recipeId }, gate.activeContext)
|
|
282
282
|
if (stale) return stale
|
|
283
283
|
|
|
284
284
|
// ---------- ⑦b 批准(choice 已由 decide 链 fail-closed 归一):选定包整批下发 ----------
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { AgentWorkspace } from '../agent-interface'
|
|
2
|
+
import type { AgentSessionEvent } from '../adapters/omp-rpc-client'
|
|
3
|
+
import { toolArgsPreview } from '../prompt-builder'
|
|
4
|
+
|
|
5
|
+
/** Compact, history-compatible audit line for a host tool used during lead supervision. */
|
|
6
|
+
export function supervisionToolHistoryMessage(event: AgentSessionEvent): string | null {
|
|
7
|
+
const toolName = typeof event.toolName === 'string' && event.toolName ? event.toolName : 'tool'
|
|
8
|
+
if (event.type === 'tool_execution_start') {
|
|
9
|
+
return `🔧 ${toolName}${toolArgsPreview(event.args)}`
|
|
10
|
+
}
|
|
11
|
+
if (event.type !== 'tool_execution_end') return null
|
|
12
|
+
|
|
13
|
+
const rawResult = event.result ?? event.output ?? ''
|
|
14
|
+
let summary: string
|
|
15
|
+
if (typeof rawResult === 'string') {
|
|
16
|
+
summary = rawResult
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
try {
|
|
20
|
+
summary = JSON.stringify(rawResult) ?? ''
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
summary = '(不可序列化结果)'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
summary = summary.slice(0, 300)
|
|
27
|
+
return `🔧 ${toolName} ${event.isError === true ? '❌ 失败' : '✅ 完成'}${summary ? `: ${summary}` : ''}`
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Persist a supervisor host-tool event against the active root task when it is still open. */
|
|
31
|
+
export async function recordSupervisionToolHistory(
|
|
32
|
+
workspace: Pick<AgentWorkspace, 'reportTask'>,
|
|
33
|
+
taskId: string,
|
|
34
|
+
event: AgentSessionEvent,
|
|
35
|
+
): Promise<void> {
|
|
36
|
+
const message = supervisionToolHistoryMessage(event)
|
|
37
|
+
if (message) await workspace.reportTask({ taskId, message })
|
|
38
|
+
}
|
|
@@ -7,6 +7,7 @@ import type { AgentEvent, AgentRunContext, AgentRunRequest, SupervisionDecision,
|
|
|
7
7
|
import type { HostToolCallRequest } from '../adapters/omp-rpc-client'
|
|
8
8
|
import { extractJsonArray, parseSteerBanner, peerPrompt, supervisePrompt, systemManual, workerPrompt } from '../prompt-builder'
|
|
9
9
|
import { log } from './helpers'
|
|
10
|
+
import { recordSupervisionToolHistory } from './supervision-history'
|
|
10
11
|
|
|
11
12
|
export abstract class OmpRpcAgentImplToolsSteer extends OmpRpcAgentImplLifecycle {
|
|
12
13
|
/** 引擎无关工具面:REST/MCP 桥直调与 omp 内部 host_tool_call 共用同一实现 */
|
|
@@ -97,6 +98,12 @@ export abstract class OmpRpcAgentImplToolsSteer extends OmpRpcAgentImplLifecycle
|
|
|
97
98
|
return new Promise<SupervisionDecision[]>((resolve) => {
|
|
98
99
|
let assistantText = ''
|
|
99
100
|
let resolved = false
|
|
101
|
+
const activeRootTask = snapshot.tasks.find(task =>
|
|
102
|
+
task.id === snapshot.activeRootId
|
|
103
|
+
&& task.assigneeId === this.selfAgentId
|
|
104
|
+
&& ['SUBMITTED', 'ASSIGNED', 'WORKING', 'WAITING'].includes(task.state),
|
|
105
|
+
)
|
|
106
|
+
let taskHistoryWrites = Promise.resolve()
|
|
100
107
|
|
|
101
108
|
const finish = (decisions: SupervisionDecision[]) => {
|
|
102
109
|
if (resolved) return
|
|
@@ -107,7 +114,7 @@ export abstract class OmpRpcAgentImplToolsSteer extends OmpRpcAgentImplLifecycle
|
|
|
107
114
|
unsub()
|
|
108
115
|
if (hardTimer) clearTimeout(hardTimer)
|
|
109
116
|
signalUnsub?.()
|
|
110
|
-
resolve(decisions)
|
|
117
|
+
void taskHistoryWrites.then(() => resolve(decisions), () => resolve(decisions))
|
|
111
118
|
}
|
|
112
119
|
|
|
113
120
|
const abortTurn = (reason: string): void => {
|
|
@@ -118,6 +125,16 @@ export abstract class OmpRpcAgentImplToolsSteer extends OmpRpcAgentImplLifecycle
|
|
|
118
125
|
}
|
|
119
126
|
|
|
120
127
|
const unsub = this.client!.onEvent((event) => {
|
|
128
|
+
if (activeRootTask && (event.type === 'tool_execution_start' || event.type === 'tool_execution_end')) {
|
|
129
|
+
// Lead supervision is not a workerTurn, so its host-tool events do not
|
|
130
|
+
// pass through promptAndStream's task event mapper. Persist them on the
|
|
131
|
+
// active root while it is open, preserving tool-call/result chronology.
|
|
132
|
+
taskHistoryWrites = taskHistoryWrites.then(async () => {
|
|
133
|
+
await recordSupervisionToolHistory(ctx.workspace, activeRootTask.id, event)
|
|
134
|
+
}).catch((err) => {
|
|
135
|
+
log.error(`[OmpRpcAgent:${this.selfAgentId}] supervise task-history write failed:`, err)
|
|
136
|
+
})
|
|
137
|
+
}
|
|
121
138
|
if (event.type === 'message_update' && event.assistantMessageEvent?.type === 'text_delta') {
|
|
122
139
|
this.streaming = true
|
|
123
140
|
assistantText += event.assistantMessageEvent.delta ?? ''
|
|
@@ -460,6 +460,22 @@ export function createAmlRepo(db: DatabaseSync) {
|
|
|
460
460
|
updateNote(id: string, note: string): void {
|
|
461
461
|
db.prepare('UPDATE aml_models SET note = ? WHERE id = ?').run(note, id)
|
|
462
462
|
},
|
|
463
|
+
/** 人读身份维护(Agent/REST 共用):只改 label/description,不改阶段与工件 */
|
|
464
|
+
updateIdentity(id: string, patch: { label?: string, description?: string }): void {
|
|
465
|
+
const sets: string[] = []
|
|
466
|
+
const args: unknown[] = []
|
|
467
|
+
if (patch.label !== undefined) {
|
|
468
|
+
sets.push('label = ?')
|
|
469
|
+
args.push(patch.label.slice(0, 200))
|
|
470
|
+
}
|
|
471
|
+
if (patch.description !== undefined) {
|
|
472
|
+
sets.push('description = ?')
|
|
473
|
+
args.push(patch.description.slice(0, 500))
|
|
474
|
+
}
|
|
475
|
+
if (!sets.length) return
|
|
476
|
+
args.push(id)
|
|
477
|
+
db.prepare(`UPDATE aml_models SET ${sets.join(', ')} WHERE id = ?`).run(...(args as never[]))
|
|
478
|
+
},
|
|
463
479
|
},
|
|
464
480
|
}
|
|
465
481
|
}
|
|
@@ -22,16 +22,23 @@ export async function getDaqQueue(): Promise<DaqQueuePort> {
|
|
|
22
22
|
|
|
23
23
|
/** 重连/初始装配:按 infra 判定结果(重新)构建 MQTT 或进程内队列 */
|
|
24
24
|
export async function rebuildDaqQueue(online: boolean, url?: string | null): Promise<DaqQueuePort> {
|
|
25
|
-
// 换装前释放旧 adapter(mqtt 连接 / inproc 泵),防重建泄漏
|
|
26
|
-
await g.__daqQueue?.close?.()
|
|
27
25
|
if (!online || !url) {
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
// Reuse an in-process adapter without closing it. close() clears consumers and
|
|
27
|
+
// stops its pump; getDaqQueue() will not initialize an existing instance again.
|
|
28
|
+
if (g.__daqQueue?.backend === 'inproc') {
|
|
30
29
|
await g.__daqQueue.init()
|
|
31
|
-
|
|
30
|
+
return g.__daqQueue
|
|
32
31
|
}
|
|
32
|
+
// When falling back from MQTT, install a fresh adapter; the controller reattaches
|
|
33
|
+
// its consumer after this replacement.
|
|
34
|
+
await g.__daqQueue?.close?.()
|
|
35
|
+
g.__daqQueue = new InProcQueueAdapter()
|
|
36
|
+
await g.__daqQueue.init()
|
|
37
|
+
log.warn('[daq-queue] 降级进程内队列')
|
|
33
38
|
return g.__daqQueue
|
|
34
39
|
}
|
|
40
|
+
// Release the previous adapter before a transition to MQTT.
|
|
41
|
+
await g.__daqQueue?.close?.()
|
|
35
42
|
try {
|
|
36
43
|
const adapter = new MqttQueueAdapter(url)
|
|
37
44
|
await adapter.init()
|