@ensocode/server 0.3.12 → 0.3.14

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.
Files changed (231) hide show
  1. package/out/phone/assets/EditDiff-7At9BpWJ.js +28 -0
  2. package/out/phone/assets/ReadFileView-CFkjh0Xx.js +7 -0
  3. package/out/phone/assets/{abnfDiagram-VCTEODGH-D-9apHOZ.js → abnfDiagram-VCTEODGH-D4384sfe.js} +1 -1
  4. package/out/phone/assets/architecture-7GRP2DOG-vDamN_Vr.js +1 -0
  5. package/out/phone/assets/{architectureDiagram-5GKGNRK7-B7ti5Yuy.js → architectureDiagram-5GKGNRK7-CjzMXFHb.js} +1 -1
  6. package/out/phone/assets/{blockDiagram-I7D4REHJ-CMg6PHJB.js → blockDiagram-I7D4REHJ-COX4_2NT.js} +1 -1
  7. package/out/phone/assets/{c4Diagram-7LVT6UL2-YtDbC01g.js → c4Diagram-7LVT6UL2-C0PHCrzg.js} +1 -1
  8. package/out/phone/assets/channel-TsMJYH0f.js +1 -0
  9. package/out/phone/assets/{chunk-4HAMMTFA-Djg6ctlZ.js → chunk-4HAMMTFA-BSqiGn28.js} +1 -1
  10. package/out/phone/assets/{chunk-75Z2AOVW-Be2kq0FP.js → chunk-75Z2AOVW-7eocu_Pa.js} +1 -1
  11. package/out/phone/assets/{chunk-DU6HZSFF-d5JZiOMy.js → chunk-DU6HZSFF-DMttOQUE.js} +1 -1
  12. package/out/phone/assets/{chunk-F27PBJKO-DHBQ6nrV.js → chunk-F27PBJKO-BFNRrOvq.js} +1 -1
  13. package/out/phone/assets/{chunk-GMAD6QVW-BatU6uXC.js → chunk-GMAD6QVW-DPVV1Shj.js} +1 -1
  14. package/out/phone/assets/{chunk-GVQU2GXP-CiyvoRIy.js → chunk-GVQU2GXP-YataTcA_.js} +1 -1
  15. package/out/phone/assets/{chunk-IMKFNOWR-vOQaK90i.js → chunk-IMKFNOWR-DBQKd74U.js} +1 -1
  16. package/out/phone/assets/{chunk-L3NEJ4N5-CPykFzBy.js → chunk-L3NEJ4N5-DXfrfXkv.js} +1 -1
  17. package/out/phone/assets/{chunk-OSK3NFVY-q4NiGH59.js → chunk-OSK3NFVY-DWr7pP6Q.js} +1 -1
  18. package/out/phone/assets/{chunk-P2QGCYS3-DUV9S_qP.js → chunk-P2QGCYS3-C_qNKS0g.js} +1 -1
  19. package/out/phone/assets/{chunk-POPQ4Y6H-CjycswNE.js → chunk-POPQ4Y6H-BhJK3UtM.js} +1 -1
  20. package/out/phone/assets/{chunk-PWAF6VOD-Dben6plA.js → chunk-PWAF6VOD-MmcwGVgC.js} +1 -1
  21. package/out/phone/assets/{chunk-SHT3W25Y-D2hK_jmb.js → chunk-SHT3W25Y-BQHA3p2Q.js} +1 -1
  22. package/out/phone/assets/{chunk-SVP7TREG-DLtgLN89.js → chunk-SVP7TREG-DbQH56Ci.js} +1 -1
  23. package/out/phone/assets/{chunk-TICWLB2K-BeBB0_0w.js → chunk-TICWLB2K-pixKba1z.js} +1 -1
  24. package/out/phone/assets/classDiagram-ZZMXUADV-Bhtnzu97.js +1 -0
  25. package/out/phone/assets/classDiagram-v2-VYDZK3BY-Bhtnzu97.js +1 -0
  26. package/out/phone/assets/codeHighlighter-CrZcFhK_.js +1346 -0
  27. package/out/phone/assets/{cynefin-OW5HDTMX-CsDdLZPP.js → cynefin-OW5HDTMX-67ETi-0P.js} +1 -1
  28. package/out/phone/assets/{cynefinDiagram-5FMLGOSQ-BcaPty-s.js → cynefinDiagram-5FMLGOSQ-C3wqlm_-.js} +1 -1
  29. package/out/phone/assets/{dagre-GXQ25YYZ-o7dqm5ri.js → dagre-GXQ25YYZ-DTC1fZsc.js} +1 -1
  30. package/out/phone/assets/desk-B382G0e_.js +52 -0
  31. package/out/phone/assets/{diagram-S7CK7UJ4-B5m8q3yP.js → diagram-S7CK7UJ4-uqcU7OpS.js} +1 -1
  32. package/out/phone/assets/{diagram-UQ7AKVKN-_lP617OW.js → diagram-UQ7AKVKN-BQ6K9f6g.js} +1 -1
  33. package/out/phone/assets/{diagram-VSXAHHWV-D16twHR0.js → diagram-VSXAHHWV-CDzRWkI9.js} +1 -1
  34. package/out/phone/assets/{diagram-VX7I27RA-BT8YSil1.js → diagram-VX7I27RA-CvI10CG1.js} +1 -1
  35. package/out/phone/assets/{diagram-Z3DM3KII-CiSuhrxd.js → diagram-Z3DM3KII-DM8G_CIZ.js} +1 -1
  36. package/out/phone/assets/{ebnfDiagram-PWID7BFC-BbCXn4HA.js → ebnfDiagram-PWID7BFC-BBbLoaIE.js} +1 -1
  37. package/out/phone/assets/{erDiagram-RLTQ6QDP-5-xE_bP2.js → erDiagram-RLTQ6QDP-Dz98FGLq.js} +1 -1
  38. package/out/phone/assets/eventmodeling-NTZA5JFV-BGT2L4_J.js +1 -0
  39. package/out/phone/assets/flowDiagram-HODETNUW-CpTX9nm5.js +1 -0
  40. package/out/phone/assets/{ganttDiagram-EL5Y4UJY-Rqgggqg_.js → ganttDiagram-EL5Y4UJY-BADRjlHl.js} +1 -1
  41. package/out/phone/assets/{gitGraph-4MIJSDKK-Drt18ZKK.js → gitGraph-4MIJSDKK-DQGKRsA2.js} +1 -1
  42. package/out/phone/assets/{gitGraphDiagram-WWUBYQGX-BQ5y4d2H.js → gitGraphDiagram-WWUBYQGX-DrLRujhH.js} +1 -1
  43. package/out/phone/assets/{info-A6RAGUB7-CpPeSHE0.js → info-A6RAGUB7-b7IbwKqs.js} +1 -1
  44. package/out/phone/assets/{infoDiagram-27XIBGKW-D3d9S0Y6.js → infoDiagram-27XIBGKW-BNbXaMmR.js} +1 -1
  45. package/out/phone/assets/{ishikawaDiagram-5VMMS53U-plFMqx62.js → ishikawaDiagram-5VMMS53U-B3SG131F.js} +1 -1
  46. package/out/phone/assets/{journeyDiagram-3NMN7TZE-CX-n-XXx.js → journeyDiagram-3NMN7TZE-BoRfNykb.js} +1 -1
  47. package/out/phone/assets/{kanban-definition-UXKFOSKX-DrdTzKIc.js → kanban-definition-UXKFOSKX-D0tKrJ8_.js} +1 -1
  48. package/out/phone/assets/{line-CqyaArNm.js → line-W1HWn4B7.js} +1 -1
  49. package/out/phone/assets/main-Bc8DQVa6.css +2 -0
  50. package/out/phone/assets/main-Bez4gfKe.js +281 -0
  51. package/out/phone/assets/{mermaid-parser.core-CERMa6fg.js → mermaid-parser.core-CpGE7UgS.js} +3 -3
  52. package/out/phone/assets/{mermaid.core-CbGP2wFn.js → mermaid.core-wueTI3u_.js} +4 -4
  53. package/out/phone/assets/{mindmap-definition-YA3MSWOX-BxaIrov6.js → mindmap-definition-YA3MSWOX-BDctzErY.js} +1 -1
  54. package/out/phone/assets/{packet-AYTQ26CC-DguFQxPm.js → packet-AYTQ26CC-C0YWsXol.js} +1 -1
  55. package/out/phone/assets/{pegDiagram-XKGWAZYB-t3td03dz.js → pegDiagram-XKGWAZYB-C97XjNI7.js} +1 -1
  56. package/out/phone/assets/{pie-WAS4IAKB-DoFu2rhu.js → pie-WAS4IAKB-BxuJ1GKP.js} +1 -1
  57. package/out/phone/assets/{pieDiagram-E7YTZNPT-DctHLSL8.js → pieDiagram-E7YTZNPT-SP4DeWDw.js} +1 -1
  58. package/out/phone/assets/{quadrantDiagram-AXDQQJYC-Br7-ImNr.js → quadrantDiagram-AXDQQJYC-DDHL4rrG.js} +1 -1
  59. package/out/phone/assets/{radar-RG4KPBEZ-BDjTOHD8.js → radar-RG4KPBEZ-AzVB8zoH.js} +1 -1
  60. package/out/phone/assets/{railroad-74A4TZTK-v8vsrpxb.js → railroad-74A4TZTK-CA2_A72l.js} +1 -1
  61. package/out/phone/assets/railroad-abnf-HS5TGJTU-CTHhRGvc.js +1 -0
  62. package/out/phone/assets/railroad-ebnf-LZEXJU2U-CS68P4fL.js +1 -0
  63. package/out/phone/assets/railroad-peg-WCYAUIDC-BqCcrVdf.js +1 -0
  64. package/out/phone/assets/{railroadDiagram-O6MQD6OU-DtH4qQrr.js → railroadDiagram-O6MQD6OU-D5zpQ5kq.js} +1 -1
  65. package/out/phone/assets/{requirementDiagram-BXWQKSXE-BSqejjZP.js → requirementDiagram-BXWQKSXE-DkQKt5hJ.js} +1 -1
  66. package/out/phone/assets/{sankeyDiagram-P5KCCOFB-DsTWuNtL.js → sankeyDiagram-P5KCCOFB-xeXrVMVr.js} +1 -1
  67. package/out/phone/assets/{sequenceDiagram-WJ2MYXX4-zLMvPyPC.js → sequenceDiagram-WJ2MYXX4-BOiNtyS8.js} +1 -1
  68. package/out/phone/assets/shellUpdate-C4yk9AaU.js +1 -0
  69. package/out/phone/assets/{stateDiagram-D77RDMKH-DrBC05BN.js → stateDiagram-D77RDMKH-Bs8LX9-n.js} +1 -1
  70. package/out/phone/assets/stateDiagram-v2-MP3YSRHH-nBP_YibA.js +1 -0
  71. package/out/phone/assets/{swimlanes-42K2YHIH-B27-qSm5.js → swimlanes-42K2YHIH-DQVYfgSI.js} +1 -1
  72. package/out/phone/assets/swimlanesDiagram-VR7AAH4N-BkfzXxS-.js +8 -0
  73. package/out/phone/assets/{timeline-definition-24CTP7MA-8NDkGf5U.js → timeline-definition-24CTP7MA-BlpgdxeN.js} +1 -1
  74. package/out/phone/assets/{treeView-Q6P3EWNA-B9BXwCDC.js → treeView-Q6P3EWNA-D0PiggHr.js} +1 -1
  75. package/out/phone/assets/{treemap-WGGIJYW6-B0IqbwdT.js → treemap-WGGIJYW6-DA07Kvo0.js} +1 -1
  76. package/out/phone/assets/{vennDiagram-4TSXK5OY-Dp-aKgNa.js → vennDiagram-4TSXK5OY-BtvfF1a4.js} +1 -1
  77. package/out/phone/assets/{wardley-WFR3VGLG-B7FlADZf.js → wardley-WFR3VGLG-Db-UrSZJ.js} +1 -1
  78. package/out/phone/assets/{wardleyDiagram-VM6X3IG4-BVntjQNl.js → wardleyDiagram-VM6X3IG4-CaBnqFYM.js} +1 -1
  79. package/out/phone/assets/{xychartDiagram-S5SC5T6Z-kgVJvkgO.js → xychartDiagram-S5SC5T6Z-Bbzz9YwS.js} +1 -1
  80. package/out/phone/desk.html +81 -2
  81. package/out/phone/index.html +51 -3
  82. package/out/phone/manifest.webmanifest +1 -0
  83. package/out/phone/splash/1125x2436-dark.png +0 -0
  84. package/out/phone/splash/1125x2436-light.png +0 -0
  85. package/out/phone/splash/1170x2532-dark.png +0 -0
  86. package/out/phone/splash/1170x2532-light.png +0 -0
  87. package/out/phone/splash/1179x2556-dark.png +0 -0
  88. package/out/phone/splash/1179x2556-light.png +0 -0
  89. package/out/phone/splash/1206x2622-dark.png +0 -0
  90. package/out/phone/splash/1206x2622-light.png +0 -0
  91. package/out/phone/splash/1242x2208-dark.png +0 -0
  92. package/out/phone/splash/1242x2208-light.png +0 -0
  93. package/out/phone/splash/1242x2688-dark.png +0 -0
  94. package/out/phone/splash/1242x2688-light.png +0 -0
  95. package/out/phone/splash/1260x2736-dark.png +0 -0
  96. package/out/phone/splash/1260x2736-light.png +0 -0
  97. package/out/phone/splash/1284x2778-dark.png +0 -0
  98. package/out/phone/splash/1284x2778-light.png +0 -0
  99. package/out/phone/splash/1290x2796-dark.png +0 -0
  100. package/out/phone/splash/1290x2796-light.png +0 -0
  101. package/out/phone/splash/1320x2868-dark.png +0 -0
  102. package/out/phone/splash/1320x2868-light.png +0 -0
  103. package/out/phone/splash/750x1334-dark.png +0 -0
  104. package/out/phone/splash/750x1334-light.png +0 -0
  105. package/out/phone/splash/828x1792-dark.png +0 -0
  106. package/out/phone/splash/828x1792-light.png +0 -0
  107. package/out/phone/sw.js +219 -6
  108. package/out/renderer/assets/EditDiff-C9JBUR0o.js +1 -0
  109. package/out/renderer/assets/File-BIf-onMm.js +1 -0
  110. package/out/renderer/assets/ReadFileView-C5AKNlFU.js +4 -0
  111. package/out/renderer/assets/SidePanel-DN2RL6QD.css +1 -0
  112. package/out/renderer/assets/SidePanel-DkSc3og9.js +48 -0
  113. package/out/renderer/assets/Virtualizer-tZu4hGtC.js +1345 -0
  114. package/out/renderer/assets/{abnfDiagram-VCTEODGH-Bp0r3dKm.js → abnfDiagram-VCTEODGH-DxBBUZxF.js} +1 -1
  115. package/out/renderer/assets/{arc-BD5HnhIt.js → arc-DXzwxP4j.js} +1 -1
  116. package/out/renderer/assets/{architectureDiagram-5GKGNRK7-CgJHjETB.js → architectureDiagram-5GKGNRK7-Bcykp-Fb.js} +1 -1
  117. package/out/renderer/assets/{blockDiagram-I7D4REHJ-5le9vk4G.js → blockDiagram-I7D4REHJ-P7zMiiL3.js} +1 -1
  118. package/out/renderer/assets/{c4Diagram-7LVT6UL2-B4DCe-qN.js → c4Diagram-7LVT6UL2-BVD9zEE8.js} +1 -1
  119. package/out/renderer/assets/channel-7bWV5QTy.js +1 -0
  120. package/out/renderer/assets/{chunk-2Q5K7J3B-DIxWfJHE.js → chunk-2Q5K7J3B-BXj05DaP.js} +1 -1
  121. package/out/renderer/assets/{chunk-5VM5RSS4-D9j4om1l.js → chunk-5VM5RSS4-D-SpodcG.js} +1 -1
  122. package/out/renderer/assets/{chunk-F27PBJKO-B_tGbKyc.js → chunk-F27PBJKO-ORLEQ9sv.js} +1 -1
  123. package/out/renderer/assets/{chunk-IMKFNOWR-Cfffd1p9.js → chunk-IMKFNOWR-1lhHjr20.js} +1 -1
  124. package/out/renderer/assets/{chunk-JWPE2WC7-BABZOPGb.js → chunk-JWPE2WC7-BgmlC9Vl.js} +1 -1
  125. package/out/renderer/assets/{chunk-POPQ4Y6H-D-QyVpSn.js → chunk-POPQ4Y6H-DPEfkZnH.js} +1 -1
  126. package/out/renderer/assets/{chunk-SVP7TREG-BghyPSd6.js → chunk-SVP7TREG-7_S5Geoi.js} +1 -1
  127. package/out/renderer/assets/{chunk-TICWLB2K-CQmthy6z.js → chunk-TICWLB2K-BKi8yvLf.js} +1 -1
  128. package/out/renderer/assets/{chunk-XXDRQBXY-CDKsbyR7.js → chunk-XXDRQBXY-PfB25f1D.js} +1 -1
  129. package/out/renderer/assets/classDiagram-ZZMXUADV-mgQwYiWM.js +1 -0
  130. package/out/renderer/assets/classDiagram-v2-VYDZK3BY-mgQwYiWM.js +1 -0
  131. package/out/renderer/assets/{cose-bilkent-JH36ORCC-oajViFnN.js → cose-bilkent-JH36ORCC-C246yayw.js} +1 -1
  132. package/out/renderer/assets/{cynefin-OW5HDTMX-DMH1CUmI.js → cynefin-OW5HDTMX-Dr9W26Pe.js} +1 -1
  133. package/out/renderer/assets/{cynefinDiagram-5FMLGOSQ-DVUJf9t0.js → cynefinDiagram-5FMLGOSQ-B3Jtuns2.js} +1 -1
  134. package/out/renderer/assets/{cytoscape-fcose-adTZ191M.js → cytoscape-fcose-CJat50hU.js} +1 -1
  135. package/out/renderer/assets/{dagre-GXQ25YYZ-BXRWWNje.js → dagre-GXQ25YYZ-Dt2pulYx.js} +1 -1
  136. package/out/renderer/assets/{diagram-S7CK7UJ4-Dg7f2Dan.js → diagram-S7CK7UJ4-Bx-0FuVR.js} +1 -1
  137. package/out/renderer/assets/{diagram-UQ7AKVKN-DsLRyZAt.js → diagram-UQ7AKVKN-D-8o1p4p.js} +1 -1
  138. package/out/renderer/assets/{diagram-VSXAHHWV-3_LoodSS.js → diagram-VSXAHHWV-CI0jUOHM.js} +1 -1
  139. package/out/renderer/assets/{diagram-VX7I27RA-DQeZp2Cz.js → diagram-VX7I27RA-Byl54mOd.js} +1 -1
  140. package/out/renderer/assets/{diagram-Z3DM3KII-Dwil6g5m.js → diagram-Z3DM3KII-Kf_GIJ7p.js} +1 -1
  141. package/out/renderer/assets/{ebnfDiagram-PWID7BFC-DecVNxpu.js → ebnfDiagram-PWID7BFC-BbOdw7R1.js} +1 -1
  142. package/out/renderer/assets/{erDiagram-RLTQ6QDP-D2rmo2nP.js → erDiagram-RLTQ6QDP-UjxTTQ7M.js} +1 -1
  143. package/out/renderer/assets/{flowDiagram-HODETNUW-_SF2dRBl.js → flowDiagram-HODETNUW-BVuwOxKp.js} +1 -1
  144. package/out/renderer/assets/{ganttDiagram-EL5Y4UJY-BoYWs5Ev.js → ganttDiagram-EL5Y4UJY-BpBSO-4X.js} +1 -1
  145. package/out/renderer/assets/{gitGraphDiagram-WWUBYQGX-BqRbZ3V0.js → gitGraphDiagram-WWUBYQGX-b72vZ1j2.js} +1 -1
  146. package/out/renderer/assets/globals-2G408HiJ.css +1 -0
  147. package/out/renderer/assets/globals-BqVjlAT_.js +673 -0
  148. package/out/renderer/assets/index-AHhNcASr.js +113 -0
  149. package/out/renderer/assets/{infoDiagram-27XIBGKW-CFt6xyuD.js → infoDiagram-27XIBGKW-CtnN4sif.js} +1 -1
  150. package/out/renderer/assets/{ishikawaDiagram-5VMMS53U-CZB8G4dD.js → ishikawaDiagram-5VMMS53U-B2YfGNEH.js} +1 -1
  151. package/out/renderer/assets/{journeyDiagram-3NMN7TZE-CO2VRmpx.js → journeyDiagram-3NMN7TZE-fUfanA7T.js} +1 -1
  152. package/out/renderer/assets/{kanban-definition-UXKFOSKX-DIqEnfMM.js → kanban-definition-UXKFOSKX-DU0d3NVH.js} +1 -1
  153. package/out/renderer/assets/{layout-DXRKfO_Y.js → layout-C0hE7llw.js} +1 -1
  154. package/out/renderer/assets/{linear-Cdx1AdZJ.js → linear-BXPh0BlC.js} +1 -1
  155. package/out/renderer/assets/manifest-DoBt8euy.js +525 -0
  156. package/out/renderer/assets/{mermaid.core-DuIO2jsm.js → mermaid.core-DlBAsGZ7.js} +5 -5
  157. package/out/renderer/assets/{mindmap-definition-YA3MSWOX-B5lvxG2M.js → mindmap-definition-YA3MSWOX-DUIiyta9.js} +1 -1
  158. package/out/renderer/assets/{pegDiagram-XKGWAZYB-DCwHp-K3.js → pegDiagram-XKGWAZYB-yP15oXPx.js} +1 -1
  159. package/out/renderer/assets/{pieDiagram-E7YTZNPT-Dq048Wh7.js → pieDiagram-E7YTZNPT-DsaSjWfA.js} +1 -1
  160. package/out/renderer/assets/{quadrantDiagram-AXDQQJYC-DwkFkAi_.js → quadrantDiagram-AXDQQJYC-BpWn5xT_.js} +1 -1
  161. package/out/renderer/assets/{railroadDiagram-O6MQD6OU-2NKvwLP-.js → railroadDiagram-O6MQD6OU-BnXhwCom.js} +1 -1
  162. package/out/renderer/assets/{requirementDiagram-BXWQKSXE-Bp44tNQ0.js → requirementDiagram-BXWQKSXE-CMIMPMzx.js} +1 -1
  163. package/out/renderer/assets/{sankeyDiagram-P5KCCOFB-C3TFp1NK.js → sankeyDiagram-P5KCCOFB-CKqneOc7.js} +1 -1
  164. package/out/renderer/assets/{sequenceDiagram-WJ2MYXX4-BTPoYQeW.js → sequenceDiagram-WJ2MYXX4-azbHkcGk.js} +1 -1
  165. package/out/renderer/assets/sessionChanges--o0RBCJW.js +31 -0
  166. package/out/renderer/assets/settings-D5R80op8.js +28 -0
  167. package/out/renderer/assets/{sizeCapture-INFHLROL-DvNj5TDT.js → sizeCapture-INFHLROL-C3uhIZ1e.js} +1 -1
  168. package/out/renderer/assets/{stateDiagram-D77RDMKH-DC8YykNp.js → stateDiagram-D77RDMKH-CrGab2Ck.js} +1 -1
  169. package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-k_H7O8MU.js +1 -0
  170. package/out/renderer/assets/{swimlanes-42K2YHIH-0yL1nNkg.js → swimlanes-42K2YHIH-6aX1l7C2.js} +1 -1
  171. package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-D2XerlPy.js +8 -0
  172. package/out/renderer/assets/{timeline-definition-24CTP7MA-Pg-2roGv.js → timeline-definition-24CTP7MA-DdVDUmce.js} +1 -1
  173. package/out/renderer/assets/{vennDiagram-4TSXK5OY-D0af5K4E.js → vennDiagram-4TSXK5OY-DP6DTjdX.js} +1 -1
  174. package/out/renderer/assets/{wardleyDiagram-VM6X3IG4-CB_nIy_l.js → wardleyDiagram-VM6X3IG4-DYJsuZCs.js} +1 -1
  175. package/out/renderer/assets/{xychartDiagram-S5SC5T6Z-A26Yld8R.js → xychartDiagram-S5SC5T6Z-CloAJCw-.js} +1 -1
  176. package/out/renderer/index.html +3 -4
  177. package/out/renderer/plugin-view.html +37 -0
  178. package/out/renderer/settings.html +7 -4
  179. package/out/renderer/web-preload.js +1 -51
  180. package/out/server/agent.js +1864 -395
  181. package/out/server/chunks/agentConstants-D4t7d6iS.js +9 -0
  182. package/out/server/chunks/builtinOccupancy-Ci-Szozb.js +93 -0
  183. package/out/server/chunks/conversationsMove-CvFPFHaa.js +587 -0
  184. package/out/server/chunks/dispatchModel-DJxnHup9.js +75 -0
  185. package/out/server/chunks/{gpuBackendInstall-CRzfB150.js → gpuBackendInstall-snisWLXN.js} +3 -3
  186. package/out/server/chunks/killTree-T-p6Lr3w.js +787 -0
  187. package/out/server/chunks/{loadProvider-4Y15KP7W.js → loadProvider-Uq3i7kKZ.js} +2 -2
  188. package/out/server/chunks/{manifest-wlfh-NN5.js → manifest-CmnE8RBt.js} +11 -3
  189. package/out/server/chunks/menuSkills-BEtW-Is6.js +53 -0
  190. package/out/server/chunks/projectCode-D9lgShsp.js +112 -0
  191. package/out/server/chunks/registry-R2KRdU8n.js +3335 -0
  192. package/out/server/chunks/{resources-DzUshg1j.js → resources-BfbTkFP0.js} +21 -10
  193. package/out/server/chunks/sendImage-CCjNsa-D.js +499 -0
  194. package/out/server/chunks/{storageScanWorker-CuttDIGS.js → storageScanWorker-CR7HbOWG.js} +2 -2
  195. package/out/server/chunks/{storageScanWorker-CX8O_DlF.js → storageScanWorker-DjFyHTye.js} +2 -2
  196. package/out/server/chunks/toolParams-DVs5d3F9.js +209 -0
  197. package/out/server/chunks/web-BIJOMDlz.js +7773 -0
  198. package/out/server/chunks/{workflowPresets-CAA0AY6f.js → workflowPresets-DVbQh2el.js} +13742 -15564
  199. package/out/server/index.js +33487 -29382
  200. package/out/server/memory-service.js +5058 -0
  201. package/out/server/plugin-host.js +44 -18
  202. package/package.json +1 -1
  203. package/out/phone/assets/EnsoNerdSymbolsMono-Regular-TdeMQojc.ttf +0 -0
  204. package/out/phone/assets/architecture-7GRP2DOG-ihVIDRRt.js +0 -1
  205. package/out/phone/assets/channel-BQsoblXW.js +0 -1
  206. package/out/phone/assets/classDiagram-ZZMXUADV-rwnxFDXp.js +0 -1
  207. package/out/phone/assets/classDiagram-v2-VYDZK3BY-rwnxFDXp.js +0 -1
  208. package/out/phone/assets/desk-DNf6lCoq.js +0 -2
  209. package/out/phone/assets/eventmodeling-NTZA5JFV-BVS2RGt-.js +0 -1
  210. package/out/phone/assets/flowDiagram-HODETNUW-BSlxj9Uk.js +0 -1
  211. package/out/phone/assets/main-BGlFv7yA.js +0 -1658
  212. package/out/phone/assets/main-BS1SSCau.css +0 -1
  213. package/out/phone/assets/railroad-abnf-HS5TGJTU-CUELjEtC.js +0 -1
  214. package/out/phone/assets/railroad-ebnf-LZEXJU2U-DdIokM4i.js +0 -1
  215. package/out/phone/assets/railroad-peg-WCYAUIDC-DYyy0B-_.js +0 -1
  216. package/out/phone/assets/stateDiagram-v2-MP3YSRHH-DT7BlwvF.js +0 -1
  217. package/out/phone/assets/storage-BeJvYXAx.js +0 -36
  218. package/out/phone/assets/swimlanesDiagram-VR7AAH4N-CWnm4v0A.js +0 -8
  219. package/out/renderer/assets/channel-D-HltTAP.js +0 -1
  220. package/out/renderer/assets/classDiagram-ZZMXUADV-BCWhgMul.js +0 -1
  221. package/out/renderer/assets/classDiagram-v2-VYDZK3BY-BCWhgMul.js +0 -1
  222. package/out/renderer/assets/globals-BEwCf508.css +0 -1
  223. package/out/renderer/assets/globals-C3zxoqqH.js +0 -2603
  224. package/out/renderer/assets/index-9vqh4wxi.js +0 -133
  225. package/out/renderer/assets/index-F_0FxVZ_.css +0 -1
  226. package/out/renderer/assets/settings-DlDHkOe2.js +0 -25
  227. package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-B4rCEEYH.js +0 -1
  228. package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-zQqW8MJ5.js +0 -8
  229. package/out/server/chunks/agent-D33nI7fP.js +0 -3924
  230. package/out/server/chunks/conversationsMove-CJZfkj55.js +0 -57
  231. package/out/server/chunks/dispatchModel-CsfmL396.js +0 -20
@@ -0,0 +1,787 @@
1
+ import { spawn, execFileSync } from "node:child_process";
2
+ import path from "node:path";
3
+ const MCP_TRANSPORTS = ["stdio", "http", "sse"];
4
+ const DEFAULT_PRESET_ID = "default";
5
+ const BUILTIN_AGENT_TYPES = [
6
+ {
7
+ name: "scout",
8
+ description: "Fast read-only recon; returns compressed findings",
9
+ systemPrompt: "You are a fast reconnaissance agent. Read and search only — never modify files or run commands with side effects. Return a compact, well-structured report of findings with concrete file paths.",
10
+ tools: "readonly",
11
+ modelMode: "agent_pick"
12
+ },
13
+ {
14
+ name: "worker",
15
+ description: "Implements a self-contained coding subtask end to end",
16
+ systemPrompt: "You are an implementation agent. Complete the assigned coding subtask end to end: read the relevant code, make the changes, and verify them (typecheck/tests where available). Report what you changed and any follow-ups.",
17
+ tools: "all",
18
+ modelMode: "agent_pick"
19
+ },
20
+ {
21
+ name: "reviewer",
22
+ description: "Reviews code or diffs; read-only, returns prioritized issues",
23
+ systemPrompt: "You are a code review agent. Read the relevant code or diff and return a prioritized list of concrete issues (correctness first), each with file:line and a suggested fix. Do not modify anything.",
24
+ tools: "readonly",
25
+ modelMode: "agent_pick"
26
+ },
27
+ {
28
+ name: "tester",
29
+ description: "Writes failing tests first (TDD RED); can only write test files, never implementation",
30
+ systemPrompt: "You are a test-first author. Write failing tests that pin down the contract described in the task, run them and confirm each fails because the behavior is missing (not because of a typo). Never write or edit implementation files — only test files (the toolset enforces this). Read specs, type contracts and existing tests; avoid reading the implementation body of the module under test so the tests stay independent of it. Do only the slice in this turn — do not expand to adjacent modules or the rest of the PRD. After the slice is red for the right reason, stop and wait for the parent to send the next slice or a green audit. Report the test files, case counts, and the exact failure reasons.",
31
+ tools: "all",
32
+ writeScope: ["**/*.test.ts", "**/*.test.tsx", "**/*.spec.ts", "**/*.spec.tsx", "test/**"],
33
+ modelMode: "agent_pick"
34
+ }
35
+ ];
36
+ const LEGACY_ENSO_TYPE_KEY = "agent:enso";
37
+ const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
38
+ const BUILTIN_NAME_PATTERN = /^[a-z][a-z0-9_-]*$/;
39
+ const RESERVED_AGENT_NAMES = {
40
+ enso: true,
41
+ [LEGACY_ENSO_TYPE_KEY]: true,
42
+ "enso-locked-v1": true,
43
+ "enso-system-v1": true
44
+ };
45
+ const RESERVED_AGENT_PREFIXES = [
46
+ "agent:",
47
+ "builtin:",
48
+ "custom:",
49
+ "builtin-agent:",
50
+ "bot:"
51
+ ];
52
+ function isUuid(value) {
53
+ return typeof value === "string" && UUID_PATTERN.test(value);
54
+ }
55
+ function normalizeAgentTypeName(value) {
56
+ return value.normalize("NFKC").trim().toLocaleLowerCase("en-US");
57
+ }
58
+ function isReservedAgentTypeName(value) {
59
+ const normalized = normalizeAgentTypeName(value);
60
+ return !normalized || Object.hasOwn(RESERVED_AGENT_NAMES, normalized) || RESERVED_AGENT_PREFIXES.some((prefix) => normalized.startsWith(prefix));
61
+ }
62
+ function isValidLegacyProfile(typeKey, profileId) {
63
+ return typeKey === LEGACY_ENSO_TYPE_KEY ? profileId === "enso-locked-v1" : profileId === void 0;
64
+ }
65
+ function parseAgentTypeKey(value) {
66
+ if (value === LEGACY_ENSO_TYPE_KEY) return LEGACY_ENSO_TYPE_KEY;
67
+ if (typeof value !== "string") return null;
68
+ if (value.startsWith("builtin:")) {
69
+ const name = value.slice("builtin:".length);
70
+ return BUILTIN_NAME_PATTERN.test(name) && name !== "general" && name !== "enso" ? value : null;
71
+ }
72
+ if (value.startsWith("custom:")) {
73
+ return isUuid(value.slice("custom:".length)) ? value : null;
74
+ }
75
+ if (value.startsWith("bot:")) {
76
+ return isUuid(value.slice("bot:".length)) ? value : null;
77
+ }
78
+ return null;
79
+ }
80
+ function parseSessionIdentity(value) {
81
+ if (!value || typeof value !== "object" || Array.isArray(value)) return null;
82
+ const identity = value;
83
+ if (Object.keys(identity).length !== 2 || typeof identity.sessionId !== "string" || !identity.sessionId || !isUuid(identity.generation)) {
84
+ return null;
85
+ }
86
+ return { sessionId: identity.sessionId, generation: identity.generation };
87
+ }
88
+ function parseChildSessionIdentity(value) {
89
+ if (!value || typeof value !== "object" || Array.isArray(value)) return null;
90
+ const identity = value;
91
+ const allowed = [
92
+ "sessionId",
93
+ "generation",
94
+ "parent",
95
+ "instanceId",
96
+ "instanceName",
97
+ "typeKey",
98
+ "profileId"
99
+ ];
100
+ if (Object.keys(identity).length < 6 || Object.keys(identity).some((key) => !allowed.includes(key))) {
101
+ return null;
102
+ }
103
+ const own = parseSessionIdentity({
104
+ sessionId: identity.sessionId,
105
+ generation: identity.generation
106
+ });
107
+ const parent = parseSessionIdentity(identity.parent);
108
+ const typeKey = parseAgentTypeKey(identity.typeKey);
109
+ if (!own || !parent || !isUuid(identity.instanceId) || typeof identity.instanceName !== "string" || !identity.instanceName || !typeKey || own.sessionId === parent.sessionId || own.generation === parent.generation || !isValidLegacyProfile(typeKey, identity.profileId)) {
110
+ return null;
111
+ }
112
+ return identity;
113
+ }
114
+ function isSameChildSessionIdentity(expected, value) {
115
+ const actual = parseChildSessionIdentity(value);
116
+ return actual !== null && actual.sessionId === expected.sessionId && actual.generation === expected.generation && actual.parent.sessionId === expected.parent.sessionId && actual.parent.generation === expected.parent.generation && actual.instanceId === expected.instanceId && actual.typeKey === expected.typeKey && actual.profileId === expected.profileId;
117
+ }
118
+ function visibleMemberAgentTypes(members, customAgentTypes) {
119
+ const taken = new Set(
120
+ [...BUILTIN_AGENT_TYPES, ...customAgentTypes].map((entry) => normalizeAgentTypeName(entry.name))
121
+ );
122
+ return members.filter((member) => {
123
+ const name = normalizeAgentTypeName(member.name);
124
+ if (!isUuid(member.id) || isReservedAgentTypeName(name) || taken.has(name)) return false;
125
+ taken.add(name);
126
+ return true;
127
+ });
128
+ }
129
+ function buildAgentTypeRegistrySnapshot(input) {
130
+ const disabled = new Set(input.disabledBuiltinAgentTypes);
131
+ const overriddenNames = new Set(
132
+ input.customAgentTypes.filter((entry) => isUuid(entry.id) && !isReservedAgentTypeName(entry.name)).map((entry) => entry.name.trim().toLowerCase())
133
+ );
134
+ const candidates = [];
135
+ for (const builtin of BUILTIN_AGENT_TYPES) {
136
+ if (builtin.name === "general" || builtin.name === "enso" || disabled.has(builtin.name) || overriddenNames.has(builtin.name)) {
137
+ continue;
138
+ }
139
+ candidates.push({
140
+ typeKey: `builtin:${builtin.name}`,
141
+ displayName: builtin.name,
142
+ description: builtin.description,
143
+ source: "builtin",
144
+ locked: false,
145
+ canDisable: true,
146
+ canEdit: false
147
+ });
148
+ }
149
+ for (const custom of input.customAgentTypes) {
150
+ if (!isUuid(custom.id) || isReservedAgentTypeName(custom.name)) continue;
151
+ candidates.push({
152
+ typeKey: `custom:${custom.id}`,
153
+ displayName: custom.name.trim(),
154
+ description: custom.description,
155
+ source: "custom",
156
+ locked: false,
157
+ canDisable: false,
158
+ canEdit: true
159
+ });
160
+ }
161
+ for (const member of visibleMemberAgentTypes(input.members ?? [], input.customAgentTypes)) {
162
+ candidates.push({
163
+ typeKey: `bot:${member.id}`,
164
+ displayName: member.name.trim(),
165
+ description: member.description,
166
+ source: "bot",
167
+ locked: false,
168
+ canDisable: false,
169
+ canEdit: false
170
+ });
171
+ }
172
+ return { revision: input.revision, candidates };
173
+ }
174
+ const PLUGIN_EVENTS = [
175
+ "session_start",
176
+ "session_end",
177
+ "agent_start",
178
+ "agent_end",
179
+ "before_compact",
180
+ "after_compact",
181
+ "tool_call",
182
+ "tool_result",
183
+ "input",
184
+ "context_usage",
185
+ "session_status",
186
+ "model_select",
187
+ "before_agent_start"
188
+ ];
189
+ const HOST_PLUGIN_EVENTS = ["session_status"];
190
+ const isHostPluginEvent = (event) => HOST_PLUGIN_EVENTS.includes(event);
191
+ const AGENT_END_TEXT_MAX = 64 * 1024;
192
+ const CONTEXT_USAGE_BUCKETS = [
193
+ "system",
194
+ "instructions",
195
+ "skills",
196
+ "tools",
197
+ "conversation",
198
+ "compaction",
199
+ "reminders"
200
+ ];
201
+ const CONTEXT_PART_KINDS = [
202
+ "system",
203
+ "tools",
204
+ "skills",
205
+ "memory",
206
+ "files",
207
+ "results",
208
+ "chat"
209
+ ];
210
+ const CONTEXT_PART_ITEMS = 24;
211
+ const PLUGIN_INTERCEPT_EVENTS = [
212
+ "tool_call",
213
+ "tool_result",
214
+ "input",
215
+ "before_agent_start"
216
+ ];
217
+ const APPEND_ONLY_INTERCEPT_EVENTS = ["before_agent_start"];
218
+ const BEFORE_AGENT_START_APPEND_MAX = 16 * 1024;
219
+ const BEFORE_AGENT_START_PROMPT_MAX = 64 * 1024;
220
+ const BEFORE_COMPACT_TIMEOUT_MS = 1e4;
221
+ const INTERCEPT_TIMEOUT_MS = 5e3;
222
+ const INTERCEPT_TOTAL_TIMEOUT_MS = 25e3;
223
+ const CHILD_INTERCEPT_EVENTS = [
224
+ "tool_call"
225
+ ];
226
+ const CHILD_INTERCEPT_TIMEOUT_MS = 2e3;
227
+ const CHILD_INTERCEPT_TOTAL_TIMEOUT_MS = 5e3;
228
+ const OBSERVE_TIMEOUT_MS = 3e4;
229
+ const isInterceptEvent = (event) => PLUGIN_INTERCEPT_EVENTS.includes(event);
230
+ const isChildInterceptEvent = (event) => CHILD_INTERCEPT_EVENTS.includes(event);
231
+ const isRecord$1 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
232
+ function initialInterceptState(event, payload) {
233
+ const result = event === "input" ? { action: "continue" } : {};
234
+ return { event, payload, result, done: false };
235
+ }
236
+ function applyInterceptResult(state, raw) {
237
+ if (state.done || !isRecord$1(raw)) return state;
238
+ if (state.event === "tool_call") {
239
+ const payload = state.payload;
240
+ const result = { ...state.result };
241
+ if (raw.block === true) {
242
+ return {
243
+ ...state,
244
+ done: true,
245
+ result: {
246
+ ...result,
247
+ block: true,
248
+ ...typeof raw.reason === "string" ? { reason: raw.reason.slice(0, 2e3) } : {}
249
+ }
250
+ };
251
+ }
252
+ if (!isRecord$1(raw.input)) return state;
253
+ return {
254
+ ...state,
255
+ payload: { ...payload, input: raw.input },
256
+ result: { ...result, input: raw.input }
257
+ };
258
+ }
259
+ if (state.event === "tool_result") {
260
+ const payload = state.payload;
261
+ const result = { ...state.result };
262
+ const nextPayload = { ...payload };
263
+ if (typeof raw.content === "string") {
264
+ result.content = raw.content;
265
+ nextPayload.content = raw.content;
266
+ }
267
+ if (typeof raw.isError === "boolean") {
268
+ result.isError = raw.isError;
269
+ nextPayload.isError = raw.isError;
270
+ }
271
+ return {
272
+ ...state,
273
+ payload: nextPayload,
274
+ result
275
+ };
276
+ }
277
+ if (state.event === "before_agent_start") {
278
+ if (typeof raw.append !== "string" || raw.append.length === 0) return state;
279
+ const previous = state.result.append;
280
+ const append = (previous ? `${previous}
281
+
282
+ ${raw.append}` : raw.append).slice(
283
+ 0,
284
+ BEFORE_AGENT_START_APPEND_MAX
285
+ );
286
+ return { ...state, result: { append } };
287
+ }
288
+ if (raw.action === "handled")
289
+ return { ...state, done: true, result: { action: "handled" } };
290
+ if (raw.action === "transform" && typeof raw.text === "string") {
291
+ return {
292
+ ...state,
293
+ payload: { ...state.payload, text: raw.text },
294
+ result: { action: "transform", text: raw.text }
295
+ };
296
+ }
297
+ return state;
298
+ }
299
+ function failClosedResult(event, pluginName) {
300
+ const reason = `插件 ${pluginName} 未能完成检查,已按其策略拒绝`;
301
+ if (event === "tool_call") return { block: true, reason };
302
+ if (event === "tool_result") return { content: reason, isError: true };
303
+ if (event === "before_agent_start") return {};
304
+ return { action: "handled" };
305
+ }
306
+ const PLUGIN_INJECT_MAX_CHARS = 32 * 1024;
307
+ const PLUGIN_INJECT_WIRE_MAX_CHARS = PLUGIN_INJECT_MAX_CHARS + 4 * 1024;
308
+ const PLUGIN_PROGRESS_MAX_CHARS = 16 * 1024;
309
+ const PLUGIN_INJECT_MAX_IMAGES = 4;
310
+ const PLUGIN_INJECT_IMAGE_MAX_CHARS = 7 * 1024 * 1024;
311
+ const PLUGIN_IMAGE_MIME = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/webp", "image/gif"]);
312
+ function parsePluginInjectImages(value) {
313
+ if (value === void 0) return [];
314
+ if (!Array.isArray(value) || value.length > PLUGIN_INJECT_MAX_IMAGES) return null;
315
+ const images = [];
316
+ for (const item of value) {
317
+ if (typeof item !== "object" || item === null) return null;
318
+ const { data, mimeType } = item;
319
+ if (typeof mimeType !== "string" || !PLUGIN_IMAGE_MIME.has(mimeType)) return null;
320
+ if (typeof data !== "string" || data.length === 0 || data.length > PLUGIN_INJECT_IMAGE_MAX_CHARS || !/^[A-Za-z0-9+/]+={0,2}$/.test(data))
321
+ return null;
322
+ images.push({ data, mimeType });
323
+ }
324
+ return images;
325
+ }
326
+ const SENDER_CHANNEL = /^[a-zA-Z0-9._:-]{1,64}$/;
327
+ function isSenderRecord(value) {
328
+ return typeof value === "object" && value !== null && !Array.isArray(value);
329
+ }
330
+ function parseSenderId(value) {
331
+ if (value === void 0) return void 0;
332
+ if (typeof value === "number") {
333
+ if (!Number.isSafeInteger(value)) return null;
334
+ return String(value);
335
+ }
336
+ if (typeof value !== "string") return null;
337
+ const trimmed = value.trim();
338
+ if (trimmed.length < 1 || trimmed.length > 128) return null;
339
+ return trimmed;
340
+ }
341
+ function parsePluginInjectSender(value) {
342
+ if (value === void 0) return void 0;
343
+ if (!isSenderRecord(value)) return null;
344
+ if (typeof value.channel !== "string" || !SENDER_CHANNEL.test(value.channel.trim())) return null;
345
+ const userId = parseSenderId(value.userId);
346
+ if (userId === null) return null;
347
+ const chatId = parseSenderId(value.chatId);
348
+ if (chatId === null) return null;
349
+ if (value.displayName !== void 0 && typeof value.displayName !== "string") return null;
350
+ const displayName = typeof value.displayName === "string" ? value.displayName.trim().slice(0, 128) : "";
351
+ return {
352
+ channel: value.channel.trim(),
353
+ ...userId ? { userId } : {},
354
+ ...chatId ? { chatId } : {},
355
+ ...displayName ? { displayName } : {}
356
+ };
357
+ }
358
+ function parsePluginInjectOrigin(value) {
359
+ return value === "owner" || value === "external" ? value : void 0;
360
+ }
361
+ const PLUGIN_MESSAGE_TYPE = "enso-plugin-message";
362
+ const PLUGIN_AGENT_PROMPT_MAX_CHARS = 64 * 1024;
363
+ const PLUGIN_AGENT_SYSTEM_MAX_CHARS = 32 * 1024;
364
+ const PLUGIN_AGENT_DEFAULT_TIMEOUT_MS = 10 * 6e4;
365
+ const PLUGIN_AGENT_MAX_TIMEOUT_MS = 20 * 6e4;
366
+ const PLUGIN_AGENT_TEXT_MAX_CHARS = 64 * 1024;
367
+ const PLUGIN_AGENT_ARGS_MAX_CHARS = 4096;
368
+ const PLUGIN_AGENT_OUTPUT_MAX_CHARS = 4096;
369
+ const PLUGIN_AGENT_RUN_ID = /^[A-Za-z0-9_-]{1,64}$/;
370
+ function parsePluginAgentRunEvent(raw) {
371
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) return null;
372
+ const v = raw;
373
+ const keys = Object.keys(v);
374
+ const only = (...allowed) => keys.every((key) => allowed.includes(key));
375
+ const short = (s, max) => typeof s === "string" && s.length <= max;
376
+ const id = (s) => typeof s === "string" && s.length > 0 && s.length <= 256;
377
+ switch (v.type) {
378
+ case "tool-start":
379
+ return only("type", "id", "name", "args", "parentId") && id(v.id) && id(v.name) && short(v.args, PLUGIN_AGENT_ARGS_MAX_CHARS) && (v.parentId === void 0 || id(v.parentId)) ? {
380
+ type: "tool-start",
381
+ id: v.id,
382
+ name: v.name,
383
+ args: v.args,
384
+ ...v.parentId ? { parentId: v.parentId } : {}
385
+ } : null;
386
+ case "tool-end":
387
+ return only("type", "id", "isError", "output") && id(v.id) && typeof v.isError === "boolean" && (v.output === void 0 || short(v.output, PLUGIN_AGENT_OUTPUT_MAX_CHARS)) ? {
388
+ type: "tool-end",
389
+ id: v.id,
390
+ isError: v.isError,
391
+ ...v.output !== void 0 ? { output: v.output } : {}
392
+ } : null;
393
+ case "text":
394
+ return only("type", "text") && short(v.text, PLUGIN_AGENT_TEXT_MAX_CHARS) ? { type: "text", text: v.text } : null;
395
+ case "end":
396
+ if (v.ok === true)
397
+ return only("type", "ok", "text", "model") && short(v.text, PLUGIN_AGENT_TEXT_MAX_CHARS) && (v.model === void 0 || id(v.model)) ? { type: "end", ok: true, text: v.text, ...v.model ? { model: v.model } : {} } : null;
398
+ return v.ok === false && only("type", "ok", "error", "aborted") && typeof v.error === "string" && v.error.length > 0 && v.error.length <= 4096 && (v.aborted === void 0 || v.aborted === true) ? { type: "end", ok: false, error: v.error, ...v.aborted ? { aborted: true } : {} } : null;
399
+ default:
400
+ return null;
401
+ }
402
+ }
403
+ const PLUGIN_ID = /^[a-z][a-z0-9]*(\.[a-z0-9]+)+$/;
404
+ function parsePluginMessageSource(raw) {
405
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) return null;
406
+ const { pluginId, pluginName } = raw;
407
+ if (typeof pluginId !== "string" || pluginId.length > 40 || !PLUGIN_ID.test(pluginId))
408
+ return null;
409
+ if (typeof pluginName !== "string" || pluginName.length === 0 || pluginName.length > 60)
410
+ return null;
411
+ return { pluginId, pluginName };
412
+ }
413
+ function parsePluginAgentSource(raw, ownerSessionId) {
414
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) return null;
415
+ const value = raw;
416
+ if (Object.keys(value).some((key) => !["kind", "sessionId", "name", "agentType"].includes(key)))
417
+ return null;
418
+ const { kind, sessionId, name, agentType } = value;
419
+ if (kind !== "subagent" && kind !== "coworker") return null;
420
+ if (sessionId !== ownerSessionId || !ownerSessionId.includes("::")) return null;
421
+ if (typeof name !== "string" || name.length === 0 || name.length > 128) return null;
422
+ if (agentType !== void 0 && (typeof agentType !== "string" || agentType.length === 0 || agentType.length > 128))
423
+ return null;
424
+ return { kind, sessionId, name, ...agentType !== void 0 ? { agentType } : {} };
425
+ }
426
+ const PLUGIN_HOST_APIS = [
427
+ "fs.readText",
428
+ "fs.writeText",
429
+ "net.fetch",
430
+ "ui.notify",
431
+ /** 推一条事件到本插件已打开的侧栏页面;args { name, data } */
432
+ "ui.viewEvent",
433
+ /** 打开右侧栏并创建或定位到本插件的侧栏页面;args { viewId? } */
434
+ "ui.viewOpen",
435
+ "ui.viewClose",
436
+ /** 改清单声明过的输入框底栏状态项;args { id, text?, tooltip?, tone?, visible? } */
437
+ "ui.statusUpdate",
438
+ "composer.readDraft",
439
+ "composer.insertText",
440
+ "composer.replaceDraft",
441
+ "config.get",
442
+ "mcp.tools",
443
+ "mcp.call",
444
+ /** 工具执行中上报进度;args { text } */
445
+ "tool.progress",
446
+ /** 写一份产出文件;args { name, text | base64, mime? },返回 { id, name, size, mime } */
447
+ "artifact.write",
448
+ /** 向会话注入消息;args { sessionId?, text, images?, deliverAs?, triggerTurn?, trusted? } */
449
+ "session.inject",
450
+ /** 认领一个外部对象;args { key, sessionId?, label?, group?, subscribedAt?, candidates? } */
451
+ "claims.claim",
452
+ /** 续期自己持有的认领;args { key, sessionId? } */
453
+ "claims.renew",
454
+ /** 释放自己持有的认领;args { key, sessionId? } */
455
+ "claims.release",
456
+ /** 列出未过期认领;args { prefix?, sessionId?, pluginId? } */
457
+ "claims.list",
458
+ /** 登记一条需求线程;args { source, sessionId, subagentId?, secretaryId?, pr? } */
459
+ "threads.open",
460
+ /** 把 PR 绑到需求线程;args { threadId? , sessionId?, pr } */
461
+ "threads.bindPr",
462
+ /** 把 PR 事件只投给负责会话;args 即事件 */
463
+ "threads.routePrEvent",
464
+ /** 列出需求线程;args { status?, sessionId?, repo?, activeOnly? } */
465
+ "threads.list",
466
+ /** 中止会话当前一轮;args { sessionId? },权限同 session.inject */
467
+ "session.abort",
468
+ /** 调用其他插件导出的方法;args { pluginId, name, args } */
469
+ "plugin.call",
470
+ "ui.clipboard",
471
+ "ui.openExternal",
472
+ /** 运行期增减工具与命令;args { kind, name, ...meta } */
473
+ "contrib.register",
474
+ "contrib.unregister",
475
+ /** 宿主能力探测 */
476
+ "host.capabilities",
477
+ /** 秘书联系方式:注册渠道实现;args { channelId, caps } */
478
+ "contact.register",
479
+ /** 渠道收到一句话;args { channelId, peerId, text, senderId?, chatType?, chatTitle?, name?, at? } */
480
+ "contact.inbound",
481
+ /** 渠道状态;args { channelId, status, detail?, peers? } */
482
+ "contact.setStatus",
483
+ /** 列出会话及其状态;args { scope? }:缺省同项目,'all' 为所有项目(需 session.readAll);返回 { current, sessions } */
484
+ "session.list",
485
+ /** 会话汇总状态;args { sessionId? } 缺省发起会话,返回 { sessionId, state, pendingAsks, pendingApprovals } */
486
+ "session.status",
487
+ /** 切换到会话;args { sessionId },需用户手势 */
488
+ "session.focus",
489
+ /** 切到会话并展开某个子代理的详情;args { sessionId, agentId },需用户手势 */
490
+ "session.focusSubagent",
491
+ /** 打开某个子会话的历史弹窗;args { parentId, childId },需用户手势 */
492
+ "session.openChildRun",
493
+ /** 在发起会话的项目里新建会话并切过去;args { text?, presetId? },presetId 只能填本插件的预设 */
494
+ "session.create",
495
+ /** 开关本进程的回合结束订阅;args { on },权限同 session.status */
496
+ "session.watchTurnEnd",
497
+ /** 用发起会话的模型跑一个只读代理;args { runId, prompt, systemPrompt?, context?, timeoutMs? },进度与结果经 agent-run 推送 */
498
+ "agent.run",
499
+ /** 取消本插件发起的代理;args { runId } */
500
+ "agent.cancel"
501
+ ];
502
+ function pluginFailureLogLevel(error, context = {}) {
503
+ const { code, expected } = error ?? {};
504
+ if (context.aborted || code === "ABORTED") return "debug";
505
+ if (context.stopped && code === "PLUGIN_EXITED") return "debug";
506
+ return expected === true ? "info" : "error";
507
+ }
508
+ const PREFIX = "plugin_";
509
+ const SEPARATOR = "__";
510
+ const EXTERNAL = /^plugin_([a-z][a-z0-9]*(?:-[a-z0-9]+)+)__([a-z][a-z0-9_]*)$/;
511
+ function pluginToolName(pluginId, toolName) {
512
+ return `${PREFIX}${pluginId.replaceAll(".", "-")}${SEPARATOR}${toolName}`;
513
+ }
514
+ function parsePluginToolName(name) {
515
+ const match = EXTERNAL.exec(name);
516
+ if (!match?.[1] || !match[2] || match[2].includes(SEPARATOR)) return null;
517
+ return { pluginId: match[1].replaceAll("-", "."), toolName: match[2] };
518
+ }
519
+ const WORKFLOW_PRESET_ID_RE = /^[a-z0-9][a-z0-9-]{0,63}$/;
520
+ const MAX_DISABLED_WORKFLOW_PRESETS = 64;
521
+ function isWorkflowPresetId(id) {
522
+ return WORKFLOW_PRESET_ID_RE.test(id);
523
+ }
524
+ function parseDisabledWorkflowPresets(value) {
525
+ if (!Array.isArray(value)) return [];
526
+ const ids = value.filter((id) => typeof id === "string" && isWorkflowPresetId(id));
527
+ return [...new Set(ids)].slice(0, MAX_DISABLED_WORKFLOW_PRESETS);
528
+ }
529
+ const RUN_STATUSES = /* @__PURE__ */ new Set(["running", "completed", "failed", "cancelled"]);
530
+ const MEMBER_STATUSES = /* @__PURE__ */ new Set(["running", "completed", "failed"]);
531
+ function isRecord(value) {
532
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
533
+ }
534
+ function bounded(value, max) {
535
+ if (typeof value !== "string") return null;
536
+ const text = value.trim();
537
+ if (!text || text.length > max) return null;
538
+ return text;
539
+ }
540
+ function parseWorkflowRunSnapshot(value) {
541
+ if (!isRecord(value)) return null;
542
+ const runId = bounded(value.runId, 80);
543
+ const name = bounded(value.name, 80);
544
+ const description = bounded(value.description, 240);
545
+ if (!runId || !name || !description || !RUN_STATUSES.has(value.status)) {
546
+ return null;
547
+ }
548
+ const phase = value.phase === void 0 ? void 0 : bounded(value.phase, 80);
549
+ if (value.phase !== void 0 && !phase) return null;
550
+ const error = value.error === void 0 ? void 0 : bounded(value.error, 400);
551
+ if (value.error !== void 0 && !error) return null;
552
+ if (!Array.isArray(value.logs) || value.logs.length > 20) return null;
553
+ const logs = [];
554
+ for (const line of value.logs) {
555
+ const text = bounded(line, 160);
556
+ if (!text) return null;
557
+ logs.push(text);
558
+ }
559
+ if (!Array.isArray(value.members) || value.members.length > 32) return null;
560
+ const members = [];
561
+ for (const member of value.members) {
562
+ if (!isRecord(member) || !Number.isInteger(member.seq) || member.seq < 1) {
563
+ return null;
564
+ }
565
+ const label = bounded(member.label, 80);
566
+ const memberPhase = member.phase === void 0 ? void 0 : bounded(member.phase, 80);
567
+ const prompt = member.prompt === void 0 ? void 0 : bounded(member.prompt, 160);
568
+ const result = member.result === void 0 ? void 0 : bounded(member.result, 160);
569
+ const childId = member.childId === void 0 ? void 0 : bounded(member.childId, 80);
570
+ if (!label || !MEMBER_STATUSES.has(member.status)) return null;
571
+ if (member.phase !== void 0 && !memberPhase) return null;
572
+ if (!Number.isInteger(member.batch) || member.batch < 1) return null;
573
+ if (member.prompt !== void 0 && !prompt) return null;
574
+ if (member.result !== void 0 && !result) return null;
575
+ if (member.childId !== void 0 && !childId) return null;
576
+ members.push({
577
+ seq: member.seq,
578
+ label,
579
+ batch: member.batch,
580
+ status: member.status,
581
+ ...memberPhase ? { phase: memberPhase } : {},
582
+ ...prompt ? { prompt } : {},
583
+ ...result ? { result } : {},
584
+ ...childId ? { childId } : {}
585
+ });
586
+ }
587
+ return {
588
+ runId,
589
+ name,
590
+ description,
591
+ status: value.status,
592
+ logs,
593
+ members,
594
+ ...phase ? { phase } : {},
595
+ ...error ? { error } : {}
596
+ };
597
+ }
598
+ function listProcesses() {
599
+ try {
600
+ return execFileSync("ps", ["-axo", "pid=,ppid=,pgid="], {
601
+ encoding: "utf8",
602
+ stdio: ["ignore", "pipe", "ignore"],
603
+ timeout: 3e3
604
+ }).split("\n").flatMap((line) => {
605
+ const [pid, ppid, pgid] = line.trim().split(/\s+/).map(Number);
606
+ return pid > 0 && ppid >= 0 && pgid > 0 ? [{ pid, ppid, pgid }] : [];
607
+ });
608
+ } catch {
609
+ return [];
610
+ }
611
+ }
612
+ function treeGroups(rootPid, table, known = /* @__PURE__ */ new Set(), selfPid = process.pid) {
613
+ const children = /* @__PURE__ */ new Map();
614
+ const members = /* @__PURE__ */ new Map();
615
+ for (const entry of table) {
616
+ children.set(entry.ppid, [...children.get(entry.ppid) ?? [], entry]);
617
+ members.set(entry.pgid, [...members.get(entry.pgid) ?? [], entry]);
618
+ }
619
+ const own = table.find((entry) => entry.pid === selfPid)?.pgid;
620
+ const groups = /* @__PURE__ */ new Set();
621
+ const seen = /* @__PURE__ */ new Set();
622
+ const queue = [];
623
+ const visit = (pid) => {
624
+ if (seen.has(pid)) return;
625
+ seen.add(pid);
626
+ queue.push(pid);
627
+ };
628
+ const addGroup = (group) => {
629
+ if (group <= 1 || group === own || groups.has(group)) return;
630
+ groups.add(group);
631
+ for (const entry of members.get(group) ?? []) visit(entry.pid);
632
+ };
633
+ addGroup(rootPid);
634
+ visit(rootPid);
635
+ for (const group of known) if (members.has(group)) addGroup(group);
636
+ while (queue.length > 0) {
637
+ for (const child of children.get(queue.pop()) ?? []) {
638
+ addGroup(child.pgid);
639
+ visit(child.pid);
640
+ }
641
+ }
642
+ return [...groups];
643
+ }
644
+ function ownGroupDescendants(rootPid, table, selfPid = process.pid) {
645
+ const own = table.find((entry) => entry.pid === selfPid)?.pgid;
646
+ if (own === void 0) return [];
647
+ const children = /* @__PURE__ */ new Map();
648
+ for (const entry of table) children.set(entry.ppid, [...children.get(entry.ppid) ?? [], entry]);
649
+ const found = [];
650
+ const seen = /* @__PURE__ */ new Set([rootPid]);
651
+ const queue = [rootPid];
652
+ while (queue.length > 0) {
653
+ for (const child of children.get(queue.pop()) ?? []) {
654
+ if (seen.has(child.pid) || child.pid <= 1 || child.pid === selfPid) continue;
655
+ seen.add(child.pid);
656
+ queue.push(child.pid);
657
+ if (child.pgid === own) found.push(child.pid);
658
+ }
659
+ }
660
+ return found;
661
+ }
662
+ function signalProcessTree(rootPid, signal, known = /* @__PURE__ */ new Set(), deps = {}, fallback = () => {
663
+ try {
664
+ process.kill(rootPid, signal);
665
+ } catch {
666
+ }
667
+ }) {
668
+ const kill = deps.killGroup ?? ((pid, sig) => process.kill(pid, sig));
669
+ const send = (target, sig) => {
670
+ try {
671
+ kill(target, sig);
672
+ return true;
673
+ } catch {
674
+ return false;
675
+ }
676
+ };
677
+ const freeze = (deps.platform ?? process.platform) === "darwin" && signal === "SIGKILL";
678
+ if (freeze) send(-rootPid, "SIGSTOP");
679
+ const table = (deps.listProcesses ?? listProcesses)();
680
+ const groups = treeGroups(rootPid, table, known);
681
+ const strays = ownGroupDescendants(rootPid, table);
682
+ for (const group of groups) known.add(group);
683
+ if (freeze) {
684
+ for (const group of groups) send(-group, "SIGSTOP");
685
+ for (const pid of strays) send(pid, "SIGSTOP");
686
+ }
687
+ for (const group of groups) {
688
+ if (!send(-group, signal) && group === rootPid) fallback();
689
+ }
690
+ for (const pid of strays) send(pid, signal);
691
+ }
692
+ const knownGroups = /* @__PURE__ */ new WeakMap();
693
+ function killProcessTree(child, signal, deps = {}) {
694
+ const pid = child.pid;
695
+ const platform = deps.platform ?? process.platform;
696
+ const fallback = () => {
697
+ try {
698
+ child.kill(signal);
699
+ } catch {
700
+ }
701
+ };
702
+ if (pid === void 0) {
703
+ fallback();
704
+ return;
705
+ }
706
+ if (platform === "win32") {
707
+ try {
708
+ const root = deps.systemRoot ?? process.env.SystemRoot ?? "C:\\Windows";
709
+ const spawn$1 = deps.spawn ?? spawn;
710
+ spawn$1(path.win32.join(root, "System32", "taskkill.exe"), ["/pid", String(pid), "/T", "/F"], {
711
+ windowsHide: true,
712
+ stdio: "ignore"
713
+ }).on("error", fallback);
714
+ } catch {
715
+ fallback();
716
+ }
717
+ return;
718
+ }
719
+ const known = knownGroups.get(child) ?? /* @__PURE__ */ new Set();
720
+ knownGroups.set(child, known);
721
+ signalProcessTree(pid, signal, known, deps, fallback);
722
+ }
723
+ export {
724
+ parsePluginAgentSource as $,
725
+ AGENT_END_TEXT_MAX as A,
726
+ BEFORE_AGENT_START_PROMPT_MAX as B,
727
+ CONTEXT_PART_ITEMS as C,
728
+ initialInterceptState as D,
729
+ CHILD_INTERCEPT_TOTAL_TIMEOUT_MS as E,
730
+ CHILD_INTERCEPT_TIMEOUT_MS as F,
731
+ INTERCEPT_TIMEOUT_MS as G,
732
+ applyInterceptResult as H,
733
+ INTERCEPT_TOTAL_TIMEOUT_MS as I,
734
+ failClosedResult as J,
735
+ BEFORE_COMPACT_TIMEOUT_MS as K,
736
+ PLUGIN_PROGRESS_MAX_CHARS as L,
737
+ MCP_TRANSPORTS as M,
738
+ parseDisabledWorkflowPresets as N,
739
+ OBSERVE_TIMEOUT_MS as O,
740
+ PLUGIN_MESSAGE_TYPE as P,
741
+ visibleMemberAgentTypes as Q,
742
+ buildAgentTypeRegistrySnapshot as R,
743
+ DEFAULT_PRESET_ID as S,
744
+ PLUGIN_INJECT_WIRE_MAX_CHARS as T,
745
+ parseAgentTypeKey as U,
746
+ parsePluginAgentRunEvent as V,
747
+ isValidLegacyProfile as W,
748
+ parsePluginMessageSource as X,
749
+ parseWorkflowRunSnapshot as Y,
750
+ isInterceptEvent as Z,
751
+ PLUGIN_EVENTS as _,
752
+ parseSessionIdentity as a,
753
+ CONTEXT_PART_KINDS as a0,
754
+ parsePluginInjectOrigin as a1,
755
+ isWorkflowPresetId as a2,
756
+ LEGACY_ENSO_TYPE_KEY as a3,
757
+ PLUGIN_INTERCEPT_EVENTS as a4,
758
+ signalProcessTree as a5,
759
+ listProcesses as a6,
760
+ APPEND_ONLY_INTERCEPT_EVENTS as a7,
761
+ parsePluginInjectSender as b,
762
+ isChildInterceptEvent as c,
763
+ CONTEXT_USAGE_BUCKETS as d,
764
+ BEFORE_AGENT_START_APPEND_MAX as e,
765
+ isSameChildSessionIdentity as f,
766
+ PLUGIN_AGENT_ARGS_MAX_CHARS as g,
767
+ PLUGIN_AGENT_TEXT_MAX_CHARS as h,
768
+ isUuid as i,
769
+ PLUGIN_AGENT_OUTPUT_MAX_CHARS as j,
770
+ killProcessTree as k,
771
+ pluginFailureLogLevel as l,
772
+ pluginToolName as m,
773
+ isReservedAgentTypeName as n,
774
+ BUILTIN_AGENT_TYPES as o,
775
+ parseChildSessionIdentity as p,
776
+ PLUGIN_HOST_APIS as q,
777
+ PLUGIN_INJECT_MAX_CHARS as r,
778
+ PLUGIN_AGENT_RUN_ID as s,
779
+ PLUGIN_AGENT_PROMPT_MAX_CHARS as t,
780
+ PLUGIN_AGENT_SYSTEM_MAX_CHARS as u,
781
+ PLUGIN_AGENT_DEFAULT_TIMEOUT_MS as v,
782
+ PLUGIN_AGENT_MAX_TIMEOUT_MS as w,
783
+ parsePluginInjectImages as x,
784
+ isHostPluginEvent as y,
785
+ parsePluginToolName as z
786
+ };
787
+ //# sourceMappingURL=killTree-T-p6Lr3w.js.map