@p4code/cli 0.9.22 → 0.9.23

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 (357) hide show
  1. package/dist/{AcpMcpStdioBridge-DxIZyDJz.mjs → AcpMcpStdioBridge-BNuxv1nx.mjs} +15 -7
  2. package/dist/AcpMcpStdioBridge-C9Ry_oCI.mjs +3 -0
  3. package/dist/{Effect-BqRgldaH.mjs → Effect-BrI3bavz.mjs} +1242 -448
  4. package/dist/{Schema-CkGB1Dgx.mjs → Schema-06GeVid5.mjs} +1626 -1148
  5. package/dist/{Stream-DZTo5F3N.mjs → Stream-DKSvHopl.mjs} +470 -190
  6. package/dist/{TraceDiagnostics-DE0N1Yf6.mjs → TraceDiagnostics-DY_cYrzB.mjs} +1961 -531
  7. package/dist/bin.mjs +2 -2
  8. package/dist/{binCli-DC5fHnhS.mjs → binCli-Bou3rWgW.mjs} +2302 -1946
  9. package/dist/claude-history-worker.mjs +1 -1
  10. package/dist/{claudeHistoryWorker-Cst8OnLH.mjs → claudeHistoryWorker-BZBBGtSw.mjs} +1 -1
  11. package/dist/{claudeHistoryWorker-r4mV4Dxy.mjs → claudeHistoryWorker-DlhW7K2f.mjs} +2 -2
  12. package/dist/client/.vite/manifest.json +2155 -2127
  13. package/dist/client/assets/{2NI2N5EU-CgpeJ5KT.js → 2NI2N5EU-B3GKfpTJ.js} +2 -2
  14. package/dist/client/assets/{4UO7MD6I-BZfVOqtM.js → 4UO7MD6I-D1jV-2l8.js} +2 -2
  15. package/dist/client/assets/{5B3SVYGG-B5V3_tzl.js → 5B3SVYGG-CiUCamIk.js} +2 -2
  16. package/dist/client/assets/{5GK6JWQ2-DRzSVTZ0.js → 5GK6JWQ2-t3RHg90Y.js} +2 -2
  17. package/dist/client/assets/{5N7A7DKN-BX-IFKkJ.js → 5N7A7DKN-QVdNnUVu.js} +2 -2
  18. package/dist/client/assets/{5OC2THR4-CGiKcStE.js → 5OC2THR4-CxE7bwzV.js} +2 -2
  19. package/dist/client/assets/{5S6HY5KT-B5Smgpiz.js → 5S6HY5KT-msIIAX0G.js} +2 -2
  20. package/dist/client/assets/{6IMQ5BUJ-BSWEueVD.js → 6IMQ5BUJ-BzYnQ5qg.js} +2 -2
  21. package/dist/client/assets/{6OLKWJ4F-0nUReGo5.js → 6OLKWJ4F-AQyY5TLk.js} +2 -2
  22. package/dist/client/assets/{74OO7NKP-BZ5SCLUX.js → 74OO7NKP-CCpQBxNH.js} +2 -2
  23. package/dist/client/assets/{75O6YZUN-NifBwMlS.js → 75O6YZUN-D3WwLu8s.js} +2 -2
  24. package/dist/client/assets/{77XECAW3-_XJOQitm.js → 77XECAW3-C6PMMrkh.js} +2 -2
  25. package/dist/client/assets/{ABYRPUBD-B5mFmY4q.js → ABYRPUBD-BmXVPnuD.js} +2 -2
  26. package/dist/client/assets/AlertDialogRoot-CNpt8h9w.js +2 -0
  27. package/dist/client/assets/{AnimatedHeight-BoS1RBdk.js → AnimatedHeight-B2j_NXft.js} +2 -2
  28. package/dist/client/assets/{AuthSurfaceShell-DesOxtee.js → AuthSurfaceShell-DDT8iJWE.js} +2 -2
  29. package/dist/client/assets/{BB2UYUI2-CxFyfwSJ.js → BB2UYUI2-C_DXRsEF.js} +2 -2
  30. package/dist/client/assets/{BUM34MOA-Kk83QSsb.js → BUM34MOA-sLk4tJuF.js} +2 -2
  31. package/dist/client/assets/{CEQABKGZ-DLcBenqs.js → CEQABKGZ-DsLeCUfk.js} +2 -2
  32. package/dist/client/assets/{CXAC5362-BcvLk6NG.js → CXAC5362-6czpP5mH.js} +2 -2
  33. package/dist/client/assets/ChatGptUsageButton-BElkMe1K.js +2 -0
  34. package/dist/client/assets/ChatMarkdown-pRUIhpGi.js +49 -0
  35. package/dist/client/assets/{CheckboxIndicator-Dj91Im5z.js → CheckboxIndicator-DFCs5GRD.js} +2 -2
  36. package/dist/client/assets/{ClippedText-CmBRrYNb.js → ClippedText-BIwvWMlV.js} +2 -2
  37. package/dist/client/assets/CodexSetupSection.logic-3MrEmFzD.js +2 -0
  38. package/dist/client/assets/{CollapsiblePanel-BwDr-EKA.js → CollapsiblePanel-CsWNZ7jo.js} +2 -2
  39. package/dist/client/assets/{ComboboxClear-DeqR6c-6.js → ComboboxClear-Cv9NZFNr.js} +2 -2
  40. package/dist/client/assets/{ComboboxGroupLabel-Dk-MF4sD.js → ComboboxGroupLabel-BPe0M6wJ.js} +2 -2
  41. package/dist/client/assets/{CommandBlock-C15Q987N.js → CommandBlock-DUs3JB3r.js} +2 -2
  42. package/dist/client/assets/{CompositeRoot-Cx12XSsh.js → CompositeRoot-RcqGhRAf.js} +2 -2
  43. package/dist/client/assets/ConnectAgentSurface-BG30oBmC.js +2 -0
  44. package/dist/client/assets/{ConnectionStatusDot-BnhNFCMA.js → ConnectionStatusDot-DIUevPBM.js} +2 -2
  45. package/dist/client/assets/{DRLTVNUE-CkNId4Pz.js → DRLTVNUE-CAWKPVio.js} +2 -2
  46. package/dist/client/assets/{DYY6UVD2-B4516qT_.js → DYY6UVD2-HB9mYAbb.js} +2 -2
  47. package/dist/client/assets/DevicePanel-BAT6BS-V.js +2 -0
  48. package/dist/client/assets/DeviceSetup-ClD1wdY1.js +2 -0
  49. package/dist/client/assets/DialogRoot-Dg58-QOq.js +2 -0
  50. package/dist/client/assets/DialogTitle-CSaaIBpP.js +2 -0
  51. package/dist/client/assets/{DiffCommentAnnotation-CSzNea6G.js → DiffCommentAnnotation-BjI2rZNS.js} +3 -3
  52. package/dist/client/assets/{DiffFileTree-CDnFut1y.js → DiffFileTree-C6VB4VCo.js} +2 -2
  53. package/dist/client/assets/DiffPanel-pkAdnqL7.js +2 -0
  54. package/dist/client/assets/{DiffWorkerPoolProvider-zgaFe3TY.js → DiffWorkerPoolProvider-CPwS1D4h.js} +3 -3
  55. package/dist/client/assets/{EmbeddedDesign-BI3VZqZl.js → EmbeddedDesign-DOevokgh.js} +7 -7
  56. package/dist/client/assets/{EnvironmentMachineIcon-Lz2YGk0G.js → EnvironmentMachineIcon-DM48TG2x.js} +2 -2
  57. package/dist/client/assets/{ExpandableText-B034p2kF.js → ExpandableText-CYFNBBpY.js} +2 -2
  58. package/dist/client/assets/{FNOVOB4O-Uc8FDPv8.js → FNOVOB4O-BkKBPKb-.js} +2 -2
  59. package/dist/client/assets/{FieldControl-H6iQvC-Q.js → FieldControl-DHSVFpKc.js} +2 -2
  60. package/dist/client/assets/{FileDiff-B4Yf4fFg.js → FileDiff-CdxU7jjH.js} +2 -2
  61. package/dist/client/assets/{FilePreviewPanel-u1jxtxzb.js → FilePreviewPanel-Bz8HETIa.js} +4 -4
  62. package/dist/client/assets/{FoldedSettingsSection-DvzfFn5A.js → FoldedSettingsSection-IyrJlpO8.js} +2 -2
  63. package/dist/client/assets/{HDGCDEEZ-DVkQN-82.js → HDGCDEEZ-BW-K6GhK.js} +2 -2
  64. package/dist/client/assets/{HSJLKHB7-txH19TCj.js → HSJLKHB7-B8h6fviS.js} +2 -2
  65. package/dist/client/assets/{Icons-DmQwwfAN.js → Icons-DpgbzNj8.js} +2 -2
  66. package/dist/client/assets/Input-BT2VVALp.js +2 -0
  67. package/dist/client/assets/{IntervalSecondsField-xqmFxAii.js → IntervalSecondsField-BaJ1qNX-.js} +2 -2
  68. package/dist/client/assets/JZOYTAAL-DbSUKTwO.js +1 -0
  69. package/dist/client/assets/{K3MD6TGW-4d2yDOzZ.js → K3MD6TGW-BTpBxr8x.js} +2 -2
  70. package/dist/client/assets/{K7RP3OMA-B8vKr81f.js → K7RP3OMA-DcsmGbRM.js} +2 -2
  71. package/dist/client/assets/{KeybindingsSettings.logic-C6XG7NtX.js → KeybindingsSettings.logic-oAUXQqts.js} +2 -2
  72. package/dist/client/assets/{LHDIQX7Q-DAyTfuTY.js → LHDIQX7Q-NOcjEUQY.js} +2 -2
  73. package/dist/client/assets/{LUXOKEGN-C67XJj3F.js → LUXOKEGN-BWJqFZst.js} +2 -2
  74. package/dist/client/assets/LinkMachineSelect-Dp6FC1LE.js +2 -0
  75. package/dist/client/assets/{MathTypeset-CMO1aCZc.js → MathTypeset-DHPwWtff.js} +2 -2
  76. package/dist/client/assets/{ModelLiveLayer-DqW0VhFG.js → ModelLiveLayer-D3x6mJFP.js} +3 -3
  77. package/dist/client/assets/{N3JZAHOW-Bp1sdK_N.js → N3JZAHOW-oDX5VWgR.js} +2 -2
  78. package/dist/client/assets/{NUIALGQ3-D427dlgt.js → NUIALGQ3-DbqxE7KO.js} +2 -2
  79. package/dist/client/assets/{NoProjectsHero-BL0Jsc_V.js → NoProjectsHero-Dk-rv5RI.js} +2 -2
  80. package/dist/client/assets/{O65XPQGZ-BxqHRP3n.js → O65XPQGZ-Cys4qXjc.js} +2 -2
  81. package/dist/client/assets/{O7XIQ6OM-CKRD1aP5.js → O7XIQ6OM-aLdTRbRJ.js} +2 -2
  82. package/dist/client/assets/{OFQON5FD-CzS9a25C.js → OFQON5FD-DpC8rm9Y.js} +2 -2
  83. package/dist/client/assets/P4ConnectAccountPages-C-GbG9lk.js +2 -0
  84. package/dist/client/assets/{P4ConnectSidebarSignIn-29st82gY.js → P4ConnectSidebarSignIn-DepXmk4f.js} +2 -2
  85. package/dist/client/assets/{PJQHF43J-Ww7-2BqY.js → PJQHF43J-CUbFewuD.js} +2 -2
  86. package/dist/client/assets/PanelLayoutControls-CKWjLO_e.js +218 -0
  87. package/dist/client/assets/{PierreEntryIcon-UO6zY_i-.js → PierreEntryIcon-CVKV5qfT.js} +2 -2
  88. package/dist/client/assets/{PopoverHandle-DEcvmS0k.js → PopoverHandle-s36xVlsK.js} +2 -2
  89. package/dist/client/assets/PreviewPanel-B-ty1_ZL.js +2 -0
  90. package/dist/client/assets/{ProjectDefaultsSettings-DN1mhFNf.js → ProjectDefaultsSettings-vF_5kxVM.js} +2 -2
  91. package/dist/client/assets/{ProjectFavicon-CyXd4lSF.js → ProjectFavicon-BEsCcLjN.js} +3 -3
  92. package/dist/client/assets/{ProjectIconPickerDialog-B_D_9SAb.js → ProjectIconPickerDialog-D1_gSlWW.js} +2 -2
  93. package/dist/client/assets/{ProjectMonogram-C8btbogu.js → ProjectMonogram-Aw_ZBtDB.js} +2 -2
  94. package/dist/client/assets/{ProviderAuthTerminal-B0GzUrya.js → ProviderAuthTerminal-cNp7I_XV.js} +2 -2
  95. package/dist/client/assets/ProviderModelPicker-CCCH-TiQ.js +2 -0
  96. package/dist/client/assets/{ProviderSettingsForm-DefAmKv_.js → ProviderSettingsForm-CV7sAQy3.js} +2 -2
  97. package/dist/client/assets/PullRequestCodeTab-DjChxC-1.js +6 -0
  98. package/dist/client/assets/{RHNBAITX-BsGO-vJB.js → RHNBAITX-CEZ1jYAC.js} +2 -2
  99. package/dist/client/assets/{ReadOnlySourcePreview-COho36OD.js → ReadOnlySourcePreview-Dw9TzXZ2.js} +2 -2
  100. package/dist/client/assets/{RedactedSensitiveText-BMXImj30.js → RedactedSensitiveText-bQSbv34p.js} +2 -2
  101. package/dist/client/assets/RenderErrorBoundary-Dbb6Gs8P.js +23 -0
  102. package/dist/client/assets/{RightPanelResizeHandle-Cog3JVw0.js → RightPanelResizeHandle-B6vIzqA0.js} +2 -2
  103. package/dist/client/assets/{SLD4V6NK-BZEKTqDY.js → SLD4V6NK-BXmFkBHB.js} +2 -2
  104. package/dist/client/assets/ScheduledTasksSettings-TjoGUXvC.js +6 -0
  105. package/dist/client/assets/{ScopedSwitch-Cq7B0T7B.js → ScopedSwitch-C8qSHRkU.js} +2 -2
  106. package/dist/client/assets/{ScrollAreaCorner-DFCZuJ0r.js → ScrollAreaCorner-Cn2VDisz.js} +2 -2
  107. package/dist/client/assets/{SecretInput-CRgvNUgU.js → SecretInput-C6zW-8wI.js} +2 -2
  108. package/dist/client/assets/{SelectScrollUpArrow-C-MWJdyw.js → SelectScrollUpArrow-C40FP3vq.js} +2 -2
  109. package/dist/client/assets/{SelfImproveSettingsSection-DZUf-jb0.js → SelfImproveSettingsSection-BhUO-XvV.js} +2 -2
  110. package/dist/client/assets/{SettingsPanels-Bk_YhHLm.js → SettingsPanels-DFPZUI9O.js} +7 -7
  111. package/dist/client/assets/{SettingsPanels.logic-UhRGlGN1.js → SettingsPanels.logic-5bLleFhd.js} +2 -2
  112. package/dist/client/assets/{SettingsScopeNotice-Cja-hHOp.js → SettingsScopeNotice-VgBZL2zg.js} +2 -2
  113. package/dist/client/assets/{SidebarStageBackdrop-DL1ZzaTz.js → SidebarStageBackdrop-DvPzZM_j.js} +2 -2
  114. package/dist/client/assets/{T3PCR2KE-D049x5K8.js → T3PCR2KE-bp9TnTiq.js} +2 -2
  115. package/dist/client/assets/{TKWO2OVW-Du9gxVgn.js → TKWO2OVW-Cyskzdq0.js} +2 -2
  116. package/dist/client/assets/{TSHNXIZL-pUPHV4Qd.js → TSHNXIZL-Dp3os6bG.js} +2 -2
  117. package/dist/client/assets/{ThemeEditorPanel-CcFVvJlQ.js → ThemeEditorPanel-B1RklhEA.js} +3 -3
  118. package/dist/client/assets/{ThreadDetailsItemsMenu-C4wfbepv.js → ThreadDetailsItemsMenu-BOMU-3M3.js} +60 -60
  119. package/dist/client/assets/ThreadTerminalDrawer-BmwBVDGv.js +5 -0
  120. package/dist/client/assets/TooltipProvider-DQ0TF9NB.js +2 -0
  121. package/dist/client/assets/{UQJE5E4I-BN56DsgT.js → UQJE5E4I-DDRoojS_.js} +2 -2
  122. package/dist/client/assets/{USNYFO5S-DVfAs9Gy.js → USNYFO5S-BvyU-aXY.js} +2 -2
  123. package/dist/client/assets/{Virtualizer-Cn_zq3uH.js → Virtualizer-DFzJCTxQ.js} +2 -2
  124. package/dist/client/assets/{WEVWDWVA-Cz36fo-k.js → WEVWDWVA-DTuHUaDF.js} +2 -2
  125. package/dist/client/assets/{WorkspaceBreadcrumb-Cok6l_SJ.js → WorkspaceBreadcrumb-Dno2N8Xd.js} +2 -2
  126. package/dist/client/assets/{WorkspacePageContainer-_--jFIZ8.js → WorkspacePageContainer-OLpcgD_f.js} +2 -2
  127. package/dist/client/assets/{WorkspacePageHeader-CJB6rvZc.js → WorkspacePageHeader-Bn0m4gpR.js} +2 -2
  128. package/dist/client/assets/{X5RFHQXM-CUB_vKAl.js → X5RFHQXM-D9IKIoIk.js} +2 -2
  129. package/dist/client/assets/{X62E3GBT-C0wKfqHq.js → X62E3GBT-BBXkOa6O.js} +2 -2
  130. package/dist/client/assets/{XBNEOJTC-CkYPODhO.js → XBNEOJTC-D743Jp_H.js} +2 -2
  131. package/dist/client/assets/{YHV2MVVZ-Cf82W2em.js → YHV2MVVZ-DZBsjjLM.js} +2 -2
  132. package/dist/client/assets/{YURCZMG2-C9tzKn90.js → YURCZMG2-ByezMSr0.js} +2 -2
  133. package/dist/client/assets/{YVG2LODB-DEZWhxa8.js → YVG2LODB-DrsC56GM.js} +2 -2
  134. package/dist/client/assets/_chat-BrgTPEvH.js +47 -0
  135. package/dist/client/assets/_chat.design-CgGDbdSU.js +2 -0
  136. package/dist/client/assets/{_chat.index-YmI2iiCN.js → _chat.index-BjAR62fj.js} +2 -2
  137. package/dist/client/assets/{_chat.new-BQY5ktA8.js → _chat.new-SjhrzHWl.js} +3 -3
  138. package/dist/client/assets/_chat.pull-requests-BixugchU.js +2 -0
  139. package/dist/client/assets/{alert-D6WJ0q4-.js → alert-CfhQnxcL.js} +2 -2
  140. package/dist/client/assets/alert-dialog-Dn_PRSFU.js +2 -0
  141. package/dist/client/assets/{assetUrls-C78a94Xu.js → assetUrls-Bn1N9LX7.js} +2 -2
  142. package/dist/client/assets/assets-Lf7mgwY7.js +2 -0
  143. package/dist/client/assets/{browserHistoryStore-DHI-0j5y.js → browserHistoryStore-Ciy-Cygo.js} +2 -2
  144. package/dist/client/assets/{browserLinkTarget-D8HUAQg-.js → browserLinkTarget-DKVi8qup.js} +2 -2
  145. package/dist/client/assets/{checkbox-Cw33xyU7.js → checkbox-iFzfBLKr.js} +2 -2
  146. package/dist/client/assets/{color-picker-Bmtarpj9.js → color-picker-W1NtR7ha.js} +2 -2
  147. package/dist/client/assets/combobox-B0IMIA-1.js +2 -0
  148. package/dist/client/assets/command-BdVxwZ8D.js +2 -0
  149. package/dist/client/assets/{connect-Dl6MuR2C.js → connect-C605Zs89.js} +2 -2
  150. package/dist/client/assets/connect-agent-Cy1G_UzI.js +2 -0
  151. package/dist/client/assets/{design-BoZx445P.js → design-BNHLz8I2.js} +2 -2
  152. package/dist/client/assets/{device-Ku4cbgo-.js → device-CwiofvsD.js} +2 -2
  153. package/dist/client/assets/dialog-DFlZvvht.js +2 -0
  154. package/dist/client/assets/dialog-styles-Df-wlHU1.js +2 -0
  155. package/dist/client/assets/{diffPanelStore-D3ARjaef.js → diffPanelStore-CGdPbp5I.js} +2 -2
  156. package/dist/client/assets/{diffRendering-yxIsTMie.js → diffRendering-DJnBG6ZN.js} +2 -2
  157. package/dist/client/assets/{dist-CkH9xVVz.js → dist-D1XCsn7e.js} +3 -3
  158. package/dist/client/assets/{draft-input-DM7mC5ty.js → draft-input-1HTN8QVo.js} +2 -2
  159. package/dist/client/assets/{duoViewer-_3Xk2sTq.js → duoViewer-CQpxZewd.js} +2 -2
  160. package/dist/client/assets/{dynamic-CwQ-caG2.js → dynamic-DHrzmb9Z.js} +2 -2
  161. package/dist/client/assets/{embeddedScripts-Cn7aGTAj.js → embeddedScripts-D7WC0N_7.js} +2 -2
  162. package/dist/client/assets/{empty-VkAC9qIO.js → empty-Dn5VI2Xk.js} +2 -2
  163. package/dist/client/assets/entities-CjoTQlW3.js +2 -0
  164. package/dist/client/assets/{fileLinks-CJ9SYNL6.js → fileLinks-BZkPwsEY.js} +2 -2
  165. package/dist/client/assets/{fileTreeExpansion-CdWOFpa-.js → fileTreeExpansion-DHPBKDpm.js} +2 -2
  166. package/dist/client/assets/{getDiffFileInput-hLtjvhYr.js → getDiffFileInput-D-dpZLfC.js} +2 -2
  167. package/dist/client/assets/{htmlRender-DYI6n9Xo.js → htmlRender-BdsR_7vV.js} +2 -2
  168. package/dist/client/assets/{index-etcfxnIt.js → index-Cq59P2HC.js} +3 -3
  169. package/dist/client/assets/{input-group-DOUsG7P-.js → input-group-B1TOCtDG.js} +2 -2
  170. package/dist/client/assets/{input-CiPGmOLv.js → input-yaZxaTds.js} +2 -2
  171. package/dist/client/assets/{kbd-C8opCm5n.js → kbd-R7rkirqT.js} +2 -2
  172. package/dist/client/assets/{keybindings-CbaDrm2P.js → keybindings-CrlWqd5q.js} +2 -2
  173. package/dist/client/assets/{lazy--Qcevr63.js → lazy-BH4rgIwO.js} +4 -4
  174. package/dist/client/assets/{lazyRouteComponent-BZe6tHvz.js → lazyRouteComponent-BxpFJiXB.js} +2 -2
  175. package/dist/client/assets/{link-BHR6GsRr.js → link-2ZiGGBbw.js} +2 -2
  176. package/dist/client/assets/{linkedPrompt-D4M9Fbja.js → linkedPrompt-BTa8Gs9-.js} +2 -2
  177. package/dist/client/assets/main-Rpw_0nEx.css +2 -0
  178. package/dist/client/assets/main-xhw8F2iL.js +38 -0
  179. package/dist/client/assets/mediaReference-B7ym_1-U.js +2 -0
  180. package/dist/client/assets/{mediaSource-B03Ykm6c.js → mediaSource-GtWYcfeZ.js} +2 -2
  181. package/dist/client/assets/{modelScene-CX8s0IGN.js → modelScene-uWeIf_CC.js} +2 -2
  182. package/dist/client/assets/number-field-DNna9ps3.js +2 -0
  183. package/dist/client/assets/{observeResize-BESwMMOy.js → observeResize-Cz6dJUG2.js} +2 -2
  184. package/dist/client/assets/{onboarding-BZ01kUjR.js → onboarding-CxDppAGc.js} +2 -2
  185. package/dist/client/assets/openFileInPreview-MLuDI8fu.js +2 -0
  186. package/dist/client/assets/{p4ProjectFile-y2CDxOaL.js → p4ProjectFile-DlnfrOnm.js} +2 -2
  187. package/dist/client/assets/{pair-PXvf9qqC.js → pair-BJWvIdrD.js} +2 -2
  188. package/dist/client/assets/{pendingSendStore-CX8QB7C5.js → pendingSendStore-Cc6n4Xji.js} +2 -2
  189. package/dist/client/assets/{phoneViewer-F9Wt5VkW.js → phoneViewer-OFK_ThS_.js} +2 -2
  190. package/dist/client/assets/{pierre-icons-BTVgApcG.js → pierre-icons-BYPQj09G.js} +2 -2
  191. package/dist/client/assets/popover-DnYfrQly.js +2 -0
  192. package/dist/client/assets/{preview-DnCP9Q0k.js → preview-Bi-hPWTp.js} +2 -2
  193. package/dist/client/assets/{preview-5pSBET3P.js → preview-CxFR-vue.js} +2 -2
  194. package/dist/client/assets/{previewMiniPlayerStore-DByen2Nk.js → previewMiniPlayerStore-W10VSM09.js} +2 -2
  195. package/dist/client/assets/primary-CCmKskNP.js +2 -0
  196. package/dist/client/assets/primaryCloudLinkState-DDs0gJOh.js +2 -0
  197. package/dist/client/assets/{projectFilesQueryState-B6AeAhgL.js → projectFilesQueryState-DzjMtjuq.js} +2 -2
  198. package/dist/client/assets/projectScriptEditor-C2NTRQLs.js +2 -0
  199. package/dist/client/assets/{providerSkills-D-ytsJU9.js → providerSkills-gNPMp_MW.js} +2 -2
  200. package/dist/client/assets/pullRequestDetail.logic-BZNLZTdt.js +10 -0
  201. package/dist/client/assets/{pullRequestIcons-1lUVOGQJ.js → pullRequestIcons-DwblWS4R.js} +2 -2
  202. package/dist/client/assets/{pullRequestReviewStore-CUZ0N4F2.js → pullRequestReviewStore-Cc4bHb4o.js} +2 -2
  203. package/dist/client/assets/{pullRequests-DrQJ8zM2.js → pullRequests-DAMVEVGR.js} +2 -2
  204. package/dist/client/assets/queries-ckipBW-f.js +2 -0
  205. package/dist/client/assets/{query-CeIgbVxh.js → query-DFSffMGJ.js} +2 -2
  206. package/dist/client/assets/{radio-group-C14CASyG.js → radio-group-EK7EPCn2.js} +2 -2
  207. package/dist/client/assets/relay-BLgoNhyd.js +2 -0
  208. package/dist/client/assets/relayFailureReason-COnjzJFI.js +2 -0
  209. package/dist/client/assets/{renderScheduler-eNIG8tB_.js → renderScheduler-BCOEl9SF.js} +2 -2
  210. package/dist/client/assets/{rightPanelStore-Bt0unAo8.js → rightPanelStore-AjYoRisO.js} +2 -2
  211. package/dist/client/assets/runtime-CbYvES7U.js +9 -0
  212. package/dist/client/assets/{runtimeModeConfig-DymGoV55.js → runtimeModeConfig-Oh86kRYJ.js} +2 -2
  213. package/dist/client/assets/{scheduledTasksSettings.logic-CKzZuci7.js → scheduledTasksSettings.logic-DBMDVdjk.js} +3 -3
  214. package/dist/client/assets/{scroll-area-D2D-AlvC.js → scroll-area-DhDCLqyU.js} +2 -2
  215. package/dist/client/assets/{select-CE2f-g-3.js → select-CNcZzYBl.js} +2 -2
  216. package/dist/client/assets/{selfImproveFindings-Bhi6QF1b.js → selfImproveFindings-CvQXlaMJ.js} +2 -2
  217. package/dist/client/assets/{server-DthHkqkT.js → server-CEMcTnD1.js} +2 -2
  218. package/dist/client/assets/{session-CxeYe0sJ.js → session-Ces3Ebxl.js} +2 -2
  219. package/dist/client/assets/session-logic-DoE1Q_f_.js +27 -0
  220. package/dist/client/assets/{settings-DAe5Z4UG.js → settings-DfyN3nPg.js} +2 -2
  221. package/dist/client/assets/{settings.appearance-wfb5oCmC.js → settings.appearance-DKdqiS33.js} +2 -2
  222. package/dist/client/assets/settings.archived-DDSjJTCo.js +2 -0
  223. package/dist/client/assets/{settings.computer-use-DJQcngZ4.js → settings.computer-use-B9Lvx9ml.js} +2 -2
  224. package/dist/client/assets/settings.connections-CeVMC9_Q.js +2 -0
  225. package/dist/client/assets/{settings.data-controls-DUI06j8l.js → settings.data-controls-C50d8Y1p.js} +2 -2
  226. package/dist/client/assets/{settings.decisions-BY4z-aRM.js → settings.decisions-IKWdsPJP.js} +2 -2
  227. package/dist/client/assets/{settings.designs-O0d1vzoU.js → settings.designs-DYK1fORq.js} +2 -2
  228. package/dist/client/assets/settings.diagnostics-DDQ_8Jca.js +2 -0
  229. package/dist/client/assets/{settings.general-CAOwfHEb.js → settings.general-c8Ls4Mz6.js} +2 -2
  230. package/dist/client/assets/settings.integrations-Bx78DSgB.js +2 -0
  231. package/dist/client/assets/{settings.keybindings-CwvrmKin.js → settings.keybindings-CBhgDtMa.js} +2 -2
  232. package/dist/client/assets/{settings.open-source-licenses-DCBCu3U3.js → settings.open-source-licenses-CgHCMsAt.js} +2 -2
  233. package/dist/client/assets/{settings.plugins-8R8eV7IR.js → settings.plugins-1AVunwAZ.js} +4 -4
  234. package/dist/client/assets/{settings.projects-Cy_93LuA.js → settings.projects-voo-H787.js} +4 -4
  235. package/dist/client/assets/settings.providers-BWjGRXNt.js +3 -0
  236. package/dist/client/assets/{settings.scheduled-tasks-CHnjcJx8.js → settings.scheduled-tasks-czvZRhu8.js} +2 -2
  237. package/dist/client/assets/{settings.secrets-BgQSmFWY.js → settings.secrets-B4BGlz80.js} +2 -2
  238. package/dist/client/assets/{settings.snap-shot-C0J6pItQ.js → settings.snap-shot-d8VTC1Lv.js} +2 -2
  239. package/dist/client/assets/{settings.source-control-B3kcm55_.js → settings.source-control-Df0azAck.js} +2 -2
  240. package/dist/client/assets/settings.storage-CAwfhCbA.js +2 -0
  241. package/dist/client/assets/settingsLayout-D5Mded9h.js +3 -0
  242. package/dist/client/assets/sidebar-BUDllWET.js +2 -0
  243. package/dist/client/assets/{sidebarProjectGrouping-BaiZoO-A.js → sidebarProjectGrouping-Dt_irkWm.js} +2 -2
  244. package/dist/client/assets/{skeleton-D6RVfMa8.js → skeleton-C6O21cqb.js} +2 -2
  245. package/dist/client/assets/{sourceControl-j8xaTHat.js → sourceControl-CgxDQG5w.js} +2 -2
  246. package/dist/client/assets/{sourceControlClients-BxzlzQxJ.js → sourceControlClients-Bg3Of7DX.js} +2 -2
  247. package/dist/client/assets/{spinner-C-qDE4WQ.js → spinner-m1uNq_wW.js} +2 -2
  248. package/dist/client/assets/src-DHn7yNZx.js +15 -0
  249. package/dist/client/assets/terminal-links-C2FjxVhS.js +2 -0
  250. package/dist/client/assets/terminalSessions-DBYKcIE6.js +2 -0
  251. package/dist/client/assets/{textarea-CWbMGhL9.js → textarea-xZYMC9X5.js} +2 -2
  252. package/dist/client/assets/{themePalette-B_fGWNEh.js → themePalette-BcMO2M90.js} +3 -3
  253. package/dist/client/assets/{threadCheckpoints-B88N2CXf.js → threadCheckpoints-DUorxvL1.js} +2 -2
  254. package/dist/client/assets/{toggle-CKr6iZUR.js → toggle-DumCe7R7.js} +2 -2
  255. package/dist/client/assets/{toggle-group-B1WN0Pgy.js → toggle-group-CzE2mG-B.js} +2 -2
  256. package/dist/client/assets/{tooltip-CCYU8XGM.js → tooltip-BhCWnsdW.js} +2 -2
  257. package/dist/client/assets/{uiStateStore-CX-sbFiq.js → uiStateStore-B25zCY_s.js} +2 -2
  258. package/dist/client/assets/usage-DdBC08dx.js +2 -0
  259. package/dist/client/assets/{usageAccess-B0nqd8U-.js → usageAccess-COKmar79.js} +2 -2
  260. package/dist/client/assets/{usageFormat-CUSzTPTq.js → usageFormat-2913AogD.js} +2 -2
  261. package/dist/client/assets/{usageShortcuts-jGu1QJHr.js → usageShortcuts-U_aRtpf7.js} +2 -2
  262. package/dist/client/assets/{use-atom-command-Bsfu4mja.js → use-atom-command-DWabKYXN.js} +2 -2
  263. package/dist/client/assets/{useAriaLabelledBy-CJvtvui4.js → useAriaLabelledBy-BiZIzNf7.js} +2 -2
  264. package/dist/client/assets/useHandleNewThread-DTgcUVdd.js +2 -0
  265. package/dist/client/assets/{useLocation-KvBZAN7v.js → useLocation-BXwb7I1F.js} +2 -2
  266. package/dist/client/assets/{useNavigate-DXSBYc-k.js → useNavigate-P1p3Es15.js} +2 -2
  267. package/dist/client/assets/{useNavigateBack-DzR35iiJ.js → useNavigateBack-D02Al7yk.js} +2 -2
  268. package/dist/client/assets/{useP4ConnectAuthPrompt-CW-hut92.js → useP4ConnectAuthPrompt-DKYJHISj.js} +2 -2
  269. package/dist/client/assets/{useParams-D9reDvT8.js → useParams-DsmZTF__.js} +2 -2
  270. package/dist/client/assets/{usePermissionStatus-C5YvHVz-.js → usePermissionStatus-DeJYBk6u.js} +2 -2
  271. package/dist/client/assets/{usePopupViewport-D7yp2NvZ.js → usePopupViewport-BBKn7x_4.js} +2 -2
  272. package/dist/client/assets/usePullRequestActions-BGugTe1S.js +3 -0
  273. package/dist/client/assets/{useRegisterFieldControl-D-hYtXkm.js → useRegisterFieldControl-DkFmgEzw.js} +2 -2
  274. package/dist/client/assets/{useScopedModelAvailability-J0i-Sj4p.js → useScopedModelAvailability-LgMepA3M.js} +2 -2
  275. package/dist/client/assets/useSettings-hYzrsDTp.js +3 -0
  276. package/dist/client/assets/utils-BVnIIHXP.js +26 -0
  277. package/dist/client/assets/vcsRefInvalidation-C5gDWck3.js +2 -0
  278. package/dist/client/assets/welcome-CQrdWD2c.js +2 -0
  279. package/dist/client/icon-192x192.png +0 -0
  280. package/dist/client/icon-512x512.png +0 -0
  281. package/dist/client/index.html +1 -1
  282. package/dist/client/manifest.webmanifest +12 -0
  283. package/dist/client/third-party-licenses.json +1 -1
  284. package/dist/{mcpResponsePayloads-tqyeJD3c.mjs → mcpResponsePayloads-C8W7Qyxk.mjs} +3 -3
  285. package/dist/{preview-CmCyL-Tc.mjs → preview-C_kKbIjf.mjs} +6741 -3322
  286. package/dist/{renderer-CswgrCon.mjs → renderer-DKOOIEoX.mjs} +2 -2
  287. package/dist/resource-monitor/darwin-arm64/p4-resource-monitor +0 -0
  288. package/dist/{runtime-Bec3_bh8.mjs → runtime-Bm_EVnst.mjs} +3 -3
  289. package/dist/{runtimeLayer-BnJcJFjY.mjs → runtimeLayer-DQ7pD9BT.mjs} +22626 -21082
  290. package/dist/{runtimeLayer-DnNbGwAf.mjs → runtimeLayer-Go0xTEaW.mjs} +1 -1
  291. package/dist/{server-DXfSgbuj.mjs → server-DQ0wuuLG.mjs} +4388 -3021
  292. package/dist/{sha2-BfCJmkJJ.mjs → sha2-Daa2Fiv1.mjs} +7411 -5229
  293. package/package.json +1 -1
  294. package/dist/AcpMcpStdioBridge-DbCGhPmy.mjs +0 -3
  295. package/dist/client/assets/AlertDialogRoot-COfNlajP.js +0 -2
  296. package/dist/client/assets/ChatGptUsageButton-C9D5JFWr.js +0 -2
  297. package/dist/client/assets/ChatMarkdown-Ck4FJs_Q.js +0 -49
  298. package/dist/client/assets/CodexSetupSection.logic-DzEO1qoo.js +0 -2
  299. package/dist/client/assets/ConnectAgentSurface-6FVydN17.js +0 -2
  300. package/dist/client/assets/DevicePanel-B3CR7kGX.js +0 -2
  301. package/dist/client/assets/DeviceSetup-Lxy9dmqi.js +0 -2
  302. package/dist/client/assets/DialogTitle-5cBExuFs.js +0 -2
  303. package/dist/client/assets/DiffPanel-KfudIZct.js +0 -2
  304. package/dist/client/assets/Input-DWc7cRWt.js +0 -2
  305. package/dist/client/assets/JZOYTAAL-BqUoPKcz.js +0 -1
  306. package/dist/client/assets/LinkMachineSelect-DoqwB0AR.js +0 -2
  307. package/dist/client/assets/P4ConnectAccountPages-Ca1o0JuS.js +0 -2
  308. package/dist/client/assets/PanelLayoutControls-CoWjUmx7.js +0 -216
  309. package/dist/client/assets/PreviewPanel-BHj7Mvmn.js +0 -2
  310. package/dist/client/assets/ProviderModelPicker-DQ3N8RWz.js +0 -2
  311. package/dist/client/assets/PullRequestCodeTab-BTwbK3zR.js +0 -6
  312. package/dist/client/assets/RenderErrorBoundary-CYsCxleQ.js +0 -23
  313. package/dist/client/assets/ScheduledTasksSettings-CpfGXMow.js +0 -6
  314. package/dist/client/assets/ThreadTerminalDrawer-PkBB7D3Z.js +0 -5
  315. package/dist/client/assets/TooltipProvider-DiV5KdTq.js +0 -2
  316. package/dist/client/assets/_chat-PsMoIPUC.js +0 -47
  317. package/dist/client/assets/_chat.design-CWE-keji.js +0 -2
  318. package/dist/client/assets/_chat.pull-requests-C90JBKAN.js +0 -2
  319. package/dist/client/assets/alert-dialog-DsMTn0ZK.js +0 -2
  320. package/dist/client/assets/assets-5kUNv3CS.js +0 -2
  321. package/dist/client/assets/combobox-D6RfzdE7.js +0 -2
  322. package/dist/client/assets/command-1dJ-vX2N.js +0 -2
  323. package/dist/client/assets/connect-agent-B22xdP4o.js +0 -2
  324. package/dist/client/assets/dialog-5OaxRXCC.js +0 -2
  325. package/dist/client/assets/entities-DOpLfnwX.js +0 -2
  326. package/dist/client/assets/main-C04YJQbN.js +0 -38
  327. package/dist/client/assets/main-i3nSjwXu.css +0 -2
  328. package/dist/client/assets/mediaReference-D4rhlY-i.js +0 -2
  329. package/dist/client/assets/number-field-BkDsfSCt.js +0 -2
  330. package/dist/client/assets/openFileInPreview-XKgvCQ1z.js +0 -2
  331. package/dist/client/assets/popover-hyDlWUPU.js +0 -2
  332. package/dist/client/assets/primary-BXI66byW.js +0 -2
  333. package/dist/client/assets/primaryCloudLinkState-DswWb__m.js +0 -2
  334. package/dist/client/assets/projectScriptEditor-DvKvgTs-.js +0 -2
  335. package/dist/client/assets/pullRequestDetail.logic-DQj9l9DL.js +0 -10
  336. package/dist/client/assets/queries-BA_altUI.js +0 -2
  337. package/dist/client/assets/relay-CTdDIWLg.js +0 -2
  338. package/dist/client/assets/runtime-BvdQMwVb.js +0 -7
  339. package/dist/client/assets/session-logic-2ZMapwqV.js +0 -27
  340. package/dist/client/assets/settings.archived-BF0zdtbV.js +0 -2
  341. package/dist/client/assets/settings.connections-CoxujVuf.js +0 -2
  342. package/dist/client/assets/settings.diagnostics-CwCeo1mG.js +0 -2
  343. package/dist/client/assets/settings.integrations-2RsLmeUi.js +0 -2
  344. package/dist/client/assets/settings.providers-4HI8om0T.js +0 -3
  345. package/dist/client/assets/settings.storage-Cy6oX7X3.js +0 -2
  346. package/dist/client/assets/settingsLayout-YTaL8Lym.js +0 -3
  347. package/dist/client/assets/sidebar-4oe_dr6q.js +0 -2
  348. package/dist/client/assets/src-R7EkrVcv.js +0 -15
  349. package/dist/client/assets/terminal-links-BdsGDJ3O.js +0 -2
  350. package/dist/client/assets/terminalSessions-yZRa64tn.js +0 -2
  351. package/dist/client/assets/usage-CdxC8YNe.js +0 -2
  352. package/dist/client/assets/useHandleNewThread-Cv_08eER.js +0 -2
  353. package/dist/client/assets/usePullRequestActions-BHv9tRFF.js +0 -3
  354. package/dist/client/assets/useSettings-BhGGZc98.js +0 -3
  355. package/dist/client/assets/utils-DkKLB01I.js +0 -24
  356. package/dist/client/assets/vcsRefInvalidation-71d-99uY.js +0 -2
  357. package/dist/client/assets/welcome-Ytf7jmR7.js +0 -2
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Pipeable.js
3
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Pipeable.js
4
4
  /**
5
5
  * The `Pipeable` module defines the shared interface and implementation helpers
6
6
  * for values that support Effect-style method chaining with `.pipe(...)`.
@@ -100,12 +100,12 @@ const Prototype$1 = { pipe() {
100
100
  * @category constructors
101
101
  * @since 3.15.0
102
102
  */
103
- const Class$2 = /*#__PURE__*/ function() {
103
+ const Class$3 = /*#__PURE__*/ function() {
104
104
  function PipeableBase() {}
105
105
  PipeableBase.prototype = Prototype$1;
106
106
  return PipeableBase;
107
107
  }();
108
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Function.js
108
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Function.js
109
109
  /**
110
110
  * Creates a function that can be called in data-first style or data-last
111
111
  * (`pipe`-friendly) style.
@@ -495,7 +495,7 @@ function memoizeIdempotent(f) {
495
495
  return result;
496
496
  };
497
497
  }
498
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/equal.js
498
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/equal.js
499
499
  /** @internal */
500
500
  const getAllObjectKeys = (obj) => {
501
501
  const keys = new Set(Reflect.ownKeys(obj));
@@ -515,7 +515,21 @@ const getAllObjectKeys = (obj) => {
515
515
  const byReferenceInstances = /*#__PURE__*/ new WeakSet();
516
516
  /** @internal */
517
517
  const viewBytes = (view) => new Uint8Array(view.buffer, view.byteOffset, view.byteLength);
518
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/hash.js
518
+ /** @internal */
519
+ const isArrayBufferLike = (u) => u instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && u instanceof SharedArrayBuffer;
520
+ /**
521
+ * Returns `undefined` for detached buffers, which can no longer be read.
522
+ *
523
+ * @internal
524
+ */
525
+ const bufferBytes = (buffer) => {
526
+ try {
527
+ return new Uint8Array(buffer);
528
+ } catch {
529
+ return;
530
+ }
531
+ };
532
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/hash.js
519
533
  /**
520
534
  * Back-edge count used to avoid caching entry-point-dependent hashes.
521
535
  *
@@ -526,7 +540,7 @@ let backEdges = 0;
526
540
  const addBackEdge = () => {
527
541
  backEdges++;
528
542
  };
529
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Predicate.js
543
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Predicate.js
530
544
  /**
531
545
  * Defines runtime checks for values.
532
546
  *
@@ -1246,7 +1260,7 @@ const compose$1 = /*#__PURE__*/ dual(2, (ab, bc) => (a) => ab(a) && bc(a));
1246
1260
  * @since 2.0.0
1247
1261
  */
1248
1262
  const or = /*#__PURE__*/ dual(2, (self, that) => (a) => self(a) || that(a));
1249
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Hash.js
1263
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Hash.js
1250
1264
  /**
1251
1265
  * Computes Effect hash values and defines the interface for objects that want
1252
1266
  * to provide their own hash implementation. Hashes are small numeric
@@ -1335,9 +1349,12 @@ const hash = (self) => {
1335
1349
  const seen = backEdges;
1336
1350
  let h;
1337
1351
  try {
1338
- if ("~effect/Hash" in self) h = self[symbol$1]();
1352
+ if (isHash(self)) h = self[symbol$1]();
1339
1353
  else if (typeof self === "function") h = random$1(self);
1340
- else if (self instanceof DataView) h = array(viewBytes(self));
1354
+ else if (isArrayBufferLike(self)) {
1355
+ const bytes = bufferBytes(self);
1356
+ h = bytes === void 0 ? random$1(self) : array(bytes);
1357
+ } else if (self instanceof DataView) h = array(viewBytes(self));
1341
1358
  else if (Array.isArray(self) || ArrayBuffer.isView(self)) h = array(self);
1342
1359
  else if (self instanceof Map) h = hashMap(self);
1343
1360
  else if (self instanceof Set) h = hashSet(self);
@@ -1449,6 +1466,40 @@ const combine$1 = /*#__PURE__*/ dual(2, (self, b) => mix(Math.imul(self, 2654435
1449
1466
  * @since 2.0.0
1450
1467
  */
1451
1468
  const optimize = (n) => n & 3221225471 | n >>> 1 & 1073741824;
1469
+ /**
1470
+ * Checks whether a value implements the Hash interface.
1471
+ *
1472
+ * **When to use**
1473
+ *
1474
+ * Use to detect whether an unknown value provides a custom hash implementation.
1475
+ *
1476
+ * **Details**
1477
+ *
1478
+ * This function determines whether a given value has a function under the Hash
1479
+ * symbol, indicating that it can provide its own hash value implementation.
1480
+ * Data that merely carries the key, such as parsed JSON, is hashed as data.
1481
+ *
1482
+ * **Example** (Checking for Hash support)
1483
+ *
1484
+ * ```ts import.meta.vitest
1485
+ * import { Hash } from "effect"
1486
+ *
1487
+ * class MyHashable implements Hash.Hash {
1488
+ * [Hash.symbol]() {
1489
+ * return 42
1490
+ * }
1491
+ * }
1492
+ *
1493
+ * Hash.isHash(new MyHashable()) // => true
1494
+ * Hash.isHash({}) // => false
1495
+ * Hash.isHash("string") // => false
1496
+ * ```
1497
+ *
1498
+ * @stability stable
1499
+ * @category guards
1500
+ * @since 2.0.0
1501
+ */
1502
+ const isHash = (u) => hasProperty(u, "~effect/Hash") && typeof u["~effect/Hash"] === "function";
1452
1503
  const float64 = /*#__PURE__*/ new DataView(/*#__PURE__*/ new ArrayBuffer(8));
1453
1504
  /**
1454
1505
  * Computes a hash value for a number.
@@ -1641,7 +1692,7 @@ const hashSet = /*#__PURE__*/ unordered(setSeed, (element) => combine$1(setSeed,
1641
1692
  const randomHashCache = /*#__PURE__*/ new WeakMap();
1642
1693
  const hashCache = /*#__PURE__*/ new WeakMap();
1643
1694
  const visitedObjects = /*#__PURE__*/ new WeakSet();
1644
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Equal.js
1695
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Equal.js
1645
1696
  /**
1646
1697
  * Defines the unique string identifier for the `Equal` interface.
1647
1698
  *
@@ -1733,6 +1784,11 @@ function compareStructure(self, that) {
1733
1784
  else if (Array.isArray(self)) {
1734
1785
  if (!Array.isArray(that) || self.length !== that.length) return false;
1735
1786
  return compareArrays(self, that);
1787
+ } else if (isArrayBufferLike(self)) {
1788
+ if (!isArrayBufferLike(that) || self instanceof ArrayBuffer !== that instanceof ArrayBuffer) return false;
1789
+ const selfBytes = bufferBytes(self);
1790
+ const thatBytes = bufferBytes(that);
1791
+ return selfBytes !== void 0 && thatBytes !== void 0 && compareTypedArrays(selfBytes, thatBytes);
1736
1792
  } else if (ArrayBuffer.isView(self)) {
1737
1793
  const selfIsDataView = self instanceof DataView;
1738
1794
  if (!ArrayBuffer.isView(that) || self.byteLength !== that.byteLength || selfIsDataView !== that instanceof DataView) return false;
@@ -1811,8 +1867,8 @@ function makeCompareSet(equivalence) {
1811
1867
  * **Details**
1812
1868
  *
1813
1869
  * - Pure function, no side effects.
1814
- * - Returns `true` if and only if `u` has a property keyed by
1815
- * {@link symbol}.
1870
+ * - Returns `true` if and only if `u` has a function keyed by {@link symbol}.
1871
+ * Data that merely carries the key, such as parsed JSON, is not `Equal`.
1816
1872
  * - Acts as a TypeScript type guard, narrowing the input to {@link Equal}.
1817
1873
  *
1818
1874
  * **Example** (Checking Equal values)
@@ -1841,7 +1897,7 @@ function makeCompareSet(equivalence) {
1841
1897
  * @category guards
1842
1898
  * @since 2.0.0
1843
1899
  */
1844
- const isEqual = (u) => hasProperty(u, symbol);
1900
+ const isEqual = (u) => hasProperty(u, "~effect/Equal") && typeof u["~effect/Equal"] === "function";
1845
1901
  /**
1846
1902
  * Wraps {@link equals} as an `Equivalence<A>`.
1847
1903
  *
@@ -1916,7 +1972,7 @@ const byReferenceUnsafe = (obj) => {
1916
1972
  byReferenceInstances.add(obj);
1917
1973
  return obj;
1918
1974
  };
1919
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Equivalence.js
1975
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Equivalence.js
1920
1976
  /**
1921
1977
  * Creates a custom equivalence relation with an optimized reference equality check.
1922
1978
  *
@@ -2092,13 +2148,13 @@ function Array_(item) {
2092
2148
  return true;
2093
2149
  });
2094
2150
  }
2095
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/array.js
2151
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/array.js
2096
2152
  /**
2097
2153
  * @since 2.0.0
2098
2154
  */
2099
2155
  /** @internal */
2100
2156
  const isArrayNonEmpty$1 = (self) => self.length > 0;
2101
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/count.js
2157
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/count.js
2102
2158
  /**
2103
2159
  * Normalizes a collection count to a non-negative integer. `NaN` and
2104
2160
  * non-positive values become `0`; positive infinity is preserved.
@@ -2112,7 +2168,7 @@ const normalize = (n) => n > 0 ? Math.floor(n) : 0;
2112
2168
  * @internal
2113
2169
  */
2114
2170
  const normalizeNonEmpty = (n) => Math.max(1, normalize(n));
2115
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/record.js
2171
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/record.js
2116
2172
  /** @internal */
2117
2173
  function assignProperty(self, key, value) {
2118
2174
  if (key === "__proto__") Object.defineProperty(self, key, {
@@ -2125,9 +2181,13 @@ function assignProperty(self, key, value) {
2125
2181
  }
2126
2182
  /** @internal */
2127
2183
  function assignProperties(self, source) {
2184
+ if (!Object.hasOwn(source, "__proto__")) {
2185
+ Object.assign(self, source);
2186
+ return;
2187
+ }
2128
2188
  for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProperty(self, key, source[key]);
2129
2189
  }
2130
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Redactable.js
2190
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Redactable.js
2131
2191
  /**
2132
2192
  * Defines the symbol used to identify objects that implement the {@link Redactable}
2133
2193
  * protocol.
@@ -2249,7 +2309,7 @@ const emptyContext$1 = {
2249
2309
  return pipeArguments(this, arguments);
2250
2310
  }
2251
2311
  };
2252
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Formatter.js
2312
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Formatter.js
2253
2313
  /**
2254
2314
  * Formats JavaScript values into readable strings.
2255
2315
  *
@@ -2486,8 +2546,9 @@ function safeGet(input, key) {
2486
2546
  */
2487
2547
  function formatJson(input, options) {
2488
2548
  const ancestors = [];
2549
+ const sources = /* @__PURE__ */ new WeakMap();
2489
2550
  return JSON.stringify(input, function(key, value) {
2490
- const original = Object.getOwnPropertyDescriptor(this, key)?.value;
2551
+ const original = Object.getOwnPropertyDescriptor(sources.get(this) ?? this, key)?.value;
2491
2552
  const redacted = hasProperty(original, symbolRedactable) ? redact(original) : redact(value);
2492
2553
  if (typeof redacted === "bigint") return format$1(redacted);
2493
2554
  if (typeof redacted !== "object" || redacted === null) return redacted;
@@ -2501,18 +2562,28 @@ function formatJson(input, options) {
2501
2562
  ancestors.push(redacted);
2502
2563
  if (current !== redacted) ancestors.push(current);
2503
2564
  if (!hasGetter(current) || isJsonPrimitiveWrapper(current)) return current;
2504
- const serialized = new Proxy(current, { get(target, key) {
2505
- const value = Reflect.get(target, key, target);
2506
- return Object.getOwnPropertyDescriptor(target, key)?.get !== void 0 ? redact(value) : value;
2507
- } });
2508
- ancestors.push(serialized);
2509
- return serialized;
2565
+ const view = redactingView(current);
2566
+ sources.set(view, current);
2567
+ ancestors.push(view);
2568
+ return view;
2510
2569
  }, options?.space) ?? "null";
2511
2570
  }
2512
2571
  function hasGetter(object) {
2513
2572
  for (const key of Object.getOwnPropertyNames(object)) if (Object.getOwnPropertyDescriptor(object, key)?.get !== void 0) return true;
2514
2573
  return false;
2515
2574
  }
2575
+ function redactingView(object) {
2576
+ const view = Array.isArray(object) ? [] : {};
2577
+ const keys = Array.isArray(object) ? Array.from({ length: object.length }, (_, i) => String(i)) : Object.keys(object);
2578
+ for (const key of keys) Object.defineProperty(view, key, {
2579
+ enumerable: true,
2580
+ get: () => {
2581
+ const value = Reflect.get(object, key);
2582
+ return Object.getOwnPropertyDescriptor(object, key)?.get !== void 0 ? redact(value) : value;
2583
+ }
2584
+ });
2585
+ return view;
2586
+ }
2516
2587
  function isJsonPrimitiveWrapper(object) {
2517
2588
  for (const valueOf of [
2518
2589
  Number.prototype.valueOf,
@@ -2524,7 +2595,7 @@ function isJsonPrimitiveWrapper(object) {
2524
2595
  } catch {}
2525
2596
  return false;
2526
2597
  }
2527
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Inspectable.js
2598
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Inspectable.js
2528
2599
  /**
2529
2600
  * Controls how values appear in logs and debugging output.
2530
2601
  *
@@ -2723,7 +2794,7 @@ const BaseProto = {
2723
2794
  * @category models
2724
2795
  * @since 2.0.0
2725
2796
  */
2726
- var Class$1 = class {
2797
+ var Class$2 = class {
2727
2798
  /**
2728
2799
  * Node.js custom inspection method.
2729
2800
  *
@@ -2749,7 +2820,7 @@ var Class$1 = class {
2749
2820
  return format$1(this.toJSON());
2750
2821
  }
2751
2822
  };
2752
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/stackTraceLimit.js
2823
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/stackTraceLimit.js
2753
2824
  /**
2754
2825
  * Check if `Error.stackTraceLimit` is writable.
2755
2826
  * Returns `false` if the property is frozen, non-writable, or `Error` is non-extensible.
@@ -2780,7 +2851,7 @@ const getStackTraceLimit = () => Error.stackTraceLimit;
2780
2851
  const setStackTraceLimit = (value) => {
2781
2852
  if (canWriteStackTraceLimit) Error.stackTraceLimit = value;
2782
2853
  };
2783
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Utils.js
2854
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Utils.js
2784
2855
  /**
2785
2856
  * Yields its wrapped value exactly once, then completes with the value sent
2786
2857
  * back in.
@@ -2862,7 +2933,7 @@ const pickInternalCall = () => {
2862
2933
  };
2863
2934
  /** @internal */
2864
2935
  const internalCall = /*#__PURE__*/ pickInternalCall();
2865
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/core.js
2936
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/core.js
2866
2937
  /** @internal */
2867
2938
  const EffectTypeId = `~effect/Effect`;
2868
2939
  /** @internal */
@@ -2956,7 +3027,7 @@ var CauseImpl = class {
2956
3027
  toJSON() {
2957
3028
  return {
2958
3029
  _id: "Cause",
2959
- failures: this.reasons.map((f) => f.toJSON())
3030
+ reasons: this.reasons.map((f) => f.toJSON())
2960
3031
  };
2961
3032
  }
2962
3033
  toString() {
@@ -2995,6 +3066,7 @@ var ReasonBase = class {
2995
3066
  if (options?.overwrite !== true && newAnnotations.has(key)) return;
2996
3067
  newAnnotations.set(key, value);
2997
3068
  });
3069
+ if (options?.overwrite !== true && newAnnotations.size === this.annotations.size) return this;
2998
3070
  const self = Object.assign(Object.create(Object.getPrototypeOf(this)), this);
2999
3071
  self.annotations = newAnnotations;
3000
3072
  return self;
@@ -3055,6 +3127,18 @@ const causeCombine = /*#__PURE__*/ dual(2, (self, that) => {
3055
3127
  const newCause = new CauseImpl(dedupeReasons(self.reasons, that.reasons));
3056
3128
  return equals$1(self, newCause) ? self : newCause;
3057
3129
  });
3130
+ /**
3131
+ * Appends the interrupts from `interrupts` that `self` does not contain yet.
3132
+ * Unlike `causeCombine`, it never calls hash or equality methods, which can be
3133
+ * user-defined, random, or throwing.
3134
+ *
3135
+ * @internal
3136
+ */
3137
+ const causeAddInterrupts = (self, interrupts) => {
3138
+ const reasons = self.reasons.slice();
3139
+ for (const reason of interrupts.reasons) if (isInterruptReason$1(reason) && !reasons.some((r) => isInterruptReason$1(r) && r.fiberId === reason.fiberId && r.annotations === reason.annotations)) reasons.push(reason);
3140
+ return reasons.length === self.reasons.length ? self : new CauseImpl(reasons);
3141
+ };
3058
3142
  /** @internal */
3059
3143
  const causeEmpty = /*#__PURE__*/ new CauseImpl([]);
3060
3144
  /** @internal */
@@ -3184,7 +3268,7 @@ const exitFailCause = /*#__PURE__*/ makeExit({
3184
3268
  cont = fiber.getCont(contE);
3185
3269
  }
3186
3270
  if (skippedHandler) cause = causeFromReasons(cause.reasons.filter((reason) => reason._tag !== "Fail"));
3187
- cause = causeCombine(cause, interruptedCause);
3271
+ cause = causeAddInterrupts(cause, interruptedCause);
3188
3272
  annotated = true;
3189
3273
  }
3190
3274
  return cont ? cont[contE](cause, fiber, annotated ? void 0 : this) : fiber.yieldWith(annotated ? exitFailCause(cause) : this);
@@ -3229,7 +3313,7 @@ const YieldableError = /*#__PURE__*/ function() {
3229
3313
  return YieldableError;
3230
3314
  }();
3231
3315
  /** @internal */
3232
- const Error$1 = /*#__PURE__*/ function() {
3316
+ const Error$2 = /*#__PURE__*/ function() {
3233
3317
  const plainArgsSymbol = /*#__PURE__*/ Symbol.for("effect/Data/Error/plainArgs");
3234
3318
  return class Base extends YieldableError {
3235
3319
  constructor(args) {
@@ -3251,8 +3335,8 @@ const Error$1 = /*#__PURE__*/ function() {
3251
3335
  };
3252
3336
  }();
3253
3337
  /** @internal */
3254
- const TaggedError = (tag) => {
3255
- class Base extends Error$1 {
3338
+ const TaggedError$1 = (tag) => {
3339
+ class Base extends Error$2 {
3256
3340
  _tag = tag;
3257
3341
  }
3258
3342
  Base.prototype.name = tag;
@@ -3263,7 +3347,7 @@ const NoSuchElementErrorTypeId = "~effect/Cause/NoSuchElementError";
3263
3347
  /** @internal */
3264
3348
  const isNoSuchElementError$1 = (u) => hasProperty(u, NoSuchElementErrorTypeId);
3265
3349
  /** @internal */
3266
- var NoSuchElementError$1 = class extends (/*#__PURE__*/ TaggedError("NoSuchElementError")) {
3350
+ var NoSuchElementError$1 = class extends (/*#__PURE__*/ TaggedError$1("NoSuchElementError")) {
3267
3351
  [NoSuchElementErrorTypeId] = NoSuchElementErrorTypeId;
3268
3352
  constructor(message) {
3269
3353
  super({ message });
@@ -3293,7 +3377,7 @@ const done$2 = (value) => {
3293
3377
  if (value === void 0) return doneVoid;
3294
3378
  return exitFail(Done$1(value));
3295
3379
  };
3296
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/option.js
3380
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/option.js
3297
3381
  /**
3298
3382
  * @since 2.0.0
3299
3383
  */
@@ -3363,7 +3447,7 @@ const SomeImpl = function(value) {
3363
3447
  SomeImpl.prototype = SomeProto;
3364
3448
  /** @internal */
3365
3449
  const some$1 = (value) => new SomeImpl(value);
3366
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/result.js
3450
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/result.js
3367
3451
  const TypeId$7 = "~effect/Result";
3368
3452
  const CommonProto = {
3369
3453
  [TypeId$7]: {
@@ -3436,7 +3520,7 @@ const SuccessImpl = function(success) {
3436
3520
  SuccessImpl.prototype = SuccessProto;
3437
3521
  /** @internal */
3438
3522
  const succeed$6 = (success) => new SuccessImpl(success);
3439
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Order.js
3523
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Order.js
3440
3524
  /**
3441
3525
  * Defines comparison functions for ordered values.
3442
3526
  *
@@ -3873,7 +3957,7 @@ const min$1 = (O) => dual(2, (self, that) => self === that || O(self, that) < 1
3873
3957
  * @since 2.0.0
3874
3958
  */
3875
3959
  const max$1 = (O) => dual(2, (self, that) => self === that || O(self, that) > -1 ? self : that);
3876
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Option.js
3960
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Option.js
3877
3961
  /**
3878
3962
  * Creates an `Option` representing the absence of a value.
3879
3963
  *
@@ -4342,6 +4426,44 @@ const liftThrowable = (f) => (...a) => {
4342
4426
  }
4343
4427
  };
4344
4428
  /**
4429
+ * Extracts the value from a `Some`, or throws a custom error for `None`.
4430
+ *
4431
+ * **When to use**
4432
+ *
4433
+ * Use when you need fail-fast unwrapping of an `Option` for unexpected absence
4434
+ * and want to provide a descriptive debugging error.
4435
+ *
4436
+ * **Details**
4437
+ *
4438
+ * - `Some` → returns the inner value
4439
+ * - `None` → throws the value returned by `onNone()`
4440
+ *
4441
+ * **Example** (Throwing a custom error)
4442
+ *
4443
+ * ```ts import.meta.vitest
4444
+ * import { Option, Result } from "effect"
4445
+ *
4446
+ * Option.getOrThrowWith(Option.some(1), () => new Error("missing")) // => 1
4447
+ *
4448
+ * const failure = Result.try({
4449
+ * try: () => Option.getOrThrowWith(Option.none(), () => new Error("missing")),
4450
+ * catch: (error) => (error as Error).message
4451
+ * })
4452
+ * Result.getFailure(failure).pipe(Option.getOrElse(() => "no error")) // => "missing"
4453
+ * ```
4454
+ *
4455
+ * @see {@link getOrThrow} for a version with a default error
4456
+ * @see {@link getOrElse} for a non-throwing alternative
4457
+ *
4458
+ * @stability stable
4459
+ * @category converting
4460
+ * @since 2.0.0
4461
+ */
4462
+ const getOrThrowWith$1 = /*#__PURE__*/ dual(2, (self, onNone) => {
4463
+ if (isSome(self)) return self.value;
4464
+ throw onNone();
4465
+ });
4466
+ /**
4345
4467
  * Extracts the value from a `Some`, or throws a default `Error` for `None`.
4346
4468
  *
4347
4469
  * **When to use**
@@ -4375,10 +4497,7 @@ const liftThrowable = (f) => (...a) => {
4375
4497
  * @category converting
4376
4498
  * @since 2.0.0
4377
4499
  */
4378
- const getOrThrow$1 = /*#__PURE__*/ (/* @__PURE__ */ dual(2, (self, onNone) => {
4379
- if (isSome(self)) return self.value;
4380
- throw onNone();
4381
- }))(() => /* @__PURE__ */ new Error("getOrThrow called on a None"));
4500
+ const getOrThrow$1 = /*#__PURE__*/ getOrThrowWith$1(() => /* @__PURE__ */ new Error("getOrThrow called on a None"));
4382
4501
  /**
4383
4502
  * Transforms the value inside a `Some` using the provided function, leaving
4384
4503
  * `None` unchanged.
@@ -4680,7 +4799,7 @@ const contains = /*#__PURE__*/ containsWith(/*#__PURE__*/ asEquivalence());
4680
4799
  * @since 2.0.0
4681
4800
  */
4682
4801
  const exists = /*#__PURE__*/ dual(2, (self, refinement) => isNone(self) ? false : refinement(self.value));
4683
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Result.js
4802
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Result.js
4684
4803
  /**
4685
4804
  * Creates a `Result` holding a `Success` value.
4686
4805
  *
@@ -5123,7 +5242,7 @@ const all$2 = (input) => {
5123
5242
  }
5124
5243
  return succeed$5(out);
5125
5244
  };
5126
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Iterable.js
5245
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Iterable.js
5127
5246
  /**
5128
5247
  * Gets the first element of an `Iterable` without returning an `Option`.
5129
5248
  *
@@ -5314,7 +5433,7 @@ const filterMap$1 = /*#__PURE__*/ dual(2, (self, f) => ({ [Symbol.iterator]() {
5314
5433
  };
5315
5434
  } };
5316
5435
  } }));
5317
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Array.js
5436
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Array.js
5318
5437
  /**
5319
5438
  * Exposes the global array constructor.
5320
5439
  *
@@ -5466,8 +5585,10 @@ const ensure = (self) => Array$1.isArray(self) ? self : [self];
5466
5585
  *
5467
5586
  * **Details**
5468
5587
  *
5469
- * `onNonEmpty` receives a `NonEmptyReadonlyArray`. Supports both data-first and
5470
- * data-last usage.
5588
+ * `onNonEmpty` receives a `NonEmptyArray` for mutable arrays and a
5589
+ * `NonEmptyReadonlyArray` otherwise. Data-last calls default to the readonly
5590
+ * callback, so the returned function still accepts `ReadonlyArray`. Supports
5591
+ * both data-first and data-last usage.
5471
5592
  *
5472
5593
  * **Example** (Branching on emptiness)
5473
5594
  *
@@ -6061,6 +6182,34 @@ const flatMap$3 = /*#__PURE__*/ dual(2, (self, f) => {
6061
6182
  return out;
6062
6183
  });
6063
6184
  /**
6185
+ * Extracts all `Some` values from an iterable of `Option`s, discarding `None`s.
6186
+ *
6187
+ * **When to use**
6188
+ *
6189
+ * Use to collect only present values from an iterable of `Option` values while
6190
+ * discarding `None` values.
6191
+ *
6192
+ * **Example** (Extracting Some values)
6193
+ *
6194
+ * ```ts import.meta.vitest
6195
+ * import { Array, Option } from "effect"
6196
+ *
6197
+ * Array.getSomes([Option.some(1), Option.none(), Option.some(2)]) // => [1, 2]
6198
+ * ```
6199
+ *
6200
+ * @see {@link fromOption} — convert a single Option
6201
+ * @see {@link getSuccesses} — extract successes from Results
6202
+ *
6203
+ * @stability stable
6204
+ * @category filtering
6205
+ * @since 2.0.0
6206
+ */
6207
+ const getSomes = (self) => {
6208
+ const out = [];
6209
+ for (const a of self) if (isSome(a)) out.push(a.value);
6210
+ return out;
6211
+ };
6212
+ /**
6064
6213
  * Keeps transformed values for elements where a `Filter` succeeds.
6065
6214
  *
6066
6215
  * **When to use**
@@ -6271,7 +6420,7 @@ const flatMapNullishOr = /*#__PURE__*/ dual(2, (self, f) => flatMap$3(self, (a)
6271
6420
  * @since 4.0.0
6272
6421
  */
6273
6422
  const makeEquivalence = Array_;
6274
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Effectable.js
6423
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Effectable.js
6275
6424
  /**
6276
6425
  * Create a low-level `Effect` prototype.
6277
6426
  *
@@ -6296,7 +6445,7 @@ const Prototype = (options) => makePrimitiveProto({
6296
6445
  op: options.label,
6297
6446
  [evaluate]: options.evaluate
6298
6447
  });
6299
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Context.js
6448
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Context.js
6300
6449
  /**
6301
6450
  * Runtime type identifier attached to `Context` service keys and used by
6302
6451
  * `isKey` to recognize them.
@@ -6403,9 +6552,8 @@ const ServiceProto = {
6403
6552
  const cacheKeys = /*#__PURE__*/ new Set();
6404
6553
  const ReferenceTypeId = "~effect/Context/Reference";
6405
6554
  const TypeId$6 = "~effect/Context";
6406
- const MaxDepth = 8;
6407
6555
  const FlattenAfterBaseHits = 8;
6408
- const makeImpl = (cacheRoot, base, overlay, depth) => {
6556
+ const makeImpl = (cacheRoot, base, overlay, depth, maxDepth) => {
6409
6557
  const self = Object.create(Proto);
6410
6558
  self.cacheRoot = cacheRoot ?? self;
6411
6559
  self.base = base;
@@ -6413,6 +6561,7 @@ const makeImpl = (cacheRoot, base, overlay, depth) => {
6413
6561
  self.depth = depth;
6414
6562
  self._flat = void 0;
6415
6563
  self.baseHits = 0;
6564
+ self.maxDepth = maxDepth;
6416
6565
  return self;
6417
6566
  };
6418
6567
  const applyOverlays = (map, overlay) => {
@@ -6430,7 +6579,7 @@ const flatten$2 = (self) => {
6430
6579
  const withFlat = (self, f) => {
6431
6580
  const map = new Map(self.mapUnsafe);
6432
6581
  f(map);
6433
- return makeUnsafe$2(map);
6582
+ return makeImpl(void 0, map, void 0, 0, self.maxDepth);
6434
6583
  };
6435
6584
  const notFound = /*#__PURE__*/ Symbol();
6436
6585
  const lookup = (self, key) => {
@@ -6453,8 +6602,23 @@ const lookup = (self, key) => {
6453
6602
  * Use when constructing a low-level `Context` from a trusted map whose lifecycle
6454
6603
  * you control.
6455
6604
  *
6605
+ * **Details**
6606
+ *
6607
+ * `options.maxDepth` sets how many `add` calls are kept as overlays before the
6608
+ * context is rebased into a flat map (default `8`). Lower values make lookups
6609
+ * cheaper, higher values make additions to a large base cheaper. Invalid
6610
+ * values fall back to the default.
6611
+ *
6612
+ * Contexts derived with `add`, `pick`, `omit`, and `merge` keep the setting
6613
+ * (`merge` from its first non-empty argument). `make`, `empty`, and `mergeAll`
6614
+ * use the default. Layers are combined with `mergeAll`, so apply it to the
6615
+ * final context rather than inside a layer.
6616
+ *
6456
6617
  * **Gotchas**
6457
6618
  *
6619
+ * Excessively large `maxDepth` values can cause stack overflow when overlays
6620
+ * are materialized or rebased. Choose a modest value.
6621
+ *
6458
6622
  * The provided map is retained without copying and must not be mutated after
6459
6623
  * construction. Prefer `empty`, `make`, `add`, or `merge` for normal Context
6460
6624
  * construction.
@@ -6477,7 +6641,10 @@ const lookup = (self, key) => {
6477
6641
  * @category constructors
6478
6642
  * @since 4.0.0
6479
6643
  */
6480
- const makeUnsafe$2 = (mapUnsafe) => makeImpl(void 0, mapUnsafe, void 0, 0);
6644
+ const makeUnsafe$2 = (mapUnsafe, options) => {
6645
+ const maxDepth = options?.maxDepth;
6646
+ return makeImpl(void 0, mapUnsafe, void 0, 0, Number.isInteger(maxDepth) && maxDepth >= 0 ? maxDepth : 8);
6647
+ };
6481
6648
  const Proto = {
6482
6649
  get mapUnsafe() {
6483
6650
  return flatten$2(this);
@@ -6645,17 +6812,17 @@ const add = /*#__PURE__*/ dual(3, (self, key, service) => addUnsafe(self, key.ke
6645
6812
  const addUnsafe = (self, key, service) => {
6646
6813
  const impl = self;
6647
6814
  const cacheRoot = cacheKeys.has(key) ? void 0 : impl.cacheRoot;
6648
- if (impl.depth >= MaxDepth) {
6815
+ if (impl.depth >= impl.maxDepth) {
6649
6816
  const map = new Map(impl._flat ?? impl.base);
6650
6817
  if (!impl._flat) applyOverlays(map, impl.overlay);
6651
6818
  map.set(key, service);
6652
- return makeImpl(cacheRoot, map, void 0, 0);
6819
+ return makeImpl(cacheRoot, map, void 0, 0, impl.maxDepth);
6653
6820
  }
6654
6821
  return makeImpl(cacheRoot, impl.base, {
6655
6822
  key,
6656
6823
  value: service,
6657
6824
  parent: impl.overlay
6658
- }, impl.depth + 1);
6825
+ }, impl.depth + 1, impl.maxDepth);
6659
6826
  };
6660
6827
  /**
6661
6828
  * Gets the service for a key, or evaluates the fallback when a non-reference
@@ -7035,7 +7202,7 @@ const omit = (...keys) => (self) => withFlat(self, (map) => {
7035
7202
  * @since 3.11.0
7036
7203
  */
7037
7204
  const Reference = Service;
7038
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Duration.js
7205
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Duration.js
7039
7206
  const TypeId$5 = "~effect/Duration";
7040
7207
  const bigint0$1 = /*#__PURE__*/ BigInt(0);
7041
7208
  const bigint1 = /*#__PURE__*/ BigInt(1);
@@ -7045,9 +7212,20 @@ const bigint24 = /*#__PURE__*/ BigInt(24);
7045
7212
  const bigint60 = /*#__PURE__*/ BigInt(60);
7046
7213
  const bigint1e3 = /*#__PURE__*/ BigInt(1e3);
7047
7214
  const bigint1e6 = /*#__PURE__*/ BigInt(1e6);
7215
+ const bigint1e9 = /*#__PURE__*/ BigInt(1e9);
7216
+ const bigintNanosPerMinute = /*#__PURE__*/ BigInt(6e10);
7217
+ const bigintNanosPerHour = /*#__PURE__*/ BigInt(36e11);
7218
+ const bigintNanosPerDay = /*#__PURE__*/ BigInt(864e11);
7219
+ const bigintNanosPerWeek = /*#__PURE__*/ BigInt(6048e11);
7048
7220
  const roundTiesAwayFromZero = (input) => BigInt(Math.sign(input) * Math.round(Math.abs(input)));
7049
- const roundMillisToNanos = (millis) => roundTiesAwayFromZero(millis * 1e6);
7221
+ const roundMillisToNanos = (millis) => Number.isInteger(millis) ? BigInt(millis) * bigint1e6 : roundTiesAwayFromZero(millis * 1e6);
7050
7222
  const fromNanosNumber = (nanos) => make$4(Number.isFinite(nanos) ? roundTiesAwayFromZero(nanos) : nanos);
7223
+ const nanosToUnit = (nanos, divisor) => {
7224
+ const value = Number(nanos);
7225
+ if (Number.isFinite(value)) return value / divisor;
7226
+ const scale = BigInt(divisor);
7227
+ return Number(nanos / scale) + Number(nanos % scale) / divisor;
7228
+ };
7051
7229
  const parseNanos = (input, scale) => {
7052
7230
  const decimalIndex = input.indexOf(".");
7053
7231
  if (decimalIndex === -1) return BigInt(input) * scale;
@@ -7062,6 +7240,12 @@ const divideTiesAwayFromZero = (numerator, denominator) => {
7062
7240
  const rounded = absolute / denominator + (absolute % denominator * bigint2 >= denominator ? bigint1 : bigint0$1);
7063
7241
  return numerator < bigint0$1 ? -rounded : rounded;
7064
7242
  };
7243
+ const fromMillisString = (input, scale) => {
7244
+ const millis = Number(input) * scale;
7245
+ if (!Number.isFinite(millis)) return make$4(millis);
7246
+ const nanos = parseNanos(input, BigInt(scale) * bigint1e6);
7247
+ return make$4(Number.isInteger(millis) && BigInt(millis) * bigint1e6 === nanos ? millis : nanos);
7248
+ };
7065
7249
  const DURATION_REGEXP = /^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/;
7066
7250
  /**
7067
7251
  * Decodes a `Duration.Input` into a `Duration`.
@@ -7102,20 +7286,19 @@ const fromInputUnsafe = (input) => {
7102
7286
  const [_, valueStr, unit] = match;
7103
7287
  if (unit === "nano" || unit === "nanos") return nanos(parseNanos(valueStr, bigint1));
7104
7288
  if (unit === "micro" || unit === "micros") return nanos(parseNanos(valueStr, bigint1e3));
7105
- const value = Number(valueStr);
7106
7289
  switch (unit) {
7107
7290
  case "milli":
7108
- case "millis": return millis(value);
7291
+ case "millis": return fromMillisString(valueStr, 1);
7109
7292
  case "second":
7110
- case "seconds": return seconds(value);
7293
+ case "seconds": return fromMillisString(valueStr, 1e3);
7111
7294
  case "minute":
7112
- case "minutes": return minutes(value);
7295
+ case "minutes": return fromMillisString(valueStr, 6e4);
7113
7296
  case "hour":
7114
- case "hours": return hours(value);
7297
+ case "hours": return fromMillisString(valueStr, 36e5);
7115
7298
  case "day":
7116
- case "days": return days(value);
7299
+ case "days": return fromMillisString(valueStr, 864e5);
7117
7300
  case "week":
7118
- case "weeks": return weeks(value);
7301
+ case "weeks": return fromMillisString(valueStr, 6048e5);
7119
7302
  }
7120
7303
  break;
7121
7304
  }
@@ -7127,7 +7310,8 @@ const fromInputUnsafe = (input) => {
7127
7310
  if (Number.isNaN(input[0]) || Number.isNaN(input[1])) return zero;
7128
7311
  if (input[0] === -Infinity || input[1] === -Infinity) return negativeInfinity;
7129
7312
  if (input[0] === Infinity || input[1] === Infinity) return infinity;
7130
- return fromNanosNumber(input[0] * 1e9 + input[1]);
7313
+ const nanos = input[0] * 1e9 + input[1];
7314
+ return Number.isFinite(nanos) && Number.isInteger(input[0]) && Number.isInteger(input[1]) ? make$4(BigInt(input[0]) * bigint1e9 + BigInt(input[1])) : fromNanosNumber(nanos);
7131
7315
  }
7132
7316
  const obj = input;
7133
7317
  let millis = 0;
@@ -7137,12 +7321,32 @@ const fromInputUnsafe = (input) => {
7137
7321
  if (obj.minutes) millis += obj.minutes * 6e4;
7138
7322
  if (obj.seconds) millis += obj.seconds * 1e3;
7139
7323
  if (obj.milliseconds) millis += obj.milliseconds;
7140
- if (!obj.microseconds && !obj.nanoseconds) return make$4(millis);
7141
- return fromNanosNumber(millis * 1e6 + (obj.microseconds ?? 0) * 1e3 + (obj.nanoseconds ?? 0));
7324
+ if (!obj.microseconds && !obj.nanoseconds) {
7325
+ if (!Number.isFinite(millis)) return make$4(millis);
7326
+ const exact = sumObjectNanos(obj);
7327
+ return exact === void 0 || BigInt(millis) * bigint1e6 === exact ? make$4(millis) : make$4(exact);
7328
+ }
7329
+ const nanos = millis * 1e6 + (obj.microseconds ?? 0) * 1e3 + (obj.nanoseconds ?? 0);
7330
+ const exact = Number.isFinite(nanos) ? sumObjectNanos(obj) : void 0;
7331
+ return exact === void 0 ? fromNanosNumber(nanos) : make$4(exact);
7142
7332
  }
7143
7333
  }
7144
7334
  return invalid(input);
7145
7335
  };
7336
+ const isIntegerOrUnset = (n) => !n || Number.isInteger(n);
7337
+ const sumObjectNanos = (obj) => {
7338
+ if (!isIntegerOrUnset(obj.weeks) || !isIntegerOrUnset(obj.days) || !isIntegerOrUnset(obj.hours) || !isIntegerOrUnset(obj.minutes) || !isIntegerOrUnset(obj.seconds) || !isIntegerOrUnset(obj.milliseconds) || !isIntegerOrUnset(obj.microseconds) || !isIntegerOrUnset(obj.nanoseconds)) return void 0;
7339
+ let nanos = bigint0$1;
7340
+ if (obj.weeks) nanos += BigInt(obj.weeks) * bigintNanosPerWeek;
7341
+ if (obj.days) nanos += BigInt(obj.days) * bigintNanosPerDay;
7342
+ if (obj.hours) nanos += BigInt(obj.hours) * bigintNanosPerHour;
7343
+ if (obj.minutes) nanos += BigInt(obj.minutes) * bigintNanosPerMinute;
7344
+ if (obj.seconds) nanos += BigInt(obj.seconds) * bigint1e9;
7345
+ if (obj.milliseconds) nanos += BigInt(obj.milliseconds) * bigint1e6;
7346
+ if (obj.microseconds) nanos += BigInt(obj.microseconds) * bigint1e3;
7347
+ if (obj.nanoseconds) nanos += BigInt(obj.nanoseconds);
7348
+ return nanos;
7349
+ };
7146
7350
  const invalid = (input) => {
7147
7351
  throw new Error(`Invalid Input: ${input}`);
7148
7352
  };
@@ -7174,10 +7378,7 @@ const DurationProto = {
7174
7378
  [TypeId$5]: TypeId$5,
7175
7379
  [symbol$1]() {
7176
7380
  switch (this.value._tag) {
7177
- case "Millis": {
7178
- const nanos = this.value.millis * 1e6;
7179
- return Number.isFinite(nanos) ? hash(roundTiesAwayFromZero(nanos)) : number(this.value.millis);
7180
- }
7381
+ case "Millis": return hash(roundMillisToNanos(this.value.millis));
7181
7382
  case "Nanos": return hash(this.value.nanos);
7182
7383
  default: return structure(this.value);
7183
7384
  }
@@ -7494,22 +7695,6 @@ const hours = (hours) => make$4(hours * 36e5);
7494
7695
  */
7495
7696
  const days = (days) => make$4(days * 864e5);
7496
7697
  /**
7497
- * Creates a Duration from weeks.
7498
- *
7499
- * **Example** (Creating durations from weeks)
7500
- *
7501
- * ```ts import.meta.vitest
7502
- * import { Duration } from "effect"
7503
- *
7504
- * Duration.toMillis(Duration.weeks(1)) // => 604_800_000
7505
- * ```
7506
- *
7507
- * @stability stable
7508
- * @category constructors
7509
- * @since 2.0.0
7510
- */
7511
- const weeks = (weeks) => make$4(weeks * 6048e5);
7512
- /**
7513
7698
  * Converts a Duration to milliseconds.
7514
7699
  *
7515
7700
  * **Example** (Converting durations to milliseconds)
@@ -7527,7 +7712,7 @@ const weeks = (weeks) => make$4(weeks * 6048e5);
7527
7712
  */
7528
7713
  const toMillis = (self) => match$3(fromInputUnsafe(self), {
7529
7714
  onMillis: identity,
7530
- onNanos: (nanos) => Number(nanos) / 1e6,
7715
+ onNanos: (nanos) => nanosToUnit(nanos, 1e6),
7531
7716
  onInfinity: () => Infinity,
7532
7717
  onNegativeInfinity: () => -Infinity
7533
7718
  });
@@ -7549,7 +7734,7 @@ const toMillis = (self) => match$3(fromInputUnsafe(self), {
7549
7734
  */
7550
7735
  const toSeconds = (self) => match$3(fromInputUnsafe(self), {
7551
7736
  onMillis: (millis) => millis / 1e3,
7552
- onNanos: (nanos) => Number(nanos) / 1e9,
7737
+ onNanos: (nanos) => nanosToUnit(nanos, 1e9),
7553
7738
  onInfinity: () => Infinity,
7554
7739
  onNegativeInfinity: () => -Infinity
7555
7740
  });
@@ -7571,7 +7756,7 @@ const toSeconds = (self) => match$3(fromInputUnsafe(self), {
7571
7756
  */
7572
7757
  const toMinutes = (self) => match$3(fromInputUnsafe(self), {
7573
7758
  onMillis: (millis) => millis / 6e4,
7574
- onNanos: (nanos) => Number(nanos) / 6e10,
7759
+ onNanos: (nanos) => nanosToUnit(nanos, 6e10),
7575
7760
  onInfinity: () => Infinity,
7576
7761
  onNegativeInfinity: () => -Infinity
7577
7762
  });
@@ -7971,7 +8156,7 @@ const format = (self) => {
7971
8156
  if (fragments.nanos !== 0) pieces.push(`${fragments.nanos}ns`);
7972
8157
  return pieces.join(" ");
7973
8158
  };
7974
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Filter.js
8159
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Filter.js
7975
8160
  /**
7976
8161
  * Converts a Filter into a predicate function.
7977
8162
  *
@@ -8073,7 +8258,7 @@ const toOption = (self) => (input) => {
8073
8258
  const result = self(input);
8074
8259
  return isFailure$1(result) ? none() : some(result.success);
8075
8260
  };
8076
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Scheduler.js
8261
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Scheduler.js
8077
8262
  /**
8078
8263
  * Controls how runnable Effect fiber tasks are dispatched.
8079
8264
  *
@@ -8309,7 +8494,322 @@ const PreventSchedulerYield = /*#__PURE__*/ Reference("effect/Scheduler/PreventS
8309
8494
  fiberCached: true,
8310
8495
  defaultValue: () => false
8311
8496
  });
8312
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/encoding/Hex.js
8497
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Data.js
8498
+ /**
8499
+ * Provides a base class for immutable data types.
8500
+ *
8501
+ * **When to use**
8502
+ *
8503
+ * Use when you need a lightweight immutable value type with `.pipe()` support.
8504
+ *
8505
+ * **Details**
8506
+ *
8507
+ * Extend `Class` with a type parameter to declare fields. The constructor
8508
+ * accepts those fields as a single object argument. When there are no fields
8509
+ * the argument is optional. Instances are `Readonly` and `Pipeable`.
8510
+ *
8511
+ * **Example** (Defining a value class)
8512
+ *
8513
+ * ```ts import.meta.vitest
8514
+ * import { Data, Equal } from "effect"
8515
+ *
8516
+ * class Person extends Data.Class<{ readonly name: string }> {}
8517
+ *
8518
+ * Equal.equals(new Person({ name: "Mike" }), new Person({ name: "Mike" })) // => true
8519
+ * ```
8520
+ *
8521
+ * @see {@link TaggedClass} — adds a `_tag` field
8522
+ * @see {@link Error} — yieldable error variant
8523
+ *
8524
+ * @stability stable
8525
+ * @category constructors
8526
+ * @since 2.0.0
8527
+ */
8528
+ const Class$1 = class extends Class$3 {
8529
+ constructor(props) {
8530
+ super();
8531
+ if (props) assignProperties(this, props);
8532
+ }
8533
+ };
8534
+ /**
8535
+ * Provides a base class for immutable data types with a `_tag` discriminator.
8536
+ *
8537
+ * **When to use**
8538
+ *
8539
+ * Use when you need a single-variant tagged type or an ad-hoc discriminator.
8540
+ *
8541
+ * **Details**
8542
+ *
8543
+ * Like {@link Class}, but the resulting instances also carry a
8544
+ * `readonly _tag: Tag` property. The `_tag` is excluded from the constructor
8545
+ * argument.
8546
+ *
8547
+ * **Example** (Defining a tagged class)
8548
+ *
8549
+ * ```ts import.meta.vitest
8550
+ * import { Data } from "effect"
8551
+ *
8552
+ * class Person extends Data.TaggedClass("Person")<{
8553
+ * readonly name: string
8554
+ * }> {}
8555
+ *
8556
+ * new Person({ name: "Mike" })._tag // => "Person"
8557
+ * ```
8558
+ *
8559
+ * @see {@link Class} — without a `_tag`
8560
+ * @see {@link TaggedError} — tagged error variant
8561
+ * @see {@link TaggedEnum} — multi-variant unions
8562
+ *
8563
+ * @stability stable
8564
+ * @category constructors
8565
+ * @since 2.0.0
8566
+ */
8567
+ const TaggedClass = (tag) => class extends Class$1 {
8568
+ _tag = tag;
8569
+ };
8570
+ /**
8571
+ * Creates constructors and matchers for a `TaggedEnum` type.
8572
+ *
8573
+ * **When to use**
8574
+ *
8575
+ * Use when you model a closed union with plain data objects and want
8576
+ * construction, tag checks, and exhaustive matching from the same definition.
8577
+ *
8578
+ * **Details**
8579
+ *
8580
+ * Returns an object with:
8581
+ * - One constructor per variant (keyed by tag name)
8582
+ * - `$is(tag)` — returns a type-guard function that checks only the `_tag` field
8583
+ * - `$match` — exhaustive pattern matching (data-first or data-last)
8584
+ *
8585
+ * **Gotchas**
8586
+ *
8587
+ * - Constructors produce **plain objects**, not class instances.
8588
+ * - `$is(tag)` only checks the `_tag` field, not the full structure. It relies
8589
+ * on the tag being globally unique and the value being produced by your
8590
+ * constructors. For untrusted input, validate with the `Schema` module first.
8591
+ *
8592
+ * **Example** (Creating and matching tagged enum values)
8593
+ *
8594
+ * ```ts import.meta.vitest
8595
+ * import { Data } from "effect"
8596
+ *
8597
+ * type HttpError = Data.TaggedEnum<{
8598
+ * BadRequest: { readonly message: string }
8599
+ * NotFound: { readonly url: string }
8600
+ * }>
8601
+ *
8602
+ * const { BadRequest, NotFound, $is, $match } = Data.taggedEnum<HttpError>()
8603
+ *
8604
+ * const err = NotFound({ url: "/missing" })
8605
+ *
8606
+ * $is("NotFound")(err) // => true
8607
+ *
8608
+ * $match(err, {
8609
+ * BadRequest: (e) => e.message,
8610
+ * NotFound: (e) => `${e.url} not found`
8611
+ * }) // => "/missing not found"
8612
+ * ```
8613
+ *
8614
+ * **Example** (Defining a generic tagged enum)
8615
+ *
8616
+ * ```ts import.meta.vitest
8617
+ * import { Data } from "effect"
8618
+ *
8619
+ * type MyResult<E, A> = Data.TaggedEnum<{
8620
+ * Failure: { readonly error: E }
8621
+ * Success: { readonly value: A }
8622
+ * }>
8623
+ * interface MyResultDef extends Data.TaggedEnum.WithGenerics<2> {
8624
+ * readonly taggedEnum: MyResult<this["A"], this["B"]>
8625
+ * }
8626
+ * const { Failure, Success } = Data.taggedEnum<MyResultDef>()
8627
+ *
8628
+ * const ok = Success({ value: 42 })
8629
+ * // ok: { readonly _tag: "Success"; readonly value: number }
8630
+ * ok // => { value: 42, _tag: "Success" }
8631
+ * ```
8632
+ *
8633
+ * @see {@link TaggedEnum} — the type-level companion
8634
+ * @see {@link TaggedEnum.Constructor} — the returned object type
8635
+ * @see {@link TaggedEnum.WithGenerics} — generic enum support
8636
+ *
8637
+ * @stability stable
8638
+ * @category constructors
8639
+ * @since 2.0.0
8640
+ */
8641
+ const taggedEnum = () => new Proxy({}, { get(_target, tag, _receiver) {
8642
+ if (tag === "$is") return isTagged;
8643
+ else if (tag === "$match") return taggedMatch;
8644
+ return (props) => ({
8645
+ ...props,
8646
+ _tag: tag
8647
+ });
8648
+ } });
8649
+ function taggedMatch() {
8650
+ if (arguments.length === 1) {
8651
+ const cases = arguments[0];
8652
+ return function(value) {
8653
+ return cases[value._tag](value);
8654
+ };
8655
+ }
8656
+ const value = arguments[0];
8657
+ return arguments[1][value._tag](value);
8658
+ }
8659
+ /**
8660
+ * Provides a base class for yieldable errors.
8661
+ *
8662
+ * **When to use**
8663
+ *
8664
+ * Use when you need yieldable errors that do **not** need tag-based
8665
+ * discrimination.
8666
+ *
8667
+ * **Details**
8668
+ *
8669
+ * Extends `Cause.YieldableError`, so instances can be yielded inside
8670
+ * `Effect.gen` to fail the enclosing effect. Fields are passed as a single
8671
+ * object; when there are no fields the argument is optional. If a `message`
8672
+ * field is provided, it becomes the error's `.message`.
8673
+ *
8674
+ * **Example** (Defining a yieldable error)
8675
+ *
8676
+ * ```ts import.meta.vitest
8677
+ * import { Data, Effect, Exit } from "effect"
8678
+ *
8679
+ * class NetworkError extends Data.Error<{
8680
+ * readonly code: number
8681
+ * readonly message: string
8682
+ * }> {}
8683
+ *
8684
+ * const program = Effect.gen(function*() {
8685
+ * return yield* new NetworkError({ code: 500, message: "timeout" })
8686
+ * })
8687
+ *
8688
+ * Effect.runSync(Effect.exit(program)) // => Exit.fail(new NetworkError({ code: 500, message: "timeout" }))
8689
+ * ```
8690
+ *
8691
+ * @see {@link TaggedError} — adds a `_tag` for `Effect.catchTag`
8692
+ * @see {@link Class} — non-error data class
8693
+ *
8694
+ * @stability stable
8695
+ * @category constructors
8696
+ * @since 2.0.0
8697
+ */
8698
+ const Error$1 = Error$2;
8699
+ /**
8700
+ * Creates a tagged error class with a `_tag` discriminator.
8701
+ *
8702
+ * **When to use**
8703
+ *
8704
+ * Use when you need domain errors with discriminated-union handling.
8705
+ *
8706
+ * **Details**
8707
+ *
8708
+ * Like {@link Error}, but instances also carry a `readonly _tag` property,
8709
+ * enabling `Effect.catchTag` and `Effect.catchTags` for tag-based recovery.
8710
+ * The `_tag` is excluded from the constructor argument. Yielding an instance
8711
+ * inside `Effect.gen` fails the effect with this error.
8712
+ *
8713
+ * **Example** (Recovering by tag)
8714
+ *
8715
+ * ```ts import.meta.vitest
8716
+ * import { Data, Effect } from "effect"
8717
+ *
8718
+ * class NotFound extends Data.TaggedError("NotFound")<{
8719
+ * readonly resource: string
8720
+ * }> {}
8721
+ *
8722
+ * class Forbidden extends Data.TaggedError("Forbidden")<{
8723
+ * readonly reason: string
8724
+ * }> {}
8725
+ *
8726
+ * const program = Effect.gen(function*() {
8727
+ * return yield* new NotFound({ resource: "/users/42" })
8728
+ * })
8729
+ *
8730
+ * const recovered = program.pipe(
8731
+ * Effect.catchTag("NotFound", (e) =>
8732
+ * Effect.succeed(`missing: ${e.resource}`))
8733
+ * )
8734
+ *
8735
+ * await Effect.runPromise(recovered) // => "missing: /users/42"
8736
+ * ```
8737
+ *
8738
+ * @see {@link Error} — without a `_tag`
8739
+ * @see {@link TaggedClass} — tagged class that is not an error
8740
+ *
8741
+ * @stability stable
8742
+ * @category constructors
8743
+ * @since 2.0.0
8744
+ */
8745
+ const TaggedError = TaggedError$1;
8746
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/encoding/EncodingError.js
8747
+ /**
8748
+ * Shared error type for encoding and decoding operations.
8749
+ *
8750
+ * @stability stable
8751
+ * @since 4.0.0
8752
+ */
8753
+ /**
8754
+ * Type identifier stored on `EncodingError` values and used by
8755
+ * `isEncodingError`.
8756
+ *
8757
+ * **When to use**
8758
+ *
8759
+ * Use when implementing low-level `EncodingError`-compatible values that need
8760
+ * to carry the runtime marker.
8761
+ *
8762
+ * **Details**
8763
+ *
8764
+ * This marker is part of the runtime representation of `EncodingError`. Prefer
8765
+ * `isEncodingError` when narrowing unknown values.
8766
+ *
8767
+ * @see {@link isEncodingError} for the public guard that checks this marker
8768
+ *
8769
+ * @stability stable
8770
+ * @category type IDs
8771
+ * @since 4.0.0
8772
+ */
8773
+ const EncodingErrorTypeId = "~effect/encoding/EncodingError";
8774
+ /**
8775
+ * Error returned when an encoding or decoding operation cannot process its input.
8776
+ *
8777
+ * **When to use**
8778
+ *
8779
+ * Use when you need to handle or inspect failures from encoding or decoding
8780
+ * operations.
8781
+ *
8782
+ * **Details**
8783
+ *
8784
+ * The error records whether the failure happened during encoding or decoding,
8785
+ * which encoding module reported it, the original input, and a human-readable
8786
+ * message.
8787
+ *
8788
+ * @see {@link isEncodingError} for checking whether a value is an EncodingError
8789
+ *
8790
+ * @stability stable
8791
+ * @category errors
8792
+ * @since 4.0.0
8793
+ */
8794
+ var EncodingError = class extends (/*#__PURE__*/ TaggedError("EncodingError")) {
8795
+ /**
8796
+ * Marks this value as an encoding or decoding error for runtime guards.
8797
+ *
8798
+ * **When to use**
8799
+ *
8800
+ * Use to identify `EncodingError` instances through `isEncodingError`.
8801
+ *
8802
+ * @since 4.0.0
8803
+ */
8804
+ [EncodingErrorTypeId] = EncodingErrorTypeId;
8805
+ };
8806
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/encoding/Hex.js
8807
+ /**
8808
+ * Hexadecimal encoding, decoding, and random value helpers.
8809
+ *
8810
+ * @stability stable
8811
+ * @since 4.0.0
8812
+ */
8313
8813
  /**
8314
8814
  * Encodes the given value into a hex `string`.
8315
8815
  *
@@ -8347,8 +8847,9 @@ const encode = (input) => typeof input === "string" ? hexEncodeUint8Array(encode
8347
8847
  * coercion rules.
8348
8848
  *
8349
8849
  * This function uses `Math.random()` and is not cryptographically secure. For
8350
- * security-sensitive values, use the `Crypto.Crypto` service's `randomBytes`
8351
- * method and encode the result with {@link encode}.
8850
+ * security-sensitive values, draw bytes with the `randomBytes` method of the
8851
+ * `SecureRandom` service from `effect/crypto/SecureRandom`, and encode them with
8852
+ * {@link encode}.
8352
8853
  *
8353
8854
  * @stability stable
8354
8855
  * @category encoding
@@ -8383,6 +8884,58 @@ const random32 = () => {
8383
8884
  const d = randomWord();
8384
8885
  return String.fromCharCode(hexCharCodes[a >>> 28], hexCharCodes[a >>> 24 & 15], hexCharCodes[a >>> 20 & 15], hexCharCodes[a >>> 16 & 15], hexCharCodes[a >>> 12 & 15], hexCharCodes[a >>> 8 & 15], hexCharCodes[a >>> 4 & 15], hexCharCodes[a & 15], hexCharCodes[b >>> 28], hexCharCodes[b >>> 24 & 15], hexCharCodes[b >>> 20 & 15], hexCharCodes[b >>> 16 & 15], hexCharCodes[b >>> 12 & 15], hexCharCodes[b >>> 8 & 15], hexCharCodes[b >>> 4 & 15], hexCharCodes[b & 15], hexCharCodes[c >>> 28], hexCharCodes[c >>> 24 & 15], hexCharCodes[c >>> 20 & 15], hexCharCodes[c >>> 16 & 15], hexCharCodes[c >>> 12 & 15], hexCharCodes[c >>> 8 & 15], hexCharCodes[c >>> 4 & 15], hexCharCodes[c & 15], hexCharCodes[d >>> 28], hexCharCodes[d >>> 24 & 15], hexCharCodes[d >>> 20 & 15], hexCharCodes[d >>> 16 & 15], hexCharCodes[d >>> 12 & 15], hexCharCodes[d >>> 8 & 15], hexCharCodes[d >>> 4 & 15], hexCharCodes[d & 15]);
8385
8886
  };
8887
+ /**
8888
+ * Decodes a hexadecimal string into bytes safely.
8889
+ *
8890
+ * **When to use**
8891
+ *
8892
+ * Use to decode hexadecimal text into bytes without throwing on invalid input.
8893
+ *
8894
+ * **Details**
8895
+ *
8896
+ * Returns `Result.succeed` with a `Uint8Array` when decoding succeeds, or
8897
+ * `Result.fail` with an `EncodingError` when the input has an odd length or
8898
+ * contains invalid hex characters.
8899
+ *
8900
+ * **Example** (Decoding hex bytes)
8901
+ *
8902
+ * ```ts import.meta.vitest
8903
+ * import { Result } from "effect"
8904
+ * import { Hex } from "effect/encoding"
8905
+ *
8906
+ * Hex.decode("48656c6c6f") // => Result.succeed(new Uint8Array([72, 101, 108, 108, 111]))
8907
+ * ```
8908
+ *
8909
+ * @stability stable
8910
+ * @category decoding
8911
+ * @since 4.0.0
8912
+ */
8913
+ const decode = (str) => {
8914
+ const bytes = new TextEncoder().encode(str);
8915
+ if (bytes.length % 2 !== 0) return fail$5(new EncodingError({
8916
+ module: "Hex",
8917
+ kind: "Decode",
8918
+ input: str,
8919
+ message: `Length must be a multiple of 2, but is ${bytes.length}`
8920
+ }));
8921
+ try {
8922
+ const length = bytes.length / 2;
8923
+ const result = new Uint8Array(length);
8924
+ for (let i = 0; i < length; i++) {
8925
+ const a = fromHexChar(bytes[i * 2]);
8926
+ const b = fromHexChar(bytes[i * 2 + 1]);
8927
+ result[i] = a << 4 | b;
8928
+ }
8929
+ return succeed$5(result);
8930
+ } catch (e) {
8931
+ return fail$5(new EncodingError({
8932
+ module: "Hex",
8933
+ kind: "Decode",
8934
+ input: str,
8935
+ message: e instanceof Error ? e.message : "Invalid input"
8936
+ }));
8937
+ }
8938
+ };
8386
8939
  const encoder = /*#__PURE__*/ new TextEncoder();
8387
8940
  const byteToHex = /*#__PURE__*/ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
8388
8941
  const hexEncodeUint8Array = (bytes) => {
@@ -8390,7 +8943,13 @@ const hexEncodeUint8Array = (bytes) => {
8390
8943
  for (let i = 0; i < bytes.length; i++) result += byteToHex[bytes[i]];
8391
8944
  return result;
8392
8945
  };
8393
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Tracer.js
8946
+ const fromHexChar = (byte) => {
8947
+ if (48 <= byte && byte <= 57) return byte - 48;
8948
+ if (97 <= byte && byte <= 102) return byte - 97 + 10;
8949
+ if (65 <= byte && byte <= 70) return byte - 65 + 10;
8950
+ throw new TypeError("Invalid input");
8951
+ };
8952
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Tracer.js
8394
8953
  /**
8395
8954
  * Defines the low-level tracing model used by Effect.
8396
8955
  *
@@ -8661,7 +9220,8 @@ const nativeTracer = /*#__PURE__*/ make$3({ span: (options) => new NativeSpan(op
8661
9220
  * identifiers, the attribute map, and the event list are created lazily on
8662
9221
  * first access, so spans that are never inspected allocate as little as
8663
9222
  * possible. Attributes, events, links, and status are mutated through `Span`
8664
- * methods.
9223
+ * methods. Once the span has ended, those methods do nothing, so a second `end`
9224
+ * keeps the original end time and exit.
8665
9225
  *
8666
9226
  * @see {@link Span} for the interface implemented by native spans
8667
9227
  *
@@ -8709,6 +9269,7 @@ var NativeSpan = class {
8709
9269
  return this._events ??= [];
8710
9270
  }
8711
9271
  end(endTime, exit) {
9272
+ if (this.status._tag === "Ended") return;
8712
9273
  this.status = {
8713
9274
  _tag: "Ended",
8714
9275
  endTime,
@@ -8717,9 +9278,11 @@ var NativeSpan = class {
8717
9278
  };
8718
9279
  }
8719
9280
  attribute(key, value) {
9281
+ if (this.status._tag === "Ended") return;
8720
9282
  this.attributes.set(key, value);
8721
9283
  }
8722
9284
  event(name, startTime, attributes) {
9285
+ if (this.status._tag === "Ended") return;
8723
9286
  this.events.push([
8724
9287
  name,
8725
9288
  startTime,
@@ -8727,13 +9290,14 @@ var NativeSpan = class {
8727
9290
  ]);
8728
9291
  }
8729
9292
  addLinks(links) {
9293
+ if (this.status._tag === "Ended") return;
8730
9294
  this.links.push(...links);
8731
9295
  }
8732
9296
  };
8733
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/metric.js
9297
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/metric.js
8734
9298
  /** @internal */
8735
9299
  const FiberRuntimeMetricsKey = "effect/Metric/FiberRuntimeMetrics";
8736
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/references.js
9300
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/references.js
8737
9301
  /** @internal */
8738
9302
  const CurrentErrorReporters = /*#__PURE__*/ Reference("effect/ErrorReporter/CurrentErrorReporters", { defaultValue: () => /* @__PURE__ */ new Set() });
8739
9303
  /** @internal */
@@ -8765,10 +9329,10 @@ const MinimumLogLevel$1 = /*#__PURE__*/ Reference("effect/References/MinimumLogL
8765
9329
  defaultValue: () => "Info"
8766
9330
  });
8767
9331
  /** @internal */
8768
- const UnhandledLogLevel$1 = /*#__PURE__*/ Reference("effect/References/UnhandledLogLevel", { defaultValue: () => "Error" });
9332
+ const UnhandledLogLevel = /*#__PURE__*/ Reference("effect/References/UnhandledLogLevel", { defaultValue: () => "Error" });
8769
9333
  /** @internal */
8770
9334
  const CurrentLogSpans$1 = /*#__PURE__*/ Reference("effect/References/CurrentLogSpans", { defaultValue: () => [] });
8771
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/tracer.js
9335
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/tracer.js
8772
9336
  /** @internal */
8773
9337
  const addSpanStackTrace = (options) => {
8774
9338
  if (options?.captureStackTrace === false) return options;
@@ -8801,7 +9365,7 @@ const makeStackCleaner = (line) => (stack) => {
8801
9365
  };
8802
9366
  };
8803
9367
  const spanCleaner = /*#__PURE__*/ makeStackCleaner(3);
8804
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/effect.js
9368
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/effect.js
8805
9369
  /** @internal */
8806
9370
  var Interrupt = class extends ReasonBase {
8807
9371
  constructor(fiberId, annotations = constEmptyAnnotations) {
@@ -8821,7 +9385,7 @@ var Interrupt = class extends ReasonBase {
8821
9385
  return isInterruptReason$1(that) && this.fiberId === that.fiberId && this.annotations === that.annotations;
8822
9386
  }
8823
9387
  [symbol$1]() {
8824
- return combine$1(string(`${this._tag}:${this.fiberId}`))(random$1(this.annotations));
9388
+ return string(`${this._tag}:${this.fiberId}`);
8825
9389
  }
8826
9390
  };
8827
9391
  /** @internal */
@@ -8847,6 +9411,21 @@ const findError$1 = (self) => {
8847
9411
  const findErrorOption$2 = /*#__PURE__*/ toOption(findError$1);
8848
9412
  /** @internal */
8849
9413
  const hasDies$1 = (self) => self.reasons.some(isDieReason$1);
9414
+ /**
9415
+ * Defects take precedence over typed failures when causes are combined: if
9416
+ * the cause contains a `Die`, every `Fail` becomes a `Die`. `Done` signals
9417
+ * stay typed so pulls still complete.
9418
+ *
9419
+ * @internal
9420
+ */
9421
+ const causeElectDefects = (self) => hasDies$1(self) && hasFails$1(self) ? causeFromReasons(self.reasons.map((reason) => reason._tag === "Fail" && !isDone$2(reason.error) ? new Die(reason.error, reason.annotations) : reason)) : self;
9422
+ /**
9423
+ * Selects the first typed error unless a defect is present, in which case
9424
+ * every `Fail` is elected to `Die`. Interrupts do not block typed recovery.
9425
+ *
9426
+ * @internal
9427
+ */
9428
+ const findRecoverableError = (self) => hasDies$1(self) ? fail$5(causeElectDefects(self)) : findError$1(self);
8850
9429
  /** @internal */
8851
9430
  const findDefect = (self) => {
8852
9431
  const reason = self.reasons.find(isDieReason$1);
@@ -8928,11 +9507,13 @@ const causePrettyErrors = (self, options) => {
8928
9507
  return errors;
8929
9508
  };
8930
9509
  /** @internal */
8931
- const causePrettyError = (original, annotations, options) => {
9510
+ const causePrettyError = (original, annotations, options, seen = /* @__PURE__ */ new Set()) => {
8932
9511
  const kind = typeof original;
8933
9512
  let error;
8934
9513
  if (original && kind === "object") {
8935
- error = new globalThis.Error(causePrettyMessage(original), { cause: original.cause ? causePrettyError(original.cause) : void 0 });
9514
+ seen.add(original);
9515
+ const cause = original.cause;
9516
+ error = new globalThis.Error(causePrettyMessage(original), { cause: cause !== void 0 && !seen.has(cause) ? causePrettyError(cause, void 0, void 0, seen) : void 0 });
8936
9517
  if (typeof original.name === "string") error.name = original.name;
8937
9518
  if (typeof original.stack === "string") error.stack = cleanErrorStack(original.stack, error, annotations);
8938
9519
  else {
@@ -9075,7 +9656,7 @@ var FiberImpl = class {
9075
9656
  let cause = causeInterrupt(fiberId);
9076
9657
  if (this.cache.stackFrame) cause = causeAnnotate(cause, make$5(StackTraceKey, this.cache.stackFrame));
9077
9658
  if (annotations) cause = causeAnnotate(cause, annotations);
9078
- this._interruptedCause = this._interruptedCause ? causeCombine(this._interruptedCause, cause) : cause;
9659
+ this._interruptedCause = this._interruptedCause ? causeAddInterrupts(this._interruptedCause, cause) : cause;
9079
9660
  if (this.interruptible) {
9080
9661
  if (this._running) this._deferredInterrupt = true;
9081
9662
  else this.evaluate(failCause$3(this._interruptedCause));
@@ -9089,7 +9670,11 @@ var FiberImpl = class {
9089
9670
  else if (this._asyncContext !== void 0) {
9090
9671
  const asyncContext = this._asyncContext;
9091
9672
  this._asyncContext = void 0;
9092
- return asyncContext.runInAsyncScope(this.evaluate, this, effect);
9673
+ try {
9674
+ return asyncContext.runInAsyncScope(this.evaluate, this, effect);
9675
+ } finally {
9676
+ asyncContext.emitDestroy();
9677
+ }
9093
9678
  } else if (this._yielded !== void 0) {
9094
9679
  const yielded = this._yielded;
9095
9680
  this._yielded = void 0;
@@ -9116,6 +9701,12 @@ var FiberImpl = class {
9116
9701
  this._stack.length = 0;
9117
9702
  this._children = void 0;
9118
9703
  this.context = empty$2();
9704
+ const cache = this.cache;
9705
+ if (cache.span !== void 0 || cache.stackFrame !== void 0) this.cache = {
9706
+ ...cache,
9707
+ span: void 0,
9708
+ stackFrame: void 0
9709
+ };
9119
9710
  }
9120
9711
  runLoop(effect) {
9121
9712
  const prevFiber = globalThis[currentFiberTypeId];
@@ -9326,7 +9917,8 @@ const fail$4 = exitFail;
9326
9917
  const sync$2 = /*#__PURE__*/ makePrimitive({
9327
9918
  op: "Sync",
9328
9919
  [evaluate](fiber) {
9329
- const value = this[args]();
9920
+ const thunk = this[args];
9921
+ const value = thunk();
9330
9922
  const cont = fiber.getCont(contA);
9331
9923
  return cont ? cont[contA](value, fiber) : fiber.yieldWith(exitSucceed(value));
9332
9924
  }
@@ -9335,11 +9927,12 @@ const sync$2 = /*#__PURE__*/ makePrimitive({
9335
9927
  const suspend$2 = /*#__PURE__*/ makePrimitive({
9336
9928
  op: "Suspend",
9337
9929
  [evaluate](_fiber) {
9338
- return this[args]();
9930
+ const thunk = this[args];
9931
+ return thunk();
9339
9932
  }
9340
9933
  });
9341
9934
  /** @internal */
9342
- const fromOption$1 = /*#__PURE__*/ dual((args) => args.length >= 2 || isOption(args[0]), (option, onNone) => isNone(option) ? fail$4(onNone ? onNone() : new NoSuchElementError$1("Effect.fromOption: Option.none")) : succeed$4(option.value));
9935
+ const fromOption$1 = /*#__PURE__*/ dual((args) => args.length >= 2 || isOption(args[0]), (option, onNone) => isNone(option) ? onNone ? failSync$1(onNone) : fail$4(new NoSuchElementError$1("Effect.fromOption: Option.none")) : succeed$4(option.value));
9343
9936
  /** @internal */
9344
9937
  const fromResult$1 = /*#__PURE__*/ match$5({
9345
9938
  onFailure: fail$4,
@@ -9368,7 +9961,7 @@ const failCauseSync$1 = (evaluate) => suspend$2(() => failCause$3(evaluate()));
9368
9961
  /** @internal */
9369
9962
  const die$4 = (defect) => exitDie(defect);
9370
9963
  /** @internal */
9371
- const failSync = (error) => suspend$2(() => fail$4(error()));
9964
+ const failSync$1 = (error) => suspend$2(() => fail$4(error()));
9372
9965
  /** @internal */
9373
9966
  const void_$2 = /*#__PURE__*/ succeed$4(void 0);
9374
9967
  /** @internal */
@@ -9407,8 +10000,6 @@ const tryPromise$1 = (options) => {
9407
10000
  }, f.length !== 0);
9408
10001
  };
9409
10002
  /** @internal */
9410
- const withFiberId = (f) => withFiber$1((fiber) => f(fiber.id));
9411
- /** @internal */
9412
10003
  const fiber$1 = /*#__PURE__*/ withFiber$1(succeed$4);
9413
10004
  const callbackOptions = /*#__PURE__*/ function() {
9414
10005
  const Proto = /*#__PURE__*/ makePrimitiveProto({
@@ -9425,9 +10016,9 @@ const callbackOptions = /*#__PURE__*/ function() {
9425
10016
  }, controller?.signal);
9426
10017
  if (yielded !== false) return yielded;
9427
10018
  yielded = true;
9428
- fiber._yielded = () => {
10019
+ fiber.yieldWith(() => {
9429
10020
  resumed = true;
9430
- };
10021
+ });
9431
10022
  if (controller === void 0 && onCancel === void 0) return Yield;
9432
10023
  fiber._stack.push(asyncFinalizer(() => {
9433
10024
  resumed = true;
@@ -9471,8 +10062,10 @@ const gen$1 = (...args) => {
9471
10062
  const [options, body] = args;
9472
10063
  return suspend$2(() => fromIteratorUnsafe(body.call(options.self)));
9473
10064
  };
10065
+ const fnBody = (bodyOrOptions, pipeables) => typeof bodyOrOptions === "function" ? bodyOrOptions : pipeables.shift().bind(bodyOrOptions.self);
9474
10066
  /** @internal */
9475
- const fnUntraced$1 = (body, ...pipeables) => {
10067
+ const fnUntraced$1 = (bodyOrOptions, ...pipeables) => {
10068
+ const body = fnBody(bodyOrOptions, pipeables);
9476
10069
  const fn = pipeables.length === 0 ? function() {
9477
10070
  return suspend$2(() => fromIteratorUnsafe(body.apply(this, arguments)));
9478
10071
  } : function() {
@@ -9503,9 +10096,18 @@ const fn$1 = function() {
9503
10096
  return makeFn(name, arguments[0], defError, Array.prototype.slice.call(arguments, 1), nameFirst, spanOptions);
9504
10097
  };
9505
10098
  const makeFn = (name, bodyOrOptions, defError, pipeables, addSpan, spanOptions) => {
9506
- const body = typeof bodyOrOptions === "function" ? bodyOrOptions : pipeables.shift().bind(bodyOrOptions.self);
10099
+ const body = fnBody(bodyOrOptions, pipeables);
9507
10100
  const definitionName = `${name} (definition)`;
9508
10101
  const definitionStack = defError ? fnStackCleaner(() => defError.stack) : constUndefined;
10102
+ const makeCallFrame = (callError) => (prev) => ({
10103
+ name,
10104
+ stack: callError ? fnStackCleaner(() => callError.stack) : constUndefined,
10105
+ parent: {
10106
+ name: definitionName,
10107
+ stack: definitionStack,
10108
+ parent: prev
10109
+ }
10110
+ });
9509
10111
  return defineFunctionLength(body.length, function(...args) {
9510
10112
  let result = suspend$2(() => {
9511
10113
  const iter = body.apply(this, arguments);
@@ -9520,25 +10122,20 @@ const makeFn = (name, bodyOrOptions, defError, pipeables, addSpan, spanOptions)
9520
10122
  callError = new globalThis.Error();
9521
10123
  setStackTraceLimit(prevLimit);
9522
10124
  }
9523
- return updateService(addSpan ? useSpan$1(name, spanOptions, (span) => provideParentSpan(result, span)) : result, CurrentStackFrame$1, (prev) => ({
9524
- name,
9525
- stack: callError ? fnStackCleaner(() => callError.stack) : constUndefined,
9526
- parent: {
9527
- name: definitionName,
9528
- stack: definitionStack,
9529
- parent: prev
9530
- }
9531
- }));
10125
+ return updateService(addSpan ? useSpan$1(name, spanOptions, (span) => provideParentSpan(result, span)) : result, CurrentStackFrame$1, makeCallFrame(callError));
9532
10126
  });
9533
10127
  };
9534
10128
  /** @internal */
9535
- const fnUntracedEager$1 = (body, ...pipeables) => defineFunctionLength(body.length, pipeables.length === 0 ? function() {
9536
- return fromIteratorEagerUnsafe(() => body.apply(this, arguments));
9537
- } : function() {
9538
- let effect = fromIteratorEagerUnsafe(() => body.apply(this, arguments));
9539
- for (const pipeable of pipeables) effect = pipeable(effect, ...arguments);
9540
- return effect;
9541
- });
10129
+ const fnUntracedEager$1 = (bodyOrOptions, ...pipeables) => {
10130
+ const body = fnBody(bodyOrOptions, pipeables);
10131
+ return defineFunctionLength(body.length, pipeables.length === 0 ? function() {
10132
+ return fromIteratorEagerUnsafe(() => body.apply(this, arguments));
10133
+ } : function() {
10134
+ let effect = fromIteratorEagerUnsafe(() => body.apply(this, arguments));
10135
+ for (const pipeable of pipeables) effect = pipeable(effect, ...arguments);
10136
+ return effect;
10137
+ });
10138
+ };
9542
10139
  const fromIteratorEagerUnsafe = (evaluate) => {
9543
10140
  try {
9544
10141
  const iterator = evaluate();
@@ -9664,7 +10261,7 @@ const raceAll = (all, options) => withFiber$1((parent) => {
9664
10261
  doneCount++;
9665
10262
  if (exit._tag === "Failure") {
9666
10263
  failures.push(...exit.cause.reasons);
9667
- if (doneCount >= len) resume(failCause$3(causeFromReasons(failures)));
10264
+ if (doneCount >= len) resume(failCause$3(causeElectDefects(causeFromReasons(failures))));
9668
10265
  return;
9669
10266
  }
9670
10267
  const isWinner = !done;
@@ -9740,13 +10337,13 @@ const mapEager$1 = /*#__PURE__*/ dual(2, (self, f) => effectIsExit(self) ? exitM
9740
10337
  /** @internal */
9741
10338
  const mapErrorEager$1 = /*#__PURE__*/ dual(2, (self, f) => effectIsExit(self) ? exitMapError(self, f) : mapError$1(self, f));
9742
10339
  /** @internal */
9743
- const mapBothEager$1 = /*#__PURE__*/ dual(2, (self, options) => effectIsExit(self) ? exitMapBoth(self, options) : mapBoth(self, options));
10340
+ const mapBothEager$1 = /*#__PURE__*/ dual(2, (self, options) => effectIsExit(self) ? exitMapBoth(self, options) : mapBoth$1(self, options));
9744
10341
  /** @internal */
9745
10342
  const catchEager$1 = /*#__PURE__*/ dual(2, (self, f) => {
9746
10343
  if (effectIsExit(self)) {
9747
10344
  if (self._tag === "Success") return self;
9748
- const error = findError$1(self.cause);
9749
- if (isFailure$1(error)) return self;
10345
+ const error = findRecoverableError(self.cause);
10346
+ if (isFailure$1(error)) return exitFailCause(error.failure);
9750
10347
  return f(error.success);
9751
10348
  }
9752
10349
  return catch_$2(self, f);
@@ -9770,16 +10367,12 @@ const exitMap = /*#__PURE__*/ dual(2, (self, f) => self._tag === "Success" ? exi
9770
10367
  /** @internal */
9771
10368
  const exitMapError = /*#__PURE__*/ dual(2, (self, f) => {
9772
10369
  if (self._tag === "Success") return self;
9773
- const error = findError$1(self.cause);
9774
- if (isFailure$1(error)) return self;
9775
- return exitFail(f(error.success));
10370
+ return exitFailCause(causeMap(self.cause, f));
9776
10371
  });
9777
10372
  /** @internal */
9778
10373
  const exitMapBoth = /*#__PURE__*/ dual(2, (self, options) => {
9779
10374
  if (self._tag === "Success") return exitSucceed(options.onSuccess(self.value));
9780
- const error = findError$1(self.cause);
9781
- if (isFailure$1(error)) return self;
9782
- return exitFail(options.onFailure(error.success));
10375
+ return exitFailCause(causeMap(self.cause, options.onFailure));
9783
10376
  });
9784
10377
  /** @internal */
9785
10378
  const exitZipRight = /*#__PURE__*/ dual(2, (self, that) => exitIsSuccess(self) ? that : self);
@@ -9874,7 +10467,7 @@ const catchCauseFilter = /*#__PURE__*/ dual(3, (self, filter, f) => catchCause$1
9874
10467
  return isFailure$1(eb) ? failCause$3(eb.failure) : f(eb.success, cause);
9875
10468
  }));
9876
10469
  /** @internal */
9877
- const catch_$2 = /*#__PURE__*/ dual(2, (self, f) => catchCauseFilter(self, findError$1, (e) => f(e)));
10470
+ const catch_$2 = /*#__PURE__*/ dual(2, (self, f) => catchCauseFilter(self, findRecoverableError, (e) => f(e)));
9878
10471
  /** @internal */
9879
10472
  const catchDefect$1 = /*#__PURE__*/ dual(2, (self, f) => catchCauseFilter(self, findDefect, f));
9880
10473
  /** @internal */
@@ -9896,14 +10489,14 @@ const tapErrorTag$1 = /*#__PURE__*/ dual(3, (self, k, f) => {
9896
10489
  const tapDefect$1 = /*#__PURE__*/ dual(2, (self, f) => tapCauseFilter(self, findDefect, (_) => f(_)));
9897
10490
  /** @internal */
9898
10491
  const catchIf$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, predicate, f, orElse) => catchCause$1(self, (cause) => {
9899
- const error = findError$1(cause);
10492
+ const error = findRecoverableError(cause);
9900
10493
  if (isFailure$1(error)) return failCause$3(error.failure);
9901
10494
  if (!predicate(error.success)) return orElse ? orElse(error.success) : failCause$3(cause);
9902
10495
  return f(error.success);
9903
10496
  }));
9904
10497
  /** @internal */
9905
10498
  const catchFilter$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, filter, f, orElse) => catchCause$1(self, (cause) => {
9906
- const error = findError$1(cause);
10499
+ const error = findRecoverableError(cause);
9907
10500
  if (isFailure$1(error)) return failCause$3(error.failure);
9908
10501
  const result = filter(error.success);
9909
10502
  if (isFailure$1(result)) return orElse ? orElse(result.failure) : failCause$3(cause);
@@ -9929,10 +10522,10 @@ const catchReason$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, e
9929
10522
  return orElse ? orElse(reason, e) : fail$4(e);
9930
10523
  }));
9931
10524
  /** @internal */
9932
- const mapError$1 = /*#__PURE__*/ dual(2, (self, f) => catch_$2(self, (error) => failSync(() => f(error))));
10525
+ const mapError$1 = /*#__PURE__*/ dual(2, (self, f) => catchCause$1(self, (cause) => failCause$3(causeMap(cause, f))));
9933
10526
  /** @internal */
9934
- const mapBoth = /*#__PURE__*/ dual(2, (self, options) => matchEffect$2(self, {
9935
- onFailure: (e) => failSync(() => options.onFailure(e)),
10527
+ const mapBoth$1 = /*#__PURE__*/ dual(2, (self, options) => matchCauseEffect$1(self, {
10528
+ onFailure: (cause) => failCause$3(causeMap(cause, options.onFailure)),
9936
10529
  onSuccess: (a) => sync$2(() => options.onSuccess(a))
9937
10530
  }));
9938
10531
  /** @internal */
@@ -9952,16 +10545,21 @@ const firstSuccessOf$1 = (effects) => suspend$2(() => {
9952
10545
  return loop(state);
9953
10546
  });
9954
10547
  /** @internal */
10548
+ const ignoreCauseLogger = (log) => log === "Unhandled" ? (...message) => withFiber$1((fiber) => {
10549
+ const level = fiber.getRef(UnhandledLogLevel);
10550
+ return level === void 0 ? void_$2 : logWithLevel(level)(...message);
10551
+ }) : logWithLevel(log === true ? void 0 : log);
10552
+ /** @internal */
9955
10553
  const ignore$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, options) => {
9956
10554
  if (!options?.log) return matchEffect$2(self, {
9957
10555
  onFailure: (_) => void_$2,
9958
10556
  onSuccess: (_) => void_$2
9959
10557
  });
9960
- const logEffect = logWithLevel$1(options.log === true ? void 0 : options.log);
10558
+ const logEffect = ignoreCauseLogger(options.log);
9961
10559
  return matchCauseEffect$1(self, {
9962
10560
  onFailure(cause) {
9963
- const failure = findFail$1(cause);
9964
- return isFailure$1(failure) ? failCause$3(failure.failure) : options.message === void 0 ? logEffect(cause) : logEffect(options.message, cause);
10561
+ const error = findRecoverableError(cause);
10562
+ return isFailure$1(error) ? failCause$3(error.failure) : options.message === void 0 ? logEffect(cause) : logEffect(options.message, cause);
9965
10563
  },
9966
10564
  onSuccess: (_) => void_$2
9967
10565
  });
@@ -9972,7 +10570,7 @@ const ignoreCause$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, o
9972
10570
  onFailure: (_) => void_$2,
9973
10571
  onSuccess: (_) => void_$2
9974
10572
  });
9975
- const logEffect = logWithLevel$1(options.log === true ? void 0 : options.log);
10573
+ const logEffect = ignoreCauseLogger(options.log);
9976
10574
  return matchCauseEffect$1(self, {
9977
10575
  onFailure: (cause) => options.message === void 0 ? logEffect(cause) : logEffect(options.message, cause),
9978
10576
  onSuccess: (_) => void_$2
@@ -10019,16 +10617,16 @@ const makeMatch = (op, onFailure) => {
10019
10617
  return MatchImpl;
10020
10618
  };
10021
10619
  const MatchImpl = /*#__PURE__*/ makeMatch("Match", function(cause, fiber) {
10022
- const fail = cause.reasons.find(isFailReason$1);
10023
- if (fail === void 0) return failCause$3(cause);
10620
+ const error = findRecoverableError(cause);
10621
+ if (isFailure$1(error)) return failCause$3(error.failure);
10024
10622
  const handlers = this.payload;
10025
- return fiber.succeedWith(continuationMarksStack ? handlers.onFailure(fail.error) : internalCall(() => handlers.onFailure(fail.error)));
10623
+ return fiber.succeedWith(continuationMarksStack ? handlers.onFailure(error.success) : internalCall(() => handlers.onFailure(error.success)));
10026
10624
  });
10027
10625
  /** @internal */
10028
10626
  const matchEffect$2 = /*#__PURE__*/ dual(2, (self, options) => matchCauseEffect$1(self, {
10029
10627
  onFailure: (cause) => {
10030
- const fail = cause.reasons.find(isFailReason$1);
10031
- return fail ? options.onFailure(fail.error) : failCause$3(cause);
10628
+ const error = findRecoverableError(cause);
10629
+ return isFailure$1(error) ? failCause$3(error.failure) : options.onFailure(error.success);
10032
10630
  },
10033
10631
  onSuccess: options.onSuccess
10034
10632
  }));
@@ -10038,8 +10636,8 @@ const match$2 = /*#__PURE__*/ dual(2, (self, options) => new MatchImpl(self, opt
10038
10636
  const matchEager = /*#__PURE__*/ dual(2, (self, options) => {
10039
10637
  if (effectIsExit(self)) {
10040
10638
  if (self._tag === "Success") return exitSucceed(options.onSuccess(self.value));
10041
- const error = findError$1(self.cause);
10042
- if (isFailure$1(error)) return self;
10639
+ const error = findRecoverableError(self.cause);
10640
+ if (isFailure$1(error)) return exitFailCause(error.failure);
10043
10641
  return exitSucceed(options.onFailure(error.success));
10044
10642
  }
10045
10643
  return match$2(self, options);
@@ -10113,16 +10711,16 @@ const runFinalizer = (finalizer, exit_) => {
10113
10711
  return exitDie(defect);
10114
10712
  }
10115
10713
  };
10116
- const combineFinalizerCause = (exit_, finalizer) => exitIsSuccess(exit_) ? finalizer : catchCause$1(finalizer, (cause) => failCause$3(causeCombine(exit_.cause, cause)));
10714
+ const combineFinalizerCause = (exit_, finalizer) => exitIsSuccess(exit_) ? finalizer : catchCause$1(finalizer, (cause) => failCause$3(causeElectDefects(causeCombine(exit_.cause, cause))));
10117
10715
  const scopeCloseFinalizers = /*#__PURE__*/ fnUntraced$1(function* (self, finalizers, exit_) {
10118
10716
  let exits = [];
10119
10717
  const fibers = [];
10120
- const arr = Array.from(finalizers.values());
10718
+ const arr = Array.from(finalizers);
10121
10719
  const parent = getCurrentFiber();
10122
10720
  for (let i = arr.length - 1; i >= 0; i--) {
10123
- const finalizer = arr[i];
10721
+ const [key, finalizer] = arr[i];
10124
10722
  if (self.strategy === "sequential") exits.push(yield* exit$1(runFinalizer(finalizer, exit_)));
10125
- else fibers.push(forkUnsafe$1(parent, runFinalizer(finalizer, exit_), true, true, "inherit"));
10723
+ else if (key !== parent) fibers.push(forkUnsafe$1(parent, runFinalizer(finalizer, exit_), true, true, "inherit"));
10126
10724
  }
10127
10725
  if (fibers.length > 0) exits = yield* fiberAwaitAll(fibers);
10128
10726
  return yield* exitAsVoidAll(exits);
@@ -10295,8 +10893,8 @@ const makeCachedUnsafe = (self, ttlMillis) => {
10295
10893
  const join = (fiber, run) => {
10296
10894
  run.awaiters++;
10297
10895
  onExitUnsafe(fiber, () => {
10298
- if (--run.awaiters > 0 || current !== run) return;
10299
- current = void 0;
10896
+ if (--run.awaiters > 0 || run.done) return;
10897
+ if (current === run) current = void 0;
10300
10898
  return fiberInterrupt(run.fiber);
10301
10899
  });
10302
10900
  return fiberJoin(run.fiber);
@@ -10308,11 +10906,13 @@ const makeCachedUnsafe = (self, ttlMillis) => {
10308
10906
  const clock = fiber.getRef(ClockRef);
10309
10907
  const run = {
10310
10908
  fiber: new FiberImpl(fiber.context),
10311
- awaiters: 0
10909
+ awaiters: 0,
10910
+ done: false
10312
10911
  };
10313
10912
  current = run;
10314
10913
  const joined = join(fiber, run);
10315
10914
  run.fiber.evaluate(onExitPrimitive$1(self, (exit_) => {
10915
+ run.done = true;
10316
10916
  if (current !== run) return;
10317
10917
  current = void 0;
10318
10918
  if (exitHasInterrupts(exit_)) return;
@@ -10322,6 +10922,7 @@ const makeCachedUnsafe = (self, ttlMillis) => {
10322
10922
  }));
10323
10923
  return run.fiber._exit ?? joined;
10324
10924
  }), sync$2(() => {
10925
+ current = void 0;
10325
10926
  exit = void 0;
10326
10927
  })];
10327
10928
  };
@@ -10390,15 +10991,7 @@ const uninterruptibleMask$1 = (f) => withFiber$1((fiber) => {
10390
10991
  const all$1 = (arg, options) => {
10391
10992
  if (isIterable(arg)) return options?.mode === "result" ? forEach$1(arg, result$1, options) : forEach$1(arg, identity, options);
10392
10993
  else if (options?.discard) return options.mode === "result" ? forEach$1(Object.values(arg), result$1, options) : forEach$1(Object.values(arg), identity, options);
10393
- return suspend$2(() => {
10394
- const out = {};
10395
- return as$1(forEach$1(Object.entries(arg), ([key, effect]) => map$2(options?.mode === "result" ? result$1(effect) : effect, (value) => {
10396
- assignProperty(out, key, value);
10397
- }), {
10398
- discard: true,
10399
- concurrency: options?.concurrency
10400
- }), out);
10401
- });
10994
+ return suspend$2(() => map$2(forEach$1(Object.entries(arg), ([key, effect]) => map$2(options?.mode === "result" ? result$1(effect) : effect, (value) => [key, value]), { concurrency: options?.concurrency }), Object.fromEntries));
10402
10995
  };
10403
10996
  /** @internal */
10404
10997
  const partition$1 = /*#__PURE__*/ dual((args) => isIterable(args[0]) && !isEffect$1(args[0]), (elements, f, options) => map$2(forEach$1(elements, (a, i) => result$1(f(a, i)), options), (results) => partition$2(results, identity)));
@@ -10542,7 +11135,7 @@ const iterateConcurrentImpl = (options) => {
10542
11135
  const reasons = exit.cause.reasons.filter((reason) => reason._tag !== "Interrupt");
10543
11136
  if (reasons.length > 0) {
10544
11137
  const cause = causeFromReasons(reasons);
10545
- terminal = exitFailCause(terminal._tag === "Failure" ? causeCombine(terminal.cause, cause) : cause);
11138
+ terminal = exitFailCause(terminal._tag === "Failure" ? causeElectDefects(causeCombine(terminal.cause, cause)) : cause);
10546
11139
  }
10547
11140
  }
10548
11141
  } else {
@@ -10603,22 +11196,11 @@ const filterMapOrElse = /*#__PURE__*/ dual(3, (self, filter, orElse) => flatMap$
10603
11196
  /** @internal */
10604
11197
  const filterMapOrFail$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, filter, orFailWith) => filterMapOrElse(self, filter, orFailWith ? (x) => fail$4(orFailWith(x)) : () => fail$4(new NoSuchElementError$1())));
10605
11198
  /** @internal */
10606
- const filter$1 = /*#__PURE__*/ dual((args) => isIterable(args[0]) && !isEffect$1(args[0]), (elements, predicate, options) => suspend$2(() => {
10607
- const out = [];
10608
- return as$1(forEach$1(elements, (a, i) => {
10609
- const result = predicate(a, i);
10610
- if (typeof result === "boolean") {
10611
- if (result) out.push(a);
10612
- return void_$2;
10613
- }
10614
- return map$2(result, (keep) => {
10615
- if (keep) out.push(a);
10616
- });
10617
- }, {
10618
- discard: true,
10619
- concurrency: options?.concurrency
10620
- }), out);
10621
- }));
11199
+ const filter$1 = /*#__PURE__*/ dual((args) => isIterable(args[0]) && !isEffect$1(args[0]), (elements, predicate, options) => map$2(forEach$1(elements, (a, i) => {
11200
+ const result = predicate(a, i);
11201
+ if (typeof result === "boolean") return succeed$4(result ? some(a) : none());
11202
+ return map$2(result, (keep) => keep ? some(a) : none());
11203
+ }, options), getSomes));
10622
11204
  /** @internal */
10623
11205
  const filterMapEffect$1 = /*#__PURE__*/ dual((args) => isIterable(args[0]) && !isEffect$1(args[0]), (elements, filter, options) => suspend$2(() => {
10624
11206
  const out = [];
@@ -10652,15 +11234,14 @@ const forkUnsafe$1 = (parent, effect, immediate = false, daemon = false, uninter
10652
11234
  };
10653
11235
  /** @internal */
10654
11236
  const forkDetach$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, options) => withFiber$1((fiber) => succeed$4(forkUnsafe$1(fiber, self, options?.startImmediately, true, options?.uninterruptible))));
11237
+ const fiberScopeFinalizer = (fiber) => () => withFiber$1((current) => current === fiber ? void_$2 : fiberInterrupt(fiber));
10655
11238
  /** @internal */
10656
11239
  const forkIn$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, scope, options) => withFiber$1((parent) => {
10657
- const fiber = forkUnsafe$1(parent, self, options?.startImmediately, true, options?.uninterruptible);
11240
+ const fiber = scope.state._tag === "Closed" ? new FiberImpl(parent.context) : forkUnsafe$1(parent, self, options?.startImmediately, true, options?.uninterruptible);
10658
11241
  if (!fiber._exit) {
10659
11242
  if (scope.state._tag !== "Closed") {
10660
- const key = {};
10661
- const finalizer = () => withFiberId((interruptor) => interruptor === fiber.id ? void_$2 : fiberInterrupt(fiber));
10662
- scopeAddFinalizerUnsafe(scope, key, finalizer);
10663
- fiber.addObserver(() => scopeRemoveFinalizerUnsafe(scope, key));
11243
+ scopeAddFinalizerUnsafe(scope, fiber, fiberScopeFinalizer(fiber));
11244
+ fiber.addObserver(() => scopeRemoveFinalizerUnsafe(scope, fiber));
10664
11245
  } else fiber.interruptUnsafe(parent.id, fiberStackAnnotations(parent));
10665
11246
  }
10666
11247
  return succeed$4(fiber);
@@ -10691,7 +11272,7 @@ const fiberRunIn = /*#__PURE__*/ dual(2, (self, scope) => {
10691
11272
  return self;
10692
11273
  }
10693
11274
  scopeRemoveFinalizerUnsafe(scope, self);
10694
- scopeAddFinalizerUnsafe(scope, self, () => fiberInterrupt(self));
11275
+ scopeAddFinalizerUnsafe(scope, self, fiberScopeFinalizer(self));
10695
11276
  self.addObserver(() => scopeRemoveFinalizerUnsafe(scope, self));
10696
11277
  return self;
10697
11278
  });
@@ -10936,7 +11517,7 @@ const withSpan$1 = function() {
10936
11517
  /** @internal */
10937
11518
  const annotateCurrentSpan$1 = (...args) => withFiber$1((fiber) => {
10938
11519
  const span = fiber.currentSpanLocal;
10939
- if (span) {
11520
+ if (span && span.status._tag !== "Ended") {
10940
11521
  if (args.length === 1) for (const [key, value] of Object.entries(args[0])) span.attribute(key, value);
10941
11522
  else span.attribute(args[0], args[1]);
10942
11523
  }
@@ -11019,7 +11600,7 @@ const TimeoutErrorTypeId = "~effect/Cause/TimeoutError";
11019
11600
  /** @internal */
11020
11601
  const isTimeoutError$1 = (u) => hasProperty(u, TimeoutErrorTypeId);
11021
11602
  /** @internal */
11022
- var TimeoutError$1 = class extends (/*#__PURE__*/ TaggedError("TimeoutError")) {
11603
+ var TimeoutError$1 = class extends (/*#__PURE__*/ TaggedError$1("TimeoutError")) {
11023
11604
  [TimeoutErrorTypeId] = TimeoutErrorTypeId;
11024
11605
  constructor(message) {
11025
11606
  super({ message });
@@ -11028,7 +11609,7 @@ var TimeoutError$1 = class extends (/*#__PURE__*/ TaggedError("TimeoutError")) {
11028
11609
  /** @internal */
11029
11610
  const IllegalArgumentErrorTypeId = "~effect/Cause/IllegalArgumentError";
11030
11611
  /** @internal */
11031
- var IllegalArgumentError$1 = class extends (/*#__PURE__*/ TaggedError("IllegalArgumentError")) {
11612
+ var IllegalArgumentError$1 = class extends (/*#__PURE__*/ TaggedError$1("IllegalArgumentError")) {
11032
11613
  [IllegalArgumentErrorTypeId] = IllegalArgumentErrorTypeId;
11033
11614
  constructor(message) {
11034
11615
  super({ message });
@@ -11037,7 +11618,7 @@ var IllegalArgumentError$1 = class extends (/*#__PURE__*/ TaggedError("IllegalAr
11037
11618
  /** @internal */
11038
11619
  const ExceededCapacityErrorTypeId = "~effect/Cause/ExceededCapacityError";
11039
11620
  /** @internal */
11040
- var ExceededCapacityError$1 = class extends (/*#__PURE__*/ TaggedError("ExceededCapacityError")) {
11621
+ var ExceededCapacityError$1 = class extends (/*#__PURE__*/ TaggedError$1("ExceededCapacityError")) {
11041
11622
  [ExceededCapacityErrorTypeId] = ExceededCapacityErrorTypeId;
11042
11623
  constructor(message) {
11043
11624
  super({ message });
@@ -11046,7 +11627,7 @@ var ExceededCapacityError$1 = class extends (/*#__PURE__*/ TaggedError("Exceeded
11046
11627
  /** @internal */
11047
11628
  const AsyncFiberErrorTypeId = "~effect/Cause/AsyncFiberError";
11048
11629
  /** @internal */
11049
- var AsyncFiberError = class extends (/*#__PURE__*/ TaggedError("AsyncFiberError")) {
11630
+ var AsyncFiberError = class extends (/*#__PURE__*/ TaggedError$1("AsyncFiberError")) {
11050
11631
  [AsyncFiberErrorTypeId] = AsyncFiberErrorTypeId;
11051
11632
  constructor(fiber) {
11052
11633
  super({
@@ -11058,7 +11639,7 @@ var AsyncFiberError = class extends (/*#__PURE__*/ TaggedError("AsyncFiberError"
11058
11639
  /** @internal */
11059
11640
  const UnknownErrorTypeId = "~effect/Cause/UnknownError";
11060
11641
  /** @internal */
11061
- var UnknownError$1 = class extends (/*#__PURE__*/ TaggedError("UnknownError")) {
11642
+ var UnknownError$1 = class extends (/*#__PURE__*/ TaggedError$1("UnknownError")) {
11062
11643
  [UnknownErrorTypeId] = UnknownErrorTypeId;
11063
11644
  constructor(cause, message) {
11064
11645
  super({
@@ -11154,7 +11735,7 @@ const structuredMessage = (u) => {
11154
11735
  }
11155
11736
  };
11156
11737
  /** @internal */
11157
- const logWithLevel$1 = (level) => (...message) => {
11738
+ const logWithLevel = (level) => (...message) => {
11158
11739
  let cause = void 0;
11159
11740
  for (let i = 0, len = message.length; i < len; i++) {
11160
11741
  const msg = message[i];
@@ -11320,7 +11901,7 @@ const tracerLogger = /*#__PURE__*/ loggerMake(({ cause, fiber, logLevel, message
11320
11901
  const clock = fiber.getRef(ClockRef);
11321
11902
  const annotations = fiber.getRef(CurrentLogAnnotations$1);
11322
11903
  const span = fiber.cache.span;
11323
- if (span === void 0 || span._tag === "ExternalSpan") return;
11904
+ if (span === void 0 || span._tag === "ExternalSpan" || span.status._tag === "Ended") return;
11324
11905
  const attributes = {};
11325
11906
  for (const [key, value] of Object.entries(annotations)) assignProperty(attributes, key, value);
11326
11907
  attributes["effect.fiberId"] = fiber.id;
@@ -11351,7 +11932,7 @@ const reportCauseUnsafe = (fiber, cause, defectsOnly) => {
11351
11932
  };
11352
11933
  reporters.forEach((reporter) => reporter.report(opts));
11353
11934
  };
11354
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Cause.js
11935
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Cause.js
11355
11936
  /**
11356
11937
  * Records the full reason an `Effect` failed.
11357
11938
  *
@@ -12358,7 +12939,7 @@ const reasonAnnotations = reasonAnnotations$1;
12358
12939
  * @since 4.0.0
12359
12940
  */
12360
12941
  var StackTrace = class extends (/*#__PURE__*/ Service()("effect/Cause/StackTrace")) {};
12361
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Exit.js
12942
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Exit.js
12362
12943
  /**
12363
12944
  * Checks whether an unknown value is an Exit.
12364
12945
  *
@@ -12721,7 +13302,7 @@ const asVoidAll = exitAsVoidAll;
12721
13302
  * @since 4.0.0
12722
13303
  */
12723
13304
  const findErrorOption = exitFindErrorOption;
12724
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Deferred.js
13305
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Deferred.js
12725
13306
  const TypeId$4 = "~effect/Deferred";
12726
13307
  /**
12727
13308
  * Checks whether a value is a `Deferred`.
@@ -13168,7 +13749,7 @@ const doneUnsafe = (self, effect) => {
13168
13749
  * @since 4.0.0
13169
13750
  */
13170
13751
  const into = /*#__PURE__*/ dual(2, (self, deferred) => uninterruptibleMask$1((restore) => flatMap$2(exit$1(restore(self)), (exit) => done(deferred, exit))));
13171
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/References.js
13752
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/References.js
13172
13753
  /**
13173
13754
  * Context reference for managing log annotations that are automatically added to all log entries.
13174
13755
  * These annotations provide contextual metadata that appears in every log message.
@@ -13476,33 +14057,7 @@ const TracerEnabled = TracerEnabled$1;
13476
14057
  * @since 4.0.0
13477
14058
  */
13478
14059
  const TracerTimingEnabled = TracerTimingEnabled$1;
13479
- /**
13480
- * Context reference for the log severity used when a pool finalizer reports an
13481
- * unhandled error.
13482
- *
13483
- * **When to use**
13484
- *
13485
- * Use to choose whether and at which severity pool finalizer failures are
13486
- * reported.
13487
- *
13488
- * **Details**
13489
- *
13490
- * The default level is `"Error"`.
13491
- *
13492
- * **Gotchas**
13493
- *
13494
- * Providing `undefined` suppresses this report; it does not fall back to
13495
- * `CurrentLogLevel`.
13496
- *
13497
- * @see {@link CurrentLogLevel} for the default severity used by ordinary `Effect.log` calls
13498
- * @see {@link MinimumLogLevel} for filtering emitted log entries by threshold
13499
- *
13500
- * @stability stable
13501
- * @category references
13502
- * @since 4.0.0
13503
- */
13504
- const UnhandledLogLevel = UnhandledLogLevel$1;
13505
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Scope.js
14060
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Scope.js
13506
14061
  /**
13507
14062
  * Controls how long resources stay open.
13508
14063
  *
@@ -13791,6 +14346,11 @@ const forkUnsafe = scopeForkUnsafe;
13791
14346
  * By default, finalizers run uninterruptibly, so interrupting the closing fiber
13792
14347
  * waits for them to finish; a finalizer can explicitly restore interruptibility.
13793
14348
  *
14349
+ * **Gotchas**
14350
+ *
14351
+ * Closing a scope that is already closed returns immediately, even when the
14352
+ * finalizers of an earlier close are still running.
14353
+ *
13794
14354
  * **Example** (Running scope finalizers)
13795
14355
  *
13796
14356
  * ```ts import.meta.vitest
@@ -13842,7 +14402,7 @@ const close = scopeClose;
13842
14402
  * @since 4.0.0
13843
14403
  */
13844
14404
  const closeUnsafe = scopeCloseUnsafe;
13845
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Layer.js
14405
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Layer.js
13846
14406
  const TypeId$3 = "~effect/Layer";
13847
14407
  const MemoMapTypeId = "~effect/Layer/MemoMap";
13848
14408
  const makeMemoMapEntry = (memoMap, layer) => {
@@ -14634,7 +15194,7 @@ const mergeAllEffect = (layers, memoMap, scope) => {
14634
15194
  * @category zipping
14635
15195
  * @since 2.0.0
14636
15196
  */
14637
- const mergeAll = (...layers) => fromBuild((memoMap, scope) => mergeAllEffect(layers, memoMap, scope));
15197
+ const mergeAll = (...layers) => fromBuildMemo((memoMap, scope) => mergeAllEffect(layers, memoMap, scope));
14638
15198
  /**
14639
15199
  * Merges this layer with another layer concurrently, producing a new layer with
14640
15200
  * combined input, error, and output types.
@@ -14682,7 +15242,7 @@ const mergeAll = (...layers) => fromBuild((memoMap, scope) => mergeAllEffect(lay
14682
15242
  * @since 2.0.0
14683
15243
  */
14684
15244
  const merge = /*#__PURE__*/ dual(2, (self, that) => mergeAll(self, ...Array.isArray(that) ? that : [that]));
14685
- const provideWith = (self, that, f) => fromBuild((memoMap, scope) => flatMap$2(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope) : that.build(memoMap, scope), (context) => self.build(memoMap, scope).pipe(provideContext$1(context), map$2((merged) => f(merged, context)))));
15245
+ const provideWith = (self, that, f) => fromBuildMemo((memoMap, scope) => flatMap$2(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope) : that.build(memoMap, scope), (context) => self.build(memoMap, scope).pipe(provideContext$1(context), map$2((merged) => f(merged, context)))));
14686
15246
  /**
14687
15247
  * Feeds the output services of the dependency layer into the requirements of
14688
15248
  * this layer, returning a layer that only provides the services from this layer.
@@ -14954,6 +15514,86 @@ const flatMap$1 = /*#__PURE__*/ dual(2, (self, f) => fromBuild((memoMap, scope)
14954
15514
  const tap$1 = /*#__PURE__*/ dual(2, (self, f) => fromBuild((memoMap, scope) => flatMap$2(self.build(memoMap, scope), (context) => provide$3(as$1(f(context), context), scope))));
14955
15515
  const catch_$1 = /*#__PURE__*/ dual(2, (self, onError) => fromBuildUnsafe((memoMap, scope) => catch_$2(self.build(memoMap, scope), (e) => onError(e).build(memoMap, scope))));
14956
15516
  /**
15517
+ * Creates a fresh version of this layer that will not be shared.
15518
+ *
15519
+ * **When to use**
15520
+ *
15521
+ * Use when you need two parts of an application to receive separate instances
15522
+ * of a resource, such as two independent client sessions.
15523
+ *
15524
+ * **Gotchas**
15525
+ *
15526
+ * Do not use it just to work around confusing composition. By default, sharing
15527
+ * the same layer value is usually the desired behavior.
15528
+ *
15529
+ * **Example** (Creating non-shared layer instances)
15530
+ *
15531
+ * ```ts import.meta.vitest
15532
+ * import { Context, Effect, Layer, Ref } from "effect"
15533
+ *
15534
+ * class Counter extends Context.Service<Counter, {
15535
+ * readonly id: number
15536
+ * }>()("Counter") {}
15537
+ *
15538
+ * class Left extends Context.Service<Left, {
15539
+ * readonly counterId: number
15540
+ * }>()("Left") {}
15541
+ *
15542
+ * class Right extends Context.Service<Right, {
15543
+ * readonly counterId: number
15544
+ * }>()("Right") {}
15545
+ *
15546
+ * const leftLayer = Layer.effect(Left, Effect.gen(function*() {
15547
+ * const counter = yield* Counter
15548
+ * return { counterId: counter.id }
15549
+ * }))
15550
+ *
15551
+ * const rightLayer = Layer.effect(Right, Effect.gen(function*() {
15552
+ * const counter = yield* Counter
15553
+ * return { counterId: counter.id }
15554
+ * }))
15555
+ *
15556
+ * const compareIds = Effect.gen(function*() {
15557
+ * const left = yield* Left
15558
+ * const right = yield* Right
15559
+ * return left.counterId === right.counterId
15560
+ * })
15561
+ *
15562
+ * const program = Effect.gen(function*() {
15563
+ * const nextId = yield* Ref.make(0)
15564
+ *
15565
+ * const counterLayer = Layer.effect(Counter, Effect.gen(function*() {
15566
+ * const id = yield* Ref.updateAndGet(nextId, (n) => n + 1)
15567
+ * return { id }
15568
+ * }))
15569
+ *
15570
+ * const shared = Layer.merge(
15571
+ * Layer.provide(leftLayer, counterLayer),
15572
+ * Layer.provide(rightLayer, counterLayer)
15573
+ * )
15574
+ *
15575
+ * const sharedResult = yield* Effect.provide(compareIds, shared)
15576
+ *
15577
+ * const freshCounterLayer = Layer.fresh(counterLayer)
15578
+ * const fresh = Layer.merge(
15579
+ * Layer.provide(leftLayer, freshCounterLayer),
15580
+ * Layer.provide(rightLayer, freshCounterLayer)
15581
+ * )
15582
+ *
15583
+ * const freshResult = yield* Effect.provide(compareIds, fresh)
15584
+ *
15585
+ * return { shared: sharedResult, fresh: freshResult }
15586
+ * })
15587
+ *
15588
+ * await Effect.runPromise(program) // => { shared: true, fresh: false }
15589
+ * ```
15590
+ *
15591
+ * @stability stable
15592
+ * @category layers
15593
+ * @since 2.0.0
15594
+ */
15595
+ const fresh = (self) => fromBuildUnsafe((_, scope) => self.build(makeMemoMapUnsafe(), scope));
15596
+ /**
14957
15597
  * Builds this layer and keeps it alive until the returned effect is interrupted.
14958
15598
  *
14959
15599
  * **When to use**
@@ -14999,7 +15639,7 @@ const catch_$1 = /*#__PURE__*/ dual(2, (self, onError) => fromBuildUnsafe((memoM
14999
15639
  * @since 2.0.0
15000
15640
  */
15001
15641
  const launch = (self) => scoped$1(andThen$1(build(self), never$1));
15002
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Clock.js
15642
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Clock.js
15003
15643
  /**
15004
15644
  * Context reference for the active time service in the environment.
15005
15645
  *
@@ -15177,7 +15817,7 @@ const currentTimeNanos = currentTimeNanos$1;
15177
15817
  * @since 4.0.0
15178
15818
  */
15179
15819
  const monotonicTimeNanos = monotonicTimeNanos$1;
15180
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/random.js
15820
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/random.js
15181
15821
  /** @internal */
15182
15822
  const Random = /*#__PURE__*/ Reference("effect/Random", { defaultValue: () => ({
15183
15823
  nextIntUnsafe() {
@@ -15187,18 +15827,7 @@ const Random = /*#__PURE__*/ Reference("effect/Random", { defaultValue: () => ({
15187
15827
  return Math.random();
15188
15828
  }
15189
15829
  }) });
15190
- /** @internal */
15191
- const nextBetween = (min, max, draw) => {
15192
- const value = draw * (max - min) + min;
15193
- if (value !== max || min >= max || !Number.isFinite(max)) return value;
15194
- if (max === 0) return -Number.MIN_VALUE;
15195
- const view = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8));
15196
- view.setFloat64(0, max);
15197
- const bits = view.getBigUint64(0);
15198
- view.setBigUint64(0, max > 0 ? bits - BigInt(1) : bits + BigInt(1));
15199
- return view.getFloat64(0);
15200
- };
15201
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Pull.js
15830
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Pull.js
15202
15831
  /**
15203
15832
  * Models one low-level pull step for stream-like consumers.
15204
15833
  *
@@ -15375,7 +16004,7 @@ const matchEffect$1 = /*#__PURE__*/ dual(2, (self, options) => matchCauseEffect$
15375
16004
  return !isFailure$1(halt) ? options.onDone(halt.success.value) : options.onFailure(halt.failure);
15376
16005
  }
15377
16006
  }));
15378
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Schedule.js
16007
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Schedule.js
15379
16008
  const TypeId$2 = "~effect/Schedule";
15380
16009
  const randomNext = /*#__PURE__*/ Random.useSync((random) => random.nextDoubleUnsafe());
15381
16010
  /**
@@ -15874,24 +16503,29 @@ const identity_ = () => constIdentity;
15874
16503
  * @since 4.0.0
15875
16504
  */
15876
16505
  const setInputType = () => (self) => self;
15877
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/layer.js
16506
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/layer.js
15878
16507
  const provideLayer = (self, layer, options) => scopedWith$1((scope) => flatMap$2(options?.local ? buildWithMemoMap(layer, makeMemoMapUnsafe(), scope) : buildWithScope(layer, scope), (context) => provideContext$1(self, context)));
15879
16508
  /** @internal */
15880
16509
  const provide$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, source, options) => isContext(source) ? provideContext$1(self, source) : provideLayer(self, Array.isArray(source) ? mergeAll(...source) : source, options));
15881
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schedule.js
15882
- const findErrorOnly = (cause) => cause.reasons.every(isFailReason$1) ? findError$1(cause) : fail$5(cause);
16510
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schedule.js
15883
16511
  /** @internal */
15884
16512
  const repeatOrElse = /*#__PURE__*/ dual(3, (self, schedule, orElse) => flatMap$2(toStepWithMetadata(schedule), (step) => {
15885
16513
  let meta = CurrentMetadata.defaultValue();
15886
- return catchCauseFilter(catchDone(forever$2(tap$2(flatMap$2(suspend$2(() => provideService$1(self, CurrentMetadata, meta)), step), (meta_) => sync$2(() => {
15887
- meta = meta_;
15888
- })), { disableYield: true }), (out) => succeed$4(out)), findErrorOnly, (error) => orElse(error, meta.attempt === 0 ? none() : some(meta)));
16514
+ const loop = (input) => matchEffect$1(step(input), {
16515
+ onSuccess(meta_) {
16516
+ meta = meta_;
16517
+ return flatMap$2(provideService$1(self, CurrentMetadata, meta), loop);
16518
+ },
16519
+ onFailure: failCause$3,
16520
+ onDone: succeed$4
16521
+ });
16522
+ return catchCauseFilter(flatMap$2(provideService$1(self, CurrentMetadata, meta), loop), findRecoverableError, (error) => orElse(error, meta.attempt === 0 ? none() : some(meta)));
15889
16523
  }));
15890
16524
  /** @internal */
15891
16525
  const retryOrElse = /*#__PURE__*/ dual(3, (self, policy, orElse) => flatMap$2(toStepWithMetadata(policy), (step) => {
15892
16526
  let meta = CurrentMetadata.defaultValue();
15893
16527
  let lastError;
15894
- const loop = catchCauseFilter(suspend$2(() => provideService$1(self, CurrentMetadata, meta)), findErrorOnly, (error) => {
16528
+ const loop = catchCauseFilter(suspend$2(() => provideService$1(self, CurrentMetadata, meta)), findRecoverableError, (error) => {
15895
16529
  lastError = error;
15896
16530
  return flatMap$2(step(error), (meta_) => {
15897
16531
  meta = meta_;
@@ -15925,7 +16559,7 @@ const buildFromOptions = (options) => {
15925
16559
  if (options.times !== void 0) schedule = while_(schedule, ({ attempt }) => succeed$4(attempt <= options.times));
15926
16560
  return schedule;
15927
16561
  };
15928
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/MutableHashMap.js
16562
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/MutableHashMap.js
15929
16563
  const TypeId$1 = "~effect/MutableHashMap";
15930
16564
  const MutableHashMapProto = {
15931
16565
  [TypeId$1]: TypeId$1,
@@ -16098,40 +16732,6 @@ const get = /*#__PURE__*/ dual(2, (self, key) => {
16098
16732
  return getFromBucket(self, bucket, key);
16099
16733
  });
16100
16734
  const isSimpleKey = (u) => typeof u !== "object" && typeof u !== "function";
16101
- /**
16102
- * Returns an iterable over the values in the `MutableHashMap`.
16103
- *
16104
- * **When to use**
16105
- *
16106
- * Use to iterate over the values currently stored in a mutable hash map.
16107
- *
16108
- * **Example** (Reading values)
16109
- *
16110
- * ```ts import.meta.vitest
16111
- * import { MutableHashMap } from "effect"
16112
- *
16113
- * const map = MutableHashMap.make(
16114
- * ["apple", 1],
16115
- * ["banana", 2],
16116
- * ["cherry", 3]
16117
- * )
16118
- *
16119
- * const allValues = Array.from(MutableHashMap.values(map)) // => [1, 2, 3]
16120
- *
16121
- * // Useful for calculations
16122
- * allValues.reduce((sum, value) => sum + value, 0) // => 6
16123
- *
16124
- * // Filter values
16125
- * allValues.filter((value) => value > 1) // => [2, 3]
16126
- * ```
16127
- *
16128
- * @see {@link keys} for iterating over stored keys
16129
- *
16130
- * @stability stable
16131
- * @category getters
16132
- * @since 3.8.0
16133
- */
16134
- const values = (self) => self.backing.values();
16135
16735
  const getFromBucket = (self, bucket, key) => {
16136
16736
  for (let i = 0, len = bucket.length; i < len; i++) if (equals$1(key, bucket[i])) {
16137
16737
  const refKey = bucket[i];
@@ -16369,7 +16969,7 @@ const clear = (self) => {
16369
16969
  * @since 2.0.0
16370
16970
  */
16371
16971
  const size = (self) => self.backing.size;
16372
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Request.js
16972
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Request.js
16373
16973
  const TypeId = "~effect/Request";
16374
16974
  const requestVariance = /*#__PURE__*/ byReferenceUnsafe({
16375
16975
  /* c8 ignore next */
@@ -16445,7 +17045,7 @@ const Class = /*#__PURE__*/ function() {
16445
17045
  * @since 2.0.0
16446
17046
  */
16447
17047
  const makeEntry = (options) => options;
16448
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/request.js
17048
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/request.js
16449
17049
  /** @internal */
16450
17050
  const request$1 = /*#__PURE__*/ dual(2, (self, resolver) => {
16451
17051
  const withResolver = (resolver) => callback$1((resume) => {
@@ -16471,8 +17071,27 @@ const makeBatchMap = (resolver) => {
16471
17071
  delete: (key) => remove(map, key)
16472
17072
  };
16473
17073
  };
16474
- const batchPool = [];
16475
17074
  const pendingBatches = /*#__PURE__*/ new WeakMap();
17075
+ const makeBatch = (key, context, resolver, map) => {
17076
+ const batch = {
17077
+ key,
17078
+ context,
17079
+ resolver,
17080
+ map,
17081
+ entrySet: /* @__PURE__ */ new Set(),
17082
+ entries: /* @__PURE__ */ new Set(),
17083
+ delayEffect: flatMap$2(withFiber$1((delayFiber) => {
17084
+ batch.fiber = delayFiber;
17085
+ return batch.resolver.delay;
17086
+ }), (_) => runBatch(batch)),
17087
+ run: onExit$1(suspend$2(() => batch.resolver.runAll(Array.from(batch.entries), batch.key)), (exit) => {
17088
+ for (const entry of batch.entrySet) entry.completeUnsafe(exit._tag === "Success" ? exitDie(new Error("Effect.request: RequestResolver did not complete request", { cause: entry.request })) : exit);
17089
+ batch.entries.clear();
17090
+ return void_$2;
17091
+ })
17092
+ };
17093
+ return batch;
17094
+ };
16476
17095
  const addEntry = (resolver, request, resume, fiber) => {
16477
17096
  let batchMap = pendingBatches.get(resolver);
16478
17097
  if (!batchMap) {
@@ -16495,44 +17114,21 @@ const addEntry = (resolver, request, resume, fiber) => {
16495
17114
  if (resolver.preCheck !== void 0 && !resolver.preCheck(entry)) return entry;
16496
17115
  const key = resolver.batchKey(entry);
16497
17116
  batch = batchMap.get(key);
17117
+ const isNewBatch = batch === void 0;
16498
17118
  if (!batch) {
16499
- if (batchPool.length > 0) {
16500
- batch = batchPool.pop();
16501
- batch.key = key;
16502
- batch.resolver = resolver;
16503
- batch.map = batchMap;
16504
- } else {
16505
- const newBatch = {
16506
- key,
16507
- resolver,
16508
- map: batchMap,
16509
- entrySet: /* @__PURE__ */ new Set(),
16510
- entries: /* @__PURE__ */ new Set(),
16511
- delayEffect: flatMap$2(suspend$2(() => newBatch.resolver.delay), (_) => runBatch(newBatch)),
16512
- run: onExit$1(suspend$2(() => newBatch.resolver.runAll(Array.from(newBatch.entries), newBatch.key)), (exit) => {
16513
- for (const entry of newBatch.entrySet) entry.completeUnsafe(exit._tag === "Success" ? exitDie(new Error("Effect.request: RequestResolver did not complete request", { cause: entry.request })) : exit);
16514
- newBatch.entries.clear();
16515
- if (batchPool.length < 128) {
16516
- newBatch.entrySet.clear();
16517
- newBatch.key = void 0;
16518
- newBatch.fiber = void 0;
16519
- newBatch.resolver = void 0;
16520
- newBatch.map = void 0;
16521
- batchPool.push(newBatch);
16522
- }
16523
- return void_$2;
16524
- })
16525
- };
16526
- batch = newBatch;
16527
- }
17119
+ batch = makeBatch(key, fiber.context, resolver, batchMap);
16528
17120
  batchMap.set(key, batch);
16529
- batch.fiber = runForkWith$1(fiber.context)(batch.delayEffect, { scheduler: fiber.cache.scheduler });
16530
17121
  }
16531
17122
  batch.entrySet.add(entry);
16532
17123
  batch.entries.add(entry);
17124
+ if (isNewBatch) {
17125
+ const delayFiber = runForkWith$1(fiber.context)(batch.delayEffect, { scheduler: fiber.cache.scheduler });
17126
+ if (completed || batchMap.get(key) !== batch) return entry;
17127
+ batch.fiber = delayFiber;
17128
+ }
16533
17129
  if (batch.resolver.collectWhile(batch.entries)) return entry;
16534
17130
  batch.fiber.interruptUnsafe(fiber.id);
16535
- batch.fiber = runForkWith$1(fiber.context)(runBatch(batch), { scheduler: fiber.cache.scheduler });
17131
+ runForkWith$1(batch.context)(runBatch(batch), { scheduler: get$1(batch.context, Scheduler) });
16536
17132
  return entry;
16537
17133
  };
16538
17134
  const removeEntryUnsafe = (resolver, entry) => {
@@ -16558,7 +17154,7 @@ function runBatch(batch) {
16558
17154
  batch.map.delete(batch.key);
16559
17155
  return batch.run;
16560
17156
  }
16561
- // ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Effect.js
17157
+ // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Effect.js
16562
17158
  /**
16563
17159
  * Checks whether a value is an `Effect`.
16564
17160
  *
@@ -16845,8 +17441,9 @@ const whileLoop = whileLoop$1;
16845
17441
  *
16846
17442
  * **Details**
16847
17443
  *
16848
- * An optional `AbortSignal` can be provided to allow for interruption of the
16849
- * wrapped `Promise` API.
17444
+ * If `evaluate` declares a parameter, it receives an `AbortSignal` that is
17445
+ * aborted if the effect is interrupted. Zero-argument thunks do not allocate
17446
+ * an `AbortController`.
16850
17447
  *
16851
17448
  * **Gotchas**
16852
17449
  *
@@ -16856,6 +17453,13 @@ const whileLoop = whileLoop$1;
16856
17453
  * Interruption aborts the provided `AbortSignal`, but the underlying
16857
17454
  * asynchronous operation only stops if it observes that signal.
16858
17455
  *
17456
+ * The parameter check reads the `length` property of `evaluate`, which does
17457
+ * not count a rest parameter or any parameter from the first default value
17458
+ * onward. `(...args) => ...` and `(signal = fallback) => ...` therefore
17459
+ * receive `undefined` instead of a signal, as do wrappers that forward
17460
+ * arguments through rest parameters. Declare the signal as an ordinary
17461
+ * parameter: `(signal) => ...`.
17462
+ *
16859
17463
  * **Example** (Wrapping a non-rejecting Promise)
16860
17464
  *
16861
17465
  * ```ts import.meta.vitest
@@ -16897,9 +17501,10 @@ const promise = promise$1;
16897
17501
  * Passing `{ try, catch }` uses `catch` to map failures to an error of type
16898
17502
  * `E`.
16899
17503
  *
16900
- * The thunk receives an `AbortSignal` that is aborted if the effect is
16901
- * interrupted. The underlying asynchronous operation only stops if it observes
16902
- * that signal.
17504
+ * If the thunk declares a parameter, it receives an `AbortSignal` that is
17505
+ * aborted if the effect is interrupted. The underlying asynchronous operation
17506
+ * only stops if it observes that signal. Zero-argument thunks do not allocate
17507
+ * an `AbortController`.
16903
17508
  *
16904
17509
  * **Gotchas**
16905
17510
  *
@@ -16907,6 +17512,13 @@ const promise = promise$1;
16907
17512
  * defect. Return the error value you want in the error channel instead of
16908
17513
  * throwing it.
16909
17514
  *
17515
+ * The parameter check reads the thunk's `length` property, which does not
17516
+ * count a rest parameter or any parameter from the first default value
17517
+ * onward. `(...args) => ...` and `(signal = fallback) => ...` therefore
17518
+ * receive `undefined` instead of a signal, as do wrappers that forward
17519
+ * arguments through rest parameters. Declare the signal as an ordinary
17520
+ * parameter: `(signal) => ...`.
17521
+ *
16910
17522
  * **Example** (Wrapping a fetch request that may fail)
16911
17523
  *
16912
17524
  * ```ts import.meta.vitest
@@ -17155,10 +17767,20 @@ const undefined_ = undefined_$1;
17155
17767
  *
17156
17768
  * **Details**
17157
17769
  *
17158
- * The registration function receives a `resume` callback and, when requested,
17159
- * an `AbortSignal`. Call `resume` at most once with the effect that should
17160
- * complete the fiber; later calls are ignored. Return an optional cleanup
17161
- * effect from the registration function to run if the fiber is interrupted.
17770
+ * The registration function receives a `resume` callback and, if it declares
17771
+ * a second parameter, an `AbortSignal` that is aborted if the fiber is
17772
+ * interrupted. Call `resume` at most once with the effect that should complete
17773
+ * the fiber; later calls are ignored. Return an optional cleanup effect from
17774
+ * the registration function to run if the fiber is interrupted.
17775
+ *
17776
+ * **Gotchas**
17777
+ *
17778
+ * The parameter check reads the registration function's `length` property,
17779
+ * which must be at least `2` and does not count a rest parameter or any
17780
+ * parameter from the first default value onward. `(...args) => ...` and
17781
+ * `(resume, signal = fallback) => ...` therefore receive `undefined` instead
17782
+ * of a signal, as do wrappers that forward arguments through rest parameters.
17783
+ * Declare both as ordinary parameters: `(resume, signal) => ...`.
17162
17784
  *
17163
17785
  * **Example** (Integrating callback APIs)
17164
17786
  *
@@ -17289,6 +17911,34 @@ const gen = gen$1;
17289
17911
  */
17290
17912
  const fail = fail$4;
17291
17913
  /**
17914
+ * Creates an `Effect` that represents a recoverable error using a lazy evaluation.
17915
+ *
17916
+ * **When to use**
17917
+ *
17918
+ * Use to defer computing a recoverable error value until the effect is run.
17919
+ *
17920
+ * **Details**
17921
+ *
17922
+ * The error-producing function is evaluated each time the effect is executed.
17923
+ *
17924
+ * **Example** (Lazily creating failures)
17925
+ *
17926
+ * ```ts import.meta.vitest
17927
+ * import { Data, Effect } from "effect"
17928
+ *
17929
+ * class ProgramError extends Data.TaggedError("ProgramError")<{ readonly operation: string }> {}
17930
+ *
17931
+ * const program = Effect.failSync(() => new ProgramError({ operation: "sync" }))
17932
+ *
17933
+ * Effect.runSync(Effect.flip(program)).operation // => "sync"
17934
+ * ```
17935
+ *
17936
+ * @stability stable
17937
+ * @category constructors
17938
+ * @since 2.0.0
17939
+ */
17940
+ const failSync = failSync$1;
17941
+ /**
17292
17942
  * Creates an `Effect` that represents a failure with a specific `Cause`.
17293
17943
  *
17294
17944
  * **When to use**
@@ -17486,7 +18136,9 @@ const fromResult = fromResult$1;
17486
18136
  * `Option.some` becomes a successful effect with the contained value, while
17487
18137
  * `Option.none` becomes a failed effect. By default the failure is a
17488
18138
  * `NoSuchElementError`, but you can provide an `onNone` callback to customize
17489
- * the error value.
18139
+ * the error value. For `Option.none`, `onNone` is evaluated on each execution,
18140
+ * not when the effect is constructed. It is never called for `Option.some`.
18141
+ * If `onNone` throws, the effect dies with the thrown value as a defect.
17490
18142
  *
17491
18143
  * **Example** (Converting an Option into an Effect)
17492
18144
  *
@@ -17773,9 +18425,12 @@ const tap = tap$2;
17773
18425
  *
17774
18426
  * **Gotchas**
17775
18427
  *
17776
- * `result` only captures typed, recoverable failures. Defects and
17777
- * interruptions are not captured inside the `Result` and still fail the
17778
- * effect.
18428
+ * `result` only captures typed, recoverable failures. If the cause contains a
18429
+ * defect, nothing is captured and every typed error is converted to a defect,
18430
+ * preserving reason order and interrupts. A cause with only interruptions
18431
+ * still fails the effect, but an interruption alongside a typed error does not
18432
+ * prevent capture. The first typed error becomes a `Result.Failure` and the
18433
+ * interruption is discarded.
17779
18434
  *
17780
18435
  * **Example** (Capturing success or failure as Result)
17781
18436
  *
@@ -17816,9 +18471,12 @@ const result = result$1;
17816
18471
  *
17817
18472
  * **Gotchas**
17818
18473
  *
17819
- * `option` only captures typed, recoverable failures as `Option.none`.
17820
- * Defects and interruptions are not captured inside the `Option` and still
17821
- * fail the effect.
18474
+ * `option` only captures typed, recoverable failures as `Option.none`. If the
18475
+ * cause contains a defect, nothing is captured and every typed error is
18476
+ * converted to a defect, preserving reason order and interrupts. A cause with
18477
+ * only interruptions still fails the effect, but an interruption alongside a
18478
+ * typed error does not prevent capture. The effect succeeds with
18479
+ * `Option.none()` and the interruption is discarded.
17822
18480
  *
17823
18481
  * `option` also discards typed failure values. Use `result` if the failure
17824
18482
  * value matters.
@@ -18128,6 +18786,12 @@ const catch_ = catch_$2;
18128
18786
  * The error type must have a readonly `_tag` field. `catchTag` matches that
18129
18787
  * field and only handles errors with the requested tag.
18130
18788
  *
18789
+ * **Gotchas**
18790
+ *
18791
+ * If the cause contains a defect, the handler is skipped and every typed error
18792
+ * is converted to a defect, preserving reason order and interrupts. An
18793
+ * interruption alongside a typed error does not prevent recovery.
18794
+ *
18131
18795
  * **Example** (Handling a tagged error)
18132
18796
  *
18133
18797
  * ```ts import.meta.vitest
@@ -18179,6 +18843,12 @@ const catchTag = catchTag$1;
18179
18843
  * The error type must have a readonly `_tag` field to use `catchTags`. This
18180
18844
  * field is used to identify and match errors.
18181
18845
  *
18846
+ * **Gotchas**
18847
+ *
18848
+ * If the cause contains a defect, the handler is skipped and every typed error
18849
+ * is converted to a defect, preserving reason order and interrupts. An
18850
+ * interruption alongside a typed error does not prevent recovery.
18851
+ *
18182
18852
  * **Example** (Handling multiple tagged errors)
18183
18853
  *
18184
18854
  * ```ts import.meta.vitest
@@ -18225,6 +18895,12 @@ const catchTags = catchTags$1;
18225
18895
  * Use this to handle nested error causes without removing the parent error
18226
18896
  * from the error channel. The handler receives the unwrapped reason.
18227
18897
  *
18898
+ * **Gotchas**
18899
+ *
18900
+ * If the cause contains a defect, the handler is skipped and every typed error
18901
+ * is converted to a defect, preserving reason order and interrupts. An
18902
+ * interruption alongside a typed error does not prevent recovery.
18903
+ *
18228
18904
  * **Example** (Handling an error reason)
18229
18905
  *
18230
18906
  * ```ts import.meta.vitest
@@ -18327,6 +19003,12 @@ const catchCause = catchCause$1;
18327
19003
  * they often indicate serious issues. In some cases, such as dynamically loaded
18328
19004
  * plugins, controlled recovery may be needed.
18329
19005
  *
19006
+ * **Gotchas**
19007
+ *
19008
+ * `catchDefect` recovers any cause that contains a defect, including causes
19009
+ * that also contain typed errors. Typed error handlers such as `catch` skip
19010
+ * those causes, so defects always take precedence.
19011
+ *
18330
19012
  * **Example** (Recovering from defects)
18331
19013
  *
18332
19014
  * ```ts import.meta.vitest
@@ -18367,6 +19049,12 @@ const catchDefect = catchDefect$1;
18367
19049
  * matching. Non-matching errors re-fail with the original cause. Defects and
18368
19050
  * interrupts are not caught.
18369
19051
  *
19052
+ * **Gotchas**
19053
+ *
19054
+ * If the cause contains a defect, the handler is skipped and every typed error
19055
+ * is converted to a defect, preserving reason order and interrupts. An
19056
+ * interruption alongside a typed error does not prevent recovery.
19057
+ *
18370
19058
  * **Example** (Recovering when a predicate matches)
18371
19059
  *
18372
19060
  * ```ts import.meta.vitest
@@ -18416,6 +19104,12 @@ const catchIf = catchIf$1;
18416
19104
  * `orElse` when provided. Without `orElse`, the original failure cause is
18417
19105
  * preserved.
18418
19106
  *
19107
+ * **Gotchas**
19108
+ *
19109
+ * If the cause contains a defect, the handler is skipped and every typed error
19110
+ * is converted to a defect, preserving reason order and interrupts. An
19111
+ * interruption alongside a typed error does not prevent recovery.
19112
+ *
18419
19113
  * @see {@link catchIf} for predicate-based recovery from typed errors
18420
19114
  * @see {@link catchTag} for recovering from a single tagged error
18421
19115
  * @see {@link catchTags} for recovering from several tagged errors
@@ -18484,6 +19178,9 @@ const catchCauseIf = catchCauseIf$1;
18484
19178
  * Only the failure channel is transformed. The success channel and requirements
18485
19179
  * are preserved.
18486
19180
  *
19181
+ * Maps every typed error in the cause, preserving defects, interrupts and
19182
+ * reason order. Unlike typed recovery, mapping does not convert errors to defects.
19183
+ *
18487
19184
  * **Example** (Transforming the error channel)
18488
19185
  *
18489
19186
  * ```ts import.meta.vitest
@@ -18513,6 +19210,52 @@ const catchCauseIf = catchCauseIf$1;
18513
19210
  */
18514
19211
  const mapError = mapError$1;
18515
19212
  /**
19213
+ * Applies transformations to both the success and error channels of an effect.
19214
+ *
19215
+ * **When to use**
19216
+ *
19217
+ * Use to transform both success and failure channels of an `Effect` without
19218
+ * changing whether it succeeds or fails.
19219
+ *
19220
+ * **Details**
19221
+ *
19222
+ * This function takes two map functions as arguments: one for the error channel
19223
+ * and one for the success channel. You can use it when you want to modify both
19224
+ * the error and the success values without altering the overall success or
19225
+ * failure status of the effect.
19226
+ *
19227
+ * Maps every typed error in the cause, preserving defects, interrupts and
19228
+ * reason order. Unlike typed recovery, mapping does not convert errors to defects.
19229
+ *
19230
+ * **Example** (Transforming success and failure channels)
19231
+ *
19232
+ * ```ts import.meta.vitest
19233
+ * import { Data, Effect } from "effect"
19234
+ *
19235
+ * class TaskError extends Data.TaggedError("TaskError")<{ readonly message: string }> {}
19236
+ *
19237
+ * // ┌─── Effect<number, string, never>
19238
+ * // ▼
19239
+ * const simulatedTask = Effect.fail("Oh no!").pipe(Effect.as(1))
19240
+ *
19241
+ * // ┌─── Effect<boolean, TaskError, never>
19242
+ * // ▼
19243
+ * const modified = Effect.mapBoth(simulatedTask, {
19244
+ * onFailure: (message) => new TaskError({ message }),
19245
+ * onSuccess: (n) => n > 0
19246
+ * })
19247
+ * Effect.runSync(Effect.flip(modified)).message // => "Oh no!"
19248
+ * ```
19249
+ *
19250
+ * @see {@link map} for a version that operates on the success channel.
19251
+ * @see {@link mapError} for a version that operates on the error channel.
19252
+ *
19253
+ * @stability stable
19254
+ * @category mapping
19255
+ * @since 2.0.0
19256
+ */
19257
+ const mapBoth = mapBoth$1;
19258
+ /**
18516
19259
  * Converts typed failures from the error channel into defects, removing the
18517
19260
  * error type from the returned effect.
18518
19261
  *
@@ -18712,7 +19455,9 @@ const tapDefect = tapDefect$1;
18712
19455
  * applied. For example, `Schedule.recurs(3)` allows up to three retries after
18713
19456
  * the initial attempt.
18714
19457
  *
18715
- * Defects and interruptions are not retried.
19458
+ * Defects take precedence over typed errors. A failure whose cause contains a
19459
+ * defect is not retried and is propagated with every typed error converted to a
19460
+ * defect. A typed error alongside an interruption is retried.
18716
19461
  *
18717
19462
  * **Example** (Retrying with a schedule)
18718
19463
  *
@@ -18756,6 +19501,16 @@ const retry = retry$1;
18756
19501
  *
18757
19502
  * Use the `log` option to emit the full {@link Cause} when the effect fails,
18758
19503
  * and `message` to prepend a custom log message.
19504
+ * Set `log: "Unhandled"` to read `References.UnhandledLogLevel` when the
19505
+ * failure occurs; `undefined` disables logging. Minimum log level filtering
19506
+ * still applies.
19507
+ *
19508
+ * **Gotchas**
19509
+ *
19510
+ * Defects take precedence over typed errors. If the cause also contains a
19511
+ * defect, the failure is not ignored and is propagated with every typed error
19512
+ * converted to a defect. An interruption alongside a typed error does not
19513
+ * prevent the error from being ignored.
18759
19514
  *
18760
19515
  * **Example** (Discarding success and failure values)
18761
19516
  *
@@ -18800,6 +19555,9 @@ const ignore = ignore$1;
18800
19555
  *
18801
19556
  * Use the `log` option to emit the full {@link Cause} when the effect fails,
18802
19557
  * and `message` to prepend a custom log message.
19558
+ * Set `log: "Unhandled"` to read `References.UnhandledLogLevel` when the
19559
+ * failure occurs; `undefined` disables logging. Minimum log level filtering
19560
+ * still applies.
18803
19561
  *
18804
19562
  * **Example** (Ignoring failures and logging causes)
18805
19563
  *
@@ -18842,6 +19600,12 @@ const withErrorReporting = withErrorReporting$1;
18842
19600
  *
18843
19601
  * Defects and interruptions are not recovered by this operator.
18844
19602
  *
19603
+ * **Gotchas**
19604
+ *
19605
+ * If the cause contains a defect, the handler is skipped and every typed error
19606
+ * is converted to a defect, preserving reason order and interrupts. An
19607
+ * interruption alongside a typed error does not prevent recovery.
19608
+ *
18845
19609
  * **Example** (Replacing failures with a value)
18846
19610
  *
18847
19611
  * ```ts import.meta.vitest
@@ -19326,6 +20090,12 @@ const when = when$1;
19326
20090
  * to process the result if the effect succeeds, or handle the error if the
19327
20091
  * effect fails.
19328
20092
  *
20093
+ * **Gotchas**
20094
+ *
20095
+ * If the cause contains a defect, the handler is skipped and every typed error
20096
+ * is converted to a defect, preserving reason order and interrupts. An
20097
+ * interruption alongside a typed error does not prevent recovery.
20098
+ *
19329
20099
  * **Example** (Matching success and failure values)
19330
20100
  *
19331
20101
  * ```ts import.meta.vitest
@@ -19458,6 +20228,12 @@ const matchCauseEffect = matchCauseEffect$1;
19458
20228
  * performing logging, recovery, notification, or other effectful work. The
19459
20229
  * returned effect succeeds or fails according to the handler that is run.
19460
20230
  *
20231
+ * **Gotchas**
20232
+ *
20233
+ * If the cause contains a defect, the handler is skipped and every typed error
20234
+ * is converted to a defect, preserving reason order and interrupts. An
20235
+ * interruption alongside a typed error does not prevent recovery.
20236
+ *
19461
20237
  * **Example** (Matching success and failure with effectful handlers)
19462
20238
  *
19463
20239
  * ```ts import.meta.vitest
@@ -19639,9 +20415,9 @@ const context = context$1;
19639
20415
  */
19640
20416
  const contextWith = contextWith$1;
19641
20417
  /**
19642
- * Provides dependencies to an effect using layers or a context. Use `options.local`
19643
- * to build the layer every time; by default, layers are shared between provide
19644
- * calls.
20418
+ * Provides dependencies to an effect using layers or a context. A layer already
20419
+ * built by an enclosing `provide` or runtime is reused. Sibling `provide` calls
20420
+ * build their own copies. Use `options.local` to build a fresh layer subtree.
19645
20421
  *
19646
20422
  * **Example** (Providing dependencies with a layer)
19647
20423
  *
@@ -20661,6 +21437,10 @@ const forever = forever$2;
20661
21437
  * The source effect is always evaluated once before the schedule is stepped.
20662
21438
  * The schedule controls additional repetitions, not the initial execution.
20663
21439
  *
21440
+ * If the effect or policy fails with a cause that contains a defect, the
21441
+ * failure is propagated with every typed error converted to a defect.
21442
+ * An interruption alongside a typed error does not block the typed error path.
21443
+ *
20664
21444
  * **Example** (Repeating successful effects with a schedule)
20665
21445
  *
20666
21446
  * ```ts import.meta.vitest
@@ -20993,8 +21773,8 @@ const request = request$1;
20993
21773
  * You can use the `forkChild` method whenever you want to execute an effect in a
20994
21774
  * new fiber, concurrently and without "blocking" the fiber executing other
20995
21775
  * effects. Using fibers can be tricky, so instead of using this method
20996
- * directly, consider other higher-level methods, such as `raceWith`,
20997
- * `zipPar`, and so forth.
21776
+ * directly, consider higher-level methods such as `Effect.race`,
21777
+ * `Effect.raceFirst`, or `Effect.all` with a concurrency option.
20998
21778
  *
20999
21779
  * The fiber returned by this method has methods to interrupt the fiber and to
21000
21780
  * wait for it to finish executing the effect. See `Fiber` for more
@@ -21083,9 +21863,14 @@ const forkIn = forkIn$1;
21083
21863
  */
21084
21864
  const forkScoped = forkScoped$1;
21085
21865
  /**
21086
- * Forks the effect into a new fiber attached to the global scope. Because the
21087
- * new fiber is attached to the global scope, when the fiber executing the
21088
- * returned effect terminates, the forked fiber will continue running.
21866
+ * Forks the effect into a new fiber with no parent and no scope, so its lifetime
21867
+ * is independent of the forking fiber.
21868
+ *
21869
+ * **Details**
21870
+ *
21871
+ * The detached fiber inherits the forking fiber's context. It continues running
21872
+ * until it completes or is explicitly interrupted through the returned handle,
21873
+ * even after the forking fiber terminates.
21089
21874
  *
21090
21875
  * **Example** (Forking a detached fiber)
21091
21876
  *
@@ -21144,11 +21929,11 @@ const fiber = fiber$1;
21144
21929
  * import { Effect, Fiber } from "effect"
21145
21930
  * const output: Array<unknown> = []
21146
21931
  *
21147
- * // ┌─── Effect<number, never, never>
21932
+ * // ┌─── Effect<string, never, never>
21148
21933
  * // ▼
21149
21934
  * const program = Effect.sync(() => { output.push("running...") }).pipe(Effect.as("done"))
21150
21935
  *
21151
- * // ┌─── RuntimeFiber<number, never>
21936
+ * // ┌─── Fiber<string, never>
21152
21937
  * // ▼
21153
21938
  * const fiber = Effect.runFork(program)
21154
21939
  *
@@ -21286,9 +22071,10 @@ const runPromiseWith = runPromiseWith$1;
21286
22071
  *
21287
22072
  * **Details**
21288
22073
  *
21289
- * If the effect fails, dies, is interrupted, or performs asynchronous work,
21290
- * `runSync` throws a `FiberFailure` instead of returning a value. Use
21291
- * `runSyncExit` when you want the failure captured as an `Exit`.
22074
+ * If the effect fails, dies, or is interrupted, `runSync` throws the squashed
22075
+ * cause instead of returning a value. Typed errors can be thrown directly,
22076
+ * including non-Error values. Asynchronous work throws `Cause.AsyncFiberError`.
22077
+ * Use `runSyncExit` when you want the failure captured as an `Exit`.
21292
22078
  *
21293
22079
  * **Example** (Running a synchronous effect)
21294
22080
  *
@@ -21406,7 +22192,7 @@ const runSyncWith = runSyncWith$1;
21406
22192
  * import { Cause, Effect, Exit } from "effect"
21407
22193
  *
21408
22194
  * const exit = Effect.runSyncExit(Effect.promise(() => Promise.resolve(1)))
21409
- * const isAsyncDie = Exit.hasDies(exit) && exit.cause.reasons.some(
22195
+ * const isAsyncDie = Exit.isFailure(exit) && Exit.hasDies(exit) && exit.cause.reasons.some(
21410
22196
  * (reason) => Cause.isDieReason(reason) && Cause.isAsyncFiberError(reason.defect)
21411
22197
  * )
21412
22198
  *
@@ -21437,7 +22223,9 @@ const runSyncExit = runSyncExit$1;
21437
22223
  * boundary and does not create tracing spans. Use {@link fn} when you need
21438
22224
  * those stack frames or spans. Additional arguments after the generator body
21439
22225
  * act like `pipe` transforms: each transform receives the previous result and
21440
- * the original function arguments. Annotate the generator return type with
22226
+ * the original function arguments. Generator bodies may declare a `this`
22227
+ * parameter; pass `{ self }` before the body to bind `this` when the function
22228
+ * is created. Annotate the generator return type with
21441
22229
  * `Effect.fn.Return<A, E, R>` when the produced `Effect` type needs to be
21442
22230
  * stated explicitly.
21443
22231
  *
@@ -21664,41 +22452,6 @@ const fn = fn$1;
21664
22452
  */
21665
22453
  const clockWith = clockWith$2;
21666
22454
  /**
21667
- * Creates a logger function that logs at the specified level.
21668
- *
21669
- * **Details**
21670
- *
21671
- * If no level is provided, the logger uses the fiber's current log level and
21672
- * extracts any `Cause` values from the message list.
21673
- *
21674
- * **Example** (Logging at a dynamic level)
21675
- *
21676
- * ```ts import.meta.vitest
21677
- * import { Effect, Logger, References } from "effect"
21678
- * const output: Array<unknown> = []
21679
- *
21680
- * const logWarn = Effect.logWithLevel("Warn")
21681
- *
21682
- * const program = Effect.gen(function*() {
21683
- * yield* logWarn("Cache miss")
21684
- * })
21685
- * const logger = Logger.make<unknown, void>(({ logLevel, message }) => {
21686
- * void output.push(`${logLevel}: ${Array.isArray(message) ? message.map(String).join(" ") : String(message)}`)
21687
- * })
21688
- * const runnable = program.pipe(
21689
- * Effect.provideService(References.MinimumLogLevel, "Debug"),
21690
- * Effect.provide(Logger.layer([logger]))
21691
- * )
21692
- * Effect.runSync(runnable)
21693
- * output // => ["Warn: Cache miss"]
21694
- * ```
21695
- *
21696
- * @stability stable
21697
- * @category logging
21698
- * @since 2.0.0
21699
- */
21700
- const logWithLevel = logWithLevel$1;
21701
- /**
21702
22455
  * Logs one or more messages using the default log level.
21703
22456
  *
21704
22457
  * **Example** (Logging at the default level)
@@ -21725,7 +22478,7 @@ const logWithLevel = logWithLevel$1;
21725
22478
  * @category logging
21726
22479
  * @since 2.0.0
21727
22480
  */
21728
- const log = /*#__PURE__*/ logWithLevel$1();
22481
+ const log = /*#__PURE__*/ logWithLevel();
21729
22482
  /**
21730
22483
  * Logs one or more messages at the FATAL level.
21731
22484
  *
@@ -21751,7 +22504,7 @@ const log = /*#__PURE__*/ logWithLevel$1();
21751
22504
  * @category logging
21752
22505
  * @since 2.0.0
21753
22506
  */
21754
- const logFatal = /*#__PURE__*/ logWithLevel$1("Fatal");
22507
+ const logFatal = /*#__PURE__*/ logWithLevel("Fatal");
21755
22508
  /**
21756
22509
  * Logs one or more messages at the WARNING level.
21757
22510
  *
@@ -21776,7 +22529,7 @@ const logFatal = /*#__PURE__*/ logWithLevel$1("Fatal");
21776
22529
  * @category logging
21777
22530
  * @since 2.0.0
21778
22531
  */
21779
- const logWarning = /*#__PURE__*/ logWithLevel$1("Warn");
22532
+ const logWarning = /*#__PURE__*/ logWithLevel("Warn");
21780
22533
  /**
21781
22534
  * Logs one or more messages at the ERROR level.
21782
22535
  *
@@ -21801,7 +22554,7 @@ const logWarning = /*#__PURE__*/ logWithLevel$1("Warn");
21801
22554
  * @category logging
21802
22555
  * @since 2.0.0
21803
22556
  */
21804
- const logError = /*#__PURE__*/ logWithLevel$1("Error");
22557
+ const logError = /*#__PURE__*/ logWithLevel("Error");
21805
22558
  /**
21806
22559
  * Logs one or more messages at the INFO level.
21807
22560
  *
@@ -21826,7 +22579,7 @@ const logError = /*#__PURE__*/ logWithLevel$1("Error");
21826
22579
  * @category logging
21827
22580
  * @since 2.0.0
21828
22581
  */
21829
- const logInfo = /*#__PURE__*/ logWithLevel$1("Info");
22582
+ const logInfo = /*#__PURE__*/ logWithLevel("Info");
21830
22583
  /**
21831
22584
  * Logs one or more messages at the DEBUG level.
21832
22585
  *
@@ -21855,7 +22608,7 @@ const logInfo = /*#__PURE__*/ logWithLevel$1("Info");
21855
22608
  * @category logging
21856
22609
  * @since 2.0.0
21857
22610
  */
21858
- const logDebug = /*#__PURE__*/ logWithLevel$1("Debug");
22611
+ const logDebug = /*#__PURE__*/ logWithLevel("Debug");
21859
22612
  /**
21860
22613
  * Adds a logger to the set of loggers which will output logs for this effect.
21861
22614
  *
@@ -22017,28 +22770,26 @@ const withLogSpan = /*#__PURE__*/ dual(2, (effect, label) => flatMap$2(currentTi
22017
22770
  *
22018
22771
  * **Details**
22019
22772
  *
22020
- * It includes a journal that stores non-committed changes to `TxRef` values and
22021
- * a retry flag that records whether the transaction should be retried.
22773
+ * Nested {@link tx} calls reuse this same service instance. Yield it inside a
22774
+ * transaction body to read {@link TransactionMeta} fields such as `attempt`
22775
+ * and `retryReason`.
22022
22776
  *
22023
- * **Example** (Building transactions)
22777
+ * **Example** (Reading transaction metadata)
22024
22778
  *
22025
22779
  * ```ts import.meta.vitest
22026
22780
  * import { Effect } from "effect"
22027
22781
  *
22028
- * // Transaction class for software transactional memory operations
22029
- * const txEffect = Effect.gen(function*() {
22782
+ * const program = Effect.tx(Effect.gen(function*() {
22030
22783
  * const tx = yield* Effect.Transaction
22031
- * // Use transaction for coordinated state changes
22032
- * return "Transaction complete"
22033
- * })
22784
+ * return [tx.attempt, tx.retryReason, tx.elapsed, tx.elapsedSincePrevious]
22785
+ * }))
22034
22786
  *
22035
- * const runnable = Effect.provideService(txEffect, Effect.Transaction, {
22036
- * retry: false,
22037
- * journal: new Map()
22038
- * })
22039
- * Effect.runSync(runnable) // => "Transaction complete"
22787
+ * Effect.runSync(program) // => [1, undefined, 0, 0]
22040
22788
  * ```
22041
22789
  *
22790
+ * @see {@link tx} for the outermost transaction boundary that creates this service
22791
+ * @see {@link TransactionMeta} for the journal and attempt metadata
22792
+ *
22042
22793
  * @stability stable
22043
22794
  * @category transactions
22044
22795
  * @since 4.0.0
@@ -22092,30 +22843,53 @@ var Transaction = class extends (/*#__PURE__*/ Service()("effect/Effect/Transact
22092
22843
  * @since 4.0.0
22093
22844
  */
22094
22845
  const tx = (effect) => withFiber((fiber) => {
22095
- let state = getOrUndefined(fiber.context, Transaction);
22846
+ const state = getOrUndefined(fiber.context, Transaction);
22096
22847
  if (state && !completedTransactions.has(state)) return effect;
22097
- state = {
22848
+ const clock = fiber.getRef(ClockRef);
22849
+ const now = clock.currentTimeMillisUnsafe();
22850
+ const mutable = {
22098
22851
  journal: /* @__PURE__ */ new Map(),
22099
- retry: false
22852
+ retry: false,
22853
+ attempt: 1,
22854
+ retryReason: void 0,
22855
+ start: now,
22856
+ now,
22857
+ elapsed: 0,
22858
+ elapsedSincePrevious: 0
22100
22859
  };
22101
22860
  let result;
22102
- return uninterruptibleMask((restore) => flatMap(whileLoop({
22103
- while: () => !result,
22104
- body: constant(restore(effect).pipe(provideService(Transaction, state), tapCause((cause) => {
22105
- if (!state.retry) return void_;
22106
- if (!hasInterruptsOnly$1(cause)) return sync(() => clearTransaction(state));
22107
- return restore(awaitPendingTransaction(state));
22108
- }), exit)),
22109
- step(exit) {
22110
- if (state.retry || !isTransactionConsistent(state)) return clearTransaction(state);
22111
- if (isSuccess$1(exit)) commitTransaction(fiber, state);
22112
- clearTransaction(state);
22113
- completedTransactions.add(state);
22114
- result = exit;
22115
- }
22116
- }), () => result));
22861
+ return uninterruptibleMask((restore) => {
22862
+ const run = restore(effect).pipe(provideService(Transaction, mutable), tapCause((cause) => {
22863
+ if (!mutable.retry) return void_;
22864
+ if (!hasInterruptsOnly$1(cause)) return sync(() => clearTransaction(mutable));
22865
+ return restore(awaitPendingTransaction(mutable));
22866
+ }), exit);
22867
+ return flatMap(whileLoop({
22868
+ while: () => !result,
22869
+ body: () => {
22870
+ if (mutable.attempt > 1) stampTransaction(mutable, clock.currentTimeMillisUnsafe());
22871
+ return run;
22872
+ },
22873
+ step(exit) {
22874
+ if (mutable.retry || !isTransactionConsistent(mutable)) {
22875
+ mutable.attempt++;
22876
+ mutable.retryReason = mutable.retry ? "retry" : "conflict";
22877
+ return clearTransaction(mutable);
22878
+ }
22879
+ if (isSuccess$1(exit)) commitTransaction(fiber, mutable);
22880
+ clearTransaction(mutable);
22881
+ completedTransactions.add(mutable);
22882
+ result = exit;
22883
+ }
22884
+ }), () => result);
22885
+ });
22117
22886
  });
22118
22887
  const completedTransactions = /*#__PURE__*/ new WeakSet();
22888
+ const stampTransaction = (state, now) => {
22889
+ state.elapsedSincePrevious = now - state.now;
22890
+ state.now = now;
22891
+ state.elapsed = now - state.start;
22892
+ };
22119
22893
  const isTransactionConsistent = (state) => {
22120
22894
  for (const [ref, { version }] of state.journal) if (ref.version !== version) return false;
22121
22895
  return true;
@@ -22187,7 +22961,8 @@ function clearTransaction(state) {
22187
22961
  * @since 4.0.0
22188
22962
  */
22189
22963
  const txRetry = /*#__PURE__*/ flatMap(Transaction, (state) => {
22190
- state.retry = true;
22964
+ const mutable = state;
22965
+ mutable.retry = true;
22191
22966
  return interrupt;
22192
22967
  });
22193
22968
  /**
@@ -22197,7 +22972,7 @@ const txRetry = /*#__PURE__*/ flatMap(Transaction, (state) => {
22197
22972
  * **Details**
22198
22973
  *
22199
22974
  * The original function is called with the supplied arguments plus a final
22200
- * callback. A non-null callback error fails the returned effect, while a
22975
+ * callback. A truthy callback error fails the returned effect, while a
22201
22976
  * successful callback value becomes the effect success. Use `onError` to map
22202
22977
  * callback errors and `onSyncError` to turn synchronous throws into typed
22203
22978
  * failures; otherwise synchronous throws become defects.
@@ -22244,14 +23019,19 @@ const txRetry = /*#__PURE__*/ flatMap(Transaction, (state) => {
22244
23019
  * @since 4.0.0
22245
23020
  */
22246
23021
  const effectify = (fn, onError, onSyncError) => (...args) => callback((resume) => {
23022
+ let synchronous = true;
23023
+ let pending;
22247
23024
  try {
22248
23025
  fn(...args, (err, result) => {
22249
- if (err) resume(onError ? suspend(() => fail(onError(err, args))) : fail(err));
22250
- else resume(succeed(result));
23026
+ const effect = err ? onError ? suspend(() => fail(onError(err, args))) : fail(err) : succeed(result);
23027
+ if (synchronous) pending ??= effect;
23028
+ else resume(effect);
22251
23029
  });
22252
23030
  } catch (err) {
22253
- resume(onSyncError ? fail(onSyncError(err, args)) : die(err));
23031
+ pending = onSyncError ? fail(onSyncError(err, args)) : die(err);
22254
23032
  }
23033
+ synchronous = false;
23034
+ if (pending) resume(pending);
22255
23035
  });
22256
23036
  /**
22257
23037
  * Applies `map` eagerly when an effect is already resolved.
@@ -22302,6 +23082,9 @@ const mapEager = mapEager$1;
22302
23082
  * transform. Failure effects apply the mapping function immediately, and
22303
23083
  * pending effects fall back to regular `mapError` behavior.
22304
23084
  *
23085
+ * Maps every typed error in the cause, preserving defects, interrupts and
23086
+ * reason order. Unlike typed recovery, mapping does not convert errors to defects.
23087
+ *
22305
23088
  * **Example** (Mapping errors eagerly when possible)
22306
23089
  *
22307
23090
  * ```ts import.meta.vitest
@@ -22345,6 +23128,9 @@ const mapErrorEager = mapErrorEager$1;
22345
23128
  * `onFailure` immediately. Pending effects fall back to regular `mapBoth`
22346
23129
  * behavior.
22347
23130
  *
23131
+ * Maps every typed error in the cause, preserving defects, interrupts and
23132
+ * reason order. Unlike typed recovery, mapping does not convert errors to defects.
23133
+ *
22348
23134
  * **Example** (Mapping both channels eagerly when possible)
22349
23135
  *
22350
23136
  * ```ts import.meta.vitest
@@ -22426,6 +23212,12 @@ const flatMapEager = flatMapEager$1;
22426
23212
  * Failure effects apply the catch function immediately, and pending effects
22427
23213
  * fall back to regular `catch` behavior.
22428
23214
  *
23215
+ * **Gotchas**
23216
+ *
23217
+ * If the cause contains a defect, the handler is skipped and every typed error
23218
+ * is converted to a defect, preserving reason order and interrupts. An
23219
+ * interruption alongside a typed error does not prevent recovery.
23220
+ *
22429
23221
  * **Example** (Catching failures eagerly when possible)
22430
23222
  *
22431
23223
  * ```ts import.meta.vitest
@@ -22473,6 +23265,8 @@ const catchEager = catchEager$1;
22473
23265
  *
22474
23266
  * Executes generator functions eagerly when all yielded effects are synchronous,
22475
23267
  * stopping at the first async effect and deferring to normal execution.
23268
+ * Additional arguments after the generator body act like `pipe` transforms, and
23269
+ * `{ self }` before the body binds `this`, as with {@link fnUntraced}.
22476
23270
  *
22477
23271
  * **Example** (Defining eager untraced effect functions)
22478
23272
  *
@@ -22494,6 +23288,6 @@ const catchEager = catchEager$1;
22494
23288
  * @since 4.0.0
22495
23289
  */
22496
23290
  const fnUntracedEager = fnUntracedEager$1;
22497
- export { forEach as $, fiberInterruptAllAs as $a, make$6 as $c, done$1 as $i, hasProperty as $l, has as $n, isZero as $o, addFinalizerExit as $r, reduce as $s, runPromise as $t, currentSpan as A, CurrentLoggers as Aa, getOrNull as Ac, asVoidAll as Ai, symbolRedactable as Al, updateContext as An, DisablePropagation as Ao, currentTimeNanos as Ar, appendAll as As, matchEffect as At, memoize as Au, filter as B, effectIsExit as Ba, none as Bc, match$1 as Bi, makeCompareMap as Bl, withParentSpan as Bn, Scheduler as Bo, launch as Br, fromIterable$1 as Bs, promise as Bt, catchTag as C, map$1 as Ca, firstSomeOf as Cc, isDeferred as Ci, toJson as Cl, tryPromise as Cn, sync$2 as Co, isDoneCause as Cr, make$5 as Cs, mapBothEager as Ct, constTrue as Cu, context as D, squash as Da, fromNullishOr$1 as Dc, makeUnsafe$1 as Di, formatPath as Dl, undefined_ as Dn, void_$2 as Do, Clock as Dr, Prototype as Ds, match as Dt, dual as Du, clockWith as E, reasonAnnotations as Ea, fromNullOr as Ec, make$2 as Ei, formatJson as El, txRetry as En, updateContext$1 as Eo, nextBetween as Er, omit as Es, mapErrorEager as Et, constant as Eu, exit as F, callback$1 as Fa, isSome as Fc, hasInterrupts as Fi, Array_ as Fl, withErrorReporting as Fn, externalSpan as Fo, catch_$1 as Fr, findFirst$2 as Fs, onInterrupt as Ft, pipeArguments as Fu, findFirst as G, exitVoid as Ga, Date$1 as Gc, IllegalArgumentError as Gi, hash as Gl, zip as Gn, format as Go, succeed$1 as Gr, isReadonlyArrayNonEmpty as Gs, race as Gt, filterMapOrFail as H, exitHasInterrupts as Ha, some as Hc, void_$1 as Hi, symbol as Hl, withTracer as Hn, has$1 as Ho, mergeAll as Hr, isArray as Hs, provideContext as Ht, fail as I, causeInterrupt as Ia, liftThrowable as Ic, interrupt$1 as Ii, Tuple as Il, withFiber as In, make$3 as Io, effect as Ir, findFirstIndex as Is, option as It, flatMapEager as J, fiberAwaitAll as Ja, flip as Jc, TimeoutError as Ji, string as Jl, Class as Jn, hours as Jo, sync$1 as Jr, makeBy as Js, request as Jt, firstSuccessOf as K, exitZipRight as Ka, Number$1 as Kc, NoSuchElementError as Ki, number as Kl, zipWith as Kn, fromInput as Ko, succeedContext as Kr, last as Ks, raceFirst as Kt, failCause as L, causePretty as La, makeOrder as Lc, isExit as Li, make$7 as Ll, withFiberSucceed as Ln, nativeTracer as Lo, effectContext as Lr, findLast as Ls, orDie as Lt, die as M, andThen$1 as Ma, getOrUndefined$2 as Mc, fail$2 as Mi, assignProperty as Ml, void_ as Mn, NativeSpan as Mo, CurrentMemoMap as Mr, ensure as Ms, onError as Mt, pipe as Mu, effectify as N, as$1 as Na, isNone as Nc, failCause$2 as Ni, normalize as Nl, when as Nn, ParentSpan as No, build as Nr, filter$2 as Ns, onExit as Nt, Class$2 as Nu, contextWith as O, ClockRef as Oa, fromUndefinedOr as Oc, poll as Oi, formatPropertyKey as Ol, uninterruptible as On, whileLoop$1 as Oo, clockWith$1 as Or, allocate as Os, matchCauseEffect as Ot, flow as Ou, ensuring as P, asSome$1 as Pa, isOption as Pc, findErrorOption as Pi, normalizeNonEmpty as Pl, whileLoop as Pn, Tracer as Po, buildWithMemoMap as Pr, filterMap as Ps, onExitPrimitive as Pt, Prototype$1 as Pu, fnUntracedEager as Q, fiberInterruptAll as Qa, isLessThanOrEqualTo$1 as Qc, die$3 as Qi, compose$1 as Ql, get as Qn, isNegative as Qo, addFinalizer$1 as Qr, of as Qs, runForkWith as Qt, failCauseSync as R, consolePretty as Ra, map$5 as Rc, isFailure as Ri, strictEqual as Rl, withLogSpan as Rn, encode as Ro, effectDiscard as Rr, flatMap$3 as Rs, orElseSucceed as Rt, catchReason as S, makeInterruptReason as Sa, filter$3 as Sc, into as Si, NodeInspectSymbol as Sl, timeoutOrElse as Sn, suspend$2 as So, filterDone as Sr, getUnsafe as Ss, map as St, constFalse as Su, catch_ as T, prettyErrors as Ta, flatten$3 as Tc, isDoneUnsafe as Ti, formatDate as Tl, tx as Tn, uninterruptibleMask$1 as To, Random as Tr, merge$1 as Ts, mapError as Tt, constVoid as Tu, filterOrElse as U, exitInterrupt as Ua, toArray as Uc, Done as Ui, array as Ul, withTracerEnabled as Un, toPredicate as Uo, provide$2 as Ur, isArrayNonEmpty as Us, provideService as Ut, filterMapEffect as V, endSpan as Va, orElse as Vc, succeed$3 as Vi, makeCompareSet as Vl, withSpan as Vn, compose as Vo, merge as Vr, getUnsafe$1 as Vs, provide as Vt, filterOrFail as W, exitIsSuccess as Wa, BigInt$1 as Wc, ExceededCapacityError as Wi, combine$1 as Wl, yieldNow as Wn, days as Wo, provideMerge as Wr, isCanonicalArrayIndex as Ws, provideServiceEffect as Wt, fn as X, fiberEnterUninterruptibleUnsafe as Xa, isGreaterThanOrEqualTo as Xc, annotate as Xi, structureKeys as Xl, clear as Xn, isDuration as Xo, unwrap as Xr, map$3 as Xs, retry as Xt, flatten as Y, fiberEnterInterruptibleUnsafe as Ya, isGreaterThan as Yc, UnknownError as Yi, structure as Yl, RequestPrototype as Yn, infinity as Yo, tap$1 as Yr, makeEquivalence as Ys, result as Yt, fnUntraced as Z, fiberInterrupt as Za, isLessThan as Zc, combine as Zi, symbol$1 as Zl, empty as Zn, isFinite as Zo, Scope as Zr, match$4 as Zs, runFork as Zt, catchCauseIf as _, isNoSuchElementError as _a, match$5 as _c, done as _i, withFiber$1 as _l, tapDefect as _n, resolveConcurrency as _o, toStep as _r, get$1 as _s, logFatal as _t, isUnknown as _u, all as a, fromReasons as aa, headUnsafe as ac, makeUnsafe as ai, TaggedError as al, scoped as an, forkUnsafe$1 as ao, CurrentMetadata as ar, negativeInfinity as as, fromOption as at, isNotNull as au, catchFilter as b, makeDieReason as ba, contains as bc, failCause$1 as bi, BaseProto as bl, timeout as bn, succeedNone$1 as bo, catchDone as br, getOrUndefined as bs, logWithLevel as bt, cast as bu, annotateLogs as c, hasInterrupts$1 as ca, failVoid as cc, CurrentLogLevel as ci, contA as cl, serviceOption as cn, iterateEager as co, forever$1 as cr, times as cs, ignore as ct, isNullish as cu, asSome as d, interruptors as da, getOrUndefined$1 as dc, MinimumLogLevel as di, exitFail as dl, succeedNone as dn, makeLatchUnsafe as do, isSchedule as dr, toSeconds as ds, interruptible as dt, isObjectKeyword as du, fail$3 as ea, reverse as ec, close as ei, mapInput as el, runPromiseWith as en, fiberInterruptAs as eo, make as er, max as es, forever as et, isBigInt as eu, asVoid as f, isCause as fa, isFailure$1 as fc, TracerEnabled as fi, exitFailCause as fl, succeedSome as fn, makeSpanUnsafe as fo, jittered as fr, zero as fs, isEffect as ft, isPropertyKey as fu, catchCause as g, isInterruptReason as ga, mapError$2 as gc, die$1 as gi, makePrimitive as gl, tapCause as gn, reportCauseUnsafe as go, spaced as gr, empty$2 as gs, logError as gt, isUndefined as gu, callback as h, isFailReason as ha, map$4 as hc, _await as hi, isExit$1 as hl, tap as hn, onExitUnsafe as ho, setInputType as hr, add as hs, logDebug as ht, isTagged as hu, addFinalizer as i, findFail as ia, filterMap$1 as ic, make$1 as ii, PipeInspectableProto as il, scope as in, fnUntraced$1 as io, values as ir, nanos as is, forkScoped as it, isNever as iu, delay as j, LogLevelOrder as ja, getOrThrow$1 as jc, die$2 as ji, assignProperties as jl, useSpan as jn, MinimumTraceLevel as jo, monotonicTimeNanos as jr, empty$3 as js, never as jt, memoizeIdempotent as ju, currentParentSpan as k, ConsoleRef as ka, getOrElse$2 as kc, succeed$2 as ki, redact as kl, uninterruptibleMask as kn, CurrentErrorReporters as ko, currentTimeMillis as kr, append as ks, matchCauseEffectEager as kt, identity as ku, annotateLogsScoped as l, hasInterruptsOnly as la, flatMap$4 as lc, CurrentLogSpans as li, contE as ll, sleep as ln, loggerMake as lo, fromStep as lr, toMillis as ls, ignoreCause as lt, isNumber as lu, cachedInvalidateWithTTL as m, isDone$1 as ma, isSuccess$3 as mc, UnhandledLogLevel as mi, isEffect$1 as ml, sync as mn, onExitPrimitive$1 as mo, passthrough as mr, Service as ms, log as mt, isString as mu, acquireRelease as n, findError as na, take as nc, fork as ni, Done$1 as nl, runSyncExit as nn, fiberRunIn as no, set as nr, min as ns, forkDetach as nt, isError as nu, andThen as o, hasDies as oa, all$2 as oc, provide$3 as oi, args as ol, scopedWith as on, getCurrentFiber as oo, addDelay as or, seconds as os, fromResult as ot, isNotNullish as ou, cached as p, isDieReason as pa, isResult as pc, TracerTimingEnabled as pi, exitSucceed as pl, suspend as pn, map$2 as po, modifyDelay as pr, Reference as ps, isSuccess as pt, isReadonlyObject as pu, flatMap as q, fiberAwait as qa, String$1 as qc, StackTrace as qi, optimize as ql, equalBatchKeys as qn, fromInputUnsafe as qo, suspend$1 as qr, lastNonEmpty as qs, repeat as qt, acquireUseRelease as r, findErrorOption$1 as ra, empty$4 as rc, forkUnsafe as ri, Error$1 as rl, runSyncWith as rn, flatMap$2 as ro, size as rr, minutes as rs, forkIn as rt, isFunction as ru, annotateCurrentSpan as s, hasFails as sa, fail$5 as sc, CurrentLogAnnotations as si, causeFail as sl, service as sn, iterateConcurrent as so, exponential as sr, sum as ss, gen as st, isNotUndefined as su, Transaction as t, filterInterruptors as ta, sort as tc, closeUnsafe as ti, min$1 as tl, runSync as tn, fiberJoin as to, remove as tr, millis as ts, forkChild as tt, isBoolean as tu, as as u, interrupt$2 as ua, getOrThrow as uc, CurrentStackFrame as ui, evaluate as ul, succeed as un, makeLatch as uo, identity_ as ur, toMinutes as us, interrupt as ut, isObject as uu, catchDefect as v, isReason as va, succeed$5 as vc, doneUnsafe as vi, getStackTraceLimit as vl, tapError as vn, structuredMessage as vo, toStepWithMetadata as vr, getOption as vs, logInfo as vt, or as vu, catchTags as w, pretty as wa, flatMap$5 as wc, isDone as wi, format$1 as wl, try_ as wn, tracerLogger as wo, matchEffect$1 as wr, makeUnsafe$2 as ws, mapEager as wt, constUndefined as wu, catchIf as x, makeFailReason as xa, exists as xc, interruptWith as xi, Class$1 as xl, timeoutOption as xn, succeedSome$1 as xo, doneExitFromCause as xr, getOrUndefinedUnsafe as xs, makeSpanScoped as xt, compose$2 as xu, catchEager as y, isTimeoutError as ya, try_$2 as yc, fail$1 as yi, setStackTraceLimit as yl, tapErrorTag as yn, succeed$4 as yo, upTo as yr, getOrElse as ys, logWarning as yt, backEdges as yu, fiber as z, contextWith$1 as za, match$6 as zc, isSuccess$1 as zi, equals$1 as zl, withLogger as zn, random as zo, empty$1 as zr, flatMapNullishOr as zs, partition as zt };
23291
+ export { fnUntracedEager as $, fiberInterruptAs as $a, orElse as $c, fail$3 as $i, equals$1 as $l, get as $n, has$1 as $o, addFinalizerExit as $r, isArray as $s, runForkWith as $t, currentSpan as A, LogLevelOrder as Aa, try_$2 as Ac, die$2 as Ai, setStackTraceLimit as Al, uninterruptibleMask as An, void_$2 as Ao, monotonicTimeNanos as Ar, getOrElse as As, matchCauseEffectEager as At, isUndefined as Au, fiber as B, endSpan as Ba, getOrElse$2 as Bc, succeed$3 as Bi, currentFiberTypeId as Bl, withLogger as Bn, make$3 as Bo, launch as Br, append as Bs, partition as Bt, constant as Bu, catchTag as C, pretty as Ca, isFailure$1 as Cc, isDone as Ci, exitFailCause as Cl, timeoutOrElse as Cn, succeedNone$1 as Co, isDoneCause as Cr, zero as Cs, mapBoth as Ct, isNumber as Cu, context as D, ClockRef as Da, mapError$2 as Dc, poll as Di, makePrimitive as Dl, txRetry as Dn, tracerLogger as Do, clockWith$1 as Dr, empty$2 as Ds, mapErrorEager as Dt, isReadonlyObject as Du, clockWith as E, squash as Ea, map$4 as Ec, makeUnsafe$1 as Ei, isExit$1 as El, tx as En, sync$2 as Eo, Clock as Er, add as Es, mapError as Et, isPropertyKey as Eu, exit as F, causeInterrupt as Fa, flatMap$5 as Fc, interrupt$1 as Fi, format$1 as Fl, whileLoop as Fn, MinimumTraceLevel as Fo, effect as Fr, makeUnsafe$2 as Fs, onExitPrimitive as Ft, compose$2 as Fu, filterOrFail as G, exitZipRight as Ga, isNone as Gc, NoSuchElementError as Gi, normalize as Gl, yieldNow as Gn, EncodingError as Go, succeed$1 as Gr, filterMap as Gs, provideServiceEffect as Gt, memoizeIdempotent as Gu, filterMapEffect as H, exitInterrupt as Ha, getOrThrow$1 as Hc, Done as Hi, symbolRedactable as Hl, withSpan as Hn, decode as Ho, mergeAll as Hr, empty$3 as Hs, provide as Ht, flow as Hu, fail as I, causePretty as Ia, flatten$3 as Ic, isExit as Ii, formatDate as Il, withErrorReporting as In, NativeSpan as Io, effectContext as Ir, merge$1 as Is, onInterrupt as It, constFalse as Iu, flatMap as J, fiberEnterInterruptibleUnsafe as Ja, liftThrowable as Jc, UnknownError as Ji, Tuple as Jl, equalBatchKeys as Jn, TaggedClass as Jo, sync$1 as Jr, findLast as Js, repeat as Jt, Prototype$1 as Ju, findFirst as K, fiberAwait as Ka, isOption as Kc, StackTrace as Ki, normalizeNonEmpty as Kl, zip as Kn, Class$1 as Ko, succeedContext as Kr, findFirst$2 as Ks, race as Kt, pipe as Ku, failCause as L, consolePretty as La, fromNullOr as Lc, isFailure as Li, formatJson as Ll, withFiber as Ln, ParentSpan as Lo, effectDiscard as Lr, omit as Ls, option as Lt, constTrue as Lu, die as M, as$1 as Ma, exists as Mc, failCause$2 as Mi, Class$2 as Ml, useSpan as Mn, CurrentErrorReporters as Mo, build as Mr, getOrUndefinedUnsafe as Ms, never as Mt, or as Mu, effectify as N, asSome$1 as Na, filter$3 as Nc, findErrorOption as Ni, NodeInspectSymbol as Nl, void_ as Nn, TracerTimingEnabled$1 as No, buildWithMemoMap as Nr, getUnsafe as Ns, onError as Nt, backEdges as Nu, contextWith as O, ConsoleRef as Oa, match$5 as Oc, succeed$2 as Oi, withFiber$1 as Ol, undefined_ as On, uninterruptibleMask$1 as Oo, currentTimeMillis as Or, get$1 as Os, match as Ot, isString as Ou, ensuring as P, callback$1 as Pa, firstSomeOf as Pc, hasInterrupts as Pi, toJson as Pl, when as Pn, DisablePropagation as Po, catch_$1 as Pr, make$5 as Ps, onExit as Pt, cast as Pu, fnUntraced as Q, fiberInterruptAllAs as Qa, none as Qc, done$1 as Qi, byReferenceUnsafe as Ql, empty as Qn, compose as Qo, addFinalizer$1 as Qr, getUnsafe$1 as Qs, runFork as Qt, failCauseSync as R, contextWith$1 as Ra, fromNullishOr$1 as Rc, isSuccess$1 as Ri, formatPath as Rl, withFiberSucceed as Rn, Tracer as Ro, empty$1 as Rr, Prototype as Rs, orDie as Rt, constUndefined as Ru, catchReason as S, map$1 as Sa, getOrUndefined$1 as Sc, isDeferred as Si, exitFail as Sl, timeoutOption as Sn, succeed$4 as So, filterDone as Sr, toSeconds as Ss, map as St, isNullish as Su, catch_ as T, reasonAnnotations as Ta, isSuccess$3 as Tc, make$2 as Ti, isEffect$1 as Tl, try_ as Tn, suspend$2 as To, Random as Tr, Service as Ts, mapEager as Tt, isObjectKeyword as Tu, filterMapOrFail as U, exitIsSuccess as Ua, getOrThrowWith$1 as Uc, ExceededCapacityError as Ui, assignProperties as Ul, withTracer as Un, encode as Uo, provide$2 as Ur, ensure as Us, provideContext as Ut, identity as Uu, filter as V, exitHasInterrupts as Va, getOrNull as Vc, void_$1 as Vi, redact as Vl, withParentSpan as Vn, nativeTracer as Vo, merge as Vr, appendAll as Vs, promise as Vt, dual as Vu, filterOrElse as W, exitVoid as Wa, getOrUndefined$2 as Wc, IllegalArgumentError as Wi, assignProperty as Wl, withTracerEnabled as Wn, random as Wo, provideMerge as Wr, filter$2 as Ws, provideService as Wt, memoize as Wu, flatten as X, fiberInterrupt as Xa, map$5 as Xc, combine as Xi, strictEqual as Xl, RequestPrototype as Xn, taggedEnum as Xo, unwrap as Xr, flatMapNullishOr as Xs, result as Xt, flatMapEager as Y, fiberEnterUninterruptibleUnsafe as Ya, makeOrder as Yc, annotate as Yi, make$7 as Yl, Class as Yn, TaggedError as Yo, tap$1 as Yr, flatMap$3 as Ys, request as Yt, pipeArguments as Yu, fn as Z, fiberInterruptAll as Za, match$6 as Zc, die$3 as Zi, asEquivalence as Zl, clear as Zn, Scheduler as Zo, Scope as Zr, fromIterable$1 as Zs, retry as Zt, catchCauseIf as _, isReason as _a, all$2 as _c, doneUnsafe as _i, args as _l, tapCause as _n, reportCauseUnsafe as _o, toStep as _r, seconds as _s, logError as _t, isFunction as _u, all as a, hasDies as aa, makeBy as ac, makeUnsafe as ai, String$1 as al, scope as an, forkUnsafe$1 as ao, CurrentMetadata as ar, hours as as, forkScoped as at, hash as au, catchFilter as b, makeFailReason as ba, flatMap$4 as bc, interruptWith as bi, contE as bl, tapErrorTag as bn, scopeAddFinalizer as bo, catchDone as br, toMillis as bs, logWarning as bt, isNotNullish as bu, annotateLogs as c, hasInterruptsOnly as ca, match$4 as cc, CurrentLogLevel as ci, isGreaterThanOrEqualTo as cl, service as cn, iterateConcurrent as co, forever$1 as cr, isFinite as cs, gen as ct, string as cu, asSome as d, isCause as da, reverse as dc, MinimumLogLevel as di, make$6 as dl, succeed as dn, makeLatch as do, isSchedule as dr, max as ds, interrupt as dt, symbol$1 as du, filterInterruptors as ea, isArrayNonEmpty as ec, close as ei, some as el, runPromise as en, fiberJoin as eo, has as er, toPredicate as es, forEach as et, makeCompareMap as eu, asVoid as f, isDieReason as fa, sort as fc, TracerEnabled as fi, mapInput as fl, succeedNone as fn, makeLatchUnsafe as fo, jittered as fr, millis as fs, interruptible as ft, compose$1 as fu, catchCause as g, isNoSuchElementError as ga, headUnsafe as gc, done as gi, PipeInspectableProto as gl, tap as gn, onExitUnsafe as go, spaced as gr, negativeInfinity as gs, logDebug as gt, isError as gu, callback as h, isInterruptReason as ha, filterMap$1 as hc, die$1 as hi, Error$2 as hl, sync as hn, onExitPrimitive$1 as ho, setInputType as hr, nanos as hs, log as ht, isBoolean as hu, addFinalizer as i, fromReasons as ia, lastNonEmpty as ic, make$1 as ii, Number$1 as il, runSyncWith as in, fnUntraced$1 as io, size as ir, fromInputUnsafe as is, forkIn as it, combine$1 as iu, delay as j, andThen$1 as ja, contains as jc, fail$2 as ji, BaseProto as jl, updateContext as jn, whileLoop$1 as jo, CurrentMemoMap as jr, getOrUndefined as js, matchEffect as jt, isUnknown as ju, currentParentSpan as k, CurrentLoggers as ka, succeed$5 as kc, asVoidAll as ki, getStackTraceLimit as kl, uninterruptible as kn, updateContext$1 as ko, currentTimeNanos as kr, getOption as ks, matchCauseEffect as kt, isTagged as ku, annotateLogsScoped as l, interrupt$2 as la, of as lc, CurrentLogSpans as li, isLessThan as ll, serviceOption as ln, iterateEager as lo, fromStep as lr, isNegative as ls, ignore as lt, structure as lu, cachedInvalidateWithTTL as m, isFailReason as ma, empty$4 as mc, _await as mi, Done$1 as ml, suspend as mn, map$2 as mo, passthrough as mr, minutes as ms, isSuccess as mt, isBigInt as mu, acquireRelease as n, findErrorOption$1 as na, isReadonlyArrayNonEmpty as nc, fork as ni, BigInt$1 as nl, runSync as nn, findRecoverableError as no, remove as nr, format as ns, forkChild as nt, symbol as nu, andThen as o, hasFails as oa, makeEquivalence as oc, provide$3 as oi, flip as ol, scoped as on, getCurrentFiber as oo, addDelay as or, infinity as os, fromOption as ot, number as ou, cached as p, isDone$1 as pa, take as pc, TracerTimingEnabled as pi, min$1 as pl, succeedSome as pn, makeSpanUnsafe as po, modifyDelay as pr, min as ps, isEffect as pt, hasProperty as pu, firstSuccessOf as q, fiberAwaitAll as qa, isSome as qc, TimeoutError as qi, Array_ as ql, zipWith as qn, Error$1 as qo, suspend$1 as qr, findFirstIndex as qs, raceFirst as qt, Class$3 as qu, acquireUseRelease as r, findFail as ra, last as rc, forkUnsafe as ri, Date$1 as rl, runSyncExit as rn, flatMap$2 as ro, set as rr, fromInput as rs, forkDetach as rt, array as ru, annotateCurrentSpan as s, hasInterrupts$1 as sa, map$3 as sc, CurrentLogAnnotations as si, isGreaterThan as sl, scopedWith as sn, ignoreCauseLogger as so, exponential as sr, isDuration as ss, fromResult as st, optimize as su, Transaction as t, findError as ta, isCanonicalArrayIndex as tc, closeUnsafe as ti, toArray as tl, runPromiseWith as tn, fiberRunIn as to, make as tr, days as ts, forever as tt, makeCompareSet as tu, as as u, interruptors as ua, reduce as uc, CurrentStackFrame as ui, isLessThanOrEqualTo$1 as ul, sleep as un, loggerMake as uo, identity_ as ur, isZero as us, ignoreCause as ut, structureKeys as uu, catchDefect as v, isTimeoutError as va, fail$5 as vc, fail$1 as vi, causeFail as vl, tapDefect as vn, resolveConcurrency as vo, toStepWithMetadata as vr, sum as vs, logFatal as vt, isNever as vu, catchTags as w, prettyErrors as wa, isResult as wc, isDoneUnsafe as wi, exitSucceed as wl, tryPromise as wn, succeedSome$1 as wo, matchEffect$1 as wr, Reference as ws, mapBothEager as wt, isObject as wu, catchIf as x, makeInterruptReason as xa, getOrThrow as xc, into as xi, evaluate as xl, timeout as xn, structuredMessage as xo, doneExitFromCause as xr, toMinutes as xs, makeSpanScoped as xt, isNotUndefined as xu, catchEager as y, makeDieReason as ya, failVoid as yc, failCause$1 as yi, contA as yl, tapError as yn, scope$1 as yo, upTo as yr, times as ys, logInfo as yt, isNotNull as yu, failSync as z, effectIsExit as za, fromUndefinedOr as zc, match$1 as zi, formatPropertyKey as zl, withLogSpan as zn, externalSpan as zo, fresh as zr, allocate as zs, orElseSucceed as zt, constVoid as zu };
22498
23292
 
22499
- //# sourceMappingURL=Effect-BqRgldaH.mjs.map
23293
+ //# sourceMappingURL=Effect-BrI3bavz.mjs.map