dorkos 0.128.0 → 0.130.0

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 (375) hide show
  1. package/dist/bin/cli.js +766 -517
  2. package/dist/browser/native/package-manifest.json +1 -1
  3. package/dist/browser/source-manifest.json +1 -1
  4. package/dist/client/assets/{AboutPage-CmQERFxo.js → AboutPage-B2CzVj5W.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-Dw231W2w.js → ActivityErrorState-Dl-P-e0R.js} +1 -1
  6. package/dist/client/assets/{ActivityPage-DVfeyA9u.js → ActivityPage-CW7tqLHb.js} +1 -1
  7. package/dist/client/assets/ActivityRow-Vy4aXWk-.js +1 -0
  8. package/dist/client/assets/{AdapterIcon-NqCDzgCI.js → AdapterIcon-aabKVZmM.js} +1 -1
  9. package/dist/client/assets/AdapterSetupWizard-C5Hs0xkG.js +2 -0
  10. package/dist/client/assets/{AgentOptionRow-BRJfZo2y.js → AgentOptionRow-CqIMxq9S.js} +1 -1
  11. package/dist/client/assets/{AgentPicker-B7upjYRk.js → AgentPicker-C6mbTDJJ.js} +1 -1
  12. package/dist/client/assets/{AgentRequestCard-DXJnLk6q.js → AgentRequestCard-C8GV5Sxn.js} +4 -4
  13. package/dist/client/assets/AppearancePage-C0JKrHsO.js +1 -0
  14. package/dist/client/assets/{ApplyToOverridesDialog-C_QQhNIf.js → ApplyToOverridesDialog-DWEi0MNt.js} +1 -1
  15. package/dist/client/assets/AttentionSignalRow-Cpu0lKYg.js +1 -0
  16. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-G7vrCqeA.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-_zVrHu5s.js} +3 -3
  17. package/dist/client/assets/BindingDialog-4UeaJfUu.js +1 -0
  18. package/dist/client/assets/BlintzCanvas-DCXIQZM_.js +1231 -0
  19. package/dist/client/assets/{CanvasCsvContent-CtLpZnTs.js → CanvasCsvContent-D-0TuvVs.js} +4 -4
  20. package/dist/client/assets/CanvasFileContent-DqSx7lz9.js +2 -0
  21. package/dist/client/assets/CanvasModel3dContent-zTx660yQ.js +2 -0
  22. package/dist/client/assets/ChannelComposer-D4TYVkvO.js +45 -0
  23. package/dist/client/assets/{ChatAppsOff-CCZUzDIH.js → ChatAppsOff-BzfyQc55.js} +2 -2
  24. package/dist/client/assets/{CodeMirrorDiff-BCpYdhgZ.js → CodeMirrorDiff-BLWBYGLp.js} +1 -1
  25. package/dist/client/assets/{CodeMirrorEditor-BeCubxHV.js → CodeMirrorEditor-D0q3ETxK.js} +1 -1
  26. package/dist/client/assets/{CommitmentList-BZtfTnwg.js → CommitmentList-BoMiLsRe.js} +1 -1
  27. package/dist/client/assets/{CommitmentsPage-DmurDgxV.js → CommitmentsPage-_7mNJVUZ.js} +1 -1
  28. package/dist/client/assets/{ComputerResourceView-Bik6GLKp.js → ComputerResourceView-Bo2LaCJf.js} +1 -1
  29. package/dist/client/assets/{ComputerViewer-CksBDqdu.js → ComputerViewer-a4VSdAw_.js} +1 -1
  30. package/dist/client/assets/ConnectionAccessLists-Dvv0YO31.js +1 -0
  31. package/dist/client/assets/{ConnectionsPage-Cgg36gDY.js → ConnectionsPage-oO8pNgbc.js} +2 -2
  32. package/dist/client/assets/{ConventionPage-CNhpF6Z1.js → ConventionPage-CFJjwhBd.js} +2 -2
  33. package/dist/client/assets/{ExtensionPageRoute-C2zue_Pw.js → ExtensionPageRoute-BqZN9q7M.js} +2 -2
  34. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-3v1TfY1P.js → FloatingTanStackRouterDevtools-CqogiFob-CnSp2ZEM.js} +1 -1
  35. package/dist/client/assets/{ForwardConsentHost-Mbo0D-zk.js → ForwardConsentHost-4LhRvCdu.js} +1 -1
  36. package/dist/client/assets/HandlePage-BjoYPqme.js +1 -0
  37. package/dist/client/assets/HeartbeatPage-rJzICayy.js +1 -0
  38. package/dist/client/assets/{KeyEntry-C43vkwpA.js → KeyEntry-BTTuXleL.js} +1 -1
  39. package/dist/client/assets/{LexicalField-iAHcvRmI.js → LexicalField-Dk_SDrjk.js} +1 -1
  40. package/dist/client/assets/{ManagesPage-BUIJvLmv.js → ManagesPage-Cvu3CQDn.js} +1 -1
  41. package/dist/client/assets/Marketplace-DPjPPlZz.js +36 -0
  42. package/dist/client/assets/{MarketplaceSourcesView-BZODwhxu.js → MarketplaceSourcesView-ChCys0on.js} +1 -1
  43. package/dist/client/assets/{McpAppFrame-D15nxVaI.js → McpAppFrame-DNamtzOp.js} +2 -2
  44. package/dist/client/assets/{McpSigninBody-DmBxqgxN.js → McpSigninBody-DLw3ZdZE.js} +1 -1
  45. package/dist/client/assets/{Model3dViewer-RGXeJd6a.js → Model3dViewer-IwCBCPZ2.js} +1 -1
  46. package/dist/client/assets/NamePage-FY_D0eA2.js +1 -0
  47. package/dist/client/assets/NewDirectMessageMenu-BB0gvClR.js +1 -0
  48. package/dist/client/assets/{NotificationsPage-NRfyiinS.js → NotificationsPage-aCF0AtqL.js} +1 -1
  49. package/dist/client/assets/{OpenMeshSwitch-CgQ6uefo.js → OpenMeshSwitch-DjCWF2Vy.js} +2 -2
  50. package/dist/client/assets/OperatorIdentityForm-Bcveds6f.js +1 -0
  51. package/dist/client/assets/{PermissionHistory-DPEPq8D9.js → PermissionHistory-CYsxFYmV.js} +1 -1
  52. package/dist/client/assets/{PermissionsPage--k-xutbJ.js → PermissionsPage-sxHkY92V.js} +1 -1
  53. package/dist/client/assets/{PersonalityPopover-DMMptmPS.js → PersonalityPopover-BZ20JTnJ.js} +1 -1
  54. package/dist/client/assets/PhotoPage-KBzkb0sT.js +1 -0
  55. package/dist/client/assets/PreviewRefusedNotice-BFQPYcUG.js +1 -0
  56. package/dist/client/assets/{ProfileFields-DbPJ7fvN.js → ProfileFields-sp17IFo8.js} +1 -1
  57. package/dist/client/assets/{ProfilePanelContainer-CzwhrIlw.js → ProfilePanelContainer-mA44jh5A.js} +1 -1
  58. package/dist/client/assets/{ProfileRolePicker-CZEXvlJm.js → ProfileRolePicker-Chh4_ZMB.js} +1 -1
  59. package/dist/client/assets/PromptSuggestionChips-CEi_-fHF.js +1 -0
  60. package/dist/client/assets/{ReportsToPopover-YOwGLJy5.js → ReportsToPopover-D1uknwnk.js} +1 -1
  61. package/dist/client/assets/RoomSurface-Clf1yLrr.js +1 -0
  62. package/dist/client/assets/{RoomsPage-CoXjZMWL.js → RoomsPage-BtCNzvhQ.js} +1 -1
  63. package/dist/client/assets/RunsOnPopover-LCvBpe9J.js +1 -0
  64. package/dist/client/assets/RuntimeConnectFlow-C5UDeHUC.js +1 -0
  65. package/dist/client/assets/RuntimeSetupDialog-Bqh67Vqb.js +1 -0
  66. package/dist/client/assets/{SeenDevices-Bh2yh-PW.js → SeenDevices-DvCfdeDo.js} +3 -3
  67. package/dist/client/assets/{SessionsPage-CFvkbT9X.js → SessionsPage-DLByE-re.js} +1 -1
  68. package/dist/client/assets/SettingsDialog-Co-Oxtyw.js +12 -0
  69. package/dist/client/assets/SkillsPage-Cc79IstM.js +1 -0
  70. package/dist/client/assets/TaskDialogWrapper-DuYV7Zch.js +1 -0
  71. package/dist/client/assets/TasksEmptyState-CfmPtBra.js +3 -0
  72. package/dist/client/assets/{TasksPage-D0Zi6Mve.js → TasksPage-DGk0zUhO.js} +1 -1
  73. package/dist/client/assets/{TeamComputerEntry-CY9eLVad.js → TeamComputerEntry-CLHbeX5i.js} +1 -1
  74. package/dist/client/assets/{ToolsPage-0_vx5P-F.js → ToolsPage-CSkDE7rZ.js} +2 -2
  75. package/dist/client/assets/{TopologyGraph-DUZLZZrB.js → TopologyGraph-pBC37k5P.js} +14 -14
  76. package/dist/client/assets/TourHost-CS9RsLj_.js +1 -0
  77. package/dist/client/assets/{UnlinkDialog-ptZy3IN4.js → UnlinkDialog-CelhOUZ0.js} +1 -1
  78. package/dist/client/assets/{UnreadDivider-Ckey1IWn.js → UnreadDivider-B_OMR0mQ.js} +1 -1
  79. package/dist/client/assets/WidgetErrorCard-CsMqCyCb.js +108 -0
  80. package/dist/client/assets/{WithheldExtensionsNotice-7Vu1Jctn.js → WithheldExtensionsNotice-GiKb0iQu.js} +1 -1
  81. package/dist/client/assets/WorkQueuePage-Cu721KyM.js +1 -0
  82. package/dist/client/assets/WorkView-CpWEaxMr.js +51 -0
  83. package/dist/client/assets/_shell-CmGG8Ysk.js +80 -0
  84. package/dist/client/assets/{_shell._home-BRIXhYLg.js → _shell._home-BnKkAeSp.js} +1 -1
  85. package/dist/client/assets/_shell._home.activity-DaaLJbvO.js +1 -0
  86. package/dist/client/assets/_shell._home.index-CNPasFxP.js +3 -0
  87. package/dist/client/assets/_shell._home.tasks-DXEOJ5Nq.js +1 -0
  88. package/dist/client/assets/_shell._home.workspaces-UeSvmquR.js +1 -0
  89. package/dist/client/assets/{_shell.channels-Bx6q9xVH.js → _shell.channels-NUbf5mcb.js} +4 -4
  90. package/dist/client/assets/_shell.connections-BEns4DKb.js +1 -0
  91. package/dist/client/assets/{_shell.feedback-requests-DFznTGbN.js → _shell.feedback-requests-NyjHNdnj.js} +2 -2
  92. package/dist/client/assets/_shell.marketplace-BEYqsDKe.js +1 -0
  93. package/dist/client/assets/_shell.marketplace_.sources-D6Ls30FY.js +1 -0
  94. package/dist/client/assets/_shell.session-CVc6i3eN.js +1 -0
  95. package/dist/client/assets/{_shell.team-DmA09abY.js → _shell.team-CXeOt4XD.js} +6 -6
  96. package/dist/client/assets/_shell.threads-BYdN1UtZ.js +1 -0
  97. package/dist/client/assets/_shell.x._extensionId-DtJYSfvG.js +1 -0
  98. package/dist/client/assets/_shell.x._extensionId_._-DtJYSfvG.js +1 -0
  99. package/dist/client/assets/{abnfDiagram-WEYOIA3C-DxgtVd9I.js → abnfDiagram-WEYOIA3C-BLCVDt6M.js} +1 -1
  100. package/dist/client/assets/{access-copy-Dqct36mi.js → access-copy-BSQ3QECN.js} +1 -1
  101. package/dist/client/assets/{arc-C-67Ef0p.js → arc-t4OhsI5R.js} +1 -1
  102. package/dist/client/assets/{architectureDiagram-ZHVYKT53-B7TjdT-_.js → architectureDiagram-ZHVYKT53-BcIfbGZR.js} +1 -1
  103. package/dist/client/assets/{banner-C9qTs6-C.js → banner-B6xfuDA7.js} +2 -2
  104. package/dist/client/assets/{blockDiagram-RJAE7QA3-DNqxJ3Ww.js → blockDiagram-RJAE7QA3-DTOlrcEZ.js} +1 -1
  105. package/dist/client/assets/{c4Diagram-XDPPPE54-D3jNLV0j.js → c4Diagram-XDPPPE54-CHGqwaxa.js} +1 -1
  106. package/dist/client/assets/channel-CSk6LhO2.js +1 -0
  107. package/dist/client/assets/{chunk-2E7WHVMD-C6OKx0ty.js → chunk-2E7WHVMD-Bh4L_7yX.js} +1 -1
  108. package/dist/client/assets/{chunk-2Q5K7J3B-Dr_6hHrZ.js → chunk-2Q5K7J3B-BmouLl8r.js} +1 -1
  109. package/dist/client/assets/{chunk-4EMNKR2T-CSrZVDEt.js → chunk-4EMNKR2T-BVhtiAdG.js} +1 -1
  110. package/dist/client/assets/{chunk-55XCU76K-CIazeRXO.js → chunk-55XCU76K-BdbLnE56.js} +1 -1
  111. package/dist/client/assets/{chunk-5VM5RSS4-C8IJ3zTR.js → chunk-5VM5RSS4-Qg9lQpPO.js} +1 -1
  112. package/dist/client/assets/{chunk-JWPE2WC7-D9DGXb79.js → chunk-JWPE2WC7-CfIrQaMW.js} +1 -1
  113. package/dist/client/assets/{chunk-VQ5W62QI-B0LNYdif.js → chunk-VQ5W62QI-BP9oQzc0.js} +1 -1
  114. package/dist/client/assets/{chunk-XXDRQBXY-C7IAIbvZ.js → chunk-XXDRQBXY-DKzIjnsB.js} +1 -1
  115. package/dist/client/assets/{chunk-ZCHMQSOR-C79hvjlu.js → chunk-ZCHMQSOR-DsvG6BGY.js} +2 -2
  116. package/dist/client/assets/{classDiagram-v2-4MYWR3UA-0Di1C2ZB.js → classDiagram-v2-4MYWR3UA-BSiSmGgP.js} +1 -1
  117. package/dist/client/assets/{command-BVQb6I3_.js → command-B_FPXirc.js} +1 -1
  118. package/dist/client/assets/copy-button-Bp75zBSh.js +1 -0
  119. package/dist/client/assets/{cose-bilkent-JH36ORCC-rZumaV4b.js → cose-bilkent-JH36ORCC-CXgyrZix.js} +1 -1
  120. package/dist/client/assets/{cpu-DeRuDMl4.js → cpu-DpkNIYeK.js} +1 -1
  121. package/dist/client/assets/{cynefin-EF2NZ3EQ-CI9l9xhM.js → cynefin-EF2NZ3EQ-DkmPO3hK.js} +1 -1
  122. package/dist/client/assets/{cynefinDiagram-WF24UDRP-C8CdorJJ.js → cynefinDiagram-WF24UDRP-BDknJT17.js} +1 -1
  123. package/dist/client/assets/{dagre-NK4GIZVX-AHpsTq1O.js → dagre-NK4GIZVX-BR4J5E3b.js} +1 -1
  124. package/dist/client/assets/detail-row-C8zz6mAC.js +1 -0
  125. package/dist/client/assets/{diagram-CBK3MWTC-BpPLL30n.js → diagram-CBK3MWTC-CvLKqPry.js} +1 -1
  126. package/dist/client/assets/{diagram-I5XIIV2D-D6loMn3G.js → diagram-I5XIIV2D-CVtE60X9.js} +1 -1
  127. package/dist/client/assets/{diagram-ODIL2UCW-BaGNd5eN.js → diagram-ODIL2UCW-B--CpfLk.js} +1 -1
  128. package/dist/client/assets/{diagram-PFBEJUXE-BnDdKu_g.js → diagram-PFBEJUXE-08gch1t1.js} +1 -1
  129. package/dist/client/assets/{diagram-RJA3I4VV-UXagB0_c.js → diagram-RJA3I4VV-C2e-ubaD.js} +1 -1
  130. package/dist/client/assets/{diagram-TYUNFSNR-C-whBP-S.js → diagram-TYUNFSNR-DcpK4OXX.js} +1 -1
  131. package/dist/client/assets/{ebnfDiagram-V4P3TTPT-BbG481iS.js → ebnfDiagram-V4P3TTPT-DM44BkBt.js} +1 -1
  132. package/dist/client/assets/{elk-QONTBCTQ-FtssIxOc.js → elk-QONTBCTQ-maYS1Zzm.js} +1 -1
  133. package/dist/client/assets/{empty-state-CACt-76q.js → empty-state-HtOTBAoq.js} +1 -1
  134. package/dist/client/assets/{erDiagram-KYQIGQAA-PpFgUf4C.js → erDiagram-KYQIGQAA-BR7z9r2M.js} +1 -1
  135. package/dist/client/assets/{execution-config-CGL73sRn.js → execution-config-DYYeJyJh.js} +1 -1
  136. package/dist/client/assets/{file-D80JE_L0.js → file-VtGYNr9E.js} +1 -1
  137. package/dist/client/assets/{file-exclamation-point-CcJ_e4_m.js → file-exclamation-point-eBlQssyW.js} +1 -1
  138. package/dist/client/assets/{file-text-Ds9edaTZ.js → file-text-DvNAxTGZ.js} +1 -1
  139. package/dist/client/assets/{find-latest-widget-fence-BtqFMP_f.js → find-latest-widget-fence-C2qXvASs.js} +5 -5
  140. package/dist/client/assets/{flowDiagram-IUGLLWBU-BIva66g9.js → flowDiagram-IUGLLWBU-DiuMtMbj.js} +1 -1
  141. package/dist/client/assets/form-CGIIzr1u.js +1 -0
  142. package/dist/client/assets/{format-cron-BpGrgPLu.js → format-cron-BzJ6ekoo.js} +1 -1
  143. package/dist/client/assets/format-tokens-DymkROvy.js +1 -0
  144. package/dist/client/assets/{ganttDiagram-R7GPNTJY-CZqips_4.js → ganttDiagram-R7GPNTJY-Cf_z8Ri1.js} +1 -1
  145. package/dist/client/assets/{git-branch-B8JNwQ6q.js → git-branch-BVzjBPW-.js} +1 -1
  146. package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-DoIc3lda.js → gitGraphDiagram-PDYL7XHY-RZXACCBr.js} +1 -1
  147. package/dist/client/assets/{graph-yizM0vwL.js → graph-DfAV_ObD.js} +1 -1
  148. package/dist/client/assets/{heart-BavUIV45.js → heart-BMOCYMFT.js} +1 -1
  149. package/dist/client/assets/{highlighted-body-KPVGNVTW-CGr3AgaU.js → highlighted-body-KPVGNVTW-DrrsaKBc.js} +1 -1
  150. package/dist/client/assets/image-lightbox-tAwBNBhm.js +1 -0
  151. package/dist/client/assets/{image-off-C1uTDs9-.js → image-off-BpagBHk1.js} +1 -1
  152. package/dist/client/assets/{index-CrTmY12y.js → index-0uCJUW_h.js} +2 -2
  153. package/dist/client/assets/index-0y0K3rYv.js +1 -0
  154. package/dist/client/assets/{index-CJXMgnYp.js → index-2GjydAcS.js} +1 -1
  155. package/dist/client/assets/index-6dsaPQ7-.js +1 -0
  156. package/dist/client/assets/{index-X282DRZf.js → index-7-yzdcAx.js} +3 -3
  157. package/dist/client/assets/{index-C8ZpJXTQ.js → index-A7HgzxSw.js} +1 -1
  158. package/dist/client/assets/{index-DW4KUPHp.js → index-BEqKTiCR.js} +1 -1
  159. package/dist/client/assets/{index-56EOd-zy.js → index-BIN0yv4s.js} +1 -1
  160. package/dist/client/assets/{index-FhWMRBQP.js → index-BL5Vmq62.js} +1 -1
  161. package/dist/client/assets/index-BOvFXsF_.js +1 -0
  162. package/dist/client/assets/index-BbcfxnHC.js +1 -0
  163. package/dist/client/assets/{index-DqkFtcGQ.js → index-BdKIijqB.js} +1 -1
  164. package/dist/client/assets/{index-BOEPL6hN.js → index-BfAymWoj.js} +1 -1
  165. package/dist/client/assets/{index-BKWJiERs.js → index-Bgts5its.js} +1 -1
  166. package/dist/client/assets/{index-n_pnc-CO.js → index-BiL3chP7.js} +1 -1
  167. package/dist/client/assets/{index-FI_y_dND.js → index-Bu3PEVA_.js} +1 -1
  168. package/dist/client/assets/{index-BOhSPP-6.js → index-C6DTV4h3.js} +1 -1
  169. package/dist/client/assets/{index-Cdod8zEY.js → index-CCH9c-nB.js} +1 -1
  170. package/dist/client/assets/{index-BkJlIXqM.js → index-CH4NJ8dD.js} +1 -1
  171. package/dist/client/assets/{index-CiGYtR9O.js → index-CKGJp3Cm.js} +1 -1
  172. package/dist/client/assets/{index-DEiSJbvu.js → index-CeqI4FFw.js} +1 -1
  173. package/dist/client/assets/{index-C4t0UTU-.js → index-Cj9-XXKl.js} +1 -1
  174. package/dist/client/assets/{index-ZR5f82z2.js → index-Cu8tnfM_.js} +1 -1
  175. package/dist/client/assets/{index-Dcd4NqFB.js → index-D4OWRMsG.js} +1 -1
  176. package/dist/client/assets/{index-Br6xDNvu.js → index-D8SP73Xw.js} +1 -1
  177. package/dist/client/assets/{index-CoNMlH37.js → index-DEJXVqcY.js} +1 -1
  178. package/dist/client/assets/{index-CoKNU2F9.js → index-DEMZynQt.js} +1 -1
  179. package/dist/client/assets/index-DGzMwE1Z.js +1 -0
  180. package/dist/client/assets/{index-1QfQImuJ.js → index-DIJdZqg2.js} +3 -3
  181. package/dist/client/assets/{index-YSHcMqHa.js → index-DIRqrOEK.js} +1 -1
  182. package/dist/client/assets/{index-CeDn1Ak1.js → index-DNbdGvs9.js} +1 -1
  183. package/dist/client/assets/{index-7XeZCCDI.js → index-DOBjxRe9.js} +1 -1
  184. package/dist/client/assets/{index-BJEt9R_G.js → index-DcBlHsnC.js} +1 -1
  185. package/dist/client/assets/index-DdsaTuqO.js +1 -0
  186. package/dist/client/assets/index-Dt4H9Tms.js +17 -0
  187. package/dist/client/assets/{index-DYEmUa5t.js → index-HXC63Ry8.js} +1 -1
  188. package/dist/client/assets/index-MHIn2TC9.js +1063 -0
  189. package/dist/client/assets/{index-tgbcsB6H.js → index-OjJ_8uMM.js} +1 -1
  190. package/dist/client/assets/index-P4Wos1Gi.css +1 -0
  191. package/dist/client/assets/{index-QSXJR98z.js → index-U5jTIqzv.js} +1 -1
  192. package/dist/client/assets/{index-CXBYgGja.js → index-ZzPr9GUI.js} +1 -1
  193. package/dist/client/assets/index-d9cqTUAj.js +1 -0
  194. package/dist/client/assets/{index-LwL5BpE4.js → index-fcfCRITA.js} +1 -1
  195. package/dist/client/assets/{index-SOKlO1zZ.js → index-onQlu3UR.js} +1 -1
  196. package/dist/client/assets/{index.esm-CAeUe7uQ.js → index.esm-DSKTDEoH.js} +1 -1
  197. package/dist/client/assets/{infoDiagram-MVDRKAX5-DweUdYSy.js → infoDiagram-MVDRKAX5-B8dulOBe.js} +1 -1
  198. package/dist/client/assets/{inline-code-SYHTKcle.js → inline-code-B3qpjdZ2.js} +1 -1
  199. package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-DKNQIv7P.js → ishikawaDiagram-HPEHV2GE-Cy8aIg0O.js} +1 -1
  200. package/dist/client/assets/{journeyDiagram-BOSHW7O7-DPD7F4VO.js → journeyDiagram-BOSHW7O7-BZAlejG3.js} +1 -1
  201. package/dist/client/assets/{kanban-definition-FNSA4HC5-B_uPSwxC.js → kanban-definition-FNSA4HC5-BxS1edpe.js} +1 -1
  202. package/dist/client/assets/{layers-F4mvrI2l.js → layers-ByCM7XO5.js} +1 -1
  203. package/dist/client/assets/{lightbulb-a6nNsrzy.js → lightbulb-KjW8YTXH.js} +1 -1
  204. package/dist/client/assets/{link-2-yI2Tlm7Q.js → link-2-CtFfuMO5.js} +1 -1
  205. package/dist/client/assets/{list-runtime-types-CsGil5te.js → list-runtime-types-DrzHejZo.js} +1 -1
  206. package/dist/client/assets/{markdown-content-Cjhsscbn.js → markdown-content-DgiSdNwz.js} +1 -1
  207. package/dist/client/assets/mention-pill-CHPHlu-U.js +1 -0
  208. package/dist/client/assets/{mermaid.core-9PwG-9fN.js → mermaid.core-ovqlC4PC.js} +4 -4
  209. package/dist/client/assets/{message-square-off-aV4NMCjd.js → message-square-off-CEOyy4Pq.js} +1 -1
  210. package/dist/client/assets/{mindmap-definition-6OY57UG3-BRbWmQkj.js → mindmap-definition-6OY57UG3-CsngqLzI.js} +1 -1
  211. package/dist/client/assets/{more-details-CRLU2HN4.js → more-details-BW9mauVT.js} +1 -1
  212. package/dist/client/assets/{owner-notice-CTJbhUak.js → owner-notice-BRUVafHC.js} +1 -1
  213. package/dist/client/assets/{package-sPggO7Dr.js → package-Bbs99yqi.js} +1 -1
  214. package/dist/client/assets/{page-container-CnfDuiDC.js → page-container-BVfGgaaJ.js} +1 -1
  215. package/dist/client/assets/{pane-resize-handle-63OC5vfI.js → pane-resize-handle-BL7Meu5R.js} +1 -1
  216. package/dist/client/assets/{paperclip-WhPo3_WD.js → paperclip-QOWXs8-5.js} +1 -1
  217. package/dist/client/assets/path-input-BDRHmgzW.js +1 -0
  218. package/dist/client/assets/{pegDiagram-ECIUJNBX-Ct9Li_PA.js → pegDiagram-ECIUJNBX-DPsWmWqw.js} +1 -1
  219. package/dist/client/assets/{pieDiagram-GNMPY74T-BAB5RA5v.js → pieDiagram-GNMPY74T-BdOIDv4F.js} +1 -1
  220. package/dist/client/assets/{plug-_q5iqunq.js → plug-BrsPyUhu.js} +1 -1
  221. package/dist/client/assets/primer-trigger-C97fRm1v.js +3 -0
  222. package/dist/client/assets/{profile-errors-COcBx7w5.js → profile-errors-nPLX60ha.js} +1 -1
  223. package/dist/client/assets/{progress-77FCPL2y.js → progress-C9TALtIa.js} +1 -1
  224. package/dist/client/assets/{quadrantDiagram-D57K4MC3-BqPJVmMS.js → quadrantDiagram-D57K4MC3-MzMEunU7.js} +1 -1
  225. package/dist/client/assets/{query-error-state-5236P3z0.js → query-error-state-BJjgx-WC.js} +1 -1
  226. package/dist/client/assets/{radio-C8xmfoqO.js → radio-Biql29-B.js} +1 -1
  227. package/dist/client/assets/{railroadDiagram-Y72NRBL7-B8U11nT6.js → railroadDiagram-Y72NRBL7-Dzx_PYVW.js} +1 -1
  228. package/dist/client/assets/registry-B0HgbN69.js +1 -0
  229. package/dist/client/assets/registry-fiUD5cv6.js +39 -0
  230. package/dist/client/assets/{relay-trace-schemas-B80E4EUn.js → relay-trace-schemas-BJ4MfChd.js} +2 -2
  231. package/dist/client/assets/{repeat-CHmB_vD7.js → repeat-CKufDGoQ.js} +1 -1
  232. package/dist/client/assets/{requirementDiagram-EQYSW5RA-CzJ1gzTh.js → requirementDiagram-EQYSW5RA-J0pg6FEt.js} +1 -1
  233. package/dist/client/assets/{room-files-source-B0gc97Ri.js → room-files-source-iaYdshKo.js} +2 -2
  234. package/dist/client/assets/{rotate-ccw-clock-CCU6SVnv.js → rotate-ccw-clock-CnARSw5V.js} +1 -1
  235. package/dist/client/assets/{rotate-cw-B8WQa8O-.js → rotate-cw-BAn_5-Gq.js} +1 -1
  236. package/dist/client/assets/{sankeyDiagram-SY24JHO5-D4vQwyve.js → sankeyDiagram-SY24JHO5-6V_uy-zQ.js} +1 -1
  237. package/dist/client/assets/scroll-area-XDq7yL_d.js +1 -0
  238. package/dist/client/assets/{sequenceDiagram-BLEHNHQU-BVnIsPQe.js → sequenceDiagram-BLEHNHQU-C4jZi3N4.js} +1 -1
  239. package/dist/client/assets/{shield-x-ijIbRppV.js → shield-x-CpiXuMbN.js} +1 -1
  240. package/dist/client/assets/signed-in-Rv3Sjk8n.js +1 -0
  241. package/dist/client/assets/{sizeCapture-INFHLROL-DGb1rAJL.js → sizeCapture-INFHLROL-B7nxFreb.js} +1 -1
  242. package/dist/client/assets/{soul-file-CXgYs25S.js → soul-file-BQz4TtHo.js} +1 -1
  243. package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-DeX3IKTm.js → stateDiagram-v2-A6IESKWZ-B5rvc4n2.js} +1 -1
  244. package/dist/client/assets/{swimlanes-B3ENRKFQ-DN5ljYhG.js → swimlanes-B3ENRKFQ-DnElusDo.js} +1 -1
  245. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-DLpKz5fF.js +8 -0
  246. package/dist/client/assets/{table-D9ww_3Ij.js → table-NGiWzPO4.js} +1 -1
  247. package/dist/client/assets/{timeline-definition-JXYKGLGB-DpRthC3r.js → timeline-definition-JXYKGLGB-DMgyn3XX.js} +1 -1
  248. package/dist/client/assets/{trust-posture-Dn2ciEE0.js → trust-posture-BArJ9H4j.js} +1 -1
  249. package/dist/client/assets/{unplug-BZ8zSvfB.js → unplug-MSjeZ0tJ.js} +1 -1
  250. package/dist/client/assets/{unverified-catalog-notice-CGy05tAO.js → unverified-catalog-notice-DA96H8Df.js} +1 -1
  251. package/dist/client/assets/{use-bindings-BLAWQRpe.js → use-bindings-BojBqRJS.js} +1 -1
  252. package/dist/client/assets/{use-composer-prefs-ICOpilWK.js → use-composer-prefs-BDl8aMme.js} +1 -1
  253. package/dist/client/assets/{use-connector-management-DEMGZy9N.js → use-connector-management-FONU6FK8.js} +1 -1
  254. package/dist/client/assets/{use-deep-link-scroll-DxGYrks3.js → use-deep-link-scroll-CtbBPBgi.js} +1 -1
  255. package/dist/client/assets/{use-delete-binding-Bnv3J5Fu.js → use-delete-binding-COhBv6X3.js} +1 -1
  256. package/dist/client/assets/{use-dev-links-BOcktLiE.js → use-dev-links-Dh0MCiGY.js} +1 -1
  257. package/dist/client/assets/{use-direct-message-panel-D38tSozW.js → use-direct-message-panel-CYnWunqk.js} +1 -1
  258. package/dist/client/assets/{use-external-adapter-catalog-9qiNBqpc.js → use-external-adapter-catalog-RTDOW8Yi.js} +1 -1
  259. package/dist/client/assets/use-filter-state-CSFTDx7z.js +6 -0
  260. package/dist/client/assets/use-full-activity-feed-DlY_ZbRZ.js +1 -0
  261. package/dist/client/assets/use-is-below-desktop-ClzGXlRb.js +1 -0
  262. package/dist/client/assets/{use-local-browser-B1huJhdg.js → use-local-browser-WwZd-FOP.js} +1 -1
  263. package/dist/client/assets/{use-mesh-topology-BTYAy6zc.js → use-mesh-topology-WnFkjq41.js} +1 -1
  264. package/dist/client/assets/{use-mounted-ref-CaPc6Prv.js → use-mounted-ref-Dz1h70pz.js} +1 -1
  265. package/dist/client/assets/{use-notification-prefs-u76DPoP0.js → use-notification-prefs-IrF5_cko.js} +1 -1
  266. package/dist/client/assets/use-pending-read-CnAnzOt_.js +1 -0
  267. package/dist/client/assets/use-personality-commit-C4hYkSPy.js +1 -0
  268. package/dist/client/assets/use-promo-activation-CPVANFBh.js +6 -0
  269. package/dist/client/assets/{use-promo-dismissals-CO7-qhEl.js → use-promo-dismissals-B9m0HT6L.js} +1 -1
  270. package/dist/client/assets/{use-pulse-freshness-D07Mv-Sa.js → use-pulse-freshness-DMySxN8D.js} +1 -1
  271. package/dist/client/assets/{use-room-follow-claim-DRQBuAIe.js → use-room-follow-claim-ByaYVY0o.js} +1 -1
  272. package/dist/client/assets/{use-room-sessions-Bzk7rM40.js → use-room-sessions-DPB29acU.js} +1 -1
  273. package/dist/client/assets/{use-roving-tab-list-CcznVldj.js → use-roving-tab-list-BO8kbs-w.js} +1 -1
  274. package/dist/client/assets/{use-session-canvas-CpgE7tFb.js → use-session-canvas-Cunag2K7.js} +9 -9
  275. package/dist/client/assets/use-status-budget-jt-9aQR0.js +21 -0
  276. package/dist/client/assets/{use-transform-ByJGn3hq.js → use-transform-ydtuYUNp.js} +1 -1
  277. package/dist/client/assets/{use-unclaimed-chats-C-z5fstJ.js → use-unclaimed-chats-ClBWJgNm.js} +1 -1
  278. package/dist/client/assets/use-update-config-ZHtOtve0.js +1 -0
  279. package/dist/client/assets/{useMutationState-BF1EFtIZ.js → useMutationState-B8ArIqeH.js} +1 -1
  280. package/dist/client/assets/{usecaseDiagram-WPOLBNNX-efVKbRIX.js → usecaseDiagram-WPOLBNNX-C5JdAkG9.js} +1 -1
  281. package/dist/client/assets/{vennDiagram-Q3Y3IDCW-Bravmwce.js → vennDiagram-Q3Y3IDCW-CqLCy7LU.js} +1 -1
  282. package/dist/client/assets/{wardleyDiagram-IVAIDKWA-fR77zByv.js → wardleyDiagram-IVAIDKWA-C9FlHLTd.js} +1 -1
  283. package/dist/client/assets/{xychartDiagram-4URNHDU4-BphORSLh.js → xychartDiagram-4URNHDU4-BIm-RUWd.js} +1 -1
  284. package/dist/client/index.html +2 -2
  285. package/dist/drizzle/20261031012841_dor3309_file_turn_on_offer.sql +2 -0
  286. package/dist/drizzle/20261101122330_schedule_declined_content_key.sql +1 -0
  287. package/dist/drizzle/20261101195529_work_queue.sql +38 -0
  288. package/dist/drizzle/20261101233656_dor3644_session_launched_by.sql +1 -0
  289. package/dist/drizzle/20261102041558_dor3070_marketplace_summary.sql +2 -0
  290. package/dist/drizzle/20261102051715_dor3440_clear_origin_holds.sql +10 -0
  291. package/dist/drizzle/20261102135442_agent_browser_profiles.sql +15 -0
  292. package/dist/drizzle/meta/20261031012841_snapshot.json +14116 -0
  293. package/dist/drizzle/meta/20261101122330_snapshot.json +14123 -0
  294. package/dist/drizzle/meta/20261101195529_snapshot.json +14363 -0
  295. package/dist/drizzle/meta/20261101233656_snapshot.json +14370 -0
  296. package/dist/drizzle/meta/20261102041558_snapshot.json +14384 -0
  297. package/dist/drizzle/meta/20261102051715_snapshot.json +14384 -0
  298. package/dist/drizzle/meta/20261102135442_snapshot.json +14483 -0
  299. package/dist/drizzle/meta/_journal.json +49 -0
  300. package/dist/server/extension-child.cjs +1147 -572
  301. package/dist/server/index.js +45678 -38894
  302. package/dist/server/index.js.map +2 -2
  303. package/package.json +5 -5
  304. package/dist/client/assets/ActivityRow-DIBH4v9c.js +0 -1
  305. package/dist/client/assets/AdapterSetupWizard-Dle_b9qc.js +0 -2
  306. package/dist/client/assets/AppearancePage-DXbhUt2e.js +0 -1
  307. package/dist/client/assets/AttentionSignalRow-5E7TkG98.js +0 -1
  308. package/dist/client/assets/BindingDialog-q--8SDJF.js +0 -1
  309. package/dist/client/assets/BlintzCanvas-DruVZcDU.js +0 -1231
  310. package/dist/client/assets/CanvasFileContent-BThy5fjD.js +0 -2
  311. package/dist/client/assets/CanvasModel3dContent-BbgR73jh.js +0 -2
  312. package/dist/client/assets/ChannelComposer-qhk0KtW7.js +0 -44
  313. package/dist/client/assets/ConnectionAccessLists-DRwO1v0V.js +0 -1
  314. package/dist/client/assets/HandlePage-B4qbFi40.js +0 -1
  315. package/dist/client/assets/HeartbeatPage-BnNbQLCW.js +0 -1
  316. package/dist/client/assets/Marketplace-DbdLWz0-.js +0 -36
  317. package/dist/client/assets/NamePage-fhxyWDDY.js +0 -1
  318. package/dist/client/assets/NewDirectMessageMenu-DBAdvv5p.js +0 -1
  319. package/dist/client/assets/OperatorIdentityForm-Bls5Vo_u.js +0 -1
  320. package/dist/client/assets/PhotoPage-CNHcXbz4.js +0 -1
  321. package/dist/client/assets/PreviewRefusedNotice-Ds4IO32o.js +0 -1
  322. package/dist/client/assets/PromptSuggestionChips-BXxC799Q.js +0 -1
  323. package/dist/client/assets/RoomSurface-DgH3a_Fv.js +0 -1
  324. package/dist/client/assets/RunsOnPopover-CEkkjrGg.js +0 -1
  325. package/dist/client/assets/RuntimeConnectFlow-DXWGgvCW.js +0 -1
  326. package/dist/client/assets/RuntimeSetupDialog-D6L1QhMF.js +0 -1
  327. package/dist/client/assets/SettingsDialog-BOOqWKcj.js +0 -12
  328. package/dist/client/assets/SkillsPage-ntCEhUIM.js +0 -1
  329. package/dist/client/assets/TaskDialogWrapper-vBWAWwTY.js +0 -1
  330. package/dist/client/assets/TasksEmptyState-C_3UkAbA.js +0 -3
  331. package/dist/client/assets/TourHost-B69XAKpE.js +0 -1
  332. package/dist/client/assets/WidgetErrorCard-BlqaIsPK.js +0 -108
  333. package/dist/client/assets/WorkView-BekLkR4O.js +0 -51
  334. package/dist/client/assets/_shell-Du0F-5fK.js +0 -80
  335. package/dist/client/assets/_shell._home.activity-5rihXoYF.js +0 -1
  336. package/dist/client/assets/_shell._home.index-BsLNqt4f.js +0 -3
  337. package/dist/client/assets/_shell._home.tasks-Cxs5tLWA.js +0 -1
  338. package/dist/client/assets/_shell._home.workspaces-CEHDdfbP.js +0 -1
  339. package/dist/client/assets/_shell.connections-Bm0WmgXH.js +0 -1
  340. package/dist/client/assets/_shell.marketplace-CsQ60Mlc.js +0 -1
  341. package/dist/client/assets/_shell.marketplace_.sources-DNyShS1x.js +0 -1
  342. package/dist/client/assets/_shell.session-BN42bV3w.js +0 -1
  343. package/dist/client/assets/_shell.threads-HH4EvufJ.js +0 -1
  344. package/dist/client/assets/_shell.x._extensionId-3ZlJV1iu.js +0 -1
  345. package/dist/client/assets/_shell.x._extensionId_._-3ZlJV1iu.js +0 -1
  346. package/dist/client/assets/card-DUmTNXJJ.js +0 -1
  347. package/dist/client/assets/channel-B7zgJbnU.js +0 -1
  348. package/dist/client/assets/form-D93N5lrK.js +0 -1
  349. package/dist/client/assets/image-lightbox-vgPEvSCc.js +0 -1
  350. package/dist/client/assets/index-B36osK_S.js +0 -17
  351. package/dist/client/assets/index-B446r3dL.js +0 -1
  352. package/dist/client/assets/index-BGo1YiUE.js +0 -1
  353. package/dist/client/assets/index-BO3yPJt-.js +0 -1
  354. package/dist/client/assets/index-DE6uOpn4.js +0 -1
  355. package/dist/client/assets/index-Dag1qeZI.js +0 -1
  356. package/dist/client/assets/index-Dm0Tav7v.js +0 -1
  357. package/dist/client/assets/index-Dry_agqN.css +0 -1
  358. package/dist/client/assets/index-OQuvRZTD.js +0 -1058
  359. package/dist/client/assets/index-eVrGefuq.js +0 -1
  360. package/dist/client/assets/mention-pill-BsOeTJ2f.js +0 -1
  361. package/dist/client/assets/path-input-C2KIXdON.js +0 -1
  362. package/dist/client/assets/primer-trigger-B2tjuHBx.js +0 -3
  363. package/dist/client/assets/registry-BzXBOE9h.js +0 -34
  364. package/dist/client/assets/registry-sfhDu9q2.js +0 -1
  365. package/dist/client/assets/scroll-area-FwZwM74Q.js +0 -1
  366. package/dist/client/assets/search-x-Q18Wm-C5.js +0 -6
  367. package/dist/client/assets/signed-in-DEOMBWVX.js +0 -1
  368. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-D8kHFWtL.js +0 -8
  369. package/dist/client/assets/use-full-activity-feed-CtQquOBW.js +0 -1
  370. package/dist/client/assets/use-is-below-desktop-CAGEAsCC.js +0 -1
  371. package/dist/client/assets/use-pending-read-D0y6i7G9.js +0 -1
  372. package/dist/client/assets/use-personality-commit-C3h8upDo.js +0 -1
  373. package/dist/client/assets/use-promo-activation-5HG08FlB.js +0 -11
  374. package/dist/client/assets/use-status-budget-Xn2sIeM1.js +0 -16
  375. package/dist/client/assets/use-update-config-L5NCTj3t.js +0 -1
@@ -15347,7 +15347,7 @@ var require_mime_types = __commonJS({
15347
15347
  var TEXT_TYPE_REGEXP = /^text\//i;
15348
15348
  exports2.charset = charset;
15349
15349
  exports2.charsets = { lookup: charset };
15350
- exports2.contentType = contentType;
15350
+ exports2.contentType = contentType2;
15351
15351
  exports2.extension = extension;
15352
15352
  exports2.extensions = /* @__PURE__ */ Object.create(null);
15353
15353
  exports2.lookup = lookup;
@@ -15368,7 +15368,7 @@ var require_mime_types = __commonJS({
15368
15368
  }
15369
15369
  return false;
15370
15370
  }
15371
- function contentType(str) {
15371
+ function contentType2(str) {
15372
15372
  if (!str || typeof str !== "string") {
15373
15373
  return false;
15374
15374
  }
@@ -15510,7 +15510,7 @@ var require_media_typer = __commonJS({
15510
15510
  var require_type_is = __commonJS({
15511
15511
  "../../node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/index.js"(exports2, module2) {
15512
15512
  "use strict";
15513
- var contentType = require_dist();
15513
+ var contentType2 = require_dist();
15514
15514
  var mime = require_mime_types();
15515
15515
  var typer = require_media_typer();
15516
15516
  module2.exports = typeofrequest;
@@ -15591,7 +15591,7 @@ var require_type_is = __commonJS({
15591
15591
  }
15592
15592
  function normalizeType(value) {
15593
15593
  if (!value) return null;
15594
- var type = contentType.parse(value, { parameters: false }).type;
15594
+ var type = contentType2.parse(value, { parameters: false }).type;
15595
15595
  return typer.test(type) ? type : null;
15596
15596
  }
15597
15597
  }
@@ -15607,7 +15607,7 @@ var require_read = __commonJS({
15607
15607
  var onFinished = require_on_finished();
15608
15608
  var zlib = require("node:zlib");
15609
15609
  var hasBody = require_type_is().hasBody;
15610
- var contentType = require_dist();
15610
+ var contentType2 = require_dist();
15611
15611
  module2.exports = read;
15612
15612
  var hasZstandardSupport = "createZstdDecompress" in zlib;
15613
15613
  function read(req, res, next, parse3, debug, options) {
@@ -15763,7 +15763,7 @@ var require_read = __commonJS({
15763
15763
  function getCharset(req) {
15764
15764
  const header = req.headers["content-type"];
15765
15765
  if (!header) return void 0;
15766
- return contentType.parse(header).parameters.charset?.toLowerCase();
15766
+ return contentType2.parse(header).parameters.charset?.toLowerCase();
15767
15767
  }
15768
15768
  }
15769
15769
  });
@@ -15820,11 +15820,11 @@ var require_json = __commonJS({
15820
15820
  var debug = require_src()("body-parser:json");
15821
15821
  var read = require_read();
15822
15822
  var { normalizeOptions } = require_utils();
15823
- module2.exports = json2;
15823
+ module2.exports = json3;
15824
15824
  var FIRST_NON_WHITESPACE_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d]|$)/;
15825
15825
  var JSON_SYNTAX_CHAR = "#";
15826
15826
  var JSON_SYNTAX_REGEXP = /#+/g;
15827
- function json2(options) {
15827
+ function json3(options) {
15828
15828
  const normalizedOptions = normalizeOptions(options, "application/json");
15829
15829
  const parse3 = createJsonParser(options);
15830
15830
  const readOptions = {
@@ -19322,14 +19322,14 @@ var require_etag = __commonJS({
19322
19322
  "../../node_modules/.pnpm/etag@1.8.1/node_modules/etag/index.js"(exports2, module2) {
19323
19323
  "use strict";
19324
19324
  module2.exports = etag;
19325
- var crypto2 = require("crypto");
19325
+ var crypto = require("crypto");
19326
19326
  var Stats = require("fs").Stats;
19327
19327
  var toString = Object.prototype.toString;
19328
19328
  function entitytag(entity) {
19329
19329
  if (entity.length === 0) {
19330
19330
  return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"';
19331
19331
  }
19332
- var hash2 = crypto2.createHash("sha1").update(entity, "utf8").digest("base64").substring(0, 27);
19332
+ var hash2 = crypto.createHash("sha1").update(entity, "utf8").digest("base64").substring(0, 27);
19333
19333
  var len = typeof entity === "string" ? Buffer.byteLength(entity, "utf8") : entity.length;
19334
19334
  return '"' + len.toString(16) + "-" + hash2 + '"';
19335
19335
  }
@@ -21180,7 +21180,7 @@ var require_utils4 = __commonJS({
21180
21180
  "../../node_modules/.pnpm/express@5.2.1/node_modules/express/lib/utils.js"(exports2) {
21181
21181
  "use strict";
21182
21182
  var { METHODS } = require("node:http");
21183
- var contentType = require_content_type();
21183
+ var contentType2 = require_content_type();
21184
21184
  var etag = require_etag();
21185
21185
  var mime = require_mime_types();
21186
21186
  var proxyaddr = require_proxy_addr();
@@ -21284,9 +21284,9 @@ var require_utils4 = __commonJS({
21284
21284
  if (!type || !charset) {
21285
21285
  return type;
21286
21286
  }
21287
- var parsed = contentType.parse(type);
21287
+ var parsed = contentType2.parse(type);
21288
21288
  parsed.parameters.charset = charset;
21289
- return contentType.format(parsed);
21289
+ return contentType2.format(parsed);
21290
21290
  };
21291
21291
  function createETagGenerator(options) {
21292
21292
  return function generateETag(body, encoding) {
@@ -23850,17 +23850,17 @@ var require_on_finished2 = __commonJS({
23850
23850
  // ../../node_modules/.pnpm/cookie-signature@1.2.2/node_modules/cookie-signature/index.js
23851
23851
  var require_cookie_signature = __commonJS({
23852
23852
  "../../node_modules/.pnpm/cookie-signature@1.2.2/node_modules/cookie-signature/index.js"(exports2) {
23853
- var crypto2 = require("crypto");
23853
+ var crypto = require("crypto");
23854
23854
  exports2.sign = function(val, secret) {
23855
23855
  if ("string" != typeof val) throw new TypeError("Cookie value must be provided as a string.");
23856
23856
  if (null == secret) throw new TypeError("Secret key must be provided.");
23857
- return val + "." + crypto2.createHmac("sha256", secret).update(val).digest("base64").replace(/\=+$/, "");
23857
+ return val + "." + crypto.createHmac("sha256", secret).update(val).digest("base64").replace(/\=+$/, "");
23858
23858
  };
23859
23859
  exports2.unsign = function(input2, secret) {
23860
23860
  if ("string" != typeof input2) throw new TypeError("Signed cookie string must be provided.");
23861
23861
  if (null == secret) throw new TypeError("Secret key must be provided.");
23862
23862
  var tentativeValue = input2.slice(0, input2.lastIndexOf(".")), expectedInput = exports2.sign(tentativeValue, secret), expectedBuffer = Buffer.from(expectedInput), inputBuffer = Buffer.from(input2);
23863
- return expectedBuffer.length === inputBuffer.length && crypto2.timingSafeEqual(expectedBuffer, inputBuffer) ? tentativeValue : false;
23863
+ return expectedBuffer.length === inputBuffer.length && crypto.timingSafeEqual(expectedBuffer, inputBuffer) ? tentativeValue : false;
23864
23864
  };
23865
23865
  }
23866
23866
  });
@@ -24180,7 +24180,7 @@ var require_send = __commonJS({
24180
24180
  var lastModified = this.res.getHeader("Last-Modified");
24181
24181
  return parseHttpDate(lastModified) <= parseHttpDate(ifRange);
24182
24182
  };
24183
- SendStream.prototype.redirect = function redirect(path3) {
24183
+ SendStream.prototype.redirect = function redirect2(path3) {
24184
24184
  var res = this.res;
24185
24185
  if (hasListeners(this, "directory")) {
24186
24186
  this.emit("directory", res, path3);
@@ -24711,7 +24711,7 @@ var require_response = __commonJS({
24711
24711
  }
24712
24712
  return this;
24713
24713
  };
24714
- res.json = function json2(obj) {
24714
+ res.json = function json3(obj) {
24715
24715
  var app = this.app;
24716
24716
  var escape2 = app.get("json escape");
24717
24717
  var replacer = app.get("json replacer");
@@ -24818,7 +24818,7 @@ var require_response = __commonJS({
24818
24818
  var fullPath = !opts.root ? resolve(path3) : path3;
24819
24819
  return this.sendFile(fullPath, opts, done);
24820
24820
  };
24821
- res.contentType = res.type = function contentType(type) {
24821
+ res.contentType = res.type = function contentType2(type) {
24822
24822
  var ct = type.indexOf("/") === -1 ? mime.contentType(type) || "application/octet-stream" : type;
24823
24823
  return this.set("Content-Type", ct);
24824
24824
  };
@@ -24911,7 +24911,7 @@ var require_response = __commonJS({
24911
24911
  res.location = function location(url2) {
24912
24912
  return this.set("Location", encodeUrl(url2));
24913
24913
  };
24914
- res.redirect = function redirect(url2) {
24914
+ res.redirect = function redirect2(url2) {
24915
24915
  var address = url2;
24916
24916
  var body;
24917
24917
  var status = 302;
@@ -25036,9 +25036,9 @@ var require_response = __commonJS({
25036
25036
  file2.pipe(res2);
25037
25037
  }
25038
25038
  function stringify(value, replacer, spaces, escape2) {
25039
- var json2 = replacer || spaces ? JSON.stringify(value, replacer, spaces) : JSON.stringify(value);
25040
- if (escape2 && typeof json2 === "string") {
25041
- json2 = json2.replace(/[<>&]/g, function(c) {
25039
+ var json3 = replacer || spaces ? JSON.stringify(value, replacer, spaces) : JSON.stringify(value);
25040
+ if (escape2 && typeof json3 === "string") {
25041
+ json3 = json3.replace(/[<>&]/g, function(c) {
25042
25042
  switch (c.charCodeAt(0)) {
25043
25043
  case 60:
25044
25044
  return "\\u003c";
@@ -25052,7 +25052,7 @@ var require_response = __commonJS({
25052
25052
  }
25053
25053
  });
25054
25054
  }
25055
- return json2;
25055
+ return json3;
25056
25056
  }
25057
25057
  }
25058
25058
  });
@@ -25077,14 +25077,14 @@ var require_serve_static = __commonJS({
25077
25077
  }
25078
25078
  var opts = Object.create(options || null);
25079
25079
  var fallthrough = opts.fallthrough !== false;
25080
- var redirect = opts.redirect !== false;
25080
+ var redirect2 = opts.redirect !== false;
25081
25081
  var setHeaders = opts.setHeaders;
25082
25082
  if (setHeaders && typeof setHeaders !== "function") {
25083
25083
  throw new TypeError("option setHeaders must be function");
25084
25084
  }
25085
25085
  opts.maxage = opts.maxage || opts.maxAge || 0;
25086
25086
  opts.root = resolve(root);
25087
- var onDirectory = redirect ? createRedirectDirectoryListener() : createNotFoundDirectoryListener();
25087
+ var onDirectory = redirect2 ? createRedirectDirectoryListener() : createNotFoundDirectoryListener();
25088
25088
  return function serveStatic2(req, res, next) {
25089
25089
  if (req.method !== "GET" && req.method !== "HEAD") {
25090
25090
  if (fallthrough) {
@@ -25139,7 +25139,7 @@ var require_serve_static = __commonJS({
25139
25139
  };
25140
25140
  }
25141
25141
  function createRedirectDirectoryListener() {
25142
- return function redirect(res) {
25142
+ return function redirect2(res) {
25143
25143
  if (this.hasTrailingSlash()) {
25144
25144
  this.error(404);
25145
25145
  return;
@@ -40910,13 +40910,13 @@ function initializeContext(params) {
40910
40910
  external: params?.external ?? void 0
40911
40911
  };
40912
40912
  }
40913
- function handleUnrepresentable(schema, ctx, json2, params, message) {
40913
+ function handleUnrepresentable(schema, ctx, json3, params, message) {
40914
40914
  const result = typeof ctx.unrepresentable === "function" ? ctx.unrepresentable({ zodSchema: schema, path: params.path, message }) : ctx.unrepresentable;
40915
40915
  if (result === "any")
40916
40916
  return false;
40917
40917
  if (result === void 0 || result === "throw")
40918
40918
  throw new Error(message);
40919
- Object.assign(json2, result);
40919
+ Object.assign(json3, result);
40920
40920
  return true;
40921
40921
  }
40922
40922
  function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
@@ -41152,12 +41152,12 @@ function foldObjects(members2) {
41152
41152
  }
41153
41153
  return folded;
41154
41154
  }
41155
- function foldIntersection(json2) {
41156
- const allOf = json2.allOf;
41155
+ function foldIntersection(json3) {
41156
+ const allOf = json3.allOf;
41157
41157
  if (!Array.isArray(allOf) || allOf.length < 2)
41158
41158
  return;
41159
41159
  for (const key of FOLDABLE_KEYS)
41160
- if (key in json2)
41160
+ if (key in json3)
41161
41161
  return;
41162
41162
  const unions = allOf.filter((m) => UNION_KEYS.some((k) => Array.isArray(m[k])));
41163
41163
  let folded = null;
@@ -41176,8 +41176,8 @@ function foldIntersection(json2) {
41176
41176
  }
41177
41177
  if (!folded)
41178
41178
  return;
41179
- delete json2.allOf;
41180
- assignProps(json2, folded);
41179
+ delete json3.allOf;
41180
+ assignProps(json3, folded);
41181
41181
  }
41182
41182
  function finalize(ctx, schema) {
41183
41183
  const root = ctx.seen.get(schema);
@@ -41259,20 +41259,20 @@ function finalize(ctx, schema) {
41259
41259
  if (ctx.intersections.length) {
41260
41260
  const carriers = /* @__PURE__ */ new Map();
41261
41261
  for (const seen of ctx.seen.values()) {
41262
- for (const json2 of [seen.schema, seen.def]) {
41263
- const allOf = json2?.allOf;
41262
+ for (const json3 of [seen.schema, seen.def]) {
41263
+ const allOf = json3?.allOf;
41264
41264
  if (!Array.isArray(allOf))
41265
41265
  continue;
41266
41266
  const existing = carriers.get(allOf);
41267
41267
  if (existing)
41268
- existing.push(json2);
41268
+ existing.push(json3);
41269
41269
  else
41270
- carriers.set(allOf, [json2]);
41270
+ carriers.set(allOf, [json3]);
41271
41271
  }
41272
41272
  }
41273
41273
  for (const allOf of ctx.intersections) {
41274
- for (const json2 of carriers.get(allOf) ?? [])
41275
- foldIntersection(json2);
41274
+ for (const json3 of carriers.get(allOf) ?? [])
41275
+ foldIntersection(json3);
41276
41276
  }
41277
41277
  }
41278
41278
  }
@@ -41507,29 +41507,29 @@ var exactPatterns = /* @__PURE__ */ new Map([
41507
41507
  ]);
41508
41508
  var exactPattern = (p) => exactPatterns.get(p) ?? p;
41509
41509
  var stringProcessor = (schema, ctx, _json, _params) => {
41510
- const json2 = _json;
41511
- json2.type = "string";
41510
+ const json3 = _json;
41511
+ json3.type = "string";
41512
41512
  const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
41513
41513
  if (typeof minimum === "number")
41514
- json2.minLength = minimum;
41514
+ json3.minLength = minimum;
41515
41515
  if (typeof maximum === "number")
41516
- json2.maxLength = maximum;
41516
+ json3.maxLength = maximum;
41517
41517
  if (format) {
41518
- json2.format = formatMap[format] ?? format;
41519
- if (json2.format === "")
41520
- delete json2.format;
41518
+ json3.format = formatMap[format] ?? format;
41519
+ if (json3.format === "")
41520
+ delete json3.format;
41521
41521
  if (format === "time" || laxFormat) {
41522
- delete json2.format;
41522
+ delete json3.format;
41523
41523
  }
41524
41524
  }
41525
41525
  if (contentEncoding)
41526
- json2.contentEncoding = contentEncoding;
41526
+ json3.contentEncoding = contentEncoding;
41527
41527
  if (patterns && patterns.size > 0) {
41528
41528
  const patternList = [...patterns].map(exactPattern);
41529
41529
  if (patternList.length === 1)
41530
- json2.pattern = patternList[0].source;
41530
+ json3.pattern = patternList[0].source;
41531
41531
  else if (patternList.length > 1) {
41532
- json2.allOf = [
41532
+ json3.allOf = [
41533
41533
  ...patternList.map((regex) => ({
41534
41534
  ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
41535
41535
  pattern: regex.source
@@ -41539,31 +41539,31 @@ var stringProcessor = (schema, ctx, _json, _params) => {
41539
41539
  }
41540
41540
  };
41541
41541
  var numberProcessor = (schema, ctx, _json, params) => {
41542
- const json2 = _json;
41542
+ const json3 = _json;
41543
41543
  const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
41544
- json2.type = isInt ? "integer" : "number";
41544
+ json3.type = isInt ? "integer" : "number";
41545
41545
  const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
41546
41546
  const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
41547
41547
  const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
41548
41548
  if (exMin) {
41549
41549
  if (legacy) {
41550
- json2.minimum = exclusiveMinimum;
41551
- json2.exclusiveMinimum = true;
41550
+ json3.minimum = exclusiveMinimum;
41551
+ json3.exclusiveMinimum = true;
41552
41552
  } else {
41553
- json2.exclusiveMinimum = exclusiveMinimum;
41553
+ json3.exclusiveMinimum = exclusiveMinimum;
41554
41554
  }
41555
41555
  } else if (typeof minimum === "number") {
41556
- json2.minimum = minimum;
41556
+ json3.minimum = minimum;
41557
41557
  }
41558
41558
  if (exMax) {
41559
41559
  if (legacy) {
41560
- json2.maximum = exclusiveMaximum;
41561
- json2.exclusiveMaximum = true;
41560
+ json3.maximum = exclusiveMaximum;
41561
+ json3.exclusiveMaximum = true;
41562
41562
  } else {
41563
- json2.exclusiveMaximum = exclusiveMaximum;
41563
+ json3.exclusiveMaximum = exclusiveMaximum;
41564
41564
  }
41565
41565
  } else if (typeof maximum === "number") {
41566
- json2.maximum = maximum;
41566
+ json3.maximum = maximum;
41567
41567
  }
41568
41568
  if (multipleOf) {
41569
41569
  const divisors = /* @__PURE__ */ new Set();
@@ -41571,75 +41571,75 @@ var numberProcessor = (schema, ctx, _json, params) => {
41571
41571
  if (Number.isFinite(divisor) && divisor !== 0)
41572
41572
  divisors.add(Math.abs(divisor));
41573
41573
  else
41574
- handleUnrepresentable(schema, ctx, json2, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
41574
+ handleUnrepresentable(schema, ctx, json3, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
41575
41575
  }
41576
41576
  const [first, ...rest] = divisors;
41577
41577
  if (first !== void 0)
41578
- json2.multipleOf = first;
41578
+ json3.multipleOf = first;
41579
41579
  if (rest.length)
41580
- json2.allOf = [...json2.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
41580
+ json3.allOf = [...json3.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
41581
41581
  }
41582
41582
  };
41583
- var booleanProcessor = (_schema, _ctx, json2, _params) => {
41584
- json2.type = "boolean";
41583
+ var booleanProcessor = (_schema, _ctx, json3, _params) => {
41584
+ json3.type = "boolean";
41585
41585
  };
41586
- var bigintProcessor = (schema, ctx, json2, params) => {
41587
- handleUnrepresentable(schema, ctx, json2, params, "BigInt cannot be represented in JSON Schema");
41586
+ var bigintProcessor = (schema, ctx, json3, params) => {
41587
+ handleUnrepresentable(schema, ctx, json3, params, "BigInt cannot be represented in JSON Schema");
41588
41588
  };
41589
- var symbolProcessor = (schema, ctx, json2, params) => {
41590
- handleUnrepresentable(schema, ctx, json2, params, "Symbols cannot be represented in JSON Schema");
41589
+ var symbolProcessor = (schema, ctx, json3, params) => {
41590
+ handleUnrepresentable(schema, ctx, json3, params, "Symbols cannot be represented in JSON Schema");
41591
41591
  };
41592
- var nullProcessor = (_schema, ctx, json2, _params) => {
41592
+ var nullProcessor = (_schema, ctx, json3, _params) => {
41593
41593
  if (ctx.target === "openapi-3.0") {
41594
- json2.type = "string";
41595
- json2.nullable = true;
41596
- json2.enum = [null];
41594
+ json3.type = "string";
41595
+ json3.nullable = true;
41596
+ json3.enum = [null];
41597
41597
  } else {
41598
- json2.type = "null";
41598
+ json3.type = "null";
41599
41599
  }
41600
41600
  };
41601
- var undefinedProcessor = (schema, ctx, json2, params) => {
41602
- handleUnrepresentable(schema, ctx, json2, params, "Undefined cannot be represented in JSON Schema");
41601
+ var undefinedProcessor = (schema, ctx, json3, params) => {
41602
+ handleUnrepresentable(schema, ctx, json3, params, "Undefined cannot be represented in JSON Schema");
41603
41603
  };
41604
- var voidProcessor = (schema, ctx, json2, params) => {
41605
- handleUnrepresentable(schema, ctx, json2, params, "Void cannot be represented in JSON Schema");
41604
+ var voidProcessor = (schema, ctx, json3, params) => {
41605
+ handleUnrepresentable(schema, ctx, json3, params, "Void cannot be represented in JSON Schema");
41606
41606
  };
41607
- var neverProcessor = (_schema, _ctx, json2, _params) => {
41608
- json2.not = {};
41607
+ var neverProcessor = (_schema, _ctx, json3, _params) => {
41608
+ json3.not = {};
41609
41609
  };
41610
41610
  var anyProcessor = (_schema, _ctx, _json, _params) => {
41611
41611
  };
41612
41612
  var unknownProcessor = (_schema, _ctx, _json, _params) => {
41613
41613
  };
41614
- var dateProcessor = (schema, ctx, json2, params) => {
41615
- handleUnrepresentable(schema, ctx, json2, params, "Date cannot be represented in JSON Schema");
41614
+ var dateProcessor = (schema, ctx, json3, params) => {
41615
+ handleUnrepresentable(schema, ctx, json3, params, "Date cannot be represented in JSON Schema");
41616
41616
  };
41617
- var enumProcessor = (schema, _ctx, json2, _params) => {
41617
+ var enumProcessor = (schema, _ctx, json3, _params) => {
41618
41618
  const def = schema._zod.def;
41619
41619
  const values = getEnumValues(def.entries);
41620
41620
  if (values.length === 0) {
41621
- json2.not = {};
41621
+ json3.not = {};
41622
41622
  return;
41623
41623
  }
41624
41624
  if (values.every((v) => typeof v === "number"))
41625
- json2.type = "number";
41625
+ json3.type = "number";
41626
41626
  if (values.every((v) => typeof v === "string"))
41627
- json2.type = "string";
41628
- json2.enum = values;
41627
+ json3.type = "string";
41628
+ json3.enum = values;
41629
41629
  };
41630
- var literalProcessor = (schema, ctx, json2, params) => {
41630
+ var literalProcessor = (schema, ctx, json3, params) => {
41631
41631
  const def = schema._zod.def;
41632
41632
  if (def.values.length === 0) {
41633
- json2.not = {};
41633
+ json3.not = {};
41634
41634
  return;
41635
41635
  }
41636
41636
  const vals = [];
41637
41637
  for (const val of def.values) {
41638
41638
  if (val === void 0) {
41639
- if (handleUnrepresentable(schema, ctx, json2, params, "Literal `undefined` cannot be represented in JSON Schema"))
41639
+ if (handleUnrepresentable(schema, ctx, json3, params, "Literal `undefined` cannot be represented in JSON Schema"))
41640
41640
  return;
41641
41641
  } else if (typeof val === "bigint") {
41642
- if (handleUnrepresentable(schema, ctx, json2, params, "BigInt literals cannot be represented in JSON Schema"))
41642
+ if (handleUnrepresentable(schema, ctx, json3, params, "BigInt literals cannot be represented in JSON Schema"))
41643
41643
  return;
41644
41644
  vals.push(Number(val));
41645
41645
  } else {
@@ -41649,37 +41649,37 @@ var literalProcessor = (schema, ctx, json2, params) => {
41649
41649
  if (vals.length === 0) {
41650
41650
  } else if (vals.length === 1) {
41651
41651
  const val = vals[0];
41652
- json2.type = val === null ? "null" : typeof val;
41652
+ json3.type = val === null ? "null" : typeof val;
41653
41653
  if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
41654
- json2.enum = [val];
41654
+ json3.enum = [val];
41655
41655
  } else {
41656
- json2.const = val;
41656
+ json3.const = val;
41657
41657
  }
41658
41658
  } else {
41659
41659
  if (vals.every((v) => typeof v === "number"))
41660
- json2.type = "number";
41660
+ json3.type = "number";
41661
41661
  if (vals.every((v) => typeof v === "string"))
41662
- json2.type = "string";
41662
+ json3.type = "string";
41663
41663
  if (vals.every((v) => typeof v === "boolean"))
41664
- json2.type = "boolean";
41664
+ json3.type = "boolean";
41665
41665
  if (vals.every((v) => v === null))
41666
- json2.type = "null";
41667
- json2.enum = vals;
41666
+ json3.type = "null";
41667
+ json3.enum = vals;
41668
41668
  }
41669
41669
  };
41670
- var nanProcessor = (schema, ctx, json2, params) => {
41671
- handleUnrepresentable(schema, ctx, json2, params, "NaN cannot be represented in JSON Schema");
41670
+ var nanProcessor = (schema, ctx, json3, params) => {
41671
+ handleUnrepresentable(schema, ctx, json3, params, "NaN cannot be represented in JSON Schema");
41672
41672
  };
41673
- var templateLiteralProcessor = (schema, _ctx, json2, _params) => {
41674
- const _json = json2;
41673
+ var templateLiteralProcessor = (schema, _ctx, json3, _params) => {
41674
+ const _json = json3;
41675
41675
  const pattern = schema._zod.pattern;
41676
41676
  if (!pattern)
41677
41677
  throw new Error("Pattern not found in template literal");
41678
41678
  _json.type = "string";
41679
41679
  _json.pattern = pattern.source;
41680
41680
  };
41681
- var fileProcessor = (schema, _ctx, json2, _params) => {
41682
- const _json = json2;
41681
+ var fileProcessor = (schema, _ctx, json3, _params) => {
41682
+ const _json = json3;
41683
41683
  _json.type = "string";
41684
41684
  _json.format = "binary";
41685
41685
  _json.contentEncoding = "binary";
@@ -41697,34 +41697,34 @@ var fileProcessor = (schema, _ctx, json2, _params) => {
41697
41697
  else
41698
41698
  _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
41699
41699
  };
41700
- var successProcessor = (_schema, _ctx, json2, _params) => {
41701
- json2.type = "boolean";
41700
+ var successProcessor = (_schema, _ctx, json3, _params) => {
41701
+ json3.type = "boolean";
41702
41702
  };
41703
- var customProcessor = (schema, ctx, json2, params) => {
41704
- handleUnrepresentable(schema, ctx, json2, params, "Custom types cannot be represented in JSON Schema");
41703
+ var customProcessor = (schema, ctx, json3, params) => {
41704
+ handleUnrepresentable(schema, ctx, json3, params, "Custom types cannot be represented in JSON Schema");
41705
41705
  };
41706
- var functionProcessor = (schema, ctx, json2, params) => {
41707
- handleUnrepresentable(schema, ctx, json2, params, "Function types cannot be represented in JSON Schema");
41706
+ var functionProcessor = (schema, ctx, json3, params) => {
41707
+ handleUnrepresentable(schema, ctx, json3, params, "Function types cannot be represented in JSON Schema");
41708
41708
  };
41709
- var transformProcessor = (schema, ctx, json2, params) => {
41710
- handleUnrepresentable(schema, ctx, json2, params, "Transforms cannot be represented in JSON Schema");
41709
+ var transformProcessor = (schema, ctx, json3, params) => {
41710
+ handleUnrepresentable(schema, ctx, json3, params, "Transforms cannot be represented in JSON Schema");
41711
41711
  };
41712
- var mapProcessor = (schema, ctx, json2, params) => {
41713
- handleUnrepresentable(schema, ctx, json2, params, "Map cannot be represented in JSON Schema");
41712
+ var mapProcessor = (schema, ctx, json3, params) => {
41713
+ handleUnrepresentable(schema, ctx, json3, params, "Map cannot be represented in JSON Schema");
41714
41714
  };
41715
- var setProcessor = (schema, ctx, json2, params) => {
41716
- handleUnrepresentable(schema, ctx, json2, params, "Set cannot be represented in JSON Schema");
41715
+ var setProcessor = (schema, ctx, json3, params) => {
41716
+ handleUnrepresentable(schema, ctx, json3, params, "Set cannot be represented in JSON Schema");
41717
41717
  };
41718
41718
  var arrayProcessor = (schema, ctx, _json, params) => {
41719
- const json2 = _json;
41719
+ const json3 = _json;
41720
41720
  const def = schema._zod.def;
41721
41721
  const { minimum, maximum } = aggregateChecks(schema);
41722
41722
  if (typeof minimum === "number")
41723
- json2.minItems = minimum;
41723
+ json3.minItems = minimum;
41724
41724
  if (typeof maximum === "number")
41725
- json2.maxItems = maximum;
41726
- json2.type = "array";
41727
- json2.items = processSchema(def.element, ctx, {
41725
+ json3.maxItems = maximum;
41726
+ json3.type = "array";
41727
+ json3.items = processSchema(def.element, ctx, {
41728
41728
  ...params,
41729
41729
  path: [...params.path, "items"]
41730
41730
  });
@@ -41740,17 +41740,17 @@ function inputOptin(schema) {
41740
41740
  return schema._zod.optin;
41741
41741
  }
41742
41742
  var objectProcessor = (schema, ctx, _json, params) => {
41743
- const json2 = _json;
41743
+ const json3 = _json;
41744
41744
  const def = schema._zod.def;
41745
41745
  const shape = def.shape;
41746
41746
  const symbolKeys = Object.getOwnPropertySymbols(shape);
41747
- if (symbolKeys.length && handleUnrepresentable(schema, ctx, json2, params, "Symbol keys cannot be represented in JSON Schema")) {
41747
+ if (symbolKeys.length && handleUnrepresentable(schema, ctx, json3, params, "Symbol keys cannot be represented in JSON Schema")) {
41748
41748
  return;
41749
41749
  }
41750
- json2.type = "object";
41751
- json2.properties = {};
41750
+ json3.type = "object";
41751
+ json3.properties = {};
41752
41752
  for (const key in shape) {
41753
- assignProp(json2.properties, key, processSchema(shape[key], ctx, {
41753
+ assignProp(json3.properties, key, processSchema(shape[key], ctx, {
41754
41754
  ...params,
41755
41755
  path: [...params.path, "properties", key]
41756
41756
  }));
@@ -41763,21 +41763,21 @@ var objectProcessor = (schema, ctx, _json, params) => {
41763
41763
  }
41764
41764
  }
41765
41765
  if (requiredKeys.length > 0) {
41766
- json2.required = requiredKeys;
41766
+ json3.required = requiredKeys;
41767
41767
  }
41768
41768
  if (def.catchall?._zod.def.type === "never") {
41769
- json2.additionalProperties = false;
41769
+ json3.additionalProperties = false;
41770
41770
  } else if (!def.catchall) {
41771
41771
  if (ctx.io === "output")
41772
- json2.additionalProperties = false;
41772
+ json3.additionalProperties = false;
41773
41773
  } else if (def.catchall) {
41774
- json2.additionalProperties = processSchema(def.catchall, ctx, {
41774
+ json3.additionalProperties = processSchema(def.catchall, ctx, {
41775
41775
  ...params,
41776
41776
  path: [...params.path, "additionalProperties"]
41777
41777
  });
41778
41778
  }
41779
41779
  };
41780
- var unionProcessor = (schema, ctx, json2, params) => {
41780
+ var unionProcessor = (schema, ctx, json3, params) => {
41781
41781
  const def = schema._zod.def;
41782
41782
  const isExclusive = def.inclusive === false;
41783
41783
  const options = def.options.map((x, i) => processSchema(x, ctx, {
@@ -41785,12 +41785,12 @@ var unionProcessor = (schema, ctx, json2, params) => {
41785
41785
  path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
41786
41786
  }));
41787
41787
  if (isExclusive) {
41788
- json2.oneOf = options;
41788
+ json3.oneOf = options;
41789
41789
  } else {
41790
- json2.anyOf = options;
41790
+ json3.anyOf = options;
41791
41791
  }
41792
41792
  };
41793
- var intersectionProcessor = (schema, ctx, json2, params) => {
41793
+ var intersectionProcessor = (schema, ctx, json3, params) => {
41794
41794
  const def = schema._zod.def;
41795
41795
  const a = processSchema(def.left, ctx, {
41796
41796
  ...params,
@@ -41805,13 +41805,13 @@ var intersectionProcessor = (schema, ctx, json2, params) => {
41805
41805
  ...isSimpleIntersection(a) ? a.allOf : [a],
41806
41806
  ...isSimpleIntersection(b) ? b.allOf : [b]
41807
41807
  ];
41808
- json2.allOf = allOf;
41808
+ json3.allOf = allOf;
41809
41809
  ctx.intersections.push(allOf);
41810
41810
  };
41811
41811
  var tupleProcessor = (schema, ctx, _json, params) => {
41812
- const json2 = _json;
41812
+ const json3 = _json;
41813
41813
  const def = schema._zod.def;
41814
- json2.type = "array";
41814
+ json3.type = "array";
41815
41815
  const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
41816
41816
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
41817
41817
  const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
@@ -41833,70 +41833,70 @@ var tupleProcessor = (schema, ctx, _json, params) => {
41833
41833
  const maxItems = def.items.length;
41834
41834
  const isClosed = !def.rest;
41835
41835
  if (ctx.target === "draft-2020-12") {
41836
- json2.prefixItems = prefixItems;
41836
+ json3.prefixItems = prefixItems;
41837
41837
  if (isClosed) {
41838
- json2.items = false;
41838
+ json3.items = false;
41839
41839
  } else if (rest) {
41840
- json2.items = rest;
41840
+ json3.items = rest;
41841
41841
  }
41842
41842
  if (minItems > 0)
41843
- json2.minItems = minItems;
41843
+ json3.minItems = minItems;
41844
41844
  if (isClosed)
41845
- json2.maxItems = maxItems;
41845
+ json3.maxItems = maxItems;
41846
41846
  } else if (ctx.target === "openapi-3.0") {
41847
- json2.items = {
41847
+ json3.items = {
41848
41848
  anyOf: prefixItems
41849
41849
  };
41850
41850
  if (rest) {
41851
- json2.items.anyOf.push(rest);
41851
+ json3.items.anyOf.push(rest);
41852
41852
  }
41853
41853
  if (minItems > 0)
41854
- json2.minItems = minItems;
41854
+ json3.minItems = minItems;
41855
41855
  if (isClosed)
41856
- json2.maxItems = maxItems;
41856
+ json3.maxItems = maxItems;
41857
41857
  } else {
41858
- json2.items = prefixItems;
41858
+ json3.items = prefixItems;
41859
41859
  if (isClosed) {
41860
- json2.additionalItems = false;
41860
+ json3.additionalItems = false;
41861
41861
  } else if (rest) {
41862
- json2.additionalItems = rest;
41862
+ json3.additionalItems = rest;
41863
41863
  }
41864
41864
  if (minItems > 0)
41865
- json2.minItems = minItems;
41865
+ json3.minItems = minItems;
41866
41866
  if (isClosed)
41867
- json2.maxItems = maxItems;
41867
+ json3.maxItems = maxItems;
41868
41868
  }
41869
41869
  const { minimum, maximum } = aggregateChecks(schema);
41870
41870
  if (typeof minimum === "number")
41871
- json2.minItems = minimum;
41871
+ json3.minItems = minimum;
41872
41872
  if (typeof maximum === "number")
41873
- json2.maxItems = maximum;
41873
+ json3.maxItems = maximum;
41874
41874
  };
41875
- function stringifyKeyNames(bySchema, json2, visited) {
41876
- if (json2.$ref) {
41877
- if (visited.has(json2))
41878
- return json2;
41879
- visited.add(json2);
41880
- const def = bySchema.get(json2)?.def;
41875
+ function stringifyKeyNames(bySchema, json3, visited) {
41876
+ if (json3.$ref) {
41877
+ if (visited.has(json3))
41878
+ return json3;
41879
+ visited.add(json3);
41880
+ const def = bySchema.get(json3)?.def;
41881
41881
  if (!def)
41882
- return json2;
41882
+ return json3;
41883
41883
  const inlined = stringifyKeyNames(bySchema, def, visited);
41884
- return inlined === def ? json2 : inlined;
41884
+ return inlined === def ? json3 : inlined;
41885
41885
  }
41886
41886
  for (const keyword of ["anyOf", "oneOf"]) {
41887
- const branches = json2[keyword];
41887
+ const branches = json3[keyword];
41888
41888
  if (!Array.isArray(branches))
41889
41889
  continue;
41890
41890
  const mapped = branches.map((branch) => stringifyKeyNames(bySchema, branch, visited));
41891
41891
  if (mapped.some((branch, i) => branch !== branches[i]))
41892
- json2 = { ...json2, [keyword]: mapped };
41892
+ json3 = { ...json3, [keyword]: mapped };
41893
41893
  }
41894
- const types = Array.isArray(json2.type) ? json2.type : [json2.type];
41894
+ const types = Array.isArray(json3.type) ? json3.type : [json3.type];
41895
41895
  const numericType = !types.includes("string") && types.some((t) => t === "number" || t === "integer");
41896
- const values = json2.enum ?? (json2.const !== void 0 ? [json2.const] : void 0);
41896
+ const values = json3.enum ?? (json3.const !== void 0 ? [json3.const] : void 0);
41897
41897
  if (!numericType && !values?.some((v) => typeof v === "number"))
41898
- return json2;
41899
- const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json2;
41898
+ return json3;
41899
+ const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json3;
41900
41900
  if (rest.enum)
41901
41901
  rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
41902
41902
  else if (typeof rest.const === "number")
@@ -41936,9 +41936,9 @@ function rewriteKeyNames(ctx) {
41936
41936
  }
41937
41937
  }
41938
41938
  var recordProcessor = (schema, ctx, _json, params) => {
41939
- const json2 = _json;
41939
+ const json3 = _json;
41940
41940
  const def = schema._zod.def;
41941
- json2.type = "object";
41941
+ json3.type = "object";
41942
41942
  const keyType = def.keyType;
41943
41943
  const patterns = aggregateChecks(keyType).patterns;
41944
41944
  if (def.mode === "loose" && patterns && patterns.size > 0) {
@@ -41946,13 +41946,13 @@ var recordProcessor = (schema, ctx, _json, params) => {
41946
41946
  ...params,
41947
41947
  path: [...params.path, "patternProperties", "*"]
41948
41948
  });
41949
- json2.patternProperties = {};
41949
+ json3.patternProperties = {};
41950
41950
  for (const pattern of patterns) {
41951
- assignProp(json2.patternProperties, exactPattern(pattern).source, valueSchema);
41951
+ assignProp(json3.patternProperties, exactPattern(pattern).source, valueSchema);
41952
41952
  }
41953
41953
  } else {
41954
41954
  if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
41955
- json2.propertyNames = processSchema(def.keyType, ctx, {
41955
+ json3.propertyNames = processSchema(def.keyType, ctx, {
41956
41956
  ...params,
41957
41957
  path: [...params.path, "propertyNames"]
41958
41958
  });
@@ -41964,7 +41964,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
41964
41964
  }
41965
41965
  pending.push(schema);
41966
41966
  }
41967
- json2.additionalProperties = processSchema(def.valueType, ctx, {
41967
+ json3.additionalProperties = processSchema(def.valueType, ctx, {
41968
41968
  ...params,
41969
41969
  path: [...params.path, "additionalProperties"]
41970
41970
  });
@@ -41974,19 +41974,19 @@ var recordProcessor = (schema, ctx, _json, params) => {
41974
41974
  if (keyValues && !def.partial && !omittableOnInput) {
41975
41975
  const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
41976
41976
  if (validKeyValues.length > 0) {
41977
- json2.required = validKeyValues.map(String);
41977
+ json3.required = validKeyValues.map(String);
41978
41978
  }
41979
41979
  }
41980
41980
  };
41981
- var nullableProcessor = (schema, ctx, json2, params) => {
41981
+ var nullableProcessor = (schema, ctx, json3, params) => {
41982
41982
  const def = schema._zod.def;
41983
41983
  const inner = processSchema(def.innerType, ctx, params);
41984
41984
  const seen = ctx.seen.get(schema);
41985
41985
  if (ctx.target === "openapi-3.0") {
41986
41986
  seen.ref = def.innerType;
41987
- json2.nullable = true;
41987
+ json3.nullable = true;
41988
41988
  } else {
41989
- json2.anyOf = [inner, { type: "null" }];
41989
+ json3.anyOf = [inner, { type: "null" }];
41990
41990
  }
41991
41991
  };
41992
41992
  var nonoptionalProcessor = (schema, ctx, _json, params) => {
@@ -41996,7 +41996,7 @@ var nonoptionalProcessor = (schema, ctx, _json, params) => {
41996
41996
  seen.ref = def.innerType;
41997
41997
  };
41998
41998
  var UNREPRESENTABLE_DEFAULT = /* @__PURE__ */ Symbol();
41999
- function serializeDefaultValue(value, schema, ctx, json2, params) {
41999
+ function serializeDefaultValue(value, schema, ctx, json3, params) {
42000
42000
  let unrepresentable = false;
42001
42001
  const serialized = JSON.stringify(value, (_, val) => {
42002
42002
  if (typeof val !== "bigint")
@@ -42006,30 +42006,30 @@ function serializeDefaultValue(value, schema, ctx, json2, params) {
42006
42006
  });
42007
42007
  if (!unrepresentable)
42008
42008
  return JSON.parse(serialized);
42009
- handleUnrepresentable(schema, ctx, json2, params, "BigInt defaults cannot be represented in JSON Schema");
42009
+ handleUnrepresentable(schema, ctx, json3, params, "BigInt defaults cannot be represented in JSON Schema");
42010
42010
  return UNREPRESENTABLE_DEFAULT;
42011
42011
  }
42012
- var defaultProcessor = (schema, ctx, json2, params) => {
42012
+ var defaultProcessor = (schema, ctx, json3, params) => {
42013
42013
  const def = schema._zod.def;
42014
42014
  processSchema(def.innerType, ctx, params);
42015
42015
  const seen = ctx.seen.get(schema);
42016
42016
  seen.ref = def.innerType;
42017
- const value = serializeDefaultValue(def.defaultValue, schema, ctx, json2, params);
42017
+ const value = serializeDefaultValue(def.defaultValue, schema, ctx, json3, params);
42018
42018
  if (value !== UNREPRESENTABLE_DEFAULT)
42019
- json2.default = value;
42019
+ json3.default = value;
42020
42020
  };
42021
- var prefaultProcessor = (schema, ctx, json2, params) => {
42021
+ var prefaultProcessor = (schema, ctx, json3, params) => {
42022
42022
  const def = schema._zod.def;
42023
42023
  processSchema(def.innerType, ctx, params);
42024
42024
  const seen = ctx.seen.get(schema);
42025
42025
  seen.ref = def.innerType;
42026
42026
  if (ctx.io !== "input")
42027
42027
  return;
42028
- const value = serializeDefaultValue(def.defaultValue, schema, ctx, json2, params);
42028
+ const value = serializeDefaultValue(def.defaultValue, schema, ctx, json3, params);
42029
42029
  if (value !== UNREPRESENTABLE_DEFAULT)
42030
- json2._prefault = value;
42030
+ json3._prefault = value;
42031
42031
  };
42032
- var catchProcessor = (schema, ctx, json2, params) => {
42032
+ var catchProcessor = (schema, ctx, json3, params) => {
42033
42033
  const def = schema._zod.def;
42034
42034
  processSchema(def.innerType, ctx, params);
42035
42035
  const seen = ctx.seen.get(schema);
@@ -42038,10 +42038,10 @@ var catchProcessor = (schema, ctx, json2, params) => {
42038
42038
  try {
42039
42039
  catchValue = def.catchValue(void 0);
42040
42040
  } catch {
42041
- handleUnrepresentable(schema, ctx, json2, params, "Dynamic catch values are not supported in JSON Schema");
42041
+ handleUnrepresentable(schema, ctx, json3, params, "Dynamic catch values are not supported in JSON Schema");
42042
42042
  return;
42043
42043
  }
42044
- json2.default = catchValue;
42044
+ json3.default = catchValue;
42045
42045
  };
42046
42046
  var pipeProcessor = (schema, ctx, _json, params) => {
42047
42047
  const def = schema._zod.def;
@@ -42051,12 +42051,12 @@ var pipeProcessor = (schema, ctx, _json, params) => {
42051
42051
  const seen = ctx.seen.get(schema);
42052
42052
  seen.ref = innerType;
42053
42053
  };
42054
- var readonlyProcessor = (schema, ctx, json2, params) => {
42054
+ var readonlyProcessor = (schema, ctx, json3, params) => {
42055
42055
  const def = schema._zod.def;
42056
42056
  processSchema(def.innerType, ctx, params);
42057
42057
  const seen = ctx.seen.get(schema);
42058
42058
  seen.ref = def.innerType;
42059
- json2.readOnly = true;
42059
+ json3.readOnly = true;
42060
42060
  };
42061
42061
  var promiseProcessor = (schema, ctx, _json, params) => {
42062
42062
  const def = schema._zod.def;
@@ -42698,7 +42698,7 @@ var _ZodString = /* @__PURE__ */ $constructor(
42698
42698
  (inst, def) => {
42699
42699
  $ZodString.init(inst, def);
42700
42700
  ZodType.init(inst, def);
42701
- inst._zod.processJSONSchema = (ctx, json2, params) => stringProcessor(inst, ctx, json2, params);
42701
+ inst._zod.processJSONSchema = (ctx, json3, params) => stringProcessor(inst, ctx, json3, params);
42702
42702
  },
42703
42703
  /* @__PURE__ */ util_exports.derived({
42704
42704
  format: (inst) => aggregateChecks(inst).format ?? null,
@@ -43057,7 +43057,7 @@ var ZodNumber = /* @__PURE__ */ $constructor(
43057
43057
  (inst, def) => {
43058
43058
  $ZodNumber.init(inst, def);
43059
43059
  ZodType.init(inst, def);
43060
- inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params);
43060
+ inst._zod.processJSONSchema = (ctx, json3, params) => numberProcessor(inst, ctx, json3, params);
43061
43061
  inst.isFinite = true;
43062
43062
  },
43063
43063
  /* @__PURE__ */ util_exports.derived({
@@ -43147,7 +43147,7 @@ function uint32(params) {
43147
43147
  var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
43148
43148
  $ZodBoolean.init(inst, def);
43149
43149
  ZodType.init(inst, def);
43150
- inst._zod.processJSONSchema = (ctx, json2, params) => booleanProcessor(inst, ctx, json2, params);
43150
+ inst._zod.processJSONSchema = (ctx, json3, params) => booleanProcessor(inst, ctx, json3, params);
43151
43151
  });
43152
43152
  function boolean2(params) {
43153
43153
  return _boolean(ZodBoolean, params);
@@ -43157,7 +43157,7 @@ var ZodBigInt = /* @__PURE__ */ $constructor(
43157
43157
  (inst, def) => {
43158
43158
  $ZodBigInt.init(inst, def);
43159
43159
  ZodType.init(inst, def);
43160
- inst._zod.processJSONSchema = (ctx, json2, params) => bigintProcessor(inst, ctx, json2, params);
43160
+ inst._zod.processJSONSchema = (ctx, json3, params) => bigintProcessor(inst, ctx, json3, params);
43161
43161
  },
43162
43162
  /* @__PURE__ */ util_exports.derived({
43163
43163
  minValue: (inst) => aggregateChecks(inst).minimum ?? null,
@@ -43215,7 +43215,7 @@ function uint64(params) {
43215
43215
  var ZodSymbol = /* @__PURE__ */ $constructor("ZodSymbol", (inst, def) => {
43216
43216
  $ZodSymbol.init(inst, def);
43217
43217
  ZodType.init(inst, def);
43218
- inst._zod.processJSONSchema = (ctx, json2, params) => symbolProcessor(inst, ctx, json2, params);
43218
+ inst._zod.processJSONSchema = (ctx, json3, params) => symbolProcessor(inst, ctx, json3, params);
43219
43219
  });
43220
43220
  function symbol(params) {
43221
43221
  return _symbol(ZodSymbol, params);
@@ -43223,7 +43223,7 @@ function symbol(params) {
43223
43223
  var ZodUndefined = /* @__PURE__ */ $constructor("ZodUndefined", (inst, def) => {
43224
43224
  $ZodUndefined.init(inst, def);
43225
43225
  ZodType.init(inst, def);
43226
- inst._zod.processJSONSchema = (ctx, json2, params) => undefinedProcessor(inst, ctx, json2, params);
43226
+ inst._zod.processJSONSchema = (ctx, json3, params) => undefinedProcessor(inst, ctx, json3, params);
43227
43227
  });
43228
43228
  function _undefined3(params) {
43229
43229
  return _undefined2(ZodUndefined, params);
@@ -43231,7 +43231,7 @@ function _undefined3(params) {
43231
43231
  var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
43232
43232
  $ZodNull.init(inst, def);
43233
43233
  ZodType.init(inst, def);
43234
- inst._zod.processJSONSchema = (ctx, json2, params) => nullProcessor(inst, ctx, json2, params);
43234
+ inst._zod.processJSONSchema = (ctx, json3, params) => nullProcessor(inst, ctx, json3, params);
43235
43235
  });
43236
43236
  function _null3(params) {
43237
43237
  return _null2(ZodNull, params);
@@ -43239,7 +43239,7 @@ function _null3(params) {
43239
43239
  var ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
43240
43240
  $ZodAny.init(inst, def);
43241
43241
  ZodType.init(inst, def);
43242
- inst._zod.processJSONSchema = (ctx, json2, params) => anyProcessor(inst, ctx, json2, params);
43242
+ inst._zod.processJSONSchema = (ctx, json3, params) => anyProcessor(inst, ctx, json3, params);
43243
43243
  });
43244
43244
  function any() {
43245
43245
  return _any(ZodAny);
@@ -43247,7 +43247,7 @@ function any() {
43247
43247
  var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
43248
43248
  $ZodUnknown.init(inst, def);
43249
43249
  ZodType.init(inst, def);
43250
- inst._zod.processJSONSchema = (ctx, json2, params) => unknownProcessor(inst, ctx, json2, params);
43250
+ inst._zod.processJSONSchema = (ctx, json3, params) => unknownProcessor(inst, ctx, json3, params);
43251
43251
  });
43252
43252
  function unknown() {
43253
43253
  return _unknown(ZodUnknown);
@@ -43255,7 +43255,7 @@ function unknown() {
43255
43255
  var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
43256
43256
  $ZodNever.init(inst, def);
43257
43257
  ZodType.init(inst, def);
43258
- inst._zod.processJSONSchema = (ctx, json2, params) => neverProcessor(inst, ctx, json2, params);
43258
+ inst._zod.processJSONSchema = (ctx, json3, params) => neverProcessor(inst, ctx, json3, params);
43259
43259
  });
43260
43260
  function never(params) {
43261
43261
  return _never(ZodNever, params);
@@ -43263,7 +43263,7 @@ function never(params) {
43263
43263
  var ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
43264
43264
  $ZodVoid.init(inst, def);
43265
43265
  ZodType.init(inst, def);
43266
- inst._zod.processJSONSchema = (ctx, json2, params) => voidProcessor(inst, ctx, json2, params);
43266
+ inst._zod.processJSONSchema = (ctx, json3, params) => voidProcessor(inst, ctx, json3, params);
43267
43267
  });
43268
43268
  function _void2(params) {
43269
43269
  return _void(ZodVoid, params);
@@ -43273,7 +43273,7 @@ var ZodDate = /* @__PURE__ */ $constructor(
43273
43273
  (inst, def) => {
43274
43274
  $ZodDate.init(inst, def);
43275
43275
  ZodType.init(inst, def);
43276
- inst._zod.processJSONSchema = (ctx, json2, params) => dateProcessor(inst, ctx, json2, params);
43276
+ inst._zod.processJSONSchema = (ctx, json3, params) => dateProcessor(inst, ctx, json3, params);
43277
43277
  inst.min = (value, params) => inst.check(_gte(value, params));
43278
43278
  inst.max = (value, params) => inst.check(_lte(value, params));
43279
43279
  },
@@ -43295,7 +43295,7 @@ var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
43295
43295
  _ensureDefaultMemoizer();
43296
43296
  $ZodArray.init(inst, def);
43297
43297
  ZodType.init(inst, def);
43298
- inst._zod.processJSONSchema = (ctx, json2, params) => arrayProcessor(inst, ctx, json2, params);
43298
+ inst._zod.processJSONSchema = (ctx, json3, params) => arrayProcessor(inst, ctx, json3, params);
43299
43299
  inst.element = def.element;
43300
43300
  }, {
43301
43301
  min(n, params) {
@@ -43325,7 +43325,7 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
43325
43325
  _ensureDefaultMemoizer();
43326
43326
  $ZodObjectJIT.init(inst, def);
43327
43327
  ZodType.init(inst, def);
43328
- inst._zod.processJSONSchema = (ctx, json2, params) => objectProcessor(inst, ctx, json2, params);
43328
+ inst._zod.processJSONSchema = (ctx, json3, params) => objectProcessor(inst, ctx, json3, params);
43329
43329
  util_exports.installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
43330
43330
  }, {
43331
43331
  keyof() {
@@ -43398,7 +43398,7 @@ function looseObject(shape, params) {
43398
43398
  var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
43399
43399
  $ZodUnion.init(inst, def);
43400
43400
  ZodType.init(inst, def);
43401
- inst._zod.processJSONSchema = (ctx, json2, params) => unionProcessor(inst, ctx, json2, params);
43401
+ inst._zod.processJSONSchema = (ctx, json3, params) => unionProcessor(inst, ctx, json3, params);
43402
43402
  inst.options = def.options;
43403
43403
  });
43404
43404
  function union(options, params) {
@@ -43411,7 +43411,7 @@ function union(options, params) {
43411
43411
  var ZodXor = /* @__PURE__ */ $constructor("ZodXor", (inst, def) => {
43412
43412
  ZodUnion.init(inst, def);
43413
43413
  $ZodXor.init(inst, def);
43414
- inst._zod.processJSONSchema = (ctx, json2, params) => unionProcessor(inst, ctx, json2, params);
43414
+ inst._zod.processJSONSchema = (ctx, json3, params) => unionProcessor(inst, ctx, json3, params);
43415
43415
  inst.options = def.options;
43416
43416
  });
43417
43417
  function xor(options, params) {
@@ -43437,7 +43437,7 @@ function discriminatedUnion(discriminator, options, params) {
43437
43437
  var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
43438
43438
  $ZodIntersection.init(inst, def);
43439
43439
  ZodType.init(inst, def);
43440
- inst._zod.processJSONSchema = (ctx, json2, params) => intersectionProcessor(inst, ctx, json2, params);
43440
+ inst._zod.processJSONSchema = (ctx, json3, params) => intersectionProcessor(inst, ctx, json3, params);
43441
43441
  });
43442
43442
  function intersection(left, right) {
43443
43443
  return new ZodIntersection({
@@ -43450,7 +43450,7 @@ var ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => {
43450
43450
  _ensureDefaultMemoizer();
43451
43451
  $ZodTuple.init(inst, def);
43452
43452
  ZodType.init(inst, def);
43453
- inst._zod.processJSONSchema = (ctx, json2, params) => tupleProcessor(inst, ctx, json2, params);
43453
+ inst._zod.processJSONSchema = (ctx, json3, params) => tupleProcessor(inst, ctx, json3, params);
43454
43454
  }, {
43455
43455
  rest(rest) {
43456
43456
  return this.clone({
@@ -43483,7 +43483,7 @@ var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
43483
43483
  _ensureDefaultMemoizer();
43484
43484
  $ZodRecord.init(inst, def);
43485
43485
  ZodType.init(inst, def);
43486
- inst._zod.processJSONSchema = (ctx, json2, params) => recordProcessor(inst, ctx, json2, params);
43486
+ inst._zod.processJSONSchema = (ctx, json3, params) => recordProcessor(inst, ctx, json3, params);
43487
43487
  inst.keyType = def.keyType;
43488
43488
  inst.valueType = def.valueType;
43489
43489
  });
@@ -43525,7 +43525,7 @@ var ZodMap = /* @__PURE__ */ $constructor("ZodMap", (inst, def) => {
43525
43525
  _ensureDefaultMemoizer();
43526
43526
  $ZodMap.init(inst, def);
43527
43527
  ZodType.init(inst, def);
43528
- inst._zod.processJSONSchema = (ctx, json2, params) => mapProcessor(inst, ctx, json2, params);
43528
+ inst._zod.processJSONSchema = (ctx, json3, params) => mapProcessor(inst, ctx, json3, params);
43529
43529
  inst.keyType = def.keyType;
43530
43530
  inst.valueType = def.valueType;
43531
43531
  inst.min = (...args) => inst.check(_minSize(...args));
@@ -43545,7 +43545,7 @@ var ZodSet = /* @__PURE__ */ $constructor("ZodSet", (inst, def) => {
43545
43545
  _ensureDefaultMemoizer();
43546
43546
  $ZodSet.init(inst, def);
43547
43547
  ZodType.init(inst, def);
43548
- inst._zod.processJSONSchema = (ctx, json2, params) => setProcessor(inst, ctx, json2, params);
43548
+ inst._zod.processJSONSchema = (ctx, json3, params) => setProcessor(inst, ctx, json3, params);
43549
43549
  inst.min = (...args) => inst.check(_minSize(...args));
43550
43550
  inst.nonempty = (params) => inst.check(_minSize(1, params));
43551
43551
  inst.max = (...args) => inst.check(_maxSize(...args));
@@ -43561,7 +43561,7 @@ function set(valueType, params) {
43561
43561
  var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
43562
43562
  $ZodEnum.init(inst, def);
43563
43563
  ZodType.init(inst, def);
43564
- inst._zod.processJSONSchema = (ctx, json2, params) => enumProcessor(inst, ctx, json2, params);
43564
+ inst._zod.processJSONSchema = (ctx, json3, params) => enumProcessor(inst, ctx, json3, params);
43565
43565
  inst.enum = def.entries;
43566
43566
  inst.options = [...inst._zod.values];
43567
43567
  const keys = new Set(Object.keys(def.entries));
@@ -43614,7 +43614,7 @@ function nativeEnum(entries, params) {
43614
43614
  var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
43615
43615
  $ZodLiteral.init(inst, def);
43616
43616
  ZodType.init(inst, def);
43617
- inst._zod.processJSONSchema = (ctx, json2, params) => literalProcessor(inst, ctx, json2, params);
43617
+ inst._zod.processJSONSchema = (ctx, json3, params) => literalProcessor(inst, ctx, json3, params);
43618
43618
  inst.values = new Set(def.values);
43619
43619
  Object.defineProperty(inst, "value", {
43620
43620
  get() {
@@ -43635,7 +43635,7 @@ function literal(value, params) {
43635
43635
  var ZodFile = /* @__PURE__ */ $constructor("ZodFile", (inst, def) => {
43636
43636
  $ZodFile.init(inst, def);
43637
43637
  ZodType.init(inst, def);
43638
- inst._zod.processJSONSchema = (ctx, json2, params) => fileProcessor(inst, ctx, json2, params);
43638
+ inst._zod.processJSONSchema = (ctx, json3, params) => fileProcessor(inst, ctx, json3, params);
43639
43639
  inst.min = (size, params) => inst.check(_minSize(size, params));
43640
43640
  inst.max = (size, params) => inst.check(_maxSize(size, params));
43641
43641
  inst.mime = (types, params) => inst.check(_mime(Array.isArray(types) ? types : [types], params));
@@ -43647,7 +43647,7 @@ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
43647
43647
  _ensureDefaultMemoizer();
43648
43648
  $ZodTransform.init(inst, def);
43649
43649
  ZodType.init(inst, def);
43650
- inst._zod.processJSONSchema = (ctx, json2, params) => transformProcessor(inst, ctx, json2, params);
43650
+ inst._zod.processJSONSchema = (ctx, json3, params) => transformProcessor(inst, ctx, json3, params);
43651
43651
  inst._zod.parse = (payload, _ctx) => {
43652
43652
  if (_ctx.direction === "backward") {
43653
43653
  throw new $ZodEncodeError(inst.constructor.name);
@@ -43686,7 +43686,7 @@ function transform(fn) {
43686
43686
  var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
43687
43687
  $ZodOptional.init(inst, def);
43688
43688
  ZodType.init(inst, def);
43689
- inst._zod.processJSONSchema = (ctx, json2, params) => optionalProcessor(inst, ctx, json2, params);
43689
+ inst._zod.processJSONSchema = (ctx, json3, params) => optionalProcessor(inst, ctx, json3, params);
43690
43690
  inst.unwrap = () => inst._zod.def.innerType;
43691
43691
  });
43692
43692
  function optional(innerType) {
@@ -43698,7 +43698,7 @@ function optional(innerType) {
43698
43698
  var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
43699
43699
  $ZodExactOptional.init(inst, def);
43700
43700
  ZodType.init(inst, def);
43701
- inst._zod.processJSONSchema = (ctx, json2, params) => optionalProcessor(inst, ctx, json2, params);
43701
+ inst._zod.processJSONSchema = (ctx, json3, params) => optionalProcessor(inst, ctx, json3, params);
43702
43702
  inst.unwrap = () => inst._zod.def.innerType;
43703
43703
  });
43704
43704
  function exactOptional(innerType) {
@@ -43710,7 +43710,7 @@ function exactOptional(innerType) {
43710
43710
  var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
43711
43711
  $ZodNullable.init(inst, def);
43712
43712
  ZodType.init(inst, def);
43713
- inst._zod.processJSONSchema = (ctx, json2, params) => nullableProcessor(inst, ctx, json2, params);
43713
+ inst._zod.processJSONSchema = (ctx, json3, params) => nullableProcessor(inst, ctx, json3, params);
43714
43714
  inst.unwrap = () => inst._zod.def.innerType;
43715
43715
  });
43716
43716
  function nullable(innerType) {
@@ -43725,7 +43725,7 @@ function nullish2(innerType) {
43725
43725
  var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
43726
43726
  $ZodDefault.init(inst, def);
43727
43727
  ZodType.init(inst, def);
43728
- inst._zod.processJSONSchema = (ctx, json2, params) => defaultProcessor(inst, ctx, json2, params);
43728
+ inst._zod.processJSONSchema = (ctx, json3, params) => defaultProcessor(inst, ctx, json3, params);
43729
43729
  inst.unwrap = () => inst._zod.def.innerType;
43730
43730
  inst.removeDefault = inst.unwrap;
43731
43731
  });
@@ -43741,7 +43741,7 @@ function _default2(innerType, defaultValue) {
43741
43741
  var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
43742
43742
  $ZodPrefault.init(inst, def);
43743
43743
  ZodType.init(inst, def);
43744
- inst._zod.processJSONSchema = (ctx, json2, params) => prefaultProcessor(inst, ctx, json2, params);
43744
+ inst._zod.processJSONSchema = (ctx, json3, params) => prefaultProcessor(inst, ctx, json3, params);
43745
43745
  inst.unwrap = () => inst._zod.def.innerType;
43746
43746
  });
43747
43747
  function prefault(innerType, defaultValue) {
@@ -43756,7 +43756,7 @@ function prefault(innerType, defaultValue) {
43756
43756
  var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
43757
43757
  $ZodNonOptional.init(inst, def);
43758
43758
  ZodType.init(inst, def);
43759
- inst._zod.processJSONSchema = (ctx, json2, params) => nonoptionalProcessor(inst, ctx, json2, params);
43759
+ inst._zod.processJSONSchema = (ctx, json3, params) => nonoptionalProcessor(inst, ctx, json3, params);
43760
43760
  inst.unwrap = () => inst._zod.def.innerType;
43761
43761
  });
43762
43762
  function nonoptional(innerType, params) {
@@ -43769,7 +43769,7 @@ function nonoptional(innerType, params) {
43769
43769
  var ZodSuccess = /* @__PURE__ */ $constructor("ZodSuccess", (inst, def) => {
43770
43770
  $ZodSuccess.init(inst, def);
43771
43771
  ZodType.init(inst, def);
43772
- inst._zod.processJSONSchema = (ctx, json2, params) => successProcessor(inst, ctx, json2, params);
43772
+ inst._zod.processJSONSchema = (ctx, json3, params) => successProcessor(inst, ctx, json3, params);
43773
43773
  inst.unwrap = () => inst._zod.def.innerType;
43774
43774
  });
43775
43775
  function success(innerType) {
@@ -43781,7 +43781,7 @@ function success(innerType) {
43781
43781
  var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
43782
43782
  $ZodCatch.init(inst, def);
43783
43783
  ZodType.init(inst, def);
43784
- inst._zod.processJSONSchema = (ctx, json2, params) => catchProcessor(inst, ctx, json2, params);
43784
+ inst._zod.processJSONSchema = (ctx, json3, params) => catchProcessor(inst, ctx, json3, params);
43785
43785
  inst.unwrap = () => inst._zod.def.innerType;
43786
43786
  inst.removeCatch = inst.unwrap;
43787
43787
  });
@@ -43795,7 +43795,7 @@ function _catch2(innerType, catchValue) {
43795
43795
  var ZodNaN = /* @__PURE__ */ $constructor("ZodNaN", (inst, def) => {
43796
43796
  $ZodNaN.init(inst, def);
43797
43797
  ZodType.init(inst, def);
43798
- inst._zod.processJSONSchema = (ctx, json2, params) => nanProcessor(inst, ctx, json2, params);
43798
+ inst._zod.processJSONSchema = (ctx, json3, params) => nanProcessor(inst, ctx, json3, params);
43799
43799
  });
43800
43800
  function nan(params) {
43801
43801
  return _nan(ZodNaN, params);
@@ -43803,7 +43803,7 @@ function nan(params) {
43803
43803
  var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
43804
43804
  $ZodPipe.init(inst, def);
43805
43805
  ZodType.init(inst, def);
43806
- inst._zod.processJSONSchema = (ctx, json2, params) => pipeProcessor(inst, ctx, json2, params);
43806
+ inst._zod.processJSONSchema = (ctx, json3, params) => pipeProcessor(inst, ctx, json3, params);
43807
43807
  inst.in = def.in;
43808
43808
  inst.out = def.out;
43809
43809
  });
@@ -43845,7 +43845,7 @@ var ZodPreprocess = /* @__PURE__ */ $constructor("ZodPreprocess", (inst, def) =>
43845
43845
  var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
43846
43846
  $ZodReadonly.init(inst, def);
43847
43847
  ZodType.init(inst, def);
43848
- inst._zod.processJSONSchema = (ctx, json2, params) => readonlyProcessor(inst, ctx, json2, params);
43848
+ inst._zod.processJSONSchema = (ctx, json3, params) => readonlyProcessor(inst, ctx, json3, params);
43849
43849
  inst.unwrap = () => inst._zod.def.innerType;
43850
43850
  });
43851
43851
  function readonly(innerType) {
@@ -43857,7 +43857,7 @@ function readonly(innerType) {
43857
43857
  var ZodTemplateLiteral = /* @__PURE__ */ $constructor("ZodTemplateLiteral", (inst, def) => {
43858
43858
  $ZodTemplateLiteral.init(inst, def);
43859
43859
  ZodType.init(inst, def);
43860
- inst._zod.processJSONSchema = (ctx, json2, params) => templateLiteralProcessor(inst, ctx, json2, params);
43860
+ inst._zod.processJSONSchema = (ctx, json3, params) => templateLiteralProcessor(inst, ctx, json3, params);
43861
43861
  });
43862
43862
  function templateLiteral(parts, params) {
43863
43863
  return new ZodTemplateLiteral({
@@ -43869,7 +43869,7 @@ function templateLiteral(parts, params) {
43869
43869
  var ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => {
43870
43870
  $ZodLazy.init(inst, def);
43871
43871
  ZodType.init(inst, def);
43872
- inst._zod.processJSONSchema = (ctx, json2, params) => lazyProcessor(inst, ctx, json2, params);
43872
+ inst._zod.processJSONSchema = (ctx, json3, params) => lazyProcessor(inst, ctx, json3, params);
43873
43873
  inst.unwrap = () => inst._zod.def.getter();
43874
43874
  });
43875
43875
  function lazy(getter) {
@@ -43881,7 +43881,7 @@ function lazy(getter) {
43881
43881
  var ZodPromise = /* @__PURE__ */ $constructor("ZodPromise", (inst, def) => {
43882
43882
  $ZodPromise.init(inst, def);
43883
43883
  ZodType.init(inst, def);
43884
- inst._zod.processJSONSchema = (ctx, json2, params) => promiseProcessor(inst, ctx, json2, params);
43884
+ inst._zod.processJSONSchema = (ctx, json3, params) => promiseProcessor(inst, ctx, json3, params);
43885
43885
  inst.unwrap = () => inst._zod.def.innerType;
43886
43886
  });
43887
43887
  function promise(innerType) {
@@ -43893,7 +43893,7 @@ function promise(innerType) {
43893
43893
  var ZodFunction = /* @__PURE__ */ $constructor("ZodFunction", (inst, def) => {
43894
43894
  $ZodFunction.init(inst, def);
43895
43895
  ZodType.init(inst, def);
43896
- inst._zod.processJSONSchema = (ctx, json2, params) => functionProcessor(inst, ctx, json2, params);
43896
+ inst._zod.processJSONSchema = (ctx, json3, params) => functionProcessor(inst, ctx, json3, params);
43897
43897
  });
43898
43898
  function _function(params) {
43899
43899
  return new ZodFunction({
@@ -43905,7 +43905,7 @@ function _function(params) {
43905
43905
  var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
43906
43906
  $ZodCustom.init(inst, def);
43907
43907
  ZodType.init(inst, def);
43908
- inst._zod.processJSONSchema = (ctx, json2, params) => customProcessor(inst, ctx, json2, params);
43908
+ inst._zod.processJSONSchema = (ctx, json3, params) => customProcessor(inst, ctx, json3, params);
43909
43909
  });
43910
43910
  function check(fn) {
43911
43911
  const ch = new $ZodCheck({
@@ -46701,52 +46701,274 @@ function createTrackedSend(raw) {
46701
46701
  }
46702
46702
 
46703
46703
  // ../../apps/server/src/services/extensions/isolation/child/virtual-server.ts
46704
- var import_node_http = __toESM(require("node:http"), 1);
46705
- var import_node_stream3 = require("node:stream");
46704
+ var import_node_http3 = __toESM(require("node:http"), 1);
46705
+ var import_node_stream4 = require("node:stream");
46706
+
46707
+ // ../../node_modules/.pnpm/@hono+node-server@2.1.5_hono@4.13.12/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs
46708
+ var X_ALREADY_SENT = "x-hono-already-sent";
46709
+
46710
+ // ../../node_modules/.pnpm/@hono+node-server@2.1.5_hono@4.13.12/node_modules/@hono/node-server/dist/index.mjs
46711
+ var import_node_http = require("node:http");
46712
+ var import_node_http2 = require("node:http2");
46713
+ var import_node_stream2 = require("node:stream");
46714
+
46715
+ // ../../node_modules/.pnpm/hono@4.13.12/node_modules/hono/dist/helper/websocket/index.js
46716
+ var defineWebSocketHelper = (handler) => {
46717
+ return ((...args) => {
46718
+ if (typeof args[0] === "function") {
46719
+ const [createEvents, options] = args;
46720
+ return async function upgradeWebSocket2(c, next) {
46721
+ const result = await handler(c, await createEvents(c), options);
46722
+ if (result) return result;
46723
+ await next();
46724
+ };
46725
+ } else {
46726
+ const [c, events, options] = args;
46727
+ return (async () => {
46728
+ const upgraded = await handler(c, events, options);
46729
+ if (!upgraded) throw new Error("Failed to upgrade WebSocket");
46730
+ return upgraded;
46731
+ })();
46732
+ }
46733
+ });
46734
+ };
46706
46735
 
46707
- // ../../node_modules/.pnpm/@hono+node-server@1.19.17_hono@4.13.12/node_modules/@hono/node-server/dist/index.mjs
46708
- var import_http2 = require("http2");
46709
- var import_http22 = require("http2");
46710
- var import_stream = require("stream");
46711
- var import_crypto = __toESM(require("crypto"), 1);
46736
+ // ../../node_modules/.pnpm/@hono+node-server@2.1.5_hono@4.13.12/node_modules/@hono/node-server/dist/index.mjs
46712
46737
  var RequestError = class extends Error {
46713
46738
  constructor(message, options) {
46714
46739
  super(message, options);
46715
46740
  this.name = "RequestError";
46716
46741
  }
46717
46742
  };
46718
- var toRequestError = (e) => {
46719
- if (e instanceof RequestError) {
46720
- return e;
46743
+ var nonJoinedHeaders = /* @__PURE__ */ new Set([
46744
+ "age",
46745
+ "authorization",
46746
+ "content-length",
46747
+ "content-type",
46748
+ "etag",
46749
+ "expires",
46750
+ "from",
46751
+ "host",
46752
+ "if-modified-since",
46753
+ "if-unmodified-since",
46754
+ "last-modified",
46755
+ "location",
46756
+ "max-forwards",
46757
+ "proxy-authorization",
46758
+ "referer",
46759
+ "retry-after",
46760
+ "server",
46761
+ "user-agent"
46762
+ ]);
46763
+ var validHeaderName = /^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/;
46764
+ var isHttpWhitespace = (code) => code === 9 || code === 10 || code === 13 || code === 32;
46765
+ var normalizeHeaderValue = (value) => {
46766
+ if (!isHttpWhitespace(value.charCodeAt(0)) && !isHttpWhitespace(value.charCodeAt(value.length - 1))) return value;
46767
+ let start = 0;
46768
+ let end = value.length;
46769
+ while (start < end && isHttpWhitespace(value.charCodeAt(start))) start++;
46770
+ while (end > start && isHttpWhitespace(value.charCodeAt(end - 1))) end--;
46771
+ return value.slice(start, end);
46772
+ };
46773
+ var forbiddenHeaderValue = /[\0\r\n]/;
46774
+ var GlobalHeaders = globalThis.Headers;
46775
+ var materializeHeaders = (rawHeaders, HeadersCtor = GlobalHeaders) => {
46776
+ const headers = new HeadersCtor();
46777
+ for (let i = 0; i < rawHeaders.length; i += 2) {
46778
+ const name = rawHeaders[i];
46779
+ if (!name.startsWith(":")) headers.append(name, rawHeaders[i + 1]);
46780
+ }
46781
+ return headers;
46782
+ };
46783
+ var RequestHeaders = class {
46784
+ #incoming;
46785
+ #rawHeaders;
46786
+ #headers;
46787
+ #invalidValue;
46788
+ constructor(incoming) {
46789
+ this.#incoming = incoming;
46790
+ if (incoming instanceof import_node_http2.Http2ServerRequest) this.#rawHeaders = incoming.rawHeaders.slice();
46791
+ }
46792
+ get #lazyRawHeaders() {
46793
+ return this.#rawHeaders ??= this.#incoming.rawHeaders.slice();
46794
+ }
46795
+ get #native() {
46796
+ if (!this.#headers) {
46797
+ this.#headers = materializeHeaders(this.#lazyRawHeaders);
46798
+ this.#rawHeaders = void 0;
46799
+ }
46800
+ return this.#headers;
46801
+ }
46802
+ #normalizedName(name) {
46803
+ if (typeof name !== "string") return;
46804
+ if (!validHeaderName.test(name)) throw new TypeError(`Invalid header name: ${name}`);
46805
+ return name.toLowerCase();
46806
+ }
46807
+ #lookupHttp1(lowerName) {
46808
+ const headers = this.#incoming instanceof import_node_http2.Http2ServerRequest ? void 0 : this.#incoming.headers;
46809
+ if (!headers || nonJoinedHeaders.has(lowerName) || lowerName === "set-cookie" || lowerName === "__proto__") return;
46810
+ if (!Object.hasOwn(headers, lowerName)) return null;
46811
+ const rawValue = headers[lowerName];
46812
+ if (typeof rawValue === "string") {
46813
+ const value = normalizeHeaderValue(rawValue);
46814
+ return forbiddenHeaderValue.test(value) ? void 0 : value;
46815
+ }
46816
+ }
46817
+ #lookup(rawHeaders, lowerName) {
46818
+ const separator = lowerName === "cookie" ? "; " : ", ";
46819
+ let value = null;
46820
+ for (let i = 0; i < rawHeaders.length; i += 2) {
46821
+ const rawName = rawHeaders[i];
46822
+ if (rawName.length === lowerName.length && rawName.toLowerCase() === lowerName) {
46823
+ const rawValue = normalizeHeaderValue(rawHeaders[i + 1]);
46824
+ if (forbiddenHeaderValue.test(rawValue)) {
46825
+ this.#invalidValue = true;
46826
+ return;
46827
+ }
46828
+ value = value === null ? rawValue : value + separator + rawValue;
46829
+ }
46830
+ }
46831
+ return value;
46832
+ }
46833
+ append(name, value) {
46834
+ this.#native.append(name, value);
46835
+ }
46836
+ delete(name) {
46837
+ this.#native.delete(name);
46838
+ }
46839
+ get(name) {
46840
+ const lowerName = this.#normalizedName(name);
46841
+ if (lowerName && !this.#headers && !this.#invalidValue) {
46842
+ const http1Value = this.#lookupHttp1(lowerName);
46843
+ if (http1Value !== void 0) return http1Value;
46844
+ const value = this.#lookup(this.#lazyRawHeaders, lowerName);
46845
+ if (value !== void 0) return value;
46846
+ }
46847
+ return this.#native.get(name);
46848
+ }
46849
+ has(name) {
46850
+ const lowerName = this.#normalizedName(name);
46851
+ if (lowerName && !this.#headers && !this.#invalidValue) {
46852
+ const http1Value = this.#lookupHttp1(lowerName);
46853
+ if (http1Value !== void 0) return http1Value !== null;
46854
+ const value = this.#lookup(this.#lazyRawHeaders, lowerName);
46855
+ if (value !== void 0) return value !== null;
46856
+ }
46857
+ return this.#native.has(name);
46858
+ }
46859
+ set(name, value) {
46860
+ this.#native.set(name, value);
46861
+ }
46862
+ getSetCookie() {
46863
+ return this.#native.getSetCookie();
46864
+ }
46865
+ keys() {
46866
+ return this.#native.keys();
46867
+ }
46868
+ values() {
46869
+ return this.#native.values();
46870
+ }
46871
+ entries() {
46872
+ return this.#native.entries();
46873
+ }
46874
+ forEach(callback, thisArg) {
46875
+ this.#native.forEach((value, key) => {
46876
+ callback.call(thisArg, value, key, this);
46877
+ });
46878
+ }
46879
+ [Symbol.iterator]() {
46880
+ return this.entries();
46721
46881
  }
46882
+ };
46883
+ Object.defineProperty(RequestHeaders.prototype, /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"), { value: function(depth, options, inspectFn) {
46884
+ return `Headers (lightweight) ${inspectFn(Object.fromEntries(this), {
46885
+ ...options,
46886
+ depth: depth == null ? null : depth - 1
46887
+ })}`;
46888
+ } });
46889
+ Object.setPrototypeOf(RequestHeaders.prototype, GlobalHeaders.prototype);
46890
+ var newHeadersFromIncoming = (incoming) => globalThis.Headers === GlobalHeaders ? new RequestHeaders(incoming) : materializeHeaders(incoming.rawHeaders, globalThis.Headers);
46891
+ var reValidRequestUrl = /^\/[!#$&-;=?-\[\]_a-z~]*$/;
46892
+ var reDotSegment = /\/\.\.?(?:[/?#]|$)/;
46893
+ var reValidHost = /^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/;
46894
+ var buildUrl = (scheme, host, incomingUrl) => {
46895
+ const url2 = `${scheme}://${host}${incomingUrl}`;
46896
+ if (!reValidHost.test(host)) {
46897
+ const urlObj = new URL(url2);
46898
+ if (urlObj.hostname.length !== host.length && urlObj.hostname !== (host.includes(":") ? host.replace(/:\d+$/, "") : host).toLowerCase()) throw new RequestError("Invalid host header");
46899
+ return urlObj.href;
46900
+ } else if (incomingUrl.length === 0) return url2 + "/";
46901
+ else {
46902
+ if (incomingUrl.charCodeAt(0) !== 47) throw new RequestError("Invalid URL");
46903
+ if (!reValidRequestUrl.test(incomingUrl) || reDotSegment.test(incomingUrl)) return new URL(url2).href;
46904
+ return url2;
46905
+ }
46906
+ };
46907
+ var toRequestError = (e) => {
46908
+ if (e instanceof RequestError) return e;
46722
46909
  return new RequestError(e.message, { cause: e });
46723
46910
  };
46724
46911
  var GlobalRequest = global.Request;
46725
- var Request2 = class extends GlobalRequest {
46912
+ var Request$1 = class extends GlobalRequest {
46726
46913
  constructor(input2, options) {
46727
46914
  if (typeof input2 === "object" && getRequestCache in input2) {
46915
+ const hasReplacementBody = options !== void 0 && "body" in options && options.body != null;
46916
+ if (input2[bodyConsumedDirectlyKey] && !hasReplacementBody) throw new TypeError("Cannot construct a Request with a Request object that has already been used.");
46728
46917
  input2 = input2[getRequestCache]();
46729
46918
  }
46730
- if (typeof options?.body?.getReader !== "undefined") {
46731
- ;
46732
- options.duplex ??= "half";
46733
- }
46919
+ if (typeof options?.body?.getReader !== "undefined") options.duplex ??= "half";
46734
46920
  super(input2, options);
46735
46921
  }
46736
46922
  };
46737
- var newHeadersFromIncoming = (incoming) => {
46738
- const headerRecord = [];
46739
- const rawHeaders = incoming.rawHeaders;
46740
- for (let i = 0; i < rawHeaders.length; i += 2) {
46741
- const { [i]: key, [i + 1]: value } = rawHeaders;
46742
- if (key.charCodeAt(0) !== /*:*/
46743
- 58) {
46744
- headerRecord.push([key, value]);
46745
- }
46923
+ var wrapBodyStream = /* @__PURE__ */ Symbol("wrapBodyStream");
46924
+ var byteExactEncodings = /* @__PURE__ */ new Set([
46925
+ "latin1",
46926
+ "binary",
46927
+ "hex",
46928
+ "base64",
46929
+ "base64url"
46930
+ ]);
46931
+ var isByteExactEncoding = (encoding) => encoding === null || byteExactEncodings.has(encoding);
46932
+ var bodyBufferedBeforeDisconnectKey = /* @__PURE__ */ Symbol("bodyBufferedBeforeDisconnect");
46933
+ var bodyBufferedLengthBeforeDisconnectKey = /* @__PURE__ */ Symbol("bodyBufferedLengthBeforeDisconnect");
46934
+ var toBufferChunk = (chunk, encoding) => Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding ?? "utf8");
46935
+ var isRecoverableDisconnectedIncoming = (incoming) => !(incoming instanceof import_node_http2.Http2ServerRequest) && !!incoming.complete && !!incoming.readableAborted && typeof incoming.read === "function" && isByteExactEncoding(incoming.readableEncoding);
46936
+ var recordBodyBufferedBeforeDisconnect = (incoming) => {
46937
+ if (incoming.readableDidRead || !isRecoverableDisconnectedIncoming(incoming)) return;
46938
+ const incomingWithRecovery = incoming;
46939
+ incomingWithRecovery[bodyBufferedLengthBeforeDisconnectKey] ??= incoming.readableLength;
46940
+ };
46941
+ var readBodyBufferedBeforeDisconnect = (incoming, chunks) => {
46942
+ if (incoming.readableDidRead && !chunks || !isRecoverableDisconnectedIncoming(incoming)) return;
46943
+ const incomingWithRecovery = incoming;
46944
+ if (incomingWithRecovery[bodyBufferedBeforeDisconnectKey] !== void 0) return incomingWithRecovery[bodyBufferedBeforeDisconnectKey];
46945
+ let result;
46946
+ const errored = incoming.errored;
46947
+ if (errored && errored.code !== "ECONNRESET") result = errored;
46948
+ else if (incomingWithRecovery[bodyBufferedLengthBeforeDisconnectKey] !== void 0 && incoming.readableLength !== incomingWithRecovery[bodyBufferedLengthBeforeDisconnectKey]) result = newBodyUnusableError();
46949
+ else {
46950
+ const bodyChunks = chunks ?? [];
46951
+ const chunk = incoming.read();
46952
+ if (chunk !== null) bodyChunks.push(toBufferChunk(chunk, incoming.readableEncoding));
46953
+ const buffer = bodyChunks.length === 1 ? bodyChunks[0] : Buffer.concat(bodyChunks);
46954
+ result = buffer;
46955
+ const contentLength = incoming.headers["content-length"];
46956
+ if (typeof contentLength === "string" && /^\d+$/.test(contentLength)) {
46957
+ const expectedLength = Number(contentLength);
46958
+ if (Number.isSafeInteger(expectedLength) && buffer.length !== expectedLength) result = newBodyUnusableError();
46959
+ }
46960
+ }
46961
+ incomingWithRecovery[bodyBufferedBeforeDisconnectKey] = result;
46962
+ return result;
46963
+ };
46964
+ var enqueueBufferedBody = (controller, buffered) => {
46965
+ if (buffered instanceof Error) {
46966
+ controller.error(buffered);
46967
+ return;
46746
46968
  }
46747
- return new Headers(headerRecord);
46969
+ if (buffered.length > 0) controller.enqueue(buffered);
46970
+ controller.close();
46748
46971
  };
46749
- var wrapBodyStream = /* @__PURE__ */ Symbol("wrapBodyStream");
46750
46972
  var newRequestFromIncoming = (method, url2, headers, incoming, abortController) => {
46751
46973
  const init = {
46752
46974
  method,
@@ -46755,55 +46977,224 @@ var newRequestFromIncoming = (method, url2, headers, incoming, abortController)
46755
46977
  };
46756
46978
  if (method === "TRACE") {
46757
46979
  init.method = "GET";
46758
- const req = new Request2(url2, init);
46759
- Object.defineProperty(req, "method", {
46760
- get() {
46761
- return "TRACE";
46762
- }
46763
- });
46980
+ const req = new Request$1(url2, init);
46981
+ Object.defineProperty(req, "method", { get() {
46982
+ return "TRACE";
46983
+ } });
46764
46984
  return req;
46765
46985
  }
46766
- if (!(method === "GET" || method === "HEAD")) {
46767
- if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) {
46768
- init.body = new ReadableStream({
46769
- start(controller) {
46770
- controller.enqueue(incoming.rawBody);
46771
- controller.close();
46772
- }
46773
- });
46774
- } else if (incoming[wrapBodyStream]) {
46775
- let reader;
46776
- init.body = new ReadableStream({
46777
- async pull(controller) {
46778
- try {
46779
- reader ||= import_stream.Readable.toWeb(incoming).getReader();
46780
- const { done, value } = await reader.read();
46781
- if (done) {
46782
- controller.close();
46783
- } else {
46784
- controller.enqueue(value);
46785
- }
46786
- } catch (error62) {
46787
- controller.error(error62);
46986
+ if (!(method === "GET" || method === "HEAD")) if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) init.body = new ReadableStream({ start(controller) {
46987
+ controller.enqueue(incoming.rawBody);
46988
+ controller.close();
46989
+ } });
46990
+ else if (incoming[wrapBodyStream]) {
46991
+ let reader;
46992
+ init.body = new ReadableStream({ async pull(controller) {
46993
+ try {
46994
+ if (!reader) {
46995
+ const buffered = readBodyBufferedBeforeDisconnect(incoming);
46996
+ if (buffered !== void 0) {
46997
+ enqueueBufferedBody(controller, buffered);
46998
+ return;
46788
46999
  }
46789
47000
  }
46790
- });
46791
- } else {
46792
- init.body = import_stream.Readable.toWeb(incoming);
46793
- }
47001
+ reader ||= import_node_stream2.Readable.toWeb(incoming).getReader();
47002
+ const { done, value } = await reader.read();
47003
+ if (done) controller.close();
47004
+ else controller.enqueue(value);
47005
+ } catch (error62) {
47006
+ controller.error(error62);
47007
+ }
47008
+ } });
47009
+ } else {
47010
+ const buffered = readBodyBufferedBeforeDisconnect(incoming);
47011
+ if (buffered !== void 0) init.body = new ReadableStream({ start(controller) {
47012
+ enqueueBufferedBody(controller, buffered);
47013
+ } });
47014
+ else init.body = import_node_stream2.Readable.toWeb(incoming);
46794
47015
  }
46795
- return new Request2(url2, init);
47016
+ return new Request$1(url2, init);
46796
47017
  };
46797
47018
  var getRequestCache = /* @__PURE__ */ Symbol("getRequestCache");
46798
47019
  var requestCache = /* @__PURE__ */ Symbol("requestCache");
46799
47020
  var incomingKey = /* @__PURE__ */ Symbol("incomingKey");
46800
47021
  var urlKey = /* @__PURE__ */ Symbol("urlKey");
47022
+ var methodKey = /* @__PURE__ */ Symbol("methodKey");
46801
47023
  var headersKey = /* @__PURE__ */ Symbol("headersKey");
46802
47024
  var abortControllerKey = /* @__PURE__ */ Symbol("abortControllerKey");
46803
47025
  var getAbortController = /* @__PURE__ */ Symbol("getAbortController");
47026
+ var abortRequest = /* @__PURE__ */ Symbol("abortRequest");
47027
+ var bodyBufferKey = /* @__PURE__ */ Symbol("bodyBuffer");
47028
+ var bodyReadPromiseKey = /* @__PURE__ */ Symbol("bodyReadPromise");
47029
+ var bodyConsumedDirectlyKey = /* @__PURE__ */ Symbol("bodyConsumedDirectly");
47030
+ var bodyLockReaderKey = /* @__PURE__ */ Symbol("bodyLockReader");
47031
+ var abortReasonKey = /* @__PURE__ */ Symbol("abortReason");
47032
+ var newBodyUnusableError = () => {
47033
+ return /* @__PURE__ */ new TypeError("Body is unusable");
47034
+ };
47035
+ var rejectBodyUnusable = () => {
47036
+ return Promise.reject(newBodyUnusableError());
47037
+ };
47038
+ var textDecoder = new TextDecoder();
47039
+ var consumeBodyDirectOnce = (request) => {
47040
+ if (request[bodyConsumedDirectlyKey]) return rejectBodyUnusable();
47041
+ request[bodyConsumedDirectlyKey] = true;
47042
+ };
47043
+ var toArrayBuffer = (buf) => {
47044
+ return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
47045
+ };
47046
+ var contentType = (request) => {
47047
+ return (request[headersKey] ||= newHeadersFromIncoming(request[incomingKey])).get("content-type") || "";
47048
+ };
47049
+ var methodTokenRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
47050
+ var normalizeIncomingMethod = (method) => {
47051
+ if (typeof method !== "string" || method.length === 0) return "GET";
47052
+ switch (method) {
47053
+ case "DELETE":
47054
+ case "GET":
47055
+ case "HEAD":
47056
+ case "OPTIONS":
47057
+ case "PATCH":
47058
+ case "POST":
47059
+ case "PUT":
47060
+ case "QUERY":
47061
+ return method;
47062
+ }
47063
+ const upper = method.toUpperCase();
47064
+ switch (upper) {
47065
+ case "DELETE":
47066
+ case "GET":
47067
+ case "HEAD":
47068
+ case "OPTIONS":
47069
+ case "POST":
47070
+ case "PUT":
47071
+ return upper;
47072
+ default:
47073
+ return method;
47074
+ }
47075
+ };
47076
+ var validateDirectReadMethod = (method) => {
47077
+ if (!methodTokenRegExp.test(method)) return /* @__PURE__ */ new TypeError(`'${method}' is not a valid HTTP method.`);
47078
+ const normalized = method.toUpperCase();
47079
+ if (normalized === "CONNECT" || normalized === "TRACK" || normalized === "TRACE" && method !== "TRACE") return /* @__PURE__ */ new TypeError(`'${method}' HTTP method is unsupported.`);
47080
+ };
47081
+ var readBodyWithFastPath = (request, method, fromBuffer) => {
47082
+ if (request[bodyConsumedDirectlyKey]) return rejectBodyUnusable();
47083
+ const methodName = request.method;
47084
+ if (methodName === "GET" || methodName === "HEAD") return request[getRequestCache]()[method]();
47085
+ const methodValidationError = validateDirectReadMethod(methodName);
47086
+ if (methodValidationError) return Promise.reject(methodValidationError);
47087
+ if (request[requestCache]) {
47088
+ if (methodName !== "TRACE") return request[requestCache][method]();
47089
+ }
47090
+ const alreadyUsedError = consumeBodyDirectOnce(request);
47091
+ if (alreadyUsedError) return alreadyUsedError;
47092
+ const raw = readRawBodyIfAvailable(request);
47093
+ if (raw) {
47094
+ const result = Promise.resolve(fromBuffer(raw, request));
47095
+ request[bodyBufferKey] = void 0;
47096
+ return result;
47097
+ }
47098
+ return readBodyDirect(request).then((buf) => {
47099
+ const result = fromBuffer(buf, request);
47100
+ request[bodyBufferKey] = void 0;
47101
+ return result;
47102
+ });
47103
+ };
47104
+ var readRawBodyIfAvailable = (request) => {
47105
+ const incoming = request[incomingKey];
47106
+ if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) return incoming.rawBody;
47107
+ };
47108
+ var normalizeAbortError = (request, incoming) => {
47109
+ if (incoming.errored) return incoming.errored;
47110
+ const reason = request[abortReasonKey];
47111
+ if (reason !== void 0) return reason instanceof Error ? reason : new Error(String(reason));
47112
+ return /* @__PURE__ */ new Error("Client connection prematurely closed.");
47113
+ };
47114
+ var readBodyDirect = (request) => {
47115
+ if (request[bodyBufferKey]) return Promise.resolve(request[bodyBufferKey]);
47116
+ if (request[bodyReadPromiseKey]) return request[bodyReadPromiseKey];
47117
+ const incoming = request[incomingKey];
47118
+ if (incoming.readableDidRead) return rejectBodyUnusable();
47119
+ const buffered = readBodyBufferedBeforeDisconnect(incoming);
47120
+ if (buffered !== void 0) {
47121
+ if (buffered instanceof Error) return Promise.reject(buffered);
47122
+ request[bodyBufferKey] = buffered;
47123
+ return Promise.resolve(buffered);
47124
+ }
47125
+ const promise2 = new Promise((resolve, reject) => {
47126
+ const chunks = [];
47127
+ let settled = false;
47128
+ const finish = (callback) => {
47129
+ if (settled) return;
47130
+ settled = true;
47131
+ cleanup();
47132
+ callback();
47133
+ };
47134
+ const recoverCompleteBodyAfterDisconnect = (error62) => {
47135
+ const streamError = incoming.errored ?? error62;
47136
+ if (!isRecoverableDisconnectedIncoming(incoming) || streamError && streamError.code !== "ECONNRESET") return false;
47137
+ finish(() => {
47138
+ const recovered = readBodyBufferedBeforeDisconnect(incoming, chunks);
47139
+ if (recovered instanceof Error) reject(recovered);
47140
+ else if (recovered === void 0) reject(error62 ?? normalizeAbortError(request, incoming));
47141
+ else {
47142
+ request[bodyBufferKey] = recovered;
47143
+ resolve(recovered);
47144
+ }
47145
+ });
47146
+ return true;
47147
+ };
47148
+ const onData = (chunk) => {
47149
+ chunks.push(toBufferChunk(chunk, incoming.readableEncoding));
47150
+ };
47151
+ const onEnd = () => {
47152
+ finish(() => {
47153
+ const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks);
47154
+ request[bodyBufferKey] = buffer;
47155
+ resolve(buffer);
47156
+ });
47157
+ };
47158
+ const onError = (error62) => {
47159
+ if (recoverCompleteBodyAfterDisconnect(error62)) return;
47160
+ finish(() => {
47161
+ reject(error62);
47162
+ });
47163
+ };
47164
+ const onClose = () => {
47165
+ if (incoming.readableEnded) {
47166
+ onEnd();
47167
+ return;
47168
+ }
47169
+ if (recoverCompleteBodyAfterDisconnect()) return;
47170
+ finish(() => {
47171
+ reject(normalizeAbortError(request, incoming));
47172
+ });
47173
+ };
47174
+ const cleanup = () => {
47175
+ incoming.off("data", onData);
47176
+ incoming.off("end", onEnd);
47177
+ incoming.off("error", onError);
47178
+ incoming.off("close", onClose);
47179
+ request[bodyReadPromiseKey] = void 0;
47180
+ };
47181
+ incoming.on("data", onData);
47182
+ incoming.on("end", onEnd);
47183
+ incoming.on("error", onError);
47184
+ incoming.on("close", onClose);
47185
+ queueMicrotask(() => {
47186
+ if (settled) return;
47187
+ if (incoming.readableEnded) onEnd();
47188
+ else if (incoming.errored) onError(incoming.errored);
47189
+ else if (incoming.destroyed) onClose();
47190
+ });
47191
+ });
47192
+ request[bodyReadPromiseKey] = promise2;
47193
+ return promise2;
47194
+ };
46804
47195
  var requestPrototype = {
46805
47196
  get method() {
46806
- return this[incomingKey].method || "GET";
47197
+ return this[methodKey];
46807
47198
  },
46808
47199
  get url() {
46809
47200
  return this[urlKey];
@@ -46811,24 +47202,57 @@ var requestPrototype = {
46811
47202
  get headers() {
46812
47203
  return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]);
46813
47204
  },
47205
+ [abortRequest](reason) {
47206
+ if (this[abortReasonKey] === void 0) this[abortReasonKey] = reason;
47207
+ const abortController = this[abortControllerKey];
47208
+ if (abortController && !abortController.signal.aborted) abortController.abort(reason);
47209
+ },
46814
47210
  [getAbortController]() {
46815
- this[getRequestCache]();
47211
+ this[abortControllerKey] ||= new AbortController();
47212
+ if (this[abortReasonKey] !== void 0 && !this[abortControllerKey].signal.aborted) this[abortControllerKey].abort(this[abortReasonKey]);
46816
47213
  return this[abortControllerKey];
46817
47214
  },
46818
47215
  [getRequestCache]() {
46819
- this[abortControllerKey] ||= new AbortController();
46820
- return this[requestCache] ||= newRequestFromIncoming(
46821
- this.method,
46822
- this[urlKey],
46823
- this.headers,
46824
- this[incomingKey],
46825
- this[abortControllerKey]
46826
- );
47216
+ const abortController = this[getAbortController]();
47217
+ if (this[requestCache]) return this[requestCache];
47218
+ const method = this.method;
47219
+ if (this[bodyConsumedDirectlyKey] && !(method === "GET" || method === "HEAD")) {
47220
+ this[bodyBufferKey] = void 0;
47221
+ const init = {
47222
+ method: method === "TRACE" ? "GET" : method,
47223
+ headers: this.headers,
47224
+ signal: abortController.signal
47225
+ };
47226
+ if (method !== "TRACE") {
47227
+ init.body = new ReadableStream({ start(c) {
47228
+ c.close();
47229
+ } });
47230
+ init.duplex = "half";
47231
+ }
47232
+ const req = new Request$1(this[urlKey], init);
47233
+ if (method === "TRACE") Object.defineProperty(req, "method", { get() {
47234
+ return "TRACE";
47235
+ } });
47236
+ return this[requestCache] = req;
47237
+ }
47238
+ return this[requestCache] = newRequestFromIncoming(this.method, this[urlKey], this.headers, this[incomingKey], abortController);
47239
+ },
47240
+ get body() {
47241
+ if (!this[bodyConsumedDirectlyKey]) return this[getRequestCache]().body;
47242
+ const request = this[getRequestCache]();
47243
+ if (!this[bodyLockReaderKey] && request.body) this[bodyLockReaderKey] = request.body.getReader();
47244
+ return request.body;
47245
+ },
47246
+ get bodyUsed() {
47247
+ if (this[bodyConsumedDirectlyKey]) return true;
47248
+ if (this[requestCache]) return this[requestCache].bodyUsed;
47249
+ return false;
46827
47250
  }
46828
47251
  };
47252
+ Object.defineProperty(requestPrototype, "signal", { get() {
47253
+ return this[getAbortController]().signal;
47254
+ } });
46829
47255
  [
46830
- "body",
46831
- "bodyUsed",
46832
47256
  "cache",
46833
47257
  "credentials",
46834
47258
  "destination",
@@ -46837,111 +47261,120 @@ var requestPrototype = {
46837
47261
  "redirect",
46838
47262
  "referrer",
46839
47263
  "referrerPolicy",
46840
- "signal",
46841
47264
  "keepalive"
46842
47265
  ].forEach((k) => {
46843
- Object.defineProperty(requestPrototype, k, {
46844
- get() {
46845
- return this[getRequestCache]()[k];
46846
- }
46847
- });
46848
- });
46849
- ["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => {
46850
- Object.defineProperty(requestPrototype, k, {
46851
- value: function() {
46852
- return this[getRequestCache]()[k]();
46853
- }
47266
+ Object.defineProperty(requestPrototype, k, { get() {
47267
+ return this[getRequestCache]()[k];
47268
+ } });
47269
+ });
47270
+ ["clone", "formData"].forEach((k) => {
47271
+ Object.defineProperty(requestPrototype, k, { value: function() {
47272
+ if (this[bodyConsumedDirectlyKey]) {
47273
+ if (k === "clone") throw newBodyUnusableError();
47274
+ return rejectBodyUnusable();
47275
+ }
47276
+ return this[getRequestCache]()[k]();
47277
+ } });
47278
+ });
47279
+ Object.defineProperty(requestPrototype, "text", { value: function() {
47280
+ return readBodyWithFastPath(this, "text", (buf) => textDecoder.decode(buf));
47281
+ } });
47282
+ Object.defineProperty(requestPrototype, "arrayBuffer", { value: function() {
47283
+ return readBodyWithFastPath(this, "arrayBuffer", (buf) => toArrayBuffer(buf));
47284
+ } });
47285
+ Object.defineProperty(requestPrototype, "blob", { value: function() {
47286
+ return readBodyWithFastPath(this, "blob", (buf, request) => {
47287
+ const type = contentType(request);
47288
+ const init = type ? { headers: { "content-type": type } } : void 0;
47289
+ return new Response(buf, init).blob();
46854
47290
  });
46855
- });
46856
- Object.defineProperty(requestPrototype, /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"), {
46857
- value: function(depth, options, inspectFn) {
46858
- const props = {
46859
- method: this.method,
46860
- url: this.url,
46861
- headers: this.headers,
46862
- nativeRequest: this[requestCache]
46863
- };
46864
- return `Request (lightweight) ${inspectFn(props, { ...options, depth: depth == null ? null : depth - 1 })}`;
46865
- }
46866
- });
46867
- Object.setPrototypeOf(requestPrototype, Request2.prototype);
47291
+ } });
47292
+ Object.defineProperty(requestPrototype, "json", { value: function() {
47293
+ if (this[bodyConsumedDirectlyKey]) return rejectBodyUnusable();
47294
+ return this.text().then(JSON.parse);
47295
+ } });
47296
+ Object.defineProperty(requestPrototype, /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"), { value: function(depth, options, inspectFn) {
47297
+ return `Request (lightweight) ${inspectFn({
47298
+ method: this.method,
47299
+ url: this.url,
47300
+ headers: this.headers,
47301
+ nativeRequest: this[requestCache]
47302
+ }, {
47303
+ ...options,
47304
+ depth: depth == null ? null : depth - 1
47305
+ })}`;
47306
+ } });
47307
+ Object.setPrototypeOf(requestPrototype, Request$1.prototype);
46868
47308
  var newRequest = (incoming, defaultHostname) => {
46869
47309
  const req = Object.create(requestPrototype);
46870
47310
  req[incomingKey] = incoming;
47311
+ req[methodKey] = normalizeIncomingMethod(incoming.method);
46871
47312
  const incomingUrl = incoming.url || "";
46872
- if (incomingUrl[0] !== "/" && // short-circuit for performance. most requests are relative URL.
46873
- (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) {
46874
- if (incoming instanceof import_http22.Http2ServerRequest) {
46875
- throw new RequestError("Absolute URL for :path is not allowed in HTTP/2");
46876
- }
47313
+ if (incomingUrl[0] !== "/" && (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) {
47314
+ if (incoming instanceof import_node_http2.Http2ServerRequest) throw new RequestError("Absolute URL for :path is not allowed in HTTP/2");
46877
47315
  try {
46878
- const url22 = new URL(incomingUrl);
46879
- req[urlKey] = url22.href;
47316
+ req[urlKey] = new URL(incomingUrl).href;
46880
47317
  } catch (e) {
46881
47318
  throw new RequestError("Invalid absolute URL", { cause: e });
46882
47319
  }
46883
47320
  return req;
46884
47321
  }
46885
- const host = (incoming instanceof import_http22.Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname;
46886
- if (!host) {
46887
- throw new RequestError("Missing host header");
46888
- }
47322
+ const host = (incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname;
47323
+ if (!host) throw new RequestError("Missing host header");
46889
47324
  let scheme;
46890
- if (incoming instanceof import_http22.Http2ServerRequest) {
47325
+ if (incoming instanceof import_node_http2.Http2ServerRequest) {
46891
47326
  scheme = incoming.scheme;
46892
- if (!(scheme === "http" || scheme === "https")) {
46893
- throw new RequestError("Unsupported scheme");
46894
- }
46895
- } else {
46896
- scheme = incoming.socket && incoming.socket.encrypted ? "https" : "http";
46897
- }
46898
- const url2 = new URL(`${scheme}://${host}${incomingUrl}`);
46899
- if (url2.hostname.length !== host.length && url2.hostname !== host.replace(/:\d+$/, "")) {
46900
- throw new RequestError("Invalid host header");
47327
+ if (!(scheme === "http" || scheme === "https")) throw new RequestError("Unsupported scheme");
47328
+ } else scheme = incoming.socket && incoming.socket.encrypted ? "https" : "http";
47329
+ try {
47330
+ req[urlKey] = buildUrl(scheme, host, incomingUrl);
47331
+ } catch (e) {
47332
+ if (e instanceof RequestError) throw e;
47333
+ else throw new RequestError("Invalid URL", { cause: e });
46901
47334
  }
46902
- req[urlKey] = url2.href;
46903
47335
  return req;
46904
47336
  };
47337
+ var defaultContentType = "text/plain; charset=UTF-8";
46905
47338
  var responseCache = /* @__PURE__ */ Symbol("responseCache");
46906
47339
  var getResponseCache = /* @__PURE__ */ Symbol("getResponseCache");
46907
47340
  var cacheKey = /* @__PURE__ */ Symbol("cache");
46908
47341
  var GlobalResponse = global.Response;
46909
- var Response2 = class _Response {
47342
+ var Response$1 = class Response$12 {
46910
47343
  #body;
46911
47344
  #init;
46912
47345
  [getResponseCache]() {
47346
+ const cache = this[cacheKey];
47347
+ const liveHeaders = cache && cache[2] instanceof Headers ? cache[2] : void 0;
46913
47348
  delete this[cacheKey];
46914
- return this[responseCache] ||= new GlobalResponse(this.#body, this.#init);
47349
+ return this[responseCache] ||= new GlobalResponse(this.#body, liveHeaders ? {
47350
+ status: this.#init?.status,
47351
+ statusText: this.#init?.statusText,
47352
+ headers: liveHeaders
47353
+ } : this.#init);
46915
47354
  }
46916
47355
  constructor(body, init) {
46917
47356
  let headers;
46918
47357
  this.#body = body;
46919
- if (init instanceof _Response) {
47358
+ if (init instanceof GlobalResponse) {
46920
47359
  const cachedGlobalResponse = init[responseCache];
46921
47360
  if (cachedGlobalResponse) {
46922
47361
  this.#init = cachedGlobalResponse;
46923
47362
  this[getResponseCache]();
46924
47363
  return;
46925
- } else {
46926
- this.#init = init.#init;
46927
- headers = new Headers(init.#init.headers);
46928
47364
  }
46929
- } else {
46930
- this.#init = init;
46931
- }
46932
- if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) {
46933
- ;
46934
- this[cacheKey] = [init?.status || 200, body, headers || init?.headers];
46935
- }
47365
+ this.#init = init instanceof Response$12 ? init.#init : init;
47366
+ headers = new Headers(init.headers);
47367
+ } else this.#init = init;
47368
+ if (body == null || typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) this[cacheKey] = [
47369
+ init?.status || 200,
47370
+ body ?? null,
47371
+ headers || init?.headers
47372
+ ];
46936
47373
  }
46937
47374
  get headers() {
46938
47375
  const cache = this[cacheKey];
46939
47376
  if (cache) {
46940
- if (!(cache[2] instanceof Headers)) {
46941
- cache[2] = new Headers(
46942
- cache[2] || { "content-type": "text/plain; charset=UTF-8" }
46943
- );
46944
- }
47377
+ if (!(cache[2] instanceof Headers)) cache[2] = new Headers(cache[2] || (cache[1] === null ? void 0 : { "content-type": defaultContentType }));
46945
47378
  return cache[2];
46946
47379
  }
46947
47380
  return this[getResponseCache]().headers;
@@ -46954,33 +47387,87 @@ var Response2 = class _Response {
46954
47387
  return status >= 200 && status < 300;
46955
47388
  }
46956
47389
  };
46957
- ["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => {
46958
- Object.defineProperty(Response2.prototype, k, {
46959
- get() {
46960
- return this[getResponseCache]()[k];
46961
- }
46962
- });
47390
+ [
47391
+ "body",
47392
+ "bodyUsed",
47393
+ "redirected",
47394
+ "statusText",
47395
+ "trailers",
47396
+ "type",
47397
+ "url"
47398
+ ].forEach((k) => {
47399
+ Object.defineProperty(Response$1.prototype, k, { get() {
47400
+ return this[getResponseCache]()[k];
47401
+ } });
46963
47402
  });
46964
- ["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => {
46965
- Object.defineProperty(Response2.prototype, k, {
46966
- value: function() {
46967
- return this[getResponseCache]()[k]();
46968
- }
46969
- });
47403
+ [
47404
+ "arrayBuffer",
47405
+ "blob",
47406
+ "clone",
47407
+ "formData",
47408
+ "json",
47409
+ "text"
47410
+ ].forEach((k) => {
47411
+ Object.defineProperty(Response$1.prototype, k, { value: function() {
47412
+ return this[getResponseCache]()[k]();
47413
+ } });
47414
+ });
47415
+ Object.defineProperty(Response$1.prototype, /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"), { value: function(depth, options, inspectFn) {
47416
+ return `Response (lightweight) ${inspectFn({
47417
+ status: this.status,
47418
+ headers: this.headers,
47419
+ ok: this.ok,
47420
+ nativeResponse: this[responseCache]
47421
+ }, {
47422
+ ...options,
47423
+ depth: depth == null ? null : depth - 1
47424
+ })}`;
47425
+ } });
47426
+ Object.setPrototypeOf(Response$1, GlobalResponse);
47427
+ Object.setPrototypeOf(Response$1.prototype, GlobalResponse.prototype);
47428
+ var validRedirectUrl = /^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/;
47429
+ var parseRedirectUrl = (url2) => {
47430
+ if (url2 instanceof URL) return url2.href;
47431
+ if (validRedirectUrl.test(url2)) return url2;
47432
+ return new URL(url2).href;
47433
+ };
47434
+ var validRedirectStatuses = /* @__PURE__ */ new Set([
47435
+ 301,
47436
+ 302,
47437
+ 303,
47438
+ 307,
47439
+ 308
47440
+ ]);
47441
+ Object.defineProperty(Response$1, "redirect", {
47442
+ value: function redirect(url2, status = 302) {
47443
+ if (!validRedirectStatuses.has(status)) throw new RangeError("Invalid status code");
47444
+ return new Response$1(null, {
47445
+ status,
47446
+ headers: { location: parseRedirectUrl(url2) }
47447
+ });
47448
+ },
47449
+ writable: true,
47450
+ configurable: true
46970
47451
  });
46971
- Object.defineProperty(Response2.prototype, /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"), {
46972
- value: function(depth, options, inspectFn) {
46973
- const props = {
46974
- status: this.status,
46975
- headers: this.headers,
46976
- ok: this.ok,
46977
- nativeResponse: this[responseCache]
46978
- };
46979
- return `Response (lightweight) ${inspectFn(props, { ...options, depth: depth == null ? null : depth - 1 })}`;
46980
- }
47452
+ Object.defineProperty(Response$1, "json", {
47453
+ value: function json2(data, init) {
47454
+ const body = JSON.stringify(data);
47455
+ if (body === void 0) throw new TypeError("The data is not JSON serializable");
47456
+ const initHeaders = init?.headers;
47457
+ let headers;
47458
+ if (initHeaders) {
47459
+ headers = new Headers(initHeaders);
47460
+ if (!headers.has("content-type")) headers.set("content-type", "application/json");
47461
+ } else headers = { "content-type": "application/json" };
47462
+ return new Response$1(body, {
47463
+ status: init?.status ?? 200,
47464
+ statusText: init?.statusText,
47465
+ headers
47466
+ });
47467
+ },
47468
+ writable: true,
47469
+ configurable: true
46981
47470
  });
46982
- Object.setPrototypeOf(Response2, GlobalResponse);
46983
- Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype);
46984
47471
  async function readWithoutBlocking(readPromise) {
46985
47472
  return Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]);
46986
47473
  }
@@ -46997,72 +47484,49 @@ function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromi
46997
47484
  writable.off("error", cancel);
46998
47485
  });
46999
47486
  function handleStreamError(error62) {
47000
- if (error62) {
47001
- writable.destroy(error62);
47002
- }
47487
+ if (error62) writable.destroy(error62);
47003
47488
  }
47004
47489
  function onDrain() {
47005
47490
  reader.read().then(flow, handleStreamError);
47006
47491
  }
47007
47492
  function flow({ done, value }) {
47008
47493
  try {
47009
- if (done) {
47010
- writable.end();
47011
- } else if (!writable.write(value)) {
47012
- writable.once("drain", onDrain);
47013
- } else {
47014
- return reader.read().then(flow, handleStreamError);
47015
- }
47494
+ if (done) writable.end();
47495
+ else if (!writable.write(value)) writable.once("drain", onDrain);
47496
+ else return reader.read().then(flow, handleStreamError);
47016
47497
  } catch (e) {
47017
47498
  handleStreamError(e);
47018
47499
  }
47019
47500
  }
47020
47501
  }
47021
47502
  function writeFromReadableStream(stream, writable) {
47022
- if (stream.locked) {
47023
- throw new TypeError("ReadableStream is locked.");
47024
- } else if (writable.destroyed) {
47025
- return;
47026
- }
47503
+ if (stream.locked) throw new TypeError("ReadableStream is locked.");
47504
+ else if (writable.destroyed) return;
47027
47505
  return writeFromReadableStreamDefaultReader(stream.getReader(), writable);
47028
47506
  }
47029
- var buildOutgoingHttpHeaders = (headers) => {
47507
+ var buildOutgoingHttpHeaders = (headers, defaultContentType2) => {
47030
47508
  const res = {};
47031
- if (!(headers instanceof Headers)) {
47032
- headers = new Headers(headers ?? void 0);
47033
- }
47034
- const cookies = [];
47035
- for (const [k, v] of headers) {
47036
- if (k === "set-cookie") {
47037
- cookies.push(v);
47038
- } else {
47039
- res[k] = v;
47040
- }
47041
- }
47042
- if (cookies.length > 0) {
47043
- res["set-cookie"] = cookies;
47044
- }
47045
- res["content-type"] ??= "text/plain; charset=UTF-8";
47509
+ if (!(headers instanceof Headers)) headers = new Headers(headers ?? void 0);
47510
+ if (headers.has("set-cookie")) {
47511
+ const cookies = [];
47512
+ for (const [k, v] of headers) if (k === "set-cookie") cookies.push(v);
47513
+ else res[k] = v;
47514
+ if (cookies.length > 0) res["set-cookie"] = cookies;
47515
+ } else for (const [k, v] of headers) res[k] = v;
47516
+ if (defaultContentType2) res["content-type"] ??= defaultContentType2;
47046
47517
  return res;
47047
47518
  };
47048
- var X_ALREADY_SENT = "x-hono-already-sent";
47049
- if (typeof global.crypto === "undefined") {
47050
- global.crypto = import_crypto.default;
47051
- }
47052
47519
  var outgoingEnded = /* @__PURE__ */ Symbol("outgoingEnded");
47053
47520
  var incomingDraining = /* @__PURE__ */ Symbol("incomingDraining");
47054
47521
  var DRAIN_TIMEOUT_MS = 500;
47055
47522
  var MAX_DRAIN_BYTES = 64 * 1024 * 1024;
47056
47523
  var drainIncoming = (incoming) => {
47057
47524
  const incomingWithDrainState = incoming;
47058
- if (incoming.destroyed || incomingWithDrainState[incomingDraining]) {
47059
- return;
47060
- }
47525
+ if (incoming.destroyed || incomingWithDrainState[incomingDraining]) return;
47061
47526
  incomingWithDrainState[incomingDraining] = true;
47062
- if (incoming instanceof import_http2.Http2ServerRequest) {
47527
+ if (incoming instanceof import_node_http2.Http2ServerRequest) {
47063
47528
  try {
47064
- ;
47065
- incoming.stream?.close?.(import_http2.constants.NGHTTP2_NO_ERROR);
47529
+ incoming.stream?.close?.(import_node_http2.constants.NGHTTP2_NO_ERROR);
47066
47530
  } catch {
47067
47531
  }
47068
47532
  return;
@@ -47078,35 +47542,49 @@ var drainIncoming = (incoming) => {
47078
47542
  cleanup();
47079
47543
  const socket = incoming.socket;
47080
47544
  if (socket && !socket.destroyed) {
47081
- socket.destroySoon();
47545
+ if (typeof socket.destroySoon === "function") socket.destroySoon();
47546
+ else if (typeof socket.destroy === "function") socket.destroy();
47082
47547
  }
47083
47548
  };
47084
47549
  const timer = setTimeout(forceClose, DRAIN_TIMEOUT_MS);
47085
47550
  timer.unref?.();
47086
47551
  const onData = (chunk) => {
47087
47552
  bytesRead += chunk.length;
47088
- if (bytesRead > MAX_DRAIN_BYTES) {
47089
- forceClose();
47090
- }
47553
+ if (bytesRead > MAX_DRAIN_BYTES) forceClose();
47091
47554
  };
47092
47555
  incoming.on("data", onData);
47093
47556
  incoming.on("end", cleanup);
47094
47557
  incoming.on("error", cleanup);
47095
47558
  incoming.resume();
47096
47559
  };
47097
- var handleRequestError = () => new Response(null, {
47098
- status: 400
47099
- });
47100
- var handleFetchError = (e) => new Response(null, {
47101
- status: e instanceof Error && (e.name === "TimeoutError" || e.constructor.name === "TimeoutError") ? 504 : 500
47102
- });
47560
+ var makeCloseHandler = (req, incoming, outgoing, needsBodyCleanup) => () => {
47561
+ if (incoming.errored) {
47562
+ recordBodyBufferedBeforeDisconnect(incoming);
47563
+ req[abortRequest](incoming.errored.toString());
47564
+ } else if (!outgoing.writableFinished || incoming instanceof import_node_http2.Http2ServerRequest && incoming.aborted) {
47565
+ recordBodyBufferedBeforeDisconnect(incoming);
47566
+ req[abortRequest]("Client connection prematurely closed.");
47567
+ }
47568
+ if (needsBodyCleanup && !incoming.readableEnded) setTimeout(() => {
47569
+ if (!incoming.readableEnded) setTimeout(() => {
47570
+ drainIncoming(incoming);
47571
+ });
47572
+ });
47573
+ };
47574
+ var isImmediateCacheableResponse = (res) => {
47575
+ if (!(cacheKey in res)) return false;
47576
+ const body = res[cacheKey][1];
47577
+ return body === null || typeof body === "string" || body instanceof Uint8Array;
47578
+ };
47579
+ var handleRequestError = () => new Response(null, { status: 400 });
47580
+ var handleFetchError = (e) => new Response(null, { status: e instanceof Error && (e.name === "TimeoutError" || e.constructor.name === "TimeoutError") ? 504 : 500 });
47103
47581
  var handleResponseError = (e, outgoing) => {
47104
47582
  const err = e instanceof Error ? e : new Error("unknown error", { cause: e });
47105
- if (err.code === "ERR_STREAM_PREMATURE_CLOSE") {
47106
- console.info("The user aborted a request.");
47107
- } else {
47583
+ if (err.code === "ERR_STREAM_PREMATURE_CLOSE") console.info("The user aborted a request.");
47584
+ else {
47108
47585
  console.error(e);
47109
47586
  if (!outgoing.headersSent) {
47587
+ if (outgoing instanceof import_node_http.ServerResponse) outgoing._contentLength = null;
47110
47588
  outgoing.writeHead(500, { "Content-Type": "text/plain" });
47111
47589
  }
47112
47590
  outgoing.end(`Error: ${err.message}`);
@@ -47114,74 +47592,98 @@ var handleResponseError = (e, outgoing) => {
47114
47592
  }
47115
47593
  };
47116
47594
  var flushHeaders = (outgoing) => {
47117
- if ("flushHeaders" in outgoing && outgoing.writable) {
47118
- outgoing.flushHeaders();
47595
+ if ("flushHeaders" in outgoing && outgoing.writable) outgoing.flushHeaders();
47596
+ };
47597
+ var trySetContentLength = (outgoing, status, length) => {
47598
+ const http1 = outgoing;
47599
+ if (http1._contentLength === null && http1._hasBody && http1.useChunkedEncodingByDefault && !http1._removedContLen && status >= 200 && status !== 204 && status !== 304 && !outgoing.hasHeader("content-length") && !outgoing.hasHeader("transfer-encoding") && !outgoing.hasHeader("trailer")) {
47600
+ http1._contentLength = length;
47601
+ return true;
47119
47602
  }
47603
+ return false;
47604
+ };
47605
+ var writeDefaultHeaders = (outgoing, status, length) => {
47606
+ if (trySetContentLength(outgoing, status, length)) outgoing.writeHead(status, { "Content-Type": defaultContentType });
47607
+ else outgoing.writeHead(status, {
47608
+ "Content-Type": defaultContentType,
47609
+ "Content-Length": length
47610
+ });
47120
47611
  };
47121
47612
  var responseViaCache = async (res, outgoing) => {
47122
47613
  let [status, body, header] = res[cacheKey];
47123
- let hasContentLength = false;
47124
47614
  if (!header) {
47125
- header = { "content-type": "text/plain; charset=UTF-8" };
47126
- } else if (header instanceof Headers) {
47615
+ if (body === null) {
47616
+ outgoing.writeHead(status);
47617
+ outgoing.end();
47618
+ } else if (typeof body === "string") {
47619
+ writeDefaultHeaders(outgoing, status, Buffer.byteLength(body));
47620
+ outgoing.end(body);
47621
+ } else if (body instanceof Uint8Array) {
47622
+ writeDefaultHeaders(outgoing, status, body.byteLength);
47623
+ outgoing.end(body);
47624
+ } else if (body instanceof Blob) {
47625
+ writeDefaultHeaders(outgoing, status, body.size);
47626
+ outgoing.end(new Uint8Array(await body.arrayBuffer()));
47627
+ } else {
47628
+ outgoing.writeHead(status, { "Content-Type": defaultContentType });
47629
+ flushHeaders(outgoing);
47630
+ await writeFromReadableStream(body, outgoing)?.catch((e) => handleResponseError(e, outgoing));
47631
+ }
47632
+ outgoing[outgoingEnded]?.();
47633
+ return;
47634
+ }
47635
+ let hasContentLength = false;
47636
+ let plainHeaders = false;
47637
+ let canAutoLength = true;
47638
+ if (header instanceof Headers) {
47127
47639
  hasContentLength = header.has("content-length");
47128
- header = buildOutgoingHttpHeaders(header);
47640
+ header = buildOutgoingHttpHeaders(header, body === null ? void 0 : defaultContentType);
47129
47641
  } else if (Array.isArray(header)) {
47130
47642
  const headerObj = new Headers(header);
47131
47643
  hasContentLength = headerObj.has("content-length");
47132
- header = buildOutgoingHttpHeaders(headerObj);
47644
+ header = buildOutgoingHttpHeaders(headerObj, body === null ? void 0 : defaultContentType);
47133
47645
  } else {
47646
+ plainHeaders = true;
47134
47647
  for (const key in header) {
47135
47648
  if (key.length === 14 && key.toLowerCase() === "content-length") {
47136
47649
  hasContentLength = true;
47137
47650
  break;
47138
47651
  }
47652
+ if (key.length === 17 && key.toLowerCase() === "transfer-encoding" || key.length === 7 && key.toLowerCase() === "trailer") canAutoLength = false;
47139
47653
  }
47140
47654
  }
47141
47655
  if (!hasContentLength) {
47142
- if (typeof body === "string") {
47143
- header["Content-Length"] = Buffer.byteLength(body);
47144
- } else if (body instanceof Uint8Array) {
47145
- header["Content-Length"] = body.byteLength;
47146
- } else if (body instanceof Blob) {
47147
- header["Content-Length"] = body.size;
47656
+ let length;
47657
+ if (typeof body === "string") length = Buffer.byteLength(body);
47658
+ else if (body instanceof Uint8Array) length = body.byteLength;
47659
+ else if (body instanceof Blob) length = body.size;
47660
+ if (length !== void 0 && (!plainHeaders || !canAutoLength || !trySetContentLength(outgoing, status, length))) {
47661
+ if (plainHeaders) header = { ...header };
47662
+ header["Content-Length"] = length;
47148
47663
  }
47149
47664
  }
47150
47665
  outgoing.writeHead(status, header);
47151
- if (typeof body === "string" || body instanceof Uint8Array) {
47152
- outgoing.end(body);
47153
- } else if (body instanceof Blob) {
47154
- outgoing.end(new Uint8Array(await body.arrayBuffer()));
47155
- } else {
47666
+ if (body == null) outgoing.end();
47667
+ else if (typeof body === "string" || body instanceof Uint8Array) outgoing.end(body);
47668
+ else if (body instanceof Blob) outgoing.end(new Uint8Array(await body.arrayBuffer()));
47669
+ else {
47156
47670
  flushHeaders(outgoing);
47157
- await writeFromReadableStream(body, outgoing)?.catch(
47158
- (e) => handleResponseError(e, outgoing)
47159
- );
47671
+ await writeFromReadableStream(body, outgoing)?.catch((e) => handleResponseError(e, outgoing));
47160
47672
  }
47161
- ;
47162
47673
  outgoing[outgoingEnded]?.();
47163
47674
  };
47164
47675
  var isPromise = (res) => typeof res.then === "function";
47165
47676
  var responseViaResponseObject = async (res, outgoing, options = {}) => {
47166
- if (isPromise(res)) {
47167
- if (options.errorHandler) {
47168
- try {
47169
- res = await res;
47170
- } catch (err) {
47171
- const errRes = await options.errorHandler(err);
47172
- if (!errRes) {
47173
- return;
47174
- }
47175
- res = errRes;
47176
- }
47177
- } else {
47178
- res = await res.catch(handleFetchError);
47179
- }
47180
- }
47181
- if (cacheKey in res) {
47182
- return responseViaCache(res, outgoing);
47677
+ if (isPromise(res)) if (options.errorHandler) try {
47678
+ res = await res;
47679
+ } catch (err) {
47680
+ const errRes = await options.errorHandler(err);
47681
+ if (!errRes) return;
47682
+ res = errRes;
47183
47683
  }
47184
- const resHeaderRecord = buildOutgoingHttpHeaders(res.headers);
47684
+ else res = await res.catch(handleFetchError);
47685
+ if (cacheKey in res) return responseViaCache(res, outgoing);
47686
+ const resHeaderRecord = buildOutgoingHttpHeaders(res.headers, res.body === null ? void 0 : defaultContentType);
47185
47687
  if (res.body) {
47186
47688
  const reader = res.body.getReader();
47187
47689
  const values = [];
@@ -47204,29 +47706,21 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
47204
47706
  break;
47205
47707
  }
47206
47708
  currentReadPromise = void 0;
47207
- if (chunk.value) {
47208
- values.push(chunk.value);
47209
- }
47709
+ if (chunk.value) values.push(chunk.value);
47210
47710
  if (chunk.done) {
47211
47711
  done = true;
47212
47712
  break;
47213
47713
  }
47214
47714
  }
47215
- if (done && !("content-length" in resHeaderRecord)) {
47216
- resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
47217
- }
47715
+ if (done && !("content-length" in resHeaderRecord)) resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
47218
47716
  }
47219
47717
  outgoing.writeHead(res.status, resHeaderRecord);
47220
47718
  values.forEach((value) => {
47221
- ;
47222
47719
  outgoing.write(value);
47223
47720
  });
47224
- if (done) {
47225
- outgoing.end();
47226
- } else {
47227
- if (values.length === 0) {
47228
- flushHeaders(outgoing);
47229
- }
47721
+ if (done) outgoing.end();
47722
+ else {
47723
+ if (values.length === 0) flushHeaders(outgoing);
47230
47724
  await writeFromReadableStreamDefaultReader(reader, outgoing, currentReadPromise);
47231
47725
  }
47232
47726
  } else if (resHeaderRecord[X_ALREADY_SENT]) {
@@ -47234,88 +47728,56 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
47234
47728
  outgoing.writeHead(res.status, resHeaderRecord);
47235
47729
  outgoing.end();
47236
47730
  }
47237
- ;
47238
47731
  outgoing[outgoingEnded]?.();
47239
47732
  };
47240
47733
  var getRequestListener = (fetchCallback, options = {}) => {
47241
47734
  const autoCleanupIncoming = options.autoCleanupIncoming ?? true;
47242
- if (options.overrideGlobalObjects !== false && global.Request !== Request2) {
47243
- Object.defineProperty(global, "Request", {
47244
- value: Request2
47245
- });
47246
- Object.defineProperty(global, "Response", {
47247
- value: Response2
47248
- });
47735
+ if (options.overrideGlobalObjects !== false && global.Request !== Request$1) {
47736
+ Object.defineProperty(global, "Request", { value: Request$1 });
47737
+ Object.defineProperty(global, "Response", { value: Response$1 });
47249
47738
  }
47250
47739
  return async (incoming, outgoing) => {
47251
47740
  let res, req;
47741
+ let needsBodyCleanup = false;
47742
+ let closeHandlerAttached = false;
47743
+ const ensureCloseHandler = () => {
47744
+ if (!req || closeHandlerAttached) return;
47745
+ closeHandlerAttached = true;
47746
+ outgoing.on("close", makeCloseHandler(req, incoming, outgoing, needsBodyCleanup));
47747
+ };
47252
47748
  try {
47253
47749
  req = newRequest(incoming, options.hostname);
47254
- let incomingEnded = !autoCleanupIncoming || incoming.method === "GET" || incoming.method === "HEAD";
47255
- if (!incomingEnded) {
47256
- ;
47750
+ needsBodyCleanup = autoCleanupIncoming && !(incoming.method === "GET" || incoming.method === "HEAD");
47751
+ if (needsBodyCleanup) {
47257
47752
  incoming[wrapBodyStream] = true;
47258
- incoming.on("end", () => {
47259
- incomingEnded = true;
47260
- });
47261
- if (incoming instanceof import_http2.Http2ServerRequest) {
47262
- ;
47263
- outgoing[outgoingEnded] = () => {
47264
- if (!incomingEnded) {
47265
- setTimeout(() => {
47266
- if (!incomingEnded) {
47267
- setTimeout(() => {
47268
- drainIncoming(incoming);
47269
- });
47270
- }
47271
- });
47272
- }
47273
- };
47274
- }
47275
- outgoing.on("finish", () => {
47276
- if (!incomingEnded) {
47277
- drainIncoming(incoming);
47278
- }
47279
- });
47280
- }
47281
- outgoing.on("close", () => {
47282
- const abortController = req[abortControllerKey];
47283
- if (abortController) {
47284
- if (incoming.errored) {
47285
- req[abortControllerKey].abort(incoming.errored.toString());
47286
- } else if (!outgoing.writableFinished) {
47287
- req[abortControllerKey].abort("Client connection prematurely closed.");
47288
- }
47289
- }
47290
- if (!incomingEnded) {
47291
- setTimeout(() => {
47292
- if (!incomingEnded) {
47293
- setTimeout(() => {
47294
- drainIncoming(incoming);
47295
- });
47296
- }
47753
+ if (incoming instanceof import_node_http2.Http2ServerRequest) outgoing[outgoingEnded] = () => {
47754
+ if (!incoming.readableEnded) setTimeout(() => {
47755
+ if (!incoming.readableEnded) setTimeout(() => {
47756
+ incoming.destroy();
47757
+ outgoing.destroy();
47758
+ });
47297
47759
  });
47298
- }
47760
+ };
47761
+ }
47762
+ res = fetchCallback(req, {
47763
+ incoming,
47764
+ outgoing
47299
47765
  });
47300
- res = fetchCallback(req, { incoming, outgoing });
47301
- if (cacheKey in res) {
47766
+ if (!isPromise(res) && isImmediateCacheableResponse(res)) {
47767
+ if (needsBodyCleanup && !incoming.readableEnded) outgoing.once("finish", () => {
47768
+ if (!incoming.readableEnded) drainIncoming(incoming);
47769
+ });
47302
47770
  return responseViaCache(res, outgoing);
47303
47771
  }
47772
+ ensureCloseHandler();
47304
47773
  } catch (e) {
47305
- if (!res) {
47306
- if (options.errorHandler) {
47307
- res = await options.errorHandler(req ? e : toRequestError(e));
47308
- if (!res) {
47309
- return;
47310
- }
47311
- } else if (!req) {
47312
- res = handleRequestError();
47313
- } else {
47314
- res = handleFetchError(e);
47315
- }
47316
- } else {
47317
- return handleResponseError(e, outgoing);
47318
- }
47774
+ if (!res) if (options.errorHandler) {
47775
+ ensureCloseHandler();
47776
+ res = await options.errorHandler(req ? e : toRequestError(e));
47777
+ if (!res) return;
47778
+ } else if (!req) res = handleRequestError();
47779
+ else res = handleFetchError(e);
47780
+ else return handleResponseError(e, outgoing);
47319
47781
  }
47320
47782
  try {
47321
47783
  return await responseViaResponseObject(res, outgoing, options);
@@ -47324,6 +47786,119 @@ var getRequestListener = (fetchCallback, options = {}) => {
47324
47786
  }
47325
47787
  };
47326
47788
  };
47789
+ var CloseEvent = globalThis.CloseEvent ?? class extends Event {
47790
+ #eventInitDict;
47791
+ constructor(type, eventInitDict = {}) {
47792
+ super(type, eventInitDict);
47793
+ this.#eventInitDict = eventInitDict;
47794
+ }
47795
+ get wasClean() {
47796
+ return this.#eventInitDict.wasClean ?? false;
47797
+ }
47798
+ get code() {
47799
+ return this.#eventInitDict.code ?? 0;
47800
+ }
47801
+ get reason() {
47802
+ return this.#eventInitDict.reason ?? "";
47803
+ }
47804
+ };
47805
+ var ErrorEvent = globalThis.ErrorEvent ?? class extends Event {
47806
+ #eventInitDict;
47807
+ constructor(type, eventInitDict = {}) {
47808
+ super(type, eventInitDict);
47809
+ this.#eventInitDict = eventInitDict;
47810
+ }
47811
+ get message() {
47812
+ return this.#eventInitDict.message ?? "";
47813
+ }
47814
+ get filename() {
47815
+ return this.#eventInitDict.filename ?? "";
47816
+ }
47817
+ get lineno() {
47818
+ return this.#eventInitDict.lineno ?? 0;
47819
+ }
47820
+ get colno() {
47821
+ return this.#eventInitDict.colno ?? 0;
47822
+ }
47823
+ get error() {
47824
+ return this.#eventInitDict.error ?? null;
47825
+ }
47826
+ };
47827
+ var generateConnectionSymbol = () => /* @__PURE__ */ Symbol("connection");
47828
+ var CONNECTION_SYMBOL_KEY = /* @__PURE__ */ Symbol("CONNECTION_SYMBOL_KEY");
47829
+ var WAIT_FOR_WEBSOCKET_SYMBOL = /* @__PURE__ */ Symbol("WAIT_FOR_WEBSOCKET_SYMBOL");
47830
+ var upgradeWebSocket = defineWebSocketHelper(async (c, events, options) => {
47831
+ if (c.req.header("upgrade")?.toLowerCase() !== "websocket") return;
47832
+ const env2 = c.env;
47833
+ const waitForWebSocket = env2[WAIT_FOR_WEBSOCKET_SYMBOL];
47834
+ if (!waitForWebSocket || !env2.incoming) return new Response(null, { status: 500 });
47835
+ const connectionSymbol = generateConnectionSymbol();
47836
+ env2[CONNECTION_SYMBOL_KEY] = connectionSymbol;
47837
+ (async () => {
47838
+ let ws;
47839
+ try {
47840
+ ws = await waitForWebSocket(env2.incoming, connectionSymbol);
47841
+ } catch {
47842
+ return;
47843
+ }
47844
+ const messagesReceivedInStarting = [];
47845
+ const bufferMessage = (data, isBinary) => {
47846
+ messagesReceivedInStarting.push([data, isBinary]);
47847
+ };
47848
+ ws.on("message", bufferMessage);
47849
+ const ctx = {
47850
+ binaryType: "arraybuffer",
47851
+ close(code, reason) {
47852
+ ws.close(code, reason);
47853
+ },
47854
+ protocol: ws.protocol,
47855
+ raw: ws,
47856
+ get readyState() {
47857
+ return ws.readyState;
47858
+ },
47859
+ send(source, opts) {
47860
+ ws.send(source, { compress: opts?.compress });
47861
+ },
47862
+ url: new URL(c.req.url)
47863
+ };
47864
+ try {
47865
+ events?.onOpen?.(new Event("open"), ctx);
47866
+ } catch (e) {
47867
+ (options?.onError ?? console.error)(e);
47868
+ }
47869
+ const handleMessage = (data, isBinary) => {
47870
+ const datas = Array.isArray(data) ? data : [data];
47871
+ for (const data2 of datas) try {
47872
+ events?.onMessage?.(new MessageEvent("message", { data: isBinary ? data2 instanceof ArrayBuffer ? data2 : data2.buffer.slice(data2.byteOffset, data2.byteOffset + data2.byteLength) : typeof data2 === "string" ? data2 : Buffer.from(data2).toString("utf-8") }), ctx);
47873
+ } catch (e) {
47874
+ (options?.onError ?? console.error)(e);
47875
+ }
47876
+ };
47877
+ ws.off("message", bufferMessage);
47878
+ for (const message of messagesReceivedInStarting) handleMessage(...message);
47879
+ ws.on("message", (data, isBinary) => {
47880
+ handleMessage(data, isBinary);
47881
+ });
47882
+ ws.on("close", (code, reason) => {
47883
+ try {
47884
+ events?.onClose?.(new CloseEvent("close", {
47885
+ code,
47886
+ reason: reason.toString()
47887
+ }), ctx);
47888
+ } catch (e) {
47889
+ (options?.onError ?? console.error)(e);
47890
+ }
47891
+ });
47892
+ ws.on("error", (error62) => {
47893
+ try {
47894
+ events?.onError?.(new ErrorEvent("error", { error: error62 }), ctx);
47895
+ } catch (e) {
47896
+ (options?.onError ?? console.error)(e);
47897
+ }
47898
+ });
47899
+ })();
47900
+ return new Response();
47901
+ });
47327
47902
 
47328
47903
  // ../../apps/server/src/services/extensions/http/reply-headers.ts
47329
47904
  function mountedLocation(value, handlerUrl, mount) {
@@ -47340,8 +47915,8 @@ function mountedLocation(value, handlerUrl, mount) {
47340
47915
  }
47341
47916
 
47342
47917
  // ../../apps/server/src/services/extensions/isolation/virtual-socket.ts
47343
- var import_node_stream2 = require("node:stream");
47344
- var VirtualSocket = class extends import_node_stream2.Duplex {
47918
+ var import_node_stream3 = require("node:stream");
47919
+ var VirtualSocket = class extends import_node_stream3.Duplex {
47345
47920
  /** The connection id. */
47346
47921
  cid;
47347
47922
  /** Never connecting: the "connection" exists the moment it is made. */
@@ -47522,7 +48097,7 @@ async function answerWithFetch(handler, req, res, refusal, mount) {
47522
48097
  headers.delete(name);
47523
48098
  }
47524
48099
  } else if (!BODILESS.has(req.method)) {
47525
- body = import_node_stream3.Readable.toWeb(req);
48100
+ body = import_node_stream4.Readable.toWeb(req);
47526
48101
  }
47527
48102
  const abort = new AbortController();
47528
48103
  res.once("close", () => {
@@ -47548,7 +48123,7 @@ async function answerWithFetch(handler, req, res, refusal, mount) {
47548
48123
  res.end();
47549
48124
  return;
47550
48125
  }
47551
- import_node_stream3.Readable.fromWeb(answer.body).on("error", () => res.destroy()).pipe(res);
48126
+ import_node_stream4.Readable.fromWeb(answer.body).on("error", () => res.destroy()).pipe(res);
47552
48127
  }
47553
48128
  function withMountedLocation(answer, handlerUrl, mount) {
47554
48129
  const location = answer.headers.get("location");
@@ -47627,7 +48202,7 @@ function createVirtualServer(deps) {
47627
48202
  res.status(500).json({ error: err instanceof Error ? err.message : "Internal error" });
47628
48203
  }
47629
48204
  );
47630
- const server = import_node_http.default.createServer((req, res) => {
48205
+ const server = import_node_http3.default.createServer((req, res) => {
47631
48206
  if (deps.router.stack.length > 0) app(req, res);
47632
48207
  else void serveFetchOnly(req, res);
47633
48208
  });