@struktoai/mirage-node 0.0.7 → 0.0.8

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 (829) hide show
  1. package/README.md +143 -48
  2. package/dist/accessor/disk.d.ts +6 -0
  3. package/dist/accessor/disk.d.ts.map +1 -1
  4. package/dist/accessor/disk.js +8 -0
  5. package/dist/accessor/disk.js.map +1 -1
  6. package/dist/accessor/email.d.ts.map +1 -1
  7. package/dist/accessor/email.js +5 -0
  8. package/dist/accessor/email.js.map +1 -1
  9. package/dist/accessor/gridfs.d.ts.map +1 -1
  10. package/dist/accessor/gridfs.js +6 -1
  11. package/dist/accessor/gridfs.js.map +1 -1
  12. package/dist/accessor/hf_hub.d.ts +3 -7
  13. package/dist/accessor/hf_hub.d.ts.map +1 -1
  14. package/dist/accessor/hf_hub.js +10 -10
  15. package/dist/accessor/hf_hub.js.map +1 -1
  16. package/dist/cache/file/redis.d.ts +8 -7
  17. package/dist/cache/file/redis.d.ts.map +1 -1
  18. package/dist/cache/file/redis.js +46 -50
  19. package/dist/cache/file/redis.js.map +1 -1
  20. package/dist/commands/builtin/utils/http.js +13 -5
  21. package/dist/commands/builtin/utils/http.js.map +1 -1
  22. package/dist/commands/cli/builtin/hf/index.d.ts.map +1 -1
  23. package/dist/commands/cli/builtin/hf/index.js +4 -5
  24. package/dist/commands/cli/builtin/hf/index.js.map +1 -1
  25. package/dist/commands/cli/builtin/hf/upload.d.ts.map +1 -1
  26. package/dist/commands/cli/builtin/hf/upload.js +2 -5
  27. package/dist/commands/cli/builtin/hf/upload.js.map +1 -1
  28. package/dist/commands/cli/builtin/himalaya/builder.d.ts +2 -2
  29. package/dist/commands/cli/builtin/himalaya/builder.d.ts.map +1 -1
  30. package/dist/commands/cli/builtin/himalaya/builder.js +1 -1
  31. package/dist/commands/cli/builtin/himalaya/builder.js.map +1 -1
  32. package/dist/commands/cli/builtin/himalaya/deliver.d.ts +35 -7
  33. package/dist/commands/cli/builtin/himalaya/deliver.d.ts.map +1 -1
  34. package/dist/commands/cli/builtin/himalaya/deliver.js.map +1 -1
  35. package/dist/commands/cli/builtin/himalaya/index.d.ts.map +1 -1
  36. package/dist/commands/cli/builtin/himalaya/index.js +4 -5
  37. package/dist/commands/cli/builtin/himalaya/index.js.map +1 -1
  38. package/dist/commands/cli/builtin/himalaya/query.d.ts +2 -2
  39. package/dist/commands/cli/builtin/himalaya/query.d.ts.map +1 -1
  40. package/dist/commands/cli/builtin/himalaya/query.js +1 -1
  41. package/dist/commands/cli/builtin/himalaya/query.js.map +1 -1
  42. package/dist/commands/cli/builtin/himalaya/send.d.ts.map +1 -1
  43. package/dist/commands/cli/builtin/himalaya/send.js +2 -1
  44. package/dist/commands/cli/builtin/himalaya/send.js.map +1 -1
  45. package/dist/commands/cli/builtin/himalaya/smtp.d.ts +2 -2
  46. package/dist/commands/cli/builtin/himalaya/smtp.d.ts.map +1 -1
  47. package/dist/commands/cli/builtin/himalaya/smtp.js +5 -0
  48. package/dist/commands/cli/builtin/himalaya/smtp.js.map +1 -1
  49. package/dist/commands/cli/builtin/himalaya/util.d.ts +1 -1
  50. package/dist/commands/cli/builtin/himalaya/util.d.ts.map +1 -1
  51. package/dist/commands/cli/builtin/himalaya/util.js +6 -5
  52. package/dist/commands/cli/builtin/himalaya/util.js.map +1 -1
  53. package/dist/config.d.ts +57 -37
  54. package/dist/config.d.ts.map +1 -1
  55. package/dist/config.js +152 -277
  56. package/dist/config.js.map +1 -1
  57. package/dist/core/disk/capacity.d.ts +13 -0
  58. package/dist/core/disk/capacity.d.ts.map +1 -0
  59. package/dist/core/disk/capacity.js +93 -0
  60. package/dist/core/disk/capacity.js.map +1 -0
  61. package/dist/core/disk/constants.d.ts +0 -1
  62. package/dist/core/disk/constants.d.ts.map +1 -1
  63. package/dist/core/disk/constants.js +0 -1
  64. package/dist/core/disk/constants.js.map +1 -1
  65. package/dist/core/disk/copy.d.ts.map +1 -1
  66. package/dist/core/disk/copy.js +24 -13
  67. package/dist/core/disk/copy.js.map +1 -1
  68. package/dist/core/disk/mkdir.d.ts.map +1 -1
  69. package/dist/core/disk/mkdir.js +9 -0
  70. package/dist/core/disk/mkdir.js.map +1 -1
  71. package/dist/core/disk/read.d.ts +3 -3
  72. package/dist/core/disk/read.d.ts.map +1 -1
  73. package/dist/core/disk/read.js +4 -19
  74. package/dist/core/disk/read.js.map +1 -1
  75. package/dist/core/disk/rename.d.ts +3 -0
  76. package/dist/core/disk/rename.d.ts.map +1 -1
  77. package/dist/core/disk/rename.js +15 -1
  78. package/dist/core/disk/rename.js.map +1 -1
  79. package/dist/core/disk/rm.d.ts.map +1 -1
  80. package/dist/core/disk/rm.js +11 -1
  81. package/dist/core/disk/rm.js.map +1 -1
  82. package/dist/core/disk/rmdir.d.ts.map +1 -1
  83. package/dist/core/disk/rmdir.js +4 -0
  84. package/dist/core/disk/rmdir.js.map +1 -1
  85. package/dist/core/disk/set_attrs.d.ts +2 -9
  86. package/dist/core/disk/set_attrs.d.ts.map +1 -1
  87. package/dist/core/disk/set_attrs.js +2 -1
  88. package/dist/core/disk/set_attrs.js.map +1 -1
  89. package/dist/core/disk/stream.d.ts +8 -0
  90. package/dist/core/disk/stream.d.ts.map +1 -1
  91. package/dist/core/disk/stream.js +33 -13
  92. package/dist/core/disk/stream.js.map +1 -1
  93. package/dist/core/disk/unlink.d.ts.map +1 -1
  94. package/dist/core/disk/unlink.js +4 -0
  95. package/dist/core/disk/unlink.js.map +1 -1
  96. package/dist/core/disk/utils.d.ts +2 -0
  97. package/dist/core/disk/utils.d.ts.map +1 -1
  98. package/dist/core/disk/utils.js +68 -21
  99. package/dist/core/disk/utils.js.map +1 -1
  100. package/dist/core/disk/write.d.ts +7 -2
  101. package/dist/core/disk/write.d.ts.map +1 -1
  102. package/dist/core/disk/write.js +22 -16
  103. package/dist/core/disk/write.js.map +1 -1
  104. package/dist/core/email/_parse.d.ts +60 -12
  105. package/dist/core/email/_parse.d.ts.map +1 -1
  106. package/dist/core/email/_parse.js +2 -2
  107. package/dist/core/email/_parse.js.map +1 -1
  108. package/dist/core/email/client.d.ts +36 -9
  109. package/dist/core/email/client.d.ts.map +1 -1
  110. package/dist/core/email/client.js +15 -0
  111. package/dist/core/email/client.js.map +1 -1
  112. package/dist/core/email/config.d.ts +6 -9
  113. package/dist/core/email/config.d.ts.map +1 -1
  114. package/dist/core/email/config.js +31 -27
  115. package/dist/core/email/config.js.map +1 -1
  116. package/dist/core/email/readdir.d.ts +2 -2
  117. package/dist/core/email/readdir.d.ts.map +1 -1
  118. package/dist/core/email/readdir.js +1 -1
  119. package/dist/core/email/readdir.js.map +1 -1
  120. package/dist/core/email/render.d.ts +5 -5
  121. package/dist/core/email/render.d.ts.map +1 -1
  122. package/dist/core/email/render.js.map +1 -1
  123. package/dist/core/email/search.d.ts +2 -2
  124. package/dist/core/email/search.d.ts.map +1 -1
  125. package/dist/core/email/search.js +1 -1
  126. package/dist/core/email/search.js.map +1 -1
  127. package/dist/core/gridfs/client.d.ts +25 -2
  128. package/dist/core/gridfs/client.d.ts.map +1 -1
  129. package/dist/core/gridfs/client.js +74 -7
  130. package/dist/core/gridfs/client.js.map +1 -1
  131. package/dist/core/gridfs/constants.d.ts +1 -0
  132. package/dist/core/gridfs/constants.d.ts.map +1 -1
  133. package/dist/core/gridfs/constants.js +5 -0
  134. package/dist/core/gridfs/constants.js.map +1 -1
  135. package/dist/core/gridfs/driver.d.ts +1 -0
  136. package/dist/core/gridfs/driver.d.ts.map +1 -1
  137. package/dist/core/gridfs/driver.js +80 -67
  138. package/dist/core/gridfs/driver.js.map +1 -1
  139. package/dist/core/gridfs/events.d.ts +8 -3
  140. package/dist/core/gridfs/events.d.ts.map +1 -1
  141. package/dist/core/gridfs/events.js +11 -3
  142. package/dist/core/gridfs/events.js.map +1 -1
  143. package/dist/core/gridfs/read.d.ts +2 -7
  144. package/dist/core/gridfs/read.d.ts.map +1 -1
  145. package/dist/core/gridfs/read.js +4 -9
  146. package/dist/core/gridfs/read.js.map +1 -1
  147. package/dist/core/gridfs/stream.d.ts.map +1 -1
  148. package/dist/core/gridfs/stream.js +5 -2
  149. package/dist/core/gridfs/stream.js.map +1 -1
  150. package/dist/core/gridfs/write.d.ts +1 -1
  151. package/dist/core/gridfs/write.d.ts.map +1 -1
  152. package/dist/core/gridfs/write.js +2 -2
  153. package/dist/core/gridfs/write.js.map +1 -1
  154. package/dist/core/hf_buckets/driver.d.ts.map +1 -1
  155. package/dist/core/hf_buckets/driver.js +16 -0
  156. package/dist/core/hf_buckets/driver.js.map +1 -1
  157. package/dist/core/hf_buckets/read.d.ts +2 -6
  158. package/dist/core/hf_buckets/read.d.ts.map +1 -1
  159. package/dist/core/hf_buckets/read.js +1 -1
  160. package/dist/core/hf_buckets/read.js.map +1 -1
  161. package/dist/core/hf_buckets/stream.d.ts.map +1 -1
  162. package/dist/core/hf_buckets/stream.js +2 -0
  163. package/dist/core/hf_buckets/stream.js.map +1 -1
  164. package/dist/core/hf_hub/admin.d.ts +3 -4
  165. package/dist/core/hf_hub/admin.d.ts.map +1 -1
  166. package/dist/core/hf_hub/admin.js +4 -4
  167. package/dist/core/hf_hub/admin.js.map +1 -1
  168. package/dist/core/hf_hub/client.d.ts +11 -24
  169. package/dist/core/hf_hub/client.d.ts.map +1 -1
  170. package/dist/core/hf_hub/client.js +40 -97
  171. package/dist/core/hf_hub/client.js.map +1 -1
  172. package/dist/core/hf_hub/commit.d.ts +8 -9
  173. package/dist/core/hf_hub/commit.d.ts.map +1 -1
  174. package/dist/core/hf_hub/commit.js +4 -6
  175. package/dist/core/hf_hub/commit.js.map +1 -1
  176. package/dist/core/hf_hub/config.d.ts +5 -4
  177. package/dist/core/hf_hub/config.d.ts.map +1 -1
  178. package/dist/core/hf_hub/config.js +3 -1
  179. package/dist/core/hf_hub/config.js.map +1 -1
  180. package/dist/core/hf_hub/constants.d.ts +0 -1
  181. package/dist/core/hf_hub/constants.d.ts.map +1 -1
  182. package/dist/core/hf_hub/constants.js +0 -1
  183. package/dist/core/hf_hub/constants.js.map +1 -1
  184. package/dist/core/hf_hub/read.d.ts +2 -5
  185. package/dist/core/hf_hub/read.d.ts.map +1 -1
  186. package/dist/core/hf_hub/read.js.map +1 -1
  187. package/dist/core/hf_hub/stream.d.ts.map +1 -1
  188. package/dist/core/hf_hub/stream.js +2 -0
  189. package/dist/core/hf_hub/stream.js.map +1 -1
  190. package/dist/core/nextcloud/capacity.js.map +1 -1
  191. package/dist/core/nextcloud/checksum.js +4 -3
  192. package/dist/core/nextcloud/checksum.js.map +1 -1
  193. package/dist/core/nextcloud/constants.d.ts +2 -0
  194. package/dist/core/nextcloud/constants.d.ts.map +1 -1
  195. package/dist/core/nextcloud/constants.js +4 -0
  196. package/dist/core/nextcloud/constants.js.map +1 -1
  197. package/dist/core/nextcloud/copy.js.map +1 -1
  198. package/dist/core/nextcloud/dav.d.ts +9 -3
  199. package/dist/core/nextcloud/dav.d.ts.map +1 -1
  200. package/dist/core/nextcloud/dav.js +20 -2
  201. package/dist/core/nextcloud/dav.js.map +1 -1
  202. package/dist/core/nextcloud/read.d.ts +2 -6
  203. package/dist/core/nextcloud/read.d.ts.map +1 -1
  204. package/dist/core/nextcloud/read.js +1 -1
  205. package/dist/core/nextcloud/read.js.map +1 -1
  206. package/dist/core/nextcloud/search/query.js +2 -2
  207. package/dist/core/nextcloud/search/query.js.map +1 -1
  208. package/dist/core/nextcloud/search/response.d.ts +3 -2
  209. package/dist/core/nextcloud/search/response.d.ts.map +1 -1
  210. package/dist/core/nextcloud/search/response.js +5 -5
  211. package/dist/core/nextcloud/search/response.js.map +1 -1
  212. package/dist/core/nextcloud/search/types.d.ts +1 -1
  213. package/dist/core/nextcloud/search/types.d.ts.map +1 -1
  214. package/dist/core/nextcloud/set_attrs.js.map +1 -1
  215. package/dist/core/nextcloud/stat.d.ts.map +1 -1
  216. package/dist/core/nextcloud/stat.js +7 -9
  217. package/dist/core/nextcloud/stat.js.map +1 -1
  218. package/dist/core/nextcloud/stream.d.ts.map +1 -1
  219. package/dist/core/nextcloud/stream.js +2 -0
  220. package/dist/core/nextcloud/stream.js.map +1 -1
  221. package/dist/core/nextcloud/write.d.ts +7 -1
  222. package/dist/core/nextcloud/write.d.ts.map +1 -1
  223. package/dist/core/nextcloud/write.js +81 -8
  224. package/dist/core/nextcloud/write.js.map +1 -1
  225. package/dist/core/ssh/append.d.ts +1 -2
  226. package/dist/core/ssh/append.d.ts.map +1 -1
  227. package/dist/core/ssh/append.js +1 -4
  228. package/dist/core/ssh/append.js.map +1 -1
  229. package/dist/core/ssh/checksum.d.ts.map +1 -1
  230. package/dist/core/ssh/checksum.js +1 -0
  231. package/dist/core/ssh/checksum.js.map +1 -1
  232. package/dist/core/ssh/rm.d.ts.map +1 -1
  233. package/dist/core/ssh/rm.js +15 -6
  234. package/dist/core/ssh/rm.js.map +1 -1
  235. package/dist/core/ssh/rmdir.d.ts.map +1 -1
  236. package/dist/core/ssh/rmdir.js +2 -22
  237. package/dist/core/ssh/rmdir.js.map +1 -1
  238. package/dist/core/ssh/set_attrs.d.ts +2 -9
  239. package/dist/core/ssh/set_attrs.d.ts.map +1 -1
  240. package/dist/core/ssh/set_attrs.js +1 -1
  241. package/dist/core/ssh/set_attrs.js.map +1 -1
  242. package/dist/core/ssh/stat.d.ts.map +1 -1
  243. package/dist/core/ssh/stat.js +5 -4
  244. package/dist/core/ssh/stat.js.map +1 -1
  245. package/dist/core/ssh/stream.d.ts.map +1 -1
  246. package/dist/core/ssh/stream.js +10 -1
  247. package/dist/core/ssh/stream.js.map +1 -1
  248. package/dist/core/ssh/utils.d.ts +8 -2
  249. package/dist/core/ssh/utils.d.ts.map +1 -1
  250. package/dist/core/ssh/utils.js +24 -3
  251. package/dist/core/ssh/utils.js.map +1 -1
  252. package/dist/core/ssh/write.d.ts +1 -2
  253. package/dist/core/ssh/write.d.ts.map +1 -1
  254. package/dist/core/ssh/write.js +1 -4
  255. package/dist/core/ssh/write.js.map +1 -1
  256. package/dist/fuse/constants.d.ts +3 -2
  257. package/dist/fuse/constants.d.ts.map +1 -1
  258. package/dist/fuse/constants.js +6 -3
  259. package/dist/fuse/constants.js.map +1 -1
  260. package/dist/fuse/fs.d.ts +1 -1
  261. package/dist/fuse/fs.d.ts.map +1 -1
  262. package/dist/fuse/fs.js +6 -3
  263. package/dist/fuse/fs.js.map +1 -1
  264. package/dist/fuse/mount.d.ts +5 -0
  265. package/dist/fuse/mount.d.ts.map +1 -1
  266. package/dist/fuse/mount.js +47 -15
  267. package/dist/fuse/mount.js.map +1 -1
  268. package/dist/index.d.ts +130 -159
  269. package/dist/index.d.ts.map +1 -1
  270. package/dist/index.js +86 -135
  271. package/dist/index.js.map +1 -1
  272. package/dist/io/gateway.d.ts +6 -0
  273. package/dist/io/gateway.d.ts.map +1 -0
  274. package/dist/io/gateway.js +357 -0
  275. package/dist/io/gateway.js.map +1 -0
  276. package/dist/io/network.d.ts +35 -0
  277. package/dist/io/network.d.ts.map +1 -0
  278. package/dist/io/network.js +187 -0
  279. package/dist/io/network.js.map +1 -0
  280. package/dist/io/spool.js +3 -3
  281. package/dist/io/spool.js.map +1 -1
  282. package/dist/mount/constants.d.ts +9 -2
  283. package/dist/mount/constants.d.ts.map +1 -1
  284. package/dist/mount/constants.js +9 -2
  285. package/dist/mount/constants.js.map +1 -1
  286. package/dist/mount/errors.d.ts +2 -11
  287. package/dist/mount/errors.d.ts.map +1 -1
  288. package/dist/mount/errors.js +28 -42
  289. package/dist/mount/errors.js.map +1 -1
  290. package/dist/mount/nfs.d.ts +2 -2
  291. package/dist/mount/nfs.d.ts.map +1 -1
  292. package/dist/mount/nfs.js +8 -20
  293. package/dist/mount/nfs.js.map +1 -1
  294. package/dist/mount/sftp.d.ts +3 -3
  295. package/dist/mount/sftp.d.ts.map +1 -1
  296. package/dist/mount/sftp.js +26 -53
  297. package/dist/mount/sftp.js.map +1 -1
  298. package/dist/observe/disk_store.js +1 -1
  299. package/dist/observe/disk_store.js.map +1 -1
  300. package/dist/runtime/js/host/constants.d.ts +1 -1
  301. package/dist/runtime/js/host/constants.d.ts.map +1 -1
  302. package/dist/runtime/js/host/constants.js +9 -8
  303. package/dist/runtime/js/host/constants.js.map +1 -1
  304. package/dist/runtime/js/host/descriptors.d.ts +11 -71
  305. package/dist/runtime/js/host/descriptors.d.ts.map +1 -1
  306. package/dist/runtime/js/host/descriptors.js +16 -202
  307. package/dist/runtime/js/host/descriptors.js.map +1 -1
  308. package/dist/runtime/js/host/fs.d.ts.map +1 -1
  309. package/dist/runtime/js/host/fs.js +491 -135
  310. package/dist/runtime/js/host/fs.js.map +1 -1
  311. package/dist/runtime/js/host/list.d.ts +21 -0
  312. package/dist/runtime/js/host/list.d.ts.map +1 -0
  313. package/dist/runtime/js/host/list.js +107 -0
  314. package/dist/runtime/js/host/list.js.map +1 -0
  315. package/dist/runtime/js/host/stat.d.ts +10 -0
  316. package/dist/runtime/js/host/stat.d.ts.map +1 -0
  317. package/dist/runtime/js/host/stat.js +70 -0
  318. package/dist/runtime/js/host/stat.js.map +1 -0
  319. package/dist/runtime/python/local/runtime.d.ts +8 -7
  320. package/dist/runtime/python/local/runtime.d.ts.map +1 -1
  321. package/dist/runtime/python/local/runtime.js +51 -74
  322. package/dist/runtime/python/local/runtime.js.map +1 -1
  323. package/dist/runtime/sandbox/apple_container/constants.d.ts +2 -3
  324. package/dist/runtime/sandbox/apple_container/constants.d.ts.map +1 -1
  325. package/dist/runtime/sandbox/apple_container/constants.js +4 -11
  326. package/dist/runtime/sandbox/apple_container/constants.js.map +1 -1
  327. package/dist/runtime/sandbox/apple_container/runtime.d.ts +14 -10
  328. package/dist/runtime/sandbox/apple_container/runtime.d.ts.map +1 -1
  329. package/dist/runtime/sandbox/apple_container/runtime.js +38 -57
  330. package/dist/runtime/sandbox/apple_container/runtime.js.map +1 -1
  331. package/dist/runtime/sandbox/daytona/constants.d.ts +27 -0
  332. package/dist/runtime/sandbox/daytona/constants.d.ts.map +1 -0
  333. package/dist/runtime/sandbox/daytona/constants.js +47 -0
  334. package/dist/runtime/sandbox/daytona/constants.js.map +1 -0
  335. package/dist/runtime/sandbox/daytona/runtime.d.ts +6 -4
  336. package/dist/runtime/sandbox/daytona/runtime.d.ts.map +1 -1
  337. package/dist/runtime/sandbox/daytona/runtime.js +13 -9
  338. package/dist/runtime/sandbox/daytona/runtime.js.map +1 -1
  339. package/dist/runtime/sandbox/docker/constants.d.ts +6 -1
  340. package/dist/runtime/sandbox/docker/constants.d.ts.map +1 -1
  341. package/dist/runtime/sandbox/docker/constants.js +6 -1
  342. package/dist/runtime/sandbox/docker/constants.js.map +1 -1
  343. package/dist/runtime/sandbox/docker/runtime.d.ts +8 -6
  344. package/dist/runtime/sandbox/docker/runtime.d.ts.map +1 -1
  345. package/dist/runtime/sandbox/docker/runtime.js +22 -28
  346. package/dist/runtime/sandbox/docker/runtime.js.map +1 -1
  347. package/dist/runtime/sandbox/microsandbox/constants.d.ts +1 -3
  348. package/dist/runtime/sandbox/microsandbox/constants.d.ts.map +1 -1
  349. package/dist/runtime/sandbox/microsandbox/constants.js +1 -5
  350. package/dist/runtime/sandbox/microsandbox/constants.js.map +1 -1
  351. package/dist/runtime/sandbox/microsandbox/runtime.d.ts +9 -8
  352. package/dist/runtime/sandbox/microsandbox/runtime.d.ts.map +1 -1
  353. package/dist/runtime/sandbox/microsandbox/runtime.js +26 -56
  354. package/dist/runtime/sandbox/microsandbox/runtime.js.map +1 -1
  355. package/dist/runtime/sandbox/program.d.ts +165 -0
  356. package/dist/runtime/sandbox/program.d.ts.map +1 -0
  357. package/dist/runtime/sandbox/program.js +724 -0
  358. package/dist/runtime/sandbox/program.js.map +1 -0
  359. package/dist/runtime/sandbox/sandlock/constants.d.ts +1 -1
  360. package/dist/runtime/sandbox/sandlock/constants.d.ts.map +1 -1
  361. package/dist/runtime/sandbox/sandlock/constants.js +1 -1
  362. package/dist/runtime/sandbox/sandlock/constants.js.map +1 -1
  363. package/dist/runtime/sandbox/sandlock/runtime.d.ts +5 -6
  364. package/dist/runtime/sandbox/sandlock/runtime.d.ts.map +1 -1
  365. package/dist/runtime/sandbox/sandlock/runtime.js +27 -16
  366. package/dist/runtime/sandbox/sandlock/runtime.js.map +1 -1
  367. package/dist/runtime/sandbox/smolvm/constants.d.ts +2 -3
  368. package/dist/runtime/sandbox/smolvm/constants.d.ts.map +1 -1
  369. package/dist/runtime/sandbox/smolvm/constants.js +6 -13
  370. package/dist/runtime/sandbox/smolvm/constants.js.map +1 -1
  371. package/dist/runtime/sandbox/smolvm/runtime.d.ts +9 -8
  372. package/dist/runtime/sandbox/smolvm/runtime.d.ts.map +1 -1
  373. package/dist/runtime/sandbox/smolvm/runtime.js +24 -45
  374. package/dist/runtime/sandbox/smolvm/runtime.js.map +1 -1
  375. package/dist/runtime/sandbox/ssh/runtime.d.ts +23 -12
  376. package/dist/runtime/sandbox/ssh/runtime.d.ts.map +1 -1
  377. package/dist/runtime/sandbox/ssh/runtime.js +88 -30
  378. package/dist/runtime/sandbox/ssh/runtime.js.map +1 -1
  379. package/dist/secrets/config.d.ts +2 -2
  380. package/dist/secrets/config.d.ts.map +1 -1
  381. package/dist/secrets/onepassword.d.ts +5 -8
  382. package/dist/secrets/onepassword.d.ts.map +1 -1
  383. package/dist/secrets/onepassword.js.map +1 -1
  384. package/dist/shell/console/redis/constants.d.ts +1 -0
  385. package/dist/shell/console/redis/constants.d.ts.map +1 -1
  386. package/dist/shell/console/redis/constants.js +3 -0
  387. package/dist/shell/console/redis/constants.js.map +1 -1
  388. package/dist/shell/console/redis/store.d.ts +24 -9
  389. package/dist/shell/console/redis/store.d.ts.map +1 -1
  390. package/dist/shell/console/redis/store.js +48 -16
  391. package/dist/shell/console/redis/store.js.map +1 -1
  392. package/dist/shell/job_table/redis.d.ts +52 -0
  393. package/dist/shell/job_table/redis.d.ts.map +1 -0
  394. package/dist/shell/job_table/redis.js +156 -0
  395. package/dist/shell/job_table/redis.js.map +1 -0
  396. package/dist/utils/loader.d.ts.map +1 -1
  397. package/dist/utils/loader.js +1 -3
  398. package/dist/utils/loader.js.map +1 -1
  399. package/dist/vfs/aliyun/aliyun.d.ts +4 -5
  400. package/dist/vfs/aliyun/aliyun.d.ts.map +1 -1
  401. package/dist/vfs/aliyun/aliyun.js +2 -4
  402. package/dist/vfs/aliyun/aliyun.js.map +1 -1
  403. package/dist/vfs/aliyun/config.d.ts +40 -6
  404. package/dist/vfs/aliyun/config.d.ts.map +1 -1
  405. package/dist/vfs/aliyun/config.js +5 -6
  406. package/dist/vfs/aliyun/config.js.map +1 -1
  407. package/dist/vfs/backblaze/backblaze.d.ts +4 -5
  408. package/dist/vfs/backblaze/backblaze.d.ts.map +1 -1
  409. package/dist/vfs/backblaze/backblaze.js +2 -4
  410. package/dist/vfs/backblaze/backblaze.js.map +1 -1
  411. package/dist/vfs/backblaze/config.d.ts +40 -6
  412. package/dist/vfs/backblaze/config.d.ts.map +1 -1
  413. package/dist/vfs/backblaze/config.js +5 -6
  414. package/dist/vfs/backblaze/config.js.map +1 -1
  415. package/dist/vfs/ceph/ceph.d.ts +4 -5
  416. package/dist/vfs/ceph/ceph.d.ts.map +1 -1
  417. package/dist/vfs/ceph/ceph.js +2 -4
  418. package/dist/vfs/ceph/ceph.js.map +1 -1
  419. package/dist/vfs/ceph/config.d.ts +42 -5
  420. package/dist/vfs/ceph/config.d.ts.map +1 -1
  421. package/dist/vfs/ceph/config.js +7 -5
  422. package/dist/vfs/ceph/config.js.map +1 -1
  423. package/dist/vfs/databricks_volume/config.d.ts +2 -2
  424. package/dist/vfs/databricks_volume/config.d.ts.map +1 -1
  425. package/dist/vfs/databricks_volume/config.js +1 -1
  426. package/dist/vfs/databricks_volume/config.js.map +1 -1
  427. package/dist/vfs/databricks_volume/databricks_volume.d.ts +6 -9
  428. package/dist/vfs/databricks_volume/databricks_volume.d.ts.map +1 -1
  429. package/dist/vfs/databricks_volume/databricks_volume.js +4 -9
  430. package/dist/vfs/databricks_volume/databricks_volume.js.map +1 -1
  431. package/dist/vfs/digitalocean/config.d.ts +40 -6
  432. package/dist/vfs/digitalocean/config.d.ts.map +1 -1
  433. package/dist/vfs/digitalocean/config.js +5 -6
  434. package/dist/vfs/digitalocean/config.js.map +1 -1
  435. package/dist/vfs/digitalocean/digitalocean.d.ts +4 -5
  436. package/dist/vfs/digitalocean/digitalocean.d.ts.map +1 -1
  437. package/dist/vfs/digitalocean/digitalocean.js +2 -4
  438. package/dist/vfs/digitalocean/digitalocean.js.map +1 -1
  439. package/dist/vfs/discord/discord.d.ts +7 -10
  440. package/dist/vfs/discord/discord.d.ts.map +1 -1
  441. package/dist/vfs/discord/discord.js +7 -12
  442. package/dist/vfs/discord/discord.js.map +1 -1
  443. package/dist/vfs/disk/disk.d.ts +14 -14
  444. package/dist/vfs/disk/disk.d.ts.map +1 -1
  445. package/dist/vfs/disk/disk.js +87 -52
  446. package/dist/vfs/disk/disk.js.map +1 -1
  447. package/dist/vfs/dropbox/config.d.ts +7 -12
  448. package/dist/vfs/dropbox/config.d.ts.map +1 -1
  449. package/dist/vfs/dropbox/config.js +18 -15
  450. package/dist/vfs/dropbox/config.js.map +1 -1
  451. package/dist/vfs/email/email.d.ts +13 -11
  452. package/dist/vfs/email/email.d.ts.map +1 -1
  453. package/dist/vfs/email/email.js +31 -16
  454. package/dist/vfs/email/email.js.map +1 -1
  455. package/dist/vfs/email/index.d.ts +1 -2
  456. package/dist/vfs/email/index.d.ts.map +1 -1
  457. package/dist/vfs/email/index.js +1 -2
  458. package/dist/vfs/email/index.js.map +1 -1
  459. package/dist/vfs/gcs/config.d.ts +36 -28
  460. package/dist/vfs/gcs/config.d.ts.map +1 -1
  461. package/dist/vfs/gcs/config.js +15 -39
  462. package/dist/vfs/gcs/config.js.map +1 -1
  463. package/dist/vfs/gcs/gcs.d.ts +4 -5
  464. package/dist/vfs/gcs/gcs.d.ts.map +1 -1
  465. package/dist/vfs/gcs/gcs.js +2 -4
  466. package/dist/vfs/gcs/gcs.js.map +1 -1
  467. package/dist/vfs/gridfs/config.d.ts +6 -7
  468. package/dist/vfs/gridfs/config.d.ts.map +1 -1
  469. package/dist/vfs/gridfs/config.js +25 -11
  470. package/dist/vfs/gridfs/config.js.map +1 -1
  471. package/dist/vfs/gridfs/gridfs.d.ts +10 -18
  472. package/dist/vfs/gridfs/gridfs.d.ts.map +1 -1
  473. package/dist/vfs/gridfs/gridfs.js +23 -40
  474. package/dist/vfs/gridfs/gridfs.js.map +1 -1
  475. package/dist/vfs/hf_buckets/config.d.ts +14 -17
  476. package/dist/vfs/hf_buckets/config.d.ts.map +1 -1
  477. package/dist/vfs/hf_buckets/config.js +41 -28
  478. package/dist/vfs/hf_buckets/config.js.map +1 -1
  479. package/dist/vfs/hf_buckets/hf_buckets.d.ts +10 -15
  480. package/dist/vfs/hf_buckets/hf_buckets.d.ts.map +1 -1
  481. package/dist/vfs/hf_buckets/hf_buckets.js +14 -22
  482. package/dist/vfs/hf_buckets/hf_buckets.js.map +1 -1
  483. package/dist/vfs/hf_datasets/config.d.ts +1 -4
  484. package/dist/vfs/hf_datasets/config.d.ts.map +1 -1
  485. package/dist/vfs/hf_datasets/config.js +1 -3
  486. package/dist/vfs/hf_datasets/config.js.map +1 -1
  487. package/dist/vfs/hf_datasets/hf_datasets.d.ts +4 -7
  488. package/dist/vfs/hf_datasets/hf_datasets.d.ts.map +1 -1
  489. package/dist/vfs/hf_datasets/hf_datasets.js +4 -6
  490. package/dist/vfs/hf_datasets/hf_datasets.js.map +1 -1
  491. package/dist/vfs/hf_hub/base.d.ts +4 -8
  492. package/dist/vfs/hf_hub/base.d.ts.map +1 -1
  493. package/dist/vfs/hf_hub/base.js +7 -11
  494. package/dist/vfs/hf_hub/base.js.map +1 -1
  495. package/dist/vfs/hf_models/config.d.ts +1 -4
  496. package/dist/vfs/hf_models/config.d.ts.map +1 -1
  497. package/dist/vfs/hf_models/config.js +1 -3
  498. package/dist/vfs/hf_models/config.js.map +1 -1
  499. package/dist/vfs/hf_models/hf_models.d.ts +4 -7
  500. package/dist/vfs/hf_models/hf_models.d.ts.map +1 -1
  501. package/dist/vfs/hf_models/hf_models.js +4 -6
  502. package/dist/vfs/hf_models/hf_models.js.map +1 -1
  503. package/dist/vfs/hf_spaces/config.d.ts +1 -4
  504. package/dist/vfs/hf_spaces/config.d.ts.map +1 -1
  505. package/dist/vfs/hf_spaces/config.js +1 -3
  506. package/dist/vfs/hf_spaces/config.js.map +1 -1
  507. package/dist/vfs/hf_spaces/hf_spaces.d.ts +4 -7
  508. package/dist/vfs/hf_spaces/hf_spaces.d.ts.map +1 -1
  509. package/dist/vfs/hf_spaces/hf_spaces.js +4 -6
  510. package/dist/vfs/hf_spaces/hf_spaces.js.map +1 -1
  511. package/dist/vfs/jaeger/jaeger.d.ts +7 -9
  512. package/dist/vfs/jaeger/jaeger.d.ts.map +1 -1
  513. package/dist/vfs/jaeger/jaeger.js +7 -11
  514. package/dist/vfs/jaeger/jaeger.js.map +1 -1
  515. package/dist/vfs/lancedb/lancedb.d.ts +10 -11
  516. package/dist/vfs/lancedb/lancedb.d.ts.map +1 -1
  517. package/dist/vfs/lancedb/lancedb.js +4 -5
  518. package/dist/vfs/lancedb/lancedb.js.map +1 -1
  519. package/dist/vfs/lancedb/store.d.ts +2 -2
  520. package/dist/vfs/lancedb/store.d.ts.map +1 -1
  521. package/dist/vfs/lancedb/store.js +3 -0
  522. package/dist/vfs/lancedb/store.js.map +1 -1
  523. package/dist/vfs/minio/config.d.ts +42 -5
  524. package/dist/vfs/minio/config.d.ts.map +1 -1
  525. package/dist/vfs/minio/config.js +7 -5
  526. package/dist/vfs/minio/config.js.map +1 -1
  527. package/dist/vfs/minio/minio.d.ts +4 -5
  528. package/dist/vfs/minio/minio.d.ts.map +1 -1
  529. package/dist/vfs/minio/minio.js +2 -4
  530. package/dist/vfs/minio/minio.js.map +1 -1
  531. package/dist/vfs/mongodb/mongodb.d.ts +10 -11
  532. package/dist/vfs/mongodb/mongodb.d.ts.map +1 -1
  533. package/dist/vfs/mongodb/mongodb.js +6 -7
  534. package/dist/vfs/mongodb/mongodb.js.map +1 -1
  535. package/dist/vfs/mongodb/store.d.ts +2 -1
  536. package/dist/vfs/mongodb/store.d.ts.map +1 -1
  537. package/dist/vfs/mongodb/store.js +11 -3
  538. package/dist/vfs/mongodb/store.js.map +1 -1
  539. package/dist/vfs/nextcloud/config.d.ts +5 -8
  540. package/dist/vfs/nextcloud/config.d.ts.map +1 -1
  541. package/dist/vfs/nextcloud/config.js +19 -13
  542. package/dist/vfs/nextcloud/config.js.map +1 -1
  543. package/dist/vfs/nextcloud/nextcloud.d.ts +8 -14
  544. package/dist/vfs/nextcloud/nextcloud.d.ts.map +1 -1
  545. package/dist/vfs/nextcloud/nextcloud.js +18 -29
  546. package/dist/vfs/nextcloud/nextcloud.js.map +1 -1
  547. package/dist/vfs/notion/notion.d.ts +7 -10
  548. package/dist/vfs/notion/notion.d.ts.map +1 -1
  549. package/dist/vfs/notion/notion.js +7 -10
  550. package/dist/vfs/notion/notion.js.map +1 -1
  551. package/dist/vfs/oci/config.d.ts +41 -27
  552. package/dist/vfs/oci/config.d.ts.map +1 -1
  553. package/dist/vfs/oci/config.js +18 -45
  554. package/dist/vfs/oci/config.js.map +1 -1
  555. package/dist/vfs/oci/oci.d.ts +4 -5
  556. package/dist/vfs/oci/oci.d.ts.map +1 -1
  557. package/dist/vfs/oci/oci.js +2 -4
  558. package/dist/vfs/oci/oci.js.map +1 -1
  559. package/dist/vfs/postgres/postgres.d.ts +10 -11
  560. package/dist/vfs/postgres/postgres.d.ts.map +1 -1
  561. package/dist/vfs/postgres/postgres.js +5 -6
  562. package/dist/vfs/postgres/postgres.js.map +1 -1
  563. package/dist/vfs/postgres/store.d.ts +3 -3
  564. package/dist/vfs/postgres/store.d.ts.map +1 -1
  565. package/dist/vfs/postgres/store.js +1 -0
  566. package/dist/vfs/postgres/store.js.map +1 -1
  567. package/dist/vfs/qingstor/config.d.ts +40 -6
  568. package/dist/vfs/qingstor/config.d.ts.map +1 -1
  569. package/dist/vfs/qingstor/config.js +5 -6
  570. package/dist/vfs/qingstor/config.js.map +1 -1
  571. package/dist/vfs/qingstor/qingstor.d.ts +4 -5
  572. package/dist/vfs/qingstor/qingstor.d.ts.map +1 -1
  573. package/dist/vfs/qingstor/qingstor.js +2 -4
  574. package/dist/vfs/qingstor/qingstor.js.map +1 -1
  575. package/dist/vfs/r2/config.d.ts +39 -28
  576. package/dist/vfs/r2/config.d.ts.map +1 -1
  577. package/dist/vfs/r2/config.js +24 -48
  578. package/dist/vfs/r2/config.js.map +1 -1
  579. package/dist/vfs/r2/r2.d.ts +4 -5
  580. package/dist/vfs/r2/r2.d.ts.map +1 -1
  581. package/dist/vfs/r2/r2.js +2 -4
  582. package/dist/vfs/r2/r2.js.map +1 -1
  583. package/dist/vfs/redis/redis.d.ts +3 -0
  584. package/dist/vfs/redis/redis.d.ts.map +1 -1
  585. package/dist/vfs/redis/redis.js +1 -1
  586. package/dist/vfs/redis/redis.js.map +1 -1
  587. package/dist/vfs/redis/store.d.ts +2 -0
  588. package/dist/vfs/redis/store.d.ts.map +1 -1
  589. package/dist/vfs/redis/store.js +13 -2
  590. package/dist/vfs/redis/store.js.map +1 -1
  591. package/dist/vfs/registry.d.ts.map +1 -1
  592. package/dist/vfs/registry.js +111 -105
  593. package/dist/vfs/registry.js.map +1 -1
  594. package/dist/vfs/s3/config.d.ts +12 -23
  595. package/dist/vfs/s3/config.d.ts.map +1 -1
  596. package/dist/vfs/s3/config.js +16 -31
  597. package/dist/vfs/s3/config.js.map +1 -1
  598. package/dist/vfs/s3/s3.d.ts +6 -9
  599. package/dist/vfs/s3/s3.d.ts.map +1 -1
  600. package/dist/vfs/s3/s3.js +11 -14
  601. package/dist/vfs/s3/s3.js.map +1 -1
  602. package/dist/vfs/s3_alias.d.ts +69 -53
  603. package/dist/vfs/s3_alias.d.ts.map +1 -1
  604. package/dist/vfs/s3_alias.js +86 -82
  605. package/dist/vfs/s3_alias.js.map +1 -1
  606. package/dist/vfs/scaleway/config.d.ts +40 -6
  607. package/dist/vfs/scaleway/config.d.ts.map +1 -1
  608. package/dist/vfs/scaleway/config.js +5 -6
  609. package/dist/vfs/scaleway/config.js.map +1 -1
  610. package/dist/vfs/scaleway/scaleway.d.ts +4 -5
  611. package/dist/vfs/scaleway/scaleway.d.ts.map +1 -1
  612. package/dist/vfs/scaleway/scaleway.js +2 -4
  613. package/dist/vfs/scaleway/scaleway.js.map +1 -1
  614. package/dist/vfs/seaweedfs/config.d.ts +42 -5
  615. package/dist/vfs/seaweedfs/config.d.ts.map +1 -1
  616. package/dist/vfs/seaweedfs/config.js +7 -5
  617. package/dist/vfs/seaweedfs/config.js.map +1 -1
  618. package/dist/vfs/seaweedfs/seaweedfs.d.ts +4 -5
  619. package/dist/vfs/seaweedfs/seaweedfs.d.ts.map +1 -1
  620. package/dist/vfs/seaweedfs/seaweedfs.js +2 -4
  621. package/dist/vfs/seaweedfs/seaweedfs.js.map +1 -1
  622. package/dist/vfs/slack/slack.d.ts +7 -10
  623. package/dist/vfs/slack/slack.d.ts.map +1 -1
  624. package/dist/vfs/slack/slack.js +7 -12
  625. package/dist/vfs/slack/slack.js.map +1 -1
  626. package/dist/vfs/ssh/config.d.ts +5 -9
  627. package/dist/vfs/ssh/config.d.ts.map +1 -1
  628. package/dist/vfs/ssh/config.js +28 -18
  629. package/dist/vfs/ssh/config.js.map +1 -1
  630. package/dist/vfs/ssh/ssh.d.ts +8 -17
  631. package/dist/vfs/ssh/ssh.d.ts.map +1 -1
  632. package/dist/vfs/ssh/ssh.js +25 -43
  633. package/dist/vfs/ssh/ssh.js.map +1 -1
  634. package/dist/vfs/supabase/config.d.ts +40 -27
  635. package/dist/vfs/supabase/config.d.ts.map +1 -1
  636. package/dist/vfs/supabase/config.js +24 -48
  637. package/dist/vfs/supabase/config.js.map +1 -1
  638. package/dist/vfs/supabase/supabase.d.ts +4 -5
  639. package/dist/vfs/supabase/supabase.d.ts.map +1 -1
  640. package/dist/vfs/supabase/supabase.js +2 -4
  641. package/dist/vfs/supabase/supabase.js.map +1 -1
  642. package/dist/vfs/tencent/config.d.ts +40 -6
  643. package/dist/vfs/tencent/config.d.ts.map +1 -1
  644. package/dist/vfs/tencent/config.js +5 -6
  645. package/dist/vfs/tencent/config.js.map +1 -1
  646. package/dist/vfs/tencent/tencent.d.ts +4 -5
  647. package/dist/vfs/tencent/tencent.d.ts.map +1 -1
  648. package/dist/vfs/tencent/tencent.js +2 -4
  649. package/dist/vfs/tencent/tencent.js.map +1 -1
  650. package/dist/vfs/tidb_filesystem/config.d.ts +2 -0
  651. package/dist/vfs/tidb_filesystem/config.d.ts.map +1 -0
  652. package/dist/{mount/types.js → vfs/tidb_filesystem/config.js} +2 -2
  653. package/dist/vfs/tidb_filesystem/config.js.map +1 -0
  654. package/dist/vfs/tidb_filesystem/tidb_filesystem.d.ts +16 -0
  655. package/dist/vfs/tidb_filesystem/tidb_filesystem.d.ts.map +1 -0
  656. package/dist/vfs/tidb_filesystem/tidb_filesystem.js +39 -0
  657. package/dist/vfs/tidb_filesystem/tidb_filesystem.js.map +1 -0
  658. package/dist/vfs/wasabi/config.d.ts +35 -28
  659. package/dist/vfs/wasabi/config.d.ts.map +1 -1
  660. package/dist/vfs/wasabi/config.js +20 -45
  661. package/dist/vfs/wasabi/config.js.map +1 -1
  662. package/dist/vfs/wasabi/wasabi.d.ts +4 -5
  663. package/dist/vfs/wasabi/wasabi.d.ts.map +1 -1
  664. package/dist/vfs/wasabi/wasabi.js +2 -4
  665. package/dist/vfs/wasabi/wasabi.js.map +1 -1
  666. package/dist/workspace/{session → mount/namespace}/cas.lua +7 -2
  667. package/dist/workspace/mount/namespace/disk.d.ts +12 -7
  668. package/dist/workspace/mount/namespace/disk.d.ts.map +1 -1
  669. package/dist/workspace/mount/namespace/disk.js +37 -21
  670. package/dist/workspace/mount/namespace/disk.js.map +1 -1
  671. package/dist/workspace/mount/namespace/redis.d.ts +14 -9
  672. package/dist/workspace/mount/namespace/redis.d.ts.map +1 -1
  673. package/dist/workspace/mount/namespace/redis.js +29 -14
  674. package/dist/workspace/mount/namespace/redis.js.map +1 -1
  675. package/dist/workspace/nfs.d.ts.map +1 -1
  676. package/dist/workspace/nfs.js +3 -1
  677. package/dist/workspace/nfs.js.map +1 -1
  678. package/dist/workspace/record/disk.d.ts +12 -5
  679. package/dist/workspace/record/disk.d.ts.map +1 -1
  680. package/dist/workspace/record/disk.js +119 -72
  681. package/dist/workspace/record/disk.js.map +1 -1
  682. package/dist/workspace/store/disk.d.ts +12 -5
  683. package/dist/workspace/store/disk.d.ts.map +1 -1
  684. package/dist/workspace/store/disk.js +20 -4
  685. package/dist/workspace/store/disk.js.map +1 -1
  686. package/dist/workspace/store/redis.d.ts +13 -7
  687. package/dist/workspace/store/redis.d.ts.map +1 -1
  688. package/dist/workspace/store/redis.js +53 -26
  689. package/dist/workspace/store/redis.js.map +1 -1
  690. package/dist/workspace.d.ts +3 -1
  691. package/dist/workspace.d.ts.map +1 -1
  692. package/dist/workspace.js +22 -21
  693. package/dist/workspace.js.map +1 -1
  694. package/package.json +13 -17
  695. package/dist/compression_codecs.d.ts +0 -2
  696. package/dist/compression_codecs.d.ts.map +0 -1
  697. package/dist/compression_codecs.js +0 -42
  698. package/dist/compression_codecs.js.map +0 -1
  699. package/dist/core/disk/append.d.ts +0 -4
  700. package/dist/core/disk/append.d.ts.map +0 -1
  701. package/dist/core/disk/append.js +0 -30
  702. package/dist/core/disk/append.js.map +0 -1
  703. package/dist/mount/core.d.ts +0 -313
  704. package/dist/mount/core.d.ts.map +0 -1
  705. package/dist/mount/core.js +0 -915
  706. package/dist/mount/core.js.map +0 -1
  707. package/dist/mount/platform/macos.d.ts +0 -2
  708. package/dist/mount/platform/macos.d.ts.map +0 -1
  709. package/dist/mount/platform/macos.js +0 -23
  710. package/dist/mount/platform/macos.js.map +0 -1
  711. package/dist/mount/types.d.ts +0 -37
  712. package/dist/mount/types.d.ts.map +0 -1
  713. package/dist/mount/types.js.map +0 -1
  714. package/dist/observe/redis_store.d.ts +0 -27
  715. package/dist/observe/redis_store.d.ts.map +0 -1
  716. package/dist/observe/redis_store.js +0 -81
  717. package/dist/observe/redis_store.js.map +0 -1
  718. package/dist/runtime/sandbox/cli.d.ts +0 -56
  719. package/dist/runtime/sandbox/cli.d.ts.map +0 -1
  720. package/dist/runtime/sandbox/cli.js +0 -260
  721. package/dist/runtime/sandbox/cli.js.map +0 -1
  722. package/dist/runtime/sandbox/ssh/constants.d.ts +0 -12
  723. package/dist/runtime/sandbox/ssh/constants.d.ts.map +0 -1
  724. package/dist/runtime/sandbox/ssh/constants.js +0 -32
  725. package/dist/runtime/sandbox/ssh/constants.js.map +0 -1
  726. package/dist/vfs/aliyun/prompt.d.ts +0 -2
  727. package/dist/vfs/aliyun/prompt.d.ts.map +0 -1
  728. package/dist/vfs/aliyun/prompt.js +0 -19
  729. package/dist/vfs/aliyun/prompt.js.map +0 -1
  730. package/dist/vfs/backblaze/prompt.d.ts +0 -2
  731. package/dist/vfs/backblaze/prompt.d.ts.map +0 -1
  732. package/dist/vfs/backblaze/prompt.js +0 -19
  733. package/dist/vfs/backblaze/prompt.js.map +0 -1
  734. package/dist/vfs/ceph/prompt.d.ts +0 -2
  735. package/dist/vfs/ceph/prompt.d.ts.map +0 -1
  736. package/dist/vfs/ceph/prompt.js +0 -19
  737. package/dist/vfs/ceph/prompt.js.map +0 -1
  738. package/dist/vfs/digitalocean/prompt.d.ts +0 -2
  739. package/dist/vfs/digitalocean/prompt.d.ts.map +0 -1
  740. package/dist/vfs/digitalocean/prompt.js +0 -19
  741. package/dist/vfs/digitalocean/prompt.js.map +0 -1
  742. package/dist/vfs/disk/prompt.d.ts +0 -2
  743. package/dist/vfs/disk/prompt.d.ts.map +0 -1
  744. package/dist/vfs/disk/prompt.js +0 -17
  745. package/dist/vfs/disk/prompt.js.map +0 -1
  746. package/dist/vfs/email/prompt.d.ts +0 -3
  747. package/dist/vfs/email/prompt.d.ts.map +0 -1
  748. package/dist/vfs/email/prompt.js +0 -29
  749. package/dist/vfs/email/prompt.js.map +0 -1
  750. package/dist/vfs/gcs/prompt.d.ts +0 -2
  751. package/dist/vfs/gcs/prompt.d.ts.map +0 -1
  752. package/dist/vfs/gcs/prompt.js +0 -19
  753. package/dist/vfs/gcs/prompt.js.map +0 -1
  754. package/dist/vfs/gridfs/prompt.d.ts +0 -2
  755. package/dist/vfs/gridfs/prompt.d.ts.map +0 -1
  756. package/dist/vfs/gridfs/prompt.js +0 -19
  757. package/dist/vfs/gridfs/prompt.js.map +0 -1
  758. package/dist/vfs/hf_buckets/prompt.d.ts +0 -2
  759. package/dist/vfs/hf_buckets/prompt.d.ts.map +0 -1
  760. package/dist/vfs/hf_buckets/prompt.js +0 -18
  761. package/dist/vfs/hf_buckets/prompt.js.map +0 -1
  762. package/dist/vfs/hf_datasets/prompt.d.ts +0 -2
  763. package/dist/vfs/hf_datasets/prompt.d.ts.map +0 -1
  764. package/dist/vfs/hf_datasets/prompt.js +0 -18
  765. package/dist/vfs/hf_datasets/prompt.js.map +0 -1
  766. package/dist/vfs/hf_models/prompt.d.ts +0 -2
  767. package/dist/vfs/hf_models/prompt.d.ts.map +0 -1
  768. package/dist/vfs/hf_models/prompt.js +0 -18
  769. package/dist/vfs/hf_models/prompt.js.map +0 -1
  770. package/dist/vfs/hf_spaces/prompt.d.ts +0 -2
  771. package/dist/vfs/hf_spaces/prompt.d.ts.map +0 -1
  772. package/dist/vfs/hf_spaces/prompt.js +0 -18
  773. package/dist/vfs/hf_spaces/prompt.js.map +0 -1
  774. package/dist/vfs/jaeger/config.d.ts +0 -15
  775. package/dist/vfs/jaeger/config.d.ts.map +0 -1
  776. package/dist/vfs/jaeger/config.js +0 -28
  777. package/dist/vfs/jaeger/config.js.map +0 -1
  778. package/dist/vfs/minio/prompt.d.ts +0 -2
  779. package/dist/vfs/minio/prompt.d.ts.map +0 -1
  780. package/dist/vfs/minio/prompt.js +0 -19
  781. package/dist/vfs/minio/prompt.js.map +0 -1
  782. package/dist/vfs/nextcloud/prompt.d.ts +0 -2
  783. package/dist/vfs/nextcloud/prompt.d.ts.map +0 -1
  784. package/dist/vfs/nextcloud/prompt.js +0 -6
  785. package/dist/vfs/nextcloud/prompt.js.map +0 -1
  786. package/dist/vfs/oci/prompt.d.ts +0 -2
  787. package/dist/vfs/oci/prompt.d.ts.map +0 -1
  788. package/dist/vfs/oci/prompt.js +0 -19
  789. package/dist/vfs/oci/prompt.js.map +0 -1
  790. package/dist/vfs/qingstor/prompt.d.ts +0 -2
  791. package/dist/vfs/qingstor/prompt.d.ts.map +0 -1
  792. package/dist/vfs/qingstor/prompt.js +0 -19
  793. package/dist/vfs/qingstor/prompt.js.map +0 -1
  794. package/dist/vfs/r2/prompt.d.ts +0 -2
  795. package/dist/vfs/r2/prompt.d.ts.map +0 -1
  796. package/dist/vfs/r2/prompt.js +0 -19
  797. package/dist/vfs/r2/prompt.js.map +0 -1
  798. package/dist/vfs/scaleway/prompt.d.ts +0 -2
  799. package/dist/vfs/scaleway/prompt.d.ts.map +0 -1
  800. package/dist/vfs/scaleway/prompt.js +0 -19
  801. package/dist/vfs/scaleway/prompt.js.map +0 -1
  802. package/dist/vfs/seaweedfs/prompt.d.ts +0 -2
  803. package/dist/vfs/seaweedfs/prompt.d.ts.map +0 -1
  804. package/dist/vfs/seaweedfs/prompt.js +0 -19
  805. package/dist/vfs/seaweedfs/prompt.js.map +0 -1
  806. package/dist/vfs/ssh/prompt.d.ts +0 -2
  807. package/dist/vfs/ssh/prompt.d.ts.map +0 -1
  808. package/dist/vfs/ssh/prompt.js +0 -18
  809. package/dist/vfs/ssh/prompt.js.map +0 -1
  810. package/dist/vfs/supabase/prompt.d.ts +0 -2
  811. package/dist/vfs/supabase/prompt.d.ts.map +0 -1
  812. package/dist/vfs/supabase/prompt.js +0 -19
  813. package/dist/vfs/supabase/prompt.js.map +0 -1
  814. package/dist/vfs/tencent/prompt.d.ts +0 -2
  815. package/dist/vfs/tencent/prompt.d.ts.map +0 -1
  816. package/dist/vfs/tencent/prompt.js +0 -19
  817. package/dist/vfs/tencent/prompt.js.map +0 -1
  818. package/dist/vfs/wasabi/prompt.d.ts +0 -2
  819. package/dist/vfs/wasabi/prompt.d.ts.map +0 -1
  820. package/dist/vfs/wasabi/prompt.js +0 -19
  821. package/dist/vfs/wasabi/prompt.js.map +0 -1
  822. package/dist/workspace/session/disk.d.ts +0 -13
  823. package/dist/workspace/session/disk.d.ts.map +0 -1
  824. package/dist/workspace/session/disk.js +0 -29
  825. package/dist/workspace/session/disk.js.map +0 -1
  826. package/dist/workspace/session/redis.d.ts +0 -31
  827. package/dist/workspace/session/redis.d.ts.map +0 -1
  828. package/dist/workspace/session/redis.js +0 -87
  829. package/dist/workspace/session/redis.js.map +0 -1
@@ -12,23 +12,36 @@
12
12
  // limitations under the License.
13
13
  // ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========
14
14
  import { Buffer } from 'node:buffer';
15
+ import { randomBytes } from 'node:crypto';
15
16
  import { constants } from 'node:fs';
16
17
  import { createRequire } from 'node:module';
17
18
  import { posix } from 'node:path';
19
+ import { createInterface } from 'node:readline';
18
20
  import { fileURLToPath } from 'node:url';
19
21
  import { classify } from '@struktoai/mirage-core/errors/classify';
20
22
  import { ebadf, einval, isMissingPath } from '@struktoai/mirage-core/errors/fs';
21
23
  import { posixErrno, posixPhrase } from '@struktoai/mirage-core/errors/posix';
24
+ import { linkView } from '@struktoai/mirage-core/commands/builtin/utils/links';
22
25
  import { workspaceBridge } from '@struktoai/mirage-core/runtime/binding';
26
+ import { MountCore } from '@struktoai/mirage-core/mount/core';
23
27
  import { RuntimeFiles } from '@struktoai/mirage-core/runtime/files';
28
+ import { openMode } from '@struktoai/mirage-core/runtime/handles/mode';
24
29
  import { posixStat } from '@struktoai/mirage-core/runtime/stat';
25
30
  import { PrefixResolver } from '@struktoai/mirage-core/runtime/resolver';
26
31
  import { MountMode } from '@struktoai/mirage-core/types';
32
+ import { MAX_SYMLINK_HOPS } from '@struktoai/mirage-core/utils/path';
27
33
  import { entryName } from '@struktoai/mirage-core/utils/remnants';
34
+ import { pathMode } from '@struktoai/mirage-core/workspace/files';
28
35
  import { DESCRIPTOR_CALLS, LISTENED_CALLS, PATH_ARGS, REFUSED_CALLS, ROUTED_CALLS, } from "./constants.js";
29
- import { Descriptors, openFlags, readAt, readOn } from "./descriptors.js";
36
+ import { Descriptors, openFlags } from "./descriptors.js";
37
+ import { dirent, openedDir } from "./list.js";
38
+ import { stats } from "./stat.js";
30
39
  const fs = createRequire(import.meta.url)('node:fs');
31
- const { S_IFMT, S_IFREG, S_IFDIR, S_IFCHR, S_IFLNK, W_OK, X_OK, COPYFILE_EXCL } = constants;
40
+ // fs.promises as the patch leaves it, each call looked up when it is
41
+ // made: a call on it reaches node for a host path and the workspace for
42
+ // a mounted one, so a cp or glob across the two takes each end where it is.
43
+ const routed = fs.promises;
44
+ const { W_OK, X_OK, COPYFILE_EXCL } = constants;
32
45
  /** `path` as a string a mount could serve, or null: a descriptor and a
33
46
  * Buffer are host spellings no mount uses. */
34
47
  function spelled(path) {
@@ -38,10 +51,6 @@ function spelled(path) {
38
51
  return fileURLToPath(path);
39
52
  return null;
40
53
  }
41
- /** A stamp in nanoseconds, as node's BigIntStats spells one. */
42
- function ns(date) {
43
- return BigInt(date.getTime()) * 1000000n;
44
- }
45
54
  /** A refusal spelled the way node's own fs spells an error. */
46
55
  function refusal(condition, syscall, path) {
47
56
  const err = new Error(`${condition}: ${posixPhrase(condition).toLowerCase()}, ${syscall} '${path}'`);
@@ -72,11 +81,44 @@ function syncRefusal(name, path) {
72
81
  function fieldsOf(options) {
73
82
  return typeof options === 'object' && options !== null ? options : {};
74
83
  }
84
+ /** The mode a node call asks for: its number, its octal text, or the
85
+ * `mode` of its options. */
86
+ function modeOf(options) {
87
+ const mode = typeof options === 'object' ? fieldsOf(options).mode : options;
88
+ if (typeof mode === 'number')
89
+ return mode;
90
+ return typeof mode === 'string' ? parseInt(mode, 8) : undefined;
91
+ }
75
92
  function encodingOf(options) {
76
93
  if (typeof options === 'string')
77
94
  return options;
78
95
  return (fieldsOf(options).encoding ?? undefined);
79
96
  }
97
+ /** A name as node answers one: a string, or a Buffer or another
98
+ * encoding where the options ask for it. */
99
+ function encoded(text, options) {
100
+ const encoding = encodingOf(options);
101
+ if (encoding === undefined || encoding === 'utf8')
102
+ return text;
103
+ const bytes = Buffer.from(text);
104
+ return encoding === 'buffer' ? bytes : bytes.toString(encoding);
105
+ }
106
+ /** One of node's own `cp` refusals (`ERR_FS_CP_*`), spelled as node spells it. */
107
+ function cpRefusal(code, title, condition, detail, path) {
108
+ return Object.assign(new Error(`${title}: cp returned ${condition} (${detail}) ${path}`), {
109
+ code,
110
+ errno: posixErrno(condition),
111
+ syscall: 'cp',
112
+ path,
113
+ });
114
+ }
115
+ /** Six characters from the alphabet of node's `mkdtemp` template. */
116
+ function tempSuffix() {
117
+ const alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
118
+ return Array.from(randomBytes(6), (byte) => alphabet[byte % alphabet.length]).join('');
119
+ }
120
+ // A path segment holding a character node's glob matcher reads as one.
121
+ const GLOB_MAGIC = /[*?[\]{}()!+@]/;
80
122
  function bytesOf(data, options) {
81
123
  if (typeof data === 'string')
82
124
  return Buffer.from(data, encodingOf(options) ?? 'utf8');
@@ -94,6 +136,13 @@ function refusedIterator(err) {
94
136
  },
95
137
  };
96
138
  }
139
+ /** Every item an async iterator yields. */
140
+ async function collected(items) {
141
+ const out = [];
142
+ for await (const item of items)
143
+ out.push(item);
144
+ return out;
145
+ }
97
146
  /** A time argument (seconds, a numeric string, a Date) as the ISO stamp
98
147
  * setattr stores. */
99
148
  function stampOf(time) {
@@ -257,6 +306,13 @@ class MountedFileHandle {
257
306
  throw ebadf(String(this.fd));
258
307
  return fs.createWriteStream(null, { ...fieldsOf(options), fd: this.fd });
259
308
  }
309
+ // node's own reads its lines through createReadStream, as this does.
310
+ readLines(options) {
311
+ return createInterface({
312
+ input: this.createReadStream(options),
313
+ crlfDelay: Infinity,
314
+ });
315
+ }
260
316
  }
261
317
  /**
262
318
  * Every routed fs call, answered on a mount: python's `HostFs` for
@@ -280,22 +336,27 @@ class HostFs {
280
336
  constructor(ws, native) {
281
337
  this.ws = ws;
282
338
  this.native = native;
283
- this.files = new RuntimeFiles(workspaceBridge(async (name, path, args, kwargs) => {
339
+ // An op that fails with no condition (an upstream 502 a REST mount
340
+ // throws as it came) answers EIO, the kernel's word for a device that
341
+ // failed, as a guest's file adapter does; the original rides along as
342
+ // the cause.
343
+ const dispatch = async (name, path, args, kwargs, report) => {
284
344
  try {
285
- const [value] = await ws.vfs.dispatch(name, path, args, kwargs);
286
- return value;
345
+ return await ws.vfs.dispatch(name, path, args, kwargs, report);
287
346
  }
288
347
  catch (err) {
289
348
  if (classify(err) !== null)
290
349
  throw err;
291
- // An op that fails with no condition (an upstream 502 a REST
292
- // mount throws as it came) answers EIO, the kernel's word for a
293
- // device that failed, as a guest's file adapter does; the original
294
- // rides along as the cause.
295
- throw Object.assign(refusal('EIO', name, path), { cause: err });
350
+ throw Object.assign(refusal('EIO', name, typeof path === 'string' ? path : path.virtual), {
351
+ cause: err,
352
+ });
296
353
  }
297
- }), new PrefixResolver(() => [], (directory) => ws.namespace.linkNamesUnder(directory)));
298
- this.descriptors = new Descriptors(this.files, native, ws.namespace);
354
+ };
355
+ // Where a link leads, so a file reads as one inode whichever spelling
356
+ // reached it.
357
+ const links = linkView(ws.vfs);
358
+ this.files = new RuntimeFiles(workspaceBridge(async (name, path, args, kwargs) => (await dispatch(name, path, args, kwargs))[0]), new PrefixResolver(() => [], (directory) => ws.namespace.linkNamesUnder(directory)), links === undefined ? null : links.resolve.bind(links), new MountCore(ws.vfs.over(dispatch)));
359
+ this.descriptors = new Descriptors(this.files, native);
299
360
  }
300
361
  /** Whether `path` is under a mount the patch answers for. The synthetic
301
362
  * root anchor matches every path but backs no files, so a path only it
@@ -314,80 +375,35 @@ class HostFs {
314
375
  statsOf(path, st, options, unlinked = false) {
315
376
  // The stat every runtime shares; an owner the row lacks is this
316
377
  // process's own.
317
- const posix = posixStat(st, path, this.ws.registry.tryMountFor(path)?.prefix ?? '/', {
378
+ // The file the links lead to names both its inode and its device, so a
379
+ // stat through a link and the fstat of its open file agree.
380
+ const named = st.name ?? path;
381
+ const posix = posixStat(st, named, this.ws.registry.tryMountFor(named)?.prefix ?? '/', {
318
382
  uid: process.getuid?.() ?? 0,
319
383
  gid: process.getgid?.() ?? 0,
320
384
  unknownMs: this.born,
321
385
  });
322
- const kind = posix.mode & S_IFMT;
323
- const mtime = new Date(posix.mtimeMs);
324
- const atime = new Date(posix.atimeMs);
325
- const kinds = {
326
- isFile: () => kind === S_IFREG,
327
- isDirectory: () => kind === S_IFDIR,
328
- isBlockDevice: () => false,
329
- isCharacterDevice: () => kind === S_IFCHR,
330
- isSymbolicLink: () => kind === S_IFLNK,
331
- isFIFO: () => false,
332
- isSocket: () => false,
333
- };
334
- const dates = { atime, mtime, ctime: mtime, birthtime: mtime };
335
- const fields = {
336
- dev: posix.dev,
337
- ino: posix.ino,
338
- mode: posix.mode,
339
- nlink: unlinked ? 0 : posix.nlink,
340
- uid: posix.uid,
341
- gid: posix.gid,
342
- rdev: posix.rdev,
343
- size: posix.size,
344
- blksize: posix.blksize,
345
- blocks: posix.blocks,
346
- atimeMs: posix.atimeMs,
347
- mtimeMs: posix.mtimeMs,
348
- ctimeMs: posix.ctimeMs,
349
- birthtimeMs: posix.mtimeMs,
350
- };
351
- if (fieldsOf(options).bigint !== true)
352
- return { ...kinds, ...fields, ...dates };
353
- // node's BigIntStats: every number a bigint, plus the stamps in ns.
354
- const big = Object.fromEntries(Object.entries(fields).map(([k, v]) => [k, BigInt(Math.trunc(v))]));
355
- return {
356
- ...kinds,
357
- ...big,
358
- atimeNs: ns(atime),
359
- mtimeNs: ns(mtime),
360
- ctimeNs: ns(mtime),
361
- birthtimeNs: ns(mtime),
362
- ...dates,
363
- };
386
+ return stats(unlinked ? { ...posix, nlink: 0 } : posix, fieldsOf(options).bigint === true);
364
387
  }
365
- direntOf(directory, row) {
366
- const kind = row.isLink === true ? S_IFLNK : row.isDir ? S_IFDIR : (row.mode ?? 0) & S_IFMT;
367
- return {
368
- name: entryName(row.path),
369
- parentPath: directory,
370
- path: directory,
371
- isFile: () => kind === S_IFREG,
372
- isDirectory: () => kind === S_IFDIR,
373
- isBlockDevice: () => false,
374
- isCharacterDevice: () => kind === S_IFCHR,
375
- isSymbolicLink: () => kind === S_IFLNK,
376
- isFIFO: () => false,
377
- isSocket: () => false,
378
- };
388
+ /**
389
+ * Whether a write at `path` would be admitted by mode: the mode the write
390
+ * itself meets (`pathMode`). Mirrors Python's `_writable`.
391
+ */
392
+ async writable(path) {
393
+ const mode = await pathMode(this.ws.vfs, path);
394
+ return mode !== null && mode !== MountMode.READ;
379
395
  }
380
396
  nativeCall(name, ...args) {
381
397
  return this.native.promises[name](...args);
382
398
  }
383
399
  async access(path, mode = 0) {
384
400
  const st = await this.files.stat(path);
385
- // Write is the mount's mode, mirage's access control; a session's own
386
- // narrower grant answers when the write happens, as POSIX leaves
387
- // access(2) advisory. Execute is the one question the bits answer.
388
- if (mode & W_OK && this.ws.registry.tryMountFor(path)?.mode === MountMode.READ) {
401
+ // Write is the mode in force at the path for the session, mirage's
402
+ // access control: W_OK answers what the write itself would meet, as
403
+ // access(2) refuses a write on a read-only file system. Execute is the
404
+ // one question the bits answer.
405
+ if (mode & W_OK && !(await this.writable(path)))
389
406
  throw refusal('EACCES', 'access', path);
390
- }
391
407
  if (mode & X_OK && (st.mode & 0o111) === 0)
392
408
  throw refusal('EACCES', 'access', path);
393
409
  }
@@ -458,6 +474,7 @@ class HostFs {
458
474
  async mkdir(path, options) {
459
475
  if (fieldsOf(options).recursive !== true) {
460
476
  await this.files.mkdir(path);
477
+ await this.narrowed(path, modeOf(options));
461
478
  return undefined;
462
479
  }
463
480
  // Each missing ancestor in turn, stopping at the mount root, as
@@ -481,6 +498,362 @@ class HostFs {
481
498
  await this.files.mkdir(dir);
482
499
  return missing[0];
483
500
  }
501
+ async cp(src, dst, options) {
502
+ const opts = fieldsOf(options);
503
+ const filter = opts.filter;
504
+ if (filter !== undefined && !(await filter(src, dst)))
505
+ return;
506
+ const from = await this.checked(src, dst, opts);
507
+ // node makes the destination's missing parents first.
508
+ const parent = posix.dirname(posix.resolve(dst));
509
+ try {
510
+ await routed.stat(parent);
511
+ }
512
+ catch (err) {
513
+ if (!isMissingPath(err))
514
+ throw err;
515
+ await routed.mkdir(parent, { recursive: true });
516
+ }
517
+ await this.copied(src, dst, from, opts);
518
+ }
519
+ /** Narrow a directory just made to the permissions `mode` asks for, as
520
+ * mkdir(2) does: its own are what the umask left of 0o777, so the two
521
+ * together are what mkdir(2) leaves of `mode`, and a bit it inherited
522
+ * (a parent's set-group-ID) stays. A mode asking all of 0o777 needs no
523
+ * lookup, and one the workspace refuses leaves the directory as made. */
524
+ async narrowed(path, mode) {
525
+ if (mode === undefined || (mode & 0o777) === 0o777)
526
+ return;
527
+ let own;
528
+ try {
529
+ own = (await this.files.stat(path)).mode & 0o7777;
530
+ }
531
+ catch (err) {
532
+ const condition = classify(err);
533
+ if (condition !== 'EACCES' && condition !== 'EPERM')
534
+ throw err;
535
+ console.debug(`mkdir: ${path} keeps the mode it was made with: ${String(err)}`);
536
+ return;
537
+ }
538
+ const narrow = (own & ~0o777) | (own & mode & 0o777);
539
+ if (narrow !== own)
540
+ await this.files.setattr(path, { mode: narrow });
541
+ }
542
+ /** Whether the link at `path` leads to a directory; a dangling one
543
+ * leads nowhere. */
544
+ async linksToDirectory(path) {
545
+ try {
546
+ return (await this.entryOf(path, true)).isDirectory();
547
+ }
548
+ catch (err) {
549
+ if (!isMissingPath(err))
550
+ throw err;
551
+ return false;
552
+ }
553
+ }
554
+ /** The source's entry once the pair passes the checks node's `cp`
555
+ * makes of every pair it copies: two names for one file (a link that
556
+ * makes them one is caught as one spelling is), a directory without
557
+ * `recursive`, and a directory into itself. */
558
+ async checked(src, dst, opts) {
559
+ const follow = opts.dereference === true;
560
+ const [source, target] = [await this.identity(src, follow), await this.identity(dst, follow)];
561
+ if (source === target) {
562
+ throw cpRefusal('ERR_FS_CP_EINVAL', 'Invalid src or dest', 'EINVAL', 'src and dest cannot be the same', dst);
563
+ }
564
+ const from = await this.entryOf(src, follow);
565
+ if (from.isDirectory()) {
566
+ if (opts.recursive !== true) {
567
+ throw cpRefusal('ERR_FS_EISDIR', 'Path is a directory', 'EISDIR', `${src} is a directory (not copied)`, src);
568
+ }
569
+ if (target.startsWith(`${source}/`)) {
570
+ throw cpRefusal('ERR_FS_CP_EINVAL', 'Invalid src or dest', 'EINVAL', `cannot copy ${src} to a subdirectory of self ${dst}`, dst);
571
+ }
572
+ }
573
+ return from;
574
+ }
575
+ /** The file `path` names once its links are followed, as node's `cp`
576
+ * tells two files apart: its directories always, its last name when
577
+ * `follow`, and a name not there as it is spelled. */
578
+ async identity(path, follow) {
579
+ const absolute = posix.resolve(path);
580
+ if (absolute === '/')
581
+ return absolute;
582
+ if (follow) {
583
+ try {
584
+ return await routed.realpath(absolute);
585
+ }
586
+ catch (err) {
587
+ if (!isMissingPath(err))
588
+ throw err;
589
+ }
590
+ }
591
+ return posix.join(await this.identity(posix.dirname(absolute), true), posix.basename(absolute));
592
+ }
593
+ /** A path's own entry, or its target's, through the patched calls, so
594
+ * a host path reaches node and a mounted one the workspace. */
595
+ entryOf(path, follow) {
596
+ return follow ? routed.stat(path) : routed.lstat(path);
597
+ }
598
+ /** One entry of a `cp` and what is under it, as node's own copies it:
599
+ * a name already there is replaced unless `force` is off, and a link
600
+ * keeps its target, a relative one resolved against where it was. */
601
+ async copied(src, dst, from, opts) {
602
+ let to = null;
603
+ try {
604
+ // `dereference` follows a link on either side, as node's does.
605
+ to = await this.entryOf(dst, opts.dereference === true);
606
+ }
607
+ catch (err) {
608
+ if (!isMissingPath(err))
609
+ throw err;
610
+ }
611
+ if (from.isDirectory()) {
612
+ if (to !== null && !to.isDirectory()) {
613
+ throw cpRefusal('ERR_FS_CP_DIR_TO_NON_DIR', 'Cannot overwrite non-directory with directory', 'EISDIR', `cannot overwrite non-directory ${dst} with directory ${src}`, dst);
614
+ }
615
+ if (to === null)
616
+ await routed.mkdir(dst);
617
+ const filter = opts.filter;
618
+ for (const name of await routed.readdir(src)) {
619
+ const [child, target] = [posix.join(src, name), posix.join(dst, name)];
620
+ if (filter !== undefined && !(await filter(child, target)))
621
+ continue;
622
+ await this.copied(child, target, await this.checked(child, target, opts), opts);
623
+ }
624
+ // A directory it made takes the source's mode, once its entries are in.
625
+ if (to === null)
626
+ await routed.chmod(dst, from.mode & 0o7777);
627
+ return;
628
+ }
629
+ if (to?.isDirectory() === true) {
630
+ throw cpRefusal('ERR_FS_CP_NON_DIR_TO_DIR', 'Cannot overwrite directory with non-directory', 'ENOTDIR', `cannot overwrite directory ${dst} with non-directory ${src}`, dst);
631
+ }
632
+ if (from.isSymbolicLink()) {
633
+ const target = await routed.readlink(src);
634
+ const kept = opts.verbatimSymlinks === true || posix.isAbsolute(target)
635
+ ? target
636
+ : posix.resolve(posix.dirname(src), target);
637
+ // A link replaces a link there, whatever `force` says, unless one
638
+ // leads into the other's directory; onto any other entry the
639
+ // symlink itself refuses the name, as node's does.
640
+ if (to?.isSymbolicLink() === true) {
641
+ const there = await routed.readlink(dst);
642
+ const leads = posix.resolve(kept);
643
+ const led = posix.isAbsolute(there) ? there : posix.resolve(posix.dirname(dst), there);
644
+ if ((await this.entryOf(src, true)).isDirectory()) {
645
+ if (led === leads || led.startsWith(`${leads}/`)) {
646
+ throw cpRefusal('ERR_FS_CP_EINVAL', 'Invalid src or dest', 'EINVAL', `cannot copy ${kept} to a subdirectory of self ${led}`, dst);
647
+ }
648
+ if (leads.startsWith(`${led}/`)) {
649
+ throw cpRefusal('ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY', 'Cannot overwrite symlink in subdirectory of self', 'EINVAL', `cannot overwrite ${led} with ${kept}`, dst);
650
+ }
651
+ }
652
+ await routed.unlink(dst);
653
+ }
654
+ await routed.symlink(kept, dst);
655
+ return;
656
+ }
657
+ if (!from.isFile() && !from.isCharacterDevice() && !from.isBlockDevice()) {
658
+ const [code, kind] = from.isSocket()
659
+ ? ['ERR_FS_CP_SOCKET', 'a socket file']
660
+ : from.isFIFO()
661
+ ? ['ERR_FS_CP_FIFO_PIPE', 'a FIFO pipe']
662
+ : ['ERR_FS_CP_UNKNOWN', 'an unknown file type'];
663
+ throw cpRefusal(code, `Cannot copy ${kind}`, 'EINVAL', `cannot copy ${kind}: ${dst}`, dst);
664
+ }
665
+ if (to !== null) {
666
+ if (opts.force === false) {
667
+ if (opts.errorOnExist !== true)
668
+ return;
669
+ throw cpRefusal('ERR_FS_CP_EEXIST', 'Target already exists', 'EEXIST', `${dst} already exists`, dst);
670
+ }
671
+ await routed.unlink(dst);
672
+ }
673
+ await routed.copyFile(src, dst, typeof opts.mode === 'number' ? opts.mode : 0);
674
+ if (opts.preserveTimestamps === true)
675
+ await routed.utimes(dst, from.atime, from.mtime);
676
+ await routed.chmod(dst, from.mode & 0o7777);
677
+ }
678
+ /** The names `pattern` matches, as node's `fs.promises.glob` yields
679
+ * them: by node's own matcher, under the part of the pattern that has
680
+ * no wildcard, relative to `cwd` for a relative pattern. */
681
+ async *glob(pattern, options) {
682
+ const opts = fieldsOf(options);
683
+ const cwd = spelled(opts.cwd) ?? process.cwd();
684
+ const exclude = opts.exclude;
685
+ const typed = opts.withFileTypes === true;
686
+ const follow = opts.followSymlinks === true;
687
+ const seen = new Set();
688
+ for (const raw of Array.isArray(pattern) ? pattern : [pattern]) {
689
+ const spelling = spelled(raw);
690
+ if (spelling === null)
691
+ continue;
692
+ const spelt = posix.isAbsolute(spelling)
693
+ ? posix.normalize(spelling)
694
+ : posix.join(cwd, spelling);
695
+ // A trailing slash asks for directories, named without it.
696
+ const directories = spelt.length > 1 && spelt.endsWith('/');
697
+ const absolute = directories ? spelt.slice(0, -1) : spelt;
698
+ const shown = (path) => posix.isAbsolute(spelling) ? path : posix.relative(cwd, path) || '.';
699
+ const parts = absolute.split('/').slice(1);
700
+ const magic = parts.findIndex((part) => GLOB_MAGIC.test(part));
701
+ const base = `/${parts.slice(0, magic === -1 ? parts.length : magic).join('/')}`;
702
+ const rest = magic === -1 ? '' : parts.slice(magic).join('/');
703
+ // A `**` that is a whole name, inside braces too, may match at any
704
+ // depth; within a name (`foo**`) it is a `*`.
705
+ const depth = /(^|[/{,])\*\*($|[/},])/.test(rest) ? Infinity : rest.split('/').length;
706
+ // An exclusion is matched from `cwd` and from the root alike,
707
+ // whichever way the pattern is spelled, as node matches it.
708
+ const skipped = (path, named, entry) => {
709
+ if (typeof exclude === 'function')
710
+ return Boolean(exclude(typed ? entry : named));
711
+ const spellings = [path, posix.relative(cwd, path) || '.'];
712
+ return (Array.isArray(exclude) &&
713
+ exclude.some((ex) => spellings.some((name) => posix.matchesGlob(name, String(ex)))));
714
+ };
715
+ let top;
716
+ try {
717
+ top = await this.entryOf(base, true);
718
+ }
719
+ catch (err) {
720
+ if (!isMissingPath(err))
721
+ throw err;
722
+ continue;
723
+ }
724
+ const baseEntry = {
725
+ name: posix.basename(base),
726
+ parentPath: posix.dirname(base),
727
+ path: posix.dirname(base),
728
+ isFile: () => top.isFile(),
729
+ isDirectory: () => top.isDirectory(),
730
+ isBlockDevice: () => false,
731
+ isCharacterDevice: () => false,
732
+ isSymbolicLink: () => false,
733
+ isFIFO: () => false,
734
+ isSocket: () => false,
735
+ };
736
+ // Each entry carries the directories its branch went through, by
737
+ // where their links lead, so a followed link never walks into one
738
+ // of them again, as node's walk does.
739
+ const pending = [[base, '', 0, baseEntry, []]];
740
+ for (let next = pending.shift(); next !== undefined; next = pending.shift()) {
741
+ const [path, relative, level, entry, walked] = next;
742
+ const named = shown(path);
743
+ // An excluded name is left out with all under it, the base too.
744
+ if (skipped(path, named, entry))
745
+ continue;
746
+ const kind = entry;
747
+ // `followSymlinks` takes a link to a directory as one.
748
+ const isDirectory = kind.isDirectory() ||
749
+ (follow && kind.isSymbolicLink() && (await this.linksToDirectory(path)));
750
+ if ((magic === -1 ? relative === '' : posix.matchesGlob(relative, rest)) &&
751
+ (!directories || isDirectory) &&
752
+ !seen.has(named)) {
753
+ seen.add(named);
754
+ yield typed ? entry : named;
755
+ }
756
+ if (magic === -1 || !isDirectory || level >= depth)
757
+ continue;
758
+ // A mounted directory's name is where the namespace's links lead,
759
+ // which needs no lookup; a host one is node's own realpath.
760
+ const real = !follow
761
+ ? path
762
+ : this.mounted(path)
763
+ ? this.files.walked(path)
764
+ : await routed.realpath(path);
765
+ if (follow && walked.includes(real))
766
+ continue;
767
+ const branch = follow ? [...walked, real] : walked;
768
+ const children = (await routed.readdir(path, { withFileTypes: true }));
769
+ for (const child of children) {
770
+ const childPath = posix.join(path, child.name);
771
+ pending.push([
772
+ childPath,
773
+ relative === '' ? child.name : `${relative}/${child.name}`,
774
+ child.isSymbolicLink() && !follow ? depth : level + 1,
775
+ child,
776
+ branch,
777
+ ]);
778
+ }
779
+ }
780
+ }
781
+ }
782
+ async mkdtemp(prefix, options) {
783
+ // A prefix whose names fall outside the mount (`/data` makes
784
+ // `/dataXXXXXX`) is the host's.
785
+ if (!this.mounted(`${prefix}XXXXXX`))
786
+ return this.nativeCall('mkdtemp', prefix, options);
787
+ // Six characters after the prefix, as node's template has them, drawn
788
+ // again for a name already there.
789
+ for (;;) {
790
+ const path = prefix + tempSuffix();
791
+ try {
792
+ await this.files.mkdir(path);
793
+ await this.narrowed(path, 0o700);
794
+ return encoded(path, options);
795
+ }
796
+ catch (err) {
797
+ if (classify(err) !== 'EEXIST')
798
+ throw fsError(err, 'mkdtemp', path);
799
+ }
800
+ }
801
+ }
802
+ async mkdtempDisposable(prefix, options) {
803
+ // The name handed back takes the encoding asked for; the removal takes
804
+ // the directory's own.
805
+ const made = String(await this.mkdtemp(prefix));
806
+ const remove = () => routed.rm(made, { recursive: true, force: true });
807
+ return { path: encoded(made, options), remove, [Symbol.asyncDispose]: remove };
808
+ }
809
+ async opendir(path, options) {
810
+ try {
811
+ return openedDir(path, await this.readdir(path, {
812
+ withFileTypes: true,
813
+ recursive: fieldsOf(options).recursive === true,
814
+ encoding: fieldsOf(options).encoding,
815
+ }));
816
+ }
817
+ catch (err) {
818
+ throw fsError(err, 'opendir', path);
819
+ }
820
+ }
821
+ async realpath(path, options) {
822
+ // As realpath(3) walks a path: each name in turn, a link swapped for
823
+ // where it leads, so a `..` after a link climbs from its target.
824
+ const todo = path.split('/');
825
+ let done = '/';
826
+ let hops = 0;
827
+ for (let name = todo.shift(); name !== undefined; name = todo.shift()) {
828
+ if (name === '' || name === '.')
829
+ continue;
830
+ if (name === '..') {
831
+ done = posix.dirname(done);
832
+ continue;
833
+ }
834
+ const next = posix.join(done, name);
835
+ let st;
836
+ try {
837
+ st = await this.files.stat(next, true);
838
+ }
839
+ catch (err) {
840
+ throw fsError(err, 'realpath', path);
841
+ }
842
+ if (st.isLink === true) {
843
+ if (++hops > MAX_SYMLINK_HOPS)
844
+ throw refusal('ELOOP', 'realpath', path);
845
+ const target = await this.files.readlink(next);
846
+ if (target.startsWith('/'))
847
+ done = '/';
848
+ todo.unshift(...target.split('/'));
849
+ continue;
850
+ }
851
+ if (!st.isDir && todo.some((rest) => rest !== ''))
852
+ throw refusal('ENOTDIR', 'realpath', path);
853
+ done = next;
854
+ }
855
+ return encoded(done, options);
856
+ }
484
857
  async readFile(path, options) {
485
858
  const bytes = Buffer.from(await this.files.read(path));
486
859
  const encoding = encodingOf(options);
@@ -493,7 +866,7 @@ class HostFs {
493
866
  const walk = async (directory, prefix) => {
494
867
  for (const row of await this.files.readdir(directory, typed || recursive)) {
495
868
  const name = entryName(row.path);
496
- out.push(typed ? this.direntOf(directory, row) : prefix + name);
869
+ out.push(typed ? dirent(directory, row, encoded(name, options)) : encoded(prefix + name, options));
497
870
  if (recursive && row.isDir && row.isLink !== true) {
498
871
  await walk(posix.join(directory, name), `${prefix}${name}/`);
499
872
  }
@@ -503,40 +876,26 @@ class HostFs {
503
876
  return out;
504
877
  }
505
878
  async readlink(path, options) {
506
- const target = await this.files.readlink(path);
507
- const encoding = encodingOf(options);
508
- if (encoding === undefined || encoding === 'utf8')
509
- return target;
510
- const bytes = Buffer.from(target);
511
- return encoding === 'buffer' ? bytes : bytes.toString(encoding);
879
+ return encoded(await this.files.readlink(path), options);
512
880
  }
513
881
  async rename(src, dst) {
514
882
  // A move between a mount and the host is EXDEV, the kernel's answer
515
883
  // for two filesystems and the errno a mover retries as copy + delete.
516
884
  if (!this.mounted(src) || !this.mounted(dst))
517
885
  throw refusal('EXDEV', 'rename', src);
518
- // Both ends as the walk names them before the rename, which may move a
519
- // link the walk takes. A rename onto its own name changes nothing, its
520
- // descriptors included.
521
- const from = this.descriptors.walked(src, false);
522
- const to = this.descriptors.walked(dst, false);
523
- const held = from === to ? [] : await this.descriptors.hold(dst);
886
+ // The descriptors open on either end follow it (the core sees to it).
524
887
  await this.files.rename(src, dst);
525
- this.descriptors.keep(held);
526
- this.descriptors.moved(from, to);
527
888
  }
528
889
  /** Remove a file, the descriptors open on it keeping the bytes it had. */
529
890
  async removeFile(path) {
530
- const held = await this.descriptors.hold(path);
531
891
  await this.files.unlink(path);
532
- this.descriptors.keep(held);
533
892
  }
534
893
  async rm(path, options) {
535
894
  const force = fieldsOf(options).force === true;
536
895
  const recursive = fieldsOf(options).recursive === true;
537
896
  // A mount root is refused however it is spelled (`/data/.`), before
538
897
  // the stat a backend may answer for that spelling or not.
539
- if (this.ws.registry.isMountRoot(posix.normalize(path)))
898
+ if (this.ws.vfs.isMount(posix.normalize(path)))
540
899
  throw refusal('EBUSY', 'rm', path);
541
900
  let st;
542
901
  try {
@@ -578,7 +937,7 @@ class HostFs {
578
937
  * before anything goes, as the agent adapters plan it, so a mount root
579
938
  * anywhere in it refuses the call with nothing removed. */
580
939
  async plan(path, isDir, out, top, where) {
581
- if (this.ws.registry.isMountRoot(posix.normalize(path)))
940
+ if (this.ws.vfs.isMount(posix.normalize(path)))
582
941
  throw refusal('EBUSY', 'rm', path);
583
942
  if (isDir) {
584
943
  this.held(path, where);
@@ -613,7 +972,7 @@ class HostFs {
613
972
  async rmdir(path) {
614
973
  // rmdir(2) on a mount point is EBUSY. A mount root is the
615
974
  // deployment's own, which the shell's rm refuses the same way.
616
- if (this.ws.registry.isMountRoot(posix.normalize(path))) {
975
+ if (this.ws.vfs.isMount(posix.normalize(path))) {
617
976
  throw refusal('EBUSY', 'rmdir', path);
618
977
  }
619
978
  await this.files.rmdir(path);
@@ -628,16 +987,14 @@ class HostFs {
628
987
  // truncate(2) names a file that is there; the op creates a missing
629
988
  // one, as GNU truncate does without -c.
630
989
  await this.files.stat(path);
631
- await this.descriptors.landPath(path);
632
990
  await this.files.truncate(path, length);
633
991
  }
634
992
  async unlink(path) {
635
993
  await this.removeFile(path);
636
994
  }
637
995
  async utimes(path, atime, mtime) {
638
- // Writes a descriptor still owes land first, or landing them at its
639
- // close would stamp over the times set here.
640
- await this.descriptors.landPath(path);
996
+ // Writes a descriptor still owes land first (the core sees to it), or
997
+ // landing them at its close would stamp over the times set here.
641
998
  await this.files.setattr(path, { atime: stampOf(atime), mtime: stampOf(mtime) });
642
999
  }
643
1000
  async writeFile(path, data, options) {
@@ -650,7 +1007,7 @@ class HostFs {
650
1007
  throw ebadf(String(target.fd));
651
1008
  const fd = target instanceof MountedFileHandle ? target.fd : target;
652
1009
  if (name === 'readFile') {
653
- const read = () => readOn(this.descriptors.file(fd, true, false), -1);
1010
+ const read = () => this.descriptors.file(fd, true, false).read(-1);
654
1011
  const bytes = Buffer.from(await this.descriptors.serial(fd, read));
655
1012
  const encoding = encodingOf(rest[0]);
656
1013
  return encoding === undefined ? bytes : bytes.toString(encoding);
@@ -671,22 +1028,23 @@ class HostFs {
671
1028
  /** A read into `buffer` at `offset`, at `position` or, when null, at the
672
1029
  * descriptor's own position, advancing it. The caller holds its queue. */
673
1030
  async readInto(fd, buffer, offset, length, position) {
674
- const handle = this.descriptors.file(fd, true, false);
675
- const bytes = position === null ? await readOn(handle, length) : await readAt(handle, position, length);
1031
+ const desc = this.descriptors.file(fd, true, false);
1032
+ const bytes = position === null ? await desc.read(length) : await desc.pread(position, length);
676
1033
  buffer.set(bytes, offset);
677
1034
  return bytes.byteLength;
678
1035
  }
679
1036
  /** A write through a mounted descriptor, in its turn on the descriptor. */
680
1037
  fdWrite(fd, bytes, position) {
681
- return this.descriptors.serial(fd, () => {
682
- const handle = this.descriptors.file(fd, false, true);
1038
+ return this.descriptors.serial(fd, async () => {
1039
+ const desc = this.descriptors.file(fd, false, true);
683
1040
  // Linux appends a positioned write on an O_APPEND descriptor,
684
- // whatever the position, and leaves the position where it was.
1041
+ // whatever the position, and leaves the position where it was: the
1042
+ // core writes an appending handle at its end.
685
1043
  if (position === null)
686
- handle.write(bytes.slice());
1044
+ await desc.write(bytes.slice());
687
1045
  else
688
- handle.pwrite(handle.append ? handle.size : position, bytes.slice());
689
- return Promise.resolve(bytes.byteLength);
1046
+ await desc.pwrite(position, bytes.slice());
1047
+ return bytes.byteLength;
690
1048
  });
691
1049
  }
692
1050
  /** A descriptor call on a mounted descriptor, answered with what node's
@@ -730,23 +1088,17 @@ class HostFs {
730
1088
  return [await this.fdWrite(fd, joined, position), buffers];
731
1089
  }
732
1090
  case 'fstat': {
733
- const st = desc.kept !== null && desc.stat !== null ? desc.stat : await this.files.stat(desc.path);
734
- const size = desc.handle?.size ?? st.size;
735
- return [
736
- this.statsOf(desc.opened, { ...st, size }, rest[0], desc.kept !== null),
737
- ];
1091
+ const row = await this.files.fstat(desc.fd);
1092
+ return [this.statsOf(desc.inode, row, rest[0], this.files.unlinked(desc.fd))];
738
1093
  }
739
1094
  case 'ftruncate':
740
1095
  if (!desc.mode.writable)
741
1096
  throw einval(desc.path);
742
- await this.descriptors.serial(fd, () => {
743
- this.descriptors.file(fd, false, true).truncate(Math.max(0, Number(rest[0] ?? 0)));
744
- return Promise.resolve();
745
- });
1097
+ await this.descriptors.serial(fd, () => this.descriptors.file(fd, false, true).truncate(Math.max(0, Number(rest[0] ?? 0))));
746
1098
  return [];
747
1099
  case 'fsync':
748
1100
  case 'fdatasync':
749
- await this.descriptors.serial(fd, () => this.descriptors.land(desc));
1101
+ await this.descriptors.serial(fd, () => desc.land());
750
1102
  return [];
751
1103
  case 'close':
752
1104
  await this.descriptors.close(fd);
@@ -775,16 +1127,16 @@ class HostFs {
775
1127
  const given = fieldsOf(options).flag;
776
1128
  const flag = typeof given === 'string' ? given : fallback;
777
1129
  const bytes = bytesOf(data, options);
778
- if (flag.includes('x') && (await this.files.statOrNull(path, true)) !== null) {
779
- throw refusal('EEXIST', 'open', path);
1130
+ // An open, a write and a close through the core, as node's own do, so
1131
+ // the descriptors open on the file see it and an exclusive flag refuses
1132
+ // a name that is there.
1133
+ const fd = await this.files.open(path, openMode(openFlags(flag), constants));
1134
+ try {
1135
+ await this.files.pwrite(fd, 0, bytes);
1136
+ }
1137
+ finally {
1138
+ await this.files.close(fd);
780
1139
  }
781
- // What descriptors on the file still owe lands first, so their older
782
- // writes never land over this one.
783
- await this.descriptors.landPath(path);
784
- if (flag.startsWith('a'))
785
- await this.files.append(path, bytes);
786
- else
787
- await this.files.write(path, bytes);
788
1140
  }
789
1141
  }
790
1142
  /**
@@ -850,6 +1202,7 @@ export function patchNodeFs(ws) {
850
1202
  const byDescriptor = (name, args) => FILE_CALLS.has(name) &&
851
1203
  (host.descriptors.get(args[0]) !== undefined || args[0] instanceof MountedFileHandle);
852
1204
  for (const name of ROUTED_CALLS) {
1205
+ // A promise, or for `glob` the iterator node's answers with.
853
1206
  const route = (args) => host[name].call(host, ...spellPaths(name, args));
854
1207
  swap(fs.promises, name, (original) => (...args) => {
855
1208
  if (byDescriptor(name, args))
@@ -866,8 +1219,10 @@ export function patchNodeFs(ws) {
866
1219
  if (typeof done !== 'function' || mountedIn(name, rest) === null)
867
1220
  return original(...args);
868
1221
  const callback = done;
869
- // `exists` is the one callback without an error slot.
870
- route(rest).then((value) => {
1222
+ const answered = route(rest);
1223
+ (name === 'glob'
1224
+ ? collected(answered)
1225
+ : answered).then((value) => {
871
1226
  if (name === 'exists')
872
1227
  callback(value);
873
1228
  else
@@ -888,10 +1243,11 @@ export function patchNodeFs(ws) {
888
1243
  if (path === null)
889
1244
  return original(...args);
890
1245
  // existsSync answers false where it cannot look, as node's does for
891
- // any path whose stat fails; a mount's root is the one name it
892
- // knows is there without asking.
1246
+ // any path whose stat fails; the root of a mount the session sees
1247
+ // is the one name it knows is there without asking, unless a `..`
1248
+ // in the spelling walks through a name it has not checked.
893
1249
  if (name === 'exists')
894
- return ws.registry.isMountRoot(path);
1250
+ return !path.split('/').includes('..') && ws.vfs.isMount(path);
895
1251
  throw syncRefusal(`${name}Sync`, path);
896
1252
  });
897
1253
  }