@agimon-ai/po-cloudflare 0.0.2-alpha.2 → 0.0.2-alpha.20

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 (260) hide show
  1. package/README.md +4 -3
  2. package/dist/abort-signals-2GUraIGq.js +34 -0
  3. package/dist/agent-DTjnYFAN.js +6850 -0
  4. package/dist/anthropic-messages-5ODquUB-.js +14317 -0
  5. package/dist/{apiContracts-CHOiCbS_.js → apiContracts-DepyzMNr.js} +94 -81
  6. package/dist/{approval-BMXqnTYd.js → approval-Biq3NCWj.js} +19 -3
  7. package/dist/{approvalPrompt-Bg1JrEEY.js → approvalPrompt-DoHlIPkU.js} +2 -2
  8. package/dist/assets/assets/{CodeEditorView-BnyZHaYM.js → CodeEditorView-BU8DeV_G.js} +2 -2
  9. package/dist/assets/assets/{abnfDiagram-WEYOIA3C-muME0eCj.js → abnfDiagram-WEYOIA3C-BkzARjqu.js} +2 -2
  10. package/dist/assets/assets/{architecture-WOLXFQ4H-DMnhK1WH.js → architecture-WOLXFQ4H-B_dgnlXa.js} +1 -1
  11. package/dist/assets/assets/{architectureDiagram-ZHVYKT53-DKn7XGP7.js → architectureDiagram-ZHVYKT53-DMGAifk0.js} +2 -2
  12. package/dist/assets/assets/{blockDiagram-RJAE7QA3-DtDctXZg.js → blockDiagram-RJAE7QA3-DwTSK4lj.js} +2 -2
  13. package/dist/assets/assets/{c4Diagram-XDPPPE54-23pGLJeP.js → c4Diagram-XDPPPE54-IRaOcC_u.js} +2 -2
  14. package/dist/assets/assets/channel-BXwM62E-.js +2 -0
  15. package/dist/assets/assets/{chunk-2E7WHVMD-BZ2nGNPa.js → chunk-2E7WHVMD-BvS46crW.js} +2 -2
  16. package/dist/assets/assets/{chunk-4EMNKR2T-Dui1SYFi.js → chunk-4EMNKR2T--n96Xbj0.js} +2 -2
  17. package/dist/assets/assets/{chunk-55XCU76K-CUB92Evl.js → chunk-55XCU76K-D3h_hFRi.js} +2 -2
  18. package/dist/assets/assets/{chunk-7S6XSTFO-CVayPHfE.js → chunk-7S6XSTFO-Cj18feJl.js} +2 -2
  19. package/dist/assets/assets/{chunk-AQDTSKZB---wakYqY.js → chunk-AQDTSKZB-DXsT43bg.js} +2 -2
  20. package/dist/assets/assets/{chunk-DSNLSHJZ-DfbdohUR.js → chunk-DSNLSHJZ-Br7dX7yf.js} +2 -2
  21. package/dist/assets/assets/{chunk-HAGFOTED-Dr4KRh-b.js → chunk-HAGFOTED-BcozAtPo.js} +2 -2
  22. package/dist/assets/assets/{chunk-HNE4Q36P-D06cR91Z.js → chunk-HNE4Q36P-B8kgXgRq.js} +2 -2
  23. package/dist/assets/assets/{chunk-NQOKRVIF-Ca4gLeDb.js → chunk-NQOKRVIF-Dn7UnsqE.js} +2 -2
  24. package/dist/assets/assets/{chunk-UHW7PFBP-DmL638jN.js → chunk-UHW7PFBP-BSJot0vi.js} +2 -2
  25. package/dist/assets/assets/{chunk-VQ5W62QI-pkxSW5Zj.js → chunk-VQ5W62QI-Cpf1EfZK.js} +2 -2
  26. package/dist/assets/assets/{chunk-WQQL4CDK-Dcc8hV4U.js → chunk-WQQL4CDK-Dnc36uZR.js} +2 -2
  27. package/dist/assets/assets/chunk-XXDRQBXY-C9Ka5KSI.js +2 -0
  28. package/dist/assets/assets/{chunk-YZO67HFG-B_HKcFrw.js → chunk-YZO67HFG-BV8_A7x3.js} +2 -2
  29. package/dist/assets/assets/{chunk-ZAUX2LTX-DAzZUysS.js → chunk-ZAUX2LTX-C4Ne_31B.js} +2 -2
  30. package/dist/assets/assets/{chunk-ZCHMQSOR-DAVgjymL.js → chunk-ZCHMQSOR-Dq9ModsA.js} +2 -2
  31. package/dist/assets/assets/{classDiagram-v2-4MYWR3UA-Fsw8TGPu.js → classDiagram-v2-4MYWR3UA-1BWEjXP9.js} +2 -2
  32. package/dist/assets/assets/{cose-bilkent-JH36ORCC-CgUbISYV.js → cose-bilkent-JH36ORCC-DREkvC_x.js} +2 -2
  33. package/dist/assets/assets/{cynefin-EF2NZ3EQ-D1LxAU2x.js → cynefin-EF2NZ3EQ-CWziP8nx.js} +1 -1
  34. package/dist/assets/assets/{cynefinDiagram-WF24UDRP-D54I1jil.js → cynefinDiagram-WF24UDRP-DOoYmcvz.js} +2 -2
  35. package/dist/assets/assets/{dagre-NK4GIZVX-DC7zL16U.js → dagre-NK4GIZVX-OoAtEico.js} +2 -2
  36. package/dist/assets/assets/{diagram-CBK3MWTC-DB0ptUdz.js → diagram-CBK3MWTC-B-pl2-iR.js} +2 -2
  37. package/dist/assets/assets/{diagram-I5XIIV2D-CozSftPJ.js → diagram-I5XIIV2D-uKzNJSZ2.js} +2 -2
  38. package/dist/assets/assets/{diagram-ODIL2UCW-g3WOEWDS.js → diagram-ODIL2UCW-CEXY_Tzu.js} +2 -2
  39. package/dist/assets/assets/{diagram-PFBEJUXE-CFxGeOYi.js → diagram-PFBEJUXE-MKlRQo-g.js} +2 -2
  40. package/dist/assets/assets/{diagram-RJA3I4VV-BQBsLche.js → diagram-RJA3I4VV-c2qlCEVs.js} +2 -2
  41. package/dist/assets/assets/{diagram-TYUNFSNR-DrjpW2yq.js → diagram-TYUNFSNR-DTdqLA6J.js} +2 -2
  42. package/dist/assets/assets/{dist-B3JXhDWV.js → dist-4TUOlkyl.js} +2 -2
  43. package/dist/assets/assets/{dist-1-mhYUBH.js → dist-BzTxJnSR.js} +2 -2
  44. package/dist/assets/assets/{dist-XIZum9n5.js → dist-D9lacOpq.js} +2 -2
  45. package/dist/assets/assets/{dist-gfbb4ygy.js → dist-DCKskbBE.js} +2 -2
  46. package/dist/assets/assets/{dist-h6SOnP8-.js → dist-DCc8tQ7G.js} +2 -2
  47. package/dist/assets/assets/{dist-Izr2SB3q.js → dist-DXlts_H5.js} +2 -2
  48. package/dist/assets/assets/{dist-DvgCCshF.js → dist-DvZCwSZ8.js} +2 -2
  49. package/dist/assets/assets/{dist-BabjcJ3j.js → dist-mQUN8X3n.js} +2 -2
  50. package/dist/assets/assets/{dist-DjL8d1jZ.js → dist-qZHwVT1x.js} +2 -2
  51. package/dist/assets/assets/{ebnfDiagram-V4P3TTPT-BZS_aAve.js → ebnfDiagram-V4P3TTPT-C89wxfCd.js} +2 -2
  52. package/dist/assets/assets/{elk-QONTBCTQ-B2ksVmMA.js → elk-QONTBCTQ-BMBgLOae.js} +2 -2
  53. package/dist/assets/assets/{erDiagram-KYQIGQAA-7P6zF-Z-.js → erDiagram-KYQIGQAA-Bb04CRa4.js} +2 -2
  54. package/dist/assets/assets/{eventmodeling-K75KTNOO-RoGQoRq-.js → eventmodeling-K75KTNOO-DSyNf2MV.js} +1 -1
  55. package/dist/assets/assets/flowDiagram-IUGLLWBU-DXuTqLUd.js +1 -0
  56. package/dist/assets/assets/{ganttDiagram-R7GPNTJY-CTOlRy7M.js → ganttDiagram-R7GPNTJY-sB7-pF_t.js} +2 -2
  57. package/dist/assets/assets/{gitGraph-VSP46ZUC-CPqytIt0.js → gitGraph-VSP46ZUC-pWPBCmdT.js} +1 -1
  58. package/dist/assets/assets/{gitGraphDiagram-PDYL7XHY-BffLxuxg.js → gitGraphDiagram-PDYL7XHY-DronDRed.js} +2 -2
  59. package/dist/assets/assets/index-CBNQEGK3.css +1 -0
  60. package/dist/assets/assets/index-DdAdCxGc.js +155 -0
  61. package/dist/assets/assets/{info-OHQRW6UA-BI8RK0Ow.js → info-OHQRW6UA-B375mT1i.js} +1 -1
  62. package/dist/assets/assets/{infoDiagram-MVDRKAX5-DUIst1FB.js → infoDiagram-MVDRKAX5-9Hw3wWP7.js} +2 -2
  63. package/dist/assets/assets/{ishikawaDiagram-HPEHV2GE-CA17Eho5.js → ishikawaDiagram-HPEHV2GE-CdPAuupk.js} +2 -2
  64. package/dist/assets/assets/{journeyDiagram-BOSHW7O7-CNri5Ap9.js → journeyDiagram-BOSHW7O7-hqmaHM9u.js} +2 -2
  65. package/dist/assets/assets/{kanban-definition-FNSA4HC5-DnXna7jO.js → kanban-definition-FNSA4HC5-BdOHplX4.js} +2 -2
  66. package/dist/assets/assets/{line-BsXJZn93.js → line-BCSC3Bu2.js} +2 -2
  67. package/dist/assets/assets/{linear-BHYaD5T0.js → linear-D5ddQU3r.js} +2 -2
  68. package/dist/assets/assets/{mermaid-parser.core-B64Eo-8a.js → mermaid-parser.core-BaSUi_Ph.js} +4 -4
  69. package/dist/assets/assets/{mermaid.core-Zw9qmTzg.js → mermaid.core-CUUsU9Ou.js} +5 -5
  70. package/dist/assets/assets/{mindmap-definition-6OY57UG3-E5qz4KNc.js → mindmap-definition-6OY57UG3-BtVkhvIZ.js} +2 -2
  71. package/dist/assets/assets/{packet-JDAUHWVQ-DgfizTr3.js → packet-JDAUHWVQ-CQ3OUDwI.js} +1 -1
  72. package/dist/assets/assets/{pegDiagram-ECIUJNBX-D0WK_agM.js → pegDiagram-ECIUJNBX-DDnq-Kn3.js} +2 -2
  73. package/dist/assets/assets/{pie-XZMESJXO-PJR1sXD4.js → pie-XZMESJXO-BvOFTkQB.js} +1 -1
  74. package/dist/assets/assets/{pieDiagram-GNMPY74T-CPuU-NTs.js → pieDiagram-GNMPY74T-Bdwhl9jD.js} +2 -2
  75. package/dist/assets/assets/{quadrantDiagram-D57K4MC3-5C9yjM1b.js → quadrantDiagram-D57K4MC3-GHKoDEeT.js} +2 -2
  76. package/dist/assets/assets/{radar-ABXABTNO-BspdXgl0.js → radar-ABXABTNO-Yk9rKkKW.js} +1 -1
  77. package/dist/assets/assets/{railroad-I3PHUGI6-Ct0a6hLD.js → railroad-I3PHUGI6-Crr2QEwm.js} +1 -1
  78. package/dist/assets/assets/{railroad-abnf-LNEFI6M7-fduYB4SA.js → railroad-abnf-LNEFI6M7-CLrgwBog.js} +1 -1
  79. package/dist/assets/assets/{railroad-ebnf-DWYD2UWJ-CTQa8Sww.js → railroad-ebnf-DWYD2UWJ-zWReI6MC.js} +1 -1
  80. package/dist/assets/assets/{railroad-peg-JR7BVNR7-DatoH3GJ.js → railroad-peg-JR7BVNR7-CnVnlaHi.js} +1 -1
  81. package/dist/assets/assets/{railroadDiagram-Y72NRBL7-C8sWN8l2.js → railroadDiagram-Y72NRBL7-MJ68mMla.js} +2 -2
  82. package/dist/assets/assets/{requirementDiagram-EQYSW5RA-CqRz4RcT.js → requirementDiagram-EQYSW5RA-BYb-mTCH.js} +2 -2
  83. package/dist/assets/assets/{sankeyDiagram-SY24JHO5-bdiuKKlX.js → sankeyDiagram-SY24JHO5-DzONJsqQ.js} +2 -2
  84. package/dist/assets/assets/{sequenceDiagram-BLEHNHQU-Zy-8I0Hy.js → sequenceDiagram-BLEHNHQU-0vav9YWV.js} +2 -2
  85. package/dist/assets/assets/{src-gihY33R9.js → src-DZJUnjaM.js} +2 -2
  86. package/dist/assets/assets/{stateDiagram-v2-A6IESKWZ-DXQERPvz.js → stateDiagram-v2-A6IESKWZ-B0M8THPh.js} +2 -2
  87. package/dist/assets/assets/{swimlanes-B3ENRKFQ-1gjZQElg.js → swimlanes-B3ENRKFQ-5YJZCHIB.js} +2 -2
  88. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-aJTRXiIU.js +9 -0
  89. package/dist/assets/assets/{timeline-definition-JXYKGLGB-CTeYEw-9.js → timeline-definition-JXYKGLGB-us1LwUHo.js} +2 -2
  90. package/dist/assets/assets/{treeView-D4JQ5SDB-DD-EsLLT.js → treeView-D4JQ5SDB-BSLlcDre.js} +1 -1
  91. package/dist/assets/assets/{treemap-SAJKECNS-BLdFeS5J.js → treemap-SAJKECNS-DZ2SwLmk.js} +1 -1
  92. package/dist/assets/assets/{usecaseDiagram-WPOLBNNX-C1GikSSP.js → usecaseDiagram-WPOLBNNX-BrmvO_6k.js} +2 -2
  93. package/dist/assets/assets/{vennDiagram-Q3Y3IDCW-B1FoA3g8.js → vennDiagram-Q3Y3IDCW-FKXSeKp5.js} +2 -2
  94. package/dist/assets/assets/{wardley-7MLQ67FV-BrHb5Bjf.js → wardley-7MLQ67FV-DZ_vIMp2.js} +1 -1
  95. package/dist/assets/assets/{wardleyDiagram-IVAIDKWA-CmPLD1X4.js → wardleyDiagram-IVAIDKWA-CfLYNckm.js} +2 -2
  96. package/dist/assets/assets/{webpack-BYWDFj_R.js → webpack-CiS_BB3R.js} +2 -2
  97. package/dist/assets/assets/{xychartDiagram-4URNHDU4-DR5pfEjl.js → xychartDiagram-4URNHDU4-DBucwhQh.js} +2 -2
  98. package/dist/assets/bundle-asset-policy.json +1 -1
  99. package/dist/assets/index.html +2 -2
  100. package/dist/assets/plugins/assets/base-C3j1WCCq.css +2 -0
  101. package/dist/assets/plugins/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2 +0 -0
  102. package/dist/assets/plugins/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2 +0 -0
  103. package/dist/assets/plugins/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2 +0 -0
  104. package/dist/assets/plugins/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
  105. package/dist/assets/plugins/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
  106. package/dist/assets/plugins/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2 +0 -0
  107. package/dist/assets/plugins/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
  108. package/dist/assets/plugins/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  109. package/dist/assets/plugins/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  110. package/dist/assets/plugins/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  111. package/dist/assets/plugins/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  112. package/dist/assets/plugins/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  113. package/dist/assets/plugins/chunks/po-web-runtime-Czm_C4SJ.js +1 -0
  114. package/dist/assets/plugins/compositions.json +1 -0
  115. package/dist/assets/plugins/slots/approval.3e4ea6e4-CqQk6XG_.js +2 -0
  116. package/dist/assets/plugins/slots/artifacts.84980c32-DQlO5IFk.js +1 -0
  117. package/dist/assets/plugins/slots/autocompact.ec8f713f-B3KTYwW1.js +1 -0
  118. package/dist/assets/plugins/slots/builtin-tools.16ef5e25-CZRYQVIP.js +7 -0
  119. package/dist/assets/plugins/slots/codemode.5f359b9c-Bzl_K_vt.js +10 -0
  120. package/dist/assets/plugins/slots/domain.832848c8-CvnpuKCY.js +1 -0
  121. package/dist/assets/plugins/slots/edit.7c802139-kaxIknZ-.js +7 -0
  122. package/dist/assets/plugins/slots/files.364f16c9-wuB8gcQA.js +2 -0
  123. package/dist/assets/plugins/slots/grep.d8bf9f57-3FnU8p-d.js +1 -0
  124. package/dist/assets/plugins/slots/log.07fd59a4-C0PXQ0O1.js +4 -0
  125. package/dist/assets/plugins/slots/mcp.ea8b6aa2-D0CkHnIw.js +109 -0
  126. package/dist/assets/plugins/slots/profile.63bc3ae6-BSY3iYfJ.js +1 -0
  127. package/dist/assets/plugins/slots/prompts.9d9b47cc-xdCkNkoA.js +3 -0
  128. package/dist/assets/plugins/slots/read.926c024f-qqaxVlEX.js +1 -0
  129. package/dist/assets/plugins/slots/runner.5393fa6c-DfO2Z9HG.js +8 -0
  130. package/dist/assets/plugins/slots/skill.56c1cc07-CL_n-l4h.js +4 -0
  131. package/dist/assets/plugins/slots/vault.587549ba-DbG3F_on.js +1 -0
  132. package/dist/assets/pwa/pwa.js +12 -12
  133. package/dist/assets/pwa/sw.js +4 -4
  134. package/dist/{atomicJson-BJfPFSYF.js → atomicJson-DCIsEywH.js} +3 -3
  135. package/dist/azure-openai-config-COZUaRzM.js +55 -0
  136. package/dist/azure-openai-responses-Cs4k2HOd.js +183 -0
  137. package/dist/{backgroundWork-CeFrbRnj.js → backgroundWork-Bswjs1av.js} +1 -1
  138. package/dist/browser-BWf8OMfl.js +3 -0
  139. package/dist/childSession-Cf2-kH4O.js +22 -0
  140. package/dist/classifier-shared-IhSH9hhh.js +106 -0
  141. package/dist/cloudflare-workers-ai-system-one-BNnc8MuH.js +52 -0
  142. package/dist/{codemode-DbPu0yJN.js → codemode-CgVosRtU.js} +5 -2
  143. package/dist/contracts-CylyLZC8.js +19 -0
  144. package/dist/diagnostics-1lYFeSJe.js +131 -0
  145. package/dist/{server-D3PQk1Gt.js → dist-B-vqs6tA.js} +1 -546
  146. package/dist/dist-Dvx5mlIR.js +50 -0
  147. package/dist/{domains-BNjGTOPj.js → domains-BqChtBLN.js} +90 -16
  148. package/dist/env-api-keys-Bow6MJe2.js +32 -0
  149. package/dist/error-body-CJk7jMUh.js +102 -0
  150. package/dist/esm-BKJy3O9-.js +1553 -0
  151. package/dist/{exports-BNZz2DNU.js → exports-C_dclnKs.js} +24 -9
  152. package/dist/{remoteMcp-CMqZldeA.js → exports-DERO0cQf.js} +1154 -175
  153. package/dist/{extensionFile-CXOa5G4C.js → extensionFile-Ds7RCpnb.js} +12 -2
  154. package/dist/github-copilot-headers-D1RedfLn.js +22 -0
  155. package/dist/google-generative-ai-DXTILNT0.js +328 -0
  156. package/dist/google-shared-e4JDCTVP.js +19588 -0
  157. package/dist/google-vertex-a1lzvJfq.js +374 -0
  158. package/dist/{harnessStore-BT706Ly6.js → harnessStore-BectazJQ.js} +4 -4
  159. package/dist/harnessStore-C0Zwvny8.js +1 -0
  160. package/dist/hash-Dt6RIbkn.js +16 -0
  161. package/dist/headers-CwtEVQvr.js +17 -0
  162. package/dist/help-Dpm82qDr.js +91 -0
  163. package/dist/{hubChannel-BHQyzcOo.js → hubChannel-COvmdWGO.js} +11 -28
  164. package/dist/hubRevisions-58pU2dW5.js +363 -0
  165. package/dist/identity-BgfHobJH.js +165 -0
  166. package/dist/index.edge-B0D_Lgbx.js +56 -0
  167. package/dist/index.edge-BLmsRNW8.js +57 -0
  168. package/dist/index.edge-COJJ_Dv2.js +937 -0
  169. package/dist/index.edge-ChYa2LU4.js +14 -0
  170. package/dist/index.edge-ClLTmPFz.js +191 -0
  171. package/dist/{index.edge-BgSx_gRO.js → index.edge-b0z7PQ6b.js} +10 -5
  172. package/dist/iso-BPQViXM8.js +10 -0
  173. package/dist/{layeredConfig-DPQAnlXD.js → layeredConfig-pQGjhAks.js} +124 -15
  174. package/dist/{majorModes-DbCfLZH3.js → majorModes-BrL4EtzH.js} +5 -14
  175. package/dist/majorModes-WXt22_km.js +1 -0
  176. package/dist/{mcpProjection-BsP0IEnb.js → mcpProjection-pbPBBuvs.js} +2 -2
  177. package/dist/migrations-5gbLIQIc.js +32 -0
  178. package/dist/mistral-conversations-CLwhVDjA.js +689 -0
  179. package/dist/models-Chzm15vC.js +1511 -0
  180. package/dist/node-BT4GsJQp.js +2479 -0
  181. package/dist/node-DytJOfYf.js +23 -0
  182. package/dist/notification-CINsJWDL.js +102 -0
  183. package/dist/openai-codex-responses-DRMONxDE.js +1210 -0
  184. package/dist/openai-completions-CcNhAv8l.js +984 -0
  185. package/dist/openai-decisions-BsFjaAGw.js +142 -0
  186. package/dist/openai-kPrtlgjl.js +17357 -0
  187. package/dist/openai-prompt-cache-Bc6qNWt0.js +8 -0
  188. package/dist/openai-responses-C5Gp2UOV.js +281 -0
  189. package/dist/openai-responses-shared-BbSi-wBR.js +661 -0
  190. package/dist/openrouter-cost-CvC52g3b.js +30 -0
  191. package/dist/openrouter-images-BoHl8g8p.js +124 -0
  192. package/dist/photon_rs_bg.wasm +0 -0
  193. package/dist/pi-messages-BXfrZLC7.js +312 -0
  194. package/dist/piConfig-BDUpA6w0.js +127 -0
  195. package/dist/piSettings-tdui0CZI.js +1 -0
  196. package/dist/{platform-B4AAgwJ0.js → platform-yhQXrrM_.js} +1 -1
  197. package/dist/{platformFiles-C_bXo4Ig.js → platformFiles-DB3Cw1l_.js} +27 -2
  198. package/dist/pluginContributions-Be9EnCAW.js +16 -0
  199. package/dist/{protocol-Xpm_mCNN.js → protocol-B6LbEIe6.js} +2 -2
  200. package/dist/provider-env-CxhHUFiF.js +38 -0
  201. package/dist/provider-retry-BUoezuw8.js +79 -0
  202. package/dist/sanitize-unicode-C3Ec8oL6.js +26 -0
  203. package/dist/sealedChannel-BeWNTWys.js +27 -0
  204. package/dist/{server-BZh1ZXz_.js → server-1O3JEYO0.js} +8 -19
  205. package/dist/server-B2G-c0hg.js +639 -0
  206. package/dist/{server-Dpgh8PDh.js → server-B8P-UkxF.js} +14 -5
  207. package/dist/server-BR9yl54i.js +2658 -0
  208. package/dist/{server-tvgQ99rv.js → server-BXFDsLgm.js} +371 -120
  209. package/dist/{server-BAAL9-NA.js → server-Bt6Zsqo8.js} +3 -10
  210. package/dist/server-CCwwnpH0.js +148 -0
  211. package/dist/{server-D4W7EdJY.js → server-Cgym-G0a.js} +16 -16
  212. package/dist/{server-DJAanjoI.js → server-Ci3ls6LL.js} +492 -103
  213. package/dist/{server-36iuA3MI.js → server-Ci_BGVwd.js} +3 -3
  214. package/dist/{server-A-_GFpPr.js → server-CyYesT-G.js} +10 -9
  215. package/dist/server-CzJjYgVk.js +295 -0
  216. package/dist/server-DFCXmDed.js +1806 -0
  217. package/dist/{server-BE6VqEiA.js → server-DL6UyXfJ.js} +19 -12
  218. package/dist/{server-D8ndq0wL.js → server-DPTp6GXS.js} +11 -9
  219. package/dist/server-DRcCuj6P.js +217 -0
  220. package/dist/server-Dgn4el5K.js +190 -0
  221. package/dist/server-DhkR6ugd.js +577 -0
  222. package/dist/server-GIQIpf33.js +489 -0
  223. package/dist/server-OerXqXJT.js +680 -0
  224. package/dist/server-Re1VNk9s.js +1517 -0
  225. package/dist/{server-Dt4y1rZD.js → server-V8W5mcGu.js} +6 -6
  226. package/dist/server-_0288DYR.js +935 -0
  227. package/dist/server-cStfn1Yv.js +505 -0
  228. package/dist/server-pY027myK.js +1057 -0
  229. package/dist/{build-2gFaVEfG.js → serverPlugin-OOfjB8tm.js} +3937 -3
  230. package/dist/{sessionConfig-rBQgzXlT.js → sessionConfig-DfwcUKO2.js} +551 -760
  231. package/dist/simple-options-CFzI5Pd_.js +156 -0
  232. package/dist/streaming-json-BWTHTwz-.js +858 -0
  233. package/dist/system-one-shared-CiIrx29d.js +132 -0
  234. package/dist/{notification-D76PSL7r.js → telemetry-Csv1ZxAn.js} +1 -92
  235. package/dist/transform-messages-D77af7Bx.js +356 -0
  236. package/dist/truncate-M3KbFyVj.js +89 -0
  237. package/dist/typesafe-system-one-DGxeggJh.js +37 -0
  238. package/dist/uuid-B0QJx6Kr.js +31 -0
  239. package/dist/{validation-D77NZBrx.js → validation-DuOGOKEi.js} +2 -2
  240. package/dist/{value-Djvc2foV.js → value-DyVsxCwZ.js} +1 -1
  241. package/dist/vaultSettings-BFCRCBM3.js +328 -0
  242. package/dist/web-cN41ySs9.js +3 -0
  243. package/dist/worker.js +95189 -49865
  244. package/dist/workflow-BgwWq0nq.js +79 -0
  245. package/package.json +32 -22
  246. package/wrangler.jsonc +2 -2
  247. package/dist/assets/assets/channel-CMrEzemr.js +0 -2
  248. package/dist/assets/assets/chunk-XXDRQBXY-CFf0S6bN.js +0 -2
  249. package/dist/assets/assets/flowDiagram-IUGLLWBU-BhGbWVf0.js +0 -1
  250. package/dist/assets/assets/index-Bx_K4Joy.js +0 -155
  251. package/dist/assets/assets/index-DZM68mTk.css +0 -1
  252. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-q91tR8ri.js +0 -9
  253. package/dist/contextProjection-DVP2Vc5j.js +0 -188
  254. package/dist/harnessStore-BiH9vSuD.js +0 -1
  255. package/dist/majorModes-BvWNqoHt.js +0 -1
  256. package/dist/piSettings-B6fsgIBA.js +0 -1
  257. package/dist/server-BZaPPoQp.js +0 -592
  258. package/dist/server-D75MWDhB.js +0 -118
  259. package/dist/server-r358hzQg.js +0 -280
  260. package/dist/serverPlugin-BOI6c6s5.js +0 -3393
@@ -0,0 +1,935 @@
1
+ import { $n as requirePoFs, B as String$1, Bn as BACKGROUND_CONTEXT, Hn as withAbortSignal, Kn as PO_FS_SERVICE, R as Union, W as Null, bn as getOrThrow, ft as _Object_, mt as Optional, yt as _Array_ } from "./serverPlugin-OOfjB8tm.js";
2
+ import { r as readBoundedFile, t as FileTooLargeError } from "./platformFiles-DB3Cw1l_.js";
3
+ import "./platform-yhQXrrM_.js";
4
+ import { d as defineServerTool, p as defineServerPlugin } from "./extensionFile-Ds7RCpnb.js";
5
+ import { a as decodeUtf8, d as normalizeToLf, i as computeFileTag, m as stripBom, n as resolveInputPath, o as displayPath, s as applyHashlineEdits, u as normalizeFileTag } from "./index.edge-ClLTmPFz.js";
6
+ import { posix } from "node:path";
7
+ //#region ../../default/po-edit/src/schemas/editTool.ts
8
+ const HashlineRangeSchema = _Object_({
9
+ from: String$1({ description: "One inclusive starting anchor, for example 5#abc. Do not paste multiple lines." }),
10
+ to: String$1({ description: "One inclusive ending anchor, for example 8#def. Do not paste multiple lines." }),
11
+ content: Optional(Union([String$1({ description: "Replacement content. Empty content deletes the selected lines." }), Null({ description: "Delete the selected lines." })]))
12
+ });
13
+ const EditParamsSchema = _Object_({
14
+ path: String$1({ description: "Path to the file returned by a compatible hashline read or grep tool." }),
15
+ hash: String$1({ description: "Eight-character exact-byte file tag returned by read or grep." }),
16
+ edits: _Array_(HashlineRangeSchema, {
17
+ minItems: 1,
18
+ description: "Non-overlapping inclusive ranges from the same original snapshot."
19
+ })
20
+ });
21
+ //#endregion
22
+ //#region ../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/base.js
23
+ var Diff = class {
24
+ diff(oldStr, newStr, options = {}) {
25
+ let callback;
26
+ if (typeof options === "function") {
27
+ callback = options;
28
+ options = {};
29
+ } else if ("callback" in options) callback = options.callback;
30
+ const oldString = this.castInput(oldStr, options);
31
+ const newString = this.castInput(newStr, options);
32
+ const oldTokens = this.removeEmpty(this.tokenize(oldString, options));
33
+ const newTokens = this.removeEmpty(this.tokenize(newString, options));
34
+ return this.diffWithOptionsObj(oldTokens, newTokens, options, callback);
35
+ }
36
+ diffWithOptionsObj(oldTokens, newTokens, options, callback) {
37
+ var _a;
38
+ const done = (value) => {
39
+ value = this.postProcess(value, options);
40
+ if (callback) {
41
+ setTimeout(function() {
42
+ callback(value);
43
+ }, 0);
44
+ return;
45
+ } else return value;
46
+ };
47
+ const newLen = newTokens.length, oldLen = oldTokens.length;
48
+ let editLength = 1;
49
+ let maxEditLength = newLen + oldLen;
50
+ if (options.maxEditLength != null) maxEditLength = Math.min(maxEditLength, options.maxEditLength);
51
+ const maxExecutionTime = (_a = options.timeout) !== null && _a !== void 0 ? _a : Infinity;
52
+ const abortAfterTimestamp = Date.now() + maxExecutionTime;
53
+ const bestPath = [{
54
+ oldPos: -1,
55
+ lastComponent: void 0
56
+ }];
57
+ let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options);
58
+ if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) return done(this.buildValues(bestPath[0].lastComponent, newTokens, oldTokens));
59
+ let minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;
60
+ const execEditLength = () => {
61
+ for (let diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
62
+ let basePath;
63
+ const removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];
64
+ if (removePath) bestPath[diagonalPath - 1] = void 0;
65
+ let canAdd = false;
66
+ if (addPath) {
67
+ const addPathNewPos = addPath.oldPos - diagonalPath;
68
+ canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
69
+ }
70
+ const canRemove = removePath && removePath.oldPos + 1 < oldLen;
71
+ if (!canAdd && !canRemove) {
72
+ bestPath[diagonalPath] = void 0;
73
+ continue;
74
+ }
75
+ if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) basePath = this.addToPath(addPath, true, false, 0, options);
76
+ else basePath = this.addToPath(removePath, false, true, 1, options);
77
+ newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options);
78
+ if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) return done(this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true;
79
+ else {
80
+ bestPath[diagonalPath] = basePath;
81
+ if (basePath.oldPos + 1 >= oldLen) maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
82
+ if (newPos + 1 >= newLen) minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
83
+ }
84
+ }
85
+ editLength++;
86
+ };
87
+ if (callback) (function exec() {
88
+ setTimeout(function() {
89
+ if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) return callback(void 0);
90
+ if (!execEditLength()) exec();
91
+ }, 0);
92
+ })();
93
+ else while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
94
+ const ret = execEditLength();
95
+ if (ret) return ret;
96
+ }
97
+ }
98
+ addToPath(path, added, removed, oldPosInc, options) {
99
+ const last = path.lastComponent;
100
+ if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) return {
101
+ oldPos: path.oldPos + oldPosInc,
102
+ lastComponent: {
103
+ count: last.count + 1,
104
+ added,
105
+ removed,
106
+ previousComponent: last.previousComponent
107
+ }
108
+ };
109
+ else return {
110
+ oldPos: path.oldPos + oldPosInc,
111
+ lastComponent: {
112
+ count: 1,
113
+ added,
114
+ removed,
115
+ previousComponent: last
116
+ }
117
+ };
118
+ }
119
+ extractCommon(basePath, newTokens, oldTokens, diagonalPath, options) {
120
+ const newLen = newTokens.length, oldLen = oldTokens.length;
121
+ let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;
122
+ while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options)) {
123
+ newPos++;
124
+ oldPos++;
125
+ commonCount++;
126
+ if (options.oneChangePerToken) basePath.lastComponent = {
127
+ count: 1,
128
+ previousComponent: basePath.lastComponent,
129
+ added: false,
130
+ removed: false
131
+ };
132
+ }
133
+ if (commonCount && !options.oneChangePerToken) basePath.lastComponent = {
134
+ count: commonCount,
135
+ previousComponent: basePath.lastComponent,
136
+ added: false,
137
+ removed: false
138
+ };
139
+ basePath.oldPos = oldPos;
140
+ return newPos;
141
+ }
142
+ equals(left, right, options) {
143
+ if (options.comparator) return options.comparator(left, right);
144
+ else return left === right || !!options.ignoreCase && left.toLowerCase() === right.toLowerCase();
145
+ }
146
+ removeEmpty(array) {
147
+ const ret = [];
148
+ for (let i = 0; i < array.length; i++) if (array[i]) ret.push(array[i]);
149
+ return ret;
150
+ }
151
+ castInput(value, options) {
152
+ return value;
153
+ }
154
+ tokenize(value, options) {
155
+ return Array.from(value);
156
+ }
157
+ join(chars) {
158
+ return chars.join("");
159
+ }
160
+ postProcess(changeObjects, options) {
161
+ return changeObjects;
162
+ }
163
+ get useLongestToken() {
164
+ return false;
165
+ }
166
+ buildValues(lastComponent, newTokens, oldTokens) {
167
+ const components = [];
168
+ let nextComponent;
169
+ while (lastComponent) {
170
+ components.push(lastComponent);
171
+ nextComponent = lastComponent.previousComponent;
172
+ delete lastComponent.previousComponent;
173
+ lastComponent = nextComponent;
174
+ }
175
+ components.reverse();
176
+ const componentLen = components.length;
177
+ let componentPos = 0, newPos = 0, oldPos = 0;
178
+ for (; componentPos < componentLen; componentPos++) {
179
+ const component = components[componentPos];
180
+ if (!component.removed) {
181
+ if (!component.added && this.useLongestToken) {
182
+ let value = newTokens.slice(newPos, newPos + component.count);
183
+ value = value.map(function(value, i) {
184
+ const oldValue = oldTokens[oldPos + i];
185
+ return oldValue.length > value.length ? oldValue : value;
186
+ });
187
+ component.value = this.join(value);
188
+ } else component.value = this.join(newTokens.slice(newPos, newPos + component.count));
189
+ newPos += component.count;
190
+ if (!component.added) oldPos += component.count;
191
+ } else {
192
+ component.value = this.join(oldTokens.slice(oldPos, oldPos + component.count));
193
+ oldPos += component.count;
194
+ }
195
+ }
196
+ return components;
197
+ }
198
+ };
199
+ //#endregion
200
+ //#region ../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/character.js
201
+ var CharacterDiff = class extends Diff {};
202
+ new CharacterDiff();
203
+ //#endregion
204
+ //#region ../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/util/string.js
205
+ function longestCommonPrefix(str1, str2) {
206
+ let i = 0;
207
+ for (; i < str1.length && i < str2.length; i++) if (str1[i] != str2[i]) return str1.slice(0, i);
208
+ return str1.slice(0, i);
209
+ }
210
+ function longestCommonSuffix(str1, str2) {
211
+ let i;
212
+ if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) return "";
213
+ for (i = 0; i < str1.length && i < str2.length; i++) if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) return str1.slice(-i);
214
+ return str1.slice(-i);
215
+ }
216
+ function replacePrefix(string, oldPrefix, newPrefix) {
217
+ if (string.slice(0, oldPrefix.length) != oldPrefix) throw Error(`string ${JSON.stringify(string)} doesn't start with prefix ${JSON.stringify(oldPrefix)}; this is a bug`);
218
+ return newPrefix + string.slice(oldPrefix.length);
219
+ }
220
+ function replaceSuffix(string, oldSuffix, newSuffix) {
221
+ if (!oldSuffix) return string + newSuffix;
222
+ if (string.slice(-oldSuffix.length) != oldSuffix) throw Error(`string ${JSON.stringify(string)} doesn't end with suffix ${JSON.stringify(oldSuffix)}; this is a bug`);
223
+ return string.slice(0, -oldSuffix.length) + newSuffix;
224
+ }
225
+ function removePrefix(string, oldPrefix) {
226
+ return replacePrefix(string, oldPrefix, "");
227
+ }
228
+ function removeSuffix(string, oldSuffix) {
229
+ return replaceSuffix(string, oldSuffix, "");
230
+ }
231
+ function maximumOverlap(string1, string2) {
232
+ return string2.slice(0, overlapCount(string1, string2));
233
+ }
234
+ function overlapCount(a, b) {
235
+ let startA = 0;
236
+ if (a.length > b.length) startA = a.length - b.length;
237
+ let endB = b.length;
238
+ if (a.length < b.length) endB = a.length;
239
+ const map = Array(endB);
240
+ let k = 0;
241
+ map[0] = 0;
242
+ for (let j = 1; j < endB; j++) {
243
+ if (b[j] == b[k]) map[j] = map[k];
244
+ else map[j] = k;
245
+ while (k > 0 && b[j] != b[k]) k = map[k];
246
+ if (b[j] == b[k]) k++;
247
+ }
248
+ k = 0;
249
+ for (let i = startA; i < a.length; i++) {
250
+ while (k > 0 && a[i] != b[k]) k = map[k];
251
+ if (a[i] == b[k]) k++;
252
+ }
253
+ return k;
254
+ }
255
+ /**
256
+ * Split a string into segments using a word segmenter, merging consecutive
257
+ * segments if they are both whitespace segments. Whitespace segments can
258
+ * appear adjacent to one another for two reasons:
259
+ * - newlines always get their own segment
260
+ * - where a diacritic is attached to a whitespace character in the text, the
261
+ * segment ends after the diacritic, so e.g. " \u0300 " becomes two segments.
262
+ * This function therefore runs the segmenter's .segment() method and then
263
+ * merges consecutive segments of whitespace into a single part.
264
+ */
265
+ function segment(string, segmenter) {
266
+ const parts = [];
267
+ for (const segmentObj of Array.from(segmenter.segment(string))) {
268
+ const segment = segmentObj.segment;
269
+ if (parts.length && /\s/.test(parts[parts.length - 1]) && /\s/.test(segment)) parts[parts.length - 1] += segment;
270
+ else parts.push(segment);
271
+ }
272
+ return parts;
273
+ }
274
+ function trailingWs(string, segmenter) {
275
+ if (segmenter) return leadingAndTrailingWs(string, segmenter)[1];
276
+ let i;
277
+ for (i = string.length - 1; i >= 0; i--) if (!string[i].match(/\s/)) break;
278
+ return string.substring(i + 1);
279
+ }
280
+ function leadingWs(string, segmenter) {
281
+ if (segmenter) return leadingAndTrailingWs(string, segmenter)[0];
282
+ const match = string.match(/^\s*/);
283
+ return match ? match[0] : "";
284
+ }
285
+ function leadingAndTrailingWs(string, segmenter) {
286
+ if (!segmenter) return [leadingWs(string), trailingWs(string)];
287
+ if (segmenter.resolvedOptions().granularity != "word") throw new Error("The segmenter passed must have a granularity of \"word\"");
288
+ const segments = segment(string, segmenter);
289
+ const firstSeg = segments[0];
290
+ const lastSeg = segments[segments.length - 1];
291
+ return [/\s/.test(firstSeg) ? firstSeg : "", /\s/.test(lastSeg) ? lastSeg : ""];
292
+ }
293
+ //#endregion
294
+ //#region ../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/word.js
295
+ const extendedWordChars = "a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";
296
+ const tokenizeIncludingWhitespace = new RegExp(`[${extendedWordChars}]+|\\s+|[^${extendedWordChars}]`, "ug");
297
+ var WordDiff = class extends Diff {
298
+ equals(left, right, options) {
299
+ if (options.ignoreCase) {
300
+ left = left.toLowerCase();
301
+ right = right.toLowerCase();
302
+ }
303
+ return left.trim() === right.trim();
304
+ }
305
+ tokenize(value, options = {}) {
306
+ let parts;
307
+ if (options.intlSegmenter) {
308
+ const segmenter = options.intlSegmenter;
309
+ if (segmenter.resolvedOptions().granularity != "word") throw new Error("The segmenter passed must have a granularity of \"word\"");
310
+ parts = segment(value, segmenter);
311
+ } else parts = value.match(tokenizeIncludingWhitespace) || [];
312
+ const tokens = [];
313
+ let prevPart = null;
314
+ parts.forEach((part) => {
315
+ if (/\s/.test(part)) {
316
+ if (prevPart == null) tokens.push(part);
317
+ else tokens.push(tokens.pop() + part);
318
+ } else if (prevPart != null && /\s/.test(prevPart)) {
319
+ if (tokens[tokens.length - 1] == prevPart) tokens.push(tokens.pop() + part);
320
+ else tokens.push(prevPart + part);
321
+ } else tokens.push(part);
322
+ prevPart = part;
323
+ });
324
+ return tokens;
325
+ }
326
+ join(tokens) {
327
+ return tokens.map((token, i) => {
328
+ if (i == 0) return token;
329
+ else return token.replace(/^\s+/, "");
330
+ }).join("");
331
+ }
332
+ postProcess(changes, options) {
333
+ if (!changes || options.oneChangePerToken) return changes;
334
+ let lastKeep = null;
335
+ let insertion = null;
336
+ let deletion = null;
337
+ changes.forEach((change) => {
338
+ if (change.added) insertion = change;
339
+ else if (change.removed) deletion = change;
340
+ else {
341
+ if (insertion || deletion) dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change, options.intlSegmenter);
342
+ lastKeep = change;
343
+ insertion = null;
344
+ deletion = null;
345
+ }
346
+ });
347
+ if (insertion || deletion) dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null, options.intlSegmenter);
348
+ return changes;
349
+ }
350
+ };
351
+ new WordDiff();
352
+ function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep, segmenter) {
353
+ if (deletion && insertion) {
354
+ const [oldWsPrefix, oldWsSuffix] = leadingAndTrailingWs(deletion.value, segmenter);
355
+ const [newWsPrefix, newWsSuffix] = leadingAndTrailingWs(insertion.value, segmenter);
356
+ if (startKeep) {
357
+ const commonWsPrefix = longestCommonPrefix(oldWsPrefix, newWsPrefix);
358
+ startKeep.value = replaceSuffix(startKeep.value, newWsPrefix, commonWsPrefix);
359
+ deletion.value = removePrefix(deletion.value, commonWsPrefix);
360
+ insertion.value = removePrefix(insertion.value, commonWsPrefix);
361
+ }
362
+ if (endKeep) {
363
+ const commonWsSuffix = longestCommonSuffix(oldWsSuffix, newWsSuffix);
364
+ endKeep.value = replacePrefix(endKeep.value, newWsSuffix, commonWsSuffix);
365
+ deletion.value = removeSuffix(deletion.value, commonWsSuffix);
366
+ insertion.value = removeSuffix(insertion.value, commonWsSuffix);
367
+ }
368
+ } else if (insertion) {
369
+ if (startKeep) {
370
+ const ws = leadingWs(insertion.value, segmenter);
371
+ insertion.value = insertion.value.substring(ws.length);
372
+ }
373
+ if (endKeep) {
374
+ const ws = leadingWs(endKeep.value, segmenter);
375
+ endKeep.value = endKeep.value.substring(ws.length);
376
+ }
377
+ } else if (startKeep && endKeep) {
378
+ const newWsFull = leadingWs(endKeep.value, segmenter), [delWsStart, delWsEnd] = leadingAndTrailingWs(deletion.value, segmenter);
379
+ const newWsStart = longestCommonPrefix(newWsFull, delWsStart);
380
+ deletion.value = removePrefix(deletion.value, newWsStart);
381
+ const newWsEnd = longestCommonSuffix(removePrefix(newWsFull, newWsStart), delWsEnd);
382
+ deletion.value = removeSuffix(deletion.value, newWsEnd);
383
+ endKeep.value = replacePrefix(endKeep.value, newWsFull, newWsEnd);
384
+ startKeep.value = replaceSuffix(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length));
385
+ } else if (endKeep) {
386
+ const endKeepWsPrefix = leadingWs(endKeep.value, segmenter);
387
+ const overlap = maximumOverlap(trailingWs(deletion.value, segmenter), endKeepWsPrefix);
388
+ deletion.value = removeSuffix(deletion.value, overlap);
389
+ } else if (startKeep) {
390
+ const overlap = maximumOverlap(trailingWs(startKeep.value, segmenter), leadingWs(deletion.value, segmenter));
391
+ deletion.value = removePrefix(deletion.value, overlap);
392
+ }
393
+ }
394
+ var WordsWithSpaceDiff = class extends Diff {
395
+ tokenize(value) {
396
+ const regex = new RegExp(`(\\r?\\n)|[${extendedWordChars}]+|[^\\S\\n\\r]+|[^${extendedWordChars}]`, "ug");
397
+ return value.match(regex) || [];
398
+ }
399
+ };
400
+ new WordsWithSpaceDiff();
401
+ //#endregion
402
+ //#region ../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/line.js
403
+ var LineDiff = class extends Diff {
404
+ constructor() {
405
+ super(...arguments);
406
+ this.tokenize = tokenize;
407
+ }
408
+ equals(left, right, options) {
409
+ if (options.ignoreWhitespace) {
410
+ if (!options.newlineIsToken || !left.includes("\n")) left = left.trim();
411
+ if (!options.newlineIsToken || !right.includes("\n")) right = right.trim();
412
+ } else if (options.ignoreNewlineAtEof && !options.newlineIsToken) {
413
+ if (left.endsWith("\n")) left = left.slice(0, -1);
414
+ if (right.endsWith("\n")) right = right.slice(0, -1);
415
+ }
416
+ return super.equals(left, right, options);
417
+ }
418
+ };
419
+ const lineDiff = new LineDiff();
420
+ function diffLines(oldStr, newStr, options) {
421
+ return lineDiff.diff(oldStr, newStr, options);
422
+ }
423
+ function tokenize(value, options) {
424
+ if (options.stripTrailingCr) value = value.replace(/\r\n/g, "\n");
425
+ const retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
426
+ if (!linesAndNewlines[linesAndNewlines.length - 1]) linesAndNewlines.pop();
427
+ for (let i = 0; i < linesAndNewlines.length; i++) {
428
+ const line = linesAndNewlines[i];
429
+ if (i % 2 && !options.newlineIsToken) retLines[retLines.length - 1] += line;
430
+ else retLines.push(line);
431
+ }
432
+ return retLines;
433
+ }
434
+ //#endregion
435
+ //#region ../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/sentence.js
436
+ function isSentenceEndPunct(char) {
437
+ return char == "." || char == "!" || char == "?";
438
+ }
439
+ var SentenceDiff = class extends Diff {
440
+ tokenize(value) {
441
+ var _a;
442
+ const result = [];
443
+ let tokenStartI = 0;
444
+ for (let i = 0; i < value.length; i++) {
445
+ if (i == value.length - 1) {
446
+ result.push(value.slice(tokenStartI));
447
+ break;
448
+ }
449
+ if (isSentenceEndPunct(value[i]) && value[i + 1].match(/\s/)) {
450
+ result.push(value.slice(tokenStartI, i + 1));
451
+ i = tokenStartI = i + 1;
452
+ while ((_a = value[i + 1]) === null || _a === void 0 ? void 0 : _a.match(/\s/)) i++;
453
+ result.push(value.slice(tokenStartI, i + 1));
454
+ tokenStartI = i + 1;
455
+ }
456
+ }
457
+ return result;
458
+ }
459
+ };
460
+ new SentenceDiff();
461
+ //#endregion
462
+ //#region ../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/css.js
463
+ var CssDiff = class extends Diff {
464
+ tokenize(value) {
465
+ return value.split(/([{}:;,]|\s+)/);
466
+ }
467
+ };
468
+ new CssDiff();
469
+ //#endregion
470
+ //#region ../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/json.js
471
+ var JsonDiff = class extends Diff {
472
+ constructor() {
473
+ super(...arguments);
474
+ this.tokenize = tokenize;
475
+ }
476
+ get useLongestToken() {
477
+ return true;
478
+ }
479
+ castInput(value, options) {
480
+ const { undefinedReplacement, stringifyReplacer = (k, v) => typeof v === "undefined" ? undefinedReplacement : v } = options;
481
+ return typeof value === "string" ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), null, " ");
482
+ }
483
+ equals(left, right, options) {
484
+ return super.equals(left.replace(/,([\r\n])/g, "$1"), right.replace(/,([\r\n])/g, "$1"), options);
485
+ }
486
+ };
487
+ new JsonDiff();
488
+ function canonicalize(obj, stack, replacementStack, replacer, key) {
489
+ stack = stack || [];
490
+ replacementStack = replacementStack || [];
491
+ if (replacer) obj = replacer(key === void 0 ? "" : key, obj);
492
+ let i = 0;
493
+ for (; i < stack.length; i += 1) if (stack[i] === obj) return replacementStack[i];
494
+ let canonicalizedObj;
495
+ if ("[object Array]" === Object.prototype.toString.call(obj)) {
496
+ stack.push(obj);
497
+ canonicalizedObj = new Array(obj.length);
498
+ replacementStack.push(canonicalizedObj);
499
+ for (i = 0; i < obj.length; i += 1) canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, String(i));
500
+ stack.pop();
501
+ replacementStack.pop();
502
+ return canonicalizedObj;
503
+ }
504
+ if (obj && obj.toJSON) obj = obj.toJSON();
505
+ if (typeof obj === "object" && obj !== null) {
506
+ stack.push(obj);
507
+ canonicalizedObj = {};
508
+ replacementStack.push(canonicalizedObj);
509
+ const sortedKeys = [];
510
+ let key;
511
+ for (key in obj)
512
+ /* istanbul ignore else */
513
+ if (Object.prototype.hasOwnProperty.call(obj, key)) sortedKeys.push(key);
514
+ sortedKeys.sort();
515
+ for (i = 0; i < sortedKeys.length; i += 1) {
516
+ key = sortedKeys[i];
517
+ canonicalizedObj[key] = canonicalize(obj[key], stack, replacementStack, replacer, key);
518
+ }
519
+ stack.pop();
520
+ replacementStack.pop();
521
+ } else canonicalizedObj = obj;
522
+ return canonicalizedObj;
523
+ }
524
+ //#endregion
525
+ //#region ../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/array.js
526
+ var ArrayDiff = class extends Diff {
527
+ tokenize(value) {
528
+ return value.slice();
529
+ }
530
+ join(value) {
531
+ return value;
532
+ }
533
+ removeEmpty(value) {
534
+ return value;
535
+ }
536
+ };
537
+ new ArrayDiff();
538
+ //#endregion
539
+ //#region ../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/patch/create.js
540
+ const INCLUDE_HEADERS = {
541
+ includeIndex: true,
542
+ includeUnderline: true,
543
+ includeFileHeaders: true
544
+ };
545
+ const FILE_HEADERS_ONLY = {
546
+ includeIndex: false,
547
+ includeUnderline: false,
548
+ includeFileHeaders: true
549
+ };
550
+ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
551
+ let optionsObj;
552
+ if (!options) optionsObj = {};
553
+ else if (typeof options === "function") optionsObj = { callback: options };
554
+ else optionsObj = options;
555
+ if (typeof optionsObj.context === "undefined") optionsObj.context = 4;
556
+ const context = optionsObj.context;
557
+ if (optionsObj.newlineIsToken) throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");
558
+ if (!optionsObj.callback) return diffLinesResultToPatch(diffLines(oldStr, newStr, optionsObj));
559
+ else {
560
+ const { callback } = optionsObj;
561
+ diffLines(oldStr, newStr, Object.assign(Object.assign({}, optionsObj), { callback: (diff) => {
562
+ const patch = diffLinesResultToPatch(diff);
563
+ callback(patch);
564
+ } }));
565
+ }
566
+ function diffLinesResultToPatch(diff) {
567
+ if (!diff) return;
568
+ diff.push({
569
+ value: "",
570
+ lines: []
571
+ });
572
+ function contextLines(lines) {
573
+ return lines.map(function(entry) {
574
+ return " " + entry;
575
+ });
576
+ }
577
+ const hunks = [];
578
+ let oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1;
579
+ for (let i = 0; i < diff.length; i++) {
580
+ const current = diff[i], lines = current.lines || splitLines(current.value);
581
+ current.lines = lines;
582
+ if (current.added || current.removed) {
583
+ if (!oldRangeStart) {
584
+ const prev = diff[i - 1];
585
+ oldRangeStart = oldLine;
586
+ newRangeStart = newLine;
587
+ if (prev) {
588
+ curRange = context > 0 ? contextLines(prev.lines.slice(-context)) : [];
589
+ oldRangeStart -= curRange.length;
590
+ newRangeStart -= curRange.length;
591
+ }
592
+ }
593
+ for (const line of lines) curRange.push((current.added ? "+" : "-") + line);
594
+ if (current.added) newLine += lines.length;
595
+ else oldLine += lines.length;
596
+ } else {
597
+ if (oldRangeStart) {
598
+ if (lines.length <= context * 2 && i < diff.length - 2) for (const line of contextLines(lines)) curRange.push(line);
599
+ else {
600
+ const contextSize = Math.min(lines.length, context);
601
+ for (const line of contextLines(lines.slice(0, contextSize))) curRange.push(line);
602
+ const hunk = {
603
+ oldStart: oldRangeStart,
604
+ oldLines: oldLine - oldRangeStart + contextSize,
605
+ newStart: newRangeStart,
606
+ newLines: newLine - newRangeStart + contextSize,
607
+ lines: curRange
608
+ };
609
+ hunks.push(hunk);
610
+ oldRangeStart = 0;
611
+ newRangeStart = 0;
612
+ curRange = [];
613
+ }
614
+ }
615
+ oldLine += lines.length;
616
+ newLine += lines.length;
617
+ }
618
+ }
619
+ for (const hunk of hunks) for (let i = 0; i < hunk.lines.length; i++) if (hunk.lines[i].endsWith("\n")) hunk.lines[i] = hunk.lines[i].slice(0, -1);
620
+ else {
621
+ hunk.lines.splice(i + 1, 0, "\");
622
+ i++;
623
+ }
624
+ return {
625
+ oldFileName,
626
+ newFileName,
627
+ oldHeader,
628
+ newHeader,
629
+ hunks
630
+ };
631
+ }
632
+ }
633
+ /**
634
+ * creates a unified diff patch.
635
+ * @param patch either a single structured patch object (as returned by `structuredPatch`) or an array of them (as returned by `parsePatch`)
636
+ */
637
+ function formatPatch(patch, headerOptions) {
638
+ if (!headerOptions) headerOptions = INCLUDE_HEADERS;
639
+ if (Array.isArray(patch)) {
640
+ if (patch.length > 1 && !headerOptions.includeFileHeaders) throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");
641
+ return patch.map((p) => formatPatch(p, headerOptions)).join("\n");
642
+ }
643
+ const ret = [];
644
+ if (headerOptions.includeIndex && patch.oldFileName == patch.newFileName) ret.push("Index: " + patch.oldFileName);
645
+ if (headerOptions.includeUnderline) ret.push("===================================================================");
646
+ if (headerOptions.includeFileHeaders) {
647
+ ret.push("--- " + patch.oldFileName + (typeof patch.oldHeader === "undefined" ? "" : " " + patch.oldHeader));
648
+ ret.push("+++ " + patch.newFileName + (typeof patch.newHeader === "undefined" ? "" : " " + patch.newHeader));
649
+ }
650
+ for (let i = 0; i < patch.hunks.length; i++) {
651
+ const hunk = patch.hunks[i];
652
+ if (hunk.oldLines === 0) hunk.oldStart -= 1;
653
+ if (hunk.newLines === 0) hunk.newStart -= 1;
654
+ ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@");
655
+ for (const line of hunk.lines) ret.push(line);
656
+ }
657
+ return ret.join("\n") + "\n";
658
+ }
659
+ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
660
+ if (typeof options === "function") options = { callback: options };
661
+ if (!(options === null || options === void 0 ? void 0 : options.callback)) {
662
+ const patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options);
663
+ if (!patchObj) return;
664
+ return formatPatch(patchObj, options === null || options === void 0 ? void 0 : options.headerOptions);
665
+ } else {
666
+ const { callback } = options;
667
+ structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, Object.assign(Object.assign({}, options), { callback: (patchObj) => {
668
+ if (!patchObj) callback(void 0);
669
+ else callback(formatPatch(patchObj, options.headerOptions));
670
+ } }));
671
+ }
672
+ }
673
+ /**
674
+ * Split `text` into an array of lines, including the trailing newline character (where present)
675
+ */
676
+ function splitLines(text) {
677
+ const hasTrailingNl = text.endsWith("\n");
678
+ const result = text.split("\n").map((line) => line + "\n");
679
+ if (hasTrailingNl) result.pop();
680
+ else result.push(result.pop().slice(0, -1));
681
+ return result;
682
+ }
683
+ //#endregion
684
+ //#region ../../default/po-edit/src/services/editHost/index.edge.ts
685
+ /** A unified patch with file headers only, as Pi writes it. */
686
+ function generateUnifiedPatch(path, oldContent, newContent, contextLines = 4) {
687
+ return createTwoFilesPatch(path, path, oldContent, newContent, void 0, void 0, {
688
+ context: contextLines,
689
+ headerOptions: FILE_HEADERS_ONLY
690
+ });
691
+ }
692
+ /**
693
+ * A display diff with line numbers and `contextLines` unchanged lines around each change, and the first changed line
694
+ * of the new file.
695
+ */
696
+ function generateDiffString(oldContent, newContent, contextLines = 4) {
697
+ const parts = diffLines(oldContent, newContent);
698
+ const output = [];
699
+ const width = String(Math.max(oldContent.split("\n").length, newContent.split("\n").length)).length;
700
+ const number = (value) => String(value).padStart(width, " ");
701
+ let oldLineNumber = 1;
702
+ let newLineNumber = 1;
703
+ let lastWasChange = false;
704
+ let firstChangedLine;
705
+ const show = (rows) => {
706
+ for (const row of rows) {
707
+ output.push(` ${number(oldLineNumber)} ${row}`);
708
+ oldLineNumber += 1;
709
+ newLineNumber += 1;
710
+ }
711
+ };
712
+ const skip = (count) => {
713
+ if (count <= 0) return;
714
+ output.push(` ${"".padStart(width, " ")} ...`);
715
+ oldLineNumber += count;
716
+ newLineNumber += count;
717
+ };
718
+ for (const [index, part] of parts.entries()) {
719
+ const rows = part.value.split("\n");
720
+ if (rows[rows.length - 1] === "") rows.pop();
721
+ if (part.added || part.removed) {
722
+ firstChangedLine ??= newLineNumber;
723
+ for (const row of rows) if (part.added) {
724
+ output.push(`+${number(newLineNumber)} ${row}`);
725
+ newLineNumber += 1;
726
+ } else {
727
+ output.push(`-${number(oldLineNumber)} ${row}`);
728
+ oldLineNumber += 1;
729
+ }
730
+ lastWasChange = true;
731
+ continue;
732
+ }
733
+ const next = parts[index + 1];
734
+ const nextIsChange = next !== void 0 && Boolean(next.added || next.removed);
735
+ if (lastWasChange && nextIsChange) {
736
+ if (rows.length <= contextLines * 2) show(rows);
737
+ else {
738
+ show(rows.slice(0, contextLines));
739
+ skip(rows.length - contextLines * 2);
740
+ show(rows.slice(rows.length - contextLines));
741
+ }
742
+ } else if (lastWasChange) {
743
+ show(rows.slice(0, contextLines));
744
+ skip(rows.length - Math.min(contextLines, rows.length));
745
+ } else if (nextIsChange) {
746
+ const skipped = Math.max(0, rows.length - contextLines);
747
+ skip(skipped);
748
+ show(rows.slice(skipped));
749
+ } else {
750
+ oldLineNumber += rows.length;
751
+ newLineNumber += rows.length;
752
+ }
753
+ lastWasChange = false;
754
+ }
755
+ return {
756
+ diff: output.join("\n"),
757
+ firstChangedLine
758
+ };
759
+ }
760
+ const queues = /* @__PURE__ */ new Map();
761
+ /**
762
+ * Serialize mutations of one file, in call order. A Worker isolate hosts many Durable Objects, each with its own file
763
+ * namespace, so the key is the namespace id and the resolved path. There are no links to resolve.
764
+ */
765
+ async function withFileMutationQueue(filesystem, filePath, run) {
766
+ const key = `${filesystem.id}\0${posix.resolve(filePath)}`;
767
+ const previous = queues.get(key) ?? Promise.resolve();
768
+ let release = () => void 0;
769
+ const current = new Promise((resolve) => {
770
+ release = resolve;
771
+ });
772
+ const chained = previous.then(() => current);
773
+ queues.set(key, chained);
774
+ await previous;
775
+ try {
776
+ return await run();
777
+ } finally {
778
+ release();
779
+ if (queues.get(key) === chained) queues.delete(key);
780
+ }
781
+ }
782
+ //#endregion
783
+ //#region ../../default/po-edit/src/services/editTool/index.ts
784
+ function createHeadlessEditTool(filesystem) {
785
+ return {
786
+ name: "edit",
787
+ label: "edit",
788
+ description: "Edit one file using its exact snapshot hash and inclusive anchors such as 5#abc from read or grep. Each from and to value must contain one anchor, not a pasted block. All ranges refer to the original snapshot. Empty or omitted content deletes a range. Files over 8 MiB are refused.",
789
+ promptSnippet: "Edit files with snapshot-bound hashline ranges",
790
+ promptGuidelines: ["Copy path, hash, and anchors from the latest compatible read or grep result. Re-read after every successful edit.", "Pass one anchor such as 5#abc in each from and to value. Do not paste tagged lines or multiline blocks."],
791
+ parameters: EditParamsSchema,
792
+ executionMode: "parallel",
793
+ execute: (_toolCallId, params, signal, _onUpdate, context) => executeHashlineEdit(params, context.cwd, signal, typeof filesystem === "function" ? filesystem() : filesystem)
794
+ };
795
+ }
796
+ function assertNotAborted(signal) {
797
+ if (signal?.aborted) throw new Error("Operation aborted");
798
+ }
799
+ async function executeHashlineEdit(params, cwd, signal, filesystem) {
800
+ const absolutePath = resolveInputPath(params.path, cwd);
801
+ const context = signal ? withAbortSignal(signal, BACKGROUND_CONTEXT) : BACKGROUND_CONTEXT;
802
+ const readSnapshot = async () => {
803
+ try {
804
+ return Buffer.from(await readBoundedFile(filesystem, absolutePath, 8388608, context));
805
+ } catch (error) {
806
+ if (error instanceof FileTooLargeError) throw new Error("File is over 8 MiB, hashline edit refuses; use runner log tools for logs.", { cause: error });
807
+ throw error;
808
+ }
809
+ };
810
+ const expectedHash = normalizeFileTag(params.hash);
811
+ return withFileMutationQueue(filesystem, absolutePath, async () => {
812
+ assertNotAborted(signal);
813
+ getOrThrow(await filesystem.fileInfo(absolutePath, context));
814
+ const beforeBytes = await readSnapshot();
815
+ assertNotAborted(signal);
816
+ const actualHash = computeFileTag(beforeBytes);
817
+ if (actualHash !== expectedHash) throw new Error(`Stale file hash ${expectedHash}. Current hash is ${actualHash}. Re-read the file and retry.`);
818
+ const hasBom = beforeBytes.subarray(0, 3).equals(Buffer.from([
819
+ 239,
820
+ 187,
821
+ 191
822
+ ]));
823
+ const decoded = decodeUtf8(beforeBytes, params.path);
824
+ const withoutBom = stripBom(decoded);
825
+ const before = normalizeToLf(withoutBom);
826
+ const applied = applyHashlineEdits(before, params.edits);
827
+ const editedText = restoreOriginalLineEndings(withoutBom, applied.edits);
828
+ if (normalizeToLf(editedText) !== applied.content) throw new Error("Could not preserve the file line endings safely. The file was not changed.");
829
+ const diff = generateDiffString(before, applied.content);
830
+ const patch = generateUnifiedPatch(displayPath(absolutePath, cwd), before, applied.content);
831
+ const details = {
832
+ diff: diff.diff,
833
+ patch,
834
+ firstChangedLine: diff.firstChangedLine
835
+ };
836
+ assertNotAborted(signal);
837
+ if (!(await readSnapshot()).equals(beforeBytes)) throw new Error("The file changed while the edit was being prepared. Re-read it and retry.");
838
+ assertNotAborted(signal);
839
+ if (applied.content !== before) {
840
+ const output = Buffer.from(`${hasBom ? "" : ""}${editedText}`, "utf8");
841
+ getOrThrow(await filesystem.writeFile(absolutePath, output, BACKGROUND_CONTEXT));
842
+ }
843
+ const count = applied.edits.length;
844
+ const noun = count === 1 ? "range" : "ranges";
845
+ return {
846
+ content: [{
847
+ type: "text",
848
+ text: `${applied.content === before ? `No changes needed in ${params.path}.` : `Edited ${params.path} (${count} ${noun}).`} Re-read before editing it again.`
849
+ }],
850
+ details
851
+ };
852
+ });
853
+ }
854
+ function restoreOriginalLineEndings(original, edits) {
855
+ const tokens = tokenizeLines(original);
856
+ const defaultEnding = tokens.find((token) => token.ending !== "")?.ending ?? "\n";
857
+ for (const edit of [...edits].reverse()) {
858
+ const start = edit.from.line - 1;
859
+ const count = edit.to.line - edit.from.line + 1;
860
+ const removed = tokens.slice(start, start + count);
861
+ const inheritedEnding = removed.at(-1)?.ending ?? "";
862
+ const internalEnding = removed.find((token) => token.ending !== "")?.ending ?? defaultEnding;
863
+ const lines = replacementLines(edit.content);
864
+ if (lines.length === 0 && removed.at(-1)?.ending === "" && start > 0) {
865
+ const previous = tokens[start - 1];
866
+ if (previous) tokens[start - 1] = {
867
+ ...previous,
868
+ ending: ""
869
+ };
870
+ }
871
+ const replacements = lines.map((text, index) => ({
872
+ text,
873
+ ending: index === lines.length - 1 ? inheritedEnding : internalEnding
874
+ }));
875
+ tokens.splice(start, count, ...replacements);
876
+ }
877
+ return tokens.map((token) => `${token.text}${token.ending}`).join("");
878
+ }
879
+ function tokenizeLines(content) {
880
+ const tokens = [];
881
+ let start = 0;
882
+ for (let index = 0; index < content.length; index += 1) {
883
+ const character = content[index];
884
+ if (character !== "\r" && character !== "\n") continue;
885
+ const ending = character === "\r" && content[index + 1] === "\n" ? "\r\n" : character;
886
+ tokens.push({
887
+ text: content.slice(start, index),
888
+ ending
889
+ });
890
+ if (ending === "\r\n") index += 1;
891
+ start = index + 1;
892
+ }
893
+ tokens.push({
894
+ text: content.slice(start),
895
+ ending: ""
896
+ });
897
+ return tokens;
898
+ }
899
+ function replacementLines(content) {
900
+ if (content === null || content === "") return [];
901
+ const normalized = normalizeToLf(content);
902
+ const trimmed = normalized.endsWith("\n") ? normalized.slice(0, -1) : normalized;
903
+ return trimmed === "" ? [] : trimmed.split("\n");
904
+ }
905
+ //#endregion
906
+ //#region ../../default/po-edit/src/extensions/workspaces/sessions/(backend)/tool/edit.server.ts
907
+ var edit_server_default = defineServerTool(({ context }) => {
908
+ let filesystem;
909
+ context.inject([PO_FS_SERVICE], (scoped) => {
910
+ const bound = requirePoFs(scoped);
911
+ filesystem = bound;
912
+ return () => {
913
+ if (filesystem === bound) filesystem = void 0;
914
+ };
915
+ });
916
+ return createHeadlessEditTool(() => {
917
+ if (!filesystem) throw new Error("Edit filesystem service is unavailable.");
918
+ return filesystem;
919
+ });
920
+ });
921
+ //#endregion
922
+ //#region ../../default/po-edit/generated/server.ts
923
+ const at = (value, context) => typeof value === "function" ? value(context) : value;
924
+ const via = (identity, value) => value === void 0 ? void 0 : {
925
+ ...identity,
926
+ ...value
927
+ };
928
+ const serverPlugin = defineServerPlugin({
929
+ name: "@agimon-ai/po-edit",
930
+ session: (context) => ({ get tools() {
931
+ return [via({ name: "edit" }, at(edit_server_default, context))];
932
+ } })
933
+ });
934
+ //#endregion
935
+ export { serverPlugin as default, serverPlugin };