@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
package/docs/api.md ADDED
@@ -0,0 +1,553 @@
1
+ ---
2
+ title: "API reference"
3
+ description: "Every export of @smthrs/platform-node: the NodeHost layers, the AtomicFileSystem adapter and its glob grammar, HostLiveness, ScopedProcess, and ProcessReaper's lifecycle and refusals."
4
+ ---
5
+
6
+ `@smthrs/platform-node` composes the closed five-tag Host surface for Node.
7
+ `NodeHost.layer` provides all of it:
8
+
9
+ ```ts
10
+ import { NodeHost } from "@smthrs/platform-node"
11
+ import * as Effect from "effect/Effect"
12
+ import * as ChildProcess from "effect/unstable/process/ChildProcess"
13
+ import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"
14
+
15
+ const program = Effect.gen(function*() {
16
+ const spawner = yield* ChildProcessSpawner
17
+ return yield* spawner.string(ChildProcess.make("printf", ["hello"]))
18
+ }).pipe(Effect.provide(NodeHost.layer))
19
+ ```
20
+
21
+ :::warning
22
+ These adapters require host APIs such as `node:child_process`; they cannot run
23
+ in a browser. Use [@smthrs/platform-browser](/api/platform-browser) for a browser
24
+ host and [@smthrs/platform-bun](/api/platform-bun) for the Bun host bundle.
25
+ `ScopedProcess` supports ordinary Node and Bun runtime executables.
26
+ :::
27
+
28
+ There is no shell service. Running a command is Effect's `ChildProcess` /
29
+ `ChildProcessSpawner`; a wall-clock budget is `Effect.timeout` around the
30
+ effect, and cancellation is fiber interruption, never an `AbortSignal`. There is
31
+ no HTTP service either: an outgoing request is Effect's `HttpClient`, provided
32
+ here as `EgressHttpClient.layer(environment)`. That layer is Undici through the egress proxy
33
+ `HTTP_PROXY`/`HTTPS_PROXY`/`NO_PROXY` name, and the plain
34
+ `NodeHttpClient.layerUndici` pool when they name none. Undici installs no
35
+ redirect interceptor either way, so every hop stays visible to
36
+ [@smthrs/kernel](/api/kernel).
37
+
38
+ The complete host bundles require jj 0.39.0 or newer. Each bundle builds its jj
39
+ layer with one version probe; construction can fail with `JjError`, including
40
+ `not_installed` or `unsupported_version`. The version probe runs outside the host process ledger; repository commands
41
+ use the selected process runner.
42
+
43
+ ## Requirements
44
+
45
+ | Requirement | Why |
46
+ | ------------------------------- | --------------------------------------------------------------------- |
47
+ | Node.js >=26.4.0 | the minimum this package's `engines` field declares |
48
+ | the `smithers-jj-export` helper | `AtomicFileSystem` runs every guarded filesystem operation through it |
49
+ | a POSIX host | Windows has none of those primitives and is unsupported |
50
+
51
+ The helper is a real prerequisite, not a soft one, and it fails LATE by
52
+ design. `NodeHost.layer` builds cleanly on a host without it, because the
53
+ executable is re-validated per request rather than once at construction: the
54
+ file a path names can be replaced while a host runs, and a check that happened
55
+ only at boot would be a check about a file that is no longer there. The
56
+ consequence is that on `node:22-slim`, `node:22-alpine`, or a distroless image
57
+ the layer builds, the run starts, and the first guarded filesystem call inside a
58
+ flow body fails `PermissionDenied`. Build or install the helper, or point the
59
+ adapter at it; see [Configure the filesystem helper](./guides/configure-the-filesystem-helper.md).
60
+
61
+ ## Entry points
62
+
63
+ | Import | Source | Platform |
64
+ | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
65
+ | `@smthrs/platform-node` | [src/index.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-node/src/index.ts) | Node |
66
+ | `@smthrs/platform-node/NodeHost` | [src/NodeHost.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-node/src/NodeHost.ts) | Node |
67
+ | `@smthrs/platform-node/AtomicFileSystem` | [src/AtomicFileSystem.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-node/src/AtomicFileSystem.ts) | Node |
68
+ | `@smthrs/platform-node/HostLiveness` | [src/HostLiveness.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-node/src/HostLiveness.ts) | Node |
69
+ | `@smthrs/platform-node/ProcessReaper` | [src/ProcessReaper.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-node/src/ProcessReaper.ts) | Node |
70
+ | `@smthrs/platform-node/ScopedProcess` | [src/ScopedProcess.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-node/src/ScopedProcess.ts) | Node / Bun |
71
+ | `@smthrs/platform-node/ProcessConfinement` | [src/ProcessConfinement.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-node/src/ProcessConfinement.ts) | Node / Bun |
72
+ | `@smthrs/platform-node/ProcessSandbox` | [src/ProcessSandbox.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-node/src/ProcessSandbox.ts) | Node / Bun |
73
+
74
+ The barrel exports `NodeHost`, `EgressHttpClient`, `HostLiveness`, `ProcessReaper`,
75
+ `ScopedProcess`, `ProcessConfinement`, and `ProcessSandbox`.
76
+ `AtomicFileSystem` is reached as `NodeHost.AtomicFileSystem` or through its own
77
+ subpath, never from the barrel.
78
+
79
+ `NodeHost` also re-exports the pieces it composes, so a program that wants one
80
+ slot rather than the whole bundle needs no second dependency:
81
+
82
+ | Re-export | What it is |
83
+ | ---------------------------------- | ---------------------------------------------------------------- |
84
+ | `NodeHost.AtomicFileSystem` | this package's descriptor-relative filesystem, the bundle's slot |
85
+ | `NodeHost.ProcessReaper` | this package's containment sweep |
86
+ | `NodeHost.NodeCrypto` | Effect's Node `Crypto` |
87
+ | `NodeHost.NodeFileSystem` | Effect's raw Node filesystem, which carries NO atomic extension |
88
+ | `NodeHost.NodeChildProcessSpawner` | Effect's Node spawner |
89
+ | `NodeHost.NodeHttpClient` | Effect's Undici-backed `HttpClient` |
90
+
91
+ `NodeCrypto` is there for a different reason from the rest. `Crypto` is not a
92
+ Host service, so it is not in the closed list, but every durable composition
93
+ needs one and a program that already depends on this package for its host
94
+ should not need a second dependency for the digest.
95
+
96
+ `NodeHost.implementationIds` is a
97
+ `Readonly<Record<HostServiceIds[number], string>>` naming the five raw bundle
98
+ implementations. Contained factories replace the process runner with
99
+ `ProcessReaper.layerSpawner`; the static identity table does not describe
100
+ that substitution.
101
+
102
+ ## Layers
103
+
104
+ | Layer | Jj bound to | Containment |
105
+ | ------------------------------------------- | --------------------- | ----------- |
106
+ | `NodeHost.layer` | the process directory | no |
107
+ | `NodeHost.layerAt(root)` | one absolute root | no |
108
+ | `NodeHost.layerContained(options?)` | the process directory | yes |
109
+ | `NodeHost.layerContainedAt(root, options?)` | one absolute root | yes |
110
+
111
+ The contained pair is what `@smthrs/flows`' `NodeRuntime` composes. Each pipeline leg
112
+ gets a prepared supervisor, a `SIGTERM`-then-`SIGKILL` deadline, and a
113
+ `ProcessLedger` record before activation, `jj` runs
114
+ through that same spawner rather than starting its own children, and
115
+ `ProcessReaper.reap` sweeps the records a crashed incarnation left behind while
116
+ the layer is built. The ledger is a requirement rather than a default: only the
117
+ program knows whether it has a durable one.
118
+
119
+ `NodeHost.ContainedOptions` is `graceMs` plus the reaper's `ownerPid` and
120
+ `system`. It deliberately omits `ContainedSpawner.Options.platform`. The
121
+ platform comes from the real `process.platform`, so the native process group
122
+ and recorded identity agree. A caller cannot describe a Windows record for an
123
+ owner that actually leads a POSIX group.
124
+
125
+ ## ScopedProcess
126
+
127
+ A small scoped process API for transient CLI commands. It uses the same POSIX
128
+ supervisor lifecycle as the contained hosts without requiring a filesystem,
129
+ repository service, or durable process ledger.
130
+
131
+ ```ts
132
+ interface Options extends ChildProcess.KillOptions {
133
+ readonly command: string
134
+ readonly args?: ReadonlyArray<string> | undefined
135
+ readonly cwd?: string | undefined
136
+ readonly env?: Readonly<Record<string, string | undefined>> | undefined
137
+ readonly stdin?: "ignore" | "pipe" | undefined
138
+ readonly windowsVerbatimArguments?: boolean | undefined
139
+ readonly windowsHide?: boolean | undefined
140
+ }
141
+
142
+ interface Handle extends ChildProcessHandle {
143
+ readonly targetPid: number
144
+ }
145
+
146
+ const spawn: (options: Options) => Effect.Effect<Handle, PlatformError, Scope>
147
+
148
+ interface Status {
149
+ readonly code: number | null
150
+ readonly signal: ChildProcess.Signal | null
151
+ }
152
+
153
+ const status: (handle: ChildProcessHandle) => Effect.Effect<Status, PlatformError>
154
+ ```
155
+
156
+ `spawn` runs the literal executable and argv with piped stdout/stderr and
157
+ `stdin: "ignore"` by default. When `env` is provided it is the complete target
158
+ environment; when omitted it inherits the host environment. The default
159
+ termination policy is `SIGTERM`, then `SIGKILL` after 2,000 milliseconds.
160
+ `windowsHide` defaults to true. Failed startup cleans up its child scope before
161
+ returning an error.
162
+
163
+ On POSIX, `handle.pid` identifies the live supervisor and `targetPid` identifies
164
+ the native target for diagnostics. `exitCode` describes the target;
165
+ `status(handle)` preserves a terminating signal as `{ code: null, signal }`.
166
+ A missing or invalid target result remains a platform failure. Use the handle's
167
+ `kill` for cleanup rather than signalling either numeric pid yourself.
168
+
169
+ Drain stdout, stderr, stdin and status concurrently when using pipes. Keep the
170
+ whole operation inside `Effect.scoped`; a target's natural exit also triggers
171
+ cleanup of children holding those pipes open. The private parent connection
172
+ requests cleanup on host loss, and the supervisor's group guardian kills the
173
+ group on supervisor loss. This API has no durable ledger; use
174
+ `NodeHost.layerContained` when a later host must reconcile retained records.
175
+
176
+ ## ProcessReaper.layerSpawner
177
+
178
+ ```ts
179
+ type SpawnerOptions = Omit<ContainedSpawner.Options, "platform">
180
+
181
+ const layerSpawner: (
182
+ options?: SpawnerOptions
183
+ ) => Layer.Layer<ChildProcessSpawner, never, ChildProcessSpawner | ProcessLedger>
184
+ ```
185
+
186
+ Provides a contained spawner without the complete Node or Bun host. Supply a
187
+ `ProcessLedger` and the underlying runtime spawner. On POSIX this factory uses
188
+ the platform's prepared native adapter, whose pipe error listeners live until
189
+ their descriptors close, including writes interrupted by owner loss. On
190
+ Windows it retains the supplied raw runtime spawner. The platform always comes
191
+ from `process.platform`; `graceMs` defaults to 2,000 milliseconds.
192
+
193
+ The adapter supports the standard command's stdin/stdout/stderr options and
194
+ additional descriptors named `fdN` for indices 3 through 65,535. Recognized
195
+ indices outside that finite integer range fail before target execution; the
196
+ operating system may impose a lower limit. Names Effect does not recognize
197
+ are ignored. A missing target result fails status and pending I/O; it never
198
+ proves successful cleanup.
199
+
200
+ `NodeHost.layerContained`, `BunHost.layerContained`, and their rooted variants
201
+ use this factory. It records new owners; `ProcessReaper.layer` separately
202
+ reconciles records inherited from a previous incarnation.
203
+
204
+ ## ProcessReaper.processLifecycle
205
+
206
+ ```ts
207
+ const processLifecycle: ContainedSpawner.Lifecycle
208
+ ```
209
+
210
+ The lower-level Node/Bun platform hook for custom
211
+ `ContainedSpawner.layer(options, lifecycle)` compositions. Prefer
212
+ `ProcessReaper.layerSpawner` for the supplied native adapter as well as the
213
+ lifecycle.
214
+ It prepares a live supervisor, lets the kernel commit the owner identity with
215
+ the original command digest, and activates the target only afterward. The
216
+ supervisor keeps group ownership until cleanup completes, including after a
217
+ natural target exit. Each pipeline leg gets its own owner and ledger record.
218
+
219
+ The returned handle's `pid` is the supervisor's, while `exitCode` and
220
+ `isRunning` describe the target. `unref` changes liveness references without
221
+ relinquishing cleanup ownership. Scope close and repeated explicit kills share
222
+ one cleanup result; the first accepted policy wins. Failed or unverified
223
+ cleanup fails close and leaves `settled` false so the kernel retains its record.
224
+
225
+ Default POSIX commands own a separate process group. With `detached: false`,
226
+ the supervisor and target share the caller's group, and cleanup signals only
227
+ the target: group cleanup is explicitly disabled. Explicit stopping of a live
228
+ grouped target also attempts a revalidated ancestry sweep for descendants that
229
+ moved to other groups. That positive-PID sweep is best effort; automatic
230
+ cleanup after natural exit does not promise to reclaim deliberately escaped
231
+ sessions. Windows remains unsupported best effort.
232
+
233
+ The supervisor starts the current Node or Bun runtime. Compiled Bun
234
+ applications and Node single-executable applications are refused before target
235
+ execution because they do not implement the runtime's eval entry point.
236
+
237
+ ## Filesystem
238
+
239
+ `AtomicFileSystem.layer` is `NodeHost`'s filesystem slot, and it is not Effect's
240
+ `NodeFileSystem`. Node exposes no `openat(2)` or `renameat(2)`, so the adapter
241
+ delegates each operation to a POSIX helper that opens the workspace root once,
242
+ walks every component with `O_NOFOLLOW`, and performs the final syscall relative
243
+ to a pinned parent descriptor. Under [@smthrs/kernel](/api/kernel)'s
244
+ `FileSystem.layer` that is what makes a symlink swapped in after authorization
245
+ unable to redirect the operation, and it is why the bundle returns
246
+ `PermissionDenied` for an out-of-root path, a hard link, a symlink, or a special
247
+ file rather than performing raw effects.
248
+
249
+ An aliased workspace root and its canonical `realPath` spelling address the
250
+ same pinned descriptor. Paths returned by `realPath` can therefore be used for
251
+ subsequent reads, writes, and atomic sibling replacement. Capability resources
252
+ remain rooted at the logical workspace name; child symlinks, sibling paths,
253
+ and replacement of the pinned root retain the same refusal checks.
254
+
255
+ | Constant or constructor | What it is |
256
+ | ------------------------------------- | --------------------------------------------------------------------- |
257
+ | `AtomicFileSystem.layer` | the adapter with every default |
258
+ | `AtomicFileSystem.layerWith(options)` | the same, with the helper and the ceilings configured |
259
+ | `AtomicFileSystem.defaultExecutable` | `/usr/local/bin/smithers-jj-export`, the last path searched |
260
+ | `AtomicFileSystem.defaultLimits` | 16 MiB content, 24 MiB request, 24 MiB response, 64 KiB helper stderr |
261
+ | `AtomicFileSystem.defaultConcurrency` | `os.availableParallelism()` |
262
+ | `AtomicFileSystem.defaultTimeoutMs` | 300000 |
263
+ | `AtomicFileSystem.AtomicHelperError` | the tagged configuration failure, below |
264
+
265
+ **Configuration errors.** An option outside its bounds, a request that cannot
266
+ be serialized, and a helper that is missing, unusable, or untrusted fail with
267
+ `AtomicHelperError` (`_tag` `@smthrs/platform-node/AtomicHelperError`), never a
268
+ bare `Error`. Classify one by `code`. A rejected option or request reaches an
269
+ operation as `BadArgument` whose `cause` is the `AtomicHelperError`;
270
+ `AtomicFileSystem.resolveHelper()` throws it directly.
271
+
272
+ | `code` | Raised when |
273
+ | ------------------------------- | --------------------------------------------------------------------------- |
274
+ | `limit_invalid` | a `limits` byte ceiling is not a positive safe integer within its bound |
275
+ | `concurrency_invalid` | `concurrency` is not a positive integer |
276
+ | `timeout_invalid` | `timeoutMs` is not a positive integer no greater than 2147483647 |
277
+ | `request_not_serializable` | JSON has no form for the request |
278
+ | `helper_missing` | no helper exists at any searched location; the message carries install hint |
279
+ | `helper_unusable` | `SMITHERS_WORKSPACE_JJ_EXPORT_BINARY` names a helper that cannot run |
280
+ | `helper_path_invalid` | the helper path is relative, ends in a separator, or loops through links |
281
+ | `helper_not_regular_file` | the helper path is not a regular file |
282
+ | `helper_inside_workspace` | the helper lives in, or appeared in, the confined workspace |
283
+ | `staging_directory_not_private` | the per-user staging directory is a link or has another owner |
284
+ | `staging_unavailable` | no location can hold a staged copy of the helper |
285
+
286
+ **Protocol faults.** A helper that answers out of protocol, over a bound, or
287
+ not at all fails closed: the operation fails with a `PlatformError` whose `cause`
288
+ is an `AtomicHelperFault` (`_tag` `@smthrs/platform-node/AtomicHelperFault`).
289
+ Classify one by `code`: `response_unframed`, `response_tag_unknown`,
290
+ `response_length_invalid`, `response_length_mismatch`, `envelope_malformed`,
291
+ `field_malformed`, `file_type_unknown`, `payload_malformed`,
292
+ `read_limit_exceeded`, `entries_malformed`, `batch_malformed`,
293
+ `digest_malformed`, `result_malformed`, `operation_unsupported`,
294
+ `helper_timeout`, `response_limit_exceeded`, `helper_rejected`, `helper_exited`.
295
+ An errno the helper itself reports is an `AtomicHelperRejection` with the native
296
+ `code` and `syscall`.
297
+
298
+ **Cost.** Every operation starts one helper process. Under the kernel's guarded
299
+ layer, authorization adds two more, resolving the path before and after the
300
+ grant decision. That is the price of descriptor-relative confinement on a runtime with no
301
+ `openat`, and it is why the adapter carries a process ceiling: without one, an
302
+ `Effect.forEach(files, read, { concurrency: "unbounded" })` over fifty entries
303
+ would start fifty helpers at once. Batch a wide fan-out, or raise
304
+ `concurrency` deliberately. A directory listing is one helper for the whole tree,
305
+ so `readDirectory(root, { recursive: true })` costs far less than a read per
306
+ entry.
307
+
308
+ Every field of `Options` except `executable` is read once, when the layer is
309
+ built, so the ceilings cannot change under a running host.
310
+
311
+ **Glob.** The helper cannot call Node's globber, so it implements the grammar:
312
+ `*` and `?` inside one segment, `[...]` classes with `!` or `^` negation, `**`
313
+ across zero or more whole segments, `{a,b}` alternation, a trailing `/` for
314
+ directory-only matching, and the dotfile rule, which keeps a wildcard out of a
315
+ name beginning with `.` while letting a segment that spells the dot, `.*` or
316
+ `[.]*`, match one. Exclusions prune the walk itself: excluding a directory
317
+ excludes everything below it, and nothing under an excluded directory is listed,
318
+ counted against the entry ceiling, or charged against the response ceiling. An
319
+ exclusion that names the root stops before the walk begins. An absolute exclude
320
+ is rewritten against the glob root so it applies to the same names the selecting
321
+ pattern does. The selecting pattern prunes the walk too: a directory is entered
322
+ only when a remaining segment or an open `**` can still name something below it,
323
+ and only selected names are charged against the response ceiling. A trailing `**` spans zero segments, so it also names its own
324
+ anchor: a directory always, and a non-directory only when every segment before it
325
+ is literal, which is the shortcut the native globber takes when it can address
326
+ the path directly rather than read a directory. `top.txt/**` names the file;
327
+ `t*.txt/**` names nothing. A one-member class is the literal it spells, so `[.]`
328
+ is a `.` path segment: the globber drops a SPELLED `.` before it parses and
329
+ collapses `[.]` only afterwards, so this one survives and, as the last segment,
330
+ names its anchor under the same rule. One addition: a `**` immediately before it
331
+ addresses nothing, so `**/[.]` names nothing while `**/deep/[.]` names the
332
+ directory. Anywhere but last, and in an exclusion, a `.` segment names an entry
333
+ no directory holds. Matching aligns path segments with bounded dynamic programming; each segment
334
+ uses globset’s compiled, non-backtracking matcher.
335
+
336
+ Two grammar bounds are refusals rather than silent truncation: a pattern longer
337
+ than 4096 UTF-8 bytes, and one whose braces expand past 64 alternatives, both
338
+ fail as `BadArgument`. The byte limit is checked before expansion; the alternative
339
+ limit is enforced during bounded expansion. Each resulting alternative is
340
+ validated before filesystem walking, so
341
+ an over-large pattern costs no listing and answers with the typed refusal rather
342
+ than with a fail-closed transport error. So do the three constructs this grammar
343
+ does not implement: extglob (`+(a|b)`), any `[:` opener inside a character
344
+ class (including POSIX classes), and brace bodies containing `..` (including
345
+ ranges such as `{1..3}` and sets containing that text). These checks conservatively
346
+ reject unsupported syntax before filesystem access. Reading unsupported constructs
347
+ as ordinary characters could answer a different question; an exclusion could
348
+ then return the paths it was meant to remove. The refusal therefore covers the exclude list as well
349
+ as the pattern, and it recognises a character class, so `[!(]*` is an ordinary
350
+ negated class and not an extglob.
351
+
352
+ Backslashes follow Node's POSIX rules instead: an absolute selector and every
353
+ exclude drop them while leaving following wildcard magic active; a relative
354
+ selector containing one matches nothing. The public filesystem path is
355
+ absolute, and the direct atomic protocol preserves the relative empty answer.
356
+
357
+ Three answers are pinned rather than copied, because the native globber gives no
358
+ single answer to copy.
359
+
360
+ 1. **Case.** Matching is case-sensitive on every host. Node's globber passes
361
+ `nocase: isMacOS || isWindows` with `nocaseMagicOnly: true`. On a
362
+ case-insensitive host a magic segment folds case (`*.TXT` finds `upper.txt`),
363
+ a literal segment the matcher decides is compared exactly (`**/MID.txt`
364
+ misses `mid.txt`), and a literal segment Node addresses directly comes back
365
+ with the pattern's own spelling (`TOP.TXT` returns `TOP.TXT`), even though the
366
+ directory does not hold that spelling. The adapter returns only names its
367
+ walk found. A pattern whose meaning depends on which host reads it is worse
368
+ than one that means the same everywhere, and worst of all in an exclusion,
369
+ so the adapter keeps one rule everywhere.
370
+ 2. **A trailing `**` in an exclusion** removes what is under a directory and
371
+ leaves the directory entry itself. Node's own answer here depends on the
372
+ shape of the SELECTING pattern: `**/*` with `exclude: ["nested/**"]` keeps
373
+ `nested`, and `**` with the same exclusion drops it. The adapter gives one
374
+ answer for every selector. Consequently, the directory-only `**/` names
375
+ directories below its own anchor but not that anchor: with `exclude: ["**/"]`,
376
+ `**` keeps the root and its files while pruning every directory.
377
+ Node empties the answer instead.
378
+ 3. **A dotted segment after `**`.** Node 22 matched nothing for `**/.hidden`;
379
+ Node 24 and later match the dotfiles. The adapter follows the newer reading
380
+ for the dotfiles themselves, but a `**` never spans a hidden directory, so
381
+ Node's further step of walking into a hidden directory that the next segment
382
+ matches is refused. With `.hidden/.secret` and `.hidden/.nested/.wanted`
383
+ present, Node returns `.hidden/.secret` for `**/.*` and `.hidden/.nested` for
384
+ `**/.*/**`; the adapter returns `.hidden` alone for both. Only a segment that
385
+ names the hidden directory enters it: `.hidden/.*` returns `.hidden/.nested`
386
+ and `.hidden/.secret`.
387
+
388
+ **Removal.** `remove(path, { recursive: true })` walks iteratively with an
389
+ explicit descriptor stack: depth is bounded at 512 levels and the total number
390
+ of entries visited at 100000, counted as each directory is read, so a hostile
391
+ wide directory is refused after 100000 names rather than allocated whole. One
392
+ directory's names are read before any of its entries is unlinked, because
393
+ unlinking from a directory while iterating it is undefined; the entry ceiling
394
+ is what bounds the names held across the whole walk. Progress is partial on
395
+ refusal, since entries already unlinked stay unlinked. `force: true` succeeds
396
+ for a path whose ancestors do not exist, exactly as `fs.rm` does.
397
+
398
+ ## Liveness and reaping
399
+
400
+ `ProcessReaper.groupSnapshotFor(platform)` selects the live cleanup probe,
401
+ returning `(pgid) => { ownGroup, members } | undefined`. Each member carries
402
+ `pid`, `startedAtMs`, and `zombie`. Linux reads `/proc` directly and needs no
403
+ `ps` binary for live cleanup; other POSIX hosts use `/bin/ps`. Unreadable or
404
+ malformed process data returns `undefined`, so the snapshot cannot claim
405
+ success. `ProcessReaper.groupVacant(pgid)` asks the kernel first with signal 0:
406
+ only `ESRCH` returns `true`, which proves the group has no process at all and
407
+ needs no `ps` fork. A live member, a zombie, or any other error returns `false`,
408
+ and the snapshot decides. `ProcessReaper.processLifecycle` uses both probes for
409
+ the current platform.
410
+
411
+ `HostLiveness.isAlive({ hostId })` is the probe a durable engine consults before
412
+ it takes a run whose recorded owner it is not: an owner on a different host reads
413
+ as alive, and an owner on this host reads as alive exactly while its pid is
414
+ signalable. `@smthrs/run-store`'s `Ownership.sameHostPidProbe` answers the same
415
+ question differently for a foreign host, and the two are not interchangeable;
416
+ the JSDoc on `isAlive` names both inputs on which they disagree.
417
+
418
+ `ProcessReaper.reap` kills the process groups a crashed incarnation of the same
419
+ `hostId` abandoned. It signals a record only when every guard holds: the numbers
420
+ name something the platform can signal, the group is not this host's, the owner
421
+ is gone, and the pid still names the process the record describes. Two of those
422
+ guards are identity questions: this process's own group, and when the
423
+ recorded pid started. On Linux, `systemFor` answers both from `/proc`
424
+ (`procSystem`), so an image without `procps` can still reap; other POSIX hosts
425
+ ask `ps` (`posixSystem`). Either can go unanswered, and an unanswered guard
426
+ refuses, because a guard that did not run is not a guard that passed. No
427
+ evidence never authorizes a `SIGKILL`.
428
+
429
+ `ProcessReaper.layer` reports every sweep: one log line with the kill count and
430
+ the count per refusal, at `Warning` when `identity-unverified`,
431
+ `own-group-unknown`, or `kill-failed` left a process running, and the
432
+ `flows_process_reaper_refusals` counter with a `refusal` attribute.
433
+
434
+ `reap` returns one `Reaped` per inherited record. The two outcomes are a union
435
+ discriminated by `killed`: a killed entry carries no reason, and a kept entry
436
+ always carries the `Refusal` that produced it, so one check on `killed` is what
437
+ makes `refusal` readable.
438
+
439
+ A refusal also decides whether the record is retired. Retiring says in the
440
+ journal that nothing was signalled and stops every later incarnation
441
+ re-examining a number the operating system has moved on from, so only a refusal
442
+ a later incarnation cannot answer differently is final.
443
+
444
+ | Refusal | Retired |
445
+ | --------------------- | ------- |
446
+ | `owner-alive` | no |
447
+ | `identity-unverified` | no |
448
+ | `own-group-unknown` | no |
449
+ | `no-group` | yes |
450
+ | `own-group` | yes |
451
+ | `invalid-record` | yes |
452
+ | `pre-boot` | yes |
453
+ | `process-gone` | yes |
454
+ | `identity-mismatch` | yes |
455
+ | `kill-failed` | no |
456
+
457
+ Windows reaping is unsupported best-effort. Windows is an unsupported platform
458
+ and `AtomicFileSystem` fails every operation closed there, but
459
+ `systemFor("win32")` still reaches `taskkill /T /F` through the sweep rather than
460
+ retiring every record unsignalled, because a feature that appears to work
461
+ partially is worse than one that says what it does.
462
+
463
+ ## Conformance
464
+
465
+ The package runs the shared suite from
466
+ [`@smthrs/kernel/test/contract`](/api/kernel) twice: once with explicit
467
+ expectations, and once taking every default the suite offers, against a loopback
468
+ HTTP server so the `HttpClient` success path is actually asserted rather than
469
+ only its refusal. On top of that, the atomic
470
+ filesystem is compared against `@effect/platform-node`'s own adapter: open
471
+ flags, errno classification, `stat` fields, and the glob grammar are asserted
472
+ row by row against the native implementation rather than against a hand-written
473
+ expectation. Containment is driven over real detached process groups.
474
+
475
+ ## Reading next
476
+
477
+ [@smthrs/kernel](/api/kernel) owns the closed list and decorates these same tags
478
+ with capability checks. [@smthrs/platform-bun](/api/platform-bun) and
479
+ [@smthrs/platform-browser](/api/platform-browser) are the sibling bundles.
480
+
481
+ ## Pinned web connections
482
+
483
+ `EgressHttpClient.layer(environment)` supplies the kernel destination-pinning
484
+ contract. Web requests get a fresh dispatcher using only their authorized IP
485
+ addresses. Host and TLS server name retain the requested hostname; TLS
486
+ verification stays enabled. `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY`
487
+ select the route by hostname. Proxied requests use CONNECT to the approved IP,
488
+ including plain HTTP, so the proxy cannot resolve the destination again.
489
+ A proxy must support IP tunnels; refusal never falls back to direct access.
490
+ Dispatchers close after their response body and are destroyed on failure or
491
+ cancellation. Ordinary requests without the web destination policy retain the
492
+ shared dispatcher, including local model connections.
493
+
494
+ A request whose pinned addresses include none of the family Undici asks for
495
+ fails with a `TransportError` whose `cause` is an `EgressAddressError` (`_tag`
496
+ `@smthrs/platform-node/EgressAddressError`, `code` `no_approved_address`).
497
+
498
+ Pinned web requests support HTTP and HTTPS proxies only. Other proxy schemes
499
+ fail closed. The transport sets Host from the URL and discards caller-supplied
500
+ proxy authorization and connection framing headers.
501
+
502
+ ## ProcessConfinement
503
+
504
+ `ProcessConfinement.layer(options?)` provides the kernel's process confinement.
505
+ Compose it as an input to `@smthrs/kernel/ChildProcessSpawner.layer`, alongside
506
+ the same `GrantStore` and `Workspace` used for filesystem authorization. The
507
+ kernel checks approval, snapshots effective grants, and confines every pipeline
508
+ stage before spawning any stage. All `NodeHost` bundles supply this service;
509
+ a guarded spawner without it refuses execution.
510
+
511
+ `make(options?)` returns the same service directly. Options are:
512
+
513
+ | Option | Default | Behavior |
514
+ | -------------------- | ---------------------- | --------------------------------------------------------------------------------------- |
515
+ | `unavailable` | `"refuse"` | Refuse a missing mechanism; `"unconfined"` explicitly permits execution with a warning. |
516
+ | `temporaryDirectory` | OS temporary directory | Parent for private, scope-owned temporary storage. |
517
+ | `host` | Real host probes | Injectable mechanism selection and filesystem probes. |
518
+
519
+ Linux needs `bwrap`; macOS needs `/usr/bin/sandbox-exec`. An installed mechanism
520
+ that fails to start never falls back to unconfined execution. A shell request
521
+ runs inside the wrapper, including its redirections and subprocesses. Streams,
522
+ exit codes, and cancellation retain Effect's process contract.
523
+
524
+ The profile accepts writable directory trees without broadening file grants to
525
+ their parents. A writable tree also needs read authority and write authority
526
+ for its directory entry because a writable bind exposes existing data and
527
+ metadata. Unsupported globs, partial ceilings, and ambiguous deny regions
528
+ stay closed. Networking opens only for unrestricted grants across all network
529
+ actions. Closed networking blocks socket creation. Native agent commands keep
530
+ host Unix sockets closed when IP networking opens, except the fixed macOS
531
+ system DNS resolver endpoint.
532
+ The launcher receives a minimal environment; the command's environment is
533
+ restored inside confinement without putting its values in launcher arguments.
534
+ macOS also denies delegation through host IPC services. Runtime paths and
535
+ private temporary storage are bootstrap permissions;
536
+ known host credential locations stay masked. Workspace links do not grant
537
+ reads of their external targets. This boundary does not isolate trusted host
538
+ JavaScript or supply a remote sandbox provider.
539
+
540
+ ## ProcessSandbox
541
+
542
+ The build graph and `ProcessConfinement` share this mechanism implementation.
543
+ `select(request, host)`, `plan(request, location, host)`, and `wrap(plan, argv,
544
+ environment, host?)` resolve a request into an enforced command.
545
+ `seatbelt`, `bubblewrap`, and `docker` render each supported mechanism;
546
+ `host`, `validateWrites`, `environment`, `diagnose`, `isUnenforceable`, and
547
+ `unenforceable` expose its host probes, validation, environment, diagnostics,
548
+ and refusals. Requests name `network`, `reads`, and writable directory `writes`,
549
+ with optional `mechanism`, `writeFiles`, `readOnly`, `externalReads`, `strict`,
550
+ and `unixSockets`. Native agent confinement uses a strict process and IPC
551
+ policy and closes Unix sockets; build tools retain their declared policy. Build
552
+ output files may open a parent directory; agent permission profiles never use
553
+ that build-specific option.