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

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