@ensocode/server 0.3.11 → 0.3.13
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/LICENSE +679 -19
- package/out/phone/assets/EditDiff-B3HxLrbF.js +28 -0
- package/out/phone/assets/ReadFileView-BFpGH-kK.js +7 -0
- package/out/phone/assets/{abnfDiagram-VCTEODGH-DeKO4j9Y.js → abnfDiagram-VCTEODGH-BNvyPGoF.js} +1 -1
- package/out/phone/assets/architecture-7GRP2DOG-Duql1LsL.js +1 -0
- package/out/phone/assets/{architectureDiagram-5GKGNRK7-DhPgDhMQ.js → architectureDiagram-5GKGNRK7-1bhpTEFA.js} +1 -1
- package/out/phone/assets/{blockDiagram-I7D4REHJ-CHjEV4S2.js → blockDiagram-I7D4REHJ-Bo9UMudu.js} +1 -1
- package/out/phone/assets/{c4Diagram-7LVT6UL2-C_w2ZiGg.js → c4Diagram-7LVT6UL2-YS11cig2.js} +1 -1
- package/out/phone/assets/channel-BPoIHov1.js +1 -0
- package/out/phone/assets/{chunk-4HAMMTFA-DsFB5306.js → chunk-4HAMMTFA-gA-CzNGD.js} +1 -1
- package/out/phone/assets/{chunk-75Z2AOVW-D-GYq_Mf.js → chunk-75Z2AOVW-BL_5b1Dw.js} +1 -1
- package/out/phone/assets/{chunk-DU6HZSFF-CfnOn1uu.js → chunk-DU6HZSFF-BpNlAs9R.js} +1 -1
- package/out/phone/assets/{chunk-F27PBJKO-DFQr9a2N.js → chunk-F27PBJKO-lsKx96Nt.js} +1 -1
- package/out/phone/assets/{chunk-GMAD6QVW--AoHkXxN.js → chunk-GMAD6QVW-CxbljbtE.js} +1 -1
- package/out/phone/assets/{chunk-GVQU2GXP-CzbFqhoi.js → chunk-GVQU2GXP-CTO3kTOF.js} +1 -1
- package/out/phone/assets/{chunk-IMKFNOWR-DT26rqUA.js → chunk-IMKFNOWR-Cq8XlkcB.js} +1 -1
- package/out/phone/assets/{chunk-L3NEJ4N5-CvadXD9U.js → chunk-L3NEJ4N5-CvIm0JX7.js} +1 -1
- package/out/phone/assets/{chunk-OSK3NFVY-DROHZT6z.js → chunk-OSK3NFVY-Cj3ilTL-.js} +1 -1
- package/out/phone/assets/{chunk-P2QGCYS3-BcsvTFQT.js → chunk-P2QGCYS3-B-twI_Fz.js} +1 -1
- package/out/phone/assets/{chunk-POPQ4Y6H-Bib7YUpn.js → chunk-POPQ4Y6H-lPQttJ5s.js} +1 -1
- package/out/phone/assets/{chunk-PWAF6VOD-CrsdfQvi.js → chunk-PWAF6VOD-DjwqZuIR.js} +1 -1
- package/out/phone/assets/{chunk-SHT3W25Y-BSSsjkbn.js → chunk-SHT3W25Y-BWRVin1H.js} +1 -1
- package/out/phone/assets/{chunk-SVP7TREG-BorYBfcS.js → chunk-SVP7TREG-CGLhvnsS.js} +1 -1
- package/out/phone/assets/{chunk-TICWLB2K-DwWprz_z.js → chunk-TICWLB2K-DkFUa03q.js} +1 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-CIR76lHP.js +1 -0
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-CIR76lHP.js +1 -0
- package/out/phone/assets/codeHighlighter-jQti-W31.js +1346 -0
- package/out/phone/assets/{cynefin-OW5HDTMX-UxW1ctBn.js → cynefin-OW5HDTMX-L8oWVu5S.js} +1 -1
- package/out/phone/assets/{cynefinDiagram-5FMLGOSQ-3xyjt_Zk.js → cynefinDiagram-5FMLGOSQ-DH8-4p4N.js} +1 -1
- package/out/phone/assets/{dagre-GXQ25YYZ-BA8g5sNo.js → dagre-GXQ25YYZ-HhLDmcu9.js} +1 -1
- package/out/phone/assets/desk-CixRGdTk.js +52 -0
- package/out/phone/assets/{diagram-S7CK7UJ4-CqaAk0xY.js → diagram-S7CK7UJ4-CeIbR3Ir.js} +1 -1
- package/out/phone/assets/{diagram-UQ7AKVKN-BJs2alr_.js → diagram-UQ7AKVKN-BQ84Qnq6.js} +1 -1
- package/out/phone/assets/{diagram-VSXAHHWV-goFBlClH.js → diagram-VSXAHHWV-aF_J57fD.js} +1 -1
- package/out/phone/assets/{diagram-VX7I27RA-NC_soOMz.js → diagram-VX7I27RA-Bg1ZqM4Y.js} +1 -1
- package/out/phone/assets/{diagram-Z3DM3KII-CPBmdhd-.js → diagram-Z3DM3KII-DjTkPAqa.js} +1 -1
- package/out/phone/assets/{ebnfDiagram-PWID7BFC-e_KXtWp1.js → ebnfDiagram-PWID7BFC-DPsH5Eky.js} +1 -1
- package/out/phone/assets/{erDiagram-RLTQ6QDP-BV3oU6Yk.js → erDiagram-RLTQ6QDP-ExvY7e6T.js} +1 -1
- package/out/phone/assets/eventmodeling-NTZA5JFV-DYp-zWcL.js +1 -0
- package/out/phone/assets/flowDiagram-HODETNUW-CIU32By5.js +1 -0
- package/out/phone/assets/{ganttDiagram-EL5Y4UJY-DOtr1Ilh.js → ganttDiagram-EL5Y4UJY-hCe06ucl.js} +1 -1
- package/out/phone/assets/{gitGraph-4MIJSDKK-D0CbVtzh.js → gitGraph-4MIJSDKK-BuZ6lDat.js} +1 -1
- package/out/phone/assets/{gitGraphDiagram-WWUBYQGX-C6wXAX8a.js → gitGraphDiagram-WWUBYQGX-D-8aVxvj.js} +1 -1
- package/out/phone/assets/{info-A6RAGUB7-BLbppMXJ.js → info-A6RAGUB7-CrZtdoYs.js} +1 -1
- package/out/phone/assets/{infoDiagram-27XIBGKW-DOlhaNYG.js → infoDiagram-27XIBGKW-BLRFHxtO.js} +1 -1
- package/out/phone/assets/{ishikawaDiagram-5VMMS53U-BtaSUSnr.js → ishikawaDiagram-5VMMS53U-D7SYWKoj.js} +1 -1
- package/out/phone/assets/{journeyDiagram-3NMN7TZE-C6DElK_Y.js → journeyDiagram-3NMN7TZE-BPsg7CQD.js} +1 -1
- package/out/phone/assets/{kanban-definition-UXKFOSKX-WqCAwlkm.js → kanban-definition-UXKFOSKX-CbPuNr-E.js} +1 -1
- package/out/phone/assets/{line-CvY1fizC.js → line-CkpKMiqK.js} +1 -1
- package/out/phone/assets/main-BCnf7dVM.js +264 -0
- package/out/phone/assets/main-nqB-uD3v.css +2 -0
- package/out/phone/assets/{mermaid-parser.core-BNyl33x8.js → mermaid-parser.core-RTq_mEm1.js} +3 -3
- package/out/phone/assets/{mermaid.core-BnUF0ZCX.js → mermaid.core-D9LtIKua.js} +4 -4
- package/out/phone/assets/{mindmap-definition-YA3MSWOX-CsORTLIm.js → mindmap-definition-YA3MSWOX-8cGgRiRD.js} +1 -1
- package/out/phone/assets/{packet-AYTQ26CC-CoxwVVdp.js → packet-AYTQ26CC-D9-eSn0v.js} +1 -1
- package/out/phone/assets/{pegDiagram-XKGWAZYB-BI2W6aLH.js → pegDiagram-XKGWAZYB-DztU_rIE.js} +1 -1
- package/out/phone/assets/{pie-WAS4IAKB-CQD3JNcj.js → pie-WAS4IAKB-Bk2Tqaq_.js} +1 -1
- package/out/phone/assets/{pieDiagram-E7YTZNPT-aLnzVgco.js → pieDiagram-E7YTZNPT-Dm_3mJ9_.js} +1 -1
- package/out/phone/assets/{quadrantDiagram-AXDQQJYC-Cbl0x-Id.js → quadrantDiagram-AXDQQJYC-lKskzjzu.js} +1 -1
- package/out/phone/assets/{radar-RG4KPBEZ-Bu2EN1RM.js → radar-RG4KPBEZ-B2z8Txd8.js} +1 -1
- package/out/phone/assets/{railroad-74A4TZTK-DiiOMWSM.js → railroad-74A4TZTK-11VmdALq.js} +1 -1
- package/out/phone/assets/railroad-abnf-HS5TGJTU-BkSycwye.js +1 -0
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-BsPIU3iV.js +1 -0
- package/out/phone/assets/railroad-peg-WCYAUIDC-Cy8G7u5C.js +1 -0
- package/out/phone/assets/{railroadDiagram-O6MQD6OU-r5JJp9nP.js → railroadDiagram-O6MQD6OU-Dr0NTIA6.js} +1 -1
- package/out/phone/assets/{requirementDiagram-BXWQKSXE-Bh86zb_w.js → requirementDiagram-BXWQKSXE-C0W6h_5I.js} +1 -1
- package/out/phone/assets/{sankeyDiagram-P5KCCOFB-CykRlthT.js → sankeyDiagram-P5KCCOFB-CVJDathY.js} +1 -1
- package/out/phone/assets/{sequenceDiagram-WJ2MYXX4-BPLcD6MF.js → sequenceDiagram-WJ2MYXX4-BxHQTG6x.js} +1 -1
- package/out/phone/assets/shellUpdate-DPSfgHG3.js +36 -0
- package/out/phone/assets/{stateDiagram-D77RDMKH-DWXApcUM.js → stateDiagram-D77RDMKH-BO5MAjhs.js} +1 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-B8IHc2bm.js +1 -0
- package/out/phone/assets/{swimlanes-42K2YHIH-BVi6IPTq.js → swimlanes-42K2YHIH-DnhDPyy6.js} +1 -1
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-dmSDAN2F.js +8 -0
- package/out/phone/assets/{timeline-definition-24CTP7MA-xf--BXjO.js → timeline-definition-24CTP7MA-bLEjS7re.js} +1 -1
- package/out/phone/assets/{treeView-Q6P3EWNA-DzJs7PRI.js → treeView-Q6P3EWNA-Ci-sA9wK.js} +1 -1
- package/out/phone/assets/{treemap-WGGIJYW6-AXb7EeRP.js → treemap-WGGIJYW6-BXCjzK65.js} +1 -1
- package/out/phone/assets/{vennDiagram-4TSXK5OY-CXDX5KG5.js → vennDiagram-4TSXK5OY-DHsj5dRx.js} +1 -1
- package/out/phone/assets/{wardley-WFR3VGLG-DrSIz3RL.js → wardley-WFR3VGLG-d8TdCu-H.js} +1 -1
- package/out/phone/assets/{wardleyDiagram-VM6X3IG4-DFL8ndUf.js → wardleyDiagram-VM6X3IG4-DQFVP9qu.js} +1 -1
- package/out/phone/assets/{xychartDiagram-S5SC5T6Z-CZZX0maW.js → xychartDiagram-S5SC5T6Z-Dni2Y0ov.js} +1 -1
- package/out/phone/desk.html +81 -2
- package/out/phone/index.html +51 -3
- package/out/phone/manifest.webmanifest +1 -0
- package/out/phone/splash/1125x2436-dark.png +0 -0
- package/out/phone/splash/1125x2436-light.png +0 -0
- package/out/phone/splash/1170x2532-dark.png +0 -0
- package/out/phone/splash/1170x2532-light.png +0 -0
- package/out/phone/splash/1179x2556-dark.png +0 -0
- package/out/phone/splash/1179x2556-light.png +0 -0
- package/out/phone/splash/1206x2622-dark.png +0 -0
- package/out/phone/splash/1206x2622-light.png +0 -0
- package/out/phone/splash/1242x2208-dark.png +0 -0
- package/out/phone/splash/1242x2208-light.png +0 -0
- package/out/phone/splash/1242x2688-dark.png +0 -0
- package/out/phone/splash/1242x2688-light.png +0 -0
- package/out/phone/splash/1260x2736-dark.png +0 -0
- package/out/phone/splash/1260x2736-light.png +0 -0
- package/out/phone/splash/1284x2778-dark.png +0 -0
- package/out/phone/splash/1284x2778-light.png +0 -0
- package/out/phone/splash/1290x2796-dark.png +0 -0
- package/out/phone/splash/1290x2796-light.png +0 -0
- package/out/phone/splash/1320x2868-dark.png +0 -0
- package/out/phone/splash/1320x2868-light.png +0 -0
- package/out/phone/splash/750x1334-dark.png +0 -0
- package/out/phone/splash/750x1334-light.png +0 -0
- package/out/phone/splash/828x1792-dark.png +0 -0
- package/out/phone/splash/828x1792-light.png +0 -0
- package/out/phone/sw.js +219 -6
- package/out/renderer/assets/EditDiff-DxxLuCEI.js +1 -0
- package/out/renderer/assets/File-Tz3MUtN6.js +1 -0
- package/out/renderer/assets/ReadFileView-DFoLPU04.js +4 -0
- package/out/renderer/assets/SidePanel-CL40W2RY.js +47 -0
- package/out/renderer/assets/SidePanel-D0m4IYxS.css +1 -0
- package/out/renderer/assets/Virtualizer-B0uwx_XV.js +1345 -0
- package/out/renderer/assets/{abnfDiagram-VCTEODGH-C03tURh9.js → abnfDiagram-VCTEODGH-CJ9nn9eH.js} +1 -1
- package/out/renderer/assets/{arc-B9ePZBoh.js → arc-B8im8n0O.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-5GKGNRK7-xqG-LPqx.js → architectureDiagram-5GKGNRK7-BRSi5FBk.js} +1 -1
- package/out/renderer/assets/{blockDiagram-I7D4REHJ-BJCB1uWW.js → blockDiagram-I7D4REHJ-CQ1wirIl.js} +1 -1
- package/out/renderer/assets/{c4Diagram-7LVT6UL2-B8YiLE3O.js → c4Diagram-7LVT6UL2-9HyLIioe.js} +1 -1
- package/out/renderer/assets/channel-DjB0ww6b.js +1 -0
- package/out/renderer/assets/{chunk-2Q5K7J3B-BfCgzuF1.js → chunk-2Q5K7J3B-BwC9g3bx.js} +1 -1
- package/out/renderer/assets/{chunk-5VM5RSS4-j2RDggaS.js → chunk-5VM5RSS4-DMtgxPBL.js} +1 -1
- package/out/renderer/assets/{chunk-F27PBJKO-D1w1G98C.js → chunk-F27PBJKO-DSi_XV5v.js} +1 -1
- package/out/renderer/assets/{chunk-IMKFNOWR-HX7TqjEn.js → chunk-IMKFNOWR-Dctc6Apj.js} +1 -1
- package/out/renderer/assets/{chunk-JWPE2WC7-Ee_2ucfe.js → chunk-JWPE2WC7-I2BD5qM7.js} +1 -1
- package/out/renderer/assets/{chunk-POPQ4Y6H-DuxBT9GV.js → chunk-POPQ4Y6H-k60pc4eT.js} +1 -1
- package/out/renderer/assets/{chunk-SVP7TREG-DFjkSsO8.js → chunk-SVP7TREG-zCGemfqm.js} +1 -1
- package/out/renderer/assets/{chunk-TICWLB2K-1B31w-4D.js → chunk-TICWLB2K-CdDiHIq-.js} +1 -1
- package/out/renderer/assets/{chunk-XXDRQBXY-DZ7nGbEc.js → chunk-XXDRQBXY-GYVDxVfN.js} +1 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-6SiAw1np.js +1 -0
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-6SiAw1np.js +1 -0
- package/out/renderer/assets/{cose-bilkent-JH36ORCC-k2aKhVw_.js → cose-bilkent-JH36ORCC-BnSAtUh-.js} +1 -1
- package/out/renderer/assets/{cynefin-OW5HDTMX-xPUo1qjT.js → cynefin-OW5HDTMX-DnQaS9VN.js} +1 -1
- package/out/renderer/assets/{cynefinDiagram-5FMLGOSQ-KbWg9eRv.js → cynefinDiagram-5FMLGOSQ-BNQdw0PV.js} +1 -1
- package/out/renderer/assets/{cytoscape-fcose-CLBXU3_O.js → cytoscape-fcose-CzkrRInm.js} +1 -1
- package/out/renderer/assets/{dagre-GXQ25YYZ-ilq61to2.js → dagre-GXQ25YYZ-fG1vMsyn.js} +1 -1
- package/out/renderer/assets/{diagram-S7CK7UJ4-DsRzYvTT.js → diagram-S7CK7UJ4-BcfAFVc2.js} +1 -1
- package/out/renderer/assets/{diagram-UQ7AKVKN-nE6Ly2i6.js → diagram-UQ7AKVKN-D8f3Tsx9.js} +1 -1
- package/out/renderer/assets/{diagram-VSXAHHWV-B9Crbma_.js → diagram-VSXAHHWV-B-U9CIWt.js} +1 -1
- package/out/renderer/assets/{diagram-VX7I27RA-Bm5JhnFh.js → diagram-VX7I27RA-CX6ifTkJ.js} +1 -1
- package/out/renderer/assets/{diagram-Z3DM3KII-ZD7ANoYg.js → diagram-Z3DM3KII-49dS9s3L.js} +1 -1
- package/out/renderer/assets/{ebnfDiagram-PWID7BFC-CT3pW9tk.js → ebnfDiagram-PWID7BFC-CraGJRI7.js} +1 -1
- package/out/renderer/assets/{erDiagram-RLTQ6QDP-D0ikskdu.js → erDiagram-RLTQ6QDP-CfMNvEoW.js} +1 -1
- package/out/renderer/assets/{flowDiagram-HODETNUW-BOF_JMXY.js → flowDiagram-HODETNUW-C8XM3p4T.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-EL5Y4UJY-BCEnP39-.js → ganttDiagram-EL5Y4UJY-DlJBMKFX.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-WWUBYQGX-WpPHHkc3.js → gitGraphDiagram-WWUBYQGX-DvEzDsKF.js} +1 -1
- package/out/renderer/assets/globals-BFf1P-Y5.js +715 -0
- package/out/renderer/assets/globals-DUBhAVpU.css +1 -0
- package/out/renderer/assets/index-L4TTIP10.js +89 -0
- package/out/renderer/assets/{infoDiagram-27XIBGKW-nRW-sje9.js → infoDiagram-27XIBGKW-CckfBO-R.js} +1 -1
- package/out/renderer/assets/{ishikawaDiagram-5VMMS53U-CEfZo_k8.js → ishikawaDiagram-5VMMS53U-mUoXchkB.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-3NMN7TZE-C5hopb9Y.js → journeyDiagram-3NMN7TZE-zzLL0HFW.js} +1 -1
- package/out/renderer/assets/{kanban-definition-UXKFOSKX-D9XV2n-x.js → kanban-definition-UXKFOSKX-BJ_9aIhB.js} +1 -1
- package/out/renderer/assets/{layout-t2tiRL7x.js → layout-3SRMHY7n.js} +1 -1
- package/out/renderer/assets/{linear-DJLwPmUz.js → linear-CWpclK_R.js} +1 -1
- package/out/renderer/assets/manifest-DOzTaB8J.js +525 -0
- package/out/renderer/assets/{mermaid.core-C0XHWibr.js → mermaid.core-DORpmVi3.js} +5 -5
- package/out/renderer/assets/{mindmap-definition-YA3MSWOX-DD-erShR.js → mindmap-definition-YA3MSWOX-CYBlCqIB.js} +1 -1
- package/out/renderer/assets/{pegDiagram-XKGWAZYB-DZ0Jk0gq.js → pegDiagram-XKGWAZYB-DhWwLs4v.js} +1 -1
- package/out/renderer/assets/{pieDiagram-E7YTZNPT-E7wG7xIV.js → pieDiagram-E7YTZNPT-Bzpc57-A.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-AXDQQJYC-iyjmw417.js → quadrantDiagram-AXDQQJYC-spKXEbds.js} +1 -1
- package/out/renderer/assets/{railroadDiagram-O6MQD6OU-vCkzrMpv.js → railroadDiagram-O6MQD6OU-Br553px3.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-BXWQKSXE-DJ7nU4ps.js → requirementDiagram-BXWQKSXE-CX-Dqij_.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-P5KCCOFB-1TKFsYjQ.js → sankeyDiagram-P5KCCOFB-Bgx1W6B9.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-WJ2MYXX4-C3ajyWo7.js → sequenceDiagram-WJ2MYXX4-CKQv6pcU.js} +1 -1
- package/out/renderer/assets/sessionChanges-BLzNhRuv.js +31 -0
- package/out/renderer/assets/settings-Bsrw4ERp.js +25 -0
- package/out/renderer/assets/{sizeCapture-INFHLROL-BKripAfM.js → sizeCapture-INFHLROL-DtRedfRe.js} +1 -1
- package/out/renderer/assets/{stateDiagram-D77RDMKH-DSqc4avN.js → stateDiagram-D77RDMKH-CMP5owem.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-6-731AqJ.js +1 -0
- package/out/renderer/assets/{swimlanes-42K2YHIH-C2Jeg683.js → swimlanes-42K2YHIH-D30AvvmW.js} +1 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-B8KijqIT.js +8 -0
- package/out/renderer/assets/{timeline-definition-24CTP7MA-rvOKRLqz.js → timeline-definition-24CTP7MA-CsZAMmMZ.js} +1 -1
- package/out/renderer/assets/{vennDiagram-4TSXK5OY-Cig1eOav.js → vennDiagram-4TSXK5OY-COQ7L1f7.js} +1 -1
- package/out/renderer/assets/{wardleyDiagram-VM6X3IG4-C8spX5XL.js → wardleyDiagram-VM6X3IG4-dqMWLTCs.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-S5SC5T6Z-DHQsGiFY.js → xychartDiagram-S5SC5T6Z-DX4clIYP.js} +1 -1
- package/out/renderer/index.html +3 -4
- package/out/renderer/plugin-view.html +37 -0
- package/out/renderer/settings.html +7 -4
- package/out/renderer/web-preload.js +40 -40
- package/out/server/agent.js +915 -606
- package/out/server/chunks/{agent-BbLTL3oo.js → agent-BbNq8i9j.js} +987 -689
- package/out/server/chunks/conversationsMove-CvFPFHaa.js +587 -0
- package/out/server/chunks/dispatchModel-CsfmL396.js +20 -0
- package/out/server/chunks/gpuBackendInstall-jAzoFq7U.js +237 -0
- package/out/server/chunks/{loadProvider-ff0h4G9y.js → loadProvider-NdOVbsHi.js} +2 -2
- package/out/server/chunks/{manifest-DjsZzZuh.js → manifest-BPXFscqI.js} +9 -3
- package/out/server/chunks/registry-BhoHPSKn.js +3353 -0
- package/out/server/chunks/{resources-DmaKIeBc.js → resources-BfbTkFP0.js} +23 -12
- package/out/server/chunks/sendImage-BCNW9JRV.js +418 -0
- package/out/server/chunks/{storageScanWorker-Bebego8l.js → storageScanWorker-CR7HbOWG.js} +2 -2
- package/out/server/chunks/{storageScanWorker-BQ1LXUu7.js → storageScanWorker-DjFyHTye.js} +2 -2
- package/out/server/chunks/{workflowPresets-XbQNDJh1.js → workflowPresets-C2T1BzA2.js} +1725 -720
- package/out/server/index.js +14387 -16832
- package/out/server/memory-service.js +5008 -0
- package/out/server/plugin-host.js +2 -2
- package/package.json +2 -3
- package/out/phone/assets/EnsoNerdSymbolsMono-Regular-TdeMQojc.ttf +0 -0
- package/out/phone/assets/architecture-7GRP2DOG-C-qor9pl.js +0 -1
- package/out/phone/assets/channel-X_IbcoWa.js +0 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-BM8gYXGQ.js +0 -1
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-BM8gYXGQ.js +0 -1
- package/out/phone/assets/desk-BNoyCelL.js +0 -2
- package/out/phone/assets/eventmodeling-NTZA5JFV-BdEBApKV.js +0 -1
- package/out/phone/assets/flowDiagram-HODETNUW-OPg41_ia.js +0 -1
- package/out/phone/assets/main-BU1pbfVw.css +0 -1
- package/out/phone/assets/main-ZLMPRLjZ.js +0 -1658
- package/out/phone/assets/railroad-abnf-HS5TGJTU-BoQXwOPL.js +0 -1
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-1G126duh.js +0 -1
- package/out/phone/assets/railroad-peg-WCYAUIDC-C7pIuHge.js +0 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-BMZswIYt.js +0 -1
- package/out/phone/assets/storage-dUWOZ2xo.js +0 -36
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-RYt3eASc.js +0 -8
- package/out/renderer/assets/channel-DwCSANyp.js +0 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-BT-9dtRl.js +0 -1
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-BT-9dtRl.js +0 -1
- package/out/renderer/assets/globals-DWAN16wT.js +0 -2603
- package/out/renderer/assets/globals-DoPyZAQo.css +0 -1
- package/out/renderer/assets/index-DOUivox4.js +0 -133
- package/out/renderer/assets/index-F_0FxVZ_.css +0 -1
- package/out/renderer/assets/settings-BmMFkVO5.js +0 -27
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-JOz8ISDT.js +0 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-Km8IGI0J.js +0 -8
- package/out/server/chunks/conversationsMove-CJZfkj55.js +0 -57
- package/out/server/chunks/engine-IZbRceya.js +0 -70
- package/out/server/chunks/engineWorker-CQxNRdLD.js +0 -6
- package/out/server/chunks/engineWorker-CrUIcXCt.js +0 -73
- package/out/server/chunks/gpuBackendInstall-COO4pT2M.js +0 -158
- package/out/server/chunks/hanbao-_aDjow_f.js +0 -187
- package/out/server/chunks/speech-CqK6_tIR.js +0 -25
- package/out/server/chunks/wetype-CR0YLhHP.js +0 -677
|
@@ -718,13 +718,13 @@ const CAPABILITY_OUTCOMES = [
|
|
|
718
718
|
"unavailable",
|
|
719
719
|
"cancelled"
|
|
720
720
|
];
|
|
721
|
-
const isRecord$
|
|
721
|
+
const isRecord$6 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
722
722
|
const isNonEmptyString$2 = (value) => typeof value === "string" && value.length > 0;
|
|
723
723
|
const hasOnlyKeys$1 = (value, allowed) => Object.keys(value).every((key) => allowed.includes(key));
|
|
724
724
|
const hasExactKeys$3 = (value, keys) => Object.keys(value).length === keys.length && hasOnlyKeys$1(value, keys);
|
|
725
725
|
const isProductSurfaceId$1 = (value) => typeof value === "string" && Object.hasOwn(PRODUCT_SURFACE_INVENTORY, value);
|
|
726
726
|
function parseCapabilityResult(value) {
|
|
727
|
-
if (!isRecord$
|
|
727
|
+
if (!isRecord$6(value) || typeof value.ok !== "boolean") return null;
|
|
728
728
|
if (value.ok) {
|
|
729
729
|
return hasExactKeys$3(value, ["ok", "data"]) ? { ok: true, data: value.data } : null;
|
|
730
730
|
}
|
|
@@ -734,15 +734,15 @@ function parseCapabilityResult(value) {
|
|
|
734
734
|
return value;
|
|
735
735
|
}
|
|
736
736
|
function parseCapabilitySubject(value) {
|
|
737
|
-
if (!isRecord$
|
|
737
|
+
if (!isRecord$6(value) || !hasExactKeys$3(value, ["kind", "id", "label"])) return null;
|
|
738
738
|
return CAPABILITY_SUBJECT_KINDS.includes(value.kind) && isNonEmptyString$2(value.id) && isNonEmptyString$2(value.label) ? value : null;
|
|
739
739
|
}
|
|
740
740
|
function parseCapabilityChange(value) {
|
|
741
|
-
if (!isRecord$
|
|
741
|
+
if (!isRecord$6(value) || !hasExactKeys$3(value, ["field", "previous", "value"])) return null;
|
|
742
742
|
return isNonEmptyString$2(value.field) ? value : null;
|
|
743
743
|
}
|
|
744
744
|
function parseCapabilityReceipt(value) {
|
|
745
|
-
if (!isRecord$
|
|
745
|
+
if (!isRecord$6(value)) return null;
|
|
746
746
|
if (!hasOnlyKeys$1(value, [
|
|
747
747
|
"receiptId",
|
|
748
748
|
"operationId",
|
|
@@ -866,13 +866,13 @@ const CHILD_INTERCEPT_TOTAL_TIMEOUT_MS = 5e3;
|
|
|
866
866
|
const OBSERVE_TIMEOUT_MS = 3e4;
|
|
867
867
|
const isInterceptEvent = (event) => PLUGIN_INTERCEPT_EVENTS.includes(event);
|
|
868
868
|
const isChildInterceptEvent = (event) => CHILD_INTERCEPT_EVENTS.includes(event);
|
|
869
|
-
const isRecord$
|
|
869
|
+
const isRecord$5 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
870
870
|
function initialInterceptState(event, payload) {
|
|
871
871
|
const result = event === "input" ? { action: "continue" } : {};
|
|
872
872
|
return { event, payload, result, done: false };
|
|
873
873
|
}
|
|
874
874
|
function applyInterceptResult(state, raw) {
|
|
875
|
-
if (state.done || !isRecord$
|
|
875
|
+
if (state.done || !isRecord$5(raw)) return state;
|
|
876
876
|
if (state.event === "tool_call") {
|
|
877
877
|
const payload = state.payload;
|
|
878
878
|
const result = { ...state.result };
|
|
@@ -887,7 +887,7 @@ function applyInterceptResult(state, raw) {
|
|
|
887
887
|
}
|
|
888
888
|
};
|
|
889
889
|
}
|
|
890
|
-
if (!isRecord$
|
|
890
|
+
if (!isRecord$5(raw.input)) return state;
|
|
891
891
|
return {
|
|
892
892
|
...state,
|
|
893
893
|
payload: { ...payload, input: raw.input },
|
|
@@ -1195,6 +1195,7 @@ const POSIX_HOST = "posix";
|
|
|
1195
1195
|
const REMOTE_FETCH_HOST = "remote-fetch";
|
|
1196
1196
|
const BOT_AVATAR_HOST = "bot-avatar";
|
|
1197
1197
|
const SECRETARY_AVATAR_HOST = "secretary-avatar";
|
|
1198
|
+
const SECRETARY_REPORT_HOST = "secretary-report";
|
|
1198
1199
|
const PLUGIN_ASSET_HOST = "plugin-asset";
|
|
1199
1200
|
const IMAGE_EXTENSIONS = [
|
|
1200
1201
|
"png",
|
|
@@ -1223,7 +1224,7 @@ function isVideoPath(pathOrUrl) {
|
|
|
1223
1224
|
}
|
|
1224
1225
|
function localImageUrlToPath(url) {
|
|
1225
1226
|
const host = url.hostname;
|
|
1226
|
-
if (!host || host === REMOTE_FETCH_HOST || host === BOT_AVATAR_HOST || host === SECRETARY_AVATAR_HOST || host === PLUGIN_ASSET_HOST)
|
|
1227
|
+
if (!host || host === REMOTE_FETCH_HOST || host === BOT_AVATAR_HOST || host === SECRETARY_AVATAR_HOST || host === SECRETARY_REPORT_HOST || host === PLUGIN_ASSET_HOST)
|
|
1227
1228
|
return null;
|
|
1228
1229
|
const segments = url.pathname.split("/").filter(Boolean).map(decodeURIComponent);
|
|
1229
1230
|
if (host === POSIX_HOST) {
|
|
@@ -1329,19 +1330,19 @@ function planPhase(state) {
|
|
|
1329
1330
|
if (state.active) return "planning";
|
|
1330
1331
|
return state.executing ? "executing" : "off";
|
|
1331
1332
|
}
|
|
1332
|
-
const isRecord$
|
|
1333
|
+
const isRecord$4 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
1333
1334
|
const hasExactKeys$2 = (value, keys) => Object.keys(value).length === keys.length && keys.every((key) => key in value);
|
|
1334
1335
|
const nonEmpty = (value, max) => typeof value === "string" && value.trim().length > 0 && value.length <= max;
|
|
1335
1336
|
const isResolution = (value) => PLAN_RESOLUTIONS.includes(value);
|
|
1336
1337
|
function parsePlanDoc(value) {
|
|
1337
|
-
if (!isRecord$
|
|
1338
|
+
if (!isRecord$4(value) || !hasExactKeys$2(value, ["planId", "title", "text"])) return null;
|
|
1338
1339
|
const { planId, title, text } = value;
|
|
1339
1340
|
if (!nonEmpty(planId, 64) || !nonEmpty(title, PLAN_TITLE_MAX) || !nonEmpty(text, PLAN_TEXT_MAX))
|
|
1340
1341
|
return null;
|
|
1341
1342
|
return { planId, title, text };
|
|
1342
1343
|
}
|
|
1343
1344
|
function parsePlanEntry(value) {
|
|
1344
|
-
if (!isRecord$
|
|
1345
|
+
if (!isRecord$4(value) || value.v !== 1 || typeof value.at !== "number") return null;
|
|
1345
1346
|
const { at } = value;
|
|
1346
1347
|
switch (value.kind) {
|
|
1347
1348
|
case "mode":
|
|
@@ -1365,7 +1366,7 @@ function foldPlanState(entries) {
|
|
|
1365
1366
|
state.resolutions = { ...state.resolutions, [planId]: action2 };
|
|
1366
1367
|
};
|
|
1367
1368
|
for (const raw of entries) {
|
|
1368
|
-
if (!isRecord$
|
|
1369
|
+
if (!isRecord$4(raw) || raw.type !== "custom" || raw.customType !== PLAN_ENTRY_TYPE) continue;
|
|
1369
1370
|
const entry = parsePlanEntry(raw.data);
|
|
1370
1371
|
if (!entry) continue;
|
|
1371
1372
|
if (entry.kind === "mode") {
|
|
@@ -1391,7 +1392,7 @@ function foldPlanState(entries) {
|
|
|
1391
1392
|
return state;
|
|
1392
1393
|
}
|
|
1393
1394
|
function parsePlanState(value) {
|
|
1394
|
-
if (!isRecord$
|
|
1395
|
+
if (!isRecord$4(value) || typeof value.active !== "boolean" || !isRecord$4(value.resolutions))
|
|
1395
1396
|
return null;
|
|
1396
1397
|
const allowed = ["active", "resolutions", "pending", "executing"];
|
|
1397
1398
|
if (Object.keys(value).some((key) => !allowed.includes(key))) return null;
|
|
@@ -1590,14 +1591,14 @@ function warnDroppedHeader(name) {
|
|
|
1590
1591
|
droppedHeaderWarnings.add(name);
|
|
1591
1592
|
console.warn(`[provider-headers] dropped ${name}: value cannot be sent as a header`);
|
|
1592
1593
|
}
|
|
1593
|
-
function parseProviderHeaders(value) {
|
|
1594
|
+
function parseProviderHeaders(value, { warn = true } = {}) {
|
|
1594
1595
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
|
|
1595
1596
|
const headers = {};
|
|
1596
1597
|
for (const [name, headerValue] of Object.entries(value)) {
|
|
1597
1598
|
if (!HEADER_NAME_RE.test(name)) continue;
|
|
1598
1599
|
if (typeof headerValue !== "string") continue;
|
|
1599
1600
|
if (!isSendableHeaderValue(headerValue)) {
|
|
1600
|
-
warnDroppedHeader(name);
|
|
1601
|
+
if (warn) warnDroppedHeader(name);
|
|
1601
1602
|
continue;
|
|
1602
1603
|
}
|
|
1603
1604
|
headers[name] = headerValue;
|
|
@@ -1609,7 +1610,7 @@ function escapePiConfigValue(value) {
|
|
|
1609
1610
|
return doubled.startsWith("!") ? `$${doubled}` : doubled;
|
|
1610
1611
|
}
|
|
1611
1612
|
function parseRequestBodyUsage(value) {
|
|
1612
|
-
if (!isRecord$
|
|
1613
|
+
if (!isRecord$3(value)) return null;
|
|
1613
1614
|
const keys = ["bytes", "limitBytes", "stage", "blocked", "at"];
|
|
1614
1615
|
if (Object.keys(value).length !== keys.length || Object.keys(value).some((key) => !keys.includes(key)))
|
|
1615
1616
|
return null;
|
|
@@ -1623,7 +1624,7 @@ function parseRequestBodyUsage(value) {
|
|
|
1623
1624
|
at: value.at
|
|
1624
1625
|
};
|
|
1625
1626
|
}
|
|
1626
|
-
function isRecord$
|
|
1627
|
+
function isRecord$3(value) {
|
|
1627
1628
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1628
1629
|
}
|
|
1629
1630
|
const cap = (text, limit) => text.length > limit ? `${text.slice(0, limit)}…` : text;
|
|
@@ -1826,6 +1827,7 @@ function childProfileToolIds(tools, options = {}) {
|
|
|
1826
1827
|
ids.push(shell);
|
|
1827
1828
|
if (editMode === "apply_patch") ids.push("apply_patch");
|
|
1828
1829
|
else ids.push("edit", "write");
|
|
1830
|
+
ids.push("task_output", "task_stop", "task_settle");
|
|
1829
1831
|
}
|
|
1830
1832
|
ids.push("message_main_agent", "message_coworker");
|
|
1831
1833
|
if (options.exploreFold) ids.push("explore_mark", "explore_fold");
|
|
@@ -2024,8 +2026,8 @@ function messageText(message) {
|
|
|
2024
2026
|
}).join("");
|
|
2025
2027
|
}
|
|
2026
2028
|
function isPureSessionUpdate(text) {
|
|
2027
|
-
if (!/<session-updates>|<secretary-schedule>/.test(text)) return false;
|
|
2028
|
-
const stripped = text.replace(/<session-updates>[\s\S]*?<\/session-updates>/g, "").replace(/<secretary-schedule>[\s\S]*?<\/secretary-schedule>/g, "").trim();
|
|
2029
|
+
if (!/<session-updates>|<secretary-schedule>|<secretary-message>/.test(text)) return false;
|
|
2030
|
+
const stripped = text.replace(/<session-updates>[\s\S]*?<\/session-updates>/g, "").replace(/<secretary-schedule>[\s\S]*?<\/secretary-schedule>/g, "").replace(/<secretary-message>[\s\S]*?<\/secretary-message>/g, "").trim();
|
|
2029
2031
|
return stripped.length === 0;
|
|
2030
2032
|
}
|
|
2031
2033
|
function isSilentMarker(text) {
|
|
@@ -2099,7 +2101,9 @@ const SECRETARY_OPS = [
|
|
|
2099
2101
|
"schedule_remove",
|
|
2100
2102
|
"secretary_profile_propose",
|
|
2101
2103
|
"skill_propose",
|
|
2102
|
-
"tool_propose"
|
|
2104
|
+
"tool_propose",
|
|
2105
|
+
"secretary_list",
|
|
2106
|
+
"secretary_message"
|
|
2103
2107
|
];
|
|
2104
2108
|
const SECRETARY_SEND_MODES = ["queue", "steer"];
|
|
2105
2109
|
const SECRETARY_INTERNAL_OPS = ["tool_run"];
|
|
@@ -2204,23 +2208,23 @@ const BOOKKEEPING_TOOLS = /* @__PURE__ */ new Set([
|
|
|
2204
2208
|
"ask_user"
|
|
2205
2209
|
]);
|
|
2206
2210
|
const clip = (text, max) => text.length > max ? `${text.slice(0, max - 1)}…` : text;
|
|
2207
|
-
const isRecord$
|
|
2211
|
+
const isRecord$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2208
2212
|
function contentText(content) {
|
|
2209
2213
|
if (typeof content === "string") return content;
|
|
2210
2214
|
if (!Array.isArray(content)) return "";
|
|
2211
|
-
return content.filter((part) => isRecord$
|
|
2215
|
+
return content.filter((part) => isRecord$2(part) && part.type === "text" && typeof part.text === "string").map((part) => part.text).join("\n");
|
|
2212
2216
|
}
|
|
2213
2217
|
function toolBatchDigest(message, toolResults) {
|
|
2214
|
-
if (!isRecord$
|
|
2218
|
+
if (!isRecord$2(message) || message.role !== "assistant" || !Array.isArray(message.content))
|
|
2215
2219
|
return void 0;
|
|
2216
2220
|
const calls = message.content.filter(
|
|
2217
|
-
(part) => isRecord$
|
|
2221
|
+
(part) => isRecord$2(part) && part.type === "toolCall" && typeof part.id === "string" && part.id.length > 0 && typeof part.name === "string"
|
|
2218
2222
|
);
|
|
2219
2223
|
if (calls.length === 0 || calls.every((c) => BOOKKEEPING_TOOLS.has(c.name))) return void 0;
|
|
2220
2224
|
const results = /* @__PURE__ */ new Map();
|
|
2221
2225
|
for (const r of toolResults)
|
|
2222
|
-
if (isRecord$
|
|
2223
|
-
const intent = contentText(message.content.filter((p) => isRecord$
|
|
2226
|
+
if (isRecord$2(r) && typeof r.toolCallId === "string") results.set(r.toolCallId, r);
|
|
2227
|
+
const intent = contentText(message.content.filter((p) => isRecord$2(p) && p.type === "text")).trim().replace(/\s+/g, " ");
|
|
2224
2228
|
return {
|
|
2225
2229
|
callId: calls[0].id,
|
|
2226
2230
|
...intent ? { intent: clip(intent, INTENT_CHARS) } : {},
|
|
@@ -2255,14 +2259,14 @@ ${tools}
|
|
|
2255
2259
|
Label:`;
|
|
2256
2260
|
}
|
|
2257
2261
|
function parseToolBatchDigest(value) {
|
|
2258
|
-
if (!isRecord$
|
|
2262
|
+
if (!isRecord$2(value) || typeof value.callId !== "string" || !value.callId) return null;
|
|
2259
2263
|
if (value.intent !== void 0 && (typeof value.intent !== "string" || value.intent.length > INTENT_CHARS))
|
|
2260
2264
|
return null;
|
|
2261
2265
|
if (!Array.isArray(value.tools) || value.tools.length === 0 || value.tools.length > MAX_TOOLS)
|
|
2262
2266
|
return null;
|
|
2263
2267
|
const fieldOk = (v) => typeof v === "string" && v.length <= FIELD_CHARS;
|
|
2264
2268
|
if (!value.tools.every(
|
|
2265
|
-
(t) => isRecord$
|
|
2269
|
+
(t) => isRecord$2(t) && typeof t.name === "string" && t.name.length > 0 && t.name.length <= FIELD_CHARS && fieldOk(t.input) && fieldOk(t.output)
|
|
2266
2270
|
))
|
|
2267
2271
|
return null;
|
|
2268
2272
|
return value;
|
|
@@ -2353,49 +2357,6 @@ function parseParentSourceBindingRequest(value) {
|
|
|
2353
2357
|
const request = value;
|
|
2354
2358
|
return hasExactKeys$1(request, ["requestId"]) && isNonEmptyString$1(request.requestId) ? { requestId: request.requestId } : null;
|
|
2355
2359
|
}
|
|
2356
|
-
const CLAUDE_HOOK_EVENTS = [
|
|
2357
|
-
"SessionStart",
|
|
2358
|
-
"UserPromptSubmit",
|
|
2359
|
-
"PreToolUse",
|
|
2360
|
-
"PostToolUse",
|
|
2361
|
-
"Stop",
|
|
2362
|
-
"SubagentStart",
|
|
2363
|
-
"SubagentStop",
|
|
2364
|
-
"PreCompact",
|
|
2365
|
-
"SessionEnd"
|
|
2366
|
-
];
|
|
2367
|
-
const MAX_ITEMS = 500;
|
|
2368
|
-
const MAX_TEXT = 256 * 1024;
|
|
2369
|
-
function isRecord$2(value) {
|
|
2370
|
-
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
2371
|
-
}
|
|
2372
|
-
function isText(value, max = 4096) {
|
|
2373
|
-
return typeof value === "string" && value.length > 0 && value.length <= max;
|
|
2374
|
-
}
|
|
2375
|
-
function onlyKeys(value, keys) {
|
|
2376
|
-
return Object.keys(value).every((key) => keys.includes(key));
|
|
2377
|
-
}
|
|
2378
|
-
function parsePluginHooks(value) {
|
|
2379
|
-
if (!Array.isArray(value) || value.length > MAX_ITEMS) return null;
|
|
2380
|
-
for (const hook of value) {
|
|
2381
|
-
if (!isRecord$2(hook) || !onlyKeys(hook, ["plugin", "root", "dataDir", "event", "matcher", "command", "timeoutSec"]) || !isText(hook.plugin, 256) || !isText(hook.root) || !isText(hook.dataDir) || !CLAUDE_HOOK_EVENTS.includes(hook.event) || hook.matcher !== void 0 && typeof hook.matcher !== "string" || !isText(hook.command, 16384) || hook.timeoutSec !== void 0 && !(typeof hook.timeoutSec === "number" && hook.timeoutSec > 0 && hook.timeoutSec <= 3600)) {
|
|
2382
|
-
return null;
|
|
2383
|
-
}
|
|
2384
|
-
}
|
|
2385
|
-
return value;
|
|
2386
|
-
}
|
|
2387
|
-
function parsePluginCommands(value) {
|
|
2388
|
-
if (!Array.isArray(value) || value.length > MAX_ITEMS) return null;
|
|
2389
|
-
for (const command of value) {
|
|
2390
|
-
if (!isRecord$2(command) || !onlyKeys(command, ["name", "description", "argumentHint", "content", "filePath"]) || !isText(command.name, 256) || typeof command.description !== "string" || command.argumentHint !== void 0 && typeof command.argumentHint !== "string" || !isText(command.content, MAX_TEXT) || !isText(command.filePath)) {
|
|
2391
|
-
return null;
|
|
2392
|
-
}
|
|
2393
|
-
}
|
|
2394
|
-
return value;
|
|
2395
|
-
}
|
|
2396
|
-
function isPluginEntry(value) {
|
|
2397
|
-
return isRecord$2(value) && typeof value.id === "string" && isText(value.key, 512) && typeof value.name === "string" && typeof value.description === "string" && typeof value.source === "string" && typeof value.enabled === "boolean";
|
|
2398
|
-
}
|
|
2399
2360
|
const WORKFLOW_PRESET_ID_RE = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
2400
2361
|
const MAX_DISABLED_WORKFLOW_PRESETS = 64;
|
|
2401
2362
|
function isWorkflowPresetId(id) {
|
|
@@ -2475,6 +2436,7 @@ function parseWorkflowRunSnapshot(value) {
|
|
|
2475
2436
|
...error ? { error } : {}
|
|
2476
2437
|
};
|
|
2477
2438
|
}
|
|
2439
|
+
const TURN_REPORT_MAX_CHARS = 8e3;
|
|
2478
2440
|
const TITLE_SUMMARY_MAX_CANDIDATES = 3;
|
|
2479
2441
|
const THINKING_LEVELS = ["minimal", "low", "medium", "high", "xhigh", "max"];
|
|
2480
2442
|
const APPROVAL_MODES = ["supervised", "auto-edits", "full", "assistant"];
|
|
@@ -2512,6 +2474,7 @@ const APPROVAL_DECISIONS = ["allow", "allowSession", "deny", "revise", "review"]
|
|
|
2512
2474
|
function isApprovalDecision(value) {
|
|
2513
2475
|
return APPROVAL_DECISIONS.includes(value);
|
|
2514
2476
|
}
|
|
2477
|
+
const TASK_KEEP_REASON_MAX = 200;
|
|
2515
2478
|
const SHELL_FAILURE_KINDS = [
|
|
2516
2479
|
"exit_nonzero",
|
|
2517
2480
|
"deadline",
|
|
@@ -2539,6 +2502,18 @@ function parseShellFailure(value) {
|
|
|
2539
2502
|
}
|
|
2540
2503
|
const AGENT_WAIT_DEFAULT_MS = 30 * 1e3;
|
|
2541
2504
|
const AGENT_WAIT_MAX_MS = 5 * 60 * 1e3;
|
|
2505
|
+
const AGENT_TASK_MAX_RESUMES = 3;
|
|
2506
|
+
function parseClosed(table, type, value) {
|
|
2507
|
+
if (!Object.hasOwn(table, type)) return null;
|
|
2508
|
+
return table[type](value);
|
|
2509
|
+
}
|
|
2510
|
+
function requireEventIdentity(kind, parse2) {
|
|
2511
|
+
return (value) => {
|
|
2512
|
+
const identity = kind === "child" ? parseChildSessionIdentity(value.identity) : kind === "parent" ? parseSessionIdentity(value.identity) : parseAnySessionIdentity(value.identity);
|
|
2513
|
+
if (!identity || !isSequence(value.seq)) return null;
|
|
2514
|
+
return parse2(value);
|
|
2515
|
+
};
|
|
2516
|
+
}
|
|
2542
2517
|
function parseAgentControlToolRequest(value) {
|
|
2543
2518
|
if (!isRecord(value) || typeof value.operation !== "string") return null;
|
|
2544
2519
|
const nonEmpty2 = (input) => typeof input === "string" && input.trim().length > 0;
|
|
@@ -2549,9 +2524,15 @@ function parseAgentControlToolRequest(value) {
|
|
|
2549
2524
|
return hasExactKeys(gate, ["commandRef"]) && nonEmpty2(gate.commandRef);
|
|
2550
2525
|
};
|
|
2551
2526
|
const optionalGate = value.gate === void 0 || gateValid(value.gate);
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2527
|
+
const parseRunIdOperation = (value2) => {
|
|
2528
|
+
return hasExactKeys(value2, ["operation", "runId"]) && nonEmpty2(value2.runId) ? value2 : null;
|
|
2529
|
+
};
|
|
2530
|
+
const parseAgentIdOperation = (value2) => {
|
|
2531
|
+
return hasExactKeys(value2, ["operation", "agentId"]) && nonEmpty2(value2.agentId) ? value2 : null;
|
|
2532
|
+
};
|
|
2533
|
+
const parsers = {
|
|
2534
|
+
spawn: (value2) => {
|
|
2535
|
+
return hasOnlyKeys(value2, [
|
|
2555
2536
|
"operation",
|
|
2556
2537
|
"mode",
|
|
2557
2538
|
"name",
|
|
@@ -2563,9 +2544,10 @@ function parseAgentControlToolRequest(value) {
|
|
|
2563
2544
|
"wait",
|
|
2564
2545
|
"schema",
|
|
2565
2546
|
"gate"
|
|
2566
|
-
]) && (
|
|
2567
|
-
|
|
2568
|
-
|
|
2547
|
+
]) && (value2.mode === "task" || value2.mode === "coworker") && optionalString(value2.name) && nonEmpty2(value2.description) && nonEmpty2(value2.prompt) && optionalString(value2.agentType) && optionalString(value2.model) && (value2.thinking === void 0 || value2.thinking === "off" || THINKING_LEVELS.includes(value2.thinking)) && typeof value2.wait === "boolean" && schemaValid && optionalGate ? value2 : null;
|
|
2548
|
+
},
|
|
2549
|
+
send: (value2) => {
|
|
2550
|
+
return hasOnlyKeys(value2, [
|
|
2569
2551
|
"operation",
|
|
2570
2552
|
"agentId",
|
|
2571
2553
|
"message",
|
|
@@ -2574,21 +2556,23 @@ function parseAgentControlToolRequest(value) {
|
|
|
2574
2556
|
"wait",
|
|
2575
2557
|
"schema",
|
|
2576
2558
|
"gate"
|
|
2577
|
-
]) && nonEmpty2(
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
return hasExactKeys(
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2559
|
+
]) && nonEmpty2(value2.agentId) && nonEmpty2(value2.message) && (value2.delivery === "auto" || value2.delivery === "steer" || value2.delivery === "next") && optionalString(value2.expectedRunId) && typeof value2.wait === "boolean" && schemaValid && optionalGate ? value2 : null;
|
|
2560
|
+
},
|
|
2561
|
+
wait: (value2) => {
|
|
2562
|
+
return hasOnlyKeys(value2, ["operation", "runIds", "until", "timeoutMs"]) && Array.isArray(value2.runIds) && value2.runIds.length > 0 && value2.runIds.every((runId) => nonEmpty2(runId)) && new Set(value2.runIds).size === value2.runIds.length && (value2.until === "all" || value2.until === "any") && (value2.timeoutMs === void 0 || Number.isInteger(value2.timeoutMs) && value2.timeoutMs >= 0 && value2.timeoutMs <= AGENT_WAIT_MAX_MS) ? value2 : null;
|
|
2563
|
+
},
|
|
2564
|
+
report: parseRunIdOperation,
|
|
2565
|
+
stop: parseRunIdOperation,
|
|
2566
|
+
list: (value2) => {
|
|
2567
|
+
return hasOnlyKeys(value2, ["operation", "status", "cursor", "limit"]) && (value2.status === void 0 || ["creating", "ready", "active", "parked", "closed"].includes(value2.status)) && optionalString(value2.cursor) && Number.isInteger(value2.limit) && value2.limit >= 1 && value2.limit <= 100 ? value2 : null;
|
|
2568
|
+
},
|
|
2569
|
+
message: (value2) => {
|
|
2570
|
+
return hasExactKeys(value2, ["operation", "to", "text"]) && nonEmpty2(value2.to) && nonEmpty2(value2.text) ? value2 : null;
|
|
2571
|
+
},
|
|
2572
|
+
dismiss: parseAgentIdOperation,
|
|
2573
|
+
resume: parseAgentIdOperation
|
|
2574
|
+
};
|
|
2575
|
+
return parseClosed(parsers, value.operation, value);
|
|
2592
2576
|
}
|
|
2593
2577
|
function parseAgentControlToolResponse(value) {
|
|
2594
2578
|
if (!isRecord(value)) return null;
|
|
@@ -2600,6 +2584,8 @@ function parseAgentControlToolResponse(value) {
|
|
|
2600
2584
|
"forbidden",
|
|
2601
2585
|
"mode-disabled",
|
|
2602
2586
|
"not-found",
|
|
2587
|
+
"restart-lost",
|
|
2588
|
+
"other-owner",
|
|
2603
2589
|
"invalid-state",
|
|
2604
2590
|
"run-mismatch",
|
|
2605
2591
|
"runtime-unavailable"
|
|
@@ -2820,12 +2806,30 @@ function hasValidProjectedMetadata(value) {
|
|
|
2820
2806
|
const isMcpOAuthAccess = (value) => isRecord(value) && hasOnlyKeys(value, ["access_token", "expires_at"]) && isNonEmptyString(value.access_token) && (value.expires_at === void 0 || typeof value.expires_at === "number" && Number.isFinite(value.expires_at));
|
|
2821
2807
|
const isMcpOAuthRefreshResult = (value) => isRecord(value) && (value.ok === true ? hasOnlyKeys(value, ["ok", "access"]) && isMcpOAuthAccess(value.access) : value.ok === false && hasOnlyKeys(value, ["ok", "unauthorized", "error"]) && typeof value.unauthorized === "boolean" && typeof value.error === "string");
|
|
2822
2808
|
function parseTurnDigest(value) {
|
|
2823
|
-
if (!isRecord(value) || !
|
|
2809
|
+
if (!isRecord(value) || !hasOnlyKeys(value, ["firstUserText", "userText", "assistantText", "lastTool"])) {
|
|
2824
2810
|
return null;
|
|
2825
2811
|
}
|
|
2826
2812
|
if (typeof value.firstUserText !== "string" || typeof value.userText !== "string" || typeof value.assistantText !== "string") {
|
|
2827
2813
|
return null;
|
|
2828
2814
|
}
|
|
2815
|
+
const digest = {
|
|
2816
|
+
firstUserText: value.firstUserText,
|
|
2817
|
+
userText: value.userText,
|
|
2818
|
+
assistantText: value.assistantText
|
|
2819
|
+
};
|
|
2820
|
+
if (value.lastTool !== void 0) {
|
|
2821
|
+
if (!isRecord(value.lastTool) || !hasExactKeys(value.lastTool, ["name", "ok"]) || typeof value.lastTool.name !== "string" || value.lastTool.name.trim().length === 0 || typeof value.lastTool.ok !== "boolean") {
|
|
2822
|
+
return null;
|
|
2823
|
+
}
|
|
2824
|
+
digest.lastTool = { name: value.lastTool.name, ok: value.lastTool.ok };
|
|
2825
|
+
}
|
|
2826
|
+
return digest;
|
|
2827
|
+
}
|
|
2828
|
+
function parseTurnReport(value) {
|
|
2829
|
+
if (!isRecord(value) || !hasOnlyKeys(value, ["text", "omitted"])) return null;
|
|
2830
|
+
if (!isNonEmptyString(value.text) || value.text.length > TURN_REPORT_MAX_CHARS) return null;
|
|
2831
|
+
if (value.omitted !== void 0 && !(typeof value.omitted === "number" && Number.isSafeInteger(value.omitted) && value.omitted > 0))
|
|
2832
|
+
return null;
|
|
2829
2833
|
return value;
|
|
2830
2834
|
}
|
|
2831
2835
|
function parseTitleSummaryInput(value) {
|
|
@@ -3071,9 +3075,8 @@ function parseSafeChildRef(value) {
|
|
|
3071
3075
|
const typeKey = parseAgentTypeKey(value.typeKey);
|
|
3072
3076
|
return isNonEmptyString(value.sessionId) && isUuid(value.generation) && isUuid(value.instanceId) && isNonEmptyString(value.instanceName) && typeKey ? value : null;
|
|
3073
3077
|
}
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
if (value.kind === "oauth-account-selected") {
|
|
3078
|
+
const agentSessionCustomEntryParsers = {
|
|
3079
|
+
"oauth-account-selected": (value) => {
|
|
3077
3080
|
return hasOnlyKeys(value, [
|
|
3078
3081
|
"kind",
|
|
3079
3082
|
"accountKey",
|
|
@@ -3082,27 +3085,37 @@ function parseAgentSessionCustomEntry(value) {
|
|
|
3082
3085
|
"modelId",
|
|
3083
3086
|
"at"
|
|
3084
3087
|
]) && isCodexAccountKey(value.accountKey) && (value.previousAccountKey === void 0 || isCodexAccountKey(value.previousAccountKey)) && (value.settingsProviderId === void 0 && value.modelId === void 0 || isNonEmptyString(value.settingsProviderId) && isNonEmptyString(value.modelId)) && typeof value.at === "number" && Number.isFinite(value.at) ? value : null;
|
|
3085
|
-
}
|
|
3086
|
-
|
|
3088
|
+
},
|
|
3089
|
+
"capability-receipt": (value) => {
|
|
3087
3090
|
if (!hasExactKeys(value, ["kind", "receipt"])) return null;
|
|
3088
3091
|
const receipt = parseCapabilityReceipt(value.receipt);
|
|
3089
3092
|
return receipt ? { kind: "capability-receipt", receipt } : null;
|
|
3090
|
-
}
|
|
3091
|
-
|
|
3093
|
+
},
|
|
3094
|
+
"task-wrap-up-nudge": (value) => {
|
|
3095
|
+
return hasExactKeys(value, ["kind", "count", "at"]) && Number.isInteger(value.count) && value.count > 0 && typeof value.at === "number" && Number.isFinite(value.at) ? value : null;
|
|
3096
|
+
},
|
|
3097
|
+
"tool-batch-label": (value) => {
|
|
3092
3098
|
return hasExactKeys(value, ["kind", "callId", "label", "at"]) && isNonEmptyString(value.callId) && isNonEmptyString(value.label) && value.label.length <= 200 && typeof value.at === "number" && Number.isFinite(value.at) ? value : null;
|
|
3099
|
+
},
|
|
3100
|
+
"agent-dispatch": (value) => {
|
|
3101
|
+
const child = parseSafeChildRef(value.child);
|
|
3102
|
+
if (!child || typeof value.at !== "number" || !Number.isFinite(value.at)) return null;
|
|
3103
|
+
return hasExactKeys(value, ["kind", "child", "at"]) ? value : null;
|
|
3104
|
+
},
|
|
3105
|
+
"agent-completed": (value) => {
|
|
3106
|
+
const child = parseSafeChildRef(value.child);
|
|
3107
|
+
if (!child || typeof value.at !== "number" || !Number.isFinite(value.at)) return null;
|
|
3108
|
+
return hasOnlyKeys(value, ["kind", "child", "receiptSummary", "at"]) && (value.receiptSummary === void 0 || typeof value.receiptSummary === "string") ? value : null;
|
|
3109
|
+
},
|
|
3110
|
+
"agent-failed": (value) => {
|
|
3111
|
+
const child = parseSafeChildRef(value.child);
|
|
3112
|
+
if (!child || typeof value.at !== "number" || !Number.isFinite(value.at)) return null;
|
|
3113
|
+
return hasExactKeys(value, ["kind", "child", "errorCode", "message", "at"]) && isNonEmptyString(value.errorCode) && isNonEmptyString(value.message) ? value : null;
|
|
3093
3114
|
}
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
if (value
|
|
3097
|
-
|
|
3098
|
-
}
|
|
3099
|
-
if (value.kind === "agent-completed" && hasOnlyKeys(value, ["kind", "child", "receiptSummary", "at"]) && (value.receiptSummary === void 0 || typeof value.receiptSummary === "string")) {
|
|
3100
|
-
return value;
|
|
3101
|
-
}
|
|
3102
|
-
if (value.kind === "agent-failed" && hasExactKeys(value, ["kind", "child", "errorCode", "message", "at"]) && isNonEmptyString(value.errorCode) && isNonEmptyString(value.message)) {
|
|
3103
|
-
return value;
|
|
3104
|
-
}
|
|
3105
|
-
return null;
|
|
3115
|
+
};
|
|
3116
|
+
function parseAgentSessionCustomEntry(value) {
|
|
3117
|
+
if (!isRecord(value) || typeof value.kind !== "string") return null;
|
|
3118
|
+
return parseClosed(agentSessionCustomEntryParsers, value.kind, value);
|
|
3106
3119
|
}
|
|
3107
3120
|
function parseResolvedChildProfileProof(value) {
|
|
3108
3121
|
if (!isRecord(value) || !hasExactKeys(value, [
|
|
@@ -3118,23 +3131,26 @@ function parseResolvedChildProfileProof(value) {
|
|
|
3118
3131
|
}
|
|
3119
3132
|
return value;
|
|
3120
3133
|
}
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
default:
|
|
3136
|
-
return null;
|
|
3134
|
+
const parseSafeTextRecord = (value) => {
|
|
3135
|
+
return hasExactKeys(value, ["type", "text", "at"]) && typeof value.text === "string" ? value : null;
|
|
3136
|
+
};
|
|
3137
|
+
const safeJournalRecordParsers = {
|
|
3138
|
+
"safe-user-text": parseSafeTextRecord,
|
|
3139
|
+
"safe-assistant-text": parseSafeTextRecord,
|
|
3140
|
+
"enso-operation": (value) => {
|
|
3141
|
+
return hasExactKeys(value, ["type", "operationId", "capabilityId", "toolCallId", "at"]) && isNonEmptyString(value.operationId) && isProductSurfaceId(value.capabilityId) && isNonEmptyString(value.toolCallId) ? value : null;
|
|
3142
|
+
},
|
|
3143
|
+
"safe-model-result": (value) => {
|
|
3144
|
+
return hasExactKeys(value, ["type", "toolCallId", "modelResult", "at"]) && isNonEmptyString(value.toolCallId) && parseCapabilityResult(value.modelResult) ? value : null;
|
|
3145
|
+
},
|
|
3146
|
+
"capability-receipt": (value) => {
|
|
3147
|
+
return hasExactKeys(value, ["type", "receipt", "at"]) && parseCapabilityReceipt(value.receipt) ? value : null;
|
|
3137
3148
|
}
|
|
3149
|
+
};
|
|
3150
|
+
function parseSafeJournalRecord(value) {
|
|
3151
|
+
if (!isRecord(value) || typeof value.at !== "number" || !Number.isFinite(value.at)) return null;
|
|
3152
|
+
if (typeof value.type !== "string") return null;
|
|
3153
|
+
return parseClosed(safeJournalRecordParsers, value.type, value);
|
|
3138
3154
|
}
|
|
3139
3155
|
function parseSafeJournalProjection(value) {
|
|
3140
3156
|
if (!isRecord(value) || !hasExactKeys(value, ["records", "partial"]) || !Array.isArray(value.records) || value.records.some((record2) => parseSafeJournalRecord(record2) === null) || typeof value.partial !== "boolean") {
|
|
@@ -3203,350 +3219,433 @@ function parseSessionSnapshot(value) {
|
|
|
3203
3219
|
}
|
|
3204
3220
|
return value;
|
|
3205
3221
|
}
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3222
|
+
const parseWorkspaceLockCommand = (value) => {
|
|
3223
|
+
return hasOnlyKeys(
|
|
3224
|
+
value,
|
|
3225
|
+
value.type === "lock-workspace" ? ["type", "requestId", "conversationIds"] : ["type", "requestId", "conversationIds", "branch"]
|
|
3226
|
+
) && isNonEmptyString(value.requestId) && Array.isArray(value.conversationIds) && value.conversationIds.length > 0 && value.conversationIds.every(isNonEmptyString) && new Set(value.conversationIds).size === value.conversationIds.length && (value.branch === void 0 || isNonEmptyString(value.branch)) ? value : null;
|
|
3227
|
+
};
|
|
3228
|
+
const parsePromptOrSteer = (value) => {
|
|
3229
|
+
const images = value.images === void 0 ? [] : parseAttachedImages(value.images);
|
|
3230
|
+
return hasOnlyKeys(value, [
|
|
3231
|
+
"type",
|
|
3232
|
+
"identity",
|
|
3233
|
+
"text",
|
|
3234
|
+
"images",
|
|
3235
|
+
"deliveryId",
|
|
3236
|
+
"activeOnly",
|
|
3237
|
+
"resume",
|
|
3238
|
+
"instanceId"
|
|
3239
|
+
]) && parseAnySessionIdentity(value.identity) && typeof value.text === "string" && images !== null && (value.text.length > 0 || images.length > 0) && (value.activeOnly === void 0 || value.type === "steer" && value.activeOnly === true && isDeliveryId(value.deliveryId)) && (value.resume === void 0 || value.type === "prompt" && value.resume === true) && (value.type === "steer" && value.deliveryId === void 0 || isDeliveryId(value.deliveryId)) && (value.instanceId === void 0 || isUuid(value.instanceId) && parseSessionIdentity(value.identity) !== null) ? value : null;
|
|
3240
|
+
};
|
|
3241
|
+
const parseHostResultCommand = (value) => {
|
|
3242
|
+
if (!hasOnlyKeys(value, ["type", "identity", "requestId", "ok", "result", "error"]) || !parseAnySessionIdentity(value.identity) || !isNonEmptyString(value.requestId) || typeof value.ok !== "boolean") {
|
|
3243
|
+
return null;
|
|
3210
3244
|
}
|
|
3211
|
-
|
|
3245
|
+
const shapeOk = value.ok ? value.error === void 0 : isNonEmptyString(value.error) && value.result === void 0;
|
|
3246
|
+
return shapeOk ? value : null;
|
|
3247
|
+
};
|
|
3248
|
+
const parseIdentityOnlyCommand = (value) => {
|
|
3249
|
+
return hasExactKeys(value, ["type", "identity"]) && parseAnySessionIdentity(value.identity) ? value : null;
|
|
3250
|
+
};
|
|
3251
|
+
const agentCommandParsers = {
|
|
3252
|
+
"oauth-pool-result": (value) => {
|
|
3253
|
+
return hasOnlyKeys(value, ["type", "requestId", "accountKey", "selectionReceipt", "error"]) && isNonEmptyString(value.requestId) && (isCodexAccountKey(value.accountKey) && value.error === void 0 && (value.selectionReceipt === void 0 || isUuid(value.selectionReceipt)) || value.accountKey === void 0 && value.selectionReceipt === void 0 && isNonEmptyString(value.error)) ? value : null;
|
|
3254
|
+
},
|
|
3255
|
+
"mcp-oauth-refresh-result": (value) => {
|
|
3212
3256
|
return hasOnlyKeys(value, ["type", "requestId", "result"]) && isNonEmptyString(value.requestId) && isMcpOAuthRefreshResult(value.result) ? value : null;
|
|
3213
|
-
}
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
"instanceId"
|
|
3279
|
-
]) || !parseSessionIdentity(value.identity) || typeof value.cwd !== "string" || !parseSessionModelConfig(value.model) || value.resumeFile !== void 0 && !isNonEmptyString(value.resumeFile) || value.loadHarnessAssets !== void 0 && typeof value.loadHarnessAssets !== "boolean" || value.trustedProjectCode !== void 0 && !(Array.isArray(value.trustedProjectCode) && value.trustedProjectCode.length <= 500 && value.trustedProjectCode.every(
|
|
3280
|
-
(entry) => typeof entry === "string" && entry.length > 0 && entry.length <= 1024
|
|
3281
|
-
)) || value.pluginCommands !== void 0 && parsePluginCommands(value.pluginCommands) === null || value.pluginTools !== void 0 && !isPluginToolList(value.pluginTools) || value.secretaryTools !== void 0 && parseSecretaryToolDescriptors(value.secretaryTools) === null || value.workflowPresetFiles !== void 0 && !(Array.isArray(value.workflowPresetFiles) && value.workflowPresetFiles.length <= 500 && value.workflowPresetFiles.every(
|
|
3282
|
-
(entry) => typeof entry === "string" && entry.length > 0 && entry.length <= 1024
|
|
3283
|
-
)) || value.pluginEvents !== void 0 && !isPluginEventPlan(value.pluginEvents) || value.pluginHooks !== void 0 && parsePluginHooks(value.pluginHooks) === null || value.rtkEnabled !== void 0 && typeof value.rtkEnabled !== "boolean" || value.dcgPath !== void 0 && !isNonEmptyString(value.dcgPath) || value.planMode !== void 0 && typeof value.planMode !== "boolean" || value.windowsLocalShell !== void 0 && !WINDOWS_LOCAL_SHELLS.includes(
|
|
3284
|
-
value.windowsLocalShell
|
|
3285
|
-
) || value.exploreFoldEnabled !== void 0 && typeof value.exploreFoldEnabled !== "boolean" || value.editMode !== void 0 && !isEditMode(value.editMode) || value.hashlineEditEnabled !== void 0 && typeof value.hashlineEditEnabled !== "boolean" || value.compactStrategy !== void 0 && parseCompactStrategy(value.compactStrategy) === null || value.smartCompactEnabled !== void 0 && typeof value.smartCompactEnabled !== "boolean" || value.smartCompactSummaryModel !== void 0 && parseSpawnModelConfig(value.smartCompactSummaryModel) === null || value.smartCompactMode !== void 0 && parseSmartCompactMode(value.smartCompactMode) === null || value.memoryLanguage !== void 0 && typeof value.memoryLanguage !== "string" || value.remote !== void 0 && parseAgentRemoteConfig(value.remote) === null || value.subagentModels !== void 0 && (!Array.isArray(value.subagentModels) || value.subagentModels.some((entry) => parseSubagentModelOption(entry) === null)) || value.approvalReviewer !== void 0 && parseSpawnModelConfig(value.approvalReviewer) === null || value.askRelay !== void 0 && (!isRecord(value.askRelay) || !isNonEmptyString(value.askRelay.name)) || value.approvalReviewerAllowThreshold !== void 0 && (!isApprovalAllowThreshold(value.approvalReviewerAllowThreshold) || value.approvalReviewerClassifier === void 0) || value.approvalReviewerManaged !== void 0 && (value.approvalReviewerManaged !== true || value.approvalReviewerClassifier === void 0) || value.approvalReviewerClassifier !== void 0 && (value.approvalReviewer !== void 0 || !parseClassifierCredentials(value.approvalReviewerClassifier)) || value.rolePrompt !== void 0 && !isNonEmptyString(value.rolePrompt) || value.systemPrompt !== void 0 && !isNonEmptyString(value.systemPrompt) || value.systemPromptAppend !== void 0 && !isNonEmptyString(value.systemPromptAppend) || value.systemPromptBoost !== void 0 && !isNonEmptyString(value.systemPromptBoost) || value.refusalRetryPrompt !== void 0 && !isNonEmptyString(value.refusalRetryPrompt) || value.botMode !== void 0 && typeof value.botMode !== "boolean" || value.botGroupTasks !== void 0 && typeof value.botGroupTasks !== "boolean" || value.botDiscussMode !== void 0 && typeof value.botDiscussMode !== "boolean" || value.botDiscussMode === true && (value.botMode !== true || value.botGroupTasks !== true) || value.botRoutines !== void 0 && typeof value.botRoutines !== "boolean" || value.secretaryMode !== void 0 && typeof value.secretaryMode !== "boolean" || value.botDelegationTask !== void 0 && typeof value.botDelegationTask !== "boolean" || value.botWriteLock !== void 0 && (!isRecord(value.botWriteLock) || !isNonEmptyString(value.botWriteLock.label) || !Array.isArray(value.botWriteLock.ancestors) || !value.botWriteLock.ancestors.every(isNonEmptyString)) || value.protectedActions !== void 0 && typeof value.protectedActions !== "boolean" || value.instanceId !== void 0 && !isUuid(value.instanceId)) {
|
|
3286
|
-
return null;
|
|
3287
|
-
}
|
|
3288
|
-
return value;
|
|
3289
|
-
}
|
|
3290
|
-
case "spawn-child":
|
|
3291
|
-
return hasOnlyKeys(value, ["type", "identity", "cwd", "config", "resumeFile"]) && parseChildSessionIdentity(value.identity) && typeof value.cwd === "string" && parseResolvedAgentTypeSpawnConfig(value.config) && (value.resumeFile === void 0 || isNonEmptyString(value.resumeFile)) ? value : null;
|
|
3292
|
-
case "prompt-child":
|
|
3293
|
-
return hasOnlyKeys(value, ["type", "identity", "requestId", "task", "requestBudget"]) && parseChildSessionIdentity(value.identity) && isNonEmptyString(value.requestId) && parseAgentDispatchTask(value.task) && (value.requestBudget === void 0 || value.requestBudget === true) ? value : null;
|
|
3294
|
-
case "agent-control-result":
|
|
3295
|
-
return hasExactKeys(value, ["type", "identity", "requestId", "response"]) && parseAnySessionIdentity(value.identity) && isNonEmptyString(value.requestId) && parseAgentControlToolResponse(value.response) ? value : null;
|
|
3296
|
-
case "dismiss-child": {
|
|
3297
|
-
const parent = parseSessionIdentity(value.parent);
|
|
3298
|
-
const child = parseChildSessionIdentity(value.child);
|
|
3299
|
-
return hasOnlyKeys(value, ["type", "parent", "child", "notify"]) && parent && child && child.parent.sessionId === parent.sessionId && child.parent.generation === parent.generation && (value.notify === void 0 || typeof value.notify === "boolean") ? value : null;
|
|
3300
|
-
}
|
|
3301
|
-
case "dismiss-coworker": {
|
|
3302
|
-
const parent = parseSessionIdentity(value.parent);
|
|
3303
|
-
return hasOnlyKeys(value, ["type", "parent", "coworkerId", "notify"]) && parent && isNonEmptyString(value.coworkerId) && // 归属校验:coworker id 恒为 `父id::cw-…`,防跨会话误解雇
|
|
3304
|
-
value.coworkerId.startsWith(`${parent.sessionId}::cw-`) && (value.notify === void 0 || typeof value.notify === "boolean") ? value : null;
|
|
3305
|
-
}
|
|
3306
|
-
case "resume-coworker": {
|
|
3307
|
-
const parent = parseSessionIdentity(value.parent);
|
|
3308
|
-
return hasOnlyKeys(value, [
|
|
3309
|
-
"type",
|
|
3310
|
-
"parent",
|
|
3311
|
-
"coworkerId",
|
|
3312
|
-
"name",
|
|
3313
|
-
"agentType",
|
|
3314
|
-
"resumeFile"
|
|
3315
|
-
]) && parent && isNonEmptyString(value.coworkerId) && value.coworkerId.startsWith(`${parent.sessionId}::cw-`) && isNonEmptyString(value.name) && (value.agentType === void 0 || isNonEmptyString(value.agentType)) && isNonEmptyString(value.resumeFile) ? value : null;
|
|
3316
|
-
}
|
|
3317
|
-
case "complete-text":
|
|
3318
|
-
return hasOnlyKeys(value, [
|
|
3319
|
-
"type",
|
|
3320
|
-
"requestId",
|
|
3321
|
-
"systemPrompt",
|
|
3322
|
-
"userText",
|
|
3323
|
-
"candidates",
|
|
3324
|
-
"timeoutMs",
|
|
3325
|
-
"maxTokens",
|
|
3326
|
-
"stream",
|
|
3327
|
-
"reasoning",
|
|
3328
|
-
"probe"
|
|
3329
|
-
]) && isNonEmptyString(value.requestId) && typeof value.systemPrompt === "string" && typeof value.userText === "string" && typeof value.timeoutMs === "number" && Number.isFinite(value.timeoutMs) && value.timeoutMs > 0 && (value.maxTokens === void 0 || typeof value.maxTokens === "number" && Number.isInteger(value.maxTokens) && value.maxTokens > 0) && (value.stream === void 0 || value.stream === true) && (value.reasoning === void 0 || value.reasoning === "off" || THINKING_LEVELS.includes(value.reasoning)) && (value.probe === void 0 || value.probe === true) && Array.isArray(value.candidates) && value.candidates.length >= 1 && value.candidates.length <= TITLE_SUMMARY_MAX_CANDIDATES && value.candidates.every((candidate) => parseSpawnModelConfig(candidate)) ? value : null;
|
|
3330
|
-
case "abort-complete-text":
|
|
3331
|
-
return hasExactKeys(value, ["type", "requestId"]) && isNonEmptyString(value.requestId) ? value : null;
|
|
3332
|
-
case "classify-choice":
|
|
3333
|
-
return hasExactKeys(value, [
|
|
3334
|
-
"type",
|
|
3335
|
-
"requestId",
|
|
3336
|
-
"classifier",
|
|
3337
|
-
"state",
|
|
3338
|
-
"instructions",
|
|
3339
|
-
"criteria",
|
|
3340
|
-
"timeoutMs"
|
|
3341
|
-
]) && isNonEmptyString(value.requestId) && parseClassifierCredentials(value.classifier) && isRecord(value.state) && isNonEmptyString(value.instructions) && isRecord(value.criteria) && Object.keys(value.criteria).length > 0 && Object.values(value.criteria).every(isNonEmptyString) && typeof value.timeoutMs === "number" && Number.isFinite(value.timeoutMs) && value.timeoutMs > 0 ? value : null;
|
|
3342
|
-
case "abort-classify-choice":
|
|
3343
|
-
return hasExactKeys(value, ["type", "requestId"]) && isNonEmptyString(value.requestId) ? value : null;
|
|
3344
|
-
case "summarize-title":
|
|
3345
|
-
return hasExactKeys(value, ["type", "conversationId", "input", "candidates"]) && isNonEmptyString(value.conversationId) && parseTitleSummaryInput(value.input) && Array.isArray(value.candidates) && value.candidates.length >= 1 && value.candidates.length <= TITLE_SUMMARY_MAX_CANDIDATES && value.candidates.every((candidate) => parseSpawnModelConfig(candidate)) ? value : null;
|
|
3346
|
-
case "prompt":
|
|
3347
|
-
case "steer": {
|
|
3348
|
-
const images = value.images === void 0 ? [] : parseAttachedImages(value.images);
|
|
3349
|
-
return hasOnlyKeys(value, [
|
|
3350
|
-
"type",
|
|
3351
|
-
"identity",
|
|
3352
|
-
"text",
|
|
3353
|
-
"images",
|
|
3354
|
-
"deliveryId",
|
|
3355
|
-
"activeOnly",
|
|
3356
|
-
"resume",
|
|
3357
|
-
"instanceId"
|
|
3358
|
-
]) && parseAnySessionIdentity(value.identity) && typeof value.text === "string" && images !== null && (value.text.length > 0 || images.length > 0) && (value.activeOnly === void 0 || value.type === "steer" && value.activeOnly === true && isDeliveryId(value.deliveryId)) && (value.resume === void 0 || value.type === "prompt" && value.resume === true) && (value.deliveryId === void 0 || isDeliveryId(value.deliveryId)) && (value.instanceId === void 0 || isUuid(value.instanceId) && parseSessionIdentity(value.identity) !== null) ? value : null;
|
|
3359
|
-
}
|
|
3360
|
-
case "set-model":
|
|
3361
|
-
return hasExactKeys(value, ["type", "identity", "model"]) && parseAnySessionIdentity(value.identity) && parseSessionModelConfig(value.model) ? value : null;
|
|
3362
|
-
case "set-thinking":
|
|
3363
|
-
return hasExactKeys(value, ["type", "identity", "level"]) && parseAnySessionIdentity(value.identity) && THINKING_LEVELS.includes(value.level) ? value : null;
|
|
3364
|
-
case "set-system-prompt":
|
|
3365
|
-
return hasExactKeys(value, ["type", "identity", "systemPrompt"]) && parseSessionIdentity(value.identity) && isNonEmptyString(value.systemPrompt) ? value : null;
|
|
3366
|
-
case "set-reasoning":
|
|
3367
|
-
return hasOnlyKeys(value, ["type", "identity", "enabled", "level"]) && parseAnySessionIdentity(value.identity) && typeof value.enabled === "boolean" && (value.level === void 0 || THINKING_LEVELS.includes(value.level)) ? value : null;
|
|
3368
|
-
case "approval-respond":
|
|
3369
|
-
return hasExactKeys(value, ["type", "identity", "requestId", "decision"]) && parseAnySessionIdentity(value.identity) && isNonEmptyString(value.requestId) && isApprovalDecision(value.decision) ? value : null;
|
|
3370
|
-
case "request-timeout":
|
|
3371
|
-
return hasExactKeys(value, ["type", "identity", "kind", "requestId"]) && parseAnySessionIdentity(value.identity) && (value.kind === "approval" || value.kind === "ask") && isNonEmptyString(value.requestId) ? value : null;
|
|
3372
|
-
case "agent-notify":
|
|
3373
|
-
return hasExactKeys(value, ["type", "identity", "text", "urgent"]) && parseSessionIdentity(value.identity) && isNonEmptyString(value.text) && typeof value.urgent === "boolean" ? value : null;
|
|
3374
|
-
case "set-approval-mode":
|
|
3375
|
-
return hasOnlyKeys(value, ["type", "identity", "mode", "autoReject"]) && parseAnySessionIdentity(value.identity) && APPROVAL_MODES.includes(value.mode) && (value.autoReject === void 0 || typeof value.autoReject === "boolean") ? value : null;
|
|
3376
|
-
case "set-ask-relay":
|
|
3377
|
-
return hasOnlyKeys(value, ["type", "identity", "relay"]) && parseAnySessionIdentity(value.identity) && (value.relay === void 0 || isRecord(value.relay) && isNonEmptyString(value.relay.name)) ? value : null;
|
|
3378
|
-
case "set-plan-mode":
|
|
3379
|
-
return hasExactKeys(value, ["type", "identity", "active"]) && parseSessionIdentity(value.identity) && typeof value.active === "boolean" ? value : null;
|
|
3380
|
-
case "plan-respond":
|
|
3381
|
-
return hasOnlyKeys(value, ["type", "identity", "planId", "action", "feedback"]) && parseSessionIdentity(value.identity) && isNonEmptyString(value.planId) && PLAN_RESPOND_ACTIONS.includes(value.action) && (value.feedback === void 0 || typeof value.feedback === "string" && value.feedback.length <= PLAN_FEEDBACK_MAX) ? value : null;
|
|
3382
|
-
case "set-approval-reviewer":
|
|
3383
|
-
return hasOnlyKeys(value, ["type", "model", "classifier", "managed", "allowThreshold"]) && (value.allowThreshold === void 0 || isApprovalAllowThreshold(value.allowThreshold) && value.classifier !== void 0) && (value.model === void 0 || parseSpawnModelConfig(value.model)) && (value.classifier === void 0 || value.model === void 0 && parseClassifierCredentials(value.classifier)) && (value.managed === void 0 || value.managed === true && value.classifier !== void 0) ? value : null;
|
|
3384
|
-
case "set-compact-route":
|
|
3385
|
-
return hasOnlyKeys(value, ["type", "model", "mode"]) && (value.model === void 0 || parseSpawnModelConfig(value.model) !== null) && (value.mode === void 0 || parseSmartCompactMode(value.mode) !== null) ? value : null;
|
|
3386
|
-
case "set-max-active-coworkers":
|
|
3387
|
-
return hasExactKeys(value, ["type", "limit"]) && parseMaxActiveCoworkers(value.limit) !== null ? value : null;
|
|
3388
|
-
case "set-auto-retry-limit":
|
|
3389
|
-
return hasExactKeys(value, ["type", "limit"]) && parseAutoRetryLimit(value.limit) !== null ? value : null;
|
|
3390
|
-
case "set-shell-limits":
|
|
3391
|
-
return hasExactKeys(value, ["type", "limits"]) && isRecord(value.limits) && JSON.stringify(resolveShellLimits(value.limits)) === JSON.stringify(value.limits) ? value : null;
|
|
3392
|
-
case "set-privacy-masking":
|
|
3393
|
-
return hasExactKeys(value, ["type", "settings"]) && JSON.stringify(parsePrivacyMaskSettings(value.settings)) === JSON.stringify(value.settings) ? value : null;
|
|
3394
|
-
case "set-image-generation-config":
|
|
3395
|
-
return hasOnlyKeys(value, ["type", "config", "error"]) && (value.config === null || parseImageGenerationConfig(value.config) !== null) && (value.error === void 0 || typeof value.error === "string" && value.error.length <= 1024) ? value : null;
|
|
3396
|
-
case "set-web-search-config":
|
|
3397
|
-
return hasOnlyKeys(value, ["type", "chain", "configured"]) && (value.configured === void 0 || typeof value.configured === "boolean") && Array.isArray(value.chain) && value.chain.length <= WEB_SEARCH_CHAIN_MAX && value.chain.every(isWebSearchChainEntry) ? value : null;
|
|
3398
|
-
case "set-disabled-workflow-presets":
|
|
3399
|
-
return hasExactKeys(value, ["type", "ids"]) && Array.isArray(value.ids) && value.ids.length <= 64 && value.ids.every((id) => typeof id === "string" && isWorkflowPresetId(id)) ? value : null;
|
|
3400
|
-
case "set-builtin-tools":
|
|
3401
|
-
return hasExactKeys(value, ["type", "identity", "disabledTools"]) && parseSessionIdentity(value.identity) && Array.isArray(value.disabledTools) && value.disabledTools.length <= 64 && value.disabledTools.every(
|
|
3402
|
-
(id) => typeof id === "string" && id.length > 0 && id.length <= 64
|
|
3403
|
-
) ? value : null;
|
|
3404
|
-
case "set-model-directory":
|
|
3405
|
-
return hasExactKeys(value, ["type", "snapshot", "customProviders"]) ? value : null;
|
|
3406
|
-
case "ask-respond":
|
|
3407
|
-
return hasOnlyKeys(value, ["type", "identity", "requestId", "answer", "by", "name"]) && parseAnySessionIdentity(value.identity) && isNonEmptyString(value.requestId) && isNonEmptyString(value.answer) && (value.by === void 0 || value.by === "user" || value.by === "relay") && (value.name === void 0 || isNonEmptyString(value.name)) ? value : null;
|
|
3408
|
-
case "browser-result":
|
|
3409
|
-
case "memory-result":
|
|
3410
|
-
case "delegation-result":
|
|
3411
|
-
case "computer-result":
|
|
3412
|
-
case "plugin-tool-result": {
|
|
3413
|
-
if (!hasOnlyKeys(value, ["type", "identity", "requestId", "ok", "result", "error"]) || !parseAnySessionIdentity(value.identity) || !isNonEmptyString(value.requestId) || typeof value.ok !== "boolean") {
|
|
3414
|
-
return null;
|
|
3415
|
-
}
|
|
3416
|
-
const shapeOk = value.ok ? value.error === void 0 : isNonEmptyString(value.error) && value.result === void 0;
|
|
3417
|
-
return shapeOk ? value : null;
|
|
3418
|
-
}
|
|
3419
|
-
case "secretary-result": {
|
|
3420
|
-
if (!hasOnlyKeys(value, ["type", "identity", "requestId", "ok", "result", "error"]) || !parseSessionIdentity(value.identity) || !isNonEmptyString(value.requestId) || typeof value.ok !== "boolean") {
|
|
3421
|
-
return null;
|
|
3422
|
-
}
|
|
3423
|
-
const shapeOk = value.ok ? value.error === void 0 : isNonEmptyString(value.error) && value.result === void 0;
|
|
3424
|
-
return shapeOk ? value : null;
|
|
3425
|
-
}
|
|
3426
|
-
case "plugin-intercept-result": {
|
|
3427
|
-
if (!hasOnlyKeys(value, ["type", "identity", "requestId", "ok", "result", "error"]) || !parseSessionIdentity(value.identity) || !isNonEmptyString(value.requestId) || typeof value.ok !== "boolean") {
|
|
3428
|
-
return null;
|
|
3429
|
-
}
|
|
3430
|
-
const shapeOk = value.ok ? value.error === void 0 : isNonEmptyString(value.error) && value.result === void 0;
|
|
3431
|
-
return shapeOk ? value : null;
|
|
3432
|
-
}
|
|
3433
|
-
case "plugin-tool-progress":
|
|
3434
|
-
return hasExactKeys(value, ["type", "identity", "requestId", "text"]) && parseSessionIdentity(value.identity) && isNonEmptyString(value.requestId) && isBoundedText(value.text, PLUGIN_PROGRESS_MAX_CHARS) ? value : null;
|
|
3435
|
-
case "plugin-inject":
|
|
3436
|
-
return hasOnlyKeys(value, [...PLUGIN_INJECT_KEYS, "images"]) && PLUGIN_INJECT_KEYS.every((key) => key in value) && parsePluginInjectImages(value.images) !== null && parseSessionIdentity(value.identity) && isNonEmptyString(value.pluginId) && value.pluginId.length <= 128 && isNonEmptyString(value.pluginName) && value.pluginName.length <= 256 && isNonEmptyString(value.text) && isBoundedText(value.text, PLUGIN_INJECT_MAX_CHARS) && (value.deliverAs === "steer" || value.deliverAs === "followUp" || value.deliverAs === "nextTurn") && typeof value.triggerTurn === "boolean" ? value : null;
|
|
3437
|
-
case "workflow-stop":
|
|
3438
|
-
return hasExactKeys(value, ["type", "identity", "runId"]) && parseAnySessionIdentity(value.identity) && isNonEmptyString(value.runId) && value.runId.length <= 80 ? value : null;
|
|
3439
|
-
case "task-stop":
|
|
3440
|
-
return hasExactKeys(value, ["type", "identity", "taskId"]) && parseAnySessionIdentity(value.identity) && isNonEmptyString(value.taskId) ? value : null;
|
|
3441
|
-
case "tool-background":
|
|
3442
|
-
return hasExactKeys(value, ["type", "identity", "toolCallId"]) && parseAnySessionIdentity(value.identity) && isNonEmptyString(value.toolCallId) && value.toolCallId.length <= 512 ? value : null;
|
|
3443
|
-
case "subagent-stop":
|
|
3444
|
-
return hasExactKeys(value, ["type", "identity", "agentId"]) && parseAnySessionIdentity(value.identity) && isNonEmptyString(value.agentId) ? value : null;
|
|
3445
|
-
case "compact":
|
|
3446
|
-
return hasOnlyKeys(value, ["type", "identity", "instructions"]) && parseAnySessionIdentity(value.identity) && (value.instructions === void 0 || isNonEmptyString(value.instructions)) ? value : null;
|
|
3447
|
-
case "rewind":
|
|
3448
|
-
return hasOnlyKeys(value, [
|
|
3449
|
-
"type",
|
|
3450
|
-
"identity",
|
|
3451
|
-
"entryId",
|
|
3452
|
-
"userIndexFromEnd",
|
|
3453
|
-
"restoreFiles"
|
|
3454
|
-
]) && parseAnySessionIdentity(value.identity) && (value.entryId !== void 0 ? isNonEmptyString(value.entryId) && value.entryId.trim().length > 0 && value.userIndexFromEnd === void 0 : isSequence(value.userIndexFromEnd)) && (value.restoreFiles === void 0 || typeof value.restoreFiles === "boolean") ? value : null;
|
|
3455
|
-
case "fork": {
|
|
3456
|
-
const hasEntry = typeof value.entryId === "string";
|
|
3457
|
-
const hasIndex = typeof value.userIndexFromEnd === "number";
|
|
3458
|
-
return hasOnlyKeys(value, [
|
|
3459
|
-
"type",
|
|
3460
|
-
"identity",
|
|
3461
|
-
"targetConversationId",
|
|
3462
|
-
"entryId",
|
|
3463
|
-
"userIndexFromEnd"
|
|
3464
|
-
]) && parseAnySessionIdentity(value.identity) && isUuid(value.targetConversationId) && (hasEntry ? !hasIndex && isNonEmptyString(value.entryId) : hasIndex && isSequence(value.userIndexFromEnd)) ? value : null;
|
|
3465
|
-
}
|
|
3466
|
-
case "abort":
|
|
3467
|
-
case "abort-retry":
|
|
3468
|
-
case "release-parent":
|
|
3469
|
-
return hasExactKeys(value, ["type", "identity"]) && parseAnySessionIdentity(value.identity) ? value : null;
|
|
3470
|
-
case "withdraw-steer":
|
|
3471
|
-
return hasExactKeys(value, ["type", "identity", "deliveryId"]) && parseAnySessionIdentity(value.identity) && isDeliveryId(value.deliveryId) ? value : null;
|
|
3472
|
-
case "retry":
|
|
3473
|
-
return hasOnlyKeys(value, ["type", "identity", "instanceId", "unfinishedOnly"]) && parseAnySessionIdentity(value.identity) && (value.unfinishedOnly === void 0 || value.unfinishedOnly === true) && (value.instanceId === void 0 || isUuid(value.instanceId) && parseSessionIdentity(value.identity) !== null) ? value : null;
|
|
3474
|
-
case "append-session-custom-entry":
|
|
3475
|
-
return hasExactKeys(value, ["type", "identity", "entry"]) && parseAnySessionIdentity(value.identity) && parseAgentSessionCustomEntry(value.entry) ? value : null;
|
|
3476
|
-
case "reload-session":
|
|
3477
|
-
return hasExactKeys(value, ["type", "requestId", "sessionId"]) && isNonEmptyString(value.requestId) && isNonEmptyString(value.sessionId) ? value : null;
|
|
3478
|
-
case "snapshot":
|
|
3479
|
-
if (hasExactKeys(value, ["type"])) return { type: "snapshot" };
|
|
3480
|
-
return hasExactKeys(value, ["type", "sessionId"]) && isNonEmptyString(value.sessionId) ? { type: "snapshot", sessionId: value.sessionId } : null;
|
|
3481
|
-
case "pin-sessions":
|
|
3482
|
-
return hasExactKeys(value, ["type", "sessionIds"]) && Array.isArray(value.sessionIds) && value.sessionIds.every((id) => typeof id === "string") ? { type: "pin-sessions", sessionIds: value.sessionIds } : null;
|
|
3483
|
-
case "warm-mcp":
|
|
3484
|
-
return hasExactKeys(value, ["type", "servers"]) && Array.isArray(value.servers) ? value : null;
|
|
3485
|
-
case "plugin-mcp-list":
|
|
3486
|
-
return hasExactKeys(value, ["type", "requestId", "servers"]) && isNonEmptyString(value.requestId) && Array.isArray(value.servers) ? value : null;
|
|
3487
|
-
case "plugin-mcp-call":
|
|
3488
|
-
return hasExactKeys(value, ["type", "requestId", "servers", "server", "tool", "args"]) && isNonEmptyString(value.requestId) && Array.isArray(value.servers) && isNonEmptyString(value.server) && isNonEmptyString(value.tool) && isRecord(value.args) ? value : null;
|
|
3489
|
-
case "plugin-mcp-cancel":
|
|
3490
|
-
return hasExactKeys(value, ["type", "requestId"]) && isNonEmptyString(value.requestId) ? { type: "plugin-mcp-cancel", requestId: value.requestId } : null;
|
|
3491
|
-
case "plugin-agent-run":
|
|
3492
|
-
return hasOnlyKeys(value, [
|
|
3493
|
-
"type",
|
|
3494
|
-
"requestId",
|
|
3495
|
-
"identity",
|
|
3496
|
-
"prompt",
|
|
3497
|
-
"systemPrompt",
|
|
3498
|
-
"context",
|
|
3499
|
-
"timeoutMs",
|
|
3500
|
-
"model"
|
|
3501
|
-
]) && isNonEmptyString(value.requestId) && parseSessionIdentity(value.identity) && isNonEmptyString(value.prompt) && isBoundedText(value.prompt, PLUGIN_AGENT_PROMPT_MAX_CHARS) && (value.systemPrompt === void 0 || typeof value.systemPrompt === "string" && isBoundedText(value.systemPrompt, PLUGIN_AGENT_SYSTEM_MAX_CHARS)) && (value.context === "conversation" || value.context === "fork" || value.context === "none") && Number.isInteger(value.timeoutMs) && value.timeoutMs > 0 && value.timeoutMs <= PLUGIN_AGENT_MAX_TIMEOUT_MS && (value.model === void 0 || parseSpawnModelConfig(value.model) !== null) ? value : null;
|
|
3502
|
-
case "plugin-agent-cancel":
|
|
3503
|
-
return hasExactKeys(value, ["type", "requestId"]) && isNonEmptyString(value.requestId) ? { type: "plugin-agent-cancel", requestId: value.requestId } : null;
|
|
3504
|
-
case "set-proxy-env": {
|
|
3505
|
-
if (!hasExactKeys(value, ["type", "env"]) || !isRecord(value.env)) return null;
|
|
3506
|
-
for (const entry of Object.values(value.env)) {
|
|
3507
|
-
if (entry !== null && typeof entry !== "string") return null;
|
|
3508
|
-
}
|
|
3509
|
-
return value;
|
|
3257
|
+
},
|
|
3258
|
+
"lock-workspace": parseWorkspaceLockCommand,
|
|
3259
|
+
"unlock-workspace": parseWorkspaceLockCommand,
|
|
3260
|
+
"spawn-parent": (value) => {
|
|
3261
|
+
if (!hasOnlyKeys(value, [
|
|
3262
|
+
"type",
|
|
3263
|
+
"identity",
|
|
3264
|
+
"cwd",
|
|
3265
|
+
"model",
|
|
3266
|
+
"resumeFile",
|
|
3267
|
+
"reasoningEnabled",
|
|
3268
|
+
"thinkingLevel",
|
|
3269
|
+
"loadLocalSkills",
|
|
3270
|
+
"loadHarnessAssets",
|
|
3271
|
+
"trustedProjectCode",
|
|
3272
|
+
"exploreFoldEnabled",
|
|
3273
|
+
"editMode",
|
|
3274
|
+
"hashlineEditEnabled",
|
|
3275
|
+
"compactStrategy",
|
|
3276
|
+
"smartCompactEnabled",
|
|
3277
|
+
"smartCompactSummaryModel",
|
|
3278
|
+
"smartCompactMode",
|
|
3279
|
+
"memoryLanguage",
|
|
3280
|
+
"skillPaths",
|
|
3281
|
+
"mcpServers",
|
|
3282
|
+
"pluginTools",
|
|
3283
|
+
"secretaryTools",
|
|
3284
|
+
"workflowPresetFiles",
|
|
3285
|
+
"pluginEvents",
|
|
3286
|
+
"instruction",
|
|
3287
|
+
"approvalMode",
|
|
3288
|
+
"autoRejectApprovals",
|
|
3289
|
+
"askRelay",
|
|
3290
|
+
"approvalReviewer",
|
|
3291
|
+
"approvalReviewerClassifier",
|
|
3292
|
+
"approvalReviewerManaged",
|
|
3293
|
+
"approvalReviewerAllowThreshold",
|
|
3294
|
+
"agentTypes",
|
|
3295
|
+
"subagentModels",
|
|
3296
|
+
"disabledTools",
|
|
3297
|
+
"windowsLocalShell",
|
|
3298
|
+
"rtkEnabled",
|
|
3299
|
+
"dcgPath",
|
|
3300
|
+
"remote",
|
|
3301
|
+
"rolePrompt",
|
|
3302
|
+
"systemPrompt",
|
|
3303
|
+
"systemPromptAppend",
|
|
3304
|
+
"systemPromptBoost",
|
|
3305
|
+
"refusalRetryPrompt",
|
|
3306
|
+
"botMode",
|
|
3307
|
+
"botGroupTasks",
|
|
3308
|
+
"botDiscussMode",
|
|
3309
|
+
"botRoutines",
|
|
3310
|
+
"secretaryMode",
|
|
3311
|
+
"botDelegationTask",
|
|
3312
|
+
"botWriteLock",
|
|
3313
|
+
"protectedActions",
|
|
3314
|
+
"planMode",
|
|
3315
|
+
"instanceId"
|
|
3316
|
+
]) || !parseSessionIdentity(value.identity) || typeof value.cwd !== "string" || !parseSessionModelConfig(value.model) || value.resumeFile !== void 0 && !isNonEmptyString(value.resumeFile) || value.loadHarnessAssets !== void 0 && typeof value.loadHarnessAssets !== "boolean" || value.trustedProjectCode !== void 0 && !(Array.isArray(value.trustedProjectCode) && value.trustedProjectCode.length <= 500 && value.trustedProjectCode.every(
|
|
3317
|
+
(entry) => typeof entry === "string" && entry.length > 0 && entry.length <= 1024
|
|
3318
|
+
)) || value.pluginTools !== void 0 && !isPluginToolList(value.pluginTools) || value.secretaryTools !== void 0 && parseSecretaryToolDescriptors(value.secretaryTools) === null || value.workflowPresetFiles !== void 0 && !(Array.isArray(value.workflowPresetFiles) && value.workflowPresetFiles.length <= 500 && value.workflowPresetFiles.every(
|
|
3319
|
+
(entry) => typeof entry === "string" && entry.length > 0 && entry.length <= 1024
|
|
3320
|
+
)) || value.pluginEvents !== void 0 && !isPluginEventPlan(value.pluginEvents) || value.rtkEnabled !== void 0 && typeof value.rtkEnabled !== "boolean" || value.dcgPath !== void 0 && !isNonEmptyString(value.dcgPath) || value.planMode !== void 0 && typeof value.planMode !== "boolean" || value.windowsLocalShell !== void 0 && !WINDOWS_LOCAL_SHELLS.includes(value.windowsLocalShell) || value.exploreFoldEnabled !== void 0 && typeof value.exploreFoldEnabled !== "boolean" || value.editMode !== void 0 && !isEditMode(value.editMode) || value.hashlineEditEnabled !== void 0 && typeof value.hashlineEditEnabled !== "boolean" || value.compactStrategy !== void 0 && parseCompactStrategy(value.compactStrategy) === null || value.smartCompactEnabled !== void 0 && typeof value.smartCompactEnabled !== "boolean" || value.smartCompactSummaryModel !== void 0 && parseSpawnModelConfig(value.smartCompactSummaryModel) === null || value.smartCompactMode !== void 0 && parseSmartCompactMode(value.smartCompactMode) === null || value.memoryLanguage !== void 0 && typeof value.memoryLanguage !== "string" || value.remote !== void 0 && parseAgentRemoteConfig(value.remote) === null || value.subagentModels !== void 0 && (!Array.isArray(value.subagentModels) || value.subagentModels.some((entry) => parseSubagentModelOption(entry) === null)) || value.approvalReviewer !== void 0 && parseSpawnModelConfig(value.approvalReviewer) === null || value.askRelay !== void 0 && (!isRecord(value.askRelay) || !isNonEmptyString(value.askRelay.name)) || value.approvalReviewerAllowThreshold !== void 0 && (!isApprovalAllowThreshold(value.approvalReviewerAllowThreshold) || value.approvalReviewerClassifier === void 0) || value.approvalReviewerManaged !== void 0 && (value.approvalReviewerManaged !== true || value.approvalReviewerClassifier === void 0) || value.approvalReviewerClassifier !== void 0 && (value.approvalReviewer !== void 0 || !parseClassifierCredentials(value.approvalReviewerClassifier)) || value.rolePrompt !== void 0 && !isNonEmptyString(value.rolePrompt) || value.systemPrompt !== void 0 && !isNonEmptyString(value.systemPrompt) || value.systemPromptAppend !== void 0 && !isNonEmptyString(value.systemPromptAppend) || value.systemPromptBoost !== void 0 && !isNonEmptyString(value.systemPromptBoost) || value.refusalRetryPrompt !== void 0 && !isNonEmptyString(value.refusalRetryPrompt) || value.botMode !== void 0 && typeof value.botMode !== "boolean" || value.botGroupTasks !== void 0 && typeof value.botGroupTasks !== "boolean" || value.botDiscussMode !== void 0 && typeof value.botDiscussMode !== "boolean" || value.botDiscussMode === true && (value.botMode !== true || value.botGroupTasks !== true) || value.botRoutines !== void 0 && typeof value.botRoutines !== "boolean" || value.secretaryMode !== void 0 && typeof value.secretaryMode !== "boolean" || value.botDelegationTask !== void 0 && typeof value.botDelegationTask !== "boolean" || value.botWriteLock !== void 0 && (!isRecord(value.botWriteLock) || !isNonEmptyString(value.botWriteLock.label) || !Array.isArray(value.botWriteLock.ancestors) || !value.botWriteLock.ancestors.every(isNonEmptyString)) || value.protectedActions !== void 0 && typeof value.protectedActions !== "boolean" || value.instanceId !== void 0 && !isUuid(value.instanceId)) {
|
|
3321
|
+
return null;
|
|
3510
3322
|
}
|
|
3511
|
-
|
|
3323
|
+
return value;
|
|
3324
|
+
},
|
|
3325
|
+
"spawn-child": (value) => {
|
|
3326
|
+
return hasOnlyKeys(value, ["type", "identity", "cwd", "config", "resumeFile"]) && parseChildSessionIdentity(value.identity) && typeof value.cwd === "string" && parseResolvedAgentTypeSpawnConfig(value.config) && (value.resumeFile === void 0 || isNonEmptyString(value.resumeFile)) ? value : null;
|
|
3327
|
+
},
|
|
3328
|
+
"prompt-child": (value) => {
|
|
3329
|
+
return hasOnlyKeys(value, ["type", "identity", "requestId", "task", "requestBudget"]) && parseChildSessionIdentity(value.identity) && isNonEmptyString(value.requestId) && parseAgentDispatchTask(value.task) && (value.requestBudget === void 0 || value.requestBudget === true) ? value : null;
|
|
3330
|
+
},
|
|
3331
|
+
"agent-control-result": (value) => {
|
|
3332
|
+
return hasExactKeys(value, ["type", "identity", "requestId", "response"]) && parseAnySessionIdentity(value.identity) && isNonEmptyString(value.requestId) && parseAgentControlToolResponse(value.response) ? value : null;
|
|
3333
|
+
},
|
|
3334
|
+
"dismiss-child": (value) => {
|
|
3335
|
+
const parent = parseSessionIdentity(value.parent);
|
|
3336
|
+
const child = parseChildSessionIdentity(value.child);
|
|
3337
|
+
return hasOnlyKeys(value, ["type", "parent", "child", "notify"]) && parent && child && child.parent.sessionId === parent.sessionId && child.parent.generation === parent.generation && (value.notify === void 0 || typeof value.notify === "boolean") ? value : null;
|
|
3338
|
+
},
|
|
3339
|
+
"dismiss-coworker": (value) => {
|
|
3340
|
+
const parent = parseSessionIdentity(value.parent);
|
|
3341
|
+
return hasOnlyKeys(value, ["type", "parent", "coworkerId", "notify"]) && parent && isNonEmptyString(value.coworkerId) && // 归属校验:coworker id 恒为 `父id::cw-…`,防跨会话误解雇
|
|
3342
|
+
value.coworkerId.startsWith(`${parent.sessionId}::cw-`) && (value.notify === void 0 || typeof value.notify === "boolean") ? value : null;
|
|
3343
|
+
},
|
|
3344
|
+
"resume-coworker": (value) => {
|
|
3345
|
+
const parent = parseSessionIdentity(value.parent);
|
|
3346
|
+
return hasOnlyKeys(value, [
|
|
3347
|
+
"type",
|
|
3348
|
+
"parent",
|
|
3349
|
+
"coworkerId",
|
|
3350
|
+
"name",
|
|
3351
|
+
"agentType",
|
|
3352
|
+
"resumeFile"
|
|
3353
|
+
]) && parent && isNonEmptyString(value.coworkerId) && value.coworkerId.startsWith(`${parent.sessionId}::cw-`) && isNonEmptyString(value.name) && (value.agentType === void 0 || isNonEmptyString(value.agentType)) && isNonEmptyString(value.resumeFile) ? value : null;
|
|
3354
|
+
},
|
|
3355
|
+
"complete-text": (value) => {
|
|
3356
|
+
return hasOnlyKeys(value, [
|
|
3357
|
+
"type",
|
|
3358
|
+
"requestId",
|
|
3359
|
+
"systemPrompt",
|
|
3360
|
+
"userText",
|
|
3361
|
+
"candidates",
|
|
3362
|
+
"timeoutMs",
|
|
3363
|
+
"maxTokens",
|
|
3364
|
+
"stream",
|
|
3365
|
+
"reasoning",
|
|
3366
|
+
"probe"
|
|
3367
|
+
]) && isNonEmptyString(value.requestId) && typeof value.systemPrompt === "string" && typeof value.userText === "string" && typeof value.timeoutMs === "number" && Number.isFinite(value.timeoutMs) && value.timeoutMs > 0 && (value.maxTokens === void 0 || typeof value.maxTokens === "number" && Number.isInteger(value.maxTokens) && value.maxTokens > 0) && (value.stream === void 0 || value.stream === true) && (value.reasoning === void 0 || value.reasoning === "off" || THINKING_LEVELS.includes(value.reasoning)) && (value.probe === void 0 || value.probe === true) && Array.isArray(value.candidates) && value.candidates.length >= 1 && value.candidates.length <= TITLE_SUMMARY_MAX_CANDIDATES && value.candidates.every((candidate) => parseSpawnModelConfig(candidate)) ? value : null;
|
|
3368
|
+
},
|
|
3369
|
+
"abort-complete-text": (value) => {
|
|
3370
|
+
return hasExactKeys(value, ["type", "requestId"]) && isNonEmptyString(value.requestId) ? value : null;
|
|
3371
|
+
},
|
|
3372
|
+
"classify-choice": (value) => {
|
|
3373
|
+
return hasExactKeys(value, [
|
|
3374
|
+
"type",
|
|
3375
|
+
"requestId",
|
|
3376
|
+
"classifier",
|
|
3377
|
+
"state",
|
|
3378
|
+
"instructions",
|
|
3379
|
+
"criteria",
|
|
3380
|
+
"timeoutMs"
|
|
3381
|
+
]) && isNonEmptyString(value.requestId) && parseClassifierCredentials(value.classifier) && isRecord(value.state) && isNonEmptyString(value.instructions) && isRecord(value.criteria) && Object.keys(value.criteria).length > 0 && Object.values(value.criteria).every(isNonEmptyString) && typeof value.timeoutMs === "number" && Number.isFinite(value.timeoutMs) && value.timeoutMs > 0 ? value : null;
|
|
3382
|
+
},
|
|
3383
|
+
"abort-classify-choice": (value) => {
|
|
3384
|
+
return hasExactKeys(value, ["type", "requestId"]) && isNonEmptyString(value.requestId) ? value : null;
|
|
3385
|
+
},
|
|
3386
|
+
"summarize-title": (value) => {
|
|
3387
|
+
return hasExactKeys(value, ["type", "conversationId", "input", "candidates"]) && isNonEmptyString(value.conversationId) && parseTitleSummaryInput(value.input) && Array.isArray(value.candidates) && value.candidates.length >= 1 && value.candidates.length <= TITLE_SUMMARY_MAX_CANDIDATES && value.candidates.every((candidate) => parseSpawnModelConfig(candidate)) ? value : null;
|
|
3388
|
+
},
|
|
3389
|
+
prompt: parsePromptOrSteer,
|
|
3390
|
+
steer: parsePromptOrSteer,
|
|
3391
|
+
"set-model": (value) => {
|
|
3392
|
+
return hasExactKeys(value, ["type", "identity", "model"]) && parseAnySessionIdentity(value.identity) && parseSessionModelConfig(value.model) ? value : null;
|
|
3393
|
+
},
|
|
3394
|
+
"set-thinking": (value) => {
|
|
3395
|
+
return hasExactKeys(value, ["type", "identity", "level"]) && parseAnySessionIdentity(value.identity) && THINKING_LEVELS.includes(value.level) ? value : null;
|
|
3396
|
+
},
|
|
3397
|
+
"set-system-prompt": (value) => {
|
|
3398
|
+
return hasExactKeys(value, ["type", "identity", "systemPrompt"]) && parseSessionIdentity(value.identity) && isNonEmptyString(value.systemPrompt) ? value : null;
|
|
3399
|
+
},
|
|
3400
|
+
"set-reasoning": (value) => {
|
|
3401
|
+
return hasOnlyKeys(value, ["type", "identity", "enabled", "level"]) && parseAnySessionIdentity(value.identity) && typeof value.enabled === "boolean" && (value.level === void 0 || THINKING_LEVELS.includes(value.level)) ? value : null;
|
|
3402
|
+
},
|
|
3403
|
+
"approval-respond": (value) => {
|
|
3404
|
+
return hasExactKeys(value, ["type", "identity", "requestId", "decision"]) && parseAnySessionIdentity(value.identity) && isNonEmptyString(value.requestId) && isApprovalDecision(value.decision) ? value : null;
|
|
3405
|
+
},
|
|
3406
|
+
"request-timeout": (value) => {
|
|
3407
|
+
return hasExactKeys(value, ["type", "identity", "kind", "requestId"]) && parseAnySessionIdentity(value.identity) && (value.kind === "approval" || value.kind === "ask") && isNonEmptyString(value.requestId) ? value : null;
|
|
3408
|
+
},
|
|
3409
|
+
"agent-notify": (value) => {
|
|
3410
|
+
return hasExactKeys(value, ["type", "identity", "text", "urgent"]) && parseSessionIdentity(value.identity) && isNonEmptyString(value.text) && typeof value.urgent === "boolean" ? value : null;
|
|
3411
|
+
},
|
|
3412
|
+
"set-approval-mode": (value) => {
|
|
3413
|
+
return hasOnlyKeys(value, ["type", "identity", "mode", "autoReject"]) && parseAnySessionIdentity(value.identity) && APPROVAL_MODES.includes(value.mode) && (value.autoReject === void 0 || typeof value.autoReject === "boolean") ? value : null;
|
|
3414
|
+
},
|
|
3415
|
+
"set-ask-relay": (value) => {
|
|
3416
|
+
return hasOnlyKeys(value, ["type", "identity", "relay"]) && parseAnySessionIdentity(value.identity) && (value.relay === void 0 || isRecord(value.relay) && isNonEmptyString(value.relay.name)) ? value : null;
|
|
3417
|
+
},
|
|
3418
|
+
"set-plan-mode": (value) => {
|
|
3419
|
+
return hasExactKeys(value, ["type", "identity", "active"]) && parseSessionIdentity(value.identity) && typeof value.active === "boolean" ? value : null;
|
|
3420
|
+
},
|
|
3421
|
+
"plan-respond": (value) => {
|
|
3422
|
+
return hasOnlyKeys(value, ["type", "identity", "planId", "action", "feedback"]) && parseSessionIdentity(value.identity) && isNonEmptyString(value.planId) && PLAN_RESPOND_ACTIONS.includes(value.action) && (value.feedback === void 0 || typeof value.feedback === "string" && value.feedback.length <= PLAN_FEEDBACK_MAX) ? value : null;
|
|
3423
|
+
},
|
|
3424
|
+
"set-approval-reviewer": (value) => {
|
|
3425
|
+
return hasOnlyKeys(value, ["type", "model", "classifier", "managed", "allowThreshold"]) && (value.allowThreshold === void 0 || isApprovalAllowThreshold(value.allowThreshold) && value.classifier !== void 0) && (value.model === void 0 || parseSpawnModelConfig(value.model)) && (value.classifier === void 0 || value.model === void 0 && parseClassifierCredentials(value.classifier)) && (value.managed === void 0 || value.managed === true && value.classifier !== void 0) ? value : null;
|
|
3426
|
+
},
|
|
3427
|
+
"set-compact-route": (value) => {
|
|
3428
|
+
return hasOnlyKeys(value, ["type", "model", "mode"]) && (value.model === void 0 || parseSpawnModelConfig(value.model) !== null) && (value.mode === void 0 || parseSmartCompactMode(value.mode) !== null) ? value : null;
|
|
3429
|
+
},
|
|
3430
|
+
"set-max-active-coworkers": (value) => {
|
|
3431
|
+
return hasExactKeys(value, ["type", "limit"]) && parseMaxActiveCoworkers(value.limit) !== null ? value : null;
|
|
3432
|
+
},
|
|
3433
|
+
"set-auto-retry-limit": (value) => {
|
|
3434
|
+
return hasExactKeys(value, ["type", "limit"]) && parseAutoRetryLimit(value.limit) !== null ? value : null;
|
|
3435
|
+
},
|
|
3436
|
+
"set-long-cache-retention": (value) => {
|
|
3437
|
+
return hasExactKeys(value, ["type", "enabled"]) && typeof value.enabled === "boolean" ? value : null;
|
|
3438
|
+
},
|
|
3439
|
+
"set-shell-limits": (value) => {
|
|
3440
|
+
return hasExactKeys(value, ["type", "limits"]) && isRecord(value.limits) && JSON.stringify(resolveShellLimits(value.limits)) === JSON.stringify(value.limits) ? value : null;
|
|
3441
|
+
},
|
|
3442
|
+
"set-privacy-masking": (value) => {
|
|
3443
|
+
return hasExactKeys(value, ["type", "settings"]) && JSON.stringify(parsePrivacyMaskSettings(value.settings)) === JSON.stringify(value.settings) ? value : null;
|
|
3444
|
+
},
|
|
3445
|
+
"set-image-generation-config": (value) => {
|
|
3446
|
+
return hasOnlyKeys(value, ["type", "config", "error"]) && (value.config === null || parseImageGenerationConfig(value.config) !== null) && (value.error === void 0 || typeof value.error === "string" && value.error.length <= 1024) ? value : null;
|
|
3447
|
+
},
|
|
3448
|
+
"set-web-search-config": (value) => {
|
|
3449
|
+
return hasOnlyKeys(value, ["type", "chain", "configured"]) && (value.configured === void 0 || typeof value.configured === "boolean") && Array.isArray(value.chain) && value.chain.length <= WEB_SEARCH_CHAIN_MAX && value.chain.every(isWebSearchChainEntry) ? value : null;
|
|
3450
|
+
},
|
|
3451
|
+
"set-disabled-workflow-presets": (value) => {
|
|
3452
|
+
return hasExactKeys(value, ["type", "ids"]) && Array.isArray(value.ids) && value.ids.length <= 64 && value.ids.every((id) => typeof id === "string" && isWorkflowPresetId(id)) ? value : null;
|
|
3453
|
+
},
|
|
3454
|
+
"set-builtin-tools": (value) => {
|
|
3455
|
+
return hasExactKeys(value, ["type", "identity", "disabledTools"]) && parseSessionIdentity(value.identity) && Array.isArray(value.disabledTools) && value.disabledTools.length <= 64 && value.disabledTools.every((id) => typeof id === "string" && id.length > 0 && id.length <= 64) ? value : null;
|
|
3456
|
+
},
|
|
3457
|
+
"set-model-directory": (value) => {
|
|
3458
|
+
return hasExactKeys(value, ["type", "snapshot", "customProviders"]) ? value : null;
|
|
3459
|
+
},
|
|
3460
|
+
"ask-respond": (value) => {
|
|
3461
|
+
return hasOnlyKeys(value, ["type", "identity", "requestId", "answer", "by", "name"]) && parseAnySessionIdentity(value.identity) && isNonEmptyString(value.requestId) && isNonEmptyString(value.answer) && (value.by === void 0 || value.by === "user" || value.by === "relay") && (value.name === void 0 || isNonEmptyString(value.name)) ? value : null;
|
|
3462
|
+
},
|
|
3463
|
+
"browser-result": parseHostResultCommand,
|
|
3464
|
+
"memory-result": parseHostResultCommand,
|
|
3465
|
+
"delegation-result": parseHostResultCommand,
|
|
3466
|
+
"computer-result": parseHostResultCommand,
|
|
3467
|
+
"plugin-tool-result": parseHostResultCommand,
|
|
3468
|
+
"secretary-result": (value) => {
|
|
3469
|
+
if (!hasOnlyKeys(value, ["type", "identity", "requestId", "ok", "result", "error"]) || !parseSessionIdentity(value.identity) || !isNonEmptyString(value.requestId) || typeof value.ok !== "boolean") {
|
|
3512
3470
|
return null;
|
|
3513
|
-
}
|
|
3514
|
-
}
|
|
3515
|
-
function parseLifecycleEvent(value) {
|
|
3516
|
-
const identity = value.type === "child-reserved" || value.type === "child-ready" || value.type === "child-rejected" || value.type === "child-ended" ? parseChildSessionIdentity(value.identity) : parseSessionIdentity(value.identity);
|
|
3517
|
-
if (!identity || !isSequence(value.seq)) return null;
|
|
3518
|
-
switch (value.type) {
|
|
3519
|
-
case "parent-ready":
|
|
3520
|
-
return isNonEmptyString(value.sessionFile) && parseModelRef(value.model) ? value : null;
|
|
3521
|
-
case "model-changed":
|
|
3522
|
-
return parseModelRef(value.model) ? value : null;
|
|
3523
|
-
case "parent-rejected":
|
|
3524
|
-
case "parent-ended":
|
|
3525
|
-
return hasOnlyKeys(value, ["type", "identity", "seq", "reason", "instanceId"]) && isNonEmptyString(value.reason) && (value.instanceId === void 0 || isUuid(value.instanceId)) ? value : null;
|
|
3526
|
-
case "child-rejected":
|
|
3527
|
-
case "child-ended":
|
|
3528
|
-
return isNonEmptyString(value.reason) ? value : null;
|
|
3529
|
-
case "child-reserved":
|
|
3530
|
-
return isNonEmptyString(value.requestId) && parseChildConversationMetadata(value.metadata) ? value : null;
|
|
3531
|
-
case "child-ready": {
|
|
3532
|
-
const proof = parseResolvedChildProfileProof(value.proof);
|
|
3533
|
-
if (!hasExactKeys(value, ["type", "identity", "seq", "sessionFile", "proof"]) || !isNonEmptyString(value.sessionFile) || !proof || !("typeKey" in identity) || proof.typeKey !== identity.typeKey) {
|
|
3534
|
-
return null;
|
|
3535
|
-
}
|
|
3536
|
-
return value;
|
|
3537
3471
|
}
|
|
3538
|
-
|
|
3472
|
+
const shapeOk = value.ok ? value.error === void 0 : isNonEmptyString(value.error) && value.result === void 0;
|
|
3473
|
+
return shapeOk ? value : null;
|
|
3474
|
+
},
|
|
3475
|
+
"plugin-intercept-result": (value) => {
|
|
3476
|
+
if (!hasOnlyKeys(value, ["type", "identity", "requestId", "ok", "result", "error"]) || !parseSessionIdentity(value.identity) || !isNonEmptyString(value.requestId) || typeof value.ok !== "boolean") {
|
|
3539
3477
|
return null;
|
|
3478
|
+
}
|
|
3479
|
+
const shapeOk = value.ok ? value.error === void 0 : isNonEmptyString(value.error) && value.result === void 0;
|
|
3480
|
+
return shapeOk ? value : null;
|
|
3481
|
+
},
|
|
3482
|
+
"plugin-tool-progress": (value) => {
|
|
3483
|
+
return hasExactKeys(value, ["type", "identity", "requestId", "text"]) && parseSessionIdentity(value.identity) && isNonEmptyString(value.requestId) && isBoundedText(value.text, PLUGIN_PROGRESS_MAX_CHARS) ? value : null;
|
|
3484
|
+
},
|
|
3485
|
+
"plugin-inject": (value) => {
|
|
3486
|
+
return hasOnlyKeys(value, [...PLUGIN_INJECT_KEYS, "images"]) && PLUGIN_INJECT_KEYS.every((key) => key in value) && parsePluginInjectImages(value.images) !== null && parseSessionIdentity(value.identity) && isNonEmptyString(value.pluginId) && value.pluginId.length <= 128 && isNonEmptyString(value.pluginName) && value.pluginName.length <= 256 && isNonEmptyString(value.text) && isBoundedText(value.text, PLUGIN_INJECT_MAX_CHARS) && (value.deliverAs === "steer" || value.deliverAs === "followUp" || value.deliverAs === "nextTurn") && typeof value.triggerTurn === "boolean" ? value : null;
|
|
3487
|
+
},
|
|
3488
|
+
"workflow-stop": (value) => {
|
|
3489
|
+
return hasExactKeys(value, ["type", "identity", "runId"]) && parseAnySessionIdentity(value.identity) && isNonEmptyString(value.runId) && value.runId.length <= 80 ? value : null;
|
|
3490
|
+
},
|
|
3491
|
+
"task-stop": (value) => {
|
|
3492
|
+
return hasExactKeys(value, ["type", "sessionId", "taskId"]) && isNonEmptyString(value.sessionId) && isNonEmptyString(value.taskId) ? value : null;
|
|
3493
|
+
},
|
|
3494
|
+
"task-keep": (value) => {
|
|
3495
|
+
return hasExactKeys(value, ["type", "sessionId", "taskId", "reason"]) && isNonEmptyString(value.sessionId) && isNonEmptyString(value.taskId) && (value.reason === null || typeof value.reason === "string" && value.reason.length <= TASK_KEEP_REASON_MAX) ? value : null;
|
|
3496
|
+
},
|
|
3497
|
+
"tool-background": (value) => {
|
|
3498
|
+
return hasExactKeys(value, ["type", "identity", "toolCallId"]) && parseAnySessionIdentity(value.identity) && isNonEmptyString(value.toolCallId) && value.toolCallId.length <= 512 ? value : null;
|
|
3499
|
+
},
|
|
3500
|
+
"subagent-stop": (value) => {
|
|
3501
|
+
return hasExactKeys(value, ["type", "identity", "agentId"]) && parseAnySessionIdentity(value.identity) && isNonEmptyString(value.agentId) ? value : null;
|
|
3502
|
+
},
|
|
3503
|
+
compact: (value) => {
|
|
3504
|
+
return hasOnlyKeys(value, ["type", "identity", "instructions"]) && parseAnySessionIdentity(value.identity) && (value.instructions === void 0 || isNonEmptyString(value.instructions)) ? value : null;
|
|
3505
|
+
},
|
|
3506
|
+
rewind: (value) => {
|
|
3507
|
+
return hasOnlyKeys(value, [
|
|
3508
|
+
"type",
|
|
3509
|
+
"identity",
|
|
3510
|
+
"entryId",
|
|
3511
|
+
"userIndexFromEnd",
|
|
3512
|
+
"restoreFiles"
|
|
3513
|
+
]) && parseAnySessionIdentity(value.identity) && (value.entryId !== void 0 ? isNonEmptyString(value.entryId) && value.entryId.trim().length > 0 && value.userIndexFromEnd === void 0 : isSequence(value.userIndexFromEnd)) && (value.restoreFiles === void 0 || typeof value.restoreFiles === "boolean") ? value : null;
|
|
3514
|
+
},
|
|
3515
|
+
fork: (value) => {
|
|
3516
|
+
const hasEntry = typeof value.entryId === "string";
|
|
3517
|
+
const hasIndex = typeof value.userIndexFromEnd === "number";
|
|
3518
|
+
return hasOnlyKeys(value, [
|
|
3519
|
+
"type",
|
|
3520
|
+
"identity",
|
|
3521
|
+
"targetConversationId",
|
|
3522
|
+
"entryId",
|
|
3523
|
+
"userIndexFromEnd"
|
|
3524
|
+
]) && parseAnySessionIdentity(value.identity) && isUuid(value.targetConversationId) && (hasEntry ? !hasIndex && isNonEmptyString(value.entryId) : hasIndex && isSequence(value.userIndexFromEnd)) ? value : null;
|
|
3525
|
+
},
|
|
3526
|
+
abort: parseIdentityOnlyCommand,
|
|
3527
|
+
"abort-retry": parseIdentityOnlyCommand,
|
|
3528
|
+
"release-parent": parseIdentityOnlyCommand,
|
|
3529
|
+
"withdraw-steer": (value) => {
|
|
3530
|
+
return hasExactKeys(value, ["type", "identity", "deliveryId"]) && parseAnySessionIdentity(value.identity) && isDeliveryId(value.deliveryId) ? value : null;
|
|
3531
|
+
},
|
|
3532
|
+
retry: (value) => {
|
|
3533
|
+
return hasOnlyKeys(value, [
|
|
3534
|
+
"type",
|
|
3535
|
+
"identity",
|
|
3536
|
+
"instanceId",
|
|
3537
|
+
"unfinishedOnly",
|
|
3538
|
+
"turnId",
|
|
3539
|
+
"requestBudget",
|
|
3540
|
+
"requestsUsed"
|
|
3541
|
+
]) && parseAnySessionIdentity(value.identity) && (value.unfinishedOnly === void 0 || value.unfinishedOnly === true) && (value.turnId === void 0 || isNonEmptyString(value.turnId)) && (value.requestBudget === void 0 || value.requestBudget === true) && (value.requestsUsed === void 0 || Number.isInteger(value.requestsUsed) && value.requestsUsed >= 0) && (value.instanceId === void 0 || isUuid(value.instanceId) && parseSessionIdentity(value.identity) !== null) ? value : null;
|
|
3542
|
+
},
|
|
3543
|
+
"append-session-custom-entry": (value) => {
|
|
3544
|
+
return hasExactKeys(value, ["type", "identity", "entry"]) && parseAnySessionIdentity(value.identity) && parseAgentSessionCustomEntry(value.entry) ? value : null;
|
|
3545
|
+
},
|
|
3546
|
+
"reload-session": (value) => {
|
|
3547
|
+
return hasExactKeys(value, ["type", "requestId", "sessionId"]) && isNonEmptyString(value.requestId) && isNonEmptyString(value.sessionId) ? value : null;
|
|
3548
|
+
},
|
|
3549
|
+
snapshot: (value) => {
|
|
3550
|
+
if (hasExactKeys(value, ["type"])) return { type: "snapshot" };
|
|
3551
|
+
return hasExactKeys(value, ["type", "sessionId"]) && isNonEmptyString(value.sessionId) ? { type: "snapshot", sessionId: value.sessionId } : null;
|
|
3552
|
+
},
|
|
3553
|
+
"pin-sessions": (value) => {
|
|
3554
|
+
return hasExactKeys(value, ["type", "sessionIds"]) && Array.isArray(value.sessionIds) && value.sessionIds.every((id) => typeof id === "string") ? { type: "pin-sessions", sessionIds: value.sessionIds } : null;
|
|
3555
|
+
},
|
|
3556
|
+
"graceful-restart": (value) => {
|
|
3557
|
+
if (hasExactKeys(value, ["type"])) return { type: "graceful-restart" };
|
|
3558
|
+
return hasExactKeys(value, ["type", "keepBackgroundTasks"]) && value.keepBackgroundTasks === true ? { type: "graceful-restart", keepBackgroundTasks: true } : null;
|
|
3559
|
+
},
|
|
3560
|
+
"detach-background-tasks": (value) => {
|
|
3561
|
+
return hasExactKeys(value, ["type"]) ? { type: "detach-background-tasks" } : null;
|
|
3562
|
+
},
|
|
3563
|
+
"warm-mcp": (value) => {
|
|
3564
|
+
return hasExactKeys(value, ["type", "servers"]) && Array.isArray(value.servers) ? value : null;
|
|
3565
|
+
},
|
|
3566
|
+
"plugin-mcp-list": (value) => {
|
|
3567
|
+
return hasExactKeys(value, ["type", "requestId", "servers"]) && isNonEmptyString(value.requestId) && Array.isArray(value.servers) ? value : null;
|
|
3568
|
+
},
|
|
3569
|
+
"plugin-mcp-call": (value) => {
|
|
3570
|
+
return hasExactKeys(value, ["type", "requestId", "servers", "server", "tool", "args"]) && isNonEmptyString(value.requestId) && Array.isArray(value.servers) && isNonEmptyString(value.server) && isNonEmptyString(value.tool) && isRecord(value.args) ? value : null;
|
|
3571
|
+
},
|
|
3572
|
+
"plugin-mcp-cancel": (value) => {
|
|
3573
|
+
return hasExactKeys(value, ["type", "requestId"]) && isNonEmptyString(value.requestId) ? { type: "plugin-mcp-cancel", requestId: value.requestId } : null;
|
|
3574
|
+
},
|
|
3575
|
+
"plugin-agent-run": (value) => {
|
|
3576
|
+
return hasOnlyKeys(value, [
|
|
3577
|
+
"type",
|
|
3578
|
+
"requestId",
|
|
3579
|
+
"identity",
|
|
3580
|
+
"prompt",
|
|
3581
|
+
"systemPrompt",
|
|
3582
|
+
"context",
|
|
3583
|
+
"timeoutMs",
|
|
3584
|
+
"model"
|
|
3585
|
+
]) && isNonEmptyString(value.requestId) && parseSessionIdentity(value.identity) && isNonEmptyString(value.prompt) && isBoundedText(value.prompt, PLUGIN_AGENT_PROMPT_MAX_CHARS) && (value.systemPrompt === void 0 || typeof value.systemPrompt === "string" && isBoundedText(value.systemPrompt, PLUGIN_AGENT_SYSTEM_MAX_CHARS)) && (value.context === "conversation" || value.context === "fork" || value.context === "none") && Number.isInteger(value.timeoutMs) && value.timeoutMs > 0 && value.timeoutMs <= PLUGIN_AGENT_MAX_TIMEOUT_MS && (value.model === void 0 || parseSpawnModelConfig(value.model) !== null) ? value : null;
|
|
3586
|
+
},
|
|
3587
|
+
"plugin-agent-cancel": (value) => {
|
|
3588
|
+
return hasExactKeys(value, ["type", "requestId"]) && isNonEmptyString(value.requestId) ? { type: "plugin-agent-cancel", requestId: value.requestId } : null;
|
|
3589
|
+
},
|
|
3590
|
+
"set-proxy-env": (value) => {
|
|
3591
|
+
if (!hasExactKeys(value, ["type", "env"]) || !isRecord(value.env)) return null;
|
|
3592
|
+
for (const entry of Object.values(value.env)) {
|
|
3593
|
+
if (entry !== null && typeof entry !== "string") return null;
|
|
3594
|
+
}
|
|
3595
|
+
return value;
|
|
3540
3596
|
}
|
|
3597
|
+
};
|
|
3598
|
+
function parseAgentCommand(value) {
|
|
3599
|
+
if (!isRecord(value) || !isNonEmptyString(value.type)) return null;
|
|
3600
|
+
return parseClosed(agentCommandParsers, value.type, value);
|
|
3541
3601
|
}
|
|
3542
3602
|
const isOptionalTimestamp = (value) => value === void 0 || typeof value === "number" && Number.isFinite(value);
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3603
|
+
const DEFERRED_SESSION_KEYS = /* @__PURE__ */ new Set([
|
|
3604
|
+
"identity",
|
|
3605
|
+
"reason",
|
|
3606
|
+
"toolsInFlight",
|
|
3607
|
+
"toolNames",
|
|
3608
|
+
"undetachableTasks",
|
|
3609
|
+
"reply"
|
|
3610
|
+
]);
|
|
3611
|
+
function isRestartReplyProgress(value) {
|
|
3612
|
+
return isRecord(value) && Object.keys(value).every(
|
|
3613
|
+
(key) => key === "requestStartMs" || key === "firstTokenMs" || key === "lastOutputMs"
|
|
3614
|
+
) && isNonNegativeNumber(value.requestStartMs) && (value.firstTokenMs === void 0 || isNonNegativeNumber(value.firstTokenMs)) && (value.lastOutputMs === void 0 || isNonNegativeNumber(value.lastOutputMs));
|
|
3615
|
+
}
|
|
3616
|
+
const parseWorkspaceLockResult = (value) => {
|
|
3617
|
+
return hasOnlyKeys(value, ["type", "requestId", "ok", "error"]) && isNonEmptyString(value.requestId) && (value.ok === true ? value.error === void 0 : value.ok === false && isNonEmptyString(value.error)) ? value : null;
|
|
3618
|
+
};
|
|
3619
|
+
const parseParentLifecycleEnd = requireEventIdentity(
|
|
3620
|
+
"parent",
|
|
3621
|
+
(value) => {
|
|
3622
|
+
return hasOnlyKeys(value, ["type", "identity", "seq", "reason", "instanceId"]) && isNonEmptyString(value.reason) && (value.instanceId === void 0 || isUuid(value.instanceId)) ? value : null;
|
|
3623
|
+
}
|
|
3624
|
+
);
|
|
3625
|
+
const parseChildLifecycleEnd = requireEventIdentity(
|
|
3626
|
+
"child",
|
|
3627
|
+
(value) => {
|
|
3628
|
+
return isNonEmptyString(value.reason) ? value : null;
|
|
3629
|
+
}
|
|
3630
|
+
);
|
|
3631
|
+
const parseDeliveryOutcome = requireEventIdentity(
|
|
3632
|
+
"any",
|
|
3633
|
+
(value) => {
|
|
3634
|
+
return hasExactKeys(value, ["type", "identity", "seq", "deliveryId"]) && isDeliveryId(value.deliveryId) ? value : null;
|
|
3635
|
+
}
|
|
3636
|
+
);
|
|
3637
|
+
const parseTaskEvent = requireEventIdentity(
|
|
3638
|
+
"any",
|
|
3639
|
+
(value) => {
|
|
3640
|
+
return isNonEmptyString(value.taskId) ? value : null;
|
|
3641
|
+
}
|
|
3642
|
+
);
|
|
3643
|
+
const agentWorkerEventParsers = {
|
|
3644
|
+
"privacy-mask-ledger": (value) => {
|
|
3546
3645
|
const record2 = parsePrivacyMaskRecord(value.record);
|
|
3547
3646
|
return hasExactKeys(value, ["type", "record"]) && record2 ? { type: "privacy-mask-ledger", record: record2 } : null;
|
|
3548
|
-
}
|
|
3549
|
-
|
|
3647
|
+
},
|
|
3648
|
+
"oauth-pool-select": (value) => {
|
|
3550
3649
|
return hasOnlyKeys(value, [
|
|
3551
3650
|
"type",
|
|
3552
3651
|
"requestId",
|
|
@@ -3555,36 +3654,32 @@ function parseAgentWorkerEvent(value) {
|
|
|
3555
3654
|
"failed",
|
|
3556
3655
|
"excludedAccountKeys"
|
|
3557
3656
|
]) && isNonEmptyString(value.requestId) && isNonEmptyString(value.settingsProviderId) && isNonEmptyString(value.modelId) && (value.excludedAccountKeys === void 0 || Array.isArray(value.excludedAccountKeys) && value.excludedAccountKeys.length <= 100 && value.excludedAccountKeys.every(isCodexAccountKey)) && (value.failed === void 0 || parseOauthPoolFailure(value.failed) !== null) ? value : null;
|
|
3558
|
-
}
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
if (value.type === "workspace-lock-result" || value.type === "workspace-unlock-result") {
|
|
3563
|
-
return hasOnlyKeys(value, ["type", "requestId", "ok", "error"]) && isNonEmptyString(value.requestId) && (value.ok === true ? value.error === void 0 : value.ok === false && isNonEmptyString(value.error)) ? value : null;
|
|
3564
|
-
}
|
|
3565
|
-
if (value.type === "plugin-mcp-result") {
|
|
3657
|
+
},
|
|
3658
|
+
"workspace-lock-result": parseWorkspaceLockResult,
|
|
3659
|
+
"workspace-unlock-result": parseWorkspaceLockResult,
|
|
3660
|
+
"plugin-mcp-result": (value) => {
|
|
3566
3661
|
if (!isNonEmptyString(value.requestId)) return null;
|
|
3567
3662
|
if (value.ok === true)
|
|
3568
3663
|
return hasExactKeys(value, ["type", "requestId", "ok", "value"]) ? value : null;
|
|
3569
3664
|
return value.ok === false && hasExactKeys(value, ["type", "requestId", "ok", "error"]) && isNonEmptyString(value.error) ? value : null;
|
|
3570
|
-
}
|
|
3571
|
-
|
|
3665
|
+
},
|
|
3666
|
+
"plugin-agent-event": (value) => {
|
|
3572
3667
|
if (!hasExactKeys(value, ["type", "requestId", "event"]) || !isNonEmptyString(value.requestId))
|
|
3573
3668
|
return null;
|
|
3574
3669
|
const event = parsePluginAgentRunEvent(value.event);
|
|
3575
3670
|
return event ? { type: "plugin-agent-event", requestId: value.requestId, event } : null;
|
|
3576
|
-
}
|
|
3577
|
-
|
|
3671
|
+
},
|
|
3672
|
+
"session-reloaded": (value) => {
|
|
3578
3673
|
if (!hasExactKeys(value, ["type", "requestId", "result"]) || !isNonEmptyString(value.requestId) || !isRecord(value.result))
|
|
3579
3674
|
return null;
|
|
3580
3675
|
const result = value.result;
|
|
3581
3676
|
const valid = result.ok === true ? hasExactKeys(result, ["ok", "snapshot", "seq"]) && parseSessionSnapshot(result.snapshot) !== null && isSequence(result.seq) : result.ok === false && hasExactKeys(result, ["ok", "error"]) && isNonEmptyString(result.error);
|
|
3582
3677
|
return valid ? value : null;
|
|
3583
|
-
}
|
|
3584
|
-
|
|
3678
|
+
},
|
|
3679
|
+
snapshot: (value) => {
|
|
3585
3680
|
return Array.isArray(value.sessions) && value.sessions.every((session) => parseSessionSnapshot(session) !== null) ? value : null;
|
|
3586
|
-
}
|
|
3587
|
-
|
|
3681
|
+
},
|
|
3682
|
+
"mcp-status": (value) => {
|
|
3588
3683
|
return hasOnlyKeys(value, [
|
|
3589
3684
|
"type",
|
|
3590
3685
|
"serverId",
|
|
@@ -3594,58 +3689,146 @@ function parseAgentWorkerEvent(value) {
|
|
|
3594
3689
|
"error",
|
|
3595
3690
|
"scopeChallenge"
|
|
3596
3691
|
]) && (value.scopeChallenge === void 0 || isMcpScopeChallenge(value.scopeChallenge)) && isNonEmptyString(value.serverName) && (value.serverId === void 0 || isNonEmptyString(value.serverId)) && (value.toolCount === void 0 || isSequence(value.toolCount)) && (value.error === void 0 || typeof value.error === "string") && MCP_CONNECTION_STATES.includes(value.state) ? value : null;
|
|
3597
|
-
}
|
|
3598
|
-
|
|
3692
|
+
},
|
|
3693
|
+
"mcp-oauth-refresh": (value) => {
|
|
3599
3694
|
return hasOnlyKeys(value, ["type", "requestId", "serverId", "rejected"]) && isNonEmptyString(value.requestId) && isNonEmptyString(value.serverId) && (value.rejected === void 0 || isNonEmptyString(value.rejected)) ? value : null;
|
|
3600
|
-
}
|
|
3601
|
-
|
|
3695
|
+
},
|
|
3696
|
+
"title-generated": (value) => {
|
|
3602
3697
|
return hasExactKeys(value, ["type", "conversationId", "title"]) && isNonEmptyString(value.conversationId) && isNonEmptyString(value.title) ? value : null;
|
|
3603
|
-
}
|
|
3604
|
-
|
|
3698
|
+
},
|
|
3699
|
+
"title-failed": (value) => {
|
|
3605
3700
|
return hasExactKeys(value, ["type", "conversationId", "error"]) && isNonEmptyString(value.conversationId) && isNonEmptyString(value.error) ? value : null;
|
|
3606
|
-
}
|
|
3607
|
-
|
|
3701
|
+
},
|
|
3702
|
+
"tool-batch-completed": (value) => {
|
|
3608
3703
|
return hasExactKeys(value, ["type", "identity", "digest"]) && parseSessionIdentity(value.identity) && parseToolBatchDigest(value.digest) ? value : null;
|
|
3609
|
-
}
|
|
3610
|
-
|
|
3704
|
+
},
|
|
3705
|
+
"graceful-restart-deferred": (value) => {
|
|
3706
|
+
return hasExactKeys(value, ["type", "sessions"]) && Array.isArray(value.sessions) && value.sessions.every(
|
|
3707
|
+
(entry) => isRecord(entry) && Object.keys(entry).every((key) => DEFERRED_SESSION_KEYS.has(key)) && (entry.undetachableTasks === void 0 || Array.isArray(entry.undetachableTasks) && entry.undetachableTasks.every(isNonEmptyString)) && (entry.toolNames === void 0 || Array.isArray(entry.toolNames) && entry.toolNames.every(isNonEmptyString)) && (entry.reply === void 0 || isRestartReplyProgress(entry.reply)) && parseSessionIdentity(entry.identity) && (entry.reason === "tool-in-flight" || entry.reason === "turn-in-progress" || entry.reason === "session-starting") && Array.isArray(entry.toolsInFlight) && entry.toolsInFlight.every(isNonEmptyString)
|
|
3708
|
+
) ? value : null;
|
|
3709
|
+
},
|
|
3710
|
+
// 断点内容由 Main 用 parseRestartCheckpoint 细验(该函数带 node:fs,渲染层不能引)
|
|
3711
|
+
"graceful-restart-ready": (value) => {
|
|
3712
|
+
return hasExactKeys(value, ["type", "checkpoint"]) && isRecord(value.checkpoint) && Array.isArray(value.checkpoint.sessions) ? value : null;
|
|
3713
|
+
},
|
|
3714
|
+
"background-tasks-detached": (value) => {
|
|
3715
|
+
return hasExactKeys(value, ["type", "detached"]) && typeof value.detached === "number" && Number.isInteger(value.detached) && value.detached >= 0 ? value : null;
|
|
3716
|
+
},
|
|
3717
|
+
"session-wake-requested": (value) => {
|
|
3718
|
+
return hasExactKeys(value, ["type", "sessionId"]) && isNonEmptyString(value.sessionId) ? value : null;
|
|
3719
|
+
},
|
|
3720
|
+
"unopened-background-tasks": (value) => {
|
|
3721
|
+
return hasExactKeys(value, ["type", "sessionId", "tasks"]) && isNonEmptyString(value.sessionId) && Array.isArray(value.tasks) && value.tasks.every((task) => isRecord(task) && isNonEmptyString(task.taskId)) ? value : null;
|
|
3722
|
+
},
|
|
3723
|
+
"text-delta": (value) => {
|
|
3611
3724
|
return hasOnlyKeys(value, ["type", "requestId", "text", "thinking"]) && isNonEmptyString(value.requestId) && typeof value.text === "string" && (value.thinking === void 0 || typeof value.thinking === "string") ? value : null;
|
|
3612
|
-
}
|
|
3613
|
-
|
|
3725
|
+
},
|
|
3726
|
+
"text-completed": (value) => {
|
|
3614
3727
|
return hasExactKeys(value, ["type", "requestId", "text"]) && isNonEmptyString(value.requestId) && typeof value.text === "string" ? value : null;
|
|
3615
|
-
}
|
|
3616
|
-
|
|
3728
|
+
},
|
|
3729
|
+
"text-failed": (value) => {
|
|
3617
3730
|
return hasExactKeys(value, ["type", "requestId", "error"]) && isNonEmptyString(value.requestId) && isNonEmptyString(value.error) ? value : null;
|
|
3618
|
-
}
|
|
3619
|
-
|
|
3731
|
+
},
|
|
3732
|
+
"choice-classified": (value) => {
|
|
3620
3733
|
return hasExactKeys(value, ["type", "requestId", "probabilities"]) && isNonEmptyString(value.requestId) && isRecord(value.probabilities) && Object.values(value.probabilities).every((p) => typeof p === "number" && Number.isFinite(p)) ? value : null;
|
|
3621
|
-
}
|
|
3622
|
-
|
|
3734
|
+
},
|
|
3735
|
+
"choice-failed": (value) => {
|
|
3623
3736
|
return hasExactKeys(value, ["type", "requestId", "error"]) && isNonEmptyString(value.requestId) && isNonEmptyString(value.error) ? value : null;
|
|
3624
|
-
}
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3737
|
+
},
|
|
3738
|
+
"parent-ready": requireEventIdentity(
|
|
3739
|
+
"parent",
|
|
3740
|
+
(value) => {
|
|
3741
|
+
return isNonEmptyString(value.sessionFile) && parseModelRef(value.model) && (value.imageInput === void 0 || typeof value.imageInput === "boolean") ? value : null;
|
|
3742
|
+
}
|
|
3743
|
+
),
|
|
3744
|
+
"model-changed": requireEventIdentity(
|
|
3745
|
+
"parent",
|
|
3746
|
+
(value) => {
|
|
3747
|
+
return parseModelRef(value.model) && (value.imageInput === void 0 || typeof value.imageInput === "boolean") ? value : null;
|
|
3748
|
+
}
|
|
3749
|
+
),
|
|
3750
|
+
"parent-rejected": parseParentLifecycleEnd,
|
|
3751
|
+
"parent-ended": parseParentLifecycleEnd,
|
|
3752
|
+
"child-rejected": parseChildLifecycleEnd,
|
|
3753
|
+
"child-ended": parseChildLifecycleEnd,
|
|
3754
|
+
"child-reserved": requireEventIdentity(
|
|
3755
|
+
"child",
|
|
3756
|
+
(value) => {
|
|
3757
|
+
return isNonEmptyString(value.requestId) && parseChildConversationMetadata(value.metadata) ? value : null;
|
|
3758
|
+
}
|
|
3759
|
+
),
|
|
3760
|
+
"child-ready": requireEventIdentity(
|
|
3761
|
+
"child",
|
|
3762
|
+
(value) => {
|
|
3763
|
+
const proof = parseResolvedChildProfileProof(value.proof);
|
|
3764
|
+
const identity = parseChildSessionIdentity(value.identity);
|
|
3765
|
+
if (!identity) return null;
|
|
3766
|
+
if (!hasExactKeys(value, ["type", "identity", "seq", "sessionFile", "proof"]) || !isNonEmptyString(value.sessionFile) || !proof || !("typeKey" in identity) || proof.typeKey !== identity.typeKey) {
|
|
3767
|
+
return null;
|
|
3768
|
+
}
|
|
3769
|
+
return value;
|
|
3770
|
+
}
|
|
3771
|
+
),
|
|
3772
|
+
"request-body": requireEventIdentity(
|
|
3773
|
+
"any",
|
|
3774
|
+
(value) => {
|
|
3775
|
+
const identity = parseAnySessionIdentity(value.identity);
|
|
3776
|
+
if (!identity || !isSequence(value.seq)) return null;
|
|
3629
3777
|
const usage = parseRequestBodyUsage(value.usage);
|
|
3630
3778
|
return hasExactKeys(value, ["type", "identity", "seq", "usage"]) && usage ? { type: "request-body", identity, seq: value.seq, usage } : null;
|
|
3631
3779
|
}
|
|
3632
|
-
|
|
3780
|
+
),
|
|
3781
|
+
"agent-control-invoke": requireEventIdentity(
|
|
3782
|
+
"any",
|
|
3783
|
+
(value) => {
|
|
3633
3784
|
return hasExactKeys(value, ["type", "identity", "seq", "requestId", "request"]) && isNonEmptyString(value.requestId) && parseAgentControlToolRequest(value.request) ? value : null;
|
|
3634
|
-
|
|
3785
|
+
}
|
|
3786
|
+
),
|
|
3787
|
+
"agent-control-cancel": requireEventIdentity(
|
|
3788
|
+
"any",
|
|
3789
|
+
(value) => {
|
|
3635
3790
|
return hasExactKeys(value, ["type", "identity", "seq", "requestId", "kind"]) && isNonEmptyString(value.requestId) && (value.kind === "abort" || value.kind === "detach") ? value : null;
|
|
3636
|
-
|
|
3791
|
+
}
|
|
3792
|
+
),
|
|
3793
|
+
"browser-invoke": requireEventIdentity(
|
|
3794
|
+
"any",
|
|
3795
|
+
(value) => {
|
|
3637
3796
|
return hasExactKeys(value, ["type", "identity", "seq", "requestId", "op", "params"]) && isNonEmptyString(value.requestId) && BROWSER_OPS.includes(value.op) ? value : null;
|
|
3638
|
-
|
|
3797
|
+
}
|
|
3798
|
+
),
|
|
3799
|
+
"memory-invoke": requireEventIdentity(
|
|
3800
|
+
"any",
|
|
3801
|
+
(value) => {
|
|
3639
3802
|
return hasExactKeys(value, ["type", "identity", "seq", "requestId", "op", "params"]) && isNonEmptyString(value.requestId) && MEMORY_OPS.includes(value.op) ? value : null;
|
|
3640
|
-
|
|
3803
|
+
}
|
|
3804
|
+
),
|
|
3805
|
+
"delegation-invoke": requireEventIdentity(
|
|
3806
|
+
"any",
|
|
3807
|
+
(value) => {
|
|
3641
3808
|
return hasExactKeys(value, ["type", "identity", "seq", "requestId", "op", "params"]) && parseSessionIdentity(value.identity) && isNonEmptyString(value.requestId) && (value.op === "delegate" || value.op === "check_delegation" || value.op === "retry_delegation" || value.op === "group_tasks" || value.op === "group_history" || value.op === "routine_propose" || value.op === "send_image" || value.op === "report_blocked") ? value : null;
|
|
3642
|
-
|
|
3809
|
+
}
|
|
3810
|
+
),
|
|
3811
|
+
"secretary-invoke": requireEventIdentity(
|
|
3812
|
+
"any",
|
|
3813
|
+
(value) => {
|
|
3643
3814
|
return hasExactKeys(value, ["type", "identity", "seq", "requestId", "op", "params"]) && parseSessionIdentity(value.identity) && isNonEmptyString(value.requestId) && (SECRETARY_OPS.includes(value.op) || SECRETARY_INTERNAL_OPS.includes(value.op)) ? value : null;
|
|
3644
|
-
|
|
3815
|
+
}
|
|
3816
|
+
),
|
|
3817
|
+
"computer-invoke": requireEventIdentity(
|
|
3818
|
+
"any",
|
|
3819
|
+
(value) => {
|
|
3645
3820
|
return hasExactKeys(value, ["type", "identity", "seq", "requestId", "op", "params"]) && isNonEmptyString(value.requestId) && COMPUTER_OPS.includes(value.op) ? value : null;
|
|
3646
|
-
|
|
3821
|
+
}
|
|
3822
|
+
),
|
|
3823
|
+
"computer-cancel": requireEventIdentity(
|
|
3824
|
+
"any",
|
|
3825
|
+
(value) => {
|
|
3647
3826
|
return hasExactKeys(value, ["type", "identity", "seq", "requestId"]) && isNonEmptyString(value.requestId) ? value : null;
|
|
3648
|
-
|
|
3827
|
+
}
|
|
3828
|
+
),
|
|
3829
|
+
"plugin-tool-invoke": requireEventIdentity(
|
|
3830
|
+
"any",
|
|
3831
|
+
(value) => {
|
|
3649
3832
|
return hasPluginAgentKeys(value, [
|
|
3650
3833
|
"type",
|
|
3651
3834
|
"identity",
|
|
@@ -3654,12 +3837,24 @@ function parseAgentWorkerEvent(value) {
|
|
|
3654
3837
|
"toolName",
|
|
3655
3838
|
"args"
|
|
3656
3839
|
]) && isNonEmptyString(value.requestId) && typeof value.toolName === "string" && parsePluginToolName(value.toolName) !== null ? value : null;
|
|
3657
|
-
|
|
3840
|
+
}
|
|
3841
|
+
),
|
|
3842
|
+
"plugin-tool-cancel": requireEventIdentity(
|
|
3843
|
+
"any",
|
|
3844
|
+
(value) => {
|
|
3658
3845
|
return hasExactKeys(value, ["type", "identity", "seq", "requestId"]) && isNonEmptyString(value.requestId) ? value : null;
|
|
3659
|
-
|
|
3846
|
+
}
|
|
3847
|
+
),
|
|
3848
|
+
"plugin-event": requireEventIdentity(
|
|
3849
|
+
"any",
|
|
3850
|
+
(value) => {
|
|
3660
3851
|
return hasPluginAgentKeys(value, ["type", "identity", "seq", "event", "data"]) && parseSessionIdentity(value.identity) && typeof value.event === "string" && PLUGIN_EVENTS.includes(value.event) && // 主会话的 before_compact 要等插件,走 plugin-intercept;只有子会话的只通知
|
|
3661
3852
|
(value.event === "before_compact" ? value.agent !== void 0 && isPluginInterceptPayload(value.event, value.data) : isPluginObserveData(value.event, value.data)) ? value : null;
|
|
3662
|
-
|
|
3853
|
+
}
|
|
3854
|
+
),
|
|
3855
|
+
"plugin-intercept": requireEventIdentity(
|
|
3856
|
+
"any",
|
|
3857
|
+
(value) => {
|
|
3663
3858
|
return hasPluginAgentKeys(value, [
|
|
3664
3859
|
"type",
|
|
3665
3860
|
"identity",
|
|
@@ -3668,37 +3863,87 @@ function parseAgentWorkerEvent(value) {
|
|
|
3668
3863
|
"event",
|
|
3669
3864
|
"payload"
|
|
3670
3865
|
]) && parseSessionIdentity(value.identity) && isNonEmptyString(value.requestId) && (value.event === "before_compact" || typeof value.event === "string" && isInterceptEvent(value.event)) && typeof value.event === "string" && (value.agent === void 0 || isChildInterceptEvent(value.event)) && isPluginInterceptPayload(value.event, value.payload) ? value : null;
|
|
3671
|
-
|
|
3866
|
+
}
|
|
3867
|
+
),
|
|
3868
|
+
"workspace-branch-context-consumed": requireEventIdentity(
|
|
3869
|
+
"any",
|
|
3870
|
+
(value) => {
|
|
3672
3871
|
return hasExactKeys(value, ["type", "identity", "seq", "requestId"]) && isNonEmptyString(value.requestId) ? value : null;
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3872
|
+
}
|
|
3873
|
+
),
|
|
3874
|
+
"delivery-settled": parseDeliveryOutcome,
|
|
3875
|
+
"delivery-rejected": (value) => {
|
|
3876
|
+
const { reason, ...rest } = value;
|
|
3877
|
+
return (reason === void 0 || reason === "turn-stuck") && parseDeliveryOutcome(rest) ? value : null;
|
|
3878
|
+
},
|
|
3879
|
+
"delivery-deferred": parseDeliveryOutcome,
|
|
3880
|
+
status: requireEventIdentity("any", (value) => {
|
|
3881
|
+
return (value.status === "idle" || value.status === "running" || value.status === "failed") && (value.turnId === void 0 || isNonEmptyString(value.turnId)) ? value : null;
|
|
3882
|
+
}),
|
|
3883
|
+
"message-upsert": requireEventIdentity(
|
|
3884
|
+
"any",
|
|
3885
|
+
(value) => {
|
|
3680
3886
|
return isSequence(value.index) && isRecord(value.message) && hasValidProjectedMetadata(value.message) ? value : null;
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3887
|
+
}
|
|
3888
|
+
),
|
|
3889
|
+
"turn-completed": requireEventIdentity(
|
|
3890
|
+
"any",
|
|
3891
|
+
(value) => {
|
|
3892
|
+
return isNonEmptyString(value.turnId) && (value.digest === void 0 || parseTurnDigest(value.digest)) && (value.report === void 0 || parseTurnReport(value.report)) && (value.aborted === void 0 || value.aborted === true) && (value.silent === void 0 || value.silent === true) && (value.requestBudgetStop === void 0 || value.requestBudgetStop === true) && (value.requestBudgetError === void 0 || value.requestBudgetStop === true && isNonEmptyString(value.requestBudgetError)) && (value.continues === void 0 || isNonEmptyString(value.continues)) && (value.awaitingTasks === void 0 || value.awaitingTasks === true) ? value : null;
|
|
3893
|
+
}
|
|
3894
|
+
),
|
|
3895
|
+
"turn-failed": requireEventIdentity(
|
|
3896
|
+
"any",
|
|
3897
|
+
(value) => {
|
|
3898
|
+
return isNonEmptyString(value.turnId) && isNonEmptyString(value.error) && (value.retryExhausted === void 0 || value.retryExhausted === true) && (value.aborted === void 0 || value.aborted === true) && (value.continues === void 0 || isNonEmptyString(value.continues)) ? value : null;
|
|
3899
|
+
}
|
|
3900
|
+
),
|
|
3901
|
+
"turn-retry": requireEventIdentity(
|
|
3902
|
+
"any",
|
|
3903
|
+
(value) => {
|
|
3686
3904
|
return Number.isInteger(value.attempt) && value.attempt >= 1 && Number.isInteger(value.maxAttempts) && value.maxAttempts >= 0 && isSequence(value.delayMs) && isNonEmptyString(value.error) ? value : null;
|
|
3687
|
-
|
|
3905
|
+
}
|
|
3906
|
+
),
|
|
3907
|
+
"retry-skipped": requireEventIdentity(
|
|
3908
|
+
"any",
|
|
3909
|
+
(value) => {
|
|
3688
3910
|
return hasExactKeys(value, ["type", "identity", "seq", "reason"]) && RETRY_SKIPPED_REASONS.includes(value.reason) ? value : null;
|
|
3689
|
-
|
|
3911
|
+
}
|
|
3912
|
+
),
|
|
3913
|
+
"messages-truncated": requireEventIdentity(
|
|
3914
|
+
"any",
|
|
3915
|
+
(value) => {
|
|
3690
3916
|
return isSequence(value.length) ? value : null;
|
|
3691
|
-
|
|
3917
|
+
}
|
|
3918
|
+
),
|
|
3919
|
+
"rewind-done": requireEventIdentity(
|
|
3920
|
+
"any",
|
|
3921
|
+
(value) => {
|
|
3692
3922
|
const editorImages = value.editorImages === void 0 ? void 0 : parseAttachedImages(value.editorImages);
|
|
3693
3923
|
return (value.editorText === void 0 || typeof value.editorText === "string") && editorImages !== null && (value.filesRestored === void 0 || typeof value.filesRestored === "boolean") ? value : null;
|
|
3694
3924
|
}
|
|
3695
|
-
|
|
3925
|
+
),
|
|
3926
|
+
"fork-done": requireEventIdentity(
|
|
3927
|
+
"any",
|
|
3928
|
+
(value) => {
|
|
3696
3929
|
return isUuid(value.targetConversationId) && (value.sessionFile === void 0 || typeof value.sessionFile === "string") && (value.entryId === void 0 || isNonEmptyString(value.entryId)) && (value.error === void 0 || typeof value.error === "string") ? value : null;
|
|
3697
|
-
|
|
3930
|
+
}
|
|
3931
|
+
),
|
|
3932
|
+
compaction: requireEventIdentity(
|
|
3933
|
+
"any",
|
|
3934
|
+
(value) => {
|
|
3698
3935
|
return (value.state === "queued" || value.state === "start" || value.state === "end") && (value.error === void 0 || typeof value.error === "string") && (value.abandoned === void 0 || value.abandoned === true) ? value : null;
|
|
3699
|
-
|
|
3936
|
+
}
|
|
3937
|
+
),
|
|
3938
|
+
commands: requireEventIdentity(
|
|
3939
|
+
"any",
|
|
3940
|
+
(value) => {
|
|
3700
3941
|
return Array.isArray(value.commands) ? value : null;
|
|
3701
|
-
|
|
3942
|
+
}
|
|
3943
|
+
),
|
|
3944
|
+
"session-meta": requireEventIdentity(
|
|
3945
|
+
"any",
|
|
3946
|
+
(value) => {
|
|
3702
3947
|
const occupancy = value.occupancy === void 0 ? void 0 : parseContextOccupancy(value.occupancy);
|
|
3703
3948
|
if (value.occupancy !== void 0 && !occupancy) return null;
|
|
3704
3949
|
const { usageTotals: rawTotals, ...rest } = value;
|
|
@@ -3709,45 +3954,96 @@ function parseAgentWorkerEvent(value) {
|
|
|
3709
3954
|
...usageTotals ? { usageTotals } : {}
|
|
3710
3955
|
} : null;
|
|
3711
3956
|
}
|
|
3712
|
-
|
|
3957
|
+
),
|
|
3958
|
+
"approval-request": requireEventIdentity(
|
|
3959
|
+
"any",
|
|
3960
|
+
(value) => {
|
|
3713
3961
|
return isRecord(value.request) && isNonEmptyString(value.request.requestId) && isNonEmptyString(value.request.tool) && (value.request.kind === "command" || value.request.kind === "file-edit" || value.request.kind === "file-write" || value.request.kind === "mcp") && typeof value.request.summary === "string" && (value.request.filePaths === void 0 || Array.isArray(value.request.filePaths) && value.request.filePaths.every(isNonEmptyString)) && (value.request.protected === void 0 || PROTECTED_ACTION_CATEGORIES.includes(value.request.protected)) && isOptionalTimestamp(value.request.expiresAt) && (value.request.reviewFallback === void 0 || APPROVAL_REVIEW_FALLBACKS.includes(value.request.reviewFallback)) && (value.request.guard === void 0 || isRecord(value.request.guard) && hasOnlyKeys(value.request.guard, ["ruleId", "reason"]) && isNonEmptyString(value.request.guard.ruleId) && isNonEmptyString(value.request.guard.reason)) ? value : null;
|
|
3714
|
-
|
|
3962
|
+
}
|
|
3963
|
+
),
|
|
3964
|
+
"approval-resolved": requireEventIdentity(
|
|
3965
|
+
"any",
|
|
3966
|
+
(value) => {
|
|
3715
3967
|
return isNonEmptyString(value.requestId) ? value : null;
|
|
3716
|
-
|
|
3968
|
+
}
|
|
3969
|
+
),
|
|
3970
|
+
"ask-resolved": requireEventIdentity(
|
|
3971
|
+
"any",
|
|
3972
|
+
(value) => {
|
|
3717
3973
|
return isNonEmptyString(value.requestId) && (value.by === void 0 || ASK_ANSWER_BY.includes(value.by)) && (value.answer === void 0 || typeof value.answer === "string") && (value.name === void 0 || isNonEmptyString(value.name)) ? value : null;
|
|
3718
|
-
|
|
3974
|
+
}
|
|
3975
|
+
),
|
|
3976
|
+
"ask-request": requireEventIdentity(
|
|
3977
|
+
"any",
|
|
3978
|
+
(value) => {
|
|
3719
3979
|
return isRecord(value.ask) && isNonEmptyString(value.ask.requestId) && isNonEmptyString(value.ask.question) && isOptionalTimestamp(value.ask.expiresAt) && (value.ask.recommended === void 0 || Array.isArray(value.ask.options) && value.ask.options.includes(value.ask.recommended)) && (value.ask.relay === void 0 || isRecord(value.ask.relay) && isNonEmptyString(value.ask.relay.name)) ? value : null;
|
|
3720
|
-
|
|
3980
|
+
}
|
|
3981
|
+
),
|
|
3982
|
+
"subagent-update": requireEventIdentity(
|
|
3983
|
+
"any",
|
|
3984
|
+
(value) => {
|
|
3721
3985
|
return isRecord(value.agent) ? value : null;
|
|
3722
|
-
|
|
3986
|
+
}
|
|
3987
|
+
),
|
|
3988
|
+
"coworker-update": requireEventIdentity(
|
|
3989
|
+
"any",
|
|
3990
|
+
(value) => {
|
|
3723
3991
|
return isRecord(value.coworker) && isNonEmptyString(value.coworker.id) ? value : null;
|
|
3724
|
-
|
|
3992
|
+
}
|
|
3993
|
+
),
|
|
3994
|
+
"goal-signal": requireEventIdentity(
|
|
3995
|
+
"any",
|
|
3996
|
+
(value) => {
|
|
3725
3997
|
return (value.kind === "complete" || value.kind === "blocked" || value.kind === "wait") && typeof value.note === "string" ? value : null;
|
|
3726
|
-
|
|
3998
|
+
}
|
|
3999
|
+
),
|
|
4000
|
+
"plan-state": requireEventIdentity(
|
|
4001
|
+
"any",
|
|
4002
|
+
(value) => {
|
|
3727
4003
|
const state = parsePlanState(value.state);
|
|
3728
4004
|
return hasExactKeys(value, ["type", "identity", "seq", "state"]) && state ? { ...value, state } : null;
|
|
3729
4005
|
}
|
|
3730
|
-
|
|
4006
|
+
),
|
|
4007
|
+
"workflow-status": requireEventIdentity(
|
|
4008
|
+
"any",
|
|
4009
|
+
(value) => {
|
|
3731
4010
|
const run = parseWorkflowRunSnapshot(value.run);
|
|
3732
4011
|
return hasExactKeys(value, ["type", "identity", "seq", "run"]) && run ? { ...value, run } : null;
|
|
3733
4012
|
}
|
|
3734
|
-
|
|
4013
|
+
),
|
|
4014
|
+
"tool-output": requireEventIdentity(
|
|
4015
|
+
"any",
|
|
4016
|
+
(value) => {
|
|
3735
4017
|
return isNonEmptyString(value.toolCallId) && typeof value.output === "string" && (value.startedAt === void 0 || typeof value.startedAt === "number") && (value.deadlineAt === void 0 || Number.isFinite(value.deadlineAt)) ? value : null;
|
|
3736
|
-
|
|
4018
|
+
}
|
|
4019
|
+
),
|
|
4020
|
+
"task-started": requireEventIdentity(
|
|
4021
|
+
"any",
|
|
4022
|
+
(value) => {
|
|
3737
4023
|
return isRecord(value.task) ? value : null;
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
4024
|
+
}
|
|
4025
|
+
),
|
|
4026
|
+
"task-output": parseTaskEvent,
|
|
4027
|
+
"task-ended": parseTaskEvent,
|
|
4028
|
+
"background-tasks-level": requireEventIdentity(
|
|
4029
|
+
"any",
|
|
4030
|
+
(value) => {
|
|
3742
4031
|
return Array.isArray(value.tasks) && value.tasks.every((task) => isRecord(task) && isNonEmptyString(task.taskId)) ? value : null;
|
|
3743
|
-
|
|
4032
|
+
}
|
|
4033
|
+
),
|
|
4034
|
+
"session-custom-entry": requireEventIdentity(
|
|
4035
|
+
"any",
|
|
4036
|
+
(value) => {
|
|
3744
4037
|
return parseAgentSessionCustomEntry(value.entry) ? value : null;
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
4038
|
+
}
|
|
4039
|
+
)
|
|
4040
|
+
};
|
|
4041
|
+
function parseAgentWorkerEvent(value) {
|
|
4042
|
+
if (!isRecord(value) || !isNonEmptyString(value.type)) return null;
|
|
4043
|
+
return parseClosed(agentWorkerEventParsers, value.type, value);
|
|
3748
4044
|
}
|
|
3749
4045
|
export {
|
|
3750
|
-
|
|
4046
|
+
isClassifierOnlyProvider as $,
|
|
3751
4047
|
AGENT_END_TEXT_MAX as A,
|
|
3752
4048
|
BEFORE_AGENT_START_PROMPT_MAX as B,
|
|
3753
4049
|
CONTEXT_OCCUPANCY_BUCKETS as C,
|
|
@@ -3773,149 +4069,151 @@ export {
|
|
|
3773
4069
|
turnCalledSilenceTurn as W,
|
|
3774
4070
|
STALE_SESSION_ERROR as X,
|
|
3775
4071
|
WORKSPACE_WRITE_TOOL_ID as Y,
|
|
3776
|
-
|
|
3777
|
-
|
|
4072
|
+
parsePlanMessage as Z,
|
|
4073
|
+
PLUGIN_AGENT_OUTPUT_MAX_CHARS as _,
|
|
3778
4074
|
parseSessionIdentity as a,
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
4075
|
+
BOT_AVATAR_HOST as a$,
|
|
4076
|
+
isOauthAccountPool as a0,
|
|
4077
|
+
resolveEditMode as a1,
|
|
4078
|
+
EMPTY_PLAN_STATE as a2,
|
|
4079
|
+
mergeMaskReports as a3,
|
|
4080
|
+
PRIVACY_MASK_ENTRY as a4,
|
|
4081
|
+
parseAgentCommand as a5,
|
|
4082
|
+
effectiveDisabledBuiltinTools as a6,
|
|
3787
4083
|
pluginToolName as a7,
|
|
3788
4084
|
APPROVAL_MODES as a8,
|
|
3789
4085
|
parseChildConversationMetadata as a9,
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
4086
|
+
PLUGIN_PROGRESS_MAX_CHARS as aA,
|
|
4087
|
+
MCP_TRANSPORTS as aB,
|
|
4088
|
+
persistedSettingsState as aC,
|
|
4089
|
+
parsePrivacyMaskRecord as aD,
|
|
4090
|
+
hasProviderCredentials as aE,
|
|
4091
|
+
parseAgentWorkerEvent as aF,
|
|
4092
|
+
SECRETARY_FORCED_DISABLED_TOOLS as aG,
|
|
4093
|
+
parseWindowsLocalShell as aH,
|
|
4094
|
+
parseSmartCompactMode as aI,
|
|
4095
|
+
SECRETARY_ALWAYS_ENABLED_TOOLS as aJ,
|
|
4096
|
+
resolveImageGenerationConfig as aK,
|
|
4097
|
+
normalizeMaxActiveCoworkers as aL,
|
|
4098
|
+
normalizeAutoRetryLimit as aM,
|
|
4099
|
+
parsePrivacyMaskSettings as aN,
|
|
4100
|
+
parseDisabledWorkflowPresets as aO,
|
|
4101
|
+
DEFAULT_APPROVAL_ALLOW_THRESHOLD as aP,
|
|
4102
|
+
visibleMemberAgentTypes as aQ,
|
|
4103
|
+
buildAgentTypeRegistrySnapshot as aR,
|
|
4104
|
+
resolveShellLimits as aS,
|
|
4105
|
+
parseWebSearchChain as aT,
|
|
4106
|
+
DEFAULT_PRESET_ID as aU,
|
|
4107
|
+
childProfileToolIds as aV,
|
|
4108
|
+
AGENT_TASK_MAX_RESUMES as aW,
|
|
4109
|
+
AGENT_WAIT_DEFAULT_MS as aX,
|
|
4110
|
+
AGENT_WAIT_MAX_MS as aY,
|
|
4111
|
+
LOCAL_IMAGE_SCHEME as aZ,
|
|
4112
|
+
REMOTE_FETCH_HOST as a_,
|
|
3817
4113
|
eligibleOauthPoolAccountKeys as aa,
|
|
3818
4114
|
normalizeSshTimeoutSeconds as ab,
|
|
3819
4115
|
isEditMode as ac,
|
|
3820
4116
|
resolveDisabledBuiltinTools as ad,
|
|
3821
4117
|
projectDisabledBuiltinTools as ae,
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
4118
|
+
isReservedAgentTypeName as af,
|
|
4119
|
+
BUILTIN_AGENT_TYPES as ag,
|
|
4120
|
+
PLUGIN_HOST_APIS as ah,
|
|
4121
|
+
PLUGIN_INJECT_MAX_CHARS as ai,
|
|
4122
|
+
PLUGIN_AGENT_RUN_ID as aj,
|
|
4123
|
+
PLUGIN_AGENT_PROMPT_MAX_CHARS as ak,
|
|
4124
|
+
PLUGIN_AGENT_SYSTEM_MAX_CHARS as al,
|
|
4125
|
+
PLUGIN_AGENT_DEFAULT_TIMEOUT_MS as am,
|
|
4126
|
+
PLUGIN_AGENT_MAX_TIMEOUT_MS as an,
|
|
4127
|
+
parsePluginInjectImages as ao,
|
|
4128
|
+
isHostPluginEvent as ap,
|
|
4129
|
+
parsePluginToolName as aq,
|
|
4130
|
+
initialInterceptState as ar,
|
|
4131
|
+
CHILD_INTERCEPT_TOTAL_TIMEOUT_MS as as,
|
|
4132
|
+
INTERCEPT_TOTAL_TIMEOUT_MS as at,
|
|
4133
|
+
CHILD_INTERCEPT_TIMEOUT_MS as au,
|
|
4134
|
+
INTERCEPT_TIMEOUT_MS as av,
|
|
4135
|
+
applyInterceptResult as aw,
|
|
4136
|
+
failClosedResult as ax,
|
|
4137
|
+
OBSERVE_TIMEOUT_MS as ay,
|
|
4138
|
+
BEFORE_COMPACT_TIMEOUT_MS as az,
|
|
3843
4139
|
parseApprovalAllowThreshold as b,
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
4140
|
+
planFeedbackText as b$,
|
|
4141
|
+
SECRETARY_AVATAR_HOST as b0,
|
|
4142
|
+
PLUGIN_ASSET_HOST as b1,
|
|
4143
|
+
SECRETARY_REPORT_HOST as b2,
|
|
4144
|
+
mediaExtension as b3,
|
|
4145
|
+
localImageUrlToPath as b4,
|
|
4146
|
+
isMediaPath as b5,
|
|
4147
|
+
isVideoPath as b6,
|
|
4148
|
+
IMAGE_EXTENSIONS as b7,
|
|
4149
|
+
isDeliveryId as b8,
|
|
4150
|
+
splitPlanPrefix as b9,
|
|
4151
|
+
SHELL_LIMITS as bA,
|
|
4152
|
+
TITLE_SUMMARY_MAX_CANDIDATES as bB,
|
|
4153
|
+
parseCreateProjectAuthorityRequest as bC,
|
|
4154
|
+
parseSelectProjectAuthorityRequest as bD,
|
|
4155
|
+
parseRemoveProjectAuthorityRequest as bE,
|
|
4156
|
+
withVersionSegment as bF,
|
|
4157
|
+
DEFAULT_BASE_URLS as bG,
|
|
4158
|
+
shouldSilenceTurn as bH,
|
|
4159
|
+
sessionIdsInUpdates as bI,
|
|
4160
|
+
messageText as bJ,
|
|
4161
|
+
isPureSessionUpdate as bK,
|
|
4162
|
+
PROJECTED_FILE_TEXT_LIMIT as bL,
|
|
4163
|
+
imageGenerationPreviewPaths as bM,
|
|
4164
|
+
parseGeneratedImagePaths as bN,
|
|
4165
|
+
parseMaskReport as bO,
|
|
4166
|
+
parsePluginMessageSource as bP,
|
|
4167
|
+
parseRtkToolStats as bQ,
|
|
4168
|
+
isBackgroundTaskId as bR,
|
|
4169
|
+
parseShellFailure as bS,
|
|
4170
|
+
pluginArtifactsFromToolDetails as bT,
|
|
4171
|
+
parseApprovalReviewRecord as bU,
|
|
4172
|
+
PROJECTED_FILE_CHANGE_LIMIT as bV,
|
|
4173
|
+
PROJECTED_APPLY_PATCH_PATH_TEXT_LIMIT as bW,
|
|
4174
|
+
PROJECTED_APPLY_PATCH_PATH_COUNT_LIMIT as bX,
|
|
4175
|
+
foldPlanState as bY,
|
|
4176
|
+
PLAN_MODE_ON_NOTE as bZ,
|
|
4177
|
+
PLAN_MODE_OFF_NOTE as b_,
|
|
4178
|
+
parseSecretarySkillDraft as ba,
|
|
4179
|
+
parseSecretaryToolDraft as bb,
|
|
4180
|
+
TURN_REPORT_MAX_CHARS as bc,
|
|
4181
|
+
isSecretarySlug as bd,
|
|
4182
|
+
secretaryToolScriptFile as be,
|
|
4183
|
+
parseSecretaryToolFile as bf,
|
|
4184
|
+
renderSecretaryToolFile as bg,
|
|
4185
|
+
secretaryToolDescriptor as bh,
|
|
4186
|
+
TOOL_TIMEOUT_DEFAULT as bi,
|
|
4187
|
+
TOOL_OUTPUT_MAX as bj,
|
|
4188
|
+
isSecretarySkillName as bk,
|
|
4189
|
+
parseSecretarySkillFile as bl,
|
|
4190
|
+
renderSecretarySkillFile as bm,
|
|
4191
|
+
effectiveSubagentAllowedModes as bn,
|
|
4192
|
+
parseCreateConversationAuthorityRequest as bo,
|
|
4193
|
+
parseConversationAuthorityRequest as bp,
|
|
4194
|
+
parseUpdateConversationSelectionRequest as bq,
|
|
4195
|
+
parseTitleSummaryInput as br,
|
|
4196
|
+
parseParentSourceBindingRequest as bs,
|
|
4197
|
+
parseParentModelSelectionRequest as bt,
|
|
4198
|
+
parseAgentDispatchRequest as bu,
|
|
4199
|
+
isApprovalDecision as bv,
|
|
4200
|
+
TASK_KEEP_REASON_MAX as bw,
|
|
4201
|
+
cleanToolBatchLabel as bx,
|
|
4202
|
+
toolBatchLabelPrompt as by,
|
|
4203
|
+
TOOL_BATCH_LABEL_SYSTEM_PROMPT as bz,
|
|
3908
4204
|
isProbability as c,
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
4205
|
+
planKickoffText as c0,
|
|
4206
|
+
activePlanNote as c1,
|
|
4207
|
+
PLAN_TITLE_MAX as c2,
|
|
4208
|
+
PLAN_TEXT_MAX as c3,
|
|
4209
|
+
planPhase as c4,
|
|
4210
|
+
parsePlanEntry as c5,
|
|
4211
|
+
parseAgentControlToolRequest as c6,
|
|
4212
|
+
nativeSearchKindFor as c7,
|
|
4213
|
+
isWorkflowPresetId as c8,
|
|
4214
|
+
PLUGIN_EVENTS as c9,
|
|
4215
|
+
isInterceptEvent as ca,
|
|
4216
|
+
APPEND_ONLY_INTERCEPT_EVENTS as cb,
|
|
3919
4217
|
CONTEXT_PART_ITEMS as d,
|
|
3920
4218
|
parseProviderHeaders as e,
|
|
3921
4219
|
escapePiConfigValue as f,
|
|
@@ -3935,9 +4233,9 @@ export {
|
|
|
3935
4233
|
SECRETARY_ID_MAX as t,
|
|
3936
4234
|
SECRETARY_CONTACT_CAPTION_MAX as u,
|
|
3937
4235
|
SECRETARY_ATTACHMENT_PATH_MAX as v,
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
4236
|
+
SECRETARY_SEND_MODES as w,
|
|
4237
|
+
SECRETARY_SESSION_MESSAGE_MAX as x,
|
|
4238
|
+
SECRETARY_ATTACHMENT_MAX as y,
|
|
3941
4239
|
TOOL_RUN_TIMEOUT_MS as z
|
|
3942
4240
|
};
|
|
3943
|
-
//# sourceMappingURL=agent-
|
|
4241
|
+
//# sourceMappingURL=agent-BbNq8i9j.js.map
|