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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (442) hide show
  1. package/CHANGELOG.md +211 -0
  2. package/LICENSE +21 -0
  3. package/README.md +165 -2
  4. package/bin/darwin-arm64/smithers-jj-export +0 -0
  5. package/bin/darwin-x64/smithers-jj-export +0 -0
  6. package/bin/linux-arm64/smithers-jj-export +0 -0
  7. package/bin/linux-x64/smithers-jj-export +4 -0
  8. package/bin/win32-x64/smithers-jj-export.exe +0 -0
  9. package/dist/cjs/AtomicFileSystem.d.ts +147 -0
  10. package/dist/cjs/AtomicFileSystem.d.ts.map +1 -0
  11. package/dist/cjs/AtomicFileSystem.js +234 -0
  12. package/dist/cjs/AtomicFileSystem.js.map +7 -0
  13. package/dist/cjs/EgressHttpClient.d.ts +106 -0
  14. package/dist/cjs/EgressHttpClient.d.ts.map +1 -0
  15. package/dist/cjs/EgressHttpClient.js +202 -0
  16. package/dist/cjs/EgressHttpClient.js.map +7 -0
  17. package/dist/cjs/HostLiveness.d.ts +81 -0
  18. package/dist/cjs/HostLiveness.d.ts.map +1 -0
  19. package/dist/cjs/HostLiveness.js +49 -0
  20. package/dist/cjs/HostLiveness.js.map +7 -0
  21. package/dist/cjs/NodeHost.d.ts +145 -0
  22. package/dist/cjs/NodeHost.d.ts.map +1 -0
  23. package/dist/cjs/NodeHost.js +128 -0
  24. package/dist/cjs/NodeHost.js.map +7 -0
  25. package/dist/cjs/ProcessConfinement.d.ts +61 -0
  26. package/dist/cjs/ProcessConfinement.d.ts.map +1 -0
  27. package/dist/cjs/ProcessConfinement.js +292 -0
  28. package/dist/cjs/ProcessConfinement.js.map +7 -0
  29. package/dist/cjs/ProcessReaper.d.ts +457 -0
  30. package/dist/cjs/ProcessReaper.d.ts.map +1 -0
  31. package/dist/cjs/ProcessReaper.js +349 -0
  32. package/dist/cjs/ProcessReaper.js.map +7 -0
  33. package/dist/cjs/ProcessSandbox.d.ts +391 -0
  34. package/dist/cjs/ProcessSandbox.d.ts.map +1 -0
  35. package/dist/cjs/ProcessSandbox.js +774 -0
  36. package/dist/cjs/ProcessSandbox.js.map +7 -0
  37. package/dist/cjs/ScopedProcess.d.ts +66 -0
  38. package/dist/cjs/ScopedProcess.d.ts.map +1 -0
  39. package/dist/cjs/ScopedProcess.js +87 -0
  40. package/dist/cjs/ScopedProcess.js.map +7 -0
  41. package/dist/cjs/index.d.ts +38 -0
  42. package/dist/cjs/index.d.ts.map +1 -0
  43. package/dist/cjs/index.js +47 -0
  44. package/dist/cjs/index.js.map +7 -0
  45. package/dist/cjs/internal/AtomicFileSystemExecutable.d.ts +61 -0
  46. package/dist/cjs/internal/AtomicFileSystemExecutable.d.ts.map +1 -0
  47. package/dist/cjs/internal/AtomicFileSystemExecutable.js +250 -0
  48. package/dist/cjs/internal/AtomicFileSystemExecutable.js.map +7 -0
  49. package/dist/cjs/internal/AtomicFileSystemProtocol.d.ts +78 -0
  50. package/dist/cjs/internal/AtomicFileSystemProtocol.d.ts.map +1 -0
  51. package/dist/cjs/internal/AtomicFileSystemProtocol.js +382 -0
  52. package/dist/cjs/internal/AtomicFileSystemProtocol.js.map +7 -0
  53. package/dist/cjs/internal/AtomicFileSystemTransport.d.ts +44 -0
  54. package/dist/cjs/internal/AtomicFileSystemTransport.d.ts.map +1 -0
  55. package/dist/cjs/internal/AtomicFileSystemTransport.js +197 -0
  56. package/dist/cjs/internal/AtomicFileSystemTransport.js.map +7 -0
  57. package/dist/cjs/internal/AtomicHelperError.d.ts +35 -0
  58. package/dist/cjs/internal/AtomicHelperError.d.ts.map +1 -0
  59. package/dist/cjs/internal/AtomicHelperError.js +45 -0
  60. package/dist/cjs/internal/AtomicHelperError.js.map +7 -0
  61. package/dist/cjs/internal/AtomicHelperFault.d.ts +59 -0
  62. package/dist/cjs/internal/AtomicHelperFault.d.ts.map +1 -0
  63. package/dist/cjs/internal/AtomicHelperFault.js +66 -0
  64. package/dist/cjs/internal/AtomicHelperFault.js.map +7 -0
  65. package/dist/cjs/internal/PipedProcess.d.ts +35 -0
  66. package/dist/cjs/internal/PipedProcess.d.ts.map +1 -0
  67. package/dist/cjs/internal/PipedProcess.js +309 -0
  68. package/dist/cjs/internal/PipedProcess.js.map +7 -0
  69. package/dist/cjs/internal/ProcSnapshot.d.ts +85 -0
  70. package/dist/cjs/internal/ProcSnapshot.d.ts.map +1 -0
  71. package/dist/cjs/internal/ProcSnapshot.js +123 -0
  72. package/dist/cjs/internal/ProcSnapshot.js.map +7 -0
  73. package/dist/cjs/internal/ProcessCleanup.d.ts +64 -0
  74. package/dist/cjs/internal/ProcessCleanup.d.ts.map +1 -0
  75. package/dist/cjs/internal/ProcessCleanup.js +62 -0
  76. package/dist/cjs/internal/ProcessCleanup.js.map +7 -0
  77. package/dist/cjs/internal/ProcessCleanupPolicyError.d.ts +30 -0
  78. package/dist/cjs/internal/ProcessCleanupPolicyError.d.ts.map +1 -0
  79. package/dist/cjs/internal/ProcessCleanupPolicyError.js +33 -0
  80. package/dist/cjs/internal/ProcessCleanupPolicyError.js.map +7 -0
  81. package/dist/cjs/internal/ProcessFault.d.ts +63 -0
  82. package/dist/cjs/internal/ProcessFault.d.ts.map +1 -0
  83. package/dist/cjs/internal/ProcessFault.js +63 -0
  84. package/dist/cjs/internal/ProcessFault.js.map +7 -0
  85. package/dist/cjs/internal/ProcessSupervisor.d.ts +143 -0
  86. package/dist/cjs/internal/ProcessSupervisor.d.ts.map +1 -0
  87. package/dist/cjs/internal/ProcessSupervisor.js +685 -0
  88. package/dist/cjs/internal/ProcessSupervisor.js.map +7 -0
  89. package/dist/cjs/internal/SupervisorProgram.d.ts +9 -0
  90. package/dist/cjs/internal/SupervisorProgram.d.ts.map +1 -0
  91. package/dist/cjs/internal/SupervisorProgram.js +326 -0
  92. package/dist/cjs/internal/SupervisorProgram.js.map +7 -0
  93. package/dist/cjs/internal/WindowsProcessJob.d.ts +39 -0
  94. package/dist/cjs/internal/WindowsProcessJob.d.ts.map +1 -0
  95. package/dist/cjs/internal/WindowsProcessJob.js +113 -0
  96. package/dist/cjs/internal/WindowsProcessJob.js.map +7 -0
  97. package/dist/cjs/package.json +1 -0
  98. package/dist/esm/AtomicFileSystem.d.ts +147 -0
  99. package/dist/esm/AtomicFileSystem.d.ts.map +1 -0
  100. package/dist/esm/AtomicFileSystem.js +290 -0
  101. package/dist/esm/AtomicFileSystem.js.map +1 -0
  102. package/dist/esm/EgressHttpClient.d.ts +106 -0
  103. package/dist/esm/EgressHttpClient.d.ts.map +1 -0
  104. package/dist/esm/EgressHttpClient.js +259 -0
  105. package/dist/esm/EgressHttpClient.js.map +1 -0
  106. package/dist/esm/HostLiveness.d.ts +81 -0
  107. package/dist/esm/HostLiveness.d.ts.map +1 -0
  108. package/dist/esm/HostLiveness.js +68 -0
  109. package/dist/esm/HostLiveness.js.map +1 -0
  110. package/dist/esm/NodeHost.d.ts +145 -0
  111. package/dist/esm/NodeHost.d.ts.map +1 -0
  112. package/dist/esm/NodeHost.js +162 -0
  113. package/dist/esm/NodeHost.js.map +1 -0
  114. package/dist/esm/ProcessConfinement.d.ts +61 -0
  115. package/dist/esm/ProcessConfinement.d.ts.map +1 -0
  116. package/dist/esm/ProcessConfinement.js +311 -0
  117. package/dist/esm/ProcessConfinement.js.map +1 -0
  118. package/dist/esm/ProcessReaper.d.ts +457 -0
  119. package/dist/esm/ProcessReaper.d.ts.map +1 -0
  120. package/dist/esm/ProcessReaper.js +711 -0
  121. package/dist/esm/ProcessReaper.js.map +1 -0
  122. package/dist/esm/ProcessSandbox.d.ts +391 -0
  123. package/dist/esm/ProcessSandbox.d.ts.map +1 -0
  124. package/dist/esm/ProcessSandbox.js +1043 -0
  125. package/dist/esm/ProcessSandbox.js.map +1 -0
  126. package/dist/esm/ScopedProcess.d.ts +66 -0
  127. package/dist/esm/ScopedProcess.d.ts.map +1 -0
  128. package/dist/esm/ScopedProcess.js +67 -0
  129. package/dist/esm/ScopedProcess.js.map +1 -0
  130. package/dist/esm/index.d.ts +38 -0
  131. package/dist/esm/index.d.ts.map +1 -0
  132. package/dist/esm/index.js +38 -0
  133. package/dist/esm/index.js.map +1 -0
  134. package/dist/esm/internal/AtomicFileSystemExecutable.d.ts +61 -0
  135. package/dist/esm/internal/AtomicFileSystemExecutable.d.ts.map +1 -0
  136. package/dist/esm/internal/AtomicFileSystemExecutable.js +350 -0
  137. package/dist/esm/internal/AtomicFileSystemExecutable.js.map +1 -0
  138. package/dist/esm/internal/AtomicFileSystemProtocol.d.ts +78 -0
  139. package/dist/esm/internal/AtomicFileSystemProtocol.d.ts.map +1 -0
  140. package/dist/esm/internal/AtomicFileSystemProtocol.js +412 -0
  141. package/dist/esm/internal/AtomicFileSystemProtocol.js.map +1 -0
  142. package/dist/esm/internal/AtomicFileSystemTransport.d.ts +44 -0
  143. package/dist/esm/internal/AtomicFileSystemTransport.d.ts.map +1 -0
  144. package/dist/esm/internal/AtomicFileSystemTransport.js +242 -0
  145. package/dist/esm/internal/AtomicFileSystemTransport.js.map +1 -0
  146. package/dist/esm/internal/AtomicHelperError.d.ts +35 -0
  147. package/dist/esm/internal/AtomicHelperError.d.ts.map +1 -0
  148. package/dist/esm/internal/AtomicHelperError.js +39 -0
  149. package/dist/esm/internal/AtomicHelperError.js.map +1 -0
  150. package/dist/esm/internal/AtomicHelperFault.d.ts +59 -0
  151. package/dist/esm/internal/AtomicHelperFault.d.ts.map +1 -0
  152. package/dist/esm/internal/AtomicHelperFault.js +66 -0
  153. package/dist/esm/internal/AtomicHelperFault.js.map +1 -0
  154. package/dist/esm/internal/PipedProcess.d.ts +35 -0
  155. package/dist/esm/internal/PipedProcess.d.ts.map +1 -0
  156. package/dist/esm/internal/PipedProcess.js +321 -0
  157. package/dist/esm/internal/PipedProcess.js.map +1 -0
  158. package/dist/esm/internal/ProcSnapshot.d.ts +85 -0
  159. package/dist/esm/internal/ProcSnapshot.d.ts.map +1 -0
  160. package/dist/esm/internal/ProcSnapshot.js +188 -0
  161. package/dist/esm/internal/ProcSnapshot.js.map +1 -0
  162. package/dist/esm/internal/ProcessCleanup.d.ts +64 -0
  163. package/dist/esm/internal/ProcessCleanup.d.ts.map +1 -0
  164. package/dist/esm/internal/ProcessCleanup.js +45 -0
  165. package/dist/esm/internal/ProcessCleanup.js.map +1 -0
  166. package/dist/esm/internal/ProcessCleanupPolicyError.d.ts +30 -0
  167. package/dist/esm/internal/ProcessCleanupPolicyError.d.ts.map +1 -0
  168. package/dist/esm/internal/ProcessCleanupPolicyError.js +25 -0
  169. package/dist/esm/internal/ProcessCleanupPolicyError.js.map +1 -0
  170. package/dist/esm/internal/ProcessFault.d.ts +63 -0
  171. package/dist/esm/internal/ProcessFault.d.ts.map +1 -0
  172. package/dist/esm/internal/ProcessFault.js +64 -0
  173. package/dist/esm/internal/ProcessFault.js.map +1 -0
  174. package/dist/esm/internal/ProcessSupervisor.d.ts +143 -0
  175. package/dist/esm/internal/ProcessSupervisor.d.ts.map +1 -0
  176. package/dist/esm/internal/ProcessSupervisor.js +689 -0
  177. package/dist/esm/internal/ProcessSupervisor.js.map +1 -0
  178. package/dist/esm/internal/SupervisorProgram.d.ts +9 -0
  179. package/dist/esm/internal/SupervisorProgram.d.ts.map +1 -0
  180. package/dist/esm/internal/SupervisorProgram.js +310 -0
  181. package/dist/esm/internal/SupervisorProgram.js.map +1 -0
  182. package/dist/esm/internal/WindowsProcessJob.d.ts +39 -0
  183. package/dist/esm/internal/WindowsProcessJob.d.ts.map +1 -0
  184. package/dist/esm/internal/WindowsProcessJob.js +115 -0
  185. package/dist/esm/internal/WindowsProcessJob.js.map +1 -0
  186. package/dist/vendor/adapters.json +1757 -0
  187. package/dist/vendor/chunk-2Y7WC4KU.js +109 -0
  188. package/dist/vendor/chunk-3GR5VZ2M.js +118 -0
  189. package/dist/vendor/chunk-42QKY6T6.js +40 -0
  190. package/dist/vendor/chunk-54RLBMTZ.js +61 -0
  191. package/dist/vendor/chunk-5ZMHBXIK.js +55 -0
  192. package/dist/vendor/chunk-6ME2W7TF.js +28 -0
  193. package/dist/vendor/chunk-AMQKOQNT.js +34 -0
  194. package/dist/vendor/chunk-B3FZ67QU.js +59 -0
  195. package/dist/vendor/chunk-BKTBUBQY.js +437 -0
  196. package/dist/vendor/chunk-DS7GF46S.js +34 -0
  197. package/dist/vendor/chunk-DVOAHXPG.js +104 -0
  198. package/dist/vendor/chunk-DWSHTSVX.js +229 -0
  199. package/dist/vendor/chunk-EGBNVEEW.js +14 -0
  200. package/dist/vendor/chunk-EZWY45HP.js +18 -0
  201. package/dist/vendor/chunk-FNZOJHSV.js +71 -0
  202. package/dist/vendor/chunk-GXCHI7BM.js +131 -0
  203. package/dist/vendor/chunk-IIJ52ZU6.js +20 -0
  204. package/dist/vendor/chunk-J7A4CZDO.js +92 -0
  205. package/dist/vendor/chunk-JG5TTWPT.js +85 -0
  206. package/dist/vendor/chunk-JJ24ARBQ.js +394 -0
  207. package/dist/vendor/chunk-KOZMM5PZ.js +426 -0
  208. package/dist/vendor/chunk-KUUXSID7.js +18 -0
  209. package/dist/vendor/chunk-LEUPYT3Q.js +36 -0
  210. package/dist/vendor/chunk-M32LDTW7.js +18 -0
  211. package/dist/vendor/chunk-M7CLUILA.js +0 -0
  212. package/dist/vendor/chunk-MBSKBQ5D.js +21 -0
  213. package/dist/vendor/chunk-MLKGABMK.js +9 -0
  214. package/dist/vendor/chunk-NBVRTDTV.js +129 -0
  215. package/dist/vendor/chunk-OXNGN5H7.js +81 -0
  216. package/dist/vendor/chunk-QPLDT6A6.js +564 -0
  217. package/dist/vendor/chunk-QYBKAIA6.js +18 -0
  218. package/dist/vendor/chunk-RO2R4MJH.js +62 -0
  219. package/dist/vendor/chunk-SIR62W3Y.js +398 -0
  220. package/dist/vendor/chunk-TFIKFFSC.js +26 -0
  221. package/dist/vendor/chunk-TXKLEBBL.js +143 -0
  222. package/dist/vendor/chunk-UFH5UUZK.js +48 -0
  223. package/dist/vendor/chunk-VANKHF46.js +96 -0
  224. package/dist/vendor/chunk-VZBDV3TV.js +18 -0
  225. package/dist/vendor/chunk-XDKNKFBW.js +22 -0
  226. package/dist/vendor/chunk-XH4U3JSV.js +249 -0
  227. package/dist/vendor/chunk-Y35ZAO5U.js +53 -0
  228. package/dist/vendor/chunk-ZJMRMY57.js +0 -0
  229. package/dist/vendor/cjs/node/NodeChildProcessSpawner.d.ts +7 -0
  230. package/dist/vendor/cjs/node/NodeChildProcessSpawner.js +1 -0
  231. package/dist/vendor/cjs/node/NodeClusterHttp.d.ts +63 -0
  232. package/dist/vendor/cjs/node/NodeClusterHttp.js +1 -0
  233. package/dist/vendor/cjs/node/NodeClusterSocket.d.ts +79 -0
  234. package/dist/vendor/cjs/node/NodeClusterSocket.js +1 -0
  235. package/dist/vendor/cjs/node/NodeCrypto.d.ts +10 -0
  236. package/dist/vendor/cjs/node/NodeCrypto.js +1 -0
  237. package/dist/vendor/cjs/node/NodeFileSystem.d.ts +10 -0
  238. package/dist/vendor/cjs/node/NodeFileSystem.js +1 -0
  239. package/dist/vendor/cjs/node/NodeHttpClient.d.ts +179 -0
  240. package/dist/vendor/cjs/node/NodeHttpClient.js +1 -0
  241. package/dist/vendor/cjs/node/NodeHttpIncomingMessage.d.ts +62 -0
  242. package/dist/vendor/cjs/node/NodeHttpIncomingMessage.js +1 -0
  243. package/dist/vendor/cjs/node/NodeHttpPlatform.d.ts +36 -0
  244. package/dist/vendor/cjs/node/NodeHttpPlatform.js +1 -0
  245. package/dist/vendor/cjs/node/NodeHttpServer.d.ts +120 -0
  246. package/dist/vendor/cjs/node/NodeHttpServer.js +1 -0
  247. package/dist/vendor/cjs/node/NodeHttpServerRequest.d.ts +29 -0
  248. package/dist/vendor/cjs/node/NodeHttpServerRequest.js +1 -0
  249. package/dist/vendor/cjs/node/NodeMultipart.d.ts +46 -0
  250. package/dist/vendor/cjs/node/NodeMultipart.js +1 -0
  251. package/dist/vendor/cjs/node/NodeMultipartParser.d.ts +97 -0
  252. package/dist/vendor/cjs/node/NodeMultipartParser.js +1 -0
  253. package/dist/vendor/cjs/node/NodePath.d.ts +27 -0
  254. package/dist/vendor/cjs/node/NodePath.js +1 -0
  255. package/dist/vendor/cjs/node/NodeRedis.d.ts +74 -0
  256. package/dist/vendor/cjs/node/NodeRedis.js +1 -0
  257. package/dist/vendor/cjs/node/NodeRuntime.d.ts +85 -0
  258. package/dist/vendor/cjs/node/NodeRuntime.js +1 -0
  259. package/dist/vendor/cjs/node/NodeServices.d.ts +34 -0
  260. package/dist/vendor/cjs/node/NodeServices.js +1 -0
  261. package/dist/vendor/cjs/node/NodeSink.d.ts +8 -0
  262. package/dist/vendor/cjs/node/NodeSink.js +1 -0
  263. package/dist/vendor/cjs/node/NodeSocket.d.ts +38 -0
  264. package/dist/vendor/cjs/node/NodeSocket.js +1 -0
  265. package/dist/vendor/cjs/node/NodeSocketServer.d.ts +8 -0
  266. package/dist/vendor/cjs/node/NodeSocketServer.js +1 -0
  267. package/dist/vendor/cjs/node/NodeStdio.d.ts +11 -0
  268. package/dist/vendor/cjs/node/NodeStdio.js +1 -0
  269. package/dist/vendor/cjs/node/NodeStream.d.ts +8 -0
  270. package/dist/vendor/cjs/node/NodeStream.js +1 -0
  271. package/dist/vendor/cjs/node/NodeTerminal.d.ts +21 -0
  272. package/dist/vendor/cjs/node/NodeTerminal.js +1 -0
  273. package/dist/vendor/cjs/node/NodeWorker.d.ts +22 -0
  274. package/dist/vendor/cjs/node/NodeWorker.js +1 -0
  275. package/dist/vendor/cjs/node/NodeWorkerRunner.d.ts +12 -0
  276. package/dist/vendor/cjs/node/NodeWorkerRunner.js +1 -0
  277. package/dist/vendor/cjs/node/Undici.d.ts +28 -0
  278. package/dist/vendor/cjs/node/Undici.js +1 -0
  279. package/dist/vendor/cjs/node/index.d.ts +100 -0
  280. package/dist/vendor/cjs/node/index.js +1 -0
  281. package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.d.ts +57 -0
  282. package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.js +1 -0
  283. package/dist/vendor/cjs/node-shared/NodeClusterSocket.d.ts +22 -0
  284. package/dist/vendor/cjs/node-shared/NodeClusterSocket.js +1 -0
  285. package/dist/vendor/cjs/node-shared/NodeCrypto.d.ts +27 -0
  286. package/dist/vendor/cjs/node-shared/NodeCrypto.js +1 -0
  287. package/dist/vendor/cjs/node-shared/NodeFileSystem.d.ts +11 -0
  288. package/dist/vendor/cjs/node-shared/NodeFileSystem.js +1 -0
  289. package/dist/vendor/cjs/node-shared/NodeHttpCompression.d.ts +36 -0
  290. package/dist/vendor/cjs/node-shared/NodeHttpCompression.js +1 -0
  291. package/dist/vendor/cjs/node-shared/NodePath.d.ts +27 -0
  292. package/dist/vendor/cjs/node-shared/NodePath.js +1 -0
  293. package/dist/vendor/cjs/node-shared/NodeRuntime.d.ts +47 -0
  294. package/dist/vendor/cjs/node-shared/NodeRuntime.js +1 -0
  295. package/dist/vendor/cjs/node-shared/NodeSink.d.ts +69 -0
  296. package/dist/vendor/cjs/node-shared/NodeSink.js +1 -0
  297. package/dist/vendor/cjs/node-shared/NodeSocket.d.ts +134 -0
  298. package/dist/vendor/cjs/node-shared/NodeSocket.js +1 -0
  299. package/dist/vendor/cjs/node-shared/NodeSocketServer.d.ts +80 -0
  300. package/dist/vendor/cjs/node-shared/NodeSocketServer.js +1 -0
  301. package/dist/vendor/cjs/node-shared/NodeStdio.d.ts +12 -0
  302. package/dist/vendor/cjs/node-shared/NodeStdio.js +1 -0
  303. package/dist/vendor/cjs/node-shared/NodeStream.d.ts +179 -0
  304. package/dist/vendor/cjs/node-shared/NodeStream.js +1 -0
  305. package/dist/vendor/cjs/node-shared/NodeTerminal.d.ts +22 -0
  306. package/dist/vendor/cjs/node-shared/NodeTerminal.js +1 -0
  307. package/dist/vendor/cjs/node-shared/index.d.ts +56 -0
  308. package/dist/vendor/cjs/node-shared/index.js +1 -0
  309. package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
  310. package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.js +1 -0
  311. package/dist/vendor/cjs/node-shared/internal/utils.d.ts +2 -0
  312. package/dist/vendor/cjs/node-shared/internal/utils.js +1 -0
  313. package/dist/vendor/cjs/package.json +1 -0
  314. package/dist/vendor/cjs/platform-node-shared.d.ts +56 -0
  315. package/dist/vendor/cjs/platform-node-shared.js +1 -0
  316. package/dist/vendor/cjs/platform-node.d.ts +100 -0
  317. package/dist/vendor/cjs/platform-node.js +1 -0
  318. package/dist/vendor/node/LICENSE +21 -0
  319. package/dist/vendor/node/NodeChildProcessSpawner.d.ts +7 -0
  320. package/dist/vendor/node/NodeChildProcessSpawner.js +14 -0
  321. package/dist/vendor/node/NodeClusterHttp.d.ts +63 -0
  322. package/dist/vendor/node/NodeClusterHttp.js +43 -0
  323. package/dist/vendor/node/NodeClusterSocket.d.ts +79 -0
  324. package/dist/vendor/node/NodeClusterSocket.js +30 -0
  325. package/dist/vendor/node/NodeCrypto.d.ts +10 -0
  326. package/dist/vendor/node/NodeCrypto.js +8 -0
  327. package/dist/vendor/node/NodeFileSystem.d.ts +10 -0
  328. package/dist/vendor/node/NodeFileSystem.js +9 -0
  329. package/dist/vendor/node/NodeHttpClient.d.ts +179 -0
  330. package/dist/vendor/node/NodeHttpClient.js +46 -0
  331. package/dist/vendor/node/NodeHttpIncomingMessage.d.ts +62 -0
  332. package/dist/vendor/node/NodeHttpIncomingMessage.js +10 -0
  333. package/dist/vendor/node/NodeHttpPlatform.d.ts +36 -0
  334. package/dist/vendor/node/NodeHttpPlatform.js +16 -0
  335. package/dist/vendor/node/NodeHttpServer.d.ts +120 -0
  336. package/dist/vendor/node/NodeHttpServer.js +46 -0
  337. package/dist/vendor/node/NodeHttpServerRequest.d.ts +29 -0
  338. package/dist/vendor/node/NodeHttpServerRequest.js +9 -0
  339. package/dist/vendor/node/NodeMultipart.d.ts +46 -0
  340. package/dist/vendor/node/NodeMultipart.js +15 -0
  341. package/dist/vendor/node/NodeMultipartParser.d.ts +97 -0
  342. package/dist/vendor/node/NodeMultipartParser.js +11 -0
  343. package/dist/vendor/node/NodePath.d.ts +27 -0
  344. package/dist/vendor/node/NodePath.js +12 -0
  345. package/dist/vendor/node/NodeRedis.d.ts +74 -0
  346. package/dist/vendor/node/NodeRedis.js +11 -0
  347. package/dist/vendor/node/NodeRuntime.d.ts +85 -0
  348. package/dist/vendor/node/NodeRuntime.js +8 -0
  349. package/dist/vendor/node/NodeServices.d.ts +34 -0
  350. package/dist/vendor/node/NodeServices.js +23 -0
  351. package/dist/vendor/node/NodeSink.d.ts +8 -0
  352. package/dist/vendor/node/NodeSink.js +12 -0
  353. package/dist/vendor/node/NodeSocket.d.ts +38 -0
  354. package/dist/vendor/node/NodeSocket.js +31 -0
  355. package/dist/vendor/node/NodeSocketServer.d.ts +8 -0
  356. package/dist/vendor/node/NodeSocketServer.js +21 -0
  357. package/dist/vendor/node/NodeStdio.d.ts +11 -0
  358. package/dist/vendor/node/NodeStdio.js +10 -0
  359. package/dist/vendor/node/NodeStream.d.ts +8 -0
  360. package/dist/vendor/node/NodeStream.js +27 -0
  361. package/dist/vendor/node/NodeTerminal.d.ts +21 -0
  362. package/dist/vendor/node/NodeTerminal.js +10 -0
  363. package/dist/vendor/node/NodeWorker.d.ts +22 -0
  364. package/dist/vendor/node/NodeWorker.js +9 -0
  365. package/dist/vendor/node/NodeWorkerRunner.d.ts +12 -0
  366. package/dist/vendor/node/NodeWorkerRunner.js +7 -0
  367. package/dist/vendor/node/Undici.d.ts +28 -0
  368. package/dist/vendor/node/Undici.js +9 -0
  369. package/dist/vendor/node/index.d.ts +100 -0
  370. package/dist/vendor/node/index.js +115 -0
  371. package/dist/vendor/node-shared/LICENSE +21 -0
  372. package/dist/vendor/node-shared/NodeChildProcessSpawner.d.ts +57 -0
  373. package/dist/vendor/node-shared/NodeChildProcessSpawner.js +13 -0
  374. package/dist/vendor/node-shared/NodeClusterSocket.d.ts +22 -0
  375. package/dist/vendor/node-shared/NodeClusterSocket.js +11 -0
  376. package/dist/vendor/node-shared/NodeCrypto.d.ts +27 -0
  377. package/dist/vendor/node-shared/NodeCrypto.js +9 -0
  378. package/dist/vendor/node-shared/NodeFileSystem.d.ts +11 -0
  379. package/dist/vendor/node-shared/NodeFileSystem.js +8 -0
  380. package/dist/vendor/node-shared/NodeHttpCompression.d.ts +36 -0
  381. package/dist/vendor/node-shared/NodeHttpCompression.js +13 -0
  382. package/dist/vendor/node-shared/NodePath.d.ts +27 -0
  383. package/dist/vendor/node-shared/NodePath.js +11 -0
  384. package/dist/vendor/node-shared/NodeRuntime.d.ts +47 -0
  385. package/dist/vendor/node-shared/NodeRuntime.js +7 -0
  386. package/dist/vendor/node-shared/NodeSink.d.ts +69 -0
  387. package/dist/vendor/node-shared/NodeSink.js +11 -0
  388. package/dist/vendor/node-shared/NodeSocket.d.ts +134 -0
  389. package/dist/vendor/node-shared/NodeSocket.js +23 -0
  390. package/dist/vendor/node-shared/NodeSocketServer.d.ts +80 -0
  391. package/dist/vendor/node-shared/NodeSocketServer.js +20 -0
  392. package/dist/vendor/node-shared/NodeStdio.d.ts +12 -0
  393. package/dist/vendor/node-shared/NodeStdio.js +9 -0
  394. package/dist/vendor/node-shared/NodeStream.d.ts +179 -0
  395. package/dist/vendor/node-shared/NodeStream.js +26 -0
  396. package/dist/vendor/node-shared/NodeTerminal.d.ts +22 -0
  397. package/dist/vendor/node-shared/NodeTerminal.js +9 -0
  398. package/dist/vendor/node-shared/index.d.ts +56 -0
  399. package/dist/vendor/node-shared/index.js +58 -0
  400. package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
  401. package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.js +7 -0
  402. package/dist/vendor/node-shared/internal/utils.d.ts +2 -0
  403. package/dist/vendor/node-shared/internal/utils.js +7 -0
  404. package/dist/vendor/platform-node-shared.d.ts +56 -0
  405. package/dist/vendor/platform-node-shared.js +58 -0
  406. package/dist/vendor/platform-node.d.ts +100 -0
  407. package/dist/vendor/platform-node.js +115 -0
  408. package/docs/README.md +129 -0
  409. package/docs/api.md +553 -0
  410. package/docs/concepts/descriptor-relative-filesystem.md +181 -0
  411. package/docs/concepts/host-bundle.md +125 -0
  412. package/docs/concepts/process-containment.md +190 -0
  413. package/docs/guides/answer-run-ownership.md +87 -0
  414. package/docs/guides/configure-the-filesystem-helper.md +152 -0
  415. package/docs/guides/contain-child-processes.md +139 -0
  416. package/docs/guides/match-files-with-glob.md +151 -0
  417. package/docs/installation.md +204 -0
  418. package/docs/quickstart.md +147 -0
  419. package/docs/troubleshooting.md +130 -0
  420. package/package.json +202 -3
  421. package/src/AtomicFileSystem.ts +415 -0
  422. package/src/EgressHttpClient.ts +327 -0
  423. package/src/HostLiveness.ts +103 -0
  424. package/src/NodeHost.ts +253 -0
  425. package/src/ProcessConfinement.ts +363 -0
  426. package/src/ProcessReaper.ts +951 -0
  427. package/src/ProcessSandbox.ts +1307 -0
  428. package/src/ScopedProcess.ts +124 -0
  429. package/src/index.ts +44 -0
  430. package/src/internal/AtomicFileSystemExecutable.ts +379 -0
  431. package/src/internal/AtomicFileSystemProtocol.ts +502 -0
  432. package/src/internal/AtomicFileSystemTransport.ts +272 -0
  433. package/src/internal/AtomicHelperError.ts +50 -0
  434. package/src/internal/AtomicHelperFault.ts +84 -0
  435. package/src/internal/PipedProcess.ts +357 -0
  436. package/src/internal/ProcSnapshot.ts +193 -0
  437. package/src/internal/ProcessCleanup.ts +99 -0
  438. package/src/internal/ProcessCleanupPolicyError.ts +30 -0
  439. package/src/internal/ProcessFault.ts +82 -0
  440. package/src/internal/ProcessSupervisor.ts +807 -0
  441. package/src/internal/SupervisorProgram.ts +309 -0
  442. package/src/internal/WindowsProcessJob.ts +114 -0
@@ -0,0 +1,152 @@
1
+ ---
2
+ title: "Configure the filesystem helper"
3
+ description: "Point AtomicFileSystem at a smithers-jj-export helper and set the byte ceilings, process ceiling, and timeout that bound what one filesystem call may cost."
4
+ ---
5
+
6
+ Use this when the host keeps the `smithers-jj-export` helper somewhere the
7
+ adapter does not look, or when the default ceilings do not fit the workload.
8
+ `AtomicFileSystem.layerWith` takes all of it in one options object.
9
+
10
+ ```ts
11
+ import * as AtomicFileSystem from "@smthrs/platform-node/AtomicFileSystem"
12
+
13
+ const filesystem = AtomicFileSystem.layerWith({
14
+ executable: "/opt/smithers/bin/smithers-jj-export",
15
+ concurrency: 4,
16
+ timeoutMs: 60_000,
17
+ limits: { content: 4 * 1024 * 1024 }
18
+ })
19
+ ```
20
+
21
+ `layerWith` returns a `Layer<FileSystem.FileSystem>` with no requirements, the
22
+ same shape as `AtomicFileSystem.layer`. Substitute it wherever the bundle would
23
+ have used the default.
24
+
25
+ ## Choose the helper
26
+
27
+ The adapter runs `smithers-jj-export --atomic-fs` and uses the first of:
28
+
29
+ 1. `executable` from `layerWith`.
30
+ 2. `SMITHERS_WORKSPACE_JJ_EXPORT_BINARY`.
31
+ 3. The package's `bin/<platform>-<arch>/smithers-jj-export`.
32
+ 4. In a source checkout, `target/release/smithers-jj-export`, then
33
+ `target/debug/smithers-jj-export`.
34
+ 5. `/usr/local/bin/smithers-jj-export`.
35
+
36
+ Build it in a source checkout:
37
+
38
+ ```sh
39
+ cargo build --locked --release -p smithers-ffi --bin smithers-jj-export
40
+ ```
41
+
42
+ Or name an installed helper:
43
+
44
+ ```sh
45
+ export SMITHERS_WORKSPACE_JJ_EXPORT_BINARY=/opt/smithers/bin/smithers-jj-export
46
+ ```
47
+
48
+ A configured path must be absolute. The adapter never searches `PATH` or the
49
+ working directory.
50
+
51
+ The executable is re-validated on every request, as an absolute, executable
52
+ regular file outside the confined workspace. The file a path names can be
53
+ replaced while a host runs, so a check made only at construction would describe
54
+ a file that is no longer there. A host with no helper builds cleanly and then
55
+ fails every guarded filesystem call with `PermissionDenied`.
56
+
57
+ The packaged helper and the source-checkout builds (steps 3 and 4) are copied
58
+ to a private `0700` directory when the first layer in the process is built,
59
+ before any flow runs. Later layer builds copy nothing, because a flow of an
60
+ earlier run may already have written those paths. Requests execute that copy,
61
+ so a flow that rewrites one of those files later changes nothing that runs. A
62
+ default helper not present at that first build is refused with
63
+ `PermissionDenied` when its path, or the file the path links to, lies inside the
64
+ confined workspace: its bytes, or the choice of binary, could only have come
65
+ from a flow.
66
+
67
+ ## Set the byte ceilings
68
+
69
+ `limits` accepts a partial `Limits`; the fields you omit keep their defaults.
70
+
71
+ | Field | Default | What it bounds |
72
+ | ------------ | ------- | ---------------------------------------------------------------------------------------- |
73
+ | `content` | 16 MiB | the bytes one `readFile` or `writeFile` may carry |
74
+ | `request` | 24 MiB | the framed request, refused before a helper is even started |
75
+ | `response` | 24 MiB | the framed response, which is what a directory listing is charged against as it is built |
76
+ | `stderr` | 64 KiB | the diagnostic text retained from a failing helper |
77
+ | `batchEntry` | 24 MiB | one batch member's encoded result envelope, in UTF-8 JSON bytes |
78
+ | `batchSize` | 128 | the number of operations in one batch; inclusive, maximum 128 |
79
+
80
+ `request` and `response` are larger than `content` because base64 expands
81
+ 16 MiB to 22369624 bytes, which has to fit.
82
+
83
+ A binary `writeFile` over the `content` ceiling never reaches the helper.
84
+ The kernel checks the advertised limit before encoding anything and fails
85
+ with a typed `BadArgument`; the helper's own ceiling is the backstop.
86
+
87
+ `request` and `response` count UTF-8 JSON payload bytes; each frame also has a
88
+ separately bounded header. A batch shares those same ceilings. `content`
89
+ continues to apply separately to every file, including digest-only reads, so
90
+ hashing in the helper does not bypass the existing read quota. `batchEntry`
91
+ includes the member's success or failure envelope. If even a failure cannot fit,
92
+ the whole call refuses. Aggregate response exhaustion likewise refuses the
93
+ call instead of returning an incomplete result list.
94
+
95
+ Every one of these is a contract rather than a tuning knob: without them a
96
+ large file, a large directory tree, or a malfunctioning helper makes the host
97
+ allocate until it dies. Raising one raises what a single call can cost the
98
+ host.
99
+
100
+ Lowering `response` has one consequence worth knowing. It bounds the rejection
101
+ envelope too, so a ceiling small enough to cut one off degrades that
102
+ operation's typed reason to the fail-closed one, and you lose the specific
103
+ errno.
104
+
105
+ ## Set the process and time ceilings
106
+
107
+ The two ceilings that decide whether the host survives a wide fan-out are not
108
+ byte ceilings.
109
+
110
+ | Field | Default | What it bounds |
111
+ | ------------- | --------------------------- | ----------------------------------------------- |
112
+ | `concurrency` | `os.availableParallelism()` | how many helpers may run at once |
113
+ | `timeoutMs` | 300000 | how long one helper may run before it is killed |
114
+
115
+ Each ordinary call or bounded batch starts one helper, and three under the
116
+ kernel's guarded filesystem, which resolves the path before and after its grant
117
+ decision. Without a process ceiling,
118
+ an `Effect.forEach(files, read, { concurrency: "unbounded" })` over fifty paths
119
+ would start fifty helpers at once. The same permit covers request JSON
120
+ serialization and framing, so queued calls retain their input rather than an
121
+ additional encoded request buffer. Invalid settings and batch counts are
122
+ rejected before admission; serialized request sizes are checked after admission
123
+ and before starting the helper.
124
+
125
+ `timeoutMs` is a backstop, not a latency budget. A read at the content ceiling
126
+ over a slow disk has to fit under it, so five minutes is generous; what it
127
+ bounds is a helper that will never answer at all. A helper that passes the
128
+ deadline is killed and the operation fails closed.
129
+
130
+ ## Ceilings are read once
131
+
132
+ Every field except `executable` is read once, when the layer value is
133
+ constructed. `Options` is a plain object the caller still holds, and a byte
134
+ ceiling that changes under a running host is not a ceiling.
135
+
136
+ The reading happens outside the layer body, so two compositions of the same
137
+ layer value enforce the same ceilings and share one process semaphore. Building
138
+ the layer twice does not double the concurrency budget.
139
+
140
+ ## Check the defaults from code
141
+
142
+ The defaults are exported, so a program that reports its own configuration does
143
+ not have to restate them:
144
+
145
+ ```ts
146
+ import * as AtomicFileSystem from "@smthrs/platform-node/AtomicFileSystem"
147
+
148
+ AtomicFileSystem.defaultExecutable // "/usr/local/bin/smithers-jj-export"
149
+ AtomicFileSystem.defaultLimits // { content, request, response, stderr, batchSize, batchEntry }
150
+ AtomicFileSystem.defaultConcurrency // os.availableParallelism()
151
+ AtomicFileSystem.defaultTimeoutMs // 300000
152
+ ```
@@ -0,0 +1,139 @@
1
+ ---
2
+ title: "Contain child processes"
3
+ description: "Compose NodeHost.layerContained with a process ledger so every spawned process gets a kill deadline and a durable record, and a crashed host's orphans are reaped at the next boot."
4
+ ---
5
+
6
+ Use this when a host spawns long-running children and must not leave them
7
+ behind if it dies. Under `NodeHost.layer` a child is signalled when its scope
8
+ closes and then waited for, forever if it ignores `SIGTERM`, and a host killed
9
+ outright abandons everything it started.
10
+
11
+ ## Choose a ledger
12
+
13
+ `NodeHost.layerContained` requires a `ProcessLedger` and does not default one,
14
+ because the durable half of containment is only as good as the journal
15
+ underneath it. The choice belongs to the program that knows which it has.
16
+
17
+ | Ledger | Inherits a crashed incarnation's processes | Requires |
18
+ | --------------------------- | ------------------------------------------ | --------- |
19
+ | `ProcessLedger.layer` | yes | `Journal` |
20
+ | `ProcessLedger.layerMemory` | no | nothing |
21
+
22
+ `layerMemory` still supplies the live supervisor lifecycle and kill deadline.
23
+ It simply inherits nothing, so the sweep always finds an empty orphan set.
24
+
25
+ Both take the same options: `hostId`, the durable identity two incarnations
26
+ share, and `ownerPid`, the process id of this one.
27
+
28
+ ## Compose the host
29
+
30
+ ```ts
31
+ import * as ProcessLedger from "@smthrs/kernel/ProcessLedger"
32
+ import { NodeHost } from "@smthrs/platform-node"
33
+ import * as Layer from "effect/Layer"
34
+
35
+ const host = NodeHost.layerContained({ graceMs: 2000 }).pipe(
36
+ Layer.provide(ProcessLedger.layerMemory({ hostId: "engine-1", ownerPid: process.pid }))
37
+ )
38
+ ```
39
+
40
+ `host` is a `Layer<NodeHost, JjError>`: the same five services `NodeHost.layer` hands
41
+ out, spawning through the contained spawner. Swap `layerMemory` for
42
+ `ProcessLedger.layer` to get the durable ledger, and provide a `Journal` from
43
+ [`@smthrs/journal`](/api/journal) underneath it.
44
+
45
+ To pin the repository root as well, use `layerContainedAt`:
46
+
47
+ ```ts
48
+ const rooted = NodeHost.layerContainedAt("/absolute/repository", { graceMs: 2000 }).pipe(
49
+ Layer.provide(ProcessLedger.layerMemory({ hostId: "engine-1", ownerPid: process.pid }))
50
+ )
51
+ ```
52
+
53
+ ## What building the layer does
54
+
55
+ Two things happen while the layer is built, in this order:
56
+
57
+ 1. `ProcessReaper.reap` sweeps the records a previous incarnation of the same
58
+ `hostId` left behind, killing the process groups it is willing to signal.
59
+ 2. The contained services are handed to everything downstream.
60
+
61
+ So standing a host up is also what cleans up after the incarnation that
62
+ crashed. `jj` runs through that same spawner, so a `jj` invocation a crashed
63
+ host left running is a ledger record like any other.
64
+
65
+ Every spawn prepares a supervisor, commits its identity, and then activates
66
+ the target. Each pipeline leg is recorded. On POSIX the handle's `pid` names
67
+ the owner while `exitCode` describes the target. A natural target exit also
68
+ cleans up its owned group; use the handle's `kill`, never an external signal
69
+ to its numeric pid. Failed or unverified cleanup fails close and retains the
70
+ record.
71
+
72
+ A smaller host composition can use `ProcessReaper.layerSpawner` with a ledger
73
+ and an underlying runtime spawner. This factory includes the native adapter
74
+ whose pipe listeners remain alive through cancellation. Custom platform
75
+ authors can pass a lifecycle to `ContainedSpawner.layer` directly. Compose
76
+ the permission decorator above containment so it checks the original command
77
+ before preparation.
78
+
79
+ ## Set the options
80
+
81
+ `NodeHost.ContainedOptions` has three fields, all optional:
82
+
83
+ | Field | Default | What it does |
84
+ | ---------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
85
+ | `graceMs` | 2000 | most milliseconds between the `SIGTERM` that asks a child to stop and the `SIGKILL` that makes it; an emptied group ends sooner |
86
+ | `ownerPid` | `process.pid` | the pid the sweep must never signal, nor signal the group of |
87
+ | `system` | selected from `process.platform` | the operating-system seam the sweep asks its questions through |
88
+
89
+ A command that already names its own `killSignal` or `forceKillAfter` keeps
90
+ them: a caller who set one thought about it.
91
+
92
+ `ContainedSpawner.Options.platform` is deliberately not among these. The
93
+ platform factory reads the real `process.platform`, so process-group behavior
94
+ and the recorded identity agree. A caller cannot describe a Windows record
95
+ for an owner that actually leads a POSIX group.
96
+
97
+ ## Read what the sweep decided
98
+
99
+ `layerContained` runs the sweep and discards its report. To log the decisions,
100
+ call `ProcessReaper.reap` yourself:
101
+
102
+ ```ts
103
+ import * as ProcessLedger from "@smthrs/kernel/ProcessLedger"
104
+ import * as ProcessReaper from "@smthrs/platform-node/ProcessReaper"
105
+ import * as Effect from "effect/Effect"
106
+
107
+ const sweep = Effect.gen(function*() {
108
+ const decided = yield* ProcessReaper.reap()
109
+ for (const entry of decided) {
110
+ yield* Effect.log(
111
+ entry.killed
112
+ ? `killed ${entry.record.pid}`
113
+ : `kept ${entry.record.pid}: ${entry.refusal}`
114
+ )
115
+ }
116
+ }).pipe(Effect.provide(ProcessLedger.layerMemory({ hostId: "engine-1", ownerPid: process.pid })))
117
+ ```
118
+
119
+ Each entry carries the record, whether it was killed, and, when it was not, the
120
+ `Refusal` that says why. `Reaped` is a union discriminated by `killed`, so the
121
+ check in the branch above is what makes `entry.refusal` readable. Four refusals leave the record for a later
122
+ incarnation to try again: `owner-alive`, `identity-unverified`,
123
+ `own-group-unknown`, and `kill-failed`. The rest are final. See
124
+ [Process containment](../concepts/process-containment.md) for what each one
125
+ means and why the split falls where it does.
126
+
127
+ ## Verify it
128
+
129
+ Use a UUID-marked fixture that installs its signal handler before reporting
130
+ readiness. Check both cancellation and natural target exit, including a child
131
+ that inherits stdout, and require a stopped heartbeat plus an exited process
132
+ identity. A target exit code alone is insufficient evidence.
133
+
134
+ For host-loss behavior, kill only the fixture host and verify the private
135
+ supervisor stops its owned group without requiring a new host. A subsequent
136
+ host with the same `hostId` and durable journal reconciles retained records.
137
+ Read any refusal instead of treating a skipped signal as a successful reap.
138
+ The [process containment](../concepts/process-containment.md) page describes
139
+ `detached: false`, deliberately escaped sessions, and unsupported hosts.
@@ -0,0 +1,151 @@
1
+ ---
2
+ title: "Match files with a glob pattern"
3
+ description: "The glob grammar AtomicFileSystem implements, how exclusions prune the walk, the patterns it refuses outright, and the three answers where it deliberately differs from Node's globber."
4
+ ---
5
+
6
+ Use this when a program needs to select files under the workspace. `glob` is
7
+ one of the fifteen operations the atomic adapter implements, so it costs one
8
+ helper process for the whole tree rather than one per entry.
9
+
10
+ ```ts
11
+ import * as Effect from "effect/Effect"
12
+ import * as FileSystem from "effect/FileSystem"
13
+
14
+ const sources = Effect.gen(function*() {
15
+ const fs = yield* FileSystem.FileSystem
16
+ return yield* fs.glob("**/*.ts", {
17
+ root: "/absolute/workspace",
18
+ exclude: ["**/node_modules/**", "**/*.test.ts"]
19
+ })
20
+ })
21
+ ```
22
+
23
+ The helper cannot call Node's globber, so it implements the grammar itself.
24
+ That has three consequences you need to know: what the grammar supports, what
25
+ it refuses, and where it deliberately answers differently.
26
+
27
+ ## The grammar
28
+
29
+ | Construct | Meaning |
30
+ | -------------- | ----------------------------------------------- |
31
+ | `*` | any run of characters within one segment |
32
+ | `?` | any one character within one segment |
33
+ | `[abc]` | a character class, with `!` or `^` for negation |
34
+ | `**` | zero or more whole segments |
35
+ | `{a,b}` | alternation |
36
+ | a trailing `/` | directory-only matching |
37
+
38
+ The dotfile rule keeps a wildcard out of a name beginning with `.`, while a
39
+ segment that spells the dot matches one: `*` misses `.git`, and `.*` or `[.]*`
40
+ finds it.
41
+
42
+ A one-member class is the literal it spells, so `[.]` is a `.` path segment.
43
+ The globber drops a spelled `.` before it parses and collapses `[.]` only
44
+ afterwards, so this one survives, and as the last segment it names its own
45
+ anchor. A `**` immediately before it addresses nothing, so `**/[.]` names
46
+ nothing while `**/deep/[.]` names the directory. Anywhere but last, and in an
47
+ exclusion, a `.` segment names an entry no directory holds.
48
+
49
+ A trailing `**` spans zero segments, so it also names its own anchor: a
50
+ directory always, and a non-directory only when every segment before it is
51
+ literal. `top.txt/**` names the file; `t*.txt/**` names nothing. Adjacent `**`
52
+ segments act as one: `deep/**/**` includes `deep`, `.hidden/**/**` includes
53
+ `.hidden`, and `**/**/**` includes the root. Repeating `**` still excludes
54
+ hidden descendants unless another segment explicitly names their leading dot.
55
+
56
+ Matching is segment-wise and linear in the candidate's length, never a compiled
57
+ regular expression, because a pattern of repeated `*x` fragments costs a regex
58
+ engine exponential backtracking.
59
+
60
+ ## Exclusions prune the walk
61
+
62
+ An exclusion is not a filter applied to the results. Excluding a directory
63
+ excludes everything below it, and nothing under an excluded directory is
64
+ listed, counted against the 100000-entry ceiling, or charged against the
65
+ response ceiling. An exclusion that names the root stops the walk before it
66
+ begins.
67
+
68
+ An absolute exclude is rewritten against the glob root, so it applies to the
69
+ same names the selecting pattern does.
70
+
71
+ The selecting pattern prunes the same walk. A directory is entered only when a
72
+ remaining pattern segment, or an open `**`, can still name something below it,
73
+ so `src/index.ts` or `*.ts` never reads the subtrees beside its match, and a
74
+ name the pattern does not select is never charged against the response
75
+ ceiling. Names in a directory the walk does read still count against the
76
+ 100000-entry ceiling, because reading them was work. Literal segments are found
77
+ by reading their parent rather than by a direct lookup: matching is
78
+ case-sensitive on every host, and a lookup on a case-insensitive filesystem
79
+ would answer for a name the pattern did not spell.
80
+
81
+ ## Patterns the adapter refuses
82
+
83
+ Five inputs fail as a typed `BadArgument` before filesystem walking. The byte
84
+ limit is checked before brace expansion, which stops at its alternative limit.
85
+ Each expanded alternative is checked for unsupported syntax before compilation,
86
+ so refused patterns cost no directory listing:
87
+
88
+ | Input | Why |
89
+ | ------------------------------------------------- | --------------------------------- |
90
+ | a pattern longer than 4096 UTF-8 bytes | a bound on what one call may cost |
91
+ | braces expanding past 64 alternatives | brace expansion is multiplicative |
92
+ | extglob, such as `+(a\|b)` | not implemented |
93
+ | `[:` inside an open class, such as `[a[:digit:]]` | not implemented |
94
+ | brace bodies containing `..`, including `{1..3}` | not implemented |
95
+
96
+ The last three checks conservatively refuse unsupported syntax, including
97
+ unrecognized class names and non-range brace sets containing `..`. Treating an
98
+ unsupported construct as literal text could make an exclusion return the paths
99
+ it was meant to remove. The refusal covers the
100
+ exclude list as well as the pattern, and it reads a character class as a class,
101
+ so `[!(]*` is an ordinary negated class and not an extglob.
102
+
103
+ Backslashes follow Node's POSIX rules: an absolute selector and every exclude
104
+ drop them while leaving following wildcard magic active, and a relative
105
+ selector containing one matches nothing.
106
+
107
+ ## Three answers pinned against Node
108
+
109
+ Every other row of the grammar is asserted against `@effect/platform-node`'s
110
+ own globber in a parity suite. Three answers are pinned instead, because the
111
+ native globber gives no single answer to copy.
112
+
113
+ **Case is always sensitive.** Node's globber passes
114
+ `nocase: isMacOS || isWindows` with `nocaseMagicOnly: true`. On a
115
+ case-insensitive host that means a magic segment folds case (`*.TXT` finds
116
+ `upper.txt`), a literal segment the matcher decides is compared exactly
117
+ (`**/MID.txt` misses `mid.txt`), and a literal segment Node addresses directly
118
+ comes back with the pattern's own spelling (`TOP.TXT` returns `TOP.TXT`) even
119
+ though the directory does not hold that spelling. This adapter returns only
120
+ names its walk found, and keeps one rule on every host. A pattern whose meaning
121
+ depends on which machine reads it is worse than one that means the same
122
+ everywhere, and worst of all in an exclusion.
123
+
124
+ **A globstar exclusion leaves the directory entry.** A trailing `**` in an
125
+ exclusion removes what is under a directory and leaves the directory entry
126
+ itself. Node's answer here depends on the shape of the selecting pattern:
127
+ `**/*` with `exclude: ["nested/**"]` keeps `nested`, and `**` with the same
128
+ exclusion drops it. This adapter gives one answer for every selector.
129
+ Consequently the directory-only `**/` names directories below its own anchor
130
+ but not that anchor: with `exclude: ["**/"]`, `**` keeps the root and its files
131
+ while pruning every directory. Node empties the answer instead.
132
+
133
+ **A dotted segment after a globstar matches dotfiles, but a globstar never
134
+ spans a hidden directory.** Node 22 matched nothing for `**/.hidden`; Node 24
135
+ and later match the dotfiles. This adapter matches the dotfiles on every
136
+ version. Node 24 and later also walk into a hidden directory when the segment
137
+ after `**` matches it, so with `.hidden/.secret` and `.hidden/.nested/.wanted`
138
+ present, `**/.*` returns `.hidden`, `.hidden/.secret`, `.hidden/.nested` and
139
+ `.hidden/.nested/.wanted`, and `**/.*/**` returns `.hidden` and
140
+ `.hidden/.nested`. This adapter returns `.hidden` alone for both, because only a
141
+ segment that names a hidden directory may enter it: `.hidden/.*` returns
142
+ `.hidden/.nested` and `.hidden/.secret`.
143
+
144
+ ## Keep the cost down
145
+
146
+ One `glob` is one fork, so prefer a single pattern with an `exclude` list to
147
+ several calls you merge yourself. Prune with exclusions rather than filtering
148
+ results: an excluded subtree is never walked at all, which is the difference
149
+ between a cheap call and one that reads a `node_modules` tree before discarding
150
+ it. A narrow selector is cheap on its own: `src/**/*.ts` enters `src` and
151
+ nothing beside it.
@@ -0,0 +1,204 @@
1
+ ---
2
+ title: "Installation"
3
+ description: "Install @smthrs/platform-node, the peers and host prerequisites it needs, its entry points, and the packages a real host composition adds."
4
+ sidebar:
5
+ order: 1
6
+ ---
7
+
8
+ ## Get the package
9
+
10
+ `@smthrs/platform-node` is not on npm at 1.0.0-rc.0. It ships as a member of
11
+ the [smithers repository](https://github.com/smithersai/smithers) workspace, so
12
+ using it today means working from a checkout:
13
+
14
+ ```bash
15
+ git clone https://github.com/smithersai/smithers.git
16
+ cd smithers
17
+ pnpm install
18
+ ```
19
+
20
+ Code that consumes it lives in that workspace too, either an existing package
21
+ or one you add, and depends on it with a workspace specifier:
22
+
23
+ ```json
24
+ {
25
+ "dependencies": {
26
+ "@smthrs/platform-node": "workspace:*"
27
+ }
28
+ }
29
+ ```
30
+
31
+ ## Peers
32
+
33
+ `@effect/platform-node`, `@effect/platform-node-shared`, and `effect` are peer
34
+ dependencies, so your project pins their versions rather than inheriting a
35
+ second copy. `@smthrs/platform-node` declares `4.0.0-rc.115` for all three:
36
+
37
+ ```bash
38
+ pnpm add @effect/platform-node@4.0.0-rc.115 @effect/platform-node-shared@4.0.0-rc.115 effect@4.0.0-rc.115
39
+ ```
40
+
41
+ The shared adapter peer keeps the Node implementation on the same Effect
42
+ release candidate. The upstream Node adapter uses a caret for that dependency,
43
+ which otherwise permits a later shared adapter with an incompatible Effect peer.
44
+ Package managers that install peers automatically resolve the exact version
45
+ from this package's manifest.
46
+
47
+ Its own runtime dependencies, [`@smthrs/jj`](/api/jj) and
48
+ [`@smthrs/kernel`](/api/kernel), resolve from the same workspace.
49
+
50
+ The package ships ESM, CommonJS, and TypeScript declarations.
51
+
52
+ ## Host requirements
53
+
54
+ | Requirement | Why it is needed |
55
+ | ------------------------------- | --------------------------------------------------------------------- |
56
+ | Node.js 26.4.0 or later | the minimum this package's `engines` field declares |
57
+ | a POSIX host | Windows has none of the primitives below and is unsupported |
58
+ | the `smithers-jj-export` helper | `AtomicFileSystem` runs every guarded filesystem operation through it |
59
+ | `jj` 0.39.0 or newer on `PATH` | required at construction by every complete `NodeHost` layer |
60
+
61
+ ### jj is checked at construction
62
+
63
+ Every complete host bundle, `NodeHost.layer`, `NodeHost.layerAt`,
64
+ `NodeHost.layerContained`, and `NodeHost.layerContainedAt`, builds a
65
+ version-checked `Jj` layer before providing its services. This requires jj
66
+ 0.39.0 or newer even when the program requests only the filesystem or process
67
+ spawner. Check the installed version with `jj --version`.
68
+
69
+ If the executable is missing, bundle construction fails with a typed `JjError`
70
+ whose code is `not_installed`. An older version fails with
71
+ `unsupported_version`. The version probe runs outside the host process ledger;
72
+ repository commands use the selected process runner.
73
+
74
+ ### The filesystem helper
75
+
76
+ From a source checkout, build it with:
77
+
78
+ ```sh
79
+ cargo build --locked --release -p smithers-ffi --bin smithers-jj-export
80
+ ```
81
+
82
+ The host finds `target/release/smithers-jj-export` automatically. Elsewhere,
83
+ set `SMITHERS_WORKSPACE_JJ_EXPORT_BINARY` to its absolute path.
84
+
85
+ `NodeHost.layer` builds cleanly on a host with no helper. The executable is
86
+ re-validated on every request rather than once at construction, because the
87
+ file a path names can be replaced while a host runs, and a check that happened
88
+ only at boot would be a check about a file that is no longer there.
89
+
90
+ The consequence is that on `node:22-slim`, `node:22-alpine`, or a distroless
91
+ image the layer builds, the run starts, and the first guarded filesystem call
92
+ inside a flow body fails with `PermissionDenied`. For the search order and
93
+ `layerWith`, see
94
+ [Configure the filesystem helper](./guides/configure-the-filesystem-helper.md).
95
+
96
+ ## Individual services without jj
97
+
98
+ Applications that do not need `Jj` can provide individual service layers.
99
+ This composition supplies the bundle's filesystem, path, process spawner, and
100
+ HTTP client without constructing a `Jj` layer:
101
+
102
+ ```ts
103
+ import { NodeHost } from "@smthrs/platform-node"
104
+ import * as Layer from "effect/Layer"
105
+ import * as Path from "effect/Path"
106
+
107
+ const platform = Layer.mergeAll(NodeHost.AtomicFileSystem.layer, Path.layer)
108
+ const spawner = NodeHost.NodeChildProcessSpawner.layer.pipe(Layer.provide(platform))
109
+ const http = NodeHost.EgressHttpClient.layer(process.env)
110
+ const hostWithoutJj = Layer.mergeAll(platform, spawner, http)
111
+ ```
112
+
113
+ `NodeHost.EgressHttpClient.layer(process.env)` is the HTTP client the complete
114
+ bundles above use. It routes through the proxy `HTTP_PROXY`, `HTTPS_PROXY` and
115
+ `NO_PROXY` name, and is the plain Undici pool when they name none.
116
+ `NodeHost.NodeHttpClient.layerUndici` is that plain pool on its own: it dials
117
+ every origin directly and ignores the proxy variables, so it bypasses an
118
+ egress proxy allowlist. Compose it only when direct egress is intended.
119
+
120
+ Provide `hostWithoutJj` to a program that needs these services, or provide only
121
+ the individual layer it needs. The spawner requires both filesystem and path
122
+ services, supplied by `platform` above. The filesystem still requires the
123
+ helper described above. This composition does not provide `Jj`
124
+ and cannot satisfy consumers that require the complete five-tag host.
125
+
126
+ ## Import forms
127
+
128
+ The root entry point re-exports three modules as namespaces:
129
+
130
+ ```ts
131
+ import { HostLiveness, NodeHost, ProcessReaper, ScopedProcess } from "@smthrs/platform-node"
132
+ ```
133
+
134
+ Each module is also importable from its own subpath, which is the form the
135
+ [API reference](./api.md) uses:
136
+
137
+ ```ts
138
+ import * as HostLiveness from "@smthrs/platform-node/HostLiveness"
139
+ import * as NodeHost from "@smthrs/platform-node/NodeHost"
140
+ import * as ProcessReaper from "@smthrs/platform-node/ProcessReaper"
141
+ ```
142
+
143
+ `AtomicFileSystem` is deliberately not in the barrel. Reach it through its own
144
+ subpath, or as a re-export off `NodeHost`:
145
+
146
+ ```ts
147
+ import * as AtomicFileSystem from "@smthrs/platform-node/AtomicFileSystem"
148
+ // or
149
+ import { NodeHost } from "@smthrs/platform-node"
150
+ const filesystem = NodeHost.AtomicFileSystem.layer
151
+ ```
152
+
153
+ Two subpath shapes are blocked in the export map:
154
+ `@smthrs/platform-node/internal/*` and `@smthrs/platform-node/*/index`.
155
+ `@smthrs/platform-node/package.json` is exported.
156
+
157
+ ## Entry points
158
+
159
+ | Import | Source |
160
+ | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
161
+ | `@smthrs/platform-node` | [src/index.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-node/src/index.ts) |
162
+ | `@smthrs/platform-node/NodeHost` | [src/NodeHost.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-node/src/NodeHost.ts) |
163
+ | `@smthrs/platform-node/AtomicFileSystem` | [src/AtomicFileSystem.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-node/src/AtomicFileSystem.ts) |
164
+ | `@smthrs/platform-node/HostLiveness` | [src/HostLiveness.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-node/src/HostLiveness.ts) |
165
+ | `@smthrs/platform-node/ProcessReaper` | [src/ProcessReaper.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-node/src/ProcessReaper.ts) |
166
+ | `@smthrs/platform-node/ScopedProcess` | [src/ScopedProcess.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-node/src/ScopedProcess.ts) |
167
+
168
+ Every entry point is Node-only by construction: the bundle resolves
169
+ `node:child_process` and its siblings, and a build check keeps it that way. For a
170
+ browser host, use [`@smthrs/platform-browser`](/api/platform-browser); for Bun,
171
+ [`@smthrs/platform-bun`](/api/platform-bun).
172
+
173
+ ## What a real composition adds
174
+
175
+ This package provides raw host services. A composition that enforces
176
+ capabilities wraps them in [`@smthrs/kernel`](/api/kernel)'s decorators, which
177
+ need a workspace root and a grant store. Add that package to your own
178
+ dependencies with the same workspace specifier, then compose:
179
+
180
+ ```ts
181
+ import * as GrantStore from "@smthrs/kernel/GrantStore"
182
+ import * as HostServices from "@smthrs/kernel/HostServices"
183
+ import * as Workspace from "@smthrs/kernel/Workspace"
184
+ import { NodeHost } from "@smthrs/platform-node"
185
+ import * as Layer from "effect/Layer"
186
+
187
+ const guarded = HostServices.layer.pipe(
188
+ Layer.provide(NodeHost.layer),
189
+ Layer.provide(Workspace.layer("/absolute/workspace")),
190
+ Layer.provide(GrantStore.layerNoop)
191
+ )
192
+ ```
193
+
194
+ `GrantStore.layerNoop` allows every operation inside the workspace. It is a
195
+ seam for tests and boot paths, not a production policy. Replace it with a
196
+ rule-based store before running untrusted work; see
197
+ [Write a capability policy](https://kernel.smithers.sh/guides/write-a-capability-policy/).
198
+
199
+ Turning on process containment adds a `ProcessLedger`, which the journal backs.
200
+ See [Contain child processes](./guides/contain-child-processes.md).
201
+
202
+ Most programs never compose this by hand. `@smthrs/flows`' `NodeRuntime` builds
203
+ the whole durable runtime, including `NodeHost.layerContainedAt` and
204
+ `HostLiveness.isAlive`, from one options object.