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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (442) hide show
  1. package/CHANGELOG.md +211 -0
  2. package/LICENSE +21 -0
  3. package/README.md +165 -2
  4. package/bin/darwin-arm64/smithers-jj-export +0 -0
  5. package/bin/darwin-x64/smithers-jj-export +0 -0
  6. package/bin/linux-arm64/smithers-jj-export +0 -0
  7. package/bin/linux-x64/smithers-jj-export +4 -0
  8. package/bin/win32-x64/smithers-jj-export.exe +0 -0
  9. package/dist/cjs/AtomicFileSystem.d.ts +147 -0
  10. package/dist/cjs/AtomicFileSystem.d.ts.map +1 -0
  11. package/dist/cjs/AtomicFileSystem.js +234 -0
  12. package/dist/cjs/AtomicFileSystem.js.map +7 -0
  13. package/dist/cjs/EgressHttpClient.d.ts +106 -0
  14. package/dist/cjs/EgressHttpClient.d.ts.map +1 -0
  15. package/dist/cjs/EgressHttpClient.js +202 -0
  16. package/dist/cjs/EgressHttpClient.js.map +7 -0
  17. package/dist/cjs/HostLiveness.d.ts +81 -0
  18. package/dist/cjs/HostLiveness.d.ts.map +1 -0
  19. package/dist/cjs/HostLiveness.js +49 -0
  20. package/dist/cjs/HostLiveness.js.map +7 -0
  21. package/dist/cjs/NodeHost.d.ts +145 -0
  22. package/dist/cjs/NodeHost.d.ts.map +1 -0
  23. package/dist/cjs/NodeHost.js +128 -0
  24. package/dist/cjs/NodeHost.js.map +7 -0
  25. package/dist/cjs/ProcessConfinement.d.ts +61 -0
  26. package/dist/cjs/ProcessConfinement.d.ts.map +1 -0
  27. package/dist/cjs/ProcessConfinement.js +292 -0
  28. package/dist/cjs/ProcessConfinement.js.map +7 -0
  29. package/dist/cjs/ProcessReaper.d.ts +457 -0
  30. package/dist/cjs/ProcessReaper.d.ts.map +1 -0
  31. package/dist/cjs/ProcessReaper.js +349 -0
  32. package/dist/cjs/ProcessReaper.js.map +7 -0
  33. package/dist/cjs/ProcessSandbox.d.ts +391 -0
  34. package/dist/cjs/ProcessSandbox.d.ts.map +1 -0
  35. package/dist/cjs/ProcessSandbox.js +774 -0
  36. package/dist/cjs/ProcessSandbox.js.map +7 -0
  37. package/dist/cjs/ScopedProcess.d.ts +66 -0
  38. package/dist/cjs/ScopedProcess.d.ts.map +1 -0
  39. package/dist/cjs/ScopedProcess.js +87 -0
  40. package/dist/cjs/ScopedProcess.js.map +7 -0
  41. package/dist/cjs/index.d.ts +38 -0
  42. package/dist/cjs/index.d.ts.map +1 -0
  43. package/dist/cjs/index.js +47 -0
  44. package/dist/cjs/index.js.map +7 -0
  45. package/dist/cjs/internal/AtomicFileSystemExecutable.d.ts +61 -0
  46. package/dist/cjs/internal/AtomicFileSystemExecutable.d.ts.map +1 -0
  47. package/dist/cjs/internal/AtomicFileSystemExecutable.js +250 -0
  48. package/dist/cjs/internal/AtomicFileSystemExecutable.js.map +7 -0
  49. package/dist/cjs/internal/AtomicFileSystemProtocol.d.ts +78 -0
  50. package/dist/cjs/internal/AtomicFileSystemProtocol.d.ts.map +1 -0
  51. package/dist/cjs/internal/AtomicFileSystemProtocol.js +382 -0
  52. package/dist/cjs/internal/AtomicFileSystemProtocol.js.map +7 -0
  53. package/dist/cjs/internal/AtomicFileSystemTransport.d.ts +44 -0
  54. package/dist/cjs/internal/AtomicFileSystemTransport.d.ts.map +1 -0
  55. package/dist/cjs/internal/AtomicFileSystemTransport.js +197 -0
  56. package/dist/cjs/internal/AtomicFileSystemTransport.js.map +7 -0
  57. package/dist/cjs/internal/AtomicHelperError.d.ts +35 -0
  58. package/dist/cjs/internal/AtomicHelperError.d.ts.map +1 -0
  59. package/dist/cjs/internal/AtomicHelperError.js +45 -0
  60. package/dist/cjs/internal/AtomicHelperError.js.map +7 -0
  61. package/dist/cjs/internal/AtomicHelperFault.d.ts +59 -0
  62. package/dist/cjs/internal/AtomicHelperFault.d.ts.map +1 -0
  63. package/dist/cjs/internal/AtomicHelperFault.js +66 -0
  64. package/dist/cjs/internal/AtomicHelperFault.js.map +7 -0
  65. package/dist/cjs/internal/PipedProcess.d.ts +35 -0
  66. package/dist/cjs/internal/PipedProcess.d.ts.map +1 -0
  67. package/dist/cjs/internal/PipedProcess.js +309 -0
  68. package/dist/cjs/internal/PipedProcess.js.map +7 -0
  69. package/dist/cjs/internal/ProcSnapshot.d.ts +85 -0
  70. package/dist/cjs/internal/ProcSnapshot.d.ts.map +1 -0
  71. package/dist/cjs/internal/ProcSnapshot.js +123 -0
  72. package/dist/cjs/internal/ProcSnapshot.js.map +7 -0
  73. package/dist/cjs/internal/ProcessCleanup.d.ts +64 -0
  74. package/dist/cjs/internal/ProcessCleanup.d.ts.map +1 -0
  75. package/dist/cjs/internal/ProcessCleanup.js +62 -0
  76. package/dist/cjs/internal/ProcessCleanup.js.map +7 -0
  77. package/dist/cjs/internal/ProcessCleanupPolicyError.d.ts +30 -0
  78. package/dist/cjs/internal/ProcessCleanupPolicyError.d.ts.map +1 -0
  79. package/dist/cjs/internal/ProcessCleanupPolicyError.js +33 -0
  80. package/dist/cjs/internal/ProcessCleanupPolicyError.js.map +7 -0
  81. package/dist/cjs/internal/ProcessFault.d.ts +63 -0
  82. package/dist/cjs/internal/ProcessFault.d.ts.map +1 -0
  83. package/dist/cjs/internal/ProcessFault.js +63 -0
  84. package/dist/cjs/internal/ProcessFault.js.map +7 -0
  85. package/dist/cjs/internal/ProcessSupervisor.d.ts +143 -0
  86. package/dist/cjs/internal/ProcessSupervisor.d.ts.map +1 -0
  87. package/dist/cjs/internal/ProcessSupervisor.js +685 -0
  88. package/dist/cjs/internal/ProcessSupervisor.js.map +7 -0
  89. package/dist/cjs/internal/SupervisorProgram.d.ts +9 -0
  90. package/dist/cjs/internal/SupervisorProgram.d.ts.map +1 -0
  91. package/dist/cjs/internal/SupervisorProgram.js +326 -0
  92. package/dist/cjs/internal/SupervisorProgram.js.map +7 -0
  93. package/dist/cjs/internal/WindowsProcessJob.d.ts +39 -0
  94. package/dist/cjs/internal/WindowsProcessJob.d.ts.map +1 -0
  95. package/dist/cjs/internal/WindowsProcessJob.js +113 -0
  96. package/dist/cjs/internal/WindowsProcessJob.js.map +7 -0
  97. package/dist/cjs/package.json +1 -0
  98. package/dist/esm/AtomicFileSystem.d.ts +147 -0
  99. package/dist/esm/AtomicFileSystem.d.ts.map +1 -0
  100. package/dist/esm/AtomicFileSystem.js +290 -0
  101. package/dist/esm/AtomicFileSystem.js.map +1 -0
  102. package/dist/esm/EgressHttpClient.d.ts +106 -0
  103. package/dist/esm/EgressHttpClient.d.ts.map +1 -0
  104. package/dist/esm/EgressHttpClient.js +259 -0
  105. package/dist/esm/EgressHttpClient.js.map +1 -0
  106. package/dist/esm/HostLiveness.d.ts +81 -0
  107. package/dist/esm/HostLiveness.d.ts.map +1 -0
  108. package/dist/esm/HostLiveness.js +68 -0
  109. package/dist/esm/HostLiveness.js.map +1 -0
  110. package/dist/esm/NodeHost.d.ts +145 -0
  111. package/dist/esm/NodeHost.d.ts.map +1 -0
  112. package/dist/esm/NodeHost.js +162 -0
  113. package/dist/esm/NodeHost.js.map +1 -0
  114. package/dist/esm/ProcessConfinement.d.ts +61 -0
  115. package/dist/esm/ProcessConfinement.d.ts.map +1 -0
  116. package/dist/esm/ProcessConfinement.js +311 -0
  117. package/dist/esm/ProcessConfinement.js.map +1 -0
  118. package/dist/esm/ProcessReaper.d.ts +457 -0
  119. package/dist/esm/ProcessReaper.d.ts.map +1 -0
  120. package/dist/esm/ProcessReaper.js +711 -0
  121. package/dist/esm/ProcessReaper.js.map +1 -0
  122. package/dist/esm/ProcessSandbox.d.ts +391 -0
  123. package/dist/esm/ProcessSandbox.d.ts.map +1 -0
  124. package/dist/esm/ProcessSandbox.js +1043 -0
  125. package/dist/esm/ProcessSandbox.js.map +1 -0
  126. package/dist/esm/ScopedProcess.d.ts +66 -0
  127. package/dist/esm/ScopedProcess.d.ts.map +1 -0
  128. package/dist/esm/ScopedProcess.js +67 -0
  129. package/dist/esm/ScopedProcess.js.map +1 -0
  130. package/dist/esm/index.d.ts +38 -0
  131. package/dist/esm/index.d.ts.map +1 -0
  132. package/dist/esm/index.js +38 -0
  133. package/dist/esm/index.js.map +1 -0
  134. package/dist/esm/internal/AtomicFileSystemExecutable.d.ts +61 -0
  135. package/dist/esm/internal/AtomicFileSystemExecutable.d.ts.map +1 -0
  136. package/dist/esm/internal/AtomicFileSystemExecutable.js +350 -0
  137. package/dist/esm/internal/AtomicFileSystemExecutable.js.map +1 -0
  138. package/dist/esm/internal/AtomicFileSystemProtocol.d.ts +78 -0
  139. package/dist/esm/internal/AtomicFileSystemProtocol.d.ts.map +1 -0
  140. package/dist/esm/internal/AtomicFileSystemProtocol.js +412 -0
  141. package/dist/esm/internal/AtomicFileSystemProtocol.js.map +1 -0
  142. package/dist/esm/internal/AtomicFileSystemTransport.d.ts +44 -0
  143. package/dist/esm/internal/AtomicFileSystemTransport.d.ts.map +1 -0
  144. package/dist/esm/internal/AtomicFileSystemTransport.js +242 -0
  145. package/dist/esm/internal/AtomicFileSystemTransport.js.map +1 -0
  146. package/dist/esm/internal/AtomicHelperError.d.ts +35 -0
  147. package/dist/esm/internal/AtomicHelperError.d.ts.map +1 -0
  148. package/dist/esm/internal/AtomicHelperError.js +39 -0
  149. package/dist/esm/internal/AtomicHelperError.js.map +1 -0
  150. package/dist/esm/internal/AtomicHelperFault.d.ts +59 -0
  151. package/dist/esm/internal/AtomicHelperFault.d.ts.map +1 -0
  152. package/dist/esm/internal/AtomicHelperFault.js +66 -0
  153. package/dist/esm/internal/AtomicHelperFault.js.map +1 -0
  154. package/dist/esm/internal/PipedProcess.d.ts +35 -0
  155. package/dist/esm/internal/PipedProcess.d.ts.map +1 -0
  156. package/dist/esm/internal/PipedProcess.js +321 -0
  157. package/dist/esm/internal/PipedProcess.js.map +1 -0
  158. package/dist/esm/internal/ProcSnapshot.d.ts +85 -0
  159. package/dist/esm/internal/ProcSnapshot.d.ts.map +1 -0
  160. package/dist/esm/internal/ProcSnapshot.js +188 -0
  161. package/dist/esm/internal/ProcSnapshot.js.map +1 -0
  162. package/dist/esm/internal/ProcessCleanup.d.ts +64 -0
  163. package/dist/esm/internal/ProcessCleanup.d.ts.map +1 -0
  164. package/dist/esm/internal/ProcessCleanup.js +45 -0
  165. package/dist/esm/internal/ProcessCleanup.js.map +1 -0
  166. package/dist/esm/internal/ProcessCleanupPolicyError.d.ts +30 -0
  167. package/dist/esm/internal/ProcessCleanupPolicyError.d.ts.map +1 -0
  168. package/dist/esm/internal/ProcessCleanupPolicyError.js +25 -0
  169. package/dist/esm/internal/ProcessCleanupPolicyError.js.map +1 -0
  170. package/dist/esm/internal/ProcessFault.d.ts +63 -0
  171. package/dist/esm/internal/ProcessFault.d.ts.map +1 -0
  172. package/dist/esm/internal/ProcessFault.js +64 -0
  173. package/dist/esm/internal/ProcessFault.js.map +1 -0
  174. package/dist/esm/internal/ProcessSupervisor.d.ts +143 -0
  175. package/dist/esm/internal/ProcessSupervisor.d.ts.map +1 -0
  176. package/dist/esm/internal/ProcessSupervisor.js +689 -0
  177. package/dist/esm/internal/ProcessSupervisor.js.map +1 -0
  178. package/dist/esm/internal/SupervisorProgram.d.ts +9 -0
  179. package/dist/esm/internal/SupervisorProgram.d.ts.map +1 -0
  180. package/dist/esm/internal/SupervisorProgram.js +310 -0
  181. package/dist/esm/internal/SupervisorProgram.js.map +1 -0
  182. package/dist/esm/internal/WindowsProcessJob.d.ts +39 -0
  183. package/dist/esm/internal/WindowsProcessJob.d.ts.map +1 -0
  184. package/dist/esm/internal/WindowsProcessJob.js +115 -0
  185. package/dist/esm/internal/WindowsProcessJob.js.map +1 -0
  186. package/dist/vendor/adapters.json +1757 -0
  187. package/dist/vendor/chunk-2Y7WC4KU.js +109 -0
  188. package/dist/vendor/chunk-3GR5VZ2M.js +118 -0
  189. package/dist/vendor/chunk-42QKY6T6.js +40 -0
  190. package/dist/vendor/chunk-54RLBMTZ.js +61 -0
  191. package/dist/vendor/chunk-5ZMHBXIK.js +55 -0
  192. package/dist/vendor/chunk-6ME2W7TF.js +28 -0
  193. package/dist/vendor/chunk-AMQKOQNT.js +34 -0
  194. package/dist/vendor/chunk-B3FZ67QU.js +59 -0
  195. package/dist/vendor/chunk-BKTBUBQY.js +437 -0
  196. package/dist/vendor/chunk-DS7GF46S.js +34 -0
  197. package/dist/vendor/chunk-DVOAHXPG.js +104 -0
  198. package/dist/vendor/chunk-DWSHTSVX.js +229 -0
  199. package/dist/vendor/chunk-EGBNVEEW.js +14 -0
  200. package/dist/vendor/chunk-EZWY45HP.js +18 -0
  201. package/dist/vendor/chunk-FNZOJHSV.js +71 -0
  202. package/dist/vendor/chunk-GXCHI7BM.js +131 -0
  203. package/dist/vendor/chunk-IIJ52ZU6.js +20 -0
  204. package/dist/vendor/chunk-J7A4CZDO.js +92 -0
  205. package/dist/vendor/chunk-JG5TTWPT.js +85 -0
  206. package/dist/vendor/chunk-JJ24ARBQ.js +394 -0
  207. package/dist/vendor/chunk-KOZMM5PZ.js +426 -0
  208. package/dist/vendor/chunk-KUUXSID7.js +18 -0
  209. package/dist/vendor/chunk-LEUPYT3Q.js +36 -0
  210. package/dist/vendor/chunk-M32LDTW7.js +18 -0
  211. package/dist/vendor/chunk-M7CLUILA.js +0 -0
  212. package/dist/vendor/chunk-MBSKBQ5D.js +21 -0
  213. package/dist/vendor/chunk-MLKGABMK.js +9 -0
  214. package/dist/vendor/chunk-NBVRTDTV.js +129 -0
  215. package/dist/vendor/chunk-OXNGN5H7.js +81 -0
  216. package/dist/vendor/chunk-QPLDT6A6.js +564 -0
  217. package/dist/vendor/chunk-QYBKAIA6.js +18 -0
  218. package/dist/vendor/chunk-RO2R4MJH.js +62 -0
  219. package/dist/vendor/chunk-SIR62W3Y.js +398 -0
  220. package/dist/vendor/chunk-TFIKFFSC.js +26 -0
  221. package/dist/vendor/chunk-TXKLEBBL.js +143 -0
  222. package/dist/vendor/chunk-UFH5UUZK.js +48 -0
  223. package/dist/vendor/chunk-VANKHF46.js +96 -0
  224. package/dist/vendor/chunk-VZBDV3TV.js +18 -0
  225. package/dist/vendor/chunk-XDKNKFBW.js +22 -0
  226. package/dist/vendor/chunk-XH4U3JSV.js +249 -0
  227. package/dist/vendor/chunk-Y35ZAO5U.js +53 -0
  228. package/dist/vendor/chunk-ZJMRMY57.js +0 -0
  229. package/dist/vendor/cjs/node/NodeChildProcessSpawner.d.ts +7 -0
  230. package/dist/vendor/cjs/node/NodeChildProcessSpawner.js +1 -0
  231. package/dist/vendor/cjs/node/NodeClusterHttp.d.ts +63 -0
  232. package/dist/vendor/cjs/node/NodeClusterHttp.js +1 -0
  233. package/dist/vendor/cjs/node/NodeClusterSocket.d.ts +79 -0
  234. package/dist/vendor/cjs/node/NodeClusterSocket.js +1 -0
  235. package/dist/vendor/cjs/node/NodeCrypto.d.ts +10 -0
  236. package/dist/vendor/cjs/node/NodeCrypto.js +1 -0
  237. package/dist/vendor/cjs/node/NodeFileSystem.d.ts +10 -0
  238. package/dist/vendor/cjs/node/NodeFileSystem.js +1 -0
  239. package/dist/vendor/cjs/node/NodeHttpClient.d.ts +179 -0
  240. package/dist/vendor/cjs/node/NodeHttpClient.js +1 -0
  241. package/dist/vendor/cjs/node/NodeHttpIncomingMessage.d.ts +62 -0
  242. package/dist/vendor/cjs/node/NodeHttpIncomingMessage.js +1 -0
  243. package/dist/vendor/cjs/node/NodeHttpPlatform.d.ts +36 -0
  244. package/dist/vendor/cjs/node/NodeHttpPlatform.js +1 -0
  245. package/dist/vendor/cjs/node/NodeHttpServer.d.ts +120 -0
  246. package/dist/vendor/cjs/node/NodeHttpServer.js +1 -0
  247. package/dist/vendor/cjs/node/NodeHttpServerRequest.d.ts +29 -0
  248. package/dist/vendor/cjs/node/NodeHttpServerRequest.js +1 -0
  249. package/dist/vendor/cjs/node/NodeMultipart.d.ts +46 -0
  250. package/dist/vendor/cjs/node/NodeMultipart.js +1 -0
  251. package/dist/vendor/cjs/node/NodeMultipartParser.d.ts +97 -0
  252. package/dist/vendor/cjs/node/NodeMultipartParser.js +1 -0
  253. package/dist/vendor/cjs/node/NodePath.d.ts +27 -0
  254. package/dist/vendor/cjs/node/NodePath.js +1 -0
  255. package/dist/vendor/cjs/node/NodeRedis.d.ts +74 -0
  256. package/dist/vendor/cjs/node/NodeRedis.js +1 -0
  257. package/dist/vendor/cjs/node/NodeRuntime.d.ts +85 -0
  258. package/dist/vendor/cjs/node/NodeRuntime.js +1 -0
  259. package/dist/vendor/cjs/node/NodeServices.d.ts +34 -0
  260. package/dist/vendor/cjs/node/NodeServices.js +1 -0
  261. package/dist/vendor/cjs/node/NodeSink.d.ts +8 -0
  262. package/dist/vendor/cjs/node/NodeSink.js +1 -0
  263. package/dist/vendor/cjs/node/NodeSocket.d.ts +38 -0
  264. package/dist/vendor/cjs/node/NodeSocket.js +1 -0
  265. package/dist/vendor/cjs/node/NodeSocketServer.d.ts +8 -0
  266. package/dist/vendor/cjs/node/NodeSocketServer.js +1 -0
  267. package/dist/vendor/cjs/node/NodeStdio.d.ts +11 -0
  268. package/dist/vendor/cjs/node/NodeStdio.js +1 -0
  269. package/dist/vendor/cjs/node/NodeStream.d.ts +8 -0
  270. package/dist/vendor/cjs/node/NodeStream.js +1 -0
  271. package/dist/vendor/cjs/node/NodeTerminal.d.ts +21 -0
  272. package/dist/vendor/cjs/node/NodeTerminal.js +1 -0
  273. package/dist/vendor/cjs/node/NodeWorker.d.ts +22 -0
  274. package/dist/vendor/cjs/node/NodeWorker.js +1 -0
  275. package/dist/vendor/cjs/node/NodeWorkerRunner.d.ts +12 -0
  276. package/dist/vendor/cjs/node/NodeWorkerRunner.js +1 -0
  277. package/dist/vendor/cjs/node/Undici.d.ts +28 -0
  278. package/dist/vendor/cjs/node/Undici.js +1 -0
  279. package/dist/vendor/cjs/node/index.d.ts +100 -0
  280. package/dist/vendor/cjs/node/index.js +1 -0
  281. package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.d.ts +57 -0
  282. package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.js +1 -0
  283. package/dist/vendor/cjs/node-shared/NodeClusterSocket.d.ts +22 -0
  284. package/dist/vendor/cjs/node-shared/NodeClusterSocket.js +1 -0
  285. package/dist/vendor/cjs/node-shared/NodeCrypto.d.ts +27 -0
  286. package/dist/vendor/cjs/node-shared/NodeCrypto.js +1 -0
  287. package/dist/vendor/cjs/node-shared/NodeFileSystem.d.ts +11 -0
  288. package/dist/vendor/cjs/node-shared/NodeFileSystem.js +1 -0
  289. package/dist/vendor/cjs/node-shared/NodeHttpCompression.d.ts +36 -0
  290. package/dist/vendor/cjs/node-shared/NodeHttpCompression.js +1 -0
  291. package/dist/vendor/cjs/node-shared/NodePath.d.ts +27 -0
  292. package/dist/vendor/cjs/node-shared/NodePath.js +1 -0
  293. package/dist/vendor/cjs/node-shared/NodeRuntime.d.ts +47 -0
  294. package/dist/vendor/cjs/node-shared/NodeRuntime.js +1 -0
  295. package/dist/vendor/cjs/node-shared/NodeSink.d.ts +69 -0
  296. package/dist/vendor/cjs/node-shared/NodeSink.js +1 -0
  297. package/dist/vendor/cjs/node-shared/NodeSocket.d.ts +134 -0
  298. package/dist/vendor/cjs/node-shared/NodeSocket.js +1 -0
  299. package/dist/vendor/cjs/node-shared/NodeSocketServer.d.ts +80 -0
  300. package/dist/vendor/cjs/node-shared/NodeSocketServer.js +1 -0
  301. package/dist/vendor/cjs/node-shared/NodeStdio.d.ts +12 -0
  302. package/dist/vendor/cjs/node-shared/NodeStdio.js +1 -0
  303. package/dist/vendor/cjs/node-shared/NodeStream.d.ts +179 -0
  304. package/dist/vendor/cjs/node-shared/NodeStream.js +1 -0
  305. package/dist/vendor/cjs/node-shared/NodeTerminal.d.ts +22 -0
  306. package/dist/vendor/cjs/node-shared/NodeTerminal.js +1 -0
  307. package/dist/vendor/cjs/node-shared/index.d.ts +56 -0
  308. package/dist/vendor/cjs/node-shared/index.js +1 -0
  309. package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
  310. package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.js +1 -0
  311. package/dist/vendor/cjs/node-shared/internal/utils.d.ts +2 -0
  312. package/dist/vendor/cjs/node-shared/internal/utils.js +1 -0
  313. package/dist/vendor/cjs/package.json +1 -0
  314. package/dist/vendor/cjs/platform-node-shared.d.ts +56 -0
  315. package/dist/vendor/cjs/platform-node-shared.js +1 -0
  316. package/dist/vendor/cjs/platform-node.d.ts +100 -0
  317. package/dist/vendor/cjs/platform-node.js +1 -0
  318. package/dist/vendor/node/LICENSE +21 -0
  319. package/dist/vendor/node/NodeChildProcessSpawner.d.ts +7 -0
  320. package/dist/vendor/node/NodeChildProcessSpawner.js +14 -0
  321. package/dist/vendor/node/NodeClusterHttp.d.ts +63 -0
  322. package/dist/vendor/node/NodeClusterHttp.js +43 -0
  323. package/dist/vendor/node/NodeClusterSocket.d.ts +79 -0
  324. package/dist/vendor/node/NodeClusterSocket.js +30 -0
  325. package/dist/vendor/node/NodeCrypto.d.ts +10 -0
  326. package/dist/vendor/node/NodeCrypto.js +8 -0
  327. package/dist/vendor/node/NodeFileSystem.d.ts +10 -0
  328. package/dist/vendor/node/NodeFileSystem.js +9 -0
  329. package/dist/vendor/node/NodeHttpClient.d.ts +179 -0
  330. package/dist/vendor/node/NodeHttpClient.js +46 -0
  331. package/dist/vendor/node/NodeHttpIncomingMessage.d.ts +62 -0
  332. package/dist/vendor/node/NodeHttpIncomingMessage.js +10 -0
  333. package/dist/vendor/node/NodeHttpPlatform.d.ts +36 -0
  334. package/dist/vendor/node/NodeHttpPlatform.js +16 -0
  335. package/dist/vendor/node/NodeHttpServer.d.ts +120 -0
  336. package/dist/vendor/node/NodeHttpServer.js +46 -0
  337. package/dist/vendor/node/NodeHttpServerRequest.d.ts +29 -0
  338. package/dist/vendor/node/NodeHttpServerRequest.js +9 -0
  339. package/dist/vendor/node/NodeMultipart.d.ts +46 -0
  340. package/dist/vendor/node/NodeMultipart.js +15 -0
  341. package/dist/vendor/node/NodeMultipartParser.d.ts +97 -0
  342. package/dist/vendor/node/NodeMultipartParser.js +11 -0
  343. package/dist/vendor/node/NodePath.d.ts +27 -0
  344. package/dist/vendor/node/NodePath.js +12 -0
  345. package/dist/vendor/node/NodeRedis.d.ts +74 -0
  346. package/dist/vendor/node/NodeRedis.js +11 -0
  347. package/dist/vendor/node/NodeRuntime.d.ts +85 -0
  348. package/dist/vendor/node/NodeRuntime.js +8 -0
  349. package/dist/vendor/node/NodeServices.d.ts +34 -0
  350. package/dist/vendor/node/NodeServices.js +23 -0
  351. package/dist/vendor/node/NodeSink.d.ts +8 -0
  352. package/dist/vendor/node/NodeSink.js +12 -0
  353. package/dist/vendor/node/NodeSocket.d.ts +38 -0
  354. package/dist/vendor/node/NodeSocket.js +31 -0
  355. package/dist/vendor/node/NodeSocketServer.d.ts +8 -0
  356. package/dist/vendor/node/NodeSocketServer.js +21 -0
  357. package/dist/vendor/node/NodeStdio.d.ts +11 -0
  358. package/dist/vendor/node/NodeStdio.js +10 -0
  359. package/dist/vendor/node/NodeStream.d.ts +8 -0
  360. package/dist/vendor/node/NodeStream.js +27 -0
  361. package/dist/vendor/node/NodeTerminal.d.ts +21 -0
  362. package/dist/vendor/node/NodeTerminal.js +10 -0
  363. package/dist/vendor/node/NodeWorker.d.ts +22 -0
  364. package/dist/vendor/node/NodeWorker.js +9 -0
  365. package/dist/vendor/node/NodeWorkerRunner.d.ts +12 -0
  366. package/dist/vendor/node/NodeWorkerRunner.js +7 -0
  367. package/dist/vendor/node/Undici.d.ts +28 -0
  368. package/dist/vendor/node/Undici.js +9 -0
  369. package/dist/vendor/node/index.d.ts +100 -0
  370. package/dist/vendor/node/index.js +115 -0
  371. package/dist/vendor/node-shared/LICENSE +21 -0
  372. package/dist/vendor/node-shared/NodeChildProcessSpawner.d.ts +57 -0
  373. package/dist/vendor/node-shared/NodeChildProcessSpawner.js +13 -0
  374. package/dist/vendor/node-shared/NodeClusterSocket.d.ts +22 -0
  375. package/dist/vendor/node-shared/NodeClusterSocket.js +11 -0
  376. package/dist/vendor/node-shared/NodeCrypto.d.ts +27 -0
  377. package/dist/vendor/node-shared/NodeCrypto.js +9 -0
  378. package/dist/vendor/node-shared/NodeFileSystem.d.ts +11 -0
  379. package/dist/vendor/node-shared/NodeFileSystem.js +8 -0
  380. package/dist/vendor/node-shared/NodeHttpCompression.d.ts +36 -0
  381. package/dist/vendor/node-shared/NodeHttpCompression.js +13 -0
  382. package/dist/vendor/node-shared/NodePath.d.ts +27 -0
  383. package/dist/vendor/node-shared/NodePath.js +11 -0
  384. package/dist/vendor/node-shared/NodeRuntime.d.ts +47 -0
  385. package/dist/vendor/node-shared/NodeRuntime.js +7 -0
  386. package/dist/vendor/node-shared/NodeSink.d.ts +69 -0
  387. package/dist/vendor/node-shared/NodeSink.js +11 -0
  388. package/dist/vendor/node-shared/NodeSocket.d.ts +134 -0
  389. package/dist/vendor/node-shared/NodeSocket.js +23 -0
  390. package/dist/vendor/node-shared/NodeSocketServer.d.ts +80 -0
  391. package/dist/vendor/node-shared/NodeSocketServer.js +20 -0
  392. package/dist/vendor/node-shared/NodeStdio.d.ts +12 -0
  393. package/dist/vendor/node-shared/NodeStdio.js +9 -0
  394. package/dist/vendor/node-shared/NodeStream.d.ts +179 -0
  395. package/dist/vendor/node-shared/NodeStream.js +26 -0
  396. package/dist/vendor/node-shared/NodeTerminal.d.ts +22 -0
  397. package/dist/vendor/node-shared/NodeTerminal.js +9 -0
  398. package/dist/vendor/node-shared/index.d.ts +56 -0
  399. package/dist/vendor/node-shared/index.js +58 -0
  400. package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
  401. package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.js +7 -0
  402. package/dist/vendor/node-shared/internal/utils.d.ts +2 -0
  403. package/dist/vendor/node-shared/internal/utils.js +7 -0
  404. package/dist/vendor/platform-node-shared.d.ts +56 -0
  405. package/dist/vendor/platform-node-shared.js +58 -0
  406. package/dist/vendor/platform-node.d.ts +100 -0
  407. package/dist/vendor/platform-node.js +115 -0
  408. package/docs/README.md +129 -0
  409. package/docs/api.md +553 -0
  410. package/docs/concepts/descriptor-relative-filesystem.md +181 -0
  411. package/docs/concepts/host-bundle.md +125 -0
  412. package/docs/concepts/process-containment.md +190 -0
  413. package/docs/guides/answer-run-ownership.md +87 -0
  414. package/docs/guides/configure-the-filesystem-helper.md +152 -0
  415. package/docs/guides/contain-child-processes.md +139 -0
  416. package/docs/guides/match-files-with-glob.md +151 -0
  417. package/docs/installation.md +204 -0
  418. package/docs/quickstart.md +147 -0
  419. package/docs/troubleshooting.md +130 -0
  420. package/package.json +202 -3
  421. package/src/AtomicFileSystem.ts +415 -0
  422. package/src/EgressHttpClient.ts +327 -0
  423. package/src/HostLiveness.ts +103 -0
  424. package/src/NodeHost.ts +253 -0
  425. package/src/ProcessConfinement.ts +363 -0
  426. package/src/ProcessReaper.ts +951 -0
  427. package/src/ProcessSandbox.ts +1307 -0
  428. package/src/ScopedProcess.ts +124 -0
  429. package/src/index.ts +44 -0
  430. package/src/internal/AtomicFileSystemExecutable.ts +379 -0
  431. package/src/internal/AtomicFileSystemProtocol.ts +502 -0
  432. package/src/internal/AtomicFileSystemTransport.ts +272 -0
  433. package/src/internal/AtomicHelperError.ts +50 -0
  434. package/src/internal/AtomicHelperFault.ts +84 -0
  435. package/src/internal/PipedProcess.ts +357 -0
  436. package/src/internal/ProcSnapshot.ts +193 -0
  437. package/src/internal/ProcessCleanup.ts +99 -0
  438. package/src/internal/ProcessCleanupPolicyError.ts +30 -0
  439. package/src/internal/ProcessFault.ts +82 -0
  440. package/src/internal/ProcessSupervisor.ts +807 -0
  441. package/src/internal/SupervisorProgram.ts +309 -0
  442. package/src/internal/WindowsProcessJob.ts +114 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,211 @@
1
+ # @smthrs/platform-node
2
+
3
+ ## [Unreleased]
4
+
5
+ ### Fixed
6
+
7
+ - Atomic glob preserves dot-class text inside an outer character class and
8
+ recognizes dot segments only when they occupy the whole path segment.
9
+
10
+ - Atomic glob refuses unsupported POSIX classes after literal character-class
11
+ members, including exclusions.
12
+
13
+ - Atomic glob character classes stay active when another path segment contains
14
+ a literal closing bracket. Globstar exclusions remove descendants even when
15
+ their names also match a later directory anchor, while retaining the original
16
+ anchor consistently across selectors and absolute or relative exclusions.
17
+ Unclosed brackets in an earlier segment no longer bypass unsupported-extglob
18
+ validation. A leading literal `]` inside a character class no longer causes
19
+ valid class members to be mistaken for unsupported extglob syntax.
20
+ - Atomic glob validates unsupported syntax separately in every expanded brace
21
+ alternative, so a literal bracket in one alternative cannot hide an extglob
22
+ exclusion in another.
23
+ - Atomic glob selection and exclusion require an explicit dot for each hidden
24
+ path segment. A pattern such as `.hidden/*` no longer matches `.hidden/.secret`,
25
+ and `**/.wanted` cannot traverse an unmentioned hidden directory. Wildcard
26
+ selectors also skip those directories before opening or listing them.
27
+ - Atomic glob patterns treat `/` as a path separator inside bracket expressions,
28
+ preserving literal bracket names. Absolute selectors and exclusions outside
29
+ the glob root no longer alias an in-root path sharing the root's name prefix.
30
+ - A `SMITHERS_WORKSPACE_JJ_EXPORT_BINARY` that names a missing or unusable
31
+ helper is refused with the variable's name and the same install hint as a
32
+ missing helper, instead of a bare `ENOENT`.
33
+ - `AtomicFileSystem.stat` now reports `birthtime` on Linux. CPython carries the
34
+ creation time on `os.stat_result` only on macOS and the BSDs, so the helper
35
+ answered `Option.none` on Linux while `@effect/platform-node` answered the
36
+ instant it read through `statx`. The helper now reads `statx` itself, through
37
+ the C library already mapped into the process, and still answers
38
+ `Option.none` on any host that has no creation time to give.
39
+
40
+ ## [1.0.0-rc.0] - 2026-09-01
41
+
42
+ ### Added
43
+
44
+ - Added `AtomicFileSystem`, the descriptor-relative filesystem `NodeHost` puts
45
+ in its filesystem slot. Every operation pins the workspace root, walks each
46
+ component with `O_NOFOLLOW`, and performs the final syscall relative to a
47
+ pinned parent descriptor, so a symlink swapped in after authorization cannot
48
+ redirect it. **It is a new host prerequisite**: a POSIX host with CPython 3 at
49
+ `/usr/bin/python3` whose `os` module supports `dir_fd` for `open`, `mkdir`,
50
+ `readlink`, `rename`, `rmdir`, `stat`, and `unlink`. The layer builds without
51
+ one and then fails every guarded filesystem call closed with
52
+ `PermissionDenied`; `AtomicFileSystem.layerWith({ executable })` points it at
53
+ an interpreter installed elsewhere. Windows is unsupported. `open`, `stream`,
54
+ `sink`, `watch`, `copy`, `copyFile`, `link`, `symlink`, `access`, `chmod`,
55
+ `chown`, `truncate`, `utimes`, and the `makeTemp*` family are refused under the
56
+ capability decorator rather than reverting to a path-based call.
57
+ - Added `ProcessReaper`, which kills the process groups a crashed incarnation of
58
+ the same host abandoned, and `HostLiveness`, which answers whether a recorded
59
+ run owner is still running on this host.
60
+ - Added `NodeHost.layerAt` and `NodeHost.layerContainedAt`, the two layers with
61
+ `Jj` bound to one absolute repository root rather than the process working
62
+ directory, and `NodeHost.layerContained`, which turns on process containment.
63
+ - Added `AtomicFileSystem.Options.concurrency` and
64
+ `AtomicFileSystem.Options.timeoutMs`, with `defaultConcurrency`
65
+ (`os.availableParallelism()`) and `defaultTimeoutMs` (300000). Each operation
66
+ is one CPython fork, so without a ceiling an unbounded fan-out started one
67
+ interpreter per entry; without a timeout a helper that never answered held the
68
+ fiber until the run itself was interrupted.
69
+ - Added `ProcessReaper.StartTime`, `ProcessReaper.SystemOptions`,
70
+ `ProcessReaper.posixSystemWith`, `ProcessReaper.defaultPsExecutable`, and
71
+ `System.refuseTarget`.
72
+ - Added `NodeHost.ContainedOptions`.
73
+
74
+ ### Changed
75
+
76
+ - Extracted the package from the dissolved `@smthrs/host`. `NodeHost` moved here
77
+ unchanged in behaviour; `NodeJj` had already moved to `@smthrs/jj` and is
78
+ composed from there.
79
+ - `AtomicFileSystem.stat` now reports the raw `st_mode`, file-type bits
80
+ included, matching `@effect/platform-node`. It previously masked the value
81
+ down to its permission bits, so `mode & S_IFMT` answered zero through the
82
+ atomic path and correctly through the raw one.
83
+ - Atomic system errors now carry `syscall`, which `@effect/platform-node` sets
84
+ on every system error it reports. It names the operation's own syscall,
85
+ narrowed where an operation has two (`remove` reports `unlink` or `rmdir`),
86
+ rather than whichever of that operation's calls raised.
87
+ - `AtomicFileSystem.glob` now implements the grammar rather than translating it
88
+ into a regular expression: brace alternation, trailing-slash directory-only
89
+ matching, `**` spanning zero segments, the dotfile rule, subtree-pruning
90
+ exclusions, and absolute excludes rewritten against the glob root all now
91
+ agree with `node:fs.glob`. Matching is linear in the candidate's length, so a
92
+ pattern of repeated `*x` fragments no longer costs exponential backtracking. A
93
+ pattern past 4096 characters or 64 brace alternatives is a `BadArgument`; a
94
+ character class that opens and never closes is literal text, and `[]]` is a
95
+ class holding one bracket rather than an error.
96
+ - `AtomicFileSystem.glob` now refuses the three constructs it does not implement,
97
+ in an exclude as well as in the pattern: extglob (`+(a|b)`), POSIX classes
98
+ (`[[:digit:]]`), and brace ranges (`{1..3}`) are a
99
+ `BadArgument`. They were read as ordinary characters, which does not fail, it
100
+ answers a different question: `exclude: ["+(private|secret)/**"]` excluded
101
+ nothing and the caller received every file under the directories it had just
102
+ forbidden.
103
+ - Backslashes now follow Node's POSIX glob behavior: absolute selectors and
104
+ every exclusion drop them while leaving following wildcard magic active;
105
+ relative selectors containing one return no matches.
106
+ - `AtomicFileSystem.glob` now enforces the 64-alternative brace bound before it
107
+ expands anything. The bound was checked as each expanded pattern was appended,
108
+ so a pattern of many brace groups exhausted the interpreter's recursion limit
109
+ before the first one existed: `"{,a}"` repeated 1024 times, which is exactly
110
+ the 4096-character pattern ceiling, answered `PermissionDenied` with
111
+ "descriptor-relative filesystem isolation failed closed: maximum recursion
112
+ depth exceeded" instead of the documented `BadArgument`. Caller input inside
113
+ the contract now reports as caller input.
114
+ - `AtomicFileSystem.glob` now applies an exclusion that names the glob ROOT
115
+ before it walks. The root is the one directory the walk never lists, so
116
+ nothing applied the rule to it: `exclude: ["."]`, `[""]`, and the absolute
117
+ root in either spelling dropped the root's own entry and then returned every
118
+ path below it, charging the entry and response ceilings for a tree the caller
119
+ had forbidden. All four now answer with nothing and walk nothing.
120
+ - `AtomicFileSystem.glob` now reads a one-member positive character class as the
121
+ literal it is, so `[.]` is a `.` path segment rather than a name no directory
122
+ holds. As the LAST segment it names whatever the segments before it addressed,
123
+ under the rule a trailing `**` already followed, with one addition: a `**`
124
+ immediately before it addresses nothing, so `**/[.]` names nothing while
125
+ `**/deep/[.]` names the directory. Anywhere else, and in an exclusion, it
126
+ names nothing.
127
+ - `AtomicFileSystem.glob` no longer names a non-directory anchor from a trailing
128
+ `**` reached through a wildcard. `*/**` returned every top-level FILE as well
129
+ as the directories, `t*.txt/**` returned `top.txt`, and `**/mid.txt/**`
130
+ returned `nested/mid.txt`, where `node:fs.glob` returns only directories,
131
+ nothing, and nothing. A trailing `**` names its anchor when the anchor is a
132
+ directory, or when every segment before it is literal, which is the shortcut
133
+ the native globber takes when it can address the path directly.
134
+ - `AtomicFileSystem.glob` now reads a character class as a class when it looks
135
+ for the extglob syntax it refuses. `[!(]*` is a negated class holding one
136
+ paren, and `node:fs.glob` answers it with real matches; it was refused as
137
+ `BadArgument` because the scan saw `!` followed by `(`.
138
+ - `AtomicFileSystem.glob` exclusions now prune the walk instead of filtering
139
+ its result. An excluded directory was listed in full first, so its names were
140
+ counted against the 100000-entry ceiling and charged against the response
141
+ ceiling: a glob whose answer was two paths could fail `BadResource` because of
142
+ a directory the caller had excluded.
143
+ - `AtomicFileSystem.glob` matching is case-sensitive on every host, and says so
144
+ in the documentation. `node:fs.glob` passes `nocase: isMacOS || isWindows`
145
+ with `nocaseMagicOnly: true`, so the same pattern means different things on
146
+ macOS and on Linux, and a magic segment means something different from a
147
+ literal one on macOS. One host-independent rule is pinned instead, alongside
148
+ the exclusion's trailing-`**` answer, which Node itself gives differently
149
+ depending on the selecting pattern's shape.
150
+ - `AtomicFileSystem.Options.timeoutMs` now refuses a value above 2147483647.
151
+ `setTimeout` clamps a longer delay to one millisecond, so asking for a longer
152
+ backstop produced no backstop at all: every operation failed instantly with
153
+ "atomic helper did not answer within 2147483648 ms".
154
+ - `ProcessReaper` now requires its own process group to be printed as decimal
155
+ digits and nothing else. `Number.parseInt` reads a PREFIX, so a `ps` answering
156
+ `"2147483646 x"` produced a number that is not this host's group: the
157
+ own-group comparison passed on a false identity, and because the answer was
158
+ not `null` the `own-group-unknown` refusal that reports an unmade comparison
159
+ never fired either, leaving a `SIGKILL` authorized by a guard that never ran.
160
+ - `AtomicFileSystem.remove(path, { force: true })` now succeeds for a path whose
161
+ ancestors do not exist, as `fs.rm` does. Recursive removal walks iteratively
162
+ with an explicit descriptor stack, bounded at 512 levels and 100000 entries,
163
+ counted as each directory is read, so a hostile wide directory is refused
164
+ rather than allocated whole.
165
+ - `AtomicFileSystem` reads every option except `executable` once, when the layer
166
+ is built, so a mutated options object cannot change a ceiling under a running
167
+ host. The concurrency ceiling is one semaphore per layer.
168
+ - `NodeHost.layerContained` and `layerContainedAt` no longer accept
169
+ `ContainedSpawner.Options.platform`. A caller-supplied `"win32"` used to win
170
+ the option spread on a POSIX host, recording `pgid: null` for a child that
171
+ really did lead a group; the reaper then refused that record as `no-group` and
172
+ the orphan outlived every incarnation.
173
+ - `ProcessReaper` refuses a record it cannot verify instead of signalling it. An
174
+ absent, unanswerable, or unparseable `ps` used to read as "no refusal" and a
175
+ recycled process group was `SIGKILL`ed on the strength of a record the host
176
+ could not check. `System.startedAtMs` now returns a tagged `StartTime`, the
177
+ probe runs from an absolute `/bin/ps` with `LC_ALL=C`, an empty-ish
178
+ environment, and a finite timeout, and the new `identity-unverified` refusal
179
+ keeps the record for an incarnation that can answer. A nonzero `ps` exit is
180
+ confirmed against the kernel before a record is retired as `process-gone`,
181
+ because it is also how a `ps` that rejected the column answers about a live
182
+ pid.
183
+ - `ProcessReaper` refuses a record with the new `own-group-unknown` when it could
184
+ not read its OWN process group. That comparison is what stops the sweep
185
+ signalling the shell this host runs in, and it is read from `ps` like the start
186
+ time, so it can go unanswered on its own; the record is kept for an incarnation
187
+ that can make the comparison rather than signalled on a guard that did not run.
188
+ - `ProcessReaper` validates a durable record's numbers before signalling them.
189
+ `pgid: 0` reached `process.kill(-0, "SIGKILL")`, which signals this host's own
190
+ process group; POSIX now requires a safe `pgid` above 1 equal to `pid`, and
191
+ Windows requires `pgid: null`, with the check repeated inside each `killTree`.
192
+ - Windows records now reach `taskkill` through `reap`. They carry `pgid: null`,
193
+ which was refused as `no-group` before `killTree` was consulted, so
194
+ `windowsSystem` was unreachable and every Windows orphan was retired
195
+ unsignalled. Windows remains outside the 1.0.0-rc.0 support contract and this
196
+ path is unsupported best-effort.
197
+ - Moved the package's published documentation into `docs/` and `docs/Manifest.ts`.
198
+ `docs/pages/api/platform-node.md` is generated from package sources and said,
199
+ until now, that the package "adds no implementation of its own".
200
+
201
+ ### Removed
202
+
203
+ - `NodeHttpTransport` is gone. An outgoing request is Effect's `HttpClient`,
204
+ and `NodeHost.layer` now provides `@effect/platform-node`'s
205
+ `NodeHttpClient.layerUndici` directly. Undici installs no redirect
206
+ interceptor, so every hop stays a separate request `@smthrs/kernel` can
207
+ authorize. `NodeHost` re-exports `NodeHttpClient` for selective wiring.
208
+ - `NodeShell` is gone. Process execution is Effect's `ChildProcessSpawner`, and
209
+ `NodeHost.layer` now provides `@effect/platform-node`'s implementation of it
210
+ directly. The wrapper's one extra feature, `timeoutMs`, is `Effect.timeout`
211
+ around any effect.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 William Cory and the Smithers Flows contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,166 @@
1
- # Temporary Holding Version
1
+ # @smthrs/platform-node
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Release candidate scope, host requirements and compatibility review are defined in the [library support policy](https://github.com/smithersai/smithers/blob/main/RELEASE_SUPPORT.md).
4
+
5
+ **Documentation:** https://platform-node.smithers.sh
6
+
7
+ The Node.js Host bundle for Smithers. One layer, `NodeHost.layer`, provides the
8
+ five services a program runs its side effects through: a filesystem, a path
9
+ helper, a child-process spawner, a [Jujutsu](https://jj-vcs.github.io/jj/)
10
+ adapter, and an HTTP client.
11
+
12
+ `@effect/platform-node` already ships Node implementations of most of those, and
13
+ this package uses them where they fit. Three guarantees are not ones a
14
+ general-purpose adapter makes, so this package implements them itself:
15
+
16
+ - **A filesystem a symlink cannot redirect.** `AtomicFileSystem` opens the
17
+ workspace root once, walks each component with `O_NOFOLLOW`, and performs the
18
+ final syscall relative to a pinned directory descriptor, so a path swapped
19
+ between the permission check and the operation cannot redirect it.
20
+ - **Child processes a crashed host does not leave behind.**
21
+ `NodeHost.layerContained` gives every child a `SIGTERM`-then-`SIGKILL`
22
+ deadline and a durable ledger record, and sweeps the records a previous
23
+ incarnation abandoned while the layer is built.
24
+ - **An honest answer about whether a run's owner is still alive.**
25
+ `HostLiveness.isAlive` is the probe a durable engine consults before it takes
26
+ a run some other process recorded itself as owning. Ambiguity resolves toward
27
+ alive, because stranding a run is cheaper than running it twice.
28
+
29
+ ## Availability
30
+
31
+ `@smthrs/platform-node` is not on npm at 1.0.0-rc.0. Its source lives in the
32
+ [smithers repository](https://github.com/smithersai/smithers), and the
33
+ [installation page](https://platform-node.smithers.sh/installation/) covers how
34
+ to depend on it from a checkout and the `effect` version it pins.
35
+
36
+ On POSIX, filesystem confinement requires Node.js 26.4.0 or later and the
37
+ `smithers-jj-export` native helper. From a source checkout, build it with:
38
+
39
+ ```sh
40
+ cargo build --locked --release -p smithers-ffi --bin smithers-jj-export
41
+ ```
42
+
43
+ Install the Rust toolchain `rust-toolchain.toml` pins with `rustup toolchain install`
44
+ if needed. The host finds `target/release/smithers-jj-export`
45
+ automatically. Packaged installs supply a platform helper; an operator-managed
46
+ installation can set `SMITHERS_WORKSPACE_JJ_EXPORT_BINARY` to its absolute path.
47
+ A missing helper refuses confined operations, including MCP flow discovery.
48
+
49
+ ## Run a command through the host
50
+
51
+ ```ts
52
+ import { NodeHost } from "@smthrs/platform-node"
53
+ import { Effect } from "effect"
54
+ import * as ChildProcess from "effect/unstable/process/ChildProcess"
55
+ import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"
56
+
57
+ const program = Effect.gen(function*() {
58
+ const spawner = yield* ChildProcessSpawner
59
+ return yield* spawner.string(ChildProcess.make("git", ["status", "--short"]))
60
+ })
61
+
62
+ Effect.runPromise(Effect.provide(program, NodeHost.layer))
63
+ ```
64
+
65
+ `ChildProcess` and `ChildProcessSpawner` are Effect's own tags. The same layer
66
+ also provided the `FileSystem`, `Path`, `Jj`, and `HttpClient` that program did
67
+ not ask for.
68
+
69
+ ## Layers
70
+
71
+ | Layer | What it adds |
72
+ | ---------------------------------- | ----------------------------------------------------------------- |
73
+ | `NodeHost.layer` | the five tags, with `Jj` bound to the process working directory |
74
+ | `NodeHost.layerAt(root)` | the same, with `Jj` pinned to one absolute repository root |
75
+ | `NodeHost.layerContained(options)` | process containment: kill deadlines, ledger records, a reap sweep |
76
+ | `NodeHost.layerContainedAt(...)` | both, which is what the flow engine's `NodeRuntime` composes |
77
+
78
+ The contained layers require a `ProcessLedger`, because the durable half of
79
+ containment is only as good as the journal underneath it. `ProcessLedger.layer`
80
+ inherits a crashed incarnation's processes; `ProcessLedger.layerMemory` contains
81
+ this one and nothing more.
82
+
83
+ ```ts
84
+ import { ProcessLedger } from "@smthrs/kernel"
85
+ import { NodeHost } from "@smthrs/platform-node"
86
+ import { Layer } from "effect"
87
+
88
+ const host = Layer.provide(
89
+ NodeHost.layerContained({ graceMs: 2000 }),
90
+ ProcessLedger.layer({ hostId: "engine-1", ownerPid: process.pid })
91
+ )
92
+ ```
93
+
94
+ The contained spawner prepares a supervisor and records its identity before
95
+ activating the target. On POSIX `handle.pid` names that owner, while
96
+ `exitCode` and `isRunning` describe the target. Natural target exit still
97
+ cleans up its owned group, including children holding output open. Use the
98
+ handle's `kill` for signal delivery; cleanup failure retains the ledger record.
99
+ `ScopedProcess` supplies this lifetime policy for transient commands without a
100
+ durable ledger, and exposes the separate native `Handle.targetPid` for diagnostics.
101
+
102
+ Complete host bundles require jj 0.39.0 or newer. Construction probes the binary through its selected runner; a contained host records and retires this probe in its process ledger and can fail with `JjError` (`not_installed` or `unsupported_version`). Repository commands use the selected process runner.
103
+
104
+ ## Modules
105
+
106
+ The barrel exports four namespaces: `NodeHost`, `HostLiveness`,
107
+ `ProcessReaper`, and `ScopedProcess`. `AtomicFileSystem` is deliberately not among them; it is reached
108
+ as `NodeHost.AtomicFileSystem` or through the
109
+ `@smthrs/platform-node/AtomicFileSystem` subpath.
110
+
111
+ | Module | What it provides |
112
+ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
113
+ | `NodeHost` | the complete closed Host bundle, plus re-exports of `AtomicFileSystem`, `ProcessReaper`, `NodeCrypto`, and Effect's raw `NodeFileSystem`, spawner, and `HttpClient` |
114
+ | `AtomicFileSystem` | the descriptor-relative, no-follow filesystem layer and its options, ceilings, and glob grammar |
115
+ | `HostLiveness` | whether a recorded run owner is still alive: `isAlive`, `Owner`, `Options` |
116
+ | `ProcessReaper` | live containment and restart reconciliation: `layerSpawner`, `SpawnerOptions`, `processLifecycle`, `reap`, `layer`, `System`, `Refusal`, `posixSystem`, `windowsSystem`, `systemFor` |
117
+ | `ScopedProcess` | transient scoped commands with the same lifecycle: `Options`, `Handle`, `spawn`, `Status`, `status` |
118
+
119
+ `NodeCrypto` is re-exported for a different reason than the rest: `Crypto` is not
120
+ a Host service, so it is not in the closed list, but every durable composition
121
+ needs one and a program that already depends on this package for its host should
122
+ not need a second dependency for the digest.
123
+
124
+ ## What the bundle does not provide
125
+
126
+ **There is no shell service.** Running a command is Effect's `ChildProcess` and
127
+ `ChildProcessSpawner`, so a wall-clock budget is `Effect.timeout` around the
128
+ effect and cancellation is fiber interruption, not an `AbortSignal`.
129
+
130
+ **There is no HTTP service.** An outgoing request is Effect's `HttpClient`,
131
+ provided here as `NodeHttpClient.layerUndici`. Undici installs no redirect
132
+ interceptor, so every hop stays a separate, checkable request.
133
+
134
+ Both are what lets [`@smthrs/kernel`](https://kernel.smithers.sh) check
135
+ `proc:spawn` against the rendered command line before any process starts, and
136
+ `net:get` / `net:post` against the host of every URL a request reaches,
137
+ redirect targets included. Wrap the bundle in its `HostServices.layer` to get
138
+ that permission-aware projection.
139
+
140
+ ## Where this sits
141
+
142
+ [`@smthrs/flows`](https://flows.smithers.sh) is the durable flow engine: flows,
143
+ actions, the journal, and the runtime that replays a crashed run from where it
144
+ stopped. It deliberately re-exports no `@smthrs/platform-*` package, for the
145
+ same reason `effect`'s own index does not re-export `@effect/platform-node`:
146
+ the program that runs picks its platform. So a Node program installs
147
+ `@smthrs/flows` for the engine and this package for the machine underneath it,
148
+ and its `NodeRuntime` composes `NodeHost.layerContainedAt` plus
149
+ `HostLiveness.isAlive` from one options object.
150
+
151
+ ## Read next
152
+
153
+ The documentation site covers the rest: [the host bundle](https://platform-node.smithers.sh/concepts/host-bundle/), [the descriptor-relative filesystem](https://platform-node.smithers.sh/concepts/descriptor-relative-filesystem/)
154
+ and everything it refuses, [process containment](https://platform-node.smithers.sh/concepts/process-containment/)
155
+ and every guard checked before a reap, the [API reference](https://platform-node.smithers.sh/reference/api/), and
156
+ [troubleshooting](https://platform-node.smithers.sh/troubleshooting/).
157
+
158
+ For a different runtime, the sibling bundles are
159
+ [`@smthrs/platform-bun`](https://platform-bun.smithers.sh) and
160
+ [`@smthrs/platform-browser`](https://platform-browser.smithers.sh).
161
+
162
+ The host exports `implementationIds` for its five service slots. Its rooted
163
+ factories reject invalid roots before constructing a layer, using the host's
164
+ own error with code `invalid_repository_root`.
165
+
166
+ The atomic filesystem supports descriptor-based `chmod` and `chown` on regular files so replacements can preserve permissions and ownership. Symlinks, hard-linked files, directories, and special files are refused by this boundary.
@@ -0,0 +1,4 @@
1
+ [diffend] Oversized file quarantined before diffing.
2
+ name: package/bin/linux-x64/smithers-jj-export
3
+ size: 53554360 bytes
4
+ sha256: 082aad5f9ca4c16a4bf1ad78225e1c0e1677141913c3a5601c586f8a8a5fdb08
@@ -0,0 +1,147 @@
1
+ /**
2
+ * Descriptor-relative filesystem operations through the packaged Rust helper.
3
+ * The helper pins the workspace root and walks each component with O_NOFOLLOW.
4
+ * Requests and responses are length-framed, size-limited, and cancellable.
5
+ * @since 0.1.0
6
+ */
7
+ import { FileSystem, Layer } from "effect";
8
+ export { AtomicHelperError, AtomicHelperErrorCode } from "./internal/AtomicHelperError.ts";
9
+ /**
10
+ * The legacy system installation path, used after package and checkout paths.
11
+ * Helper selection never consults `PATH` or the process working directory.
12
+ *
13
+ * @since 0.1.0
14
+ * @category constants
15
+ */
16
+ export declare const defaultExecutable = "/usr/local/bin/smithers-jj-export";
17
+ /**
18
+ * Byte ceilings for the helper protocol. Every one of them is a contract, not
19
+ * a tuning knob: without them a large file, a large directory tree, or a
20
+ * malfunctioning helper makes the host allocate until it dies.
21
+ *
22
+ * - `content` bounds the bytes a single `readFile`/`writeFile` may carry.
23
+ * - `request` bounds the framed request; an over-limit request is refused
24
+ * before an helper is even started.
25
+ * - `response` bounds the framed response, and is what a directory listing is
26
+ * charged against as it is built. It bounds the REJECTION envelope too, so a
27
+ * ceiling small enough to cut one off degrades that operation's typed reason
28
+ * to the fail-closed one.
29
+ * - `stderr` bounds the diagnostic text retained from a failing helper.
30
+ * - `batchEntry` bounds one batch member's encoded success or failure envelope.
31
+ * - `batchSize` bounds the number of operations in one batch, at most 128.
32
+ *
33
+ * All except `batchSize` count bytes. The two ceilings that decide whether the host
34
+ * survives a wide fan-out are {@link Options.concurrency}, which bounds how
35
+ * many helpers run at once, and {@link Options.timeoutMs}, which bounds
36
+ * how long any one of them may take.
37
+ *
38
+ * @since 0.1.0
39
+ * @category models
40
+ */
41
+ export interface Limits {
42
+ readonly content: number;
43
+ readonly request: number;
44
+ readonly response: number;
45
+ readonly stderr: number;
46
+ /** Maximum operations in one helper invocation, at most 128. */
47
+ readonly batchSize: number;
48
+ /** Maximum encoded result bytes for one batch member. */
49
+ readonly batchEntry: number;
50
+ }
51
+ /**
52
+ * 16 MiB of file content, 24 MiB of framed request and response (base64
53
+ * expands 16 MiB to 22369624 bytes, which has to fit), and 64 KiB of retained
54
+ * helper diagnostics.
55
+ *
56
+ * @since 0.1.0
57
+ * @category constants
58
+ */
59
+ export declare const defaultLimits: Limits;
60
+ /**
61
+ * The default number of helper processes that may run at once:
62
+ * `os.availableParallelism()`.
63
+ *
64
+ * @since 1.0.0-rc.0
65
+ * @category constants
66
+ */
67
+ export declare const defaultConcurrency: number;
68
+ /**
69
+ * How long one helper may run before it is killed and the operation fails
70
+ * closed: five minutes.
71
+ *
72
+ * It is a backstop, not a latency budget. A read at the content ceiling over a
73
+ * slow disk has to fit under it, so it is generous; what it bounds is a helper
74
+ * that will never answer at all.
75
+ *
76
+ * @since 1.0.0-rc.0
77
+ * @category constants
78
+ */
79
+ export declare const defaultTimeoutMs = 300000;
80
+ /**
81
+ * The deliberate seam for a POSIX host that installs the native helper somewhere other
82
+ * than {@link defaultExecutable}, or that needs different ceilings. It is
83
+ * configuration, never discovery: the executable is validated as an absolute,
84
+ * executable regular file outside the confined workspace on every request, and
85
+ * every other field is read ONCE, when the layer is built.
86
+ *
87
+ * @since 0.1.0
88
+ * @category models
89
+ */
90
+ export interface Options {
91
+ readonly executable?: string | undefined;
92
+ readonly limits?: Partial<Limits> | undefined;
93
+ /**
94
+ * How many helper processes may run at once. Default
95
+ * {@link defaultConcurrency}.
96
+ *
97
+ * Each ordinary operation or batch starts one helper, so an unbounded
98
+ * `Effect.forEach` over a directory would start
99
+ * one helper per entry. This ceiling is what keeps a wide fan-out from
100
+ * pinning every core; it is a contract, not a tuning knob.
101
+ */
102
+ readonly concurrency?: number | undefined;
103
+ /**
104
+ * How long one helper may run before it is killed and the operation fails
105
+ * closed, in milliseconds. Default {@link defaultTimeoutMs}.
106
+ */
107
+ readonly timeoutMs?: number | undefined;
108
+ }
109
+ /**
110
+ * Process-local helper starts, for cost counters and local measurements.
111
+ * Includes helpers later cancelled or refused; rejected preflight starts none.
112
+ *
113
+ * @since 1.0.0
114
+ * @category metrics
115
+ */
116
+ export declare const helperSpawns: () => number;
117
+ /**
118
+ * The helper this process would start for an atomic operation, resolved exactly
119
+ * as an operation resolves it: `SMITHERS_WORKSPACE_JJ_EXPORT_BINARY`, then the
120
+ * packaged and checkout locations. Nothing is spawned. Throws an {@link AtomicHelperError} whose
121
+ * message names what was searched and how to install the helper when none is
122
+ * usable, so a diagnostic can report it before any operation needs it.
123
+ *
124
+ * @since 1.0.0
125
+ * @category constructors
126
+ */
127
+ export declare const resolveHelper: () => string;
128
+ /**
129
+ * A Node filesystem layer carrying the kernel's atomic host extension, built
130
+ * against an explicitly configured helper, byte limits, process ceiling,
131
+ * and helper timeout.
132
+ *
133
+ * Every field of {@link Options} except `executable` is read once, here. The
134
+ * concurrency ceiling is one semaphore for the whole layer rather than one per
135
+ * request, which is the only arrangement that bounds anything.
136
+ *
137
+ * @since 0.1.0
138
+ * @category layers
139
+ */
140
+ export declare const layerWith: (options: Options) => Layer.Layer<FileSystem.FileSystem>;
141
+ /** A Node filesystem layer carrying the kernel's atomic host extension.
142
+ *
143
+ * @since 0.1.0
144
+ * @category layers
145
+ */
146
+ export declare const layer: Layer.Layer<FileSystem.FileSystem>;
147
+ //# sourceMappingURL=AtomicFileSystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AtomicFileSystem.d.ts","sourceRoot":"","sources":["../../src/AtomicFileSystem.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAU,UAAU,EAAE,KAAK,EAAoC,MAAM,QAAQ,CAAA;AAapF,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AAE1F;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,sCAAsC,CAAA;AAEpE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,yDAAyD;IACzD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,MAO3B,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAA+B,CAAA;AAEhE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,SAAU,CAAA;AAEvC;;;;;;;;;GASG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IAC7C;;;;;;;;OAQG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzC;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACxC;AAgBD;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,QAAO,MAA6B,CAAA;AAqJ7D;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,QAAO,MAA0C,CAAA;AAuB3E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,SAAS,GAAI,SAAS,OAAO,KAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAuD7E,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAiB,CAAA"}