@openclaw/fs-safe 0.12.0 → 0.13.0

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 (383) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +12 -7
  3. package/dist/absolute-path.d.ts.map +1 -1
  4. package/dist/absolute-path.js +32 -11
  5. package/dist/advanced.d.ts +2 -0
  6. package/dist/advanced.d.ts.map +1 -1
  7. package/dist/advanced.js +2 -0
  8. package/dist/archive-input.d.ts.map +1 -1
  9. package/dist/archive-input.js +6 -2
  10. package/dist/archive-merge.d.ts.map +1 -1
  11. package/dist/archive-merge.js +15 -2
  12. package/dist/archive-native.d.ts.map +1 -1
  13. package/dist/archive-native.js +7 -19
  14. package/dist/archive-plan.js +1 -1
  15. package/dist/archive-read.d.ts.map +1 -1
  16. package/dist/archive-read.js +18 -13
  17. package/dist/archive-staging.d.ts.map +1 -1
  18. package/dist/archive-staging.js +43 -10
  19. package/dist/archive-tar-inspect.d.ts.map +1 -1
  20. package/dist/archive-tar-inspect.js +4 -1
  21. package/dist/archive-zip-admission.d.ts +1 -1
  22. package/dist/archive-zip-admission.d.ts.map +1 -1
  23. package/dist/archive-zip-admission.js +2 -2
  24. package/dist/archive-zip-directory.d.ts +3 -0
  25. package/dist/archive-zip-directory.d.ts.map +1 -1
  26. package/dist/archive-zip-directory.js +13 -2
  27. package/dist/archive-zip-loader.d.ts +3 -2
  28. package/dist/archive-zip-loader.d.ts.map +1 -1
  29. package/dist/archive-zip-loader.js +30 -4
  30. package/dist/archive-zip-manifest.d.ts +5 -0
  31. package/dist/archive-zip-manifest.d.ts.map +1 -0
  32. package/dist/archive-zip-manifest.js +22 -0
  33. package/dist/archive-zip-names.d.ts +6 -1
  34. package/dist/archive-zip-names.d.ts.map +1 -1
  35. package/dist/archive-zip-names.js +35 -14
  36. package/dist/archive-zip-preflight.d.ts.map +1 -1
  37. package/dist/archive-zip-preflight.js +3 -2
  38. package/dist/archive.d.ts.map +1 -1
  39. package/dist/archive.js +9 -4
  40. package/dist/darwin-acl.d.ts +4 -0
  41. package/dist/darwin-acl.d.ts.map +1 -0
  42. package/dist/darwin-acl.js +24 -0
  43. package/dist/deny-mutations.d.ts.map +1 -1
  44. package/dist/deny-mutations.js +8 -2
  45. package/dist/directory-durability.d.ts.map +1 -1
  46. package/dist/directory-durability.js +67 -23
  47. package/dist/directory-entry-path.d.ts +3 -0
  48. package/dist/directory-entry-path.d.ts.map +1 -0
  49. package/dist/directory-entry-path.js +21 -0
  50. package/dist/directory-guard.d.ts +17 -1
  51. package/dist/directory-guard.d.ts.map +1 -1
  52. package/dist/directory-guard.js +134 -48
  53. package/dist/directory-mode-node.d.ts +12 -0
  54. package/dist/directory-mode-node.d.ts.map +1 -1
  55. package/dist/directory-mode-node.js +102 -4
  56. package/dist/effective-uid.d.ts +2 -0
  57. package/dist/effective-uid.d.ts.map +1 -0
  58. package/dist/effective-uid.js +25 -0
  59. package/dist/file-handle-transfer.d.ts.map +1 -1
  60. package/dist/file-handle-transfer.js +98 -27
  61. package/dist/file-hash.d.ts.map +1 -1
  62. package/dist/file-hash.js +3 -0
  63. package/dist/file-lock-sync.d.ts.map +1 -1
  64. package/dist/file-lock-sync.js +36 -6
  65. package/dist/file-lock.d.ts.map +1 -1
  66. package/dist/file-lock.js +29 -9
  67. package/dist/file-observation.d.ts +1 -1
  68. package/dist/file-observation.d.ts.map +1 -1
  69. package/dist/file-store-boundary.d.ts +6 -2
  70. package/dist/file-store-boundary.d.ts.map +1 -1
  71. package/dist/file-store-boundary.js +20 -65
  72. package/dist/file-store-copy-source.d.ts +5 -0
  73. package/dist/file-store-copy-source.d.ts.map +1 -0
  74. package/dist/file-store-copy-source.js +31 -0
  75. package/dist/file-store-path.d.ts.map +1 -1
  76. package/dist/file-store-path.js +4 -1
  77. package/dist/file-store-sync-directory.d.ts +16 -0
  78. package/dist/file-store-sync-directory.d.ts.map +1 -0
  79. package/dist/file-store-sync-directory.js +349 -0
  80. package/dist/file-store.d.ts.map +1 -1
  81. package/dist/file-store.js +11 -28
  82. package/dist/filename.d.ts.map +1 -1
  83. package/dist/filename.js +65 -20
  84. package/dist/fs.d.ts.map +1 -1
  85. package/dist/fs.js +3 -2
  86. package/dist/guarded-mkdir.d.ts +8 -0
  87. package/dist/guarded-mkdir.d.ts.map +1 -1
  88. package/dist/guarded-mkdir.js +176 -27
  89. package/dist/guest.d.ts.map +1 -1
  90. package/dist/guest.js +4 -1
  91. package/dist/home-dir.d.ts.map +1 -1
  92. package/dist/home-dir.js +73 -10
  93. package/dist/install-path.d.ts.map +1 -1
  94. package/dist/install-path.js +54 -19
  95. package/dist/json-durable-queue-ownership.d.ts +6 -0
  96. package/dist/json-durable-queue-ownership.d.ts.map +1 -1
  97. package/dist/json-durable-queue-ownership.js +89 -42
  98. package/dist/json-durable-queue-paths.d.ts +11 -0
  99. package/dist/json-durable-queue-paths.d.ts.map +1 -0
  100. package/dist/json-durable-queue-paths.js +42 -0
  101. package/dist/json-durable-queue-read.d.ts.map +1 -1
  102. package/dist/json-durable-queue-read.js +2 -0
  103. package/dist/json-durable-queue.d.ts.map +1 -1
  104. package/dist/json-durable-queue.js +50 -58
  105. package/dist/json-store.d.ts.map +1 -1
  106. package/dist/json-store.js +5 -1
  107. package/dist/json.d.ts.map +1 -1
  108. package/dist/json.js +54 -22
  109. package/dist/local-file-access.d.ts.map +1 -1
  110. package/dist/local-file-access.js +4 -0
  111. package/dist/local-file-descriptor.d.ts +17 -0
  112. package/dist/local-file-descriptor.d.ts.map +1 -0
  113. package/dist/local-file-descriptor.js +84 -0
  114. package/dist/local-roots.d.ts.map +1 -1
  115. package/dist/local-roots.js +35 -7
  116. package/dist/move-path-cleanup.d.ts +2 -0
  117. package/dist/move-path-cleanup.d.ts.map +1 -1
  118. package/dist/move-path-cleanup.js +44 -18
  119. package/dist/move-path.d.ts.map +1 -1
  120. package/dist/move-path.js +31 -6
  121. package/dist/native-binding.d.ts +14 -0
  122. package/dist/native-binding.d.ts.map +1 -1
  123. package/dist/native-directory-observation.d.ts +17 -0
  124. package/dist/native-directory-observation.d.ts.map +1 -0
  125. package/dist/native-directory-observation.js +37 -0
  126. package/dist/native-parent-admission.d.ts +31 -0
  127. package/dist/native-parent-admission.d.ts.map +1 -0
  128. package/dist/native-parent-admission.js +124 -0
  129. package/dist/native-pinned-write-windows.d.ts +0 -1
  130. package/dist/native-pinned-write-windows.d.ts.map +1 -1
  131. package/dist/native-pinned-write-windows.js +0 -3
  132. package/dist/native-pinned-write.d.ts.map +1 -1
  133. package/dist/native-pinned-write.js +309 -40
  134. package/dist/output.d.ts.map +1 -1
  135. package/dist/output.js +15 -5
  136. package/dist/overwrite-file-handle.d.ts.map +1 -1
  137. package/dist/overwrite-file-handle.js +5 -1
  138. package/dist/owner-dacl.d.ts.map +1 -1
  139. package/dist/owner-dacl.js +2 -0
  140. package/dist/path-policy.d.ts.map +1 -1
  141. package/dist/path-policy.js +7 -2
  142. package/dist/path-prefix.d.ts +7 -0
  143. package/dist/path-prefix.d.ts.map +1 -0
  144. package/dist/path-prefix.js +82 -0
  145. package/dist/path-scope-lexical.d.ts.map +1 -1
  146. package/dist/path-scope-lexical.js +18 -8
  147. package/dist/path-segment-route.d.ts +7 -0
  148. package/dist/path-segment-route.d.ts.map +1 -0
  149. package/dist/path-segment-route.js +24 -0
  150. package/dist/path-suffix-aliases.d.ts +10 -0
  151. package/dist/path-suffix-aliases.d.ts.map +1 -0
  152. package/dist/path-suffix-aliases.js +386 -0
  153. package/dist/path.d.ts.map +1 -1
  154. package/dist/path.js +16 -5
  155. package/dist/permissions-windows.d.ts.map +1 -1
  156. package/dist/permissions-windows.js +14 -3
  157. package/dist/permissions.d.ts.map +1 -1
  158. package/dist/permissions.js +37 -8
  159. package/dist/pinned-mutation-admission.d.ts +25 -0
  160. package/dist/pinned-mutation-admission.d.ts.map +1 -0
  161. package/dist/pinned-mutation-admission.js +425 -0
  162. package/dist/pinned-mutation-observation.d.ts +34 -0
  163. package/dist/pinned-mutation-observation.d.ts.map +1 -0
  164. package/dist/pinned-mutation-observation.js +142 -0
  165. package/dist/pinned-mutation-shared-route.d.ts +24 -0
  166. package/dist/pinned-mutation-shared-route.d.ts.map +1 -0
  167. package/dist/pinned-mutation-shared-route.js +70 -0
  168. package/dist/pinned-open.d.ts +6 -0
  169. package/dist/pinned-open.d.ts.map +1 -1
  170. package/dist/pinned-open.js +28 -10
  171. package/dist/pinned-write-types.d.ts +75 -0
  172. package/dist/pinned-write-types.d.ts.map +1 -0
  173. package/dist/pinned-write-types.js +1 -0
  174. package/dist/pinned-write.d.ts +7 -33
  175. package/dist/pinned-write.d.ts.map +1 -1
  176. package/dist/pinned-write.js +151 -17
  177. package/dist/private-directory.d.ts.map +1 -1
  178. package/dist/private-directory.js +2 -0
  179. package/dist/private-producer-handoff.d.ts +16 -0
  180. package/dist/private-producer-handoff.d.ts.map +1 -0
  181. package/dist/private-producer-handoff.js +272 -0
  182. package/dist/private-temp-workspace.d.ts +2 -39
  183. package/dist/private-temp-workspace.d.ts.map +1 -1
  184. package/dist/private-temp-workspace.js +183 -77
  185. package/dist/publish-file.d.ts.map +1 -1
  186. package/dist/publish-file.js +33 -29
  187. package/dist/regular-file.d.ts.map +1 -1
  188. package/dist/regular-file.js +56 -45
  189. package/dist/replace-directory.d.ts.map +1 -1
  190. package/dist/replace-directory.js +12 -5
  191. package/dist/replace-file-temp-owner.d.ts +1 -0
  192. package/dist/replace-file-temp-owner.d.ts.map +1 -1
  193. package/dist/replace-file-temp-owner.js +12 -1
  194. package/dist/replace-file.d.ts.map +1 -1
  195. package/dist/replace-file.js +24 -24
  196. package/dist/root-boundary.d.ts +4 -0
  197. package/dist/root-boundary.d.ts.map +1 -1
  198. package/dist/root-boundary.js +6 -1
  199. package/dist/root-context.d.ts +12 -1
  200. package/dist/root-context.d.ts.map +1 -1
  201. package/dist/root-context.js +57 -11
  202. package/dist/root-directory-creation.d.ts +13 -0
  203. package/dist/root-directory-creation.d.ts.map +1 -0
  204. package/dist/root-directory-creation.js +212 -0
  205. package/dist/root-directory-list.d.ts +16 -4
  206. package/dist/root-directory-list.d.ts.map +1 -1
  207. package/dist/root-directory-list.js +180 -39
  208. package/dist/root-directory.d.ts +23 -0
  209. package/dist/root-directory.d.ts.map +1 -0
  210. package/dist/root-directory.js +141 -0
  211. package/dist/root-errors.d.ts.map +1 -1
  212. package/dist/root-errors.js +12 -1
  213. package/dist/root-file-final-admission.d.ts +21 -0
  214. package/dist/root-file-final-admission.d.ts.map +1 -0
  215. package/dist/root-file-final-admission.js +83 -0
  216. package/dist/root-file.d.ts.map +1 -1
  217. package/dist/root-file.js +103 -24
  218. package/dist/root-impl.d.ts +1 -0
  219. package/dist/root-impl.d.ts.map +1 -1
  220. package/dist/root-impl.js +289 -317
  221. package/dist/root-move-noreplace.d.ts +14 -0
  222. package/dist/root-move-noreplace.d.ts.map +1 -0
  223. package/dist/root-move-noreplace.js +202 -0
  224. package/dist/root-observed-path.d.ts +9 -0
  225. package/dist/root-observed-path.d.ts.map +1 -0
  226. package/dist/root-observed-path.js +95 -0
  227. package/dist/root-path-errors.d.ts +12 -0
  228. package/dist/root-path-errors.d.ts.map +1 -0
  229. package/dist/root-path-errors.js +13 -0
  230. package/dist/root-path-existing.d.ts.map +1 -1
  231. package/dist/root-path-existing.js +53 -20
  232. package/dist/root-path-observation.d.ts +63 -0
  233. package/dist/root-path-observation.d.ts.map +1 -0
  234. package/dist/root-path-observation.js +180 -0
  235. package/dist/root-path-stat.d.ts +5 -0
  236. package/dist/root-path-stat.d.ts.map +1 -0
  237. package/dist/root-path-stat.js +101 -0
  238. package/dist/root-path-symlink.d.ts.map +1 -1
  239. package/dist/root-path-symlink.js +23 -4
  240. package/dist/root-path.d.ts +11 -0
  241. package/dist/root-path.d.ts.map +1 -1
  242. package/dist/root-path.js +215 -53
  243. package/dist/root-paths-lexical.d.ts +9 -0
  244. package/dist/root-paths-lexical.d.ts.map +1 -0
  245. package/dist/root-paths-lexical.js +22 -0
  246. package/dist/root-paths.d.ts +3 -25
  247. package/dist/root-paths.d.ts.map +1 -1
  248. package/dist/root-paths.js +77 -154
  249. package/dist/root-read-admission.d.ts +26 -0
  250. package/dist/root-read-admission.d.ts.map +1 -0
  251. package/dist/root-read-admission.js +94 -0
  252. package/dist/root-remove-identity.d.ts +15 -0
  253. package/dist/root-remove-identity.d.ts.map +1 -0
  254. package/dist/root-remove-identity.js +89 -0
  255. package/dist/root-remove-receipt.d.ts +17 -0
  256. package/dist/root-remove-receipt.d.ts.map +1 -0
  257. package/dist/root-remove-receipt.js +37 -0
  258. package/dist/root-remove.d.ts +2 -1
  259. package/dist/root-remove.d.ts.map +1 -1
  260. package/dist/root-remove.js +172 -10
  261. package/dist/root-write-admission.d.ts +68 -0
  262. package/dist/root-write-admission.d.ts.map +1 -0
  263. package/dist/root-write-admission.js +322 -0
  264. package/dist/root-write-compatibility.d.ts +13 -0
  265. package/dist/root-write-compatibility.d.ts.map +1 -0
  266. package/dist/root-write-compatibility.js +74 -0
  267. package/dist/root-write-complete-parent.d.ts +42 -0
  268. package/dist/root-write-complete-parent.d.ts.map +1 -0
  269. package/dist/root-write-complete-parent.js +195 -0
  270. package/dist/root-write-publication.d.ts +24 -0
  271. package/dist/root-write-publication.d.ts.map +1 -0
  272. package/dist/root-write-publication.js +85 -0
  273. package/dist/root-write-verification.d.ts.map +1 -1
  274. package/dist/root-write-verification.js +6 -4
  275. package/dist/secret-file.d.ts.map +1 -1
  276. package/dist/secret-file.js +62 -24
  277. package/dist/secret-read-async.d.ts.map +1 -1
  278. package/dist/secret-read-async.js +18 -13
  279. package/dist/secret-read-policy.d.ts.map +1 -1
  280. package/dist/secret-read-policy.js +5 -1
  281. package/dist/secure-file.d.ts.map +1 -1
  282. package/dist/secure-file.js +92 -7
  283. package/dist/secure-temp-dir.d.ts +6 -3
  284. package/dist/secure-temp-dir.d.ts.map +1 -1
  285. package/dist/secure-temp-dir.js +121 -101
  286. package/dist/secure-temp-repair.d.ts +35 -0
  287. package/dist/secure-temp-repair.d.ts.map +1 -0
  288. package/dist/secure-temp-repair.js +106 -0
  289. package/dist/sibling-staged-file.d.ts +3 -2
  290. package/dist/sibling-staged-file.d.ts.map +1 -1
  291. package/dist/sibling-staged-file.js +179 -55
  292. package/dist/sibling-temp.d.ts.map +1 -1
  293. package/dist/sibling-temp.js +27 -13
  294. package/dist/sidecar-lock-acquire.d.ts.map +1 -1
  295. package/dist/sidecar-lock-acquire.js +44 -14
  296. package/dist/sidecar-lock-root.d.ts.map +1 -1
  297. package/dist/sidecar-lock-root.js +4 -2
  298. package/dist/staged-directory.d.ts +14 -5
  299. package/dist/staged-directory.d.ts.map +1 -1
  300. package/dist/staged-directory.js +54 -3
  301. package/dist/standalone-publication-path.d.ts +2 -0
  302. package/dist/standalone-publication-path.d.ts.map +1 -0
  303. package/dist/standalone-publication-path.js +6 -0
  304. package/dist/stat-observation.d.ts +11 -0
  305. package/dist/stat-observation.d.ts.map +1 -0
  306. package/dist/stat-observation.js +64 -0
  307. package/dist/strict-file-identity.d.ts.map +1 -1
  308. package/dist/strict-file-identity.js +39 -2
  309. package/dist/symlink-parents.d.ts.map +1 -1
  310. package/dist/symlink-parents.js +7 -2
  311. package/dist/temp-target.d.ts +2 -0
  312. package/dist/temp-target.d.ts.map +1 -1
  313. package/dist/temp-target.js +130 -3
  314. package/dist/temp-workspace-admission.d.ts +22 -0
  315. package/dist/temp-workspace-admission.d.ts.map +1 -0
  316. package/dist/temp-workspace-admission.js +374 -0
  317. package/dist/temp-workspace-child-admission.d.ts +13 -0
  318. package/dist/temp-workspace-child-admission.d.ts.map +1 -0
  319. package/dist/temp-workspace-child-admission.js +95 -0
  320. package/dist/temp-workspace-descriptor.d.ts +48 -0
  321. package/dist/temp-workspace-descriptor.d.ts.map +1 -0
  322. package/dist/temp-workspace-descriptor.js +363 -0
  323. package/dist/temp-workspace-identity.d.ts +15 -0
  324. package/dist/temp-workspace-identity.d.ts.map +1 -0
  325. package/dist/temp-workspace-identity.js +41 -0
  326. package/dist/temp-workspace-owner.d.ts +7 -6
  327. package/dist/temp-workspace-owner.d.ts.map +1 -1
  328. package/dist/temp-workspace-owner.js +121 -61
  329. package/dist/temp-workspace-permissions.d.ts +4 -0
  330. package/dist/temp-workspace-permissions.d.ts.map +1 -0
  331. package/dist/temp-workspace-permissions.js +32 -0
  332. package/dist/temp-workspace-types.d.ts +40 -0
  333. package/dist/temp-workspace-types.d.ts.map +1 -0
  334. package/dist/temp-workspace-types.js +1 -0
  335. package/dist/temp.d.ts +1 -1
  336. package/dist/temp.d.ts.map +1 -1
  337. package/dist/temp.js +1 -1
  338. package/dist/test-hooks.d.ts +7 -0
  339. package/dist/test-hooks.d.ts.map +1 -1
  340. package/dist/text-atomic.d.ts.map +1 -1
  341. package/dist/text-atomic.js +3 -1
  342. package/dist/trash.d.ts.map +1 -1
  343. package/dist/trash.js +54 -8
  344. package/dist/walk.d.ts.map +1 -1
  345. package/dist/walk.js +9 -6
  346. package/dist/windows-owner.d.ts.map +1 -1
  347. package/dist/windows-owner.js +5 -0
  348. package/dist/windows-path-alias.d.ts +39 -0
  349. package/dist/windows-path-alias.d.ts.map +1 -0
  350. package/dist/windows-path-alias.js +153 -0
  351. package/docs/advanced.md +25 -0
  352. package/docs/archive.md +23 -2
  353. package/docs/atomic.md +27 -3
  354. package/docs/copy.md +3 -0
  355. package/docs/durability.md +14 -0
  356. package/docs/errors.md +14 -6
  357. package/docs/file-store.md +24 -3
  358. package/docs/filename.md +14 -7
  359. package/docs/install-path.md +2 -2
  360. package/docs/install.md +8 -7
  361. package/docs/json-store.md +5 -1
  362. package/docs/json.md +11 -0
  363. package/docs/mutation-policy-proof.md +65 -0
  364. package/docs/native-helper.md +26 -9
  365. package/docs/native.md +32 -8
  366. package/docs/output.md +33 -11
  367. package/docs/path-prefix.md +64 -0
  368. package/docs/path-suffix-aliases.md +159 -0
  369. package/docs/path.md +11 -0
  370. package/docs/private-file-store.md +14 -0
  371. package/docs/public-api.md +9 -0
  372. package/docs/quickstart.md +1 -1
  373. package/docs/reading.md +8 -1
  374. package/docs/root.md +18 -3
  375. package/docs/secret-file.md +3 -0
  376. package/docs/secure-file.md +6 -2
  377. package/docs/security-model.md +75 -8
  378. package/docs/sidecar-lock.md +28 -1
  379. package/docs/store.md +5 -1
  380. package/docs/temp.md +260 -36
  381. package/docs/test-hooks.md +14 -0
  382. package/docs/writing.md +38 -8
  383. package/package.json +10 -10
@@ -0,0 +1,180 @@
1
+ import fs, {} from "node:fs";
2
+ import { extendDirectoryObservationGuard, } from "./directory-guard.js";
3
+ import { FsSafeError } from "./errors.js";
4
+ import { extendNativeDirectoryObservationGuard, inspectNativeDirectoryObservation, isNativeDirectoryObservationGuard, } from "./native-directory-observation.js";
5
+ import { admitPathInsideRoot, } from "./root-boundary.js";
6
+ import { realpathSync } from "./realpath.js";
7
+ import { inspectStatObservationSync } from "./stat-observation.js";
8
+ // Observation-only failures happen after ordinary traversal has admitted the
9
+ // name. Keep them distinguishable so Root preserves existing error precedence.
10
+ export class RootPathObservationError extends Error {
11
+ error;
12
+ parentReceipt;
13
+ traversalFailure;
14
+ constructor(error, parentReceipt, traversalFailure = false) {
15
+ super("root path observation failed", { cause: error });
16
+ this.error = error;
17
+ this.parentReceipt = parentReceipt;
18
+ this.traversalFailure = traversalFailure;
19
+ this.name = "RootPathObservationError";
20
+ }
21
+ }
22
+ function straightTraversalPath(value) {
23
+ if (value.length === 0)
24
+ return false;
25
+ const windows = process.platform === "win32";
26
+ let segmentStart = 0;
27
+ for (let index = 0; index <= value.length; index += 1) {
28
+ const separator = index === value.length || value[index] === "/" ||
29
+ (windows && value[index] === "\\");
30
+ if (!separator)
31
+ continue;
32
+ const segmentLength = index - segmentStart;
33
+ if (segmentLength === 0 ||
34
+ (segmentLength === 1 && value.charCodeAt(segmentStart) === 0x2e) ||
35
+ (segmentLength === 2 && value.charCodeAt(segmentStart) === 0x2e &&
36
+ value.charCodeAt(segmentStart + 1) === 0x2e))
37
+ return false;
38
+ segmentStart = index + 1;
39
+ }
40
+ return true;
41
+ }
42
+ export function createRootPathTraversalObservation(context, request) {
43
+ const { state } = context;
44
+ const rootTraversal = state.finalComponentIndex < 0 &&
45
+ (state.relativePath === "" || state.relativePath === ".");
46
+ if (!request || !context.observationEligible ||
47
+ request.rootGuard.dir !== context.rootCanonicalPath ||
48
+ request.rootGuard.realPath !== context.rootCanonicalPath ||
49
+ context.rootPath !== context.rootCanonicalPath ||
50
+ (!rootTraversal && !straightTraversalPath(state.relativePath)) ||
51
+ (!rootTraversal && state.finalComponentIndex !== state.segments.length - 1))
52
+ return undefined;
53
+ if (state.finalComponentIndex >= 0) {
54
+ const directoryIndex = request.kind === "stat"
55
+ ? state.finalComponentIndex - 1
56
+ : state.finalComponentIndex;
57
+ return {
58
+ enabled: true,
59
+ request,
60
+ targetIndex: state.finalComponentIndex,
61
+ directoryIndex,
62
+ directoryGuard: directoryIndex < 0 ? request.rootGuard : undefined,
63
+ // A direct-child stat has no selected-directory slot at which the
64
+ // optional helper can establish a receipt. Keep its final Root fence on
65
+ // the established JavaScript path so helper unavailability cannot first
66
+ // appear after the target has been admitted.
67
+ directoryObserver: directoryIndex < 0 ? undefined : request.directoryObserver,
68
+ };
69
+ }
70
+ if (!rootTraversal)
71
+ return undefined;
72
+ let directoryGuard = request.rootGuard;
73
+ // Root-only stat likewise has no pre-admission helper observation. Root
74
+ // listing below does establish one and may safely retain the backend.
75
+ let directoryObserver = request.kind === "stat" ? undefined : request.directoryObserver;
76
+ if (request.kind === "directory") {
77
+ if (directoryObserver) {
78
+ try {
79
+ const observed = inspectNativeDirectoryObservation(directoryObserver, request.rootGuard.dir, request.rootGuard.identity);
80
+ const admitted = admitPathInsideRoot({
81
+ rootPath: context.rootCanonicalPath,
82
+ candidatePath: observed.realPath,
83
+ rootIdentity: context.resolveParams.rootIdentity,
84
+ });
85
+ if (!admitted || admitted.relativePath !== "") {
86
+ throw new FsSafeError("path-mismatch", "root path changed during operation");
87
+ }
88
+ observed.realPath = admitted.path;
89
+ directoryGuard = extendNativeDirectoryObservationGuard(observed, request.rootGuard.dir);
90
+ }
91
+ catch (error) {
92
+ if (error instanceof FsSafeError && error.code === "path-mismatch") {
93
+ throw new RootPathObservationError(error);
94
+ }
95
+ directoryObserver = undefined;
96
+ }
97
+ }
98
+ if (!directoryObserver) {
99
+ try {
100
+ const admitted = admitPathInsideRoot({
101
+ rootPath: context.rootCanonicalPath,
102
+ candidatePath: realpathSync.native(request.rootGuard.dir),
103
+ rootIdentity: context.resolveParams.rootIdentity,
104
+ });
105
+ if (!admitted || admitted.relativePath !== "") {
106
+ throw new FsSafeError("path-mismatch", "root path changed during operation");
107
+ }
108
+ }
109
+ catch (error) {
110
+ throw new RootPathObservationError(error);
111
+ }
112
+ }
113
+ }
114
+ return {
115
+ enabled: true,
116
+ request,
117
+ targetIndex: -1,
118
+ directoryIndex: -1,
119
+ directoryGuard,
120
+ directoryObserver,
121
+ targetPath: context.rootCanonicalPath,
122
+ target: directoryGuard,
123
+ };
124
+ }
125
+ export function inspectRootPathTraversalEntry(pathname, directorySlot, observation) {
126
+ if (directorySlot && observation.directoryObserver) {
127
+ try {
128
+ return extendNativeDirectoryObservationGuard(inspectNativeDirectoryObservation(observation.directoryObserver, pathname), pathname);
129
+ }
130
+ catch {
131
+ // This directory has not been admitted yet. Preserve the established
132
+ // resolver and error ordering when the optional observation is unusable.
133
+ observation.directoryObserver = undefined;
134
+ }
135
+ }
136
+ const first = process.platform === "win32"
137
+ ? fs.lstatSync(pathname, { bigint: true }) : fs.lstatSync(pathname);
138
+ if (first.isSymbolicLink() || (directorySlot && !first.isDirectory()))
139
+ return { stat: first };
140
+ try {
141
+ return inspectStatObservationSync(bigint => bigint
142
+ ? fs.lstatSync(pathname, { bigint: true }) : fs.lstatSync(pathname), undefined, first);
143
+ }
144
+ catch (error) {
145
+ if (error instanceof FsSafeError && error.code === "path-mismatch") {
146
+ throw new RootPathObservationError(error);
147
+ }
148
+ throw error;
149
+ }
150
+ }
151
+ export function captureRootPathObservedDirectory(observation, observed, publicPath, canonicalPath, rootCanonicalPath, rootIdentity) {
152
+ if (!isNativeDirectoryObservationGuard(observed) && !observed.stat.isDirectory())
153
+ return false;
154
+ let realPath;
155
+ try {
156
+ realPath = isNativeDirectoryObservationGuard(observed)
157
+ ? observed.realPath
158
+ : realpathSync.native(canonicalPath);
159
+ }
160
+ catch (error) {
161
+ throw new RootPathObservationError(error);
162
+ }
163
+ const admitted = admitPathInsideRoot({
164
+ rootPath: rootCanonicalPath,
165
+ candidatePath: realPath,
166
+ rootIdentity,
167
+ });
168
+ if (!admitted) {
169
+ throw new RootPathObservationError(new FsSafeError("outside-workspace", "directory is outside workspace root"));
170
+ }
171
+ if (isNativeDirectoryObservationGuard(observed)) {
172
+ observed.dir = publicPath;
173
+ observed.realPath = admitted.path;
174
+ observation.directoryGuard = observed;
175
+ }
176
+ else {
177
+ observation.directoryGuard = extendDirectoryObservationGuard(observed, publicPath, admitted.path);
178
+ }
179
+ return true;
180
+ }
@@ -0,0 +1,5 @@
1
+ import type { RootContext } from "./root-context.js";
2
+ import type { RootPathObservationReceipt } from "./root-path.js";
3
+ import type { PathStat } from "./types.js";
4
+ export declare function statResolvedPathInRoot(root: RootContext, resolvedPath: string, receipt?: RootPathObservationReceipt): Promise<PathStat>;
5
+ //# sourceMappingURL=root-path-stat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-path-stat.d.ts","sourceRoot":"","sources":["../src/root-path-stat.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAIjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAwB3C,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,WAAW,EACjB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,0BAA0B,GACnC,OAAO,CAAC,QAAQ,CAAC,CA8EnB"}
@@ -0,0 +1,101 @@
1
+ import fsSync from "node:fs";
2
+ import path from "node:path";
3
+ import { FsSafeError } from "./errors.js";
4
+ import { recordFileObservationFailure } from "./file-observation.js";
5
+ import { hasNodeErrorCode, isNotFoundPathError } from "./path.js";
6
+ import { assertRootDirectoryObservationGuard, assertRootPathObservationReceiptCurrent, createRootDirectoryObservationGuard, pathStatFromStats, } from "./root-directory-list.js";
7
+ import { fileNotFoundError } from "./root-errors.js";
8
+ import { inspectFileIdentitySync } from "./strict-file-identity.js";
9
+ import { assertStatObservationSync } from "./stat-observation.js";
10
+ import { getFsSafeTestHooks } from "./test-hooks.js";
11
+ async function missingObservedFileError(cause, pathname, before, assertParents) {
12
+ const failure = new FsSafeError("path-mismatch", "file changed during operation", {
13
+ cause: cause instanceof Error ? cause : undefined,
14
+ });
15
+ if (hasNodeErrorCode(cause, "ENOENT") && before?.isFile() && !before.isSymbolicLink() &&
16
+ (before.nlink === 1 || before.nlink === 1n)) {
17
+ try {
18
+ await assertParents();
19
+ // Metadata loss permits discarding a probe, never reading or owning a file.
20
+ recordFileObservationFailure(failure, `stat-leaf-missing:${pathname}`);
21
+ }
22
+ catch {
23
+ // Keep the public mismatch and withhold provenance when ancestry changed.
24
+ }
25
+ }
26
+ return failure;
27
+ }
28
+ export async function statResolvedPathInRoot(root, resolvedPath, receipt) {
29
+ let admittedTarget = false;
30
+ try {
31
+ if (receipt) {
32
+ if (receipt.kind !== "stat" || receipt.targetPath !== resolvedPath) {
33
+ throw new FsSafeError("path-mismatch", "file observation receipt does not match target");
34
+ }
35
+ admittedTarget = true;
36
+ const beforeObservation = getFsSafeTestHooks()?.beforeRootStatObservation;
37
+ if (beforeObservation)
38
+ await beforeObservation(resolvedPath);
39
+ let observed;
40
+ try {
41
+ observed = assertStatObservationSync(bigint => bigint ? fsSync.lstatSync(resolvedPath, { bigint: true }) : fsSync.lstatSync(resolvedPath), receipt.target.identity);
42
+ }
43
+ catch (error) {
44
+ if (isNotFoundPathError(error)) {
45
+ throw await missingObservedFileError(error, resolvedPath, "stat" in receipt.target ? receipt.target.stat : undefined, () => assertRootPathObservationReceiptCurrent(root, receipt));
46
+ }
47
+ throw error;
48
+ }
49
+ if (observed.isSymbolicLink()) {
50
+ throw new FsSafeError("path-mismatch", "file changed during operation");
51
+ }
52
+ assertRootPathObservationReceiptCurrent(root, receipt, observed);
53
+ return pathStatFromStats(observed);
54
+ }
55
+ const guardPath = resolvedPath === root.rootReal ? root.rootReal : path.dirname(resolvedPath);
56
+ const parentGuard = guardPath === root.rootReal && root.rootGuard
57
+ ? root.rootGuard
58
+ : await createRootDirectoryObservationGuard(root, guardPath);
59
+ let expected;
60
+ try {
61
+ const beforeInitialObservation = getFsSafeTestHooks()?.beforeRootStatInitialObservation;
62
+ if (beforeInitialObservation)
63
+ await beforeInitialObservation(resolvedPath);
64
+ expected = inspectFileIdentitySync(() => fsSync.lstatSync(resolvedPath, { bigint: true }));
65
+ if (expected.isSymbolicLink()) {
66
+ throw new FsSafeError("path-mismatch", "file changed during operation");
67
+ }
68
+ }
69
+ catch (error) {
70
+ // No initial target error is safe to expose until the admitted parent is
71
+ // proven current; a redirect must win over an ordinary lookup failure.
72
+ await assertRootDirectoryObservationGuard(root, parentGuard);
73
+ throw error;
74
+ }
75
+ admittedTarget = true;
76
+ const beforeObservation = getFsSafeTestHooks()?.beforeRootStatObservation;
77
+ if (beforeObservation)
78
+ await beforeObservation(resolvedPath);
79
+ let observed;
80
+ try {
81
+ observed = inspectFileIdentitySync(() => fsSync.lstatSync(resolvedPath, { bigint: true }), expected);
82
+ }
83
+ catch (error) {
84
+ if (isNotFoundPathError(error)) {
85
+ throw await missingObservedFileError(error, resolvedPath, expected, () => assertRootDirectoryObservationGuard(root, parentGuard));
86
+ }
87
+ throw error;
88
+ }
89
+ if (observed.isSymbolicLink()) {
90
+ throw new FsSafeError("path-mismatch", "file changed during operation");
91
+ }
92
+ await assertRootDirectoryObservationGuard(root, parentGuard);
93
+ return pathStatFromStats(observed);
94
+ }
95
+ catch (error) {
96
+ if (!admittedTarget && isNotFoundPathError(error)) {
97
+ throw fileNotFoundError(error instanceof Error ? error : undefined);
98
+ }
99
+ throw error;
100
+ }
101
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"root-path-symlink.d.ts","sourceRoot":"","sources":["../src/root-path-symlink.ts"],"names":[],"mappings":"AAUA,KAAK,wBAAwB,GAAG;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAiBF,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,MAAM,CAAC,CAQjB;AAED,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,wBAA6B,GACrC,MAAM,CAQR"}
1
+ {"version":3,"file":"root-path-symlink.d.ts","sourceRoot":"","sources":["../src/root-path-symlink.ts"],"names":[],"mappings":"AAeA,KAAK,wBAAwB,GAAG;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAsBF,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,MAAM,CAAC,CAejB;AAED,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,wBAA6B,GACrC,MAAM,CAeR"}
@@ -4,6 +4,7 @@ import { FsSafeError } from "./errors.js";
4
4
  import { isNotFoundPathError, isSymlinkOpenError } from "./path.js";
5
5
  import { realpathSync } from "./realpath.js";
6
6
  import { resolvePathViaExistingAncestor, resolvePathViaExistingAncestorSync, } from "./root-path-existing.js";
7
+ import { assertNoWindowsPathAlias, resolvePathFromBasePreservingWindowsRoot, resolvePathPreservingWindowsRoot, } from "./windows-path-alias.js";
7
8
  function normalizeSymlinkResolutionError(error, options) {
8
9
  if (isSymlinkOpenError(error) ||
9
10
  (options.rejectUnresolved && isNotFoundPathError(error))) {
@@ -14,23 +15,41 @@ function normalizeSymlinkResolutionError(error, options) {
14
15
  if (!isNotFoundPathError(error))
15
16
  throw error;
16
17
  }
18
+ function resolveSymlinkTargetPath(symlinkPath, linkTarget) {
19
+ const linkDir = resolvePathPreservingWindowsRoot(path.dirname(symlinkPath));
20
+ return resolvePathFromBasePreservingWindowsRoot(linkDir, linkTarget);
21
+ }
17
22
  export async function resolveSymlinkHopPath(symlinkPath, options = {}) {
18
23
  try {
19
- return path.resolve(realpathSync.native(symlinkPath));
24
+ const rawRealPath = realpathSync.native(symlinkPath);
25
+ assertNoWindowsPathAlias(rawRealPath, "filesystem", "resolved symlink path uses a Windows filesystem namespace alias");
26
+ const realPath = resolvePathPreservingWindowsRoot(rawRealPath);
27
+ assertNoWindowsPathAlias(realPath, "filesystem", "resolved symlink path uses a Windows filesystem namespace alias");
28
+ return realPath;
20
29
  }
21
30
  catch (error) {
22
31
  normalizeSymlinkResolutionError(error, options);
23
32
  const linkTarget = fs.readlinkSync(symlinkPath);
24
- return resolvePathViaExistingAncestor(path.resolve(path.dirname(symlinkPath), linkTarget));
33
+ assertNoWindowsPathAlias(linkTarget, "filesystem", "symlink target uses a Windows filesystem namespace alias");
34
+ const resolved = await resolvePathViaExistingAncestor(resolveSymlinkTargetPath(symlinkPath, linkTarget));
35
+ assertNoWindowsPathAlias(resolved, "filesystem", "resolved symlink path uses a Windows filesystem namespace alias");
36
+ return resolved;
25
37
  }
26
38
  }
27
39
  export function resolveSymlinkHopPathSync(symlinkPath, options = {}) {
28
40
  try {
29
- return path.resolve(realpathSync(symlinkPath));
41
+ const rawRealPath = realpathSync(symlinkPath);
42
+ assertNoWindowsPathAlias(rawRealPath, "filesystem", "resolved symlink path uses a Windows filesystem namespace alias");
43
+ const realPath = resolvePathPreservingWindowsRoot(rawRealPath);
44
+ assertNoWindowsPathAlias(realPath, "filesystem", "resolved symlink path uses a Windows filesystem namespace alias");
45
+ return realPath;
30
46
  }
31
47
  catch (error) {
32
48
  normalizeSymlinkResolutionError(error, options);
33
49
  const linkTarget = fs.readlinkSync(symlinkPath);
34
- return resolvePathViaExistingAncestorSync(path.resolve(path.dirname(symlinkPath), linkTarget));
50
+ assertNoWindowsPathAlias(linkTarget, "filesystem", "symlink target uses a Windows filesystem namespace alias");
51
+ const resolved = resolvePathViaExistingAncestorSync(resolveSymlinkTargetPath(symlinkPath, linkTarget));
52
+ assertNoWindowsPathAlias(resolved, "filesystem", "resolved symlink path uses a Windows filesystem namespace alias");
53
+ return resolved;
35
54
  }
36
55
  }
@@ -1,5 +1,8 @@
1
1
  import { type RootBoundaryIdentity } from "./root-boundary.js";
2
+ import { type RootPathObservationReceipt, type RootPathObservationRequest } from "./root-path-observation.js";
3
+ import type { RemovalPathReceipts } from "./root-remove-receipt.js";
2
4
  export { resolvePathViaExistingAncestorSync } from "./root-path-existing.js";
5
+ export { RootPathObservationError, type RootPathDirectoryObservationGuard, type RootPathObservationKind, type RootPathObservationReceipt, type RootPathParentObservationReceipt, type RootPathObservationRequest, type RootPathTargetObservation, } from "./root-path-observation.js";
3
6
  type RootPathIntent = "read" | "write" | "create" | "delete" | "stat";
4
7
  export type RootPathAliasPolicy = {
5
8
  allowFinalSymlinkForUnlink?: boolean;
@@ -38,6 +41,14 @@ export type ResolvedRootPath = {
38
41
  exists: boolean;
39
42
  kind: ResolvedRootPathKind;
40
43
  };
44
+ export type ObservedRootPath = {
45
+ resolved: ResolvedRootPath;
46
+ receipt?: RootPathObservationReceipt;
47
+ };
41
48
  export declare function resolveRootPath(params: ResolveRootPathParams): Promise<ResolvedRootPath>;
49
+ export declare function resolveRootPathWithCanonicalRootObservation(params: ResolveRootPathParams, observeRoot: (rootCanonicalPath: string) => void): Promise<ResolvedRootPath>;
50
+ export declare function resolveRootPathWithObservation(params: ResolveRootPathParams, request: RootPathObservationRequest): Promise<ObservedRootPath>;
51
+ export declare function resolveRootPathForRemoval(params: ResolveRootPathParams, receipts: RemovalPathReceipts): Promise<ResolvedRootPath>;
42
52
  export declare function resolveRootPathSync(params: ResolveRootPathParams): ResolvedRootPath;
53
+ export declare function resolveRootPathSyncWithCanonicalRootObservation(params: ResolveRootPathParams, observeRoot: (rootCanonicalPath: string) => void): ResolvedRootPath;
43
54
  //# sourceMappingURL=root-path.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"root-path.d.ts","sourceRoot":"","sources":["../src/root-path.ts"],"names":[],"mappings":"AAeA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,kCAAkC,EAAE,MAAM,yBAAyB,CAAC;AAE7E,KAAK,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEtE,MAAM,MAAM,mBAAmB,GAAG;IAChC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAEF,eAAO,MAAM,wBAAwB;aACnC,MAAM;;;;aAIN,YAAY;;;;CAIJ,CAAC;AAEX,KAAK,qBAAqB,GAAG;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,oBAAoB,CAAC;CACrC,CAAC;AAEF,KAAK,oBAAoB,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;AAEnF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,YAAY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