@smthrs/platform-node 0.0.0-stage → 1.0.0-rc.4

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 (442) hide show
  1. package/CHANGELOG.md +211 -0
  2. package/LICENSE +21 -0
  3. package/README.md +165 -2
  4. package/bin/darwin-arm64/smithers-jj-export +0 -0
  5. package/bin/darwin-x64/smithers-jj-export +0 -0
  6. package/bin/linux-arm64/smithers-jj-export +0 -0
  7. package/bin/linux-x64/smithers-jj-export +4 -0
  8. package/bin/win32-x64/smithers-jj-export.exe +0 -0
  9. package/dist/cjs/AtomicFileSystem.d.ts +147 -0
  10. package/dist/cjs/AtomicFileSystem.d.ts.map +1 -0
  11. package/dist/cjs/AtomicFileSystem.js +234 -0
  12. package/dist/cjs/AtomicFileSystem.js.map +7 -0
  13. package/dist/cjs/EgressHttpClient.d.ts +106 -0
  14. package/dist/cjs/EgressHttpClient.d.ts.map +1 -0
  15. package/dist/cjs/EgressHttpClient.js +202 -0
  16. package/dist/cjs/EgressHttpClient.js.map +7 -0
  17. package/dist/cjs/HostLiveness.d.ts +81 -0
  18. package/dist/cjs/HostLiveness.d.ts.map +1 -0
  19. package/dist/cjs/HostLiveness.js +49 -0
  20. package/dist/cjs/HostLiveness.js.map +7 -0
  21. package/dist/cjs/NodeHost.d.ts +145 -0
  22. package/dist/cjs/NodeHost.d.ts.map +1 -0
  23. package/dist/cjs/NodeHost.js +128 -0
  24. package/dist/cjs/NodeHost.js.map +7 -0
  25. package/dist/cjs/ProcessConfinement.d.ts +61 -0
  26. package/dist/cjs/ProcessConfinement.d.ts.map +1 -0
  27. package/dist/cjs/ProcessConfinement.js +292 -0
  28. package/dist/cjs/ProcessConfinement.js.map +7 -0
  29. package/dist/cjs/ProcessReaper.d.ts +457 -0
  30. package/dist/cjs/ProcessReaper.d.ts.map +1 -0
  31. package/dist/cjs/ProcessReaper.js +349 -0
  32. package/dist/cjs/ProcessReaper.js.map +7 -0
  33. package/dist/cjs/ProcessSandbox.d.ts +391 -0
  34. package/dist/cjs/ProcessSandbox.d.ts.map +1 -0
  35. package/dist/cjs/ProcessSandbox.js +774 -0
  36. package/dist/cjs/ProcessSandbox.js.map +7 -0
  37. package/dist/cjs/ScopedProcess.d.ts +66 -0
  38. package/dist/cjs/ScopedProcess.d.ts.map +1 -0
  39. package/dist/cjs/ScopedProcess.js +87 -0
  40. package/dist/cjs/ScopedProcess.js.map +7 -0
  41. package/dist/cjs/index.d.ts +38 -0
  42. package/dist/cjs/index.d.ts.map +1 -0
  43. package/dist/cjs/index.js +47 -0
  44. package/dist/cjs/index.js.map +7 -0
  45. package/dist/cjs/internal/AtomicFileSystemExecutable.d.ts +61 -0
  46. package/dist/cjs/internal/AtomicFileSystemExecutable.d.ts.map +1 -0
  47. package/dist/cjs/internal/AtomicFileSystemExecutable.js +250 -0
  48. package/dist/cjs/internal/AtomicFileSystemExecutable.js.map +7 -0
  49. package/dist/cjs/internal/AtomicFileSystemProtocol.d.ts +78 -0
  50. package/dist/cjs/internal/AtomicFileSystemProtocol.d.ts.map +1 -0
  51. package/dist/cjs/internal/AtomicFileSystemProtocol.js +382 -0
  52. package/dist/cjs/internal/AtomicFileSystemProtocol.js.map +7 -0
  53. package/dist/cjs/internal/AtomicFileSystemTransport.d.ts +44 -0
  54. package/dist/cjs/internal/AtomicFileSystemTransport.d.ts.map +1 -0
  55. package/dist/cjs/internal/AtomicFileSystemTransport.js +197 -0
  56. package/dist/cjs/internal/AtomicFileSystemTransport.js.map +7 -0
  57. package/dist/cjs/internal/AtomicHelperError.d.ts +35 -0
  58. package/dist/cjs/internal/AtomicHelperError.d.ts.map +1 -0
  59. package/dist/cjs/internal/AtomicHelperError.js +45 -0
  60. package/dist/cjs/internal/AtomicHelperError.js.map +7 -0
  61. package/dist/cjs/internal/AtomicHelperFault.d.ts +59 -0
  62. package/dist/cjs/internal/AtomicHelperFault.d.ts.map +1 -0
  63. package/dist/cjs/internal/AtomicHelperFault.js +66 -0
  64. package/dist/cjs/internal/AtomicHelperFault.js.map +7 -0
  65. package/dist/cjs/internal/PipedProcess.d.ts +35 -0
  66. package/dist/cjs/internal/PipedProcess.d.ts.map +1 -0
  67. package/dist/cjs/internal/PipedProcess.js +309 -0
  68. package/dist/cjs/internal/PipedProcess.js.map +7 -0
  69. package/dist/cjs/internal/ProcSnapshot.d.ts +85 -0
  70. package/dist/cjs/internal/ProcSnapshot.d.ts.map +1 -0
  71. package/dist/cjs/internal/ProcSnapshot.js +123 -0
  72. package/dist/cjs/internal/ProcSnapshot.js.map +7 -0
  73. package/dist/cjs/internal/ProcessCleanup.d.ts +64 -0
  74. package/dist/cjs/internal/ProcessCleanup.d.ts.map +1 -0
  75. package/dist/cjs/internal/ProcessCleanup.js +62 -0
  76. package/dist/cjs/internal/ProcessCleanup.js.map +7 -0
  77. package/dist/cjs/internal/ProcessCleanupPolicyError.d.ts +30 -0
  78. package/dist/cjs/internal/ProcessCleanupPolicyError.d.ts.map +1 -0
  79. package/dist/cjs/internal/ProcessCleanupPolicyError.js +33 -0
  80. package/dist/cjs/internal/ProcessCleanupPolicyError.js.map +7 -0
  81. package/dist/cjs/internal/ProcessFault.d.ts +63 -0
  82. package/dist/cjs/internal/ProcessFault.d.ts.map +1 -0
  83. package/dist/cjs/internal/ProcessFault.js +63 -0
  84. package/dist/cjs/internal/ProcessFault.js.map +7 -0
  85. package/dist/cjs/internal/ProcessSupervisor.d.ts +143 -0
  86. package/dist/cjs/internal/ProcessSupervisor.d.ts.map +1 -0
  87. package/dist/cjs/internal/ProcessSupervisor.js +685 -0
  88. package/dist/cjs/internal/ProcessSupervisor.js.map +7 -0
  89. package/dist/cjs/internal/SupervisorProgram.d.ts +9 -0
  90. package/dist/cjs/internal/SupervisorProgram.d.ts.map +1 -0
  91. package/dist/cjs/internal/SupervisorProgram.js +326 -0
  92. package/dist/cjs/internal/SupervisorProgram.js.map +7 -0
  93. package/dist/cjs/internal/WindowsProcessJob.d.ts +39 -0
  94. package/dist/cjs/internal/WindowsProcessJob.d.ts.map +1 -0
  95. package/dist/cjs/internal/WindowsProcessJob.js +113 -0
  96. package/dist/cjs/internal/WindowsProcessJob.js.map +7 -0
  97. package/dist/cjs/package.json +1 -0
  98. package/dist/esm/AtomicFileSystem.d.ts +147 -0
  99. package/dist/esm/AtomicFileSystem.d.ts.map +1 -0
  100. package/dist/esm/AtomicFileSystem.js +290 -0
  101. package/dist/esm/AtomicFileSystem.js.map +1 -0
  102. package/dist/esm/EgressHttpClient.d.ts +106 -0
  103. package/dist/esm/EgressHttpClient.d.ts.map +1 -0
  104. package/dist/esm/EgressHttpClient.js +259 -0
  105. package/dist/esm/EgressHttpClient.js.map +1 -0
  106. package/dist/esm/HostLiveness.d.ts +81 -0
  107. package/dist/esm/HostLiveness.d.ts.map +1 -0
  108. package/dist/esm/HostLiveness.js +68 -0
  109. package/dist/esm/HostLiveness.js.map +1 -0
  110. package/dist/esm/NodeHost.d.ts +145 -0
  111. package/dist/esm/NodeHost.d.ts.map +1 -0
  112. package/dist/esm/NodeHost.js +162 -0
  113. package/dist/esm/NodeHost.js.map +1 -0
  114. package/dist/esm/ProcessConfinement.d.ts +61 -0
  115. package/dist/esm/ProcessConfinement.d.ts.map +1 -0
  116. package/dist/esm/ProcessConfinement.js +311 -0
  117. package/dist/esm/ProcessConfinement.js.map +1 -0
  118. package/dist/esm/ProcessReaper.d.ts +457 -0
  119. package/dist/esm/ProcessReaper.d.ts.map +1 -0
  120. package/dist/esm/ProcessReaper.js +711 -0
  121. package/dist/esm/ProcessReaper.js.map +1 -0
  122. package/dist/esm/ProcessSandbox.d.ts +391 -0
  123. package/dist/esm/ProcessSandbox.d.ts.map +1 -0
  124. package/dist/esm/ProcessSandbox.js +1043 -0
  125. package/dist/esm/ProcessSandbox.js.map +1 -0
  126. package/dist/esm/ScopedProcess.d.ts +66 -0
  127. package/dist/esm/ScopedProcess.d.ts.map +1 -0
  128. package/dist/esm/ScopedProcess.js +67 -0
  129. package/dist/esm/ScopedProcess.js.map +1 -0
  130. package/dist/esm/index.d.ts +38 -0
  131. package/dist/esm/index.d.ts.map +1 -0
  132. package/dist/esm/index.js +38 -0
  133. package/dist/esm/index.js.map +1 -0
  134. package/dist/esm/internal/AtomicFileSystemExecutable.d.ts +61 -0
  135. package/dist/esm/internal/AtomicFileSystemExecutable.d.ts.map +1 -0
  136. package/dist/esm/internal/AtomicFileSystemExecutable.js +350 -0
  137. package/dist/esm/internal/AtomicFileSystemExecutable.js.map +1 -0
  138. package/dist/esm/internal/AtomicFileSystemProtocol.d.ts +78 -0
  139. package/dist/esm/internal/AtomicFileSystemProtocol.d.ts.map +1 -0
  140. package/dist/esm/internal/AtomicFileSystemProtocol.js +412 -0
  141. package/dist/esm/internal/AtomicFileSystemProtocol.js.map +1 -0
  142. package/dist/esm/internal/AtomicFileSystemTransport.d.ts +44 -0
  143. package/dist/esm/internal/AtomicFileSystemTransport.d.ts.map +1 -0
  144. package/dist/esm/internal/AtomicFileSystemTransport.js +242 -0
  145. package/dist/esm/internal/AtomicFileSystemTransport.js.map +1 -0
  146. package/dist/esm/internal/AtomicHelperError.d.ts +35 -0
  147. package/dist/esm/internal/AtomicHelperError.d.ts.map +1 -0
  148. package/dist/esm/internal/AtomicHelperError.js +39 -0
  149. package/dist/esm/internal/AtomicHelperError.js.map +1 -0
  150. package/dist/esm/internal/AtomicHelperFault.d.ts +59 -0
  151. package/dist/esm/internal/AtomicHelperFault.d.ts.map +1 -0
  152. package/dist/esm/internal/AtomicHelperFault.js +66 -0
  153. package/dist/esm/internal/AtomicHelperFault.js.map +1 -0
  154. package/dist/esm/internal/PipedProcess.d.ts +35 -0
  155. package/dist/esm/internal/PipedProcess.d.ts.map +1 -0
  156. package/dist/esm/internal/PipedProcess.js +321 -0
  157. package/dist/esm/internal/PipedProcess.js.map +1 -0
  158. package/dist/esm/internal/ProcSnapshot.d.ts +85 -0
  159. package/dist/esm/internal/ProcSnapshot.d.ts.map +1 -0
  160. package/dist/esm/internal/ProcSnapshot.js +188 -0
  161. package/dist/esm/internal/ProcSnapshot.js.map +1 -0
  162. package/dist/esm/internal/ProcessCleanup.d.ts +64 -0
  163. package/dist/esm/internal/ProcessCleanup.d.ts.map +1 -0
  164. package/dist/esm/internal/ProcessCleanup.js +45 -0
  165. package/dist/esm/internal/ProcessCleanup.js.map +1 -0
  166. package/dist/esm/internal/ProcessCleanupPolicyError.d.ts +30 -0
  167. package/dist/esm/internal/ProcessCleanupPolicyError.d.ts.map +1 -0
  168. package/dist/esm/internal/ProcessCleanupPolicyError.js +25 -0
  169. package/dist/esm/internal/ProcessCleanupPolicyError.js.map +1 -0
  170. package/dist/esm/internal/ProcessFault.d.ts +63 -0
  171. package/dist/esm/internal/ProcessFault.d.ts.map +1 -0
  172. package/dist/esm/internal/ProcessFault.js +64 -0
  173. package/dist/esm/internal/ProcessFault.js.map +1 -0
  174. package/dist/esm/internal/ProcessSupervisor.d.ts +143 -0
  175. package/dist/esm/internal/ProcessSupervisor.d.ts.map +1 -0
  176. package/dist/esm/internal/ProcessSupervisor.js +689 -0
  177. package/dist/esm/internal/ProcessSupervisor.js.map +1 -0
  178. package/dist/esm/internal/SupervisorProgram.d.ts +9 -0
  179. package/dist/esm/internal/SupervisorProgram.d.ts.map +1 -0
  180. package/dist/esm/internal/SupervisorProgram.js +310 -0
  181. package/dist/esm/internal/SupervisorProgram.js.map +1 -0
  182. package/dist/esm/internal/WindowsProcessJob.d.ts +39 -0
  183. package/dist/esm/internal/WindowsProcessJob.d.ts.map +1 -0
  184. package/dist/esm/internal/WindowsProcessJob.js +115 -0
  185. package/dist/esm/internal/WindowsProcessJob.js.map +1 -0
  186. package/dist/vendor/adapters.json +1757 -0
  187. package/dist/vendor/chunk-2Y7WC4KU.js +109 -0
  188. package/dist/vendor/chunk-3GR5VZ2M.js +118 -0
  189. package/dist/vendor/chunk-42QKY6T6.js +40 -0
  190. package/dist/vendor/chunk-54RLBMTZ.js +61 -0
  191. package/dist/vendor/chunk-5ZMHBXIK.js +55 -0
  192. package/dist/vendor/chunk-6ME2W7TF.js +28 -0
  193. package/dist/vendor/chunk-AMQKOQNT.js +34 -0
  194. package/dist/vendor/chunk-B3FZ67QU.js +59 -0
  195. package/dist/vendor/chunk-BKTBUBQY.js +437 -0
  196. package/dist/vendor/chunk-DS7GF46S.js +34 -0
  197. package/dist/vendor/chunk-DVOAHXPG.js +104 -0
  198. package/dist/vendor/chunk-DWSHTSVX.js +229 -0
  199. package/dist/vendor/chunk-EGBNVEEW.js +14 -0
  200. package/dist/vendor/chunk-EZWY45HP.js +18 -0
  201. package/dist/vendor/chunk-FNZOJHSV.js +71 -0
  202. package/dist/vendor/chunk-GXCHI7BM.js +131 -0
  203. package/dist/vendor/chunk-IIJ52ZU6.js +20 -0
  204. package/dist/vendor/chunk-J7A4CZDO.js +92 -0
  205. package/dist/vendor/chunk-JG5TTWPT.js +85 -0
  206. package/dist/vendor/chunk-JJ24ARBQ.js +394 -0
  207. package/dist/vendor/chunk-KOZMM5PZ.js +426 -0
  208. package/dist/vendor/chunk-KUUXSID7.js +18 -0
  209. package/dist/vendor/chunk-LEUPYT3Q.js +36 -0
  210. package/dist/vendor/chunk-M32LDTW7.js +18 -0
  211. package/dist/vendor/chunk-M7CLUILA.js +0 -0
  212. package/dist/vendor/chunk-MBSKBQ5D.js +21 -0
  213. package/dist/vendor/chunk-MLKGABMK.js +9 -0
  214. package/dist/vendor/chunk-NBVRTDTV.js +129 -0
  215. package/dist/vendor/chunk-OXNGN5H7.js +81 -0
  216. package/dist/vendor/chunk-QPLDT6A6.js +564 -0
  217. package/dist/vendor/chunk-QYBKAIA6.js +18 -0
  218. package/dist/vendor/chunk-RO2R4MJH.js +62 -0
  219. package/dist/vendor/chunk-SIR62W3Y.js +398 -0
  220. package/dist/vendor/chunk-TFIKFFSC.js +26 -0
  221. package/dist/vendor/chunk-TXKLEBBL.js +143 -0
  222. package/dist/vendor/chunk-UFH5UUZK.js +48 -0
  223. package/dist/vendor/chunk-VANKHF46.js +96 -0
  224. package/dist/vendor/chunk-VZBDV3TV.js +18 -0
  225. package/dist/vendor/chunk-XDKNKFBW.js +22 -0
  226. package/dist/vendor/chunk-XH4U3JSV.js +249 -0
  227. package/dist/vendor/chunk-Y35ZAO5U.js +53 -0
  228. package/dist/vendor/chunk-ZJMRMY57.js +0 -0
  229. package/dist/vendor/cjs/node/NodeChildProcessSpawner.d.ts +7 -0
  230. package/dist/vendor/cjs/node/NodeChildProcessSpawner.js +1 -0
  231. package/dist/vendor/cjs/node/NodeClusterHttp.d.ts +63 -0
  232. package/dist/vendor/cjs/node/NodeClusterHttp.js +1 -0
  233. package/dist/vendor/cjs/node/NodeClusterSocket.d.ts +79 -0
  234. package/dist/vendor/cjs/node/NodeClusterSocket.js +1 -0
  235. package/dist/vendor/cjs/node/NodeCrypto.d.ts +10 -0
  236. package/dist/vendor/cjs/node/NodeCrypto.js +1 -0
  237. package/dist/vendor/cjs/node/NodeFileSystem.d.ts +10 -0
  238. package/dist/vendor/cjs/node/NodeFileSystem.js +1 -0
  239. package/dist/vendor/cjs/node/NodeHttpClient.d.ts +179 -0
  240. package/dist/vendor/cjs/node/NodeHttpClient.js +1 -0
  241. package/dist/vendor/cjs/node/NodeHttpIncomingMessage.d.ts +62 -0
  242. package/dist/vendor/cjs/node/NodeHttpIncomingMessage.js +1 -0
  243. package/dist/vendor/cjs/node/NodeHttpPlatform.d.ts +36 -0
  244. package/dist/vendor/cjs/node/NodeHttpPlatform.js +1 -0
  245. package/dist/vendor/cjs/node/NodeHttpServer.d.ts +120 -0
  246. package/dist/vendor/cjs/node/NodeHttpServer.js +1 -0
  247. package/dist/vendor/cjs/node/NodeHttpServerRequest.d.ts +29 -0
  248. package/dist/vendor/cjs/node/NodeHttpServerRequest.js +1 -0
  249. package/dist/vendor/cjs/node/NodeMultipart.d.ts +46 -0
  250. package/dist/vendor/cjs/node/NodeMultipart.js +1 -0
  251. package/dist/vendor/cjs/node/NodeMultipartParser.d.ts +97 -0
  252. package/dist/vendor/cjs/node/NodeMultipartParser.js +1 -0
  253. package/dist/vendor/cjs/node/NodePath.d.ts +27 -0
  254. package/dist/vendor/cjs/node/NodePath.js +1 -0
  255. package/dist/vendor/cjs/node/NodeRedis.d.ts +74 -0
  256. package/dist/vendor/cjs/node/NodeRedis.js +1 -0
  257. package/dist/vendor/cjs/node/NodeRuntime.d.ts +85 -0
  258. package/dist/vendor/cjs/node/NodeRuntime.js +1 -0
  259. package/dist/vendor/cjs/node/NodeServices.d.ts +34 -0
  260. package/dist/vendor/cjs/node/NodeServices.js +1 -0
  261. package/dist/vendor/cjs/node/NodeSink.d.ts +8 -0
  262. package/dist/vendor/cjs/node/NodeSink.js +1 -0
  263. package/dist/vendor/cjs/node/NodeSocket.d.ts +38 -0
  264. package/dist/vendor/cjs/node/NodeSocket.js +1 -0
  265. package/dist/vendor/cjs/node/NodeSocketServer.d.ts +8 -0
  266. package/dist/vendor/cjs/node/NodeSocketServer.js +1 -0
  267. package/dist/vendor/cjs/node/NodeStdio.d.ts +11 -0
  268. package/dist/vendor/cjs/node/NodeStdio.js +1 -0
  269. package/dist/vendor/cjs/node/NodeStream.d.ts +8 -0
  270. package/dist/vendor/cjs/node/NodeStream.js +1 -0
  271. package/dist/vendor/cjs/node/NodeTerminal.d.ts +21 -0
  272. package/dist/vendor/cjs/node/NodeTerminal.js +1 -0
  273. package/dist/vendor/cjs/node/NodeWorker.d.ts +22 -0
  274. package/dist/vendor/cjs/node/NodeWorker.js +1 -0
  275. package/dist/vendor/cjs/node/NodeWorkerRunner.d.ts +12 -0
  276. package/dist/vendor/cjs/node/NodeWorkerRunner.js +1 -0
  277. package/dist/vendor/cjs/node/Undici.d.ts +28 -0
  278. package/dist/vendor/cjs/node/Undici.js +1 -0
  279. package/dist/vendor/cjs/node/index.d.ts +100 -0
  280. package/dist/vendor/cjs/node/index.js +1 -0
  281. package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.d.ts +57 -0
  282. package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.js +1 -0
  283. package/dist/vendor/cjs/node-shared/NodeClusterSocket.d.ts +22 -0
  284. package/dist/vendor/cjs/node-shared/NodeClusterSocket.js +1 -0
  285. package/dist/vendor/cjs/node-shared/NodeCrypto.d.ts +27 -0
  286. package/dist/vendor/cjs/node-shared/NodeCrypto.js +1 -0
  287. package/dist/vendor/cjs/node-shared/NodeFileSystem.d.ts +11 -0
  288. package/dist/vendor/cjs/node-shared/NodeFileSystem.js +1 -0
  289. package/dist/vendor/cjs/node-shared/NodeHttpCompression.d.ts +36 -0
  290. package/dist/vendor/cjs/node-shared/NodeHttpCompression.js +1 -0
  291. package/dist/vendor/cjs/node-shared/NodePath.d.ts +27 -0
  292. package/dist/vendor/cjs/node-shared/NodePath.js +1 -0
  293. package/dist/vendor/cjs/node-shared/NodeRuntime.d.ts +47 -0
  294. package/dist/vendor/cjs/node-shared/NodeRuntime.js +1 -0
  295. package/dist/vendor/cjs/node-shared/NodeSink.d.ts +69 -0
  296. package/dist/vendor/cjs/node-shared/NodeSink.js +1 -0
  297. package/dist/vendor/cjs/node-shared/NodeSocket.d.ts +134 -0
  298. package/dist/vendor/cjs/node-shared/NodeSocket.js +1 -0
  299. package/dist/vendor/cjs/node-shared/NodeSocketServer.d.ts +80 -0
  300. package/dist/vendor/cjs/node-shared/NodeSocketServer.js +1 -0
  301. package/dist/vendor/cjs/node-shared/NodeStdio.d.ts +12 -0
  302. package/dist/vendor/cjs/node-shared/NodeStdio.js +1 -0
  303. package/dist/vendor/cjs/node-shared/NodeStream.d.ts +179 -0
  304. package/dist/vendor/cjs/node-shared/NodeStream.js +1 -0
  305. package/dist/vendor/cjs/node-shared/NodeTerminal.d.ts +22 -0
  306. package/dist/vendor/cjs/node-shared/NodeTerminal.js +1 -0
  307. package/dist/vendor/cjs/node-shared/index.d.ts +56 -0
  308. package/dist/vendor/cjs/node-shared/index.js +1 -0
  309. package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
  310. package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.js +1 -0
  311. package/dist/vendor/cjs/node-shared/internal/utils.d.ts +2 -0
  312. package/dist/vendor/cjs/node-shared/internal/utils.js +1 -0
  313. package/dist/vendor/cjs/package.json +1 -0
  314. package/dist/vendor/cjs/platform-node-shared.d.ts +56 -0
  315. package/dist/vendor/cjs/platform-node-shared.js +1 -0
  316. package/dist/vendor/cjs/platform-node.d.ts +100 -0
  317. package/dist/vendor/cjs/platform-node.js +1 -0
  318. package/dist/vendor/node/LICENSE +21 -0
  319. package/dist/vendor/node/NodeChildProcessSpawner.d.ts +7 -0
  320. package/dist/vendor/node/NodeChildProcessSpawner.js +14 -0
  321. package/dist/vendor/node/NodeClusterHttp.d.ts +63 -0
  322. package/dist/vendor/node/NodeClusterHttp.js +43 -0
  323. package/dist/vendor/node/NodeClusterSocket.d.ts +79 -0
  324. package/dist/vendor/node/NodeClusterSocket.js +30 -0
  325. package/dist/vendor/node/NodeCrypto.d.ts +10 -0
  326. package/dist/vendor/node/NodeCrypto.js +8 -0
  327. package/dist/vendor/node/NodeFileSystem.d.ts +10 -0
  328. package/dist/vendor/node/NodeFileSystem.js +9 -0
  329. package/dist/vendor/node/NodeHttpClient.d.ts +179 -0
  330. package/dist/vendor/node/NodeHttpClient.js +46 -0
  331. package/dist/vendor/node/NodeHttpIncomingMessage.d.ts +62 -0
  332. package/dist/vendor/node/NodeHttpIncomingMessage.js +10 -0
  333. package/dist/vendor/node/NodeHttpPlatform.d.ts +36 -0
  334. package/dist/vendor/node/NodeHttpPlatform.js +16 -0
  335. package/dist/vendor/node/NodeHttpServer.d.ts +120 -0
  336. package/dist/vendor/node/NodeHttpServer.js +46 -0
  337. package/dist/vendor/node/NodeHttpServerRequest.d.ts +29 -0
  338. package/dist/vendor/node/NodeHttpServerRequest.js +9 -0
  339. package/dist/vendor/node/NodeMultipart.d.ts +46 -0
  340. package/dist/vendor/node/NodeMultipart.js +15 -0
  341. package/dist/vendor/node/NodeMultipartParser.d.ts +97 -0
  342. package/dist/vendor/node/NodeMultipartParser.js +11 -0
  343. package/dist/vendor/node/NodePath.d.ts +27 -0
  344. package/dist/vendor/node/NodePath.js +12 -0
  345. package/dist/vendor/node/NodeRedis.d.ts +74 -0
  346. package/dist/vendor/node/NodeRedis.js +11 -0
  347. package/dist/vendor/node/NodeRuntime.d.ts +85 -0
  348. package/dist/vendor/node/NodeRuntime.js +8 -0
  349. package/dist/vendor/node/NodeServices.d.ts +34 -0
  350. package/dist/vendor/node/NodeServices.js +23 -0
  351. package/dist/vendor/node/NodeSink.d.ts +8 -0
  352. package/dist/vendor/node/NodeSink.js +12 -0
  353. package/dist/vendor/node/NodeSocket.d.ts +38 -0
  354. package/dist/vendor/node/NodeSocket.js +31 -0
  355. package/dist/vendor/node/NodeSocketServer.d.ts +8 -0
  356. package/dist/vendor/node/NodeSocketServer.js +21 -0
  357. package/dist/vendor/node/NodeStdio.d.ts +11 -0
  358. package/dist/vendor/node/NodeStdio.js +10 -0
  359. package/dist/vendor/node/NodeStream.d.ts +8 -0
  360. package/dist/vendor/node/NodeStream.js +27 -0
  361. package/dist/vendor/node/NodeTerminal.d.ts +21 -0
  362. package/dist/vendor/node/NodeTerminal.js +10 -0
  363. package/dist/vendor/node/NodeWorker.d.ts +22 -0
  364. package/dist/vendor/node/NodeWorker.js +9 -0
  365. package/dist/vendor/node/NodeWorkerRunner.d.ts +12 -0
  366. package/dist/vendor/node/NodeWorkerRunner.js +7 -0
  367. package/dist/vendor/node/Undici.d.ts +28 -0
  368. package/dist/vendor/node/Undici.js +9 -0
  369. package/dist/vendor/node/index.d.ts +100 -0
  370. package/dist/vendor/node/index.js +115 -0
  371. package/dist/vendor/node-shared/LICENSE +21 -0
  372. package/dist/vendor/node-shared/NodeChildProcessSpawner.d.ts +57 -0
  373. package/dist/vendor/node-shared/NodeChildProcessSpawner.js +13 -0
  374. package/dist/vendor/node-shared/NodeClusterSocket.d.ts +22 -0
  375. package/dist/vendor/node-shared/NodeClusterSocket.js +11 -0
  376. package/dist/vendor/node-shared/NodeCrypto.d.ts +27 -0
  377. package/dist/vendor/node-shared/NodeCrypto.js +9 -0
  378. package/dist/vendor/node-shared/NodeFileSystem.d.ts +11 -0
  379. package/dist/vendor/node-shared/NodeFileSystem.js +8 -0
  380. package/dist/vendor/node-shared/NodeHttpCompression.d.ts +36 -0
  381. package/dist/vendor/node-shared/NodeHttpCompression.js +13 -0
  382. package/dist/vendor/node-shared/NodePath.d.ts +27 -0
  383. package/dist/vendor/node-shared/NodePath.js +11 -0
  384. package/dist/vendor/node-shared/NodeRuntime.d.ts +47 -0
  385. package/dist/vendor/node-shared/NodeRuntime.js +7 -0
  386. package/dist/vendor/node-shared/NodeSink.d.ts +69 -0
  387. package/dist/vendor/node-shared/NodeSink.js +11 -0
  388. package/dist/vendor/node-shared/NodeSocket.d.ts +134 -0
  389. package/dist/vendor/node-shared/NodeSocket.js +23 -0
  390. package/dist/vendor/node-shared/NodeSocketServer.d.ts +80 -0
  391. package/dist/vendor/node-shared/NodeSocketServer.js +20 -0
  392. package/dist/vendor/node-shared/NodeStdio.d.ts +12 -0
  393. package/dist/vendor/node-shared/NodeStdio.js +9 -0
  394. package/dist/vendor/node-shared/NodeStream.d.ts +179 -0
  395. package/dist/vendor/node-shared/NodeStream.js +26 -0
  396. package/dist/vendor/node-shared/NodeTerminal.d.ts +22 -0
  397. package/dist/vendor/node-shared/NodeTerminal.js +9 -0
  398. package/dist/vendor/node-shared/index.d.ts +56 -0
  399. package/dist/vendor/node-shared/index.js +58 -0
  400. package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
  401. package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.js +7 -0
  402. package/dist/vendor/node-shared/internal/utils.d.ts +2 -0
  403. package/dist/vendor/node-shared/internal/utils.js +7 -0
  404. package/dist/vendor/platform-node-shared.d.ts +56 -0
  405. package/dist/vendor/platform-node-shared.js +58 -0
  406. package/dist/vendor/platform-node.d.ts +100 -0
  407. package/dist/vendor/platform-node.js +115 -0
  408. package/docs/README.md +129 -0
  409. package/docs/api.md +553 -0
  410. package/docs/concepts/descriptor-relative-filesystem.md +181 -0
  411. package/docs/concepts/host-bundle.md +125 -0
  412. package/docs/concepts/process-containment.md +190 -0
  413. package/docs/guides/answer-run-ownership.md +87 -0
  414. package/docs/guides/configure-the-filesystem-helper.md +152 -0
  415. package/docs/guides/contain-child-processes.md +139 -0
  416. package/docs/guides/match-files-with-glob.md +151 -0
  417. package/docs/installation.md +204 -0
  418. package/docs/quickstart.md +147 -0
  419. package/docs/troubleshooting.md +130 -0
  420. package/package.json +202 -3
  421. package/src/AtomicFileSystem.ts +415 -0
  422. package/src/EgressHttpClient.ts +327 -0
  423. package/src/HostLiveness.ts +103 -0
  424. package/src/NodeHost.ts +253 -0
  425. package/src/ProcessConfinement.ts +363 -0
  426. package/src/ProcessReaper.ts +951 -0
  427. package/src/ProcessSandbox.ts +1307 -0
  428. package/src/ScopedProcess.ts +124 -0
  429. package/src/index.ts +44 -0
  430. package/src/internal/AtomicFileSystemExecutable.ts +379 -0
  431. package/src/internal/AtomicFileSystemProtocol.ts +502 -0
  432. package/src/internal/AtomicFileSystemTransport.ts +272 -0
  433. package/src/internal/AtomicHelperError.ts +50 -0
  434. package/src/internal/AtomicHelperFault.ts +84 -0
  435. package/src/internal/PipedProcess.ts +357 -0
  436. package/src/internal/ProcSnapshot.ts +193 -0
  437. package/src/internal/ProcessCleanup.ts +99 -0
  438. package/src/internal/ProcessCleanupPolicyError.ts +30 -0
  439. package/src/internal/ProcessFault.ts +82 -0
  440. package/src/internal/ProcessSupervisor.ts +807 -0
  441. package/src/internal/SupervisorProgram.ts +309 -0
  442. package/src/internal/WindowsProcessJob.ts +114 -0
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Aggregate Node.js Host bundle.
3
+ *
4
+ * This module defines the `NodeHost` service union and a single `layer` that
5
+ * provides the closed Host surface backed by Node: `@effect/platform-node`'s
6
+ * filesystem, child-process spawner, Undici `HttpClient`, native `Path`,
7
+ * and the Node `Jj` adapter from its own package. Use the layer when a Node
8
+ * program wants every host capability from one place; use the individual
9
+ * modules when a program should only be able to reach part of the host. The
10
+ * bundle also supplies native `ProcessConfinement` for the kernel spawner.
11
+ *
12
+ * There is no Node HTTP module either: outgoing requests are Effect's
13
+ * `HttpClient`, and `@effect/platform-node` already ships the Undici-backed
14
+ * implementation. Undici follows no redirect unless a redirect interceptor is
15
+ * installed, so every hop stays visible to `@smthrs/kernel`'s decorator.
16
+ *
17
+ * There is no Node shell module: running a command is Effect's
18
+ * `ChildProcessSpawner`, and `@effect/platform-node` already ships the
19
+ * implementation.
20
+ *
21
+ * @since 0.1.0
22
+ */
23
+ import * as NodeChildProcessSpawner from "../vendor/node/NodeChildProcessSpawner.js";
24
+ import * as NodeCrypto from "../vendor/node/NodeCrypto.js";
25
+ import * as NodeFileSystem from "../vendor/node/NodeFileSystem.js";
26
+ import * as NodeHttpClient from "../vendor/node/NodeHttpClient.js";
27
+ import type { Jj, JjError } from "@smthrs/jj";
28
+ import type { HostServiceIds } from "@smthrs/kernel/HostServices";
29
+ import type * as KernelProcessConfinement from "@smthrs/kernel/ProcessConfinement";
30
+ import type * as ProcessLedger from "@smthrs/kernel/ProcessLedger";
31
+ import type { FileSystem } from "effect/FileSystem";
32
+ import * as Layer from "effect/Layer";
33
+ import type * as Path from "effect/Path";
34
+ import * as Schema from "effect/Schema";
35
+ import type { HttpClient } from "effect/unstable/http/HttpClient";
36
+ import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner";
37
+ import * as AtomicFileSystem from "./AtomicFileSystem.ts";
38
+ import * as EgressHttpClient from "./EgressHttpClient.ts";
39
+ import * as ProcessReaper from "./ProcessReaper.ts";
40
+ /**
41
+ * The Node platform modules Effect ships, re-exported so a program that wants
42
+ * only part of the host has one place to reach for them. `NodeJj` belongs to
43
+ * `@smthrs/jj`; import it from there.
44
+ *
45
+ * `NodeCrypto` is here for a different reason than the rest. `Crypto` is not a
46
+ * Host service — it carries no host authority the kernel could attenuate, so
47
+ * it is not in {@link NodeHost} and not in the closed list — but every durable
48
+ * composition needs one, and a program that already depends on this package
49
+ * for its host should not have to add a second dependency for the digest.
50
+ *
51
+ * @category re-exports
52
+ * @since 0.1.0
53
+ */
54
+ export { AtomicFileSystem, EgressHttpClient, NodeChildProcessSpawner, NodeCrypto, NodeFileSystem, NodeHttpClient, ProcessReaper };
55
+ /**
56
+ * The union of host services provided by the Node host layer.
57
+ *
58
+ * @category models
59
+ * @since 0.1.0
60
+ */
61
+ export type NodeHost = FileSystem | Path.Path | ChildProcessSpawner | Jj | HttpClient | KernelProcessConfinement.ProcessConfinement;
62
+ declare const NodeHostError_base: Schema.Class<NodeHostError, Schema.TaggedStruct<"@smthrs/platform-node/NodeHostError", {
63
+ readonly code: Schema.Literal<"invalid_repository_root">;
64
+ readonly message: Schema.String;
65
+ }>, import("effect/Cause").YieldableError>;
66
+ /**
67
+ * Invalid repository-root configuration, refused before layer construction.
68
+ * @category errors
69
+ * @since 1.0.0-rc.0
70
+ */
71
+ export declare class NodeHostError extends NodeHostError_base {
72
+ readonly name = "NodeHostError";
73
+ }
74
+ /**
75
+ * Stable implementation identities for the raw bundle's five Host slots.
76
+ * Contained POSIX factories replace its spawner with {@link ProcessReaper.layerSpawner}.
77
+ * @category models
78
+ * @since 1.0.0-rc.0
79
+ */
80
+ export declare const implementationIds: Readonly<Record<(typeof HostServiceIds)[number], string>>;
81
+ /**
82
+ * What a caller may configure about a contained Node host.
83
+ *
84
+ * `platform` is deliberately absent. `ContainedSpawner.Options` declares it so a
85
+ * caller that supplies its own spawner can describe one, but this native host
86
+ * detaches by `process.platform` whatever a record claims. A caller-supplied
87
+ * `"win32"` on a POSIX host would therefore
88
+ * record `pgid: null` for a child that really does lead a group, and
89
+ * {@link ProcessReaper.reap} would retire that record as `no-group` and leave
90
+ * the orphan running forever — a durable lie rather than a compile error.
91
+ *
92
+ * @category models
93
+ * @since 1.0.0-rc.0
94
+ */
95
+ export type ContainedOptions = ProcessReaper.SpawnerOptions & ProcessReaper.Options;
96
+ /**
97
+ * Provides the default Node implementations for the whole closed Host surface.
98
+ *
99
+ * @category layers
100
+ * @since 0.1.0
101
+ */
102
+ export declare const layer: Layer.Layer<NodeHost, JjError>;
103
+ /**
104
+ * Provides the Node host with `Jj` bound to one absolute repository root.
105
+ *
106
+ * @category layers
107
+ * @since 1.0.0
108
+ */
109
+ export declare const layerAt: (repositoryRoot: string) => Layer.Layer<NodeHost, JjError>;
110
+ /**
111
+ * Provides the Node host with process containment turned on.
112
+ *
113
+ * The difference from {@link layer} is what happens to a spawned process when
114
+ * its run stops. Under {@link layer} a child is signalled when its scope
115
+ * closes and then waited for, forever if it ignores `SIGTERM`, and a host that
116
+ * dies without closing its scopes abandons every child it started. This layer
117
+ * gives each child an escalation deadline and records it in the
118
+ * `ProcessLedger`, then sweeps the records a previous incarnation of the same
119
+ * host left behind before it hands the host over
120
+ * ({@link ProcessReaper.reap}).
121
+ *
122
+ * jj is contained here too: `layerContained` builds the `Jj` service over the
123
+ * same spawner rather than letting it start its own children, so a `jj`
124
+ * invocation a crashed host left running is a record the next incarnation
125
+ * reaps like any other.
126
+ *
127
+ * The ledger is a requirement rather than a default because the durable half
128
+ * of containment is only as good as the journal underneath it:
129
+ * `ProcessLedger.layer` inherits a crashed incarnation's processes,
130
+ * `ProcessLedger.layerMemory` contains this incarnation and nothing more, and
131
+ * the choice belongs to the program that knows which it has.
132
+ *
133
+ * @category layers
134
+ * @since 0.1.0
135
+ */
136
+ export declare const layerContained: (options?: ContainedOptions) => Layer.Layer<NodeHost, JjError, ProcessLedger.ProcessLedger>;
137
+ /**
138
+ * Provides the contained Node host with `Jj` bound to one absolute repository
139
+ * root.
140
+ *
141
+ * @category layers
142
+ * @since 1.0.0
143
+ */
144
+ export declare const layerContainedAt: (repositoryRoot: string, options?: ContainedOptions) => Layer.Layer<NodeHost, JjError, ProcessLedger.ProcessLedger>;
145
+ //# sourceMappingURL=NodeHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeHost.d.ts","sourceRoot":"","sources":["../../src/NodeHost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,uBAAuB,MAAM,+CAA+C,CAAA;AACxF,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAA;AAC9D,OAAO,KAAK,cAAc,MAAM,sCAAsC,CAAA;AACtE,OAAO,KAAK,cAAc,MAAM,sCAAsC,CAAA;AAEtE,OAAO,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,KAAK,KAAK,wBAAwB,MAAM,mCAAmC,CAAA;AAClF,OAAO,KAAK,KAAK,aAAa,MAAM,8BAA8B,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,KAAK,IAAI,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AAEtF,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,UAAU,EACV,cAAc,EACd,cAAc,EACd,aAAa,EACd,CAAA;AAcD;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAChB,UAAU,GACV,IAAI,CAAC,IAAI,GACT,mBAAmB,GACnB,EAAE,GACF,UAAU,GACV,wBAAwB,CAAC,kBAAkB,CAAA;;;;;AAE/C;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,kBAGjC;IACA,SAAkB,IAAI,mBAAkB;CACzC;AAYD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAMvF,CAAA;AAKD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC,cAAc,GAAG,aAAa,CAAC,OAAO,CAAA;AAQnF;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAMhD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAAI,gBAAgB,MAAM,KAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAO3E,CAAA;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,cAAc,GACzB,UAAU,gBAAgB,KACzB,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,aAAa,CAgB5D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC3B,gBAAgB,MAAM,EACtB,UAAU,gBAAgB,KACzB,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,aAAa,CAW5D,CAAA"}
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Aggregate Node.js Host bundle.
3
+ *
4
+ * This module defines the `NodeHost` service union and a single `layer` that
5
+ * provides the closed Host surface backed by Node: `@effect/platform-node`'s
6
+ * filesystem, child-process spawner, Undici `HttpClient`, native `Path`,
7
+ * and the Node `Jj` adapter from its own package. Use the layer when a Node
8
+ * program wants every host capability from one place; use the individual
9
+ * modules when a program should only be able to reach part of the host. The
10
+ * bundle also supplies native `ProcessConfinement` for the kernel spawner.
11
+ *
12
+ * There is no Node HTTP module either: outgoing requests are Effect's
13
+ * `HttpClient`, and `@effect/platform-node` already ships the Undici-backed
14
+ * implementation. Undici follows no redirect unless a redirect interceptor is
15
+ * installed, so every hop stays visible to `@smthrs/kernel`'s decorator.
16
+ *
17
+ * There is no Node shell module: running a command is Effect's
18
+ * `ChildProcessSpawner`, and `@effect/platform-node` already ships the
19
+ * implementation.
20
+ *
21
+ * @since 0.1.0
22
+ */
23
+ import * as NodeChildProcessSpawner from "../vendor/node/NodeChildProcessSpawner.js";
24
+ import * as NodeCrypto from "../vendor/node/NodeCrypto.js";
25
+ import * as NodeFileSystem from "../vendor/node/NodeFileSystem.js";
26
+ import * as NodeHttpClient from "../vendor/node/NodeHttpClient.js";
27
+ import * as NodePath from "../vendor/node/NodePath.js";
28
+ import * as NodeJj from "@smthrs/jj/node/NodeJj";
29
+ import * as Layer from "effect/Layer";
30
+ import * as Schema from "effect/Schema";
31
+ import { isAbsolute } from "node:path";
32
+ import * as AtomicFileSystem from "./AtomicFileSystem.js";
33
+ import * as EgressHttpClient from "./EgressHttpClient.js";
34
+ import * as ProcessConfinement from "./ProcessConfinement.js";
35
+ import * as ProcessReaper from "./ProcessReaper.js";
36
+ /**
37
+ * The Node platform modules Effect ships, re-exported so a program that wants
38
+ * only part of the host has one place to reach for them. `NodeJj` belongs to
39
+ * `@smthrs/jj`; import it from there.
40
+ *
41
+ * `NodeCrypto` is here for a different reason than the rest. `Crypto` is not a
42
+ * Host service — it carries no host authority the kernel could attenuate, so
43
+ * it is not in {@link NodeHost} and not in the closed list — but every durable
44
+ * composition needs one, and a program that already depends on this package
45
+ * for its host should not have to add a second dependency for the digest.
46
+ *
47
+ * @category re-exports
48
+ * @since 0.1.0
49
+ */
50
+ export { AtomicFileSystem, EgressHttpClient, NodeChildProcessSpawner, NodeCrypto, NodeFileSystem, NodeHttpClient, ProcessReaper };
51
+ /**
52
+ * The `HttpClient` every bundle below installs: Undici through the egress
53
+ * proxy this process's environment names, and a direct Undici pool when it
54
+ * names none.
55
+ *
56
+ * `NodeHttpClient.layerUndici` is the direct pool unconditionally. It is still
57
+ * re-exported above for a program composing its own services, but a bundle
58
+ * that spans a whole host has to work inside a sandbox whose only way out is a
59
+ * proxy, so the bundles read the environment. See {@link EgressHttpClient}.
60
+ */
61
+ const httpClient = EgressHttpClient.layer(process.env);
62
+ /**
63
+ * Invalid repository-root configuration, refused before layer construction.
64
+ * @category errors
65
+ * @since 1.0.0-rc.0
66
+ */
67
+ export class NodeHostError extends Schema.TaggedError()("@smthrs/platform-node/NodeHostError", {
68
+ code: Schema.Literal("invalid_repository_root"),
69
+ message: Schema.String
70
+ }) {
71
+ name = "NodeHostError";
72
+ }
73
+ const absoluteRoot = (root) => {
74
+ if (isAbsolute(root))
75
+ return root;
76
+ throw new NodeHostError({
77
+ code: "invalid_repository_root",
78
+ message: `NodeHost requires an absolute repository root, got ${JSON.stringify(Array.from(root).slice(0, 64).join(""))}`
79
+ });
80
+ };
81
+ /**
82
+ * Stable implementation identities for the raw bundle's five Host slots.
83
+ * Contained POSIX factories replace its spawner with {@link ProcessReaper.layerSpawner}.
84
+ * @category models
85
+ * @since 1.0.0-rc.0
86
+ */
87
+ export const implementationIds = {
88
+ "effect/FileSystem": "@smthrs/platform-node/AtomicFileSystem",
89
+ "effect/Path": "@effect/platform-node/NodePath",
90
+ "effect/process/ChildProcessSpawner": "@effect/platform-node/NodeChildProcessSpawner",
91
+ "@smthrs/jj/Jj": "@smthrs/jj/node/NodeJj",
92
+ "effect/HttpClient": "@smthrs/platform-node/EgressHttpClient"
93
+ };
94
+ /** The two services `NodeChildProcessSpawner` resolves paths and files with. */
95
+ const platform = Layer.mergeAll(AtomicFileSystem.layer, NodePath.layer);
96
+ /** The reaper half of {@link ContainedOptions}. */
97
+ const reaping = (options) => ({
98
+ ownerPid: options?.ownerPid,
99
+ system: options?.system
100
+ });
101
+ /**
102
+ * Provides the default Node implementations for the whole closed Host surface.
103
+ *
104
+ * @category layers
105
+ * @since 0.1.0
106
+ */
107
+ export const layer = Layer.mergeAll(ProcessConfinement.layer(), platform, Layer.provide(NodeChildProcessSpawner.layer, platform), httpClient, NodeJj.layer);
108
+ /**
109
+ * Provides the Node host with `Jj` bound to one absolute repository root.
110
+ *
111
+ * @category layers
112
+ * @since 1.0.0
113
+ */
114
+ export const layerAt = (repositoryRoot) => Layer.mergeAll(ProcessConfinement.layer(), platform, Layer.provide(NodeChildProcessSpawner.layer, platform), httpClient, NodeJj.layerAt(absoluteRoot(repositoryRoot)));
115
+ /**
116
+ * Provides the Node host with process containment turned on.
117
+ *
118
+ * The difference from {@link layer} is what happens to a spawned process when
119
+ * its run stops. Under {@link layer} a child is signalled when its scope
120
+ * closes and then waited for, forever if it ignores `SIGTERM`, and a host that
121
+ * dies without closing its scopes abandons every child it started. This layer
122
+ * gives each child an escalation deadline and records it in the
123
+ * `ProcessLedger`, then sweeps the records a previous incarnation of the same
124
+ * host left behind before it hands the host over
125
+ * ({@link ProcessReaper.reap}).
126
+ *
127
+ * jj is contained here too: `layerContained` builds the `Jj` service over the
128
+ * same spawner rather than letting it start its own children, so a `jj`
129
+ * invocation a crashed host left running is a record the next incarnation
130
+ * reaps like any other.
131
+ *
132
+ * The ledger is a requirement rather than a default because the durable half
133
+ * of containment is only as good as the journal underneath it:
134
+ * `ProcessLedger.layer` inherits a crashed incarnation's processes,
135
+ * `ProcessLedger.layerMemory` contains this incarnation and nothing more, and
136
+ * the choice belongs to the program that knows which it has.
137
+ *
138
+ * @category layers
139
+ * @since 0.1.0
140
+ */
141
+ export const layerContained = (options) => {
142
+ const spawner = Layer.provide(ProcessReaper.layerSpawner({ graceMs: options?.graceMs }), Layer.provide(NodeChildProcessSpawner.layer, platform));
143
+ return Layer.mergeAll(ProcessConfinement.layer(), platform, httpClient,
144
+ // jj goes through the CONTAINED spawner here, not around it. `NodeJj.layer`
145
+ // spawns its own children, which is right for a host that has no spawner
146
+ // to offer, but under containment it would mean a `jj` that leads no
147
+ // recorded process group, appears in no ledger, and survives the
148
+ // incarnation that started it.
149
+ Layer.provideMerge(NodeJj.layerSpawner, spawner)).pipe(Layer.provideMerge(ProcessReaper.layer(reaping(options))));
150
+ };
151
+ /**
152
+ * Provides the contained Node host with `Jj` bound to one absolute repository
153
+ * root.
154
+ *
155
+ * @category layers
156
+ * @since 1.0.0
157
+ */
158
+ export const layerContainedAt = (repositoryRoot, options) => {
159
+ const spawner = Layer.provide(ProcessReaper.layerSpawner({ graceMs: options?.graceMs }), Layer.provide(NodeChildProcessSpawner.layer, platform));
160
+ return Layer.mergeAll(ProcessConfinement.layer(), platform, httpClient, Layer.provideMerge(NodeJj.layerSpawnerAt(absoluteRoot(repositoryRoot)), spawner)).pipe(Layer.provideMerge(ProcessReaper.layer(reaping(options))));
161
+ };
162
+ //# sourceMappingURL=NodeHost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeHost.js","sourceRoot":"","sources":["../../src/NodeHost.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * Aggregate Node.js Host bundle.\n *\n * This module defines the `NodeHost` service union and a single `layer` that\n * provides the closed Host surface backed by Node: `@effect/platform-node`'s\n * filesystem, child-process spawner, Undici `HttpClient`, native `Path`,\n * and the Node `Jj` adapter from its own package. Use the layer when a Node\n * program wants every host capability from one place; use the individual\n * modules when a program should only be able to reach part of the host. The\n * bundle also supplies native `ProcessConfinement` for the kernel spawner.\n *\n * There is no Node HTTP module either: outgoing requests are Effect's\n * `HttpClient`, and `@effect/platform-node` already ships the Undici-backed\n * implementation. Undici follows no redirect unless a redirect interceptor is\n * installed, so every hop stays visible to `@smthrs/kernel`'s decorator.\n *\n * There is no Node shell module: running a command is Effect's\n * `ChildProcessSpawner`, and `@effect/platform-node` already ships the\n * implementation.\n *\n * @since 0.1.0\n */\n\nimport * as NodeChildProcessSpawner from \"@effect/platform-node/NodeChildProcessSpawner\"\nimport * as NodeCrypto from \"@effect/platform-node/NodeCrypto\"\nimport * as NodeFileSystem from \"@effect/platform-node/NodeFileSystem\"\nimport * as NodeHttpClient from \"@effect/platform-node/NodeHttpClient\"\nimport * as NodePath from \"@effect/platform-node/NodePath\"\nimport type { Jj, JjError } from \"@smthrs/jj\"\nimport * as NodeJj from \"@smthrs/jj/node/NodeJj\"\nimport type { HostServiceIds } from \"@smthrs/kernel/HostServices\"\nimport type * as KernelProcessConfinement from \"@smthrs/kernel/ProcessConfinement\"\nimport type * as ProcessLedger from \"@smthrs/kernel/ProcessLedger\"\nimport type { FileSystem } from \"effect/FileSystem\"\nimport * as Layer from \"effect/Layer\"\nimport type * as Path from \"effect/Path\"\nimport * as Schema from \"effect/Schema\"\nimport type { HttpClient } from \"effect/unstable/http/HttpClient\"\nimport type { ChildProcessSpawner } from \"effect/unstable/process/ChildProcessSpawner\"\nimport { isAbsolute } from \"node:path\"\nimport * as AtomicFileSystem from \"./AtomicFileSystem.ts\"\nimport * as EgressHttpClient from \"./EgressHttpClient.ts\"\nimport * as ProcessConfinement from \"./ProcessConfinement.ts\"\nimport * as ProcessReaper from \"./ProcessReaper.ts\"\n\n/**\n * The Node platform modules Effect ships, re-exported so a program that wants\n * only part of the host has one place to reach for them. `NodeJj` belongs to\n * `@smthrs/jj`; import it from there.\n *\n * `NodeCrypto` is here for a different reason than the rest. `Crypto` is not a\n * Host service — it carries no host authority the kernel could attenuate, so\n * it is not in {@link NodeHost} and not in the closed list — but every durable\n * composition needs one, and a program that already depends on this package\n * for its host should not have to add a second dependency for the digest.\n *\n * @category re-exports\n * @since 0.1.0\n */\nexport {\n AtomicFileSystem,\n EgressHttpClient,\n NodeChildProcessSpawner,\n NodeCrypto,\n NodeFileSystem,\n NodeHttpClient,\n ProcessReaper\n}\n\n/**\n * The `HttpClient` every bundle below installs: Undici through the egress\n * proxy this process's environment names, and a direct Undici pool when it\n * names none.\n *\n * `NodeHttpClient.layerUndici` is the direct pool unconditionally. It is still\n * re-exported above for a program composing its own services, but a bundle\n * that spans a whole host has to work inside a sandbox whose only way out is a\n * proxy, so the bundles read the environment. See {@link EgressHttpClient}.\n */\nconst httpClient = EgressHttpClient.layer(process.env)\n\n/**\n * The union of host services provided by the Node host layer.\n *\n * @category models\n * @since 0.1.0\n */\nexport type NodeHost =\n | FileSystem\n | Path.Path\n | ChildProcessSpawner\n | Jj\n | HttpClient\n | KernelProcessConfinement.ProcessConfinement\n\n/**\n * Invalid repository-root configuration, refused before layer construction.\n * @category errors\n * @since 1.0.0-rc.0\n */\nexport class NodeHostError extends Schema.TaggedError<NodeHostError>()(\"@smthrs/platform-node/NodeHostError\", {\n code: Schema.Literal(\"invalid_repository_root\"),\n message: Schema.String\n}) {\n override readonly name = \"NodeHostError\"\n}\n\nconst absoluteRoot = (root: string): string => {\n if (isAbsolute(root)) return root\n throw new NodeHostError({\n code: \"invalid_repository_root\",\n message: `NodeHost requires an absolute repository root, got ${\n JSON.stringify(Array.from(root).slice(0, 64).join(\"\"))\n }`\n })\n}\n\n/**\n * Stable implementation identities for the raw bundle's five Host slots.\n * Contained POSIX factories replace its spawner with {@link ProcessReaper.layerSpawner}.\n * @category models\n * @since 1.0.0-rc.0\n */\nexport const implementationIds: Readonly<Record<(typeof HostServiceIds)[number], string>> = {\n \"effect/FileSystem\": \"@smthrs/platform-node/AtomicFileSystem\",\n \"effect/Path\": \"@effect/platform-node/NodePath\",\n \"effect/process/ChildProcessSpawner\": \"@effect/platform-node/NodeChildProcessSpawner\",\n \"@smthrs/jj/Jj\": \"@smthrs/jj/node/NodeJj\",\n \"effect/HttpClient\": \"@smthrs/platform-node/EgressHttpClient\"\n}\n\n/** The two services `NodeChildProcessSpawner` resolves paths and files with. */\nconst platform = Layer.mergeAll(AtomicFileSystem.layer, NodePath.layer)\n\n/**\n * What a caller may configure about a contained Node host.\n *\n * `platform` is deliberately absent. `ContainedSpawner.Options` declares it so a\n * caller that supplies its own spawner can describe one, but this native host\n * detaches by `process.platform` whatever a record claims. A caller-supplied\n * `\"win32\"` on a POSIX host would therefore\n * record `pgid: null` for a child that really does lead a group, and\n * {@link ProcessReaper.reap} would retire that record as `no-group` and leave\n * the orphan running forever — a durable lie rather than a compile error.\n *\n * @category models\n * @since 1.0.0-rc.0\n */\nexport type ContainedOptions = ProcessReaper.SpawnerOptions & ProcessReaper.Options\n\n/** The reaper half of {@link ContainedOptions}. */\nconst reaping = (options?: ContainedOptions): ProcessReaper.Options => ({\n ownerPid: options?.ownerPid,\n system: options?.system\n})\n\n/**\n * Provides the default Node implementations for the whole closed Host surface.\n *\n * @category layers\n * @since 0.1.0\n */\nexport const layer: Layer.Layer<NodeHost, JjError> = Layer.mergeAll(\n ProcessConfinement.layer(),\n platform,\n Layer.provide(NodeChildProcessSpawner.layer, platform),\n httpClient,\n NodeJj.layer\n)\n\n/**\n * Provides the Node host with `Jj` bound to one absolute repository root.\n *\n * @category layers\n * @since 1.0.0\n */\nexport const layerAt = (repositoryRoot: string): Layer.Layer<NodeHost, JjError> =>\n Layer.mergeAll(\n ProcessConfinement.layer(),\n platform,\n Layer.provide(NodeChildProcessSpawner.layer, platform),\n httpClient,\n NodeJj.layerAt(absoluteRoot(repositoryRoot))\n )\n\n/**\n * Provides the Node host with process containment turned on.\n *\n * The difference from {@link layer} is what happens to a spawned process when\n * its run stops. Under {@link layer} a child is signalled when its scope\n * closes and then waited for, forever if it ignores `SIGTERM`, and a host that\n * dies without closing its scopes abandons every child it started. This layer\n * gives each child an escalation deadline and records it in the\n * `ProcessLedger`, then sweeps the records a previous incarnation of the same\n * host left behind before it hands the host over\n * ({@link ProcessReaper.reap}).\n *\n * jj is contained here too: `layerContained` builds the `Jj` service over the\n * same spawner rather than letting it start its own children, so a `jj`\n * invocation a crashed host left running is a record the next incarnation\n * reaps like any other.\n *\n * The ledger is a requirement rather than a default because the durable half\n * of containment is only as good as the journal underneath it:\n * `ProcessLedger.layer` inherits a crashed incarnation's processes,\n * `ProcessLedger.layerMemory` contains this incarnation and nothing more, and\n * the choice belongs to the program that knows which it has.\n *\n * @category layers\n * @since 0.1.0\n */\nexport const layerContained = (\n options?: ContainedOptions\n): Layer.Layer<NodeHost, JjError, ProcessLedger.ProcessLedger> => {\n const spawner = Layer.provide(\n ProcessReaper.layerSpawner({ graceMs: options?.graceMs }),\n Layer.provide(NodeChildProcessSpawner.layer, platform)\n )\n return Layer.mergeAll(\n ProcessConfinement.layer(),\n platform,\n httpClient,\n // jj goes through the CONTAINED spawner here, not around it. `NodeJj.layer`\n // spawns its own children, which is right for a host that has no spawner\n // to offer, but under containment it would mean a `jj` that leads no\n // recorded process group, appears in no ledger, and survives the\n // incarnation that started it.\n Layer.provideMerge(NodeJj.layerSpawner, spawner)\n ).pipe(Layer.provideMerge(ProcessReaper.layer(reaping(options))))\n}\n\n/**\n * Provides the contained Node host with `Jj` bound to one absolute repository\n * root.\n *\n * @category layers\n * @since 1.0.0\n */\nexport const layerContainedAt = (\n repositoryRoot: string,\n options?: ContainedOptions\n): Layer.Layer<NodeHost, JjError, ProcessLedger.ProcessLedger> => {\n const spawner = Layer.provide(\n ProcessReaper.layerSpawner({ graceMs: options?.graceMs }),\n Layer.provide(NodeChildProcessSpawner.layer, platform)\n )\n return Layer.mergeAll(\n ProcessConfinement.layer(),\n platform,\n httpClient,\n Layer.provideMerge(NodeJj.layerSpawnerAt(absoluteRoot(repositoryRoot)), spawner)\n ).pipe(Layer.provideMerge(ProcessReaper.layer(reaping(options))))\n}\n"]}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The kernel's `ProcessConfinement` seam, filled with this host's native
3
+ * sandbox: bubblewrap on Linux, seatbelt on macOS.
4
+ *
5
+ * `@smthrs/kernel`'s `ChildProcessSpawner.layer` hands every stage that passed
6
+ * its `proc:spawn` check to the confinement in its context, together with the
7
+ * `ProcessConfinement.Profile` the grants in force admit. This module turns
8
+ * that profile into a {@link ProcessSandbox.Request}, plans it against the
9
+ * workspace, and wraps the stage's argv in the mechanism the host has, so an
10
+ * approved `bash` can write only where an `fs:write` grant says and reach the
11
+ * network only when a `net:*` grant says. A stage that asked for the platform
12
+ * shell is spelled out as `/bin/sh -c <line>` first: wrapping a `shell: true`
13
+ * command line would otherwise leave its redirections and pipes to a shell
14
+ * outside the sandbox.
15
+ *
16
+ * A host with no mechanism is the one decision this module leaves to its
17
+ * caller: {@link Options.unavailable} either refuses the spawn, so nothing
18
+ * runs that the profile would not have confined, or runs it unconfined with
19
+ * a warning, the way every host did before this seam existed. A write set
20
+ * the mechanism cannot enforce safely, a symbolic link below the workspace
21
+ * root, is always refused.
22
+ *
23
+ * @since 1.0.0-rc.1
24
+ */
25
+ import * as KernelProcessConfinement from "@smthrs/kernel/ProcessConfinement";
26
+ import * as Layer from "effect/Layer";
27
+ import * as ProcessSandbox from "./ProcessSandbox.ts";
28
+ /**
29
+ * How the confinement is built.
30
+ *
31
+ * @category models
32
+ * @since 1.0.0-rc.1
33
+ */
34
+ export interface Options {
35
+ /**
36
+ * What happens when this host has no mechanism to enforce a profile with.
37
+ * `"refuse"` fails the spawn, so a command never runs with more than the
38
+ * profile allows; `"unconfined"` runs it as given and logs a
39
+ * warning naming what the host lacks.
40
+ */
41
+ readonly unavailable?: "refuse" | "unconfined" | undefined;
42
+ /** The host facts mechanism selection reads; defaults to the real host. */
43
+ readonly host?: ProcessSandbox.Host | undefined;
44
+ /** Where each run's private temporary directory is created; defaults to the OS temporary directory. */
45
+ readonly temporaryDirectory?: string | undefined;
46
+ }
47
+ /**
48
+ * Builds the native confinement.
49
+ *
50
+ * @category constructors
51
+ * @since 1.0.0-rc.1
52
+ */
53
+ export declare const make: (options?: Options) => KernelProcessConfinement.Service;
54
+ /**
55
+ * Provides the native confinement.
56
+ *
57
+ * @category layers
58
+ * @since 1.0.0-rc.1
59
+ */
60
+ export declare const layer: (options?: Options) => Layer.Layer<KernelProcessConfinement.ProcessConfinement>;
61
+ //# sourceMappingURL=ProcessConfinement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProcessConfinement.d.ts","sourceRoot":"","sources":["../../src/ProcessConfinement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,wBAAwB,MAAM,mCAAmC,CAAA;AAE7E,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAOrC,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AAErD;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAA;IAC1D,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,IAAI,GAAG,SAAS,CAAA;IAC/C,uGAAuG;IACvG,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACjD;AA0FD;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,UAAS,OAAY,KAAG,wBAAwB,CAAC,OA2MrE,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,UAAS,OAAY,KAAG,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,kBAAkB,CAC1B,CAAA"}