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

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 (283) hide show
  1. package/README.md +4 -3
  2. package/dist/abort-signals-2GUraIGq.js +34 -0
  3. package/dist/agent-DZ-OKOHn.js +6850 -0
  4. package/dist/anthropic-messages-5ODquUB-.js +14317 -0
  5. package/dist/{apiContracts-CHOiCbS_.js → apiContracts-b33nSAAI.js} +18 -81
  6. package/dist/{approval-BMXqnTYd.js → approval-r3NnI1VC.js} +19 -3
  7. package/dist/{approvalPrompt-Bg1JrEEY.js → approvalPrompt-DWoXxu3S.js} +2 -2
  8. package/dist/artifactFiles-DLCReI0-.js +1 -0
  9. package/dist/assets/assets/{CodeEditorView-BnyZHaYM.js → CodeEditorView-XeNS0L9M.js} +2 -2
  10. package/dist/assets/assets/{abnfDiagram-WEYOIA3C-muME0eCj.js → abnfDiagram-WEYOIA3C-B6ZW0nkR.js} +2 -2
  11. package/dist/assets/assets/{architecture-WOLXFQ4H-DMnhK1WH.js → architecture-WOLXFQ4H-bVR64sHO.js} +1 -1
  12. package/dist/assets/assets/{architectureDiagram-ZHVYKT53-DKn7XGP7.js → architectureDiagram-ZHVYKT53-D7tZz3io.js} +2 -2
  13. package/dist/assets/assets/{blockDiagram-RJAE7QA3-DtDctXZg.js → blockDiagram-RJAE7QA3-DdwScfiX.js} +2 -2
  14. package/dist/assets/assets/{c4Diagram-XDPPPE54-23pGLJeP.js → c4Diagram-XDPPPE54-DgSxZJCV.js} +2 -2
  15. package/dist/assets/assets/channel-TPcVvp_3.js +2 -0
  16. package/dist/assets/assets/{chunk-2E7WHVMD-BZ2nGNPa.js → chunk-2E7WHVMD-D5TXC2SM.js} +2 -2
  17. package/dist/assets/assets/{chunk-4EMNKR2T-Dui1SYFi.js → chunk-4EMNKR2T-BWhOSvo1.js} +2 -2
  18. package/dist/assets/assets/{chunk-55XCU76K-CUB92Evl.js → chunk-55XCU76K-HkkBzLtZ.js} +2 -2
  19. package/dist/assets/assets/{chunk-7S6XSTFO-CVayPHfE.js → chunk-7S6XSTFO-CBnjycLU.js} +2 -2
  20. package/dist/assets/assets/{chunk-AQDTSKZB---wakYqY.js → chunk-AQDTSKZB-75lIIq8T.js} +2 -2
  21. package/dist/assets/assets/{chunk-DSNLSHJZ-DfbdohUR.js → chunk-DSNLSHJZ-D8PpnXMk.js} +2 -2
  22. package/dist/assets/assets/{chunk-HAGFOTED-Dr4KRh-b.js → chunk-HAGFOTED-CXRS2NIN.js} +2 -2
  23. package/dist/assets/assets/{chunk-HNE4Q36P-D06cR91Z.js → chunk-HNE4Q36P-BocUqS94.js} +2 -2
  24. package/dist/assets/assets/{chunk-NQOKRVIF-Ca4gLeDb.js → chunk-NQOKRVIF-CHf_ogYT.js} +2 -2
  25. package/dist/assets/assets/{chunk-UHW7PFBP-DmL638jN.js → chunk-UHW7PFBP-DrW1PaIv.js} +2 -2
  26. package/dist/assets/assets/{chunk-VQ5W62QI-pkxSW5Zj.js → chunk-VQ5W62QI-CLoA7bFm.js} +2 -2
  27. package/dist/assets/assets/{chunk-WQQL4CDK-Dcc8hV4U.js → chunk-WQQL4CDK-BmBsrj9I.js} +2 -2
  28. package/dist/assets/assets/chunk-XXDRQBXY-iFE4Tl8c.js +2 -0
  29. package/dist/assets/assets/{chunk-YZO67HFG-B_HKcFrw.js → chunk-YZO67HFG-DShE_cgv.js} +2 -2
  30. package/dist/assets/assets/{chunk-ZAUX2LTX-DAzZUysS.js → chunk-ZAUX2LTX-B3oLvSXy.js} +2 -2
  31. package/dist/assets/assets/{chunk-ZCHMQSOR-DAVgjymL.js → chunk-ZCHMQSOR-B14vKK7C.js} +2 -2
  32. package/dist/assets/assets/{classDiagram-v2-4MYWR3UA-Fsw8TGPu.js → classDiagram-v2-4MYWR3UA-Da8elIW2.js} +2 -2
  33. package/dist/assets/assets/{cose-bilkent-JH36ORCC-CgUbISYV.js → cose-bilkent-JH36ORCC-Du4tGtiJ.js} +2 -2
  34. package/dist/assets/assets/{cynefin-EF2NZ3EQ-D1LxAU2x.js → cynefin-EF2NZ3EQ-Cyj6i_WI.js} +1 -1
  35. package/dist/assets/assets/{cynefinDiagram-WF24UDRP-D54I1jil.js → cynefinDiagram-WF24UDRP-DFWXwO7A.js} +2 -2
  36. package/dist/assets/assets/{dagre-NK4GIZVX-DC7zL16U.js → dagre-NK4GIZVX-C1wB_cf-.js} +2 -2
  37. package/dist/assets/assets/{diagram-CBK3MWTC-DB0ptUdz.js → diagram-CBK3MWTC-MYCOBYl6.js} +2 -2
  38. package/dist/assets/assets/{diagram-I5XIIV2D-CozSftPJ.js → diagram-I5XIIV2D-BFYbKUFf.js} +2 -2
  39. package/dist/assets/assets/{diagram-ODIL2UCW-g3WOEWDS.js → diagram-ODIL2UCW-6siqTpv_.js} +2 -2
  40. package/dist/assets/assets/{diagram-PFBEJUXE-CFxGeOYi.js → diagram-PFBEJUXE-CaBr9CoB.js} +2 -2
  41. package/dist/assets/assets/{diagram-RJA3I4VV-BQBsLche.js → diagram-RJA3I4VV-DAvmuDpc.js} +2 -2
  42. package/dist/assets/assets/{diagram-TYUNFSNR-DrjpW2yq.js → diagram-TYUNFSNR-CJnhgCpo.js} +2 -2
  43. package/dist/assets/assets/{dist-DjL8d1jZ.js → dist-BQ4W1R18.js} +2 -2
  44. package/dist/assets/assets/{dist-DvgCCshF.js → dist-BnzFckPF.js} +2 -2
  45. package/dist/assets/assets/{dist-gfbb4ygy.js → dist-CFtBpcYL.js} +2 -2
  46. package/dist/assets/assets/{dist-BabjcJ3j.js → dist-CIQX1z4W.js} +2 -2
  47. package/dist/assets/assets/{dist-XIZum9n5.js → dist-ChHYoe9_.js} +2 -2
  48. package/dist/assets/assets/{dist-1-mhYUBH.js → dist-DKxZO8d9.js} +2 -2
  49. package/dist/assets/assets/{dist-h6SOnP8-.js → dist-DL6z28wl.js} +2 -2
  50. package/dist/assets/assets/{dist-B3JXhDWV.js → dist-DNyn1p9Z.js} +2 -2
  51. package/dist/assets/assets/{dist-Izr2SB3q.js → dist-qYlLXIa8.js} +2 -2
  52. package/dist/assets/assets/{ebnfDiagram-V4P3TTPT-BZS_aAve.js → ebnfDiagram-V4P3TTPT-AUcqDTM3.js} +2 -2
  53. package/dist/assets/assets/{elk-QONTBCTQ-B2ksVmMA.js → elk-QONTBCTQ-aA10PEHJ.js} +2 -2
  54. package/dist/assets/assets/{erDiagram-KYQIGQAA-7P6zF-Z-.js → erDiagram-KYQIGQAA-hhYiqA-x.js} +2 -2
  55. package/dist/assets/assets/{eventmodeling-K75KTNOO-RoGQoRq-.js → eventmodeling-K75KTNOO-BQZqbRo5.js} +1 -1
  56. package/dist/assets/assets/flowDiagram-IUGLLWBU-BuyysPYC.js +1 -0
  57. package/dist/assets/assets/{ganttDiagram-R7GPNTJY-CTOlRy7M.js → ganttDiagram-R7GPNTJY-CLON1GpW.js} +2 -2
  58. package/dist/assets/assets/{gitGraph-VSP46ZUC-CPqytIt0.js → gitGraph-VSP46ZUC-DbmvNwR2.js} +1 -1
  59. package/dist/assets/assets/{gitGraphDiagram-PDYL7XHY-BffLxuxg.js → gitGraphDiagram-PDYL7XHY-DJVO0WlL.js} +2 -2
  60. package/dist/assets/assets/index-BiTVAj5E.js +155 -0
  61. package/dist/assets/assets/index-CBNQEGK3.css +1 -0
  62. package/dist/assets/assets/{info-OHQRW6UA-BI8RK0Ow.js → info-OHQRW6UA-CAt3Nt3g.js} +1 -1
  63. package/dist/assets/assets/{infoDiagram-MVDRKAX5-DUIst1FB.js → infoDiagram-MVDRKAX5-DTuqH-Zb.js} +2 -2
  64. package/dist/assets/assets/{ishikawaDiagram-HPEHV2GE-CA17Eho5.js → ishikawaDiagram-HPEHV2GE-BnWvdonT.js} +2 -2
  65. package/dist/assets/assets/{journeyDiagram-BOSHW7O7-CNri5Ap9.js → journeyDiagram-BOSHW7O7-Btxtcgvl.js} +2 -2
  66. package/dist/assets/assets/{kanban-definition-FNSA4HC5-DnXna7jO.js → kanban-definition-FNSA4HC5-q7ek9o_H.js} +2 -2
  67. package/dist/assets/assets/{line-BsXJZn93.js → line-B7yLilmC.js} +2 -2
  68. package/dist/assets/assets/{linear-BHYaD5T0.js → linear-y8aSKEli.js} +2 -2
  69. package/dist/assets/assets/{mermaid-parser.core-B64Eo-8a.js → mermaid-parser.core-B4rH50nD.js} +4 -4
  70. package/dist/assets/assets/{mermaid.core-Zw9qmTzg.js → mermaid.core-DnRVHTjE.js} +5 -5
  71. package/dist/assets/assets/{mindmap-definition-6OY57UG3-E5qz4KNc.js → mindmap-definition-6OY57UG3-DT9Afs2v.js} +2 -2
  72. package/dist/assets/assets/{packet-JDAUHWVQ-DgfizTr3.js → packet-JDAUHWVQ-CnqNbu4p.js} +1 -1
  73. package/dist/assets/assets/{pegDiagram-ECIUJNBX-D0WK_agM.js → pegDiagram-ECIUJNBX-cvxdBBFq.js} +2 -2
  74. package/dist/assets/assets/{pie-XZMESJXO-PJR1sXD4.js → pie-XZMESJXO-etXMNsaL.js} +1 -1
  75. package/dist/assets/assets/{pieDiagram-GNMPY74T-CPuU-NTs.js → pieDiagram-GNMPY74T-CBN-R3_j.js} +2 -2
  76. package/dist/assets/assets/{quadrantDiagram-D57K4MC3-5C9yjM1b.js → quadrantDiagram-D57K4MC3-C5jjVPIH.js} +2 -2
  77. package/dist/assets/assets/{radar-ABXABTNO-BspdXgl0.js → radar-ABXABTNO-CAMd_mrV.js} +1 -1
  78. package/dist/assets/assets/{railroad-I3PHUGI6-Ct0a6hLD.js → railroad-I3PHUGI6-DIs3auoe.js} +1 -1
  79. package/dist/assets/assets/{railroad-abnf-LNEFI6M7-fduYB4SA.js → railroad-abnf-LNEFI6M7-CJXr1qWy.js} +1 -1
  80. package/dist/assets/assets/{railroad-ebnf-DWYD2UWJ-CTQa8Sww.js → railroad-ebnf-DWYD2UWJ-DfwtykqI.js} +1 -1
  81. package/dist/assets/assets/{railroad-peg-JR7BVNR7-DatoH3GJ.js → railroad-peg-JR7BVNR7-B8beAhTs.js} +1 -1
  82. package/dist/assets/assets/{railroadDiagram-Y72NRBL7-C8sWN8l2.js → railroadDiagram-Y72NRBL7-BDcQE-EL.js} +2 -2
  83. package/dist/assets/assets/{requirementDiagram-EQYSW5RA-CqRz4RcT.js → requirementDiagram-EQYSW5RA-KJ4-QjZM.js} +2 -2
  84. package/dist/assets/assets/{sankeyDiagram-SY24JHO5-bdiuKKlX.js → sankeyDiagram-SY24JHO5-VjIB-Ybr.js} +2 -2
  85. package/dist/assets/assets/{sequenceDiagram-BLEHNHQU-Zy-8I0Hy.js → sequenceDiagram-BLEHNHQU-MfMuWq1M.js} +2 -2
  86. package/dist/assets/assets/{src-gihY33R9.js → src-BAxIj8GJ.js} +2 -2
  87. package/dist/assets/assets/{stateDiagram-v2-A6IESKWZ-DXQERPvz.js → stateDiagram-v2-A6IESKWZ-mHwLRRCY.js} +2 -2
  88. package/dist/assets/assets/{swimlanes-B3ENRKFQ-1gjZQElg.js → swimlanes-B3ENRKFQ-PArlYoqV.js} +2 -2
  89. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-The09-5S.js +9 -0
  90. package/dist/assets/assets/{timeline-definition-JXYKGLGB-CTeYEw-9.js → timeline-definition-JXYKGLGB-B2nKiNFU.js} +2 -2
  91. package/dist/assets/assets/{treeView-D4JQ5SDB-DD-EsLLT.js → treeView-D4JQ5SDB-gU23_RuI.js} +1 -1
  92. package/dist/assets/assets/{treemap-SAJKECNS-BLdFeS5J.js → treemap-SAJKECNS-CiqoMvZa.js} +1 -1
  93. package/dist/assets/assets/{usecaseDiagram-WPOLBNNX-C1GikSSP.js → usecaseDiagram-WPOLBNNX-DpeoWpMK.js} +2 -2
  94. package/dist/assets/assets/{vennDiagram-Q3Y3IDCW-B1FoA3g8.js → vennDiagram-Q3Y3IDCW-C31iGKvM.js} +2 -2
  95. package/dist/assets/assets/{wardley-7MLQ67FV-BrHb5Bjf.js → wardley-7MLQ67FV-CIzHhzNw.js} +1 -1
  96. package/dist/assets/assets/{wardleyDiagram-IVAIDKWA-CmPLD1X4.js → wardleyDiagram-IVAIDKWA-DIIkoezc.js} +2 -2
  97. package/dist/assets/assets/{webpack-BYWDFj_R.js → webpack-RFseiMZW.js} +2 -2
  98. package/dist/assets/assets/{xychartDiagram-4URNHDU4-DR5pfEjl.js → xychartDiagram-4URNHDU4-QiHL91kC.js} +2 -2
  99. package/dist/assets/bundle-asset-policy.json +1 -1
  100. package/dist/assets/index.html +2 -2
  101. package/dist/assets/plugins/assets/base-CKKRZ7-h.css +2 -0
  102. package/dist/assets/plugins/assets/browserCaptureWorklet-Droj0fW0-Droj0fW0.js +13 -0
  103. package/dist/assets/plugins/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2 +0 -0
  104. package/dist/assets/plugins/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2 +0 -0
  105. package/dist/assets/plugins/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2 +0 -0
  106. package/dist/assets/plugins/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
  107. package/dist/assets/plugins/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
  108. package/dist/assets/plugins/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2 +0 -0
  109. package/dist/assets/plugins/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
  110. package/dist/assets/plugins/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  111. package/dist/assets/plugins/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  112. package/dist/assets/plugins/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  113. package/dist/assets/plugins/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  114. package/dist/assets/plugins/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  115. package/dist/assets/plugins/assets/sileroVadWorker-D894njUe-DjN_BMWf.mjs +110 -0
  116. package/dist/assets/plugins/assets/silero_vad_v6.2.1-SjbCxFXk-SjbCxFXk.onnx +0 -0
  117. package/dist/assets/plugins/chunks/po-web-runtime-BJDT6Lbw.js +1 -0
  118. package/dist/assets/plugins/compositions.json +1 -0
  119. package/dist/assets/plugins/slots/approval.293d9a00-BXIhaPlQ.js +2 -0
  120. package/dist/assets/plugins/slots/artifacts.24567664-ZzR0gbvy.js +1 -0
  121. package/dist/assets/plugins/slots/author.0998a880-DAbA-7rb.js +93 -0
  122. package/dist/assets/plugins/slots/autocompact.dd97d013-IVq4Z6qm.js +1 -0
  123. package/dist/assets/plugins/slots/builtin-tools.36d7400b-CpCLjRRN.js +7 -0
  124. package/dist/assets/plugins/slots/codemode.8eaee717-VWt9PqsU.js +10 -0
  125. package/dist/assets/plugins/slots/domain.5e95fc37-5PIUBqDe.js +1 -0
  126. package/dist/assets/plugins/slots/edit.385c9aa9-DNAjPNG5.js +7 -0
  127. package/dist/assets/plugins/slots/files.daf34ed8-CQaTz0i1.js +2 -0
  128. package/dist/assets/plugins/slots/goal.77ec9930-B8EkarBq.js +1 -0
  129. package/dist/assets/plugins/slots/grep.02052cdc-CIRhO2gY.js +1 -0
  130. package/dist/assets/plugins/slots/help.ecd4c0f9-naMF9NN1.js +3 -0
  131. package/dist/assets/plugins/slots/log.a86eb6d0-D5__rAZJ.js +4 -0
  132. package/dist/assets/plugins/slots/mcp.974af249-DPNHn9XH.js +109 -0
  133. package/dist/assets/plugins/slots/plan.bafb8f68-C5GEpybF.js +3 -0
  134. package/dist/assets/plugins/slots/profile.48851a1d-yX6tzV3x.js +1 -0
  135. package/dist/assets/plugins/slots/prompts.723d7748-B7zpPeoF.js +3 -0
  136. package/dist/assets/plugins/slots/read.46bf6536-Cw5Z5z5T.js +1 -0
  137. package/dist/assets/plugins/slots/runner.53e9bd76-CiQR_FPX.js +8 -0
  138. package/dist/assets/plugins/slots/skill.086701a4-CL6h_F-x.js +4 -0
  139. package/dist/assets/plugins/slots/vault.ac9935c8-DKERQYg4.js +1 -0
  140. package/dist/assets/plugins/slots/voice.e85ca7f9-DEgb-U9m.js +1 -0
  141. package/dist/assets/pwa/pwa.js +12 -12
  142. package/dist/assets/pwa/sw.js +4 -4
  143. package/dist/{atomicJson-BJfPFSYF.js → atomicJson-C_7F2zD1.js} +2 -3
  144. package/dist/azure-openai-config-COZUaRzM.js +55 -0
  145. package/dist/azure-openai-responses-Cs4k2HOd.js +183 -0
  146. package/dist/{backgroundWork-CeFrbRnj.js → backgroundWork-B1mPDYlf.js} +1 -1
  147. package/dist/browser-BWf8OMfl.js +3 -0
  148. package/dist/childSession-Cf2-kH4O.js +22 -0
  149. package/dist/classifier-shared-IhSH9hhh.js +106 -0
  150. package/dist/cloudflare-workers-ai-system-one-BNnc8MuH.js +52 -0
  151. package/dist/{codemode-DbPu0yJN.js → codemode-DQFmrosw.js} +5 -2
  152. package/dist/contracts-DD3f1Lpn.js +19 -0
  153. package/dist/diagnostics-1lYFeSJe.js +131 -0
  154. package/dist/{server-D3PQk1Gt.js → dist-B-vqs6tA.js} +1 -546
  155. package/dist/dist-Dvx5mlIR.js +50 -0
  156. package/dist/env-api-keys-Bow6MJe2.js +32 -0
  157. package/dist/error-body-CJk7jMUh.js +102 -0
  158. package/dist/esm-BKJy3O9-.js +1553 -0
  159. package/dist/exports-B0WMEXCP.js +34 -0
  160. package/dist/{remoteMcp-CMqZldeA.js → exports-D09VsUk-.js} +1153 -175
  161. package/dist/{exports-BNZz2DNU.js → exports-nV43ShA7.js} +25 -9
  162. package/dist/{extensionFile-CXOa5G4C.js → extensionFile-DNM4xsje.js} +26 -2
  163. package/dist/github-copilot-headers-D1RedfLn.js +22 -0
  164. package/dist/google-generative-ai-DXTILNT0.js +328 -0
  165. package/dist/google-shared-e4JDCTVP.js +19588 -0
  166. package/dist/google-vertex-a1lzvJfq.js +374 -0
  167. package/dist/{domains-BNjGTOPj.js → harnessState-Dwrk3lfv.js} +175 -16
  168. package/dist/{harnessStore-BT706Ly6.js → harnessStore-Z7yDLO45.js} +4 -5
  169. package/dist/hash-Dt6RIbkn.js +16 -0
  170. package/dist/headers-CwtEVQvr.js +17 -0
  171. package/dist/help-w6vVEZGL.js +101 -0
  172. package/dist/hubChannel-Cm-sxOvU.js +21 -0
  173. package/dist/hubRevisions-58pU2dW5.js +363 -0
  174. package/dist/identity-BgfHobJH.js +165 -0
  175. package/dist/index.edge-COJJ_Dv2.js +937 -0
  176. package/dist/index.edge-ChYa2LU4.js +14 -0
  177. package/dist/index.edge-ClLTmPFz.js +191 -0
  178. package/dist/index.edge-DyYmurS7.js +62 -0
  179. package/dist/index.edge-K0w5auwG.js +56 -0
  180. package/dist/index.edge-Xa5LLtxz.js +67 -0
  181. package/dist/iso-BPQViXM8.js +10 -0
  182. package/dist/{layeredConfig-DPQAnlXD.js → layeredConfig-CUkYUs1f.js} +193 -15
  183. package/dist/{majorModes-DbCfLZH3.js → majorModes-BB0PXgFn.js} +4 -14
  184. package/dist/majorModes-C7vtBs4D.js +1 -0
  185. package/dist/{mcpProjection-BsP0IEnb.js → mcpProjection-BtKzB6oK.js} +2 -2
  186. package/dist/migrations-5gbLIQIc.js +32 -0
  187. package/dist/mistral-conversations-CLwhVDjA.js +689 -0
  188. package/dist/modeDefinition-C3Zbrw48.js +44 -0
  189. package/dist/models-Chzm15vC.js +1511 -0
  190. package/dist/narration-CpRurWLO.js +127 -0
  191. package/dist/node-BT4GsJQp.js +2479 -0
  192. package/dist/node-DytJOfYf.js +23 -0
  193. package/dist/notification-kckG3leF.js +102 -0
  194. package/dist/openai-codex-responses-DRMONxDE.js +1210 -0
  195. package/dist/openai-completions-CcNhAv8l.js +984 -0
  196. package/dist/openai-decisions-BsFjaAGw.js +142 -0
  197. package/dist/openai-kPrtlgjl.js +17357 -0
  198. package/dist/openai-prompt-cache-Bc6qNWt0.js +8 -0
  199. package/dist/openai-responses-C5Gp2UOV.js +281 -0
  200. package/dist/openai-responses-shared-BbSi-wBR.js +661 -0
  201. package/dist/openrouter-cost-CvC52g3b.js +30 -0
  202. package/dist/openrouter-images-BoHl8g8p.js +124 -0
  203. package/dist/{hubChannel-BHQyzcOo.js → packageApi-t1oCjNDU.js} +4 -41
  204. package/dist/photon_rs_bg.wasm +0 -0
  205. package/dist/pi-messages-BXfrZLC7.js +312 -0
  206. package/dist/piConfig-DQzlbPY4.js +126 -0
  207. package/dist/piSettings-Cf1QofNe.js +1 -0
  208. package/dist/platform-BIEiM4TG.js +113 -0
  209. package/dist/pluginContributions-Be9EnCAW.js +16 -0
  210. package/dist/pluginProtocol-BqXXyI4z.js +80 -0
  211. package/dist/{protocol-Xpm_mCNN.js → protocol-DDL8geoS.js} +2 -2
  212. package/dist/provider-env-CxhHUFiF.js +38 -0
  213. package/dist/provider-retry-BUoezuw8.js +79 -0
  214. package/dist/sanitize-unicode-C3Ec8oL6.js +26 -0
  215. package/dist/sealedChannel-BeWNTWys.js +27 -0
  216. package/dist/server-AbXyhXlY.js +217 -0
  217. package/dist/server-B6dqQoh2.js +1518 -0
  218. package/dist/server-BIHo9TFu.js +505 -0
  219. package/dist/{server-BZh1ZXz_.js → server-BJ7DNzCp.js} +8 -19
  220. package/dist/server-BO-j_GbD.js +15106 -0
  221. package/dist/{server-D4W7EdJY.js → server-BQzAiMns.js} +16 -16
  222. package/dist/server-BR7SZtj7.js +3125 -0
  223. package/dist/{server-BE6VqEiA.js → server-BT2ORK83.js} +20 -12
  224. package/dist/server-BbSHYRnY.js +295 -0
  225. package/dist/server-BqoKlEGk.js +1806 -0
  226. package/dist/{server-tvgQ99rv.js → server-Busl0pQI.js} +370 -120
  227. package/dist/server-CIHM4jqu.js +1116 -0
  228. package/dist/server-CgWSSdvd.js +576 -0
  229. package/dist/{server-Dpgh8PDh.js → server-Co_UWKrR.js} +14 -5
  230. package/dist/{server-BAAL9-NA.js → server-CuEPb7u-.js} +3 -10
  231. package/dist/{server-Dt4y1rZD.js → server-D40q2Jpx.js} +47 -27
  232. package/dist/server-DCyf2Asb.js +679 -0
  233. package/dist/server-DH7PfLln.js +148 -0
  234. package/dist/server-DJ8bc89M.js +934 -0
  235. package/dist/server-DYdp0W9v.js +489 -0
  236. package/dist/server-DsdPEYGu.js +639 -0
  237. package/dist/server-DymH4Ucq.js +189 -0
  238. package/dist/server-IqECnUrb.js +834 -0
  239. package/dist/{server-36iuA3MI.js → server-KBgW77zh.js} +3 -3
  240. package/dist/server-RW_9R3R3.js +1522 -0
  241. package/dist/server-aUit8j6r.js +1028 -0
  242. package/dist/{server-DJAanjoI.js → server-gifRriZK.js} +491 -103
  243. package/dist/server-nkUlqnAL.js +2658 -0
  244. package/dist/server-oxyEbv1a.js +1256 -0
  245. package/dist/{server-D8ndq0wL.js → server-ub3s16Mc.js} +11 -9
  246. package/dist/{build-2gFaVEfG.js → serverPlugin-CELT6P0Q.js} +3946 -3
  247. package/dist/{sessionConfig-rBQgzXlT.js → sessionConfig-RQGvfm6E.js} +550 -760
  248. package/dist/simple-options-CFzI5Pd_.js +156 -0
  249. package/dist/streaming-json-BWTHTwz-.js +858 -0
  250. package/dist/system-one-shared-CiIrx29d.js +132 -0
  251. package/dist/{notification-D76PSL7r.js → telemetry-Csv1ZxAn.js} +1 -92
  252. package/dist/transform-messages-D77af7Bx.js +356 -0
  253. package/dist/truncate-M3KbFyVj.js +89 -0
  254. package/dist/{server-A-_GFpPr.js → type-ASYnCGVW.js} +10 -1031
  255. package/dist/typesafe-system-one-DGxeggJh.js +37 -0
  256. package/dist/uuid-B0QJx6Kr.js +31 -0
  257. package/dist/{validation-D77NZBrx.js → validation-BJxVSAwx.js} +8 -3
  258. package/dist/{value-Djvc2foV.js → value-_W31So3B.js} +1 -1
  259. package/dist/vaultSettings-Di3n5YIg.js +328 -0
  260. package/dist/voiceTools-RMn4HvWo.js +246 -0
  261. package/dist/web-DCP7ELJj.js +3 -0
  262. package/dist/worker.js +95288 -49863
  263. package/dist/workflow-B7qx0Vv9.js +79 -0
  264. package/package.json +37 -22
  265. package/wrangler.jsonc +4 -2
  266. package/dist/assets/assets/channel-CMrEzemr.js +0 -2
  267. package/dist/assets/assets/chunk-XXDRQBXY-CFf0S6bN.js +0 -2
  268. package/dist/assets/assets/flowDiagram-IUGLLWBU-BhGbWVf0.js +0 -1
  269. package/dist/assets/assets/index-Bx_K4Joy.js +0 -155
  270. package/dist/assets/assets/index-DZM68mTk.css +0 -1
  271. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-q91tR8ri.js +0 -9
  272. package/dist/contextProjection-DVP2Vc5j.js +0 -188
  273. package/dist/harnessState-gmzJcPGt.js +0 -88
  274. package/dist/harnessStore-BiH9vSuD.js +0 -1
  275. package/dist/index.edge-BgSx_gRO.js +0 -45
  276. package/dist/majorModes-BvWNqoHt.js +0 -1
  277. package/dist/piSettings-B6fsgIBA.js +0 -1
  278. package/dist/platform-B4AAgwJ0.js +0 -16
  279. package/dist/platformFiles-C_bXo4Ig.js +0 -39
  280. package/dist/server-BZaPPoQp.js +0 -592
  281. package/dist/server-D75MWDhB.js +0 -118
  282. package/dist/server-r358hzQg.js +0 -280
  283. package/dist/serverPlugin-BOI6c6s5.js +0 -3393
@@ -0,0 +1,113 @@
1
+ import { Hn as BACKGROUND_CONTEXT, On as SessionIdentityDoc, Sn as getOrThrow, Wn as withAbortSignal, _n as fileMutationRunner } from "./serverPlugin-CELT6P0Q.js";
2
+ import { createHash, randomUUID } from "node:crypto";
3
+ import path from "node:path";
4
+ //#region ../../core/po-core/src/services/platformFiles/index.ts
5
+ let largestTranscriptEntryBytes = 0;
6
+ /** Exact JSON bytes of a browser projection, not the durable source entry size. */
7
+ function recordTranscriptProjection(bytes) {
8
+ if (Number.isSafeInteger(bytes) && bytes > 0) largestTranscriptEntryBytes = Math.max(largestTranscriptEntryBytes, bytes);
9
+ }
10
+ var FileTooLargeError = class extends Error {
11
+ constructor(filePath, maxBytes) {
12
+ super(`File exceeds ${maxBytes} byte read limit: ${filePath}`);
13
+ this.name = "FileTooLargeError";
14
+ }
15
+ };
16
+ /** Bounds allocation even when a file grows between stat and read. */
17
+ async function readBoundedFile(fs, filePath, maxBytes, context) {
18
+ if (!Number.isSafeInteger(maxBytes) || maxBytes < 0) throw new RangeError("Invalid read limit.");
19
+ const reader = getOrThrow(await fs.openBinaryReader(filePath, {}, context));
20
+ try {
21
+ const info = getOrThrow(await reader.info(context));
22
+ if (info.size > maxBytes) throw new FileTooLargeError(filePath, maxBytes);
23
+ const data = getOrThrow(await reader.read(0, info.size, context));
24
+ const after = getOrThrow(await reader.info(context));
25
+ if (after.size > maxBytes) throw new FileTooLargeError(filePath, maxBytes);
26
+ if (data.length !== info.size || after.size !== info.size || after.mtimeMs !== info.mtimeMs) throw new Error(`File changed during access: ${filePath}`);
27
+ return data;
28
+ } finally {
29
+ await reader.close(BACKGROUND_CONTEXT);
30
+ }
31
+ }
32
+ /** File text, or undefined when the file does not exist. Every other failure throws. */
33
+ async function readTextIfExists(fs, filePath, context) {
34
+ const result = await fs.readTextFile(filePath, context);
35
+ if (!result.ok && result.error.code === "not_found") return void 0;
36
+ return getOrThrow(result);
37
+ }
38
+ async function pathExists(fs, filePath, context) {
39
+ return getOrThrow(await fs.exists(filePath, context));
40
+ }
41
+ /** Removes a file or directory tree; a missing path is not an error. */
42
+ async function removePath(fs, filePath, context) {
43
+ getOrThrow(await fs.remove(filePath, {
44
+ recursive: true,
45
+ force: true
46
+ }, context));
47
+ }
48
+ /**
49
+ * Writes through a uniquely named temporary file beside the target, then renames it into
50
+ * place, so a reader never sees a torn file. A failed write removes its temporary file.
51
+ * Callers that read-modify-write the same target serialise through `serialRunner.forKey`.
52
+ */
53
+ async function writeFileAtomic(fs, filePath, content, context) {
54
+ getOrThrow(await fs.createDir(path.dirname(filePath), { recursive: true }, context));
55
+ const temporaryPath = `${filePath}.${randomUUID()}.tmp`;
56
+ const written = await fs.writeFile(temporaryPath, content, context);
57
+ const renamed = written.ok ? await fs.renameFile(temporaryPath, filePath, context) : written;
58
+ if (!renamed.ok) {
59
+ await fs.remove(temporaryPath, { force: true }, context);
60
+ getOrThrow(renamed);
61
+ }
62
+ }
63
+ //#endregion
64
+ //#region ../../core/po-core/src/services/platformFiles/rootBoundReplace.edge.ts
65
+ var RootBoundReplaceError = class extends Error {
66
+ status;
67
+ constructor(message, status) {
68
+ super(message);
69
+ this.status = status;
70
+ this.name = "RootBoundReplaceError";
71
+ }
72
+ };
73
+ const digest = (bytes) => createHash("sha256").update(bytes).digest("hex");
74
+ /** Replace an existing file in host-owned virtual storage, retaining optimistic concurrency. */
75
+ async function replaceRootBoundFile(options) {
76
+ const { root, relativePath, expectedSha256, maxBytes, signal, fileSystem } = options;
77
+ if (!Number.isSafeInteger(maxBytes) || maxBytes < 0) throw new RangeError("Invalid save limit.");
78
+ if (options.bytes.byteLength > maxBytes) throw new RootBoundReplaceError("File exceeds the save limit.", 413);
79
+ if (!/^[a-f0-9]{64}$/.test(expectedSha256)) throw new RootBoundReplaceError("A SHA-256 is required.", 400);
80
+ if (!path.isAbsolute(root) || !relativePath || relativePath.includes("\\") || relativePath.includes("\0") || path.isAbsolute(relativePath) || relativePath.split("/").some((part) => !part || part === "." || part === "..")) throw new RootBoundReplaceError("A relative file path under an admitted root is required.", 403);
81
+ if (fileSystem === void 0) throw new Error("Root-bound replacement requires the host filesystem.");
82
+ signal?.throwIfAborted();
83
+ const context = signal ? withAbortSignal(signal, BACKGROUND_CONTEXT) : BACKGROUND_CONTEXT;
84
+ const bytes = Uint8Array.from(options.bytes);
85
+ const target = path.join(root, relativePath);
86
+ return fileMutationRunner.forKey(target)(async () => {
87
+ signal?.throwIfAborted();
88
+ if (getOrThrow(await fileSystem.canonicalPath(root, context)) !== path.resolve(root) || getOrThrow(await fileSystem.canonicalPath(target, context)) !== target) throw new RootBoundReplaceError("The save path changed or contains a symlink.", 403);
89
+ const info = getOrThrow(await fileSystem.fileInfo(target, context));
90
+ if (info.kind !== "file") throw new RootBoundReplaceError("The save target is not a regular file.", 403);
91
+ if (info.size > maxBytes) throw new RootBoundReplaceError("File exceeds the save limit.", 413);
92
+ if (digest(await readBoundedFile(fileSystem, target, maxBytes, context)) !== expectedSha256) throw new RootBoundReplaceError("This file changed elsewhere. Reopen it before saving.", 409);
93
+ signal?.throwIfAborted();
94
+ await writeFileAtomic(fileSystem, target, bytes, context);
95
+ return digest(bytes);
96
+ });
97
+ }
98
+ //#endregion
99
+ //#region ../../core/po-core/src/services/durableSession/index.ts
100
+ /** Stamps a new session's identity, or checks an existing one matches the requested id. */
101
+ async function initializeSessionIdentity(session, request, context) {
102
+ const identity = await session.snapshot(SessionIdentityDoc, context);
103
+ if (request.existing && (!identity || identity.id !== request.id)) throw new Error("SQLite session id does not match the requested session");
104
+ if (request.existing) return;
105
+ await session.commit(async (tx) => {
106
+ const doc = await tx.doc(SessionIdentityDoc);
107
+ doc.id = request.id;
108
+ doc.createdAt = Date.now();
109
+ doc.parentSessionId = request.parentSessionId ?? "";
110
+ }, context);
111
+ }
112
+ //#endregion
113
+ export { pathExists as a, recordTranscriptProjection as c, FileTooLargeError as i, removePath as l, RootBoundReplaceError as n, readBoundedFile as o, replaceRootBoundFile as r, readTextIfExists as s, initializeSessionIdentity as t, writeFileAtomic as u };
@@ -0,0 +1,16 @@
1
+ //#region ../../core/po-core/src/schemas/pluginContributions.ts
2
+ /** Preserve schema inference at the declaration, before heterogeneous composition. */
3
+ function defineTool(tool) {
4
+ return {
5
+ ...tool,
6
+ kind: "tool"
7
+ };
8
+ }
9
+ function defineCommand(command) {
10
+ return {
11
+ ...command,
12
+ kind: "command"
13
+ };
14
+ }
15
+ //#endregion
16
+ export { defineTool as n, defineCommand as t };
@@ -0,0 +1,80 @@
1
+ import { V as String, Z as Literal, dt as Unknown, pt as _Object_, z as Union } from "./serverPlugin-CELT6P0Q.js";
2
+ import { n as Check } from "./value-_W31So3B.js";
3
+ //#region ../../core/po-core/src/schemas/pluginProtocol.ts
4
+ /** The address is always exact. A workspace call never resolves to a global service. */
5
+ const PoPluginMountSchema = Union([
6
+ _Object_({ scope: Literal("global") }, { additionalProperties: false }),
7
+ _Object_({
8
+ scope: Literal("workspace"),
9
+ workspaceId: String({ minLength: 1 })
10
+ }, { additionalProperties: false }),
11
+ _Object_({
12
+ scope: Literal("session"),
13
+ sessionId: String({ minLength: 1 })
14
+ }, { additionalProperties: false })
15
+ ]);
16
+ const PoPluginCallSchema = _Object_({
17
+ mount: PoPluginMountSchema,
18
+ service: String({ minLength: 1 }),
19
+ method: String({ minLength: 1 }),
20
+ input: Unknown()
21
+ }, { additionalProperties: false });
22
+ function definePoPluginMethod(definition) {
23
+ if (!definition.service || !definition.method) throw new Error("Plugin service and method must be named.");
24
+ return definition;
25
+ }
26
+ function poPluginMountKey(mount) {
27
+ if (!Check(PoPluginMountSchema, mount)) throw new Error("Invalid plugin mount.");
28
+ switch (mount.scope) {
29
+ case "global": return "global";
30
+ case "workspace": return `workspace:${mount.workspaceId}`;
31
+ case "session": return `session:${mount.sessionId}`;
32
+ }
33
+ }
34
+ var PoPluginCallError = class extends Error {
35
+ code;
36
+ constructor(code, message) {
37
+ super(message);
38
+ this.code = code;
39
+ this.name = "PoPluginCallError";
40
+ }
41
+ };
42
+ /** Transport-neutral dispatch, shared by Chord server services and client capability hosts. */
43
+ function createPoPluginRegistry() {
44
+ const handlers = /* @__PURE__ */ new Map();
45
+ let disposed = false;
46
+ const keyOf = (mount, service, method, direction) => `${poPluginMountKey(mount)}\0${direction}\0${service}\0${method}`;
47
+ return {
48
+ register(mount, definition, handler) {
49
+ if (disposed) throw new Error("Plugin registry is disposed.");
50
+ if (mount.scope !== definition.scope) throw new Error(`Method '${definition.service}.${definition.method}' requires ${definition.scope} scope.`);
51
+ const key = keyOf(mount, definition.service, definition.method, definition.direction);
52
+ if (handlers.has(key)) throw new Error(`Plugin method '${definition.service}.${definition.method}' is already mounted.`);
53
+ const entry = {
54
+ definition,
55
+ handler
56
+ };
57
+ handlers.set(key, entry);
58
+ return () => {
59
+ if (handlers.get(key) === entry) handlers.delete(key);
60
+ };
61
+ },
62
+ async invoke(value, direction, caller = {}) {
63
+ if (disposed) throw new Error("Plugin registry is disposed.");
64
+ if (!Check(PoPluginCallSchema, value)) throw new PoPluginCallError("INVALID_CALL", "Invalid plugin call.");
65
+ const call = value;
66
+ const entry = handlers.get(keyOf(call.mount, call.service, call.method, direction));
67
+ if (!entry) throw new PoPluginCallError("METHOD_NOT_FOUND", `Plugin method '${call.service}.${call.method}' is not mounted at this scope.`);
68
+ if (!Check(entry.definition.input, call.input)) throw new PoPluginCallError("INVALID_INPUT", `Invalid input for '${call.service}.${call.method}'.`);
69
+ const output = await entry.handler(call.input, caller);
70
+ if (!Check(entry.definition.output, output)) throw new PoPluginCallError("INVALID_OUTPUT", `Invalid output from '${call.service}.${call.method}'.`);
71
+ return output;
72
+ },
73
+ dispose() {
74
+ disposed = true;
75
+ handlers.clear();
76
+ }
77
+ };
78
+ }
79
+ //#endregion
80
+ export { createPoPluginRegistry as n, definePoPluginMethod as r, PoPluginCallSchema as t };
@@ -1,5 +1,5 @@
1
- import { G as _Object_, M as Boolean, k as Literal, q as Optional, y as String$1 } from "./build-2gFaVEfG.js";
2
- import { t as Errors } from "./value-Djvc2foV.js";
1
+ import { V as String$1, Z as Literal, et as Boolean, ht as Optional, pt as _Object_ } from "./serverPlugin-CELT6P0Q.js";
2
+ import { t as Errors } from "./value-_W31So3B.js";
3
3
  _Object_({
4
4
  code: String$1({ minLength: 1 }),
5
5
  message: String$1({ minLength: 1 }),
@@ -0,0 +1,38 @@
1
+ import * as __poBuiltin0 from "node:fs";
2
+ import "./rolldown-runtime-B-lAHAz2.js";
3
+ //#region ../../../node_modules/.pnpm/@earendil-works+pi-ai@1.5.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_018b33d3c6d4455b3921fdf11f2d0b63/node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js
4
+ let procEnvCache = null;
5
+ /**
6
+ * Fallback for https://github.com/oven-sh/bun/issues/27802.
7
+ * Bun compiled binaries can expose an empty process.env inside Linux sandboxes
8
+ * even though /proc/self/environ contains the environment.
9
+ *
10
+ * This intentionally duplicates restoreSandboxEnv() in
11
+ * packages/coding-agent/src/bun/restore-sandbox-env.ts. The ai package can be
12
+ * used directly, without going through that entrypoint, so provider env lookup
13
+ * must not depend on process.env having been patched.
14
+ */
15
+ function getBunSandboxEnvValue(name) {
16
+ if (typeof process === "undefined" || !process.versions?.bun || Object.keys(process.env).length > 0) return;
17
+ if (procEnvCache === null) {
18
+ procEnvCache = /* @__PURE__ */ new Map();
19
+ try {
20
+ const { readFileSync } = __poBuiltin0;
21
+ const data = readFileSync("/proc/self/environ", "utf-8");
22
+ for (const entry of data.split("\0")) {
23
+ const idx = entry.indexOf("=");
24
+ if (idx > 0) procEnvCache.set(entry.slice(0, idx), entry.slice(idx + 1));
25
+ }
26
+ } catch {}
27
+ }
28
+ return procEnvCache.get(name);
29
+ }
30
+ /**
31
+ * Resolve a provider env value from scoped overrides, normal process.env, then
32
+ * the duplicated Bun sandbox fallback for direct pi-ai consumers.
33
+ */
34
+ function getProviderEnvValue(name, env) {
35
+ return env?.[name] || (typeof process !== "undefined" ? process.env[name] : void 0) || getBunSandboxEnvValue(name) || void 0;
36
+ }
37
+ //#endregion
38
+ export { getProviderEnvValue as t };
@@ -0,0 +1,79 @@
1
+ //#region ../../../node_modules/.pnpm/@earendil-works+pi-ai@1.5.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_018b33d3c6d4455b3921fdf11f2d0b63/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js
2
+ const DEFAULT_MAX_RETRY_DELAY_MS = 6e4;
3
+ function isProviderError(error) {
4
+ if (!(error instanceof Error) || !("status" in error) || !("headers" in error)) return false;
5
+ return (error.status === void 0 || typeof error.status === "number") && (error.headers === void 0 || error.headers instanceof Headers);
6
+ }
7
+ /** Mirrors the pinned OpenAI/Anthropic SDK retry policy; review when either SDK is upgraded. */
8
+ function isRetryableProviderError(error) {
9
+ const shouldRetry = error.headers?.get("x-should-retry");
10
+ if (shouldRetry === "true") return true;
11
+ if (shouldRetry === "false") return false;
12
+ if (error.status === void 0) return true;
13
+ return error.status === 408 || error.status === 409 || error.status === 429 || typeof error.status === "number" && error.status >= 500;
14
+ }
15
+ function validateServerRetryDelayMs(delayMs, maxRetryDelayMs, providerErrorMessage) {
16
+ const maxDelayMs = maxRetryDelayMs ?? DEFAULT_MAX_RETRY_DELAY_MS;
17
+ if (maxDelayMs > 0 && delayMs > maxDelayMs) throw new Error(`Server requested ${Math.ceil(delayMs / 1e3)}s retry delay (max: ${Math.ceil(maxDelayMs / 1e3)}s). ${providerErrorMessage}`);
18
+ return delayMs;
19
+ }
20
+ function getRetryDelayMs(error, retryIndex, maxRetryDelayMs) {
21
+ const retryAfterMs = error.headers?.get("retry-after-ms");
22
+ if (retryAfterMs) {
23
+ const value = Number.parseFloat(retryAfterMs);
24
+ if (Number.isFinite(value)) return validateServerRetryDelayMs(value, maxRetryDelayMs, error.message);
25
+ }
26
+ const retryAfter = error.headers?.get("retry-after");
27
+ if (retryAfter) {
28
+ const seconds = Number.parseFloat(retryAfter);
29
+ const delayMs = Number.isNaN(seconds) ? Date.parse(retryAfter) - Date.now() : seconds * 1e3;
30
+ if (Number.isFinite(delayMs)) return validateServerRetryDelayMs(delayMs, maxRetryDelayMs, error.message);
31
+ }
32
+ return Math.min(.5 * 2 ** retryIndex, 8) * 1e3 * (1 - Math.random() * .25);
33
+ }
34
+ function createAbortError() {
35
+ const error = /* @__PURE__ */ new Error("Request aborted");
36
+ error.name = "AbortError";
37
+ return error;
38
+ }
39
+ function abortableSleep(ms, signal) {
40
+ return new Promise((resolve, reject) => {
41
+ if (signal?.aborted) {
42
+ reject(createAbortError());
43
+ return;
44
+ }
45
+ const onAbort = () => {
46
+ clearTimeout(timeout);
47
+ reject(createAbortError());
48
+ };
49
+ const timeout = setTimeout(() => {
50
+ signal?.removeEventListener("abort", onAbort);
51
+ resolve();
52
+ }, Math.max(0, ms));
53
+ signal?.addEventListener("abort", onAbort, { once: true });
54
+ });
55
+ }
56
+ /**
57
+ * Reproduce the retry behavior used by the OpenAI and Anthropic SDKs while making
58
+ * their backoff sleep interruptible. Their built-in retry timers ignore the
59
+ * request AbortSignal, so callers must invoke the SDK with `maxRetries: 0` and
60
+ * wrap the request with this helper. Provider-requested delays above
61
+ * `maxRetryDelayMs` fail immediately (60 seconds by default); set it to zero to
62
+ * disable the limit.
63
+ */
64
+ async function retryProviderRequest(request, options = {}) {
65
+ const maxRetries = options.maxRetries ?? 0;
66
+ let retriesRemaining = maxRetries;
67
+ for (;;) try {
68
+ return await request();
69
+ } catch (error) {
70
+ if (options.signal?.aborted) throw createAbortError();
71
+ if (retriesRemaining <= 0 || !isProviderError(error) || !isRetryableProviderError(error)) throw error;
72
+ if (error.status !== void 0 && options.noRetryStatuses?.includes(error.status)) throw error;
73
+ const retryIndex = maxRetries - retriesRemaining;
74
+ retriesRemaining--;
75
+ await abortableSleep(getRetryDelayMs(error, retryIndex, options.maxRetryDelayMs), options.signal);
76
+ }
77
+ }
78
+ //#endregion
79
+ export { retryProviderRequest as t };
@@ -0,0 +1,26 @@
1
+ //#region ../../../node_modules/.pnpm/@earendil-works+pi-ai@1.5.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_018b33d3c6d4455b3921fdf11f2d0b63/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.js
2
+ /**
3
+ * Removes unpaired Unicode surrogate characters from a string.
4
+ *
5
+ * Unpaired surrogates (high surrogates 0xD800-0xDBFF without matching low surrogates 0xDC00-0xDFFF,
6
+ * or vice versa) cause JSON serialization errors in many API providers.
7
+ *
8
+ * Valid emoji and other characters outside the Basic Multilingual Plane use properly paired
9
+ * surrogates and will NOT be affected by this function.
10
+ *
11
+ * @param text - The text to sanitize
12
+ * @returns The sanitized text with unpaired surrogates removed
13
+ *
14
+ * @example
15
+ * // Valid emoji (properly paired surrogates) are preserved
16
+ * sanitizeSurrogates("Hello 🙈 World") // => "Hello 🙈 World"
17
+ *
18
+ * // Unpaired high surrogate is removed
19
+ * const unpaired = String.fromCharCode(0xD83D); // high surrogate without low
20
+ * sanitizeSurrogates(`Text ${unpaired} here`) // => "Text here"
21
+ */
22
+ function sanitizeSurrogates(text) {
23
+ return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, "");
24
+ }
25
+ //#endregion
26
+ export { sanitizeSurrogates as t };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Rekey well before the counter could wrap.
3
+ *
4
+ * A repeated nonce under one AES-GCM key is catastrophic, not merely weak: it
5
+ * leaks the XOR of two plaintexts and the authentication subkey. The counter is
6
+ * 64 bits, so this bound is nowhere near it; the point is that the bound exists
7
+ * and is enforced rather than assumed.
8
+ */
9
+ const MAX_MESSAGES_PER_KEY = 2 ** 32;
10
+ /**
11
+ * HKDF info strings, one per direction.
12
+ *
13
+ * Separate keys per direction, not one shared key, so a message the server sent
14
+ * can never be replayed back at it as though the client had sent it.
15
+ */
16
+ const CLIENT_TO_SERVER_INFO = "po/sealed/c2s/v1";
17
+ const SERVER_TO_CLIENT_INFO = "po/sealed/s2c/v1";
18
+ function infoFor(direction) {
19
+ return direction === "c2s" ? CLIENT_TO_SERVER_INFO : SERVER_TO_CLIENT_INFO;
20
+ }
21
+ function isSealedEnvelope(value) {
22
+ if (typeof value !== "object" || value === null) return false;
23
+ const candidate = value;
24
+ return candidate.v === 1 && typeof candidate.n === "string" && typeof candidate.c === "string";
25
+ }
26
+ //#endregion
27
+ export { infoFor as n, isSealedEnvelope as r, MAX_MESSAGES_PER_KEY as t };
@@ -0,0 +1,217 @@
1
+ import { U as Number, V as String, bt as _Array_, et as Boolean, ht as Optional, pt as _Object_, v as composeServerProviderOverrides } from "./serverPlugin-CELT6P0Q.js";
2
+ import { a as defineHook, c as defineRoot, d as defineServerCommand, f as defineServerTool, h as defineServerPlugin, l as defineRoute, n as composeRootInjects, r as defineChannel, s as defineResource, t as composeRootHooks } from "./extensionFile-DNM4xsje.js";
3
+ import { n as readPackageResource, t as packageResourcePath } from "./index.edge-DyYmurS7.js";
4
+ import { t as PO_HELP_WHEN } from "./help-w6vVEZGL.js";
5
+ //#region ../../default/po-runner/src/constants/runners.ts
6
+ const RUNNER_UNAVAILABLE_MESSAGE = "Subprocess supervision is unavailable on this host.";
7
+ //#endregion
8
+ //#region ../../default/po-runner/src/schemas/bashTool.ts
9
+ /** Replaces pi's built-in `bash` tool. Descriptions are agent-facing prompt copy. */
10
+ const BashParamsSchema = _Object_({
11
+ command: _Array_(String({
12
+ minLength: 1,
13
+ maxLength: 65536
14
+ }), {
15
+ minItems: 1,
16
+ maxItems: 32,
17
+ description: "Bash commands to run in order, stopping on first failure. Use a one-item array for one command. Each command gets a full log; return all log paths and only the last executed result. Do not pipe or redirect output to a file, head, or tail. Logs are saved automatically and returned output is bounded."
18
+ }),
19
+ timeout: Optional(Number({ description: "Timeout in seconds for each command (optional, no default timeout)" })),
20
+ background: Optional(Boolean({ description: "Start the command sequence in the background immediately. Use for dev servers, watchers and other commands you already know will not finish." })),
21
+ interactive: Optional(Boolean({ description: "Run only the last command under a pseudo terminal when it needs input. Earlier commands are noninteractive. Send input to the last stage runner ID with runner.input in code mode, or po-runner input without code mode." })),
22
+ name: Optional(String({ description: "Preferred runner name if the command ends up in the background. A name in use gets a suffix." }))
23
+ });
24
+ //#endregion
25
+ //#region ../../default/po-runner/src/extensions/workspaces/sessions/(backend)/_lib/serverRoot.edge.ts
26
+ /** Workers have no subprocess supervisor. Keep the package loadable, but never claim a command ran. */
27
+ const createRunnerServerRoot = ({ signal }) => {
28
+ let disposed = false;
29
+ const refuse = (callSignal) => {
30
+ signal.throwIfAborted();
31
+ callSignal?.throwIfAborted();
32
+ if (disposed) throw new Error("Runner session is disposed.");
33
+ throw new Error(RUNNER_UNAVAILABLE_MESSAGE);
34
+ };
35
+ const tool = {
36
+ name: "bash",
37
+ label: "bash",
38
+ description: RUNNER_UNAVAILABLE_MESSAGE,
39
+ parameters: BashParamsSchema,
40
+ executionMode: "serial",
41
+ execute: async (_id, _params, callSignal) => refuse(callSignal)
42
+ };
43
+ return {
44
+ value: {
45
+ sequences: void 0,
46
+ tool,
47
+ remoteTool: tool,
48
+ command: {
49
+ name: "runners",
50
+ description: RUNNER_UNAVAILABLE_MESSAGE,
51
+ execute: async () => refuse()
52
+ },
53
+ recoverCompaction: async () => void 0
54
+ },
55
+ onStop: () => {
56
+ disposed = true;
57
+ }
58
+ };
59
+ };
60
+ //#endregion
61
+ //#region ../../default/po-runner/src/extensions/workspaces/sessions/(backend)/root.server.ts
62
+ var root_server_default = defineRoot(createRunnerServerRoot);
63
+ //#endregion
64
+ //#region ../../default/po-runner/src/constants/webRunners.ts
65
+ const RUNNER_RUNS_TYPE = "runner_runs";
66
+ //#endregion
67
+ //#region ../../default/po-runner/src/services/runnersChannel/index.ts
68
+ function runnerPayload(value) {
69
+ return typeof value === "object" && value !== null && Array.isArray(value.runs);
70
+ }
71
+ /**
72
+ * The runners data channel consumes lifecycle-owned snapshots from the session
73
+ * server. Durable registry files are read by the owning session only, never by
74
+ * this hub channel.
75
+ */
76
+ function createRunnersChannel() {
77
+ return {
78
+ frameType: RUNNER_RUNS_TYPE,
79
+ start(host) {
80
+ const latest = /* @__PURE__ */ new Map();
81
+ const subscriptions = /* @__PURE__ */ new Map();
82
+ return {
83
+ payloadFor(scope) {
84
+ const runs = latest.get(scope.sessionId);
85
+ return runs === void 0 ? void 0 : { runs };
86
+ },
87
+ sessionAdded(scope) {
88
+ subscriptions.get(scope.sessionId)?.();
89
+ latest.delete(scope.sessionId);
90
+ const unsubscribe = host.directEvents.subscribe(RUNNER_RUNS_TYPE, scope.sessionId, (payload) => {
91
+ if (!runnerPayload(payload)) return;
92
+ latest.set(scope.sessionId, payload.runs);
93
+ host.publish(scope.sessionId, payload);
94
+ }, { replayLatest: true });
95
+ subscriptions.set(scope.sessionId, unsubscribe);
96
+ },
97
+ sessionRemoved(sessionId) {
98
+ subscriptions.get(sessionId)?.();
99
+ subscriptions.delete(sessionId);
100
+ latest.delete(sessionId);
101
+ },
102
+ close() {
103
+ for (const unsubscribe of subscriptions.values()) unsubscribe();
104
+ subscriptions.clear();
105
+ latest.clear();
106
+ }
107
+ };
108
+ }
109
+ };
110
+ }
111
+ //#endregion
112
+ //#region ../../default/po-runner/src/extensions/(backend)/channel/runnerRuns.server.ts
113
+ var runnerRuns_server_default = defineChannel(function runnerRunsChannel() {
114
+ return createRunnersChannel();
115
+ });
116
+ //#endregion
117
+ //#region ../../default/po-runner/src/extensions/workspaces/sessions/(backend)/api/runner/route.server.ts
118
+ /**
119
+ * Mounts this package's HTTP API at `runner`, which the folder names.
120
+ *
121
+ * The folder is the declaration: the build reads the base path off it and hands
122
+ * the browser a client bound to the same segment, so the mount is stated once
123
+ * rather than in a constant and in four URL builders that were each free to
124
+ * drift.
125
+ */
126
+ var route_server_default = defineRoute({
127
+ basePath: "runner",
128
+ start: () => ({
129
+ fetch: () => Response.json({ error: RUNNER_UNAVAILABLE_MESSAGE }, { status: 503 }),
130
+ close: () => void 0
131
+ })
132
+ });
133
+ //#endregion
134
+ //#region ../../default/po-runner/src/extensions/workspaces/sessions/(backend)/command/runners.server.ts
135
+ var runners_server_default = defineServerCommand((context) => context.root.command);
136
+ //#endregion
137
+ //#region ../../default/po-runner/src/extensions/workspaces/sessions/(backend)/hook/session-compact.server.ts
138
+ var session_compact_server_default = defineHook(({ root }) => ({
139
+ event: "session_compact",
140
+ handle: root.recoverCompaction
141
+ }));
142
+ //#endregion
143
+ //#region ../../default/po-runner/src/extensions/workspaces/sessions/(backend)/resource/codemode-how-to-runner.server.edge.ts
144
+ var codemode_how_to_runner_server_edge_default = defineResource({
145
+ name: "codemode-how-to-runner",
146
+ description: RUNNER_UNAVAILABLE_MESSAGE,
147
+ kind: "skill",
148
+ pinned: true,
149
+ read: () => `${RUNNER_UNAVAILABLE_MESSAGE}\nBash, background jobs, PTYs and runner logs are not available in this Worker. Do not claim commands ran or invent runner IDs. Use the namespaces this session actually provides.`
150
+ });
151
+ //#endregion
152
+ //#region ../../default/po-runner/src/extensions/workspaces/sessions/(backend)/resource/help-how-to-runner.server.ts
153
+ var help_how_to_runner_server_default = defineResource({
154
+ name: "help-how-to-runner",
155
+ description: "Use Po Pi Runner to supervise shell commands, inspect durable logs, provide interactive input, and stop background runs.",
156
+ when: PO_HELP_WHEN,
157
+ kind: "skill",
158
+ path: packageResourcePath("bundle:///po-runner/src/extensions/workspaces/sessions/(backend)/resource/help-how-to-runner.server.ts", "src/prompts/help-how-to-runner/SKILL.md"),
159
+ read: () => readPackageResource("bundle:///po-runner/src/extensions/workspaces/sessions/(backend)/resource/help-how-to-runner.server.ts", "src/prompts/help-how-to-runner/SKILL.md")
160
+ });
161
+ //#endregion
162
+ //#region ../../default/po-runner/src/extensions/workspaces/sessions/(backend)/tool/bash.server.ts
163
+ var bash_server_default = defineServerTool((context) => context.root.tool);
164
+ //#endregion
165
+ //#region ../../default/po-runner/generated/server.ts
166
+ const at = (value, context) => typeof value === "function" ? value(context) : value;
167
+ /* v8 ignore next -- generated normalization branch */
168
+ const defined = (values) => values.filter((value) => value !== void 0);
169
+ const via = (identity, value) => value === void 0 ? void 0 : {
170
+ ...identity,
171
+ ...value
172
+ };
173
+ const serverPlugin = defineServerPlugin({
174
+ name: "@agimon-ai/po-runner",
175
+ providerOverrides: composeServerProviderOverrides(root_server_default),
176
+ injects: composeRootInjects({ session: [root_server_default] }),
177
+ global: (context) => ({ get channels() {
178
+ return [() => via({ frameType: "runner_runs" }, at(runnerRuns_server_default, context))];
179
+ } }),
180
+ workspace: (context) => ({ get channels() {
181
+ return defined([context.hosted("global") ? void 0 : () => via({ frameType: "runner_runs" }, at(runnerRuns_server_default, context))]);
182
+ } }),
183
+ session: async (context) => {
184
+ const scopeSession = await context.scopeRoot("session", root_server_default, context);
185
+ const contextSession = {
186
+ ...context,
187
+ root: scopeSession.value
188
+ };
189
+ return {
190
+ ...composeRootHooks(scopeSession),
191
+ get api() {
192
+ return [at(route_server_default, contextSession)];
193
+ },
194
+ get channels() {
195
+ return defined([context.hosted("global") ? void 0 : () => via({ frameType: "runner_runs" }, at(runnerRuns_server_default, context))]);
196
+ },
197
+ get commands() {
198
+ return [via({ name: "runners" }, at(runners_server_default, contextSession))];
199
+ },
200
+ get hooks() {
201
+ return [via({ event: "session_compact" }, at(session_compact_server_default, contextSession))];
202
+ },
203
+ get resources() {
204
+ return [at(codemode_how_to_runner_server_edge_default, contextSession), at(help_how_to_runner_server_default, contextSession)];
205
+ },
206
+ get tools() {
207
+ return [via({ name: "bash" }, at(bash_server_default, contextSession))];
208
+ },
209
+ services: [...scopeSession.services ?? []],
210
+ get activities() {
211
+ return [...scopeSession.activities ?? []];
212
+ }
213
+ };
214
+ }
215
+ });
216
+ //#endregion
217
+ export { serverPlugin as default, serverPlugin };