@das-org/dascode 0.0.31

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 (514) hide show
  1. package/dist/BunHttpServer-YBQwrNiq.mjs +407 -0
  2. package/dist/BunPtyAdapter--Swo7U5P.mjs +120 -0
  3. package/dist/BunServices-RIDbItx-.mjs +115 -0
  4. package/dist/Cache-DyGeujxI.mjs +605 -0
  5. package/dist/Config-DcF-IZjO.mjs +1274 -0
  6. package/dist/FetchHttpClient-BmjpVs1I.mjs +5976 -0
  7. package/dist/NodePtyAdapter-H8kyf9St.mjs +115 -0
  8. package/dist/NodeServices-D8d9bE2V.mjs +152 -0
  9. package/dist/NodeSqliteClient-CmuXRT3w.mjs +178 -0
  10. package/dist/NodeTerminal-C6yhrF1E.mjs +1813 -0
  11. package/dist/Path-BB53LP8h.mjs +9050 -0
  12. package/dist/PtyAdapter-mAqTlv3d.mjs +60 -0
  13. package/dist/Schema-DuQUv9rO.mjs +33744 -0
  14. package/dist/SqlClient-Dp5XVCmr.mjs +922 -0
  15. package/dist/SqlError-D49f1UD-.mjs +409 -0
  16. package/dist/SqliteClient-DEcJdONi.mjs +147 -0
  17. package/dist/bin.mjs +201961 -0
  18. package/dist/client/assets/ChatView-HZc6-lKr.js +60 -0
  19. package/dist/client/assets/ClientOnly-FoswohdZ.js +2 -0
  20. package/dist/client/assets/CompositeRoot-Yff66Zmm.js +2 -0
  21. package/dist/client/assets/ConnectCliAuthSurface-BLD0XNSi.js +2 -0
  22. package/dist/client/assets/DiffDisplayControls-DsQS9IDw.js +1403 -0
  23. package/dist/client/assets/DiffPanel-DnIRg_Qy.js +98 -0
  24. package/dist/client/assets/DiffWorkerPoolProvider-DZJfC5kN.js +2 -0
  25. package/dist/client/assets/FieldControl-CuSMRkbi.js +2 -0
  26. package/dist/client/assets/FieldItemContext-Ba7ZZoDN.js +2 -0
  27. package/dist/client/assets/FilePreviewPanel-D3bq1Own.js +2220 -0
  28. package/dist/client/assets/KeybindingsSettings.logic-BQBQ8pFk.js +2 -0
  29. package/dist/client/assets/LocalAnnotatableCodeView-BS3qlDRM.js +2 -0
  30. package/dist/client/assets/PreviewPanel-C41OCDV3.js +2 -0
  31. package/dist/client/assets/ProviderModelPicker-BcQ3CMKb.js +2 -0
  32. package/dist/client/assets/PullRequestMarkdown-D5bDuXWN.js +2 -0
  33. package/dist/client/assets/RedactedSensitiveText-C3lDjv-5.js +2 -0
  34. package/dist/client/assets/ReviewActionsPanel-7rqPggzL.js +2 -0
  35. package/dist/client/assets/ReviewDiffWorkerPoolBoundary-CpqNaHWe.js +2 -0
  36. package/dist/client/assets/ReviewDiffWorkerSurface-fGPW1-P9.js +2 -0
  37. package/dist/client/assets/ReviewPatchView-Dt3GW4pP.js +4 -0
  38. package/dist/client/assets/Schema-DzLI5hMK.js +16 -0
  39. package/dist/client/assets/ServerUpdateAction-N9rNsTaN.js +2 -0
  40. package/dist/client/assets/SettingsPanels-DgK9Gy4R.js +3 -0
  41. package/dist/client/assets/SymbolsNerdFontMono-Regular-aK5vsLov.woff2 +0 -0
  42. package/dist/client/assets/WorkerPoolContext-BG9CEDyi.js +15 -0
  43. package/dist/client/assets/_chat-CDYErsvF.js +2 -0
  44. package/dist/client/assets/_chat._environmentId._threadId-Dn7yzuy5.js +2 -0
  45. package/dist/client/assets/_chat.draft._draftId-CKnp5OeX.js +2 -0
  46. package/dist/client/assets/_chat.index-CSOaDOiG.js +2 -0
  47. package/dist/client/assets/abap-CLvhMVsD.js +2 -0
  48. package/dist/client/assets/actionscript-3--17pq3dv.js +2 -0
  49. package/dist/client/assets/ada-C5qYipkI.js +2 -0
  50. package/dist/client/assets/alert-dialog-0GbcUK1u.js +2 -0
  51. package/dist/client/assets/andromeeda-WkhI09AS.js +2 -0
  52. package/dist/client/assets/andromeeda-vGVdxbeo.js +2 -0
  53. package/dist/client/assets/angular-html-BmcYSFCP.js +2 -0
  54. package/dist/client/assets/angular-ts-Ab3z1XOh.js +2 -0
  55. package/dist/client/assets/apache-U0d_L8uA.js +2 -0
  56. package/dist/client/assets/apex-VAyPSnFM.js +2 -0
  57. package/dist/client/assets/apl-DdAjc1Is.js +2 -0
  58. package/dist/client/assets/applescript-CCn79oCD.js +2 -0
  59. package/dist/client/assets/ara-4CJ0cIlV.js +2 -0
  60. package/dist/client/assets/asciidoc-DE70LPWp.js +2 -0
  61. package/dist/client/assets/asm-Cmm7eHzH.js +2 -0
  62. package/dist/client/assets/astro-jyGOnYUN.js +2 -0
  63. package/dist/client/assets/aurora-x-C7CFqhAd.js +2 -0
  64. package/dist/client/assets/aurora-x-CDeNXAV0.js +2 -0
  65. package/dist/client/assets/awk-BWXHIvNe.js +2 -0
  66. package/dist/client/assets/ayu-dark-CRu61w6_.js +2 -0
  67. package/dist/client/assets/ayu-dark-DluEY0Gj.js +2 -0
  68. package/dist/client/assets/ayu-light-C3h-C4tm.js +2 -0
  69. package/dist/client/assets/ayu-light-Dn6O_aYR.js +2 -0
  70. package/dist/client/assets/ayu-mirage-Bqwy1Gya.js +2 -0
  71. package/dist/client/assets/ayu-mirage-CTjYAbs-.js +2 -0
  72. package/dist/client/assets/ballerina-B7ZEbQpA.js +2 -0
  73. package/dist/client/assets/bat-Bo4NYOV-.js +2 -0
  74. package/dist/client/assets/beancount-D-usSTwE.js +2 -0
  75. package/dist/client/assets/berry-DKpUyyne.js +2 -0
  76. package/dist/client/assets/bibtex-Ci_nEsc7.js +2 -0
  77. package/dist/client/assets/bicep-CUHmPFLl.js +2 -0
  78. package/dist/client/assets/bird2-C6vDhewU.js +2 -0
  79. package/dist/client/assets/blade-C4dPlbVG.js +2 -0
  80. package/dist/client/assets/branding-DWKqECp7.js +2 -0
  81. package/dist/client/assets/bsl-BkkzgIyY.js +2 -0
  82. package/dist/client/assets/c-DtlEA5ZX.js +2 -0
  83. package/dist/client/assets/c3-BFHwR3_K.js +2 -0
  84. package/dist/client/assets/cadence-CQ2zXKGN.js +2 -0
  85. package/dist/client/assets/cairo-DLTphjLi.js +2 -0
  86. package/dist/client/assets/catppuccin-frappe-3VR1Za6u.js +2 -0
  87. package/dist/client/assets/catppuccin-frappe-DFlFW5gh.js +2 -0
  88. package/dist/client/assets/catppuccin-latte-CpxdcXpJ.js +2 -0
  89. package/dist/client/assets/catppuccin-latte-DwIHMF0Q.js +2 -0
  90. package/dist/client/assets/catppuccin-macchiato-DIdIQ04K.js +2 -0
  91. package/dist/client/assets/catppuccin-macchiato-DYnBP6_5.js +2 -0
  92. package/dist/client/assets/catppuccin-mocha-Co3Xjl64.js +2 -0
  93. package/dist/client/assets/catppuccin-mocha-DYhrFGRu.js +2 -0
  94. package/dist/client/assets/checkbox-Cuif7tF0.js +2 -0
  95. package/dist/client/assets/circle-x-F0441fqg.js +2 -0
  96. package/dist/client/assets/clarity-SemFz856.js +2 -0
  97. package/dist/client/assets/clojure-DqKBuwfJ.js +2 -0
  98. package/dist/client/assets/cmake-Bj61d0ZC.js +2 -0
  99. package/dist/client/assets/cobol-X9aU3UsG.js +2 -0
  100. package/dist/client/assets/codeowners-C8r90Shi.js +2 -0
  101. package/dist/client/assets/codeql-oeQT6MSM.js +2 -0
  102. package/dist/client/assets/coffee-BluyIHgc.js +2 -0
  103. package/dist/client/assets/combobox-D0sqVdtm.js +2 -0
  104. package/dist/client/assets/common-lisp-Cv5bFMCO.js +2 -0
  105. package/dist/client/assets/compiler-runtime-CUwoe8mk.js +2 -0
  106. package/dist/client/assets/connect-CshPrK5J.js +2 -0
  107. package/dist/client/assets/connect_.callback-1fxfJdnn.js +2 -0
  108. package/dist/client/assets/coq-BrsZFFmf.js +2 -0
  109. package/dist/client/assets/cpp-BAWTDsD2.js +2 -0
  110. package/dist/client/assets/crystal-DEAezpUc.js +2 -0
  111. package/dist/client/assets/csharp-oqKa8noW.js +2 -0
  112. package/dist/client/assets/css-ZG5tpaE7.js +2 -0
  113. package/dist/client/assets/csv-Dx-8-gkx.js +2 -0
  114. package/dist/client/assets/cue-CE9AQfxI.js +2 -0
  115. package/dist/client/assets/cypher-ClKdZ_lG.js +2 -0
  116. package/dist/client/assets/d-qD-0Kul2.js +2 -0
  117. package/dist/client/assets/dark-plus-Cs2F2srj.js +2 -0
  118. package/dist/client/assets/dark-plus-GAt2ZgX8.js +2 -0
  119. package/dist/client/assets/dart-CnvKMtbv.js +2 -0
  120. package/dist/client/assets/dax-BkyTk9wS.js +2 -0
  121. package/dist/client/assets/desktop-Dlh5hvp9.js +2 -0
  122. package/dist/client/assets/diff-woXpYk--.js +2 -0
  123. package/dist/client/assets/dm-sans-latin-ext-wght-normal-BOFOeGcA.woff2 +0 -0
  124. package/dist/client/assets/dm-sans-latin-wght-normal-Xz1IZZA0.woff2 +0 -0
  125. package/dist/client/assets/docker-IyjqRm3v.js +2 -0
  126. package/dist/client/assets/dotenv-_5a1GRtc.js +2 -0
  127. package/dist/client/assets/dracula-BHWKrbxM.js +2 -0
  128. package/dist/client/assets/dracula-C2uKkzgK.js +2 -0
  129. package/dist/client/assets/dracula-soft-5eyTD99u.js +2 -0
  130. package/dist/client/assets/dracula-soft-D1bVjxWZ.js +2 -0
  131. package/dist/client/assets/dream-maker-DW3nJb8Q.js +2 -0
  132. package/dist/client/assets/edge-BUUilOUR.js +2 -0
  133. package/dist/client/assets/elixir-amUSnRCT.js +2 -0
  134. package/dist/client/assets/elm-BjxEHjzr.js +2 -0
  135. package/dist/client/assets/emacs-lisp-B4R74twV.js +2 -0
  136. package/dist/client/assets/entities-EGZcO-rg.js +2 -0
  137. package/dist/client/assets/environments-DPUVdQJp.js +2 -0
  138. package/dist/client/assets/erb-t1kck8M-.js +2 -0
  139. package/dist/client/assets/erlang-Cphh6RMH.js +2 -0
  140. package/dist/client/assets/everforest-dark-D-DlICQR.js +2 -0
  141. package/dist/client/assets/everforest-dark-sB-x3p7T.js +2 -0
  142. package/dist/client/assets/everforest-light-CeVdGHYG.js +2 -0
  143. package/dist/client/assets/everforest-light-Df2xbC6M.js +2 -0
  144. package/dist/client/assets/eye-TogxKhHZ.js +2 -0
  145. package/dist/client/assets/fennel-DQxkIbk2.js +2 -0
  146. package/dist/client/assets/fileCommentAnnotations-uFcaPOph.js +2 -0
  147. package/dist/client/assets/fish-BJitypiv.js +2 -0
  148. package/dist/client/assets/fluent-C03EYrpw.js +2 -0
  149. package/dist/client/assets/fortran-fixed-form-DEKoE2YW.js +2 -0
  150. package/dist/client/assets/fortran-free-form-CYNrtFtB.js +2 -0
  151. package/dist/client/assets/fsharp-D13ZGOAj.js +2 -0
  152. package/dist/client/assets/gauge-DXknpyA8.js +2 -0
  153. package/dist/client/assets/gdresource-C0sCabJj.js +2 -0
  154. package/dist/client/assets/gdscript-Cp2uCuqX.js +2 -0
  155. package/dist/client/assets/gdshader-CBce3t8t.js +2 -0
  156. package/dist/client/assets/genie-CV2tkWYe.js +2 -0
  157. package/dist/client/assets/gherkin-DExj1W_8.js +2 -0
  158. package/dist/client/assets/ghostty-vt-DdA0Zryv.wasm +0 -0
  159. package/dist/client/assets/ghostty-write-pty-hgyAvVbe.wasm +0 -0
  160. package/dist/client/assets/git-commit-BSykSTBG.js +2 -0
  161. package/dist/client/assets/git-rebase-Cq4_6JTl.js +2 -0
  162. package/dist/client/assets/github-dark-C-LZuMrd.js +2 -0
  163. package/dist/client/assets/github-dark-DwbbXv51.js +2 -0
  164. package/dist/client/assets/github-dark-default-CxjRwzl6.js +2 -0
  165. package/dist/client/assets/github-dark-default-DXG-b-1a.js +2 -0
  166. package/dist/client/assets/github-dark-dimmed-Bx1FflLF.js +2 -0
  167. package/dist/client/assets/github-dark-dimmed-Cr1oaoul.js +2 -0
  168. package/dist/client/assets/github-dark-high-contrast-B4qJZLZa.js +2 -0
  169. package/dist/client/assets/github-dark-high-contrast-B_tTalzw.js +2 -0
  170. package/dist/client/assets/github-light-CsVXhIlR.js +2 -0
  171. package/dist/client/assets/github-light-EUqPIrTm.js +2 -0
  172. package/dist/client/assets/github-light-default-BXViO-2h.js +2 -0
  173. package/dist/client/assets/github-light-default-DB_IwZa6.js +2 -0
  174. package/dist/client/assets/github-light-high-contrast-B68TUdTA.js +2 -0
  175. package/dist/client/assets/github-light-high-contrast-DLgVeSB-.js +2 -0
  176. package/dist/client/assets/gleam-CSRkHgEL.js +2 -0
  177. package/dist/client/assets/glimmer-js-u4EGJ0zO.js +2 -0
  178. package/dist/client/assets/glimmer-ts-Gurbt52H.js +2 -0
  179. package/dist/client/assets/glsl-30pqDoZO.js +2 -0
  180. package/dist/client/assets/gn-ilITqXS6.js +2 -0
  181. package/dist/client/assets/gnuplot-7GGW24-e.js +2 -0
  182. package/dist/client/assets/go-rLFTqkRN.js +2 -0
  183. package/dist/client/assets/graphql-Bs5G1kBK.js +2 -0
  184. package/dist/client/assets/groovy-CacY0gHj.js +2 -0
  185. package/dist/client/assets/group-BUXx2pDS.js +2 -0
  186. package/dist/client/assets/gruvbox-dark-hard-C820rvS2.js +2 -0
  187. package/dist/client/assets/gruvbox-dark-hard-DXm60lX3.js +2 -0
  188. package/dist/client/assets/gruvbox-dark-medium-BPjhmG05.js +2 -0
  189. package/dist/client/assets/gruvbox-dark-medium-GE2thSmD.js +2 -0
  190. package/dist/client/assets/gruvbox-dark-soft-04Cj-4VZ.js +2 -0
  191. package/dist/client/assets/gruvbox-dark-soft-MrdJrrXF.js +2 -0
  192. package/dist/client/assets/gruvbox-light-hard-BC_s9l72.js +2 -0
  193. package/dist/client/assets/gruvbox-light-hard-K6wSn29D.js +2 -0
  194. package/dist/client/assets/gruvbox-light-medium-BAWPOn9u.js +2 -0
  195. package/dist/client/assets/gruvbox-light-medium-CVy3aSlc.js +2 -0
  196. package/dist/client/assets/gruvbox-light-soft-BSMLrYjP.js +2 -0
  197. package/dist/client/assets/gruvbox-light-soft-DNgJjaY0.js +2 -0
  198. package/dist/client/assets/hack-Cko6MX06.js +2 -0
  199. package/dist/client/assets/haml-Doizmjk4.js +2 -0
  200. package/dist/client/assets/handlebars-b-YSlzII.js +2 -0
  201. package/dist/client/assets/haskell-D8IpX4py.js +2 -0
  202. package/dist/client/assets/haxe-OTjmBuCE.js +2 -0
  203. package/dist/client/assets/hcl-Dh228itO.js +2 -0
  204. package/dist/client/assets/hex-color-picker-DfLvGsRa.js +2 -0
  205. package/dist/client/assets/history-D05vcMtj.js +2 -0
  206. package/dist/client/assets/hjson-CxZEssPk.js +2 -0
  207. package/dist/client/assets/hlsl-Cvrh5tZx.js +2 -0
  208. package/dist/client/assets/horizon-0-RkHfro.js +2 -0
  209. package/dist/client/assets/horizon-CE9ld1lL.js +2 -0
  210. package/dist/client/assets/horizon-bright-BgL2X9oq.js +2 -0
  211. package/dist/client/assets/horizon-bright-DSNQnXHK.js +2 -0
  212. package/dist/client/assets/hostedPairing-nVVe5x4p.js +2 -0
  213. package/dist/client/assets/houston-CsvMBhTu.js +2 -0
  214. package/dist/client/assets/houston-KyjWKfuY.js +2 -0
  215. package/dist/client/assets/html-FzejeGn1.js +2 -0
  216. package/dist/client/assets/html-derivative-CnAooqTz.js +2 -0
  217. package/dist/client/assets/http-BxFImlHF.js +2 -0
  218. package/dist/client/assets/hurl-qINZb_eJ.js +2 -0
  219. package/dist/client/assets/hxml-B0Qn7Nwc.js +2 -0
  220. package/dist/client/assets/hy-CZbG8q4J.js +2 -0
  221. package/dist/client/assets/imba-DsUTQ-LC.js +2 -0
  222. package/dist/client/assets/index-DCOpJfCm.js +475 -0
  223. package/dist/client/assets/index-zJhfLl9C.css +1 -0
  224. package/dist/client/assets/ini-B5eOa1yu.js +2 -0
  225. package/dist/client/assets/input-group-DTqnJGXS.js +2 -0
  226. package/dist/client/assets/java-dMRc_cVD.js +2 -0
  227. package/dist/client/assets/javascript-BWMpBhVQ.js +2 -0
  228. package/dist/client/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
  229. package/dist/client/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
  230. package/dist/client/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
  231. package/dist/client/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
  232. package/dist/client/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
  233. package/dist/client/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
  234. package/dist/client/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
  235. package/dist/client/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
  236. package/dist/client/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
  237. package/dist/client/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  238. package/dist/client/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
  239. package/dist/client/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
  240. package/dist/client/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
  241. package/dist/client/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
  242. package/dist/client/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
  243. package/dist/client/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
  244. package/dist/client/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
  245. package/dist/client/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
  246. package/dist/client/assets/jinja-VDH3C9Ij.js +2 -0
  247. package/dist/client/assets/jison-BB0XuJyA.js +2 -0
  248. package/dist/client/assets/json-BjGzD-SE.js +2 -0
  249. package/dist/client/assets/json5-BR5RXkoi.js +2 -0
  250. package/dist/client/assets/jsonc-CYpm1nAK.js +2 -0
  251. package/dist/client/assets/jsonl-CmCQp5Yx.js +2 -0
  252. package/dist/client/assets/jsonnet-CJTPZ8u_.js +2 -0
  253. package/dist/client/assets/jssm-DXw9l8Rf.js +2 -0
  254. package/dist/client/assets/jsx-DzJWGKks.js +2 -0
  255. package/dist/client/assets/julia-BgCkjxqD.js +2 -0
  256. package/dist/client/assets/just-CVxSIAWS.js +2 -0
  257. package/dist/client/assets/kanagawa-dragon-7TqgsUPC.js +2 -0
  258. package/dist/client/assets/kanagawa-dragon-CXtmUGW6.js +2 -0
  259. package/dist/client/assets/kanagawa-lotus-BN08jTvb.js +2 -0
  260. package/dist/client/assets/kanagawa-lotus-CqxMQulh.js +2 -0
  261. package/dist/client/assets/kanagawa-wave-CTweb8Dz.js +2 -0
  262. package/dist/client/assets/kanagawa-wave-D8CNn6T_.js +2 -0
  263. package/dist/client/assets/kdl-CsD5j6eV.js +2 -0
  264. package/dist/client/assets/kotlin-DhhofPvG.js +2 -0
  265. package/dist/client/assets/kusto-C7mF5XQf.js +2 -0
  266. package/dist/client/assets/laserwave-CQkdhozh.js +2 -0
  267. package/dist/client/assets/laserwave-C_8bwKvT.js +2 -0
  268. package/dist/client/assets/latex-D7_rfK40.js +2 -0
  269. package/dist/client/assets/lean-CewbzKMR.js +2 -0
  270. package/dist/client/assets/less-DVTAwKKz.js +2 -0
  271. package/dist/client/assets/lib-b9zyleUn.js +30 -0
  272. package/dist/client/assets/light-plus-CNQ8_7Y0.js +2 -0
  273. package/dist/client/assets/light-plus-DVQuIRkW.js +2 -0
  274. package/dist/client/assets/link-BL3GZ_rH.js +2 -0
  275. package/dist/client/assets/liquid-C5PsA06M.js +2 -0
  276. package/dist/client/assets/llvm-Cm23YOpf.js +2 -0
  277. package/dist/client/assets/localApi-5K0gg1WP.js +3 -0
  278. package/dist/client/assets/log-BNLmms1o.js +2 -0
  279. package/dist/client/assets/logo-Cluzi2Zq.js +2 -0
  280. package/dist/client/assets/lua-Bq1DnbZG.js +2 -0
  281. package/dist/client/assets/luau-FMPmPwt6.js +2 -0
  282. package/dist/client/assets/make-Dixweg8N.js +2 -0
  283. package/dist/client/assets/markdown-BYOwaDjH.js +2 -0
  284. package/dist/client/assets/marko-C7zk2YT1.js +2 -0
  285. package/dist/client/assets/matchContext-C4X6O3hW.js +2 -0
  286. package/dist/client/assets/material-theme-Bm3Qr25_.js +2 -0
  287. package/dist/client/assets/material-theme-CAtLaHa3.js +2 -0
  288. package/dist/client/assets/material-theme-darker-2IIEA8gg.js +2 -0
  289. package/dist/client/assets/material-theme-darker-k-s5Bc6K.js +2 -0
  290. package/dist/client/assets/material-theme-lighter-CD6a-c4d.js +2 -0
  291. package/dist/client/assets/material-theme-lighter-uhdI0v04.js +2 -0
  292. package/dist/client/assets/material-theme-ocean-B3mraInd.js +2 -0
  293. package/dist/client/assets/material-theme-ocean-CHQ94UKr.js +2 -0
  294. package/dist/client/assets/material-theme-palenight-B5W6OYN7.js +2 -0
  295. package/dist/client/assets/material-theme-palenight-DEhAARHw.js +2 -0
  296. package/dist/client/assets/matlab-D7qyCx1q.js +2 -0
  297. package/dist/client/assets/mdc-JKnKthIF.js +2 -0
  298. package/dist/client/assets/mdx-DQZ5AkYe.js +2 -0
  299. package/dist/client/assets/mermaid-Bk4SNUv9.js +2 -0
  300. package/dist/client/assets/min-dark-BFqTAwCr.js +2 -0
  301. package/dist/client/assets/min-dark-BSWPekZh.js +2 -0
  302. package/dist/client/assets/min-light-DDpmG2fV.js +2 -0
  303. package/dist/client/assets/min-light-O7UdaaxX.js +2 -0
  304. package/dist/client/assets/mipsasm-BMqwQI7S.js +2 -0
  305. package/dist/client/assets/mojo-BgCJLMeH.js +2 -0
  306. package/dist/client/assets/monokai-C0p7Qecz.js +2 -0
  307. package/dist/client/assets/monokai-CdkpiU2Y.js +2 -0
  308. package/dist/client/assets/moonbit-CaWjb8XO.js +2 -0
  309. package/dist/client/assets/move-B1IS1UjX.js +2 -0
  310. package/dist/client/assets/narrat-_X_XdTYD.js +2 -0
  311. package/dist/client/assets/nextflow-BJtWHP5T.js +2 -0
  312. package/dist/client/assets/nextflow-groovy-DJMQeKeT.js +2 -0
  313. package/dist/client/assets/nginx-DXZZx9Fe.js +2 -0
  314. package/dist/client/assets/night-owl-BsnCLAKc.js +2 -0
  315. package/dist/client/assets/night-owl-DhmEMT88.js +2 -0
  316. package/dist/client/assets/night-owl-light-BODRhcTU.js +2 -0
  317. package/dist/client/assets/night-owl-light-eJ-hLW7d.js +2 -0
  318. package/dist/client/assets/nim-CkvLrvYM.js +2 -0
  319. package/dist/client/assets/nix-IvuFDN5E.js +2 -0
  320. package/dist/client/assets/nord-Cb4Vim4T.js +2 -0
  321. package/dist/client/assets/nord-Cd-F4txO.js +2 -0
  322. package/dist/client/assets/nushell-DcLAeLz5.js +2 -0
  323. package/dist/client/assets/objective-c-D1A_Heim.js +2 -0
  324. package/dist/client/assets/objective-cpp-BsSzOQcm.js +2 -0
  325. package/dist/client/assets/ocaml-O90oeIOV.js +2 -0
  326. package/dist/client/assets/odin-B1RWQWA5.js +2 -0
  327. package/dist/client/assets/one-dark-pro-CLwyXe_n.js +2 -0
  328. package/dist/client/assets/one-dark-pro-DUS_IGRK.js +2 -0
  329. package/dist/client/assets/one-light-CVUd7yD5.js +2 -0
  330. package/dist/client/assets/one-light-D7Lr4KcI.js +2 -0
  331. package/dist/client/assets/openscad-BUDT5pXO.js +2 -0
  332. package/dist/client/assets/pair-D_sKBvJj.js +2 -0
  333. package/dist/client/assets/pascal-4ZHwLPI5.js +2 -0
  334. package/dist/client/assets/perl-DKUKw9CE.js +2 -0
  335. package/dist/client/assets/php-GHQk7Jua.js +2 -0
  336. package/dist/client/assets/pierre-dark-CpLgRqie.js +2 -0
  337. package/dist/client/assets/pierre-dark-protanopia-deuteranopia-B35FxJx-.js +2 -0
  338. package/dist/client/assets/pierre-dark-soft-kZQmAZld.js +2 -0
  339. package/dist/client/assets/pierre-dark-tritanopia-CpjhbsIL.js +2 -0
  340. package/dist/client/assets/pierre-dark-vibrant-CpQYzh95.js +2 -0
  341. package/dist/client/assets/pierre-light-CoaEpmwp.js +2 -0
  342. package/dist/client/assets/pierre-light-protanopia-deuteranopia-0fSaH845.js +2 -0
  343. package/dist/client/assets/pierre-light-soft-lWLdNTOI.js +2 -0
  344. package/dist/client/assets/pierre-light-tritanopia-CEbqgOJL.js +2 -0
  345. package/dist/client/assets/pierre-light-vibrant-D80Fkn33.js +2 -0
  346. package/dist/client/assets/pkl-ot-7Btpt.js +2 -0
  347. package/dist/client/assets/plastic-CF8VZTnn.js +2 -0
  348. package/dist/client/assets/plastic-DQwYfKfQ.js +2 -0
  349. package/dist/client/assets/plsql-DGHpHOYJ.js +2 -0
  350. package/dist/client/assets/po-BiJDBrnU.js +2 -0
  351. package/dist/client/assets/poimandres-BX2TyY6j.js +2 -0
  352. package/dist/client/assets/poimandres-DRFjx7u4.js +2 -0
  353. package/dist/client/assets/polar-C7UOKdEL.js +2 -0
  354. package/dist/client/assets/postcss-BXeXVLqQ.js +2 -0
  355. package/dist/client/assets/powerquery-DNMTfnFr.js +2 -0
  356. package/dist/client/assets/powershell-DshXNtvi.js +2 -0
  357. package/dist/client/assets/preload-helper-D2XUqLHy.js +1 -0
  358. package/dist/client/assets/previewActionBus-B2LYye0P.js +2 -0
  359. package/dist/client/assets/prisma-BsRQq5mF.js +2 -0
  360. package/dist/client/assets/projects-D9v9VLJo.js +2 -0
  361. package/dist/client/assets/prolog-iXnhIJG7.js +2 -0
  362. package/dist/client/assets/proto-DB4EqR-F.js +2 -0
  363. package/dist/client/assets/pug-DxCMAzbD.js +2 -0
  364. package/dist/client/assets/puppet-CDv2pdJW.js +2 -0
  365. package/dist/client/assets/purescript-9MfHhQsQ.js +2 -0
  366. package/dist/client/assets/python-gzcpVVnB.js +2 -0
  367. package/dist/client/assets/qml-D3IL06-0.js +2 -0
  368. package/dist/client/assets/qmldir-DCQb3MpD.js +2 -0
  369. package/dist/client/assets/qss-Fe1Jh2GI.js +2 -0
  370. package/dist/client/assets/query-BTlH8ppa.js +2 -0
  371. package/dist/client/assets/r-D2Zb3-aq.js +2 -0
  372. package/dist/client/assets/racket-DcIDlBhZ.js +2 -0
  373. package/dist/client/assets/radio-group-VXzWvOzu.js +2 -0
  374. package/dist/client/assets/raku-B3gFvitq.js +2 -0
  375. package/dist/client/assets/razor-BfPqrQiz.js +2 -0
  376. package/dist/client/assets/red-7ga_dcKu.js +2 -0
  377. package/dist/client/assets/red-CJ3rzSJv.js +2 -0
  378. package/dist/client/assets/redirect-CTDpd8-N.js +2 -0
  379. package/dist/client/assets/reg-CRGYupPL.js +2 -0
  380. package/dist/client/assets/regexp-BtCnpNi-.js +2 -0
  381. package/dist/client/assets/rel-BtDbiS_P.js +2 -0
  382. package/dist/client/assets/reviewPatchParser.worker-Bx0aLcXI.js +13 -0
  383. package/dist/client/assets/reviews-DqcOSrtz.js +2 -0
  384. package/dist/client/assets/reviews._environmentId._host._owner._repository._pullRequestNumber-QICycRVU.js +11 -0
  385. package/dist/client/assets/reviews.index-Dw9KYVnt.js +2 -0
  386. package/dist/client/assets/riscv-Ckw8ddFX.js +2 -0
  387. package/dist/client/assets/ron-VUp2lXgN.js +2 -0
  388. package/dist/client/assets/rose-pine-BthvhNj6.js +2 -0
  389. package/dist/client/assets/rose-pine-dawn-DSuRaP6u.js +2 -0
  390. package/dist/client/assets/rose-pine-dawn-Dg85fqjY.js +2 -0
  391. package/dist/client/assets/rose-pine-moon-DdHjCvFQ.js +2 -0
  392. package/dist/client/assets/rose-pine-moon-hon4tzzS.js +2 -0
  393. package/dist/client/assets/rose-pine-rh6ipraJ.js +2 -0
  394. package/dist/client/assets/rosmsg-CAekHB0j.js +2 -0
  395. package/dist/client/assets/rotate-ccw-BuHf9qmb.js +2 -0
  396. package/dist/client/assets/rst-DgVsEgbv.js +2 -0
  397. package/dist/client/assets/ruby-DM9zEDxk.js +2 -0
  398. package/dist/client/assets/rust-Cfkwpbl8.js +2 -0
  399. package/dist/client/assets/safeLog-NeXgoMPF.js +3 -0
  400. package/dist/client/assets/sas-DlL3ue79.js +2 -0
  401. package/dist/client/assets/sass-DXrisJhu.js +2 -0
  402. package/dist/client/assets/scala-DKOlJaKm.js +2 -0
  403. package/dist/client/assets/scheduler-8SgDf5Nb.js +2 -0
  404. package/dist/client/assets/scheme-DQCgrYNe.js +2 -0
  405. package/dist/client/assets/scss-LGD8fUVB.js +2 -0
  406. package/dist/client/assets/sdbl-bTVj8UrX.js +2 -0
  407. package/dist/client/assets/settings-D4XOj85b.js +2 -0
  408. package/dist/client/assets/settings.appearance-CZvAeZCN.js +42 -0
  409. package/dist/client/assets/settings.archived-Y06GoG0S.js +2 -0
  410. package/dist/client/assets/settings.beta-Bd5UrFtG.js +2 -0
  411. package/dist/client/assets/settings.connections-YjuBg0cD.js +2 -0
  412. package/dist/client/assets/settings.diagnostics-DujS7DMW.js +3 -0
  413. package/dist/client/assets/settings.general-sQSJC3Rq.js +2 -0
  414. package/dist/client/assets/settings.keybindings-C6b2im1-.js +2 -0
  415. package/dist/client/assets/settings.providers-CzhQRSvU.js +2 -0
  416. package/dist/client/assets/settings.source-control-Ocoxm1T5.js +2 -0
  417. package/dist/client/assets/shaderlab-TOUzSsQk.js +2 -0
  418. package/dist/client/assets/shell-BfrxrAzH.js +2 -0
  419. package/dist/client/assets/shellscript-CYVg9JP5.js +2 -0
  420. package/dist/client/assets/shellsession-Cn2QQjIy.js +2 -0
  421. package/dist/client/assets/slack-dark-DYvUXyrP.js +2 -0
  422. package/dist/client/assets/slack-dark-DnToyrRv.js +2 -0
  423. package/dist/client/assets/slack-ochin-B2OO5cIa.js +2 -0
  424. package/dist/client/assets/slack-ochin-bqtMVDfH.js +2 -0
  425. package/dist/client/assets/smalltalk-B16xEiuN.js +2 -0
  426. package/dist/client/assets/snazzy-light-4G7pJPwS.js +2 -0
  427. package/dist/client/assets/snazzy-light-D8dzFmq5.js +2 -0
  428. package/dist/client/assets/solarized-dark-BQwPDzxK.js +2 -0
  429. package/dist/client/assets/solarized-dark-DV17i1UV.js +2 -0
  430. package/dist/client/assets/solarized-light-BLaijb3X.js +2 -0
  431. package/dist/client/assets/solarized-light-DSh2HLQt.js +2 -0
  432. package/dist/client/assets/solidity-CKzVLygQ.js +2 -0
  433. package/dist/client/assets/soy-BNUH7AWp.js +2 -0
  434. package/dist/client/assets/sparql-D_iOobhT.js +2 -0
  435. package/dist/client/assets/splunk-BC2Px7Mm.js +2 -0
  436. package/dist/client/assets/sql-BLrhh1Yv.js +2 -0
  437. package/dist/client/assets/ssh-config-BgfXC-Er.js +2 -0
  438. package/dist/client/assets/stata-CbTJOr_m.js +2 -0
  439. package/dist/client/assets/stylus-B6D30XZt.js +2 -0
  440. package/dist/client/assets/surrealql-Bp6i6018.js +2 -0
  441. package/dist/client/assets/svelte-CuQ8bF4c.js +2 -0
  442. package/dist/client/assets/swift-DonLKvLd.js +2 -0
  443. package/dist/client/assets/switch-rJ-jJPhK.js +2 -0
  444. package/dist/client/assets/synthwave-84-CIknw8y7.js +2 -0
  445. package/dist/client/assets/synthwave-84-nFMaYfgc.js +2 -0
  446. package/dist/client/assets/system-verilog-DJ5XKQeo.js +2 -0
  447. package/dist/client/assets/systemd-BxMlprV5.js +2 -0
  448. package/dist/client/assets/talonscript-CohzipZa.js +2 -0
  449. package/dist/client/assets/tasl-DMoTqEGO.js +2 -0
  450. package/dist/client/assets/tcl-CZd0xW_V.js +2 -0
  451. package/dist/client/assets/templ-Bo-nf_t1.js +2 -0
  452. package/dist/client/assets/terminalAppearance-BqQ_2bv1.js +2 -0
  453. package/dist/client/assets/terraform-DswuEJGm.js +2 -0
  454. package/dist/client/assets/tex-BgvSMBks.js +2 -0
  455. package/dist/client/assets/textarea-XNVgJSPU.js +2 -0
  456. package/dist/client/assets/toggle-QDWstdFN.js +2 -0
  457. package/dist/client/assets/tokyo-night-iIspnLcq.js +2 -0
  458. package/dist/client/assets/tokyo-night-oM2G3aXe.js +2 -0
  459. package/dist/client/assets/toml-CcmNWLt0.js +2 -0
  460. package/dist/client/assets/ts-tags-Bm95_vpn.js +2 -0
  461. package/dist/client/assets/tsv-sltzmVWM.js +2 -0
  462. package/dist/client/assets/tsx-ToB8-PkG.js +2 -0
  463. package/dist/client/assets/turtle-ByJddavk.js +2 -0
  464. package/dist/client/assets/twig-D5eIhwLo.js +2 -0
  465. package/dist/client/assets/typescript-55S1t3b3.js +2 -0
  466. package/dist/client/assets/typespec-BRdr0IET.js +2 -0
  467. package/dist/client/assets/typst-DI99ib-x.js +2 -0
  468. package/dist/client/assets/uiStateStore-DKTfup26.js +2 -0
  469. package/dist/client/assets/use-atom-command-CbJ8L7ju.js +4 -0
  470. package/dist/client/assets/useAriaLabelledBy-DcnsWgtX.js +2 -0
  471. package/dist/client/assets/useParams-Iww6IHUG.js +2 -0
  472. package/dist/client/assets/useReviewMergeAction-BgjVNuJP.js +2 -0
  473. package/dist/client/assets/useSettings-CGh4Xw67.js +2 -0
  474. package/dist/client/assets/useStore-Bv9Rrp6F.js +2 -0
  475. package/dist/client/assets/utils-SYwD9hoF.js +2 -0
  476. package/dist/client/assets/utils-Yidpy5tB.js +30 -0
  477. package/dist/client/assets/v-DETTlOr0.js +2 -0
  478. package/dist/client/assets/vala-zf12oZj6.js +2 -0
  479. package/dist/client/assets/vb-Djn5o6TS.js +2 -0
  480. package/dist/client/assets/vcsRefInvalidation-CMdkUDtM.js +2 -0
  481. package/dist/client/assets/verilog-CiiDBU1e.js +2 -0
  482. package/dist/client/assets/vesper-BIFK_oDq.js +2 -0
  483. package/dist/client/assets/vesper-DdrHHSXu.js +2 -0
  484. package/dist/client/assets/vhdl-BroJfC0k.js +2 -0
  485. package/dist/client/assets/viml-DvXPmvsu.js +2 -0
  486. package/dist/client/assets/vitesse-black-D082JcaE.js +2 -0
  487. package/dist/client/assets/vitesse-black-fwtXNY1n.js +2 -0
  488. package/dist/client/assets/vitesse-dark-BZCL-v6S.js +2 -0
  489. package/dist/client/assets/vitesse-dark-z-nr_5O8.js +2 -0
  490. package/dist/client/assets/vitesse-light-VbXTXTou.js +2 -0
  491. package/dist/client/assets/vitesse-light-ojz42ZLy.js +2 -0
  492. package/dist/client/assets/vue-BWR1mbne.js +2 -0
  493. package/dist/client/assets/vue-html-DGrJOwF8.js +2 -0
  494. package/dist/client/assets/vue-vine-SedHajQj.js +2 -0
  495. package/dist/client/assets/vyper-CgoNMtux.js +2 -0
  496. package/dist/client/assets/wasm-BnjxR4X6.js +2 -0
  497. package/dist/client/assets/wasm-ByWQv1Qj.js +2 -0
  498. package/dist/client/assets/wenyan-C8pVoKbM.js +2 -0
  499. package/dist/client/assets/wgsl-BsKzXJz4.js +2 -0
  500. package/dist/client/assets/wikitext-ClFFjSW2.js +2 -0
  501. package/dist/client/assets/wit-DdvCle-K.js +2 -0
  502. package/dist/client/assets/with-selector-C3poe37J.js +2 -0
  503. package/dist/client/assets/wolfram-DLL8P-h_.js +2 -0
  504. package/dist/client/assets/worker-CIcqvLjo.js +159 -0
  505. package/dist/client/assets/workspaceTitlebar-CrNTdVrF.js +2 -0
  506. package/dist/client/assets/xml-BB6ezbMQ.js +2 -0
  507. package/dist/client/assets/xsl-DygAj9pT.js +2 -0
  508. package/dist/client/assets/yaml-CIJj2T9S.js +2 -0
  509. package/dist/client/assets/zenscript-BnlCZFoB.js +2 -0
  510. package/dist/client/assets/zig-CMLA9XwU.js +2 -0
  511. package/dist/client/index.html +327 -0
  512. package/dist/client/mockServiceWorker.js +349 -0
  513. package/dist/service-launcher.mjs +461 -0
  514. package/package.json +54 -0
@@ -0,0 +1,1813 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { Ar as clockWith, Cd as identity, Di as matchEffect, Eu as some, Fu as Prototype, Gi as runFork, Gr as flatMap, Gu as BaseProto, Ir as effectify, It as tag, Oo as succeed$2, Pi as orDie, Po as addFinalizer, Sa as void_, Ts as fail$2, Vi as raceFirst, Xo as doneUnsafe, Xr as forEach, Yr as fnUntraced, Za as catchDone, Zi as scoped, Zr as forever, _r as as, _s as Done, aa as suspend, ad as hasProperty, ai as ignore, cd as isNullish, cr as acquireRelease, cs as fail$1, ea as serviceOption, eu as getUnsafe, f as ErrorClass, fd as isUndefined, fr as andThen, fu as fromNullishOr, ha as try_, hs as succeed$1, ii as gen, is as makeUnsafe, kr as catch_, ma as tryPromise, mu as getOrElse, na as succeed, ns as isDone, oa as sync, od as isNotNull, pa as timeoutOrElse, pu as fromUndefinedOr, ql as Service, qo as _await, sd as isNotUndefined, ti as forkScoped, ur as addFinalizer$1, uu as flatMap$1, va as uninterruptible, vo as effect, wd as pipe, wl as of, ws as done, wu as none, xr as callback, xs as UnknownError, yi as map, yr as asVoid, zr as fail } from "./Schema-DuQUv9rO.mjs";
4
+ import { $t as offer, At as isSink, Cn as BadArgument, D as fromChannel$1, Dn as nominal, Dt as drain, En as systemError, F as isStream, H as mkString, It as fromTransform, Jt as endUnsafe, Lt as mapDone, Q as runCollect, Qt as make$11, Tn as badArgument, V as merge, Z as run, Zt as failCauseUnsafe, _t as make$10, a as FileTypeId, c as make$9, ft as transduce, gn as makeUnsafe$1, gt as get, h as decodeText, i as FileSystem, it as splitLines, kt as fromChannel, l as callback$1, mn as make$8, mt as unwrap, n as TypeId$4, o as Size, r as FileDescriptor, s as WatchBackend, t as Path$1, tn as offerUnsafe, v as empty } from "./Path-BB53LP8h.mjs";
5
+ import * as NodeChildProcess from "node:child_process";
6
+ import { PassThrough } from "node:stream";
7
+ import * as NodeCrypto from "node:crypto";
8
+ import * as NFS from "node:fs";
9
+ import * as OS from "node:os";
10
+ import * as Path from "node:path";
11
+ import * as NodeUrl from "node:url";
12
+ import * as readline from "node:readline";
13
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.102_patch_10dcca2e28a1e6c67a3825e6da1ff253/node_modules/effect/dist/unstable/process/ChildProcessSpawner.js
14
+ /**
15
+ * Service boundary for starting and controlling child processes.
16
+ *
17
+ * `ChildProcessSpawner` is the service used by `ChildProcess` commands to start
18
+ * operating-system processes. A spawner turns a command description into a
19
+ * handle that can write to stdin, read stdout and stderr, wait for exit, kill
20
+ * the process, and manage whether the process keeps its parent alive. Platform
21
+ * backends implement this service, while most application code uses the higher
22
+ * level `ChildProcess` module.
23
+ *
24
+ * @since 4.0.0
25
+ */
26
+ /**
27
+ * Constructs branded child process `ExitCode` values.
28
+ *
29
+ * @category constructors
30
+ * @since 4.0.0
31
+ */
32
+ const ExitCode = /*#__PURE__*/ nominal();
33
+ /**
34
+ * Constructs branded child process `ProcessId` values.
35
+ *
36
+ * @category constructors
37
+ * @since 4.0.0
38
+ */
39
+ const ProcessId = /*#__PURE__*/ nominal();
40
+ const HandleTypeId = "~effect/ChildProcessSpawner/ChildProcessHandle";
41
+ const HandleProto = {
42
+ [HandleTypeId]: HandleTypeId,
43
+ ...BaseProto,
44
+ toJSON() {
45
+ return {
46
+ _id: "ChildProcessHandle",
47
+ pid: this.pid
48
+ };
49
+ }
50
+ };
51
+ /**
52
+ * Constructs a new `ChildProcessHandle`.
53
+ *
54
+ * @category constructors
55
+ * @since 4.0.0
56
+ */
57
+ const makeHandle = (params) => Object.setPrototypeOf({ ...params }, HandleProto);
58
+ /**
59
+ * Creates a `ChildProcessSpawner` service from a `spawn` function, deriving
60
+ * helpers for exit codes and output collection from that implementation.
61
+ *
62
+ * @category models
63
+ * @since 4.0.0
64
+ */
65
+ const make$7 = (spawn) => {
66
+ const streamString = (command, options) => spawn(command).pipe(map((handle) => decodeText(options?.includeStderr === true ? handle.all : handle.stdout)), unwrap);
67
+ const streamLines = (command, options) => splitLines(streamString(command, options));
68
+ return ChildProcessSpawner.of({
69
+ spawn,
70
+ exitCode: (command) => scoped(flatMap(spawn(command), (handle) => handle.exitCode)),
71
+ streamString,
72
+ streamLines,
73
+ lines: (command, options) => runCollect(streamLines(command, options)),
74
+ string: (command, options) => mkString(streamString(command, options))
75
+ });
76
+ };
77
+ /**
78
+ * Service tag for child process spawning.
79
+ *
80
+ * @category services
81
+ * @since 4.0.0
82
+ */
83
+ var ChildProcessSpawner = class extends Service()("effect/process/ChildProcessSpawner") {};
84
+ //#endregion
85
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.102_patch_10dcca2e28a1e6c67a3825e6da1ff253/node_modules/effect/dist/unstable/process/ChildProcess.js
86
+ /**
87
+ * Describes child processes before they are started.
88
+ *
89
+ * A `Command` stores the executable, arguments, environment, standard streams,
90
+ * working directory, and other process options. Commands can also be piped
91
+ * together. A command is an `Effect`; running it asks the
92
+ * `ChildProcessSpawner` service to start the process and returns a
93
+ * `ChildProcessHandle`.
94
+ *
95
+ * @since 4.0.0
96
+ */
97
+ const TypeId$3 = "~effect/unstable/process/ChildProcess";
98
+ const Proto = {
99
+ .../*#__PURE__*/ Prototype({
100
+ label: "Command",
101
+ evaluate(fiber) {
102
+ return getUnsafe(fiber.context, ChildProcessSpawner).spawn(this);
103
+ }
104
+ }),
105
+ [TypeId$3]: TypeId$3
106
+ };
107
+ const makeStandardCommand = (command, args, options) => Object.assign(Object.create(Proto), {
108
+ _tag: "StandardCommand",
109
+ command,
110
+ args,
111
+ options
112
+ });
113
+ /**
114
+ * Create a command from a template literal, options + template, or array form.
115
+ *
116
+ * **Details**
117
+ *
118
+ * This function supports three calling conventions:
119
+ * 1. Template literal: `make\`npm run build\``
120
+ * 2. Options + template literal: `make({ cwd: "/app" })\`npm run build\``
121
+ * 3. Array form: `make("npm", ["run", "build"], options?)`
122
+ *
123
+ * Template literals are not parsed until execution time, allowing parsing
124
+ * errors to flow through Effect's error channel.
125
+ *
126
+ * **Example** (Creating commands)
127
+ *
128
+ * ```ts
129
+ * import { ChildProcess } from "effect/unstable/process"
130
+ *
131
+ * // Template literal form
132
+ * const cmd1 = ChildProcess.make`echo "hello"`
133
+ *
134
+ * // With options
135
+ * const cmd2 = ChildProcess.make({ cwd: "/tmp" })`ls -la`
136
+ *
137
+ * // Array form
138
+ * const cmd3 = ChildProcess.make("git", ["status"])
139
+ * ```
140
+ *
141
+ * @category constructors
142
+ * @since 4.0.0
143
+ */
144
+ const make$6 = function make(...args) {
145
+ if (isTemplateString(args[0])) {
146
+ const [templates, ...expressions] = args;
147
+ const tokens = parseTemplates(templates, expressions);
148
+ return makeStandardCommand(tokens[0] ?? "", tokens.slice(1), {});
149
+ }
150
+ if (typeof args[0] === "object" && !Array.isArray(args[0]) && !isTemplateString(args[0])) {
151
+ const options = args[0];
152
+ return function(templates, ...expressions) {
153
+ const tokens = parseTemplates(templates, expressions);
154
+ return makeStandardCommand(tokens[0] ?? "", tokens.slice(1), options);
155
+ };
156
+ }
157
+ if (typeof args[0] === "string" && !Array.isArray(args[1])) {
158
+ const [command, options = {}] = args;
159
+ return makeStandardCommand(command, [], options);
160
+ }
161
+ const [command, cmdArgs = [], options = {}] = args;
162
+ return makeStandardCommand(command, cmdArgs, options);
163
+ };
164
+ const isTemplateString = (u) => Array.isArray(u) && "raw" in u && Array.isArray(u.raw);
165
+ /**
166
+ * Parses an fd name like "fd3" to its numeric index.
167
+ * Returns undefined if the name is invalid.
168
+ *
169
+ * @category converting
170
+ * @since 4.0.0
171
+ */
172
+ const parseFdName = (name) => {
173
+ const match = /^fd(\d+)$/.exec(name);
174
+ if (match === null) return void 0;
175
+ const fd = parseInt(match[1], 10);
176
+ return fd >= 3 ? fd : void 0;
177
+ };
178
+ /**
179
+ * Create an fd name from its numeric index.
180
+ *
181
+ * @category converting
182
+ * @since 4.0.0
183
+ */
184
+ const fdName = (fd) => `fd${fd}`;
185
+ const parseTemplates = (templates, expressions) => {
186
+ let tokens = [];
187
+ for (const [index, template] of templates.entries()) tokens = parseTemplate(templates, expressions, tokens, template, index);
188
+ return tokens;
189
+ };
190
+ const parseTemplate = (templates, expressions, prevTokens, template, index) => {
191
+ const rawTemplate = templates.raw[index];
192
+ if (rawTemplate === void 0) throw new Error(`Invalid backslash sequence: ${templates.raw[index]}`);
193
+ const { hasLeadingWhitespace, hasTrailingWhitespace, tokens } = splitByWhitespaces(template, rawTemplate);
194
+ const nextTokens = concatTokens(prevTokens, tokens, hasLeadingWhitespace);
195
+ if (index === expressions.length) return nextTokens;
196
+ const expression = expressions[index];
197
+ const expressionTokens = Array.isArray(expression) ? expression.map((expression) => parseExpression(expression)) : [parseExpression(expression)];
198
+ return concatTokens(nextTokens, expressionTokens, hasTrailingWhitespace);
199
+ };
200
+ /**
201
+ * Convert valid expressions defined in a template string command (i.e. using
202
+ * `${expression}` into strings.
203
+ */
204
+ const parseExpression = (expression) => {
205
+ if (typeof expression === "string") return expression;
206
+ return String(expression);
207
+ };
208
+ const DELIMITERS = /*#__PURE__*/ new Set([
209
+ " ",
210
+ " ",
211
+ "\r",
212
+ "\n"
213
+ ]);
214
+ /**
215
+ * Number of characters in backslash escape sequences: \0 \xXX or \uXXXX
216
+ * \cX is allowed in RegExps but not in strings
217
+ * Octal sequences are not allowed in strict mode
218
+ */
219
+ const ESCAPE_LENGTH = {
220
+ x: 3,
221
+ u: 5
222
+ };
223
+ /**
224
+ * Splits a template string by whitespace while also properly handling escape
225
+ * sequences.
226
+ *
227
+ * As an example, let's review the following valid commands:
228
+ *
229
+ * ```ts
230
+ * ChildProcess.exec`echo foo\n bar`
231
+ * // We should run `["echo", "foo\n", "bar"]`
232
+ *
233
+ * ChildProcess.exec`echo foo
234
+ * bar`
235
+ * // We should run `["echo", "foo", "bar]`
236
+ * ```
237
+ *
238
+ * The problem is that when we evaluate the template string for both of the above
239
+ * commands, we will end up with the same string "echo foo\n bar".
240
+ *
241
+ * What we really want is to include the escaped character in the arguments for
242
+ * the first command, since it was written explicitly by the user.
243
+ *
244
+ * This is why also having access to the raw template string is useful - in a
245
+ * template string, there are two representations of the same string:
246
+ * 1. `template` - The processed string (escape sequences are evaluated).
247
+ * 2. `template.raw` - The raw string (escape sequences are literal).
248
+ */
249
+ const splitByWhitespaces = (template, rawTemplate) => {
250
+ if (rawTemplate.length === 0) return {
251
+ tokens: [],
252
+ hasLeadingWhitespace: false,
253
+ hasTrailingWhitespace: false
254
+ };
255
+ const hasLeadingWhitespace = DELIMITERS.has(rawTemplate[0]);
256
+ const tokens = [];
257
+ let templateCursor = 0;
258
+ for (let templateIndex = 0, rawIndex = 0; templateIndex < template.length; templateIndex += 1, rawIndex += 1) {
259
+ const rawCharacter = rawTemplate[rawIndex];
260
+ if (DELIMITERS.has(rawCharacter)) {
261
+ if (templateCursor !== templateIndex) tokens.push(template.slice(templateCursor, templateIndex));
262
+ templateCursor = templateIndex + 1;
263
+ } else if (rawCharacter === "\\") {
264
+ const nextRawCharacter = rawTemplate[rawIndex + 1];
265
+ if (nextRawCharacter === "\n") {
266
+ templateIndex -= 1;
267
+ rawIndex += 1;
268
+ } else if (nextRawCharacter === "u" && rawTemplate[rawIndex + 2] === "{") rawIndex = rawTemplate.indexOf("}", rawIndex + 3);
269
+ else rawIndex += ESCAPE_LENGTH[nextRawCharacter] ?? 1;
270
+ }
271
+ }
272
+ const hasTrailingWhitespace = templateCursor === template.length;
273
+ if (!hasTrailingWhitespace) tokens.push(template.slice(templateCursor));
274
+ return {
275
+ tokens,
276
+ hasLeadingWhitespace,
277
+ hasTrailingWhitespace
278
+ };
279
+ };
280
+ /**
281
+ * Concatenates two separate sets of string tokens together.
282
+ *
283
+ * If either set is empty or `isSeparated=false`, the last element of `prevTokens`
284
+ * and the first element of `nextTokens` will be joined into a single token.
285
+ */
286
+ const concatTokens = (prevTokens, nextTokens, isSeparated) => isSeparated || prevTokens.length === 0 || nextTokens.length === 0 ? [...prevTokens, ...nextTokens] : [
287
+ ...prevTokens.slice(0, -1),
288
+ `${prevTokens.at(-1)}${nextTokens.at(0)}`,
289
+ ...nextTokens.slice(1)
290
+ ];
291
+ //#endregion
292
+ //#region ../../node_modules/.pnpm/@effect+platform-node-share_9c633f87f6fead147ad02fc5b0d67765/node_modules/@effect/platform-node-shared/dist/internal/utils.js
293
+ /** @internal */
294
+ const handleErrnoException = (module, method) => (err, [path]) => {
295
+ let reason = "Unknown";
296
+ switch (err.code) {
297
+ case "ENOENT":
298
+ reason = "NotFound";
299
+ break;
300
+ case "EACCES":
301
+ reason = "PermissionDenied";
302
+ break;
303
+ case "EEXIST":
304
+ reason = "AlreadyExists";
305
+ break;
306
+ case "EISDIR":
307
+ reason = "BadResource";
308
+ break;
309
+ case "ENOTDIR":
310
+ reason = "BadResource";
311
+ break;
312
+ case "EBUSY":
313
+ reason = "Busy";
314
+ break;
315
+ case "ELOOP":
316
+ reason = "BadResource";
317
+ break;
318
+ }
319
+ return systemError({
320
+ _tag: reason,
321
+ module,
322
+ method,
323
+ pathOrDescriptor: path,
324
+ syscall: err.syscall,
325
+ cause: err
326
+ });
327
+ };
328
+ //#endregion
329
+ //#region ../../node_modules/.pnpm/@effect+platform-node-share_9c633f87f6fead147ad02fc5b0d67765/node_modules/@effect/platform-node-shared/dist/NodeSink.js
330
+ /**
331
+ * Creates a `Sink` that writes chunks to a Node writable stream, respecting
332
+ * backpressure, mapping writable errors with `onError`, and ending the stream
333
+ * on completion unless `endOnDone` is `false`.
334
+ *
335
+ * @category constructors
336
+ * @since 4.0.0
337
+ */
338
+ const fromWritable = (options) => fromChannel(mapDone(fromWritableChannel(options), (_) => [_]));
339
+ /**
340
+ * Creates a `Channel` that pulls chunks from upstream and writes them to a
341
+ * Node writable stream, respecting backpressure and optionally ending the
342
+ * writable when upstream is done.
343
+ *
344
+ * @category constructors
345
+ * @since 4.0.0
346
+ */
347
+ const fromWritableChannel = (options) => fromTransform((pull) => {
348
+ const writable = options.evaluate();
349
+ return succeed(pullIntoWritable({
350
+ ...options,
351
+ writable,
352
+ pull
353
+ }));
354
+ });
355
+ /**
356
+ * Writes Effect chunks into a Node writable stream.
357
+ *
358
+ * **When to use**
359
+ *
360
+ * Use to implement custom Node stream adapters that already have an upstream
361
+ * pull and need direct control over a writable stream.
362
+ *
363
+ * **Details**
364
+ *
365
+ * The loop waits for `drain` when needed, fails on writable errors, and ends
366
+ * the writable on upstream completion unless `endOnDone` is `false`.
367
+ *
368
+ * @category converting
369
+ * @since 4.0.0
370
+ */
371
+ const pullIntoWritable = (options) => options.pull.pipe(flatMap((chunk) => {
372
+ let i = 0;
373
+ return callback(function loop(resume) {
374
+ for (; i < chunk.length;) if (!options.writable.write(chunk[i++], options.encoding)) {
375
+ options.writable.once("drain", () => loop(resume));
376
+ return;
377
+ }
378
+ resume(void_);
379
+ });
380
+ }), forever({ disableYield: true }), raceFirst(callback((resume) => {
381
+ const onError = (error) => resume(fail(options.onError(error)));
382
+ options.writable.once("error", onError);
383
+ return sync(() => {
384
+ options.writable.off("error", onError);
385
+ });
386
+ })), options.endOnDone !== false ? catchDone((_) => {
387
+ if ("closed" in options.writable && options.writable.closed) return done(_);
388
+ return callback((resume) => {
389
+ options.writable.once("finish", () => resume(done(_)));
390
+ options.writable.end();
391
+ });
392
+ }) : identity);
393
+ //#endregion
394
+ //#region ../../node_modules/.pnpm/@effect+platform-node-share_9c633f87f6fead147ad02fc5b0d67765/node_modules/@effect/platform-node-shared/dist/NodeStream.js
395
+ /**
396
+ * Adapters between Node streams and Effect streams, channels, and readables.
397
+ *
398
+ * This module is the stream boundary for Node APIs. It wraps `Readable` and
399
+ * `Duplex` values as Effect `Stream`s and `Channel`s, pipes Effect streams
400
+ * through Node duplex streams, exposes an Effect `Stream` back to Node as a
401
+ * `Readable`, and collects readable payloads into strings, array buffers, or
402
+ * `Uint8Array`s with optional byte limits.
403
+ *
404
+ * @since 4.0.0
405
+ */
406
+ /**
407
+ * Converts a Node readable stream into an Effect `Stream`, reading chunks with
408
+ * an optional chunk size, mapping stream errors with `onError`, and destroying
409
+ * the readable on completion unless `closeOnDone` is `false`.
410
+ *
411
+ * @category constructors
412
+ * @since 4.0.0
413
+ */
414
+ const fromReadable = (options) => fromChannel$1(fromReadableChannel(options));
415
+ /**
416
+ * Creates a `Channel` that pulls chunks from a Node readable stream, mapping
417
+ * errors with `onError` and destroying the readable on completion unless
418
+ * `closeOnDone` is `false`.
419
+ *
420
+ * @category constructors
421
+ * @since 4.0.0
422
+ */
423
+ const fromReadableChannel = (options) => fromTransform((_, scope) => readableToPullUnsafe({
424
+ scope,
425
+ readable: options.evaluate(),
426
+ onError: options.onError ?? defaultOnError,
427
+ chunkSize: options.chunkSize,
428
+ closeOnDone: options.closeOnDone
429
+ }));
430
+ /**
431
+ * Consumes a Node readable stream into a string using the selected encoding,
432
+ * failing through `onError` on stream errors or when `maxBytes` is exceeded
433
+ * and destroying the stream on interruption or failure.
434
+ *
435
+ * @category converting
436
+ * @since 4.0.0
437
+ */
438
+ const toString = (readable, options) => {
439
+ const maxBytesNumber = options?.maxBytes ? Number(options.maxBytes) : void 0;
440
+ const onError = options?.onError ?? defaultOnError;
441
+ const encoding = options?.encoding ?? "utf8";
442
+ return callback((resume) => {
443
+ const stream = readable();
444
+ stream.setEncoding(encoding);
445
+ stream.once("error", (err) => {
446
+ if ("closed" in stream && !stream.closed) stream.destroy();
447
+ resume(fail(onError(err)));
448
+ });
449
+ stream.once("error", (err) => {
450
+ resume(fail(onError(err)));
451
+ });
452
+ let string = "";
453
+ let bytes = 0;
454
+ stream.once("end", () => {
455
+ resume(succeed(string));
456
+ });
457
+ stream.on("data", (chunk) => {
458
+ string += chunk;
459
+ bytes += Buffer.byteLength(chunk);
460
+ if (maxBytesNumber && bytes > maxBytesNumber) resume(fail(onError(/* @__PURE__ */ new Error("maxBytes exceeded"))));
461
+ });
462
+ return sync(() => {
463
+ if ("closed" in stream && !stream.closed) stream.destroy();
464
+ });
465
+ });
466
+ };
467
+ /**
468
+ * Consumes a Node readable stream into an `ArrayBuffer`, failing through
469
+ * `onError` on stream errors or when `maxBytes` is exceeded and destroying the
470
+ * stream on interruption or failure.
471
+ *
472
+ * @category converting
473
+ * @since 4.0.0
474
+ */
475
+ const toArrayBuffer = (readable, options) => {
476
+ const maxBytesNumber = options?.maxBytes ? Number(options.maxBytes) : void 0;
477
+ const onError = options?.onError ?? defaultOnError;
478
+ return callback((resume) => {
479
+ const stream = readable();
480
+ const buffers = [];
481
+ let bytes = 0;
482
+ stream.once("error", (err) => {
483
+ if ("closed" in stream && !stream.closed) stream.destroy();
484
+ resume(fail(onError(err)));
485
+ });
486
+ stream.once("end", () => {
487
+ const buffer = buffers.length === 1 ? buffers[0] : Buffer.concat(buffers);
488
+ if (buffer.byteOffset === 0 && buffer.buffer.byteLength === buffer.byteLength) return resume(succeed(buffer.buffer));
489
+ resume(succeed(buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)));
490
+ });
491
+ stream.on("data", (chunk) => {
492
+ buffers.push(chunk);
493
+ bytes += chunk.length;
494
+ if (maxBytesNumber && bytes > maxBytesNumber) resume(fail(onError(/* @__PURE__ */ new Error("maxBytes exceeded"))));
495
+ });
496
+ return sync(() => {
497
+ if ("closed" in stream && !stream.closed) stream.destroy();
498
+ });
499
+ });
500
+ };
501
+ /**
502
+ * Consumes a Node readable stream into a `Uint8Array`, using the same error
503
+ * mapping and `maxBytes` handling as `toArrayBuffer`.
504
+ *
505
+ * @category converting
506
+ * @since 4.0.0
507
+ */
508
+ const toUint8Array = (readable, options) => map(toArrayBuffer(readable, options), (buffer) => new Uint8Array(buffer));
509
+ const readableToPullUnsafe = (options) => {
510
+ const readable = options.readable;
511
+ const closeOnDone = options.closeOnDone ?? true;
512
+ const exit = options.exit ?? make$8(void 0);
513
+ const latch = makeUnsafe$1(false);
514
+ function onReadable() {
515
+ latch.openUnsafe();
516
+ }
517
+ function onError(error) {
518
+ exit.current = fail$1(options.onError(error));
519
+ latch.openUnsafe();
520
+ }
521
+ function onEnd() {
522
+ exit.current = fail$1(Done());
523
+ latch.openUnsafe();
524
+ }
525
+ readable.on("readable", onReadable);
526
+ readable.once("error", onError);
527
+ readable.once("end", onEnd);
528
+ const pull = suspend(function loop() {
529
+ let item = options.readable.read(options.chunkSize);
530
+ if (item === null) {
531
+ if (exit.current) return exit.current;
532
+ if (readable.readableEnded) return fail(Done());
533
+ latch.closeUnsafe();
534
+ return flatMap(latch.await, loop);
535
+ }
536
+ const chunk = of(item);
537
+ while (true) {
538
+ item = options.readable.read(options.chunkSize);
539
+ if (item === null) break;
540
+ chunk.push(item);
541
+ }
542
+ return succeed(chunk);
543
+ });
544
+ return as(addFinalizer(options.scope, sync(() => {
545
+ readable.off("readable", onReadable);
546
+ readable.off("error", onError);
547
+ readable.off("end", onEnd);
548
+ if (closeOnDone && "closed" in options.readable && !options.readable.closed) options.readable.destroy();
549
+ })), pull);
550
+ };
551
+ const defaultOnError = (error) => new UnknownError(error);
552
+ //#endregion
553
+ //#region ../../node_modules/.pnpm/@effect+platform-node-share_9c633f87f6fead147ad02fc5b0d67765/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
554
+ const toError = (error) => error instanceof globalThis.Error ? error : new globalThis.Error(String(error));
555
+ const toPlatformError = (method, error, command) => {
556
+ const { commands } = flattenCommand(command);
557
+ const commandStr = commands.reduce((acc, curr) => {
558
+ const cmd = `${curr.command} ${curr.args.join(" ")}`;
559
+ return acc.length === 0 ? cmd : `${acc} | ${cmd}`;
560
+ }, "");
561
+ return handleErrnoException("ChildProcess", method)(error, [commandStr]);
562
+ };
563
+ /**
564
+ * Layer that provides the `NodeChildProcessSpawner` implementation.
565
+ *
566
+ * @category layers
567
+ * @since 4.0.0
568
+ */
569
+ const layer$5 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(function* () {
570
+ const fs = yield* FileSystem;
571
+ const path = yield* Path$1;
572
+ const resolveWorkingDirectory = fnUntraced(function* (options) {
573
+ if (isUndefined(options.cwd)) return void 0;
574
+ yield* fs.access(options.cwd);
575
+ return path.resolve(options.cwd);
576
+ });
577
+ const resolveEnvironment = (options) => {
578
+ return options.extendEnv ? {
579
+ ...globalThis.process.env,
580
+ ...options.env
581
+ } : options.env;
582
+ };
583
+ const inputToStdioOption = (input) => isStream(input) ? "pipe" : input;
584
+ const outputToStdioOption = (input) => isSink(input) ? "pipe" : input;
585
+ const resolveStdinOption = (options) => {
586
+ const defaultConfig = {
587
+ stream: "pipe",
588
+ encoding: "utf-8",
589
+ endOnDone: true
590
+ };
591
+ if (isUndefined(options.stdin)) return defaultConfig;
592
+ if (typeof options.stdin === "string") return {
593
+ ...defaultConfig,
594
+ stream: options.stdin
595
+ };
596
+ if (isStream(options.stdin)) return {
597
+ ...defaultConfig,
598
+ stream: options.stdin
599
+ };
600
+ return {
601
+ stream: options.stdin.stream,
602
+ encoding: options.stdin.encoding ?? defaultConfig.encoding,
603
+ endOnDone: options.stdin.endOnDone ?? defaultConfig.endOnDone
604
+ };
605
+ };
606
+ const resolveOutputOption = (options, streamName) => {
607
+ const option = options[streamName];
608
+ if (isUndefined(option)) return { stream: "pipe" };
609
+ if (typeof option === "string") return { stream: option };
610
+ if (isSink(option)) return { stream: option };
611
+ return { stream: option.stream };
612
+ };
613
+ const resolveAdditionalFds = (options) => {
614
+ if (isUndefined(options.additionalFds)) return [];
615
+ const result = [];
616
+ for (const [name, config] of Object.entries(options.additionalFds)) {
617
+ const fd = parseFdName(name);
618
+ if (isNotUndefined(fd)) result.push({
619
+ fd,
620
+ config
621
+ });
622
+ }
623
+ return result.sort((a, b) => a.fd - b.fd);
624
+ };
625
+ const buildStdioArray = (stdinConfig, stdoutConfig, stderrConfig, additionalFds) => {
626
+ const stdio = [
627
+ inputToStdioOption(stdinConfig.stream),
628
+ outputToStdioOption(stdoutConfig.stream),
629
+ outputToStdioOption(stderrConfig.stream)
630
+ ];
631
+ if (additionalFds.length === 0) return stdio;
632
+ const maxFd = additionalFds.reduce((max, { fd }) => Math.max(max, fd), 2);
633
+ for (let i = 3; i <= maxFd; i++) stdio[i] = "ignore";
634
+ for (const { fd } of additionalFds) stdio[fd] = "pipe";
635
+ return stdio;
636
+ };
637
+ const setupAdditionalFds = fnUntraced(function* (command, childProcess, additionalFds) {
638
+ if (additionalFds.length === 0) return {
639
+ getInputFd: () => drain,
640
+ getOutputFd: () => empty
641
+ };
642
+ const inputSinks = /* @__PURE__ */ new Map();
643
+ const outputStreams = /* @__PURE__ */ new Map();
644
+ for (const { config, fd } of additionalFds) {
645
+ const nodeStream = childProcess.stdio[fd];
646
+ switch (config.type) {
647
+ case "input": {
648
+ let sink = drain;
649
+ if (nodeStream && "write" in nodeStream) sink = fromWritable({
650
+ evaluate: () => nodeStream,
651
+ onError: (error) => toPlatformError(`fromWritable(fd${fd})`, toError(error), command)
652
+ });
653
+ if (config.stream) yield* forkScoped(run(config.stream, sink));
654
+ inputSinks.set(fd, sink);
655
+ break;
656
+ }
657
+ case "output": {
658
+ let stream = empty;
659
+ if (nodeStream && "read" in nodeStream) {
660
+ const passThrough = new PassThrough();
661
+ nodeStream.on("error", (error) => passThrough.destroy(error));
662
+ nodeStream.pipe(passThrough);
663
+ stream = fromReadable({
664
+ evaluate: () => passThrough,
665
+ onError: (error) => toPlatformError(`fromReadable(fd${fd})`, toError(error), command)
666
+ });
667
+ }
668
+ if (config.sink) stream = transduce(stream, config.sink);
669
+ outputStreams.set(fd, stream);
670
+ break;
671
+ }
672
+ }
673
+ }
674
+ return {
675
+ getInputFd: (fd) => inputSinks.get(fd) ?? drain,
676
+ getOutputFd: (fd) => outputStreams.get(fd) ?? empty
677
+ };
678
+ });
679
+ const setupChildStdin = (command, childProcess, config) => suspend(() => {
680
+ let sink = drain;
681
+ if (isNotNull(childProcess.stdin)) sink = fromWritable({
682
+ evaluate: () => childProcess.stdin,
683
+ onError: (error) => toPlatformError("fromWritable(stdin)", toError(error), command),
684
+ endOnDone: config.endOnDone,
685
+ encoding: config.encoding
686
+ });
687
+ if (isStream(config.stream)) return as(forkScoped(run(config.stream, sink)), sink);
688
+ return succeed(sink);
689
+ });
690
+ const setupChildOutputStreams = (command, childProcess, stdoutConfig, stderrConfig) => {
691
+ let stdout = childProcess.stdout ? (() => {
692
+ const passThrough = new PassThrough();
693
+ childProcess.stdout.on("error", (error) => passThrough.destroy(error));
694
+ childProcess.stdout.pipe(passThrough);
695
+ return fromReadable({
696
+ evaluate: () => passThrough,
697
+ onError: (error) => toPlatformError("fromReadable(stdout)", toError(error), command)
698
+ });
699
+ })() : empty;
700
+ let stderr = childProcess.stderr ? (() => {
701
+ const passThrough = new PassThrough();
702
+ childProcess.stderr.on("error", (error) => passThrough.destroy(error));
703
+ childProcess.stderr.pipe(passThrough);
704
+ return fromReadable({
705
+ evaluate: () => passThrough,
706
+ onError: (error) => toPlatformError("fromReadable(stderr)", toError(error), command)
707
+ });
708
+ })() : empty;
709
+ if (isSink(stdoutConfig.stream)) stdout = transduce(stdout, stdoutConfig.stream);
710
+ if (isSink(stderrConfig.stream)) stderr = transduce(stderr, stderrConfig.stream);
711
+ const all = merge(stdout, stderr);
712
+ return {
713
+ stdout,
714
+ stderr,
715
+ all
716
+ };
717
+ };
718
+ const spawn = (command, spawnOptions) => callback((resume) => {
719
+ const deferred = makeUnsafe();
720
+ const handle = NodeChildProcess.spawn(command.command, command.args, spawnOptions);
721
+ handle.on("error", (error) => {
722
+ resume(fail(toPlatformError("spawn", error, command)));
723
+ });
724
+ handle.on("exit", (...args) => {
725
+ doneUnsafe(deferred, succeed$1(args));
726
+ });
727
+ handle.on("spawn", () => {
728
+ resume(succeed([handle, deferred]));
729
+ });
730
+ return sync(() => {
731
+ handle.kill("SIGTERM");
732
+ });
733
+ });
734
+ const killProcessGroup = (command, childProcess, signal) => {
735
+ if (globalThis.process.platform === "win32") return callback((resume) => {
736
+ NodeChildProcess.exec(`taskkill /pid ${childProcess.pid} /T /F`, { windowsHide: true }, (error) => {
737
+ if (error) resume(fail(toPlatformError("kill", toError(error), command)));
738
+ else resume(void_);
739
+ });
740
+ });
741
+ return try_({
742
+ try: () => {
743
+ globalThis.process.kill(-childProcess.pid, signal);
744
+ },
745
+ catch: (error) => toPlatformError("kill", toError(error), command)
746
+ });
747
+ };
748
+ const killProcessGroupOnExit = (childProcess, signal) => {
749
+ if (globalThis.process.platform === "win32") {
750
+ NodeChildProcess.exec(`taskkill /pid ${childProcess.pid} /T /F`, { windowsHide: true }, () => {});
751
+ return;
752
+ }
753
+ try {
754
+ globalThis.process.kill(-childProcess.pid, signal);
755
+ } catch {}
756
+ };
757
+ const killProcess = (command, childProcess, signal) => suspend(() => {
758
+ if (!childProcess.kill(signal)) {
759
+ const error = new globalThis.Error("Failed to kill child process");
760
+ return fail(toPlatformError("kill", error, command));
761
+ }
762
+ return void_;
763
+ });
764
+ const withTimeout = (childProcess, command, options) => (kill) => {
765
+ const killSignal = options?.killSignal ?? "SIGTERM";
766
+ return isUndefined(options?.forceKillAfter) ? kill(command, childProcess, killSignal) : timeoutOrElse(kill(command, childProcess, killSignal), {
767
+ duration: options.forceKillAfter,
768
+ orElse: () => kill(command, childProcess, "SIGKILL")
769
+ });
770
+ };
771
+ /**
772
+ * Get the appropriate source stream from a process handle based on the
773
+ * `from` pipe option.
774
+ */
775
+ const getSourceStream = (handle, from) => {
776
+ const fromOption = from ?? "stdout";
777
+ switch (fromOption) {
778
+ case "stdout": return handle.stdout;
779
+ case "stderr": return handle.stderr;
780
+ case "all": return handle.all;
781
+ default: {
782
+ const fd = parseFdName(fromOption);
783
+ if (isNotUndefined(fd)) return handle.getOutputFd(fd);
784
+ return handle.stdout;
785
+ }
786
+ }
787
+ };
788
+ const spawnCommand = fnUntraced(function* (cmd) {
789
+ switch (cmd._tag) {
790
+ case "StandardCommand": {
791
+ const stdinConfig = resolveStdinOption(cmd.options);
792
+ const stdoutConfig = resolveOutputOption(cmd.options, "stdout");
793
+ const stderrConfig = resolveOutputOption(cmd.options, "stderr");
794
+ const resolvedAdditionalFds = resolveAdditionalFds(cmd.options);
795
+ let isReferenced = true;
796
+ const cwd = yield* resolveWorkingDirectory(cmd.options);
797
+ const env = resolveEnvironment(cmd.options);
798
+ const stdio = buildStdioArray(stdinConfig, stdoutConfig, stderrConfig, resolvedAdditionalFds);
799
+ const [childProcess, exitSignal] = yield* acquireRelease(spawn(cmd, {
800
+ cwd,
801
+ env,
802
+ stdio,
803
+ detached: cmd.options.detached ?? process.platform !== "win32",
804
+ shell: cmd.options.shell,
805
+ ...globalThis.process.platform === "win32" ? { windowsHide: true } : {}
806
+ }), fnUntraced(function* ([childProcess, exitSignal]) {
807
+ const exited = yield* isDone(exitSignal);
808
+ const killWithTimeout = withTimeout(childProcess, cmd, cmd.options);
809
+ if (exited) {
810
+ const [code] = yield* _await(exitSignal);
811
+ if (code !== 0 && isNotNull(code)) return yield* ignore(killWithTimeout(killProcessGroup));
812
+ return yield* void_;
813
+ }
814
+ if (!isReferenced) return yield* void_;
815
+ return yield* killWithTimeout((command, childProcess, signal) => killProcessGroup(command, childProcess, signal).pipe(catch_(() => killProcess(command, childProcess, signal)), andThen(_await(exitSignal)))).pipe(ignore);
816
+ }));
817
+ const pid = ProcessId(childProcess.pid);
818
+ childProcess.on("exit", (code) => {
819
+ if (code !== 0 && isNotNull(code)) killProcessGroupOnExit(childProcess, cmd.options.killSignal ?? "SIGTERM");
820
+ });
821
+ const reref = sync(() => {
822
+ if (!isReferenced) {
823
+ childProcess.ref();
824
+ isReferenced = true;
825
+ }
826
+ });
827
+ const unref = sync(() => {
828
+ if (isReferenced) {
829
+ childProcess.unref();
830
+ isReferenced = false;
831
+ }
832
+ return reref;
833
+ });
834
+ const stdin = yield* setupChildStdin(cmd, childProcess, stdinConfig);
835
+ const { all, stderr, stdout } = setupChildOutputStreams(cmd, childProcess, stdoutConfig, stderrConfig);
836
+ const { getInputFd, getOutputFd } = yield* setupAdditionalFds(cmd, childProcess, resolvedAdditionalFds);
837
+ const isRunning = map(isDone(exitSignal), (done) => !done);
838
+ const exitCode = flatMap(_await(exitSignal), ([code, signal]) => {
839
+ if (isNotNull(code)) return succeed(ExitCode(code));
840
+ const error = new globalThis.Error(`Process interrupted due to receipt of signal: '${signal}'`);
841
+ return fail(toPlatformError("exitCode", error, cmd));
842
+ });
843
+ const kill = (options) => {
844
+ return withTimeout(childProcess, cmd, options)((command, childProcess, signal) => killProcessGroup(command, childProcess, signal).pipe(catch_(() => killProcess(command, childProcess, signal)), andThen(_await(exitSignal)))).pipe(asVoid);
845
+ };
846
+ return makeHandle({
847
+ pid,
848
+ exitCode,
849
+ isRunning,
850
+ kill,
851
+ stdin,
852
+ stdout,
853
+ stderr,
854
+ all,
855
+ getInputFd,
856
+ getOutputFd,
857
+ unref
858
+ });
859
+ }
860
+ case "PipedCommand": {
861
+ const { commands, pipeOptions } = flattenCommand(cmd);
862
+ const [root, ...pipeline] = commands;
863
+ const handles = [yield* spawnCommand(root)];
864
+ for (let i = 0; i < pipeline.length; i++) {
865
+ const command = pipeline[i];
866
+ const options = pipeOptions[i] ?? {};
867
+ const stdinConfig = resolveStdinOption(command.options);
868
+ const sourceStream = unwrap(succeed(getSourceStream(handles[handles.length - 1], options.from)));
869
+ const toOption = options.to ?? "stdin";
870
+ if (toOption === "stdin") handles.push(yield* spawnCommand(make$6(command.command, command.args, {
871
+ ...command.options,
872
+ stdin: {
873
+ ...stdinConfig,
874
+ stream: sourceStream
875
+ }
876
+ })));
877
+ else {
878
+ const fd = parseFdName(toOption);
879
+ if (isNotUndefined(fd)) {
880
+ const fdName$1 = fdName(fd);
881
+ const existingFds = command.options.additionalFds ?? {};
882
+ handles.push(yield* spawnCommand(make$6(command.command, command.args, {
883
+ ...command.options,
884
+ additionalFds: {
885
+ ...existingFds,
886
+ [fdName$1]: {
887
+ type: "input",
888
+ stream: sourceStream
889
+ }
890
+ }
891
+ })));
892
+ } else handles.push(yield* spawnCommand(make$6(command.command, command.args, {
893
+ ...command.options,
894
+ stdin: {
895
+ ...stdinConfig,
896
+ stream: sourceStream
897
+ }
898
+ })));
899
+ }
900
+ }
901
+ const handle = handles[handles.length - 1];
902
+ const unref = gen(function* () {
903
+ const rerefs = [];
904
+ for (const handle of handles) rerefs.push(yield* handle.unref);
905
+ return forEach([...rerefs].reverse(), (reref) => reref, { discard: true });
906
+ });
907
+ return makeHandle({
908
+ pid: handle.pid,
909
+ exitCode: handle.exitCode,
910
+ isRunning: handle.isRunning,
911
+ kill: handle.kill,
912
+ stdin: handle.stdin,
913
+ stdout: handle.stdout,
914
+ stderr: handle.stderr,
915
+ all: handle.all,
916
+ getInputFd: handle.getInputFd,
917
+ getOutputFd: handle.getOutputFd,
918
+ unref
919
+ });
920
+ }
921
+ }
922
+ });
923
+ return make$7(spawnCommand);
924
+ }));
925
+ /**
926
+ * Flattens a `Command` into an array of `StandardCommand`s along with pipe
927
+ * options for each connection.
928
+ *
929
+ * @category transforming
930
+ * @since 4.0.0
931
+ */
932
+ const flattenCommand = (command) => {
933
+ const commands = [];
934
+ const pipeOptions = [];
935
+ const flatten = (cmd) => {
936
+ switch (cmd._tag) {
937
+ case "StandardCommand":
938
+ commands.push(cmd);
939
+ break;
940
+ case "PipedCommand":
941
+ flatten(cmd.left);
942
+ pipeOptions.push(cmd.options);
943
+ flatten(cmd.right);
944
+ break;
945
+ }
946
+ };
947
+ flatten(command);
948
+ if (commands.length === 0) throw new Error("flattenCommand produced empty commands array");
949
+ const [first, ...rest] = commands;
950
+ return {
951
+ commands: [first, ...rest],
952
+ pipeOptions
953
+ };
954
+ };
955
+ //#endregion
956
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.102_patch_10dcca2e28a1e6c67a3825e6da1ff253/node_modules/effect/dist/Crypto.js
957
+ /**
958
+ * Defines a platform-independent service for cryptographic operations.
959
+ *
960
+ * Runtime packages provide concrete implementations backed by the host
961
+ * platform's cryptography APIs. This module defines the service interface and a
962
+ * constructor from random-byte and digest primitives. The service provides
963
+ * secure random bytes and numbers, UUIDv4 and UUIDv7 generation, shuffling, and
964
+ * SHA message digests.
965
+ *
966
+ * @since 4.0.0
967
+ */
968
+ const TypeId$2 = "~effect/platform/Crypto";
969
+ /**
970
+ * Service tag for platform cryptography.
971
+ *
972
+ * **When to use**
973
+ *
974
+ * Use when you need to provide or retrieve the full platform cryptography
975
+ * service from an effect's context.
976
+ *
977
+ * **Details**
978
+ *
979
+ * Providing this service supplies platform-agnostic cryptographic operations
980
+ * such as hashing, UUID generation, and secure random values.
981
+ *
982
+ * @see {@link make} for constructing a Crypto service from primitive operations
983
+ *
984
+ * @category services
985
+ * @since 4.0.0
986
+ */
987
+ const Crypto = /*#__PURE__*/ Service("effect/Crypto");
988
+ /**
989
+ * Creates a `Crypto` service from the primitive implementation, deriving the
990
+ * random generator helpers and UUID generation from those primitives.
991
+ *
992
+ * **When to use**
993
+ *
994
+ * Use to build a Crypto service for a platform integration, test layer, or
995
+ * custom runtime from primitive random-byte and digest operations.
996
+ *
997
+ * **Details**
998
+ *
999
+ * The constructor derives random numbers, booleans, integer ranges, shuffling,
1000
+ * and UUID generation from `impl.randomBytes`. Digest operations delegate to
1001
+ * `impl.digest`.
1002
+ *
1003
+ * **Gotchas**
1004
+ *
1005
+ * `impl.randomBytes` must return cryptographically secure bytes of the
1006
+ * requested length. UUID formatting mutates the byte array returned for UUID
1007
+ * generation, so the implementation should return a fresh array for each call.
1008
+ *
1009
+ * **Example** (Creating a Crypto service)
1010
+ *
1011
+ * ```ts
1012
+ * import { Crypto, Effect, Layer } from "effect"
1013
+ *
1014
+ * const TestCrypto = Layer.succeed(
1015
+ * Crypto.Crypto,
1016
+ * Crypto.make({
1017
+ * randomBytes: (size) => new Uint8Array(size),
1018
+ * digest: (_algorithm, data) => Effect.succeed(data)
1019
+ * })
1020
+ * )
1021
+ * ```
1022
+ *
1023
+ * @category constructors
1024
+ * @since 4.0.0
1025
+ */
1026
+ const make$4 = (impl) => {
1027
+ const randomBytesUnsafe = impl.randomBytes;
1028
+ const randomBytes = (size) => map(validateSize("randomBytes", size), randomBytesUnsafe);
1029
+ const nextDoubleUnsafe = () => {
1030
+ const bytes = randomBytesUnsafe(7);
1031
+ return ((bytes[0] & 31) * 2 ** 48 + bytes[1] * 2 ** 40 + bytes[2] * 2 ** 32 + bytes[3] * 2 ** 24 + bytes[4] * 2 ** 16 + bytes[5] * 2 ** 8 + bytes[6]) / 2 ** 53;
1032
+ };
1033
+ const nextIntUnsafe = () => Math.floor(nextDoubleUnsafe() * (Number.MAX_SAFE_INTEGER - Number.MIN_SAFE_INTEGER + 1)) + Number.MIN_SAFE_INTEGER;
1034
+ return Crypto.of({
1035
+ [TypeId$2]: TypeId$2,
1036
+ randomBytes,
1037
+ nextDoubleUnsafe,
1038
+ nextIntUnsafe,
1039
+ digest: impl.digest,
1040
+ random: sync(() => nextDoubleUnsafe()),
1041
+ randomBoolean: sync(() => nextDoubleUnsafe() > .5),
1042
+ randomInt: sync(() => nextIntUnsafe()),
1043
+ randomBetween: (min, max) => sync(() => nextDoubleUnsafe() * (max - min) + min),
1044
+ randomIntBetween(min, max, options) {
1045
+ const extra = options?.halfOpen === true ? 0 : 1;
1046
+ return sync(() => {
1047
+ const minInt = Math.ceil(min);
1048
+ const maxInt = Math.floor(max);
1049
+ return Math.floor(nextDoubleUnsafe() * (maxInt - minInt + extra)) + minInt;
1050
+ });
1051
+ },
1052
+ randomShuffle: (elements) => sync(() => {
1053
+ const buffer = Array.from(elements);
1054
+ for (let i = buffer.length - 1; i >= 1; i = i - 1) {
1055
+ const index = Math.min(i, Math.floor(nextDoubleUnsafe() * (i + 1)));
1056
+ const value = buffer[i];
1057
+ buffer[i] = buffer[index];
1058
+ buffer[index] = value;
1059
+ }
1060
+ return buffer;
1061
+ }),
1062
+ randomUUIDv4: sync(() => formatUUIDv4(randomBytesUnsafe(16))),
1063
+ randomUUIDv7: clockWith((clock) => succeed(formatUUIDv7(clock.currentTimeMillisUnsafe(), randomBytesUnsafe(16))))
1064
+ });
1065
+ };
1066
+ const validateSize = (method, size) => Number.isSafeInteger(size) && size >= 0 ? succeed(size) : fail(badArgument({
1067
+ module: "Crypto",
1068
+ method,
1069
+ description: "size must be a non-negative safe integer"
1070
+ }));
1071
+ const hex = (byte) => byte.toString(16).padStart(2, "0");
1072
+ const formatUUID = (bytes) => {
1073
+ return [
1074
+ bytes.subarray(0, 4),
1075
+ bytes.subarray(4, 6),
1076
+ bytes.subarray(6, 8),
1077
+ bytes.subarray(8, 10),
1078
+ bytes.subarray(10, 16)
1079
+ ].map((segment) => Array.from(segment, hex).join("")).join("-");
1080
+ };
1081
+ const formatUUIDv4 = (bytes) => {
1082
+ bytes[6] = bytes[6] & 15 | 64;
1083
+ bytes[8] = bytes[8] & 63 | 128;
1084
+ return formatUUID(bytes);
1085
+ };
1086
+ const maxUUIDv7Timestamp = 2 ** 48 - 1;
1087
+ const formatUUIDv7 = (timestampMillis, bytes) => {
1088
+ const timestamp = Math.min(Math.max(0, Math.trunc(timestampMillis)), maxUUIDv7Timestamp);
1089
+ bytes[0] = Math.floor(timestamp / 2 ** 40);
1090
+ bytes[1] = Math.floor(timestamp / 2 ** 32) & 255;
1091
+ bytes[2] = Math.floor(timestamp / 2 ** 24) & 255;
1092
+ bytes[3] = Math.floor(timestamp / 2 ** 16) & 255;
1093
+ bytes[4] = Math.floor(timestamp / 2 ** 8) & 255;
1094
+ bytes[5] = timestamp & 255;
1095
+ bytes[6] = bytes[6] & 15 | 112;
1096
+ bytes[8] = bytes[8] & 63 | 128;
1097
+ return formatUUID(bytes);
1098
+ };
1099
+ //#endregion
1100
+ //#region ../../node_modules/.pnpm/@effect+platform-node-share_9c633f87f6fead147ad02fc5b0d67765/node_modules/@effect/platform-node-shared/dist/NodeCrypto.js
1101
+ /**
1102
+ * Node-compatible implementation of Effect's `Crypto` service.
1103
+ *
1104
+ * This module builds the service from `node:crypto`, using `randomBytes` for
1105
+ * random data and `createHash` for supported digest algorithms. It exports
1106
+ * `make` as the concrete service value and `layer` for providing it through
1107
+ * Effect context.
1108
+ *
1109
+ * @since 1.0.0
1110
+ */
1111
+ const toHashAlgorithm = (algorithm) => {
1112
+ switch (algorithm) {
1113
+ case "SHA-1": return "sha1";
1114
+ case "SHA-256": return "sha256";
1115
+ case "SHA-384": return "sha384";
1116
+ case "SHA-512": return "sha512";
1117
+ }
1118
+ };
1119
+ const digest = (algorithm, data) => try_({
1120
+ try: () => Uint8Array.from(NodeCrypto.createHash(toHashAlgorithm(algorithm)).update(data).digest()),
1121
+ catch: (cause) => systemError({
1122
+ module: "Crypto",
1123
+ method: "digest",
1124
+ _tag: "Unknown",
1125
+ description: "Could not compute digest",
1126
+ cause
1127
+ })
1128
+ });
1129
+ /**
1130
+ * Layer that provides the Node.js Crypto service implementation.
1131
+ *
1132
+ * @category layers
1133
+ * @since 1.0.0
1134
+ */
1135
+ const layer$4 = /*#__PURE__*/ succeed$2(Crypto, /* @__PURE__ */ make$4({
1136
+ randomBytes: NodeCrypto.randomBytes,
1137
+ digest
1138
+ }));
1139
+ //#endregion
1140
+ //#region ../../node_modules/.pnpm/@effect+platform-node-share_9c633f87f6fead147ad02fc5b0d67765/node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js
1141
+ /**
1142
+ * Shared Node-compatible implementation of Effect's `FileSystem` service.
1143
+ *
1144
+ * This module adapts Node's `node:fs`, `node:os`, and `node:path` APIs into a
1145
+ * `FileSystem` layer for Effect programs running on Node-compatible runtimes.
1146
+ * Platform packages use it to provide file and directory I/O, permissions,
1147
+ * links, metadata, temporary files and directories, and file watching through
1148
+ * the shared `FileSystem` service.
1149
+ *
1150
+ * @since 4.0.0
1151
+ */
1152
+ const handleBadArgument = (method) => (err) => badArgument({
1153
+ module: "FileSystem",
1154
+ method,
1155
+ description: err.message ?? String(err)
1156
+ });
1157
+ const access = /*#__PURE__*/ (() => {
1158
+ const nodeAccess = /*#__PURE__*/ effectify(NFS.access, /*#__PURE__*/ handleErrnoException("FileSystem", "access"), /*#__PURE__*/ handleBadArgument("access"));
1159
+ return (path, options) => {
1160
+ let mode = NFS.constants.F_OK;
1161
+ if (options?.readable) mode |= NFS.constants.R_OK;
1162
+ if (options?.writable) mode |= NFS.constants.W_OK;
1163
+ return nodeAccess(path, mode);
1164
+ };
1165
+ })();
1166
+ const copy = /*#__PURE__*/ (() => {
1167
+ const nodeCp = /*#__PURE__*/ effectify(NFS.cp, /*#__PURE__*/ handleErrnoException("FileSystem", "copy"), /*#__PURE__*/ handleBadArgument("copy"));
1168
+ return (fromPath, toPath, options) => nodeCp(fromPath, toPath, {
1169
+ force: options?.overwrite ?? false,
1170
+ preserveTimestamps: options?.preserveTimestamps ?? false,
1171
+ recursive: true
1172
+ });
1173
+ })();
1174
+ const copyFile = /*#__PURE__*/ (() => {
1175
+ const nodeCopyFile = /*#__PURE__*/ effectify(NFS.copyFile, /*#__PURE__*/ handleErrnoException("FileSystem", "copyFile"), /*#__PURE__*/ handleBadArgument("copyFile"));
1176
+ return (fromPath, toPath) => nodeCopyFile(fromPath, toPath);
1177
+ })();
1178
+ const chmod = /*#__PURE__*/ (() => {
1179
+ const nodeChmod = /*#__PURE__*/ effectify(NFS.chmod, /*#__PURE__*/ handleErrnoException("FileSystem", "chmod"), /*#__PURE__*/ handleBadArgument("chmod"));
1180
+ return (path, mode) => nodeChmod(path, mode);
1181
+ })();
1182
+ const chown = /*#__PURE__*/ (() => {
1183
+ const nodeChown = /*#__PURE__*/ effectify(NFS.chown, /*#__PURE__*/ handleErrnoException("FileSystem", "chown"), /*#__PURE__*/ handleBadArgument("chown"));
1184
+ return (path, uid, gid) => nodeChown(path, uid, gid);
1185
+ })();
1186
+ const glob = /*#__PURE__*/ (() => {
1187
+ const nodeGlob = /*#__PURE__*/ effectify(NFS.glob, /*#__PURE__*/ handleErrnoException("FileSystem", "glob"), /*#__PURE__*/ handleBadArgument("glob"));
1188
+ return (pattern, options) => nodeGlob(pattern, {
1189
+ cwd: options?.root,
1190
+ exclude: options?.exclude
1191
+ });
1192
+ })();
1193
+ const link = /*#__PURE__*/ (() => {
1194
+ const nodeLink = /*#__PURE__*/ effectify(NFS.link, /*#__PURE__*/ handleErrnoException("FileSystem", "link"), /*#__PURE__*/ handleBadArgument("link"));
1195
+ return (existingPath, newPath) => nodeLink(existingPath, newPath);
1196
+ })();
1197
+ const makeDirectory = /*#__PURE__*/ (() => {
1198
+ const nodeMkdir = /*#__PURE__*/ effectify(NFS.mkdir, /*#__PURE__*/ handleErrnoException("FileSystem", "makeDirectory"), /*#__PURE__*/ handleBadArgument("makeDirectory"));
1199
+ return (path, options) => nodeMkdir(path, {
1200
+ recursive: options?.recursive ?? false,
1201
+ mode: options?.mode
1202
+ });
1203
+ })();
1204
+ const makeTempDirectoryFactory = (method) => {
1205
+ const nodeMkdtemp = effectify(NFS.mkdtemp, handleErrnoException("FileSystem", method), handleBadArgument(method));
1206
+ return (options) => suspend(() => {
1207
+ const prefix = options?.prefix ?? "";
1208
+ const directory = typeof options?.directory === "string" ? Path.join(options.directory, ".") : OS.tmpdir();
1209
+ return nodeMkdtemp(prefix ? Path.join(directory, prefix) : directory + "/");
1210
+ });
1211
+ };
1212
+ const makeTempDirectory = /*#__PURE__*/ makeTempDirectoryFactory("makeTempDirectory");
1213
+ const removeFactory = (method) => {
1214
+ const nodeRm = effectify(NFS.rm, handleErrnoException("FileSystem", method), handleBadArgument(method));
1215
+ return (path, options) => nodeRm(path, {
1216
+ recursive: options?.recursive ?? false,
1217
+ force: options?.force ?? false
1218
+ });
1219
+ };
1220
+ const remove = /*#__PURE__*/ removeFactory("remove");
1221
+ const makeTempDirectoryScoped = /*#__PURE__*/ (() => {
1222
+ const makeDirectory = /*#__PURE__*/ makeTempDirectoryFactory("makeTempDirectoryScoped");
1223
+ const removeDirectory = /*#__PURE__*/ removeFactory("makeTempDirectoryScoped");
1224
+ return (options) => acquireRelease(makeDirectory(options), (directory) => orDie(removeDirectory(directory, { recursive: true })));
1225
+ })();
1226
+ const openFactory = (method) => {
1227
+ const nodeOpen = effectify(NFS.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
1228
+ const nodeClose = effectify(NFS.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
1229
+ return (path, options) => pipe(acquireRelease(nodeOpen(path, options?.flag ?? "r", options?.mode), (fd) => orDie(nodeClose(fd))), map((fd) => makeFile(FileDescriptor(fd), options?.flag?.startsWith("a") ?? false)));
1230
+ };
1231
+ const open = /*#__PURE__*/ openFactory("open");
1232
+ const makeFile = /*#__PURE__*/ (() => {
1233
+ const nodeReadFactory = (method) => effectify(NFS.read, handleErrnoException("FileSystem", method), handleBadArgument(method));
1234
+ const nodeRead = /*#__PURE__*/ nodeReadFactory("read");
1235
+ const nodeReadAlloc = /*#__PURE__*/ nodeReadFactory("readAlloc");
1236
+ const nodeStat = /*#__PURE__*/ effectify(NFS.fstat, /*#__PURE__*/ handleErrnoException("FileSystem", "stat"), /*#__PURE__*/ handleBadArgument("stat"));
1237
+ const nodeTruncate = /*#__PURE__*/ effectify(NFS.ftruncate, /*#__PURE__*/ handleErrnoException("FileSystem", "truncate"), /*#__PURE__*/ handleBadArgument("truncate"));
1238
+ const nodeSync = /*#__PURE__*/ effectify(NFS.fsync, /*#__PURE__*/ handleErrnoException("FileSystem", "sync"), /*#__PURE__*/ handleBadArgument("sync"));
1239
+ const nodeWriteFactory = (method) => effectify(NFS.write, handleErrnoException("FileSystem", method), handleBadArgument(method));
1240
+ const nodeWrite = /*#__PURE__*/ nodeWriteFactory("write");
1241
+ const nodeWriteAll = /*#__PURE__*/ nodeWriteFactory("writeAll");
1242
+ class FileImpl {
1243
+ [FileTypeId];
1244
+ fd;
1245
+ append;
1246
+ position = /*#__PURE__*/ BigInt(0);
1247
+ constructor(fd, append) {
1248
+ this[FileTypeId] = FileTypeId;
1249
+ this.fd = fd;
1250
+ this.append = append;
1251
+ }
1252
+ get stat() {
1253
+ return map(nodeStat(this.fd), makeFileInfo);
1254
+ }
1255
+ get sync() {
1256
+ return nodeSync(this.fd);
1257
+ }
1258
+ seek(offset, from) {
1259
+ const offsetSize = Size(offset);
1260
+ return sync(() => {
1261
+ if (from === "start") this.position = offsetSize;
1262
+ else if (from === "current") this.position = this.position + offsetSize;
1263
+ return this.position;
1264
+ });
1265
+ }
1266
+ read(buffer) {
1267
+ return suspend(() => {
1268
+ const position = this.position;
1269
+ return map(nodeRead(this.fd, {
1270
+ buffer,
1271
+ position
1272
+ }), (bytesRead) => {
1273
+ const sizeRead = Size(bytesRead);
1274
+ this.position = position + sizeRead;
1275
+ return sizeRead;
1276
+ });
1277
+ });
1278
+ }
1279
+ readAlloc(size) {
1280
+ const sizeNumber = Number(size);
1281
+ return suspend(() => {
1282
+ const buffer = Buffer.allocUnsafeSlow(sizeNumber);
1283
+ const position = this.position;
1284
+ return map(nodeReadAlloc(this.fd, {
1285
+ buffer,
1286
+ position
1287
+ }), (bytesRead) => {
1288
+ if (bytesRead === 0) return none();
1289
+ this.position = position + BigInt(bytesRead);
1290
+ if (bytesRead === sizeNumber) return some(buffer);
1291
+ const dst = Buffer.allocUnsafeSlow(bytesRead);
1292
+ buffer.copy(dst, 0, 0, bytesRead);
1293
+ return some(dst);
1294
+ });
1295
+ });
1296
+ }
1297
+ truncate(length) {
1298
+ return map(nodeTruncate(this.fd, length ? Number(length) : void 0), () => {
1299
+ if (!this.append) {
1300
+ const len = BigInt(length ?? 0);
1301
+ if (this.position > len) this.position = len;
1302
+ }
1303
+ });
1304
+ }
1305
+ write(buffer) {
1306
+ return suspend(() => {
1307
+ const position = this.position;
1308
+ return map(nodeWrite(this.fd, buffer, void 0, void 0, this.append ? void 0 : Number(position)), (bytesWritten) => {
1309
+ const sizeWritten = Size(bytesWritten);
1310
+ if (!this.append) this.position = position + sizeWritten;
1311
+ return sizeWritten;
1312
+ });
1313
+ });
1314
+ }
1315
+ writeAllChunk(buffer) {
1316
+ return suspend(() => {
1317
+ const position = this.position;
1318
+ return flatMap(nodeWriteAll(this.fd, buffer, void 0, void 0, this.append ? void 0 : Number(position)), (bytesWritten) => {
1319
+ if (bytesWritten === 0) return fail(systemError({
1320
+ module: "FileSystem",
1321
+ method: "writeAll",
1322
+ _tag: "WriteZero",
1323
+ pathOrDescriptor: this.fd,
1324
+ description: "write returned 0 bytes written"
1325
+ }));
1326
+ if (!this.append) this.position = position + BigInt(bytesWritten);
1327
+ return bytesWritten < buffer.length ? this.writeAllChunk(buffer.subarray(bytesWritten)) : void_;
1328
+ });
1329
+ });
1330
+ }
1331
+ writeAll(buffer) {
1332
+ return this.writeAllChunk(buffer);
1333
+ }
1334
+ }
1335
+ return (fd, append) => new FileImpl(fd, append);
1336
+ })();
1337
+ const makeTempFileFactory = (method) => {
1338
+ const makeDirectory = makeTempDirectoryFactory(method);
1339
+ return fnUntraced(function* (options) {
1340
+ const directory = yield* makeDirectory(options);
1341
+ const random = NodeCrypto.randomBytes(6).toString("hex");
1342
+ const name = Path.join(directory, options?.suffix ? `${random}${options.suffix}` : random);
1343
+ yield* writeFile(name, /* @__PURE__ */ new Uint8Array(0));
1344
+ return name;
1345
+ });
1346
+ };
1347
+ const makeTempFile = /*#__PURE__*/ makeTempFileFactory("makeTempFile");
1348
+ const makeTempFileScoped = /*#__PURE__*/ (() => {
1349
+ const makeFile = /*#__PURE__*/ makeTempFileFactory("makeTempFileScoped");
1350
+ const removeDirectory = /*#__PURE__*/ removeFactory("makeTempFileScoped");
1351
+ return (options) => acquireRelease(makeFile(options), (file) => orDie(removeDirectory(Path.dirname(file), { recursive: true })));
1352
+ })();
1353
+ const readDirectory = (path, options) => tryPromise({
1354
+ try: () => NFS.promises.readdir(path, options),
1355
+ catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [path])
1356
+ });
1357
+ const readFile = (path) => callback((resume, signal) => {
1358
+ try {
1359
+ NFS.readFile(path, { signal }, (err, data) => {
1360
+ if (err) resume(fail(handleErrnoException("FileSystem", "readFile")(err, [path])));
1361
+ else resume(succeed(data));
1362
+ });
1363
+ } catch (err) {
1364
+ resume(fail(handleBadArgument("readFile")(err)));
1365
+ }
1366
+ });
1367
+ const readLink = /*#__PURE__*/ (() => {
1368
+ const nodeReadLink = /*#__PURE__*/ effectify(NFS.readlink, /*#__PURE__*/ handleErrnoException("FileSystem", "readLink"), /*#__PURE__*/ handleBadArgument("readLink"));
1369
+ return (path) => nodeReadLink(path);
1370
+ })();
1371
+ const realPath = /*#__PURE__*/ (() => {
1372
+ const nodeRealPath = /*#__PURE__*/ effectify(NFS.realpath, /*#__PURE__*/ handleErrnoException("FileSystem", "realPath"), /*#__PURE__*/ handleBadArgument("realPath"));
1373
+ return (path) => nodeRealPath(path);
1374
+ })();
1375
+ const rename = /*#__PURE__*/ (() => {
1376
+ const nodeRename = /*#__PURE__*/ effectify(NFS.rename, /*#__PURE__*/ handleErrnoException("FileSystem", "rename"), /*#__PURE__*/ handleBadArgument("rename"));
1377
+ return (oldPath, newPath) => nodeRename(oldPath, newPath);
1378
+ })();
1379
+ const makeFileInfo = (stat) => ({
1380
+ type: stat.isFile() ? "File" : stat.isDirectory() ? "Directory" : stat.isSymbolicLink() ? "SymbolicLink" : stat.isBlockDevice() ? "BlockDevice" : stat.isCharacterDevice() ? "CharacterDevice" : stat.isFIFO() ? "FIFO" : stat.isSocket() ? "Socket" : "Unknown",
1381
+ mtime: fromNullishOr(stat.mtime),
1382
+ atime: fromNullishOr(stat.atime),
1383
+ birthtime: fromNullishOr(stat.birthtime),
1384
+ dev: stat.dev,
1385
+ rdev: fromNullishOr(stat.rdev),
1386
+ ino: fromNullishOr(stat.ino),
1387
+ mode: stat.mode,
1388
+ nlink: fromNullishOr(stat.nlink),
1389
+ uid: fromNullishOr(stat.uid),
1390
+ gid: fromNullishOr(stat.gid),
1391
+ size: Size(stat.size),
1392
+ blksize: stat.blksize !== void 0 ? some(Size(stat.blksize)) : none(),
1393
+ blocks: fromNullishOr(stat.blocks)
1394
+ });
1395
+ const stat = /*#__PURE__*/ (() => {
1396
+ const nodeStat = /*#__PURE__*/ effectify(NFS.stat, /*#__PURE__*/ handleErrnoException("FileSystem", "stat"), /*#__PURE__*/ handleBadArgument("stat"));
1397
+ return (path) => map(nodeStat(path), makeFileInfo);
1398
+ })();
1399
+ const symlink = /*#__PURE__*/ (() => {
1400
+ const nodeSymlink = /*#__PURE__*/ effectify(NFS.symlink, /*#__PURE__*/ handleErrnoException("FileSystem", "symlink"), /*#__PURE__*/ handleBadArgument("symlink"));
1401
+ return (target, path) => nodeSymlink(target, path);
1402
+ })();
1403
+ const truncate = /*#__PURE__*/ (() => {
1404
+ const nodeTruncate = /*#__PURE__*/ effectify(NFS.truncate, /*#__PURE__*/ handleErrnoException("FileSystem", "truncate"), /*#__PURE__*/ handleBadArgument("truncate"));
1405
+ return (path, length) => nodeTruncate(path, length !== void 0 ? Number(length) : void 0);
1406
+ })();
1407
+ const utimes = /*#__PURE__*/ (() => {
1408
+ const nodeUtimes = /*#__PURE__*/ effectify(NFS.utimes, /*#__PURE__*/ handleErrnoException("FileSystem", "utime"), /*#__PURE__*/ handleBadArgument("utime"));
1409
+ return (path, atime, mtime) => nodeUtimes(path, atime, mtime);
1410
+ })();
1411
+ const watchNode = (path) => callback$1((queue) => acquireRelease(sync(() => {
1412
+ const watcher = NFS.watch(path, { recursive: true }, (event, path) => {
1413
+ if (!path) return;
1414
+ switch (event) {
1415
+ case "rename":
1416
+ runFork(matchEffect(stat(path), {
1417
+ onSuccess: (_) => offer(queue, {
1418
+ _tag: "Create",
1419
+ path
1420
+ }),
1421
+ onFailure: (_) => offer(queue, {
1422
+ _tag: "Remove",
1423
+ path
1424
+ })
1425
+ }));
1426
+ return;
1427
+ case "change":
1428
+ offerUnsafe(queue, {
1429
+ _tag: "Update",
1430
+ path
1431
+ });
1432
+ return;
1433
+ }
1434
+ });
1435
+ watcher.on("error", (error) => {
1436
+ failCauseUnsafe(queue, fail$2(systemError({
1437
+ module: "FileSystem",
1438
+ _tag: "Unknown",
1439
+ method: "watch",
1440
+ pathOrDescriptor: path,
1441
+ cause: error
1442
+ })));
1443
+ });
1444
+ watcher.on("close", () => {
1445
+ endUnsafe(queue);
1446
+ });
1447
+ return watcher;
1448
+ }), (watcher) => sync(() => watcher.close())));
1449
+ const watch = (backend, path) => stat(path).pipe(map((stat) => backend.pipe(flatMap$1((_) => _.register(path, stat)), getOrElse(() => watchNode(path)))), unwrap);
1450
+ const writeFile = (path, data, options) => callback((resume, signal) => {
1451
+ try {
1452
+ NFS.writeFile(path, data, {
1453
+ signal,
1454
+ flag: options?.flag,
1455
+ mode: options?.mode
1456
+ }, (err) => {
1457
+ if (err) resume(fail(handleErrnoException("FileSystem", "writeFile")(err, [path])));
1458
+ else resume(void_);
1459
+ });
1460
+ } catch (err) {
1461
+ resume(fail(handleBadArgument("writeFile")(err)));
1462
+ }
1463
+ });
1464
+ const makeFileSystem = /*#__PURE__*/ map(/*#__PURE__*/ serviceOption(WatchBackend), (backend) => make$9({
1465
+ access,
1466
+ chmod,
1467
+ chown,
1468
+ copy,
1469
+ copyFile,
1470
+ glob,
1471
+ link,
1472
+ makeDirectory,
1473
+ makeTempDirectory,
1474
+ makeTempDirectoryScoped,
1475
+ makeTempFile,
1476
+ makeTempFileScoped,
1477
+ open,
1478
+ readDirectory,
1479
+ readFile,
1480
+ readLink,
1481
+ realPath,
1482
+ remove,
1483
+ rename,
1484
+ stat,
1485
+ symlink,
1486
+ truncate,
1487
+ utimes,
1488
+ watch(path) {
1489
+ return watch(backend, path);
1490
+ },
1491
+ writeFile
1492
+ }));
1493
+ /**
1494
+ * Provides the `FileSystem` service backed by Node filesystem APIs, including
1495
+ * file operations, directory operations, links, metadata, and file watching.
1496
+ *
1497
+ * @category layers
1498
+ * @since 4.0.0
1499
+ */
1500
+ const layer$3 = /*#__PURE__*/ effect(FileSystem)(makeFileSystem);
1501
+ //#endregion
1502
+ //#region ../../node_modules/.pnpm/@effect+platform-node-share_9c633f87f6fead147ad02fc5b0d67765/node_modules/@effect/platform-node-shared/dist/NodePath.js
1503
+ /**
1504
+ * Node-backed provider for Effect's `Path` service.
1505
+ *
1506
+ * This module turns Node's `node:path` and `node:url` APIs into `Path` layers.
1507
+ * `layer` uses the host platform path implementation, while `layerPosix` and
1508
+ * `layerWin32` provide fixed POSIX and Windows variants. All three layers also
1509
+ * include helpers for converting between file paths and file URLs.
1510
+ *
1511
+ * @since 4.0.0
1512
+ */
1513
+ const fromFileUrl = (url) => try_({
1514
+ try: () => NodeUrl.fileURLToPath(url),
1515
+ catch: (cause) => new BadArgument({
1516
+ module: "Path",
1517
+ method: "fromFileUrl",
1518
+ cause
1519
+ })
1520
+ });
1521
+ const toFileUrl = (path) => try_({
1522
+ try: () => NodeUrl.pathToFileURL(path),
1523
+ catch: (cause) => new BadArgument({
1524
+ module: "Path",
1525
+ method: "toFileUrl",
1526
+ cause
1527
+ })
1528
+ });
1529
+ ({ ...Path.posix });
1530
+ ({ ...Path.win32 });
1531
+ /**
1532
+ * Provides the default `Path` service using the host platform's Node path
1533
+ * implementation plus file URL conversion helpers.
1534
+ *
1535
+ * @category layers
1536
+ * @since 4.0.0
1537
+ */
1538
+ const layer$2 = /*#__PURE__*/ succeed$2(Path$1)({
1539
+ [TypeId$4]: TypeId$4,
1540
+ ...Path,
1541
+ fromFileUrl,
1542
+ toFileUrl
1543
+ });
1544
+ //#endregion
1545
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.102_patch_10dcca2e28a1e6c67a3825e6da1ff253/node_modules/effect/dist/Stdio.js
1546
+ /**
1547
+ * Service contract for command-line arguments and standard input, output, and
1548
+ * error output. It lets programs depend on standard I/O through the Effect
1549
+ * environment instead of reading from or writing to global process handles
1550
+ * directly.
1551
+ *
1552
+ * The service exposes arguments as an `Effect`, stdout and stderr as `Sink`s
1553
+ * that accept strings or bytes, and stdin as a byte `Stream`. This module also
1554
+ * provides a constructor for service values and a small test layer with
1555
+ * overridable defaults.
1556
+ *
1557
+ * @since 4.0.0
1558
+ */
1559
+ /**
1560
+ * Runtime identifier stored on `Stdio` service implementations.
1561
+ *
1562
+ * **Details**
1563
+ *
1564
+ * This marker is part of the runtime representation of `Stdio` service
1565
+ * implementations.
1566
+ *
1567
+ * @category type IDs
1568
+ * @since 4.0.0
1569
+ */
1570
+ const TypeId$1 = "~effect/Stdio";
1571
+ /**
1572
+ * Service tag for process standard I/O.
1573
+ *
1574
+ * **When to use**
1575
+ *
1576
+ * Use when you need command-line arguments or standard I/O streams supplied by
1577
+ * an effect's environment.
1578
+ *
1579
+ * @see {@link make} for constructing a `Stdio` service directly
1580
+ * @see {@link layerTest} for a test layer with defaults and overrides
1581
+ *
1582
+ * @category services
1583
+ * @since 4.0.0
1584
+ */
1585
+ const Stdio = /*#__PURE__*/ Service(TypeId$1);
1586
+ /**
1587
+ * Creates a `Stdio` service implementation from the provided fields and
1588
+ * attaches the `Stdio` type identifier.
1589
+ *
1590
+ * **When to use**
1591
+ *
1592
+ * Use when you need to assemble a concrete `Stdio` service from command-line
1593
+ * arguments and standard I/O implementations.
1594
+ *
1595
+ * **Details**
1596
+ *
1597
+ * The returned service reuses the supplied fields unchanged and only adds the
1598
+ * `Stdio` type identifier; it does not create a `Layer` or provide defaults.
1599
+ *
1600
+ * @see {@link layerTest} for a test layer with default fields that can be overridden
1601
+ *
1602
+ * @category constructors
1603
+ * @since 4.0.0
1604
+ */
1605
+ const make$2 = (options) => ({
1606
+ [TypeId$1]: TypeId$1,
1607
+ ...options
1608
+ });
1609
+ //#endregion
1610
+ //#region ../../node_modules/.pnpm/@effect+platform-node-share_9c633f87f6fead147ad02fc5b0d67765/node_modules/@effect/platform-node-shared/dist/NodeStdio.js
1611
+ /**
1612
+ * Shared Node.js implementation of the Effect `Stdio` service.
1613
+ *
1614
+ * `NodeStdio` provides {@link Stdio.Stdio} from the current Node process. The
1615
+ * exported {@link layer} reads command-line arguments from `process.argv`,
1616
+ * consumes input from `process.stdin`, and writes normal and error output to
1617
+ * `process.stdout` and `process.stderr`. Standard input remains open, and
1618
+ * standard output and error output are not ended unless requested.
1619
+ *
1620
+ * @since 4.0.0
1621
+ */
1622
+ /**
1623
+ * Provides `Stdio` from `process.argv`, `process.stdin`, `process.stdout`,
1624
+ * and `process.stderr`; stdin remains open and stdout/stderr are not ended by
1625
+ * default.
1626
+ *
1627
+ * @category layers
1628
+ * @since 4.0.0
1629
+ */
1630
+ const layer$1 = /*#__PURE__*/ succeed$2(Stdio, /*#__PURE__*/ make$2({
1631
+ args: /*#__PURE__*/ sync(() => process.argv.slice(2)),
1632
+ stdout: (options) => fromWritable({
1633
+ evaluate: () => process.stdout,
1634
+ onError: (cause) => systemError({
1635
+ module: "Stdio",
1636
+ method: "stdout",
1637
+ _tag: "Unknown",
1638
+ cause
1639
+ }),
1640
+ endOnDone: options?.endOnDone ?? false
1641
+ }),
1642
+ stderr: (options) => fromWritable({
1643
+ evaluate: () => process.stderr,
1644
+ onError: (cause) => systemError({
1645
+ module: "Stdio",
1646
+ method: "stderr",
1647
+ _tag: "Unknown",
1648
+ cause
1649
+ }),
1650
+ endOnDone: options?.endOnDone ?? false
1651
+ }),
1652
+ stdin: /*#__PURE__*/ fromReadable({
1653
+ evaluate: () => process.stdin,
1654
+ onError: (cause) => systemError({
1655
+ module: "Stdio",
1656
+ method: "stdin",
1657
+ _tag: "Unknown",
1658
+ cause
1659
+ }),
1660
+ closeOnDone: false
1661
+ })
1662
+ }));
1663
+ //#endregion
1664
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.102_patch_10dcca2e28a1e6c67a3825e6da1ff253/node_modules/effect/dist/Terminal.js
1665
+ const TypeId = "~effect/platform/Terminal";
1666
+ const QuitErrorTypeId = "effect/platform/Terminal/QuitError";
1667
+ /**
1668
+ * Represents an error that occurs when a user attempts to
1669
+ * quit out of a `Terminal` prompt for input (usually by entering `ctrl`+`c`).
1670
+ *
1671
+ * **When to use**
1672
+ *
1673
+ * Use when implementing terminal input or prompts that need to signal
1674
+ * user-requested cancellation through the typed error channel.
1675
+ *
1676
+ * @see {@link isQuitError} for checking unknown errors when handling terminal cancellation
1677
+ *
1678
+ * @category QuitError
1679
+ * @since 4.0.0
1680
+ */
1681
+ var QuitError = class extends ErrorClass("QuitError")({ _tag: /*#__PURE__*/ tag("QuitError") }) {
1682
+ /**
1683
+ * Marks this value as a terminal quit error for runtime guards.
1684
+ *
1685
+ * @since 4.0.0
1686
+ */
1687
+ [QuitErrorTypeId] = QuitErrorTypeId;
1688
+ };
1689
+ /**
1690
+ * Returns `true` if the provided value is a `Terminal.QuitError`.
1691
+ *
1692
+ * **When to use**
1693
+ *
1694
+ * Use to narrow unknown failures to `QuitError` when handling terminal input
1695
+ * cancellation.
1696
+ *
1697
+ * **Details**
1698
+ *
1699
+ * Returns `true` when the value carries the `QuitError` runtime marker and
1700
+ * narrows it to `QuitError`.
1701
+ *
1702
+ * @see {@link QuitError} for the error value produced when terminal input is quit
1703
+ *
1704
+ * @category guards
1705
+ * @since 4.0.0
1706
+ */
1707
+ const isQuitError = (u) => hasProperty(u, QuitErrorTypeId);
1708
+ /**
1709
+ * Service tag for command-line input and output services.
1710
+ *
1711
+ * **When to use**
1712
+ *
1713
+ * Use to access or provide platform terminal capabilities such as reading
1714
+ * input, writing output, and inspecting terminal dimensions.
1715
+ *
1716
+ * @category services
1717
+ * @since 4.0.0
1718
+ */
1719
+ const Terminal = /*#__PURE__*/ Service("effect/platform/Terminal");
1720
+ /**
1721
+ * Creates a `Terminal` service implementation.
1722
+ *
1723
+ * **When to use**
1724
+ *
1725
+ * Use to construct a custom `Terminal` service implementation from concrete
1726
+ * terminal capabilities when writing a platform adapter, test implementation,
1727
+ * or custom runtime service.
1728
+ *
1729
+ * **Details**
1730
+ *
1731
+ * The implementation object supplies `columns`, `rows`, `readInput`,
1732
+ * `readLine`, and `display`; `make` attaches the `Terminal` service marker so
1733
+ * the result can be provided through the `Terminal` context service.
1734
+ *
1735
+ * @category constructors
1736
+ * @since 4.0.0
1737
+ */
1738
+ const make$1 = (impl) => Terminal.of({
1739
+ ...impl,
1740
+ [TypeId]: TypeId
1741
+ });
1742
+ /**
1743
+ * Provides the default process-backed `Terminal` service, ending key input on
1744
+ * Ctrl+C or Ctrl+D.
1745
+ *
1746
+ * @category layers
1747
+ * @since 4.0.0
1748
+ */
1749
+ const layer = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
1750
+ const stdin = process.stdin;
1751
+ const stdout = process.stdout;
1752
+ const rlRef = yield* make$10({ acquire: acquireRelease(sync(() => {
1753
+ const rl = readline.createInterface({
1754
+ input: stdin,
1755
+ escapeCodeTimeout: 50
1756
+ });
1757
+ readline.emitKeypressEvents(stdin, rl);
1758
+ if (stdin.isTTY) stdin.setRawMode(true);
1759
+ return rl;
1760
+ }), (rl) => sync(() => {
1761
+ if (stdin.isTTY) stdin.setRawMode(false);
1762
+ rl.close();
1763
+ })) });
1764
+ const columns = sync(() => stdout.columns ?? 0);
1765
+ const rows = sync(() => stdout.rows ?? 0);
1766
+ const readInput = gen(function* () {
1767
+ yield* get(rlRef);
1768
+ const queue = yield* make$11();
1769
+ const handleKeypress = (s, k) => {
1770
+ const userInput = {
1771
+ input: fromUndefinedOr(s),
1772
+ key: {
1773
+ name: k.name ?? "",
1774
+ ctrl: !!k.ctrl,
1775
+ meta: !!k.meta,
1776
+ shift: !!k.shift
1777
+ }
1778
+ };
1779
+ offerUnsafe(queue, userInput);
1780
+ if (shouldQuit(userInput)) endUnsafe(queue);
1781
+ };
1782
+ yield* addFinalizer$1(() => sync(() => stdin.off("keypress", handleKeypress)));
1783
+ stdin.on("keypress", handleKeypress);
1784
+ return queue;
1785
+ });
1786
+ const readLine = scoped(flatMap(get(rlRef), (readlineInterface) => callback((resume) => {
1787
+ const onLine = (line) => resume(succeed(line));
1788
+ readlineInterface.once("line", onLine);
1789
+ return sync(() => readlineInterface.off("line", onLine));
1790
+ })));
1791
+ const display = (prompt) => uninterruptible(callback((resume) => {
1792
+ stdout.write(prompt, (err) => isNullish(err) ? resume(void_) : resume(fail(badArgument({
1793
+ module: "Terminal",
1794
+ method: "display",
1795
+ description: "Failed to write prompt to stdout",
1796
+ cause: err
1797
+ }))));
1798
+ }));
1799
+ return make$1({
1800
+ columns,
1801
+ rows,
1802
+ readInput,
1803
+ readLine,
1804
+ display
1805
+ });
1806
+ }))(defaultShouldQuit));
1807
+ function defaultShouldQuit(input) {
1808
+ return input.key.ctrl && (input.key.name === "c" || input.key.name === "d");
1809
+ }
1810
+ //#endregion
1811
+ export { make$6 as _, layer$1 as a, layer$2 as c, Crypto as d, layer$5 as f, toUint8Array as g, toString as h, isQuitError as i, layer$3 as l, toArrayBuffer as m, QuitError as n, Stdio as o, fromReadable as p, Terminal as r, make$2 as s, layer as t, layer$4 as u, ChildProcessSpawner as v, ExitCode as y };
1812
+
1813
+ //# sourceMappingURL=NodeTerminal-C6yhrF1E.mjs.map